@regulaforensics/facesdk-webclient
Version:
JS client for facesdk web service
1,711 lines • 121 kB
JavaScript
function ve(t, e) {
return function() {
return t.apply(e, arguments);
};
}
const { toString: ft } = Object.prototype, { getPrototypeOf: Te } = Object, { iterator: ce, toStringTag: qe } = Symbol, le = /* @__PURE__ */ ((t) => (e) => {
const s = ft.call(e);
return t[s] || (t[s] = s.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), U = (t) => (t = t.toLowerCase(), (e) => le(e) === t), ue = (t) => (e) => typeof e === t, { isArray: $ } = Array, K = ue("undefined");
function X(t) {
return t !== null && !K(t) && t.constructor !== null && !K(t.constructor) && N(t.constructor.isBuffer) && t.constructor.isBuffer(t);
}
const ze = U("ArrayBuffer");
function mt(t) {
let e;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && ze(t.buffer), e;
}
const Et = ue("string"), N = ue("function"), $e = ue("number"), J = (t) => t !== null && typeof t == "object", At = (t) => t === !0 || t === !1, se = (t) => {
if (le(t) !== "object")
return !1;
const e = Te(t);
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(qe in t) && !(ce in t);
}, Ot = (t) => {
if (!J(t) || X(t))
return !1;
try {
return Object.keys(t).length === 0 && Object.getPrototypeOf(t) === Object.prototype;
} catch {
return !1;
}
}, yt = U("Date"), Rt = U("File"), St = U("Blob"), gt = U("FileList"), Pt = (t) => J(t) && N(t.pipe), Tt = (t) => {
let e;
return t && (typeof FormData == "function" && t instanceof FormData || N(t.append) && ((e = le(t)) === "formdata" || // detect form-data instance
e === "object" && N(t.toString) && t.toString() === "[object FormData]"));
}, Ct = U("URLSearchParams"), [bt, _t, wt, It] = ["ReadableStream", "Request", "Response", "Headers"].map(U), Lt = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function Y(t, e, { allOwnKeys: s = !1 } = {}) {
if (t === null || typeof t > "u")
return;
let r, n;
if (typeof t != "object" && (t = [t]), $(t))
for (r = 0, n = t.length; r < n; r++)
e.call(null, t[r], r, t);
else {
if (X(t))
return;
const o = s ? Object.getOwnPropertyNames(t) : Object.keys(t), a = o.length;
let i;
for (r = 0; r < a; r++)
i = o[r], e.call(null, t[i], i, t);
}
}
function Qe(t, e) {
if (X(t))
return null;
e = e.toLowerCase();
const s = Object.keys(t);
let r = s.length, n;
for (; r-- > 0; )
if (n = s[r], e === n.toLowerCase())
return n;
return null;
}
const j = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, We = (t) => !K(t) && t !== j;
function Oe() {
const { caseless: t } = We(this) && this || {}, e = {}, s = (r, n) => {
const o = t && Qe(e, n) || n;
se(e[o]) && se(r) ? e[o] = Oe(e[o], r) : se(r) ? e[o] = Oe({}, r) : $(r) ? e[o] = r.slice() : e[o] = r;
};
for (let r = 0, n = arguments.length; r < n; r++)
arguments[r] && Y(arguments[r], s);
return e;
}
const Nt = (t, e, s, { allOwnKeys: r } = {}) => (Y(e, (n, o) => {
s && N(n) ? t[o] = ve(n, s) : t[o] = n;
}, { allOwnKeys: r }), t), Ft = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Ut = (t, e, s, r) => {
t.prototype = Object.create(e.prototype, r), t.prototype.constructor = t, Object.defineProperty(t, "super", {
value: e.prototype
}), s && Object.assign(t.prototype, s);
}, Vt = (t, e, s, r) => {
let n, o, a;
const i = {};
if (e = e || {}, t == null) return e;
do {
for (n = Object.getOwnPropertyNames(t), o = n.length; o-- > 0; )
a = n[o], (!r || r(a, t, e)) && !i[a] && (e[a] = t[a], i[a] = !0);
t = s !== !1 && Te(t);
} while (t && (!s || s(t, e)) && t !== Object.prototype);
return e;
}, Dt = (t, e, s) => {
t = String(t), (s === void 0 || s > t.length) && (s = t.length), s -= e.length;
const r = t.indexOf(e, s);
return r !== -1 && r === s;
}, Gt = (t) => {
if (!t) return null;
if ($(t)) return t;
let e = t.length;
if (!$e(e)) return null;
const s = new Array(e);
for (; e-- > 0; )
s[e] = t[e];
return s;
}, Ht = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && Te(Uint8Array)), xt = (t, e) => {
const r = (t && t[ce]).call(t);
let n;
for (; (n = r.next()) && !n.done; ) {
const o = n.value;
e.call(t, o[0], o[1]);
}
}, Bt = (t, e) => {
let s;
const r = [];
for (; (s = t.exec(e)) !== null; )
r.push(s);
return r;
}, Mt = U("HTMLFormElement"), jt = (t) => t.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(s, r, n) {
return r.toUpperCase() + n;
}
), we = (({ hasOwnProperty: t }) => (e, s) => t.call(e, s))(Object.prototype), kt = U("RegExp"), Ke = (t, e) => {
const s = Object.getOwnPropertyDescriptors(t), r = {};
Y(s, (n, o) => {
let a;
(a = e(n, o, t)) !== !1 && (r[o] = a || n);
}), Object.defineProperties(t, r);
}, vt = (t) => {
Ke(t, (e, s) => {
if (N(t) && ["arguments", "caller", "callee"].indexOf(s) !== -1)
return !1;
const r = t[s];
if (N(r)) {
if (e.enumerable = !1, "writable" in e) {
e.writable = !1;
return;
}
e.set || (e.set = () => {
throw Error("Can not rewrite read-only method '" + s + "'");
});
}
});
}, qt = (t, e) => {
const s = {}, r = (n) => {
n.forEach((o) => {
s[o] = !0;
});
};
return $(t) ? r(t) : r(String(t).split(e)), s;
}, zt = () => {
}, $t = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
function Qt(t) {
return !!(t && N(t.append) && t[qe] === "FormData" && t[ce]);
}
const Wt = (t) => {
const e = new Array(10), s = (r, n) => {
if (J(r)) {
if (e.indexOf(r) >= 0)
return;
if (X(r))
return r;
if (!("toJSON" in r)) {
e[n] = r;
const o = $(r) ? [] : {};
return Y(r, (a, i) => {
const c = s(a, n + 1);
!K(c) && (o[i] = c);
}), e[n] = void 0, o;
}
}
return r;
};
return s(t, 0);
}, Kt = U("AsyncFunction"), Xt = (t) => t && (J(t) || N(t)) && N(t.then) && N(t.catch), Xe = ((t, e) => t ? setImmediate : e ? ((s, r) => (j.addEventListener("message", ({ source: n, data: o }) => {
n === j && o === s && r.length && r.shift()();
}, !1), (n) => {
r.push(n), j.postMessage(s, "*");
}))(`axios@${Math.random()}`, []) : (s) => setTimeout(s))(
typeof setImmediate == "function",
N(j.postMessage)
), Jt = typeof queueMicrotask < "u" ? queueMicrotask.bind(j) : typeof process < "u" && process.nextTick || Xe, Yt = (t) => t != null && N(t[ce]), u = {
isArray: $,
isArrayBuffer: ze,
isBuffer: X,
isFormData: Tt,
isArrayBufferView: mt,
isString: Et,
isNumber: $e,
isBoolean: At,
isObject: J,
isPlainObject: se,
isEmptyObject: Ot,
isReadableStream: bt,
isRequest: _t,
isResponse: wt,
isHeaders: It,
isUndefined: K,
isDate: yt,
isFile: Rt,
isBlob: St,
isRegExp: kt,
isFunction: N,
isStream: Pt,
isURLSearchParams: Ct,
isTypedArray: Ht,
isFileList: gt,
forEach: Y,
merge: Oe,
extend: Nt,
trim: Lt,
stripBOM: Ft,
inherits: Ut,
toFlatObject: Vt,
kindOf: le,
kindOfTest: U,
endsWith: Dt,
toArray: Gt,
forEachEntry: xt,
matchAll: Bt,
isHTMLForm: Mt,
hasOwnProperty: we,
hasOwnProp: we,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: Ke,
freezeMethods: vt,
toObjectSet: qt,
toCamelCase: jt,
noop: zt,
toFiniteNumber: $t,
findKey: Qe,
global: j,
isContextDefined: We,
isSpecCompliantForm: Qt,
toJSONObject: Wt,
isAsyncFn: Kt,
isThenable: Xt,
setImmediate: Xe,
asap: Jt,
isIterable: Yt
};
function E(t, e, s, r, n) {
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), s && (this.config = s), r && (this.request = r), n && (this.response = n, this.status = n.status ? n.status : null);
}
u.inherits(E, 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: u.toJSONObject(this.config),
code: this.code,
status: this.status
};
}
});
const Je = E.prototype, Ye = {};
[
"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((t) => {
Ye[t] = { value: t };
});
Object.defineProperties(E, Ye);
Object.defineProperty(Je, "isAxiosError", { value: !0 });
E.from = (t, e, s, r, n, o) => {
const a = Object.create(Je);
return u.toFlatObject(t, a, function(c) {
return c !== Error.prototype;
}, (i) => i !== "isAxiosError"), E.call(a, t.message, e, s, r, n), a.cause = t, a.name = t.name, o && Object.assign(a, o), a;
};
const Zt = null;
function ye(t) {
return u.isPlainObject(t) || u.isArray(t);
}
function Ze(t) {
return u.endsWith(t, "[]") ? t.slice(0, -2) : t;
}
function Ie(t, e, s) {
return t ? t.concat(e).map(function(n, o) {
return n = Ze(n), !s && o ? "[" + n + "]" : n;
}).join(s ? "." : "") : e;
}
function es(t) {
return u.isArray(t) && !t.some(ye);
}
const ts = u.toFlatObject(u, {}, null, function(e) {
return /^is[A-Z]/.test(e);
});
function de(t, e, s) {
if (!u.isObject(t))
throw new TypeError("target must be an object");
e = e || new FormData(), s = u.toFlatObject(s, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(A, f) {
return !u.isUndefined(f[A]);
});
const r = s.metaTokens, n = s.visitor || d, o = s.dots, a = s.indexes, c = (s.Blob || typeof Blob < "u" && Blob) && u.isSpecCompliantForm(e);
if (!u.isFunction(n))
throw new TypeError("visitor must be a function");
function l(h) {
if (h === null) return "";
if (u.isDate(h))
return h.toISOString();
if (u.isBoolean(h))
return h.toString();
if (!c && u.isBlob(h))
throw new E("Blob is not supported. Use a Buffer instead.");
return u.isArrayBuffer(h) || u.isTypedArray(h) ? c && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
}
function d(h, A, f) {
let C = h;
if (h && !f && typeof h == "object") {
if (u.endsWith(A, "{}"))
A = r ? A : A.slice(0, -2), h = JSON.stringify(h);
else if (u.isArray(h) && es(h) || (u.isFileList(h) || u.endsWith(A, "[]")) && (C = u.toArray(h)))
return A = Ze(A), C.forEach(function(w, G) {
!(u.isUndefined(w) || w === null) && e.append(
// eslint-disable-next-line no-nested-ternary
a === !0 ? Ie([A], G, o) : a === null ? A : A + "[]",
l(w)
);
}), !1;
}
return ye(h) ? !0 : (e.append(Ie(f, A, o), l(h)), !1);
}
const p = [], O = Object.assign(ts, {
defaultVisitor: d,
convertValue: l,
isVisitable: ye
});
function b(h, A) {
if (!u.isUndefined(h)) {
if (p.indexOf(h) !== -1)
throw Error("Circular reference detected in " + A.join("."));
p.push(h), u.forEach(h, function(C, _) {
(!(u.isUndefined(C) || C === null) && n.call(
e,
C,
u.isString(_) ? _.trim() : _,
A,
O
)) === !0 && b(C, A ? A.concat(_) : [_]);
}), p.pop();
}
}
if (!u.isObject(t))
throw new TypeError("data must be an object");
return b(t), e;
}
function Le(t) {
const e = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(r) {
return e[r];
});
}
function Ce(t, e) {
this._pairs = [], t && de(t, this, e);
}
const et = Ce.prototype;
et.append = function(e, s) {
this._pairs.push([e, s]);
};
et.toString = function(e) {
const s = e ? function(r) {
return e.call(this, r, Le);
} : Le;
return this._pairs.map(function(n) {
return s(n[0]) + "=" + s(n[1]);
}, "").join("&");
};
function ss(t) {
return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function tt(t, e, s) {
if (!e)
return t;
const r = s && s.encode || ss;
u.isFunction(s) && (s = {
serialize: s
});
const n = s && s.serialize;
let o;
if (n ? o = n(e, s) : o = u.isURLSearchParams(e) ? e.toString() : new Ce(e, s).toString(r), o) {
const a = t.indexOf("#");
a !== -1 && (t = t.slice(0, a)), t += (t.indexOf("?") === -1 ? "?" : "&") + o;
}
return t;
}
class Ne {
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(e, s, r) {
return this.handlers.push({
fulfilled: e,
rejected: s,
synchronous: r ? r.synchronous : !1,
runWhen: r ? r.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(e) {
this.handlers[e] && (this.handlers[e] = 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(e) {
u.forEach(this.handlers, function(r) {
r !== null && e(r);
});
}
}
const st = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, rs = typeof URLSearchParams < "u" ? URLSearchParams : Ce, ns = typeof FormData < "u" ? FormData : null, os = typeof Blob < "u" ? Blob : null, as = {
isBrowser: !0,
classes: {
URLSearchParams: rs,
FormData: ns,
Blob: os
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, be = typeof window < "u" && typeof document < "u", Re = typeof navigator == "object" && navigator || void 0, is = be && (!Re || ["ReactNative", "NativeScript", "NS"].indexOf(Re.product) < 0), cs = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", ls = be && window.location.href || "http://localhost", us = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: be,
hasStandardBrowserEnv: is,
hasStandardBrowserWebWorkerEnv: cs,
navigator: Re,
origin: ls
}, Symbol.toStringTag, { value: "Module" })), I = {
...us,
...as
};
function ds(t, e) {
return de(t, new I.classes.URLSearchParams(), {
visitor: function(s, r, n, o) {
return I.isNode && u.isBuffer(s) ? (this.append(r, s.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
},
...e
});
}
function ps(t) {
return u.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
}
function hs(t) {
const e = {}, s = Object.keys(t);
let r;
const n = s.length;
let o;
for (r = 0; r < n; r++)
o = s[r], e[o] = t[o];
return e;
}
function rt(t) {
function e(s, r, n, o) {
let a = s[o++];
if (a === "__proto__") return !0;
const i = Number.isFinite(+a), c = o >= s.length;
return a = !a && u.isArray(n) ? n.length : a, c ? (u.hasOwnProp(n, a) ? n[a] = [n[a], r] : n[a] = r, !i) : ((!n[a] || !u.isObject(n[a])) && (n[a] = []), e(s, r, n[a], o) && u.isArray(n[a]) && (n[a] = hs(n[a])), !i);
}
if (u.isFormData(t) && u.isFunction(t.entries)) {
const s = {};
return u.forEachEntry(t, (r, n) => {
e(ps(r), n, s, 0);
}), s;
}
return null;
}
function fs(t, e, s) {
if (u.isString(t))
try {
return (e || JSON.parse)(t), u.trim(t);
} catch (r) {
if (r.name !== "SyntaxError")
throw r;
}
return (s || JSON.stringify)(t);
}
const Z = {
transitional: st,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(e, s) {
const r = s.getContentType() || "", n = r.indexOf("application/json") > -1, o = u.isObject(e);
if (o && u.isHTMLForm(e) && (e = new FormData(e)), u.isFormData(e))
return n ? JSON.stringify(rt(e)) : e;
if (u.isArrayBuffer(e) || u.isBuffer(e) || u.isStream(e) || u.isFile(e) || u.isBlob(e) || u.isReadableStream(e))
return e;
if (u.isArrayBufferView(e))
return e.buffer;
if (u.isURLSearchParams(e))
return s.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
let i;
if (o) {
if (r.indexOf("application/x-www-form-urlencoded") > -1)
return ds(e, this.formSerializer).toString();
if ((i = u.isFileList(e)) || r.indexOf("multipart/form-data") > -1) {
const c = this.env && this.env.FormData;
return de(
i ? { "files[]": e } : e,
c && new c(),
this.formSerializer
);
}
}
return o || n ? (s.setContentType("application/json", !1), fs(e)) : e;
}],
transformResponse: [function(e) {
const s = this.transitional || Z.transitional, r = s && s.forcedJSONParsing, n = this.responseType === "json";
if (u.isResponse(e) || u.isReadableStream(e))
return e;
if (e && u.isString(e) && (r && !this.responseType || n)) {
const a = !(s && s.silentJSONParsing) && n;
try {
return JSON.parse(e);
} catch (i) {
if (a)
throw i.name === "SyntaxError" ? E.from(i, E.ERR_BAD_RESPONSE, this, null, this.response) : i;
}
}
return e;
}],
/**
* 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: I.classes.FormData,
Blob: I.classes.Blob
},
validateStatus: function(e) {
return e >= 200 && e < 300;
},
headers: {
common: {
Accept: "application/json, text/plain, */*",
"Content-Type": void 0
}
}
};
u.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
Z.headers[t] = {};
});
const ms = u.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"
]), Es = (t) => {
const e = {};
let s, r, n;
return t && t.split(`
`).forEach(function(a) {
n = a.indexOf(":"), s = a.substring(0, n).trim().toLowerCase(), r = a.substring(n + 1).trim(), !(!s || e[s] && ms[s]) && (s === "set-cookie" ? e[s] ? e[s].push(r) : e[s] = [r] : e[s] = e[s] ? e[s] + ", " + r : r);
}), e;
}, Fe = Symbol("internals");
function W(t) {
return t && String(t).trim().toLowerCase();
}
function re(t) {
return t === !1 || t == null ? t : u.isArray(t) ? t.map(re) : String(t);
}
function As(t) {
const e = /* @__PURE__ */ Object.create(null), s = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
let r;
for (; r = s.exec(t); )
e[r[1]] = r[2];
return e;
}
const Os = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
function fe(t, e, s, r, n) {
if (u.isFunction(r))
return r.call(this, e, s);
if (n && (e = s), !!u.isString(e)) {
if (u.isString(r))
return e.indexOf(r) !== -1;
if (u.isRegExp(r))
return r.test(e);
}
}
function ys(t) {
return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, s, r) => s.toUpperCase() + r);
}
function Rs(t, e) {
const s = u.toCamelCase(" " + e);
["get", "set", "has"].forEach((r) => {
Object.defineProperty(t, r + s, {
value: function(n, o, a) {
return this[r].call(this, e, n, o, a);
},
configurable: !0
});
});
}
let F = class {
constructor(e) {
e && this.set(e);
}
set(e, s, r) {
const n = this;
function o(i, c, l) {
const d = W(c);
if (!d)
throw new Error("header name must be a non-empty string");
const p = u.findKey(n, d);
(!p || n[p] === void 0 || l === !0 || l === void 0 && n[p] !== !1) && (n[p || c] = re(i));
}
const a = (i, c) => u.forEach(i, (l, d) => o(l, d, c));
if (u.isPlainObject(e) || e instanceof this.constructor)
a(e, s);
else if (u.isString(e) && (e = e.trim()) && !Os(e))
a(Es(e), s);
else if (u.isObject(e) && u.isIterable(e)) {
let i = {}, c, l;
for (const d of e) {
if (!u.isArray(d))
throw TypeError("Object iterator must return a key-value pair");
i[l = d[0]] = (c = i[l]) ? u.isArray(c) ? [...c, d[1]] : [c, d[1]] : d[1];
}
a(i, s);
} else
e != null && o(s, e, r);
return this;
}
get(e, s) {
if (e = W(e), e) {
const r = u.findKey(this, e);
if (r) {
const n = this[r];
if (!s)
return n;
if (s === !0)
return As(n);
if (u.isFunction(s))
return s.call(this, n, r);
if (u.isRegExp(s))
return s.exec(n);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(e, s) {
if (e = W(e), e) {
const r = u.findKey(this, e);
return !!(r && this[r] !== void 0 && (!s || fe(this, this[r], r, s)));
}
return !1;
}
delete(e, s) {
const r = this;
let n = !1;
function o(a) {
if (a = W(a), a) {
const i = u.findKey(r, a);
i && (!s || fe(r, r[i], i, s)) && (delete r[i], n = !0);
}
}
return u.isArray(e) ? e.forEach(o) : o(e), n;
}
clear(e) {
const s = Object.keys(this);
let r = s.length, n = !1;
for (; r--; ) {
const o = s[r];
(!e || fe(this, this[o], o, e, !0)) && (delete this[o], n = !0);
}
return n;
}
normalize(e) {
const s = this, r = {};
return u.forEach(this, (n, o) => {
const a = u.findKey(r, o);
if (a) {
s[a] = re(n), delete s[o];
return;
}
const i = e ? ys(o) : String(o).trim();
i !== o && delete s[o], s[i] = re(n), r[i] = !0;
}), this;
}
concat(...e) {
return this.constructor.concat(this, ...e);
}
toJSON(e) {
const s = /* @__PURE__ */ Object.create(null);
return u.forEach(this, (r, n) => {
r != null && r !== !1 && (s[n] = e && u.isArray(r) ? r.join(", ") : r);
}), s;
}
[Symbol.iterator]() {
return Object.entries(this.toJSON())[Symbol.iterator]();
}
toString() {
return Object.entries(this.toJSON()).map(([e, s]) => e + ": " + s).join(`
`);
}
getSetCookie() {
return this.get("set-cookie") || [];
}
get [Symbol.toStringTag]() {
return "AxiosHeaders";
}
static from(e) {
return e instanceof this ? e : new this(e);
}
static concat(e, ...s) {
const r = new this(e);
return s.forEach((n) => r.set(n)), r;
}
static accessor(e) {
const r = (this[Fe] = this[Fe] = {
accessors: {}
}).accessors, n = this.prototype;
function o(a) {
const i = W(a);
r[i] || (Rs(n, a), r[i] = !0);
}
return u.isArray(e) ? e.forEach(o) : o(e), this;
}
};
F.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
u.reduceDescriptors(F.prototype, ({ value: t }, e) => {
let s = e[0].toUpperCase() + e.slice(1);
return {
get: () => t,
set(r) {
this[s] = r;
}
};
});
u.freezeMethods(F);
function me(t, e) {
const s = this || Z, r = e || s, n = F.from(r.headers);
let o = r.data;
return u.forEach(t, function(i) {
o = i.call(s, o, n.normalize(), e ? e.status : void 0);
}), n.normalize(), o;
}
function nt(t) {
return !!(t && t.__CANCEL__);
}
function Q(t, e, s) {
E.call(this, t ?? "canceled", E.ERR_CANCELED, e, s), this.name = "CanceledError";
}
u.inherits(Q, E, {
__CANCEL__: !0
});
function ot(t, e, s) {
const r = s.config.validateStatus;
!s.status || !r || r(s.status) ? t(s) : e(new E(
"Request failed with status code " + s.status,
[E.ERR_BAD_REQUEST, E.ERR_BAD_RESPONSE][Math.floor(s.status / 100) - 4],
s.config,
s.request,
s
));
}
function Ss(t) {
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
return e && e[1] || "";
}
function gs(t, e) {
t = t || 10;
const s = new Array(t), r = new Array(t);
let n = 0, o = 0, a;
return e = e !== void 0 ? e : 1e3, function(c) {
const l = Date.now(), d = r[o];
a || (a = l), s[n] = c, r[n] = l;
let p = o, O = 0;
for (; p !== n; )
O += s[p++], p = p % t;
if (n = (n + 1) % t, n === o && (o = (o + 1) % t), l - a < e)
return;
const b = d && l - d;
return b ? Math.round(O * 1e3 / b) : void 0;
};
}
function Ps(t, e) {
let s = 0, r = 1e3 / e, n, o;
const a = (l, d = Date.now()) => {
s = d, n = null, o && (clearTimeout(o), o = null), t(...l);
};
return [(...l) => {
const d = Date.now(), p = d - s;
p >= r ? a(l, d) : (n = l, o || (o = setTimeout(() => {
o = null, a(n);
}, r - p)));
}, () => n && a(n)];
}
const oe = (t, e, s = 3) => {
let r = 0;
const n = gs(50, 250);
return Ps((o) => {
const a = o.loaded, i = o.lengthComputable ? o.total : void 0, c = a - r, l = n(c), d = a <= i;
r = a;
const p = {
loaded: a,
total: i,
progress: i ? a / i : void 0,
bytes: c,
rate: l || void 0,
estimated: l && i && d ? (i - a) / l : void 0,
event: o,
lengthComputable: i != null,
[e ? "download" : "upload"]: !0
};
t(p);
}, s);
}, Ue = (t, e) => {
const s = t != null;
return [(r) => e[0]({
lengthComputable: s,
total: t,
loaded: r
}), e[1]];
}, Ve = (t) => (...e) => u.asap(() => t(...e)), Ts = I.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (s) => (s = new URL(s, I.origin), t.protocol === s.protocol && t.host === s.host && (e || t.port === s.port)))(
new URL(I.origin),
I.navigator && /(msie|trident)/i.test(I.navigator.userAgent)
) : () => !0, Cs = I.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(t, e, s, r, n, o) {
const a = [t + "=" + encodeURIComponent(e)];
u.isNumber(s) && a.push("expires=" + new Date(s).toGMTString()), u.isString(r) && a.push("path=" + r), u.isString(n) && a.push("domain=" + n), o === !0 && a.push("secure"), document.cookie = a.join("; ");
},
read(t) {
const e = document.cookie.match(new RegExp("(^|;\\s*)(" + t + ")=([^;]*)"));
return e ? decodeURIComponent(e[3]) : null;
},
remove(t) {
this.write(t, "", Date.now() - 864e5);
}
}
) : (
// Non-standard browser env (web workers, react-native) lack needed support.
{
write() {
},
read() {
return null;
},
remove() {
}
}
);
function bs(t) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
}
function _s(t, e) {
return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
}
function at(t, e, s) {
let r = !bs(e);
return t && (r || s == !1) ? _s(t, e) : e;
}
const De = (t) => t instanceof F ? { ...t } : t;
function v(t, e) {
e = e || {};
const s = {};
function r(l, d, p, O) {
return u.isPlainObject(l) && u.isPlainObject(d) ? u.merge.call({ caseless: O }, l, d) : u.isPlainObject(d) ? u.merge({}, d) : u.isArray(d) ? d.slice() : d;
}
function n(l, d, p, O) {
if (u.isUndefined(d)) {
if (!u.isUndefined(l))
return r(void 0, l, p, O);
} else return r(l, d, p, O);
}
function o(l, d) {
if (!u.isUndefined(d))
return r(void 0, d);
}
function a(l, d) {
if (u.isUndefined(d)) {
if (!u.isUndefined(l))
return r(void 0, l);
} else return r(void 0, d);
}
function i(l, d, p) {
if (p in e)
return r(l, d);
if (p in t)
return r(void 0, l);
}
const c = {
url: o,
method: o,
data: o,
baseURL: a,
transformRequest: a,
transformResponse: a,
paramsSerializer: a,
timeout: a,
timeoutMessage: a,
withCredentials: a,
withXSRFToken: a,
adapter: a,
responseType: a,
xsrfCookieName: a,
xsrfHeaderName: a,
onUploadProgress: a,
onDownloadProgress: a,
decompress: a,
maxContentLength: a,
maxBodyLength: a,
beforeRedirect: a,
transport: a,
httpAgent: a,
httpsAgent: a,
cancelToken: a,
socketPath: a,
responseEncoding: a,
validateStatus: i,
headers: (l, d, p) => n(De(l), De(d), p, !0)
};
return u.forEach(Object.keys({ ...t, ...e }), function(d) {
const p = c[d] || n, O = p(t[d], e[d], d);
u.isUndefined(O) && p !== i || (s[d] = O);
}), s;
}
const it = (t) => {
const e = v({}, t);
let { data: s, withXSRFToken: r, xsrfHeaderName: n, xsrfCookieName: o, headers: a, auth: i } = e;
e.headers = a = F.from(a), e.url = tt(at(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), i && a.set(
"Authorization",
"Basic " + btoa((i.username || "") + ":" + (i.password ? unescape(encodeURIComponent(i.password)) : ""))
);
let c;
if (u.isFormData(s)) {
if (I.hasStandardBrowserEnv || I.hasStandardBrowserWebWorkerEnv)
a.setContentType(void 0);
else if ((c = a.getContentType()) !== !1) {
const [l, ...d] = c ? c.split(";").map((p) => p.trim()).filter(Boolean) : [];
a.setContentType([l || "multipart/form-data", ...d].join("; "));
}
}
if (I.hasStandardBrowserEnv && (r && u.isFunction(r) && (r = r(e)), r || r !== !1 && Ts(e.url))) {
const l = n && o && Cs.read(o);
l && a.set(n, l);
}
return e;
}, ws = typeof XMLHttpRequest < "u", Is = ws && function(t) {
return new Promise(function(s, r) {
const n = it(t);
let o = n.data;
const a = F.from(n.headers).normalize();
let { responseType: i, onUploadProgress: c, onDownloadProgress: l } = n, d, p, O, b, h;
function A() {
b && b(), h && h(), n.cancelToken && n.cancelToken.unsubscribe(d), n.signal && n.signal.removeEventListener("abort", d);
}
let f = new XMLHttpRequest();
f.open(n.method.toUpperCase(), n.url, !0), f.timeout = n.timeout;
function C() {
if (!f)
return;
const w = F.from(
"getAllResponseHeaders" in f && f.getAllResponseHeaders()
), L = {
data: !i || i === "text" || i === "json" ? f.responseText : f.response,
status: f.status,
statusText: f.statusText,
headers: w,
config: t,
request: f
};
ot(function(B) {
s(B), A();
}, function(B) {
r(B), A();
}, L), f = null;
}
"onloadend" in f ? f.onloadend = C : f.onreadystatechange = function() {
!f || f.readyState !== 4 || f.status === 0 && !(f.responseURL && f.responseURL.indexOf("file:") === 0) || setTimeout(C);
}, f.onabort = function() {
f && (r(new E("Request aborted", E.ECONNABORTED, t, f)), f = null);
}, f.onerror = function() {
r(new E("Network Error", E.ERR_NETWORK, t, f)), f = null;
}, f.ontimeout = function() {
let G = n.timeout ? "timeout of " + n.timeout + "ms exceeded" : "timeout exceeded";
const L = n.transitional || st;
n.timeoutErrorMessage && (G = n.timeoutErrorMessage), r(new E(
G,
L.clarifyTimeoutError ? E.ETIMEDOUT : E.ECONNABORTED,
t,
f
)), f = null;
}, o === void 0 && a.setContentType(null), "setRequestHeader" in f && u.forEach(a.toJSON(), function(G, L) {
f.setRequestHeader(L, G);
}), u.isUndefined(n.withCredentials) || (f.withCredentials = !!n.withCredentials), i && i !== "json" && (f.responseType = n.responseType), l && ([O, h] = oe(l, !0), f.addEventListener("progress", O)), c && f.upload && ([p, b] = oe(c), f.upload.addEventListener("progress", p), f.upload.addEventListener("loadend", b)), (n.cancelToken || n.signal) && (d = (w) => {
f && (r(!w || w.type ? new Q(null, t, f) : w), f.abort(), f = null);
}, n.cancelToken && n.cancelToken.subscribe(d), n.signal && (n.signal.aborted ? d() : n.signal.addEventListener("abort", d)));
const _ = Ss(n.url);
if (_ && I.protocols.indexOf(_) === -1) {
r(new E("Unsupported protocol " + _ + ":", E.ERR_BAD_REQUEST, t));
return;
}
f.send(o || null);
});
}, Ls = (t, e) => {
const { length: s } = t = t ? t.filter(Boolean) : [];
if (e || s) {
let r = new AbortController(), n;
const o = function(l) {
if (!n) {
n = !0, i();
const d = l instanceof Error ? l : this.reason;
r.abort(d instanceof E ? d : new Q(d instanceof Error ? d.message : d));
}
};
let a = e && setTimeout(() => {
a = null, o(new E(`timeout ${e} of ms exceeded`, E.ETIMEDOUT));
}, e);
const i = () => {
t && (a && clearTimeout(a), a = null, t.forEach((l) => {
l.unsubscribe ? l.unsubscribe(o) : l.removeEventListener("abort", o);
}), t = null);
};
t.forEach((l) => l.addEventListener("abort", o));
const { signal: c } = r;
return c.unsubscribe = () => u.asap(i), c;
}
}, Ns = function* (t, e) {
let s = t.byteLength;
if (s < e) {
yield t;
return;
}
let r = 0, n;
for (; r < s; )
n = r + e, yield t.slice(r, n), r = n;
}, Fs = async function* (t, e) {
for await (const s of Us(t))
yield* Ns(s, e);
}, Us = async function* (t) {
if (t[Symbol.asyncIterator]) {
yield* t;
return;
}
const e = t.getReader();
try {
for (; ; ) {
const { done: s, value: r } = await e.read();
if (s)
break;
yield r;
}
} finally {
await e.cancel();
}
}, Ge = (t, e, s, r) => {
const n = Fs(t, e);
let o = 0, a, i = (c) => {
a || (a = !0, r && r(c));
};
return new ReadableStream({
async pull(c) {
try {
const { done: l, value: d } = await n.next();
if (l) {
i(), c.close();
return;
}
let p = d.byteLength;
if (s) {
let O = o += p;
s(O);
}
c.enqueue(new Uint8Array(d));
} catch (l) {
throw i(l), l;
}
},
cancel(c) {
return i(c), n.return();
}
}, {
highWaterMark: 2
});
}, pe = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", ct = pe && typeof ReadableStream == "function", Vs = pe && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((t) => (e) => t.encode(e))(new TextEncoder()) : async (t) => new Uint8Array(await new Response(t).arrayBuffer())), lt = (t, ...e) => {
try {
return !!t(...e);
} catch {
return !1;
}
}, Ds = ct && lt(() => {
let t = !1;
const e = new Request(I.origin, {
body: new ReadableStream(),
method: "POST",
get duplex() {
return t = !0, "half";
}
}).headers.has("Content-Type");
return t && !e;
}), He = 64 * 1024, Se = ct && lt(() => u.isReadableStream(new Response("").body)), ae = {
stream: Se && ((t) => t.body)
};
pe && ((t) => {
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((e) => {
!ae[e] && (ae[e] = u.isFunction(t[e]) ? (s) => s[e]() : (s, r) => {
throw new E(`Response type '${e}' is not supported`, E.ERR_NOT_SUPPORT, r);
});
});
})(new Response());
const Gs = async (t) => {
if (t == null)
return 0;
if (u.isBlob(t))
return t.size;
if (u.isSpecCompliantForm(t))
return (await new Request(I.origin, {
method: "POST",
body: t
}).arrayBuffer()).byteLength;
if (u.isArrayBufferView(t) || u.isArrayBuffer(t))
return t.byteLength;
if (u.isURLSearchParams(t) && (t = t + ""), u.isString(t))
return (await Vs(t)).byteLength;
}, Hs = async (t, e) => {
const s = u.toFiniteNumber(t.getContentLength());
return s ?? Gs(e);
}, xs = pe && (async (t) => {
let {
url: e,
method: s,
data: r,
signal: n,
cancelToken: o,
timeout: a,
onDownloadProgress: i,
onUploadProgress: c,
responseType: l,
headers: d,
withCredentials: p = "same-origin",
fetchOptions: O
} = it(t);
l = l ? (l + "").toLowerCase() : "text";
let b = Ls([n, o && o.toAbortSignal()], a), h;
const A = b && b.unsubscribe && (() => {
b.unsubscribe();
});
let f;
try {
if (c && Ds && s !== "get" && s !== "head" && (f = await Hs(d, r)) !== 0) {
let L = new Request(e, {
method: "POST",
body: r,
duplex: "half"
}), x;
if (u.isFormData(r) && (x = L.headers.get("content-type")) && d.setContentType(x), L.body) {
const [B, ee] = Ue(
f,
oe(Ve(c))
);
r = Ge(L.body, He, B, ee);
}
}
u.isString(p) || (p = p ? "include" : "omit");
const C = "credentials" in Request.prototype;
h = new Request(e, {
...O,
signal: b,
method: s.toUpperCase(),
headers: d.normalize().toJSON(),
body: r,
duplex: "half",
credentials: C ? p : void 0
});
let _ = await fetch(h, O);
const w = Se && (l === "stream" || l === "response");
if (Se && (i || w && A)) {
const L = {};
["status", "statusText", "headers"].forEach((_e) => {
L[_e] = _[_e];
});
const x = u.toFiniteNumber(_.headers.get("content-length")), [B, ee] = i && Ue(
x,
oe(Ve(i), !0)
) || [];
_ = new Response(
Ge(_.body, He, B, () => {
ee && ee(), A && A();
}),
L
);
}
l = l || "text";
let G = await ae[u.findKey(ae, l) || "text"](_, t);
return !w && A && A(), await new Promise((L, x) => {
ot(L, x, {
data: G,
headers: F.from(_.headers),
status: _.status,
statusText: _.statusText,
config: t,
request: h
});
});
} catch (C) {
throw A && A(), C && C.name === "TypeError" && /Load failed|fetch/i.test(C.message) ? Object.assign(
new E("Network Error", E.ERR_NETWORK, t, h),
{
cause: C.cause || C
}
) : E.from(C, C && C.code, t, h);
}
}), ge = {
http: Zt,
xhr: Is,
fetch: xs
};
u.forEach(ge, (t, e) => {
if (t) {
try {
Object.defineProperty(t, "name", { value: e });
} catch {
}
Object.defineProperty(t, "adapterName", { value: e });
}
});
const xe = (t) => `- ${t}`, Bs = (t) => u.isFunction(t) || t === null || t === !1, ut = {
getAdapter: (t) => {
t = u.isArray(t) ? t : [t];
const { length: e } = t;
let s, r;
const n = {};
for (let o = 0; o < e; o++) {
s = t[o];
let a;
if (r = s, !Bs(s) && (r = ge[(a = String(s)).toLowerCase()], r === void 0))
throw new E(`Unknown adapter '${a}'`);
if (r)
break;
n[a || "#" + o] = r;
}
if (!r) {
const o = Object.entries(n).map(
([i, c]) => `adapter ${i} ` + (c === !1 ? "is not supported by the environment" : "is not available in the build")
);
let a = e ? o.length > 1 ? `since :
` + o.map(xe).join(`
`) : " " + xe(o[0]) : "as no adapter specified";
throw new E(
"There is no suitable adapter to dispatch the request " + a,
"ERR_NOT_SUPPORT"
);
}
return r;
},
adapters: ge
};
function Ee(t) {
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
throw new Q(null, t);
}
function Be(t) {
return Ee(t), t.headers = F.from(t.headers), t.data = me.call(
t,
t.transformRequest
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), ut.getAdapter(t.adapter || Z.adapter)(t).then(function(r) {
return Ee(t), r.data = me.call(
t,
t.transformResponse,
r
), r.headers = F.from(r.headers), r;
}, function(r) {
return nt(r) || (Ee(t), r && r.response && (r.response.data = me.call(
t,
t.transformResponse,
r.response
), r.response.headers = F.from(r.response.headers))), Promise.reject(r);
});
}
const dt = "1.11.0", he = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
he[t] = function(r) {
return typeof r === t || "a" + (e < 1 ? "n " : " ") + t;
};
});
const Me = {};
he.transitional = function(e, s, r) {
function n(o, a) {
return "[Axios v" + dt + "] Transitional option '" + o + "'" + a + (r ? ". " + r : "");
}
return (o, a, i) => {
if (e === !1)
throw new E(
n(a, " has been removed" + (s ? " in " + s : "")),
E.ERR_DEPRECATED
);
return s && !Me[a] && (Me[a] = !0, console.warn(
n(
a,
" has been deprecated since v" + s + " and will be removed in the near future"
)
)), e ? e(o, a, i) : !0;
};
};
he.spelling = function(e) {
return (s, r) => (console.warn(`${r} is likely a misspelling of ${e}`), !0);
};
function Ms(t, e, s) {
if (typeof t != "object")
throw new E("options must be an object", E.ERR_BAD_OPTION_VALUE);
const r = Object.keys(t);
let n = r.length;
for (; n-- > 0; ) {
const o = r[n], a = e[o];
if (a) {
const i = t[o], c = i === void 0 || a(i, o, t);
if (c !== !0)
throw new E("option " + o + " must be " + c, E.ERR_BAD_OPTION_VALUE);
continue;
}
if (s !== !0)
throw new E("Unknown option " + o, E.ERR_BAD_OPTION);
}
}
const ne = {
assertOptions: Ms,
validators: he
}, V = ne.validators;
let k = class {
constructor(e) {
this.defaults = e || {}, this.interceptors = {
request: new Ne(),
response: new Ne()
};
}
/**
* 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(e, s) {
try {
return await this._request(e, s);
} catch (r) {
if (r instanceof Error) {
let n = {};
Error.captureStackTrace ? Error.captureStackTrace(n) : n = new Error();
const o = n.stack ? n.stack.replace(/^.+\n/, "") : "";
try {
r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
` + o) : r.stack = o;
} catch {
}
}
throw r;
}
}
_request(e, s) {
typeof e == "string" ? (s = s || {}, s.url = e) : s = e || {}, s = v(this.defaults, s);
const { transitional: r, paramsSerializer: n, headers: o } = s;
r !== void 0 && ne.assertOptions(r, {
silentJSONParsing: V.transitional(V.boolean),
forcedJSONParsing: V.transitional(V.boolean),
clarifyTimeoutError: V.transitional(V.boolean)
}, !1), n != null && (u.isFunction(n) ? s.paramsSerializer = {
serialize: n
} : ne.assertOptions(n, {
encode: V.function,
serialize: V.function
}, !0)), s.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? s.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : s.allowAbsoluteUrls = !0), ne.assertOptions(s, {
baseUrl: V.spelling("baseURL"),
withXsrfToken: V.spelling("withXSRFToken")
}, !0), s.method = (s.method || this.defaults.method || "get").toLowerCase();
let a = o && u.merge(
o.common,
o[s.method]
);
o && u.forEach(
["delete", "get", "head", "post", "put", "patch", "common"],
(h) => {
delete o[h];
}
), s.headers = F.concat(a, o);
const i = [];
let c = !0;
this.interceptors.request.forEach(function(A) {
typeof A.runWhen == "function" && A.runWhen(s) === !1 || (c = c && A.synchronous, i.unshift(A.fulfilled, A.rejected));
});
const l = [];
this.interceptors.response.forEach(function(A) {
l.push(A.fulfilled, A.rejected);
});
let d, p = 0, O;
if (!c) {
const h = [Be.bind(this), void 0];
for (h.unshift(...i), h.push(...l), O = h.length, d = Promise.resolve(s); p < O; )
d = d.then(h[p++], h[p++]);
return d;
}
O = i.length;
let b = s;
for (p = 0; p < O; ) {
const h = i[p++], A = i[p++];
try {
b = h(b);
} catch (f) {
A.call(this, f);
break;
}
}
try {
d = Be.call(this, b);
} catch (h) {
return Promise.reject(h);
}
for (p = 0, O = l.length; p < O; )
d = d.then(l[p++], l[p++]);
return d;
}
getUri(e) {
e = v(this.defaults, e);
const s = at(e.baseURL, e.url, e.allowAbsoluteUrls);
return tt(s, e.params, e.paramsSerializer);
}
};
u.forEach(["delete", "get", "head", "options"], function(e) {
k.prototype[e] = function(s, r) {
return this.request(v(r || {}, {
method: e,
url: s,
data: (r || {}).data
}));
};
});
u.forEach(["post", "put", "patch"], function(e) {
function s(r) {
return function(o, a, i) {
return this.request(v(i || {}, {
method: e,
headers: r ? {
"Content-Type": "multipart/form-data"
} : {},
url: o,
data: a
}));
};
}
k.prototype[e] = s(), k.prototype[e + "Form"] = s(!0);
});
let js = class pt {
constructor(e) {
if (typeof e != "function")
throw new TypeError("executor must be a function.");
let s;
this.promise = new Promise(function(o) {
s = o;
});
const r = this;
this.promise.then((n) => {
if (!r._listeners) return;
let o = r._listeners.length;
for (; o-- > 0; )
r._listeners[o](n);
r._listeners = null;
}), this.promise.then = (n) => {
let o;
const a = new Promise((i) => {
r.subscribe(i), o = i;
}).then(n);
return a.cancel = function() {
r.unsubscribe(o);
}, a;
}, e(function(o, a, i) {
r.reason || (r.reason = new Q(o, a, i), s(r.reason));
});
}
/**
* Throws a `CanceledError` if cancellation has been requested.
*/
throwIfRequested() {
if (this.reason)
throw this.reason;
}
/**
* Subscribe to the cancel signal
*/
subscribe(e) {
if (this.reason) {
e(this.reason);
return;
}
this._listeners ? this._listeners.push(e) : this._listeners = [e];
}
/**
* Unsubscribe from the cancel signal
*/
unsubscribe(e) {
if (!this._listeners)
return;
const s = this._listeners.indexOf(e);
s !== -1 && this._listeners.splice(s, 1);
}
toAbortSignal() {
const e = new AbortController(), s = (r) => {
e.abort(r);
};
return this.subscribe(s), e.signal.unsubscribe = () => this.unsubscribe(s), e.signal;
}
/**
* Returns an object that contains a new `CancelToken` and a function that, when called,
* cancels the `CancelToken`.
*/
static source() {
let e;
return {
token: new pt(function(n) {
e = n;
}),
cancel: e
};
}
};
function ks(t) {
return function(s) {
return t.apply(null, s);
};
}
function vs(t) {
return u.isObject(t) && t.isAxiosError === !0;
}
const Pe = {
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(Pe).forEach(([t, e]) => {
Pe[e] = t;
});
function ht(t) {
const e = new k(t), s = ve(k.prototype.request, e);
return u.extend(s, k.prototype, e, { allOwnKeys: !0 }), u.extend(s, e, null, { allOwnKeys: !0 }), s.create = function(n) {
return ht(v(t, n));
}, s;
}
const m = ht(Z);
m.Axios = k;
m.CanceledError = Q;
m.CancelToken = js;
m.isCancel = nt;
m.VERSION = dt;
m.toFormData = de;
m.AxiosError = E;
m.Cancel = m.CanceledError;
m.all = function(e) {
return Promise.all(e);
};
m.spread = ks;
m.isAxiosError = vs;
m.mergeConfig = v;
m.AxiosHeaders = F;
m.formToJSON = (t) => rt(u.isHTMLForm(t) ? new FormData(t) : t);
m.getAdapter = ut.getAdapter;
m.HttpStatusCode = Pe;
m.default = m;
const {
Axios: Ar,
AxiosError: Or,
CanceledError: yr,
isCancel: Rr,
CancelToken: Sr,
VERSION: gr,
all: Pr,
Cancel: Tr,
isAxiosError: Cr,
spread: br,
toFormData