UNPKG

@wdp-api/bim-api

Version:

51WORLD BIM/DCP Api is a JavaScript plugin for WdpApi, It provides a set of APIs for developers to integrate BIM/DCP into their own applications.

1,640 lines 262 kB
var $i = Object.defineProperty; var Vi = (o, r, n) => r in o ? $i(o, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : o[r] = n; var se = (o, r, n) => Vi(o, typeof r != "symbol" ? r + "" : r, n); class Bs { constructor(r, n) { se(this, "subject"); se(this, "level"); this.subject = r, this.level = n ?? 10; } log(r, n, ...s) { if (typeof (s == null ? void 0 : s[0]) == "string" && s[0].match(/\%[sodif]?/gi)) { const a = s.shift(), c = /* @__PURE__ */ new Date(); console.log( `${n}%c[${c.toLocaleTimeString()}.${c.getMilliseconds()}]::: %c${a}`, `color: ${r}`, "color: unset", ...s ); } else for (const a of s) { const c = /* @__PURE__ */ new Date(); console.log(`${n}%c[${c.toLocaleTimeString()}.${c.getMilliseconds()}]:::`, `color: ${r}`, a); } } error(r, ...n) { this.level !== 0 && (console.group( `%c${this.subject} %c ${r}`, "color: black; border-radius: 3px 0 0 3px; padding: 2px 2px 1px 10px; background: #ff4d4f", "border-radius: 0 3px 3px 0; padding: 2px 10px 1px 2px; background: #ff4d4f20" ), this.log("#ff4d4f", "⭕", ...n), console.groupEnd()); } info(r, ...n) { console.groupCollapsed( `%c${this.subject} %c ${r}`, "color: black; border-radius: 3px 0 0 3px; padding: 2px 2px 1px 10px; background: #00dc82", "border-radius: 0 3px 3px 0; padding: 2px 10px 1px 2px; background: #00dc8220" ), this.log("#00dc82", "🚀", ...n), console.groupEnd(); } warn(r, ...n) { console.group( `%c${this.subject} %c ${r}`, "color: black; border-radius: 3px 0 0 3px; padding: 2px 2px 1px 10px; background: #faad14", "border-radius: 0 3px 3px 0; padding: 2px 10px 1px 2px; background: #faad1420" ), this.log("#faad14", "🔥", ...n), console.groupEnd(); } lowLevel(r, ...n) { this.level < 1 || this.info(r, ...n); } highLevel(r, ...n) { this.level < 3 || this.warn(r, ...n); } } const Wi = (o) => !!o && o.constructor === Symbol, _n = Array.isArray, Ji = (o) => !!o && o.constructor === Object, Ms = (o) => !!(o && o.constructor && o.call && o.apply), vr = (o) => { try { return Number(o) === o; } catch { return !1; } }, Xi = (o) => Object.prototype.toString.call(o) === "[object Date]", H = (o) => { if (o === !0 || o === !1 || o == null) return !0; if (vr(o)) return o === 0; if (Xi(o)) return isNaN(o.getTime()); if (Ms(o) || Wi(o)) return !1; const r = o.length; if (vr(r)) return r === 0; const n = o.size; return vr(n) ? n === 0 : Object.keys(o).length === 0; }, wt = (o, r) => { if (Object.is(o, r)) return !0; if (o instanceof Date && r instanceof Date) return o.getTime() === r.getTime(); if (o instanceof RegExp && r instanceof RegExp) return o.toString() === r.toString(); if (typeof o != "object" || o === null || typeof r != "object" || r === null) return !1; const n = Reflect.ownKeys(o), s = Reflect.ownKeys(r); if (n.length !== s.length) return !1; for (let a = 0; a < n.length; a++) if (!Reflect.has(r, n[a]) || !wt(o[n[a]], r[n[a]])) return !1; return !0; }; function Yi(o, r) { if (!o || !o.length) return {}; const n = Ms(r) ? r : _n(r) ? (s, a) => r[a] : (s, a) => r; return o.reduce((s, a, c) => (s[a] = n(a, c), s), {}); } const Qi = (o, r, n) => o ? o.reduce((s, a, c) => (n(a, c) && s.push(r(a, c)), s), []) : [], Zi = (o, r) => { const n = o.reduce((s, a) => { const c = r(a); return s[c] || (s[c] = a), s; }, {}); return Object.values(n); }, We = (o, r) => !o || !r ? o ?? r ?? {} : Object.entries({ ...o, ...r }).reduce( (n, [s, a]) => ({ ...n, [s]: Ji(o[s]) ? We(o[s], a) : a }), {} ); function Ls(o, r) { return function() { return o.apply(r, arguments); }; } const { toString: eo } = Object.prototype, { getPrototypeOf: Tr } = Object, xn = /* @__PURE__ */ ((o) => (r) => { const n = eo.call(r); return o[n] || (o[n] = n.slice(8, -1).toLowerCase()); })(/* @__PURE__ */ Object.create(null)), Oe = (o) => (o = o.toLowerCase(), (r) => xn(r) === o), Cn = (o) => (r) => typeof r === o, { isArray: St } = Array, Gt = Cn("undefined"); function to(o) { return o !== null && !Gt(o) && o.constructor !== null && !Gt(o.constructor) && Ce(o.constructor.isBuffer) && o.constructor.isBuffer(o); } const Fs = Oe("ArrayBuffer"); function no(o) { let r; return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? r = ArrayBuffer.isView(o) : r = o && o.buffer && Fs(o.buffer), r; } const ro = Cn("string"), Ce = Cn("function"), Gs = Cn("number"), In = (o) => o !== null && typeof o == "object", so = (o) => o === !0 || o === !1, wn = (o) => { if (xn(o) !== "object") return !1; const r = Tr(o); return (r === null || r === Object.prototype || Object.getPrototypeOf(r) === null) && !(Symbol.toStringTag in o) && !(Symbol.iterator in o); }, io = Oe("Date"), oo = Oe("File"), ao = Oe("Blob"), co = Oe("FileList"), uo = (o) => In(o) && Ce(o.pipe), lo = (o) => { let r; return o && (typeof FormData == "function" && o instanceof FormData || Ce(o.append) && ((r = xn(o)) === "formdata" || // detect form-data instance r === "object" && Ce(o.toString) && o.toString() === "[object FormData]")); }, fo = Oe("URLSearchParams"), [ho, po, mo, yo] = ["ReadableStream", "Request", "Response", "Headers"].map(Oe), go = (o) => o.trim ? o.trim() : o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); function Kt(o, r, { allOwnKeys: n = !1 } = {}) { if (o === null || typeof o > "u") return; let s, a; if (typeof o != "object" && (o = [o]), St(o)) for (s = 0, a = o.length; s < a; s++) r.call(null, o[s], s, o); else { const c = n ? Object.getOwnPropertyNames(o) : Object.keys(o), d = c.length; let h; for (s = 0; s < d; s++) h = c[s], r.call(null, o[h], h, o); } } function Ks(o, r) { r = r.toLowerCase(); const n = Object.keys(o); let s = n.length, a; for (; s-- > 0; ) if (a = n[s], r === a.toLowerCase()) return a; return null; } const ot = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, qs = (o) => !Gt(o) && o !== ot; function Pr() { const { caseless: o } = qs(this) && this || {}, r = {}, n = (s, a) => { const c = o && Ks(r, a) || a; wn(r[c]) && wn(s) ? r[c] = Pr(r[c], s) : wn(s) ? r[c] = Pr({}, s) : St(s) ? r[c] = s.slice() : r[c] = s; }; for (let s = 0, a = arguments.length; s < a; s++) arguments[s] && Kt(arguments[s], n); return r; } const bo = (o, r, n, { allOwnKeys: s } = {}) => (Kt(r, (a, c) => { n && Ce(a) ? o[c] = Ls(a, n) : o[c] = a; }, { allOwnKeys: s }), o), vo = (o) => (o.charCodeAt(0) === 65279 && (o = o.slice(1)), o), wo = (o, r, n, s) => { o.prototype = Object.create(r.prototype, s), o.prototype.constructor = o, Object.defineProperty(o, "super", { value: r.prototype }), n && Object.assign(o.prototype, n); }, So = (o, r, n, s) => { let a, c, d; const h = {}; if (r = r || {}, o == null) return r; do { for (a = Object.getOwnPropertyNames(o), c = a.length; c-- > 0; ) d = a[c], (!s || s(d, o, r)) && !h[d] && (r[d] = o[d], h[d] = !0); o = n !== !1 && Tr(o); } while (o && (!n || n(o, r)) && o !== Object.prototype); return r; }, Ao = (o, r, n) => { o = String(o), (n === void 0 || n > o.length) && (n = o.length), n -= r.length; const s = o.indexOf(r, n); return s !== -1 && s === n; }, _o = (o) => { if (!o) return null; if (St(o)) return o; let r = o.length; if (!Gs(r)) return null; const n = new Array(r); for (; r-- > 0; ) n[r] = o[r]; return n; }, Eo = /* @__PURE__ */ ((o) => (r) => o && r instanceof o)(typeof Uint8Array < "u" && Tr(Uint8Array)), Po = (o, r) => { const s = (o && o[Symbol.iterator]).call(o); let a; for (; (a = s.next()) && !a.done; ) { const c = a.value; r.call(o, c[0], c[1]); } }, xo = (o, r) => { let n; const s = []; for (; (n = o.exec(r)) !== null; ) s.push(n); return s; }, Co = Oe("HTMLFormElement"), Io = (o) => o.toLowerCase().replace( /[-_\s]([a-z\d])(\w*)/g, function(n, s, a) { return s.toUpperCase() + a; } ), bs = (({ hasOwnProperty: o }) => (r, n) => o.call(r, n))(Object.prototype), ko = Oe("RegExp"), Us = (o, r) => { const n = Object.getOwnPropertyDescriptors(o), s = {}; Kt(n, (a, c) => { let d; (d = r(a, c, o)) !== !1 && (s[c] = d || a); }), Object.defineProperties(o, s); }, Oo = (o) => { Us(o, (r, n) => { if (Ce(o) && ["arguments", "caller", "callee"].indexOf(n) !== -1) return !1; const s = o[n]; if (Ce(s)) { if (r.enumerable = !1, "writable" in r) { r.writable = !1; return; } r.set || (r.set = () => { throw Error("Can not rewrite read-only method '" + n + "'"); }); } }); }, No = (o, r) => { const n = {}, s = (a) => { a.forEach((c) => { n[c] = !0; }); }; return St(o) ? s(o) : s(String(o).split(r)), n; }, Do = () => { }, To = (o, r) => o != null && Number.isFinite(o = +o) ? o : r, wr = "abcdefghijklmnopqrstuvwxyz", vs = "0123456789", Hs = { DIGIT: vs, ALPHA: wr, ALPHA_DIGIT: wr + wr.toUpperCase() + vs }, Ro = (o = 16, r = Hs.ALPHA_DIGIT) => { let n = ""; const { length: s } = r; for (; o--; ) n += r[Math.random() * s | 0]; return n; }; function jo(o) { return !!(o && Ce(o.append) && o[Symbol.toStringTag] === "FormData" && o[Symbol.iterator]); } const Bo = (o) => { const r = new Array(10), n = (s, a) => { if (In(s)) { if (r.indexOf(s) >= 0) return; if (!("toJSON" in s)) { r[a] = s; const c = St(s) ? [] : {}; return Kt(s, (d, h) => { const b = n(d, a + 1); !Gt(b) && (c[h] = b); }), r[a] = void 0, c; } } return s; }; return n(o, 0); }, Mo = Oe("AsyncFunction"), Lo = (o) => o && (In(o) || Ce(o)) && Ce(o.then) && Ce(o.catch), zs = ((o, r) => o ? setImmediate : r ? ((n, s) => (ot.addEventListener("message", ({ source: a, data: c }) => { a === ot && c === n && s.length && s.shift()(); }, !1), (a) => { s.push(a), ot.postMessage(n, "*"); }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))( typeof setImmediate == "function", Ce(ot.postMessage) ), Fo = typeof queueMicrotask < "u" ? queueMicrotask.bind(ot) : typeof process < "u" && process.nextTick || zs, N = { isArray: St, isArrayBuffer: Fs, isBuffer: to, isFormData: lo, isArrayBufferView: no, isString: ro, isNumber: Gs, isBoolean: so, isObject: In, isPlainObject: wn, isReadableStream: ho, isRequest: po, isResponse: mo, isHeaders: yo, isUndefined: Gt, isDate: io, isFile: oo, isBlob: ao, isRegExp: ko, isFunction: Ce, isStream: uo, isURLSearchParams: fo, isTypedArray: Eo, isFileList: co, forEach: Kt, merge: Pr, extend: bo, trim: go, stripBOM: vo, inherits: wo, toFlatObject: So, kindOf: xn, kindOfTest: Oe, endsWith: Ao, toArray: _o, forEachEntry: Po, matchAll: xo, isHTMLForm: Co, hasOwnProperty: bs, hasOwnProp: bs, // an alias to avoid ESLint no-prototype-builtins detection reduceDescriptors: Us, freezeMethods: Oo, toObjectSet: No, toCamelCase: Io, noop: Do, toFiniteNumber: To, findKey: Ks, global: ot, isContextDefined: qs, ALPHABET: Hs, generateString: Ro, isSpecCompliantForm: jo, toJSONObject: Bo, isAsyncFn: Mo, isThenable: Lo, setImmediate: zs, asap: Fo }; function Y(o, r, n, s, a) { Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = o, this.name = "AxiosError", r && (this.code = r), n && (this.config = n), s && (this.request = s), a && (this.response = a, this.status = a.status ? a.status : null); } N.inherits(Y, 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: N.toJSONObject(this.config), code: this.code, status: this.status }; } }); const $s = Y.prototype, Vs = {}; [ "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((o) => { Vs[o] = { value: o }; }); Object.defineProperties(Y, Vs); Object.defineProperty($s, "isAxiosError", { value: !0 }); Y.from = (o, r, n, s, a, c) => { const d = Object.create($s); return N.toFlatObject(o, d, function(b) { return b !== Error.prototype; }, (h) => h !== "isAxiosError"), Y.call(d, o.message, r, n, s, a), d.cause = o, d.name = o.name, c && Object.assign(d, c), d; }; const Go = null; function xr(o) { return N.isPlainObject(o) || N.isArray(o); } function Ws(o) { return N.endsWith(o, "[]") ? o.slice(0, -2) : o; } function ws(o, r, n) { return o ? o.concat(r).map(function(a, c) { return a = Ws(a), !n && c ? "[" + a + "]" : a; }).join(n ? "." : "") : r; } function Ko(o) { return N.isArray(o) && !o.some(xr); } const qo = N.toFlatObject(N, {}, null, function(r) { return /^is[A-Z]/.test(r); }); function kn(o, r, n) { if (!N.isObject(o)) throw new TypeError("target must be an object"); r = r || new FormData(), n = N.toFlatObject(n, { metaTokens: !0, dots: !1, indexes: !1 }, !1, function(V, U) { return !N.isUndefined(U[V]); }); const s = n.metaTokens, a = n.visitor || P, c = n.dots, d = n.indexes, b = (n.Blob || typeof Blob < "u" && Blob) && N.isSpecCompliantForm(r); if (!N.isFunction(a)) throw new TypeError("visitor must be a function"); function y(M) { if (M === null) return ""; if (N.isDate(M)) return M.toISOString(); if (!b && N.isBlob(M)) throw new Y("Blob is not supported. Use a Buffer instead."); return N.isArrayBuffer(M) || N.isTypedArray(M) ? b && typeof Blob == "function" ? new Blob([M]) : Buffer.from(M) : M; } function P(M, V, U) { let te = M; if (M && !U && typeof M == "object") { if (N.endsWith(V, "{}")) V = s ? V : V.slice(0, -2), M = JSON.stringify(M); else if (N.isArray(M) && Ko(M) || (N.isFileList(M) || N.endsWith(V, "[]")) && (te = N.toArray(M))) return V = Ws(V), te.forEach(function(le, _e) { !(N.isUndefined(le) || le === null) && r.append( // eslint-disable-next-line no-nested-ternary d === !0 ? ws([V], _e, c) : d === null ? V : V + "[]", y(le) ); }), !1; } return xr(M) ? !0 : (r.append(ws(U, V, c), y(M)), !1); } const D = [], B = Object.assign(qo, { defaultVisitor: P, convertValue: y, isVisitable: xr }); function $(M, V) { if (!N.isUndefined(M)) { if (D.indexOf(M) !== -1) throw Error("Circular reference detected in " + V.join(".")); D.push(M), N.forEach(M, function(te, ae) { (!(N.isUndefined(te) || te === null) && a.call( r, te, N.isString(ae) ? ae.trim() : ae, V, B )) === !0 && $(te, V ? V.concat(ae) : [ae]); }), D.pop(); } } if (!N.isObject(o)) throw new TypeError("data must be an object"); return $(o), r; } function Ss(o) { const r = { "!": "%21", "'": "%27", "(": "%28", ")": "%29", "~": "%7E", "%20": "+", "%00": "\0" }; return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g, function(s) { return r[s]; }); } function Rr(o, r) { this._pairs = [], o && kn(o, this, r); } const Js = Rr.prototype; Js.append = function(r, n) { this._pairs.push([r, n]); }; Js.toString = function(r) { const n = r ? function(s) { return r.call(this, s, Ss); } : Ss; return this._pairs.map(function(a) { return n(a[0]) + "=" + n(a[1]); }, "").join("&"); }; function Uo(o) { return encodeURIComponent(o).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); } function Xs(o, r, n) { if (!r) return o; const s = n && n.encode || Uo; N.isFunction(n) && (n = { serialize: n }); const a = n && n.serialize; let c; if (a ? c = a(r, n) : c = N.isURLSearchParams(r) ? r.toString() : new Rr(r, n).toString(s), c) { const d = o.indexOf("#"); d !== -1 && (o = o.slice(0, d)), o += (o.indexOf("?") === -1 ? "?" : "&") + c; } return o; } class As { 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(r, n, s) { return this.handlers.push({ fulfilled: r, rejected: n, synchronous: s ? s.synchronous : !1, runWhen: s ? s.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(r) { this.handlers[r] && (this.handlers[r] = 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(r) { N.forEach(this.handlers, function(s) { s !== null && r(s); }); } } const Ys = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 }, Ho = typeof URLSearchParams < "u" ? URLSearchParams : Rr, zo = typeof FormData < "u" ? FormData : null, $o = typeof Blob < "u" ? Blob : null, Vo = { isBrowser: !0, classes: { URLSearchParams: Ho, FormData: zo, Blob: $o }, protocols: ["http", "https", "file", "blob", "url", "data"] }, jr = typeof window < "u" && typeof document < "u", Cr = typeof navigator == "object" && navigator || void 0, Wo = jr && (!Cr || ["ReactNative", "NativeScript", "NS"].indexOf(Cr.product) < 0), Jo = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Xo = jr && window.location.href || "http://localhost", Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, hasBrowserEnv: jr, hasStandardBrowserEnv: Wo, hasStandardBrowserWebWorkerEnv: Jo, navigator: Cr, origin: Xo }, Symbol.toStringTag, { value: "Module" })), Ae = { ...Yo, ...Vo }; function Qo(o, r) { return kn(o, new Ae.classes.URLSearchParams(), Object.assign({ visitor: function(n, s, a, c) { return Ae.isNode && N.isBuffer(n) ? (this.append(s, n.toString("base64")), !1) : c.defaultVisitor.apply(this, arguments); } }, r)); } function Zo(o) { return N.matchAll(/\w+|\[(\w*)]/g, o).map((r) => r[0] === "[]" ? "" : r[1] || r[0]); } function ea(o) { const r = {}, n = Object.keys(o); let s; const a = n.length; let c; for (s = 0; s < a; s++) c = n[s], r[c] = o[c]; return r; } function Qs(o) { function r(n, s, a, c) { let d = n[c++]; if (d === "__proto__") return !0; const h = Number.isFinite(+d), b = c >= n.length; return d = !d && N.isArray(a) ? a.length : d, b ? (N.hasOwnProp(a, d) ? a[d] = [a[d], s] : a[d] = s, !h) : ((!a[d] || !N.isObject(a[d])) && (a[d] = []), r(n, s, a[d], c) && N.isArray(a[d]) && (a[d] = ea(a[d])), !h); } if (N.isFormData(o) && N.isFunction(o.entries)) { const n = {}; return N.forEachEntry(o, (s, a) => { r(Zo(s), a, n, 0); }), n; } return null; } function ta(o, r, n) { if (N.isString(o)) try { return (r || JSON.parse)(o), N.trim(o); } catch (s) { if (s.name !== "SyntaxError") throw s; } return (0, JSON.stringify)(o); } const qt = { transitional: Ys, adapter: ["xhr", "http", "fetch"], transformRequest: [function(r, n) { const s = n.getContentType() || "", a = s.indexOf("application/json") > -1, c = N.isObject(r); if (c && N.isHTMLForm(r) && (r = new FormData(r)), N.isFormData(r)) return a ? JSON.stringify(Qs(r)) : r; if (N.isArrayBuffer(r) || N.isBuffer(r) || N.isStream(r) || N.isFile(r) || N.isBlob(r) || N.isReadableStream(r)) return r; if (N.isArrayBufferView(r)) return r.buffer; if (N.isURLSearchParams(r)) return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), r.toString(); let h; if (c) { if (s.indexOf("application/x-www-form-urlencoded") > -1) return Qo(r, this.formSerializer).toString(); if ((h = N.isFileList(r)) || s.indexOf("multipart/form-data") > -1) { const b = this.env && this.env.FormData; return kn( h ? { "files[]": r } : r, b && new b(), this.formSerializer ); } } return c || a ? (n.setContentType("application/json", !1), ta(r)) : r; }], transformResponse: [function(r) { const n = this.transitional || qt.transitional, s = n && n.forcedJSONParsing, a = this.responseType === "json"; if (N.isResponse(r) || N.isReadableStream(r)) return r; if (r && N.isString(r) && (s && !this.responseType || a)) { const d = !(n && n.silentJSONParsing) && a; try { return JSON.parse(r); } catch (h) { if (d) throw h.name === "SyntaxError" ? Y.from(h, Y.ERR_BAD_RESPONSE, this, null, this.response) : h; } } return r; }], /** * 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: Ae.classes.FormData, Blob: Ae.classes.Blob }, validateStatus: function(r) { return r >= 200 && r < 300; }, headers: { common: { Accept: "application/json, text/plain, */*", "Content-Type": void 0 } } }; N.forEach(["delete", "get", "head", "post", "put", "patch"], (o) => { qt.headers[o] = {}; }); const na = N.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" ]), ra = (o) => { const r = {}; let n, s, a; return o && o.split(` `).forEach(function(d) { a = d.indexOf(":"), n = d.substring(0, a).trim().toLowerCase(), s = d.substring(a + 1).trim(), !(!n || r[n] && na[n]) && (n === "set-cookie" ? r[n] ? r[n].push(s) : r[n] = [s] : r[n] = r[n] ? r[n] + ", " + s : s); }), r; }, _s = Symbol("internals"); function Ft(o) { return o && String(o).trim().toLowerCase(); } function Sn(o) { return o === !1 || o == null ? o : N.isArray(o) ? o.map(Sn) : String(o); } function sa(o) { const r = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; let s; for (; s = n.exec(o); ) r[s[1]] = s[2]; return r; } const ia = (o) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim()); function Sr(o, r, n, s, a) { if (N.isFunction(s)) return s.call(this, r, n); if (a && (r = n), !!N.isString(r)) { if (N.isString(s)) return r.indexOf(s) !== -1; if (N.isRegExp(s)) return s.test(r); } } function oa(o) { return o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (r, n, s) => n.toUpperCase() + s); } function aa(o, r) { const n = N.toCamelCase(" " + r); ["get", "set", "has"].forEach((s) => { Object.defineProperty(o, s + n, { value: function(a, c, d) { return this[s].call(this, r, a, c, d); }, configurable: !0 }); }); } let Pe = class { constructor(r) { r && this.set(r); } set(r, n, s) { const a = this; function c(h, b, y) { const P = Ft(b); if (!P) throw new Error("header name must be a non-empty string"); const D = N.findKey(a, P); (!D || a[D] === void 0 || y === !0 || y === void 0 && a[D] !== !1) && (a[D || b] = Sn(h)); } const d = (h, b) => N.forEach(h, (y, P) => c(y, P, b)); if (N.isPlainObject(r) || r instanceof this.constructor) d(r, n); else if (N.isString(r) && (r = r.trim()) && !ia(r)) d(ra(r), n); else if (N.isHeaders(r)) for (const [h, b] of r.entries()) c(b, h, s); else r != null && c(n, r, s); return this; } get(r, n) { if (r = Ft(r), r) { const s = N.findKey(this, r); if (s) { const a = this[s]; if (!n) return a; if (n === !0) return sa(a); if (N.isFunction(n)) return n.call(this, a, s); if (N.isRegExp(n)) return n.exec(a); throw new TypeError("parser must be boolean|regexp|function"); } } } has(r, n) { if (r = Ft(r), r) { const s = N.findKey(this, r); return !!(s && this[s] !== void 0 && (!n || Sr(this, this[s], s, n))); } return !1; } delete(r, n) { const s = this; let a = !1; function c(d) { if (d = Ft(d), d) { const h = N.findKey(s, d); h && (!n || Sr(s, s[h], h, n)) && (delete s[h], a = !0); } } return N.isArray(r) ? r.forEach(c) : c(r), a; } clear(r) { const n = Object.keys(this); let s = n.length, a = !1; for (; s--; ) { const c = n[s]; (!r || Sr(this, this[c], c, r, !0)) && (delete this[c], a = !0); } return a; } normalize(r) { const n = this, s = {}; return N.forEach(this, (a, c) => { const d = N.findKey(s, c); if (d) { n[d] = Sn(a), delete n[c]; return; } const h = r ? oa(c) : String(c).trim(); h !== c && delete n[c], n[h] = Sn(a), s[h] = !0; }), this; } concat(...r) { return this.constructor.concat(this, ...r); } toJSON(r) { const n = /* @__PURE__ */ Object.create(null); return N.forEach(this, (s, a) => { s != null && s !== !1 && (n[a] = r && N.isArray(s) ? s.join(", ") : s); }), n; } [Symbol.iterator]() { return Object.entries(this.toJSON())[Symbol.iterator](); } toString() { return Object.entries(this.toJSON()).map(([r, n]) => r + ": " + n).join(` `); } get [Symbol.toStringTag]() { return "AxiosHeaders"; } static from(r) { return r instanceof this ? r : new this(r); } static concat(r, ...n) { const s = new this(r); return n.forEach((a) => s.set(a)), s; } static accessor(r) { const s = (this[_s] = this[_s] = { accessors: {} }).accessors, a = this.prototype; function c(d) { const h = Ft(d); s[h] || (aa(a, d), s[h] = !0); } return N.isArray(r) ? r.forEach(c) : c(r), this; } }; Pe.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); N.reduceDescriptors(Pe.prototype, ({ value: o }, r) => { let n = r[0].toUpperCase() + r.slice(1); return { get: () => o, set(s) { this[n] = s; } }; }); N.freezeMethods(Pe); function Ar(o, r) { const n = this || qt, s = r || n, a = Pe.from(s.headers); let c = s.data; return N.forEach(o, function(h) { c = h.call(n, c, a.normalize(), r ? r.status : void 0); }), a.normalize(), c; } function Zs(o) { return !!(o && o.__CANCEL__); } function At(o, r, n) { Y.call(this, o ?? "canceled", Y.ERR_CANCELED, r, n), this.name = "CanceledError"; } N.inherits(At, Y, { __CANCEL__: !0 }); function ei(o, r, n) { const s = n.config.validateStatus; !n.status || !s || s(n.status) ? o(n) : r(new Y( "Request failed with status code " + n.status, [Y.ERR_BAD_REQUEST, Y.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4], n.config, n.request, n )); } function ca(o) { const r = /^([-+\w]{1,25})(:?\/\/|:)/.exec(o); return r && r[1] || ""; } function ua(o, r) { o = o || 10; const n = new Array(o), s = new Array(o); let a = 0, c = 0, d; return r = r !== void 0 ? r : 1e3, function(b) { const y = Date.now(), P = s[c]; d || (d = y), n[a] = b, s[a] = y; let D = c, B = 0; for (; D !== a; ) B += n[D++], D = D % o; if (a = (a + 1) % o, a === c && (c = (c + 1) % o), y - d < r) return; const $ = P && y - P; return $ ? Math.round(B * 1e3 / $) : void 0; }; } function la(o, r) { let n = 0, s = 1e3 / r, a, c; const d = (y, P = Date.now()) => { n = P, a = null, c && (clearTimeout(c), c = null), o.apply(null, y); }; return [(...y) => { const P = Date.now(), D = P - n; D >= s ? d(y, P) : (a = y, c || (c = setTimeout(() => { c = null, d(a); }, s - D))); }, () => a && d(a)]; } const En = (o, r, n = 3) => { let s = 0; const a = ua(50, 250); return la((c) => { const d = c.loaded, h = c.lengthComputable ? c.total : void 0, b = d - s, y = a(b), P = d <= h; s = d; const D = { loaded: d, total: h, progress: h ? d / h : void 0, bytes: b, rate: y || void 0, estimated: y && h && P ? (h - d) / y : void 0, event: c, lengthComputable: h != null, [r ? "download" : "upload"]: !0 }; o(D); }, n); }, Es = (o, r) => { const n = o != null; return [(s) => r[0]({ lengthComputable: n, total: o, loaded: s }), r[1]]; }, Ps = (o) => (...r) => N.asap(() => o(...r)), da = Ae.hasStandardBrowserEnv ? /* @__PURE__ */ ((o, r) => (n) => (n = new URL(n, Ae.origin), o.protocol === n.protocol && o.host === n.host && (r || o.port === n.port)))( new URL(Ae.origin), Ae.navigator && /(msie|trident)/i.test(Ae.navigator.userAgent) ) : () => !0, fa = Ae.hasStandardBrowserEnv ? ( // Standard browser envs support document.cookie { write(o, r, n, s, a, c) { const d = [o + "=" + encodeURIComponent(r)]; N.isNumber(n) && d.push("expires=" + new Date(n).toGMTString()), N.isString(s) && d.push("path=" + s), N.isString(a) && d.push("domain=" + a), c === !0 && d.push("secure"), document.cookie = d.join("; "); }, read(o) { const r = document.cookie.match(new RegExp("(^|;\\s*)(" + o + ")=([^;]*)")); return r ? decodeURIComponent(r[3]) : null; }, remove(o) { this.write(o, "", Date.now() - 864e5); } } ) : ( // Non-standard browser env (web workers, react-native) lack needed support. { write() { }, read() { return null; }, remove() { } } ); function ha(o) { return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(o); } function pa(o, r) { return r ? o.replace(/\/?\/$/, "") + "/" + r.replace(/^\/+/, "") : o; } function ti(o, r) { return o && !ha(r) ? pa(o, r) : r; } const xs = (o) => o instanceof Pe ? { ...o } : o; function ct(o, r) { r = r || {}; const n = {}; function s(y, P, D, B) { return N.isPlainObject(y) && N.isPlainObject(P) ? N.merge.call({ caseless: B }, y, P) : N.isPlainObject(P) ? N.merge({}, P) : N.isArray(P) ? P.slice() : P; } function a(y, P, D, B) { if (N.isUndefined(P)) { if (!N.isUndefined(y)) return s(void 0, y, D, B); } else return s(y, P, D, B); } function c(y, P) { if (!N.isUndefined(P)) return s(void 0, P); } function d(y, P) { if (N.isUndefined(P)) { if (!N.isUndefined(y)) return s(void 0, y); } else return s(void 0, P); } function h(y, P, D) { if (D in r) return s(y, P); if (D in o) return s(void 0, y); } const b = { url: c, method: c, data: c, baseURL: d, transformRequest: d, transformResponse: d, paramsSerializer: d, timeout: d, timeoutMessage: d, withCredentials: d, withXSRFToken: d, adapter: d, responseType: d, xsrfCookieName: d, xsrfHeaderName: d, onUploadProgress: d, onDownloadProgress: d, decompress: d, maxContentLength: d, maxBodyLength: d, beforeRedirect: d, transport: d, httpAgent: d, httpsAgent: d, cancelToken: d, socketPath: d, responseEncoding: d, validateStatus: h, headers: (y, P, D) => a(xs(y), xs(P), D, !0) }; return N.forEach(Object.keys(Object.assign({}, o, r)), function(P) { const D = b[P] || a, B = D(o[P], r[P], P); N.isUndefined(B) && D !== h || (n[P] = B); }), n; } const ni = (o) => { const r = ct({}, o); let { data: n, withXSRFToken: s, xsrfHeaderName: a, xsrfCookieName: c, headers: d, auth: h } = r; r.headers = d = Pe.from(d), r.url = Xs(ti(r.baseURL, r.url), o.params, o.paramsSerializer), h && d.set( "Authorization", "Basic " + btoa((h.username || "") + ":" + (h.password ? unescape(encodeURIComponent(h.password)) : "")) ); let b; if (N.isFormData(n)) { if (Ae.hasStandardBrowserEnv || Ae.hasStandardBrowserWebWorkerEnv) d.setContentType(void 0); else if ((b = d.getContentType()) !== !1) { const [y, ...P] = b ? b.split(";").map((D) => D.trim()).filter(Boolean) : []; d.setContentType([y || "multipart/form-data", ...P].join("; ")); } } if (Ae.hasStandardBrowserEnv && (s && N.isFunction(s) && (s = s(r)), s || s !== !1 && da(r.url))) { const y = a && c && fa.read(c); y && d.set(a, y); } return r; }, ma = typeof XMLHttpRequest < "u", ya = ma && function(o) { return new Promise(function(n, s) { const a = ni(o); let c = a.data; const d = Pe.from(a.headers).normalize(); let { responseType: h, onUploadProgress: b, onDownloadProgress: y } = a, P, D, B, $, M; function V() { $ && $(), M && M(), a.cancelToken && a.cancelToken.unsubscribe(P), a.signal && a.signal.removeEventListener("abort", P); } let U = new XMLHttpRequest(); U.open(a.method.toUpperCase(), a.url, !0), U.timeout = a.timeout; function te() { if (!U) return; const le = Pe.from( "getAllResponseHeaders" in U && U.getAllResponseHeaders() ), be = { data: !h || h === "text" || h === "json" ? U.responseText : U.response, status: U.status, statusText: U.statusText, headers: le, config: o, request: U }; ei(function(de) { n(de), V(); }, function(de) { s(de), V(); }, be), U = null; } "onloadend" in U ? U.onloadend = te : U.onreadystatechange = function() { !U || U.readyState !== 4 || U.status === 0 && !(U.responseURL && U.responseURL.indexOf("file:") === 0) || setTimeout(te); }, U.onabort = function() { U && (s(new Y("Request aborted", Y.ECONNABORTED, o, U)), U = null); }, U.onerror = function() { s(new Y("Network Error", Y.ERR_NETWORK, o, U)), U = null; }, U.ontimeout = function() { let _e = a.timeout ? "timeout of " + a.timeout + "ms exceeded" : "timeout exceeded"; const be = a.transitional || Ys; a.timeoutErrorMessage && (_e = a.timeoutErrorMessage), s(new Y( _e, be.clarifyTimeoutError ? Y.ETIMEDOUT : Y.ECONNABORTED, o, U )), U = null; }, c === void 0 && d.setContentType(null), "setRequestHeader" in U && N.forEach(d.toJSON(), function(_e, be) { U.setRequestHeader(be, _e); }), N.isUndefined(a.withCredentials) || (U.withCredentials = !!a.withCredentials), h && h !== "json" && (U.responseType = a.responseType), y && ([B, M] = En(y, !0), U.addEventListener("progress", B)), b && U.upload && ([D, $] = En(b), U.upload.addEventListener("progress", D), U.upload.addEventListener("loadend", $)), (a.cancelToken || a.signal) && (P = (le) => { U && (s(!le || le.type ? new At(null, o, U) : le), U.abort(), U = null); }, a.cancelToken && a.cancelToken.subscribe(P), a.signal && (a.signal.aborted ? P() : a.signal.addEventListener("abort", P))); const ae = ca(a.url); if (ae && Ae.protocols.indexOf(ae) === -1) { s(new Y("Unsupported protocol " + ae + ":", Y.ERR_BAD_REQUEST, o)); return; } U.send(c || null); }); }, ga = (o, r) => { const { length: n } = o = o ? o.filter(Boolean) : []; if (r || n) { let s = new AbortController(), a; const c = function(y) { if (!a) { a = !0, h(); const P = y instanceof Error ? y : this.reason; s.abort(P instanceof Y ? P : new At(P instanceof Error ? P.message : P)); } }; let d = r && setTimeout(() => { d = null, c(new Y(`timeout ${r} of ms exceeded`, Y.ETIMEDOUT)); }, r); const h = () => { o && (d && clearTimeout(d), d = null, o.forEach((y) => { y.unsubscribe ? y.unsubscribe(c) : y.removeEventListener("abort", c); }), o = null); }; o.forEach((y) => y.addEventListener("abort", c)); const { signal: b } = s; return b.unsubscribe = () => N.asap(h), b; } }, ba = function* (o, r) { let n = o.byteLength; if (n < r) { yield o; return; } let s = 0, a; for (; s < n; ) a = s + r, yield o.slice(s, a), s = a; }, va = async function* (o, r) { for await (const n of wa(o)) yield* ba(n, r); }, wa = async function* (o) { if (o[Symbol.asyncIterator]) { yield* o; return; } const r = o.getReader(); try { for (; ; ) { const { done: n, value: s } = await r.read(); if (n) break; yield s; } } finally { await r.cancel(); } }, Cs = (o, r, n, s) => { const a = va(o, r); let c = 0, d, h = (b) => { d || (d = !0, s && s(b)); }; return new ReadableStream({ async pull(b) { try { const { done: y, value: P } = await a.next(); if (y) { h(), b.close(); return; } let D = P.byteLength; if (n) { let B = c += D; n(B); } b.enqueue(new Uint8Array(P)); } catch (y) { throw h(y), y; } }, cancel(b) { return h(b), a.return(); } }, { highWaterMark: 2 }); }, On = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", ri = On && typeof ReadableStream == "function", Sa = On && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((o) => (r) => o.encode(r))(new TextEncoder()) : async (o) => new Uint8Array(await new Response(o).arrayBuffer())), si = (o, ...r) => { try { return !!o(...r); } catch { return !1; } }, Aa = ri && si(() => { let o = !1; const r = new Request(Ae.origin, { body: new ReadableStream(), method: "POST", get duplex() { return o = !0, "half"; } }).headers.has("Content-Type"); return o && !r; }), Is = 64 * 1024, Ir = ri && si(() => N.isReadableStream(new Response("").body)), Pn = { stream: Ir && ((o) => o.body) }; On && ((o) => { ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((r) => { !Pn[r] && (Pn[r] = N.isFunction(o[r]) ? (n) => n[r]() : (n, s) => { throw new Y(`Response type '${r}' is not supported`, Y.ERR_NOT_SUPPORT, s); }); }); })(new Response()); const _a = async (o) => { if (o == null) return 0; if (N.isBlob(o)) return o.size; if (N.isSpecCompliantForm(o)) return (await new Request(Ae.origin, { method: "POST", body: o }).arrayBuffer()).byteLength; if (N.isArrayBufferView(o) || N.isArrayBuffer(o)) return o.byteLength; if (N.isURLSearchParams(o) && (o = o + ""), N.isString(o)) return (await Sa(o)).byteLength; }, Ea = async (o, r) => { const n = N.toFiniteNumber(o.getContentLength()); return n ?? _a(r); }, Pa = On && (async (o) => { let { url: r, method: n, data: s, signal: a, cancelToken: c, timeout: d, onDownloadProgress: h, onUploadProgress: b, responseType: y, headers: P, withCredentials: D = "same-origin", fetchOptions: B } = ni(o); y = y ? (y + "").toLowerCase() : "text"; let $ = ga([a, c && c.toAbortSignal()], d), M; const V = $ && $.unsubscribe && (() => { $.unsubscribe(); }); let U; try { if (b && Aa && n !== "get" && n !== "head" && (U = await Ea(P, s)) !== 0) { let be = new Request(r, { method: "POST", body: s, duplex: "half" }), me; if (N.isFormData(s) && (me = be.headers.get("content-type")) && P.setContentType(me), be.body) { const [de, Je] = Es( U, En(Ps(b)) ); s = Cs(be.body, Is, de, Je); } } N.isString(D) || (D = D ? "include" : "omit"); const te = "credentials" in Request.prototype; M = new Request(r, { ...B, signal: $, method: n.toUpperCase(), headers: P.normalize().toJSON(), body: s, duplex: "half", credentials: te ? D : void 0 }); let ae = await fetch(M); const le = Ir && (y === "stream" || y === "response"); if (Ir && (h || le && V)) { const be = {}; ["status", "statusText", "headers"].forEach((Ht) => { be[Ht] = ae[Ht]; }); const me = N.toFiniteNumber(ae.headers.get("content-length")), [de, Je] = h && Es( me, En(Ps(h), !0) ) || []; ae = new Response( Cs(ae.body, Is, de, () => { Je && Je(), V && V(); }), be ); } y = y || "text"; let _e = await Pn[N.findKey(Pn, y) || "text"](ae, o); return !le && V && V(), await new Promise((be, me) => { ei(be, me, { data: _e, headers: Pe.from(ae.headers), status: ae.status, statusText: ae.statusText, config: o, request: M }); }); } catch (te) { throw V && V(), te && te.name === "TypeError" && /fetch/i.test(te.message) ? Object.assign( new Y("Network Error", Y.ERR_NETWORK, o, M), { cause: te.cause || te } ) : Y.from(te, te && te.code, o, M); } }), kr = { http: Go, xhr: ya, fetch: Pa }; N.forEach(kr, (o, r) => { if (o) { try { Object.defineProperty(o, "name", { value: r }); } catch { } Object.defineProperty(o, "adapterName", { value: r }); } }); const ks = (o) => `- ${o}`, xa = (o) => N.isFunction(o) || o === null || o === !1, ii = { getAdapter: (o) => { o = N.isArray(o) ? o : [o]; const { length: r } = o; let n, s; const a = {}; for (let c = 0; c < r; c++) { n = o[c]; let d; if (s = n, !xa(n) && (s = kr[(d = String(n)).toLowerCase()], s === void 0)) throw new Y(`Unknown adapter '${d}'`); if (s) break; a[d || "#" + c] = s; } if (!s) { const c = Object.entries(a).map( ([h, b]) => `adapter ${h} ` + (b === !1 ? "is not supported by the environment" : "is not available in the build") ); let d = r ? c.length > 1 ? `since : ` + c.map(ks).join(` `) : " " + ks(c[0]) : "as no adapter specified"; throw new Y( "There is no suitable adapter to dispatch the request " + d, "ERR_NOT_SUPPORT" ); } return s; }, adapters: kr }; function _r(o) { if (o.cancelToken && o.cancelToken.throwIfRequested(), o.signal && o.signal.aborted) throw new At(null, o); } function Os(o) { return _r(o), o.headers = Pe.from(o.headers), o.data = Ar.call( o, o.transformRequest ), ["post", "put", "patch"].indexOf(o.method) !== -1 && o.headers.setContentType("application/x-www-form-urlencoded", !1), ii.getAdapter(o.adapter || qt.adapter)(o).then(function(s) { return _r(o), s.data = Ar.call( o, o.transformResponse, s ), s.headers = Pe.from(s.headers), s; }, function(s) { return Zs(s) || (_r(o), s && s.response && (s.response.data = Ar.call( o, o.transformResponse, s.response ), s.response.headers = Pe.from(s.response.headers))), Promise.reject(s); }); } const oi = "1.7.9", Nn = {}; ["object", "boolean", "number", "function", "string", "symbol"].forEach((o, r) => { Nn[o] = function(s) { return typeof s === o || "a" + (r < 1 ? "n " : " ") + o; }; }); const Ns = {}; Nn.transitional = function(r, n, s) { function a(c, d) { return "[Axios v" + oi + "] Transitional option '" + c + "'" + d + (s ? ". " + s : ""); } return (c, d, h) => { if (r === !1) throw new Y( a(d, " has been removed" + (n ? " in " + n : "")), Y.ERR_DEPRECATED ); return n && !Ns[d] && (Ns[d] = !0, console.warn( a( d, " has been deprecated since v" + n + " and will be removed in the near future" ) )), r ? r(c, d, h) : !0; }; }; Nn.spelling = function(r) { return (n, s) => (console.warn(`${s} is likely a misspelling of ${r}`), !0); }; function Ca(o, r, n) { if (typeof o != "object") throw new Y("options must be an object", Y.ERR_BAD_OPTION_VALUE); const s = Object.keys(o); let a = s.length; for (; a-- > 0; ) { const c = s[a], d = r[c]; if (d) { const h = o[c], b = h === void 0 || d(h, c, o); if (b !== !0) throw new Y("option " + c + " must be " + b, Y.ERR_BAD_OPTION_VALUE); continue; } if (n !== !0) throw new Y("Unknown option " + c, Y.ERR_BAD_OPTION); } } const An = { assertOptions: Ca, validators: Nn }, Re = An.validators; let at = class { constructor(r) { this.defaults = r, this.interceptors = { request: new As(), response: new As() }; } /** * 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(r, n) { try { return await this._request(r, n); } catch (s) { if (s instanceof Error) { let a = {}; Error.captureStackTrace ? Error.captureStackTrace(a) : a = new Error(); const c = a.stack ? a.stack.replace(/^.+\n/, "") : ""; try { s.stack ? c && !String(s.stack).endsWith(c.replace(/^.+\n.+\n/, "")) && (s.stack += ` ` + c) : s.stack = c; } catch { } } throw s; } } _request(r, n) { typeof r == "string" ? (n = n || {}, n.url = r) : n = r || {}, n = ct(this.defaults, n); const { transitional: s, paramsSerializer: a, headers: c } = n; s !== void 0 && An.assertOptions(s, { silentJSONParsing: Re.transitional(Re.boolean), forcedJSONParsing: Re.transitional(Re.boolean), clarifyTimeoutError: Re.transitional(Re.boolean) }, !1), a != null && (N.isFunction(a) ? n.paramsSerializer = { serialize: a } : An.assertOptions(a, { encode: Re.function, serialize: Re.function }, !0)), An.assertOptions(n, { baseUrl: Re.spelling("baseURL"), withXsrfToken: Re.spelling("withXSRFToken") }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase(); let d = c && N.merge( c.common, c[n.method] ); c && N.forEach( ["delete", "get", "head", "post", "put", "patch", "common"], (M) => { delete c[M]; } ), n.headers = Pe.concat(d, c); const h = []; let b = !0; this.interceptors.request.forEach(function(V) { typeof V.runWhen == "function" && V.runWhen(n) === !1 || (b = b && V.synchronous, h.unshift(V.fulfilled, V.rejected)); }); const y = []; this.interceptors.response.forEach(function(V) { y.push(V.fulfilled, V.rejected); }); let P, D = 0, B; if (!b) { const M = [Os.bind(this), void 0]; for (M.unshift.apply(M, h), M.push.apply(M, y), B = M.length, P = Promise.resolve(n); D < B; ) P = P.then(M[D++], M[D++]); return P; } B = h.length; let $ = n; for (D = 0; D < B; ) { const M = h[D++], V = h[D++]; try { $ = M($); } catch (U) { V.call(this, U); break; } } try { P = Os.call(this, $); } catch (M) { return Promise.reject(M); } for (D = 0, B = y.length; D < B; ) P = P.then(y[D++], y[D++]); return P; } getUri(r) { r = ct(this.defaults, r); const n = ti(r.baseURL, r.url); return Xs(n, r.params, r.paramsSerializer); } }; N.forEach(["delete", "get", "head", "options"], function(r) { at.prototype[r] = function(n, s) { return this.request(ct(s || {}, { method: r, url: n, data: (s || {}).data })); }; }); N.forEach(["post", "put", "patch"], function(r) { function n(s) { return function(c, d, h) { return this.request(ct(h || {}, { method: r, headers: s ? { "Content-Type": "multipart/form-data" } : {}, url: c, data: d })); }; } at.prototype[r] = n(), at.prototype[r + "Form"] = n(!0); }); let Ia = class ai { constructor(r) { if (typeof r != "function") throw new TypeError("executor must be a function."); let n; this.promise = new Promise(function(c) { n = c; }); const s = this; this.promise.then((a) => { if (!s._listeners) return; let c = s._listeners.length; for (; c-- > 0; ) s._listeners[c](a); s._listeners = null; }), this.promise.then = (a) => { let c; const d = new Promise((h) => { s.subscribe(h), c = h; }).then(a); return d.cancel = function() { s.unsubscribe(c); }, d; }, r(function(c, d, h) { s.reason || (s.reason = new At(c, d, h), n(s.reason)); }); } /** * Throws a `CanceledError` if cancellation has been requested. */ throwIfRequest