@odynn/awayz-core 0.6.13 → 0.6.14
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/{AccountService-DGz0jGwx.js → AccountService-Cu1fDg5B.js} +297 -267
- package/dist/{TripsService-B5dp_HNZ.js → TripsService-D-0263l6.js} +1 -1
- package/dist/components/CashValue/CashValue.js +1 -1
- package/dist/components/CashValue/CashValue.stories.js +1 -1
- package/dist/components/Wallet/Card/Card.stories.js +1 -1
- package/dist/configs/endpoints.js +2 -2
- package/dist/hooks/useAwayzAuth/useAwayzAuth.js +62 -48
- package/dist/hooks/useBookingManagement/useBookingManagement.js +1 -1
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +1 -1
- package/dist/hooks/useSearchLimit.js +1 -1
- package/dist/hooks/useTripManagement/useTripManagement.js +2 -2
- package/dist/hooks/useTripManagement/useTripManagement.test.js +2 -2
- package/dist/hooks/useWallet/useWallet.js +1 -1
- package/dist/hooks/useWallet/useWallet.test.js +1 -1
- package/dist/lib/configs/endpoints.d.ts +1 -0
- package/dist/lib/hooks/useAwayzAuth/useAwayzAuth.d.ts +2 -0
- package/dist/lib/services/account/AccountService.d.ts +2 -1
- package/dist/main.js +1 -1
- package/dist/providers/AwayzProvider.js +1 -1
- package/dist/services/account/AccountService.js +2 -2
- package/dist/services/bookings/BookingService.js +1 -1
- package/dist/services/currency/CurrencyService.js +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/instance.js +1 -1
- package/dist/services/instanceConfig.js +1 -1
- package/dist/services/noRetryInstance.js +1 -1
- package/dist/services/preferences/PreferencesService.js +1 -1
- package/dist/services/rewards/RewardsService.js +1 -1
- package/dist/services/trips/TripsService.js +2 -2
- package/dist/services/wallet/WalletService.js +1 -1
- package/package.json +1 -1
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
var lt = Object.defineProperty;
|
|
2
2
|
var ft = (e, t, n) => t in e ? lt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var
|
|
3
|
+
var k = (e, t, n) => ft(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import "./arrayExtensions-DlcBOj5a.js";
|
|
5
|
-
import { a as
|
|
5
|
+
import { a as x } from "./keys-D66VvSIm.js";
|
|
6
6
|
import "react";
|
|
7
|
+
import { awayzClient as $ } from "./configs/awayzClient.js";
|
|
8
|
+
import { EAuthEndpoints as b } from "./configs/endpoints.js";
|
|
7
9
|
import { getBaseUrl as qe } from "./configs/baseUrl.js";
|
|
8
|
-
import { EAuthEndpoints as O } from "./configs/endpoints.js";
|
|
9
10
|
import { EAuthFlow as dt } from "./types/EAuthFlow.js";
|
|
10
|
-
import { awayzClient as W } from "./configs/awayzClient.js";
|
|
11
11
|
function pt(e) {
|
|
12
12
|
return e = e.replace(/^_+/, ""), e.replace(/_([a-z])/g, (t, n) => n.toUpperCase());
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const L = (e) => Array.isArray(e) ? e.map((t) => L(t)) : typeof e == "object" && e !== null ? Object.keys(e).reduce((t, n) => {
|
|
15
15
|
const r = pt(n);
|
|
16
|
-
return t[r] =
|
|
16
|
+
return t[r] = L(e[n]), t;
|
|
17
17
|
}, {}) : e;
|
|
18
18
|
function ht(e) {
|
|
19
19
|
return e.replace(/([A-Z])/g, "_$1").toLowerCase();
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const we = (e) => Array.isArray(e) ? e.map((t) => we(t)) : typeof e == "object" && e !== null ? Object.keys(e).reduce((t, n) => {
|
|
22
22
|
const r = ht(n);
|
|
23
|
-
return t[r] =
|
|
23
|
+
return t[r] = we(e[n]), t;
|
|
24
24
|
}, {}) : e, fr = (e) => (Object.keys(e).forEach(
|
|
25
25
|
(t) => !e[t] && delete e[t]
|
|
26
26
|
), e);
|
|
27
|
-
var
|
|
28
|
-
function
|
|
27
|
+
var j = /* @__PURE__ */ ((e) => (e.LOCATIONS = "LOCATIONS", e.CHECK_USER = "CHECK_USER", e.USER_REGIONS = "USER_REGIONS", e.CONVERT_CURRENCY = "CONVERT_CURRENCY", e.CLIENT_COMPONENT_KEY = "CLIENT_COMPONENT_KEY", e.SEARCH_LIMIT = "SEARCH_LIMIT", e.PROGRAMS = "PROGRAMS", e.USER_PROGRAMS = "USER_PROGRAMS", e.LINKED_USER_PROGRAMS = "LINKED_USER_PROGRAMS", e.BANKS = "BANKS", e.CARDS = "CARDS", e.USER_CARDS = "USER_CARDS", e.TRIPS = "TRIPS", e.UNCATEGORISED_BOOKINGS = "UNCATEGORISED_BOOKINGS", e.BOOKING = "BOOKING", e.VALUE_CENTS = "VALUE_CENTS", e.AVAILABILITY_ALERTS = "AVAILABILITY_ALERTS", e.ALERT_NOTIFICATIONS = "ALERT_NOTIFICATIONS", e.POINTS_AS_CASH = "POINTS_AS_CASH", e))(j || {}), mt = /* @__PURE__ */ ((e) => (e.HOTEL = "Hotel", e.AIRLINE = "Airline", e.BANK = "Bank", e))(mt || {});
|
|
28
|
+
function He(e, t) {
|
|
29
29
|
return function() {
|
|
30
30
|
return e.apply(t, arguments);
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
const { toString: Et } = Object.prototype, { getPrototypeOf: ye } = Object, { iterator: te, toStringTag:
|
|
33
|
+
const { toString: Et } = Object.prototype, { getPrototypeOf: ye } = Object, { iterator: te, toStringTag: Me } = Symbol, ne = /* @__PURE__ */ ((e) => (t) => {
|
|
34
34
|
const n = Et.call(t);
|
|
35
35
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
36
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
36
|
+
})(/* @__PURE__ */ Object.create(null)), U = (e) => (e = e.toLowerCase(), (t) => ne(t) === e), re = (e) => (t) => typeof t === e, { isArray: z } = Array, v = re("undefined");
|
|
37
37
|
function yt(e) {
|
|
38
|
-
return e !== null && !
|
|
38
|
+
return e !== null && !v(e) && e.constructor !== null && !v(e.constructor) && _(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
39
39
|
}
|
|
40
|
-
const je =
|
|
41
|
-
function
|
|
40
|
+
const je = U("ArrayBuffer");
|
|
41
|
+
function Rt(e) {
|
|
42
42
|
let t;
|
|
43
43
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && je(e.buffer), t;
|
|
44
44
|
}
|
|
45
|
-
const
|
|
45
|
+
const St = re("string"), _ = re("function"), ze = re("number"), se = (e) => e !== null && typeof e == "object", gt = (e) => e === !0 || e === !1, X = (e) => {
|
|
46
46
|
if (ne(e) !== "object")
|
|
47
47
|
return !1;
|
|
48
48
|
const t = ye(e);
|
|
49
|
-
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(
|
|
50
|
-
},
|
|
49
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Me in e) && !(te in e);
|
|
50
|
+
}, wt = U("Date"), Tt = U("File"), bt = U("Blob"), Ot = U("FileList"), At = (e) => se(e) && _(e.pipe), _t = (e) => {
|
|
51
51
|
let t;
|
|
52
52
|
return e && (typeof FormData == "function" && e instanceof FormData || _(e.append) && ((t = ne(e)) === "formdata" || // detect form-data instance
|
|
53
53
|
t === "object" && _(e.toString) && e.toString() === "[object FormData]"));
|
|
54
|
-
}, Nt =
|
|
55
|
-
function
|
|
54
|
+
}, Nt = U("URLSearchParams"), [Ct, kt, Ut, It] = ["ReadableStream", "Request", "Response", "Headers"].map(U), xt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
55
|
+
function V(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
56
56
|
if (e === null || typeof e > "u")
|
|
57
57
|
return;
|
|
58
58
|
let r, s;
|
|
59
|
-
if (typeof e != "object" && (e = [e]),
|
|
59
|
+
if (typeof e != "object" && (e = [e]), z(e))
|
|
60
60
|
for (r = 0, s = e.length; r < s; r++)
|
|
61
61
|
t.call(null, e[r], r, e);
|
|
62
62
|
else {
|
|
@@ -75,18 +75,18 @@ function Ke(e, t) {
|
|
|
75
75
|
return s;
|
|
76
76
|
return null;
|
|
77
77
|
}
|
|
78
|
-
const q = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, $e = (e) => !
|
|
78
|
+
const q = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, $e = (e) => !v(e) && e !== q;
|
|
79
79
|
function fe() {
|
|
80
80
|
const { caseless: e } = $e(this) && this || {}, t = {}, n = (r, s) => {
|
|
81
81
|
const o = e && Ke(t, s) || s;
|
|
82
|
-
X(t[o]) && X(r) ? t[o] = fe(t[o], r) : X(r) ? t[o] = fe({}, r) :
|
|
82
|
+
X(t[o]) && X(r) ? t[o] = fe(t[o], r) : X(r) ? t[o] = fe({}, r) : z(r) ? t[o] = r.slice() : t[o] = r;
|
|
83
83
|
};
|
|
84
84
|
for (let r = 0, s = arguments.length; r < s; r++)
|
|
85
|
-
arguments[r] &&
|
|
85
|
+
arguments[r] && V(arguments[r], n);
|
|
86
86
|
return t;
|
|
87
87
|
}
|
|
88
|
-
const Pt = (e, t, n, { allOwnKeys: r } = {}) => (
|
|
89
|
-
n && _(s) ? e[o] =
|
|
88
|
+
const Pt = (e, t, n, { allOwnKeys: r } = {}) => (V(t, (s, o) => {
|
|
89
|
+
n && _(s) ? e[o] = He(s, n) : e[o] = s;
|
|
90
90
|
}, { allOwnKeys: r }), e), Lt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Ft = (e, t, n, r) => {
|
|
91
91
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
92
92
|
value: t.prototype
|
|
@@ -107,14 +107,14 @@ const Pt = (e, t, n, { allOwnKeys: r } = {}) => (v(t, (s, o) => {
|
|
|
107
107
|
return r !== -1 && r === n;
|
|
108
108
|
}, qt = (e) => {
|
|
109
109
|
if (!e) return null;
|
|
110
|
-
if (
|
|
110
|
+
if (z(e)) return e;
|
|
111
111
|
let t = e.length;
|
|
112
112
|
if (!ze(t)) return null;
|
|
113
113
|
const n = new Array(t);
|
|
114
114
|
for (; t-- > 0; )
|
|
115
115
|
n[t] = e[t];
|
|
116
116
|
return n;
|
|
117
|
-
},
|
|
117
|
+
}, Ht = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ye(Uint8Array)), Mt = (e, t) => {
|
|
118
118
|
const r = (e && e[te]).call(e);
|
|
119
119
|
let s;
|
|
120
120
|
for (; (s = r.next()) && !s.done; ) {
|
|
@@ -127,14 +127,14 @@ const Pt = (e, t, n, { allOwnKeys: r } = {}) => (v(t, (s, o) => {
|
|
|
127
127
|
for (; (n = e.exec(t)) !== null; )
|
|
128
128
|
r.push(n);
|
|
129
129
|
return r;
|
|
130
|
-
}, zt =
|
|
130
|
+
}, zt = U("HTMLFormElement"), Kt = (e) => e.toLowerCase().replace(
|
|
131
131
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
132
132
|
function(n, r, s) {
|
|
133
133
|
return r.toUpperCase() + s;
|
|
134
134
|
}
|
|
135
|
-
),
|
|
135
|
+
), Te = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), $t = U("RegExp"), Ge = (e, t) => {
|
|
136
136
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
137
|
-
|
|
137
|
+
V(n, (s, o) => {
|
|
138
138
|
let i;
|
|
139
139
|
(i = t(s, o, e)) !== !1 && (r[o] = i || s);
|
|
140
140
|
}), Object.defineProperties(e, r);
|
|
@@ -159,11 +159,11 @@ const Pt = (e, t, n, { allOwnKeys: r } = {}) => (v(t, (s, o) => {
|
|
|
159
159
|
n[o] = !0;
|
|
160
160
|
});
|
|
161
161
|
};
|
|
162
|
-
return
|
|
162
|
+
return z(e) ? r(e) : r(String(e).split(t)), n;
|
|
163
163
|
}, Vt = () => {
|
|
164
164
|
}, Jt = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
165
165
|
function Wt(e) {
|
|
166
|
-
return !!(e && _(e.append) && e[
|
|
166
|
+
return !!(e && _(e.append) && e[Me] === "FormData" && e[te]);
|
|
167
167
|
}
|
|
168
168
|
const Xt = (e) => {
|
|
169
169
|
const t = new Array(10), n = (r, s) => {
|
|
@@ -172,17 +172,17 @@ const Xt = (e) => {
|
|
|
172
172
|
return;
|
|
173
173
|
if (!("toJSON" in r)) {
|
|
174
174
|
t[s] = r;
|
|
175
|
-
const o =
|
|
176
|
-
return
|
|
175
|
+
const o = z(r) ? [] : {};
|
|
176
|
+
return V(r, (i, c) => {
|
|
177
177
|
const f = n(i, s + 1);
|
|
178
|
-
!
|
|
178
|
+
!v(f) && (o[c] = f);
|
|
179
179
|
}), t[s] = void 0, o;
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
return r;
|
|
183
183
|
};
|
|
184
184
|
return n(e, 0);
|
|
185
|
-
}, Yt =
|
|
185
|
+
}, Yt = U("AsyncFunction"), Zt = (e) => e && (se(e) || _(e)) && _(e.then) && _(e.catch), ve = ((e, t) => e ? setImmediate : t ? ((n, r) => (q.addEventListener("message", ({ source: s, data: o }) => {
|
|
186
186
|
s === q && o === n && r.length && r.shift()();
|
|
187
187
|
}, !1), (s) => {
|
|
188
188
|
r.push(s), q.postMessage(n, "*");
|
|
@@ -190,46 +190,46 @@ const Xt = (e) => {
|
|
|
190
190
|
typeof setImmediate == "function",
|
|
191
191
|
_(q.postMessage)
|
|
192
192
|
), Qt = typeof queueMicrotask < "u" ? queueMicrotask.bind(q) : typeof process < "u" && process.nextTick || ve, en = (e) => e != null && _(e[te]), a = {
|
|
193
|
-
isArray:
|
|
193
|
+
isArray: z,
|
|
194
194
|
isArrayBuffer: je,
|
|
195
195
|
isBuffer: yt,
|
|
196
196
|
isFormData: _t,
|
|
197
|
-
isArrayBufferView:
|
|
198
|
-
isString:
|
|
197
|
+
isArrayBufferView: Rt,
|
|
198
|
+
isString: St,
|
|
199
199
|
isNumber: ze,
|
|
200
|
-
isBoolean:
|
|
200
|
+
isBoolean: gt,
|
|
201
201
|
isObject: se,
|
|
202
202
|
isPlainObject: X,
|
|
203
203
|
isReadableStream: Ct,
|
|
204
|
-
isRequest:
|
|
204
|
+
isRequest: kt,
|
|
205
205
|
isResponse: Ut,
|
|
206
206
|
isHeaders: It,
|
|
207
|
-
isUndefined:
|
|
208
|
-
isDate:
|
|
209
|
-
isFile:
|
|
210
|
-
isBlob:
|
|
207
|
+
isUndefined: v,
|
|
208
|
+
isDate: wt,
|
|
209
|
+
isFile: Tt,
|
|
210
|
+
isBlob: bt,
|
|
211
211
|
isRegExp: $t,
|
|
212
212
|
isFunction: _,
|
|
213
213
|
isStream: At,
|
|
214
214
|
isURLSearchParams: Nt,
|
|
215
|
-
isTypedArray:
|
|
215
|
+
isTypedArray: Ht,
|
|
216
216
|
isFileList: Ot,
|
|
217
|
-
forEach:
|
|
217
|
+
forEach: V,
|
|
218
218
|
merge: fe,
|
|
219
219
|
extend: Pt,
|
|
220
|
-
trim:
|
|
220
|
+
trim: xt,
|
|
221
221
|
stripBOM: Lt,
|
|
222
222
|
inherits: Ft,
|
|
223
223
|
toFlatObject: Dt,
|
|
224
224
|
kindOf: ne,
|
|
225
|
-
kindOfTest:
|
|
225
|
+
kindOfTest: U,
|
|
226
226
|
endsWith: Bt,
|
|
227
227
|
toArray: qt,
|
|
228
|
-
forEachEntry:
|
|
228
|
+
forEachEntry: Mt,
|
|
229
229
|
matchAll: jt,
|
|
230
230
|
isHTMLForm: zt,
|
|
231
|
-
hasOwnProperty:
|
|
232
|
-
hasOwnProp:
|
|
231
|
+
hasOwnProperty: Te,
|
|
232
|
+
hasOwnProp: Te,
|
|
233
233
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
234
234
|
reduceDescriptors: Ge,
|
|
235
235
|
freezeMethods: Gt,
|
|
@@ -305,7 +305,7 @@ function de(e) {
|
|
|
305
305
|
function We(e) {
|
|
306
306
|
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function be(e, t, n) {
|
|
309
309
|
return e ? e.concat(t).map(function(s, o) {
|
|
310
310
|
return s = We(s), !n && o ? "[" + s + "]" : s;
|
|
311
311
|
}).join(n ? "." : "") : t;
|
|
@@ -338,44 +338,44 @@ function oe(e, t, n) {
|
|
|
338
338
|
return a.isArrayBuffer(h) || a.isTypedArray(h) ? f && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
|
|
339
339
|
}
|
|
340
340
|
function l(h, m, p) {
|
|
341
|
-
let
|
|
341
|
+
let S = h;
|
|
342
342
|
if (h && !p && typeof h == "object") {
|
|
343
343
|
if (a.endsWith(m, "{}"))
|
|
344
344
|
m = r ? m : m.slice(0, -2), h = JSON.stringify(h);
|
|
345
|
-
else if (a.isArray(h) && nn(h) || (a.isFileList(h) || a.endsWith(m, "[]")) && (
|
|
346
|
-
return m = We(m),
|
|
347
|
-
!(a.isUndefined(
|
|
345
|
+
else if (a.isArray(h) && nn(h) || (a.isFileList(h) || a.endsWith(m, "[]")) && (S = a.toArray(h)))
|
|
346
|
+
return m = We(m), S.forEach(function(T, P) {
|
|
347
|
+
!(a.isUndefined(T) || T === null) && t.append(
|
|
348
348
|
// eslint-disable-next-line no-nested-ternary
|
|
349
|
-
i === !0 ?
|
|
350
|
-
u(
|
|
349
|
+
i === !0 ? be([m], P, o) : i === null ? m : m + "[]",
|
|
350
|
+
u(T)
|
|
351
351
|
);
|
|
352
352
|
}), !1;
|
|
353
353
|
}
|
|
354
|
-
return de(h) ? !0 : (t.append(
|
|
354
|
+
return de(h) ? !0 : (t.append(be(p, m, o), u(h)), !1);
|
|
355
355
|
}
|
|
356
356
|
const d = [], y = Object.assign(rn, {
|
|
357
357
|
defaultVisitor: l,
|
|
358
358
|
convertValue: u,
|
|
359
359
|
isVisitable: de
|
|
360
360
|
});
|
|
361
|
-
function
|
|
361
|
+
function R(h, m) {
|
|
362
362
|
if (!a.isUndefined(h)) {
|
|
363
363
|
if (d.indexOf(h) !== -1)
|
|
364
364
|
throw Error("Circular reference detected in " + m.join("."));
|
|
365
|
-
d.push(h), a.forEach(h, function(
|
|
366
|
-
(!(a.isUndefined(
|
|
365
|
+
d.push(h), a.forEach(h, function(S, w) {
|
|
366
|
+
(!(a.isUndefined(S) || S === null) && s.call(
|
|
367
367
|
t,
|
|
368
|
-
|
|
369
|
-
a.isString(
|
|
368
|
+
S,
|
|
369
|
+
a.isString(w) ? w.trim() : w,
|
|
370
370
|
m,
|
|
371
371
|
y
|
|
372
|
-
)) === !0 && S
|
|
372
|
+
)) === !0 && R(S, m ? m.concat(w) : [w]);
|
|
373
373
|
}), d.pop();
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
if (!a.isObject(e))
|
|
377
377
|
throw new TypeError("data must be an object");
|
|
378
|
-
return
|
|
378
|
+
return R(e), t;
|
|
379
379
|
}
|
|
380
380
|
function Oe(e) {
|
|
381
381
|
const t = {
|
|
@@ -391,10 +391,10 @@ function Oe(e) {
|
|
|
391
391
|
return t[r];
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function Re(e, t) {
|
|
395
395
|
this._pairs = [], e && oe(e, this, t);
|
|
396
396
|
}
|
|
397
|
-
const Xe =
|
|
397
|
+
const Xe = Re.prototype;
|
|
398
398
|
Xe.append = function(t, n) {
|
|
399
399
|
this._pairs.push([t, n]);
|
|
400
400
|
};
|
|
@@ -418,7 +418,7 @@ function Ye(e, t, n) {
|
|
|
418
418
|
});
|
|
419
419
|
const s = n && n.serialize;
|
|
420
420
|
let o;
|
|
421
|
-
if (s ? o = s(t, n) : o = a.isURLSearchParams(t) ? t.toString() : new
|
|
421
|
+
if (s ? o = s(t, n) : o = a.isURLSearchParams(t) ? t.toString() : new Re(t, n).toString(r), o) {
|
|
422
422
|
const i = e.indexOf("#");
|
|
423
423
|
i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
|
|
424
424
|
}
|
|
@@ -482,7 +482,7 @@ const Ze = {
|
|
|
482
482
|
silentJSONParsing: !0,
|
|
483
483
|
forcedJSONParsing: !0,
|
|
484
484
|
clarifyTimeoutError: !1
|
|
485
|
-
}, on = typeof URLSearchParams < "u" ? URLSearchParams :
|
|
485
|
+
}, on = typeof URLSearchParams < "u" ? URLSearchParams : Re, an = typeof FormData < "u" ? FormData : null, cn = typeof Blob < "u" ? Blob : null, un = {
|
|
486
486
|
isBrowser: !0,
|
|
487
487
|
classes: {
|
|
488
488
|
URLSearchParams: on,
|
|
@@ -490,22 +490,22 @@ const Ze = {
|
|
|
490
490
|
Blob: cn
|
|
491
491
|
},
|
|
492
492
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
493
|
-
},
|
|
494
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", dn =
|
|
493
|
+
}, Se = typeof window < "u" && typeof document < "u", pe = typeof navigator == "object" && navigator || void 0, ln = Se && (!pe || ["ReactNative", "NativeScript", "NS"].indexOf(pe.product) < 0), fn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
494
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", dn = Se && window.location.href || "http://localhost", pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
495
495
|
__proto__: null,
|
|
496
|
-
hasBrowserEnv:
|
|
496
|
+
hasBrowserEnv: Se,
|
|
497
497
|
hasStandardBrowserEnv: ln,
|
|
498
498
|
hasStandardBrowserWebWorkerEnv: fn,
|
|
499
499
|
navigator: pe,
|
|
500
500
|
origin: dn
|
|
501
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
501
|
+
}, Symbol.toStringTag, { value: "Module" })), O = {
|
|
502
502
|
...pn,
|
|
503
503
|
...un
|
|
504
504
|
};
|
|
505
505
|
function hn(e, t) {
|
|
506
|
-
return oe(e, new
|
|
506
|
+
return oe(e, new O.classes.URLSearchParams(), Object.assign({
|
|
507
507
|
visitor: function(n, r, s, o) {
|
|
508
|
-
return
|
|
508
|
+
return O.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
509
509
|
}
|
|
510
510
|
}, t));
|
|
511
511
|
}
|
|
@@ -546,7 +546,7 @@ function yn(e, t, n) {
|
|
|
546
546
|
}
|
|
547
547
|
return (n || JSON.stringify)(e);
|
|
548
548
|
}
|
|
549
|
-
const
|
|
549
|
+
const J = {
|
|
550
550
|
transitional: Ze,
|
|
551
551
|
adapter: ["xhr", "http", "fetch"],
|
|
552
552
|
transformRequest: [function(t, n) {
|
|
@@ -575,7 +575,7 @@ const V = {
|
|
|
575
575
|
return o || s ? (n.setContentType("application/json", !1), yn(t)) : t;
|
|
576
576
|
}],
|
|
577
577
|
transformResponse: [function(t) {
|
|
578
|
-
const n = this.transitional ||
|
|
578
|
+
const n = this.transitional || J.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
|
|
579
579
|
if (a.isResponse(t) || a.isReadableStream(t))
|
|
580
580
|
return t;
|
|
581
581
|
if (t && a.isString(t) && (r && !this.responseType || s)) {
|
|
@@ -599,8 +599,8 @@ const V = {
|
|
|
599
599
|
maxContentLength: -1,
|
|
600
600
|
maxBodyLength: -1,
|
|
601
601
|
env: {
|
|
602
|
-
FormData:
|
|
603
|
-
Blob:
|
|
602
|
+
FormData: O.classes.FormData,
|
|
603
|
+
Blob: O.classes.Blob
|
|
604
604
|
},
|
|
605
605
|
validateStatus: function(t) {
|
|
606
606
|
return t >= 200 && t < 300;
|
|
@@ -613,9 +613,9 @@ const V = {
|
|
|
613
613
|
}
|
|
614
614
|
};
|
|
615
615
|
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
616
|
-
|
|
616
|
+
J.headers[e] = {};
|
|
617
617
|
});
|
|
618
|
-
const
|
|
618
|
+
const Rn = a.toObjectSet([
|
|
619
619
|
"age",
|
|
620
620
|
"authorization",
|
|
621
621
|
"content-length",
|
|
@@ -633,28 +633,28 @@ const Sn = a.toObjectSet([
|
|
|
633
633
|
"referer",
|
|
634
634
|
"retry-after",
|
|
635
635
|
"user-agent"
|
|
636
|
-
]),
|
|
636
|
+
]), Sn = (e) => {
|
|
637
637
|
const t = {};
|
|
638
638
|
let n, r, s;
|
|
639
639
|
return e && e.split(`
|
|
640
640
|
`).forEach(function(i) {
|
|
641
|
-
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] &&
|
|
641
|
+
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && Rn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
642
642
|
}), t;
|
|
643
643
|
}, _e = Symbol("internals");
|
|
644
|
-
function
|
|
644
|
+
function G(e) {
|
|
645
645
|
return e && String(e).trim().toLowerCase();
|
|
646
646
|
}
|
|
647
647
|
function Y(e) {
|
|
648
648
|
return e === !1 || e == null ? e : a.isArray(e) ? e.map(Y) : String(e);
|
|
649
649
|
}
|
|
650
|
-
function
|
|
650
|
+
function gn(e) {
|
|
651
651
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
652
652
|
let r;
|
|
653
653
|
for (; r = n.exec(e); )
|
|
654
654
|
t[r[1]] = r[2];
|
|
655
655
|
return t;
|
|
656
656
|
}
|
|
657
|
-
const
|
|
657
|
+
const wn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
658
658
|
function ce(e, t, n, r, s) {
|
|
659
659
|
if (a.isFunction(r))
|
|
660
660
|
return r.call(this, t, n);
|
|
@@ -665,10 +665,10 @@ function ce(e, t, n, r, s) {
|
|
|
665
665
|
return r.test(t);
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
|
-
function
|
|
668
|
+
function Tn(e) {
|
|
669
669
|
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function bn(e, t) {
|
|
672
672
|
const n = a.toCamelCase(" " + t);
|
|
673
673
|
["get", "set", "has"].forEach((r) => {
|
|
674
674
|
Object.defineProperty(e, r + n, {
|
|
@@ -686,7 +686,7 @@ let N = class {
|
|
|
686
686
|
set(t, n, r) {
|
|
687
687
|
const s = this;
|
|
688
688
|
function o(c, f, u) {
|
|
689
|
-
const l =
|
|
689
|
+
const l = G(f);
|
|
690
690
|
if (!l)
|
|
691
691
|
throw new Error("header name must be a non-empty string");
|
|
692
692
|
const d = a.findKey(s, l);
|
|
@@ -695,8 +695,8 @@ let N = class {
|
|
|
695
695
|
const i = (c, f) => a.forEach(c, (u, l) => o(u, l, f));
|
|
696
696
|
if (a.isPlainObject(t) || t instanceof this.constructor)
|
|
697
697
|
i(t, n);
|
|
698
|
-
else if (a.isString(t) && (t = t.trim()) && !
|
|
699
|
-
i(
|
|
698
|
+
else if (a.isString(t) && (t = t.trim()) && !wn(t))
|
|
699
|
+
i(Sn(t), n);
|
|
700
700
|
else if (a.isObject(t) && a.isIterable(t)) {
|
|
701
701
|
let c = {}, f, u;
|
|
702
702
|
for (const l of t) {
|
|
@@ -710,14 +710,14 @@ let N = class {
|
|
|
710
710
|
return this;
|
|
711
711
|
}
|
|
712
712
|
get(t, n) {
|
|
713
|
-
if (t =
|
|
713
|
+
if (t = G(t), t) {
|
|
714
714
|
const r = a.findKey(this, t);
|
|
715
715
|
if (r) {
|
|
716
716
|
const s = this[r];
|
|
717
717
|
if (!n)
|
|
718
718
|
return s;
|
|
719
719
|
if (n === !0)
|
|
720
|
-
return
|
|
720
|
+
return gn(s);
|
|
721
721
|
if (a.isFunction(n))
|
|
722
722
|
return n.call(this, s, r);
|
|
723
723
|
if (a.isRegExp(n))
|
|
@@ -727,7 +727,7 @@ let N = class {
|
|
|
727
727
|
}
|
|
728
728
|
}
|
|
729
729
|
has(t, n) {
|
|
730
|
-
if (t =
|
|
730
|
+
if (t = G(t), t) {
|
|
731
731
|
const r = a.findKey(this, t);
|
|
732
732
|
return !!(r && this[r] !== void 0 && (!n || ce(this, this[r], r, n)));
|
|
733
733
|
}
|
|
@@ -737,7 +737,7 @@ let N = class {
|
|
|
737
737
|
const r = this;
|
|
738
738
|
let s = !1;
|
|
739
739
|
function o(i) {
|
|
740
|
-
if (i =
|
|
740
|
+
if (i = G(i), i) {
|
|
741
741
|
const c = a.findKey(r, i);
|
|
742
742
|
c && (!n || ce(r, r[c], c, n)) && (delete r[c], s = !0);
|
|
743
743
|
}
|
|
@@ -761,7 +761,7 @@ let N = class {
|
|
|
761
761
|
n[i] = Y(s), delete n[o];
|
|
762
762
|
return;
|
|
763
763
|
}
|
|
764
|
-
const c = t ?
|
|
764
|
+
const c = t ? Tn(o) : String(o).trim();
|
|
765
765
|
c !== o && delete n[o], n[c] = Y(s), r[c] = !0;
|
|
766
766
|
}), this;
|
|
767
767
|
}
|
|
@@ -799,8 +799,8 @@ let N = class {
|
|
|
799
799
|
accessors: {}
|
|
800
800
|
}).accessors, s = this.prototype;
|
|
801
801
|
function o(i) {
|
|
802
|
-
const c =
|
|
803
|
-
r[c] || (
|
|
802
|
+
const c = G(i);
|
|
803
|
+
r[c] || (bn(s, i), r[c] = !0);
|
|
804
804
|
}
|
|
805
805
|
return a.isArray(t) ? t.forEach(o) : o(t), this;
|
|
806
806
|
}
|
|
@@ -817,7 +817,7 @@ a.reduceDescriptors(N.prototype, ({ value: e }, t) => {
|
|
|
817
817
|
});
|
|
818
818
|
a.freezeMethods(N);
|
|
819
819
|
function ue(e, t) {
|
|
820
|
-
const n = this ||
|
|
820
|
+
const n = this || J, r = t || n, s = N.from(r.headers);
|
|
821
821
|
let o = r.data;
|
|
822
822
|
return a.forEach(e, function(c) {
|
|
823
823
|
o = c.call(n, o, s.normalize(), t ? t.status : void 0);
|
|
@@ -826,10 +826,10 @@ function ue(e, t) {
|
|
|
826
826
|
function et(e) {
|
|
827
827
|
return !!(e && e.__CANCEL__);
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function K(e, t, n) {
|
|
830
830
|
E.call(this, e ?? "canceled", E.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
831
831
|
}
|
|
832
|
-
a.inherits(
|
|
832
|
+
a.inherits(K, E, {
|
|
833
833
|
__CANCEL__: !0
|
|
834
834
|
});
|
|
835
835
|
function tt(e, t, n) {
|
|
@@ -858,8 +858,8 @@ function An(e, t) {
|
|
|
858
858
|
y += n[d++], d = d % e;
|
|
859
859
|
if (s = (s + 1) % e, s === o && (o = (o + 1) % e), u - i < t)
|
|
860
860
|
return;
|
|
861
|
-
const
|
|
862
|
-
return
|
|
861
|
+
const R = l && u - l;
|
|
862
|
+
return R ? Math.round(y * 1e3 / R) : void 0;
|
|
863
863
|
};
|
|
864
864
|
}
|
|
865
865
|
function _n(e, t) {
|
|
@@ -900,10 +900,10 @@ const Q = (e, t, n = 3) => {
|
|
|
900
900
|
total: e,
|
|
901
901
|
loaded: r
|
|
902
902
|
}), t[1]];
|
|
903
|
-
}, Ce = (e) => (...t) => a.asap(() => e(...t)), Nn =
|
|
904
|
-
new URL(
|
|
905
|
-
|
|
906
|
-
) : () => !0, Cn =
|
|
903
|
+
}, Ce = (e) => (...t) => a.asap(() => e(...t)), Nn = O.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, O.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
904
|
+
new URL(O.origin),
|
|
905
|
+
O.navigator && /(msie|trident)/i.test(O.navigator.userAgent)
|
|
906
|
+
) : () => !0, Cn = O.hasStandardBrowserEnv ? (
|
|
907
907
|
// Standard browser envs support document.cookie
|
|
908
908
|
{
|
|
909
909
|
write(e, t, n, r, s, o) {
|
|
@@ -930,18 +930,18 @@ const Q = (e, t, n = 3) => {
|
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
932
|
);
|
|
933
|
-
function
|
|
933
|
+
function kn(e) {
|
|
934
934
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
935
935
|
}
|
|
936
936
|
function Un(e, t) {
|
|
937
937
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
938
938
|
}
|
|
939
939
|
function nt(e, t, n) {
|
|
940
|
-
let r = !
|
|
940
|
+
let r = !kn(t);
|
|
941
941
|
return e && (r || n == !1) ? Un(e, t) : t;
|
|
942
942
|
}
|
|
943
|
-
const
|
|
944
|
-
function
|
|
943
|
+
const ke = (e) => e instanceof N ? { ...e } : e;
|
|
944
|
+
function M(e, t) {
|
|
945
945
|
t = t || {};
|
|
946
946
|
const n = {};
|
|
947
947
|
function r(u, l, d, y) {
|
|
@@ -998,7 +998,7 @@ function H(e, t) {
|
|
|
998
998
|
socketPath: i,
|
|
999
999
|
responseEncoding: i,
|
|
1000
1000
|
validateStatus: c,
|
|
1001
|
-
headers: (u, l, d) => s(
|
|
1001
|
+
headers: (u, l, d) => s(ke(u), ke(l), d, !0)
|
|
1002
1002
|
};
|
|
1003
1003
|
return a.forEach(Object.keys(Object.assign({}, e, t)), function(l) {
|
|
1004
1004
|
const d = f[l] || s, y = d(e[l], t[l], l);
|
|
@@ -1006,7 +1006,7 @@ function H(e, t) {
|
|
|
1006
1006
|
}), n;
|
|
1007
1007
|
}
|
|
1008
1008
|
const rt = (e) => {
|
|
1009
|
-
const t =
|
|
1009
|
+
const t = M({}, e);
|
|
1010
1010
|
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = t;
|
|
1011
1011
|
t.headers = i = N.from(i), t.url = Ye(nt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), c && i.set(
|
|
1012
1012
|
"Authorization",
|
|
@@ -1014,39 +1014,39 @@ const rt = (e) => {
|
|
|
1014
1014
|
);
|
|
1015
1015
|
let f;
|
|
1016
1016
|
if (a.isFormData(n)) {
|
|
1017
|
-
if (
|
|
1017
|
+
if (O.hasStandardBrowserEnv || O.hasStandardBrowserWebWorkerEnv)
|
|
1018
1018
|
i.setContentType(void 0);
|
|
1019
1019
|
else if ((f = i.getContentType()) !== !1) {
|
|
1020
1020
|
const [u, ...l] = f ? f.split(";").map((d) => d.trim()).filter(Boolean) : [];
|
|
1021
1021
|
i.setContentType([u || "multipart/form-data", ...l].join("; "));
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
|
-
if (
|
|
1024
|
+
if (O.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && Nn(t.url))) {
|
|
1025
1025
|
const u = s && o && Cn.read(o);
|
|
1026
1026
|
u && i.set(s, u);
|
|
1027
1027
|
}
|
|
1028
1028
|
return t;
|
|
1029
|
-
}, In = typeof XMLHttpRequest < "u",
|
|
1029
|
+
}, In = typeof XMLHttpRequest < "u", xn = In && function(e) {
|
|
1030
1030
|
return new Promise(function(n, r) {
|
|
1031
1031
|
const s = rt(e);
|
|
1032
1032
|
let o = s.data;
|
|
1033
1033
|
const i = N.from(s.headers).normalize();
|
|
1034
|
-
let { responseType: c, onUploadProgress: f, onDownloadProgress: u } = s, l, d, y,
|
|
1034
|
+
let { responseType: c, onUploadProgress: f, onDownloadProgress: u } = s, l, d, y, R, h;
|
|
1035
1035
|
function m() {
|
|
1036
|
-
|
|
1036
|
+
R && R(), h && h(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
|
|
1037
1037
|
}
|
|
1038
1038
|
let p = new XMLHttpRequest();
|
|
1039
1039
|
p.open(s.method.toUpperCase(), s.url, !0), p.timeout = s.timeout;
|
|
1040
|
-
function
|
|
1040
|
+
function S() {
|
|
1041
1041
|
if (!p)
|
|
1042
1042
|
return;
|
|
1043
|
-
const
|
|
1043
|
+
const T = N.from(
|
|
1044
1044
|
"getAllResponseHeaders" in p && p.getAllResponseHeaders()
|
|
1045
1045
|
), A = {
|
|
1046
1046
|
data: !c || c === "text" || c === "json" ? p.responseText : p.response,
|
|
1047
1047
|
status: p.status,
|
|
1048
1048
|
statusText: p.statusText,
|
|
1049
|
-
headers:
|
|
1049
|
+
headers: T,
|
|
1050
1050
|
config: e,
|
|
1051
1051
|
request: p
|
|
1052
1052
|
};
|
|
@@ -1056,29 +1056,29 @@ const rt = (e) => {
|
|
|
1056
1056
|
r(D), m();
|
|
1057
1057
|
}, A), p = null;
|
|
1058
1058
|
}
|
|
1059
|
-
"onloadend" in p ? p.onloadend =
|
|
1060
|
-
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(
|
|
1059
|
+
"onloadend" in p ? p.onloadend = S : p.onreadystatechange = function() {
|
|
1060
|
+
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(S);
|
|
1061
1061
|
}, p.onabort = function() {
|
|
1062
1062
|
p && (r(new E("Request aborted", E.ECONNABORTED, e, p)), p = null);
|
|
1063
1063
|
}, p.onerror = function() {
|
|
1064
1064
|
r(new E("Network Error", E.ERR_NETWORK, e, p)), p = null;
|
|
1065
1065
|
}, p.ontimeout = function() {
|
|
1066
|
-
let
|
|
1066
|
+
let P = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1067
1067
|
const A = s.transitional || Ze;
|
|
1068
|
-
s.timeoutErrorMessage && (
|
|
1069
|
-
|
|
1068
|
+
s.timeoutErrorMessage && (P = s.timeoutErrorMessage), r(new E(
|
|
1069
|
+
P,
|
|
1070
1070
|
A.clarifyTimeoutError ? E.ETIMEDOUT : E.ECONNABORTED,
|
|
1071
1071
|
e,
|
|
1072
1072
|
p
|
|
1073
1073
|
)), p = null;
|
|
1074
|
-
}, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(
|
|
1075
|
-
p.setRequestHeader(A,
|
|
1076
|
-
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([y, h] = Q(u, !0), p.addEventListener("progress", y)), f && p.upload && ([d,
|
|
1077
|
-
p && (r(!
|
|
1074
|
+
}, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(P, A) {
|
|
1075
|
+
p.setRequestHeader(A, P);
|
|
1076
|
+
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([y, h] = Q(u, !0), p.addEventListener("progress", y)), f && p.upload && ([d, R] = Q(f), p.upload.addEventListener("progress", d), p.upload.addEventListener("loadend", R)), (s.cancelToken || s.signal) && (l = (T) => {
|
|
1077
|
+
p && (r(!T || T.type ? new K(null, e, p) : T), p.abort(), p = null);
|
|
1078
1078
|
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
|
|
1079
|
-
const
|
|
1080
|
-
if (
|
|
1081
|
-
r(new E("Unsupported protocol " +
|
|
1079
|
+
const w = On(s.url);
|
|
1080
|
+
if (w && O.protocols.indexOf(w) === -1) {
|
|
1081
|
+
r(new E("Unsupported protocol " + w + ":", E.ERR_BAD_REQUEST, e));
|
|
1082
1082
|
return;
|
|
1083
1083
|
}
|
|
1084
1084
|
p.send(o || null);
|
|
@@ -1091,7 +1091,7 @@ const rt = (e) => {
|
|
|
1091
1091
|
if (!s) {
|
|
1092
1092
|
s = !0, c();
|
|
1093
1093
|
const l = u instanceof Error ? u : this.reason;
|
|
1094
|
-
r.abort(l instanceof E ? l : new
|
|
1094
|
+
r.abort(l instanceof E ? l : new K(l instanceof Error ? l.message : l));
|
|
1095
1095
|
}
|
|
1096
1096
|
};
|
|
1097
1097
|
let i = t && setTimeout(() => {
|
|
@@ -1171,7 +1171,7 @@ const rt = (e) => {
|
|
|
1171
1171
|
}
|
|
1172
1172
|
}, qn = st && ot(() => {
|
|
1173
1173
|
let e = !1;
|
|
1174
|
-
const t = new Request(
|
|
1174
|
+
const t = new Request(O.origin, {
|
|
1175
1175
|
body: new ReadableStream(),
|
|
1176
1176
|
method: "POST",
|
|
1177
1177
|
get duplex() {
|
|
@@ -1189,13 +1189,13 @@ ie && ((e) => {
|
|
|
1189
1189
|
});
|
|
1190
1190
|
});
|
|
1191
1191
|
})(new Response());
|
|
1192
|
-
const
|
|
1192
|
+
const Hn = async (e) => {
|
|
1193
1193
|
if (e == null)
|
|
1194
1194
|
return 0;
|
|
1195
1195
|
if (a.isBlob(e))
|
|
1196
1196
|
return e.size;
|
|
1197
1197
|
if (a.isSpecCompliantForm(e))
|
|
1198
|
-
return (await new Request(
|
|
1198
|
+
return (await new Request(O.origin, {
|
|
1199
1199
|
method: "POST",
|
|
1200
1200
|
body: e
|
|
1201
1201
|
}).arrayBuffer()).byteLength;
|
|
@@ -1203,9 +1203,9 @@ const Mn = async (e) => {
|
|
|
1203
1203
|
return e.byteLength;
|
|
1204
1204
|
if (a.isURLSearchParams(e) && (e = e + ""), a.isString(e))
|
|
1205
1205
|
return (await Bn(e)).byteLength;
|
|
1206
|
-
},
|
|
1206
|
+
}, Mn = async (e, t) => {
|
|
1207
1207
|
const n = a.toFiniteNumber(e.getContentLength());
|
|
1208
|
-
return n ??
|
|
1208
|
+
return n ?? Hn(t);
|
|
1209
1209
|
}, jn = ie && (async (e) => {
|
|
1210
1210
|
let {
|
|
1211
1211
|
url: t,
|
|
@@ -1222,78 +1222,78 @@ const Mn = async (e) => {
|
|
|
1222
1222
|
fetchOptions: y
|
|
1223
1223
|
} = rt(e);
|
|
1224
1224
|
u = u ? (u + "").toLowerCase() : "text";
|
|
1225
|
-
let
|
|
1226
|
-
const m =
|
|
1227
|
-
|
|
1225
|
+
let R = Pn([s, o && o.toAbortSignal()], i), h;
|
|
1226
|
+
const m = R && R.unsubscribe && (() => {
|
|
1227
|
+
R.unsubscribe();
|
|
1228
1228
|
});
|
|
1229
1229
|
let p;
|
|
1230
1230
|
try {
|
|
1231
|
-
if (f && qn && n !== "get" && n !== "head" && (p = await
|
|
1231
|
+
if (f && qn && n !== "get" && n !== "head" && (p = await Mn(l, r)) !== 0) {
|
|
1232
1232
|
let A = new Request(t, {
|
|
1233
1233
|
method: "POST",
|
|
1234
1234
|
body: r,
|
|
1235
1235
|
duplex: "half"
|
|
1236
|
-
}),
|
|
1237
|
-
if (a.isFormData(r) && (
|
|
1238
|
-
const [D,
|
|
1236
|
+
}), F;
|
|
1237
|
+
if (a.isFormData(r) && (F = A.headers.get("content-type")) && l.setContentType(F), A.body) {
|
|
1238
|
+
const [D, W] = Ne(
|
|
1239
1239
|
p,
|
|
1240
1240
|
Q(Ce(f))
|
|
1241
1241
|
);
|
|
1242
|
-
r = Ue(A.body, Ie, D,
|
|
1242
|
+
r = Ue(A.body, Ie, D, W);
|
|
1243
1243
|
}
|
|
1244
1244
|
}
|
|
1245
1245
|
a.isString(d) || (d = d ? "include" : "omit");
|
|
1246
|
-
const
|
|
1246
|
+
const S = "credentials" in Request.prototype;
|
|
1247
1247
|
h = new Request(t, {
|
|
1248
1248
|
...y,
|
|
1249
|
-
signal:
|
|
1249
|
+
signal: R,
|
|
1250
1250
|
method: n.toUpperCase(),
|
|
1251
1251
|
headers: l.normalize().toJSON(),
|
|
1252
1252
|
body: r,
|
|
1253
1253
|
duplex: "half",
|
|
1254
|
-
credentials:
|
|
1254
|
+
credentials: S ? d : void 0
|
|
1255
1255
|
});
|
|
1256
|
-
let
|
|
1257
|
-
const
|
|
1258
|
-
if (he && (c ||
|
|
1256
|
+
let w = await fetch(h);
|
|
1257
|
+
const T = he && (u === "stream" || u === "response");
|
|
1258
|
+
if (he && (c || T && m)) {
|
|
1259
1259
|
const A = {};
|
|
1260
|
-
["status", "statusText", "headers"].forEach((
|
|
1261
|
-
A[
|
|
1260
|
+
["status", "statusText", "headers"].forEach((ge) => {
|
|
1261
|
+
A[ge] = w[ge];
|
|
1262
1262
|
});
|
|
1263
|
-
const
|
|
1264
|
-
|
|
1263
|
+
const F = a.toFiniteNumber(w.headers.get("content-length")), [D, W] = c && Ne(
|
|
1264
|
+
F,
|
|
1265
1265
|
Q(Ce(c), !0)
|
|
1266
1266
|
) || [];
|
|
1267
|
-
|
|
1268
|
-
Ue(
|
|
1269
|
-
|
|
1267
|
+
w = new Response(
|
|
1268
|
+
Ue(w.body, Ie, D, () => {
|
|
1269
|
+
W && W(), m && m();
|
|
1270
1270
|
}),
|
|
1271
1271
|
A
|
|
1272
1272
|
);
|
|
1273
1273
|
}
|
|
1274
1274
|
u = u || "text";
|
|
1275
|
-
let
|
|
1276
|
-
return !
|
|
1277
|
-
tt(A,
|
|
1278
|
-
data:
|
|
1279
|
-
headers: N.from(
|
|
1280
|
-
status:
|
|
1281
|
-
statusText:
|
|
1275
|
+
let P = await ee[a.findKey(ee, u) || "text"](w, e);
|
|
1276
|
+
return !T && m && m(), await new Promise((A, F) => {
|
|
1277
|
+
tt(A, F, {
|
|
1278
|
+
data: P,
|
|
1279
|
+
headers: N.from(w.headers),
|
|
1280
|
+
status: w.status,
|
|
1281
|
+
statusText: w.statusText,
|
|
1282
1282
|
config: e,
|
|
1283
1283
|
request: h
|
|
1284
1284
|
});
|
|
1285
1285
|
});
|
|
1286
|
-
} catch (
|
|
1287
|
-
throw m && m(),
|
|
1286
|
+
} catch (S) {
|
|
1287
|
+
throw m && m(), S && S.name === "TypeError" && /Load failed|fetch/i.test(S.message) ? Object.assign(
|
|
1288
1288
|
new E("Network Error", E.ERR_NETWORK, e, h),
|
|
1289
1289
|
{
|
|
1290
|
-
cause:
|
|
1290
|
+
cause: S.cause || S
|
|
1291
1291
|
}
|
|
1292
|
-
) : E.from(
|
|
1292
|
+
) : E.from(S, S && S.code, e, h);
|
|
1293
1293
|
}
|
|
1294
1294
|
}), me = {
|
|
1295
1295
|
http: tn,
|
|
1296
|
-
xhr:
|
|
1296
|
+
xhr: xn,
|
|
1297
1297
|
fetch: jn
|
|
1298
1298
|
};
|
|
1299
1299
|
a.forEach(me, (e, t) => {
|
|
@@ -1305,7 +1305,7 @@ a.forEach(me, (e, t) => {
|
|
|
1305
1305
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1306
1306
|
}
|
|
1307
1307
|
});
|
|
1308
|
-
const
|
|
1308
|
+
const xe = (e) => `- ${e}`, zn = (e) => a.isFunction(e) || e === null || e === !1, it = {
|
|
1309
1309
|
getAdapter: (e) => {
|
|
1310
1310
|
e = a.isArray(e) ? e : [e];
|
|
1311
1311
|
const { length: t } = e;
|
|
@@ -1325,8 +1325,8 @@ const ke = (e) => `- ${e}`, zn = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1325
1325
|
([c, f]) => `adapter ${c} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1326
1326
|
);
|
|
1327
1327
|
let i = t ? o.length > 1 ? `since :
|
|
1328
|
-
` + o.map(
|
|
1329
|
-
`) : " " +
|
|
1328
|
+
` + o.map(xe).join(`
|
|
1329
|
+
`) : " " + xe(o[0]) : "as no adapter specified";
|
|
1330
1330
|
throw new E(
|
|
1331
1331
|
"There is no suitable adapter to dispatch the request " + i,
|
|
1332
1332
|
"ERR_NOT_SUPPORT"
|
|
@@ -1338,13 +1338,13 @@ const ke = (e) => `- ${e}`, zn = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1338
1338
|
};
|
|
1339
1339
|
function le(e) {
|
|
1340
1340
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1341
|
-
throw new
|
|
1341
|
+
throw new K(null, e);
|
|
1342
1342
|
}
|
|
1343
1343
|
function Pe(e) {
|
|
1344
1344
|
return le(e), e.headers = N.from(e.headers), e.data = ue.call(
|
|
1345
1345
|
e,
|
|
1346
1346
|
e.transformRequest
|
|
1347
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), it.getAdapter(e.adapter ||
|
|
1347
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), it.getAdapter(e.adapter || J.adapter)(e).then(function(r) {
|
|
1348
1348
|
return le(e), r.data = ue.call(
|
|
1349
1349
|
e,
|
|
1350
1350
|
e.transformResponse,
|
|
@@ -1407,7 +1407,7 @@ const Z = {
|
|
|
1407
1407
|
assertOptions: Kn,
|
|
1408
1408
|
validators: ae
|
|
1409
1409
|
}, I = Z.validators;
|
|
1410
|
-
let
|
|
1410
|
+
let H = class {
|
|
1411
1411
|
constructor(t) {
|
|
1412
1412
|
this.defaults = t || {}, this.interceptors = {
|
|
1413
1413
|
request: new Ae(),
|
|
@@ -1440,7 +1440,7 @@ let M = class {
|
|
|
1440
1440
|
}
|
|
1441
1441
|
}
|
|
1442
1442
|
_request(t, n) {
|
|
1443
|
-
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n =
|
|
1443
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = M(this.defaults, n);
|
|
1444
1444
|
const { transitional: r, paramsSerializer: s, headers: o } = n;
|
|
1445
1445
|
r !== void 0 && Z.assertOptions(r, {
|
|
1446
1446
|
silentJSONParsing: I.transitional(I.boolean),
|
|
@@ -1482,18 +1482,18 @@ let M = class {
|
|
|
1482
1482
|
return l;
|
|
1483
1483
|
}
|
|
1484
1484
|
y = c.length;
|
|
1485
|
-
let
|
|
1485
|
+
let R = n;
|
|
1486
1486
|
for (d = 0; d < y; ) {
|
|
1487
1487
|
const h = c[d++], m = c[d++];
|
|
1488
1488
|
try {
|
|
1489
|
-
|
|
1489
|
+
R = h(R);
|
|
1490
1490
|
} catch (p) {
|
|
1491
1491
|
m.call(this, p);
|
|
1492
1492
|
break;
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
1495
|
try {
|
|
1496
|
-
l = Pe.call(this,
|
|
1496
|
+
l = Pe.call(this, R);
|
|
1497
1497
|
} catch (h) {
|
|
1498
1498
|
return Promise.reject(h);
|
|
1499
1499
|
}
|
|
@@ -1502,14 +1502,14 @@ let M = class {
|
|
|
1502
1502
|
return l;
|
|
1503
1503
|
}
|
|
1504
1504
|
getUri(t) {
|
|
1505
|
-
t =
|
|
1505
|
+
t = M(this.defaults, t);
|
|
1506
1506
|
const n = nt(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
1507
1507
|
return Ye(n, t.params, t.paramsSerializer);
|
|
1508
1508
|
}
|
|
1509
1509
|
};
|
|
1510
1510
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1511
|
-
|
|
1512
|
-
return this.request(
|
|
1511
|
+
H.prototype[t] = function(n, r) {
|
|
1512
|
+
return this.request(M(r || {}, {
|
|
1513
1513
|
method: t,
|
|
1514
1514
|
url: n,
|
|
1515
1515
|
data: (r || {}).data
|
|
@@ -1519,7 +1519,7 @@ a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1519
1519
|
a.forEach(["post", "put", "patch"], function(t) {
|
|
1520
1520
|
function n(r) {
|
|
1521
1521
|
return function(o, i, c) {
|
|
1522
|
-
return this.request(
|
|
1522
|
+
return this.request(M(c || {}, {
|
|
1523
1523
|
method: t,
|
|
1524
1524
|
headers: r ? {
|
|
1525
1525
|
"Content-Type": "multipart/form-data"
|
|
@@ -1529,7 +1529,7 @@ a.forEach(["post", "put", "patch"], function(t) {
|
|
|
1529
1529
|
}));
|
|
1530
1530
|
};
|
|
1531
1531
|
}
|
|
1532
|
-
|
|
1532
|
+
H.prototype[t] = n(), H.prototype[t + "Form"] = n(!0);
|
|
1533
1533
|
});
|
|
1534
1534
|
let $n = class ct {
|
|
1535
1535
|
constructor(t) {
|
|
@@ -1555,7 +1555,7 @@ let $n = class ct {
|
|
|
1555
1555
|
r.unsubscribe(o);
|
|
1556
1556
|
}, i;
|
|
1557
1557
|
}, t(function(o, i, c) {
|
|
1558
|
-
r.reason || (r.reason = new
|
|
1558
|
+
r.reason || (r.reason = new K(o, i, c), n(r.reason));
|
|
1559
1559
|
});
|
|
1560
1560
|
}
|
|
1561
1561
|
/**
|
|
@@ -1681,49 +1681,49 @@ Object.entries(Ee).forEach(([e, t]) => {
|
|
|
1681
1681
|
Ee[t] = e;
|
|
1682
1682
|
});
|
|
1683
1683
|
function ut(e) {
|
|
1684
|
-
const t = new
|
|
1685
|
-
return a.extend(n,
|
|
1686
|
-
return ut(
|
|
1684
|
+
const t = new H(e), n = He(H.prototype.request, t);
|
|
1685
|
+
return a.extend(n, H.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1686
|
+
return ut(M(e, s));
|
|
1687
1687
|
}, n;
|
|
1688
1688
|
}
|
|
1689
|
-
const
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1689
|
+
const g = ut(J);
|
|
1690
|
+
g.Axios = H;
|
|
1691
|
+
g.CanceledError = K;
|
|
1692
|
+
g.CancelToken = $n;
|
|
1693
|
+
g.isCancel = et;
|
|
1694
|
+
g.VERSION = at;
|
|
1695
|
+
g.toFormData = oe;
|
|
1696
|
+
g.AxiosError = E;
|
|
1697
|
+
g.Cancel = g.CanceledError;
|
|
1698
|
+
g.all = function(t) {
|
|
1699
1699
|
return Promise.all(t);
|
|
1700
1700
|
};
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1701
|
+
g.spread = Gn;
|
|
1702
|
+
g.isAxiosError = vn;
|
|
1703
|
+
g.mergeConfig = M;
|
|
1704
|
+
g.AxiosHeaders = N;
|
|
1705
|
+
g.formToJSON = (e) => Qe(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1706
|
+
g.getAdapter = it.getAdapter;
|
|
1707
|
+
g.HttpStatusCode = Ee;
|
|
1708
|
+
g.default = g;
|
|
1709
1709
|
const {
|
|
1710
1710
|
Axios: hr,
|
|
1711
1711
|
AxiosError: Vn,
|
|
1712
1712
|
CanceledError: mr,
|
|
1713
1713
|
isCancel: Er,
|
|
1714
1714
|
CancelToken: yr,
|
|
1715
|
-
VERSION:
|
|
1716
|
-
all:
|
|
1717
|
-
Cancel:
|
|
1718
|
-
isAxiosError:
|
|
1719
|
-
spread:
|
|
1720
|
-
toFormData:
|
|
1715
|
+
VERSION: Rr,
|
|
1716
|
+
all: Sr,
|
|
1717
|
+
Cancel: gr,
|
|
1718
|
+
isAxiosError: wr,
|
|
1719
|
+
spread: Tr,
|
|
1720
|
+
toFormData: br,
|
|
1721
1721
|
AxiosHeaders: Or,
|
|
1722
1722
|
HttpStatusCode: B,
|
|
1723
1723
|
formToJSON: Ar,
|
|
1724
1724
|
getAdapter: _r,
|
|
1725
1725
|
mergeConfig: Nr
|
|
1726
|
-
} =
|
|
1726
|
+
} = g, Jn = (e) => (e.baseURL = qe(), e.headers.Authorization = localStorage.getItem(x.TOKEN), e.headers["client-id"] = localStorage.getItem(x.CLIENT_ID), e.metadata = { startTime: /* @__PURE__ */ new Date() }, { ...e }), Fe = (e, t, n) => {
|
|
1727
1727
|
for (const r of e)
|
|
1728
1728
|
t ? r.rej(t) : r.res(n);
|
|
1729
1729
|
}, Wn = async (e) => new Promise((t, n) => {
|
|
@@ -1742,26 +1742,26 @@ const {
|
|
|
1742
1742
|
);
|
|
1743
1743
|
}, Yn = async (e, t, n, r, s) => {
|
|
1744
1744
|
var f, u, l;
|
|
1745
|
-
const o = t.config, i = localStorage.getItem(
|
|
1745
|
+
const o = t.config, i = localStorage.getItem(x.REFRESH_TOKEN), c = ((f = t.response) == null ? void 0 : f.status) || B.InternalServerError;
|
|
1746
1746
|
if (!o || o.__retries === n)
|
|
1747
1747
|
throw t;
|
|
1748
|
-
if (c === B.Unauthorized && o.url !==
|
|
1748
|
+
if (c === B.Unauthorized && o.url !== b.REFRESH_EMBED_TOKEN && o.url !== b.REFRESH_TOKEN && o.url !== b.SIGN_IN && o.url !== b.SIGN_UP) {
|
|
1749
1749
|
if (!i)
|
|
1750
1750
|
throw De(
|
|
1751
1751
|
"refresh_token",
|
|
1752
1752
|
"no refresh token found to reauthenticate user"
|
|
1753
1753
|
), t;
|
|
1754
1754
|
if (r)
|
|
1755
|
-
return new Promise((p,
|
|
1756
|
-
e.push({ res: p, rej:
|
|
1755
|
+
return new Promise((p, S) => {
|
|
1756
|
+
e.push({ res: p, rej: S });
|
|
1757
1757
|
}).then((p) => (o.headers && (o.headers.Authorization = `Bearer ${p}`), s(o))).catch((p) => {
|
|
1758
1758
|
throw p;
|
|
1759
1759
|
});
|
|
1760
1760
|
r = !0;
|
|
1761
|
-
const y = localStorage.getItem(
|
|
1761
|
+
const y = localStorage.getItem(x.AUTH_FLOW) === dt.POST_MESSAGE ? Be.refreshEmbedToken : Be.refreshToken, { data: R, success: h, message: m } = await y(i);
|
|
1762
1762
|
if (!h)
|
|
1763
|
-
throw (u = o == null ? void 0 : o.url) != null && u.includes(
|
|
1764
|
-
return (l = o.url) != null && l.includes(
|
|
1763
|
+
throw (u = o == null ? void 0 : o.url) != null && u.includes(b.EXCHANGE_TOKEN) || De("refresh_token", m), r = !1, Fe(e, t), t;
|
|
1764
|
+
return (l = o.url) != null && l.includes(b.EXCHANGE_TOKEN) && "id_token" in R && (o.data = JSON.stringify({ idToken: R.id_token })), r = !1, o.headers && (o.headers.Authorization = `Bearer ${R.token}`), Fe(e, null, R.token), s(o);
|
|
1765
1765
|
}
|
|
1766
1766
|
if ([
|
|
1767
1767
|
B.Unauthorized,
|
|
@@ -1776,9 +1776,9 @@ const {
|
|
|
1776
1776
|
Math.pow(10, o.__retries + 1) / 2
|
|
1777
1777
|
// Exponential backoff 50ms, 500ms, 5000ms
|
|
1778
1778
|
);
|
|
1779
|
-
}, Zn =
|
|
1780
|
-
Zn.interceptors.request.use((e) => (e.baseURL = qe(), e.headers.Authorization = localStorage.getItem(
|
|
1781
|
-
const C =
|
|
1779
|
+
}, Zn = g.create();
|
|
1780
|
+
Zn.interceptors.request.use((e) => (e.baseURL = qe(), e.headers.Authorization = localStorage.getItem(x.TOKEN), e.metadata = { startTime: /* @__PURE__ */ new Date() }, { ...e }));
|
|
1781
|
+
const C = g.create();
|
|
1782
1782
|
C.interceptors.request.use((e) => (e = Jn(e), e));
|
|
1783
1783
|
const Qn = 3;
|
|
1784
1784
|
let er = !1;
|
|
@@ -1801,19 +1801,19 @@ class nr {
|
|
|
1801
1801
|
* @param params - The sign-in parameters containing email and password.
|
|
1802
1802
|
* @returns A promise that resolves to a service response containing authentication data.
|
|
1803
1803
|
*/
|
|
1804
|
-
|
|
1804
|
+
k(this, "login", async (t) => {
|
|
1805
1805
|
var n, r, s, o, i;
|
|
1806
1806
|
try {
|
|
1807
|
-
const { data: c } = await C.post(
|
|
1807
|
+
const { data: c } = await C.post(b.SIGN_IN, {
|
|
1808
1808
|
email_address: t.email,
|
|
1809
1809
|
password: t.password
|
|
1810
|
-
}), f = await
|
|
1811
|
-
queryKey: [
|
|
1810
|
+
}), f = await $.ensureQueryData({
|
|
1811
|
+
queryKey: [j.USER_REGIONS],
|
|
1812
1812
|
queryFn: this.getRegions
|
|
1813
|
-
}), u =
|
|
1814
|
-
return localStorage.setItem(
|
|
1813
|
+
}), u = L(c.data), l = (n = c.data) == null ? void 0 : n.accessToken;
|
|
1814
|
+
return localStorage.setItem(x.TOKEN, l), {
|
|
1815
1815
|
success: !0,
|
|
1816
|
-
data:
|
|
1816
|
+
data: L({
|
|
1817
1817
|
...c.data,
|
|
1818
1818
|
token: (r = c.data) == null ? void 0 : r.accessToken,
|
|
1819
1819
|
user: {
|
|
@@ -1837,10 +1837,10 @@ class nr {
|
|
|
1837
1837
|
* @param params - The sign-up parameters containing email, password, and region.
|
|
1838
1838
|
* @returns A promise that resolves to a service response containing authentication data.
|
|
1839
1839
|
*/
|
|
1840
|
-
|
|
1840
|
+
k(this, "signUp", async (t) => {
|
|
1841
1841
|
var n, r, s, o, i, c;
|
|
1842
1842
|
try {
|
|
1843
|
-
const { data: f } = await C.post(
|
|
1843
|
+
const { data: f } = await C.post(b.SIGN_UP, {
|
|
1844
1844
|
user: {
|
|
1845
1845
|
email_address: t.email,
|
|
1846
1846
|
password: t.password,
|
|
@@ -1849,11 +1849,11 @@ class nr {
|
|
|
1849
1849
|
success_url: t.successUrl,
|
|
1850
1850
|
cancel_url: t.cancelUrl,
|
|
1851
1851
|
price_id: t.priceId
|
|
1852
|
-
}), u = await
|
|
1853
|
-
queryKey: [
|
|
1852
|
+
}), u = await $.ensureQueryData({
|
|
1853
|
+
queryKey: [j.USER_REGIONS],
|
|
1854
1854
|
queryFn: this.getRegions
|
|
1855
|
-
}), l =
|
|
1856
|
-
return localStorage.setItem(
|
|
1855
|
+
}), l = L(f.data), d = (n = f.data) == null ? void 0 : n.tokens.accessToken;
|
|
1856
|
+
return localStorage.setItem(x.TOKEN, d), {
|
|
1857
1857
|
success: !0,
|
|
1858
1858
|
data: {
|
|
1859
1859
|
accessToken: (r = f.data) == null ? void 0 : r.tokens.accessToken,
|
|
@@ -1873,11 +1873,41 @@ class nr {
|
|
|
1873
1873
|
};
|
|
1874
1874
|
}
|
|
1875
1875
|
});
|
|
1876
|
-
|
|
1876
|
+
k(this, "getOrCreateGoogleUser", async (t, n) => {
|
|
1877
|
+
var r, s, o, i, c, f;
|
|
1878
|
+
try {
|
|
1879
|
+
const { data: u } = await C.post(b.GOOGLE_AUTH, {
|
|
1880
|
+
google_access_token: t,
|
|
1881
|
+
user_region: n
|
|
1882
|
+
}), l = await $.ensureQueryData({
|
|
1883
|
+
queryKey: [j.USER_REGIONS],
|
|
1884
|
+
queryFn: this.getRegions
|
|
1885
|
+
}), d = L(u.data), y = (r = u.data) == null ? void 0 : r.tokens.accessToken;
|
|
1886
|
+
return localStorage.setItem(x.TOKEN, y), {
|
|
1887
|
+
success: !0,
|
|
1888
|
+
data: {
|
|
1889
|
+
accessToken: (s = u.data) == null ? void 0 : s.tokens.accessToken,
|
|
1890
|
+
refreshToken: (o = u.data) == null ? void 0 : o.tokens.refreshToken,
|
|
1891
|
+
user: {
|
|
1892
|
+
...d.user,
|
|
1893
|
+
userRegion: l.find(
|
|
1894
|
+
(R) => R.code === u.data.user.user_region
|
|
1895
|
+
)
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
};
|
|
1899
|
+
} catch (u) {
|
|
1900
|
+
return console.error(u), {
|
|
1901
|
+
success: !1,
|
|
1902
|
+
message: ((c = (i = u.response) == null ? void 0 : i.data) == null ? void 0 : c.message) || ((f = u == null ? void 0 : u.response) == null ? void 0 : f.data) || u.message || "error getting or creating google user"
|
|
1903
|
+
};
|
|
1904
|
+
}
|
|
1905
|
+
});
|
|
1906
|
+
k(this, "resendVerificationEmail", async (t) => {
|
|
1877
1907
|
var n, r, s;
|
|
1878
1908
|
try {
|
|
1879
1909
|
return (await C.post(
|
|
1880
|
-
|
|
1910
|
+
b.RESEND_VERIFICATION_EMAIL,
|
|
1881
1911
|
{
|
|
1882
1912
|
email_address: t.email,
|
|
1883
1913
|
success_url: t.successUrl,
|
|
@@ -1897,15 +1927,15 @@ class nr {
|
|
|
1897
1927
|
* @param idToken - The ID token to authenticate with.
|
|
1898
1928
|
* @returns A promise that resolves to a service response containing authentication data.
|
|
1899
1929
|
*/
|
|
1900
|
-
|
|
1930
|
+
k(this, "authenticateWithToken", async (t) => {
|
|
1901
1931
|
var n, r, s;
|
|
1902
1932
|
try {
|
|
1903
|
-
const { data: o } = await C.post(
|
|
1933
|
+
const { data: o } = await C.post(b.EXCHANGE_TOKEN, {
|
|
1904
1934
|
idToken: t
|
|
1905
|
-
}), i = await
|
|
1906
|
-
queryKey: [
|
|
1935
|
+
}), i = await $.ensureQueryData({
|
|
1936
|
+
queryKey: [j.USER_REGIONS],
|
|
1907
1937
|
queryFn: this.getRegions
|
|
1908
|
-
}), c =
|
|
1938
|
+
}), c = L(o.data);
|
|
1909
1939
|
return {
|
|
1910
1940
|
success: !0,
|
|
1911
1941
|
data: {
|
|
@@ -1930,10 +1960,10 @@ class nr {
|
|
|
1930
1960
|
*
|
|
1931
1961
|
* @returns A promise that resolves to a service response containing the user details.
|
|
1932
1962
|
*/
|
|
1933
|
-
|
|
1963
|
+
k(this, "checkUser", async () => {
|
|
1934
1964
|
try {
|
|
1935
|
-
const { data: t } = await C.get(
|
|
1936
|
-
queryKey: [
|
|
1965
|
+
const { data: t } = await C.get(b.ME), n = await $.ensureQueryData({
|
|
1966
|
+
queryKey: [j.USER_REGIONS],
|
|
1937
1967
|
queryFn: this.getRegions
|
|
1938
1968
|
}), r = {
|
|
1939
1969
|
...t.data,
|
|
@@ -1943,7 +1973,7 @@ class nr {
|
|
|
1943
1973
|
};
|
|
1944
1974
|
return {
|
|
1945
1975
|
success: !0,
|
|
1946
|
-
data:
|
|
1976
|
+
data: L(r)
|
|
1947
1977
|
};
|
|
1948
1978
|
} catch (t) {
|
|
1949
1979
|
console.error(t);
|
|
@@ -1960,15 +1990,15 @@ class nr {
|
|
|
1960
1990
|
*
|
|
1961
1991
|
* @param refreshToken - The refresh token
|
|
1962
1992
|
*/
|
|
1963
|
-
|
|
1993
|
+
k(this, "refreshEmbedToken", async (t) => {
|
|
1964
1994
|
try {
|
|
1965
1995
|
const { data: n } = await C.post(
|
|
1966
|
-
|
|
1996
|
+
b.REFRESH_EMBED_TOKEN,
|
|
1967
1997
|
{
|
|
1968
1998
|
refreshToken: t
|
|
1969
1999
|
}
|
|
1970
2000
|
), r = n.data.token;
|
|
1971
|
-
return localStorage.setItem(
|
|
2001
|
+
return localStorage.setItem(x.TOKEN, r), {
|
|
1972
2002
|
success: !0,
|
|
1973
2003
|
data: n.data
|
|
1974
2004
|
};
|
|
@@ -1985,15 +2015,15 @@ class nr {
|
|
|
1985
2015
|
*
|
|
1986
2016
|
* @param refreshToken - The refresh token
|
|
1987
2017
|
*/
|
|
1988
|
-
|
|
2018
|
+
k(this, "refreshToken", async (t) => {
|
|
1989
2019
|
try {
|
|
1990
2020
|
const { data: n } = await C.post(
|
|
1991
|
-
|
|
2021
|
+
b.REFRESH_TOKEN,
|
|
1992
2022
|
{
|
|
1993
2023
|
refreshToken: t
|
|
1994
2024
|
}
|
|
1995
2025
|
), r = n.data.accessToken;
|
|
1996
|
-
return localStorage.setItem(
|
|
2026
|
+
return localStorage.setItem(x.TOKEN, r), {
|
|
1997
2027
|
success: !0,
|
|
1998
2028
|
data: {
|
|
1999
2029
|
...n.data,
|
|
@@ -2013,29 +2043,29 @@ class nr {
|
|
|
2013
2043
|
*
|
|
2014
2044
|
* @returns A promise that resolves to a service response containing the request limit data.
|
|
2015
2045
|
*/
|
|
2016
|
-
|
|
2046
|
+
k(this, "getRequestLimit", async () => (await C.get(b.REQUEST_LIMIT)).data);
|
|
2017
2047
|
/**
|
|
2018
2048
|
* Retrieves the regions available for user registration.
|
|
2019
2049
|
*
|
|
2020
2050
|
* @returns A promise that resolves to a service response containing the available regions.
|
|
2021
2051
|
*/
|
|
2022
|
-
|
|
2052
|
+
k(this, "getRegions", async () => {
|
|
2023
2053
|
var n;
|
|
2024
|
-
const t = await C.get(
|
|
2025
|
-
return
|
|
2054
|
+
const t = await C.get(b.REGIONS);
|
|
2055
|
+
return L((n = t.data) == null ? void 0 : n.data);
|
|
2026
2056
|
});
|
|
2027
2057
|
}
|
|
2028
2058
|
}
|
|
2029
2059
|
const Be = new nr();
|
|
2030
2060
|
export {
|
|
2031
2061
|
Be as A,
|
|
2032
|
-
|
|
2033
|
-
|
|
2062
|
+
j as E,
|
|
2063
|
+
L as a,
|
|
2034
2064
|
mt as b,
|
|
2035
2065
|
C as c,
|
|
2036
|
-
|
|
2066
|
+
g as d,
|
|
2037
2067
|
Vn as e,
|
|
2038
|
-
|
|
2068
|
+
we as f,
|
|
2039
2069
|
Jn as g,
|
|
2040
2070
|
Yn as h,
|
|
2041
2071
|
Zn as i,
|