@corgicoding-el/dialog-form-grid
Version:
基于 @corgicoding-el/data-form-grid 和 @corgicoding-el/custom-dialog 的弹窗表单组件
1,724 lines • 338 kB
JavaScript
import { defineComponent as k, ref as j, computed as C, inject as Q, resolveComponent as M, openBlock as T, createBlock as P, mergeProps as q, toHandlers as re, createSlots as Ni, withCtx as F, createElementVNode as B, renderSlot as Y, normalizeClass as H, toDisplayString as Z, createElementBlock as A, createVNode as J, createCommentVNode as $, createTextVNode as fe, unref as h, watch as W, Transition as ft, withDirectives as ue, normalizeStyle as Me, vShow as mt, shallowReactive as To, onMounted as tt, resolveDynamicComponent as nn, Fragment as V, withModifiers as Yn, renderList as ke, resolveDirective as ji, warn as xo, getCurrentInstance as X, getCurrentScope as Zn, onScopeDispose as Qn, readonly as Xn, provide as Co, isVNode as ht, shallowRef as Ne, nextTick as rn, isRef as yt, render as st } from "vue";
import { useI18n as gt } from "vue-i18n";
const Mc = {
cancel: "Cancel",
sumbit: "Submit"
}, zc = {
button: Mc
}, Vc = {
cancel: "取消",
sumbit: "提交"
}, qc = {
button: Vc
}, Hc = { class: "elibs-component__custom-dialog-header" }, Kc = ["id"], Jc = ["onClick"], Wc = { class: "elibs-component__custom-dialog-footer" }, Gc = { class: "elibs-component__custom-dialog-footer-suffix" }, Yc = { class: "dialog-footer" }, wn = /* @__PURE__ */ k({
__name: "CustomDialog",
props: {
modelValue: { type: Boolean, default: !0 },
title: { default: void 0 },
destroyOnClose: { type: Boolean, default: !0 },
confirmText: { default: void 0 },
cancelText: { default: void 0 },
loading: { type: Boolean, default: !1 },
width: { default: 700 },
disabled: { type: Boolean, default: !1 },
showCancel: { type: Boolean, default: !0 },
showFooter: { type: Boolean, default: !0 },
showClose: { type: Boolean, default: !0 },
noPadding: { type: Boolean, default: !1 },
draggable: { type: Boolean, default: !0 },
closeOnClickModal: { type: Boolean, default: !1 },
ignoreGlobal: { type: Boolean },
componentOptions: { default: () => ({}) },
eventOptions: { default: () => ({}) }
},
emits: [
"update:modelValue",
"confirm",
// 提交按钮触发
"cancel"
// 取消按钮触发
],
setup(e, { expose: t, emit: n }) {
const { t: r } = gt({
messages: {
"zh-CN": {
...qc
},
en: {
...zc
}
}
}), o = j(), a = e, s = n, i = C({
get: () => a.modelValue,
set: (f) => {
s("update:modelValue", f);
}
}), u = Q("system-configs", {
dialog: {
draggable: a.draggable,
closeOnClickModal: a.closeOnClickModal
}
}), l = C(() => {
if (!a.ignoreGlobal && typeof u == "object" && typeof u.dialog == "object") {
const {
draggable: f = a.draggable,
closeOnClickModal: p = a.closeOnClickModal
} = u.dialog;
return {
draggable: f,
closeOnClickModal: p
};
}
return {
draggable: a.draggable,
closeOnClickModal: a.closeOnClickModal
};
}), d = () => {
s("confirm");
}, c = () => {
s("cancel"), i.value = !1;
};
return t({
/**
* @description el-dialog挂载ref
*/
elRef: o
}), (f, p) => {
const m = M("Close"), v = M("el-icon"), y = M("el-button"), w = M("el-dialog");
return T(), P(w, q({
ref_key: "dialogRef",
ref: o,
modelValue: i.value,
"onUpdate:modelValue": p[0] || (p[0] = (E) => i.value = E),
draggable: l.value.draggable,
"destroy-on-close": f.destroyOnClose,
width: f.width,
"append-to-body": !0,
"lock-scroll": !1,
class: ["elibs-component__custom-dialog", {
"elibs-component__custom-dialog-nopadding": f.noPadding
}],
"before-close": c,
"show-close": !1,
"close-on-click-modal": l.value.closeOnClickModal != !1,
style: { "--el-dialog-title-font-size": "1rem", "--el-dialog-border-radius": "8px" }
}, f.componentOptions || {}, re(f.eventOptions || {})), Ni({
header: F(({ close: E, titleId: g, titleClass: x }) => [
B("div", Hc, [
Y(f.$slots, "title", {}, () => [
B("div", {
id: g,
class: H(["elibs-component__custom-dialog-title", x])
}, Z(f.title), 11, Kc)
]),
f.showClose ? (T(), A("div", {
key: 0,
class: "elibs-component__custom-dialog-close",
onClick: E
}, [
J(v, null, {
default: F(() => [
J(m)
]),
_: 1
})
], 8, Jc)) : $("", !0)
])
]),
default: F(() => [
Y(f.$slots, "default")
]),
_: 2
}, [
f.showFooter ? {
name: "footer",
fn: F(() => [
Y(f.$slots, "footer", {}, () => [
B("div", Wc, [
B("div", Gc, [
Y(f.$slots, "footer-suffix")
]),
B("span", Yc, [
f.showCancel ? (T(), P(y, {
key: 0,
onClick: c
}, {
default: F(() => [
fe(Z(f.cancelText || h(r)("button.cancel")), 1)
]),
_: 1
})) : $("", !0),
J(y, {
type: "primary",
loading: f.loading,
disabled: f.disabled,
onClick: d
}, {
default: F(() => [
fe(Z(f.confirmText || h(r)("button.sumbit")), 1)
]),
_: 1
}, 8, ["loading", "disabled"])
])
])
])
]),
key: "0"
} : void 0
]), 1040, ["modelValue", "draggable", "destroy-on-close", "width", "class", "close-on-click-modal"]);
};
}
});
wn.install = (e, t) => {
t && t.configs && e.provide("system-configs", t.configs), e.component(wn.__name, wn);
};
const Zc = [
"select",
"remoteSelect",
"remoteTreeSelect",
"dictSelect",
"dictCheckbox",
"dictRadio",
"checkbox",
"radio",
"date",
"datetime",
"datetimerange",
"daterange",
"year",
"yearrange",
"month",
"monthrange",
"week",
"weekrange"
], Qc = [
"date",
"datetime",
"daterange",
"year",
"month",
"week",
"datetimerange"
], ya = {
date: "YYYY-MM-DD",
datetime: "YYYY-MM-DD HH:mm:ss",
daterange: "YYYY-MM-DD",
year: "YYYY",
month: "MM",
datetimerange: "YYYY-MM-DD HH:mm:ss"
}, Xc = [
"dictSelect",
"dictCheckbox",
"dictRadio"
], ed = ["select", "radio", "checkbox"], td = [
"uploadImage",
"uploadFiles",
"remoteSelect",
"remoteTreeSelect"
];
function nd(e) {
return Zn() ? (Qn(e), !0) : !1;
}
function $e(e) {
return typeof e == "function" ? e() : h(e);
}
const rd = typeof window < "u" && typeof document < "u";
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
const od = Object.prototype.toString, ad = (e) => od.call(e) === "[object Object]", $r = () => {
};
function sd(e, t) {
function n(...r) {
return new Promise((o, a) => {
Promise.resolve(e(() => t.apply(this, r), { fn: t, thisArg: this, args: r })).then(o).catch(a);
});
}
return n;
}
const Pi = (e) => e();
function id(e = Pi) {
const t = j(!0);
function n() {
t.value = !1;
}
function r() {
t.value = !0;
}
const o = (...a) => {
t.value && e(...a);
};
return { isActive: Xn(t), pause: n, resume: r, eventFilter: o };
}
function Ur(e, t = !1, n = "Timeout") {
return new Promise((r, o) => {
setTimeout(t ? () => o(n) : r, e);
});
}
function ld(e) {
return X();
}
function ud(e, t, n = {}) {
const {
eventFilter: r = Pi,
...o
} = n;
return W(
e,
sd(
r,
t
),
o
);
}
function cd(e, t, n = {}) {
const {
eventFilter: r,
...o
} = n, { eventFilter: a, pause: s, resume: i, isActive: u } = id(r);
return { stop: ud(
e,
t,
{
...o,
eventFilter: a
}
), pause: s, resume: i, isActive: u };
}
function dd(e, t = !0, n) {
ld() ? tt(e, n) : t ? e() : rn(e);
}
function Mr(e, t = !1) {
function n(c, { flush: f = "sync", deep: p = !1, timeout: m, throwOnTimeout: v } = {}) {
let y = null;
const w = [new Promise((E) => {
y = W(
e,
(g) => {
c(g) !== t && (y == null || y(), E(g));
},
{
flush: f,
deep: p,
immediate: !0
}
);
})];
return m != null && w.push(
Ur(m, v).then(() => $e(e)).finally(() => y == null ? void 0 : y())
), Promise.race(w);
}
function r(c, f) {
if (!yt(c))
return n((g) => g === c, f);
const { flush: p = "sync", deep: m = !1, timeout: v, throwOnTimeout: y } = f ?? {};
let w = null;
const E = [new Promise((g) => {
w = W(
[e, c],
([x, R]) => {
t !== (x === R) && (w == null || w(), g(x));
},
{
flush: p,
deep: m,
immediate: !0
}
);
})];
return v != null && E.push(
Ur(v, y).then(() => $e(e)).finally(() => (w == null || w(), $e(e)))
), Promise.race(E);
}
function o(c) {
return n((f) => !!f, c);
}
function a(c) {
return r(null, c);
}
function s(c) {
return r(void 0, c);
}
function i(c) {
return n(Number.isNaN, c);
}
function u(c, f) {
return n((p) => {
const m = Array.from(p);
return m.includes(c) || m.includes($e(c));
}, f);
}
function l(c) {
return d(1, c);
}
function d(c = 1, f) {
let p = -1;
return n(() => (p += 1, p >= c), f);
}
return Array.isArray($e(e)) ? {
toMatch: n,
toContains: u,
changed: l,
changedTimes: d,
get not() {
return Mr(e, !t);
}
} : {
toMatch: n,
toBe: r,
toBeTruthy: o,
toBeNull: a,
toBeNaN: i,
toBeUndefined: s,
changed: l,
changedTimes: d,
get not() {
return Mr(e, !t);
}
};
}
function pd(e) {
return Mr(e);
}
function fd(e) {
var t;
const n = $e(e);
return (t = n == null ? void 0 : n.$el) != null ? t : n;
}
const zr = rd ? window : void 0;
function ga(...e) {
let t, n, r, o;
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, r, o] = e, t = zr) : [t, n, r, o] = e, !t)
return $r;
Array.isArray(n) || (n = [n]), Array.isArray(r) || (r = [r]);
const a = [], s = () => {
a.forEach((d) => d()), a.length = 0;
}, i = (d, c, f, p) => (d.addEventListener(c, f, p), () => d.removeEventListener(c, f, p)), u = W(
() => [fd(t), $e(o)],
([d, c]) => {
if (s(), !d)
return;
const f = ad(c) ? { ...c } : c;
a.push(
...n.flatMap((p) => r.map((m) => i(d, p, m, f)))
);
},
{ immediate: !0, flush: "post" }
), l = () => {
u(), s();
};
return nd(l), l;
}
function md(e, t, n) {
const {
immediate: r = !0,
delay: o = 0,
onError: a = $r,
onSuccess: s = $r,
resetOnExecute: i = !0,
shallow: u = !0,
throwError: l
} = n ?? {}, d = u ? Ne(t) : j(t), c = j(!1), f = j(!1), p = Ne(void 0);
async function m(w = 0, ...E) {
i && (d.value = t), p.value = void 0, c.value = !1, f.value = !0, w > 0 && await Ur(w);
const g = typeof e == "function" ? e(...E) : e;
try {
const x = await g;
d.value = x, c.value = !0, s(x);
} catch (x) {
if (p.value = x, a(x), l)
throw x;
} finally {
f.value = !1;
}
return d.value;
}
r && m(o);
const v = {
state: d,
isReady: c,
isLoading: f,
error: p,
execute: m
};
function y() {
return new Promise((w, E) => {
pd(f).toBe(!1).then(() => w(v)).catch(E);
});
}
return {
...v,
then(w, E) {
return y().then(w, E);
}
};
}
const bn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, vn = "__vueuse_ssr_handlers__", hd = /* @__PURE__ */ yd();
function yd() {
return vn in bn || (bn[vn] = bn[vn] || {}), bn[vn];
}
function gd(e, t) {
return hd[e] || t;
}
function bd(e) {
return e == null ? "any" : e instanceof Set ? "set" : e instanceof Map ? "map" : e instanceof Date ? "date" : typeof e == "boolean" ? "boolean" : typeof e == "string" ? "string" : typeof e == "object" ? "object" : Number.isNaN(e) ? "any" : "number";
}
const ki = {
boolean: {
read: (e) => e === "true",
write: (e) => String(e)
},
object: {
read: (e) => JSON.parse(e),
write: (e) => JSON.stringify(e)
},
number: {
read: (e) => Number.parseFloat(e),
write: (e) => String(e)
},
any: {
read: (e) => e,
write: (e) => String(e)
},
string: {
read: (e) => e,
write: (e) => String(e)
},
map: {
read: (e) => new Map(JSON.parse(e)),
write: (e) => JSON.stringify(Array.from(e.entries()))
},
set: {
read: (e) => new Set(JSON.parse(e)),
write: (e) => JSON.stringify(Array.from(e))
},
date: {
read: (e) => new Date(e),
write: (e) => e.toISOString()
}
}, ba = "vueuse-storage";
function vd(e, t, n, r = {}) {
var o;
const {
flush: a = "pre",
deep: s = !0,
listenToStorageChanges: i = !0,
writeDefaults: u = !0,
mergeDefaults: l = !1,
shallow: d,
window: c = zr,
eventFilter: f,
onError: p = (z) => {
console.error(z);
},
initOnMounted: m
} = r, v = (d ? Ne : j)(typeof t == "function" ? t() : t);
if (!n)
try {
n = gd("getDefaultStorage", () => {
var z;
return (z = zr) == null ? void 0 : z.localStorage;
})();
} catch (z) {
p(z);
}
if (!n)
return v;
const y = $e(t), w = bd(y), E = (o = r.serializer) != null ? o : ki[w], { pause: g, resume: x } = cd(
v,
() => N(v.value),
{ flush: a, deep: s, eventFilter: f }
);
c && i && dd(() => {
ga(c, "storage", U), ga(c, ba, oe), m && U();
}), m || U();
function R(z, le) {
c && c.dispatchEvent(new CustomEvent(ba, {
detail: {
key: e,
oldValue: z,
newValue: le,
storageArea: n
}
}));
}
function N(z) {
try {
const le = n.getItem(e);
if (z == null)
R(le, null), n.removeItem(e);
else {
const Be = E.write(z);
le !== Be && (n.setItem(e, Be), R(le, Be));
}
} catch (le) {
p(le);
}
}
function b(z) {
const le = z ? z.newValue : n.getItem(e);
if (le == null)
return u && y != null && n.setItem(e, E.write(y)), y;
if (!z && l) {
const Be = E.read(le);
return typeof l == "function" ? l(Be, y) : w === "object" && !Array.isArray(Be) ? { ...y, ...Be } : Be;
} else
return typeof le != "string" ? le : E.read(le);
}
function U(z) {
if (!(z && z.storageArea !== n)) {
if (z && z.key == null) {
v.value = y;
return;
}
if (!(z && z.key !== e)) {
g();
try {
(z == null ? void 0 : z.newValue) !== E.write(v.value) && (v.value = b(z));
} catch (le) {
p(le);
} finally {
z ? rn(x) : x();
}
}
}
}
function oe(z) {
U(z.detail);
}
return v;
}
function Fi(e, t) {
return function() {
return e.apply(t, arguments);
};
}
const { toString: wd } = Object.prototype, { getPrototypeOf: Ao } = Object, er = /* @__PURE__ */ ((e) => (t) => {
const n = wd.call(t);
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), xe = (e) => (e = e.toLowerCase(), (t) => er(t) === e), tr = (e) => (t) => typeof t === e, { isArray: bt } = Array, Vt = tr("undefined");
function _d(e) {
return e !== null && !Vt(e) && e.constructor !== null && !Vt(e.constructor) && me(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const Bi = xe("ArrayBuffer");
function Od(e) {
let t;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Bi(e.buffer), t;
}
const Sd = tr("string"), me = tr("function"), Di = tr("number"), nr = (e) => e !== null && typeof e == "object", Ed = (e) => e === !0 || e === !1, _n = (e) => {
if (er(e) !== "object")
return !1;
const t = Ao(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
}, Td = xe("Date"), xd = xe("File"), Cd = xe("Blob"), Ad = xe("FileList"), Rd = (e) => nr(e) && me(e.pipe), Nd = (e) => {
let t;
return e && (typeof FormData == "function" && e instanceof FormData || me(e.append) && ((t = er(e)) === "formdata" || // detect form-data instance
t === "object" && me(e.toString) && e.toString() === "[object FormData]"));
}, jd = xe("URLSearchParams"), [Pd, kd, Fd, Bd] = ["ReadableStream", "Request", "Response", "Headers"].map(xe), Dd = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function on(e, t, { allOwnKeys: n = !1 } = {}) {
if (e === null || typeof e > "u")
return;
let r, o;
if (typeof e != "object" && (e = [e]), bt(e))
for (r = 0, o = e.length; r < o; r++)
t.call(null, e[r], r, e);
else {
const a = n ? Object.getOwnPropertyNames(e) : Object.keys(e), s = a.length;
let i;
for (r = 0; r < s; r++)
i = a[r], t.call(null, e[i], i, e);
}
}
function Li(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 Ii = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, $i = (e) => !Vt(e) && e !== Ii;
function Vr() {
const { caseless: e } = $i(this) && this || {}, t = {}, n = (r, o) => {
const a = e && Li(t, o) || o;
_n(t[a]) && _n(r) ? t[a] = Vr(t[a], r) : _n(r) ? t[a] = Vr({}, r) : bt(r) ? t[a] = r.slice() : t[a] = r;
};
for (let r = 0, o = arguments.length; r < o; r++)
arguments[r] && on(arguments[r], n);
return t;
}
const Ld = (e, t, n, { allOwnKeys: r } = {}) => (on(t, (o, a) => {
n && me(o) ? e[a] = Fi(o, n) : e[a] = o;
}, { allOwnKeys: r }), e), Id = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), $d = (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);
}, Ud = (e, t, n, r) => {
let o, a, s;
const i = {};
if (t = t || {}, e == null)
return t;
do {
for (o = Object.getOwnPropertyNames(e), a = o.length; a-- > 0; )
s = o[a], (!r || r(s, e, t)) && !i[s] && (t[s] = e[s], i[s] = !0);
e = n !== !1 && Ao(e);
} while (e && (!n || n(e, t)) && e !== Object.prototype);
return t;
}, Md = (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;
}, zd = (e) => {
if (!e)
return null;
if (bt(e))
return e;
let t = e.length;
if (!Di(t))
return null;
const n = new Array(t);
for (; t-- > 0; )
n[t] = e[t];
return n;
}, Vd = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Ao(Uint8Array)), qd = (e, t) => {
const n = (e && e[Symbol.iterator]).call(e);
let r;
for (; (r = n.next()) && !r.done; ) {
const o = r.value;
t.call(e, o[0], o[1]);
}
}, Hd = (e, t) => {
let n;
const r = [];
for (; (n = e.exec(t)) !== null; )
r.push(n);
return r;
}, Kd = xe("HTMLFormElement"), Jd = (e) => e.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(t, n, r) {
return n.toUpperCase() + r;
}
), va = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Wd = xe("RegExp"), Ui = (e, t) => {
const n = Object.getOwnPropertyDescriptors(e), r = {};
on(n, (o, a) => {
let s;
(s = t(o, a, e)) !== !1 && (r[a] = s || o);
}), Object.defineProperties(e, r);
}, Gd = (e) => {
Ui(e, (t, n) => {
if (me(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
return !1;
const r = e[n];
if (me(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 + "'");
});
}
});
}, Yd = (e, t) => {
const n = {}, r = (o) => {
o.forEach((a) => {
n[a] = !0;
});
};
return bt(e) ? r(e) : r(String(e).split(t)), n;
}, Zd = () => {
}, Qd = (e, t) => e != null && Number.isFinite(e = +e) ? e : t, Or = "abcdefghijklmnopqrstuvwxyz", wa = "0123456789", Mi = {
DIGIT: wa,
ALPHA: Or,
ALPHA_DIGIT: Or + Or.toUpperCase() + wa
}, Xd = (e = 16, t = Mi.ALPHA_DIGIT) => {
let n = "";
const { length: r } = t;
for (; e--; )
n += t[Math.random() * r | 0];
return n;
};
function ep(e) {
return !!(e && me(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
}
const tp = (e) => {
const t = new Array(10), n = (r, o) => {
if (nr(r)) {
if (t.indexOf(r) >= 0)
return;
if (!("toJSON" in r)) {
t[o] = r;
const a = bt(r) ? [] : {};
return on(r, (s, i) => {
const u = n(s, o + 1);
!Vt(u) && (a[i] = u);
}), t[o] = void 0, a;
}
}
return r;
};
return n(e, 0);
}, np = xe("AsyncFunction"), rp = (e) => e && (nr(e) || me(e)) && me(e.then) && me(e.catch), _ = {
isArray: bt,
isArrayBuffer: Bi,
isBuffer: _d,
isFormData: Nd,
isArrayBufferView: Od,
isString: Sd,
isNumber: Di,
isBoolean: Ed,
isObject: nr,
isPlainObject: _n,
isReadableStream: Pd,
isRequest: kd,
isResponse: Fd,
isHeaders: Bd,
isUndefined: Vt,
isDate: Td,
isFile: xd,
isBlob: Cd,
isRegExp: Wd,
isFunction: me,
isStream: Rd,
isURLSearchParams: jd,
isTypedArray: Vd,
isFileList: Ad,
forEach: on,
merge: Vr,
extend: Ld,
trim: Dd,
stripBOM: Id,
inherits: $d,
toFlatObject: Ud,
kindOf: er,
kindOfTest: xe,
endsWith: Md,
toArray: zd,
forEachEntry: qd,
matchAll: Hd,
isHTMLForm: Kd,
hasOwnProperty: va,
hasOwnProp: va,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: Ui,
freezeMethods: Gd,
toObjectSet: Yd,
toCamelCase: Jd,
noop: Zd,
toFiniteNumber: Qd,
findKey: Li,
global: Ii,
isContextDefined: $i,
ALPHABET: Mi,
generateString: Xd,
isSpecCompliantForm: ep,
toJSONObject: tp,
isAsyncFn: np,
isThenable: rp
};
function D(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);
}
_.inherits(D, 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.response && this.response.status ? this.response.status : null
};
}
});
const zi = D.prototype, Vi = {};
[
"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) => {
Vi[e] = { value: e };
});
Object.defineProperties(D, Vi);
Object.defineProperty(zi, "isAxiosError", { value: !0 });
D.from = (e, t, n, r, o, a) => {
const s = Object.create(zi);
return _.toFlatObject(e, s, function(i) {
return i !== Error.prototype;
}, (i) => i !== "isAxiosError"), D.call(s, e.message, t, n, r, o), s.cause = e, s.name = e.name, a && Object.assign(s, a), s;
};
const op = null;
function qr(e) {
return _.isPlainObject(e) || _.isArray(e);
}
function qi(e) {
return _.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function _a(e, t, n) {
return e ? e.concat(t).map(function(r, o) {
return r = qi(r), !n && o ? "[" + r + "]" : r;
}).join(n ? "." : "") : t;
}
function ap(e) {
return _.isArray(e) && !e.some(qr);
}
const sp = _.toFlatObject(_, {}, null, function(e) {
return /^is[A-Z]/.test(e);
});
function rr(e, t, n) {
if (!_.isObject(e))
throw new TypeError("target must be an object");
t = t || new FormData(), n = _.toFlatObject(n, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(p, m) {
return !_.isUndefined(m[p]);
});
const r = n.metaTokens, o = n.visitor || l, a = n.dots, s = n.indexes, i = (n.Blob || typeof Blob < "u" && Blob) && _.isSpecCompliantForm(t);
if (!_.isFunction(o))
throw new TypeError("visitor must be a function");
function u(p) {
if (p === null)
return "";
if (_.isDate(p))
return p.toISOString();
if (!i && _.isBlob(p))
throw new D("Blob is not supported. Use a Buffer instead.");
return _.isArrayBuffer(p) || _.isTypedArray(p) ? i && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
}
function l(p, m, v) {
let y = p;
if (p && !v && typeof p == "object") {
if (_.endsWith(m, "{}"))
m = r ? m : m.slice(0, -2), p = JSON.stringify(p);
else if (_.isArray(p) && ap(p) || (_.isFileList(p) || _.endsWith(m, "[]")) && (y = _.toArray(p)))
return m = qi(m), y.forEach(function(w, E) {
!(_.isUndefined(w) || w === null) && t.append(
// eslint-disable-next-line no-nested-ternary
s === !0 ? _a([m], E, a) : s === null ? m : m + "[]",
u(w)
);
}), !1;
}
return qr(p) ? !0 : (t.append(_a(v, m, a), u(p)), !1);
}
const d = [], c = Object.assign(sp, {
defaultVisitor: l,
convertValue: u,
isVisitable: qr
});
function f(p, m) {
if (!_.isUndefined(p)) {
if (d.indexOf(p) !== -1)
throw Error("Circular reference detected in " + m.join("."));
d.push(p), _.forEach(p, function(v, y) {
(!(_.isUndefined(v) || v === null) && o.call(
t,
v,
_.isString(y) ? y.trim() : y,
m,
c
)) === !0 && f(v, m ? m.concat(y) : [y]);
}), d.pop();
}
}
if (!_.isObject(e))
throw new TypeError("data must be an object");
return f(e), t;
}
function Oa(e) {
const t = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(n) {
return t[n];
});
}
function Ro(e, t) {
this._pairs = [], e && rr(e, this, t);
}
const Hi = Ro.prototype;
Hi.append = function(e, t) {
this._pairs.push([e, t]);
};
Hi.toString = function(e) {
const t = e ? function(n) {
return e.call(this, n, Oa);
} : Oa;
return this._pairs.map(function(n) {
return t(n[0]) + "=" + t(n[1]);
}, "").join("&");
};
function ip(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function Ki(e, t, n) {
if (!t)
return e;
const r = n && n.encode || ip, o = n && n.serialize;
let a;
if (o ? a = o(t, n) : a = _.isURLSearchParams(t) ? t.toString() : new Ro(t, n).toString(r), a) {
const s = e.indexOf("#");
s !== -1 && (e = e.slice(0, s)), e += (e.indexOf("?") === -1 ? "?" : "&") + a;
}
return e;
}
let Sa = class {
constructor() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
use(e, t, n) {
return this.handlers.push({
fulfilled: e,
rejected: t,
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(e) {
this.handlers[e] && (this.handlers[e] = null);
}
/**
* Clear all interceptors from the stack
*
* @returns {void}
*/
clear() {
this.handlers && (this.handlers = []);
}
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*
* @returns {void}
*/
forEach(e) {
_.forEach(this.handlers, function(t) {
t !== null && e(t);
});
}
};
const Ji = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, lp = typeof URLSearchParams < "u" ? URLSearchParams : Ro, up = typeof FormData < "u" ? FormData : null, cp = typeof Blob < "u" ? Blob : null, dp = {
isBrowser: !0,
classes: {
URLSearchParams: lp,
FormData: up,
Blob: cp
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, No = typeof window < "u" && typeof document < "u", pp = ((e) => No && ["ReactNative", "NativeScript", "NS"].indexOf(e) < 0)(typeof navigator < "u" && navigator.product), fp = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", mp = No && window.location.href || "http://localhost", hp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: No,
hasStandardBrowserEnv: pp,
hasStandardBrowserWebWorkerEnv: fp,
origin: mp
}, Symbol.toStringTag, { value: "Module" })), Se = {
...hp,
...dp
};
function yp(e, t) {
return rr(e, new Se.classes.URLSearchParams(), Object.assign({
visitor: function(n, r, o, a) {
return Se.isNode && _.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : a.defaultVisitor.apply(this, arguments);
}
}, t));
}
function gp(e) {
return _.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function bp(e) {
const t = {}, n = Object.keys(e);
let r;
const o = n.length;
let a;
for (r = 0; r < o; r++)
a = n[r], t[a] = e[a];
return t;
}
function Wi(e) {
function t(n, r, o, a) {
let s = n[a++];
if (s === "__proto__")
return !0;
const i = Number.isFinite(+s), u = a >= n.length;
return s = !s && _.isArray(o) ? o.length : s, u ? (_.hasOwnProp(o, s) ? o[s] = [o[s], r] : o[s] = r, !i) : ((!o[s] || !_.isObject(o[s])) && (o[s] = []), t(n, r, o[s], a) && _.isArray(o[s]) && (o[s] = bp(o[s])), !i);
}
if (_.isFormData(e) && _.isFunction(e.entries)) {
const n = {};
return _.forEachEntry(e, (r, o) => {
t(gp(r), o, n, 0);
}), n;
}
return null;
}
function vp(e, t, n) {
if (_.isString(e))
try {
return (t || JSON.parse)(e), _.trim(e);
} catch (r) {
if (r.name !== "SyntaxError")
throw r;
}
return (0, JSON.stringify)(e);
}
const an = {
transitional: Ji,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(e, t) {
const n = t.getContentType() || "", r = n.indexOf("application/json") > -1, o = _.isObject(e);
if (o && _.isHTMLForm(e) && (e = new FormData(e)), _.isFormData(e))
return r ? JSON.stringify(Wi(e)) : e;
if (_.isArrayBuffer(e) || _.isBuffer(e) || _.isStream(e) || _.isFile(e) || _.isBlob(e) || _.isReadableStream(e))
return e;
if (_.isArrayBufferView(e))
return e.buffer;
if (_.isURLSearchParams(e))
return t.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
let a;
if (o) {
if (n.indexOf("application/x-www-form-urlencoded") > -1)
return yp(e, this.formSerializer).toString();
if ((a = _.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
const s = this.env && this.env.FormData;
return rr(
a ? { "files[]": e } : e,
s && new s(),
this.formSerializer
);
}
}
return o || r ? (t.setContentType("application/json", !1), vp(e)) : e;
}],
transformResponse: [function(e) {
const t = this.transitional || an.transitional, n = t && t.forcedJSONParsing, r = this.responseType === "json";
if (_.isResponse(e) || _.isReadableStream(e))
return e;
if (e && _.isString(e) && (n && !this.responseType || r)) {
const o = !(t && t.silentJSONParsing) && r;
try {
return JSON.parse(e);
} catch (a) {
if (o)
throw a.name === "SyntaxError" ? D.from(a, D.ERR_BAD_RESPONSE, this, null, this.response) : a;
}
}
return e;
}],
/**
* A timeout in milliseconds to abort a request. If set to 0 (default) a
* timeout is not created.
*/
timeout: 0,
xsrfCookieName: "XSRF-TOKEN",
xsrfHeaderName: "X-XSRF-TOKEN",
maxContentLength: -1,
maxBodyLength: -1,
env: {
FormData: Se.classes.FormData,
Blob: Se.classes.Blob
},
validateStatus: function(e) {
return e >= 200 && e < 300;
},
headers: {
common: {
Accept: "application/json, text/plain, */*",
"Content-Type": void 0
}
}
};
_.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
an.headers[e] = {};
});
const wp = _.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"
]), _p = (e) => {
const t = {};
let n, r, o;
return e && e.split(`
`).forEach(function(a) {
o = a.indexOf(":"), n = a.substring(0, o).trim().toLowerCase(), r = a.substring(o + 1).trim(), !(!n || t[n] && wp[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
}), t;
}, Ea = Symbol("internals");
function kt(e) {
return e && String(e).trim().toLowerCase();
}
function On(e) {
return e === !1 || e == null ? e : _.isArray(e) ? e.map(On) : String(e);
}
function Op(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 Sp = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
function Sr(e, t, n, r, o) {
if (_.isFunction(r))
return r.call(this, t, n);
if (o && (t = n), !!_.isString(t)) {
if (_.isString(r))
return t.indexOf(r) !== -1;
if (_.isRegExp(r))
return r.test(t);
}
}
function Ep(e) {
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
}
function Tp(e, t) {
const n = _.toCamelCase(" " + t);
["get", "set", "has"].forEach((r) => {
Object.defineProperty(e, r + n, {
value: function(o, a, s) {
return this[r].call(this, t, o, a, s);
},
configurable: !0
});
});
}
let ce = class {
constructor(e) {
e && this.set(e);
}
set(e, t, n) {
const r = this;
function o(s, i, u) {
const l = kt(i);
if (!l)
throw new Error("header name must be a non-empty string");
const d = _.findKey(r, l);
(!d || r[d] === void 0 || u === !0 || u === void 0 && r[d] !== !1) && (r[d || i] = On(s));
}
const a = (s, i) => _.forEach(s, (u, l) => o(u, l, i));
if (_.isPlainObject(e) || e instanceof this.constructor)
a(e, t);
else if (_.isString(e) && (e = e.trim()) && !Sp(e))
a(_p(e), t);
else if (_.isHeaders(e))
for (const [s, i] of e.entries())
o(i, s, n);
else
e != null && o(t, e, n);
return this;
}
get(e, t) {
if (e = kt(e), e) {
const n = _.findKey(this, e);
if (n) {
const r = this[n];
if (!t)
return r;
if (t === !0)
return Op(r);
if (_.isFunction(t))
return t.call(this, r, n);
if (_.isRegExp(t))
return t.exec(r);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(e, t) {
if (e = kt(e), e) {
const n = _.findKey(this, e);
return !!(n && this[n] !== void 0 && (!t || Sr(this, this[n], n, t)));
}
return !1;
}
delete(e, t) {
const n = this;
let r = !1;
function o(a) {
if (a = kt(a), a) {
const s = _.findKey(n, a);
s && (!t || Sr(n, n[s], s, t)) && (delete n[s], r = !0);
}
}
return _.isArray(e) ? e.forEach(o) : o(e), r;
}
clear(e) {
const t = Object.keys(this);
let n = t.length, r = !1;
for (; n--; ) {
const o = t[n];
(!e || Sr(this, this[o], o, e, !0)) && (delete this[o], r = !0);
}
return r;
}
normalize(e) {
const t = this, n = {};
return _.forEach(this, (r, o) => {
const a = _.findKey(n, o);
if (a) {
t[a] = On(r), delete t[o];
return;
}
const s = e ? Ep(o) : String(o).trim();
s !== o && delete t[o], t[s] = On(r), n[s] = !0;
}), this;
}
concat(...e) {
return this.constructor.concat(this, ...e);
}
toJSON(e) {
const t = /* @__PURE__ */ Object.create(null);
return _.forEach(this, (n, r) => {
n != null && n !== !1 && (t[r] = e && _.isArray(n) ? n.join(", ") : n);
}), t;
}
[Symbol.iterator]() {
return Object.entries(this.toJSON())[Symbol.iterator]();
}
toString() {
return Object.entries(this.toJSON()).map(([e, t]) => e + ": " + t).join(`
`);
}
get [Symbol.toStringTag]() {
return "AxiosHeaders";
}
static from(e) {
return e instanceof this ? e : new this(e);
}
static concat(e, ...t) {
const n = new this(e);
return t.forEach((r) => n.set(r)), n;
}
static accessor(e) {
const t = (this[Ea] = this[Ea] = {
accessors: {}
}).accessors, n = this.prototype;
function r(o) {
const a = kt(o);
t[a] || (Tp(n, o), t[a] = !0);
}
return _.isArray(e) ? e.forEach(r) : r(e), this;
}
};
ce.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
_.reduceDescriptors(ce.prototype, ({ value: e }, t) => {
let n = t[0].toUpperCase() + t.slice(1);
return {
get: () => e,
set(r) {
this[n] = r;
}
};
});
_.freezeMethods(ce);
function Er(e, t) {
const n = this || an, r = t || n, o = ce.from(r.headers);
let a = r.data;
return _.forEach(e, function(s) {
a = s.call(n, a, o.normalize(), t ? t.status : void 0);
}), o.normalize(), a;
}
function Gi(e) {
return !!(e && e.__CANCEL__);
}
function vt(e, t, n) {
D.call(this, e ?? "canceled", D.ERR_CANCELED, t, n), this.name = "CanceledError";
}
_.inherits(vt, D, {
__CANCEL__: !0
});
function Yi(e, t, n) {
const r = n.config.validateStatus;
!n.status || !r || r(n.status) ? e(n) : t(new D(
"Request failed with status code " + n.status,
[D.ERR_BAD_REQUEST, D.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
n.config,
n.request,
n
));
}
function xp(e) {
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
return t && t[1] || "";
}
function Cp(e, t) {
e = e || 10;
const n = new Array(e), r = new Array(e);
let o = 0, a = 0, s;
return t = t !== void 0 ? t : 1e3, function(i) {
const u = Date.now(), l = r[a];
s || (s = u), n[o] = i, r[o] = u;
let d = a, c = 0;
for (; d !== o; )
c += n[d++], d = d % e;
if (o = (o + 1) % e, o === a && (a = (a + 1) % e), u - s < t)
return;
const f = l && u - l;
return f ? Math.round(c * 1e3 / f) : void 0;
};
}
function Ap(e, t) {
let n = 0;
const r = 1e3 / t;
let o = null;
return function() {
const a = this === !0, s = Date.now();
if (a || s - n > r)
return o && (clearTimeout(o), o = null), n = s, e.apply(null, arguments);
o || (o = setTimeout(() => (o = null, n = Date.now(), e.apply(null, arguments)), r - (s - n)));
};
}
const In = (e, t, n = 3) => {
let r = 0;
const o = Cp(50, 250);
return Ap((a) => {
const s = a.loaded, i = a.lengthComputable ? a.total : void 0, u = s - r, l = o(u), d = s <= i;
r = s;
const c = {
loaded: s,
total: i,
progress: i ? s / i : void 0,
bytes: u,
rate: l || void 0,
estimated: l && i && d ? (i - s) / l : void 0,
event: a,
lengthComputable: i != null
};
c[t ? "download" : "upload"] = !0, e(c);
}, n);
}, Rp = Se.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 e = /(msie|trident)/i.test(navigator.userAgent), t = document.createElement("a");
let n;
function r(o) {
let a = o;
return e && (t.setAttribute("href", a), a = t.href), t.setAttribute("href", a), {
href: t.href,
protocol: t.protocol ? t.protocol.replace(/:$/, "") : "",
host: t.host,
search: t.search ? t.search.replace(/^\?/, "") : "",
hash: t.hash ? t.hash.replace(/^#/, "") : "",
hostname: t.hostname,
port: t.port,
pathname: t.pathname.charAt(0) === "/" ? t.pathname : "/" + t.pathname
};
}
return n = r(window.location.href), function(o) {
const a = _.isString(o) ? r(o) : o;
return a.protocol === n.protocol && a.host === n.host;
};
}()
) : (
// Non standard browser envs (web workers, react-native) lack needed support.
/* @__PURE__ */ function() {
return function() {
return !0;
};
}()
), Np = Se.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(e, t, n, r, o, a) {
const s = [e + "=" + encodeURIComponent(t)];
_.isNumber(n) && s.push("expires=" + new Date(n).toGMTString()), _.isString(r) && s.push("path=" + r), _.isString(o) && s.push("domain=" + o), a === !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 jp(e) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}
function Pp(e, t) {
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
}
function Zi(e, t) {
return e && !jp(t) ? Pp(e, t) : t;
}
const Ta = (e) => e instanceof ce ? { ...e } : e;
function Ge(e, t) {
t = t || {};
const n = {};
function r(l, d, c) {
return _.isPlainObject(l) && _.isPlainObject(d) ? _.merge.call({ caseless: c }, l, d) : _.isPlainObject(d) ? _.merge({}, d) : _.isArray(d) ? d.slice() : d;
}
function o(l, d, c) {
if (_.isUndefined(d)) {
if (!_.isUndefined(l))
return r(void 0, l, c);
} else
return r(l, d, c);
}
function a(l, d) {
if (!_.isUndefined(d))
return r(void 0, d);
}
function s(l, d) {
if (_.isUndefined(d)) {
if (!_.isUndefined(l))
return r(void 0, l);
} else
return r(void 0, d);
}
function i(l, d, c) {
if (c in t)
return r(l, d);
if (c in e)
return r(void 0, l);
}
const u = {
url: a,
method: a,
data: a,
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: i,
headers: (l, d) => o(Ta(l), Ta(d), !0)
};
return _.forEach(Object.keys(Object.assign({}, e, t)), function(l) {
const d = u[l] || o, c = d(e[l], t[l], l);
_.isUndefined(c) && d !== i || (n[l] = c);
}), n;
}
const Qi = (e) => {
const t = Ge({}, e);
let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: a, headers: s, auth: i } = t;
t.headers = s = ce.from(s), t.url = Ki(Zi(t.baseURL, t.url), e.params, e.paramsSerializer), i && s.set(
"Authorization",
"Basic " + btoa((i.username || "") + ":" + (i.password ? unescape(encodeURIComponent(i.password)) : ""))
);
let u;
if (_.isFormData(n)) {
if (Se.hasStandardBrowserEnv || Se.hasStandardBrowserWebWorkerEnv)
s.setContentType(void 0);
else if ((u = s.getContentType()) !== !1) {
const [l, ...d] = u ? u.split(";").map((c) => c.trim()).filter(Boolean) : [];
s.setContentType([l || "multipart/form-data", ...d].join("; "));
}
}
if (Se.hasStandardBrowserEnv && (r && _.isFunction(r) && (r = r(t)), r || r !== !1 && Rp(t.url))) {
const l = o && a && Np.read(a);
l && s.set(o, l);
}
return t;
}, kp = typeof XMLHttpRequest < "u", Fp = kp && function(e) {
return new Promise(function(t, n) {
const r = Qi(e);
let o = r.data;
const a = ce.from(r.headers).normalize();
let { responseType: s } = r, i;
function u() {
r.cancelToken && r.cancelToken.unsubscribe(i), r.signal && r.signal.removeEventListener("abort", i);
}
let l = new XMLHttpRequest();
l.open(r.method.toUpperCase(), r.url, !0), l.timeout = r.timeout;
function d() {
if (!l)
return;
const f = ce.from(
"getAllResponseHeaders" in l && l.getAllResponseHeaders()
), p = {
data: !s || s === "text" || s === "json" ? l.responseText : l.response,
status: l.status,
statusText: l.statusText,
headers: f,
config: e,
request: l
};
Yi(function(m) {
t(m), u();
}, function(m) {
n(m), u();
}, p), l = null;
}
"onloadend" in l ? l.onloadend = d : l.onreadystatechange = function() {
!l || l.readyState !== 4 || l.status === 0 && !(l.responseURL && l.responseURL.indexOf("file:") === 0) || setTimeout(d);
}, l.onabort = function() {
l && (n(new D("Request aborted", D.ECONNABORTED, r, l)), l = null);
}, l.onerror = function() {
n(new D("Network Error", D.ERR_NETWORK, r, l)), l = null;
}, l.ontimeout = function() {
let f = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
const p = r.transitional || Ji;
r.timeoutErrorMessage && (f = r.timeoutErrorMessage), n(new D(
f,
p.clarifyTimeoutError ? D.ETIMEDOUT : D.ECONNABORTED,
r,
l
)), l = null;
}, o === void 0 && a.setContentType(null), "setRequestHeader" in l && _.forEach(a.toJSON(), function(f, p) {
l.setRequestHeader(p, f);
}), _.isUndefined(r.withCredentials) || (l.withCredentials = !!r.withCredentials), s && s !== "json" && (l.responseType = r.responseType), typeof r.onDownloadProgress == "function" && l.addEventListener("progress", In(r.onDownloadProgress, !0)), typeof r.onUploadProgress == "function" && l.upload && l.upload.addEventListener("progress", In(r.onUploadProgress)), (r.cancelToken || r.signal) && (i = (f) => {
l && (n(!f || f.type ? new vt(null, e, l) : f), l.abort(), l = null);
}, r.cancelToken && r.cancelToken.subscribe(i), r.signal && (r.signal.aborted ? i() : r.signal.addEventListener("abort", i)));
const c = xp(r.url);
if (c && Se.protocols.indexOf(c) === -1) {
n(new D("Unsupported protocol " + c + ":", D.ERR_BAD_REQUEST, e));
return;
}
l.send(o || null);
});
}, Bp = (e, t) => {
let n = new AbortController(), r;
const o = function(u) {
if (!r) {
r = !0, s();
const l = u instanceof Error ? u : this.reason;
n.abort(l instanceof D ? l : new vt(l instanceof Error ? l.message : l));
}
};
let a = t && setTimeout(() => {
o(new D(`timeout ${t} of ms exceeded`, D.ETIMEDOUT));
}, t);
const s = () => {
e && (a && clearTimeout(a), a = null, e.forEach((u) => {
u && (u.removeEventListener ? u.removeEventListener("abort", o) : u.unsubscribe(o));
}), e = null);
};
e.forEach((u) => u && u.addEventListener && u.addEventListener("abort", o));
const { signal: i } = n;
return i.unsubscribe = s, [i, () => {
a && clearTimeout(a), a = null;
}];
}, Dp = 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;
}, Lp = async function* (e, t, n) {
for await (const r of e)
yield* Dp(ArrayBuffer.isView(r) ? r : await n(String(r)), t);
}, xa = (e, t, n, r, o) => {
const a = Lp(e, t, o);
let s = 0;
return new ReadableStream({
type: "bytes",
async pull(i) {
const { done: u, value: l } = await a.next();
if (u) {
i.close(), r();
return;
}
let d = l.byteLength;
n && n(s += d), i.enqueue(new Uint8Array(l));
},
cancel(i) {
return r(i), a.return();
}
}, {
highWaterMark: 2
});
}, Ca = (e, t) => {
const n = e != null;
return (r) => setTimeout(() => t({
lengthComputable: n,
total: e,
loaded: r
}));
}, or = typeof fetch == "function" && typeof Request == "function" &&