@fuul/sdk 3.0.0 → 3.1.1
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/AffiliateService.d.ts +16 -0
- package/dist/AffiliateService.d.ts.map +1 -1
- package/dist/HttpClient.d.ts.map +1 -1
- package/dist/core.d.ts +12 -0
- package/dist/core.d.ts.map +1 -1
- package/dist/index.mjs +515 -445
- package/dist/index.umd.js +3 -3
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,91 +1,32 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
constructor(t) {
|
|
6
|
-
A(this, "httpClient");
|
|
7
|
-
A(this, "_debug");
|
|
8
|
-
this.httpClient = t.httpClient, this._debug = t.debug;
|
|
9
|
-
}
|
|
10
|
-
async getCode(t) {
|
|
11
|
-
try {
|
|
12
|
-
const n = await this.httpClient.get(`/affiliates/${t}`);
|
|
13
|
-
return n.status !== 200 ? null : n.data.code;
|
|
14
|
-
} catch (n) {
|
|
15
|
-
return this._debug && console.error("Fuul SDK: Could not get affiliate code", n), null;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
class Ye {
|
|
20
|
-
constructor(t) {
|
|
21
|
-
A(this, "httpClient");
|
|
22
|
-
this.httpClient = t.httpClient;
|
|
23
|
-
}
|
|
24
|
-
async getAll() {
|
|
25
|
-
const { data: t } = await this.httpClient.get("conversions");
|
|
26
|
-
return t;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
const fe = "fuul.sent", Qe = 60;
|
|
30
|
-
class Xe {
|
|
31
|
-
constructor(t) {
|
|
32
|
-
A(this, "debug");
|
|
33
|
-
A(this, "httpClient");
|
|
34
|
-
this.httpClient = t.httpClient, this.debug = !!t.debug;
|
|
35
|
-
}
|
|
36
|
-
async sendEvent(t) {
|
|
37
|
-
if (this.isDuplicate(t)) {
|
|
38
|
-
this.debug && console.debug("Fuul SDK: Event is considered duplicate and will not be sent");
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
await this.httpClient.post("events", t), this.debug && console.debug(`Fuul SDK: Sent '${t.name}' event`), this.saveSentEvent(t);
|
|
42
|
-
}
|
|
43
|
-
isDuplicate(t) {
|
|
44
|
-
const n = `${fe}_${t.name}`, r = localStorage.getItem(n);
|
|
45
|
-
if (!r)
|
|
46
|
-
return !1;
|
|
47
|
-
const s = JSON.parse(r);
|
|
48
|
-
if (this.getCurrentTimestamp() - s.timestamp > Qe)
|
|
49
|
-
return !1;
|
|
50
|
-
let d = !1;
|
|
51
|
-
t.metadata && (d = s.metadata.tracking_id === t.metadata.tracking_id && s.metadata.project_id === t.metadata.project_id && s.metadata.referrer === t.metadata.referrer && s.metadata.source === t.metadata.source && s.metadata.category === t.metadata.category && s.metadata.title === t.metadata.title && s.metadata.tag === t.metadata.tag && s.user_address === t.user_address && s.signature === t.signature && s.signature_message === t.signature_message);
|
|
52
|
-
let c = !1;
|
|
53
|
-
return t.args && s.args && (c = s.args.page === t.args.page), c && d;
|
|
54
|
-
}
|
|
55
|
-
getCurrentTimestamp() {
|
|
56
|
-
return Date.now() / 1e3;
|
|
57
|
-
}
|
|
58
|
-
saveSentEvent(t) {
|
|
59
|
-
const n = `${fe}_${t.name}`, r = this.getCurrentTimestamp(), s = { ...t, timestamp: r };
|
|
60
|
-
localStorage.setItem(n, JSON.stringify(s));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
function Re(e, t) {
|
|
1
|
+
var We = Object.defineProperty;
|
|
2
|
+
var Ge = (e, t, n) => t in e ? We(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var S = (e, t, n) => (Ge(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
+
function Ae(e, t) {
|
|
64
5
|
return function() {
|
|
65
6
|
return e.apply(t, arguments);
|
|
66
7
|
};
|
|
67
8
|
}
|
|
68
|
-
const { toString:
|
|
69
|
-
const n =
|
|
9
|
+
const { toString: Re } = Object.prototype, { getPrototypeOf: ne } = Object, re = ((e) => (t) => {
|
|
10
|
+
const n = Re.call(t);
|
|
70
11
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
71
|
-
})(/* @__PURE__ */ Object.create(null)), O = (e) => (e = e.toLowerCase(), (t) => re(t) === e),
|
|
72
|
-
function
|
|
12
|
+
})(/* @__PURE__ */ Object.create(null)), O = (e) => (e = e.toLowerCase(), (t) => re(t) === e), V = (e) => (t) => typeof t === e, { isArray: x } = Array, U = V("undefined");
|
|
13
|
+
function Xe(e) {
|
|
73
14
|
return e !== null && !U(e) && e.constructor !== null && !U(e.constructor) && P(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
74
15
|
}
|
|
75
|
-
const
|
|
76
|
-
function
|
|
16
|
+
const Oe = O("ArrayBuffer");
|
|
17
|
+
function Ye(e) {
|
|
77
18
|
let t;
|
|
78
|
-
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 && Oe(e.buffer), t;
|
|
79
20
|
}
|
|
80
|
-
const
|
|
21
|
+
const Qe = V("string"), P = V("function"), Te = V("number"), se = (e) => e !== null && typeof e == "object", Ze = (e) => e === !0 || e === !1, j = (e) => {
|
|
81
22
|
if (re(e) !== "object")
|
|
82
23
|
return !1;
|
|
83
24
|
const t = ne(e);
|
|
84
25
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
|
|
85
|
-
},
|
|
26
|
+
}, et = O("Date"), tt = O("File"), nt = O("Blob"), rt = O("FileList"), st = (e) => se(e) && P(e.pipe), ot = (e) => {
|
|
86
27
|
const t = "[object FormData]";
|
|
87
|
-
return e && (typeof FormData == "function" && e instanceof FormData ||
|
|
88
|
-
},
|
|
28
|
+
return e && (typeof FormData == "function" && e instanceof FormData || Re.call(e) === t || P(e.toString) && e.toString() === t);
|
|
29
|
+
}, it = O("URLSearchParams"), at = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
89
30
|
function L(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
90
31
|
if (e === null || typeof e > "u")
|
|
91
32
|
return;
|
|
@@ -95,9 +36,9 @@ function L(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
95
36
|
t.call(null, e[r], r, e);
|
|
96
37
|
else {
|
|
97
38
|
const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
|
|
98
|
-
let
|
|
39
|
+
let c;
|
|
99
40
|
for (r = 0; r < i; r++)
|
|
100
|
-
|
|
41
|
+
c = o[r], t.call(null, e[c], c, e);
|
|
101
42
|
}
|
|
102
43
|
}
|
|
103
44
|
function Ce(e, t) {
|
|
@@ -110,37 +51,37 @@ function Ce(e, t) {
|
|
|
110
51
|
return null;
|
|
111
52
|
}
|
|
112
53
|
const Pe = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global)(), _e = (e) => !U(e) && e !== Pe;
|
|
113
|
-
function
|
|
54
|
+
function Y() {
|
|
114
55
|
const { caseless: e } = _e(this) && this || {}, t = {}, n = (r, s) => {
|
|
115
56
|
const o = e && Ce(t, s) || s;
|
|
116
|
-
|
|
57
|
+
j(t[o]) && j(r) ? t[o] = Y(t[o], r) : j(r) ? t[o] = Y({}, r) : x(r) ? t[o] = r.slice() : t[o] = r;
|
|
117
58
|
};
|
|
118
59
|
for (let r = 0, s = arguments.length; r < s; r++)
|
|
119
60
|
arguments[r] && L(arguments[r], n);
|
|
120
61
|
return t;
|
|
121
62
|
}
|
|
122
|
-
const
|
|
123
|
-
n && P(s) ? e[o] =
|
|
124
|
-
}, { allOwnKeys: r }), e),
|
|
63
|
+
const ct = (e, t, n, { allOwnKeys: r } = {}) => (L(t, (s, o) => {
|
|
64
|
+
n && P(s) ? e[o] = Ae(s, n) : e[o] = s;
|
|
65
|
+
}, { allOwnKeys: r }), e), ut = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), lt = (e, t, n, r) => {
|
|
125
66
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
126
67
|
value: t.prototype
|
|
127
68
|
}), n && Object.assign(e.prototype, n);
|
|
128
|
-
},
|
|
69
|
+
}, ft = (e, t, n, r) => {
|
|
129
70
|
let s, o, i;
|
|
130
|
-
const
|
|
71
|
+
const c = {};
|
|
131
72
|
if (t = t || {}, e == null)
|
|
132
73
|
return t;
|
|
133
74
|
do {
|
|
134
75
|
for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
|
|
135
|
-
i = s[o], (!r || r(i, e, t)) && !
|
|
76
|
+
i = s[o], (!r || r(i, e, t)) && !c[i] && (t[i] = e[i], c[i] = !0);
|
|
136
77
|
e = n !== !1 && ne(e);
|
|
137
78
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
138
79
|
return t;
|
|
139
|
-
},
|
|
80
|
+
}, dt = (e, t, n) => {
|
|
140
81
|
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
141
82
|
const r = e.indexOf(t, n);
|
|
142
83
|
return r !== -1 && r === n;
|
|
143
|
-
},
|
|
84
|
+
}, pt = (e) => {
|
|
144
85
|
if (!e)
|
|
145
86
|
return null;
|
|
146
87
|
if (x(e))
|
|
@@ -152,30 +93,30 @@ const ft = (e, t, n, { allOwnKeys: r } = {}) => (L(t, (s, o) => {
|
|
|
152
93
|
for (; t-- > 0; )
|
|
153
94
|
n[t] = e[t];
|
|
154
95
|
return n;
|
|
155
|
-
},
|
|
96
|
+
}, ht = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ne(Uint8Array)), mt = (e, t) => {
|
|
156
97
|
const r = (e && e[Symbol.iterator]).call(e);
|
|
157
98
|
let s;
|
|
158
99
|
for (; (s = r.next()) && !s.done; ) {
|
|
159
100
|
const o = s.value;
|
|
160
101
|
t.call(e, o[0], o[1]);
|
|
161
102
|
}
|
|
162
|
-
},
|
|
103
|
+
}, yt = (e, t) => {
|
|
163
104
|
let n;
|
|
164
105
|
const r = [];
|
|
165
106
|
for (; (n = e.exec(t)) !== null; )
|
|
166
107
|
r.push(n);
|
|
167
108
|
return r;
|
|
168
|
-
},
|
|
109
|
+
}, Et = O("HTMLFormElement"), wt = (e) => e.toLowerCase().replace(
|
|
169
110
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
170
111
|
function(n, r, s) {
|
|
171
112
|
return r.toUpperCase() + s;
|
|
172
113
|
}
|
|
173
|
-
),
|
|
114
|
+
), fe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), gt = O("RegExp"), Ne = (e, t) => {
|
|
174
115
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
175
116
|
L(n, (s, o) => {
|
|
176
117
|
t(s, o, e) !== !1 && (r[o] = s);
|
|
177
118
|
}), Object.defineProperties(e, r);
|
|
178
|
-
},
|
|
119
|
+
}, St = (e) => {
|
|
179
120
|
Ne(e, (t, n) => {
|
|
180
121
|
if (P(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
181
122
|
return !1;
|
|
@@ -190,29 +131,29 @@ const ft = (e, t, n, { allOwnKeys: r } = {}) => (L(t, (s, o) => {
|
|
|
190
131
|
});
|
|
191
132
|
}
|
|
192
133
|
});
|
|
193
|
-
},
|
|
134
|
+
}, bt = (e, t) => {
|
|
194
135
|
const n = {}, r = (s) => {
|
|
195
136
|
s.forEach((o) => {
|
|
196
137
|
n[o] = !0;
|
|
197
138
|
});
|
|
198
139
|
};
|
|
199
140
|
return x(e) ? r(e) : r(String(e).split(t)), n;
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
DIGIT:
|
|
141
|
+
}, At = () => {
|
|
142
|
+
}, Rt = (e, t) => (e = +e, Number.isFinite(e) ? e : t), M = "abcdefghijklmnopqrstuvwxyz", de = "0123456789", xe = {
|
|
143
|
+
DIGIT: de,
|
|
203
144
|
ALPHA: M,
|
|
204
|
-
ALPHA_DIGIT: M + M.toUpperCase() +
|
|
205
|
-
},
|
|
145
|
+
ALPHA_DIGIT: M + M.toUpperCase() + de
|
|
146
|
+
}, Ot = (e = 16, t = xe.ALPHA_DIGIT) => {
|
|
206
147
|
let n = "";
|
|
207
148
|
const { length: r } = t;
|
|
208
149
|
for (; e--; )
|
|
209
150
|
n += t[Math.random() * r | 0];
|
|
210
151
|
return n;
|
|
211
152
|
};
|
|
212
|
-
function
|
|
153
|
+
function Tt(e) {
|
|
213
154
|
return !!(e && P(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
|
|
214
155
|
}
|
|
215
|
-
const
|
|
156
|
+
const Ct = (e) => {
|
|
216
157
|
const t = new Array(10), n = (r, s) => {
|
|
217
158
|
if (se(r)) {
|
|
218
159
|
if (t.indexOf(r) >= 0)
|
|
@@ -220,9 +161,9 @@ const Nt = (e) => {
|
|
|
220
161
|
if (!("toJSON" in r)) {
|
|
221
162
|
t[s] = r;
|
|
222
163
|
const o = x(r) ? [] : {};
|
|
223
|
-
return L(r, (i,
|
|
224
|
-
const
|
|
225
|
-
!U(
|
|
164
|
+
return L(r, (i, c) => {
|
|
165
|
+
const f = n(i, s + 1);
|
|
166
|
+
!U(f) && (o[c] = f);
|
|
226
167
|
}), t[s] = void 0, o;
|
|
227
168
|
}
|
|
228
169
|
}
|
|
@@ -231,55 +172,55 @@ const Nt = (e) => {
|
|
|
231
172
|
return n(e, 0);
|
|
232
173
|
}, a = {
|
|
233
174
|
isArray: x,
|
|
234
|
-
isArrayBuffer:
|
|
235
|
-
isBuffer:
|
|
236
|
-
isFormData:
|
|
237
|
-
isArrayBufferView:
|
|
238
|
-
isString:
|
|
175
|
+
isArrayBuffer: Oe,
|
|
176
|
+
isBuffer: Xe,
|
|
177
|
+
isFormData: ot,
|
|
178
|
+
isArrayBufferView: Ye,
|
|
179
|
+
isString: Qe,
|
|
239
180
|
isNumber: Te,
|
|
240
|
-
isBoolean:
|
|
181
|
+
isBoolean: Ze,
|
|
241
182
|
isObject: se,
|
|
242
|
-
isPlainObject:
|
|
183
|
+
isPlainObject: j,
|
|
243
184
|
isUndefined: U,
|
|
244
|
-
isDate:
|
|
245
|
-
isFile:
|
|
246
|
-
isBlob:
|
|
247
|
-
isRegExp:
|
|
185
|
+
isDate: et,
|
|
186
|
+
isFile: tt,
|
|
187
|
+
isBlob: nt,
|
|
188
|
+
isRegExp: gt,
|
|
248
189
|
isFunction: P,
|
|
249
|
-
isStream:
|
|
250
|
-
isURLSearchParams:
|
|
251
|
-
isTypedArray:
|
|
252
|
-
isFileList:
|
|
190
|
+
isStream: st,
|
|
191
|
+
isURLSearchParams: it,
|
|
192
|
+
isTypedArray: ht,
|
|
193
|
+
isFileList: rt,
|
|
253
194
|
forEach: L,
|
|
254
|
-
merge:
|
|
255
|
-
extend:
|
|
256
|
-
trim:
|
|
257
|
-
stripBOM:
|
|
258
|
-
inherits:
|
|
259
|
-
toFlatObject:
|
|
195
|
+
merge: Y,
|
|
196
|
+
extend: ct,
|
|
197
|
+
trim: at,
|
|
198
|
+
stripBOM: ut,
|
|
199
|
+
inherits: lt,
|
|
200
|
+
toFlatObject: ft,
|
|
260
201
|
kindOf: re,
|
|
261
202
|
kindOfTest: O,
|
|
262
|
-
endsWith:
|
|
263
|
-
toArray:
|
|
264
|
-
forEachEntry:
|
|
265
|
-
matchAll:
|
|
266
|
-
isHTMLForm:
|
|
267
|
-
hasOwnProperty:
|
|
268
|
-
hasOwnProp:
|
|
203
|
+
endsWith: dt,
|
|
204
|
+
toArray: pt,
|
|
205
|
+
forEachEntry: mt,
|
|
206
|
+
matchAll: yt,
|
|
207
|
+
isHTMLForm: Et,
|
|
208
|
+
hasOwnProperty: fe,
|
|
209
|
+
hasOwnProp: fe,
|
|
269
210
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
270
211
|
reduceDescriptors: Ne,
|
|
271
|
-
freezeMethods:
|
|
272
|
-
toObjectSet:
|
|
273
|
-
toCamelCase:
|
|
274
|
-
noop:
|
|
275
|
-
toFiniteNumber:
|
|
212
|
+
freezeMethods: St,
|
|
213
|
+
toObjectSet: bt,
|
|
214
|
+
toCamelCase: wt,
|
|
215
|
+
noop: At,
|
|
216
|
+
toFiniteNumber: Rt,
|
|
276
217
|
findKey: Ce,
|
|
277
218
|
global: Pe,
|
|
278
219
|
isContextDefined: _e,
|
|
279
220
|
ALPHABET: xe,
|
|
280
|
-
generateString:
|
|
281
|
-
isSpecCompliantForm:
|
|
282
|
-
toJSONObject:
|
|
221
|
+
generateString: Ot,
|
|
222
|
+
isSpecCompliantForm: Tt,
|
|
223
|
+
toJSONObject: Ct
|
|
283
224
|
};
|
|
284
225
|
function m(e, t, n, r, s) {
|
|
285
226
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), s && (this.response = s);
|
|
@@ -327,76 +268,76 @@ Object.defineProperties(m, Fe);
|
|
|
327
268
|
Object.defineProperty(De, "isAxiosError", { value: !0 });
|
|
328
269
|
m.from = (e, t, n, r, s, o) => {
|
|
329
270
|
const i = Object.create(De);
|
|
330
|
-
return a.toFlatObject(e, i, function(
|
|
331
|
-
return
|
|
332
|
-
}, (
|
|
271
|
+
return a.toFlatObject(e, i, function(f) {
|
|
272
|
+
return f !== Error.prototype;
|
|
273
|
+
}, (c) => c !== "isAxiosError"), m.call(i, e.message, t, n, r, s), i.cause = e, i.name = e.name, o && Object.assign(i, o), i;
|
|
333
274
|
};
|
|
334
|
-
const
|
|
335
|
-
function
|
|
275
|
+
const Pt = null;
|
|
276
|
+
function Q(e) {
|
|
336
277
|
return a.isPlainObject(e) || a.isArray(e);
|
|
337
278
|
}
|
|
338
279
|
function Ue(e) {
|
|
339
280
|
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
340
281
|
}
|
|
341
|
-
function
|
|
282
|
+
function pe(e, t, n) {
|
|
342
283
|
return e ? e.concat(t).map(function(s, o) {
|
|
343
284
|
return s = Ue(s), !n && o ? "[" + s + "]" : s;
|
|
344
285
|
}).join(n ? "." : "") : t;
|
|
345
286
|
}
|
|
346
|
-
function
|
|
347
|
-
return a.isArray(e) && !e.some(
|
|
287
|
+
function _t(e) {
|
|
288
|
+
return a.isArray(e) && !e.some(Q);
|
|
348
289
|
}
|
|
349
|
-
const
|
|
290
|
+
const Nt = a.toFlatObject(a, {}, null, function(t) {
|
|
350
291
|
return /^is[A-Z]/.test(t);
|
|
351
292
|
});
|
|
352
|
-
function
|
|
293
|
+
function K(e, t, n) {
|
|
353
294
|
if (!a.isObject(e))
|
|
354
295
|
throw new TypeError("target must be an object");
|
|
355
296
|
t = t || new FormData(), n = a.toFlatObject(n, {
|
|
356
297
|
metaTokens: !0,
|
|
357
298
|
dots: !1,
|
|
358
299
|
indexes: !1
|
|
359
|
-
}, !1, function(h,
|
|
360
|
-
return !a.isUndefined(
|
|
300
|
+
}, !1, function(h, A) {
|
|
301
|
+
return !a.isUndefined(A[h]);
|
|
361
302
|
});
|
|
362
|
-
const r = n.metaTokens, s = n.visitor || l, o = n.dots, i = n.indexes,
|
|
303
|
+
const r = n.metaTokens, s = n.visitor || l, o = n.dots, i = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
|
|
363
304
|
if (!a.isFunction(s))
|
|
364
305
|
throw new TypeError("visitor must be a function");
|
|
365
|
-
function
|
|
366
|
-
if (
|
|
306
|
+
function u(d) {
|
|
307
|
+
if (d === null)
|
|
367
308
|
return "";
|
|
368
|
-
if (a.isDate(
|
|
369
|
-
return
|
|
370
|
-
if (!
|
|
309
|
+
if (a.isDate(d))
|
|
310
|
+
return d.toISOString();
|
|
311
|
+
if (!f && a.isBlob(d))
|
|
371
312
|
throw new m("Blob is not supported. Use a Buffer instead.");
|
|
372
|
-
return a.isArrayBuffer(
|
|
313
|
+
return a.isArrayBuffer(d) || a.isTypedArray(d) ? f && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
|
|
373
314
|
}
|
|
374
|
-
function l(
|
|
375
|
-
let g =
|
|
376
|
-
if (
|
|
315
|
+
function l(d, h, A) {
|
|
316
|
+
let g = d;
|
|
317
|
+
if (d && !A && typeof d == "object") {
|
|
377
318
|
if (a.endsWith(h, "{}"))
|
|
378
|
-
h = r ? h : h.slice(0, -2),
|
|
379
|
-
else if (a.isArray(
|
|
380
|
-
return h = Ue(h), g.forEach(function(I,
|
|
319
|
+
h = r ? h : h.slice(0, -2), d = JSON.stringify(d);
|
|
320
|
+
else if (a.isArray(d) && _t(d) || (a.isFileList(d) || a.endsWith(h, "[]")) && (g = a.toArray(d)))
|
|
321
|
+
return h = Ue(h), g.forEach(function(I, Me) {
|
|
381
322
|
!(a.isUndefined(I) || I === null) && t.append(
|
|
382
323
|
// eslint-disable-next-line no-nested-ternary
|
|
383
|
-
i === !0 ?
|
|
384
|
-
|
|
324
|
+
i === !0 ? pe([h], Me, o) : i === null ? h : h + "[]",
|
|
325
|
+
u(I)
|
|
385
326
|
);
|
|
386
327
|
}), !1;
|
|
387
328
|
}
|
|
388
|
-
return
|
|
329
|
+
return Q(d) ? !0 : (t.append(pe(A, h, o), u(d)), !1);
|
|
389
330
|
}
|
|
390
|
-
const p = [], w = Object.assign(
|
|
331
|
+
const p = [], w = Object.assign(Nt, {
|
|
391
332
|
defaultVisitor: l,
|
|
392
|
-
convertValue:
|
|
393
|
-
isVisitable:
|
|
333
|
+
convertValue: u,
|
|
334
|
+
isVisitable: Q
|
|
394
335
|
});
|
|
395
|
-
function y(
|
|
396
|
-
if (!a.isUndefined(
|
|
397
|
-
if (p.indexOf(
|
|
336
|
+
function y(d, h) {
|
|
337
|
+
if (!a.isUndefined(d)) {
|
|
338
|
+
if (p.indexOf(d) !== -1)
|
|
398
339
|
throw Error("Circular reference detected in " + h.join("."));
|
|
399
|
-
p.push(
|
|
340
|
+
p.push(d), a.forEach(d, function(g, _) {
|
|
400
341
|
(!(a.isUndefined(g) || g === null) && s.call(
|
|
401
342
|
t,
|
|
402
343
|
g,
|
|
@@ -411,7 +352,7 @@ function J(e, t, n) {
|
|
|
411
352
|
throw new TypeError("data must be an object");
|
|
412
353
|
return y(e), t;
|
|
413
354
|
}
|
|
414
|
-
function
|
|
355
|
+
function he(e) {
|
|
415
356
|
const t = {
|
|
416
357
|
"!": "%21",
|
|
417
358
|
"'": "%27",
|
|
@@ -426,7 +367,7 @@ function me(e) {
|
|
|
426
367
|
});
|
|
427
368
|
}
|
|
428
369
|
function oe(e, t) {
|
|
429
|
-
this._pairs = [], e &&
|
|
370
|
+
this._pairs = [], e && K(e, this, t);
|
|
430
371
|
}
|
|
431
372
|
const Le = oe.prototype;
|
|
432
373
|
Le.append = function(t, n) {
|
|
@@ -434,19 +375,19 @@ Le.append = function(t, n) {
|
|
|
434
375
|
};
|
|
435
376
|
Le.toString = function(t) {
|
|
436
377
|
const n = t ? function(r) {
|
|
437
|
-
return t.call(this, r,
|
|
438
|
-
} :
|
|
378
|
+
return t.call(this, r, he);
|
|
379
|
+
} : he;
|
|
439
380
|
return this._pairs.map(function(s) {
|
|
440
381
|
return n(s[0]) + "=" + n(s[1]);
|
|
441
382
|
}, "").join("&");
|
|
442
383
|
};
|
|
443
|
-
function
|
|
384
|
+
function xt(e) {
|
|
444
385
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
445
386
|
}
|
|
446
387
|
function Be(e, t, n) {
|
|
447
388
|
if (!t)
|
|
448
389
|
return e;
|
|
449
|
-
const r = n && n.encode ||
|
|
390
|
+
const r = n && n.encode || xt, s = n && n.serialize;
|
|
450
391
|
let o;
|
|
451
392
|
if (s ? o = s(t, n) : o = a.isURLSearchParams(t) ? t.toString() : new oe(t, n).toString(r), o) {
|
|
452
393
|
const i = e.indexOf("#");
|
|
@@ -454,7 +395,7 @@ function Be(e, t, n) {
|
|
|
454
395
|
}
|
|
455
396
|
return e;
|
|
456
397
|
}
|
|
457
|
-
class
|
|
398
|
+
class Dt {
|
|
458
399
|
constructor() {
|
|
459
400
|
this.handlers = [];
|
|
460
401
|
}
|
|
@@ -508,36 +449,36 @@ class Lt {
|
|
|
508
449
|
});
|
|
509
450
|
}
|
|
510
451
|
}
|
|
511
|
-
const
|
|
452
|
+
const me = Dt, Ie = {
|
|
512
453
|
silentJSONParsing: !0,
|
|
513
454
|
forcedJSONParsing: !0,
|
|
514
455
|
clarifyTimeoutError: !1
|
|
515
|
-
},
|
|
456
|
+
}, Ft = typeof URLSearchParams < "u" ? URLSearchParams : oe, Ut = typeof FormData < "u" ? FormData : null, Lt = typeof Blob < "u" ? Blob : null, Bt = (() => {
|
|
516
457
|
let e;
|
|
517
458
|
return typeof navigator < "u" && ((e = navigator.product) === "ReactNative" || e === "NativeScript" || e === "NS") ? !1 : typeof window < "u" && typeof document < "u";
|
|
518
|
-
})(),
|
|
519
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(),
|
|
459
|
+
})(), It = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
460
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")(), b = {
|
|
520
461
|
isBrowser: !0,
|
|
521
462
|
classes: {
|
|
522
|
-
URLSearchParams:
|
|
523
|
-
FormData:
|
|
524
|
-
Blob:
|
|
463
|
+
URLSearchParams: Ft,
|
|
464
|
+
FormData: Ut,
|
|
465
|
+
Blob: Lt
|
|
525
466
|
},
|
|
526
|
-
isStandardBrowserEnv:
|
|
527
|
-
isStandardBrowserWebWorkerEnv:
|
|
467
|
+
isStandardBrowserEnv: Bt,
|
|
468
|
+
isStandardBrowserWebWorkerEnv: It,
|
|
528
469
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
529
470
|
};
|
|
530
|
-
function
|
|
531
|
-
return
|
|
471
|
+
function kt(e, t) {
|
|
472
|
+
return K(e, new b.classes.URLSearchParams(), Object.assign({
|
|
532
473
|
visitor: function(n, r, s, o) {
|
|
533
|
-
return
|
|
474
|
+
return b.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
534
475
|
}
|
|
535
476
|
}, t));
|
|
536
477
|
}
|
|
537
|
-
function
|
|
478
|
+
function jt(e) {
|
|
538
479
|
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
539
480
|
}
|
|
540
|
-
function
|
|
481
|
+
function qt(e) {
|
|
541
482
|
const t = {}, n = Object.keys(e);
|
|
542
483
|
let r;
|
|
543
484
|
const s = n.length;
|
|
@@ -546,24 +487,24 @@ function $t(e) {
|
|
|
546
487
|
o = n[r], t[o] = e[o];
|
|
547
488
|
return t;
|
|
548
489
|
}
|
|
549
|
-
function
|
|
490
|
+
function ke(e) {
|
|
550
491
|
function t(n, r, s, o) {
|
|
551
492
|
let i = n[o++];
|
|
552
|
-
const
|
|
553
|
-
return i = !i && a.isArray(s) ? s.length : i,
|
|
493
|
+
const c = Number.isFinite(+i), f = o >= n.length;
|
|
494
|
+
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] = qt(s[i])), !c);
|
|
554
495
|
}
|
|
555
496
|
if (a.isFormData(e) && a.isFunction(e.entries)) {
|
|
556
497
|
const n = {};
|
|
557
498
|
return a.forEachEntry(e, (r, s) => {
|
|
558
|
-
t(
|
|
499
|
+
t(jt(r), s, n, 0);
|
|
559
500
|
}), n;
|
|
560
501
|
}
|
|
561
502
|
return null;
|
|
562
503
|
}
|
|
563
|
-
const
|
|
504
|
+
const $t = {
|
|
564
505
|
"Content-Type": void 0
|
|
565
506
|
};
|
|
566
|
-
function
|
|
507
|
+
function Ht(e, t, n) {
|
|
567
508
|
if (a.isString(e))
|
|
568
509
|
try {
|
|
569
510
|
return (t || JSON.parse)(e), a.trim(e);
|
|
@@ -573,43 +514,43 @@ function Jt(e, t, n) {
|
|
|
573
514
|
}
|
|
574
515
|
return (n || JSON.stringify)(e);
|
|
575
516
|
}
|
|
576
|
-
const
|
|
517
|
+
const J = {
|
|
577
518
|
transitional: Ie,
|
|
578
519
|
adapter: ["xhr", "http"],
|
|
579
520
|
transformRequest: [function(t, n) {
|
|
580
521
|
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = a.isObject(t);
|
|
581
522
|
if (o && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
|
|
582
|
-
return s && s ? JSON.stringify(
|
|
523
|
+
return s && s ? JSON.stringify(ke(t)) : t;
|
|
583
524
|
if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t))
|
|
584
525
|
return t;
|
|
585
526
|
if (a.isArrayBufferView(t))
|
|
586
527
|
return t.buffer;
|
|
587
528
|
if (a.isURLSearchParams(t))
|
|
588
529
|
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
589
|
-
let
|
|
530
|
+
let c;
|
|
590
531
|
if (o) {
|
|
591
532
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
592
|
-
return
|
|
593
|
-
if ((
|
|
594
|
-
const
|
|
595
|
-
return
|
|
596
|
-
|
|
597
|
-
|
|
533
|
+
return kt(t, this.formSerializer).toString();
|
|
534
|
+
if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
535
|
+
const f = this.env && this.env.FormData;
|
|
536
|
+
return K(
|
|
537
|
+
c ? { "files[]": t } : t,
|
|
538
|
+
f && new f(),
|
|
598
539
|
this.formSerializer
|
|
599
540
|
);
|
|
600
541
|
}
|
|
601
542
|
}
|
|
602
|
-
return o || s ? (n.setContentType("application/json", !1),
|
|
543
|
+
return o || s ? (n.setContentType("application/json", !1), Ht(t)) : t;
|
|
603
544
|
}],
|
|
604
545
|
transformResponse: [function(t) {
|
|
605
|
-
const n = this.transitional ||
|
|
546
|
+
const n = this.transitional || J.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
|
|
606
547
|
if (t && a.isString(t) && (r && !this.responseType || s)) {
|
|
607
548
|
const i = !(n && n.silentJSONParsing) && s;
|
|
608
549
|
try {
|
|
609
550
|
return JSON.parse(t);
|
|
610
|
-
} catch (
|
|
551
|
+
} catch (c) {
|
|
611
552
|
if (i)
|
|
612
|
-
throw
|
|
553
|
+
throw c.name === "SyntaxError" ? m.from(c, m.ERR_BAD_RESPONSE, this, null, this.response) : c;
|
|
613
554
|
}
|
|
614
555
|
}
|
|
615
556
|
return t;
|
|
@@ -624,8 +565,8 @@ const V = {
|
|
|
624
565
|
maxContentLength: -1,
|
|
625
566
|
maxBodyLength: -1,
|
|
626
567
|
env: {
|
|
627
|
-
FormData:
|
|
628
|
-
Blob:
|
|
568
|
+
FormData: b.classes.FormData,
|
|
569
|
+
Blob: b.classes.Blob
|
|
629
570
|
},
|
|
630
571
|
validateStatus: function(t) {
|
|
631
572
|
return t >= 200 && t < 300;
|
|
@@ -637,12 +578,12 @@ const V = {
|
|
|
637
578
|
}
|
|
638
579
|
};
|
|
639
580
|
a.forEach(["delete", "get", "head"], function(t) {
|
|
640
|
-
|
|
581
|
+
J.headers[t] = {};
|
|
641
582
|
});
|
|
642
583
|
a.forEach(["post", "put", "patch"], function(t) {
|
|
643
|
-
|
|
584
|
+
J.headers[t] = a.merge($t);
|
|
644
585
|
});
|
|
645
|
-
const ie =
|
|
586
|
+
const ie = J, zt = a.toObjectSet([
|
|
646
587
|
"age",
|
|
647
588
|
"authorization",
|
|
648
589
|
"content-length",
|
|
@@ -660,28 +601,28 @@ const ie = V, Vt = a.toObjectSet([
|
|
|
660
601
|
"referer",
|
|
661
602
|
"retry-after",
|
|
662
603
|
"user-agent"
|
|
663
|
-
]),
|
|
604
|
+
]), Vt = (e) => {
|
|
664
605
|
const t = {};
|
|
665
606
|
let n, r, s;
|
|
666
607
|
return e && e.split(`
|
|
667
608
|
`).forEach(function(i) {
|
|
668
|
-
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] &&
|
|
609
|
+
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && zt[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
669
610
|
}), t;
|
|
670
|
-
},
|
|
611
|
+
}, ye = Symbol("internals");
|
|
671
612
|
function D(e) {
|
|
672
613
|
return e && String(e).trim().toLowerCase();
|
|
673
614
|
}
|
|
674
615
|
function q(e) {
|
|
675
616
|
return e === !1 || e == null ? e : a.isArray(e) ? e.map(q) : String(e);
|
|
676
617
|
}
|
|
677
|
-
function
|
|
618
|
+
function Kt(e) {
|
|
678
619
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
679
620
|
let r;
|
|
680
621
|
for (; r = n.exec(e); )
|
|
681
622
|
t[r[1]] = r[2];
|
|
682
623
|
return t;
|
|
683
624
|
}
|
|
684
|
-
function
|
|
625
|
+
function Jt(e) {
|
|
685
626
|
return /^[-_a-zA-Z]+$/.test(e.trim());
|
|
686
627
|
}
|
|
687
628
|
function W(e, t, n, r, s) {
|
|
@@ -694,10 +635,10 @@ function W(e, t, n, r, s) {
|
|
|
694
635
|
return r.test(t);
|
|
695
636
|
}
|
|
696
637
|
}
|
|
697
|
-
function
|
|
638
|
+
function vt(e) {
|
|
698
639
|
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
|
|
699
640
|
}
|
|
700
|
-
function
|
|
641
|
+
function Mt(e, t) {
|
|
701
642
|
const n = a.toCamelCase(" " + t);
|
|
702
643
|
["get", "set", "has"].forEach((r) => {
|
|
703
644
|
Object.defineProperty(e, r + n, {
|
|
@@ -708,21 +649,21 @@ function Yt(e, t) {
|
|
|
708
649
|
});
|
|
709
650
|
});
|
|
710
651
|
}
|
|
711
|
-
|
|
652
|
+
let v = class {
|
|
712
653
|
constructor(t) {
|
|
713
654
|
t && this.set(t);
|
|
714
655
|
}
|
|
715
656
|
set(t, n, r) {
|
|
716
657
|
const s = this;
|
|
717
|
-
function o(
|
|
718
|
-
const l = D(
|
|
658
|
+
function o(c, f, u) {
|
|
659
|
+
const l = D(f);
|
|
719
660
|
if (!l)
|
|
720
661
|
throw new Error("header name must be a non-empty string");
|
|
721
662
|
const p = a.findKey(s, l);
|
|
722
|
-
(!p || s[p] === void 0 ||
|
|
663
|
+
(!p || s[p] === void 0 || u === !0 || u === void 0 && s[p] !== !1) && (s[p || f] = q(c));
|
|
723
664
|
}
|
|
724
|
-
const i = (
|
|
725
|
-
return a.isPlainObject(t) || t instanceof this.constructor ? i(t, n) : a.isString(t) && (t = t.trim()) && !
|
|
665
|
+
const i = (c, f) => a.forEach(c, (u, l) => o(u, l, f));
|
|
666
|
+
return a.isPlainObject(t) || t instanceof this.constructor ? i(t, n) : a.isString(t) && (t = t.trim()) && !Jt(t) ? i(Vt(t), n) : t != null && o(n, t, r), this;
|
|
726
667
|
}
|
|
727
668
|
get(t, n) {
|
|
728
669
|
if (t = D(t), t) {
|
|
@@ -732,7 +673,7 @@ class v {
|
|
|
732
673
|
if (!n)
|
|
733
674
|
return s;
|
|
734
675
|
if (n === !0)
|
|
735
|
-
return
|
|
676
|
+
return Kt(s);
|
|
736
677
|
if (a.isFunction(n))
|
|
737
678
|
return n.call(this, s, r);
|
|
738
679
|
if (a.isRegExp(n))
|
|
@@ -753,8 +694,8 @@ class v {
|
|
|
753
694
|
let s = !1;
|
|
754
695
|
function o(i) {
|
|
755
696
|
if (i = D(i), i) {
|
|
756
|
-
const
|
|
757
|
-
|
|
697
|
+
const c = a.findKey(r, i);
|
|
698
|
+
c && (!n || W(r, r[c], c, n)) && (delete r[c], s = !0);
|
|
758
699
|
}
|
|
759
700
|
}
|
|
760
701
|
return a.isArray(t) ? t.forEach(o) : o(t), s;
|
|
@@ -776,8 +717,8 @@ class v {
|
|
|
776
717
|
n[i] = q(s), delete n[o];
|
|
777
718
|
return;
|
|
778
719
|
}
|
|
779
|
-
const
|
|
780
|
-
|
|
720
|
+
const c = t ? vt(o) : String(o).trim();
|
|
721
|
+
c !== o && delete n[o], n[c] = q(s), r[c] = !0;
|
|
781
722
|
}), this;
|
|
782
723
|
}
|
|
783
724
|
concat(...t) {
|
|
@@ -807,16 +748,16 @@ class v {
|
|
|
807
748
|
return n.forEach((s) => r.set(s)), r;
|
|
808
749
|
}
|
|
809
750
|
static accessor(t) {
|
|
810
|
-
const r = (this[
|
|
751
|
+
const r = (this[ye] = this[ye] = {
|
|
811
752
|
accessors: {}
|
|
812
753
|
}).accessors, s = this.prototype;
|
|
813
754
|
function o(i) {
|
|
814
|
-
const
|
|
815
|
-
r[
|
|
755
|
+
const c = D(i);
|
|
756
|
+
r[c] || (Mt(s, i), r[c] = !0);
|
|
816
757
|
}
|
|
817
758
|
return a.isArray(t) ? t.forEach(o) : o(t), this;
|
|
818
759
|
}
|
|
819
|
-
}
|
|
760
|
+
};
|
|
820
761
|
v.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
821
762
|
a.freezeMethods(v.prototype);
|
|
822
763
|
a.freezeMethods(v);
|
|
@@ -824,11 +765,11 @@ const R = v;
|
|
|
824
765
|
function G(e, t) {
|
|
825
766
|
const n = this || ie, r = t || n, s = R.from(r.headers);
|
|
826
767
|
let o = r.data;
|
|
827
|
-
return a.forEach(e, function(
|
|
828
|
-
o =
|
|
768
|
+
return a.forEach(e, function(c) {
|
|
769
|
+
o = c.call(n, o, s.normalize(), t ? t.status : void 0);
|
|
829
770
|
}), s.normalize(), o;
|
|
830
771
|
}
|
|
831
|
-
function
|
|
772
|
+
function je(e) {
|
|
832
773
|
return !!(e && e.__CANCEL__);
|
|
833
774
|
}
|
|
834
775
|
function B(e, t, n) {
|
|
@@ -837,7 +778,7 @@ function B(e, t, n) {
|
|
|
837
778
|
a.inherits(B, m, {
|
|
838
779
|
__CANCEL__: !0
|
|
839
780
|
});
|
|
840
|
-
function
|
|
781
|
+
function Wt(e, t, n) {
|
|
841
782
|
const r = n.config.validateStatus;
|
|
842
783
|
!n.status || !r || r(n.status) ? e(n) : t(new m(
|
|
843
784
|
"Request failed with status code " + n.status,
|
|
@@ -847,13 +788,13 @@ function Qt(e, t, n) {
|
|
|
847
788
|
n
|
|
848
789
|
));
|
|
849
790
|
}
|
|
850
|
-
const
|
|
791
|
+
const Gt = b.isStandardBrowserEnv ? (
|
|
851
792
|
// Standard browser envs support document.cookie
|
|
852
793
|
function() {
|
|
853
794
|
return {
|
|
854
|
-
write: function(n, r, s, o, i,
|
|
855
|
-
const
|
|
856
|
-
|
|
795
|
+
write: function(n, r, s, o, i, c) {
|
|
796
|
+
const f = [];
|
|
797
|
+
f.push(n + "=" + encodeURIComponent(r)), a.isNumber(s) && f.push("expires=" + new Date(s).toGMTString()), a.isString(o) && f.push("path=" + o), a.isString(i) && f.push("domain=" + i), c === !0 && f.push("secure"), document.cookie = f.join("; ");
|
|
857
798
|
},
|
|
858
799
|
read: function(n) {
|
|
859
800
|
const r = document.cookie.match(new RegExp("(^|;\\s*)(" + n + ")=([^;]*)"));
|
|
@@ -878,16 +819,16 @@ const Xt = S.isStandardBrowserEnv ? (
|
|
|
878
819
|
};
|
|
879
820
|
}()
|
|
880
821
|
);
|
|
881
|
-
function
|
|
822
|
+
function Xt(e) {
|
|
882
823
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
883
824
|
}
|
|
884
|
-
function
|
|
825
|
+
function Yt(e, t) {
|
|
885
826
|
return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
886
827
|
}
|
|
887
828
|
function qe(e, t) {
|
|
888
|
-
return e && !
|
|
829
|
+
return e && !Xt(t) ? Yt(e, t) : t;
|
|
889
830
|
}
|
|
890
|
-
const
|
|
831
|
+
const Qt = b.isStandardBrowserEnv ? (
|
|
891
832
|
// Standard browser envs have full support of the APIs needed to test
|
|
892
833
|
// whether the request URL is of the same origin as current location.
|
|
893
834
|
function() {
|
|
@@ -907,8 +848,8 @@ const tn = S.isStandardBrowserEnv ? (
|
|
|
907
848
|
};
|
|
908
849
|
}
|
|
909
850
|
return r = s(window.location.href), function(i) {
|
|
910
|
-
const
|
|
911
|
-
return
|
|
851
|
+
const c = a.isString(i) ? s(i) : i;
|
|
852
|
+
return c.protocol === r.protocol && c.host === r.host;
|
|
912
853
|
};
|
|
913
854
|
}()
|
|
914
855
|
) : (
|
|
@@ -919,115 +860,115 @@ const tn = S.isStandardBrowserEnv ? (
|
|
|
919
860
|
};
|
|
920
861
|
}()
|
|
921
862
|
);
|
|
922
|
-
function
|
|
863
|
+
function Zt(e) {
|
|
923
864
|
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
924
865
|
return t && t[1] || "";
|
|
925
866
|
}
|
|
926
|
-
function
|
|
867
|
+
function en(e, t) {
|
|
927
868
|
e = e || 10;
|
|
928
869
|
const n = new Array(e), r = new Array(e);
|
|
929
870
|
let s = 0, o = 0, i;
|
|
930
|
-
return t = t !== void 0 ? t : 1e3, function(
|
|
931
|
-
const
|
|
932
|
-
i || (i =
|
|
871
|
+
return t = t !== void 0 ? t : 1e3, function(f) {
|
|
872
|
+
const u = Date.now(), l = r[o];
|
|
873
|
+
i || (i = u), n[s] = f, r[s] = u;
|
|
933
874
|
let p = o, w = 0;
|
|
934
875
|
for (; p !== s; )
|
|
935
876
|
w += n[p++], p = p % e;
|
|
936
|
-
if (s = (s + 1) % e, s === o && (o = (o + 1) % e),
|
|
877
|
+
if (s = (s + 1) % e, s === o && (o = (o + 1) % e), u - i < t)
|
|
937
878
|
return;
|
|
938
|
-
const y = l &&
|
|
879
|
+
const y = l && u - l;
|
|
939
880
|
return y ? Math.round(w * 1e3 / y) : void 0;
|
|
940
881
|
};
|
|
941
882
|
}
|
|
942
|
-
function
|
|
883
|
+
function Ee(e, t) {
|
|
943
884
|
let n = 0;
|
|
944
|
-
const r =
|
|
885
|
+
const r = en(50, 250);
|
|
945
886
|
return (s) => {
|
|
946
|
-
const o = s.loaded, i = s.lengthComputable ? s.total : void 0,
|
|
887
|
+
const o = s.loaded, i = s.lengthComputable ? s.total : void 0, c = o - n, f = r(c), u = o <= i;
|
|
947
888
|
n = o;
|
|
948
889
|
const l = {
|
|
949
890
|
loaded: o,
|
|
950
891
|
total: i,
|
|
951
892
|
progress: i ? o / i : void 0,
|
|
952
|
-
bytes:
|
|
953
|
-
rate:
|
|
954
|
-
estimated:
|
|
893
|
+
bytes: c,
|
|
894
|
+
rate: f || void 0,
|
|
895
|
+
estimated: f && i && u ? (i - o) / f : void 0,
|
|
955
896
|
event: s
|
|
956
897
|
};
|
|
957
898
|
l[t ? "download" : "upload"] = !0, e(l);
|
|
958
899
|
};
|
|
959
900
|
}
|
|
960
|
-
const
|
|
901
|
+
const tn = typeof XMLHttpRequest < "u", nn = tn && function(e) {
|
|
961
902
|
return new Promise(function(n, r) {
|
|
962
903
|
let s = e.data;
|
|
963
904
|
const o = R.from(e.headers).normalize(), i = e.responseType;
|
|
964
|
-
let
|
|
965
|
-
function
|
|
966
|
-
e.cancelToken && e.cancelToken.unsubscribe(
|
|
905
|
+
let c;
|
|
906
|
+
function f() {
|
|
907
|
+
e.cancelToken && e.cancelToken.unsubscribe(c), e.signal && e.signal.removeEventListener("abort", c);
|
|
967
908
|
}
|
|
968
|
-
a.isFormData(s) && (
|
|
969
|
-
let
|
|
909
|
+
a.isFormData(s) && (b.isStandardBrowserEnv || b.isStandardBrowserWebWorkerEnv) && o.setContentType(!1);
|
|
910
|
+
let u = new XMLHttpRequest();
|
|
970
911
|
if (e.auth) {
|
|
971
|
-
const y = e.auth.username || "",
|
|
972
|
-
o.set("Authorization", "Basic " + btoa(y + ":" +
|
|
912
|
+
const y = e.auth.username || "", d = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
|
|
913
|
+
o.set("Authorization", "Basic " + btoa(y + ":" + d));
|
|
973
914
|
}
|
|
974
915
|
const l = qe(e.baseURL, e.url);
|
|
975
|
-
|
|
916
|
+
u.open(e.method.toUpperCase(), Be(l, e.params, e.paramsSerializer), !0), u.timeout = e.timeout;
|
|
976
917
|
function p() {
|
|
977
|
-
if (!
|
|
918
|
+
if (!u)
|
|
978
919
|
return;
|
|
979
920
|
const y = R.from(
|
|
980
|
-
"getAllResponseHeaders" in
|
|
921
|
+
"getAllResponseHeaders" in u && u.getAllResponseHeaders()
|
|
981
922
|
), h = {
|
|
982
|
-
data: !i || i === "text" || i === "json" ?
|
|
983
|
-
status:
|
|
984
|
-
statusText:
|
|
923
|
+
data: !i || i === "text" || i === "json" ? u.responseText : u.response,
|
|
924
|
+
status: u.status,
|
|
925
|
+
statusText: u.statusText,
|
|
985
926
|
headers: y,
|
|
986
927
|
config: e,
|
|
987
|
-
request:
|
|
928
|
+
request: u
|
|
988
929
|
};
|
|
989
|
-
|
|
990
|
-
n(g),
|
|
930
|
+
Wt(function(g) {
|
|
931
|
+
n(g), f();
|
|
991
932
|
}, function(g) {
|
|
992
|
-
r(g),
|
|
993
|
-
}, h),
|
|
933
|
+
r(g), f();
|
|
934
|
+
}, h), u = null;
|
|
994
935
|
}
|
|
995
|
-
if ("onloadend" in
|
|
996
|
-
!
|
|
997
|
-
},
|
|
998
|
-
|
|
999
|
-
},
|
|
1000
|
-
r(new m("Network Error", m.ERR_NETWORK, e,
|
|
1001
|
-
},
|
|
1002
|
-
let
|
|
936
|
+
if ("onloadend" in u ? u.onloadend = p : u.onreadystatechange = function() {
|
|
937
|
+
!u || u.readyState !== 4 || u.status === 0 && !(u.responseURL && u.responseURL.indexOf("file:") === 0) || setTimeout(p);
|
|
938
|
+
}, u.onabort = function() {
|
|
939
|
+
u && (r(new m("Request aborted", m.ECONNABORTED, e, u)), u = null);
|
|
940
|
+
}, u.onerror = function() {
|
|
941
|
+
r(new m("Network Error", m.ERR_NETWORK, e, u)), u = null;
|
|
942
|
+
}, u.ontimeout = function() {
|
|
943
|
+
let d = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded";
|
|
1003
944
|
const h = e.transitional || Ie;
|
|
1004
|
-
e.timeoutErrorMessage && (
|
|
1005
|
-
|
|
945
|
+
e.timeoutErrorMessage && (d = e.timeoutErrorMessage), r(new m(
|
|
946
|
+
d,
|
|
1006
947
|
h.clarifyTimeoutError ? m.ETIMEDOUT : m.ECONNABORTED,
|
|
1007
948
|
e,
|
|
1008
|
-
|
|
1009
|
-
)),
|
|
1010
|
-
},
|
|
1011
|
-
const y = (e.withCredentials ||
|
|
949
|
+
u
|
|
950
|
+
)), u = null;
|
|
951
|
+
}, b.isStandardBrowserEnv) {
|
|
952
|
+
const y = (e.withCredentials || Qt(l)) && e.xsrfCookieName && Gt.read(e.xsrfCookieName);
|
|
1012
953
|
y && o.set(e.xsrfHeaderName, y);
|
|
1013
954
|
}
|
|
1014
|
-
s === void 0 && o.setContentType(null), "setRequestHeader" in
|
|
1015
|
-
|
|
1016
|
-
}), a.isUndefined(e.withCredentials) || (
|
|
1017
|
-
|
|
1018
|
-
}, e.cancelToken && e.cancelToken.subscribe(
|
|
1019
|
-
const w =
|
|
1020
|
-
if (w &&
|
|
955
|
+
s === void 0 && o.setContentType(null), "setRequestHeader" in u && a.forEach(o.toJSON(), function(d, h) {
|
|
956
|
+
u.setRequestHeader(h, d);
|
|
957
|
+
}), a.isUndefined(e.withCredentials) || (u.withCredentials = !!e.withCredentials), i && i !== "json" && (u.responseType = e.responseType), typeof e.onDownloadProgress == "function" && u.addEventListener("progress", Ee(e.onDownloadProgress, !0)), typeof e.onUploadProgress == "function" && u.upload && u.upload.addEventListener("progress", Ee(e.onUploadProgress)), (e.cancelToken || e.signal) && (c = (y) => {
|
|
958
|
+
u && (r(!y || y.type ? new B(null, e, u) : y), u.abort(), u = null);
|
|
959
|
+
}, e.cancelToken && e.cancelToken.subscribe(c), e.signal && (e.signal.aborted ? c() : e.signal.addEventListener("abort", c)));
|
|
960
|
+
const w = Zt(l);
|
|
961
|
+
if (w && b.protocols.indexOf(w) === -1) {
|
|
1021
962
|
r(new m("Unsupported protocol " + w + ":", m.ERR_BAD_REQUEST, e));
|
|
1022
963
|
return;
|
|
1023
964
|
}
|
|
1024
|
-
|
|
965
|
+
u.send(s || null);
|
|
1025
966
|
});
|
|
1026
|
-
},
|
|
1027
|
-
http:
|
|
1028
|
-
xhr:
|
|
967
|
+
}, $ = {
|
|
968
|
+
http: Pt,
|
|
969
|
+
xhr: nn
|
|
1029
970
|
};
|
|
1030
|
-
a.forEach(
|
|
971
|
+
a.forEach($, (e, t) => {
|
|
1031
972
|
if (e) {
|
|
1032
973
|
try {
|
|
1033
974
|
Object.defineProperty(e, "name", { value: t });
|
|
@@ -1036,80 +977,80 @@ a.forEach(H, (e, t) => {
|
|
|
1036
977
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1037
978
|
}
|
|
1038
979
|
});
|
|
1039
|
-
const
|
|
980
|
+
const rn = {
|
|
1040
981
|
getAdapter: (e) => {
|
|
1041
982
|
e = a.isArray(e) ? e : [e];
|
|
1042
983
|
const { length: t } = e;
|
|
1043
984
|
let n, r;
|
|
1044
|
-
for (let s = 0; s < t && (n = e[s], !(r = a.isString(n) ?
|
|
985
|
+
for (let s = 0; s < t && (n = e[s], !(r = a.isString(n) ? $[n.toLowerCase()] : n)); s++)
|
|
1045
986
|
;
|
|
1046
987
|
if (!r)
|
|
1047
988
|
throw r === !1 ? new m(
|
|
1048
989
|
`Adapter ${n} is not supported by the environment`,
|
|
1049
990
|
"ERR_NOT_SUPPORT"
|
|
1050
991
|
) : new Error(
|
|
1051
|
-
a.hasOwnProp(
|
|
992
|
+
a.hasOwnProp($, n) ? `Adapter '${n}' is not available in the build` : `Unknown adapter '${n}'`
|
|
1052
993
|
);
|
|
1053
994
|
if (!a.isFunction(r))
|
|
1054
995
|
throw new TypeError("adapter is not a function");
|
|
1055
996
|
return r;
|
|
1056
997
|
},
|
|
1057
|
-
adapters:
|
|
998
|
+
adapters: $
|
|
1058
999
|
};
|
|
1059
|
-
function
|
|
1000
|
+
function X(e) {
|
|
1060
1001
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1061
1002
|
throw new B(null, e);
|
|
1062
1003
|
}
|
|
1063
|
-
function
|
|
1064
|
-
return
|
|
1004
|
+
function we(e) {
|
|
1005
|
+
return X(e), e.headers = R.from(e.headers), e.data = G.call(
|
|
1065
1006
|
e,
|
|
1066
1007
|
e.transformRequest
|
|
1067
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1),
|
|
1068
|
-
return
|
|
1008
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), rn.getAdapter(e.adapter || ie.adapter)(e).then(function(r) {
|
|
1009
|
+
return X(e), r.data = G.call(
|
|
1069
1010
|
e,
|
|
1070
1011
|
e.transformResponse,
|
|
1071
1012
|
r
|
|
1072
1013
|
), r.headers = R.from(r.headers), r;
|
|
1073
1014
|
}, function(r) {
|
|
1074
|
-
return
|
|
1015
|
+
return je(r) || (X(e), r && r.response && (r.response.data = G.call(
|
|
1075
1016
|
e,
|
|
1076
1017
|
e.transformResponse,
|
|
1077
1018
|
r.response
|
|
1078
1019
|
), r.response.headers = R.from(r.response.headers))), Promise.reject(r);
|
|
1079
1020
|
});
|
|
1080
1021
|
}
|
|
1081
|
-
const
|
|
1022
|
+
const ge = (e) => e instanceof R ? e.toJSON() : e;
|
|
1082
1023
|
function N(e, t) {
|
|
1083
1024
|
t = t || {};
|
|
1084
1025
|
const n = {};
|
|
1085
|
-
function r(
|
|
1086
|
-
return a.isPlainObject(
|
|
1026
|
+
function r(u, l, p) {
|
|
1027
|
+
return a.isPlainObject(u) && a.isPlainObject(l) ? a.merge.call({ caseless: p }, u, l) : a.isPlainObject(l) ? a.merge({}, l) : a.isArray(l) ? l.slice() : l;
|
|
1087
1028
|
}
|
|
1088
|
-
function s(
|
|
1029
|
+
function s(u, l, p) {
|
|
1089
1030
|
if (a.isUndefined(l)) {
|
|
1090
|
-
if (!a.isUndefined(
|
|
1091
|
-
return r(void 0,
|
|
1031
|
+
if (!a.isUndefined(u))
|
|
1032
|
+
return r(void 0, u, p);
|
|
1092
1033
|
} else
|
|
1093
|
-
return r(
|
|
1034
|
+
return r(u, l, p);
|
|
1094
1035
|
}
|
|
1095
|
-
function o(
|
|
1036
|
+
function o(u, l) {
|
|
1096
1037
|
if (!a.isUndefined(l))
|
|
1097
1038
|
return r(void 0, l);
|
|
1098
1039
|
}
|
|
1099
|
-
function i(
|
|
1040
|
+
function i(u, l) {
|
|
1100
1041
|
if (a.isUndefined(l)) {
|
|
1101
|
-
if (!a.isUndefined(
|
|
1102
|
-
return r(void 0,
|
|
1042
|
+
if (!a.isUndefined(u))
|
|
1043
|
+
return r(void 0, u);
|
|
1103
1044
|
} else
|
|
1104
1045
|
return r(void 0, l);
|
|
1105
1046
|
}
|
|
1106
|
-
function u
|
|
1047
|
+
function c(u, l, p) {
|
|
1107
1048
|
if (p in t)
|
|
1108
|
-
return r(
|
|
1049
|
+
return r(u, l);
|
|
1109
1050
|
if (p in e)
|
|
1110
|
-
return r(void 0,
|
|
1051
|
+
return r(void 0, u);
|
|
1111
1052
|
}
|
|
1112
|
-
const
|
|
1053
|
+
const f = {
|
|
1113
1054
|
url: o,
|
|
1114
1055
|
method: o,
|
|
1115
1056
|
data: o,
|
|
@@ -1136,40 +1077,40 @@ function N(e, t) {
|
|
|
1136
1077
|
cancelToken: i,
|
|
1137
1078
|
socketPath: i,
|
|
1138
1079
|
responseEncoding: i,
|
|
1139
|
-
validateStatus:
|
|
1140
|
-
headers: (
|
|
1080
|
+
validateStatus: c,
|
|
1081
|
+
headers: (u, l) => s(ge(u), ge(l), !0)
|
|
1141
1082
|
};
|
|
1142
1083
|
return a.forEach(Object.keys(e).concat(Object.keys(t)), function(l) {
|
|
1143
|
-
const p =
|
|
1144
|
-
a.isUndefined(w) && p !==
|
|
1084
|
+
const p = f[l] || s, w = p(e[l], t[l], l);
|
|
1085
|
+
a.isUndefined(w) && p !== c || (n[l] = w);
|
|
1145
1086
|
}), n;
|
|
1146
1087
|
}
|
|
1147
|
-
const
|
|
1088
|
+
const $e = "1.3.4", ae = {};
|
|
1148
1089
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1149
1090
|
ae[e] = function(r) {
|
|
1150
1091
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1151
1092
|
};
|
|
1152
1093
|
});
|
|
1153
|
-
const
|
|
1094
|
+
const Se = {};
|
|
1154
1095
|
ae.transitional = function(t, n, r) {
|
|
1155
1096
|
function s(o, i) {
|
|
1156
|
-
return "[Axios v" +
|
|
1097
|
+
return "[Axios v" + $e + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
|
|
1157
1098
|
}
|
|
1158
|
-
return (o, i,
|
|
1099
|
+
return (o, i, c) => {
|
|
1159
1100
|
if (t === !1)
|
|
1160
1101
|
throw new m(
|
|
1161
1102
|
s(i, " has been removed" + (n ? " in " + n : "")),
|
|
1162
1103
|
m.ERR_DEPRECATED
|
|
1163
1104
|
);
|
|
1164
|
-
return n && !
|
|
1105
|
+
return n && !Se[i] && (Se[i] = !0, console.warn(
|
|
1165
1106
|
s(
|
|
1166
1107
|
i,
|
|
1167
1108
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
1168
1109
|
)
|
|
1169
|
-
)), t ? t(o, i,
|
|
1110
|
+
)), t ? t(o, i, c) : !0;
|
|
1170
1111
|
};
|
|
1171
1112
|
};
|
|
1172
|
-
function
|
|
1113
|
+
function sn(e, t, n) {
|
|
1173
1114
|
if (typeof e != "object")
|
|
1174
1115
|
throw new m("options must be an object", m.ERR_BAD_OPTION_VALUE);
|
|
1175
1116
|
const r = Object.keys(e);
|
|
@@ -1177,9 +1118,9 @@ function cn(e, t, n) {
|
|
|
1177
1118
|
for (; s-- > 0; ) {
|
|
1178
1119
|
const o = r[s], i = t[o];
|
|
1179
1120
|
if (i) {
|
|
1180
|
-
const
|
|
1181
|
-
if (
|
|
1182
|
-
throw new m("option " + o + " must be " +
|
|
1121
|
+
const c = e[o], f = c === void 0 || i(c, o, e);
|
|
1122
|
+
if (f !== !0)
|
|
1123
|
+
throw new m("option " + o + " must be " + f, m.ERR_BAD_OPTION_VALUE);
|
|
1183
1124
|
continue;
|
|
1184
1125
|
}
|
|
1185
1126
|
if (n !== !0)
|
|
@@ -1187,14 +1128,14 @@ function cn(e, t, n) {
|
|
|
1187
1128
|
}
|
|
1188
1129
|
}
|
|
1189
1130
|
const Z = {
|
|
1190
|
-
assertOptions:
|
|
1131
|
+
assertOptions: sn,
|
|
1191
1132
|
validators: ae
|
|
1192
1133
|
}, T = Z.validators;
|
|
1193
|
-
class
|
|
1134
|
+
let z = class {
|
|
1194
1135
|
constructor(t) {
|
|
1195
1136
|
this.defaults = t, this.interceptors = {
|
|
1196
|
-
request: new
|
|
1197
|
-
response: new
|
|
1137
|
+
request: new me(),
|
|
1138
|
+
response: new me()
|
|
1198
1139
|
};
|
|
1199
1140
|
}
|
|
1200
1141
|
/**
|
|
@@ -1222,44 +1163,44 @@ class $ {
|
|
|
1222
1163
|
o[n.method]
|
|
1223
1164
|
), i && a.forEach(
|
|
1224
1165
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1225
|
-
(
|
|
1226
|
-
delete o[
|
|
1166
|
+
(d) => {
|
|
1167
|
+
delete o[d];
|
|
1227
1168
|
}
|
|
1228
1169
|
), n.headers = R.concat(i, o);
|
|
1229
|
-
const
|
|
1230
|
-
let
|
|
1170
|
+
const c = [];
|
|
1171
|
+
let f = !0;
|
|
1231
1172
|
this.interceptors.request.forEach(function(h) {
|
|
1232
|
-
typeof h.runWhen == "function" && h.runWhen(n) === !1 || (
|
|
1173
|
+
typeof h.runWhen == "function" && h.runWhen(n) === !1 || (f = f && h.synchronous, c.unshift(h.fulfilled, h.rejected));
|
|
1233
1174
|
});
|
|
1234
|
-
const
|
|
1175
|
+
const u = [];
|
|
1235
1176
|
this.interceptors.response.forEach(function(h) {
|
|
1236
|
-
|
|
1177
|
+
u.push(h.fulfilled, h.rejected);
|
|
1237
1178
|
});
|
|
1238
1179
|
let l, p = 0, w;
|
|
1239
|
-
if (!
|
|
1240
|
-
const
|
|
1241
|
-
for (
|
|
1242
|
-
l = l.then(
|
|
1180
|
+
if (!f) {
|
|
1181
|
+
const d = [we.bind(this), void 0];
|
|
1182
|
+
for (d.unshift.apply(d, c), d.push.apply(d, u), w = d.length, l = Promise.resolve(n); p < w; )
|
|
1183
|
+
l = l.then(d[p++], d[p++]);
|
|
1243
1184
|
return l;
|
|
1244
1185
|
}
|
|
1245
|
-
w =
|
|
1186
|
+
w = c.length;
|
|
1246
1187
|
let y = n;
|
|
1247
1188
|
for (p = 0; p < w; ) {
|
|
1248
|
-
const
|
|
1189
|
+
const d = c[p++], h = c[p++];
|
|
1249
1190
|
try {
|
|
1250
|
-
y =
|
|
1251
|
-
} catch (
|
|
1252
|
-
h.call(this,
|
|
1191
|
+
y = d(y);
|
|
1192
|
+
} catch (A) {
|
|
1193
|
+
h.call(this, A);
|
|
1253
1194
|
break;
|
|
1254
1195
|
}
|
|
1255
1196
|
}
|
|
1256
1197
|
try {
|
|
1257
|
-
l =
|
|
1258
|
-
} catch (
|
|
1259
|
-
return Promise.reject(
|
|
1198
|
+
l = we.call(this, y);
|
|
1199
|
+
} catch (d) {
|
|
1200
|
+
return Promise.reject(d);
|
|
1260
1201
|
}
|
|
1261
|
-
for (p = 0, w =
|
|
1262
|
-
l = l.then(
|
|
1202
|
+
for (p = 0, w = u.length; p < w; )
|
|
1203
|
+
l = l.then(u[p++], u[p++]);
|
|
1263
1204
|
return l;
|
|
1264
1205
|
}
|
|
1265
1206
|
getUri(t) {
|
|
@@ -1267,9 +1208,9 @@ class $ {
|
|
|
1267
1208
|
const n = qe(t.baseURL, t.url);
|
|
1268
1209
|
return Be(n, t.params, t.paramsSerializer);
|
|
1269
1210
|
}
|
|
1270
|
-
}
|
|
1211
|
+
};
|
|
1271
1212
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1272
|
-
|
|
1213
|
+
z.prototype[t] = function(n, r) {
|
|
1273
1214
|
return this.request(N(r || {}, {
|
|
1274
1215
|
method: t,
|
|
1275
1216
|
url: n,
|
|
@@ -1279,8 +1220,8 @@ a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1279
1220
|
});
|
|
1280
1221
|
a.forEach(["post", "put", "patch"], function(t) {
|
|
1281
1222
|
function n(r) {
|
|
1282
|
-
return function(o, i,
|
|
1283
|
-
return this.request(N(
|
|
1223
|
+
return function(o, i, c) {
|
|
1224
|
+
return this.request(N(c || {}, {
|
|
1284
1225
|
method: t,
|
|
1285
1226
|
headers: r ? {
|
|
1286
1227
|
"Content-Type": "multipart/form-data"
|
|
@@ -1290,10 +1231,10 @@ a.forEach(["post", "put", "patch"], function(t) {
|
|
|
1290
1231
|
}));
|
|
1291
1232
|
};
|
|
1292
1233
|
}
|
|
1293
|
-
|
|
1234
|
+
z.prototype[t] = n(), z.prototype[t + "Form"] = n(!0);
|
|
1294
1235
|
});
|
|
1295
|
-
const
|
|
1296
|
-
class
|
|
1236
|
+
const H = z;
|
|
1237
|
+
let on = class He {
|
|
1297
1238
|
constructor(t) {
|
|
1298
1239
|
if (typeof t != "function")
|
|
1299
1240
|
throw new TypeError("executor must be a function.");
|
|
@@ -1311,14 +1252,14 @@ class ce {
|
|
|
1311
1252
|
r._listeners = null;
|
|
1312
1253
|
}), this.promise.then = (s) => {
|
|
1313
1254
|
let o;
|
|
1314
|
-
const i = new Promise((
|
|
1315
|
-
r.subscribe(
|
|
1255
|
+
const i = new Promise((c) => {
|
|
1256
|
+
r.subscribe(c), o = c;
|
|
1316
1257
|
}).then(s);
|
|
1317
1258
|
return i.cancel = function() {
|
|
1318
1259
|
r.unsubscribe(o);
|
|
1319
1260
|
}, i;
|
|
1320
|
-
}, t(function(o, i,
|
|
1321
|
-
r.reason || (r.reason = new B(o, i,
|
|
1261
|
+
}, t(function(o, i, c) {
|
|
1262
|
+
r.reason || (r.reason = new B(o, i, c), n(r.reason));
|
|
1322
1263
|
});
|
|
1323
1264
|
}
|
|
1324
1265
|
/**
|
|
@@ -1354,20 +1295,20 @@ class ce {
|
|
|
1354
1295
|
static source() {
|
|
1355
1296
|
let t;
|
|
1356
1297
|
return {
|
|
1357
|
-
token: new
|
|
1298
|
+
token: new He(function(s) {
|
|
1358
1299
|
t = s;
|
|
1359
1300
|
}),
|
|
1360
1301
|
cancel: t
|
|
1361
1302
|
};
|
|
1362
1303
|
}
|
|
1363
|
-
}
|
|
1364
|
-
const
|
|
1365
|
-
function
|
|
1304
|
+
};
|
|
1305
|
+
const an = on;
|
|
1306
|
+
function cn(e) {
|
|
1366
1307
|
return function(n) {
|
|
1367
1308
|
return e.apply(null, n);
|
|
1368
1309
|
};
|
|
1369
1310
|
}
|
|
1370
|
-
function
|
|
1311
|
+
function un(e) {
|
|
1371
1312
|
return a.isObject(e) && e.isAxiosError === !0;
|
|
1372
1313
|
}
|
|
1373
1314
|
const ee = {
|
|
@@ -1438,41 +1379,165 @@ const ee = {
|
|
|
1438
1379
|
Object.entries(ee).forEach(([e, t]) => {
|
|
1439
1380
|
ee[t] = e;
|
|
1440
1381
|
});
|
|
1441
|
-
const
|
|
1382
|
+
const ln = ee;
|
|
1442
1383
|
function ze(e) {
|
|
1443
|
-
const t = new
|
|
1444
|
-
return a.extend(n,
|
|
1384
|
+
const t = new H(e), n = Ae(H.prototype.request, t);
|
|
1385
|
+
return a.extend(n, H.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1445
1386
|
return ze(N(e, s));
|
|
1446
1387
|
}, n;
|
|
1447
1388
|
}
|
|
1448
1389
|
const E = ze(ie);
|
|
1449
|
-
E.Axios =
|
|
1390
|
+
E.Axios = H;
|
|
1450
1391
|
E.CanceledError = B;
|
|
1451
|
-
E.CancelToken =
|
|
1452
|
-
E.isCancel =
|
|
1453
|
-
E.VERSION =
|
|
1454
|
-
E.toFormData =
|
|
1392
|
+
E.CancelToken = an;
|
|
1393
|
+
E.isCancel = je;
|
|
1394
|
+
E.VERSION = $e;
|
|
1395
|
+
E.toFormData = K;
|
|
1455
1396
|
E.AxiosError = m;
|
|
1456
1397
|
E.Cancel = E.CanceledError;
|
|
1457
1398
|
E.all = function(t) {
|
|
1458
1399
|
return Promise.all(t);
|
|
1459
1400
|
};
|
|
1460
|
-
E.spread =
|
|
1461
|
-
E.isAxiosError =
|
|
1401
|
+
E.spread = cn;
|
|
1402
|
+
E.isAxiosError = un;
|
|
1462
1403
|
E.mergeConfig = N;
|
|
1463
1404
|
E.AxiosHeaders = R;
|
|
1464
|
-
E.formToJSON = (e) =>
|
|
1465
|
-
E.HttpStatusCode =
|
|
1405
|
+
E.formToJSON = (e) => ke(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1406
|
+
E.HttpStatusCode = ln;
|
|
1466
1407
|
E.default = E;
|
|
1467
|
-
const
|
|
1468
|
-
|
|
1408
|
+
const Ve = E, {
|
|
1409
|
+
Axios: Mn,
|
|
1410
|
+
AxiosError: fn,
|
|
1411
|
+
CanceledError: Wn,
|
|
1412
|
+
isCancel: Gn,
|
|
1413
|
+
CancelToken: Xn,
|
|
1414
|
+
VERSION: Yn,
|
|
1415
|
+
all: Qn,
|
|
1416
|
+
Cancel: Zn,
|
|
1417
|
+
isAxiosError: er,
|
|
1418
|
+
spread: tr,
|
|
1419
|
+
toFormData: nr,
|
|
1420
|
+
AxiosHeaders: rr,
|
|
1421
|
+
HttpStatusCode: sr,
|
|
1422
|
+
formToJSON: or,
|
|
1423
|
+
mergeConfig: ir
|
|
1424
|
+
} = Ve;
|
|
1425
|
+
class dn extends Error {
|
|
1426
|
+
constructor(n) {
|
|
1427
|
+
super(n.join(", "));
|
|
1428
|
+
S(this, "errors");
|
|
1429
|
+
this.name = "ValidationError", this.errors = n;
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
class pn extends Error {
|
|
1433
|
+
constructor(n) {
|
|
1434
|
+
super(`Address already used: ${n}`);
|
|
1435
|
+
S(this, "address");
|
|
1436
|
+
this.name = "AddressInUseError", this.address = n;
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
class hn extends Error {
|
|
1440
|
+
constructor(n) {
|
|
1441
|
+
super(`Code already used: ${n}`);
|
|
1442
|
+
S(this, "code");
|
|
1443
|
+
this.name = "CodeInUseError", this.code = n;
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
class mn extends Error {
|
|
1447
|
+
constructor() {
|
|
1448
|
+
super("Invalid signature provided"), this.name = "InvalidSignatureError";
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
class yn {
|
|
1452
|
+
constructor(t) {
|
|
1453
|
+
S(this, "httpClient");
|
|
1454
|
+
S(this, "_debug");
|
|
1455
|
+
this.httpClient = t.httpClient, this._debug = t.debug;
|
|
1456
|
+
}
|
|
1457
|
+
async create(t, n, r, s) {
|
|
1458
|
+
var o;
|
|
1459
|
+
try {
|
|
1460
|
+
await this.httpClient.post("/affiliates", {
|
|
1461
|
+
address: t,
|
|
1462
|
+
name: n,
|
|
1463
|
+
code: n,
|
|
1464
|
+
signature: r,
|
|
1465
|
+
signature_message: s
|
|
1466
|
+
});
|
|
1467
|
+
} catch (i) {
|
|
1468
|
+
if (i instanceof fn) {
|
|
1469
|
+
const c = (o = i.response) == null ? void 0 : o.data;
|
|
1470
|
+
if (typeof (c == null ? void 0 : c.message) == "string") {
|
|
1471
|
+
const f = c.message.toLowerCase();
|
|
1472
|
+
throw f == "invalid signature" ? new mn() : f == "address in use" ? new pn(t) : f == "code in use" ? new hn(n) : new Error(f);
|
|
1473
|
+
} else if ((c == null ? void 0 : c.message) instanceof Array)
|
|
1474
|
+
throw new dn(c.message);
|
|
1475
|
+
}
|
|
1476
|
+
throw i;
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
async getCode(t) {
|
|
1480
|
+
try {
|
|
1481
|
+
const n = await this.httpClient.get(`/affiliates/${t}`);
|
|
1482
|
+
return n.status !== 200 ? null : n.data.code;
|
|
1483
|
+
} catch (n) {
|
|
1484
|
+
return console.error("Fuul SDK: Could not get affiliate code", n), null;
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
class En {
|
|
1489
|
+
constructor(t) {
|
|
1490
|
+
S(this, "httpClient");
|
|
1491
|
+
this.httpClient = t.httpClient;
|
|
1492
|
+
}
|
|
1493
|
+
async getAll() {
|
|
1494
|
+
const { data: t } = await this.httpClient.get("conversions");
|
|
1495
|
+
return t;
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
const be = "fuul.sent", wn = 60;
|
|
1499
|
+
class gn {
|
|
1469
1500
|
constructor(t) {
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
this.
|
|
1501
|
+
S(this, "debug");
|
|
1502
|
+
S(this, "httpClient");
|
|
1503
|
+
this.httpClient = t.httpClient, this.debug = !!t.debug;
|
|
1504
|
+
}
|
|
1505
|
+
async sendEvent(t) {
|
|
1506
|
+
if (this.isDuplicate(t)) {
|
|
1507
|
+
this.debug && console.debug("Fuul SDK: Event is considered duplicate and will not be sent");
|
|
1508
|
+
return;
|
|
1509
|
+
}
|
|
1510
|
+
await this.httpClient.post("events", t), this.debug && console.debug(`Fuul SDK: Sent '${t.name}' event`), this.saveSentEvent(t);
|
|
1511
|
+
}
|
|
1512
|
+
isDuplicate(t) {
|
|
1513
|
+
const n = `${be}_${t.name}`, r = localStorage.getItem(n);
|
|
1514
|
+
if (!r)
|
|
1515
|
+
return !1;
|
|
1516
|
+
const s = JSON.parse(r);
|
|
1517
|
+
if (this.getCurrentTimestamp() - s.timestamp > wn)
|
|
1518
|
+
return !1;
|
|
1519
|
+
let f = !1;
|
|
1520
|
+
t.metadata && (f = s.metadata.tracking_id === t.metadata.tracking_id && s.metadata.project_id === t.metadata.project_id && s.metadata.referrer === t.metadata.referrer && s.metadata.source === t.metadata.source && s.metadata.category === t.metadata.category && s.metadata.title === t.metadata.title && s.metadata.tag === t.metadata.tag && s.user_address === t.user_address && s.signature === t.signature && s.signature_message === t.signature_message);
|
|
1521
|
+
let u = !1;
|
|
1522
|
+
return t.args && s.args && (u = s.args.page === t.args.page), u && f;
|
|
1523
|
+
}
|
|
1524
|
+
getCurrentTimestamp() {
|
|
1525
|
+
return Date.now() / 1e3;
|
|
1526
|
+
}
|
|
1527
|
+
saveSentEvent(t) {
|
|
1528
|
+
const n = `${be}_${t.name}`, r = this.getCurrentTimestamp(), s = { ...t, timestamp: r };
|
|
1529
|
+
localStorage.setItem(n, JSON.stringify(s));
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
class Sn {
|
|
1533
|
+
constructor(t) {
|
|
1534
|
+
S(this, "client");
|
|
1535
|
+
S(this, "queryParams");
|
|
1536
|
+
this.client = Ve.create({
|
|
1473
1537
|
...t,
|
|
1474
1538
|
headers: {
|
|
1475
|
-
Authorization: `Bearer ${t.apiKey}
|
|
1539
|
+
Authorization: `Bearer ${t.apiKey}`,
|
|
1540
|
+
"X-Fuul-Sdk-Version": "3.1.1"
|
|
1476
1541
|
}
|
|
1477
1542
|
}), this.queryParams = t.queryParams ? this.buildQueryParams(t.queryParams) : "";
|
|
1478
1543
|
}
|
|
@@ -1495,8 +1560,8 @@ class hn {
|
|
|
1495
1560
|
return this.client.delete(t + this.queryParams);
|
|
1496
1561
|
}
|
|
1497
1562
|
}
|
|
1498
|
-
let
|
|
1499
|
-
const
|
|
1563
|
+
let bn = (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), "");
|
|
1564
|
+
const An = "fuul.tracking_id", Rn = ["google.com", "bing.com", "yahoo.com"], On = () => Dn(An, () => bn()), Tn = () => C("af") || C("referrer"), Cn = () => document.referrer, Pn = () => Fn(), _n = () => C("category"), Nn = () => C("title"), xn = () => C("tag"), Dn = (e, t) => {
|
|
1500
1565
|
const n = localStorage.getItem(e);
|
|
1501
1566
|
if (n)
|
|
1502
1567
|
return n;
|
|
@@ -1504,82 +1569,87 @@ const yn = "fuul.tracking_id", En = ["google.com", "bing.com", "yahoo.com"], wn
|
|
|
1504
1569
|
const r = t();
|
|
1505
1570
|
return r ? localStorage.setItem(e, r) : localStorage.removeItem(e), r;
|
|
1506
1571
|
}
|
|
1507
|
-
}, C = (e) => new URLSearchParams(window.location.search).get(e),
|
|
1572
|
+
}, C = (e) => new URLSearchParams(window.location.search).get(e), Fn = () => {
|
|
1508
1573
|
const e = C("source"), t = C("af") || C("referrer");
|
|
1509
1574
|
if (e)
|
|
1510
1575
|
return e;
|
|
1511
1576
|
if (t)
|
|
1512
1577
|
return "affiliate";
|
|
1513
|
-
const n =
|
|
1514
|
-
return
|
|
1515
|
-
},
|
|
1578
|
+
const n = Un(document.referrer);
|
|
1579
|
+
return Rn.includes(n) ? "organic" : "direct";
|
|
1580
|
+
}, Un = (e) => {
|
|
1516
1581
|
var r;
|
|
1517
1582
|
return (r = new URL(e).hostname) == null ? void 0 : r.split(".").slice(-2).join(".");
|
|
1518
|
-
},
|
|
1519
|
-
let F = !1, te = !1,
|
|
1520
|
-
function
|
|
1521
|
-
F = !!e.debug, !te && (
|
|
1522
|
-
e.baseApiUrl ??
|
|
1583
|
+
}, Ln = "https://api.fuul.xyz/api/v1/";
|
|
1584
|
+
let F = !1, te = !1, ce, k, Ke, ue, Je;
|
|
1585
|
+
function Bn(e) {
|
|
1586
|
+
F = !!e.debug, !te && (ce = e.apiKey, zn(), k = Vn(
|
|
1587
|
+
e.baseApiUrl ?? Ln,
|
|
1523
1588
|
e.defaultQueryParams ?? {}
|
|
1524
|
-
),
|
|
1589
|
+
), Ke = new En({ httpClient: k, debug: F }), Je = new gn({ httpClient: k, debug: F }), ue = new yn({ httpClient: k, debug: F }), te = !0, F && console.debug("Fuul SDK: init() complete"));
|
|
1525
1590
|
}
|
|
1526
|
-
function
|
|
1591
|
+
function ve() {
|
|
1527
1592
|
if (!te)
|
|
1528
1593
|
throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods");
|
|
1529
1594
|
}
|
|
1530
1595
|
async function le(e, t, n) {
|
|
1531
|
-
|
|
1532
|
-
const r =
|
|
1596
|
+
ve(), Hn();
|
|
1597
|
+
const r = On(), s = Tn(), o = Pn(), i = _n(), c = Nn(), f = xn(), u = Cn(), l = {
|
|
1533
1598
|
name: e,
|
|
1534
1599
|
args: t || {},
|
|
1535
1600
|
metadata: {
|
|
1536
1601
|
tracking_id: r ?? ""
|
|
1537
1602
|
}
|
|
1538
1603
|
};
|
|
1539
|
-
n != null && n.address && (l.user_address = n.address), n != null && n.signature && (l.signature = n == null ? void 0 : n.signature, l.signature_message = n == null ? void 0 : n.message), s && (l.metadata.referrer = s, l.metadata.affiliate_id = s),
|
|
1604
|
+
n != null && n.address && (l.user_address = n.address), n != null && n.signature && (l.signature = n == null ? void 0 : n.signature, l.signature_message = n == null ? void 0 : n.message), s && (l.metadata.referrer = s, l.metadata.affiliate_id = s), u && (l.metadata.referrer_url = u), o && (l.metadata.source = o), i && (l.metadata.category = i), c && (l.metadata.title = c), f && (l.metadata.tag = f), Je.sendEvent(l);
|
|
1540
1605
|
}
|
|
1541
|
-
async function
|
|
1606
|
+
async function In(e) {
|
|
1542
1607
|
await le("pageview", {
|
|
1543
1608
|
page: e ?? document.location.pathname,
|
|
1544
1609
|
locationOrigin: document.location.origin
|
|
1545
1610
|
});
|
|
1546
1611
|
}
|
|
1547
|
-
async function
|
|
1612
|
+
async function kn(e) {
|
|
1548
1613
|
await le("connect_wallet", {}, e);
|
|
1549
1614
|
}
|
|
1550
|
-
async function
|
|
1551
|
-
const r =
|
|
1615
|
+
async function jn(e, t, n) {
|
|
1616
|
+
const r = `I confirm that I am creating the ${t} code on Fuul`;
|
|
1617
|
+
await ue.create(e, t, n, r);
|
|
1618
|
+
}
|
|
1619
|
+
async function qn(e, t, n) {
|
|
1620
|
+
const r = await ue.getCode(t), s = new URLSearchParams({
|
|
1552
1621
|
af: r ?? t
|
|
1553
1622
|
});
|
|
1554
1623
|
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()}`;
|
|
1555
1624
|
}
|
|
1556
|
-
async function
|
|
1557
|
-
return
|
|
1625
|
+
async function $n() {
|
|
1626
|
+
return ve(), Ke.getAll();
|
|
1558
1627
|
}
|
|
1559
|
-
function
|
|
1628
|
+
function Hn() {
|
|
1560
1629
|
if (typeof window > "u" || typeof document > "u")
|
|
1561
1630
|
throw new Error("Fuul SDK: Browser context required");
|
|
1562
1631
|
}
|
|
1563
|
-
function
|
|
1564
|
-
if (!
|
|
1632
|
+
function zn() {
|
|
1633
|
+
if (!ce)
|
|
1565
1634
|
throw new Error("Fuul SDK: Invalid API key");
|
|
1566
1635
|
}
|
|
1567
|
-
function
|
|
1568
|
-
return new
|
|
1636
|
+
function Vn(e, t) {
|
|
1637
|
+
return new Sn({
|
|
1569
1638
|
baseURL: e,
|
|
1570
1639
|
timeout: 1e4,
|
|
1571
|
-
apiKey:
|
|
1640
|
+
apiKey: ce,
|
|
1572
1641
|
queryParams: t
|
|
1573
1642
|
});
|
|
1574
1643
|
}
|
|
1575
|
-
const
|
|
1576
|
-
init:
|
|
1644
|
+
const ar = {
|
|
1645
|
+
init: Bn,
|
|
1577
1646
|
sendEvent: le,
|
|
1578
|
-
sendPageview:
|
|
1579
|
-
sendConnectWallet:
|
|
1580
|
-
generateTrackingLink:
|
|
1581
|
-
getConversions:
|
|
1647
|
+
sendPageview: In,
|
|
1648
|
+
sendConnectWallet: kn,
|
|
1649
|
+
generateTrackingLink: qn,
|
|
1650
|
+
getConversions: $n,
|
|
1651
|
+
createAffiliateCode: jn
|
|
1582
1652
|
};
|
|
1583
1653
|
export {
|
|
1584
|
-
|
|
1654
|
+
ar as Fuul
|
|
1585
1655
|
};
|