UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

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