UNPKG

absolute-widget

Version:

An embeddable User Login and Registration using Absolute & PasswordLess with consent page

1,682 lines (1,681 loc) 801 kB
var Hy = Object.defineProperty; var $y = (e, t, r) => t in e ? Hy(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r; var Vo = (e, t, r) => $y(e, typeof t != "symbol" ? t + "" : t, r); import { jsx as x, jsxs as le, Fragment as Cl } from "react/jsx-runtime"; import * as R from "react"; import Pt, { useState as Pe, forwardRef as Gy, useContext as qy, isValidElement as ys, cloneElement as co, Children as Xy, Component as Ip, createElement as sd, useRef as jt, useCallback as Zy, useEffect as Ni, useLayoutEffect as Jy, Fragment as Ky } from "react"; import * as Qy from "react-dom"; import rs from "react-dom"; function Np(e, t) { return function() { return e.apply(t, arguments); }; } const { toString: ev } = Object.prototype, { getPrototypeOf: Cc } = Object, na = /* @__PURE__ */ ((e) => (t) => { const r = ev.call(t); return e[r] || (e[r] = r.slice(8, -1).toLowerCase()); })(/* @__PURE__ */ Object.create(null)), Ar = (e) => (e = e.toLowerCase(), (t) => na(t) === e), oa = (e) => (t) => typeof t === e, { isArray: Ao } = Array, mi = oa("undefined"); function tv(e) { return e !== null && !mi(e) && e.constructor !== null && !mi(e.constructor) && or(e.constructor.isBuffer) && e.constructor.isBuffer(e); } const Dp = Ar("ArrayBuffer"); function rv(e) { let t; return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Dp(e.buffer), t; } const nv = oa("string"), or = oa("function"), Fp = oa("number"), ia = (e) => e !== null && typeof e == "object", ov = (e) => e === !0 || e === !1, vs = (e) => { if (na(e) !== "object") return !1; const t = Cc(e); return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e); }, iv = Ar("Date"), sv = Ar("File"), av = Ar("Blob"), lv = Ar("FileList"), cv = (e) => ia(e) && or(e.pipe), uv = (e) => { let t; return e && (typeof FormData == "function" && e instanceof FormData || or(e.append) && ((t = na(e)) === "formdata" || // detect form-data instance t === "object" && or(e.toString) && e.toString() === "[object FormData]")); }, dv = Ar("URLSearchParams"), [fv, pv, hv, mv] = ["ReadableStream", "Request", "Response", "Headers"].map(Ar), gv = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); function Di(e, t, { allOwnKeys: r = !1 } = {}) { if (e === null || typeof e > "u") return; let n, o; if (typeof e != "object" && (e = [e]), Ao(e)) for (n = 0, o = e.length; n < o; n++) t.call(null, e[n], n, e); else { const i = r ? Object.getOwnPropertyNames(e) : Object.keys(e), s = i.length; let a; for (n = 0; n < s; n++) a = i[n], t.call(null, e[a], a, e); } } function Lp(e, t) { t = t.toLowerCase(); const r = Object.keys(e); let n = r.length, o; for (; n-- > 0; ) if (o = r[n], t === o.toLowerCase()) return o; return null; } const Mn = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Bp = (e) => !mi(e) && e !== Mn; function Rl() { const { caseless: e } = Bp(this) && this || {}, t = {}, r = (n, o) => { const i = e && Lp(t, o) || o; vs(t[i]) && vs(n) ? t[i] = Rl(t[i], n) : vs(n) ? t[i] = Rl({}, n) : Ao(n) ? t[i] = n.slice() : t[i] = n; }; for (let n = 0, o = arguments.length; n < o; n++) arguments[n] && Di(arguments[n], r); return t; } const yv = (e, t, r, { allOwnKeys: n } = {}) => (Di(t, (o, i) => { r && or(o) ? e[i] = Np(o, r) : e[i] = o; }, { allOwnKeys: n }), e), vv = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), bv = (e, t, r, n) => { e.prototype = Object.create(t.prototype, n), e.prototype.constructor = e, Object.defineProperty(e, "super", { value: t.prototype }), r && Object.assign(e.prototype, r); }, wv = (e, t, r, n) => { 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], (!n || n(s, e, t)) && !a[s] && (t[s] = e[s], a[s] = !0); e = r !== !1 && Cc(e); } while (e && (!r || r(e, t)) && e !== Object.prototype); return t; }, Sv = (e, t, r) => { e = String(e), (r === void 0 || r > e.length) && (r = e.length), r -= t.length; const n = e.indexOf(t, r); return n !== -1 && n === r; }, xv = (e) => { if (!e) return null; if (Ao(e)) return e; let t = e.length; if (!Fp(t)) return null; const r = new Array(t); for (; t-- > 0; ) r[t] = e[t]; return r; }, Cv = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Cc(Uint8Array)), Rv = (e, t) => { const n = (e && e[Symbol.iterator]).call(e); let o; for (; (o = n.next()) && !o.done; ) { const i = o.value; t.call(e, i[0], i[1]); } }, Tv = (e, t) => { let r; const n = []; for (; (r = e.exec(t)) !== null; ) n.push(r); return n; }, Av = Ar("HTMLFormElement"), kv = (e) => e.toLowerCase().replace( /[-_\s]([a-z\d])(\w*)/g, function(r, n, o) { return n.toUpperCase() + o; } ), ad = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), Ev = Ar("RegExp"), _p = (e, t) => { const r = Object.getOwnPropertyDescriptors(e), n = {}; Di(r, (o, i) => { let s; (s = t(o, i, e)) !== !1 && (n[i] = s || o); }), Object.defineProperties(e, n); }, Pv = (e) => { _p(e, (t, r) => { if (or(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1) return !1; const n = e[r]; if (or(n)) { if (t.enumerable = !1, "writable" in t) { t.writable = !1; return; } t.set || (t.set = () => { throw Error("Can not rewrite read-only method '" + r + "'"); }); } }); }, Ov = (e, t) => { const r = {}, n = (o) => { o.forEach((i) => { r[i] = !0; }); }; return Ao(e) ? n(e) : n(String(e).split(t)), r; }, Mv = () => { }, Iv = (e, t) => e != null && Number.isFinite(e = +e) ? e : t; function Nv(e) { return !!(e && or(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]); } const Dv = (e) => { const t = new Array(10), r = (n, o) => { if (ia(n)) { if (t.indexOf(n) >= 0) return; if (!("toJSON" in n)) { t[o] = n; const i = Ao(n) ? [] : {}; return Di(n, (s, a) => { const l = r(s, o + 1); !mi(l) && (i[a] = l); }), t[o] = void 0, i; } } return n; }; return r(e, 0); }, Fv = Ar("AsyncFunction"), Lv = (e) => e && (ia(e) || or(e)) && or(e.then) && or(e.catch), Wp = ((e, t) => e ? setImmediate : t ? ((r, n) => (Mn.addEventListener("message", ({ source: o, data: i }) => { o === Mn && i === r && n.length && n.shift()(); }, !1), (o) => { n.push(o), Mn.postMessage(r, "*"); }))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))( typeof setImmediate == "function", or(Mn.postMessage) ), Bv = typeof queueMicrotask < "u" ? queueMicrotask.bind(Mn) : typeof process < "u" && process.nextTick || Wp, _ = { isArray: Ao, isArrayBuffer: Dp, isBuffer: tv, isFormData: uv, isArrayBufferView: rv, isString: nv, isNumber: Fp, isBoolean: ov, isObject: ia, isPlainObject: vs, isReadableStream: fv, isRequest: pv, isResponse: hv, isHeaders: mv, isUndefined: mi, isDate: iv, isFile: sv, isBlob: av, isRegExp: Ev, isFunction: or, isStream: cv, isURLSearchParams: dv, isTypedArray: Cv, isFileList: lv, forEach: Di, merge: Rl, extend: yv, trim: gv, stripBOM: vv, inherits: bv, toFlatObject: wv, kindOf: na, kindOfTest: Ar, endsWith: Sv, toArray: xv, forEachEntry: Rv, matchAll: Tv, isHTMLForm: Av, hasOwnProperty: ad, hasOwnProp: ad, // an alias to avoid ESLint no-prototype-builtins detection reduceDescriptors: _p, freezeMethods: Pv, toObjectSet: Ov, toCamelCase: kv, noop: Mv, toFiniteNumber: Iv, findKey: Lp, global: Mn, isContextDefined: Bp, isSpecCompliantForm: Nv, toJSONObject: Dv, isAsyncFn: Fv, isThenable: Lv, setImmediate: Wp, asap: Bv }; function Ie(e, t, r, n, 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), r && (this.config = r), n && (this.request = n), o && (this.response = o, this.status = o.status ? o.status : null); } _.inherits(Ie, 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: _.toJSONObject(this.config), code: this.code, status: this.status }; } }); const jp = Ie.prototype, Vp = {}; [ "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) => { Vp[e] = { value: e }; }); Object.defineProperties(Ie, Vp); Object.defineProperty(jp, "isAxiosError", { value: !0 }); Ie.from = (e, t, r, n, o, i) => { const s = Object.create(jp); return _.toFlatObject(e, s, function(l) { return l !== Error.prototype; }, (a) => a !== "isAxiosError"), Ie.call(s, e.message, t, r, n, o), s.cause = e, s.name = e.name, i && Object.assign(s, i), s; }; const _v = null; function Tl(e) { return _.isPlainObject(e) || _.isArray(e); } function zp(e) { return _.endsWith(e, "[]") ? e.slice(0, -2) : e; } function ld(e, t, r) { return e ? e.concat(t).map(function(o, i) { return o = zp(o), !r && i ? "[" + o + "]" : o; }).join(r ? "." : "") : t; } function Wv(e) { return _.isArray(e) && !e.some(Tl); } const jv = _.toFlatObject(_, {}, null, function(t) { return /^is[A-Z]/.test(t); }); function sa(e, t, r) { if (!_.isObject(e)) throw new TypeError("target must be an object"); t = t || new FormData(), r = _.toFlatObject(r, { metaTokens: !0, dots: !1, indexes: !1 }, !1, function(h, g) { return !_.isUndefined(g[h]); }); const n = r.metaTokens, o = r.visitor || u, i = r.dots, s = r.indexes, l = (r.Blob || typeof Blob < "u" && Blob) && _.isSpecCompliantForm(t); if (!_.isFunction(o)) throw new TypeError("visitor must be a function"); function c(f) { if (f === null) return ""; if (_.isDate(f)) return f.toISOString(); if (!l && _.isBlob(f)) throw new Ie("Blob is not supported. Use a Buffer instead."); return _.isArrayBuffer(f) || _.isTypedArray(f) ? l && typeof Blob == "function" ? new Blob([f]) : Buffer.from(f) : f; } function u(f, h, g) { let S = f; if (f && !g && typeof f == "object") { if (_.endsWith(h, "{}")) h = n ? h : h.slice(0, -2), f = JSON.stringify(f); else if (_.isArray(f) && Wv(f) || (_.isFileList(f) || _.endsWith(h, "[]")) && (S = _.toArray(f))) return h = zp(h), S.forEach(function(y, b) { !(_.isUndefined(y) || y === null) && t.append( // eslint-disable-next-line no-nested-ternary s === !0 ? ld([h], b, i) : s === null ? h : h + "[]", c(y) ); }), !1; } return Tl(f) ? !0 : (t.append(ld(g, h, i), c(f)), !1); } const d = [], p = Object.assign(jv, { defaultVisitor: u, convertValue: c, isVisitable: Tl }); function m(f, h) { if (!_.isUndefined(f)) { if (d.indexOf(f) !== -1) throw Error("Circular reference detected in " + h.join(".")); d.push(f), _.forEach(f, function(S, C) { (!(_.isUndefined(S) || S === null) && o.call( t, S, _.isString(C) ? C.trim() : C, h, p )) === !0 && m(S, h ? h.concat(C) : [C]); }), d.pop(); } } if (!_.isObject(e)) throw new TypeError("data must be an object"); return m(e), t; } function cd(e) { const t = { "!": "%21", "'": "%27", "(": "%28", ")": "%29", "~": "%7E", "%20": "+", "%00": "\0" }; return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(n) { return t[n]; }); } function Rc(e, t) { this._pairs = [], e && sa(e, this, t); } const Up = Rc.prototype; Up.append = function(t, r) { this._pairs.push([t, r]); }; Up.toString = function(t) { const r = t ? function(n) { return t.call(this, n, cd); } : cd; return this._pairs.map(function(o) { return r(o[0]) + "=" + r(o[1]); }, "").join("&"); }; function Vv(e) { return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); } function Yp(e, t, r) { if (!t) return e; const n = r && r.encode || Vv; _.isFunction(r) && (r = { serialize: r }); const o = r && r.serialize; let i; if (o ? i = o(t, r) : i = _.isURLSearchParams(t) ? t.toString() : new Rc(t, r).toString(n), i) { const s = e.indexOf("#"); s !== -1 && (e = e.slice(0, s)), e += (e.indexOf("?") === -1 ? "?" : "&") + i; } return e; } class ud { 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, r, n) { return this.handlers.push({ fulfilled: t, rejected: r, synchronous: n ? n.synchronous : !1, runWhen: n ? n.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) { _.forEach(this.handlers, function(n) { n !== null && t(n); }); } } const Hp = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 }, zv = typeof URLSearchParams < "u" ? URLSearchParams : Rc, Uv = typeof FormData < "u" ? FormData : null, Yv = typeof Blob < "u" ? Blob : null, Hv = { isBrowser: !0, classes: { URLSearchParams: zv, FormData: Uv, Blob: Yv }, protocols: ["http", "https", "file", "blob", "url", "data"] }, Tc = typeof window < "u" && typeof document < "u", Al = typeof navigator == "object" && navigator || void 0, $v = Tc && (!Al || ["ReactNative", "NativeScript", "NS"].indexOf(Al.product) < 0), Gv = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef self instanceof WorkerGlobalScope && typeof self.importScripts == "function", qv = Tc && window.location.href || "http://localhost", Xv = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, hasBrowserEnv: Tc, hasStandardBrowserEnv: $v, hasStandardBrowserWebWorkerEnv: Gv, navigator: Al, origin: qv }, Symbol.toStringTag, { value: "Module" })), Ut = { ...Xv, ...Hv }; function Zv(e, t) { return sa(e, new Ut.classes.URLSearchParams(), Object.assign({ visitor: function(r, n, o, i) { return Ut.isNode && _.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments); } }, t)); } function Jv(e) { return _.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]); } function Kv(e) { const t = {}, r = Object.keys(e); let n; const o = r.length; let i; for (n = 0; n < o; n++) i = r[n], t[i] = e[i]; return t; } function $p(e) { function t(r, n, o, i) { let s = r[i++]; if (s === "__proto__") return !0; const a = Number.isFinite(+s), l = i >= r.length; return s = !s && _.isArray(o) ? o.length : s, l ? (_.hasOwnProp(o, s) ? o[s] = [o[s], n] : o[s] = n, !a) : ((!o[s] || !_.isObject(o[s])) && (o[s] = []), t(r, n, o[s], i) && _.isArray(o[s]) && (o[s] = Kv(o[s])), !a); } if (_.isFormData(e) && _.isFunction(e.entries)) { const r = {}; return _.forEachEntry(e, (n, o) => { t(Jv(n), o, r, 0); }), r; } return null; } function Qv(e, t, r) { if (_.isString(e)) try { return (t || JSON.parse)(e), _.trim(e); } catch (n) { if (n.name !== "SyntaxError") throw n; } return (r || JSON.stringify)(e); } const Fi = { transitional: Hp, adapter: ["xhr", "http", "fetch"], transformRequest: [function(t, r) { const n = r.getContentType() || "", o = n.indexOf("application/json") > -1, i = _.isObject(t); if (i && _.isHTMLForm(t) && (t = new FormData(t)), _.isFormData(t)) return o ? JSON.stringify($p(t)) : t; if (_.isArrayBuffer(t) || _.isBuffer(t) || _.isStream(t) || _.isFile(t) || _.isBlob(t) || _.isReadableStream(t)) return t; if (_.isArrayBufferView(t)) return t.buffer; if (_.isURLSearchParams(t)) return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString(); let a; if (i) { if (n.indexOf("application/x-www-form-urlencoded") > -1) return Zv(t, this.formSerializer).toString(); if ((a = _.isFileList(t)) || n.indexOf("multipart/form-data") > -1) { const l = this.env && this.env.FormData; return sa( a ? { "files[]": t } : t, l && new l(), this.formSerializer ); } } return i || o ? (r.setContentType("application/json", !1), Qv(t)) : t; }], transformResponse: [function(t) { const r = this.transitional || Fi.transitional, n = r && r.forcedJSONParsing, o = this.responseType === "json"; if (_.isResponse(t) || _.isReadableStream(t)) return t; if (t && _.isString(t) && (n && !this.responseType || o)) { const s = !(r && r.silentJSONParsing) && o; try { return JSON.parse(t); } catch (a) { if (s) throw a.name === "SyntaxError" ? Ie.from(a, Ie.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: Ut.classes.FormData, Blob: Ut.classes.Blob }, validateStatus: function(t) { return t >= 200 && t < 300; }, headers: { common: { Accept: "application/json, text/plain, */*", "Content-Type": void 0 } } }; _.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => { Fi.headers[e] = {}; }); const e0 = _.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" ]), t0 = (e) => { const t = {}; let r, n, o; return e && e.split(` `).forEach(function(s) { o = s.indexOf(":"), r = s.substring(0, o).trim().toLowerCase(), n = s.substring(o + 1).trim(), !(!r || t[r] && e0[r]) && (r === "set-cookie" ? t[r] ? t[r].push(n) : t[r] = [n] : t[r] = t[r] ? t[r] + ", " + n : n); }), t; }, dd = Symbol("internals"); function zo(e) { return e && String(e).trim().toLowerCase(); } function bs(e) { return e === !1 || e == null ? e : _.isArray(e) ? e.map(bs) : String(e); } function r0(e) { const t = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; let n; for (; n = r.exec(e); ) t[n[1]] = n[2]; return t; } const n0 = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()); function Va(e, t, r, n, o) { if (_.isFunction(n)) return n.call(this, t, r); if (o && (t = r), !!_.isString(t)) { if (_.isString(n)) return t.indexOf(n) !== -1; if (_.isRegExp(n)) return n.test(t); } } function o0(e) { return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, r, n) => r.toUpperCase() + n); } function i0(e, t) { const r = _.toCamelCase(" " + t); ["get", "set", "has"].forEach((n) => { Object.defineProperty(e, n + r, { value: function(o, i, s) { return this[n].call(this, t, o, i, s); }, configurable: !0 }); }); } let Kt = class { constructor(t) { t && this.set(t); } set(t, r, n) { const o = this; function i(a, l, c) { const u = zo(l); if (!u) throw new Error("header name must be a non-empty string"); const d = _.findKey(o, u); (!d || o[d] === void 0 || c === !0 || c === void 0 && o[d] !== !1) && (o[d || l] = bs(a)); } const s = (a, l) => _.forEach(a, (c, u) => i(c, u, l)); if (_.isPlainObject(t) || t instanceof this.constructor) s(t, r); else if (_.isString(t) && (t = t.trim()) && !n0(t)) s(t0(t), r); else if (_.isHeaders(t)) for (const [a, l] of t.entries()) i(l, a, n); else t != null && i(r, t, n); return this; } get(t, r) { if (t = zo(t), t) { const n = _.findKey(this, t); if (n) { const o = this[n]; if (!r) return o; if (r === !0) return r0(o); if (_.isFunction(r)) return r.call(this, o, n); if (_.isRegExp(r)) return r.exec(o); throw new TypeError("parser must be boolean|regexp|function"); } } } has(t, r) { if (t = zo(t), t) { const n = _.findKey(this, t); return !!(n && this[n] !== void 0 && (!r || Va(this, this[n], n, r))); } return !1; } delete(t, r) { const n = this; let o = !1; function i(s) { if (s = zo(s), s) { const a = _.findKey(n, s); a && (!r || Va(n, n[a], a, r)) && (delete n[a], o = !0); } } return _.isArray(t) ? t.forEach(i) : i(t), o; } clear(t) { const r = Object.keys(this); let n = r.length, o = !1; for (; n--; ) { const i = r[n]; (!t || Va(this, this[i], i, t, !0)) && (delete this[i], o = !0); } return o; } normalize(t) { const r = this, n = {}; return _.forEach(this, (o, i) => { const s = _.findKey(n, i); if (s) { r[s] = bs(o), delete r[i]; return; } const a = t ? o0(i) : String(i).trim(); a !== i && delete r[i], r[a] = bs(o), n[a] = !0; }), this; } concat(...t) { return this.constructor.concat(this, ...t); } toJSON(t) { const r = /* @__PURE__ */ Object.create(null); return _.forEach(this, (n, o) => { n != null && n !== !1 && (r[o] = t && _.isArray(n) ? n.join(", ") : n); }), r; } [Symbol.iterator]() { return Object.entries(this.toJSON())[Symbol.iterator](); } toString() { return Object.entries(this.toJSON()).map(([t, r]) => t + ": " + r).join(` `); } get [Symbol.toStringTag]() { return "AxiosHeaders"; } static from(t) { return t instanceof this ? t : new this(t); } static concat(t, ...r) { const n = new this(t); return r.forEach((o) => n.set(o)), n; } static accessor(t) { const n = (this[dd] = this[dd] = { accessors: {} }).accessors, o = this.prototype; function i(s) { const a = zo(s); n[a] || (i0(o, s), n[a] = !0); } return _.isArray(t) ? t.forEach(i) : i(t), this; } }; Kt.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); _.reduceDescriptors(Kt.prototype, ({ value: e }, t) => { let r = t[0].toUpperCase() + t.slice(1); return { get: () => e, set(n) { this[r] = n; } }; }); _.freezeMethods(Kt); function za(e, t) { const r = this || Fi, n = t || r, o = Kt.from(n.headers); let i = n.data; return _.forEach(e, function(a) { i = a.call(r, i, o.normalize(), t ? t.status : void 0); }), o.normalize(), i; } function Gp(e) { return !!(e && e.__CANCEL__); } function ko(e, t, r) { Ie.call(this, e ?? "canceled", Ie.ERR_CANCELED, t, r), this.name = "CanceledError"; } _.inherits(ko, Ie, { __CANCEL__: !0 }); function qp(e, t, r) { const n = r.config.validateStatus; !r.status || !n || n(r.status) ? e(r) : t(new Ie( "Request failed with status code " + r.status, [Ie.ERR_BAD_REQUEST, Ie.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4], r.config, r.request, r )); } function s0(e) { const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e); return t && t[1] || ""; } function a0(e, t) { e = e || 10; const r = new Array(e), n = new Array(e); let o = 0, i = 0, s; return t = t !== void 0 ? t : 1e3, function(l) { const c = Date.now(), u = n[i]; s || (s = c), r[o] = l, n[o] = c; let d = i, p = 0; for (; d !== o; ) p += r[d++], d = d % e; if (o = (o + 1) % e, o === i && (i = (i + 1) % e), c - s < t) return; const m = u && c - u; return m ? Math.round(p * 1e3 / m) : void 0; }; } function l0(e, t) { let r = 0, n = 1e3 / t, o, i; const s = (c, u = Date.now()) => { r = u, o = null, i && (clearTimeout(i), i = null), e.apply(null, c); }; return [(...c) => { const u = Date.now(), d = u - r; d >= n ? s(c, u) : (o = c, i || (i = setTimeout(() => { i = null, s(o); }, n - d))); }, () => o && s(o)]; } const Ms = (e, t, r = 3) => { let n = 0; const o = a0(50, 250); return l0((i) => { const s = i.loaded, a = i.lengthComputable ? i.total : void 0, l = s - n, c = o(l), u = s <= a; n = s; const d = { loaded: s, total: a, progress: a ? s / a : void 0, bytes: l, rate: c || void 0, estimated: c && a && u ? (a - s) / c : void 0, event: i, lengthComputable: a != null, [t ? "download" : "upload"]: !0 }; e(d); }, r); }, fd = (e, t) => { const r = e != null; return [(n) => t[0]({ lengthComputable: r, total: e, loaded: n }), t[1]]; }, pd = (e) => (...t) => _.asap(() => e(...t)), c0 = Ut.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (r) => (r = new URL(r, Ut.origin), e.protocol === r.protocol && e.host === r.host && (t || e.port === r.port)))( new URL(Ut.origin), Ut.navigator && /(msie|trident)/i.test(Ut.navigator.userAgent) ) : () => !0, u0 = Ut.hasStandardBrowserEnv ? ( // Standard browser envs support document.cookie { write(e, t, r, n, o, i) { const s = [e + "=" + encodeURIComponent(t)]; _.isNumber(r) && s.push("expires=" + new Date(r).toGMTString()), _.isString(n) && s.push("path=" + n), _.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 d0(e) { return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e); } function f0(e, t) { return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e; } function Xp(e, t, r) { let n = !d0(t); return e && n || r == !1 ? f0(e, t) : t; } const hd = (e) => e instanceof Kt ? { ...e } : e; function _n(e, t) { t = t || {}; const r = {}; function n(c, u, d, p) { return _.isPlainObject(c) && _.isPlainObject(u) ? _.merge.call({ caseless: p }, c, u) : _.isPlainObject(u) ? _.merge({}, u) : _.isArray(u) ? u.slice() : u; } function o(c, u, d, p) { if (_.isUndefined(u)) { if (!_.isUndefined(c)) return n(void 0, c, d, p); } else return n(c, u, d, p); } function i(c, u) { if (!_.isUndefined(u)) return n(void 0, u); } function s(c, u) { if (_.isUndefined(u)) { if (!_.isUndefined(c)) return n(void 0, c); } else return n(void 0, u); } function a(c, u, d) { if (d in t) return n(c, u); if (d in e) return n(void 0, c); } const l = { 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: (c, u, d) => o(hd(c), hd(u), d, !0) }; return _.forEach(Object.keys(Object.assign({}, e, t)), function(u) { const d = l[u] || o, p = d(e[u], t[u], u); _.isUndefined(p) && d !== a || (r[u] = p); }), r; } const Zp = (e) => { const t = _n({}, e); let { data: r, withXSRFToken: n, xsrfHeaderName: o, xsrfCookieName: i, headers: s, auth: a } = t; t.headers = s = Kt.from(s), t.url = Yp(Xp(t.baseURL, t.url), e.params, e.paramsSerializer), a && s.set( "Authorization", "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : "")) ); let l; if (_.isFormData(r)) { if (Ut.hasStandardBrowserEnv || Ut.hasStandardBrowserWebWorkerEnv) s.setContentType(void 0); else if ((l = s.getContentType()) !== !1) { const [c, ...u] = l ? l.split(";").map((d) => d.trim()).filter(Boolean) : []; s.setContentType([c || "multipart/form-data", ...u].join("; ")); } } if (Ut.hasStandardBrowserEnv && (n && _.isFunction(n) && (n = n(t)), n || n !== !1 && c0(t.url))) { const c = o && i && u0.read(i); c && s.set(o, c); } return t; }, p0 = typeof XMLHttpRequest < "u", h0 = p0 && function(e) { return new Promise(function(r, n) { const o = Zp(e); let i = o.data; const s = Kt.from(o.headers).normalize(); let { responseType: a, onUploadProgress: l, onDownloadProgress: c } = o, u, d, p, m, f; function h() { m && m(), f && f(), o.cancelToken && o.cancelToken.unsubscribe(u), o.signal && o.signal.removeEventListener("abort", u); } let g = new XMLHttpRequest(); g.open(o.method.toUpperCase(), o.url, !0), g.timeout = o.timeout; function S() { if (!g) return; const y = Kt.from( "getAllResponseHeaders" in g && g.getAllResponseHeaders() ), w = { data: !a || a === "text" || a === "json" ? g.responseText : g.response, status: g.status, statusText: g.statusText, headers: y, config: e, request: g }; qp(function(E) { r(E), h(); }, function(E) { n(E), h(); }, w), g = null; } "onloadend" in g ? g.onloadend = S : g.onreadystatechange = function() { !g || g.readyState !== 4 || g.status === 0 && !(g.responseURL && g.responseURL.indexOf("file:") === 0) || setTimeout(S); }, g.onabort = function() { g && (n(new Ie("Request aborted", Ie.ECONNABORTED, e, g)), g = null); }, g.onerror = function() { n(new Ie("Network Error", Ie.ERR_NETWORK, e, g)), g = null; }, g.ontimeout = function() { let b = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded"; const w = o.transitional || Hp; o.timeoutErrorMessage && (b = o.timeoutErrorMessage), n(new Ie( b, w.clarifyTimeoutError ? Ie.ETIMEDOUT : Ie.ECONNABORTED, e, g )), g = null; }, i === void 0 && s.setContentType(null), "setRequestHeader" in g && _.forEach(s.toJSON(), function(b, w) { g.setRequestHeader(w, b); }), _.isUndefined(o.withCredentials) || (g.withCredentials = !!o.withCredentials), a && a !== "json" && (g.responseType = o.responseType), c && ([p, f] = Ms(c, !0), g.addEventListener("progress", p)), l && g.upload && ([d, m] = Ms(l), g.upload.addEventListener("progress", d), g.upload.addEventListener("loadend", m)), (o.cancelToken || o.signal) && (u = (y) => { g && (n(!y || y.type ? new ko(null, e, g) : y), g.abort(), g = null); }, o.cancelToken && o.cancelToken.subscribe(u), o.signal && (o.signal.aborted ? u() : o.signal.addEventListener("abort", u))); const C = s0(o.url); if (C && Ut.protocols.indexOf(C) === -1) { n(new Ie("Unsupported protocol " + C + ":", Ie.ERR_BAD_REQUEST, e)); return; } g.send(i || null); }); }, m0 = (e, t) => { const { length: r } = e = e ? e.filter(Boolean) : []; if (t || r) { let n = new AbortController(), o; const i = function(c) { if (!o) { o = !0, a(); const u = c instanceof Error ? c : this.reason; n.abort(u instanceof Ie ? u : new ko(u instanceof Error ? u.message : u)); } }; let s = t && setTimeout(() => { s = null, i(new Ie(`timeout ${t} of ms exceeded`, Ie.ETIMEDOUT)); }, t); const a = () => { e && (s && clearTimeout(s), s = null, e.forEach((c) => { c.unsubscribe ? c.unsubscribe(i) : c.removeEventListener("abort", i); }), e = null); }; e.forEach((c) => c.addEventListener("abort", i)); const { signal: l } = n; return l.unsubscribe = () => _.asap(a), l; } }, g0 = function* (e, t) { let r = e.byteLength; if (r < t) { yield e; return; } let n = 0, o; for (; n < r; ) o = n + t, yield e.slice(n, o), n = o; }, y0 = async function* (e, t) { for await (const r of v0(e)) yield* g0(r, t); }, v0 = async function* (e) { if (e[Symbol.asyncIterator]) { yield* e; return; } const t = e.getReader(); try { for (; ; ) { const { done: r, value: n } = await t.read(); if (r) break; yield n; } } finally { await t.cancel(); } }, md = (e, t, r, n) => { const o = y0(e, t); let i = 0, s, a = (l) => { s || (s = !0, n && n(l)); }; return new ReadableStream({ async pull(l) { try { const { done: c, value: u } = await o.next(); if (c) { a(), l.close(); return; } let d = u.byteLength; if (r) { let p = i += d; r(p); } l.enqueue(new Uint8Array(u)); } catch (c) { throw a(c), c; } }, cancel(l) { return a(l), o.return(); } }, { highWaterMark: 2 }); }, aa = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Jp = aa && typeof ReadableStream == "function", b0 = aa && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), Kp = (e, ...t) => { try { return !!e(...t); } catch { return !1; } }, w0 = Jp && Kp(() => { let e = !1; const t = new Request(Ut.origin, { body: new ReadableStream(), method: "POST", get duplex() { return e = !0, "half"; } }).headers.has("Content-Type"); return e && !t; }), gd = 64 * 1024, kl = Jp && Kp(() => _.isReadableStream(new Response("").body)), Is = { stream: kl && ((e) => e.body) }; aa && ((e) => { ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => { !Is[t] && (Is[t] = _.isFunction(e[t]) ? (r) => r[t]() : (r, n) => { throw new Ie(`Response type '${t}' is not supported`, Ie.ERR_NOT_SUPPORT, n); }); }); })(new Response()); const S0 = async (e) => { if (e == null) return 0; if (_.isBlob(e)) return e.size; if (_.isSpecCompliantForm(e)) return (await new Request(Ut.origin, { method: "POST", body: e }).arrayBuffer()).byteLength; if (_.isArrayBufferView(e) || _.isArrayBuffer(e)) return e.byteLength; if (_.isURLSearchParams(e) && (e = e + ""), _.isString(e)) return (await b0(e)).byteLength; }, x0 = async (e, t) => { const r = _.toFiniteNumber(e.getContentLength()); return r ?? S0(t); }, C0 = aa && (async (e) => { let { url: t, method: r, data: n, signal: o, cancelToken: i, timeout: s, onDownloadProgress: a, onUploadProgress: l, responseType: c, headers: u, withCredentials: d = "same-origin", fetchOptions: p } = Zp(e); c = c ? (c + "").toLowerCase() : "text"; let m = m0([o, i && i.toAbortSignal()], s), f; const h = m && m.unsubscribe && (() => { m.unsubscribe(); }); let g; try { if (l && w0 && r !== "get" && r !== "head" && (g = await x0(u, n)) !== 0) { let w = new Request(t, { method: "POST", body: n, duplex: "half" }), A; if (_.isFormData(n) && (A = w.headers.get("content-type")) && u.setContentType(A), w.body) { const [E, P] = fd( g, Ms(pd(l)) ); n = md(w.body, gd, E, P); } } _.isString(d) || (d = d ? "include" : "omit"); const S = "credentials" in Request.prototype; f = new Request(t, { ...p, signal: m, method: r.toUpperCase(), headers: u.normalize().toJSON(), body: n, duplex: "half", credentials: S ? d : void 0 }); let C = await fetch(f); const y = kl && (c === "stream" || c === "response"); if (kl && (a || y && h)) { const w = {}; ["status", "statusText", "headers"].forEach((D) => { w[D] = C[D]; }); const A = _.toFiniteNumber(C.headers.get("content-length")), [E, P] = a && fd( A, Ms(pd(a), !0) ) || []; C = new Response( md(C.body, gd, E, () => { P && P(), h && h(); }), w ); } c = c || "text"; let b = await Is[_.findKey(Is, c) || "text"](C, e); return !y && h && h(), await new Promise((w, A) => { qp(w, A, { data: b, headers: Kt.from(C.headers), status: C.status, statusText: C.statusText, config: e, request: f }); }); } catch (S) { throw h && h(), S && S.name === "TypeError" && /fetch/i.test(S.message) ? Object.assign( new Ie("Network Error", Ie.ERR_NETWORK, e, f), { cause: S.cause || S } ) : Ie.from(S, S && S.code, e, f); } }), El = { http: _v, xhr: h0, fetch: C0 }; _.forEach(El, (e, t) => { if (e) { try { Object.defineProperty(e, "name", { value: t }); } catch { } Object.defineProperty(e, "adapterName", { value: t }); } }); const yd = (e) => `- ${e}`, R0 = (e) => _.isFunction(e) || e === null || e === !1, Qp = { getAdapter: (e) => { e = _.isArray(e) ? e : [e]; const { length: t } = e; let r, n; const o = {}; for (let i = 0; i < t; i++) { r = e[i]; let s; if (n = r, !R0(r) && (n = El[(s = String(r)).toLowerCase()], n === void 0)) throw new Ie(`Unknown adapter '${s}'`); if (n) break; o[s || "#" + i] = n; } if (!n) { const i = Object.entries(o).map( ([a, l]) => `adapter ${a} ` + (l === !1 ? "is not supported by the environment" : "is not available in the build") ); let s = t ? i.length > 1 ? `since : ` + i.map(yd).join(` `) : " " + yd(i[0]) : "as no adapter specified"; throw new Ie( "There is no suitable adapter to dispatch the request " + s, "ERR_NOT_SUPPORT" ); } return n; }, adapters: El }; function Ua(e) { if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted) throw new ko(null, e); } function vd(e) { return Ua(e), e.headers = Kt.from(e.headers), e.data = za.call( e, e.transformRequest ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Qp.getAdapter(e.adapter || Fi.adapter)(e).then(function(n) { return Ua(e), n.data = za.call( e, e.transformResponse, n ), n.headers = Kt.from(n.headers), n; }, function(n) { return Gp(n) || (Ua(e), n && n.response && (n.response.data = za.call( e, e.transformResponse, n.response ), n.response.headers = Kt.from(n.response.headers))), Promise.reject(n); }); } const eh = "1.8.1", la = {}; ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => { la[e] = function(n) { return typeof n === e || "a" + (t < 1 ? "n " : " ") + e; }; }); const bd = {}; la.transitional = function(t, r, n) { function o(i, s) { return "[Axios v" + eh + "] Transitional option '" + i + "'" + s + (n ? ". " + n : ""); } return (i, s, a) => { if (t === !1) throw new Ie( o(s, " has been removed" + (r ? " in " + r : "")), Ie.ERR_DEPRECATED ); return r && !bd[s] && (bd[s] = !0, console.warn( o( s, " has been deprecated since v" + r + " and will be removed in the near future" ) )), t ? t(i, s, a) : !0; }; }; la.spelling = function(t) { return (r, n) => (console.warn(`${n} is likely a misspelling of ${t}`), !0); }; function T0(e, t, r) { if (typeof e != "object") throw new Ie("options must be an object", Ie.ERR_BAD_OPTION_VALUE); const n = Object.keys(e); let o = n.length; for (; o-- > 0; ) { const i = n[o], s = t[i]; if (s) { const a = e[i], l = a === void 0 || s(a, i, e); if (l !== !0) throw new Ie("option " + i + " must be " + l, Ie.ERR_BAD_OPTION_VALUE); continue; } if (r !== !0) throw new Ie("Unknown option " + i, Ie.ERR_BAD_OPTION); } } const ws = { assertOptions: T0, validators: la }, Mr = ws.validators; let Dn = class { constructor(t) { this.defaults = t, this.interceptors = { request: new ud(), response: new ud() }; } /** * 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, r) { try { return await this._request(t, r); } catch (n) { if (n instanceof Error) { let o = {}; Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error(); const i = o.stack ? o.stack.replace(/^.+\n/, "") : ""; try { n.stack ? i && !String(n.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (n.stack += ` ` + i) : n.stack = i; } catch { } } throw n; } } _request(t, r) { typeof t == "string" ? (r = r || {}, r.url = t) : r = t || {}, r = _n(this.defaults, r); const { transitional: n, paramsSerializer: o, headers: i } = r; n !== void 0 && ws.assertOptions(n, { silentJSONParsing: Mr.transitional(Mr.boolean), forcedJSONParsing: Mr.transitional(Mr.boolean), clarifyTimeoutError: Mr.transitional(Mr.boolean) }, !1), o != null && (_.isFunction(o) ? r.paramsSerializer = { serialize: o } : ws.assertOptions(o, { encode: Mr.function, serialize: Mr.function }, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), ws.assertOptions(r, { baseUrl: Mr.spelling("baseURL"), withXsrfToken: Mr.spelling("withXSRFToken") }, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase(); let s = i && _.merge( i.common, i[r.method] ); i && _.forEach( ["delete", "get", "head", "post", "put", "patch", "common"], (f) => { delete i[f]; } ), r.headers = Kt.concat(s, i); const a = []; let l = !0; this.interceptors.request.forEach(function(h) { typeof h.runWhen == "function" && h.runWhen(r) === !1 || (l = l && h.synchronous, a.unshift(h.fulfilled, h.rejected)); }); const c = []; this.interceptors.response.forEach(function(h) { c.push(h.fulfilled, h.rejected); }); let u, d = 0, p; if (!l) { const f = [vd.bind(this), void 0]; for (f.unshift.apply(f, a), f.push.apply(f, c), p = f.length, u = Promise.resolve(r); d < p; ) u = u.then(f[d++], f[d++]); return u; } p = a.length; let m = r; for (d = 0; d < p; ) { const f = a[d++], h = a[d++]; try { m = f(m); } catch (g) { h.call(this, g); break; } } try { u = vd.call(this, m); } catch (f) { return Promise.reject(f); } for (d = 0, p = c.length; d < p; ) u = u.then(c[d++], c[d++]); return u; } getUri(t) { t = _n(this.defaults, t); const r = Xp(t.baseURL, t.url, t.allowAbsoluteUrls); return Yp(r, t.params, t.paramsSerializer); } }; _.forEach(["delete", "get", "head", "options"], function(t) { Dn.prototype[t] = function(r, n) { return this.request(_n(n || {}, { method: t, url: r, data: (n || {}).data })); }; }); _.forEach(["post", "put", "patch"], function(t) { function r(n) { return function(i, s, a) { return this.request(_n(a || {}, { method: t, headers: n ? { "Content-Type": "multipart/form-data" } : {}, url: i, data: s })); }; } Dn.prototype[t] = r(), Dn.prototype[t + "Form"] = r(!0); }); let A0 = class th { constructor(t) { if (typeof t != "function") throw new TypeError("executor must be a function."); let r; this.promise = new Promise(function(i) { r = i; }); const n = this; this.promise.then((o) => { if (!n._listeners) return; let i = n._listeners.length; for (; i-- > 0; ) n._listeners[i](o); n._listeners = null; }), this.promise.then = (o) => { let i; const s = new Promise((a) => { n.subscribe(a), i = a; }).then(o); return s.cancel = function() { n.unsubscribe(i); }, s; }, t(function(i, s, a) { n.reason || (n.reason = new ko(i, s, a), r(n.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 r = this._listeners.indexOf(t); r !== -1 && this._listeners.splice(r, 1); } toAbortSignal() { const t = new AbortController(), r = (n) => { t.abort(n); }; return this.subscribe(r), t.signal.unsubscribe = () => this.unsubscribe(r), 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 th(function(o) { t = o; }), cancel: t }; } }; function k0(e) { return function(r) { return e.apply(null, r); }; } function E0(e) { return _.isObject(e) && e.isAxiosError === !0; } const Pl = { 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(Pl).forEach(([e, t]) => { Pl[t] = e; }); function rh(e) { const t = new Dn(e), r = Np(Dn.prototype.request, t); return _.extend(r, Dn.prototype, t, { allOwnKeys: !0 }), _.extend(r, t, null, { allOwnKeys: !0 }), r.create = function(o) { return rh(_n(e, o)); }, r; } const Ee = rh(Fi); Ee.Axios = Dn; Ee.CanceledError = ko; Ee.CancelToken = A0; Ee.isCancel = Gp; Ee.VERSION = eh; Ee.toFormData = sa; Ee.AxiosError = Ie; Ee.Cancel = Ee.CanceledError; Ee.all = function(t) { return Promise.all(t); }; Ee.spread = k0; Ee.isAxiosError = E0; Ee.mergeConfig = _n; Ee.AxiosHeaders = Kt; Ee.formToJSON = (e) => $p(_.isHTMLForm(e) ? new FormData(e) : e); Ee.getAdapter = Qp.getAdapter; Ee.HttpStatusCode = Pl; Ee.default = Ee; const {