eth-graph-query 2.0.20 → 2.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -6
- package/dist/index.d.ts +324 -3
- package/dist/index.js +109 -1873
- package/package.json +8 -8
- package/dist/api-query.d.ts +0 -67
- package/dist/eth-graph-query.d.ts +0 -41
- package/dist/query-builder.d.ts +0 -56
- package/dist/type.d.ts +0 -149
package/dist/index.js
CHANGED
|
@@ -1,1776 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import y from "axios";
|
|
2
|
+
const p = { Accept: "application/json", "Content-Type": "application/json" };
|
|
3
|
+
function f(a) {
|
|
4
|
+
return a.data;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
const n = mt.call(e);
|
|
8
|
-
return t[n] || (t[n] = n.slice(8, -1).toLowerCase());
|
|
9
|
-
})(/* @__PURE__ */ Object.create(null)), F = (t) => (t = t.toLowerCase(), (e) => oe(e) === t), ie = (t) => (e) => typeof e === t, { isArray: I } = Array, M = ie("undefined");
|
|
10
|
-
function z(t) {
|
|
11
|
-
return t !== null && !M(t) && t.constructor !== null && !M(t.constructor) && A(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
12
|
-
}
|
|
13
|
-
const Ve = F("ArrayBuffer");
|
|
14
|
-
function yt(t) {
|
|
15
|
-
let e;
|
|
16
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && Ve(t.buffer), e;
|
|
17
|
-
}
|
|
18
|
-
const bt = ie("string"), A = ie("function"), ve = ie("number"), V = (t) => t !== null && typeof t == "object", wt = (t) => t === !0 || t === !1, ee = (t) => {
|
|
19
|
-
if (oe(t) !== "object")
|
|
20
|
-
return !1;
|
|
21
|
-
const e = we(t);
|
|
22
|
-
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(ze in t) && !(se in t);
|
|
23
|
-
}, gt = (t) => {
|
|
24
|
-
if (!V(t) || z(t))
|
|
25
|
-
return !1;
|
|
26
|
-
try {
|
|
27
|
-
return Object.keys(t).length === 0 && Object.getPrototypeOf(t) === Object.prototype;
|
|
28
|
-
} catch {
|
|
29
|
-
return !1;
|
|
30
|
-
}
|
|
31
|
-
}, Et = F("Date"), St = F("File"), Rt = F("Blob"), Ot = F("FileList"), At = (t) => V(t) && A(t.pipe), Tt = (t) => {
|
|
32
|
-
let e;
|
|
33
|
-
return t && (typeof FormData == "function" && t instanceof FormData || A(t.append) && ((e = oe(t)) === "formdata" || // detect form-data instance
|
|
34
|
-
e === "object" && A(t.toString) && t.toString() === "[object FormData]"));
|
|
35
|
-
}, xt = F("URLSearchParams"), [_t, Ct, Ft, Nt] = ["ReadableStream", "Request", "Response", "Headers"].map(F), kt = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
36
|
-
function v(t, e, { allOwnKeys: n = !1 } = {}) {
|
|
37
|
-
if (t === null || typeof t > "u")
|
|
38
|
-
return;
|
|
39
|
-
let r, s;
|
|
40
|
-
if (typeof t != "object" && (t = [t]), I(t))
|
|
41
|
-
for (r = 0, s = t.length; r < s; r++)
|
|
42
|
-
e.call(null, t[r], r, t);
|
|
43
|
-
else {
|
|
44
|
-
if (z(t))
|
|
45
|
-
return;
|
|
46
|
-
const o = n ? Object.getOwnPropertyNames(t) : Object.keys(t), i = o.length;
|
|
47
|
-
let c;
|
|
48
|
-
for (r = 0; r < i; r++)
|
|
49
|
-
c = o[r], e.call(null, t[c], c, t);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function We(t, e) {
|
|
53
|
-
if (z(t))
|
|
54
|
-
return null;
|
|
55
|
-
e = e.toLowerCase();
|
|
56
|
-
const n = Object.keys(t);
|
|
57
|
-
let r = n.length, s;
|
|
58
|
-
for (; r-- > 0; )
|
|
59
|
-
if (s = n[r], e === s.toLowerCase())
|
|
60
|
-
return s;
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
const j = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Ke = (t) => !M(t) && t !== j;
|
|
64
|
-
function pe() {
|
|
65
|
-
const { caseless: t, skipUndefined: e } = Ke(this) && this || {}, n = {}, r = (s, o) => {
|
|
66
|
-
const i = t && We(n, o) || o;
|
|
67
|
-
ee(n[i]) && ee(s) ? n[i] = pe(n[i], s) : ee(s) ? n[i] = pe({}, s) : I(s) ? n[i] = s.slice() : (!e || !M(s)) && (n[i] = s);
|
|
68
|
-
};
|
|
69
|
-
for (let s = 0, o = arguments.length; s < o; s++)
|
|
70
|
-
arguments[s] && v(arguments[s], r);
|
|
71
|
-
return n;
|
|
72
|
-
}
|
|
73
|
-
const Pt = (t, e, n, { allOwnKeys: r } = {}) => (v(e, (s, o) => {
|
|
74
|
-
n && A(s) ? t[o] = Je(s, n) : t[o] = s;
|
|
75
|
-
}, { allOwnKeys: r }), t), Ut = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Lt = (t, e, n, r) => {
|
|
76
|
-
t.prototype = Object.create(e.prototype, r), t.prototype.constructor = t, Object.defineProperty(t, "super", {
|
|
77
|
-
value: e.prototype
|
|
78
|
-
}), n && Object.assign(t.prototype, n);
|
|
79
|
-
}, $t = (t, e, n, r) => {
|
|
80
|
-
let s, o, i;
|
|
81
|
-
const c = {};
|
|
82
|
-
if (e = e || {}, t == null) return e;
|
|
83
|
-
do {
|
|
84
|
-
for (s = Object.getOwnPropertyNames(t), o = s.length; o-- > 0; )
|
|
85
|
-
i = s[o], (!r || r(i, t, e)) && !c[i] && (e[i] = t[i], c[i] = !0);
|
|
86
|
-
t = n !== !1 && we(t);
|
|
87
|
-
} while (t && (!n || n(t, e)) && t !== Object.prototype);
|
|
88
|
-
return e;
|
|
89
|
-
}, jt = (t, e, n) => {
|
|
90
|
-
t = String(t), (n === void 0 || n > t.length) && (n = t.length), n -= e.length;
|
|
91
|
-
const r = t.indexOf(e, n);
|
|
92
|
-
return r !== -1 && r === n;
|
|
93
|
-
}, Bt = (t) => {
|
|
94
|
-
if (!t) return null;
|
|
95
|
-
if (I(t)) return t;
|
|
96
|
-
let e = t.length;
|
|
97
|
-
if (!ve(e)) return null;
|
|
98
|
-
const n = new Array(e);
|
|
99
|
-
for (; e-- > 0; )
|
|
100
|
-
n[e] = t[e];
|
|
101
|
-
return n;
|
|
102
|
-
}, Dt = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && we(Uint8Array)), qt = (t, e) => {
|
|
103
|
-
const r = (t && t[se]).call(t);
|
|
104
|
-
let s;
|
|
105
|
-
for (; (s = r.next()) && !s.done; ) {
|
|
106
|
-
const o = s.value;
|
|
107
|
-
e.call(t, o[0], o[1]);
|
|
108
|
-
}
|
|
109
|
-
}, Mt = (t, e) => {
|
|
110
|
-
let n;
|
|
111
|
-
const r = [];
|
|
112
|
-
for (; (n = t.exec(e)) !== null; )
|
|
113
|
-
r.push(n);
|
|
114
|
-
return r;
|
|
115
|
-
}, It = F("HTMLFormElement"), Ht = (t) => t.toLowerCase().replace(
|
|
116
|
-
/[-_\s]([a-z\d])(\w*)/g,
|
|
117
|
-
function(n, r, s) {
|
|
118
|
-
return r.toUpperCase() + s;
|
|
119
|
-
}
|
|
120
|
-
), Ce = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype), Qt = F("RegExp"), Xe = (t, e) => {
|
|
121
|
-
const n = Object.getOwnPropertyDescriptors(t), r = {};
|
|
122
|
-
v(n, (s, o) => {
|
|
123
|
-
let i;
|
|
124
|
-
(i = e(s, o, t)) !== !1 && (r[o] = i || s);
|
|
125
|
-
}), Object.defineProperties(t, r);
|
|
126
|
-
}, Jt = (t) => {
|
|
127
|
-
Xe(t, (e, n) => {
|
|
128
|
-
if (A(t) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
129
|
-
return !1;
|
|
130
|
-
const r = t[n];
|
|
131
|
-
if (A(r)) {
|
|
132
|
-
if (e.enumerable = !1, "writable" in e) {
|
|
133
|
-
e.writable = !1;
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
e.set || (e.set = () => {
|
|
137
|
-
throw Error("Can not rewrite read-only method '" + n + "'");
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
}, zt = (t, e) => {
|
|
142
|
-
const n = {}, r = (s) => {
|
|
143
|
-
s.forEach((o) => {
|
|
144
|
-
n[o] = !0;
|
|
145
|
-
});
|
|
146
|
-
};
|
|
147
|
-
return I(t) ? r(t) : r(String(t).split(e)), n;
|
|
148
|
-
}, Vt = () => {
|
|
149
|
-
}, vt = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
|
|
150
|
-
function Wt(t) {
|
|
151
|
-
return !!(t && A(t.append) && t[ze] === "FormData" && t[se]);
|
|
152
|
-
}
|
|
153
|
-
const Kt = (t) => {
|
|
154
|
-
const e = new Array(10), n = (r, s) => {
|
|
155
|
-
if (V(r)) {
|
|
156
|
-
if (e.indexOf(r) >= 0)
|
|
157
|
-
return;
|
|
158
|
-
if (z(r))
|
|
159
|
-
return r;
|
|
160
|
-
if (!("toJSON" in r)) {
|
|
161
|
-
e[s] = r;
|
|
162
|
-
const o = I(r) ? [] : {};
|
|
163
|
-
return v(r, (i, c) => {
|
|
164
|
-
const d = n(i, s + 1);
|
|
165
|
-
!M(d) && (o[c] = d);
|
|
166
|
-
}), e[s] = void 0, o;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
return r;
|
|
170
|
-
};
|
|
171
|
-
return n(t, 0);
|
|
172
|
-
}, Xt = F("AsyncFunction"), Gt = (t) => t && (V(t) || A(t)) && A(t.then) && A(t.catch), Ge = ((t, e) => t ? setImmediate : e ? ((n, r) => (j.addEventListener("message", ({ source: s, data: o }) => {
|
|
173
|
-
s === j && o === n && r.length && r.shift()();
|
|
174
|
-
}, !1), (s) => {
|
|
175
|
-
r.push(s), j.postMessage(n, "*");
|
|
176
|
-
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
177
|
-
typeof setImmediate == "function",
|
|
178
|
-
A(j.postMessage)
|
|
179
|
-
), Zt = typeof queueMicrotask < "u" ? queueMicrotask.bind(j) : typeof process < "u" && process.nextTick || Ge, Yt = (t) => t != null && A(t[se]), a = {
|
|
180
|
-
isArray: I,
|
|
181
|
-
isArrayBuffer: Ve,
|
|
182
|
-
isBuffer: z,
|
|
183
|
-
isFormData: Tt,
|
|
184
|
-
isArrayBufferView: yt,
|
|
185
|
-
isString: bt,
|
|
186
|
-
isNumber: ve,
|
|
187
|
-
isBoolean: wt,
|
|
188
|
-
isObject: V,
|
|
189
|
-
isPlainObject: ee,
|
|
190
|
-
isEmptyObject: gt,
|
|
191
|
-
isReadableStream: _t,
|
|
192
|
-
isRequest: Ct,
|
|
193
|
-
isResponse: Ft,
|
|
194
|
-
isHeaders: Nt,
|
|
195
|
-
isUndefined: M,
|
|
196
|
-
isDate: Et,
|
|
197
|
-
isFile: St,
|
|
198
|
-
isBlob: Rt,
|
|
199
|
-
isRegExp: Qt,
|
|
200
|
-
isFunction: A,
|
|
201
|
-
isStream: At,
|
|
202
|
-
isURLSearchParams: xt,
|
|
203
|
-
isTypedArray: Dt,
|
|
204
|
-
isFileList: Ot,
|
|
205
|
-
forEach: v,
|
|
206
|
-
merge: pe,
|
|
207
|
-
extend: Pt,
|
|
208
|
-
trim: kt,
|
|
209
|
-
stripBOM: Ut,
|
|
210
|
-
inherits: Lt,
|
|
211
|
-
toFlatObject: $t,
|
|
212
|
-
kindOf: oe,
|
|
213
|
-
kindOfTest: F,
|
|
214
|
-
endsWith: jt,
|
|
215
|
-
toArray: Bt,
|
|
216
|
-
forEachEntry: qt,
|
|
217
|
-
matchAll: Mt,
|
|
218
|
-
isHTMLForm: It,
|
|
219
|
-
hasOwnProperty: Ce,
|
|
220
|
-
hasOwnProp: Ce,
|
|
221
|
-
// an alias to avoid ESLint no-prototype-builtins detection
|
|
222
|
-
reduceDescriptors: Xe,
|
|
223
|
-
freezeMethods: Jt,
|
|
224
|
-
toObjectSet: zt,
|
|
225
|
-
toCamelCase: Ht,
|
|
226
|
-
noop: Vt,
|
|
227
|
-
toFiniteNumber: vt,
|
|
228
|
-
findKey: We,
|
|
229
|
-
global: j,
|
|
230
|
-
isContextDefined: Ke,
|
|
231
|
-
isSpecCompliantForm: Wt,
|
|
232
|
-
toJSONObject: Kt,
|
|
233
|
-
isAsyncFn: Xt,
|
|
234
|
-
isThenable: Gt,
|
|
235
|
-
setImmediate: Ge,
|
|
236
|
-
asap: Zt,
|
|
237
|
-
isIterable: Yt
|
|
238
|
-
};
|
|
239
|
-
function y(t, e, n, r, s) {
|
|
240
|
-
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), n && (this.config = n), r && (this.request = r), s && (this.response = s, this.status = s.status ? s.status : null);
|
|
241
|
-
}
|
|
242
|
-
a.inherits(y, Error, {
|
|
243
|
-
toJSON: function() {
|
|
244
|
-
return {
|
|
245
|
-
// Standard
|
|
246
|
-
message: this.message,
|
|
247
|
-
name: this.name,
|
|
248
|
-
// Microsoft
|
|
249
|
-
description: this.description,
|
|
250
|
-
number: this.number,
|
|
251
|
-
// Mozilla
|
|
252
|
-
fileName: this.fileName,
|
|
253
|
-
lineNumber: this.lineNumber,
|
|
254
|
-
columnNumber: this.columnNumber,
|
|
255
|
-
stack: this.stack,
|
|
256
|
-
// Axios
|
|
257
|
-
config: a.toJSONObject(this.config),
|
|
258
|
-
code: this.code,
|
|
259
|
-
status: this.status
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
const Ze = y.prototype, Ye = {};
|
|
264
|
-
[
|
|
265
|
-
"ERR_BAD_OPTION_VALUE",
|
|
266
|
-
"ERR_BAD_OPTION",
|
|
267
|
-
"ECONNABORTED",
|
|
268
|
-
"ETIMEDOUT",
|
|
269
|
-
"ERR_NETWORK",
|
|
270
|
-
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
271
|
-
"ERR_DEPRECATED",
|
|
272
|
-
"ERR_BAD_RESPONSE",
|
|
273
|
-
"ERR_BAD_REQUEST",
|
|
274
|
-
"ERR_CANCELED",
|
|
275
|
-
"ERR_NOT_SUPPORT",
|
|
276
|
-
"ERR_INVALID_URL"
|
|
277
|
-
// eslint-disable-next-line func-names
|
|
278
|
-
].forEach((t) => {
|
|
279
|
-
Ye[t] = { value: t };
|
|
280
|
-
});
|
|
281
|
-
Object.defineProperties(y, Ye);
|
|
282
|
-
Object.defineProperty(Ze, "isAxiosError", { value: !0 });
|
|
283
|
-
y.from = (t, e, n, r, s, o) => {
|
|
284
|
-
const i = Object.create(Ze);
|
|
285
|
-
a.toFlatObject(t, i, function(l) {
|
|
286
|
-
return l !== Error.prototype;
|
|
287
|
-
}, (u) => u !== "isAxiosError");
|
|
288
|
-
const c = t && t.message ? t.message : "Error", d = e == null && t ? t.code : e;
|
|
289
|
-
return y.call(i, c, d, n, r, s), t && i.cause == null && Object.defineProperty(i, "cause", { value: t, configurable: !0 }), i.name = t && t.name || "Error", o && Object.assign(i, o), i;
|
|
290
|
-
};
|
|
291
|
-
const en = null;
|
|
292
|
-
function me(t) {
|
|
293
|
-
return a.isPlainObject(t) || a.isArray(t);
|
|
294
|
-
}
|
|
295
|
-
function et(t) {
|
|
296
|
-
return a.endsWith(t, "[]") ? t.slice(0, -2) : t;
|
|
297
|
-
}
|
|
298
|
-
function Fe(t, e, n) {
|
|
299
|
-
return t ? t.concat(e).map(function(s, o) {
|
|
300
|
-
return s = et(s), !n && o ? "[" + s + "]" : s;
|
|
301
|
-
}).join(n ? "." : "") : e;
|
|
302
|
-
}
|
|
303
|
-
function tn(t) {
|
|
304
|
-
return a.isArray(t) && !t.some(me);
|
|
305
|
-
}
|
|
306
|
-
const nn = a.toFlatObject(a, {}, null, function(e) {
|
|
307
|
-
return /^is[A-Z]/.test(e);
|
|
308
|
-
});
|
|
309
|
-
function ae(t, e, n) {
|
|
310
|
-
if (!a.isObject(t))
|
|
311
|
-
throw new TypeError("target must be an object");
|
|
312
|
-
e = e || new FormData(), n = a.toFlatObject(n, {
|
|
313
|
-
metaTokens: !0,
|
|
314
|
-
dots: !1,
|
|
315
|
-
indexes: !1
|
|
316
|
-
}, !1, function(m, h) {
|
|
317
|
-
return !a.isUndefined(h[m]);
|
|
318
|
-
});
|
|
319
|
-
const r = n.metaTokens, s = n.visitor || l, o = n.dots, i = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(e);
|
|
320
|
-
if (!a.isFunction(s))
|
|
321
|
-
throw new TypeError("visitor must be a function");
|
|
322
|
-
function u(f) {
|
|
323
|
-
if (f === null) return "";
|
|
324
|
-
if (a.isDate(f))
|
|
325
|
-
return f.toISOString();
|
|
326
|
-
if (a.isBoolean(f))
|
|
327
|
-
return f.toString();
|
|
328
|
-
if (!d && a.isBlob(f))
|
|
329
|
-
throw new y("Blob is not supported. Use a Buffer instead.");
|
|
330
|
-
return a.isArrayBuffer(f) || a.isTypedArray(f) ? d && typeof Blob == "function" ? new Blob([f]) : Buffer.from(f) : f;
|
|
331
|
-
}
|
|
332
|
-
function l(f, m, h) {
|
|
333
|
-
let g = f;
|
|
334
|
-
if (f && !h && typeof f == "object") {
|
|
335
|
-
if (a.endsWith(m, "{}"))
|
|
336
|
-
m = r ? m : m.slice(0, -2), f = JSON.stringify(f);
|
|
337
|
-
else if (a.isArray(f) && tn(f) || (a.isFileList(f) || a.endsWith(m, "[]")) && (g = a.toArray(f)))
|
|
338
|
-
return m = et(m), g.forEach(function(E, O) {
|
|
339
|
-
!(a.isUndefined(E) || E === null) && e.append(
|
|
340
|
-
// eslint-disable-next-line no-nested-ternary
|
|
341
|
-
i === !0 ? Fe([m], O, o) : i === null ? m : m + "[]",
|
|
342
|
-
u(E)
|
|
343
|
-
);
|
|
344
|
-
}), !1;
|
|
345
|
-
}
|
|
346
|
-
return me(f) ? !0 : (e.append(Fe(h, m, o), u(f)), !1);
|
|
347
|
-
}
|
|
348
|
-
const p = [], b = Object.assign(nn, {
|
|
349
|
-
defaultVisitor: l,
|
|
350
|
-
convertValue: u,
|
|
351
|
-
isVisitable: me
|
|
352
|
-
});
|
|
353
|
-
function S(f, m) {
|
|
354
|
-
if (!a.isUndefined(f)) {
|
|
355
|
-
if (p.indexOf(f) !== -1)
|
|
356
|
-
throw Error("Circular reference detected in " + m.join("."));
|
|
357
|
-
p.push(f), a.forEach(f, function(g, x) {
|
|
358
|
-
(!(a.isUndefined(g) || g === null) && s.call(
|
|
359
|
-
e,
|
|
360
|
-
g,
|
|
361
|
-
a.isString(x) ? x.trim() : x,
|
|
362
|
-
m,
|
|
363
|
-
b
|
|
364
|
-
)) === !0 && S(g, m ? m.concat(x) : [x]);
|
|
365
|
-
}), p.pop();
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
if (!a.isObject(t))
|
|
369
|
-
throw new TypeError("data must be an object");
|
|
370
|
-
return S(t), e;
|
|
371
|
-
}
|
|
372
|
-
function Ne(t) {
|
|
373
|
-
const e = {
|
|
374
|
-
"!": "%21",
|
|
375
|
-
"'": "%27",
|
|
376
|
-
"(": "%28",
|
|
377
|
-
")": "%29",
|
|
378
|
-
"~": "%7E",
|
|
379
|
-
"%20": "+",
|
|
380
|
-
"%00": "\0"
|
|
381
|
-
};
|
|
382
|
-
return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(r) {
|
|
383
|
-
return e[r];
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
function ge(t, e) {
|
|
387
|
-
this._pairs = [], t && ae(t, this, e);
|
|
388
|
-
}
|
|
389
|
-
const tt = ge.prototype;
|
|
390
|
-
tt.append = function(e, n) {
|
|
391
|
-
this._pairs.push([e, n]);
|
|
392
|
-
};
|
|
393
|
-
tt.toString = function(e) {
|
|
394
|
-
const n = e ? function(r) {
|
|
395
|
-
return e.call(this, r, Ne);
|
|
396
|
-
} : Ne;
|
|
397
|
-
return this._pairs.map(function(s) {
|
|
398
|
-
return n(s[0]) + "=" + n(s[1]);
|
|
399
|
-
}, "").join("&");
|
|
400
|
-
};
|
|
401
|
-
function rn(t) {
|
|
402
|
-
return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
403
|
-
}
|
|
404
|
-
function nt(t, e, n) {
|
|
405
|
-
if (!e)
|
|
406
|
-
return t;
|
|
407
|
-
const r = n && n.encode || rn;
|
|
408
|
-
a.isFunction(n) && (n = {
|
|
409
|
-
serialize: n
|
|
410
|
-
});
|
|
411
|
-
const s = n && n.serialize;
|
|
412
|
-
let o;
|
|
413
|
-
if (s ? o = s(e, n) : o = a.isURLSearchParams(e) ? e.toString() : new ge(e, n).toString(r), o) {
|
|
414
|
-
const i = t.indexOf("#");
|
|
415
|
-
i !== -1 && (t = t.slice(0, i)), t += (t.indexOf("?") === -1 ? "?" : "&") + o;
|
|
416
|
-
}
|
|
417
|
-
return t;
|
|
418
|
-
}
|
|
419
|
-
class ke {
|
|
420
|
-
constructor() {
|
|
421
|
-
this.handlers = [];
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Add a new interceptor to the stack
|
|
425
|
-
*
|
|
426
|
-
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
427
|
-
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
428
|
-
*
|
|
429
|
-
* @return {Number} An ID used to remove interceptor later
|
|
430
|
-
*/
|
|
431
|
-
use(e, n, r) {
|
|
432
|
-
return this.handlers.push({
|
|
433
|
-
fulfilled: e,
|
|
434
|
-
rejected: n,
|
|
435
|
-
synchronous: r ? r.synchronous : !1,
|
|
436
|
-
runWhen: r ? r.runWhen : null
|
|
437
|
-
}), this.handlers.length - 1;
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* Remove an interceptor from the stack
|
|
441
|
-
*
|
|
442
|
-
* @param {Number} id The ID that was returned by `use`
|
|
443
|
-
*
|
|
444
|
-
* @returns {void}
|
|
445
|
-
*/
|
|
446
|
-
eject(e) {
|
|
447
|
-
this.handlers[e] && (this.handlers[e] = null);
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* Clear all interceptors from the stack
|
|
451
|
-
*
|
|
452
|
-
* @returns {void}
|
|
453
|
-
*/
|
|
454
|
-
clear() {
|
|
455
|
-
this.handlers && (this.handlers = []);
|
|
456
|
-
}
|
|
457
|
-
/**
|
|
458
|
-
* Iterate over all the registered interceptors
|
|
459
|
-
*
|
|
460
|
-
* This method is particularly useful for skipping over any
|
|
461
|
-
* interceptors that may have become `null` calling `eject`.
|
|
462
|
-
*
|
|
463
|
-
* @param {Function} fn The function to call for each interceptor
|
|
464
|
-
*
|
|
465
|
-
* @returns {void}
|
|
466
|
-
*/
|
|
467
|
-
forEach(e) {
|
|
468
|
-
a.forEach(this.handlers, function(r) {
|
|
469
|
-
r !== null && e(r);
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
const rt = {
|
|
474
|
-
silentJSONParsing: !0,
|
|
475
|
-
forcedJSONParsing: !0,
|
|
476
|
-
clarifyTimeoutError: !1
|
|
477
|
-
}, sn = typeof URLSearchParams < "u" ? URLSearchParams : ge, on = typeof FormData < "u" ? FormData : null, an = typeof Blob < "u" ? Blob : null, cn = {
|
|
478
|
-
isBrowser: !0,
|
|
479
|
-
classes: {
|
|
480
|
-
URLSearchParams: sn,
|
|
481
|
-
FormData: on,
|
|
482
|
-
Blob: an
|
|
483
|
-
},
|
|
484
|
-
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
485
|
-
}, Ee = typeof window < "u" && typeof document < "u", ye = typeof navigator == "object" && navigator || void 0, ln = Ee && (!ye || ["ReactNative", "NativeScript", "NS"].indexOf(ye.product) < 0), un = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
486
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", fn = Ee && window.location.href || "http://localhost", dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
487
|
-
__proto__: null,
|
|
488
|
-
hasBrowserEnv: Ee,
|
|
489
|
-
hasStandardBrowserEnv: ln,
|
|
490
|
-
hasStandardBrowserWebWorkerEnv: un,
|
|
491
|
-
navigator: ye,
|
|
492
|
-
origin: fn
|
|
493
|
-
}, Symbol.toStringTag, { value: "Module" })), R = {
|
|
494
|
-
...dn,
|
|
495
|
-
...cn
|
|
496
|
-
};
|
|
497
|
-
function hn(t, e) {
|
|
498
|
-
return ae(t, new R.classes.URLSearchParams(), {
|
|
499
|
-
visitor: function(n, r, s, o) {
|
|
500
|
-
return R.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
501
|
-
},
|
|
502
|
-
...e
|
|
503
|
-
});
|
|
504
|
-
}
|
|
505
|
-
function pn(t) {
|
|
506
|
-
return a.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
507
|
-
}
|
|
508
|
-
function mn(t) {
|
|
509
|
-
const e = {}, n = Object.keys(t);
|
|
510
|
-
let r;
|
|
511
|
-
const s = n.length;
|
|
512
|
-
let o;
|
|
513
|
-
for (r = 0; r < s; r++)
|
|
514
|
-
o = n[r], e[o] = t[o];
|
|
515
|
-
return e;
|
|
516
|
-
}
|
|
517
|
-
function st(t) {
|
|
518
|
-
function e(n, r, s, o) {
|
|
519
|
-
let i = n[o++];
|
|
520
|
-
if (i === "__proto__") return !0;
|
|
521
|
-
const c = Number.isFinite(+i), d = o >= n.length;
|
|
522
|
-
return i = !i && a.isArray(s) ? s.length : i, d ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), e(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = mn(s[i])), !c);
|
|
523
|
-
}
|
|
524
|
-
if (a.isFormData(t) && a.isFunction(t.entries)) {
|
|
525
|
-
const n = {};
|
|
526
|
-
return a.forEachEntry(t, (r, s) => {
|
|
527
|
-
e(pn(r), s, n, 0);
|
|
528
|
-
}), n;
|
|
529
|
-
}
|
|
530
|
-
return null;
|
|
531
|
-
}
|
|
532
|
-
function yn(t, e, n) {
|
|
533
|
-
if (a.isString(t))
|
|
534
|
-
try {
|
|
535
|
-
return (e || JSON.parse)(t), a.trim(t);
|
|
536
|
-
} catch (r) {
|
|
537
|
-
if (r.name !== "SyntaxError")
|
|
538
|
-
throw r;
|
|
539
|
-
}
|
|
540
|
-
return (n || JSON.stringify)(t);
|
|
541
|
-
}
|
|
542
|
-
const W = {
|
|
543
|
-
transitional: rt,
|
|
544
|
-
adapter: ["xhr", "http", "fetch"],
|
|
545
|
-
transformRequest: [function(e, n) {
|
|
546
|
-
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = a.isObject(e);
|
|
547
|
-
if (o && a.isHTMLForm(e) && (e = new FormData(e)), a.isFormData(e))
|
|
548
|
-
return s ? JSON.stringify(st(e)) : e;
|
|
549
|
-
if (a.isArrayBuffer(e) || a.isBuffer(e) || a.isStream(e) || a.isFile(e) || a.isBlob(e) || a.isReadableStream(e))
|
|
550
|
-
return e;
|
|
551
|
-
if (a.isArrayBufferView(e))
|
|
552
|
-
return e.buffer;
|
|
553
|
-
if (a.isURLSearchParams(e))
|
|
554
|
-
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
|
|
555
|
-
let c;
|
|
556
|
-
if (o) {
|
|
557
|
-
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
558
|
-
return hn(e, this.formSerializer).toString();
|
|
559
|
-
if ((c = a.isFileList(e)) || r.indexOf("multipart/form-data") > -1) {
|
|
560
|
-
const d = this.env && this.env.FormData;
|
|
561
|
-
return ae(
|
|
562
|
-
c ? { "files[]": e } : e,
|
|
563
|
-
d && new d(),
|
|
564
|
-
this.formSerializer
|
|
565
|
-
);
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
return o || s ? (n.setContentType("application/json", !1), yn(e)) : e;
|
|
569
|
-
}],
|
|
570
|
-
transformResponse: [function(e) {
|
|
571
|
-
const n = this.transitional || W.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
|
|
572
|
-
if (a.isResponse(e) || a.isReadableStream(e))
|
|
573
|
-
return e;
|
|
574
|
-
if (e && a.isString(e) && (r && !this.responseType || s)) {
|
|
575
|
-
const i = !(n && n.silentJSONParsing) && s;
|
|
576
|
-
try {
|
|
577
|
-
return JSON.parse(e, this.parseReviver);
|
|
578
|
-
} catch (c) {
|
|
579
|
-
if (i)
|
|
580
|
-
throw c.name === "SyntaxError" ? y.from(c, y.ERR_BAD_RESPONSE, this, null, this.response) : c;
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
return e;
|
|
584
|
-
}],
|
|
585
|
-
/**
|
|
586
|
-
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
587
|
-
* timeout is not created.
|
|
588
|
-
*/
|
|
589
|
-
timeout: 0,
|
|
590
|
-
xsrfCookieName: "XSRF-TOKEN",
|
|
591
|
-
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
592
|
-
maxContentLength: -1,
|
|
593
|
-
maxBodyLength: -1,
|
|
594
|
-
env: {
|
|
595
|
-
FormData: R.classes.FormData,
|
|
596
|
-
Blob: R.classes.Blob
|
|
597
|
-
},
|
|
598
|
-
validateStatus: function(e) {
|
|
599
|
-
return e >= 200 && e < 300;
|
|
600
|
-
},
|
|
601
|
-
headers: {
|
|
602
|
-
common: {
|
|
603
|
-
Accept: "application/json, text/plain, */*",
|
|
604
|
-
"Content-Type": void 0
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
};
|
|
608
|
-
a.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
|
|
609
|
-
W.headers[t] = {};
|
|
610
|
-
});
|
|
611
|
-
const bn = a.toObjectSet([
|
|
612
|
-
"age",
|
|
613
|
-
"authorization",
|
|
614
|
-
"content-length",
|
|
615
|
-
"content-type",
|
|
616
|
-
"etag",
|
|
617
|
-
"expires",
|
|
618
|
-
"from",
|
|
619
|
-
"host",
|
|
620
|
-
"if-modified-since",
|
|
621
|
-
"if-unmodified-since",
|
|
622
|
-
"last-modified",
|
|
623
|
-
"location",
|
|
624
|
-
"max-forwards",
|
|
625
|
-
"proxy-authorization",
|
|
626
|
-
"referer",
|
|
627
|
-
"retry-after",
|
|
628
|
-
"user-agent"
|
|
629
|
-
]), wn = (t) => {
|
|
630
|
-
const e = {};
|
|
631
|
-
let n, r, s;
|
|
632
|
-
return t && t.split(`
|
|
633
|
-
`).forEach(function(i) {
|
|
634
|
-
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || e[n] && bn[n]) && (n === "set-cookie" ? e[n] ? e[n].push(r) : e[n] = [r] : e[n] = e[n] ? e[n] + ", " + r : r);
|
|
635
|
-
}), e;
|
|
636
|
-
}, Pe = /* @__PURE__ */ Symbol("internals");
|
|
637
|
-
function J(t) {
|
|
638
|
-
return t && String(t).trim().toLowerCase();
|
|
639
|
-
}
|
|
640
|
-
function te(t) {
|
|
641
|
-
return t === !1 || t == null ? t : a.isArray(t) ? t.map(te) : String(t);
|
|
642
|
-
}
|
|
643
|
-
function gn(t) {
|
|
644
|
-
const e = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
645
|
-
let r;
|
|
646
|
-
for (; r = n.exec(t); )
|
|
647
|
-
e[r[1]] = r[2];
|
|
648
|
-
return e;
|
|
649
|
-
}
|
|
650
|
-
const En = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
|
|
651
|
-
function fe(t, e, n, r, s) {
|
|
652
|
-
if (a.isFunction(r))
|
|
653
|
-
return r.call(this, e, n);
|
|
654
|
-
if (s && (e = n), !!a.isString(e)) {
|
|
655
|
-
if (a.isString(r))
|
|
656
|
-
return e.indexOf(r) !== -1;
|
|
657
|
-
if (a.isRegExp(r))
|
|
658
|
-
return r.test(e);
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
function Sn(t) {
|
|
662
|
-
return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, n, r) => n.toUpperCase() + r);
|
|
663
|
-
}
|
|
664
|
-
function Rn(t, e) {
|
|
665
|
-
const n = a.toCamelCase(" " + e);
|
|
666
|
-
["get", "set", "has"].forEach((r) => {
|
|
667
|
-
Object.defineProperty(t, r + n, {
|
|
668
|
-
value: function(s, o, i) {
|
|
669
|
-
return this[r].call(this, e, s, o, i);
|
|
670
|
-
},
|
|
671
|
-
configurable: !0
|
|
672
|
-
});
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
let T = class {
|
|
676
|
-
constructor(e) {
|
|
677
|
-
e && this.set(e);
|
|
678
|
-
}
|
|
679
|
-
set(e, n, r) {
|
|
680
|
-
const s = this;
|
|
681
|
-
function o(c, d, u) {
|
|
682
|
-
const l = J(d);
|
|
683
|
-
if (!l)
|
|
684
|
-
throw new Error("header name must be a non-empty string");
|
|
685
|
-
const p = a.findKey(s, l);
|
|
686
|
-
(!p || s[p] === void 0 || u === !0 || u === void 0 && s[p] !== !1) && (s[p || d] = te(c));
|
|
687
|
-
}
|
|
688
|
-
const i = (c, d) => a.forEach(c, (u, l) => o(u, l, d));
|
|
689
|
-
if (a.isPlainObject(e) || e instanceof this.constructor)
|
|
690
|
-
i(e, n);
|
|
691
|
-
else if (a.isString(e) && (e = e.trim()) && !En(e))
|
|
692
|
-
i(wn(e), n);
|
|
693
|
-
else if (a.isObject(e) && a.isIterable(e)) {
|
|
694
|
-
let c = {}, d, u;
|
|
695
|
-
for (const l of e) {
|
|
696
|
-
if (!a.isArray(l))
|
|
697
|
-
throw TypeError("Object iterator must return a key-value pair");
|
|
698
|
-
c[u = l[0]] = (d = c[u]) ? a.isArray(d) ? [...d, l[1]] : [d, l[1]] : l[1];
|
|
699
|
-
}
|
|
700
|
-
i(c, n);
|
|
701
|
-
} else
|
|
702
|
-
e != null && o(n, e, r);
|
|
703
|
-
return this;
|
|
704
|
-
}
|
|
705
|
-
get(e, n) {
|
|
706
|
-
if (e = J(e), e) {
|
|
707
|
-
const r = a.findKey(this, e);
|
|
708
|
-
if (r) {
|
|
709
|
-
const s = this[r];
|
|
710
|
-
if (!n)
|
|
711
|
-
return s;
|
|
712
|
-
if (n === !0)
|
|
713
|
-
return gn(s);
|
|
714
|
-
if (a.isFunction(n))
|
|
715
|
-
return n.call(this, s, r);
|
|
716
|
-
if (a.isRegExp(n))
|
|
717
|
-
return n.exec(s);
|
|
718
|
-
throw new TypeError("parser must be boolean|regexp|function");
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
has(e, n) {
|
|
723
|
-
if (e = J(e), e) {
|
|
724
|
-
const r = a.findKey(this, e);
|
|
725
|
-
return !!(r && this[r] !== void 0 && (!n || fe(this, this[r], r, n)));
|
|
726
|
-
}
|
|
727
|
-
return !1;
|
|
728
|
-
}
|
|
729
|
-
delete(e, n) {
|
|
730
|
-
const r = this;
|
|
731
|
-
let s = !1;
|
|
732
|
-
function o(i) {
|
|
733
|
-
if (i = J(i), i) {
|
|
734
|
-
const c = a.findKey(r, i);
|
|
735
|
-
c && (!n || fe(r, r[c], c, n)) && (delete r[c], s = !0);
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
return a.isArray(e) ? e.forEach(o) : o(e), s;
|
|
739
|
-
}
|
|
740
|
-
clear(e) {
|
|
741
|
-
const n = Object.keys(this);
|
|
742
|
-
let r = n.length, s = !1;
|
|
743
|
-
for (; r--; ) {
|
|
744
|
-
const o = n[r];
|
|
745
|
-
(!e || fe(this, this[o], o, e, !0)) && (delete this[o], s = !0);
|
|
746
|
-
}
|
|
747
|
-
return s;
|
|
748
|
-
}
|
|
749
|
-
normalize(e) {
|
|
750
|
-
const n = this, r = {};
|
|
751
|
-
return a.forEach(this, (s, o) => {
|
|
752
|
-
const i = a.findKey(r, o);
|
|
753
|
-
if (i) {
|
|
754
|
-
n[i] = te(s), delete n[o];
|
|
755
|
-
return;
|
|
756
|
-
}
|
|
757
|
-
const c = e ? Sn(o) : String(o).trim();
|
|
758
|
-
c !== o && delete n[o], n[c] = te(s), r[c] = !0;
|
|
759
|
-
}), this;
|
|
760
|
-
}
|
|
761
|
-
concat(...e) {
|
|
762
|
-
return this.constructor.concat(this, ...e);
|
|
763
|
-
}
|
|
764
|
-
toJSON(e) {
|
|
765
|
-
const n = /* @__PURE__ */ Object.create(null);
|
|
766
|
-
return a.forEach(this, (r, s) => {
|
|
767
|
-
r != null && r !== !1 && (n[s] = e && a.isArray(r) ? r.join(", ") : r);
|
|
768
|
-
}), n;
|
|
769
|
-
}
|
|
770
|
-
[Symbol.iterator]() {
|
|
771
|
-
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
772
|
-
}
|
|
773
|
-
toString() {
|
|
774
|
-
return Object.entries(this.toJSON()).map(([e, n]) => e + ": " + n).join(`
|
|
775
|
-
`);
|
|
776
|
-
}
|
|
777
|
-
getSetCookie() {
|
|
778
|
-
return this.get("set-cookie") || [];
|
|
779
|
-
}
|
|
780
|
-
get [Symbol.toStringTag]() {
|
|
781
|
-
return "AxiosHeaders";
|
|
782
|
-
}
|
|
783
|
-
static from(e) {
|
|
784
|
-
return e instanceof this ? e : new this(e);
|
|
785
|
-
}
|
|
786
|
-
static concat(e, ...n) {
|
|
787
|
-
const r = new this(e);
|
|
788
|
-
return n.forEach((s) => r.set(s)), r;
|
|
789
|
-
}
|
|
790
|
-
static accessor(e) {
|
|
791
|
-
const r = (this[Pe] = this[Pe] = {
|
|
792
|
-
accessors: {}
|
|
793
|
-
}).accessors, s = this.prototype;
|
|
794
|
-
function o(i) {
|
|
795
|
-
const c = J(i);
|
|
796
|
-
r[c] || (Rn(s, i), r[c] = !0);
|
|
797
|
-
}
|
|
798
|
-
return a.isArray(e) ? e.forEach(o) : o(e), this;
|
|
799
|
-
}
|
|
800
|
-
};
|
|
801
|
-
T.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
802
|
-
a.reduceDescriptors(T.prototype, ({ value: t }, e) => {
|
|
803
|
-
let n = e[0].toUpperCase() + e.slice(1);
|
|
804
|
-
return {
|
|
805
|
-
get: () => t,
|
|
806
|
-
set(r) {
|
|
807
|
-
this[n] = r;
|
|
808
|
-
}
|
|
809
|
-
};
|
|
810
|
-
});
|
|
811
|
-
a.freezeMethods(T);
|
|
812
|
-
function de(t, e) {
|
|
813
|
-
const n = this || W, r = e || n, s = T.from(r.headers);
|
|
814
|
-
let o = r.data;
|
|
815
|
-
return a.forEach(t, function(c) {
|
|
816
|
-
o = c.call(n, o, s.normalize(), e ? e.status : void 0);
|
|
817
|
-
}), s.normalize(), o;
|
|
818
|
-
}
|
|
819
|
-
function ot(t) {
|
|
820
|
-
return !!(t && t.__CANCEL__);
|
|
821
|
-
}
|
|
822
|
-
function H(t, e, n) {
|
|
823
|
-
y.call(this, t ?? "canceled", y.ERR_CANCELED, e, n), this.name = "CanceledError";
|
|
824
|
-
}
|
|
825
|
-
a.inherits(H, y, {
|
|
826
|
-
__CANCEL__: !0
|
|
827
|
-
});
|
|
828
|
-
function it(t, e, n) {
|
|
829
|
-
const r = n.config.validateStatus;
|
|
830
|
-
!n.status || !r || r(n.status) ? t(n) : e(new y(
|
|
831
|
-
"Request failed with status code " + n.status,
|
|
832
|
-
[y.ERR_BAD_REQUEST, y.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
|
|
833
|
-
n.config,
|
|
834
|
-
n.request,
|
|
835
|
-
n
|
|
836
|
-
));
|
|
837
|
-
}
|
|
838
|
-
function On(t) {
|
|
839
|
-
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
|
|
840
|
-
return e && e[1] || "";
|
|
841
|
-
}
|
|
842
|
-
function An(t, e) {
|
|
843
|
-
t = t || 10;
|
|
844
|
-
const n = new Array(t), r = new Array(t);
|
|
845
|
-
let s = 0, o = 0, i;
|
|
846
|
-
return e = e !== void 0 ? e : 1e3, function(d) {
|
|
847
|
-
const u = Date.now(), l = r[o];
|
|
848
|
-
i || (i = u), n[s] = d, r[s] = u;
|
|
849
|
-
let p = o, b = 0;
|
|
850
|
-
for (; p !== s; )
|
|
851
|
-
b += n[p++], p = p % t;
|
|
852
|
-
if (s = (s + 1) % t, s === o && (o = (o + 1) % t), u - i < e)
|
|
853
|
-
return;
|
|
854
|
-
const S = l && u - l;
|
|
855
|
-
return S ? Math.round(b * 1e3 / S) : void 0;
|
|
856
|
-
};
|
|
857
|
-
}
|
|
858
|
-
function Tn(t, e) {
|
|
859
|
-
let n = 0, r = 1e3 / e, s, o;
|
|
860
|
-
const i = (u, l = Date.now()) => {
|
|
861
|
-
n = l, s = null, o && (clearTimeout(o), o = null), t(...u);
|
|
862
|
-
};
|
|
863
|
-
return [(...u) => {
|
|
864
|
-
const l = Date.now(), p = l - n;
|
|
865
|
-
p >= r ? i(u, l) : (s = u, o || (o = setTimeout(() => {
|
|
866
|
-
o = null, i(s);
|
|
867
|
-
}, r - p)));
|
|
868
|
-
}, () => s && i(s)];
|
|
869
|
-
}
|
|
870
|
-
const re = (t, e, n = 3) => {
|
|
871
|
-
let r = 0;
|
|
872
|
-
const s = An(50, 250);
|
|
873
|
-
return Tn((o) => {
|
|
874
|
-
const i = o.loaded, c = o.lengthComputable ? o.total : void 0, d = i - r, u = s(d), l = i <= c;
|
|
875
|
-
r = i;
|
|
876
|
-
const p = {
|
|
877
|
-
loaded: i,
|
|
878
|
-
total: c,
|
|
879
|
-
progress: c ? i / c : void 0,
|
|
880
|
-
bytes: d,
|
|
881
|
-
rate: u || void 0,
|
|
882
|
-
estimated: u && c && l ? (c - i) / u : void 0,
|
|
883
|
-
event: o,
|
|
884
|
-
lengthComputable: c != null,
|
|
885
|
-
[e ? "download" : "upload"]: !0
|
|
886
|
-
};
|
|
887
|
-
t(p);
|
|
888
|
-
}, n);
|
|
889
|
-
}, Ue = (t, e) => {
|
|
890
|
-
const n = t != null;
|
|
891
|
-
return [(r) => e[0]({
|
|
892
|
-
lengthComputable: n,
|
|
893
|
-
total: t,
|
|
894
|
-
loaded: r
|
|
895
|
-
}), e[1]];
|
|
896
|
-
}, Le = (t) => (...e) => a.asap(() => t(...e)), xn = R.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (n) => (n = new URL(n, R.origin), t.protocol === n.protocol && t.host === n.host && (e || t.port === n.port)))(
|
|
897
|
-
new URL(R.origin),
|
|
898
|
-
R.navigator && /(msie|trident)/i.test(R.navigator.userAgent)
|
|
899
|
-
) : () => !0, _n = R.hasStandardBrowserEnv ? (
|
|
900
|
-
// Standard browser envs support document.cookie
|
|
901
|
-
{
|
|
902
|
-
write(t, e, n, r, s, o, i) {
|
|
903
|
-
if (typeof document > "u") return;
|
|
904
|
-
const c = [`${t}=${encodeURIComponent(e)}`];
|
|
905
|
-
a.isNumber(n) && c.push(`expires=${new Date(n).toUTCString()}`), a.isString(r) && c.push(`path=${r}`), a.isString(s) && c.push(`domain=${s}`), o === !0 && c.push("secure"), a.isString(i) && c.push(`SameSite=${i}`), document.cookie = c.join("; ");
|
|
906
|
-
},
|
|
907
|
-
read(t) {
|
|
908
|
-
if (typeof document > "u") return null;
|
|
909
|
-
const e = document.cookie.match(new RegExp("(?:^|; )" + t + "=([^;]*)"));
|
|
910
|
-
return e ? decodeURIComponent(e[1]) : null;
|
|
911
|
-
},
|
|
912
|
-
remove(t) {
|
|
913
|
-
this.write(t, "", Date.now() - 864e5, "/");
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
) : (
|
|
917
|
-
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
918
|
-
{
|
|
919
|
-
write() {
|
|
920
|
-
},
|
|
921
|
-
read() {
|
|
922
|
-
return null;
|
|
923
|
-
},
|
|
924
|
-
remove() {
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
);
|
|
928
|
-
function Cn(t) {
|
|
929
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
|
|
930
|
-
}
|
|
931
|
-
function Fn(t, e) {
|
|
932
|
-
return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
|
|
933
|
-
}
|
|
934
|
-
function at(t, e, n) {
|
|
935
|
-
let r = !Cn(e);
|
|
936
|
-
return t && (r || n == !1) ? Fn(t, e) : e;
|
|
937
|
-
}
|
|
938
|
-
const $e = (t) => t instanceof T ? { ...t } : t;
|
|
939
|
-
function D(t, e) {
|
|
940
|
-
e = e || {};
|
|
941
|
-
const n = {};
|
|
942
|
-
function r(u, l, p, b) {
|
|
943
|
-
return a.isPlainObject(u) && a.isPlainObject(l) ? a.merge.call({ caseless: b }, u, l) : a.isPlainObject(l) ? a.merge({}, l) : a.isArray(l) ? l.slice() : l;
|
|
944
|
-
}
|
|
945
|
-
function s(u, l, p, b) {
|
|
946
|
-
if (a.isUndefined(l)) {
|
|
947
|
-
if (!a.isUndefined(u))
|
|
948
|
-
return r(void 0, u, p, b);
|
|
949
|
-
} else return r(u, l, p, b);
|
|
950
|
-
}
|
|
951
|
-
function o(u, l) {
|
|
952
|
-
if (!a.isUndefined(l))
|
|
953
|
-
return r(void 0, l);
|
|
954
|
-
}
|
|
955
|
-
function i(u, l) {
|
|
956
|
-
if (a.isUndefined(l)) {
|
|
957
|
-
if (!a.isUndefined(u))
|
|
958
|
-
return r(void 0, u);
|
|
959
|
-
} else return r(void 0, l);
|
|
960
|
-
}
|
|
961
|
-
function c(u, l, p) {
|
|
962
|
-
if (p in e)
|
|
963
|
-
return r(u, l);
|
|
964
|
-
if (p in t)
|
|
965
|
-
return r(void 0, u);
|
|
966
|
-
}
|
|
967
|
-
const d = {
|
|
968
|
-
url: o,
|
|
969
|
-
method: o,
|
|
970
|
-
data: o,
|
|
971
|
-
baseURL: i,
|
|
972
|
-
transformRequest: i,
|
|
973
|
-
transformResponse: i,
|
|
974
|
-
paramsSerializer: i,
|
|
975
|
-
timeout: i,
|
|
976
|
-
timeoutMessage: i,
|
|
977
|
-
withCredentials: i,
|
|
978
|
-
withXSRFToken: i,
|
|
979
|
-
adapter: i,
|
|
980
|
-
responseType: i,
|
|
981
|
-
xsrfCookieName: i,
|
|
982
|
-
xsrfHeaderName: i,
|
|
983
|
-
onUploadProgress: i,
|
|
984
|
-
onDownloadProgress: i,
|
|
985
|
-
decompress: i,
|
|
986
|
-
maxContentLength: i,
|
|
987
|
-
maxBodyLength: i,
|
|
988
|
-
beforeRedirect: i,
|
|
989
|
-
transport: i,
|
|
990
|
-
httpAgent: i,
|
|
991
|
-
httpsAgent: i,
|
|
992
|
-
cancelToken: i,
|
|
993
|
-
socketPath: i,
|
|
994
|
-
responseEncoding: i,
|
|
995
|
-
validateStatus: c,
|
|
996
|
-
headers: (u, l, p) => s($e(u), $e(l), p, !0)
|
|
997
|
-
};
|
|
998
|
-
return a.forEach(Object.keys({ ...t, ...e }), function(l) {
|
|
999
|
-
const p = d[l] || s, b = p(t[l], e[l], l);
|
|
1000
|
-
a.isUndefined(b) && p !== c || (n[l] = b);
|
|
1001
|
-
}), n;
|
|
1002
|
-
}
|
|
1003
|
-
const ct = (t) => {
|
|
1004
|
-
const e = D({}, t);
|
|
1005
|
-
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = e;
|
|
1006
|
-
if (e.headers = i = T.from(i), e.url = nt(at(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), c && i.set(
|
|
1007
|
-
"Authorization",
|
|
1008
|
-
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1009
|
-
), a.isFormData(n)) {
|
|
1010
|
-
if (R.hasStandardBrowserEnv || R.hasStandardBrowserWebWorkerEnv)
|
|
1011
|
-
i.setContentType(void 0);
|
|
1012
|
-
else if (a.isFunction(n.getHeaders)) {
|
|
1013
|
-
const d = n.getHeaders(), u = ["content-type", "content-length"];
|
|
1014
|
-
Object.entries(d).forEach(([l, p]) => {
|
|
1015
|
-
u.includes(l.toLowerCase()) && i.set(l, p);
|
|
1016
|
-
});
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
if (R.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(e)), r || r !== !1 && xn(e.url))) {
|
|
1020
|
-
const d = s && o && _n.read(o);
|
|
1021
|
-
d && i.set(s, d);
|
|
1022
|
-
}
|
|
1023
|
-
return e;
|
|
1024
|
-
}, Nn = typeof XMLHttpRequest < "u", kn = Nn && function(t) {
|
|
1025
|
-
return new Promise(function(n, r) {
|
|
1026
|
-
const s = ct(t);
|
|
1027
|
-
let o = s.data;
|
|
1028
|
-
const i = T.from(s.headers).normalize();
|
|
1029
|
-
let { responseType: c, onUploadProgress: d, onDownloadProgress: u } = s, l, p, b, S, f;
|
|
1030
|
-
function m() {
|
|
1031
|
-
S && S(), f && f(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
|
|
1032
|
-
}
|
|
1033
|
-
let h = new XMLHttpRequest();
|
|
1034
|
-
h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
|
|
1035
|
-
function g() {
|
|
1036
|
-
if (!h)
|
|
1037
|
-
return;
|
|
1038
|
-
const E = T.from(
|
|
1039
|
-
"getAllResponseHeaders" in h && h.getAllResponseHeaders()
|
|
1040
|
-
), C = {
|
|
1041
|
-
data: !c || c === "text" || c === "json" ? h.responseText : h.response,
|
|
1042
|
-
status: h.status,
|
|
1043
|
-
statusText: h.statusText,
|
|
1044
|
-
headers: E,
|
|
1045
|
-
config: t,
|
|
1046
|
-
request: h
|
|
1047
|
-
};
|
|
1048
|
-
it(function(_) {
|
|
1049
|
-
n(_), m();
|
|
1050
|
-
}, function(_) {
|
|
1051
|
-
r(_), m();
|
|
1052
|
-
}, C), h = null;
|
|
1053
|
-
}
|
|
1054
|
-
"onloadend" in h ? h.onloadend = g : h.onreadystatechange = function() {
|
|
1055
|
-
!h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(g);
|
|
1056
|
-
}, h.onabort = function() {
|
|
1057
|
-
h && (r(new y("Request aborted", y.ECONNABORTED, t, h)), h = null);
|
|
1058
|
-
}, h.onerror = function(O) {
|
|
1059
|
-
const C = O && O.message ? O.message : "Network Error", L = new y(C, y.ERR_NETWORK, t, h);
|
|
1060
|
-
L.event = O || null, r(L), h = null;
|
|
1061
|
-
}, h.ontimeout = function() {
|
|
1062
|
-
let O = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1063
|
-
const C = s.transitional || rt;
|
|
1064
|
-
s.timeoutErrorMessage && (O = s.timeoutErrorMessage), r(new y(
|
|
1065
|
-
O,
|
|
1066
|
-
C.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
|
|
1067
|
-
t,
|
|
1068
|
-
h
|
|
1069
|
-
)), h = null;
|
|
1070
|
-
}, o === void 0 && i.setContentType(null), "setRequestHeader" in h && a.forEach(i.toJSON(), function(O, C) {
|
|
1071
|
-
h.setRequestHeader(C, O);
|
|
1072
|
-
}), a.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), c && c !== "json" && (h.responseType = s.responseType), u && ([b, f] = re(u, !0), h.addEventListener("progress", b)), d && h.upload && ([p, S] = re(d), h.upload.addEventListener("progress", p), h.upload.addEventListener("loadend", S)), (s.cancelToken || s.signal) && (l = (E) => {
|
|
1073
|
-
h && (r(!E || E.type ? new H(null, t, h) : E), h.abort(), h = null);
|
|
1074
|
-
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
|
|
1075
|
-
const x = On(s.url);
|
|
1076
|
-
if (x && R.protocols.indexOf(x) === -1) {
|
|
1077
|
-
r(new y("Unsupported protocol " + x + ":", y.ERR_BAD_REQUEST, t));
|
|
1078
|
-
return;
|
|
1079
|
-
}
|
|
1080
|
-
h.send(o || null);
|
|
1081
|
-
});
|
|
1082
|
-
}, Pn = (t, e) => {
|
|
1083
|
-
const { length: n } = t = t ? t.filter(Boolean) : [];
|
|
1084
|
-
if (e || n) {
|
|
1085
|
-
let r = new AbortController(), s;
|
|
1086
|
-
const o = function(u) {
|
|
1087
|
-
if (!s) {
|
|
1088
|
-
s = !0, c();
|
|
1089
|
-
const l = u instanceof Error ? u : this.reason;
|
|
1090
|
-
r.abort(l instanceof y ? l : new H(l instanceof Error ? l.message : l));
|
|
1091
|
-
}
|
|
1092
|
-
};
|
|
1093
|
-
let i = e && setTimeout(() => {
|
|
1094
|
-
i = null, o(new y(`timeout ${e} of ms exceeded`, y.ETIMEDOUT));
|
|
1095
|
-
}, e);
|
|
1096
|
-
const c = () => {
|
|
1097
|
-
t && (i && clearTimeout(i), i = null, t.forEach((u) => {
|
|
1098
|
-
u.unsubscribe ? u.unsubscribe(o) : u.removeEventListener("abort", o);
|
|
1099
|
-
}), t = null);
|
|
1100
|
-
};
|
|
1101
|
-
t.forEach((u) => u.addEventListener("abort", o));
|
|
1102
|
-
const { signal: d } = r;
|
|
1103
|
-
return d.unsubscribe = () => a.asap(c), d;
|
|
1104
|
-
}
|
|
1105
|
-
}, Un = function* (t, e) {
|
|
1106
|
-
let n = t.byteLength;
|
|
1107
|
-
if (n < e) {
|
|
1108
|
-
yield t;
|
|
1109
|
-
return;
|
|
1110
|
-
}
|
|
1111
|
-
let r = 0, s;
|
|
1112
|
-
for (; r < n; )
|
|
1113
|
-
s = r + e, yield t.slice(r, s), r = s;
|
|
1114
|
-
}, Ln = async function* (t, e) {
|
|
1115
|
-
for await (const n of $n(t))
|
|
1116
|
-
yield* Un(n, e);
|
|
1117
|
-
}, $n = async function* (t) {
|
|
1118
|
-
if (t[Symbol.asyncIterator]) {
|
|
1119
|
-
yield* t;
|
|
1120
|
-
return;
|
|
1121
|
-
}
|
|
1122
|
-
const e = t.getReader();
|
|
1123
|
-
try {
|
|
1124
|
-
for (; ; ) {
|
|
1125
|
-
const { done: n, value: r } = await e.read();
|
|
1126
|
-
if (n)
|
|
1127
|
-
break;
|
|
1128
|
-
yield r;
|
|
1129
|
-
}
|
|
1130
|
-
} finally {
|
|
1131
|
-
await e.cancel();
|
|
1132
|
-
}
|
|
1133
|
-
}, je = (t, e, n, r) => {
|
|
1134
|
-
const s = Ln(t, e);
|
|
1135
|
-
let o = 0, i, c = (d) => {
|
|
1136
|
-
i || (i = !0, r && r(d));
|
|
1137
|
-
};
|
|
1138
|
-
return new ReadableStream({
|
|
1139
|
-
async pull(d) {
|
|
1140
|
-
try {
|
|
1141
|
-
const { done: u, value: l } = await s.next();
|
|
1142
|
-
if (u) {
|
|
1143
|
-
c(), d.close();
|
|
1144
|
-
return;
|
|
1145
|
-
}
|
|
1146
|
-
let p = l.byteLength;
|
|
1147
|
-
if (n) {
|
|
1148
|
-
let b = o += p;
|
|
1149
|
-
n(b);
|
|
1150
|
-
}
|
|
1151
|
-
d.enqueue(new Uint8Array(l));
|
|
1152
|
-
} catch (u) {
|
|
1153
|
-
throw c(u), u;
|
|
1154
|
-
}
|
|
1155
|
-
},
|
|
1156
|
-
cancel(d) {
|
|
1157
|
-
return c(d), s.return();
|
|
1158
|
-
}
|
|
1159
|
-
}, {
|
|
1160
|
-
highWaterMark: 2
|
|
1161
|
-
});
|
|
1162
|
-
}, Be = 64 * 1024, { isFunction: Z } = a, jn = (({ Request: t, Response: e }) => ({
|
|
1163
|
-
Request: t,
|
|
1164
|
-
Response: e
|
|
1165
|
-
}))(a.global), {
|
|
1166
|
-
ReadableStream: De,
|
|
1167
|
-
TextEncoder: qe
|
|
1168
|
-
} = a.global, Me = (t, ...e) => {
|
|
1169
|
-
try {
|
|
1170
|
-
return !!t(...e);
|
|
1171
|
-
} catch {
|
|
1172
|
-
return !1;
|
|
1173
|
-
}
|
|
1174
|
-
}, Bn = (t) => {
|
|
1175
|
-
t = a.merge.call({
|
|
1176
|
-
skipUndefined: !0
|
|
1177
|
-
}, jn, t);
|
|
1178
|
-
const { fetch: e, Request: n, Response: r } = t, s = e ? Z(e) : typeof fetch == "function", o = Z(n), i = Z(r);
|
|
1179
|
-
if (!s)
|
|
1180
|
-
return !1;
|
|
1181
|
-
const c = s && Z(De), d = s && (typeof qe == "function" ? /* @__PURE__ */ ((f) => (m) => f.encode(m))(new qe()) : async (f) => new Uint8Array(await new n(f).arrayBuffer())), u = o && c && Me(() => {
|
|
1182
|
-
let f = !1;
|
|
1183
|
-
const m = new n(R.origin, {
|
|
1184
|
-
body: new De(),
|
|
1185
|
-
method: "POST",
|
|
1186
|
-
get duplex() {
|
|
1187
|
-
return f = !0, "half";
|
|
1188
|
-
}
|
|
1189
|
-
}).headers.has("Content-Type");
|
|
1190
|
-
return f && !m;
|
|
1191
|
-
}), l = i && c && Me(() => a.isReadableStream(new r("").body)), p = {
|
|
1192
|
-
stream: l && ((f) => f.body)
|
|
1193
|
-
};
|
|
1194
|
-
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((f) => {
|
|
1195
|
-
!p[f] && (p[f] = (m, h) => {
|
|
1196
|
-
let g = m && m[f];
|
|
1197
|
-
if (g)
|
|
1198
|
-
return g.call(m);
|
|
1199
|
-
throw new y(`Response type '${f}' is not supported`, y.ERR_NOT_SUPPORT, h);
|
|
1200
|
-
});
|
|
1201
|
-
});
|
|
1202
|
-
const b = async (f) => {
|
|
1203
|
-
if (f == null)
|
|
1204
|
-
return 0;
|
|
1205
|
-
if (a.isBlob(f))
|
|
1206
|
-
return f.size;
|
|
1207
|
-
if (a.isSpecCompliantForm(f))
|
|
1208
|
-
return (await new n(R.origin, {
|
|
1209
|
-
method: "POST",
|
|
1210
|
-
body: f
|
|
1211
|
-
}).arrayBuffer()).byteLength;
|
|
1212
|
-
if (a.isArrayBufferView(f) || a.isArrayBuffer(f))
|
|
1213
|
-
return f.byteLength;
|
|
1214
|
-
if (a.isURLSearchParams(f) && (f = f + ""), a.isString(f))
|
|
1215
|
-
return (await d(f)).byteLength;
|
|
1216
|
-
}, S = async (f, m) => {
|
|
1217
|
-
const h = a.toFiniteNumber(f.getContentLength());
|
|
1218
|
-
return h ?? b(m);
|
|
1219
|
-
};
|
|
1220
|
-
return async (f) => {
|
|
1221
|
-
let {
|
|
1222
|
-
url: m,
|
|
1223
|
-
method: h,
|
|
1224
|
-
data: g,
|
|
1225
|
-
signal: x,
|
|
1226
|
-
cancelToken: E,
|
|
1227
|
-
timeout: O,
|
|
1228
|
-
onDownloadProgress: C,
|
|
1229
|
-
onUploadProgress: L,
|
|
1230
|
-
responseType: _,
|
|
1231
|
-
headers: le,
|
|
1232
|
-
withCredentials: K = "same-origin",
|
|
1233
|
-
fetchOptions: Re
|
|
1234
|
-
} = ct(f), Oe = e || fetch;
|
|
1235
|
-
_ = _ ? (_ + "").toLowerCase() : "text";
|
|
1236
|
-
let X = Pn([x, E && E.toAbortSignal()], O), Q = null;
|
|
1237
|
-
const $ = X && X.unsubscribe && (() => {
|
|
1238
|
-
X.unsubscribe();
|
|
1239
|
-
});
|
|
1240
|
-
let Ae;
|
|
1241
|
-
try {
|
|
1242
|
-
if (L && u && h !== "get" && h !== "head" && (Ae = await S(le, g)) !== 0) {
|
|
1243
|
-
let U = new n(m, {
|
|
1244
|
-
method: "POST",
|
|
1245
|
-
body: g,
|
|
1246
|
-
duplex: "half"
|
|
1247
|
-
}), q;
|
|
1248
|
-
if (a.isFormData(g) && (q = U.headers.get("content-type")) && le.setContentType(q), U.body) {
|
|
1249
|
-
const [ue, G] = Ue(
|
|
1250
|
-
Ae,
|
|
1251
|
-
re(Le(L))
|
|
1252
|
-
);
|
|
1253
|
-
g = je(U.body, Be, ue, G);
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
a.isString(K) || (K = K ? "include" : "omit");
|
|
1257
|
-
const N = o && "credentials" in n.prototype, Te = {
|
|
1258
|
-
...Re,
|
|
1259
|
-
signal: X,
|
|
1260
|
-
method: h.toUpperCase(),
|
|
1261
|
-
headers: le.normalize().toJSON(),
|
|
1262
|
-
body: g,
|
|
1263
|
-
duplex: "half",
|
|
1264
|
-
credentials: N ? K : void 0
|
|
1265
|
-
};
|
|
1266
|
-
Q = o && new n(m, Te);
|
|
1267
|
-
let P = await (o ? Oe(Q, Re) : Oe(m, Te));
|
|
1268
|
-
const xe = l && (_ === "stream" || _ === "response");
|
|
1269
|
-
if (l && (C || xe && $)) {
|
|
1270
|
-
const U = {};
|
|
1271
|
-
["status", "statusText", "headers"].forEach((_e) => {
|
|
1272
|
-
U[_e] = P[_e];
|
|
1273
|
-
});
|
|
1274
|
-
const q = a.toFiniteNumber(P.headers.get("content-length")), [ue, G] = C && Ue(
|
|
1275
|
-
q,
|
|
1276
|
-
re(Le(C), !0)
|
|
1277
|
-
) || [];
|
|
1278
|
-
P = new r(
|
|
1279
|
-
je(P.body, Be, ue, () => {
|
|
1280
|
-
G && G(), $ && $();
|
|
1281
|
-
}),
|
|
1282
|
-
U
|
|
1283
|
-
);
|
|
1284
|
-
}
|
|
1285
|
-
_ = _ || "text";
|
|
1286
|
-
let pt = await p[a.findKey(p, _) || "text"](P, f);
|
|
1287
|
-
return !xe && $ && $(), await new Promise((U, q) => {
|
|
1288
|
-
it(U, q, {
|
|
1289
|
-
data: pt,
|
|
1290
|
-
headers: T.from(P.headers),
|
|
1291
|
-
status: P.status,
|
|
1292
|
-
statusText: P.statusText,
|
|
1293
|
-
config: f,
|
|
1294
|
-
request: Q
|
|
1295
|
-
});
|
|
1296
|
-
});
|
|
1297
|
-
} catch (N) {
|
|
1298
|
-
throw $ && $(), N && N.name === "TypeError" && /Load failed|fetch/i.test(N.message) ? Object.assign(
|
|
1299
|
-
new y("Network Error", y.ERR_NETWORK, f, Q),
|
|
1300
|
-
{
|
|
1301
|
-
cause: N.cause || N
|
|
1302
|
-
}
|
|
1303
|
-
) : y.from(N, N && N.code, f, Q);
|
|
1304
|
-
}
|
|
1305
|
-
};
|
|
1306
|
-
}, Dn = /* @__PURE__ */ new Map(), lt = (t) => {
|
|
1307
|
-
let e = t && t.env || {};
|
|
1308
|
-
const { fetch: n, Request: r, Response: s } = e, o = [
|
|
1309
|
-
r,
|
|
1310
|
-
s,
|
|
1311
|
-
n
|
|
1312
|
-
];
|
|
1313
|
-
let i = o.length, c = i, d, u, l = Dn;
|
|
1314
|
-
for (; c--; )
|
|
1315
|
-
d = o[c], u = l.get(d), u === void 0 && l.set(d, u = c ? /* @__PURE__ */ new Map() : Bn(e)), l = u;
|
|
1316
|
-
return u;
|
|
1317
|
-
};
|
|
1318
|
-
lt();
|
|
1319
|
-
const Se = {
|
|
1320
|
-
http: en,
|
|
1321
|
-
xhr: kn,
|
|
1322
|
-
fetch: {
|
|
1323
|
-
get: lt
|
|
1324
|
-
}
|
|
1325
|
-
};
|
|
1326
|
-
a.forEach(Se, (t, e) => {
|
|
1327
|
-
if (t) {
|
|
1328
|
-
try {
|
|
1329
|
-
Object.defineProperty(t, "name", { value: e });
|
|
1330
|
-
} catch {
|
|
1331
|
-
}
|
|
1332
|
-
Object.defineProperty(t, "adapterName", { value: e });
|
|
1333
|
-
}
|
|
1334
|
-
});
|
|
1335
|
-
const Ie = (t) => `- ${t}`, qn = (t) => a.isFunction(t) || t === null || t === !1;
|
|
1336
|
-
function Mn(t, e) {
|
|
1337
|
-
t = a.isArray(t) ? t : [t];
|
|
1338
|
-
const { length: n } = t;
|
|
1339
|
-
let r, s;
|
|
1340
|
-
const o = {};
|
|
1341
|
-
for (let i = 0; i < n; i++) {
|
|
1342
|
-
r = t[i];
|
|
1343
|
-
let c;
|
|
1344
|
-
if (s = r, !qn(r) && (s = Se[(c = String(r)).toLowerCase()], s === void 0))
|
|
1345
|
-
throw new y(`Unknown adapter '${c}'`);
|
|
1346
|
-
if (s && (a.isFunction(s) || (s = s.get(e))))
|
|
1347
|
-
break;
|
|
1348
|
-
o[c || "#" + i] = s;
|
|
1349
|
-
}
|
|
1350
|
-
if (!s) {
|
|
1351
|
-
const i = Object.entries(o).map(
|
|
1352
|
-
([d, u]) => `adapter ${d} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1353
|
-
);
|
|
1354
|
-
let c = n ? i.length > 1 ? `since :
|
|
1355
|
-
` + i.map(Ie).join(`
|
|
1356
|
-
`) : " " + Ie(i[0]) : "as no adapter specified";
|
|
1357
|
-
throw new y(
|
|
1358
|
-
"There is no suitable adapter to dispatch the request " + c,
|
|
1359
|
-
"ERR_NOT_SUPPORT"
|
|
1360
|
-
);
|
|
1361
|
-
}
|
|
1362
|
-
return s;
|
|
1363
|
-
}
|
|
1364
|
-
const ut = {
|
|
1365
|
-
/**
|
|
1366
|
-
* Resolve an adapter from a list of adapter names or functions.
|
|
1367
|
-
* @type {Function}
|
|
1368
|
-
*/
|
|
1369
|
-
getAdapter: Mn,
|
|
1370
|
-
/**
|
|
1371
|
-
* Exposes all known adapters
|
|
1372
|
-
* @type {Object<string, Function|Object>}
|
|
1373
|
-
*/
|
|
1374
|
-
adapters: Se
|
|
1375
|
-
};
|
|
1376
|
-
function he(t) {
|
|
1377
|
-
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
|
|
1378
|
-
throw new H(null, t);
|
|
1379
|
-
}
|
|
1380
|
-
function He(t) {
|
|
1381
|
-
return he(t), t.headers = T.from(t.headers), t.data = de.call(
|
|
1382
|
-
t,
|
|
1383
|
-
t.transformRequest
|
|
1384
|
-
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), ut.getAdapter(t.adapter || W.adapter, t)(t).then(function(r) {
|
|
1385
|
-
return he(t), r.data = de.call(
|
|
1386
|
-
t,
|
|
1387
|
-
t.transformResponse,
|
|
1388
|
-
r
|
|
1389
|
-
), r.headers = T.from(r.headers), r;
|
|
1390
|
-
}, function(r) {
|
|
1391
|
-
return ot(r) || (he(t), r && r.response && (r.response.data = de.call(
|
|
1392
|
-
t,
|
|
1393
|
-
t.transformResponse,
|
|
1394
|
-
r.response
|
|
1395
|
-
), r.response.headers = T.from(r.response.headers))), Promise.reject(r);
|
|
1396
|
-
});
|
|
1397
|
-
}
|
|
1398
|
-
const ft = "1.13.2", ce = {};
|
|
1399
|
-
["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
|
|
1400
|
-
ce[t] = function(r) {
|
|
1401
|
-
return typeof r === t || "a" + (e < 1 ? "n " : " ") + t;
|
|
1402
|
-
};
|
|
1403
|
-
});
|
|
1404
|
-
const Qe = {};
|
|
1405
|
-
ce.transitional = function(e, n, r) {
|
|
1406
|
-
function s(o, i) {
|
|
1407
|
-
return "[Axios v" + ft + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
|
|
1408
|
-
}
|
|
1409
|
-
return (o, i, c) => {
|
|
1410
|
-
if (e === !1)
|
|
1411
|
-
throw new y(
|
|
1412
|
-
s(i, " has been removed" + (n ? " in " + n : "")),
|
|
1413
|
-
y.ERR_DEPRECATED
|
|
1414
|
-
);
|
|
1415
|
-
return n && !Qe[i] && (Qe[i] = !0, console.warn(
|
|
1416
|
-
s(
|
|
1417
|
-
i,
|
|
1418
|
-
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
1419
|
-
)
|
|
1420
|
-
)), e ? e(o, i, c) : !0;
|
|
1421
|
-
};
|
|
1422
|
-
};
|
|
1423
|
-
ce.spelling = function(e) {
|
|
1424
|
-
return (n, r) => (console.warn(`${r} is likely a misspelling of ${e}`), !0);
|
|
1425
|
-
};
|
|
1426
|
-
function In(t, e, n) {
|
|
1427
|
-
if (typeof t != "object")
|
|
1428
|
-
throw new y("options must be an object", y.ERR_BAD_OPTION_VALUE);
|
|
1429
|
-
const r = Object.keys(t);
|
|
1430
|
-
let s = r.length;
|
|
1431
|
-
for (; s-- > 0; ) {
|
|
1432
|
-
const o = r[s], i = e[o];
|
|
1433
|
-
if (i) {
|
|
1434
|
-
const c = t[o], d = c === void 0 || i(c, o, t);
|
|
1435
|
-
if (d !== !0)
|
|
1436
|
-
throw new y("option " + o + " must be " + d, y.ERR_BAD_OPTION_VALUE);
|
|
1437
|
-
continue;
|
|
1438
|
-
}
|
|
1439
|
-
if (n !== !0)
|
|
1440
|
-
throw new y("Unknown option " + o, y.ERR_BAD_OPTION);
|
|
1441
|
-
}
|
|
1442
|
-
}
|
|
1443
|
-
const ne = {
|
|
1444
|
-
assertOptions: In,
|
|
1445
|
-
validators: ce
|
|
1446
|
-
}, k = ne.validators;
|
|
1447
|
-
let B = class {
|
|
1448
|
-
constructor(e) {
|
|
1449
|
-
this.defaults = e || {}, this.interceptors = {
|
|
1450
|
-
request: new ke(),
|
|
1451
|
-
response: new ke()
|
|
1452
|
-
};
|
|
1453
|
-
}
|
|
1454
|
-
/**
|
|
1455
|
-
* Dispatch a request
|
|
1456
|
-
*
|
|
1457
|
-
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
1458
|
-
* @param {?Object} config
|
|
1459
|
-
*
|
|
1460
|
-
* @returns {Promise} The Promise to be fulfilled
|
|
1461
|
-
*/
|
|
1462
|
-
async request(e, n) {
|
|
1463
|
-
try {
|
|
1464
|
-
return await this._request(e, n);
|
|
1465
|
-
} catch (r) {
|
|
1466
|
-
if (r instanceof Error) {
|
|
1467
|
-
let s = {};
|
|
1468
|
-
Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
|
|
1469
|
-
const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
|
|
1470
|
-
try {
|
|
1471
|
-
r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
|
|
1472
|
-
` + o) : r.stack = o;
|
|
1473
|
-
} catch {
|
|
1474
|
-
}
|
|
1475
|
-
}
|
|
1476
|
-
throw r;
|
|
1477
|
-
}
|
|
1478
|
-
}
|
|
1479
|
-
_request(e, n) {
|
|
1480
|
-
typeof e == "string" ? (n = n || {}, n.url = e) : n = e || {}, n = D(this.defaults, n);
|
|
1481
|
-
const { transitional: r, paramsSerializer: s, headers: o } = n;
|
|
1482
|
-
r !== void 0 && ne.assertOptions(r, {
|
|
1483
|
-
silentJSONParsing: k.transitional(k.boolean),
|
|
1484
|
-
forcedJSONParsing: k.transitional(k.boolean),
|
|
1485
|
-
clarifyTimeoutError: k.transitional(k.boolean)
|
|
1486
|
-
}, !1), s != null && (a.isFunction(s) ? n.paramsSerializer = {
|
|
1487
|
-
serialize: s
|
|
1488
|
-
} : ne.assertOptions(s, {
|
|
1489
|
-
encode: k.function,
|
|
1490
|
-
serialize: k.function
|
|
1491
|
-
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), ne.assertOptions(n, {
|
|
1492
|
-
baseUrl: k.spelling("baseURL"),
|
|
1493
|
-
withXsrfToken: k.spelling("withXSRFToken")
|
|
1494
|
-
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1495
|
-
let i = o && a.merge(
|
|
1496
|
-
o.common,
|
|
1497
|
-
o[n.method]
|
|
1498
|
-
);
|
|
1499
|
-
o && a.forEach(
|
|
1500
|
-
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1501
|
-
(f) => {
|
|
1502
|
-
delete o[f];
|
|
1503
|
-
}
|
|
1504
|
-
), n.headers = T.concat(i, o);
|
|
1505
|
-
const c = [];
|
|
1506
|
-
let d = !0;
|
|
1507
|
-
this.interceptors.request.forEach(function(m) {
|
|
1508
|
-
typeof m.runWhen == "function" && m.runWhen(n) === !1 || (d = d && m.synchronous, c.unshift(m.fulfilled, m.rejected));
|
|
1509
|
-
});
|
|
1510
|
-
const u = [];
|
|
1511
|
-
this.interceptors.response.forEach(function(m) {
|
|
1512
|
-
u.push(m.fulfilled, m.rejected);
|
|
1513
|
-
});
|
|
1514
|
-
let l, p = 0, b;
|
|
1515
|
-
if (!d) {
|
|
1516
|
-
const f = [He.bind(this), void 0];
|
|
1517
|
-
for (f.unshift(...c), f.push(...u), b = f.length, l = Promise.resolve(n); p < b; )
|
|
1518
|
-
l = l.then(f[p++], f[p++]);
|
|
1519
|
-
return l;
|
|
1520
|
-
}
|
|
1521
|
-
b = c.length;
|
|
1522
|
-
let S = n;
|
|
1523
|
-
for (; p < b; ) {
|
|
1524
|
-
const f = c[p++], m = c[p++];
|
|
1525
|
-
try {
|
|
1526
|
-
S = f(S);
|
|
1527
|
-
} catch (h) {
|
|
1528
|
-
m.call(this, h);
|
|
1529
|
-
break;
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
try {
|
|
1533
|
-
l = He.call(this, S);
|
|
1534
|
-
} catch (f) {
|
|
1535
|
-
return Promise.reject(f);
|
|
1536
|
-
}
|
|
1537
|
-
for (p = 0, b = u.length; p < b; )
|
|
1538
|
-
l = l.then(u[p++], u[p++]);
|
|
1539
|
-
return l;
|
|
1540
|
-
}
|
|
1541
|
-
getUri(e) {
|
|
1542
|
-
e = D(this.defaults, e);
|
|
1543
|
-
const n = at(e.baseURL, e.url, e.allowAbsoluteUrls);
|
|
1544
|
-
return nt(n, e.params, e.paramsSerializer);
|
|
1545
|
-
}
|
|
1546
|
-
};
|
|
1547
|
-
a.forEach(["delete", "get", "head", "options"], function(e) {
|
|
1548
|
-
B.prototype[e] = function(n, r) {
|
|
1549
|
-
return this.request(D(r || {}, {
|
|
1550
|
-
method: e,
|
|
1551
|
-
url: n,
|
|
1552
|
-
data: (r || {}).data
|
|
1553
|
-
}));
|
|
1554
|
-
};
|
|
1555
|
-
});
|
|
1556
|
-
a.forEach(["post", "put", "patch"], function(e) {
|
|
1557
|
-
function n(r) {
|
|
1558
|
-
return function(o, i, c) {
|
|
1559
|
-
return this.request(D(c || {}, {
|
|
1560
|
-
method: e,
|
|
1561
|
-
headers: r ? {
|
|
1562
|
-
"Content-Type": "multipart/form-data"
|
|
1563
|
-
} : {},
|
|
1564
|
-
url: o,
|
|
1565
|
-
data: i
|
|
1566
|
-
}));
|
|
1567
|
-
};
|
|
1568
|
-
}
|
|
1569
|
-
B.prototype[e] = n(), B.prototype[e + "Form"] = n(!0);
|
|
1570
|
-
});
|
|
1571
|
-
let Hn = class dt {
|
|
1572
|
-
constructor(e) {
|
|
1573
|
-
if (typeof e != "function")
|
|
1574
|
-
throw new TypeError("executor must be a function.");
|
|
1575
|
-
let n;
|
|
1576
|
-
this.promise = new Promise(function(o) {
|
|
1577
|
-
n = o;
|
|
1578
|
-
});
|
|
1579
|
-
const r = this;
|
|
1580
|
-
this.promise.then((s) => {
|
|
1581
|
-
if (!r._listeners) return;
|
|
1582
|
-
let o = r._listeners.length;
|
|
1583
|
-
for (; o-- > 0; )
|
|
1584
|
-
r._listeners[o](s);
|
|
1585
|
-
r._listeners = null;
|
|
1586
|
-
}), this.promise.then = (s) => {
|
|
1587
|
-
let o;
|
|
1588
|
-
const i = new Promise((c) => {
|
|
1589
|
-
r.subscribe(c), o = c;
|
|
1590
|
-
}).then(s);
|
|
1591
|
-
return i.cancel = function() {
|
|
1592
|
-
r.unsubscribe(o);
|
|
1593
|
-
}, i;
|
|
1594
|
-
}, e(function(o, i, c) {
|
|
1595
|
-
r.reason || (r.reason = new H(o, i, c), n(r.reason));
|
|
1596
|
-
});
|
|
1597
|
-
}
|
|
1598
|
-
/**
|
|
1599
|
-
* Throws a `CanceledError` if cancellation has been requested.
|
|
1600
|
-
*/
|
|
1601
|
-
throwIfRequested() {
|
|
1602
|
-
if (this.reason)
|
|
1603
|
-
throw this.reason;
|
|
1604
|
-
}
|
|
1605
|
-
/**
|
|
1606
|
-
* Subscribe to the cancel signal
|
|
1607
|
-
*/
|
|
1608
|
-
subscribe(e) {
|
|
1609
|
-
if (this.reason) {
|
|
1610
|
-
e(this.reason);
|
|
1611
|
-
return;
|
|
1612
|
-
}
|
|
1613
|
-
this._listeners ? this._listeners.push(e) : this._listeners = [e];
|
|
1614
|
-
}
|
|
1615
|
-
/**
|
|
1616
|
-
* Unsubscribe from the cancel signal
|
|
1617
|
-
*/
|
|
1618
|
-
unsubscribe(e) {
|
|
1619
|
-
if (!this._listeners)
|
|
1620
|
-
return;
|
|
1621
|
-
const n = this._listeners.indexOf(e);
|
|
1622
|
-
n !== -1 && this._listeners.splice(n, 1);
|
|
1623
|
-
}
|
|
1624
|
-
toAbortSignal() {
|
|
1625
|
-
const e = new AbortController(), n = (r) => {
|
|
1626
|
-
e.abort(r);
|
|
1627
|
-
};
|
|
1628
|
-
return this.subscribe(n), e.signal.unsubscribe = () => this.unsubscribe(n), e.signal;
|
|
1629
|
-
}
|
|
1630
|
-
/**
|
|
1631
|
-
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
1632
|
-
* cancels the `CancelToken`.
|
|
1633
|
-
*/
|
|
1634
|
-
static source() {
|
|
1635
|
-
let e;
|
|
1636
|
-
return {
|
|
1637
|
-
token: new dt(function(s) {
|
|
1638
|
-
e = s;
|
|
1639
|
-
}),
|
|
1640
|
-
cancel: e
|
|
1641
|
-
};
|
|
1642
|
-
}
|
|
1643
|
-
};
|
|
1644
|
-
function Qn(t) {
|
|
1645
|
-
return function(n) {
|
|
1646
|
-
return t.apply(null, n);
|
|
1647
|
-
};
|
|
1648
|
-
}
|
|
1649
|
-
function Jn(t) {
|
|
1650
|
-
return a.isObject(t) && t.isAxiosError === !0;
|
|
1651
|
-
}
|
|
1652
|
-
const be = {
|
|
1653
|
-
Continue: 100,
|
|
1654
|
-
SwitchingProtocols: 101,
|
|
1655
|
-
Processing: 102,
|
|
1656
|
-
EarlyHints: 103,
|
|
1657
|
-
Ok: 200,
|
|
1658
|
-
Created: 201,
|
|
1659
|
-
Accepted: 202,
|
|
1660
|
-
NonAuthoritativeInformation: 203,
|
|
1661
|
-
NoContent: 204,
|
|
1662
|
-
ResetContent: 205,
|
|
1663
|
-
PartialContent: 206,
|
|
1664
|
-
MultiStatus: 207,
|
|
1665
|
-
AlreadyReported: 208,
|
|
1666
|
-
ImUsed: 226,
|
|
1667
|
-
MultipleChoices: 300,
|
|
1668
|
-
MovedPermanently: 301,
|
|
1669
|
-
Found: 302,
|
|
1670
|
-
SeeOther: 303,
|
|
1671
|
-
NotModified: 304,
|
|
1672
|
-
UseProxy: 305,
|
|
1673
|
-
Unused: 306,
|
|
1674
|
-
TemporaryRedirect: 307,
|
|
1675
|
-
PermanentRedirect: 308,
|
|
1676
|
-
BadRequest: 400,
|
|
1677
|
-
Unauthorized: 401,
|
|
1678
|
-
PaymentRequired: 402,
|
|
1679
|
-
Forbidden: 403,
|
|
1680
|
-
NotFound: 404,
|
|
1681
|
-
MethodNotAllowed: 405,
|
|
1682
|
-
NotAcceptable: 406,
|
|
1683
|
-
ProxyAuthenticationRequired: 407,
|
|
1684
|
-
RequestTimeout: 408,
|
|
1685
|
-
Conflict: 409,
|
|
1686
|
-
Gone: 410,
|
|
1687
|
-
LengthRequired: 411,
|
|
1688
|
-
PreconditionFailed: 412,
|
|
1689
|
-
PayloadTooLarge: 413,
|
|
1690
|
-
UriTooLong: 414,
|
|
1691
|
-
UnsupportedMediaType: 415,
|
|
1692
|
-
RangeNotSatisfiable: 416,
|
|
1693
|
-
ExpectationFailed: 417,
|
|
1694
|
-
ImATeapot: 418,
|
|
1695
|
-
MisdirectedRequest: 421,
|
|
1696
|
-
UnprocessableEntity: 422,
|
|
1697
|
-
Locked: 423,
|
|
1698
|
-
FailedDependency: 424,
|
|
1699
|
-
TooEarly: 425,
|
|
1700
|
-
UpgradeRequired: 426,
|
|
1701
|
-
PreconditionRequired: 428,
|
|
1702
|
-
TooManyRequests: 429,
|
|
1703
|
-
RequestHeaderFieldsTooLarge: 431,
|
|
1704
|
-
UnavailableForLegalReasons: 451,
|
|
1705
|
-
InternalServerError: 500,
|
|
1706
|
-
NotImplemented: 501,
|
|
1707
|
-
BadGateway: 502,
|
|
1708
|
-
ServiceUnavailable: 503,
|
|
1709
|
-
GatewayTimeout: 504,
|
|
1710
|
-
HttpVersionNotSupported: 505,
|
|
1711
|
-
VariantAlsoNegotiates: 506,
|
|
1712
|
-
InsufficientStorage: 507,
|
|
1713
|
-
LoopDetected: 508,
|
|
1714
|
-
NotExtended: 510,
|
|
1715
|
-
NetworkAuthenticationRequired: 511,
|
|
1716
|
-
WebServerIsDown: 521,
|
|
1717
|
-
ConnectionTimedOut: 522,
|
|
1718
|
-
OriginIsUnreachable: 523,
|
|
1719
|
-
TimeoutOccurred: 524,
|
|
1720
|
-
SslHandshakeFailed: 525,
|
|
1721
|
-
InvalidSslCertificate: 526
|
|
1722
|
-
};
|
|
1723
|
-
Object.entries(be).forEach(([t, e]) => {
|
|
1724
|
-
be[e] = t;
|
|
1725
|
-
});
|
|
1726
|
-
function ht(t) {
|
|
1727
|
-
const e = new B(t), n = Je(B.prototype.request, e);
|
|
1728
|
-
return a.extend(n, B.prototype, e, { allOwnKeys: !0 }), a.extend(n, e, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1729
|
-
return ht(D(t, s));
|
|
1730
|
-
}, n;
|
|
1731
|
-
}
|
|
1732
|
-
const w = ht(W);
|
|
1733
|
-
w.Axios = B;
|
|
1734
|
-
w.CanceledError = H;
|
|
1735
|
-
w.CancelToken = Hn;
|
|
1736
|
-
w.isCancel = ot;
|
|
1737
|
-
w.VERSION = ft;
|
|
1738
|
-
w.toFormData = ae;
|
|
1739
|
-
w.AxiosError = y;
|
|
1740
|
-
w.Cancel = w.CanceledError;
|
|
1741
|
-
w.all = function(e) {
|
|
1742
|
-
return Promise.all(e);
|
|
1743
|
-
};
|
|
1744
|
-
w.spread = Qn;
|
|
1745
|
-
w.isAxiosError = Jn;
|
|
1746
|
-
w.mergeConfig = D;
|
|
1747
|
-
w.AxiosHeaders = T;
|
|
1748
|
-
w.formToJSON = (t) => st(a.isHTMLForm(t) ? new FormData(t) : t);
|
|
1749
|
-
w.getAdapter = ut.getAdapter;
|
|
1750
|
-
w.HttpStatusCode = be;
|
|
1751
|
-
w.default = w;
|
|
1752
|
-
const {
|
|
1753
|
-
Axios: Yn,
|
|
1754
|
-
AxiosError: er,
|
|
1755
|
-
CanceledError: tr,
|
|
1756
|
-
isCancel: nr,
|
|
1757
|
-
CancelToken: rr,
|
|
1758
|
-
VERSION: sr,
|
|
1759
|
-
all: or,
|
|
1760
|
-
Cancel: ir,
|
|
1761
|
-
isAxiosError: ar,
|
|
1762
|
-
spread: cr,
|
|
1763
|
-
toFormData: lr,
|
|
1764
|
-
AxiosHeaders: ur,
|
|
1765
|
-
HttpStatusCode: fr,
|
|
1766
|
-
formToJSON: dr,
|
|
1767
|
-
getAdapter: hr,
|
|
1768
|
-
mergeConfig: pr
|
|
1769
|
-
} = w, zn = { Accept: "application/json", "Content-Type": "application/json" };
|
|
1770
|
-
function Vn(t) {
|
|
1771
|
-
return t.data;
|
|
1772
|
-
}
|
|
1773
|
-
class vn {
|
|
6
|
+
class d {
|
|
1774
7
|
/** The root URL for all API requests. */
|
|
1775
8
|
root;
|
|
1776
9
|
/** Axios configuration used for all requests. */
|
|
@@ -1780,12 +13,12 @@ class vn {
|
|
|
1780
13
|
* @param rootUrl - The base URL for the API.
|
|
1781
14
|
* @param config - Optional axios configuration.
|
|
1782
15
|
*/
|
|
1783
|
-
constructor(
|
|
1784
|
-
this.root =
|
|
1785
|
-
...
|
|
16
|
+
constructor(t, e = {}) {
|
|
17
|
+
this.root = t, this.config = {
|
|
18
|
+
...e,
|
|
1786
19
|
headers: {
|
|
1787
|
-
...
|
|
1788
|
-
...
|
|
20
|
+
...p,
|
|
21
|
+
...e.headers || {}
|
|
1789
22
|
}
|
|
1790
23
|
};
|
|
1791
24
|
}
|
|
@@ -1798,9 +31,9 @@ class vn {
|
|
|
1798
31
|
* @param config - Optional axios configuration to override defaults.
|
|
1799
32
|
* @returns A promise that resolves to the response data.
|
|
1800
33
|
*/
|
|
1801
|
-
async request(
|
|
1802
|
-
const
|
|
1803
|
-
return
|
|
34
|
+
async request(t, e, r, s) {
|
|
35
|
+
const n = `${this.root}${e}`, i = { ...this.config, ...s }, c = await (t === "get" || t === "delete" ? y[t](n, i) : y[t](n, r, i));
|
|
36
|
+
return f(c);
|
|
1804
37
|
}
|
|
1805
38
|
/**
|
|
1806
39
|
* Performs a GET request.
|
|
@@ -1809,8 +42,8 @@ class vn {
|
|
|
1809
42
|
* @param config - Optional axios configuration to override defaults.
|
|
1810
43
|
* @returns A promise that resolves to the response data.
|
|
1811
44
|
*/
|
|
1812
|
-
async get(
|
|
1813
|
-
return this.request("get",
|
|
45
|
+
async get(t, e) {
|
|
46
|
+
return this.request("get", t, void 0, e);
|
|
1814
47
|
}
|
|
1815
48
|
/**
|
|
1816
49
|
* Performs a POST request.
|
|
@@ -1821,8 +54,8 @@ class vn {
|
|
|
1821
54
|
* @param config - Optional axios configuration to override defaults.
|
|
1822
55
|
* @returns A promise that resolves to the response data.
|
|
1823
56
|
*/
|
|
1824
|
-
async post(
|
|
1825
|
-
return this.request("post",
|
|
57
|
+
async post(t, e, r) {
|
|
58
|
+
return this.request("post", t, e, r);
|
|
1826
59
|
}
|
|
1827
60
|
/**
|
|
1828
61
|
* Performs a PUT request.
|
|
@@ -1833,8 +66,8 @@ class vn {
|
|
|
1833
66
|
* @param config - Optional axios configuration to override defaults.
|
|
1834
67
|
* @returns A promise that resolves to the response data.
|
|
1835
68
|
*/
|
|
1836
|
-
async put(
|
|
1837
|
-
return this.request("put",
|
|
69
|
+
async put(t, e, r) {
|
|
70
|
+
return this.request("put", t, e, r);
|
|
1838
71
|
}
|
|
1839
72
|
/**
|
|
1840
73
|
* Performs a DELETE request.
|
|
@@ -1843,11 +76,11 @@ class vn {
|
|
|
1843
76
|
* @param config - Optional axios configuration to override defaults.
|
|
1844
77
|
* @returns A promise that resolves to the response data.
|
|
1845
78
|
*/
|
|
1846
|
-
async del(
|
|
1847
|
-
return this.request("delete",
|
|
79
|
+
async del(t, e) {
|
|
80
|
+
return this.request("delete", t, void 0, e);
|
|
1848
81
|
}
|
|
1849
82
|
}
|
|
1850
|
-
const
|
|
83
|
+
const b = [
|
|
1851
84
|
"contains",
|
|
1852
85
|
"contains_nocase",
|
|
1853
86
|
"ends_with",
|
|
@@ -1867,52 +100,53 @@ const Wn = [
|
|
|
1867
100
|
"not",
|
|
1868
101
|
"in",
|
|
1869
102
|
"not_in"
|
|
1870
|
-
],
|
|
1871
|
-
class
|
|
103
|
+
], $ = 1e3, g = 5e3;
|
|
104
|
+
class h {
|
|
1872
105
|
/**
|
|
1873
106
|
* Converts a JSON query object into a GraphQL-compatible string.
|
|
1874
107
|
* Handles nested objects and operator mapping (e.g., $gt -> _gt).
|
|
1875
108
|
* @param query - The JSON filter object to build.
|
|
1876
109
|
* @returns A string representing the GraphQL 'where' or 'block' filter.
|
|
1877
110
|
*/
|
|
1878
|
-
static buildJsonQuery(
|
|
1879
|
-
const
|
|
1880
|
-
for (const r in
|
|
1881
|
-
const s =
|
|
111
|
+
static buildJsonQuery(t) {
|
|
112
|
+
const e = [];
|
|
113
|
+
for (const r in t) {
|
|
114
|
+
const s = t[r];
|
|
1882
115
|
if (s !== void 0)
|
|
1883
116
|
if (s === null)
|
|
1884
|
-
|
|
117
|
+
e.push(`${r}: null`);
|
|
1885
118
|
else if (Array.isArray(s)) {
|
|
1886
|
-
const
|
|
1887
|
-
|
|
119
|
+
const n = s;
|
|
120
|
+
e.push(
|
|
121
|
+
`${r}: [${n.map((i) => typeof i == "string" ? `"${i}"` : i).join(", ")}]`
|
|
122
|
+
);
|
|
1888
123
|
} else if (typeof s == "string")
|
|
1889
|
-
|
|
124
|
+
e.push(`${r}: "${s}"`);
|
|
1890
125
|
else if (typeof s == "object") {
|
|
1891
|
-
const
|
|
1892
|
-
for (const
|
|
1893
|
-
const u = c[
|
|
1894
|
-
if (
|
|
1895
|
-
const
|
|
1896
|
-
|
|
126
|
+
const n = {}, i = {}, c = s;
|
|
127
|
+
for (const l in c) {
|
|
128
|
+
const u = c[l];
|
|
129
|
+
if (l.startsWith("$")) {
|
|
130
|
+
const o = l.slice(1);
|
|
131
|
+
b.includes(o) ? i[`${r}_${o}`] = u : n[l] = u;
|
|
1897
132
|
} else
|
|
1898
|
-
|
|
133
|
+
n[l] = u;
|
|
1899
134
|
}
|
|
1900
|
-
Object.keys(
|
|
135
|
+
Object.keys(n).length > 0 && e.push(`${r}: {${this.buildJsonQuery(n)}}`), Object.keys(i).length > 0 && e.push(this.buildJsonQuery(i));
|
|
1901
136
|
} else
|
|
1902
|
-
|
|
137
|
+
e.push(`${r}: ${s}`);
|
|
1903
138
|
}
|
|
1904
|
-
return
|
|
139
|
+
return e.join(", ");
|
|
1905
140
|
}
|
|
1906
141
|
/**
|
|
1907
142
|
* Builds the fields/elements part of a GraphQL query from an array of strings or objects.
|
|
1908
143
|
* @param elements - An array of fields to query. Can include nested collections as GraphObject.
|
|
1909
144
|
* @returns An array of strings representing the selected fields.
|
|
1910
145
|
*/
|
|
1911
|
-
static buildElements(
|
|
1912
|
-
return
|
|
1913
|
-
if (typeof
|
|
1914
|
-
|
|
1915
|
-
const r = n;
|
|
146
|
+
static buildElements(t) {
|
|
147
|
+
return t.map((e) => {
|
|
148
|
+
if (typeof e == "string") return e;
|
|
149
|
+
const r = e;
|
|
1916
150
|
return this.buildQuery({ collection: r.collection, params: r.params });
|
|
1917
151
|
});
|
|
1918
152
|
}
|
|
@@ -1921,22 +155,22 @@ class Y {
|
|
|
1921
155
|
* @param metadata - The metadata configuration.
|
|
1922
156
|
* @returns A string representing the _meta query fragment.
|
|
1923
157
|
*/
|
|
1924
|
-
static buildMetadata(
|
|
1925
|
-
let
|
|
158
|
+
static buildMetadata(t) {
|
|
159
|
+
let e = "";
|
|
1926
160
|
const r = [];
|
|
1927
|
-
|
|
161
|
+
t.blockQuery && (t.blockQuery.hash && r.push(`hash: "${t.blockQuery.hash}"`), t.blockQuery.number !== void 0 && r.push(`number: ${t.blockQuery.number}`), t.blockQuery.number_gte !== void 0 && r.push(`number_gte: ${t.blockQuery.number_gte}`));
|
|
1928
162
|
const s = r.join(", ");
|
|
1929
|
-
s.length > 0 && (
|
|
1930
|
-
const
|
|
1931
|
-
if (
|
|
1932
|
-
for (const u of
|
|
1933
|
-
u === "deployment" || u === "hasIndexingErrors" ?
|
|
163
|
+
s.length > 0 && (e += `(block: {${s}})`);
|
|
164
|
+
const n = [], i = [];
|
|
165
|
+
if (t.elements) {
|
|
166
|
+
for (const u of t.elements)
|
|
167
|
+
u === "deployment" || u === "hasIndexingErrors" ? n.includes(u) || n.push(u) : i.includes(u) || i.push(u);
|
|
1934
168
|
const c = i.join(" ");
|
|
1935
|
-
c.length > 0 &&
|
|
1936
|
-
const
|
|
1937
|
-
|
|
169
|
+
c.length > 0 && n.push(`block{${c}}`);
|
|
170
|
+
const l = n.join(" ");
|
|
171
|
+
l.length > 0 && (e += `{${l}}`);
|
|
1938
172
|
}
|
|
1939
|
-
return
|
|
173
|
+
return e.length > 0 ? `_meta${e}` : "";
|
|
1940
174
|
}
|
|
1941
175
|
/**
|
|
1942
176
|
* Builds an inline fragment (... on Collection { ... }) for a query.
|
|
@@ -1944,17 +178,17 @@ class Y {
|
|
|
1944
178
|
* @returns A string representing the inline fragment.
|
|
1945
179
|
* @private
|
|
1946
180
|
*/
|
|
1947
|
-
static _buildInlineFragment(
|
|
1948
|
-
const
|
|
1949
|
-
return `... on ${
|
|
181
|
+
static _buildInlineFragment(t) {
|
|
182
|
+
const e = t.params?.elements?.length ? this.buildElements(t.params.elements) : ["id"];
|
|
183
|
+
return `... on ${t.collection}{${e.join(" ")}}`;
|
|
1950
184
|
}
|
|
1951
185
|
/**
|
|
1952
186
|
* Builds multiple inline fragments from an array of fragment configurations.
|
|
1953
187
|
* @param fragments - An array of inline fragments.
|
|
1954
188
|
* @returns A string containing all built inline fragments.
|
|
1955
189
|
*/
|
|
1956
|
-
static buildInlineFragments(
|
|
1957
|
-
return
|
|
190
|
+
static buildInlineFragments(t) {
|
|
191
|
+
return t.map((e) => this._buildInlineFragment(e)).join(" ");
|
|
1958
192
|
}
|
|
1959
193
|
/**
|
|
1960
194
|
* Builds a complete GraphQL query for a single collection.
|
|
@@ -1962,33 +196,33 @@ class Y {
|
|
|
1962
196
|
* @param metadata - Optional metadata configuration.
|
|
1963
197
|
* @returns A string containing the GraphQL query for the collection.
|
|
1964
198
|
*/
|
|
1965
|
-
static buildQuery(
|
|
1966
|
-
const { collection: r, params: s } =
|
|
1967
|
-
if (s?.id !== void 0 &&
|
|
1968
|
-
const
|
|
1969
|
-
|
|
199
|
+
static buildQuery(t, e) {
|
|
200
|
+
const { collection: r, params: s } = t, n = [];
|
|
201
|
+
if (s?.id !== void 0 && n.push(`id: ${s.id}`), s?.orderBy && n.push(`orderBy: ${s.orderBy}`), s?.orderDirection && n.push(`orderDirection: ${s.orderDirection}`), s?.first !== void 0) {
|
|
202
|
+
const o = Math.max(0, Math.min(s.first, $));
|
|
203
|
+
n.push(`first: ${o}`);
|
|
1970
204
|
}
|
|
1971
205
|
if (s?.skip !== void 0) {
|
|
1972
|
-
const
|
|
1973
|
-
|
|
206
|
+
const o = Math.max(0, Math.min(s.skip, g));
|
|
207
|
+
n.push(`skip: ${o}`);
|
|
1974
208
|
}
|
|
1975
209
|
if (s?.where) {
|
|
1976
|
-
const
|
|
1977
|
-
|
|
210
|
+
const o = this.buildJsonQuery(s.where);
|
|
211
|
+
o.length > 0 && n.push(`where: {${o}}`);
|
|
1978
212
|
}
|
|
1979
213
|
if (s?.block) {
|
|
1980
|
-
const
|
|
1981
|
-
|
|
214
|
+
const o = this.buildJsonQuery(s.block);
|
|
215
|
+
o.length > 0 && n.push(`block: {${o}}`);
|
|
1982
216
|
}
|
|
1983
|
-
const i =
|
|
217
|
+
const i = n.length > 0 ? `(${n.join(", ")})` : "";
|
|
1984
218
|
let c = ["id"];
|
|
1985
219
|
s?.elements && s.elements.length > 0 && (c = this.buildElements(s.elements));
|
|
1986
|
-
let
|
|
1987
|
-
s?.inlineFragments && s.inlineFragments.length > 0 && (
|
|
1988
|
-
const u = `${r}${i} {${c.join(" ")}${
|
|
1989
|
-
if (
|
|
1990
|
-
const
|
|
1991
|
-
return
|
|
220
|
+
let l = "";
|
|
221
|
+
s?.inlineFragments && s.inlineFragments.length > 0 && (l = ` ${this.buildInlineFragments(s.inlineFragments)}`);
|
|
222
|
+
const u = `${r}${i} {${c.join(" ")}${l}}`;
|
|
223
|
+
if (e) {
|
|
224
|
+
const o = this.buildMetadata(e);
|
|
225
|
+
return o ? `${o} ${u}` : u;
|
|
1992
226
|
}
|
|
1993
227
|
return u;
|
|
1994
228
|
}
|
|
@@ -1998,11 +232,13 @@ class Y {
|
|
|
1998
232
|
* @param metadata - Optional metadata configuration that applies to the entire query.
|
|
1999
233
|
* @returns A string containing the merged GraphQL query for multiple collections.
|
|
2000
234
|
*/
|
|
2001
|
-
static buildMultipleQuery(
|
|
2002
|
-
const s =
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
235
|
+
static buildMultipleQuery(t, e) {
|
|
236
|
+
const s = t.map(
|
|
237
|
+
(n) => this.buildQuery({ collection: n.collection, params: n.params })
|
|
238
|
+
).join(" ");
|
|
239
|
+
if (e) {
|
|
240
|
+
const n = this.buildMetadata(e);
|
|
241
|
+
return n ? `${n} ${s}` : s;
|
|
2006
242
|
}
|
|
2007
243
|
return s;
|
|
2008
244
|
}
|
|
@@ -2012,11 +248,11 @@ class Y {
|
|
|
2012
248
|
* @param queryName - An optional name for the GraphQL query (defaults to 'query').
|
|
2013
249
|
* @returns The full GraphQL query string.
|
|
2014
250
|
*/
|
|
2015
|
-
static makeFullQuery(
|
|
2016
|
-
return `query ${
|
|
251
|
+
static makeFullQuery(t, e = "query") {
|
|
252
|
+
return `query ${e} {${t}}`;
|
|
2017
253
|
}
|
|
2018
254
|
}
|
|
2019
|
-
class
|
|
255
|
+
class Q extends d {
|
|
2020
256
|
/** The name of the GraphQL query, used in makeFullQuery. */
|
|
2021
257
|
queryName;
|
|
2022
258
|
/**
|
|
@@ -2024,8 +260,8 @@ class mr extends vn {
|
|
|
2024
260
|
* @param rootUrl - The endpoint URL of the subgraph.
|
|
2025
261
|
* @param config - Optional axios configuration for custom headers or timeouts.
|
|
2026
262
|
*/
|
|
2027
|
-
constructor(
|
|
2028
|
-
super(
|
|
263
|
+
constructor(t, e) {
|
|
264
|
+
super(t, e), this.queryName = "query";
|
|
2029
265
|
}
|
|
2030
266
|
/**
|
|
2031
267
|
* Executes a raw GraphQL query string.
|
|
@@ -2034,13 +270,13 @@ class mr extends vn {
|
|
|
2034
270
|
* @returns A promise resolving to the query result.
|
|
2035
271
|
* @throws Error if the response contains any GraphQL errors.
|
|
2036
272
|
*/
|
|
2037
|
-
async stringQuery(
|
|
2038
|
-
const
|
|
2039
|
-
if (
|
|
2040
|
-
const s =
|
|
273
|
+
async stringQuery(t) {
|
|
274
|
+
const e = await this.post("", { query: t });
|
|
275
|
+
if (e && typeof e == "object" && "errors" in e) {
|
|
276
|
+
const s = e.errors.map((n) => n.message).join("; ");
|
|
2041
277
|
throw new Error(`GraphQL Error: ${s}`);
|
|
2042
278
|
}
|
|
2043
|
-
return
|
|
279
|
+
return e.data;
|
|
2044
280
|
}
|
|
2045
281
|
/**
|
|
2046
282
|
* Executes a single collection query using a JSON configuration.
|
|
@@ -2049,9 +285,9 @@ class mr extends vn {
|
|
|
2049
285
|
* @param metadata - Optional metadata fields to include in the query.
|
|
2050
286
|
* @returns A promise resolving to the fetched data.
|
|
2051
287
|
*/
|
|
2052
|
-
async query(
|
|
2053
|
-
const r =
|
|
2054
|
-
return this.stringQuery(
|
|
288
|
+
async query(t, e) {
|
|
289
|
+
const r = h.buildQuery(t, e);
|
|
290
|
+
return this.stringQuery(h.makeFullQuery(r, this.queryName));
|
|
2055
291
|
}
|
|
2056
292
|
/**
|
|
2057
293
|
* Executes multiple collection queries in a single request using JSON configurations.
|
|
@@ -2060,13 +296,13 @@ class mr extends vn {
|
|
|
2060
296
|
* @param metadata - Optional metadata fields to include in the query.
|
|
2061
297
|
* @returns A promise resolving to the merged results of all queries.
|
|
2062
298
|
*/
|
|
2063
|
-
async multipleQuery(
|
|
2064
|
-
const r =
|
|
2065
|
-
return this.stringQuery(
|
|
299
|
+
async multipleQuery(t, e) {
|
|
300
|
+
const r = h.buildMultipleQuery(t, e);
|
|
301
|
+
return this.stringQuery(h.makeFullQuery(r, this.queryName));
|
|
2066
302
|
}
|
|
2067
303
|
}
|
|
2068
304
|
export {
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
305
|
+
Q as EthGraphQuery,
|
|
306
|
+
b as OptionKeys,
|
|
307
|
+
h as QueryBuilder
|
|
2072
308
|
};
|