@fuul/sdk 4.12.1 → 4.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/HttpClient.d.ts +11 -10
- package/dist/HttpClient.d.ts.map +1 -1
- package/dist/affiliates/AffiliateService.d.ts.map +1 -1
- package/dist/audiences/AudienceService.d.ts.map +1 -1
- package/dist/index.mjs +379 -331
- package/dist/index.umd.js +5 -5
- package/dist/leaderboard/LeaderboardService.d.ts.map +1 -1
- package/dist/payouts/PayoutService.d.ts.map +1 -1
- package/dist/release.json.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
var Rt = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var R = (e, t, n) =>
|
|
4
|
-
function
|
|
2
|
+
var Tt = (e, t, n) => t in e ? Rt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var R = (e, t, n) => Tt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
function Qe(e, t) {
|
|
5
5
|
return function() {
|
|
6
6
|
return e.apply(t, arguments);
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
const { toString:
|
|
10
|
-
const n =
|
|
9
|
+
const { toString: At } = Object.prototype, { getPrototypeOf: Ee } = Object, te = /* @__PURE__ */ ((e) => (t) => {
|
|
10
|
+
const n = At.call(t);
|
|
11
11
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
12
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
13
|
-
function
|
|
14
|
-
return e !== null && !J(e) && e.constructor !== null && !J(e.constructor) &&
|
|
12
|
+
})(/* @__PURE__ */ Object.create(null)), _ = (e) => (e = e.toLowerCase(), (t) => te(t) === e), ne = (e) => (t) => typeof t === e, { isArray: j } = Array, J = ne("undefined");
|
|
13
|
+
function Pt(e) {
|
|
14
|
+
return e !== null && !J(e) && e.constructor !== null && !J(e.constructor) && O(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
function
|
|
16
|
+
const Ge = _("ArrayBuffer");
|
|
17
|
+
function Ot(e) {
|
|
18
18
|
let t;
|
|
19
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer &&
|
|
19
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Ge(e.buffer), t;
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const _t = ne("string"), O = ne("function"), Xe = ne("number"), re = (e) => e !== null && typeof e == "object", xt = (e) => e === !0 || e === !1, X = (e) => {
|
|
22
22
|
if (te(e) !== "object")
|
|
23
23
|
return !1;
|
|
24
24
|
const t = Ee(e);
|
|
25
25
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
|
|
26
|
-
}, Nt =
|
|
26
|
+
}, Nt = _("Date"), Ut = _("File"), Lt = _("Blob"), Dt = _("FileList"), Ft = (e) => re(e) && O(e.pipe), Bt = (e) => {
|
|
27
27
|
let t;
|
|
28
|
-
return e && (typeof FormData == "function" && e instanceof FormData ||
|
|
29
|
-
t === "object" &&
|
|
30
|
-
},
|
|
28
|
+
return e && (typeof FormData == "function" && e instanceof FormData || O(e.append) && ((t = te(e)) === "formdata" || // detect form-data instance
|
|
29
|
+
t === "object" && O(e.toString) && e.toString() === "[object FormData]"));
|
|
30
|
+
}, kt = _("URLSearchParams"), [vt, qt, It, jt] = ["ReadableStream", "Request", "Response", "Headers"].map(_), Ht = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
31
31
|
function M(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
32
32
|
if (e === null || typeof e > "u")
|
|
33
33
|
return;
|
|
@@ -42,7 +42,7 @@ function M(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
42
42
|
c = o[r], t.call(null, e[c], c, e);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Ye(e, t) {
|
|
46
46
|
t = t.toLowerCase();
|
|
47
47
|
const n = Object.keys(e);
|
|
48
48
|
let r = n.length, s;
|
|
@@ -51,18 +51,18 @@ function Qe(e, t) {
|
|
|
51
51
|
return s;
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
54
|
+
const k = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Ze = (e) => !J(e) && e !== k;
|
|
55
55
|
function de() {
|
|
56
56
|
const { caseless: e } = Ze(this) && this || {}, t = {}, n = (r, s) => {
|
|
57
|
-
const o = e &&
|
|
58
|
-
|
|
57
|
+
const o = e && Ye(t, s) || s;
|
|
58
|
+
X(t[o]) && X(r) ? t[o] = de(t[o], r) : X(r) ? t[o] = de({}, r) : j(r) ? t[o] = r.slice() : t[o] = r;
|
|
59
59
|
};
|
|
60
60
|
for (let r = 0, s = arguments.length; r < s; r++)
|
|
61
61
|
arguments[r] && M(arguments[r], n);
|
|
62
62
|
return t;
|
|
63
63
|
}
|
|
64
|
-
const
|
|
65
|
-
n &&
|
|
64
|
+
const $t = (e, t, n, { allOwnKeys: r } = {}) => (M(t, (s, o) => {
|
|
65
|
+
n && O(s) ? e[o] = Qe(s, n) : e[o] = s;
|
|
66
66
|
}, { allOwnKeys: r }), e), zt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Vt = (e, t, n, r) => {
|
|
67
67
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
68
68
|
value: t.prototype
|
|
@@ -85,30 +85,30 @@ const Ht = (e, t, n, { allOwnKeys: r } = {}) => (M(t, (s, o) => {
|
|
|
85
85
|
if (!e) return null;
|
|
86
86
|
if (j(e)) return e;
|
|
87
87
|
let t = e.length;
|
|
88
|
-
if (!
|
|
88
|
+
if (!Xe(t)) return null;
|
|
89
89
|
const n = new Array(t);
|
|
90
90
|
for (; t-- > 0; )
|
|
91
91
|
n[t] = e[t];
|
|
92
92
|
return n;
|
|
93
|
-
}, Wt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Ee(Uint8Array)),
|
|
93
|
+
}, Wt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Ee(Uint8Array)), Qt = (e, t) => {
|
|
94
94
|
const r = (e && e[Symbol.iterator]).call(e);
|
|
95
95
|
let s;
|
|
96
96
|
for (; (s = r.next()) && !s.done; ) {
|
|
97
97
|
const o = s.value;
|
|
98
98
|
t.call(e, o[0], o[1]);
|
|
99
99
|
}
|
|
100
|
-
},
|
|
100
|
+
}, Gt = (e, t) => {
|
|
101
101
|
let n;
|
|
102
102
|
const r = [];
|
|
103
103
|
for (; (n = e.exec(t)) !== null; )
|
|
104
104
|
r.push(n);
|
|
105
105
|
return r;
|
|
106
|
-
},
|
|
106
|
+
}, Xt = _("HTMLFormElement"), Yt = (e) => e.toLowerCase().replace(
|
|
107
107
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
108
108
|
function(n, r, s) {
|
|
109
109
|
return r.toUpperCase() + s;
|
|
110
110
|
}
|
|
111
|
-
), xe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Zt =
|
|
111
|
+
), xe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Zt = _("RegExp"), et = (e, t) => {
|
|
112
112
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
113
113
|
M(n, (s, o) => {
|
|
114
114
|
let i;
|
|
@@ -116,10 +116,10 @@ const Ht = (e, t, n, { allOwnKeys: r } = {}) => (M(t, (s, o) => {
|
|
|
116
116
|
}), Object.defineProperties(e, r);
|
|
117
117
|
}, en = (e) => {
|
|
118
118
|
et(e, (t, n) => {
|
|
119
|
-
if (
|
|
119
|
+
if (O(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
120
120
|
return !1;
|
|
121
121
|
const r = e[n];
|
|
122
|
-
if (
|
|
122
|
+
if (O(r)) {
|
|
123
123
|
if (t.enumerable = !1, "writable" in t) {
|
|
124
124
|
t.writable = !1;
|
|
125
125
|
return;
|
|
@@ -149,7 +149,7 @@ const Ht = (e, t, n, { allOwnKeys: r } = {}) => (M(t, (s, o) => {
|
|
|
149
149
|
return n;
|
|
150
150
|
};
|
|
151
151
|
function on(e) {
|
|
152
|
-
return !!(e &&
|
|
152
|
+
return !!(e && O(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
|
|
153
153
|
}
|
|
154
154
|
const an = (e) => {
|
|
155
155
|
const t = new Array(10), n = (r, s) => {
|
|
@@ -168,63 +168,63 @@ const an = (e) => {
|
|
|
168
168
|
return r;
|
|
169
169
|
};
|
|
170
170
|
return n(e, 0);
|
|
171
|
-
}, cn =
|
|
172
|
-
s ===
|
|
171
|
+
}, cn = _("AsyncFunction"), un = (e) => e && (re(e) || O(e)) && O(e.then) && O(e.catch), nt = ((e, t) => e ? setImmediate : t ? ((n, r) => (k.addEventListener("message", ({ source: s, data: o }) => {
|
|
172
|
+
s === k && o === n && r.length && r.shift()();
|
|
173
173
|
}, !1), (s) => {
|
|
174
|
-
r.push(s),
|
|
174
|
+
r.push(s), k.postMessage(n, "*");
|
|
175
175
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
176
176
|
typeof setImmediate == "function",
|
|
177
|
-
|
|
178
|
-
), ln = typeof queueMicrotask < "u" ? queueMicrotask.bind(
|
|
177
|
+
O(k.postMessage)
|
|
178
|
+
), ln = typeof queueMicrotask < "u" ? queueMicrotask.bind(k) : typeof process < "u" && process.nextTick || nt, a = {
|
|
179
179
|
isArray: j,
|
|
180
|
-
isArrayBuffer:
|
|
181
|
-
isBuffer:
|
|
180
|
+
isArrayBuffer: Ge,
|
|
181
|
+
isBuffer: Pt,
|
|
182
182
|
isFormData: Bt,
|
|
183
|
-
isArrayBufferView:
|
|
184
|
-
isString:
|
|
185
|
-
isNumber:
|
|
183
|
+
isArrayBufferView: Ot,
|
|
184
|
+
isString: _t,
|
|
185
|
+
isNumber: Xe,
|
|
186
186
|
isBoolean: xt,
|
|
187
187
|
isObject: re,
|
|
188
|
-
isPlainObject:
|
|
189
|
-
isReadableStream:
|
|
190
|
-
isRequest:
|
|
191
|
-
isResponse:
|
|
188
|
+
isPlainObject: X,
|
|
189
|
+
isReadableStream: vt,
|
|
190
|
+
isRequest: qt,
|
|
191
|
+
isResponse: It,
|
|
192
192
|
isHeaders: jt,
|
|
193
193
|
isUndefined: J,
|
|
194
194
|
isDate: Nt,
|
|
195
195
|
isFile: Ut,
|
|
196
196
|
isBlob: Lt,
|
|
197
197
|
isRegExp: Zt,
|
|
198
|
-
isFunction:
|
|
199
|
-
isStream:
|
|
200
|
-
isURLSearchParams:
|
|
198
|
+
isFunction: O,
|
|
199
|
+
isStream: Ft,
|
|
200
|
+
isURLSearchParams: kt,
|
|
201
201
|
isTypedArray: Wt,
|
|
202
|
-
isFileList:
|
|
202
|
+
isFileList: Dt,
|
|
203
203
|
forEach: M,
|
|
204
204
|
merge: de,
|
|
205
|
-
extend:
|
|
206
|
-
trim:
|
|
205
|
+
extend: $t,
|
|
206
|
+
trim: Ht,
|
|
207
207
|
stripBOM: zt,
|
|
208
208
|
inherits: Vt,
|
|
209
209
|
toFlatObject: Kt,
|
|
210
210
|
kindOf: te,
|
|
211
|
-
kindOfTest:
|
|
211
|
+
kindOfTest: _,
|
|
212
212
|
endsWith: Jt,
|
|
213
213
|
toArray: Mt,
|
|
214
|
-
forEachEntry:
|
|
215
|
-
matchAll:
|
|
216
|
-
isHTMLForm:
|
|
214
|
+
forEachEntry: Qt,
|
|
215
|
+
matchAll: Gt,
|
|
216
|
+
isHTMLForm: Xt,
|
|
217
217
|
hasOwnProperty: xe,
|
|
218
218
|
hasOwnProp: xe,
|
|
219
219
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
220
220
|
reduceDescriptors: et,
|
|
221
221
|
freezeMethods: en,
|
|
222
222
|
toObjectSet: tn,
|
|
223
|
-
toCamelCase:
|
|
223
|
+
toCamelCase: Yt,
|
|
224
224
|
noop: nn,
|
|
225
225
|
toFiniteNumber: rn,
|
|
226
|
-
findKey:
|
|
227
|
-
global:
|
|
226
|
+
findKey: Ye,
|
|
227
|
+
global: k,
|
|
228
228
|
isContextDefined: Ze,
|
|
229
229
|
ALPHABET: tt,
|
|
230
230
|
generateString: sn,
|
|
@@ -310,8 +310,8 @@ function se(e, t, n) {
|
|
|
310
310
|
metaTokens: !0,
|
|
311
311
|
dots: !1,
|
|
312
312
|
indexes: !1
|
|
313
|
-
}, !1, function(
|
|
314
|
-
return !a.isUndefined(p[
|
|
313
|
+
}, !1, function(y, p) {
|
|
314
|
+
return !a.isUndefined(p[y]);
|
|
315
315
|
});
|
|
316
316
|
const r = n.metaTokens, s = n.visitor || l, o = n.dots, i = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
|
|
317
317
|
if (!a.isFunction(s))
|
|
@@ -324,39 +324,39 @@ function se(e, t, n) {
|
|
|
324
324
|
throw new m("Blob is not supported. Use a Buffer instead.");
|
|
325
325
|
return a.isArrayBuffer(h) || a.isTypedArray(h) ? f && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
|
|
326
326
|
}
|
|
327
|
-
function l(h,
|
|
327
|
+
function l(h, y, p) {
|
|
328
328
|
let w = h;
|
|
329
329
|
if (h && !p && typeof h == "object") {
|
|
330
|
-
if (a.endsWith(
|
|
331
|
-
|
|
332
|
-
else if (a.isArray(h) && dn(h) || (a.isFileList(h) || a.endsWith(
|
|
333
|
-
return
|
|
330
|
+
if (a.endsWith(y, "{}"))
|
|
331
|
+
y = r ? y : y.slice(0, -2), h = JSON.stringify(h);
|
|
332
|
+
else if (a.isArray(h) && dn(h) || (a.isFileList(h) || a.endsWith(y, "[]")) && (w = a.toArray(h)))
|
|
333
|
+
return y = ot(y), w.forEach(function(C, N) {
|
|
334
334
|
!(a.isUndefined(C) || C === null) && t.append(
|
|
335
335
|
// eslint-disable-next-line no-nested-ternary
|
|
336
|
-
i === !0 ? Ue([
|
|
336
|
+
i === !0 ? Ue([y], N, o) : i === null ? y : y + "[]",
|
|
337
337
|
u(C)
|
|
338
338
|
);
|
|
339
339
|
}), !1;
|
|
340
340
|
}
|
|
341
|
-
return he(h) ? !0 : (t.append(Ue(p,
|
|
341
|
+
return he(h) ? !0 : (t.append(Ue(p, y, o), u(h)), !1);
|
|
342
342
|
}
|
|
343
|
-
const d = [],
|
|
343
|
+
const d = [], g = Object.assign(hn, {
|
|
344
344
|
defaultVisitor: l,
|
|
345
345
|
convertValue: u,
|
|
346
346
|
isVisitable: he
|
|
347
347
|
});
|
|
348
|
-
function E(h,
|
|
348
|
+
function E(h, y) {
|
|
349
349
|
if (!a.isUndefined(h)) {
|
|
350
350
|
if (d.indexOf(h) !== -1)
|
|
351
|
-
throw Error("Circular reference detected in " +
|
|
351
|
+
throw Error("Circular reference detected in " + y.join("."));
|
|
352
352
|
d.push(h), a.forEach(h, function(w, S) {
|
|
353
353
|
(!(a.isUndefined(w) || w === null) && s.call(
|
|
354
354
|
t,
|
|
355
355
|
w,
|
|
356
356
|
a.isString(S) ? S.trim() : S,
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
)) === !0 && E(w,
|
|
357
|
+
y,
|
|
358
|
+
g
|
|
359
|
+
)) === !0 && E(w, y ? y.concat(S) : [S]);
|
|
360
360
|
}), d.pop();
|
|
361
361
|
}
|
|
362
362
|
}
|
|
@@ -407,7 +407,7 @@ function at(e, t, n) {
|
|
|
407
407
|
}
|
|
408
408
|
return e;
|
|
409
409
|
}
|
|
410
|
-
class
|
|
410
|
+
class De {
|
|
411
411
|
constructor() {
|
|
412
412
|
this.handlers = [];
|
|
413
413
|
}
|
|
@@ -465,12 +465,12 @@ const ct = {
|
|
|
465
465
|
silentJSONParsing: !0,
|
|
466
466
|
forcedJSONParsing: !0,
|
|
467
467
|
clarifyTimeoutError: !1
|
|
468
|
-
}, mn = typeof URLSearchParams < "u" ? URLSearchParams : Se,
|
|
468
|
+
}, mn = typeof URLSearchParams < "u" ? URLSearchParams : Se, yn = typeof FormData < "u" ? FormData : null, gn = typeof Blob < "u" ? Blob : null, wn = {
|
|
469
469
|
isBrowser: !0,
|
|
470
470
|
classes: {
|
|
471
471
|
URLSearchParams: mn,
|
|
472
|
-
FormData:
|
|
473
|
-
Blob:
|
|
472
|
+
FormData: yn,
|
|
473
|
+
Blob: gn
|
|
474
474
|
},
|
|
475
475
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
476
476
|
}, Ce = typeof window < "u" && typeof document < "u", pe = typeof navigator == "object" && navigator || void 0, bn = Ce && (!pe || ["ReactNative", "NativeScript", "NS"].indexOf(pe.product) < 0), En = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
@@ -481,21 +481,21 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Sn
|
|
|
481
481
|
hasStandardBrowserWebWorkerEnv: En,
|
|
482
482
|
navigator: pe,
|
|
483
483
|
origin: Sn
|
|
484
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
484
|
+
}, Symbol.toStringTag, { value: "Module" })), A = {
|
|
485
485
|
...Cn,
|
|
486
486
|
...wn
|
|
487
487
|
};
|
|
488
488
|
function Rn(e, t) {
|
|
489
|
-
return se(e, new
|
|
489
|
+
return se(e, new A.classes.URLSearchParams(), Object.assign({
|
|
490
490
|
visitor: function(n, r, s, o) {
|
|
491
|
-
return
|
|
491
|
+
return A.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
492
492
|
}
|
|
493
493
|
}, t));
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Tn(e) {
|
|
496
496
|
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function An(e) {
|
|
499
499
|
const t = {}, n = Object.keys(e);
|
|
500
500
|
let r;
|
|
501
501
|
const s = n.length;
|
|
@@ -509,17 +509,17 @@ function ut(e) {
|
|
|
509
509
|
let i = n[o++];
|
|
510
510
|
if (i === "__proto__") return !0;
|
|
511
511
|
const c = Number.isFinite(+i), f = o >= n.length;
|
|
512
|
-
return i = !i && a.isArray(s) ? s.length : i, f ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] =
|
|
512
|
+
return i = !i && a.isArray(s) ? s.length : i, f ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = An(s[i])), !c);
|
|
513
513
|
}
|
|
514
514
|
if (a.isFormData(e) && a.isFunction(e.entries)) {
|
|
515
515
|
const n = {};
|
|
516
516
|
return a.forEachEntry(e, (r, s) => {
|
|
517
|
-
t(
|
|
517
|
+
t(Tn(r), s, n, 0);
|
|
518
518
|
}), n;
|
|
519
519
|
}
|
|
520
520
|
return null;
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function Pn(e, t, n) {
|
|
523
523
|
if (a.isString(e))
|
|
524
524
|
try {
|
|
525
525
|
return (t || JSON.parse)(e), a.trim(e);
|
|
@@ -555,7 +555,7 @@ const W = {
|
|
|
555
555
|
);
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
|
-
return o || s ? (n.setContentType("application/json", !1),
|
|
558
|
+
return o || s ? (n.setContentType("application/json", !1), Pn(t)) : t;
|
|
559
559
|
}],
|
|
560
560
|
transformResponse: [function(t) {
|
|
561
561
|
const n = this.transitional || W.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
|
|
@@ -582,8 +582,8 @@ const W = {
|
|
|
582
582
|
maxContentLength: -1,
|
|
583
583
|
maxBodyLength: -1,
|
|
584
584
|
env: {
|
|
585
|
-
FormData:
|
|
586
|
-
Blob:
|
|
585
|
+
FormData: A.classes.FormData,
|
|
586
|
+
Blob: A.classes.Blob
|
|
587
587
|
},
|
|
588
588
|
validateStatus: function(t) {
|
|
589
589
|
return t >= 200 && t < 300;
|
|
@@ -598,7 +598,7 @@ const W = {
|
|
|
598
598
|
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
599
599
|
W.headers[e] = {};
|
|
600
600
|
});
|
|
601
|
-
const
|
|
601
|
+
const On = a.toObjectSet([
|
|
602
602
|
"age",
|
|
603
603
|
"authorization",
|
|
604
604
|
"content-length",
|
|
@@ -616,19 +616,19 @@ const _n = a.toObjectSet([
|
|
|
616
616
|
"referer",
|
|
617
617
|
"retry-after",
|
|
618
618
|
"user-agent"
|
|
619
|
-
]),
|
|
619
|
+
]), _n = (e) => {
|
|
620
620
|
const t = {};
|
|
621
621
|
let n, r, s;
|
|
622
622
|
return e && e.split(`
|
|
623
623
|
`).forEach(function(i) {
|
|
624
|
-
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] &&
|
|
624
|
+
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && On[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
625
625
|
}), t;
|
|
626
|
-
},
|
|
626
|
+
}, Fe = Symbol("internals");
|
|
627
627
|
function V(e) {
|
|
628
628
|
return e && String(e).trim().toLowerCase();
|
|
629
629
|
}
|
|
630
|
-
function
|
|
631
|
-
return e === !1 || e == null ? e : a.isArray(e) ? e.map(
|
|
630
|
+
function Y(e) {
|
|
631
|
+
return e === !1 || e == null ? e : a.isArray(e) ? e.map(Y) : String(e);
|
|
632
632
|
}
|
|
633
633
|
function xn(e) {
|
|
634
634
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
@@ -662,7 +662,7 @@ function Ln(e, t) {
|
|
|
662
662
|
});
|
|
663
663
|
});
|
|
664
664
|
}
|
|
665
|
-
let
|
|
665
|
+
let P = class {
|
|
666
666
|
constructor(t) {
|
|
667
667
|
t && this.set(t);
|
|
668
668
|
}
|
|
@@ -673,13 +673,13 @@ let O = class {
|
|
|
673
673
|
if (!l)
|
|
674
674
|
throw new Error("header name must be a non-empty string");
|
|
675
675
|
const d = a.findKey(s, l);
|
|
676
|
-
(!d || s[d] === void 0 || u === !0 || u === void 0 && s[d] !== !1) && (s[d || f] =
|
|
676
|
+
(!d || s[d] === void 0 || u === !0 || u === void 0 && s[d] !== !1) && (s[d || f] = Y(c));
|
|
677
677
|
}
|
|
678
678
|
const i = (c, f) => a.forEach(c, (u, l) => o(u, l, f));
|
|
679
679
|
if (a.isPlainObject(t) || t instanceof this.constructor)
|
|
680
680
|
i(t, n);
|
|
681
681
|
else if (a.isString(t) && (t = t.trim()) && !Nn(t))
|
|
682
|
-
i(
|
|
682
|
+
i(_n(t), n);
|
|
683
683
|
else if (a.isHeaders(t))
|
|
684
684
|
for (const [c, f] of t.entries())
|
|
685
685
|
o(f, c, r);
|
|
@@ -736,11 +736,11 @@ let O = class {
|
|
|
736
736
|
return a.forEach(this, (s, o) => {
|
|
737
737
|
const i = a.findKey(r, o);
|
|
738
738
|
if (i) {
|
|
739
|
-
n[i] =
|
|
739
|
+
n[i] = Y(s), delete n[o];
|
|
740
740
|
return;
|
|
741
741
|
}
|
|
742
742
|
const c = t ? Un(o) : String(o).trim();
|
|
743
|
-
c !== o && delete n[o], n[c] =
|
|
743
|
+
c !== o && delete n[o], n[c] = Y(s), r[c] = !0;
|
|
744
744
|
}), this;
|
|
745
745
|
}
|
|
746
746
|
concat(...t) {
|
|
@@ -770,7 +770,7 @@ let O = class {
|
|
|
770
770
|
return n.forEach((s) => r.set(s)), r;
|
|
771
771
|
}
|
|
772
772
|
static accessor(t) {
|
|
773
|
-
const r = (this[
|
|
773
|
+
const r = (this[Fe] = this[Fe] = {
|
|
774
774
|
accessors: {}
|
|
775
775
|
}).accessors, s = this.prototype;
|
|
776
776
|
function o(i) {
|
|
@@ -780,8 +780,8 @@ let O = class {
|
|
|
780
780
|
return a.isArray(t) ? t.forEach(o) : o(t), this;
|
|
781
781
|
}
|
|
782
782
|
};
|
|
783
|
-
|
|
784
|
-
a.reduceDescriptors(
|
|
783
|
+
P.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
784
|
+
a.reduceDescriptors(P.prototype, ({ value: e }, t) => {
|
|
785
785
|
let n = t[0].toUpperCase() + t.slice(1);
|
|
786
786
|
return {
|
|
787
787
|
get: () => e,
|
|
@@ -790,9 +790,9 @@ a.reduceDescriptors(O.prototype, ({ value: e }, t) => {
|
|
|
790
790
|
}
|
|
791
791
|
};
|
|
792
792
|
});
|
|
793
|
-
a.freezeMethods(
|
|
793
|
+
a.freezeMethods(P);
|
|
794
794
|
function le(e, t) {
|
|
795
|
-
const n = this || W, r = t || n, s =
|
|
795
|
+
const n = this || W, r = t || n, s = P.from(r.headers);
|
|
796
796
|
let o = r.data;
|
|
797
797
|
return a.forEach(e, function(c) {
|
|
798
798
|
o = c.call(n, o, s.normalize(), t ? t.status : void 0);
|
|
@@ -801,10 +801,10 @@ function le(e, t) {
|
|
|
801
801
|
function lt(e) {
|
|
802
802
|
return !!(e && e.__CANCEL__);
|
|
803
803
|
}
|
|
804
|
-
function
|
|
804
|
+
function H(e, t, n) {
|
|
805
805
|
m.call(this, e ?? "canceled", m.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
806
806
|
}
|
|
807
|
-
a.inherits(
|
|
807
|
+
a.inherits(H, m, {
|
|
808
808
|
__CANCEL__: !0
|
|
809
809
|
});
|
|
810
810
|
function ft(e, t, n) {
|
|
@@ -817,24 +817,24 @@ function ft(e, t, n) {
|
|
|
817
817
|
n
|
|
818
818
|
));
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function Dn(e) {
|
|
821
821
|
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
822
822
|
return t && t[1] || "";
|
|
823
823
|
}
|
|
824
|
-
function
|
|
824
|
+
function Fn(e, t) {
|
|
825
825
|
e = e || 10;
|
|
826
826
|
const n = new Array(e), r = new Array(e);
|
|
827
827
|
let s = 0, o = 0, i;
|
|
828
828
|
return t = t !== void 0 ? t : 1e3, function(f) {
|
|
829
829
|
const u = Date.now(), l = r[o];
|
|
830
830
|
i || (i = u), n[s] = f, r[s] = u;
|
|
831
|
-
let d = o,
|
|
831
|
+
let d = o, g = 0;
|
|
832
832
|
for (; d !== s; )
|
|
833
|
-
|
|
833
|
+
g += n[d++], d = d % e;
|
|
834
834
|
if (s = (s + 1) % e, s === o && (o = (o + 1) % e), u - i < t)
|
|
835
835
|
return;
|
|
836
836
|
const E = l && u - l;
|
|
837
|
-
return E ? Math.round(
|
|
837
|
+
return E ? Math.round(g * 1e3 / E) : void 0;
|
|
838
838
|
};
|
|
839
839
|
}
|
|
840
840
|
function Bn(e, t) {
|
|
@@ -851,7 +851,7 @@ function Bn(e, t) {
|
|
|
851
851
|
}
|
|
852
852
|
const Z = (e, t, n = 3) => {
|
|
853
853
|
let r = 0;
|
|
854
|
-
const s =
|
|
854
|
+
const s = Fn(50, 250);
|
|
855
855
|
return Bn((o) => {
|
|
856
856
|
const i = o.loaded, c = o.lengthComputable ? o.total : void 0, f = i - r, u = s(f), l = i <= c;
|
|
857
857
|
r = i;
|
|
@@ -875,11 +875,11 @@ const Z = (e, t, n = 3) => {
|
|
|
875
875
|
total: e,
|
|
876
876
|
loaded: r
|
|
877
877
|
}), t[1]];
|
|
878
|
-
},
|
|
878
|
+
}, ke = (e) => (...t) => a.asap(() => e(...t)), kn = A.hasStandardBrowserEnv ? (
|
|
879
879
|
// Standard browser envs have full support of the APIs needed to test
|
|
880
880
|
// whether the request URL is of the same origin as current location.
|
|
881
881
|
function() {
|
|
882
|
-
const t =
|
|
882
|
+
const t = A.navigator && /(msie|trident)/i.test(A.navigator.userAgent), n = document.createElement("a");
|
|
883
883
|
let r;
|
|
884
884
|
function s(o) {
|
|
885
885
|
let i = o;
|
|
@@ -906,7 +906,7 @@ const Z = (e, t, n = 3) => {
|
|
|
906
906
|
return !0;
|
|
907
907
|
};
|
|
908
908
|
}()
|
|
909
|
-
),
|
|
909
|
+
), vn = A.hasStandardBrowserEnv ? (
|
|
910
910
|
// Standard browser envs support document.cookie
|
|
911
911
|
{
|
|
912
912
|
write(e, t, n, r, s, o) {
|
|
@@ -933,17 +933,17 @@ const Z = (e, t, n = 3) => {
|
|
|
933
933
|
}
|
|
934
934
|
}
|
|
935
935
|
);
|
|
936
|
-
function
|
|
936
|
+
function qn(e) {
|
|
937
937
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
938
938
|
}
|
|
939
|
-
function
|
|
939
|
+
function In(e, t) {
|
|
940
940
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
941
941
|
}
|
|
942
942
|
function dt(e, t) {
|
|
943
|
-
return e && !
|
|
943
|
+
return e && !qn(t) ? In(e, t) : t;
|
|
944
944
|
}
|
|
945
|
-
const
|
|
946
|
-
function
|
|
945
|
+
const ve = (e) => e instanceof P ? { ...e } : e;
|
|
946
|
+
function q(e, t) {
|
|
947
947
|
t = t || {};
|
|
948
948
|
const n = {};
|
|
949
949
|
function r(u, l, d) {
|
|
@@ -1000,41 +1000,41 @@ function I(e, t) {
|
|
|
1000
1000
|
socketPath: i,
|
|
1001
1001
|
responseEncoding: i,
|
|
1002
1002
|
validateStatus: c,
|
|
1003
|
-
headers: (u, l) => s(
|
|
1003
|
+
headers: (u, l) => s(ve(u), ve(l), !0)
|
|
1004
1004
|
};
|
|
1005
1005
|
return a.forEach(Object.keys(Object.assign({}, e, t)), function(l) {
|
|
1006
|
-
const d = f[l] || s,
|
|
1007
|
-
a.isUndefined(
|
|
1006
|
+
const d = f[l] || s, g = d(e[l], t[l], l);
|
|
1007
|
+
a.isUndefined(g) && d !== c || (n[l] = g);
|
|
1008
1008
|
}), n;
|
|
1009
1009
|
}
|
|
1010
1010
|
const ht = (e) => {
|
|
1011
|
-
const t =
|
|
1011
|
+
const t = q({}, e);
|
|
1012
1012
|
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = t;
|
|
1013
|
-
t.headers = i =
|
|
1013
|
+
t.headers = i = P.from(i), t.url = at(dt(t.baseURL, t.url), e.params, e.paramsSerializer), c && i.set(
|
|
1014
1014
|
"Authorization",
|
|
1015
1015
|
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1016
1016
|
);
|
|
1017
1017
|
let f;
|
|
1018
1018
|
if (a.isFormData(n)) {
|
|
1019
|
-
if (
|
|
1019
|
+
if (A.hasStandardBrowserEnv || A.hasStandardBrowserWebWorkerEnv)
|
|
1020
1020
|
i.setContentType(void 0);
|
|
1021
1021
|
else if ((f = i.getContentType()) !== !1) {
|
|
1022
1022
|
const [u, ...l] = f ? f.split(";").map((d) => d.trim()).filter(Boolean) : [];
|
|
1023
1023
|
i.setContentType([u || "multipart/form-data", ...l].join("; "));
|
|
1024
1024
|
}
|
|
1025
1025
|
}
|
|
1026
|
-
if (
|
|
1027
|
-
const u = s && o &&
|
|
1026
|
+
if (A.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && kn(t.url))) {
|
|
1027
|
+
const u = s && o && vn.read(o);
|
|
1028
1028
|
u && i.set(s, u);
|
|
1029
1029
|
}
|
|
1030
1030
|
return t;
|
|
1031
|
-
}, jn = typeof XMLHttpRequest < "u",
|
|
1031
|
+
}, jn = typeof XMLHttpRequest < "u", Hn = jn && function(e) {
|
|
1032
1032
|
return new Promise(function(n, r) {
|
|
1033
1033
|
const s = ht(e);
|
|
1034
1034
|
let o = s.data;
|
|
1035
|
-
const i =
|
|
1036
|
-
let { responseType: c, onUploadProgress: f, onDownloadProgress: u } = s, l, d,
|
|
1037
|
-
function
|
|
1035
|
+
const i = P.from(s.headers).normalize();
|
|
1036
|
+
let { responseType: c, onUploadProgress: f, onDownloadProgress: u } = s, l, d, g, E, h;
|
|
1037
|
+
function y() {
|
|
1038
1038
|
E && E(), h && h(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
|
|
1039
1039
|
}
|
|
1040
1040
|
let p = new XMLHttpRequest();
|
|
@@ -1042,9 +1042,9 @@ const ht = (e) => {
|
|
|
1042
1042
|
function w() {
|
|
1043
1043
|
if (!p)
|
|
1044
1044
|
return;
|
|
1045
|
-
const C =
|
|
1045
|
+
const C = P.from(
|
|
1046
1046
|
"getAllResponseHeaders" in p && p.getAllResponseHeaders()
|
|
1047
|
-
),
|
|
1047
|
+
), T = {
|
|
1048
1048
|
data: !c || c === "text" || c === "json" ? p.responseText : p.response,
|
|
1049
1049
|
status: p.status,
|
|
1050
1050
|
statusText: p.statusText,
|
|
@@ -1052,11 +1052,11 @@ const ht = (e) => {
|
|
|
1052
1052
|
config: e,
|
|
1053
1053
|
request: p
|
|
1054
1054
|
};
|
|
1055
|
-
ft(function(
|
|
1056
|
-
n(
|
|
1057
|
-
}, function(
|
|
1058
|
-
r(
|
|
1059
|
-
},
|
|
1055
|
+
ft(function(F) {
|
|
1056
|
+
n(F), y();
|
|
1057
|
+
}, function(F) {
|
|
1058
|
+
r(F), y();
|
|
1059
|
+
}, T), p = null;
|
|
1060
1060
|
}
|
|
1061
1061
|
"onloadend" in p ? p.onloadend = w : p.onreadystatechange = function() {
|
|
1062
1062
|
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(w);
|
|
@@ -1066,26 +1066,26 @@ const ht = (e) => {
|
|
|
1066
1066
|
r(new m("Network Error", m.ERR_NETWORK, e, p)), p = null;
|
|
1067
1067
|
}, p.ontimeout = function() {
|
|
1068
1068
|
let N = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1069
|
-
const
|
|
1069
|
+
const T = s.transitional || ct;
|
|
1070
1070
|
s.timeoutErrorMessage && (N = s.timeoutErrorMessage), r(new m(
|
|
1071
1071
|
N,
|
|
1072
|
-
|
|
1072
|
+
T.clarifyTimeoutError ? m.ETIMEDOUT : m.ECONNABORTED,
|
|
1073
1073
|
e,
|
|
1074
1074
|
p
|
|
1075
1075
|
)), p = null;
|
|
1076
|
-
}, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(N,
|
|
1077
|
-
p.setRequestHeader(
|
|
1078
|
-
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([
|
|
1079
|
-
p && (r(!C || C.type ? new
|
|
1076
|
+
}, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(N, T) {
|
|
1077
|
+
p.setRequestHeader(T, N);
|
|
1078
|
+
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([g, h] = Z(u, !0), p.addEventListener("progress", g)), f && p.upload && ([d, E] = Z(f), p.upload.addEventListener("progress", d), p.upload.addEventListener("loadend", E)), (s.cancelToken || s.signal) && (l = (C) => {
|
|
1079
|
+
p && (r(!C || C.type ? new H(null, e, p) : C), p.abort(), p = null);
|
|
1080
1080
|
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
|
|
1081
|
-
const S =
|
|
1082
|
-
if (S &&
|
|
1081
|
+
const S = Dn(s.url);
|
|
1082
|
+
if (S && A.protocols.indexOf(S) === -1) {
|
|
1083
1083
|
r(new m("Unsupported protocol " + S + ":", m.ERR_BAD_REQUEST, e));
|
|
1084
1084
|
return;
|
|
1085
1085
|
}
|
|
1086
1086
|
p.send(o || null);
|
|
1087
1087
|
});
|
|
1088
|
-
},
|
|
1088
|
+
}, $n = (e, t) => {
|
|
1089
1089
|
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
1090
1090
|
if (t || n) {
|
|
1091
1091
|
let r = new AbortController(), s;
|
|
@@ -1093,7 +1093,7 @@ const ht = (e) => {
|
|
|
1093
1093
|
if (!s) {
|
|
1094
1094
|
s = !0, c();
|
|
1095
1095
|
const l = u instanceof Error ? u : this.reason;
|
|
1096
|
-
r.abort(l instanceof m ? l : new
|
|
1096
|
+
r.abort(l instanceof m ? l : new H(l instanceof Error ? l.message : l));
|
|
1097
1097
|
}
|
|
1098
1098
|
};
|
|
1099
1099
|
let i = t && setTimeout(() => {
|
|
@@ -1136,7 +1136,7 @@ const ht = (e) => {
|
|
|
1136
1136
|
} finally {
|
|
1137
1137
|
await t.cancel();
|
|
1138
1138
|
}
|
|
1139
|
-
},
|
|
1139
|
+
}, qe = (e, t, n, r) => {
|
|
1140
1140
|
const s = Vn(e, t);
|
|
1141
1141
|
let o = 0, i, c = (f) => {
|
|
1142
1142
|
i || (i = !0, r && r(f));
|
|
@@ -1151,8 +1151,8 @@ const ht = (e) => {
|
|
|
1151
1151
|
}
|
|
1152
1152
|
let d = l.byteLength;
|
|
1153
1153
|
if (n) {
|
|
1154
|
-
let
|
|
1155
|
-
n(
|
|
1154
|
+
let g = o += d;
|
|
1155
|
+
n(g);
|
|
1156
1156
|
}
|
|
1157
1157
|
f.enqueue(new Uint8Array(l));
|
|
1158
1158
|
} catch (u) {
|
|
@@ -1173,7 +1173,7 @@ const ht = (e) => {
|
|
|
1173
1173
|
}
|
|
1174
1174
|
}, Mn = pt && mt(() => {
|
|
1175
1175
|
let e = !1;
|
|
1176
|
-
const t = new Request(
|
|
1176
|
+
const t = new Request(A.origin, {
|
|
1177
1177
|
body: new ReadableStream(),
|
|
1178
1178
|
method: "POST",
|
|
1179
1179
|
get duplex() {
|
|
@@ -1181,7 +1181,7 @@ const ht = (e) => {
|
|
|
1181
1181
|
}
|
|
1182
1182
|
}).headers.has("Content-Type");
|
|
1183
1183
|
return e && !t;
|
|
1184
|
-
}),
|
|
1184
|
+
}), Ie = 64 * 1024, me = pt && mt(() => a.isReadableStream(new Response("").body)), ee = {
|
|
1185
1185
|
stream: me && ((e) => e.body)
|
|
1186
1186
|
};
|
|
1187
1187
|
oe && ((e) => {
|
|
@@ -1197,7 +1197,7 @@ const Wn = async (e) => {
|
|
|
1197
1197
|
if (a.isBlob(e))
|
|
1198
1198
|
return e.size;
|
|
1199
1199
|
if (a.isSpecCompliantForm(e))
|
|
1200
|
-
return (await new Request(
|
|
1200
|
+
return (await new Request(A.origin, {
|
|
1201
1201
|
method: "POST",
|
|
1202
1202
|
body: e
|
|
1203
1203
|
}).arrayBuffer()).byteLength;
|
|
@@ -1205,10 +1205,10 @@ const Wn = async (e) => {
|
|
|
1205
1205
|
return e.byteLength;
|
|
1206
1206
|
if (a.isURLSearchParams(e) && (e = e + ""), a.isString(e))
|
|
1207
1207
|
return (await Jn(e)).byteLength;
|
|
1208
|
-
},
|
|
1208
|
+
}, Qn = async (e, t) => {
|
|
1209
1209
|
const n = a.toFiniteNumber(e.getContentLength());
|
|
1210
1210
|
return n ?? Wn(t);
|
|
1211
|
-
},
|
|
1211
|
+
}, Gn = oe && (async (e) => {
|
|
1212
1212
|
let {
|
|
1213
1213
|
url: t,
|
|
1214
1214
|
method: n,
|
|
@@ -1221,33 +1221,33 @@ const Wn = async (e) => {
|
|
|
1221
1221
|
responseType: u,
|
|
1222
1222
|
headers: l,
|
|
1223
1223
|
withCredentials: d = "same-origin",
|
|
1224
|
-
fetchOptions:
|
|
1224
|
+
fetchOptions: g
|
|
1225
1225
|
} = ht(e);
|
|
1226
1226
|
u = u ? (u + "").toLowerCase() : "text";
|
|
1227
|
-
let E =
|
|
1228
|
-
const
|
|
1227
|
+
let E = $n([s, o && o.toAbortSignal()], i), h;
|
|
1228
|
+
const y = E && E.unsubscribe && (() => {
|
|
1229
1229
|
E.unsubscribe();
|
|
1230
1230
|
});
|
|
1231
1231
|
let p;
|
|
1232
1232
|
try {
|
|
1233
|
-
if (f && Mn && n !== "get" && n !== "head" && (p = await
|
|
1234
|
-
let
|
|
1233
|
+
if (f && Mn && n !== "get" && n !== "head" && (p = await Qn(l, r)) !== 0) {
|
|
1234
|
+
let T = new Request(t, {
|
|
1235
1235
|
method: "POST",
|
|
1236
1236
|
body: r,
|
|
1237
1237
|
duplex: "half"
|
|
1238
1238
|
}), U;
|
|
1239
|
-
if (a.isFormData(r) && (U =
|
|
1240
|
-
const [
|
|
1239
|
+
if (a.isFormData(r) && (U = T.headers.get("content-type")) && l.setContentType(U), T.body) {
|
|
1240
|
+
const [F, Q] = Be(
|
|
1241
1241
|
p,
|
|
1242
|
-
Z(
|
|
1242
|
+
Z(ke(f))
|
|
1243
1243
|
);
|
|
1244
|
-
r =
|
|
1244
|
+
r = qe(T.body, Ie, F, Q);
|
|
1245
1245
|
}
|
|
1246
1246
|
}
|
|
1247
1247
|
a.isString(d) || (d = d ? "include" : "omit");
|
|
1248
1248
|
const w = "credentials" in Request.prototype;
|
|
1249
1249
|
h = new Request(t, {
|
|
1250
|
-
...
|
|
1250
|
+
...g,
|
|
1251
1251
|
signal: E,
|
|
1252
1252
|
method: n.toUpperCase(),
|
|
1253
1253
|
headers: l.normalize().toJSON(),
|
|
@@ -1257,28 +1257,28 @@ const Wn = async (e) => {
|
|
|
1257
1257
|
});
|
|
1258
1258
|
let S = await fetch(h);
|
|
1259
1259
|
const C = me && (u === "stream" || u === "response");
|
|
1260
|
-
if (me && (c || C &&
|
|
1261
|
-
const
|
|
1262
|
-
["status", "statusText", "headers"].forEach((
|
|
1263
|
-
|
|
1260
|
+
if (me && (c || C && y)) {
|
|
1261
|
+
const T = {};
|
|
1262
|
+
["status", "statusText", "headers"].forEach((_e) => {
|
|
1263
|
+
T[_e] = S[_e];
|
|
1264
1264
|
});
|
|
1265
|
-
const U = a.toFiniteNumber(S.headers.get("content-length")), [
|
|
1265
|
+
const U = a.toFiniteNumber(S.headers.get("content-length")), [F, Q] = c && Be(
|
|
1266
1266
|
U,
|
|
1267
|
-
Z(
|
|
1267
|
+
Z(ke(c), !0)
|
|
1268
1268
|
) || [];
|
|
1269
1269
|
S = new Response(
|
|
1270
|
-
|
|
1271
|
-
|
|
1270
|
+
qe(S.body, Ie, F, () => {
|
|
1271
|
+
Q && Q(), y && y();
|
|
1272
1272
|
}),
|
|
1273
|
-
|
|
1273
|
+
T
|
|
1274
1274
|
);
|
|
1275
1275
|
}
|
|
1276
1276
|
u = u || "text";
|
|
1277
1277
|
let N = await ee[a.findKey(ee, u) || "text"](S, e);
|
|
1278
|
-
return !C &&
|
|
1279
|
-
ft(
|
|
1278
|
+
return !C && y && y(), await new Promise((T, U) => {
|
|
1279
|
+
ft(T, U, {
|
|
1280
1280
|
data: N,
|
|
1281
|
-
headers:
|
|
1281
|
+
headers: P.from(S.headers),
|
|
1282
1282
|
status: S.status,
|
|
1283
1283
|
statusText: S.statusText,
|
|
1284
1284
|
config: e,
|
|
@@ -1286,19 +1286,19 @@ const Wn = async (e) => {
|
|
|
1286
1286
|
});
|
|
1287
1287
|
});
|
|
1288
1288
|
} catch (w) {
|
|
1289
|
-
throw
|
|
1289
|
+
throw y && y(), w && w.name === "TypeError" && /fetch/i.test(w.message) ? Object.assign(
|
|
1290
1290
|
new m("Network Error", m.ERR_NETWORK, e, h),
|
|
1291
1291
|
{
|
|
1292
1292
|
cause: w.cause || w
|
|
1293
1293
|
}
|
|
1294
1294
|
) : m.from(w, w && w.code, e, h);
|
|
1295
1295
|
}
|
|
1296
|
-
}),
|
|
1296
|
+
}), ye = {
|
|
1297
1297
|
http: fn,
|
|
1298
|
-
xhr:
|
|
1299
|
-
fetch:
|
|
1298
|
+
xhr: Hn,
|
|
1299
|
+
fetch: Gn
|
|
1300
1300
|
};
|
|
1301
|
-
a.forEach(
|
|
1301
|
+
a.forEach(ye, (e, t) => {
|
|
1302
1302
|
if (e) {
|
|
1303
1303
|
try {
|
|
1304
1304
|
Object.defineProperty(e, "name", { value: t });
|
|
@@ -1307,7 +1307,7 @@ a.forEach(ge, (e, t) => {
|
|
|
1307
1307
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1308
1308
|
}
|
|
1309
1309
|
});
|
|
1310
|
-
const je = (e) => `- ${e}`,
|
|
1310
|
+
const je = (e) => `- ${e}`, Xn = (e) => a.isFunction(e) || e === null || e === !1, yt = {
|
|
1311
1311
|
getAdapter: (e) => {
|
|
1312
1312
|
e = a.isArray(e) ? e : [e];
|
|
1313
1313
|
const { length: t } = e;
|
|
@@ -1316,7 +1316,7 @@ const je = (e) => `- ${e}`, Yn = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1316
1316
|
for (let o = 0; o < t; o++) {
|
|
1317
1317
|
n = e[o];
|
|
1318
1318
|
let i;
|
|
1319
|
-
if (r = n, !
|
|
1319
|
+
if (r = n, !Xn(n) && (r = ye[(i = String(n)).toLowerCase()], r === void 0))
|
|
1320
1320
|
throw new m(`Unknown adapter '${i}'`);
|
|
1321
1321
|
if (r)
|
|
1322
1322
|
break;
|
|
@@ -1336,40 +1336,40 @@ const je = (e) => `- ${e}`, Yn = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1336
1336
|
}
|
|
1337
1337
|
return r;
|
|
1338
1338
|
},
|
|
1339
|
-
adapters:
|
|
1339
|
+
adapters: ye
|
|
1340
1340
|
};
|
|
1341
1341
|
function fe(e) {
|
|
1342
1342
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1343
|
-
throw new
|
|
1343
|
+
throw new H(null, e);
|
|
1344
1344
|
}
|
|
1345
|
-
function
|
|
1346
|
-
return fe(e), e.headers =
|
|
1345
|
+
function He(e) {
|
|
1346
|
+
return fe(e), e.headers = P.from(e.headers), e.data = le.call(
|
|
1347
1347
|
e,
|
|
1348
1348
|
e.transformRequest
|
|
1349
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1),
|
|
1349
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), yt.getAdapter(e.adapter || W.adapter)(e).then(function(r) {
|
|
1350
1350
|
return fe(e), r.data = le.call(
|
|
1351
1351
|
e,
|
|
1352
1352
|
e.transformResponse,
|
|
1353
1353
|
r
|
|
1354
|
-
), r.headers =
|
|
1354
|
+
), r.headers = P.from(r.headers), r;
|
|
1355
1355
|
}, function(r) {
|
|
1356
1356
|
return lt(r) || (fe(e), r && r.response && (r.response.data = le.call(
|
|
1357
1357
|
e,
|
|
1358
1358
|
e.transformResponse,
|
|
1359
1359
|
r.response
|
|
1360
|
-
), r.response.headers =
|
|
1360
|
+
), r.response.headers = P.from(r.response.headers))), Promise.reject(r);
|
|
1361
1361
|
});
|
|
1362
1362
|
}
|
|
1363
|
-
const
|
|
1363
|
+
const gt = "1.7.7", Re = {};
|
|
1364
1364
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1365
1365
|
Re[e] = function(r) {
|
|
1366
1366
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1367
1367
|
};
|
|
1368
1368
|
});
|
|
1369
|
-
const
|
|
1369
|
+
const $e = {};
|
|
1370
1370
|
Re.transitional = function(t, n, r) {
|
|
1371
1371
|
function s(o, i) {
|
|
1372
|
-
return "[Axios v" +
|
|
1372
|
+
return "[Axios v" + gt + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
|
|
1373
1373
|
}
|
|
1374
1374
|
return (o, i, c) => {
|
|
1375
1375
|
if (t === !1)
|
|
@@ -1377,7 +1377,7 @@ Re.transitional = function(t, n, r) {
|
|
|
1377
1377
|
s(i, " has been removed" + (n ? " in " + n : "")),
|
|
1378
1378
|
m.ERR_DEPRECATED
|
|
1379
1379
|
);
|
|
1380
|
-
return n &&
|
|
1380
|
+
return n && !$e[i] && ($e[i] = !0, console.warn(
|
|
1381
1381
|
s(
|
|
1382
1382
|
i,
|
|
1383
1383
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
@@ -1385,7 +1385,7 @@ Re.transitional = function(t, n, r) {
|
|
|
1385
1385
|
)), t ? t(o, i, c) : !0;
|
|
1386
1386
|
};
|
|
1387
1387
|
};
|
|
1388
|
-
function
|
|
1388
|
+
function Yn(e, t, n) {
|
|
1389
1389
|
if (typeof e != "object")
|
|
1390
1390
|
throw new m("options must be an object", m.ERR_BAD_OPTION_VALUE);
|
|
1391
1391
|
const r = Object.keys(e);
|
|
@@ -1402,15 +1402,15 @@ function Qn(e, t, n) {
|
|
|
1402
1402
|
throw new m("Unknown option " + o, m.ERR_BAD_OPTION);
|
|
1403
1403
|
}
|
|
1404
1404
|
}
|
|
1405
|
-
const
|
|
1406
|
-
assertOptions:
|
|
1405
|
+
const ge = {
|
|
1406
|
+
assertOptions: Yn,
|
|
1407
1407
|
validators: Re
|
|
1408
|
-
}, L =
|
|
1409
|
-
let
|
|
1408
|
+
}, L = ge.validators;
|
|
1409
|
+
let v = class {
|
|
1410
1410
|
constructor(t) {
|
|
1411
1411
|
this.defaults = t, this.interceptors = {
|
|
1412
|
-
request: new
|
|
1413
|
-
response: new
|
|
1412
|
+
request: new De(),
|
|
1413
|
+
response: new De()
|
|
1414
1414
|
};
|
|
1415
1415
|
}
|
|
1416
1416
|
/**
|
|
@@ -1439,15 +1439,15 @@ let k = class {
|
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
1441
|
_request(t, n) {
|
|
1442
|
-
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n =
|
|
1442
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = q(this.defaults, n);
|
|
1443
1443
|
const { transitional: r, paramsSerializer: s, headers: o } = n;
|
|
1444
|
-
r !== void 0 &&
|
|
1444
|
+
r !== void 0 && ge.assertOptions(r, {
|
|
1445
1445
|
silentJSONParsing: L.transitional(L.boolean),
|
|
1446
1446
|
forcedJSONParsing: L.transitional(L.boolean),
|
|
1447
1447
|
clarifyTimeoutError: L.transitional(L.boolean)
|
|
1448
1448
|
}, !1), s != null && (a.isFunction(s) ? n.paramsSerializer = {
|
|
1449
1449
|
serialize: s
|
|
1450
|
-
} :
|
|
1450
|
+
} : ge.assertOptions(s, {
|
|
1451
1451
|
encode: L.function,
|
|
1452
1452
|
serialize: L.function
|
|
1453
1453
|
}, !0)), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
@@ -1460,52 +1460,52 @@ let k = class {
|
|
|
1460
1460
|
(h) => {
|
|
1461
1461
|
delete o[h];
|
|
1462
1462
|
}
|
|
1463
|
-
), n.headers =
|
|
1463
|
+
), n.headers = P.concat(i, o);
|
|
1464
1464
|
const c = [];
|
|
1465
1465
|
let f = !0;
|
|
1466
|
-
this.interceptors.request.forEach(function(
|
|
1467
|
-
typeof
|
|
1466
|
+
this.interceptors.request.forEach(function(y) {
|
|
1467
|
+
typeof y.runWhen == "function" && y.runWhen(n) === !1 || (f = f && y.synchronous, c.unshift(y.fulfilled, y.rejected));
|
|
1468
1468
|
});
|
|
1469
1469
|
const u = [];
|
|
1470
|
-
this.interceptors.response.forEach(function(
|
|
1471
|
-
u.push(
|
|
1470
|
+
this.interceptors.response.forEach(function(y) {
|
|
1471
|
+
u.push(y.fulfilled, y.rejected);
|
|
1472
1472
|
});
|
|
1473
|
-
let l, d = 0,
|
|
1473
|
+
let l, d = 0, g;
|
|
1474
1474
|
if (!f) {
|
|
1475
|
-
const h = [
|
|
1476
|
-
for (h.unshift.apply(h, c), h.push.apply(h, u),
|
|
1475
|
+
const h = [He.bind(this), void 0];
|
|
1476
|
+
for (h.unshift.apply(h, c), h.push.apply(h, u), g = h.length, l = Promise.resolve(n); d < g; )
|
|
1477
1477
|
l = l.then(h[d++], h[d++]);
|
|
1478
1478
|
return l;
|
|
1479
1479
|
}
|
|
1480
|
-
|
|
1480
|
+
g = c.length;
|
|
1481
1481
|
let E = n;
|
|
1482
|
-
for (d = 0; d <
|
|
1483
|
-
const h = c[d++],
|
|
1482
|
+
for (d = 0; d < g; ) {
|
|
1483
|
+
const h = c[d++], y = c[d++];
|
|
1484
1484
|
try {
|
|
1485
1485
|
E = h(E);
|
|
1486
1486
|
} catch (p) {
|
|
1487
|
-
|
|
1487
|
+
y.call(this, p);
|
|
1488
1488
|
break;
|
|
1489
1489
|
}
|
|
1490
1490
|
}
|
|
1491
1491
|
try {
|
|
1492
|
-
l =
|
|
1492
|
+
l = He.call(this, E);
|
|
1493
1493
|
} catch (h) {
|
|
1494
1494
|
return Promise.reject(h);
|
|
1495
1495
|
}
|
|
1496
|
-
for (d = 0,
|
|
1496
|
+
for (d = 0, g = u.length; d < g; )
|
|
1497
1497
|
l = l.then(u[d++], u[d++]);
|
|
1498
1498
|
return l;
|
|
1499
1499
|
}
|
|
1500
1500
|
getUri(t) {
|
|
1501
|
-
t =
|
|
1501
|
+
t = q(this.defaults, t);
|
|
1502
1502
|
const n = dt(t.baseURL, t.url);
|
|
1503
1503
|
return at(n, t.params, t.paramsSerializer);
|
|
1504
1504
|
}
|
|
1505
1505
|
};
|
|
1506
1506
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1507
|
-
|
|
1508
|
-
return this.request(
|
|
1507
|
+
v.prototype[t] = function(n, r) {
|
|
1508
|
+
return this.request(q(r || {}, {
|
|
1509
1509
|
method: t,
|
|
1510
1510
|
url: n,
|
|
1511
1511
|
data: (r || {}).data
|
|
@@ -1515,7 +1515,7 @@ a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1515
1515
|
a.forEach(["post", "put", "patch"], function(t) {
|
|
1516
1516
|
function n(r) {
|
|
1517
1517
|
return function(o, i, c) {
|
|
1518
|
-
return this.request(
|
|
1518
|
+
return this.request(q(c || {}, {
|
|
1519
1519
|
method: t,
|
|
1520
1520
|
headers: r ? {
|
|
1521
1521
|
"Content-Type": "multipart/form-data"
|
|
@@ -1525,7 +1525,7 @@ a.forEach(["post", "put", "patch"], function(t) {
|
|
|
1525
1525
|
}));
|
|
1526
1526
|
};
|
|
1527
1527
|
}
|
|
1528
|
-
|
|
1528
|
+
v.prototype[t] = n(), v.prototype[t + "Form"] = n(!0);
|
|
1529
1529
|
});
|
|
1530
1530
|
let Zn = class wt {
|
|
1531
1531
|
constructor(t) {
|
|
@@ -1551,7 +1551,7 @@ let Zn = class wt {
|
|
|
1551
1551
|
r.unsubscribe(o);
|
|
1552
1552
|
}, i;
|
|
1553
1553
|
}, t(function(o, i, c) {
|
|
1554
|
-
r.reason || (r.reason = new
|
|
1554
|
+
r.reason || (r.reason = new H(o, i, c), n(r.reason));
|
|
1555
1555
|
});
|
|
1556
1556
|
}
|
|
1557
1557
|
/**
|
|
@@ -1677,17 +1677,17 @@ Object.entries(we).forEach(([e, t]) => {
|
|
|
1677
1677
|
we[t] = e;
|
|
1678
1678
|
});
|
|
1679
1679
|
function bt(e) {
|
|
1680
|
-
const t = new
|
|
1681
|
-
return a.extend(n,
|
|
1682
|
-
return bt(
|
|
1680
|
+
const t = new v(e), n = Qe(v.prototype.request, t);
|
|
1681
|
+
return a.extend(n, v.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1682
|
+
return bt(q(e, s));
|
|
1683
1683
|
}, n;
|
|
1684
1684
|
}
|
|
1685
1685
|
const b = bt(W);
|
|
1686
|
-
b.Axios =
|
|
1687
|
-
b.CanceledError =
|
|
1686
|
+
b.Axios = v;
|
|
1687
|
+
b.CanceledError = H;
|
|
1688
1688
|
b.CancelToken = Zn;
|
|
1689
1689
|
b.isCancel = lt;
|
|
1690
|
-
b.VERSION =
|
|
1690
|
+
b.VERSION = gt;
|
|
1691
1691
|
b.toFormData = se;
|
|
1692
1692
|
b.AxiosError = m;
|
|
1693
1693
|
b.Cancel = b.CanceledError;
|
|
@@ -1696,17 +1696,17 @@ b.all = function(t) {
|
|
|
1696
1696
|
};
|
|
1697
1697
|
b.spread = er;
|
|
1698
1698
|
b.isAxiosError = tr;
|
|
1699
|
-
b.mergeConfig =
|
|
1700
|
-
b.AxiosHeaders =
|
|
1699
|
+
b.mergeConfig = q;
|
|
1700
|
+
b.AxiosHeaders = P;
|
|
1701
1701
|
b.formToJSON = (e) => ut(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1702
|
-
b.getAdapter =
|
|
1702
|
+
b.getAdapter = yt.getAdapter;
|
|
1703
1703
|
b.HttpStatusCode = we;
|
|
1704
1704
|
b.default = b;
|
|
1705
1705
|
const {
|
|
1706
|
-
Axios:
|
|
1707
|
-
AxiosError:
|
|
1708
|
-
CanceledError:
|
|
1709
|
-
isCancel:
|
|
1706
|
+
Axios: Gr,
|
|
1707
|
+
AxiosError: G,
|
|
1708
|
+
CanceledError: Xr,
|
|
1709
|
+
isCancel: Yr,
|
|
1710
1710
|
CancelToken: Zr,
|
|
1711
1711
|
VERSION: es,
|
|
1712
1712
|
all: ts,
|
|
@@ -1755,15 +1755,18 @@ class nr {
|
|
|
1755
1755
|
async create(t, n, r, s) {
|
|
1756
1756
|
var o;
|
|
1757
1757
|
try {
|
|
1758
|
-
await this.httpClient.post(
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1758
|
+
await this.httpClient.post({
|
|
1759
|
+
path: "/affiliates",
|
|
1760
|
+
postData: {
|
|
1761
|
+
address: t,
|
|
1762
|
+
name: n,
|
|
1763
|
+
code: n,
|
|
1764
|
+
signature: r,
|
|
1765
|
+
account_chain_id: s
|
|
1766
|
+
}
|
|
1764
1767
|
});
|
|
1765
1768
|
} catch (i) {
|
|
1766
|
-
if (i instanceof
|
|
1769
|
+
if (i instanceof G) {
|
|
1767
1770
|
const c = (o = i.response) == null ? void 0 : o.data;
|
|
1768
1771
|
if (typeof (c == null ? void 0 : c.message) == "string") {
|
|
1769
1772
|
const f = c.message.toLowerCase();
|
|
@@ -1777,14 +1780,17 @@ class nr {
|
|
|
1777
1780
|
async update(t, n, r, s) {
|
|
1778
1781
|
var o;
|
|
1779
1782
|
try {
|
|
1780
|
-
await this.httpClient.post(
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1783
|
+
await this.httpClient.post({
|
|
1784
|
+
path: `/affiliates/${t}`,
|
|
1785
|
+
postData: {
|
|
1786
|
+
code: n,
|
|
1787
|
+
address: t,
|
|
1788
|
+
signature: r,
|
|
1789
|
+
account_chain_id: s
|
|
1790
|
+
}
|
|
1785
1791
|
});
|
|
1786
1792
|
} catch (i) {
|
|
1787
|
-
if (i instanceof
|
|
1793
|
+
if (i instanceof G) {
|
|
1788
1794
|
const c = (o = i.response) == null ? void 0 : o.data;
|
|
1789
1795
|
if (typeof (c == null ? void 0 : c.message) == "string") {
|
|
1790
1796
|
const f = c.message.toLowerCase();
|
|
@@ -1798,9 +1804,9 @@ class nr {
|
|
|
1798
1804
|
async isCodeFree(t) {
|
|
1799
1805
|
var n;
|
|
1800
1806
|
try {
|
|
1801
|
-
return await this.httpClient.get(`/affiliates/codes/${t}`), !1;
|
|
1807
|
+
return await this.httpClient.get({ path: `/affiliates/codes/${t}` }), !1;
|
|
1802
1808
|
} catch (r) {
|
|
1803
|
-
if (r instanceof
|
|
1809
|
+
if (r instanceof G && ((n = r.response) == null ? void 0 : n.status) === 404)
|
|
1804
1810
|
return !0;
|
|
1805
1811
|
throw console.error("Fuul SDK: Could not check affiliate code", r), r;
|
|
1806
1812
|
}
|
|
@@ -1808,9 +1814,9 @@ class nr {
|
|
|
1808
1814
|
async getCode(t) {
|
|
1809
1815
|
var n;
|
|
1810
1816
|
try {
|
|
1811
|
-
return (await this.httpClient.get(`/affiliates/${t}`)).data.code;
|
|
1817
|
+
return (await this.httpClient.get({ path: `/affiliates/${t}` })).data.code;
|
|
1812
1818
|
} catch (r) {
|
|
1813
|
-
if (r instanceof
|
|
1819
|
+
if (r instanceof G && ((n = r.response) == null ? void 0 : n.status) === 404)
|
|
1814
1820
|
return null;
|
|
1815
1821
|
throw console.error("Fuul SDK: Could not get affiliate code", r), r;
|
|
1816
1822
|
}
|
|
@@ -1824,7 +1830,10 @@ class sr {
|
|
|
1824
1830
|
this.httpClient = t.httpClient, this._debug = t.debug;
|
|
1825
1831
|
}
|
|
1826
1832
|
async getUserAudiences(t) {
|
|
1827
|
-
return (await this.httpClient.get(
|
|
1833
|
+
return (await this.httpClient.get({
|
|
1834
|
+
path: `${rr}/user`,
|
|
1835
|
+
queryParams: { ...t }
|
|
1836
|
+
})).data;
|
|
1828
1837
|
}
|
|
1829
1838
|
}
|
|
1830
1839
|
class or {
|
|
@@ -1833,7 +1842,7 @@ class or {
|
|
|
1833
1842
|
this.httpClient = t.httpClient;
|
|
1834
1843
|
}
|
|
1835
1844
|
async getAll(t) {
|
|
1836
|
-
const { data: n } = await this.httpClient.get("conversions", t);
|
|
1845
|
+
const { data: n } = await this.httpClient.get({ path: "conversions", queryParams: { ...t } });
|
|
1837
1846
|
return n;
|
|
1838
1847
|
}
|
|
1839
1848
|
}
|
|
@@ -1850,11 +1859,11 @@ class ar {
|
|
|
1850
1859
|
return;
|
|
1851
1860
|
}
|
|
1852
1861
|
if (!n || !Array.isArray(n) || n.length === 0)
|
|
1853
|
-
await this.httpClient.post("events", t);
|
|
1862
|
+
await this.httpClient.post({ path: "events", postData: t });
|
|
1854
1863
|
else
|
|
1855
1864
|
for (const r of n) {
|
|
1856
1865
|
const s = structuredClone({ ...t, project_id: r });
|
|
1857
|
-
s.metadata.project_id = r, await this.httpClient.post("events", s);
|
|
1866
|
+
s.metadata.project_id = r, await this.httpClient.post({ path: "events", postData: s, queryParams: { project_id: r } });
|
|
1858
1867
|
}
|
|
1859
1868
|
this.debug && console.debug(`Fuul SDK: Sent '${t.name}' event`), this.saveSentEvent(t);
|
|
1860
1869
|
}
|
|
@@ -1878,38 +1887,53 @@ class ar {
|
|
|
1878
1887
|
localStorage.setItem(n, JSON.stringify(s));
|
|
1879
1888
|
}
|
|
1880
1889
|
}
|
|
1881
|
-
const cr = "4.12.
|
|
1890
|
+
const cr = "4.12.2", ur = {
|
|
1882
1891
|
version: cr
|
|
1883
1892
|
};
|
|
1884
1893
|
class lr {
|
|
1885
1894
|
constructor(t) {
|
|
1886
1895
|
R(this, "client");
|
|
1887
|
-
R(this, "
|
|
1896
|
+
R(this, "defaultQueryParams");
|
|
1888
1897
|
this.client = b.create({
|
|
1889
1898
|
...t,
|
|
1890
1899
|
headers: {
|
|
1891
1900
|
Authorization: `Bearer ${t.apiKey}`,
|
|
1892
1901
|
"X-Fuul-Sdk-Version": ur.version
|
|
1893
1902
|
}
|
|
1894
|
-
}), this.
|
|
1903
|
+
}), this.defaultQueryParams = t.queryParams || {};
|
|
1895
1904
|
}
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
return Object.keys(t).forEach((r) => {
|
|
1899
|
-
n = n === "" ? n + `?${r}=${t[r]}` : n + `&${r}=${t[r]}`;
|
|
1900
|
-
}), n;
|
|
1905
|
+
makeQueryParams(t) {
|
|
1906
|
+
return Object.assign({}, this.defaultQueryParams || {}, t || {});
|
|
1901
1907
|
}
|
|
1902
|
-
async get(t
|
|
1903
|
-
return this.client.
|
|
1908
|
+
async get(t) {
|
|
1909
|
+
return this.client.request({
|
|
1910
|
+
url: t.path,
|
|
1911
|
+
params: this.makeQueryParams(t.queryParams),
|
|
1912
|
+
method: "GET"
|
|
1913
|
+
});
|
|
1904
1914
|
}
|
|
1905
|
-
async post(t
|
|
1906
|
-
return this.client.
|
|
1915
|
+
async post(t) {
|
|
1916
|
+
return this.client.request({
|
|
1917
|
+
url: t.path,
|
|
1918
|
+
params: this.makeQueryParams(t.queryParams),
|
|
1919
|
+
data: t.postData,
|
|
1920
|
+
method: "POST"
|
|
1921
|
+
});
|
|
1907
1922
|
}
|
|
1908
|
-
async put(t
|
|
1909
|
-
return this.client.
|
|
1923
|
+
async put(t) {
|
|
1924
|
+
return this.client.request({
|
|
1925
|
+
url: t.path,
|
|
1926
|
+
params: this.makeQueryParams(t.queryParams),
|
|
1927
|
+
data: t.postData,
|
|
1928
|
+
method: "PUT"
|
|
1929
|
+
});
|
|
1910
1930
|
}
|
|
1911
1931
|
async delete(t) {
|
|
1912
|
-
return this.client.
|
|
1932
|
+
return this.client.request({
|
|
1933
|
+
url: t.path,
|
|
1934
|
+
params: this.makeQueryParams(t.queryParams),
|
|
1935
|
+
method: "DELETE"
|
|
1936
|
+
});
|
|
1913
1937
|
}
|
|
1914
1938
|
}
|
|
1915
1939
|
class fr {
|
|
@@ -1918,13 +1942,22 @@ class fr {
|
|
|
1918
1942
|
this.httpClient = t.httpClient;
|
|
1919
1943
|
}
|
|
1920
1944
|
async getPayoutsLeaderboard(t) {
|
|
1921
|
-
return (await this.httpClient.get(
|
|
1945
|
+
return (await this.httpClient.get({
|
|
1946
|
+
path: "/payouts/leaderboard/payouts",
|
|
1947
|
+
queryParams: { ...t }
|
|
1948
|
+
})).data;
|
|
1922
1949
|
}
|
|
1923
1950
|
async getPointsLeaderboard(t) {
|
|
1924
|
-
return (await this.httpClient.get(
|
|
1951
|
+
return (await this.httpClient.get({
|
|
1952
|
+
path: "/payouts/leaderboard/points",
|
|
1953
|
+
queryParams: { ...t }
|
|
1954
|
+
})).data;
|
|
1925
1955
|
}
|
|
1926
1956
|
async getReferredUsersLeaderboard(t) {
|
|
1927
|
-
return (await this.httpClient.get(
|
|
1957
|
+
return (await this.httpClient.get({
|
|
1958
|
+
path: "/leaderboard/referred",
|
|
1959
|
+
queryParams: { ...t }
|
|
1960
|
+
})).data;
|
|
1928
1961
|
}
|
|
1929
1962
|
}
|
|
1930
1963
|
const K = "/payouts";
|
|
@@ -1935,23 +1968,38 @@ class dr {
|
|
|
1935
1968
|
this.httpClient = t.httpClient, this._debug = t.debug;
|
|
1936
1969
|
}
|
|
1937
1970
|
async getUserPayoutsByConversion(t) {
|
|
1938
|
-
return (await this.httpClient.get(
|
|
1971
|
+
return (await this.httpClient.get({
|
|
1972
|
+
path: K,
|
|
1973
|
+
queryParams: { ...t, type: "onchain-currency" }
|
|
1974
|
+
})).data;
|
|
1939
1975
|
}
|
|
1940
1976
|
async getUserPointsByConversion(t) {
|
|
1941
|
-
return (await this.httpClient.get(
|
|
1977
|
+
return (await this.httpClient.get({
|
|
1978
|
+
path: K,
|
|
1979
|
+
queryParams: { ...t, type: "point" }
|
|
1980
|
+
})).data;
|
|
1942
1981
|
}
|
|
1943
1982
|
async getUserPayoutMovements(t) {
|
|
1944
|
-
return (await this.httpClient.get(
|
|
1983
|
+
return (await this.httpClient.get({
|
|
1984
|
+
path: `${K}/movements`,
|
|
1985
|
+
queryParams: { ...t, type: "onchain-currency" }
|
|
1986
|
+
})).data;
|
|
1945
1987
|
}
|
|
1946
1988
|
async getUserPointsMovements(t) {
|
|
1947
|
-
return (await this.httpClient.get(
|
|
1989
|
+
return (await this.httpClient.get({
|
|
1990
|
+
path: `${K}/movements`,
|
|
1991
|
+
queryParams: { ...t, type: "point" }
|
|
1992
|
+
})).data;
|
|
1948
1993
|
}
|
|
1949
1994
|
async getVolumeLeaderboard(t) {
|
|
1950
|
-
return (await this.httpClient.get(
|
|
1995
|
+
return (await this.httpClient.get({
|
|
1996
|
+
path: `${K}/leaderboard/volume`,
|
|
1997
|
+
queryParams: { ...t }
|
|
1998
|
+
})).data;
|
|
1951
1999
|
}
|
|
1952
2000
|
}
|
|
1953
2001
|
let hr = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((t, n) => (n &= 63, n < 36 ? t += n.toString(36) : n < 62 ? t += (n - 26).toString(36).toUpperCase() : n > 62 ? t += "-" : t += "_", t), "");
|
|
1954
|
-
const pr = "fuul.tracking_id",
|
|
2002
|
+
const pr = "fuul.tracking_id", Te = () => Er(pr, () => hr()), We = () => I("af") || I("referrer"), mr = () => document.referrer, yr = () => Sr(), gr = () => I("category"), wr = () => I("title"), br = () => I("tag"), Er = (e, t) => {
|
|
1955
2003
|
const n = localStorage.getItem(e);
|
|
1956
2004
|
if (n)
|
|
1957
2005
|
return n;
|
|
@@ -1959,8 +2007,8 @@ const pr = "fuul.tracking_id", Ae = () => Er(pr, () => hr()), We = () => q("af")
|
|
|
1959
2007
|
const r = t();
|
|
1960
2008
|
return r ? localStorage.setItem(e, r) : localStorage.removeItem(e), r;
|
|
1961
2009
|
}
|
|
1962
|
-
},
|
|
1963
|
-
const e =
|
|
2010
|
+
}, I = (e) => new URLSearchParams(window.location.search).get(e), Sr = () => {
|
|
2011
|
+
const e = I("source");
|
|
1964
2012
|
if (e)
|
|
1965
2013
|
return e;
|
|
1966
2014
|
}, Cr = "/user";
|
|
@@ -1970,31 +2018,31 @@ class Rr {
|
|
|
1970
2018
|
this.httpClient = t.httpClient;
|
|
1971
2019
|
}
|
|
1972
2020
|
async getUserAffiliates(t) {
|
|
1973
|
-
return (await this.httpClient.get(Cr, t)).data.affiliates;
|
|
2021
|
+
return (await this.httpClient.get({ path: Cr, queryParams: { ...t } })).data.affiliates;
|
|
1974
2022
|
}
|
|
1975
2023
|
}
|
|
1976
|
-
const
|
|
1977
|
-
let B = !1, be = !1,
|
|
1978
|
-
function
|
|
1979
|
-
B = !!e.debug, !be && (
|
|
2024
|
+
const Tr = "https://api.fuul.xyz/api/v1/";
|
|
2025
|
+
let B = !1, be = !1, Ae, D, Et, St, $, ie, z, Ct, ae;
|
|
2026
|
+
function Ar(e) {
|
|
2027
|
+
B = !!e.debug, !be && (Ae = e.apiKey, Kr(), D = Jr(e.baseApiUrl ?? Tr, e.defaultQueryParams ?? {}), Et = new or({ httpClient: D, debug: B }), ie = new ar({ httpClient: D, debug: B }), $ = new nr({ httpClient: D, debug: B }), z = new dr({ httpClient: D, debug: B }), St = new Rr({ httpClient: D }), Ct = new sr({ httpClient: D, debug: B }), ae = new fr({ httpClient: D }), be = !0, B && console.debug("Fuul SDK: init() complete"));
|
|
1980
2028
|
}
|
|
1981
2029
|
function x() {
|
|
1982
2030
|
if (!be)
|
|
1983
2031
|
throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods");
|
|
1984
2032
|
}
|
|
1985
|
-
async function
|
|
1986
|
-
x(),
|
|
2033
|
+
async function Pr(e, t) {
|
|
2034
|
+
x(), Pe(), Oe();
|
|
1987
2035
|
const n = {
|
|
1988
2036
|
name: e,
|
|
1989
2037
|
args: t ?? {},
|
|
1990
2038
|
metadata: {
|
|
1991
|
-
tracking_id:
|
|
2039
|
+
tracking_id: Te()
|
|
1992
2040
|
}
|
|
1993
2041
|
};
|
|
1994
2042
|
await ie.sendEvent(n);
|
|
1995
2043
|
}
|
|
1996
|
-
async function
|
|
1997
|
-
x(),
|
|
2044
|
+
async function Or(e, t) {
|
|
2045
|
+
x(), Pe(), Oe();
|
|
1998
2046
|
const n = {
|
|
1999
2047
|
name: "pageview",
|
|
2000
2048
|
args: {
|
|
@@ -2002,20 +2050,20 @@ async function _r(e, t) {
|
|
|
2002
2050
|
locationOrigin: document.location.origin
|
|
2003
2051
|
},
|
|
2004
2052
|
metadata: {
|
|
2005
|
-
tracking_id:
|
|
2053
|
+
tracking_id: Te(),
|
|
2006
2054
|
referrer_url: mr(),
|
|
2007
|
-
source:
|
|
2055
|
+
source: yr(),
|
|
2008
2056
|
affiliate_id: We() ?? void 0,
|
|
2009
2057
|
referrer: We() ?? void 0,
|
|
2010
|
-
category:
|
|
2058
|
+
category: gr() ?? void 0,
|
|
2011
2059
|
title: wr() ?? void 0,
|
|
2012
2060
|
tag: br() ?? void 0
|
|
2013
2061
|
}
|
|
2014
2062
|
};
|
|
2015
2063
|
await ie.sendEvent(n, t);
|
|
2016
2064
|
}
|
|
2017
|
-
async function
|
|
2018
|
-
x(),
|
|
2065
|
+
async function _r(e, t) {
|
|
2066
|
+
x(), Pe(), Oe();
|
|
2019
2067
|
const n = {
|
|
2020
2068
|
name: "connect_wallet",
|
|
2021
2069
|
args: {
|
|
@@ -2023,55 +2071,55 @@ async function Pr(e, t) {
|
|
|
2023
2071
|
locationOrigin: document.location.origin
|
|
2024
2072
|
},
|
|
2025
2073
|
metadata: {
|
|
2026
|
-
tracking_id:
|
|
2074
|
+
tracking_id: Te()
|
|
2027
2075
|
}
|
|
2028
2076
|
};
|
|
2029
2077
|
e != null && e.address && (n.user_address = e.address), e != null && e.signature && (n.signature = e == null ? void 0 : e.signature, n.signature_message = e == null ? void 0 : e.message), e != null && e.accountChainId && (n.account_chain_id = e.accountChainId), await ie.sendEvent(n, t);
|
|
2030
2078
|
}
|
|
2031
2079
|
async function xr(e) {
|
|
2032
|
-
x(), await
|
|
2080
|
+
x(), await $.create(e.address, e.code, e.signature, e.accountChainId);
|
|
2033
2081
|
}
|
|
2034
2082
|
async function Nr(e) {
|
|
2035
|
-
x(), await
|
|
2083
|
+
x(), await $.update(e.address, e.code, e.signature, e.accountChainId);
|
|
2036
2084
|
}
|
|
2037
2085
|
async function Ur(e) {
|
|
2038
|
-
return x(), await
|
|
2086
|
+
return x(), await $.getCode(e);
|
|
2039
2087
|
}
|
|
2040
2088
|
async function Lr(e) {
|
|
2041
|
-
return x(), await
|
|
2089
|
+
return x(), await $.isCodeFree(e);
|
|
2042
2090
|
}
|
|
2043
|
-
async function
|
|
2091
|
+
async function Dr(e, t, n) {
|
|
2044
2092
|
x();
|
|
2045
|
-
const r = await
|
|
2093
|
+
const r = await $.getCode(t), s = new URLSearchParams({
|
|
2046
2094
|
af: r ?? t
|
|
2047
2095
|
});
|
|
2048
2096
|
return n != null && n.title && s.append("af_title", n.title), n != null && n.format && s.append("af_format", n.format), n != null && n.place && s.append("af_place", n.place), `${e}?${s.toString()}`;
|
|
2049
2097
|
}
|
|
2050
|
-
function
|
|
2098
|
+
function Fr(e) {
|
|
2051
2099
|
return ae.getPayoutsLeaderboard(e);
|
|
2052
2100
|
}
|
|
2053
2101
|
function Br(e) {
|
|
2054
2102
|
return ae.getPointsLeaderboard(e);
|
|
2055
2103
|
}
|
|
2056
|
-
function
|
|
2104
|
+
function kr(e) {
|
|
2057
2105
|
return ae.getReferredUsersLeaderboard(e);
|
|
2058
2106
|
}
|
|
2059
|
-
function
|
|
2107
|
+
function vr(e) {
|
|
2060
2108
|
return z.getVolumeLeaderboard(e);
|
|
2061
2109
|
}
|
|
2062
|
-
function
|
|
2110
|
+
function qr(e) {
|
|
2063
2111
|
return z.getUserPayoutsByConversion(e);
|
|
2064
2112
|
}
|
|
2065
|
-
function
|
|
2113
|
+
function Ir(e) {
|
|
2066
2114
|
return z.getUserPointsByConversion(e);
|
|
2067
2115
|
}
|
|
2068
2116
|
function jr(e) {
|
|
2069
2117
|
return z.getUserPayoutMovements(e);
|
|
2070
2118
|
}
|
|
2071
|
-
function
|
|
2119
|
+
function Hr(e) {
|
|
2072
2120
|
return z.getUserPointsMovements(e);
|
|
2073
2121
|
}
|
|
2074
|
-
async function
|
|
2122
|
+
async function $r(e) {
|
|
2075
2123
|
return x(), Et.getAll(e);
|
|
2076
2124
|
}
|
|
2077
2125
|
async function zr(e) {
|
|
@@ -2080,47 +2128,47 @@ async function zr(e) {
|
|
|
2080
2128
|
async function Vr(e) {
|
|
2081
2129
|
return x(), Ct.getUserAudiences(e);
|
|
2082
2130
|
}
|
|
2083
|
-
function
|
|
2131
|
+
function Pe() {
|
|
2084
2132
|
if (typeof window > "u" || typeof document > "u")
|
|
2085
2133
|
throw new Error("Fuul SDK: Browser context required");
|
|
2086
2134
|
}
|
|
2087
|
-
function
|
|
2135
|
+
function Oe() {
|
|
2088
2136
|
if (navigator.webdriver)
|
|
2089
2137
|
throw new Error("Fuul SDK: You are using a browser automation tool");
|
|
2090
2138
|
}
|
|
2091
2139
|
function Kr() {
|
|
2092
|
-
if (!
|
|
2140
|
+
if (!Ae)
|
|
2093
2141
|
throw new Error("Fuul SDK: Invalid API key");
|
|
2094
2142
|
}
|
|
2095
2143
|
function Jr(e, t) {
|
|
2096
2144
|
return new lr({
|
|
2097
2145
|
baseURL: e,
|
|
2098
2146
|
timeout: 3e4,
|
|
2099
|
-
apiKey:
|
|
2147
|
+
apiKey: Ae,
|
|
2100
2148
|
queryParams: t
|
|
2101
2149
|
});
|
|
2102
2150
|
}
|
|
2103
2151
|
const fs = {
|
|
2104
|
-
init:
|
|
2105
|
-
sendEvent:
|
|
2106
|
-
sendPageview:
|
|
2107
|
-
sendConnectWallet:
|
|
2108
|
-
generateTrackingLink:
|
|
2109
|
-
getConversions:
|
|
2152
|
+
init: Ar,
|
|
2153
|
+
sendEvent: Pr,
|
|
2154
|
+
sendPageview: Or,
|
|
2155
|
+
sendConnectWallet: _r,
|
|
2156
|
+
generateTrackingLink: Dr,
|
|
2157
|
+
getConversions: $r,
|
|
2110
2158
|
createAffiliateCode: xr,
|
|
2111
2159
|
updateAffiliateCode: Nr,
|
|
2112
2160
|
getAffiliateCode: Ur,
|
|
2113
2161
|
isAffiliateCodeFree: Lr,
|
|
2114
|
-
getPayoutsLeaderboard:
|
|
2162
|
+
getPayoutsLeaderboard: Fr,
|
|
2115
2163
|
getPointsLeaderboard: Br,
|
|
2116
|
-
getReferredUsersLeaderboard:
|
|
2164
|
+
getReferredUsersLeaderboard: kr,
|
|
2117
2165
|
getUserAudiences: Vr,
|
|
2118
|
-
getUserPayoutsByConversion:
|
|
2119
|
-
getUserPointsByConversion:
|
|
2120
|
-
getUserPointsMovements:
|
|
2166
|
+
getUserPayoutsByConversion: qr,
|
|
2167
|
+
getUserPointsByConversion: Ir,
|
|
2168
|
+
getUserPointsMovements: Hr,
|
|
2121
2169
|
getUserPayoutMovements: jr,
|
|
2122
2170
|
getUserAffiliates: zr,
|
|
2123
|
-
getVolumeLeaderboard:
|
|
2171
|
+
getVolumeLeaderboard: vr
|
|
2124
2172
|
};
|
|
2125
2173
|
export {
|
|
2126
2174
|
Ve as AddressInUseError,
|