2 строки
75 KiB
JavaScript
2 строки
75 KiB
JavaScript
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).got=e()}}((function(){return function e(t,r,o){function s(i,a){if(!r[i]){if(!t[i]){var c="function"==typeof require&&require;if(!a&&c)return c(i,!0);if(n)return n(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[i]={exports:{}};t[i][0].call(l.exports,(function(e){return s(t[i][1][e]||e)}),l,l.exports,e,t,r,o)}return r[i].exports}for(var n="function"==typeof require&&require,i=0;i<o.length;i++)s(o[i]);return s}({1:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("events"),s=e("get-stream"),n=e("p-cancelable"),i=e("@sindresorhus/is"),a=e("./errors"),c=e("./normalize-arguments"),u=e("./request-as-event-emitter"),l=(e,t,r)=>{if("json"===t)return 0===e.length?"":JSON.parse(e.toString());if("buffer"===t)return Buffer.from(e);if("text"===t)return e.toString(r);throw new TypeError(`Unknown body type '${t}'`)};r.createRejection=function(e){const t=Promise.reject(e),r=()=>t;return t.json=r,t.text=r,t.buffer=r,t.on=r,t},r.default=function e(t){const r=new o;let d;const h=new n((o,n,i)=>{const h=u.default(t);i(h.abort);const f=async e=>{try{for(const r of t.hooks.beforeError)e=await r(e);n(e)}catch(e){n(e)}};h.on("response",async n=>{var u;r.emit("response",n);try{d=await s.buffer(n,{encoding:"binary"})}catch(e){return void f(new a.ReadError(e,t))}if(null===(u=n.req)||void 0===u?void 0:u.aborted)return;const p=()=>{const{statusCode:e}=n,r=t.followRedirect?299:399;return e>=200&&e<=r||304===e};try{n.body=l(d,t.responseType,t.encoding)}catch(e){if(n.body=d.toString(),p()){const r=new a.ParseError(e,n,t);return void f(r)}}try{for(const[r,o]of t.hooks.afterResponse.entries())n=await o(n,async o=>{const s=c.normalizeArguments(c.mergeOptions(t,{...o,retry:{calculateDelay:()=>0},throwHttpErrors:!1,resolveBodyOnly:!1}));s.hooks.afterResponse=t.hooks.afterResponse.slice(0,r);for(const e of t.hooks.beforeRetry)await e(s);const n=e(s);return i(()=>{n.catch(()=>{}),n.cancel()}),n})}catch(e){return void f(e)}if(!p()){const e=new a.HTTPError(n,t);if(h.retry(e))return;if(t.throwHttpErrors)return void f(e)}o(t.resolveBodyOnly?n.body:n)}),h.once("error",n),u.proxyEvents(r,h)});h.on=(e,t)=>(r.on(e,t),h);const f=e=>{const r=h.then(()=>l(d,e,t.encoding));return Object.defineProperties(r,Object.getOwnPropertyDescriptors(h)),r};return h.json=()=>(i.default.undefined(d)&&i.default.undefined(t.headers.accept)&&(t.headers.accept="application/json"),f("json")),h.buffer=()=>f("buffer"),h.text=()=>f("text"),h}},{"./errors":5,"./normalize-arguments":9,"./request-as-event-emitter":11,"@sindresorhus/is":23,events:void 0,"get-stream":34,"p-cancelable":42}],2:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("duplexer3"),s=e("http"),n=e("stream"),i=e("./errors"),a=e("./request-as-event-emitter");class c extends n.Duplex{}r.ProxyStream=c,r.default=function(e){const t=new n.PassThrough,r=new n.PassThrough,c=o(t,r),u=new Set;let l=!1;e.retry.calculateDelay=()=>0,e.body||e.json||e.form?c.write=()=>{throw c.destroy(),new Error("Got's stream is not writable when the `body`, `json` or `form` option is used")}:"POST"===e.method||"PUT"===e.method||"PATCH"===e.method||e.allowGetBody&&"GET"===e.method?e.body=t:c.write=()=>{throw c.destroy(),new TypeError(`The \`${e.method}\` method cannot be used with a body`)};const d=a.default(e),h=async t=>{try{for(const r of e.hooks.beforeError)t=await r(t);c.emit("error",t)}catch(e){c.emit("error",e)}};c._destroy=(e,t)=>{t(e),d.abort()},d.on("response",t=>{const{statusCode:o,isFromCache:s}=t;if(c.isFromCache=s,e.throwHttpErrors&&304!==o&&(o<200||o>299))h(new i.HTTPError(t,e));else{{const e=c._read;c._read=(...t)=>(l=!0,c._read=e,e.apply(c,t))}e.encoding&&c.setEncoding(e.encoding),t.pipe(r),t.once("error",t=>{h(new i.ReadError(t,e))});for(const r of u)if(!r.headersSent){for(const[o,s]of Object.entries(t.headers)){(!e.decompress||"content-encoding"!==o)&&r.setHeader(o,s)}r.statusCode=t.statusCode}c.emit("response",t)}}),a.proxyEvents(c,d),d.on("error",e=>c.emit("error",e));const f=c.pipe.bind(c),p=c.unpipe.bind(c);return c.pipe=(e,t)=>{if(l)throw new Error("Failed to pipe. The response has been emitted already.");return f(e,t),e instanceof s.ServerResponse&&u.add(e),e},c.unpipe=e=>(u.delete(e),p(e)),c.on("pipe",t=>{t instanceof s.IncomingMessage&&(e.headers={...t.headers,...e.headers})}),c.isFromCache=void 0,c}},{"./errors":5,"./request-as-event-emitter":11,duplexer3:31,http:void 0,stream:void 0}],3:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("@sindresorhus/is"),s=e("./errors"),n=new Set([413,429,503]),i=e=>e instanceof s.HTTPError||e instanceof s.ParseError||e instanceof s.MaxRedirectsError;r.default=({attemptCount:e,retryOptions:t,error:r})=>{if(e>t.limit)return 0;const s=t.methods.includes(r.options.method),a=Reflect.has(r,"code")&&t.errorCodes.includes(r.code),c=i(r)&&t.statusCodes.includes(r.response.statusCode);if(!s||!a&&!c)return 0;if(i(r)){const{response:e}=r;if(e&&Reflect.has(e.headers,"retry-after")&&n.has(e.statusCode)){let r=Number(e.headers["retry-after"]);return o.default.nan(r)?r=Date.parse(e.headers["retry-after"])-Date.now():r*=1e3,r>t.maxRetryAfter?0:r}if(413===e.statusCode)return 0}return 2**(e-1)*1e3+100*Math.random()}},{"./errors":5,"@sindresorhus/is":23}],4:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("@sindresorhus/is"),s=e("./as-promise"),n=e("./as-stream"),i=e("./errors"),a=e("./normalize-arguments"),c=e("./utils/deep-freeze"),u=e=>e.isStream?n.default(e):s.default(e),l=e=>Reflect.has(e,"defaults")&&Reflect.has(e.defaults,"options"),d=["get","post","put","patch","head","delete"];r.defaultHandler=(e,t)=>t(e);const h=e=>{e._rawHandlers=e.handlers,e.handlers=e.handlers.map(e=>(t,r)=>{let o;const s=e(t,e=>(o=r(e),o));if(s!==o&&!t.isStream&&o){const e=s,{then:t,catch:r,finally:n}=e;Object.setPrototypeOf(e,Object.getPrototypeOf(o)),Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)),e.then=t,e.catch=r,e.finally=n}return s});const t=(t,r)=>{var o;let n=0;const i=t=>e.handlers[n++](t,n===e.handlers.length?u:i);try{return i(a.normalizeArguments(t,r,e))}catch(e){if(null===(o=r)||void 0===o?void 0:o.isStream)throw e;return s.createRejection(e)}};t.extend=(...t)=>{const o=[e.options];let s,n=[...e._rawHandlers];for(const e of t)l(e)?(o.push(e.defaults.options),n.push(...e.defaults._rawHandlers),s=e.defaults.mutableDefaults):(o.push(e),Reflect.has(e,"handlers")&&n.push(...e.handlers),s=e.mutableDefaults);return n=n.filter(e=>e!==r.defaultHandler),0===n.length&&n.push(r.defaultHandler),h({options:a.mergeOptions(...o),handlers:n,mutableDefaults:Boolean(s)})},t.stream=(e,r)=>t(e,{...r,isStream:!0});for(const e of d)t[e]=(r,o)=>t(r,{...o,method:e}),t.stream[e]=(r,o)=>t.stream(r,{...o,method:e});return(t.paginate=async function*(r,s){let n=a.normalizeArguments(r,s,e);const i=n._pagination;if(!o.default.object(i))throw new Error("`options._pagination` must be implemented");const c=[];for(;;){const e=await t(n),r=await i.transform(e),o=[];for(const e of r)if(i.filter(e,c,o)){if(!i.shouldContinue(e,c,o))return;if(yield e,c.push(e),o.push(e),c.length===i.countLimit)return}const s=i.paginate(e,c,o);if(!1===s)return;void 0!==s&&(n=a.normalizeArguments(n,s))}}).all=async(e,r)=>{const o=[];for await(const s of t.paginate(e,r))o.push(s);return o},Object.assign(t,{...i,mergeOptions:a.mergeOptions}),Object.defineProperty(t,"defaults",{value:e.mutableDefaults?e:c.default(e),writable:e.mutableDefaults,configurable:e.mutableDefaults,enumerable:!0}),t};r.default=h},{"./as-promise":1,"./as-stream":2,"./errors":5,"./normalize-arguments":9,"./utils/deep-freeze":13,"@sindresorhus/is":23}],5:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("@sindresorhus/is");class s extends Error{constructor(e,t,r){if(super(e),Error.captureStackTrace(this,this.constructor),this.name="GotError",o.default.undefined(t.code)||(this.code=t.code),Object.defineProperty(this,"options",{enumerable:!1,value:r}),!o.default.undefined(t.stack)){const e=this.stack.indexOf(this.message)+this.message.length,r=this.stack.slice(e).split("\n").reverse(),o=t.stack.slice(t.stack.indexOf(t.message)+t.message.length).split("\n").reverse();for(;0!==o.length&&o[0]===r[0];)r.shift();this.stack=`${this.stack.slice(0,e)}${r.reverse().join("\n")}${o.reverse().join("\n")}`}}}r.GotError=s;r.CacheError=class extends s{constructor(e,t){super(e.message,e,t),this.name="CacheError"}};r.RequestError=class extends s{constructor(e,t){super(e.message,e,t),this.name="RequestError"}};r.ReadError=class extends s{constructor(e,t){super(e.message,e,t),this.name="ReadError"}};r.ParseError=class extends s{constructor(e,t,r){super(`${e.message} in "${r.url.toString()}"`,e,r),this.name="ParseError",Object.defineProperty(this,"response",{enumerable:!1,value:t})}};r.HTTPError=class extends s{constructor(e,t){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},t),this.name="HTTPError",Object.defineProperty(this,"response",{enumerable:!1,value:e})}};r.MaxRedirectsError=class extends s{constructor(e,t,r){super(`Redirected ${t} times. Aborting.`,{},r),this.name="MaxRedirectsError",Object.defineProperty(this,"response",{enumerable:!1,value:e})}};r.UnsupportedProtocolError=class extends s{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError"}};r.TimeoutError=class extends s{constructor(e,t,r){super(e.message,e,r),this.name="TimeoutError",this.event=e.event,this.timings=t}};var n=e("p-cancelable");r.CancelError=n.CancelError},{"@sindresorhus/is":23,"p-cancelable":42}],6:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("decompress-response"),s=e("mimic-response"),n=e("stream"),i=e("util"),a=e("./progress"),c=i.promisify(n.pipeline);r.default=async(e,t,r)=>{var n;const i=Number(e.headers["content-length"])||void 0,u=a.createProgressStream("downloadProgress",r,i);s(e,u);const l=t.decompress&&"HEAD"!==t.method?o(u):u;return!t.decompress&&["gzip","deflate","br"].includes(null!=(n=l.headers["content-encoding"])?n:"")&&(t.responseType="buffer"),r.emit("response",l),c(e,u).catch(e=>{if("ERR_STREAM_PREMATURE_CLOSE"!==e.code)throw e})}},{"./progress":10,"decompress-response":29,"mimic-response":39,stream:void 0,util:void 0}],7:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("url"),s=e("./create"),n={options:{method:"GET",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:void 0,calculateDelay:({computedValue:e})=>e},timeout:{},headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},decompress:!0,throwHttpErrors:!0,followRedirect:!0,isStream:!1,cache:!1,dnsCache:!1,useElectronNet:!1,responseType:"text",resolveBodyOnly:!1,maxRedirects:10,prefixUrl:"",methodRewriting:!0,allowGetBody:!1,ignoreInvalidCookies:!1,context:{},_pagination:{transform:e=>"json"===e.request.options.responseType?e.body:JSON.parse(e.body),paginate:e=>{if(!Reflect.has(e.headers,"link"))return!1;const t=e.headers.link.split(",");let r;for(const e of t){const t=e.split(";");if(t[1].includes("next")){r=t[0].trimStart().trim(),r=r.slice(1,-1);break}}if(r){return{url:new o.URL(r)}}return!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:1/0}},handlers:[s.defaultHandler],mutableDefaults:!1},i=s.default(n);r.default=i,t.exports=i,t.exports.default=i,function(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}(e("./types"));var a=e("./as-stream");r.ResponseStream=a.ProxyStream;var c=e("./errors");r.GotError=c.GotError,r.CacheError=c.CacheError,r.RequestError=c.RequestError,r.ReadError=c.ReadError,r.ParseError=c.ParseError,r.HTTPError=c.HTTPError,r.MaxRedirectsError=c.MaxRedirectsError,r.UnsupportedProtocolError=c.UnsupportedProtocolError,r.TimeoutError=c.TimeoutError,r.CancelError=c.CancelError},{"./as-stream":2,"./create":4,"./errors":5,"./types":12,url:void 0}],8:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.default=["beforeError","init","beforeRequest","beforeRedirect","beforeRetry","afterResponse"]},{}],9:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("url"),s=e("util"),n=e("cacheable-request"),i=e("http"),a=e("https"),c=e("lowercase-keys"),u=e("to-readable-stream"),l=e("@sindresorhus/is"),d=e("cacheable-lookup"),h=e("./errors"),f=e("./known-hook-events"),p=e("./utils/dynamic-require"),m=e("./utils/get-body-size"),y=e("./utils/is-form-data"),g=e("./utils/merge"),b=e("./utils/options-to-url"),v=e("./utils/supports-brotli"),w=e("./types"),_=["context","body","json","form"];r.preNormalizeArguments=(e,t)=>{var r,o,i,a,u,h;l.default.undefined(e.headers)?e.headers={}:e.headers=c(e.headers);for(const[t,r]of Object.entries(e.headers))if(l.default.null_(r))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${t}\` header`);if(l.default.urlInstance(e.prefixUrl)||l.default.string(e.prefixUrl)?(e.prefixUrl=e.prefixUrl.toString(),0===e.prefixUrl.length||e.prefixUrl.endsWith("/")||(e.prefixUrl+="/")):e.prefixUrl=t?t.prefixUrl:"",l.default.undefined(e.hooks)&&(e.hooks={}),!l.default.object(e.hooks))throw new TypeError(`Parameter \`hooks\` must be an Object, not ${l.default(e.hooks)}`);for(const t of f.default)if(Reflect.has(e.hooks,t)){if(!l.default.array(e.hooks[t]))throw new TypeError(`Parameter \`${t}\` must be an Array, not ${l.default(e.hooks[t])}`)}else e.hooks[t]=[];if(t)for(const r of f.default)Reflect.has(e.hooks,r)&&l.default.undefined(e.hooks[r])||(e.hooks[r]=[...t.hooks[r],...e.hooks[r]]);l.default.number(e.timeout)?e.timeout={request:e.timeout}:l.default.object(e.timeout)||(e.timeout={});const{retry:p}=e;if(e.retry=t?{...t.retry}:{calculateDelay:e=>e.computedValue,limit:0,methods:[],statusCodes:[],errorCodes:[],maxRetryAfter:void 0},l.default.object(p)?e.retry={...e.retry,...p}:l.default.number(p)&&(e.retry.limit=p),void 0===e.retry.maxRetryAfter&&(e.retry.maxRetryAfter=Math.min(...[e.timeout.request,e.timeout.connect].filter(e=>!l.default.nullOrUndefined(e)))),e.retry.methods=[...new Set(e.retry.methods.map(e=>e.toUpperCase()))],e.retry.statusCodes=[...new Set(e.retry.statusCodes)],e.retry.errorCodes=[...new Set(e.retry.errorCodes)],!e.dnsCache||e.dnsCache instanceof d.default||(e.dnsCache=new d.default({cacheAdapter:e.dnsCache})),l.default.string(e.method)?e.method=e.method.toUpperCase():e.method=null!=(o=null===(r=t)||void 0===r?void 0:r.method)?o:"GET",e.cache&&(e.cacheableRequest=new n((e,t)=>e[w.requestSymbol](e,t),e.cache)),l.default.object(e.cookieJar)){let{setCookie:t,getCookieString:r}=e.cookieJar;if(4===t.length&&0===r.length)Reflect.has(t,s.promisify.custom)||(t=s.promisify(t.bind(e.cookieJar)),r=s.promisify(r.bind(e.cookieJar)));else{if(2!==t.length)throw new TypeError("`options.cookieJar.setCookie` needs to be an async function with 2 arguments");if(1!==r.length)throw new TypeError("`options.cookieJar.getCookieString` needs to be an async function with 1 argument")}e.cookieJar={setCookie:t,getCookieString:r}}if(l.default.null_(e.encoding))throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");if(Reflect.has(e,"maxRedirects")||t&&Reflect.has(t,"maxRedirects")||(e.maxRedirects=0),t&&(e=g.default({},t,e)),l.default.object(e._pagination)){const{_pagination:t}=e;if(!l.default.function_(t.transform))throw new TypeError("`options._pagination.transform` must be implemented");if(!l.default.function_(t.shouldContinue))throw new TypeError("`options._pagination.shouldContinue` must be implemented");if(!l.default.function_(t.filter))throw new TypeError("`options._pagination.filter` must be implemented");if(!l.default.function_(t.paginate))throw new TypeError("`options._pagination.paginate` must be implemented")}return e.decompress=Boolean(e.decompress),e.isStream=Boolean(e.isStream),e.throwHttpErrors=Boolean(e.throwHttpErrors),e.ignoreInvalidCookies=Boolean(e.ignoreInvalidCookies),e.cache=null!=(i=e.cache)&&i,e.responseType=null!=(a=e.responseType)?a:"text",e.resolveBodyOnly=Boolean(e.resolveBodyOnly),e.followRedirect=Boolean(e.followRedirect),e.dnsCache=null!=(u=e.dnsCache)&&u,e.useElectronNet=Boolean(e.useElectronNet),e.methodRewriting=Boolean(e.methodRewriting),e.allowGetBody=Boolean(e.allowGetBody),e.context=null!=(h=e.context)?h:{},e},r.mergeOptions=(...e)=>{let t=r.preNormalizeArguments({});const o={};for(const s of e){t=r.preNormalizeArguments(g.default({},s),t);for(const e of _)Reflect.has(s,e)&&(o[e]={writable:!0,configurable:!0,enumerable:!1,value:s[e]})}return Object.defineProperties(t,o),t},r.normalizeArguments=(e,t,s)=>{var n,i,a,c,u,d,h,f,p,m;if(void 0===e)throw new TypeError("Missing `url` argument");const y=(e,t)=>{if(e&&t)for(const r of e){const e=r(t);if(l.default.promise(e))throw new TypeError("The `init` hook must be a synchronous function")}},g=l.default.urlInstance(e)||l.default.string(e);if(g){if(t){if(Reflect.has(t,"url"))throw new TypeError("The `url` option cannot be used if the input is a valid URL.")}else t={};t.url=e,y(null===(n=s)||void 0===n?void 0:n.options.hooks.init,t),y(null===(i=t.hooks)||void 0===i?void 0:i.init,t)}else{if(Reflect.has(e,"resolve"))throw new Error("The legacy `url.Url` is deprecated. Use `URL` instead.");y(null===(a=s)||void 0===a?void 0:a.options.hooks.init,e),y(null===(c=e.hooks)||void 0===c?void 0:c.init,e),t&&(y(null===(u=s)||void 0===u?void 0:u.options.hooks.init,t),y(null===(d=t.hooks)||void 0===d?void 0:d.init,t))}t=g?r.mergeOptions(null!=(f=null===(h=s)||void 0===h?void 0:h.options)?f:{},null!=t?t:{}):r.mergeOptions(null!=(m=null===(p=s)||void 0===p?void 0:p.options)?m:{},e,null!=t?t:{}),l.default.string(t.url)?(t.url=t.prefixUrl+t.url,t.url=t.url.replace(/^unix:/,"http://$&"),(t.searchParams||t.search)&&(t.url=t.url.split("?")[0]),t.url=b.default({origin:t.url,...t})):l.default.urlInstance(t.url)||(t.url=b.default({origin:t.prefixUrl,...t}));const v=t;let w=t.prefixUrl;Object.defineProperty(v,"prefixUrl",{set:e=>{if(!v.url.href.startsWith(e))throw new Error(`Cannot change \`prefixUrl\` from ${w} to ${e}: ${v.url.href}`);v.url=new o.URL(e+v.url.href.slice(w.length)),w=e},get:()=>w});for(const[e,t]of Object.entries(v.headers))l.default.undefined(t)&&delete v.headers[e];return v};const E=new Set(["HEAD"]);r.normalizeRequestArguments=async e=>{var n,c,d;e=r.mergeOptions(e);const{headers:f}=e,g=l.default.undefined(f["content-type"]);{const t=!l.default.undefined(e.form),r=!l.default.undefined(e.json),o=!l.default.undefined(e.body);if((o||t||r)&&E.has(e.method))throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);if(!e.allowGetBody&&(o||t||r)&&"GET"===e.method)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);if([o,t,r].filter(e=>e).length>1)throw new TypeError("The `body`, `json` and `form` options are mutually exclusive");if(o&&!l.default.nodeStream(e.body)&&!l.default.string(e.body)&&!l.default.buffer(e.body)&&(!l.default.object(e.body)||!y.default(e.body)))throw new TypeError("The `body` option must be a stream.Readable, string or Buffer");if(t&&!l.default.object(e.form))throw new TypeError("The `form` option must be an Object")}e.body?l.default.object(e.body)&&y.default(e.body)&&g&&(f["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`):e.form?(g&&(f["content-type"]="application/x-www-form-urlencoded"),e.body=new o.URLSearchParams(e.form).toString()):e.json&&(g&&(f["content-type"]="application/json"),e.body=JSON.stringify(e.json));const b=await m.default(e);if(l.default.nodeStream(e.body)||(e.body=u(e.body)),l.default.undefined(f["content-length"])&&l.default.undefined(f["transfer-encoding"])&&("POST"===e.method||"PUT"===e.method||"PATCH"===e.method||"DELETE"===e.method||e.allowGetBody&&"GET"===e.method)&&!l.default.undefined(b)&&(f["content-length"]=String(b)),!e.isStream&&"json"===e.responseType&&l.default.undefined(f.accept)&&(f.accept="application/json"),e.decompress&&l.default.undefined(f["accept-encoding"])&&(f["accept-encoding"]=v.default?"gzip, deflate, br":"gzip, deflate"),"http:"!==e.url.protocol&&"https:"!==e.url.protocol)throw new h.UnsupportedProtocolError(e);if(decodeURI(e.url.toString()),l.default.function_(e.request)?(e[w.requestSymbol]=e.request,delete e.request):e[w.requestSymbol]="https:"===e.url.protocol?a.request:i.request,"unix"===e.url.hostname){const t=/(?<socketPath>.+?):(?<path>.+)/.exec(e.url.pathname);if(null===(n=t)||void 0===n?void 0:n.groups){const{socketPath:r,path:o}=t.groups;e={...e,socketPath:r,path:o,host:""}}}var _;if(_=e.agent,l.default.object(_)&&(e.agent=null!=(c=e.agent[e.url.protocol.slice(0,-1)])?c:e.agent),e.dnsCache&&(e.lookup=e.dnsCache.lookup),e.useElectronNet&&process.versions.electron){const r=p.default(t,"electron");e.request=s.deprecate(null!=(d=r.net.request)?d:r.remote.net.request,"Electron support has been deprecated and will be removed in Got 11.\nSee https://github.com/sindresorhus/got/issues/899 for further information.","GOT_ELECTRON")}if(delete e.timeout,e.cookieJar){const t=await e.cookieJar.getCookieString(e.url.toString());l.default.nonEmptyString(t)?e.headers.cookie=t:delete e.headers.cookie}return delete e.url,e}},{"./errors":5,"./known-hook-events":8,"./types":12,"./utils/dynamic-require":14,"./utils/get-body-size":15,"./utils/is-form-data":16,"./utils/merge":17,"./utils/options-to-url":18,"./utils/supports-brotli":19,"@sindresorhus/is":23,"cacheable-lookup":25,"cacheable-request":26,http:void 0,https:void 0,"lowercase-keys":38,"to-readable-stream":48,url:void 0,util:void 0}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("stream"),s=e("@sindresorhus/is");r.createProgressStream=function(e,t,r){let n=0;s.default.string(r)&&(r=Number(r));const i=new o.Transform({transform(o,s,i){n+=o.length;const a=r?n/r:0;a<1&&t.emit(e,{percent:a,transferred:n,total:r}),i(void 0,o)},flush(o){t.emit(e,{percent:1,transferred:n,total:r}),o()}});return t.emit(e,{percent:0,transferred:0,total:r}),i}},{"@sindresorhus/is":23,stream:void 0}],11:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("fs"),s=e("cacheable-request"),n=e("events"),i=e("http"),a=e("stream"),c=e("url"),u=e("util"),l=e("@sindresorhus/is"),d=e("@szmarczak/http-timer"),h=e("./calculate-retry-delay"),f=e("./errors"),p=e("./get-response"),m=e("./normalize-arguments"),y=e("./progress"),g=e("./utils/timed-out"),b=e("./types"),v=e("./utils/url-to-options"),w=e("p-event"),_=u.promisify(a.pipeline),E=new Set([300,301,302,303,304,307,308]);r.default=e=>{const t=new n,r=e.url.toString(),a=[];let u,x=0;const P=()=>"number"==typeof u.aborted||u.aborted,O=async r=>{try{for(const t of e.hooks.beforeError)r=await t(r);t.emit("error",r)}catch(e){t.emit("error",e)}},T=async()=>{let o=await m.normalizeRequestArguments(e);const n=async o=>{var s;try{e.useElectronNet&&(o=new Proxy(o,{get:(e,t)=>{if("trailers"===t||"rawTrailers"===t)return[];const r=e[t];return l.default.function_(r)?r.bind(e):r}}));const n=o,{statusCode:u}=n;n.statusMessage=l.default.nonEmptyString(n.statusMessage)?n.statusMessage:i.STATUS_CODES[u],n.url=e.url.toString(),n.requestUrl=r,n.retryCount=x,n.redirectUrls=a,n.request={options:e},n.isFromCache=null!=(s=n.fromCache)&&s,delete n.fromCache,n.isFromCache||(n.ip=o.socket.remoteAddress);const d=n.headers["set-cookie"];if(Reflect.has(e,"cookieJar")&&d){let t=d.map(async t=>e.cookieJar.setCookie(t,n.url));e.ignoreInvalidCookies&&(t=t.map(async e=>e.catch(()=>{}))),await Promise.all(t)}if(e.followRedirect&&Reflect.has(n.headers,"location")&&E.has(u)){if(n.resume(),303!==u&&!1!==e.methodRewriting||("GET"!==e.method&&"HEAD"!==e.method&&(e.method="GET"),Reflect.has(e,"body")&&delete e.body,Reflect.has(e,"json")&&delete e.json,Reflect.has(e,"form")&&delete e.form),a.length>=e.maxRedirects)throw new f.MaxRedirectsError(n,e.maxRedirects,e);const r=Buffer.from(n.headers.location,"binary").toString(),s=new c.URL(r,e.url);s.hostname!==e.url.hostname&&Reflect.has(e.headers,"cookie")&&delete e.headers.cookie,a.push(s.toString()),e.url=s;for(const t of e.hooks.beforeRedirect)await t(e,n);return t.emit("redirect",o,e),void await T()}await p.default(n,e,t)}catch(e){O(e)}},h=async r=>{let s=!1,n=!1;r.once("finish",()=>{n=!0}),u=r;const i=o=>{o=o instanceof g.TimeoutError?new f.TimeoutError(o,r.timings,e):new f.RequestError(o,e),t.retry(o)||O(o)};r.on("error",e=>{if(s){if(!n)return;if(P()&&!(e instanceof g.TimeoutError))return}i(e)});try{d.default(r),g.default(r,e.timeout,e.url),t.emit("request",r);const n=y.createProgressStream("uploadProgress",t,o.headers["content-length"]);s=!0,await _(o.body,n,r),r.emit("upload-complete")}catch(e){if(P()&&"Premature close"===e.message)return;i(e)}};if(e.cache){o={...o,...v.default(e.url)};const t=e.cacheableRequest(o,n);t.once("error",t=>{t instanceof s.RequestError?O(new f.RequestError(t,e)):O(new f.CacheError(t,e))}),t.once("request",h)}else try{h(o[b.requestSymbol](e.url,o,n))}catch(t){O(new f.RequestError(t,e))}};return t.retry=t=>{let r;x++;try{r=e.retry.calculateDelay({attemptCount:x,retryOptions:e.retry,error:t,computedValue:h.default({attemptCount:x,retryOptions:e.retry,error:t,computedValue:0})})}catch(e){return O(e),!1}if(r){return setTimeout(async e=>{try{for(const r of e.hooks.beforeRetry)await r(e,t,x);await T()}catch(e){O(e)}},r,{...e,forceRefresh:!0}),!0}return!1},t.abort=()=>{t.prependListener("request",e=>{e.abort()}),u&&u.abort()},(async()=>{try{e.body instanceof o.ReadStream&&await w(e.body,"open"),await(async()=>new Promise(e=>setImmediate(e)))();for(const t of e.hooks.beforeRequest)await t(e);await T()}catch(e){O(e)}})(),t},r.proxyEvents=(e,t)=>{const r=["request","redirect","uploadProgress","downloadProgress"];for(const o of r)t.on(o,(...t)=>{e.emit(o,...t)})}},{"./calculate-retry-delay":3,"./errors":5,"./get-response":6,"./normalize-arguments":9,"./progress":10,"./types":12,"./utils/timed-out":20,"./utils/url-to-options":22,"@sindresorhus/is":23,"@szmarczak/http-timer":24,"cacheable-request":26,events:void 0,fs:void 0,http:void 0,"p-event":43,stream:void 0,url:void 0,util:void 0}],12:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.requestSymbol=Symbol("request")},{}],13:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("@sindresorhus/is");r.default=function e(t){for(const r of Object.values(t))(o.default.plainObject(r)||o.default.array(r))&&e(r);return Object.freeze(t)}},{"@sindresorhus/is":23}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=(e,t)=>e.require(t)},{}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("fs"),s=e("util"),n=e("@sindresorhus/is"),i=e("./is-form-data"),a=s.promisify(o.stat);r.default=async e=>{const{body:t,headers:r}=e;if(r&&"content-length"in r)return Number(r["content-length"]);if(!t)return 0;if(n.default.string(t))return Buffer.byteLength(t);if(n.default.buffer(t))return t.length;if(i.default(t))return s.promisify(t.getLength.bind(t))();if(t instanceof o.ReadStream){const{size:e}=await a(t.path);return e}}},{"./is-form-data":16,"@sindresorhus/is":23,fs:void 0,util:void 0}],16:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("@sindresorhus/is");r.default=e=>o.default.nodeStream(e)&&o.default.function_(e.getBoundary)},{"@sindresorhus/is":23}],17:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("url"),s=e("@sindresorhus/is");r.default=function e(t,...r){for(const n of r)for(const[r,i]of Object.entries(n)){const n=t[r];s.default.urlInstance(n)&&s.default.string(i)?t[r]=new o.URL(i,n):s.default.plainObject(i)?s.default.plainObject(n)?t[r]=e({},n,i):t[r]=e({},i):s.default.array(i)?t[r]=i.slice():t[r]=i}return t}},{"@sindresorhus/is":23,url:void 0}],18:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("url");const s=["protocol","username","password","host","hostname","port","pathname","search","hash"];r.default=e=>{var t,r;let n;if(e.path){if(e.pathname)throw new TypeError("Parameters `path` and `pathname` are mutually exclusive.");if(e.search)throw new TypeError("Parameters `path` and `search` are mutually exclusive.");if(e.searchParams)throw new TypeError("Parameters `path` and `searchParams` are mutually exclusive.")}if(Reflect.has(e,"auth"))throw new TypeError("Parameter `auth` is deprecated. Use `username` / `password` instead.");if(e.search&&e.searchParams)throw new TypeError("Parameters `search` and `searchParams` are mutually exclusive.");if(e.href)return new o.URL(e.href);if(e.origin)n=e.origin;else{if(!e.protocol)throw new TypeError("No URL protocol specified");n=`${e.protocol}//${t=e.hostname,r=null!=t?t:e.host,null!=r?r:""}`}const i=new o.URL(n);if(e.path){const t=e.path.indexOf("?");-1===t?e.pathname=e.path:(e.pathname=e.path.slice(0,t),e.search=e.path.slice(t+1))}Reflect.has(e,"path")&&delete e.path;for(const t of s)Reflect.has(e,t)&&(i[t]=e[t].toString());return e.searchParams&&("string"==typeof e.searchParams||e.searchParams instanceof o.URLSearchParams||function(e){for(const t of Object.values(e))if("string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t&&null!==t)throw new TypeError(`The \`searchParams\` value '${String(t)}' must be a string, number, boolean or null`)}(e.searchParams),new o.URLSearchParams(e.searchParams).forEach((e,t)=>{i.searchParams.append(t,e)})),i}},{url:void 0}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("zlib");r.default="function"==typeof o.createBrotliDecompress},{zlib:void 0}],20:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("net"),s=e("./unhandle"),n=Symbol("reentry"),i=()=>{};class a extends Error{constructor(e,t){super(`Timeout awaiting '${t}' for ${e}ms`),this.event=t,this.name="TimeoutError",this.code="ETIMEDOUT"}}r.TimeoutError=a,r.default=(e,t,r)=>{if(Reflect.has(e,n))return i;e[n]=!0;const c=[],{once:u,unhandleAll:l}=s.default(),d=(e,t,r)=>{var o,s;const n=setTimeout(t,e,e,r);null===(s=(o=n).unref)||void 0===s||s.call(o);const i=()=>{clearTimeout(n)};return c.push(i),i},{host:h,hostname:f}=r,p=(t,r)=>{e.socket&&(e.socket._hadError=!0),e.abort(),e.emit("error",new a(t,r))},m=()=>{for(const e of c)e();l()};if(e.once("error",t=>{if(m(),0===e.listenerCount("error"))throw t}),e.once("abort",m),u(e,"response",e=>{u(e,"end",m)}),void 0!==t.request&&d(t.request,p,"request"),void 0!==t.socket){const r=()=>{p(t.socket,"socket")};e.setTimeout(t.socket,r),c.push(()=>{e.removeListener("timeout",r)})}return u(e,"socket",s=>{var n;const{socketPath:i}=e;if(s.connecting){const e=Boolean(null!=i?i:0!==o.isIP(null!=(n=null!=f?f:h)?n:""));if(void 0!==t.lookup&&!e&&void 0===s.address().address){const e=d(t.lookup,p,"lookup");u(s,"lookup",e)}if(void 0!==t.connect){const r=()=>d(t.connect,p,"connect");e?u(s,"connect",r()):u(s,"lookup",e=>{null===e&&u(s,"connect",r())})}void 0!==t.secureConnect&&"https:"===r.protocol&&u(s,"connect",()=>{const e=d(t.secureConnect,p,"secureConnect");u(s,"secureConnect",e)})}if(void 0!==t.send){const r=()=>d(t.send,p,"send");s.connecting?u(s,"connect",()=>{u(e,"upload-complete",r())}):u(e,"upload-complete",r())}}),void 0!==t.response&&u(e,"upload-complete",()=>{const r=d(t.response,p,"response");u(e,"response",r)}),m}},{"./unhandle":21,net:void 0}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=()=>{const e=[];return{once(t,r,o){t.once(r,o),e.push({origin:t,event:r,fn:o})},unhandleAll(){for(const t of e){const{origin:e,event:r,fn:o}=t;e.removeListener(r,o)}e.length=0}}}},{}],22:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("@sindresorhus/is");r.default=e=>{const t={protocol:(e=e).protocol,hostname:o.default.string(e.hostname)&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,host:e.host,hash:e.hash,search:e.search,pathname:e.pathname,href:e.href,path:`${e.pathname||""}${e.search||""}`};return o.default.string(e.port)&&0!==e.port.length&&(t.port=Number(e.port)),(e.username||e.password)&&(t.auth=`${e.username||""}:${e.password||""}`),t}},{"@sindresorhus/is":23}],23:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const{toString:o}=Object.prototype,s=e=>t=>typeof t===e,n=e=>{const t=o.call(e).slice(8,-1);if(t)return t},i=e=>t=>n(t)===e;function a(e){switch(e){case null:return"null";case!0:case!1:return"boolean"}switch(typeof e){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"bigint":return"bigint";case"symbol":return"symbol"}if(a.function_(e))return"Function";if(a.observable(e))return"Observable";if(a.array(e))return"Array";if(a.buffer(e))return"Buffer";const t=n(e);if(t)return t;if(e instanceof String||e instanceof Boolean||e instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}a.undefined=s("undefined"),a.string=s("string");const c=s("number");a.number=e=>c(e)&&!a.nan(e),a.bigint=s("bigint"),a.function_=s("function"),a.null_=e=>null===e,a.class_=e=>a.function_(e)&&e.toString().startsWith("class "),a.boolean=e=>!0===e||!1===e,a.symbol=s("symbol"),a.numericString=e=>a.string(e)&&e.length>0&&!Number.isNaN(Number(e)),a.array=Array.isArray,a.buffer=e=>!a.nullOrUndefined(e)&&!a.nullOrUndefined(e.constructor)&&a.function_(e.constructor.isBuffer)&&e.constructor.isBuffer(e),a.nullOrUndefined=e=>a.null_(e)||a.undefined(e),a.object=e=>!a.null_(e)&&("object"==typeof e||a.function_(e)),a.iterable=e=>!a.nullOrUndefined(e)&&a.function_(e[Symbol.iterator]),a.asyncIterable=e=>!a.nullOrUndefined(e)&&a.function_(e[Symbol.asyncIterator]),a.generator=e=>a.iterable(e)&&a.function_(e.next)&&a.function_(e.throw),a.asyncGenerator=e=>a.asyncIterable(e)&&a.function_(e.next)&&a.function_(e.throw),a.nativePromise=e=>i("Promise")(e);a.promise=e=>a.nativePromise(e)||(e=>a.object(e)&&a.function_(e.then)&&a.function_(e.catch))(e),a.generatorFunction=i("GeneratorFunction"),a.asyncGeneratorFunction=e=>"AsyncGeneratorFunction"===n(e),a.asyncFunction=e=>"AsyncFunction"===n(e),a.boundFunction=e=>a.function_(e)&&!e.hasOwnProperty("prototype"),a.regExp=i("RegExp"),a.date=i("Date"),a.error=i("Error"),a.map=e=>i("Map")(e),a.set=e=>i("Set")(e),a.weakMap=e=>i("WeakMap")(e),a.weakSet=e=>i("WeakSet")(e),a.int8Array=i("Int8Array"),a.uint8Array=i("Uint8Array"),a.uint8ClampedArray=i("Uint8ClampedArray"),a.int16Array=i("Int16Array"),a.uint16Array=i("Uint16Array"),a.int32Array=i("Int32Array"),a.uint32Array=i("Uint32Array"),a.float32Array=i("Float32Array"),a.float64Array=i("Float64Array"),a.bigInt64Array=i("BigInt64Array"),a.bigUint64Array=i("BigUint64Array"),a.arrayBuffer=i("ArrayBuffer"),a.sharedArrayBuffer=i("SharedArrayBuffer"),a.dataView=i("DataView"),a.directInstanceOf=(e,t)=>Object.getPrototypeOf(e)===t.prototype,a.urlInstance=e=>i("URL")(e),a.urlString=e=>{if(!a.string(e))return!1;try{return new URL(e),!0}catch(e){return!1}},a.truthy=e=>Boolean(e),a.falsy=e=>!e,a.nan=e=>Number.isNaN(e);const u=new Set(["undefined","string","number","bigint","boolean","symbol"]);a.primitive=e=>a.null_(e)||u.has(typeof e),a.integer=e=>Number.isInteger(e),a.safeInteger=e=>Number.isSafeInteger(e),a.plainObject=e=>{if("Object"!==n(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.getPrototypeOf({})};const l=new Set(["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"]);a.typedArray=e=>{const t=n(e);return void 0!==t&&l.has(t)};a.arrayLike=e=>!a.nullOrUndefined(e)&&!a.function_(e)&&(e=>a.safeInteger(e)&&e>=0)(e.length),a.inRange=(e,t)=>{if(a.number(t))return e>=Math.min(0,t)&&e<=Math.max(t,0);if(a.array(t)&&2===t.length)return e>=Math.min(...t)&&e<=Math.max(...t);throw new TypeError(`Invalid range: ${JSON.stringify(t)}`)};const d=["innerHTML","ownerDocument","style","attributes","nodeValue"];a.domElement=e=>a.object(e)&&1===e.nodeType&&a.string(e.nodeName)&&!a.plainObject(e)&&d.every(t=>t in e),a.observable=e=>!!e&&(!(!e[Symbol.observable]||e!==e[Symbol.observable]())||!(!e["@@observable"]||e!==e["@@observable"]())),a.nodeStream=e=>a.object(e)&&a.function_(e.pipe)&&!a.observable(e),a.infinite=e=>e===1/0||e===-1/0;const h=e=>t=>a.integer(t)&&Math.abs(t%2)===e;a.evenInteger=h(0),a.oddInteger=h(1),a.emptyArray=e=>a.array(e)&&0===e.length,a.nonEmptyArray=e=>a.array(e)&&e.length>0,a.emptyString=e=>a.string(e)&&0===e.length,a.nonEmptyString=e=>a.string(e)&&e.length>0;a.emptyStringOrWhitespace=e=>a.emptyString(e)||(e=>a.string(e)&&!1===/\S/.test(e))(e),a.emptyObject=e=>a.object(e)&&!a.map(e)&&!a.set(e)&&0===Object.keys(e).length,a.nonEmptyObject=e=>a.object(e)&&!a.map(e)&&!a.set(e)&&Object.keys(e).length>0,a.emptySet=e=>a.set(e)&&0===e.size,a.nonEmptySet=e=>a.set(e)&&e.size>0,a.emptyMap=e=>a.map(e)&&0===e.size,a.nonEmptyMap=e=>a.map(e)&&e.size>0;const f=(e,t,r)=>{if(!1===a.function_(t))throw new TypeError(`Invalid predicate: ${JSON.stringify(t)}`);if(0===r.length)throw new TypeError("Invalid number of values");return e.call(r,t)};a.any=(e,...t)=>(a.array(e)?e:[e]).some(e=>f(Array.prototype.some,e,t)),a.all=(e,...t)=>f(Array.prototype.every,e,t);const p=(e,t,r)=>{if(!e)throw new TypeError(`Expected value which is \`${t}\`, received value of type \`${a(r)}\`.`)};r.assert={undefined:e=>p(a.undefined(e),"undefined",e),string:e=>p(a.string(e),"string",e),number:e=>p(a.number(e),"number",e),bigint:e=>p(a.bigint(e),"bigint",e),function_:e=>p(a.function_(e),"Function",e),null_:e=>p(a.null_(e),"null",e),class_:e=>p(a.class_(e),"Class",e),boolean:e=>p(a.boolean(e),"boolean",e),symbol:e=>p(a.symbol(e),"symbol",e),numericString:e=>p(a.numericString(e),"string with a number",e),array:e=>p(a.array(e),"Array",e),buffer:e=>p(a.buffer(e),"Buffer",e),nullOrUndefined:e=>p(a.nullOrUndefined(e),"null or undefined",e),object:e=>p(a.object(e),"Object",e),iterable:e=>p(a.iterable(e),"Iterable",e),asyncIterable:e=>p(a.asyncIterable(e),"AsyncIterable",e),generator:e=>p(a.generator(e),"Generator",e),asyncGenerator:e=>p(a.asyncGenerator(e),"AsyncGenerator",e),nativePromise:e=>p(a.nativePromise(e),"native Promise",e),promise:e=>p(a.promise(e),"Promise",e),generatorFunction:e=>p(a.generatorFunction(e),"GeneratorFunction",e),asyncGeneratorFunction:e=>p(a.asyncGeneratorFunction(e),"AsyncGeneratorFunction",e),asyncFunction:e=>p(a.asyncFunction(e),"AsyncFunction",e),boundFunction:e=>p(a.boundFunction(e),"Function",e),regExp:e=>p(a.regExp(e),"RegExp",e),date:e=>p(a.date(e),"Date",e),error:e=>p(a.error(e),"Error",e),map:e=>p(a.map(e),"Map",e),set:e=>p(a.set(e),"Set",e),weakMap:e=>p(a.weakMap(e),"WeakMap",e),weakSet:e=>p(a.weakSet(e),"WeakSet",e),int8Array:e=>p(a.int8Array(e),"Int8Array",e),uint8Array:e=>p(a.uint8Array(e),"Uint8Array",e),uint8ClampedArray:e=>p(a.uint8ClampedArray(e),"Uint8ClampedArray",e),int16Array:e=>p(a.int16Array(e),"Int16Array",e),uint16Array:e=>p(a.uint16Array(e),"Uint16Array",e),int32Array:e=>p(a.int32Array(e),"Int32Array",e),uint32Array:e=>p(a.uint32Array(e),"Uint32Array",e),float32Array:e=>p(a.float32Array(e),"Float32Array",e),float64Array:e=>p(a.float64Array(e),"Float64Array",e),bigInt64Array:e=>p(a.bigInt64Array(e),"BigInt64Array",e),bigUint64Array:e=>p(a.bigUint64Array(e),"BigUint64Array",e),arrayBuffer:e=>p(a.arrayBuffer(e),"ArrayBuffer",e),sharedArrayBuffer:e=>p(a.sharedArrayBuffer(e),"SharedArrayBuffer",e),dataView:e=>p(a.dataView(e),"DataView",e),urlInstance:e=>p(a.urlInstance(e),"URL",e),urlString:e=>p(a.urlString(e),"string with a URL",e),truthy:e=>p(a.truthy(e),"truthy",e),falsy:e=>p(a.falsy(e),"falsy",e),nan:e=>p(a.nan(e),"NaN",e),primitive:e=>p(a.primitive(e),"primitive",e),integer:e=>p(a.integer(e),"integer",e),safeInteger:e=>p(a.safeInteger(e),"integer",e),plainObject:e=>p(a.plainObject(e),"plain object",e),typedArray:e=>p(a.typedArray(e),"TypedArray",e),arrayLike:e=>p(a.arrayLike(e),"array-like",e),domElement:e=>p(a.domElement(e),"Element",e),observable:e=>p(a.observable(e),"Observable",e),nodeStream:e=>p(a.nodeStream(e),"Node.js Stream",e),infinite:e=>p(a.infinite(e),"infinite number",e),emptyArray:e=>p(a.emptyArray(e),"empty array",e),nonEmptyArray:e=>p(a.nonEmptyArray(e),"non-empty array",e),emptyString:e=>p(a.emptyString(e),"empty string",e),nonEmptyString:e=>p(a.nonEmptyString(e),"non-empty string",e),emptyStringOrWhitespace:e=>p(a.emptyStringOrWhitespace(e),"empty string or whitespace",e),emptyObject:e=>p(a.emptyObject(e),"empty object",e),nonEmptyObject:e=>p(a.nonEmptyObject(e),"non-empty object",e),emptySet:e=>p(a.emptySet(e),"empty set",e),nonEmptySet:e=>p(a.nonEmptySet(e),"non-empty set",e),emptyMap:e=>p(a.emptyMap(e),"empty map",e),nonEmptyMap:e=>p(a.nonEmptyMap(e),"non-empty map",e),evenInteger:e=>p(a.evenInteger(e),"even integer",e),oddInteger:e=>p(a.oddInteger(e),"odd integer",e),directInstanceOf:(e,t)=>p(a.directInstanceOf(e,t),"T",e),inRange:(e,t)=>p(a.inRange(e,t),"in range",e),any:(e,...t)=>p(a.any(e,...t),"predicate returns truthy for any value",t),all:(e,...t)=>p(a.all(e,...t),"predicate returns truthy for all values",t)},Object.defineProperties(a,{class:{value:a.class_},function:{value:a.function_},null:{value:a.null_}}),Object.defineProperties(r.assert,{class:{value:r.assert.class_},function:{value:r.assert.function_},null:{value:r.assert.null_}}),r.default=a,t.exports=a,t.exports.default=a,t.exports.assert=r.assert},{}],24:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("defer-to-connect"),s=Number(process.versions.node.split(".")[0]),n=e=>{const t={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};e.timings=t;const r=e=>{const r=e.emit.bind(e);e.emit=(o,...s)=>("error"===o&&(t.error=Date.now(),t.phases.total=t.error-t.start,e.emit=r),r(o,...s))};r(e),e.prependOnceListener("abort",()=>{t.abort=Date.now(),(!t.response||s>=13)&&(t.phases.total=Date.now()-t.start)});const n=e=>{t.socket=Date.now(),t.phases.wait=t.socket-t.start;const r=()=>{t.lookup=Date.now(),t.phases.dns=t.lookup-t.socket};e.prependOnceListener("lookup",r),o.default(e,{connect:()=>{t.connect=Date.now(),void 0===t.lookup&&(e.removeListener("lookup",r),t.lookup=t.connect,t.phases.dns=t.lookup-t.socket),t.phases.tcp=t.connect-t.lookup},secureConnect:()=>{t.secureConnect=Date.now(),t.phases.tls=t.secureConnect-t.connect}})};e.socket?n(e.socket):e.prependOnceListener("socket",n);const i=()=>{var e;t.upload=Date.now(),t.phases.request=t.upload-(null!=(e=t.secureConnect)?e:t.connect)};return("boolean"==typeof e.writableFinished?!e.writableFinished:!e.finished||0!==e.outputSize||e.socket&&0!==e.socket.writableLength)?e.prependOnceListener("finish",i):i(),e.prependOnceListener("response",e=>{t.response=Date.now(),t.phases.firstByte=t.response-t.upload,e.timings=t,r(e),e.prependOnceListener("end",()=>{t.end=Date.now(),t.phases.download=t.end-t.response,t.phases.total=t.end-t.start})}),t};r.default=n,t.exports=n,t.exports.default=n},{"defer-to-connect":30}],25:[function(e,t,r){"use strict";const{Resolver:o,V4MAPPED:s,ADDRCONFIG:n}=e("dns"),{promisify:i}=e("util"),a=e("os"),c=e("keyv"),u=Symbol("cacheableLookupData"),l=Symbol("cacheableLookupInstance"),d=e=>{if(!e||"function"!=typeof e.createConnection)throw new Error("Expected an Agent instance as the first argument")},h=()=>{let e=!1,t=!1;for(const r of Object.values(a.networkInterfaces()))for(const o of r)if(!o.internal&&("IPv6"===o.family?t=!0:e=!0,e&&t))break;return{has4:e,has6:t}};class f{constructor({cacheAdapter:e,maxTtl:t=1/0,resolver:r}={}){this.cache=new c({uri:"string"==typeof e&&e,store:"string"!=typeof e&&e,namespace:"cached-lookup"}),this.maxTtl=t,this._resolver=r||new o,this._resolve4=i(this._resolver.resolve4.bind(this._resolver)),this._resolve6=i(this._resolver.resolve6.bind(this._resolver)),this._iface=h(),this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,t,r){"function"==typeof t&&(r=t,t={}),this.lookupAsync(e,{...t,throwNotFound:!0}).then(e=>{t.all?r(null,e):r(null,e.address,e.family,e.expires,e.ttl)}).catch(r)}async lookupAsync(e,t={}){let r;if(!t.family&&t.all){const[t,o]=await Promise.all([this.lookupAsync(e,{all:!0,family:4}),this.lookupAsync(e,{all:!0,family:6})]);r=[...t,...o]}else r=await this.query(e,t.family||4),0===r.length&&6===t.family&&t.hints&s&&(r=await this.query(e,4),(e=>{for(const t of e)t.address=`::ffff:${t.address}`,t.family=6})(r));if(t.hints&n){const{_iface:e}=this;r=r.filter(t=>6===t.family?e.has6:e.has4)}if(0===r.length&&t.throwNotFound){const t=new Error(`ENOTFOUND ${e}`);throw t.code="ENOTFOUND",t.hostname=e,t}const o=Date.now();return r=r.filter(e=>0===e.ttl||o<e.expires),t.all?r:1===r.length?r[0]:0!==r.length?this._getEntry(r):void 0}async query(e,t){let r=await this.cache.get(`${e}:${t}`);return r||(r=await this.queryAndCache(e,t)),r}async queryAndCache(e,t){const r=4===t?this._resolve4:this._resolve6,o=await r(e,{ttl:!0});if(void 0===o)return[];const s=Date.now();let n=0;for(const e of o)n=Math.max(n,e.ttl),e.family=t,e.expires=s+1e3*e.ttl;return n=1e3*Math.min(this.maxTtl,n),0!==this.maxTtl&&0!==n&&await this.cache.set(`${e}:${t}`,o,n),o}_getEntry(e){return e[Math.floor(Math.random()*e.length)]}install(e){if(d(e),u in e)throw new Error("CacheableLookup has been already installed");e[u]=e.createConnection,e[l]=this,e.createConnection=(t,r)=>("lookup"in t||(t.lookup=this.lookup),e[u](t,r))}uninstall(e){if(d(e),e[u]){if(e[l]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[u],delete e[u],delete e[l]}}updateInterfaceInfo(){this._iface=h()}}t.exports=f,t.exports.default=f},{dns:void 0,keyv:37,os:void 0,util:void 0}],26:[function(e,t,r){"use strict";const o=e("events"),s=e("url"),n=e("normalize-url"),i=e("get-stream"),a=e("http-cache-semantics"),c=e("responselike"),u=e("lowercase-keys"),l=e("clone-response"),d=e("keyv");class h{constructor(e,t){if("function"!=typeof e)throw new TypeError("Parameter `request` must be a function");return this.cache=new d({uri:"string"==typeof t&&t,store:"string"!=typeof t&&t,namespace:"cacheable-request"}),this.createCacheableRequest(e)}createCacheableRequest(e){return(t,r)=>{let d;if("string"==typeof t)d=p(s.parse(t)),t={};else if(t instanceof s.URL)d=p(s.parse(t.toString())),t={};else{const[e,...r]=(t.path||"").split("?"),o=r.length>0?`?${r.join("?")}`:"";d=p({...t,pathname:e,search:o})}(t={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...t,...f(d)}).headers=u(t.headers);const m=new o,y=n(s.format(d),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),g=`${t.method}:${y}`;let b=!1,v=!1;const w=t=>{v=!0;let o,s=!1;const n=new Promise(e=>{o=()=>{s||(s=!0,e())}}),u=e=>{if(b&&!t.forceRefresh){e.status=e.statusCode;const r=a.fromObject(b.cachePolicy).revalidatedPolicy(t,e);if(!r.modified){const t=r.policy.responseHeaders();(e=new c(b.statusCode,t,b.body,b.url)).cachePolicy=r.policy,e.fromCache=!0}}let o;e.fromCache||(e.cachePolicy=new a(t,e,t),e.fromCache=!1),t.cache&&e.cachePolicy.storable()?(o=l(e),(async()=>{try{const r=i.buffer(e);if(await Promise.race([n,new Promise(t=>e.once("end",t))]),s)return;const o=await r,a={cachePolicy:e.cachePolicy.toObject(),url:e.url,statusCode:e.fromCache?b.statusCode:e.statusCode,body:o};let c=t.strictTtl?e.cachePolicy.timeToLive():void 0;t.maxTtl&&(c=c?Math.min(c,t.maxTtl):t.maxTtl),await this.cache.set(g,a,c)}catch(e){m.emit("error",new h.CacheError(e))}})()):t.cache&&b&&(async()=>{try{await this.cache.delete(g)}catch(e){m.emit("error",new h.CacheError(e))}})(),m.emit("response",o||e),"function"==typeof r&&r(o||e)};try{const r=e(t,u);r.once("error",o),r.once("abort",o),m.emit("request",r)}catch(e){m.emit("error",new h.RequestError(e))}};return(async()=>{const e=async e=>{await Promise.resolve();const t=e.cache?await this.cache.get(g):void 0;if(void 0===t)return w(e);const o=a.fromObject(t.cachePolicy);if(o.satisfiesWithoutRevalidation(e)&&!e.forceRefresh){const e=o.responseHeaders(),s=new c(t.statusCode,e,t.body,t.url);s.cachePolicy=o,s.fromCache=!0,m.emit("response",s),"function"==typeof r&&r(s)}else b=t,e.headers=o.revalidationHeaders(e),w(e)},o=e=>m.emit("error",new h.CacheError(e));this.cache.once("error",o),m.on("response",()=>this.cache.removeListener("error",o));try{await e(t)}catch(e){t.automaticFailover&&!v&&w(t),m.emit("error",new h.CacheError(e))}})(),m}}}function f(e){const t={...e};return t.path=`${e.pathname||"/"}${e.search||""}`,delete t.pathname,delete t.search,t}function p(e){return{protocol:e.protocol,auth:e.auth,hostname:e.hostname||e.host||"localhost",port:e.port,pathname:e.pathname,search:e.search}}h.RequestError=class extends Error{constructor(e){super(e.message),this.name="RequestError",Object.assign(this,e)}},h.CacheError=class extends Error{constructor(e){super(e.message),this.name="CacheError",Object.assign(this,e)}},t.exports=h},{"clone-response":28,events:void 0,"get-stream":34,"http-cache-semantics":35,keyv:37,"lowercase-keys":38,"normalize-url":40,responselike:47,url:void 0}],27:[function(e,t,r){"use strict";const o=["destroy","setTimeout","socket","headers","trailers","rawHeaders","statusCode","httpVersion","httpVersionMinor","httpVersionMajor","rawTrailers","statusMessage"];t.exports=(e,t)=>{const r=new Set(Object.keys(e).concat(o));for(const o of r)o in t||(t[o]="function"==typeof e[o]?e[o].bind(e):e[o])}},{}],28:[function(e,t,r){"use strict";const o=e("stream").PassThrough,s=e("mimic-response");t.exports=e=>{if(!e||!e.pipe)throw new TypeError("Parameter `response` must be a response stream.");const t=new o;return s(e,t),e.pipe(t)}},{"mimic-response":27,stream:void 0}],29:[function(e,t,r){"use strict";const{pipeline:o,PassThrough:s}=e("stream"),n=e("zlib"),i=e("mimic-response");t.exports=e=>{const t=(e.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(t))return e;const r="br"===t;if(r&&"function"!=typeof n.createBrotliDecompress)return e;const a=r?n.createBrotliDecompress():n.createUnzip(),c=new s;a.on("error",e=>{"Z_BUF_ERROR"!==e.code?c.emit("error",e):c.end()});const u=o(e,a,c,()=>{});return i(e,u),u}},{"mimic-response":39,stream:void 0,zlib:void 0}],30:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=e("tls"),s=(e,t)=>{let r;if("function"==typeof t){r={connect:t}}else r=t;const s="function"==typeof r.connect,n="function"==typeof r.secureConnect,i="function"==typeof r.close,a=()=>{s&&r.connect(),e instanceof o.TLSSocket&&n&&(e.authorized?r.secureConnect():e.authorizationError||e.once("secureConnect",r.secureConnect)),i&&e.once("close",r.close)};e.writable&&!e.connecting?a():e.connecting?e.once("connect",a):e.destroyed&&i&&r.close(e._hadError)};r.default=s,t.exports=s,t.exports.default=s},{tls:void 0}],31:[function(e,t,r){"use strict";var o=e("stream");function s(e,t,r){void 0===r&&(r=t,t=e,e=null),o.Duplex.call(this,e),"function"!=typeof r.read&&(r=new o.Readable(e).wrap(r)),this._writable=t,this._readable=r,this._waiting=!1;var s=this;t.once("finish",(function(){s.end()})),this.once("finish",(function(){t.end()})),r.on("readable",(function(){s._waiting&&(s._waiting=!1,s._read())})),r.once("end",(function(){s.push(null)})),e&&void 0!==e.bubbleErrors&&!e.bubbleErrors||(t.on("error",(function(e){s.emit("error",e)})),r.on("error",(function(e){s.emit("error",e)})))}s.prototype=Object.create(o.Duplex.prototype,{constructor:{value:s}}),s.prototype._write=function(e,t,r){this._writable.write(e,t,r)},s.prototype._read=function(){for(var e,t=0;null!==(e=this._readable.read());)this.push(e),t++;0===t&&(this._waiting=!0)},t.exports=function(e,t,r){return new s(e,t,r)},t.exports.DuplexWrapper=s},{stream:void 0}],32:[function(e,t,r){var o=e("once"),s=function(){},n=function(e,t,r){if("function"==typeof t)return n(e,null,t);t||(t={}),r=o(r||s);var i=e._writableState,a=e._readableState,c=t.readable||!1!==t.readable&&e.readable,u=t.writable||!1!==t.writable&&e.writable,l=!1,d=function(){e.writable||h()},h=function(){u=!1,c||r.call(e)},f=function(){c=!1,u||r.call(e)},p=function(t){r.call(e,t?new Error("exited with error code: "+t):null)},m=function(t){r.call(e,t)},y=function(){process.nextTick(g)},g=function(){if(!l)return(!c||a&&a.ended&&!a.destroyed)&&(!u||i&&i.ended&&!i.destroyed)?void 0:r.call(e,new Error("premature close"))},b=function(){e.req.on("finish",h)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?u&&!i&&(e.on("end",d),e.on("close",d)):(e.on("complete",h),e.on("abort",y),e.req?b():e.on("request",b)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",p),e.on("end",f),e.on("finish",h),!1!==t.error&&e.on("error",m),e.on("close",y),function(){l=!0,e.removeListener("complete",h),e.removeListener("abort",y),e.removeListener("request",b),e.req&&e.req.removeListener("finish",h),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",h),e.removeListener("exit",p),e.removeListener("end",f),e.removeListener("error",m),e.removeListener("close",y)}};t.exports=n},{once:41}],33:[function(e,t,r){"use strict";const{PassThrough:o}=e("stream");t.exports=e=>{e={...e};const{array:t}=e;let{encoding:r}=e;const s="buffer"===r;let n=!1;t?n=!(r||s):r=r||"utf8",s&&(r=null);const i=new o({objectMode:n});r&&i.setEncoding(r);let a=0;const c=[];return i.on("data",e=>{c.push(e),n?a=c.length:a+=e.length}),i.getBufferedValue=()=>t?c:s?Buffer.concat(c,a):c.join(""),i.getBufferedLength=()=>a,i}},{stream:void 0}],34:[function(e,t,r){"use strict";const o=e("pump"),s=e("./buffer-stream");class n extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function i(e,t){if(!e)return Promise.reject(new Error("Expected a stream"));t={maxBuffer:1/0,...t};const{maxBuffer:r}=t;let i;return await new Promise((a,c)=>{const u=e=>{e&&(e.bufferedData=i.getBufferedValue()),c(e)};i=o(e,s(t),e=>{e?u(e):a()}),i.on("data",()=>{i.getBufferedLength()>r&&u(new n)})}),i.getBufferedValue()}t.exports=i,t.exports.default=i,t.exports.buffer=(e,t)=>i(e,{...t,encoding:"buffer"}),t.exports.array=(e,t)=>i(e,{...t,array:!0}),t.exports.MaxBufferError=n},{"./buffer-stream":33,pump:46}],35:[function(e,t,r){"use strict";const o=new Set([200,203,204,206,300,301,404,405,410,414,501]),s=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),n=new Set([500,502,503,504]),i={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},a={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function c(e){const t=parseInt(e,10);return isFinite(t)?t:0}function u(e){const t={};if(!e)return t;const r=e.trim().split(/\s*,\s*/);for(const e of r){const[r,o]=e.split(/\s*=\s*/,2);t[r]=void 0===o||o.replace(/^"|"$/g,"")}return t}function l(e){let t=[];for(const r in e){const o=e[r];t.push(!0===o?r:r+"="+o)}if(t.length)return t.join(", ")}t.exports=class{constructor(e,t,{shared:r,cacheHeuristic:o,immutableMinTimeToLive:s,ignoreCargoCult:n,_fromObject:i}={}){if(i)this._fromObject(i);else{if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=!1!==r,this._cacheHeuristic=void 0!==o?o:.1,this._immutableMinTtl=void 0!==s?s:864e5,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=u(t.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=t.headers.vary?e.headers:null,this._reqcc=u(e.headers["cache-control"]),n&&"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":l(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),null==t.headers["cache-control"]&&/no-cache/.test(t.headers.pragma)&&(this._rescc["no-cache"]=!0)}}now(){return Date.now()}storable(){return!(this._reqcc["no-store"]||!("GET"===this._method||"HEAD"===this._method||"POST"===this._method&&this._hasExplicitExpiration())||!s.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||o.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);const t=u(e.headers["cache-control"]);if(t["no-cache"]||/no-cache/.test(e.headers.pragma))return!1;if(t["max-age"]&&this.age()>t["max-age"])return!1;if(t["min-fresh"]&&this.timeToLive()<1e3*t["min-fresh"])return!1;if(this.stale()){if(!(t["max-stale"]&&!this._rescc["must-revalidate"]&&(!0===t["max-stale"]||t["max-stale"]>this.age()-this.maxAge())))return!1}return this._requestMatches(e,!1)}_requestMatches(e,t){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&"HEAD"===e.method)&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if("*"===this._resHeaders.vary)return!1;const t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(const r of t)if(e.headers[r]!==this._reqHeaders[r])return!1;return!0}_copyWithoutHopByHopHeaders(e){const t={};for(const r in e)i[r]||(t[r]=e[r]);if(e.connection){const r=e.connection.trim().split(/\s*,\s*/);for(const e of r)delete t[e]}if(t.warning){const e=t.warning.split(/,/).filter(e=>!/^\s*1[0-9][0-9]/.test(e));e.length?t.warning=e.join(",").trim():delete t.warning}return t}responseHeaders(){const e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>86400&&!this._hasExplicitExpiration()&&this.maxAge()>86400&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){const e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){return this._ageValue()+(this.now()-this._responseTime)/1e3}_ageValue(){return c(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 c(this._rescc["s-maxage"])}if(this._rescc["max-age"])return c(this._rescc["max-age"]);const e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){const r=Date.parse(this._resHeaders.expires);return Number.isNaN(r)||r<t?0:Math.max(e,(r-t)/1e3)}if(this._resHeaders["last-modified"]){const r=Date.parse(this._resHeaders["last-modified"]);if(isFinite(r)&&t>r)return Math.max(e,(t-r)/1e3*this._cacheHeuristic)}return e}timeToLive(){const e=this.maxAge()-this.age(),t=e+c(this._rescc["stale-if-error"]),r=e+c(this._rescc["stale-while-revalidate"]);return 1e3*Math.max(0,e,t,r)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+c(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+c(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||1!==e.v)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=void 0!==e.imm?e.imm:864e5,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.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(e){this._assertRequestHasHeaders(e);const t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete t["if-none-match"],delete t["if-modified-since"],t;if(this._resHeaders.etag&&(t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&"GET"!=this._method){if(delete t["if-modified-since"],t["if-none-match"]){const e=t["if-none-match"].split(/,/).filter(e=>!/^\s*W\//.test(e));e.length?t["if-none-match"]=e.join(",").trim():delete t["if-none-match"]}}else this._resHeaders["last-modified"]&&!t["if-modified-since"]&&(t["if-modified-since"]=this._resHeaders["last-modified"]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&function(e){return!e||n.has(e.status)}(t))return{modified:!1,matches:!1,policy:this};if(!t||!t.headers)throw Error("Response headers missing");let r=!1;if(void 0!==t.status&&304!=t.status?r=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?r=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?r=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?r=this._resHeaders["last-modified"]===t.headers["last-modified"]:this._resHeaders.etag||this._resHeaders["last-modified"]||t.headers.etag||t.headers["last-modified"]||(r=!0),!r)return{policy:new this.constructor(e,t),modified:304!=t.status,matches:!1};const o={};for(const e in this._resHeaders)o[e]=e in t.headers&&!a[e]?t.headers[e]:this._resHeaders[e];const s=Object.assign({},t,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}},{}],36:[function(e,t,r){r.stringify=function e(t){if(void 0===t)return t;if(t&&Buffer.isBuffer(t))return JSON.stringify(":base64:"+t.toString("base64"));if(t&&t.toJSON&&(t=t.toJSON()),t&&"object"==typeof t){var r="",o=Array.isArray(t);r=o?"[":"{";var s=!0;for(var n in t){var i="function"==typeof t[n]||!o&&void 0===t[n];Object.hasOwnProperty.call(t,n)&&!i&&(s||(r+=","),s=!1,o?null==t[n]?r+="null":r+=e(t[n]):void 0!==t[n]&&(r+=e(n)+":"+e(t[n])))}return r+=o?"]":"}"}return"string"==typeof t?JSON.stringify(/^:/.test(t)?":"+t:t):void 0===t?"null":JSON.stringify(t)},r.parse=function(e){return JSON.parse(e,(function(e,t){return"string"==typeof t?/^:base64:/.test(t)?Buffer.from(t.substring(8),"base64"):/^:/.test(t)?t.substring(1):t:t}))}},{}],37:[function(e,t,r){"use strict";const o=e("events"),s=e("json-buffer");t.exports=class extends o{constructor(t,r){if(super(),this.opts=Object.assign({namespace:"keyv",serialize:s.stringify,deserialize:s.parse},"string"==typeof t?{uri:t}:t,r),!this.opts.store){const t=Object.assign({},this.opts);this.opts.store=(t=>{const r={redis:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql"};if(t.adapter||t.uri){const o=t.adapter||/^[^:]*/.exec(t.uri)[0];return new(e(r[o]))(t)}return new Map})(t)}"function"==typeof this.opts.store.on&&this.opts.store.on("error",e=>this.emit("error",e)),this.opts.store.namespace=this.opts.namespace}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}get(e,t){e=this._getKeyPrefix(e);const{store:r}=this.opts;return Promise.resolve().then(()=>r.get(e)).then(e=>"string"==typeof e?this.opts.deserialize(e):e).then(r=>{if(void 0!==r){if(!("number"==typeof r.expires&&Date.now()>r.expires))return t&&t.raw?r:r.value;this.delete(e)}})}set(e,t,r){e=this._getKeyPrefix(e),void 0===r&&(r=this.opts.ttl),0===r&&(r=void 0);const{store:o}=this.opts;return Promise.resolve().then(()=>{const e="number"==typeof r?Date.now()+r:null;return t={value:t,expires:e},this.opts.serialize(t)}).then(t=>o.set(e,t,r)).then(()=>!0)}delete(e){e=this._getKeyPrefix(e);const{store:t}=this.opts;return Promise.resolve().then(()=>t.delete(e))}clear(){const{store:e}=this.opts;return Promise.resolve().then(()=>e.clear())}}},{events:void 0,"json-buffer":36}],38:[function(e,t,r){"use strict";t.exports=e=>{const t={};for(const[r,o]of Object.entries(e))t[r.toLowerCase()]=o;return t}},{}],39:[function(e,t,r){"use strict";const o=["aborted","complete","destroy","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];t.exports=(e,t)=>{const r=new Set(Object.keys(e).concat(o));for(const o of r)o in t||(t[o]="function"==typeof e[o]?e[o].bind(e):e[o]);return t}},{}],40:[function(e,t,r){"use strict";const o="undefined"==typeof URL?e("url").URL:URL,s=(e,t)=>t.some(t=>t instanceof RegExp?t.test(e):t===e),n=(e,t)=>{if(t={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...t},Reflect.has(t,"normalizeHttps"))throw new Error("options.normalizeHttps is renamed to options.forceHttp");if(Reflect.has(t,"normalizeHttp"))throw new Error("options.normalizeHttp is renamed to options.forceHttps");if(Reflect.has(t,"stripFragment"))throw new Error("options.stripFragment is renamed to options.stripHash");if(e=e.trim(),/^data:/i.test(e))return((e,{stripHash:t})=>{const r=e.match(/^data:(.*?),(.*?)(?:#(.*))?$/);if(!r)throw new Error(`Invalid URL: ${e}`);const o=r[1].split(";"),s=r[2],n=t?"":r[3];let i=!1;"base64"===o[o.length-1]&&(o.pop(),i=!0);const a=(o.shift()||"").toLowerCase(),c=[...o.map(e=>{let[t,r=""]=e.split("=").map(e=>e.trim());return"charset"===t&&(r=r.toLowerCase(),"us-ascii"===r)?"":`${t}${r?`=${r}`:""}`}).filter(Boolean)];return i&&c.push("base64"),(0!==c.length||a&&"text/plain"!==a)&&c.unshift(a),`data:${c.join(";")},${i?s.trim():s}${n?`#${n}`:""}`})(e,t);const r=e.startsWith("//");!r&&/^\.*\//.test(e)||(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol));const n=new o(e);if(t.forceHttp&&t.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(t.forceHttp&&"https:"===n.protocol&&(n.protocol="http:"),t.forceHttps&&"http:"===n.protocol&&(n.protocol="https:"),t.stripAuthentication&&(n.username="",n.password=""),t.stripHash&&(n.hash=""),n.pathname&&(n.pathname=n.pathname.replace(/((?!:).|^)\/{2,}/g,(e,t)=>/^(?!\/)/g.test(t)?`${t}/`:"/")),n.pathname&&(n.pathname=decodeURI(n.pathname)),!0===t.removeDirectoryIndex&&(t.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(t.removeDirectoryIndex)&&t.removeDirectoryIndex.length>0){let e=n.pathname.split("/");const r=e[e.length-1];s(r,t.removeDirectoryIndex)&&(e=e.slice(0,e.length-1),n.pathname=e.slice(1).join("/")+"/")}if(n.hostname&&(n.hostname=n.hostname.replace(/\.$/,""),t.stripWWW&&/^www\.([a-z\-\d]{2,63})\.([a-z.]{2,5})$/.test(n.hostname)&&(n.hostname=n.hostname.replace(/^www\./,""))),Array.isArray(t.removeQueryParameters))for(const e of[...n.searchParams.keys()])s(e,t.removeQueryParameters)&&n.searchParams.delete(e);return t.sortQueryParameters&&n.searchParams.sort(),t.removeTrailingSlash&&(n.pathname=n.pathname.replace(/\/$/,"")),e=n.toString(),!t.removeTrailingSlash&&"/"!==n.pathname||""!==n.hash||(e=e.replace(/\/$/,"")),r&&!t.normalizeProtocol&&(e=e.replace(/^http:\/\//,"//")),t.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,"")),e};t.exports=n,t.exports.default=n},{url:void 0}],41:[function(e,t,r){var o=e("wrappy");function s(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function n(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}t.exports=o(s),t.exports.strict=o(n),s.proto=s((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return s(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return n(this)},configurable:!0})}))},{wrappy:49}],42:[function(e,t,r){"use strict";class o extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}}class s{static fn(e){return(...t)=>new s((r,o,s)=>{t.push(s),e(...t).then(r,o)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((t,r)=>{this._reject=r;const o=e=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(e)};return Object.defineProperties(o,{shouldReject:{get:()=>this._rejectOnCancel,set:e=>{this._rejectOnCancel=e}}}),e(e=>{this._isPending=!1,t(e)},e=>{this._isPending=!1,r(e)},o)})}then(e,t){return this._promise.then(e,t)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(this._isPending&&!this._isCanceled){if(this._cancelHandlers.length>0)try{for(const e of this._cancelHandlers)e()}catch(e){this._reject(e)}this._isCanceled=!0,this._rejectOnCancel&&this._reject(new o(e))}}get isCanceled(){return this._isCanceled}}Object.setPrototypeOf(s.prototype,Promise.prototype),t.exports=s,t.exports.CancelError=o},{}],43:[function(e,t,r){"use strict";const o=e("p-timeout"),s=Symbol.asyncIterator||"@@asyncIterator",n=e=>{const t=e.on||e.addListener||e.addEventListener,r=e.off||e.removeListener||e.removeEventListener;if(!t||!r)throw new TypeError("Emitter is not compatible");return{addListener:t.bind(e),removeListener:r.bind(e)}},i=e=>Array.isArray(e)?e:[e],a=(e,t,r)=>{let s;const a=new Promise((o,a)=>{if(!((r={rejectionEvents:["error"],multiArgs:!1,resolveImmediately:!1,...r}).count>=0)||r.count!==1/0&&!Number.isInteger(r.count))throw new TypeError("The `count` option should be at least 0 or more");const c=i(t),u=[],{addListener:l,removeListener:d}=n(e),h=(...e)=>{const t=r.multiArgs?e:e[0];r.filter&&!r.filter(t)||(u.push(t),r.count===u.length&&(s(),o(u)))},f=e=>{s(),a(e)};s=()=>{for(const e of c)d(e,h);for(const e of r.rejectionEvents)d(e,f)};for(const e of c)l(e,h);for(const e of r.rejectionEvents)l(e,f);r.resolveImmediately&&o(u)});if(a.cancel=s,"number"==typeof r.timeout){const e=o(a,r.timeout);return e.cancel=s,e}return a},c=(e,t,r)=>{"function"==typeof r&&(r={filter:r}),r={...r,count:1,resolveImmediately:!1};const o=a(e,t,r),s=o.then(e=>e[0]);return s.cancel=o.cancel,s};t.exports=c,t.exports.default=c,t.exports.multiple=a,t.exports.iterator=(e,t,r)=>{"function"==typeof r&&(r={filter:r});const o=i(t);r={rejectionEvents:["error"],resolutionEvents:[],limit:1/0,multiArgs:!1,...r};const{limit:a}=r;if(!(a>=0&&(a===1/0||Number.isInteger(a))))throw new TypeError("The `limit` option should be a non-negative integer or Infinity");if(0===a)return{[Symbol.asyncIterator](){return this},next:async()=>({done:!0,value:void 0})};const{addListener:c,removeListener:u}=n(e);let l,d=!1,h=!1;const f=[],p=[];let m=0,y=!1;const g=(...e)=>{m++,y=m===a;const t=r.multiArgs?e:e[0];if(f.length>0){const{resolve:e}=f.shift();return e({done:!1,value:t}),void(y&&b())}p.push(t),y&&b()},b=()=>{d=!0;for(const e of o)u(e,g);for(const e of r.rejectionEvents)u(e,v);for(const e of r.resolutionEvents)u(e,w);for(;f.length>0;){const{resolve:e}=f.shift();e({done:!0,value:void 0})}},v=(...e)=>{if(l=r.multiArgs?e:e[0],f.length>0){const{reject:e}=f.shift();e(l)}else h=!0;b()},w=(...e)=>{const t=r.multiArgs?e:e[0];if(!r.filter||r.filter(t)){if(f.length>0){const{resolve:e}=f.shift();e({done:!0,value:t})}else p.push(t);b()}};for(const e of o)c(e,g);for(const e of r.rejectionEvents)c(e,v);for(const e of r.resolutionEvents)c(e,w);return{[s](){return this},async next(){if(p.length>0){const e=p.shift();return{done:d&&0===p.length&&!y,value:e}}if(h)throw h=!1,l;return d?{done:!0,value:void 0}:new Promise((e,t)=>f.push({resolve:e,reject:t}))},return:async e=>(b(),{done:d,value:e})}}},{"p-timeout":45}],44:[function(e,t,r){"use strict";t.exports=(e,t)=>(t=t||(()=>{}),e.then(e=>new Promise(e=>{e(t())}).then(()=>e),e=>new Promise(e=>{e(t())}).then(()=>{throw e})))},{}],45:[function(e,t,r){"use strict";const o=e("p-finally");class s extends Error{constructor(e){super(e),this.name="TimeoutError"}}t.exports=(e,t,r)=>new Promise((n,i)=>{if("number"!=typeof t||t<0)throw new TypeError("Expected `ms` to be a positive number");const a=setTimeout(()=>{if("function"==typeof r){try{n(r())}catch(o){i(o)}return}const o=r instanceof Error?r:new s("string"==typeof r?r:`Promise timed out after ${t} milliseconds`);"function"==typeof e.cancel&&e.cancel(),i(o)},t);o(e.then(n,i),()=>{clearTimeout(a)})}),t.exports.TimeoutError=s},{"p-finally":44}],46:[function(e,t,r){var o=e("once"),s=e("end-of-stream"),n=e("fs"),i=function(){},a=/^v?\.0/.test(process.version),c=function(e){return"function"==typeof e},u=function(e,t,r,u){u=o(u);var l=!1;e.on("close",(function(){l=!0})),s(e,{readable:t,writable:r},(function(e){if(e)return u(e);l=!0,u()}));var d=!1;return function(t){if(!l&&!d)return d=!0,function(e){return!!a&&(!!n&&((e instanceof(n.ReadStream||i)||e instanceof(n.WriteStream||i))&&c(e.close)))}(e)?e.close(i):function(e){return e.setHeader&&c(e.abort)}(e)?e.abort():c(e.destroy)?e.destroy():void u(t||new Error("stream was destroyed"))}},l=function(e){e()},d=function(e,t){return e.pipe(t)};t.exports=function(){var e,t=Array.prototype.slice.call(arguments),r=c(t[t.length-1]||i)&&t.pop()||i;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var o=t.map((function(s,n){var i=n<t.length-1;return u(s,i,n>0,(function(t){e||(e=t),t&&o.forEach(l),i||(o.forEach(l),r(e))}))}));return t.reduce(d)}},{"end-of-stream":32,fs:void 0,once:41}],47:[function(e,t,r){"use strict";const o=e("stream").Readable,s=e("lowercase-keys");t.exports=class extends o{constructor(e,t,r,o){if("number"!=typeof e)throw new TypeError("Argument `statusCode` should be a number");if("object"!=typeof t)throw new TypeError("Argument `headers` should be an object");if(!(r instanceof Buffer))throw new TypeError("Argument `body` should be a buffer");if("string"!=typeof o)throw new TypeError("Argument `url` should be a string");super(),this.statusCode=e,this.headers=s(t),this.body=r,this.url=o}_read(){this.push(this.body),this.push(null)}}},{"lowercase-keys":38,stream:void 0}],48:[function(e,t,r){"use strict";const{Readable:o}=e("stream"),s=e=>new o({read(){this.push(e),this.push(null)}});t.exports=s,t.exports.default=s},{stream:void 0}],49:[function(e,t,r){t.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){o[e]=t[e]})),o;function o(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var o=t.apply(this,e),s=e[e.length-1];return"function"==typeof o&&o!==s&&Object.keys(s).forEach((function(e){o[e]=s[e]})),o}}},{}]},{},[7])(7)}));
|