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