← All changes
|
assets/js/packages/http-client/http-client.js
+3040
-2
4.1.0-dev3
→
4.3.2
View file →
| @@ -1,3 +1,3041 @@ | ||
| 1 | -/*! For license information please see http-client.js.LICENSE.txt */ | |
| 2 | -!function(){"use strict";var e={"./node_modules/axios/index.js":function(e,t,o){o.r(t),o.d(t,{Axios:function(){return n},AxiosError:function(){return s},AxiosHeaders:function(){return h},Cancel:function(){return c},CancelToken:function(){return l},CanceledError:function(){return a},HttpStatusCode:function(){return b},VERSION:function(){return u},all:function(){return d},default:function(){return r.default},formToJSON:function(){return g},getAdapter:function(){return x},isAxiosError:function(){return f},isCancel:function(){return i},mergeConfig:function(){return _},spread:function(){return p},toFormData:function(){return m}});var r=o("./node_modules/axios/lib/axios.js");const{Axios:n,AxiosError:s,CanceledError:a,isCancel:i,CancelToken:l,VERSION:u,all:d,Cancel:c,isAxiosError:f,spread:p,toFormData:m,AxiosHeaders:h,HttpStatusCode:b,formToJSON:g,getAdapter:x,mergeConfig:_}=r.default},"./node_modules/axios/lib/adapters/adapters.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/utils.js"),n=o("./node_modules/axios/lib/helpers/null.js"),s=o("./node_modules/axios/lib/adapters/xhr.js"),a=o("./node_modules/axios/lib/adapters/fetch.js"),i=o("./node_modules/axios/lib/core/AxiosError.js");const l={http:n.default,xhr:s.default,fetch:{get:a.getFetch}};r.default.forEach(l,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const renderReason=e=>`- ${e}`,isResolvedHandle=e=>r.default.isFunction(e)||null===e||!1===e;t.default={getAdapter:function getAdapter(e,t){e=r.default.isArray(e)?e:[e];const{length:o}=e;let n,s;const a={};for(let u=0;u<o;u++){let o;if(n=e[u],s=n,!isResolvedHandle(n)&&(s=l[(o=String(n)).toLowerCase()],void 0===s))throw new i.default(`Unknown adapter '${o}'`);if(s&&(r.default.isFunction(s)||(s=s.get(t))))break;a[o||"#"+u]=s}if(!s){const e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=o?e.length>1?"since :\n"+e.map(renderReason).join("\n"):" "+renderReason(e[0]):"as no adapter specified";throw new i.default("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return s},adapters:l}},"./node_modules/axios/lib/adapters/fetch.js":function(e,t,o){o.r(t),o.d(t,{getFetch:function(){return getFetch}});var r=o("./node_modules/axios/lib/platform/index.js"),n=o("./node_modules/axios/lib/utils.js"),s=o("./node_modules/axios/lib/core/AxiosError.js"),a=o("./node_modules/axios/lib/helpers/composeSignals.js"),i=o("./node_modules/axios/lib/helpers/trackStream.js"),l=o("./node_modules/axios/lib/core/AxiosHeaders.js"),u=o("./node_modules/axios/lib/helpers/progressEventReducer.js"),d=o("./node_modules/axios/lib/helpers/resolveConfig.js"),c=o("./node_modules/axios/lib/core/settle.js");const{isFunction:f}=n.default,p=(({Request:e,Response:t})=>({Request:e,Response:t}))(n.default.global),{ReadableStream:m,TextEncoder:h}=n.default.global,test=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},factory=e=>{e=n.default.merge.call({skipUndefined:!0},p,e);const{fetch:t,Request:o,Response:b}=e,g=t?f(t):"function"==typeof fetch,x=f(o),_=f(b);if(!g)return!1;const y=g&&f(m),j=g&&("function"==typeof h?(w=new h,e=>w.encode(e)):async e=>new Uint8Array(await new o(e).arrayBuffer()));var w;const E=x&&y&&test(()=>{let e=!1;const t=new o(r.default.origin,{body:new m,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),R=_&&y&&test(()=>n.default.isReadableStream(new b("").body)),v={stream:R&&(e=>e.body)};g&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!v[e]&&(v[e]=(t,o)=>{let r=t&&t[e];if(r)return r.call(t);throw new s.default(`Response type '${e}' is not supported`,s.default.ERR_NOT_SUPPORT,o)})});const resolveBodyLength=async(e,t)=>{const s=n.default.toFiniteNumber(e.getContentLength());return null==s?(async e=>{if(null==e)return 0;if(n.default.isBlob(e))return e.size;if(n.default.isSpecCompliantForm(e)){const t=new o(r.default.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return n.default.isArrayBufferView(e)||n.default.isArrayBuffer(e)?e.byteLength:(n.default.isURLSearchParams(e)&&(e+=""),n.default.isString(e)?(await j(e)).byteLength:void 0)})(t):s};return async e=>{let{url:r,method:f,data:p,signal:m,cancelToken:h,timeout:g,onDownloadProgress:_,onUploadProgress:y,responseType:j,headers:w,withCredentials:S="same-origin",fetchOptions:A}=(0,d.default)(e),C=t||fetch;j=j?(j+"").toLowerCase():"text";let O=(0,a.default)([m,h&&h.toAbortSignal()],g),T=null;const U=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let P;try{if(y&&E&&"get"!==f&&"head"!==f&&0!==(P=await resolveBodyLength(w,p))){let e,t=new o(r,{method:"POST",body:p,duplex:"half"});if(n.default.isFormData(p)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,o]=(0,u.progressEventDecorator)(P,(0,u.progressEventReducer)((0,u.asyncDecorator)(y)));p=(0,i.trackStream)(t.body,65536,e,o)}}n.default.isString(S)||(S=S?"include":"omit");const t=x&&"credentials"in o.prototype,s={...A,signal:O,method:f.toUpperCase(),headers:w.normalize().toJSON(),body:p,duplex:"half",credentials:t?S:void 0};T=x&&new o(r,s);let a=await(x?C(T,A):C(r,s));const d=R&&("stream"===j||"response"===j);if(R&&(_||d&&U)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=a[t]});const t=n.default.toFiniteNumber(a.headers.get("content-length")),[o,r]=_&&(0,u.progressEventDecorator)(t,(0,u.progressEventReducer)((0,u.asyncDecorator)(_),!0))||[];a=new b((0,i.trackStream)(a.body,65536,o,()=>{r&&r(),U&&U()}),e)}j=j||"text";let m=await v[n.default.findKey(v,j)||"text"](a,e);return!d&&U&&U(),await new Promise((t,o)=>{(0,c.default)(t,o,{data:m,headers:l.default.from(a.headers),status:a.status,statusText:a.statusText,config:e,request:T})})}catch(t){if(U&&U(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new s.default("Network Error",s.default.ERR_NETWORK,e,T),{cause:t.cause||t});throw s.default.from(t,t&&t.code,e,T)}}},b=new Map,getFetch=e=>{let t=e&&e.env||{};const{fetch:o,Request:r,Response:n}=t,s=[r,n,o];let a,i,l=s.length,u=b;for(;l--;)a=s[l],i=u.get(a),void 0===i&&u.set(a,i=l?new Map:factory(t)),u=i;return i},g=getFetch();t.default=g},"./node_modules/axios/lib/adapters/xhr.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/utils.js"),n=o("./node_modules/axios/lib/core/settle.js"),s=o("./node_modules/axios/lib/defaults/transitional.js"),a=o("./node_modules/axios/lib/core/AxiosError.js"),i=o("./node_modules/axios/lib/cancel/CanceledError.js"),l=o("./node_modules/axios/lib/helpers/parseProtocol.js"),u=o("./node_modules/axios/lib/platform/index.js"),d=o("./node_modules/axios/lib/core/AxiosHeaders.js"),c=o("./node_modules/axios/lib/helpers/progressEventReducer.js"),f=o("./node_modules/axios/lib/helpers/resolveConfig.js");const p="undefined"!=typeof XMLHttpRequest;t.default=p&&function(e){return new Promise(function dispatchXhrRequest(t,o){const p=(0,f.default)(e);let m=p.data;const h=d.default.from(p.headers).normalize();let b,g,x,_,y,{responseType:j,onUploadProgress:w,onDownloadProgress:E}=p;function done(){_&&_(),y&&y(),p.cancelToken&&p.cancelToken.unsubscribe(b),p.signal&&p.signal.removeEventListener("abort",b)}let R=new XMLHttpRequest;function onloadend(){if(!R)return;const r=d.default.from("getAllResponseHeaders"in R&&R.getAllResponseHeaders()),s={data:j&&"text"!==j&&"json"!==j?R.response:R.responseText,status:R.status,statusText:R.statusText,headers:r,config:e,request:R};(0,n.default)(function _resolve(e){t(e),done()},function _reject(e){o(e),done()},s),R=null}R.open(p.method.toUpperCase(),p.url,!0),R.timeout=p.timeout,"onloadend"in R?R.onloadend=onloadend:R.onreadystatechange=function handleLoad(){R&&4===R.readyState&&(0!==R.status||R.responseURL&&0===R.responseURL.indexOf("file:"))&&setTimeout(onloadend)},R.onabort=function handleAbort(){R&&(o(new a.default("Request aborted",a.default.ECONNABORTED,e,R)),R=null)},R.onerror=function handleError(t){const r=t&&t.message?t.message:"Network Error",n=new a.default(r,a.default.ERR_NETWORK,e,R);n.event=t||null,o(n),R=null},R.ontimeout=function handleTimeout(){let t=p.timeout?"timeout of "+p.timeout+"ms exceeded":"timeout exceeded";const r=p.transitional||s.default;p.timeoutErrorMessage&&(t=p.timeoutErrorMessage),o(new a.default(t,r.clarifyTimeoutError?a.default.ETIMEDOUT:a.default.ECONNABORTED,e,R)),R=null},void 0===m&&h.setContentType(null),"setRequestHeader"in R&&r.default.forEach(h.toJSON(),function setRequestHeader(e,t){R.setRequestHeader(t,e)}),r.default.isUndefined(p.withCredentials)||(R.withCredentials=!!p.withCredentials),j&&"json"!==j&&(R.responseType=p.responseType),E&&([x,y]=(0,c.progressEventReducer)(E,!0),R.addEventListener("progress",x)),w&&R.upload&&([g,_]=(0,c.progressEventReducer)(w),R.upload.addEventListener("progress",g),R.upload.addEventListener("loadend",_)),(p.cancelToken||p.signal)&&(b=t=>{R&&(o(!t||t.type?new i.default(null,e,R):t),R.abort(),R=null)},p.cancelToken&&p.cancelToken.subscribe(b),p.signal&&(p.signal.aborted?b():p.signal.addEventListener("abort",b)));const v=(0,l.default)(p.url);v&&-1===u.default.protocols.indexOf(v)?o(new a.default("Unsupported protocol "+v+":",a.default.ERR_BAD_REQUEST,e)):R.send(m||null)})}},"./node_modules/axios/lib/axios.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/utils.js"),n=o("./node_modules/axios/lib/helpers/bind.js"),s=o("./node_modules/axios/lib/core/Axios.js"),a=o("./node_modules/axios/lib/core/mergeConfig.js"),i=o("./node_modules/axios/lib/defaults/index.js"),l=o("./node_modules/axios/lib/helpers/formDataToJSON.js"),u=o("./node_modules/axios/lib/cancel/CanceledError.js"),d=o("./node_modules/axios/lib/cancel/CancelToken.js"),c=o("./node_modules/axios/lib/cancel/isCancel.js"),f=o("./node_modules/axios/lib/env/data.js"),p=o("./node_modules/axios/lib/helpers/toFormData.js"),m=o("./node_modules/axios/lib/core/AxiosError.js"),h=o("./node_modules/axios/lib/helpers/spread.js"),b=o("./node_modules/axios/lib/helpers/isAxiosError.js"),g=o("./node_modules/axios/lib/core/AxiosHeaders.js"),x=o("./node_modules/axios/lib/adapters/adapters.js"),_=o("./node_modules/axios/lib/helpers/HttpStatusCode.js");const y=function createInstance(e){const t=new s.default(e),o=(0,n.default)(s.default.prototype.request,t);return r.default.extend(o,s.default.prototype,t,{allOwnKeys:!0}),r.default.extend(o,t,null,{allOwnKeys:!0}),o.create=function create(t){return createInstance((0,a.default)(e,t))},o}(i.default);y.Axios=s.default,y.CanceledError=u.default,y.CancelToken=d.default,y.isCancel=c.default,y.VERSION=f.VERSION,y.toFormData=p.default,y.AxiosError=m.default,y.Cancel=y.CanceledError,y.all=function all(e){return Promise.all(e)},y.spread=h.default,y.isAxiosError=b.default,y.mergeConfig=a.default,y.AxiosHeaders=g.default,y.formToJSON=e=>(0,l.default)(r.default.isHTMLForm(e)?new FormData(e):e),y.getAdapter=x.default.getAdapter,y.HttpStatusCode=_.default,y.default=y,t.default=y},"./node_modules/axios/lib/cancel/CancelToken.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/cancel/CanceledError.js");class CancelToken{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function promiseExecutor(e){t=e});const o=this;this.promise.then(e=>{if(!o._listeners)return;let t=o._listeners.length;for(;t-- >0;)o._listeners[t](e);o._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{o.subscribe(e),t=e}).then(e);return r.cancel=function reject(){o.unsubscribe(t)},r},e(function cancel(e,n,s){o.reason||(o.reason=new r.default(e,n,s),t(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,abort=t=>{e.abort(t)};return this.subscribe(abort),e.signal.unsubscribe=()=>this.unsubscribe(abort),e.signal}static source(){let e;return{token:new CancelToken(function executor(t){e=t}),cancel:e}}}t.default=CancelToken},"./node_modules/axios/lib/cancel/CanceledError.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/core/AxiosError.js");function CanceledError(e,t,o){r.default.call(this,null==e?"canceled":e,r.default.ERR_CANCELED,t,o),this.name="CanceledError"}o("./node_modules/axios/lib/utils.js").default.inherits(CanceledError,r.default,{__CANCEL__:!0}),t.default=CanceledError},"./node_modules/axios/lib/cancel/isCancel.js":function(e,t,o){function isCancel(e){return!(!e||!e.__CANCEL__)}o.r(t),o.d(t,{default:function(){return isCancel}})},"./node_modules/axios/lib/core/Axios.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/utils.js"),n=o("./node_modules/axios/lib/helpers/buildURL.js"),s=o("./node_modules/axios/lib/core/InterceptorManager.js"),a=o("./node_modules/axios/lib/core/dispatchRequest.js"),i=o("./node_modules/axios/lib/core/mergeConfig.js"),l=o("./node_modules/axios/lib/core/buildFullPath.js"),u=o("./node_modules/axios/lib/helpers/validator.js"),d=o("./node_modules/axios/lib/core/AxiosHeaders.js");const c=u.default.validators;class Axios{constructor(e){this.defaults=e||{},this.interceptors={request:new s.default,response:new s.default}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const o=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?o&&!String(e.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+o):e.stack=o}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=(0,i.default)(this.defaults,t);const{transitional:o,paramsSerializer:n,headers:s}=t;void 0!==o&&u.default.assertOptions(o,{silentJSONParsing:c.transitional(c.boolean),forcedJSONParsing:c.transitional(c.boolean),clarifyTimeoutError:c.transitional(c.boolean)},!1),null!=n&&(r.default.isFunction(n)?t.paramsSerializer={serialize:n}:u.default.assertOptions(n,{encode:c.function,serialize:c.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),u.default.assertOptions(t,{baseUrl:c.spelling("baseURL"),withXsrfToken:c.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let l=s&&r.default.merge(s.common,s[t.method]);s&&r.default.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=d.default.concat(l,s);const f=[];let p=!0;this.interceptors.request.forEach(function unshiftRequestInterceptors(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(p=p&&e.synchronous,f.unshift(e.fulfilled,e.rejected))});const m=[];let h;this.interceptors.response.forEach(function pushResponseInterceptors(e){m.push(e.fulfilled,e.rejected)});let b,g=0;if(!p){const e=[a.default.bind(this),void 0];for(e.unshift(...f),e.push(...m),b=e.length,h=Promise.resolve(t);g<b;)h=h.then(e[g++],e[g++]);return h}b=f.length;let x=t;for(;g<b;){const e=f[g++],t=f[g++];try{x=e(x)}catch(e){t.call(this,e);break}}try{h=a.default.call(this,x)}catch(e){return Promise.reject(e)}for(g=0,b=m.length;g<b;)h=h.then(m[g++],m[g++]);return h}getUri(e){e=(0,i.default)(this.defaults,e);const t=(0,l.default)(e.baseURL,e.url,e.allowAbsoluteUrls);return(0,n.default)(t,e.params,e.paramsSerializer)}}r.default.forEach(["delete","get","head","options"],function forEachMethodNoData(e){Axios.prototype[e]=function(t,o){return this.request((0,i.default)(o||{},{method:e,url:t,data:(o||{}).data}))}}),r.default.forEach(["post","put","patch"],function forEachMethodWithData(e){function generateHTTPMethod(t){return function httpMethod(o,r,n){return this.request((0,i.default)(n||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}Axios.prototype[e]=generateHTTPMethod(),Axios.prototype[e+"Form"]=generateHTTPMethod(!0)}),t.default=Axios},"./node_modules/axios/lib/core/AxiosError.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/utils.js");function AxiosError(e,t,o,r,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),o&&(this.config=o),r&&(this.request=r),n&&(this.response=n,this.status=n.status?n.status:null)}r.default.inherits(AxiosError,Error,{toJSON:function toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r.default.toJSONObject(this.config),code:this.code,status:this.status}}});const n=AxiosError.prototype,s={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{s[e]={value:e}}),Object.defineProperties(AxiosError,s),Object.defineProperty(n,"isAxiosError",{value:!0}),AxiosError.from=(e,t,o,s,a,i)=>{const l=Object.create(n);r.default.toFlatObject(e,l,function filter(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const u=e&&e.message?e.message:"Error",d=null==t&&e?e.code:t;return AxiosError.call(l,u,d,o,s,a),e&&null==l.cause&&Object.defineProperty(l,"cause",{value:e,configurable:!0}),l.name=e&&e.name||"Error",i&&Object.assign(l,i),l},t.default=AxiosError},"./node_modules/axios/lib/core/AxiosHeaders.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/utils.js"),n=o("./node_modules/axios/lib/helpers/parseHeaders.js");const s=Symbol("internals");function normalizeHeader(e){return e&&String(e).trim().toLowerCase()}function normalizeValue(e){return!1===e||null==e?e:r.default.isArray(e)?e.map(normalizeValue):String(e)}function matchHeaderValue(e,t,o,n,s){return r.default.isFunction(n)?n.call(this,t,o):(s&&(t=o),r.default.isString(t)?r.default.isString(n)?-1!==t.indexOf(n):r.default.isRegExp(n)?n.test(t):void 0:void 0)}class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,t,o){const s=this;function setHeader(e,t,o){const n=normalizeHeader(t);if(!n)throw new Error("header name must be a non-empty string");const a=r.default.findKey(s,n);(!a||void 0===s[a]||!0===o||void 0===o&&!1!==s[a])&&(s[a||t]=normalizeValue(e))}const setHeaders=(e,t)=>r.default.forEach(e,(e,o)=>setHeader(e,o,t));if(r.default.isPlainObject(e)||e instanceof this.constructor)setHeaders(e,t);else if(r.default.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))setHeaders((0,n.default)(e),t);else if(r.default.isObject(e)&&r.default.isIterable(e)){let o,n,s={};for(const t of e){if(!r.default.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[n=t[0]]=(o=s[n])?r.default.isArray(o)?[...o,t[1]]:[o,t[1]]:t[1]}setHeaders(s,t)}else null!=e&&setHeader(t,e,o);return this}get(e,t){if(e=normalizeHeader(e)){const o=r.default.findKey(this,e);if(o){const e=this[o];if(!t)return e;if(!0===t)return function parseTokens(e){const t=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=o.exec(e);)t[r[1]]=r[2];return t}(e);if(r.default.isFunction(t))return t.call(this,e,o);if(r.default.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=normalizeHeader(e)){const o=r.default.findKey(this,e);return!(!o||void 0===this[o]||t&&!matchHeaderValue(0,this[o],o,t))}return!1}delete(e,t){const o=this;let n=!1;function deleteHeader(e){if(e=normalizeHeader(e)){const s=r.default.findKey(o,e);!s||t&&!matchHeaderValue(0,o[s],s,t)||(delete o[s],n=!0)}}return r.default.isArray(e)?e.forEach(deleteHeader):deleteHeader(e),n}clear(e){const t=Object.keys(this);let o=t.length,r=!1;for(;o--;){const n=t[o];e&&!matchHeaderValue(0,this[n],n,e,!0)||(delete this[n],r=!0)}return r}normalize(e){const t=this,o={};return r.default.forEach(this,(n,s)=>{const a=r.default.findKey(o,s);if(a)return t[a]=normalizeValue(n),void delete t[s];const i=e?function formatHeader(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,o)=>t.toUpperCase()+o)}(s):String(s).trim();i!==s&&delete t[s],t[i]=normalizeValue(n),o[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return r.default.forEach(this,(o,n)=>{null!=o&&!1!==o&&(t[n]=e&&r.default.isArray(o)?o.join(", "):o)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const o=new this(e);return t.forEach(e=>o.set(e)),o}static accessor(e){const t=(this[s]=this[s]={accessors:{}}).accessors,o=this.prototype;function defineAccessor(e){const n=normalizeHeader(e);t[n]||(!function buildAccessors(e,t){const o=r.default.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+o,{value:function(e,o,n){return this[r].call(this,t,e,o,n)},configurable:!0})})}(o,e),t[n]=!0)}return r.default.isArray(e)?e.forEach(defineAccessor):defineAccessor(e),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),r.default.reduceDescriptors(AxiosHeaders.prototype,({value:e},t)=>{let o=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[o]=e}}}),r.default.freezeMethods(AxiosHeaders),t.default=AxiosHeaders},"./node_modules/axios/lib/core/InterceptorManager.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/utils.js");t.default=class InterceptorManager{constructor(){this.handlers=[]}use(e,t,o){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!o&&o.synchronous,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){r.default.forEach(this.handlers,function forEachHandler(t){null!==t&&e(t)})}}},"./node_modules/axios/lib/core/buildFullPath.js":function(e,t,o){o.r(t),o.d(t,{default:function(){return buildFullPath}});var r=o("./node_modules/axios/lib/helpers/isAbsoluteURL.js"),n=o("./node_modules/axios/lib/helpers/combineURLs.js");function buildFullPath(e,t,o){let s=!(0,r.default)(t);return e&&(s||0==o)?(0,n.default)(e,t):t}},"./node_modules/axios/lib/core/dispatchRequest.js":function(e,t,o){o.r(t),o.d(t,{default:function(){return dispatchRequest}});var r=o("./node_modules/axios/lib/core/transformData.js"),n=o("./node_modules/axios/lib/cancel/isCancel.js"),s=o("./node_modules/axios/lib/defaults/index.js"),a=o("./node_modules/axios/lib/cancel/CanceledError.js"),i=o("./node_modules/axios/lib/core/AxiosHeaders.js"),l=o("./node_modules/axios/lib/adapters/adapters.js");function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a.default(null,e)}function dispatchRequest(e){throwIfCancellationRequested(e),e.headers=i.default.from(e.headers),e.data=r.default.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return l.default.getAdapter(e.adapter||s.default.adapter,e)(e).then(function onAdapterResolution(t){return throwIfCancellationRequested(e),t.data=r.default.call(e,e.transformResponse,t),t.headers=i.default.from(t.headers),t},function onAdapterRejection(t){return(0,n.default)(t)||(throwIfCancellationRequested(e),t&&t.response&&(t.response.data=r.default.call(e,e.transformResponse,t.response),t.response.headers=i.default.from(t.response.headers))),Promise.reject(t)})}},"./node_modules/axios/lib/core/mergeConfig.js":function(e,t,o){o.r(t),o.d(t,{default:function(){return mergeConfig}});var r=o("./node_modules/axios/lib/utils.js"),n=o("./node_modules/axios/lib/core/AxiosHeaders.js");const headersToObject=e=>e instanceof n.default?{...e}:e;function mergeConfig(e,t){t=t||{};const o={};function getMergedValue(e,t,o,n){return r.default.isPlainObject(e)&&r.default.isPlainObject(t)?r.default.merge.call({caseless:n},e,t):r.default.isPlainObject(t)?r.default.merge({},t):r.default.isArray(t)?t.slice():t}function mergeDeepProperties(e,t,o,n){return r.default.isUndefined(t)?r.default.isUndefined(e)?void 0:getMergedValue(void 0,e,0,n):getMergedValue(e,t,0,n)}function valueFromConfig2(e,t){if(!r.default.isUndefined(t))return getMergedValue(void 0,t)}function defaultToConfig2(e,t){return r.default.isUndefined(t)?r.default.isUndefined(e)?void 0:getMergedValue(void 0,e):getMergedValue(void 0,t)}function mergeDirectKeys(o,r,n){return n in t?getMergedValue(o,r):n in e?getMergedValue(void 0,o):void 0}const n={url:valueFromConfig2,method:valueFromConfig2,data:valueFromConfig2,baseURL:defaultToConfig2,transformRequest:defaultToConfig2,transformResponse:defaultToConfig2,paramsSerializer:defaultToConfig2,timeout:defaultToConfig2,timeoutMessage:defaultToConfig2,withCredentials:defaultToConfig2,withXSRFToken:defaultToConfig2,adapter:defaultToConfig2,responseType:defaultToConfig2,xsrfCookieName:defaultToConfig2,xsrfHeaderName:defaultToConfig2,onUploadProgress:defaultToConfig2,onDownloadProgress:defaultToConfig2,decompress:defaultToConfig2,maxContentLength:defaultToConfig2,maxBodyLength:defaultToConfig2,beforeRedirect:defaultToConfig2,transport:defaultToConfig2,httpAgent:defaultToConfig2,httpsAgent:defaultToConfig2,cancelToken:defaultToConfig2,socketPath:defaultToConfig2,responseEncoding:defaultToConfig2,validateStatus:mergeDirectKeys,headers:(e,t,o)=>mergeDeepProperties(headersToObject(e),headersToObject(t),0,!0)};return r.default.forEach(Object.keys({...e,...t}),function computeConfigValue(s){const a=n[s]||mergeDeepProperties,i=a(e[s],t[s],s);r.default.isUndefined(i)&&a!==mergeDirectKeys||(o[s]=i)}),o}},"./node_modules/axios/lib/core/settle.js":function(e,t,o){o.r(t),o.d(t,{default:function(){return settle}});var r=o("./node_modules/axios/lib/core/AxiosError.js");function settle(e,t,o){const n=o.config.validateStatus;o.status&&n&&!n(o.status)?t(new r.default("Request failed with status code "+o.status,[r.default.ERR_BAD_REQUEST,r.default.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o)):e(o)}},"./node_modules/axios/lib/core/transformData.js":function(e,t,o){o.r(t),o.d(t,{default:function(){return transformData}});var r=o("./node_modules/axios/lib/utils.js"),n=o("./node_modules/axios/lib/defaults/index.js"),s=o("./node_modules/axios/lib/core/AxiosHeaders.js");function transformData(e,t){const o=this||n.default,a=t||o,i=s.default.from(a.headers);let l=a.data;return r.default.forEach(e,function transform(e){l=e.call(o,l,i.normalize(),t?t.status:void 0)}),i.normalize(),l}},"./node_modules/axios/lib/defaults/index.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/utils.js"),n=o("./node_modules/axios/lib/core/AxiosError.js"),s=o("./node_modules/axios/lib/defaults/transitional.js"),a=o("./node_modules/axios/lib/helpers/toFormData.js"),i=o("./node_modules/axios/lib/helpers/toURLEncodedForm.js"),l=o("./node_modules/axios/lib/platform/index.js"),u=o("./node_modules/axios/lib/helpers/formDataToJSON.js");const d={transitional:s.default,adapter:["xhr","http","fetch"],transformRequest:[function transformRequest(e,t){const o=t.getContentType()||"",n=o.indexOf("application/json")>-1,s=r.default.isObject(e);s&&r.default.isHTMLForm(e)&&(e=new FormData(e));if(r.default.isFormData(e))return n?JSON.stringify((0,u.default)(e)):e;if(r.default.isArrayBuffer(e)||r.default.isBuffer(e)||r.default.isStream(e)||r.default.isFile(e)||r.default.isBlob(e)||r.default.isReadableStream(e))return e;if(r.default.isArrayBufferView(e))return e.buffer;if(r.default.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(s){if(o.indexOf("application/x-www-form-urlencoded")>-1)return(0,i.default)(e,this.formSerializer).toString();if((l=r.default.isFileList(e))||o.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return(0,a.default)(l?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||n?(t.setContentType("application/json",!1),function stringifySafely(e,t,o){if(r.default.isString(e))try{return(t||JSON.parse)(e),r.default.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(o||JSON.stringify)(e)}(e)):e}],transformResponse:[function transformResponse(e){const t=this.transitional||d.transitional,o=t&&t.forcedJSONParsing,s="json"===this.responseType;if(r.default.isResponse(e)||r.default.isReadableStream(e))return e;if(e&&r.default.isString(e)&&(o&&!this.responseType||s)){const o=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(e){if(o){if("SyntaxError"===e.name)throw n.default.from(e,n.default.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:l.default.classes.FormData,Blob:l.default.classes.Blob},validateStatus:function validateStatus(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};r.default.forEach(["delete","get","head","post","put","patch"],e=>{d.headers[e]={}}),t.default=d},"./node_modules/axios/lib/defaults/transitional.js":function(e,t,o){o.r(t),t.default={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},"./node_modules/axios/lib/env/data.js":function(e,t,o){o.r(t),o.d(t,{VERSION:function(){return r}});const r="1.13.2"},"./node_modules/axios/lib/helpers/AxiosURLSearchParams.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/helpers/toFormData.js");function encode(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function replacer(e){return t[e]})}function AxiosURLSearchParams(e,t){this._pairs=[],e&&(0,r.default)(e,this,t)}const n=AxiosURLSearchParams.prototype;n.append=function append(e,t){this._pairs.push([e,t])},n.toString=function toString(e){const t=e?function(t){return e.call(this,t,encode)}:encode;return this._pairs.map(function each(e){return t(e[0])+"="+t(e[1])},"").join("&")},t.default=AxiosURLSearchParams},"./node_modules/axios/lib/helpers/HttpStatusCode.js":function(e,t,o){o.r(t);const r={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(r).forEach(([e,t])=>{r[t]=e}),t.default=r},"./node_modules/axios/lib/helpers/bind.js":function(e,t,o){function bind(e,t){return function wrap(){return e.apply(t,arguments)}}o.r(t),o.d(t,{default:function(){return bind}})},"./node_modules/axios/lib/helpers/buildURL.js":function(e,t,o){o.r(t),o.d(t,{default:function(){return buildURL}});var r=o("./node_modules/axios/lib/utils.js"),n=o("./node_modules/axios/lib/helpers/AxiosURLSearchParams.js");function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function buildURL(e,t,o){if(!t)return e;const s=o&&o.encode||encode;r.default.isFunction(o)&&(o={serialize:o});const a=o&&o.serialize;let i;if(i=a?a(t,o):r.default.isURLSearchParams(t)?t.toString():new n.default(t,o).toString(s),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},"./node_modules/axios/lib/helpers/combineURLs.js":function(e,t,o){function combineURLs(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}o.r(t),o.d(t,{default:function(){return combineURLs}})},"./node_modules/axios/lib/helpers/composeSignals.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/cancel/CanceledError.js"),n=o("./node_modules/axios/lib/core/AxiosError.js"),s=o("./node_modules/axios/lib/utils.js");t.default=(e,t)=>{const{length:o}=e=e?e.filter(Boolean):[];if(t||o){let o,a=new AbortController;const onabort=function(e){if(!o){o=!0,unsubscribe();const t=e instanceof Error?e:this.reason;a.abort(t instanceof n.default?t:new r.default(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,onabort(new n.default(`timeout ${t} of ms exceeded`,n.default.ETIMEDOUT))},t);const unsubscribe=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(onabort):e.removeEventListener("abort",onabort)}),e=null)};e.forEach(e=>e.addEventListener("abort",onabort));const{signal:l}=a;return l.unsubscribe=()=>s.default.asap(unsubscribe),l}}},"./node_modules/axios/lib/helpers/cookies.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/utils.js"),n=o("./node_modules/axios/lib/platform/index.js");t.default=n.default.hasStandardBrowserEnv?{write(e,t,o,n,s,a,i){if("undefined"==typeof document)return;const l=[`${e}=${encodeURIComponent(t)}`];r.default.isNumber(o)&&l.push(`expires=${new Date(o).toUTCString()}`),r.default.isString(n)&&l.push(`path=${n}`),r.default.isString(s)&&l.push(`domain=${s}`),!0===a&&l.push("secure"),r.default.isString(i)&&l.push(`SameSite=${i}`),document.cookie=l.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}}},"./node_modules/axios/lib/helpers/formDataToJSON.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/utils.js");t.default=function formDataToJSON(e){function buildPath(e,t,o,n){let s=e[n++];if("__proto__"===s)return!0;const a=Number.isFinite(+s),i=n>=e.length;if(s=!s&&r.default.isArray(o)?o.length:s,i)return r.default.hasOwnProp(o,s)?o[s]=[o[s],t]:o[s]=t,!a;o[s]&&r.default.isObject(o[s])||(o[s]=[]);return buildPath(e,t,o[s],n)&&r.default.isArray(o[s])&&(o[s]=function arrayToObject(e){const t={},o=Object.keys(e);let r;const n=o.length;let s;for(r=0;r<n;r++)s=o[r],t[s]=e[s];return t}(o[s])),!a}if(r.default.isFormData(e)&&r.default.isFunction(e.entries)){const t={};return r.default.forEachEntry(e,(e,o)=>{buildPath(function parsePropPath(e){return r.default.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),o,t,0)}),t}return null}},"./node_modules/axios/lib/helpers/isAbsoluteURL.js":function(e,t,o){function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}o.r(t),o.d(t,{default:function(){return isAbsoluteURL}})},"./node_modules/axios/lib/helpers/isAxiosError.js":function(e,t,o){o.r(t),o.d(t,{default:function(){return isAxiosError}});var r=o("./node_modules/axios/lib/utils.js");function isAxiosError(e){return r.default.isObject(e)&&!0===e.isAxiosError}},"./node_modules/axios/lib/helpers/isURLSameOrigin.js":function(e,t,o){o.r(t);var r,n,s=o("./node_modules/axios/lib/platform/index.js");t.default=s.default.hasStandardBrowserEnv?(r=new URL(s.default.origin),n=s.default.navigator&&/(msie|trident)/i.test(s.default.navigator.userAgent),e=>(e=new URL(e,s.default.origin),r.protocol===e.protocol&&r.host===e.host&&(n||r.port===e.port))):()=>!0},"./node_modules/axios/lib/helpers/null.js":function(e,t,o){o.r(t),t.default=null},"./node_modules/axios/lib/helpers/parseHeaders.js":function(e,t,o){o.r(t);const r=o("./node_modules/axios/lib/utils.js").default.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);t.default=e=>{const t={};let o,n,s;return e&&e.split("\n").forEach(function parser(e){s=e.indexOf(":"),o=e.substring(0,s).trim().toLowerCase(),n=e.substring(s+1).trim(),!o||t[o]&&r[o]||("set-cookie"===o?t[o]?t[o].push(n):t[o]=[n]:t[o]=t[o]?t[o]+", "+n:n)}),t}},"./node_modules/axios/lib/helpers/parseProtocol.js":function(e,t,o){function parseProtocol(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}o.r(t),o.d(t,{default:function(){return parseProtocol}})},"./node_modules/axios/lib/helpers/progressEventReducer.js":function(e,t,o){o.r(t),o.d(t,{asyncDecorator:function(){return asyncDecorator},progressEventDecorator:function(){return progressEventDecorator},progressEventReducer:function(){return progressEventReducer}});var r=o("./node_modules/axios/lib/helpers/speedometer.js"),n=o("./node_modules/axios/lib/helpers/throttle.js"),s=o("./node_modules/axios/lib/utils.js");const progressEventReducer=(e,t,o=3)=>{let s=0;const a=(0,r.default)(50,250);return(0,n.default)(o=>{const r=o.loaded,n=o.lengthComputable?o.total:void 0,i=r-s,l=a(i);s=r;e({loaded:r,total:n,progress:n?r/n:void 0,bytes:i,rate:l||void 0,estimated:l&&n&&r<=n?(n-r)/l:void 0,event:o,lengthComputable:null!=n,[t?"download":"upload"]:!0})},o)},progressEventDecorator=(e,t)=>{const o=null!=e;return[r=>t[0]({lengthComputable:o,total:e,loaded:r}),t[1]]},asyncDecorator=e=>(...t)=>s.default.asap(()=>e(...t))},"./node_modules/axios/lib/helpers/resolveConfig.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/platform/index.js"),n=o("./node_modules/axios/lib/utils.js"),s=o("./node_modules/axios/lib/helpers/isURLSameOrigin.js"),a=o("./node_modules/axios/lib/helpers/cookies.js"),i=o("./node_modules/axios/lib/core/buildFullPath.js"),l=o("./node_modules/axios/lib/core/mergeConfig.js"),u=o("./node_modules/axios/lib/core/AxiosHeaders.js"),d=o("./node_modules/axios/lib/helpers/buildURL.js");t.default=e=>{const t=(0,l.default)({},e);let{data:o,withXSRFToken:c,xsrfHeaderName:f,xsrfCookieName:p,headers:m,auth:h}=t;if(t.headers=m=u.default.from(m),t.url=(0,d.default)((0,i.default)(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),h&&m.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):""))),n.default.isFormData(o))if(r.default.hasStandardBrowserEnv||r.default.hasStandardBrowserWebWorkerEnv)m.setContentType(void 0);else if(n.default.isFunction(o.getHeaders)){const e=o.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,o])=>{t.includes(e.toLowerCase())&&m.set(e,o)})}if(r.default.hasStandardBrowserEnv&&(c&&n.default.isFunction(c)&&(c=c(t)),c||!1!==c&&(0,s.default)(t.url))){const e=f&&p&&a.default.read(p);e&&m.set(f,e)}return t}},"./node_modules/axios/lib/helpers/speedometer.js":function(e,t,o){o.r(t),t.default=function speedometer(e,t){e=e||10;const o=new Array(e),r=new Array(e);let n,s=0,a=0;return t=void 0!==t?t:1e3,function push(i){const l=Date.now(),u=r[a];n||(n=l),o[s]=i,r[s]=l;let d=a,c=0;for(;d!==s;)c+=o[d++],d%=e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),l-n<t)return;const f=u&&l-u;return f?Math.round(1e3*c/f):void 0}}},"./node_modules/axios/lib/helpers/spread.js":function(e,t,o){function spread(e){return function wrap(t){return e.apply(null,t)}}o.r(t),o.d(t,{default:function(){return spread}})},"./node_modules/axios/lib/helpers/throttle.js":function(e,t,o){o.r(t),t.default=function throttle(e,t){let o,r,n=0,s=1e3/t;const invoke=(t,s=Date.now())=>{n=s,o=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-n;a>=s?invoke(e,t):(o=e,r||(r=setTimeout(()=>{r=null,invoke(o)},s-a)))},()=>o&&invoke(o)]}},"./node_modules/axios/lib/helpers/toFormData.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/utils.js"),n=o("./node_modules/axios/lib/core/AxiosError.js"),s=o("./node_modules/axios/lib/helpers/null.js");function isVisitable(e){return r.default.isPlainObject(e)||r.default.isArray(e)}function removeBrackets(e){return r.default.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey(e,t,o){return e?e.concat(t).map(function each(e,t){return e=removeBrackets(e),!o&&t?"["+e+"]":e}).join(o?".":""):t}const a=r.default.toFlatObject(r.default,{},null,function filter(e){return/^is[A-Z]/.test(e)});t.default=function toFormData(e,t,o){if(!r.default.isObject(e))throw new TypeError("target must be an object");t=t||new(s.default||FormData);const i=(o=r.default.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function defined(e,t){return!r.default.isUndefined(t[e])})).metaTokens,l=o.visitor||defaultVisitor,u=o.dots,d=o.indexes,c=(o.Blob||"undefined"!=typeof Blob&&Blob)&&r.default.isSpecCompliantForm(t);if(!r.default.isFunction(l))throw new TypeError("visitor must be a function");function convertValue(e){if(null===e)return"";if(r.default.isDate(e))return e.toISOString();if(r.default.isBoolean(e))return e.toString();if(!c&&r.default.isBlob(e))throw new n.default("Blob is not supported. Use a Buffer instead.");return r.default.isArrayBuffer(e)||r.default.isTypedArray(e)?c&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function defaultVisitor(e,o,n){let s=e;if(e&&!n&&"object"==typeof e)if(r.default.endsWith(o,"{}"))o=i?o:o.slice(0,-2),e=JSON.stringify(e);else if(r.default.isArray(e)&&function isFlatArray(e){return r.default.isArray(e)&&!e.some(isVisitable)}(e)||(r.default.isFileList(e)||r.default.endsWith(o,"[]"))&&(s=r.default.toArray(e)))return o=removeBrackets(o),s.forEach(function each(e,n){!r.default.isUndefined(e)&&null!==e&&t.append(!0===d?renderKey([o],n,u):null===d?o:o+"[]",convertValue(e))}),!1;return!!isVisitable(e)||(t.append(renderKey(n,o,u),convertValue(e)),!1)}const f=[],p=Object.assign(a,{defaultVisitor:defaultVisitor,convertValue:convertValue,isVisitable:isVisitable});if(!r.default.isObject(e))throw new TypeError("data must be an object");return function build(e,o){if(!r.default.isUndefined(e)){if(-1!==f.indexOf(e))throw Error("Circular reference detected in "+o.join("."));f.push(e),r.default.forEach(e,function each(e,n){!0===(!(r.default.isUndefined(e)||null===e)&&l.call(t,e,r.default.isString(n)?n.trim():n,o,p))&&build(e,o?o.concat(n):[n])}),f.pop()}}(e),t}},"./node_modules/axios/lib/helpers/toURLEncodedForm.js":function(e,t,o){o.r(t),o.d(t,{default:function(){return toURLEncodedForm}});var r=o("./node_modules/axios/lib/utils.js"),n=o("./node_modules/axios/lib/helpers/toFormData.js"),s=o("./node_modules/axios/lib/platform/index.js");function toURLEncodedForm(e,t){return(0,n.default)(e,new s.default.classes.URLSearchParams,{visitor:function(e,t,o,n){return s.default.isNode&&r.default.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}},"./node_modules/axios/lib/helpers/trackStream.js":function(e,t,o){o.r(t),o.d(t,{readBytes:function(){return readBytes},streamChunk:function(){return streamChunk},trackStream:function(){return trackStream}});const streamChunk=function*(e,t){let o=e.byteLength;if(!t||o<t)return void(yield e);let r,n=0;for(;n<o;)r=n+t,yield e.slice(n,r),n=r},readBytes=async function*(e,t){for await(const o of readStream(e))yield*streamChunk(o,t)},readStream=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:o}=await t.read();if(e)break;yield o}}finally{await t.cancel()}},trackStream=(e,t,o,r)=>{const n=readBytes(e,t);let s,a=0,_onFinish=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await n.next();if(t)return _onFinish(),void e.close();let s=r.byteLength;if(o){let e=a+=s;o(e)}e.enqueue(new Uint8Array(r))}catch(e){throw _onFinish(e),e}},cancel(e){return _onFinish(e),n.return()}},{highWaterMark:2})}},"./node_modules/axios/lib/helpers/validator.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/env/data.js"),n=o("./node_modules/axios/lib/core/AxiosError.js");const s={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{s[e]=function validator(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const a={};s.transitional=function transitional(e,t,o){function formatMessage(e,t){return"[Axios v"+r.VERSION+"] Transitional option '"+e+"'"+t+(o?". "+o:"")}return(o,r,s)=>{if(!1===e)throw new n.default(formatMessage(r," has been removed"+(t?" in "+t:"")),n.default.ERR_DEPRECATED);return t&&!a[r]&&(a[r]=!0,console.warn(formatMessage(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(o,r,s)}},s.spelling=function spelling(e){return(t,o)=>(console.warn(`${o} is likely a misspelling of ${e}`),!0)},t.default={assertOptions:function assertOptions(e,t,o){if("object"!=typeof e)throw new n.default("options must be an object",n.default.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const a=r[s],i=t[a];if(i){const t=e[a],o=void 0===t||i(t,a,e);if(!0!==o)throw new n.default("option "+a+" must be "+o,n.default.ERR_BAD_OPTION_VALUE);continue}if(!0!==o)throw new n.default("Unknown option "+a,n.default.ERR_BAD_OPTION)}},validators:s}},"./node_modules/axios/lib/platform/browser/classes/Blob.js":function(e,t,o){o.r(t),t.default="undefined"!=typeof Blob?Blob:null},"./node_modules/axios/lib/platform/browser/classes/FormData.js":function(e,t,o){o.r(t),t.default="undefined"!=typeof FormData?FormData:null},"./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/helpers/AxiosURLSearchParams.js");t.default="undefined"!=typeof URLSearchParams?URLSearchParams:r.default},"./node_modules/axios/lib/platform/browser/index.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js"),n=o("./node_modules/axios/lib/platform/browser/classes/FormData.js"),s=o("./node_modules/axios/lib/platform/browser/classes/Blob.js");t.default={isBrowser:!0,classes:{URLSearchParams:r.default,FormData:n.default,Blob:s.default},protocols:["http","https","file","blob","url","data"]}},"./node_modules/axios/lib/platform/common/utils.js":function(e,t,o){o.r(t),o.d(t,{hasBrowserEnv:function(){return r},hasStandardBrowserEnv:function(){return s},hasStandardBrowserWebWorkerEnv:function(){return a},navigator:function(){return n},origin:function(){return i}});const r="undefined"!=typeof window&&"undefined"!=typeof document,n="object"==typeof navigator&&navigator||void 0,s=r&&(!n||["ReactNative","NativeScript","NS"].indexOf(n.product)<0),a="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,i=r&&window.location.href||"http://localhost"},"./node_modules/axios/lib/platform/index.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/platform/browser/index.js"),n=o("./node_modules/axios/lib/platform/common/utils.js");t.default={...n,...r.default}},"./node_modules/axios/lib/utils.js":function(e,t,o){o.r(t);var r=o("./node_modules/axios/lib/helpers/bind.js");const{toString:n}=Object.prototype,{getPrototypeOf:s}=Object,{iterator:a,toStringTag:i}=Symbol,l=(u=Object.create(null),e=>{const t=n.call(e);return u[t]||(u[t]=t.slice(8,-1).toLowerCase())});var u;const kindOfTest=e=>(e=e.toLowerCase(),t=>l(t)===e),typeOfTest=e=>t=>typeof t===e,{isArray:d}=Array,c=typeOfTest("undefined");function isBuffer(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&m(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const f=kindOfTest("ArrayBuffer");const p=typeOfTest("string"),m=typeOfTest("function"),h=typeOfTest("number"),isObject=e=>null!==e&&"object"==typeof e,isPlainObject=e=>{if("object"!==l(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||i in e||a in e)},b=kindOfTest("Date"),g=kindOfTest("File"),x=kindOfTest("Blob"),_=kindOfTest("FileList"),y=kindOfTest("URLSearchParams"),[j,w,E,R]=["ReadableStream","Request","Response","Headers"].map(kindOfTest);function forEach(e,t,{allOwnKeys:o=!1}={}){if(null==e)return;let r,n;if("object"!=typeof e&&(e=[e]),d(e))for(r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else{if(isBuffer(e))return;const n=o?Object.getOwnPropertyNames(e):Object.keys(e),s=n.length;let a;for(r=0;r<s;r++)a=n[r],t.call(null,e[a],a,e)}}function findKey(e,t){if(isBuffer(e))return null;t=t.toLowerCase();const o=Object.keys(e);let r,n=o.length;for(;n-- >0;)if(r=o[n],t===r.toLowerCase())return r;return null}const v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,isContextDefined=e=>!c(e)&&e!==v;const S=(A="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>A&&e instanceof A);var A;const C=kindOfTest("HTMLFormElement"),O=(({hasOwnProperty:e})=>(t,o)=>e.call(t,o))(Object.prototype),T=kindOfTest("RegExp"),reduceDescriptors=(e,t)=>{const o=Object.getOwnPropertyDescriptors(e),r={};forEach(o,(o,n)=>{let s;!1!==(s=t(o,n,e))&&(r[n]=s||o)}),Object.defineProperties(e,r)};const U=kindOfTest("AsyncFunction"),P=(k="function"==typeof setImmediate,F=m(v.postMessage),k?setImmediate:F?(L=`axios@${Math.random()}`,N=[],v.addEventListener("message",({source:e,data:t})=>{e===v&&t===L&&N.length&&N.shift()()},!1),e=>{N.push(e),v.postMessage(L,"*")}):e=>setTimeout(e));var k,F,L,N;const D="undefined"!=typeof queueMicrotask?queueMicrotask.bind(v):"undefined"!=typeof process&&process.nextTick||P;t.default={isArray:d,isArrayBuffer:f,isBuffer:isBuffer,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||m(e.append)&&("formdata"===(t=l(e))||"object"===t&&m(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function isArrayBufferView(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer),t},isString:p,isNumber:h,isBoolean:e=>!0===e||!1===e,isObject:isObject,isPlainObject:isPlainObject,isEmptyObject:e=>{if(!isObject(e)||isBuffer(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:j,isRequest:w,isResponse:E,isHeaders:R,isUndefined:c,isDate:b,isFile:g,isBlob:x,isRegExp:T,isFunction:m,isStream:e=>isObject(e)&&m(e.pipe),isURLSearchParams:y,isTypedArray:S,isFileList:_,forEach:forEach,merge:function merge(){const{caseless:e,skipUndefined:t}=isContextDefined(this)&&this||{},o={},assignValue=(r,n)=>{const s=e&&findKey(o,n)||n;isPlainObject(o[s])&&isPlainObject(r)?o[s]=merge(o[s],r):isPlainObject(r)?o[s]=merge({},r):d(r)?o[s]=r.slice():t&&c(r)||(o[s]=r)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&forEach(arguments[e],assignValue);return o},extend:(e,t,o,{allOwnKeys:n}={})=>(forEach(t,(t,n)=>{o&&m(t)?e[n]=(0,r.default)(t,o):e[n]=t},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,o,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),o&&Object.assign(e.prototype,o)},toFlatObject:(e,t,o,r)=>{let n,a,i;const l={};if(t=t||{},null==e)return t;do{for(n=Object.getOwnPropertyNames(e),a=n.length;a-- >0;)i=n[a],r&&!r(i,e,t)||l[i]||(t[i]=e[i],l[i]=!0);e=!1!==o&&s(e)}while(e&&(!o||o(e,t))&&e!==Object.prototype);return t},kindOf:l,kindOfTest:kindOfTest,endsWith:(e,t,o)=>{e=String(e),(void 0===o||o>e.length)&&(o=e.length),o-=t.length;const r=e.indexOf(t,o);return-1!==r&&r===o},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!h(t))return null;const o=new Array(t);for(;t-- >0;)o[t]=e[t];return o},forEachEntry:(e,t)=>{const o=(e&&e[a]).call(e);let r;for(;(r=o.next())&&!r.done;){const o=r.value;t.call(e,o[0],o[1])}},matchAll:(e,t)=>{let o;const r=[];for(;null!==(o=e.exec(t));)r.push(o);return r},isHTMLForm:C,hasOwnProperty:O,hasOwnProp:O,reduceDescriptors:reduceDescriptors,freezeMethods:e=>{reduceDescriptors(e,(t,o)=>{if(m(e)&&-1!==["arguments","caller","callee"].indexOf(o))return!1;const r=e[o];m(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")}))})},toObjectSet:(e,t)=>{const o={},define=e=>{e.forEach(e=>{o[e]=!0})};return d(e)?define(e):define(String(e).split(t)),o},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function replacer(e,t,o){return t.toUpperCase()+o}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:findKey,global:v,isContextDefined:isContextDefined,isSpecCompliantForm:function isSpecCompliantForm(e){return!!(e&&m(e.append)&&"FormData"===e[i]&&e[a])},toJSONObject:e=>{const t=new Array(10),visit=(e,o)=>{if(isObject(e)){if(t.indexOf(e)>=0)return;if(isBuffer(e))return e;if(!("toJSON"in e)){t[o]=e;const r=d(e)?[]:{};return forEach(e,(e,t)=>{const n=visit(e,o+1);!c(n)&&(r[t]=n)}),t[o]=void 0,r}}return e};return visit(e,0)},isAsyncFn:U,isThenable:e=>e&&(isObject(e)||m(e))&&m(e.then)&&m(e.catch),setImmediate:P,asap:D,isIterable:e=>null!=e&&m(e[a])}},"./packages/packages/libs/http-client/src/env.ts":function(e,t,o){o.r(t),o.d(t,{env:function(){return n}});var r=o("@elementor/env");const{env:n}=(0,r.parseEnv)("@elementor/http-client")},"./packages/packages/libs/http-client/src/http.ts":function(e,t,o){o.r(t),o.d(t,{httpService:function(){return httpService},registerUrlForCache:function(){return registerUrlForCache}});var r=o("./node_modules/axios/lib/axios.js"),n=o("./packages/packages/libs/http-client/src/env.ts");const s=2e4,a=new Map,i=new Map;function registerUrlForCache(e,t=s){i.set(e,t)}function getUrlCacheTtl(e){for(const[t,o]of i)if(e.includes(t))return o;return null}function getCacheKey(e){const t=e.url??"",o=e.params?JSON.stringify(e.params):"";return`${e.baseURL??""}${t}${o}`}const l=new Set(["get","head","options","put","delete"]);let u;const httpService=()=>(u||(u=r.default.create({baseURL:n.env.base_url,timeout:1e4,headers:{"Content-Type":"application/json",...n.env.headers}}),u.interceptors.request.use(e=>{const t=function getCachedResponse(e){if("get"!==e.method?.toLowerCase())return null;const t=getUrlCacheTtl(`${e.baseURL??""}${e.url??""}`);if(null===t)return null;const o=getCacheKey(e),r=a.get(o);return r?Date.now()-r.timestamp>t?(a.delete(o),null):r.response:null}(e);if(t){const o=new AbortController;return o.abort(),{...e,signal:o.signal,__cachedResponse:t}}return e}),u.interceptors.response.use(e=>(function setCachedResponse(e,t){if(!e||"get"!==e.method?.toLowerCase())return;if(null===getUrlCacheTtl(`${e.baseURL??""}${e.url??""}`))return;const o=getCacheKey(e);a.set(o,{response:t,timestamp:Date.now()})}(e.config,e),e),async e=>{const t=e.config;if(t?.__cachedResponse)return t.__cachedResponse;if(!t||!function shouldRetry(e){const t=e.config?.method?.toLowerCase();if(t&&!l.has(t))return!1;if(!e.response)return!0;if(429===e.response.status)return!0;return e.response.status>=500}(e))return Promise.reject(e);const o=t.__retryCount??0;if(o>=3)return Promise.reject(e);const r=1e3*Math.pow(2,o),n=1e3*Math.random()*.1;await function sleep(e){return new Promise(t=>setTimeout(t,e))}(r+n);const s=t.__baseTimeout??t.timeout??1e4;return u({...t,__retryCount:o+1,__baseTimeout:s,timeout:s*(o+2)})})),u)},"@elementor/env":function(e){e.exports=window.elementorV2.env}},t={};function __webpack_require__(o){var r=t[o];if(void 0!==r)return r.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=function(e,t){for(var o in t)__webpack_require__.o(t,o)&&!__webpack_require__.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){__webpack_require__.r(o),__webpack_require__.d(o,{AxiosError:function(){return e.AxiosError},httpService:function(){return t.httpService},registerUrlForCache:function(){return t.registerUrlForCache}});var e=__webpack_require__("./node_modules/axios/index.js"),t=__webpack_require__("./packages/packages/libs/http-client/src/http.ts")}(),(window.elementorV2=window.elementorV2||{}).httpClient=o}(),window.elementorV2.httpClient?.init?.(); | |
| 1 | +(function(_elementor_env) { | |
| 2 | + | |
| 3 | +//#region \0rolldown/runtime.js | |
| 4 | + var __defProp = Object.defineProperty; | |
| 5 | + var __name = (target, value) => __defProp(target, "name", { | |
| 6 | + value, | |
| 7 | + configurable: true | |
| 8 | + }); | |
| 9 | + var __exportAll = (all, no_symbols) => { | |
| 10 | + let target = {}; | |
| 11 | + for (var name in all) { | |
| 12 | + __defProp(target, name, { | |
| 13 | + get: all[name], | |
| 14 | + enumerable: true | |
| 15 | + }); | |
| 16 | + } | |
| 17 | + if (!no_symbols) { | |
| 18 | + __defProp(target, Symbol.toStringTag, { value: "Module" }); | |
| 19 | + } | |
| 20 | + return target; | |
| 21 | + }; | |
| 22 | + | |
| 23 | +//#endregion | |
| 24 | + | |
| 25 | +//#region node_modules/axios/lib/helpers/bind.js | |
| 26 | +/** | |
| 27 | + * Create a bound version of a function with a specified `this` context | |
| 28 | + * | |
| 29 | + * @param {Function} fn - The function to bind | |
| 30 | + * @param {*} thisArg - The value to be passed as the `this` parameter | |
| 31 | + * @returns {Function} A new function that will call the original function with the specified `this` context | |
| 32 | + */ | |
| 33 | + function bind(fn, thisArg) { | |
| 34 | + return function wrap() { | |
| 35 | + return fn.apply(thisArg, arguments); | |
| 36 | + }; | |
| 37 | + } | |
| 38 | + | |
| 39 | +//#endregion | |
| 40 | +//#region node_modules/axios/lib/utils.js | |
| 41 | + var { toString } = Object.prototype; | |
| 42 | + var { getPrototypeOf } = Object; | |
| 43 | + var { iterator, toStringTag } = Symbol; | |
| 44 | + var kindOf = ((cache) => (thing) => { | |
| 45 | + const str = toString.call(thing); | |
| 46 | + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); | |
| 47 | + })(Object.create(null)); | |
| 48 | + var kindOfTest = (type) => { | |
| 49 | + type = type.toLowerCase(); | |
| 50 | + return (thing) => kindOf(thing) === type; | |
| 51 | + }; | |
| 52 | + var typeOfTest = (type) => (thing) => typeof thing === type; | |
| 53 | + /** | |
| 54 | + * Determine if a value is an Array | |
| 55 | + * | |
| 56 | + * @param {Object} val The value to test | |
| 57 | + * | |
| 58 | + * @returns {boolean} True if value is an Array, otherwise false | |
| 59 | + */ | |
| 60 | + var { isArray } = Array; | |
| 61 | + /** | |
| 62 | + * Determine if a value is undefined | |
| 63 | + * | |
| 64 | + * @param {*} val The value to test | |
| 65 | + * | |
| 66 | + * @returns {boolean} True if the value is undefined, otherwise false | |
| 67 | + */ | |
| 68 | + var isUndefined = typeOfTest("undefined"); | |
| 69 | + /** | |
| 70 | + * Determine if a value is a Buffer | |
| 71 | + * | |
| 72 | + * @param {*} val The value to test | |
| 73 | + * | |
| 74 | + * @returns {boolean} True if value is a Buffer, otherwise false | |
| 75 | + */ | |
| 76 | + function isBuffer(val) { | |
| 77 | + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val); | |
| 78 | + } | |
| 79 | + /** | |
| 80 | + * Determine if a value is an ArrayBuffer | |
| 81 | + * | |
| 82 | + * @param {*} val The value to test | |
| 83 | + * | |
| 84 | + * @returns {boolean} True if value is an ArrayBuffer, otherwise false | |
| 85 | + */ | |
| 86 | + var isArrayBuffer = kindOfTest("ArrayBuffer"); | |
| 87 | + /** | |
| 88 | + * Determine if a value is a view on an ArrayBuffer | |
| 89 | + * | |
| 90 | + * @param {*} val The value to test | |
| 91 | + * | |
| 92 | + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false | |
| 93 | + */ | |
| 94 | + function isArrayBufferView(val) { | |
| 95 | + let result; | |
| 96 | + if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) result = ArrayBuffer.isView(val); | |
| 97 | + else result = val && val.buffer && isArrayBuffer(val.buffer); | |
| 98 | + return result; | |
| 99 | + } | |
| 100 | + /** | |
| 101 | + * Determine if a value is a String | |
| 102 | + * | |
| 103 | + * @param {*} val The value to test | |
| 104 | + * | |
| 105 | + * @returns {boolean} True if value is a String, otherwise false | |
| 106 | + */ | |
| 107 | + var isString = typeOfTest("string"); | |
| 108 | + /** | |
| 109 | + * Determine if a value is a Function | |
| 110 | + * | |
| 111 | + * @param {*} val The value to test | |
| 112 | + * @returns {boolean} True if value is a Function, otherwise false | |
| 113 | + */ | |
| 114 | + var isFunction$1 = typeOfTest("function"); | |
| 115 | + /** | |
| 116 | + * Determine if a value is a Number | |
| 117 | + * | |
| 118 | + * @param {*} val The value to test | |
| 119 | + * | |
| 120 | + * @returns {boolean} True if value is a Number, otherwise false | |
| 121 | + */ | |
| 122 | + var isNumber = typeOfTest("number"); | |
| 123 | + /** | |
| 124 | + * Determine if a value is an Object | |
| 125 | + * | |
| 126 | + * @param {*} thing The value to test | |
| 127 | + * | |
| 128 | + * @returns {boolean} True if value is an Object, otherwise false | |
| 129 | + */ | |
| 130 | + var isObject = (thing) => thing !== null && typeof thing === "object"; | |
| 131 | + /** | |
| 132 | + * Determine if a value is a Boolean | |
| 133 | + * | |
| 134 | + * @param {*} thing The value to test | |
| 135 | + * @returns {boolean} True if value is a Boolean, otherwise false | |
| 136 | + */ | |
| 137 | + var isBoolean = (thing) => thing === true || thing === false; | |
| 138 | + /** | |
| 139 | + * Determine if a value is a plain Object | |
| 140 | + * | |
| 141 | + * @param {*} val The value to test | |
| 142 | + * | |
| 143 | + * @returns {boolean} True if value is a plain Object, otherwise false | |
| 144 | + */ | |
| 145 | + var isPlainObject = (val) => { | |
| 146 | + if (kindOf(val) !== "object") return false; | |
| 147 | + const prototype = getPrototypeOf(val); | |
| 148 | + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val); | |
| 149 | + }; | |
| 150 | + /** | |
| 151 | + * Determine if a value is an empty object (safely handles Buffers) | |
| 152 | + * | |
| 153 | + * @param {*} val The value to test | |
| 154 | + * | |
| 155 | + * @returns {boolean} True if value is an empty object, otherwise false | |
| 156 | + */ | |
| 157 | + var isEmptyObject = (val) => { | |
| 158 | + if (!isObject(val) || isBuffer(val)) return false; | |
| 159 | + try { | |
| 160 | + return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; | |
| 161 | + } catch (e) { | |
| 162 | + return false; | |
| 163 | + } | |
| 164 | + }; | |
| 165 | + /** | |
| 166 | + * Determine if a value is a Date | |
| 167 | + * | |
| 168 | + * @param {*} val The value to test | |
| 169 | + * | |
| 170 | + * @returns {boolean} True if value is a Date, otherwise false | |
| 171 | + */ | |
| 172 | + var isDate = kindOfTest("Date"); | |
| 173 | + /** | |
| 174 | + * Determine if a value is a File | |
| 175 | + * | |
| 176 | + * @param {*} val The value to test | |
| 177 | + * | |
| 178 | + * @returns {boolean} True if value is a File, otherwise false | |
| 179 | + */ | |
| 180 | + var isFile = kindOfTest("File"); | |
| 181 | + /** | |
| 182 | + * Determine if a value is a Blob | |
| 183 | + * | |
| 184 | + * @param {*} val The value to test | |
| 185 | + * | |
| 186 | + * @returns {boolean} True if value is a Blob, otherwise false | |
| 187 | + */ | |
| 188 | + var isBlob = kindOfTest("Blob"); | |
| 189 | + /** | |
| 190 | + * Determine if a value is a FileList | |
| 191 | + * | |
| 192 | + * @param {*} val The value to test | |
| 193 | + * | |
| 194 | + * @returns {boolean} True if value is a File, otherwise false | |
| 195 | + */ | |
| 196 | + var isFileList = kindOfTest("FileList"); | |
| 197 | + /** | |
| 198 | + * Determine if a value is a Stream | |
| 199 | + * | |
| 200 | + * @param {*} val The value to test | |
| 201 | + * | |
| 202 | + * @returns {boolean} True if value is a Stream, otherwise false | |
| 203 | + */ | |
| 204 | + var isStream = (val) => isObject(val) && isFunction$1(val.pipe); | |
| 205 | + /** | |
| 206 | + * Determine if a value is a FormData | |
| 207 | + * | |
| 208 | + * @param {*} thing The value to test | |
| 209 | + * | |
| 210 | + * @returns {boolean} True if value is an FormData, otherwise false | |
| 211 | + */ | |
| 212 | + var isFormData = (thing) => { | |
| 213 | + let kind; | |
| 214 | + return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]")); | |
| 215 | + }; | |
| 216 | + /** | |
| 217 | + * Determine if a value is a URLSearchParams object | |
| 218 | + * | |
| 219 | + * @param {*} val The value to test | |
| 220 | + * | |
| 221 | + * @returns {boolean} True if value is a URLSearchParams object, otherwise false | |
| 222 | + */ | |
| 223 | + var isURLSearchParams = kindOfTest("URLSearchParams"); | |
| 224 | + var [isReadableStream, isRequest, isResponse, isHeaders] = [ | |
| 225 | + "ReadableStream", | |
| 226 | + "Request", | |
| 227 | + "Response", | |
| 228 | + "Headers" | |
| 229 | + ].map(kindOfTest); | |
| 230 | + /** | |
| 231 | + * Trim excess whitespace off the beginning and end of a string | |
| 232 | + * | |
| 233 | + * @param {String} str The String to trim | |
| 234 | + * | |
| 235 | + * @returns {String} The String freed of excess whitespace | |
| 236 | + */ | |
| 237 | + var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); | |
| 238 | + /** | |
| 239 | + * Iterate over an Array or an Object invoking a function for each item. | |
| 240 | + * | |
| 241 | + * If `obj` is an Array callback will be called passing | |
| 242 | + * the value, index, and complete array for each item. | |
| 243 | + * | |
| 244 | + * If 'obj' is an Object callback will be called passing | |
| 245 | + * the value, key, and complete object for each property. | |
| 246 | + * | |
| 247 | + * @param {Object|Array} obj The object to iterate | |
| 248 | + * @param {Function} fn The callback to invoke for each item | |
| 249 | + * | |
| 250 | + * @param {Boolean} [allOwnKeys = false] | |
| 251 | + * @returns {any} | |
| 252 | + */ | |
| 253 | + function forEach(obj, fn, { allOwnKeys = false } = {}) { | |
| 254 | + if (obj === null || typeof obj === "undefined") return; | |
| 255 | + let i; | |
| 256 | + let l; | |
| 257 | + if (typeof obj !== "object") obj = [obj]; | |
| 258 | + if (isArray(obj)) for (i = 0, l = obj.length; i < l; i++) fn.call(null, obj[i], i, obj); | |
| 259 | + else { | |
| 260 | + if (isBuffer(obj)) return; | |
| 261 | + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); | |
| 262 | + const len = keys.length; | |
| 263 | + let key; | |
| 264 | + for (i = 0; i < len; i++) { | |
| 265 | + key = keys[i]; | |
| 266 | + fn.call(null, obj[key], key, obj); | |
| 267 | + } | |
| 268 | + } | |
| 269 | + } | |
| 270 | + function findKey(obj, key) { | |
| 271 | + if (isBuffer(obj)) return null; | |
| 272 | + key = key.toLowerCase(); | |
| 273 | + const keys = Object.keys(obj); | |
| 274 | + let i = keys.length; | |
| 275 | + let _key; | |
| 276 | + while (i-- > 0) { | |
| 277 | + _key = keys[i]; | |
| 278 | + if (key === _key.toLowerCase()) return _key; | |
| 279 | + } | |
| 280 | + return null; | |
| 281 | + } | |
| 282 | + var _global = (() => { | |
| 283 | + if (typeof globalThis !== "undefined") return globalThis; | |
| 284 | + return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global; | |
| 285 | + })(); | |
| 286 | + var isContextDefined = (context) => !isUndefined(context) && context !== _global; | |
| 287 | + /** | |
| 288 | + * Accepts varargs expecting each argument to be an object, then | |
| 289 | + * immutably merges the properties of each object and returns result. | |
| 290 | + * | |
| 291 | + * When multiple objects contain the same key the later object in | |
| 292 | + * the arguments list will take precedence. | |
| 293 | + * | |
| 294 | + * Example: | |
| 295 | + * | |
| 296 | + * ```js | |
| 297 | + * var result = merge({foo: 123}, {foo: 456}); | |
| 298 | + * console.log(result.foo); // outputs 456 | |
| 299 | + * ``` | |
| 300 | + * | |
| 301 | + * @param {Object} obj1 Object to merge | |
| 302 | + * | |
| 303 | + * @returns {Object} Result of all merge properties | |
| 304 | + */ | |
| 305 | + function merge() { | |
| 306 | + const { caseless, skipUndefined } = isContextDefined(this) && this || {}; | |
| 307 | + const result = {}; | |
| 308 | + const assignValue = (val, key) => { | |
| 309 | + const targetKey = caseless && findKey(result, key) || key; | |
| 310 | + if (isPlainObject(result[targetKey]) && isPlainObject(val)) result[targetKey] = merge(result[targetKey], val); | |
| 311 | + else if (isPlainObject(val)) result[targetKey] = merge({}, val); | |
| 312 | + else if (isArray(val)) result[targetKey] = val.slice(); | |
| 313 | + else if (!skipUndefined || !isUndefined(val)) result[targetKey] = val; | |
| 314 | + }; | |
| 315 | + for (let i = 0, l = arguments.length; i < l; i++) arguments[i] && forEach(arguments[i], assignValue); | |
| 316 | + return result; | |
| 317 | + } | |
| 318 | + /** | |
| 319 | + * Extends object a by mutably adding to it the properties of object b. | |
| 320 | + * | |
| 321 | + * @param {Object} a The object to be extended | |
| 322 | + * @param {Object} b The object to copy properties from | |
| 323 | + * @param {Object} thisArg The object to bind function to | |
| 324 | + * | |
| 325 | + * @param {Boolean} [allOwnKeys] | |
| 326 | + * @returns {Object} The resulting value of object a | |
| 327 | + */ | |
| 328 | + var extend = (a, b, thisArg, { allOwnKeys } = {}) => { | |
| 329 | + forEach(b, (val, key) => { | |
| 330 | + if (thisArg && isFunction$1(val)) a[key] = bind(val, thisArg); | |
| 331 | + else a[key] = val; | |
| 332 | + }, { allOwnKeys }); | |
| 333 | + return a; | |
| 334 | + }; | |
| 335 | + /** | |
| 336 | + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) | |
| 337 | + * | |
| 338 | + * @param {string} content with BOM | |
| 339 | + * | |
| 340 | + * @returns {string} content value without BOM | |
| 341 | + */ | |
| 342 | + var stripBOM = (content) => { | |
| 343 | + if (content.charCodeAt(0) === 65279) content = content.slice(1); | |
| 344 | + return content; | |
| 345 | + }; | |
| 346 | + /** | |
| 347 | + * Inherit the prototype methods from one constructor into another | |
| 348 | + * @param {function} constructor | |
| 349 | + * @param {function} superConstructor | |
| 350 | + * @param {object} [props] | |
| 351 | + * @param {object} [descriptors] | |
| 352 | + * | |
| 353 | + * @returns {void} | |
| 354 | + */ | |
| 355 | + var inherits = (constructor, superConstructor, props, descriptors) => { | |
| 356 | + constructor.prototype = Object.create(superConstructor.prototype, descriptors); | |
| 357 | + constructor.prototype.constructor = constructor; | |
| 358 | + Object.defineProperty(constructor, "super", { value: superConstructor.prototype }); | |
| 359 | + props && Object.assign(constructor.prototype, props); | |
| 360 | + }; | |
| 361 | + /** | |
| 362 | + * Resolve object with deep prototype chain to a flat object | |
| 363 | + * @param {Object} sourceObj source object | |
| 364 | + * @param {Object} [destObj] | |
| 365 | + * @param {Function|Boolean} [filter] | |
| 366 | + * @param {Function} [propFilter] | |
| 367 | + * | |
| 368 | + * @returns {Object} | |
| 369 | + */ | |
| 370 | + var toFlatObject = (sourceObj, destObj, filter, propFilter) => { | |
| 371 | + let props; | |
| 372 | + let i; | |
| 373 | + let prop; | |
| 374 | + const merged = {}; | |
| 375 | + destObj = destObj || {}; | |
| 376 | + if (sourceObj == null) return destObj; | |
| 377 | + do { | |
| 378 | + props = Object.getOwnPropertyNames(sourceObj); | |
| 379 | + i = props.length; | |
| 380 | + while (i-- > 0) { | |
| 381 | + prop = props[i]; | |
| 382 | + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { | |
| 383 | + destObj[prop] = sourceObj[prop]; | |
| 384 | + merged[prop] = true; | |
| 385 | + } | |
| 386 | + } | |
| 387 | + sourceObj = filter !== false && getPrototypeOf(sourceObj); | |
| 388 | + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); | |
| 389 | + return destObj; | |
| 390 | + }; | |
| 391 | + /** | |
| 392 | + * Determines whether a string ends with the characters of a specified string | |
| 393 | + * | |
| 394 | + * @param {String} str | |
| 395 | + * @param {String} searchString | |
| 396 | + * @param {Number} [position= 0] | |
| 397 | + * | |
| 398 | + * @returns {boolean} | |
| 399 | + */ | |
| 400 | + var endsWith = (str, searchString, position) => { | |
| 401 | + str = String(str); | |
| 402 | + if (position === void 0 || position > str.length) position = str.length; | |
| 403 | + position -= searchString.length; | |
| 404 | + const lastIndex = str.indexOf(searchString, position); | |
| 405 | + return lastIndex !== -1 && lastIndex === position; | |
| 406 | + }; | |
| 407 | + /** | |
| 408 | + * Returns new array from array like object or null if failed | |
| 409 | + * | |
| 410 | + * @param {*} [thing] | |
| 411 | + * | |
| 412 | + * @returns {?Array} | |
| 413 | + */ | |
| 414 | + var toArray = (thing) => { | |
| 415 | + if (!thing) return null; | |
| 416 | + if (isArray(thing)) return thing; | |
| 417 | + let i = thing.length; | |
| 418 | + if (!isNumber(i)) return null; | |
| 419 | + const arr = new Array(i); | |
| 420 | + while (i-- > 0) arr[i] = thing[i]; | |
| 421 | + return arr; | |
| 422 | + }; | |
| 423 | + /** | |
| 424 | + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the | |
| 425 | + * thing passed in is an instance of Uint8Array | |
| 426 | + * | |
| 427 | + * @param {TypedArray} | |
| 428 | + * | |
| 429 | + * @returns {Array} | |
| 430 | + */ | |
| 431 | + var isTypedArray = ((TypedArray) => { | |
| 432 | + return (thing) => { | |
| 433 | + return TypedArray && thing instanceof TypedArray; | |
| 434 | + }; | |
| 435 | + })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array)); | |
| 436 | + /** | |
| 437 | + * For each entry in the object, call the function with the key and value. | |
| 438 | + * | |
| 439 | + * @param {Object<any, any>} obj - The object to iterate over. | |
| 440 | + * @param {Function} fn - The function to call for each entry. | |
| 441 | + * | |
| 442 | + * @returns {void} | |
| 443 | + */ | |
| 444 | + var forEachEntry = (obj, fn) => { | |
| 445 | + const _iterator = (obj && obj[iterator]).call(obj); | |
| 446 | + let result; | |
| 447 | + while ((result = _iterator.next()) && !result.done) { | |
| 448 | + const pair = result.value; | |
| 449 | + fn.call(obj, pair[0], pair[1]); | |
| 450 | + } | |
| 451 | + }; | |
| 452 | + /** | |
| 453 | + * It takes a regular expression and a string, and returns an array of all the matches | |
| 454 | + * | |
| 455 | + * @param {string} regExp - The regular expression to match against. | |
| 456 | + * @param {string} str - The string to search. | |
| 457 | + * | |
| 458 | + * @returns {Array<boolean>} | |
| 459 | + */ | |
| 460 | + var matchAll = (regExp, str) => { | |
| 461 | + let matches; | |
| 462 | + const arr = []; | |
| 463 | + while ((matches = regExp.exec(str)) !== null) arr.push(matches); | |
| 464 | + return arr; | |
| 465 | + }; | |
| 466 | + var isHTMLForm = kindOfTest("HTMLFormElement"); | |
| 467 | + var toCamelCase = (str) => { | |
| 468 | + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) { | |
| 469 | + return p1.toUpperCase() + p2; | |
| 470 | + }); | |
| 471 | + }; | |
| 472 | + var hasOwnProperty = (({ hasOwnProperty }) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); | |
| 473 | + /** | |
| 474 | + * Determine if a value is a RegExp object | |
| 475 | + * | |
| 476 | + * @param {*} val The value to test | |
| 477 | + * | |
| 478 | + * @returns {boolean} True if value is a RegExp object, otherwise false | |
| 479 | + */ | |
| 480 | + var isRegExp = kindOfTest("RegExp"); | |
| 481 | + var reduceDescriptors = (obj, reducer) => { | |
| 482 | + const descriptors = Object.getOwnPropertyDescriptors(obj); | |
| 483 | + const reducedDescriptors = {}; | |
| 484 | + forEach(descriptors, (descriptor, name) => { | |
| 485 | + let ret; | |
| 486 | + if ((ret = reducer(descriptor, name, obj)) !== false) reducedDescriptors[name] = ret || descriptor; | |
| 487 | + }); | |
| 488 | + Object.defineProperties(obj, reducedDescriptors); | |
| 489 | + }; | |
| 490 | + /** | |
| 491 | + * Makes all methods read-only | |
| 492 | + * @param {Object} obj | |
| 493 | + */ | |
| 494 | + var freezeMethods = (obj) => { | |
| 495 | + reduceDescriptors(obj, (descriptor, name) => { | |
| 496 | + if (isFunction$1(obj) && [ | |
| 497 | + "arguments", | |
| 498 | + "caller", | |
| 499 | + "callee" | |
| 500 | + ].indexOf(name) !== -1) return false; | |
| 501 | + const value = obj[name]; | |
| 502 | + if (!isFunction$1(value)) return; | |
| 503 | + descriptor.enumerable = false; | |
| 504 | + if ("writable" in descriptor) { | |
| 505 | + descriptor.writable = false; | |
| 506 | + return; | |
| 507 | + } | |
| 508 | + if (!descriptor.set) descriptor.set = () => { | |
| 509 | + throw Error("Can not rewrite read-only method '" + name + "'"); | |
| 510 | + }; | |
| 511 | + }); | |
| 512 | + }; | |
| 513 | + var toObjectSet = (arrayOrString, delimiter) => { | |
| 514 | + const obj = {}; | |
| 515 | + const define = (arr) => { | |
| 516 | + arr.forEach((value) => { | |
| 517 | + obj[value] = true; | |
| 518 | + }); | |
| 519 | + }; | |
| 520 | + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); | |
| 521 | + return obj; | |
| 522 | + }; | |
| 523 | + var noop = () => {}; | |
| 524 | + var toFiniteNumber = (value, defaultValue) => { | |
| 525 | + return value != null && Number.isFinite(value = +value) ? value : defaultValue; | |
| 526 | + }; | |
| 527 | + /** | |
| 528 | + * If the thing is a FormData object, return true, otherwise return false. | |
| 529 | + * | |
| 530 | + * @param {unknown} thing - The thing to check. | |
| 531 | + * | |
| 532 | + * @returns {boolean} | |
| 533 | + */ | |
| 534 | + function isSpecCompliantForm(thing) { | |
| 535 | + return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]); | |
| 536 | + } | |
| 537 | + var toJSONObject = (obj) => { | |
| 538 | + const stack = new Array(10); | |
| 539 | + const visit = (source, i) => { | |
| 540 | + if (isObject(source)) { | |
| 541 | + if (stack.indexOf(source) >= 0) return; | |
| 542 | + if (isBuffer(source)) return source; | |
| 543 | + if (!("toJSON" in source)) { | |
| 544 | + stack[i] = source; | |
| 545 | + const target = isArray(source) ? [] : {}; | |
| 546 | + forEach(source, (value, key) => { | |
| 547 | + const reducedValue = visit(value, i + 1); | |
| 548 | + !isUndefined(reducedValue) && (target[key] = reducedValue); | |
| 549 | + }); | |
| 550 | + stack[i] = void 0; | |
| 551 | + return target; | |
| 552 | + } | |
| 553 | + } | |
| 554 | + return source; | |
| 555 | + }; | |
| 556 | + return visit(obj, 0); | |
| 557 | + }; | |
| 558 | + var isAsyncFn = kindOfTest("AsyncFunction"); | |
| 559 | + var isThenable = (thing) => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch); | |
| 560 | + var _setImmediate = ((setImmediateSupported, postMessageSupported) => { | |
| 561 | + if (setImmediateSupported) return setImmediate; | |
| 562 | + return postMessageSupported ? ((token, callbacks) => { | |
| 563 | + _global.addEventListener("message", ({ source, data }) => { | |
| 564 | + if (source === _global && data === token) callbacks.length && callbacks.shift()(); | |
| 565 | + }, false); | |
| 566 | + return (cb) => { | |
| 567 | + callbacks.push(cb); | |
| 568 | + _global.postMessage(token, "*"); | |
| 569 | + }; | |
| 570 | + })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); | |
| 571 | + })(typeof setImmediate === "function", isFunction$1(_global.postMessage)); | |
| 572 | + var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; | |
| 573 | + var isIterable = (thing) => thing != null && isFunction$1(thing[iterator]); | |
| 574 | + var utils_default = { | |
| 575 | + isArray, | |
| 576 | + isArrayBuffer, | |
| 577 | + isBuffer, | |
| 578 | + isFormData, | |
| 579 | + isArrayBufferView, | |
| 580 | + isString, | |
| 581 | + isNumber, | |
| 582 | + isBoolean, | |
| 583 | + isObject, | |
| 584 | + isPlainObject, | |
| 585 | + isEmptyObject, | |
| 586 | + isReadableStream, | |
| 587 | + isRequest, | |
| 588 | + isResponse, | |
| 589 | + isHeaders, | |
| 590 | + isUndefined, | |
| 591 | + isDate, | |
| 592 | + isFile, | |
| 593 | + isBlob, | |
| 594 | + isRegExp, | |
| 595 | + isFunction: isFunction$1, | |
| 596 | + isStream, | |
| 597 | + isURLSearchParams, | |
| 598 | + isTypedArray, | |
| 599 | + isFileList, | |
| 600 | + forEach, | |
| 601 | + merge, | |
| 602 | + extend, | |
| 603 | + trim, | |
| 604 | + stripBOM, | |
| 605 | + inherits, | |
| 606 | + toFlatObject, | |
| 607 | + kindOf, | |
| 608 | + kindOfTest, | |
| 609 | + endsWith, | |
| 610 | + toArray, | |
| 611 | + forEachEntry, | |
| 612 | + matchAll, | |
| 613 | + isHTMLForm, | |
| 614 | + hasOwnProperty, | |
| 615 | + hasOwnProp: hasOwnProperty, | |
| 616 | + reduceDescriptors, | |
| 617 | + freezeMethods, | |
| 618 | + toObjectSet, | |
| 619 | + toCamelCase, | |
| 620 | + noop, | |
| 621 | + toFiniteNumber, | |
| 622 | + findKey, | |
| 623 | + global: _global, | |
| 624 | + isContextDefined, | |
| 625 | + isSpecCompliantForm, | |
| 626 | + toJSONObject, | |
| 627 | + isAsyncFn, | |
| 628 | + isThenable, | |
| 629 | + setImmediate: _setImmediate, | |
| 630 | + asap, | |
| 631 | + isIterable | |
| 632 | + }; | |
| 633 | + | |
| 634 | +//#endregion | |
| 635 | +//#region node_modules/axios/lib/core/AxiosError.js | |
| 636 | +/** | |
| 637 | + * Create an Error with the specified message, config, error code, request and response. | |
| 638 | + * | |
| 639 | + * @param {string} message The error message. | |
| 640 | + * @param {string} [code] The error code (for example, 'ECONNABORTED'). | |
| 641 | + * @param {Object} [config] The config. | |
| 642 | + * @param {Object} [request] The request. | |
| 643 | + * @param {Object} [response] The response. | |
| 644 | + * | |
| 645 | + * @returns {Error} The created error. | |
| 646 | + */ | |
| 647 | + function AxiosError$1(message, code, config, request, response) { | |
| 648 | + Error.call(this); | |
| 649 | + if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor); | |
| 650 | + else this.stack = (/* @__PURE__ */ new Error()).stack; | |
| 651 | + this.message = message; | |
| 652 | + this.name = "AxiosError"; | |
| 653 | + code && (this.code = code); | |
| 654 | + config && (this.config = config); | |
| 655 | + request && (this.request = request); | |
| 656 | + if (response) { | |
| 657 | + this.response = response; | |
| 658 | + this.status = response.status ? response.status : null; | |
| 659 | + } | |
| 660 | + } | |
| 661 | + __name(AxiosError$1, "AxiosError"); | |
| 662 | + utils_default.inherits(AxiosError$1, Error, { toJSON: function toJSON() { | |
| 663 | + return { | |
| 664 | + message: this.message, | |
| 665 | + name: this.name, | |
| 666 | + description: this.description, | |
| 667 | + number: this.number, | |
| 668 | + fileName: this.fileName, | |
| 669 | + lineNumber: this.lineNumber, | |
| 670 | + columnNumber: this.columnNumber, | |
| 671 | + stack: this.stack, | |
| 672 | + config: utils_default.toJSONObject(this.config), | |
| 673 | + code: this.code, | |
| 674 | + status: this.status | |
| 675 | + }; | |
| 676 | + } }); | |
| 677 | + var prototype$1 = AxiosError$1.prototype; | |
| 678 | + var descriptors = {}; | |
| 679 | + [ | |
| 680 | + "ERR_BAD_OPTION_VALUE", | |
| 681 | + "ERR_BAD_OPTION", | |
| 682 | + "ECONNABORTED", | |
| 683 | + "ETIMEDOUT", | |
| 684 | + "ERR_NETWORK", | |
| 685 | + "ERR_FR_TOO_MANY_REDIRECTS", | |
| 686 | + "ERR_DEPRECATED", | |
| 687 | + "ERR_BAD_RESPONSE", | |
| 688 | + "ERR_BAD_REQUEST", | |
| 689 | + "ERR_CANCELED", | |
| 690 | + "ERR_NOT_SUPPORT", | |
| 691 | + "ERR_INVALID_URL" | |
| 692 | + ].forEach((code) => { | |
| 693 | + descriptors[code] = { value: code }; | |
| 694 | + }); | |
| 695 | + Object.defineProperties(AxiosError$1, descriptors); | |
| 696 | + Object.defineProperty(prototype$1, "isAxiosError", { value: true }); | |
| 697 | + AxiosError$1.from = (error, code, config, request, response, customProps) => { | |
| 698 | + const axiosError = Object.create(prototype$1); | |
| 699 | + utils_default.toFlatObject(error, axiosError, function filter(obj) { | |
| 700 | + return obj !== Error.prototype; | |
| 701 | + }, (prop) => { | |
| 702 | + return prop !== "isAxiosError"; | |
| 703 | + }); | |
| 704 | + const msg = error && error.message ? error.message : "Error"; | |
| 705 | + const errCode = code == null && error ? error.code : code; | |
| 706 | + AxiosError$1.call(axiosError, msg, errCode, config, request, response); | |
| 707 | + if (error && axiosError.cause == null) Object.defineProperty(axiosError, "cause", { | |
| 708 | + value: error, | |
| 709 | + configurable: true | |
| 710 | + }); | |
| 711 | + axiosError.name = error && error.name || "Error"; | |
| 712 | + customProps && Object.assign(axiosError, customProps); | |
| 713 | + return axiosError; | |
| 714 | + }; | |
| 715 | + | |
| 716 | +//#endregion | |
| 717 | +//#region node_modules/axios/lib/helpers/toFormData.js | |
| 718 | +/** | |
| 719 | + * Determines if the given thing is a array or js object. | |
| 720 | + * | |
| 721 | + * @param {string} thing - The object or array to be visited. | |
| 722 | + * | |
| 723 | + * @returns {boolean} | |
| 724 | + */ | |
| 725 | + function isVisitable(thing) { | |
| 726 | + return utils_default.isPlainObject(thing) || utils_default.isArray(thing); | |
| 727 | + } | |
| 728 | + /** | |
| 729 | + * It removes the brackets from the end of a string | |
| 730 | + * | |
| 731 | + * @param {string} key - The key of the parameter. | |
| 732 | + * | |
| 733 | + * @returns {string} the key without the brackets. | |
| 734 | + */ | |
| 735 | + function removeBrackets(key) { | |
| 736 | + return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key; | |
| 737 | + } | |
| 738 | + /** | |
| 739 | + * It takes a path, a key, and a boolean, and returns a string | |
| 740 | + * | |
| 741 | + * @param {string} path - The path to the current key. | |
| 742 | + * @param {string} key - The key of the current object being iterated over. | |
| 743 | + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. | |
| 744 | + * | |
| 745 | + * @returns {string} The path to the current key. | |
| 746 | + */ | |
| 747 | + function renderKey(path, key, dots) { | |
| 748 | + if (!path) return key; | |
| 749 | + return path.concat(key).map(function each(token, i) { | |
| 750 | + token = removeBrackets(token); | |
| 751 | + return !dots && i ? "[" + token + "]" : token; | |
| 752 | + }).join(dots ? "." : ""); | |
| 753 | + } | |
| 754 | + /** | |
| 755 | + * If the array is an array and none of its elements are visitable, then it's a flat array. | |
| 756 | + * | |
| 757 | + * @param {Array<any>} arr - The array to check | |
| 758 | + * | |
| 759 | + * @returns {boolean} | |
| 760 | + */ | |
| 761 | + function isFlatArray(arr) { | |
| 762 | + return utils_default.isArray(arr) && !arr.some(isVisitable); | |
| 763 | + } | |
| 764 | + var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) { | |
| 765 | + return /^is[A-Z]/.test(prop); | |
| 766 | + }); | |
| 767 | + /** | |
| 768 | + * Convert a data object to FormData | |
| 769 | + * | |
| 770 | + * @param {Object} obj | |
| 771 | + * @param {?Object} [formData] | |
| 772 | + * @param {?Object} [options] | |
| 773 | + * @param {Function} [options.visitor] | |
| 774 | + * @param {Boolean} [options.metaTokens = true] | |
| 775 | + * @param {Boolean} [options.dots = false] | |
| 776 | + * @param {?Boolean} [options.indexes = false] | |
| 777 | + * | |
| 778 | + * @returns {Object} | |
| 779 | + **/ | |
| 780 | + /** | |
| 781 | + * It converts an object into a FormData object | |
| 782 | + * | |
| 783 | + * @param {Object<any, any>} obj - The object to convert to form data. | |
| 784 | + * @param {string} formData - The FormData object to append to. | |
| 785 | + * @param {Object<string, any>} options | |
| 786 | + * | |
| 787 | + * @returns | |
| 788 | + */ | |
| 789 | + function toFormData$1(obj, formData, options) { | |
| 790 | + if (!utils_default.isObject(obj)) throw new TypeError("target must be an object"); | |
| 791 | + formData = formData || new (null || FormData)(); | |
| 792 | + options = utils_default.toFlatObject(options, { | |
| 793 | + metaTokens: true, | |
| 794 | + dots: false, | |
| 795 | + indexes: false | |
| 796 | + }, false, function defined(option, source) { | |
| 797 | + return !utils_default.isUndefined(source[option]); | |
| 798 | + }); | |
| 799 | + const metaTokens = options.metaTokens; | |
| 800 | + const visitor = options.visitor || defaultVisitor; | |
| 801 | + const dots = options.dots; | |
| 802 | + const indexes = options.indexes; | |
| 803 | + const useBlob = (options.Blob || typeof Blob !== "undefined" && Blob) && utils_default.isSpecCompliantForm(formData); | |
| 804 | + if (!utils_default.isFunction(visitor)) throw new TypeError("visitor must be a function"); | |
| 805 | + function convertValue(value) { | |
| 806 | + if (value === null) return ""; | |
| 807 | + if (utils_default.isDate(value)) return value.toISOString(); | |
| 808 | + if (utils_default.isBoolean(value)) return value.toString(); | |
| 809 | + if (!useBlob && utils_default.isBlob(value)) throw new AxiosError$1("Blob is not supported. Use a Buffer instead."); | |
| 810 | + if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value); | |
| 811 | + return value; | |
| 812 | + } | |
| 813 | + /** | |
| 814 | + * Default visitor. | |
| 815 | + * | |
| 816 | + * @param {*} value | |
| 817 | + * @param {String|Number} key | |
| 818 | + * @param {Array<String|Number>} path | |
| 819 | + * @this {FormData} | |
| 820 | + * | |
| 821 | + * @returns {boolean} return true to visit the each prop of the value recursively | |
| 822 | + */ | |
| 823 | + function defaultVisitor(value, key, path) { | |
| 824 | + let arr = value; | |
| 825 | + if (value && !path && typeof value === "object") { | |
| 826 | + if (utils_default.endsWith(key, "{}")) { | |
| 827 | + key = metaTokens ? key : key.slice(0, -2); | |
| 828 | + value = JSON.stringify(value); | |
| 829 | + } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) { | |
| 830 | + key = removeBrackets(key); | |
| 831 | + arr.forEach(function each(el, index) { | |
| 832 | + !(utils_default.isUndefined(el) || el === null) && formData.append(indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]", convertValue(el)); | |
| 833 | + }); | |
| 834 | + return false; | |
| 835 | + } | |
| 836 | + } | |
| 837 | + if (isVisitable(value)) return true; | |
| 838 | + formData.append(renderKey(path, key, dots), convertValue(value)); | |
| 839 | + return false; | |
| 840 | + } | |
| 841 | + const stack = []; | |
| 842 | + const exposedHelpers = Object.assign(predicates, { | |
| 843 | + defaultVisitor, | |
| 844 | + convertValue, | |
| 845 | + isVisitable | |
| 846 | + }); | |
| 847 | + function build(value, path) { | |
| 848 | + if (utils_default.isUndefined(value)) return; | |
| 849 | + if (stack.indexOf(value) !== -1) throw Error("Circular reference detected in " + path.join(".")); | |
| 850 | + stack.push(value); | |
| 851 | + utils_default.forEach(value, function each(el, key) { | |
| 852 | + if ((!(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key, path, exposedHelpers)) === true) build(el, path ? path.concat(key) : [key]); | |
| 853 | + }); | |
| 854 | + stack.pop(); | |
| 855 | + } | |
| 856 | + if (!utils_default.isObject(obj)) throw new TypeError("data must be an object"); | |
| 857 | + build(obj); | |
| 858 | + return formData; | |
| 859 | + } | |
| 860 | + __name(toFormData$1, "toFormData"); | |
| 861 | + | |
| 862 | +//#endregion | |
| 863 | +//#region node_modules/axios/lib/helpers/AxiosURLSearchParams.js | |
| 864 | +/** | |
| 865 | + * It encodes a string by replacing all characters that are not in the unreserved set with | |
| 866 | + * their percent-encoded equivalents | |
| 867 | + * | |
| 868 | + * @param {string} str - The string to encode. | |
| 869 | + * | |
| 870 | + * @returns {string} The encoded string. | |
| 871 | + */ | |
| 872 | + function encode$1(str) { | |
| 873 | + const charMap = { | |
| 874 | + "!": "%21", | |
| 875 | + "'": "%27", | |
| 876 | + "(": "%28", | |
| 877 | + ")": "%29", | |
| 878 | + "~": "%7E", | |
| 879 | + "%20": "+", | |
| 880 | + "%00": "\0" | |
| 881 | + }; | |
| 882 | + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { | |
| 883 | + return charMap[match]; | |
| 884 | + }); | |
| 885 | + } | |
| 886 | + __name(encode$1, "encode"); | |
| 887 | + /** | |
| 888 | + * It takes a params object and converts it to a FormData object | |
| 889 | + * | |
| 890 | + * @param {Object<string, any>} params - The parameters to be converted to a FormData object. | |
| 891 | + * @param {Object<string, any>} options - The options object passed to the Axios constructor. | |
| 892 | + * | |
| 893 | + * @returns {void} | |
| 894 | + */ | |
| 895 | + function AxiosURLSearchParams(params, options) { | |
| 896 | + this._pairs = []; | |
| 897 | + params && toFormData$1(params, this, options); | |
| 898 | + } | |
| 899 | + var prototype = AxiosURLSearchParams.prototype; | |
| 900 | + prototype.append = function append(name, value) { | |
| 901 | + this._pairs.push([name, value]); | |
| 902 | + }; | |
| 903 | + prototype.toString = function toString(encoder) { | |
| 904 | + const _encode = encoder ? function(value) { | |
| 905 | + return encoder.call(this, value, encode$1); | |
| 906 | + } : encode$1; | |
| 907 | + return this._pairs.map(function each(pair) { | |
| 908 | + return _encode(pair[0]) + "=" + _encode(pair[1]); | |
| 909 | + }, "").join("&"); | |
| 910 | + }; | |
| 911 | + | |
| 912 | +//#endregion | |
| 913 | +//#region node_modules/axios/lib/helpers/buildURL.js | |
| 914 | +/** | |
| 915 | + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their | |
| 916 | + * URI encoded counterparts | |
| 917 | + * | |
| 918 | + * @param {string} val The value to be encoded. | |
| 919 | + * | |
| 920 | + * @returns {string} The encoded value. | |
| 921 | + */ | |
| 922 | + function encode(val) { | |
| 923 | + return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+"); | |
| 924 | + } | |
| 925 | + /** | |
| 926 | + * Build a URL by appending params to the end | |
| 927 | + * | |
| 928 | + * @param {string} url The base of the url (e.g., http://www.google.com) | |
| 929 | + * @param {object} [params] The params to be appended | |
| 930 | + * @param {?(object|Function)} options | |
| 931 | + * | |
| 932 | + * @returns {string} The formatted url | |
| 933 | + */ | |
| 934 | + function buildURL(url, params, options) { | |
| 935 | + if (!params) return url; | |
| 936 | + const _encode = options && options.encode || encode; | |
| 937 | + if (utils_default.isFunction(options)) options = { serialize: options }; | |
| 938 | + const serializeFn = options && options.serialize; | |
| 939 | + let serializedParams; | |
| 940 | + if (serializeFn) serializedParams = serializeFn(params, options); | |
| 941 | + else serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode); | |
| 942 | + if (serializedParams) { | |
| 943 | + const hashmarkIndex = url.indexOf("#"); | |
| 944 | + if (hashmarkIndex !== -1) url = url.slice(0, hashmarkIndex); | |
| 945 | + url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams; | |
| 946 | + } | |
| 947 | + return url; | |
| 948 | + } | |
| 949 | + | |
| 950 | +//#endregion | |
| 951 | +//#region node_modules/axios/lib/core/InterceptorManager.js | |
| 952 | + var InterceptorManager = class { | |
| 953 | + constructor() { | |
| 954 | + this.handlers = []; | |
| 955 | + } | |
| 956 | + /** | |
| 957 | + * Add a new interceptor to the stack | |
| 958 | + * | |
| 959 | + * @param {Function} fulfilled The function to handle `then` for a `Promise` | |
| 960 | + * @param {Function} rejected The function to handle `reject` for a `Promise` | |
| 961 | + * | |
| 962 | + * @return {Number} An ID used to remove interceptor later | |
| 963 | + */ | |
| 964 | + use(fulfilled, rejected, options) { | |
| 965 | + this.handlers.push({ | |
| 966 | + fulfilled, | |
| 967 | + rejected, | |
| 968 | + synchronous: options ? options.synchronous : false, | |
| 969 | + runWhen: options ? options.runWhen : null | |
| 970 | + }); | |
| 971 | + return this.handlers.length - 1; | |
| 972 | + } | |
| 973 | + /** | |
| 974 | + * Remove an interceptor from the stack | |
| 975 | + * | |
| 976 | + * @param {Number} id The ID that was returned by `use` | |
| 977 | + * | |
| 978 | + * @returns {void} | |
| 979 | + */ | |
| 980 | + eject(id) { | |
| 981 | + if (this.handlers[id]) this.handlers[id] = null; | |
| 982 | + } | |
| 983 | + /** | |
| 984 | + * Clear all interceptors from the stack | |
| 985 | + * | |
| 986 | + * @returns {void} | |
| 987 | + */ | |
| 988 | + clear() { | |
| 989 | + if (this.handlers) this.handlers = []; | |
| 990 | + } | |
| 991 | + /** | |
| 992 | + * Iterate over all the registered interceptors | |
| 993 | + * | |
| 994 | + * This method is particularly useful for skipping over any | |
| 995 | + * interceptors that may have become `null` calling `eject`. | |
| 996 | + * | |
| 997 | + * @param {Function} fn The function to call for each interceptor | |
| 998 | + * | |
| 999 | + * @returns {void} | |
| 1000 | + */ | |
| 1001 | + forEach(fn) { | |
| 1002 | + utils_default.forEach(this.handlers, function forEachHandler(h) { | |
| 1003 | + if (h !== null) fn(h); | |
| 1004 | + }); | |
| 1005 | + } | |
| 1006 | + }; | |
| 1007 | + | |
| 1008 | +//#endregion | |
| 1009 | +//#region node_modules/axios/lib/defaults/transitional.js | |
| 1010 | + var transitional_default = { | |
| 1011 | + silentJSONParsing: true, | |
| 1012 | + forcedJSONParsing: true, | |
| 1013 | + clarifyTimeoutError: false | |
| 1014 | + }; | |
| 1015 | + | |
| 1016 | +//#endregion | |
| 1017 | +//#region node_modules/axios/lib/platform/browser/classes/URLSearchParams.js | |
| 1018 | + var URLSearchParams_default = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams; | |
| 1019 | + | |
| 1020 | +//#endregion | |
| 1021 | +//#region node_modules/axios/lib/platform/browser/classes/FormData.js | |
| 1022 | + var FormData_default = typeof FormData !== "undefined" ? FormData : null; | |
| 1023 | + | |
| 1024 | +//#endregion | |
| 1025 | +//#region node_modules/axios/lib/platform/browser/classes/Blob.js | |
| 1026 | + var Blob_default = typeof Blob !== "undefined" ? Blob : null; | |
| 1027 | + | |
| 1028 | +//#endregion | |
| 1029 | +//#region node_modules/axios/lib/platform/browser/index.js | |
| 1030 | + var browser_default = { | |
| 1031 | + isBrowser: true, | |
| 1032 | + classes: { | |
| 1033 | + URLSearchParams: URLSearchParams_default, | |
| 1034 | + FormData: FormData_default, | |
| 1035 | + Blob: Blob_default | |
| 1036 | + }, | |
| 1037 | + protocols: [ | |
| 1038 | + "http", | |
| 1039 | + "https", | |
| 1040 | + "file", | |
| 1041 | + "blob", | |
| 1042 | + "url", | |
| 1043 | + "data" | |
| 1044 | + ] | |
| 1045 | + }; | |
| 1046 | + | |
| 1047 | +//#endregion | |
| 1048 | +//#region node_modules/axios/lib/platform/common/utils.js | |
| 1049 | + var utils_exports = /* @__PURE__ */ __exportAll({ | |
| 1050 | + hasBrowserEnv: () => hasBrowserEnv, | |
| 1051 | + hasStandardBrowserEnv: () => hasStandardBrowserEnv, | |
| 1052 | + hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv, | |
| 1053 | + navigator: () => _navigator, | |
| 1054 | + origin: () => origin | |
| 1055 | + }); | |
| 1056 | + var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; | |
| 1057 | + var _navigator = typeof navigator === "object" && navigator || void 0; | |
| 1058 | + /** | |
| 1059 | + * Determine if we're running in a standard browser environment | |
| 1060 | + * | |
| 1061 | + * This allows axios to run in a web worker, and react-native. | |
| 1062 | + * Both environments support XMLHttpRequest, but not fully standard globals. | |
| 1063 | + * | |
| 1064 | + * web workers: | |
| 1065 | + * typeof window -> undefined | |
| 1066 | + * typeof document -> undefined | |
| 1067 | + * | |
| 1068 | + * react-native: | |
| 1069 | + * navigator.product -> 'ReactNative' | |
| 1070 | + * nativescript | |
| 1071 | + * navigator.product -> 'NativeScript' or 'NS' | |
| 1072 | + * | |
| 1073 | + * @returns {boolean} | |
| 1074 | + */ | |
| 1075 | + var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || [ | |
| 1076 | + "ReactNative", | |
| 1077 | + "NativeScript", | |
| 1078 | + "NS" | |
| 1079 | + ].indexOf(_navigator.product) < 0); | |
| 1080 | + /** | |
| 1081 | + * Determine if we're running in a standard browser webWorker environment | |
| 1082 | + * | |
| 1083 | + * Although the `isStandardBrowserEnv` method indicates that | |
| 1084 | + * `allows axios to run in a web worker`, the WebWorker will still be | |
| 1085 | + * filtered out due to its judgment standard | |
| 1086 | + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. | |
| 1087 | + * This leads to a problem when axios post `FormData` in webWorker | |
| 1088 | + */ | |
| 1089 | + var hasStandardBrowserWebWorkerEnv = (() => { | |
| 1090 | + return typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; | |
| 1091 | + })(); | |
| 1092 | + var origin = hasBrowserEnv && window.location.href || "http://localhost"; | |
| 1093 | + | |
| 1094 | +//#endregion | |
| 1095 | +//#region node_modules/axios/lib/platform/index.js | |
| 1096 | + var platform_default = { | |
| 1097 | + ...utils_exports, | |
| 1098 | + ...browser_default | |
| 1099 | + }; | |
| 1100 | + | |
| 1101 | +//#endregion | |
| 1102 | +//#region node_modules/axios/lib/helpers/toURLEncodedForm.js | |
| 1103 | + function toURLEncodedForm(data, options) { | |
| 1104 | + return toFormData$1(data, new platform_default.classes.URLSearchParams(), { | |
| 1105 | + visitor: function(value, key, path, helpers) { | |
| 1106 | + if (platform_default.isNode && utils_default.isBuffer(value)) { | |
| 1107 | + this.append(key, value.toString("base64")); | |
| 1108 | + return false; | |
| 1109 | + } | |
| 1110 | + return helpers.defaultVisitor.apply(this, arguments); | |
| 1111 | + }, | |
| 1112 | + ...options | |
| 1113 | + }); | |
| 1114 | + } | |
| 1115 | + | |
| 1116 | +//#endregion | |
| 1117 | +//#region node_modules/axios/lib/helpers/formDataToJSON.js | |
| 1118 | +/** | |
| 1119 | + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] | |
| 1120 | + * | |
| 1121 | + * @param {string} name - The name of the property to get. | |
| 1122 | + * | |
| 1123 | + * @returns An array of strings. | |
| 1124 | + */ | |
| 1125 | + function parsePropPath(name) { | |
| 1126 | + return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => { | |
| 1127 | + return match[0] === "[]" ? "" : match[1] || match[0]; | |
| 1128 | + }); | |
| 1129 | + } | |
| 1130 | + /** | |
| 1131 | + * Convert an array to an object. | |
| 1132 | + * | |
| 1133 | + * @param {Array<any>} arr - The array to convert to an object. | |
| 1134 | + * | |
| 1135 | + * @returns An object with the same keys and values as the array. | |
| 1136 | + */ | |
| 1137 | + function arrayToObject(arr) { | |
| 1138 | + const obj = {}; | |
| 1139 | + const keys = Object.keys(arr); | |
| 1140 | + let i; | |
| 1141 | + const len = keys.length; | |
| 1142 | + let key; | |
| 1143 | + for (i = 0; i < len; i++) { | |
| 1144 | + key = keys[i]; | |
| 1145 | + obj[key] = arr[key]; | |
| 1146 | + } | |
| 1147 | + return obj; | |
| 1148 | + } | |
| 1149 | + /** | |
| 1150 | + * It takes a FormData object and returns a JavaScript object | |
| 1151 | + * | |
| 1152 | + * @param {string} formData The FormData object to convert to JSON. | |
| 1153 | + * | |
| 1154 | + * @returns {Object<string, any> | null} The converted object. | |
| 1155 | + */ | |
| 1156 | + function formDataToJSON(formData) { | |
| 1157 | + function buildPath(path, value, target, index) { | |
| 1158 | + let name = path[index++]; | |
| 1159 | + if (name === "__proto__") return true; | |
| 1160 | + const isNumericKey = Number.isFinite(+name); | |
| 1161 | + const isLast = index >= path.length; | |
| 1162 | + name = !name && utils_default.isArray(target) ? target.length : name; | |
| 1163 | + if (isLast) { | |
| 1164 | + if (utils_default.hasOwnProp(target, name)) target[name] = [target[name], value]; | |
| 1165 | + else target[name] = value; | |
| 1166 | + return !isNumericKey; | |
| 1167 | + } | |
| 1168 | + if (!target[name] || !utils_default.isObject(target[name])) target[name] = []; | |
| 1169 | + if (buildPath(path, value, target[name], index) && utils_default.isArray(target[name])) target[name] = arrayToObject(target[name]); | |
| 1170 | + return !isNumericKey; | |
| 1171 | + } | |
| 1172 | + if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) { | |
| 1173 | + const obj = {}; | |
| 1174 | + utils_default.forEachEntry(formData, (name, value) => { | |
| 1175 | + buildPath(parsePropPath(name), value, obj, 0); | |
| 1176 | + }); | |
| 1177 | + return obj; | |
| 1178 | + } | |
| 1179 | + return null; | |
| 1180 | + } | |
| 1181 | + | |
| 1182 | +//#endregion | |
| 1183 | +//#region node_modules/axios/lib/defaults/index.js | |
| 1184 | +/** | |
| 1185 | + * It takes a string, tries to parse it, and if it fails, it returns the stringified version | |
| 1186 | + * of the input | |
| 1187 | + * | |
| 1188 | + * @param {any} rawValue - The value to be stringified. | |
| 1189 | + * @param {Function} parser - A function that parses a string into a JavaScript object. | |
| 1190 | + * @param {Function} encoder - A function that takes a value and returns a string. | |
| 1191 | + * | |
| 1192 | + * @returns {string} A stringified version of the rawValue. | |
| 1193 | + */ | |
| 1194 | + function stringifySafely(rawValue, parser, encoder) { | |
| 1195 | + if (utils_default.isString(rawValue)) try { | |
| 1196 | + (parser || JSON.parse)(rawValue); | |
| 1197 | + return utils_default.trim(rawValue); | |
| 1198 | + } catch (e) { | |
| 1199 | + if (e.name !== "SyntaxError") throw e; | |
| 1200 | + } | |
| 1201 | + return (encoder || JSON.stringify)(rawValue); | |
| 1202 | + } | |
| 1203 | + var defaults = { | |
| 1204 | + transitional: transitional_default, | |
| 1205 | + adapter: [ | |
| 1206 | + "xhr", | |
| 1207 | + "http", | |
| 1208 | + "fetch" | |
| 1209 | + ], | |
| 1210 | + transformRequest: [function transformRequest(data, headers) { | |
| 1211 | + const contentType = headers.getContentType() || ""; | |
| 1212 | + const hasJSONContentType = contentType.indexOf("application/json") > -1; | |
| 1213 | + const isObjectPayload = utils_default.isObject(data); | |
| 1214 | + if (isObjectPayload && utils_default.isHTMLForm(data)) data = new FormData(data); | |
| 1215 | + if (utils_default.isFormData(data)) return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; | |
| 1216 | + if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) return data; | |
| 1217 | + if (utils_default.isArrayBufferView(data)) return data.buffer; | |
| 1218 | + if (utils_default.isURLSearchParams(data)) { | |
| 1219 | + headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false); | |
| 1220 | + return data.toString(); | |
| 1221 | + } | |
| 1222 | + let isFileList; | |
| 1223 | + if (isObjectPayload) { | |
| 1224 | + if (contentType.indexOf("application/x-www-form-urlencoded") > -1) return toURLEncodedForm(data, this.formSerializer).toString(); | |
| 1225 | + if ((isFileList = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { | |
| 1226 | + const _FormData = this.env && this.env.FormData; | |
| 1227 | + return toFormData$1(isFileList ? { "files[]": data } : data, _FormData && new _FormData(), this.formSerializer); | |
| 1228 | + } | |
| 1229 | + } | |
| 1230 | + if (isObjectPayload || hasJSONContentType) { | |
| 1231 | + headers.setContentType("application/json", false); | |
| 1232 | + return stringifySafely(data); | |
| 1233 | + } | |
| 1234 | + return data; | |
| 1235 | + }], | |
| 1236 | + transformResponse: [function transformResponse(data) { | |
| 1237 | + const transitional = this.transitional || defaults.transitional; | |
| 1238 | + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; | |
| 1239 | + const JSONRequested = this.responseType === "json"; | |
| 1240 | + if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) return data; | |
| 1241 | + if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { | |
| 1242 | + const strictJSONParsing = !(transitional && transitional.silentJSONParsing) && JSONRequested; | |
| 1243 | + try { | |
| 1244 | + return JSON.parse(data, this.parseReviver); | |
| 1245 | + } catch (e) { | |
| 1246 | + if (strictJSONParsing) { | |
| 1247 | + if (e.name === "SyntaxError") throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response); | |
| 1248 | + throw e; | |
| 1249 | + } | |
| 1250 | + } | |
| 1251 | + } | |
| 1252 | + return data; | |
| 1253 | + }], | |
| 1254 | + /** | |
| 1255 | + * A timeout in milliseconds to abort a request. If set to 0 (default) a | |
| 1256 | + * timeout is not created. | |
| 1257 | + */ | |
| 1258 | + timeout: 0, | |
| 1259 | + xsrfCookieName: "XSRF-TOKEN", | |
| 1260 | + xsrfHeaderName: "X-XSRF-TOKEN", | |
| 1261 | + maxContentLength: -1, | |
| 1262 | + maxBodyLength: -1, | |
| 1263 | + env: { | |
| 1264 | + FormData: platform_default.classes.FormData, | |
| 1265 | + Blob: platform_default.classes.Blob | |
| 1266 | + }, | |
| 1267 | + validateStatus: function validateStatus(status) { | |
| 1268 | + return status >= 200 && status < 300; | |
| 1269 | + }, | |
| 1270 | + headers: { common: { | |
| 1271 | + "Accept": "application/json, text/plain, */*", | |
| 1272 | + "Content-Type": void 0 | |
| 1273 | + } } | |
| 1274 | + }; | |
| 1275 | + utils_default.forEach([ | |
| 1276 | + "delete", | |
| 1277 | + "get", | |
| 1278 | + "head", | |
| 1279 | + "post", | |
| 1280 | + "put", | |
| 1281 | + "patch" | |
| 1282 | + ], (method) => { | |
| 1283 | + defaults.headers[method] = {}; | |
| 1284 | + }); | |
| 1285 | + | |
| 1286 | +//#endregion | |
| 1287 | +//#region node_modules/axios/lib/helpers/parseHeaders.js | |
| 1288 | + var ignoreDuplicateOf = utils_default.toObjectSet([ | |
| 1289 | + "age", | |
| 1290 | + "authorization", | |
| 1291 | + "content-length", | |
| 1292 | + "content-type", | |
| 1293 | + "etag", | |
| 1294 | + "expires", | |
| 1295 | + "from", | |
| 1296 | + "host", | |
| 1297 | + "if-modified-since", | |
| 1298 | + "if-unmodified-since", | |
| 1299 | + "last-modified", | |
| 1300 | + "location", | |
| 1301 | + "max-forwards", | |
| 1302 | + "proxy-authorization", | |
| 1303 | + "referer", | |
| 1304 | + "retry-after", | |
| 1305 | + "user-agent" | |
| 1306 | + ]); | |
| 1307 | + /** | |
| 1308 | + * Parse headers into an object | |
| 1309 | + * | |
| 1310 | + * ``` | |
| 1311 | + * Date: Wed, 27 Aug 2014 08:58:49 GMT | |
| 1312 | + * Content-Type: application/json | |
| 1313 | + * Connection: keep-alive | |
| 1314 | + * Transfer-Encoding: chunked | |
| 1315 | + * ``` | |
| 1316 | + * | |
| 1317 | + * @param {String} rawHeaders Headers needing to be parsed | |
| 1318 | + * | |
| 1319 | + * @returns {Object} Headers parsed into an object | |
| 1320 | + */ | |
| 1321 | + var parseHeaders_default = /* @__PURE__ */ __name((rawHeaders) => { | |
| 1322 | + const parsed = {}; | |
| 1323 | + let key; | |
| 1324 | + let val; | |
| 1325 | + let i; | |
| 1326 | + rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { | |
| 1327 | + i = line.indexOf(":"); | |
| 1328 | + key = line.substring(0, i).trim().toLowerCase(); | |
| 1329 | + val = line.substring(i + 1).trim(); | |
| 1330 | + if (!key || parsed[key] && ignoreDuplicateOf[key]) return; | |
| 1331 | + if (key === "set-cookie") if (parsed[key]) parsed[key].push(val); | |
| 1332 | + else parsed[key] = [val]; | |
| 1333 | + else parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; | |
| 1334 | + }); | |
| 1335 | + return parsed; | |
| 1336 | + }, "default"); | |
| 1337 | + | |
| 1338 | +//#endregion | |
| 1339 | +//#region node_modules/axios/lib/core/AxiosHeaders.js | |
| 1340 | + var $internals = Symbol("internals"); | |
| 1341 | + function normalizeHeader(header) { | |
| 1342 | + return header && String(header).trim().toLowerCase(); | |
| 1343 | + } | |
| 1344 | + function normalizeValue(value) { | |
| 1345 | + if (value === false || value == null) return value; | |
| 1346 | + return utils_default.isArray(value) ? value.map(normalizeValue) : String(value); | |
| 1347 | + } | |
| 1348 | + function parseTokens(str) { | |
| 1349 | + const tokens = Object.create(null); | |
| 1350 | + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; | |
| 1351 | + let match; | |
| 1352 | + while (match = tokensRE.exec(str)) tokens[match[1]] = match[2]; | |
| 1353 | + return tokens; | |
| 1354 | + } | |
| 1355 | + var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); | |
| 1356 | + function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { | |
| 1357 | + if (utils_default.isFunction(filter)) return filter.call(this, value, header); | |
| 1358 | + if (isHeaderNameFilter) value = header; | |
| 1359 | + if (!utils_default.isString(value)) return; | |
| 1360 | + if (utils_default.isString(filter)) return value.indexOf(filter) !== -1; | |
| 1361 | + if (utils_default.isRegExp(filter)) return filter.test(value); | |
| 1362 | + } | |
| 1363 | + function formatHeader(header) { | |
| 1364 | + return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { | |
| 1365 | + return char.toUpperCase() + str; | |
| 1366 | + }); | |
| 1367 | + } | |
| 1368 | + function buildAccessors(obj, header) { | |
| 1369 | + const accessorName = utils_default.toCamelCase(" " + header); | |
| 1370 | + [ | |
| 1371 | + "get", | |
| 1372 | + "set", | |
| 1373 | + "has" | |
| 1374 | + ].forEach((methodName) => { | |
| 1375 | + Object.defineProperty(obj, methodName + accessorName, { | |
| 1376 | + value: function(arg1, arg2, arg3) { | |
| 1377 | + return this[methodName].call(this, header, arg1, arg2, arg3); | |
| 1378 | + }, | |
| 1379 | + configurable: true | |
| 1380 | + }); | |
| 1381 | + }); | |
| 1382 | + } | |
| 1383 | + var AxiosHeaders$1 = class { | |
| 1384 | + static { | |
| 1385 | + __name(this, "AxiosHeaders"); | |
| 1386 | + } | |
| 1387 | + constructor(headers) { | |
| 1388 | + headers && this.set(headers); | |
| 1389 | + } | |
| 1390 | + set(header, valueOrRewrite, rewrite) { | |
| 1391 | + const self = this; | |
| 1392 | + function setHeader(_value, _header, _rewrite) { | |
| 1393 | + const lHeader = normalizeHeader(_header); | |
| 1394 | + if (!lHeader) throw new Error("header name must be a non-empty string"); | |
| 1395 | + const key = utils_default.findKey(self, lHeader); | |
| 1396 | + if (!key || self[key] === void 0 || _rewrite === true || _rewrite === void 0 && self[key] !== false) self[key || _header] = normalizeValue(_value); | |
| 1397 | + } | |
| 1398 | + const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); | |
| 1399 | + if (utils_default.isPlainObject(header) || header instanceof this.constructor) setHeaders(header, valueOrRewrite); | |
| 1400 | + else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) setHeaders(parseHeaders_default(header), valueOrRewrite); | |
| 1401 | + else if (utils_default.isObject(header) && utils_default.isIterable(header)) { | |
| 1402 | + let obj = {}; | |
| 1403 | + let dest; | |
| 1404 | + let key; | |
| 1405 | + for (const entry of header) { | |
| 1406 | + if (!utils_default.isArray(entry)) throw TypeError("Object iterator must return a key-value pair"); | |
| 1407 | + obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1]; | |
| 1408 | + } | |
| 1409 | + setHeaders(obj, valueOrRewrite); | |
| 1410 | + } else header != null && setHeader(valueOrRewrite, header, rewrite); | |
| 1411 | + return this; | |
| 1412 | + } | |
| 1413 | + get(header, parser) { | |
| 1414 | + header = normalizeHeader(header); | |
| 1415 | + if (header) { | |
| 1416 | + const key = utils_default.findKey(this, header); | |
| 1417 | + if (key) { | |
| 1418 | + const value = this[key]; | |
| 1419 | + if (!parser) return value; | |
| 1420 | + if (parser === true) return parseTokens(value); | |
| 1421 | + if (utils_default.isFunction(parser)) return parser.call(this, value, key); | |
| 1422 | + if (utils_default.isRegExp(parser)) return parser.exec(value); | |
| 1423 | + throw new TypeError("parser must be boolean|regexp|function"); | |
| 1424 | + } | |
| 1425 | + } | |
| 1426 | + } | |
| 1427 | + has(header, matcher) { | |
| 1428 | + header = normalizeHeader(header); | |
| 1429 | + if (header) { | |
| 1430 | + const key = utils_default.findKey(this, header); | |
| 1431 | + return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher))); | |
| 1432 | + } | |
| 1433 | + return false; | |
| 1434 | + } | |
| 1435 | + delete(header, matcher) { | |
| 1436 | + const self = this; | |
| 1437 | + let deleted = false; | |
| 1438 | + function deleteHeader(_header) { | |
| 1439 | + _header = normalizeHeader(_header); | |
| 1440 | + if (_header) { | |
| 1441 | + const key = utils_default.findKey(self, _header); | |
| 1442 | + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { | |
| 1443 | + delete self[key]; | |
| 1444 | + deleted = true; | |
| 1445 | + } | |
| 1446 | + } | |
| 1447 | + } | |
| 1448 | + if (utils_default.isArray(header)) header.forEach(deleteHeader); | |
| 1449 | + else deleteHeader(header); | |
| 1450 | + return deleted; | |
| 1451 | + } | |
| 1452 | + clear(matcher) { | |
| 1453 | + const keys = Object.keys(this); | |
| 1454 | + let i = keys.length; | |
| 1455 | + let deleted = false; | |
| 1456 | + while (i--) { | |
| 1457 | + const key = keys[i]; | |
| 1458 | + if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { | |
| 1459 | + delete this[key]; | |
| 1460 | + deleted = true; | |
| 1461 | + } | |
| 1462 | + } | |
| 1463 | + return deleted; | |
| 1464 | + } | |
| 1465 | + normalize(format) { | |
| 1466 | + const self = this; | |
| 1467 | + const headers = {}; | |
| 1468 | + utils_default.forEach(this, (value, header) => { | |
| 1469 | + const key = utils_default.findKey(headers, header); | |
| 1470 | + if (key) { | |
| 1471 | + self[key] = normalizeValue(value); | |
| 1472 | + delete self[header]; | |
| 1473 | + return; | |
| 1474 | + } | |
| 1475 | + const normalized = format ? formatHeader(header) : String(header).trim(); | |
| 1476 | + if (normalized !== header) delete self[header]; | |
| 1477 | + self[normalized] = normalizeValue(value); | |
| 1478 | + headers[normalized] = true; | |
| 1479 | + }); | |
| 1480 | + return this; | |
| 1481 | + } | |
| 1482 | + concat(...targets) { | |
| 1483 | + return this.constructor.concat(this, ...targets); | |
| 1484 | + } | |
| 1485 | + toJSON(asStrings) { | |
| 1486 | + const obj = Object.create(null); | |
| 1487 | + utils_default.forEach(this, (value, header) => { | |
| 1488 | + value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value); | |
| 1489 | + }); | |
| 1490 | + return obj; | |
| 1491 | + } | |
| 1492 | + [Symbol.iterator]() { | |
| 1493 | + return Object.entries(this.toJSON())[Symbol.iterator](); | |
| 1494 | + } | |
| 1495 | + toString() { | |
| 1496 | + return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); | |
| 1497 | + } | |
| 1498 | + getSetCookie() { | |
| 1499 | + return this.get("set-cookie") || []; | |
| 1500 | + } | |
| 1501 | + get [Symbol.toStringTag]() { | |
| 1502 | + return "AxiosHeaders"; | |
| 1503 | + } | |
| 1504 | + static from(thing) { | |
| 1505 | + return thing instanceof this ? thing : new this(thing); | |
| 1506 | + } | |
| 1507 | + static concat(first, ...targets) { | |
| 1508 | + const computed = new this(first); | |
| 1509 | + targets.forEach((target) => computed.set(target)); | |
| 1510 | + return computed; | |
| 1511 | + } | |
| 1512 | + static accessor(header) { | |
| 1513 | + const accessors = (this[$internals] = this[$internals] = { accessors: {} }).accessors; | |
| 1514 | + const prototype = this.prototype; | |
| 1515 | + function defineAccessor(_header) { | |
| 1516 | + const lHeader = normalizeHeader(_header); | |
| 1517 | + if (!accessors[lHeader]) { | |
| 1518 | + buildAccessors(prototype, _header); | |
| 1519 | + accessors[lHeader] = true; | |
| 1520 | + } | |
| 1521 | + } | |
| 1522 | + utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); | |
| 1523 | + return this; | |
| 1524 | + } | |
| 1525 | + }; | |
| 1526 | + AxiosHeaders$1.accessor([ | |
| 1527 | + "Content-Type", | |
| 1528 | + "Content-Length", | |
| 1529 | + "Accept", | |
| 1530 | + "Accept-Encoding", | |
| 1531 | + "User-Agent", | |
| 1532 | + "Authorization" | |
| 1533 | + ]); | |
| 1534 | + utils_default.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => { | |
| 1535 | + let mapped = key[0].toUpperCase() + key.slice(1); | |
| 1536 | + return { | |
| 1537 | + get: () => value, | |
| 1538 | + set(headerValue) { | |
| 1539 | + this[mapped] = headerValue; | |
| 1540 | + } | |
| 1541 | + }; | |
| 1542 | + }); | |
| 1543 | + utils_default.freezeMethods(AxiosHeaders$1); | |
| 1544 | + | |
| 1545 | +//#endregion | |
| 1546 | +//#region node_modules/axios/lib/core/transformData.js | |
| 1547 | +/** | |
| 1548 | + * Transform the data for a request or a response | |
| 1549 | + * | |
| 1550 | + * @param {Array|Function} fns A single function or Array of functions | |
| 1551 | + * @param {?Object} response The response object | |
| 1552 | + * | |
| 1553 | + * @returns {*} The resulting transformed data | |
| 1554 | + */ | |
| 1555 | + function transformData(fns, response) { | |
| 1556 | + const config = this || defaults; | |
| 1557 | + const context = response || config; | |
| 1558 | + const headers = AxiosHeaders$1.from(context.headers); | |
| 1559 | + let data = context.data; | |
| 1560 | + utils_default.forEach(fns, function transform(fn) { | |
| 1561 | + data = fn.call(config, data, headers.normalize(), response ? response.status : void 0); | |
| 1562 | + }); | |
| 1563 | + headers.normalize(); | |
| 1564 | + return data; | |
| 1565 | + } | |
| 1566 | + | |
| 1567 | +//#endregion | |
| 1568 | +//#region node_modules/axios/lib/cancel/isCancel.js | |
| 1569 | + function isCancel$1(value) { | |
| 1570 | + return !!(value && value.__CANCEL__); | |
| 1571 | + } | |
| 1572 | + __name(isCancel$1, "isCancel"); | |
| 1573 | + | |
| 1574 | +//#endregion | |
| 1575 | +//#region node_modules/axios/lib/cancel/CanceledError.js | |
| 1576 | +/** | |
| 1577 | + * A `CanceledError` is an object that is thrown when an operation is canceled. | |
| 1578 | + * | |
| 1579 | + * @param {string=} message The message. | |
| 1580 | + * @param {Object=} config The config. | |
| 1581 | + * @param {Object=} request The request. | |
| 1582 | + * | |
| 1583 | + * @returns {CanceledError} The created error. | |
| 1584 | + */ | |
| 1585 | + function CanceledError$1(message, config, request) { | |
| 1586 | + AxiosError$1.call(this, message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request); | |
| 1587 | + this.name = "CanceledError"; | |
| 1588 | + } | |
| 1589 | + __name(CanceledError$1, "CanceledError"); | |
| 1590 | + utils_default.inherits(CanceledError$1, AxiosError$1, { __CANCEL__: true }); | |
| 1591 | + | |
| 1592 | +//#endregion | |
| 1593 | +//#region node_modules/axios/lib/core/settle.js | |
| 1594 | +/** | |
| 1595 | + * Resolve or reject a Promise based on response status. | |
| 1596 | + * | |
| 1597 | + * @param {Function} resolve A function that resolves the promise. | |
| 1598 | + * @param {Function} reject A function that rejects the promise. | |
| 1599 | + * @param {object} response The response. | |
| 1600 | + * | |
| 1601 | + * @returns {object} The response. | |
| 1602 | + */ | |
| 1603 | + function settle(resolve, reject, response) { | |
| 1604 | + const validateStatus = response.config.validateStatus; | |
| 1605 | + if (!response.status || !validateStatus || validateStatus(response.status)) resolve(response); | |
| 1606 | + else reject(new AxiosError$1("Request failed with status code " + response.status, [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response)); | |
| 1607 | + } | |
| 1608 | + | |
| 1609 | +//#endregion | |
| 1610 | +//#region node_modules/axios/lib/helpers/parseProtocol.js | |
| 1611 | + function parseProtocol(url) { | |
| 1612 | + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); | |
| 1613 | + return match && match[1] || ""; | |
| 1614 | + } | |
| 1615 | + | |
| 1616 | +//#endregion | |
| 1617 | +//#region node_modules/axios/lib/helpers/speedometer.js | |
| 1618 | +/** | |
| 1619 | + * Calculate data maxRate | |
| 1620 | + * @param {Number} [samplesCount= 10] | |
| 1621 | + * @param {Number} [min= 1000] | |
| 1622 | + * @returns {Function} | |
| 1623 | + */ | |
| 1624 | + function speedometer(samplesCount, min) { | |
| 1625 | + samplesCount = samplesCount || 10; | |
| 1626 | + const bytes = new Array(samplesCount); | |
| 1627 | + const timestamps = new Array(samplesCount); | |
| 1628 | + let head = 0; | |
| 1629 | + let tail = 0; | |
| 1630 | + let firstSampleTS; | |
| 1631 | + min = min !== void 0 ? min : 1e3; | |
| 1632 | + return function push(chunkLength) { | |
| 1633 | + const now = Date.now(); | |
| 1634 | + const startedAt = timestamps[tail]; | |
| 1635 | + if (!firstSampleTS) firstSampleTS = now; | |
| 1636 | + bytes[head] = chunkLength; | |
| 1637 | + timestamps[head] = now; | |
| 1638 | + let i = tail; | |
| 1639 | + let bytesCount = 0; | |
| 1640 | + while (i !== head) { | |
| 1641 | + bytesCount += bytes[i++]; | |
| 1642 | + i = i % samplesCount; | |
| 1643 | + } | |
| 1644 | + head = (head + 1) % samplesCount; | |
| 1645 | + if (head === tail) tail = (tail + 1) % samplesCount; | |
| 1646 | + if (now - firstSampleTS < min) return; | |
| 1647 | + const passed = startedAt && now - startedAt; | |
| 1648 | + return passed ? Math.round(bytesCount * 1e3 / passed) : void 0; | |
| 1649 | + }; | |
| 1650 | + } | |
| 1651 | + | |
| 1652 | +//#endregion | |
| 1653 | +//#region node_modules/axios/lib/helpers/throttle.js | |
| 1654 | +/** | |
| 1655 | + * Throttle decorator | |
| 1656 | + * @param {Function} fn | |
| 1657 | + * @param {Number} freq | |
| 1658 | + * @return {Function} | |
| 1659 | + */ | |
| 1660 | + function throttle(fn, freq) { | |
| 1661 | + let timestamp = 0; | |
| 1662 | + let threshold = 1e3 / freq; | |
| 1663 | + let lastArgs; | |
| 1664 | + let timer; | |
| 1665 | + const invoke = (args, now = Date.now()) => { | |
| 1666 | + timestamp = now; | |
| 1667 | + lastArgs = null; | |
| 1668 | + if (timer) { | |
| 1669 | + clearTimeout(timer); | |
| 1670 | + timer = null; | |
| 1671 | + } | |
| 1672 | + fn(...args); | |
| 1673 | + }; | |
| 1674 | + const throttled = (...args) => { | |
| 1675 | + const now = Date.now(); | |
| 1676 | + const passed = now - timestamp; | |
| 1677 | + if (passed >= threshold) invoke(args, now); | |
| 1678 | + else { | |
| 1679 | + lastArgs = args; | |
| 1680 | + if (!timer) timer = setTimeout(() => { | |
| 1681 | + timer = null; | |
| 1682 | + invoke(lastArgs); | |
| 1683 | + }, threshold - passed); | |
| 1684 | + } | |
| 1685 | + }; | |
| 1686 | + const flush = () => lastArgs && invoke(lastArgs); | |
| 1687 | + return [throttled, flush]; | |
| 1688 | + } | |
| 1689 | + | |
| 1690 | +//#endregion | |
| 1691 | +//#region node_modules/axios/lib/helpers/progressEventReducer.js | |
| 1692 | + var progressEventReducer = (listener, isDownloadStream, freq = 3) => { | |
| 1693 | + let bytesNotified = 0; | |
| 1694 | + const _speedometer = speedometer(50, 250); | |
| 1695 | + return throttle((e) => { | |
| 1696 | + const loaded = e.loaded; | |
| 1697 | + const total = e.lengthComputable ? e.total : void 0; | |
| 1698 | + const progressBytes = loaded - bytesNotified; | |
| 1699 | + const rate = _speedometer(progressBytes); | |
| 1700 | + const inRange = loaded <= total; | |
| 1701 | + bytesNotified = loaded; | |
| 1702 | + listener({ | |
| 1703 | + loaded, | |
| 1704 | + total, | |
| 1705 | + progress: total ? loaded / total : void 0, | |
| 1706 | + bytes: progressBytes, | |
| 1707 | + rate: rate ? rate : void 0, | |
| 1708 | + estimated: rate && total && inRange ? (total - loaded) / rate : void 0, | |
| 1709 | + event: e, | |
| 1710 | + lengthComputable: total != null, | |
| 1711 | + [isDownloadStream ? "download" : "upload"]: true | |
| 1712 | + }); | |
| 1713 | + }, freq); | |
| 1714 | + }; | |
| 1715 | + var progressEventDecorator = (total, throttled) => { | |
| 1716 | + const lengthComputable = total != null; | |
| 1717 | + return [(loaded) => throttled[0]({ | |
| 1718 | + lengthComputable, | |
| 1719 | + total, | |
| 1720 | + loaded | |
| 1721 | + }), throttled[1]]; | |
| 1722 | + }; | |
| 1723 | + var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args)); | |
| 1724 | + | |
| 1725 | +//#endregion | |
| 1726 | +//#region node_modules/axios/lib/helpers/isURLSameOrigin.js | |
| 1727 | + var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => { | |
| 1728 | + url = new URL(url, platform_default.origin); | |
| 1729 | + return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port); | |
| 1730 | + })(new URL(platform_default.origin), platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)) : () => true; | |
| 1731 | + | |
| 1732 | +//#endregion | |
| 1733 | +//#region node_modules/axios/lib/helpers/cookies.js | |
| 1734 | + var cookies_default = platform_default.hasStandardBrowserEnv ? { | |
| 1735 | + write(name, value, expires, path, domain, secure, sameSite) { | |
| 1736 | + if (typeof document === "undefined") return; | |
| 1737 | + const cookie = [`${name}=${encodeURIComponent(value)}`]; | |
| 1738 | + if (utils_default.isNumber(expires)) cookie.push(`expires=${new Date(expires).toUTCString()}`); | |
| 1739 | + if (utils_default.isString(path)) cookie.push(`path=${path}`); | |
| 1740 | + if (utils_default.isString(domain)) cookie.push(`domain=${domain}`); | |
| 1741 | + if (secure === true) cookie.push("secure"); | |
| 1742 | + if (utils_default.isString(sameSite)) cookie.push(`SameSite=${sameSite}`); | |
| 1743 | + document.cookie = cookie.join("; "); | |
| 1744 | + }, | |
| 1745 | + read(name) { | |
| 1746 | + if (typeof document === "undefined") return null; | |
| 1747 | + const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)")); | |
| 1748 | + return match ? decodeURIComponent(match[1]) : null; | |
| 1749 | + }, | |
| 1750 | + remove(name) { | |
| 1751 | + this.write(name, "", Date.now() - 864e5, "/"); | |
| 1752 | + } | |
| 1753 | + } : { | |
| 1754 | + write() {}, | |
| 1755 | + read() { | |
| 1756 | + return null; | |
| 1757 | + }, | |
| 1758 | + remove() {} | |
| 1759 | + }; | |
| 1760 | + | |
| 1761 | +//#endregion | |
| 1762 | +//#region node_modules/axios/lib/helpers/isAbsoluteURL.js | |
| 1763 | +/** | |
| 1764 | + * Determines whether the specified URL is absolute | |
| 1765 | + * | |
| 1766 | + * @param {string} url The URL to test | |
| 1767 | + * | |
| 1768 | + * @returns {boolean} True if the specified URL is absolute, otherwise false | |
| 1769 | + */ | |
| 1770 | + function isAbsoluteURL(url) { | |
| 1771 | + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); | |
| 1772 | + } | |
| 1773 | + | |
| 1774 | +//#endregion | |
| 1775 | +//#region node_modules/axios/lib/helpers/combineURLs.js | |
| 1776 | +/** | |
| 1777 | + * Creates a new URL by combining the specified URLs | |
| 1778 | + * | |
| 1779 | + * @param {string} baseURL The base URL | |
| 1780 | + * @param {string} relativeURL The relative URL | |
| 1781 | + * | |
| 1782 | + * @returns {string} The combined URL | |
| 1783 | + */ | |
| 1784 | + function combineURLs(baseURL, relativeURL) { | |
| 1785 | + return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; | |
| 1786 | + } | |
| 1787 | + | |
| 1788 | +//#endregion | |
| 1789 | +//#region node_modules/axios/lib/core/buildFullPath.js | |
| 1790 | +/** | |
| 1791 | + * Creates a new URL by combining the baseURL with the requestedURL, | |
| 1792 | + * only when the requestedURL is not already an absolute URL. | |
| 1793 | + * If the requestURL is absolute, this function returns the requestedURL untouched. | |
| 1794 | + * | |
| 1795 | + * @param {string} baseURL The base URL | |
| 1796 | + * @param {string} requestedURL Absolute or relative URL to combine | |
| 1797 | + * | |
| 1798 | + * @returns {string} The combined full path | |
| 1799 | + */ | |
| 1800 | + function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { | |
| 1801 | + let isRelativeUrl = !isAbsoluteURL(requestedURL); | |
| 1802 | + if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) return combineURLs(baseURL, requestedURL); | |
| 1803 | + return requestedURL; | |
| 1804 | + } | |
| 1805 | + | |
| 1806 | +//#endregion | |
| 1807 | +//#region node_modules/axios/lib/core/mergeConfig.js | |
| 1808 | + var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing; | |
| 1809 | + /** | |
| 1810 | + * Config-specific merge-function which creates a new config-object | |
| 1811 | + * by merging two configuration objects together. | |
| 1812 | + * | |
| 1813 | + * @param {Object} config1 | |
| 1814 | + * @param {Object} config2 | |
| 1815 | + * | |
| 1816 | + * @returns {Object} New object resulting from merging config2 to config1 | |
| 1817 | + */ | |
| 1818 | + function mergeConfig$1(config1, config2) { | |
| 1819 | + config2 = config2 || {}; | |
| 1820 | + const config = {}; | |
| 1821 | + function getMergedValue(target, source, prop, caseless) { | |
| 1822 | + if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) return utils_default.merge.call({ caseless }, target, source); | |
| 1823 | + else if (utils_default.isPlainObject(source)) return utils_default.merge({}, source); | |
| 1824 | + else if (utils_default.isArray(source)) return source.slice(); | |
| 1825 | + return source; | |
| 1826 | + } | |
| 1827 | + function mergeDeepProperties(a, b, prop, caseless) { | |
| 1828 | + if (!utils_default.isUndefined(b)) return getMergedValue(a, b, prop, caseless); | |
| 1829 | + else if (!utils_default.isUndefined(a)) return getMergedValue(void 0, a, prop, caseless); | |
| 1830 | + } | |
| 1831 | + function valueFromConfig2(a, b) { | |
| 1832 | + if (!utils_default.isUndefined(b)) return getMergedValue(void 0, b); | |
| 1833 | + } | |
| 1834 | + function defaultToConfig2(a, b) { | |
| 1835 | + if (!utils_default.isUndefined(b)) return getMergedValue(void 0, b); | |
| 1836 | + else if (!utils_default.isUndefined(a)) return getMergedValue(void 0, a); | |
| 1837 | + } | |
| 1838 | + function mergeDirectKeys(a, b, prop) { | |
| 1839 | + if (prop in config2) return getMergedValue(a, b); | |
| 1840 | + else if (prop in config1) return getMergedValue(void 0, a); | |
| 1841 | + } | |
| 1842 | + const mergeMap = { | |
| 1843 | + url: valueFromConfig2, | |
| 1844 | + method: valueFromConfig2, | |
| 1845 | + data: valueFromConfig2, | |
| 1846 | + baseURL: defaultToConfig2, | |
| 1847 | + transformRequest: defaultToConfig2, | |
| 1848 | + transformResponse: defaultToConfig2, | |
| 1849 | + paramsSerializer: defaultToConfig2, | |
| 1850 | + timeout: defaultToConfig2, | |
| 1851 | + timeoutMessage: defaultToConfig2, | |
| 1852 | + withCredentials: defaultToConfig2, | |
| 1853 | + withXSRFToken: defaultToConfig2, | |
| 1854 | + adapter: defaultToConfig2, | |
| 1855 | + responseType: defaultToConfig2, | |
| 1856 | + xsrfCookieName: defaultToConfig2, | |
| 1857 | + xsrfHeaderName: defaultToConfig2, | |
| 1858 | + onUploadProgress: defaultToConfig2, | |
| 1859 | + onDownloadProgress: defaultToConfig2, | |
| 1860 | + decompress: defaultToConfig2, | |
| 1861 | + maxContentLength: defaultToConfig2, | |
| 1862 | + maxBodyLength: defaultToConfig2, | |
| 1863 | + beforeRedirect: defaultToConfig2, | |
| 1864 | + transport: defaultToConfig2, | |
| 1865 | + httpAgent: defaultToConfig2, | |
| 1866 | + httpsAgent: defaultToConfig2, | |
| 1867 | + cancelToken: defaultToConfig2, | |
| 1868 | + socketPath: defaultToConfig2, | |
| 1869 | + responseEncoding: defaultToConfig2, | |
| 1870 | + validateStatus: mergeDirectKeys, | |
| 1871 | + headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) | |
| 1872 | + }; | |
| 1873 | + utils_default.forEach(Object.keys({ | |
| 1874 | + ...config1, | |
| 1875 | + ...config2 | |
| 1876 | + }), function computeConfigValue(prop) { | |
| 1877 | + const merge = mergeMap[prop] || mergeDeepProperties; | |
| 1878 | + const configValue = merge(config1[prop], config2[prop], prop); | |
| 1879 | + utils_default.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue); | |
| 1880 | + }); | |
| 1881 | + return config; | |
| 1882 | + } | |
| 1883 | + __name(mergeConfig$1, "mergeConfig"); | |
| 1884 | + | |
| 1885 | +//#endregion | |
| 1886 | +//#region node_modules/axios/lib/helpers/resolveConfig.js | |
| 1887 | + var resolveConfig_default = /* @__PURE__ */ __name((config) => { | |
| 1888 | + const newConfig = mergeConfig$1({}, config); | |
| 1889 | + let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; | |
| 1890 | + newConfig.headers = headers = AxiosHeaders$1.from(headers); | |
| 1891 | + newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); | |
| 1892 | + if (auth) headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))); | |
| 1893 | + if (utils_default.isFormData(data)) { | |
| 1894 | + if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) headers.setContentType(void 0); | |
| 1895 | + else if (utils_default.isFunction(data.getHeaders)) { | |
| 1896 | + const formHeaders = data.getHeaders(); | |
| 1897 | + const allowedHeaders = ["content-type", "content-length"]; | |
| 1898 | + Object.entries(formHeaders).forEach(([key, val]) => { | |
| 1899 | + if (allowedHeaders.includes(key.toLowerCase())) headers.set(key, val); | |
| 1900 | + }); | |
| 1901 | + } | |
| 1902 | + } | |
| 1903 | + if (platform_default.hasStandardBrowserEnv) { | |
| 1904 | + withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); | |
| 1905 | + if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) { | |
| 1906 | + const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName); | |
| 1907 | + if (xsrfValue) headers.set(xsrfHeaderName, xsrfValue); | |
| 1908 | + } | |
| 1909 | + } | |
| 1910 | + return newConfig; | |
| 1911 | + }, "default"); | |
| 1912 | + | |
| 1913 | +//#endregion | |
| 1914 | +//#region node_modules/axios/lib/adapters/xhr.js | |
| 1915 | + var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; | |
| 1916 | + var xhr_default = isXHRAdapterSupported && function(config) { | |
| 1917 | + return new Promise(function dispatchXhrRequest(resolve, reject) { | |
| 1918 | + const _config = resolveConfig_default(config); | |
| 1919 | + let requestData = _config.data; | |
| 1920 | + const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize(); | |
| 1921 | + let { responseType, onUploadProgress, onDownloadProgress } = _config; | |
| 1922 | + let onCanceled; | |
| 1923 | + let uploadThrottled; | |
| 1924 | + let downloadThrottled; | |
| 1925 | + let flushUpload; | |
| 1926 | + let flushDownload; | |
| 1927 | + function done() { | |
| 1928 | + flushUpload && flushUpload(); | |
| 1929 | + flushDownload && flushDownload(); | |
| 1930 | + _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); | |
| 1931 | + _config.signal && _config.signal.removeEventListener("abort", onCanceled); | |
| 1932 | + } | |
| 1933 | + let request = new XMLHttpRequest(); | |
| 1934 | + request.open(_config.method.toUpperCase(), _config.url, true); | |
| 1935 | + request.timeout = _config.timeout; | |
| 1936 | + function onloadend() { | |
| 1937 | + if (!request) return; | |
| 1938 | + const responseHeaders = AxiosHeaders$1.from("getAllResponseHeaders" in request && request.getAllResponseHeaders()); | |
| 1939 | + settle(function _resolve(value) { | |
| 1940 | + resolve(value); | |
| 1941 | + done(); | |
| 1942 | + }, function _reject(err) { | |
| 1943 | + reject(err); | |
| 1944 | + done(); | |
| 1945 | + }, { | |
| 1946 | + data: !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response, | |
| 1947 | + status: request.status, | |
| 1948 | + statusText: request.statusText, | |
| 1949 | + headers: responseHeaders, | |
| 1950 | + config, | |
| 1951 | + request | |
| 1952 | + }); | |
| 1953 | + request = null; | |
| 1954 | + } | |
| 1955 | + if ("onloadend" in request) request.onloadend = onloadend; | |
| 1956 | + else request.onreadystatechange = function handleLoad() { | |
| 1957 | + if (!request || request.readyState !== 4) return; | |
| 1958 | + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) return; | |
| 1959 | + setTimeout(onloadend); | |
| 1960 | + }; | |
| 1961 | + request.onabort = function handleAbort() { | |
| 1962 | + if (!request) return; | |
| 1963 | + reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request)); | |
| 1964 | + request = null; | |
| 1965 | + }; | |
| 1966 | + request.onerror = function handleError(event) { | |
| 1967 | + const err = new AxiosError$1(event && event.message ? event.message : "Network Error", AxiosError$1.ERR_NETWORK, config, request); | |
| 1968 | + err.event = event || null; | |
| 1969 | + reject(err); | |
| 1970 | + request = null; | |
| 1971 | + }; | |
| 1972 | + request.ontimeout = function handleTimeout() { | |
| 1973 | + let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded"; | |
| 1974 | + const transitional = _config.transitional || transitional_default; | |
| 1975 | + if (_config.timeoutErrorMessage) timeoutErrorMessage = _config.timeoutErrorMessage; | |
| 1976 | + reject(new AxiosError$1(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, config, request)); | |
| 1977 | + request = null; | |
| 1978 | + }; | |
| 1979 | + requestData === void 0 && requestHeaders.setContentType(null); | |
| 1980 | + if ("setRequestHeader" in request) utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { | |
| 1981 | + request.setRequestHeader(key, val); | |
| 1982 | + }); | |
| 1983 | + if (!utils_default.isUndefined(_config.withCredentials)) request.withCredentials = !!_config.withCredentials; | |
| 1984 | + if (responseType && responseType !== "json") request.responseType = _config.responseType; | |
| 1985 | + if (onDownloadProgress) { | |
| 1986 | + [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); | |
| 1987 | + request.addEventListener("progress", downloadThrottled); | |
| 1988 | + } | |
| 1989 | + if (onUploadProgress && request.upload) { | |
| 1990 | + [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); | |
| 1991 | + request.upload.addEventListener("progress", uploadThrottled); | |
| 1992 | + request.upload.addEventListener("loadend", flushUpload); | |
| 1993 | + } | |
| 1994 | + if (_config.cancelToken || _config.signal) { | |
| 1995 | + onCanceled = (cancel) => { | |
| 1996 | + if (!request) return; | |
| 1997 | + reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel); | |
| 1998 | + request.abort(); | |
| 1999 | + request = null; | |
| 2000 | + }; | |
| 2001 | + _config.cancelToken && _config.cancelToken.subscribe(onCanceled); | |
| 2002 | + if (_config.signal) _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); | |
| 2003 | + } | |
| 2004 | + const protocol = parseProtocol(_config.url); | |
| 2005 | + if (protocol && platform_default.protocols.indexOf(protocol) === -1) { | |
| 2006 | + reject(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config)); | |
| 2007 | + return; | |
| 2008 | + } | |
| 2009 | + request.send(requestData || null); | |
| 2010 | + }); | |
| 2011 | + }; | |
| 2012 | + | |
| 2013 | +//#endregion | |
| 2014 | +//#region node_modules/axios/lib/helpers/composeSignals.js | |
| 2015 | + var composeSignals = (signals, timeout) => { | |
| 2016 | + const { length } = signals = signals ? signals.filter(Boolean) : []; | |
| 2017 | + if (timeout || length) { | |
| 2018 | + let controller = new AbortController(); | |
| 2019 | + let aborted; | |
| 2020 | + const onabort = function(reason) { | |
| 2021 | + if (!aborted) { | |
| 2022 | + aborted = true; | |
| 2023 | + unsubscribe(); | |
| 2024 | + const err = reason instanceof Error ? reason : this.reason; | |
| 2025 | + controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err)); | |
| 2026 | + } | |
| 2027 | + }; | |
| 2028 | + let timer = timeout && setTimeout(() => { | |
| 2029 | + timer = null; | |
| 2030 | + onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT)); | |
| 2031 | + }, timeout); | |
| 2032 | + const unsubscribe = () => { | |
| 2033 | + if (signals) { | |
| 2034 | + timer && clearTimeout(timer); | |
| 2035 | + timer = null; | |
| 2036 | + signals.forEach((signal) => { | |
| 2037 | + signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener("abort", onabort); | |
| 2038 | + }); | |
| 2039 | + signals = null; | |
| 2040 | + } | |
| 2041 | + }; | |
| 2042 | + signals.forEach((signal) => signal.addEventListener("abort", onabort)); | |
| 2043 | + const { signal } = controller; | |
| 2044 | + signal.unsubscribe = () => utils_default.asap(unsubscribe); | |
| 2045 | + return signal; | |
| 2046 | + } | |
| 2047 | + }; | |
| 2048 | + | |
| 2049 | +//#endregion | |
| 2050 | +//#region node_modules/axios/lib/helpers/trackStream.js | |
| 2051 | + var streamChunk = function* (chunk, chunkSize) { | |
| 2052 | + let len = chunk.byteLength; | |
| 2053 | + if (!chunkSize || len < chunkSize) { | |
| 2054 | + yield chunk; | |
| 2055 | + return; | |
| 2056 | + } | |
| 2057 | + let pos = 0; | |
| 2058 | + let end; | |
| 2059 | + while (pos < len) { | |
| 2060 | + end = pos + chunkSize; | |
| 2061 | + yield chunk.slice(pos, end); | |
| 2062 | + pos = end; | |
| 2063 | + } | |
| 2064 | + }; | |
| 2065 | + var readBytes = async function* (iterable, chunkSize) { | |
| 2066 | + for await (const chunk of readStream(iterable)) yield* streamChunk(chunk, chunkSize); | |
| 2067 | + }; | |
| 2068 | + var readStream = async function* (stream) { | |
| 2069 | + if (stream[Symbol.asyncIterator]) { | |
| 2070 | + yield* stream; | |
| 2071 | + return; | |
| 2072 | + } | |
| 2073 | + const reader = stream.getReader(); | |
| 2074 | + try { | |
| 2075 | + for (;;) { | |
| 2076 | + const { done, value } = await reader.read(); | |
| 2077 | + if (done) break; | |
| 2078 | + yield value; | |
| 2079 | + } | |
| 2080 | + } finally { | |
| 2081 | + await reader.cancel(); | |
| 2082 | + } | |
| 2083 | + }; | |
| 2084 | + var trackStream = (stream, chunkSize, onProgress, onFinish) => { | |
| 2085 | + const iterator = readBytes(stream, chunkSize); | |
| 2086 | + let bytes = 0; | |
| 2087 | + let done; | |
| 2088 | + let _onFinish = (e) => { | |
| 2089 | + if (!done) { | |
| 2090 | + done = true; | |
| 2091 | + onFinish && onFinish(e); | |
| 2092 | + } | |
| 2093 | + }; | |
| 2094 | + return new ReadableStream({ | |
| 2095 | + async pull(controller) { | |
| 2096 | + try { | |
| 2097 | + const { done, value } = await iterator.next(); | |
| 2098 | + if (done) { | |
| 2099 | + _onFinish(); | |
| 2100 | + controller.close(); | |
| 2101 | + return; | |
| 2102 | + } | |
| 2103 | + let len = value.byteLength; | |
| 2104 | + if (onProgress) onProgress(bytes += len); | |
| 2105 | + controller.enqueue(new Uint8Array(value)); | |
| 2106 | + } catch (err) { | |
| 2107 | + _onFinish(err); | |
| 2108 | + throw err; | |
| 2109 | + } | |
| 2110 | + }, | |
| 2111 | + cancel(reason) { | |
| 2112 | + _onFinish(reason); | |
| 2113 | + return iterator.return(); | |
| 2114 | + } | |
| 2115 | + }, { highWaterMark: 2 }); | |
| 2116 | + }; | |
| 2117 | + | |
| 2118 | +//#endregion | |
| 2119 | +//#region node_modules/axios/lib/adapters/fetch.js | |
| 2120 | + var DEFAULT_CHUNK_SIZE = 64 * 1024; | |
| 2121 | + var { isFunction } = utils_default; | |
| 2122 | + var globalFetchAPI = (({ Request, Response }) => ({ | |
| 2123 | + Request, | |
| 2124 | + Response | |
| 2125 | + }))(utils_default.global); | |
| 2126 | + var { ReadableStream: ReadableStream$1, TextEncoder } = utils_default.global; | |
| 2127 | + var test = (fn, ...args) => { | |
| 2128 | + try { | |
| 2129 | + return !!fn(...args); | |
| 2130 | + } catch (e) { | |
| 2131 | + return false; | |
| 2132 | + } | |
| 2133 | + }; | |
| 2134 | + var factory = (env) => { | |
| 2135 | + env = utils_default.merge.call({ skipUndefined: true }, globalFetchAPI, env); | |
| 2136 | + const { fetch: envFetch, Request, Response } = env; | |
| 2137 | + const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function"; | |
| 2138 | + const isRequestSupported = isFunction(Request); | |
| 2139 | + const isResponseSupported = isFunction(Response); | |
| 2140 | + if (!isFetchSupported) return false; | |
| 2141 | + const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1); | |
| 2142 | + const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer())); | |
| 2143 | + const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { | |
| 2144 | + let duplexAccessed = false; | |
| 2145 | + const hasContentType = new Request(platform_default.origin, { | |
| 2146 | + body: new ReadableStream$1(), | |
| 2147 | + method: "POST", | |
| 2148 | + get duplex() { | |
| 2149 | + duplexAccessed = true; | |
| 2150 | + return "half"; | |
| 2151 | + } | |
| 2152 | + }).headers.has("Content-Type"); | |
| 2153 | + return duplexAccessed && !hasContentType; | |
| 2154 | + }); | |
| 2155 | + const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body)); | |
| 2156 | + const resolvers = { stream: supportsResponseStream && ((res) => res.body) }; | |
| 2157 | + isFetchSupported && (() => { | |
| 2158 | + [ | |
| 2159 | + "text", | |
| 2160 | + "arrayBuffer", | |
| 2161 | + "blob", | |
| 2162 | + "formData", | |
| 2163 | + "stream" | |
| 2164 | + ].forEach((type) => { | |
| 2165 | + !resolvers[type] && (resolvers[type] = (res, config) => { | |
| 2166 | + let method = res && res[type]; | |
| 2167 | + if (method) return method.call(res); | |
| 2168 | + throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config); | |
| 2169 | + }); | |
| 2170 | + }); | |
| 2171 | + })(); | |
| 2172 | + const getBodyLength = async (body) => { | |
| 2173 | + if (body == null) return 0; | |
| 2174 | + if (utils_default.isBlob(body)) return body.size; | |
| 2175 | + if (utils_default.isSpecCompliantForm(body)) return (await new Request(platform_default.origin, { | |
| 2176 | + method: "POST", | |
| 2177 | + body | |
| 2178 | + }).arrayBuffer()).byteLength; | |
| 2179 | + if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) return body.byteLength; | |
| 2180 | + if (utils_default.isURLSearchParams(body)) body = body + ""; | |
| 2181 | + if (utils_default.isString(body)) return (await encodeText(body)).byteLength; | |
| 2182 | + }; | |
| 2183 | + const resolveBodyLength = async (headers, body) => { | |
| 2184 | + const length = utils_default.toFiniteNumber(headers.getContentLength()); | |
| 2185 | + return length == null ? getBodyLength(body) : length; | |
| 2186 | + }; | |
| 2187 | + return async (config) => { | |
| 2188 | + let { url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, withCredentials = "same-origin", fetchOptions } = resolveConfig_default(config); | |
| 2189 | + let _fetch = envFetch || fetch; | |
| 2190 | + responseType = responseType ? (responseType + "").toLowerCase() : "text"; | |
| 2191 | + let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout); | |
| 2192 | + let request = null; | |
| 2193 | + const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { | |
| 2194 | + composedSignal.unsubscribe(); | |
| 2195 | + }); | |
| 2196 | + let requestContentLength; | |
| 2197 | + try { | |
| 2198 | + if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) { | |
| 2199 | + let _request = new Request(url, { | |
| 2200 | + method: "POST", | |
| 2201 | + body: data, | |
| 2202 | + duplex: "half" | |
| 2203 | + }); | |
| 2204 | + let contentTypeHeader; | |
| 2205 | + if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) headers.setContentType(contentTypeHeader); | |
| 2206 | + if (_request.body) { | |
| 2207 | + const [onProgress, flush] = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))); | |
| 2208 | + data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); | |
| 2209 | + } | |
| 2210 | + } | |
| 2211 | + if (!utils_default.isString(withCredentials)) withCredentials = withCredentials ? "include" : "omit"; | |
| 2212 | + const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; | |
| 2213 | + const resolvedOptions = { | |
| 2214 | + ...fetchOptions, | |
| 2215 | + signal: composedSignal, | |
| 2216 | + method: method.toUpperCase(), | |
| 2217 | + headers: headers.normalize().toJSON(), | |
| 2218 | + body: data, | |
| 2219 | + duplex: "half", | |
| 2220 | + credentials: isCredentialsSupported ? withCredentials : void 0 | |
| 2221 | + }; | |
| 2222 | + request = isRequestSupported && new Request(url, resolvedOptions); | |
| 2223 | + let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions)); | |
| 2224 | + const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); | |
| 2225 | + if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) { | |
| 2226 | + const options = {}; | |
| 2227 | + [ | |
| 2228 | + "status", | |
| 2229 | + "statusText", | |
| 2230 | + "headers" | |
| 2231 | + ].forEach((prop) => { | |
| 2232 | + options[prop] = response[prop]; | |
| 2233 | + }); | |
| 2234 | + const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length")); | |
| 2235 | + const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || []; | |
| 2236 | + response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { | |
| 2237 | + flush && flush(); | |
| 2238 | + unsubscribe && unsubscribe(); | |
| 2239 | + }), options); | |
| 2240 | + } | |
| 2241 | + responseType = responseType || "text"; | |
| 2242 | + let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config); | |
| 2243 | + !isStreamResponse && unsubscribe && unsubscribe(); | |
| 2244 | + return await new Promise((resolve, reject) => { | |
| 2245 | + settle(resolve, reject, { | |
| 2246 | + data: responseData, | |
| 2247 | + headers: AxiosHeaders$1.from(response.headers), | |
| 2248 | + status: response.status, | |
| 2249 | + statusText: response.statusText, | |
| 2250 | + config, | |
| 2251 | + request | |
| 2252 | + }); | |
| 2253 | + }); | |
| 2254 | + } catch (err) { | |
| 2255 | + unsubscribe && unsubscribe(); | |
| 2256 | + if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) throw Object.assign(new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request), { cause: err.cause || err }); | |
| 2257 | + throw AxiosError$1.from(err, err && err.code, config, request); | |
| 2258 | + } | |
| 2259 | + }; | |
| 2260 | + }; | |
| 2261 | + var seedCache = /* @__PURE__ */ new Map(); | |
| 2262 | + var getFetch = (config) => { | |
| 2263 | + let env = config && config.env || {}; | |
| 2264 | + const { fetch, Request, Response } = env; | |
| 2265 | + const seeds = [ | |
| 2266 | + Request, | |
| 2267 | + Response, | |
| 2268 | + fetch | |
| 2269 | + ]; | |
| 2270 | + let i = seeds.length; | |
| 2271 | + let seed; | |
| 2272 | + let target; | |
| 2273 | + let map = seedCache; | |
| 2274 | + while (i--) { | |
| 2275 | + seed = seeds[i]; | |
| 2276 | + target = map.get(seed); | |
| 2277 | + target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env)); | |
| 2278 | + map = target; | |
| 2279 | + } | |
| 2280 | + return target; | |
| 2281 | + }; | |
| 2282 | + var adapter = getFetch(); | |
| 2283 | + | |
| 2284 | +//#endregion | |
| 2285 | +//#region node_modules/axios/lib/adapters/adapters.js | |
| 2286 | +/** | |
| 2287 | + * Known adapters mapping. | |
| 2288 | + * Provides environment-specific adapters for Axios: | |
| 2289 | + * - `http` for Node.js | |
| 2290 | + * - `xhr` for browsers | |
| 2291 | + * - `fetch` for fetch API-based requests | |
| 2292 | + * | |
| 2293 | + * @type {Object<string, Function|Object>} | |
| 2294 | + */ | |
| 2295 | + var knownAdapters = { | |
| 2296 | + http: null, | |
| 2297 | + xhr: xhr_default, | |
| 2298 | + fetch: { get: getFetch } | |
| 2299 | + }; | |
| 2300 | + utils_default.forEach(knownAdapters, (fn, value) => { | |
| 2301 | + if (fn) { | |
| 2302 | + try { | |
| 2303 | + Object.defineProperty(fn, "name", { value }); | |
| 2304 | + } catch (e) {} | |
| 2305 | + Object.defineProperty(fn, "adapterName", { value }); | |
| 2306 | + } | |
| 2307 | + }); | |
| 2308 | + /** | |
| 2309 | + * Render a rejection reason string for unknown or unsupported adapters | |
| 2310 | + * | |
| 2311 | + * @param {string} reason | |
| 2312 | + * @returns {string} | |
| 2313 | + */ | |
| 2314 | + var renderReason = (reason) => `- ${reason}`; | |
| 2315 | + /** | |
| 2316 | + * Check if the adapter is resolved (function, null, or false) | |
| 2317 | + * | |
| 2318 | + * @param {Function|null|false} adapter | |
| 2319 | + * @returns {boolean} | |
| 2320 | + */ | |
| 2321 | + var isResolvedHandle = (adapter) => utils_default.isFunction(adapter) || adapter === null || adapter === false; | |
| 2322 | + /** | |
| 2323 | + * Get the first suitable adapter from the provided list. | |
| 2324 | + * Tries each adapter in order until a supported one is found. | |
| 2325 | + * Throws an AxiosError if no adapter is suitable. | |
| 2326 | + * | |
| 2327 | + * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function. | |
| 2328 | + * @param {Object} config - Axios request configuration | |
| 2329 | + * @throws {AxiosError} If no suitable adapter is available | |
| 2330 | + * @returns {Function} The resolved adapter function | |
| 2331 | + */ | |
| 2332 | + function getAdapter$1(adapters, config) { | |
| 2333 | + adapters = utils_default.isArray(adapters) ? adapters : [adapters]; | |
| 2334 | + const { length } = adapters; | |
| 2335 | + let nameOrAdapter; | |
| 2336 | + let adapter; | |
| 2337 | + const rejectedReasons = {}; | |
| 2338 | + for (let i = 0; i < length; i++) { | |
| 2339 | + nameOrAdapter = adapters[i]; | |
| 2340 | + let id; | |
| 2341 | + adapter = nameOrAdapter; | |
| 2342 | + if (!isResolvedHandle(nameOrAdapter)) { | |
| 2343 | + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; | |
| 2344 | + if (adapter === void 0) throw new AxiosError$1(`Unknown adapter '${id}'`); | |
| 2345 | + } | |
| 2346 | + if (adapter && (utils_default.isFunction(adapter) || (adapter = adapter.get(config)))) break; | |
| 2347 | + rejectedReasons[id || "#" + i] = adapter; | |
| 2348 | + } | |
| 2349 | + if (!adapter) { | |
| 2350 | + const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")); | |
| 2351 | + throw new AxiosError$1(`There is no suitable adapter to dispatch the request ` + (length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"), "ERR_NOT_SUPPORT"); | |
| 2352 | + } | |
| 2353 | + return adapter; | |
| 2354 | + } | |
| 2355 | + __name(getAdapter$1, "getAdapter"); | |
| 2356 | + /** | |
| 2357 | + * Exports Axios adapters and utility to resolve an adapter | |
| 2358 | + */ | |
| 2359 | + var adapters_default = { | |
| 2360 | + /** | |
| 2361 | + * Resolve an adapter from a list of adapter names or functions. | |
| 2362 | + * @type {Function} | |
| 2363 | + */ | |
| 2364 | + getAdapter: getAdapter$1, | |
| 2365 | + /** | |
| 2366 | + * Exposes all known adapters | |
| 2367 | + * @type {Object<string, Function|Object>} | |
| 2368 | + */ | |
| 2369 | + adapters: knownAdapters | |
| 2370 | + }; | |
| 2371 | + | |
| 2372 | +//#endregion | |
| 2373 | +//#region node_modules/axios/lib/core/dispatchRequest.js | |
| 2374 | +/** | |
| 2375 | + * Throws a `CanceledError` if cancellation has been requested. | |
| 2376 | + * | |
| 2377 | + * @param {Object} config The config that is to be used for the request | |
| 2378 | + * | |
| 2379 | + * @returns {void} | |
| 2380 | + */ | |
| 2381 | + function throwIfCancellationRequested(config) { | |
| 2382 | + if (config.cancelToken) config.cancelToken.throwIfRequested(); | |
| 2383 | + if (config.signal && config.signal.aborted) throw new CanceledError$1(null, config); | |
| 2384 | + } | |
| 2385 | + /** | |
| 2386 | + * Dispatch a request to the server using the configured adapter. | |
| 2387 | + * | |
| 2388 | + * @param {object} config The config that is to be used for the request | |
| 2389 | + * | |
| 2390 | + * @returns {Promise} The Promise to be fulfilled | |
| 2391 | + */ | |
| 2392 | + function dispatchRequest(config) { | |
| 2393 | + throwIfCancellationRequested(config); | |
| 2394 | + config.headers = AxiosHeaders$1.from(config.headers); | |
| 2395 | + config.data = transformData.call(config, config.transformRequest); | |
| 2396 | + if ([ | |
| 2397 | + "post", | |
| 2398 | + "put", | |
| 2399 | + "patch" | |
| 2400 | + ].indexOf(config.method) !== -1) config.headers.setContentType("application/x-www-form-urlencoded", false); | |
| 2401 | + return adapters_default.getAdapter(config.adapter || defaults.adapter, config)(config).then(function onAdapterResolution(response) { | |
| 2402 | + throwIfCancellationRequested(config); | |
| 2403 | + response.data = transformData.call(config, config.transformResponse, response); | |
| 2404 | + response.headers = AxiosHeaders$1.from(response.headers); | |
| 2405 | + return response; | |
| 2406 | + }, function onAdapterRejection(reason) { | |
| 2407 | + if (!isCancel$1(reason)) { | |
| 2408 | + throwIfCancellationRequested(config); | |
| 2409 | + if (reason && reason.response) { | |
| 2410 | + reason.response.data = transformData.call(config, config.transformResponse, reason.response); | |
| 2411 | + reason.response.headers = AxiosHeaders$1.from(reason.response.headers); | |
| 2412 | + } | |
| 2413 | + } | |
| 2414 | + return Promise.reject(reason); | |
| 2415 | + }); | |
| 2416 | + } | |
| 2417 | + | |
| 2418 | +//#endregion | |
| 2419 | +//#region node_modules/axios/lib/env/data.js | |
| 2420 | + var VERSION$1 = "1.13.2"; | |
| 2421 | + | |
| 2422 | +//#endregion | |
| 2423 | +//#region node_modules/axios/lib/helpers/validator.js | |
| 2424 | + var validators$1 = {}; | |
| 2425 | + [ | |
| 2426 | + "object", | |
| 2427 | + "boolean", | |
| 2428 | + "number", | |
| 2429 | + "function", | |
| 2430 | + "string", | |
| 2431 | + "symbol" | |
| 2432 | + ].forEach((type, i) => { | |
| 2433 | + validators$1[type] = function validator(thing) { | |
| 2434 | + return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type; | |
| 2435 | + }; | |
| 2436 | + }); | |
| 2437 | + var deprecatedWarnings = {}; | |
| 2438 | + /** | |
| 2439 | + * Transitional option validator | |
| 2440 | + * | |
| 2441 | + * @param {function|boolean?} validator - set to false if the transitional option has been removed | |
| 2442 | + * @param {string?} version - deprecated version / removed since version | |
| 2443 | + * @param {string?} message - some message with additional info | |
| 2444 | + * | |
| 2445 | + * @returns {function} | |
| 2446 | + */ | |
| 2447 | + validators$1.transitional = function transitional(validator, version, message) { | |
| 2448 | + function formatMessage(opt, desc) { | |
| 2449 | + return "[Axios v" + VERSION$1 + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : ""); | |
| 2450 | + } | |
| 2451 | + return (value, opt, opts) => { | |
| 2452 | + if (validator === false) throw new AxiosError$1(formatMessage(opt, " has been removed" + (version ? " in " + version : "")), AxiosError$1.ERR_DEPRECATED); | |
| 2453 | + if (version && !deprecatedWarnings[opt]) { | |
| 2454 | + deprecatedWarnings[opt] = true; | |
| 2455 | + console.warn(formatMessage(opt, " has been deprecated since v" + version + " and will be removed in the near future")); | |
| 2456 | + } | |
| 2457 | + return validator ? validator(value, opt, opts) : true; | |
| 2458 | + }; | |
| 2459 | + }; | |
| 2460 | + validators$1.spelling = function spelling(correctSpelling) { | |
| 2461 | + return (value, opt) => { | |
| 2462 | + console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); | |
| 2463 | + return true; | |
| 2464 | + }; | |
| 2465 | + }; | |
| 2466 | + /** | |
| 2467 | + * Assert object's properties type | |
| 2468 | + * | |
| 2469 | + * @param {object} options | |
| 2470 | + * @param {object} schema | |
| 2471 | + * @param {boolean?} allowUnknown | |
| 2472 | + * | |
| 2473 | + * @returns {object} | |
| 2474 | + */ | |
| 2475 | + function assertOptions(options, schema, allowUnknown) { | |
| 2476 | + if (typeof options !== "object") throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE); | |
| 2477 | + const keys = Object.keys(options); | |
| 2478 | + let i = keys.length; | |
| 2479 | + while (i-- > 0) { | |
| 2480 | + const opt = keys[i]; | |
| 2481 | + const validator = schema[opt]; | |
| 2482 | + if (validator) { | |
| 2483 | + const value = options[opt]; | |
| 2484 | + const result = value === void 0 || validator(value, opt, options); | |
| 2485 | + if (result !== true) throw new AxiosError$1("option " + opt + " must be " + result, AxiosError$1.ERR_BAD_OPTION_VALUE); | |
| 2486 | + continue; | |
| 2487 | + } | |
| 2488 | + if (allowUnknown !== true) throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION); | |
| 2489 | + } | |
| 2490 | + } | |
| 2491 | + var validator_default = { | |
| 2492 | + assertOptions, | |
| 2493 | + validators: validators$1 | |
| 2494 | + }; | |
| 2495 | + | |
| 2496 | +//#endregion | |
| 2497 | +//#region node_modules/axios/lib/core/Axios.js | |
| 2498 | + var validators = validator_default.validators; | |
| 2499 | + /** | |
| 2500 | + * Create a new instance of Axios | |
| 2501 | + * | |
| 2502 | + * @param {Object} instanceConfig The default config for the instance | |
| 2503 | + * | |
| 2504 | + * @return {Axios} A new instance of Axios | |
| 2505 | + */ | |
| 2506 | + var Axios$1 = class { | |
| 2507 | + static { | |
| 2508 | + __name(this, "Axios"); | |
| 2509 | + } | |
| 2510 | + constructor(instanceConfig) { | |
| 2511 | + this.defaults = instanceConfig || {}; | |
| 2512 | + this.interceptors = { | |
| 2513 | + request: new InterceptorManager(), | |
| 2514 | + response: new InterceptorManager() | |
| 2515 | + }; | |
| 2516 | + } | |
| 2517 | + /** | |
| 2518 | + * Dispatch a request | |
| 2519 | + * | |
| 2520 | + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) | |
| 2521 | + * @param {?Object} config | |
| 2522 | + * | |
| 2523 | + * @returns {Promise} The Promise to be fulfilled | |
| 2524 | + */ | |
| 2525 | + async request(configOrUrl, config) { | |
| 2526 | + try { | |
| 2527 | + return await this._request(configOrUrl, config); | |
| 2528 | + } catch (err) { | |
| 2529 | + if (err instanceof Error) { | |
| 2530 | + let dummy = {}; | |
| 2531 | + Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = /* @__PURE__ */ new Error(); | |
| 2532 | + const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; | |
| 2533 | + try { | |
| 2534 | + if (!err.stack) err.stack = stack; | |
| 2535 | + else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) err.stack += "\n" + stack; | |
| 2536 | + } catch (e) {} | |
| 2537 | + } | |
| 2538 | + throw err; | |
| 2539 | + } | |
| 2540 | + } | |
| 2541 | + _request(configOrUrl, config) { | |
| 2542 | + if (typeof configOrUrl === "string") { | |
| 2543 | + config = config || {}; | |
| 2544 | + config.url = configOrUrl; | |
| 2545 | + } else config = configOrUrl || {}; | |
| 2546 | + config = mergeConfig$1(this.defaults, config); | |
| 2547 | + const { transitional, paramsSerializer, headers } = config; | |
| 2548 | + if (transitional !== void 0) validator_default.assertOptions(transitional, { | |
| 2549 | + silentJSONParsing: validators.transitional(validators.boolean), | |
| 2550 | + forcedJSONParsing: validators.transitional(validators.boolean), | |
| 2551 | + clarifyTimeoutError: validators.transitional(validators.boolean) | |
| 2552 | + }, false); | |
| 2553 | + if (paramsSerializer != null) if (utils_default.isFunction(paramsSerializer)) config.paramsSerializer = { serialize: paramsSerializer }; | |
| 2554 | + else validator_default.assertOptions(paramsSerializer, { | |
| 2555 | + encode: validators.function, | |
| 2556 | + serialize: validators.function | |
| 2557 | + }, true); | |
| 2558 | + if (config.allowAbsoluteUrls !== void 0) {} else if (this.defaults.allowAbsoluteUrls !== void 0) config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; | |
| 2559 | + else config.allowAbsoluteUrls = true; | |
| 2560 | + validator_default.assertOptions(config, { | |
| 2561 | + baseUrl: validators.spelling("baseURL"), | |
| 2562 | + withXsrfToken: validators.spelling("withXSRFToken") | |
| 2563 | + }, true); | |
| 2564 | + config.method = (config.method || this.defaults.method || "get").toLowerCase(); | |
| 2565 | + let contextHeaders = headers && utils_default.merge(headers.common, headers[config.method]); | |
| 2566 | + headers && utils_default.forEach([ | |
| 2567 | + "delete", | |
| 2568 | + "get", | |
| 2569 | + "head", | |
| 2570 | + "post", | |
| 2571 | + "put", | |
| 2572 | + "patch", | |
| 2573 | + "common" | |
| 2574 | + ], (method) => { | |
| 2575 | + delete headers[method]; | |
| 2576 | + }); | |
| 2577 | + config.headers = AxiosHeaders$1.concat(contextHeaders, headers); | |
| 2578 | + const requestInterceptorChain = []; | |
| 2579 | + let synchronousRequestInterceptors = true; | |
| 2580 | + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { | |
| 2581 | + if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) return; | |
| 2582 | + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; | |
| 2583 | + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); | |
| 2584 | + }); | |
| 2585 | + const responseInterceptorChain = []; | |
| 2586 | + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { | |
| 2587 | + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); | |
| 2588 | + }); | |
| 2589 | + let promise; | |
| 2590 | + let i = 0; | |
| 2591 | + let len; | |
| 2592 | + if (!synchronousRequestInterceptors) { | |
| 2593 | + const chain = [dispatchRequest.bind(this), void 0]; | |
| 2594 | + chain.unshift(...requestInterceptorChain); | |
| 2595 | + chain.push(...responseInterceptorChain); | |
| 2596 | + len = chain.length; | |
| 2597 | + promise = Promise.resolve(config); | |
| 2598 | + while (i < len) promise = promise.then(chain[i++], chain[i++]); | |
| 2599 | + return promise; | |
| 2600 | + } | |
| 2601 | + len = requestInterceptorChain.length; | |
| 2602 | + let newConfig = config; | |
| 2603 | + while (i < len) { | |
| 2604 | + const onFulfilled = requestInterceptorChain[i++]; | |
| 2605 | + const onRejected = requestInterceptorChain[i++]; | |
| 2606 | + try { | |
| 2607 | + newConfig = onFulfilled(newConfig); | |
| 2608 | + } catch (error) { | |
| 2609 | + onRejected.call(this, error); | |
| 2610 | + break; | |
| 2611 | + } | |
| 2612 | + } | |
| 2613 | + try { | |
| 2614 | + promise = dispatchRequest.call(this, newConfig); | |
| 2615 | + } catch (error) { | |
| 2616 | + return Promise.reject(error); | |
| 2617 | + } | |
| 2618 | + i = 0; | |
| 2619 | + len = responseInterceptorChain.length; | |
| 2620 | + while (i < len) promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); | |
| 2621 | + return promise; | |
| 2622 | + } | |
| 2623 | + getUri(config) { | |
| 2624 | + config = mergeConfig$1(this.defaults, config); | |
| 2625 | + return buildURL(buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls), config.params, config.paramsSerializer); | |
| 2626 | + } | |
| 2627 | + }; | |
| 2628 | + utils_default.forEach([ | |
| 2629 | + "delete", | |
| 2630 | + "get", | |
| 2631 | + "head", | |
| 2632 | + "options" | |
| 2633 | + ], function forEachMethodNoData(method) { | |
| 2634 | + Axios$1.prototype[method] = function(url, config) { | |
| 2635 | + return this.request(mergeConfig$1(config || {}, { | |
| 2636 | + method, | |
| 2637 | + url, | |
| 2638 | + data: (config || {}).data | |
| 2639 | + })); | |
| 2640 | + }; | |
| 2641 | + }); | |
| 2642 | + utils_default.forEach([ | |
| 2643 | + "post", | |
| 2644 | + "put", | |
| 2645 | + "patch" | |
| 2646 | + ], function forEachMethodWithData(method) { | |
| 2647 | + function generateHTTPMethod(isForm) { | |
| 2648 | + return function httpMethod(url, data, config) { | |
| 2649 | + return this.request(mergeConfig$1(config || {}, { | |
| 2650 | + method, | |
| 2651 | + headers: isForm ? { "Content-Type": "multipart/form-data" } : {}, | |
| 2652 | + url, | |
| 2653 | + data | |
| 2654 | + })); | |
| 2655 | + }; | |
| 2656 | + } | |
| 2657 | + Axios$1.prototype[method] = generateHTTPMethod(); | |
| 2658 | + Axios$1.prototype[method + "Form"] = generateHTTPMethod(true); | |
| 2659 | + }); | |
| 2660 | + | |
| 2661 | +//#endregion | |
| 2662 | +//#region node_modules/axios/lib/cancel/CancelToken.js | |
| 2663 | +/** | |
| 2664 | + * A `CancelToken` is an object that can be used to request cancellation of an operation. | |
| 2665 | + * | |
| 2666 | + * @param {Function} executor The executor function. | |
| 2667 | + * | |
| 2668 | + * @returns {CancelToken} | |
| 2669 | + */ | |
| 2670 | + var CancelToken$1 = class CancelToken$1 { | |
| 2671 | + static { | |
| 2672 | + __name(this, "CancelToken"); | |
| 2673 | + } | |
| 2674 | + constructor(executor) { | |
| 2675 | + if (typeof executor !== "function") throw new TypeError("executor must be a function."); | |
| 2676 | + let resolvePromise; | |
| 2677 | + this.promise = new Promise(function promiseExecutor(resolve) { | |
| 2678 | + resolvePromise = resolve; | |
| 2679 | + }); | |
| 2680 | + const token = this; | |
| 2681 | + this.promise.then((cancel) => { | |
| 2682 | + if (!token._listeners) return; | |
| 2683 | + let i = token._listeners.length; | |
| 2684 | + while (i-- > 0) token._listeners[i](cancel); | |
| 2685 | + token._listeners = null; | |
| 2686 | + }); | |
| 2687 | + this.promise.then = (onfulfilled) => { | |
| 2688 | + let _resolve; | |
| 2689 | + const promise = new Promise((resolve) => { | |
| 2690 | + token.subscribe(resolve); | |
| 2691 | + _resolve = resolve; | |
| 2692 | + }).then(onfulfilled); | |
| 2693 | + promise.cancel = function reject() { | |
| 2694 | + token.unsubscribe(_resolve); | |
| 2695 | + }; | |
| 2696 | + return promise; | |
| 2697 | + }; | |
| 2698 | + executor(function cancel(message, config, request) { | |
| 2699 | + if (token.reason) return; | |
| 2700 | + token.reason = new CanceledError$1(message, config, request); | |
| 2701 | + resolvePromise(token.reason); | |
| 2702 | + }); | |
| 2703 | + } | |
| 2704 | + /** | |
| 2705 | + * Throws a `CanceledError` if cancellation has been requested. | |
| 2706 | + */ | |
| 2707 | + throwIfRequested() { | |
| 2708 | + if (this.reason) throw this.reason; | |
| 2709 | + } | |
| 2710 | + /** | |
| 2711 | + * Subscribe to the cancel signal | |
| 2712 | + */ | |
| 2713 | + subscribe(listener) { | |
| 2714 | + if (this.reason) { | |
| 2715 | + listener(this.reason); | |
| 2716 | + return; | |
| 2717 | + } | |
| 2718 | + if (this._listeners) this._listeners.push(listener); | |
| 2719 | + else this._listeners = [listener]; | |
| 2720 | + } | |
| 2721 | + /** | |
| 2722 | + * Unsubscribe from the cancel signal | |
| 2723 | + */ | |
| 2724 | + unsubscribe(listener) { | |
| 2725 | + if (!this._listeners) return; | |
| 2726 | + const index = this._listeners.indexOf(listener); | |
| 2727 | + if (index !== -1) this._listeners.splice(index, 1); | |
| 2728 | + } | |
| 2729 | + toAbortSignal() { | |
| 2730 | + const controller = new AbortController(); | |
| 2731 | + const abort = (err) => { | |
| 2732 | + controller.abort(err); | |
| 2733 | + }; | |
| 2734 | + this.subscribe(abort); | |
| 2735 | + controller.signal.unsubscribe = () => this.unsubscribe(abort); | |
| 2736 | + return controller.signal; | |
| 2737 | + } | |
| 2738 | + /** | |
| 2739 | + * Returns an object that contains a new `CancelToken` and a function that, when called, | |
| 2740 | + * cancels the `CancelToken`. | |
| 2741 | + */ | |
| 2742 | + static source() { | |
| 2743 | + let cancel; | |
| 2744 | + return { | |
| 2745 | + token: new CancelToken$1(function executor(c) { | |
| 2746 | + cancel = c; | |
| 2747 | + }), | |
| 2748 | + cancel | |
| 2749 | + }; | |
| 2750 | + } | |
| 2751 | + }; | |
| 2752 | + | |
| 2753 | +//#endregion | |
| 2754 | +//#region node_modules/axios/lib/helpers/spread.js | |
| 2755 | +/** | |
| 2756 | + * Syntactic sugar for invoking a function and expanding an array for arguments. | |
| 2757 | + * | |
| 2758 | + * Common use case would be to use `Function.prototype.apply`. | |
| 2759 | + * | |
| 2760 | + * ```js | |
| 2761 | + * function f(x, y, z) {} | |
| 2762 | + * var args = [1, 2, 3]; | |
| 2763 | + * f.apply(null, args); | |
| 2764 | + * ``` | |
| 2765 | + * | |
| 2766 | + * With `spread` this example can be re-written. | |
| 2767 | + * | |
| 2768 | + * ```js | |
| 2769 | + * spread(function(x, y, z) {})([1, 2, 3]); | |
| 2770 | + * ``` | |
| 2771 | + * | |
| 2772 | + * @param {Function} callback | |
| 2773 | + * | |
| 2774 | + * @returns {Function} | |
| 2775 | + */ | |
| 2776 | + function spread$1(callback) { | |
| 2777 | + return function wrap(arr) { | |
| 2778 | + return callback.apply(null, arr); | |
| 2779 | + }; | |
| 2780 | + } | |
| 2781 | + __name(spread$1, "spread"); | |
| 2782 | + | |
| 2783 | +//#endregion | |
| 2784 | +//#region node_modules/axios/lib/helpers/isAxiosError.js | |
| 2785 | +/** | |
| 2786 | + * Determines whether the payload is an error thrown by Axios | |
| 2787 | + * | |
| 2788 | + * @param {*} payload The value to test | |
| 2789 | + * | |
| 2790 | + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false | |
| 2791 | + */ | |
| 2792 | + function isAxiosError$1(payload) { | |
| 2793 | + return utils_default.isObject(payload) && payload.isAxiosError === true; | |
| 2794 | + } | |
| 2795 | + __name(isAxiosError$1, "isAxiosError"); | |
| 2796 | + | |
| 2797 | +//#endregion | |
| 2798 | +//#region node_modules/axios/lib/helpers/HttpStatusCode.js | |
| 2799 | + var HttpStatusCode$1 = { | |
| 2800 | + Continue: 100, | |
| 2801 | + SwitchingProtocols: 101, | |
| 2802 | + Processing: 102, | |
| 2803 | + EarlyHints: 103, | |
| 2804 | + Ok: 200, | |
| 2805 | + Created: 201, | |
| 2806 | + Accepted: 202, | |
| 2807 | + NonAuthoritativeInformation: 203, | |
| 2808 | + NoContent: 204, | |
| 2809 | + ResetContent: 205, | |
| 2810 | + PartialContent: 206, | |
| 2811 | + MultiStatus: 207, | |
| 2812 | + AlreadyReported: 208, | |
| 2813 | + ImUsed: 226, | |
| 2814 | + MultipleChoices: 300, | |
| 2815 | + MovedPermanently: 301, | |
| 2816 | + Found: 302, | |
| 2817 | + SeeOther: 303, | |
| 2818 | + NotModified: 304, | |
| 2819 | + UseProxy: 305, | |
| 2820 | + Unused: 306, | |
| 2821 | + TemporaryRedirect: 307, | |
| 2822 | + PermanentRedirect: 308, | |
| 2823 | + BadRequest: 400, | |
| 2824 | + Unauthorized: 401, | |
| 2825 | + PaymentRequired: 402, | |
| 2826 | + Forbidden: 403, | |
| 2827 | + NotFound: 404, | |
| 2828 | + MethodNotAllowed: 405, | |
| 2829 | + NotAcceptable: 406, | |
| 2830 | + ProxyAuthenticationRequired: 407, | |
| 2831 | + RequestTimeout: 408, | |
| 2832 | + Conflict: 409, | |
| 2833 | + Gone: 410, | |
| 2834 | + LengthRequired: 411, | |
| 2835 | + PreconditionFailed: 412, | |
| 2836 | + PayloadTooLarge: 413, | |
| 2837 | + UriTooLong: 414, | |
| 2838 | + UnsupportedMediaType: 415, | |
| 2839 | + RangeNotSatisfiable: 416, | |
| 2840 | + ExpectationFailed: 417, | |
| 2841 | + ImATeapot: 418, | |
| 2842 | + MisdirectedRequest: 421, | |
| 2843 | + UnprocessableEntity: 422, | |
| 2844 | + Locked: 423, | |
| 2845 | + FailedDependency: 424, | |
| 2846 | + TooEarly: 425, | |
| 2847 | + UpgradeRequired: 426, | |
| 2848 | + PreconditionRequired: 428, | |
| 2849 | + TooManyRequests: 429, | |
| 2850 | + RequestHeaderFieldsTooLarge: 431, | |
| 2851 | + UnavailableForLegalReasons: 451, | |
| 2852 | + InternalServerError: 500, | |
| 2853 | + NotImplemented: 501, | |
| 2854 | + BadGateway: 502, | |
| 2855 | + ServiceUnavailable: 503, | |
| 2856 | + GatewayTimeout: 504, | |
| 2857 | + HttpVersionNotSupported: 505, | |
| 2858 | + VariantAlsoNegotiates: 506, | |
| 2859 | + InsufficientStorage: 507, | |
| 2860 | + LoopDetected: 508, | |
| 2861 | + NotExtended: 510, | |
| 2862 | + NetworkAuthenticationRequired: 511, | |
| 2863 | + WebServerIsDown: 521, | |
| 2864 | + ConnectionTimedOut: 522, | |
| 2865 | + OriginIsUnreachable: 523, | |
| 2866 | + TimeoutOccurred: 524, | |
| 2867 | + SslHandshakeFailed: 525, | |
| 2868 | + InvalidSslCertificate: 526 | |
| 2869 | + }; | |
| 2870 | + Object.entries(HttpStatusCode$1).forEach(([key, value]) => { | |
| 2871 | + HttpStatusCode$1[value] = key; | |
| 2872 | + }); | |
| 2873 | + | |
| 2874 | +//#endregion | |
| 2875 | +//#region node_modules/axios/lib/axios.js | |
| 2876 | +/** | |
| 2877 | + * Create an instance of Axios | |
| 2878 | + * | |
| 2879 | + * @param {Object} defaultConfig The default config for the instance | |
| 2880 | + * | |
| 2881 | + * @returns {Axios} A new instance of Axios | |
| 2882 | + */ | |
| 2883 | + function createInstance(defaultConfig) { | |
| 2884 | + const context = new Axios$1(defaultConfig); | |
| 2885 | + const instance = bind(Axios$1.prototype.request, context); | |
| 2886 | + utils_default.extend(instance, Axios$1.prototype, context, { allOwnKeys: true }); | |
| 2887 | + utils_default.extend(instance, context, null, { allOwnKeys: true }); | |
| 2888 | + instance.create = function create(instanceConfig) { | |
| 2889 | + return createInstance(mergeConfig$1(defaultConfig, instanceConfig)); | |
| 2890 | + }; | |
| 2891 | + return instance; | |
| 2892 | + } | |
| 2893 | + var axios = createInstance(defaults); | |
| 2894 | + axios.Axios = Axios$1; | |
| 2895 | + axios.CanceledError = CanceledError$1; | |
| 2896 | + axios.CancelToken = CancelToken$1; | |
| 2897 | + axios.isCancel = isCancel$1; | |
| 2898 | + axios.VERSION = VERSION$1; | |
| 2899 | + axios.toFormData = toFormData$1; | |
| 2900 | + axios.AxiosError = AxiosError$1; | |
| 2901 | + axios.Cancel = axios.CanceledError; | |
| 2902 | + axios.all = function all(promises) { | |
| 2903 | + return Promise.all(promises); | |
| 2904 | + }; | |
| 2905 | + axios.spread = spread$1; | |
| 2906 | + axios.isAxiosError = isAxiosError$1; | |
| 2907 | + axios.mergeConfig = mergeConfig$1; | |
| 2908 | + axios.AxiosHeaders = AxiosHeaders$1; | |
| 2909 | + axios.formToJSON = (thing) => formDataToJSON(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing); | |
| 2910 | + axios.getAdapter = adapters_default.getAdapter; | |
| 2911 | + axios.HttpStatusCode = HttpStatusCode$1; | |
| 2912 | + axios.default = axios; | |
| 2913 | + | |
| 2914 | +//#endregion | |
| 2915 | +//#region node_modules/axios/index.js | |
| 2916 | + var { Axios, AxiosError, CanceledError, isCancel, CancelToken, VERSION, all, Cancel, isAxiosError, spread, toFormData, AxiosHeaders, HttpStatusCode, formToJSON, getAdapter, mergeConfig } = axios; | |
| 2917 | + | |
| 2918 | +//#endregion | |
| 2919 | +//#region packages/packages/libs/http-client/src/env.ts | |
| 2920 | + var { env } = (0, _elementor_env.parseEnv)("@elementor/http-client"); | |
| 2921 | + | |
| 2922 | +//#endregion | |
| 2923 | +//#region packages/packages/libs/http-client/src/http.ts | |
| 2924 | + var MAX_RETRIES = 3; | |
| 2925 | + var BASE_DELAY_MS = 1e3; | |
| 2926 | + var CACHE_TTL_MS = 2e4; | |
| 2927 | + var cache = /* @__PURE__ */ new Map(); | |
| 2928 | + var cacheableUrls = /* @__PURE__ */ new Map(); | |
| 2929 | + function registerUrlForCache(partialUrl, ttlMs = CACHE_TTL_MS) { | |
| 2930 | + cacheableUrls.set(partialUrl, ttlMs); | |
| 2931 | + } | |
| 2932 | + function getUrlCacheTtl(url) { | |
| 2933 | + for (const [pattern, ttl] of cacheableUrls) if (url.includes(pattern)) return ttl; | |
| 2934 | + return null; | |
| 2935 | + } | |
| 2936 | + function getCacheKey(config) { | |
| 2937 | + const url = config.url ?? ""; | |
| 2938 | + const params = config.params ? JSON.stringify(config.params) : ""; | |
| 2939 | + return `${config.baseURL ?? ""}${url}${params}`; | |
| 2940 | + } | |
| 2941 | + function getCachedResponse(config) { | |
| 2942 | + if (config.method?.toLowerCase() !== "get") return null; | |
| 2943 | + const ttl = getUrlCacheTtl(`${config.baseURL ?? ""}${config.url ?? ""}`); | |
| 2944 | + if (ttl === null) return null; | |
| 2945 | + const key = getCacheKey(config); | |
| 2946 | + const entry = cache.get(key); | |
| 2947 | + if (!entry) return null; | |
| 2948 | + if (Date.now() - entry.timestamp > ttl) { | |
| 2949 | + cache.delete(key); | |
| 2950 | + return null; | |
| 2951 | + } | |
| 2952 | + return entry.response; | |
| 2953 | + } | |
| 2954 | + function setCachedResponse(config, response) { | |
| 2955 | + if (!config || config.method?.toLowerCase() !== "get") return; | |
| 2956 | + if (getUrlCacheTtl(`${config.baseURL ?? ""}${config.url ?? ""}`) === null) return; | |
| 2957 | + const key = getCacheKey(config); | |
| 2958 | + cache.set(key, { | |
| 2959 | + response, | |
| 2960 | + timestamp: Date.now() | |
| 2961 | + }); | |
| 2962 | + } | |
| 2963 | + var RETRYABLE_METHODS = /* @__PURE__ */ new Set([ | |
| 2964 | + "get", | |
| 2965 | + "head", | |
| 2966 | + "options", | |
| 2967 | + "put", | |
| 2968 | + "delete" | |
| 2969 | + ]); | |
| 2970 | + var instance; | |
| 2971 | + var httpService = () => { | |
| 2972 | + if (!instance) { | |
| 2973 | + instance = axios.create({ | |
| 2974 | + baseURL: env.base_url, | |
| 2975 | + timeout: 1e4, | |
| 2976 | + headers: { | |
| 2977 | + "Content-Type": "application/json", | |
| 2978 | + ...env.headers | |
| 2979 | + } | |
| 2980 | + }); | |
| 2981 | + instance.interceptors.request.use((config) => { | |
| 2982 | + const cachedResponse = getCachedResponse(config); | |
| 2983 | + if (cachedResponse) { | |
| 2984 | + const controller = new AbortController(); | |
| 2985 | + controller.abort(); | |
| 2986 | + return { | |
| 2987 | + ...config, | |
| 2988 | + signal: controller.signal, | |
| 2989 | + __cachedResponse: cachedResponse | |
| 2990 | + }; | |
| 2991 | + } | |
| 2992 | + return config; | |
| 2993 | + }); | |
| 2994 | + instance.interceptors.response.use((response) => { | |
| 2995 | + setCachedResponse(response.config, response); | |
| 2996 | + return response; | |
| 2997 | + }, async (error) => { | |
| 2998 | + const config = error.config; | |
| 2999 | + if (config?.__cachedResponse) return config.__cachedResponse; | |
| 3000 | + if (!config || !shouldRetry(error)) return Promise.reject(error); | |
| 3001 | + const retryCount = config.__retryCount ?? 0; | |
| 3002 | + if (retryCount >= MAX_RETRIES) return Promise.reject(error); | |
| 3003 | + await sleep(BASE_DELAY_MS * Math.pow(2, retryCount) + Math.random() * BASE_DELAY_MS * .1); | |
| 3004 | + const baseTimeout = config.__baseTimeout ?? config.timeout ?? 1e4; | |
| 3005 | + return instance({ | |
| 3006 | + ...config, | |
| 3007 | + __retryCount: retryCount + 1, | |
| 3008 | + __baseTimeout: baseTimeout, | |
| 3009 | + timeout: baseTimeout * (retryCount + 2) | |
| 3010 | + }); | |
| 3011 | + }); | |
| 3012 | + } | |
| 3013 | + return instance; | |
| 3014 | + }; | |
| 3015 | + function shouldRetry(error) { | |
| 3016 | + const method = error.config?.method?.toLowerCase(); | |
| 3017 | + if (method && !RETRYABLE_METHODS.has(method)) return false; | |
| 3018 | + if (!error.response) return true; | |
| 3019 | + if (error.response.status === 429) return true; | |
| 3020 | + return error.response.status >= 500; | |
| 3021 | + } | |
| 3022 | + function sleep(ms) { | |
| 3023 | + return new Promise((resolve) => setTimeout(resolve, ms)); | |
| 3024 | + } | |
| 3025 | + | |
| 3026 | +//#endregion | |
| 3027 | +//#region packages/packages/libs/http-client/src/index.ts | |
| 3028 | + var src_exports = /* @__PURE__ */ __exportAll({ | |
| 3029 | + AxiosError: () => AxiosError, | |
| 3030 | + httpService: () => httpService, | |
| 3031 | + registerUrlForCache: () => registerUrlForCache | |
| 3032 | + }); | |
| 3033 | + | |
| 3034 | +//#endregion | |
| 3035 | +//#region \0elementor-package-library-entry | |
| 3036 | + (window.elementorV2 = window.elementorV2 || {}).httpClient = src_exports; | |
| 3037 | + | |
| 3038 | +//#endregion | |
| 3039 | +})(elementorV2.env); | |
| 3040 | +window.elementorV2.httpClient?.init?.(); | |
| 3 | 3041 | //# sourceMappingURL=http-client.js.map |