qlfy-unified-login
Version:
实现统一认证登陆功能的逻辑插件,无实际渲染标签,内置统一登陆跳转、统一登录token获取、统一登陆token刷新等功能;
1,670 lines • 94.9 kB
JavaScript
import { getCurrentInstance as ne, inject as te, ref as B, computed as O, unref as b, readonly as Wn, getCurrentScope as Gn, onScopeDispose as Zn, onMounted as Jt, nextTick as Kt, watch as re, isRef as Xn, warn as Qn, provide as Yn, defineComponent as U, createElementBlock as q, openBlock as I, mergeProps as er, renderSlot as pe, createElementVNode as V, normalizeClass as H, createVNode as Ye, Transition as Wt, withCtx as Se, withDirectives as Gt, normalizeStyle as Zt, createTextVNode as tr, toDisplayString as Xt, vShow as Qt, shallowReactive as nr, createBlock as ue, createCommentVNode as _e, resolveDynamicComponent as rr, Fragment as or, withModifiers as sr, isVNode as Yt, render as dt, onBeforeUnmount as ir } from "vue";
function en(e, t) {
return function() {
return e.apply(t, arguments);
};
}
const { toString: ar } = Object.prototype, { getPrototypeOf: et } = Object, { iterator: Pe, toStringTag: tn } = Symbol, Ie = /* @__PURE__ */ ((e) => (t) => {
const n = ar.call(t);
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), M = (e) => (e = e.toLowerCase(), (t) => Ie(t) === e), Le = (e) => (t) => typeof t === e, { isArray: ie } = Array, me = Le("undefined");
function lr(e) {
return e !== null && !me(e) && e.constructor !== null && !me(e.constructor) && L(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const nn = M("ArrayBuffer");
function cr(e) {
let t;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && nn(e.buffer), t;
}
const ur = Le("string"), L = Le("function"), rn = Le("number"), ke = (e) => e !== null && typeof e == "object", fr = (e) => e === !0 || e === !1, Ee = (e) => {
if (Ie(e) !== "object")
return !1;
const t = et(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(tn in e) && !(Pe in e);
}, dr = M("Date"), pr = M("File"), mr = M("Blob"), hr = M("FileList"), gr = (e) => ke(e) && L(e.pipe), yr = (e) => {
let t;
return e && (typeof FormData == "function" && e instanceof FormData || L(e.append) && ((t = Ie(e)) === "formdata" || // detect form-data instance
t === "object" && L(e.toString) && e.toString() === "[object FormData]"));
}, br = M("URLSearchParams"), [wr, _r, vr, Sr] = ["ReadableStream", "Request", "Response", "Headers"].map(M), Er = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function ye(e, t, { allOwnKeys: n = !1 } = {}) {
if (e === null || typeof e > "u")
return;
let r, o;
if (typeof e != "object" && (e = [e]), ie(e))
for (r = 0, o = e.length; r < o; r++)
t.call(null, e[r], r, e);
else {
const i = n ? Object.getOwnPropertyNames(e) : Object.keys(e), s = i.length;
let a;
for (r = 0; r < s; r++)
a = i[r], t.call(null, e[a], a, e);
}
}
function on(e, t) {
t = t.toLowerCase();
const n = Object.keys(e);
let r = n.length, o;
for (; r-- > 0; )
if (o = n[r], t === o.toLowerCase())
return o;
return null;
}
const K = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, sn = (e) => !me(e) && e !== K;
function Je() {
const { caseless: e } = sn(this) && this || {}, t = {}, n = (r, o) => {
const i = e && on(t, o) || o;
Ee(t[i]) && Ee(r) ? t[i] = Je(t[i], r) : Ee(r) ? t[i] = Je({}, r) : ie(r) ? t[i] = r.slice() : t[i] = r;
};
for (let r = 0, o = arguments.length; r < o; r++)
arguments[r] && ye(arguments[r], n);
return t;
}
const Or = (e, t, n, { allOwnKeys: r } = {}) => (ye(t, (o, i) => {
n && L(o) ? e[i] = en(o, n) : e[i] = o;
}, { allOwnKeys: r }), e), Tr = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Cr = (e, t, n, r) => {
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
value: t.prototype
}), n && Object.assign(e.prototype, n);
}, xr = (e, t, n, r) => {
let o, i, s;
const a = {};
if (t = t || {}, e == null) return t;
do {
for (o = Object.getOwnPropertyNames(e), i = o.length; i-- > 0; )
s = o[i], (!r || r(s, e, t)) && !a[s] && (t[s] = e[s], a[s] = !0);
e = n !== !1 && et(e);
} while (e && (!n || n(e, t)) && e !== Object.prototype);
return t;
}, Rr = (e, t, n) => {
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
const r = e.indexOf(t, n);
return r !== -1 && r === n;
}, Nr = (e) => {
if (!e) return null;
if (ie(e)) return e;
let t = e.length;
if (!rn(t)) return null;
const n = new Array(t);
for (; t-- > 0; )
n[t] = e[t];
return n;
}, Ar = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && et(Uint8Array)), Pr = (e, t) => {
const r = (e && e[Pe]).call(e);
let o;
for (; (o = r.next()) && !o.done; ) {
const i = o.value;
t.call(e, i[0], i[1]);
}
}, Ir = (e, t) => {
let n;
const r = [];
for (; (n = e.exec(t)) !== null; )
r.push(n);
return r;
}, Lr = M("HTMLFormElement"), kr = (e) => e.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(n, r, o) {
return r.toUpperCase() + o;
}
), pt = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), $r = M("RegExp"), an = (e, t) => {
const n = Object.getOwnPropertyDescriptors(e), r = {};
ye(n, (o, i) => {
let s;
(s = t(o, i, e)) !== !1 && (r[i] = s || o);
}), Object.defineProperties(e, r);
}, Fr = (e) => {
an(e, (t, n) => {
if (L(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
return !1;
const r = e[n];
if (L(r)) {
if (t.enumerable = !1, "writable" in t) {
t.writable = !1;
return;
}
t.set || (t.set = () => {
throw Error("Can not rewrite read-only method '" + n + "'");
});
}
});
}, Br = (e, t) => {
const n = {}, r = (o) => {
o.forEach((i) => {
n[i] = !0;
});
};
return ie(e) ? r(e) : r(String(e).split(t)), n;
}, Ur = () => {
}, Dr = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
function jr(e) {
return !!(e && L(e.append) && e[tn] === "FormData" && e[Pe]);
}
const Mr = (e) => {
const t = new Array(10), n = (r, o) => {
if (ke(r)) {
if (t.indexOf(r) >= 0)
return;
if (!("toJSON" in r)) {
t[o] = r;
const i = ie(r) ? [] : {};
return ye(r, (s, a) => {
const f = n(s, o + 1);
!me(f) && (i[a] = f);
}), t[o] = void 0, i;
}
}
return r;
};
return n(e, 0);
}, zr = M("AsyncFunction"), qr = (e) => e && (ke(e) || L(e)) && L(e.then) && L(e.catch), ln = ((e, t) => e ? setImmediate : t ? ((n, r) => (K.addEventListener("message", ({ source: o, data: i }) => {
o === K && i === n && r.length && r.shift()();
}, !1), (o) => {
r.push(o), K.postMessage(n, "*");
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
typeof setImmediate == "function",
L(K.postMessage)
), Hr = typeof queueMicrotask < "u" ? queueMicrotask.bind(K) : typeof process < "u" && process.nextTick || ln, Vr = (e) => e != null && L(e[Pe]), l = {
isArray: ie,
isArrayBuffer: nn,
isBuffer: lr,
isFormData: yr,
isArrayBufferView: cr,
isString: ur,
isNumber: rn,
isBoolean: fr,
isObject: ke,
isPlainObject: Ee,
isReadableStream: wr,
isRequest: _r,
isResponse: vr,
isHeaders: Sr,
isUndefined: me,
isDate: dr,
isFile: pr,
isBlob: mr,
isRegExp: $r,
isFunction: L,
isStream: gr,
isURLSearchParams: br,
isTypedArray: Ar,
isFileList: hr,
forEach: ye,
merge: Je,
extend: Or,
trim: Er,
stripBOM: Tr,
inherits: Cr,
toFlatObject: xr,
kindOf: Ie,
kindOfTest: M,
endsWith: Rr,
toArray: Nr,
forEachEntry: Pr,
matchAll: Ir,
isHTMLForm: Lr,
hasOwnProperty: pt,
hasOwnProp: pt,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: an,
freezeMethods: Fr,
toObjectSet: Br,
toCamelCase: kr,
noop: Ur,
toFiniteNumber: Dr,
findKey: on,
global: K,
isContextDefined: sn,
isSpecCompliantForm: jr,
toJSONObject: Mr,
isAsyncFn: zr,
isThenable: qr,
setImmediate: ln,
asap: Hr,
isIterable: Vr
};
function y(e, t, n, r, o) {
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), o && (this.response = o, this.status = o.status ? o.status : null);
}
l.inherits(y, 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 cn = y.prototype, un = {};
[
"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((e) => {
un[e] = { value: e };
});
Object.defineProperties(y, un);
Object.defineProperty(cn, "isAxiosError", { value: !0 });
y.from = (e, t, n, r, o, i) => {
const s = Object.create(cn);
return l.toFlatObject(e, s, function(f) {
return f !== Error.prototype;
}, (a) => a !== "isAxiosError"), y.call(s, e.message, t, n, r, o), s.cause = e, s.name = e.name, i && Object.assign(s, i), s;
};
const Jr = null;
function Ke(e) {
return l.isPlainObject(e) || l.isArray(e);
}
function fn(e) {
return l.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function mt(e, t, n) {
return e ? e.concat(t).map(function(o, i) {
return o = fn(o), !n && i ? "[" + o + "]" : o;
}).join(n ? "." : "") : t;
}
function Kr(e) {
return l.isArray(e) && !e.some(Ke);
}
const Wr = l.toFlatObject(l, {}, null, function(t) {
return /^is[A-Z]/.test(t);
});
function $e(e, t, n) {
if (!l.isObject(e))
throw new TypeError("target must be an object");
t = t || new FormData(), n = l.toFlatObject(n, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(d, p) {
return !l.isUndefined(p[d]);
});
const r = n.metaTokens, o = n.visitor || c, i = n.dots, s = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && l.isSpecCompliantForm(t);
if (!l.isFunction(o))
throw new TypeError("visitor must be a function");
function u(h) {
if (h === null) return "";
if (l.isDate(h))
return h.toISOString();
if (l.isBoolean(h))
return h.toString();
if (!f && l.isBlob(h))
throw new y("Blob is not supported. Use a Buffer instead.");
return l.isArrayBuffer(h) || l.isTypedArray(h) ? f && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
}
function c(h, d, p) {
let w = h;
if (h && !p && typeof h == "object") {
if (l.endsWith(d, "{}"))
d = r ? d : d.slice(0, -2), h = JSON.stringify(h);
else if (l.isArray(h) && Kr(h) || (l.isFileList(h) || l.endsWith(d, "[]")) && (w = l.toArray(h)))
return d = fn(d), w.forEach(function(x, _) {
!(l.isUndefined(x) || x === null) && t.append(
// eslint-disable-next-line no-nested-ternary
s === !0 ? mt([d], _, i) : s === null ? d : d + "[]",
u(x)
);
}), !1;
}
return Ke(h) ? !0 : (t.append(mt(p, d, i), u(h)), !1);
}
const m = [], g = Object.assign(Wr, {
defaultVisitor: c,
convertValue: u,
isVisitable: Ke
});
function S(h, d) {
if (!l.isUndefined(h)) {
if (m.indexOf(h) !== -1)
throw Error("Circular reference detected in " + d.join("."));
m.push(h), l.forEach(h, function(w, T) {
(!(l.isUndefined(w) || w === null) && o.call(
t,
w,
l.isString(T) ? T.trim() : T,
d,
g
)) === !0 && S(w, d ? d.concat(T) : [T]);
}), m.pop();
}
}
if (!l.isObject(e))
throw new TypeError("data must be an object");
return S(e), t;
}
function ht(e) {
const t = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
return t[r];
});
}
function tt(e, t) {
this._pairs = [], e && $e(e, this, t);
}
const dn = tt.prototype;
dn.append = function(t, n) {
this._pairs.push([t, n]);
};
dn.toString = function(t) {
const n = t ? function(r) {
return t.call(this, r, ht);
} : ht;
return this._pairs.map(function(o) {
return n(o[0]) + "=" + n(o[1]);
}, "").join("&");
};
function Gr(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function pn(e, t, n) {
if (!t)
return e;
const r = n && n.encode || Gr;
l.isFunction(n) && (n = {
serialize: n
});
const o = n && n.serialize;
let i;
if (o ? i = o(t, n) : i = l.isURLSearchParams(t) ? t.toString() : new tt(t, n).toString(r), i) {
const s = e.indexOf("#");
s !== -1 && (e = e.slice(0, s)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
}
return e;
}
class gt {
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(t, n, r) {
return this.handlers.push({
fulfilled: t,
rejected: n,
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(t) {
this.handlers[t] && (this.handlers[t] = 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(t) {
l.forEach(this.handlers, function(r) {
r !== null && t(r);
});
}
}
const mn = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, Zr = typeof URLSearchParams < "u" ? URLSearchParams : tt, Xr = typeof FormData < "u" ? FormData : null, Qr = typeof Blob < "u" ? Blob : null, Yr = {
isBrowser: !0,
classes: {
URLSearchParams: Zr,
FormData: Xr,
Blob: Qr
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, nt = typeof window < "u" && typeof document < "u", We = typeof navigator == "object" && navigator || void 0, eo = nt && (!We || ["ReactNative", "NativeScript", "NS"].indexOf(We.product) < 0), to = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", no = nt && window.location.href || "http://localhost", ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: nt,
hasStandardBrowserEnv: eo,
hasStandardBrowserWebWorkerEnv: to,
navigator: We,
origin: no
}, Symbol.toStringTag, { value: "Module" })), A = {
...ro,
...Yr
};
function oo(e, t) {
return $e(e, new A.classes.URLSearchParams(), Object.assign({
visitor: function(n, r, o, i) {
return A.isNode && l.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
}
}, t));
}
function so(e) {
return l.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function io(e) {
const t = {}, n = Object.keys(e);
let r;
const o = n.length;
let i;
for (r = 0; r < o; r++)
i = n[r], t[i] = e[i];
return t;
}
function hn(e) {
function t(n, r, o, i) {
let s = n[i++];
if (s === "__proto__") return !0;
const a = Number.isFinite(+s), f = i >= n.length;
return s = !s && l.isArray(o) ? o.length : s, f ? (l.hasOwnProp(o, s) ? o[s] = [o[s], r] : o[s] = r, !a) : ((!o[s] || !l.isObject(o[s])) && (o[s] = []), t(n, r, o[s], i) && l.isArray(o[s]) && (o[s] = io(o[s])), !a);
}
if (l.isFormData(e) && l.isFunction(e.entries)) {
const n = {};
return l.forEachEntry(e, (r, o) => {
t(so(r), o, n, 0);
}), n;
}
return null;
}
function ao(e, t, n) {
if (l.isString(e))
try {
return (t || JSON.parse)(e), l.trim(e);
} catch (r) {
if (r.name !== "SyntaxError")
throw r;
}
return (n || JSON.stringify)(e);
}
const be = {
transitional: mn,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(t, n) {
const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, i = l.isObject(t);
if (i && l.isHTMLForm(t) && (t = new FormData(t)), l.isFormData(t))
return o ? JSON.stringify(hn(t)) : t;
if (l.isArrayBuffer(t) || l.isBuffer(t) || l.isStream(t) || l.isFile(t) || l.isBlob(t) || l.isReadableStream(t))
return t;
if (l.isArrayBufferView(t))
return t.buffer;
if (l.isURLSearchParams(t))
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
let a;
if (i) {
if (r.indexOf("application/x-www-form-urlencoded") > -1)
return oo(t, this.formSerializer).toString();
if ((a = l.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
const f = this.env && this.env.FormData;
return $e(
a ? { "files[]": t } : t,
f && new f(),
this.formSerializer
);
}
}
return i || o ? (n.setContentType("application/json", !1), ao(t)) : t;
}],
transformResponse: [function(t) {
const n = this.transitional || be.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
if (l.isResponse(t) || l.isReadableStream(t))
return t;
if (t && l.isString(t) && (r && !this.responseType || o)) {
const s = !(n && n.silentJSONParsing) && o;
try {
return JSON.parse(t);
} catch (a) {
if (s)
throw a.name === "SyntaxError" ? y.from(a, y.ERR_BAD_RESPONSE, this, null, this.response) : a;
}
}
return t;
}],
/**
* 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: A.classes.FormData,
Blob: A.classes.Blob
},
validateStatus: function(t) {
return t >= 200 && t < 300;
},
headers: {
common: {
Accept: "application/json, text/plain, */*",
"Content-Type": void 0
}
}
};
l.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
be.headers[e] = {};
});
const lo = 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"
]), co = (e) => {
const t = {};
let n, r, o;
return e && e.split(`
`).forEach(function(s) {
o = s.indexOf(":"), n = s.substring(0, o).trim().toLowerCase(), r = s.substring(o + 1).trim(), !(!n || t[n] && lo[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
}), t;
}, yt = Symbol("internals");
function fe(e) {
return e && String(e).trim().toLowerCase();
}
function Oe(e) {
return e === !1 || e == null ? e : l.isArray(e) ? e.map(Oe) : String(e);
}
function uo(e) {
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
let r;
for (; r = n.exec(e); )
t[r[1]] = r[2];
return t;
}
const fo = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
function Me(e, t, n, r, o) {
if (l.isFunction(r))
return r.call(this, t, n);
if (o && (t = n), !!l.isString(t)) {
if (l.isString(r))
return t.indexOf(r) !== -1;
if (l.isRegExp(r))
return r.test(t);
}
}
function po(e) {
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
}
function mo(e, t) {
const n = l.toCamelCase(" " + t);
["get", "set", "has"].forEach((r) => {
Object.defineProperty(e, r + n, {
value: function(o, i, s) {
return this[r].call(this, t, o, i, s);
},
configurable: !0
});
});
}
let k = class {
constructor(t) {
t && this.set(t);
}
set(t, n, r) {
const o = this;
function i(a, f, u) {
const c = fe(f);
if (!c)
throw new Error("header name must be a non-empty string");
const m = l.findKey(o, c);
(!m || o[m] === void 0 || u === !0 || u === void 0 && o[m] !== !1) && (o[m || f] = Oe(a));
}
const s = (a, f) => l.forEach(a, (u, c) => i(u, c, f));
if (l.isPlainObject(t) || t instanceof this.constructor)
s(t, n);
else if (l.isString(t) && (t = t.trim()) && !fo(t))
s(co(t), n);
else if (l.isObject(t) && l.isIterable(t)) {
let a = {}, f, u;
for (const c of t) {
if (!l.isArray(c))
throw TypeError("Object iterator must return a key-value pair");
a[u = c[0]] = (f = a[u]) ? l.isArray(f) ? [...f, c[1]] : [f, c[1]] : c[1];
}
s(a, n);
} else
t != null && i(n, t, r);
return this;
}
get(t, n) {
if (t = fe(t), t) {
const r = l.findKey(this, t);
if (r) {
const o = this[r];
if (!n)
return o;
if (n === !0)
return uo(o);
if (l.isFunction(n))
return n.call(this, o, r);
if (l.isRegExp(n))
return n.exec(o);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(t, n) {
if (t = fe(t), t) {
const r = l.findKey(this, t);
return !!(r && this[r] !== void 0 && (!n || Me(this, this[r], r, n)));
}
return !1;
}
delete(t, n) {
const r = this;
let o = !1;
function i(s) {
if (s = fe(s), s) {
const a = l.findKey(r, s);
a && (!n || Me(r, r[a], a, n)) && (delete r[a], o = !0);
}
}
return l.isArray(t) ? t.forEach(i) : i(t), o;
}
clear(t) {
const n = Object.keys(this);
let r = n.length, o = !1;
for (; r--; ) {
const i = n[r];
(!t || Me(this, this[i], i, t, !0)) && (delete this[i], o = !0);
}
return o;
}
normalize(t) {
const n = this, r = {};
return l.forEach(this, (o, i) => {
const s = l.findKey(r, i);
if (s) {
n[s] = Oe(o), delete n[i];
return;
}
const a = t ? po(i) : String(i).trim();
a !== i && delete n[i], n[a] = Oe(o), r[a] = !0;
}), this;
}
concat(...t) {
return this.constructor.concat(this, ...t);
}
toJSON(t) {
const n = /* @__PURE__ */ Object.create(null);
return l.forEach(this, (r, o) => {
r != null && r !== !1 && (n[o] = t && l.isArray(r) ? r.join(", ") : r);
}), n;
}
[Symbol.iterator]() {
return Object.entries(this.toJSON())[Symbol.iterator]();
}
toString() {
return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
`);
}
getSetCookie() {
return this.get("set-cookie") || [];
}
get [Symbol.toStringTag]() {
return "AxiosHeaders";
}
static from(t) {
return t instanceof this ? t : new this(t);
}
static concat(t, ...n) {
const r = new this(t);
return n.forEach((o) => r.set(o)), r;
}
static accessor(t) {
const r = (this[yt] = this[yt] = {
accessors: {}
}).accessors, o = this.prototype;
function i(s) {
const a = fe(s);
r[a] || (mo(o, s), r[a] = !0);
}
return l.isArray(t) ? t.forEach(i) : i(t), this;
}
};
k.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
l.reduceDescriptors(k.prototype, ({ value: e }, t) => {
let n = t[0].toUpperCase() + t.slice(1);
return {
get: () => e,
set(r) {
this[n] = r;
}
};
});
l.freezeMethods(k);
function ze(e, t) {
const n = this || be, r = t || n, o = k.from(r.headers);
let i = r.data;
return l.forEach(e, function(a) {
i = a.call(n, i, o.normalize(), t ? t.status : void 0);
}), o.normalize(), i;
}
function gn(e) {
return !!(e && e.__CANCEL__);
}
function ae(e, t, n) {
y.call(this, e ?? "canceled", y.ERR_CANCELED, t, n), this.name = "CanceledError";
}
l.inherits(ae, y, {
__CANCEL__: !0
});
function yn(e, t, n) {
const r = n.config.validateStatus;
!n.status || !r || r(n.status) ? e(n) : t(new y(
"Request failed with status code " + n.status,
[y.ERR_BAD_REQUEST, y.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
n.config,
n.request,
n
));
}
function ho(e) {
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
return t && t[1] || "";
}
function go(e, t) {
e = e || 10;
const n = new Array(e), r = new Array(e);
let o = 0, i = 0, s;
return t = t !== void 0 ? t : 1e3, function(f) {
const u = Date.now(), c = r[i];
s || (s = u), n[o] = f, r[o] = u;
let m = i, g = 0;
for (; m !== o; )
g += n[m++], m = m % e;
if (o = (o + 1) % e, o === i && (i = (i + 1) % e), u - s < t)
return;
const S = c && u - c;
return S ? Math.round(g * 1e3 / S) : void 0;
};
}
function yo(e, t) {
let n = 0, r = 1e3 / t, o, i;
const s = (u, c = Date.now()) => {
n = c, o = null, i && (clearTimeout(i), i = null), e.apply(null, u);
};
return [(...u) => {
const c = Date.now(), m = c - n;
m >= r ? s(u, c) : (o = u, i || (i = setTimeout(() => {
i = null, s(o);
}, r - m)));
}, () => o && s(o)];
}
const xe = (e, t, n = 3) => {
let r = 0;
const o = go(50, 250);
return yo((i) => {
const s = i.loaded, a = i.lengthComputable ? i.total : void 0, f = s - r, u = o(f), c = s <= a;
r = s;
const m = {
loaded: s,
total: a,
progress: a ? s / a : void 0,
bytes: f,
rate: u || void 0,
estimated: u && a && c ? (a - s) / u : void 0,
event: i,
lengthComputable: a != null,
[t ? "download" : "upload"]: !0
};
e(m);
}, n);
}, bt = (e, t) => {
const n = e != null;
return [(r) => t[0]({
lengthComputable: n,
total: e,
loaded: r
}), t[1]];
}, wt = (e) => (...t) => l.asap(() => e(...t)), bo = A.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, A.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
new URL(A.origin),
A.navigator && /(msie|trident)/i.test(A.navigator.userAgent)
) : () => !0, wo = A.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(e, t, n, r, o, i) {
const s = [e + "=" + encodeURIComponent(t)];
l.isNumber(n) && s.push("expires=" + new Date(n).toGMTString()), l.isString(r) && s.push("path=" + r), l.isString(o) && s.push("domain=" + o), i === !0 && s.push("secure"), document.cookie = s.join("; ");
},
read(e) {
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
return t ? decodeURIComponent(t[3]) : null;
},
remove(e) {
this.write(e, "", Date.now() - 864e5);
}
}
) : (
// Non-standard browser env (web workers, react-native) lack needed support.
{
write() {
},
read() {
return null;
},
remove() {
}
}
);
function _o(e) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}
function vo(e, t) {
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
}
function bn(e, t, n) {
let r = !_o(t);
return e && (r || n == !1) ? vo(e, t) : t;
}
const _t = (e) => e instanceof k ? { ...e } : e;
function X(e, t) {
t = t || {};
const n = {};
function r(u, c, m, g) {
return l.isPlainObject(u) && l.isPlainObject(c) ? l.merge.call({ caseless: g }, u, c) : l.isPlainObject(c) ? l.merge({}, c) : l.isArray(c) ? c.slice() : c;
}
function o(u, c, m, g) {
if (l.isUndefined(c)) {
if (!l.isUndefined(u))
return r(void 0, u, m, g);
} else return r(u, c, m, g);
}
function i(u, c) {
if (!l.isUndefined(c))
return r(void 0, c);
}
function s(u, c) {
if (l.isUndefined(c)) {
if (!l.isUndefined(u))
return r(void 0, u);
} else return r(void 0, c);
}
function a(u, c, m) {
if (m in t)
return r(u, c);
if (m in e)
return r(void 0, u);
}
const f = {
url: i,
method: i,
data: i,
baseURL: s,
transformRequest: s,
transformResponse: s,
paramsSerializer: s,
timeout: s,
timeoutMessage: s,
withCredentials: s,
withXSRFToken: s,
adapter: s,
responseType: s,
xsrfCookieName: s,
xsrfHeaderName: s,
onUploadProgress: s,
onDownloadProgress: s,
decompress: s,
maxContentLength: s,
maxBodyLength: s,
beforeRedirect: s,
transport: s,
httpAgent: s,
httpsAgent: s,
cancelToken: s,
socketPath: s,
responseEncoding: s,
validateStatus: a,
headers: (u, c, m) => o(_t(u), _t(c), m, !0)
};
return l.forEach(Object.keys(Object.assign({}, e, t)), function(c) {
const m = f[c] || o, g = m(e[c], t[c], c);
l.isUndefined(g) && m !== a || (n[c] = g);
}), n;
}
const wn = (e) => {
const t = X({}, e);
let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: i, headers: s, auth: a } = t;
t.headers = s = k.from(s), t.url = pn(bn(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && s.set(
"Authorization",
"Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
);
let f;
if (l.isFormData(n)) {
if (A.hasStandardBrowserEnv || A.hasStandardBrowserWebWorkerEnv)
s.setContentType(void 0);
else if ((f = s.getContentType()) !== !1) {
const [u, ...c] = f ? f.split(";").map((m) => m.trim()).filter(Boolean) : [];
s.setContentType([u || "multipart/form-data", ...c].join("; "));
}
}
if (A.hasStandardBrowserEnv && (r && l.isFunction(r) && (r = r(t)), r || r !== !1 && bo(t.url))) {
const u = o && i && wo.read(i);
u && s.set(o, u);
}
return t;
}, So = typeof XMLHttpRequest < "u", Eo = So && function(e) {
return new Promise(function(n, r) {
const o = wn(e);
let i = o.data;
const s = k.from(o.headers).normalize();
let { responseType: a, onUploadProgress: f, onDownloadProgress: u } = o, c, m, g, S, h;
function d() {
S && S(), h && h(), o.cancelToken && o.cancelToken.unsubscribe(c), o.signal && o.signal.removeEventListener("abort", c);
}
let p = new XMLHttpRequest();
p.open(o.method.toUpperCase(), o.url, !0), p.timeout = o.timeout;
function w() {
if (!p)
return;
const x = k.from(
"getAllResponseHeaders" in p && p.getAllResponseHeaders()
), v = {
data: !a || a === "text" || a === "json" ? p.responseText : p.response,
status: p.status,
statusText: p.statusText,
headers: x,
config: e,
request: p
};
yn(function(C) {
n(C), d();
}, function(C) {
r(C), d();
}, v), p = null;
}
"onloadend" in p ? p.onloadend = w : p.onreadystatechange = function() {
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(w);
}, p.onabort = function() {
p && (r(new y("Request aborted", y.ECONNABORTED, e, p)), p = null);
}, p.onerror = function() {
r(new y("Network Error", y.ERR_NETWORK, e, p)), p = null;
}, p.ontimeout = function() {
let _ = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
const v = o.transitional || mn;
o.timeoutErrorMessage && (_ = o.timeoutErrorMessage), r(new y(
_,
v.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
e,
p
)), p = null;
}, i === void 0 && s.setContentType(null), "setRequestHeader" in p && l.forEach(s.toJSON(), function(_, v) {
p.setRequestHeader(v, _);
}), l.isUndefined(o.withCredentials) || (p.withCredentials = !!o.withCredentials), a && a !== "json" && (p.responseType = o.responseType), u && ([g, h] = xe(u, !0), p.addEventListener("progress", g)), f && p.upload && ([m, S] = xe(f), p.upload.addEventListener("progress", m), p.upload.addEventListener("loadend", S)), (o.cancelToken || o.signal) && (c = (x) => {
p && (r(!x || x.type ? new ae(null, e, p) : x), p.abort(), p = null);
}, o.cancelToken && o.cancelToken.subscribe(c), o.signal && (o.signal.aborted ? c() : o.signal.addEventListener("abort", c)));
const T = ho(o.url);
if (T && A.protocols.indexOf(T) === -1) {
r(new y("Unsupported protocol " + T + ":", y.ERR_BAD_REQUEST, e));
return;
}
p.send(i || null);
});
}, Oo = (e, t) => {
const { length: n } = e = e ? e.filter(Boolean) : [];
if (t || n) {
let r = new AbortController(), o;
const i = function(u) {
if (!o) {
o = !0, a();
const c = u instanceof Error ? u : this.reason;
r.abort(c instanceof y ? c : new ae(c instanceof Error ? c.message : c));
}
};
let s = t && setTimeout(() => {
s = null, i(new y(`timeout ${t} of ms exceeded`, y.ETIMEDOUT));
}, t);
const a = () => {
e && (s && clearTimeout(s), s = null, e.forEach((u) => {
u.unsubscribe ? u.unsubscribe(i) : u.removeEventListener("abort", i);
}), e = null);
};
e.forEach((u) => u.addEventListener("abort", i));
const { signal: f } = r;
return f.unsubscribe = () => l.asap(a), f;
}
}, To = function* (e, t) {
let n = e.byteLength;
if (n < t) {
yield e;
return;
}
let r = 0, o;
for (; r < n; )
o = r + t, yield e.slice(r, o), r = o;
}, Co = async function* (e, t) {
for await (const n of xo(e))
yield* To(n, t);
}, xo = async function* (e) {
if (e[Symbol.asyncIterator]) {
yield* e;
return;
}
const t = e.getReader();
try {
for (; ; ) {
const { done: n, value: r } = await t.read();
if (n)
break;
yield r;
}
} finally {
await t.cancel();
}
}, vt = (e, t, n, r) => {
const o = Co(e, t);
let i = 0, s, a = (f) => {
s || (s = !0, r && r(f));
};
return new ReadableStream({
async pull(f) {
try {
const { done: u, value: c } = await o.next();
if (u) {
a(), f.close();
return;
}
let m = c.byteLength;
if (n) {
let g = i += m;
n(g);
}
f.enqueue(new Uint8Array(c));
} catch (u) {
throw a(u), u;
}
},
cancel(f) {
return a(f), o.return();
}
}, {
highWaterMark: 2
});
}, Fe = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", _n = Fe && typeof ReadableStream == "function", Ro = Fe && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), vn = (e, ...t) => {
try {
return !!e(...t);
} catch {
return !1;
}
}, No = _n && vn(() => {
let e = !1;
const t = new Request(A.origin, {
body: new ReadableStream(),
method: "POST",
get duplex() {
return e = !0, "half";
}
}).headers.has("Content-Type");
return e && !t;
}), St = 64 * 1024, Ge = _n && vn(() => l.isReadableStream(new Response("").body)), Re = {
stream: Ge && ((e) => e.body)
};
Fe && ((e) => {
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
!Re[t] && (Re[t] = l.isFunction(e[t]) ? (n) => n[t]() : (n, r) => {
throw new y(`Response type '${t}' is not supported`, y.ERR_NOT_SUPPORT, r);
});
});
})(new Response());
const Ao = async (e) => {
if (e == null)
return 0;
if (l.isBlob(e))
return e.size;
if (l.isSpecCompliantForm(e))
return (await new Request(A.origin, {
method: "POST",
body: e
}).arrayBuffer()).byteLength;
if (l.isArrayBufferView(e) || l.isArrayBuffer(e))
return e.byteLength;
if (l.isURLSearchParams(e) && (e = e + ""), l.isString(e))
return (await Ro(e)).byteLength;
}, Po = async (e, t) => {
const n = l.toFiniteNumber(e.getContentLength());
return n ?? Ao(t);
}, Io = Fe && (async (e) => {
let {
url: t,
method: n,
data: r,
signal: o,
cancelToken: i,
timeout: s,
onDownloadProgress: a,
onUploadProgress: f,
responseType: u,
headers: c,
withCredentials: m = "same-origin",
fetchOptions: g
} = wn(e);
u = u ? (u + "").toLowerCase() : "text";
let S = Oo([o, i && i.toAbortSignal()], s), h;
const d = S && S.unsubscribe && (() => {
S.unsubscribe();
});
let p;
try {
if (f && No && n !== "get" && n !== "head" && (p = await Po(c, r)) !== 0) {
let v = new Request(t, {
method: "POST",
body: r,
duplex: "half"
}), N;
if (l.isFormData(r) && (N = v.headers.get("content-type")) && c.setContentType(N), v.body) {
const [C, $] = bt(
p,
xe(wt(f))
);
r = vt(v.body, St, C, $);
}
}
l.isString(m) || (m = m ? "include" : "omit");
const w = "credentials" in Request.prototype;
h = new Request(t, {
...g,
signal: S,
method: n.toUpperCase(),
headers: c.normalize().toJSON(),
body: r,
duplex: "half",
credentials: w ? m : void 0
});
let T = await fetch(h, g);
const x = Ge && (u === "stream" || u === "response");
if (Ge && (a || x && d)) {
const v = {};
["status", "statusText", "headers"].forEach((E) => {
v[E] = T[E];
});
const N = l.toFiniteNumber(T.headers.get("content-length")), [C, $] = a && bt(
N,
xe(wt(a), !0)
) || [];
T = new Response(
vt(T.body, St, C, () => {
$ && $(), d && d();
}),
v
);
}
u = u || "text";
let _ = await Re[l.findKey(Re, u) || "text"](T, e);
return !x && d && d(), await new Promise((v, N) => {
yn(v, N, {
data: _,
headers: k.from(T.headers),
status: T.status,
statusText: T.statusText,
config: e,
request: h
});
});
} catch (w) {
throw d && d(), w && w.name === "TypeError" && /Load failed|fetch/i.test(w.message) ? Object.assign(
new y("Network Error", y.ERR_NETWORK, e, h),
{
cause: w.cause || w
}
) : y.from(w, w && w.code, e, h);
}
}), Ze = {
http: Jr,
xhr: Eo,
fetch: Io
};
l.forEach(Ze, (e, t) => {
if (e) {
try {
Object.defineProperty(e, "name", { value: t });
} catch {
}
Object.defineProperty(e, "adapterName", { value: t });
}
});
const Et = (e) => `- ${e}`, Lo = (e) => l.isFunction(e) || e === null || e === !1, Sn = {
getAdapter: (e) => {
e = l.isArray(e) ? e : [e];
const { length: t } = e;
let n, r;
const o = {};
for (let i = 0; i < t; i++) {
n = e[i];
let s;
if (r = n, !Lo(n) && (r = Ze[(s = String(n)).toLowerCase()], r === void 0))
throw new y(`Unknown adapter '${s}'`);
if (r)
break;
o[s || "#" + i] = r;
}
if (!r) {
const i = Object.entries(o).map(
([a, f]) => `adapter ${a} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
);
let s = t ? i.length > 1 ? `since :
` + i.map(Et).join(`
`) : " " + Et(i[0]) : "as no adapter specified";
throw new y(
"There is no suitable adapter to dispatch the request " + s,
"ERR_NOT_SUPPORT"
);
}
return r;
},
adapters: Ze
};
function qe(e) {
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
throw new ae(null, e);
}
function Ot(e) {
return qe(e), e.headers = k.from(e.headers), e.data = ze.call(
e,
e.transformRequest
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Sn.getAdapter(e.adapter || be.adapter)(e).then(function(r) {
return qe(e), r.data = ze.call(
e,
e.transformResponse,
r
), r.headers = k.from(r.headers), r;
}, function(r) {
return gn(r) || (qe(e), r && r.response && (r.response.data = ze.call(
e,
e.transformResponse,
r.response
), r.response.headers = k.from(r.response.headers))), Promise.reject(r);
});
}
const En = "1.10.0", Be = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
Be[e] = function(r) {
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
};
});
const Tt = {};
Be.transitional = function(t, n, r) {
function o(i, s) {
return "[Axios v" + En + "] Transitional option '" + i + "'" + s + (r ? ". " + r : "");
}
return (i, s, a) => {
if (t === !1)
throw new y(
o(s, " has been removed" + (n ? " in " + n : "")),
y.ERR_DEPRECATED
);
return n && !Tt[s] && (Tt[s] = !0, console.warn(
o(
s,
" has been deprecated since v" + n + " and will be removed in the near future"
)
)), t ? t(i, s, a) : !0;
};
};
Be.spelling = function(t) {
return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
};
function ko(e, t, n) {
if (typeof e != "object")
throw new y("options must be an object", y.ERR_BAD_OPTION_VALUE);
const r = Object.keys(e);
let o = r.length;
for (; o-- > 0; ) {
const i = r[o], s = t[i];
if (s) {
const a = e[i], f = a === void 0 || s(a, i, e);
if (f !== !0)
throw new y("option " + i + " must be " + f, y.ERR_BAD_OPTION_VALUE);
continue;
}
if (n !== !0)
throw new y("Unknown option " + i, y.ERR_BAD_OPTION);
}
}
const Te = {
assertOptions: ko,
validators: Be
}, z = Te.validators;
let G = class {
constructor(t) {
this.defaults = t || {}, this.interceptors = {
request: new gt(),
response: new gt()
};
}
/**
* 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(t, n) {
try {
return await this._request(t, n);
} catch (r) {
if (r instanceof Error) {
let o = {};
Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
const i = o.stack ? o.stack.replace(/^.+\n/, "") : "";
try {
r.stack ? i && !String(r.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (r.stack += `
` + i) : r.stack = i;
} catch {
}
}
throw r;
}
}
_request(t, n) {
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = X(this.defaults, n);
const { transitional: r, paramsSerializer: o, headers: i } = n;
r !== void 0 && Te.assertOptions(r, {
silentJSONParsing: z.transitional(z.boolean),
forcedJSONParsing: z.transitional(z.boolean),
clarifyTimeoutError: z.transitional(z.boolean)
}, !1), o != null && (l.isFunction(o) ? n.paramsSerializer = {
serialize: o
} : Te.assertOptions(o, {
encode: z.function,
serialize: z.function
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), Te.assertOptions(n, {
baseUrl: z.spelling("baseURL"),
withXsrfToken: z.spelling("withXSRFToken")
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
let s = i && l.merge(
i.common,
i[n.method]
);
i && l.forEach(
["delete", "get", "head", "post", "put", "patch", "common"],
(h) => {
delete i[h];
}
), n.headers = k.concat(s, i);
const a = [];
let f = !0;
this.interceptors.request.forEach(function(d) {
typeof d.runWhen == "function" && d.runWhen(n) === !1 || (f = f && d.synchronous, a.unshift(d.fulfilled, d.rejected));
});
const u = [];
this.interceptors.response.forEach(function(d) {
u.push(d.fulfilled, d.rejected);
});
let c, m = 0, g;
if (!f) {
const h = [Ot.bind(this), void 0];
for (h.unshift.apply(h, a), h.push.apply(h, u), g = h.length, c = Promise.resolve(n); m < g; )
c = c.then(h[m++], h[m++]);
return c;
}
g = a.length;
let S = n;
for (m = 0; m < g; ) {
const h = a[m++], d = a[m++];
try {
S = h(S);
} catch (p) {
d.call(this, p);
break;
}
}
try {
c = Ot.call(this, S);
} catch (h) {
return Promise.reject(h);
}
for (m = 0, g = u.length; m < g; )
c = c.then(u[m++], u[m++]);
return c;
}
getUri(t) {
t = X(this.defaults, t);
const n = bn(t.baseURL, t.url, t.allowAbsoluteUrls);
return pn(n, t.params, t.paramsSerializer);
}
};
l.forEach(["delete", "get", "head", "options"], function(t) {
G.prototype[t] = function(n, r) {
return this.request(X(r || {}, {
method: t,
url: n,
data: (r || {}).data
}));
};
});
l.forEach(["post", "put", "patch"], function(t) {
function n(r) {
return function(i, s, a) {
return this.request(X(a || {}, {
method: t,
headers: r ? {
"Content-Type": "multipart/form-data"
} : {},
url: i,
data: s
}));
};
}
G.prototype[t] = n(), G.prototype[t + "Form"] = n(!0);
});
let $o = class On {
constructor(t) {
if (typeof t != "function")
throw new TypeError("executor must be a function.");
let n;
this.promise = new Promise(function(i) {
n = i;
});
const r = this;
this.promise.then((o) => {
if (!r._listeners) return;
let i = r._listeners.length;
for (; i-- > 0; )
r._listeners[i](o);
r._listeners = null;
}), this.promise.then = (o) => {
let i;
const s = new Promise((a) => {
r.subscribe(a), i = a;
}).then(o);
return s.cancel = function() {
r.unsubscribe(i);
}, s;
}, t(function(i, s, a) {
r.reason || (r.reason = new ae(i, s, a), n(r.reason));
});
}
/**
* Throws a `CanceledError` if cancellation has been requested.
*/
throwIfRequested() {
if (this.reason)
throw this.reason;
}
/**
* Subscribe to the cancel signal
*/
subscribe(t) {
if (this.reason) {
t(this.reason);
return;
}
this._listeners ? this._listeners.push(t) : this._listeners = [t];
}
/**
* Unsubscribe from the cancel signal
*/
unsubscribe(t) {
if (!this._listeners)
return;
const n = this._listeners.indexOf(t);
n !== -1 && this._listeners.splice(n, 1);
}
toAbortSignal() {
const t = new AbortController(), n = (r) => {
t.abort(r);
};
return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
}
/**
* Returns an object that contains a new `CancelToken` and a function that, when called,
* cancels the `CancelToken`.
*/
static source() {
let t;
return {
token: new On(function(o) {
t = o;
}),
cancel: t
};
}
};
function Fo(e) {
return function(n) {
return e.apply(null, n);
};
}
function Bo(e) {
return l.isObject(e) && e.isAxiosError === !0;
}
const Xe = {
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(Xe).forEach(([e, t]) => {
Xe[t] = e;
});
function Tn(e) {
const t = new G(e), n = en(G.prototype.request, t);
return l.extend(n, G.prototype, t, { allOwnKeys: !0 }), l.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
return Tn(X(e, o));
}, n;
}
const R = Tn(be);
R.Axios = G;
R.CanceledError = ae;
R.CancelToken = $o;
R.isCancel = gn;
R.VE