@regulaforensics/document-reader-webclient
Version:
Regula Document Reader js client for the browser and node.js based on axios
1,709 lines • 276 kB
JavaScript
function DS(_, S) {
return function() {
return _.apply(S, arguments);
};
}
const { toString: EI } = Object.prototype, { getPrototypeOf: NE } = Object, { iterator: Y_, toStringTag: nS } = Symbol, w_ = /* @__PURE__ */ ((_) => (S) => {
const E = EI.call(S);
return _[E] || (_[E] = E.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), j = (_) => (_ = _.toLowerCase(), (S) => w_(S) === _), K_ = (_) => (S) => typeof S === _, { isArray: t_ } = Array, L_ = K_("undefined");
function s_(_) {
return _ !== null && !L_(_) && _.constructor !== null && !L_(_.constructor) && K(_.constructor.isBuffer) && _.constructor.isBuffer(_);
}
const LS = j("ArrayBuffer");
function SI(_) {
let S;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? S = ArrayBuffer.isView(_) : S = _ && _.buffer && LS(_.buffer), S;
}
const II = K_("string"), K = K_("function"), NS = K_("number"), M_ = (_) => _ !== null && typeof _ == "object", AI = (_) => _ === !0 || _ === !1, P_ = (_) => {
if (w_(_) !== "object")
return !1;
const S = NE(_);
return (S === null || S === Object.prototype || Object.getPrototypeOf(S) === null) && !(nS in _) && !(Y_ in _);
}, tI = (_) => {
if (!M_(_) || s_(_))
return !1;
try {
return Object.keys(_).length === 0 && Object.getPrototypeOf(_) === Object.prototype;
} catch {
return !1;
}
}, OI = j("Date"), RI = j("File"), rI = j("Blob"), DI = j("FileList"), nI = (_) => M_(_) && K(_.pipe), LI = (_) => {
let S;
return _ && (typeof FormData == "function" && _ instanceof FormData || K(_.append) && ((S = w_(_)) === "formdata" || // detect form-data instance
S === "object" && K(_.toString) && _.toString() === "[object FormData]"));
}, NI = j("URLSearchParams"), [CI, sI, MI, cI] = ["ReadableStream", "Request", "Response", "Headers"].map(j), aI = (_) => _.trim ? _.trim() : _.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function c_(_, S, { allOwnKeys: E = !1 } = {}) {
if (_ === null || typeof _ > "u")
return;
let I, t;
if (typeof _ != "object" && (_ = [_]), t_(_))
for (I = 0, t = _.length; I < t; I++)
S.call(null, _[I], I, _);
else {
if (s_(_))
return;
const A = E ? Object.getOwnPropertyNames(_) : Object.keys(_), O = A.length;
let r;
for (I = 0; I < O; I++)
r = A[I], S.call(null, _[r], r, _);
}
}
function CS(_, S) {
if (s_(_))
return null;
S = S.toLowerCase();
const E = Object.keys(_);
let I = E.length, t;
for (; I-- > 0; )
if (t = E[I], S === t.toLowerCase())
return t;
return null;
}
const d = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, sS = (_) => !L_(_) && _ !== d;
function y_() {
const { caseless: _ } = sS(this) && this || {}, S = {}, E = (I, t) => {
const A = _ && CS(S, t) || t;
P_(S[A]) && P_(I) ? S[A] = y_(S[A], I) : P_(I) ? S[A] = y_({}, I) : t_(I) ? S[A] = I.slice() : S[A] = I;
};
for (let I = 0, t = arguments.length; I < t; I++)
arguments[I] && c_(arguments[I], E);
return S;
}
const UI = (_, S, E, { allOwnKeys: I } = {}) => (c_(S, (t, A) => {
E && K(t) ? _[A] = DS(t, E) : _[A] = t;
}, { allOwnKeys: I }), _), fI = (_) => (_.charCodeAt(0) === 65279 && (_ = _.slice(1)), _), BI = (_, S, E, I) => {
_.prototype = Object.create(S.prototype, I), _.prototype.constructor = _, Object.defineProperty(_, "super", {
value: S.prototype
}), E && Object.assign(_.prototype, E);
}, hI = (_, S, E, I) => {
let t, A, O;
const r = {};
if (S = S || {}, _ == null) return S;
do {
for (t = Object.getOwnPropertyNames(_), A = t.length; A-- > 0; )
O = t[A], (!I || I(O, _, S)) && !r[O] && (S[O] = _[O], r[O] = !0);
_ = E !== !1 && NE(_);
} while (_ && (!E || E(_, S)) && _ !== Object.prototype);
return S;
}, HI = (_, S, E) => {
_ = String(_), (E === void 0 || E > _.length) && (E = _.length), E -= S.length;
const I = _.indexOf(S, E);
return I !== -1 && I === E;
}, VI = (_) => {
if (!_) return null;
if (t_(_)) return _;
let S = _.length;
if (!NS(S)) return null;
const E = new Array(S);
for (; S-- > 0; )
E[S] = _[S];
return E;
}, GI = /* @__PURE__ */ ((_) => (S) => _ && S instanceof _)(typeof Uint8Array < "u" && NE(Uint8Array)), PI = (_, S) => {
const I = (_ && _[Y_]).call(_);
let t;
for (; (t = I.next()) && !t.done; ) {
const A = t.value;
S.call(_, A[0], A[1]);
}
}, uI = (_, S) => {
let E;
const I = [];
for (; (E = _.exec(S)) !== null; )
I.push(E);
return I;
}, mI = j("HTMLFormElement"), lI = (_) => _.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(E, I, t) {
return I.toUpperCase() + t;
}
), UE = (({ hasOwnProperty: _ }) => (S, E) => _.call(S, E))(Object.prototype), oI = j("RegExp"), MS = (_, S) => {
const E = Object.getOwnPropertyDescriptors(_), I = {};
c_(E, (t, A) => {
let O;
(O = S(t, A, _)) !== !1 && (I[A] = O || t);
}), Object.defineProperties(_, I);
}, bI = (_) => {
MS(_, (S, E) => {
if (K(_) && ["arguments", "caller", "callee"].indexOf(E) !== -1)
return !1;
const I = _[E];
if (K(I)) {
if (S.enumerable = !1, "writable" in S) {
S.writable = !1;
return;
}
S.set || (S.set = () => {
throw Error("Can not rewrite read-only method '" + E + "'");
});
}
});
}, eI = (_, S) => {
const E = {}, I = (t) => {
t.forEach((A) => {
E[A] = !0;
});
};
return t_(_) ? I(_) : I(String(_).split(S)), E;
}, YI = () => {
}, wI = (_, S) => _ != null && Number.isFinite(_ = +_) ? _ : S;
function KI(_) {
return !!(_ && K(_.append) && _[nS] === "FormData" && _[Y_]);
}
const vI = (_) => {
const S = new Array(10), E = (I, t) => {
if (M_(I)) {
if (S.indexOf(I) >= 0)
return;
if (s_(I))
return I;
if (!("toJSON" in I)) {
S[t] = I;
const A = t_(I) ? [] : {};
return c_(I, (O, r) => {
const n = E(O, t + 1);
!L_(n) && (A[r] = n);
}), S[t] = void 0, A;
}
}
return I;
};
return E(_, 0);
}, WI = j("AsyncFunction"), ZI = (_) => _ && (M_(_) || K(_)) && K(_.then) && K(_.catch), cS = ((_, S) => _ ? setImmediate : S ? ((E, I) => (d.addEventListener("message", ({ source: t, data: A }) => {
t === d && A === E && I.length && I.shift()();
}, !1), (t) => {
I.push(t), d.postMessage(E, "*");
}))(`axios@${Math.random()}`, []) : (E) => setTimeout(E))(
typeof setImmediate == "function",
K(d.postMessage)
), XI = typeof queueMicrotask < "u" ? queueMicrotask.bind(d) : typeof process < "u" && process.nextTick || cS, jI = (_) => _ != null && K(_[Y_]), L = {
isArray: t_,
isArrayBuffer: LS,
isBuffer: s_,
isFormData: LI,
isArrayBufferView: SI,
isString: II,
isNumber: NS,
isBoolean: AI,
isObject: M_,
isPlainObject: P_,
isEmptyObject: tI,
isReadableStream: CI,
isRequest: sI,
isResponse: MI,
isHeaders: cI,
isUndefined: L_,
isDate: OI,
isFile: RI,
isBlob: rI,
isRegExp: oI,
isFunction: K,
isStream: nI,
isURLSearchParams: NI,
isTypedArray: GI,
isFileList: DI,
forEach: c_,
merge: y_,
extend: UI,
trim: aI,
stripBOM: fI,
inherits: BI,
toFlatObject: hI,
kindOf: w_,
kindOfTest: j,
endsWith: HI,
toArray: VI,
forEachEntry: PI,
matchAll: uI,
isHTMLForm: mI,
hasOwnProperty: UE,
hasOwnProp: UE,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: MS,
freezeMethods: bI,
toObjectSet: eI,
toCamelCase: lI,
noop: YI,
toFiniteNumber: wI,
findKey: CS,
global: d,
isContextDefined: sS,
isSpecCompliantForm: KI,
toJSONObject: vI,
isAsyncFn: WI,
isThenable: ZI,
setImmediate: cS,
asap: XI,
isIterable: jI
};
function P(_, S, E, I, t) {
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = _, this.name = "AxiosError", S && (this.code = S), E && (this.config = E), I && (this.request = I), t && (this.response = t, this.status = t.status ? t.status : null);
}
L.inherits(P, Error, {
toJSON: function() {
return {
// Standard
message: this.message,
name: this.name,
// Microsoft
description: this.description,
number: this.number,
// Mozilla
fileName: this.fileName,
lineNumber: this.lineNumber,
columnNumber: this.columnNumber,
stack: this.stack,
// Axios
config: L.toJSONObject(this.config),
code: this.code,
status: this.status
};
}
});
const aS = P.prototype, US = {};
[
"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"
// eslint-disable-next-line func-names
].forEach((_) => {
US[_] = { value: _ };
});
Object.defineProperties(P, US);
Object.defineProperty(aS, "isAxiosError", { value: !0 });
P.from = (_, S, E, I, t, A) => {
const O = Object.create(aS);
return L.toFlatObject(_, O, function(n) {
return n !== Error.prototype;
}, (r) => r !== "isAxiosError"), P.call(O, _.message, S, E, I, t), O.cause = _, O.name = _.name, A && Object.assign(O, A), O;
};
const TI = null;
function _E(_) {
return L.isPlainObject(_) || L.isArray(_);
}
function fS(_) {
return L.endsWith(_, "[]") ? _.slice(0, -2) : _;
}
function fE(_, S, E) {
return _ ? _.concat(S).map(function(t, A) {
return t = fS(t), !E && A ? "[" + t + "]" : t;
}).join(E ? "." : "") : S;
}
function zI(_) {
return L.isArray(_) && !_.some(_E);
}
const JI = L.toFlatObject(L, {}, null, function(S) {
return /^is[A-Z]/.test(S);
});
function v_(_, S, E) {
if (!L.isObject(_))
throw new TypeError("target must be an object");
S = S || new FormData(), E = L.toFlatObject(E, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(f, s) {
return !L.isUndefined(s[f]);
});
const I = E.metaTokens, t = E.visitor || D, A = E.dots, O = E.indexes, n = (E.Blob || typeof Blob < "u" && Blob) && L.isSpecCompliantForm(S);
if (!L.isFunction(t))
throw new TypeError("visitor must be a function");
function R(C) {
if (C === null) return "";
if (L.isDate(C))
return C.toISOString();
if (L.isBoolean(C))
return C.toString();
if (!n && L.isBlob(C))
throw new P("Blob is not supported. Use a Buffer instead.");
return L.isArrayBuffer(C) || L.isTypedArray(C) ? n && typeof Blob == "function" ? new Blob([C]) : Buffer.from(C) : C;
}
function D(C, f, s) {
let U = C;
if (C && !s && typeof C == "object") {
if (L.endsWith(f, "{}"))
f = I ? f : f.slice(0, -2), C = JSON.stringify(C);
else if (L.isArray(C) && zI(C) || (L.isFileList(C) || L.endsWith(f, "[]")) && (U = L.toArray(C)))
return f = fS(f), U.forEach(function(h, c) {
!(L.isUndefined(h) || h === null) && S.append(
// eslint-disable-next-line no-nested-ternary
O === !0 ? fE([f], c, A) : O === null ? f : f + "[]",
R(h)
);
}), !1;
}
return _E(C) ? !0 : (S.append(fE(s, f, A), R(C)), !1);
}
const M = [], a = Object.assign(JI, {
defaultVisitor: D,
convertValue: R,
isVisitable: _E
});
function N(C, f) {
if (!L.isUndefined(C)) {
if (M.indexOf(C) !== -1)
throw Error("Circular reference detected in " + f.join("."));
M.push(C), L.forEach(C, function(U, H) {
(!(L.isUndefined(U) || U === null) && t.call(
S,
U,
L.isString(H) ? H.trim() : H,
f,
a
)) === !0 && N(U, f ? f.concat(H) : [H]);
}), M.pop();
}
}
if (!L.isObject(_))
throw new TypeError("data must be an object");
return N(_), S;
}
function BE(_) {
const S = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(_).replace(/[!'()~]|%20|%00/g, function(I) {
return S[I];
});
}
function CE(_, S) {
this._pairs = [], _ && v_(_, this, S);
}
const BS = CE.prototype;
BS.append = function(S, E) {
this._pairs.push([S, E]);
};
BS.toString = function(S) {
const E = S ? function(I) {
return S.call(this, I, BE);
} : BE;
return this._pairs.map(function(t) {
return E(t[0]) + "=" + E(t[1]);
}, "").join("&");
};
function qI(_) {
return encodeURIComponent(_).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function hS(_, S, E) {
if (!S)
return _;
const I = E && E.encode || qI;
L.isFunction(E) && (E = {
serialize: E
});
const t = E && E.serialize;
let A;
if (t ? A = t(S, E) : A = L.isURLSearchParams(S) ? S.toString() : new CE(S, E).toString(I), A) {
const O = _.indexOf("#");
O !== -1 && (_ = _.slice(0, O)), _ += (_.indexOf("?") === -1 ? "?" : "&") + A;
}
return _;
}
class hE {
constructor() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
use(S, E, I) {
return this.handlers.push({
fulfilled: S,
rejected: E,
synchronous: I ? I.synchronous : !1,
runWhen: I ? I.runWhen : null
}), this.handlers.length - 1;
}
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
*/
eject(S) {
this.handlers[S] && (this.handlers[S] = null);
}
/**
* Clear all interceptors from the stack
*
* @returns {void}
*/
clear() {
this.handlers && (this.handlers = []);
}
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*
* @returns {void}
*/
forEach(S) {
L.forEach(this.handlers, function(I) {
I !== null && S(I);
});
}
}
const HS = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, kI = typeof URLSearchParams < "u" ? URLSearchParams : CE, $I = typeof FormData < "u" ? FormData : null, QI = typeof Blob < "u" ? Blob : null, iI = {
isBrowser: !0,
classes: {
URLSearchParams: kI,
FormData: $I,
Blob: QI
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, sE = typeof window < "u" && typeof document < "u", EE = typeof navigator == "object" && navigator || void 0, gI = sE && (!EE || ["ReactNative", "NativeScript", "NS"].indexOf(EE.product) < 0), FI = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", xI = sE && window.location.href || "http://localhost", dI = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: sE,
hasStandardBrowserEnv: gI,
hasStandardBrowserWebWorkerEnv: FI,
navigator: EE,
origin: xI
}, Symbol.toStringTag, { value: "Module" })), w = {
...dI,
...iI
};
function pI(_, S) {
return v_(_, new w.classes.URLSearchParams(), {
visitor: function(E, I, t, A) {
return w.isNode && L.isBuffer(E) ? (this.append(I, E.toString("base64")), !1) : A.defaultVisitor.apply(this, arguments);
},
...S
});
}
function yI(_) {
return L.matchAll(/\w+|\[(\w*)]/g, _).map((S) => S[0] === "[]" ? "" : S[1] || S[0]);
}
function _A(_) {
const S = {}, E = Object.keys(_);
let I;
const t = E.length;
let A;
for (I = 0; I < t; I++)
A = E[I], S[A] = _[A];
return S;
}
function VS(_) {
function S(E, I, t, A) {
let O = E[A++];
if (O === "__proto__") return !0;
const r = Number.isFinite(+O), n = A >= E.length;
return O = !O && L.isArray(t) ? t.length : O, n ? (L.hasOwnProp(t, O) ? t[O] = [t[O], I] : t[O] = I, !r) : ((!t[O] || !L.isObject(t[O])) && (t[O] = []), S(E, I, t[O], A) && L.isArray(t[O]) && (t[O] = _A(t[O])), !r);
}
if (L.isFormData(_) && L.isFunction(_.entries)) {
const E = {};
return L.forEachEntry(_, (I, t) => {
S(yI(I), t, E, 0);
}), E;
}
return null;
}
function EA(_, S, E) {
if (L.isString(_))
try {
return (S || JSON.parse)(_), L.trim(_);
} catch (I) {
if (I.name !== "SyntaxError")
throw I;
}
return (E || JSON.stringify)(_);
}
const a_ = {
transitional: HS,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(S, E) {
const I = E.getContentType() || "", t = I.indexOf("application/json") > -1, A = L.isObject(S);
if (A && L.isHTMLForm(S) && (S = new FormData(S)), L.isFormData(S))
return t ? JSON.stringify(VS(S)) : S;
if (L.isArrayBuffer(S) || L.isBuffer(S) || L.isStream(S) || L.isFile(S) || L.isBlob(S) || L.isReadableStream(S))
return S;
if (L.isArrayBufferView(S))
return S.buffer;
if (L.isURLSearchParams(S))
return E.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), S.toString();
let r;
if (A) {
if (I.indexOf("application/x-www-form-urlencoded") > -1)
return pI(S, this.formSerializer).toString();
if ((r = L.isFileList(S)) || I.indexOf("multipart/form-data") > -1) {
const n = this.env && this.env.FormData;
return v_(
r ? { "files[]": S } : S,
n && new n(),
this.formSerializer
);
}
}
return A || t ? (E.setContentType("application/json", !1), EA(S)) : S;
}],
transformResponse: [function(S) {
const E = this.transitional || a_.transitional, I = E && E.forcedJSONParsing, t = this.responseType === "json";
if (L.isResponse(S) || L.isReadableStream(S))
return S;
if (S && L.isString(S) && (I && !this.responseType || t)) {
const O = !(E && E.silentJSONParsing) && t;
try {
return JSON.parse(S);
} catch (r) {
if (O)
throw r.name === "SyntaxError" ? P.from(r, P.ERR_BAD_RESPONSE, this, null, this.response) : r;
}
}
return S;
}],
/**
* A timeout in milliseconds to abort a request. If set to 0 (default) a
* timeout is not created.
*/
timeout: 0,
xsrfCookieName: "XSRF-TOKEN",
xsrfHeaderName: "X-XSRF-TOKEN",
maxContentLength: -1,
maxBodyLength: -1,
env: {
FormData: w.classes.FormData,
Blob: w.classes.Blob
},
validateStatus: function(S) {
return S >= 200 && S < 300;
},
headers: {
common: {
Accept: "application/json, text/plain, */*",
"Content-Type": void 0
}
}
};
L.forEach(["delete", "get", "head", "post", "put", "patch"], (_) => {
a_.headers[_] = {};
});
const SA = L.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"
]), IA = (_) => {
const S = {};
let E, I, t;
return _ && _.split(`
`).forEach(function(O) {
t = O.indexOf(":"), E = O.substring(0, t).trim().toLowerCase(), I = O.substring(t + 1).trim(), !(!E || S[E] && SA[E]) && (E === "set-cookie" ? S[E] ? S[E].push(I) : S[E] = [I] : S[E] = S[E] ? S[E] + ", " + I : I);
}), S;
}, HE = Symbol("internals");
function r_(_) {
return _ && String(_).trim().toLowerCase();
}
function u_(_) {
return _ === !1 || _ == null ? _ : L.isArray(_) ? _.map(u_) : String(_);
}
function AA(_) {
const S = /* @__PURE__ */ Object.create(null), E = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
let I;
for (; I = E.exec(_); )
S[I[1]] = I[2];
return S;
}
const tA = (_) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(_.trim());
function T_(_, S, E, I, t) {
if (L.isFunction(I))
return I.call(this, S, E);
if (t && (S = E), !!L.isString(S)) {
if (L.isString(I))
return S.indexOf(I) !== -1;
if (L.isRegExp(I))
return I.test(S);
}
}
function OA(_) {
return _.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (S, E, I) => E.toUpperCase() + I);
}
function RA(_, S) {
const E = L.toCamelCase(" " + S);
["get", "set", "has"].forEach((I) => {
Object.defineProperty(_, I + E, {
value: function(t, A, O) {
return this[I].call(this, S, t, A, O);
},
configurable: !0
});
});
}
let v = class {
constructor(S) {
S && this.set(S);
}
set(S, E, I) {
const t = this;
function A(r, n, R) {
const D = r_(n);
if (!D)
throw new Error("header name must be a non-empty string");
const M = L.findKey(t, D);
(!M || t[M] === void 0 || R === !0 || R === void 0 && t[M] !== !1) && (t[M || n] = u_(r));
}
const O = (r, n) => L.forEach(r, (R, D) => A(R, D, n));
if (L.isPlainObject(S) || S instanceof this.constructor)
O(S, E);
else if (L.isString(S) && (S = S.trim()) && !tA(S))
O(IA(S), E);
else if (L.isObject(S) && L.isIterable(S)) {
let r = {}, n, R;
for (const D of S) {
if (!L.isArray(D))
throw TypeError("Object iterator must return a key-value pair");
r[R = D[0]] = (n = r[R]) ? L.isArray(n) ? [...n, D[1]] : [n, D[1]] : D[1];
}
O(r, E);
} else
S != null && A(E, S, I);
return this;
}
get(S, E) {
if (S = r_(S), S) {
const I = L.findKey(this, S);
if (I) {
const t = this[I];
if (!E)
return t;
if (E === !0)
return AA(t);
if (L.isFunction(E))
return E.call(this, t, I);
if (L.isRegExp(E))
return E.exec(t);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(S, E) {
if (S = r_(S), S) {
const I = L.findKey(this, S);
return !!(I && this[I] !== void 0 && (!E || T_(this, this[I], I, E)));
}
return !1;
}
delete(S, E) {
const I = this;
let t = !1;
function A(O) {
if (O = r_(O), O) {
const r = L.findKey(I, O);
r && (!E || T_(I, I[r], r, E)) && (delete I[r], t = !0);
}
}
return L.isArray(S) ? S.forEach(A) : A(S), t;
}
clear(S) {
const E = Object.keys(this);
let I = E.length, t = !1;
for (; I--; ) {
const A = E[I];
(!S || T_(this, this[A], A, S, !0)) && (delete this[A], t = !0);
}
return t;
}
normalize(S) {
const E = this, I = {};
return L.forEach(this, (t, A) => {
const O = L.findKey(I, A);
if (O) {
E[O] = u_(t), delete E[A];
return;
}
const r = S ? OA(A) : String(A).trim();
r !== A && delete E[A], E[r] = u_(t), I[r] = !0;
}), this;
}
concat(...S) {
return this.constructor.concat(this, ...S);
}
toJSON(S) {
const E = /* @__PURE__ */ Object.create(null);
return L.forEach(this, (I, t) => {
I != null && I !== !1 && (E[t] = S && L.isArray(I) ? I.join(", ") : I);
}), E;
}
[Symbol.iterator]() {
return Object.entries(this.toJSON())[Symbol.iterator]();
}
toString() {
return Object.entries(this.toJSON()).map(([S, E]) => S + ": " + E).join(`
`);
}
getSetCookie() {
return this.get("set-cookie") || [];
}
get [Symbol.toStringTag]() {
return "AxiosHeaders";
}
static from(S) {
return S instanceof this ? S : new this(S);
}
static concat(S, ...E) {
const I = new this(S);
return E.forEach((t) => I.set(t)), I;
}
static accessor(S) {
const I = (this[HE] = this[HE] = {
accessors: {}
}).accessors, t = this.prototype;
function A(O) {
const r = r_(O);
I[r] || (RA(t, O), I[r] = !0);
}
return L.isArray(S) ? S.forEach(A) : A(S), this;
}
};
v.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
L.reduceDescriptors(v.prototype, ({ value: _ }, S) => {
let E = S[0].toUpperCase() + S.slice(1);
return {
get: () => _,
set(I) {
this[E] = I;
}
};
});
L.freezeMethods(v);
function z_(_, S) {
const E = this || a_, I = S || E, t = v.from(I.headers);
let A = I.data;
return L.forEach(_, function(r) {
A = r.call(E, A, t.normalize(), S ? S.status : void 0);
}), t.normalize(), A;
}
function GS(_) {
return !!(_ && _.__CANCEL__);
}
function O_(_, S, E) {
P.call(this, _ ?? "canceled", P.ERR_CANCELED, S, E), this.name = "CanceledError";
}
L.inherits(O_, P, {
__CANCEL__: !0
});
function PS(_, S, E) {
const I = E.config.validateStatus;
!E.status || !I || I(E.status) ? _(E) : S(new P(
"Request failed with status code " + E.status,
[P.ERR_BAD_REQUEST, P.ERR_BAD_RESPONSE][Math.floor(E.status / 100) - 4],
E.config,
E.request,
E
));
}
function rA(_) {
const S = /^([-+\w]{1,25})(:?\/\/|:)/.exec(_);
return S && S[1] || "";
}
function DA(_, S) {
_ = _ || 10;
const E = new Array(_), I = new Array(_);
let t = 0, A = 0, O;
return S = S !== void 0 ? S : 1e3, function(n) {
const R = Date.now(), D = I[A];
O || (O = R), E[t] = n, I[t] = R;
let M = A, a = 0;
for (; M !== t; )
a += E[M++], M = M % _;
if (t = (t + 1) % _, t === A && (A = (A + 1) % _), R - O < S)
return;
const N = D && R - D;
return N ? Math.round(a * 1e3 / N) : void 0;
};
}
function nA(_, S) {
let E = 0, I = 1e3 / S, t, A;
const O = (R, D = Date.now()) => {
E = D, t = null, A && (clearTimeout(A), A = null), _(...R);
};
return [(...R) => {
const D = Date.now(), M = D - E;
M >= I ? O(R, D) : (t = R, A || (A = setTimeout(() => {
A = null, O(t);
}, I - M)));
}, () => t && O(t)];
}
const o_ = (_, S, E = 3) => {
let I = 0;
const t = DA(50, 250);
return nA((A) => {
const O = A.loaded, r = A.lengthComputable ? A.total : void 0, n = O - I, R = t(n), D = O <= r;
I = O;
const M = {
loaded: O,
total: r,
progress: r ? O / r : void 0,
bytes: n,
rate: R || void 0,
estimated: R && r && D ? (r - O) / R : void 0,
event: A,
lengthComputable: r != null,
[S ? "download" : "upload"]: !0
};
_(M);
}, E);
}, VE = (_, S) => {
const E = _ != null;
return [(I) => S[0]({
lengthComputable: E,
total: _,
loaded: I
}), S[1]];
}, GE = (_) => (...S) => L.asap(() => _(...S)), LA = w.hasStandardBrowserEnv ? /* @__PURE__ */ ((_, S) => (E) => (E = new URL(E, w.origin), _.protocol === E.protocol && _.host === E.host && (S || _.port === E.port)))(
new URL(w.origin),
w.navigator && /(msie|trident)/i.test(w.navigator.userAgent)
) : () => !0, NA = w.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(_, S, E, I, t, A) {
const O = [_ + "=" + encodeURIComponent(S)];
L.isNumber(E) && O.push("expires=" + new Date(E).toGMTString()), L.isString(I) && O.push("path=" + I), L.isString(t) && O.push("domain=" + t), A === !0 && O.push("secure"), document.cookie = O.join("; ");
},
read(_) {
const S = document.cookie.match(new RegExp("(^|;\\s*)(" + _ + ")=([^;]*)"));
return S ? decodeURIComponent(S[3]) : null;
},
remove(_) {
this.write(_, "", Date.now() - 864e5);
}
}
) : (
// Non-standard browser env (web workers, react-native) lack needed support.
{
write() {
},
read() {
return null;
},
remove() {
}
}
);
function CA(_) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(_);
}
function sA(_, S) {
return S ? _.replace(/\/?\/$/, "") + "/" + S.replace(/^\/+/, "") : _;
}
function uS(_, S, E) {
let I = !CA(S);
return _ && (I || E == !1) ? sA(_, S) : S;
}
const PE = (_) => _ instanceof v ? { ..._ } : _;
function y(_, S) {
S = S || {};
const E = {};
function I(R, D, M, a) {
return L.isPlainObject(R) && L.isPlainObject(D) ? L.merge.call({ caseless: a }, R, D) : L.isPlainObject(D) ? L.merge({}, D) : L.isArray(D) ? D.slice() : D;
}
function t(R, D, M, a) {
if (L.isUndefined(D)) {
if (!L.isUndefined(R))
return I(void 0, R, M, a);
} else return I(R, D, M, a);
}
function A(R, D) {
if (!L.isUndefined(D))
return I(void 0, D);
}
function O(R, D) {
if (L.isUndefined(D)) {
if (!L.isUndefined(R))
return I(void 0, R);
} else return I(void 0, D);
}
function r(R, D, M) {
if (M in S)
return I(R, D);
if (M in _)
return I(void 0, R);
}
const n = {
url: A,
method: A,
data: A,
baseURL: O,
transformRequest: O,
transformResponse: O,
paramsSerializer: O,
timeout: O,
timeoutMessage: O,
withCredentials: O,
withXSRFToken: O,
adapter: O,
responseType: O,
xsrfCookieName: O,
xsrfHeaderName: O,
onUploadProgress: O,
onDownloadProgress: O,
decompress: O,
maxContentLength: O,
maxBodyLength: O,
beforeRedirect: O,
transport: O,
httpAgent: O,
httpsAgent: O,
cancelToken: O,
socketPath: O,
responseEncoding: O,
validateStatus: r,
headers: (R, D, M) => t(PE(R), PE(D), M, !0)
};
return L.forEach(Object.keys({ ..._, ...S }), function(D) {
const M = n[D] || t, a = M(_[D], S[D], D);
L.isUndefined(a) && M !== r || (E[D] = a);
}), E;
}
const mS = (_) => {
const S = y({}, _);
let { data: E, withXSRFToken: I, xsrfHeaderName: t, xsrfCookieName: A, headers: O, auth: r } = S;
S.headers = O = v.from(O), S.url = hS(uS(S.baseURL, S.url, S.allowAbsoluteUrls), _.params, _.paramsSerializer), r && O.set(
"Authorization",
"Basic " + btoa((r.username || "") + ":" + (r.password ? unescape(encodeURIComponent(r.password)) : ""))
);
let n;
if (L.isFormData(E)) {
if (w.hasStandardBrowserEnv || w.hasStandardBrowserWebWorkerEnv)
O.setContentType(void 0);
else if ((n = O.getContentType()) !== !1) {
const [R, ...D] = n ? n.split(";").map((M) => M.trim()).filter(Boolean) : [];
O.setContentType([R || "multipart/form-data", ...D].join("; "));
}
}
if (w.hasStandardBrowserEnv && (I && L.isFunction(I) && (I = I(S)), I || I !== !1 && LA(S.url))) {
const R = t && A && NA.read(A);
R && O.set(t, R);
}
return S;
}, MA = typeof XMLHttpRequest < "u", cA = MA && function(_) {
return new Promise(function(E, I) {
const t = mS(_);
let A = t.data;
const O = v.from(t.headers).normalize();
let { responseType: r, onUploadProgress: n, onDownloadProgress: R } = t, D, M, a, N, C;
function f() {
N && N(), C && C(), t.cancelToken && t.cancelToken.unsubscribe(D), t.signal && t.signal.removeEventListener("abort", D);
}
let s = new XMLHttpRequest();
s.open(t.method.toUpperCase(), t.url, !0), s.timeout = t.timeout;
function U() {
if (!s)
return;
const h = v.from(
"getAllResponseHeaders" in s && s.getAllResponseHeaders()
), V = {
data: !r || r === "text" || r === "json" ? s.responseText : s.response,
status: s.status,
statusText: s.statusText,
headers: h,
config: _,
request: s
};
PS(function(B) {
E(B), f();
}, function(B) {
I(B), f();
}, V), s = null;
}
"onloadend" in s ? s.onloadend = U : s.onreadystatechange = function() {
!s || s.readyState !== 4 || s.status === 0 && !(s.responseURL && s.responseURL.indexOf("file:") === 0) || setTimeout(U);
}, s.onabort = function() {
s && (I(new P("Request aborted", P.ECONNABORTED, _, s)), s = null);
}, s.onerror = function() {
I(new P("Network Error", P.ERR_NETWORK, _, s)), s = null;
}, s.ontimeout = function() {
let c = t.timeout ? "timeout of " + t.timeout + "ms exceeded" : "timeout exceeded";
const V = t.transitional || HS;
t.timeoutErrorMessage && (c = t.timeoutErrorMessage), I(new P(
c,
V.clarifyTimeoutError ? P.ETIMEDOUT : P.ECONNABORTED,
_,
s
)), s = null;
}, A === void 0 && O.setContentType(null), "setRequestHeader" in s && L.forEach(O.toJSON(), function(c, V) {
s.setRequestHeader(V, c);
}), L.isUndefined(t.withCredentials) || (s.withCredentials = !!t.withCredentials), r && r !== "json" && (s.responseType = t.responseType), R && ([a, C] = o_(R, !0), s.addEventListener("progress", a)), n && s.upload && ([M, N] = o_(n), s.upload.addEventListener("progress", M), s.upload.addEventListener("loadend", N)), (t.cancelToken || t.signal) && (D = (h) => {
s && (I(!h || h.type ? new O_(null, _, s) : h), s.abort(), s = null);
}, t.cancelToken && t.cancelToken.subscribe(D), t.signal && (t.signal.aborted ? D() : t.signal.addEventListener("abort", D)));
const H = rA(t.url);
if (H && w.protocols.indexOf(H) === -1) {
I(new P("Unsupported protocol " + H + ":", P.ERR_BAD_REQUEST, _));
return;
}
s.send(A || null);
});
}, aA = (_, S) => {
const { length: E } = _ = _ ? _.filter(Boolean) : [];
if (S || E) {
let I = new AbortController(), t;
const A = function(R) {
if (!t) {
t = !0, r();
const D = R instanceof Error ? R : this.reason;
I.abort(D instanceof P ? D : new O_(D instanceof Error ? D.message : D));
}
};
let O = S && setTimeout(() => {
O = null, A(new P(`timeout ${S} of ms exceeded`, P.ETIMEDOUT));
}, S);
const r = () => {
_ && (O && clearTimeout(O), O = null, _.forEach((R) => {
R.unsubscribe ? R.unsubscribe(A) : R.removeEventListener("abort", A);
}), _ = null);
};
_.forEach((R) => R.addEventListener("abort", A));
const { signal: n } = I;
return n.unsubscribe = () => L.asap(r), n;
}
}, UA = function* (_, S) {
let E = _.byteLength;
if (E < S) {
yield _;
return;
}
let I = 0, t;
for (; I < E; )
t = I + S, yield _.slice(I, t), I = t;
}, fA = async function* (_, S) {
for await (const E of BA(_))
yield* UA(E, S);
}, BA = async function* (_) {
if (_[Symbol.asyncIterator]) {
yield* _;
return;
}
const S = _.getReader();
try {
for (; ; ) {
const { done: E, value: I } = await S.read();
if (E)
break;
yield I;
}
} finally {
await S.cancel();
}
}, uE = (_, S, E, I) => {
const t = fA(_, S);
let A = 0, O, r = (n) => {
O || (O = !0, I && I(n));
};
return new ReadableStream({
async pull(n) {
try {
const { done: R, value: D } = await t.next();
if (R) {
r(), n.close();
return;
}
let M = D.byteLength;
if (E) {
let a = A += M;
E(a);
}
n.enqueue(new Uint8Array(D));
} catch (R) {
throw r(R), R;
}
},
cancel(n) {
return r(n), t.return();
}
}, {
highWaterMark: 2
});
}, W_ = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", lS = W_ && typeof ReadableStream == "function", hA = W_ && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((_) => (S) => _.encode(S))(new TextEncoder()) : async (_) => new Uint8Array(await new Response(_).arrayBuffer())), oS = (_, ...S) => {
try {
return !!_(...S);
} catch {
return !1;
}
}, HA = lS && oS(() => {
let _ = !1;
const S = new Request(w.origin, {
body: new ReadableStream(),
method: "POST",
get duplex() {
return _ = !0, "half";
}
}).headers.has("Content-Type");
return _ && !S;
}), mE = 64 * 1024, SE = lS && oS(() => L.isReadableStream(new Response("").body)), b_ = {
stream: SE && ((_) => _.body)
};
W_ && ((_) => {
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((S) => {
!b_[S] && (b_[S] = L.isFunction(_[S]) ? (E) => E[S]() : (E, I) => {
throw new P(`Response type '${S}' is not supported`, P.ERR_NOT_SUPPORT, I);
});
});
})(new Response());
const VA = async (_) => {
if (_ == null)
return 0;
if (L.isBlob(_))
return _.size;
if (L.isSpecCompliantForm(_))
return (await new Request(w.origin, {
method: "POST",
body: _
}).arrayBuffer()).byteLength;
if (L.isArrayBufferView(_) || L.isArrayBuffer(_))
return _.byteLength;
if (L.isURLSearchParams(_) && (_ = _ + ""), L.isString(_))
return (await hA(_)).byteLength;
}, GA = async (_, S) => {
const E = L.toFiniteNumber(_.getContentLength());
return E ?? VA(S);
}, PA = W_ && (async (_) => {
let {
url: S,
method: E,
data: I,
signal: t,
cancelToken: A,
timeout: O,
onDownloadProgress: r,
onUploadProgress: n,
responseType: R,
headers: D,
withCredentials: M = "same-origin",
fetchOptions: a
} = mS(_);
R = R ? (R + "").toLowerCase() : "text";
let N = aA([t, A && A.toAbortSignal()], O), C;
const f = N && N.unsubscribe && (() => {
N.unsubscribe();
});
let s;
try {
if (n && HA && E !== "get" && E !== "head" && (s = await GA(D, I)) !== 0) {
let V = new Request(S, {
method: "POST",
body: I,
duplex: "half"
}), b;
if (L.isFormData(I) && (b = V.headers.get("content-type")) && D.setContentType(b), V.body) {
const [B, l] = VE(
s,
o_(GE(n))
);
I = uE(V.body, mE, B, l);
}
}
L.isString(M) || (M = M ? "include" : "omit");
const U = "credentials" in Request.prototype;
C = new Request(S, {
...a,
signal: N,
method: E.toUpperCase(),
headers: D.normalize().toJSON(),
body: I,
duplex: "half",
credentials: U ? M : void 0
});
let H = await fetch(C, a);
const h = SE && (R === "stream" || R === "response");
if (SE && (r || h && f)) {
const V = {};
["status", "statusText", "headers"].forEach((u) => {
V[u] = H[u];
});
const b = L.toFiniteNumber(H.headers.get("content-length")), [B, l] = r && VE(
b,
o_(GE(r), !0)
) || [];
H = new Response(
uE(H.body, mE, B, () => {
l && l(), f && f();
}),
V
);
}
R = R || "text";
let c = await b_[L.findKey(b_, R) || "text"](H, _);
return !h && f && f(), await new Promise((V, b) => {
PS(V, b, {
data: c,
headers: v.from(H.headers),
status: H.status,
statusText: H.statusText,
config: _,
request: C
});
});
} catch (U) {
throw f && f(), U && U.name === "TypeError" && /Load failed|fetch/i.test(U.message) ? Object.assign(
new P("Network Error", P.ERR_NETWORK, _, C),
{
cause: U.cause || U
}
) : P.from(U, U && U.code, _, C);
}
}), IE = {
http: TI,
xhr: cA,
fetch: PA
};
L.forEach(IE, (_, S) => {
if (_) {
try {
Object.defineProperty(_, "name", { value: S });
} catch {
}
Object.defineProperty(_, "adapterName", { value: S });
}
});
const lE = (_) => `- ${_}`, uA = (_) => L.isFunction(_) || _ === null || _ === !1, bS = {
getAdapter: (_) => {
_ = L.isArray(_) ? _ : [_];
const { length: S } = _;
let E, I;
const t = {};
for (let A = 0; A < S; A++) {
E = _[A];
let O;
if (I = E, !uA(E) && (I = IE[(O = String(E)).toLowerCase()], I === void 0))
throw new P(`Unknown adapter '${O}'`);
if (I)
break;
t[O || "#" + A] = I;
}
if (!I) {
const A = Object.entries(t).map(
([r, n]) => `adapter ${r} ` + (n === !1 ? "is not supported by the environment" : "is not available in the build")
);
let O = S ? A.length > 1 ? `since :
` + A.map(lE).join(`
`) : " " + lE(A[0]) : "as no adapter specified";
throw new P(
"There is no suitable adapter to dispatch the request " + O,
"ERR_NOT_SUPPORT"
);
}
return I;
},
adapters: IE
};
function J_(_) {
if (_.cancelToken && _.cancelToken.throwIfRequested(), _.signal && _.signal.aborted)
throw new O_(null, _);
}
function oE(_) {
return J_(_), _.headers = v.from(_.headers), _.data = z_.call(
_,
_.transformRequest
), ["post", "put", "patch"].indexOf(_.method) !== -1 && _.headers.setContentType("application/x-www-form-urlencoded", !1), bS.getAdapter(_.adapter || a_.adapter)(_).then(function(I) {
return J_(_), I.data = z_.call(
_,
_.transformResponse,
I
), I.headers = v.from(I.headers), I;
}, function(I) {
return GS(I) || (J_(_), I && I.response && (I.response.data = z_.call(
_,
_.transformResponse,
I.response
), I.response.headers = v.from(I.response.headers))), Promise.reject(I);
});
}
const eS = "1.11.0", Z_ = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((_, S) => {
Z_[_] = function(I) {
return typeof I === _ || "a" + (S < 1 ? "n " : " ") + _;
};
});
const bE = {};
Z_.transitional = function(S, E, I) {
function t(A, O) {
return "[Axios v" + eS + "] Transitional option '" + A + "'" + O + (I ? ". " + I : "");
}
return (A, O, r) => {
if (S === !1)
throw new P(
t(O, " has been removed" + (E ? " in " + E : "")),
P.ERR_DEPRECATED
);
return E && !bE[O] && (bE[O] = !0, console.warn(
t(
O,
" has been deprecated since v" + E + " and will be removed in the near future"
)
)), S ? S(A, O, r) : !0;
};
};
Z_.spelling = function(S) {
return (E, I) => (console.warn(`${I} is likely a misspelling of ${S}`), !0);
};
function mA(_, S, E) {
if (typeof _ != "object")
throw new P("options must be an object", P.ERR_BAD_OPTION_VALUE);
const I = Object.keys(_);
let t = I.length;
for (; t-- > 0; ) {
const A = I[t], O = S[A];
if (O) {
const r = _[A], n = r === void 0 || O(r, A, _);
if (n !== !0)
throw new P("option " + A + " must be " + n, P.ERR_BAD_OPTION_VALUE);
continue;
}
if (E !== !0)
throw new P("Unknown option " + A, P.ERR_BAD_OPTION);
}
}
const m_ = {
assertOptions: mA,
validators: Z_
}, T = m_.validators;
let p = class {
constructor(S) {
this.defaults = S || {}, this.interceptors = {
request: new hE(),
response: new hE()
};
}
/**
* Dispatch a request
*
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
* @param {?Object} config
*
* @returns {Promise} The Promise to be fulfilled
*/
async request(S, E) {
try {
return await this._request(S, E);
} catch (I) {
if (I instanceof Error) {
let t = {};
Error.captureStackTrace ? Error.captureStackTrace(t) : t = new Error();
const A = t.stack ? t.stack.replace(/^.+\n/, "") : "";
try {
I.stack ? A && !String(I.stack).endsWith(A.replace(/^.+\n.+\n/, "")) && (I.stack += `
` + A) : I.stack = A;
} catch {
}
}
throw I;
}
}
_request(S, E) {
typeof S == "string" ? (E = E || {}, E.url = S) : E = S || {}, E = y(this.defaults, E);
const { transitional: I, paramsSerializer: t, headers: A } = E;
I !== void 0 && m_.assertOptions(I, {
silentJSONParsing: T.transitional(T.boolean),
forcedJSONParsing: T.transitional(T.boolean),
clarifyTimeoutError: T.transitional(T.boolean)
}, !1), t != null && (L.isFunction(t) ? E.paramsSerializer = {
serialize: t
} : m_.assertOptions(t, {
encode: T.function,
serialize: T.function
}, !0)), E.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? E.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : E.allowAbsoluteUrls = !0), m_.assertOptions(E, {
baseUrl: T.spelling("baseURL"),
withXsrfToken: T.spelling("withXSRFToken")
}, !0), E.method = (E.method || this.defaults.method || "get").toLowerCase();
let O = A && L.merge(
A.common,
A[E.method]
);
A && L.forEach(
["delete", "get", "head", "post", "put", "patch", "common"],
(C) => {
delete A[C];
}
), E.headers = v.concat(O, A);
const r = [];
let n = !0;
this.interceptors.request.forEach(function(f) {
typeof f.runWhen == "function" && f.runWhen(E) === !1 || (n = n && f.synchronous, r.unshift(f.fulfilled, f.rejected));
});
const R = [];
this.interceptors.response.forEach(function(f) {
R.push(f.fulfilled, f.rejected);
});
let D, M = 0, a;
if (!n) {
const C = [oE.bind(this), void 0];
for (C.unshift(...r), C.push(...R), a = C.length, D = Promise.resolve(E); M < a; )
D = D.then(C[M++], C[M++]);
return D;
}
a = r.length;
let N = E;
for (M = 0; M < a; ) {
const C = r[M++], f = r[M++];
try {
N = C(N);
} catch (s) {
f.call(this, s);
break;
}
}
try {
D = oE.call(this, N);
} catch (C) {
return Promise.reject(C);
}
for (M = 0, a = R.length; M < a; )
D = D.then(R[M++], R[M++]);
return D;
}
getUri(S) {
S = y(this.defaults, S);
const E = uS(S.baseURL, S.url, S.allowAbsoluteUrls);
return hS(E, S.params, S.paramsSerializer);
}
};
L.forEach(["delete", "get", "head", "options"], function(S) {
p.prototype[S] = function(E, I) {
return this.request(y(I || {}, {
method: S,
url: E,
data: (I || {}).data
}));
};
});
L.forEach(["post", "put", "patch"], function(S) {
function E(I) {
return function(A, O, r) {
return this.request(y(r || {}, {
method: S,
headers: I ? {
"Content-Type": "multipart/form-data"
} : {},
url: A,
data: O
}));
};
}
p.prototype[S] = E(), p.prototype[S + "Form"] = E(!0);
});
let lA = class YS {
constructor(S) {
if (typeof S != "function")
throw new TypeError("executor must be a function.");
let E;
this.promise = new Promise(function(A) {
E = A;
});
const I = this;
this.promise.then((t) => {
if (!I._listeners) return;
let A = I._listeners.length;
for (; A-- > 0; )
I._listeners[A](t);
I._listeners = null;
}), this.promise.then = (t) => {
let A;
const O = new Promise((r) => {
I.subscribe(r), A = r;
}).then(t);
return O.cancel = function() {
I.unsubscribe(A);
}, O;
}, S(function(A, O, r) {
I.reason || (I.reason = new O_(A, O, r), E(I.reason));
});
}
/**
* Throws a `CanceledError` if cancellation has been requested.
*/
throwIfRequested() {
if (this.reason)
throw this.reason;
}
/**
* Subscribe to the cancel signal
*/
subscribe(S) {
if (this.reason) {
S(this.reason);
return;
}
this._listeners ? this._listeners.push(S) : this._listeners = [S];
}
/**
* Unsubscribe from the cancel signal
*/
unsubscribe(S) {
if (!this._listeners)
return;
const E = this._listeners.indexOf(S);
E !== -1 && this._listeners.splice(E, 1);
}
toAbortSignal() {
const S = new AbortController(), E = (I) => {
S.abort(I);
};
return this.subscribe(E), S.signal.unsubscribe = () => this.unsubscribe(E), S.signal;
}
/**
* Returns an object that contains a new `CancelToken` and a function that, when called,
* cancels the `CancelToken`.
*/
static source() {
let S;
return {
token: new YS(function(t) {
S = t;
}),
cancel: S
};
}
};
function oA(_) {
return function(E) {
return _.apply(null, E);
};
}
function bA(_) {
return L.isObject(_) && _.isAxiosError === !0;
}
const AE = {
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
};
Object.entries(AE).forEach(([_, S]) => {
AE[S] = _;
});
function wS(_) {
const S = new p(_), E = DS(p.prototype.request, S);
return L.extend(E, p.prototype, S, { allOwnKeys: !0 }), L.extend(E, S, null, { allOwnKeys: !0 }), E.create = function(t) {
return wS(y(_, t));
}, E;
}
const o = wS(a_);
o.Axios = p;
o.CanceledError = O_;
o.CancelToken = lA;
o.isCancel = GS;
o.VERSION = eS;
o.toFormData = v_;
o.AxiosError = P;
o.Cancel = o.CanceledError;
o.all = function(S) {
return Promise.all(S);
};
o.spread = oA;
o.isAxiosError = bA;
o.mergeConfig = y;
o.AxiosHeaders = v;
o.formToJSON = (_) => VS(L.isHTMLForm(_) ? new FormData(_) : _);
o.getAdapter = bS.getAdapter;
o.HttpStatusCode = AE;
o.default = o;
const {
Axios: _R,
AxiosError: ER,
CanceledError: SR,
isCancel: IR,
CancelToken: AR,
VERSION: tR,
all: OR,
Cancel: RR,
is