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