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