hyperbook 0.5.6 → 0.5.7

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -4
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- (()=>{var t={8889:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createFileSystemAdapter=r.FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);r.FILE_SYSTEM_ADAPTER={lstat:o.lstat,stat:o.stat,lstatSync:o.lstatSync,statSync:o.statSync,readdir:o.readdir,readdirSync:o.readdirSync};function createFileSystemAdapter(t){if(t===undefined){return r.FILE_SYSTEM_ADAPTER}return Object.assign(Object.assign({},r.FILE_SYSTEM_ADAPTER),t)}r.createFileSystemAdapter=createFileSystemAdapter},992:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;const i=process.versions.node.split(".");if(i[0]===undefined||i[1]===undefined){throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`)}const o=Number.parseInt(i[0],10);const a=Number.parseInt(i[1],10);const l=10;const c=10;const u=o>l;const h=o===l&&a>=c;r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=u||h},7287:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.scandirSync=r.scandir=void 0;const o=i(353);const a=i(7833);const l=i(3241);r.Settings=l.default;function scandir(t,r,i){if(typeof r==="function"){o.read(t,getSettings(),r);return}o.read(t,getSettings(r),i)}r.scandir=scandir;function scandirSync(t,r){const i=getSettings(r);return a.read(t,i)}r.scandirSync=scandirSync;function getSettings(t={}){if(t instanceof l.default){return t}return new l.default(t)}},353:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(5587);const a=i(4796);const l=i(992);const c=i(6480);const u=i(2147);function read(t,r,i){if(!r.stats&&l.IS_SUPPORT_READDIR_WITH_FILE_TYPES){readdirWithFileTypes(t,r,i);return}readdir(t,r,i)}r.read=read;function readdirWithFileTypes(t,r,i){r.fs.readdir(t,{withFileTypes:true},((o,l)=>{if(o!==null){callFailureCallback(i,o);return}const c=l.map((i=>({dirent:i,name:i.name,path:u.joinPathSegments(t,i.name,r.pathSegmentSeparator)})));if(!r.followSymbolicLinks){callSuccessCallback(i,c);return}const h=c.map((t=>makeRplTaskEntry(t,r)));a(h,((t,r)=>{if(t!==null){callFailureCallback(i,t);return}callSuccessCallback(i,r)}))}))}r.readdirWithFileTypes=readdirWithFileTypes;function makeRplTaskEntry(t,r){return i=>{if(!t.dirent.isSymbolicLink()){i(null,t);return}r.fs.stat(t.path,((o,a)=>{if(o!==null){if(r.throwErrorOnBrokenSymbolicLink){i(o);return}i(null,t);return}t.dirent=c.fs.createDirentFromStats(t.name,a);i(null,t)}))}}function readdir(t,r,i){r.fs.readdir(t,((l,h)=>{if(l!==null){callFailureCallback(i,l);return}const d=h.map((i=>{const a=u.joinPathSegments(t,i,r.pathSegmentSeparator);return t=>{o.stat(a,r.fsStatSettings,((o,l)=>{if(o!==null){t(o);return}const u={name:i,path:a,dirent:c.fs.createDirentFromStats(i,l)};if(r.stats){u.stats=l}t(null,u)}))}}));a(d,((t,r)=>{if(t!==null){callFailureCallback(i,t);return}callSuccessCallback(i,r)}))}))}r.readdir=readdir;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},2147:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.joinPathSegments=void 0;function joinPathSegments(t,r,i){if(t.endsWith(i)){return t+r}return t+i+r}r.joinPathSegments=joinPathSegments},7833:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(5587);const a=i(992);const l=i(6480);const c=i(2147);function read(t,r){if(!r.stats&&a.IS_SUPPORT_READDIR_WITH_FILE_TYPES){return readdirWithFileTypes(t,r)}return readdir(t,r)}r.read=read;function readdirWithFileTypes(t,r){const i=r.fs.readdirSync(t,{withFileTypes:true});return i.map((i=>{const o={dirent:i,name:i.name,path:c.joinPathSegments(t,i.name,r.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&r.followSymbolicLinks){try{const t=r.fs.statSync(o.path);o.dirent=l.fs.createDirentFromStats(o.name,t)}catch(t){if(r.throwErrorOnBrokenSymbolicLink){throw t}}}return o}))}r.readdirWithFileTypes=readdirWithFileTypes;function readdir(t,r){const i=r.fs.readdirSync(t);return i.map((i=>{const a=c.joinPathSegments(t,i,r.pathSegmentSeparator);const u=o.statSync(a,r.fsStatSettings);const h={name:i,path:a,dirent:l.fs.createDirentFromStats(i,u)};if(r.stats){h.stats=u}return h}))}r.readdir=readdir},3241:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(5587);const l=i(8889);class Settings{constructor(t={}){this._options=t;this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,false);this.fs=l.createFileSystemAdapter(this._options.fs);this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,o.sep);this.stats=this._getValue(this._options.stats,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true);this.fsStatSettings=new a.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},7345:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createDirentFromStats=void 0;class DirentFromStats{constructor(t,r){this.name=t;this.isBlockDevice=r.isBlockDevice.bind(r);this.isCharacterDevice=r.isCharacterDevice.bind(r);this.isDirectory=r.isDirectory.bind(r);this.isFIFO=r.isFIFO.bind(r);this.isFile=r.isFile.bind(r);this.isSocket=r.isSocket.bind(r);this.isSymbolicLink=r.isSymbolicLink.bind(r)}}function createDirentFromStats(t,r){return new DirentFromStats(t,r)}r.createDirentFromStats=createDirentFromStats},6480:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.fs=void 0;const o=i(7345);r.fs=o},72:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createFileSystemAdapter=r.FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);r.FILE_SYSTEM_ADAPTER={lstat:o.lstat,stat:o.stat,lstatSync:o.lstatSync,statSync:o.statSync};function createFileSystemAdapter(t){if(t===undefined){return r.FILE_SYSTEM_ADAPTER}return Object.assign(Object.assign({},r.FILE_SYSTEM_ADAPTER),t)}r.createFileSystemAdapter=createFileSystemAdapter},5587:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.statSync=r.stat=r.Settings=void 0;const o=i(5703);const a=i(2268);const l=i(5166);r.Settings=l.default;function stat(t,r,i){if(typeof r==="function"){o.read(t,getSettings(),r);return}o.read(t,getSettings(r),i)}r.stat=stat;function statSync(t,r){const i=getSettings(r);return a.read(t,i)}r.statSync=statSync;function getSettings(t={}){if(t instanceof l.default){return t}return new l.default(t)}},5703:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.read=void 0;function read(t,r,i){r.fs.lstat(t,((o,a)=>{if(o!==null){callFailureCallback(i,o);return}if(!a.isSymbolicLink()||!r.followSymbolicLink){callSuccessCallback(i,a);return}r.fs.stat(t,((t,o)=>{if(t!==null){if(r.throwErrorOnBrokenSymbolicLink){callFailureCallback(i,t);return}callSuccessCallback(i,a);return}if(r.markSymbolicLink){o.isSymbolicLink=()=>true}callSuccessCallback(i,o)}))}))}r.read=read;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},2268:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.read=void 0;function read(t,r){const i=r.fs.lstatSync(t);if(!i.isSymbolicLink()||!r.followSymbolicLink){return i}try{const i=r.fs.statSync(t);if(r.markSymbolicLink){i.isSymbolicLink=()=>true}return i}catch(t){if(!r.throwErrorOnBrokenSymbolicLink){return i}throw t}}r.read=read},5166:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(72);class Settings{constructor(t={}){this._options=t;this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,true);this.fs=o.createFileSystemAdapter(this._options.fs);this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true)}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},204:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.walkStream=r.walkSync=r.walk=void 0;const o=i(1321);const a=i(3951);const l=i(5286);const c=i(6736);r.Settings=c.default;function walk(t,r,i){if(typeof r==="function"){new o.default(t,getSettings()).read(r);return}new o.default(t,getSettings(r)).read(i)}r.walk=walk;function walkSync(t,r){const i=getSettings(r);const o=new l.default(t,i);return o.read()}r.walkSync=walkSync;function walkStream(t,r){const i=getSettings(r);const o=new a.default(t,i);return o.read()}r.walkStream=walkStream;function getSettings(t={}){if(t instanceof c.default){return t}return new c.default(t)}},1321:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(9556);class AsyncProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new o.default(this._root,this._settings);this._storage=[]}read(t){this._reader.onError((r=>{callFailureCallback(t,r)}));this._reader.onEntry((t=>{this._storage.push(t)}));this._reader.onEnd((()=>{callSuccessCallback(t,this._storage)}));this._reader.read()}}r["default"]=AsyncProvider;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},3951:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2781);const a=i(9556);class StreamProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new a.default(this._root,this._settings);this._stream=new o.Readable({objectMode:true,read:()=>{},destroy:()=>{if(!this._reader.isDestroyed){this._reader.destroy()}}})}read(){this._reader.onError((t=>{this._stream.emit("error",t)}));this._reader.onEntry((t=>{this._stream.push(t)}));this._reader.onEnd((()=>{this._stream.push(null)}));this._reader.read();return this._stream}}r["default"]=StreamProvider},5286:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(5446);class SyncProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new o.default(this._root,this._settings)}read(){return this._reader.read()}}r["default"]=SyncProvider},9556:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2361);const a=i(7287);const l=i(8205);const c=i(1771);const u=i(358);class AsyncReader extends u.default{constructor(t,r){super(t,r);this._settings=r;this._scandir=a.scandir;this._emitter=new o.EventEmitter;this._queue=l(this._worker.bind(this),this._settings.concurrency);this._isFatalError=false;this._isDestroyed=false;this._queue.drain=()=>{if(!this._isFatalError){this._emitter.emit("end")}}}read(){this._isFatalError=false;this._isDestroyed=false;setImmediate((()=>{this._pushToQueue(this._root,this._settings.basePath)}));return this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed){throw new Error("The reader is already destroyed")}this._isDestroyed=true;this._queue.killAndDrain()}onEntry(t){this._emitter.on("entry",t)}onError(t){this._emitter.once("error",t)}onEnd(t){this._emitter.once("end",t)}_pushToQueue(t,r){const i={directory:t,base:r};this._queue.push(i,(t=>{if(t!==null){this._handleError(t)}}))}_worker(t,r){this._scandir(t.directory,this._settings.fsScandirSettings,((i,o)=>{if(i!==null){r(i,undefined);return}for(const r of o){this._handleEntry(r,t.base)}r(null,undefined)}))}_handleError(t){if(this._isDestroyed||!c.isFatalError(this._settings,t)){return}this._isFatalError=true;this._isDestroyed=true;this._emitter.emit("error",t)}_handleEntry(t,r){if(this._isDestroyed||this._isFatalError){return}const i=t.path;if(r!==undefined){t.path=c.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)}if(c.isAppliedFilter(this._settings.entryFilter,t)){this._emitEntry(t)}if(t.dirent.isDirectory()&&c.isAppliedFilter(this._settings.deepFilter,t)){this._pushToQueue(i,r===undefined?undefined:t.path)}}_emitEntry(t){this._emitter.emit("entry",t)}}r["default"]=AsyncReader},1771:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.joinPathSegments=r.replacePathSegmentSeparator=r.isAppliedFilter=r.isFatalError=void 0;function isFatalError(t,r){if(t.errorFilter===null){return true}return!t.errorFilter(r)}r.isFatalError=isFatalError;function isAppliedFilter(t,r){return t===null||t(r)}r.isAppliedFilter=isAppliedFilter;function replacePathSegmentSeparator(t,r){return t.split(/[/\\]/).join(r)}r.replacePathSegmentSeparator=replacePathSegmentSeparator;function joinPathSegments(t,r,i){if(t===""){return r}if(t.endsWith(i)){return t+r}return t+i+r}r.joinPathSegments=joinPathSegments},358:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1771);class Reader{constructor(t,r){this._root=t;this._settings=r;this._root=o.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}}r["default"]=Reader},5446:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(7287);const a=i(1771);const l=i(358);class SyncReader extends l.default{constructor(){super(...arguments);this._scandir=o.scandirSync;this._storage=[];this._queue=new Set}read(){this._pushToQueue(this._root,this._settings.basePath);this._handleQueue();return this._storage}_pushToQueue(t,r){this._queue.add({directory:t,base:r})}_handleQueue(){for(const t of this._queue.values()){this._handleDirectory(t.directory,t.base)}}_handleDirectory(t,r){try{const i=this._scandir(t,this._settings.fsScandirSettings);for(const t of i){this._handleEntry(t,r)}}catch(t){this._handleError(t)}}_handleError(t){if(!a.isFatalError(this._settings,t)){return}throw t}_handleEntry(t,r){const i=t.path;if(r!==undefined){t.path=a.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)}if(a.isAppliedFilter(this._settings.entryFilter,t)){this._pushToStorage(t)}if(t.dirent.isDirectory()&&a.isAppliedFilter(this._settings.deepFilter,t)){this._pushToQueue(i,r===undefined?undefined:t.path)}}_pushToStorage(t){this._storage.push(t)}}r["default"]=SyncReader},6736:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(7287);class Settings{constructor(t={}){this._options=t;this.basePath=this._getValue(this._options.basePath,undefined);this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY);this.deepFilter=this._getValue(this._options.deepFilter,null);this.entryFilter=this._getValue(this._options.entryFilter,null);this.errorFilter=this._getValue(this._options.errorFilter,null);this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,o.sep);this.fsScandirSettings=new a.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},9620:(t,r,i)=>{var o=i(9165);var a=i(1017);var l=i(4332);var c=i(7843);var u=i(1418);var h=i(3443);var d=i(4966);var p=t.exports={};var m=/[\/\\]/g;var processPatterns=function(t,r){var i=[];l(t).forEach((function(t){var o=t.indexOf("!")===0;if(o){t=t.slice(1)}var a=r(t);if(o){i=c(i,a)}else{i=u(i,a)}}));return i};p.exists=function(){var t=a.join.apply(a,arguments);return o.existsSync(t)};p.expand=function(...t){var r=h(t[0])?t.shift():{};var i=Array.isArray(t[0])?t[0]:t;if(i.length===0){return[]}var l=processPatterns(i,(function(t){return d.sync(t,r)}));if(r.filter){l=l.filter((function(t){t=a.join(r.cwd||"",t);try{if(typeof r.filter==="function"){return r.filter(t)}else{return o.statSync(t)[r.filter]()}}catch(t){return false}}))}return l};p.expandMapping=function(t,r,i){i=Object.assign({rename:function(t,r){return a.join(t||"",r)}},i);var o=[];var l={};p.expand(i,t).forEach((function(t){var c=t;if(i.flatten){c=a.basename(c)}if(i.ext){c=c.replace(/(\.[^\/]*)?$/,i.ext)}var u=i.rename(r,c,i);if(i.cwd){t=a.join(i.cwd,t)}u=u.replace(m,"/");t=t.replace(m,"/");if(l[u]){l[u].src.push(t)}else{o.push({src:[t],dest:u});l[u]=o[o.length-1]}}));return o};p.normalizeFilesArray=function(t){var r=[];t.forEach((function(t){var i;if("src"in t||"dest"in t){r.push(t)}}));if(r.length===0){return[]}r=_(r).chain().forEach((function(t){if(!("src"in t)||!t.src){return}if(Array.isArray(t.src)){t.src=l(t.src)}else{t.src=[t.src]}})).map((function(t){var r=Object.assign({},t);delete r.src;delete r.dest;if(t.expand){return p.expandMapping(t.src,t.dest,r).map((function(r){var i=Object.assign({},t);i.orig=Object.assign({},t);i.src=r.src;i.dest=r.dest;["expand","cwd","flatten","rename","ext"].forEach((function(t){delete i[t]}));return i}))}var i=Object.assign({},t);i.orig=Object.assign({},t);if("src"in i){Object.defineProperty(i,"src",{enumerable:true,get:function fn(){var i;if(!("result"in fn)){i=t.src;i=Array.isArray(i)?l(i):[i];fn.result=p.expand(r,i)}return fn.result}})}if("dest"in i){i.dest=t.dest}return i})).flatten().value();return r}},1246:(t,r,i)=>{var o=i(9165);var a=i(1017);var l=i(3837);var c=i(9544);var u=i(4119);var h=i(9297);var d=i(2781).Stream;var p=i(8511).PassThrough;var m=t.exports={};m.file=i(9620);function assertPath(t){if(typeof t!=="string"){throw new TypeError("Path must be a string. Received "+nutils.inspect(t))}}m.collectStream=function(t,r){var i=[];var o=0;t.on("error",r);t.on("data",(function(t){i.push(t);o+=t.length}));t.on("end",(function(){var t=new Buffer(o);var a=0;i.forEach((function(r){r.copy(t,a);a+=r.length}));r(null,t)}))};m.dateify=function(t){t=t||new Date;if(t instanceof Date){t=t}else if(typeof t==="string"){t=new Date(t)}else{t=new Date}return t};m.defaults=function(t,r,i){var o=arguments;o[0]=o[0]||{};return h(...o)};m.isStream=function(t){return t instanceof d};m.lazyReadStream=function(t){return new c.Readable((function(){return o.createReadStream(t)}))};m.normalizeInputSource=function(t){if(t===null){return new Buffer(0)}else if(typeof t==="string"){return new Buffer(t)}else if(m.isStream(t)&&!t._readableState){var r=new p;t.pipe(r);return r}return t};m.sanitizePath=function(t){return u(t,false).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")};m.trailingSlashIt=function(t){return t.slice(-1)!=="/"?t+"/":t};m.unixifyPath=function(t){return u(t,false).replace(/^\w+:/,"")};m.walkdir=function(t,r,i){var l=[];if(typeof r==="function"){i=r;r=t}o.readdir(t,(function(c,u){var h=0;var d;var p;if(c){return i(c)}(function next(){d=u[h++];if(!d){return i(null,l)}p=a.join(t,d);o.stat(p,(function(t,i){l.push({path:p,relative:a.relative(r,p).replace(/\\/g,"/"),stats:i});if(i&&i.isDirectory()){m.walkdir(p,r,(function(t,r){r.forEach((function(t){l.push(t)}));next()}))}else{next()}}))})()}))}},2202:(t,r,i)=>{
2
+ (()=>{var t={8889:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createFileSystemAdapter=r.FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);r.FILE_SYSTEM_ADAPTER={lstat:o.lstat,stat:o.stat,lstatSync:o.lstatSync,statSync:o.statSync,readdir:o.readdir,readdirSync:o.readdirSync};function createFileSystemAdapter(t){if(t===undefined){return r.FILE_SYSTEM_ADAPTER}return Object.assign(Object.assign({},r.FILE_SYSTEM_ADAPTER),t)}r.createFileSystemAdapter=createFileSystemAdapter},992:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;const i=process.versions.node.split(".");if(i[0]===undefined||i[1]===undefined){throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`)}const o=Number.parseInt(i[0],10);const a=Number.parseInt(i[1],10);const l=10;const c=10;const u=o>l;const h=o===l&&a>=c;r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=u||h},7287:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.scandirSync=r.scandir=void 0;const o=i(353);const a=i(7833);const l=i(3241);r.Settings=l.default;function scandir(t,r,i){if(typeof r==="function"){o.read(t,getSettings(),r);return}o.read(t,getSettings(r),i)}r.scandir=scandir;function scandirSync(t,r){const i=getSettings(r);return a.read(t,i)}r.scandirSync=scandirSync;function getSettings(t={}){if(t instanceof l.default){return t}return new l.default(t)}},353:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(5587);const a=i(4796);const l=i(992);const c=i(6480);const u=i(2147);function read(t,r,i){if(!r.stats&&l.IS_SUPPORT_READDIR_WITH_FILE_TYPES){readdirWithFileTypes(t,r,i);return}readdir(t,r,i)}r.read=read;function readdirWithFileTypes(t,r,i){r.fs.readdir(t,{withFileTypes:true},((o,l)=>{if(o!==null){callFailureCallback(i,o);return}const c=l.map((i=>({dirent:i,name:i.name,path:u.joinPathSegments(t,i.name,r.pathSegmentSeparator)})));if(!r.followSymbolicLinks){callSuccessCallback(i,c);return}const h=c.map((t=>makeRplTaskEntry(t,r)));a(h,((t,r)=>{if(t!==null){callFailureCallback(i,t);return}callSuccessCallback(i,r)}))}))}r.readdirWithFileTypes=readdirWithFileTypes;function makeRplTaskEntry(t,r){return i=>{if(!t.dirent.isSymbolicLink()){i(null,t);return}r.fs.stat(t.path,((o,a)=>{if(o!==null){if(r.throwErrorOnBrokenSymbolicLink){i(o);return}i(null,t);return}t.dirent=c.fs.createDirentFromStats(t.name,a);i(null,t)}))}}function readdir(t,r,i){r.fs.readdir(t,((l,h)=>{if(l!==null){callFailureCallback(i,l);return}const d=h.map((i=>{const a=u.joinPathSegments(t,i,r.pathSegmentSeparator);return t=>{o.stat(a,r.fsStatSettings,((o,l)=>{if(o!==null){t(o);return}const u={name:i,path:a,dirent:c.fs.createDirentFromStats(i,l)};if(r.stats){u.stats=l}t(null,u)}))}}));a(d,((t,r)=>{if(t!==null){callFailureCallback(i,t);return}callSuccessCallback(i,r)}))}))}r.readdir=readdir;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},2147:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.joinPathSegments=void 0;function joinPathSegments(t,r,i){if(t.endsWith(i)){return t+r}return t+i+r}r.joinPathSegments=joinPathSegments},7833:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(5587);const a=i(992);const l=i(6480);const c=i(2147);function read(t,r){if(!r.stats&&a.IS_SUPPORT_READDIR_WITH_FILE_TYPES){return readdirWithFileTypes(t,r)}return readdir(t,r)}r.read=read;function readdirWithFileTypes(t,r){const i=r.fs.readdirSync(t,{withFileTypes:true});return i.map((i=>{const o={dirent:i,name:i.name,path:c.joinPathSegments(t,i.name,r.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&r.followSymbolicLinks){try{const t=r.fs.statSync(o.path);o.dirent=l.fs.createDirentFromStats(o.name,t)}catch(t){if(r.throwErrorOnBrokenSymbolicLink){throw t}}}return o}))}r.readdirWithFileTypes=readdirWithFileTypes;function readdir(t,r){const i=r.fs.readdirSync(t);return i.map((i=>{const a=c.joinPathSegments(t,i,r.pathSegmentSeparator);const u=o.statSync(a,r.fsStatSettings);const h={name:i,path:a,dirent:l.fs.createDirentFromStats(i,u)};if(r.stats){h.stats=u}return h}))}r.readdir=readdir},3241:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(5587);const l=i(8889);class Settings{constructor(t={}){this._options=t;this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,false);this.fs=l.createFileSystemAdapter(this._options.fs);this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,o.sep);this.stats=this._getValue(this._options.stats,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true);this.fsStatSettings=new a.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},7345:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createDirentFromStats=void 0;class DirentFromStats{constructor(t,r){this.name=t;this.isBlockDevice=r.isBlockDevice.bind(r);this.isCharacterDevice=r.isCharacterDevice.bind(r);this.isDirectory=r.isDirectory.bind(r);this.isFIFO=r.isFIFO.bind(r);this.isFile=r.isFile.bind(r);this.isSocket=r.isSocket.bind(r);this.isSymbolicLink=r.isSymbolicLink.bind(r)}}function createDirentFromStats(t,r){return new DirentFromStats(t,r)}r.createDirentFromStats=createDirentFromStats},6480:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.fs=void 0;const o=i(7345);r.fs=o},72:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createFileSystemAdapter=r.FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);r.FILE_SYSTEM_ADAPTER={lstat:o.lstat,stat:o.stat,lstatSync:o.lstatSync,statSync:o.statSync};function createFileSystemAdapter(t){if(t===undefined){return r.FILE_SYSTEM_ADAPTER}return Object.assign(Object.assign({},r.FILE_SYSTEM_ADAPTER),t)}r.createFileSystemAdapter=createFileSystemAdapter},5587:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.statSync=r.stat=r.Settings=void 0;const o=i(5703);const a=i(2268);const l=i(5166);r.Settings=l.default;function stat(t,r,i){if(typeof r==="function"){o.read(t,getSettings(),r);return}o.read(t,getSettings(r),i)}r.stat=stat;function statSync(t,r){const i=getSettings(r);return a.read(t,i)}r.statSync=statSync;function getSettings(t={}){if(t instanceof l.default){return t}return new l.default(t)}},5703:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.read=void 0;function read(t,r,i){r.fs.lstat(t,((o,a)=>{if(o!==null){callFailureCallback(i,o);return}if(!a.isSymbolicLink()||!r.followSymbolicLink){callSuccessCallback(i,a);return}r.fs.stat(t,((t,o)=>{if(t!==null){if(r.throwErrorOnBrokenSymbolicLink){callFailureCallback(i,t);return}callSuccessCallback(i,a);return}if(r.markSymbolicLink){o.isSymbolicLink=()=>true}callSuccessCallback(i,o)}))}))}r.read=read;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},2268:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.read=void 0;function read(t,r){const i=r.fs.lstatSync(t);if(!i.isSymbolicLink()||!r.followSymbolicLink){return i}try{const i=r.fs.statSync(t);if(r.markSymbolicLink){i.isSymbolicLink=()=>true}return i}catch(t){if(!r.throwErrorOnBrokenSymbolicLink){return i}throw t}}r.read=read},5166:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(72);class Settings{constructor(t={}){this._options=t;this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,true);this.fs=o.createFileSystemAdapter(this._options.fs);this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true)}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},204:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.walkStream=r.walkSync=r.walk=void 0;const o=i(1321);const a=i(3951);const l=i(5286);const c=i(6736);r.Settings=c.default;function walk(t,r,i){if(typeof r==="function"){new o.default(t,getSettings()).read(r);return}new o.default(t,getSettings(r)).read(i)}r.walk=walk;function walkSync(t,r){const i=getSettings(r);const o=new l.default(t,i);return o.read()}r.walkSync=walkSync;function walkStream(t,r){const i=getSettings(r);const o=new a.default(t,i);return o.read()}r.walkStream=walkStream;function getSettings(t={}){if(t instanceof c.default){return t}return new c.default(t)}},1321:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(9556);class AsyncProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new o.default(this._root,this._settings);this._storage=[]}read(t){this._reader.onError((r=>{callFailureCallback(t,r)}));this._reader.onEntry((t=>{this._storage.push(t)}));this._reader.onEnd((()=>{callSuccessCallback(t,this._storage)}));this._reader.read()}}r["default"]=AsyncProvider;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},3951:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2781);const a=i(9556);class StreamProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new a.default(this._root,this._settings);this._stream=new o.Readable({objectMode:true,read:()=>{},destroy:()=>{if(!this._reader.isDestroyed){this._reader.destroy()}}})}read(){this._reader.onError((t=>{this._stream.emit("error",t)}));this._reader.onEntry((t=>{this._stream.push(t)}));this._reader.onEnd((()=>{this._stream.push(null)}));this._reader.read();return this._stream}}r["default"]=StreamProvider},5286:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(5446);class SyncProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new o.default(this._root,this._settings)}read(){return this._reader.read()}}r["default"]=SyncProvider},9556:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2361);const a=i(7287);const l=i(8205);const c=i(1771);const u=i(358);class AsyncReader extends u.default{constructor(t,r){super(t,r);this._settings=r;this._scandir=a.scandir;this._emitter=new o.EventEmitter;this._queue=l(this._worker.bind(this),this._settings.concurrency);this._isFatalError=false;this._isDestroyed=false;this._queue.drain=()=>{if(!this._isFatalError){this._emitter.emit("end")}}}read(){this._isFatalError=false;this._isDestroyed=false;setImmediate((()=>{this._pushToQueue(this._root,this._settings.basePath)}));return this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed){throw new Error("The reader is already destroyed")}this._isDestroyed=true;this._queue.killAndDrain()}onEntry(t){this._emitter.on("entry",t)}onError(t){this._emitter.once("error",t)}onEnd(t){this._emitter.once("end",t)}_pushToQueue(t,r){const i={directory:t,base:r};this._queue.push(i,(t=>{if(t!==null){this._handleError(t)}}))}_worker(t,r){this._scandir(t.directory,this._settings.fsScandirSettings,((i,o)=>{if(i!==null){r(i,undefined);return}for(const r of o){this._handleEntry(r,t.base)}r(null,undefined)}))}_handleError(t){if(this._isDestroyed||!c.isFatalError(this._settings,t)){return}this._isFatalError=true;this._isDestroyed=true;this._emitter.emit("error",t)}_handleEntry(t,r){if(this._isDestroyed||this._isFatalError){return}const i=t.path;if(r!==undefined){t.path=c.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)}if(c.isAppliedFilter(this._settings.entryFilter,t)){this._emitEntry(t)}if(t.dirent.isDirectory()&&c.isAppliedFilter(this._settings.deepFilter,t)){this._pushToQueue(i,r===undefined?undefined:t.path)}}_emitEntry(t){this._emitter.emit("entry",t)}}r["default"]=AsyncReader},1771:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.joinPathSegments=r.replacePathSegmentSeparator=r.isAppliedFilter=r.isFatalError=void 0;function isFatalError(t,r){if(t.errorFilter===null){return true}return!t.errorFilter(r)}r.isFatalError=isFatalError;function isAppliedFilter(t,r){return t===null||t(r)}r.isAppliedFilter=isAppliedFilter;function replacePathSegmentSeparator(t,r){return t.split(/[/\\]/).join(r)}r.replacePathSegmentSeparator=replacePathSegmentSeparator;function joinPathSegments(t,r,i){if(t===""){return r}if(t.endsWith(i)){return t+r}return t+i+r}r.joinPathSegments=joinPathSegments},358:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1771);class Reader{constructor(t,r){this._root=t;this._settings=r;this._root=o.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}}r["default"]=Reader},5446:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(7287);const a=i(1771);const l=i(358);class SyncReader extends l.default{constructor(){super(...arguments);this._scandir=o.scandirSync;this._storage=[];this._queue=new Set}read(){this._pushToQueue(this._root,this._settings.basePath);this._handleQueue();return this._storage}_pushToQueue(t,r){this._queue.add({directory:t,base:r})}_handleQueue(){for(const t of this._queue.values()){this._handleDirectory(t.directory,t.base)}}_handleDirectory(t,r){try{const i=this._scandir(t,this._settings.fsScandirSettings);for(const t of i){this._handleEntry(t,r)}}catch(t){this._handleError(t)}}_handleError(t){if(!a.isFatalError(this._settings,t)){return}throw t}_handleEntry(t,r){const i=t.path;if(r!==undefined){t.path=a.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)}if(a.isAppliedFilter(this._settings.entryFilter,t)){this._pushToStorage(t)}if(t.dirent.isDirectory()&&a.isAppliedFilter(this._settings.deepFilter,t)){this._pushToQueue(i,r===undefined?undefined:t.path)}}_pushToStorage(t){this._storage.push(t)}}r["default"]=SyncReader},6736:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(7287);class Settings{constructor(t={}){this._options=t;this.basePath=this._getValue(this._options.basePath,undefined);this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY);this.deepFilter=this._getValue(this._options.deepFilter,null);this.entryFilter=this._getValue(this._options.entryFilter,null);this.errorFilter=this._getValue(this._options.errorFilter,null);this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,o.sep);this.fsScandirSettings=new a.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},9620:(t,r,i)=>{var o=i(9165);var a=i(1017);var l=i(4332);var c=i(7843);var u=i(1418);var h=i(3443);var d=i(4991);var p=t.exports={};var m=/[\/\\]/g;var processPatterns=function(t,r){var i=[];l(t).forEach((function(t){var o=t.indexOf("!")===0;if(o){t=t.slice(1)}var a=r(t);if(o){i=c(i,a)}else{i=u(i,a)}}));return i};p.exists=function(){var t=a.join.apply(a,arguments);return o.existsSync(t)};p.expand=function(...t){var r=h(t[0])?t.shift():{};var i=Array.isArray(t[0])?t[0]:t;if(i.length===0){return[]}var l=processPatterns(i,(function(t){return d.sync(t,r)}));if(r.filter){l=l.filter((function(t){t=a.join(r.cwd||"",t);try{if(typeof r.filter==="function"){return r.filter(t)}else{return o.statSync(t)[r.filter]()}}catch(t){return false}}))}return l};p.expandMapping=function(t,r,i){i=Object.assign({rename:function(t,r){return a.join(t||"",r)}},i);var o=[];var l={};p.expand(i,t).forEach((function(t){var c=t;if(i.flatten){c=a.basename(c)}if(i.ext){c=c.replace(/(\.[^\/]*)?$/,i.ext)}var u=i.rename(r,c,i);if(i.cwd){t=a.join(i.cwd,t)}u=u.replace(m,"/");t=t.replace(m,"/");if(l[u]){l[u].src.push(t)}else{o.push({src:[t],dest:u});l[u]=o[o.length-1]}}));return o};p.normalizeFilesArray=function(t){var r=[];t.forEach((function(t){var i;if("src"in t||"dest"in t){r.push(t)}}));if(r.length===0){return[]}r=_(r).chain().forEach((function(t){if(!("src"in t)||!t.src){return}if(Array.isArray(t.src)){t.src=l(t.src)}else{t.src=[t.src]}})).map((function(t){var r=Object.assign({},t);delete r.src;delete r.dest;if(t.expand){return p.expandMapping(t.src,t.dest,r).map((function(r){var i=Object.assign({},t);i.orig=Object.assign({},t);i.src=r.src;i.dest=r.dest;["expand","cwd","flatten","rename","ext"].forEach((function(t){delete i[t]}));return i}))}var i=Object.assign({},t);i.orig=Object.assign({},t);if("src"in i){Object.defineProperty(i,"src",{enumerable:true,get:function fn(){var i;if(!("result"in fn)){i=t.src;i=Array.isArray(i)?l(i):[i];fn.result=p.expand(r,i)}return fn.result}})}if("dest"in i){i.dest=t.dest}return i})).flatten().value();return r}},1246:(t,r,i)=>{var o=i(9165);var a=i(1017);var l=i(3837);var c=i(9544);var u=i(4119);var h=i(9297);var d=i(2781).Stream;var p=i(8511).PassThrough;var m=t.exports={};m.file=i(9620);function assertPath(t){if(typeof t!=="string"){throw new TypeError("Path must be a string. Received "+nutils.inspect(t))}}m.collectStream=function(t,r){var i=[];var o=0;t.on("error",r);t.on("data",(function(t){i.push(t);o+=t.length}));t.on("end",(function(){var t=new Buffer(o);var a=0;i.forEach((function(r){r.copy(t,a);a+=r.length}));r(null,t)}))};m.dateify=function(t){t=t||new Date;if(t instanceof Date){t=t}else if(typeof t==="string"){t=new Date(t)}else{t=new Date}return t};m.defaults=function(t,r,i){var o=arguments;o[0]=o[0]||{};return h(...o)};m.isStream=function(t){return t instanceof d};m.lazyReadStream=function(t){return new c.Readable((function(){return o.createReadStream(t)}))};m.normalizeInputSource=function(t){if(t===null){return new Buffer(0)}else if(typeof t==="string"){return new Buffer(t)}else if(m.isStream(t)&&!t._readableState){var r=new p;t.pipe(r);return r}return t};m.sanitizePath=function(t){return u(t,false).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")};m.trailingSlashIt=function(t){return t.slice(-1)!=="/"?t+"/":t};m.unixifyPath=function(t){return u(t,false).replace(/^\w+:/,"")};m.walkdir=function(t,r,i){var l=[];if(typeof r==="function"){i=r;r=t}o.readdir(t,(function(c,u){var h=0;var d;var p;if(c){return i(c)}(function next(){d=u[h++];if(!d){return i(null,l)}p=a.join(t,d);o.stat(p,(function(t,i){l.push({path:p,relative:a.relative(r,p).replace(/\\/g,"/"),stats:i});if(i&&i.isDirectory()){m.walkdir(p,r,(function(t,r){r.forEach((function(t){l.push(t)}));next()}))}else{next()}}))})()}))}},2202:(t,r,i)=>{
3
3
  /**
4
4
  * Archiver Vending
5
5
  *
@@ -81,7 +81,7 @@ var i;(function(t){if(typeof DO_NOT_EXPORT_CRC==="undefined"){if(true){t(r)}else
81
81
  *
82
82
  * Copyright (c) 2014-present, Jon Schlinkert.
83
83
  * Licensed under the MIT License.
84
- */const o=i(3837);const a=i(492);const isObject=t=>t!==null&&typeof t==="object"&&!Array.isArray(t);const transform=t=>r=>t===true?Number(r):String(r);const isValidValue=t=>typeof t==="number"||typeof t==="string"&&t!=="";const isNumber=t=>Number.isInteger(+t);const zeros=t=>{let r=`${t}`;let i=-1;if(r[0]==="-")r=r.slice(1);if(r==="0")return false;while(r[++i]==="0");return i>0};const stringify=(t,r,i)=>{if(typeof t==="string"||typeof r==="string"){return true}return i.stringify===true};const pad=(t,r,i)=>{if(r>0){let i=t[0]==="-"?"-":"";if(i)t=t.slice(1);t=i+t.padStart(i?r-1:r,"0")}if(i===false){return String(t)}return t};const toMaxLen=(t,r)=>{let i=t[0]==="-"?"-":"";if(i){t=t.slice(1);r--}while(t.length<r)t="0"+t;return i?"-"+t:t};const toSequence=(t,r)=>{t.negatives.sort(((t,r)=>t<r?-1:t>r?1:0));t.positives.sort(((t,r)=>t<r?-1:t>r?1:0));let i=r.capture?"":"?:";let o="";let a="";let l;if(t.positives.length){o=t.positives.join("|")}if(t.negatives.length){a=`-(${i}${t.negatives.join("|")})`}if(o&&a){l=`${o}|${a}`}else{l=o||a}if(r.wrap){return`(${i}${l})`}return l};const toRange=(t,r,i,o)=>{if(i){return a(t,r,{wrap:false,...o})}let l=String.fromCharCode(t);if(t===r)return l;let c=String.fromCharCode(r);return`[${l}-${c}]`};const toRegex=(t,r,i)=>{if(Array.isArray(t)){let r=i.wrap===true;let o=i.capture?"":"?:";return r?`(${o}${t.join("|")})`:t.join("|")}return a(t,r,i)};const rangeError=(...t)=>new RangeError("Invalid range arguments: "+o.inspect(...t));const invalidRange=(t,r,i)=>{if(i.strictRanges===true)throw rangeError([t,r]);return[]};const invalidStep=(t,r)=>{if(r.strictRanges===true){throw new TypeError(`Expected step "${t}" to be a number`)}return[]};const fillNumbers=(t,r,i=1,o={})=>{let a=Number(t);let l=Number(r);if(!Number.isInteger(a)||!Number.isInteger(l)){if(o.strictRanges===true)throw rangeError([t,r]);return[]}if(a===0)a=0;if(l===0)l=0;let c=a>l;let u=String(t);let h=String(r);let d=String(i);i=Math.max(Math.abs(i),1);let p=zeros(u)||zeros(h)||zeros(d);let m=p?Math.max(u.length,h.length,d.length):0;let y=p===false&&stringify(t,r,o)===false;let g=o.transform||transform(y);if(o.toRegex&&i===1){return toRange(toMaxLen(t,m),toMaxLen(r,m),true,o)}let b={negatives:[],positives:[]};let push=t=>b[t<0?"negatives":"positives"].push(Math.abs(t));let v=[];let _=0;while(c?a>=l:a<=l){if(o.toRegex===true&&i>1){push(a)}else{v.push(pad(g(a,_),m,y))}a=c?a-i:a+i;_++}if(o.toRegex===true){return i>1?toSequence(b,o):toRegex(v,null,{wrap:false,...o})}return v};const fillLetters=(t,r,i=1,o={})=>{if(!isNumber(t)&&t.length>1||!isNumber(r)&&r.length>1){return invalidRange(t,r,o)}let a=o.transform||(t=>String.fromCharCode(t));let l=`${t}`.charCodeAt(0);let c=`${r}`.charCodeAt(0);let u=l>c;let h=Math.min(l,c);let d=Math.max(l,c);if(o.toRegex&&i===1){return toRange(h,d,false,o)}let p=[];let m=0;while(u?l>=c:l<=c){p.push(a(l,m));l=u?l-i:l+i;m++}if(o.toRegex===true){return toRegex(p,null,{wrap:false,options:o})}return p};const fill=(t,r,i,o={})=>{if(r==null&&isValidValue(t)){return[t]}if(!isValidValue(t)||!isValidValue(r)){return invalidRange(t,r,o)}if(typeof i==="function"){return fill(t,r,1,{transform:i})}if(isObject(i)){return fill(t,r,0,i)}let a={...o};if(a.capture===true)a.wrap=true;i=i||a.step||1;if(!isNumber(i)){if(i!=null&&!isObject(i))return invalidStep(i,a);return fill(t,r,1,i)}if(isNumber(t)&&isNumber(r)){return fillNumbers(t,r,i,a)}return fillLetters(t,r,Math.max(Math.abs(i),1),a)};t.exports=fill},2439:(t,r,i)=>{t.exports=i(7147).constants||i(2057)},644:(t,r,i)=>{"use strict";const o=i(9974);const a=i(2361).EventEmitter;const l=i(7147);let c=l.writev;if(!c){const t=process.binding("fs");const r=t.FSReqWrap||t.FSReqCallback;c=(i,o,a,l)=>{const done=(t,r)=>l(t,r,o);const c=new r;c.oncomplete=done;t.writeBuffers(i,o,a,c)}}const u=Symbol("_autoClose");const h=Symbol("_close");const d=Symbol("_ended");const p=Symbol("_fd");const m=Symbol("_finished");const y=Symbol("_flags");const g=Symbol("_flush");const b=Symbol("_handleChunk");const v=Symbol("_makeBuf");const _=Symbol("_mode");const w=Symbol("_needDrain");const E=Symbol("_onerror");const S=Symbol("_onopen");const O=Symbol("_onread");const R=Symbol("_onwrite");const x=Symbol("_open");const k=Symbol("_path");const T=Symbol("_pos");const A=Symbol("_queue");const C=Symbol("_read");const P=Symbol("_readSize");const I=Symbol("_reading");const L=Symbol("_remain");const M=Symbol("_size");const D=Symbol("_write");const N=Symbol("_writing");const j=Symbol("_defaultFlag");const B=Symbol("_errored");class ReadStream extends o{constructor(t,r){r=r||{};super(r);this.readable=true;this.writable=false;if(typeof t!=="string")throw new TypeError("path must be a string");this[B]=false;this[p]=typeof r.fd==="number"?r.fd:null;this[k]=t;this[P]=r.readSize||16*1024*1024;this[I]=false;this[M]=typeof r.size==="number"?r.size:Infinity;this[L]=this[M];this[u]=typeof r.autoClose==="boolean"?r.autoClose:true;if(typeof this[p]==="number")this[C]();else this[x]()}get fd(){return this[p]}get path(){return this[k]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[x](){l.open(this[k],"r",((t,r)=>this[S](t,r)))}[S](t,r){if(t)this[E](t);else{this[p]=r;this.emit("open",r);this[C]()}}[v](){return Buffer.allocUnsafe(Math.min(this[P],this[L]))}[C](){if(!this[I]){this[I]=true;const t=this[v]();if(t.length===0)return process.nextTick((()=>this[O](null,0,t)));l.read(this[p],t,0,t.length,null,((t,r,i)=>this[O](t,r,i)))}}[O](t,r,i){this[I]=false;if(t)this[E](t);else if(this[b](r,i))this[C]()}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;l.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}[E](t){this[I]=true;this[h]();this.emit("error",t)}[b](t,r){let i=false;this[L]-=t;if(t>0)i=super.write(t<r.length?r.slice(0,t):r);if(t===0||this[L]<=0){i=false;this[h]();super.end()}return i}emit(t,r){switch(t){case"prefinish":case"finish":break;case"drain":if(typeof this[p]==="number")this[C]();break;case"error":if(this[B])return;this[B]=true;return super.emit(t,r);default:return super.emit(t,r)}}}class ReadStreamSync extends ReadStream{[x](){let t=true;try{this[S](null,l.openSync(this[k],"r"));t=false}finally{if(t)this[h]()}}[C](){let t=true;try{if(!this[I]){this[I]=true;do{const t=this[v]();const r=t.length===0?0:l.readSync(this[p],t,0,t.length,null);if(!this[b](r,t))break}while(true);this[I]=false}t=false}finally{if(t)this[h]()}}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;l.closeSync(t);this.emit("close")}}}class WriteStream extends a{constructor(t,r){r=r||{};super(r);this.readable=false;this.writable=true;this[B]=false;this[N]=false;this[d]=false;this[w]=false;this[A]=[];this[k]=t;this[p]=typeof r.fd==="number"?r.fd:null;this[_]=r.mode===undefined?438:r.mode;this[T]=typeof r.start==="number"?r.start:null;this[u]=typeof r.autoClose==="boolean"?r.autoClose:true;const i=this[T]!==null?"r+":"w";this[j]=r.flags===undefined;this[y]=this[j]?i:r.flags;if(this[p]===null)this[x]()}emit(t,r){if(t==="error"){if(this[B])return;this[B]=true}return super.emit(t,r)}get fd(){return this[p]}get path(){return this[k]}[E](t){this[h]();this[N]=true;this.emit("error",t)}[x](){l.open(this[k],this[y],this[_],((t,r)=>this[S](t,r)))}[S](t,r){if(this[j]&&this[y]==="r+"&&t&&t.code==="ENOENT"){this[y]="w";this[x]()}else if(t)this[E](t);else{this[p]=r;this.emit("open",r);this[g]()}}end(t,r){if(t)this.write(t,r);this[d]=true;if(!this[N]&&!this[A].length&&typeof this[p]==="number")this[R](null,0);return this}write(t,r){if(typeof t==="string")t=Buffer.from(t,r);if(this[d]){this.emit("error",new Error("write() after end()"));return false}if(this[p]===null||this[N]||this[A].length){this[A].push(t);this[w]=true;return false}this[N]=true;this[D](t);return true}[D](t){l.write(this[p],t,0,t.length,this[T],((t,r)=>this[R](t,r)))}[R](t,r){if(t)this[E](t);else{if(this[T]!==null)this[T]+=r;if(this[A].length)this[g]();else{this[N]=false;if(this[d]&&!this[m]){this[m]=true;this[h]();this.emit("finish")}else if(this[w]){this[w]=false;this.emit("drain")}}}}[g](){if(this[A].length===0){if(this[d])this[R](null,0)}else if(this[A].length===1)this[D](this[A].pop());else{const t=this[A];this[A]=[];c(this[p],t,this[T],((t,r)=>this[R](t,r)))}}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;l.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}}class WriteStreamSync extends WriteStream{[x](){let t;if(this[j]&&this[y]==="r+"){try{t=l.openSync(this[k],this[y],this[_])}catch(t){if(t.code==="ENOENT"){this[y]="w";return this[x]()}else throw t}}else t=l.openSync(this[k],this[y],this[_]);this[S](null,t)}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;l.closeSync(t);this.emit("close")}}[D](t){let r=true;try{this[R](null,l.writeSync(this[p],t,0,t.length,this[T]));r=false}finally{if(r)try{this[h]()}catch(t){}}}}r.ReadStream=ReadStream;r.ReadStreamSync=ReadStreamSync;r.WriteStream=WriteStream;r.WriteStreamSync=WriteStreamSync},3981:(t,r,i)=>{t.exports=realpath;realpath.realpath=realpath;realpath.sync=realpathSync;realpath.realpathSync=realpathSync;realpath.monkeypatch=monkeypatch;realpath.unmonkeypatch=unmonkeypatch;var o=i(7147);var a=o.realpath;var l=o.realpathSync;var c=process.version;var u=/^v[0-5]\./.test(c);var h=i(3623);function newError(t){return t&&t.syscall==="realpath"&&(t.code==="ELOOP"||t.code==="ENOMEM"||t.code==="ENAMETOOLONG")}function realpath(t,r,i){if(u){return a(t,r,i)}if(typeof r==="function"){i=r;r=null}a(t,r,(function(o,a){if(newError(o)){h.realpath(t,r,i)}else{i(o,a)}}))}function realpathSync(t,r){if(u){return l(t,r)}try{return l(t,r)}catch(i){if(newError(i)){return h.realpathSync(t,r)}else{throw i}}}function monkeypatch(){o.realpath=realpath;o.realpathSync=realpathSync}function unmonkeypatch(){o.realpath=a;o.realpathSync=l}},3623:(t,r,i)=>{var o=i(1017);var a=process.platform==="win32";var l=i(7147);var c=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function rethrow(){var t;if(c){var r=new Error;t=debugCallback}else t=missingCallback;return t;function debugCallback(t){if(t){r.message=t.message;t=r;missingCallback(t)}}function missingCallback(t){if(t){if(process.throwDeprecation)throw t;else if(!process.noDeprecation){var r="fs: missing callback "+(t.stack||t.message);if(process.traceDeprecation)console.trace(r);else console.error(r)}}}}function maybeCallback(t){return typeof t==="function"?t:rethrow()}var u=o.normalize;if(a){var h=/(.*?)(?:[\/\\]+|$)/g}else{var h=/(.*?)(?:[\/]+|$)/g}if(a){var d=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/}else{var d=/^[\/]*/}r.realpathSync=function realpathSync(t,r){t=o.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return r[t]}var i=t,c={},u={};var p;var m;var y;var g;start();function start(){var r=d.exec(t);p=r[0].length;m=r[0];y=r[0];g="";if(a&&!u[y]){l.lstatSync(y);u[y]=true}}while(p<t.length){h.lastIndex=p;var b=h.exec(t);g=m;m+=b[0];y=g+b[1];p=h.lastIndex;if(u[y]||r&&r[y]===y){continue}var v;if(r&&Object.prototype.hasOwnProperty.call(r,y)){v=r[y]}else{var _=l.lstatSync(y);if(!_.isSymbolicLink()){u[y]=true;if(r)r[y]=y;continue}var w=null;if(!a){var E=_.dev.toString(32)+":"+_.ino.toString(32);if(c.hasOwnProperty(E)){w=c[E]}}if(w===null){l.statSync(y);w=l.readlinkSync(y)}v=o.resolve(g,w);if(r)r[y]=v;if(!a)c[E]=w}t=o.resolve(v,t.slice(p));start()}if(r)r[i]=t;return t};r.realpath=function realpath(t,r,i){if(typeof i!=="function"){i=maybeCallback(r);r=null}t=o.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return process.nextTick(i.bind(null,null,r[t]))}var c=t,u={},p={};var m;var y;var g;var b;start();function start(){var r=d.exec(t);m=r[0].length;y=r[0];g=r[0];b="";if(a&&!p[g]){l.lstat(g,(function(t){if(t)return i(t);p[g]=true;LOOP()}))}else{process.nextTick(LOOP)}}function LOOP(){if(m>=t.length){if(r)r[c]=t;return i(null,t)}h.lastIndex=m;var o=h.exec(t);b=y;y+=o[0];g=b+o[1];m=h.lastIndex;if(p[g]||r&&r[g]===g){return process.nextTick(LOOP)}if(r&&Object.prototype.hasOwnProperty.call(r,g)){return gotResolvedLink(r[g])}return l.lstat(g,gotStat)}function gotStat(t,o){if(t)return i(t);if(!o.isSymbolicLink()){p[g]=true;if(r)r[g]=g;return process.nextTick(LOOP)}if(!a){var c=o.dev.toString(32)+":"+o.ino.toString(32);if(u.hasOwnProperty(c)){return gotTarget(null,u[c],g)}}l.stat(g,(function(t){if(t)return i(t);l.readlink(g,(function(t,r){if(!a)u[c]=r;gotTarget(t,r)}))}))}function gotTarget(t,a,l){if(t)return i(t);var c=o.resolve(b,a);if(r)r[l]=c;gotResolvedLink(c)}function gotResolvedLink(r){t=o.resolve(r,t.slice(m));start()}}},8898:(t,r,i)=>{"use strict";const{PassThrough:o}=i(2781);t.exports=t=>{t={...t};const{array:r}=t;let{encoding:i}=t;const a=i==="buffer";let l=false;if(r){l=!(i||a)}else{i=i||"utf8"}if(a){i=null}const c=new o({objectMode:l});if(i){c.setEncoding(i)}let u=0;const h=[];c.on("data",(t=>{h.push(t);if(l){u=h.length}else{u+=t.length}}));c.getBufferedValue=()=>{if(r){return h}return a?Buffer.concat(h,u):h.join("")};c.getBufferedLength=()=>u;return c}},367:(t,r,i)=>{"use strict";const{constants:o}=i(4300);const a=i(2781);const{promisify:l}=i(3837);const c=i(8898);const u=l(a.pipeline);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(t,r){if(!t){throw new Error("Expected a stream")}r={maxBuffer:Infinity,...r};const{maxBuffer:i}=r;const a=c(r);await new Promise(((r,l)=>{const rejectPromise=t=>{if(t&&a.getBufferedLength()<=o.MAX_LENGTH){t.bufferedData=a.getBufferedValue()}l(t)};(async()=>{try{await u(t,a);r()}catch(t){rejectPromise(t)}})();a.on("data",(()=>{if(a.getBufferedLength()>i){rejectPromise(new MaxBufferError)}}))}));return a.getBufferedValue()}t.exports=getStream;t.exports.buffer=(t,r)=>getStream(t,{...r,encoding:"buffer"});t.exports.array=(t,r)=>getStream(t,{...r,array:true});t.exports.MaxBufferError=MaxBufferError},7080:(t,r,i)=>{"use strict";var o=i(2755);var a=i(1017).posix.dirname;var l=i(2037).platform()==="win32";var c="/";var u=/\\/g;var h=/[\{\[].*[\}\]]$/;var d=/(^|[^\\])([\{\[]|\([^\)]+$)/;var p=/\\([\!\*\?\|\[\]\(\)\{\}])/g;t.exports=function globParent(t,r){var i=Object.assign({flipBackslashes:true},r);if(i.flipBackslashes&&l&&t.indexOf(c)<0){t=t.replace(u,c)}if(h.test(t)){t+=c}t+="a";do{t=a(t)}while(o(t)||d.test(t));return t.replace(p,"$1")}},4795:(t,r,i)=>{r.setopts=setopts;r.ownProp=ownProp;r.makeAbs=makeAbs;r.finish=finish;r.mark=mark;r.isIgnored=isIgnored;r.childrenIgnored=childrenIgnored;function ownProp(t,r){return Object.prototype.hasOwnProperty.call(t,r)}var o=i(7147);var a=i(1017);var l=i(8923);var c=i(6230);var u=l.Minimatch;function alphasort(t,r){return t.localeCompare(r,"en")}function setupIgnores(t,r){t.ignore=r.ignore||[];if(!Array.isArray(t.ignore))t.ignore=[t.ignore];if(t.ignore.length){t.ignore=t.ignore.map(ignoreMap)}}function ignoreMap(t){var r=null;if(t.slice(-3)==="/**"){var i=t.replace(/(\/\*\*)+$/,"");r=new u(i,{dot:true})}return{matcher:new u(t,{dot:true}),gmatcher:r}}function setopts(t,r,i){if(!i)i={};if(i.matchBase&&-1===r.indexOf("/")){if(i.noglobstar){throw new Error("base matching requires globstar")}r="**/"+r}t.silent=!!i.silent;t.pattern=r;t.strict=i.strict!==false;t.realpath=!!i.realpath;t.realpathCache=i.realpathCache||Object.create(null);t.follow=!!i.follow;t.dot=!!i.dot;t.mark=!!i.mark;t.nodir=!!i.nodir;if(t.nodir)t.mark=true;t.sync=!!i.sync;t.nounique=!!i.nounique;t.nonull=!!i.nonull;t.nosort=!!i.nosort;t.nocase=!!i.nocase;t.stat=!!i.stat;t.noprocess=!!i.noprocess;t.absolute=!!i.absolute;t.fs=i.fs||o;t.maxLength=i.maxLength||Infinity;t.cache=i.cache||Object.create(null);t.statCache=i.statCache||Object.create(null);t.symlinks=i.symlinks||Object.create(null);setupIgnores(t,i);t.changedCwd=false;var l=process.cwd();if(!ownProp(i,"cwd"))t.cwd=l;else{t.cwd=a.resolve(i.cwd);t.changedCwd=t.cwd!==l}t.root=i.root||a.resolve(t.cwd,"/");t.root=a.resolve(t.root);if(process.platform==="win32")t.root=t.root.replace(/\\/g,"/");t.cwdAbs=c(t.cwd)?t.cwd:makeAbs(t,t.cwd);if(process.platform==="win32")t.cwdAbs=t.cwdAbs.replace(/\\/g,"/");t.nomount=!!i.nomount;i.nonegate=true;i.nocomment=true;t.minimatch=new u(r,i);t.options=t.minimatch.options}function finish(t){var r=t.nounique;var i=r?[]:Object.create(null);for(var o=0,a=t.matches.length;o<a;o++){var l=t.matches[o];if(!l||Object.keys(l).length===0){if(t.nonull){var c=t.minimatch.globSet[o];if(r)i.push(c);else i[c]=true}}else{var u=Object.keys(l);if(r)i.push.apply(i,u);else u.forEach((function(t){i[t]=true}))}}if(!r)i=Object.keys(i);if(!t.nosort)i=i.sort(alphasort);if(t.mark){for(var o=0;o<i.length;o++){i[o]=t._mark(i[o])}if(t.nodir){i=i.filter((function(r){var i=!/\/$/.test(r);var o=t.cache[r]||t.cache[makeAbs(t,r)];if(i&&o)i=o!=="DIR"&&!Array.isArray(o);return i}))}}if(t.ignore.length)i=i.filter((function(r){return!isIgnored(t,r)}));t.found=i}function mark(t,r){var i=makeAbs(t,r);var o=t.cache[i];var a=r;if(o){var l=o==="DIR"||Array.isArray(o);var c=r.slice(-1)==="/";if(l&&!c)a+="/";else if(!l&&c)a=a.slice(0,-1);if(a!==r){var u=makeAbs(t,a);t.statCache[u]=t.statCache[i];t.cache[u]=t.cache[i]}}return a}function makeAbs(t,r){var i=r;if(r.charAt(0)==="/"){i=a.join(t.root,r)}else if(c(r)||r===""){i=r}else if(t.changedCwd){i=a.resolve(t.cwd,r)}else{i=a.resolve(r)}if(process.platform==="win32")i=i.replace(/\\/g,"/");return i}function isIgnored(t,r){if(!t.ignore.length)return false;return t.ignore.some((function(t){return t.matcher.match(r)||!!(t.gmatcher&&t.gmatcher.match(r))}))}function childrenIgnored(t,r){if(!t.ignore.length)return false;return t.ignore.some((function(t){return!!(t.gmatcher&&t.gmatcher.match(r))}))}},4966:(t,r,i)=>{t.exports=glob;var o=i(3981);var a=i(8923);var l=a.Minimatch;var c=i(2842);var u=i(2361).EventEmitter;var h=i(1017);var d=i(9491);var p=i(6230);var m=i(9395);var y=i(4795);var g=y.setopts;var b=y.ownProp;var v=i(8143);var _=i(3837);var w=y.childrenIgnored;var E=y.isIgnored;var S=i(9852);function glob(t,r,i){if(typeof r==="function")i=r,r={};if(!r)r={};if(r.sync){if(i)throw new TypeError("callback provided to sync glob");return m(t,r)}return new Glob(t,r,i)}glob.sync=m;var O=glob.GlobSync=m.GlobSync;glob.glob=glob;function extend(t,r){if(r===null||typeof r!=="object"){return t}var i=Object.keys(r);var o=i.length;while(o--){t[i[o]]=r[i[o]]}return t}glob.hasMagic=function(t,r){var i=extend({},r);i.noprocess=true;var o=new Glob(t,i);var a=o.minimatch.set;if(!t)return false;if(a.length>1)return true;for(var l=0;l<a[0].length;l++){if(typeof a[0][l]!=="string")return true}return false};glob.Glob=Glob;c(Glob,u);function Glob(t,r,i){if(typeof r==="function"){i=r;r=null}if(r&&r.sync){if(i)throw new TypeError("callback provided to sync glob");return new O(t,r)}if(!(this instanceof Glob))return new Glob(t,r,i);g(this,t,r);this._didRealPath=false;var o=this.minimatch.set.length;this.matches=new Array(o);if(typeof i==="function"){i=S(i);this.on("error",i);this.on("end",(function(t){i(null,t)}))}var a=this;this._processing=0;this._emitQueue=[];this._processQueue=[];this.paused=false;if(this.noprocess)return this;if(o===0)return done();var l=true;for(var c=0;c<o;c++){this._process(this.minimatch.set[c],c,false,done)}l=false;function done(){--a._processing;if(a._processing<=0){if(l){process.nextTick((function(){a._finish()}))}else{a._finish()}}}}Glob.prototype._finish=function(){d(this instanceof Glob);if(this.aborted)return;if(this.realpath&&!this._didRealpath)return this._realpath();y.finish(this);this.emit("end",this.found)};Glob.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=true;var t=this.matches.length;if(t===0)return this._finish();var r=this;for(var i=0;i<this.matches.length;i++)this._realpathSet(i,next);function next(){if(--t===0)r._finish()}};Glob.prototype._realpathSet=function(t,r){var i=this.matches[t];if(!i)return r();var a=Object.keys(i);var l=this;var c=a.length;if(c===0)return r();var u=this.matches[t]=Object.create(null);a.forEach((function(i,a){i=l._makeAbs(i);o.realpath(i,l.realpathCache,(function(o,a){if(!o)u[a]=true;else if(o.syscall==="stat")u[i]=true;else l.emit("error",o);if(--c===0){l.matches[t]=u;r()}}))}))};Glob.prototype._mark=function(t){return y.mark(this,t)};Glob.prototype._makeAbs=function(t){return y.makeAbs(this,t)};Glob.prototype.abort=function(){this.aborted=true;this.emit("abort")};Glob.prototype.pause=function(){if(!this.paused){this.paused=true;this.emit("pause")}};Glob.prototype.resume=function(){if(this.paused){this.emit("resume");this.paused=false;if(this._emitQueue.length){var t=this._emitQueue.slice(0);this._emitQueue.length=0;for(var r=0;r<t.length;r++){var i=t[r];this._emitMatch(i[0],i[1])}}if(this._processQueue.length){var o=this._processQueue.slice(0);this._processQueue.length=0;for(var r=0;r<o.length;r++){var a=o[r];this._processing--;this._process(a[0],a[1],a[2],a[3])}}}};Glob.prototype._process=function(t,r,i,o){d(this instanceof Glob);d(typeof o==="function");if(this.aborted)return;this._processing++;if(this.paused){this._processQueue.push([t,r,i,o]);return}var l=0;while(typeof t[l]==="string"){l++}var c;switch(l){case t.length:this._processSimple(t.join("/"),r,o);return;case 0:c=null;break;default:c=t.slice(0,l).join("/");break}var u=t.slice(l);var h;if(c===null)h=".";else if(p(c)||p(t.join("/"))){if(!c||!p(c))c="/"+c;h=c}else h=c;var m=this._makeAbs(h);if(w(this,h))return o();var y=u[0]===a.GLOBSTAR;if(y)this._processGlobStar(c,h,m,u,r,i,o);else this._processReaddir(c,h,m,u,r,i,o)};Glob.prototype._processReaddir=function(t,r,i,o,a,l,c){var u=this;this._readdir(i,l,(function(h,d){return u._processReaddir2(t,r,i,o,a,l,d,c)}))};Glob.prototype._processReaddir2=function(t,r,i,o,a,l,c,u){if(!c)return u();var d=o[0];var p=!!this.minimatch.negate;var m=d._glob;var y=this.dot||m.charAt(0)===".";var g=[];for(var b=0;b<c.length;b++){var v=c[b];if(v.charAt(0)!=="."||y){var _;if(p&&!t){_=!v.match(d)}else{_=v.match(d)}if(_)g.push(v)}}var w=g.length;if(w===0)return u();if(o.length===1&&!this.mark&&!this.stat){if(!this.matches[a])this.matches[a]=Object.create(null);for(var b=0;b<w;b++){var v=g[b];if(t){if(t!=="/")v=t+"/"+v;else v=t+v}if(v.charAt(0)==="/"&&!this.nomount){v=h.join(this.root,v)}this._emitMatch(a,v)}return u()}o.shift();for(var b=0;b<w;b++){var v=g[b];var E;if(t){if(t!=="/")v=t+"/"+v;else v=t+v}this._process([v].concat(o),a,l,u)}u()};Glob.prototype._emitMatch=function(t,r){if(this.aborted)return;if(E(this,r))return;if(this.paused){this._emitQueue.push([t,r]);return}var i=p(r)?r:this._makeAbs(r);if(this.mark)r=this._mark(r);if(this.absolute)r=i;if(this.matches[t][r])return;if(this.nodir){var o=this.cache[i];if(o==="DIR"||Array.isArray(o))return}this.matches[t][r]=true;var a=this.statCache[i];if(a)this.emit("stat",r,a);this.emit("match",r)};Glob.prototype._readdirInGlobStar=function(t,r){if(this.aborted)return;if(this.follow)return this._readdir(t,false,r);var i="lstat\0"+t;var o=this;var a=v(i,lstatcb_);if(a)o.fs.lstat(t,a);function lstatcb_(i,a){if(i&&i.code==="ENOENT")return r();var l=a&&a.isSymbolicLink();o.symlinks[t]=l;if(!l&&a&&!a.isDirectory()){o.cache[t]="FILE";r()}else o._readdir(t,false,r)}};Glob.prototype._readdir=function(t,r,i){if(this.aborted)return;i=v("readdir\0"+t+"\0"+r,i);if(!i)return;if(r&&!b(this.symlinks,t))return this._readdirInGlobStar(t,i);if(b(this.cache,t)){var o=this.cache[t];if(!o||o==="FILE")return i();if(Array.isArray(o))return i(null,o)}var a=this;a.fs.readdir(t,readdirCb(this,t,i))};function readdirCb(t,r,i){return function(o,a){if(o)t._readdirError(r,o,i);else t._readdirEntries(r,a,i)}}Glob.prototype._readdirEntries=function(t,r,i){if(this.aborted)return;if(!this.mark&&!this.stat){for(var o=0;o<r.length;o++){var a=r[o];if(t==="/")a=t+a;else a=t+"/"+a;this.cache[a]=true}}this.cache[t]=r;return i(null,r)};Glob.prototype._readdirError=function(t,r,i){if(this.aborted)return;switch(r.code){case"ENOTSUP":case"ENOTDIR":var o=this._makeAbs(t);this.cache[o]="FILE";if(o===this.cwdAbs){var a=new Error(r.code+" invalid cwd "+this.cwd);a.path=this.cwd;a.code=r.code;this.emit("error",a);this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=false;break;default:this.cache[this._makeAbs(t)]=false;if(this.strict){this.emit("error",r);this.abort()}if(!this.silent)console.error("glob error",r);break}return i()};Glob.prototype._processGlobStar=function(t,r,i,o,a,l,c){var u=this;this._readdir(i,l,(function(h,d){u._processGlobStar2(t,r,i,o,a,l,d,c)}))};Glob.prototype._processGlobStar2=function(t,r,i,o,a,l,c,u){if(!c)return u();var h=o.slice(1);var d=t?[t]:[];var p=d.concat(h);this._process(p,a,false,u);var m=this.symlinks[i];var y=c.length;if(m&&l)return u();for(var g=0;g<y;g++){var b=c[g];if(b.charAt(0)==="."&&!this.dot)continue;var v=d.concat(c[g],h);this._process(v,a,true,u);var _=d.concat(c[g],o);this._process(_,a,true,u)}u()};Glob.prototype._processSimple=function(t,r,i){var o=this;this._stat(t,(function(a,l){o._processSimple2(t,r,a,l,i)}))};Glob.prototype._processSimple2=function(t,r,i,o,a){if(!this.matches[r])this.matches[r]=Object.create(null);if(!o)return a();if(t&&p(t)&&!this.nomount){var l=/[\/\\]$/.test(t);if(t.charAt(0)==="/"){t=h.join(this.root,t)}else{t=h.resolve(this.root,t);if(l)t+="/"}}if(process.platform==="win32")t=t.replace(/\\/g,"/");this._emitMatch(r,t);a()};Glob.prototype._stat=function(t,r){var i=this._makeAbs(t);var o=t.slice(-1)==="/";if(t.length>this.maxLength)return r();if(!this.stat&&b(this.cache,i)){var a=this.cache[i];if(Array.isArray(a))a="DIR";if(!o||a==="DIR")return r(null,a);if(o&&a==="FILE")return r()}var l;var c=this.statCache[i];if(c!==undefined){if(c===false)return r(null,c);else{var u=c.isDirectory()?"DIR":"FILE";if(o&&u==="FILE")return r();else return r(null,u,c)}}var h=this;var d=v("stat\0"+i,lstatcb_);if(d)h.fs.lstat(i,d);function lstatcb_(o,a){if(a&&a.isSymbolicLink()){return h.fs.stat(i,(function(o,l){if(o)h._stat2(t,i,null,a,r);else h._stat2(t,i,o,l,r)}))}else{h._stat2(t,i,o,a,r)}}};Glob.prototype._stat2=function(t,r,i,o,a){if(i&&(i.code==="ENOENT"||i.code==="ENOTDIR")){this.statCache[r]=false;return a()}var l=t.slice(-1)==="/";this.statCache[r]=o;if(r.slice(-1)==="/"&&o&&!o.isDirectory())return a(null,false,o);var c=true;if(o)c=o.isDirectory()?"DIR":"FILE";this.cache[r]=this.cache[r]||c;if(l&&c==="FILE")return a();return a(null,c,o)}},9395:(t,r,i)=>{t.exports=globSync;globSync.GlobSync=GlobSync;var o=i(3981);var a=i(8923);var l=a.Minimatch;var c=i(4966).Glob;var u=i(3837);var h=i(1017);var d=i(9491);var p=i(6230);var m=i(4795);var y=m.setopts;var g=m.ownProp;var b=m.childrenIgnored;var v=m.isIgnored;function globSync(t,r){if(typeof r==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");return new GlobSync(t,r).found}function GlobSync(t,r){if(!t)throw new Error("must provide pattern");if(typeof r==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof GlobSync))return new GlobSync(t,r);y(this,t,r);if(this.noprocess)return this;var i=this.minimatch.set.length;this.matches=new Array(i);for(var o=0;o<i;o++){this._process(this.minimatch.set[o],o,false)}this._finish()}GlobSync.prototype._finish=function(){d(this instanceof GlobSync);if(this.realpath){var t=this;this.matches.forEach((function(r,i){var a=t.matches[i]=Object.create(null);for(var l in r){try{l=t._makeAbs(l);var c=o.realpathSync(l,t.realpathCache);a[c]=true}catch(r){if(r.syscall==="stat")a[t._makeAbs(l)]=true;else throw r}}}))}m.finish(this)};GlobSync.prototype._process=function(t,r,i){d(this instanceof GlobSync);var o=0;while(typeof t[o]==="string"){o++}var l;switch(o){case t.length:this._processSimple(t.join("/"),r);return;case 0:l=null;break;default:l=t.slice(0,o).join("/");break}var c=t.slice(o);var u;if(l===null)u=".";else if(p(l)||p(t.join("/"))){if(!l||!p(l))l="/"+l;u=l}else u=l;var h=this._makeAbs(u);if(b(this,u))return;var m=c[0]===a.GLOBSTAR;if(m)this._processGlobStar(l,u,h,c,r,i);else this._processReaddir(l,u,h,c,r,i)};GlobSync.prototype._processReaddir=function(t,r,i,o,a,l){var c=this._readdir(i,l);if(!c)return;var u=o[0];var d=!!this.minimatch.negate;var p=u._glob;var m=this.dot||p.charAt(0)===".";var y=[];for(var g=0;g<c.length;g++){var b=c[g];if(b.charAt(0)!=="."||m){var v;if(d&&!t){v=!b.match(u)}else{v=b.match(u)}if(v)y.push(b)}}var _=y.length;if(_===0)return;if(o.length===1&&!this.mark&&!this.stat){if(!this.matches[a])this.matches[a]=Object.create(null);for(var g=0;g<_;g++){var b=y[g];if(t){if(t.slice(-1)!=="/")b=t+"/"+b;else b=t+b}if(b.charAt(0)==="/"&&!this.nomount){b=h.join(this.root,b)}this._emitMatch(a,b)}return}o.shift();for(var g=0;g<_;g++){var b=y[g];var w;if(t)w=[t,b];else w=[b];this._process(w.concat(o),a,l)}};GlobSync.prototype._emitMatch=function(t,r){if(v(this,r))return;var i=this._makeAbs(r);if(this.mark)r=this._mark(r);if(this.absolute){r=i}if(this.matches[t][r])return;if(this.nodir){var o=this.cache[i];if(o==="DIR"||Array.isArray(o))return}this.matches[t][r]=true;if(this.stat)this._stat(r)};GlobSync.prototype._readdirInGlobStar=function(t){if(this.follow)return this._readdir(t,false);var r;var i;var o;try{i=this.fs.lstatSync(t)}catch(t){if(t.code==="ENOENT"){return null}}var a=i&&i.isSymbolicLink();this.symlinks[t]=a;if(!a&&i&&!i.isDirectory())this.cache[t]="FILE";else r=this._readdir(t,false);return r};GlobSync.prototype._readdir=function(t,r){var i;if(r&&!g(this.symlinks,t))return this._readdirInGlobStar(t);if(g(this.cache,t)){var o=this.cache[t];if(!o||o==="FILE")return null;if(Array.isArray(o))return o}try{return this._readdirEntries(t,this.fs.readdirSync(t))}catch(r){this._readdirError(t,r);return null}};GlobSync.prototype._readdirEntries=function(t,r){if(!this.mark&&!this.stat){for(var i=0;i<r.length;i++){var o=r[i];if(t==="/")o=t+o;else o=t+"/"+o;this.cache[o]=true}}this.cache[t]=r;return r};GlobSync.prototype._readdirError=function(t,r){switch(r.code){case"ENOTSUP":case"ENOTDIR":var i=this._makeAbs(t);this.cache[i]="FILE";if(i===this.cwdAbs){var o=new Error(r.code+" invalid cwd "+this.cwd);o.path=this.cwd;o.code=r.code;throw o}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=false;break;default:this.cache[this._makeAbs(t)]=false;if(this.strict)throw r;if(!this.silent)console.error("glob error",r);break}};GlobSync.prototype._processGlobStar=function(t,r,i,o,a,l){var c=this._readdir(i,l);if(!c)return;var u=o.slice(1);var h=t?[t]:[];var d=h.concat(u);this._process(d,a,false);var p=c.length;var m=this.symlinks[i];if(m&&l)return;for(var y=0;y<p;y++){var g=c[y];if(g.charAt(0)==="."&&!this.dot)continue;var b=h.concat(c[y],u);this._process(b,a,true);var v=h.concat(c[y],o);this._process(v,a,true)}};GlobSync.prototype._processSimple=function(t,r){var i=this._stat(t);if(!this.matches[r])this.matches[r]=Object.create(null);if(!i)return;if(t&&p(t)&&!this.nomount){var o=/[\/\\]$/.test(t);if(t.charAt(0)==="/"){t=h.join(this.root,t)}else{t=h.resolve(this.root,t);if(o)t+="/"}}if(process.platform==="win32")t=t.replace(/\\/g,"/");this._emitMatch(r,t)};GlobSync.prototype._stat=function(t){var r=this._makeAbs(t);var i=t.slice(-1)==="/";if(t.length>this.maxLength)return false;if(!this.stat&&g(this.cache,r)){var o=this.cache[r];if(Array.isArray(o))o="DIR";if(!i||o==="DIR")return o;if(i&&o==="FILE")return false}var a;var l=this.statCache[r];if(!l){var c;try{c=this.fs.lstatSync(r)}catch(t){if(t&&(t.code==="ENOENT"||t.code==="ENOTDIR")){this.statCache[r]=false;return false}}if(c&&c.isSymbolicLink()){try{l=this.fs.statSync(r)}catch(t){l=c}}else{l=c}}this.statCache[r]=l;var o=true;if(l)o=l.isDirectory()?"DIR":"FILE";this.cache[r]=this.cache[r]||o;if(i&&o==="FILE")return false;return o};GlobSync.prototype._mark=function(t){return m.mark(this,t)};GlobSync.prototype._makeAbs=function(t){return m.makeAbs(this,t)}},4444:t=>{"use strict";t.exports=clone;var r=Object.getPrototypeOf||function(t){return t.__proto__};function clone(t){if(t===null||typeof t!=="object")return t;if(t instanceof Object)var i={__proto__:r(t)};else var i=Object.create(null);Object.getOwnPropertyNames(t).forEach((function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))}));return i}},9165:(t,r,i)=>{var o=i(7147);var a=i(8986);var l=i(7078);var c=i(4444);var u=i(3837);var h;var d;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){h=Symbol.for("graceful-fs.queue");d=Symbol.for("graceful-fs.previous")}else{h="___graceful-fs.queue";d="___graceful-fs.previous"}function noop(){}function publishQueue(t,r){Object.defineProperty(t,h,{get:function(){return r}})}var p=noop;if(u.debuglog)p=u.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))p=function(){var t=u.format.apply(u,arguments);t="GFS4: "+t.split(/\n/).join("\nGFS4: ");console.error(t)};if(!o[h]){var m=global[h]||[];publishQueue(o,m);o.close=function(t){function close(r,i){return t.call(o,r,(function(t){if(!t){resetQueue()}if(typeof i==="function")i.apply(this,arguments)}))}Object.defineProperty(close,d,{value:t});return close}(o.close);o.closeSync=function(t){function closeSync(r){t.apply(o,arguments);resetQueue()}Object.defineProperty(closeSync,d,{value:t});return closeSync}(o.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){p(o[h]);i(9491).equal(o[h].length,0)}))}}if(!global[h]){publishQueue(global,o[h])}t.exports=patch(c(o));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!o.__patched){t.exports=patch(o);o.__patched=true}function patch(t){a(t);t.gracefulify=patch;t.createReadStream=createReadStream;t.createWriteStream=createWriteStream;var r=t.readFile;t.readFile=readFile;function readFile(t,i,o){if(typeof i==="function")o=i,i=null;return go$readFile(t,i,o);function go$readFile(t,i,o,a){return r(t,i,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$readFile,[t,i,o],r,a||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var i=t.writeFile;t.writeFile=writeFile;function writeFile(t,r,o,a){if(typeof o==="function")a=o,o=null;return go$writeFile(t,r,o,a);function go$writeFile(t,r,o,a,l){return i(t,r,o,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$writeFile,[t,r,o,a],i,l||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var o=t.appendFile;if(o)t.appendFile=appendFile;function appendFile(t,r,i,a){if(typeof i==="function")a=i,i=null;return go$appendFile(t,r,i,a);function go$appendFile(t,r,i,a,l){return o(t,r,i,(function(o){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$appendFile,[t,r,i,a],o,l||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var c=t.copyFile;if(c)t.copyFile=copyFile;function copyFile(t,r,i,o){if(typeof i==="function"){o=i;i=0}return go$copyFile(t,r,i,o);function go$copyFile(t,r,i,o,a){return c(t,r,i,(function(l){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))enqueue([go$copyFile,[t,r,i,o],l,a||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var u=t.readdir;t.readdir=readdir;var h=/^v[0-5]\./;function readdir(t,r,i){if(typeof r==="function")i=r,r=null;var o=h.test(process.version)?function go$readdir(t,r,i,o){return u(t,fs$readdirCallback(t,r,i,o))}:function go$readdir(t,r,i,o){return u(t,r,fs$readdirCallback(t,r,i,o))};return o(t,r,i);function fs$readdirCallback(t,r,i,a){return function(l,c){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))enqueue([o,[t,r,i],l,a||Date.now(),Date.now()]);else{if(c&&c.sort)c.sort();if(typeof i==="function")i.call(this,l,c)}}}}if(process.version.substr(0,4)==="v0.8"){var d=l(t);ReadStream=d.ReadStream;WriteStream=d.WriteStream}var p=t.ReadStream;if(p){ReadStream.prototype=Object.create(p.prototype);ReadStream.prototype.open=ReadStream$open}var m=t.WriteStream;if(m){WriteStream.prototype=Object.create(m.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(t,"ReadStream",{get:function(){return ReadStream},set:function(t){ReadStream=t},enumerable:true,configurable:true});Object.defineProperty(t,"WriteStream",{get:function(){return WriteStream},set:function(t){WriteStream=t},enumerable:true,configurable:true});var y=ReadStream;Object.defineProperty(t,"FileReadStream",{get:function(){return y},set:function(t){y=t},enumerable:true,configurable:true});var g=WriteStream;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(t){g=t},enumerable:true,configurable:true});function ReadStream(t,r){if(this instanceof ReadStream)return p.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(r,i){if(r){if(t.autoClose)t.destroy();t.emit("error",r)}else{t.fd=i;t.emit("open",i);t.read()}}))}function WriteStream(t,r){if(this instanceof WriteStream)return m.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(r,i){if(r){t.destroy();t.emit("error",r)}else{t.fd=i;t.emit("open",i)}}))}function createReadStream(r,i){return new t.ReadStream(r,i)}function createWriteStream(r,i){return new t.WriteStream(r,i)}var b=t.open;t.open=open;function open(t,r,i,o){if(typeof i==="function")o=i,i=null;return go$open(t,r,i,o);function go$open(t,r,i,o,a){return b(t,r,i,(function(l,c){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))enqueue([go$open,[t,r,i,o],l,a||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}return t}function enqueue(t){p("ENQUEUE",t[0].name,t[1]);o[h].push(t);retry()}var y;function resetQueue(){var t=Date.now();for(var r=0;r<o[h].length;++r){if(o[h][r].length>2){o[h][r][3]=t;o[h][r][4]=t}}retry()}function retry(){clearTimeout(y);y=undefined;if(o[h].length===0)return;var t=o[h].shift();var r=t[0];var i=t[1];var a=t[2];var l=t[3];var c=t[4];if(l===undefined){p("RETRY",r.name,i);r.apply(null,i)}else if(Date.now()-l>=6e4){p("TIMEOUT",r.name,i);var u=i.pop();if(typeof u==="function")u.call(null,a)}else{var d=Date.now()-c;var m=Math.max(c-l,1);var g=Math.min(m*1.2,100);if(d>=g){p("RETRY",r.name,i);r.apply(null,i.concat([l]))}else{o[h].push(t)}}if(y===undefined){y=setTimeout(retry,0)}}},7078:(t,r,i)=>{var o=i(2781).Stream;t.exports=legacy;function legacy(t){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(r,i){if(!(this instanceof ReadStream))return new ReadStream(r,i);o.call(this);var a=this;this.path=r;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;i=i||{};var l=Object.keys(i);for(var c=0,u=l.length;c<u;c++){var h=l[c];this[h]=i[h]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){a._read()}));return}t.open(this.path,this.flags,this.mode,(function(t,r){if(t){a.emit("error",t);a.readable=false;return}a.fd=r;a.emit("open",r);a._read()}))}function WriteStream(r,i){if(!(this instanceof WriteStream))return new WriteStream(r,i);o.call(this);this.path=r;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;i=i||{};var a=Object.keys(i);for(var l=0,c=a.length;l<c;l++){var u=a[l];this[u]=i[u]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=t.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},8986:(t,r,i)=>{var o=i(2057);var a=process.cwd;var l=null;var c=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!l)l=a.call(process);return l};try{process.cwd()}catch(t){}if(typeof process.chdir==="function"){var u=process.chdir;process.chdir=function(t){l=null;u.call(process,t)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,u)}t.exports=patch;function patch(t){if(o.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(t)}if(!t.lutimes){patchLutimes(t)}t.chown=chownFix(t.chown);t.fchown=chownFix(t.fchown);t.lchown=chownFix(t.lchown);t.chmod=chmodFix(t.chmod);t.fchmod=chmodFix(t.fchmod);t.lchmod=chmodFix(t.lchmod);t.chownSync=chownFixSync(t.chownSync);t.fchownSync=chownFixSync(t.fchownSync);t.lchownSync=chownFixSync(t.lchownSync);t.chmodSync=chmodFixSync(t.chmodSync);t.fchmodSync=chmodFixSync(t.fchmodSync);t.lchmodSync=chmodFixSync(t.lchmodSync);t.stat=statFix(t.stat);t.fstat=statFix(t.fstat);t.lstat=statFix(t.lstat);t.statSync=statFixSync(t.statSync);t.fstatSync=statFixSync(t.fstatSync);t.lstatSync=statFixSync(t.lstatSync);if(t.chmod&&!t.lchmod){t.lchmod=function(t,r,i){if(i)process.nextTick(i)};t.lchmodSync=function(){}}if(t.chown&&!t.lchown){t.lchown=function(t,r,i,o){if(o)process.nextTick(o)};t.lchownSync=function(){}}if(c==="win32"){t.rename=typeof t.rename!=="function"?t.rename:function(r){function rename(i,o,a){var l=Date.now();var c=0;r(i,o,(function CB(u){if(u&&(u.code==="EACCES"||u.code==="EPERM")&&Date.now()-l<6e4){setTimeout((function(){t.stat(o,(function(t,l){if(t&&t.code==="ENOENT")r(i,o,CB);else a(u)}))}),c);if(c<100)c+=10;return}if(a)a(u)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,r);return rename}(t.rename)}t.read=typeof t.read!=="function"?t.read:function(r){function read(i,o,a,l,c,u){var h;if(u&&typeof u==="function"){var d=0;h=function(p,m,y){if(p&&p.code==="EAGAIN"&&d<10){d++;return r.call(t,i,o,a,l,c,h)}u.apply(this,arguments)}}return r.call(t,i,o,a,l,c,h)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,r);return read}(t.read);t.readSync=typeof t.readSync!=="function"?t.readSync:function(r){return function(i,o,a,l,c){var u=0;while(true){try{return r.call(t,i,o,a,l,c)}catch(t){if(t.code==="EAGAIN"&&u<10){u++;continue}throw t}}}}(t.readSync);function patchLchmod(t){t.lchmod=function(r,i,a){t.open(r,o.O_WRONLY|o.O_SYMLINK,i,(function(r,o){if(r){if(a)a(r);return}t.fchmod(o,i,(function(r){t.close(o,(function(t){if(a)a(r||t)}))}))}))};t.lchmodSync=function(r,i){var a=t.openSync(r,o.O_WRONLY|o.O_SYMLINK,i);var l=true;var c;try{c=t.fchmodSync(a,i);l=false}finally{if(l){try{t.closeSync(a)}catch(t){}}else{t.closeSync(a)}}return c}}function patchLutimes(t){if(o.hasOwnProperty("O_SYMLINK")&&t.futimes){t.lutimes=function(r,i,a,l){t.open(r,o.O_SYMLINK,(function(r,o){if(r){if(l)l(r);return}t.futimes(o,i,a,(function(r){t.close(o,(function(t){if(l)l(r||t)}))}))}))};t.lutimesSync=function(r,i,a){var l=t.openSync(r,o.O_SYMLINK);var c;var u=true;try{c=t.futimesSync(l,i,a);u=false}finally{if(u){try{t.closeSync(l)}catch(t){}}else{t.closeSync(l)}}return c}}else if(t.futimes){t.lutimes=function(t,r,i,o){if(o)process.nextTick(o)};t.lutimesSync=function(){}}}function chmodFix(r){if(!r)return r;return function(i,o,a){return r.call(t,i,o,(function(t){if(chownErOk(t))t=null;if(a)a.apply(this,arguments)}))}}function chmodFixSync(r){if(!r)return r;return function(i,o){try{return r.call(t,i,o)}catch(t){if(!chownErOk(t))throw t}}}function chownFix(r){if(!r)return r;return function(i,o,a,l){return r.call(t,i,o,a,(function(t){if(chownErOk(t))t=null;if(l)l.apply(this,arguments)}))}}function chownFixSync(r){if(!r)return r;return function(i,o,a){try{return r.call(t,i,o,a)}catch(t){if(!chownErOk(t))throw t}}}function statFix(r){if(!r)return r;return function(i,o,a){if(typeof o==="function"){a=o;o=null}function callback(t,r){if(r){if(r.uid<0)r.uid+=4294967296;if(r.gid<0)r.gid+=4294967296}if(a)a.apply(this,arguments)}return o?r.call(t,i,o,callback):r.call(t,i,callback)}}function statFixSync(r){if(!r)return r;return function(i,o){var a=o?r.call(t,i,o):r.call(t,i);if(a){if(a.uid<0)a.uid+=4294967296;if(a.gid<0)a.gid+=4294967296}return a}}function chownErOk(t){if(!t)return true;if(t.code==="ENOSYS")return true;var r=!process.getuid||process.getuid()!==0;if(r){if(t.code==="EINVAL"||t.code==="EPERM")return true}return false}}},1454:t=>{"use strict";const r=new Set([200,203,204,206,300,301,404,405,410,414,501]);const i=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]);const o=new Set([500,502,503,504]);const a={date:true,connection:true,"keep-alive":true,"proxy-authenticate":true,"proxy-authorization":true,te:true,trailer:true,"transfer-encoding":true,upgrade:true};const l={"content-length":true,"content-encoding":true,"transfer-encoding":true,"content-range":true};function toNumberOrZero(t){const r=parseInt(t,10);return isFinite(r)?r:0}function isErrorResponse(t){if(!t){return true}return o.has(t.status)}function parseCacheControl(t){const r={};if(!t)return r;const i=t.trim().split(/\s*,\s*/);for(const t of i){const[i,o]=t.split(/\s*=\s*/,2);r[i]=o===undefined?true:o.replace(/^"|"$/g,"")}return r}function formatCacheControl(t){let r=[];for(const i in t){const o=t[i];r.push(o===true?i:i+"="+o)}if(!r.length){return undefined}return r.join(", ")}t.exports=class CachePolicy{constructor(t,r,{shared:i,cacheHeuristic:o,immutableMinTimeToLive:a,ignoreCargoCult:l,_fromObject:c}={}){if(c){this._fromObject(c);return}if(!r||!r.headers){throw Error("Response headers missing")}this._assertRequestHasHeaders(t);this._responseTime=this.now();this._isShared=i!==false;this._cacheHeuristic=undefined!==o?o:.1;this._immutableMinTtl=undefined!==a?a:24*3600*1e3;this._status="status"in r?r.status:200;this._resHeaders=r.headers;this._rescc=parseCacheControl(r.headers["cache-control"]);this._method="method"in t?t.method:"GET";this._url=t.url;this._host=t.headers.host;this._noAuthorization=!t.headers.authorization;this._reqHeaders=r.headers.vary?t.headers:null;this._reqcc=parseCacheControl(t.headers["cache-control"]);if(l&&"pre-check"in this._rescc&&"post-check"in this._rescc){delete this._rescc["pre-check"];delete this._rescc["post-check"];delete this._rescc["no-cache"];delete this._rescc["no-store"];delete this._rescc["must-revalidate"];this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":formatCacheControl(this._rescc)});delete this._resHeaders.expires;delete this._resHeaders.pragma}if(r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)){this._rescc["no-cache"]=true}}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&("GET"===this._method||"HEAD"===this._method||"POST"===this._method&&this._hasExplicitExpiration())&&i.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||r.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(t){if(!t||!t.headers){throw Error("Request headers missing")}}satisfiesWithoutRevalidation(t){this._assertRequestHasHeaders(t);const r=parseCacheControl(t.headers["cache-control"]);if(r["no-cache"]||/no-cache/.test(t.headers.pragma)){return false}if(r["max-age"]&&this.age()>r["max-age"]){return false}if(r["min-fresh"]&&this.timeToLive()<1e3*r["min-fresh"]){return false}if(this.stale()){const t=r["max-stale"]&&!this._rescc["must-revalidate"]&&(true===r["max-stale"]||r["max-stale"]>this.age()-this.maxAge());if(!t){return false}}return this._requestMatches(t,false)}_requestMatches(t,r){return(!this._url||this._url===t.url)&&this._host===t.headers.host&&(!t.method||this._method===t.method||r&&"HEAD"===t.method)&&this._varyMatches(t)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(t){if(!this._resHeaders.vary){return true}if(this._resHeaders.vary==="*"){return false}const r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(const i of r){if(t.headers[i]!==this._reqHeaders[i])return false}return true}_copyWithoutHopByHopHeaders(t){const r={};for(const i in t){if(a[i])continue;r[i]=t[i]}if(t.connection){const i=t.connection.trim().split(/\s*,\s*/);for(const t of i){delete r[t]}}if(r.warning){const t=r.warning.split(/,/).filter((t=>!/^\s*1[0-9][0-9]/.test(t)));if(!t.length){delete r.warning}else{r.warning=t.join(",").trim()}}return r}responseHeaders(){const t=this._copyWithoutHopByHopHeaders(this._resHeaders);const r=this.age();if(r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24){t.warning=(t.warning?`${t.warning}, `:"")+'113 - "rfc7234 5.5.4"'}t.age=`${Math.round(r)}`;t.date=new Date(this.now()).toUTCString();return t}date(){const t=Date.parse(this._resHeaders.date);if(isFinite(t)){return t}return this._responseTime}age(){let t=this._ageValue();const r=(this.now()-this._responseTime)/1e3;return t+r}_ageValue(){return toNumberOrZero(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]){return 0}if(this._isShared&&(this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable)){return 0}if(this._resHeaders.vary==="*"){return 0}if(this._isShared){if(this._rescc["proxy-revalidate"]){return 0}if(this._rescc["s-maxage"]){return toNumberOrZero(this._rescc["s-maxage"])}}if(this._rescc["max-age"]){return toNumberOrZero(this._rescc["max-age"])}const t=this._rescc.immutable?this._immutableMinTtl:0;const r=this.date();if(this._resHeaders.expires){const i=Date.parse(this._resHeaders.expires);if(Number.isNaN(i)||i<r){return 0}return Math.max(t,(i-r)/1e3)}if(this._resHeaders["last-modified"]){const i=Date.parse(this._resHeaders["last-modified"]);if(isFinite(i)&&r>i){return Math.max(t,(r-i)/1e3*this._cacheHeuristic)}}return t}timeToLive(){const t=this.maxAge()-this.age();const r=t+toNumberOrZero(this._rescc["stale-if-error"]);const i=t+toNumberOrZero(this._rescc["stale-while-revalidate"]);return Math.max(0,t,r,i)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+toNumberOrZero(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+toNumberOrZero(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(t){return new this(undefined,undefined,{_fromObject:t})}_fromObject(t){if(this._responseTime)throw Error("Reinitialized");if(!t||t.v!==1)throw Error("Invalid serialization");this._responseTime=t.t;this._isShared=t.sh;this._cacheHeuristic=t.ch;this._immutableMinTtl=t.imm!==undefined?t.imm:24*3600*1e3;this._status=t.st;this._resHeaders=t.resh;this._rescc=t.rescc;this._method=t.m;this._url=t.u;this._host=t.h;this._noAuthorization=t.a;this._reqHeaders=t.reqh;this._reqcc=t.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(t){this._assertRequestHasHeaders(t);const r=this._copyWithoutHopByHopHeaders(t.headers);delete r["if-range"];if(!this._requestMatches(t,true)||!this.storable()){delete r["if-none-match"];delete r["if-modified-since"];return r}if(this._resHeaders.etag){r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag}const i=r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET";if(i){delete r["if-modified-since"];if(r["if-none-match"]){const t=r["if-none-match"].split(/,/).filter((t=>!/^\s*W\//.test(t)));if(!t.length){delete r["if-none-match"]}else{r["if-none-match"]=t.join(",").trim()}}}else if(this._resHeaders["last-modified"]&&!r["if-modified-since"]){r["if-modified-since"]=this._resHeaders["last-modified"]}return r}revalidatedPolicy(t,r){this._assertRequestHasHeaders(t);if(this._useStaleIfError()&&isErrorResponse(r)){return{modified:false,matches:false,policy:this}}if(!r||!r.headers){throw Error("Response headers missing")}let i=false;if(r.status!==undefined&&r.status!=304){i=false}else if(r.headers.etag&&!/^\s*W\//.test(r.headers.etag)){i=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag}else if(this._resHeaders.etag&&r.headers.etag){i=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,"")}else if(this._resHeaders["last-modified"]){i=this._resHeaders["last-modified"]===r.headers["last-modified"]}else{if(!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]){i=true}}if(!i){return{policy:new this.constructor(t,r),modified:r.status!=304,matches:false}}const o={};for(const t in this._resHeaders){o[t]=t in r.headers&&!l[t]?r.headers[t]:this._resHeaders[t]}const a=Object.assign({},r,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(t,a,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:false,matches:true}}}},4828:(t,r,i)=>{"use strict";const{URL:o}=i(7310);const a=i(2361);const l=i(4404);const c=i(5158);const u=i(6664);const h=i(7253);const d=Symbol("currentStreamCount");const p=Symbol("request");const m=Symbol("cachedOriginSet");const y=Symbol("gracefullyClosing");const g=Symbol("length");const b=["createConnection","maxDeflateDynamicTableSize","maxSettings","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","peerMaxConcurrentStreams","settings","family","localAddress","rejectUnauthorized","pskCallback","minDHSize","path","socket","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","pfx","secureOptions","secureProtocol","sessionIdContext","ticketKeys"];const getSortedIndex=(t,r,i)=>{let o=0;let a=t.length;while(o<a){const l=o+a>>>1;if(i(t[l],r)){o=l+1}else{a=l}}return o};const compareSessions=(t,r)=>t.remoteSettings.maxConcurrentStreams>r.remoteSettings.maxConcurrentStreams;const closeCoveredSessions=(t,r)=>{for(let i=0;i<t.length;i++){const o=t[i];if(o[m].length>0&&o[m].length<r[m].length&&o[m].every((t=>r[m].includes(t)))&&o[d]+r[d]<=r.remoteSettings.maxConcurrentStreams){gracefullyClose(o)}}};const closeSessionIfCovered=(t,r)=>{for(let i=0;i<t.length;i++){const o=t[i];if(r[m].length>0&&r[m].length<o[m].length&&r[m].every((t=>o[m].includes(t)))&&r[d]+o[d]<=o.remoteSettings.maxConcurrentStreams){gracefullyClose(r);return true}}return false};const gracefullyClose=t=>{t[y]=true;if(t[d]===0){t.close()}};class Agent extends a{constructor({timeout:t=0,maxSessions:r=Number.POSITIVE_INFINITY,maxEmptySessions:i=10,maxCachedTlsSessions:o=100}={}){super();this.sessions={};this.queue={};this.timeout=t;this.maxSessions=r;this.maxEmptySessions=i;this._emptySessionCount=0;this._sessionCount=0;this.settings={enablePush:false,initialWindowSize:1024*1024*32};this.tlsSessionCache=new u({maxSize:o})}get protocol(){return"https:"}normalizeOptions(t){let r="";for(let i=0;i<b.length;i++){const o=b[i];r+=":";if(t&&t[o]!==undefined){r+=t[o]}}return r}_processQueue(){if(this._sessionCount>=this.maxSessions){this.closeEmptySessions(this.maxSessions-this._sessionCount+1);return}for(const t in this.queue){for(const r in this.queue[t]){const i=this.queue[t][r];if(!i.completed){i.completed=true;i()}}}}_isBetterSession(t,r){return t>r}_accept(t,r,i,o){let a=0;while(a<r.length&&t[d]<t.remoteSettings.maxConcurrentStreams){r[a].resolve(t);a++}r.splice(0,a);if(r.length>0){this.getSession(i,o,r);r.length=0}}getSession(t,r,i){return new Promise(((a,l)=>{if(Array.isArray(i)&&i.length>0){i=[...i];a()}else{i=[{resolve:a,reject:l}]}try{if(typeof t==="string"){t=new o(t)}else if(!(t instanceof o)){throw new TypeError("The `origin` argument needs to be a string or an URL object")}if(r){const{servername:i}=r;const{hostname:o}=t;if(i&&o!==i){throw new Error(`Origin ${o} differs from servername ${i}`)}}}catch(t){for(let r=0;r<i.length;r++){i[r].reject(t)}return}const u=this.normalizeOptions(r);const h=t.origin;if(u in this.sessions){const t=this.sessions[u];let o=-1;let a=-1;let l;for(let r=0;r<t.length;r++){const i=t[r];const c=i.remoteSettings.maxConcurrentStreams;if(c<o){break}if(!i[m].includes(h)){continue}const u=i[d];if(u>=c||i[y]||i.destroyed){continue}if(!l){o=c}if(this._isBetterSession(u,a)){l=i;a=u}}if(l){this._accept(l,i,h,r);return}}if(u in this.queue){if(h in this.queue[u]){this.queue[u][h].listeners.push(...i);return}}else{this.queue[u]={[g]:0}}const removeFromQueue=()=>{if(u in this.queue&&this.queue[u][h]===entry){delete this.queue[u][h];if(--this.queue[u][g]===0){delete this.queue[u]}}};const entry=async()=>{this._sessionCount++;const o=`${h}:${u}`;let a=false;let l;try{const b={...r};if(b.settings===undefined){b.settings=this.settings}if(b.session===undefined){b.session=this.tlsSessionCache.get(o)}const v=b.createConnection||this.createConnection;l=await v.call(this,t,b);b.createConnection=()=>l;const _=c.connect(t,b);_[d]=0;_[y]=false;const getOriginSet=()=>{const{socket:t}=_;let r;if(t.servername===false){t.servername=t.remoteAddress;r=_.originSet;t.servername=false}else{r=_.originSet}return r};const isFree=()=>_[d]<_.remoteSettings.maxConcurrentStreams;_.socket.once("session",(t=>{this.tlsSessionCache.set(o,t)}));_.once("error",(t=>{for(let r=0;r<i.length;r++){i[r].reject(t)}this.tlsSessionCache.delete(o)}));_.setTimeout(this.timeout,(()=>{_.destroy()}));_.once("close",(()=>{this._sessionCount--;if(a){this._emptySessionCount--;const t=this.sessions[u];if(t.length===1){delete this.sessions[u]}else{t.splice(t.indexOf(_),1)}}else{removeFromQueue();const t=new Error("Session closed without receiving a SETTINGS frame");t.code="HTTP2WRAPPER_NOSETTINGS";for(let r=0;r<i.length;r++){i[r].reject(t)}}this._processQueue()}));const processListeners=()=>{const t=this.queue[u];if(!t){return}const r=_[m];for(let i=0;i<r.length;i++){const o=r[i];if(o in t){const{listeners:r,completed:i}=t[o];let a=0;while(a<r.length&&isFree()){r[a].resolve(_);a++}t[o].listeners.splice(0,a);if(t[o].listeners.length===0&&!i){delete t[o];if(--t[g]===0){delete this.queue[u];break}}if(!isFree()){break}}}};_.on("origin",(()=>{_[m]=getOriginSet()||[];_[y]=false;closeSessionIfCovered(this.sessions[u],_);if(_[y]||!isFree()){return}processListeners();if(!isFree()){return}closeCoveredSessions(this.sessions[u],_)}));_.once("remoteSettings",(()=>{if(entry.destroyed){const t=new Error("Agent has been destroyed");for(let r=0;r<i.length;r++){i[r].reject(t)}_.destroy();return}if(_.setLocalWindowSize){_.setLocalWindowSize(1024*1024*4)}_[m]=getOriginSet()||[];if(_.socket.encrypted){const t=_[m][0];if(t!==h){const r=new Error(`Requested origin ${h} does not match server ${t}`);for(let t=0;t<i.length;t++){i[t].reject(r)}_.destroy();return}}removeFromQueue();{const t=this.sessions;if(u in t){const r=t[u];r.splice(getSortedIndex(r,_,compareSessions),0,_)}else{t[u]=[_]}}a=true;this._emptySessionCount++;this.emit("session",_);this._accept(_,i,h,r);if(_[d]===0&&this._emptySessionCount>this.maxEmptySessions){this.closeEmptySessions(this._emptySessionCount-this.maxEmptySessions)}_.on("remoteSettings",(()=>{if(!isFree()){return}processListeners();if(!isFree()){return}closeCoveredSessions(this.sessions[u],_)}))}));_[p]=_.request;_.request=(t,r)=>{if(_[y]){throw new Error("The session is gracefully closing. No new streams are allowed.")}const i=_[p](t,r);_.ref();if(_[d]++===0){this._emptySessionCount--}i.once("close",(()=>{if(--_[d]===0){this._emptySessionCount++;_.unref();if(this._emptySessionCount>this.maxEmptySessions||_[y]){_.close();return}}if(_.destroyed||_.closed){return}if(isFree()&&!closeSessionIfCovered(this.sessions[u],_)){closeCoveredSessions(this.sessions[u],_);processListeners();if(_[d]===0){this._processQueue()}}}));return i}}catch(t){removeFromQueue();this._sessionCount--;for(let r=0;r<i.length;r++){i[r].reject(t)}}};entry.listeners=i;entry.completed=false;entry.destroyed=false;this.queue[u][h]=entry;this.queue[u][g]++;this._processQueue()}))}request(t,r,i,o){return new Promise(((a,l)=>{this.getSession(t,r,[{reject:l,resolve:t=>{try{const r=t.request(i,o);h(r);a(r)}catch(t){l(t)}}}])}))}async createConnection(t,r){return Agent.connect(t,r)}static connect(t,r){r.ALPNProtocols=["h2"];const i=t.port||443;const o=t.hostname;if(typeof r.servername==="undefined"){r.servername=o}const a=l.connect(i,o,r);if(r.socket){a._peername={family:undefined,address:undefined,port:i}}return a}closeEmptySessions(t=Number.POSITIVE_INFINITY){let r=0;const{sessions:i}=this;for(const o in i){const a=i[o];for(let i=0;i<a.length;i++){const o=a[i];if(o[d]===0){r++;o.close();if(r>=t){return r}}}}return r}destroy(t){const{sessions:r,queue:i}=this;for(const i in r){const o=r[i];for(let r=0;r<o.length;r++){o[r].destroy(t)}}for(const t in i){const r=i[t];for(const t in r){r[t].destroyed=true}}this.queue={};this.tlsSessionCache.clear()}get emptySessionCount(){return this._emptySessionCount}get pendingSessionCount(){return this._sessionCount-this._emptySessionCount}get sessionCount(){return this._sessionCount}}Agent.kCurrentStreamCount=d;Agent.kGracefullyClosing=y;t.exports={Agent:Agent,globalAgent:new Agent}},3942:(t,r,i)=>{"use strict";const{URL:o,urlToHttpOptions:a}=i(7310);const l=i(3685);const c=i(5687);const u=i(8826);const h=i(6664);const{Agent:d,globalAgent:p}=i(4828);const m=i(6496);const y=i(3671);const g=i(7253);const b=new h({maxSize:100});const v=new Map;const installSocket=(t,r,i)=>{r._httpMessage={shouldKeepAlive:true};const onFree=()=>{t.emit("free",r,i)};r.on("free",onFree);const onClose=()=>{t.removeSocket(r,i)};r.on("close",onClose);const onTimeout=()=>{const{freeSockets:i}=t;for(const t of Object.values(i)){if(t.includes(r)){r.destroy();return}}};r.on("timeout",onTimeout);const onRemove=()=>{t.removeSocket(r,i);r.off("close",onClose);r.off("free",onFree);r.off("timeout",onTimeout);r.off("agentRemove",onRemove)};r.on("agentRemove",onRemove);t.emit("free",r,i)};const createResolveProtocol=(t,r=new Map,i=undefined)=>async o=>{const a=`${o.host}:${o.port}:${o.ALPNProtocols.sort()}`;if(!t.has(a)){if(r.has(a)){const t=await r.get(a);return{alpnProtocol:t.alpnProtocol}}const{path:l}=o;o.path=o.socketPath;const c=u(o,i);r.set(a,c);try{const i=await c;t.set(a,i.alpnProtocol);r.delete(a);o.path=l;return i}catch(t){r.delete(a);o.path=l;throw t}}return{alpnProtocol:t.get(a)}};const _=createResolveProtocol(b,v);t.exports=async(t,r,i)=>{if(typeof t==="string"){t=a(new o(t))}else if(t instanceof o){t=a(t)}else{t={...t}}if(typeof r==="function"||r===undefined){i=r;r=t}else{r=Object.assign(t,r)}r.ALPNProtocols=r.ALPNProtocols||["h2","http/1.1"];if(!Array.isArray(r.ALPNProtocols)||r.ALPNProtocols.length===0){throw new Error("The `ALPNProtocols` option must be an Array with at least one entry")}r.protocol=r.protocol||"https:";const u=r.protocol==="https:";r.host=r.hostname||r.host||"localhost";r.session=r.tlsSession;r.servername=r.servername||y(r.headers&&r.headers.host||r.host);r.port=r.port||(u?443:80);r._defaultAgent=u?c.globalAgent:l.globalAgent;const h=r.resolveProtocol||_;let{agent:b}=r;if(b!==undefined&&b!==false&&b.constructor.name!=="Object"){throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties")}if(u){r.resolveSocket=true;let{socket:t,alpnProtocol:o,timeout:a}=await h(r);if(a){if(t){t.destroy()}const i=new Error(`Timed out resolving ALPN: ${r.timeout} ms`);i.code="ETIMEDOUT";i.ms=r.timeout;throw i}if(t&&r.createConnection){t.destroy();t=undefined}delete r.resolveSocket;const l=o==="h2";if(b){b=l?b.http2:b.https;r.agent=b}if(b===undefined){b=l?p:c.globalAgent}if(t){if(b===false){t.destroy()}else{const i=(l?d:c.Agent).prototype.createConnection;if(b.createConnection===i){if(l){r._reuseSocket=t}else{installSocket(b,t,r)}}else{t.destroy()}}}if(l){return g(new m(r,i))}}else if(b){r.agent=b.http}return g(l.request(r,i))};t.exports.protocolCache=b;t.exports.resolveProtocol=_;t.exports.createResolveProtocol=createResolveProtocol},6496:(t,r,i)=>{"use strict";const{URL:o,urlToHttpOptions:a}=i(7310);const l=i(5158);const{Writable:c}=i(2781);const{Agent:u,globalAgent:h}=i(4828);const d=i(4011);const p=i(1544);const{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_PROTOCOL:y,ERR_HTTP_HEADERS_SENT:g}=i(8635);const b=i(1091);const v=i(5590);const _=i(704);const{HTTP2_HEADER_STATUS:w,HTTP2_HEADER_METHOD:E,HTTP2_HEADER_PATH:S,HTTP2_HEADER_AUTHORITY:O,HTTP2_METHOD_CONNECT:R}=l.constants;const x=Symbol("headers");const k=Symbol("origin");const T=Symbol("session");const A=Symbol("options");const C=Symbol("flushedHeaders");const P=Symbol("jobs");const I=Symbol("pendingAgentPromise");class ClientRequest extends c{constructor(t,r,i){super({autoDestroy:false,emitClose:false});if(typeof t==="string"){t=a(new o(t))}else if(t instanceof o){t=a(t)}else{t={...t}}if(typeof r==="function"||r===undefined){i=r;r=t}else{r=Object.assign(t,r)}if(r.h2session){this[T]=r.h2session;if(this[T].destroyed){throw new Error("The session has been closed already")}this.protocol=this[T].socket.encrypted?"https:":"http:"}else if(r.agent===false){this.agent=new u({maxEmptySessions:0})}else if(typeof r.agent==="undefined"||r.agent===null){this.agent=h}else if(typeof r.agent.request==="function"){this.agent=r.agent}else{throw new m("options.agent",["http2wrapper.Agent-like Object","undefined","false"],r.agent)}if(this.agent){this.protocol=this.agent.protocol}if(r.protocol&&r.protocol!==this.protocol){throw new y(r.protocol,this.protocol)}if(!r.port){r.port=r.defaultPort||this.agent&&this.agent.defaultPort||443}r.host=r.hostname||r.host||"localhost";delete r.hostname;const{timeout:l}=r;r.timeout=undefined;this[x]=Object.create(null);this[P]=[];this[I]=undefined;this.socket=null;this.connection=null;this.method=r.method||"GET";if(!(this.method==="CONNECT"&&(r.path==="/"||r.path===undefined))){this.path=r.path}this.res=null;this.aborted=false;this.reusedSocket=false;const{headers:c}=r;if(c){for(const t in c){this.setHeader(t,c[t])}}if(r.auth&&!("authorization"in this[x])){this[x].authorization="Basic "+Buffer.from(r.auth).toString("base64")}r.session=r.tlsSession;r.path=r.socketPath;this[A]=r;this[k]=new o(`${this.protocol}//${r.servername||r.host}:${r.port}`);const d=r._reuseSocket;if(d){r.createConnection=(...t)=>{if(d.destroyed){return this.agent.createConnection(...t)}return d};this.agent.getSession(this[k],this[A]).catch((()=>{}))}if(l){this.setTimeout(l)}if(i){this.once("response",i)}this[C]=false}get method(){return this[x][E]}set method(t){if(t){this[x][E]=t.toUpperCase()}}get path(){const t=this.method==="CONNECT"?O:S;return this[x][t]}set path(t){if(t){const r=this.method==="CONNECT"?O:S;this[x][r]=t}}get host(){return this[k].hostname}set host(t){}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(t,r,i){if(this._mustNotHaveABody){i(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();const callWrite=()=>this._request.write(t,r,i);if(this._request){callWrite()}else{this[P].push(callWrite)}}_final(t){this.flushHeaders();const callEnd=()=>{if(this._mustNotHaveABody||this.method==="CONNECT"){t();return}this._request.end(t)};if(this._request){callEnd()}else{this[P].push(callEnd)}}abort(){if(this.res&&this.res.complete){return}if(!this.aborted){process.nextTick((()=>this.emit("abort")))}this.aborted=true;this.destroy()}async _destroy(t,r){if(this.res){this.res._dump()}if(this._request){this._request.destroy()}else{process.nextTick((()=>{this.emit("close")}))}try{await this[I]}catch(r){if(this.aborted){t=r}}r(t)}async flushHeaders(){if(this[C]||this.destroyed){return}this[C]=true;const t=this.method===R;const onStream=r=>{this._request=r;if(this.destroyed){r.destroy();return}if(!t){p(r,this,["timeout","continue"])}r.once("error",(t=>{this.destroy(t)}));r.once("aborted",(()=>{const{res:t}=this;if(t){t.aborted=true;t.emit("aborted");t.destroy()}else{this.destroy(new Error("The server aborted the HTTP/2 stream"))}}));const onResponse=(i,o,a)=>{const l=new d(this.socket,r.readableHighWaterMark);this.res=l;l.url=`${this[k].origin}${this.path}`;l.req=this;l.statusCode=i[w];l.headers=i;l.rawHeaders=a;l.once("end",(()=>{l.complete=true;l.socket=null;l.connection=null}));if(t){l.upgrade=true;if(this.emit("connect",l,r,Buffer.alloc(0))){this.emit("close")}else{r.destroy()}}else{r.on("data",(t=>{if(!l._dumped&&!l.push(t)){r.pause()}}));r.once("end",(()=>{if(!this.aborted){l.push(null)}}));if(!this.emit("response",l)){l._dump()}}};r.once("response",onResponse);r.once("headers",(t=>this.emit("information",{statusCode:t[w]})));r.once("trailers",((t,r,i)=>{const{res:o}=this;if(o===null){onResponse(t,r,i);return}o.trailers=t;o.rawTrailers=i}));r.once("close",(()=>{const{aborted:t,res:r}=this;if(r){if(t){r.aborted=true;r.emit("aborted");r.destroy()}const finish=()=>{r.emit("close");this.destroy();this.emit("close")};if(r.readable){r.once("end",finish)}else{finish()}return}if(!this.destroyed){this.destroy(new Error("The HTTP/2 stream has been early terminated"));this.emit("close");return}this.destroy();this.emit("close")}));this.socket=new Proxy(r,_);for(const t of this[P]){t()}this.emit("socket",this.socket)};if(!(O in this[x])&&!t){this[x][O]=this[k].host}if(this[T]){try{onStream(this[T].request(this[x]))}catch(t){this.destroy(t)}}else{this.reusedSocket=true;try{const t=this.agent.request(this[k],this[A],this[x]);this[I]=t;onStream(await t);this[I]=false}catch(t){this[I]=false;this.destroy(t)}}}get connection(){return this.socket}set connection(t){this.socket=t}getHeaderNames(){return Object.keys(this[x])}hasHeader(t){if(typeof t!=="string"){throw new m("name","string",t)}return Boolean(this[x][t.toLowerCase()])}getHeader(t){if(typeof t!=="string"){throw new m("name","string",t)}return this[x][t.toLowerCase()]}get headersSent(){return this[C]}removeHeader(t){if(typeof t!=="string"){throw new m("name","string",t)}if(this.headersSent){throw new g("remove")}delete this[x][t.toLowerCase()]}setHeader(t,r){if(this.headersSent){throw new g("set")}b(t);v(t,r);const i=t.toLowerCase();if(i==="connection"){if(r.toLowerCase()==="keep-alive"){return}throw new Error(`Invalid 'connection' header: ${r}`)}if(i==="host"&&this.method==="CONNECT"){this[x][O]=r}else{this[x][i]=r}}setNoDelay(){}setSocketKeepAlive(){}setTimeout(t,r){const applyTimeout=()=>this._request.setTimeout(t,r);if(this._request){applyTimeout()}else{this[P].push(applyTimeout)}return this}get maxHeadersCount(){if(!this.destroyed&&this._request){return this._request.session.localSettings.maxHeaderListSize}return undefined}set maxHeadersCount(t){}}t.exports=ClientRequest},4011:(t,r,i)=>{"use strict";const{Readable:o}=i(2781);class IncomingMessage extends o{constructor(t,r){super({emitClose:false,autoDestroy:true,highWaterMark:r});this.statusCode=null;this.statusMessage="";this.httpVersion="2.0";this.httpVersionMajor=2;this.httpVersionMinor=0;this.headers={};this.trailers={};this.req=null;this.aborted=false;this.complete=false;this.upgrade=null;this.rawHeaders=[];this.rawTrailers=[];this.socket=t;this._dumped=false}get connection(){return this.socket}set connection(t){this.socket=t}_destroy(t,r){if(!this.readableEnded){this.aborted=true}r();this.req._request.destroy(t)}setTimeout(t,r){this.req.setTimeout(t,r);return this}_dump(){if(!this._dumped){this._dumped=true;this.removeAllListeners("data");this.resume()}}_read(){if(this.req){this.req._request.resume()}}}t.exports=IncomingMessage},5767:(t,r,i)=>{"use strict";const o=i(5158);const{Agent:a,globalAgent:l}=i(4828);const c=i(6496);const u=i(4011);const h=i(3942);const{HttpOverHttp2:d,HttpsOverHttp2:p}=i(7570);const m=i(855);const{Http2OverHttp:y,Http2OverHttps:g}=i(5431);const b=i(1091);const v=i(5590);const request=(t,r,i)=>new c(t,r,i);const get=(t,r,i)=>{const o=new c(t,r,i);o.end();return o};t.exports={...o,ClientRequest:c,IncomingMessage:u,Agent:a,globalAgent:l,request:request,get:get,auto:h,proxies:{HttpOverHttp2:d,HttpsOverHttp2:p,Http2OverHttp2:m,Http2OverHttp:y,Http2OverHttps:g},validateHeaderName:b,validateHeaderValue:v}},5060:t=>{"use strict";t.exports=t=>{const{username:r,password:i}=t.proxyOptions.url;if(r||i){const t=`${r}:${i}`;const o=`Basic ${Buffer.from(t).toString("base64")}`;return{"proxy-authorization":o,authorization:o}}return{}}},7570:(t,r,i)=>{"use strict";const o=i(4404);const a=i(3685);const l=i(5687);const c=i(6582);const{globalAgent:u}=i(4828);const h=i(4039);const d=i(7652);const p=i(5060);const createConnection=(t,r,i)=>{(async()=>{try{const{proxyOptions:a}=t;const{url:d,headers:m,raw:y}=a;const g=await u.request(d,a,{...p(t),...m,":method":"CONNECT",":authority":`${r.host}:${r.port}`});g.once("error",i);g.once("response",(a=>{const u=a[":status"];if(u!==200){i(new h(u));return}const d=t instanceof l.Agent;if(y&&d){r.socket=g;const t=o.connect(r);t.once("close",(()=>{g.destroy()}));i(null,t);return}const p=new c(g);p.encrypted=false;p._handle.getpeername=t=>{t.family=undefined;t.address=undefined;t.port=undefined};i(null,p)}))}catch(t){i(t)}})()};class HttpOverHttp2 extends a.Agent{constructor(t){super(t);d(this,t.proxyOptions)}createConnection(t,r){createConnection(this,t,r)}}class HttpsOverHttp2 extends l.Agent{constructor(t){super(t);d(this,t.proxyOptions)}createConnection(t,r){createConnection(this,t,r)}}t.exports={HttpOverHttp2:HttpOverHttp2,HttpsOverHttp2:HttpsOverHttp2}},5431:(t,r,i)=>{"use strict";const o=i(3685);const a=i(5687);const l=i(2853);const c=i(5060);const getStream=t=>new Promise(((r,i)=>{const onConnect=(o,a,l)=>{a.unshift(l);t.off("error",i);r([a,o.statusCode])};t.once("error",i);t.once("connect",onConnect)}));class Http2OverHttp extends l{async _getProxyStream(t){const{proxyOptions:r}=this;const{url:i,headers:l}=this.proxyOptions;const u=i.protocol==="https:"?a:o;const h=u.request({...r,hostname:i.hostname,port:i.port,path:t,headers:{...c(this),...l,host:t},method:"CONNECT"}).end();return getStream(h)}}t.exports={Http2OverHttp:Http2OverHttp,Http2OverHttps:Http2OverHttp}},855:(t,r,i)=>{"use strict";const{globalAgent:o}=i(4828);const a=i(2853);const l=i(5060);const getStatusCode=t=>new Promise(((r,i)=>{t.once("error",i);t.once("response",(o=>{t.off("error",i);r(o[":status"])}))}));class Http2OverHttp2 extends a{async _getProxyStream(t){const{proxyOptions:r}=this;const i={...l(this),...r.headers,":method":"CONNECT",":authority":t};const a=await o.request(r.url,r,i);const c=await getStatusCode(a);return[a,c]}}t.exports=Http2OverHttp2},2853:(t,r,i)=>{"use strict";const{Agent:o}=i(4828);const a=i(6582);const l=i(4039);const c=i(7652);class Http2OverHttpX extends o{constructor(t){super(t);c(this,t.proxyOptions)}async createConnection(t,r){const i=`${t.hostname}:${t.port||443}`;const[o,c]=await this._getProxyStream(i);if(c!==200){throw new l(c)}if(this.proxyOptions.raw){r.socket=o}else{const t=new a(o);t.encrypted=false;t._handle.getpeername=t=>{t.family=undefined;t.address=undefined;t.port=undefined};return t}return super.createConnection(t,r)}}t.exports=Http2OverHttpX},7652:(t,r,i)=>{"use strict";const{URL:o}=i(7310);const a=i(8583);t.exports=(t,r)=>{a("proxyOptions",r,["object"]);a("proxyOptions.headers",r.headers,["object","undefined"]);a("proxyOptions.raw",r.raw,["boolean","undefined"]);a("proxyOptions.url",r.url,[o,"string"]);const i=new o(r.url);t.proxyOptions={raw:true,...r,headers:{...r.headers},url:i}}},4039:t=>{"use strict";class UnexpectedStatusCodeError extends Error{constructor(t){super(`The proxy server rejected the request with status code ${t}`);this.statusCode=t}}t.exports=UnexpectedStatusCodeError},3671:(t,r,i)=>{"use strict";const{isIP:o}=i(1808);const a=i(9491);const getHost=t=>{if(t[0]==="["){const r=t.indexOf("]");a(r!==-1);return t.slice(1,r)}const r=t.indexOf(":");if(r===-1){return t}return t.slice(0,r)};t.exports=t=>{const r=getHost(t);if(o(r)){return""}return r}},8583:t=>{"use strict";const checkType=(t,r,i)=>{const o=i.some((t=>{const i=typeof t;if(i==="string"){return typeof r===t}return r instanceof t}));if(!o){const o=i.map((t=>typeof t==="string"?t:t.name));throw new TypeError(`Expected '${t}' to be a type of ${o.join(" or ")}, got ${typeof r}`)}};t.exports=checkType},7253:t=>{"use strict";t.exports=t=>{if(t.listenerCount("error")!==0){return t}t.__destroy=t._destroy;t._destroy=(...r)=>{const i=r.pop();t.__destroy(...r,(async t=>{await Promise.resolve();i(t)}))};const onError=r=>{Promise.resolve().then((()=>{t.emit("error",r)}))};t.once("error",onError);Promise.resolve().then((()=>{t.off("error",onError)}));return t}},8635:t=>{"use strict";const makeError=(r,i,o)=>{t.exports[i]=class NodeError extends r{constructor(...t){super(typeof o==="string"?o:o(t));this.name=`${super.name} [${i}]`;this.code=i}}};makeError(TypeError,"ERR_INVALID_ARG_TYPE",(t=>{const r=t[0].includes(".")?"property":"argument";let i=t[1];const o=Array.isArray(i);if(o){i=`${i.slice(0,-1).join(", ")} or ${i.slice(-1)}`}return`The "${t[0]}" ${r} must be ${o?"one of":"of"} type ${i}. Received ${typeof t[2]}`}));makeError(TypeError,"ERR_INVALID_PROTOCOL",(t=>`Protocol "${t[0]}" not supported. Expected "${t[1]}"`));makeError(Error,"ERR_HTTP_HEADERS_SENT",(t=>`Cannot ${t[0]} headers after they are sent to the client`));makeError(TypeError,"ERR_INVALID_HTTP_TOKEN",(t=>`${t[0]} must be a valid HTTP token [${t[1]}]`));makeError(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",(t=>`Invalid value "${t[0]} for header "${t[1]}"`));makeError(TypeError,"ERR_INVALID_CHAR",(t=>`Invalid character in ${t[0]} [${t[1]}]`));makeError(Error,"ERR_HTTP2_NO_SOCKET_MANIPULATION","HTTP/2 sockets should not be directly manipulated (e.g. read and written)")},8100:t=>{"use strict";t.exports=t=>{switch(t){case":method":case":scheme":case":authority":case":path":return true;default:return false}}},6582:(t,r,i)=>{"use strict";const o=i(2781);const a=i(4404);const l=new a.TLSSocket(new o.PassThrough)._handle._parentWrap.constructor;t.exports=l},1544:t=>{"use strict";t.exports=(t,r,i)=>{for(const o of i){t.on(o,((...t)=>r.emit(o,...t)))}}},704:(t,r,i)=>{"use strict";const{ERR_HTTP2_NO_SOCKET_MANIPULATION:o}=i(8635);const a={has(t,r){const i=t.session===undefined?t:t.session.socket;return r in t||r in i},get(t,r){switch(r){case"on":case"once":case"end":case"emit":case"destroy":return t[r].bind(t);case"writable":case"destroyed":return t[r];case"readable":if(t.destroyed){return false}return t.readable;case"setTimeout":{const{session:r}=t;if(r!==undefined){return r.setTimeout.bind(r)}return t.setTimeout.bind(t)}case"write":case"read":case"pause":case"resume":throw new o;default:{const i=t.session===undefined?t:t.session.socket;const o=i[r];return typeof o==="function"?o.bind(i):o}}},getPrototypeOf(t){if(t.session!==undefined){return Reflect.getPrototypeOf(t.session.socket)}return Reflect.getPrototypeOf(t)},set(t,r,i){switch(r){case"writable":case"readable":case"destroyed":case"on":case"once":case"end":case"emit":case"destroy":t[r]=i;return true;case"setTimeout":{const{session:r}=t;if(r===undefined){t.setTimeout=i}else{r.setTimeout=i}return true}case"write":case"read":case"pause":case"resume":throw new o;default:{const o=t.session===undefined?t:t.session.socket;o[r]=i;return true}}}};t.exports=a},1091:(t,r,i)=>{"use strict";const{ERR_INVALID_HTTP_TOKEN:o}=i(8635);const a=i(8100);const l=/^[\^`\-\w!#$%&*+.|~]+$/;t.exports=t=>{if(typeof t!=="string"||!l.test(t)&&!a(t)){throw new o("Header name",t)}}},5590:(t,r,i)=>{"use strict";const{ERR_HTTP_INVALID_HEADER_VALUE:o,ERR_INVALID_CHAR:a}=i(8635);const l=/[^\t\u0020-\u007E\u0080-\u00FF]/;t.exports=(t,r)=>{if(typeof r==="undefined"){throw new o(r,t)}if(l.test(r)){throw new a("header content",t)}}},7993:t=>{function makeArray(t){return Array.isArray(t)?t:[t]}const r="";const i=" ";const o="\\";const a=/^\s+$/;const l=/^\\!/;const c=/^\\#/;const u=/\r?\n/g;const h=/^\.*\/|^\.+$/;const d="/";const p=typeof Symbol!=="undefined"?Symbol.for("node-ignore"):"node-ignore";const define=(t,r,i)=>Object.defineProperty(t,r,{value:i});const m=/([0-z])-([0-z])/g;const RETURN_FALSE=()=>false;const sanitizeRange=t=>t.replace(m,((t,i,o)=>i.charCodeAt(0)<=o.charCodeAt(0)?t:r));const cleanRangeBackSlash=t=>{const{length:r}=t;return t.slice(0,r-r%2)};const y=[[/\\?\s+$/,t=>t.indexOf("\\")===0?i:r],[/\\\s/g,()=>i],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function startingReplacer(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,r,i)=>r+6<i.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)\\\*(?=.+)/g,(t,r)=>`${r}[^\\/]*`],[/\\\\\\(?=[$.|*+(){^])/g,()=>o],[/\\\\/g,()=>o],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,r,i,a,l)=>r===o?`\\[${i}${cleanRangeBackSlash(a)}${l}`:l==="]"?a.length%2===0?`[${sanitizeRange(i)}${a}]`:"[]":"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,r)=>{const i=r?`${r}[^/]+`:"[^/]*";return`${i}(?=$|\\/$)`}]];const g=Object.create(null);const makeRegex=(t,r)=>{let i=g[t];if(!i){i=y.reduce(((r,i)=>r.replace(i[0],i[1].bind(t))),t);g[t]=i}return r?new RegExp(i,"i"):new RegExp(i)};const isString=t=>typeof t==="string";const checkPattern=t=>t&&isString(t)&&!a.test(t)&&t.indexOf("#")!==0;const splitPattern=t=>t.split(u);class IgnoreRule{constructor(t,r,i,o){this.origin=t;this.pattern=r;this.negative=i;this.regex=o}}const createRule=(t,r)=>{const i=t;let o=false;if(t.indexOf("!")===0){o=true;t=t.substr(1)}t=t.replace(l,"!").replace(c,"#");const a=makeRegex(t,r);return new IgnoreRule(i,t,o,a)};const throwError=(t,r)=>{throw new r(t)};const checkPath=(t,r,i)=>{if(!isString(t)){return i(`path must be a string, but got \`${r}\``,TypeError)}if(!t){return i(`path must not be empty`,TypeError)}if(checkPath.isNotRelative(t)){const t="`path.relative()`d";return i(`path should be a ${t} string, but got "${r}"`,RangeError)}return true};const isNotRelative=t=>h.test(t);checkPath.isNotRelative=isNotRelative;checkPath.convert=t=>t;class Ignore{constructor({ignorecase:t=true,ignoreCase:r=t,allowRelativePaths:i=false}={}){define(this,p,true);this._rules=[];this._ignoreCase=r;this._allowRelativePaths=i;this._initCache()}_initCache(){this._ignoreCache=Object.create(null);this._testCache=Object.create(null)}_addPattern(t){if(t&&t[p]){this._rules=this._rules.concat(t._rules);this._added=true;return}if(checkPattern(t)){const r=createRule(t,this._ignoreCase);this._added=true;this._rules.push(r)}}add(t){this._added=false;makeArray(isString(t)?splitPattern(t):t).forEach(this._addPattern,this);if(this._added){this._initCache()}return this}addPattern(t){return this.add(t)}_testOne(t,r){let i=false;let o=false;this._rules.forEach((a=>{const{negative:l}=a;if(o===l&&i!==o||l&&!i&&!o&&!r){return}const c=a.regex.test(t);if(c){i=!l;o=l}}));return{ignored:i,unignored:o}}_test(t,r,i,o){const a=t&&checkPath.convert(t);checkPath(a,t,this._allowRelativePaths?RETURN_FALSE:throwError);return this._t(a,r,i,o)}_t(t,r,i,o){if(t in r){return r[t]}if(!o){o=t.split(d)}o.pop();if(!o.length){return r[t]=this._testOne(t,i)}const a=this._t(o.join(d)+d,r,i,o);return r[t]=a.ignored?a:this._testOne(t,i)}ignores(t){return this._test(t,this._ignoreCache,false).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return makeArray(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,true)}}const factory=t=>new Ignore(t);const isPathValid=t=>checkPath(t&&checkPath.convert(t),t,RETURN_FALSE);factory.isPathValid=isPathValid;factory.default=factory;t.exports=factory;if(typeof process!=="undefined"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){const makePosix=t=>/^\\\\\?\\/.test(t)||/["<>|\u0000-\u001F]+/u.test(t)?t:t.replace(/\\/g,"/");checkPath.convert=makePosix;const t=/^[a-z]:\//i;checkPath.isNotRelative=r=>t.test(r)||isNotRelative(r)}},8143:(t,r,i)=>{var o=i(3270);var a=Object.create(null);var l=i(9852);t.exports=o(inflight);function inflight(t,r){if(a[t]){a[t].push(r);return null}else{a[t]=[r];return makeres(t)}}function makeres(t){return l((function RES(){var r=a[t];var i=r.length;var o=slice(arguments);try{for(var l=0;l<i;l++){r[l].apply(null,o)}}finally{if(r.length>i){r.splice(0,i);process.nextTick((function(){RES.apply(null,o)}))}else{delete a[t]}}}))}function slice(t){var r=t.length;var i=[];for(var o=0;o<r;o++)i[o]=t[o];return i}},2842:(t,r,i)=>{try{var o=i(3837);if(typeof o.inherits!=="function")throw"";t.exports=o.inherits}catch(r){t.exports=i(3782)}},3782:t=>{if(typeof Object.create==="function"){t.exports=function inherits(t,r){if(r){t.super_=r;t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}})}}}else{t.exports=function inherits(t,r){if(r){t.super_=r;var TempCtor=function(){};TempCtor.prototype=r.prototype;t.prototype=new TempCtor;t.prototype.constructor=t}}}},7036:(t,r)=>{r.parse=r.decode=decode;r.stringify=r.encode=encode;r.safe=safe;r.unsafe=unsafe;var i=typeof process!=="undefined"&&process.platform==="win32"?"\r\n":"\n";function encode(t,r){var o=[];var a="";if(typeof r==="string"){r={section:r,whitespace:false}}else{r=r||{};r.whitespace=r.whitespace===true}var l=r.whitespace?" = ":"=";Object.keys(t).forEach((function(r,c,u){var h=t[r];if(h&&Array.isArray(h)){h.forEach((function(t){a+=safe(r+"[]")+l+safe(t)+"\n"}))}else if(h&&typeof h==="object")o.push(r);else a+=safe(r)+l+safe(h)+i}));if(r.section&&a.length)a="["+safe(r.section)+"]"+i+a;o.forEach((function(o,l,c){var u=dotSplit(o).join("\\.");var h=(r.section?r.section+".":"")+u;var d=encode(t[o],{section:h,whitespace:r.whitespace});if(a.length&&d.length)a+=i;a+=d}));return a}function dotSplit(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map((function(t){return t.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")}))}function decode(t){var r={};var i=r;var o=null;var a=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;var l=t.split(/[\r\n]+/g);l.forEach((function(t,l,c){if(!t||t.match(/^\s*[;#]/))return;var u=t.match(a);if(!u)return;if(u[1]!==undefined){o=unsafe(u[1]);if(o==="__proto__"){i={};return}i=r[o]=r[o]||{};return}var h=unsafe(u[2]);if(h==="__proto__")return;var d=u[3]?unsafe(u[4]):true;switch(d){case"true":case"false":case"null":d=JSON.parse(d)}if(h.length>2&&h.slice(-2)==="[]"){h=h.substring(0,h.length-2);if(h==="__proto__")return;if(!i[h])i[h]=[];else if(!Array.isArray(i[h]))i[h]=[i[h]]}if(Array.isArray(i[h]))i[h].push(d);else i[h]=d}));Object.keys(r).filter((function(t,i,o){if(!r[t]||typeof r[t]!=="object"||Array.isArray(r[t]))return false;var a=dotSplit(t);var l=r;var c=a.pop();var u=c.replace(/\\\./g,".");a.forEach((function(t,r,i){if(t==="__proto__")return;if(!l[t]||typeof l[t]!=="object")l[t]={};l=l[t]}));if(l===r&&u===c)return false;l[u]=r[t];return true})).forEach((function(t,i,o){delete r[t]}));return r}function isQuoted(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function safe(t){return typeof t!=="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&isQuoted(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function unsafe(t,r){t=(t||"").trim();if(isQuoted(t)){if(t.charAt(0)==="'")t=t.substr(1,t.length-2);try{t=JSON.parse(t)}catch(t){}}else{var i=false;var o="";for(var a=0,l=t.length;a<l;a++){var c=t.charAt(a);if(i){if("\\;#".indexOf(c)!==-1)o+=c;else o+="\\"+c;i=false}else if(";#".indexOf(c)!==-1)break;else if(c==="\\")i=true;else o+=c}if(i)o+="\\";return o.trim()}return t}},9999:t=>{
84
+ */const o=i(3837);const a=i(492);const isObject=t=>t!==null&&typeof t==="object"&&!Array.isArray(t);const transform=t=>r=>t===true?Number(r):String(r);const isValidValue=t=>typeof t==="number"||typeof t==="string"&&t!=="";const isNumber=t=>Number.isInteger(+t);const zeros=t=>{let r=`${t}`;let i=-1;if(r[0]==="-")r=r.slice(1);if(r==="0")return false;while(r[++i]==="0");return i>0};const stringify=(t,r,i)=>{if(typeof t==="string"||typeof r==="string"){return true}return i.stringify===true};const pad=(t,r,i)=>{if(r>0){let i=t[0]==="-"?"-":"";if(i)t=t.slice(1);t=i+t.padStart(i?r-1:r,"0")}if(i===false){return String(t)}return t};const toMaxLen=(t,r)=>{let i=t[0]==="-"?"-":"";if(i){t=t.slice(1);r--}while(t.length<r)t="0"+t;return i?"-"+t:t};const toSequence=(t,r)=>{t.negatives.sort(((t,r)=>t<r?-1:t>r?1:0));t.positives.sort(((t,r)=>t<r?-1:t>r?1:0));let i=r.capture?"":"?:";let o="";let a="";let l;if(t.positives.length){o=t.positives.join("|")}if(t.negatives.length){a=`-(${i}${t.negatives.join("|")})`}if(o&&a){l=`${o}|${a}`}else{l=o||a}if(r.wrap){return`(${i}${l})`}return l};const toRange=(t,r,i,o)=>{if(i){return a(t,r,{wrap:false,...o})}let l=String.fromCharCode(t);if(t===r)return l;let c=String.fromCharCode(r);return`[${l}-${c}]`};const toRegex=(t,r,i)=>{if(Array.isArray(t)){let r=i.wrap===true;let o=i.capture?"":"?:";return r?`(${o}${t.join("|")})`:t.join("|")}return a(t,r,i)};const rangeError=(...t)=>new RangeError("Invalid range arguments: "+o.inspect(...t));const invalidRange=(t,r,i)=>{if(i.strictRanges===true)throw rangeError([t,r]);return[]};const invalidStep=(t,r)=>{if(r.strictRanges===true){throw new TypeError(`Expected step "${t}" to be a number`)}return[]};const fillNumbers=(t,r,i=1,o={})=>{let a=Number(t);let l=Number(r);if(!Number.isInteger(a)||!Number.isInteger(l)){if(o.strictRanges===true)throw rangeError([t,r]);return[]}if(a===0)a=0;if(l===0)l=0;let c=a>l;let u=String(t);let h=String(r);let d=String(i);i=Math.max(Math.abs(i),1);let p=zeros(u)||zeros(h)||zeros(d);let m=p?Math.max(u.length,h.length,d.length):0;let y=p===false&&stringify(t,r,o)===false;let g=o.transform||transform(y);if(o.toRegex&&i===1){return toRange(toMaxLen(t,m),toMaxLen(r,m),true,o)}let b={negatives:[],positives:[]};let push=t=>b[t<0?"negatives":"positives"].push(Math.abs(t));let v=[];let _=0;while(c?a>=l:a<=l){if(o.toRegex===true&&i>1){push(a)}else{v.push(pad(g(a,_),m,y))}a=c?a-i:a+i;_++}if(o.toRegex===true){return i>1?toSequence(b,o):toRegex(v,null,{wrap:false,...o})}return v};const fillLetters=(t,r,i=1,o={})=>{if(!isNumber(t)&&t.length>1||!isNumber(r)&&r.length>1){return invalidRange(t,r,o)}let a=o.transform||(t=>String.fromCharCode(t));let l=`${t}`.charCodeAt(0);let c=`${r}`.charCodeAt(0);let u=l>c;let h=Math.min(l,c);let d=Math.max(l,c);if(o.toRegex&&i===1){return toRange(h,d,false,o)}let p=[];let m=0;while(u?l>=c:l<=c){p.push(a(l,m));l=u?l-i:l+i;m++}if(o.toRegex===true){return toRegex(p,null,{wrap:false,options:o})}return p};const fill=(t,r,i,o={})=>{if(r==null&&isValidValue(t)){return[t]}if(!isValidValue(t)||!isValidValue(r)){return invalidRange(t,r,o)}if(typeof i==="function"){return fill(t,r,1,{transform:i})}if(isObject(i)){return fill(t,r,0,i)}let a={...o};if(a.capture===true)a.wrap=true;i=i||a.step||1;if(!isNumber(i)){if(i!=null&&!isObject(i))return invalidStep(i,a);return fill(t,r,1,i)}if(isNumber(t)&&isNumber(r)){return fillNumbers(t,r,i,a)}return fillLetters(t,r,Math.max(Math.abs(i),1),a)};t.exports=fill},2439:(t,r,i)=>{t.exports=i(7147).constants||i(2057)},644:(t,r,i)=>{"use strict";const o=i(9974);const a=i(2361).EventEmitter;const l=i(7147);let c=l.writev;if(!c){const t=process.binding("fs");const r=t.FSReqWrap||t.FSReqCallback;c=(i,o,a,l)=>{const done=(t,r)=>l(t,r,o);const c=new r;c.oncomplete=done;t.writeBuffers(i,o,a,c)}}const u=Symbol("_autoClose");const h=Symbol("_close");const d=Symbol("_ended");const p=Symbol("_fd");const m=Symbol("_finished");const y=Symbol("_flags");const g=Symbol("_flush");const b=Symbol("_handleChunk");const v=Symbol("_makeBuf");const _=Symbol("_mode");const w=Symbol("_needDrain");const E=Symbol("_onerror");const S=Symbol("_onopen");const O=Symbol("_onread");const R=Symbol("_onwrite");const x=Symbol("_open");const k=Symbol("_path");const T=Symbol("_pos");const A=Symbol("_queue");const C=Symbol("_read");const P=Symbol("_readSize");const I=Symbol("_reading");const L=Symbol("_remain");const M=Symbol("_size");const D=Symbol("_write");const N=Symbol("_writing");const j=Symbol("_defaultFlag");const B=Symbol("_errored");class ReadStream extends o{constructor(t,r){r=r||{};super(r);this.readable=true;this.writable=false;if(typeof t!=="string")throw new TypeError("path must be a string");this[B]=false;this[p]=typeof r.fd==="number"?r.fd:null;this[k]=t;this[P]=r.readSize||16*1024*1024;this[I]=false;this[M]=typeof r.size==="number"?r.size:Infinity;this[L]=this[M];this[u]=typeof r.autoClose==="boolean"?r.autoClose:true;if(typeof this[p]==="number")this[C]();else this[x]()}get fd(){return this[p]}get path(){return this[k]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[x](){l.open(this[k],"r",((t,r)=>this[S](t,r)))}[S](t,r){if(t)this[E](t);else{this[p]=r;this.emit("open",r);this[C]()}}[v](){return Buffer.allocUnsafe(Math.min(this[P],this[L]))}[C](){if(!this[I]){this[I]=true;const t=this[v]();if(t.length===0)return process.nextTick((()=>this[O](null,0,t)));l.read(this[p],t,0,t.length,null,((t,r,i)=>this[O](t,r,i)))}}[O](t,r,i){this[I]=false;if(t)this[E](t);else if(this[b](r,i))this[C]()}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;l.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}[E](t){this[I]=true;this[h]();this.emit("error",t)}[b](t,r){let i=false;this[L]-=t;if(t>0)i=super.write(t<r.length?r.slice(0,t):r);if(t===0||this[L]<=0){i=false;this[h]();super.end()}return i}emit(t,r){switch(t){case"prefinish":case"finish":break;case"drain":if(typeof this[p]==="number")this[C]();break;case"error":if(this[B])return;this[B]=true;return super.emit(t,r);default:return super.emit(t,r)}}}class ReadStreamSync extends ReadStream{[x](){let t=true;try{this[S](null,l.openSync(this[k],"r"));t=false}finally{if(t)this[h]()}}[C](){let t=true;try{if(!this[I]){this[I]=true;do{const t=this[v]();const r=t.length===0?0:l.readSync(this[p],t,0,t.length,null);if(!this[b](r,t))break}while(true);this[I]=false}t=false}finally{if(t)this[h]()}}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;l.closeSync(t);this.emit("close")}}}class WriteStream extends a{constructor(t,r){r=r||{};super(r);this.readable=false;this.writable=true;this[B]=false;this[N]=false;this[d]=false;this[w]=false;this[A]=[];this[k]=t;this[p]=typeof r.fd==="number"?r.fd:null;this[_]=r.mode===undefined?438:r.mode;this[T]=typeof r.start==="number"?r.start:null;this[u]=typeof r.autoClose==="boolean"?r.autoClose:true;const i=this[T]!==null?"r+":"w";this[j]=r.flags===undefined;this[y]=this[j]?i:r.flags;if(this[p]===null)this[x]()}emit(t,r){if(t==="error"){if(this[B])return;this[B]=true}return super.emit(t,r)}get fd(){return this[p]}get path(){return this[k]}[E](t){this[h]();this[N]=true;this.emit("error",t)}[x](){l.open(this[k],this[y],this[_],((t,r)=>this[S](t,r)))}[S](t,r){if(this[j]&&this[y]==="r+"&&t&&t.code==="ENOENT"){this[y]="w";this[x]()}else if(t)this[E](t);else{this[p]=r;this.emit("open",r);this[g]()}}end(t,r){if(t)this.write(t,r);this[d]=true;if(!this[N]&&!this[A].length&&typeof this[p]==="number")this[R](null,0);return this}write(t,r){if(typeof t==="string")t=Buffer.from(t,r);if(this[d]){this.emit("error",new Error("write() after end()"));return false}if(this[p]===null||this[N]||this[A].length){this[A].push(t);this[w]=true;return false}this[N]=true;this[D](t);return true}[D](t){l.write(this[p],t,0,t.length,this[T],((t,r)=>this[R](t,r)))}[R](t,r){if(t)this[E](t);else{if(this[T]!==null)this[T]+=r;if(this[A].length)this[g]();else{this[N]=false;if(this[d]&&!this[m]){this[m]=true;this[h]();this.emit("finish")}else if(this[w]){this[w]=false;this.emit("drain")}}}}[g](){if(this[A].length===0){if(this[d])this[R](null,0)}else if(this[A].length===1)this[D](this[A].pop());else{const t=this[A];this[A]=[];c(this[p],t,this[T],((t,r)=>this[R](t,r)))}}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;l.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}}class WriteStreamSync extends WriteStream{[x](){let t;if(this[j]&&this[y]==="r+"){try{t=l.openSync(this[k],this[y],this[_])}catch(t){if(t.code==="ENOENT"){this[y]="w";return this[x]()}else throw t}}else t=l.openSync(this[k],this[y],this[_]);this[S](null,t)}[h](){if(this[u]&&typeof this[p]==="number"){const t=this[p];this[p]=null;l.closeSync(t);this.emit("close")}}[D](t){let r=true;try{this[R](null,l.writeSync(this[p],t,0,t.length,this[T]));r=false}finally{if(r)try{this[h]()}catch(t){}}}}r.ReadStream=ReadStream;r.ReadStreamSync=ReadStreamSync;r.WriteStream=WriteStream;r.WriteStreamSync=WriteStreamSync},3981:(t,r,i)=>{t.exports=realpath;realpath.realpath=realpath;realpath.sync=realpathSync;realpath.realpathSync=realpathSync;realpath.monkeypatch=monkeypatch;realpath.unmonkeypatch=unmonkeypatch;var o=i(7147);var a=o.realpath;var l=o.realpathSync;var c=process.version;var u=/^v[0-5]\./.test(c);var h=i(3623);function newError(t){return t&&t.syscall==="realpath"&&(t.code==="ELOOP"||t.code==="ENOMEM"||t.code==="ENAMETOOLONG")}function realpath(t,r,i){if(u){return a(t,r,i)}if(typeof r==="function"){i=r;r=null}a(t,r,(function(o,a){if(newError(o)){h.realpath(t,r,i)}else{i(o,a)}}))}function realpathSync(t,r){if(u){return l(t,r)}try{return l(t,r)}catch(i){if(newError(i)){return h.realpathSync(t,r)}else{throw i}}}function monkeypatch(){o.realpath=realpath;o.realpathSync=realpathSync}function unmonkeypatch(){o.realpath=a;o.realpathSync=l}},3623:(t,r,i)=>{var o=i(1017);var a=process.platform==="win32";var l=i(7147);var c=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function rethrow(){var t;if(c){var r=new Error;t=debugCallback}else t=missingCallback;return t;function debugCallback(t){if(t){r.message=t.message;t=r;missingCallback(t)}}function missingCallback(t){if(t){if(process.throwDeprecation)throw t;else if(!process.noDeprecation){var r="fs: missing callback "+(t.stack||t.message);if(process.traceDeprecation)console.trace(r);else console.error(r)}}}}function maybeCallback(t){return typeof t==="function"?t:rethrow()}var u=o.normalize;if(a){var h=/(.*?)(?:[\/\\]+|$)/g}else{var h=/(.*?)(?:[\/]+|$)/g}if(a){var d=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/}else{var d=/^[\/]*/}r.realpathSync=function realpathSync(t,r){t=o.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return r[t]}var i=t,c={},u={};var p;var m;var y;var g;start();function start(){var r=d.exec(t);p=r[0].length;m=r[0];y=r[0];g="";if(a&&!u[y]){l.lstatSync(y);u[y]=true}}while(p<t.length){h.lastIndex=p;var b=h.exec(t);g=m;m+=b[0];y=g+b[1];p=h.lastIndex;if(u[y]||r&&r[y]===y){continue}var v;if(r&&Object.prototype.hasOwnProperty.call(r,y)){v=r[y]}else{var _=l.lstatSync(y);if(!_.isSymbolicLink()){u[y]=true;if(r)r[y]=y;continue}var w=null;if(!a){var E=_.dev.toString(32)+":"+_.ino.toString(32);if(c.hasOwnProperty(E)){w=c[E]}}if(w===null){l.statSync(y);w=l.readlinkSync(y)}v=o.resolve(g,w);if(r)r[y]=v;if(!a)c[E]=w}t=o.resolve(v,t.slice(p));start()}if(r)r[i]=t;return t};r.realpath=function realpath(t,r,i){if(typeof i!=="function"){i=maybeCallback(r);r=null}t=o.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return process.nextTick(i.bind(null,null,r[t]))}var c=t,u={},p={};var m;var y;var g;var b;start();function start(){var r=d.exec(t);m=r[0].length;y=r[0];g=r[0];b="";if(a&&!p[g]){l.lstat(g,(function(t){if(t)return i(t);p[g]=true;LOOP()}))}else{process.nextTick(LOOP)}}function LOOP(){if(m>=t.length){if(r)r[c]=t;return i(null,t)}h.lastIndex=m;var o=h.exec(t);b=y;y+=o[0];g=b+o[1];m=h.lastIndex;if(p[g]||r&&r[g]===g){return process.nextTick(LOOP)}if(r&&Object.prototype.hasOwnProperty.call(r,g)){return gotResolvedLink(r[g])}return l.lstat(g,gotStat)}function gotStat(t,o){if(t)return i(t);if(!o.isSymbolicLink()){p[g]=true;if(r)r[g]=g;return process.nextTick(LOOP)}if(!a){var c=o.dev.toString(32)+":"+o.ino.toString(32);if(u.hasOwnProperty(c)){return gotTarget(null,u[c],g)}}l.stat(g,(function(t){if(t)return i(t);l.readlink(g,(function(t,r){if(!a)u[c]=r;gotTarget(t,r)}))}))}function gotTarget(t,a,l){if(t)return i(t);var c=o.resolve(b,a);if(r)r[l]=c;gotResolvedLink(c)}function gotResolvedLink(r){t=o.resolve(r,t.slice(m));start()}}},8898:(t,r,i)=>{"use strict";const{PassThrough:o}=i(2781);t.exports=t=>{t={...t};const{array:r}=t;let{encoding:i}=t;const a=i==="buffer";let l=false;if(r){l=!(i||a)}else{i=i||"utf8"}if(a){i=null}const c=new o({objectMode:l});if(i){c.setEncoding(i)}let u=0;const h=[];c.on("data",(t=>{h.push(t);if(l){u=h.length}else{u+=t.length}}));c.getBufferedValue=()=>{if(r){return h}return a?Buffer.concat(h,u):h.join("")};c.getBufferedLength=()=>u;return c}},367:(t,r,i)=>{"use strict";const{constants:o}=i(4300);const a=i(2781);const{promisify:l}=i(3837);const c=i(8898);const u=l(a.pipeline);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(t,r){if(!t){throw new Error("Expected a stream")}r={maxBuffer:Infinity,...r};const{maxBuffer:i}=r;const a=c(r);await new Promise(((r,l)=>{const rejectPromise=t=>{if(t&&a.getBufferedLength()<=o.MAX_LENGTH){t.bufferedData=a.getBufferedValue()}l(t)};(async()=>{try{await u(t,a);r()}catch(t){rejectPromise(t)}})();a.on("data",(()=>{if(a.getBufferedLength()>i){rejectPromise(new MaxBufferError)}}))}));return a.getBufferedValue()}t.exports=getStream;t.exports.buffer=(t,r)=>getStream(t,{...r,encoding:"buffer"});t.exports.array=(t,r)=>getStream(t,{...r,array:true});t.exports.MaxBufferError=MaxBufferError},7080:(t,r,i)=>{"use strict";var o=i(2755);var a=i(1017).posix.dirname;var l=i(2037).platform()==="win32";var c="/";var u=/\\/g;var h=/[\{\[].*[\}\]]$/;var d=/(^|[^\\])([\{\[]|\([^\)]+$)/;var p=/\\([\!\*\?\|\[\]\(\)\{\}])/g;t.exports=function globParent(t,r){var i=Object.assign({flipBackslashes:true},r);if(i.flipBackslashes&&l&&t.indexOf(c)<0){t=t.replace(u,c)}if(h.test(t)){t+=c}t+="a";do{t=a(t)}while(o(t)||d.test(t));return t.replace(p,"$1")}},569:(t,r,i)=>{r.setopts=setopts;r.ownProp=ownProp;r.makeAbs=makeAbs;r.finish=finish;r.mark=mark;r.isIgnored=isIgnored;r.childrenIgnored=childrenIgnored;function ownProp(t,r){return Object.prototype.hasOwnProperty.call(t,r)}var o=i(7147);var a=i(1017);var l=i(8923);var c=i(6230);var u=l.Minimatch;function alphasort(t,r){return t.localeCompare(r,"en")}function setupIgnores(t,r){t.ignore=r.ignore||[];if(!Array.isArray(t.ignore))t.ignore=[t.ignore];if(t.ignore.length){t.ignore=t.ignore.map(ignoreMap)}}function ignoreMap(t){var r=null;if(t.slice(-3)==="/**"){var i=t.replace(/(\/\*\*)+$/,"");r=new u(i,{dot:true})}return{matcher:new u(t,{dot:true}),gmatcher:r}}function setopts(t,r,i){if(!i)i={};if(i.matchBase&&-1===r.indexOf("/")){if(i.noglobstar){throw new Error("base matching requires globstar")}r="**/"+r}t.silent=!!i.silent;t.pattern=r;t.strict=i.strict!==false;t.realpath=!!i.realpath;t.realpathCache=i.realpathCache||Object.create(null);t.follow=!!i.follow;t.dot=!!i.dot;t.mark=!!i.mark;t.nodir=!!i.nodir;if(t.nodir)t.mark=true;t.sync=!!i.sync;t.nounique=!!i.nounique;t.nonull=!!i.nonull;t.nosort=!!i.nosort;t.nocase=!!i.nocase;t.stat=!!i.stat;t.noprocess=!!i.noprocess;t.absolute=!!i.absolute;t.fs=i.fs||o;t.maxLength=i.maxLength||Infinity;t.cache=i.cache||Object.create(null);t.statCache=i.statCache||Object.create(null);t.symlinks=i.symlinks||Object.create(null);setupIgnores(t,i);t.changedCwd=false;var l=process.cwd();if(!ownProp(i,"cwd"))t.cwd=l;else{t.cwd=a.resolve(i.cwd);t.changedCwd=t.cwd!==l}t.root=i.root||a.resolve(t.cwd,"/");t.root=a.resolve(t.root);if(process.platform==="win32")t.root=t.root.replace(/\\/g,"/");t.cwdAbs=c(t.cwd)?t.cwd:makeAbs(t,t.cwd);if(process.platform==="win32")t.cwdAbs=t.cwdAbs.replace(/\\/g,"/");t.nomount=!!i.nomount;i.nonegate=true;i.nocomment=true;i.allowWindowsEscape=false;t.minimatch=new u(r,i);t.options=t.minimatch.options}function finish(t){var r=t.nounique;var i=r?[]:Object.create(null);for(var o=0,a=t.matches.length;o<a;o++){var l=t.matches[o];if(!l||Object.keys(l).length===0){if(t.nonull){var c=t.minimatch.globSet[o];if(r)i.push(c);else i[c]=true}}else{var u=Object.keys(l);if(r)i.push.apply(i,u);else u.forEach((function(t){i[t]=true}))}}if(!r)i=Object.keys(i);if(!t.nosort)i=i.sort(alphasort);if(t.mark){for(var o=0;o<i.length;o++){i[o]=t._mark(i[o])}if(t.nodir){i=i.filter((function(r){var i=!/\/$/.test(r);var o=t.cache[r]||t.cache[makeAbs(t,r)];if(i&&o)i=o!=="DIR"&&!Array.isArray(o);return i}))}}if(t.ignore.length)i=i.filter((function(r){return!isIgnored(t,r)}));t.found=i}function mark(t,r){var i=makeAbs(t,r);var o=t.cache[i];var a=r;if(o){var l=o==="DIR"||Array.isArray(o);var c=r.slice(-1)==="/";if(l&&!c)a+="/";else if(!l&&c)a=a.slice(0,-1);if(a!==r){var u=makeAbs(t,a);t.statCache[u]=t.statCache[i];t.cache[u]=t.cache[i]}}return a}function makeAbs(t,r){var i=r;if(r.charAt(0)==="/"){i=a.join(t.root,r)}else if(c(r)||r===""){i=r}else if(t.changedCwd){i=a.resolve(t.cwd,r)}else{i=a.resolve(r)}if(process.platform==="win32")i=i.replace(/\\/g,"/");return i}function isIgnored(t,r){if(!t.ignore.length)return false;return t.ignore.some((function(t){return t.matcher.match(r)||!!(t.gmatcher&&t.gmatcher.match(r))}))}function childrenIgnored(t,r){if(!t.ignore.length)return false;return t.ignore.some((function(t){return!!(t.gmatcher&&t.gmatcher.match(r))}))}},4991:(t,r,i)=>{t.exports=glob;var o=i(3981);var a=i(8923);var l=a.Minimatch;var c=i(2842);var u=i(2361).EventEmitter;var h=i(1017);var d=i(9491);var p=i(6230);var m=i(4003);var y=i(569);var g=y.setopts;var b=y.ownProp;var v=i(8143);var _=i(3837);var w=y.childrenIgnored;var E=y.isIgnored;var S=i(9852);function glob(t,r,i){if(typeof r==="function")i=r,r={};if(!r)r={};if(r.sync){if(i)throw new TypeError("callback provided to sync glob");return m(t,r)}return new Glob(t,r,i)}glob.sync=m;var O=glob.GlobSync=m.GlobSync;glob.glob=glob;function extend(t,r){if(r===null||typeof r!=="object"){return t}var i=Object.keys(r);var o=i.length;while(o--){t[i[o]]=r[i[o]]}return t}glob.hasMagic=function(t,r){var i=extend({},r);i.noprocess=true;var o=new Glob(t,i);var a=o.minimatch.set;if(!t)return false;if(a.length>1)return true;for(var l=0;l<a[0].length;l++){if(typeof a[0][l]!=="string")return true}return false};glob.Glob=Glob;c(Glob,u);function Glob(t,r,i){if(typeof r==="function"){i=r;r=null}if(r&&r.sync){if(i)throw new TypeError("callback provided to sync glob");return new O(t,r)}if(!(this instanceof Glob))return new Glob(t,r,i);g(this,t,r);this._didRealPath=false;var o=this.minimatch.set.length;this.matches=new Array(o);if(typeof i==="function"){i=S(i);this.on("error",i);this.on("end",(function(t){i(null,t)}))}var a=this;this._processing=0;this._emitQueue=[];this._processQueue=[];this.paused=false;if(this.noprocess)return this;if(o===0)return done();var l=true;for(var c=0;c<o;c++){this._process(this.minimatch.set[c],c,false,done)}l=false;function done(){--a._processing;if(a._processing<=0){if(l){process.nextTick((function(){a._finish()}))}else{a._finish()}}}}Glob.prototype._finish=function(){d(this instanceof Glob);if(this.aborted)return;if(this.realpath&&!this._didRealpath)return this._realpath();y.finish(this);this.emit("end",this.found)};Glob.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=true;var t=this.matches.length;if(t===0)return this._finish();var r=this;for(var i=0;i<this.matches.length;i++)this._realpathSet(i,next);function next(){if(--t===0)r._finish()}};Glob.prototype._realpathSet=function(t,r){var i=this.matches[t];if(!i)return r();var a=Object.keys(i);var l=this;var c=a.length;if(c===0)return r();var u=this.matches[t]=Object.create(null);a.forEach((function(i,a){i=l._makeAbs(i);o.realpath(i,l.realpathCache,(function(o,a){if(!o)u[a]=true;else if(o.syscall==="stat")u[i]=true;else l.emit("error",o);if(--c===0){l.matches[t]=u;r()}}))}))};Glob.prototype._mark=function(t){return y.mark(this,t)};Glob.prototype._makeAbs=function(t){return y.makeAbs(this,t)};Glob.prototype.abort=function(){this.aborted=true;this.emit("abort")};Glob.prototype.pause=function(){if(!this.paused){this.paused=true;this.emit("pause")}};Glob.prototype.resume=function(){if(this.paused){this.emit("resume");this.paused=false;if(this._emitQueue.length){var t=this._emitQueue.slice(0);this._emitQueue.length=0;for(var r=0;r<t.length;r++){var i=t[r];this._emitMatch(i[0],i[1])}}if(this._processQueue.length){var o=this._processQueue.slice(0);this._processQueue.length=0;for(var r=0;r<o.length;r++){var a=o[r];this._processing--;this._process(a[0],a[1],a[2],a[3])}}}};Glob.prototype._process=function(t,r,i,o){d(this instanceof Glob);d(typeof o==="function");if(this.aborted)return;this._processing++;if(this.paused){this._processQueue.push([t,r,i,o]);return}var l=0;while(typeof t[l]==="string"){l++}var c;switch(l){case t.length:this._processSimple(t.join("/"),r,o);return;case 0:c=null;break;default:c=t.slice(0,l).join("/");break}var u=t.slice(l);var h;if(c===null)h=".";else if(p(c)||p(t.map((function(t){return typeof t==="string"?t:"[*]"})).join("/"))){if(!c||!p(c))c="/"+c;h=c}else h=c;var m=this._makeAbs(h);if(w(this,h))return o();var y=u[0]===a.GLOBSTAR;if(y)this._processGlobStar(c,h,m,u,r,i,o);else this._processReaddir(c,h,m,u,r,i,o)};Glob.prototype._processReaddir=function(t,r,i,o,a,l,c){var u=this;this._readdir(i,l,(function(h,d){return u._processReaddir2(t,r,i,o,a,l,d,c)}))};Glob.prototype._processReaddir2=function(t,r,i,o,a,l,c,u){if(!c)return u();var d=o[0];var p=!!this.minimatch.negate;var m=d._glob;var y=this.dot||m.charAt(0)===".";var g=[];for(var b=0;b<c.length;b++){var v=c[b];if(v.charAt(0)!=="."||y){var _;if(p&&!t){_=!v.match(d)}else{_=v.match(d)}if(_)g.push(v)}}var w=g.length;if(w===0)return u();if(o.length===1&&!this.mark&&!this.stat){if(!this.matches[a])this.matches[a]=Object.create(null);for(var b=0;b<w;b++){var v=g[b];if(t){if(t!=="/")v=t+"/"+v;else v=t+v}if(v.charAt(0)==="/"&&!this.nomount){v=h.join(this.root,v)}this._emitMatch(a,v)}return u()}o.shift();for(var b=0;b<w;b++){var v=g[b];var E;if(t){if(t!=="/")v=t+"/"+v;else v=t+v}this._process([v].concat(o),a,l,u)}u()};Glob.prototype._emitMatch=function(t,r){if(this.aborted)return;if(E(this,r))return;if(this.paused){this._emitQueue.push([t,r]);return}var i=p(r)?r:this._makeAbs(r);if(this.mark)r=this._mark(r);if(this.absolute)r=i;if(this.matches[t][r])return;if(this.nodir){var o=this.cache[i];if(o==="DIR"||Array.isArray(o))return}this.matches[t][r]=true;var a=this.statCache[i];if(a)this.emit("stat",r,a);this.emit("match",r)};Glob.prototype._readdirInGlobStar=function(t,r){if(this.aborted)return;if(this.follow)return this._readdir(t,false,r);var i="lstat\0"+t;var o=this;var a=v(i,lstatcb_);if(a)o.fs.lstat(t,a);function lstatcb_(i,a){if(i&&i.code==="ENOENT")return r();var l=a&&a.isSymbolicLink();o.symlinks[t]=l;if(!l&&a&&!a.isDirectory()){o.cache[t]="FILE";r()}else o._readdir(t,false,r)}};Glob.prototype._readdir=function(t,r,i){if(this.aborted)return;i=v("readdir\0"+t+"\0"+r,i);if(!i)return;if(r&&!b(this.symlinks,t))return this._readdirInGlobStar(t,i);if(b(this.cache,t)){var o=this.cache[t];if(!o||o==="FILE")return i();if(Array.isArray(o))return i(null,o)}var a=this;a.fs.readdir(t,readdirCb(this,t,i))};function readdirCb(t,r,i){return function(o,a){if(o)t._readdirError(r,o,i);else t._readdirEntries(r,a,i)}}Glob.prototype._readdirEntries=function(t,r,i){if(this.aborted)return;if(!this.mark&&!this.stat){for(var o=0;o<r.length;o++){var a=r[o];if(t==="/")a=t+a;else a=t+"/"+a;this.cache[a]=true}}this.cache[t]=r;return i(null,r)};Glob.prototype._readdirError=function(t,r,i){if(this.aborted)return;switch(r.code){case"ENOTSUP":case"ENOTDIR":var o=this._makeAbs(t);this.cache[o]="FILE";if(o===this.cwdAbs){var a=new Error(r.code+" invalid cwd "+this.cwd);a.path=this.cwd;a.code=r.code;this.emit("error",a);this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=false;break;default:this.cache[this._makeAbs(t)]=false;if(this.strict){this.emit("error",r);this.abort()}if(!this.silent)console.error("glob error",r);break}return i()};Glob.prototype._processGlobStar=function(t,r,i,o,a,l,c){var u=this;this._readdir(i,l,(function(h,d){u._processGlobStar2(t,r,i,o,a,l,d,c)}))};Glob.prototype._processGlobStar2=function(t,r,i,o,a,l,c,u){if(!c)return u();var h=o.slice(1);var d=t?[t]:[];var p=d.concat(h);this._process(p,a,false,u);var m=this.symlinks[i];var y=c.length;if(m&&l)return u();for(var g=0;g<y;g++){var b=c[g];if(b.charAt(0)==="."&&!this.dot)continue;var v=d.concat(c[g],h);this._process(v,a,true,u);var _=d.concat(c[g],o);this._process(_,a,true,u)}u()};Glob.prototype._processSimple=function(t,r,i){var o=this;this._stat(t,(function(a,l){o._processSimple2(t,r,a,l,i)}))};Glob.prototype._processSimple2=function(t,r,i,o,a){if(!this.matches[r])this.matches[r]=Object.create(null);if(!o)return a();if(t&&p(t)&&!this.nomount){var l=/[\/\\]$/.test(t);if(t.charAt(0)==="/"){t=h.join(this.root,t)}else{t=h.resolve(this.root,t);if(l)t+="/"}}if(process.platform==="win32")t=t.replace(/\\/g,"/");this._emitMatch(r,t);a()};Glob.prototype._stat=function(t,r){var i=this._makeAbs(t);var o=t.slice(-1)==="/";if(t.length>this.maxLength)return r();if(!this.stat&&b(this.cache,i)){var a=this.cache[i];if(Array.isArray(a))a="DIR";if(!o||a==="DIR")return r(null,a);if(o&&a==="FILE")return r()}var l;var c=this.statCache[i];if(c!==undefined){if(c===false)return r(null,c);else{var u=c.isDirectory()?"DIR":"FILE";if(o&&u==="FILE")return r();else return r(null,u,c)}}var h=this;var d=v("stat\0"+i,lstatcb_);if(d)h.fs.lstat(i,d);function lstatcb_(o,a){if(a&&a.isSymbolicLink()){return h.fs.stat(i,(function(o,l){if(o)h._stat2(t,i,null,a,r);else h._stat2(t,i,o,l,r)}))}else{h._stat2(t,i,o,a,r)}}};Glob.prototype._stat2=function(t,r,i,o,a){if(i&&(i.code==="ENOENT"||i.code==="ENOTDIR")){this.statCache[r]=false;return a()}var l=t.slice(-1)==="/";this.statCache[r]=o;if(r.slice(-1)==="/"&&o&&!o.isDirectory())return a(null,false,o);var c=true;if(o)c=o.isDirectory()?"DIR":"FILE";this.cache[r]=this.cache[r]||c;if(l&&c==="FILE")return a();return a(null,c,o)}},4003:(t,r,i)=>{t.exports=globSync;globSync.GlobSync=GlobSync;var o=i(3981);var a=i(8923);var l=a.Minimatch;var c=i(4991).Glob;var u=i(3837);var h=i(1017);var d=i(9491);var p=i(6230);var m=i(569);var y=m.setopts;var g=m.ownProp;var b=m.childrenIgnored;var v=m.isIgnored;function globSync(t,r){if(typeof r==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");return new GlobSync(t,r).found}function GlobSync(t,r){if(!t)throw new Error("must provide pattern");if(typeof r==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof GlobSync))return new GlobSync(t,r);y(this,t,r);if(this.noprocess)return this;var i=this.minimatch.set.length;this.matches=new Array(i);for(var o=0;o<i;o++){this._process(this.minimatch.set[o],o,false)}this._finish()}GlobSync.prototype._finish=function(){d.ok(this instanceof GlobSync);if(this.realpath){var t=this;this.matches.forEach((function(r,i){var a=t.matches[i]=Object.create(null);for(var l in r){try{l=t._makeAbs(l);var c=o.realpathSync(l,t.realpathCache);a[c]=true}catch(r){if(r.syscall==="stat")a[t._makeAbs(l)]=true;else throw r}}}))}m.finish(this)};GlobSync.prototype._process=function(t,r,i){d.ok(this instanceof GlobSync);var o=0;while(typeof t[o]==="string"){o++}var l;switch(o){case t.length:this._processSimple(t.join("/"),r);return;case 0:l=null;break;default:l=t.slice(0,o).join("/");break}var c=t.slice(o);var u;if(l===null)u=".";else if(p(l)||p(t.map((function(t){return typeof t==="string"?t:"[*]"})).join("/"))){if(!l||!p(l))l="/"+l;u=l}else u=l;var h=this._makeAbs(u);if(b(this,u))return;var m=c[0]===a.GLOBSTAR;if(m)this._processGlobStar(l,u,h,c,r,i);else this._processReaddir(l,u,h,c,r,i)};GlobSync.prototype._processReaddir=function(t,r,i,o,a,l){var c=this._readdir(i,l);if(!c)return;var u=o[0];var d=!!this.minimatch.negate;var p=u._glob;var m=this.dot||p.charAt(0)===".";var y=[];for(var g=0;g<c.length;g++){var b=c[g];if(b.charAt(0)!=="."||m){var v;if(d&&!t){v=!b.match(u)}else{v=b.match(u)}if(v)y.push(b)}}var _=y.length;if(_===0)return;if(o.length===1&&!this.mark&&!this.stat){if(!this.matches[a])this.matches[a]=Object.create(null);for(var g=0;g<_;g++){var b=y[g];if(t){if(t.slice(-1)!=="/")b=t+"/"+b;else b=t+b}if(b.charAt(0)==="/"&&!this.nomount){b=h.join(this.root,b)}this._emitMatch(a,b)}return}o.shift();for(var g=0;g<_;g++){var b=y[g];var w;if(t)w=[t,b];else w=[b];this._process(w.concat(o),a,l)}};GlobSync.prototype._emitMatch=function(t,r){if(v(this,r))return;var i=this._makeAbs(r);if(this.mark)r=this._mark(r);if(this.absolute){r=i}if(this.matches[t][r])return;if(this.nodir){var o=this.cache[i];if(o==="DIR"||Array.isArray(o))return}this.matches[t][r]=true;if(this.stat)this._stat(r)};GlobSync.prototype._readdirInGlobStar=function(t){if(this.follow)return this._readdir(t,false);var r;var i;var o;try{i=this.fs.lstatSync(t)}catch(t){if(t.code==="ENOENT"){return null}}var a=i&&i.isSymbolicLink();this.symlinks[t]=a;if(!a&&i&&!i.isDirectory())this.cache[t]="FILE";else r=this._readdir(t,false);return r};GlobSync.prototype._readdir=function(t,r){var i;if(r&&!g(this.symlinks,t))return this._readdirInGlobStar(t);if(g(this.cache,t)){var o=this.cache[t];if(!o||o==="FILE")return null;if(Array.isArray(o))return o}try{return this._readdirEntries(t,this.fs.readdirSync(t))}catch(r){this._readdirError(t,r);return null}};GlobSync.prototype._readdirEntries=function(t,r){if(!this.mark&&!this.stat){for(var i=0;i<r.length;i++){var o=r[i];if(t==="/")o=t+o;else o=t+"/"+o;this.cache[o]=true}}this.cache[t]=r;return r};GlobSync.prototype._readdirError=function(t,r){switch(r.code){case"ENOTSUP":case"ENOTDIR":var i=this._makeAbs(t);this.cache[i]="FILE";if(i===this.cwdAbs){var o=new Error(r.code+" invalid cwd "+this.cwd);o.path=this.cwd;o.code=r.code;throw o}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=false;break;default:this.cache[this._makeAbs(t)]=false;if(this.strict)throw r;if(!this.silent)console.error("glob error",r);break}};GlobSync.prototype._processGlobStar=function(t,r,i,o,a,l){var c=this._readdir(i,l);if(!c)return;var u=o.slice(1);var h=t?[t]:[];var d=h.concat(u);this._process(d,a,false);var p=c.length;var m=this.symlinks[i];if(m&&l)return;for(var y=0;y<p;y++){var g=c[y];if(g.charAt(0)==="."&&!this.dot)continue;var b=h.concat(c[y],u);this._process(b,a,true);var v=h.concat(c[y],o);this._process(v,a,true)}};GlobSync.prototype._processSimple=function(t,r){var i=this._stat(t);if(!this.matches[r])this.matches[r]=Object.create(null);if(!i)return;if(t&&p(t)&&!this.nomount){var o=/[\/\\]$/.test(t);if(t.charAt(0)==="/"){t=h.join(this.root,t)}else{t=h.resolve(this.root,t);if(o)t+="/"}}if(process.platform==="win32")t=t.replace(/\\/g,"/");this._emitMatch(r,t)};GlobSync.prototype._stat=function(t){var r=this._makeAbs(t);var i=t.slice(-1)==="/";if(t.length>this.maxLength)return false;if(!this.stat&&g(this.cache,r)){var o=this.cache[r];if(Array.isArray(o))o="DIR";if(!i||o==="DIR")return o;if(i&&o==="FILE")return false}var a;var l=this.statCache[r];if(!l){var c;try{c=this.fs.lstatSync(r)}catch(t){if(t&&(t.code==="ENOENT"||t.code==="ENOTDIR")){this.statCache[r]=false;return false}}if(c&&c.isSymbolicLink()){try{l=this.fs.statSync(r)}catch(t){l=c}}else{l=c}}this.statCache[r]=l;var o=true;if(l)o=l.isDirectory()?"DIR":"FILE";this.cache[r]=this.cache[r]||o;if(i&&o==="FILE")return false;return o};GlobSync.prototype._mark=function(t){return m.mark(this,t)};GlobSync.prototype._makeAbs=function(t){return m.makeAbs(this,t)}},4444:t=>{"use strict";t.exports=clone;var r=Object.getPrototypeOf||function(t){return t.__proto__};function clone(t){if(t===null||typeof t!=="object")return t;if(t instanceof Object)var i={__proto__:r(t)};else var i=Object.create(null);Object.getOwnPropertyNames(t).forEach((function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))}));return i}},9165:(t,r,i)=>{var o=i(7147);var a=i(8986);var l=i(7078);var c=i(4444);var u=i(3837);var h;var d;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){h=Symbol.for("graceful-fs.queue");d=Symbol.for("graceful-fs.previous")}else{h="___graceful-fs.queue";d="___graceful-fs.previous"}function noop(){}function publishQueue(t,r){Object.defineProperty(t,h,{get:function(){return r}})}var p=noop;if(u.debuglog)p=u.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))p=function(){var t=u.format.apply(u,arguments);t="GFS4: "+t.split(/\n/).join("\nGFS4: ");console.error(t)};if(!o[h]){var m=global[h]||[];publishQueue(o,m);o.close=function(t){function close(r,i){return t.call(o,r,(function(t){if(!t){resetQueue()}if(typeof i==="function")i.apply(this,arguments)}))}Object.defineProperty(close,d,{value:t});return close}(o.close);o.closeSync=function(t){function closeSync(r){t.apply(o,arguments);resetQueue()}Object.defineProperty(closeSync,d,{value:t});return closeSync}(o.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){p(o[h]);i(9491).equal(o[h].length,0)}))}}if(!global[h]){publishQueue(global,o[h])}t.exports=patch(c(o));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!o.__patched){t.exports=patch(o);o.__patched=true}function patch(t){a(t);t.gracefulify=patch;t.createReadStream=createReadStream;t.createWriteStream=createWriteStream;var r=t.readFile;t.readFile=readFile;function readFile(t,i,o){if(typeof i==="function")o=i,i=null;return go$readFile(t,i,o);function go$readFile(t,i,o,a){return r(t,i,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$readFile,[t,i,o],r,a||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var i=t.writeFile;t.writeFile=writeFile;function writeFile(t,r,o,a){if(typeof o==="function")a=o,o=null;return go$writeFile(t,r,o,a);function go$writeFile(t,r,o,a,l){return i(t,r,o,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$writeFile,[t,r,o,a],i,l||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var o=t.appendFile;if(o)t.appendFile=appendFile;function appendFile(t,r,i,a){if(typeof i==="function")a=i,i=null;return go$appendFile(t,r,i,a);function go$appendFile(t,r,i,a,l){return o(t,r,i,(function(o){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$appendFile,[t,r,i,a],o,l||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var c=t.copyFile;if(c)t.copyFile=copyFile;function copyFile(t,r,i,o){if(typeof i==="function"){o=i;i=0}return go$copyFile(t,r,i,o);function go$copyFile(t,r,i,o,a){return c(t,r,i,(function(l){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))enqueue([go$copyFile,[t,r,i,o],l,a||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var u=t.readdir;t.readdir=readdir;var h=/^v[0-5]\./;function readdir(t,r,i){if(typeof r==="function")i=r,r=null;var o=h.test(process.version)?function go$readdir(t,r,i,o){return u(t,fs$readdirCallback(t,r,i,o))}:function go$readdir(t,r,i,o){return u(t,r,fs$readdirCallback(t,r,i,o))};return o(t,r,i);function fs$readdirCallback(t,r,i,a){return function(l,c){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))enqueue([o,[t,r,i],l,a||Date.now(),Date.now()]);else{if(c&&c.sort)c.sort();if(typeof i==="function")i.call(this,l,c)}}}}if(process.version.substr(0,4)==="v0.8"){var d=l(t);ReadStream=d.ReadStream;WriteStream=d.WriteStream}var p=t.ReadStream;if(p){ReadStream.prototype=Object.create(p.prototype);ReadStream.prototype.open=ReadStream$open}var m=t.WriteStream;if(m){WriteStream.prototype=Object.create(m.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(t,"ReadStream",{get:function(){return ReadStream},set:function(t){ReadStream=t},enumerable:true,configurable:true});Object.defineProperty(t,"WriteStream",{get:function(){return WriteStream},set:function(t){WriteStream=t},enumerable:true,configurable:true});var y=ReadStream;Object.defineProperty(t,"FileReadStream",{get:function(){return y},set:function(t){y=t},enumerable:true,configurable:true});var g=WriteStream;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(t){g=t},enumerable:true,configurable:true});function ReadStream(t,r){if(this instanceof ReadStream)return p.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(r,i){if(r){if(t.autoClose)t.destroy();t.emit("error",r)}else{t.fd=i;t.emit("open",i);t.read()}}))}function WriteStream(t,r){if(this instanceof WriteStream)return m.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(r,i){if(r){t.destroy();t.emit("error",r)}else{t.fd=i;t.emit("open",i)}}))}function createReadStream(r,i){return new t.ReadStream(r,i)}function createWriteStream(r,i){return new t.WriteStream(r,i)}var b=t.open;t.open=open;function open(t,r,i,o){if(typeof i==="function")o=i,i=null;return go$open(t,r,i,o);function go$open(t,r,i,o,a){return b(t,r,i,(function(l,c){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))enqueue([go$open,[t,r,i,o],l,a||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}return t}function enqueue(t){p("ENQUEUE",t[0].name,t[1]);o[h].push(t);retry()}var y;function resetQueue(){var t=Date.now();for(var r=0;r<o[h].length;++r){if(o[h][r].length>2){o[h][r][3]=t;o[h][r][4]=t}}retry()}function retry(){clearTimeout(y);y=undefined;if(o[h].length===0)return;var t=o[h].shift();var r=t[0];var i=t[1];var a=t[2];var l=t[3];var c=t[4];if(l===undefined){p("RETRY",r.name,i);r.apply(null,i)}else if(Date.now()-l>=6e4){p("TIMEOUT",r.name,i);var u=i.pop();if(typeof u==="function")u.call(null,a)}else{var d=Date.now()-c;var m=Math.max(c-l,1);var g=Math.min(m*1.2,100);if(d>=g){p("RETRY",r.name,i);r.apply(null,i.concat([l]))}else{o[h].push(t)}}if(y===undefined){y=setTimeout(retry,0)}}},7078:(t,r,i)=>{var o=i(2781).Stream;t.exports=legacy;function legacy(t){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(r,i){if(!(this instanceof ReadStream))return new ReadStream(r,i);o.call(this);var a=this;this.path=r;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;i=i||{};var l=Object.keys(i);for(var c=0,u=l.length;c<u;c++){var h=l[c];this[h]=i[h]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){a._read()}));return}t.open(this.path,this.flags,this.mode,(function(t,r){if(t){a.emit("error",t);a.readable=false;return}a.fd=r;a.emit("open",r);a._read()}))}function WriteStream(r,i){if(!(this instanceof WriteStream))return new WriteStream(r,i);o.call(this);this.path=r;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;i=i||{};var a=Object.keys(i);for(var l=0,c=a.length;l<c;l++){var u=a[l];this[u]=i[u]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=t.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},8986:(t,r,i)=>{var o=i(2057);var a=process.cwd;var l=null;var c=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!l)l=a.call(process);return l};try{process.cwd()}catch(t){}if(typeof process.chdir==="function"){var u=process.chdir;process.chdir=function(t){l=null;u.call(process,t)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,u)}t.exports=patch;function patch(t){if(o.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(t)}if(!t.lutimes){patchLutimes(t)}t.chown=chownFix(t.chown);t.fchown=chownFix(t.fchown);t.lchown=chownFix(t.lchown);t.chmod=chmodFix(t.chmod);t.fchmod=chmodFix(t.fchmod);t.lchmod=chmodFix(t.lchmod);t.chownSync=chownFixSync(t.chownSync);t.fchownSync=chownFixSync(t.fchownSync);t.lchownSync=chownFixSync(t.lchownSync);t.chmodSync=chmodFixSync(t.chmodSync);t.fchmodSync=chmodFixSync(t.fchmodSync);t.lchmodSync=chmodFixSync(t.lchmodSync);t.stat=statFix(t.stat);t.fstat=statFix(t.fstat);t.lstat=statFix(t.lstat);t.statSync=statFixSync(t.statSync);t.fstatSync=statFixSync(t.fstatSync);t.lstatSync=statFixSync(t.lstatSync);if(t.chmod&&!t.lchmod){t.lchmod=function(t,r,i){if(i)process.nextTick(i)};t.lchmodSync=function(){}}if(t.chown&&!t.lchown){t.lchown=function(t,r,i,o){if(o)process.nextTick(o)};t.lchownSync=function(){}}if(c==="win32"){t.rename=typeof t.rename!=="function"?t.rename:function(r){function rename(i,o,a){var l=Date.now();var c=0;r(i,o,(function CB(u){if(u&&(u.code==="EACCES"||u.code==="EPERM")&&Date.now()-l<6e4){setTimeout((function(){t.stat(o,(function(t,l){if(t&&t.code==="ENOENT")r(i,o,CB);else a(u)}))}),c);if(c<100)c+=10;return}if(a)a(u)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,r);return rename}(t.rename)}t.read=typeof t.read!=="function"?t.read:function(r){function read(i,o,a,l,c,u){var h;if(u&&typeof u==="function"){var d=0;h=function(p,m,y){if(p&&p.code==="EAGAIN"&&d<10){d++;return r.call(t,i,o,a,l,c,h)}u.apply(this,arguments)}}return r.call(t,i,o,a,l,c,h)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,r);return read}(t.read);t.readSync=typeof t.readSync!=="function"?t.readSync:function(r){return function(i,o,a,l,c){var u=0;while(true){try{return r.call(t,i,o,a,l,c)}catch(t){if(t.code==="EAGAIN"&&u<10){u++;continue}throw t}}}}(t.readSync);function patchLchmod(t){t.lchmod=function(r,i,a){t.open(r,o.O_WRONLY|o.O_SYMLINK,i,(function(r,o){if(r){if(a)a(r);return}t.fchmod(o,i,(function(r){t.close(o,(function(t){if(a)a(r||t)}))}))}))};t.lchmodSync=function(r,i){var a=t.openSync(r,o.O_WRONLY|o.O_SYMLINK,i);var l=true;var c;try{c=t.fchmodSync(a,i);l=false}finally{if(l){try{t.closeSync(a)}catch(t){}}else{t.closeSync(a)}}return c}}function patchLutimes(t){if(o.hasOwnProperty("O_SYMLINK")&&t.futimes){t.lutimes=function(r,i,a,l){t.open(r,o.O_SYMLINK,(function(r,o){if(r){if(l)l(r);return}t.futimes(o,i,a,(function(r){t.close(o,(function(t){if(l)l(r||t)}))}))}))};t.lutimesSync=function(r,i,a){var l=t.openSync(r,o.O_SYMLINK);var c;var u=true;try{c=t.futimesSync(l,i,a);u=false}finally{if(u){try{t.closeSync(l)}catch(t){}}else{t.closeSync(l)}}return c}}else if(t.futimes){t.lutimes=function(t,r,i,o){if(o)process.nextTick(o)};t.lutimesSync=function(){}}}function chmodFix(r){if(!r)return r;return function(i,o,a){return r.call(t,i,o,(function(t){if(chownErOk(t))t=null;if(a)a.apply(this,arguments)}))}}function chmodFixSync(r){if(!r)return r;return function(i,o){try{return r.call(t,i,o)}catch(t){if(!chownErOk(t))throw t}}}function chownFix(r){if(!r)return r;return function(i,o,a,l){return r.call(t,i,o,a,(function(t){if(chownErOk(t))t=null;if(l)l.apply(this,arguments)}))}}function chownFixSync(r){if(!r)return r;return function(i,o,a){try{return r.call(t,i,o,a)}catch(t){if(!chownErOk(t))throw t}}}function statFix(r){if(!r)return r;return function(i,o,a){if(typeof o==="function"){a=o;o=null}function callback(t,r){if(r){if(r.uid<0)r.uid+=4294967296;if(r.gid<0)r.gid+=4294967296}if(a)a.apply(this,arguments)}return o?r.call(t,i,o,callback):r.call(t,i,callback)}}function statFixSync(r){if(!r)return r;return function(i,o){var a=o?r.call(t,i,o):r.call(t,i);if(a){if(a.uid<0)a.uid+=4294967296;if(a.gid<0)a.gid+=4294967296}return a}}function chownErOk(t){if(!t)return true;if(t.code==="ENOSYS")return true;var r=!process.getuid||process.getuid()!==0;if(r){if(t.code==="EINVAL"||t.code==="EPERM")return true}return false}}},1454:t=>{"use strict";const r=new Set([200,203,204,206,300,301,404,405,410,414,501]);const i=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]);const o=new Set([500,502,503,504]);const a={date:true,connection:true,"keep-alive":true,"proxy-authenticate":true,"proxy-authorization":true,te:true,trailer:true,"transfer-encoding":true,upgrade:true};const l={"content-length":true,"content-encoding":true,"transfer-encoding":true,"content-range":true};function toNumberOrZero(t){const r=parseInt(t,10);return isFinite(r)?r:0}function isErrorResponse(t){if(!t){return true}return o.has(t.status)}function parseCacheControl(t){const r={};if(!t)return r;const i=t.trim().split(/\s*,\s*/);for(const t of i){const[i,o]=t.split(/\s*=\s*/,2);r[i]=o===undefined?true:o.replace(/^"|"$/g,"")}return r}function formatCacheControl(t){let r=[];for(const i in t){const o=t[i];r.push(o===true?i:i+"="+o)}if(!r.length){return undefined}return r.join(", ")}t.exports=class CachePolicy{constructor(t,r,{shared:i,cacheHeuristic:o,immutableMinTimeToLive:a,ignoreCargoCult:l,_fromObject:c}={}){if(c){this._fromObject(c);return}if(!r||!r.headers){throw Error("Response headers missing")}this._assertRequestHasHeaders(t);this._responseTime=this.now();this._isShared=i!==false;this._cacheHeuristic=undefined!==o?o:.1;this._immutableMinTtl=undefined!==a?a:24*3600*1e3;this._status="status"in r?r.status:200;this._resHeaders=r.headers;this._rescc=parseCacheControl(r.headers["cache-control"]);this._method="method"in t?t.method:"GET";this._url=t.url;this._host=t.headers.host;this._noAuthorization=!t.headers.authorization;this._reqHeaders=r.headers.vary?t.headers:null;this._reqcc=parseCacheControl(t.headers["cache-control"]);if(l&&"pre-check"in this._rescc&&"post-check"in this._rescc){delete this._rescc["pre-check"];delete this._rescc["post-check"];delete this._rescc["no-cache"];delete this._rescc["no-store"];delete this._rescc["must-revalidate"];this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":formatCacheControl(this._rescc)});delete this._resHeaders.expires;delete this._resHeaders.pragma}if(r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)){this._rescc["no-cache"]=true}}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&("GET"===this._method||"HEAD"===this._method||"POST"===this._method&&this._hasExplicitExpiration())&&i.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||r.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(t){if(!t||!t.headers){throw Error("Request headers missing")}}satisfiesWithoutRevalidation(t){this._assertRequestHasHeaders(t);const r=parseCacheControl(t.headers["cache-control"]);if(r["no-cache"]||/no-cache/.test(t.headers.pragma)){return false}if(r["max-age"]&&this.age()>r["max-age"]){return false}if(r["min-fresh"]&&this.timeToLive()<1e3*r["min-fresh"]){return false}if(this.stale()){const t=r["max-stale"]&&!this._rescc["must-revalidate"]&&(true===r["max-stale"]||r["max-stale"]>this.age()-this.maxAge());if(!t){return false}}return this._requestMatches(t,false)}_requestMatches(t,r){return(!this._url||this._url===t.url)&&this._host===t.headers.host&&(!t.method||this._method===t.method||r&&"HEAD"===t.method)&&this._varyMatches(t)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(t){if(!this._resHeaders.vary){return true}if(this._resHeaders.vary==="*"){return false}const r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(const i of r){if(t.headers[i]!==this._reqHeaders[i])return false}return true}_copyWithoutHopByHopHeaders(t){const r={};for(const i in t){if(a[i])continue;r[i]=t[i]}if(t.connection){const i=t.connection.trim().split(/\s*,\s*/);for(const t of i){delete r[t]}}if(r.warning){const t=r.warning.split(/,/).filter((t=>!/^\s*1[0-9][0-9]/.test(t)));if(!t.length){delete r.warning}else{r.warning=t.join(",").trim()}}return r}responseHeaders(){const t=this._copyWithoutHopByHopHeaders(this._resHeaders);const r=this.age();if(r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24){t.warning=(t.warning?`${t.warning}, `:"")+'113 - "rfc7234 5.5.4"'}t.age=`${Math.round(r)}`;t.date=new Date(this.now()).toUTCString();return t}date(){const t=Date.parse(this._resHeaders.date);if(isFinite(t)){return t}return this._responseTime}age(){let t=this._ageValue();const r=(this.now()-this._responseTime)/1e3;return t+r}_ageValue(){return toNumberOrZero(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]){return 0}if(this._isShared&&(this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable)){return 0}if(this._resHeaders.vary==="*"){return 0}if(this._isShared){if(this._rescc["proxy-revalidate"]){return 0}if(this._rescc["s-maxage"]){return toNumberOrZero(this._rescc["s-maxage"])}}if(this._rescc["max-age"]){return toNumberOrZero(this._rescc["max-age"])}const t=this._rescc.immutable?this._immutableMinTtl:0;const r=this.date();if(this._resHeaders.expires){const i=Date.parse(this._resHeaders.expires);if(Number.isNaN(i)||i<r){return 0}return Math.max(t,(i-r)/1e3)}if(this._resHeaders["last-modified"]){const i=Date.parse(this._resHeaders["last-modified"]);if(isFinite(i)&&r>i){return Math.max(t,(r-i)/1e3*this._cacheHeuristic)}}return t}timeToLive(){const t=this.maxAge()-this.age();const r=t+toNumberOrZero(this._rescc["stale-if-error"]);const i=t+toNumberOrZero(this._rescc["stale-while-revalidate"]);return Math.max(0,t,r,i)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+toNumberOrZero(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+toNumberOrZero(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(t){return new this(undefined,undefined,{_fromObject:t})}_fromObject(t){if(this._responseTime)throw Error("Reinitialized");if(!t||t.v!==1)throw Error("Invalid serialization");this._responseTime=t.t;this._isShared=t.sh;this._cacheHeuristic=t.ch;this._immutableMinTtl=t.imm!==undefined?t.imm:24*3600*1e3;this._status=t.st;this._resHeaders=t.resh;this._rescc=t.rescc;this._method=t.m;this._url=t.u;this._host=t.h;this._noAuthorization=t.a;this._reqHeaders=t.reqh;this._reqcc=t.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(t){this._assertRequestHasHeaders(t);const r=this._copyWithoutHopByHopHeaders(t.headers);delete r["if-range"];if(!this._requestMatches(t,true)||!this.storable()){delete r["if-none-match"];delete r["if-modified-since"];return r}if(this._resHeaders.etag){r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag}const i=r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET";if(i){delete r["if-modified-since"];if(r["if-none-match"]){const t=r["if-none-match"].split(/,/).filter((t=>!/^\s*W\//.test(t)));if(!t.length){delete r["if-none-match"]}else{r["if-none-match"]=t.join(",").trim()}}}else if(this._resHeaders["last-modified"]&&!r["if-modified-since"]){r["if-modified-since"]=this._resHeaders["last-modified"]}return r}revalidatedPolicy(t,r){this._assertRequestHasHeaders(t);if(this._useStaleIfError()&&isErrorResponse(r)){return{modified:false,matches:false,policy:this}}if(!r||!r.headers){throw Error("Response headers missing")}let i=false;if(r.status!==undefined&&r.status!=304){i=false}else if(r.headers.etag&&!/^\s*W\//.test(r.headers.etag)){i=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag}else if(this._resHeaders.etag&&r.headers.etag){i=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,"")}else if(this._resHeaders["last-modified"]){i=this._resHeaders["last-modified"]===r.headers["last-modified"]}else{if(!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]){i=true}}if(!i){return{policy:new this.constructor(t,r),modified:r.status!=304,matches:false}}const o={};for(const t in this._resHeaders){o[t]=t in r.headers&&!l[t]?r.headers[t]:this._resHeaders[t]}const a=Object.assign({},r,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(t,a,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:false,matches:true}}}},4828:(t,r,i)=>{"use strict";const{URL:o}=i(7310);const a=i(2361);const l=i(4404);const c=i(5158);const u=i(6664);const h=i(7253);const d=Symbol("currentStreamCount");const p=Symbol("request");const m=Symbol("cachedOriginSet");const y=Symbol("gracefullyClosing");const g=Symbol("length");const b=["createConnection","maxDeflateDynamicTableSize","maxSettings","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","peerMaxConcurrentStreams","settings","family","localAddress","rejectUnauthorized","pskCallback","minDHSize","path","socket","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","pfx","secureOptions","secureProtocol","sessionIdContext","ticketKeys"];const getSortedIndex=(t,r,i)=>{let o=0;let a=t.length;while(o<a){const l=o+a>>>1;if(i(t[l],r)){o=l+1}else{a=l}}return o};const compareSessions=(t,r)=>t.remoteSettings.maxConcurrentStreams>r.remoteSettings.maxConcurrentStreams;const closeCoveredSessions=(t,r)=>{for(let i=0;i<t.length;i++){const o=t[i];if(o[m].length>0&&o[m].length<r[m].length&&o[m].every((t=>r[m].includes(t)))&&o[d]+r[d]<=r.remoteSettings.maxConcurrentStreams){gracefullyClose(o)}}};const closeSessionIfCovered=(t,r)=>{for(let i=0;i<t.length;i++){const o=t[i];if(r[m].length>0&&r[m].length<o[m].length&&r[m].every((t=>o[m].includes(t)))&&r[d]+o[d]<=o.remoteSettings.maxConcurrentStreams){gracefullyClose(r);return true}}return false};const gracefullyClose=t=>{t[y]=true;if(t[d]===0){t.close()}};class Agent extends a{constructor({timeout:t=0,maxSessions:r=Number.POSITIVE_INFINITY,maxEmptySessions:i=10,maxCachedTlsSessions:o=100}={}){super();this.sessions={};this.queue={};this.timeout=t;this.maxSessions=r;this.maxEmptySessions=i;this._emptySessionCount=0;this._sessionCount=0;this.settings={enablePush:false,initialWindowSize:1024*1024*32};this.tlsSessionCache=new u({maxSize:o})}get protocol(){return"https:"}normalizeOptions(t){let r="";for(let i=0;i<b.length;i++){const o=b[i];r+=":";if(t&&t[o]!==undefined){r+=t[o]}}return r}_processQueue(){if(this._sessionCount>=this.maxSessions){this.closeEmptySessions(this.maxSessions-this._sessionCount+1);return}for(const t in this.queue){for(const r in this.queue[t]){const i=this.queue[t][r];if(!i.completed){i.completed=true;i()}}}}_isBetterSession(t,r){return t>r}_accept(t,r,i,o){let a=0;while(a<r.length&&t[d]<t.remoteSettings.maxConcurrentStreams){r[a].resolve(t);a++}r.splice(0,a);if(r.length>0){this.getSession(i,o,r);r.length=0}}getSession(t,r,i){return new Promise(((a,l)=>{if(Array.isArray(i)&&i.length>0){i=[...i];a()}else{i=[{resolve:a,reject:l}]}try{if(typeof t==="string"){t=new o(t)}else if(!(t instanceof o)){throw new TypeError("The `origin` argument needs to be a string or an URL object")}if(r){const{servername:i}=r;const{hostname:o}=t;if(i&&o!==i){throw new Error(`Origin ${o} differs from servername ${i}`)}}}catch(t){for(let r=0;r<i.length;r++){i[r].reject(t)}return}const u=this.normalizeOptions(r);const h=t.origin;if(u in this.sessions){const t=this.sessions[u];let o=-1;let a=-1;let l;for(let r=0;r<t.length;r++){const i=t[r];const c=i.remoteSettings.maxConcurrentStreams;if(c<o){break}if(!i[m].includes(h)){continue}const u=i[d];if(u>=c||i[y]||i.destroyed){continue}if(!l){o=c}if(this._isBetterSession(u,a)){l=i;a=u}}if(l){this._accept(l,i,h,r);return}}if(u in this.queue){if(h in this.queue[u]){this.queue[u][h].listeners.push(...i);return}}else{this.queue[u]={[g]:0}}const removeFromQueue=()=>{if(u in this.queue&&this.queue[u][h]===entry){delete this.queue[u][h];if(--this.queue[u][g]===0){delete this.queue[u]}}};const entry=async()=>{this._sessionCount++;const o=`${h}:${u}`;let a=false;let l;try{const b={...r};if(b.settings===undefined){b.settings=this.settings}if(b.session===undefined){b.session=this.tlsSessionCache.get(o)}const v=b.createConnection||this.createConnection;l=await v.call(this,t,b);b.createConnection=()=>l;const _=c.connect(t,b);_[d]=0;_[y]=false;const getOriginSet=()=>{const{socket:t}=_;let r;if(t.servername===false){t.servername=t.remoteAddress;r=_.originSet;t.servername=false}else{r=_.originSet}return r};const isFree=()=>_[d]<_.remoteSettings.maxConcurrentStreams;_.socket.once("session",(t=>{this.tlsSessionCache.set(o,t)}));_.once("error",(t=>{for(let r=0;r<i.length;r++){i[r].reject(t)}this.tlsSessionCache.delete(o)}));_.setTimeout(this.timeout,(()=>{_.destroy()}));_.once("close",(()=>{this._sessionCount--;if(a){this._emptySessionCount--;const t=this.sessions[u];if(t.length===1){delete this.sessions[u]}else{t.splice(t.indexOf(_),1)}}else{removeFromQueue();const t=new Error("Session closed without receiving a SETTINGS frame");t.code="HTTP2WRAPPER_NOSETTINGS";for(let r=0;r<i.length;r++){i[r].reject(t)}}this._processQueue()}));const processListeners=()=>{const t=this.queue[u];if(!t){return}const r=_[m];for(let i=0;i<r.length;i++){const o=r[i];if(o in t){const{listeners:r,completed:i}=t[o];let a=0;while(a<r.length&&isFree()){r[a].resolve(_);a++}t[o].listeners.splice(0,a);if(t[o].listeners.length===0&&!i){delete t[o];if(--t[g]===0){delete this.queue[u];break}}if(!isFree()){break}}}};_.on("origin",(()=>{_[m]=getOriginSet()||[];_[y]=false;closeSessionIfCovered(this.sessions[u],_);if(_[y]||!isFree()){return}processListeners();if(!isFree()){return}closeCoveredSessions(this.sessions[u],_)}));_.once("remoteSettings",(()=>{if(entry.destroyed){const t=new Error("Agent has been destroyed");for(let r=0;r<i.length;r++){i[r].reject(t)}_.destroy();return}if(_.setLocalWindowSize){_.setLocalWindowSize(1024*1024*4)}_[m]=getOriginSet()||[];if(_.socket.encrypted){const t=_[m][0];if(t!==h){const r=new Error(`Requested origin ${h} does not match server ${t}`);for(let t=0;t<i.length;t++){i[t].reject(r)}_.destroy();return}}removeFromQueue();{const t=this.sessions;if(u in t){const r=t[u];r.splice(getSortedIndex(r,_,compareSessions),0,_)}else{t[u]=[_]}}a=true;this._emptySessionCount++;this.emit("session",_);this._accept(_,i,h,r);if(_[d]===0&&this._emptySessionCount>this.maxEmptySessions){this.closeEmptySessions(this._emptySessionCount-this.maxEmptySessions)}_.on("remoteSettings",(()=>{if(!isFree()){return}processListeners();if(!isFree()){return}closeCoveredSessions(this.sessions[u],_)}))}));_[p]=_.request;_.request=(t,r)=>{if(_[y]){throw new Error("The session is gracefully closing. No new streams are allowed.")}const i=_[p](t,r);_.ref();if(_[d]++===0){this._emptySessionCount--}i.once("close",(()=>{if(--_[d]===0){this._emptySessionCount++;_.unref();if(this._emptySessionCount>this.maxEmptySessions||_[y]){_.close();return}}if(_.destroyed||_.closed){return}if(isFree()&&!closeSessionIfCovered(this.sessions[u],_)){closeCoveredSessions(this.sessions[u],_);processListeners();if(_[d]===0){this._processQueue()}}}));return i}}catch(t){removeFromQueue();this._sessionCount--;for(let r=0;r<i.length;r++){i[r].reject(t)}}};entry.listeners=i;entry.completed=false;entry.destroyed=false;this.queue[u][h]=entry;this.queue[u][g]++;this._processQueue()}))}request(t,r,i,o){return new Promise(((a,l)=>{this.getSession(t,r,[{reject:l,resolve:t=>{try{const r=t.request(i,o);h(r);a(r)}catch(t){l(t)}}}])}))}async createConnection(t,r){return Agent.connect(t,r)}static connect(t,r){r.ALPNProtocols=["h2"];const i=t.port||443;const o=t.hostname;if(typeof r.servername==="undefined"){r.servername=o}const a=l.connect(i,o,r);if(r.socket){a._peername={family:undefined,address:undefined,port:i}}return a}closeEmptySessions(t=Number.POSITIVE_INFINITY){let r=0;const{sessions:i}=this;for(const o in i){const a=i[o];for(let i=0;i<a.length;i++){const o=a[i];if(o[d]===0){r++;o.close();if(r>=t){return r}}}}return r}destroy(t){const{sessions:r,queue:i}=this;for(const i in r){const o=r[i];for(let r=0;r<o.length;r++){o[r].destroy(t)}}for(const t in i){const r=i[t];for(const t in r){r[t].destroyed=true}}this.queue={};this.tlsSessionCache.clear()}get emptySessionCount(){return this._emptySessionCount}get pendingSessionCount(){return this._sessionCount-this._emptySessionCount}get sessionCount(){return this._sessionCount}}Agent.kCurrentStreamCount=d;Agent.kGracefullyClosing=y;t.exports={Agent:Agent,globalAgent:new Agent}},3942:(t,r,i)=>{"use strict";const{URL:o,urlToHttpOptions:a}=i(7310);const l=i(3685);const c=i(5687);const u=i(8826);const h=i(6664);const{Agent:d,globalAgent:p}=i(4828);const m=i(6496);const y=i(3671);const g=i(7253);const b=new h({maxSize:100});const v=new Map;const installSocket=(t,r,i)=>{r._httpMessage={shouldKeepAlive:true};const onFree=()=>{t.emit("free",r,i)};r.on("free",onFree);const onClose=()=>{t.removeSocket(r,i)};r.on("close",onClose);const onTimeout=()=>{const{freeSockets:i}=t;for(const t of Object.values(i)){if(t.includes(r)){r.destroy();return}}};r.on("timeout",onTimeout);const onRemove=()=>{t.removeSocket(r,i);r.off("close",onClose);r.off("free",onFree);r.off("timeout",onTimeout);r.off("agentRemove",onRemove)};r.on("agentRemove",onRemove);t.emit("free",r,i)};const createResolveProtocol=(t,r=new Map,i=undefined)=>async o=>{const a=`${o.host}:${o.port}:${o.ALPNProtocols.sort()}`;if(!t.has(a)){if(r.has(a)){const t=await r.get(a);return{alpnProtocol:t.alpnProtocol}}const{path:l}=o;o.path=o.socketPath;const c=u(o,i);r.set(a,c);try{const i=await c;t.set(a,i.alpnProtocol);r.delete(a);o.path=l;return i}catch(t){r.delete(a);o.path=l;throw t}}return{alpnProtocol:t.get(a)}};const _=createResolveProtocol(b,v);t.exports=async(t,r,i)=>{if(typeof t==="string"){t=a(new o(t))}else if(t instanceof o){t=a(t)}else{t={...t}}if(typeof r==="function"||r===undefined){i=r;r=t}else{r=Object.assign(t,r)}r.ALPNProtocols=r.ALPNProtocols||["h2","http/1.1"];if(!Array.isArray(r.ALPNProtocols)||r.ALPNProtocols.length===0){throw new Error("The `ALPNProtocols` option must be an Array with at least one entry")}r.protocol=r.protocol||"https:";const u=r.protocol==="https:";r.host=r.hostname||r.host||"localhost";r.session=r.tlsSession;r.servername=r.servername||y(r.headers&&r.headers.host||r.host);r.port=r.port||(u?443:80);r._defaultAgent=u?c.globalAgent:l.globalAgent;const h=r.resolveProtocol||_;let{agent:b}=r;if(b!==undefined&&b!==false&&b.constructor.name!=="Object"){throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties")}if(u){r.resolveSocket=true;let{socket:t,alpnProtocol:o,timeout:a}=await h(r);if(a){if(t){t.destroy()}const i=new Error(`Timed out resolving ALPN: ${r.timeout} ms`);i.code="ETIMEDOUT";i.ms=r.timeout;throw i}if(t&&r.createConnection){t.destroy();t=undefined}delete r.resolveSocket;const l=o==="h2";if(b){b=l?b.http2:b.https;r.agent=b}if(b===undefined){b=l?p:c.globalAgent}if(t){if(b===false){t.destroy()}else{const i=(l?d:c.Agent).prototype.createConnection;if(b.createConnection===i){if(l){r._reuseSocket=t}else{installSocket(b,t,r)}}else{t.destroy()}}}if(l){return g(new m(r,i))}}else if(b){r.agent=b.http}return g(l.request(r,i))};t.exports.protocolCache=b;t.exports.resolveProtocol=_;t.exports.createResolveProtocol=createResolveProtocol},6496:(t,r,i)=>{"use strict";const{URL:o,urlToHttpOptions:a}=i(7310);const l=i(5158);const{Writable:c}=i(2781);const{Agent:u,globalAgent:h}=i(4828);const d=i(4011);const p=i(1544);const{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_PROTOCOL:y,ERR_HTTP_HEADERS_SENT:g}=i(8635);const b=i(1091);const v=i(5590);const _=i(704);const{HTTP2_HEADER_STATUS:w,HTTP2_HEADER_METHOD:E,HTTP2_HEADER_PATH:S,HTTP2_HEADER_AUTHORITY:O,HTTP2_METHOD_CONNECT:R}=l.constants;const x=Symbol("headers");const k=Symbol("origin");const T=Symbol("session");const A=Symbol("options");const C=Symbol("flushedHeaders");const P=Symbol("jobs");const I=Symbol("pendingAgentPromise");class ClientRequest extends c{constructor(t,r,i){super({autoDestroy:false,emitClose:false});if(typeof t==="string"){t=a(new o(t))}else if(t instanceof o){t=a(t)}else{t={...t}}if(typeof r==="function"||r===undefined){i=r;r=t}else{r=Object.assign(t,r)}if(r.h2session){this[T]=r.h2session;if(this[T].destroyed){throw new Error("The session has been closed already")}this.protocol=this[T].socket.encrypted?"https:":"http:"}else if(r.agent===false){this.agent=new u({maxEmptySessions:0})}else if(typeof r.agent==="undefined"||r.agent===null){this.agent=h}else if(typeof r.agent.request==="function"){this.agent=r.agent}else{throw new m("options.agent",["http2wrapper.Agent-like Object","undefined","false"],r.agent)}if(this.agent){this.protocol=this.agent.protocol}if(r.protocol&&r.protocol!==this.protocol){throw new y(r.protocol,this.protocol)}if(!r.port){r.port=r.defaultPort||this.agent&&this.agent.defaultPort||443}r.host=r.hostname||r.host||"localhost";delete r.hostname;const{timeout:l}=r;r.timeout=undefined;this[x]=Object.create(null);this[P]=[];this[I]=undefined;this.socket=null;this.connection=null;this.method=r.method||"GET";if(!(this.method==="CONNECT"&&(r.path==="/"||r.path===undefined))){this.path=r.path}this.res=null;this.aborted=false;this.reusedSocket=false;const{headers:c}=r;if(c){for(const t in c){this.setHeader(t,c[t])}}if(r.auth&&!("authorization"in this[x])){this[x].authorization="Basic "+Buffer.from(r.auth).toString("base64")}r.session=r.tlsSession;r.path=r.socketPath;this[A]=r;this[k]=new o(`${this.protocol}//${r.servername||r.host}:${r.port}`);const d=r._reuseSocket;if(d){r.createConnection=(...t)=>{if(d.destroyed){return this.agent.createConnection(...t)}return d};this.agent.getSession(this[k],this[A]).catch((()=>{}))}if(l){this.setTimeout(l)}if(i){this.once("response",i)}this[C]=false}get method(){return this[x][E]}set method(t){if(t){this[x][E]=t.toUpperCase()}}get path(){const t=this.method==="CONNECT"?O:S;return this[x][t]}set path(t){if(t){const r=this.method==="CONNECT"?O:S;this[x][r]=t}}get host(){return this[k].hostname}set host(t){}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(t,r,i){if(this._mustNotHaveABody){i(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();const callWrite=()=>this._request.write(t,r,i);if(this._request){callWrite()}else{this[P].push(callWrite)}}_final(t){this.flushHeaders();const callEnd=()=>{if(this._mustNotHaveABody||this.method==="CONNECT"){t();return}this._request.end(t)};if(this._request){callEnd()}else{this[P].push(callEnd)}}abort(){if(this.res&&this.res.complete){return}if(!this.aborted){process.nextTick((()=>this.emit("abort")))}this.aborted=true;this.destroy()}async _destroy(t,r){if(this.res){this.res._dump()}if(this._request){this._request.destroy()}else{process.nextTick((()=>{this.emit("close")}))}try{await this[I]}catch(r){if(this.aborted){t=r}}r(t)}async flushHeaders(){if(this[C]||this.destroyed){return}this[C]=true;const t=this.method===R;const onStream=r=>{this._request=r;if(this.destroyed){r.destroy();return}if(!t){p(r,this,["timeout","continue"])}r.once("error",(t=>{this.destroy(t)}));r.once("aborted",(()=>{const{res:t}=this;if(t){t.aborted=true;t.emit("aborted");t.destroy()}else{this.destroy(new Error("The server aborted the HTTP/2 stream"))}}));const onResponse=(i,o,a)=>{const l=new d(this.socket,r.readableHighWaterMark);this.res=l;l.url=`${this[k].origin}${this.path}`;l.req=this;l.statusCode=i[w];l.headers=i;l.rawHeaders=a;l.once("end",(()=>{l.complete=true;l.socket=null;l.connection=null}));if(t){l.upgrade=true;if(this.emit("connect",l,r,Buffer.alloc(0))){this.emit("close")}else{r.destroy()}}else{r.on("data",(t=>{if(!l._dumped&&!l.push(t)){r.pause()}}));r.once("end",(()=>{if(!this.aborted){l.push(null)}}));if(!this.emit("response",l)){l._dump()}}};r.once("response",onResponse);r.once("headers",(t=>this.emit("information",{statusCode:t[w]})));r.once("trailers",((t,r,i)=>{const{res:o}=this;if(o===null){onResponse(t,r,i);return}o.trailers=t;o.rawTrailers=i}));r.once("close",(()=>{const{aborted:t,res:r}=this;if(r){if(t){r.aborted=true;r.emit("aborted");r.destroy()}const finish=()=>{r.emit("close");this.destroy();this.emit("close")};if(r.readable){r.once("end",finish)}else{finish()}return}if(!this.destroyed){this.destroy(new Error("The HTTP/2 stream has been early terminated"));this.emit("close");return}this.destroy();this.emit("close")}));this.socket=new Proxy(r,_);for(const t of this[P]){t()}this.emit("socket",this.socket)};if(!(O in this[x])&&!t){this[x][O]=this[k].host}if(this[T]){try{onStream(this[T].request(this[x]))}catch(t){this.destroy(t)}}else{this.reusedSocket=true;try{const t=this.agent.request(this[k],this[A],this[x]);this[I]=t;onStream(await t);this[I]=false}catch(t){this[I]=false;this.destroy(t)}}}get connection(){return this.socket}set connection(t){this.socket=t}getHeaderNames(){return Object.keys(this[x])}hasHeader(t){if(typeof t!=="string"){throw new m("name","string",t)}return Boolean(this[x][t.toLowerCase()])}getHeader(t){if(typeof t!=="string"){throw new m("name","string",t)}return this[x][t.toLowerCase()]}get headersSent(){return this[C]}removeHeader(t){if(typeof t!=="string"){throw new m("name","string",t)}if(this.headersSent){throw new g("remove")}delete this[x][t.toLowerCase()]}setHeader(t,r){if(this.headersSent){throw new g("set")}b(t);v(t,r);const i=t.toLowerCase();if(i==="connection"){if(r.toLowerCase()==="keep-alive"){return}throw new Error(`Invalid 'connection' header: ${r}`)}if(i==="host"&&this.method==="CONNECT"){this[x][O]=r}else{this[x][i]=r}}setNoDelay(){}setSocketKeepAlive(){}setTimeout(t,r){const applyTimeout=()=>this._request.setTimeout(t,r);if(this._request){applyTimeout()}else{this[P].push(applyTimeout)}return this}get maxHeadersCount(){if(!this.destroyed&&this._request){return this._request.session.localSettings.maxHeaderListSize}return undefined}set maxHeadersCount(t){}}t.exports=ClientRequest},4011:(t,r,i)=>{"use strict";const{Readable:o}=i(2781);class IncomingMessage extends o{constructor(t,r){super({emitClose:false,autoDestroy:true,highWaterMark:r});this.statusCode=null;this.statusMessage="";this.httpVersion="2.0";this.httpVersionMajor=2;this.httpVersionMinor=0;this.headers={};this.trailers={};this.req=null;this.aborted=false;this.complete=false;this.upgrade=null;this.rawHeaders=[];this.rawTrailers=[];this.socket=t;this._dumped=false}get connection(){return this.socket}set connection(t){this.socket=t}_destroy(t,r){if(!this.readableEnded){this.aborted=true}r();this.req._request.destroy(t)}setTimeout(t,r){this.req.setTimeout(t,r);return this}_dump(){if(!this._dumped){this._dumped=true;this.removeAllListeners("data");this.resume()}}_read(){if(this.req){this.req._request.resume()}}}t.exports=IncomingMessage},5767:(t,r,i)=>{"use strict";const o=i(5158);const{Agent:a,globalAgent:l}=i(4828);const c=i(6496);const u=i(4011);const h=i(3942);const{HttpOverHttp2:d,HttpsOverHttp2:p}=i(7570);const m=i(855);const{Http2OverHttp:y,Http2OverHttps:g}=i(5431);const b=i(1091);const v=i(5590);const request=(t,r,i)=>new c(t,r,i);const get=(t,r,i)=>{const o=new c(t,r,i);o.end();return o};t.exports={...o,ClientRequest:c,IncomingMessage:u,Agent:a,globalAgent:l,request:request,get:get,auto:h,proxies:{HttpOverHttp2:d,HttpsOverHttp2:p,Http2OverHttp2:m,Http2OverHttp:y,Http2OverHttps:g},validateHeaderName:b,validateHeaderValue:v}},5060:t=>{"use strict";t.exports=t=>{const{username:r,password:i}=t.proxyOptions.url;if(r||i){const t=`${r}:${i}`;const o=`Basic ${Buffer.from(t).toString("base64")}`;return{"proxy-authorization":o,authorization:o}}return{}}},7570:(t,r,i)=>{"use strict";const o=i(4404);const a=i(3685);const l=i(5687);const c=i(6582);const{globalAgent:u}=i(4828);const h=i(4039);const d=i(7652);const p=i(5060);const createConnection=(t,r,i)=>{(async()=>{try{const{proxyOptions:a}=t;const{url:d,headers:m,raw:y}=a;const g=await u.request(d,a,{...p(t),...m,":method":"CONNECT",":authority":`${r.host}:${r.port}`});g.once("error",i);g.once("response",(a=>{const u=a[":status"];if(u!==200){i(new h(u));return}const d=t instanceof l.Agent;if(y&&d){r.socket=g;const t=o.connect(r);t.once("close",(()=>{g.destroy()}));i(null,t);return}const p=new c(g);p.encrypted=false;p._handle.getpeername=t=>{t.family=undefined;t.address=undefined;t.port=undefined};i(null,p)}))}catch(t){i(t)}})()};class HttpOverHttp2 extends a.Agent{constructor(t){super(t);d(this,t.proxyOptions)}createConnection(t,r){createConnection(this,t,r)}}class HttpsOverHttp2 extends l.Agent{constructor(t){super(t);d(this,t.proxyOptions)}createConnection(t,r){createConnection(this,t,r)}}t.exports={HttpOverHttp2:HttpOverHttp2,HttpsOverHttp2:HttpsOverHttp2}},5431:(t,r,i)=>{"use strict";const o=i(3685);const a=i(5687);const l=i(2853);const c=i(5060);const getStream=t=>new Promise(((r,i)=>{const onConnect=(o,a,l)=>{a.unshift(l);t.off("error",i);r([a,o.statusCode])};t.once("error",i);t.once("connect",onConnect)}));class Http2OverHttp extends l{async _getProxyStream(t){const{proxyOptions:r}=this;const{url:i,headers:l}=this.proxyOptions;const u=i.protocol==="https:"?a:o;const h=u.request({...r,hostname:i.hostname,port:i.port,path:t,headers:{...c(this),...l,host:t},method:"CONNECT"}).end();return getStream(h)}}t.exports={Http2OverHttp:Http2OverHttp,Http2OverHttps:Http2OverHttp}},855:(t,r,i)=>{"use strict";const{globalAgent:o}=i(4828);const a=i(2853);const l=i(5060);const getStatusCode=t=>new Promise(((r,i)=>{t.once("error",i);t.once("response",(o=>{t.off("error",i);r(o[":status"])}))}));class Http2OverHttp2 extends a{async _getProxyStream(t){const{proxyOptions:r}=this;const i={...l(this),...r.headers,":method":"CONNECT",":authority":t};const a=await o.request(r.url,r,i);const c=await getStatusCode(a);return[a,c]}}t.exports=Http2OverHttp2},2853:(t,r,i)=>{"use strict";const{Agent:o}=i(4828);const a=i(6582);const l=i(4039);const c=i(7652);class Http2OverHttpX extends o{constructor(t){super(t);c(this,t.proxyOptions)}async createConnection(t,r){const i=`${t.hostname}:${t.port||443}`;const[o,c]=await this._getProxyStream(i);if(c!==200){throw new l(c)}if(this.proxyOptions.raw){r.socket=o}else{const t=new a(o);t.encrypted=false;t._handle.getpeername=t=>{t.family=undefined;t.address=undefined;t.port=undefined};return t}return super.createConnection(t,r)}}t.exports=Http2OverHttpX},7652:(t,r,i)=>{"use strict";const{URL:o}=i(7310);const a=i(8583);t.exports=(t,r)=>{a("proxyOptions",r,["object"]);a("proxyOptions.headers",r.headers,["object","undefined"]);a("proxyOptions.raw",r.raw,["boolean","undefined"]);a("proxyOptions.url",r.url,[o,"string"]);const i=new o(r.url);t.proxyOptions={raw:true,...r,headers:{...r.headers},url:i}}},4039:t=>{"use strict";class UnexpectedStatusCodeError extends Error{constructor(t){super(`The proxy server rejected the request with status code ${t}`);this.statusCode=t}}t.exports=UnexpectedStatusCodeError},3671:(t,r,i)=>{"use strict";const{isIP:o}=i(1808);const a=i(9491);const getHost=t=>{if(t[0]==="["){const r=t.indexOf("]");a(r!==-1);return t.slice(1,r)}const r=t.indexOf(":");if(r===-1){return t}return t.slice(0,r)};t.exports=t=>{const r=getHost(t);if(o(r)){return""}return r}},8583:t=>{"use strict";const checkType=(t,r,i)=>{const o=i.some((t=>{const i=typeof t;if(i==="string"){return typeof r===t}return r instanceof t}));if(!o){const o=i.map((t=>typeof t==="string"?t:t.name));throw new TypeError(`Expected '${t}' to be a type of ${o.join(" or ")}, got ${typeof r}`)}};t.exports=checkType},7253:t=>{"use strict";t.exports=t=>{if(t.listenerCount("error")!==0){return t}t.__destroy=t._destroy;t._destroy=(...r)=>{const i=r.pop();t.__destroy(...r,(async t=>{await Promise.resolve();i(t)}))};const onError=r=>{Promise.resolve().then((()=>{t.emit("error",r)}))};t.once("error",onError);Promise.resolve().then((()=>{t.off("error",onError)}));return t}},8635:t=>{"use strict";const makeError=(r,i,o)=>{t.exports[i]=class NodeError extends r{constructor(...t){super(typeof o==="string"?o:o(t));this.name=`${super.name} [${i}]`;this.code=i}}};makeError(TypeError,"ERR_INVALID_ARG_TYPE",(t=>{const r=t[0].includes(".")?"property":"argument";let i=t[1];const o=Array.isArray(i);if(o){i=`${i.slice(0,-1).join(", ")} or ${i.slice(-1)}`}return`The "${t[0]}" ${r} must be ${o?"one of":"of"} type ${i}. Received ${typeof t[2]}`}));makeError(TypeError,"ERR_INVALID_PROTOCOL",(t=>`Protocol "${t[0]}" not supported. Expected "${t[1]}"`));makeError(Error,"ERR_HTTP_HEADERS_SENT",(t=>`Cannot ${t[0]} headers after they are sent to the client`));makeError(TypeError,"ERR_INVALID_HTTP_TOKEN",(t=>`${t[0]} must be a valid HTTP token [${t[1]}]`));makeError(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",(t=>`Invalid value "${t[0]} for header "${t[1]}"`));makeError(TypeError,"ERR_INVALID_CHAR",(t=>`Invalid character in ${t[0]} [${t[1]}]`));makeError(Error,"ERR_HTTP2_NO_SOCKET_MANIPULATION","HTTP/2 sockets should not be directly manipulated (e.g. read and written)")},8100:t=>{"use strict";t.exports=t=>{switch(t){case":method":case":scheme":case":authority":case":path":return true;default:return false}}},6582:(t,r,i)=>{"use strict";const o=i(2781);const a=i(4404);const l=new a.TLSSocket(new o.PassThrough)._handle._parentWrap.constructor;t.exports=l},1544:t=>{"use strict";t.exports=(t,r,i)=>{for(const o of i){t.on(o,((...t)=>r.emit(o,...t)))}}},704:(t,r,i)=>{"use strict";const{ERR_HTTP2_NO_SOCKET_MANIPULATION:o}=i(8635);const a={has(t,r){const i=t.session===undefined?t:t.session.socket;return r in t||r in i},get(t,r){switch(r){case"on":case"once":case"end":case"emit":case"destroy":return t[r].bind(t);case"writable":case"destroyed":return t[r];case"readable":if(t.destroyed){return false}return t.readable;case"setTimeout":{const{session:r}=t;if(r!==undefined){return r.setTimeout.bind(r)}return t.setTimeout.bind(t)}case"write":case"read":case"pause":case"resume":throw new o;default:{const i=t.session===undefined?t:t.session.socket;const o=i[r];return typeof o==="function"?o.bind(i):o}}},getPrototypeOf(t){if(t.session!==undefined){return Reflect.getPrototypeOf(t.session.socket)}return Reflect.getPrototypeOf(t)},set(t,r,i){switch(r){case"writable":case"readable":case"destroyed":case"on":case"once":case"end":case"emit":case"destroy":t[r]=i;return true;case"setTimeout":{const{session:r}=t;if(r===undefined){t.setTimeout=i}else{r.setTimeout=i}return true}case"write":case"read":case"pause":case"resume":throw new o;default:{const o=t.session===undefined?t:t.session.socket;o[r]=i;return true}}}};t.exports=a},1091:(t,r,i)=>{"use strict";const{ERR_INVALID_HTTP_TOKEN:o}=i(8635);const a=i(8100);const l=/^[\^`\-\w!#$%&*+.|~]+$/;t.exports=t=>{if(typeof t!=="string"||!l.test(t)&&!a(t)){throw new o("Header name",t)}}},5590:(t,r,i)=>{"use strict";const{ERR_HTTP_INVALID_HEADER_VALUE:o,ERR_INVALID_CHAR:a}=i(8635);const l=/[^\t\u0020-\u007E\u0080-\u00FF]/;t.exports=(t,r)=>{if(typeof r==="undefined"){throw new o(r,t)}if(l.test(r)){throw new a("header content",t)}}},7993:t=>{function makeArray(t){return Array.isArray(t)?t:[t]}const r="";const i=" ";const o="\\";const a=/^\s+$/;const l=/^\\!/;const c=/^\\#/;const u=/\r?\n/g;const h=/^\.*\/|^\.+$/;const d="/";const p=typeof Symbol!=="undefined"?Symbol.for("node-ignore"):"node-ignore";const define=(t,r,i)=>Object.defineProperty(t,r,{value:i});const m=/([0-z])-([0-z])/g;const RETURN_FALSE=()=>false;const sanitizeRange=t=>t.replace(m,((t,i,o)=>i.charCodeAt(0)<=o.charCodeAt(0)?t:r));const cleanRangeBackSlash=t=>{const{length:r}=t;return t.slice(0,r-r%2)};const y=[[/\\?\s+$/,t=>t.indexOf("\\")===0?i:r],[/\\\s/g,()=>i],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function startingReplacer(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,r,i)=>r+6<i.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)\\\*(?=.+)/g,(t,r)=>`${r}[^\\/]*`],[/\\\\\\(?=[$.|*+(){^])/g,()=>o],[/\\\\/g,()=>o],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,r,i,a,l)=>r===o?`\\[${i}${cleanRangeBackSlash(a)}${l}`:l==="]"?a.length%2===0?`[${sanitizeRange(i)}${a}]`:"[]":"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,r)=>{const i=r?`${r}[^/]+`:"[^/]*";return`${i}(?=$|\\/$)`}]];const g=Object.create(null);const makeRegex=(t,r)=>{let i=g[t];if(!i){i=y.reduce(((r,i)=>r.replace(i[0],i[1].bind(t))),t);g[t]=i}return r?new RegExp(i,"i"):new RegExp(i)};const isString=t=>typeof t==="string";const checkPattern=t=>t&&isString(t)&&!a.test(t)&&t.indexOf("#")!==0;const splitPattern=t=>t.split(u);class IgnoreRule{constructor(t,r,i,o){this.origin=t;this.pattern=r;this.negative=i;this.regex=o}}const createRule=(t,r)=>{const i=t;let o=false;if(t.indexOf("!")===0){o=true;t=t.substr(1)}t=t.replace(l,"!").replace(c,"#");const a=makeRegex(t,r);return new IgnoreRule(i,t,o,a)};const throwError=(t,r)=>{throw new r(t)};const checkPath=(t,r,i)=>{if(!isString(t)){return i(`path must be a string, but got \`${r}\``,TypeError)}if(!t){return i(`path must not be empty`,TypeError)}if(checkPath.isNotRelative(t)){const t="`path.relative()`d";return i(`path should be a ${t} string, but got "${r}"`,RangeError)}return true};const isNotRelative=t=>h.test(t);checkPath.isNotRelative=isNotRelative;checkPath.convert=t=>t;class Ignore{constructor({ignorecase:t=true,ignoreCase:r=t,allowRelativePaths:i=false}={}){define(this,p,true);this._rules=[];this._ignoreCase=r;this._allowRelativePaths=i;this._initCache()}_initCache(){this._ignoreCache=Object.create(null);this._testCache=Object.create(null)}_addPattern(t){if(t&&t[p]){this._rules=this._rules.concat(t._rules);this._added=true;return}if(checkPattern(t)){const r=createRule(t,this._ignoreCase);this._added=true;this._rules.push(r)}}add(t){this._added=false;makeArray(isString(t)?splitPattern(t):t).forEach(this._addPattern,this);if(this._added){this._initCache()}return this}addPattern(t){return this.add(t)}_testOne(t,r){let i=false;let o=false;this._rules.forEach((a=>{const{negative:l}=a;if(o===l&&i!==o||l&&!i&&!o&&!r){return}const c=a.regex.test(t);if(c){i=!l;o=l}}));return{ignored:i,unignored:o}}_test(t,r,i,o){const a=t&&checkPath.convert(t);checkPath(a,t,this._allowRelativePaths?RETURN_FALSE:throwError);return this._t(a,r,i,o)}_t(t,r,i,o){if(t in r){return r[t]}if(!o){o=t.split(d)}o.pop();if(!o.length){return r[t]=this._testOne(t,i)}const a=this._t(o.join(d)+d,r,i,o);return r[t]=a.ignored?a:this._testOne(t,i)}ignores(t){return this._test(t,this._ignoreCache,false).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return makeArray(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,true)}}const factory=t=>new Ignore(t);const isPathValid=t=>checkPath(t&&checkPath.convert(t),t,RETURN_FALSE);factory.isPathValid=isPathValid;factory.default=factory;t.exports=factory;if(typeof process!=="undefined"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){const makePosix=t=>/^\\\\\?\\/.test(t)||/["<>|\u0000-\u001F]+/u.test(t)?t:t.replace(/\\/g,"/");checkPath.convert=makePosix;const t=/^[a-z]:\//i;checkPath.isNotRelative=r=>t.test(r)||isNotRelative(r)}},8143:(t,r,i)=>{var o=i(3270);var a=Object.create(null);var l=i(9852);t.exports=o(inflight);function inflight(t,r){if(a[t]){a[t].push(r);return null}else{a[t]=[r];return makeres(t)}}function makeres(t){return l((function RES(){var r=a[t];var i=r.length;var o=slice(arguments);try{for(var l=0;l<i;l++){r[l].apply(null,o)}}finally{if(r.length>i){r.splice(0,i);process.nextTick((function(){RES.apply(null,o)}))}else{delete a[t]}}}))}function slice(t){var r=t.length;var i=[];for(var o=0;o<r;o++)i[o]=t[o];return i}},2842:(t,r,i)=>{try{var o=i(3837);if(typeof o.inherits!=="function")throw"";t.exports=o.inherits}catch(r){t.exports=i(3782)}},3782:t=>{if(typeof Object.create==="function"){t.exports=function inherits(t,r){if(r){t.super_=r;t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}})}}}else{t.exports=function inherits(t,r){if(r){t.super_=r;var TempCtor=function(){};TempCtor.prototype=r.prototype;t.prototype=new TempCtor;t.prototype.constructor=t}}}},7036:(t,r)=>{r.parse=r.decode=decode;r.stringify=r.encode=encode;r.safe=safe;r.unsafe=unsafe;var i=typeof process!=="undefined"&&process.platform==="win32"?"\r\n":"\n";function encode(t,r){var o=[];var a="";if(typeof r==="string"){r={section:r,whitespace:false}}else{r=r||{};r.whitespace=r.whitespace===true}var l=r.whitespace?" = ":"=";Object.keys(t).forEach((function(r,c,u){var h=t[r];if(h&&Array.isArray(h)){h.forEach((function(t){a+=safe(r+"[]")+l+safe(t)+"\n"}))}else if(h&&typeof h==="object")o.push(r);else a+=safe(r)+l+safe(h)+i}));if(r.section&&a.length)a="["+safe(r.section)+"]"+i+a;o.forEach((function(o,l,c){var u=dotSplit(o).join("\\.");var h=(r.section?r.section+".":"")+u;var d=encode(t[o],{section:h,whitespace:r.whitespace});if(a.length&&d.length)a+=i;a+=d}));return a}function dotSplit(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map((function(t){return t.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")}))}function decode(t){var r={};var i=r;var o=null;var a=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;var l=t.split(/[\r\n]+/g);l.forEach((function(t,l,c){if(!t||t.match(/^\s*[;#]/))return;var u=t.match(a);if(!u)return;if(u[1]!==undefined){o=unsafe(u[1]);if(o==="__proto__"){i={};return}i=r[o]=r[o]||{};return}var h=unsafe(u[2]);if(h==="__proto__")return;var d=u[3]?unsafe(u[4]):true;switch(d){case"true":case"false":case"null":d=JSON.parse(d)}if(h.length>2&&h.slice(-2)==="[]"){h=h.substring(0,h.length-2);if(h==="__proto__")return;if(!i[h])i[h]=[];else if(!Array.isArray(i[h]))i[h]=[i[h]]}if(Array.isArray(i[h]))i[h].push(d);else i[h]=d}));Object.keys(r).filter((function(t,i,o){if(!r[t]||typeof r[t]!=="object"||Array.isArray(r[t]))return false;var a=dotSplit(t);var l=r;var c=a.pop();var u=c.replace(/\\\./g,".");a.forEach((function(t,r,i){if(t==="__proto__")return;if(!l[t]||typeof l[t]!=="object")l[t]={};l=l[t]}));if(l===r&&u===c)return false;l[u]=r[t];return true})).forEach((function(t,i,o){delete r[t]}));return r}function isQuoted(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function safe(t){return typeof t!=="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&isQuoted(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function unsafe(t,r){t=(t||"").trim();if(isQuoted(t)){if(t.charAt(0)==="'")t=t.substr(1,t.length-2);try{t=JSON.parse(t)}catch(t){}}else{var i=false;var o="";for(var a=0,l=t.length;a<l;a++){var c=t.charAt(a);if(i){if("\\;#".indexOf(c)!==-1)o+=c;else o+="\\"+c;i=false}else if(";#".indexOf(c)!==-1)break;else if(c==="\\")i=true;else o+=c}if(i)o+="\\";return o.trim()}return t}},9999:t=>{
85
85
  /*!
86
86
  * is-extglob <https://github.com/jonschlinkert/is-extglob>
87
87
  *
@@ -110,7 +110,7 @@ var o=i(9999);var a={"{":"}","(":")","[":"]"};var strictCheck=function(t){if(t[0
110
110
  */
111
111
  t.exports=function(t,r){if(typeof t!=="string"){throw new TypeError("expected path to be a string")}if(t==="\\"||t==="/")return"/";var i=t.length;if(i<=1)return t;var o="";if(i>4&&t[3]==="\\"){var a=t[2];if((a==="?"||a===".")&&t.slice(0,2)==="\\\\"){t=t.slice(2);o="//"}}var l=t.split(/[/\\]+/);if(r!==false&&l[l.length-1]===""){l.pop()}return o+l.join("/")}},9852:(t,r,i)=>{var o=i(3270);t.exports=o(once);t.exports.strict=o(onceStrict);once.proto=once((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})}));function once(t){var f=function(){if(f.called)return f.value;f.called=true;return f.value=t.apply(this,arguments)};f.called=false;return f}function onceStrict(t){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=t.apply(this,arguments)};var r=t.name||"Function wrapped with `once`";f.onceError=r+" shouldn't be called more than once";f.called=false;return f}},6415:(t,r,i)=>{"use strict";const o=i(2816);const a=Symbol.asyncIterator||"@@asyncIterator";const normalizeEmitter=t=>{const r=t.on||t.addListener||t.addEventListener;const i=t.off||t.removeListener||t.removeEventListener;if(!r||!i){throw new TypeError("Emitter is not compatible")}return{addListener:r.bind(t),removeListener:i.bind(t)}};const toArray=t=>Array.isArray(t)?t:[t];const multiple=(t,r,i)=>{let a;const l=new Promise(((o,l)=>{i={rejectionEvents:["error"],multiArgs:false,resolveImmediately:false,...i};if(!(i.count>=0&&(i.count===Infinity||Number.isInteger(i.count)))){throw new TypeError("The `count` option should be at least 0 or more")}const c=toArray(r);const u=[];const{addListener:h,removeListener:d}=normalizeEmitter(t);const onItem=(...t)=>{const r=i.multiArgs?t:t[0];if(i.filter&&!i.filter(r)){return}u.push(r);if(i.count===u.length){a();o(u)}};const rejectHandler=t=>{a();l(t)};a=()=>{for(const t of c){d(t,onItem)}for(const t of i.rejectionEvents){d(t,rejectHandler)}};for(const t of c){h(t,onItem)}for(const t of i.rejectionEvents){h(t,rejectHandler)}if(i.resolveImmediately){o(u)}}));l.cancel=a;if(typeof i.timeout==="number"){const t=o(l,i.timeout);t.cancel=a;return t}return l};const pEvent=(t,r,i)=>{if(typeof i==="function"){i={filter:i}}i={...i,count:1,resolveImmediately:false};const o=multiple(t,r,i);const a=o.then((t=>t[0]));a.cancel=o.cancel;return a};t.exports=pEvent;t.exports["default"]=pEvent;t.exports.multiple=multiple;t.exports.iterator=(t,r,i)=>{if(typeof i==="function"){i={filter:i}}const o=toArray(r);i={rejectionEvents:["error"],resolutionEvents:[],limit:Infinity,multiArgs:false,...i};const{limit:l}=i;const c=l>=0&&(l===Infinity||Number.isInteger(l));if(!c){throw new TypeError("The `limit` option should be a non-negative integer or Infinity")}if(l===0){return{[Symbol.asyncIterator](){return this},async next(){return{done:true,value:undefined}}}}const{addListener:u,removeListener:h}=normalizeEmitter(t);let d=false;let p;let m=false;const y=[];const g=[];let b=0;let v=false;const valueHandler=(...t)=>{b++;v=b===l;const r=i.multiArgs?t:t[0];if(y.length>0){const{resolve:t}=y.shift();t({done:false,value:r});if(v){cancel()}return}g.push(r);if(v){cancel()}};const cancel=()=>{d=true;for(const t of o){h(t,valueHandler)}for(const t of i.rejectionEvents){h(t,rejectHandler)}for(const t of i.resolutionEvents){h(t,resolveHandler)}while(y.length>0){const{resolve:t}=y.shift();t({done:true,value:undefined})}};const rejectHandler=(...t)=>{p=i.multiArgs?t:t[0];if(y.length>0){const{reject:t}=y.shift();t(p)}else{m=true}cancel()};const resolveHandler=(...t)=>{const r=i.multiArgs?t:t[0];if(i.filter&&!i.filter(r)){return}if(y.length>0){const{resolve:t}=y.shift();t({done:true,value:r})}else{g.push(r)}cancel()};for(const t of o){u(t,valueHandler)}for(const t of i.rejectionEvents){u(t,rejectHandler)}for(const t of i.resolutionEvents){u(t,resolveHandler)}return{[a](){return this},async next(){if(g.length>0){const t=g.shift();return{done:d&&g.length===0&&!v,value:t}}if(m){m=false;throw p}if(d){return{done:true,value:undefined}}return new Promise(((t,r)=>y.push({resolve:t,reject:r})))},async return(t){cancel();return{done:d,value:t}}}};t.exports.TimeoutError=o.TimeoutError},8213:t=>{"use strict";t.exports=(t,r)=>{r=r||(()=>{});return t.then((t=>new Promise((t=>{t(r())})).then((()=>t))),(t=>new Promise((t=>{t(r())})).then((()=>{throw t}))))}},2816:(t,r,i)=>{"use strict";const o=i(8213);class TimeoutError extends Error{constructor(t){super(t);this.name="TimeoutError"}}const pTimeout=(t,r,i)=>new Promise(((a,l)=>{if(typeof r!=="number"||r<0){throw new TypeError("Expected `milliseconds` to be a positive number")}if(r===Infinity){a(t);return}const c=setTimeout((()=>{if(typeof i==="function"){try{a(i())}catch(t){l(t)}return}const o=typeof i==="string"?i:`Promise timed out after ${r} milliseconds`;const c=i instanceof Error?i:new TimeoutError(o);if(typeof t.cancel==="function"){t.cancel()}l(c)}),r);o(t.then(a,l),(()=>{clearTimeout(c)}))}));t.exports=pTimeout;t.exports["default"]=pTimeout;t.exports.TimeoutError=TimeoutError},6230:t=>{"use strict";function posix(t){return t.charAt(0)==="/"}function win32(t){var r=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var i=r.exec(t);var o=i[1]||"";var a=Boolean(o&&o.charAt(1)!==":");return Boolean(i[2]||a)}t.exports=process.platform==="win32"?win32:posix;t.exports.posix=posix;t.exports.win32=win32},2799:t=>{"use strict";const pathKey=(t={})=>{const r=t.env||process.env;const i=t.platform||process.platform;if(i!=="win32"){return"PATH"}return Object.keys(r).reverse().find((t=>t.toUpperCase()==="PATH"))||"Path"};t.exports=pathKey;t.exports["default"]=pathKey},4997:(t,r,i)=>{"use strict";const{promisify:o}=i(3837);const a=i(7147);async function isType(t,r,i){if(typeof i!=="string"){throw new TypeError(`Expected a string, got ${typeof i}`)}try{const l=await o(a[t])(i);return l[r]()}catch(t){if(t.code==="ENOENT"){return false}throw t}}function isTypeSync(t,r,i){if(typeof i!=="string"){throw new TypeError(`Expected a string, got ${typeof i}`)}try{return a[t](i)[r]()}catch(t){if(t.code==="ENOENT"){return false}throw t}}r.isFile=isType.bind(null,"stat","isFile");r.isDirectory=isType.bind(null,"stat","isDirectory");r.isSymlink=isType.bind(null,"lstat","isSymbolicLink");r.isFileSync=isTypeSync.bind(null,"statSync","isFile");r.isDirectorySync=isTypeSync.bind(null,"statSync","isDirectory");r.isSymlinkSync=isTypeSync.bind(null,"lstatSync","isSymbolicLink")},3846:(t,r,i)=>{"use strict";t.exports=i(7250)},7798:(t,r,i)=>{"use strict";const o=i(1017);const a="\\\\/";const l=`[^${a}]`;const c="\\.";const u="\\+";const h="\\?";const d="\\/";const p="(?=.)";const m="[^/]";const y=`(?:${d}|$)`;const g=`(?:^|${d})`;const b=`${c}{1,2}${y}`;const v=`(?!${c})`;const _=`(?!${g}${b})`;const w=`(?!${c}{0,1}${y})`;const E=`(?!${b})`;const S=`[^.${d}]`;const O=`${m}*?`;const R={DOT_LITERAL:c,PLUS_LITERAL:u,QMARK_LITERAL:h,SLASH_LITERAL:d,ONE_CHAR:p,QMARK:m,END_ANCHOR:y,DOTS_SLASH:b,NO_DOT:v,NO_DOTS:_,NO_DOT_SLASH:w,NO_DOTS_SLASH:E,QMARK_NO_DOT:S,STAR:O,START_ANCHOR:g};const x={...R,SLASH_LITERAL:`[${a}]`,QMARK:l,STAR:`${l}*?`,DOTS_SLASH:`${c}{1,2}(?:[${a}]|$)`,NO_DOT:`(?!${c})`,NO_DOTS:`(?!(?:^|[${a}])${c}{1,2}(?:[${a}]|$))`,NO_DOT_SLASH:`(?!${c}{0,1}(?:[${a}]|$))`,NO_DOTS_SLASH:`(?!${c}{1,2}(?:[${a}]|$))`,QMARK_NO_DOT:`[^.${a}]`,START_ANCHOR:`(?:^|[${a}])`,END_ANCHOR:`(?:[${a}]|$)`};const k={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};t.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:k,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:o.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===true?x:R}}},3632:(t,r,i)=>{"use strict";const o=i(7798);const a=i(5502);const{MAX_LENGTH:l,POSIX_REGEX_SOURCE:c,REGEX_NON_SPECIAL_CHARS:u,REGEX_SPECIAL_CHARS_BACKREF:h,REPLACEMENTS:d}=o;const expandRange=(t,r)=>{if(typeof r.expandRange==="function"){return r.expandRange(...t,r)}t.sort();const i=`[${t.join("-")}]`;try{new RegExp(i)}catch(r){return t.map((t=>a.escapeRegex(t))).join("..")}return i};const syntaxError=(t,r)=>`Missing ${t}: "${r}" - use "\\\\${r}" to match literal characters`;const parse=(t,r)=>{if(typeof t!=="string"){throw new TypeError("Expected a string")}t=d[t]||t;const i={...r};const p=typeof i.maxLength==="number"?Math.min(l,i.maxLength):l;let m=t.length;if(m>p){throw new SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${p}`)}const y={type:"bos",value:"",output:i.prepend||""};const g=[y];const b=i.capture?"":"?:";const v=a.isWindows(r);const _=o.globChars(v);const w=o.extglobChars(_);const{DOT_LITERAL:E,PLUS_LITERAL:S,SLASH_LITERAL:O,ONE_CHAR:R,DOTS_SLASH:x,NO_DOT:k,NO_DOT_SLASH:T,NO_DOTS_SLASH:A,QMARK:C,QMARK_NO_DOT:P,STAR:I,START_ANCHOR:L}=_;const globstar=t=>`(${b}(?:(?!${L}${t.dot?x:E}).)*?)`;const M=i.dot?"":k;const D=i.dot?C:P;let N=i.bash===true?globstar(i):I;if(i.capture){N=`(${N})`}if(typeof i.noext==="boolean"){i.noextglob=i.noext}const j={input:t,index:-1,start:0,dot:i.dot===true,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:g};t=a.removePrefix(t,j);m=t.length;const B=[];const $=[];const H=[];let U=y;let q;const eos=()=>j.index===m-1;const z=j.peek=(r=1)=>t[j.index+r];const G=j.advance=()=>t[++j.index]||"";const remaining=()=>t.slice(j.index+1);const consume=(t="",r=0)=>{j.consumed+=t;j.index+=r};const append=t=>{j.output+=t.output!=null?t.output:t.value;consume(t.value)};const negate=()=>{let t=1;while(z()==="!"&&(z(2)!=="("||z(3)==="?")){G();j.start++;t++}if(t%2===0){return false}j.negated=true;j.start++;return true};const increment=t=>{j[t]++;H.push(t)};const decrement=t=>{j[t]--;H.pop()};const push=t=>{if(U.type==="globstar"){const r=j.braces>0&&(t.type==="comma"||t.type==="brace");const i=t.extglob===true||B.length&&(t.type==="pipe"||t.type==="paren");if(t.type!=="slash"&&t.type!=="paren"&&!r&&!i){j.output=j.output.slice(0,-U.output.length);U.type="star";U.value="*";U.output=N;j.output+=U.output}}if(B.length&&t.type!=="paren"){B[B.length-1].inner+=t.value}if(t.value||t.output)append(t);if(U&&U.type==="text"&&t.type==="text"){U.value+=t.value;U.output=(U.output||"")+t.value;return}t.prev=U;g.push(t);U=t};const extglobOpen=(t,r)=>{const o={...w[r],conditions:1,inner:""};o.prev=U;o.parens=j.parens;o.output=j.output;const a=(i.capture?"(":"")+o.open;increment("parens");push({type:t,value:r,output:j.output?"":R});push({type:"paren",extglob:true,value:G(),output:a});B.push(o)};const extglobClose=t=>{let o=t.close+(i.capture?")":"");let a;if(t.type==="negate"){let l=N;if(t.inner&&t.inner.length>1&&t.inner.includes("/")){l=globstar(i)}if(l!==N||eos()||/^\)+$/.test(remaining())){o=t.close=`)$))${l}`}if(t.inner.includes("*")&&(a=remaining())&&/^\.[^\\/.]+$/.test(a)){const i=parse(a,{...r,fastpaths:false}).output;o=t.close=`)${i})${l})`}if(t.prev.type==="bos"){j.negatedExtglob=true}}push({type:"paren",extglob:true,value:q,output:o});decrement("parens")};if(i.fastpaths!==false&&!/(^[*!]|[/()[\]{}"])/.test(t)){let o=false;let l=t.replace(h,((t,r,i,a,l,c)=>{if(a==="\\"){o=true;return t}if(a==="?"){if(r){return r+a+(l?C.repeat(l.length):"")}if(c===0){return D+(l?C.repeat(l.length):"")}return C.repeat(i.length)}if(a==="."){return E.repeat(i.length)}if(a==="*"){if(r){return r+a+(l?N:"")}return N}return r?t:`\\${t}`}));if(o===true){if(i.unescape===true){l=l.replace(/\\/g,"")}else{l=l.replace(/\\+/g,(t=>t.length%2===0?"\\\\":t?"\\":""))}}if(l===t&&i.contains===true){j.output=t;return j}j.output=a.wrapOutput(l,j,r);return j}while(!eos()){q=G();if(q==="\0"){continue}if(q==="\\"){const t=z();if(t==="/"&&i.bash!==true){continue}if(t==="."||t===";"){continue}if(!t){q+="\\";push({type:"text",value:q});continue}const r=/^\\+/.exec(remaining());let o=0;if(r&&r[0].length>2){o=r[0].length;j.index+=o;if(o%2!==0){q+="\\"}}if(i.unescape===true){q=G()}else{q+=G()}if(j.brackets===0){push({type:"text",value:q});continue}}if(j.brackets>0&&(q!=="]"||U.value==="["||U.value==="[^")){if(i.posix!==false&&q===":"){const t=U.value.slice(1);if(t.includes("[")){U.posix=true;if(t.includes(":")){const t=U.value.lastIndexOf("[");const r=U.value.slice(0,t);const i=U.value.slice(t+2);const o=c[i];if(o){U.value=r+o;j.backtrack=true;G();if(!y.output&&g.indexOf(U)===1){y.output=R}continue}}}}if(q==="["&&z()!==":"||q==="-"&&z()==="]"){q=`\\${q}`}if(q==="]"&&(U.value==="["||U.value==="[^")){q=`\\${q}`}if(i.posix===true&&q==="!"&&U.value==="["){q="^"}U.value+=q;append({value:q});continue}if(j.quotes===1&&q!=='"'){q=a.escapeRegex(q);U.value+=q;append({value:q});continue}if(q==='"'){j.quotes=j.quotes===1?0:1;if(i.keepQuotes===true){push({type:"text",value:q})}continue}if(q==="("){increment("parens");push({type:"paren",value:q});continue}if(q===")"){if(j.parens===0&&i.strictBrackets===true){throw new SyntaxError(syntaxError("opening","("))}const t=B[B.length-1];if(t&&j.parens===t.parens+1){extglobClose(B.pop());continue}push({type:"paren",value:q,output:j.parens?")":"\\)"});decrement("parens");continue}if(q==="["){if(i.nobracket===true||!remaining().includes("]")){if(i.nobracket!==true&&i.strictBrackets===true){throw new SyntaxError(syntaxError("closing","]"))}q=`\\${q}`}else{increment("brackets")}push({type:"bracket",value:q});continue}if(q==="]"){if(i.nobracket===true||U&&U.type==="bracket"&&U.value.length===1){push({type:"text",value:q,output:`\\${q}`});continue}if(j.brackets===0){if(i.strictBrackets===true){throw new SyntaxError(syntaxError("opening","["))}push({type:"text",value:q,output:`\\${q}`});continue}decrement("brackets");const t=U.value.slice(1);if(U.posix!==true&&t[0]==="^"&&!t.includes("/")){q=`/${q}`}U.value+=q;append({value:q});if(i.literalBrackets===false||a.hasRegexChars(t)){continue}const r=a.escapeRegex(U.value);j.output=j.output.slice(0,-U.value.length);if(i.literalBrackets===true){j.output+=r;U.value=r;continue}U.value=`(${b}${r}|${U.value})`;j.output+=U.value;continue}if(q==="{"&&i.nobrace!==true){increment("braces");const t={type:"brace",value:q,output:"(",outputIndex:j.output.length,tokensIndex:j.tokens.length};$.push(t);push(t);continue}if(q==="}"){const t=$[$.length-1];if(i.nobrace===true||!t){push({type:"text",value:q,output:q});continue}let r=")";if(t.dots===true){const t=g.slice();const o=[];for(let r=t.length-1;r>=0;r--){g.pop();if(t[r].type==="brace"){break}if(t[r].type!=="dots"){o.unshift(t[r].value)}}r=expandRange(o,i);j.backtrack=true}if(t.comma!==true&&t.dots!==true){const i=j.output.slice(0,t.outputIndex);const o=j.tokens.slice(t.tokensIndex);t.value=t.output="\\{";q=r="\\}";j.output=i;for(const t of o){j.output+=t.output||t.value}}push({type:"brace",value:q,output:r});decrement("braces");$.pop();continue}if(q==="|"){if(B.length>0){B[B.length-1].conditions++}push({type:"text",value:q});continue}if(q===","){let t=q;const r=$[$.length-1];if(r&&H[H.length-1]==="braces"){r.comma=true;t="|"}push({type:"comma",value:q,output:t});continue}if(q==="/"){if(U.type==="dot"&&j.index===j.start+1){j.start=j.index+1;j.consumed="";j.output="";g.pop();U=y;continue}push({type:"slash",value:q,output:O});continue}if(q==="."){if(j.braces>0&&U.type==="dot"){if(U.value===".")U.output=E;const t=$[$.length-1];U.type="dots";U.output+=q;U.value+=q;t.dots=true;continue}if(j.braces+j.parens===0&&U.type!=="bos"&&U.type!=="slash"){push({type:"text",value:q,output:E});continue}push({type:"dot",value:q,output:E});continue}if(q==="?"){const t=U&&U.value==="(";if(!t&&i.noextglob!==true&&z()==="("&&z(2)!=="?"){extglobOpen("qmark",q);continue}if(U&&U.type==="paren"){const t=z();let r=q;if(t==="<"&&!a.supportsLookbehinds()){throw new Error("Node.js v10 or higher is required for regex lookbehinds")}if(U.value==="("&&!/[!=<:]/.test(t)||t==="<"&&!/<([!=]|\w+>)/.test(remaining())){r=`\\${q}`}push({type:"text",value:q,output:r});continue}if(i.dot!==true&&(U.type==="slash"||U.type==="bos")){push({type:"qmark",value:q,output:P});continue}push({type:"qmark",value:q,output:C});continue}if(q==="!"){if(i.noextglob!==true&&z()==="("){if(z(2)!=="?"||!/[!=<:]/.test(z(3))){extglobOpen("negate",q);continue}}if(i.nonegate!==true&&j.index===0){negate();continue}}if(q==="+"){if(i.noextglob!==true&&z()==="("&&z(2)!=="?"){extglobOpen("plus",q);continue}if(U&&U.value==="("||i.regex===false){push({type:"plus",value:q,output:S});continue}if(U&&(U.type==="bracket"||U.type==="paren"||U.type==="brace")||j.parens>0){push({type:"plus",value:q});continue}push({type:"plus",value:S});continue}if(q==="@"){if(i.noextglob!==true&&z()==="("&&z(2)!=="?"){push({type:"at",extglob:true,value:q,output:""});continue}push({type:"text",value:q});continue}if(q!=="*"){if(q==="$"||q==="^"){q=`\\${q}`}const t=u.exec(remaining());if(t){q+=t[0];j.index+=t[0].length}push({type:"text",value:q});continue}if(U&&(U.type==="globstar"||U.star===true)){U.type="star";U.star=true;U.value+=q;U.output=N;j.backtrack=true;j.globstar=true;consume(q);continue}let r=remaining();if(i.noextglob!==true&&/^\([^?]/.test(r)){extglobOpen("star",q);continue}if(U.type==="star"){if(i.noglobstar===true){consume(q);continue}const o=U.prev;const a=o.prev;const l=o.type==="slash"||o.type==="bos";const c=a&&(a.type==="star"||a.type==="globstar");if(i.bash===true&&(!l||r[0]&&r[0]!=="/")){push({type:"star",value:q,output:""});continue}const u=j.braces>0&&(o.type==="comma"||o.type==="brace");const h=B.length&&(o.type==="pipe"||o.type==="paren");if(!l&&o.type!=="paren"&&!u&&!h){push({type:"star",value:q,output:""});continue}while(r.slice(0,3)==="/**"){const i=t[j.index+4];if(i&&i!=="/"){break}r=r.slice(3);consume("/**",3)}if(o.type==="bos"&&eos()){U.type="globstar";U.value+=q;U.output=globstar(i);j.output=U.output;j.globstar=true;consume(q);continue}if(o.type==="slash"&&o.prev.type!=="bos"&&!c&&eos()){j.output=j.output.slice(0,-(o.output+U.output).length);o.output=`(?:${o.output}`;U.type="globstar";U.output=globstar(i)+(i.strictSlashes?")":"|$)");U.value+=q;j.globstar=true;j.output+=o.output+U.output;consume(q);continue}if(o.type==="slash"&&o.prev.type!=="bos"&&r[0]==="/"){const t=r[1]!==void 0?"|$":"";j.output=j.output.slice(0,-(o.output+U.output).length);o.output=`(?:${o.output}`;U.type="globstar";U.output=`${globstar(i)}${O}|${O}${t})`;U.value+=q;j.output+=o.output+U.output;j.globstar=true;consume(q+G());push({type:"slash",value:"/",output:""});continue}if(o.type==="bos"&&r[0]==="/"){U.type="globstar";U.value+=q;U.output=`(?:^|${O}|${globstar(i)}${O})`;j.output=U.output;j.globstar=true;consume(q+G());push({type:"slash",value:"/",output:""});continue}j.output=j.output.slice(0,-U.output.length);U.type="globstar";U.output=globstar(i);U.value+=q;j.output+=U.output;j.globstar=true;consume(q);continue}const o={type:"star",value:q,output:N};if(i.bash===true){o.output=".*?";if(U.type==="bos"||U.type==="slash"){o.output=M+o.output}push(o);continue}if(U&&(U.type==="bracket"||U.type==="paren")&&i.regex===true){o.output=q;push(o);continue}if(j.index===j.start||U.type==="slash"||U.type==="dot"){if(U.type==="dot"){j.output+=T;U.output+=T}else if(i.dot===true){j.output+=A;U.output+=A}else{j.output+=M;U.output+=M}if(z()!=="*"){j.output+=R;U.output+=R}}push(o)}while(j.brackets>0){if(i.strictBrackets===true)throw new SyntaxError(syntaxError("closing","]"));j.output=a.escapeLast(j.output,"[");decrement("brackets")}while(j.parens>0){if(i.strictBrackets===true)throw new SyntaxError(syntaxError("closing",")"));j.output=a.escapeLast(j.output,"(");decrement("parens")}while(j.braces>0){if(i.strictBrackets===true)throw new SyntaxError(syntaxError("closing","}"));j.output=a.escapeLast(j.output,"{");decrement("braces")}if(i.strictSlashes!==true&&(U.type==="star"||U.type==="bracket")){push({type:"maybe_slash",value:"",output:`${O}?`})}if(j.backtrack===true){j.output="";for(const t of j.tokens){j.output+=t.output!=null?t.output:t.value;if(t.suffix){j.output+=t.suffix}}}return j};parse.fastpaths=(t,r)=>{const i={...r};const c=typeof i.maxLength==="number"?Math.min(l,i.maxLength):l;const u=t.length;if(u>c){throw new SyntaxError(`Input length: ${u}, exceeds maximum allowed length: ${c}`)}t=d[t]||t;const h=a.isWindows(r);const{DOT_LITERAL:p,SLASH_LITERAL:m,ONE_CHAR:y,DOTS_SLASH:g,NO_DOT:b,NO_DOTS:v,NO_DOTS_SLASH:_,STAR:w,START_ANCHOR:E}=o.globChars(h);const S=i.dot?v:b;const O=i.dot?_:b;const R=i.capture?"":"?:";const x={negated:false,prefix:""};let k=i.bash===true?".*?":w;if(i.capture){k=`(${k})`}const globstar=t=>{if(t.noglobstar===true)return k;return`(${R}(?:(?!${E}${t.dot?g:p}).)*?)`};const create=t=>{switch(t){case"*":return`${S}${y}${k}`;case".*":return`${p}${y}${k}`;case"*.*":return`${S}${k}${p}${y}${k}`;case"*/*":return`${S}${k}${m}${y}${O}${k}`;case"**":return S+globstar(i);case"**/*":return`(?:${S}${globstar(i)}${m})?${O}${y}${k}`;case"**/*.*":return`(?:${S}${globstar(i)}${m})?${O}${k}${p}${y}${k}`;case"**/.*":return`(?:${S}${globstar(i)}${m})?${p}${y}${k}`;default:{const r=/^(.*?)\.(\w+)$/.exec(t);if(!r)return;const i=create(r[1]);if(!i)return;return i+p+r[2]}}};const T=a.removePrefix(t,x);let A=create(T);if(A&&i.strictSlashes!==true){A+=`${m}?`}return A};t.exports=parse},7250:(t,r,i)=>{"use strict";const o=i(1017);const a=i(2964);const l=i(3632);const c=i(5502);const u=i(7798);const isObject=t=>t&&typeof t==="object"&&!Array.isArray(t);const picomatch=(t,r,i=false)=>{if(Array.isArray(t)){const o=t.map((t=>picomatch(t,r,i)));const arrayMatcher=t=>{for(const r of o){const i=r(t);if(i)return i}return false};return arrayMatcher}const o=isObject(t)&&t.tokens&&t.input;if(t===""||typeof t!=="string"&&!o){throw new TypeError("Expected pattern to be a non-empty string")}const a=r||{};const l=c.isWindows(r);const u=o?picomatch.compileRe(t,r):picomatch.makeRe(t,r,false,true);const h=u.state;delete u.state;let isIgnored=()=>false;if(a.ignore){const t={...r,ignore:null,onMatch:null,onResult:null};isIgnored=picomatch(a.ignore,t,i)}const matcher=(i,o=false)=>{const{isMatch:c,match:d,output:p}=picomatch.test(i,u,r,{glob:t,posix:l});const m={glob:t,state:h,regex:u,posix:l,input:i,output:p,match:d,isMatch:c};if(typeof a.onResult==="function"){a.onResult(m)}if(c===false){m.isMatch=false;return o?m:false}if(isIgnored(i)){if(typeof a.onIgnore==="function"){a.onIgnore(m)}m.isMatch=false;return o?m:false}if(typeof a.onMatch==="function"){a.onMatch(m)}return o?m:true};if(i){matcher.state=h}return matcher};picomatch.test=(t,r,i,{glob:o,posix:a}={})=>{if(typeof t!=="string"){throw new TypeError("Expected input to be a string")}if(t===""){return{isMatch:false,output:""}}const l=i||{};const u=l.format||(a?c.toPosixSlashes:null);let h=t===o;let d=h&&u?u(t):t;if(h===false){d=u?u(t):t;h=d===o}if(h===false||l.capture===true){if(l.matchBase===true||l.basename===true){h=picomatch.matchBase(t,r,i,a)}else{h=r.exec(d)}}return{isMatch:Boolean(h),match:h,output:d}};picomatch.matchBase=(t,r,i,a=c.isWindows(i))=>{const l=r instanceof RegExp?r:picomatch.makeRe(r,i);return l.test(o.basename(t))};picomatch.isMatch=(t,r,i)=>picomatch(r,i)(t);picomatch.parse=(t,r)=>{if(Array.isArray(t))return t.map((t=>picomatch.parse(t,r)));return l(t,{...r,fastpaths:false})};picomatch.scan=(t,r)=>a(t,r);picomatch.compileRe=(t,r,i=false,o=false)=>{if(i===true){return t.output}const a=r||{};const l=a.contains?"":"^";const c=a.contains?"":"$";let u=`${l}(?:${t.output})${c}`;if(t&&t.negated===true){u=`^(?!${u}).*$`}const h=picomatch.toRegex(u,r);if(o===true){h.state=t}return h};picomatch.makeRe=(t,r={},i=false,o=false)=>{if(!t||typeof t!=="string"){throw new TypeError("Expected a non-empty string")}let a={negated:false,fastpaths:true};if(r.fastpaths!==false&&(t[0]==="."||t[0]==="*")){a.output=l.fastpaths(t,r)}if(!a.output){a=l(t,r)}return picomatch.compileRe(a,r,i,o)};picomatch.toRegex=(t,r)=>{try{const i=r||{};return new RegExp(t,i.flags||(i.nocase?"i":""))}catch(t){if(r&&r.debug===true)throw t;return/$^/}};picomatch.constants=u;t.exports=picomatch},2964:(t,r,i)=>{"use strict";const o=i(5502);const{CHAR_ASTERISK:a,CHAR_AT:l,CHAR_BACKWARD_SLASH:c,CHAR_COMMA:u,CHAR_DOT:h,CHAR_EXCLAMATION_MARK:d,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:m,CHAR_LEFT_PARENTHESES:y,CHAR_LEFT_SQUARE_BRACKET:g,CHAR_PLUS:b,CHAR_QUESTION_MARK:v,CHAR_RIGHT_CURLY_BRACE:_,CHAR_RIGHT_PARENTHESES:w,CHAR_RIGHT_SQUARE_BRACKET:E}=i(7798);const isPathSeparator=t=>t===p||t===c;const depth=t=>{if(t.isPrefix!==true){t.depth=t.isGlobstar?Infinity:1}};const scan=(t,r)=>{const i=r||{};const S=t.length-1;const O=i.parts===true||i.scanToEnd===true;const R=[];const x=[];const k=[];let T=t;let A=-1;let C=0;let P=0;let I=false;let L=false;let M=false;let D=false;let N=false;let j=false;let B=false;let $=false;let H=false;let U=false;let q=0;let z;let G;let W={value:"",depth:0,isGlob:false};const eos=()=>A>=S;const peek=()=>T.charCodeAt(A+1);const advance=()=>{z=G;return T.charCodeAt(++A)};while(A<S){G=advance();let t;if(G===c){B=W.backslashes=true;G=advance();if(G===m){j=true}continue}if(j===true||G===m){q++;while(eos()!==true&&(G=advance())){if(G===c){B=W.backslashes=true;advance();continue}if(G===m){q++;continue}if(j!==true&&G===h&&(G=advance())===h){I=W.isBrace=true;M=W.isGlob=true;U=true;if(O===true){continue}break}if(j!==true&&G===u){I=W.isBrace=true;M=W.isGlob=true;U=true;if(O===true){continue}break}if(G===_){q--;if(q===0){j=false;I=W.isBrace=true;U=true;break}}}if(O===true){continue}break}if(G===p){R.push(A);x.push(W);W={value:"",depth:0,isGlob:false};if(U===true)continue;if(z===h&&A===C+1){C+=2;continue}P=A+1;continue}if(i.noext!==true){const t=G===b||G===l||G===a||G===v||G===d;if(t===true&&peek()===y){M=W.isGlob=true;D=W.isExtglob=true;U=true;if(G===d&&A===C){H=true}if(O===true){while(eos()!==true&&(G=advance())){if(G===c){B=W.backslashes=true;G=advance();continue}if(G===w){M=W.isGlob=true;U=true;break}}continue}break}}if(G===a){if(z===a)N=W.isGlobstar=true;M=W.isGlob=true;U=true;if(O===true){continue}break}if(G===v){M=W.isGlob=true;U=true;if(O===true){continue}break}if(G===g){while(eos()!==true&&(t=advance())){if(t===c){B=W.backslashes=true;advance();continue}if(t===E){L=W.isBracket=true;M=W.isGlob=true;U=true;break}}if(O===true){continue}break}if(i.nonegate!==true&&G===d&&A===C){$=W.negated=true;C++;continue}if(i.noparen!==true&&G===y){M=W.isGlob=true;if(O===true){while(eos()!==true&&(G=advance())){if(G===y){B=W.backslashes=true;G=advance();continue}if(G===w){U=true;break}}continue}break}if(M===true){U=true;if(O===true){continue}break}}if(i.noext===true){D=false;M=false}let V=T;let Y="";let Z="";if(C>0){Y=T.slice(0,C);T=T.slice(C);P-=C}if(V&&M===true&&P>0){V=T.slice(0,P);Z=T.slice(P)}else if(M===true){V="";Z=T}else{V=T}if(V&&V!==""&&V!=="/"&&V!==T){if(isPathSeparator(V.charCodeAt(V.length-1))){V=V.slice(0,-1)}}if(i.unescape===true){if(Z)Z=o.removeBackslashes(Z);if(V&&B===true){V=o.removeBackslashes(V)}}const K={prefix:Y,input:t,start:C,base:V,glob:Z,isBrace:I,isBracket:L,isGlob:M,isExtglob:D,isGlobstar:N,negated:$,negatedExtglob:H};if(i.tokens===true){K.maxDepth=0;if(!isPathSeparator(G)){x.push(W)}K.tokens=x}if(i.parts===true||i.tokens===true){let r;for(let o=0;o<R.length;o++){const a=r?r+1:C;const l=R[o];const c=t.slice(a,l);if(i.tokens){if(o===0&&C!==0){x[o].isPrefix=true;x[o].value=Y}else{x[o].value=c}depth(x[o]);K.maxDepth+=x[o].depth}if(o!==0||c!==""){k.push(c)}r=l}if(r&&r+1<t.length){const o=t.slice(r+1);k.push(o);if(i.tokens){x[x.length-1].value=o;depth(x[x.length-1]);K.maxDepth+=x[x.length-1].depth}}K.slashes=R;K.parts=k}return K};t.exports=scan},5502:(t,r,i)=>{"use strict";const o=i(1017);const a=process.platform==="win32";const{REGEX_BACKSLASH:l,REGEX_REMOVE_BACKSLASH:c,REGEX_SPECIAL_CHARS:u,REGEX_SPECIAL_CHARS_GLOBAL:h}=i(7798);r.isObject=t=>t!==null&&typeof t==="object"&&!Array.isArray(t);r.hasRegexChars=t=>u.test(t);r.isRegexChar=t=>t.length===1&&r.hasRegexChars(t);r.escapeRegex=t=>t.replace(h,"\\$1");r.toPosixSlashes=t=>t.replace(l,"/");r.removeBackslashes=t=>t.replace(c,(t=>t==="\\"?"":t));r.supportsLookbehinds=()=>{const t=process.version.slice(1).split(".").map(Number);if(t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10){return true}return false};r.isWindows=t=>{if(t&&typeof t.windows==="boolean"){return t.windows}return a===true||o.sep==="\\"};r.escapeLast=(t,i,o)=>{const a=t.lastIndexOf(i,o);if(a===-1)return t;if(t[a-1]==="\\")return r.escapeLast(t,i,a-1);return`${t.slice(0,a)}\\${t.slice(a)}`};r.removePrefix=(t,r={})=>{let i=t;if(i.startsWith("./")){i=i.slice(2);r.prefix="./"}return i};r.wrapOutput=(t,r={},i={})=>{const o=i.contains?"":"^";const a=i.contains?"":"$";let l=`${o}(?:${t})${a}`;if(r.negated===true){l=`(?:^(?!${l}).*$)`}return l}},9182:t=>{"use strict";if(typeof process==="undefined"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0){t.exports={nextTick:nextTick}}else{t.exports=process}function nextTick(t,r,i,o){if(typeof t!=="function"){throw new TypeError('"callback" argument must be a function')}var a=arguments.length;var l,c;switch(a){case 0:case 1:return process.nextTick(t);case 2:return process.nextTick((function afterTickOne(){t.call(null,r)}));case 3:return process.nextTick((function afterTickTwo(){t.call(null,r,i)}));case 4:return process.nextTick((function afterTickThree(){t.call(null,r,i,o)}));default:l=new Array(a-1);c=0;while(c<l.length){l[c++]=arguments[c]}return process.nextTick((function afterTick(){t.apply(null,l)}))}}},7127:t=>{"use strict";class DatePart{constructor({token:t,date:r,parts:i,locales:o}){this.token=t;this.date=r||new Date;this.parts=i||[this];this.locales=o||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((r,i)=>i>t&&r instanceof DatePart))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const r=t.indexOf(this);return t.find(((t,i)=>i>r&&t instanceof DatePart))}toString(){return String(this.date)}}t.exports=DatePart},9009:(t,r,i)=>{"use strict";const o=i(7127);const pos=t=>{t=t%10;return t===1?"st":t===2?"nd":t===3?"rd":"th"};class Day extends o{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate();let r=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+pos(t):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:t}}t.exports=Day},7574:(t,r,i)=>{"use strict";const o=i(7127);class Hours extends o{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();if(/h/.test(this.token))t=t%12||12;return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Hours},1411:(t,r,i)=>{"use strict";t.exports={DatePart:i(7127),Meridiem:i(4375),Day:i(9009),Hours:i(7574),Milliseconds:i(8284),Minutes:i(2168),Month:i(7001),Seconds:i(3228),Year:i(494)}},4375:(t,r,i)=>{"use strict";const o=i(7127);class Meridiem extends o{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}t.exports=Meridiem},8284:(t,r,i)=>{"use strict";const o=i(7127);class Milliseconds extends o{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}t.exports=Milliseconds},2168:(t,r,i)=>{"use strict";const o=i(7127);class Minutes extends o{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Minutes},7001:(t,r,i)=>{"use strict";const o=i(7127);class Month extends o{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1;this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth();let r=this.token.length;return r===2?String(t+1).padStart(2,"0"):r===3?this.locales.monthsShort[t]:r===4?this.locales.months[t]:String(t+1)}}t.exports=Month},3228:(t,r,i)=>{"use strict";const o=i(7127);class Seconds extends o{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Seconds},494:(t,r,i)=>{"use strict";const o=i(7127);class Year extends o{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}}t.exports=Year},6074:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,l,c){try{var u=t[l](c);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var l=t.apply(r,i);function _next(t){asyncGeneratorStep(l,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(7836);const a=i(4458);const l=i(1407),c=l.erase,u=l.cursor;const h=i(4115),d=h.style,p=h.clear,m=h.figures,y=h.wrap,g=h.entriesToDisplay;const getVal=(t,r)=>t[r]&&(t[r].value||t[r].title||t[r]);const getTitle=(t,r)=>t[r]&&(t[r].title||t[r].value||t[r]);const getIndex=(t,r)=>{const i=t.findIndex((t=>t.value===r||t.title===r));return i>-1?i:undefined};class AutocompletePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.suggest=t.suggest;this.choices=t.choices;this.initial=typeof t.initial==="number"?t.initial:getIndex(t.choices,t.initial);this.select=this.initial||t.cursor||0;this.i18n={noMatches:t.noMatches||"no matches found"};this.fallback=t.fallback||this.initial;this.clearFirst=t.clearFirst||false;this.suggestions=[];this.input="";this.limit=t.limit||10;this.cursor=0;this.transform=d.render(t.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=p("",this.out.columns);this.complete(this.render);this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;if(typeof this._fb==="number")t=this.choices[this._fb];else if(typeof this._fb==="string")t={title:this._fb};return t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t;if(this.suggestions.length>0)this.value=getVal(this.suggestions,t);else this.value=this.fallback.value;this.fire()}complete(t){var r=this;return _asyncToGenerator((function*(){const i=r.completing=r.suggest(r.input,r.choices);const o=yield i;if(r.completing!==i)return;r.suggestions=o.map(((t,r,i)=>({title:getTitle(i,r),value:getVal(i,r),description:t.description})));r.completing=false;const a=Math.max(o.length-1,0);r.moveSelect(Math.min(a,r.select));t&&t()}))()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){let i=this.input.slice(0,this.cursor);let o=this.input.slice(this.cursor);this.input=`${i}${t}${o}`;this.cursor=i.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1);let r=this.input.slice(this.cursor);this.input=`${t}${r}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor);let r=this.input.slice(this.cursor+1);this.input=`${t}${r}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(t,r,i,a){let l;let c=i?m.arrowUp:a?m.arrowDown:" ";let u=r?o.cyan().underline(t.title):t.title;c=(r?o.cyan(m.pointer)+" ":" ")+c;if(t.description){l=` - ${t.description}`;if(c.length+u.length+l.length>=this.out.columns||t.description.split(/\r?\n/).length>1){l="\n"+y(t.description,{margin:3,width:this.out.columns})}}return c+" "+u+o.gray(l||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(u.hide);else this.out.write(p(this.outputText,this.out.columns));super.render();let t=g(this.select,this.choices.length,this.limit),r=t.startIndex,i=t.endIndex;this.outputText=[d.symbol(this.done,this.aborted,this.exited),o.bold(this.msg),d.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const t=this.suggestions.slice(r,i).map(((t,o)=>this.renderOption(t,this.select===o+r,o===0&&r>0,o+r===i-1&&i<this.choices.length))).join("\n");this.outputText+=`\n`+(t||o.gray(this.fallback.title))}this.out.write(c.line+u.to(0)+this.outputText)}}t.exports=AutocompletePrompt},555:(t,r,i)=>{"use strict";const o=i(7836);const a=i(1407),l=a.cursor;const c=i(3740);const u=i(4115),h=u.clear,d=u.style,p=u.figures;class AutocompleteMultiselectPrompt extends c{constructor(t={}){t.overrideRender=true;super(t);this.inputValue="";this.clear=h("",this.out.columns);this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>{if(this.inputValue){if(typeof t.title==="string"){if(t.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof t.value==="string"){if(t.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const r=this.filteredOptions.findIndex((r=>r===t));this.cursor=r<0?0:r;this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t;this.updateFilteredOptions()}_(t,r){if(t===" "){this.handleSpaceToggle()}else{this.handleInputChange(t)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${p.arrowUp}/${p.arrowDown}: Highlight option\n ${p.arrowLeft}/${p.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:o.gray("Enter something to filter")}\n`}renderOption(t,r,i){let a;if(r.disabled)a=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title);else a=t===i?o.cyan().underline(r.title):r.title;return(r.selected?o.green(p.radioOn):p.radioOff)+" "+a}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(l.hide);super.render();let t=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+t);this.clear=h(t,this.out.columns)}}t.exports=AutocompleteMultiselectPrompt},9205:(t,r,i)=>{"use strict";const o=i(7836);const a=i(4458);const l=i(4115),c=l.style,u=l.clear;const h=i(1407),d=h.erase,p=h.cursor;class ConfirmPrompt extends a{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=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){if(t.toLowerCase()==="y"){this.value=true;return this.submit()}if(t.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:o.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(d.line+p.to(0)+this.outputText)}}t.exports=ConfirmPrompt},4244:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,l,c){try{var u=t[l](c);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var l=t.apply(r,i);function _next(t){asyncGeneratorStep(l,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(7836);const a=i(4458);const l=i(4115),c=l.style,u=l.clear,h=l.figures;const d=i(1407),p=d.erase,m=d.cursor;const y=i(1411),g=y.DatePart,b=y.Meridiem,v=y.Day,_=y.Hours,w=y.Milliseconds,E=y.Minutes,S=y.Month,O=y.Seconds,R=y.Year;const x=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const k={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new v(t),3:t=>new S(t),4:t=>new R(t),5:t=>new b(t),6:t=>new _(t),7:t=>new E(t),8:t=>new O(t),9:t=>new w(t)};const T={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.cursor=0;this.typed="";this.locales=Object.assign(T,t.locales);this._date=t.initial||new Date;this.errorMsg=t.error||"Please Enter A Valid Value";this.validator=t.validate||(()=>true);this.mask=t.mask||"YYYY-MM-DD HH:mm:ss";this.clear=u("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(t){if(t)this._date.setTime(t.getTime())}set mask(t){let r;this.parts=[];while(r=x.exec(t)){let t=r.shift();let i=r.findIndex((t=>t!=null));this.parts.push(i in k?k[i]({token:r[i]||t,date:this.date,parts:this.parts,locales:this.locales}):r[i]||t)}let i=this.parts.reduce(((t,r)=>{if(typeof r==="string"&&typeof t[t.length-1]==="string")t[t.length-1]+=r;else t.push(r);return t}),[]);this.parts.splice(0);this.parts.push(...i);this.reset()}moveCursor(t){this.typed="";this.cursor=t;this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof g)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let r=yield t.validator(t.value);if(typeof r==="string"){t.errorMsg=r;r=false}t.error=!r}))()}submit(){var t=this;return _asyncToGenerator((function*(){yield t.validate();if(t.error){t.color="red";t.fire();t.render();return}t.done=true;t.aborted=false;t.fire();t.render();t.out.write("\n");t.close()}))()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof g)));this.render()}_(t){if(/\d/.test(t)){this.typed+=t;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(m.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(false),this.parts.reduce(((t,r,i)=>t.concat(i===this.cursor&&!this.done?o.cyan().underline(r.toString()):r)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((t,r,i)=>t+`\n${i?` `:h.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(p.line+m.to(0)+this.outputText)}}t.exports=DatePrompt},8301:(t,r,i)=>{"use strict";t.exports={TextPrompt:i(9548),SelectPrompt:i(4319),TogglePrompt:i(8999),DatePrompt:i(4244),NumberPrompt:i(6460),MultiselectPrompt:i(3740),AutocompletePrompt:i(6074),AutocompleteMultiselectPrompt:i(555),ConfirmPrompt:i(9205)}},3740:(t,r,i)=>{"use strict";const o=i(7836);const a=i(1407),l=a.cursor;const c=i(4458);const u=i(4115),h=u.clear,d=u.figures,p=u.style,m=u.wrap,y=u.entriesToDisplay;class MultiselectPrompt extends c{constructor(t={}){super(t);this.msg=t.message;this.cursor=t.cursor||0;this.scrollIndex=t.cursor||0;this.hint=t.hint||"";this.warn=t.warn||"- This option is disabled -";this.minSelected=t.min;this.showMinError=false;this.maxChoices=t.max;this.instructions=t.instructions;this.optionsPerPage=t.optionsPerPage||10;this.value=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===undefined?r:t.value),selected:t&&t.selected,disabled:t&&t.disabled}}));this.clear=h("",this.out.columns);if(!t.overrideRender){this.render()}}reset(){this.value.map((t=>!t.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const t=this.value.filter((t=>t.selected));if(this.minSelected&&t.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((r=>r.selected=t));this.render()}_(t,r){if(t===" "){this.handleSpaceToggle()}else if(t==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${d.arrowUp}/${d.arrowDown}: Highlight option\n`+` ${d.arrowLeft}/${d.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(t,r,i,a){const l=(r.selected?o.green(d.radioOn):d.radioOff)+" "+a+" ";let c,u;if(r.disabled){c=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title)}else{c=t===i?o.cyan().underline(r.title):r.title;if(t===i&&r.description){u=` - ${r.description}`;if(l.length+c.length+u.length>=this.out.columns||r.description.split(/\r?\n/).length>1){u="\n"+m(r.description,{margin:l.length,width:this.out.columns})}}}return l+c+o.gray(u||"")}paginateOptions(t){if(t.length===0){return o.red("No matches for this query.")}let r=y(this.cursor,t.length,this.optionsPerPage),i=r.startIndex,a=r.endIndex;let l,c=[];for(let r=i;r<a;r++){if(r===i&&i>0){l=d.arrowUp}else if(r===a-1&&a<t.length){l=d.arrowDown}else{l=" "}c.push(this.renderOption(this.cursor,t[r],r,l))}return"\n"+c.join("\n")}renderOptions(t){if(!this.done){return this.paginateOptions(t)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(l.hide);super.render();let t=[p.symbol(this.done,this.aborted),o.bold(this.msg),p.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.value);this.out.write(this.clear+t);this.clear=h(t,this.out.columns)}}t.exports=MultiselectPrompt},6460:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,l,c){try{var u=t[l](c);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var l=t.apply(r,i);function _next(t){asyncGeneratorStep(l,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(7836);const a=i(4458);const l=i(1407),c=l.cursor,u=l.erase;const h=i(4115),d=h.style,p=h.figures,m=h.clear,y=h.lines;const g=/[0-9]/;const isDef=t=>t!==undefined;const round=(t,r)=>{let i=Math.pow(10,r);return Math.round(t*i)/i};class NumberPrompt extends a{constructor(t={}){super(t);this.transform=d.render(t.style);this.msg=t.message;this.initial=isDef(t.initial)?t.initial:"";this.float=!!t.float;this.round=t.round||2;this.inc=t.increment||1;this.min=isDef(t.min)?t.min:-Infinity;this.max=isDef(t.max)?t.max:Infinity;this.errorMsg=t.error||`Please Enter A Valid Value`;this.validator=t.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(t){if(!t&&t!==0){this.placeholder=true;this.rendered=o.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(t,this.round)}`);this._value=round(t,this.round)}this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t===`-`||t===`.`&&this.float||g.test(t)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==``?t:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let r=yield t.validator(t.value);if(typeof r===`string`){t.errorMsg=r;r=false}t.error=!r}))()}submit(){var t=this;return _asyncToGenerator((function*(){yield t.validate();if(t.error){t.color=`red`;t.fire();t.render();return}let r=t.value;t.value=r!==``?r:t.initial;t.done=true;t.aborted=false;t.error=false;t.fire();t.render();t.out.write(`\n`);t.close()}))()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(t,r){if(!this.valid(t))return this.bell();const i=Date.now();if(i-this.lastHit>1e3)this.typed=``;this.typed+=t;this.lastHit=i;this.color=`cyan`;if(t===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(c.down(y(this.outputError,this.out.columns)-1)+m(this.outputError,this.out.columns));this.out.write(m(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(this.done),!this.done||!this.done&&!this.placeholder?o[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?` `:p.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(u.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore)}}t.exports=NumberPrompt},4458:(t,r,i)=>{"use strict";const o=i(4521);const a=i(4115),l=a.action;const c=i(2361);const u=i(1407),h=u.beep,d=u.cursor;const p=i(7836);class Prompt extends c{constructor(t={}){super();this.firstRender=true;this.in=t.stdin||process.stdin;this.out=t.stdout||process.stdout;this.onRender=(t.onRender||(()=>void 0)).bind(this);const r=o.createInterface({input:this.in,escapeCodeTimeout:50});o.emitKeypressEvents(this.in,r);if(this.in.isTTY)this.in.setRawMode(true);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(t,r)=>{let o=l(r,i);if(o===false){this._&&this._(t,r)}else if(typeof this[o]==="function"){this[o](r)}else{this.bell()}};this.close=()=>{this.out.write(d.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);r.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(h)}render(){this.onRender(p);if(this.firstRender)this.firstRender=false}}t.exports=Prompt},4319:(t,r,i)=>{"use strict";const o=i(7836);const a=i(4458);const l=i(4115),c=l.style,u=l.clear,h=l.figures,d=l.wrap,p=l.entriesToDisplay;const m=i(1407),y=m.cursor;class SelectPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.hint=t.hint||"- Use arrow-keys. Return to submit.";this.warn=t.warn||"- This option is disabled";this.cursor=t.initial||0;this.choices=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),value:t&&(t.value===undefined?r:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}}));this.optionsPerPage=t.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=u("",this.out.columns);this.render()}moveCursor(t){this.cursor=t;this.value=this.choices[t].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(t,r){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(y.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();let t=p(this.cursor,this.choices.length,this.optionsPerPage),r=t.startIndex,i=t.endIndex;this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(false),this.done?this.selection.title:this.selection.disabled?o.yellow(this.warn):o.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let t=r;t<i;t++){let a,l,c="",u=this.choices[t];if(t===r&&r>0){l=h.arrowUp}else if(t===i-1&&i<this.choices.length){l=h.arrowDown}else{l=" "}if(u.disabled){a=this.cursor===t?o.gray().underline(u.title):o.strikethrough().gray(u.title);l=(this.cursor===t?o.bold().gray(h.pointer)+" ":" ")+l}else{a=this.cursor===t?o.cyan().underline(u.title):u.title;l=(this.cursor===t?o.cyan(h.pointer)+" ":" ")+l;if(u.description&&this.cursor===t){c=` - ${u.description}`;if(l.length+a.length+c.length>=this.out.columns||u.description.split(/\r?\n/).length>1){c="\n"+d(u.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${l} ${a}${o.gray(c)}\n`}}this.out.write(this.outputText)}}t.exports=SelectPrompt},9548:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,l,c){try{var u=t[l](c);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var l=t.apply(r,i);function _next(t){asyncGeneratorStep(l,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(7836);const a=i(4458);const l=i(1407),c=l.erase,u=l.cursor;const h=i(4115),d=h.style,p=h.clear,m=h.lines,y=h.figures;class TextPrompt extends a{constructor(t={}){super(t);this.transform=d.render(t.style);this.scale=this.transform.scale;this.msg=t.message;this.initial=t.initial||``;this.validator=t.validate||(()=>true);this.value=``;this.errorMsg=t.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=p(``,this.out.columns);this.render()}set value(t){if(!t&&this.initial){this.placeholder=true;this.rendered=o.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(t)}this._value=t;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let r=yield t.validator(t.value);if(typeof r===`string`){t.errorMsg=r;r=false}t.error=!r}))()}submit(){var t=this;return _asyncToGenerator((function*(){t.value=t.value||t.initial;t.cursorOffset=0;t.cursor=t.rendered.length;yield t.validate();if(t.error){t.red=true;t.fire();t.render();return}t.done=true;t.aborted=false;t.fire();t.render();t.out.write("\n");t.close()}))()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(t){if(this.placeholder)return;this.cursor=this.cursor+t;this.cursorOffset+=t}_(t,r){let i=this.value.slice(0,this.cursor);let o=this.value.slice(this.cursor);this.value=`${i}${t}${o}`;this.red=false;this.cursor=this.placeholder?0:i.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1);let r=this.value.slice(this.cursor);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor);let r=this.value.slice(this.cursor+1);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{this.cursorOffset++}this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(u.down(m(this.outputError,this.out.columns)-1)+p(this.outputError,this.out.columns));this.out.write(p(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(this.done),this.red?o.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?" ":y.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(c.line+u.to(0)+this.outputText+u.save+this.outputError+u.restore+u.move(this.cursorOffset,0))}}t.exports=TextPrompt},8999:(t,r,i)=>{"use strict";const o=i(7836);const a=i(4458);const l=i(4115),c=l.style,u=l.clear;const h=i(1407),d=h.cursor,p=h.erase;class TogglePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=!!t.initial;this.active=t.active||"on";this.inactive=t.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(t,r){if(t===" "){this.value=!this.value}else if(t==="1"){this.value=true}else if(t==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(d.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(this.done),this.value?this.inactive:o.cyan().underline(this.inactive),o.gray("/"),this.value?o.cyan().underline(this.active):this.active].join(" ");this.out.write(p.line+d.to(0)+this.outputText)}}t.exports=TogglePrompt},2024:(t,r,i)=>{"use strict";function ownKeys(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);if(r){o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))}i.push.apply(i,o)}return i}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){ownKeys(Object(i),true).forEach((function(r){_defineProperty(t,r,i[r])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))}else{ownKeys(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}}return t}function _defineProperty(t,r,i){if(r in t){Object.defineProperty(t,r,{value:i,enumerable:true,configurable:true,writable:true})}else{t[r]=i}return t}function _createForOfIteratorHelper(t,r){var i=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||r&&t&&typeof t.length==="number"){if(i)t=i;var o=0;var a=function F(){};return{s:a,n:function n(){if(o>=t.length)return{done:true};return{done:false,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l=true,c=false,u;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();l=t.done;return t},e:function e(t){c=true;u=t},f:function f(){try{if(!l&&i.return!=null)i.return()}finally{if(c)throw u}}}}function _unsupportedIterableToArray(t,r){if(!t)return;if(typeof t==="string")return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor)i=t.constructor.name;if(i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(t,r)}function _arrayLikeToArray(t,r){if(r==null||r>t.length)r=t.length;for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}function asyncGeneratorStep(t,r,i,o,a,l,c){try{var u=t[l](c);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var l=t.apply(r,i);function _next(t){asyncGeneratorStep(l,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(8422);const a=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};function prompt(){return _prompt.apply(this,arguments)}function _prompt(){_prompt=_asyncToGenerator((function*(t=[],{onSubmit:r=noop,onCancel:i=noop}={}){const l={};const c=prompt._override||{};t=[].concat(t);let u,h,d,p,m,y;const g=function(){var t=_asyncToGenerator((function*(t,r,i=false){if(!i&&t.validate&&t.validate(r)!==true){return}return t.format?yield t.format(r,l):r}));return function getFormattedAnswer(r,i){return t.apply(this,arguments)}}();var b=_createForOfIteratorHelper(t),v;try{for(b.s();!(v=b.n()).done;){h=v.value;var _=h;p=_.name;m=_.type;if(typeof m==="function"){m=yield m(u,_objectSpread({},l),h);h["type"]=m}if(!m)continue;for(let t in h){if(a.includes(t))continue;let r=h[t];h[t]=typeof r==="function"?yield r(u,_objectSpread({},l),y):r}y=h;if(typeof h.message!=="string"){throw new Error("prompt message is required")}var w=h;p=w.name;m=w.type;if(o[m]===void 0){throw new Error(`prompt type (${m}) is not defined`)}if(c[h.name]!==undefined){u=yield g(h,c[h.name]);if(u!==undefined){l[p]=u;continue}}try{u=prompt._injected?getInjectedAnswer(prompt._injected,h.initial):yield o[m](h);l[p]=u=yield g(h,u,true);d=yield r(h,u,l)}catch(t){d=!(yield i(h,l))}if(d)return l}}catch(t){b.e(t)}finally{b.f()}return l}));return _prompt.apply(this,arguments)}function getInjectedAnswer(t,r){const i=t.shift();if(i instanceof Error){throw i}return i===undefined?r:i}function inject(t){prompt._injected=(prompt._injected||[]).concat(t)}function override(t){prompt._override=Object.assign({},t)}t.exports=Object.assign(prompt,{prompt:prompt,prompts:o,inject:inject,override:override})},8422:(t,r,i)=>{"use strict";const o=r;const a=i(8301);const noop=t=>t;function toPrompt(t,r,i={}){return new Promise(((o,l)=>{const c=new a[t](r);const u=i.onAbort||noop;const h=i.onSubmit||noop;const d=i.onExit||noop;c.on("state",r.onState||noop);c.on("submit",(t=>o(h(t))));c.on("exit",(t=>o(d(t))));c.on("abort",(t=>l(u(t))))}))}o.text=t=>toPrompt("TextPrompt",t);o.password=t=>{t.style="password";return o.text(t)};o.invisible=t=>{t.style="invisible";return o.text(t)};o.number=t=>toPrompt("NumberPrompt",t);o.date=t=>toPrompt("DatePrompt",t);o.confirm=t=>toPrompt("ConfirmPrompt",t);o.list=t=>{const r=t.separator||",";return toPrompt("TextPrompt",t,{onSubmit:t=>t.split(r).map((t=>t.trim()))})};o.toggle=t=>toPrompt("TogglePrompt",t);o.select=t=>toPrompt("SelectPrompt",t);o.multiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("MultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};o.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("AutocompleteMultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(t,r)=>Promise.resolve(r.filter((r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));o.autocomplete=t=>{t.suggest=t.suggest||byTitle;t.choices=[].concat(t.choices||[]);return toPrompt("AutocompletePrompt",t)}},4199:t=>{"use strict";t.exports=(t,r)=>{if(t.meta&&t.name!=="escape")return;if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c")return"abort";if(t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(r){if(t.name==="j")return"down";if(t.name==="k")return"up"}if(t.name==="return")return"submit";if(t.name==="enter")return"submit";if(t.name==="backspace")return"delete";if(t.name==="delete")return"deleteForward";if(t.name==="abort")return"abort";if(t.name==="escape")return"exit";if(t.name==="tab")return"next";if(t.name==="pagedown")return"nextPage";if(t.name==="pageup")return"prevPage";if(t.name==="home")return"home";if(t.name==="end")return"end";if(t.name==="up")return"up";if(t.name==="down")return"down";if(t.name==="right")return"right";if(t.name==="left")return"left";return false}},3995:(t,r,i)=>{"use strict";function _createForOfIteratorHelper(t,r){var i=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||r&&t&&typeof t.length==="number"){if(i)t=i;var o=0;var a=function F(){};return{s:a,n:function n(){if(o>=t.length)return{done:true};return{done:false,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l=true,c=false,u;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();l=t.done;return t},e:function e(t){c=true;u=t},f:function f(){try{if(!l&&i.return!=null)i.return()}finally{if(c)throw u}}}}function _unsupportedIterableToArray(t,r){if(!t)return;if(typeof t==="string")return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor)i=t.constructor.name;if(i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(t,r)}function _arrayLikeToArray(t,r){if(r==null||r>t.length)r=t.length;for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}const o=i(4056);const a=i(1407),l=a.erase,c=a.cursor;const width=t=>[...o(t)].length;t.exports=function(t,r){if(!r)return l.line+c.to(0);let i=0;const o=t.split(/\r?\n/);var a=_createForOfIteratorHelper(o),u;try{for(a.s();!(u=a.n()).done;){let t=u.value;i+=1+Math.floor(Math.max(width(t)-1,0)/r)}}catch(t){a.e(t)}finally{a.f()}return l.lines(i)}},308:t=>{"use strict";t.exports=(t,r,i)=>{i=i||r;let o=Math.min(r-i,t-Math.floor(i/2));if(o<0)o=0;let a=Math.min(o+i,r);return{startIndex:o,endIndex:a}}},8111:t=>{"use strict";const r={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const i={arrowUp:r.arrowUp,arrowDown:r.arrowDown,arrowLeft:r.arrowLeft,arrowRight:r.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const o=process.platform==="win32"?i:r;t.exports=o},4115:(t,r,i)=>{"use strict";t.exports={action:i(4199),clear:i(3995),style:i(1640),strip:i(4056),figures:i(8111),lines:i(8886),wrap:i(2110),entriesToDisplay:i(308)}},8886:(t,r,i)=>{"use strict";const o=i(4056);t.exports=function(t,r){let i=String(o(t)||"").split(/\r?\n/);if(!r)return i.length;return i.map((t=>Math.ceil(t.length/r))).reduce(((t,r)=>t+r))}},4056:t=>{"use strict";t.exports=t=>{const r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const i=new RegExp(r,"g");return typeof t==="string"?t.replace(i,""):t}},1640:(t,r,i)=>{"use strict";const o=i(7836);const a=i(8111);const l=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}});const render=t=>l[t]||l.default;const c=Object.freeze({aborted:o.red(a.cross),done:o.green(a.tick),exited:o.yellow(a.cross),default:o.cyan("?")});const symbol=(t,r,i)=>r?c.aborted:i?c.exited:t?c.done:c.default;const delimiter=t=>o.gray(t?a.ellipsis:a.pointerSmall);const item=(t,r)=>o.gray(t?r?a.pointerSmall:"+":a.line);t.exports={styles:l,render:render,symbols:c,symbol:symbol,delimiter:delimiter,item:item}},2110:t=>{"use strict";t.exports=(t,r={})=>{const i=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"";const o=r.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,r)=>{if(r.length+i.length>=o||t[t.length-1].length+r.length+1<o)t[t.length-1]+=` ${r}`;else t.push(`${i}${r}`);return t}),[i]).join("\n"))).join("\n")}},5713:(t,r,i)=>{function isNodeLT(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let r=0,i=process.versions.node.split(".").map(Number);for(;r<t.length;r++){if(i[r]>t[r])return false;if(t[r]>i[r])return true}return false}t.exports=isNodeLT("8.6.0")?i(2024):i(5061)},8701:t=>{"use strict";class DatePart{constructor({token:t,date:r,parts:i,locales:o}){this.token=t;this.date=r||new Date;this.parts=i||[this];this.locales=o||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((r,i)=>i>t&&r instanceof DatePart))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const r=t.indexOf(this);return t.find(((t,i)=>i>r&&t instanceof DatePart))}toString(){return String(this.date)}}t.exports=DatePart},5998:(t,r,i)=>{"use strict";const o=i(8701);const pos=t=>{t=t%10;return t===1?"st":t===2?"nd":t===3?"rd":"th"};class Day extends o{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate();let r=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+pos(t):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:t}}t.exports=Day},9780:(t,r,i)=>{"use strict";const o=i(8701);class Hours extends o{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();if(/h/.test(this.token))t=t%12||12;return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Hours},399:(t,r,i)=>{"use strict";t.exports={DatePart:i(8701),Meridiem:i(3385),Day:i(5998),Hours:i(9780),Milliseconds:i(6858),Minutes:i(8616),Month:i(1325),Seconds:i(817),Year:i(5406)}},3385:(t,r,i)=>{"use strict";const o=i(8701);class Meridiem extends o{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}t.exports=Meridiem},6858:(t,r,i)=>{"use strict";const o=i(8701);class Milliseconds extends o{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}t.exports=Milliseconds},8616:(t,r,i)=>{"use strict";const o=i(8701);class Minutes extends o{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Minutes},1325:(t,r,i)=>{"use strict";const o=i(8701);class Month extends o{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1;this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth();let r=this.token.length;return r===2?String(t+1).padStart(2,"0"):r===3?this.locales.monthsShort[t]:r===4?this.locales.months[t]:String(t+1)}}t.exports=Month},817:(t,r,i)=>{"use strict";const o=i(8701);class Seconds extends o{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Seconds},5406:(t,r,i)=>{"use strict";const o=i(8701);class Year extends o{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}}t.exports=Year},5533:(t,r,i)=>{"use strict";const o=i(7836);const a=i(9850);const{erase:l,cursor:c}=i(1407);const{style:u,clear:h,figures:d,wrap:p,entriesToDisplay:m}=i(327);const getVal=(t,r)=>t[r]&&(t[r].value||t[r].title||t[r]);const getTitle=(t,r)=>t[r]&&(t[r].title||t[r].value||t[r]);const getIndex=(t,r)=>{const i=t.findIndex((t=>t.value===r||t.title===r));return i>-1?i:undefined};class AutocompletePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.suggest=t.suggest;this.choices=t.choices;this.initial=typeof t.initial==="number"?t.initial:getIndex(t.choices,t.initial);this.select=this.initial||t.cursor||0;this.i18n={noMatches:t.noMatches||"no matches found"};this.fallback=t.fallback||this.initial;this.clearFirst=t.clearFirst||false;this.suggestions=[];this.input="";this.limit=t.limit||10;this.cursor=0;this.transform=u.render(t.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=h("",this.out.columns);this.complete(this.render);this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;if(typeof this._fb==="number")t=this.choices[this._fb];else if(typeof this._fb==="string")t={title:this._fb};return t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t;if(this.suggestions.length>0)this.value=getVal(this.suggestions,t);else this.value=this.fallback.value;this.fire()}async complete(t){const r=this.completing=this.suggest(this.input,this.choices);const i=await r;if(this.completing!==r)return;this.suggestions=i.map(((t,r,i)=>({title:getTitle(i,r),value:getVal(i,r),description:t.description})));this.completing=false;const o=Math.max(i.length-1,0);this.moveSelect(Math.min(o,this.select));t&&t()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){let i=this.input.slice(0,this.cursor);let o=this.input.slice(this.cursor);this.input=`${i}${t}${o}`;this.cursor=i.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1);let r=this.input.slice(this.cursor);this.input=`${t}${r}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor);let r=this.input.slice(this.cursor+1);this.input=`${t}${r}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(t,r,i,a){let l;let c=i?d.arrowUp:a?d.arrowDown:" ";let u=r?o.cyan().underline(t.title):t.title;c=(r?o.cyan(d.pointer)+" ":" ")+c;if(t.description){l=` - ${t.description}`;if(c.length+u.length+l.length>=this.out.columns||t.description.split(/\r?\n/).length>1){l="\n"+p(t.description,{margin:3,width:this.out.columns})}}return c+" "+u+o.gray(l||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(c.hide);else this.out.write(h(this.outputText,this.out.columns));super.render();let{startIndex:t,endIndex:r}=m(this.select,this.choices.length,this.limit);this.outputText=[u.symbol(this.done,this.aborted,this.exited),o.bold(this.msg),u.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const i=this.suggestions.slice(t,r).map(((i,o)=>this.renderOption(i,this.select===o+t,o===0&&t>0,o+t===r-1&&r<this.choices.length))).join("\n");this.outputText+=`\n`+(i||o.gray(this.fallback.title))}this.out.write(l.line+c.to(0)+this.outputText)}}t.exports=AutocompletePrompt},5474:(t,r,i)=>{"use strict";const o=i(7836);const{cursor:a}=i(1407);const l=i(3441);const{clear:c,style:u,figures:h}=i(327);class AutocompleteMultiselectPrompt extends l{constructor(t={}){t.overrideRender=true;super(t);this.inputValue="";this.clear=c("",this.out.columns);this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>{if(this.inputValue){if(typeof t.title==="string"){if(t.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof t.value==="string"){if(t.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const r=this.filteredOptions.findIndex((r=>r===t));this.cursor=r<0?0:r;this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t;this.updateFilteredOptions()}_(t,r){if(t===" "){this.handleSpaceToggle()}else{this.handleInputChange(t)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${h.arrowUp}/${h.arrowDown}: Highlight option\n ${h.arrowLeft}/${h.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:o.gray("Enter something to filter")}\n`}renderOption(t,r,i){let a;if(r.disabled)a=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title);else a=t===i?o.cyan().underline(r.title):r.title;return(r.selected?o.green(h.radioOn):h.radioOff)+" "+a}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(a.hide);super.render();let t=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+t);this.clear=c(t,this.out.columns)}}t.exports=AutocompleteMultiselectPrompt},252:(t,r,i)=>{const o=i(7836);const a=i(9850);const{style:l,clear:c}=i(327);const{erase:u,cursor:h}=i(1407);class ConfirmPrompt extends a{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=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){if(t.toLowerCase()==="y"){this.value=true;return this.submit()}if(t.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(h.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:o.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(u.line+h.to(0)+this.outputText)}}t.exports=ConfirmPrompt},3330:(t,r,i)=>{"use strict";const o=i(7836);const a=i(9850);const{style:l,clear:c,figures:u}=i(327);const{erase:h,cursor:d}=i(1407);const{DatePart:p,Meridiem:m,Day:y,Hours:g,Milliseconds:b,Minutes:v,Month:_,Seconds:w,Year:E}=i(399);const S=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const O={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new y(t),3:t=>new _(t),4:t=>new E(t),5:t=>new m(t),6:t=>new g(t),7:t=>new v(t),8:t=>new w(t),9:t=>new b(t)};const R={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.cursor=0;this.typed="";this.locales=Object.assign(R,t.locales);this._date=t.initial||new Date;this.errorMsg=t.error||"Please Enter A Valid Value";this.validator=t.validate||(()=>true);this.mask=t.mask||"YYYY-MM-DD HH:mm:ss";this.clear=c("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(t){if(t)this._date.setTime(t.getTime())}set mask(t){let r;this.parts=[];while(r=S.exec(t)){let t=r.shift();let i=r.findIndex((t=>t!=null));this.parts.push(i in O?O[i]({token:r[i]||t,date:this.date,parts:this.parts,locales:this.locales}):r[i]||t)}let i=this.parts.reduce(((t,r)=>{if(typeof r==="string"&&typeof t[t.length-1]==="string")t[t.length-1]+=r;else t.push(r);return t}),[]);this.parts.splice(0);this.parts.push(...i);this.reset()}moveCursor(t){this.typed="";this.cursor=t;this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof p)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let t=await this.validator(this.value);if(typeof t==="string"){this.errorMsg=t;t=false}this.error=!t}async submit(){await this.validate();if(this.error){this.color="red";this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof p)));this.render()}_(t){if(/\d/.test(t)){this.typed+=t;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(d.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(false),this.parts.reduce(((t,r,i)=>t.concat(i===this.cursor&&!this.done?o.cyan().underline(r.toString()):r)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((t,r,i)=>t+`\n${i?` `:u.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(h.line+d.to(0)+this.outputText)}}t.exports=DatePrompt},697:(t,r,i)=>{"use strict";t.exports={TextPrompt:i(6589),SelectPrompt:i(7682),TogglePrompt:i(4654),DatePrompt:i(3330),NumberPrompt:i(3281),MultiselectPrompt:i(3441),AutocompletePrompt:i(5533),AutocompleteMultiselectPrompt:i(5474),ConfirmPrompt:i(252)}},3441:(t,r,i)=>{"use strict";const o=i(7836);const{cursor:a}=i(1407);const l=i(9850);const{clear:c,figures:u,style:h,wrap:d,entriesToDisplay:p}=i(327);class MultiselectPrompt extends l{constructor(t={}){super(t);this.msg=t.message;this.cursor=t.cursor||0;this.scrollIndex=t.cursor||0;this.hint=t.hint||"";this.warn=t.warn||"- This option is disabled -";this.minSelected=t.min;this.showMinError=false;this.maxChoices=t.max;this.instructions=t.instructions;this.optionsPerPage=t.optionsPerPage||10;this.value=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===undefined?r:t.value),selected:t&&t.selected,disabled:t&&t.disabled}}));this.clear=c("",this.out.columns);if(!t.overrideRender){this.render()}}reset(){this.value.map((t=>!t.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const t=this.value.filter((t=>t.selected));if(this.minSelected&&t.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((r=>r.selected=t));this.render()}_(t,r){if(t===" "){this.handleSpaceToggle()}else if(t==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${u.arrowUp}/${u.arrowDown}: Highlight option\n`+` ${u.arrowLeft}/${u.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(t,r,i,a){const l=(r.selected?o.green(u.radioOn):u.radioOff)+" "+a+" ";let c,h;if(r.disabled){c=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title)}else{c=t===i?o.cyan().underline(r.title):r.title;if(t===i&&r.description){h=` - ${r.description}`;if(l.length+c.length+h.length>=this.out.columns||r.description.split(/\r?\n/).length>1){h="\n"+d(r.description,{margin:l.length,width:this.out.columns})}}}return l+c+o.gray(h||"")}paginateOptions(t){if(t.length===0){return o.red("No matches for this query.")}let{startIndex:r,endIndex:i}=p(this.cursor,t.length,this.optionsPerPage);let a,l=[];for(let o=r;o<i;o++){if(o===r&&r>0){a=u.arrowUp}else if(o===i-1&&i<t.length){a=u.arrowDown}else{a=" "}l.push(this.renderOption(this.cursor,t[o],o,a))}return"\n"+l.join("\n")}renderOptions(t){if(!this.done){return this.paginateOptions(t)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(a.hide);super.render();let t=[h.symbol(this.done,this.aborted),o.bold(this.msg),h.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.value);this.out.write(this.clear+t);this.clear=c(t,this.out.columns)}}t.exports=MultiselectPrompt},3281:(t,r,i)=>{const o=i(7836);const a=i(9850);const{cursor:l,erase:c}=i(1407);const{style:u,figures:h,clear:d,lines:p}=i(327);const m=/[0-9]/;const isDef=t=>t!==undefined;const round=(t,r)=>{let i=Math.pow(10,r);return Math.round(t*i)/i};class NumberPrompt extends a{constructor(t={}){super(t);this.transform=u.render(t.style);this.msg=t.message;this.initial=isDef(t.initial)?t.initial:"";this.float=!!t.float;this.round=t.round||2;this.inc=t.increment||1;this.min=isDef(t.min)?t.min:-Infinity;this.max=isDef(t.max)?t.max:Infinity;this.errorMsg=t.error||`Please Enter A Valid Value`;this.validator=t.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(t){if(!t&&t!==0){this.placeholder=true;this.rendered=o.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(t,this.round)}`);this._value=round(t,this.round)}this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t===`-`||t===`.`&&this.float||m.test(t)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==``?t:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}async validate(){let t=await this.validator(this.value);if(typeof t===`string`){this.errorMsg=t;t=false}this.error=!t}async submit(){await this.validate();if(this.error){this.color=`red`;this.fire();this.render();return}let t=this.value;this.value=t!==``?t:this.initial;this.done=true;this.aborted=false;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(t,r){if(!this.valid(t))return this.bell();const i=Date.now();if(i-this.lastHit>1e3)this.typed=``;this.typed+=t;this.lastHit=i;this.color=`cyan`;if(t===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(l.down(p(this.outputError,this.out.columns)-1)+d(this.outputError,this.out.columns));this.out.write(d(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(this.done),!this.done||!this.done&&!this.placeholder?o[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?` `:h.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(c.line+l.to(0)+this.outputText+l.save+this.outputError+l.restore)}}t.exports=NumberPrompt},9850:(t,r,i)=>{"use strict";const o=i(4521);const{action:a}=i(327);const l=i(2361);const{beep:c,cursor:u}=i(1407);const h=i(7836);class Prompt extends l{constructor(t={}){super();this.firstRender=true;this.in=t.stdin||process.stdin;this.out=t.stdout||process.stdout;this.onRender=(t.onRender||(()=>void 0)).bind(this);const r=o.createInterface({input:this.in,escapeCodeTimeout:50});o.emitKeypressEvents(this.in,r);if(this.in.isTTY)this.in.setRawMode(true);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(t,r)=>{let o=a(r,i);if(o===false){this._&&this._(t,r)}else if(typeof this[o]==="function"){this[o](r)}else{this.bell()}};this.close=()=>{this.out.write(u.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);r.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(c)}render(){this.onRender(h);if(this.firstRender)this.firstRender=false}}t.exports=Prompt},7682:(t,r,i)=>{"use strict";const o=i(7836);const a=i(9850);const{style:l,clear:c,figures:u,wrap:h,entriesToDisplay:d}=i(327);const{cursor:p}=i(1407);class SelectPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.hint=t.hint||"- Use arrow-keys. Return to submit.";this.warn=t.warn||"- This option is disabled";this.cursor=t.initial||0;this.choices=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),value:t&&(t.value===undefined?r:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}}));this.optionsPerPage=t.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=c("",this.out.columns);this.render()}moveCursor(t){this.cursor=t;this.value=this.choices[t].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(t,r){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();let{startIndex:t,endIndex:r}=d(this.cursor,this.choices.length,this.optionsPerPage);this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(false),this.done?this.selection.title:this.selection.disabled?o.yellow(this.warn):o.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let i=t;i<r;i++){let a,l,c="",d=this.choices[i];if(i===t&&t>0){l=u.arrowUp}else if(i===r-1&&r<this.choices.length){l=u.arrowDown}else{l=" "}if(d.disabled){a=this.cursor===i?o.gray().underline(d.title):o.strikethrough().gray(d.title);l=(this.cursor===i?o.bold().gray(u.pointer)+" ":" ")+l}else{a=this.cursor===i?o.cyan().underline(d.title):d.title;l=(this.cursor===i?o.cyan(u.pointer)+" ":" ")+l;if(d.description&&this.cursor===i){c=` - ${d.description}`;if(l.length+a.length+c.length>=this.out.columns||d.description.split(/\r?\n/).length>1){c="\n"+h(d.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${l} ${a}${o.gray(c)}\n`}}this.out.write(this.outputText)}}t.exports=SelectPrompt},6589:(t,r,i)=>{const o=i(7836);const a=i(9850);const{erase:l,cursor:c}=i(1407);const{style:u,clear:h,lines:d,figures:p}=i(327);class TextPrompt extends a{constructor(t={}){super(t);this.transform=u.render(t.style);this.scale=this.transform.scale;this.msg=t.message;this.initial=t.initial||``;this.validator=t.validate||(()=>true);this.value=``;this.errorMsg=t.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=h(``,this.out.columns);this.render()}set value(t){if(!t&&this.initial){this.placeholder=true;this.rendered=o.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(t)}this._value=t;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let t=await this.validator(this.value);if(typeof t===`string`){this.errorMsg=t;t=false}this.error=!t}async submit(){this.value=this.value||this.initial;this.cursorOffset=0;this.cursor=this.rendered.length;await this.validate();if(this.error){this.red=true;this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(t){if(this.placeholder)return;this.cursor=this.cursor+t;this.cursorOffset+=t}_(t,r){let i=this.value.slice(0,this.cursor);let o=this.value.slice(this.cursor);this.value=`${i}${t}${o}`;this.red=false;this.cursor=this.placeholder?0:i.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1);let r=this.value.slice(this.cursor);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor);let r=this.value.slice(this.cursor+1);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{this.cursorOffset++}this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(c.down(d(this.outputError,this.out.columns)-1)+h(this.outputError,this.out.columns));this.out.write(h(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(this.done),this.red?o.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?" ":p.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(l.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore+c.move(this.cursorOffset,0))}}t.exports=TextPrompt},4654:(t,r,i)=>{const o=i(7836);const a=i(9850);const{style:l,clear:c}=i(327);const{cursor:u,erase:h}=i(1407);class TogglePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=!!t.initial;this.active=t.active||"on";this.inactive=t.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(t,r){if(t===" "){this.value=!this.value}else if(t==="1"){this.value=true}else if(t==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(u.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),this.value?this.inactive:o.cyan().underline(this.inactive),o.gray("/"),this.value?o.cyan().underline(this.active):this.active].join(" ");this.out.write(h.line+u.to(0)+this.outputText)}}t.exports=TogglePrompt},5061:(t,r,i)=>{"use strict";const o=i(4542);const a=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};async function prompt(t=[],{onSubmit:r=noop,onCancel:i=noop}={}){const l={};const c=prompt._override||{};t=[].concat(t);let u,h,d,p,m,y;const getFormattedAnswer=async(t,r,i=false)=>{if(!i&&t.validate&&t.validate(r)!==true){return}return t.format?await t.format(r,l):r};for(h of t){({name:p,type:m}=h);if(typeof m==="function"){m=await m(u,{...l},h);h["type"]=m}if(!m)continue;for(let t in h){if(a.includes(t))continue;let r=h[t];h[t]=typeof r==="function"?await r(u,{...l},y):r}y=h;if(typeof h.message!=="string"){throw new Error("prompt message is required")}({name:p,type:m}=h);if(o[m]===void 0){throw new Error(`prompt type (${m}) is not defined`)}if(c[h.name]!==undefined){u=await getFormattedAnswer(h,c[h.name]);if(u!==undefined){l[p]=u;continue}}try{u=prompt._injected?getInjectedAnswer(prompt._injected,h.initial):await o[m](h);l[p]=u=await getFormattedAnswer(h,u,true);d=await r(h,u,l)}catch(t){d=!await i(h,l)}if(d)return l}return l}function getInjectedAnswer(t,r){const i=t.shift();if(i instanceof Error){throw i}return i===undefined?r:i}function inject(t){prompt._injected=(prompt._injected||[]).concat(t)}function override(t){prompt._override=Object.assign({},t)}t.exports=Object.assign(prompt,{prompt:prompt,prompts:o,inject:inject,override:override})},4542:(t,r,i)=>{"use strict";const o=r;const a=i(697);const noop=t=>t;function toPrompt(t,r,i={}){return new Promise(((o,l)=>{const c=new a[t](r);const u=i.onAbort||noop;const h=i.onSubmit||noop;const d=i.onExit||noop;c.on("state",r.onState||noop);c.on("submit",(t=>o(h(t))));c.on("exit",(t=>o(d(t))));c.on("abort",(t=>l(u(t))))}))}o.text=t=>toPrompt("TextPrompt",t);o.password=t=>{t.style="password";return o.text(t)};o.invisible=t=>{t.style="invisible";return o.text(t)};o.number=t=>toPrompt("NumberPrompt",t);o.date=t=>toPrompt("DatePrompt",t);o.confirm=t=>toPrompt("ConfirmPrompt",t);o.list=t=>{const r=t.separator||",";return toPrompt("TextPrompt",t,{onSubmit:t=>t.split(r).map((t=>t.trim()))})};o.toggle=t=>toPrompt("TogglePrompt",t);o.select=t=>toPrompt("SelectPrompt",t);o.multiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("MultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};o.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("AutocompleteMultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(t,r)=>Promise.resolve(r.filter((r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));o.autocomplete=t=>{t.suggest=t.suggest||byTitle;t.choices=[].concat(t.choices||[]);return toPrompt("AutocompletePrompt",t)}},7612:t=>{"use strict";t.exports=(t,r)=>{if(t.meta&&t.name!=="escape")return;if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c")return"abort";if(t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(r){if(t.name==="j")return"down";if(t.name==="k")return"up"}if(t.name==="return")return"submit";if(t.name==="enter")return"submit";if(t.name==="backspace")return"delete";if(t.name==="delete")return"deleteForward";if(t.name==="abort")return"abort";if(t.name==="escape")return"exit";if(t.name==="tab")return"next";if(t.name==="pagedown")return"nextPage";if(t.name==="pageup")return"prevPage";if(t.name==="home")return"home";if(t.name==="end")return"end";if(t.name==="up")return"up";if(t.name==="down")return"down";if(t.name==="right")return"right";if(t.name==="left")return"left";return false}},1335:(t,r,i)=>{"use strict";const o=i(8409);const{erase:a,cursor:l}=i(1407);const width=t=>[...o(t)].length;t.exports=function(t,r){if(!r)return a.line+l.to(0);let i=0;const o=t.split(/\r?\n/);for(let t of o){i+=1+Math.floor(Math.max(width(t)-1,0)/r)}return a.lines(i)}},6606:t=>{"use strict";t.exports=(t,r,i)=>{i=i||r;let o=Math.min(r-i,t-Math.floor(i/2));if(o<0)o=0;let a=Math.min(o+i,r);return{startIndex:o,endIndex:a}}},5878:t=>{"use strict";const r={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const i={arrowUp:r.arrowUp,arrowDown:r.arrowDown,arrowLeft:r.arrowLeft,arrowRight:r.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const o=process.platform==="win32"?i:r;t.exports=o},327:(t,r,i)=>{"use strict";t.exports={action:i(7612),clear:i(1335),style:i(3165),strip:i(8409),figures:i(5878),lines:i(2890),wrap:i(1669),entriesToDisplay:i(6606)}},2890:(t,r,i)=>{"use strict";const o=i(8409);t.exports=function(t,r){let i=String(o(t)||"").split(/\r?\n/);if(!r)return i.length;return i.map((t=>Math.ceil(t.length/r))).reduce(((t,r)=>t+r))}},8409:t=>{"use strict";t.exports=t=>{const r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const i=new RegExp(r,"g");return typeof t==="string"?t.replace(i,""):t}},3165:(t,r,i)=>{"use strict";const o=i(7836);const a=i(5878);const l=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}});const render=t=>l[t]||l.default;const c=Object.freeze({aborted:o.red(a.cross),done:o.green(a.tick),exited:o.yellow(a.cross),default:o.cyan("?")});const symbol=(t,r,i)=>r?c.aborted:i?c.exited:t?c.done:c.default;const delimiter=t=>o.gray(t?a.ellipsis:a.pointerSmall);const item=(t,r)=>o.gray(t?r?a.pointerSmall:"+":a.line);t.exports={styles:l,render:render,symbols:c,symbol:symbol,delimiter:delimiter,item:item}},1669:t=>{"use strict";t.exports=(t,r={})=>{const i=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"";const o=r.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,r)=>{if(r.length+i.length>=o||t[t.length-1].length+r.length+1<o)t[t.length-1]+=` ${r}`;else t.push(`${i}${r}`);return t}),[i]).join("\n"))).join("\n")}},592:t=>{
112
112
  /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
113
- let r;t.exports=typeof queueMicrotask==="function"?queueMicrotask.bind(typeof window!=="undefined"?window:global):t=>(r||(r=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},6664:t=>{"use strict";class QuickLRU{constructor(t={}){if(!(t.maxSize&&t.maxSize>0)){throw new TypeError("`maxSize` must be a number greater than 0")}this.maxSize=t.maxSize;this.onEviction=t.onEviction;this.cache=new Map;this.oldCache=new Map;this._size=0}_set(t,r){this.cache.set(t,r);this._size++;if(this._size>=this.maxSize){this._size=0;if(typeof this.onEviction==="function"){for(const[t,r]of this.oldCache.entries()){this.onEviction(t,r)}}this.oldCache=this.cache;this.cache=new Map}}get(t){if(this.cache.has(t)){return this.cache.get(t)}if(this.oldCache.has(t)){const r=this.oldCache.get(t);this.oldCache.delete(t);this._set(t,r);return r}}set(t,r){if(this.cache.has(t)){this.cache.set(t,r)}else{this._set(t,r)}return this}has(t){return this.cache.has(t)||this.oldCache.has(t)}peek(t){if(this.cache.has(t)){return this.cache.get(t)}if(this.oldCache.has(t)){return this.oldCache.get(t)}}delete(t){const r=this.cache.delete(t);if(r){this._size--}return this.oldCache.delete(t)||r}clear(){this.cache.clear();this.oldCache.clear();this._size=0}*keys(){for(const[t]of this){yield t}}*values(){for(const[,t]of this){yield t}}*[Symbol.iterator](){for(const t of this.cache){yield t}for(const t of this.oldCache){const[r]=t;if(!this.cache.has(r)){yield t}}}get size(){let t=0;for(const r of this.oldCache.keys()){if(!this.cache.has(r)){t++}}return Math.min(this._size+t,this.maxSize)}}t.exports=QuickLRU},4446:(t,r,i)=>{var o=i(3574);var a=i(1017).join;var l=i(7360);var c="/etc";var u=process.platform==="win32";var h=u?process.env.USERPROFILE:process.env.HOME;t.exports=function(t,r,d,p){if("string"!==typeof t)throw new Error("rc(name): name *must* be string");if(!d)d=i(1254)(process.argv.slice(2));r=("string"===typeof r?o.json(r):r)||{};p=p||o.parse;var m=o.env(t+"_");var y=[r];var g=[];function addConfigFile(t){if(g.indexOf(t)>=0)return;var r=o.file(t);if(r){y.push(p(r));g.push(t)}}if(!u)[a(c,t,"config"),a(c,t+"rc")].forEach(addConfigFile);if(h)[a(h,".config",t,"config"),a(h,".config",t),a(h,"."+t,"config"),a(h,"."+t+"rc")].forEach(addConfigFile);addConfigFile(o.find("."+t+"rc"));if(m.config)addConfigFile(m.config);if(d.config)addConfigFile(d.config);return l.apply(null,y.concat([m,d,g.length?{configs:g,config:g[g.length-1]}:undefined]))}},3574:(t,r,i)=>{"use strict";var o=i(7147);var a=i(7036);var l=i(1017);var c=i(2251);var u=r.parse=function(t){if(/^\s*{/.test(t))return JSON.parse(c(t));return a.parse(t)};var h=r.file=function(){var t=[].slice.call(arguments).filter((function(t){return t!=null}));for(var r in t)if("string"!==typeof t[r])return;var i=l.join.apply(null,t);var a;try{return o.readFileSync(i,"utf-8")}catch(t){return}};var d=r.json=function(){var t=h.apply(null,arguments);return t?u(t):null};var p=r.env=function(t,r){r=r||process.env;var i={};var o=t.length;for(var a in r){if(a.toLowerCase().indexOf(t.toLowerCase())===0){var l=a.substring(o).split("__");var c;while((c=l.indexOf(""))>-1){l.splice(c,1)}var u=i;l.forEach((function _buildSubObj(t,i){if(!t||typeof u!=="object")return;if(i===l.length-1)u[t]=r[a];if(u[t]===undefined)u[t]={};u=u[t]}))}}return i};var m=r.find=function(){var t=l.join.apply(null,[].slice.call(arguments));function find(t,r){var i=l.join(t,r);try{o.statSync(i);return i}catch(i){if(l.dirname(t)!==t)return find(l.dirname(t),r)}}return find(process.cwd(),t)}},4928:(t,r,i)=>{"use strict";var o=i(9182);var a=Object.keys||function(t){var r=[];for(var i in t){r.push(i)}return r};t.exports=Duplex;var l=Object.create(i(642));l.inherits=i(2842);var c=i(7355);var u=i(3517);l.inherits(Duplex,c);{var h=a(u.prototype);for(var d=0;d<h.length;d++){var p=h[d];if(!Duplex.prototype[p])Duplex.prototype[p]=u.prototype[p]}}function Duplex(t){if(!(this instanceof Duplex))return new Duplex(t);c.call(this,t);u.call(this,t);if(t&&t.readable===false)this.readable=false;if(t&&t.writable===false)this.writable=false;this.allowHalfOpen=true;if(t&&t.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",onend)}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function onend(){if(this.allowHalfOpen||this._writableState.ended)return;o.nextTick(onEndNT,this)}function onEndNT(t){t.end()}Object.defineProperty(Duplex.prototype,"destroyed",{get:function(){if(this._readableState===undefined||this._writableState===undefined){return false}return this._readableState.destroyed&&this._writableState.destroyed},set:function(t){if(this._readableState===undefined||this._writableState===undefined){return}this._readableState.destroyed=t;this._writableState.destroyed=t}});Duplex.prototype._destroy=function(t,r){this.push(null);this.end();o.nextTick(r,t)}},9924:(t,r,i)=>{"use strict";t.exports=PassThrough;var o=i(2162);var a=Object.create(i(642));a.inherits=i(2842);a.inherits(PassThrough,o);function PassThrough(t){if(!(this instanceof PassThrough))return new PassThrough(t);o.call(this,t)}PassThrough.prototype._transform=function(t,r,i){i(null,t)}},7355:(t,r,i)=>{"use strict";var o=i(9182);t.exports=Readable;var a=i(1551);var l;Readable.ReadableState=ReadableState;var c=i(2361).EventEmitter;var EElistenerCount=function(t,r){return t.listeners(r).length};var u=i(2641);var h=i(291).Buffer;var d=global.Uint8Array||function(){};function _uint8ArrayToBuffer(t){return h.from(t)}function _isUint8Array(t){return h.isBuffer(t)||t instanceof d}var p=Object.create(i(642));p.inherits=i(2842);var m=i(3837);var y=void 0;if(m&&m.debuglog){y=m.debuglog("stream")}else{y=function(){}}var g=i(4865);var b=i(2604);var v;p.inherits(Readable,u);var _=["error","close","destroy","pause","resume"];function prependListener(t,r,i){if(typeof t.prependListener==="function")return t.prependListener(r,i);if(!t._events||!t._events[r])t.on(r,i);else if(a(t._events[r]))t._events[r].unshift(i);else t._events[r]=[i,t._events[r]]}function ReadableState(t,r){l=l||i(4928);t=t||{};var o=r instanceof l;this.objectMode=!!t.objectMode;if(o)this.objectMode=this.objectMode||!!t.readableObjectMode;var a=t.highWaterMark;var c=t.readableHighWaterMark;var u=this.objectMode?16:16*1024;if(a||a===0)this.highWaterMark=a;else if(o&&(c||c===0))this.highWaterMark=c;else this.highWaterMark=u;this.highWaterMark=Math.floor(this.highWaterMark);this.buffer=new g;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.destroyed=false;this.defaultEncoding=t.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(t.encoding){if(!v)v=i(4426).s;this.decoder=new v(t.encoding);this.encoding=t.encoding}}function Readable(t){l=l||i(4928);if(!(this instanceof Readable))return new Readable(t);this._readableState=new ReadableState(t,this);this.readable=true;if(t){if(typeof t.read==="function")this._read=t.read;if(typeof t.destroy==="function")this._destroy=t.destroy}u.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function(t){if(!this._readableState){return}this._readableState.destroyed=t}});Readable.prototype.destroy=b.destroy;Readable.prototype._undestroy=b.undestroy;Readable.prototype._destroy=function(t,r){this.push(null);r(t)};Readable.prototype.push=function(t,r){var i=this._readableState;var o;if(!i.objectMode){if(typeof t==="string"){r=r||i.defaultEncoding;if(r!==i.encoding){t=h.from(t,r);r=""}o=true}}else{o=true}return readableAddChunk(this,t,r,false,o)};Readable.prototype.unshift=function(t){return readableAddChunk(this,t,null,true,false)};function readableAddChunk(t,r,i,o,a){var l=t._readableState;if(r===null){l.reading=false;onEofChunk(t,l)}else{var c;if(!a)c=chunkInvalid(l,r);if(c){t.emit("error",c)}else if(l.objectMode||r&&r.length>0){if(typeof r!=="string"&&!l.objectMode&&Object.getPrototypeOf(r)!==h.prototype){r=_uint8ArrayToBuffer(r)}if(o){if(l.endEmitted)t.emit("error",new Error("stream.unshift() after end event"));else addChunk(t,l,r,true)}else if(l.ended){t.emit("error",new Error("stream.push() after EOF"))}else{l.reading=false;if(l.decoder&&!i){r=l.decoder.write(r);if(l.objectMode||r.length!==0)addChunk(t,l,r,false);else maybeReadMore(t,l)}else{addChunk(t,l,r,false)}}}else if(!o){l.reading=false}}return needMoreData(l)}function addChunk(t,r,i,o){if(r.flowing&&r.length===0&&!r.sync){t.emit("data",i);t.read(0)}else{r.length+=r.objectMode?1:i.length;if(o)r.buffer.unshift(i);else r.buffer.push(i);if(r.needReadable)emitReadable(t)}maybeReadMore(t,r)}function chunkInvalid(t,r){var i;if(!_isUint8Array(r)&&typeof r!=="string"&&r!==undefined&&!t.objectMode){i=new TypeError("Invalid non-string/buffer chunk")}return i}function needMoreData(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||t.length===0)}Readable.prototype.isPaused=function(){return this._readableState.flowing===false};Readable.prototype.setEncoding=function(t){if(!v)v=i(4426).s;this._readableState.decoder=new v(t);this._readableState.encoding=t;return this};var w=8388608;function computeNewHighWaterMark(t){if(t>=w){t=w}else{t--;t|=t>>>1;t|=t>>>2;t|=t>>>4;t|=t>>>8;t|=t>>>16;t++}return t}function howMuchToRead(t,r){if(t<=0||r.length===0&&r.ended)return 0;if(r.objectMode)return 1;if(t!==t){if(r.flowing&&r.length)return r.buffer.head.data.length;else return r.length}if(t>r.highWaterMark)r.highWaterMark=computeNewHighWaterMark(t);if(t<=r.length)return t;if(!r.ended){r.needReadable=true;return 0}return r.length}Readable.prototype.read=function(t){y("read",t);t=parseInt(t,10);var r=this._readableState;var i=t;if(t!==0)r.emittedReadable=false;if(t===0&&r.needReadable&&(r.length>=r.highWaterMark||r.ended)){y("read: emitReadable",r.length,r.ended);if(r.length===0&&r.ended)endReadable(this);else emitReadable(this);return null}t=howMuchToRead(t,r);if(t===0&&r.ended){if(r.length===0)endReadable(this);return null}var o=r.needReadable;y("need readable",o);if(r.length===0||r.length-t<r.highWaterMark){o=true;y("length less than watermark",o)}if(r.ended||r.reading){o=false;y("reading or ended",o)}else if(o){y("do read");r.reading=true;r.sync=true;if(r.length===0)r.needReadable=true;this._read(r.highWaterMark);r.sync=false;if(!r.reading)t=howMuchToRead(i,r)}var a;if(t>0)a=fromList(t,r);else a=null;if(a===null){r.needReadable=true;t=0}else{r.length-=t}if(r.length===0){if(!r.ended)r.needReadable=true;if(i!==t&&r.ended)endReadable(this)}if(a!==null)this.emit("data",a);return a};function onEofChunk(t,r){if(r.ended)return;if(r.decoder){var i=r.decoder.end();if(i&&i.length){r.buffer.push(i);r.length+=r.objectMode?1:i.length}}r.ended=true;emitReadable(t)}function emitReadable(t){var r=t._readableState;r.needReadable=false;if(!r.emittedReadable){y("emitReadable",r.flowing);r.emittedReadable=true;if(r.sync)o.nextTick(emitReadable_,t);else emitReadable_(t)}}function emitReadable_(t){y("emit readable");t.emit("readable");flow(t)}function maybeReadMore(t,r){if(!r.readingMore){r.readingMore=true;o.nextTick(maybeReadMore_,t,r)}}function maybeReadMore_(t,r){var i=r.length;while(!r.reading&&!r.flowing&&!r.ended&&r.length<r.highWaterMark){y("maybeReadMore read 0");t.read(0);if(i===r.length)break;else i=r.length}r.readingMore=false}Readable.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))};Readable.prototype.pipe=function(t,r){var i=this;var a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t);break}a.pipesCount+=1;y("pipe count=%d opts=%j",a.pipesCount,r);var l=(!r||r.end!==false)&&t!==process.stdout&&t!==process.stderr;var c=l?onend:unpipe;if(a.endEmitted)o.nextTick(c);else i.once("end",c);t.on("unpipe",onunpipe);function onunpipe(t,r){y("onunpipe");if(t===i){if(r&&r.hasUnpiped===false){r.hasUnpiped=true;cleanup()}}}function onend(){y("onend");t.end()}var u=pipeOnDrain(i);t.on("drain",u);var h=false;function cleanup(){y("cleanup");t.removeListener("close",onclose);t.removeListener("finish",onfinish);t.removeListener("drain",u);t.removeListener("error",onerror);t.removeListener("unpipe",onunpipe);i.removeListener("end",onend);i.removeListener("end",unpipe);i.removeListener("data",ondata);h=true;if(a.awaitDrain&&(!t._writableState||t._writableState.needDrain))u()}var d=false;i.on("data",ondata);function ondata(r){y("ondata");d=false;var o=t.write(r);if(false===o&&!d){if((a.pipesCount===1&&a.pipes===t||a.pipesCount>1&&indexOf(a.pipes,t)!==-1)&&!h){y("false write response, pause",i._readableState.awaitDrain);i._readableState.awaitDrain++;d=true}i.pause()}}function onerror(r){y("onerror",r);unpipe();t.removeListener("error",onerror);if(EElistenerCount(t,"error")===0)t.emit("error",r)}prependListener(t,"error",onerror);function onclose(){t.removeListener("finish",onfinish);unpipe()}t.once("close",onclose);function onfinish(){y("onfinish");t.removeListener("close",onclose);unpipe()}t.once("finish",onfinish);function unpipe(){y("unpipe");i.unpipe(t)}t.emit("pipe",i);if(!a.flowing){y("pipe resume");i.resume()}return t};function pipeOnDrain(t){return function(){var r=t._readableState;y("pipeOnDrain",r.awaitDrain);if(r.awaitDrain)r.awaitDrain--;if(r.awaitDrain===0&&EElistenerCount(t,"data")){r.flowing=true;flow(t)}}}Readable.prototype.unpipe=function(t){var r=this._readableState;var i={hasUnpiped:false};if(r.pipesCount===0)return this;if(r.pipesCount===1){if(t&&t!==r.pipes)return this;if(!t)t=r.pipes;r.pipes=null;r.pipesCount=0;r.flowing=false;if(t)t.emit("unpipe",this,i);return this}if(!t){var o=r.pipes;var a=r.pipesCount;r.pipes=null;r.pipesCount=0;r.flowing=false;for(var l=0;l<a;l++){o[l].emit("unpipe",this,i)}return this}var c=indexOf(r.pipes,t);if(c===-1)return this;r.pipes.splice(c,1);r.pipesCount-=1;if(r.pipesCount===1)r.pipes=r.pipes[0];t.emit("unpipe",this,i);return this};Readable.prototype.on=function(t,r){var i=u.prototype.on.call(this,t,r);if(t==="data"){if(this._readableState.flowing!==false)this.resume()}else if(t==="readable"){var a=this._readableState;if(!a.endEmitted&&!a.readableListening){a.readableListening=a.needReadable=true;a.emittedReadable=false;if(!a.reading){o.nextTick(nReadingNextTick,this)}else if(a.length){emitReadable(this)}}}return i};Readable.prototype.addListener=Readable.prototype.on;function nReadingNextTick(t){y("readable nexttick read 0");t.read(0)}Readable.prototype.resume=function(){var t=this._readableState;if(!t.flowing){y("resume");t.flowing=true;resume(this,t)}return this};function resume(t,r){if(!r.resumeScheduled){r.resumeScheduled=true;o.nextTick(resume_,t,r)}}function resume_(t,r){if(!r.reading){y("resume read 0");t.read(0)}r.resumeScheduled=false;r.awaitDrain=0;t.emit("resume");flow(t);if(r.flowing&&!r.reading)t.read(0)}Readable.prototype.pause=function(){y("call pause flowing=%j",this._readableState.flowing);if(false!==this._readableState.flowing){y("pause");this._readableState.flowing=false;this.emit("pause")}return this};function flow(t){var r=t._readableState;y("flow",r.flowing);while(r.flowing&&t.read()!==null){}}Readable.prototype.wrap=function(t){var r=this;var i=this._readableState;var o=false;t.on("end",(function(){y("wrapped end");if(i.decoder&&!i.ended){var t=i.decoder.end();if(t&&t.length)r.push(t)}r.push(null)}));t.on("data",(function(a){y("wrapped data");if(i.decoder)a=i.decoder.write(a);if(i.objectMode&&(a===null||a===undefined))return;else if(!i.objectMode&&(!a||!a.length))return;var l=r.push(a);if(!l){o=true;t.pause()}}));for(var a in t){if(this[a]===undefined&&typeof t[a]==="function"){this[a]=function(r){return function(){return t[r].apply(t,arguments)}}(a)}}for(var l=0;l<_.length;l++){t.on(_[l],this.emit.bind(this,_[l]))}this._read=function(r){y("wrapped _read",r);if(o){o=false;t.resume()}};return this};Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:false,get:function(){return this._readableState.highWaterMark}});Readable._fromList=fromList;function fromList(t,r){if(r.length===0)return null;var i;if(r.objectMode)i=r.buffer.shift();else if(!t||t>=r.length){if(r.decoder)i=r.buffer.join("");else if(r.buffer.length===1)i=r.buffer.head.data;else i=r.buffer.concat(r.length);r.buffer.clear()}else{i=fromListPartial(t,r.buffer,r.decoder)}return i}function fromListPartial(t,r,i){var o;if(t<r.head.data.length){o=r.head.data.slice(0,t);r.head.data=r.head.data.slice(t)}else if(t===r.head.data.length){o=r.shift()}else{o=i?copyFromBufferString(t,r):copyFromBuffer(t,r)}return o}function copyFromBufferString(t,r){var i=r.head;var o=1;var a=i.data;t-=a.length;while(i=i.next){var l=i.data;var c=t>l.length?l.length:t;if(c===l.length)a+=l;else a+=l.slice(0,t);t-=c;if(t===0){if(c===l.length){++o;if(i.next)r.head=i.next;else r.head=r.tail=null}else{r.head=i;i.data=l.slice(c)}break}++o}r.length-=o;return a}function copyFromBuffer(t,r){var i=h.allocUnsafe(t);var o=r.head;var a=1;o.data.copy(i);t-=o.data.length;while(o=o.next){var l=o.data;var c=t>l.length?l.length:t;l.copy(i,i.length-t,0,c);t-=c;if(t===0){if(c===l.length){++a;if(o.next)r.head=o.next;else r.head=r.tail=null}else{r.head=o;o.data=l.slice(c)}break}++a}r.length-=a;return i}function endReadable(t){var r=t._readableState;if(r.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!r.endEmitted){r.ended=true;o.nextTick(endReadableNT,r,t)}}function endReadableNT(t,r){if(!t.endEmitted&&t.length===0){t.endEmitted=true;r.readable=false;r.emit("end")}}function indexOf(t,r){for(var i=0,o=t.length;i<o;i++){if(t[i]===r)return i}return-1}},2162:(t,r,i)=>{"use strict";t.exports=Transform;var o=i(4928);var a=Object.create(i(642));a.inherits=i(2842);a.inherits(Transform,o);function afterTransform(t,r){var i=this._transformState;i.transforming=false;var o=i.writecb;if(!o){return this.emit("error",new Error("write callback called multiple times"))}i.writechunk=null;i.writecb=null;if(r!=null)this.push(r);o(t);var a=this._readableState;a.reading=false;if(a.needReadable||a.length<a.highWaterMark){this._read(a.highWaterMark)}}function Transform(t){if(!(this instanceof Transform))return new Transform(t);o.call(this,t);this._transformState={afterTransform:afterTransform.bind(this),needTransform:false,transforming:false,writecb:null,writechunk:null,writeencoding:null};this._readableState.needReadable=true;this._readableState.sync=false;if(t){if(typeof t.transform==="function")this._transform=t.transform;if(typeof t.flush==="function")this._flush=t.flush}this.on("prefinish",prefinish)}function prefinish(){var t=this;if(typeof this._flush==="function"){this._flush((function(r,i){done(t,r,i)}))}else{done(this,null,null)}}Transform.prototype.push=function(t,r){this._transformState.needTransform=false;return o.prototype.push.call(this,t,r)};Transform.prototype._transform=function(t,r,i){throw new Error("_transform() is not implemented")};Transform.prototype._write=function(t,r,i){var o=this._transformState;o.writecb=i;o.writechunk=t;o.writeencoding=r;if(!o.transforming){var a=this._readableState;if(o.needTransform||a.needReadable||a.length<a.highWaterMark)this._read(a.highWaterMark)}};Transform.prototype._read=function(t){var r=this._transformState;if(r.writechunk!==null&&r.writecb&&!r.transforming){r.transforming=true;this._transform(r.writechunk,r.writeencoding,r.afterTransform)}else{r.needTransform=true}};Transform.prototype._destroy=function(t,r){var i=this;o.prototype._destroy.call(this,t,(function(t){r(t);i.emit("close")}))};function done(t,r,i){if(r)return t.emit("error",r);if(i!=null)t.push(i);if(t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}},3517:(t,r,i)=>{"use strict";var o=i(9182);t.exports=Writable;function WriteReq(t,r,i){this.chunk=t;this.encoding=r;this.callback=i;this.next=null}function CorkedRequest(t){var r=this;this.next=null;this.entry=null;this.finish=function(){onCorkedFinish(r,t)}}var a=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:o.nextTick;var l;Writable.WritableState=WritableState;var c=Object.create(i(642));c.inherits=i(2842);var u={deprecate:i(6124)};var h=i(2641);var d=i(291).Buffer;var p=global.Uint8Array||function(){};function _uint8ArrayToBuffer(t){return d.from(t)}function _isUint8Array(t){return d.isBuffer(t)||t instanceof p}var m=i(2604);c.inherits(Writable,h);function nop(){}function WritableState(t,r){l=l||i(4928);t=t||{};var o=r instanceof l;this.objectMode=!!t.objectMode;if(o)this.objectMode=this.objectMode||!!t.writableObjectMode;var a=t.highWaterMark;var c=t.writableHighWaterMark;var u=this.objectMode?16:16*1024;if(a||a===0)this.highWaterMark=a;else if(o&&(c||c===0))this.highWaterMark=c;else this.highWaterMark=u;this.highWaterMark=Math.floor(this.highWaterMark);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var h=t.decodeStrings===false;this.decodeStrings=!h;this.defaultEncoding=t.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(t){onwrite(r,t)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function getBuffer(){var t=this.bufferedRequest;var r=[];while(t){r.push(t);t=t.next}return r};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:u.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(t){}})();var y;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){y=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function(t){if(y.call(this,t))return true;if(this!==Writable)return false;return t&&t._writableState instanceof WritableState}})}else{y=function(t){return t instanceof this}}function Writable(t){l=l||i(4928);if(!y.call(Writable,this)&&!(this instanceof l)){return new Writable(t)}this._writableState=new WritableState(t,this);this.writable=true;if(t){if(typeof t.write==="function")this._write=t.write;if(typeof t.writev==="function")this._writev=t.writev;if(typeof t.destroy==="function")this._destroy=t.destroy;if(typeof t.final==="function")this._final=t.final}h.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(t,r){var i=new Error("write after end");t.emit("error",i);o.nextTick(r,i)}function validChunk(t,r,i,a){var l=true;var c=false;if(i===null){c=new TypeError("May not write null values to stream")}else if(typeof i!=="string"&&i!==undefined&&!r.objectMode){c=new TypeError("Invalid non-string/buffer chunk")}if(c){t.emit("error",c);o.nextTick(a,c);l=false}return l}Writable.prototype.write=function(t,r,i){var o=this._writableState;var a=false;var l=!o.objectMode&&_isUint8Array(t);if(l&&!d.isBuffer(t)){t=_uint8ArrayToBuffer(t)}if(typeof r==="function"){i=r;r=null}if(l)r="buffer";else if(!r)r=o.defaultEncoding;if(typeof i!=="function")i=nop;if(o.ended)writeAfterEnd(this,i);else if(l||validChunk(this,o,t,i)){o.pendingcb++;a=writeOrBuffer(this,o,l,t,r,i)}return a};Writable.prototype.cork=function(){var t=this._writableState;t.corked++};Writable.prototype.uncork=function(){var t=this._writableState;if(t.corked){t.corked--;if(!t.writing&&!t.corked&&!t.finished&&!t.bufferProcessing&&t.bufferedRequest)clearBuffer(this,t)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(t){if(typeof t==="string")t=t.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);this._writableState.defaultEncoding=t;return this};function decodeChunk(t,r,i){if(!t.objectMode&&t.decodeStrings!==false&&typeof r==="string"){r=d.from(r,i)}return r}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(t,r,i,o,a,l){if(!i){var c=decodeChunk(r,o,a);if(o!==c){i=true;a="buffer";o=c}}var u=r.objectMode?1:o.length;r.length+=u;var h=r.length<r.highWaterMark;if(!h)r.needDrain=true;if(r.writing||r.corked){var d=r.lastBufferedRequest;r.lastBufferedRequest={chunk:o,encoding:a,isBuf:i,callback:l,next:null};if(d){d.next=r.lastBufferedRequest}else{r.bufferedRequest=r.lastBufferedRequest}r.bufferedRequestCount+=1}else{doWrite(t,r,false,u,o,a,l)}return h}function doWrite(t,r,i,o,a,l,c){r.writelen=o;r.writecb=c;r.writing=true;r.sync=true;if(i)t._writev(a,r.onwrite);else t._write(a,l,r.onwrite);r.sync=false}function onwriteError(t,r,i,a,l){--r.pendingcb;if(i){o.nextTick(l,a);o.nextTick(finishMaybe,t,r);t._writableState.errorEmitted=true;t.emit("error",a)}else{l(a);t._writableState.errorEmitted=true;t.emit("error",a);finishMaybe(t,r)}}function onwriteStateUpdate(t){t.writing=false;t.writecb=null;t.length-=t.writelen;t.writelen=0}function onwrite(t,r){var i=t._writableState;var o=i.sync;var l=i.writecb;onwriteStateUpdate(i);if(r)onwriteError(t,i,o,r,l);else{var c=needFinish(i);if(!c&&!i.corked&&!i.bufferProcessing&&i.bufferedRequest){clearBuffer(t,i)}if(o){a(afterWrite,t,i,c,l)}else{afterWrite(t,i,c,l)}}}function afterWrite(t,r,i,o){if(!i)onwriteDrain(t,r);r.pendingcb--;o();finishMaybe(t,r)}function onwriteDrain(t,r){if(r.length===0&&r.needDrain){r.needDrain=false;t.emit("drain")}}function clearBuffer(t,r){r.bufferProcessing=true;var i=r.bufferedRequest;if(t._writev&&i&&i.next){var o=r.bufferedRequestCount;var a=new Array(o);var l=r.corkedRequestsFree;l.entry=i;var c=0;var u=true;while(i){a[c]=i;if(!i.isBuf)u=false;i=i.next;c+=1}a.allBuffers=u;doWrite(t,r,true,r.length,a,"",l.finish);r.pendingcb++;r.lastBufferedRequest=null;if(l.next){r.corkedRequestsFree=l.next;l.next=null}else{r.corkedRequestsFree=new CorkedRequest(r)}r.bufferedRequestCount=0}else{while(i){var h=i.chunk;var d=i.encoding;var p=i.callback;var m=r.objectMode?1:h.length;doWrite(t,r,false,m,h,d,p);i=i.next;r.bufferedRequestCount--;if(r.writing){break}}if(i===null)r.lastBufferedRequest=null}r.bufferedRequest=i;r.bufferProcessing=false}Writable.prototype._write=function(t,r,i){i(new Error("_write() is not implemented"))};Writable.prototype._writev=null;Writable.prototype.end=function(t,r,i){var o=this._writableState;if(typeof t==="function"){i=t;t=null;r=null}else if(typeof r==="function"){i=r;r=null}if(t!==null&&t!==undefined)this.write(t,r);if(o.corked){o.corked=1;this.uncork()}if(!o.ending&&!o.finished)endWritable(this,o,i)};function needFinish(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function callFinal(t,r){t._final((function(i){r.pendingcb--;if(i){t.emit("error",i)}r.prefinished=true;t.emit("prefinish");finishMaybe(t,r)}))}function prefinish(t,r){if(!r.prefinished&&!r.finalCalled){if(typeof t._final==="function"){r.pendingcb++;r.finalCalled=true;o.nextTick(callFinal,t,r)}else{r.prefinished=true;t.emit("prefinish")}}}function finishMaybe(t,r){var i=needFinish(r);if(i){prefinish(t,r);if(r.pendingcb===0){r.finished=true;t.emit("finish")}}return i}function endWritable(t,r,i){r.ending=true;finishMaybe(t,r);if(i){if(r.finished)o.nextTick(i);else t.once("finish",i)}r.ended=true;t.writable=false}function onCorkedFinish(t,r,i){var o=t.entry;t.entry=null;while(o){var a=o.callback;r.pendingcb--;a(i);o=o.next}if(r.corkedRequestsFree){r.corkedRequestsFree.next=t}else{r.corkedRequestsFree=t}}Object.defineProperty(Writable.prototype,"destroyed",{get:function(){if(this._writableState===undefined){return false}return this._writableState.destroyed},set:function(t){if(!this._writableState){return}this._writableState.destroyed=t}});Writable.prototype.destroy=m.destroy;Writable.prototype._undestroy=m.undestroy;Writable.prototype._destroy=function(t,r){this.end();r(t)}},4865:(t,r,i)=>{"use strict";function _classCallCheck(t,r){if(!(t instanceof r)){throw new TypeError("Cannot call a class as a function")}}var o=i(291).Buffer;var a=i(3837);function copyBuffer(t,r,i){t.copy(r,i)}t.exports=function(){function BufferList(){_classCallCheck(this,BufferList);this.head=null;this.tail=null;this.length=0}BufferList.prototype.push=function push(t){var r={data:t,next:null};if(this.length>0)this.tail.next=r;else this.head=r;this.tail=r;++this.length};BufferList.prototype.unshift=function unshift(t){var r={data:t,next:this.head};if(this.length===0)this.tail=r;this.head=r;++this.length};BufferList.prototype.shift=function shift(){if(this.length===0)return;var t=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return t};BufferList.prototype.clear=function clear(){this.head=this.tail=null;this.length=0};BufferList.prototype.join=function join(t){if(this.length===0)return"";var r=this.head;var i=""+r.data;while(r=r.next){i+=t+r.data}return i};BufferList.prototype.concat=function concat(t){if(this.length===0)return o.alloc(0);if(this.length===1)return this.head.data;var r=o.allocUnsafe(t>>>0);var i=this.head;var a=0;while(i){copyBuffer(i.data,r,a);a+=i.data.length;i=i.next}return r};return BufferList}();if(a&&a.inspect&&a.inspect.custom){t.exports.prototype[a.inspect.custom]=function(){var t=a.inspect({length:this.length});return this.constructor.name+" "+t}}},2604:(t,r,i)=>{"use strict";var o=i(9182);function destroy(t,r){var i=this;var a=this._readableState&&this._readableState.destroyed;var l=this._writableState&&this._writableState.destroyed;if(a||l){if(r){r(t)}else if(t&&(!this._writableState||!this._writableState.errorEmitted)){o.nextTick(emitErrorNT,this,t)}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(t||null,(function(t){if(!r&&t){o.nextTick(emitErrorNT,i,t);if(i._writableState){i._writableState.errorEmitted=true}}else if(r){r(t)}}));return this}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(t,r){t.emit("error",r)}t.exports={destroy:destroy,undestroy:undestroy}},2641:(t,r,i)=>{t.exports=i(2781)},4088:(t,r,i)=>{t.exports=i(8511).PassThrough},8511:(t,r,i)=>{var o=i(2781);if(process.env.READABLE_STREAM==="disable"&&o){t.exports=o;r=t.exports=o.Readable;r.Readable=o.Readable;r.Writable=o.Writable;r.Duplex=o.Duplex;r.Transform=o.Transform;r.PassThrough=o.PassThrough;r.Stream=o}else{r=t.exports=i(7355);r.Stream=o||r;r.Readable=r;r.Writable=i(3517);r.Duplex=i(4928);r.Transform=i(2162);r.PassThrough=i(9924)}},4646:t=>{"use strict";const r={};function createErrorType(t,i,o){if(!o){o=Error}function getMessage(t,r,o){if(typeof i==="string"){return i}else{return i(t,r,o)}}class NodeError extends o{constructor(t,r,i){super(getMessage(t,r,i))}}NodeError.prototype.name=o.name;NodeError.prototype.code=t;r[t]=NodeError}function oneOf(t,r){if(Array.isArray(t)){const i=t.length;t=t.map((t=>String(t)));if(i>2){return`one of ${r} ${t.slice(0,i-1).join(", ")}, or `+t[i-1]}else if(i===2){return`one of ${r} ${t[0]} or ${t[1]}`}else{return`of ${r} ${t[0]}`}}else{return`of ${r} ${String(t)}`}}function startsWith(t,r,i){return t.substr(!i||i<0?0:+i,r.length)===r}function endsWith(t,r,i){if(i===undefined||i>t.length){i=t.length}return t.substring(i-r.length,i)===r}function includes(t,r,i){if(typeof i!=="number"){i=0}if(i+r.length>t.length){return false}else{return t.indexOf(r,i)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(t,r){return'The value "'+r+'" is invalid for option "'+t+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(t,r,i){let o;if(typeof r==="string"&&startsWith(r,"not ")){o="must not be";r=r.replace(/^not /,"")}else{o="must be"}let a;if(endsWith(t," argument")){a=`The ${t} ${o} ${oneOf(r,"type")}`}else{const i=includes(t,".")?"property":"argument";a=`The "${t}" ${i} ${o} ${oneOf(r,"type")}`}a+=`. Received type ${typeof i}`;return a}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");t.exports.q=r},2403:(t,r,i)=>{"use strict";var o=Object.keys||function(t){var r=[];for(var i in t){r.push(i)}return r};t.exports=Duplex;var a=i(1709);var l=i(7337);i(2842)(Duplex,a);{var c=o(l.prototype);for(var u=0;u<c.length;u++){var h=c[u];if(!Duplex.prototype[h])Duplex.prototype[h]=l.prototype[h]}}function Duplex(t){if(!(this instanceof Duplex))return new Duplex(t);a.call(this,t);l.call(this,t);this.allowHalfOpen=true;if(t){if(t.readable===false)this.readable=false;if(t.writable===false)this.writable=false;if(t.allowHalfOpen===false){this.allowHalfOpen=false;this.once("end",onend)}}}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});Object.defineProperty(Duplex.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Duplex.prototype,"writableLength",{enumerable:false,get:function get(){return this._writableState.length}});function onend(){if(this._writableState.ended)return;process.nextTick(onEndNT,this)}function onEndNT(t){t.end()}Object.defineProperty(Duplex.prototype,"destroyed",{enumerable:false,get:function get(){if(this._readableState===undefined||this._writableState===undefined){return false}return this._readableState.destroyed&&this._writableState.destroyed},set:function set(t){if(this._readableState===undefined||this._writableState===undefined){return}this._readableState.destroyed=t;this._writableState.destroyed=t}})},7889:(t,r,i)=>{"use strict";t.exports=PassThrough;var o=i(1170);i(2842)(PassThrough,o);function PassThrough(t){if(!(this instanceof PassThrough))return new PassThrough(t);o.call(this,t)}PassThrough.prototype._transform=function(t,r,i){i(null,t)}},1709:(t,r,i)=>{"use strict";t.exports=Readable;var o;Readable.ReadableState=ReadableState;var a=i(2361).EventEmitter;var l=function EElistenerCount(t,r){return t.listeners(r).length};var c=i(4678);var u=i(4300).Buffer;var h=global.Uint8Array||function(){};function _uint8ArrayToBuffer(t){return u.from(t)}function _isUint8Array(t){return u.isBuffer(t)||t instanceof h}var d=i(3837);var p;if(d&&d.debuglog){p=d.debuglog("stream")}else{p=function debug(){}}var m=i(4379);var y=i(7025);var g=i(6776),b=g.getHighWaterMark;var v=i(4646).q,_=v.ERR_INVALID_ARG_TYPE,w=v.ERR_STREAM_PUSH_AFTER_EOF,E=v.ERR_METHOD_NOT_IMPLEMENTED,S=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;var O;var R;var x;i(2842)(Readable,c);var k=y.errorOrDestroy;var T=["error","close","destroy","pause","resume"];function prependListener(t,r,i){if(typeof t.prependListener==="function")return t.prependListener(r,i);if(!t._events||!t._events[r])t.on(r,i);else if(Array.isArray(t._events[r]))t._events[r].unshift(i);else t._events[r]=[i,t._events[r]]}function ReadableState(t,r,a){o=o||i(2403);t=t||{};if(typeof a!=="boolean")a=r instanceof o;this.objectMode=!!t.objectMode;if(a)this.objectMode=this.objectMode||!!t.readableObjectMode;this.highWaterMark=b(this,t,"readableHighWaterMark",a);this.buffer=new m;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.paused=true;this.emitClose=t.emitClose!==false;this.autoDestroy=!!t.autoDestroy;this.destroyed=false;this.defaultEncoding=t.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(t.encoding){if(!O)O=i(3704).s;this.decoder=new O(t.encoding);this.encoding=t.encoding}}function Readable(t){o=o||i(2403);if(!(this instanceof Readable))return new Readable(t);var r=this instanceof o;this._readableState=new ReadableState(t,this,r);this.readable=true;if(t){if(typeof t.read==="function")this._read=t.read;if(typeof t.destroy==="function")this._destroy=t.destroy}c.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{enumerable:false,get:function get(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function set(t){if(!this._readableState){return}this._readableState.destroyed=t}});Readable.prototype.destroy=y.destroy;Readable.prototype._undestroy=y.undestroy;Readable.prototype._destroy=function(t,r){r(t)};Readable.prototype.push=function(t,r){var i=this._readableState;var o;if(!i.objectMode){if(typeof t==="string"){r=r||i.defaultEncoding;if(r!==i.encoding){t=u.from(t,r);r=""}o=true}}else{o=true}return readableAddChunk(this,t,r,false,o)};Readable.prototype.unshift=function(t){return readableAddChunk(this,t,null,true,false)};function readableAddChunk(t,r,i,o,a){p("readableAddChunk",r);var l=t._readableState;if(r===null){l.reading=false;onEofChunk(t,l)}else{var c;if(!a)c=chunkInvalid(l,r);if(c){k(t,c)}else if(l.objectMode||r&&r.length>0){if(typeof r!=="string"&&!l.objectMode&&Object.getPrototypeOf(r)!==u.prototype){r=_uint8ArrayToBuffer(r)}if(o){if(l.endEmitted)k(t,new S);else addChunk(t,l,r,true)}else if(l.ended){k(t,new w)}else if(l.destroyed){return false}else{l.reading=false;if(l.decoder&&!i){r=l.decoder.write(r);if(l.objectMode||r.length!==0)addChunk(t,l,r,false);else maybeReadMore(t,l)}else{addChunk(t,l,r,false)}}}else if(!o){l.reading=false;maybeReadMore(t,l)}}return!l.ended&&(l.length<l.highWaterMark||l.length===0)}function addChunk(t,r,i,o){if(r.flowing&&r.length===0&&!r.sync){r.awaitDrain=0;t.emit("data",i)}else{r.length+=r.objectMode?1:i.length;if(o)r.buffer.unshift(i);else r.buffer.push(i);if(r.needReadable)emitReadable(t)}maybeReadMore(t,r)}function chunkInvalid(t,r){var i;if(!_isUint8Array(r)&&typeof r!=="string"&&r!==undefined&&!t.objectMode){i=new _("chunk",["string","Buffer","Uint8Array"],r)}return i}Readable.prototype.isPaused=function(){return this._readableState.flowing===false};Readable.prototype.setEncoding=function(t){if(!O)O=i(3704).s;var r=new O(t);this._readableState.decoder=r;this._readableState.encoding=this._readableState.decoder.encoding;var o=this._readableState.buffer.head;var a="";while(o!==null){a+=r.write(o.data);o=o.next}this._readableState.buffer.clear();if(a!=="")this._readableState.buffer.push(a);this._readableState.length=a.length;return this};var A=1073741824;function computeNewHighWaterMark(t){if(t>=A){t=A}else{t--;t|=t>>>1;t|=t>>>2;t|=t>>>4;t|=t>>>8;t|=t>>>16;t++}return t}function howMuchToRead(t,r){if(t<=0||r.length===0&&r.ended)return 0;if(r.objectMode)return 1;if(t!==t){if(r.flowing&&r.length)return r.buffer.head.data.length;else return r.length}if(t>r.highWaterMark)r.highWaterMark=computeNewHighWaterMark(t);if(t<=r.length)return t;if(!r.ended){r.needReadable=true;return 0}return r.length}Readable.prototype.read=function(t){p("read",t);t=parseInt(t,10);var r=this._readableState;var i=t;if(t!==0)r.emittedReadable=false;if(t===0&&r.needReadable&&((r.highWaterMark!==0?r.length>=r.highWaterMark:r.length>0)||r.ended)){p("read: emitReadable",r.length,r.ended);if(r.length===0&&r.ended)endReadable(this);else emitReadable(this);return null}t=howMuchToRead(t,r);if(t===0&&r.ended){if(r.length===0)endReadable(this);return null}var o=r.needReadable;p("need readable",o);if(r.length===0||r.length-t<r.highWaterMark){o=true;p("length less than watermark",o)}if(r.ended||r.reading){o=false;p("reading or ended",o)}else if(o){p("do read");r.reading=true;r.sync=true;if(r.length===0)r.needReadable=true;this._read(r.highWaterMark);r.sync=false;if(!r.reading)t=howMuchToRead(i,r)}var a;if(t>0)a=fromList(t,r);else a=null;if(a===null){r.needReadable=r.length<=r.highWaterMark;t=0}else{r.length-=t;r.awaitDrain=0}if(r.length===0){if(!r.ended)r.needReadable=true;if(i!==t&&r.ended)endReadable(this)}if(a!==null)this.emit("data",a);return a};function onEofChunk(t,r){p("onEofChunk");if(r.ended)return;if(r.decoder){var i=r.decoder.end();if(i&&i.length){r.buffer.push(i);r.length+=r.objectMode?1:i.length}}r.ended=true;if(r.sync){emitReadable(t)}else{r.needReadable=false;if(!r.emittedReadable){r.emittedReadable=true;emitReadable_(t)}}}function emitReadable(t){var r=t._readableState;p("emitReadable",r.needReadable,r.emittedReadable);r.needReadable=false;if(!r.emittedReadable){p("emitReadable",r.flowing);r.emittedReadable=true;process.nextTick(emitReadable_,t)}}function emitReadable_(t){var r=t._readableState;p("emitReadable_",r.destroyed,r.length,r.ended);if(!r.destroyed&&(r.length||r.ended)){t.emit("readable");r.emittedReadable=false}r.needReadable=!r.flowing&&!r.ended&&r.length<=r.highWaterMark;flow(t)}function maybeReadMore(t,r){if(!r.readingMore){r.readingMore=true;process.nextTick(maybeReadMore_,t,r)}}function maybeReadMore_(t,r){while(!r.reading&&!r.ended&&(r.length<r.highWaterMark||r.flowing&&r.length===0)){var i=r.length;p("maybeReadMore read 0");t.read(0);if(i===r.length)break}r.readingMore=false}Readable.prototype._read=function(t){k(this,new E("_read()"))};Readable.prototype.pipe=function(t,r){var i=this;var o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t);break}o.pipesCount+=1;p("pipe count=%d opts=%j",o.pipesCount,r);var a=(!r||r.end!==false)&&t!==process.stdout&&t!==process.stderr;var c=a?onend:unpipe;if(o.endEmitted)process.nextTick(c);else i.once("end",c);t.on("unpipe",onunpipe);function onunpipe(t,r){p("onunpipe");if(t===i){if(r&&r.hasUnpiped===false){r.hasUnpiped=true;cleanup()}}}function onend(){p("onend");t.end()}var u=pipeOnDrain(i);t.on("drain",u);var h=false;function cleanup(){p("cleanup");t.removeListener("close",onclose);t.removeListener("finish",onfinish);t.removeListener("drain",u);t.removeListener("error",onerror);t.removeListener("unpipe",onunpipe);i.removeListener("end",onend);i.removeListener("end",unpipe);i.removeListener("data",ondata);h=true;if(o.awaitDrain&&(!t._writableState||t._writableState.needDrain))u()}i.on("data",ondata);function ondata(r){p("ondata");var a=t.write(r);p("dest.write",a);if(a===false){if((o.pipesCount===1&&o.pipes===t||o.pipesCount>1&&indexOf(o.pipes,t)!==-1)&&!h){p("false write response, pause",o.awaitDrain);o.awaitDrain++}i.pause()}}function onerror(r){p("onerror",r);unpipe();t.removeListener("error",onerror);if(l(t,"error")===0)k(t,r)}prependListener(t,"error",onerror);function onclose(){t.removeListener("finish",onfinish);unpipe()}t.once("close",onclose);function onfinish(){p("onfinish");t.removeListener("close",onclose);unpipe()}t.once("finish",onfinish);function unpipe(){p("unpipe");i.unpipe(t)}t.emit("pipe",i);if(!o.flowing){p("pipe resume");i.resume()}return t};function pipeOnDrain(t){return function pipeOnDrainFunctionResult(){var r=t._readableState;p("pipeOnDrain",r.awaitDrain);if(r.awaitDrain)r.awaitDrain--;if(r.awaitDrain===0&&l(t,"data")){r.flowing=true;flow(t)}}}Readable.prototype.unpipe=function(t){var r=this._readableState;var i={hasUnpiped:false};if(r.pipesCount===0)return this;if(r.pipesCount===1){if(t&&t!==r.pipes)return this;if(!t)t=r.pipes;r.pipes=null;r.pipesCount=0;r.flowing=false;if(t)t.emit("unpipe",this,i);return this}if(!t){var o=r.pipes;var a=r.pipesCount;r.pipes=null;r.pipesCount=0;r.flowing=false;for(var l=0;l<a;l++){o[l].emit("unpipe",this,{hasUnpiped:false})}return this}var c=indexOf(r.pipes,t);if(c===-1)return this;r.pipes.splice(c,1);r.pipesCount-=1;if(r.pipesCount===1)r.pipes=r.pipes[0];t.emit("unpipe",this,i);return this};Readable.prototype.on=function(t,r){var i=c.prototype.on.call(this,t,r);var o=this._readableState;if(t==="data"){o.readableListening=this.listenerCount("readable")>0;if(o.flowing!==false)this.resume()}else if(t==="readable"){if(!o.endEmitted&&!o.readableListening){o.readableListening=o.needReadable=true;o.flowing=false;o.emittedReadable=false;p("on readable",o.length,o.reading);if(o.length){emitReadable(this)}else if(!o.reading){process.nextTick(nReadingNextTick,this)}}}return i};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(t,r){var i=c.prototype.removeListener.call(this,t,r);if(t==="readable"){process.nextTick(updateReadableListening,this)}return i};Readable.prototype.removeAllListeners=function(t){var r=c.prototype.removeAllListeners.apply(this,arguments);if(t==="readable"||t===undefined){process.nextTick(updateReadableListening,this)}return r};function updateReadableListening(t){var r=t._readableState;r.readableListening=t.listenerCount("readable")>0;if(r.resumeScheduled&&!r.paused){r.flowing=true}else if(t.listenerCount("data")>0){t.resume()}}function nReadingNextTick(t){p("readable nexttick read 0");t.read(0)}Readable.prototype.resume=function(){var t=this._readableState;if(!t.flowing){p("resume");t.flowing=!t.readableListening;resume(this,t)}t.paused=false;return this};function resume(t,r){if(!r.resumeScheduled){r.resumeScheduled=true;process.nextTick(resume_,t,r)}}function resume_(t,r){p("resume",r.reading);if(!r.reading){t.read(0)}r.resumeScheduled=false;t.emit("resume");flow(t);if(r.flowing&&!r.reading)t.read(0)}Readable.prototype.pause=function(){p("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){p("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(t){var r=t._readableState;p("flow",r.flowing);while(r.flowing&&t.read()!==null){}}Readable.prototype.wrap=function(t){var r=this;var i=this._readableState;var o=false;t.on("end",(function(){p("wrapped end");if(i.decoder&&!i.ended){var t=i.decoder.end();if(t&&t.length)r.push(t)}r.push(null)}));t.on("data",(function(a){p("wrapped data");if(i.decoder)a=i.decoder.write(a);if(i.objectMode&&(a===null||a===undefined))return;else if(!i.objectMode&&(!a||!a.length))return;var l=r.push(a);if(!l){o=true;t.pause()}}));for(var a in t){if(this[a]===undefined&&typeof t[a]==="function"){this[a]=function methodWrap(r){return function methodWrapReturnFunction(){return t[r].apply(t,arguments)}}(a)}}for(var l=0;l<T.length;l++){t.on(T[l],this.emit.bind(this,T[l]))}this._read=function(r){p("wrapped _read",r);if(o){o=false;t.resume()}};return this};if(typeof Symbol==="function"){Readable.prototype[Symbol.asyncIterator]=function(){if(R===undefined){R=i(6871)}return R(this)}}Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:false,get:function get(){return this._readableState.highWaterMark}});Object.defineProperty(Readable.prototype,"readableBuffer",{enumerable:false,get:function get(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Readable.prototype,"readableFlowing",{enumerable:false,get:function get(){return this._readableState.flowing},set:function set(t){if(this._readableState){this._readableState.flowing=t}}});Readable._fromList=fromList;Object.defineProperty(Readable.prototype,"readableLength",{enumerable:false,get:function get(){return this._readableState.length}});function fromList(t,r){if(r.length===0)return null;var i;if(r.objectMode)i=r.buffer.shift();else if(!t||t>=r.length){if(r.decoder)i=r.buffer.join("");else if(r.buffer.length===1)i=r.buffer.first();else i=r.buffer.concat(r.length);r.buffer.clear()}else{i=r.buffer.consume(t,r.decoder)}return i}function endReadable(t){var r=t._readableState;p("endReadable",r.endEmitted);if(!r.endEmitted){r.ended=true;process.nextTick(endReadableNT,r,t)}}function endReadableNT(t,r){p("endReadableNT",t.endEmitted,t.length);if(!t.endEmitted&&t.length===0){t.endEmitted=true;r.readable=false;r.emit("end");if(t.autoDestroy){var i=r._writableState;if(!i||i.autoDestroy&&i.finished){r.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(t,r){if(x===undefined){x=i(9727)}return x(Readable,t,r)}}function indexOf(t,r){for(var i=0,o=t.length;i<o;i++){if(t[i]===r)return i}return-1}},1170:(t,r,i)=>{"use strict";t.exports=Transform;var o=i(4646).q,a=o.ERR_METHOD_NOT_IMPLEMENTED,l=o.ERR_MULTIPLE_CALLBACK,c=o.ERR_TRANSFORM_ALREADY_TRANSFORMING,u=o.ERR_TRANSFORM_WITH_LENGTH_0;var h=i(2403);i(2842)(Transform,h);function afterTransform(t,r){var i=this._transformState;i.transforming=false;var o=i.writecb;if(o===null){return this.emit("error",new l)}i.writechunk=null;i.writecb=null;if(r!=null)this.push(r);o(t);var a=this._readableState;a.reading=false;if(a.needReadable||a.length<a.highWaterMark){this._read(a.highWaterMark)}}function Transform(t){if(!(this instanceof Transform))return new Transform(t);h.call(this,t);this._transformState={afterTransform:afterTransform.bind(this),needTransform:false,transforming:false,writecb:null,writechunk:null,writeencoding:null};this._readableState.needReadable=true;this._readableState.sync=false;if(t){if(typeof t.transform==="function")this._transform=t.transform;if(typeof t.flush==="function")this._flush=t.flush}this.on("prefinish",prefinish)}function prefinish(){var t=this;if(typeof this._flush==="function"&&!this._readableState.destroyed){this._flush((function(r,i){done(t,r,i)}))}else{done(this,null,null)}}Transform.prototype.push=function(t,r){this._transformState.needTransform=false;return h.prototype.push.call(this,t,r)};Transform.prototype._transform=function(t,r,i){i(new a("_transform()"))};Transform.prototype._write=function(t,r,i){var o=this._transformState;o.writecb=i;o.writechunk=t;o.writeencoding=r;if(!o.transforming){var a=this._readableState;if(o.needTransform||a.needReadable||a.length<a.highWaterMark)this._read(a.highWaterMark)}};Transform.prototype._read=function(t){var r=this._transformState;if(r.writechunk!==null&&!r.transforming){r.transforming=true;this._transform(r.writechunk,r.writeencoding,r.afterTransform)}else{r.needTransform=true}};Transform.prototype._destroy=function(t,r){h.prototype._destroy.call(this,t,(function(t){r(t)}))};function done(t,r,i){if(r)return t.emit("error",r);if(i!=null)t.push(i);if(t._writableState.length)throw new u;if(t._transformState.transforming)throw new c;return t.push(null)}},7337:(t,r,i)=>{"use strict";t.exports=Writable;function WriteReq(t,r,i){this.chunk=t;this.encoding=r;this.callback=i;this.next=null}function CorkedRequest(t){var r=this;this.next=null;this.entry=null;this.finish=function(){onCorkedFinish(r,t)}}var o;Writable.WritableState=WritableState;var a={deprecate:i(6124)};var l=i(4678);var c=i(4300).Buffer;var u=global.Uint8Array||function(){};function _uint8ArrayToBuffer(t){return c.from(t)}function _isUint8Array(t){return c.isBuffer(t)||t instanceof u}var h=i(7025);var d=i(6776),p=d.getHighWaterMark;var m=i(4646).q,y=m.ERR_INVALID_ARG_TYPE,g=m.ERR_METHOD_NOT_IMPLEMENTED,b=m.ERR_MULTIPLE_CALLBACK,v=m.ERR_STREAM_CANNOT_PIPE,_=m.ERR_STREAM_DESTROYED,w=m.ERR_STREAM_NULL_VALUES,E=m.ERR_STREAM_WRITE_AFTER_END,S=m.ERR_UNKNOWN_ENCODING;var O=h.errorOrDestroy;i(2842)(Writable,l);function nop(){}function WritableState(t,r,a){o=o||i(2403);t=t||{};if(typeof a!=="boolean")a=r instanceof o;this.objectMode=!!t.objectMode;if(a)this.objectMode=this.objectMode||!!t.writableObjectMode;this.highWaterMark=p(this,t,"writableHighWaterMark",a);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var l=t.decodeStrings===false;this.decodeStrings=!l;this.defaultEncoding=t.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(t){onwrite(r,t)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.emitClose=t.emitClose!==false;this.autoDestroy=!!t.autoDestroy;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function getBuffer(){var t=this.bufferedRequest;var r=[];while(t){r.push(t);t=t.next}return r};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:a.deprecate((function writableStateBufferGetter(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(t){}})();var R;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){R=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function value(t){if(R.call(this,t))return true;if(this!==Writable)return false;return t&&t._writableState instanceof WritableState}})}else{R=function realHasInstance(t){return t instanceof this}}function Writable(t){o=o||i(2403);var r=this instanceof o;if(!r&&!R.call(Writable,this))return new Writable(t);this._writableState=new WritableState(t,this,r);this.writable=true;if(t){if(typeof t.write==="function")this._write=t.write;if(typeof t.writev==="function")this._writev=t.writev;if(typeof t.destroy==="function")this._destroy=t.destroy;if(typeof t.final==="function")this._final=t.final}l.call(this)}Writable.prototype.pipe=function(){O(this,new v)};function writeAfterEnd(t,r){var i=new E;O(t,i);process.nextTick(r,i)}function validChunk(t,r,i,o){var a;if(i===null){a=new w}else if(typeof i!=="string"&&!r.objectMode){a=new y("chunk",["string","Buffer"],i)}if(a){O(t,a);process.nextTick(o,a);return false}return true}Writable.prototype.write=function(t,r,i){var o=this._writableState;var a=false;var l=!o.objectMode&&_isUint8Array(t);if(l&&!c.isBuffer(t)){t=_uint8ArrayToBuffer(t)}if(typeof r==="function"){i=r;r=null}if(l)r="buffer";else if(!r)r=o.defaultEncoding;if(typeof i!=="function")i=nop;if(o.ending)writeAfterEnd(this,i);else if(l||validChunk(this,o,t,i)){o.pendingcb++;a=writeOrBuffer(this,o,l,t,r,i)}return a};Writable.prototype.cork=function(){this._writableState.corked++};Writable.prototype.uncork=function(){var t=this._writableState;if(t.corked){t.corked--;if(!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest)clearBuffer(this,t)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(t){if(typeof t==="string")t=t.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new S(t);this._writableState.defaultEncoding=t;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(t,r,i){if(!t.objectMode&&t.decodeStrings!==false&&typeof r==="string"){r=c.from(r,i)}return r}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(t,r,i,o,a,l){if(!i){var c=decodeChunk(r,o,a);if(o!==c){i=true;a="buffer";o=c}}var u=r.objectMode?1:o.length;r.length+=u;var h=r.length<r.highWaterMark;if(!h)r.needDrain=true;if(r.writing||r.corked){var d=r.lastBufferedRequest;r.lastBufferedRequest={chunk:o,encoding:a,isBuf:i,callback:l,next:null};if(d){d.next=r.lastBufferedRequest}else{r.bufferedRequest=r.lastBufferedRequest}r.bufferedRequestCount+=1}else{doWrite(t,r,false,u,o,a,l)}return h}function doWrite(t,r,i,o,a,l,c){r.writelen=o;r.writecb=c;r.writing=true;r.sync=true;if(r.destroyed)r.onwrite(new _("write"));else if(i)t._writev(a,r.onwrite);else t._write(a,l,r.onwrite);r.sync=false}function onwriteError(t,r,i,o,a){--r.pendingcb;if(i){process.nextTick(a,o);process.nextTick(finishMaybe,t,r);t._writableState.errorEmitted=true;O(t,o)}else{a(o);t._writableState.errorEmitted=true;O(t,o);finishMaybe(t,r)}}function onwriteStateUpdate(t){t.writing=false;t.writecb=null;t.length-=t.writelen;t.writelen=0}function onwrite(t,r){var i=t._writableState;var o=i.sync;var a=i.writecb;if(typeof a!=="function")throw new b;onwriteStateUpdate(i);if(r)onwriteError(t,i,o,r,a);else{var l=needFinish(i)||t.destroyed;if(!l&&!i.corked&&!i.bufferProcessing&&i.bufferedRequest){clearBuffer(t,i)}if(o){process.nextTick(afterWrite,t,i,l,a)}else{afterWrite(t,i,l,a)}}}function afterWrite(t,r,i,o){if(!i)onwriteDrain(t,r);r.pendingcb--;o();finishMaybe(t,r)}function onwriteDrain(t,r){if(r.length===0&&r.needDrain){r.needDrain=false;t.emit("drain")}}function clearBuffer(t,r){r.bufferProcessing=true;var i=r.bufferedRequest;if(t._writev&&i&&i.next){var o=r.bufferedRequestCount;var a=new Array(o);var l=r.corkedRequestsFree;l.entry=i;var c=0;var u=true;while(i){a[c]=i;if(!i.isBuf)u=false;i=i.next;c+=1}a.allBuffers=u;doWrite(t,r,true,r.length,a,"",l.finish);r.pendingcb++;r.lastBufferedRequest=null;if(l.next){r.corkedRequestsFree=l.next;l.next=null}else{r.corkedRequestsFree=new CorkedRequest(r)}r.bufferedRequestCount=0}else{while(i){var h=i.chunk;var d=i.encoding;var p=i.callback;var m=r.objectMode?1:h.length;doWrite(t,r,false,m,h,d,p);i=i.next;r.bufferedRequestCount--;if(r.writing){break}}if(i===null)r.lastBufferedRequest=null}r.bufferedRequest=i;r.bufferProcessing=false}Writable.prototype._write=function(t,r,i){i(new g("_write()"))};Writable.prototype._writev=null;Writable.prototype.end=function(t,r,i){var o=this._writableState;if(typeof t==="function"){i=t;t=null;r=null}else if(typeof r==="function"){i=r;r=null}if(t!==null&&t!==undefined)this.write(t,r);if(o.corked){o.corked=1;this.uncork()}if(!o.ending)endWritable(this,o,i);return this};Object.defineProperty(Writable.prototype,"writableLength",{enumerable:false,get:function get(){return this._writableState.length}});function needFinish(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function callFinal(t,r){t._final((function(i){r.pendingcb--;if(i){O(t,i)}r.prefinished=true;t.emit("prefinish");finishMaybe(t,r)}))}function prefinish(t,r){if(!r.prefinished&&!r.finalCalled){if(typeof t._final==="function"&&!r.destroyed){r.pendingcb++;r.finalCalled=true;process.nextTick(callFinal,t,r)}else{r.prefinished=true;t.emit("prefinish")}}}function finishMaybe(t,r){var i=needFinish(r);if(i){prefinish(t,r);if(r.pendingcb===0){r.finished=true;t.emit("finish");if(r.autoDestroy){var o=t._readableState;if(!o||o.autoDestroy&&o.endEmitted){t.destroy()}}}}return i}function endWritable(t,r,i){r.ending=true;finishMaybe(t,r);if(i){if(r.finished)process.nextTick(i);else t.once("finish",i)}r.ended=true;t.writable=false}function onCorkedFinish(t,r,i){var o=t.entry;t.entry=null;while(o){var a=o.callback;r.pendingcb--;a(i);o=o.next}r.corkedRequestsFree.next=t}Object.defineProperty(Writable.prototype,"destroyed",{enumerable:false,get:function get(){if(this._writableState===undefined){return false}return this._writableState.destroyed},set:function set(t){if(!this._writableState){return}this._writableState.destroyed=t}});Writable.prototype.destroy=h.destroy;Writable.prototype._undestroy=h.undestroy;Writable.prototype._destroy=function(t,r){r(t)}},6871:(t,r,i)=>{"use strict";var o;function _defineProperty(t,r,i){if(r in t){Object.defineProperty(t,r,{value:i,enumerable:true,configurable:true,writable:true})}else{t[r]=i}return t}var a=i(9698);var l=Symbol("lastResolve");var c=Symbol("lastReject");var u=Symbol("error");var h=Symbol("ended");var d=Symbol("lastPromise");var p=Symbol("handlePromise");var m=Symbol("stream");function createIterResult(t,r){return{value:t,done:r}}function readAndResolve(t){var r=t[l];if(r!==null){var i=t[m].read();if(i!==null){t[d]=null;t[l]=null;t[c]=null;r(createIterResult(i,false))}}}function onReadable(t){process.nextTick(readAndResolve,t)}function wrapForNext(t,r){return function(i,o){t.then((function(){if(r[h]){i(createIterResult(undefined,true));return}r[p](i,o)}),o)}}var y=Object.getPrototypeOf((function(){}));var g=Object.setPrototypeOf((o={get stream(){return this[m]},next:function next(){var t=this;var r=this[u];if(r!==null){return Promise.reject(r)}if(this[h]){return Promise.resolve(createIterResult(undefined,true))}if(this[m].destroyed){return new Promise((function(r,i){process.nextTick((function(){if(t[u]){i(t[u])}else{r(createIterResult(undefined,true))}}))}))}var i=this[d];var o;if(i){o=new Promise(wrapForNext(i,this))}else{var a=this[m].read();if(a!==null){return Promise.resolve(createIterResult(a,false))}o=new Promise(this[p])}this[d]=o;return o}},_defineProperty(o,Symbol.asyncIterator,(function(){return this})),_defineProperty(o,"return",(function _return(){var t=this;return new Promise((function(r,i){t[m].destroy(null,(function(t){if(t){i(t);return}r(createIterResult(undefined,true))}))}))})),o),y);var b=function createReadableStreamAsyncIterator(t){var r;var i=Object.create(g,(r={},_defineProperty(r,m,{value:t,writable:true}),_defineProperty(r,l,{value:null,writable:true}),_defineProperty(r,c,{value:null,writable:true}),_defineProperty(r,u,{value:null,writable:true}),_defineProperty(r,h,{value:t._readableState.endEmitted,writable:true}),_defineProperty(r,p,{value:function value(t,r){var o=i[m].read();if(o){i[d]=null;i[l]=null;i[c]=null;t(createIterResult(o,false))}else{i[l]=t;i[c]=r}},writable:true}),r));i[d]=null;a(t,(function(t){if(t&&t.code!=="ERR_STREAM_PREMATURE_CLOSE"){var r=i[c];if(r!==null){i[d]=null;i[l]=null;i[c]=null;r(t)}i[u]=t;return}var o=i[l];if(o!==null){i[d]=null;i[l]=null;i[c]=null;o(createIterResult(undefined,true))}i[h]=true}));t.on("readable",onReadable.bind(null,i));return i};t.exports=b},4379:(t,r,i)=>{"use strict";function ownKeys(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);if(r)o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}));i.push.apply(i,o)}return i}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){ownKeys(Object(i),true).forEach((function(r){_defineProperty(t,r,i[r])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))}else{ownKeys(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}}return t}function _defineProperty(t,r,i){if(r in t){Object.defineProperty(t,r,{value:i,enumerable:true,configurable:true,writable:true})}else{t[r]=i}return t}function _classCallCheck(t,r){if(!(t instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||false;o.configurable=true;if("value"in o)o.writable=true;Object.defineProperty(t,o.key,o)}}function _createClass(t,r,i){if(r)_defineProperties(t.prototype,r);if(i)_defineProperties(t,i);return t}var o=i(4300),a=o.Buffer;var l=i(3837),c=l.inspect;var u=c&&c.custom||"inspect";function copyBuffer(t,r,i){a.prototype.copy.call(t,r,i)}t.exports=function(){function BufferList(){_classCallCheck(this,BufferList);this.head=null;this.tail=null;this.length=0}_createClass(BufferList,[{key:"push",value:function push(t){var r={data:t,next:null};if(this.length>0)this.tail.next=r;else this.head=r;this.tail=r;++this.length}},{key:"unshift",value:function unshift(t){var r={data:t,next:this.head};if(this.length===0)this.tail=r;this.head=r;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var t=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return t}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(t){if(this.length===0)return"";var r=this.head;var i=""+r.data;while(r=r.next){i+=t+r.data}return i}},{key:"concat",value:function concat(t){if(this.length===0)return a.alloc(0);var r=a.allocUnsafe(t>>>0);var i=this.head;var o=0;while(i){copyBuffer(i.data,r,o);o+=i.data.length;i=i.next}return r}},{key:"consume",value:function consume(t,r){var i;if(t<this.head.data.length){i=this.head.data.slice(0,t);this.head.data=this.head.data.slice(t)}else if(t===this.head.data.length){i=this.shift()}else{i=r?this._getString(t):this._getBuffer(t)}return i}},{key:"first",value:function first(){return this.head.data}},{key:"_getString",value:function _getString(t){var r=this.head;var i=1;var o=r.data;t-=o.length;while(r=r.next){var a=r.data;var l=t>a.length?a.length:t;if(l===a.length)o+=a;else o+=a.slice(0,t);t-=l;if(t===0){if(l===a.length){++i;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=a.slice(l)}break}++i}this.length-=i;return o}},{key:"_getBuffer",value:function _getBuffer(t){var r=a.allocUnsafe(t);var i=this.head;var o=1;i.data.copy(r);t-=i.data.length;while(i=i.next){var l=i.data;var c=t>l.length?l.length:t;l.copy(r,r.length-t,0,c);t-=c;if(t===0){if(c===l.length){++o;if(i.next)this.head=i.next;else this.head=this.tail=null}else{this.head=i;i.data=l.slice(c)}break}++o}this.length-=o;return r}},{key:u,value:function value(t,r){return c(this,_objectSpread({},r,{depth:0,customInspect:false}))}}]);return BufferList}()},7025:t=>{"use strict";function destroy(t,r){var i=this;var o=this._readableState&&this._readableState.destroyed;var a=this._writableState&&this._writableState.destroyed;if(o||a){if(r){r(t)}else if(t){if(!this._writableState){process.nextTick(emitErrorNT,this,t)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,t)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(t||null,(function(t){if(!r&&t){if(!i._writableState){process.nextTick(emitErrorAndCloseNT,i,t)}else if(!i._writableState.errorEmitted){i._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,i,t)}else{process.nextTick(emitCloseNT,i)}}else if(r){process.nextTick(emitCloseNT,i);r(t)}else{process.nextTick(emitCloseNT,i)}}));return this}function emitErrorAndCloseNT(t,r){emitErrorNT(t,r);emitCloseNT(t)}function emitCloseNT(t){if(t._writableState&&!t._writableState.emitClose)return;if(t._readableState&&!t._readableState.emitClose)return;t.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(t,r){t.emit("error",r)}function errorOrDestroy(t,r){var i=t._readableState;var o=t._writableState;if(i&&i.autoDestroy||o&&o.autoDestroy)t.destroy(r);else t.emit("error",r)}t.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},9698:(t,r,i)=>{"use strict";var o=i(4646).q.ERR_STREAM_PREMATURE_CLOSE;function once(t){var r=false;return function(){if(r)return;r=true;for(var i=arguments.length,o=new Array(i),a=0;a<i;a++){o[a]=arguments[a]}t.apply(this,o)}}function noop(){}function isRequest(t){return t.setHeader&&typeof t.abort==="function"}function eos(t,r,i){if(typeof r==="function")return eos(t,null,r);if(!r)r={};i=once(i||noop);var a=r.readable||r.readable!==false&&t.readable;var l=r.writable||r.writable!==false&&t.writable;var c=function onlegacyfinish(){if(!t.writable)h()};var u=t._writableState&&t._writableState.finished;var h=function onfinish(){l=false;u=true;if(!a)i.call(t)};var d=t._readableState&&t._readableState.endEmitted;var p=function onend(){a=false;d=true;if(!l)i.call(t)};var m=function onerror(r){i.call(t,r)};var y=function onclose(){var r;if(a&&!d){if(!t._readableState||!t._readableState.ended)r=new o;return i.call(t,r)}if(l&&!u){if(!t._writableState||!t._writableState.ended)r=new o;return i.call(t,r)}};var g=function onrequest(){t.req.on("finish",h)};if(isRequest(t)){t.on("complete",h);t.on("abort",y);if(t.req)g();else t.on("request",g)}else if(l&&!t._writableState){t.on("end",c);t.on("close",c)}t.on("end",p);t.on("finish",h);if(r.error!==false)t.on("error",m);t.on("close",y);return function(){t.removeListener("complete",h);t.removeListener("abort",y);t.removeListener("request",g);if(t.req)t.req.removeListener("finish",h);t.removeListener("end",c);t.removeListener("close",c);t.removeListener("finish",h);t.removeListener("end",p);t.removeListener("error",m);t.removeListener("close",y)}}t.exports=eos},9727:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,l,c){try{var u=t[l](c);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var l=t.apply(r,i);function _next(t){asyncGeneratorStep(l,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}function ownKeys(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);if(r)o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}));i.push.apply(i,o)}return i}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){ownKeys(Object(i),true).forEach((function(r){_defineProperty(t,r,i[r])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))}else{ownKeys(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}}return t}function _defineProperty(t,r,i){if(r in t){Object.defineProperty(t,r,{value:i,enumerable:true,configurable:true,writable:true})}else{t[r]=i}return t}var o=i(4646).q.ERR_INVALID_ARG_TYPE;function from(t,r,i){var a;if(r&&typeof r.next==="function"){a=r}else if(r&&r[Symbol.asyncIterator])a=r[Symbol.asyncIterator]();else if(r&&r[Symbol.iterator])a=r[Symbol.iterator]();else throw new o("iterable",["Iterable"],r);var l=new t(_objectSpread({objectMode:true},i));var c=false;l._read=function(){if(!c){c=true;next()}};function next(){return _next2.apply(this,arguments)}function _next2(){_next2=_asyncToGenerator((function*(){try{var t=yield a.next(),r=t.value,i=t.done;if(i){l.push(null)}else if(l.push(yield r)){next()}else{c=false}}catch(t){l.destroy(t)}}));return _next2.apply(this,arguments)}return l}t.exports=from},8442:(t,r,i)=>{"use strict";var o;function once(t){var r=false;return function(){if(r)return;r=true;t.apply(void 0,arguments)}}var a=i(4646).q,l=a.ERR_MISSING_ARGS,c=a.ERR_STREAM_DESTROYED;function noop(t){if(t)throw t}function isRequest(t){return t.setHeader&&typeof t.abort==="function"}function destroyer(t,r,a,l){l=once(l);var u=false;t.on("close",(function(){u=true}));if(o===undefined)o=i(9698);o(t,{readable:r,writable:a},(function(t){if(t)return l(t);u=true;l()}));var h=false;return function(r){if(u)return;if(h)return;h=true;if(isRequest(t))return t.abort();if(typeof t.destroy==="function")return t.destroy();l(r||new c("pipe"))}}function call(t){t()}function pipe(t,r){return t.pipe(r)}function popCallback(t){if(!t.length)return noop;if(typeof t[t.length-1]!=="function")return noop;return t.pop()}function pipeline(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++){r[i]=arguments[i]}var o=popCallback(r);if(Array.isArray(r[0]))r=r[0];if(r.length<2){throw new l("streams")}var a;var c=r.map((function(t,i){var l=i<r.length-1;var u=i>0;return destroyer(t,l,u,(function(t){if(!a)a=t;if(t)c.forEach(call);if(l)return;c.forEach(call);o(a)}))}));return r.reduce(pipe)}t.exports=pipeline},6776:(t,r,i)=>{"use strict";var o=i(4646).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(t,r,i){return t.highWaterMark!=null?t.highWaterMark:r?t[i]:null}function getHighWaterMark(t,r,i,a){var l=highWaterMarkFrom(r,a,i);if(l!=null){if(!(isFinite(l)&&Math.floor(l)===l)||l<0){var c=a?i:"highWaterMark";throw new o(c,l)}return Math.floor(l)}return t.objectMode?16:16*1024}t.exports={getHighWaterMark:getHighWaterMark}},4678:(t,r,i)=>{t.exports=i(2781)},3726:(t,r,i)=>{var o=i(2781);if(process.env.READABLE_STREAM==="disable"&&o){t.exports=o.Readable;Object.assign(t.exports,o);t.exports.Stream=o}else{r=t.exports=i(1709);r.Stream=o||r;r.Readable=r;r.Writable=i(7337);r.Duplex=i(2403);r.Transform=i(1170);r.PassThrough=i(7889);r.finished=i(9698);r.pipeline=i(8442)}},3638:(t,r,i)=>{t.exports=readdirGlob;const o=i(7147);const{EventEmitter:a}=i(2361);const{Minimatch:l}=i(8923);const{resolve:c}=i(1017);function readdir(t,r){return new Promise(((i,a)=>{o.readdir(t,{withFileTypes:true},((t,o)=>{if(t){switch(t.code){case"ENOTDIR":if(r){a(t)}else{i([])}break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":i([]);break;case"ELOOP":default:a(t);break}}else{i(o)}}))}))}function stat(t,r){return new Promise(((i,a)=>{const l=r?o.stat:o.lstat;l(t,((o,a)=>{if(o){switch(o.code){case"ENOENT":if(r){i(stat(t,false))}else{i(null)}break;default:i(null);break}}else{i(a)}}))}))}async function*exploreWalkAsync(t,r,i,o,a,l){let c=await readdir(r+t,l);for(const l of c){let c=l.name;if(c===undefined){c=l;o=true}const u=t+"/"+c;const h=u.slice(1);const d=r+"/"+h;let p=null;if(o||i){p=await stat(d,i)}if(!p&&l.name!==undefined){p=l}if(p===null){p={isDirectory:()=>false}}if(p.isDirectory()){if(!a(h)){yield{relative:h,absolute:d,stats:p};yield*exploreWalkAsync(u,r,i,o,a,false)}}else{yield{relative:h,absolute:d,stats:p}}}}async function*explore(t,r,i,o){yield*exploreWalkAsync("",t,r,i,o,true)}function readOptions(t){return{pattern:t.pattern,dot:!!t.dot,noglobstar:!!t.noglobstar,matchBase:!!t.matchBase,nocase:!!t.nocase,ignore:t.ignore,skip:t.skip,follow:!!t.follow,stat:!!t.stat,nodir:!!t.nodir,mark:!!t.mark,silent:!!t.silent,absolute:!!t.absolute}}class ReaddirGlob extends a{constructor(t,r,i){super();if(typeof r==="function"){i=r;r=null}this.options=readOptions(r||{});this.matchers=[];if(this.options.pattern){const t=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=t.map((t=>new l(t,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase})))}this.ignoreMatchers=[];if(this.options.ignore){const t=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=t.map((t=>new l(t,{dot:true})))}this.skipMatchers=[];if(this.options.skip){const t=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=t.map((t=>new l(t,{dot:true})))}this.iterator=explore(c(t||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this));this.paused=false;this.inactive=false;this.aborted=false;if(i){this._matches=[];this.on("match",(t=>this._matches.push(this.options.absolute?t.absolute:t.relative)));this.on("error",(t=>i(t)));this.on("end",(()=>i(null,this._matches)))}setTimeout((()=>this._next()),0)}_shouldSkipDirectory(t){return this.skipMatchers.some((r=>r.match(t)))}_fileMatches(t,r){const i=t+(r?"/":"");return(this.matchers.length===0||this.matchers.some((t=>t.match(i))))&&!this.ignoreMatchers.some((t=>t.match(i)))&&(!this.options.nodir||!r)}_next(){if(!this.paused&&!this.aborted){this.iterator.next().then((t=>{if(!t.done){const r=t.value.stats.isDirectory();if(this._fileMatches(t.value.relative,r)){let i=t.value.relative;let o=t.value.absolute;if(this.options.mark&&r){i+="/";o+="/"}if(this.options.stat){this.emit("match",{relative:i,absolute:o,stat:t.value.stats})}else{this.emit("match",{relative:i,absolute:o})}}this._next(this.iterator)}else{this.emit("end")}})).catch((t=>{this.abort();this.emit("error",t);if(!t.code&&!this.options.silent){console.error(t)}}))}else{this.inactive=true}}abort(){this.aborted=true}pause(){this.paused=true}resume(){this.paused=false;if(this.inactive){this.inactive=false;this._next()}}}function readdirGlob(t,r,i){return new ReaddirGlob(t,r,i)}readdirGlob.ReaddirGlob=ReaddirGlob},1913:(t,r,i)=>{const o=i(6911).Buffer;function decodeBase64(t){return o.from(t,"base64").toString("utf8")}function encodeBase64(t){return o.from(t,"utf8").toString("base64")}t.exports={decodeBase64:decodeBase64,encodeBase64:encodeBase64}},1281:(t,r,i)=>{var o=i(7310);var a=i(1913);var l=a.decodeBase64;var c=a.encodeBase64;var u=":_authToken";var h=":username";var d=":_password";t.exports=function(){var t;var r;if(arguments.length>=2){t=arguments[0];r=arguments[1]}else if(typeof arguments[0]==="string"){t=arguments[0]}else{r=arguments[0]}r=r||{};r.npmrc=r.npmrc||i(4446)("npm",{registry:"https://registry.npmjs.org/"});t=t||r.npmrc.registry;return getRegistryAuthInfo(t,r)||getLegacyAuthInfo(r.npmrc)};function getRegistryAuthInfo(t,r){var i=o.parse(t,false,true);var a;while(a!=="/"&&i.pathname!==a){a=i.pathname||"/";var l="//"+i.host+a.replace(/\/$/,"");var c=getAuthInfoForUrl(l,r.npmrc);if(c){return c}if(!r.recursive){return/\/$/.test(t)?undefined:getRegistryAuthInfo(o.resolve(t,"."),r)}i.pathname=o.resolve(normalizePath(a),"..")||"/"}return undefined}function getLegacyAuthInfo(t){if(t._auth){return{token:t._auth,type:"Basic"}}return undefined}function normalizePath(t){return t[t.length-1]==="/"?t:t+"/"}function getAuthInfoForUrl(t,r){var i=getBearerToken(r[t+u]||r[t+"/"+u]);if(i){return i}var o=r[t+h]||r[t+"/"+h];var a=r[t+d]||r[t+"/"+d];var l=getTokenForUsernameAndPassword(o,a);if(l){return l}return undefined}function getBearerToken(t){if(!t){return undefined}var r=t.replace(/^\$\{?([^}]*)\}?$/,(function(t,r){return process.env[r]}));return{token:r,type:"Bearer"}}function getTokenForUsernameAndPassword(t,r){if(!t||!r){return undefined}var i=l(r.replace(/^\$\{?([^}]*)\}?$/,(function(t,r){return process.env[r]})));var o=c(t+":"+i);return{token:o,type:"Basic",password:i,username:t}}},9074:(t,r,i)=>{"use strict";t.exports=function(t){var r=i(4446)("npm",{registry:"https://registry.npmjs.org/"});var o=r[t+":registry"]||r.registry;return o.slice(-1)==="/"?o:o+"/"}},8826:(t,r,i)=>{"use strict";const o=i(4404);t.exports=(t={},r=o.connect)=>new Promise(((i,o)=>{let a=false;let l;const callback=async()=>{await c;l.off("timeout",onTimeout);l.off("error",o);if(t.resolveSocket){i({alpnProtocol:l.alpnProtocol,socket:l,timeout:a});if(a){await Promise.resolve();l.emit("timeout")}}else{l.destroy();i({alpnProtocol:l.alpnProtocol,timeout:a})}};const onTimeout=async()=>{a=true;callback()};const c=(async()=>{try{l=await r(t,callback);l.on("error",o);l.once("timeout",onTimeout)}catch(t){o(t)}})()}))},6975:(t,r,i)=>{t.exports=i(4432)},4432:(t,r,i)=>{var o=i(26);r.operation=function(t){var i=r.timeouts(t);return new o(i,{forever:t&&(t.forever||t.retries===Infinity),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};r.timeouts=function(t){if(t instanceof Array){return[].concat(t)}var r={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:Infinity,randomize:false};for(var i in t){r[i]=t[i]}if(r.minTimeout>r.maxTimeout){throw new Error("minTimeout is greater than maxTimeout")}var o=[];for(var a=0;a<r.retries;a++){o.push(this.createTimeout(a,r))}if(t&&t.forever&&!o.length){o.push(this.createTimeout(a,r))}o.sort((function(t,r){return t-r}));return o};r.createTimeout=function(t,r){var i=r.randomize?Math.random()+1:1;var o=Math.round(i*Math.max(r.minTimeout,1)*Math.pow(r.factor,t));o=Math.min(o,r.maxTimeout);return o};r.wrap=function(t,i,o){if(i instanceof Array){o=i;i=null}if(!o){o=[];for(var a in t){if(typeof t[a]==="function"){o.push(a)}}}for(var l=0;l<o.length;l++){var c=o[l];var u=t[c];t[c]=function retryWrapper(o){var a=r.operation(i);var l=Array.prototype.slice.call(arguments,1);var c=l.pop();l.push((function(t){if(a.retry(t)){return}if(t){arguments[0]=a.mainError()}c.apply(this,arguments)}));a.attempt((function(){o.apply(t,l)}))}.bind(t,u);t[c].options=i}}},26:t=>{function RetryOperation(t,r){if(typeof r==="boolean"){r={forever:r}}this._originalTimeouts=JSON.parse(JSON.stringify(t));this._timeouts=t;this._options=r||{};this._maxRetryTime=r&&r.maxRetryTime||Infinity;this._fn=null;this._errors=[];this._attempts=1;this._operationTimeout=null;this._operationTimeoutCb=null;this._timeout=null;this._operationStart=null;this._timer=null;if(this._options.forever){this._cachedTimeouts=this._timeouts.slice(0)}}t.exports=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1;this._timeouts=this._originalTimeouts.slice(0)};RetryOperation.prototype.stop=function(){if(this._timeout){clearTimeout(this._timeout)}if(this._timer){clearTimeout(this._timer)}this._timeouts=[];this._cachedTimeouts=null};RetryOperation.prototype.retry=function(t){if(this._timeout){clearTimeout(this._timeout)}if(!t){return false}var r=(new Date).getTime();if(t&&r-this._operationStart>=this._maxRetryTime){this._errors.push(t);this._errors.unshift(new Error("RetryOperation timeout occurred"));return false}this._errors.push(t);var i=this._timeouts.shift();if(i===undefined){if(this._cachedTimeouts){this._errors.splice(0,this._errors.length-1);i=this._cachedTimeouts.slice(-1)}else{return false}}var o=this;this._timer=setTimeout((function(){o._attempts++;if(o._operationTimeoutCb){o._timeout=setTimeout((function(){o._operationTimeoutCb(o._attempts)}),o._operationTimeout);if(o._options.unref){o._timeout.unref()}}o._fn(o._attempts)}),i);if(this._options.unref){this._timer.unref()}return true};RetryOperation.prototype.attempt=function(t,r){this._fn=t;if(r){if(r.timeout){this._operationTimeout=r.timeout}if(r.cb){this._operationTimeoutCb=r.cb}}var i=this;if(this._operationTimeoutCb){this._timeout=setTimeout((function(){i._operationTimeoutCb()}),i._operationTimeout)}this._operationStart=(new Date).getTime();this._fn(this._attempts)};RetryOperation.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated");this.attempt(t)};RetryOperation.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated");this.attempt(t)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0){return null}var t={};var r=null;var i=0;for(var o=0;o<this._errors.length;o++){var a=this._errors[o];var l=a.message;var c=(t[l]||0)+1;t[l]=c;if(c>=i){r=a;i=c}}return r}},7327:t=>{"use strict";function reusify(t){var r=new t;var i=r;function get(){var o=r;if(o.next){r=o.next}else{r=new t;i=r}o.next=null;return o}function release(t){i.next=t;i=t}return{get:get,release:release}}t.exports=reusify},4700:(t,r,i)=>{const o=i(9491);const a=i(1017);const l=i(7147);let c=undefined;try{c=i(4966)}catch(t){}const u={nosort:true,silent:true};let h=0;const d=process.platform==="win32";const defaults=t=>{const r=["unlink","chmod","stat","lstat","rmdir","readdir"];r.forEach((r=>{t[r]=t[r]||l[r];r=r+"Sync";t[r]=t[r]||l[r]}));t.maxBusyTries=t.maxBusyTries||3;t.emfileWait=t.emfileWait||1e3;if(t.glob===false){t.disableGlob=true}if(t.disableGlob!==true&&c===undefined){throw Error("glob dependency not found, set `options.disableGlob = true` if intentional")}t.disableGlob=t.disableGlob||false;t.glob=t.glob||u};const rimraf=(t,r,i)=>{if(typeof r==="function"){i=r;r={}}o(t,"rimraf: missing path");o.equal(typeof t,"string","rimraf: path should be a string");o.equal(typeof i,"function","rimraf: callback function required");o(r,"rimraf: invalid options argument provided");o.equal(typeof r,"object","rimraf: options should be object");defaults(r);let a=0;let l=null;let u=0;const next=t=>{l=l||t;if(--u===0)i(l)};const afterGlob=(t,o)=>{if(t)return i(t);u=o.length;if(u===0)return i();o.forEach((t=>{const CB=i=>{if(i){if((i.code==="EBUSY"||i.code==="ENOTEMPTY"||i.code==="EPERM")&&a<r.maxBusyTries){a++;return setTimeout((()=>rimraf_(t,r,CB)),a*100)}if(i.code==="EMFILE"&&h<r.emfileWait){return setTimeout((()=>rimraf_(t,r,CB)),h++)}if(i.code==="ENOENT")i=null}h=0;next(i)};rimraf_(t,r,CB)}))};if(r.disableGlob||!c.hasMagic(t))return afterGlob(null,[t]);r.lstat(t,((i,o)=>{if(!i)return afterGlob(null,[t]);c(t,r.glob,afterGlob)}))};const rimraf_=(t,r,i)=>{o(t);o(r);o(typeof i==="function");r.lstat(t,((o,a)=>{if(o&&o.code==="ENOENT")return i(null);if(o&&o.code==="EPERM"&&d)fixWinEPERM(t,r,o,i);if(a&&a.isDirectory())return rmdir(t,r,o,i);r.unlink(t,(o=>{if(o){if(o.code==="ENOENT")return i(null);if(o.code==="EPERM")return d?fixWinEPERM(t,r,o,i):rmdir(t,r,o,i);if(o.code==="EISDIR")return rmdir(t,r,o,i)}return i(o)}))}))};const fixWinEPERM=(t,r,i,a)=>{o(t);o(r);o(typeof a==="function");r.chmod(t,438,(o=>{if(o)a(o.code==="ENOENT"?null:i);else r.stat(t,((o,l)=>{if(o)a(o.code==="ENOENT"?null:i);else if(l.isDirectory())rmdir(t,r,i,a);else r.unlink(t,a)}))}))};const fixWinEPERMSync=(t,r,i)=>{o(t);o(r);try{r.chmodSync(t,438)}catch(t){if(t.code==="ENOENT")return;else throw i}let a;try{a=r.statSync(t)}catch(t){if(t.code==="ENOENT")return;else throw i}if(a.isDirectory())rmdirSync(t,r,i);else r.unlinkSync(t)};const rmdir=(t,r,i,a)=>{o(t);o(r);o(typeof a==="function");r.rmdir(t,(o=>{if(o&&(o.code==="ENOTEMPTY"||o.code==="EEXIST"||o.code==="EPERM"))rmkids(t,r,a);else if(o&&o.code==="ENOTDIR")a(i);else a(o)}))};const rmkids=(t,r,i)=>{o(t);o(r);o(typeof i==="function");r.readdir(t,((o,l)=>{if(o)return i(o);let c=l.length;if(c===0)return r.rmdir(t,i);let u;l.forEach((o=>{rimraf(a.join(t,o),r,(o=>{if(u)return;if(o)return i(u=o);if(--c===0)r.rmdir(t,i)}))}))}))};const rimrafSync=(t,r)=>{r=r||{};defaults(r);o(t,"rimraf: missing path");o.equal(typeof t,"string","rimraf: path should be a string");o(r,"rimraf: missing options");o.equal(typeof r,"object","rimraf: options should be object");let i;if(r.disableGlob||!c.hasMagic(t)){i=[t]}else{try{r.lstatSync(t);i=[t]}catch(o){i=c.sync(t,r.glob)}}if(!i.length)return;for(let t=0;t<i.length;t++){const o=i[t];let a;try{a=r.lstatSync(o)}catch(t){if(t.code==="ENOENT")return;if(t.code==="EPERM"&&d)fixWinEPERMSync(o,r,t)}try{if(a&&a.isDirectory())rmdirSync(o,r,null);else r.unlinkSync(o)}catch(t){if(t.code==="ENOENT")return;if(t.code==="EPERM")return d?fixWinEPERMSync(o,r,t):rmdirSync(o,r,t);if(t.code!=="EISDIR")throw t;rmdirSync(o,r,t)}}};const rmdirSync=(t,r,i)=>{o(t);o(r);try{r.rmdirSync(t)}catch(o){if(o.code==="ENOENT")return;if(o.code==="ENOTDIR")throw i;if(o.code==="ENOTEMPTY"||o.code==="EEXIST"||o.code==="EPERM")rmkidsSync(t,r)}};const rmkidsSync=(t,r)=>{o(t);o(r);r.readdirSync(t).forEach((i=>rimrafSync(a.join(t,i),r)));const i=d?100:1;let l=0;do{let o=true;try{const a=r.rmdirSync(t,r);o=false;return a}finally{if(++l<i&&o)continue}}while(true)};t.exports=rimraf;rimraf.sync=rimrafSync},4796:(t,r,i)=>{
113
+ let r;t.exports=typeof queueMicrotask==="function"?queueMicrotask.bind(typeof window!=="undefined"?window:global):t=>(r||(r=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},6664:t=>{"use strict";class QuickLRU{constructor(t={}){if(!(t.maxSize&&t.maxSize>0)){throw new TypeError("`maxSize` must be a number greater than 0")}this.maxSize=t.maxSize;this.onEviction=t.onEviction;this.cache=new Map;this.oldCache=new Map;this._size=0}_set(t,r){this.cache.set(t,r);this._size++;if(this._size>=this.maxSize){this._size=0;if(typeof this.onEviction==="function"){for(const[t,r]of this.oldCache.entries()){this.onEviction(t,r)}}this.oldCache=this.cache;this.cache=new Map}}get(t){if(this.cache.has(t)){return this.cache.get(t)}if(this.oldCache.has(t)){const r=this.oldCache.get(t);this.oldCache.delete(t);this._set(t,r);return r}}set(t,r){if(this.cache.has(t)){this.cache.set(t,r)}else{this._set(t,r)}return this}has(t){return this.cache.has(t)||this.oldCache.has(t)}peek(t){if(this.cache.has(t)){return this.cache.get(t)}if(this.oldCache.has(t)){return this.oldCache.get(t)}}delete(t){const r=this.cache.delete(t);if(r){this._size--}return this.oldCache.delete(t)||r}clear(){this.cache.clear();this.oldCache.clear();this._size=0}*keys(){for(const[t]of this){yield t}}*values(){for(const[,t]of this){yield t}}*[Symbol.iterator](){for(const t of this.cache){yield t}for(const t of this.oldCache){const[r]=t;if(!this.cache.has(r)){yield t}}}get size(){let t=0;for(const r of this.oldCache.keys()){if(!this.cache.has(r)){t++}}return Math.min(this._size+t,this.maxSize)}}t.exports=QuickLRU},4446:(t,r,i)=>{var o=i(3574);var a=i(1017).join;var l=i(7360);var c="/etc";var u=process.platform==="win32";var h=u?process.env.USERPROFILE:process.env.HOME;t.exports=function(t,r,d,p){if("string"!==typeof t)throw new Error("rc(name): name *must* be string");if(!d)d=i(1254)(process.argv.slice(2));r=("string"===typeof r?o.json(r):r)||{};p=p||o.parse;var m=o.env(t+"_");var y=[r];var g=[];function addConfigFile(t){if(g.indexOf(t)>=0)return;var r=o.file(t);if(r){y.push(p(r));g.push(t)}}if(!u)[a(c,t,"config"),a(c,t+"rc")].forEach(addConfigFile);if(h)[a(h,".config",t,"config"),a(h,".config",t),a(h,"."+t,"config"),a(h,"."+t+"rc")].forEach(addConfigFile);addConfigFile(o.find("."+t+"rc"));if(m.config)addConfigFile(m.config);if(d.config)addConfigFile(d.config);return l.apply(null,y.concat([m,d,g.length?{configs:g,config:g[g.length-1]}:undefined]))}},3574:(t,r,i)=>{"use strict";var o=i(7147);var a=i(7036);var l=i(1017);var c=i(2251);var u=r.parse=function(t){if(/^\s*{/.test(t))return JSON.parse(c(t));return a.parse(t)};var h=r.file=function(){var t=[].slice.call(arguments).filter((function(t){return t!=null}));for(var r in t)if("string"!==typeof t[r])return;var i=l.join.apply(null,t);var a;try{return o.readFileSync(i,"utf-8")}catch(t){return}};var d=r.json=function(){var t=h.apply(null,arguments);return t?u(t):null};var p=r.env=function(t,r){r=r||process.env;var i={};var o=t.length;for(var a in r){if(a.toLowerCase().indexOf(t.toLowerCase())===0){var l=a.substring(o).split("__");var c;while((c=l.indexOf(""))>-1){l.splice(c,1)}var u=i;l.forEach((function _buildSubObj(t,i){if(!t||typeof u!=="object")return;if(i===l.length-1)u[t]=r[a];if(u[t]===undefined)u[t]={};u=u[t]}))}}return i};var m=r.find=function(){var t=l.join.apply(null,[].slice.call(arguments));function find(t,r){var i=l.join(t,r);try{o.statSync(i);return i}catch(i){if(l.dirname(t)!==t)return find(l.dirname(t),r)}}return find(process.cwd(),t)}},4928:(t,r,i)=>{"use strict";var o=i(9182);var a=Object.keys||function(t){var r=[];for(var i in t){r.push(i)}return r};t.exports=Duplex;var l=Object.create(i(642));l.inherits=i(2842);var c=i(7355);var u=i(3517);l.inherits(Duplex,c);{var h=a(u.prototype);for(var d=0;d<h.length;d++){var p=h[d];if(!Duplex.prototype[p])Duplex.prototype[p]=u.prototype[p]}}function Duplex(t){if(!(this instanceof Duplex))return new Duplex(t);c.call(this,t);u.call(this,t);if(t&&t.readable===false)this.readable=false;if(t&&t.writable===false)this.writable=false;this.allowHalfOpen=true;if(t&&t.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",onend)}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function onend(){if(this.allowHalfOpen||this._writableState.ended)return;o.nextTick(onEndNT,this)}function onEndNT(t){t.end()}Object.defineProperty(Duplex.prototype,"destroyed",{get:function(){if(this._readableState===undefined||this._writableState===undefined){return false}return this._readableState.destroyed&&this._writableState.destroyed},set:function(t){if(this._readableState===undefined||this._writableState===undefined){return}this._readableState.destroyed=t;this._writableState.destroyed=t}});Duplex.prototype._destroy=function(t,r){this.push(null);this.end();o.nextTick(r,t)}},9924:(t,r,i)=>{"use strict";t.exports=PassThrough;var o=i(2162);var a=Object.create(i(642));a.inherits=i(2842);a.inherits(PassThrough,o);function PassThrough(t){if(!(this instanceof PassThrough))return new PassThrough(t);o.call(this,t)}PassThrough.prototype._transform=function(t,r,i){i(null,t)}},7355:(t,r,i)=>{"use strict";var o=i(9182);t.exports=Readable;var a=i(1551);var l;Readable.ReadableState=ReadableState;var c=i(2361).EventEmitter;var EElistenerCount=function(t,r){return t.listeners(r).length};var u=i(2641);var h=i(291).Buffer;var d=global.Uint8Array||function(){};function _uint8ArrayToBuffer(t){return h.from(t)}function _isUint8Array(t){return h.isBuffer(t)||t instanceof d}var p=Object.create(i(642));p.inherits=i(2842);var m=i(3837);var y=void 0;if(m&&m.debuglog){y=m.debuglog("stream")}else{y=function(){}}var g=i(4865);var b=i(2604);var v;p.inherits(Readable,u);var _=["error","close","destroy","pause","resume"];function prependListener(t,r,i){if(typeof t.prependListener==="function")return t.prependListener(r,i);if(!t._events||!t._events[r])t.on(r,i);else if(a(t._events[r]))t._events[r].unshift(i);else t._events[r]=[i,t._events[r]]}function ReadableState(t,r){l=l||i(4928);t=t||{};var o=r instanceof l;this.objectMode=!!t.objectMode;if(o)this.objectMode=this.objectMode||!!t.readableObjectMode;var a=t.highWaterMark;var c=t.readableHighWaterMark;var u=this.objectMode?16:16*1024;if(a||a===0)this.highWaterMark=a;else if(o&&(c||c===0))this.highWaterMark=c;else this.highWaterMark=u;this.highWaterMark=Math.floor(this.highWaterMark);this.buffer=new g;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.destroyed=false;this.defaultEncoding=t.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(t.encoding){if(!v)v=i(4426).s;this.decoder=new v(t.encoding);this.encoding=t.encoding}}function Readable(t){l=l||i(4928);if(!(this instanceof Readable))return new Readable(t);this._readableState=new ReadableState(t,this);this.readable=true;if(t){if(typeof t.read==="function")this._read=t.read;if(typeof t.destroy==="function")this._destroy=t.destroy}u.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function(t){if(!this._readableState){return}this._readableState.destroyed=t}});Readable.prototype.destroy=b.destroy;Readable.prototype._undestroy=b.undestroy;Readable.prototype._destroy=function(t,r){this.push(null);r(t)};Readable.prototype.push=function(t,r){var i=this._readableState;var o;if(!i.objectMode){if(typeof t==="string"){r=r||i.defaultEncoding;if(r!==i.encoding){t=h.from(t,r);r=""}o=true}}else{o=true}return readableAddChunk(this,t,r,false,o)};Readable.prototype.unshift=function(t){return readableAddChunk(this,t,null,true,false)};function readableAddChunk(t,r,i,o,a){var l=t._readableState;if(r===null){l.reading=false;onEofChunk(t,l)}else{var c;if(!a)c=chunkInvalid(l,r);if(c){t.emit("error",c)}else if(l.objectMode||r&&r.length>0){if(typeof r!=="string"&&!l.objectMode&&Object.getPrototypeOf(r)!==h.prototype){r=_uint8ArrayToBuffer(r)}if(o){if(l.endEmitted)t.emit("error",new Error("stream.unshift() after end event"));else addChunk(t,l,r,true)}else if(l.ended){t.emit("error",new Error("stream.push() after EOF"))}else{l.reading=false;if(l.decoder&&!i){r=l.decoder.write(r);if(l.objectMode||r.length!==0)addChunk(t,l,r,false);else maybeReadMore(t,l)}else{addChunk(t,l,r,false)}}}else if(!o){l.reading=false}}return needMoreData(l)}function addChunk(t,r,i,o){if(r.flowing&&r.length===0&&!r.sync){t.emit("data",i);t.read(0)}else{r.length+=r.objectMode?1:i.length;if(o)r.buffer.unshift(i);else r.buffer.push(i);if(r.needReadable)emitReadable(t)}maybeReadMore(t,r)}function chunkInvalid(t,r){var i;if(!_isUint8Array(r)&&typeof r!=="string"&&r!==undefined&&!t.objectMode){i=new TypeError("Invalid non-string/buffer chunk")}return i}function needMoreData(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||t.length===0)}Readable.prototype.isPaused=function(){return this._readableState.flowing===false};Readable.prototype.setEncoding=function(t){if(!v)v=i(4426).s;this._readableState.decoder=new v(t);this._readableState.encoding=t;return this};var w=8388608;function computeNewHighWaterMark(t){if(t>=w){t=w}else{t--;t|=t>>>1;t|=t>>>2;t|=t>>>4;t|=t>>>8;t|=t>>>16;t++}return t}function howMuchToRead(t,r){if(t<=0||r.length===0&&r.ended)return 0;if(r.objectMode)return 1;if(t!==t){if(r.flowing&&r.length)return r.buffer.head.data.length;else return r.length}if(t>r.highWaterMark)r.highWaterMark=computeNewHighWaterMark(t);if(t<=r.length)return t;if(!r.ended){r.needReadable=true;return 0}return r.length}Readable.prototype.read=function(t){y("read",t);t=parseInt(t,10);var r=this._readableState;var i=t;if(t!==0)r.emittedReadable=false;if(t===0&&r.needReadable&&(r.length>=r.highWaterMark||r.ended)){y("read: emitReadable",r.length,r.ended);if(r.length===0&&r.ended)endReadable(this);else emitReadable(this);return null}t=howMuchToRead(t,r);if(t===0&&r.ended){if(r.length===0)endReadable(this);return null}var o=r.needReadable;y("need readable",o);if(r.length===0||r.length-t<r.highWaterMark){o=true;y("length less than watermark",o)}if(r.ended||r.reading){o=false;y("reading or ended",o)}else if(o){y("do read");r.reading=true;r.sync=true;if(r.length===0)r.needReadable=true;this._read(r.highWaterMark);r.sync=false;if(!r.reading)t=howMuchToRead(i,r)}var a;if(t>0)a=fromList(t,r);else a=null;if(a===null){r.needReadable=true;t=0}else{r.length-=t}if(r.length===0){if(!r.ended)r.needReadable=true;if(i!==t&&r.ended)endReadable(this)}if(a!==null)this.emit("data",a);return a};function onEofChunk(t,r){if(r.ended)return;if(r.decoder){var i=r.decoder.end();if(i&&i.length){r.buffer.push(i);r.length+=r.objectMode?1:i.length}}r.ended=true;emitReadable(t)}function emitReadable(t){var r=t._readableState;r.needReadable=false;if(!r.emittedReadable){y("emitReadable",r.flowing);r.emittedReadable=true;if(r.sync)o.nextTick(emitReadable_,t);else emitReadable_(t)}}function emitReadable_(t){y("emit readable");t.emit("readable");flow(t)}function maybeReadMore(t,r){if(!r.readingMore){r.readingMore=true;o.nextTick(maybeReadMore_,t,r)}}function maybeReadMore_(t,r){var i=r.length;while(!r.reading&&!r.flowing&&!r.ended&&r.length<r.highWaterMark){y("maybeReadMore read 0");t.read(0);if(i===r.length)break;else i=r.length}r.readingMore=false}Readable.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))};Readable.prototype.pipe=function(t,r){var i=this;var a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t);break}a.pipesCount+=1;y("pipe count=%d opts=%j",a.pipesCount,r);var l=(!r||r.end!==false)&&t!==process.stdout&&t!==process.stderr;var c=l?onend:unpipe;if(a.endEmitted)o.nextTick(c);else i.once("end",c);t.on("unpipe",onunpipe);function onunpipe(t,r){y("onunpipe");if(t===i){if(r&&r.hasUnpiped===false){r.hasUnpiped=true;cleanup()}}}function onend(){y("onend");t.end()}var u=pipeOnDrain(i);t.on("drain",u);var h=false;function cleanup(){y("cleanup");t.removeListener("close",onclose);t.removeListener("finish",onfinish);t.removeListener("drain",u);t.removeListener("error",onerror);t.removeListener("unpipe",onunpipe);i.removeListener("end",onend);i.removeListener("end",unpipe);i.removeListener("data",ondata);h=true;if(a.awaitDrain&&(!t._writableState||t._writableState.needDrain))u()}var d=false;i.on("data",ondata);function ondata(r){y("ondata");d=false;var o=t.write(r);if(false===o&&!d){if((a.pipesCount===1&&a.pipes===t||a.pipesCount>1&&indexOf(a.pipes,t)!==-1)&&!h){y("false write response, pause",i._readableState.awaitDrain);i._readableState.awaitDrain++;d=true}i.pause()}}function onerror(r){y("onerror",r);unpipe();t.removeListener("error",onerror);if(EElistenerCount(t,"error")===0)t.emit("error",r)}prependListener(t,"error",onerror);function onclose(){t.removeListener("finish",onfinish);unpipe()}t.once("close",onclose);function onfinish(){y("onfinish");t.removeListener("close",onclose);unpipe()}t.once("finish",onfinish);function unpipe(){y("unpipe");i.unpipe(t)}t.emit("pipe",i);if(!a.flowing){y("pipe resume");i.resume()}return t};function pipeOnDrain(t){return function(){var r=t._readableState;y("pipeOnDrain",r.awaitDrain);if(r.awaitDrain)r.awaitDrain--;if(r.awaitDrain===0&&EElistenerCount(t,"data")){r.flowing=true;flow(t)}}}Readable.prototype.unpipe=function(t){var r=this._readableState;var i={hasUnpiped:false};if(r.pipesCount===0)return this;if(r.pipesCount===1){if(t&&t!==r.pipes)return this;if(!t)t=r.pipes;r.pipes=null;r.pipesCount=0;r.flowing=false;if(t)t.emit("unpipe",this,i);return this}if(!t){var o=r.pipes;var a=r.pipesCount;r.pipes=null;r.pipesCount=0;r.flowing=false;for(var l=0;l<a;l++){o[l].emit("unpipe",this,i)}return this}var c=indexOf(r.pipes,t);if(c===-1)return this;r.pipes.splice(c,1);r.pipesCount-=1;if(r.pipesCount===1)r.pipes=r.pipes[0];t.emit("unpipe",this,i);return this};Readable.prototype.on=function(t,r){var i=u.prototype.on.call(this,t,r);if(t==="data"){if(this._readableState.flowing!==false)this.resume()}else if(t==="readable"){var a=this._readableState;if(!a.endEmitted&&!a.readableListening){a.readableListening=a.needReadable=true;a.emittedReadable=false;if(!a.reading){o.nextTick(nReadingNextTick,this)}else if(a.length){emitReadable(this)}}}return i};Readable.prototype.addListener=Readable.prototype.on;function nReadingNextTick(t){y("readable nexttick read 0");t.read(0)}Readable.prototype.resume=function(){var t=this._readableState;if(!t.flowing){y("resume");t.flowing=true;resume(this,t)}return this};function resume(t,r){if(!r.resumeScheduled){r.resumeScheduled=true;o.nextTick(resume_,t,r)}}function resume_(t,r){if(!r.reading){y("resume read 0");t.read(0)}r.resumeScheduled=false;r.awaitDrain=0;t.emit("resume");flow(t);if(r.flowing&&!r.reading)t.read(0)}Readable.prototype.pause=function(){y("call pause flowing=%j",this._readableState.flowing);if(false!==this._readableState.flowing){y("pause");this._readableState.flowing=false;this.emit("pause")}return this};function flow(t){var r=t._readableState;y("flow",r.flowing);while(r.flowing&&t.read()!==null){}}Readable.prototype.wrap=function(t){var r=this;var i=this._readableState;var o=false;t.on("end",(function(){y("wrapped end");if(i.decoder&&!i.ended){var t=i.decoder.end();if(t&&t.length)r.push(t)}r.push(null)}));t.on("data",(function(a){y("wrapped data");if(i.decoder)a=i.decoder.write(a);if(i.objectMode&&(a===null||a===undefined))return;else if(!i.objectMode&&(!a||!a.length))return;var l=r.push(a);if(!l){o=true;t.pause()}}));for(var a in t){if(this[a]===undefined&&typeof t[a]==="function"){this[a]=function(r){return function(){return t[r].apply(t,arguments)}}(a)}}for(var l=0;l<_.length;l++){t.on(_[l],this.emit.bind(this,_[l]))}this._read=function(r){y("wrapped _read",r);if(o){o=false;t.resume()}};return this};Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:false,get:function(){return this._readableState.highWaterMark}});Readable._fromList=fromList;function fromList(t,r){if(r.length===0)return null;var i;if(r.objectMode)i=r.buffer.shift();else if(!t||t>=r.length){if(r.decoder)i=r.buffer.join("");else if(r.buffer.length===1)i=r.buffer.head.data;else i=r.buffer.concat(r.length);r.buffer.clear()}else{i=fromListPartial(t,r.buffer,r.decoder)}return i}function fromListPartial(t,r,i){var o;if(t<r.head.data.length){o=r.head.data.slice(0,t);r.head.data=r.head.data.slice(t)}else if(t===r.head.data.length){o=r.shift()}else{o=i?copyFromBufferString(t,r):copyFromBuffer(t,r)}return o}function copyFromBufferString(t,r){var i=r.head;var o=1;var a=i.data;t-=a.length;while(i=i.next){var l=i.data;var c=t>l.length?l.length:t;if(c===l.length)a+=l;else a+=l.slice(0,t);t-=c;if(t===0){if(c===l.length){++o;if(i.next)r.head=i.next;else r.head=r.tail=null}else{r.head=i;i.data=l.slice(c)}break}++o}r.length-=o;return a}function copyFromBuffer(t,r){var i=h.allocUnsafe(t);var o=r.head;var a=1;o.data.copy(i);t-=o.data.length;while(o=o.next){var l=o.data;var c=t>l.length?l.length:t;l.copy(i,i.length-t,0,c);t-=c;if(t===0){if(c===l.length){++a;if(o.next)r.head=o.next;else r.head=r.tail=null}else{r.head=o;o.data=l.slice(c)}break}++a}r.length-=a;return i}function endReadable(t){var r=t._readableState;if(r.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!r.endEmitted){r.ended=true;o.nextTick(endReadableNT,r,t)}}function endReadableNT(t,r){if(!t.endEmitted&&t.length===0){t.endEmitted=true;r.readable=false;r.emit("end")}}function indexOf(t,r){for(var i=0,o=t.length;i<o;i++){if(t[i]===r)return i}return-1}},2162:(t,r,i)=>{"use strict";t.exports=Transform;var o=i(4928);var a=Object.create(i(642));a.inherits=i(2842);a.inherits(Transform,o);function afterTransform(t,r){var i=this._transformState;i.transforming=false;var o=i.writecb;if(!o){return this.emit("error",new Error("write callback called multiple times"))}i.writechunk=null;i.writecb=null;if(r!=null)this.push(r);o(t);var a=this._readableState;a.reading=false;if(a.needReadable||a.length<a.highWaterMark){this._read(a.highWaterMark)}}function Transform(t){if(!(this instanceof Transform))return new Transform(t);o.call(this,t);this._transformState={afterTransform:afterTransform.bind(this),needTransform:false,transforming:false,writecb:null,writechunk:null,writeencoding:null};this._readableState.needReadable=true;this._readableState.sync=false;if(t){if(typeof t.transform==="function")this._transform=t.transform;if(typeof t.flush==="function")this._flush=t.flush}this.on("prefinish",prefinish)}function prefinish(){var t=this;if(typeof this._flush==="function"){this._flush((function(r,i){done(t,r,i)}))}else{done(this,null,null)}}Transform.prototype.push=function(t,r){this._transformState.needTransform=false;return o.prototype.push.call(this,t,r)};Transform.prototype._transform=function(t,r,i){throw new Error("_transform() is not implemented")};Transform.prototype._write=function(t,r,i){var o=this._transformState;o.writecb=i;o.writechunk=t;o.writeencoding=r;if(!o.transforming){var a=this._readableState;if(o.needTransform||a.needReadable||a.length<a.highWaterMark)this._read(a.highWaterMark)}};Transform.prototype._read=function(t){var r=this._transformState;if(r.writechunk!==null&&r.writecb&&!r.transforming){r.transforming=true;this._transform(r.writechunk,r.writeencoding,r.afterTransform)}else{r.needTransform=true}};Transform.prototype._destroy=function(t,r){var i=this;o.prototype._destroy.call(this,t,(function(t){r(t);i.emit("close")}))};function done(t,r,i){if(r)return t.emit("error",r);if(i!=null)t.push(i);if(t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}},3517:(t,r,i)=>{"use strict";var o=i(9182);t.exports=Writable;function WriteReq(t,r,i){this.chunk=t;this.encoding=r;this.callback=i;this.next=null}function CorkedRequest(t){var r=this;this.next=null;this.entry=null;this.finish=function(){onCorkedFinish(r,t)}}var a=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:o.nextTick;var l;Writable.WritableState=WritableState;var c=Object.create(i(642));c.inherits=i(2842);var u={deprecate:i(6124)};var h=i(2641);var d=i(291).Buffer;var p=global.Uint8Array||function(){};function _uint8ArrayToBuffer(t){return d.from(t)}function _isUint8Array(t){return d.isBuffer(t)||t instanceof p}var m=i(2604);c.inherits(Writable,h);function nop(){}function WritableState(t,r){l=l||i(4928);t=t||{};var o=r instanceof l;this.objectMode=!!t.objectMode;if(o)this.objectMode=this.objectMode||!!t.writableObjectMode;var a=t.highWaterMark;var c=t.writableHighWaterMark;var u=this.objectMode?16:16*1024;if(a||a===0)this.highWaterMark=a;else if(o&&(c||c===0))this.highWaterMark=c;else this.highWaterMark=u;this.highWaterMark=Math.floor(this.highWaterMark);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var h=t.decodeStrings===false;this.decodeStrings=!h;this.defaultEncoding=t.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(t){onwrite(r,t)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function getBuffer(){var t=this.bufferedRequest;var r=[];while(t){r.push(t);t=t.next}return r};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:u.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(t){}})();var y;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){y=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function(t){if(y.call(this,t))return true;if(this!==Writable)return false;return t&&t._writableState instanceof WritableState}})}else{y=function(t){return t instanceof this}}function Writable(t){l=l||i(4928);if(!y.call(Writable,this)&&!(this instanceof l)){return new Writable(t)}this._writableState=new WritableState(t,this);this.writable=true;if(t){if(typeof t.write==="function")this._write=t.write;if(typeof t.writev==="function")this._writev=t.writev;if(typeof t.destroy==="function")this._destroy=t.destroy;if(typeof t.final==="function")this._final=t.final}h.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(t,r){var i=new Error("write after end");t.emit("error",i);o.nextTick(r,i)}function validChunk(t,r,i,a){var l=true;var c=false;if(i===null){c=new TypeError("May not write null values to stream")}else if(typeof i!=="string"&&i!==undefined&&!r.objectMode){c=new TypeError("Invalid non-string/buffer chunk")}if(c){t.emit("error",c);o.nextTick(a,c);l=false}return l}Writable.prototype.write=function(t,r,i){var o=this._writableState;var a=false;var l=!o.objectMode&&_isUint8Array(t);if(l&&!d.isBuffer(t)){t=_uint8ArrayToBuffer(t)}if(typeof r==="function"){i=r;r=null}if(l)r="buffer";else if(!r)r=o.defaultEncoding;if(typeof i!=="function")i=nop;if(o.ended)writeAfterEnd(this,i);else if(l||validChunk(this,o,t,i)){o.pendingcb++;a=writeOrBuffer(this,o,l,t,r,i)}return a};Writable.prototype.cork=function(){var t=this._writableState;t.corked++};Writable.prototype.uncork=function(){var t=this._writableState;if(t.corked){t.corked--;if(!t.writing&&!t.corked&&!t.finished&&!t.bufferProcessing&&t.bufferedRequest)clearBuffer(this,t)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(t){if(typeof t==="string")t=t.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);this._writableState.defaultEncoding=t;return this};function decodeChunk(t,r,i){if(!t.objectMode&&t.decodeStrings!==false&&typeof r==="string"){r=d.from(r,i)}return r}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(t,r,i,o,a,l){if(!i){var c=decodeChunk(r,o,a);if(o!==c){i=true;a="buffer";o=c}}var u=r.objectMode?1:o.length;r.length+=u;var h=r.length<r.highWaterMark;if(!h)r.needDrain=true;if(r.writing||r.corked){var d=r.lastBufferedRequest;r.lastBufferedRequest={chunk:o,encoding:a,isBuf:i,callback:l,next:null};if(d){d.next=r.lastBufferedRequest}else{r.bufferedRequest=r.lastBufferedRequest}r.bufferedRequestCount+=1}else{doWrite(t,r,false,u,o,a,l)}return h}function doWrite(t,r,i,o,a,l,c){r.writelen=o;r.writecb=c;r.writing=true;r.sync=true;if(i)t._writev(a,r.onwrite);else t._write(a,l,r.onwrite);r.sync=false}function onwriteError(t,r,i,a,l){--r.pendingcb;if(i){o.nextTick(l,a);o.nextTick(finishMaybe,t,r);t._writableState.errorEmitted=true;t.emit("error",a)}else{l(a);t._writableState.errorEmitted=true;t.emit("error",a);finishMaybe(t,r)}}function onwriteStateUpdate(t){t.writing=false;t.writecb=null;t.length-=t.writelen;t.writelen=0}function onwrite(t,r){var i=t._writableState;var o=i.sync;var l=i.writecb;onwriteStateUpdate(i);if(r)onwriteError(t,i,o,r,l);else{var c=needFinish(i);if(!c&&!i.corked&&!i.bufferProcessing&&i.bufferedRequest){clearBuffer(t,i)}if(o){a(afterWrite,t,i,c,l)}else{afterWrite(t,i,c,l)}}}function afterWrite(t,r,i,o){if(!i)onwriteDrain(t,r);r.pendingcb--;o();finishMaybe(t,r)}function onwriteDrain(t,r){if(r.length===0&&r.needDrain){r.needDrain=false;t.emit("drain")}}function clearBuffer(t,r){r.bufferProcessing=true;var i=r.bufferedRequest;if(t._writev&&i&&i.next){var o=r.bufferedRequestCount;var a=new Array(o);var l=r.corkedRequestsFree;l.entry=i;var c=0;var u=true;while(i){a[c]=i;if(!i.isBuf)u=false;i=i.next;c+=1}a.allBuffers=u;doWrite(t,r,true,r.length,a,"",l.finish);r.pendingcb++;r.lastBufferedRequest=null;if(l.next){r.corkedRequestsFree=l.next;l.next=null}else{r.corkedRequestsFree=new CorkedRequest(r)}r.bufferedRequestCount=0}else{while(i){var h=i.chunk;var d=i.encoding;var p=i.callback;var m=r.objectMode?1:h.length;doWrite(t,r,false,m,h,d,p);i=i.next;r.bufferedRequestCount--;if(r.writing){break}}if(i===null)r.lastBufferedRequest=null}r.bufferedRequest=i;r.bufferProcessing=false}Writable.prototype._write=function(t,r,i){i(new Error("_write() is not implemented"))};Writable.prototype._writev=null;Writable.prototype.end=function(t,r,i){var o=this._writableState;if(typeof t==="function"){i=t;t=null;r=null}else if(typeof r==="function"){i=r;r=null}if(t!==null&&t!==undefined)this.write(t,r);if(o.corked){o.corked=1;this.uncork()}if(!o.ending&&!o.finished)endWritable(this,o,i)};function needFinish(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function callFinal(t,r){t._final((function(i){r.pendingcb--;if(i){t.emit("error",i)}r.prefinished=true;t.emit("prefinish");finishMaybe(t,r)}))}function prefinish(t,r){if(!r.prefinished&&!r.finalCalled){if(typeof t._final==="function"){r.pendingcb++;r.finalCalled=true;o.nextTick(callFinal,t,r)}else{r.prefinished=true;t.emit("prefinish")}}}function finishMaybe(t,r){var i=needFinish(r);if(i){prefinish(t,r);if(r.pendingcb===0){r.finished=true;t.emit("finish")}}return i}function endWritable(t,r,i){r.ending=true;finishMaybe(t,r);if(i){if(r.finished)o.nextTick(i);else t.once("finish",i)}r.ended=true;t.writable=false}function onCorkedFinish(t,r,i){var o=t.entry;t.entry=null;while(o){var a=o.callback;r.pendingcb--;a(i);o=o.next}if(r.corkedRequestsFree){r.corkedRequestsFree.next=t}else{r.corkedRequestsFree=t}}Object.defineProperty(Writable.prototype,"destroyed",{get:function(){if(this._writableState===undefined){return false}return this._writableState.destroyed},set:function(t){if(!this._writableState){return}this._writableState.destroyed=t}});Writable.prototype.destroy=m.destroy;Writable.prototype._undestroy=m.undestroy;Writable.prototype._destroy=function(t,r){this.end();r(t)}},4865:(t,r,i)=>{"use strict";function _classCallCheck(t,r){if(!(t instanceof r)){throw new TypeError("Cannot call a class as a function")}}var o=i(291).Buffer;var a=i(3837);function copyBuffer(t,r,i){t.copy(r,i)}t.exports=function(){function BufferList(){_classCallCheck(this,BufferList);this.head=null;this.tail=null;this.length=0}BufferList.prototype.push=function push(t){var r={data:t,next:null};if(this.length>0)this.tail.next=r;else this.head=r;this.tail=r;++this.length};BufferList.prototype.unshift=function unshift(t){var r={data:t,next:this.head};if(this.length===0)this.tail=r;this.head=r;++this.length};BufferList.prototype.shift=function shift(){if(this.length===0)return;var t=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return t};BufferList.prototype.clear=function clear(){this.head=this.tail=null;this.length=0};BufferList.prototype.join=function join(t){if(this.length===0)return"";var r=this.head;var i=""+r.data;while(r=r.next){i+=t+r.data}return i};BufferList.prototype.concat=function concat(t){if(this.length===0)return o.alloc(0);if(this.length===1)return this.head.data;var r=o.allocUnsafe(t>>>0);var i=this.head;var a=0;while(i){copyBuffer(i.data,r,a);a+=i.data.length;i=i.next}return r};return BufferList}();if(a&&a.inspect&&a.inspect.custom){t.exports.prototype[a.inspect.custom]=function(){var t=a.inspect({length:this.length});return this.constructor.name+" "+t}}},2604:(t,r,i)=>{"use strict";var o=i(9182);function destroy(t,r){var i=this;var a=this._readableState&&this._readableState.destroyed;var l=this._writableState&&this._writableState.destroyed;if(a||l){if(r){r(t)}else if(t&&(!this._writableState||!this._writableState.errorEmitted)){o.nextTick(emitErrorNT,this,t)}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(t||null,(function(t){if(!r&&t){o.nextTick(emitErrorNT,i,t);if(i._writableState){i._writableState.errorEmitted=true}}else if(r){r(t)}}));return this}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(t,r){t.emit("error",r)}t.exports={destroy:destroy,undestroy:undestroy}},2641:(t,r,i)=>{t.exports=i(2781)},4088:(t,r,i)=>{t.exports=i(8511).PassThrough},8511:(t,r,i)=>{var o=i(2781);if(process.env.READABLE_STREAM==="disable"&&o){t.exports=o;r=t.exports=o.Readable;r.Readable=o.Readable;r.Writable=o.Writable;r.Duplex=o.Duplex;r.Transform=o.Transform;r.PassThrough=o.PassThrough;r.Stream=o}else{r=t.exports=i(7355);r.Stream=o||r;r.Readable=r;r.Writable=i(3517);r.Duplex=i(4928);r.Transform=i(2162);r.PassThrough=i(9924)}},4646:t=>{"use strict";const r={};function createErrorType(t,i,o){if(!o){o=Error}function getMessage(t,r,o){if(typeof i==="string"){return i}else{return i(t,r,o)}}class NodeError extends o{constructor(t,r,i){super(getMessage(t,r,i))}}NodeError.prototype.name=o.name;NodeError.prototype.code=t;r[t]=NodeError}function oneOf(t,r){if(Array.isArray(t)){const i=t.length;t=t.map((t=>String(t)));if(i>2){return`one of ${r} ${t.slice(0,i-1).join(", ")}, or `+t[i-1]}else if(i===2){return`one of ${r} ${t[0]} or ${t[1]}`}else{return`of ${r} ${t[0]}`}}else{return`of ${r} ${String(t)}`}}function startsWith(t,r,i){return t.substr(!i||i<0?0:+i,r.length)===r}function endsWith(t,r,i){if(i===undefined||i>t.length){i=t.length}return t.substring(i-r.length,i)===r}function includes(t,r,i){if(typeof i!=="number"){i=0}if(i+r.length>t.length){return false}else{return t.indexOf(r,i)!==-1}}createErrorType("ERR_INVALID_OPT_VALUE",(function(t,r){return'The value "'+r+'" is invalid for option "'+t+'"'}),TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(t,r,i){let o;if(typeof r==="string"&&startsWith(r,"not ")){o="must not be";r=r.replace(/^not /,"")}else{o="must be"}let a;if(endsWith(t," argument")){a=`The ${t} ${o} ${oneOf(r,"type")}`}else{const i=includes(t,".")?"property":"argument";a=`The "${t}" ${i} ${o} ${oneOf(r,"type")}`}a+=`. Received type ${typeof i}`;return a}),TypeError);createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"}));createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close");createErrorType("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"}));createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times");createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);createErrorType("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError);createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");t.exports.q=r},2403:(t,r,i)=>{"use strict";var o=Object.keys||function(t){var r=[];for(var i in t){r.push(i)}return r};t.exports=Duplex;var a=i(1709);var l=i(7337);i(2842)(Duplex,a);{var c=o(l.prototype);for(var u=0;u<c.length;u++){var h=c[u];if(!Duplex.prototype[h])Duplex.prototype[h]=l.prototype[h]}}function Duplex(t){if(!(this instanceof Duplex))return new Duplex(t);a.call(this,t);l.call(this,t);this.allowHalfOpen=true;if(t){if(t.readable===false)this.readable=false;if(t.writable===false)this.writable=false;if(t.allowHalfOpen===false){this.allowHalfOpen=false;this.once("end",onend)}}}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});Object.defineProperty(Duplex.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Duplex.prototype,"writableLength",{enumerable:false,get:function get(){return this._writableState.length}});function onend(){if(this._writableState.ended)return;process.nextTick(onEndNT,this)}function onEndNT(t){t.end()}Object.defineProperty(Duplex.prototype,"destroyed",{enumerable:false,get:function get(){if(this._readableState===undefined||this._writableState===undefined){return false}return this._readableState.destroyed&&this._writableState.destroyed},set:function set(t){if(this._readableState===undefined||this._writableState===undefined){return}this._readableState.destroyed=t;this._writableState.destroyed=t}})},7889:(t,r,i)=>{"use strict";t.exports=PassThrough;var o=i(1170);i(2842)(PassThrough,o);function PassThrough(t){if(!(this instanceof PassThrough))return new PassThrough(t);o.call(this,t)}PassThrough.prototype._transform=function(t,r,i){i(null,t)}},1709:(t,r,i)=>{"use strict";t.exports=Readable;var o;Readable.ReadableState=ReadableState;var a=i(2361).EventEmitter;var l=function EElistenerCount(t,r){return t.listeners(r).length};var c=i(4678);var u=i(4300).Buffer;var h=global.Uint8Array||function(){};function _uint8ArrayToBuffer(t){return u.from(t)}function _isUint8Array(t){return u.isBuffer(t)||t instanceof h}var d=i(3837);var p;if(d&&d.debuglog){p=d.debuglog("stream")}else{p=function debug(){}}var m=i(4379);var y=i(7025);var g=i(6776),b=g.getHighWaterMark;var v=i(4646).q,_=v.ERR_INVALID_ARG_TYPE,w=v.ERR_STREAM_PUSH_AFTER_EOF,E=v.ERR_METHOD_NOT_IMPLEMENTED,S=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;var O;var R;var x;i(2842)(Readable,c);var k=y.errorOrDestroy;var T=["error","close","destroy","pause","resume"];function prependListener(t,r,i){if(typeof t.prependListener==="function")return t.prependListener(r,i);if(!t._events||!t._events[r])t.on(r,i);else if(Array.isArray(t._events[r]))t._events[r].unshift(i);else t._events[r]=[i,t._events[r]]}function ReadableState(t,r,a){o=o||i(2403);t=t||{};if(typeof a!=="boolean")a=r instanceof o;this.objectMode=!!t.objectMode;if(a)this.objectMode=this.objectMode||!!t.readableObjectMode;this.highWaterMark=b(this,t,"readableHighWaterMark",a);this.buffer=new m;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.paused=true;this.emitClose=t.emitClose!==false;this.autoDestroy=!!t.autoDestroy;this.destroyed=false;this.defaultEncoding=t.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(t.encoding){if(!O)O=i(3704).s;this.decoder=new O(t.encoding);this.encoding=t.encoding}}function Readable(t){o=o||i(2403);if(!(this instanceof Readable))return new Readable(t);var r=this instanceof o;this._readableState=new ReadableState(t,this,r);this.readable=true;if(t){if(typeof t.read==="function")this._read=t.read;if(typeof t.destroy==="function")this._destroy=t.destroy}c.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{enumerable:false,get:function get(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function set(t){if(!this._readableState){return}this._readableState.destroyed=t}});Readable.prototype.destroy=y.destroy;Readable.prototype._undestroy=y.undestroy;Readable.prototype._destroy=function(t,r){r(t)};Readable.prototype.push=function(t,r){var i=this._readableState;var o;if(!i.objectMode){if(typeof t==="string"){r=r||i.defaultEncoding;if(r!==i.encoding){t=u.from(t,r);r=""}o=true}}else{o=true}return readableAddChunk(this,t,r,false,o)};Readable.prototype.unshift=function(t){return readableAddChunk(this,t,null,true,false)};function readableAddChunk(t,r,i,o,a){p("readableAddChunk",r);var l=t._readableState;if(r===null){l.reading=false;onEofChunk(t,l)}else{var c;if(!a)c=chunkInvalid(l,r);if(c){k(t,c)}else if(l.objectMode||r&&r.length>0){if(typeof r!=="string"&&!l.objectMode&&Object.getPrototypeOf(r)!==u.prototype){r=_uint8ArrayToBuffer(r)}if(o){if(l.endEmitted)k(t,new S);else addChunk(t,l,r,true)}else if(l.ended){k(t,new w)}else if(l.destroyed){return false}else{l.reading=false;if(l.decoder&&!i){r=l.decoder.write(r);if(l.objectMode||r.length!==0)addChunk(t,l,r,false);else maybeReadMore(t,l)}else{addChunk(t,l,r,false)}}}else if(!o){l.reading=false;maybeReadMore(t,l)}}return!l.ended&&(l.length<l.highWaterMark||l.length===0)}function addChunk(t,r,i,o){if(r.flowing&&r.length===0&&!r.sync){r.awaitDrain=0;t.emit("data",i)}else{r.length+=r.objectMode?1:i.length;if(o)r.buffer.unshift(i);else r.buffer.push(i);if(r.needReadable)emitReadable(t)}maybeReadMore(t,r)}function chunkInvalid(t,r){var i;if(!_isUint8Array(r)&&typeof r!=="string"&&r!==undefined&&!t.objectMode){i=new _("chunk",["string","Buffer","Uint8Array"],r)}return i}Readable.prototype.isPaused=function(){return this._readableState.flowing===false};Readable.prototype.setEncoding=function(t){if(!O)O=i(3704).s;var r=new O(t);this._readableState.decoder=r;this._readableState.encoding=this._readableState.decoder.encoding;var o=this._readableState.buffer.head;var a="";while(o!==null){a+=r.write(o.data);o=o.next}this._readableState.buffer.clear();if(a!=="")this._readableState.buffer.push(a);this._readableState.length=a.length;return this};var A=1073741824;function computeNewHighWaterMark(t){if(t>=A){t=A}else{t--;t|=t>>>1;t|=t>>>2;t|=t>>>4;t|=t>>>8;t|=t>>>16;t++}return t}function howMuchToRead(t,r){if(t<=0||r.length===0&&r.ended)return 0;if(r.objectMode)return 1;if(t!==t){if(r.flowing&&r.length)return r.buffer.head.data.length;else return r.length}if(t>r.highWaterMark)r.highWaterMark=computeNewHighWaterMark(t);if(t<=r.length)return t;if(!r.ended){r.needReadable=true;return 0}return r.length}Readable.prototype.read=function(t){p("read",t);t=parseInt(t,10);var r=this._readableState;var i=t;if(t!==0)r.emittedReadable=false;if(t===0&&r.needReadable&&((r.highWaterMark!==0?r.length>=r.highWaterMark:r.length>0)||r.ended)){p("read: emitReadable",r.length,r.ended);if(r.length===0&&r.ended)endReadable(this);else emitReadable(this);return null}t=howMuchToRead(t,r);if(t===0&&r.ended){if(r.length===0)endReadable(this);return null}var o=r.needReadable;p("need readable",o);if(r.length===0||r.length-t<r.highWaterMark){o=true;p("length less than watermark",o)}if(r.ended||r.reading){o=false;p("reading or ended",o)}else if(o){p("do read");r.reading=true;r.sync=true;if(r.length===0)r.needReadable=true;this._read(r.highWaterMark);r.sync=false;if(!r.reading)t=howMuchToRead(i,r)}var a;if(t>0)a=fromList(t,r);else a=null;if(a===null){r.needReadable=r.length<=r.highWaterMark;t=0}else{r.length-=t;r.awaitDrain=0}if(r.length===0){if(!r.ended)r.needReadable=true;if(i!==t&&r.ended)endReadable(this)}if(a!==null)this.emit("data",a);return a};function onEofChunk(t,r){p("onEofChunk");if(r.ended)return;if(r.decoder){var i=r.decoder.end();if(i&&i.length){r.buffer.push(i);r.length+=r.objectMode?1:i.length}}r.ended=true;if(r.sync){emitReadable(t)}else{r.needReadable=false;if(!r.emittedReadable){r.emittedReadable=true;emitReadable_(t)}}}function emitReadable(t){var r=t._readableState;p("emitReadable",r.needReadable,r.emittedReadable);r.needReadable=false;if(!r.emittedReadable){p("emitReadable",r.flowing);r.emittedReadable=true;process.nextTick(emitReadable_,t)}}function emitReadable_(t){var r=t._readableState;p("emitReadable_",r.destroyed,r.length,r.ended);if(!r.destroyed&&(r.length||r.ended)){t.emit("readable");r.emittedReadable=false}r.needReadable=!r.flowing&&!r.ended&&r.length<=r.highWaterMark;flow(t)}function maybeReadMore(t,r){if(!r.readingMore){r.readingMore=true;process.nextTick(maybeReadMore_,t,r)}}function maybeReadMore_(t,r){while(!r.reading&&!r.ended&&(r.length<r.highWaterMark||r.flowing&&r.length===0)){var i=r.length;p("maybeReadMore read 0");t.read(0);if(i===r.length)break}r.readingMore=false}Readable.prototype._read=function(t){k(this,new E("_read()"))};Readable.prototype.pipe=function(t,r){var i=this;var o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t);break}o.pipesCount+=1;p("pipe count=%d opts=%j",o.pipesCount,r);var a=(!r||r.end!==false)&&t!==process.stdout&&t!==process.stderr;var c=a?onend:unpipe;if(o.endEmitted)process.nextTick(c);else i.once("end",c);t.on("unpipe",onunpipe);function onunpipe(t,r){p("onunpipe");if(t===i){if(r&&r.hasUnpiped===false){r.hasUnpiped=true;cleanup()}}}function onend(){p("onend");t.end()}var u=pipeOnDrain(i);t.on("drain",u);var h=false;function cleanup(){p("cleanup");t.removeListener("close",onclose);t.removeListener("finish",onfinish);t.removeListener("drain",u);t.removeListener("error",onerror);t.removeListener("unpipe",onunpipe);i.removeListener("end",onend);i.removeListener("end",unpipe);i.removeListener("data",ondata);h=true;if(o.awaitDrain&&(!t._writableState||t._writableState.needDrain))u()}i.on("data",ondata);function ondata(r){p("ondata");var a=t.write(r);p("dest.write",a);if(a===false){if((o.pipesCount===1&&o.pipes===t||o.pipesCount>1&&indexOf(o.pipes,t)!==-1)&&!h){p("false write response, pause",o.awaitDrain);o.awaitDrain++}i.pause()}}function onerror(r){p("onerror",r);unpipe();t.removeListener("error",onerror);if(l(t,"error")===0)k(t,r)}prependListener(t,"error",onerror);function onclose(){t.removeListener("finish",onfinish);unpipe()}t.once("close",onclose);function onfinish(){p("onfinish");t.removeListener("close",onclose);unpipe()}t.once("finish",onfinish);function unpipe(){p("unpipe");i.unpipe(t)}t.emit("pipe",i);if(!o.flowing){p("pipe resume");i.resume()}return t};function pipeOnDrain(t){return function pipeOnDrainFunctionResult(){var r=t._readableState;p("pipeOnDrain",r.awaitDrain);if(r.awaitDrain)r.awaitDrain--;if(r.awaitDrain===0&&l(t,"data")){r.flowing=true;flow(t)}}}Readable.prototype.unpipe=function(t){var r=this._readableState;var i={hasUnpiped:false};if(r.pipesCount===0)return this;if(r.pipesCount===1){if(t&&t!==r.pipes)return this;if(!t)t=r.pipes;r.pipes=null;r.pipesCount=0;r.flowing=false;if(t)t.emit("unpipe",this,i);return this}if(!t){var o=r.pipes;var a=r.pipesCount;r.pipes=null;r.pipesCount=0;r.flowing=false;for(var l=0;l<a;l++){o[l].emit("unpipe",this,{hasUnpiped:false})}return this}var c=indexOf(r.pipes,t);if(c===-1)return this;r.pipes.splice(c,1);r.pipesCount-=1;if(r.pipesCount===1)r.pipes=r.pipes[0];t.emit("unpipe",this,i);return this};Readable.prototype.on=function(t,r){var i=c.prototype.on.call(this,t,r);var o=this._readableState;if(t==="data"){o.readableListening=this.listenerCount("readable")>0;if(o.flowing!==false)this.resume()}else if(t==="readable"){if(!o.endEmitted&&!o.readableListening){o.readableListening=o.needReadable=true;o.flowing=false;o.emittedReadable=false;p("on readable",o.length,o.reading);if(o.length){emitReadable(this)}else if(!o.reading){process.nextTick(nReadingNextTick,this)}}}return i};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.removeListener=function(t,r){var i=c.prototype.removeListener.call(this,t,r);if(t==="readable"){process.nextTick(updateReadableListening,this)}return i};Readable.prototype.removeAllListeners=function(t){var r=c.prototype.removeAllListeners.apply(this,arguments);if(t==="readable"||t===undefined){process.nextTick(updateReadableListening,this)}return r};function updateReadableListening(t){var r=t._readableState;r.readableListening=t.listenerCount("readable")>0;if(r.resumeScheduled&&!r.paused){r.flowing=true}else if(t.listenerCount("data")>0){t.resume()}}function nReadingNextTick(t){p("readable nexttick read 0");t.read(0)}Readable.prototype.resume=function(){var t=this._readableState;if(!t.flowing){p("resume");t.flowing=!t.readableListening;resume(this,t)}t.paused=false;return this};function resume(t,r){if(!r.resumeScheduled){r.resumeScheduled=true;process.nextTick(resume_,t,r)}}function resume_(t,r){p("resume",r.reading);if(!r.reading){t.read(0)}r.resumeScheduled=false;t.emit("resume");flow(t);if(r.flowing&&!r.reading)t.read(0)}Readable.prototype.pause=function(){p("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){p("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function flow(t){var r=t._readableState;p("flow",r.flowing);while(r.flowing&&t.read()!==null){}}Readable.prototype.wrap=function(t){var r=this;var i=this._readableState;var o=false;t.on("end",(function(){p("wrapped end");if(i.decoder&&!i.ended){var t=i.decoder.end();if(t&&t.length)r.push(t)}r.push(null)}));t.on("data",(function(a){p("wrapped data");if(i.decoder)a=i.decoder.write(a);if(i.objectMode&&(a===null||a===undefined))return;else if(!i.objectMode&&(!a||!a.length))return;var l=r.push(a);if(!l){o=true;t.pause()}}));for(var a in t){if(this[a]===undefined&&typeof t[a]==="function"){this[a]=function methodWrap(r){return function methodWrapReturnFunction(){return t[r].apply(t,arguments)}}(a)}}for(var l=0;l<T.length;l++){t.on(T[l],this.emit.bind(this,T[l]))}this._read=function(r){p("wrapped _read",r);if(o){o=false;t.resume()}};return this};if(typeof Symbol==="function"){Readable.prototype[Symbol.asyncIterator]=function(){if(R===undefined){R=i(6871)}return R(this)}}Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:false,get:function get(){return this._readableState.highWaterMark}});Object.defineProperty(Readable.prototype,"readableBuffer",{enumerable:false,get:function get(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Readable.prototype,"readableFlowing",{enumerable:false,get:function get(){return this._readableState.flowing},set:function set(t){if(this._readableState){this._readableState.flowing=t}}});Readable._fromList=fromList;Object.defineProperty(Readable.prototype,"readableLength",{enumerable:false,get:function get(){return this._readableState.length}});function fromList(t,r){if(r.length===0)return null;var i;if(r.objectMode)i=r.buffer.shift();else if(!t||t>=r.length){if(r.decoder)i=r.buffer.join("");else if(r.buffer.length===1)i=r.buffer.first();else i=r.buffer.concat(r.length);r.buffer.clear()}else{i=r.buffer.consume(t,r.decoder)}return i}function endReadable(t){var r=t._readableState;p("endReadable",r.endEmitted);if(!r.endEmitted){r.ended=true;process.nextTick(endReadableNT,r,t)}}function endReadableNT(t,r){p("endReadableNT",t.endEmitted,t.length);if(!t.endEmitted&&t.length===0){t.endEmitted=true;r.readable=false;r.emit("end");if(t.autoDestroy){var i=r._writableState;if(!i||i.autoDestroy&&i.finished){r.destroy()}}}}if(typeof Symbol==="function"){Readable.from=function(t,r){if(x===undefined){x=i(9727)}return x(Readable,t,r)}}function indexOf(t,r){for(var i=0,o=t.length;i<o;i++){if(t[i]===r)return i}return-1}},1170:(t,r,i)=>{"use strict";t.exports=Transform;var o=i(4646).q,a=o.ERR_METHOD_NOT_IMPLEMENTED,l=o.ERR_MULTIPLE_CALLBACK,c=o.ERR_TRANSFORM_ALREADY_TRANSFORMING,u=o.ERR_TRANSFORM_WITH_LENGTH_0;var h=i(2403);i(2842)(Transform,h);function afterTransform(t,r){var i=this._transformState;i.transforming=false;var o=i.writecb;if(o===null){return this.emit("error",new l)}i.writechunk=null;i.writecb=null;if(r!=null)this.push(r);o(t);var a=this._readableState;a.reading=false;if(a.needReadable||a.length<a.highWaterMark){this._read(a.highWaterMark)}}function Transform(t){if(!(this instanceof Transform))return new Transform(t);h.call(this,t);this._transformState={afterTransform:afterTransform.bind(this),needTransform:false,transforming:false,writecb:null,writechunk:null,writeencoding:null};this._readableState.needReadable=true;this._readableState.sync=false;if(t){if(typeof t.transform==="function")this._transform=t.transform;if(typeof t.flush==="function")this._flush=t.flush}this.on("prefinish",prefinish)}function prefinish(){var t=this;if(typeof this._flush==="function"&&!this._readableState.destroyed){this._flush((function(r,i){done(t,r,i)}))}else{done(this,null,null)}}Transform.prototype.push=function(t,r){this._transformState.needTransform=false;return h.prototype.push.call(this,t,r)};Transform.prototype._transform=function(t,r,i){i(new a("_transform()"))};Transform.prototype._write=function(t,r,i){var o=this._transformState;o.writecb=i;o.writechunk=t;o.writeencoding=r;if(!o.transforming){var a=this._readableState;if(o.needTransform||a.needReadable||a.length<a.highWaterMark)this._read(a.highWaterMark)}};Transform.prototype._read=function(t){var r=this._transformState;if(r.writechunk!==null&&!r.transforming){r.transforming=true;this._transform(r.writechunk,r.writeencoding,r.afterTransform)}else{r.needTransform=true}};Transform.prototype._destroy=function(t,r){h.prototype._destroy.call(this,t,(function(t){r(t)}))};function done(t,r,i){if(r)return t.emit("error",r);if(i!=null)t.push(i);if(t._writableState.length)throw new u;if(t._transformState.transforming)throw new c;return t.push(null)}},7337:(t,r,i)=>{"use strict";t.exports=Writable;function WriteReq(t,r,i){this.chunk=t;this.encoding=r;this.callback=i;this.next=null}function CorkedRequest(t){var r=this;this.next=null;this.entry=null;this.finish=function(){onCorkedFinish(r,t)}}var o;Writable.WritableState=WritableState;var a={deprecate:i(6124)};var l=i(4678);var c=i(4300).Buffer;var u=global.Uint8Array||function(){};function _uint8ArrayToBuffer(t){return c.from(t)}function _isUint8Array(t){return c.isBuffer(t)||t instanceof u}var h=i(7025);var d=i(6776),p=d.getHighWaterMark;var m=i(4646).q,y=m.ERR_INVALID_ARG_TYPE,g=m.ERR_METHOD_NOT_IMPLEMENTED,b=m.ERR_MULTIPLE_CALLBACK,v=m.ERR_STREAM_CANNOT_PIPE,_=m.ERR_STREAM_DESTROYED,w=m.ERR_STREAM_NULL_VALUES,E=m.ERR_STREAM_WRITE_AFTER_END,S=m.ERR_UNKNOWN_ENCODING;var O=h.errorOrDestroy;i(2842)(Writable,l);function nop(){}function WritableState(t,r,a){o=o||i(2403);t=t||{};if(typeof a!=="boolean")a=r instanceof o;this.objectMode=!!t.objectMode;if(a)this.objectMode=this.objectMode||!!t.writableObjectMode;this.highWaterMark=p(this,t,"writableHighWaterMark",a);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var l=t.decodeStrings===false;this.decodeStrings=!l;this.defaultEncoding=t.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(t){onwrite(r,t)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.emitClose=t.emitClose!==false;this.autoDestroy=!!t.autoDestroy;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function getBuffer(){var t=this.bufferedRequest;var r=[];while(t){r.push(t);t=t.next}return r};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:a.deprecate((function writableStateBufferGetter(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(t){}})();var R;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){R=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function value(t){if(R.call(this,t))return true;if(this!==Writable)return false;return t&&t._writableState instanceof WritableState}})}else{R=function realHasInstance(t){return t instanceof this}}function Writable(t){o=o||i(2403);var r=this instanceof o;if(!r&&!R.call(Writable,this))return new Writable(t);this._writableState=new WritableState(t,this,r);this.writable=true;if(t){if(typeof t.write==="function")this._write=t.write;if(typeof t.writev==="function")this._writev=t.writev;if(typeof t.destroy==="function")this._destroy=t.destroy;if(typeof t.final==="function")this._final=t.final}l.call(this)}Writable.prototype.pipe=function(){O(this,new v)};function writeAfterEnd(t,r){var i=new E;O(t,i);process.nextTick(r,i)}function validChunk(t,r,i,o){var a;if(i===null){a=new w}else if(typeof i!=="string"&&!r.objectMode){a=new y("chunk",["string","Buffer"],i)}if(a){O(t,a);process.nextTick(o,a);return false}return true}Writable.prototype.write=function(t,r,i){var o=this._writableState;var a=false;var l=!o.objectMode&&_isUint8Array(t);if(l&&!c.isBuffer(t)){t=_uint8ArrayToBuffer(t)}if(typeof r==="function"){i=r;r=null}if(l)r="buffer";else if(!r)r=o.defaultEncoding;if(typeof i!=="function")i=nop;if(o.ending)writeAfterEnd(this,i);else if(l||validChunk(this,o,t,i)){o.pendingcb++;a=writeOrBuffer(this,o,l,t,r,i)}return a};Writable.prototype.cork=function(){this._writableState.corked++};Writable.prototype.uncork=function(){var t=this._writableState;if(t.corked){t.corked--;if(!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest)clearBuffer(this,t)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(t){if(typeof t==="string")t=t.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new S(t);this._writableState.defaultEncoding=t;return this};Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:false,get:function get(){return this._writableState&&this._writableState.getBuffer()}});function decodeChunk(t,r,i){if(!t.objectMode&&t.decodeStrings!==false&&typeof r==="string"){r=c.from(r,i)}return r}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function get(){return this._writableState.highWaterMark}});function writeOrBuffer(t,r,i,o,a,l){if(!i){var c=decodeChunk(r,o,a);if(o!==c){i=true;a="buffer";o=c}}var u=r.objectMode?1:o.length;r.length+=u;var h=r.length<r.highWaterMark;if(!h)r.needDrain=true;if(r.writing||r.corked){var d=r.lastBufferedRequest;r.lastBufferedRequest={chunk:o,encoding:a,isBuf:i,callback:l,next:null};if(d){d.next=r.lastBufferedRequest}else{r.bufferedRequest=r.lastBufferedRequest}r.bufferedRequestCount+=1}else{doWrite(t,r,false,u,o,a,l)}return h}function doWrite(t,r,i,o,a,l,c){r.writelen=o;r.writecb=c;r.writing=true;r.sync=true;if(r.destroyed)r.onwrite(new _("write"));else if(i)t._writev(a,r.onwrite);else t._write(a,l,r.onwrite);r.sync=false}function onwriteError(t,r,i,o,a){--r.pendingcb;if(i){process.nextTick(a,o);process.nextTick(finishMaybe,t,r);t._writableState.errorEmitted=true;O(t,o)}else{a(o);t._writableState.errorEmitted=true;O(t,o);finishMaybe(t,r)}}function onwriteStateUpdate(t){t.writing=false;t.writecb=null;t.length-=t.writelen;t.writelen=0}function onwrite(t,r){var i=t._writableState;var o=i.sync;var a=i.writecb;if(typeof a!=="function")throw new b;onwriteStateUpdate(i);if(r)onwriteError(t,i,o,r,a);else{var l=needFinish(i)||t.destroyed;if(!l&&!i.corked&&!i.bufferProcessing&&i.bufferedRequest){clearBuffer(t,i)}if(o){process.nextTick(afterWrite,t,i,l,a)}else{afterWrite(t,i,l,a)}}}function afterWrite(t,r,i,o){if(!i)onwriteDrain(t,r);r.pendingcb--;o();finishMaybe(t,r)}function onwriteDrain(t,r){if(r.length===0&&r.needDrain){r.needDrain=false;t.emit("drain")}}function clearBuffer(t,r){r.bufferProcessing=true;var i=r.bufferedRequest;if(t._writev&&i&&i.next){var o=r.bufferedRequestCount;var a=new Array(o);var l=r.corkedRequestsFree;l.entry=i;var c=0;var u=true;while(i){a[c]=i;if(!i.isBuf)u=false;i=i.next;c+=1}a.allBuffers=u;doWrite(t,r,true,r.length,a,"",l.finish);r.pendingcb++;r.lastBufferedRequest=null;if(l.next){r.corkedRequestsFree=l.next;l.next=null}else{r.corkedRequestsFree=new CorkedRequest(r)}r.bufferedRequestCount=0}else{while(i){var h=i.chunk;var d=i.encoding;var p=i.callback;var m=r.objectMode?1:h.length;doWrite(t,r,false,m,h,d,p);i=i.next;r.bufferedRequestCount--;if(r.writing){break}}if(i===null)r.lastBufferedRequest=null}r.bufferedRequest=i;r.bufferProcessing=false}Writable.prototype._write=function(t,r,i){i(new g("_write()"))};Writable.prototype._writev=null;Writable.prototype.end=function(t,r,i){var o=this._writableState;if(typeof t==="function"){i=t;t=null;r=null}else if(typeof r==="function"){i=r;r=null}if(t!==null&&t!==undefined)this.write(t,r);if(o.corked){o.corked=1;this.uncork()}if(!o.ending)endWritable(this,o,i);return this};Object.defineProperty(Writable.prototype,"writableLength",{enumerable:false,get:function get(){return this._writableState.length}});function needFinish(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function callFinal(t,r){t._final((function(i){r.pendingcb--;if(i){O(t,i)}r.prefinished=true;t.emit("prefinish");finishMaybe(t,r)}))}function prefinish(t,r){if(!r.prefinished&&!r.finalCalled){if(typeof t._final==="function"&&!r.destroyed){r.pendingcb++;r.finalCalled=true;process.nextTick(callFinal,t,r)}else{r.prefinished=true;t.emit("prefinish")}}}function finishMaybe(t,r){var i=needFinish(r);if(i){prefinish(t,r);if(r.pendingcb===0){r.finished=true;t.emit("finish");if(r.autoDestroy){var o=t._readableState;if(!o||o.autoDestroy&&o.endEmitted){t.destroy()}}}}return i}function endWritable(t,r,i){r.ending=true;finishMaybe(t,r);if(i){if(r.finished)process.nextTick(i);else t.once("finish",i)}r.ended=true;t.writable=false}function onCorkedFinish(t,r,i){var o=t.entry;t.entry=null;while(o){var a=o.callback;r.pendingcb--;a(i);o=o.next}r.corkedRequestsFree.next=t}Object.defineProperty(Writable.prototype,"destroyed",{enumerable:false,get:function get(){if(this._writableState===undefined){return false}return this._writableState.destroyed},set:function set(t){if(!this._writableState){return}this._writableState.destroyed=t}});Writable.prototype.destroy=h.destroy;Writable.prototype._undestroy=h.undestroy;Writable.prototype._destroy=function(t,r){r(t)}},6871:(t,r,i)=>{"use strict";var o;function _defineProperty(t,r,i){if(r in t){Object.defineProperty(t,r,{value:i,enumerable:true,configurable:true,writable:true})}else{t[r]=i}return t}var a=i(9698);var l=Symbol("lastResolve");var c=Symbol("lastReject");var u=Symbol("error");var h=Symbol("ended");var d=Symbol("lastPromise");var p=Symbol("handlePromise");var m=Symbol("stream");function createIterResult(t,r){return{value:t,done:r}}function readAndResolve(t){var r=t[l];if(r!==null){var i=t[m].read();if(i!==null){t[d]=null;t[l]=null;t[c]=null;r(createIterResult(i,false))}}}function onReadable(t){process.nextTick(readAndResolve,t)}function wrapForNext(t,r){return function(i,o){t.then((function(){if(r[h]){i(createIterResult(undefined,true));return}r[p](i,o)}),o)}}var y=Object.getPrototypeOf((function(){}));var g=Object.setPrototypeOf((o={get stream(){return this[m]},next:function next(){var t=this;var r=this[u];if(r!==null){return Promise.reject(r)}if(this[h]){return Promise.resolve(createIterResult(undefined,true))}if(this[m].destroyed){return new Promise((function(r,i){process.nextTick((function(){if(t[u]){i(t[u])}else{r(createIterResult(undefined,true))}}))}))}var i=this[d];var o;if(i){o=new Promise(wrapForNext(i,this))}else{var a=this[m].read();if(a!==null){return Promise.resolve(createIterResult(a,false))}o=new Promise(this[p])}this[d]=o;return o}},_defineProperty(o,Symbol.asyncIterator,(function(){return this})),_defineProperty(o,"return",(function _return(){var t=this;return new Promise((function(r,i){t[m].destroy(null,(function(t){if(t){i(t);return}r(createIterResult(undefined,true))}))}))})),o),y);var b=function createReadableStreamAsyncIterator(t){var r;var i=Object.create(g,(r={},_defineProperty(r,m,{value:t,writable:true}),_defineProperty(r,l,{value:null,writable:true}),_defineProperty(r,c,{value:null,writable:true}),_defineProperty(r,u,{value:null,writable:true}),_defineProperty(r,h,{value:t._readableState.endEmitted,writable:true}),_defineProperty(r,p,{value:function value(t,r){var o=i[m].read();if(o){i[d]=null;i[l]=null;i[c]=null;t(createIterResult(o,false))}else{i[l]=t;i[c]=r}},writable:true}),r));i[d]=null;a(t,(function(t){if(t&&t.code!=="ERR_STREAM_PREMATURE_CLOSE"){var r=i[c];if(r!==null){i[d]=null;i[l]=null;i[c]=null;r(t)}i[u]=t;return}var o=i[l];if(o!==null){i[d]=null;i[l]=null;i[c]=null;o(createIterResult(undefined,true))}i[h]=true}));t.on("readable",onReadable.bind(null,i));return i};t.exports=b},4379:(t,r,i)=>{"use strict";function ownKeys(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);if(r)o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}));i.push.apply(i,o)}return i}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){ownKeys(Object(i),true).forEach((function(r){_defineProperty(t,r,i[r])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))}else{ownKeys(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}}return t}function _defineProperty(t,r,i){if(r in t){Object.defineProperty(t,r,{value:i,enumerable:true,configurable:true,writable:true})}else{t[r]=i}return t}function _classCallCheck(t,r){if(!(t instanceof r)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||false;o.configurable=true;if("value"in o)o.writable=true;Object.defineProperty(t,o.key,o)}}function _createClass(t,r,i){if(r)_defineProperties(t.prototype,r);if(i)_defineProperties(t,i);return t}var o=i(4300),a=o.Buffer;var l=i(3837),c=l.inspect;var u=c&&c.custom||"inspect";function copyBuffer(t,r,i){a.prototype.copy.call(t,r,i)}t.exports=function(){function BufferList(){_classCallCheck(this,BufferList);this.head=null;this.tail=null;this.length=0}_createClass(BufferList,[{key:"push",value:function push(t){var r={data:t,next:null};if(this.length>0)this.tail.next=r;else this.head=r;this.tail=r;++this.length}},{key:"unshift",value:function unshift(t){var r={data:t,next:this.head};if(this.length===0)this.tail=r;this.head=r;++this.length}},{key:"shift",value:function shift(){if(this.length===0)return;var t=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return t}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0}},{key:"join",value:function join(t){if(this.length===0)return"";var r=this.head;var i=""+r.data;while(r=r.next){i+=t+r.data}return i}},{key:"concat",value:function concat(t){if(this.length===0)return a.alloc(0);var r=a.allocUnsafe(t>>>0);var i=this.head;var o=0;while(i){copyBuffer(i.data,r,o);o+=i.data.length;i=i.next}return r}},{key:"consume",value:function consume(t,r){var i;if(t<this.head.data.length){i=this.head.data.slice(0,t);this.head.data=this.head.data.slice(t)}else if(t===this.head.data.length){i=this.shift()}else{i=r?this._getString(t):this._getBuffer(t)}return i}},{key:"first",value:function first(){return this.head.data}},{key:"_getString",value:function _getString(t){var r=this.head;var i=1;var o=r.data;t-=o.length;while(r=r.next){var a=r.data;var l=t>a.length?a.length:t;if(l===a.length)o+=a;else o+=a.slice(0,t);t-=l;if(t===0){if(l===a.length){++i;if(r.next)this.head=r.next;else this.head=this.tail=null}else{this.head=r;r.data=a.slice(l)}break}++i}this.length-=i;return o}},{key:"_getBuffer",value:function _getBuffer(t){var r=a.allocUnsafe(t);var i=this.head;var o=1;i.data.copy(r);t-=i.data.length;while(i=i.next){var l=i.data;var c=t>l.length?l.length:t;l.copy(r,r.length-t,0,c);t-=c;if(t===0){if(c===l.length){++o;if(i.next)this.head=i.next;else this.head=this.tail=null}else{this.head=i;i.data=l.slice(c)}break}++o}this.length-=o;return r}},{key:u,value:function value(t,r){return c(this,_objectSpread({},r,{depth:0,customInspect:false}))}}]);return BufferList}()},7025:t=>{"use strict";function destroy(t,r){var i=this;var o=this._readableState&&this._readableState.destroyed;var a=this._writableState&&this._writableState.destroyed;if(o||a){if(r){r(t)}else if(t){if(!this._writableState){process.nextTick(emitErrorNT,this,t)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,t)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(t||null,(function(t){if(!r&&t){if(!i._writableState){process.nextTick(emitErrorAndCloseNT,i,t)}else if(!i._writableState.errorEmitted){i._writableState.errorEmitted=true;process.nextTick(emitErrorAndCloseNT,i,t)}else{process.nextTick(emitCloseNT,i)}}else if(r){process.nextTick(emitCloseNT,i);r(t)}else{process.nextTick(emitCloseNT,i)}}));return this}function emitErrorAndCloseNT(t,r){emitErrorNT(t,r);emitCloseNT(t)}function emitCloseNT(t){if(t._writableState&&!t._writableState.emitClose)return;if(t._readableState&&!t._readableState.emitClose)return;t.emit("close")}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(t,r){t.emit("error",r)}function errorOrDestroy(t,r){var i=t._readableState;var o=t._writableState;if(i&&i.autoDestroy||o&&o.autoDestroy)t.destroy(r);else t.emit("error",r)}t.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy}},9698:(t,r,i)=>{"use strict";var o=i(4646).q.ERR_STREAM_PREMATURE_CLOSE;function once(t){var r=false;return function(){if(r)return;r=true;for(var i=arguments.length,o=new Array(i),a=0;a<i;a++){o[a]=arguments[a]}t.apply(this,o)}}function noop(){}function isRequest(t){return t.setHeader&&typeof t.abort==="function"}function eos(t,r,i){if(typeof r==="function")return eos(t,null,r);if(!r)r={};i=once(i||noop);var a=r.readable||r.readable!==false&&t.readable;var l=r.writable||r.writable!==false&&t.writable;var c=function onlegacyfinish(){if(!t.writable)h()};var u=t._writableState&&t._writableState.finished;var h=function onfinish(){l=false;u=true;if(!a)i.call(t)};var d=t._readableState&&t._readableState.endEmitted;var p=function onend(){a=false;d=true;if(!l)i.call(t)};var m=function onerror(r){i.call(t,r)};var y=function onclose(){var r;if(a&&!d){if(!t._readableState||!t._readableState.ended)r=new o;return i.call(t,r)}if(l&&!u){if(!t._writableState||!t._writableState.ended)r=new o;return i.call(t,r)}};var g=function onrequest(){t.req.on("finish",h)};if(isRequest(t)){t.on("complete",h);t.on("abort",y);if(t.req)g();else t.on("request",g)}else if(l&&!t._writableState){t.on("end",c);t.on("close",c)}t.on("end",p);t.on("finish",h);if(r.error!==false)t.on("error",m);t.on("close",y);return function(){t.removeListener("complete",h);t.removeListener("abort",y);t.removeListener("request",g);if(t.req)t.req.removeListener("finish",h);t.removeListener("end",c);t.removeListener("close",c);t.removeListener("finish",h);t.removeListener("end",p);t.removeListener("error",m);t.removeListener("close",y)}}t.exports=eos},9727:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,l,c){try{var u=t[l](c);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var l=t.apply(r,i);function _next(t){asyncGeneratorStep(l,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}function ownKeys(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);if(r)o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}));i.push.apply(i,o)}return i}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){ownKeys(Object(i),true).forEach((function(r){_defineProperty(t,r,i[r])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))}else{ownKeys(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}}return t}function _defineProperty(t,r,i){if(r in t){Object.defineProperty(t,r,{value:i,enumerable:true,configurable:true,writable:true})}else{t[r]=i}return t}var o=i(4646).q.ERR_INVALID_ARG_TYPE;function from(t,r,i){var a;if(r&&typeof r.next==="function"){a=r}else if(r&&r[Symbol.asyncIterator])a=r[Symbol.asyncIterator]();else if(r&&r[Symbol.iterator])a=r[Symbol.iterator]();else throw new o("iterable",["Iterable"],r);var l=new t(_objectSpread({objectMode:true},i));var c=false;l._read=function(){if(!c){c=true;next()}};function next(){return _next2.apply(this,arguments)}function _next2(){_next2=_asyncToGenerator((function*(){try{var t=yield a.next(),r=t.value,i=t.done;if(i){l.push(null)}else if(l.push(yield r)){next()}else{c=false}}catch(t){l.destroy(t)}}));return _next2.apply(this,arguments)}return l}t.exports=from},8442:(t,r,i)=>{"use strict";var o;function once(t){var r=false;return function(){if(r)return;r=true;t.apply(void 0,arguments)}}var a=i(4646).q,l=a.ERR_MISSING_ARGS,c=a.ERR_STREAM_DESTROYED;function noop(t){if(t)throw t}function isRequest(t){return t.setHeader&&typeof t.abort==="function"}function destroyer(t,r,a,l){l=once(l);var u=false;t.on("close",(function(){u=true}));if(o===undefined)o=i(9698);o(t,{readable:r,writable:a},(function(t){if(t)return l(t);u=true;l()}));var h=false;return function(r){if(u)return;if(h)return;h=true;if(isRequest(t))return t.abort();if(typeof t.destroy==="function")return t.destroy();l(r||new c("pipe"))}}function call(t){t()}function pipe(t,r){return t.pipe(r)}function popCallback(t){if(!t.length)return noop;if(typeof t[t.length-1]!=="function")return noop;return t.pop()}function pipeline(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++){r[i]=arguments[i]}var o=popCallback(r);if(Array.isArray(r[0]))r=r[0];if(r.length<2){throw new l("streams")}var a;var c=r.map((function(t,i){var l=i<r.length-1;var u=i>0;return destroyer(t,l,u,(function(t){if(!a)a=t;if(t)c.forEach(call);if(l)return;c.forEach(call);o(a)}))}));return r.reduce(pipe)}t.exports=pipeline},6776:(t,r,i)=>{"use strict";var o=i(4646).q.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(t,r,i){return t.highWaterMark!=null?t.highWaterMark:r?t[i]:null}function getHighWaterMark(t,r,i,a){var l=highWaterMarkFrom(r,a,i);if(l!=null){if(!(isFinite(l)&&Math.floor(l)===l)||l<0){var c=a?i:"highWaterMark";throw new o(c,l)}return Math.floor(l)}return t.objectMode?16:16*1024}t.exports={getHighWaterMark:getHighWaterMark}},4678:(t,r,i)=>{t.exports=i(2781)},3726:(t,r,i)=>{var o=i(2781);if(process.env.READABLE_STREAM==="disable"&&o){t.exports=o.Readable;Object.assign(t.exports,o);t.exports.Stream=o}else{r=t.exports=i(1709);r.Stream=o||r;r.Readable=r;r.Writable=i(7337);r.Duplex=i(2403);r.Transform=i(1170);r.PassThrough=i(7889);r.finished=i(9698);r.pipeline=i(8442)}},3638:(t,r,i)=>{t.exports=readdirGlob;const o=i(7147);const{EventEmitter:a}=i(2361);const{Minimatch:l}=i(8923);const{resolve:c}=i(1017);function readdir(t,r){return new Promise(((i,a)=>{o.readdir(t,{withFileTypes:true},((t,o)=>{if(t){switch(t.code){case"ENOTDIR":if(r){a(t)}else{i([])}break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":i([]);break;case"ELOOP":default:a(t);break}}else{i(o)}}))}))}function stat(t,r){return new Promise(((i,a)=>{const l=r?o.stat:o.lstat;l(t,((o,a)=>{if(o){switch(o.code){case"ENOENT":if(r){i(stat(t,false))}else{i(null)}break;default:i(null);break}}else{i(a)}}))}))}async function*exploreWalkAsync(t,r,i,o,a,l){let c=await readdir(r+t,l);for(const l of c){let c=l.name;if(c===undefined){c=l;o=true}const u=t+"/"+c;const h=u.slice(1);const d=r+"/"+h;let p=null;if(o||i){p=await stat(d,i)}if(!p&&l.name!==undefined){p=l}if(p===null){p={isDirectory:()=>false}}if(p.isDirectory()){if(!a(h)){yield{relative:h,absolute:d,stats:p};yield*exploreWalkAsync(u,r,i,o,a,false)}}else{yield{relative:h,absolute:d,stats:p}}}}async function*explore(t,r,i,o){yield*exploreWalkAsync("",t,r,i,o,true)}function readOptions(t){return{pattern:t.pattern,dot:!!t.dot,noglobstar:!!t.noglobstar,matchBase:!!t.matchBase,nocase:!!t.nocase,ignore:t.ignore,skip:t.skip,follow:!!t.follow,stat:!!t.stat,nodir:!!t.nodir,mark:!!t.mark,silent:!!t.silent,absolute:!!t.absolute}}class ReaddirGlob extends a{constructor(t,r,i){super();if(typeof r==="function"){i=r;r=null}this.options=readOptions(r||{});this.matchers=[];if(this.options.pattern){const t=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=t.map((t=>new l(t,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase})))}this.ignoreMatchers=[];if(this.options.ignore){const t=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=t.map((t=>new l(t,{dot:true})))}this.skipMatchers=[];if(this.options.skip){const t=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=t.map((t=>new l(t,{dot:true})))}this.iterator=explore(c(t||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this));this.paused=false;this.inactive=false;this.aborted=false;if(i){this._matches=[];this.on("match",(t=>this._matches.push(this.options.absolute?t.absolute:t.relative)));this.on("error",(t=>i(t)));this.on("end",(()=>i(null,this._matches)))}setTimeout((()=>this._next()),0)}_shouldSkipDirectory(t){return this.skipMatchers.some((r=>r.match(t)))}_fileMatches(t,r){const i=t+(r?"/":"");return(this.matchers.length===0||this.matchers.some((t=>t.match(i))))&&!this.ignoreMatchers.some((t=>t.match(i)))&&(!this.options.nodir||!r)}_next(){if(!this.paused&&!this.aborted){this.iterator.next().then((t=>{if(!t.done){const r=t.value.stats.isDirectory();if(this._fileMatches(t.value.relative,r)){let i=t.value.relative;let o=t.value.absolute;if(this.options.mark&&r){i+="/";o+="/"}if(this.options.stat){this.emit("match",{relative:i,absolute:o,stat:t.value.stats})}else{this.emit("match",{relative:i,absolute:o})}}this._next(this.iterator)}else{this.emit("end")}})).catch((t=>{this.abort();this.emit("error",t);if(!t.code&&!this.options.silent){console.error(t)}}))}else{this.inactive=true}}abort(){this.aborted=true}pause(){this.paused=true}resume(){this.paused=false;if(this.inactive){this.inactive=false;this._next()}}}function readdirGlob(t,r,i){return new ReaddirGlob(t,r,i)}readdirGlob.ReaddirGlob=ReaddirGlob},1913:(t,r,i)=>{const o=i(6911).Buffer;function decodeBase64(t){return o.from(t,"base64").toString("utf8")}function encodeBase64(t){return o.from(t,"utf8").toString("base64")}t.exports={decodeBase64:decodeBase64,encodeBase64:encodeBase64}},1281:(t,r,i)=>{var o=i(7310);var a=i(1913);var l=a.decodeBase64;var c=a.encodeBase64;var u=":_authToken";var h=":username";var d=":_password";t.exports=function(){var t;var r;if(arguments.length>=2){t=arguments[0];r=arguments[1]}else if(typeof arguments[0]==="string"){t=arguments[0]}else{r=arguments[0]}r=r||{};r.npmrc=r.npmrc||i(4446)("npm",{registry:"https://registry.npmjs.org/"});t=t||r.npmrc.registry;return getRegistryAuthInfo(t,r)||getLegacyAuthInfo(r.npmrc)};function getRegistryAuthInfo(t,r){var i=o.parse(t,false,true);var a;while(a!=="/"&&i.pathname!==a){a=i.pathname||"/";var l="//"+i.host+a.replace(/\/$/,"");var c=getAuthInfoForUrl(l,r.npmrc);if(c){return c}if(!r.recursive){return/\/$/.test(t)?undefined:getRegistryAuthInfo(o.resolve(t,"."),r)}i.pathname=o.resolve(normalizePath(a),"..")||"/"}return undefined}function getLegacyAuthInfo(t){if(t._auth){return{token:t._auth,type:"Basic"}}return undefined}function normalizePath(t){return t[t.length-1]==="/"?t:t+"/"}function getAuthInfoForUrl(t,r){var i=getBearerToken(r[t+u]||r[t+"/"+u]);if(i){return i}var o=r[t+h]||r[t+"/"+h];var a=r[t+d]||r[t+"/"+d];var l=getTokenForUsernameAndPassword(o,a);if(l){return l}return undefined}function getBearerToken(t){if(!t){return undefined}var r=t.replace(/^\$\{?([^}]*)\}?$/,(function(t,r){return process.env[r]}));return{token:r,type:"Bearer"}}function getTokenForUsernameAndPassword(t,r){if(!t||!r){return undefined}var i=l(r.replace(/^\$\{?([^}]*)\}?$/,(function(t,r){return process.env[r]})));var o=c(t+":"+i);return{token:o,type:"Basic",password:i,username:t}}},9074:(t,r,i)=>{"use strict";t.exports=function(t){var r=i(4446)("npm",{registry:"https://registry.npmjs.org/"});var o=r[t+":registry"]||r.registry;return o.slice(-1)==="/"?o:o+"/"}},8826:(t,r,i)=>{"use strict";const o=i(4404);t.exports=(t={},r=o.connect)=>new Promise(((i,o)=>{let a=false;let l;const callback=async()=>{await c;l.off("timeout",onTimeout);l.off("error",o);if(t.resolveSocket){i({alpnProtocol:l.alpnProtocol,socket:l,timeout:a});if(a){await Promise.resolve();l.emit("timeout")}}else{l.destroy();i({alpnProtocol:l.alpnProtocol,timeout:a})}};const onTimeout=async()=>{a=true;callback()};const c=(async()=>{try{l=await r(t,callback);l.on("error",o);l.once("timeout",onTimeout)}catch(t){o(t)}})()}))},6975:(t,r,i)=>{t.exports=i(4432)},4432:(t,r,i)=>{var o=i(26);r.operation=function(t){var i=r.timeouts(t);return new o(i,{forever:t&&(t.forever||t.retries===Infinity),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};r.timeouts=function(t){if(t instanceof Array){return[].concat(t)}var r={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:Infinity,randomize:false};for(var i in t){r[i]=t[i]}if(r.minTimeout>r.maxTimeout){throw new Error("minTimeout is greater than maxTimeout")}var o=[];for(var a=0;a<r.retries;a++){o.push(this.createTimeout(a,r))}if(t&&t.forever&&!o.length){o.push(this.createTimeout(a,r))}o.sort((function(t,r){return t-r}));return o};r.createTimeout=function(t,r){var i=r.randomize?Math.random()+1:1;var o=Math.round(i*Math.max(r.minTimeout,1)*Math.pow(r.factor,t));o=Math.min(o,r.maxTimeout);return o};r.wrap=function(t,i,o){if(i instanceof Array){o=i;i=null}if(!o){o=[];for(var a in t){if(typeof t[a]==="function"){o.push(a)}}}for(var l=0;l<o.length;l++){var c=o[l];var u=t[c];t[c]=function retryWrapper(o){var a=r.operation(i);var l=Array.prototype.slice.call(arguments,1);var c=l.pop();l.push((function(t){if(a.retry(t)){return}if(t){arguments[0]=a.mainError()}c.apply(this,arguments)}));a.attempt((function(){o.apply(t,l)}))}.bind(t,u);t[c].options=i}}},26:t=>{function RetryOperation(t,r){if(typeof r==="boolean"){r={forever:r}}this._originalTimeouts=JSON.parse(JSON.stringify(t));this._timeouts=t;this._options=r||{};this._maxRetryTime=r&&r.maxRetryTime||Infinity;this._fn=null;this._errors=[];this._attempts=1;this._operationTimeout=null;this._operationTimeoutCb=null;this._timeout=null;this._operationStart=null;this._timer=null;if(this._options.forever){this._cachedTimeouts=this._timeouts.slice(0)}}t.exports=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1;this._timeouts=this._originalTimeouts.slice(0)};RetryOperation.prototype.stop=function(){if(this._timeout){clearTimeout(this._timeout)}if(this._timer){clearTimeout(this._timer)}this._timeouts=[];this._cachedTimeouts=null};RetryOperation.prototype.retry=function(t){if(this._timeout){clearTimeout(this._timeout)}if(!t){return false}var r=(new Date).getTime();if(t&&r-this._operationStart>=this._maxRetryTime){this._errors.push(t);this._errors.unshift(new Error("RetryOperation timeout occurred"));return false}this._errors.push(t);var i=this._timeouts.shift();if(i===undefined){if(this._cachedTimeouts){this._errors.splice(0,this._errors.length-1);i=this._cachedTimeouts.slice(-1)}else{return false}}var o=this;this._timer=setTimeout((function(){o._attempts++;if(o._operationTimeoutCb){o._timeout=setTimeout((function(){o._operationTimeoutCb(o._attempts)}),o._operationTimeout);if(o._options.unref){o._timeout.unref()}}o._fn(o._attempts)}),i);if(this._options.unref){this._timer.unref()}return true};RetryOperation.prototype.attempt=function(t,r){this._fn=t;if(r){if(r.timeout){this._operationTimeout=r.timeout}if(r.cb){this._operationTimeoutCb=r.cb}}var i=this;if(this._operationTimeoutCb){this._timeout=setTimeout((function(){i._operationTimeoutCb()}),i._operationTimeout)}this._operationStart=(new Date).getTime();this._fn(this._attempts)};RetryOperation.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated");this.attempt(t)};RetryOperation.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated");this.attempt(t)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0){return null}var t={};var r=null;var i=0;for(var o=0;o<this._errors.length;o++){var a=this._errors[o];var l=a.message;var c=(t[l]||0)+1;t[l]=c;if(c>=i){r=a;i=c}}return r}},7327:t=>{"use strict";function reusify(t){var r=new t;var i=r;function get(){var o=r;if(o.next){r=o.next}else{r=new t;i=r}o.next=null;return o}function release(t){i.next=t;i=t}return{get:get,release:release}}t.exports=reusify},4700:(t,r,i)=>{const o=i(9491);const a=i(1017);const l=i(7147);let c=undefined;try{c=i(4991)}catch(t){}const u={nosort:true,silent:true};let h=0;const d=process.platform==="win32";const defaults=t=>{const r=["unlink","chmod","stat","lstat","rmdir","readdir"];r.forEach((r=>{t[r]=t[r]||l[r];r=r+"Sync";t[r]=t[r]||l[r]}));t.maxBusyTries=t.maxBusyTries||3;t.emfileWait=t.emfileWait||1e3;if(t.glob===false){t.disableGlob=true}if(t.disableGlob!==true&&c===undefined){throw Error("glob dependency not found, set `options.disableGlob = true` if intentional")}t.disableGlob=t.disableGlob||false;t.glob=t.glob||u};const rimraf=(t,r,i)=>{if(typeof r==="function"){i=r;r={}}o(t,"rimraf: missing path");o.equal(typeof t,"string","rimraf: path should be a string");o.equal(typeof i,"function","rimraf: callback function required");o(r,"rimraf: invalid options argument provided");o.equal(typeof r,"object","rimraf: options should be object");defaults(r);let a=0;let l=null;let u=0;const next=t=>{l=l||t;if(--u===0)i(l)};const afterGlob=(t,o)=>{if(t)return i(t);u=o.length;if(u===0)return i();o.forEach((t=>{const CB=i=>{if(i){if((i.code==="EBUSY"||i.code==="ENOTEMPTY"||i.code==="EPERM")&&a<r.maxBusyTries){a++;return setTimeout((()=>rimraf_(t,r,CB)),a*100)}if(i.code==="EMFILE"&&h<r.emfileWait){return setTimeout((()=>rimraf_(t,r,CB)),h++)}if(i.code==="ENOENT")i=null}h=0;next(i)};rimraf_(t,r,CB)}))};if(r.disableGlob||!c.hasMagic(t))return afterGlob(null,[t]);r.lstat(t,((i,o)=>{if(!i)return afterGlob(null,[t]);c(t,r.glob,afterGlob)}))};const rimraf_=(t,r,i)=>{o(t);o(r);o(typeof i==="function");r.lstat(t,((o,a)=>{if(o&&o.code==="ENOENT")return i(null);if(o&&o.code==="EPERM"&&d)fixWinEPERM(t,r,o,i);if(a&&a.isDirectory())return rmdir(t,r,o,i);r.unlink(t,(o=>{if(o){if(o.code==="ENOENT")return i(null);if(o.code==="EPERM")return d?fixWinEPERM(t,r,o,i):rmdir(t,r,o,i);if(o.code==="EISDIR")return rmdir(t,r,o,i)}return i(o)}))}))};const fixWinEPERM=(t,r,i,a)=>{o(t);o(r);o(typeof a==="function");r.chmod(t,438,(o=>{if(o)a(o.code==="ENOENT"?null:i);else r.stat(t,((o,l)=>{if(o)a(o.code==="ENOENT"?null:i);else if(l.isDirectory())rmdir(t,r,i,a);else r.unlink(t,a)}))}))};const fixWinEPERMSync=(t,r,i)=>{o(t);o(r);try{r.chmodSync(t,438)}catch(t){if(t.code==="ENOENT")return;else throw i}let a;try{a=r.statSync(t)}catch(t){if(t.code==="ENOENT")return;else throw i}if(a.isDirectory())rmdirSync(t,r,i);else r.unlinkSync(t)};const rmdir=(t,r,i,a)=>{o(t);o(r);o(typeof a==="function");r.rmdir(t,(o=>{if(o&&(o.code==="ENOTEMPTY"||o.code==="EEXIST"||o.code==="EPERM"))rmkids(t,r,a);else if(o&&o.code==="ENOTDIR")a(i);else a(o)}))};const rmkids=(t,r,i)=>{o(t);o(r);o(typeof i==="function");r.readdir(t,((o,l)=>{if(o)return i(o);let c=l.length;if(c===0)return r.rmdir(t,i);let u;l.forEach((o=>{rimraf(a.join(t,o),r,(o=>{if(u)return;if(o)return i(u=o);if(--c===0)r.rmdir(t,i)}))}))}))};const rimrafSync=(t,r)=>{r=r||{};defaults(r);o(t,"rimraf: missing path");o.equal(typeof t,"string","rimraf: path should be a string");o(r,"rimraf: missing options");o.equal(typeof r,"object","rimraf: options should be object");let i;if(r.disableGlob||!c.hasMagic(t)){i=[t]}else{try{r.lstatSync(t);i=[t]}catch(o){i=c.sync(t,r.glob)}}if(!i.length)return;for(let t=0;t<i.length;t++){const o=i[t];let a;try{a=r.lstatSync(o)}catch(t){if(t.code==="ENOENT")return;if(t.code==="EPERM"&&d)fixWinEPERMSync(o,r,t)}try{if(a&&a.isDirectory())rmdirSync(o,r,null);else r.unlinkSync(o)}catch(t){if(t.code==="ENOENT")return;if(t.code==="EPERM")return d?fixWinEPERMSync(o,r,t):rmdirSync(o,r,t);if(t.code!=="EISDIR")throw t;rmdirSync(o,r,t)}}};const rmdirSync=(t,r,i)=>{o(t);o(r);try{r.rmdirSync(t)}catch(o){if(o.code==="ENOENT")return;if(o.code==="ENOTDIR")throw i;if(o.code==="ENOTEMPTY"||o.code==="EEXIST"||o.code==="EPERM")rmkidsSync(t,r)}};const rmkidsSync=(t,r)=>{o(t);o(r);r.readdirSync(t).forEach((i=>rimrafSync(a.join(t,i),r)));const i=d?100:1;let l=0;do{let o=true;try{const a=r.rmdirSync(t,r);o=false;return a}finally{if(++l<i&&o)continue}}while(true)};t.exports=rimraf;rimraf.sync=rimrafSync},4796:(t,r,i)=>{
114
114
  /*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
115
115
  t.exports=runParallel;const o=i(592);function runParallel(t,r){let i,a,l;let c=true;if(Array.isArray(t)){i=[];a=t.length}else{l=Object.keys(t);i={};a=l.length}function done(t){function end(){if(r)r(t,i);r=null}if(c)o(end);else end()}function each(t,r,o){i[t]=o;if(--a===0||r){done(r)}}if(!a){done(null)}else if(l){l.forEach((function(r){t[r]((function(t,i){each(r,t,i)}))}))}else{t.forEach((function(t,r){t((function(t,i){each(r,t,i)}))}))}c=false}},291:(t,r,i)=>{var o=i(4300);var a=o.Buffer;function copyProps(t,r){for(var i in t){r[i]=t[i]}}if(a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow){t.exports=o}else{copyProps(o,r);r.Buffer=SafeBuffer}function SafeBuffer(t,r,i){return a(t,r,i)}copyProps(a,SafeBuffer);SafeBuffer.from=function(t,r,i){if(typeof t==="number"){throw new TypeError("Argument must not be a number")}return a(t,r,i)};SafeBuffer.alloc=function(t,r,i){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}var o=a(t);if(r!==undefined){if(typeof i==="string"){o.fill(r,i)}else{o.fill(r)}}else{o.fill(0)}return o};SafeBuffer.allocUnsafe=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return a(t)};SafeBuffer.allocUnsafeSlow=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return o.SlowBuffer(t)}},6911:(t,r,i)=>{
116
116
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
@@ -128,4 +128,4 @@ var o=i(4300);var a=o.Buffer;function copyProps(t,r){for(var i in t){r[i]=t[i]}}
128
128
  * @license [MIT]{@link https://github.com/archiverjs/node-zip-stream/blob/master/LICENSE}
129
129
  * @copyright (c) 2014 Chris Talkington, contributors.
130
130
  */
131
- var o=i(3837).inherits;var a=i(2096).ZipArchiveOutputStream;var l=i(2096).ZipArchiveEntry;var c=i(1246);var u=t.exports=function(t){if(!(this instanceof u)){return new u(t)}t=this.options=t||{};t.zlib=t.zlib||{};a.call(this,t);if(typeof t.level==="number"&&t.level>=0){t.zlib.level=t.level;delete t.level}if(!t.forceZip64&&typeof t.zlib.level==="number"&&t.zlib.level===0){t.store=true}t.namePrependSlash=t.namePrependSlash||false;if(t.comment&&t.comment.length>0){this.setComment(t.comment)}};o(u,a);u.prototype._normalizeFileData=function(t){t=c.defaults(t,{type:"file",name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:""});var r=t.type==="directory";var i=t.type==="symlink";if(t.name){t.name=c.sanitizePath(t.name);if(!i&&t.name.slice(-1)==="/"){r=true;t.type="directory"}else if(r){t.name+="/"}}if(r||i){t.store=true}t.date=c.dateify(t.date);return t};u.prototype.entry=function(t,r,i){if(typeof i!=="function"){i=this._emitErrorCallback.bind(this)}r=this._normalizeFileData(r);if(r.type!=="file"&&r.type!=="directory"&&r.type!=="symlink"){i(new Error(r.type+" entries not currently supported"));return}if(typeof r.name!=="string"||r.name.length===0){i(new Error("entry name must be a non-empty string value"));return}if(r.type==="symlink"&&typeof r.linkname!=="string"){i(new Error("entry linkname must be a non-empty string value when type equals symlink"));return}var o=new l(r.name);o.setTime(r.date,this.options.forceLocalTime);if(r.namePrependSlash){o.setName(r.name,true)}if(r.store){o.setMethod(0)}if(r.comment.length>0){o.setComment(r.comment)}if(r.type==="symlink"&&typeof r.mode!=="number"){r.mode=40960}if(typeof r.mode==="number"){if(r.type==="symlink"){r.mode|=40960}o.setUnixMode(r.mode)}if(r.type==="symlink"&&typeof r.linkname==="string"){t=Buffer.from(r.linkname)}return a.prototype.entry.call(this,o,t,i)};u.prototype.finalize=function(){this.finish()}},7666:(t,r,i)=>{"use strict";i.r(r);const o=10;const wrapAnsi16=(t=0)=>r=>`[${r+t}m`;const wrapAnsi256=(t=0)=>r=>`[${38+t};5;${r}m`;const wrapAnsi16m=(t=0)=>(r,i,o)=>`[${38+t};2;${r};${i};${o}m`;function assembleStyles(){const t=new Map;const r={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};r.color.gray=r.color.blackBright;r.bgColor.bgGray=r.bgColor.bgBlackBright;r.color.grey=r.color.blackBright;r.bgColor.bgGrey=r.bgColor.bgBlackBright;for(const[i,o]of Object.entries(r)){for(const[i,a]of Object.entries(o)){r[i]={open:`[${a[0]}m`,close:`[${a[1]}m`};o[i]=r[i];t.set(a[0],a[1])}Object.defineProperty(r,i,{value:o,enumerable:false})}Object.defineProperty(r,"codes",{value:t,enumerable:false});r.color.close="";r.bgColor.close="";r.color.ansi=wrapAnsi16();r.color.ansi256=wrapAnsi256();r.color.ansi16m=wrapAnsi16m();r.bgColor.ansi=wrapAnsi16(o);r.bgColor.ansi256=wrapAnsi256(o);r.bgColor.ansi16m=wrapAnsi16m(o);Object.defineProperties(r,{rgbToAnsi256:{value:(t,r,i)=>{if(t===r&&r===i){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:false},hexToRgb:{value:t=>{const r=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!r){return[0,0,0]}let{colorString:i}=r.groups;if(i.length===3){i=[...i].map((t=>t+t)).join("")}const o=Number.parseInt(i,16);return[o>>16&255,o>>8&255,o&255]},enumerable:false},hexToAnsi256:{value:t=>r.rgbToAnsi256(...r.hexToRgb(t)),enumerable:false},ansi256ToAnsi:{value:t=>{if(t<8){return 30+t}if(t<16){return 90+(t-8)}let r;let i;let o;if(t>=232){r=((t-232)*10+8)/255;i=r;o=r}else{t-=16;const a=t%36;r=Math.floor(t/36)/5;i=Math.floor(a/6)/5;o=a%6/5}const a=Math.max(r,i,o)*2;if(a===0){return 30}let l=30+(Math.round(o)<<2|Math.round(i)<<1|Math.round(r));if(a===2){l+=60}return l},enumerable:false},rgbToAnsi:{value:(t,i,o)=>r.ansi256ToAnsi(r.rgbToAnsi256(t,i,o)),enumerable:false},hexToAnsi:{value:t=>r.ansi256ToAnsi(r.hexToAnsi256(t)),enumerable:false}});return r}const a=assembleStyles();const l=a;const c=require("node:process");const u=require("node:os");const h=require("node:tty");function hasFlag(t,r=c.argv){const i=t.startsWith("-")?"":t.length===1?"-":"--";const o=r.indexOf(i+t);const a=r.indexOf("--");return o!==-1&&(a===-1||o<a)}const{env:d}=c;let p;if(hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")){p=0}else if(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always")){p=1}function envForceColor(){if("FORCE_COLOR"in d){if(d.FORCE_COLOR==="true"){return 1}if(d.FORCE_COLOR==="false"){return 0}return d.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(d.FORCE_COLOR,10),3)}}function translateLevel(t){if(t===0){return false}return{level:t,hasBasic:true,has256:t>=2,has16m:t>=3}}function _supportsColor(t,{streamIsTTY:r,sniffFlags:i=true}={}){const o=envForceColor();if(o!==undefined){p=o}const a=i?p:o;if(a===0){return 0}if(i){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor")){return 3}if(hasFlag("color=256")){return 2}}if(t&&!r&&a===undefined){return 0}const l=a||0;if(d.TERM==="dumb"){return l}if(c.platform==="win32"){const t=u.release().split(".");if(Number(t[0])>=10&&Number(t[2])>=10586){return Number(t[2])>=14931?3:2}return 1}if("CI"in d){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((t=>t in d))||d.CI_NAME==="codeship"){return 1}return l}if("TEAMCITY_VERSION"in d){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(d.TEAMCITY_VERSION)?1:0}if("TF_BUILD"in d&&"AGENT_NAME"in d){return 1}if(d.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in d){const t=Number.parseInt((d.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(d.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(d.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(d.TERM)){return 1}if("COLORTERM"in d){return 1}return l}function createSupportsColor(t,r={}){const i=_supportsColor(t,{streamIsTTY:t&&t.isTTY,...r});return translateLevel(i)}const m={stdout:createSupportsColor({isTTY:h.isatty(1)}),stderr:createSupportsColor({isTTY:h.isatty(2)})};const y=m;function stringReplaceAll(t,r,i){let o=t.indexOf(r);if(o===-1){return t}const a=r.length;let l=0;let c="";do{c+=t.substr(l,o-l)+r+i;l=o+a;o=t.indexOf(r,l)}while(o!==-1);c+=t.slice(l);return c}function stringEncaseCRLFWithFirstIndex(t,r,i,o){let a=0;let l="";do{const c=t[o-1]==="\r";l+=t.substr(a,(c?o-1:o)-a)+r+(c?"\r\n":"\n")+i;a=o+1;o=t.indexOf("\n",a)}while(o!==-1);l+=t.slice(a);return l}const{stdout:g,stderr:b}=y;const v=Symbol("GENERATOR");const _=Symbol("STYLER");const w=Symbol("IS_EMPTY");const E=["ansi","ansi","ansi256","ansi16m"];const S=Object.create(null);const applyOptions=(t,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const i=g?g.level:0;t.level=r.level===undefined?i:r.level};class Chalk{constructor(t){return chalkFactory(t)}}const chalkFactory=t=>{const chalk=(...t)=>t.join(" ");applyOptions(chalk,t);Object.setPrototypeOf(chalk,createChalk.prototype);return chalk};function createChalk(t){return chalkFactory(t)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[t,r]of Object.entries(l)){S[t]={get(){const i=createBuilder(this,createStyler(r.open,r.close,this[_]),this[w]);Object.defineProperty(this,t,{value:i});return i}}}S.visible={get(){const t=createBuilder(this,this[_],true);Object.defineProperty(this,"visible",{value:t});return t}};const getModelAnsi=(t,r,i,...o)=>{if(t==="rgb"){if(r==="ansi16m"){return l[i].ansi16m(...o)}if(r==="ansi256"){return l[i].ansi256(l.rgbToAnsi256(...o))}return l[i].ansi(l.rgbToAnsi(...o))}if(t==="hex"){return getModelAnsi("rgb",r,i,...l.hexToRgb(...o))}return l[i][t](...o)};const O=["rgb","hex","ansi256"];for(const t of O){S[t]={get(){const{level:r}=this;return function(...i){const o=createStyler(getModelAnsi(t,E[r],"color",...i),l.color.close,this[_]);return createBuilder(this,o,this[w])}}};const r="bg"+t[0].toUpperCase()+t.slice(1);S[r]={get(){const{level:r}=this;return function(...i){const o=createStyler(getModelAnsi(t,E[r],"bgColor",...i),l.bgColor.close,this[_]);return createBuilder(this,o,this[w])}}}}const R=Object.defineProperties((()=>{}),{...S,level:{enumerable:true,get(){return this[v].level},set(t){this[v].level=t}}});const createStyler=(t,r,i)=>{let o;let a;if(i===undefined){o=t;a=r}else{o=i.openAll+t;a=r+i.closeAll}return{open:t,close:r,openAll:o,closeAll:a,parent:i}};const createBuilder=(t,r,i)=>{const builder=(...t)=>applyStyle(builder,t.length===1?""+t[0]:t.join(" "));Object.setPrototypeOf(builder,R);builder[v]=t;builder[_]=r;builder[w]=i;return builder};const applyStyle=(t,r)=>{if(t.level<=0||!r){return t[w]?"":r}let i=t[_];if(i===undefined){return r}const{openAll:o,closeAll:a}=i;if(r.includes("")){while(i!==undefined){r=stringReplaceAll(r,i.close,i.open);i=i.parent}}const l=r.indexOf("\n");if(l!==-1){r=stringEncaseCRLFWithFirstIndex(r,a,o,l)}return o+r+a};Object.defineProperties(createChalk.prototype,S);const x=createChalk();const k=createChalk({level:b?b.level:0});const T=x;var A=i(345);const{program:C,createCommand:P,createArgument:I,createOption:L,CommanderError:M,InvalidArgumentError:D,InvalidOptionArgumentError:N,Command:j,Argument:B,Option:$,Help:H}=A;var U=i(5656);var q=i.n(U);var z=i(1017);var G=i.n(z);var W=i(7147);var V=i.n(W);function isSetup(){try{const t=V().statSync(G().join(process.cwd(),".hyperbook"));if(!t.isDirectory()){throw Error()}}catch(t){console.log(T.red("Could not find .hyperbook folder. Be sure to run `hyperbook setup`."));return false}try{V().statSync(G().join(process.cwd(),".hyperbook","node_modules",".bin","next"))}catch(t){console.log(T.red("Could not find next binary in the .hyperbook folder. Be sure to run `hyperbook setup`."));return false}return true}var Y=i(2202);var Z=i.n(Y);var K=i(7282);var Q=i.n(K);async function archiveFolder(t){return new Promise(((r,i)=>{const o=G().join(Q().cwd(),"public","archives");if(!V().existsSync(o)){V().mkdirSync(o,{recursive:true})}const a=G().join(o,t+".zip");const l=V().createWriteStream(a);const c=Z()("zip",{zlib:{level:9}});c.on("finish",(()=>{console.log(T.green("Archive zipped: ")+t);r()}));c.on("error",(t=>{throw t}));c.pipe(l);c.directory(G().join(Q().cwd(),"archives",t),false);c.finalize()}))}async function runArchive(){const t=isSetup();if(!t){throw new Error("no setup")}return new Promise(((t,r)=>{if(!V().existsSync(G().join(Q().cwd(),"archives"))){console.log(T.blue("info ")+"- No Archives found");t()}const i=V().readdirSync(G().join(Q().cwd(),"archives"),{withFileTypes:true}).filter((t=>t.isDirectory()));Promise.all(i.map((t=>archiveFolder(t.name)))).then((()=>{t()})).catch((()=>{r()}))}))}var X=i(4488);var J=i.n(X);async function readHyperbook(){return new Promise(((t,r)=>{V().readFile(G().join(process.cwd(),"hyperbook.json"),((i,o)=>{if(i){console.log(T.red("Could not find 'hyperbook.json'. Make sure you are in the right directory."));r()}else{const r=JSON.parse(o.toString());t(r)}}))}))}async function runBuild(){const t=isSetup();if(!t){throw new Error("no setup")}const r=await readHyperbook();V().writeFileSync(G().join(process.cwd(),".hyperbook","next.config.js"),`\nmodule.exports = {\n ${(r===null||r===void 0?void 0:r.basePath)?`basePath: '${r.basePath}',`:""}\n typescript: {\n ignoreBuildErrors: true,\n }\n}\n `);return new Promise(((t,r)=>{const i="npm";const o=["run","build"];const a=J()(i,o,{stdio:"inherit",cwd:G().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});a.on("close",(a=>{if(a!==0){r({command:`${i} ${o.join(" ")}`});return}t()}))}))}async function runDev(){const t=isSetup();if(!t){throw new Error("no setup")}return new Promise(((t,r)=>{const i="npm";const o=["run","dev"];const a=J()(i,o,{stdio:"inherit",cwd:G().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});a.on("close",(a=>{if(a!==0){r({command:`${i} ${o.join(" ")}`});return}t()}))}))}var ee=i(2081);function getPkgManager(){try{const t=process.env.npm_config_user_agent;if(t){if(t.startsWith("yarn")){return"yarn"}else if(t.startsWith("pnpm")){return"pnpm"}}try{(0,ee.execSync)("yarn --version",{stdio:"ignore"});return"yarn"}catch{(0,ee.execSync)("pnpm --version",{stdio:"ignore"});return"pnpm"}}catch{return"npm"}}var te=i(2037);var re=i.n(te);const ie=require("node:events");const se=require("node:path");function indentString(t,r=1,i={}){const{indent:o=" ",includeEmptyLines:a=false}=i;if(typeof t!=="string"){throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``)}if(typeof r!=="number"){throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``)}if(r<0){throw new RangeError(`Expected \`count\` to be at least 0, got \`${r}\``)}if(typeof o!=="string"){throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof o}\``)}if(r===0){return t}const l=a?/^/gm:/^(?!\s*$)/gm;return t.replace(l,o.repeat(r))}function escapeStringRegexp(t){if(typeof t!=="string"){throw new TypeError("Expected a string")}return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const ne=/\s+at.*[(\s](.*)\)?/;const oe=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/;const ae=typeof te.homedir==="undefined"?"":te.homedir().replace(/\\/g,"/");function cleanStack(t,{pretty:r=false,basePath:i}={}){const o=i&&new RegExp(`(at | \\()${escapeStringRegexp(i.replace(/\\/g,"/"))}`,"g");if(typeof t!=="string"){return undefined}return t.replace(/\\/g,"/").split("\n").filter((t=>{const r=t.match(ne);if(r===null||!r[1]){return true}const i=r[1];if(i.includes(".app/Contents/Resources/electron.asar")||i.includes(".app/Contents/Resources/default_app.asar")){return false}return!oe.test(i)})).filter((t=>t.trim()!=="")).map((t=>{if(o){t=t.replace(o,"$1")}if(r){t=t.replace(ne,((t,r)=>t.replace(r,r.replace(ae,"~"))))}return t})).join("\n")}const cleanInternalStack=t=>t.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");class AggregateError extends Error{#e;name="AggregateError";constructor(t){if(!Array.isArray(t)){throw new TypeError(`Expected input to be an Array, got ${typeof t}`)}t=t.map((t=>{if(t instanceof Error){return t}if(t!==null&&typeof t==="object"){return Object.assign(new Error(t.message),t)}return new Error(t)}));let r=t.map((t=>typeof t.stack==="string"?cleanInternalStack(cleanStack(t.stack)):String(t))).join("\n");r="\n"+indentString(r,4);super(r);this.#e=t}get errors(){return this.#e.slice()}}async function pMap(t,r,{concurrency:i=Number.POSITIVE_INFINITY,stopOnError:o=true}={}){return new Promise(((a,l)=>{if(t[Symbol.iterator]===undefined&&t[Symbol.asyncIterator]===undefined){throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`)}if(typeof r!=="function"){throw new TypeError("Mapper function is required")}if(!((Number.isSafeInteger(i)||i===Number.POSITIVE_INFINITY)&&i>=1)){throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${i}\` (${typeof i})`)}const c=[];const u=[];const h=new Map;let d=false;let p=false;let m=false;let y=0;let g=0;const b=t[Symbol.iterator]===undefined?t[Symbol.asyncIterator]():t[Symbol.iterator]();const reject=t=>{d=true;p=true;l(t)};const next=async()=>{if(p){return}const t=await b.next();const i=g;g++;if(t.done){m=true;if(y===0&&!p){if(!o&&u.length>0){reject(new AggregateError(u));return}p=true;if(!h.size){a(c);return}const t=[];for(const[r,i]of c.entries()){if(h.get(r)===le){continue}t.push(i)}a(t)}return}y++;(async()=>{try{const o=await t.value;if(p){return}const a=await r(o,i);if(a===le){h.set(i,a)}c[i]=a;y--;await next()}catch(t){if(o){reject(t)}else{u.push(t);y--;try{await next()}catch(t){reject(t)}}}})()};(async()=>{for(let t=0;t<i;t++){try{await next()}catch(t){reject(t);break}if(m||d){break}}})()}))}const le=Symbol("skip");function arrify(t){if(t===null||t===undefined){return[]}if(Array.isArray(t)){return t}if(typeof t==="string"){return[t]}if(typeof t[Symbol.iterator]==="function"){return[...t]}return[t]}var ce=i(8174);class AbortError extends Error{constructor(t){super();this.name="AbortError";this.message=t}}const getDOMException=t=>globalThis.DOMException===undefined?new AbortError(t):new DOMException(t);const getAbortedReason=t=>{const r=t.reason===undefined?getDOMException("This operation was aborted."):t.reason;return r instanceof Error?r:getDOMException(r)};async function p_map_pMap(t,r,{concurrency:i=Number.POSITIVE_INFINITY,stopOnError:o=true,signal:a}={}){return new Promise(((l,c)=>{if(t[Symbol.iterator]===undefined&&t[Symbol.asyncIterator]===undefined){throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`)}if(typeof r!=="function"){throw new TypeError("Mapper function is required")}if(!((Number.isSafeInteger(i)||i===Number.POSITIVE_INFINITY)&&i>=1)){throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${i}\` (${typeof i})`)}const u=[];const h=[];const d=new Map;let p=false;let m=false;let y=false;let g=0;let b=0;const v=t[Symbol.iterator]===undefined?t[Symbol.asyncIterator]():t[Symbol.iterator]();const reject=t=>{p=true;m=true;c(t)};if(a){if(a.aborted){reject(getAbortedReason(a))}a.addEventListener("abort",(()=>{reject(getAbortedReason(a))}))}const next=async()=>{if(m){return}const t=await v.next();const i=b;b++;if(t.done){y=true;if(g===0&&!m){if(!o&&h.length>0){reject(new AggregateError(h));return}m=true;if(d.size===0){l(u);return}const t=[];for(const[r,i]of u.entries()){if(d.get(r)===ue){continue}t.push(i)}l(t)}return}g++;(async()=>{try{const o=await t.value;if(m){return}const a=await r(o,i);if(a===ue){d.set(i,a)}u[i]=a;g--;await next()}catch(t){if(o){reject(t)}else{h.push(t);g--;try{await next()}catch(t){reject(t)}}}})()};(async()=>{for(let t=0;t<i;t++){try{await next()}catch(t){reject(t);break}if(y||p){break}}})()}))}const ue=Symbol("skip");async function pFilter(t,r,i){const o=await p_map_pMap(t,((t,i)=>Promise.all([r(t,i),t])),i);return o.filter((t=>Boolean(t[0]))).map((t=>t[1]))}const he=require("node:fs");var fe=i(9117);var de=i(5342);var pe=i(3286);var me=i(7993);function slash(t){const r=/^\\\\\?\\/.test(t);const i=/[^\u0000-\u0080]+/.test(t);if(r||i){return t}return t.replace(/\\/g,"/")}const ye=require("node:url");const ge=require("node:stream");const toPath=t=>t instanceof URL?(0,ye.fileURLToPath)(t):t;class FilterStream extends ge.Transform{constructor(t){super({objectMode:true,transform(r,i,o){o(undefined,t(r)?r:undefined)}})}}const isNegativePattern=t=>t[0]==="!";const be={ignore:["**/node_modules","**/flow-typed","**/coverage","**/.git"],absolute:true,dot:true};const ve="**/.gitignore";const applyBaseToPattern=(t,r)=>isNegativePattern(t)?"!"+se.posix.join(r,t.slice(1)):se.posix.join(r,t);const parseIgnoreFile=(t,r)=>{const i=slash(se.relative(r,se.dirname(t.filePath)));return t.content.split(/\r?\n/).filter((t=>t&&!t.startsWith("#"))).map((t=>applyBaseToPattern(t,i)))};const toRelativePath=(t,r)=>{r=slash(r);if(se.isAbsolute(t)){if(slash(t).startsWith(r)){return se.relative(r,t)}throw new Error(`Path ${t} is not in cwd ${r}`)}return t};const getIsIgnoredPredicate=(t,r)=>{const i=t.flatMap((t=>parseIgnoreFile(t,r)));const o=me().add(i);return t=>{t=toPath(t);t=toRelativePath(t,r);return o.ignores(slash(t))}};const normalizeOptions=(t={})=>({cwd:toPath(t.cwd)||c.cwd()});const isIgnoredByIgnoreFiles=async(t,r)=>{const{cwd:i}=normalizeOptions(r);const o=await de(t,{cwd:i,...be});const a=await Promise.all(o.map((async t=>({filePath:t,content:await he.promises.readFile(t,"utf8")}))));return getIsIgnoredPredicate(a,i)};const isIgnoredByIgnoreFilesSync=(t,r)=>{const{cwd:i}=normalizeOptions(r);const o=de.sync(t,{cwd:i,...be});const a=o.map((t=>({filePath:t,content:he.readFileSync(t,"utf8")})));return getIsIgnoredPredicate(a,i)};const isGitIgnored=t=>isIgnoredByIgnoreFiles(ve,t);const isGitIgnoredSync=t=>isIgnoredByIgnoreFilesSync(ve,t);const assertPatternsInput=t=>{if(t.some((t=>typeof t!=="string"))){throw new TypeError("Patterns must be a string or an array of strings")}};const toPatternsArray=t=>{t=[...new Set([t].flat())];assertPatternsInput(t);return t};const checkCwdOption=t=>{if(!t.cwd){return}let r;try{r=he.statSync(t.cwd)}catch{return}if(!r.isDirectory()){throw new Error("The `cwd` option must be a path to a directory")}};const globby_normalizeOptions=(t={})=>{t={ignore:[],expandDirectories:true,...t,cwd:toPath(t.cwd)};checkCwdOption(t);return t};const normalizeArguments=t=>async(r,i)=>t(toPatternsArray(r),globby_normalizeOptions(i));const normalizeArgumentsSync=t=>(r,i)=>t(toPatternsArray(r),globby_normalizeOptions(i));const getIgnoreFilesPatterns=t=>{const{ignoreFiles:r,gitignore:i}=t;const o=r?toPatternsArray(r):[];if(i){o.push(ve)}return o};const getFilter=async t=>{const r=getIgnoreFilesPatterns(t);return createFilterFunction(r.length>0&&await isIgnoredByIgnoreFiles(r,{cwd:t.cwd}))};const getFilterSync=t=>{const r=getIgnoreFilesPatterns(t);return createFilterFunction(r.length>0&&isIgnoredByIgnoreFilesSync(r,{cwd:t.cwd}))};const createFilterFunction=t=>{const r=new Set;return i=>{const o=i.path||i;const a=se.normalize(o);const l=r.has(a)||t&&t(o);r.add(a);return!l}};const unionFastGlobResults=(t,r)=>t.flat().filter((t=>r(t)));const unionFastGlobStreams=(t,r)=>fe(t).pipe(new FilterStream((t=>r(t))));const convertNegativePatterns=(t,r)=>{const i=[];while(t.length>0){const o=t.findIndex((t=>isNegativePattern(t)));if(o===-1){i.push({patterns:t,options:r});break}const a=t[o].slice(1);for(const t of i){t.options.ignore.push(a)}if(o!==0){i.push({patterns:t.slice(0,o),options:{...r,ignore:[...r.ignore,a]}})}t=t.slice(o+1)}return i};const getDirGlobOptions=(t,r)=>({...r?{cwd:r}:{},...Array.isArray(t)?{files:t}:t});const generateTasks=async(t,r)=>{const i=convertNegativePatterns(t,r);const{cwd:o,expandDirectories:a}=r;if(!a){return i}const l=getDirGlobOptions(a,o);const c=o?{cwd:o}:undefined;return Promise.all(i.map((async t=>{let{patterns:r,options:i}=t;[r,i.ignore]=await Promise.all([pe(r,l),pe(i.ignore,c)]);return{patterns:r,options:i}})))};const generateTasksSync=(t,r)=>{const i=convertNegativePatterns(t,r);const{cwd:o,expandDirectories:a}=r;if(!a){return i}const l=getDirGlobOptions(a,o);const c=o?{cwd:o}:undefined;return i.map((t=>{let{patterns:r,options:i}=t;r=pe.sync(r,l);i.ignore=pe.sync(i.ignore,c);return{patterns:r,options:i}}))};const _e=normalizeArguments((async(t,r)=>{const[i,o]=await Promise.all([generateTasks(t,r),getFilter(r)]);const a=await Promise.all(i.map((t=>de(t.patterns,t.options))));return unionFastGlobResults(a,o)}));const we=normalizeArgumentsSync(((t,r)=>{const i=generateTasksSync(t,r);const o=getFilterSync(r);const a=i.map((t=>de.sync(t.patterns,t.options)));return unionFastGlobResults(a,o)}));const Ee=normalizeArgumentsSync(((t,r)=>{const i=generateTasksSync(t,r);const o=getFilterSync(r);const a=i.map((t=>de.stream(t.patterns,t.options)));return unionFastGlobStreams(a,o)}));const Se=normalizeArgumentsSync(((t,r)=>t.some((t=>de.isDynamicPattern(t,r)))));const Oe=normalizeArguments(generateTasks);const Re=normalizeArgumentsSync(generateTasksSync);var xe=i(7971);var ke=i(3134);class CpyError extends ke{constructor(t,r){super(t,r);Object.assign(this,r);this.name="CpyError"}}const Te=["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^Desktop\\.ini$","@eaDir$"];const Ae=new RegExp(Te.join("|"));function isJunk(t){return Ae.test(t)}function isNotJunk(t){return!isJunk(t)}class GlobPattern{constructor(t,r,i){this.path=t;this.originalPath=t;this.destination=r;this.options=i;this.isDirectory=false;if(!Se(t)&&he.existsSync(t)&&he.lstatSync(t).isDirectory()){this.path=[t,"**"].join("/");this.isDirectory=true}}get name(){return se.basename(this.originalPath)}get normalizedPath(){const t=this.originalPath.split("/");const r=t.findIndex((t=>t?Se(t):false));const i=t.slice(0,r).join("/");if(i){return se.isAbsolute(i)?i:se.join(this.options.cwd,i)}return this.destination}hasMagic(){return Se(this.options.flat?this.path:this.originalPath)}getMatches(){let t=we(this.path,{...this.options,dot:true,absolute:true,onlyFiles:true});if(this.options.ignoreJunk){t=t.filter((t=>isNotJunk(se.basename(t))))}return t}}const Ce=(u.cpus().length||1)*2;const Pe={ignoreJunk:true,flat:false,cwd:c.cwd()};class Entry{constructor(t,r,i){this.path=t.split("/").join(se.sep);this.relativePath=r.split("/").join(se.sep);this.pattern=i;Object.freeze(this)}get name(){return se.basename(this.path)}get nameWithoutExtension(){return se.basename(this.path,se.extname(this.path))}get extension(){return se.extname(this.path).slice(1)}}const expandPatternsWithBraceExpansion=t=>t.flatMap((t=>xe.braces(t,{expand:true,nodupes:true})));const preprocessDestinationPath=({entry:t,destination:r,options:i})=>{if(t.pattern.hasMagic()){if(i.flat){if(se.isAbsolute(r)){return se.join(r,t.name)}return se.join(i.cwd,r,t.name)}return se.join(r,se.relative(t.pattern.normalizedPath,t.path))}if(se.isAbsolute(r)){return se.join(r,t.name)}if(t.pattern.isDirectory&&se.relative(i.cwd,t.path).startsWith("..")){return se.join(i.cwd,r,se.basename(t.pattern.originalPath),se.relative(t.pattern.originalPath,t.path))}if(!t.pattern.isDirectory&&t.path===t.relativePath){return se.join(i.cwd,r,se.basename(t.pattern.originalPath),se.relative(t.pattern.originalPath,t.path))}if(!t.pattern.isDirectory&&i.flat){return se.join(i.cwd,r,se.basename(t.pattern.originalPath))}return se.join(i.cwd,r,se.relative(i.cwd,t.path))};const renameFile=(t,r)=>{const i=se.basename(t,se.extname(t));const o=se.extname(t);const a=se.dirname(t);if(typeof r==="string"){return se.join(a,r)}if(typeof r==="function"){return se.join(a,`${r(i)}${o}`)}return t};function cpy(t,r,{concurrency:i=Ce,...o}={}){const a=new Map;const l=new ie;o={...Pe,...o};const c=(async()=>{let c=[];let u=0;let h=0;let d=expandPatternsWithBraceExpansion(arrify(t)).map((t=>t.replace(/\\/g,"/")));const p=d.filter((t=>!t.startsWith("!")));const m=d.filter((t=>t.startsWith("!")));if(p.length===0||!r){throw new CpyError("`source` and `destination` required")}d=d.map((t=>new GlobPattern(t,r,{...o,ignore:m})));for(const t of d){let r=[];try{r=t.getMatches()}catch(r){throw new CpyError(`Cannot glob \`${t.originalPath}\`: ${r.message}`,r)}if(r.length===0&&!Se(t.originalPath)&&!Se(m)){throw new CpyError(`Cannot copy \`${t.originalPath}\`: the file doesn't exist`)}c=[...c,...r.map((r=>new Entry(r,se.relative(o.cwd,r),t)))]}if(o.filter!==undefined){c=await pFilter(c,o.filter,{concurrency:1024})}if(c.length===0){l.emit("progress",{totalFiles:0,percent:1,completedFiles:0,completedSize:0})}const fileProgressHandler=t=>{const r=a.get(t.sourcePath)||{writtenBytes:0,percent:0};if(r.writtenBytes!==t.writtenBytes||r.percent!==t.percent){h-=r.writtenBytes;h+=t.writtenBytes;if(t.percent===1&&r.percent!==1){u++}a.set(t.sourcePath,{writtenBytes:t.writtenBytes,percent:t.percent});l.emit("progress",{totalFiles:c.length,percent:u/c.length,completedFiles:u,completedSize:h})}};return pMap(c,(async t=>{const i=renameFile(preprocessDestinationPath({entry:t,destination:r,options:o}),o.rename);try{await ce(t.path,i,o).on("progress",fileProgressHandler)}catch(r){throw new CpyError(`Cannot copy from \`${t.relativePath}\` to \`${i}\`: ${r.message}`,r)}return i}),{concurrency:i})})();c.on=(...t)=>{l.on(...t);return c};return c}var Ie=i(5713);var Le=i.n(Ie);function isFolderEmpty(t,r){const i=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log"];const o=V().readdirSync(t).filter((t=>!i.includes(t))).filter((t=>!/\.iml$/.test(t)));if(o.length>0){console.log(`The directory ${T.green(r)} contains files that could conflict:`);console.log();for(const r of o){try{const i=V().lstatSync(G().join(t,r));if(i.isDirectory()){console.log(` ${T.blue(r)}/`)}else{console.log(` ${r}`)}}catch{console.log(` ${r}`)}}console.log();console.log("Either try using a new directory name, or remove the files listed above.");console.log();return false}return true}async function isWriteable(t){try{await V().promises.access(t,(V().constants||V()).W_OK);return true}catch(t){return false}}async function makeDir(t,r={recursive:true}){await V().promises.mkdir(t,r)}var Me=i(4700);var De=i.n(Me);function isInGitRepository(){try{(0,ee.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"});return true}catch(t){}return false}function isInMercurialRepository(){try{(0,ee.execSync)("hg --cwd . root",{stdio:"ignore"});return true}catch(t){}return false}function tryGitInit(t){let r=false;try{(0,ee.execSync)("git --version",{stdio:"ignore"});if(isInGitRepository()||isInMercurialRepository()){return false}(0,ee.execSync)("git init",{stdio:"ignore"});r=true;(0,ee.execSync)("git checkout -b main",{stdio:"ignore"});(0,ee.execSync)("git add -A",{stdio:"ignore"});(0,ee.execSync)('git commit -m "Initial commit from Hyperbook"',{stdio:"ignore"});return true}catch(i){if(r){try{De().sync(G().join(t,".git"))}catch(t){}}return false}}const Ne=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function isTypedArrayName(t){return Ne.includes(t)}const je=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...Ne];function isObjectTypeName(t){return je.includes(t)}const Fe=["null","undefined","string","number","bigint","boolean","symbol"];function isPrimitiveTypeName(t){return Fe.includes(t)}function isOfType(t){return r=>typeof r===t}const{toString:Be}=Object.prototype;const getObjectType=t=>{const r=Be.call(t).slice(8,-1);if(/HTML\w+Element/.test(r)&&is.domElement(t)){return"HTMLElement"}if(isObjectTypeName(r)){return r}return undefined};const isObjectOfType=t=>r=>getObjectType(r)===t;function is(t){if(t===null){return"null"}switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"NaN":"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(is.observable(t)){return"Observable"}if(is.array(t)){return"Array"}if(is.buffer(t)){return"Buffer"}const r=getObjectType(t);if(r){return r}if(t instanceof String||t instanceof Boolean||t instanceof Number){throw new TypeError("Please don't use object wrappers for primitive types")}return"Object"}is.undefined=isOfType("undefined");is.string=isOfType("string");const $e=isOfType("number");is.number=t=>$e(t)&&!is.nan(t);is.bigint=isOfType("bigint");is.function_=isOfType("function");is.null_=t=>t===null;is.class_=t=>is.function_(t)&&t.toString().startsWith("class ");is.boolean=t=>t===true||t===false;is.symbol=isOfType("symbol");is.numericString=t=>is.string(t)&&!is.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));is.array=(t,r)=>{if(!Array.isArray(t)){return false}if(!is.function_(r)){return true}return t.every((t=>r(t)))};is.buffer=t=>t?.constructor?.isBuffer?.(t)??false;is.blob=t=>isObjectOfType("Blob")(t);is.nullOrUndefined=t=>is.null_(t)||is.undefined(t);is.object=t=>!is.null_(t)&&(typeof t==="object"||is.function_(t));is.iterable=t=>is.function_(t?.[Symbol.iterator]);is.asyncIterable=t=>is.function_(t?.[Symbol.asyncIterator]);is.generator=t=>is.iterable(t)&&is.function_(t?.next)&&is.function_(t?.throw);is.asyncGenerator=t=>is.asyncIterable(t)&&is.function_(t.next)&&is.function_(t.throw);is.nativePromise=t=>isObjectOfType("Promise")(t);const hasPromiseApi=t=>is.function_(t?.then)&&is.function_(t?.catch);is.promise=t=>is.nativePromise(t)||hasPromiseApi(t);is.generatorFunction=isObjectOfType("GeneratorFunction");is.asyncGeneratorFunction=t=>getObjectType(t)==="AsyncGeneratorFunction";is.asyncFunction=t=>getObjectType(t)==="AsyncFunction";is.boundFunction=t=>is.function_(t)&&!t.hasOwnProperty("prototype");is.regExp=isObjectOfType("RegExp");is.date=isObjectOfType("Date");is.error=isObjectOfType("Error");is.map=t=>isObjectOfType("Map")(t);is.set=t=>isObjectOfType("Set")(t);is.weakMap=t=>isObjectOfType("WeakMap")(t);is.weakSet=t=>isObjectOfType("WeakSet")(t);is.weakRef=t=>isObjectOfType("WeakRef")(t);is.int8Array=isObjectOfType("Int8Array");is.uint8Array=isObjectOfType("Uint8Array");is.uint8ClampedArray=isObjectOfType("Uint8ClampedArray");is.int16Array=isObjectOfType("Int16Array");is.uint16Array=isObjectOfType("Uint16Array");is.int32Array=isObjectOfType("Int32Array");is.uint32Array=isObjectOfType("Uint32Array");is.float32Array=isObjectOfType("Float32Array");is.float64Array=isObjectOfType("Float64Array");is.bigInt64Array=isObjectOfType("BigInt64Array");is.bigUint64Array=isObjectOfType("BigUint64Array");is.arrayBuffer=isObjectOfType("ArrayBuffer");is.sharedArrayBuffer=isObjectOfType("SharedArrayBuffer");is.dataView=isObjectOfType("DataView");is.enumCase=(t,r)=>Object.values(r).includes(t);is.directInstanceOf=(t,r)=>Object.getPrototypeOf(t)===r.prototype;is.urlInstance=t=>isObjectOfType("URL")(t);is.urlString=t=>{if(!is.string(t)){return false}try{new URL(t);return true}catch{return false}};is.truthy=t=>Boolean(t);is.falsy=t=>!t;is.nan=t=>Number.isNaN(t);is.primitive=t=>is.null_(t)||isPrimitiveTypeName(typeof t);is.integer=t=>Number.isInteger(t);is.safeInteger=t=>Number.isSafeInteger(t);is.plainObject=t=>{if(typeof t!=="object"||t===null){return false}const r=Object.getPrototypeOf(t);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};is.typedArray=t=>isTypedArrayName(getObjectType(t));const isValidLength=t=>is.safeInteger(t)&&t>=0;is.arrayLike=t=>!is.nullOrUndefined(t)&&!is.function_(t)&&isValidLength(t.length);is.inRange=(t,r)=>{if(is.number(r)){return t>=Math.min(0,r)&&t<=Math.max(r,0)}if(is.array(r)&&r.length===2){return t>=Math.min(...r)&&t<=Math.max(...r)}throw new TypeError(`Invalid range: ${JSON.stringify(r)}`)};const He=1;const Ue=["innerHTML","ownerDocument","style","attributes","nodeValue"];is.domElement=t=>is.object(t)&&t.nodeType===He&&is.string(t.nodeName)&&!is.plainObject(t)&&Ue.every((r=>r in t));is.observable=t=>{if(!t){return false}if(t===t[Symbol.observable]?.()){return true}if(t===t["@@observable"]?.()){return true}return false};is.nodeStream=t=>is.object(t)&&is.function_(t.pipe)&&!is.observable(t);is.infinite=t=>t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY;const isAbsoluteMod2=t=>r=>is.integer(r)&&Math.abs(r%2)===t;is.evenInteger=isAbsoluteMod2(0);is.oddInteger=isAbsoluteMod2(1);is.emptyArray=t=>is.array(t)&&t.length===0;is.nonEmptyArray=t=>is.array(t)&&t.length>0;is.emptyString=t=>is.string(t)&&t.length===0;const isWhiteSpaceString=t=>is.string(t)&&!/\S/.test(t);is.emptyStringOrWhitespace=t=>is.emptyString(t)||isWhiteSpaceString(t);is.nonEmptyString=t=>is.string(t)&&t.length>0;is.nonEmptyStringAndNotWhitespace=t=>is.string(t)&&!is.emptyStringOrWhitespace(t);is.emptyObject=t=>is.object(t)&&!is.map(t)&&!is.set(t)&&Object.keys(t).length===0;is.nonEmptyObject=t=>is.object(t)&&!is.map(t)&&!is.set(t)&&Object.keys(t).length>0;is.emptySet=t=>is.set(t)&&t.size===0;is.nonEmptySet=t=>is.set(t)&&t.size>0;is.emptyMap=t=>is.map(t)&&t.size===0;is.nonEmptyMap=t=>is.map(t)&&t.size>0;is.propertyKey=t=>is.any([is.string,is.number,is.symbol],t);is.formData=t=>isObjectOfType("FormData")(t);is.urlSearchParams=t=>isObjectOfType("URLSearchParams")(t);const predicateOnArray=(t,r,i)=>{if(!is.function_(r)){throw new TypeError(`Invalid predicate: ${JSON.stringify(r)}`)}if(i.length===0){throw new TypeError("Invalid number of values")}return t.call(i,r)};is.any=(t,...r)=>{const i=is.array(t)?t:[t];return i.some((t=>predicateOnArray(Array.prototype.some,t,r)))};is.all=(t,...r)=>predicateOnArray(Array.prototype.every,t,r);const assertType=(t,r,i,o={})=>{if(!t){const{multipleValues:t}=o;const a=t?`received values of types ${[...new Set(i.map((t=>`\`${is(t)}\``)))].join(", ")}`:`received value of type \`${is(i)}\``;throw new TypeError(`Expected value which is \`${r}\`, ${a}.`)}};const qe={undefined:t=>assertType(is.undefined(t),"undefined",t),string:t=>assertType(is.string(t),"string",t),number:t=>assertType(is.number(t),"number",t),bigint:t=>assertType(is.bigint(t),"bigint",t),function_:t=>assertType(is.function_(t),"Function",t),null_:t=>assertType(is.null_(t),"null",t),class_:t=>assertType(is.class_(t),"Class",t),boolean:t=>assertType(is.boolean(t),"boolean",t),symbol:t=>assertType(is.symbol(t),"symbol",t),numericString:t=>assertType(is.numericString(t),"string with a number",t),array:(t,r)=>{const i=assertType;i(is.array(t),"Array",t);if(r){t.forEach(r)}},buffer:t=>assertType(is.buffer(t),"Buffer",t),blob:t=>assertType(is.blob(t),"Blob",t),nullOrUndefined:t=>assertType(is.nullOrUndefined(t),"null or undefined",t),object:t=>assertType(is.object(t),"Object",t),iterable:t=>assertType(is.iterable(t),"Iterable",t),asyncIterable:t=>assertType(is.asyncIterable(t),"AsyncIterable",t),generator:t=>assertType(is.generator(t),"Generator",t),asyncGenerator:t=>assertType(is.asyncGenerator(t),"AsyncGenerator",t),nativePromise:t=>assertType(is.nativePromise(t),"native Promise",t),promise:t=>assertType(is.promise(t),"Promise",t),generatorFunction:t=>assertType(is.generatorFunction(t),"GeneratorFunction",t),asyncGeneratorFunction:t=>assertType(is.asyncGeneratorFunction(t),"AsyncGeneratorFunction",t),asyncFunction:t=>assertType(is.asyncFunction(t),"AsyncFunction",t),boundFunction:t=>assertType(is.boundFunction(t),"Function",t),regExp:t=>assertType(is.regExp(t),"RegExp",t),date:t=>assertType(is.date(t),"Date",t),error:t=>assertType(is.error(t),"Error",t),map:t=>assertType(is.map(t),"Map",t),set:t=>assertType(is.set(t),"Set",t),weakMap:t=>assertType(is.weakMap(t),"WeakMap",t),weakSet:t=>assertType(is.weakSet(t),"WeakSet",t),weakRef:t=>assertType(is.weakRef(t),"WeakRef",t),int8Array:t=>assertType(is.int8Array(t),"Int8Array",t),uint8Array:t=>assertType(is.uint8Array(t),"Uint8Array",t),uint8ClampedArray:t=>assertType(is.uint8ClampedArray(t),"Uint8ClampedArray",t),int16Array:t=>assertType(is.int16Array(t),"Int16Array",t),uint16Array:t=>assertType(is.uint16Array(t),"Uint16Array",t),int32Array:t=>assertType(is.int32Array(t),"Int32Array",t),uint32Array:t=>assertType(is.uint32Array(t),"Uint32Array",t),float32Array:t=>assertType(is.float32Array(t),"Float32Array",t),float64Array:t=>assertType(is.float64Array(t),"Float64Array",t),bigInt64Array:t=>assertType(is.bigInt64Array(t),"BigInt64Array",t),bigUint64Array:t=>assertType(is.bigUint64Array(t),"BigUint64Array",t),arrayBuffer:t=>assertType(is.arrayBuffer(t),"ArrayBuffer",t),sharedArrayBuffer:t=>assertType(is.sharedArrayBuffer(t),"SharedArrayBuffer",t),dataView:t=>assertType(is.dataView(t),"DataView",t),enumCase:(t,r)=>assertType(is.enumCase(t,r),"EnumCase",t),urlInstance:t=>assertType(is.urlInstance(t),"URL",t),urlString:t=>assertType(is.urlString(t),"string with a URL",t),truthy:t=>assertType(is.truthy(t),"truthy",t),falsy:t=>assertType(is.falsy(t),"falsy",t),nan:t=>assertType(is.nan(t),"NaN",t),primitive:t=>assertType(is.primitive(t),"primitive",t),integer:t=>assertType(is.integer(t),"integer",t),safeInteger:t=>assertType(is.safeInteger(t),"integer",t),plainObject:t=>assertType(is.plainObject(t),"plain object",t),typedArray:t=>assertType(is.typedArray(t),"TypedArray",t),arrayLike:t=>assertType(is.arrayLike(t),"array-like",t),domElement:t=>assertType(is.domElement(t),"HTMLElement",t),observable:t=>assertType(is.observable(t),"Observable",t),nodeStream:t=>assertType(is.nodeStream(t),"Node.js Stream",t),infinite:t=>assertType(is.infinite(t),"infinite number",t),emptyArray:t=>assertType(is.emptyArray(t),"empty array",t),nonEmptyArray:t=>assertType(is.nonEmptyArray(t),"non-empty array",t),emptyString:t=>assertType(is.emptyString(t),"empty string",t),emptyStringOrWhitespace:t=>assertType(is.emptyStringOrWhitespace(t),"empty string or whitespace",t),nonEmptyString:t=>assertType(is.nonEmptyString(t),"non-empty string",t),nonEmptyStringAndNotWhitespace:t=>assertType(is.nonEmptyStringAndNotWhitespace(t),"non-empty string and not whitespace",t),emptyObject:t=>assertType(is.emptyObject(t),"empty object",t),nonEmptyObject:t=>assertType(is.nonEmptyObject(t),"non-empty object",t),emptySet:t=>assertType(is.emptySet(t),"empty set",t),nonEmptySet:t=>assertType(is.nonEmptySet(t),"non-empty set",t),emptyMap:t=>assertType(is.emptyMap(t),"empty map",t),nonEmptyMap:t=>assertType(is.nonEmptyMap(t),"non-empty map",t),propertyKey:t=>assertType(is.propertyKey(t),"PropertyKey",t),formData:t=>assertType(is.formData(t),"FormData",t),urlSearchParams:t=>assertType(is.urlSearchParams(t),"URLSearchParams",t),evenInteger:t=>assertType(is.evenInteger(t),"even integer",t),oddInteger:t=>assertType(is.oddInteger(t),"odd integer",t),directInstanceOf:(t,r)=>assertType(is.directInstanceOf(t,r),"T",t),inRange:(t,r)=>assertType(is.inRange(t,r),"in range",t),any:(t,...r)=>assertType(is.any(t,...r),"predicate returns truthy for any value",r,{multipleValues:true}),all:(t,...r)=>assertType(is.all(t,...r),"predicate returns truthy for all values",r,{multipleValues:true})};Object.defineProperties(is,{class:{value:is.class_},function:{value:is.function_},null:{value:is.null_}});Object.defineProperties(qe,{class:{value:qe.class_},function:{value:qe.function_},null:{value:qe.null_}});const ze=is;class CancelError extends Error{constructor(t){super(t||"Promise was canceled");this.name="CancelError"}get isCanceled(){return true}}class PCancelable{static fn(t){return(...r)=>new PCancelable(((i,o,a)=>{r.push(a);t(...r).then(i,o)}))}constructor(t){this._cancelHandlers=[];this._isPending=true;this._isCanceled=false;this._rejectOnCancel=true;this._promise=new Promise(((r,i)=>{this._reject=i;const onResolve=t=>{if(!this._isCanceled||!onCancel.shouldReject){this._isPending=false;r(t)}};const onReject=t=>{this._isPending=false;i(t)};const onCancel=t=>{if(!this._isPending){throw new Error("The `onCancel` handler was attached after the promise settled.")}this._cancelHandlers.push(t)};Object.defineProperties(onCancel,{shouldReject:{get:()=>this._rejectOnCancel,set:t=>{this._rejectOnCancel=t}}});t(onResolve,onReject,onCancel)}))}then(t,r){return this._promise.then(t,r)}catch(t){return this._promise.catch(t)}finally(t){return this._promise.finally(t)}cancel(t){if(!this._isPending||this._isCanceled){return}this._isCanceled=true;if(this._cancelHandlers.length>0){try{for(const t of this._cancelHandlers){t()}}catch(t){this._reject(t);return}}if(this._rejectOnCancel){this._reject(new CancelError(t))}}get isCanceled(){return this._isCanceled}}Object.setPrototypeOf(PCancelable.prototype,Promise.prototype);function isRequest(t){return ze.object(t)&&"_onResponse"in t}class RequestError extends Error{constructor(t,r,i){super(t);Object.defineProperty(this,"input",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"stack",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"response",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"request",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"timings",{enumerable:true,configurable:true,writable:true,value:void 0});Error.captureStackTrace(this,this.constructor);this.name="RequestError";this.code=r.code??"ERR_GOT_REQUEST_ERROR";this.input=r.input;if(isRequest(i)){Object.defineProperty(this,"request",{enumerable:false,value:i});Object.defineProperty(this,"response",{enumerable:false,value:i.response});this.options=i.options}else{this.options=i}this.timings=this.request?.timings;if(ze.string(r.stack)&&ze.string(this.stack)){const t=this.stack.indexOf(this.message)+this.message.length;const i=this.stack.slice(t).split("\n").reverse();const o=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split("\n").reverse();while(o.length>0&&o[0]===i[0]){i.shift()}this.stack=`${this.stack.slice(0,t)}${i.reverse().join("\n")}${o.reverse().join("\n")}`}}}class MaxRedirectsError extends RequestError{constructor(t){super(`Redirected ${t.options.maxRedirects} times. Aborting.`,{},t);this.name="MaxRedirectsError";this.code="ERR_TOO_MANY_REDIRECTS"}}class HTTPError extends RequestError{constructor(t){super(`Response code ${t.statusCode} (${t.statusMessage})`,{},t.request);this.name="HTTPError";this.code="ERR_NON_2XX_3XX_RESPONSE"}}class CacheError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="CacheError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}}class UploadError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="UploadError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}}class TimeoutError extends RequestError{constructor(t,r,i){super(t.message,t,i);Object.defineProperty(this,"timings",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"event",{enumerable:true,configurable:true,writable:true,value:void 0});this.name="TimeoutError";this.event=t.event;this.timings=r}}class ReadError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="ReadError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}}class RetryError extends RequestError{constructor(t){super("Retrying",{},t);this.name="RetryError";this.code="ERR_RETRYING"}}class errors_AbortError extends RequestError{constructor(t){super("This operation was aborted.",{},t);this.code="ERR_ABORTED";this.name="AbortError"}}const Ge=require("node:buffer");const We=require("node:http");var Ve=i(2361);var Ye=i(3837);var Ze=i(8985);const timer=t=>{if(t.timings){return t.timings}const r={start:Date.now(),socket:undefined,lookup:undefined,connect:undefined,secureConnect:undefined,upload:undefined,response:undefined,end:undefined,error:undefined,abort:undefined,phases:{wait:undefined,dns:undefined,tcp:undefined,tls:undefined,request:undefined,firstByte:undefined,download:undefined,total:undefined}};t.timings=r;const handleError=t=>{t.once(Ve.errorMonitor,(()=>{r.error=Date.now();r.phases.total=r.error-r.start}))};handleError(t);const onAbort=()=>{r.abort=Date.now();r.phases.total=r.abort-r.start};t.prependOnceListener("abort",onAbort);const onSocket=t=>{r.socket=Date.now();r.phases.wait=r.socket-r.start;if(Ye.types.isProxy(t)){return}const lookupListener=()=>{r.lookup=Date.now();r.phases.dns=r.lookup-r.socket};t.prependOnceListener("lookup",lookupListener);Ze(t,{connect:()=>{r.connect=Date.now();if(r.lookup===undefined){t.removeListener("lookup",lookupListener);r.lookup=r.connect;r.phases.dns=r.lookup-r.socket}r.phases.tcp=r.connect-r.lookup},secureConnect:()=>{r.secureConnect=Date.now();r.phases.tls=r.secureConnect-r.connect}})};if(t.socket){onSocket(t.socket)}else{t.prependOnceListener("socket",onSocket)}const onUpload=()=>{r.upload=Date.now();r.phases.request=r.upload-(r.secureConnect??r.connect)};if(t.writableFinished){onUpload()}else{t.prependOnceListener("finish",onUpload)}t.prependOnceListener("response",(i=>{r.response=Date.now();r.phases.firstByte=r.response-r.upload;i.timings=r;handleError(i);i.prependOnceListener("end",(()=>{t.off("abort",onAbort);i.off("aborted",onAbort);if(r.phases.total){return}r.end=Date.now();r.phases.download=r.end-r.response;r.phases.total=r.end-r.start}));i.prependOnceListener("aborted",onAbort)}));return r};const Ke=timer;const Qe=require("node:crypto");const Xe="text/plain";const Je="us-ascii";const testParameter=(t,r)=>r.some((r=>r instanceof RegExp?r.test(t):r===t));const normalizeDataURL=(t,{stripHash:r})=>{const i=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(t);if(!i){throw new Error(`Invalid URL: ${t}`)}let{type:o,data:a,hash:l}=i.groups;const c=o.split(";");l=r?"":l;let u=false;if(c[c.length-1]==="base64"){c.pop();u=true}const h=(c.shift()||"").toLowerCase();const d=c.map((t=>{let[r,i=""]=t.split("=").map((t=>t.trim()));if(r==="charset"){i=i.toLowerCase();if(i===Je){return""}}return`${r}${i?`=${i}`:""}`})).filter(Boolean);const p=[...d];if(u){p.push("base64")}if(p.length>0||h&&h!==Xe){p.unshift(h)}return`data:${p.join(";")},${u?a.trim():a}${l?`#${l}`:""}`};function normalizeUrl(t,r){r={defaultProtocol:"http:",normalizeProtocol:true,forceHttp:false,forceHttps:false,stripAuthentication:true,stripHash:false,stripTextFragment:true,stripWWW:true,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:true,removeSingleSlash:true,removeDirectoryIndex:false,sortQueryParameters:true,...r};t=t.trim();if(/^data:/i.test(t)){return normalizeDataURL(t,r)}if(/^view-source:/i.test(t)){throw new Error("`view-source:` is not supported as it is a non-standard protocol")}const i=t.startsWith("//");const o=!i&&/^\.*\//.test(t);if(!o){t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,r.defaultProtocol)}const a=new URL(t);if(r.forceHttp&&r.forceHttps){throw new Error("The `forceHttp` and `forceHttps` options cannot be used together")}if(r.forceHttp&&a.protocol==="https:"){a.protocol="http:"}if(r.forceHttps&&a.protocol==="http:"){a.protocol="https:"}if(r.stripAuthentication){a.username="";a.password=""}if(r.stripHash){a.hash=""}else if(r.stripTextFragment){a.hash=a.hash.replace(/#?:~:text.*?$/i,"")}if(a.pathname){const t=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g;let r=0;let i="";for(;;){const o=t.exec(a.pathname);if(!o){break}const l=o[0];const c=o.index;const u=a.pathname.slice(r,c);i+=u.replace(/\/{2,}/g,"/");i+=l;r=c+l.length}const o=a.pathname.slice(r,a.pathname.length);i+=o.replace(/\/{2,}/g,"/");a.pathname=i}if(a.pathname){try{a.pathname=decodeURI(a.pathname)}catch{}}if(r.removeDirectoryIndex===true){r.removeDirectoryIndex=[/^index\.[a-z]+$/]}if(Array.isArray(r.removeDirectoryIndex)&&r.removeDirectoryIndex.length>0){let t=a.pathname.split("/");const i=t[t.length-1];if(testParameter(i,r.removeDirectoryIndex)){t=t.slice(0,-1);a.pathname=t.slice(1).join("/")+"/"}}if(a.hostname){a.hostname=a.hostname.replace(/\.$/,"");if(r.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(a.hostname)){a.hostname=a.hostname.replace(/^www\./,"")}}if(Array.isArray(r.removeQueryParameters)){for(const t of[...a.searchParams.keys()]){if(testParameter(t,r.removeQueryParameters)){a.searchParams.delete(t)}}}if(!Array.isArray(r.keepQueryParameters)&&r.removeQueryParameters===true){a.search=""}if(Array.isArray(r.keepQueryParameters)&&r.keepQueryParameters.length>0){for(const t of[...a.searchParams.keys()]){if(!testParameter(t,r.keepQueryParameters)){a.searchParams.delete(t)}}}if(r.sortQueryParameters){a.searchParams.sort();try{a.search=decodeURIComponent(a.search)}catch{}}if(r.removeTrailingSlash){a.pathname=a.pathname.replace(/\/$/,"")}const l=t;t=a.toString();if(!r.removeSingleSlash&&a.pathname==="/"&&!l.endsWith("/")&&a.hash===""){t=t.replace(/\/$/,"")}if((r.removeTrailingSlash||a.pathname==="/")&&a.hash===""&&r.removeSingleSlash){t=t.replace(/\/$/,"")}if(i&&!r.normalizeProtocol){t=t.replace(/^http:\/\//,"//")}if(r.stripProtocol){t=t.replace(/^(?:https?:)?\/\//,"")}return t}var et=i(367);var tt=i(1454);function lowercaseKeys(t){return Object.fromEntries(Object.entries(t).map((([t,r])=>[t.toLowerCase(),r])))}class Response extends ge.Readable{statusCode;headers;body;url;constructor({statusCode:t,headers:r,body:i,url:o}){if(typeof t!=="number"){throw new TypeError("Argument `statusCode` should be a number")}if(typeof r!=="object"){throw new TypeError("Argument `headers` should be an object")}if(!(i instanceof Uint8Array)){throw new TypeError("Argument `body` should be a buffer")}if(typeof o!=="string"){throw new TypeError("Argument `url` should be a string")}super({read(){this.push(i);this.push(null)}});this.statusCode=t;this.headers=lowercaseKeys(r);this.body=i;this.url=o}}var rt=i(1187);const it=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];function mimicResponse(t,r){if(r._readableState.autoDestroy){throw new Error("The second stream must have the `autoDestroy` option set to `false`")}const i=new Set([...Object.keys(t),...it]);const o={};for(const a of i){if(a in r){continue}o[a]={get(){const r=t[a];const i=typeof r==="function";return i?r.bind(t):r},set(r){t[a]=r},enumerable:true,configurable:false}}Object.defineProperties(r,o);t.once("aborted",(()=>{r.destroy();r.emit("aborted")}));t.once("close",(()=>{if(t.complete){if(r.readable){r.once("end",(()=>{r.emit("close")}))}else{r.emit("close")}}else{r.emit("close")}}));return r}class types_RequestError extends Error{constructor(t){super(t.message);Object.assign(this,t)}}class types_CacheError extends Error{constructor(t){super(t.message);Object.assign(this,t)}}class CacheableRequest{constructor(t,r){this.hooks=new Map;this.request=()=>(t,r)=>{let i;if(typeof t==="string"){i=normalizeUrlObject(ye.parse(t));t={}}else if(t instanceof ye.URL){i=normalizeUrlObject(ye.parse(t.toString()));t={}}else{const[r,...o]=(t.path??"").split("?");const a=o.length>0?`?${o.join("?")}`:"";i=normalizeUrlObject({...t,pathname:r,search:a})}t={headers:{},method:"GET",cache:true,strictTtl:false,automaticFailover:false,...t,...urlObjectToRequestOptions(i)};t.headers=Object.fromEntries(st(t.headers).map((([t,r])=>[t.toLowerCase(),r])));const o=new ie;const a=normalizeUrl(ye.format(i),{stripWWW:false,removeTrailingSlash:false,stripAuthentication:false});let l=`${t.method}:${a}`;if(t.body&&t.method!==undefined&&["POST","PATCH","PUT"].includes(t.method)){if(t.body instanceof ge.Readable){t.cache=false}else{l+=`:${Qe.createHash("md5").update(t.body).digest("hex")}`}}let c=false;let u=false;const makeRequest=t=>{u=true;let i=false;let requestErrorCallback=()=>{};const a=new Promise((t=>{requestErrorCallback=()=>{if(!i){i=true;t()}}}));const handler=async i=>{if(c){i.status=i.statusCode;const r=tt.fromObject(c.cachePolicy).revalidatedPolicy(t,i);if(!r.modified){i.resume();await new Promise((t=>{i.once("end",t)}));const t=convertHeaders(r.policy.responseHeaders());i=new Response({statusCode:c.statusCode,headers:t,body:c.body,url:c.url});i.cachePolicy=r.policy;i.fromCache=true}}if(!i.fromCache){i.cachePolicy=new tt(t,i,t);i.fromCache=false}let u;if(t.cache&&i.cachePolicy.storable()){u=cloneResponse(i);(async()=>{try{const r=et.buffer(i);await Promise.race([a,new Promise((t=>i.once("end",t)))]);const o=await r;let u={url:i.url,statusCode:i.fromCache?c.statusCode:i.statusCode,body:o,cachePolicy:i.cachePolicy.toObject()};let h=t.strictTtl?i.cachePolicy.timeToLive():undefined;if(t.maxTtl){h=h?Math.min(h,t.maxTtl):t.maxTtl}if(this.hooks.size>0){for(const t of this.hooks.keys()){u=await this.runHook(t,u,i)}}await this.cache.set(l,u,h)}catch(t){o.emit("error",new types_CacheError(t))}})()}else if(t.cache&&c){(async()=>{try{await this.cache.delete(l)}catch(t){o.emit("error",new types_CacheError(t))}})()}o.emit("response",u??i);if(typeof r==="function"){r(u??i)}};try{const r=this.cacheRequest(t,handler);r.once("error",requestErrorCallback);r.once("abort",requestErrorCallback);o.emit("request",r)}catch(t){o.emit("error",new types_RequestError(t))}};(async()=>{const get=async t=>{await Promise.resolve();const i=t.cache?await this.cache.get(l):undefined;if(typeof i==="undefined"&&!t.forceRefresh){makeRequest(t);return}const a=tt.fromObject(i.cachePolicy);if(a.satisfiesWithoutRevalidation(t)&&!t.forceRefresh){const t=convertHeaders(a.responseHeaders());const l=new Response({statusCode:i.statusCode,headers:t,body:i.body,url:i.url});l.cachePolicy=a;l.fromCache=true;o.emit("response",l);if(typeof r==="function"){r(l)}}else if(a.satisfiesWithoutRevalidation(t)&&Date.now()>=a.timeToLive()&&t.forceRefresh){await this.cache.delete(l);t.headers=a.revalidationHeaders(t);makeRequest(t)}else{c=i;t.headers=a.revalidationHeaders(t);makeRequest(t)}};const errorHandler=t=>o.emit("error",new types_CacheError(t));if(this.cache instanceof rt){const t=this.cache;t.once("error",errorHandler);o.on("error",(()=>t.removeListener("error",errorHandler)))}try{await get(t)}catch(r){if(t.automaticFailover&&!u){makeRequest(t)}o.emit("error",new types_CacheError(r))}})();return o};this.addHook=(t,r)=>{if(!this.hooks.has(t)){this.hooks.set(t,r)}};this.removeHook=t=>this.hooks.delete(t);this.getHook=t=>this.hooks.get(t);this.runHook=async(t,...r)=>this.hooks.get(t)?.(...r);if(r instanceof rt){this.cache=r}else if(typeof r==="string"){this.cache=new rt({uri:r,namespace:"cacheable-request"})}else{this.cache=new rt({store:r,namespace:"cacheable-request"})}this.request=this.request.bind(this);this.cacheRequest=t}}const st=Object.entries;const cloneResponse=t=>{const r=new ge.PassThrough({autoDestroy:false});mimicResponse(t,r);return t.pipe(r)};const urlObjectToRequestOptions=t=>{const r={...t};r.path=`${t.pathname||"/"}${t.search||""}`;delete r.pathname;delete r.search;return r};const normalizeUrlObject=t=>({protocol:t.protocol,auth:t.auth,hostname:t.hostname||t.host||"localhost",port:t.port,pathname:t.pathname,search:t.search});const convertHeaders=t=>{const r=[];for(const i of Object.keys(t)){r[i.toLowerCase()]=t[i]}return r};const nt=CacheableRequest;const ot="onResponse";var at=i(2269);const isFunction=t=>typeof t==="function";const isFormData=t=>Boolean(t&&isFunction(t.constructor)&&t[Symbol.toStringTag]==="FormData"&&isFunction(t.append)&&isFunction(t.getAll)&&isFunction(t.entries)&&isFunction(t[Symbol.iterator]));const ct="abcdefghijklmnopqrstuvwxyz0123456789";function createBoundary(){let t=16;let r="";while(t--){r+=ct[Math.random()*ct.length<<0]}return r}const normalizeValue=t=>String(t).replace(/\r|\n/g,((t,r,i)=>{if(t==="\r"&&i[r+1]!=="\n"||t==="\n"&&i[r-1]!=="\r"){return"\r\n"}return t}));const getType=t=>Object.prototype.toString.call(t).slice(8,-1).toLowerCase();function isPlainObject(t){if(getType(t)!=="object"){return false}const r=Object.getPrototypeOf(t);if(r===null||r===undefined){return true}const i=r.constructor&&r.constructor.toString();return i===Object.toString()}function getProperty(t,r){if(typeof r!=="string"){return t[r]}for(const[i,o]of Object.entries(t)){if(r.toLowerCase()===i.toLowerCase()){return o}}return undefined}const proxyHeaders=t=>new Proxy(t,{get:(t,r)=>getProperty(t,r),has:(t,r)=>getProperty(t,r)!==undefined});const escapeName=t=>String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22");const isFile=t=>Boolean(t&&typeof t==="object"&&isFunction(t.constructor)&&t[Symbol.toStringTag]==="File"&&isFunction(t.stream)&&t.name!=null);const ut=null&&isFile;var ht=undefined&&undefined.__classPrivateFieldSet||function(t,r,i,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof r==="function"?t!==r||!a:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(t,i):a?a.value=i:r.set(t,i),i};var ft=undefined&&undefined.__classPrivateFieldGet||function(t,r,i,o){if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof r==="function"?t!==r||!o:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?o:i==="a"?o.call(t):o?o.value:r.get(t)};var dt,pt,mt,yt,bt,vt,_t,wt,Et,St,Ot;const Rt={enableAdditionalHeaders:false};const xt={writable:false,configurable:false};class FormDataEncoder{constructor(t,r,i){dt.add(this);pt.set(this,"\r\n");mt.set(this,void 0);yt.set(this,void 0);bt.set(this,"-".repeat(2));vt.set(this,new TextEncoder);_t.set(this,void 0);wt.set(this,void 0);Et.set(this,void 0);if(!isFormData(t)){throw new TypeError("Expected first argument to be a FormData instance.")}let o;if(isPlainObject(r)){i=r}else{o=r}if(!o){o=createBoundary()}if(typeof o!=="string"){throw new TypeError("Expected boundary argument to be a string.")}if(i&&!isPlainObject(i)){throw new TypeError("Expected options argument to be an object.")}ht(this,wt,Array.from(t.entries()),"f");ht(this,Et,{...Rt,...i},"f");ht(this,mt,ft(this,vt,"f").encode(ft(this,pt,"f")),"f");ht(this,yt,ft(this,mt,"f").byteLength,"f");this.boundary=`form-data-boundary-${o}`;this.contentType=`multipart/form-data; boundary=${this.boundary}`;ht(this,_t,ft(this,vt,"f").encode(`${ft(this,bt,"f")}${this.boundary}${ft(this,bt,"f")}${ft(this,pt,"f").repeat(2)}`),"f");const a={"Content-Type":this.contentType};const l=ft(this,dt,"m",Ot).call(this);if(l){this.contentLength=l;a["Content-Length"]=l}this.headers=proxyHeaders(Object.freeze(a));Object.defineProperties(this,{boundary:xt,contentType:xt,contentLength:xt,headers:xt})}getContentLength(){return this.contentLength==null?undefined:Number(this.contentLength)}*values(){for(const[t,r]of ft(this,wt,"f")){const i=isFile(r)?r:ft(this,vt,"f").encode(normalizeValue(r));yield ft(this,dt,"m",St).call(this,t,i);yield i;yield ft(this,mt,"f")}yield ft(this,_t,"f")}async*encode(){for(const t of this.values()){if(isFile(t)){yield*t.stream()}else{yield t}}}[(pt=new WeakMap,mt=new WeakMap,yt=new WeakMap,bt=new WeakMap,vt=new WeakMap,_t=new WeakMap,wt=new WeakMap,Et=new WeakMap,dt=new WeakSet,St=function _FormDataEncoder_getFieldHeader(t,r){let i="";i+=`${ft(this,bt,"f")}${this.boundary}${ft(this,pt,"f")}`;i+=`Content-Disposition: form-data; name="${escapeName(t)}"`;if(isFile(r)){i+=`; filename="${escapeName(r.name)}"${ft(this,pt,"f")}`;i+=`Content-Type: ${r.type||"application/octet-stream"}`}const o=isFile(r)?r.size:r.byteLength;if(ft(this,Et,"f").enableAdditionalHeaders===true&&o!=null&&!isNaN(o)){i+=`${ft(this,pt,"f")}Content-Length: ${isFile(r)?r.size:r.byteLength}`}return ft(this,vt,"f").encode(`${i}${ft(this,pt,"f").repeat(2)}`)},Ot=function _FormDataEncoder_getContentLength(){let t=0;for(const[r,i]of ft(this,wt,"f")){const o=isFile(i)?i:ft(this,vt,"f").encode(normalizeValue(i));const a=isFile(o)?o.size:o.byteLength;if(a==null||isNaN(a)){return undefined}t+=ft(this,dt,"m",St).call(this,r,o).byteLength;t+=a;t+=ft(this,yt,"f")}return String(t+ft(this,_t,"f").byteLength)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}}const kt=require("node:util");function is_form_data_isFormData(t){return ze.nodeStream(t)&&ze.function_(t.getBoundary)}async function getBodySize(t,r){if(r&&"content-length"in r){return Number(r["content-length"])}if(!t){return 0}if(ze.string(t)){return Ge.Buffer.byteLength(t)}if(ze.buffer(t)){return t.length}if(is_form_data_isFormData(t)){return(0,kt.promisify)(t.getLength.bind(t))()}return undefined}function proxyEvents(t,r,i){const o={};for(const a of i){const eventFunction=(...t)=>{r.emit(a,...t)};o[a]=eventFunction;t.on(a,eventFunction)}return()=>{for(const[r,i]of Object.entries(o)){t.off(r,i)}}}const Tt=require("node:net");function unhandle(){const t=[];return{once(r,i,o){r.once(i,o);t.push({origin:r,event:i,fn:o})},unhandleAll(){for(const r of t){const{origin:t,event:i,fn:o}=r;t.removeListener(i,o)}t.length=0}}}const At=Symbol("reentry");const noop=()=>{};class timed_out_TimeoutError extends Error{constructor(t,r){super(`Timeout awaiting '${r}' for ${t}ms`);Object.defineProperty(this,"event",{enumerable:true,configurable:true,writable:true,value:r});Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0});this.name="TimeoutError";this.code="ETIMEDOUT"}}function timedOut(t,r,i){if(At in t){return noop}t[At]=true;const o=[];const{once:a,unhandleAll:l}=unhandle();const addTimeout=(t,r,i)=>{const a=setTimeout(r,t,t,i);a.unref?.();const cancel=()=>{clearTimeout(a)};o.push(cancel);return cancel};const{host:c,hostname:u}=i;const timeoutHandler=(r,i)=>{t.destroy(new timed_out_TimeoutError(r,i))};const cancelTimeouts=()=>{for(const t of o){t()}l()};t.once("error",(r=>{cancelTimeouts();if(t.listenerCount("error")===0){throw r}}));if(typeof r.request!=="undefined"){const i=addTimeout(r.request,timeoutHandler,"request");a(t,"response",(t=>{a(t,"end",i)}))}if(typeof r.socket!=="undefined"){const{socket:i}=r;const socketTimeoutHandler=()=>{timeoutHandler(i,"socket")};t.setTimeout(i,socketTimeoutHandler);o.push((()=>{t.removeListener("timeout",socketTimeoutHandler)}))}const h=typeof r.lookup!=="undefined";const d=typeof r.connect!=="undefined";const p=typeof r.secureConnect!=="undefined";const m=typeof r.send!=="undefined";if(h||d||p||m){a(t,"socket",(o=>{const{socketPath:l}=t;if(o.connecting){const t=Boolean(l??Tt.isIP(u??c??"")!==0);if(h&&!t&&typeof o.address().address==="undefined"){const t=addTimeout(r.lookup,timeoutHandler,"lookup");a(o,"lookup",t)}if(d){const timeConnect=()=>addTimeout(r.connect,timeoutHandler,"connect");if(t){a(o,"connect",timeConnect())}else{a(o,"lookup",(t=>{if(t===null){a(o,"connect",timeConnect())}}))}}if(p&&i.protocol==="https:"){a(o,"connect",(()=>{const t=addTimeout(r.secureConnect,timeoutHandler,"secureConnect");a(o,"secureConnect",t)}))}}if(m){const timeRequest=()=>addTimeout(r.send,timeoutHandler,"send");if(o.connecting){a(o,"connect",(()=>{a(t,"upload-complete",timeRequest())}))}else{a(t,"upload-complete",timeRequest())}}}))}if(typeof r.response!=="undefined"){a(t,"upload-complete",(()=>{const i=addTimeout(r.response,timeoutHandler,"response");a(t,"response",i)}))}if(typeof r.read!=="undefined"){a(t,"response",(t=>{const i=addTimeout(r.read,timeoutHandler,"read");a(t,"end",i)}))}return cancelTimeouts}function urlToOptions(t){t=t;const r={protocol:t.protocol,hostname:ze.string(t.hostname)&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};if(ze.string(t.port)&&t.port.length>0){r.port=Number(t.port)}if(t.username||t.password){r.auth=`${t.username||""}:${t.password||""}`}return r}class WeakableMap{constructor(){Object.defineProperty(this,"weakMap",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"map",{enumerable:true,configurable:true,writable:true,value:void 0});this.weakMap=new WeakMap;this.map=new Map}set(t,r){if(typeof t==="object"){this.weakMap.set(t,r)}else{this.map.set(t,r)}}get(t){if(typeof t==="object"){return this.weakMap.get(t)}return this.map.get(t)}has(t){if(typeof t==="object"){return this.weakMap.has(t)}return this.map.has(t)}}const calculateRetryDelay=({attemptCount:t,retryOptions:r,error:i,retryAfter:o,computedValue:a})=>{if(i.name==="RetryError"){return 1}if(t>r.limit){return 0}const l=r.methods.includes(i.options.method);const c=r.errorCodes.includes(i.code);const u=i.response&&r.statusCodes.includes(i.response.statusCode);if(!l||!c&&!u){return 0}if(i.response){if(o){if(o>a){return 0}return o}if(i.response.statusCode===413){return 0}}const h=Math.random()*r.noise;return Math.min(2**(t-1)*1e3,r.backoffLimit)+h};const Ct=calculateRetryDelay;const Pt=require("node:tls");const It=require("node:https");const Lt=require("node:dns");const{Resolver:Mt}=Lt.promises;const Dt=Symbol("cacheableLookupCreateConnection");const Nt=Symbol("cacheableLookupInstance");const jt=Symbol("expires");const Ft=typeof Lt.ALL==="number";const verifyAgent=t=>{if(!(t&&typeof t.createConnection==="function")){throw new Error("Expected an Agent instance as the first argument")}};const map4to6=t=>{for(const r of t){if(r.family===6){continue}r.address=`::ffff:${r.address}`;r.family=6}};const getIfaceInfo=()=>{let t=false;let r=false;for(const i of Object.values(u.networkInterfaces())){for(const o of i){if(o.internal){continue}if(o.family==="IPv6"){r=true}else{t=true}if(t&&r){return{has4:t,has6:r}}}}return{has4:t,has6:r}};const isIterable=t=>Symbol.iterator in t;const ignoreNoResultErrors=t=>t.catch((t=>{if(t.code==="ENODATA"||t.code==="ENOTFOUND"||t.code==="ENOENT"){return[]}throw t}));const Bt={ttl:true};const $t={all:true};const Ht={all:true,family:4};const Ut={all:true,family:6};class CacheableLookup{constructor({cache:t=new Map,maxTtl:r=Infinity,fallbackDuration:i=3600,errorTtl:o=.15,resolver:a=new Mt,lookup:l=Lt.lookup}={}){this.maxTtl=r;this.errorTtl=o;this._cache=t;this._resolver=a;this._dnsLookup=l&&(0,kt.promisify)(l);this.stats={cache:0,query:0};if(this._resolver instanceof Mt){this._resolve4=this._resolver.resolve4.bind(this._resolver);this._resolve6=this._resolver.resolve6.bind(this._resolver)}else{this._resolve4=(0,kt.promisify)(this._resolver.resolve4.bind(this._resolver));this._resolve6=(0,kt.promisify)(this._resolver.resolve6.bind(this._resolver))}this._iface=getIfaceInfo();this._pending={};this._nextRemovalTime=false;this._hostnamesToFallback=new Set;this.fallbackDuration=i;if(i>0){const t=setInterval((()=>{this._hostnamesToFallback.clear()}),i*1e3);if(t.unref){t.unref()}this._fallbackInterval=t}this.lookup=this.lookup.bind(this);this.lookupAsync=this.lookupAsync.bind(this)}set servers(t){this.clear();this._resolver.setServers(t)}get servers(){return this._resolver.getServers()}lookup(t,r,i){if(typeof r==="function"){i=r;r={}}else if(typeof r==="number"){r={family:r}}if(!i){throw new Error("Callback must be a function.")}this.lookupAsync(t,r).then((t=>{if(r.all){i(null,t)}else{i(null,t.address,t.family,t.expires,t.ttl,t.source)}}),i)}async lookupAsync(t,r={}){if(typeof r==="number"){r={family:r}}let i=await this.query(t);if(r.family===6){const t=i.filter((t=>t.family===6));if(r.hints&Lt.V4MAPPED){if(Ft&&r.hints&Lt.ALL||t.length===0){map4to6(i)}else{i=t}}else{i=t}}else if(r.family===4){i=i.filter((t=>t.family===4))}if(r.hints&Lt.ADDRCONFIG){const{_iface:t}=this;i=i.filter((r=>r.family===6?t.has6:t.has4))}if(i.length===0){const r=new Error(`cacheableLookup ENOTFOUND ${t}`);r.code="ENOTFOUND";r.hostname=t;throw r}if(r.all){return i}return i[0]}async query(t){let r="cache";let i=await this._cache.get(t);if(i){this.stats.cache++}if(!i){const o=this._pending[t];if(o){this.stats.cache++;i=await o}else{r="query";const o=this.queryAndCache(t);this._pending[t]=o;this.stats.query++;try{i=await o}finally{delete this._pending[t]}}}i=i.map((t=>({...t,source:r})));return i}async _resolve(t){const[r,i]=await Promise.all([ignoreNoResultErrors(this._resolve4(t,Bt)),ignoreNoResultErrors(this._resolve6(t,Bt))]);let o=0;let a=0;let l=0;const c=Date.now();for(const t of r){t.family=4;t.expires=c+t.ttl*1e3;o=Math.max(o,t.ttl)}for(const t of i){t.family=6;t.expires=c+t.ttl*1e3;a=Math.max(a,t.ttl)}if(r.length>0){if(i.length>0){l=Math.min(o,a)}else{l=o}}else{l=a}return{entries:[...r,...i],cacheTtl:l}}async _lookup(t){try{const[r,i]=await Promise.all([ignoreNoResultErrors(this._dnsLookup(t,Ht)),ignoreNoResultErrors(this._dnsLookup(t,Ut))]);return{entries:[...r,...i],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(t,r,i){if(this.maxTtl>0&&i>0){i=Math.min(i,this.maxTtl)*1e3;r[jt]=Date.now()+i;try{await this._cache.set(t,r,i)}catch(t){this.lookupAsync=async()=>{const r=new Error("Cache Error. Please recreate the CacheableLookup instance.");r.cause=t;throw r}}if(isIterable(this._cache)){this._tick(i)}}}async queryAndCache(t){if(this._hostnamesToFallback.has(t)){return this._dnsLookup(t,$t)}let r=await this._resolve(t);if(r.entries.length===0&&this._dnsLookup){r=await this._lookup(t);if(r.entries.length!==0&&this.fallbackDuration>0){this._hostnamesToFallback.add(t)}}const i=r.entries.length===0?this.errorTtl:r.cacheTtl;await this._set(t,r.entries,i);return r.entries}_tick(t){const r=this._nextRemovalTime;if(!r||t<r){clearTimeout(this._removalTimeout);this._nextRemovalTime=t;this._removalTimeout=setTimeout((()=>{this._nextRemovalTime=false;let t=Infinity;const r=Date.now();for(const[i,o]of this._cache){const a=o[jt];if(r>=a){this._cache.delete(i)}else if(a<t){t=a}}if(t!==Infinity){this._tick(t-r)}}),t);if(this._removalTimeout.unref){this._removalTimeout.unref()}}}install(t){verifyAgent(t);if(Dt in t){throw new Error("CacheableLookup has been already installed")}t[Dt]=t.createConnection;t[Nt]=this;t.createConnection=(r,i)=>{if(!("lookup"in r)){r.lookup=this.lookup}return t[Dt](r,i)}}uninstall(t){verifyAgent(t);if(t[Dt]){if(t[Nt]!==this){throw new Error("The agent is not owned by this CacheableLookup instance")}t.createConnection=t[Dt];delete t[Dt];delete t[Nt]}}updateInterfaceInfo(){const{_iface:t}=this;this._iface=getIfaceInfo();if(t.has4&&!this._iface.has4||t.has6&&!this._iface.has6){this._cache.clear()}}clear(t){if(t){this._cache.delete(t);return}this._cache.clear()}}var qt=i(5767);function parseLinkHeader(t){const r=[];const i=t.split(",");for(const o of i){const[i,...a]=o.split(";");const l=i.trim();if(l[0]!=="<"||l[l.length-1]!==">"){throw new Error(`Invalid format of the Link header reference: ${l}`)}const c=l.slice(1,-1);const u={};if(a.length===0){throw new Error(`Unexpected end of Link header parameters: ${a.join(";")}`)}for(const r of a){const i=r.trim();const o=i.indexOf("=");if(o===-1){throw new Error(`Failed to parse Link header: ${t}`)}const a=i.slice(0,o).trim();const l=i.slice(o+1).trim();u[a]=l}r.push({reference:c,parameters:u})}return r}const[zt,Gt]=c.versions.node.split(".").map(Number);function validateSearchParameters(t){for(const r in t){const i=t[r];qe.any([ze.string,ze.number,ze.boolean,ze.null_,ze.undefined],i)}}const Wt=new Map;let Vt;const getGlobalDnsCache=()=>{if(Vt){return Vt}Vt=new CacheableLookup;return Vt};const Yt={request:undefined,agent:{http:undefined,https:undefined,http2:undefined},h2session:undefined,decompress:true,timeout:{connect:undefined,lookup:undefined,read:undefined,request:undefined,response:undefined,secureConnect:undefined,send:undefined,socket:undefined},prefixUrl:"",body:undefined,form:undefined,json:undefined,cookieJar:undefined,ignoreInvalidCookies:false,searchParams:undefined,dnsLookup:undefined,dnsCache:undefined,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],afterResponse:[]},followRedirect:true,maxRedirects:10,cache:undefined,throwHttpErrors:true,username:"",password:"",http2:false,allowGetBody:false,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:false,dnsLookupIpVersion:undefined,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:undefined,calculateDelay:({computedValue:t})=>t,backoffLimit:Number.POSITIVE_INFINITY,noise:100},localAddress:undefined,method:"GET",createConnection:undefined,cacheOptions:{shared:undefined,cacheHeuristic:undefined,immutableMinTimeToLive:undefined,ignoreCargoCult:undefined},https:{alpnProtocols:undefined,rejectUnauthorized:undefined,checkServerIdentity:undefined,certificateAuthority:undefined,key:undefined,certificate:undefined,passphrase:undefined,pfx:undefined,ciphers:undefined,honorCipherOrder:undefined,minVersion:undefined,maxVersion:undefined,signatureAlgorithms:undefined,tlsSessionLifetime:undefined,dhparam:undefined,ecdhCurve:undefined,certificateRevocationLists:undefined},encoding:undefined,resolveBodyOnly:false,isStream:false,responseType:"text",url:undefined,pagination:{transform(t){if(t.request.options.responseType==="json"){return t.body}return JSON.parse(t.body)},paginate({response:t}){const r=t.headers.link;if(typeof r!=="string"||r.trim()===""){return false}const i=parseLinkHeader(r);const o=i.find((t=>t.parameters.rel==="next"||t.parameters.rel==='"next"'));if(o){return{url:new ye.URL(o.reference,t.url)}}return false},filter:()=>true,shouldContinue:()=>true,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:false},setHost:true,maxHeaderSize:undefined,signal:undefined,enableUnixSockets:true};const cloneInternals=t=>{const{hooks:r,retry:i}=t;const o={...t,context:{...t.context},cacheOptions:{...t.cacheOptions},https:{...t.https},agent:{...t.agent},headers:{...t.headers},retry:{...i,errorCodes:[...i.errorCodes],methods:[...i.methods],statusCodes:[...i.statusCodes]},timeout:{...t.timeout},hooks:{init:[...r.init],beforeRequest:[...r.beforeRequest],beforeError:[...r.beforeError],beforeRedirect:[...r.beforeRedirect],beforeRetry:[...r.beforeRetry],afterResponse:[...r.afterResponse]},searchParams:t.searchParams?new ye.URLSearchParams(t.searchParams):undefined,pagination:{...t.pagination}};if(o.url!==undefined){o.prefixUrl=""}return o};const cloneRaw=t=>{const{hooks:r,retry:i}=t;const o={...t};if(ze.object(t.context)){o.context={...t.context}}if(ze.object(t.cacheOptions)){o.cacheOptions={...t.cacheOptions}}if(ze.object(t.https)){o.https={...t.https}}if(ze.object(t.cacheOptions)){o.cacheOptions={...o.cacheOptions}}if(ze.object(t.agent)){o.agent={...t.agent}}if(ze.object(t.headers)){o.headers={...t.headers}}if(ze.object(i)){o.retry={...i};if(ze.array(i.errorCodes)){o.retry.errorCodes=[...i.errorCodes]}if(ze.array(i.methods)){o.retry.methods=[...i.methods]}if(ze.array(i.statusCodes)){o.retry.statusCodes=[...i.statusCodes]}}if(ze.object(t.timeout)){o.timeout={...t.timeout}}if(ze.object(r)){o.hooks={...r};if(ze.array(r.init)){o.hooks.init=[...r.init]}if(ze.array(r.beforeRequest)){o.hooks.beforeRequest=[...r.beforeRequest]}if(ze.array(r.beforeError)){o.hooks.beforeError=[...r.beforeError]}if(ze.array(r.beforeRedirect)){o.hooks.beforeRedirect=[...r.beforeRedirect]}if(ze.array(r.beforeRetry)){o.hooks.beforeRetry=[...r.beforeRetry]}if(ze.array(r.afterResponse)){o.hooks.afterResponse=[...r.afterResponse]}}if(ze.object(t.pagination)){o.pagination={...t.pagination}}return o};const getHttp2TimeoutOption=t=>{const r=[t.timeout.socket,t.timeout.connect,t.timeout.lookup,t.timeout.request,t.timeout.secureConnect].filter((t=>typeof t==="number"));if(r.length>0){return Math.min(...r)}return undefined};const init=(t,r,i)=>{const o=t.hooks?.init;if(o){for(const t of o){t(r,i)}}};class Options{constructor(t,r,i){Object.defineProperty(this,"_unixOptions",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_internals",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_merging",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_init",{enumerable:true,configurable:true,writable:true,value:void 0});qe.any([ze.string,ze.urlInstance,ze.object,ze.undefined],t);qe.any([ze.object,ze.undefined],r);qe.any([ze.object,ze.undefined],i);if(t instanceof Options||r instanceof Options){throw new TypeError("The defaults must be passed as the third argument")}this._internals=cloneInternals(i?._internals??i??Yt);this._init=[...i?._init??[]];this._merging=false;this._unixOptions=undefined;try{if(ze.plainObject(t)){try{this.merge(t);this.merge(r)}finally{this.url=t.url}}else{try{this.merge(r)}finally{if(r?.url!==undefined){if(t===undefined){this.url=r.url}else{throw new TypeError("The `url` option is mutually exclusive with the `input` argument")}}else if(t!==undefined){this.url=t}}}}catch(t){t.options=this;throw t}}merge(t){if(!t){return}if(t instanceof Options){for(const r of t._init){this.merge(r)}return}t=cloneRaw(t);init(this,t,this);init(t,t,this);this._merging=true;if("isStream"in t){this.isStream=t.isStream}try{let r=false;for(const i in t){if(i==="mutableDefaults"||i==="handlers"){continue}if(i==="url"){continue}if(!(i in this)){throw new Error(`Unexpected option: ${i}`)}this[i]=t[i];r=true}if(r){this._init.push(t)}}finally{this._merging=false}}get request(){return this._internals.request}set request(t){qe.any([ze.function_,ze.undefined],t);this._internals.request=t}get agent(){return this._internals.agent}set agent(t){qe.plainObject(t);for(const r in t){if(!(r in this._internals.agent)){throw new TypeError(`Unexpected agent option: ${r}`)}qe.any([ze.object,ze.undefined],t[r])}if(this._merging){Object.assign(this._internals.agent,t)}else{this._internals.agent={...t}}}get h2session(){return this._internals.h2session}set h2session(t){this._internals.h2session=t}get decompress(){return this._internals.decompress}set decompress(t){qe.boolean(t);this._internals.decompress=t}get timeout(){return this._internals.timeout}set timeout(t){qe.plainObject(t);for(const r in t){if(!(r in this._internals.timeout)){throw new Error(`Unexpected timeout option: ${r}`)}qe.any([ze.number,ze.undefined],t[r])}if(this._merging){Object.assign(this._internals.timeout,t)}else{this._internals.timeout={...t}}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(t){qe.any([ze.string,ze.urlInstance],t);if(t===""){this._internals.prefixUrl="";return}t=t.toString();if(!t.endsWith("/")){t+="/"}if(this._internals.prefixUrl&&this._internals.url){const{href:r}=this._internals.url;this._internals.url.href=t+r.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=t}get body(){return this._internals.body}set body(t){qe.any([ze.string,ze.buffer,ze.nodeStream,ze.generator,ze.asyncGenerator,isFormData,ze.undefined],t);if(ze.nodeStream(t)){qe.truthy(t.readable)}if(t!==undefined){qe.undefined(this._internals.form);qe.undefined(this._internals.json)}this._internals.body=t}get form(){return this._internals.form}set form(t){qe.any([ze.plainObject,ze.undefined],t);if(t!==undefined){qe.undefined(this._internals.body);qe.undefined(this._internals.json)}this._internals.form=t}get json(){return this._internals.json}set json(t){if(t!==undefined){qe.undefined(this._internals.body);qe.undefined(this._internals.form)}this._internals.json=t}get url(){return this._internals.url}set url(t){qe.any([ze.string,ze.urlInstance,ze.undefined],t);if(t===undefined){this._internals.url=undefined;return}if(ze.string(t)&&t.startsWith("/")){throw new Error("`url` must not start with a slash")}const r=`${this.prefixUrl}${t.toString()}`;const i=new ye.URL(r);this._internals.url=i;decodeURI(r);if(i.protocol==="unix:"){i.href=`http://unix${i.pathname}${i.search}`}if(i.protocol!=="http:"&&i.protocol!=="https:"){const t=new Error(`Unsupported protocol: ${i.protocol}`);t.code="ERR_UNSUPPORTED_PROTOCOL";throw t}if(this._internals.username){i.username=this._internals.username;this._internals.username=""}if(this._internals.password){i.password=this._internals.password;this._internals.password=""}if(this._internals.searchParams){i.search=this._internals.searchParams.toString();this._internals.searchParams=undefined}if(i.hostname==="unix"){if(!this._internals.enableUnixSockets){throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled")}const t=/(?<socketPath>.+?):(?<path>.+)/.exec(`${i.pathname}${i.search}`);if(t?.groups){const{socketPath:r,path:i}=t.groups;this._unixOptions={socketPath:r,path:i,host:""}}else{this._unixOptions=undefined}return}this._unixOptions=undefined}get cookieJar(){return this._internals.cookieJar}set cookieJar(t){qe.any([ze.object,ze.undefined],t);if(t===undefined){this._internals.cookieJar=undefined;return}let{setCookie:r,getCookieString:i}=t;qe.function_(r);qe.function_(i);if(r.length===4&&i.length===0){r=(0,kt.promisify)(r.bind(t));i=(0,kt.promisify)(i.bind(t));this._internals.cookieJar={setCookie:r,getCookieString:i}}else{this._internals.cookieJar=t}}get signal(){return this._internals.signal}set signal(t){qe.object(t);this._internals.signal=t}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(t){qe.boolean(t);this._internals.ignoreInvalidCookies=t}get searchParams(){if(this._internals.url){return this._internals.url.searchParams}if(this._internals.searchParams===undefined){this._internals.searchParams=new ye.URLSearchParams}return this._internals.searchParams}set searchParams(t){qe.any([ze.string,ze.object,ze.undefined],t);const r=this._internals.url;if(t===undefined){this._internals.searchParams=undefined;if(r){r.search=""}return}const i=this.searchParams;let o;if(ze.string(t)){o=new ye.URLSearchParams(t)}else if(t instanceof ye.URLSearchParams){o=t}else{validateSearchParameters(t);o=new ye.URLSearchParams;for(const r in t){const a=t[r];if(a===null){o.append(r,"")}else if(a===undefined){i.delete(r)}else{o.append(r,a)}}}if(this._merging){for(const t of o.keys()){i.delete(t)}for(const[t,r]of o){i.append(t,r)}}else if(r){r.search=i.toString()}else{this._internals.searchParams=i}}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(t){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(t){qe.any([ze.function_,ze.undefined],t);this._internals.dnsLookup=t}get dnsCache(){return this._internals.dnsCache}set dnsCache(t){qe.any([ze.object,ze.boolean,ze.undefined],t);if(t===true){this._internals.dnsCache=getGlobalDnsCache()}else if(t===false){this._internals.dnsCache=undefined}else{this._internals.dnsCache=t}}get context(){return this._internals.context}set context(t){qe.object(t);if(this._merging){Object.assign(this._internals.context,t)}else{this._internals.context={...t}}}get hooks(){return this._internals.hooks}set hooks(t){qe.object(t);for(const r in t){if(!(r in this._internals.hooks)){throw new Error(`Unexpected hook event: ${r}`)}const i=r;const o=t[i];qe.any([ze.array,ze.undefined],o);if(o){for(const t of o){qe.function_(t)}}if(this._merging){if(o){this._internals.hooks[i].push(...o)}}else{if(!o){throw new Error(`Missing hook event: ${r}`)}this._internals.hooks[r]=[...o]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(t){qe.boolean(t);this._internals.followRedirect=t}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(t){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(t){qe.number(t);this._internals.maxRedirects=t}get cache(){return this._internals.cache}set cache(t){qe.any([ze.object,ze.string,ze.boolean,ze.undefined],t);if(t===true){this._internals.cache=Wt}else if(t===false){this._internals.cache=undefined}else{this._internals.cache=t}}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(t){qe.boolean(t);this._internals.throwHttpErrors=t}get username(){const t=this._internals.url;const r=t?t.username:this._internals.username;return decodeURIComponent(r)}set username(t){qe.string(t);const r=this._internals.url;const i=encodeURIComponent(t);if(r){r.username=i}else{this._internals.username=i}}get password(){const t=this._internals.url;const r=t?t.password:this._internals.password;return decodeURIComponent(r)}set password(t){qe.string(t);const r=this._internals.url;const i=encodeURIComponent(t);if(r){r.password=i}else{this._internals.password=i}}get http2(){return this._internals.http2}set http2(t){qe.boolean(t);this._internals.http2=t}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(t){qe.boolean(t);this._internals.allowGetBody=t}get headers(){return this._internals.headers}set headers(t){qe.plainObject(t);if(this._merging){Object.assign(this._internals.headers,lowercaseKeys(t))}else{this._internals.headers=lowercaseKeys(t)}}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(t){qe.boolean(t);this._internals.methodRewriting=t}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(t){if(t!==undefined&&t!==4&&t!==6){throw new TypeError(`Invalid DNS lookup IP version: ${t}`)}this._internals.dnsLookupIpVersion=t}get parseJson(){return this._internals.parseJson}set parseJson(t){qe.function_(t);this._internals.parseJson=t}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(t){qe.function_(t);this._internals.stringifyJson=t}get retry(){return this._internals.retry}set retry(t){qe.plainObject(t);qe.any([ze.function_,ze.undefined],t.calculateDelay);qe.any([ze.number,ze.undefined],t.maxRetryAfter);qe.any([ze.number,ze.undefined],t.limit);qe.any([ze.array,ze.undefined],t.methods);qe.any([ze.array,ze.undefined],t.statusCodes);qe.any([ze.array,ze.undefined],t.errorCodes);qe.any([ze.number,ze.undefined],t.noise);if(t.noise&&Math.abs(t.noise)>100){throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${t.noise}`)}for(const r in t){if(!(r in this._internals.retry)){throw new Error(`Unexpected retry option: ${r}`)}}if(this._merging){Object.assign(this._internals.retry,t)}else{this._internals.retry={...t}}const{retry:r}=this._internals;r.methods=[...new Set(r.methods.map((t=>t.toUpperCase())))];r.statusCodes=[...new Set(r.statusCodes)];r.errorCodes=[...new Set(r.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(t){qe.any([ze.string,ze.undefined],t);this._internals.localAddress=t}get method(){return this._internals.method}set method(t){qe.string(t);this._internals.method=t.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(t){qe.any([ze.function_,ze.undefined],t);this._internals.createConnection=t}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(t){qe.plainObject(t);qe.any([ze.boolean,ze.undefined],t.shared);qe.any([ze.number,ze.undefined],t.cacheHeuristic);qe.any([ze.number,ze.undefined],t.immutableMinTimeToLive);qe.any([ze.boolean,ze.undefined],t.ignoreCargoCult);for(const r in t){if(!(r in this._internals.cacheOptions)){throw new Error(`Cache option \`${r}\` does not exist`)}}if(this._merging){Object.assign(this._internals.cacheOptions,t)}else{this._internals.cacheOptions={...t}}}get https(){return this._internals.https}set https(t){qe.plainObject(t);qe.any([ze.boolean,ze.undefined],t.rejectUnauthorized);qe.any([ze.function_,ze.undefined],t.checkServerIdentity);qe.any([ze.string,ze.object,ze.array,ze.undefined],t.certificateAuthority);qe.any([ze.string,ze.object,ze.array,ze.undefined],t.key);qe.any([ze.string,ze.object,ze.array,ze.undefined],t.certificate);qe.any([ze.string,ze.undefined],t.passphrase);qe.any([ze.string,ze.buffer,ze.array,ze.undefined],t.pfx);qe.any([ze.array,ze.undefined],t.alpnProtocols);qe.any([ze.string,ze.undefined],t.ciphers);qe.any([ze.string,ze.buffer,ze.undefined],t.dhparam);qe.any([ze.string,ze.undefined],t.signatureAlgorithms);qe.any([ze.string,ze.undefined],t.minVersion);qe.any([ze.string,ze.undefined],t.maxVersion);qe.any([ze.boolean,ze.undefined],t.honorCipherOrder);qe.any([ze.number,ze.undefined],t.tlsSessionLifetime);qe.any([ze.string,ze.undefined],t.ecdhCurve);qe.any([ze.string,ze.buffer,ze.array,ze.undefined],t.certificateRevocationLists);for(const r in t){if(!(r in this._internals.https)){throw new Error(`HTTPS option \`${r}\` does not exist`)}}if(this._merging){Object.assign(this._internals.https,t)}else{this._internals.https={...t}}}get encoding(){return this._internals.encoding}set encoding(t){if(t===null){throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead")}qe.any([ze.string,ze.undefined],t);this._internals.encoding=t}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(t){qe.boolean(t);this._internals.resolveBodyOnly=t}get isStream(){return this._internals.isStream}set isStream(t){qe.boolean(t);this._internals.isStream=t}get responseType(){return this._internals.responseType}set responseType(t){if(t===undefined){this._internals.responseType="text";return}if(t!=="text"&&t!=="buffer"&&t!=="json"){throw new Error(`Invalid \`responseType\` option: ${t}`)}this._internals.responseType=t}get pagination(){return this._internals.pagination}set pagination(t){qe.object(t);if(this._merging){Object.assign(this._internals.pagination,t)}else{this._internals.pagination=t}}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(t){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(t){qe.boolean(t);this._internals.setHost=t}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(t){qe.any([ze.number,ze.undefined],t);this._internals.maxHeaderSize=t}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(t){qe.boolean(t);this._internals.enableUnixSockets=t}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](t,r){return(0,kt.inspect)(this._internals,r)}createNativeRequestOptions(){const t=this._internals;const r=t.url;let i;if(r.protocol==="https:"){i=t.http2?t.agent:t.agent.https}else{i=t.agent.http}const{https:o}=t;let{pfx:a}=o;if(ze.array(a)&&ze.plainObject(a[0])){a=a.map((t=>({buf:t.buffer,passphrase:t.passphrase})))}return{...t.cacheOptions,...this._unixOptions,ALPNProtocols:o.alpnProtocols,ca:o.certificateAuthority,cert:o.certificate,key:o.key,passphrase:o.passphrase,pfx:o.pfx,rejectUnauthorized:o.rejectUnauthorized,checkServerIdentity:o.checkServerIdentity??Pt.checkServerIdentity,ciphers:o.ciphers,honorCipherOrder:o.honorCipherOrder,minVersion:o.minVersion,maxVersion:o.maxVersion,sigalgs:o.signatureAlgorithms,sessionTimeout:o.tlsSessionLifetime,dhparam:o.dhparam,ecdhCurve:o.ecdhCurve,crl:o.certificateRevocationLists,lookup:t.dnsLookup??t.dnsCache?.lookup,family:t.dnsLookupIpVersion,agent:i,setHost:t.setHost,method:t.method,maxHeaderSize:t.maxHeaderSize,localAddress:t.localAddress,headers:t.headers,createConnection:t.createConnection,timeout:t.http2?getHttp2TimeoutOption(t):undefined,h2session:t.h2session}}getRequestFunction(){const t=this._internals.url;const{request:r}=this._internals;if(!r&&t){return this.getFallbackRequestFunction()}return r}getFallbackRequestFunction(){const t=this._internals.url;if(!t){return}if(t.protocol==="https:"){if(this._internals.http2){if(zt<15||zt===15&&Gt<10){const t=new Error("To use the `http2` option, install Node.js 15.10.0 or above");t.code="EUNSUPPORTED";throw t}return qt.auto}return It.request}return We.request}freeze(){const t=this._internals;Object.freeze(t);Object.freeze(t.hooks);Object.freeze(t.hooks.afterResponse);Object.freeze(t.hooks.beforeError);Object.freeze(t.hooks.beforeRedirect);Object.freeze(t.hooks.beforeRequest);Object.freeze(t.hooks.beforeRetry);Object.freeze(t.hooks.init);Object.freeze(t.https);Object.freeze(t.cacheOptions);Object.freeze(t.agent);Object.freeze(t.headers);Object.freeze(t.timeout);Object.freeze(t.retry);Object.freeze(t.retry.errorCodes);Object.freeze(t.retry.methods);Object.freeze(t.retry.statusCodes)}}const isResponseOk=t=>{const{statusCode:r}=t;const i=t.request.options.followRedirect?299:399;return r>=200&&r<=i||r===304};class ParseError extends RequestError{constructor(t,r){const{options:i}=r.request;super(`${t.message} in "${i.url.toString()}"`,t,r.request);this.name="ParseError";this.code="ERR_BODY_PARSE_FAILURE"}}const parseBody=(t,r,i,o)=>{const{rawBody:a}=t;try{if(r==="text"){return a.toString(o)}if(r==="json"){return a.length===0?"":i(a.toString(o))}if(r==="buffer"){return a}}catch(r){throw new ParseError(r,t)}throw new ParseError({message:`Unknown body type '${r}'`,name:"Error"},t)};function isClientRequest(t){return t.writable&&!t.writableEnded}const Zt=isClientRequest;function isUnixSocketURL(t){return t.protocol==="unix:"||t.hostname==="unix"}const Kt=ze.string(c.versions.brotli);const Qt=new Set(["GET","HEAD"]);const Xt=new WeakableMap;const Jt=new Set([300,301,302,303,304,307,308]);const er=["socket","connect","continue","information","upgrade"];const core_noop=()=>{};class Request extends ge.Duplex{constructor(t,r,i){super({autoDestroy:false,highWaterMark:0});Object.defineProperty(this,"constructor",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_noPipe",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"options",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"response",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"requestUrl",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"redirectUrls",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"retryCount",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_stopRetry",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_downloadedSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_uploadedSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_stopReading",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_pipedServerResponses",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_request",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_responseSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_bodySize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_unproxyEvents",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_isFromCache",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_cannotHaveBody",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_triggerRead",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_cancelTimeouts",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_nativeResponse",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_flushed",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_aborted",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_requestInitialized",{enumerable:true,configurable:true,writable:true,value:void 0});this._downloadedSize=0;this._uploadedSize=0;this._stopReading=false;this._pipedServerResponses=new Set;this._cannotHaveBody=false;this._unproxyEvents=core_noop;this._triggerRead=false;this._cancelTimeouts=core_noop;this._jobs=[];this._flushed=false;this._requestInitialized=false;this._aborted=false;this.redirectUrls=[];this.retryCount=0;this._stopRetry=core_noop;this.on("pipe",(t=>{if(t.headers){Object.assign(this.options.headers,t.headers)}}));this.on("newListener",(t=>{if(t==="retry"&&this.listenerCount("retry")>0){throw new Error("A retry listener has been attached already.")}}));try{this.options=new Options(t,r,i);if(!this.options.url){if(this.options.prefixUrl===""){throw new TypeError("Missing `url` property")}this.options.url=""}this.requestUrl=this.options.url}catch(t){const{options:r}=t;if(r){this.options=r}this.flush=async()=>{this.flush=async()=>{};this.destroy(t)};return}if(this.options.signal?.aborted){this.destroy(new errors_AbortError(this))}this.options.signal?.addEventListener("abort",(()=>{this.destroy(new errors_AbortError(this))}));const{body:o}=this.options;if(ze.nodeStream(o)){o.once("error",(t=>{if(this._flushed){this._beforeError(new UploadError(t,this))}else{this.flush=async()=>{this.flush=async()=>{};this._beforeError(new UploadError(t,this))}}}))}}async flush(){if(this._flushed){return}this._flushed=true;try{await this._finalizeBody();if(this.destroyed){return}await this._makeRequest();if(this.destroyed){this._request?.destroy();return}for(const t of this._jobs){t()}this._jobs.length=0;this._requestInitialized=true}catch(t){this._beforeError(t)}}_beforeError(t){if(this._stopReading){return}const{response:r,options:i}=this;const o=this.retryCount+(t.name==="RetryError"?0:1);this._stopReading=true;if(!(t instanceof RequestError)){t=new RequestError(t.message,t,this)}const a=t;void(async()=>{if(r?.readable&&!r.rawBody&&!this._request?.socket?.destroyed){r.setEncoding(this.readableEncoding);const t=await this._setRawBody(r);if(t){r.body=r.rawBody.toString()}}if(this.listenerCount("retry")!==0){let l;try{let t;if(r&&"retry-after"in r.headers){t=Number(r.headers["retry-after"]);if(Number.isNaN(t)){t=Date.parse(r.headers["retry-after"])-Date.now();if(t<=0){t=1}}else{t*=1e3}}const c=i.retry;l=await c.calculateDelay({attemptCount:o,retryOptions:c,error:a,retryAfter:t,computedValue:Ct({attemptCount:o,retryOptions:c,error:a,retryAfter:t,computedValue:c.maxRetryAfter??i.timeout.request??Number.POSITIVE_INFINITY})})}catch(t){void this._error(new RequestError(t.message,t,this));return}if(l){await new Promise((t=>{const r=setTimeout(t,l);this._stopRetry=()=>{clearTimeout(r);t()}}));if(this.destroyed){return}try{for(const t of this.options.hooks.beforeRetry){await t(a,this.retryCount+1)}}catch(r){void this._error(new RequestError(r.message,t,this));return}if(this.destroyed){return}this.destroy();this.emit("retry",this.retryCount+1,t,(t=>{const r=new Request(i.url,t,i);r.retryCount=this.retryCount+1;c.nextTick((()=>{void r.flush()}));return r}));return}}void this._error(a)})()}_read(){this._triggerRead=true;const{response:t}=this;if(t&&!this._stopReading){if(t.readableLength){this._triggerRead=false}let r;while((r=t.read())!==null){this._downloadedSize+=r.length;const t=this.downloadProgress;if(t.percent<1){this.emit("downloadProgress",t)}this.push(r)}}}_write(t,r,i){const write=()=>{this._writeRequest(t,r,i)};if(this._requestInitialized){write()}else{this._jobs.push(write)}}_final(t){const endRequest=()=>{if(!this._request||this._request.destroyed){t();return}this._request.end((r=>{if(this._request._writableState?.errored){return}if(!r){this._bodySize=this._uploadedSize;this.emit("uploadProgress",this.uploadProgress);this._request.emit("upload-complete")}t(r)}))};if(this._requestInitialized){endRequest()}else{this._jobs.push(endRequest)}}_destroy(t,r){this._stopReading=true;this.flush=async()=>{};this._stopRetry();this._cancelTimeouts();if(this.options){const{body:t}=this.options;if(ze.nodeStream(t)){t.destroy()}}if(this._request){this._request.destroy()}if(t!==null&&!ze.undefined(t)&&!(t instanceof RequestError)){t=new RequestError(t.message,t,this)}r(t)}pipe(t,r){if(t instanceof We.ServerResponse){this._pipedServerResponses.add(t)}return super.pipe(t,r)}unpipe(t){if(t instanceof We.ServerResponse){this._pipedServerResponses.delete(t)}super.unpipe(t);return this}async _finalizeBody(){const{options:t}=this;const{headers:r}=t;const i=!ze.undefined(t.form);const o=!ze.undefined(t.json);const a=!ze.undefined(t.body);const l=Qt.has(t.method)&&!(t.method==="GET"&&t.allowGetBody);this._cannotHaveBody=l;if(i||o||a){if(l){throw new TypeError(`The \`${t.method}\` method cannot be used with a body`)}const o=!ze.string(r["content-type"]);if(a){if(isFormData(t.body)){const i=new FormDataEncoder(t.body);if(o){r["content-type"]=i.headers["Content-Type"]}if("Content-Length"in i.headers){r["content-length"]=i.headers["Content-Length"]}t.body=i.encode()}if(is_form_data_isFormData(t.body)&&o){r["content-type"]=`multipart/form-data; boundary=${t.body.getBoundary()}`}}else if(i){if(o){r["content-type"]="application/x-www-form-urlencoded"}const{form:i}=t;t.form=undefined;t.body=new ye.URLSearchParams(i).toString()}else{if(o){r["content-type"]="application/json"}const{json:i}=t;t.json=undefined;t.body=t.stringifyJson(i)}const c=await getBodySize(t.body,t.headers);if(ze.undefined(r["content-length"])&&ze.undefined(r["transfer-encoding"])&&!l&&!ze.undefined(c)){r["content-length"]=String(c)}}if(t.responseType==="json"&&!("accept"in t.headers)){t.headers.accept="application/json"}this._bodySize=Number(r["content-length"])||undefined}async _onResponseBase(t){if(this.isAborted){return}const{options:r}=this;const{url:i}=r;this._nativeResponse=t;if(r.decompress){t=at(t)}const o=t.statusCode;const a=t;a.statusMessage=a.statusMessage?a.statusMessage:We.STATUS_CODES[o];a.url=r.url.toString();a.requestUrl=this.requestUrl;a.redirectUrls=this.redirectUrls;a.request=this;a.isFromCache=this._nativeResponse.fromCache??false;a.ip=this.ip;a.retryCount=this.retryCount;a.ok=isResponseOk(a);this._isFromCache=a.isFromCache;this._responseSize=Number(t.headers["content-length"])||undefined;this.response=a;t.once("end",(()=>{this._responseSize=this._downloadedSize;this.emit("downloadProgress",this.downloadProgress)}));t.once("error",(r=>{this._aborted=true;t.destroy();this._beforeError(new ReadError(r,this))}));t.once("aborted",(()=>{this._aborted=true;this._beforeError(new ReadError({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}));this.emit("downloadProgress",this.downloadProgress);const l=t.headers["set-cookie"];if(ze.object(r.cookieJar)&&l){let t=l.map((async t=>r.cookieJar.setCookie(t,i.toString())));if(r.ignoreInvalidCookies){t=t.map((async t=>{try{await t}catch{}}))}try{await Promise.all(t)}catch(t){this._beforeError(t);return}}if(this.isAborted){return}if(r.followRedirect&&t.headers.location&&Jt.has(o)){t.resume();this._cancelTimeouts();this._unproxyEvents();if(this.redirectUrls.length>=r.maxRedirects){this._beforeError(new MaxRedirectsError(this));return}this._request=undefined;const l=new Options(undefined,undefined,this.options);const c=o===303&&l.method!=="GET"&&l.method!=="HEAD";const u=o!==307&&o!==308;const h=l.methodRewriting&&u;if(c||h){l.method="GET";l.body=undefined;l.json=undefined;l.form=undefined;delete l.headers["content-length"]}try{const r=Ge.Buffer.from(t.headers.location,"binary").toString();const o=new ye.URL(r,i);if(!isUnixSocketURL(i)&&isUnixSocketURL(o)){this._beforeError(new RequestError("Cannot redirect to UNIX socket",{},this));return}if(o.hostname!==i.hostname||o.port!==i.port){if("host"in l.headers){delete l.headers.host}if("cookie"in l.headers){delete l.headers.cookie}if("authorization"in l.headers){delete l.headers.authorization}if(l.username||l.password){l.username="";l.password=""}}else{o.username=l.username;o.password=l.password}this.redirectUrls.push(o);l.prefixUrl="";l.url=o;for(const t of l.hooks.beforeRedirect){await t(l,a)}this.emit("redirect",l,a);this.options=l;await this._makeRequest()}catch(t){this._beforeError(t);return}return}if(r.isStream&&r.throwHttpErrors&&!isResponseOk(a)){this._beforeError(new HTTPError(a));return}t.on("readable",(()=>{if(this._triggerRead){this._read()}}));this.on("resume",(()=>{t.resume()}));this.on("pause",(()=>{t.pause()}));t.once("end",(()=>{this.push(null)}));if(this._noPipe){const r=await this._setRawBody();if(r){this.emit("response",t)}return}this.emit("response",t);for(const i of this._pipedServerResponses){if(i.headersSent){continue}for(const o in t.headers){const a=r.decompress?o!=="content-encoding":true;const l=t.headers[o];if(a){i.setHeader(o,l)}}i.statusCode=o}}async _setRawBody(t=this){if(t.readableEnded){return false}try{const r=await(0,et.buffer)(t);if(!this.isAborted){this.response.rawBody=r;return true}}catch{}return false}async _onResponse(t){try{await this._onResponseBase(t)}catch(t){this._beforeError(t)}}_onRequest(t){const{options:r}=this;const{timeout:i,url:o}=r;Ke(t);if(this.options.http2){t.setTimeout(0)}this._cancelTimeouts=timedOut(t,i,o);const a=r.cache?"cacheableResponse":"response";t.once(a,(t=>{void this._onResponse(t)}));t.once("error",(r=>{this._aborted=true;t.destroy();r=r instanceof timed_out_TimeoutError?new TimeoutError(r,this.timings,this):new RequestError(r.message,r,this);this._beforeError(r)}));this._unproxyEvents=proxyEvents(t,this,er);this._request=t;this.emit("uploadProgress",this.uploadProgress);this._sendBody();this.emit("request",t)}async _asyncWrite(t){return new Promise(((r,i)=>{super.write(t,(t=>{if(t){i(t);return}r()}))}))}_sendBody(){const{body:t}=this.options;const r=this.redirectUrls.length===0?this:this._request??this;if(ze.nodeStream(t)){t.pipe(r)}else if(ze.generator(t)||ze.asyncGenerator(t)){(async()=>{try{for await(const r of t){await this._asyncWrite(r)}super.end()}catch(t){this._beforeError(t)}})()}else if(!ze.undefined(t)){this._writeRequest(t,undefined,(()=>{}));r.end()}else if(this._cannotHaveBody||this._noPipe){r.end()}}_prepareCache(t){if(!Xt.has(t)){const r=new nt(((t,r)=>{const i=t._request(t,r);if(ze.promise(i)){i.once=(t,r)=>{if(t==="error"){(async()=>{try{await i}catch(t){r(t)}})()}else if(t==="abort"){(async()=>{try{const t=await i;t.once("abort",r)}catch{}})()}else{throw new Error(`Unknown HTTP2 promise event: ${t}`)}return i}}return i}),t);Xt.set(t,r.request())}}async _createCacheableRequest(t,r){return new Promise(((i,o)=>{Object.assign(r,urlToOptions(t));let a;const l=Xt.get(r.cache)(r,(async t=>{t._readableState.autoDestroy=false;if(a){const fix=()=>{if(t.req){t.complete=t.req.res.complete}};t.prependOnceListener("end",fix);fix();(await a).emit("cacheableResponse",t)}i(t)}));l.once("error",o);l.once("request",(async t=>{a=t;i(a)}))}))}async _makeRequest(){const{options:t}=this;const{headers:r,username:i,password:o}=t;const a=t.cookieJar;for(const t in r){if(ze.undefined(r[t])){delete r[t]}else if(ze.null_(r[t])){throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${t}\` header`)}}if(t.decompress&&ze.undefined(r["accept-encoding"])){r["accept-encoding"]=Kt?"gzip, deflate, br":"gzip, deflate"}if(i||o){const t=Ge.Buffer.from(`${i}:${o}`).toString("base64");r.authorization=`Basic ${t}`}if(a){const i=await a.getCookieString(t.url.toString());if(ze.nonEmptyString(i)){r.cookie=i}}t.prefixUrl="";let l;for(const r of t.hooks.beforeRequest){const i=await r(t);if(!ze.undefined(i)){l=()=>i;break}}if(!l){l=t.getRequestFunction()}const c=t.url;this._requestOptions=t.createNativeRequestOptions();if(t.cache){this._requestOptions._request=l;this._requestOptions.cache=t.cache;this._requestOptions.body=t.body;this._prepareCache(t.cache)}const u=t.cache?this._createCacheableRequest:l;try{let r=u(c,this._requestOptions);if(ze.promise(r)){r=await r}if(ze.undefined(r)){r=t.getFallbackRequestFunction()(c,this._requestOptions);if(ze.promise(r)){r=await r}}if(Zt(r)){this._onRequest(r)}else if(this.writable){this.once("finish",(()=>{void this._onResponse(r)}));this._sendBody()}else{void this._onResponse(r)}}catch(t){if(t instanceof types_CacheError){throw new CacheError(t,this)}throw t}}async _error(t){try{if(t instanceof HTTPError&&!this.options.throwHttpErrors){}else{for(const r of this.options.hooks.beforeError){t=await r(t)}}}catch(r){t=new RequestError(r.message,r,this)}this.destroy(t)}_writeRequest(t,r,i){if(!this._request||this._request.destroyed){return}this._request.write(t,r,(o=>{if(!o&&!this._request.destroyed){this._uploadedSize+=Ge.Buffer.byteLength(t,r);const i=this.uploadProgress;if(i.percent<1){this.emit("uploadProgress",i)}}i(o)}))}get ip(){return this.socket?.remoteAddress}get isAborted(){return this._aborted}get socket(){return this._request?.socket??undefined}get downloadProgress(){let t;if(this._responseSize){t=this._downloadedSize/this._responseSize}else if(this._responseSize===this._downloadedSize){t=1}else{t=0}return{percent:t,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let t;if(this._bodySize){t=this._uploadedSize/this._bodySize}else if(this._bodySize===this._uploadedSize){t=1}else{t=0}return{percent:t,transferred:this._uploadedSize,total:this._bodySize}}get timings(){return this._request?.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){return this._request?.reusedSocket}}class types_CancelError extends RequestError{constructor(t){super("Promise was canceled",{},t);this.name="CancelError";this.code="ERR_CANCELED"}get isCanceled(){return true}}const tr=["request","response","redirect","uploadProgress","downloadProgress"];function asPromise(t){let r;let i;let o;const a=new ie.EventEmitter;const l=new PCancelable(((c,u,h)=>{h((()=>{r.destroy()}));h.shouldReject=false;h((()=>{u(new types_CancelError(r))}));const makeRequest=d=>{h((()=>{}));const p=t??new Request(undefined,undefined,o);p.retryCount=d;p._noPipe=true;r=p;p.once("response",(async t=>{const r=(t.headers["content-encoding"]??"").toLowerCase();const o=r==="gzip"||r==="deflate"||r==="br";const{options:a}=p;if(o&&!a.decompress){t.body=t.rawBody}else{try{t.body=parseBody(t,a.responseType,a.parseJson,a.encoding)}catch(r){t.body=t.rawBody.toString();if(isResponseOk(t)){p._beforeError(r);return}}}try{const r=a.hooks.afterResponse;for(const[i,o]of r.entries()){t=await o(t,(async t=>{a.merge(t);a.prefixUrl="";if(t.url){a.url=t.url}a.hooks.afterResponse=a.hooks.afterResponse.slice(0,i);throw new RetryError(p)}));if(!(ze.object(t)&&ze.number(t.statusCode)&&!ze.nullOrUndefined(t.body))){throw new TypeError("The `afterResponse` hook returned an invalid value")}}}catch(t){p._beforeError(t);return}i=t;if(!isResponseOk(t)){p._beforeError(new HTTPError(t));return}p.destroy();c(p.options.resolveBodyOnly?t.body:t)}));const onError=t=>{if(l.isCanceled){return}const{options:r}=p;if(t instanceof HTTPError&&!r.throwHttpErrors){const{response:r}=t;p.destroy();c(p.options.resolveBodyOnly?r.body:r);return}u(t)};p.once("error",onError);const m=p.options?.body;p.once("retry",((r,i)=>{t=undefined;const a=p.options.body;if(m===a&&ze.nodeStream(a)){i.message="Cannot retry with consumed body stream";onError(i);return}o=p.options;makeRequest(r)}));proxyEvents(p,a,tr);if(ze.undefined(t)){void p.flush()}};makeRequest(0)}));l.on=(t,r)=>{a.on(t,r);return l};l.off=(t,r)=>{a.off(t,r);return l};const shortcut=t=>{const r=(async()=>{await l;const{options:r}=i.request;return parseBody(i,t,r.parseJson,r.encoding)})();Object.defineProperties(r,Object.getOwnPropertyDescriptors(l));return r};l.json=()=>{if(r.options){const{headers:t}=r.options;if(!r.writableFinished&&!("accept"in t)){t.accept="application/json"}}return shortcut("json")};l.buffer=()=>shortcut("buffer");l.text=()=>shortcut("text");return l}const delay=async t=>new Promise((r=>{setTimeout(r,t)}));const isGotInstance=t=>ze.function_(t);const rr=["get","post","put","patch","head","delete"];const create=t=>{t={options:new Options(undefined,undefined,t.options),handlers:[...t.handlers],mutableDefaults:t.mutableDefaults};Object.defineProperty(t,"mutableDefaults",{enumerable:true,configurable:false,writable:false});const got=(r,i,o=t.options)=>{const a=new Request(r,i,o);let l;const lastHandler=t=>{a.options=t;a._noPipe=!t.isStream;void a.flush();if(t.isStream){return a}if(!l){l=asPromise(a)}return l};let c=0;const iterateHandlers=r=>{const i=t.handlers[c++]??lastHandler;const o=i(r,iterateHandlers);if(ze.promise(o)&&!a.options.isStream){if(!l){l=asPromise(a)}if(o!==l){const t=Object.getOwnPropertyDescriptors(l);for(const r in t){if(r in o){delete t[r]}}Object.defineProperties(o,t);o.cancel=l.cancel}}return o};return iterateHandlers(a.options)};got.extend=(...r)=>{const i=new Options(undefined,undefined,t.options);const o=[...t.handlers];let a;for(const t of r){if(isGotInstance(t)){i.merge(t.defaults.options);o.push(...t.defaults.handlers);a=t.defaults.mutableDefaults}else{i.merge(t);if(t.handlers){o.push(...t.handlers)}a=t.mutableDefaults}}return create({options:i,handlers:o,mutableDefaults:Boolean(a)})};const paginateEach=async function*(r,i){let o=new Options(r,i,t.options);o.resolveBodyOnly=false;const{pagination:a}=o;qe.function_(a.transform);qe.function_(a.shouldContinue);qe.function_(a.filter);qe.function_(a.paginate);qe.number(a.countLimit);qe.number(a.requestLimit);qe.number(a.backoff);const l=[];let{countLimit:c}=a;let u=0;while(u<a.requestLimit){if(u!==0){await delay(a.backoff)}const t=await got(undefined,undefined,o);const r=await a.transform(t);const i=[];qe.array(r);for(const t of r){if(a.filter({item:t,currentItems:i,allItems:l})){if(!a.shouldContinue({item:t,currentItems:i,allItems:l})){return}yield t;if(a.stackAllItems){l.push(t)}i.push(t);if(--c<=0){return}}}const h=a.paginate({response:t,currentItems:i,allItems:l});if(h===false){return}if(h===t.request.options){o=t.request.options}else{o.merge(h);qe.any([ze.urlInstance,ze.undefined],h.url);if(h.url!==undefined){o.prefixUrl="";o.url=h.url}}u++}};got.paginate=paginateEach;got.paginate.all=async(t,r)=>{const i=[];for await(const o of paginateEach(t,r)){i.push(o)}return i};got.paginate.each=paginateEach;got.stream=(t,r)=>got(t,{...r,isStream:true});for(const t of rr){got[t]=(r,i)=>got(r,{...i,method:t});got.stream[t]=(r,i)=>got(r,{...i,method:t,isStream:true})}if(!t.mutableDefaults){Object.freeze(t.handlers);t.options.freeze()}Object.defineProperty(got,"defaults",{value:t,writable:false,configurable:false,enumerable:true});return got};const ir=create;const sr={options:new Options,handlers:[],mutableDefaults:false};const nr=ir(sr);const or=nr;var ar=i(5793);var lr=i(2781);const cr=(0,Ye.promisify)(lr.Stream.pipeline);async function isUrlOk(t){const r=await or.head(t).catch((t=>t));return r.statusCode===200}async function getRepoInfo(t,r){const[,i,o,a,l,...c]=t.pathname.split("/");const u=r?r.replace(/^\//,""):c.join("/");if(a===undefined){const t=await or(`https://api.github.com/repos/${i}/${o}`).catch((t=>t));if(t.statusCode!==200){return}const r=JSON.parse(t.body);return{username:i,name:o,branch:r["default_branch"],filePath:u}}const h=r?`${l}/${c.join("/")}`.replace(new RegExp(`/${u}|/$`),""):l;if(i&&o&&h&&a==="tree"){return{username:i,name:o,branch:h,filePath:u}}}function hasRepo({username:t,name:r,branch:i,filePath:o}){const a=`https://api.github.com/repos/${t}/${r}/contents`;const l=`${o?`/${o}`:""}/package.json`;return isUrlOk(a+l+`?ref=${i}`)}function hasTemplate(t){return isUrlOk(`https://api.github.com/repos/openpatch/hyperbook/contents/templates/${encodeURIComponent(t)}/package.json`)}function downloadAndExtractRepo(t,{username:r,name:i,branch:o,filePath:a}){return cr(or.stream(`https://codeload.github.com/${r}/${i}/tar.gz/${o}`),ar.extract({cwd:t,strip:a?a.split("/").length+1:1},[`${i}-${o}${a?`/${a}`:""}`]))}async function getTemplateInfo(t){let r;if(t){let i;try{i=new URL(t)}catch(t){if(t.code!=="ERR_INVALID_URL"){console.error(t);process.exit(1)}}if(i){if(i.origin!=="https://github.com"){console.error(`Invalid URL: ${T.red(`"${t}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`);process.exit(1)}r=await getRepoInfo(i);if(!r){console.error(`Found invalid GitHub URL: ${T.red(`"${t}"`)}. Please fix the URL and try again.`);process.exit(1)}const o=await hasRepo(r);if(!o){console.error(`Could not locate the repository for ${T.red(`"${t}"`)}. Please check that the repository exists and try again.`);process.exit(1)}}else if(t!=="__internal-testing-retry"){const r=await hasTemplate(t);if(!r){console.error(`Could not locate an template named ${T.red(`"${t}"`)}. It could be due to the following:\n`,`1. Your spelling of template ${T.red(`"${t}"`)} might be incorrect.\n`,`2. You might not be connected to the internet.`);process.exit(1)}}}return r}var ur=i(3493);var hr=i.n(ur);function install(t,r,{packageManager:i,isOnline:o,devDependencies:a}){const l=[];const c=[];return new Promise(((u,h)=>{let d;let p=i;const m=i==="yarn";if(r&&r.length){if(m){d=["add","--exact"];if(!o)d.push("--offline");d.push("--cwd",t);if(a)d.push("--dev");d.push(...r)}else{d=["install","--save-exact"];d.push(a?"--save-dev":"--save");d.push(...r)}}else{d=["install"];if(!o){console.log(T.yellow("You appear to be offline."));if(m){console.log(T.yellow("Falling back to the local Yarn cache."));console.log();d.push("--offline")}else{console.log()}}}if(m){d.push(...c)}else{d.push(...l)}const y=J()(p,d,{stdio:"inherit",cwd:G().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});y.on("close",(t=>{if(t!==0){h({command:`${p} ${d.join(" ")}`});return}u()}))}))}const fr=require("dns");var dr=i.n(fr);var pr=i(7310);var mr=i.n(pr);function getProxy(){if(process.env.https_proxy){return process.env.https_proxy}try{const t=(0,ee.execSync)("npm config get https-proxy").toString().trim();return t!=="null"?t:undefined}catch(t){return}}function getOnline(){return new Promise((t=>{dr().lookup("registry.yarnpkg.com",(r=>{if(!r){return t(true)}const i=getProxy();if(!i){return t(false)}const{hostname:o}=mr().parse(i);if(!o){return t(false)}dr().lookup(o,(r=>{t(r==null)}))}))}))}async function makeSymlink(t,r){const i=re().platform()=="win32"?"junction":null;return new Promise(((o,a)=>{V().symlink(t,r,i,(t=>{if(t){a()}else{o()}}))}))}const yr=require("fs/promises");var gr=i.n(yr);async function preparePackages(t){var r,i;const o=await gr().readFile(G().join(t,"package.json")).then((t=>t.toString("utf8"))).then((t=>JSON.parse(t)));const{dependencies:a,devDependencies:l}=o;for(let t of Object.entries(a)){const[i,o]=t;if(o==="workspace:*"){const t=`https://registry.npmjs.org/${encodeURIComponent(i)}`;const o=await or.get(t).json();const l=(r=o===null||o===void 0?void 0:o["dist-tags"])===null||r===void 0?void 0:r["latest"];if(l){a[i]=l}}}for(let t of Object.entries(l)){const[r,o]=t;if(o==="workspace:*"){const t=`https://registry.npmjs.org/${encodeURIComponent(r)}`;const o=await or.get(t).json();const a=(i=o===null||o===void 0?void 0:o["dist-tags"])===null||i===void 0?void 0:i["latest"];if(a){l[r]=a}}}o["dependencies"]=a;o["devDependencies"]=l;await gr().writeFile(G().join(t,"package.json"),JSON.stringify(o,null,2))}class DownloadError extends Error{}async function runSetup(t,r,i){if(!i){i=process.cwd()}if(!t){const r=await readHyperbook();t=r.template}if(!t){t="https://github.com/openpatch/hyperbook/tree/main/templates/simple"}if(!r){r=await getTemplateInfo(t)}const o=G().join(i,".hyperbook");console.log("Removing old template");De().sync(o);await makeDir(o);const a=await getOnline();try{if(r){const i=r;console.log(`Downloading files from repo ${T.cyan(t)}. This might take a moment.`);console.log();await hr()((()=>downloadAndExtractRepo(o,i)),{retries:3})}}catch(t){function isErrorLike(t){return typeof t==="object"&&t!==null&&typeof t.message==="string"}throw new DownloadError(isErrorLike(t)?t.message:t+"")}console.log("Prepare packages. Use latest versions.");console.log();await preparePackages(o);console.log("Installing packages. This might take a couple of minutes.");console.log();await install(o,null,{packageManager:"npm",isOnline:a});console.log();De().sync(G().join(o,"book"));De().sync(G().join(o,"public"));De().sync(G().join(o,"glossary"));De().sync(G().join(o,"hyperbook.json"));await makeSymlink(G().join(i,"book"),G().join(o,"book"));await makeSymlink(G().join(i,"public"),G().join(o,"public"));await makeSymlink(G().join(i,"glossary"),G().join(o,"glossary"));await makeSymlink(G().join(i,"hyperbook.json"),G().join(o,"hyperbook.json"))}async function runNew({programName:t,bookPath:r,template:o}){if(typeof r==="string"){r=r.trim()}if(!r){const t=await Le()({type:"text",name:"path",message:"What is your book named?",initial:"my-book"});if(typeof t.path==="string"){r=t.path.trim()}}if(!r){console.log();console.log("Please specify the book directory:");console.log(` ${T.cyan(t)} ${T.green("<book-directory>")}`);console.log();console.log("For example:");console.log(` ${T.cyan(t)} ${T.green("my-new-book")}`);console.log();console.log(`Run ${T.cyan(`${t} --help`)} to see all options.`);process.exit(1)}let a=await getTemplateInfo(o);const l=G().resolve(r);if(!await isWriteable(G().dirname(l))){console.error("The book path is not writable, please check folder permissions and try again.");console.error("It is likely you do not have write permissions for this folder.");process.exit(1)}const c=G().basename(l);await makeDir(l);if(!isFolderEmpty(l,c)){process.exit(1)}const u=process.cwd();console.log(`Creating a new hyperbook in ${T.green(l)}.`);console.log();process.chdir(l);const{description:h}=await Le()({type:"text",name:"description",message:"What is your book about?",initial:""});const{author:d}=await Le()({type:"text",name:"author",message:"Who is the author of the book?",initial:""});const{authorUrl:p}=await Le()({type:"text",name:"authorUrl",message:"What is the link to the authors homepage?",initial:""});let{license:m}=await Le()({type:"select",name:"license",message:"Pick a license for your book!",choices:[{title:"Creative Commons Zero (CC0)",value:"cc0"},{title:"Creative Commons Attribution (CC BY)",value:"cc-by"},{title:"Creative Commons Attribution-ShareAlike (CC BY-SA)",value:"cc-by-sa"},{title:"Creative Commons Attribution-NoDerivs (CC BY-ND)",value:"cc-by-nd"},{title:"Creative Commons Attribution-NonCommercial (CC BY-NC)",value:"cc-by-nc"},{title:"Creative Commons Attribution-NonCommercial-ShareAlike (CC BY-NC-SA)",value:"cc-by-nc-sa"},{title:"Creative Commons Attribution-NonCommercial-NoDervis (CC BY-NC-ND)",value:"cc-by-nc-nd"},{title:"Custom",value:"custom"}]});if(m==="custom"){const t=await Le()({type:"text",name:"license",message:"Which custom license you want to use?"});m=t.license}const{language:y}=await Le()({type:"text",name:"language",message:"In which language is your book written? Provide a short code, e.g.: en or de",initial:"en"});const g={name:c,version:"0.0.0",description:h,license:m,author:{name:d,url:p},language:y};V().writeFileSync(G().join(l,"hyperbook.json"),JSON.stringify(g,null,2)+re().EOL);console.log();const b=i.ab+"templates";await cpy("default/**",l,{cwd:i.ab+"templates",rename:t=>{switch(t){case"gitignore":{return".".concat(t)}case"README-template.md":{return"README.md"}default:{return t}}}});await runSetup(o,a,l);if(tryGitInit(l)){console.log("Initialized a git repository.");console.log()}let v;if(G().join(u,c)===r){v=c}else{v=r}console.log(`${T.green("Success!")} Created ${c} at ${r}`);console.log("Inside that directory, you can run several commands:");console.log();console.log(T.cyan(` hyperbook dev`));console.log(" Starts the development server.");console.log();console.log(T.cyan(` hyperbook build`));console.log(" Builds the book for production.");console.log();console.log("We suggest that you begin by typing:");console.log();console.log(T.cyan(" cd"),v);console.log(` ${T.cyan(`hyperbook dev`)}`);console.log()}const br=JSON.parse('{"name":"hyperbook","version":"0.5.6","author":"Mike Barkmin","homepage":"https://github.com/openpatch/hyperbook#readme","license":"MIT","bin":{"hyperbook":"./dist/index.js"},"files":["dist"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/openpatch/hyperbook.git","directory":"packages/hyperbook"},"bugs":{"url":"https://github.com/openpatch/hyperbook/issues"},"engines":{"node":">=12.22.0"},"scripts":{"version":"pnpm build","lint":"tsc --noEmit","dev":"ncc build ./index.ts -w -o dist/","build":"rimraf dist && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register"},"devDependencies":{"@types/archiver":"5.3.1","@types/async-retry":"1.4.5","@types/cross-spawn":"6.0.2","@types/prompts":"2.4.1","@types/rimraf":"3.0.2","@types/tar":"6.1.3","@vercel/ncc":"0.34.0","archiver":"5.3.1","async-retry":"1.3.3","chalk":"5.0.1","commander":"9.4.1","cpy":"9.0.1","cross-spawn":"7.0.3","got":"12.5.1","prompts":"2.4.2","rimraf":"3.0.2","tar":"6.1.11","update-check":"1.5.4"},"dependencies":{"@hyperbook/types":"workspace:*"}}');const vr=new j;vr.name(br.name).version(br.version).hook("preAction",(async()=>{await notifyUpdate()}));vr.command("new").description("create a new hyperbook").arguments("<book-directory>").usage(`${T.green("<book-directory>")} [options]`).option("-t, --template [name]|[github-url]",`\n A template for your hyperbook. You can use an template name\n from the official hyperbook repo or a GitHub URL. The URL can use\n any branch and/or subdirectory\n`).action((async(t,r)=>{const i=typeof r.template==="string"&&r.template.trim();await runNew({programName:vr.name(),bookPath:t,template:i}).catch((()=>process.exit(1)))}));vr.command("dev").description("start the development server for a hyperbook").action((async()=>{await runDev().catch((()=>process.exit(1)))}));vr.command("setup").description("downloads the latest version of the template of a hyperbook").action((async()=>{await runSetup().catch((()=>process.exit(1)))}));vr.command("build").description("build a hyperbook").action((async()=>{await runArchive().catch((()=>process.exit(1)));await runBuild().catch((()=>process.exit(1)))}));vr.command("archive").description("create archives from archives folder").action((async()=>{await runArchive().catch((()=>process.exit(1)))}));vr.parseAsync(process.argv);const _r=q()(br).catch((()=>null));async function notifyUpdate(){try{const t=await _r;if(t===null||t===void 0?void 0:t.latest){const t=getPkgManager();console.log();console.log(T.yellow.bold("A new version of `hyperbook` is available!"));console.log("You can update by running: "+T.cyan(t==="yarn"?"yarn global add hyperbook":`${t} install --global hyperbook`));console.log()}process.exit()}catch{}}},9491:t=>{"use strict";t.exports=require("assert")},4300:t=>{"use strict";t.exports=require("buffer")},2081:t=>{"use strict";t.exports=require("child_process")},2057:t=>{"use strict";t.exports=require("constants")},6113:t=>{"use strict";t.exports=require("crypto")},2361:t=>{"use strict";t.exports=require("events")},7147:t=>{"use strict";t.exports=require("fs")},3685:t=>{"use strict";t.exports=require("http")},5158:t=>{"use strict";t.exports=require("http2")},5687:t=>{"use strict";t.exports=require("https")},1808:t=>{"use strict";t.exports=require("net")},2037:t=>{"use strict";t.exports=require("os")},1017:t=>{"use strict";t.exports=require("path")},7282:t=>{"use strict";t.exports=require("process")},4521:t=>{"use strict";t.exports=require("readline")},2781:t=>{"use strict";t.exports=require("stream")},1576:t=>{"use strict";t.exports=require("string_decoder")},4404:t=>{"use strict";t.exports=require("tls")},7310:t=>{"use strict";t.exports=require("url")},3837:t=>{"use strict";t.exports=require("util")},9796:t=>{"use strict";t.exports=require("zlib")},345:(t,r,i)=>{const{Argument:o}=i(4079);const{Command:a}=i(6505);const{CommanderError:l,InvalidArgumentError:c}=i(9027);const{Help:u}=i(9164);const{Option:h}=i(5205);r=t.exports=new a;r.program=r;r.Argument=o;r.Command=a;r.CommanderError=l;r.Help=u;r.InvalidArgumentError=c;r.InvalidOptionArgumentError=c;r.Option=h},4079:(t,r,i)=>{const{InvalidArgumentError:o}=i(9027);class Argument{constructor(t,r){this.description=r||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(t[0]){case"<":this.required=true;this._name=t.slice(1,-1);break;case"[":this.required=false;this._name=t.slice(1,-1);break;default:this.required=true;this._name=t;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(t,r){if(r===this.defaultValue||!Array.isArray(r)){return[t]}return r.concat(t)}default(t,r){this.defaultValue=t;this.defaultValueDescription=r;return this}argParser(t){this.parseArg=t;return this}choices(t){this.argChoices=t.slice();this.parseArg=(t,r)=>{if(!this.argChoices.includes(t)){throw new o(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,r)}return t};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(t){const r=t.name()+(t.variadic===true?"...":"");return t.required?"<"+r+">":"["+r+"]"}r.Argument=Argument;r.humanReadableArgName=humanReadableArgName},6505:(t,r,i)=>{const o=i(2361).EventEmitter;const a=i(2081);const l=i(1017);const c=i(7147);const u=i(7282);const{Argument:h,humanReadableArgName:d}=i(4079);const{CommanderError:p}=i(9027);const{Help:m}=i(9164);const{Option:y,splitOptionFlags:g,DualOptions:b}=i(5205);const{suggestSimilar:v}=i(211);class Command extends o{constructor(t){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this._args=[];this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=t||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._summary="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._outputConfiguration={writeOut:t=>u.stdout.write(t),writeErr:t=>u.stderr.write(t),getOutHelpWidth:()=>u.stdout.isTTY?u.stdout.columns:undefined,getErrHelpWidth:()=>u.stderr.isTTY?u.stderr.columns:undefined,outputError:(t,r)=>r(t)};this._hidden=false;this._hasHelpOption=true;this._helpFlags="-h, --help";this._helpDescription="display help for command";this._helpShortFlag="-h";this._helpLongFlag="--help";this._addImplicitHelpCommand=undefined;this._helpCommandName="help";this._helpCommandnameAndArgs="help [command]";this._helpCommandDescription="display help for command";this._helpConfiguration={}}copyInheritedSettings(t){this._outputConfiguration=t._outputConfiguration;this._hasHelpOption=t._hasHelpOption;this._helpFlags=t._helpFlags;this._helpDescription=t._helpDescription;this._helpShortFlag=t._helpShortFlag;this._helpLongFlag=t._helpLongFlag;this._helpCommandName=t._helpCommandName;this._helpCommandnameAndArgs=t._helpCommandnameAndArgs;this._helpCommandDescription=t._helpCommandDescription;this._helpConfiguration=t._helpConfiguration;this._exitCallback=t._exitCallback;this._storeOptionsAsProperties=t._storeOptionsAsProperties;this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue;this._allowExcessArguments=t._allowExcessArguments;this._enablePositionalOptions=t._enablePositionalOptions;this._showHelpAfterError=t._showHelpAfterError;this._showSuggestionAfterError=t._showSuggestionAfterError;return this}command(t,r,i){let o=r;let a=i;if(typeof o==="object"&&o!==null){a=o;o=null}a=a||{};const[,l,c]=t.match(/([^ ]+) *(.*)/);const u=this.createCommand(l);if(o){u.description(o);u._executableHandler=true}if(a.isDefault)this._defaultCommandName=u._name;u._hidden=!!(a.noHelp||a.hidden);u._executableFile=a.executableFile||null;if(c)u.arguments(c);this.commands.push(u);u.parent=this;u.copyInheritedSettings(this);if(o)return this;return u}createCommand(t){return new Command(t)}createHelp(){return Object.assign(new m,this.configureHelp())}configureHelp(t){if(t===undefined)return this._helpConfiguration;this._helpConfiguration=t;return this}configureOutput(t){if(t===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,t);return this}showHelpAfterError(t=true){if(typeof t!=="string")t=!!t;this._showHelpAfterError=t;return this}showSuggestionAfterError(t=true){this._showSuggestionAfterError=!!t;return this}addCommand(t,r){if(!t._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}r=r||{};if(r.isDefault)this._defaultCommandName=t._name;if(r.noHelp||r.hidden)t._hidden=true;this.commands.push(t);t.parent=this;return this}createArgument(t,r){return new h(t,r)}argument(t,r,i,o){const a=this.createArgument(t,r);if(typeof i==="function"){a.default(o).argParser(i)}else{a.default(i)}this.addArgument(a);return this}arguments(t){t.split(/ +/).forEach((t=>{this.argument(t)}));return this}addArgument(t){const r=this._args.slice(-1)[0];if(r&&r.variadic){throw new Error(`only the last argument can be variadic '${r.name()}'`)}if(t.required&&t.defaultValue!==undefined&&t.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${t.name()}'`)}this._args.push(t);return this}addHelpCommand(t,r){if(t===false){this._addImplicitHelpCommand=false}else{this._addImplicitHelpCommand=true;if(typeof t==="string"){this._helpCommandName=t.split(" ")[0];this._helpCommandnameAndArgs=t}this._helpCommandDescription=r||this._helpCommandDescription}return this}_hasImplicitHelpCommand(){if(this._addImplicitHelpCommand===undefined){return this.commands.length&&!this._actionHandler&&!this._findCommand("help")}return this._addImplicitHelpCommand}hook(t,r){const i=["preSubcommand","preAction","postAction"];if(!i.includes(t)){throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${i.join("', '")}'`)}if(this._lifeCycleHooks[t]){this._lifeCycleHooks[t].push(r)}else{this._lifeCycleHooks[t]=[r]}return this}exitOverride(t){if(t){this._exitCallback=t}else{this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync"){throw t}else{}}}return this}_exit(t,r,i){if(this._exitCallback){this._exitCallback(new p(t,r,i))}u.exit(t)}action(t){const listener=r=>{const i=this._args.length;const o=r.slice(0,i);if(this._storeOptionsAsProperties){o[i]=this}else{o[i]=this.opts()}o.push(this);return t.apply(this,o)};this._actionHandler=listener;return this}createOption(t,r){return new y(t,r)}addOption(t){const r=t.name();const i=t.attributeName();if(t.negate){const r=t.long.replace(/^--no-/,"--");if(!this._findOption(r)){this.setOptionValueWithSource(i,t.defaultValue===undefined?true:t.defaultValue,"default")}}else if(t.defaultValue!==undefined){this.setOptionValueWithSource(i,t.defaultValue,"default")}this.options.push(t);const handleOptionValue=(r,o,a)=>{if(r==null&&t.presetArg!==undefined){r=t.presetArg}const l=this.getOptionValue(i);if(r!==null&&t.parseArg){try{r=t.parseArg(r,l)}catch(t){if(t.code==="commander.invalidArgument"){const r=`${o} ${t.message}`;this.error(r,{exitCode:t.exitCode,code:t.code})}throw t}}else if(r!==null&&t.variadic){r=t._concatValue(r,l)}if(r==null){if(t.negate){r=false}else if(t.isBoolean()||t.optional){r=true}else{r=""}}this.setOptionValueWithSource(i,r,a)};this.on("option:"+r,(r=>{const i=`error: option '${t.flags}' argument '${r}' is invalid.`;handleOptionValue(r,i,"cli")}));if(t.envVar){this.on("optionEnv:"+r,(r=>{const i=`error: option '${t.flags}' value '${r}' from env '${t.envVar}' is invalid.`;handleOptionValue(r,i,"env")}))}return this}_optionEx(t,r,i,o,a){if(typeof r==="object"&&r instanceof y){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const l=this.createOption(r,i);l.makeOptionMandatory(!!t.mandatory);if(typeof o==="function"){l.default(a).argParser(o)}else if(o instanceof RegExp){const t=o;o=(r,i)=>{const o=t.exec(r);return o?o[0]:i};l.default(a).argParser(o)}else{l.default(o)}return this.addOption(l)}option(t,r,i,o){return this._optionEx({},t,r,i,o)}requiredOption(t,r,i,o){return this._optionEx({mandatory:true},t,r,i,o)}combineFlagAndOptionalValue(t=true){this._combineFlagAndOptionalValue=!!t;return this}allowUnknownOption(t=true){this._allowUnknownOption=!!t;return this}allowExcessArguments(t=true){this._allowExcessArguments=!!t;return this}enablePositionalOptions(t=true){this._enablePositionalOptions=!!t;return this}passThroughOptions(t=true){this._passThroughOptions=!!t;if(!!this.parent&&t&&!this.parent._enablePositionalOptions){throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)")}return this}storeOptionsAsProperties(t=true){this._storeOptionsAsProperties=!!t;if(this.options.length){throw new Error("call .storeOptionsAsProperties() before adding options")}return this}getOptionValue(t){if(this._storeOptionsAsProperties){return this[t]}return this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,undefined)}setOptionValueWithSource(t,r,i){if(this._storeOptionsAsProperties){this[t]=r}else{this._optionValues[t]=r}this._optionValueSources[t]=i;return this}getOptionValueSource(t){return this._optionValueSources[t]}_prepareUserArgs(t,r){if(t!==undefined&&!Array.isArray(t)){throw new Error("first parameter to parse must be array or undefined")}r=r||{};if(t===undefined){t=u.argv;if(u.versions&&u.versions.electron){r.from="electron"}}this.rawArgs=t.slice();let i;switch(r.from){case undefined:case"node":this._scriptPath=t[1];i=t.slice(2);break;case"electron":if(u.defaultApp){this._scriptPath=t[1];i=t.slice(2)}else{i=t.slice(1)}break;case"user":i=t.slice(0);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return i}parse(t,r){const i=this._prepareUserArgs(t,r);this._parseCommand([],i);return this}async parseAsync(t,r){const i=this._prepareUserArgs(t,r);await this._parseCommand([],i);return this}_executeSubCommand(t,r){r=r.slice();let i=false;const o=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(t,r){const i=l.resolve(t,r);if(c.existsSync(i))return i;if(o.includes(l.extname(r)))return undefined;const a=o.find((t=>c.existsSync(`${i}${t}`)));if(a)return`${i}${a}`;return undefined}this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();let h=t._executableFile||`${this._name}-${t._name}`;let d=this._executableDir||"";if(this._scriptPath){let t;try{t=c.realpathSync(this._scriptPath)}catch(r){t=this._scriptPath}d=l.resolve(l.dirname(t),d)}if(d){let r=findFile(d,h);if(!r&&!t._executableFile&&this._scriptPath){const i=l.basename(this._scriptPath,l.extname(this._scriptPath));if(i!==this._name){r=findFile(d,`${i}-${t._name}`)}}h=r||h}i=o.includes(l.extname(h));let m;if(u.platform!=="win32"){if(i){r.unshift(h);r=incrementNodeInspectorPort(u.execArgv).concat(r);m=a.spawn(u.argv[0],r,{stdio:"inherit"})}else{m=a.spawn(h,r,{stdio:"inherit"})}}else{r.unshift(h);r=incrementNodeInspectorPort(u.execArgv).concat(r);m=a.spawn(u.execPath,r,{stdio:"inherit"})}if(!m.killed){const t=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];t.forEach((t=>{u.on(t,(()=>{if(m.killed===false&&m.exitCode===null){m.kill(t)}}))}))}const y=this._exitCallback;if(!y){m.on("close",u.exit.bind(u))}else{m.on("close",(()=>{y(new p(u.exitCode||0,"commander.executeSubCommandAsync","(close)"))}))}m.on("error",(r=>{if(r.code==="ENOENT"){const r=d?`searched for local subcommand relative to directory '${d}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const i=`'${h}' does not exist\n - if '${t._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${r}`;throw new Error(i)}else if(r.code==="EACCES"){throw new Error(`'${h}' not executable`)}if(!y){u.exit(1)}else{const t=new p(1,"commander.executeSubCommandAsync","(error)");t.nestedError=r;y(t)}}));this.runningCommand=m}_dispatchSubcommand(t,r,i){const o=this._findCommand(t);if(!o)this.help({error:true});let a;a=this._chainOrCallSubCommandHook(a,o,"preSubcommand");a=this._chainOrCall(a,(()=>{if(o._executableHandler){this._executeSubCommand(o,r.concat(i))}else{return o._parseCommand(r,i)}}));return a}_checkNumberOfArguments(){this._args.forEach(((t,r)=>{if(t.required&&this.args[r]==null){this.missingArgument(t.name())}}));if(this._args.length>0&&this._args[this._args.length-1].variadic){return}if(this.args.length>this._args.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(t,r,i)=>{let o=r;if(r!==null&&t.parseArg){try{o=t.parseArg(r,i)}catch(i){if(i.code==="commander.invalidArgument"){const o=`error: command-argument value '${r}' is invalid for argument '${t.name()}'. ${i.message}`;this.error(o,{exitCode:i.exitCode,code:i.code})}throw i}}return o};this._checkNumberOfArguments();const t=[];this._args.forEach(((r,i)=>{let o=r.defaultValue;if(r.variadic){if(i<this.args.length){o=this.args.slice(i);if(r.parseArg){o=o.reduce(((t,i)=>myParseArg(r,i,t)),r.defaultValue)}}else if(o===undefined){o=[]}}else if(i<this.args.length){o=this.args[i];if(r.parseArg){o=myParseArg(r,o,r.defaultValue)}}t[i]=o}));this.processedArgs=t}_chainOrCall(t,r){if(t&&t.then&&typeof t.then==="function"){return t.then((()=>r()))}return r()}_chainOrCallHooks(t,r){let i=t;const o=[];getCommandAndParents(this).reverse().filter((t=>t._lifeCycleHooks[r]!==undefined)).forEach((t=>{t._lifeCycleHooks[r].forEach((r=>{o.push({hookedCommand:t,callback:r})}))}));if(r==="postAction"){o.reverse()}o.forEach((t=>{i=this._chainOrCall(i,(()=>t.callback(t.hookedCommand,this)))}));return i}_chainOrCallSubCommandHook(t,r,i){let o=t;if(this._lifeCycleHooks[i]!==undefined){this._lifeCycleHooks[i].forEach((t=>{o=this._chainOrCall(o,(()=>t(this,r)))}))}return o}_parseCommand(t,r){const i=this.parseOptions(r);this._parseOptionsEnv();this._parseOptionsImplied();t=t.concat(i.operands);r=i.unknown;this.args=t.concat(r);if(t&&this._findCommand(t[0])){return this._dispatchSubcommand(t[0],t.slice(1),r)}if(this._hasImplicitHelpCommand()&&t[0]===this._helpCommandName){if(t.length===1){this.help()}return this._dispatchSubcommand(t[1],[],[this._helpLongFlag])}if(this._defaultCommandName){outputHelpIfRequested(this,r);return this._dispatchSubcommand(this._defaultCommandName,t,r)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}outputHelpIfRequested(this,i.unknown);this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();const checkForUnknownOptions=()=>{if(i.unknown.length>0){this.unknownOption(i.unknown[0])}};const o=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let i;i=this._chainOrCallHooks(i,"preAction");i=this._chainOrCall(i,(()=>this._actionHandler(this.processedArgs)));if(this.parent){i=this._chainOrCall(i,(()=>{this.parent.emit(o,t,r)}))}i=this._chainOrCallHooks(i,"postAction");return i}if(this.parent&&this.parent.listenerCount(o)){checkForUnknownOptions();this._processArguments();this.parent.emit(o,t,r)}else if(t.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",t,r)}if(this.listenerCount("command:*")){this.emit("command:*",t,r)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(t){if(!t)return undefined;return this.commands.find((r=>r._name===t||r._aliases.includes(t)))}_findOption(t){return this.options.find((r=>r.is(t)))}_checkForMissingMandatoryOptions(){for(let t=this;t;t=t.parent){t.options.forEach((r=>{if(r.mandatory&&t.getOptionValue(r.attributeName())===undefined){t.missingMandatoryOptionValue(r)}}))}}_checkForConflictingLocalOptions(){const t=this.options.filter((t=>{const r=t.attributeName();if(this.getOptionValue(r)===undefined){return false}return this.getOptionValueSource(r)!=="default"}));const r=t.filter((t=>t.conflictsWith.length>0));r.forEach((r=>{const i=t.find((t=>r.conflictsWith.includes(t.attributeName())));if(i){this._conflictingOption(r,i)}}))}_checkForConflictingOptions(){for(let t=this;t;t=t.parent){t._checkForConflictingLocalOptions()}}parseOptions(t){const r=[];const i=[];let o=r;const a=t.slice();function maybeOption(t){return t.length>1&&t[0]==="-"}let l=null;while(a.length){const t=a.shift();if(t==="--"){if(o===i)o.push(t);o.push(...a);break}if(l&&!maybeOption(t)){this.emit(`option:${l.name()}`,t);continue}l=null;if(maybeOption(t)){const r=this._findOption(t);if(r){if(r.required){const t=a.shift();if(t===undefined)this.optionMissingArgument(r);this.emit(`option:${r.name()}`,t)}else if(r.optional){let t=null;if(a.length>0&&!maybeOption(a[0])){t=a.shift()}this.emit(`option:${r.name()}`,t)}else{this.emit(`option:${r.name()}`)}l=r.variadic?r:null;continue}}if(t.length>2&&t[0]==="-"&&t[1]!=="-"){const r=this._findOption(`-${t[1]}`);if(r){if(r.required||r.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${r.name()}`,t.slice(2))}else{this.emit(`option:${r.name()}`);a.unshift(`-${t.slice(2)}`)}continue}}if(/^--[^=]+=/.test(t)){const r=t.indexOf("=");const i=this._findOption(t.slice(0,r));if(i&&(i.required||i.optional)){this.emit(`option:${i.name()}`,t.slice(r+1));continue}}if(maybeOption(t)){o=i}if((this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(t)){r.push(t);if(a.length>0)i.push(...a);break}else if(t===this._helpCommandName&&this._hasImplicitHelpCommand()){r.push(t);if(a.length>0)r.push(...a);break}else if(this._defaultCommandName){i.push(t);if(a.length>0)i.push(...a);break}}if(this._passThroughOptions){o.push(t);if(a.length>0)o.push(...a);break}o.push(t)}return{operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){const t={};const r=this.options.length;for(let i=0;i<r;i++){const r=this.options[i].attributeName();t[r]=r===this._versionOptionName?this._version:this[r]}return t}return this._optionValues}optsWithGlobals(){return getCommandAndParents(this).reduce(((t,r)=>Object.assign(t,r.opts())),{})}error(t,r){this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const i=r||{};const o=i.exitCode||1;const a=i.code||"commander.error";this._exit(o,a,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in u.env){const r=t.attributeName();if(this.getOptionValue(r)===undefined||["default","config","env"].includes(this.getOptionValueSource(r))){if(t.required||t.optional){this.emit(`optionEnv:${t.name()}`,u.env[t.envVar])}else{this.emit(`optionEnv:${t.name()}`)}}}}))}_parseOptionsImplied(){const t=new b(this.options);const hasCustomOptionValue=t=>this.getOptionValue(t)!==undefined&&!["default","implied"].includes(this.getOptionValueSource(t));this.options.filter((r=>r.implied!==undefined&&hasCustomOptionValue(r.attributeName())&&t.valueFromOption(this.getOptionValue(r.attributeName()),r))).forEach((t=>{Object.keys(t.implied).filter((t=>!hasCustomOptionValue(t))).forEach((r=>{this.setOptionValueWithSource(r,t.implied[r],"implied")}))}))}missingArgument(t){const r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){const r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){const findBestOptionFromValue=t=>{const r=t.attributeName();const i=this.getOptionValue(r);const o=this.options.find((t=>t.negate&&r===t.attributeName()));const a=this.options.find((t=>!t.negate&&r===t.attributeName()));if(o&&(o.presetArg===undefined&&i===false||o.presetArg!==undefined&&i===o.presetArg)){return o}return a||t};const getErrorMessage=t=>{const r=findBestOptionFromValue(t);const i=r.attributeName();const o=this.getOptionValueSource(i);if(o==="env"){return`environment variable '${r.envVar}'`}return`option '${r.flags}'`};const i=`error: ${getErrorMessage(t)} cannot be used with ${getErrorMessage(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[];let o=this;do{const t=o.createHelp().visibleOptions(o).filter((t=>t.long)).map((t=>t.long));i=i.concat(t);o=o.parent}while(o&&!o._enablePositionalOptions);r=v(t,i)}const i=`error: unknown option '${t}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const r=this._args.length;const i=r===1?"":"s";const o=this.parent?` for '${this.name()}'`:"";const a=`error: too many arguments${o}. Expected ${r} argument${i} but got ${t.length}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let r="";if(this._showSuggestionAfterError){const i=[];this.createHelp().visibleCommands(this).forEach((t=>{i.push(t.name());if(t.alias())i.push(t.alias())}));r=v(t,i)}const i=`error: unknown command '${t}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(t,r,i){if(t===undefined)return this._version;this._version=t;r=r||"-V, --version";i=i||"output the version number";const o=this.createOption(r,i);this._versionOptionName=o.attributeName();this.options.push(o);this.on("option:"+o.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`);this._exit(0,"commander.version",t)}));return this}description(t,r){if(t===undefined&&r===undefined)return this._description;this._description=t;if(r){this._argsDescription=r}return this}summary(t){if(t===undefined)return this._summary;this._summary=t;return this}alias(t){if(t===undefined)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler){r=this.commands[this.commands.length-1]}if(t===r._name)throw new Error("Command alias can't be the same as its name");r._aliases.push(t);return this}aliases(t){if(t===undefined)return this._aliases;t.forEach((t=>this.alias(t)));return this}usage(t){if(t===undefined){if(this._usage)return this._usage;const t=this._args.map((t=>d(t)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?t:[]).join(" ")}this._usage=t;return this}name(t){if(t===undefined)return this._name;this._name=t;return this}nameFromFilename(t){this._name=l.basename(t,l.extname(t));return this}executableDir(t){if(t===undefined)return this._executableDir;this._executableDir=t;return this}helpInformation(t){const r=this.createHelp();if(r.helpWidth===undefined){r.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()}return r.formatHelp(this,r)}_getHelpContext(t){t=t||{};const r={error:!!t.error};let i;if(r.error){i=t=>this._outputConfiguration.writeErr(t)}else{i=t=>this._outputConfiguration.writeOut(t)}r.write=t.write||i;r.command=this;return r}outputHelp(t){let r;if(typeof t==="function"){r=t;t=undefined}const i=this._getHelpContext(t);getCommandAndParents(this).reverse().forEach((t=>t.emit("beforeAllHelp",i)));this.emit("beforeHelp",i);let o=this.helpInformation(i);if(r){o=r(o);if(typeof o!=="string"&&!Buffer.isBuffer(o)){throw new Error("outputHelp callback must return a string or a Buffer")}}i.write(o);this.emit(this._helpLongFlag);this.emit("afterHelp",i);getCommandAndParents(this).forEach((t=>t.emit("afterAllHelp",i)))}helpOption(t,r){if(typeof t==="boolean"){this._hasHelpOption=t;return this}this._helpFlags=t||this._helpFlags;this._helpDescription=r||this._helpDescription;const i=g(this._helpFlags);this._helpShortFlag=i.shortFlag;this._helpLongFlag=i.longFlag;return this}help(t){this.outputHelp(t);let r=u.exitCode||0;if(r===0&&t&&typeof t!=="function"&&t.error){r=1}this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){const i=["beforeAll","before","after","afterAll"];if(!i.includes(t)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${i.join("', '")}'`)}const o=`${t}Help`;this.on(o,(t=>{let i;if(typeof r==="function"){i=r({error:t.error,command:t.command})}else{i=r}if(i){t.write(`${i}\n`)}}));return this}}function outputHelpIfRequested(t,r){const i=t._hasHelpOption&&r.find((r=>r===t._helpLongFlag||r===t._helpShortFlag));if(i){t.outputHelp();t._exit(0,"commander.helpDisplayed","(outputHelp)")}}function incrementNodeInspectorPort(t){return t.map((t=>{if(!t.startsWith("--inspect")){return t}let r;let i="127.0.0.1";let o="9229";let a;if((a=t.match(/^(--inspect(-brk)?)$/))!==null){r=a[1]}else if((a=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){r=a[1];if(/^\d+$/.test(a[3])){o=a[3]}else{i=a[3]}}else if((a=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){r=a[1];i=a[3];o=a[4]}if(r&&o!=="0"){return`${r}=${i}:${parseInt(o)+1}`}return t}))}function getCommandAndParents(t){const r=[];for(let i=t;i;i=i.parent){r.push(i)}return r}r.Command=Command},9027:(t,r)=>{class CommanderError extends Error{constructor(t,r,i){super(i);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=r;this.exitCode=t;this.nestedError=undefined}}class InvalidArgumentError extends CommanderError{constructor(t){super(1,"commander.invalidArgument",t);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}r.CommanderError=CommanderError;r.InvalidArgumentError=InvalidArgumentError},9164:(t,r,i)=>{const{humanReadableArgName:o}=i(4079);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false}visibleCommands(t){const r=t.commands.filter((t=>!t._hidden));if(t._hasImplicitHelpCommand()){const[,i,o]=t._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/);const a=t.createCommand(i).helpOption(false);a.description(t._helpCommandDescription);if(o)a.arguments(o);r.push(a)}if(this.sortSubcommands){r.sort(((t,r)=>t.name().localeCompare(r.name())))}return r}visibleOptions(t){const r=t.options.filter((t=>!t.hidden));const i=t._hasHelpOption&&t._helpShortFlag&&!t._findOption(t._helpShortFlag);const o=t._hasHelpOption&&!t._findOption(t._helpLongFlag);if(i||o){let a;if(!i){a=t.createOption(t._helpLongFlag,t._helpDescription)}else if(!o){a=t.createOption(t._helpShortFlag,t._helpDescription)}else{a=t.createOption(t._helpFlags,t._helpDescription)}r.push(a)}if(this.sortOptions){const getSortKey=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");r.sort(((t,r)=>getSortKey(t).localeCompare(getSortKey(r))))}return r}visibleArguments(t){if(t._argsDescription){t._args.forEach((r=>{r.description=r.description||t._argsDescription[r.name()]||""}))}if(t._args.find((t=>t.description))){return t._args}return[]}subcommandTerm(t){const r=t._args.map((t=>o(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce(((t,i)=>Math.max(t,r.subcommandTerm(i).length)),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce(((t,i)=>Math.max(t,r.optionTerm(i).length)),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce(((t,i)=>Math.max(t,r.argumentTerm(i).length)),0)}commandUsage(t){let r=t._name;if(t._aliases[0]){r=r+"|"+t._aliases[0]}let i="";for(let r=t.parent;r;r=r.parent){i=r.name()+" "+i}return i+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){const r=[];if(t.argChoices){r.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){const i=t.required||t.optional||t.isBoolean()&&typeof t.defaultValue==="boolean";if(i){r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}}if(t.presetArg!==undefined&&t.optional){r.push(`preset: ${JSON.stringify(t.presetArg)}`)}if(t.envVar!==undefined){r.push(`env: ${t.envVar}`)}if(r.length>0){return`${t.description} (${r.join(", ")})`}return t.description}argumentDescription(t){const r=[];if(t.argChoices){r.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}if(r.length>0){const i=`(${r.join(", ")})`;if(t.description){return`${t.description} ${i}`}return i}return t.description}formatHelp(t,r){const i=r.padWidth(t,r);const o=r.helpWidth||80;const a=2;const l=2;function formatItem(t,c){if(c){const u=`${t.padEnd(i+l)}${c}`;return r.wrap(u,o-a,i+l)}return t}function formatList(t){return t.join("\n").replace(/^/gm," ".repeat(a))}let c=[`Usage: ${r.commandUsage(t)}`,""];const u=r.commandDescription(t);if(u.length>0){c=c.concat([u,""])}const h=r.visibleArguments(t).map((t=>formatItem(r.argumentTerm(t),r.argumentDescription(t))));if(h.length>0){c=c.concat(["Arguments:",formatList(h),""])}const d=r.visibleOptions(t).map((t=>formatItem(r.optionTerm(t),r.optionDescription(t))));if(d.length>0){c=c.concat(["Options:",formatList(d),""])}const p=r.visibleCommands(t).map((t=>formatItem(r.subcommandTerm(t),r.subcommandDescription(t))));if(p.length>0){c=c.concat(["Commands:",formatList(p),""])}return c.join("\n")}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}wrap(t,r,i,o=40){if(t.match(/[\n]\s+/))return t;const a=r-i;if(a<o)return t;const l=t.slice(0,i);const c=t.slice(i);const u=" ".repeat(i);const h=new RegExp(".{1,"+(a-1)+"}([\\s​]|$)|[^\\s​]+?([\\s​]|$)","g");const d=c.match(h)||[];return l+d.map(((t,r)=>{if(t.slice(-1)==="\n"){t=t.slice(0,t.length-1)}return(r>0?u:"")+t.trimRight()})).join("\n")}}r.Help=Help},5205:(t,r,i)=>{const{InvalidArgumentError:o}=i(9027);class Option{constructor(t,r){this.flags=t;this.description=r||"";this.required=t.includes("<");this.optional=t.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(t);this.mandatory=false;const i=splitOptionFlags(t);this.short=i.shortFlag;this.long=i.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined;this.conflictsWith=[];this.implied=undefined}default(t,r){this.defaultValue=t;this.defaultValueDescription=r;return this}preset(t){this.presetArg=t;return this}conflicts(t){this.conflictsWith=this.conflictsWith.concat(t);return this}implies(t){this.implied=Object.assign(this.implied||{},t);return this}env(t){this.envVar=t;return this}argParser(t){this.parseArg=t;return this}makeOptionMandatory(t=true){this.mandatory=!!t;return this}hideHelp(t=true){this.hidden=!!t;return this}_concatValue(t,r){if(r===this.defaultValue||!Array.isArray(r)){return[t]}return r.concat(t)}choices(t){this.argChoices=t.slice();this.parseArg=(t,r)=>{if(!this.argChoices.includes(t)){throw new o(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,r)}return t};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){return camelcase(this.name().replace(/^no-/,""))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class DualOptions{constructor(t){this.positiveOptions=new Map;this.negativeOptions=new Map;this.dualOptions=new Set;t.forEach((t=>{if(t.negate){this.negativeOptions.set(t.attributeName(),t)}else{this.positiveOptions.set(t.attributeName(),t)}}));this.negativeOptions.forEach(((t,r)=>{if(this.positiveOptions.has(r)){this.dualOptions.add(r)}}))}valueFromOption(t,r){const i=r.attributeName();if(!this.dualOptions.has(i))return true;const o=this.negativeOptions.get(i).presetArg;const a=o!==undefined?o:false;return r.negate===(a===t)}}function camelcase(t){return t.split("-").reduce(((t,r)=>t+r[0].toUpperCase()+r.slice(1)))}function splitOptionFlags(t){let r;let i;const o=t.split(/[ |,]+/);if(o.length>1&&!/^[[<]/.test(o[1]))r=o.shift();i=o.shift();if(!r&&/^-[^-]$/.test(i)){r=i;i=undefined}return{shortFlag:r,longFlag:i}}r.Option=Option;r.splitOptionFlags=splitOptionFlags;r.DualOptions=DualOptions},211:(t,r)=>{const i=3;function editDistance(t,r){if(Math.abs(t.length-r.length)>i)return Math.max(t.length,r.length);const o=[];for(let r=0;r<=t.length;r++){o[r]=[r]}for(let t=0;t<=r.length;t++){o[0][t]=t}for(let i=1;i<=r.length;i++){for(let a=1;a<=t.length;a++){let l=1;if(t[a-1]===r[i-1]){l=0}else{l=1}o[a][i]=Math.min(o[a-1][i]+1,o[a][i-1]+1,o[a-1][i-1]+l);if(a>1&&i>1&&t[a-1]===r[i-2]&&t[a-2]===r[i-1]){o[a][i]=Math.min(o[a][i],o[a-2][i-2]+1)}}}return o[t.length][r.length]}function suggestSimilar(t,r){if(!r||r.length===0)return"";r=Array.from(new Set(r));const o=t.startsWith("--");if(o){t=t.slice(2);r=r.map((t=>t.slice(2)))}let a=[];let l=i;const c=.4;r.forEach((r=>{if(r.length<=1)return;const i=editDistance(t,r);const o=Math.max(t.length,r.length);const u=(o-i)/o;if(u>c){if(i<l){l=i;a=[r]}else if(i===l){a.push(r)}}}));a.sort(((t,r)=>t.localeCompare(r)));if(o){a=a.map((t=>`--${t}`))}if(a.length>1){return`\n(Did you mean one of ${a.join(", ")}?)`}if(a.length===1){return`\n(Did you mean ${a[0]}?)`}return""}r.suggestSimilar=suggestSimilar}};var r={};function __nccwpck_require__(i){var o=r[i];if(o!==undefined){return o.exports}var a=r[i]={exports:{}};var l=true;try{t[i].call(a.exports,a,a.exports,__nccwpck_require__);l=false}finally{if(l)delete r[i]}return a.exports}(()=>{__nccwpck_require__.n=t=>{var r=t&&t.__esModule?()=>t["default"]:()=>t;__nccwpck_require__.d(r,{a:r});return r}})();(()=>{__nccwpck_require__.d=(t,r)=>{for(var i in r){if(__nccwpck_require__.o(r,i)&&!__nccwpck_require__.o(t,i)){Object.defineProperty(t,i,{enumerable:true,get:r[i]})}}}})();(()=>{__nccwpck_require__.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(7666);module.exports=i})();
131
+ var o=i(3837).inherits;var a=i(2096).ZipArchiveOutputStream;var l=i(2096).ZipArchiveEntry;var c=i(1246);var u=t.exports=function(t){if(!(this instanceof u)){return new u(t)}t=this.options=t||{};t.zlib=t.zlib||{};a.call(this,t);if(typeof t.level==="number"&&t.level>=0){t.zlib.level=t.level;delete t.level}if(!t.forceZip64&&typeof t.zlib.level==="number"&&t.zlib.level===0){t.store=true}t.namePrependSlash=t.namePrependSlash||false;if(t.comment&&t.comment.length>0){this.setComment(t.comment)}};o(u,a);u.prototype._normalizeFileData=function(t){t=c.defaults(t,{type:"file",name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:""});var r=t.type==="directory";var i=t.type==="symlink";if(t.name){t.name=c.sanitizePath(t.name);if(!i&&t.name.slice(-1)==="/"){r=true;t.type="directory"}else if(r){t.name+="/"}}if(r||i){t.store=true}t.date=c.dateify(t.date);return t};u.prototype.entry=function(t,r,i){if(typeof i!=="function"){i=this._emitErrorCallback.bind(this)}r=this._normalizeFileData(r);if(r.type!=="file"&&r.type!=="directory"&&r.type!=="symlink"){i(new Error(r.type+" entries not currently supported"));return}if(typeof r.name!=="string"||r.name.length===0){i(new Error("entry name must be a non-empty string value"));return}if(r.type==="symlink"&&typeof r.linkname!=="string"){i(new Error("entry linkname must be a non-empty string value when type equals symlink"));return}var o=new l(r.name);o.setTime(r.date,this.options.forceLocalTime);if(r.namePrependSlash){o.setName(r.name,true)}if(r.store){o.setMethod(0)}if(r.comment.length>0){o.setComment(r.comment)}if(r.type==="symlink"&&typeof r.mode!=="number"){r.mode=40960}if(typeof r.mode==="number"){if(r.type==="symlink"){r.mode|=40960}o.setUnixMode(r.mode)}if(r.type==="symlink"&&typeof r.linkname==="string"){t=Buffer.from(r.linkname)}return a.prototype.entry.call(this,o,t,i)};u.prototype.finalize=function(){this.finish()}},889:(t,r,i)=>{"use strict";i.r(r);const o=10;const wrapAnsi16=(t=0)=>r=>`[${r+t}m`;const wrapAnsi256=(t=0)=>r=>`[${38+t};5;${r}m`;const wrapAnsi16m=(t=0)=>(r,i,o)=>`[${38+t};2;${r};${i};${o}m`;const a={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};const l=Object.keys(a.modifier);const c=Object.keys(a.color);const u=Object.keys(a.bgColor);const h=[...c,...u];function assembleStyles(){const t=new Map;for(const[r,i]of Object.entries(a)){for(const[r,o]of Object.entries(i)){a[r]={open:`[${o[0]}m`,close:`[${o[1]}m`};i[r]=a[r];t.set(o[0],o[1])}Object.defineProperty(a,r,{value:i,enumerable:false})}Object.defineProperty(a,"codes",{value:t,enumerable:false});a.color.close="";a.bgColor.close="";a.color.ansi=wrapAnsi16();a.color.ansi256=wrapAnsi256();a.color.ansi16m=wrapAnsi16m();a.bgColor.ansi=wrapAnsi16(o);a.bgColor.ansi256=wrapAnsi256(o);a.bgColor.ansi16m=wrapAnsi16m(o);Object.defineProperties(a,{rgbToAnsi256:{value(t,r,i){if(t===r&&r===i){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:false},hexToRgb:{value(t){const r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r){return[0,0,0]}let[i]=r;if(i.length===3){i=[...i].map((t=>t+t)).join("")}const o=Number.parseInt(i,16);return[o>>16&255,o>>8&255,o&255]},enumerable:false},hexToAnsi256:{value:t=>a.rgbToAnsi256(...a.hexToRgb(t)),enumerable:false},ansi256ToAnsi:{value(t){if(t<8){return 30+t}if(t<16){return 90+(t-8)}let r;let i;let o;if(t>=232){r=((t-232)*10+8)/255;i=r;o=r}else{t-=16;const a=t%36;r=Math.floor(t/36)/5;i=Math.floor(a/6)/5;o=a%6/5}const a=Math.max(r,i,o)*2;if(a===0){return 30}let l=30+(Math.round(o)<<2|Math.round(i)<<1|Math.round(r));if(a===2){l+=60}return l},enumerable:false},rgbToAnsi:{value:(t,r,i)=>a.ansi256ToAnsi(a.rgbToAnsi256(t,r,i)),enumerable:false},hexToAnsi:{value:t=>a.ansi256ToAnsi(a.hexToAnsi256(t)),enumerable:false}});return a}const d=assembleStyles();const p=d;const m=require("node:process");const y=require("node:os");const g=require("node:tty");function hasFlag(t,r=m.argv){const i=t.startsWith("-")?"":t.length===1?"-":"--";const o=r.indexOf(i+t);const a=r.indexOf("--");return o!==-1&&(a===-1||o<a)}const{env:b}=m;let v;if(hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")){v=0}else if(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always")){v=1}function envForceColor(){if("FORCE_COLOR"in b){if(b.FORCE_COLOR==="true"){return 1}if(b.FORCE_COLOR==="false"){return 0}return b.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(b.FORCE_COLOR,10),3)}}function translateLevel(t){if(t===0){return false}return{level:t,hasBasic:true,has256:t>=2,has16m:t>=3}}function _supportsColor(t,{streamIsTTY:r,sniffFlags:i=true}={}){const o=envForceColor();if(o!==undefined){v=o}const a=i?v:o;if(a===0){return 0}if(i){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor")){return 3}if(hasFlag("color=256")){return 2}}if(t&&!r&&a===undefined){return 0}const l=a||0;if(b.TERM==="dumb"){return l}if(m.platform==="win32"){const t=y.release().split(".");if(Number(t[0])>=10&&Number(t[2])>=10586){return Number(t[2])>=14931?3:2}return 1}if("CI"in b){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((t=>t in b))||b.CI_NAME==="codeship"){return 1}return l}if("TEAMCITY_VERSION"in b){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(b.TEAMCITY_VERSION)?1:0}if("TF_BUILD"in b&&"AGENT_NAME"in b){return 1}if(b.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in b){const t=Number.parseInt((b.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(b.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(b.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(b.TERM)){return 1}if("COLORTERM"in b){return 1}return l}function createSupportsColor(t,r={}){const i=_supportsColor(t,{streamIsTTY:t&&t.isTTY,...r});return translateLevel(i)}const _={stdout:createSupportsColor({isTTY:g.isatty(1)}),stderr:createSupportsColor({isTTY:g.isatty(2)})};const w=_;function stringReplaceAll(t,r,i){let o=t.indexOf(r);if(o===-1){return t}const a=r.length;let l=0;let c="";do{c+=t.slice(l,o)+r+i;l=o+a;o=t.indexOf(r,l)}while(o!==-1);c+=t.slice(l);return c}function stringEncaseCRLFWithFirstIndex(t,r,i,o){let a=0;let l="";do{const c=t[o-1]==="\r";l+=t.slice(a,c?o-1:o)+r+(c?"\r\n":"\n")+i;a=o+1;o=t.indexOf("\n",a)}while(o!==-1);l+=t.slice(a);return l}const{stdout:E,stderr:S}=w;const O=Symbol("GENERATOR");const R=Symbol("STYLER");const x=Symbol("IS_EMPTY");const k=["ansi","ansi","ansi256","ansi16m"];const T=Object.create(null);const applyOptions=(t,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const i=E?E.level:0;t.level=r.level===undefined?i:r.level};class Chalk{constructor(t){return chalkFactory(t)}}const chalkFactory=t=>{const chalk=(...t)=>t.join(" ");applyOptions(chalk,t);Object.setPrototypeOf(chalk,createChalk.prototype);return chalk};function createChalk(t){return chalkFactory(t)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[t,r]of Object.entries(p)){T[t]={get(){const i=createBuilder(this,createStyler(r.open,r.close,this[R]),this[x]);Object.defineProperty(this,t,{value:i});return i}}}T.visible={get(){const t=createBuilder(this,this[R],true);Object.defineProperty(this,"visible",{value:t});return t}};const getModelAnsi=(t,r,i,...o)=>{if(t==="rgb"){if(r==="ansi16m"){return p[i].ansi16m(...o)}if(r==="ansi256"){return p[i].ansi256(p.rgbToAnsi256(...o))}return p[i].ansi(p.rgbToAnsi(...o))}if(t==="hex"){return getModelAnsi("rgb",r,i,...p.hexToRgb(...o))}return p[i][t](...o)};const A=["rgb","hex","ansi256"];for(const t of A){T[t]={get(){const{level:r}=this;return function(...i){const o=createStyler(getModelAnsi(t,k[r],"color",...i),p.color.close,this[R]);return createBuilder(this,o,this[x])}}};const r="bg"+t[0].toUpperCase()+t.slice(1);T[r]={get(){const{level:r}=this;return function(...i){const o=createStyler(getModelAnsi(t,k[r],"bgColor",...i),p.bgColor.close,this[R]);return createBuilder(this,o,this[x])}}}}const C=Object.defineProperties((()=>{}),{...T,level:{enumerable:true,get(){return this[O].level},set(t){this[O].level=t}}});const createStyler=(t,r,i)=>{let o;let a;if(i===undefined){o=t;a=r}else{o=i.openAll+t;a=r+i.closeAll}return{open:t,close:r,openAll:o,closeAll:a,parent:i}};const createBuilder=(t,r,i)=>{const builder=(...t)=>applyStyle(builder,t.length===1?""+t[0]:t.join(" "));Object.setPrototypeOf(builder,C);builder[O]=t;builder[R]=r;builder[x]=i;return builder};const applyStyle=(t,r)=>{if(t.level<=0||!r){return t[x]?"":r}let i=t[R];if(i===undefined){return r}const{openAll:o,closeAll:a}=i;if(r.includes("")){while(i!==undefined){r=stringReplaceAll(r,i.close,i.open);i=i.parent}}const l=r.indexOf("\n");if(l!==-1){r=stringEncaseCRLFWithFirstIndex(r,a,o,l)}return o+r+a};Object.defineProperties(createChalk.prototype,T);const P=createChalk();const I=createChalk({level:S?S.level:0});const L=P;var M=i(345);const{program:D,createCommand:N,createArgument:j,createOption:B,CommanderError:$,InvalidArgumentError:H,InvalidOptionArgumentError:U,Command:q,Argument:z,Option:G,Help:W}=M;var V=i(5656);var Y=i.n(V);var Z=i(1017);var K=i.n(Z);var Q=i(7147);var X=i.n(Q);function isSetup(){try{const t=X().statSync(K().join(process.cwd(),".hyperbook"));if(!t.isDirectory()){throw Error()}}catch(t){console.log(L.red("Could not find .hyperbook folder. Be sure to run `hyperbook setup`."));return false}try{X().statSync(K().join(process.cwd(),".hyperbook","node_modules",".bin","next"))}catch(t){console.log(L.red("Could not find next binary in the .hyperbook folder. Be sure to run `hyperbook setup`."));return false}return true}var J=i(2202);var ee=i.n(J);var te=i(7282);var re=i.n(te);async function archiveFolder(t){return new Promise(((r,i)=>{const o=K().join(re().cwd(),"public","archives");if(!X().existsSync(o)){X().mkdirSync(o,{recursive:true})}const a=K().join(o,t+".zip");const l=X().createWriteStream(a);const c=ee()("zip",{zlib:{level:9}});c.on("finish",(()=>{console.log(L.green("Archive zipped: ")+t);r()}));c.on("error",(t=>{throw t}));c.pipe(l);c.directory(K().join(re().cwd(),"archives",t),false);c.finalize()}))}async function runArchive(){const t=isSetup();if(!t){throw new Error("no setup")}return new Promise(((t,r)=>{if(!X().existsSync(K().join(re().cwd(),"archives"))){console.log(L.blue("info ")+"- No Archives found");t()}const i=X().readdirSync(K().join(re().cwd(),"archives"),{withFileTypes:true}).filter((t=>t.isDirectory()));Promise.all(i.map((t=>archiveFolder(t.name)))).then((()=>{t()})).catch((()=>{r()}))}))}var ie=i(4488);var se=i.n(ie);async function readHyperbook(){return new Promise(((t,r)=>{X().readFile(K().join(process.cwd(),"hyperbook.json"),((i,o)=>{if(i){console.log(L.red("Could not find 'hyperbook.json'. Make sure you are in the right directory."));r()}else{const r=JSON.parse(o.toString());t(r)}}))}))}async function runBuild(){const t=isSetup();if(!t){throw new Error("no setup")}const r=await readHyperbook();X().writeFileSync(K().join(process.cwd(),".hyperbook","next.config.js"),`\nmodule.exports = {\n ${(r===null||r===void 0?void 0:r.basePath)?`basePath: '${r.basePath}',`:""}\n typescript: {\n ignoreBuildErrors: true,\n }\n}\n `);return new Promise(((t,r)=>{const i="npm";const o=["run","build"];const a=se()(i,o,{stdio:"inherit",cwd:K().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});a.on("close",(a=>{if(a!==0){r({command:`${i} ${o.join(" ")}`});return}t()}))}))}async function runDev(){const t=isSetup();if(!t){throw new Error("no setup")}return new Promise(((t,r)=>{const i="npm";const o=["run","dev"];const a=se()(i,o,{stdio:"inherit",cwd:K().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});a.on("close",(a=>{if(a!==0){r({command:`${i} ${o.join(" ")}`});return}t()}))}))}var ne=i(2081);function getPkgManager(){try{const t=process.env.npm_config_user_agent;if(t){if(t.startsWith("yarn")){return"yarn"}else if(t.startsWith("pnpm")){return"pnpm"}}try{(0,ne.execSync)("yarn --version",{stdio:"ignore"});return"yarn"}catch{(0,ne.execSync)("pnpm --version",{stdio:"ignore"});return"pnpm"}}catch{return"npm"}}var oe=i(2037);var ae=i.n(oe);const le=require("node:events");const ce=require("node:path");function indentString(t,r=1,i={}){const{indent:o=" ",includeEmptyLines:a=false}=i;if(typeof t!=="string"){throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``)}if(typeof r!=="number"){throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``)}if(r<0){throw new RangeError(`Expected \`count\` to be at least 0, got \`${r}\``)}if(typeof o!=="string"){throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof o}\``)}if(r===0){return t}const l=a?/^/gm:/^(?!\s*$)/gm;return t.replace(l,o.repeat(r))}function escapeStringRegexp(t){if(typeof t!=="string"){throw new TypeError("Expected a string")}return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const ue=/\s+at.*[(\s](.*)\)?/;const he=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/;const fe=typeof oe.homedir==="undefined"?"":oe.homedir().replace(/\\/g,"/");function cleanStack(t,{pretty:r=false,basePath:i}={}){const o=i&&new RegExp(`(at | \\()${escapeStringRegexp(i.replace(/\\/g,"/"))}`,"g");if(typeof t!=="string"){return undefined}return t.replace(/\\/g,"/").split("\n").filter((t=>{const r=t.match(ue);if(r===null||!r[1]){return true}const i=r[1];if(i.includes(".app/Contents/Resources/electron.asar")||i.includes(".app/Contents/Resources/default_app.asar")){return false}return!he.test(i)})).filter((t=>t.trim()!=="")).map((t=>{if(o){t=t.replace(o,"$1")}if(r){t=t.replace(ue,((t,r)=>t.replace(r,r.replace(fe,"~"))))}return t})).join("\n")}const cleanInternalStack=t=>t.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");class AggregateError extends Error{#e;name="AggregateError";constructor(t){if(!Array.isArray(t)){throw new TypeError(`Expected input to be an Array, got ${typeof t}`)}t=t.map((t=>{if(t instanceof Error){return t}if(t!==null&&typeof t==="object"){return Object.assign(new Error(t.message),t)}return new Error(t)}));let r=t.map((t=>typeof t.stack==="string"?cleanInternalStack(cleanStack(t.stack)):String(t))).join("\n");r="\n"+indentString(r,4);super(r);this.#e=t}get errors(){return this.#e.slice()}}async function pMap(t,r,{concurrency:i=Number.POSITIVE_INFINITY,stopOnError:o=true}={}){return new Promise(((a,l)=>{if(t[Symbol.iterator]===undefined&&t[Symbol.asyncIterator]===undefined){throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`)}if(typeof r!=="function"){throw new TypeError("Mapper function is required")}if(!((Number.isSafeInteger(i)||i===Number.POSITIVE_INFINITY)&&i>=1)){throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${i}\` (${typeof i})`)}const c=[];const u=[];const h=new Map;let d=false;let p=false;let m=false;let y=0;let g=0;const b=t[Symbol.iterator]===undefined?t[Symbol.asyncIterator]():t[Symbol.iterator]();const reject=t=>{d=true;p=true;l(t)};const next=async()=>{if(p){return}const t=await b.next();const i=g;g++;if(t.done){m=true;if(y===0&&!p){if(!o&&u.length>0){reject(new AggregateError(u));return}p=true;if(!h.size){a(c);return}const t=[];for(const[r,i]of c.entries()){if(h.get(r)===de){continue}t.push(i)}a(t)}return}y++;(async()=>{try{const o=await t.value;if(p){return}const a=await r(o,i);if(a===de){h.set(i,a)}c[i]=a;y--;await next()}catch(t){if(o){reject(t)}else{u.push(t);y--;try{await next()}catch(t){reject(t)}}}})()};(async()=>{for(let t=0;t<i;t++){try{await next()}catch(t){reject(t);break}if(m||d){break}}})()}))}const de=Symbol("skip");function arrify(t){if(t===null||t===undefined){return[]}if(Array.isArray(t)){return t}if(typeof t==="string"){return[t]}if(typeof t[Symbol.iterator]==="function"){return[...t]}return[t]}var pe=i(8174);class AbortError extends Error{constructor(t){super();this.name="AbortError";this.message=t}}const getDOMException=t=>globalThis.DOMException===undefined?new AbortError(t):new DOMException(t);const getAbortedReason=t=>{const r=t.reason===undefined?getDOMException("This operation was aborted."):t.reason;return r instanceof Error?r:getDOMException(r)};async function p_map_pMap(t,r,{concurrency:i=Number.POSITIVE_INFINITY,stopOnError:o=true,signal:a}={}){return new Promise(((l,c)=>{if(t[Symbol.iterator]===undefined&&t[Symbol.asyncIterator]===undefined){throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`)}if(typeof r!=="function"){throw new TypeError("Mapper function is required")}if(!((Number.isSafeInteger(i)||i===Number.POSITIVE_INFINITY)&&i>=1)){throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${i}\` (${typeof i})`)}const u=[];const h=[];const d=new Map;let p=false;let m=false;let y=false;let g=0;let b=0;const v=t[Symbol.iterator]===undefined?t[Symbol.asyncIterator]():t[Symbol.iterator]();const reject=t=>{p=true;m=true;c(t)};if(a){if(a.aborted){reject(getAbortedReason(a))}a.addEventListener("abort",(()=>{reject(getAbortedReason(a))}))}const next=async()=>{if(m){return}const t=await v.next();const i=b;b++;if(t.done){y=true;if(g===0&&!m){if(!o&&h.length>0){reject(new AggregateError(h));return}m=true;if(d.size===0){l(u);return}const t=[];for(const[r,i]of u.entries()){if(d.get(r)===me){continue}t.push(i)}l(t)}return}g++;(async()=>{try{const o=await t.value;if(m){return}const a=await r(o,i);if(a===me){d.set(i,a)}u[i]=a;g--;await next()}catch(t){if(o){reject(t)}else{h.push(t);g--;try{await next()}catch(t){reject(t)}}}})()};(async()=>{for(let t=0;t<i;t++){try{await next()}catch(t){reject(t);break}if(y||p){break}}})()}))}const me=Symbol("skip");async function pFilter(t,r,i){const o=await p_map_pMap(t,((t,i)=>Promise.all([r(t,i),t])),i);return o.filter((t=>Boolean(t[0]))).map((t=>t[1]))}const ye=require("node:fs");var ge=i(9117);var be=i(5342);var ve=i(3286);var _e=i(7993);function slash(t){const r=/^\\\\\?\\/.test(t);const i=/[^\u0000-\u0080]+/.test(t);if(r||i){return t}return t.replace(/\\/g,"/")}const we=require("node:url");const Ee=require("node:stream");const toPath=t=>t instanceof URL?(0,we.fileURLToPath)(t):t;class FilterStream extends Ee.Transform{constructor(t){super({objectMode:true,transform(r,i,o){o(undefined,t(r)?r:undefined)}})}}const isNegativePattern=t=>t[0]==="!";const Se={ignore:["**/node_modules","**/flow-typed","**/coverage","**/.git"],absolute:true,dot:true};const Oe="**/.gitignore";const applyBaseToPattern=(t,r)=>isNegativePattern(t)?"!"+ce.posix.join(r,t.slice(1)):ce.posix.join(r,t);const parseIgnoreFile=(t,r)=>{const i=slash(ce.relative(r,ce.dirname(t.filePath)));return t.content.split(/\r?\n/).filter((t=>t&&!t.startsWith("#"))).map((t=>applyBaseToPattern(t,i)))};const toRelativePath=(t,r)=>{r=slash(r);if(ce.isAbsolute(t)){if(slash(t).startsWith(r)){return ce.relative(r,t)}throw new Error(`Path ${t} is not in cwd ${r}`)}return t};const getIsIgnoredPredicate=(t,r)=>{const i=t.flatMap((t=>parseIgnoreFile(t,r)));const o=_e().add(i);return t=>{t=toPath(t);t=toRelativePath(t,r);return o.ignores(slash(t))}};const normalizeOptions=(t={})=>({cwd:toPath(t.cwd)||m.cwd()});const isIgnoredByIgnoreFiles=async(t,r)=>{const{cwd:i}=normalizeOptions(r);const o=await be(t,{cwd:i,...Se});const a=await Promise.all(o.map((async t=>({filePath:t,content:await ye.promises.readFile(t,"utf8")}))));return getIsIgnoredPredicate(a,i)};const isIgnoredByIgnoreFilesSync=(t,r)=>{const{cwd:i}=normalizeOptions(r);const o=be.sync(t,{cwd:i,...Se});const a=o.map((t=>({filePath:t,content:ye.readFileSync(t,"utf8")})));return getIsIgnoredPredicate(a,i)};const isGitIgnored=t=>isIgnoredByIgnoreFiles(Oe,t);const isGitIgnoredSync=t=>isIgnoredByIgnoreFilesSync(Oe,t);const assertPatternsInput=t=>{if(t.some((t=>typeof t!=="string"))){throw new TypeError("Patterns must be a string or an array of strings")}};const toPatternsArray=t=>{t=[...new Set([t].flat())];assertPatternsInput(t);return t};const checkCwdOption=t=>{if(!t.cwd){return}let r;try{r=ye.statSync(t.cwd)}catch{return}if(!r.isDirectory()){throw new Error("The `cwd` option must be a path to a directory")}};const globby_normalizeOptions=(t={})=>{t={ignore:[],expandDirectories:true,...t,cwd:toPath(t.cwd)};checkCwdOption(t);return t};const normalizeArguments=t=>async(r,i)=>t(toPatternsArray(r),globby_normalizeOptions(i));const normalizeArgumentsSync=t=>(r,i)=>t(toPatternsArray(r),globby_normalizeOptions(i));const getIgnoreFilesPatterns=t=>{const{ignoreFiles:r,gitignore:i}=t;const o=r?toPatternsArray(r):[];if(i){o.push(Oe)}return o};const getFilter=async t=>{const r=getIgnoreFilesPatterns(t);return createFilterFunction(r.length>0&&await isIgnoredByIgnoreFiles(r,{cwd:t.cwd}))};const getFilterSync=t=>{const r=getIgnoreFilesPatterns(t);return createFilterFunction(r.length>0&&isIgnoredByIgnoreFilesSync(r,{cwd:t.cwd}))};const createFilterFunction=t=>{const r=new Set;return i=>{const o=i.path||i;const a=ce.normalize(o);const l=r.has(a)||t&&t(o);r.add(a);return!l}};const unionFastGlobResults=(t,r)=>t.flat().filter((t=>r(t)));const unionFastGlobStreams=(t,r)=>ge(t).pipe(new FilterStream((t=>r(t))));const convertNegativePatterns=(t,r)=>{const i=[];while(t.length>0){const o=t.findIndex((t=>isNegativePattern(t)));if(o===-1){i.push({patterns:t,options:r});break}const a=t[o].slice(1);for(const t of i){t.options.ignore.push(a)}if(o!==0){i.push({patterns:t.slice(0,o),options:{...r,ignore:[...r.ignore,a]}})}t=t.slice(o+1)}return i};const getDirGlobOptions=(t,r)=>({...r?{cwd:r}:{},...Array.isArray(t)?{files:t}:t});const generateTasks=async(t,r)=>{const i=convertNegativePatterns(t,r);const{cwd:o,expandDirectories:a}=r;if(!a){return i}const l=getDirGlobOptions(a,o);const c=o?{cwd:o}:undefined;return Promise.all(i.map((async t=>{let{patterns:r,options:i}=t;[r,i.ignore]=await Promise.all([ve(r,l),ve(i.ignore,c)]);return{patterns:r,options:i}})))};const generateTasksSync=(t,r)=>{const i=convertNegativePatterns(t,r);const{cwd:o,expandDirectories:a}=r;if(!a){return i}const l=getDirGlobOptions(a,o);const c=o?{cwd:o}:undefined;return i.map((t=>{let{patterns:r,options:i}=t;r=ve.sync(r,l);i.ignore=ve.sync(i.ignore,c);return{patterns:r,options:i}}))};const Re=normalizeArguments((async(t,r)=>{const[i,o]=await Promise.all([generateTasks(t,r),getFilter(r)]);const a=await Promise.all(i.map((t=>be(t.patterns,t.options))));return unionFastGlobResults(a,o)}));const xe=normalizeArgumentsSync(((t,r)=>{const i=generateTasksSync(t,r);const o=getFilterSync(r);const a=i.map((t=>be.sync(t.patterns,t.options)));return unionFastGlobResults(a,o)}));const ke=normalizeArgumentsSync(((t,r)=>{const i=generateTasksSync(t,r);const o=getFilterSync(r);const a=i.map((t=>be.stream(t.patterns,t.options)));return unionFastGlobStreams(a,o)}));const Te=normalizeArgumentsSync(((t,r)=>t.some((t=>be.isDynamicPattern(t,r)))));const Ae=normalizeArguments(generateTasks);const Ce=normalizeArgumentsSync(generateTasksSync);var Pe=i(7971);var Ie=i(3134);class CpyError extends Ie{constructor(t,r){super(t,r);Object.assign(this,r);this.name="CpyError"}}const Le=["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^Desktop\\.ini$","@eaDir$"];const Me=new RegExp(Le.join("|"));function isJunk(t){return Me.test(t)}function isNotJunk(t){return!isJunk(t)}class GlobPattern{constructor(t,r,i){this.path=t;this.originalPath=t;this.destination=r;this.options=i;this.isDirectory=false;if(!Te(t)&&ye.existsSync(t)&&ye.lstatSync(t).isDirectory()){this.path=[t,"**"].join("/");this.isDirectory=true}}get name(){return ce.basename(this.originalPath)}get normalizedPath(){const t=this.originalPath.split("/");const r=t.findIndex((t=>t?Te(t):false));const i=t.slice(0,r).join("/");if(i){return ce.isAbsolute(i)?i:ce.join(this.options.cwd,i)}return this.destination}hasMagic(){return Te(this.options.flat?this.path:this.originalPath)}getMatches(){let t=xe(this.path,{...this.options,dot:true,absolute:true,onlyFiles:true});if(this.options.ignoreJunk){t=t.filter((t=>isNotJunk(ce.basename(t))))}return t}}const De=(y.cpus().length||1)*2;const Ne={ignoreJunk:true,flat:false,cwd:m.cwd()};class Entry{constructor(t,r,i){this.path=t.split("/").join(ce.sep);this.relativePath=r.split("/").join(ce.sep);this.pattern=i;Object.freeze(this)}get name(){return ce.basename(this.path)}get nameWithoutExtension(){return ce.basename(this.path,ce.extname(this.path))}get extension(){return ce.extname(this.path).slice(1)}}const expandPatternsWithBraceExpansion=t=>t.flatMap((t=>Pe.braces(t,{expand:true,nodupes:true})));const preprocessDestinationPath=({entry:t,destination:r,options:i})=>{if(t.pattern.hasMagic()){if(i.flat){if(ce.isAbsolute(r)){return ce.join(r,t.name)}return ce.join(i.cwd,r,t.name)}return ce.join(r,ce.relative(t.pattern.normalizedPath,t.path))}if(ce.isAbsolute(r)){return ce.join(r,t.name)}if(t.pattern.isDirectory&&ce.relative(i.cwd,t.path).startsWith("..")){return ce.join(i.cwd,r,ce.basename(t.pattern.originalPath),ce.relative(t.pattern.originalPath,t.path))}if(!t.pattern.isDirectory&&t.path===t.relativePath){return ce.join(i.cwd,r,ce.basename(t.pattern.originalPath),ce.relative(t.pattern.originalPath,t.path))}if(!t.pattern.isDirectory&&i.flat){return ce.join(i.cwd,r,ce.basename(t.pattern.originalPath))}return ce.join(i.cwd,r,ce.relative(i.cwd,t.path))};const renameFile=(t,r)=>{const i=ce.basename(t,ce.extname(t));const o=ce.extname(t);const a=ce.dirname(t);if(typeof r==="string"){return ce.join(a,r)}if(typeof r==="function"){return ce.join(a,`${r(i)}${o}`)}return t};function cpy(t,r,{concurrency:i=De,...o}={}){const a=new Map;const l=new le;o={...Ne,...o};const c=(async()=>{let c=[];let u=0;let h=0;let d=expandPatternsWithBraceExpansion(arrify(t)).map((t=>t.replace(/\\/g,"/")));const p=d.filter((t=>!t.startsWith("!")));const m=d.filter((t=>t.startsWith("!")));if(p.length===0||!r){throw new CpyError("`source` and `destination` required")}d=d.map((t=>new GlobPattern(t,r,{...o,ignore:m})));for(const t of d){let r=[];try{r=t.getMatches()}catch(r){throw new CpyError(`Cannot glob \`${t.originalPath}\`: ${r.message}`,r)}if(r.length===0&&!Te(t.originalPath)&&!Te(m)){throw new CpyError(`Cannot copy \`${t.originalPath}\`: the file doesn't exist`)}c=[...c,...r.map((r=>new Entry(r,ce.relative(o.cwd,r),t)))]}if(o.filter!==undefined){c=await pFilter(c,o.filter,{concurrency:1024})}if(c.length===0){l.emit("progress",{totalFiles:0,percent:1,completedFiles:0,completedSize:0})}const fileProgressHandler=t=>{const r=a.get(t.sourcePath)||{writtenBytes:0,percent:0};if(r.writtenBytes!==t.writtenBytes||r.percent!==t.percent){h-=r.writtenBytes;h+=t.writtenBytes;if(t.percent===1&&r.percent!==1){u++}a.set(t.sourcePath,{writtenBytes:t.writtenBytes,percent:t.percent});l.emit("progress",{totalFiles:c.length,percent:u/c.length,completedFiles:u,completedSize:h})}};return pMap(c,(async t=>{const i=renameFile(preprocessDestinationPath({entry:t,destination:r,options:o}),o.rename);try{await pe(t.path,i,o).on("progress",fileProgressHandler)}catch(r){throw new CpyError(`Cannot copy from \`${t.relativePath}\` to \`${i}\`: ${r.message}`,r)}return i}),{concurrency:i})})();c.on=(...t)=>{l.on(...t);return c};return c}var je=i(5713);var Fe=i.n(je);function isFolderEmpty(t,r){const i=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log"];const o=X().readdirSync(t).filter((t=>!i.includes(t))).filter((t=>!/\.iml$/.test(t)));if(o.length>0){console.log(`The directory ${L.green(r)} contains files that could conflict:`);console.log();for(const r of o){try{const i=X().lstatSync(K().join(t,r));if(i.isDirectory()){console.log(` ${L.blue(r)}/`)}else{console.log(` ${r}`)}}catch{console.log(` ${r}`)}}console.log();console.log("Either try using a new directory name, or remove the files listed above.");console.log();return false}return true}async function isWriteable(t){try{await X().promises.access(t,(X().constants||X()).W_OK);return true}catch(t){return false}}async function makeDir(t,r={recursive:true}){await X().promises.mkdir(t,r)}var Be=i(4700);var $e=i.n(Be);function isInGitRepository(){try{(0,ne.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"});return true}catch(t){}return false}function isInMercurialRepository(){try{(0,ne.execSync)("hg --cwd . root",{stdio:"ignore"});return true}catch(t){}return false}function tryGitInit(t){let r=false;try{(0,ne.execSync)("git --version",{stdio:"ignore"});if(isInGitRepository()||isInMercurialRepository()){return false}(0,ne.execSync)("git init",{stdio:"ignore"});r=true;(0,ne.execSync)("git checkout -b main",{stdio:"ignore"});(0,ne.execSync)("git add -A",{stdio:"ignore"});(0,ne.execSync)('git commit -m "Initial commit from Hyperbook"',{stdio:"ignore"});return true}catch(i){if(r){try{$e().sync(K().join(t,".git"))}catch(t){}}return false}}const He=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function isTypedArrayName(t){return He.includes(t)}const Ue=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...He];function isObjectTypeName(t){return Ue.includes(t)}const qe=["null","undefined","string","number","bigint","boolean","symbol"];function isPrimitiveTypeName(t){return qe.includes(t)}function isOfType(t){return r=>typeof r===t}const{toString:ze}=Object.prototype;const getObjectType=t=>{const r=ze.call(t).slice(8,-1);if(/HTML\w+Element/.test(r)&&is.domElement(t)){return"HTMLElement"}if(isObjectTypeName(r)){return r}return undefined};const isObjectOfType=t=>r=>getObjectType(r)===t;function is(t){if(t===null){return"null"}switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"NaN":"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(is.observable(t)){return"Observable"}if(is.array(t)){return"Array"}if(is.buffer(t)){return"Buffer"}const r=getObjectType(t);if(r){return r}if(t instanceof String||t instanceof Boolean||t instanceof Number){throw new TypeError("Please don't use object wrappers for primitive types")}return"Object"}is.undefined=isOfType("undefined");is.string=isOfType("string");const Ge=isOfType("number");is.number=t=>Ge(t)&&!is.nan(t);is.bigint=isOfType("bigint");is.function_=isOfType("function");is.null_=t=>t===null;is.class_=t=>is.function_(t)&&t.toString().startsWith("class ");is.boolean=t=>t===true||t===false;is.symbol=isOfType("symbol");is.numericString=t=>is.string(t)&&!is.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));is.array=(t,r)=>{if(!Array.isArray(t)){return false}if(!is.function_(r)){return true}return t.every((t=>r(t)))};is.buffer=t=>t?.constructor?.isBuffer?.(t)??false;is.blob=t=>isObjectOfType("Blob")(t);is.nullOrUndefined=t=>is.null_(t)||is.undefined(t);is.object=t=>!is.null_(t)&&(typeof t==="object"||is.function_(t));is.iterable=t=>is.function_(t?.[Symbol.iterator]);is.asyncIterable=t=>is.function_(t?.[Symbol.asyncIterator]);is.generator=t=>is.iterable(t)&&is.function_(t?.next)&&is.function_(t?.throw);is.asyncGenerator=t=>is.asyncIterable(t)&&is.function_(t.next)&&is.function_(t.throw);is.nativePromise=t=>isObjectOfType("Promise")(t);const hasPromiseApi=t=>is.function_(t?.then)&&is.function_(t?.catch);is.promise=t=>is.nativePromise(t)||hasPromiseApi(t);is.generatorFunction=isObjectOfType("GeneratorFunction");is.asyncGeneratorFunction=t=>getObjectType(t)==="AsyncGeneratorFunction";is.asyncFunction=t=>getObjectType(t)==="AsyncFunction";is.boundFunction=t=>is.function_(t)&&!t.hasOwnProperty("prototype");is.regExp=isObjectOfType("RegExp");is.date=isObjectOfType("Date");is.error=isObjectOfType("Error");is.map=t=>isObjectOfType("Map")(t);is.set=t=>isObjectOfType("Set")(t);is.weakMap=t=>isObjectOfType("WeakMap")(t);is.weakSet=t=>isObjectOfType("WeakSet")(t);is.weakRef=t=>isObjectOfType("WeakRef")(t);is.int8Array=isObjectOfType("Int8Array");is.uint8Array=isObjectOfType("Uint8Array");is.uint8ClampedArray=isObjectOfType("Uint8ClampedArray");is.int16Array=isObjectOfType("Int16Array");is.uint16Array=isObjectOfType("Uint16Array");is.int32Array=isObjectOfType("Int32Array");is.uint32Array=isObjectOfType("Uint32Array");is.float32Array=isObjectOfType("Float32Array");is.float64Array=isObjectOfType("Float64Array");is.bigInt64Array=isObjectOfType("BigInt64Array");is.bigUint64Array=isObjectOfType("BigUint64Array");is.arrayBuffer=isObjectOfType("ArrayBuffer");is.sharedArrayBuffer=isObjectOfType("SharedArrayBuffer");is.dataView=isObjectOfType("DataView");is.enumCase=(t,r)=>Object.values(r).includes(t);is.directInstanceOf=(t,r)=>Object.getPrototypeOf(t)===r.prototype;is.urlInstance=t=>isObjectOfType("URL")(t);is.urlString=t=>{if(!is.string(t)){return false}try{new URL(t);return true}catch{return false}};is.truthy=t=>Boolean(t);is.falsy=t=>!t;is.nan=t=>Number.isNaN(t);is.primitive=t=>is.null_(t)||isPrimitiveTypeName(typeof t);is.integer=t=>Number.isInteger(t);is.safeInteger=t=>Number.isSafeInteger(t);is.plainObject=t=>{if(typeof t!=="object"||t===null){return false}const r=Object.getPrototypeOf(t);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};is.typedArray=t=>isTypedArrayName(getObjectType(t));const isValidLength=t=>is.safeInteger(t)&&t>=0;is.arrayLike=t=>!is.nullOrUndefined(t)&&!is.function_(t)&&isValidLength(t.length);is.inRange=(t,r)=>{if(is.number(r)){return t>=Math.min(0,r)&&t<=Math.max(r,0)}if(is.array(r)&&r.length===2){return t>=Math.min(...r)&&t<=Math.max(...r)}throw new TypeError(`Invalid range: ${JSON.stringify(r)}`)};const We=1;const Ve=["innerHTML","ownerDocument","style","attributes","nodeValue"];is.domElement=t=>is.object(t)&&t.nodeType===We&&is.string(t.nodeName)&&!is.plainObject(t)&&Ve.every((r=>r in t));is.observable=t=>{if(!t){return false}if(t===t[Symbol.observable]?.()){return true}if(t===t["@@observable"]?.()){return true}return false};is.nodeStream=t=>is.object(t)&&is.function_(t.pipe)&&!is.observable(t);is.infinite=t=>t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY;const isAbsoluteMod2=t=>r=>is.integer(r)&&Math.abs(r%2)===t;is.evenInteger=isAbsoluteMod2(0);is.oddInteger=isAbsoluteMod2(1);is.emptyArray=t=>is.array(t)&&t.length===0;is.nonEmptyArray=t=>is.array(t)&&t.length>0;is.emptyString=t=>is.string(t)&&t.length===0;const isWhiteSpaceString=t=>is.string(t)&&!/\S/.test(t);is.emptyStringOrWhitespace=t=>is.emptyString(t)||isWhiteSpaceString(t);is.nonEmptyString=t=>is.string(t)&&t.length>0;is.nonEmptyStringAndNotWhitespace=t=>is.string(t)&&!is.emptyStringOrWhitespace(t);is.emptyObject=t=>is.object(t)&&!is.map(t)&&!is.set(t)&&Object.keys(t).length===0;is.nonEmptyObject=t=>is.object(t)&&!is.map(t)&&!is.set(t)&&Object.keys(t).length>0;is.emptySet=t=>is.set(t)&&t.size===0;is.nonEmptySet=t=>is.set(t)&&t.size>0;is.emptyMap=t=>is.map(t)&&t.size===0;is.nonEmptyMap=t=>is.map(t)&&t.size>0;is.propertyKey=t=>is.any([is.string,is.number,is.symbol],t);is.formData=t=>isObjectOfType("FormData")(t);is.urlSearchParams=t=>isObjectOfType("URLSearchParams")(t);const predicateOnArray=(t,r,i)=>{if(!is.function_(r)){throw new TypeError(`Invalid predicate: ${JSON.stringify(r)}`)}if(i.length===0){throw new TypeError("Invalid number of values")}return t.call(i,r)};is.any=(t,...r)=>{const i=is.array(t)?t:[t];return i.some((t=>predicateOnArray(Array.prototype.some,t,r)))};is.all=(t,...r)=>predicateOnArray(Array.prototype.every,t,r);const assertType=(t,r,i,o={})=>{if(!t){const{multipleValues:t}=o;const a=t?`received values of types ${[...new Set(i.map((t=>`\`${is(t)}\``)))].join(", ")}`:`received value of type \`${is(i)}\``;throw new TypeError(`Expected value which is \`${r}\`, ${a}.`)}};const Ye={undefined:t=>assertType(is.undefined(t),"undefined",t),string:t=>assertType(is.string(t),"string",t),number:t=>assertType(is.number(t),"number",t),bigint:t=>assertType(is.bigint(t),"bigint",t),function_:t=>assertType(is.function_(t),"Function",t),null_:t=>assertType(is.null_(t),"null",t),class_:t=>assertType(is.class_(t),"Class",t),boolean:t=>assertType(is.boolean(t),"boolean",t),symbol:t=>assertType(is.symbol(t),"symbol",t),numericString:t=>assertType(is.numericString(t),"string with a number",t),array:(t,r)=>{const i=assertType;i(is.array(t),"Array",t);if(r){t.forEach(r)}},buffer:t=>assertType(is.buffer(t),"Buffer",t),blob:t=>assertType(is.blob(t),"Blob",t),nullOrUndefined:t=>assertType(is.nullOrUndefined(t),"null or undefined",t),object:t=>assertType(is.object(t),"Object",t),iterable:t=>assertType(is.iterable(t),"Iterable",t),asyncIterable:t=>assertType(is.asyncIterable(t),"AsyncIterable",t),generator:t=>assertType(is.generator(t),"Generator",t),asyncGenerator:t=>assertType(is.asyncGenerator(t),"AsyncGenerator",t),nativePromise:t=>assertType(is.nativePromise(t),"native Promise",t),promise:t=>assertType(is.promise(t),"Promise",t),generatorFunction:t=>assertType(is.generatorFunction(t),"GeneratorFunction",t),asyncGeneratorFunction:t=>assertType(is.asyncGeneratorFunction(t),"AsyncGeneratorFunction",t),asyncFunction:t=>assertType(is.asyncFunction(t),"AsyncFunction",t),boundFunction:t=>assertType(is.boundFunction(t),"Function",t),regExp:t=>assertType(is.regExp(t),"RegExp",t),date:t=>assertType(is.date(t),"Date",t),error:t=>assertType(is.error(t),"Error",t),map:t=>assertType(is.map(t),"Map",t),set:t=>assertType(is.set(t),"Set",t),weakMap:t=>assertType(is.weakMap(t),"WeakMap",t),weakSet:t=>assertType(is.weakSet(t),"WeakSet",t),weakRef:t=>assertType(is.weakRef(t),"WeakRef",t),int8Array:t=>assertType(is.int8Array(t),"Int8Array",t),uint8Array:t=>assertType(is.uint8Array(t),"Uint8Array",t),uint8ClampedArray:t=>assertType(is.uint8ClampedArray(t),"Uint8ClampedArray",t),int16Array:t=>assertType(is.int16Array(t),"Int16Array",t),uint16Array:t=>assertType(is.uint16Array(t),"Uint16Array",t),int32Array:t=>assertType(is.int32Array(t),"Int32Array",t),uint32Array:t=>assertType(is.uint32Array(t),"Uint32Array",t),float32Array:t=>assertType(is.float32Array(t),"Float32Array",t),float64Array:t=>assertType(is.float64Array(t),"Float64Array",t),bigInt64Array:t=>assertType(is.bigInt64Array(t),"BigInt64Array",t),bigUint64Array:t=>assertType(is.bigUint64Array(t),"BigUint64Array",t),arrayBuffer:t=>assertType(is.arrayBuffer(t),"ArrayBuffer",t),sharedArrayBuffer:t=>assertType(is.sharedArrayBuffer(t),"SharedArrayBuffer",t),dataView:t=>assertType(is.dataView(t),"DataView",t),enumCase:(t,r)=>assertType(is.enumCase(t,r),"EnumCase",t),urlInstance:t=>assertType(is.urlInstance(t),"URL",t),urlString:t=>assertType(is.urlString(t),"string with a URL",t),truthy:t=>assertType(is.truthy(t),"truthy",t),falsy:t=>assertType(is.falsy(t),"falsy",t),nan:t=>assertType(is.nan(t),"NaN",t),primitive:t=>assertType(is.primitive(t),"primitive",t),integer:t=>assertType(is.integer(t),"integer",t),safeInteger:t=>assertType(is.safeInteger(t),"integer",t),plainObject:t=>assertType(is.plainObject(t),"plain object",t),typedArray:t=>assertType(is.typedArray(t),"TypedArray",t),arrayLike:t=>assertType(is.arrayLike(t),"array-like",t),domElement:t=>assertType(is.domElement(t),"HTMLElement",t),observable:t=>assertType(is.observable(t),"Observable",t),nodeStream:t=>assertType(is.nodeStream(t),"Node.js Stream",t),infinite:t=>assertType(is.infinite(t),"infinite number",t),emptyArray:t=>assertType(is.emptyArray(t),"empty array",t),nonEmptyArray:t=>assertType(is.nonEmptyArray(t),"non-empty array",t),emptyString:t=>assertType(is.emptyString(t),"empty string",t),emptyStringOrWhitespace:t=>assertType(is.emptyStringOrWhitespace(t),"empty string or whitespace",t),nonEmptyString:t=>assertType(is.nonEmptyString(t),"non-empty string",t),nonEmptyStringAndNotWhitespace:t=>assertType(is.nonEmptyStringAndNotWhitespace(t),"non-empty string and not whitespace",t),emptyObject:t=>assertType(is.emptyObject(t),"empty object",t),nonEmptyObject:t=>assertType(is.nonEmptyObject(t),"non-empty object",t),emptySet:t=>assertType(is.emptySet(t),"empty set",t),nonEmptySet:t=>assertType(is.nonEmptySet(t),"non-empty set",t),emptyMap:t=>assertType(is.emptyMap(t),"empty map",t),nonEmptyMap:t=>assertType(is.nonEmptyMap(t),"non-empty map",t),propertyKey:t=>assertType(is.propertyKey(t),"PropertyKey",t),formData:t=>assertType(is.formData(t),"FormData",t),urlSearchParams:t=>assertType(is.urlSearchParams(t),"URLSearchParams",t),evenInteger:t=>assertType(is.evenInteger(t),"even integer",t),oddInteger:t=>assertType(is.oddInteger(t),"odd integer",t),directInstanceOf:(t,r)=>assertType(is.directInstanceOf(t,r),"T",t),inRange:(t,r)=>assertType(is.inRange(t,r),"in range",t),any:(t,...r)=>assertType(is.any(t,...r),"predicate returns truthy for any value",r,{multipleValues:true}),all:(t,...r)=>assertType(is.all(t,...r),"predicate returns truthy for all values",r,{multipleValues:true})};Object.defineProperties(is,{class:{value:is.class_},function:{value:is.function_},null:{value:is.null_}});Object.defineProperties(Ye,{class:{value:Ye.class_},function:{value:Ye.function_},null:{value:Ye.null_}});const Ze=is;class CancelError extends Error{constructor(t){super(t||"Promise was canceled");this.name="CancelError"}get isCanceled(){return true}}class PCancelable{static fn(t){return(...r)=>new PCancelable(((i,o,a)=>{r.push(a);t(...r).then(i,o)}))}constructor(t){this._cancelHandlers=[];this._isPending=true;this._isCanceled=false;this._rejectOnCancel=true;this._promise=new Promise(((r,i)=>{this._reject=i;const onResolve=t=>{if(!this._isCanceled||!onCancel.shouldReject){this._isPending=false;r(t)}};const onReject=t=>{this._isPending=false;i(t)};const onCancel=t=>{if(!this._isPending){throw new Error("The `onCancel` handler was attached after the promise settled.")}this._cancelHandlers.push(t)};Object.defineProperties(onCancel,{shouldReject:{get:()=>this._rejectOnCancel,set:t=>{this._rejectOnCancel=t}}});t(onResolve,onReject,onCancel)}))}then(t,r){return this._promise.then(t,r)}catch(t){return this._promise.catch(t)}finally(t){return this._promise.finally(t)}cancel(t){if(!this._isPending||this._isCanceled){return}this._isCanceled=true;if(this._cancelHandlers.length>0){try{for(const t of this._cancelHandlers){t()}}catch(t){this._reject(t);return}}if(this._rejectOnCancel){this._reject(new CancelError(t))}}get isCanceled(){return this._isCanceled}}Object.setPrototypeOf(PCancelable.prototype,Promise.prototype);function isRequest(t){return Ze.object(t)&&"_onResponse"in t}class RequestError extends Error{constructor(t,r,i){super(t);Object.defineProperty(this,"input",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"stack",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"response",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"request",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"timings",{enumerable:true,configurable:true,writable:true,value:void 0});Error.captureStackTrace(this,this.constructor);this.name="RequestError";this.code=r.code??"ERR_GOT_REQUEST_ERROR";this.input=r.input;if(isRequest(i)){Object.defineProperty(this,"request",{enumerable:false,value:i});Object.defineProperty(this,"response",{enumerable:false,value:i.response});this.options=i.options}else{this.options=i}this.timings=this.request?.timings;if(Ze.string(r.stack)&&Ze.string(this.stack)){const t=this.stack.indexOf(this.message)+this.message.length;const i=this.stack.slice(t).split("\n").reverse();const o=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split("\n").reverse();while(o.length>0&&o[0]===i[0]){i.shift()}this.stack=`${this.stack.slice(0,t)}${i.reverse().join("\n")}${o.reverse().join("\n")}`}}}class MaxRedirectsError extends RequestError{constructor(t){super(`Redirected ${t.options.maxRedirects} times. Aborting.`,{},t);this.name="MaxRedirectsError";this.code="ERR_TOO_MANY_REDIRECTS"}}class HTTPError extends RequestError{constructor(t){super(`Response code ${t.statusCode} (${t.statusMessage})`,{},t.request);this.name="HTTPError";this.code="ERR_NON_2XX_3XX_RESPONSE"}}class CacheError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="CacheError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}}class UploadError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="UploadError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}}class TimeoutError extends RequestError{constructor(t,r,i){super(t.message,t,i);Object.defineProperty(this,"timings",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"event",{enumerable:true,configurable:true,writable:true,value:void 0});this.name="TimeoutError";this.event=t.event;this.timings=r}}class ReadError extends RequestError{constructor(t,r){super(t.message,t,r);this.name="ReadError";this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}}class RetryError extends RequestError{constructor(t){super("Retrying",{},t);this.name="RetryError";this.code="ERR_RETRYING"}}class errors_AbortError extends RequestError{constructor(t){super("This operation was aborted.",{},t);this.code="ERR_ABORTED";this.name="AbortError"}}const Ke=require("node:buffer");const Qe=require("node:http");var Xe=i(2361);var Je=i(3837);var et=i(8985);const timer=t=>{if(t.timings){return t.timings}const r={start:Date.now(),socket:undefined,lookup:undefined,connect:undefined,secureConnect:undefined,upload:undefined,response:undefined,end:undefined,error:undefined,abort:undefined,phases:{wait:undefined,dns:undefined,tcp:undefined,tls:undefined,request:undefined,firstByte:undefined,download:undefined,total:undefined}};t.timings=r;const handleError=t=>{t.once(Xe.errorMonitor,(()=>{r.error=Date.now();r.phases.total=r.error-r.start}))};handleError(t);const onAbort=()=>{r.abort=Date.now();r.phases.total=r.abort-r.start};t.prependOnceListener("abort",onAbort);const onSocket=t=>{r.socket=Date.now();r.phases.wait=r.socket-r.start;if(Je.types.isProxy(t)){return}const lookupListener=()=>{r.lookup=Date.now();r.phases.dns=r.lookup-r.socket};t.prependOnceListener("lookup",lookupListener);et(t,{connect:()=>{r.connect=Date.now();if(r.lookup===undefined){t.removeListener("lookup",lookupListener);r.lookup=r.connect;r.phases.dns=r.lookup-r.socket}r.phases.tcp=r.connect-r.lookup},secureConnect:()=>{r.secureConnect=Date.now();r.phases.tls=r.secureConnect-r.connect}})};if(t.socket){onSocket(t.socket)}else{t.prependOnceListener("socket",onSocket)}const onUpload=()=>{r.upload=Date.now();r.phases.request=r.upload-(r.secureConnect??r.connect)};if(t.writableFinished){onUpload()}else{t.prependOnceListener("finish",onUpload)}t.prependOnceListener("response",(i=>{r.response=Date.now();r.phases.firstByte=r.response-r.upload;i.timings=r;handleError(i);i.prependOnceListener("end",(()=>{t.off("abort",onAbort);i.off("aborted",onAbort);if(r.phases.total){return}r.end=Date.now();r.phases.download=r.end-r.response;r.phases.total=r.end-r.start}));i.prependOnceListener("aborted",onAbort)}));return r};const tt=timer;const rt=require("node:crypto");const it="text/plain";const st="us-ascii";const testParameter=(t,r)=>r.some((r=>r instanceof RegExp?r.test(t):r===t));const normalizeDataURL=(t,{stripHash:r})=>{const i=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(t);if(!i){throw new Error(`Invalid URL: ${t}`)}let{type:o,data:a,hash:l}=i.groups;const c=o.split(";");l=r?"":l;let u=false;if(c[c.length-1]==="base64"){c.pop();u=true}const h=(c.shift()||"").toLowerCase();const d=c.map((t=>{let[r,i=""]=t.split("=").map((t=>t.trim()));if(r==="charset"){i=i.toLowerCase();if(i===st){return""}}return`${r}${i?`=${i}`:""}`})).filter(Boolean);const p=[...d];if(u){p.push("base64")}if(p.length>0||h&&h!==it){p.unshift(h)}return`data:${p.join(";")},${u?a.trim():a}${l?`#${l}`:""}`};function normalizeUrl(t,r){r={defaultProtocol:"http:",normalizeProtocol:true,forceHttp:false,forceHttps:false,stripAuthentication:true,stripHash:false,stripTextFragment:true,stripWWW:true,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:true,removeSingleSlash:true,removeDirectoryIndex:false,sortQueryParameters:true,...r};t=t.trim();if(/^data:/i.test(t)){return normalizeDataURL(t,r)}if(/^view-source:/i.test(t)){throw new Error("`view-source:` is not supported as it is a non-standard protocol")}const i=t.startsWith("//");const o=!i&&/^\.*\//.test(t);if(!o){t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,r.defaultProtocol)}const a=new URL(t);if(r.forceHttp&&r.forceHttps){throw new Error("The `forceHttp` and `forceHttps` options cannot be used together")}if(r.forceHttp&&a.protocol==="https:"){a.protocol="http:"}if(r.forceHttps&&a.protocol==="http:"){a.protocol="https:"}if(r.stripAuthentication){a.username="";a.password=""}if(r.stripHash){a.hash=""}else if(r.stripTextFragment){a.hash=a.hash.replace(/#?:~:text.*?$/i,"")}if(a.pathname){const t=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g;let r=0;let i="";for(;;){const o=t.exec(a.pathname);if(!o){break}const l=o[0];const c=o.index;const u=a.pathname.slice(r,c);i+=u.replace(/\/{2,}/g,"/");i+=l;r=c+l.length}const o=a.pathname.slice(r,a.pathname.length);i+=o.replace(/\/{2,}/g,"/");a.pathname=i}if(a.pathname){try{a.pathname=decodeURI(a.pathname)}catch{}}if(r.removeDirectoryIndex===true){r.removeDirectoryIndex=[/^index\.[a-z]+$/]}if(Array.isArray(r.removeDirectoryIndex)&&r.removeDirectoryIndex.length>0){let t=a.pathname.split("/");const i=t[t.length-1];if(testParameter(i,r.removeDirectoryIndex)){t=t.slice(0,-1);a.pathname=t.slice(1).join("/")+"/"}}if(a.hostname){a.hostname=a.hostname.replace(/\.$/,"");if(r.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(a.hostname)){a.hostname=a.hostname.replace(/^www\./,"")}}if(Array.isArray(r.removeQueryParameters)){for(const t of[...a.searchParams.keys()]){if(testParameter(t,r.removeQueryParameters)){a.searchParams.delete(t)}}}if(!Array.isArray(r.keepQueryParameters)&&r.removeQueryParameters===true){a.search=""}if(Array.isArray(r.keepQueryParameters)&&r.keepQueryParameters.length>0){for(const t of[...a.searchParams.keys()]){if(!testParameter(t,r.keepQueryParameters)){a.searchParams.delete(t)}}}if(r.sortQueryParameters){a.searchParams.sort();try{a.search=decodeURIComponent(a.search)}catch{}}if(r.removeTrailingSlash){a.pathname=a.pathname.replace(/\/$/,"")}const l=t;t=a.toString();if(!r.removeSingleSlash&&a.pathname==="/"&&!l.endsWith("/")&&a.hash===""){t=t.replace(/\/$/,"")}if((r.removeTrailingSlash||a.pathname==="/")&&a.hash===""&&r.removeSingleSlash){t=t.replace(/\/$/,"")}if(i&&!r.normalizeProtocol){t=t.replace(/^http:\/\//,"//")}if(r.stripProtocol){t=t.replace(/^(?:https?:)?\/\//,"")}return t}var nt=i(367);var ot=i(1454);function lowercaseKeys(t){return Object.fromEntries(Object.entries(t).map((([t,r])=>[t.toLowerCase(),r])))}class Response extends Ee.Readable{statusCode;headers;body;url;constructor({statusCode:t,headers:r,body:i,url:o}){if(typeof t!=="number"){throw new TypeError("Argument `statusCode` should be a number")}if(typeof r!=="object"){throw new TypeError("Argument `headers` should be an object")}if(!(i instanceof Uint8Array)){throw new TypeError("Argument `body` should be a buffer")}if(typeof o!=="string"){throw new TypeError("Argument `url` should be a string")}super({read(){this.push(i);this.push(null)}});this.statusCode=t;this.headers=lowercaseKeys(r);this.body=i;this.url=o}}var at=i(1187);const ct=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];function mimicResponse(t,r){if(r._readableState.autoDestroy){throw new Error("The second stream must have the `autoDestroy` option set to `false`")}const i=new Set([...Object.keys(t),...ct]);const o={};for(const a of i){if(a in r){continue}o[a]={get(){const r=t[a];const i=typeof r==="function";return i?r.bind(t):r},set(r){t[a]=r},enumerable:true,configurable:false}}Object.defineProperties(r,o);t.once("aborted",(()=>{r.destroy();r.emit("aborted")}));t.once("close",(()=>{if(t.complete){if(r.readable){r.once("end",(()=>{r.emit("close")}))}else{r.emit("close")}}else{r.emit("close")}}));return r}class types_RequestError extends Error{constructor(t){super(t.message);Object.assign(this,t)}}class types_CacheError extends Error{constructor(t){super(t.message);Object.assign(this,t)}}class CacheableRequest{constructor(t,r){this.hooks=new Map;this.request=()=>(t,r)=>{let i;if(typeof t==="string"){i=normalizeUrlObject(we.parse(t));t={}}else if(t instanceof we.URL){i=normalizeUrlObject(we.parse(t.toString()));t={}}else{const[r,...o]=(t.path??"").split("?");const a=o.length>0?`?${o.join("?")}`:"";i=normalizeUrlObject({...t,pathname:r,search:a})}t={headers:{},method:"GET",cache:true,strictTtl:false,automaticFailover:false,...t,...urlObjectToRequestOptions(i)};t.headers=Object.fromEntries(ut(t.headers).map((([t,r])=>[t.toLowerCase(),r])));const o=new le;const a=normalizeUrl(we.format(i),{stripWWW:false,removeTrailingSlash:false,stripAuthentication:false});let l=`${t.method}:${a}`;if(t.body&&t.method!==undefined&&["POST","PATCH","PUT"].includes(t.method)){if(t.body instanceof Ee.Readable){t.cache=false}else{l+=`:${rt.createHash("md5").update(t.body).digest("hex")}`}}let c=false;let u=false;const makeRequest=t=>{u=true;let i=false;let requestErrorCallback=()=>{};const a=new Promise((t=>{requestErrorCallback=()=>{if(!i){i=true;t()}}}));const handler=async i=>{if(c){i.status=i.statusCode;const r=ot.fromObject(c.cachePolicy).revalidatedPolicy(t,i);if(!r.modified){i.resume();await new Promise((t=>{i.once("end",t)}));const t=convertHeaders(r.policy.responseHeaders());i=new Response({statusCode:c.statusCode,headers:t,body:c.body,url:c.url});i.cachePolicy=r.policy;i.fromCache=true}}if(!i.fromCache){i.cachePolicy=new ot(t,i,t);i.fromCache=false}let u;if(t.cache&&i.cachePolicy.storable()){u=cloneResponse(i);(async()=>{try{const r=nt.buffer(i);await Promise.race([a,new Promise((t=>i.once("end",t)))]);const o=await r;let u={url:i.url,statusCode:i.fromCache?c.statusCode:i.statusCode,body:o,cachePolicy:i.cachePolicy.toObject()};let h=t.strictTtl?i.cachePolicy.timeToLive():undefined;if(t.maxTtl){h=h?Math.min(h,t.maxTtl):t.maxTtl}if(this.hooks.size>0){for(const t of this.hooks.keys()){u=await this.runHook(t,u,i)}}await this.cache.set(l,u,h)}catch(t){o.emit("error",new types_CacheError(t))}})()}else if(t.cache&&c){(async()=>{try{await this.cache.delete(l)}catch(t){o.emit("error",new types_CacheError(t))}})()}o.emit("response",u??i);if(typeof r==="function"){r(u??i)}};try{const r=this.cacheRequest(t,handler);r.once("error",requestErrorCallback);r.once("abort",requestErrorCallback);o.emit("request",r)}catch(t){o.emit("error",new types_RequestError(t))}};(async()=>{const get=async t=>{await Promise.resolve();const i=t.cache?await this.cache.get(l):undefined;if(typeof i==="undefined"&&!t.forceRefresh){makeRequest(t);return}const a=ot.fromObject(i.cachePolicy);if(a.satisfiesWithoutRevalidation(t)&&!t.forceRefresh){const t=convertHeaders(a.responseHeaders());const l=new Response({statusCode:i.statusCode,headers:t,body:i.body,url:i.url});l.cachePolicy=a;l.fromCache=true;o.emit("response",l);if(typeof r==="function"){r(l)}}else if(a.satisfiesWithoutRevalidation(t)&&Date.now()>=a.timeToLive()&&t.forceRefresh){await this.cache.delete(l);t.headers=a.revalidationHeaders(t);makeRequest(t)}else{c=i;t.headers=a.revalidationHeaders(t);makeRequest(t)}};const errorHandler=t=>o.emit("error",new types_CacheError(t));if(this.cache instanceof at){const t=this.cache;t.once("error",errorHandler);o.on("error",(()=>t.removeListener("error",errorHandler)))}try{await get(t)}catch(r){if(t.automaticFailover&&!u){makeRequest(t)}o.emit("error",new types_CacheError(r))}})();return o};this.addHook=(t,r)=>{if(!this.hooks.has(t)){this.hooks.set(t,r)}};this.removeHook=t=>this.hooks.delete(t);this.getHook=t=>this.hooks.get(t);this.runHook=async(t,...r)=>this.hooks.get(t)?.(...r);if(r instanceof at){this.cache=r}else if(typeof r==="string"){this.cache=new at({uri:r,namespace:"cacheable-request"})}else{this.cache=new at({store:r,namespace:"cacheable-request"})}this.request=this.request.bind(this);this.cacheRequest=t}}const ut=Object.entries;const cloneResponse=t=>{const r=new Ee.PassThrough({autoDestroy:false});mimicResponse(t,r);return t.pipe(r)};const urlObjectToRequestOptions=t=>{const r={...t};r.path=`${t.pathname||"/"}${t.search||""}`;delete r.pathname;delete r.search;return r};const normalizeUrlObject=t=>({protocol:t.protocol,auth:t.auth,hostname:t.hostname||t.host||"localhost",port:t.port,pathname:t.pathname,search:t.search});const convertHeaders=t=>{const r=[];for(const i of Object.keys(t)){r[i.toLowerCase()]=t[i]}return r};const ht=CacheableRequest;const ft="onResponse";var dt=i(2269);const isFunction=t=>typeof t==="function";const isFormData=t=>Boolean(t&&isFunction(t.constructor)&&t[Symbol.toStringTag]==="FormData"&&isFunction(t.append)&&isFunction(t.getAll)&&isFunction(t.entries)&&isFunction(t[Symbol.iterator]));const pt="abcdefghijklmnopqrstuvwxyz0123456789";function createBoundary(){let t=16;let r="";while(t--){r+=pt[Math.random()*pt.length<<0]}return r}const normalizeValue=t=>String(t).replace(/\r|\n/g,((t,r,i)=>{if(t==="\r"&&i[r+1]!=="\n"||t==="\n"&&i[r-1]!=="\r"){return"\r\n"}return t}));const getType=t=>Object.prototype.toString.call(t).slice(8,-1).toLowerCase();function isPlainObject(t){if(getType(t)!=="object"){return false}const r=Object.getPrototypeOf(t);if(r===null||r===undefined){return true}const i=r.constructor&&r.constructor.toString();return i===Object.toString()}function getProperty(t,r){if(typeof r!=="string"){return t[r]}for(const[i,o]of Object.entries(t)){if(r.toLowerCase()===i.toLowerCase()){return o}}return undefined}const proxyHeaders=t=>new Proxy(t,{get:(t,r)=>getProperty(t,r),has:(t,r)=>getProperty(t,r)!==undefined});const escapeName=t=>String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22");const isFile=t=>Boolean(t&&typeof t==="object"&&isFunction(t.constructor)&&t[Symbol.toStringTag]==="File"&&isFunction(t.stream)&&t.name!=null);const mt=null&&isFile;var yt=undefined&&undefined.__classPrivateFieldSet||function(t,r,i,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof r==="function"?t!==r||!a:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(t,i):a?a.value=i:r.set(t,i),i};var bt=undefined&&undefined.__classPrivateFieldGet||function(t,r,i,o){if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof r==="function"?t!==r||!o:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?o:i==="a"?o.call(t):o?o.value:r.get(t)};var vt,_t,wt,Et,St,Ot,Rt,xt,kt,Tt,At;const Ct={enableAdditionalHeaders:false};const Pt={writable:false,configurable:false};class FormDataEncoder{constructor(t,r,i){vt.add(this);_t.set(this,"\r\n");wt.set(this,void 0);Et.set(this,void 0);St.set(this,"-".repeat(2));Ot.set(this,new TextEncoder);Rt.set(this,void 0);xt.set(this,void 0);kt.set(this,void 0);if(!isFormData(t)){throw new TypeError("Expected first argument to be a FormData instance.")}let o;if(isPlainObject(r)){i=r}else{o=r}if(!o){o=createBoundary()}if(typeof o!=="string"){throw new TypeError("Expected boundary argument to be a string.")}if(i&&!isPlainObject(i)){throw new TypeError("Expected options argument to be an object.")}yt(this,xt,Array.from(t.entries()),"f");yt(this,kt,{...Ct,...i},"f");yt(this,wt,bt(this,Ot,"f").encode(bt(this,_t,"f")),"f");yt(this,Et,bt(this,wt,"f").byteLength,"f");this.boundary=`form-data-boundary-${o}`;this.contentType=`multipart/form-data; boundary=${this.boundary}`;yt(this,Rt,bt(this,Ot,"f").encode(`${bt(this,St,"f")}${this.boundary}${bt(this,St,"f")}${bt(this,_t,"f").repeat(2)}`),"f");const a={"Content-Type":this.contentType};const l=bt(this,vt,"m",At).call(this);if(l){this.contentLength=l;a["Content-Length"]=l}this.headers=proxyHeaders(Object.freeze(a));Object.defineProperties(this,{boundary:Pt,contentType:Pt,contentLength:Pt,headers:Pt})}getContentLength(){return this.contentLength==null?undefined:Number(this.contentLength)}*values(){for(const[t,r]of bt(this,xt,"f")){const i=isFile(r)?r:bt(this,Ot,"f").encode(normalizeValue(r));yield bt(this,vt,"m",Tt).call(this,t,i);yield i;yield bt(this,wt,"f")}yield bt(this,Rt,"f")}async*encode(){for(const t of this.values()){if(isFile(t)){yield*t.stream()}else{yield t}}}[(_t=new WeakMap,wt=new WeakMap,Et=new WeakMap,St=new WeakMap,Ot=new WeakMap,Rt=new WeakMap,xt=new WeakMap,kt=new WeakMap,vt=new WeakSet,Tt=function _FormDataEncoder_getFieldHeader(t,r){let i="";i+=`${bt(this,St,"f")}${this.boundary}${bt(this,_t,"f")}`;i+=`Content-Disposition: form-data; name="${escapeName(t)}"`;if(isFile(r)){i+=`; filename="${escapeName(r.name)}"${bt(this,_t,"f")}`;i+=`Content-Type: ${r.type||"application/octet-stream"}`}const o=isFile(r)?r.size:r.byteLength;if(bt(this,kt,"f").enableAdditionalHeaders===true&&o!=null&&!isNaN(o)){i+=`${bt(this,_t,"f")}Content-Length: ${isFile(r)?r.size:r.byteLength}`}return bt(this,Ot,"f").encode(`${i}${bt(this,_t,"f").repeat(2)}`)},At=function _FormDataEncoder_getContentLength(){let t=0;for(const[r,i]of bt(this,xt,"f")){const o=isFile(i)?i:bt(this,Ot,"f").encode(normalizeValue(i));const a=isFile(o)?o.size:o.byteLength;if(a==null||isNaN(a)){return undefined}t+=bt(this,vt,"m",Tt).call(this,r,o).byteLength;t+=a;t+=bt(this,Et,"f")}return String(t+bt(this,Rt,"f").byteLength)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}}const It=require("node:util");function is_form_data_isFormData(t){return Ze.nodeStream(t)&&Ze.function_(t.getBoundary)}async function getBodySize(t,r){if(r&&"content-length"in r){return Number(r["content-length"])}if(!t){return 0}if(Ze.string(t)){return Ke.Buffer.byteLength(t)}if(Ze.buffer(t)){return t.length}if(is_form_data_isFormData(t)){return(0,It.promisify)(t.getLength.bind(t))()}return undefined}function proxyEvents(t,r,i){const o={};for(const a of i){const eventFunction=(...t)=>{r.emit(a,...t)};o[a]=eventFunction;t.on(a,eventFunction)}return()=>{for(const[r,i]of Object.entries(o)){t.off(r,i)}}}const Lt=require("node:net");function unhandle(){const t=[];return{once(r,i,o){r.once(i,o);t.push({origin:r,event:i,fn:o})},unhandleAll(){for(const r of t){const{origin:t,event:i,fn:o}=r;t.removeListener(i,o)}t.length=0}}}const Mt=Symbol("reentry");const noop=()=>{};class timed_out_TimeoutError extends Error{constructor(t,r){super(`Timeout awaiting '${r}' for ${t}ms`);Object.defineProperty(this,"event",{enumerable:true,configurable:true,writable:true,value:r});Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0});this.name="TimeoutError";this.code="ETIMEDOUT"}}function timedOut(t,r,i){if(Mt in t){return noop}t[Mt]=true;const o=[];const{once:a,unhandleAll:l}=unhandle();const addTimeout=(t,r,i)=>{const a=setTimeout(r,t,t,i);a.unref?.();const cancel=()=>{clearTimeout(a)};o.push(cancel);return cancel};const{host:c,hostname:u}=i;const timeoutHandler=(r,i)=>{t.destroy(new timed_out_TimeoutError(r,i))};const cancelTimeouts=()=>{for(const t of o){t()}l()};t.once("error",(r=>{cancelTimeouts();if(t.listenerCount("error")===0){throw r}}));if(typeof r.request!=="undefined"){const i=addTimeout(r.request,timeoutHandler,"request");a(t,"response",(t=>{a(t,"end",i)}))}if(typeof r.socket!=="undefined"){const{socket:i}=r;const socketTimeoutHandler=()=>{timeoutHandler(i,"socket")};t.setTimeout(i,socketTimeoutHandler);o.push((()=>{t.removeListener("timeout",socketTimeoutHandler)}))}const h=typeof r.lookup!=="undefined";const d=typeof r.connect!=="undefined";const p=typeof r.secureConnect!=="undefined";const m=typeof r.send!=="undefined";if(h||d||p||m){a(t,"socket",(o=>{const{socketPath:l}=t;if(o.connecting){const t=Boolean(l??Lt.isIP(u??c??"")!==0);if(h&&!t&&typeof o.address().address==="undefined"){const t=addTimeout(r.lookup,timeoutHandler,"lookup");a(o,"lookup",t)}if(d){const timeConnect=()=>addTimeout(r.connect,timeoutHandler,"connect");if(t){a(o,"connect",timeConnect())}else{a(o,"lookup",(t=>{if(t===null){a(o,"connect",timeConnect())}}))}}if(p&&i.protocol==="https:"){a(o,"connect",(()=>{const t=addTimeout(r.secureConnect,timeoutHandler,"secureConnect");a(o,"secureConnect",t)}))}}if(m){const timeRequest=()=>addTimeout(r.send,timeoutHandler,"send");if(o.connecting){a(o,"connect",(()=>{a(t,"upload-complete",timeRequest())}))}else{a(t,"upload-complete",timeRequest())}}}))}if(typeof r.response!=="undefined"){a(t,"upload-complete",(()=>{const i=addTimeout(r.response,timeoutHandler,"response");a(t,"response",i)}))}if(typeof r.read!=="undefined"){a(t,"response",(t=>{const i=addTimeout(r.read,timeoutHandler,"read");a(t,"end",i)}))}return cancelTimeouts}function urlToOptions(t){t=t;const r={protocol:t.protocol,hostname:Ze.string(t.hostname)&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};if(Ze.string(t.port)&&t.port.length>0){r.port=Number(t.port)}if(t.username||t.password){r.auth=`${t.username||""}:${t.password||""}`}return r}class WeakableMap{constructor(){Object.defineProperty(this,"weakMap",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"map",{enumerable:true,configurable:true,writable:true,value:void 0});this.weakMap=new WeakMap;this.map=new Map}set(t,r){if(typeof t==="object"){this.weakMap.set(t,r)}else{this.map.set(t,r)}}get(t){if(typeof t==="object"){return this.weakMap.get(t)}return this.map.get(t)}has(t){if(typeof t==="object"){return this.weakMap.has(t)}return this.map.has(t)}}const calculateRetryDelay=({attemptCount:t,retryOptions:r,error:i,retryAfter:o,computedValue:a})=>{if(i.name==="RetryError"){return 1}if(t>r.limit){return 0}const l=r.methods.includes(i.options.method);const c=r.errorCodes.includes(i.code);const u=i.response&&r.statusCodes.includes(i.response.statusCode);if(!l||!c&&!u){return 0}if(i.response){if(o){if(o>a){return 0}return o}if(i.response.statusCode===413){return 0}}const h=Math.random()*r.noise;return Math.min(2**(t-1)*1e3,r.backoffLimit)+h};const Dt=calculateRetryDelay;const Nt=require("node:tls");const jt=require("node:https");const Ft=require("node:dns");const{Resolver:Bt}=Ft.promises;const $t=Symbol("cacheableLookupCreateConnection");const Ht=Symbol("cacheableLookupInstance");const Ut=Symbol("expires");const qt=typeof Ft.ALL==="number";const verifyAgent=t=>{if(!(t&&typeof t.createConnection==="function")){throw new Error("Expected an Agent instance as the first argument")}};const map4to6=t=>{for(const r of t){if(r.family===6){continue}r.address=`::ffff:${r.address}`;r.family=6}};const getIfaceInfo=()=>{let t=false;let r=false;for(const i of Object.values(y.networkInterfaces())){for(const o of i){if(o.internal){continue}if(o.family==="IPv6"){r=true}else{t=true}if(t&&r){return{has4:t,has6:r}}}}return{has4:t,has6:r}};const isIterable=t=>Symbol.iterator in t;const ignoreNoResultErrors=t=>t.catch((t=>{if(t.code==="ENODATA"||t.code==="ENOTFOUND"||t.code==="ENOENT"){return[]}throw t}));const zt={ttl:true};const Gt={all:true};const Wt={all:true,family:4};const Vt={all:true,family:6};class CacheableLookup{constructor({cache:t=new Map,maxTtl:r=Infinity,fallbackDuration:i=3600,errorTtl:o=.15,resolver:a=new Bt,lookup:l=Ft.lookup}={}){this.maxTtl=r;this.errorTtl=o;this._cache=t;this._resolver=a;this._dnsLookup=l&&(0,It.promisify)(l);this.stats={cache:0,query:0};if(this._resolver instanceof Bt){this._resolve4=this._resolver.resolve4.bind(this._resolver);this._resolve6=this._resolver.resolve6.bind(this._resolver)}else{this._resolve4=(0,It.promisify)(this._resolver.resolve4.bind(this._resolver));this._resolve6=(0,It.promisify)(this._resolver.resolve6.bind(this._resolver))}this._iface=getIfaceInfo();this._pending={};this._nextRemovalTime=false;this._hostnamesToFallback=new Set;this.fallbackDuration=i;if(i>0){const t=setInterval((()=>{this._hostnamesToFallback.clear()}),i*1e3);if(t.unref){t.unref()}this._fallbackInterval=t}this.lookup=this.lookup.bind(this);this.lookupAsync=this.lookupAsync.bind(this)}set servers(t){this.clear();this._resolver.setServers(t)}get servers(){return this._resolver.getServers()}lookup(t,r,i){if(typeof r==="function"){i=r;r={}}else if(typeof r==="number"){r={family:r}}if(!i){throw new Error("Callback must be a function.")}this.lookupAsync(t,r).then((t=>{if(r.all){i(null,t)}else{i(null,t.address,t.family,t.expires,t.ttl,t.source)}}),i)}async lookupAsync(t,r={}){if(typeof r==="number"){r={family:r}}let i=await this.query(t);if(r.family===6){const t=i.filter((t=>t.family===6));if(r.hints&Ft.V4MAPPED){if(qt&&r.hints&Ft.ALL||t.length===0){map4to6(i)}else{i=t}}else{i=t}}else if(r.family===4){i=i.filter((t=>t.family===4))}if(r.hints&Ft.ADDRCONFIG){const{_iface:t}=this;i=i.filter((r=>r.family===6?t.has6:t.has4))}if(i.length===0){const r=new Error(`cacheableLookup ENOTFOUND ${t}`);r.code="ENOTFOUND";r.hostname=t;throw r}if(r.all){return i}return i[0]}async query(t){let r="cache";let i=await this._cache.get(t);if(i){this.stats.cache++}if(!i){const o=this._pending[t];if(o){this.stats.cache++;i=await o}else{r="query";const o=this.queryAndCache(t);this._pending[t]=o;this.stats.query++;try{i=await o}finally{delete this._pending[t]}}}i=i.map((t=>({...t,source:r})));return i}async _resolve(t){const[r,i]=await Promise.all([ignoreNoResultErrors(this._resolve4(t,zt)),ignoreNoResultErrors(this._resolve6(t,zt))]);let o=0;let a=0;let l=0;const c=Date.now();for(const t of r){t.family=4;t.expires=c+t.ttl*1e3;o=Math.max(o,t.ttl)}for(const t of i){t.family=6;t.expires=c+t.ttl*1e3;a=Math.max(a,t.ttl)}if(r.length>0){if(i.length>0){l=Math.min(o,a)}else{l=o}}else{l=a}return{entries:[...r,...i],cacheTtl:l}}async _lookup(t){try{const[r,i]=await Promise.all([ignoreNoResultErrors(this._dnsLookup(t,Wt)),ignoreNoResultErrors(this._dnsLookup(t,Vt))]);return{entries:[...r,...i],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(t,r,i){if(this.maxTtl>0&&i>0){i=Math.min(i,this.maxTtl)*1e3;r[Ut]=Date.now()+i;try{await this._cache.set(t,r,i)}catch(t){this.lookupAsync=async()=>{const r=new Error("Cache Error. Please recreate the CacheableLookup instance.");r.cause=t;throw r}}if(isIterable(this._cache)){this._tick(i)}}}async queryAndCache(t){if(this._hostnamesToFallback.has(t)){return this._dnsLookup(t,Gt)}let r=await this._resolve(t);if(r.entries.length===0&&this._dnsLookup){r=await this._lookup(t);if(r.entries.length!==0&&this.fallbackDuration>0){this._hostnamesToFallback.add(t)}}const i=r.entries.length===0?this.errorTtl:r.cacheTtl;await this._set(t,r.entries,i);return r.entries}_tick(t){const r=this._nextRemovalTime;if(!r||t<r){clearTimeout(this._removalTimeout);this._nextRemovalTime=t;this._removalTimeout=setTimeout((()=>{this._nextRemovalTime=false;let t=Infinity;const r=Date.now();for(const[i,o]of this._cache){const a=o[Ut];if(r>=a){this._cache.delete(i)}else if(a<t){t=a}}if(t!==Infinity){this._tick(t-r)}}),t);if(this._removalTimeout.unref){this._removalTimeout.unref()}}}install(t){verifyAgent(t);if($t in t){throw new Error("CacheableLookup has been already installed")}t[$t]=t.createConnection;t[Ht]=this;t.createConnection=(r,i)=>{if(!("lookup"in r)){r.lookup=this.lookup}return t[$t](r,i)}}uninstall(t){verifyAgent(t);if(t[$t]){if(t[Ht]!==this){throw new Error("The agent is not owned by this CacheableLookup instance")}t.createConnection=t[$t];delete t[$t];delete t[Ht]}}updateInterfaceInfo(){const{_iface:t}=this;this._iface=getIfaceInfo();if(t.has4&&!this._iface.has4||t.has6&&!this._iface.has6){this._cache.clear()}}clear(t){if(t){this._cache.delete(t);return}this._cache.clear()}}var Yt=i(5767);function parseLinkHeader(t){const r=[];const i=t.split(",");for(const o of i){const[i,...a]=o.split(";");const l=i.trim();if(l[0]!=="<"||l[l.length-1]!==">"){throw new Error(`Invalid format of the Link header reference: ${l}`)}const c=l.slice(1,-1);const u={};if(a.length===0){throw new Error(`Unexpected end of Link header parameters: ${a.join(";")}`)}for(const r of a){const i=r.trim();const o=i.indexOf("=");if(o===-1){throw new Error(`Failed to parse Link header: ${t}`)}const a=i.slice(0,o).trim();const l=i.slice(o+1).trim();u[a]=l}r.push({reference:c,parameters:u})}return r}const[Zt,Kt]=m.versions.node.split(".").map(Number);function validateSearchParameters(t){for(const r in t){const i=t[r];Ye.any([Ze.string,Ze.number,Ze.boolean,Ze.null_,Ze.undefined],i)}}const Qt=new Map;let Xt;const getGlobalDnsCache=()=>{if(Xt){return Xt}Xt=new CacheableLookup;return Xt};const Jt={request:undefined,agent:{http:undefined,https:undefined,http2:undefined},h2session:undefined,decompress:true,timeout:{connect:undefined,lookup:undefined,read:undefined,request:undefined,response:undefined,secureConnect:undefined,send:undefined,socket:undefined},prefixUrl:"",body:undefined,form:undefined,json:undefined,cookieJar:undefined,ignoreInvalidCookies:false,searchParams:undefined,dnsLookup:undefined,dnsCache:undefined,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],afterResponse:[]},followRedirect:true,maxRedirects:10,cache:undefined,throwHttpErrors:true,username:"",password:"",http2:false,allowGetBody:false,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:false,dnsLookupIpVersion:undefined,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:undefined,calculateDelay:({computedValue:t})=>t,backoffLimit:Number.POSITIVE_INFINITY,noise:100},localAddress:undefined,method:"GET",createConnection:undefined,cacheOptions:{shared:undefined,cacheHeuristic:undefined,immutableMinTimeToLive:undefined,ignoreCargoCult:undefined},https:{alpnProtocols:undefined,rejectUnauthorized:undefined,checkServerIdentity:undefined,certificateAuthority:undefined,key:undefined,certificate:undefined,passphrase:undefined,pfx:undefined,ciphers:undefined,honorCipherOrder:undefined,minVersion:undefined,maxVersion:undefined,signatureAlgorithms:undefined,tlsSessionLifetime:undefined,dhparam:undefined,ecdhCurve:undefined,certificateRevocationLists:undefined},encoding:undefined,resolveBodyOnly:false,isStream:false,responseType:"text",url:undefined,pagination:{transform(t){if(t.request.options.responseType==="json"){return t.body}return JSON.parse(t.body)},paginate({response:t}){const r=t.headers.link;if(typeof r!=="string"||r.trim()===""){return false}const i=parseLinkHeader(r);const o=i.find((t=>t.parameters.rel==="next"||t.parameters.rel==='"next"'));if(o){return{url:new we.URL(o.reference,t.url)}}return false},filter:()=>true,shouldContinue:()=>true,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:false},setHost:true,maxHeaderSize:undefined,signal:undefined,enableUnixSockets:true};const cloneInternals=t=>{const{hooks:r,retry:i}=t;const o={...t,context:{...t.context},cacheOptions:{...t.cacheOptions},https:{...t.https},agent:{...t.agent},headers:{...t.headers},retry:{...i,errorCodes:[...i.errorCodes],methods:[...i.methods],statusCodes:[...i.statusCodes]},timeout:{...t.timeout},hooks:{init:[...r.init],beforeRequest:[...r.beforeRequest],beforeError:[...r.beforeError],beforeRedirect:[...r.beforeRedirect],beforeRetry:[...r.beforeRetry],afterResponse:[...r.afterResponse]},searchParams:t.searchParams?new we.URLSearchParams(t.searchParams):undefined,pagination:{...t.pagination}};if(o.url!==undefined){o.prefixUrl=""}return o};const cloneRaw=t=>{const{hooks:r,retry:i}=t;const o={...t};if(Ze.object(t.context)){o.context={...t.context}}if(Ze.object(t.cacheOptions)){o.cacheOptions={...t.cacheOptions}}if(Ze.object(t.https)){o.https={...t.https}}if(Ze.object(t.cacheOptions)){o.cacheOptions={...o.cacheOptions}}if(Ze.object(t.agent)){o.agent={...t.agent}}if(Ze.object(t.headers)){o.headers={...t.headers}}if(Ze.object(i)){o.retry={...i};if(Ze.array(i.errorCodes)){o.retry.errorCodes=[...i.errorCodes]}if(Ze.array(i.methods)){o.retry.methods=[...i.methods]}if(Ze.array(i.statusCodes)){o.retry.statusCodes=[...i.statusCodes]}}if(Ze.object(t.timeout)){o.timeout={...t.timeout}}if(Ze.object(r)){o.hooks={...r};if(Ze.array(r.init)){o.hooks.init=[...r.init]}if(Ze.array(r.beforeRequest)){o.hooks.beforeRequest=[...r.beforeRequest]}if(Ze.array(r.beforeError)){o.hooks.beforeError=[...r.beforeError]}if(Ze.array(r.beforeRedirect)){o.hooks.beforeRedirect=[...r.beforeRedirect]}if(Ze.array(r.beforeRetry)){o.hooks.beforeRetry=[...r.beforeRetry]}if(Ze.array(r.afterResponse)){o.hooks.afterResponse=[...r.afterResponse]}}if(Ze.object(t.pagination)){o.pagination={...t.pagination}}return o};const getHttp2TimeoutOption=t=>{const r=[t.timeout.socket,t.timeout.connect,t.timeout.lookup,t.timeout.request,t.timeout.secureConnect].filter((t=>typeof t==="number"));if(r.length>0){return Math.min(...r)}return undefined};const init=(t,r,i)=>{const o=t.hooks?.init;if(o){for(const t of o){t(r,i)}}};class Options{constructor(t,r,i){Object.defineProperty(this,"_unixOptions",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_internals",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_merging",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_init",{enumerable:true,configurable:true,writable:true,value:void 0});Ye.any([Ze.string,Ze.urlInstance,Ze.object,Ze.undefined],t);Ye.any([Ze.object,Ze.undefined],r);Ye.any([Ze.object,Ze.undefined],i);if(t instanceof Options||r instanceof Options){throw new TypeError("The defaults must be passed as the third argument")}this._internals=cloneInternals(i?._internals??i??Jt);this._init=[...i?._init??[]];this._merging=false;this._unixOptions=undefined;try{if(Ze.plainObject(t)){try{this.merge(t);this.merge(r)}finally{this.url=t.url}}else{try{this.merge(r)}finally{if(r?.url!==undefined){if(t===undefined){this.url=r.url}else{throw new TypeError("The `url` option is mutually exclusive with the `input` argument")}}else if(t!==undefined){this.url=t}}}}catch(t){t.options=this;throw t}}merge(t){if(!t){return}if(t instanceof Options){for(const r of t._init){this.merge(r)}return}t=cloneRaw(t);init(this,t,this);init(t,t,this);this._merging=true;if("isStream"in t){this.isStream=t.isStream}try{let r=false;for(const i in t){if(i==="mutableDefaults"||i==="handlers"){continue}if(i==="url"){continue}if(!(i in this)){throw new Error(`Unexpected option: ${i}`)}this[i]=t[i];r=true}if(r){this._init.push(t)}}finally{this._merging=false}}get request(){return this._internals.request}set request(t){Ye.any([Ze.function_,Ze.undefined],t);this._internals.request=t}get agent(){return this._internals.agent}set agent(t){Ye.plainObject(t);for(const r in t){if(!(r in this._internals.agent)){throw new TypeError(`Unexpected agent option: ${r}`)}Ye.any([Ze.object,Ze.undefined],t[r])}if(this._merging){Object.assign(this._internals.agent,t)}else{this._internals.agent={...t}}}get h2session(){return this._internals.h2session}set h2session(t){this._internals.h2session=t}get decompress(){return this._internals.decompress}set decompress(t){Ye.boolean(t);this._internals.decompress=t}get timeout(){return this._internals.timeout}set timeout(t){Ye.plainObject(t);for(const r in t){if(!(r in this._internals.timeout)){throw new Error(`Unexpected timeout option: ${r}`)}Ye.any([Ze.number,Ze.undefined],t[r])}if(this._merging){Object.assign(this._internals.timeout,t)}else{this._internals.timeout={...t}}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(t){Ye.any([Ze.string,Ze.urlInstance],t);if(t===""){this._internals.prefixUrl="";return}t=t.toString();if(!t.endsWith("/")){t+="/"}if(this._internals.prefixUrl&&this._internals.url){const{href:r}=this._internals.url;this._internals.url.href=t+r.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=t}get body(){return this._internals.body}set body(t){Ye.any([Ze.string,Ze.buffer,Ze.nodeStream,Ze.generator,Ze.asyncGenerator,isFormData,Ze.undefined],t);if(Ze.nodeStream(t)){Ye.truthy(t.readable)}if(t!==undefined){Ye.undefined(this._internals.form);Ye.undefined(this._internals.json)}this._internals.body=t}get form(){return this._internals.form}set form(t){Ye.any([Ze.plainObject,Ze.undefined],t);if(t!==undefined){Ye.undefined(this._internals.body);Ye.undefined(this._internals.json)}this._internals.form=t}get json(){return this._internals.json}set json(t){if(t!==undefined){Ye.undefined(this._internals.body);Ye.undefined(this._internals.form)}this._internals.json=t}get url(){return this._internals.url}set url(t){Ye.any([Ze.string,Ze.urlInstance,Ze.undefined],t);if(t===undefined){this._internals.url=undefined;return}if(Ze.string(t)&&t.startsWith("/")){throw new Error("`url` must not start with a slash")}const r=`${this.prefixUrl}${t.toString()}`;const i=new we.URL(r);this._internals.url=i;decodeURI(r);if(i.protocol==="unix:"){i.href=`http://unix${i.pathname}${i.search}`}if(i.protocol!=="http:"&&i.protocol!=="https:"){const t=new Error(`Unsupported protocol: ${i.protocol}`);t.code="ERR_UNSUPPORTED_PROTOCOL";throw t}if(this._internals.username){i.username=this._internals.username;this._internals.username=""}if(this._internals.password){i.password=this._internals.password;this._internals.password=""}if(this._internals.searchParams){i.search=this._internals.searchParams.toString();this._internals.searchParams=undefined}if(i.hostname==="unix"){if(!this._internals.enableUnixSockets){throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled")}const t=/(?<socketPath>.+?):(?<path>.+)/.exec(`${i.pathname}${i.search}`);if(t?.groups){const{socketPath:r,path:i}=t.groups;this._unixOptions={socketPath:r,path:i,host:""}}else{this._unixOptions=undefined}return}this._unixOptions=undefined}get cookieJar(){return this._internals.cookieJar}set cookieJar(t){Ye.any([Ze.object,Ze.undefined],t);if(t===undefined){this._internals.cookieJar=undefined;return}let{setCookie:r,getCookieString:i}=t;Ye.function_(r);Ye.function_(i);if(r.length===4&&i.length===0){r=(0,It.promisify)(r.bind(t));i=(0,It.promisify)(i.bind(t));this._internals.cookieJar={setCookie:r,getCookieString:i}}else{this._internals.cookieJar=t}}get signal(){return this._internals.signal}set signal(t){Ye.object(t);this._internals.signal=t}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(t){Ye.boolean(t);this._internals.ignoreInvalidCookies=t}get searchParams(){if(this._internals.url){return this._internals.url.searchParams}if(this._internals.searchParams===undefined){this._internals.searchParams=new we.URLSearchParams}return this._internals.searchParams}set searchParams(t){Ye.any([Ze.string,Ze.object,Ze.undefined],t);const r=this._internals.url;if(t===undefined){this._internals.searchParams=undefined;if(r){r.search=""}return}const i=this.searchParams;let o;if(Ze.string(t)){o=new we.URLSearchParams(t)}else if(t instanceof we.URLSearchParams){o=t}else{validateSearchParameters(t);o=new we.URLSearchParams;for(const r in t){const a=t[r];if(a===null){o.append(r,"")}else if(a===undefined){i.delete(r)}else{o.append(r,a)}}}if(this._merging){for(const t of o.keys()){i.delete(t)}for(const[t,r]of o){i.append(t,r)}}else if(r){r.search=i.toString()}else{this._internals.searchParams=i}}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(t){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(t){Ye.any([Ze.function_,Ze.undefined],t);this._internals.dnsLookup=t}get dnsCache(){return this._internals.dnsCache}set dnsCache(t){Ye.any([Ze.object,Ze.boolean,Ze.undefined],t);if(t===true){this._internals.dnsCache=getGlobalDnsCache()}else if(t===false){this._internals.dnsCache=undefined}else{this._internals.dnsCache=t}}get context(){return this._internals.context}set context(t){Ye.object(t);if(this._merging){Object.assign(this._internals.context,t)}else{this._internals.context={...t}}}get hooks(){return this._internals.hooks}set hooks(t){Ye.object(t);for(const r in t){if(!(r in this._internals.hooks)){throw new Error(`Unexpected hook event: ${r}`)}const i=r;const o=t[i];Ye.any([Ze.array,Ze.undefined],o);if(o){for(const t of o){Ye.function_(t)}}if(this._merging){if(o){this._internals.hooks[i].push(...o)}}else{if(!o){throw new Error(`Missing hook event: ${r}`)}this._internals.hooks[r]=[...o]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(t){Ye.boolean(t);this._internals.followRedirect=t}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(t){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(t){Ye.number(t);this._internals.maxRedirects=t}get cache(){return this._internals.cache}set cache(t){Ye.any([Ze.object,Ze.string,Ze.boolean,Ze.undefined],t);if(t===true){this._internals.cache=Qt}else if(t===false){this._internals.cache=undefined}else{this._internals.cache=t}}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(t){Ye.boolean(t);this._internals.throwHttpErrors=t}get username(){const t=this._internals.url;const r=t?t.username:this._internals.username;return decodeURIComponent(r)}set username(t){Ye.string(t);const r=this._internals.url;const i=encodeURIComponent(t);if(r){r.username=i}else{this._internals.username=i}}get password(){const t=this._internals.url;const r=t?t.password:this._internals.password;return decodeURIComponent(r)}set password(t){Ye.string(t);const r=this._internals.url;const i=encodeURIComponent(t);if(r){r.password=i}else{this._internals.password=i}}get http2(){return this._internals.http2}set http2(t){Ye.boolean(t);this._internals.http2=t}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(t){Ye.boolean(t);this._internals.allowGetBody=t}get headers(){return this._internals.headers}set headers(t){Ye.plainObject(t);if(this._merging){Object.assign(this._internals.headers,lowercaseKeys(t))}else{this._internals.headers=lowercaseKeys(t)}}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(t){Ye.boolean(t);this._internals.methodRewriting=t}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(t){if(t!==undefined&&t!==4&&t!==6){throw new TypeError(`Invalid DNS lookup IP version: ${t}`)}this._internals.dnsLookupIpVersion=t}get parseJson(){return this._internals.parseJson}set parseJson(t){Ye.function_(t);this._internals.parseJson=t}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(t){Ye.function_(t);this._internals.stringifyJson=t}get retry(){return this._internals.retry}set retry(t){Ye.plainObject(t);Ye.any([Ze.function_,Ze.undefined],t.calculateDelay);Ye.any([Ze.number,Ze.undefined],t.maxRetryAfter);Ye.any([Ze.number,Ze.undefined],t.limit);Ye.any([Ze.array,Ze.undefined],t.methods);Ye.any([Ze.array,Ze.undefined],t.statusCodes);Ye.any([Ze.array,Ze.undefined],t.errorCodes);Ye.any([Ze.number,Ze.undefined],t.noise);if(t.noise&&Math.abs(t.noise)>100){throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${t.noise}`)}for(const r in t){if(!(r in this._internals.retry)){throw new Error(`Unexpected retry option: ${r}`)}}if(this._merging){Object.assign(this._internals.retry,t)}else{this._internals.retry={...t}}const{retry:r}=this._internals;r.methods=[...new Set(r.methods.map((t=>t.toUpperCase())))];r.statusCodes=[...new Set(r.statusCodes)];r.errorCodes=[...new Set(r.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(t){Ye.any([Ze.string,Ze.undefined],t);this._internals.localAddress=t}get method(){return this._internals.method}set method(t){Ye.string(t);this._internals.method=t.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(t){Ye.any([Ze.function_,Ze.undefined],t);this._internals.createConnection=t}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(t){Ye.plainObject(t);Ye.any([Ze.boolean,Ze.undefined],t.shared);Ye.any([Ze.number,Ze.undefined],t.cacheHeuristic);Ye.any([Ze.number,Ze.undefined],t.immutableMinTimeToLive);Ye.any([Ze.boolean,Ze.undefined],t.ignoreCargoCult);for(const r in t){if(!(r in this._internals.cacheOptions)){throw new Error(`Cache option \`${r}\` does not exist`)}}if(this._merging){Object.assign(this._internals.cacheOptions,t)}else{this._internals.cacheOptions={...t}}}get https(){return this._internals.https}set https(t){Ye.plainObject(t);Ye.any([Ze.boolean,Ze.undefined],t.rejectUnauthorized);Ye.any([Ze.function_,Ze.undefined],t.checkServerIdentity);Ye.any([Ze.string,Ze.object,Ze.array,Ze.undefined],t.certificateAuthority);Ye.any([Ze.string,Ze.object,Ze.array,Ze.undefined],t.key);Ye.any([Ze.string,Ze.object,Ze.array,Ze.undefined],t.certificate);Ye.any([Ze.string,Ze.undefined],t.passphrase);Ye.any([Ze.string,Ze.buffer,Ze.array,Ze.undefined],t.pfx);Ye.any([Ze.array,Ze.undefined],t.alpnProtocols);Ye.any([Ze.string,Ze.undefined],t.ciphers);Ye.any([Ze.string,Ze.buffer,Ze.undefined],t.dhparam);Ye.any([Ze.string,Ze.undefined],t.signatureAlgorithms);Ye.any([Ze.string,Ze.undefined],t.minVersion);Ye.any([Ze.string,Ze.undefined],t.maxVersion);Ye.any([Ze.boolean,Ze.undefined],t.honorCipherOrder);Ye.any([Ze.number,Ze.undefined],t.tlsSessionLifetime);Ye.any([Ze.string,Ze.undefined],t.ecdhCurve);Ye.any([Ze.string,Ze.buffer,Ze.array,Ze.undefined],t.certificateRevocationLists);for(const r in t){if(!(r in this._internals.https)){throw new Error(`HTTPS option \`${r}\` does not exist`)}}if(this._merging){Object.assign(this._internals.https,t)}else{this._internals.https={...t}}}get encoding(){return this._internals.encoding}set encoding(t){if(t===null){throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead")}Ye.any([Ze.string,Ze.undefined],t);this._internals.encoding=t}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(t){Ye.boolean(t);this._internals.resolveBodyOnly=t}get isStream(){return this._internals.isStream}set isStream(t){Ye.boolean(t);this._internals.isStream=t}get responseType(){return this._internals.responseType}set responseType(t){if(t===undefined){this._internals.responseType="text";return}if(t!=="text"&&t!=="buffer"&&t!=="json"){throw new Error(`Invalid \`responseType\` option: ${t}`)}this._internals.responseType=t}get pagination(){return this._internals.pagination}set pagination(t){Ye.object(t);if(this._merging){Object.assign(this._internals.pagination,t)}else{this._internals.pagination=t}}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(t){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(t){Ye.boolean(t);this._internals.setHost=t}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(t){Ye.any([Ze.number,Ze.undefined],t);this._internals.maxHeaderSize=t}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(t){Ye.boolean(t);this._internals.enableUnixSockets=t}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](t,r){return(0,It.inspect)(this._internals,r)}createNativeRequestOptions(){const t=this._internals;const r=t.url;let i;if(r.protocol==="https:"){i=t.http2?t.agent:t.agent.https}else{i=t.agent.http}const{https:o}=t;let{pfx:a}=o;if(Ze.array(a)&&Ze.plainObject(a[0])){a=a.map((t=>({buf:t.buffer,passphrase:t.passphrase})))}return{...t.cacheOptions,...this._unixOptions,ALPNProtocols:o.alpnProtocols,ca:o.certificateAuthority,cert:o.certificate,key:o.key,passphrase:o.passphrase,pfx:o.pfx,rejectUnauthorized:o.rejectUnauthorized,checkServerIdentity:o.checkServerIdentity??Nt.checkServerIdentity,ciphers:o.ciphers,honorCipherOrder:o.honorCipherOrder,minVersion:o.minVersion,maxVersion:o.maxVersion,sigalgs:o.signatureAlgorithms,sessionTimeout:o.tlsSessionLifetime,dhparam:o.dhparam,ecdhCurve:o.ecdhCurve,crl:o.certificateRevocationLists,lookup:t.dnsLookup??t.dnsCache?.lookup,family:t.dnsLookupIpVersion,agent:i,setHost:t.setHost,method:t.method,maxHeaderSize:t.maxHeaderSize,localAddress:t.localAddress,headers:t.headers,createConnection:t.createConnection,timeout:t.http2?getHttp2TimeoutOption(t):undefined,h2session:t.h2session}}getRequestFunction(){const t=this._internals.url;const{request:r}=this._internals;if(!r&&t){return this.getFallbackRequestFunction()}return r}getFallbackRequestFunction(){const t=this._internals.url;if(!t){return}if(t.protocol==="https:"){if(this._internals.http2){if(Zt<15||Zt===15&&Kt<10){const t=new Error("To use the `http2` option, install Node.js 15.10.0 or above");t.code="EUNSUPPORTED";throw t}return Yt.auto}return jt.request}return Qe.request}freeze(){const t=this._internals;Object.freeze(t);Object.freeze(t.hooks);Object.freeze(t.hooks.afterResponse);Object.freeze(t.hooks.beforeError);Object.freeze(t.hooks.beforeRedirect);Object.freeze(t.hooks.beforeRequest);Object.freeze(t.hooks.beforeRetry);Object.freeze(t.hooks.init);Object.freeze(t.https);Object.freeze(t.cacheOptions);Object.freeze(t.agent);Object.freeze(t.headers);Object.freeze(t.timeout);Object.freeze(t.retry);Object.freeze(t.retry.errorCodes);Object.freeze(t.retry.methods);Object.freeze(t.retry.statusCodes)}}const isResponseOk=t=>{const{statusCode:r}=t;const i=t.request.options.followRedirect?299:399;return r>=200&&r<=i||r===304};class ParseError extends RequestError{constructor(t,r){const{options:i}=r.request;super(`${t.message} in "${i.url.toString()}"`,t,r.request);this.name="ParseError";this.code="ERR_BODY_PARSE_FAILURE"}}const parseBody=(t,r,i,o)=>{const{rawBody:a}=t;try{if(r==="text"){return a.toString(o)}if(r==="json"){return a.length===0?"":i(a.toString(o))}if(r==="buffer"){return a}}catch(r){throw new ParseError(r,t)}throw new ParseError({message:`Unknown body type '${r}'`,name:"Error"},t)};function isClientRequest(t){return t.writable&&!t.writableEnded}const er=isClientRequest;function isUnixSocketURL(t){return t.protocol==="unix:"||t.hostname==="unix"}const tr=Ze.string(m.versions.brotli);const rr=new Set(["GET","HEAD"]);const ir=new WeakableMap;const sr=new Set([300,301,302,303,304,307,308]);const nr=["socket","connect","continue","information","upgrade"];const core_noop=()=>{};class Request extends Ee.Duplex{constructor(t,r,i){super({autoDestroy:false,highWaterMark:0});Object.defineProperty(this,"constructor",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_noPipe",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"options",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"response",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"requestUrl",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"redirectUrls",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"retryCount",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_stopRetry",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_downloadedSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_uploadedSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_stopReading",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_pipedServerResponses",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_request",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_responseSize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_bodySize",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_unproxyEvents",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_isFromCache",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_cannotHaveBody",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_triggerRead",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_cancelTimeouts",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_nativeResponse",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_flushed",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_aborted",{enumerable:true,configurable:true,writable:true,value:void 0});Object.defineProperty(this,"_requestInitialized",{enumerable:true,configurable:true,writable:true,value:void 0});this._downloadedSize=0;this._uploadedSize=0;this._stopReading=false;this._pipedServerResponses=new Set;this._cannotHaveBody=false;this._unproxyEvents=core_noop;this._triggerRead=false;this._cancelTimeouts=core_noop;this._jobs=[];this._flushed=false;this._requestInitialized=false;this._aborted=false;this.redirectUrls=[];this.retryCount=0;this._stopRetry=core_noop;this.on("pipe",(t=>{if(t.headers){Object.assign(this.options.headers,t.headers)}}));this.on("newListener",(t=>{if(t==="retry"&&this.listenerCount("retry")>0){throw new Error("A retry listener has been attached already.")}}));try{this.options=new Options(t,r,i);if(!this.options.url){if(this.options.prefixUrl===""){throw new TypeError("Missing `url` property")}this.options.url=""}this.requestUrl=this.options.url}catch(t){const{options:r}=t;if(r){this.options=r}this.flush=async()=>{this.flush=async()=>{};this.destroy(t)};return}if(this.options.signal?.aborted){this.destroy(new errors_AbortError(this))}this.options.signal?.addEventListener("abort",(()=>{this.destroy(new errors_AbortError(this))}));const{body:o}=this.options;if(Ze.nodeStream(o)){o.once("error",(t=>{if(this._flushed){this._beforeError(new UploadError(t,this))}else{this.flush=async()=>{this.flush=async()=>{};this._beforeError(new UploadError(t,this))}}}))}}async flush(){if(this._flushed){return}this._flushed=true;try{await this._finalizeBody();if(this.destroyed){return}await this._makeRequest();if(this.destroyed){this._request?.destroy();return}for(const t of this._jobs){t()}this._jobs.length=0;this._requestInitialized=true}catch(t){this._beforeError(t)}}_beforeError(t){if(this._stopReading){return}const{response:r,options:i}=this;const o=this.retryCount+(t.name==="RetryError"?0:1);this._stopReading=true;if(!(t instanceof RequestError)){t=new RequestError(t.message,t,this)}const a=t;void(async()=>{if(r?.readable&&!r.rawBody&&!this._request?.socket?.destroyed){r.setEncoding(this.readableEncoding);const t=await this._setRawBody(r);if(t){r.body=r.rawBody.toString()}}if(this.listenerCount("retry")!==0){let l;try{let t;if(r&&"retry-after"in r.headers){t=Number(r.headers["retry-after"]);if(Number.isNaN(t)){t=Date.parse(r.headers["retry-after"])-Date.now();if(t<=0){t=1}}else{t*=1e3}}const c=i.retry;l=await c.calculateDelay({attemptCount:o,retryOptions:c,error:a,retryAfter:t,computedValue:Dt({attemptCount:o,retryOptions:c,error:a,retryAfter:t,computedValue:c.maxRetryAfter??i.timeout.request??Number.POSITIVE_INFINITY})})}catch(t){void this._error(new RequestError(t.message,t,this));return}if(l){await new Promise((t=>{const r=setTimeout(t,l);this._stopRetry=()=>{clearTimeout(r);t()}}));if(this.destroyed){return}try{for(const t of this.options.hooks.beforeRetry){await t(a,this.retryCount+1)}}catch(r){void this._error(new RequestError(r.message,t,this));return}if(this.destroyed){return}this.destroy();this.emit("retry",this.retryCount+1,t,(t=>{const r=new Request(i.url,t,i);r.retryCount=this.retryCount+1;m.nextTick((()=>{void r.flush()}));return r}));return}}void this._error(a)})()}_read(){this._triggerRead=true;const{response:t}=this;if(t&&!this._stopReading){if(t.readableLength){this._triggerRead=false}let r;while((r=t.read())!==null){this._downloadedSize+=r.length;const t=this.downloadProgress;if(t.percent<1){this.emit("downloadProgress",t)}this.push(r)}}}_write(t,r,i){const write=()=>{this._writeRequest(t,r,i)};if(this._requestInitialized){write()}else{this._jobs.push(write)}}_final(t){const endRequest=()=>{if(!this._request||this._request.destroyed){t();return}this._request.end((r=>{if(this._request._writableState?.errored){return}if(!r){this._bodySize=this._uploadedSize;this.emit("uploadProgress",this.uploadProgress);this._request.emit("upload-complete")}t(r)}))};if(this._requestInitialized){endRequest()}else{this._jobs.push(endRequest)}}_destroy(t,r){this._stopReading=true;this.flush=async()=>{};this._stopRetry();this._cancelTimeouts();if(this.options){const{body:t}=this.options;if(Ze.nodeStream(t)){t.destroy()}}if(this._request){this._request.destroy()}if(t!==null&&!Ze.undefined(t)&&!(t instanceof RequestError)){t=new RequestError(t.message,t,this)}r(t)}pipe(t,r){if(t instanceof Qe.ServerResponse){this._pipedServerResponses.add(t)}return super.pipe(t,r)}unpipe(t){if(t instanceof Qe.ServerResponse){this._pipedServerResponses.delete(t)}super.unpipe(t);return this}async _finalizeBody(){const{options:t}=this;const{headers:r}=t;const i=!Ze.undefined(t.form);const o=!Ze.undefined(t.json);const a=!Ze.undefined(t.body);const l=rr.has(t.method)&&!(t.method==="GET"&&t.allowGetBody);this._cannotHaveBody=l;if(i||o||a){if(l){throw new TypeError(`The \`${t.method}\` method cannot be used with a body`)}const o=!Ze.string(r["content-type"]);if(a){if(isFormData(t.body)){const i=new FormDataEncoder(t.body);if(o){r["content-type"]=i.headers["Content-Type"]}if("Content-Length"in i.headers){r["content-length"]=i.headers["Content-Length"]}t.body=i.encode()}if(is_form_data_isFormData(t.body)&&o){r["content-type"]=`multipart/form-data; boundary=${t.body.getBoundary()}`}}else if(i){if(o){r["content-type"]="application/x-www-form-urlencoded"}const{form:i}=t;t.form=undefined;t.body=new we.URLSearchParams(i).toString()}else{if(o){r["content-type"]="application/json"}const{json:i}=t;t.json=undefined;t.body=t.stringifyJson(i)}const c=await getBodySize(t.body,t.headers);if(Ze.undefined(r["content-length"])&&Ze.undefined(r["transfer-encoding"])&&!l&&!Ze.undefined(c)){r["content-length"]=String(c)}}if(t.responseType==="json"&&!("accept"in t.headers)){t.headers.accept="application/json"}this._bodySize=Number(r["content-length"])||undefined}async _onResponseBase(t){if(this.isAborted){return}const{options:r}=this;const{url:i}=r;this._nativeResponse=t;if(r.decompress){t=dt(t)}const o=t.statusCode;const a=t;a.statusMessage=a.statusMessage?a.statusMessage:Qe.STATUS_CODES[o];a.url=r.url.toString();a.requestUrl=this.requestUrl;a.redirectUrls=this.redirectUrls;a.request=this;a.isFromCache=this._nativeResponse.fromCache??false;a.ip=this.ip;a.retryCount=this.retryCount;a.ok=isResponseOk(a);this._isFromCache=a.isFromCache;this._responseSize=Number(t.headers["content-length"])||undefined;this.response=a;t.once("end",(()=>{this._responseSize=this._downloadedSize;this.emit("downloadProgress",this.downloadProgress)}));t.once("error",(r=>{this._aborted=true;t.destroy();this._beforeError(new ReadError(r,this))}));t.once("aborted",(()=>{this._aborted=true;this._beforeError(new ReadError({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}));this.emit("downloadProgress",this.downloadProgress);const l=t.headers["set-cookie"];if(Ze.object(r.cookieJar)&&l){let t=l.map((async t=>r.cookieJar.setCookie(t,i.toString())));if(r.ignoreInvalidCookies){t=t.map((async t=>{try{await t}catch{}}))}try{await Promise.all(t)}catch(t){this._beforeError(t);return}}if(this.isAborted){return}if(r.followRedirect&&t.headers.location&&sr.has(o)){t.resume();this._cancelTimeouts();this._unproxyEvents();if(this.redirectUrls.length>=r.maxRedirects){this._beforeError(new MaxRedirectsError(this));return}this._request=undefined;const l=new Options(undefined,undefined,this.options);const c=o===303&&l.method!=="GET"&&l.method!=="HEAD";const u=o!==307&&o!==308;const h=l.methodRewriting&&u;if(c||h){l.method="GET";l.body=undefined;l.json=undefined;l.form=undefined;delete l.headers["content-length"]}try{const r=Ke.Buffer.from(t.headers.location,"binary").toString();const o=new we.URL(r,i);if(!isUnixSocketURL(i)&&isUnixSocketURL(o)){this._beforeError(new RequestError("Cannot redirect to UNIX socket",{},this));return}if(o.hostname!==i.hostname||o.port!==i.port){if("host"in l.headers){delete l.headers.host}if("cookie"in l.headers){delete l.headers.cookie}if("authorization"in l.headers){delete l.headers.authorization}if(l.username||l.password){l.username="";l.password=""}}else{o.username=l.username;o.password=l.password}this.redirectUrls.push(o);l.prefixUrl="";l.url=o;for(const t of l.hooks.beforeRedirect){await t(l,a)}this.emit("redirect",l,a);this.options=l;await this._makeRequest()}catch(t){this._beforeError(t);return}return}if(r.isStream&&r.throwHttpErrors&&!isResponseOk(a)){this._beforeError(new HTTPError(a));return}t.on("readable",(()=>{if(this._triggerRead){this._read()}}));this.on("resume",(()=>{t.resume()}));this.on("pause",(()=>{t.pause()}));t.once("end",(()=>{this.push(null)}));if(this._noPipe){const r=await this._setRawBody();if(r){this.emit("response",t)}return}this.emit("response",t);for(const i of this._pipedServerResponses){if(i.headersSent){continue}for(const o in t.headers){const a=r.decompress?o!=="content-encoding":true;const l=t.headers[o];if(a){i.setHeader(o,l)}}i.statusCode=o}}async _setRawBody(t=this){if(t.readableEnded){return false}try{const r=await(0,nt.buffer)(t);if(!this.isAborted){this.response.rawBody=r;return true}}catch{}return false}async _onResponse(t){try{await this._onResponseBase(t)}catch(t){this._beforeError(t)}}_onRequest(t){const{options:r}=this;const{timeout:i,url:o}=r;tt(t);if(this.options.http2){t.setTimeout(0)}this._cancelTimeouts=timedOut(t,i,o);const a=r.cache?"cacheableResponse":"response";t.once(a,(t=>{void this._onResponse(t)}));t.once("error",(r=>{this._aborted=true;t.destroy();r=r instanceof timed_out_TimeoutError?new TimeoutError(r,this.timings,this):new RequestError(r.message,r,this);this._beforeError(r)}));this._unproxyEvents=proxyEvents(t,this,nr);this._request=t;this.emit("uploadProgress",this.uploadProgress);this._sendBody();this.emit("request",t)}async _asyncWrite(t){return new Promise(((r,i)=>{super.write(t,(t=>{if(t){i(t);return}r()}))}))}_sendBody(){const{body:t}=this.options;const r=this.redirectUrls.length===0?this:this._request??this;if(Ze.nodeStream(t)){t.pipe(r)}else if(Ze.generator(t)||Ze.asyncGenerator(t)){(async()=>{try{for await(const r of t){await this._asyncWrite(r)}super.end()}catch(t){this._beforeError(t)}})()}else if(!Ze.undefined(t)){this._writeRequest(t,undefined,(()=>{}));r.end()}else if(this._cannotHaveBody||this._noPipe){r.end()}}_prepareCache(t){if(!ir.has(t)){const r=new ht(((t,r)=>{const i=t._request(t,r);if(Ze.promise(i)){i.once=(t,r)=>{if(t==="error"){(async()=>{try{await i}catch(t){r(t)}})()}else if(t==="abort"){(async()=>{try{const t=await i;t.once("abort",r)}catch{}})()}else{throw new Error(`Unknown HTTP2 promise event: ${t}`)}return i}}return i}),t);ir.set(t,r.request())}}async _createCacheableRequest(t,r){return new Promise(((i,o)=>{Object.assign(r,urlToOptions(t));let a;const l=ir.get(r.cache)(r,(async t=>{t._readableState.autoDestroy=false;if(a){const fix=()=>{if(t.req){t.complete=t.req.res.complete}};t.prependOnceListener("end",fix);fix();(await a).emit("cacheableResponse",t)}i(t)}));l.once("error",o);l.once("request",(async t=>{a=t;i(a)}))}))}async _makeRequest(){const{options:t}=this;const{headers:r,username:i,password:o}=t;const a=t.cookieJar;for(const t in r){if(Ze.undefined(r[t])){delete r[t]}else if(Ze.null_(r[t])){throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${t}\` header`)}}if(t.decompress&&Ze.undefined(r["accept-encoding"])){r["accept-encoding"]=tr?"gzip, deflate, br":"gzip, deflate"}if(i||o){const t=Ke.Buffer.from(`${i}:${o}`).toString("base64");r.authorization=`Basic ${t}`}if(a){const i=await a.getCookieString(t.url.toString());if(Ze.nonEmptyString(i)){r.cookie=i}}t.prefixUrl="";let l;for(const r of t.hooks.beforeRequest){const i=await r(t);if(!Ze.undefined(i)){l=()=>i;break}}if(!l){l=t.getRequestFunction()}const c=t.url;this._requestOptions=t.createNativeRequestOptions();if(t.cache){this._requestOptions._request=l;this._requestOptions.cache=t.cache;this._requestOptions.body=t.body;this._prepareCache(t.cache)}const u=t.cache?this._createCacheableRequest:l;try{let r=u(c,this._requestOptions);if(Ze.promise(r)){r=await r}if(Ze.undefined(r)){r=t.getFallbackRequestFunction()(c,this._requestOptions);if(Ze.promise(r)){r=await r}}if(er(r)){this._onRequest(r)}else if(this.writable){this.once("finish",(()=>{void this._onResponse(r)}));this._sendBody()}else{void this._onResponse(r)}}catch(t){if(t instanceof types_CacheError){throw new CacheError(t,this)}throw t}}async _error(t){try{if(t instanceof HTTPError&&!this.options.throwHttpErrors){}else{for(const r of this.options.hooks.beforeError){t=await r(t)}}}catch(r){t=new RequestError(r.message,r,this)}this.destroy(t)}_writeRequest(t,r,i){if(!this._request||this._request.destroyed){return}this._request.write(t,r,(o=>{if(!o&&!this._request.destroyed){this._uploadedSize+=Ke.Buffer.byteLength(t,r);const i=this.uploadProgress;if(i.percent<1){this.emit("uploadProgress",i)}}i(o)}))}get ip(){return this.socket?.remoteAddress}get isAborted(){return this._aborted}get socket(){return this._request?.socket??undefined}get downloadProgress(){let t;if(this._responseSize){t=this._downloadedSize/this._responseSize}else if(this._responseSize===this._downloadedSize){t=1}else{t=0}return{percent:t,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let t;if(this._bodySize){t=this._uploadedSize/this._bodySize}else if(this._bodySize===this._uploadedSize){t=1}else{t=0}return{percent:t,transferred:this._uploadedSize,total:this._bodySize}}get timings(){return this._request?.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){return this._request?.reusedSocket}}class types_CancelError extends RequestError{constructor(t){super("Promise was canceled",{},t);this.name="CancelError";this.code="ERR_CANCELED"}get isCanceled(){return true}}const or=["request","response","redirect","uploadProgress","downloadProgress"];function asPromise(t){let r;let i;let o;const a=new le.EventEmitter;const l=new PCancelable(((c,u,h)=>{h((()=>{r.destroy()}));h.shouldReject=false;h((()=>{u(new types_CancelError(r))}));const makeRequest=d=>{h((()=>{}));const p=t??new Request(undefined,undefined,o);p.retryCount=d;p._noPipe=true;r=p;p.once("response",(async t=>{const r=(t.headers["content-encoding"]??"").toLowerCase();const o=r==="gzip"||r==="deflate"||r==="br";const{options:a}=p;if(o&&!a.decompress){t.body=t.rawBody}else{try{t.body=parseBody(t,a.responseType,a.parseJson,a.encoding)}catch(r){t.body=t.rawBody.toString();if(isResponseOk(t)){p._beforeError(r);return}}}try{const r=a.hooks.afterResponse;for(const[i,o]of r.entries()){t=await o(t,(async t=>{a.merge(t);a.prefixUrl="";if(t.url){a.url=t.url}a.hooks.afterResponse=a.hooks.afterResponse.slice(0,i);throw new RetryError(p)}));if(!(Ze.object(t)&&Ze.number(t.statusCode)&&!Ze.nullOrUndefined(t.body))){throw new TypeError("The `afterResponse` hook returned an invalid value")}}}catch(t){p._beforeError(t);return}i=t;if(!isResponseOk(t)){p._beforeError(new HTTPError(t));return}p.destroy();c(p.options.resolveBodyOnly?t.body:t)}));const onError=t=>{if(l.isCanceled){return}const{options:r}=p;if(t instanceof HTTPError&&!r.throwHttpErrors){const{response:r}=t;p.destroy();c(p.options.resolveBodyOnly?r.body:r);return}u(t)};p.once("error",onError);const m=p.options?.body;p.once("retry",((r,i)=>{t=undefined;const a=p.options.body;if(m===a&&Ze.nodeStream(a)){i.message="Cannot retry with consumed body stream";onError(i);return}o=p.options;makeRequest(r)}));proxyEvents(p,a,or);if(Ze.undefined(t)){void p.flush()}};makeRequest(0)}));l.on=(t,r)=>{a.on(t,r);return l};l.off=(t,r)=>{a.off(t,r);return l};const shortcut=t=>{const r=(async()=>{await l;const{options:r}=i.request;return parseBody(i,t,r.parseJson,r.encoding)})();Object.defineProperties(r,Object.getOwnPropertyDescriptors(l));return r};l.json=()=>{if(r.options){const{headers:t}=r.options;if(!r.writableFinished&&!("accept"in t)){t.accept="application/json"}}return shortcut("json")};l.buffer=()=>shortcut("buffer");l.text=()=>shortcut("text");return l}const delay=async t=>new Promise((r=>{setTimeout(r,t)}));const isGotInstance=t=>Ze.function_(t);const ar=["get","post","put","patch","head","delete"];const create=t=>{t={options:new Options(undefined,undefined,t.options),handlers:[...t.handlers],mutableDefaults:t.mutableDefaults};Object.defineProperty(t,"mutableDefaults",{enumerable:true,configurable:false,writable:false});const got=(r,i,o=t.options)=>{const a=new Request(r,i,o);let l;const lastHandler=t=>{a.options=t;a._noPipe=!t.isStream;void a.flush();if(t.isStream){return a}if(!l){l=asPromise(a)}return l};let c=0;const iterateHandlers=r=>{const i=t.handlers[c++]??lastHandler;const o=i(r,iterateHandlers);if(Ze.promise(o)&&!a.options.isStream){if(!l){l=asPromise(a)}if(o!==l){const t=Object.getOwnPropertyDescriptors(l);for(const r in t){if(r in o){delete t[r]}}Object.defineProperties(o,t);o.cancel=l.cancel}}return o};return iterateHandlers(a.options)};got.extend=(...r)=>{const i=new Options(undefined,undefined,t.options);const o=[...t.handlers];let a;for(const t of r){if(isGotInstance(t)){i.merge(t.defaults.options);o.push(...t.defaults.handlers);a=t.defaults.mutableDefaults}else{i.merge(t);if(t.handlers){o.push(...t.handlers)}a=t.mutableDefaults}}return create({options:i,handlers:o,mutableDefaults:Boolean(a)})};const paginateEach=async function*(r,i){let o=new Options(r,i,t.options);o.resolveBodyOnly=false;const{pagination:a}=o;Ye.function_(a.transform);Ye.function_(a.shouldContinue);Ye.function_(a.filter);Ye.function_(a.paginate);Ye.number(a.countLimit);Ye.number(a.requestLimit);Ye.number(a.backoff);const l=[];let{countLimit:c}=a;let u=0;while(u<a.requestLimit){if(u!==0){await delay(a.backoff)}const t=await got(undefined,undefined,o);const r=await a.transform(t);const i=[];Ye.array(r);for(const t of r){if(a.filter({item:t,currentItems:i,allItems:l})){if(!a.shouldContinue({item:t,currentItems:i,allItems:l})){return}yield t;if(a.stackAllItems){l.push(t)}i.push(t);if(--c<=0){return}}}const h=a.paginate({response:t,currentItems:i,allItems:l});if(h===false){return}if(h===t.request.options){o=t.request.options}else{o.merge(h);Ye.any([Ze.urlInstance,Ze.undefined],h.url);if(h.url!==undefined){o.prefixUrl="";o.url=h.url}}u++}};got.paginate=paginateEach;got.paginate.all=async(t,r)=>{const i=[];for await(const o of paginateEach(t,r)){i.push(o)}return i};got.paginate.each=paginateEach;got.stream=(t,r)=>got(t,{...r,isStream:true});for(const t of ar){got[t]=(r,i)=>got(r,{...i,method:t});got.stream[t]=(r,i)=>got(r,{...i,method:t,isStream:true})}if(!t.mutableDefaults){Object.freeze(t.handlers);t.options.freeze()}Object.defineProperty(got,"defaults",{value:t,writable:false,configurable:false,enumerable:true});return got};const lr=create;const cr={options:new Options,handlers:[],mutableDefaults:false};const ur=lr(cr);const hr=ur;var fr=i(5793);var dr=i(2781);const pr=(0,Je.promisify)(dr.Stream.pipeline);async function isUrlOk(t){const r=await hr.head(t).catch((t=>t));return r.statusCode===200}async function getRepoInfo(t,r){const[,i,o,a,l,...c]=t.pathname.split("/");const u=r?r.replace(/^\//,""):c.join("/");if(a===undefined){const t=await hr(`https://api.github.com/repos/${i}/${o}`).catch((t=>t));if(t.statusCode!==200){return}const r=JSON.parse(t.body);return{username:i,name:o,branch:r["default_branch"],filePath:u}}const h=r?`${l}/${c.join("/")}`.replace(new RegExp(`/${u}|/$`),""):l;if(i&&o&&h&&a==="tree"){return{username:i,name:o,branch:h,filePath:u}}}function hasRepo({username:t,name:r,branch:i,filePath:o}){const a=`https://api.github.com/repos/${t}/${r}/contents`;const l=`${o?`/${o}`:""}/package.json`;return isUrlOk(a+l+`?ref=${i}`)}function hasTemplate(t){return isUrlOk(`https://api.github.com/repos/openpatch/hyperbook/contents/templates/${encodeURIComponent(t)}/package.json`)}function downloadAndExtractRepo(t,{username:r,name:i,branch:o,filePath:a}){return pr(hr.stream(`https://codeload.github.com/${r}/${i}/tar.gz/${o}`),fr.extract({cwd:t,strip:a?a.split("/").length+1:1},[`${i}-${o}${a?`/${a}`:""}`]))}async function getTemplateInfo(t){let r;if(t){let i;try{i=new URL(t)}catch(t){if(t.code!=="ERR_INVALID_URL"){console.error(t);process.exit(1)}}if(i){if(i.origin!=="https://github.com"){console.error(`Invalid URL: ${L.red(`"${t}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`);process.exit(1)}r=await getRepoInfo(i);if(!r){console.error(`Found invalid GitHub URL: ${L.red(`"${t}"`)}. Please fix the URL and try again.`);process.exit(1)}const o=await hasRepo(r);if(!o){console.error(`Could not locate the repository for ${L.red(`"${t}"`)}. Please check that the repository exists and try again.`);process.exit(1)}}else if(t!=="__internal-testing-retry"){const r=await hasTemplate(t);if(!r){console.error(`Could not locate an template named ${L.red(`"${t}"`)}. It could be due to the following:\n`,`1. Your spelling of template ${L.red(`"${t}"`)} might be incorrect.\n`,`2. You might not be connected to the internet.`);process.exit(1)}}}return r}var mr=i(3493);var yr=i.n(mr);function install(t,r,{packageManager:i,isOnline:o,devDependencies:a}){const l=[];const c=[];return new Promise(((u,h)=>{let d;let p=i;const m=i==="yarn";if(r&&r.length){if(m){d=["add","--exact"];if(!o)d.push("--offline");d.push("--cwd",t);if(a)d.push("--dev");d.push(...r)}else{d=["install","--save-exact"];d.push(a?"--save-dev":"--save");d.push(...r)}}else{d=["install"];if(!o){console.log(L.yellow("You appear to be offline."));if(m){console.log(L.yellow("Falling back to the local Yarn cache."));console.log();d.push("--offline")}else{console.log()}}}if(m){d.push(...c)}else{d.push(...l)}const y=se()(p,d,{stdio:"inherit",cwd:K().join(process.cwd(),".hyperbook"),env:{...process.env,ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"}});y.on("close",(t=>{if(t!==0){h({command:`${p} ${d.join(" ")}`});return}u()}))}))}const gr=require("dns");var br=i.n(gr);var vr=i(7310);var _r=i.n(vr);function getProxy(){if(process.env.https_proxy){return process.env.https_proxy}try{const t=(0,ne.execSync)("npm config get https-proxy").toString().trim();return t!=="null"?t:undefined}catch(t){return}}function getOnline(){return new Promise((t=>{br().lookup("registry.yarnpkg.com",(r=>{if(!r){return t(true)}const i=getProxy();if(!i){return t(false)}const{hostname:o}=_r().parse(i);if(!o){return t(false)}br().lookup(o,(r=>{t(r==null)}))}))}))}async function makeSymlink(t,r){const i=ae().platform()=="win32"?"junction":null;return new Promise(((o,a)=>{X().symlink(t,r,i,(t=>{if(t){a()}else{o()}}))}))}const wr=require("fs/promises");var Er=i.n(wr);async function preparePackages(t){var r,i;const o=await Er().readFile(K().join(t,"package.json")).then((t=>t.toString("utf8"))).then((t=>JSON.parse(t)));const{dependencies:a,devDependencies:l}=o;for(let t of Object.entries(a)){const[i,o]=t;if(o==="workspace:*"){const t=`https://registry.npmjs.org/${encodeURIComponent(i)}`;const o=await hr.get(t).json();const l=(r=o===null||o===void 0?void 0:o["dist-tags"])===null||r===void 0?void 0:r["latest"];if(l){a[i]=l}}}for(let t of Object.entries(l)){const[r,o]=t;if(o==="workspace:*"){const t=`https://registry.npmjs.org/${encodeURIComponent(r)}`;const o=await hr.get(t).json();const a=(i=o===null||o===void 0?void 0:o["dist-tags"])===null||i===void 0?void 0:i["latest"];if(a){l[r]=a}}}o["dependencies"]=a;o["devDependencies"]=l;await Er().writeFile(K().join(t,"package.json"),JSON.stringify(o,null,2))}class DownloadError extends Error{}async function runSetup(t,r,i){if(!i){i=process.cwd()}if(!t){const r=await readHyperbook();t=r.template}if(!t){t="https://github.com/openpatch/hyperbook/tree/main/templates/simple"}if(!r){r=await getTemplateInfo(t)}const o=K().join(i,".hyperbook");console.log("Removing old template");$e().sync(o);await makeDir(o);const a=await getOnline();try{if(r){const i=r;console.log(`Downloading files from repo ${L.cyan(t)}. This might take a moment.`);console.log();await yr()((()=>downloadAndExtractRepo(o,i)),{retries:3})}}catch(t){function isErrorLike(t){return typeof t==="object"&&t!==null&&typeof t.message==="string"}throw new DownloadError(isErrorLike(t)?t.message:t+"")}console.log("Prepare packages. Use latest versions.");console.log();await preparePackages(o);console.log("Installing packages. This might take a couple of minutes.");console.log();await install(o,null,{packageManager:"npm",isOnline:a});console.log();$e().sync(K().join(o,"book"));$e().sync(K().join(o,"public"));$e().sync(K().join(o,"glossary"));$e().sync(K().join(o,"hyperbook.json"));await makeSymlink(K().join(i,"book"),K().join(o,"book"));await makeSymlink(K().join(i,"public"),K().join(o,"public"));await makeSymlink(K().join(i,"glossary"),K().join(o,"glossary"));await makeSymlink(K().join(i,"hyperbook.json"),K().join(o,"hyperbook.json"))}async function runNew({programName:t,bookPath:r,template:o}){if(typeof r==="string"){r=r.trim()}if(!r){const t=await Fe()({type:"text",name:"path",message:"What is your book named?",initial:"my-book"});if(typeof t.path==="string"){r=t.path.trim()}}if(!r){console.log();console.log("Please specify the book directory:");console.log(` ${L.cyan(t)} ${L.green("<book-directory>")}`);console.log();console.log("For example:");console.log(` ${L.cyan(t)} ${L.green("my-new-book")}`);console.log();console.log(`Run ${L.cyan(`${t} --help`)} to see all options.`);process.exit(1)}let a=await getTemplateInfo(o);const l=K().resolve(r);if(!await isWriteable(K().dirname(l))){console.error("The book path is not writable, please check folder permissions and try again.");console.error("It is likely you do not have write permissions for this folder.");process.exit(1)}const c=K().basename(l);await makeDir(l);if(!isFolderEmpty(l,c)){process.exit(1)}const u=process.cwd();console.log(`Creating a new hyperbook in ${L.green(l)}.`);console.log();process.chdir(l);const{description:h}=await Fe()({type:"text",name:"description",message:"What is your book about?",initial:""});const{author:d}=await Fe()({type:"text",name:"author",message:"Who is the author of the book?",initial:""});const{authorUrl:p}=await Fe()({type:"text",name:"authorUrl",message:"What is the link to the authors homepage?",initial:""});let{license:m}=await Fe()({type:"select",name:"license",message:"Pick a license for your book!",choices:[{title:"Creative Commons Zero (CC0)",value:"cc0"},{title:"Creative Commons Attribution (CC BY)",value:"cc-by"},{title:"Creative Commons Attribution-ShareAlike (CC BY-SA)",value:"cc-by-sa"},{title:"Creative Commons Attribution-NoDerivs (CC BY-ND)",value:"cc-by-nd"},{title:"Creative Commons Attribution-NonCommercial (CC BY-NC)",value:"cc-by-nc"},{title:"Creative Commons Attribution-NonCommercial-ShareAlike (CC BY-NC-SA)",value:"cc-by-nc-sa"},{title:"Creative Commons Attribution-NonCommercial-NoDervis (CC BY-NC-ND)",value:"cc-by-nc-nd"},{title:"Custom",value:"custom"}]});if(m==="custom"){const t=await Fe()({type:"text",name:"license",message:"Which custom license you want to use?"});m=t.license}const{language:y}=await Fe()({type:"text",name:"language",message:"In which language is your book written? Provide a short code, e.g.: en or de",initial:"en"});const g={name:c,version:"0.0.0",description:h,license:m,author:{name:d,url:p},language:y};X().writeFileSync(K().join(l,"hyperbook.json"),JSON.stringify(g,null,2)+ae().EOL);console.log();const b=i.ab+"templates";await cpy("default/**",l,{cwd:i.ab+"templates",rename:t=>{switch(t){case"gitignore":{return".".concat(t)}case"README-template.md":{return"README.md"}default:{return t}}}});await runSetup(o,a,l);if(tryGitInit(l)){console.log("Initialized a git repository.");console.log()}let v;if(K().join(u,c)===r){v=c}else{v=r}console.log(`${L.green("Success!")} Created ${c} at ${r}`);console.log("Inside that directory, you can run several commands:");console.log();console.log(L.cyan(` hyperbook dev`));console.log(" Starts the development server.");console.log();console.log(L.cyan(` hyperbook build`));console.log(" Builds the book for production.");console.log();console.log("We suggest that you begin by typing:");console.log();console.log(L.cyan(" cd"),v);console.log(` ${L.cyan(`hyperbook dev`)}`);console.log()}const Sr=JSON.parse('{"name":"hyperbook","version":"0.5.7","author":"Mike Barkmin","homepage":"https://github.com/openpatch/hyperbook#readme","license":"MIT","bin":{"hyperbook":"./dist/index.js"},"files":["dist"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/openpatch/hyperbook.git","directory":"packages/hyperbook"},"bugs":{"url":"https://github.com/openpatch/hyperbook/issues"},"engines":{"node":">=12.22.0"},"scripts":{"version":"pnpm build","lint":"tsc --noEmit","dev":"ncc build ./index.ts -w -o dist/","build":"rimraf dist && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register"},"devDependencies":{"@types/archiver":"5.3.1","@types/async-retry":"1.4.5","@types/cross-spawn":"6.0.2","@types/prompts":"2.4.1","@types/rimraf":"3.0.2","@types/tar":"6.1.3","@vercel/ncc":"0.34.0","archiver":"5.3.1","async-retry":"1.3.3","chalk":"5.1.2","commander":"9.4.1","cpy":"9.0.1","cross-spawn":"7.0.3","got":"12.5.2","prompts":"2.4.2","rimraf":"3.0.2","tar":"6.1.11","update-check":"1.5.4"},"dependencies":{"@hyperbook/types":"workspace:*"}}');const Or=new q;Or.name(Sr.name).version(Sr.version).hook("preAction",(async()=>{await notifyUpdate()}));Or.command("new").description("create a new hyperbook").arguments("<book-directory>").usage(`${L.green("<book-directory>")} [options]`).option("-t, --template [name]|[github-url]",`\n A template for your hyperbook. You can use an template name\n from the official hyperbook repo or a GitHub URL. The URL can use\n any branch and/or subdirectory\n`).action((async(t,r)=>{const i=typeof r.template==="string"&&r.template.trim();await runNew({programName:Or.name(),bookPath:t,template:i}).catch((()=>process.exit(1)))}));Or.command("dev").description("start the development server for a hyperbook").action((async()=>{await runDev().catch((()=>process.exit(1)))}));Or.command("setup").description("downloads the latest version of the template of a hyperbook").action((async()=>{await runSetup().catch((()=>process.exit(1)))}));Or.command("build").description("build a hyperbook").action((async()=>{await runArchive().catch((()=>process.exit(1)));await runBuild().catch((()=>process.exit(1)))}));Or.command("archive").description("create archives from archives folder").action((async()=>{await runArchive().catch((()=>process.exit(1)))}));Or.parseAsync(process.argv);const Rr=Y()(Sr).catch((()=>null));async function notifyUpdate(){try{const t=await Rr;if(t===null||t===void 0?void 0:t.latest){const t=getPkgManager();console.log();console.log(L.yellow.bold("A new version of `hyperbook` is available!"));console.log("You can update by running: "+L.cyan(t==="yarn"?"yarn global add hyperbook":`${t} install --global hyperbook`));console.log()}process.exit()}catch{}}},9491:t=>{"use strict";t.exports=require("assert")},4300:t=>{"use strict";t.exports=require("buffer")},2081:t=>{"use strict";t.exports=require("child_process")},2057:t=>{"use strict";t.exports=require("constants")},6113:t=>{"use strict";t.exports=require("crypto")},2361:t=>{"use strict";t.exports=require("events")},7147:t=>{"use strict";t.exports=require("fs")},3685:t=>{"use strict";t.exports=require("http")},5158:t=>{"use strict";t.exports=require("http2")},5687:t=>{"use strict";t.exports=require("https")},1808:t=>{"use strict";t.exports=require("net")},2037:t=>{"use strict";t.exports=require("os")},1017:t=>{"use strict";t.exports=require("path")},7282:t=>{"use strict";t.exports=require("process")},4521:t=>{"use strict";t.exports=require("readline")},2781:t=>{"use strict";t.exports=require("stream")},1576:t=>{"use strict";t.exports=require("string_decoder")},4404:t=>{"use strict";t.exports=require("tls")},7310:t=>{"use strict";t.exports=require("url")},3837:t=>{"use strict";t.exports=require("util")},9796:t=>{"use strict";t.exports=require("zlib")},345:(t,r,i)=>{const{Argument:o}=i(4079);const{Command:a}=i(6505);const{CommanderError:l,InvalidArgumentError:c}=i(9027);const{Help:u}=i(9164);const{Option:h}=i(5205);r=t.exports=new a;r.program=r;r.Argument=o;r.Command=a;r.CommanderError=l;r.Help=u;r.InvalidArgumentError=c;r.InvalidOptionArgumentError=c;r.Option=h},4079:(t,r,i)=>{const{InvalidArgumentError:o}=i(9027);class Argument{constructor(t,r){this.description=r||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(t[0]){case"<":this.required=true;this._name=t.slice(1,-1);break;case"[":this.required=false;this._name=t.slice(1,-1);break;default:this.required=true;this._name=t;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(t,r){if(r===this.defaultValue||!Array.isArray(r)){return[t]}return r.concat(t)}default(t,r){this.defaultValue=t;this.defaultValueDescription=r;return this}argParser(t){this.parseArg=t;return this}choices(t){this.argChoices=t.slice();this.parseArg=(t,r)=>{if(!this.argChoices.includes(t)){throw new o(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,r)}return t};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(t){const r=t.name()+(t.variadic===true?"...":"");return t.required?"<"+r+">":"["+r+"]"}r.Argument=Argument;r.humanReadableArgName=humanReadableArgName},6505:(t,r,i)=>{const o=i(2361).EventEmitter;const a=i(2081);const l=i(1017);const c=i(7147);const u=i(7282);const{Argument:h,humanReadableArgName:d}=i(4079);const{CommanderError:p}=i(9027);const{Help:m}=i(9164);const{Option:y,splitOptionFlags:g,DualOptions:b}=i(5205);const{suggestSimilar:v}=i(211);class Command extends o{constructor(t){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this._args=[];this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=t||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._summary="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._outputConfiguration={writeOut:t=>u.stdout.write(t),writeErr:t=>u.stderr.write(t),getOutHelpWidth:()=>u.stdout.isTTY?u.stdout.columns:undefined,getErrHelpWidth:()=>u.stderr.isTTY?u.stderr.columns:undefined,outputError:(t,r)=>r(t)};this._hidden=false;this._hasHelpOption=true;this._helpFlags="-h, --help";this._helpDescription="display help for command";this._helpShortFlag="-h";this._helpLongFlag="--help";this._addImplicitHelpCommand=undefined;this._helpCommandName="help";this._helpCommandnameAndArgs="help [command]";this._helpCommandDescription="display help for command";this._helpConfiguration={}}copyInheritedSettings(t){this._outputConfiguration=t._outputConfiguration;this._hasHelpOption=t._hasHelpOption;this._helpFlags=t._helpFlags;this._helpDescription=t._helpDescription;this._helpShortFlag=t._helpShortFlag;this._helpLongFlag=t._helpLongFlag;this._helpCommandName=t._helpCommandName;this._helpCommandnameAndArgs=t._helpCommandnameAndArgs;this._helpCommandDescription=t._helpCommandDescription;this._helpConfiguration=t._helpConfiguration;this._exitCallback=t._exitCallback;this._storeOptionsAsProperties=t._storeOptionsAsProperties;this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue;this._allowExcessArguments=t._allowExcessArguments;this._enablePositionalOptions=t._enablePositionalOptions;this._showHelpAfterError=t._showHelpAfterError;this._showSuggestionAfterError=t._showSuggestionAfterError;return this}command(t,r,i){let o=r;let a=i;if(typeof o==="object"&&o!==null){a=o;o=null}a=a||{};const[,l,c]=t.match(/([^ ]+) *(.*)/);const u=this.createCommand(l);if(o){u.description(o);u._executableHandler=true}if(a.isDefault)this._defaultCommandName=u._name;u._hidden=!!(a.noHelp||a.hidden);u._executableFile=a.executableFile||null;if(c)u.arguments(c);this.commands.push(u);u.parent=this;u.copyInheritedSettings(this);if(o)return this;return u}createCommand(t){return new Command(t)}createHelp(){return Object.assign(new m,this.configureHelp())}configureHelp(t){if(t===undefined)return this._helpConfiguration;this._helpConfiguration=t;return this}configureOutput(t){if(t===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,t);return this}showHelpAfterError(t=true){if(typeof t!=="string")t=!!t;this._showHelpAfterError=t;return this}showSuggestionAfterError(t=true){this._showSuggestionAfterError=!!t;return this}addCommand(t,r){if(!t._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}r=r||{};if(r.isDefault)this._defaultCommandName=t._name;if(r.noHelp||r.hidden)t._hidden=true;this.commands.push(t);t.parent=this;return this}createArgument(t,r){return new h(t,r)}argument(t,r,i,o){const a=this.createArgument(t,r);if(typeof i==="function"){a.default(o).argParser(i)}else{a.default(i)}this.addArgument(a);return this}arguments(t){t.split(/ +/).forEach((t=>{this.argument(t)}));return this}addArgument(t){const r=this._args.slice(-1)[0];if(r&&r.variadic){throw new Error(`only the last argument can be variadic '${r.name()}'`)}if(t.required&&t.defaultValue!==undefined&&t.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${t.name()}'`)}this._args.push(t);return this}addHelpCommand(t,r){if(t===false){this._addImplicitHelpCommand=false}else{this._addImplicitHelpCommand=true;if(typeof t==="string"){this._helpCommandName=t.split(" ")[0];this._helpCommandnameAndArgs=t}this._helpCommandDescription=r||this._helpCommandDescription}return this}_hasImplicitHelpCommand(){if(this._addImplicitHelpCommand===undefined){return this.commands.length&&!this._actionHandler&&!this._findCommand("help")}return this._addImplicitHelpCommand}hook(t,r){const i=["preSubcommand","preAction","postAction"];if(!i.includes(t)){throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${i.join("', '")}'`)}if(this._lifeCycleHooks[t]){this._lifeCycleHooks[t].push(r)}else{this._lifeCycleHooks[t]=[r]}return this}exitOverride(t){if(t){this._exitCallback=t}else{this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync"){throw t}else{}}}return this}_exit(t,r,i){if(this._exitCallback){this._exitCallback(new p(t,r,i))}u.exit(t)}action(t){const listener=r=>{const i=this._args.length;const o=r.slice(0,i);if(this._storeOptionsAsProperties){o[i]=this}else{o[i]=this.opts()}o.push(this);return t.apply(this,o)};this._actionHandler=listener;return this}createOption(t,r){return new y(t,r)}addOption(t){const r=t.name();const i=t.attributeName();if(t.negate){const r=t.long.replace(/^--no-/,"--");if(!this._findOption(r)){this.setOptionValueWithSource(i,t.defaultValue===undefined?true:t.defaultValue,"default")}}else if(t.defaultValue!==undefined){this.setOptionValueWithSource(i,t.defaultValue,"default")}this.options.push(t);const handleOptionValue=(r,o,a)=>{if(r==null&&t.presetArg!==undefined){r=t.presetArg}const l=this.getOptionValue(i);if(r!==null&&t.parseArg){try{r=t.parseArg(r,l)}catch(t){if(t.code==="commander.invalidArgument"){const r=`${o} ${t.message}`;this.error(r,{exitCode:t.exitCode,code:t.code})}throw t}}else if(r!==null&&t.variadic){r=t._concatValue(r,l)}if(r==null){if(t.negate){r=false}else if(t.isBoolean()||t.optional){r=true}else{r=""}}this.setOptionValueWithSource(i,r,a)};this.on("option:"+r,(r=>{const i=`error: option '${t.flags}' argument '${r}' is invalid.`;handleOptionValue(r,i,"cli")}));if(t.envVar){this.on("optionEnv:"+r,(r=>{const i=`error: option '${t.flags}' value '${r}' from env '${t.envVar}' is invalid.`;handleOptionValue(r,i,"env")}))}return this}_optionEx(t,r,i,o,a){if(typeof r==="object"&&r instanceof y){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const l=this.createOption(r,i);l.makeOptionMandatory(!!t.mandatory);if(typeof o==="function"){l.default(a).argParser(o)}else if(o instanceof RegExp){const t=o;o=(r,i)=>{const o=t.exec(r);return o?o[0]:i};l.default(a).argParser(o)}else{l.default(o)}return this.addOption(l)}option(t,r,i,o){return this._optionEx({},t,r,i,o)}requiredOption(t,r,i,o){return this._optionEx({mandatory:true},t,r,i,o)}combineFlagAndOptionalValue(t=true){this._combineFlagAndOptionalValue=!!t;return this}allowUnknownOption(t=true){this._allowUnknownOption=!!t;return this}allowExcessArguments(t=true){this._allowExcessArguments=!!t;return this}enablePositionalOptions(t=true){this._enablePositionalOptions=!!t;return this}passThroughOptions(t=true){this._passThroughOptions=!!t;if(!!this.parent&&t&&!this.parent._enablePositionalOptions){throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)")}return this}storeOptionsAsProperties(t=true){this._storeOptionsAsProperties=!!t;if(this.options.length){throw new Error("call .storeOptionsAsProperties() before adding options")}return this}getOptionValue(t){if(this._storeOptionsAsProperties){return this[t]}return this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,undefined)}setOptionValueWithSource(t,r,i){if(this._storeOptionsAsProperties){this[t]=r}else{this._optionValues[t]=r}this._optionValueSources[t]=i;return this}getOptionValueSource(t){return this._optionValueSources[t]}_prepareUserArgs(t,r){if(t!==undefined&&!Array.isArray(t)){throw new Error("first parameter to parse must be array or undefined")}r=r||{};if(t===undefined){t=u.argv;if(u.versions&&u.versions.electron){r.from="electron"}}this.rawArgs=t.slice();let i;switch(r.from){case undefined:case"node":this._scriptPath=t[1];i=t.slice(2);break;case"electron":if(u.defaultApp){this._scriptPath=t[1];i=t.slice(2)}else{i=t.slice(1)}break;case"user":i=t.slice(0);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return i}parse(t,r){const i=this._prepareUserArgs(t,r);this._parseCommand([],i);return this}async parseAsync(t,r){const i=this._prepareUserArgs(t,r);await this._parseCommand([],i);return this}_executeSubCommand(t,r){r=r.slice();let i=false;const o=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(t,r){const i=l.resolve(t,r);if(c.existsSync(i))return i;if(o.includes(l.extname(r)))return undefined;const a=o.find((t=>c.existsSync(`${i}${t}`)));if(a)return`${i}${a}`;return undefined}this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();let h=t._executableFile||`${this._name}-${t._name}`;let d=this._executableDir||"";if(this._scriptPath){let t;try{t=c.realpathSync(this._scriptPath)}catch(r){t=this._scriptPath}d=l.resolve(l.dirname(t),d)}if(d){let r=findFile(d,h);if(!r&&!t._executableFile&&this._scriptPath){const i=l.basename(this._scriptPath,l.extname(this._scriptPath));if(i!==this._name){r=findFile(d,`${i}-${t._name}`)}}h=r||h}i=o.includes(l.extname(h));let m;if(u.platform!=="win32"){if(i){r.unshift(h);r=incrementNodeInspectorPort(u.execArgv).concat(r);m=a.spawn(u.argv[0],r,{stdio:"inherit"})}else{m=a.spawn(h,r,{stdio:"inherit"})}}else{r.unshift(h);r=incrementNodeInspectorPort(u.execArgv).concat(r);m=a.spawn(u.execPath,r,{stdio:"inherit"})}if(!m.killed){const t=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];t.forEach((t=>{u.on(t,(()=>{if(m.killed===false&&m.exitCode===null){m.kill(t)}}))}))}const y=this._exitCallback;if(!y){m.on("close",u.exit.bind(u))}else{m.on("close",(()=>{y(new p(u.exitCode||0,"commander.executeSubCommandAsync","(close)"))}))}m.on("error",(r=>{if(r.code==="ENOENT"){const r=d?`searched for local subcommand relative to directory '${d}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const i=`'${h}' does not exist\n - if '${t._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${r}`;throw new Error(i)}else if(r.code==="EACCES"){throw new Error(`'${h}' not executable`)}if(!y){u.exit(1)}else{const t=new p(1,"commander.executeSubCommandAsync","(error)");t.nestedError=r;y(t)}}));this.runningCommand=m}_dispatchSubcommand(t,r,i){const o=this._findCommand(t);if(!o)this.help({error:true});let a;a=this._chainOrCallSubCommandHook(a,o,"preSubcommand");a=this._chainOrCall(a,(()=>{if(o._executableHandler){this._executeSubCommand(o,r.concat(i))}else{return o._parseCommand(r,i)}}));return a}_checkNumberOfArguments(){this._args.forEach(((t,r)=>{if(t.required&&this.args[r]==null){this.missingArgument(t.name())}}));if(this._args.length>0&&this._args[this._args.length-1].variadic){return}if(this.args.length>this._args.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(t,r,i)=>{let o=r;if(r!==null&&t.parseArg){try{o=t.parseArg(r,i)}catch(i){if(i.code==="commander.invalidArgument"){const o=`error: command-argument value '${r}' is invalid for argument '${t.name()}'. ${i.message}`;this.error(o,{exitCode:i.exitCode,code:i.code})}throw i}}return o};this._checkNumberOfArguments();const t=[];this._args.forEach(((r,i)=>{let o=r.defaultValue;if(r.variadic){if(i<this.args.length){o=this.args.slice(i);if(r.parseArg){o=o.reduce(((t,i)=>myParseArg(r,i,t)),r.defaultValue)}}else if(o===undefined){o=[]}}else if(i<this.args.length){o=this.args[i];if(r.parseArg){o=myParseArg(r,o,r.defaultValue)}}t[i]=o}));this.processedArgs=t}_chainOrCall(t,r){if(t&&t.then&&typeof t.then==="function"){return t.then((()=>r()))}return r()}_chainOrCallHooks(t,r){let i=t;const o=[];getCommandAndParents(this).reverse().filter((t=>t._lifeCycleHooks[r]!==undefined)).forEach((t=>{t._lifeCycleHooks[r].forEach((r=>{o.push({hookedCommand:t,callback:r})}))}));if(r==="postAction"){o.reverse()}o.forEach((t=>{i=this._chainOrCall(i,(()=>t.callback(t.hookedCommand,this)))}));return i}_chainOrCallSubCommandHook(t,r,i){let o=t;if(this._lifeCycleHooks[i]!==undefined){this._lifeCycleHooks[i].forEach((t=>{o=this._chainOrCall(o,(()=>t(this,r)))}))}return o}_parseCommand(t,r){const i=this.parseOptions(r);this._parseOptionsEnv();this._parseOptionsImplied();t=t.concat(i.operands);r=i.unknown;this.args=t.concat(r);if(t&&this._findCommand(t[0])){return this._dispatchSubcommand(t[0],t.slice(1),r)}if(this._hasImplicitHelpCommand()&&t[0]===this._helpCommandName){if(t.length===1){this.help()}return this._dispatchSubcommand(t[1],[],[this._helpLongFlag])}if(this._defaultCommandName){outputHelpIfRequested(this,r);return this._dispatchSubcommand(this._defaultCommandName,t,r)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}outputHelpIfRequested(this,i.unknown);this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();const checkForUnknownOptions=()=>{if(i.unknown.length>0){this.unknownOption(i.unknown[0])}};const o=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let i;i=this._chainOrCallHooks(i,"preAction");i=this._chainOrCall(i,(()=>this._actionHandler(this.processedArgs)));if(this.parent){i=this._chainOrCall(i,(()=>{this.parent.emit(o,t,r)}))}i=this._chainOrCallHooks(i,"postAction");return i}if(this.parent&&this.parent.listenerCount(o)){checkForUnknownOptions();this._processArguments();this.parent.emit(o,t,r)}else if(t.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",t,r)}if(this.listenerCount("command:*")){this.emit("command:*",t,r)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(t){if(!t)return undefined;return this.commands.find((r=>r._name===t||r._aliases.includes(t)))}_findOption(t){return this.options.find((r=>r.is(t)))}_checkForMissingMandatoryOptions(){for(let t=this;t;t=t.parent){t.options.forEach((r=>{if(r.mandatory&&t.getOptionValue(r.attributeName())===undefined){t.missingMandatoryOptionValue(r)}}))}}_checkForConflictingLocalOptions(){const t=this.options.filter((t=>{const r=t.attributeName();if(this.getOptionValue(r)===undefined){return false}return this.getOptionValueSource(r)!=="default"}));const r=t.filter((t=>t.conflictsWith.length>0));r.forEach((r=>{const i=t.find((t=>r.conflictsWith.includes(t.attributeName())));if(i){this._conflictingOption(r,i)}}))}_checkForConflictingOptions(){for(let t=this;t;t=t.parent){t._checkForConflictingLocalOptions()}}parseOptions(t){const r=[];const i=[];let o=r;const a=t.slice();function maybeOption(t){return t.length>1&&t[0]==="-"}let l=null;while(a.length){const t=a.shift();if(t==="--"){if(o===i)o.push(t);o.push(...a);break}if(l&&!maybeOption(t)){this.emit(`option:${l.name()}`,t);continue}l=null;if(maybeOption(t)){const r=this._findOption(t);if(r){if(r.required){const t=a.shift();if(t===undefined)this.optionMissingArgument(r);this.emit(`option:${r.name()}`,t)}else if(r.optional){let t=null;if(a.length>0&&!maybeOption(a[0])){t=a.shift()}this.emit(`option:${r.name()}`,t)}else{this.emit(`option:${r.name()}`)}l=r.variadic?r:null;continue}}if(t.length>2&&t[0]==="-"&&t[1]!=="-"){const r=this._findOption(`-${t[1]}`);if(r){if(r.required||r.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${r.name()}`,t.slice(2))}else{this.emit(`option:${r.name()}`);a.unshift(`-${t.slice(2)}`)}continue}}if(/^--[^=]+=/.test(t)){const r=t.indexOf("=");const i=this._findOption(t.slice(0,r));if(i&&(i.required||i.optional)){this.emit(`option:${i.name()}`,t.slice(r+1));continue}}if(maybeOption(t)){o=i}if((this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(t)){r.push(t);if(a.length>0)i.push(...a);break}else if(t===this._helpCommandName&&this._hasImplicitHelpCommand()){r.push(t);if(a.length>0)r.push(...a);break}else if(this._defaultCommandName){i.push(t);if(a.length>0)i.push(...a);break}}if(this._passThroughOptions){o.push(t);if(a.length>0)o.push(...a);break}o.push(t)}return{operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){const t={};const r=this.options.length;for(let i=0;i<r;i++){const r=this.options[i].attributeName();t[r]=r===this._versionOptionName?this._version:this[r]}return t}return this._optionValues}optsWithGlobals(){return getCommandAndParents(this).reduce(((t,r)=>Object.assign(t,r.opts())),{})}error(t,r){this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const i=r||{};const o=i.exitCode||1;const a=i.code||"commander.error";this._exit(o,a,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in u.env){const r=t.attributeName();if(this.getOptionValue(r)===undefined||["default","config","env"].includes(this.getOptionValueSource(r))){if(t.required||t.optional){this.emit(`optionEnv:${t.name()}`,u.env[t.envVar])}else{this.emit(`optionEnv:${t.name()}`)}}}}))}_parseOptionsImplied(){const t=new b(this.options);const hasCustomOptionValue=t=>this.getOptionValue(t)!==undefined&&!["default","implied"].includes(this.getOptionValueSource(t));this.options.filter((r=>r.implied!==undefined&&hasCustomOptionValue(r.attributeName())&&t.valueFromOption(this.getOptionValue(r.attributeName()),r))).forEach((t=>{Object.keys(t.implied).filter((t=>!hasCustomOptionValue(t))).forEach((r=>{this.setOptionValueWithSource(r,t.implied[r],"implied")}))}))}missingArgument(t){const r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){const r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){const findBestOptionFromValue=t=>{const r=t.attributeName();const i=this.getOptionValue(r);const o=this.options.find((t=>t.negate&&r===t.attributeName()));const a=this.options.find((t=>!t.negate&&r===t.attributeName()));if(o&&(o.presetArg===undefined&&i===false||o.presetArg!==undefined&&i===o.presetArg)){return o}return a||t};const getErrorMessage=t=>{const r=findBestOptionFromValue(t);const i=r.attributeName();const o=this.getOptionValueSource(i);if(o==="env"){return`environment variable '${r.envVar}'`}return`option '${r.flags}'`};const i=`error: ${getErrorMessage(t)} cannot be used with ${getErrorMessage(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[];let o=this;do{const t=o.createHelp().visibleOptions(o).filter((t=>t.long)).map((t=>t.long));i=i.concat(t);o=o.parent}while(o&&!o._enablePositionalOptions);r=v(t,i)}const i=`error: unknown option '${t}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const r=this._args.length;const i=r===1?"":"s";const o=this.parent?` for '${this.name()}'`:"";const a=`error: too many arguments${o}. Expected ${r} argument${i} but got ${t.length}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let r="";if(this._showSuggestionAfterError){const i=[];this.createHelp().visibleCommands(this).forEach((t=>{i.push(t.name());if(t.alias())i.push(t.alias())}));r=v(t,i)}const i=`error: unknown command '${t}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(t,r,i){if(t===undefined)return this._version;this._version=t;r=r||"-V, --version";i=i||"output the version number";const o=this.createOption(r,i);this._versionOptionName=o.attributeName();this.options.push(o);this.on("option:"+o.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`);this._exit(0,"commander.version",t)}));return this}description(t,r){if(t===undefined&&r===undefined)return this._description;this._description=t;if(r){this._argsDescription=r}return this}summary(t){if(t===undefined)return this._summary;this._summary=t;return this}alias(t){if(t===undefined)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler){r=this.commands[this.commands.length-1]}if(t===r._name)throw new Error("Command alias can't be the same as its name");r._aliases.push(t);return this}aliases(t){if(t===undefined)return this._aliases;t.forEach((t=>this.alias(t)));return this}usage(t){if(t===undefined){if(this._usage)return this._usage;const t=this._args.map((t=>d(t)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?t:[]).join(" ")}this._usage=t;return this}name(t){if(t===undefined)return this._name;this._name=t;return this}nameFromFilename(t){this._name=l.basename(t,l.extname(t));return this}executableDir(t){if(t===undefined)return this._executableDir;this._executableDir=t;return this}helpInformation(t){const r=this.createHelp();if(r.helpWidth===undefined){r.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()}return r.formatHelp(this,r)}_getHelpContext(t){t=t||{};const r={error:!!t.error};let i;if(r.error){i=t=>this._outputConfiguration.writeErr(t)}else{i=t=>this._outputConfiguration.writeOut(t)}r.write=t.write||i;r.command=this;return r}outputHelp(t){let r;if(typeof t==="function"){r=t;t=undefined}const i=this._getHelpContext(t);getCommandAndParents(this).reverse().forEach((t=>t.emit("beforeAllHelp",i)));this.emit("beforeHelp",i);let o=this.helpInformation(i);if(r){o=r(o);if(typeof o!=="string"&&!Buffer.isBuffer(o)){throw new Error("outputHelp callback must return a string or a Buffer")}}i.write(o);this.emit(this._helpLongFlag);this.emit("afterHelp",i);getCommandAndParents(this).forEach((t=>t.emit("afterAllHelp",i)))}helpOption(t,r){if(typeof t==="boolean"){this._hasHelpOption=t;return this}this._helpFlags=t||this._helpFlags;this._helpDescription=r||this._helpDescription;const i=g(this._helpFlags);this._helpShortFlag=i.shortFlag;this._helpLongFlag=i.longFlag;return this}help(t){this.outputHelp(t);let r=u.exitCode||0;if(r===0&&t&&typeof t!=="function"&&t.error){r=1}this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){const i=["beforeAll","before","after","afterAll"];if(!i.includes(t)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${i.join("', '")}'`)}const o=`${t}Help`;this.on(o,(t=>{let i;if(typeof r==="function"){i=r({error:t.error,command:t.command})}else{i=r}if(i){t.write(`${i}\n`)}}));return this}}function outputHelpIfRequested(t,r){const i=t._hasHelpOption&&r.find((r=>r===t._helpLongFlag||r===t._helpShortFlag));if(i){t.outputHelp();t._exit(0,"commander.helpDisplayed","(outputHelp)")}}function incrementNodeInspectorPort(t){return t.map((t=>{if(!t.startsWith("--inspect")){return t}let r;let i="127.0.0.1";let o="9229";let a;if((a=t.match(/^(--inspect(-brk)?)$/))!==null){r=a[1]}else if((a=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){r=a[1];if(/^\d+$/.test(a[3])){o=a[3]}else{i=a[3]}}else if((a=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){r=a[1];i=a[3];o=a[4]}if(r&&o!=="0"){return`${r}=${i}:${parseInt(o)+1}`}return t}))}function getCommandAndParents(t){const r=[];for(let i=t;i;i=i.parent){r.push(i)}return r}r.Command=Command},9027:(t,r)=>{class CommanderError extends Error{constructor(t,r,i){super(i);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=r;this.exitCode=t;this.nestedError=undefined}}class InvalidArgumentError extends CommanderError{constructor(t){super(1,"commander.invalidArgument",t);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}r.CommanderError=CommanderError;r.InvalidArgumentError=InvalidArgumentError},9164:(t,r,i)=>{const{humanReadableArgName:o}=i(4079);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false}visibleCommands(t){const r=t.commands.filter((t=>!t._hidden));if(t._hasImplicitHelpCommand()){const[,i,o]=t._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/);const a=t.createCommand(i).helpOption(false);a.description(t._helpCommandDescription);if(o)a.arguments(o);r.push(a)}if(this.sortSubcommands){r.sort(((t,r)=>t.name().localeCompare(r.name())))}return r}visibleOptions(t){const r=t.options.filter((t=>!t.hidden));const i=t._hasHelpOption&&t._helpShortFlag&&!t._findOption(t._helpShortFlag);const o=t._hasHelpOption&&!t._findOption(t._helpLongFlag);if(i||o){let a;if(!i){a=t.createOption(t._helpLongFlag,t._helpDescription)}else if(!o){a=t.createOption(t._helpShortFlag,t._helpDescription)}else{a=t.createOption(t._helpFlags,t._helpDescription)}r.push(a)}if(this.sortOptions){const getSortKey=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");r.sort(((t,r)=>getSortKey(t).localeCompare(getSortKey(r))))}return r}visibleArguments(t){if(t._argsDescription){t._args.forEach((r=>{r.description=r.description||t._argsDescription[r.name()]||""}))}if(t._args.find((t=>t.description))){return t._args}return[]}subcommandTerm(t){const r=t._args.map((t=>o(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce(((t,i)=>Math.max(t,r.subcommandTerm(i).length)),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce(((t,i)=>Math.max(t,r.optionTerm(i).length)),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce(((t,i)=>Math.max(t,r.argumentTerm(i).length)),0)}commandUsage(t){let r=t._name;if(t._aliases[0]){r=r+"|"+t._aliases[0]}let i="";for(let r=t.parent;r;r=r.parent){i=r.name()+" "+i}return i+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){const r=[];if(t.argChoices){r.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){const i=t.required||t.optional||t.isBoolean()&&typeof t.defaultValue==="boolean";if(i){r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}}if(t.presetArg!==undefined&&t.optional){r.push(`preset: ${JSON.stringify(t.presetArg)}`)}if(t.envVar!==undefined){r.push(`env: ${t.envVar}`)}if(r.length>0){return`${t.description} (${r.join(", ")})`}return t.description}argumentDescription(t){const r=[];if(t.argChoices){r.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}if(r.length>0){const i=`(${r.join(", ")})`;if(t.description){return`${t.description} ${i}`}return i}return t.description}formatHelp(t,r){const i=r.padWidth(t,r);const o=r.helpWidth||80;const a=2;const l=2;function formatItem(t,c){if(c){const u=`${t.padEnd(i+l)}${c}`;return r.wrap(u,o-a,i+l)}return t}function formatList(t){return t.join("\n").replace(/^/gm," ".repeat(a))}let c=[`Usage: ${r.commandUsage(t)}`,""];const u=r.commandDescription(t);if(u.length>0){c=c.concat([u,""])}const h=r.visibleArguments(t).map((t=>formatItem(r.argumentTerm(t),r.argumentDescription(t))));if(h.length>0){c=c.concat(["Arguments:",formatList(h),""])}const d=r.visibleOptions(t).map((t=>formatItem(r.optionTerm(t),r.optionDescription(t))));if(d.length>0){c=c.concat(["Options:",formatList(d),""])}const p=r.visibleCommands(t).map((t=>formatItem(r.subcommandTerm(t),r.subcommandDescription(t))));if(p.length>0){c=c.concat(["Commands:",formatList(p),""])}return c.join("\n")}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}wrap(t,r,i,o=40){if(t.match(/[\n]\s+/))return t;const a=r-i;if(a<o)return t;const l=t.slice(0,i);const c=t.slice(i);const u=" ".repeat(i);const h=new RegExp(".{1,"+(a-1)+"}([\\s​]|$)|[^\\s​]+?([\\s​]|$)","g");const d=c.match(h)||[];return l+d.map(((t,r)=>{if(t.slice(-1)==="\n"){t=t.slice(0,t.length-1)}return(r>0?u:"")+t.trimRight()})).join("\n")}}r.Help=Help},5205:(t,r,i)=>{const{InvalidArgumentError:o}=i(9027);class Option{constructor(t,r){this.flags=t;this.description=r||"";this.required=t.includes("<");this.optional=t.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(t);this.mandatory=false;const i=splitOptionFlags(t);this.short=i.shortFlag;this.long=i.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined;this.conflictsWith=[];this.implied=undefined}default(t,r){this.defaultValue=t;this.defaultValueDescription=r;return this}preset(t){this.presetArg=t;return this}conflicts(t){this.conflictsWith=this.conflictsWith.concat(t);return this}implies(t){this.implied=Object.assign(this.implied||{},t);return this}env(t){this.envVar=t;return this}argParser(t){this.parseArg=t;return this}makeOptionMandatory(t=true){this.mandatory=!!t;return this}hideHelp(t=true){this.hidden=!!t;return this}_concatValue(t,r){if(r===this.defaultValue||!Array.isArray(r)){return[t]}return r.concat(t)}choices(t){this.argChoices=t.slice();this.parseArg=(t,r)=>{if(!this.argChoices.includes(t)){throw new o(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,r)}return t};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){return camelcase(this.name().replace(/^no-/,""))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class DualOptions{constructor(t){this.positiveOptions=new Map;this.negativeOptions=new Map;this.dualOptions=new Set;t.forEach((t=>{if(t.negate){this.negativeOptions.set(t.attributeName(),t)}else{this.positiveOptions.set(t.attributeName(),t)}}));this.negativeOptions.forEach(((t,r)=>{if(this.positiveOptions.has(r)){this.dualOptions.add(r)}}))}valueFromOption(t,r){const i=r.attributeName();if(!this.dualOptions.has(i))return true;const o=this.negativeOptions.get(i).presetArg;const a=o!==undefined?o:false;return r.negate===(a===t)}}function camelcase(t){return t.split("-").reduce(((t,r)=>t+r[0].toUpperCase()+r.slice(1)))}function splitOptionFlags(t){let r;let i;const o=t.split(/[ |,]+/);if(o.length>1&&!/^[[<]/.test(o[1]))r=o.shift();i=o.shift();if(!r&&/^-[^-]$/.test(i)){r=i;i=undefined}return{shortFlag:r,longFlag:i}}r.Option=Option;r.splitOptionFlags=splitOptionFlags;r.DualOptions=DualOptions},211:(t,r)=>{const i=3;function editDistance(t,r){if(Math.abs(t.length-r.length)>i)return Math.max(t.length,r.length);const o=[];for(let r=0;r<=t.length;r++){o[r]=[r]}for(let t=0;t<=r.length;t++){o[0][t]=t}for(let i=1;i<=r.length;i++){for(let a=1;a<=t.length;a++){let l=1;if(t[a-1]===r[i-1]){l=0}else{l=1}o[a][i]=Math.min(o[a-1][i]+1,o[a][i-1]+1,o[a-1][i-1]+l);if(a>1&&i>1&&t[a-1]===r[i-2]&&t[a-2]===r[i-1]){o[a][i]=Math.min(o[a][i],o[a-2][i-2]+1)}}}return o[t.length][r.length]}function suggestSimilar(t,r){if(!r||r.length===0)return"";r=Array.from(new Set(r));const o=t.startsWith("--");if(o){t=t.slice(2);r=r.map((t=>t.slice(2)))}let a=[];let l=i;const c=.4;r.forEach((r=>{if(r.length<=1)return;const i=editDistance(t,r);const o=Math.max(t.length,r.length);const u=(o-i)/o;if(u>c){if(i<l){l=i;a=[r]}else if(i===l){a.push(r)}}}));a.sort(((t,r)=>t.localeCompare(r)));if(o){a=a.map((t=>`--${t}`))}if(a.length>1){return`\n(Did you mean one of ${a.join(", ")}?)`}if(a.length===1){return`\n(Did you mean ${a[0]}?)`}return""}r.suggestSimilar=suggestSimilar}};var r={};function __nccwpck_require__(i){var o=r[i];if(o!==undefined){return o.exports}var a=r[i]={exports:{}};var l=true;try{t[i].call(a.exports,a,a.exports,__nccwpck_require__);l=false}finally{if(l)delete r[i]}return a.exports}(()=>{__nccwpck_require__.n=t=>{var r=t&&t.__esModule?()=>t["default"]:()=>t;__nccwpck_require__.d(r,{a:r});return r}})();(()=>{__nccwpck_require__.d=(t,r)=>{for(var i in r){if(__nccwpck_require__.o(r,i)&&!__nccwpck_require__.o(t,i)){Object.defineProperty(t,i,{enumerable:true,get:r[i]})}}}})();(()=>{__nccwpck_require__.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(889);module.exports=i})();