@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
1,668 lines (1,667 loc) • 63.2 kB
JavaScript
import { defineComponent as je, ref as k, watch as oe, createVNode as F, isVNode as dt, computed as V, inject as pt, reactive as ht } from "vue";
import { isPlainObject as we, cloneDeep as mt } from "lodash-es";
import { FButtonEdit as yt } from "../button-edit/index.esm.js";
import gt, { FLayoutPane as Ee } from "../layout/index.esm.js";
import bt from "../tree-view/index.esm.js";
import wt from "../data-grid/index.esm.js";
import { F_NOTIFY_SERVICE_TOKEN as Et } from "../notify/index.esm.js";
import { withInstall as St } from "../common/index.esm.js";
const Rt = {}, Ot = {};
function Ue(e) {
const { properties: t, title: r, ignore: n } = e, o = n && Array.isArray(n), s = Object.keys(t).reduce((i, u) => ((!o || !n.find((d) => d === u)) && (i[u] = t[u].type === "object" && t[u].properties ? Ue(t[u]) : mt(t[u].default)), i), {});
if (r && (!o || !n.find((i) => i === "id"))) {
const i = r.toLowerCase().replace(/-/g, "_");
s.id = `${i}_${Math.random().toString().slice(2, 6)}`;
}
return s;
}
function Tt(e, t) {
const r = Ue(t);
return Object.keys(r).reduce((n, o) => (Object.prototype.hasOwnProperty.call(e, o) && (n[o] && we(n[o]) && we(e[o] || !e[o]) ? Object.assign(n[o], e[o] || {}) : n[o] = e[o]), n), r), r;
}
function Me(e, t) {
return Object.keys(e).filter((n) => e[n] != null).reduce((n, o) => {
if (t.has(o)) {
const s = t.get(o);
if (typeof s == "string")
n[s] = e[o];
else {
const i = s(o, e[o], e);
Object.assign(n, i);
}
} else
n[o] = e[o];
return n;
}, {});
}
function Ct(e, t, r = /* @__PURE__ */ new Map()) {
const n = Tt(e, t);
return Me(n, r);
}
function Nt(e = {}) {
function t(a, l, f, g) {
if (typeof f == "number")
return g[a].length === f;
if (typeof f == "object") {
const h = Object.keys(f)[0], p = f[h];
if (h === "not")
return Number(g[a].length) !== Number(p);
if (h === "moreThan")
return Number(g[a].length) >= Number(p);
if (h === "lessThan")
return Number(g[a].length) <= Number(p);
}
return !1;
}
function r(a, l, f, g) {
return g[a] && g[a].propertyValue && String(g[a].propertyValue.value) === String(f);
}
const n = /* @__PURE__ */ new Map([
["length", t],
["getProperty", r]
]);
Object.keys(e).reduce((a, l) => (a.set(l, e[l]), a), n);
function o(a, l) {
const f = a;
return typeof l == "number" ? [{ target: f, operator: "length", param: null, value: Number(l) }] : typeof l == "boolean" ? [{ target: f, operator: "getProperty", param: a, value: !!l }] : typeof l == "object" ? Object.keys(l).map((g) => {
if (g === "length")
return { target: f, operator: "length", param: null, value: l[g] };
const h = g, p = l[g];
return { target: f, operator: "getProperty", param: h, value: p };
}) : [];
}
function s(a) {
return Object.keys(a).reduce((f, g) => {
const h = o(g, a[g]);
return f.push(...h), f;
}, []);
}
function i(a, l) {
if (n.has(a.operator)) {
const f = n.get(a.operator);
return f && f(a.target, a.param, a.value, l) || !1;
}
return !1;
}
function u(a, l) {
return s(a).reduce((h, p) => h && i(p, l), !0);
}
function d(a, l) {
const f = Object.keys(a), g = f.includes("allOf"), h = f.includes("anyOf"), p = g || h, y = (p ? a[p ? g ? "allOf" : "anyOf" : "allOf"] : [a]).map((S) => u(S, l));
return g ? !y.includes(!1) : y.includes(!0);
}
return { parseValueSchema: d };
}
const At = {}, xt = {};
Nt();
function Pt(e, t, r = /* @__PURE__ */ new Map(), n = (i, u, d, a) => u, o = {}, s = (i) => i) {
return Rt[t.title] = t, Ot[t.title] = n, At[t.title] = o, xt[t.title] = s, (i = {}, u = !0) => {
if (!u)
return Me(i, r);
const d = Ct(i, t, r), a = Object.keys(e).reduce((l, f) => (l[f] = e[f].default, l), {});
return Object.assign(a, d);
};
}
const Dt = "https://json-schema.org/draft/2020-12/schema", Lt = "https://farris-design.gitee.io/menu-lookup.schema.json", Ft = "menu-lookup", _t = "A Farris Component", Bt = "object", kt = {
type: {
description: "The type string of menu-lookup",
type: "string",
default: "menu-lookup"
},
targetType: {
description: "",
type: "string",
enum: [
"menu",
"app"
],
default: "menu"
},
fetchNodeApi: {
description: "",
type: "function"
}
}, jt = [
"type",
"fetchNodeApi"
], Ut = [], Mt = {
$schema: Dt,
$id: Lt,
title: Ft,
description: _t,
type: Bt,
properties: kt,
required: jt,
ignore: Ut
}, vt = /* @__PURE__ */ new Map([]);
function qt(e, t, r) {
return t;
}
const ve = {
/** 选择的目标类型 */
targetType: { type: String, default: "menu" },
/** 获取“菜单树”或“应用树”数据的接口地址 */
fetchNodeApi: { type: [String, Function], require: !0 },
/** 组件值 */
modelValue: { type: String, default: "" }
}, It = Pt(ve, Mt, vt, qt), Ht = {
targetType: { type: String, default: "menu" },
useTreeGridCoordinatorComposition: { type: Object, default: () => ({}) }
};
function Se(e) {
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !dt(e);
}
const zt = /* @__PURE__ */ je({
name: "FMenuLookupModalContainer",
props: Ht,
emits: [],
setup(e) {
const t = k(), r = k(), {
treeData: n,
gridData: o,
onNavTreeExpandNode: s,
onNavTreeSelectionChange: i,
onDataGridSelectionChange: u,
onDataGridUnSelectItem: d
} = e.useTreeGridCoordinatorComposition, a = {
parentIdField: "parentId",
collapseField: "collapse",
hasChildrenField: "hasChildren"
}, l = {
enabelSelectRow: !0,
clearSelectionOnEmpty: !1,
keepSelectingOnClick: !0,
multiSelect: !1,
showCheckbox: !0,
selectOnCheck: !0,
focusSelection: !0,
checkOnSelect: !0
}, f = [{
field: "code",
title: "编号",
dataType: "string"
}, {
field: "name",
title: "名称",
dataType: "string"
}], g = [{
field: "code",
title: "编号",
dataType: "string"
}, {
field: "name",
title: "名称",
dataType: "string"
}, {
field: "appEntrance",
title: "入口",
dataType: "string"
}], h = e.targetType === "app" ? g : f;
function p() {
t.value && t.value.updateDataSource(n.value);
}
oe(n, p);
function b() {
r.value && r.value.updateDataSource(o.value);
}
oe(o, b);
function m() {
return F(bt, {
ref: t,
data: n.value,
hierarchy: a,
virtualized: !1,
onSelectionChange: i,
onExpandNode: s
}, null);
}
function y() {
return F(wt, {
ref: r,
columns: h,
data: o.value,
fit: !0,
showStripe: !1,
columnOption: {
fitColumns: !0
},
rowNumber: {
enable: !1
},
selection: l,
virtualized: !1,
onSelectionChange: u,
onUnSelectItem: d
}, null);
}
return () => {
let E, S;
return F(gt, {
class: "fv-menu-lookup-container"
}, {
default: () => [F(Ee, {
position: "left",
width: 300,
"min-width": 200
}, Se(E = m()) ? E : {
default: () => [E]
}), F(Ee, {
position: "center",
"min-width": 400
}, Se(S = y()) ? S : {
default: () => [S]
})]
});
};
}
});
function qe(e, t) {
return function() {
return e.apply(t, arguments);
};
}
const { toString: Vt } = Object.prototype, { getPrototypeOf: pe } = Object, X = /* @__PURE__ */ ((e) => (t) => {
const r = Vt.call(t);
return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), x = (e) => (e = e.toLowerCase(), (t) => X(t) === e), K = (e) => (t) => typeof t === e, { isArray: U } = Array, q = K("undefined");
function Gt(e) {
return e !== null && !q(e) && e.constructor !== null && !q(e.constructor) && N(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const Ie = x("ArrayBuffer");
function Jt(e) {
let t;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Ie(e.buffer), t;
}
const $t = K("string"), N = K("function"), He = K("number"), Q = (e) => e !== null && typeof e == "object", Wt = (e) => e === !0 || e === !1, G = (e) => {
if (X(e) !== "object")
return !1;
const t = pe(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
}, Xt = x("Date"), Kt = x("File"), Qt = x("Blob"), Zt = x("FileList"), Yt = (e) => Q(e) && N(e.pipe), en = (e) => {
let t;
return e && (typeof FormData == "function" && e instanceof FormData || N(e.append) && ((t = X(e)) === "formdata" || // detect form-data instance
t === "object" && N(e.toString) && e.toString() === "[object FormData]"));
}, tn = x("URLSearchParams"), [nn, rn, on, sn] = ["ReadableStream", "Request", "Response", "Headers"].map(x), an = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function I(e, t, { allOwnKeys: r = !1 } = {}) {
if (e === null || typeof e > "u")
return;
let n, o;
if (typeof e != "object" && (e = [e]), U(e))
for (n = 0, o = e.length; n < o; n++)
t.call(null, e[n], n, e);
else {
const s = r ? Object.getOwnPropertyNames(e) : Object.keys(e), i = s.length;
let u;
for (n = 0; n < i; n++)
u = s[n], t.call(null, e[u], u, e);
}
}
function ze(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 _ = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Ve = (e) => !q(e) && e !== _;
function se() {
const { caseless: e } = Ve(this) && this || {}, t = {}, r = (n, o) => {
const s = e && ze(t, o) || o;
G(t[s]) && G(n) ? t[s] = se(t[s], n) : G(n) ? t[s] = se({}, n) : U(n) ? t[s] = n.slice() : t[s] = n;
};
for (let n = 0, o = arguments.length; n < o; n++)
arguments[n] && I(arguments[n], r);
return t;
}
const cn = (e, t, r, { allOwnKeys: n } = {}) => (I(t, (o, s) => {
r && N(o) ? e[s] = qe(o, r) : e[s] = o;
}, { allOwnKeys: n }), e), un = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), ln = (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);
}, fn = (e, t, r, n) => {
let o, s, i;
const u = {};
if (t = t || {}, e == null) return t;
do {
for (o = Object.getOwnPropertyNames(e), s = o.length; s-- > 0; )
i = o[s], (!n || n(i, e, t)) && !u[i] && (t[i] = e[i], u[i] = !0);
e = r !== !1 && pe(e);
} while (e && (!r || r(e, t)) && e !== Object.prototype);
return t;
}, dn = (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;
}, pn = (e) => {
if (!e) return null;
if (U(e)) return e;
let t = e.length;
if (!He(t)) return null;
const r = new Array(t);
for (; t-- > 0; )
r[t] = e[t];
return r;
}, hn = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && pe(Uint8Array)), mn = (e, t) => {
const n = (e && e[Symbol.iterator]).call(e);
let o;
for (; (o = n.next()) && !o.done; ) {
const s = o.value;
t.call(e, s[0], s[1]);
}
}, yn = (e, t) => {
let r;
const n = [];
for (; (r = e.exec(t)) !== null; )
n.push(r);
return n;
}, gn = x("HTMLFormElement"), bn = (e) => e.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(r, n, o) {
return n.toUpperCase() + o;
}
), Re = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), wn = x("RegExp"), Ge = (e, t) => {
const r = Object.getOwnPropertyDescriptors(e), n = {};
I(r, (o, s) => {
let i;
(i = t(o, s, e)) !== !1 && (n[s] = i || o);
}), Object.defineProperties(e, n);
}, En = (e) => {
Ge(e, (t, r) => {
if (N(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
return !1;
const n = e[r];
if (N(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 + "'");
});
}
});
}, Sn = (e, t) => {
const r = {}, n = (o) => {
o.forEach((s) => {
r[s] = !0;
});
};
return U(e) ? n(e) : n(String(e).split(t)), r;
}, Rn = () => {
}, On = (e, t) => e != null && Number.isFinite(e = +e) ? e : t, ee = "abcdefghijklmnopqrstuvwxyz", Oe = "0123456789", Je = {
DIGIT: Oe,
ALPHA: ee,
ALPHA_DIGIT: ee + ee.toUpperCase() + Oe
}, Tn = (e = 16, t = Je.ALPHA_DIGIT) => {
let r = "";
const { length: n } = t;
for (; e--; )
r += t[Math.random() * n | 0];
return r;
};
function Cn(e) {
return !!(e && N(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
}
const Nn = (e) => {
const t = new Array(10), r = (n, o) => {
if (Q(n)) {
if (t.indexOf(n) >= 0)
return;
if (!("toJSON" in n)) {
t[o] = n;
const s = U(n) ? [] : {};
return I(n, (i, u) => {
const d = r(i, o + 1);
!q(d) && (s[u] = d);
}), t[o] = void 0, s;
}
}
return n;
};
return r(e, 0);
}, An = x("AsyncFunction"), xn = (e) => e && (Q(e) || N(e)) && N(e.then) && N(e.catch), $e = ((e, t) => e ? setImmediate : t ? ((r, n) => (_.addEventListener("message", ({ source: o, data: s }) => {
o === _ && s === r && n.length && n.shift()();
}, !1), (o) => {
n.push(o), _.postMessage(r, "*");
}))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
typeof setImmediate == "function",
N(_.postMessage)
), Pn = typeof queueMicrotask < "u" ? queueMicrotask.bind(_) : typeof process < "u" && process.nextTick || $e, c = {
isArray: U,
isArrayBuffer: Ie,
isBuffer: Gt,
isFormData: en,
isArrayBufferView: Jt,
isString: $t,
isNumber: He,
isBoolean: Wt,
isObject: Q,
isPlainObject: G,
isReadableStream: nn,
isRequest: rn,
isResponse: on,
isHeaders: sn,
isUndefined: q,
isDate: Xt,
isFile: Kt,
isBlob: Qt,
isRegExp: wn,
isFunction: N,
isStream: Yt,
isURLSearchParams: tn,
isTypedArray: hn,
isFileList: Zt,
forEach: I,
merge: se,
extend: cn,
trim: an,
stripBOM: un,
inherits: ln,
toFlatObject: fn,
kindOf: X,
kindOfTest: x,
endsWith: dn,
toArray: pn,
forEachEntry: mn,
matchAll: yn,
isHTMLForm: gn,
hasOwnProperty: Re,
hasOwnProp: Re,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: Ge,
freezeMethods: En,
toObjectSet: Sn,
toCamelCase: bn,
noop: Rn,
toFiniteNumber: On,
findKey: ze,
global: _,
isContextDefined: Ve,
ALPHABET: Je,
generateString: Tn,
isSpecCompliantForm: Cn,
toJSONObject: Nn,
isAsyncFn: An,
isThenable: xn,
setImmediate: $e,
asap: Pn
};
function w(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);
}
c.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: c.toJSONObject(this.config),
code: this.code,
status: this.status
};
}
});
const We = w.prototype, Xe = {};
[
"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) => {
Xe[e] = { value: e };
});
Object.defineProperties(w, Xe);
Object.defineProperty(We, "isAxiosError", { value: !0 });
w.from = (e, t, r, n, o, s) => {
const i = Object.create(We);
return c.toFlatObject(e, i, function(d) {
return d !== Error.prototype;
}, (u) => u !== "isAxiosError"), w.call(i, e.message, t, r, n, o), i.cause = e, i.name = e.name, s && Object.assign(i, s), i;
};
const Dn = null;
function ie(e) {
return c.isPlainObject(e) || c.isArray(e);
}
function Ke(e) {
return c.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function Te(e, t, r) {
return e ? e.concat(t).map(function(o, s) {
return o = Ke(o), !r && s ? "[" + o + "]" : o;
}).join(r ? "." : "") : t;
}
function Ln(e) {
return c.isArray(e) && !e.some(ie);
}
const Fn = c.toFlatObject(c, {}, null, function(t) {
return /^is[A-Z]/.test(t);
});
function Z(e, t, r) {
if (!c.isObject(e))
throw new TypeError("target must be an object");
t = t || new FormData(), r = c.toFlatObject(r, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(b, m) {
return !c.isUndefined(m[b]);
});
const n = r.metaTokens, o = r.visitor || l, s = r.dots, i = r.indexes, d = (r.Blob || typeof Blob < "u" && Blob) && c.isSpecCompliantForm(t);
if (!c.isFunction(o))
throw new TypeError("visitor must be a function");
function a(p) {
if (p === null) return "";
if (c.isDate(p))
return p.toISOString();
if (!d && c.isBlob(p))
throw new w("Blob is not supported. Use a Buffer instead.");
return c.isArrayBuffer(p) || c.isTypedArray(p) ? d && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
}
function l(p, b, m) {
let y = p;
if (p && !m && typeof p == "object") {
if (c.endsWith(b, "{}"))
b = n ? b : b.slice(0, -2), p = JSON.stringify(p);
else if (c.isArray(p) && Ln(p) || (c.isFileList(p) || c.endsWith(b, "[]")) && (y = c.toArray(p)))
return b = Ke(b), y.forEach(function(S, A) {
!(c.isUndefined(S) || S === null) && t.append(
// eslint-disable-next-line no-nested-ternary
i === !0 ? Te([b], A, s) : i === null ? b : b + "[]",
a(S)
);
}), !1;
}
return ie(p) ? !0 : (t.append(Te(m, b, s), a(p)), !1);
}
const f = [], g = Object.assign(Fn, {
defaultVisitor: l,
convertValue: a,
isVisitable: ie
});
function h(p, b) {
if (!c.isUndefined(p)) {
if (f.indexOf(p) !== -1)
throw Error("Circular reference detected in " + b.join("."));
f.push(p), c.forEach(p, function(y, E) {
(!(c.isUndefined(y) || y === null) && o.call(
t,
y,
c.isString(E) ? E.trim() : E,
b,
g
)) === !0 && h(y, b ? b.concat(E) : [E]);
}), f.pop();
}
}
if (!c.isObject(e))
throw new TypeError("data must be an object");
return h(e), t;
}
function Ce(e) {
const t = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(n) {
return t[n];
});
}
function he(e, t) {
this._pairs = [], e && Z(e, this, t);
}
const Qe = he.prototype;
Qe.append = function(t, r) {
this._pairs.push([t, r]);
};
Qe.toString = function(t) {
const r = t ? function(n) {
return t.call(this, n, Ce);
} : Ce;
return this._pairs.map(function(o) {
return r(o[0]) + "=" + r(o[1]);
}, "").join("&");
};
function _n(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function Ze(e, t, r) {
if (!t)
return e;
const n = r && r.encode || _n, o = r && r.serialize;
let s;
if (o ? s = o(t, r) : s = c.isURLSearchParams(t) ? t.toString() : new he(t, r).toString(n), s) {
const i = e.indexOf("#");
i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
}
return e;
}
class Ne {
constructor() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
use(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) {
c.forEach(this.handlers, function(n) {
n !== null && t(n);
});
}
}
const Ye = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, Bn = typeof URLSearchParams < "u" ? URLSearchParams : he, kn = typeof FormData < "u" ? FormData : null, jn = typeof Blob < "u" ? Blob : null, Un = {
isBrowser: !0,
classes: {
URLSearchParams: Bn,
FormData: kn,
Blob: jn
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, me = typeof window < "u" && typeof document < "u", ae = typeof navigator == "object" && navigator || void 0, Mn = me && (!ae || ["ReactNative", "NativeScript", "NS"].indexOf(ae.product) < 0), vn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", qn = me && window.location.href || "http://localhost", In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: me,
hasStandardBrowserEnv: Mn,
hasStandardBrowserWebWorkerEnv: vn,
navigator: ae,
origin: qn
}, Symbol.toStringTag, { value: "Module" })), T = {
...In,
...Un
};
function Hn(e, t) {
return Z(e, new T.classes.URLSearchParams(), Object.assign({
visitor: function(r, n, o, s) {
return T.isNode && c.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
}
}, t));
}
function zn(e) {
return c.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function Vn(e) {
const t = {}, r = Object.keys(e);
let n;
const o = r.length;
let s;
for (n = 0; n < o; n++)
s = r[n], t[s] = e[s];
return t;
}
function et(e) {
function t(r, n, o, s) {
let i = r[s++];
if (i === "__proto__") return !0;
const u = Number.isFinite(+i), d = s >= r.length;
return i = !i && c.isArray(o) ? o.length : i, d ? (c.hasOwnProp(o, i) ? o[i] = [o[i], n] : o[i] = n, !u) : ((!o[i] || !c.isObject(o[i])) && (o[i] = []), t(r, n, o[i], s) && c.isArray(o[i]) && (o[i] = Vn(o[i])), !u);
}
if (c.isFormData(e) && c.isFunction(e.entries)) {
const r = {};
return c.forEachEntry(e, (n, o) => {
t(zn(n), o, r, 0);
}), r;
}
return null;
}
function Gn(e, t, r) {
if (c.isString(e))
try {
return (t || JSON.parse)(e), c.trim(e);
} catch (n) {
if (n.name !== "SyntaxError")
throw n;
}
return (0, JSON.stringify)(e);
}
const H = {
transitional: Ye,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(t, r) {
const n = r.getContentType() || "", o = n.indexOf("application/json") > -1, s = c.isObject(t);
if (s && c.isHTMLForm(t) && (t = new FormData(t)), c.isFormData(t))
return o ? JSON.stringify(et(t)) : t;
if (c.isArrayBuffer(t) || c.isBuffer(t) || c.isStream(t) || c.isFile(t) || c.isBlob(t) || c.isReadableStream(t))
return t;
if (c.isArrayBufferView(t))
return t.buffer;
if (c.isURLSearchParams(t))
return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
let u;
if (s) {
if (n.indexOf("application/x-www-form-urlencoded") > -1)
return Hn(t, this.formSerializer).toString();
if ((u = c.isFileList(t)) || n.indexOf("multipart/form-data") > -1) {
const d = this.env && this.env.FormData;
return Z(
u ? { "files[]": t } : t,
d && new d(),
this.formSerializer
);
}
}
return s || o ? (r.setContentType("application/json", !1), Gn(t)) : t;
}],
transformResponse: [function(t) {
const r = this.transitional || H.transitional, n = r && r.forcedJSONParsing, o = this.responseType === "json";
if (c.isResponse(t) || c.isReadableStream(t))
return t;
if (t && c.isString(t) && (n && !this.responseType || o)) {
const i = !(r && r.silentJSONParsing) && o;
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: T.classes.FormData,
Blob: T.classes.Blob
},
validateStatus: function(t) {
return t >= 200 && t < 300;
},
headers: {
common: {
Accept: "application/json, text/plain, */*",
"Content-Type": void 0
}
}
};
c.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
H.headers[e] = {};
});
const Jn = c.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"
]), $n = (e) => {
const t = {};
let r, n, o;
return e && e.split(`
`).forEach(function(i) {
o = i.indexOf(":"), r = i.substring(0, o).trim().toLowerCase(), n = i.substring(o + 1).trim(), !(!r || t[r] && Jn[r]) && (r === "set-cookie" ? t[r] ? t[r].push(n) : t[r] = [n] : t[r] = t[r] ? t[r] + ", " + n : n);
}), t;
}, Ae = Symbol("internals");
function v(e) {
return e && String(e).trim().toLowerCase();
}
function J(e) {
return e === !1 || e == null ? e : c.isArray(e) ? e.map(J) : String(e);
}
function Wn(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 Xn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
function te(e, t, r, n, o) {
if (c.isFunction(n))
return n.call(this, t, r);
if (o && (t = r), !!c.isString(t)) {
if (c.isString(n))
return t.indexOf(n) !== -1;
if (c.isRegExp(n))
return n.test(t);
}
}
function Kn(e) {
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, r, n) => r.toUpperCase() + n);
}
function Qn(e, t) {
const r = c.toCamelCase(" " + t);
["get", "set", "has"].forEach((n) => {
Object.defineProperty(e, n + r, {
value: function(o, s, i) {
return this[n].call(this, t, o, s, i);
},
configurable: !0
});
});
}
class C {
constructor(t) {
t && this.set(t);
}
set(t, r, n) {
const o = this;
function s(u, d, a) {
const l = v(d);
if (!l)
throw new Error("header name must be a non-empty string");
const f = c.findKey(o, l);
(!f || o[f] === void 0 || a === !0 || a === void 0 && o[f] !== !1) && (o[f || d] = J(u));
}
const i = (u, d) => c.forEach(u, (a, l) => s(a, l, d));
if (c.isPlainObject(t) || t instanceof this.constructor)
i(t, r);
else if (c.isString(t) && (t = t.trim()) && !Xn(t))
i($n(t), r);
else if (c.isHeaders(t))
for (const [u, d] of t.entries())
s(d, u, n);
else
t != null && s(r, t, n);
return this;
}
get(t, r) {
if (t = v(t), t) {
const n = c.findKey(this, t);
if (n) {
const o = this[n];
if (!r)
return o;
if (r === !0)
return Wn(o);
if (c.isFunction(r))
return r.call(this, o, n);
if (c.isRegExp(r))
return r.exec(o);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(t, r) {
if (t = v(t), t) {
const n = c.findKey(this, t);
return !!(n && this[n] !== void 0 && (!r || te(this, this[n], n, r)));
}
return !1;
}
delete(t, r) {
const n = this;
let o = !1;
function s(i) {
if (i = v(i), i) {
const u = c.findKey(n, i);
u && (!r || te(n, n[u], u, r)) && (delete n[u], o = !0);
}
}
return c.isArray(t) ? t.forEach(s) : s(t), o;
}
clear(t) {
const r = Object.keys(this);
let n = r.length, o = !1;
for (; n--; ) {
const s = r[n];
(!t || te(this, this[s], s, t, !0)) && (delete this[s], o = !0);
}
return o;
}
normalize(t) {
const r = this, n = {};
return c.forEach(this, (o, s) => {
const i = c.findKey(n, s);
if (i) {
r[i] = J(o), delete r[s];
return;
}
const u = t ? Kn(s) : String(s).trim();
u !== s && delete r[s], r[u] = J(o), n[u] = !0;
}), this;
}
concat(...t) {
return this.constructor.concat(this, ...t);
}
toJSON(t) {
const r = /* @__PURE__ */ Object.create(null);
return c.forEach(this, (n, o) => {
n != null && n !== !1 && (r[o] = t && c.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[Ae] = this[Ae] = {
accessors: {}
}).accessors, o = this.prototype;
function s(i) {
const u = v(i);
n[u] || (Qn(o, i), n[u] = !0);
}
return c.isArray(t) ? t.forEach(s) : s(t), this;
}
}
C.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
c.reduceDescriptors(C.prototype, ({ value: e }, t) => {
let r = t[0].toUpperCase() + t.slice(1);
return {
get: () => e,
set(n) {
this[r] = n;
}
};
});
c.freezeMethods(C);
function ne(e, t) {
const r = this || H, n = t || r, o = C.from(n.headers);
let s = n.data;
return c.forEach(e, function(u) {
s = u.call(r, s, o.normalize(), t ? t.status : void 0);
}), o.normalize(), s;
}
function tt(e) {
return !!(e && e.__CANCEL__);
}
function M(e, t, r) {
w.call(this, e ?? "canceled", w.ERR_CANCELED, t, r), this.name = "CanceledError";
}
c.inherits(M, w, {
__CANCEL__: !0
});
function nt(e, t, r) {
const n = r.config.validateStatus;
!r.status || !n || n(r.status) ? e(r) : t(new w(
"Request failed with status code " + r.status,
[w.ERR_BAD_REQUEST, w.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
r.config,
r.request,
r
));
}
function Zn(e) {
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
return t && t[1] || "";
}
function Yn(e, t) {
e = e || 10;
const r = new Array(e), n = new Array(e);
let o = 0, s = 0, i;
return t = t !== void 0 ? t : 1e3, function(d) {
const a = Date.now(), l = n[s];
i || (i = a), r[o] = d, n[o] = a;
let f = s, g = 0;
for (; f !== o; )
g += r[f++], f = f % e;
if (o = (o + 1) % e, o === s && (s = (s + 1) % e), a - i < t)
return;
const h = l && a - l;
return h ? Math.round(g * 1e3 / h) : void 0;
};
}
function er(e, t) {
let r = 0, n = 1e3 / t, o, s;
const i = (a, l = Date.now()) => {
r = l, o = null, s && (clearTimeout(s), s = null), e.apply(null, a);
};
return [(...a) => {
const l = Date.now(), f = l - r;
f >= n ? i(a, l) : (o = a, s || (s = setTimeout(() => {
s = null, i(o);
}, n - f)));
}, () => o && i(o)];
}
const $ = (e, t, r = 3) => {
let n = 0;
const o = Yn(50, 250);
return er((s) => {
const i = s.loaded, u = s.lengthComputable ? s.total : void 0, d = i - n, a = o(d), l = i <= u;
n = i;
const f = {
loaded: i,
total: u,
progress: u ? i / u : void 0,
bytes: d,
rate: a || void 0,
estimated: a && u && l ? (u - i) / a : void 0,
event: s,
lengthComputable: u != null,
[t ? "download" : "upload"]: !0
};
e(f);
}, r);
}, xe = (e, t) => {
const r = e != null;
return [(n) => t[0]({
lengthComputable: r,
total: e,
loaded: n
}), t[1]];
}, Pe = (e) => (...t) => c.asap(() => e(...t)), tr = T.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 = T.navigator && /(msie|trident)/i.test(T.navigator.userAgent), r = document.createElement("a");
let n;
function o(s) {
let i = s;
return t && (r.setAttribute("href", i), i = r.href), r.setAttribute("href", i), {
href: r.href,
protocol: r.protocol ? r.protocol.replace(/:$/, "") : "",
host: r.host,
search: r.search ? r.search.replace(/^\?/, "") : "",
hash: r.hash ? r.hash.replace(/^#/, "") : "",
hostname: r.hostname,
port: r.port,
pathname: r.pathname.charAt(0) === "/" ? r.pathname : "/" + r.pathname
};
}
return n = o(window.location.href), function(i) {
const u = c.isString(i) ? o(i) : i;
return u.protocol === n.protocol && u.host === n.host;
};
}()
) : (
// Non standard browser envs (web workers, react-native) lack needed support.
/* @__PURE__ */ function() {
return function() {
return !0;
};
}()
), nr = T.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(e, t, r, n, o, s) {
const i = [e + "=" + encodeURIComponent(t)];
c.isNumber(r) && i.push("expires=" + new Date(r).toGMTString()), c.isString(n) && i.push("path=" + n), c.isString(o) && i.push("domain=" + o), s === !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 rr(e) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}
function or(e, t) {
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
}
function rt(e, t) {
return e && !rr(t) ? or(e, t) : t;
}
const De = (e) => e instanceof C ? { ...e } : e;
function j(e, t) {
t = t || {};
const r = {};
function n(a, l, f) {
return c.isPlainObject(a) && c.isPlainObject(l) ? c.merge.call({ caseless: f }, a, l) : c.isPlainObject(l) ? c.merge({}, l) : c.isArray(l) ? l.slice() : l;
}
function o(a, l, f) {
if (c.isUndefined(l)) {
if (!c.isUndefined(a))
return n(void 0, a, f);
} else return n(a, l, f);
}
function s(a, l) {
if (!c.isUndefined(l))
return n(void 0, l);
}
function i(a, l) {
if (c.isUndefined(l)) {
if (!c.isUndefined(a))
return n(void 0, a);
} else return n(void 0, l);
}
function u(a, l, f) {
if (f in t)
return n(a, l);
if (f in e)
return n(void 0, a);
}
const d = {
url: s,
method: s,
data: s,
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: (a, l) => o(De(a), De(l), !0)
};
return c.forEach(Object.keys(Object.assign({}, e, t)), function(l) {
const f = d[l] || o, g = f(e[l], t[l], l);
c.isUndefined(g) && f !== u || (r[l] = g);
}), r;
}
const ot = (e) => {
const t = j({}, e);
let { data: r, withXSRFToken: n, xsrfHeaderName: o, xsrfCookieName: s, headers: i, auth: u } = t;
t.headers = i = C.from(i), t.url = Ze(rt(t.baseURL, t.url), e.params, e.paramsSerializer), u && i.set(
"Authorization",
"Basic " + btoa((u.username || "") + ":" + (u.password ? unescape(encodeURIComponent(u.password)) : ""))
);
let d;
if (c.isFormData(r)) {
if (T.hasStandardBrowserEnv || T.hasStandardBrowserWebWorkerEnv)
i.setContentType(void 0);
else if ((d = i.getContentType()) !== !1) {
const [a, ...l] = d ? d.split(";").map((f) => f.trim()).filter(Boolean) : [];
i.setContentType([a || "multipart/form-data", ...l].join("; "));
}
}
if (T.hasStandardBrowserEnv && (n && c.isFunction(n) && (n = n(t)), n || n !== !1 && tr(t.url))) {
const a = o && s && nr.read(s);
a && i.set(o, a);
}
return t;
}, sr = typeof XMLHttpRequest < "u", ir = sr && function(e) {
return new Promise(function(r, n) {
const o = ot(e);
let s = o.data;
const i = C.from(o.headers).normalize();
let { responseType: u, onUploadProgress: d, onDownloadProgress: a } = o, l, f, g, h, p;
function b() {
h && h(), p && p(), o.cancelToken && o.cancelToken.unsubscribe(l), o.signal && o.signal.removeEventListener("abort", l);
}
let m = new XMLHttpRequest();
m.open(o.method.toUpperCase(), o.url, !0), m.timeout = o.timeout;
function y() {
if (!m)
return;
const S = C.from(
"getAllResponseHeaders" in m && m.getAllResponseHeaders()
), O = {
data: !u || u === "text" || u === "json" ? m.responseText : m.response,
status: m.status,
statusText: m.statusText,
headers: S,
config: e,
request: m
};
nt(function(L) {
r(L), b();
}, function(L) {
n(L), b();
}, O), m = null;
}
"onloadend" in m ? m.onloadend = y : m.onreadystatechange = function() {
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(y);
}, m.onabort = function() {
m && (n(new w("Request aborted", w.ECONNABORTED, e, m)), m = null);
}, m.onerror = function() {
n(new w("Network Error", w.ERR_NETWORK, e, m)), m = null;
}, m.ontimeout = function() {
let A = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
const O = o.transitional || Ye;
o.timeoutErrorMessage && (A = o.timeoutErrorMessage), n(new w(
A,
O.clarifyTimeoutError ? w.ETIMEDOUT : w.ECONNABORTED,
e,
m
)), m = null;
}, s === void 0 && i.setContentType(null), "setRequestHeader" in m && c.forEach(i.toJSON(), function(A, O) {
m.setRequestHeader(O, A);
}), c.isUndefined(o.withCredentials) || (m.withCredentials = !!o.withCredentials), u && u !== "json" && (m.responseType = o.responseType), a && ([g, p] = $(a, !0), m.addEventListener("progress", g)), d && m.upload && ([f, h] = $(d), m.upload.addEventListener("progress", f), m.upload.addEventListener("loadend", h)), (o.cancelToken || o.signal) && (l = (S) => {
m && (n(!S || S.type ? new M(null, e, m) : S), m.abort(), m = null);
}, o.cancelToken && o.cancelToken.subscribe(l), o.signal && (o.signal.aborted ? l() : o.signal.addEventListener("abort", l)));
const E = Zn(o.url);
if (E && T.protocols.indexOf(E) === -1) {
n(new w("Unsupported protocol " + E + ":", w.ERR_BAD_REQUEST, e));
return;
}
m.send(s || null);
});
}, ar = (e, t) => {
const { length: r } = e = e ? e.filter(Boolean) : [];
if (t || r) {
let n = new AbortController(), o;
const s = function(a) {
if (!o) {
o = !0, u();
const l = a instanceof Error ? a : this.reason;
n.abort(l instanceof w ? l : new M(l instanceof Error ? l.message : l));
}
};
let i = t && setTimeout(() => {
i = null, s(new w(`timeout ${t} of ms exceeded`, w.ETIMEDOUT));
}, t);
const u = () => {
e && (i && clearTimeout(i), i = null, e.forEach((a) => {
a.unsubscribe ? a.unsubscribe(s) : a.removeEventListener("abort", s);
}), e = null);
};
e.forEach((a) => a.addEventListener("abort", s));
const { signal: d } = n;
return d.unsubscribe = () => c.asap(u), d;
}
}, cr = 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;
}, ur = async function* (e, t) {
for await (const r of lr(e))
yield* cr(r, t);
}, lr = 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();
}
}, Le = (e, t, r, n) => {
const o = ur(e, t);
let s = 0, i, u = (d) => {
i || (i = !0, n && n(d));
};
return new ReadableStream({
async pull(d) {
try {
const { done: a, value: l } = await o.next();
if (a) {
u(), d.close();
return;
}
let f = l.byteLength;
if (r) {
let g = s += f;
r(g);
}
d.enqueue(new Uint8Array(l));
} catch (a) {
throw u(a), a;
}
},
cancel(d) {
return u(d), o.return();
}
}, {
highWaterMark: 2
});
}, Y = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", st = Y && typeof ReadableStream == "function", fr = Y && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), it = (e, ...t) => {
try {
return !!e(...t);
} catch {
return !1;
}
}, dr = st && it(() => {
let e = !1;
const t = new Request(T.origin, {
body: new ReadableStream(),
method: "POST",
get duplex() {
return e = !0, "half";
}
}).headers.has("Content-Type");
return e && !t;
}), Fe = 64 * 1024, ce = st && it(() => c.isReadableStream(new Response("").body)), W = {
stream: ce && ((e) => e.body)
};
Y && ((e) => {
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
!W[t] && (W[t] = c.isFunction(e[t]) ? (r) => r[t]() : (r, n) => {
throw new w(`Response type '${t}' is not supported`, w.ERR_NOT_SUPPORT, n);
});
});
})(new Response());
const pr = async (e) => {
if (e == null)
return 0;
if (c.isBlob(e))
return e.size;
if (c.isSpecCompliantForm(e))
return (await new Request(T.origin, {
method: "POST",
body: e
}).arrayBuffer()).byteLength;
if (c.isArrayBufferView(e) || c.isArrayBuffer(e))
return e.byteLength;
if (c.isURLSearchParams(e) && (e = e + ""), c.isString(e))
return (await fr(e)).byteLength;
}, hr = async (e, t) => {
const r = c.toFiniteNumber(e.getContentLength());
return r ?? pr(t);
}, mr = Y && (async (e) => {
let {
url: t,
method: r,
data: n,
signal: o,
cancelToken: s,
timeout: i,
onDownloadProgress: u,
onUploadProgress: d,
responseType: a,
headers: l,
withCredentials: f = "same-origin",
fetchOptions: g
} = ot(e);
a = a ? (a + "").toLowerCase() : "text";
let h = ar([o, s && s.toAbortSignal()], i), p;
const b = h && h.unsubscribe && (() => {
h.unsubscribe();
});
let m;
try {
if (d && dr && r !== "get" && r !== "head" && (m = await hr(l, n)) !== 0) {
let O = new Request(t, {
method: "POST",
body: n,
duplex: "half"
}), P;
if (c.isFormData(n) && (P = O.headers.get("content-type")) && l.setContentType(P), O.body) {
const [L, z] = xe(
m,
$(Pe(d))
);
n = Le(O.body, Fe, L, z);
}
}
c.isString(f) || (f = f ? "include" : "omit");
const y = "credentials" in Request.prototype;
p = new Request(t, {
...g,
signal: h,
method: r.toUpperCase(),
headers: l.normalize().toJSON(),
body: n,
duplex: "half",
credentials: y ? f : void 0
});
let E = await fetch(p);
const S = ce && (a === "stream" || a === "response");
if (ce && (u || S && b)) {
const O = {};
["status", "statusText", "headers"].forEach((be) => {
O[be] = E[be];
});
const P = c.toFiniteNumber(E.headers.get("content-length")), [L, z] = u && xe(
P,
$(Pe(u), !0)
) || [];
E = new Response(
Le(E.body, Fe, L, () => {
z && z(), b && b();
}),
O
);
}
a = a || "text";
let A = await W[c.findKey(W, a) || "text"](E, e);
return !S && b && b(), await new Promise((O, P) => {
nt(O, P, {
data: A,
headers: C.from(E.headers),
status: E.status,
statusText: E.statusText,
config: e,
request: p
});
});
} catch (y) {
throw b && b(), y && y.name === "TypeError" && /fetch/i.test(y.message) ? Object.assign(
new w("Network Error", w.ERR_NETWORK, e, p),
{
cause: y.cause || y
}
) : w.from(y, y && y.code, e, p);
}
}), ue = {
http: Dn,
xhr: ir,
fetch: mr
};
c.forEach(ue, (e, t) => {
if (e) {
try {
Object.defineProperty(e, "name", { value: t });
} catch {
}
Object.defineProperty(e, "adapterName", { value: t });
}
});
const _e = (e) => `- ${e}`, yr = (e) => c.isFunction(e) || e === null || e === !1, at = {
getAdapter: (e) => {
e = c.isArray(e) ? e : [e];
const { length: t } = e;
let r, n;
const o = {};
for (let s = 0; s < t; s++) {
r = e[s];
let i;
if (n = r, !yr(r) && (n = ue[(i = String(r)).toLowerCase()], n === void 0))
throw new w(`Unknown adapter '${i}'`);
if (n)
break;
o[i || "#" + s] = n;
}
if (!n) {
const s = Object.entries(o).map(
([u, d]) => `adapter ${u} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
);
let i = t ? s.length > 1 ? `since :
` + s.map(_e).join(`
`) : " " + _e(s[0]) : "as no adapter specified";
throw new w(
"There is no suitable adapter to dispatch the request " + i,
"ERR_NOT_SUPPORT"
);
}
return n;
},
adapters: ue
};
function re(e) {
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
throw new M(null, e);
}
function Be(e) {
return re(e), e.headers = C.from(e.headers), e.data = ne.call(
e,
e.transformRequest
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), at.getAdapter(e.adapter || H.adapter)(e).then(function(n) {
return re(e), n.data = ne.call(
e,
e.transformResponse,
n
), n.headers = C.from(n.headers), n;
}, function(n) {
return tt(n) || (re(e), n && n.response && (n.response.data = ne.call(
e,
e.transformResponse,
n.response
), n.response.headers = C.from(n.response.headers))), Promise.reject(n);
});
}
const ct = "1.7.7", ye = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
ye[e] = function(n) {
return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
};
});
const ke = {};
ye.transitional = function(t, r, n) {
function o(s, i) {
return "[Axios v" + ct + "] Transitional option '" + s + "'" + i + (n ? ". " + n : "");
}
return (s, i, u) => {
if (t === !1)
throw new w(
o(i, " has been removed" + (r ? " in " + r : "")),
w.ERR_DEPRECATED
);
return r && !ke[i] && (ke[i] = !0, console.warn(
o(
i,
" has been deprecated since v" + r + " and will be removed in the near future"
)
)), t ? t(s, i, u) : !0;
};
};
function gr(e, t, r) {
if (typeof e != "object")
throw new w("options must be an object", w.ERR_BAD_OPTION_VALUE);
const n = Object.keys(e);
let o = n.length;
for (; o-- > 0; ) {
const s = n[o], i = t[s];
if (i) {
const u = e[s], d = u === void 0 || i(u, s, e);
if (d !== !0)
throw new w("option " + s + " must be " + d, w.ERR_BAD_OPTION_VALUE);
continue;
}
if (r !== !0)
throw new w("Unknown option " + s, w.ERR_BAD_OPTION);
}
}
const le = {
assertOptions: gr,
validators: ye
}, D = le.validators;
class B {
constructor(t) {
this.defaults = t, this.interceptors = {
request: new Ne(),
response: new Ne()