axios
Version:
Promise based HTTP client for the browser and node.js
4 lines • 51.4 kB
JavaScript
/*! Axios v1.20.0 Copyright (c) 2026 Matt Zabriskie and contributors */
function e(e,t){return function(){return e.apply(t,arguments)}}const{toString:t}=Object.prototype,{getPrototypeOf:n}=Object,{iterator:r,toStringTag:o}=Symbol,s=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),i=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),a=(e,t,n)=>e===Object.prototype||!n&&null===t,c=(e,t)=>{let r=e;const o=[];for(;null!=r;){if(-1!==o.indexOf(r))return!1;o.push(r);const i=n(r);if(a(r,i,r===e))return!1;if(s(r,t))return!0;r=i}return!1},l=(u=Object.create(null),e=>{const n=t.call(e);return u[n]||(u[n]=n.slice(8,-1).toLowerCase())});var u;const f=e=>(e=e.toLowerCase(),t=>l(t)===e),d=e=>t=>typeof t===e,{isArray:h}=Array,p=d("undefined");function g(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const m=f("ArrayBuffer");const b=d("string"),y=d("function"),w=d("number"),O=e=>null!==e&&"object"==typeof e,E=e=>{if(!O(e))return!1;const t=n(e);return!(null!==t&&t!==Object.prototype&&null!==n(t)||c(e,o)||c(e,r))},R=f("Date"),S=f("File"),_=f("Blob"),A=f("FileList"),v=f("Set");const P="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},T=void 0!==P.FormData?P.FormData:void 0,C=f("URLSearchParams"),[j,x,N,U]=["ReadableStream","Request","Response","Headers"].map(f);function D(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),h(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(g(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function L(e,t){if(g(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,B=e=>!p(e)&&e!==F;const k=(q="undefined"!=typeof Uint8Array&&n(Uint8Array),e=>q&&e instanceof q);var q;const I=f("HTMLFormElement"),{propertyIsEnumerable:M}=Object.prototype,z=f("RegExp"),H=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};D(n,(n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)}),Object.defineProperties(e,r)};const $=f("AsyncFunction"),W=(J="function"==typeof setImmediate,V=y(F.postMessage),J?setImmediate:V?(K=`axios@${Math.random()}`,X=[],F.addEventListener("message",({source:e,data:t})=>{e===F&&t===K&&X.length&&X.shift()()},!1),e=>{X.push(e),F.postMessage(K,"*")}):e=>setTimeout(e));var J,V,K,X;const G="undefined"!=typeof queueMicrotask?queueMicrotask.bind(F):"undefined"!=typeof process&&process.nextTick||W,Q=e=>null!=e&&y(e[r]);var Z={isArray:h,isArrayBuffer:m,isBuffer:g,isFormData:e=>{if(!e)return!1;if(T&&e instanceof T)return!0;const t=n(e);if(!t||t===Object.prototype)return!1;if(!y(e.append))return!1;const r=l(e);return"formdata"===r||"object"===r&&y(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer),t},isString:b,isNumber:w,isBoolean:e=>!0===e||!1===e,isObject:O,isPlainObject:E,isEmptyObject:e=>{if(!O(e)||g(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:j,isRequest:x,isResponse:N,isHeaders:U,isUndefined:p,isDate:R,isFile:S,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:_,isRegExp:z,isFunction:y,isStream:e=>O(e)&&y(e.pipe),isURLSearchParams:C,isTypedArray:k,isFileList:A,forEach:D,merge:function e(...t){const{caseless:n,skipUndefined:r}=B(this)&&this||{},o={},i=(t,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;const a=n&&"string"==typeof i&&L(o,i)||i,c=s(o,a)?o[a]:void 0;E(c)&&E(t)?o[a]=e(c,t):E(t)?o[a]=e({},t):h(t)?o[a]=t.slice():r&&p(t)||(o[a]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||g(n))continue;if(D(n,i),"object"!=typeof n||h(n))continue;const r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){const t=r[e];M.call(n,t)&&i(n[t],t)}}return o},extend:(t,n,r,{allOwnKeys:o}={})=>(D(n,(n,o)=>{r&&y(n)?Object.defineProperty(t,o,{__proto__:null,value:e(n,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,o,{__proto__:null,value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),t),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,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,r,o)=>{let s,i,a;const c={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],o&&!o(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==r&&n(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:l,kindOfTest:f,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(h(e))return e;let t=e.length;if(!w(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[r]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:I,hasOwnProperty:s,hasOwnProp:s,hasOwnInPrototypeChain:c,getSafeProp:(e,t)=>null!=e&&c(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;const t=n(e);if(null===t&&(e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(t=>{if(i(t))return!1;const n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable})})(e))return e;const r=Object.create(null),o=Object.create(null),c=[];let l=e;for(;null!=l&&-1===c.indexOf(l);){c.push(l);const u=l===e?t:n(l);if(a(l,u,l===e))break;const f=Object.getOwnPropertyNames(l);Object.getOwnPropertySymbols&&f.push(...Object.getOwnPropertySymbols(l));for(const t of f)i(t)||s(o,t)||(r[t]=e[t],o[t]=!0);l=u}return r},reduceDescriptors:H,freezeMethods:e=>{H(e,(t,n)=>{if(y(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];y(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return h(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:L,global:F,isContextDefined:B,isSpecCompliantForm:function(e){return!!(e&&y(e.append)&&"FormData"===e[o]&&e[r])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(O(e)){if(t.has(e))return;if(g(e))return e;if(!("toJSON"in e)){let r;if(t.add(e),v(e)){r=[];for(const t of e){const e=n(t);!p(e)&&r.push(e)}}else r=h(e)?[]:{},D(e,(e,t)=>{const o=n(e);!p(o)&&(r[t]=o)});return t.delete(e),r}}return e};return n(e)},isAsyncFn:$,isThenable:e=>e&&(O(e)||y(e))&&y(e.then)&&y(e.catch),setImmediate:W,asap:G,isIterable:Q,isSafeIterable:e=>null!=e&&c(e,r)&&Q(e)};const Y=Z.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"]);const ee=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),te=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ne(e,t){return Z.isArray(e)?e.map(e=>ne(e,t)):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function re(e){const t=Object.create(null);return Z.forEach(e.toJSON(),(e,n)=>{t[n]=(e=>ne(e,te))(e)}),t}const oe=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function ie(e){return!1===e||null==e?e:Z.isArray(e)?e.map(ie):(e=>ne(e,ee))(String(e))}const ae=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function ce(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function le(e,t,n,r,o){return Z.isFunction(r)?r.call(this,t,n):(o&&(t=n),Z.isString(t)?Z.isString(r)?-1!==t.indexOf(r):Z.isRegExp(r)?r.test(t):void 0:void 0)}let ue=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=se(t);if(!o)return;const s=Z.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=ie(e))}const s=(e,t)=>Z.forEach(e,(e,n)=>o(e,n,t));if(Z.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(Z.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim();const s=Z.hasOwnProp(t,n);!n||s&&Z.hasOwnProp(Y,n)||("set-cookie"===n?s?t[n].push(r):t[n]=[r]:t[n]=s?t[n]+", "+r:r)}),t})(e),t);else if(Z.isObject(e)&&Z.isSafeIterable(e)){let n,r,o=Object.create(null);for(const t of e){if(!Z.isArray(t))throw new TypeError("Object iterator must return a key-value pair");r=t[0],Z.hasOwnProp(o,r)?(n=o[r],o[r]=Z.isArray(n)?[...n,t[1]]:[n,t[1]]):o[r]=t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=se(e)){const n=Z.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Z.isFunction(t))return t.call(this,e,n);if(Z.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=se(e)){const n=Z.findKey(this,e);return!(!n||void 0===this[n]||t&&!le(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=se(e)){const o=Z.findKey(n,e);!o||t&&!le(0,n[o],o,t)||(delete n[o],r=!0)}}return Z.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!le(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Z.forEach(this,(r,o)=>{const s=Z.findKey(n,o);if(s)return t[s]=ie(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=ie(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Z.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Z.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){const e=this.get("set-cookie");return Z.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let r=0,o=!1,s=!1;function i(e){const o=ce(n.slice(r,e)),s=o.indexOf("=");if(s<1)return;const i=ce(o.slice(0,s));if(!ae.test(i))return;const a=i.toLowerCase();if("__proto__"===a||"constructor"===a||"prototype"===a)return;const c=ce(o.slice(s+1));t[a]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let r=1;r<t;r++){const o=e.charCodeAt(r);if(34===o)return e;if(92===o&&(r+=1,r>=t))return e;n+=e[r]}return n}(c)}for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);o?s?s=!1:92===t?s=!0:34===t&&(o=!1):34===t?o=!0:44!==t&&59!==t||(i(e),r=e+1)}return i(n.length),t}(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[oe]=this[oe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=se(e);t[r]||(!function(e,t){const n=Z.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Z.isArray(e)?e.forEach(r):r(e),this}};ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Z.reduceDescriptors(ue.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Z.freezeMethods(ue);const fe="[REDACTED ****]";function de(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),r=[],o=e=>{if(null===e||"object"!=typeof e)return e;if(Z.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof ue&&(e=e.toJSON()),r.push(e),Z.isArray(e))t=[],e.forEach((e,n)=>{const r=o(e);Z.isUndefined(r)||(t[n]=r)});else{if(!Z.isPlainObject(e)&&function(e){if(Z.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Z.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,s]of Object.entries(e)){const e=n.has(r.toLowerCase())?fe:o(s);Z.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return o(e)}function he(e){try{return String(e)}catch(e){return""}}let pe=class e extends Error{static from(t,n,r,o,s,i){let a=t.message;!a&&Z.isArray(t.errors)&&t.errors.length&&(a=function(e){return e.errors.map(e=>{try{return e&&e.message?he(e.message):he(e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}(t));const c=new e(a,n||t.code,r,o,s);return Object.defineProperty(c,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),c.name=t.name,null!=t.status&&null==c.status&&(c.status=t.status),i&&Object.assign(c,i),c}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){const e=this.config,t=e&&Z.hasOwnProp(e,"redact")?e.redact:void 0,n=Z.isArray(t)&&t.length>0?de(e,t):Z.toJSONObject(e);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:n,code:this.code,status:this.status}}};pe.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",pe.ERR_BAD_OPTION="ERR_BAD_OPTION",pe.ECONNABORTED="ECONNABORTED",pe.ETIMEDOUT="ETIMEDOUT",pe.ECONNREFUSED="ECONNREFUSED",pe.ERR_NETWORK="ERR_NETWORK",pe.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",pe.ERR_DEPRECATED="ERR_DEPRECATED",pe.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",pe.ERR_BAD_REQUEST="ERR_BAD_REQUEST",pe.ERR_CANCELED="ERR_CANCELED",pe.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",pe.ERR_INVALID_URL="ERR_INVALID_URL",pe.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";function ge(e){return Z.isPlainObject(e)||Z.isArray(e)}function me(e){return Z.endsWith(e,"[]")?e.slice(0,-2):e}function be(e,t,n){return e?e.concat(t).map(function(e,t){return e=me(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ye=Z.toFlatObject(Z,{},null,function(e){return/^is[A-Z]/.test(e)});function we(e,t,n){if(!Z.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(e,t)=>{const r=Z.getSafeProp(n,e);return Z.isUndefined(r)?t:r},o=r("metaTokens",!0),s=r("visitor")||p,i=r("dots",!1),a=r("indexes",!1),c=r("Blob")||"undefined"!=typeof Blob&&Blob,l=r("maxDepth",100),u=c&&Z.isSpecCompliantForm(t),f=[];if(!Z.isFunction(s))throw new TypeError("visitor must be a function");function d(e){if(null===e)return"";if(Z.isDate(e))return e.toISOString();if(Z.isBoolean(e))return e.toString();if(!u&&Z.isBlob(e))throw new pe("Blob is not supported. Use a Buffer instead.");if(Z.isArrayBuffer(e)||Z.isTypedArray(e)){if(u&&"function"==typeof c)return new c([e]);throw new pe("Blob is not supported. Use a Buffer instead.",pe.ERR_NOT_SUPPORT)}return e}function h(e){if(e>l)throw new pe("Object is too deeply nested ("+e+" levels). Max depth: "+l,pe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(e,n,r){let s=e;if(Z.isReactNative(t)&&Z.isReactNativeBlob(e))return t.append(be(r,n,i),d(e)),!1;if(e&&!r&&"object"==typeof e)if(Z.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=function(e,t){if(l===1/0)return JSON.stringify(e);const n=[];return JSON.stringify(e,function(e,r){if(!Z.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),h(t+n.length-1),r})}(e,1);else if(Z.isArray(e)&&function(e){return Z.isArray(e)&&!e.some(ge)}(e)||(Z.isFileList(e)||Z.endsWith(n,"[]"))&&(s=Z.toArray(e)))return n=me(n),s.forEach(function(e,r){!Z.isUndefined(e)&&null!==e&&t.append(!0===a?be([n],r,i):null===a?n:n+"[]",d(e))}),!1;return!!ge(e)||(t.append(be(r,n,i),d(e)),!1)}const g=Object.assign(ye,{defaultVisitor:p,convertValue:d,isVisitable:ge});if(!Z.isObject(e))throw new TypeError("data must be an object");return function e(n,r,o=0){if(!Z.isUndefined(n)){if(h(o),-1!==f.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));f.push(n),Z.forEach(n,function(n,i){!0===(!(Z.isUndefined(n)||null===n)&&s.call(t,n,Z.isString(i)?i.trim():i,r,g))&&e(n,r?r.concat(i):[i],o+1)}),f.pop()}}(e),t}function Oe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function Ee(e,t){this._pairs=[],e&&we(e,this,t)}const Re=Ee.prototype;function Se(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function _e(e,t,n){if(!t)return e;e=e||"";const r=Z.isFunction(n)?{serialize:n}:n,o=Z.getSafeProp(r,"encode")||Se,s=Z.getSafeProp(r,"serialize");let i;if(i=s?s(t,r):Z.isURLSearchParams(t)?t.toString():new Ee(t,r).toString(o),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Re.append=function(e,t){this._pairs.push([e,t])},Re.toString=function(e){const t=e?t=>e.call(this,t,Oe):Oe;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Ae=Symbol("internals");function ve(e){return e?e.length:0}function Pe(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function Te(e,t){const n=e.handlers,r=ve(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):r!==t.handlersLength&&(r?t.handlerEntries.forEach(function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)}):t.handlerEntries.clear()),t.handlersLength=r}class Ce{constructor(){this.handlers=[],this[Ae]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){const r={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},o=this[Ae];null==this.handlers&&(this.handlers=[]),Te(this,o);const s=o.nextId++;return this.handlers.push(r),o.handlerEntries.set(s,{handler:r,index:this.handlers.length-1}),o.handlersLength=this.handlers.length,s}eject(e){const t=this[Ae];Te(this,t);const n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||(Pe(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],Te(this,this[Ae]))}forEach(e){const t=this[Ae];Te(this,t),t.iterationDepth++;try{Z.forEach(this.handlers,function(t){null!==t&&e(t)})}finally{--t.iterationDepth||(Te(this,t),Pe(this.handlers),t.handlersLength=ve(this.handlers))}}}var je={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},xe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ee,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Ne="undefined"!=typeof window&&"undefined"!=typeof document,Ue="object"==typeof navigator&&navigator||void 0,De=Ne&&(!Ue||["ReactNative","NativeScript","NS"].indexOf(Ue.product)<0),Le="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Fe=Ne&&window.location.href||"http://localhost";var Be={...Object.freeze({__proto__:null,hasBrowserEnv:Ne,hasStandardBrowserEnv:De,hasStandardBrowserWebWorkerEnv:Le,navigator:Ue,origin:Fe}),...xe};function ke(e){if(e>100)throw new pe("FormData field is too deeply nested ("+e+" levels). Max depth: 100",pe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function qe(e){function t(e,n,r,o){ke(o);let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&Z.isArray(r)?r.length:s,a)return Z.hasOwnProp(r,s)?r[s]=Z.isArray(r[s])?r[s].concat(n):[r[s],n]:r[s]=n,!i;Z.hasOwnProp(r,s)&&Z.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&Z.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if(Z.isFormData(e)&&Z.isFunction(e.entries)){const n={};return Z.forEachEntry(e,(e,r)=>{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;null!==(r=n.exec(e));)ke(t.length),t.push("[]"===r[0]?"":r[1]||r[0]);return t}(e),r,n,0)}),n}return null}const Ie=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Me=(e,t)=>null!=e&&Z.hasOwnProp(e,t)?e[t]:void 0;const ze={transitional:je,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Z.isObject(e);o&&Z.isHTMLForm(e)&&(e=new FormData(e));if(Z.isFormData(e))return r?JSON.stringify(qe(e)):e;if(Z.isArrayBuffer(e)||Z.isBuffer(e)||Z.isStream(e)||Z.isFile(e)||Z.isBlob(e)||Z.isReadableStream(e))return e;if(Z.isArrayBufferView(e))return e.buffer;if(Z.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){const t=Me(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return we(e,new Be.classes.URLSearchParams,{visitor:function(e,t,n,r){return Be.isNode&&Z.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((s=Z.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Me(this,"env"),r=n&&n.FormData;return we(s?{"files[]":e}:e,r&&new r,t)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Z.isString(e))try{return(t||JSON.parse)(e),Z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Me(this,"transitional")||ze.transitional,n=t&&t.forcedJSONParsing,r=Me(this,"responseType"),o="json"===r;if(Z.isResponse(e)||Z.isReadableStream(e))return e;if(e&&Z.isString(e)&&(n&&!r||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,Me(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw pe.from(e,pe.ERR_BAD_RESPONSE,this,null,Me(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Be.classes.FormData,Blob:Be.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function He(e,t){const n=this||ze,r=t||n,o=ue.from(r.headers);let s=r.data;return Z.forEach(e,function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function $e(e){return!(!e||!e.__CANCEL__)}Z.forEach(Ie,e=>{ze.headers[e]={}});let We=class extends pe{constructor(e,t,n){super(null==e?"canceled":e,pe.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Je(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new pe("Request failed with status code "+n.status,n.status>=400&&n.status<500?pe.ERR_BAD_REQUEST:pe.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const Ve=/[\t\n\r]/g;function Ke(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(Ve,"")}function Xe(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}const Ge=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,f=0;for(;u!==s;)f+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=l&&c-l;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},s-a)))},()=>n&&i(n),(...e)=>i(e)]}(n=>{if(!n||!Z.isNumber(n.loaded))return;const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=Math.max(0,null!=i?Math.min(s,i):s),c=Math.max(0,a-r),l=o(c);r=Math.max(r,a);e({loaded:a,total:i,progress:i?a/i:void 0,bytes:c,rate:l||void 0,estimated:l&&i?(i-a)/l:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},Qe=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ze=(e,t=Z.asap)=>(...n)=>t(()=>e(...n));var Ye=Be.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Be.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Be.origin),Be.navigator&&/(msie|trident)/i.test(Be.navigator.userAgent)):()=>!0,et=Be.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Z.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Z.isString(r)&&a.push(`path=${r}`),Z.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),Z.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===e)try{return decodeURIComponent(r.slice(o+1))}catch(e){return r.slice(o+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};const tt=/^https?:(?!\/\/)/i;function nt(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${fe}@`),n=t.indexOf("#"),r=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${fe}`);return-1===n?r:`${r}#${o=t.slice(n+1),o?o.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n="")=>`${t}${n}${fe}`):o}`;var o}function rt(e,t){if("string"==typeof e){const n=Ke(e);if(tt.test(n))throw new pe(`Invalid URL ${JSON.stringify(nt(n))}: missing "//" after protocol`,pe.ERR_INVALID_URL,t)}}function ot(e,t,n,r){rt(t,r);let o=!("string"==typeof(s=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s));var s;return e&&(o||!1===n)?(rt(e,r),function(e,t){if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}const st=e=>e instanceof ue?{...e}:e;function it(e,t){e=e||{},t=t||{};const n=Object.create(null);function r(e,t,n,r){return Z.isPlainObject(e)&&Z.isPlainObject(t)?Z.merge.call({caseless:r},e,t):Z.isPlainObject(t)?Z.merge({},t):Z.isArray(t)?t.slice():t}function o(e,t,n,o){return Z.isUndefined(t)?Z.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!Z.isUndefined(t))return r(void 0,t)}function i(e,t){return Z.isUndefined(t)?Z.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return Z.hasOwnProp(t,s)?r(n,o):Z.hasOwnProp(e,s)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutErrorMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>o(st(e),st(t),0,!0)};var l;return Z.forEach((l={...e,...t},Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(l).concat(Object.getOwnPropertySymbols(l).filter(e=>Object.getOwnPropertyDescriptor(l,e).enumerable)):Object.keys(l)),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const s=Z.hasOwnProp(c,r)?c[r]:o,i=s(Z.hasOwnProp(e,r)?e[r]:void 0,Z.hasOwnProp(t,r)?t[r]:void 0,r);Z.isUndefined(i)&&s!==a||(n[r]=i)}),Z.hasOwnProp(t,"validateStatus")&&Z.isUndefined(t.validateStatus)&&!1===function(n){const r=Z.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Z.isUndefined(r)){if(!Z.isPlainObject(r))return;if(Z.hasOwnProp(r,n))return r[n]}const o=Z.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Z.isPlainObject(o)&&Z.hasOwnProp(o,n))return o[n]}("validateStatusUndefinedResolves")&&(Z.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const at=["content-type","content-length"];function ct(e){const t=it({},e),n=e=>Z.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let o=n("withXSRFToken");const s=n("xsrfHeaderName"),i=n("xsrfCookieName");let a=n("headers");const c=n("auth"),l=n("baseURL"),u=n("allowAbsoluteUrls"),f=n("url");if(t.headers=a=ue.from(a),t.url=_e(ot(l,f,u,t),n("params"),n("paramsSerializer")),c){const t=Z.getSafeProp(c,"username")||"",n=Z.getSafeProp(c,"password")||"";try{a.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(t){throw pe.from(t,pe.ERR_BAD_OPTION_VALUE,e)}}if(Z.isFormData(r)){const e=Z.getSafeProp(r,"getHeaders");Be.hasStandardBrowserEnv||Be.hasStandardBrowserWebWorkerEnv||Z.isReactNative(r)?a.setContentType(void 0):Z.isFunction(e)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(([t,n])=>{at.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}(a,e.call(r),n("formDataHeaderPolicy"))}if(Be.hasStandardBrowserEnv){Z.isFunction(o)&&(o=o(t));if(!0===o||null==o&&Ye(t.url)){const e=s&&i&&et.read(i);e&&a.set(s,e)}}return t}var lt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=ct(e);let o=r.data;const s=ue.from(r.headers).normalize();let i,a,c,l,u,f,{responseType:d,onUploadProgress:h,onDownloadProgress:p}=r;function g(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function b(o){if(!m)return;if(!(0!==m.status||"file"===(Xe(Ke(r.url))||Xe(Be.origin))||m.responseURL&&m.responseURL.startsWith("file:")))return n(new pe("Request aborted",pe.ECONNABORTED,e,m)),g(),void(m=null);try{o?f&&f(o):u&&u()}catch(e){setTimeout(()=>{throw e})}if(!m)return;const s=ue.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Je(function(e){t(e),g()},function(e){n(e),g()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:s,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=b:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&m.responseURL.startsWith("file:"))&&setTimeout(b)},m.onabort=function(){m&&(n(new pe("Request aborted",pe.ECONNABORTED,e,m)),g(),m=null)},m.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new pe(r,pe.ERR_NETWORK,e,m);o.event=t||null,n(o),g(),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||je;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new pe(t,o.clarifyTimeoutError?pe.ETIMEDOUT:pe.ECONNABORTED,e,m)),g(),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&Z.forEach(re(s),function(e,t){m.setRequestHeader(t,e)}),Z.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),p&&([c,u,f]=Ge(p,!0),m.addEventListener("progress",c)),h&&m.upload&&([a,l]=Ge(h),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new We(null,e,m):t),m.abort(),g(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=Xe(r.url);if(y&&!Be.protocols.includes(y))return n(new pe("Unsupported protocol "+y+":",pe.ERR_BAD_REQUEST,e)),void g();m.send(o||null)})};const ut=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const o=function(e){if(!r){r=!0,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof pe?t:new We(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new pe(`timeout of ${t}ms exceeded`,pe.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>{r||(e.aborted?o.call(e):e.addEventListener("abort",o,{once:!0}))});const{signal:a}=n;return a.unsubscribe=()=>Z.asap(i),a},ft=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},dt=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ht=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of dt(e))yield*ft(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},pt=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,gt=(e,t,n)=>t+2<n&&pt(e.charCodeAt(t+1))&&pt(e.charCodeAt(t+2)),mt=e=>e<=57?e-48:(223&e)-55,bt=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,yt=e=>9===e||10===e||12===e||13===e||32===e,wt=e=>{const t=e.length;let n=0,r=0,o=!1;for(let s=0;s<t;s++){let i=e.charCodeAt(s);37===i&>(e,s,t)&&(i=16*mt(e.charCodeAt(s+1))+mt(e.charCodeAt(s+2)),s+=2),yt(i)||(61!==i?!bt(i)||r>0?o=!0:n++:r++)}return o||r>2||r>0&&(n+r)%4!=0||n%4==1?(e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)})(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)};function Ot(e){const t="string"==typeof e?e.indexOf("#"):-1;return((e,t)=>{if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const r=e.slice(5,n),o=e.slice(n+1);if(/;base64/i.test(r))return t(o);let s=0;for(let e=0,t=o.length;e<t;e++){const n=o.charCodeAt(e);if(37===n&>(o,e,t))s+=1,e+=2;else if(n<128)s+=1;else if(n<2048)s+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=o.charCodeAt(e+1);t>=56320&&t<=57343?(s+=4,e++):s+=3}else s+=3}return s})(-1===t?e:e.slice(0,t),wt)}const Et="1.20.0",Rt={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:St}=Z,_t=e=>{if(!Z.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},At=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},vt=e=>{const t=void 0!==Z.global&&null!==Z.global?Z.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=Z.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:s,Response:i}=e,a=o?St(o):"function"==typeof fetch,c=St(s),l=St(i);if(!a)return!1;const u=a&&St(n),f=a&&("function"==typeof r?(d=new r,e=>d.encode(e)):async e=>new Uint8Array(await new s(e).arrayBuffer()));var d;const h=c&&u&&At(()=>{let e=!1;const t=new s(Be.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),p=l&&u&&At(()=>Z.isReadableStream(new i("").body)),g={stream:p&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!g[e]&&(g[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new pe(`Response type '${e}' is not supported`,pe.ERR_NOT_SUPPORT,n)})});const m=async e=>{if(null==e)return 0;if(Z.isBlob(e))return e.size;if(Z.isSpecCompliantForm(e)){const t=new s(Be.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Z.isArrayBufferView(e)||Z.isArrayBuffer(e)?e.byteLength:(Z.isURLSearchParams(e)&&(e+=""),Z.isString(e)?(await f(e)).byteLength:void 0)};return async e=>{let{url:t,method:n,data:a,signal:l,cancelToken:f,timeout:d,onDownloadProgress:b,onUploadProgress:y,responseType:w,headers:O,withCredentials:E="same-origin",fetchOptions:R,maxContentLength:S,maxBodyLength:_,maxRedirects:A}=ct(e);const v=Z.isNumber(S)&&S>-1,P=Z.isNumber(_)&&_>-1;let T=o||fetch;w=w?(w+"").toLowerCase():"text";let C=ut([l,f&&f.toAbortSignal()],d),j=null;const x=C&&C.unsubscribe&&(()=>{C.unsubscribe()});let N,U=null;const D=()=>new pe("Request body larger than maxBodyLength limit",pe.ERR_BAD_REQUEST,e,j);try{let o;const l=(F="auth",Z.hasOwnProp(e,F)?e[F]:void 0);if(l){const e=Z.getSafeProp(l,"username")||"";o={username:e,password:Z.getSafeProp(l,"password")||""}}if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){const e=new URL(t,Be.origin);if(!o&&(e.username||e.password)){const t=_t(e.username);o={username:t,password:_t(e.password)}}(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(o&&(O.delete("authorization"),O.set("Authorization","Basic "+btoa((L=(o.username||"")+":"+(o.password||""),encodeURIComponent(L).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))),v&&"string"==typeof t&&t.startsWith("data:")){if(Ot(t)>S)throw new pe("maxContentLength size of "+S+" exceeded",pe.ERR_BAD_RESPONSE,e,j)}if(P&&"get"!==n&&"head"!==n){const e=await m(a);if("number"==typeof e&&isFinite(e)&&(N=e,e>_))throw D()}const f=P&&(Z.isReadableStream(a)||Z.isStream(a)),d=(e,t,n)=>ht(e,65536,e=>{if(P&&e>_)throw U=D();t&&t(e)},n);if(h&&"get"!==n&&"head"!==n&&(y||f)){if(N=null==N?await(async(e,t)=>{const n=Z.toFiniteNumber(e.getContentLength());return null==n?m(t):n})(O,a):N,0!==N||f){let e,n=new s(t,{method:"POST",body:a,duplex:"half"});if(Z.isFormData(a)&&(e=n.headers.get("content-type"))&&O.setContentType(e),n.body){const[e,t]=y&&Qe(N,Ge(Ze(y)))||[];a=d(n.body,e,t)}}}else if(f&&!c&&u&&"get"!==n&&"head"!==n)a=d(a);else if(f&&c&&!h&&"get"!==n&&"head"!==n)throw new pe("Stream request bodies are not supported by the current fetch implementation",pe.ERR_NOT_SUPPORT,e,j);Z.isString(E)||(E=E?"include":"omit");const B=c&&"credentials"in s.prototype;if(Z.isFormData(a)){const e=O.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&O.delete("content-type")}O.set("User-Agent","axios/"+Et,!1);const k=null==R?R:Object.assign(Object.create(null),R);k&&(delete k.body,delete k.headers,delete k.method,delete k.signal,delete k.duplex,delete k.credentials);const q=Object.assign(Object.create(null),k,{signal:C,method:n.toUpperCase(),headers:re(O.normalize()),body:a,duplex:"half",credentials:B?E:void 0});c&&(Z.forEach(Rt,(e,t)=>{void 0===q[t]&&(q[t]=e)}),void 0===q.signal&&(q.signal=null),void 0===q.body&&(q.body=null)),0===A&&(q.redirect="manual",k&&(k.redirect="manual")),j=c&&new s(t,q);let I=await(c?T(j,k):T(t,q));const M=ue.from(I.headers);if(v){const t=Z.toFiniteNumber(M.getContentLength());if(null!=t&&t>S)throw new pe("maxContentLength size of "+S+" exceeded",pe.ERR_BAD_RESPONSE,e,j)}const z=p&&("stream"===w||"response"===w);if(p&&I.body&&(b||v||z&&x)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=I[e]});const n=Z.toFiniteNumber(M.getContentLength()),[r,o]=b&&Qe(n,Ge(Ze(b),!0))||[];let s=0;const a=t=>{if(v&&(s=t,s>S))throw new pe("maxContentLength size of "+S+" exceeded",pe.ERR_BAD_RESPONSE,e,j);r&&r(t)};I=new i(ht(I.body,65536,a,()=>{o&&o(),x&&x()}),t)}w=w||"text";let H=await g[Z.findKey(g,w)||"text"](I,e);if(v&&!p&&!z){let t;if(null!=H&&("number"==typeof H.byteLength?t=H.byteLength:"number"==typeof H.size?t=H.size:"string"==typeof H&&(t="function"==typeof r?(new r).encode(H).byteLength:H.length)),"number"==typeof t&&t>S)throw new pe("maxContentLength size of "+S+" exceeded",pe.ERR_BAD_RESPONSE,e,j)}return!z&&x&&x(),await new Promise((t,n)=>{Je(t,n,{data:H,headers:ue.from(I.headers),status:I.status,statusText:I.statusText,config:e,request:j})})}catch(t){if(x&&x(),C&&C.aborted&&C.reason instanceof pe){const n=C.reason;throw n.config=e,j&&(n.request=j),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(U)throw j&&!U.request&&(U.request=j),U;if(t instanceof pe)throw j&&!t.request&&(t.request=j),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new pe("Network Error",pe.ERR_NETWORK,e,j,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw pe.from(t,t&&t.code,e,j,t&&t.response)}var L,F}},Pt=new Map,Tt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,l=Pt;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:vt(t)),l=a;return a};Tt();const Ct={http:null,xhr:lt,fetch:{get:Tt}};Z.forEach(Ct,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const jt=e=>`- ${e}`,xt=e=>Z.isFunction(e)||null===e||!1===e;var Nt={getAdapter:function(e,t){e=Z.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i<n;i++){let n;if(r=e[i],o=r,!xt(r)&&(o=Ct[(n=String(r)).toLowerCase()],void 0===o))throw new pe(`Unknown adapter '${n}'`);if(o&&(Z.isFunction(o)||(o=o.get(t))))break;s[n||"#"+i]=o}if(!o){const e=Object.entries(s).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(jt).join("\n"):" "+jt(e[0]):"as no adapter specified";throw new pe("There is no suitable adapter to dispatch the request "+t,pe.ERR_NOT_SUPPORT)}return o},adapters:Ct};function Ut(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new We(null,e)}function Dt(e){const t=Z.toSafeFlatObject(e);Ut(t),t.headers=ue.from(Z.getSafeProp(t,"headers")),t.data=He.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return Nt.getAdapter(t.adapter||ze.adapter,t)(t).then(function(e){Ut(t),t.response=e;try{e.data=He.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=ue.from(e.headers),e},function(e){if(!$e(e)&&(Ut(t),e&&e.response)){t.response=e.response;try{e.response.data=He.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=ue.from(e.response.headers)}return Promise.reject(e)})}const Lt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Lt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ft={};Lt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Et+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new pe(r(o," has been removed"+(t?" in "+t:"")),pe.ERR_DEPRECATED);return t&&!Ft[o]&&(Ft[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},Lt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Bt={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new pe("options must be an object",pe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new pe("option "+s+" must be "+n,pe.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new pe("Unknown option "+s,pe.ERR_BAD_OPTION)}},validators:Lt};const kt=Bt.validators;let qt=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ce,response:new Ce}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error)try{let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack;let r="";if("string"==typeof n){const e=n.indexOf("\n");r=-1===e?"":n.slice(e+1)}if(e.stack){if(r){const t=r.indexOf("\n"),n=-1===t?-1:r.indexOf("\n",t+1),o=-1===n?"":r.slice(n+1);String(e.stack).endsWith(o)||(e.stack+="\n"+r)}}else e.stack=r}catch(e){}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=it(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Bt.assertOptions(n,{silentJSONParsing:kt.transitional(kt.boolean),forcedJSONParsing:kt.transitional(kt.boolean),clarifyTimeoutError:kt.transitional(kt.boolean),legacyInterceptorReqResOrdering:kt.transitional(kt.boolean),advertiseZstdAcceptEncoding:kt.transitional(kt.boolean),validateStatusUndefinedResolves:kt.transitional(kt.boolean)},!1),null!=r&&(Z.isFunction(r)?t.paramsSerializer={serialize:r}:Bt.assertOptions(r,{encode:kt.function,serialize:kt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Bt.assertOptions(t,{baseUrl:kt.spelling("baseURL"),withXsrfToken:kt.spelling("withXSRFToken")},!0),t.method=(Z.getSafeProp(t,"method")||Z.getSafeProp(this.defaults,"method")||"get").toLowerCase();let s=o&&Z.merge(o.common,o[t.method]);o&&Z.forEach(Ie.concat("common"),e=>{delete o[e]}),t.headers=ue.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||je;n&&n.legacyInterceptorReqResOrdering?i.unshift(e.fulfilled,e.rejected):i.push(e.fulfilled,e.rejected)});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,f=0;if(!a){const e=[Dt.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);f<u;)l=l.then(e[f++],e[f++]);return l}u=i.length;let d=t;for(;f<u;){const e=i[f++],t=i[f++];try{d=e?e(d):d}catch(e){if(!t){l=Promise.reject(e);break}try{const n=t.call(this,e);Z.isThenable(n)&&(l=Promise.resolve(n).then(()=>Dt.call(this,d)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=Dt.call(this,d)}catch(e){l=Promise.reject(e)}for(f=0,u=c.length;f<u;)l=l.then(c[f++],c[f++]);return l}getUri(e){return _e(ot((e=it(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}};Z.forEach(["delete","get","head","options"],function(e){qt.prototype[e]=function(t,n){return this.request(it(n||{},{method:e,url:t,data:n&&Z.hasOwnProp(n,"data")?n.data:void 0}))}}),Z.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,r,o){return this.request(it(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}qt.prototype[e]=t(),"query"!==e&&(qt.prototype[e+"Form"]=t(!0))});const It={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,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent: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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(It).forEach(([e,t])=>{void 0===It[t]&&(It[t]=e)});const Mt=function t(n){const r=new qt(n),o=e(qt.prototype.request,r);return Z.extend(o,qt.prototype,r,{allOwnKeys:!0}),Z.extend(o,r,null,{allOwnKeys:!0}),o.create=function(e){return t(it(n,e))},o}(ze);Mt.Axios=qt,Mt.CanceledError=We,Mt.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new We(e,r,o),t(n.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,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},Mt.isCancel=$e,Mt.VERSION=Et,Mt.toFormData=we,Mt.AxiosError=pe,Mt.Cancel=Mt.CanceledError,Mt.all=function(e){return Promise.all(e)},Mt.spread=function(e){return function(t){return e.apply(null,t)}},Mt.isAxiosError=function(e){return Z.isObject(e)&&!0===e.isAxiosError},Mt.mergeConfig=it,Mt.AxiosHeaders=ue,Mt.formToJSON=e=>qe(Z.isHTMLForm(e)?new FormData(e):e),Mt.getAdapter=Nt.getAdapter,Mt.HttpStatusCode=It,Mt.default=Mt;const{Axios:zt,AxiosError:Ht,CanceledError:$t,isCancel:Wt,CancelToken:Jt,VERSION:Vt,all:Kt,Cancel:Xt,isAxiosError:Gt,spread:Qt,toFormData:Zt,AxiosHeaders:Yt,HttpStatusCode:en,formToJSON:tn,getAdapter:nn,mergeConfig:rn,create:on}=Mt;export{zt as Axios,Ht as AxiosError,Yt as AxiosHeaders,Xt as Cancel,Jt as CancelToken,$t as CanceledError,en as HttpStatusCode,Vt as VERSION,Kt as all,on as create,Mt as default,tn as formToJSON,nn as getAdapter,Gt as isAxiosError,Wt as isCancel,rn as mergeConfig,Qt as spread,Zt as toFormData};
//# sourceMappingURL=axios.min.js.map