@unielon/wallet-tg-sdk
Version:
unielon wallet sdk for telegram
1,634 lines • 82.9 kB
JavaScript
var St = Object.defineProperty;
var Rt = (e, t, n) => t in e ? St(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var S = (e, t, n) => Rt(e, typeof t != "symbol" ? t + "" : t, n);
function _t(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var fe = { exports: {} }, ae, Ae;
function Ot() {
if (Ae) return ae;
Ae = 1;
var e = 1e3, t = e * 60, n = t * 60, r = n * 24, s = r * 7, o = r * 365.25;
ae = function(a, c) {
c = c || {};
var m = typeof a;
if (m === "string" && a.length > 0)
return i(a);
if (m === "number" && isFinite(a))
return c.long ? f(a) : u(a);
throw new Error(
"val is not a non-empty string or a valid number. val=" + JSON.stringify(a)
);
};
function i(a) {
if (a = String(a), !(a.length > 100)) {
var c = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
a
);
if (c) {
var m = parseFloat(c[1]), y = (c[2] || "ms").toLowerCase();
switch (y) {
case "years":
case "year":
case "yrs":
case "yr":
case "y":
return m * o;
case "weeks":
case "week":
case "w":
return m * s;
case "days":
case "day":
case "d":
return m * r;
case "hours":
case "hour":
case "hrs":
case "hr":
case "h":
return m * n;
case "minutes":
case "minute":
case "mins":
case "min":
case "m":
return m * t;
case "seconds":
case "second":
case "secs":
case "sec":
case "s":
return m * e;
case "milliseconds":
case "millisecond":
case "msecs":
case "msec":
case "ms":
return m;
default:
return;
}
}
}
}
function u(a) {
var c = Math.abs(a);
return c >= r ? Math.round(a / r) + "d" : c >= n ? Math.round(a / n) + "h" : c >= t ? Math.round(a / t) + "m" : c >= e ? Math.round(a / e) + "s" : a + "ms";
}
function f(a) {
var c = Math.abs(a);
return c >= r ? l(a, c, r, "day") : c >= n ? l(a, c, n, "hour") : c >= t ? l(a, c, t, "minute") : c >= e ? l(a, c, e, "second") : a + " ms";
}
function l(a, c, m, y) {
var p = c >= m * 1.5;
return Math.round(a / m) + " " + y + (p ? "s" : "");
}
return ae;
}
function At(e) {
n.debug = n, n.default = n, n.coerce = f, n.disable = o, n.enable = s, n.enabled = i, n.humanize = Ot(), n.destroy = l, Object.keys(e).forEach((a) => {
n[a] = e[a];
}), n.names = [], n.skips = [], n.formatters = {};
function t(a) {
let c = 0;
for (let m = 0; m < a.length; m++)
c = (c << 5) - c + a.charCodeAt(m), c |= 0;
return n.colors[Math.abs(c) % n.colors.length];
}
n.selectColor = t;
function n(a) {
let c, m = null, y, p;
function g(...h) {
if (!g.enabled)
return;
const C = g, E = Number(/* @__PURE__ */ new Date()), b = E - (c || E);
C.diff = b, C.prev = c, C.curr = E, c = E, h[0] = n.coerce(h[0]), typeof h[0] != "string" && h.unshift("%O");
let O = 0;
h[0] = h[0].replace(/%([a-zA-Z%])/g, (v, x) => {
if (v === "%%")
return "%";
O++;
const k = n.formatters[x];
if (typeof k == "function") {
const H = h[O];
v = k.call(C, H), h.splice(O, 1), O--;
}
return v;
}), n.formatArgs.call(C, h), (C.log || n.log).apply(C, h);
}
return g.namespace = a, g.useColors = n.useColors(), g.color = n.selectColor(a), g.extend = r, g.destroy = n.destroy, Object.defineProperty(g, "enabled", {
enumerable: !0,
configurable: !1,
get: () => m !== null ? m : (y !== n.namespaces && (y = n.namespaces, p = n.enabled(a)), p),
set: (h) => {
m = h;
}
}), typeof n.init == "function" && n.init(g), g;
}
function r(a, c) {
const m = n(this.namespace + (typeof c > "u" ? ":" : c) + a);
return m.log = this.log, m;
}
function s(a) {
n.save(a), n.namespaces = a, n.names = [], n.skips = [];
let c;
const m = (typeof a == "string" ? a : "").split(/[\s,]+/), y = m.length;
for (c = 0; c < y; c++)
m[c] && (a = m[c].replace(/\*/g, ".*?"), a[0] === "-" ? n.skips.push(new RegExp("^" + a.slice(1) + "$")) : n.names.push(new RegExp("^" + a + "$")));
}
function o() {
const a = [
...n.names.map(u),
...n.skips.map(u).map((c) => "-" + c)
].join(",");
return n.enable(""), a;
}
function i(a) {
if (a[a.length - 1] === "*")
return !0;
let c, m;
for (c = 0, m = n.skips.length; c < m; c++)
if (n.skips[c].test(a))
return !1;
for (c = 0, m = n.names.length; c < m; c++)
if (n.names[c].test(a))
return !0;
return !1;
}
function u(a) {
return a.toString().substring(2, a.toString().length - 2).replace(/\.\*\?$/, "*");
}
function f(a) {
return a instanceof Error ? a.stack || a.message : a;
}
function l() {
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
}
return n.enable(n.load()), n;
}
var Tt = At;
(function(e, t) {
t.formatArgs = r, t.save = s, t.load = o, t.useColors = n, t.storage = i(), t.destroy = /* @__PURE__ */ (() => {
let f = !1;
return () => {
f || (f = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));
};
})(), t.colors = [
"#0000CC",
"#0000FF",
"#0033CC",
"#0033FF",
"#0066CC",
"#0066FF",
"#0099CC",
"#0099FF",
"#00CC00",
"#00CC33",
"#00CC66",
"#00CC99",
"#00CCCC",
"#00CCFF",
"#3300CC",
"#3300FF",
"#3333CC",
"#3333FF",
"#3366CC",
"#3366FF",
"#3399CC",
"#3399FF",
"#33CC00",
"#33CC33",
"#33CC66",
"#33CC99",
"#33CCCC",
"#33CCFF",
"#6600CC",
"#6600FF",
"#6633CC",
"#6633FF",
"#66CC00",
"#66CC33",
"#9900CC",
"#9900FF",
"#9933CC",
"#9933FF",
"#99CC00",
"#99CC33",
"#CC0000",
"#CC0033",
"#CC0066",
"#CC0099",
"#CC00CC",
"#CC00FF",
"#CC3300",
"#CC3333",
"#CC3366",
"#CC3399",
"#CC33CC",
"#CC33FF",
"#CC6600",
"#CC6633",
"#CC9900",
"#CC9933",
"#CCCC00",
"#CCCC33",
"#FF0000",
"#FF0033",
"#FF0066",
"#FF0099",
"#FF00CC",
"#FF00FF",
"#FF3300",
"#FF3333",
"#FF3366",
"#FF3399",
"#FF33CC",
"#FF33FF",
"#FF6600",
"#FF6633",
"#FF9900",
"#FF9933",
"#FFCC00",
"#FFCC33"
];
function n() {
if (typeof window < "u" && window.process && (window.process.type === "renderer" || window.process.__nwjs))
return !0;
if (typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))
return !1;
let f;
return typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
typeof navigator < "u" && navigator.userAgent && (f = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(f[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
}
function r(f) {
if (f[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + f[0] + (this.useColors ? "%c " : " ") + "+" + e.exports.humanize(this.diff), !this.useColors)
return;
const l = "color: " + this.color;
f.splice(1, 0, l, "color: inherit");
let a = 0, c = 0;
f[0].replace(/%[a-zA-Z%]/g, (m) => {
m !== "%%" && (a++, m === "%c" && (c = a));
}), f.splice(c, 0, l);
}
t.log = console.debug || console.log || (() => {
});
function s(f) {
try {
f ? t.storage.setItem("debug", f) : t.storage.removeItem("debug");
} catch {
}
}
function o() {
let f;
try {
f = t.storage.getItem("debug");
} catch {
}
return !f && typeof process < "u" && "env" in process && (f = process.env.DEBUG), f;
}
function i() {
try {
return localStorage;
} catch {
}
}
e.exports = Tt(t);
const { formatters: u } = e.exports;
u.j = function(f) {
try {
return JSON.stringify(f);
} catch (l) {
return "[UnexpectedJSONParseError]: " + l.message;
}
};
})(fe, fe.exports);
var Ve = fe.exports;
const V = Ve.debug("unielon:tmapi:debug"), Ft = Ve.debug("unielon:tmapi:error");
function vt(e, t = "_self") {
V("openLink", e, t), window.open(e, t, "noopener noreferrer");
}
function Pt(e) {
vt(e, "_blank");
}
function te() {
if (typeof window < "u")
return window;
}
class X extends Error {
constructor(t) {
super(t), this.name = "UnielonConnectUIError";
}
}
let U = {};
try {
let e = location.hash.toString();
U = Nt(e);
} catch {
}
let he = "unknown";
U != null && U.tgWebAppPlatform && (he = U.tgWebAppPlatform ?? "unknown");
var ze, Je;
if (he === "unknown") {
const e = te();
he = ((Je = (ze = e == null ? void 0 : e.Telegram) == null ? void 0 : ze.WebApp) == null ? void 0 : Je.platform) ?? "unknown";
}
let Z = "6.0";
U != null && U.tgWebAppVersion && (Z = U.tgWebAppVersion);
var $e, He;
if (!Z) {
const e = te();
Z = ((He = ($e = e == null ? void 0 : e.Telegram) == null ? void 0 : $e.WebApp) == null ? void 0 : He.version) ?? "6.0";
}
function xt(e, t) {
const n = new URL(e);
if (n.protocol !== "http:" && n.protocol !== "https:")
throw new X(`Url protocol is not supported: ${n}`);
if (n.hostname !== "t.me")
throw new X(`Url host is not supported: ${n}`);
const r = n.pathname + n.search;
Ke() || qt("6.1") ? Ut("web_app_open_tg_link", { path_full: r }) : Pt("https://t.me" + r);
}
function Ke() {
try {
const e = te();
return e ? e.parent != null && e !== e.parent : !1;
} catch {
return !1;
}
}
function Ut(e, t) {
try {
const n = te();
if (!n)
throw new X(
"Can't post event to parent window: window is not defined"
);
if (n.TelegramWebviewProxy !== void 0)
V("postEvent", e, t), n.TelegramWebviewProxy.postEvent(
e,
JSON.stringify(t)
);
else if (n.external && "notify" in n.external)
V("postEvent", e, t), n.external.notify(
JSON.stringify({ eventType: e, eventData: t })
);
else if (Ke()) {
const r = "*", s = JSON.stringify({
eventType: e,
eventData: t
});
V("postEvent", e, t), n.parent.postMessage(s, r);
} else
throw new X("Can't post event to TMA");
} catch (n) {
Ft(`Can't post event to parent window: ${n}`);
}
}
function Nt(e) {
e = e.replace(/^#/, "");
let t = {};
if (!e.length)
return t;
if (e.indexOf("=") < 0 && e.indexOf("?") < 0)
return t._path = Q(e), t;
let n = e.indexOf("?");
if (n >= 0) {
let s = e.substr(0, n);
t._path = Q(s), e = e.substr(n + 1);
}
let r = kt(e);
for (let s in r)
t[s] = r[s];
return t;
}
function Q(e) {
try {
return e = e.replace(/\+/g, "%20"), decodeURIComponent(e);
} catch {
return e;
}
}
function kt(e) {
let t = {};
if (!e.length)
return t;
let n = e.split("&"), r, s, o, i;
for (r = 0; r < n.length; r++)
s = n[r].split("="), o = Q(s[0]), i = s[1] == null ? null : Q(s[1]), t[o] = i;
return t;
}
function Lt(e, t) {
typeof e != "string" && (e = "");
let n = e.replace(/^\s+|\s+$/g, "").split("."), r = t.replace(/^\s+|\s+$/g, "").split("."), s, o, i, u;
for (s = Math.max(n.length, r.length), o = 0; o < s; o++)
if (i = parseInt(n[o]) || 0, u = parseInt(r[o]) || 0, i !== u)
return i > u ? 1 : -1;
return 0;
}
function qt(e) {
return Lt(Z, e) >= 0;
}
var Ge = { exports: {} };
(function(e) {
var t = Object.prototype.hasOwnProperty, n = "~";
function r() {
}
Object.create && (r.prototype = /* @__PURE__ */ Object.create(null), new r().__proto__ || (n = !1));
function s(f, l, a) {
this.fn = f, this.context = l, this.once = a || !1;
}
function o(f, l, a, c, m) {
if (typeof a != "function")
throw new TypeError("The listener must be a function");
var y = new s(a, c || f, m), p = n ? n + l : l;
return f._events[p] ? f._events[p].fn ? f._events[p] = [f._events[p], y] : f._events[p].push(y) : (f._events[p] = y, f._eventsCount++), f;
}
function i(f, l) {
--f._eventsCount === 0 ? f._events = new r() : delete f._events[l];
}
function u() {
this._events = new r(), this._eventsCount = 0;
}
u.prototype.eventNames = function() {
var l = [], a, c;
if (this._eventsCount === 0) return l;
for (c in a = this._events)
t.call(a, c) && l.push(n ? c.slice(1) : c);
return Object.getOwnPropertySymbols ? l.concat(Object.getOwnPropertySymbols(a)) : l;
}, u.prototype.listeners = function(l) {
var a = n ? n + l : l, c = this._events[a];
if (!c) return [];
if (c.fn) return [c.fn];
for (var m = 0, y = c.length, p = new Array(y); m < y; m++)
p[m] = c[m].fn;
return p;
}, u.prototype.listenerCount = function(l) {
var a = n ? n + l : l, c = this._events[a];
return c ? c.fn ? 1 : c.length : 0;
}, u.prototype.emit = function(l, a, c, m, y, p) {
var g = n ? n + l : l;
if (!this._events[g]) return !1;
var h = this._events[g], C = arguments.length, E, b;
if (h.fn) {
switch (h.once && this.removeListener(l, h.fn, void 0, !0), C) {
case 1:
return h.fn.call(h.context), !0;
case 2:
return h.fn.call(h.context, a), !0;
case 3:
return h.fn.call(h.context, a, c), !0;
case 4:
return h.fn.call(h.context, a, c, m), !0;
case 5:
return h.fn.call(h.context, a, c, m, y), !0;
case 6:
return h.fn.call(h.context, a, c, m, y, p), !0;
}
for (b = 1, E = new Array(C - 1); b < C; b++)
E[b - 1] = arguments[b];
h.fn.apply(h.context, E);
} else {
var O = h.length, R;
for (b = 0; b < O; b++)
switch (h[b].once && this.removeListener(l, h[b].fn, void 0, !0), C) {
case 1:
h[b].fn.call(h[b].context);
break;
case 2:
h[b].fn.call(h[b].context, a);
break;
case 3:
h[b].fn.call(h[b].context, a, c);
break;
case 4:
h[b].fn.call(h[b].context, a, c, m);
break;
default:
if (!E) for (R = 1, E = new Array(C - 1); R < C; R++)
E[R - 1] = arguments[R];
h[b].fn.apply(h[b].context, E);
}
}
return !0;
}, u.prototype.on = function(l, a, c) {
return o(this, l, a, c, !1);
}, u.prototype.once = function(l, a, c) {
return o(this, l, a, c, !0);
}, u.prototype.removeListener = function(l, a, c, m) {
var y = n ? n + l : l;
if (!this._events[y]) return this;
if (!a)
return i(this, y), this;
var p = this._events[y];
if (p.fn)
p.fn === a && (!m || p.once) && (!c || p.context === c) && i(this, y);
else {
for (var g = 0, h = [], C = p.length; g < C; g++)
(p[g].fn !== a || m && !p[g].once || c && p[g].context !== c) && h.push(p[g]);
h.length ? this._events[y] = h.length === 1 ? h[0] : h : i(this, y);
}
return this;
}, u.prototype.removeAllListeners = function(l) {
var a;
return l ? (a = n ? n + l : l, this._events[a] && i(this, a)) : (this._events = new r(), this._eventsCount = 0), this;
}, u.prototype.off = u.prototype.removeListener, u.prototype.addListener = u.prototype.on, u.prefixed = n, u.EventEmitter = u, e.exports = u;
})(Ge);
var It = Ge.exports;
const Xe = /* @__PURE__ */ _t(It), Bt = "0.0.4", Te = {
id: "Unielon",
version: Bt,
name: "Unielon Wallet based on Telegram",
homepage: "https://unielon.com",
description: "Unielon Wallet based on Telegram",
downloadLinks: {
telegram: "https://t.me/unielonbot/app",
browserExtension: {
chrome: ""
}
},
deepLinks: {
direct_link: "https://t.me/unielonbot/wallet"
}
}, W = {
connect_url: "https://bridge.unielon.com",
connect_direct_link: "https://t.me/unielonbot/wallet"
};
function Ze(e, t) {
return function() {
return e.apply(t, arguments);
};
}
const { toString: jt } = Object.prototype, { getPrototypeOf: Ee } = Object, ne = /* @__PURE__ */ ((e) => (t) => {
const n = jt.call(t);
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), P = (e) => (e = e.toLowerCase(), (t) => ne(t) === e), re = (e) => (t) => typeof t === e, { isArray: B } = Array, z = re("undefined");
function Mt(e) {
return e !== null && !z(e) && e.constructor !== null && !z(e.constructor) && F(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const Qe = P("ArrayBuffer");
function Dt(e) {
let t;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Qe(e.buffer), t;
}
const Wt = re("string"), F = re("function"), Ye = re("number"), se = (e) => e !== null && typeof e == "object", zt = (e) => e === !0 || e === !1, K = (e) => {
if (ne(e) !== "object")
return !1;
const t = Ee(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
}, Jt = P("Date"), $t = P("File"), Ht = P("Blob"), Vt = P("FileList"), Kt = (e) => se(e) && F(e.pipe), Gt = (e) => {
let t;
return e && (typeof FormData == "function" && e instanceof FormData || F(e.append) && ((t = ne(e)) === "formdata" || // detect form-data instance
t === "object" && F(e.toString) && e.toString() === "[object FormData]"));
}, Xt = P("URLSearchParams"), [Zt, Qt, Yt, en] = ["ReadableStream", "Request", "Response", "Headers"].map(P), tn = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function J(e, t, { allOwnKeys: n = !1 } = {}) {
if (e === null || typeof e > "u")
return;
let r, s;
if (typeof e != "object" && (e = [e]), B(e))
for (r = 0, s = e.length; r < s; r++)
t.call(null, e[r], r, e);
else {
const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
let u;
for (r = 0; r < i; r++)
u = o[r], t.call(null, e[u], u, e);
}
}
function et(e, t) {
t = t.toLowerCase();
const n = Object.keys(e);
let r = n.length, s;
for (; r-- > 0; )
if (s = n[r], t === s.toLowerCase())
return s;
return null;
}
const L = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, tt = (e) => !z(e) && e !== L;
function pe() {
const { caseless: e } = tt(this) && this || {}, t = {}, n = (r, s) => {
const o = e && et(t, s) || s;
K(t[o]) && K(r) ? t[o] = pe(t[o], r) : K(r) ? t[o] = pe({}, r) : B(r) ? t[o] = r.slice() : t[o] = r;
};
for (let r = 0, s = arguments.length; r < s; r++)
arguments[r] && J(arguments[r], n);
return t;
}
const nn = (e, t, n, { allOwnKeys: r } = {}) => (J(t, (s, o) => {
n && F(s) ? e[o] = Ze(s, n) : e[o] = s;
}, { allOwnKeys: r }), e), rn = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), sn = (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);
}, on = (e, t, n, r) => {
let s, o, i;
const u = {};
if (t = t || {}, e == null) return t;
do {
for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
i = s[o], (!r || r(i, e, t)) && !u[i] && (t[i] = e[i], u[i] = !0);
e = n !== !1 && Ee(e);
} while (e && (!n || n(e, t)) && e !== Object.prototype);
return t;
}, an = (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;
}, cn = (e) => {
if (!e) return null;
if (B(e)) return e;
let t = e.length;
if (!Ye(t)) return null;
const n = new Array(t);
for (; t-- > 0; )
n[t] = e[t];
return n;
}, ln = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Ee(Uint8Array)), un = (e, t) => {
const r = (e && e[Symbol.iterator]).call(e);
let s;
for (; (s = r.next()) && !s.done; ) {
const o = s.value;
t.call(e, o[0], o[1]);
}
}, dn = (e, t) => {
let n;
const r = [];
for (; (n = e.exec(t)) !== null; )
r.push(n);
return r;
}, fn = P("HTMLFormElement"), hn = (e) => e.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(n, r, s) {
return r.toUpperCase() + s;
}
), Fe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), pn = P("RegExp"), nt = (e, t) => {
const n = Object.getOwnPropertyDescriptors(e), r = {};
J(n, (s, o) => {
let i;
(i = t(s, o, e)) !== !1 && (r[o] = i || s);
}), Object.defineProperties(e, r);
}, mn = (e) => {
nt(e, (t, n) => {
if (F(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
return !1;
const r = e[n];
if (F(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 + "'");
});
}
});
}, gn = (e, t) => {
const n = {}, r = (s) => {
s.forEach((o) => {
n[o] = !0;
});
};
return B(e) ? r(e) : r(String(e).split(t)), n;
}, yn = () => {
}, wn = (e, t) => e != null && Number.isFinite(e = +e) ? e : t, ce = "abcdefghijklmnopqrstuvwxyz", ve = "0123456789", rt = {
DIGIT: ve,
ALPHA: ce,
ALPHA_DIGIT: ce + ce.toUpperCase() + ve
}, bn = (e = 16, t = rt.ALPHA_DIGIT) => {
let n = "";
const { length: r } = t;
for (; e--; )
n += t[Math.random() * r | 0];
return n;
};
function Cn(e) {
return !!(e && F(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
}
const En = (e) => {
const t = new Array(10), n = (r, s) => {
if (se(r)) {
if (t.indexOf(r) >= 0)
return;
if (!("toJSON" in r)) {
t[s] = r;
const o = B(r) ? [] : {};
return J(r, (i, u) => {
const f = n(i, s + 1);
!z(f) && (o[u] = f);
}), t[s] = void 0, o;
}
}
return r;
};
return n(e, 0);
}, Sn = P("AsyncFunction"), Rn = (e) => e && (se(e) || F(e)) && F(e.then) && F(e.catch), st = ((e, t) => e ? setImmediate : t ? ((n, r) => (L.addEventListener("message", ({ source: s, data: o }) => {
s === L && o === n && r.length && r.shift()();
}, !1), (s) => {
r.push(s), L.postMessage(n, "*");
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
typeof setImmediate == "function",
F(L.postMessage)
), _n = typeof queueMicrotask < "u" ? queueMicrotask.bind(L) : typeof process < "u" && process.nextTick || st, d = {
isArray: B,
isArrayBuffer: Qe,
isBuffer: Mt,
isFormData: Gt,
isArrayBufferView: Dt,
isString: Wt,
isNumber: Ye,
isBoolean: zt,
isObject: se,
isPlainObject: K,
isReadableStream: Zt,
isRequest: Qt,
isResponse: Yt,
isHeaders: en,
isUndefined: z,
isDate: Jt,
isFile: $t,
isBlob: Ht,
isRegExp: pn,
isFunction: F,
isStream: Kt,
isURLSearchParams: Xt,
isTypedArray: ln,
isFileList: Vt,
forEach: J,
merge: pe,
extend: nn,
trim: tn,
stripBOM: rn,
inherits: sn,
toFlatObject: on,
kindOf: ne,
kindOfTest: P,
endsWith: an,
toArray: cn,
forEachEntry: un,
matchAll: dn,
isHTMLForm: fn,
hasOwnProperty: Fe,
hasOwnProp: Fe,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: nt,
freezeMethods: mn,
toObjectSet: gn,
toCamelCase: hn,
noop: yn,
toFiniteNumber: wn,
findKey: et,
global: L,
isContextDefined: tt,
ALPHABET: rt,
generateString: bn,
isSpecCompliantForm: Cn,
toJSONObject: En,
isAsyncFn: Sn,
isThenable: Rn,
setImmediate: st,
asap: _n
};
function w(e, t, n, r, s) {
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), s && (this.response = s, this.status = s.status ? s.status : null);
}
d.inherits(w, 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: d.toJSONObject(this.config),
code: this.code,
status: this.status
};
}
});
const ot = w.prototype, it = {};
[
"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) => {
it[e] = { value: e };
});
Object.defineProperties(w, it);
Object.defineProperty(ot, "isAxiosError", { value: !0 });
w.from = (e, t, n, r, s, o) => {
const i = Object.create(ot);
return d.toFlatObject(e, i, function(f) {
return f !== Error.prototype;
}, (u) => u !== "isAxiosError"), w.call(i, e.message, t, n, r, s), i.cause = e, i.name = e.name, o && Object.assign(i, o), i;
};
const On = null;
function me(e) {
return d.isPlainObject(e) || d.isArray(e);
}
function at(e) {
return d.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function Pe(e, t, n) {
return e ? e.concat(t).map(function(s, o) {
return s = at(s), !n && o ? "[" + s + "]" : s;
}).join(n ? "." : "") : t;
}
function An(e) {
return d.isArray(e) && !e.some(me);
}
const Tn = d.toFlatObject(d, {}, null, function(t) {
return /^is[A-Z]/.test(t);
});
function oe(e, t, n) {
if (!d.isObject(e))
throw new TypeError("target must be an object");
t = t || new FormData(), n = d.toFlatObject(n, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(g, h) {
return !d.isUndefined(h[g]);
});
const r = n.metaTokens, s = n.visitor || a, o = n.dots, i = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && d.isSpecCompliantForm(t);
if (!d.isFunction(s))
throw new TypeError("visitor must be a function");
function l(p) {
if (p === null) return "";
if (d.isDate(p))
return p.toISOString();
if (!f && d.isBlob(p))
throw new w("Blob is not supported. Use a Buffer instead.");
return d.isArrayBuffer(p) || d.isTypedArray(p) ? f && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
}
function a(p, g, h) {
let C = p;
if (p && !h && typeof p == "object") {
if (d.endsWith(g, "{}"))
g = r ? g : g.slice(0, -2), p = JSON.stringify(p);
else if (d.isArray(p) && An(p) || (d.isFileList(p) || d.endsWith(g, "[]")) && (C = d.toArray(p)))
return g = at(g), C.forEach(function(b, O) {
!(d.isUndefined(b) || b === null) && t.append(
// eslint-disable-next-line no-nested-ternary
i === !0 ? Pe([g], O, o) : i === null ? g : g + "[]",
l(b)
);
}), !1;
}
return me(p) ? !0 : (t.append(Pe(h, g, o), l(p)), !1);
}
const c = [], m = Object.assign(Tn, {
defaultVisitor: a,
convertValue: l,
isVisitable: me
});
function y(p, g) {
if (!d.isUndefined(p)) {
if (c.indexOf(p) !== -1)
throw Error("Circular reference detected in " + g.join("."));
c.push(p), d.forEach(p, function(C, E) {
(!(d.isUndefined(C) || C === null) && s.call(
t,
C,
d.isString(E) ? E.trim() : E,
g,
m
)) === !0 && y(C, g ? g.concat(E) : [E]);
}), c.pop();
}
}
if (!d.isObject(e))
throw new TypeError("data must be an object");
return y(e), t;
}
function xe(e) {
const t = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
return t[r];
});
}
function Se(e, t) {
this._pairs = [], e && oe(e, this, t);
}
const ct = Se.prototype;
ct.append = function(t, n) {
this._pairs.push([t, n]);
};
ct.toString = function(t) {
const n = t ? function(r) {
return t.call(this, r, xe);
} : xe;
return this._pairs.map(function(s) {
return n(s[0]) + "=" + n(s[1]);
}, "").join("&");
};
function Fn(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function lt(e, t, n) {
if (!t)
return e;
const r = n && n.encode || Fn, s = n && n.serialize;
let o;
if (s ? o = s(t, n) : o = d.isURLSearchParams(t) ? t.toString() : new Se(t, n).toString(r), o) {
const i = e.indexOf("#");
i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
}
return e;
}
class Ue {
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) {
d.forEach(this.handlers, function(r) {
r !== null && t(r);
});
}
}
const ut = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, vn = typeof URLSearchParams < "u" ? URLSearchParams : Se, Pn = typeof FormData < "u" ? FormData : null, xn = typeof Blob < "u" ? Blob : null, Un = {
isBrowser: !0,
classes: {
URLSearchParams: vn,
FormData: Pn,
Blob: xn
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, Re = typeof window < "u" && typeof document < "u", ge = typeof navigator == "object" && navigator || void 0, Nn = Re && (!ge || ["ReactNative", "NativeScript", "NS"].indexOf(ge.product) < 0), kn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Ln = Re && window.location.href || "http://localhost", qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: Re,
hasStandardBrowserEnv: Nn,
hasStandardBrowserWebWorkerEnv: kn,
navigator: ge,
origin: Ln
}, Symbol.toStringTag, { value: "Module" })), A = {
...qn,
...Un
};
function In(e, t) {
return oe(e, new A.classes.URLSearchParams(), Object.assign({
visitor: function(n, r, s, o) {
return A.isNode && d.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
}
}, t));
}
function Bn(e) {
return d.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function jn(e) {
const t = {}, n = Object.keys(e);
let r;
const s = n.length;
let o;
for (r = 0; r < s; r++)
o = n[r], t[o] = e[o];
return t;
}
function dt(e) {
function t(n, r, s, o) {
let i = n[o++];
if (i === "__proto__") return !0;
const u = Number.isFinite(+i), f = o >= n.length;
return i = !i && d.isArray(s) ? s.length : i, f ? (d.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !u) : ((!s[i] || !d.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && d.isArray(s[i]) && (s[i] = jn(s[i])), !u);
}
if (d.isFormData(e) && d.isFunction(e.entries)) {
const n = {};
return d.forEachEntry(e, (r, s) => {
t(Bn(r), s, n, 0);
}), n;
}
return null;
}
function Mn(e, t, n) {
if (d.isString(e))
try {
return (t || JSON.parse)(e), d.trim(e);
} catch (r) {
if (r.name !== "SyntaxError")
throw r;
}
return (0, JSON.stringify)(e);
}
const $ = {
transitional: ut,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(t, n) {
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = d.isObject(t);
if (o && d.isHTMLForm(t) && (t = new FormData(t)), d.isFormData(t))
return s ? JSON.stringify(dt(t)) : t;
if (d.isArrayBuffer(t) || d.isBuffer(t) || d.isStream(t) || d.isFile(t) || d.isBlob(t) || d.isReadableStream(t))
return t;
if (d.isArrayBufferView(t))
return t.buffer;
if (d.isURLSearchParams(t))
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
let u;
if (o) {
if (r.indexOf("application/x-www-form-urlencoded") > -1)
return In(t, this.formSerializer).toString();
if ((u = d.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
const f = this.env && this.env.FormData;
return oe(
u ? { "files[]": t } : t,
f && new f(),
this.formSerializer
);
}
}
return o || s ? (n.setContentType("application/json", !1), Mn(t)) : t;
}],
transformResponse: [function(t) {
const n = this.transitional || $.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
if (d.isResponse(t) || d.isReadableStream(t))
return t;
if (t && d.isString(t) && (r && !this.responseType || s)) {
const i = !(n && n.silentJSONParsing) && s;
try {
return JSON.parse(t);
} catch (u) {
if (i)
throw u.name === "SyntaxError" ? w.from(u, w.ERR_BAD_RESPONSE, this, null, this.response) : u;
}
}
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
}
}
};
d.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
$.headers[e] = {};
});
const Dn = d.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"
]), Wn = (e) => {
const t = {};
let n, r, s;
return e && e.split(`
`).forEach(function(i) {
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && Dn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
}), t;
}, Ne = Symbol("internals");
function M(e) {
return e && String(e).trim().toLowerCase();
}
function G(e) {
return e === !1 || e == null ? e : d.isArray(e) ? e.map(G) : String(e);
}
function zn(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 Jn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
function le(e, t, n, r, s) {
if (d.isFunction(r))
return r.call(this, t, n);
if (s && (t = n), !!d.isString(t)) {
if (d.isString(r))
return t.indexOf(r) !== -1;
if (d.isRegExp(r))
return r.test(t);
}
}
function $n(e) {
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
}
function Hn(e, t) {
const n = d.toCamelCase(" " + t);
["get", "set", "has"].forEach((r) => {
Object.defineProperty(e, r + n, {
value: function(s, o, i) {
return this[r].call(this, t, s, o, i);
},
configurable: !0
});
});
}
class T {
constructor(t) {
t && this.set(t);
}
set(t, n, r) {
const s = this;
function o(u, f, l) {
const a = M(f);
if (!a)
throw new Error("header name must be a non-empty string");
const c = d.findKey(s, a);
(!c || s[c] === void 0 || l === !0 || l === void 0 && s[c] !== !1) && (s[c || f] = G(u));
}
const i = (u, f) => d.forEach(u, (l, a) => o(l, a, f));
if (d.isPlainObject(t) || t instanceof this.constructor)
i(t, n);
else if (d.isString(t) && (t = t.trim()) && !Jn(t))
i(Wn(t), n);
else if (d.isHeaders(t))
for (const [u, f] of t.entries())
o(f, u, r);
else
t != null && o(n, t, r);
return this;
}
get(t, n) {
if (t = M(t), t) {
const r = d.findKey(this, t);
if (r) {
const s = this[r];
if (!n)
return s;
if (n === !0)
return zn(s);
if (d.isFunction(n))
return n.call(this, s, r);
if (d.isRegExp(n))
return n.exec(s);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(t, n) {
if (t = M(t), t) {
const r = d.findKey(this, t);
return !!(r && this[r] !== void 0 && (!n || le(this, this[r], r, n)));
}
return !1;
}
delete(t, n) {
const r = this;
let s = !1;
function o(i) {
if (i = M(i), i) {
const u = d.findKey(r, i);
u && (!n || le(r, r[u], u, n)) && (delete r[u], s = !0);
}
}
return d.isArray(t) ? t.forEach(o) : o(t), s;
}
clear(t) {
const n = Object.keys(this);
let r = n.length, s = !1;
for (; r--; ) {
const o = n[r];
(!t || le(this, this[o], o, t, !0)) && (delete this[o], s = !0);
}
return s;
}
normalize(t) {
const n = this, r = {};
return d.forEach(this, (s, o) => {
const i = d.findKey(r, o);
if (i) {
n[i] = G(s), delete n[o];
return;
}
const u = t ? $n(o) : String(o).trim();
u !== o && delete n[o], n[u] = G(s), r[u] = !0;
}), this;
}
concat(...t) {
return this.constructor.concat(this, ...t);
}
toJSON(t) {
const n = /* @__PURE__ */ Object.create(null);
return d.forEach(this, (r, s) => {
r != null && r !== !1 && (n[s] = t && d.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(`
`);
}
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((s) => r.set(s)), r;
}
static accessor(t) {
const r = (this[Ne] = this[Ne] = {
accessors: {}
}).accessors, s = this.prototype;
function o(i) {
const u = M(i);
r[u] || (Hn(s, i), r[u] = !0);
}
return d.isArray(t) ? t.forEach(o) : o(t), this;
}
}
T.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
d.reduceDescriptors(T.prototype, ({ value: e }, t) => {
let n = t[0].toUpperCase() + t.slice(1);
return {
get: () => e,
set(r) {
this[n] = r;
}
};
});
d.freezeMethods(T);
function ue(e, t) {
const n = this || $, r = t || n, s = T.from(r.headers);
let o = r.data;
return d.forEach(e, function(u) {
o = u.call(n, o, s.normalize(), t ? t.status : void 0);
}), s.normalize(), o;
}
function ft(e) {
return !!(e && e.__CANCEL__);
}
function j(e, t, n) {
w.call(this, e ?? "canceled", w.ERR_CANCELED, t, n), this.name = "CanceledError";
}
d.inherits(j, w, {
__CANCEL__: !0
});
function ht(e, t, n) {
const r = n.config.validateStatus;
!n.status || !r || r(n.status) ? e(n) : t(new w(
"Request failed with status code " + n.status,
[w.ERR_BAD_REQUEST, w.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
n.config,
n.request,
n
));
}
function Vn(e) {
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
return t && t[1] || "";
}
function Kn(e, t) {
e = e || 10;
const n = new Array(e), r = new Array(e);
let s = 0, o = 0, i;
return t = t !== void 0 ? t : 1e3, function(f) {
const l = Date.now(), a = r[o];
i || (i = l), n[s] = f, r[s] = l;
let c = o, m = 0;
for (; c !== s; )
m += n[c++], c = c % e;
if (s = (s + 1) % e, s === o && (o = (o + 1) % e), l - i < t)
return;
const y = a && l - a;
return y ? Math.round(m * 1e3 / y) : void 0;
};
}
function Gn(e, t) {
let n = 0, r = 1e3 / t, s, o;
const i = (l, a = Date.now()) => {
n = a, s = null, o && (clearTimeout(o), o = null), e.apply(null, l);
};
return [(...l) => {
const a = Date.now(), c = a - n;
c >= r ? i(l, a) : (s = l, o || (o = setTimeout(() => {
o = null, i(s);
}, r - c)));
}, () => s && i(s)];
}
const Y = (e, t, n = 3) => {
let r = 0;
const s = Kn(50, 250);
return Gn((o) => {
const i = o.loaded, u = o.lengthComputable ? o.total : void 0, f = i - r, l = s(f), a = i <= u;
r = i;
const c = {
loaded: i,
total: u,
progress: u ? i / u : void 0,
bytes: f,
rate: l || void 0,
estimated: l && u && a ? (u - i) / l : void 0,
event: o,
lengthComputable: u != null,
[t ? "download" : "upload"]: !0
};
e(c);
}, n);
}, ke = (e, t) => {
const n = e != null;
return [(r) => t[0]({
lengthComputable: n,
total: e,
loaded: r
}), t[1]];
}, Le = (e) => (...t) => d.asap(() => e(...t)), Xn = A.hasStandardBrowserEnv ? (
// Standard browser envs have full support of the APIs needed to test
// whether the request URL is of the same origin as current location.
function() {
const t = A.navigator && /(msie|trident)/i.test(A.navigator.userAgent), n = document.createElement("a");
let r;
function s(o) {
let i = o;
return t && (n.setAttribute("href", i), i = n.href), n.setAttribute("href", i), {
href: n.href,
protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
host: n.host,
search: n.search ? n.search.replace(/^\?/, "") : "",
hash: n.hash ? n.hash.replace(/^#/, "") : "",
hostname: n.hostname,
port: n.port,
pathname: n.pathname.charAt(0) === "/" ? n.pathname : "/" + n.pathname
};
}
return r = s(window.location.href), function(i) {
const u = d.isString(i) ? s(i) : i;
return u.protocol === r.protocol && u.host === r.host;
};
}()
) : (
// Non standard browser envs (web workers, react-native) lack needed support.
/* @__PURE__ */ function() {
return function() {
return !0;
};
}()
), Zn = A.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(e, t, n, r, s, o) {
const i = [e + "=" + encodeURIComponent(t)];
d.isNumber(n) && i.push("expires=" + new Date(n).toGMTString()), d.isString(r) && i.push("path=" + r), d.isString(s) && i.push("domain=" + s), o === !0 && i.push("secure"), document.cookie = i.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 Qn(e) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}
function Yn(e, t) {
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
}
function pt(e, t) {
return e && !Qn(t) ? Yn(e, t) : t;
}
const qe = (e) => e instanceof T ? { ...e } : e;
function I(e, t) {
t = t || {};
const n = {};
function r(l, a, c) {
return d.isPlainObject(l) && d.isPlainObject(a) ? d.merge.call({ caseless: c }, l, a) : d.isPlainObject(a) ? d.merge({}, a) : d.isArray(a) ? a.slice() : a;
}
function s(l, a, c) {
if (d.isUndefined(a)) {
if (!d.isUndefined(l))
return r(void 0, l, c);
} else return r(l, a, c);
}
function o(l, a) {
if (!d.isUndefined(a))
return r(void 0, a);
}
function i(l, a) {
if (d.isUndefined(a)) {
if (!d.isUndefined(l))
return r(void 0, l);
} else return r(void 0, a);
}
function u(l, a, c) {
if (c in t)
return r(l, a);
if (c in e)
return r(void 0, l);
}
const f = {
url: o,
method: o,
data: o,
baseURL: i,
transformRequest: i,
transformResponse: i,
paramsSerializer: i,
timeout: i,
timeoutMessage: i,
withCredentials: i,
withXSRFToken: i,
adapter: i,
responseType: i,
xsrfCookieName: i,
xsrfHeaderName: i,
onUploadProgress: i,
onDownloadProgress: i,
decompress: i,
maxContentLength: i,
maxBodyLength: i,
beforeRedirect: i,
transport: i,
httpAgent: i,
httpsAgent: i,
cancelToken: i,
socketPath: i,
responseEncoding: i,
validateStatus: u,
headers: (l, a) => s(qe(l), qe(a), !0)
};
return d.forEach(Object.keys(Object.assign({}, e, t)), function(a) {
const c = f[a] || s, m = c(e[a], t[a], a);
d.isUndefined(m) && c !== u || (n[a] = m);
}), n;
}
const mt = (e) => {
const t = I({}, e);
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: u } = t;
t.headers = i = T.from(i), t.url = lt(pt(t.baseURL, t.url), e.params, e.paramsSerializer), u && i.set(
"Authorization",
"Basic " + btoa((u.username || "") + ":" + (u.password ? unescape(encodeURIComponent(u.password)) : ""))
);
let f;
if (d.isFormData(n)) {
if (A.hasStandardBrowserEnv || A.hasStandardBrowserWebWorkerEnv)
i.setContentType(void 0);
else if ((f = i.getContentType()) !== !1) {
const [l, ...a] = f ? f.split(";").map((c) => c.trim()).filter(Boolean) : [];
i.setContentType([l || "multipart/form-data", ...a].join("; "));
}
}
if (A.hasStandardBrowserEnv && (r && d.isFunction(r) && (r = r(t)), r || r !== !1 && Xn(t.url))) {
const l = s && o && Zn.read(o);
l && i.set(s, l);
}
return t;
}, er = typeof XMLHttpRequest < "u", tr = er && function(e) {
return new Promise(function(n, r) {
const s = mt(e);
let o = s.data;
const i = T.from(s.headers).normalize();
let { responseType: u, onUploadProgress: f, onDownloadProgress: l } = s, a, c, m, y, p;
function g() {
y && y(), p && p(), s.cancelToken && s.cancelToken.unsubscribe(a), s.signal && s.signal.removeEventListener("abort", a);
}
let h = new XMLHttpRequest();
h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
function C() {
if (!h)
return;
const b = T.from(
"getAllResponseHeaders" in h && h.getAllResponseHeaders()
), R = {
data: !u || u === "text" || u === "json" ? h.responseText : h.response,
status: h.status,
statusText: h.statusText,
headers: b,
config: e,
request: h
};
ht(function(x) {
n(x), g();
}, function(x) {
r(x), g();
}, R), h = null;
}
"onloadend" in h ? h.onloadend = C : h.onreadystatechange = function() {
!h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(C);
}, h.onabort = function() {
h && (r(new w("Request aborted", w.ECONNABORTED, e, h)), h = null);
}, h.onerror = function() {
r(new w("Network Error", w.ERR_NETWORK, e, h)), h = null;
}, h.ontimeout = function() {
let O = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
const R = s.transitional || ut;
s.timeoutErrorMessage && (O = s.timeoutErrorMessage), r(new w(
O,
R.clarifyTimeoutError ? w.ETIMEDOUT : w.ECONNABORTED,
e,
h
)), h = null;
}, o === void 0 && i.setContentType(null), "setRequestHeader" in h && d.forEach(i.toJSON(), function(O, R) {
h.setRequestHeader(R, O);
}), d.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), u && u !== "json" && (h.responseType = s.responseType), l && ([m, p] = Y(l, !0), h.addEventListener("progress", m)), f && h.upload && ([c, y] = Y(f), h.upload.addEventListener("progress", c), h.upload.addEventListener("loadend", y)), (s.cance