@odynn/awayz-core 0.10.30 → 0.10.31
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-B582vLTc.js +2149 -0
- package/dist/{TripsService-B2m7Yy9W.js → TripsService-BwBvXdDC.js} +6 -6
- package/dist/assets/_styles5.css +1 -1
- package/dist/assets/_styles6.css +1 -1
- package/dist/assets/_styles7.css +1 -0
- package/dist/components/CashValue/CashValue.js +15 -13
- package/dist/components/CashValue/CashValue.stories.js +22 -21
- package/dist/components/ClientPointsValue/ClientPointsValue.js +20 -18
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Wallet/Card/Card.stories.js +16 -14
- package/dist/hooks/useAwayzAuth/useAwayzAuth.js +15 -13
- package/dist/hooks/useBookingManagement/useBookingManagement.js +6 -4
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +5 -3
- package/dist/hooks/useFeatureFlags.js +1 -1
- package/dist/hooks/useSearchLimit.js +1 -1
- package/dist/hooks/useTripManagement/useTripManagement.js +7 -5
- package/dist/hooks/useTripManagement/useTripManagement.test.js +5 -3
- package/dist/hooks/useWallet/useWallet.js +31 -29
- package/dist/hooks/useWallet/useWallet.test.js +4 -2
- package/dist/lib/services/account/AccountService.d.ts +12 -2
- package/dist/lib/services/account/AccountServices.types.d.ts +13 -0
- package/dist/lib/services/index.d.ts +2 -0
- package/dist/lib/services/instanceConfig.d.ts +1 -1
- package/dist/main.js +43 -39
- package/dist/providers/AwayzProvider.js +10 -8
- package/dist/services/account/AccountService.js +3 -2
- package/dist/services/bookings/BookingService.js +3 -3
- package/dist/services/currency/CurrencyService.js +16 -14
- package/dist/services/features/featureService.js +1 -1
- package/dist/services/index.js +13 -9
- package/dist/services/instance.js +1 -1
- package/dist/services/instanceConfig.js +8 -20
- package/dist/services/noRetryInstance.js +9 -2
- 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/dist/utils/clientPoints.js +6 -4
- package/package.json +1 -1
- package/dist/assets/noRetryInstance.css +0 -1
- package/dist/noRetryInstance-DNLgOg0E.js +0 -2134
|
@@ -0,0 +1,2149 @@
|
|
|
1
|
+
var ct = Object.defineProperty;
|
|
2
|
+
var ut = (e, t, n) => t in e ? ct(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var O = (e, t, n) => ut(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import "react/jsx-runtime";
|
|
5
|
+
import "./arrayExtensions-DlcBOj5a.js";
|
|
6
|
+
import { a as C } from "./keys-BcBfU51M.js";
|
|
7
|
+
import "react";
|
|
8
|
+
import { awayzClient as G } from "./configs/awayzClient.js";
|
|
9
|
+
import { EAuthEndpoints as T } from "./configs/endpoints.js";
|
|
10
|
+
import { EAuthFlow as lt } from "./types/EAuthFlow.js";
|
|
11
|
+
import { getBaseUrl as De } from "./configs/baseUrl.js";
|
|
12
|
+
import { getGatewayBaseUrl as ft } from "./configs/gatewayBaseUrl.js";
|
|
13
|
+
const U = (e) => Array.isArray(e) ? e.map((t) => U(t)) : typeof e == "object" && e !== null ? Object.keys(e).reduce((t, n) => {
|
|
14
|
+
const s = pt(n);
|
|
15
|
+
return t[s] = U(e[n]), t;
|
|
16
|
+
}, {}) : e;
|
|
17
|
+
function dt(e) {
|
|
18
|
+
return e.replace(/([A-Z])/g, "_$1").toLowerCase();
|
|
19
|
+
}
|
|
20
|
+
const ye = (e) => Array.isArray(e) ? e.map((t) => ye(t)) : typeof e == "object" && e !== null ? Object.keys(e).reduce((t, n) => {
|
|
21
|
+
const s = dt(n);
|
|
22
|
+
return t[s] = ye(e[n]), t;
|
|
23
|
+
}, {}) : e, ht = (e) => (Object.keys(e).forEach(
|
|
24
|
+
(t) => !e[t] && delete e[t]
|
|
25
|
+
), e), pt = (e) => (e = e.replace(/^_+/, ""), e.replace(/_([a-z])/gi, (t, n) => n.toUpperCase()));
|
|
26
|
+
var q = /* @__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.GET_USER_REGION = "get_user_region", e.PRICING = "pricing", e.FAQS = "faqs", e.FEATURES = "features", e.AIRLINE_HEALTH = "airline_health", e.SUPPORTED_AIRLINE_PROGRAMS = "supported_airline_programs", e.CLIENT_DETAILS = "client-details", e))(q || {}), mt = /* @__PURE__ */ ((e) => (e.HOTEL = "Hotel", e.AIRLINE = "Airline", e.BANK = "Bank", e))(mt || {});
|
|
27
|
+
function Be(e, t) {
|
|
28
|
+
return function() {
|
|
29
|
+
return e.apply(t, arguments);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const { toString: Et } = Object.prototype, { getPrototypeOf: Re } = Object, { iterator: te, toStringTag: qe } = Symbol, ne = /* @__PURE__ */ ((e) => (t) => {
|
|
33
|
+
const n = Et.call(t);
|
|
34
|
+
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
35
|
+
})(/* @__PURE__ */ Object.create(null)), x = (e) => (e = e.toLowerCase(), (t) => ne(t) === e), se = (e) => (t) => typeof t === e, { isArray: z } = Array, v = se("undefined");
|
|
36
|
+
function Rt(e) {
|
|
37
|
+
return e !== null && !v(e) && e.constructor !== null && !v(e.constructor) && I(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
38
|
+
}
|
|
39
|
+
const He = x("ArrayBuffer");
|
|
40
|
+
function gt(e) {
|
|
41
|
+
let t;
|
|
42
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && He(e.buffer), t;
|
|
43
|
+
}
|
|
44
|
+
const St = se("string"), I = se("function"), Me = se("number"), re = (e) => e !== null && typeof e == "object", wt = (e) => e === !0 || e === !1, X = (e) => {
|
|
45
|
+
if (ne(e) !== "object")
|
|
46
|
+
return !1;
|
|
47
|
+
const t = Re(e);
|
|
48
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(qe in e) && !(te in e);
|
|
49
|
+
}, yt = x("Date"), Tt = x("File"), bt = x("Blob"), Ot = x("FileList"), At = (e) => re(e) && I(e.pipe), _t = (e) => {
|
|
50
|
+
let t;
|
|
51
|
+
return e && (typeof FormData == "function" && e instanceof FormData || I(e.append) && ((t = ne(e)) === "formdata" || // detect form-data instance
|
|
52
|
+
t === "object" && I(e.toString) && e.toString() === "[object FormData]"));
|
|
53
|
+
}, Nt = x("URLSearchParams"), [Ct, It, kt, Ut] = ["ReadableStream", "Request", "Response", "Headers"].map(x), xt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
54
|
+
function V(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
55
|
+
if (e === null || typeof e > "u")
|
|
56
|
+
return;
|
|
57
|
+
let s, r;
|
|
58
|
+
if (typeof e != "object" && (e = [e]), z(e))
|
|
59
|
+
for (s = 0, r = e.length; s < r; s++)
|
|
60
|
+
t.call(null, e[s], s, e);
|
|
61
|
+
else {
|
|
62
|
+
const i = n ? Object.getOwnPropertyNames(e) : Object.keys(e), o = i.length;
|
|
63
|
+
let c;
|
|
64
|
+
for (s = 0; s < o; s++)
|
|
65
|
+
c = i[s], t.call(null, e[c], c, e);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function je(e, t) {
|
|
69
|
+
t = t.toLowerCase();
|
|
70
|
+
const n = Object.keys(e);
|
|
71
|
+
let s = n.length, r;
|
|
72
|
+
for (; s-- > 0; )
|
|
73
|
+
if (r = n[s], t === r.toLowerCase())
|
|
74
|
+
return r;
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
const H = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Ge = (e) => !v(e) && e !== H;
|
|
78
|
+
function fe() {
|
|
79
|
+
const { caseless: e } = Ge(this) && this || {}, t = {}, n = (s, r) => {
|
|
80
|
+
const i = e && je(t, r) || r;
|
|
81
|
+
X(t[i]) && X(s) ? t[i] = fe(t[i], s) : X(s) ? t[i] = fe({}, s) : z(s) ? t[i] = s.slice() : t[i] = s;
|
|
82
|
+
};
|
|
83
|
+
for (let s = 0, r = arguments.length; s < r; s++)
|
|
84
|
+
arguments[s] && V(arguments[s], n);
|
|
85
|
+
return t;
|
|
86
|
+
}
|
|
87
|
+
const Lt = (e, t, n, { allOwnKeys: s } = {}) => (V(t, (r, i) => {
|
|
88
|
+
n && I(r) ? e[i] = Be(r, n) : e[i] = r;
|
|
89
|
+
}, { allOwnKeys: s }), e), Pt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Ft = (e, t, n, s) => {
|
|
90
|
+
e.prototype = Object.create(t.prototype, s), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
91
|
+
value: t.prototype
|
|
92
|
+
}), n && Object.assign(e.prototype, n);
|
|
93
|
+
}, Dt = (e, t, n, s) => {
|
|
94
|
+
let r, i, o;
|
|
95
|
+
const c = {};
|
|
96
|
+
if (t = t || {}, e == null) return t;
|
|
97
|
+
do {
|
|
98
|
+
for (r = Object.getOwnPropertyNames(e), i = r.length; i-- > 0; )
|
|
99
|
+
o = r[i], (!s || s(o, e, t)) && !c[o] && (t[o] = e[o], c[o] = !0);
|
|
100
|
+
e = n !== !1 && Re(e);
|
|
101
|
+
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
102
|
+
return t;
|
|
103
|
+
}, Bt = (e, t, n) => {
|
|
104
|
+
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
105
|
+
const s = e.indexOf(t, n);
|
|
106
|
+
return s !== -1 && s === n;
|
|
107
|
+
}, qt = (e) => {
|
|
108
|
+
if (!e) return null;
|
|
109
|
+
if (z(e)) return e;
|
|
110
|
+
let t = e.length;
|
|
111
|
+
if (!Me(t)) return null;
|
|
112
|
+
const n = new Array(t);
|
|
113
|
+
for (; t-- > 0; )
|
|
114
|
+
n[t] = e[t];
|
|
115
|
+
return n;
|
|
116
|
+
}, Ht = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Re(Uint8Array)), Mt = (e, t) => {
|
|
117
|
+
const s = (e && e[te]).call(e);
|
|
118
|
+
let r;
|
|
119
|
+
for (; (r = s.next()) && !r.done; ) {
|
|
120
|
+
const i = r.value;
|
|
121
|
+
t.call(e, i[0], i[1]);
|
|
122
|
+
}
|
|
123
|
+
}, jt = (e, t) => {
|
|
124
|
+
let n;
|
|
125
|
+
const s = [];
|
|
126
|
+
for (; (n = e.exec(t)) !== null; )
|
|
127
|
+
s.push(n);
|
|
128
|
+
return s;
|
|
129
|
+
}, Gt = x("HTMLFormElement"), zt = (e) => e.toLowerCase().replace(
|
|
130
|
+
/[-_\s]([a-z\d])(\w*)/g,
|
|
131
|
+
function(n, s, r) {
|
|
132
|
+
return s.toUpperCase() + r;
|
|
133
|
+
}
|
|
134
|
+
), Te = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Kt = x("RegExp"), ze = (e, t) => {
|
|
135
|
+
const n = Object.getOwnPropertyDescriptors(e), s = {};
|
|
136
|
+
V(n, (r, i) => {
|
|
137
|
+
let o;
|
|
138
|
+
(o = t(r, i, e)) !== !1 && (s[i] = o || r);
|
|
139
|
+
}), Object.defineProperties(e, s);
|
|
140
|
+
}, $t = (e) => {
|
|
141
|
+
ze(e, (t, n) => {
|
|
142
|
+
if (I(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
143
|
+
return !1;
|
|
144
|
+
const s = e[n];
|
|
145
|
+
if (I(s)) {
|
|
146
|
+
if (t.enumerable = !1, "writable" in t) {
|
|
147
|
+
t.writable = !1;
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
t.set || (t.set = () => {
|
|
151
|
+
throw Error("Can not rewrite read-only method '" + n + "'");
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}, vt = (e, t) => {
|
|
156
|
+
const n = {}, s = (r) => {
|
|
157
|
+
r.forEach((i) => {
|
|
158
|
+
n[i] = !0;
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
return z(e) ? s(e) : s(String(e).split(t)), n;
|
|
162
|
+
}, Vt = () => {
|
|
163
|
+
}, Jt = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
164
|
+
function Wt(e) {
|
|
165
|
+
return !!(e && I(e.append) && e[qe] === "FormData" && e[te]);
|
|
166
|
+
}
|
|
167
|
+
const Xt = (e) => {
|
|
168
|
+
const t = new Array(10), n = (s, r) => {
|
|
169
|
+
if (re(s)) {
|
|
170
|
+
if (t.indexOf(s) >= 0)
|
|
171
|
+
return;
|
|
172
|
+
if (!("toJSON" in s)) {
|
|
173
|
+
t[r] = s;
|
|
174
|
+
const i = z(s) ? [] : {};
|
|
175
|
+
return V(s, (o, c) => {
|
|
176
|
+
const f = n(o, r + 1);
|
|
177
|
+
!v(f) && (i[c] = f);
|
|
178
|
+
}), t[r] = void 0, i;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return s;
|
|
182
|
+
};
|
|
183
|
+
return n(e, 0);
|
|
184
|
+
}, Yt = x("AsyncFunction"), Zt = (e) => e && (re(e) || I(e)) && I(e.then) && I(e.catch), Ke = ((e, t) => e ? setImmediate : t ? ((n, s) => (H.addEventListener("message", ({ source: r, data: i }) => {
|
|
185
|
+
r === H && i === n && s.length && s.shift()();
|
|
186
|
+
}, !1), (r) => {
|
|
187
|
+
s.push(r), H.postMessage(n, "*");
|
|
188
|
+
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
189
|
+
typeof setImmediate == "function",
|
|
190
|
+
I(H.postMessage)
|
|
191
|
+
), Qt = typeof queueMicrotask < "u" ? queueMicrotask.bind(H) : typeof process < "u" && process.nextTick || Ke, en = (e) => e != null && I(e[te]), a = {
|
|
192
|
+
isArray: z,
|
|
193
|
+
isArrayBuffer: He,
|
|
194
|
+
isBuffer: Rt,
|
|
195
|
+
isFormData: _t,
|
|
196
|
+
isArrayBufferView: gt,
|
|
197
|
+
isString: St,
|
|
198
|
+
isNumber: Me,
|
|
199
|
+
isBoolean: wt,
|
|
200
|
+
isObject: re,
|
|
201
|
+
isPlainObject: X,
|
|
202
|
+
isReadableStream: Ct,
|
|
203
|
+
isRequest: It,
|
|
204
|
+
isResponse: kt,
|
|
205
|
+
isHeaders: Ut,
|
|
206
|
+
isUndefined: v,
|
|
207
|
+
isDate: yt,
|
|
208
|
+
isFile: Tt,
|
|
209
|
+
isBlob: bt,
|
|
210
|
+
isRegExp: Kt,
|
|
211
|
+
isFunction: I,
|
|
212
|
+
isStream: At,
|
|
213
|
+
isURLSearchParams: Nt,
|
|
214
|
+
isTypedArray: Ht,
|
|
215
|
+
isFileList: Ot,
|
|
216
|
+
forEach: V,
|
|
217
|
+
merge: fe,
|
|
218
|
+
extend: Lt,
|
|
219
|
+
trim: xt,
|
|
220
|
+
stripBOM: Pt,
|
|
221
|
+
inherits: Ft,
|
|
222
|
+
toFlatObject: Dt,
|
|
223
|
+
kindOf: ne,
|
|
224
|
+
kindOfTest: x,
|
|
225
|
+
endsWith: Bt,
|
|
226
|
+
toArray: qt,
|
|
227
|
+
forEachEntry: Mt,
|
|
228
|
+
matchAll: jt,
|
|
229
|
+
isHTMLForm: Gt,
|
|
230
|
+
hasOwnProperty: Te,
|
|
231
|
+
hasOwnProp: Te,
|
|
232
|
+
// an alias to avoid ESLint no-prototype-builtins detection
|
|
233
|
+
reduceDescriptors: ze,
|
|
234
|
+
freezeMethods: $t,
|
|
235
|
+
toObjectSet: vt,
|
|
236
|
+
toCamelCase: zt,
|
|
237
|
+
noop: Vt,
|
|
238
|
+
toFiniteNumber: Jt,
|
|
239
|
+
findKey: je,
|
|
240
|
+
global: H,
|
|
241
|
+
isContextDefined: Ge,
|
|
242
|
+
isSpecCompliantForm: Wt,
|
|
243
|
+
toJSONObject: Xt,
|
|
244
|
+
isAsyncFn: Yt,
|
|
245
|
+
isThenable: Zt,
|
|
246
|
+
setImmediate: Ke,
|
|
247
|
+
asap: Qt,
|
|
248
|
+
isIterable: en
|
|
249
|
+
};
|
|
250
|
+
function m(e, t, n, s, r) {
|
|
251
|
+
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), s && (this.request = s), r && (this.response = r, this.status = r.status ? r.status : null);
|
|
252
|
+
}
|
|
253
|
+
a.inherits(m, Error, {
|
|
254
|
+
toJSON: function() {
|
|
255
|
+
return {
|
|
256
|
+
// Standard
|
|
257
|
+
message: this.message,
|
|
258
|
+
name: this.name,
|
|
259
|
+
// Microsoft
|
|
260
|
+
description: this.description,
|
|
261
|
+
number: this.number,
|
|
262
|
+
// Mozilla
|
|
263
|
+
fileName: this.fileName,
|
|
264
|
+
lineNumber: this.lineNumber,
|
|
265
|
+
columnNumber: this.columnNumber,
|
|
266
|
+
stack: this.stack,
|
|
267
|
+
// Axios
|
|
268
|
+
config: a.toJSONObject(this.config),
|
|
269
|
+
code: this.code,
|
|
270
|
+
status: this.status
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
const $e = m.prototype, ve = {};
|
|
275
|
+
[
|
|
276
|
+
"ERR_BAD_OPTION_VALUE",
|
|
277
|
+
"ERR_BAD_OPTION",
|
|
278
|
+
"ECONNABORTED",
|
|
279
|
+
"ETIMEDOUT",
|
|
280
|
+
"ERR_NETWORK",
|
|
281
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
282
|
+
"ERR_DEPRECATED",
|
|
283
|
+
"ERR_BAD_RESPONSE",
|
|
284
|
+
"ERR_BAD_REQUEST",
|
|
285
|
+
"ERR_CANCELED",
|
|
286
|
+
"ERR_NOT_SUPPORT",
|
|
287
|
+
"ERR_INVALID_URL"
|
|
288
|
+
// eslint-disable-next-line func-names
|
|
289
|
+
].forEach((e) => {
|
|
290
|
+
ve[e] = { value: e };
|
|
291
|
+
});
|
|
292
|
+
Object.defineProperties(m, ve);
|
|
293
|
+
Object.defineProperty($e, "isAxiosError", { value: !0 });
|
|
294
|
+
m.from = (e, t, n, s, r, i) => {
|
|
295
|
+
const o = Object.create($e);
|
|
296
|
+
return a.toFlatObject(e, o, function(f) {
|
|
297
|
+
return f !== Error.prototype;
|
|
298
|
+
}, (c) => c !== "isAxiosError"), m.call(o, e.message, t, n, s, r), o.cause = e, o.name = e.name, i && Object.assign(o, i), o;
|
|
299
|
+
};
|
|
300
|
+
const tn = null;
|
|
301
|
+
function de(e) {
|
|
302
|
+
return a.isPlainObject(e) || a.isArray(e);
|
|
303
|
+
}
|
|
304
|
+
function Ve(e) {
|
|
305
|
+
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
306
|
+
}
|
|
307
|
+
function be(e, t, n) {
|
|
308
|
+
return e ? e.concat(t).map(function(r, i) {
|
|
309
|
+
return r = Ve(r), !n && i ? "[" + r + "]" : r;
|
|
310
|
+
}).join(n ? "." : "") : t;
|
|
311
|
+
}
|
|
312
|
+
function nn(e) {
|
|
313
|
+
return a.isArray(e) && !e.some(de);
|
|
314
|
+
}
|
|
315
|
+
const sn = a.toFlatObject(a, {}, null, function(t) {
|
|
316
|
+
return /^is[A-Z]/.test(t);
|
|
317
|
+
});
|
|
318
|
+
function oe(e, t, n) {
|
|
319
|
+
if (!a.isObject(e))
|
|
320
|
+
throw new TypeError("target must be an object");
|
|
321
|
+
t = t || new FormData(), n = a.toFlatObject(n, {
|
|
322
|
+
metaTokens: !0,
|
|
323
|
+
dots: !1,
|
|
324
|
+
indexes: !1
|
|
325
|
+
}, !1, function(E, p) {
|
|
326
|
+
return !a.isUndefined(p[E]);
|
|
327
|
+
});
|
|
328
|
+
const s = n.metaTokens, r = n.visitor || l, i = n.dots, o = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
|
|
329
|
+
if (!a.isFunction(r))
|
|
330
|
+
throw new TypeError("visitor must be a function");
|
|
331
|
+
function u(h) {
|
|
332
|
+
if (h === null) return "";
|
|
333
|
+
if (a.isDate(h))
|
|
334
|
+
return h.toISOString();
|
|
335
|
+
if (!f && a.isBlob(h))
|
|
336
|
+
throw new m("Blob is not supported. Use a Buffer instead.");
|
|
337
|
+
return a.isArrayBuffer(h) || a.isTypedArray(h) ? f && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
|
|
338
|
+
}
|
|
339
|
+
function l(h, E, p) {
|
|
340
|
+
let S = h;
|
|
341
|
+
if (h && !p && typeof h == "object") {
|
|
342
|
+
if (a.endsWith(E, "{}"))
|
|
343
|
+
E = s ? E : E.slice(0, -2), h = JSON.stringify(h);
|
|
344
|
+
else if (a.isArray(h) && nn(h) || (a.isFileList(h) || a.endsWith(E, "[]")) && (S = a.toArray(h)))
|
|
345
|
+
return E = Ve(E), S.forEach(function(b, P) {
|
|
346
|
+
!(a.isUndefined(b) || b === null) && t.append(
|
|
347
|
+
// eslint-disable-next-line no-nested-ternary
|
|
348
|
+
o === !0 ? be([E], P, i) : o === null ? E : E + "[]",
|
|
349
|
+
u(b)
|
|
350
|
+
);
|
|
351
|
+
}), !1;
|
|
352
|
+
}
|
|
353
|
+
return de(h) ? !0 : (t.append(be(p, E, i), u(h)), !1);
|
|
354
|
+
}
|
|
355
|
+
const d = [], R = Object.assign(sn, {
|
|
356
|
+
defaultVisitor: l,
|
|
357
|
+
convertValue: u,
|
|
358
|
+
isVisitable: de
|
|
359
|
+
});
|
|
360
|
+
function w(h, E) {
|
|
361
|
+
if (!a.isUndefined(h)) {
|
|
362
|
+
if (d.indexOf(h) !== -1)
|
|
363
|
+
throw Error("Circular reference detected in " + E.join("."));
|
|
364
|
+
d.push(h), a.forEach(h, function(S, y) {
|
|
365
|
+
(!(a.isUndefined(S) || S === null) && r.call(
|
|
366
|
+
t,
|
|
367
|
+
S,
|
|
368
|
+
a.isString(y) ? y.trim() : y,
|
|
369
|
+
E,
|
|
370
|
+
R
|
|
371
|
+
)) === !0 && w(S, E ? E.concat(y) : [y]);
|
|
372
|
+
}), d.pop();
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
if (!a.isObject(e))
|
|
376
|
+
throw new TypeError("data must be an object");
|
|
377
|
+
return w(e), t;
|
|
378
|
+
}
|
|
379
|
+
function Oe(e) {
|
|
380
|
+
const t = {
|
|
381
|
+
"!": "%21",
|
|
382
|
+
"'": "%27",
|
|
383
|
+
"(": "%28",
|
|
384
|
+
")": "%29",
|
|
385
|
+
"~": "%7E",
|
|
386
|
+
"%20": "+",
|
|
387
|
+
"%00": "\0"
|
|
388
|
+
};
|
|
389
|
+
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(s) {
|
|
390
|
+
return t[s];
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
function ge(e, t) {
|
|
394
|
+
this._pairs = [], e && oe(e, this, t);
|
|
395
|
+
}
|
|
396
|
+
const Je = ge.prototype;
|
|
397
|
+
Je.append = function(t, n) {
|
|
398
|
+
this._pairs.push([t, n]);
|
|
399
|
+
};
|
|
400
|
+
Je.toString = function(t) {
|
|
401
|
+
const n = t ? function(s) {
|
|
402
|
+
return t.call(this, s, Oe);
|
|
403
|
+
} : Oe;
|
|
404
|
+
return this._pairs.map(function(r) {
|
|
405
|
+
return n(r[0]) + "=" + n(r[1]);
|
|
406
|
+
}, "").join("&");
|
|
407
|
+
};
|
|
408
|
+
function rn(e) {
|
|
409
|
+
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
410
|
+
}
|
|
411
|
+
function We(e, t, n) {
|
|
412
|
+
if (!t)
|
|
413
|
+
return e;
|
|
414
|
+
const s = n && n.encode || rn;
|
|
415
|
+
a.isFunction(n) && (n = {
|
|
416
|
+
serialize: n
|
|
417
|
+
});
|
|
418
|
+
const r = n && n.serialize;
|
|
419
|
+
let i;
|
|
420
|
+
if (r ? i = r(t, n) : i = a.isURLSearchParams(t) ? t.toString() : new ge(t, n).toString(s), i) {
|
|
421
|
+
const o = e.indexOf("#");
|
|
422
|
+
o !== -1 && (e = e.slice(0, o)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
|
|
423
|
+
}
|
|
424
|
+
return e;
|
|
425
|
+
}
|
|
426
|
+
class Ae {
|
|
427
|
+
constructor() {
|
|
428
|
+
this.handlers = [];
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Add a new interceptor to the stack
|
|
432
|
+
*
|
|
433
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
434
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
435
|
+
*
|
|
436
|
+
* @return {Number} An ID used to remove interceptor later
|
|
437
|
+
*/
|
|
438
|
+
use(t, n, s) {
|
|
439
|
+
return this.handlers.push({
|
|
440
|
+
fulfilled: t,
|
|
441
|
+
rejected: n,
|
|
442
|
+
synchronous: s ? s.synchronous : !1,
|
|
443
|
+
runWhen: s ? s.runWhen : null
|
|
444
|
+
}), this.handlers.length - 1;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Remove an interceptor from the stack
|
|
448
|
+
*
|
|
449
|
+
* @param {Number} id The ID that was returned by `use`
|
|
450
|
+
*
|
|
451
|
+
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
|
|
452
|
+
*/
|
|
453
|
+
eject(t) {
|
|
454
|
+
this.handlers[t] && (this.handlers[t] = null);
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Clear all interceptors from the stack
|
|
458
|
+
*
|
|
459
|
+
* @returns {void}
|
|
460
|
+
*/
|
|
461
|
+
clear() {
|
|
462
|
+
this.handlers && (this.handlers = []);
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Iterate over all the registered interceptors
|
|
466
|
+
*
|
|
467
|
+
* This method is particularly useful for skipping over any
|
|
468
|
+
* interceptors that may have become `null` calling `eject`.
|
|
469
|
+
*
|
|
470
|
+
* @param {Function} fn The function to call for each interceptor
|
|
471
|
+
*
|
|
472
|
+
* @returns {void}
|
|
473
|
+
*/
|
|
474
|
+
forEach(t) {
|
|
475
|
+
a.forEach(this.handlers, function(s) {
|
|
476
|
+
s !== null && t(s);
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
const Xe = {
|
|
481
|
+
silentJSONParsing: !0,
|
|
482
|
+
forcedJSONParsing: !0,
|
|
483
|
+
clarifyTimeoutError: !1
|
|
484
|
+
}, on = typeof URLSearchParams < "u" ? URLSearchParams : ge, an = typeof FormData < "u" ? FormData : null, cn = typeof Blob < "u" ? Blob : null, un = {
|
|
485
|
+
isBrowser: !0,
|
|
486
|
+
classes: {
|
|
487
|
+
URLSearchParams: on,
|
|
488
|
+
FormData: an,
|
|
489
|
+
Blob: cn
|
|
490
|
+
},
|
|
491
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
492
|
+
}, Se = typeof window < "u" && typeof document < "u", he = typeof navigator == "object" && navigator || void 0, ln = Se && (!he || ["ReactNative", "NativeScript", "NS"].indexOf(he.product) < 0), fn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
493
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", dn = Se && window.location.href || "http://localhost", hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
494
|
+
__proto__: null,
|
|
495
|
+
hasBrowserEnv: Se,
|
|
496
|
+
hasStandardBrowserEnv: ln,
|
|
497
|
+
hasStandardBrowserWebWorkerEnv: fn,
|
|
498
|
+
navigator: he,
|
|
499
|
+
origin: dn
|
|
500
|
+
}, Symbol.toStringTag, { value: "Module" })), A = {
|
|
501
|
+
...hn,
|
|
502
|
+
...un
|
|
503
|
+
};
|
|
504
|
+
function pn(e, t) {
|
|
505
|
+
return oe(e, new A.classes.URLSearchParams(), Object.assign({
|
|
506
|
+
visitor: function(n, s, r, i) {
|
|
507
|
+
return A.isNode && a.isBuffer(n) ? (this.append(s, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
508
|
+
}
|
|
509
|
+
}, t));
|
|
510
|
+
}
|
|
511
|
+
function mn(e) {
|
|
512
|
+
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
513
|
+
}
|
|
514
|
+
function En(e) {
|
|
515
|
+
const t = {}, n = Object.keys(e);
|
|
516
|
+
let s;
|
|
517
|
+
const r = n.length;
|
|
518
|
+
let i;
|
|
519
|
+
for (s = 0; s < r; s++)
|
|
520
|
+
i = n[s], t[i] = e[i];
|
|
521
|
+
return t;
|
|
522
|
+
}
|
|
523
|
+
function Ye(e) {
|
|
524
|
+
function t(n, s, r, i) {
|
|
525
|
+
let o = n[i++];
|
|
526
|
+
if (o === "__proto__") return !0;
|
|
527
|
+
const c = Number.isFinite(+o), f = i >= n.length;
|
|
528
|
+
return o = !o && a.isArray(r) ? r.length : o, f ? (a.hasOwnProp(r, o) ? r[o] = [r[o], s] : r[o] = s, !c) : ((!r[o] || !a.isObject(r[o])) && (r[o] = []), t(n, s, r[o], i) && a.isArray(r[o]) && (r[o] = En(r[o])), !c);
|
|
529
|
+
}
|
|
530
|
+
if (a.isFormData(e) && a.isFunction(e.entries)) {
|
|
531
|
+
const n = {};
|
|
532
|
+
return a.forEachEntry(e, (s, r) => {
|
|
533
|
+
t(mn(s), r, n, 0);
|
|
534
|
+
}), n;
|
|
535
|
+
}
|
|
536
|
+
return null;
|
|
537
|
+
}
|
|
538
|
+
function Rn(e, t, n) {
|
|
539
|
+
if (a.isString(e))
|
|
540
|
+
try {
|
|
541
|
+
return (t || JSON.parse)(e), a.trim(e);
|
|
542
|
+
} catch (s) {
|
|
543
|
+
if (s.name !== "SyntaxError")
|
|
544
|
+
throw s;
|
|
545
|
+
}
|
|
546
|
+
return (n || JSON.stringify)(e);
|
|
547
|
+
}
|
|
548
|
+
const J = {
|
|
549
|
+
transitional: Xe,
|
|
550
|
+
adapter: ["xhr", "http", "fetch"],
|
|
551
|
+
transformRequest: [function(t, n) {
|
|
552
|
+
const s = n.getContentType() || "", r = s.indexOf("application/json") > -1, i = a.isObject(t);
|
|
553
|
+
if (i && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
|
|
554
|
+
return r ? JSON.stringify(Ye(t)) : t;
|
|
555
|
+
if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t) || a.isReadableStream(t))
|
|
556
|
+
return t;
|
|
557
|
+
if (a.isArrayBufferView(t))
|
|
558
|
+
return t.buffer;
|
|
559
|
+
if (a.isURLSearchParams(t))
|
|
560
|
+
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
561
|
+
let c;
|
|
562
|
+
if (i) {
|
|
563
|
+
if (s.indexOf("application/x-www-form-urlencoded") > -1)
|
|
564
|
+
return pn(t, this.formSerializer).toString();
|
|
565
|
+
if ((c = a.isFileList(t)) || s.indexOf("multipart/form-data") > -1) {
|
|
566
|
+
const f = this.env && this.env.FormData;
|
|
567
|
+
return oe(
|
|
568
|
+
c ? { "files[]": t } : t,
|
|
569
|
+
f && new f(),
|
|
570
|
+
this.formSerializer
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
return i || r ? (n.setContentType("application/json", !1), Rn(t)) : t;
|
|
575
|
+
}],
|
|
576
|
+
transformResponse: [function(t) {
|
|
577
|
+
const n = this.transitional || J.transitional, s = n && n.forcedJSONParsing, r = this.responseType === "json";
|
|
578
|
+
if (a.isResponse(t) || a.isReadableStream(t))
|
|
579
|
+
return t;
|
|
580
|
+
if (t && a.isString(t) && (s && !this.responseType || r)) {
|
|
581
|
+
const o = !(n && n.silentJSONParsing) && r;
|
|
582
|
+
try {
|
|
583
|
+
return JSON.parse(t);
|
|
584
|
+
} catch (c) {
|
|
585
|
+
if (o)
|
|
586
|
+
throw c.name === "SyntaxError" ? m.from(c, m.ERR_BAD_RESPONSE, this, null, this.response) : c;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
return t;
|
|
590
|
+
}],
|
|
591
|
+
/**
|
|
592
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
593
|
+
* timeout is not created.
|
|
594
|
+
*/
|
|
595
|
+
timeout: 0,
|
|
596
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
597
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
598
|
+
maxContentLength: -1,
|
|
599
|
+
maxBodyLength: -1,
|
|
600
|
+
env: {
|
|
601
|
+
FormData: A.classes.FormData,
|
|
602
|
+
Blob: A.classes.Blob
|
|
603
|
+
},
|
|
604
|
+
validateStatus: function(t) {
|
|
605
|
+
return t >= 200 && t < 300;
|
|
606
|
+
},
|
|
607
|
+
headers: {
|
|
608
|
+
common: {
|
|
609
|
+
Accept: "application/json, text/plain, */*",
|
|
610
|
+
"Content-Type": void 0
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
};
|
|
614
|
+
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
615
|
+
J.headers[e] = {};
|
|
616
|
+
});
|
|
617
|
+
const gn = a.toObjectSet([
|
|
618
|
+
"age",
|
|
619
|
+
"authorization",
|
|
620
|
+
"content-length",
|
|
621
|
+
"content-type",
|
|
622
|
+
"etag",
|
|
623
|
+
"expires",
|
|
624
|
+
"from",
|
|
625
|
+
"host",
|
|
626
|
+
"if-modified-since",
|
|
627
|
+
"if-unmodified-since",
|
|
628
|
+
"last-modified",
|
|
629
|
+
"location",
|
|
630
|
+
"max-forwards",
|
|
631
|
+
"proxy-authorization",
|
|
632
|
+
"referer",
|
|
633
|
+
"retry-after",
|
|
634
|
+
"user-agent"
|
|
635
|
+
]), Sn = (e) => {
|
|
636
|
+
const t = {};
|
|
637
|
+
let n, s, r;
|
|
638
|
+
return e && e.split(`
|
|
639
|
+
`).forEach(function(o) {
|
|
640
|
+
r = o.indexOf(":"), n = o.substring(0, r).trim().toLowerCase(), s = o.substring(r + 1).trim(), !(!n || t[n] && gn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(s) : t[n] = [s] : t[n] = t[n] ? t[n] + ", " + s : s);
|
|
641
|
+
}), t;
|
|
642
|
+
}, _e = Symbol("internals");
|
|
643
|
+
function $(e) {
|
|
644
|
+
return e && String(e).trim().toLowerCase();
|
|
645
|
+
}
|
|
646
|
+
function Y(e) {
|
|
647
|
+
return e === !1 || e == null ? e : a.isArray(e) ? e.map(Y) : String(e);
|
|
648
|
+
}
|
|
649
|
+
function wn(e) {
|
|
650
|
+
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
651
|
+
let s;
|
|
652
|
+
for (; s = n.exec(e); )
|
|
653
|
+
t[s[1]] = s[2];
|
|
654
|
+
return t;
|
|
655
|
+
}
|
|
656
|
+
const yn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
657
|
+
function ce(e, t, n, s, r) {
|
|
658
|
+
if (a.isFunction(s))
|
|
659
|
+
return s.call(this, t, n);
|
|
660
|
+
if (r && (t = n), !!a.isString(t)) {
|
|
661
|
+
if (a.isString(s))
|
|
662
|
+
return t.indexOf(s) !== -1;
|
|
663
|
+
if (a.isRegExp(s))
|
|
664
|
+
return s.test(t);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
function Tn(e) {
|
|
668
|
+
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, s) => n.toUpperCase() + s);
|
|
669
|
+
}
|
|
670
|
+
function bn(e, t) {
|
|
671
|
+
const n = a.toCamelCase(" " + t);
|
|
672
|
+
["get", "set", "has"].forEach((s) => {
|
|
673
|
+
Object.defineProperty(e, s + n, {
|
|
674
|
+
value: function(r, i, o) {
|
|
675
|
+
return this[s].call(this, t, r, i, o);
|
|
676
|
+
},
|
|
677
|
+
configurable: !0
|
|
678
|
+
});
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
let k = class {
|
|
682
|
+
constructor(t) {
|
|
683
|
+
t && this.set(t);
|
|
684
|
+
}
|
|
685
|
+
set(t, n, s) {
|
|
686
|
+
const r = this;
|
|
687
|
+
function i(c, f, u) {
|
|
688
|
+
const l = $(f);
|
|
689
|
+
if (!l)
|
|
690
|
+
throw new Error("header name must be a non-empty string");
|
|
691
|
+
const d = a.findKey(r, l);
|
|
692
|
+
(!d || r[d] === void 0 || u === !0 || u === void 0 && r[d] !== !1) && (r[d || f] = Y(c));
|
|
693
|
+
}
|
|
694
|
+
const o = (c, f) => a.forEach(c, (u, l) => i(u, l, f));
|
|
695
|
+
if (a.isPlainObject(t) || t instanceof this.constructor)
|
|
696
|
+
o(t, n);
|
|
697
|
+
else if (a.isString(t) && (t = t.trim()) && !yn(t))
|
|
698
|
+
o(Sn(t), n);
|
|
699
|
+
else if (a.isObject(t) && a.isIterable(t)) {
|
|
700
|
+
let c = {}, f, u;
|
|
701
|
+
for (const l of t) {
|
|
702
|
+
if (!a.isArray(l))
|
|
703
|
+
throw TypeError("Object iterator must return a key-value pair");
|
|
704
|
+
c[u = l[0]] = (f = c[u]) ? a.isArray(f) ? [...f, l[1]] : [f, l[1]] : l[1];
|
|
705
|
+
}
|
|
706
|
+
o(c, n);
|
|
707
|
+
} else
|
|
708
|
+
t != null && i(n, t, s);
|
|
709
|
+
return this;
|
|
710
|
+
}
|
|
711
|
+
get(t, n) {
|
|
712
|
+
if (t = $(t), t) {
|
|
713
|
+
const s = a.findKey(this, t);
|
|
714
|
+
if (s) {
|
|
715
|
+
const r = this[s];
|
|
716
|
+
if (!n)
|
|
717
|
+
return r;
|
|
718
|
+
if (n === !0)
|
|
719
|
+
return wn(r);
|
|
720
|
+
if (a.isFunction(n))
|
|
721
|
+
return n.call(this, r, s);
|
|
722
|
+
if (a.isRegExp(n))
|
|
723
|
+
return n.exec(r);
|
|
724
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
has(t, n) {
|
|
729
|
+
if (t = $(t), t) {
|
|
730
|
+
const s = a.findKey(this, t);
|
|
731
|
+
return !!(s && this[s] !== void 0 && (!n || ce(this, this[s], s, n)));
|
|
732
|
+
}
|
|
733
|
+
return !1;
|
|
734
|
+
}
|
|
735
|
+
delete(t, n) {
|
|
736
|
+
const s = this;
|
|
737
|
+
let r = !1;
|
|
738
|
+
function i(o) {
|
|
739
|
+
if (o = $(o), o) {
|
|
740
|
+
const c = a.findKey(s, o);
|
|
741
|
+
c && (!n || ce(s, s[c], c, n)) && (delete s[c], r = !0);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
return a.isArray(t) ? t.forEach(i) : i(t), r;
|
|
745
|
+
}
|
|
746
|
+
clear(t) {
|
|
747
|
+
const n = Object.keys(this);
|
|
748
|
+
let s = n.length, r = !1;
|
|
749
|
+
for (; s--; ) {
|
|
750
|
+
const i = n[s];
|
|
751
|
+
(!t || ce(this, this[i], i, t, !0)) && (delete this[i], r = !0);
|
|
752
|
+
}
|
|
753
|
+
return r;
|
|
754
|
+
}
|
|
755
|
+
normalize(t) {
|
|
756
|
+
const n = this, s = {};
|
|
757
|
+
return a.forEach(this, (r, i) => {
|
|
758
|
+
const o = a.findKey(s, i);
|
|
759
|
+
if (o) {
|
|
760
|
+
n[o] = Y(r), delete n[i];
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
const c = t ? Tn(i) : String(i).trim();
|
|
764
|
+
c !== i && delete n[i], n[c] = Y(r), s[c] = !0;
|
|
765
|
+
}), this;
|
|
766
|
+
}
|
|
767
|
+
concat(...t) {
|
|
768
|
+
return this.constructor.concat(this, ...t);
|
|
769
|
+
}
|
|
770
|
+
toJSON(t) {
|
|
771
|
+
const n = /* @__PURE__ */ Object.create(null);
|
|
772
|
+
return a.forEach(this, (s, r) => {
|
|
773
|
+
s != null && s !== !1 && (n[r] = t && a.isArray(s) ? s.join(", ") : s);
|
|
774
|
+
}), n;
|
|
775
|
+
}
|
|
776
|
+
[Symbol.iterator]() {
|
|
777
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
778
|
+
}
|
|
779
|
+
toString() {
|
|
780
|
+
return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
|
|
781
|
+
`);
|
|
782
|
+
}
|
|
783
|
+
getSetCookie() {
|
|
784
|
+
return this.get("set-cookie") || [];
|
|
785
|
+
}
|
|
786
|
+
get [Symbol.toStringTag]() {
|
|
787
|
+
return "AxiosHeaders";
|
|
788
|
+
}
|
|
789
|
+
static from(t) {
|
|
790
|
+
return t instanceof this ? t : new this(t);
|
|
791
|
+
}
|
|
792
|
+
static concat(t, ...n) {
|
|
793
|
+
const s = new this(t);
|
|
794
|
+
return n.forEach((r) => s.set(r)), s;
|
|
795
|
+
}
|
|
796
|
+
static accessor(t) {
|
|
797
|
+
const s = (this[_e] = this[_e] = {
|
|
798
|
+
accessors: {}
|
|
799
|
+
}).accessors, r = this.prototype;
|
|
800
|
+
function i(o) {
|
|
801
|
+
const c = $(o);
|
|
802
|
+
s[c] || (bn(r, o), s[c] = !0);
|
|
803
|
+
}
|
|
804
|
+
return a.isArray(t) ? t.forEach(i) : i(t), this;
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
k.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
808
|
+
a.reduceDescriptors(k.prototype, ({ value: e }, t) => {
|
|
809
|
+
let n = t[0].toUpperCase() + t.slice(1);
|
|
810
|
+
return {
|
|
811
|
+
get: () => e,
|
|
812
|
+
set(s) {
|
|
813
|
+
this[n] = s;
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
});
|
|
817
|
+
a.freezeMethods(k);
|
|
818
|
+
function ue(e, t) {
|
|
819
|
+
const n = this || J, s = t || n, r = k.from(s.headers);
|
|
820
|
+
let i = s.data;
|
|
821
|
+
return a.forEach(e, function(c) {
|
|
822
|
+
i = c.call(n, i, r.normalize(), t ? t.status : void 0);
|
|
823
|
+
}), r.normalize(), i;
|
|
824
|
+
}
|
|
825
|
+
function Ze(e) {
|
|
826
|
+
return !!(e && e.__CANCEL__);
|
|
827
|
+
}
|
|
828
|
+
function K(e, t, n) {
|
|
829
|
+
m.call(this, e ?? "canceled", m.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
830
|
+
}
|
|
831
|
+
a.inherits(K, m, {
|
|
832
|
+
__CANCEL__: !0
|
|
833
|
+
});
|
|
834
|
+
function Qe(e, t, n) {
|
|
835
|
+
const s = n.config.validateStatus;
|
|
836
|
+
!n.status || !s || s(n.status) ? e(n) : t(new m(
|
|
837
|
+
"Request failed with status code " + n.status,
|
|
838
|
+
[m.ERR_BAD_REQUEST, m.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
|
|
839
|
+
n.config,
|
|
840
|
+
n.request,
|
|
841
|
+
n
|
|
842
|
+
));
|
|
843
|
+
}
|
|
844
|
+
function On(e) {
|
|
845
|
+
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
846
|
+
return t && t[1] || "";
|
|
847
|
+
}
|
|
848
|
+
function An(e, t) {
|
|
849
|
+
e = e || 10;
|
|
850
|
+
const n = new Array(e), s = new Array(e);
|
|
851
|
+
let r = 0, i = 0, o;
|
|
852
|
+
return t = t !== void 0 ? t : 1e3, function(f) {
|
|
853
|
+
const u = Date.now(), l = s[i];
|
|
854
|
+
o || (o = u), n[r] = f, s[r] = u;
|
|
855
|
+
let d = i, R = 0;
|
|
856
|
+
for (; d !== r; )
|
|
857
|
+
R += n[d++], d = d % e;
|
|
858
|
+
if (r = (r + 1) % e, r === i && (i = (i + 1) % e), u - o < t)
|
|
859
|
+
return;
|
|
860
|
+
const w = l && u - l;
|
|
861
|
+
return w ? Math.round(R * 1e3 / w) : void 0;
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
function _n(e, t) {
|
|
865
|
+
let n = 0, s = 1e3 / t, r, i;
|
|
866
|
+
const o = (u, l = Date.now()) => {
|
|
867
|
+
n = l, r = null, i && (clearTimeout(i), i = null), e.apply(null, u);
|
|
868
|
+
};
|
|
869
|
+
return [(...u) => {
|
|
870
|
+
const l = Date.now(), d = l - n;
|
|
871
|
+
d >= s ? o(u, l) : (r = u, i || (i = setTimeout(() => {
|
|
872
|
+
i = null, o(r);
|
|
873
|
+
}, s - d)));
|
|
874
|
+
}, () => r && o(r)];
|
|
875
|
+
}
|
|
876
|
+
const Q = (e, t, n = 3) => {
|
|
877
|
+
let s = 0;
|
|
878
|
+
const r = An(50, 250);
|
|
879
|
+
return _n((i) => {
|
|
880
|
+
const o = i.loaded, c = i.lengthComputable ? i.total : void 0, f = o - s, u = r(f), l = o <= c;
|
|
881
|
+
s = o;
|
|
882
|
+
const d = {
|
|
883
|
+
loaded: o,
|
|
884
|
+
total: c,
|
|
885
|
+
progress: c ? o / c : void 0,
|
|
886
|
+
bytes: f,
|
|
887
|
+
rate: u || void 0,
|
|
888
|
+
estimated: u && c && l ? (c - o) / u : void 0,
|
|
889
|
+
event: i,
|
|
890
|
+
lengthComputable: c != null,
|
|
891
|
+
[t ? "download" : "upload"]: !0
|
|
892
|
+
};
|
|
893
|
+
e(d);
|
|
894
|
+
}, n);
|
|
895
|
+
}, Ne = (e, t) => {
|
|
896
|
+
const n = e != null;
|
|
897
|
+
return [(s) => t[0]({
|
|
898
|
+
lengthComputable: n,
|
|
899
|
+
total: e,
|
|
900
|
+
loaded: s
|
|
901
|
+
}), t[1]];
|
|
902
|
+
}, Ce = (e) => (...t) => a.asap(() => e(...t)), Nn = A.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, A.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
903
|
+
new URL(A.origin),
|
|
904
|
+
A.navigator && /(msie|trident)/i.test(A.navigator.userAgent)
|
|
905
|
+
) : () => !0, Cn = A.hasStandardBrowserEnv ? (
|
|
906
|
+
// Standard browser envs support document.cookie
|
|
907
|
+
{
|
|
908
|
+
write(e, t, n, s, r, i) {
|
|
909
|
+
const o = [e + "=" + encodeURIComponent(t)];
|
|
910
|
+
a.isNumber(n) && o.push("expires=" + new Date(n).toGMTString()), a.isString(s) && o.push("path=" + s), a.isString(r) && o.push("domain=" + r), i === !0 && o.push("secure"), document.cookie = o.join("; ");
|
|
911
|
+
},
|
|
912
|
+
read(e) {
|
|
913
|
+
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
914
|
+
return t ? decodeURIComponent(t[3]) : null;
|
|
915
|
+
},
|
|
916
|
+
remove(e) {
|
|
917
|
+
this.write(e, "", Date.now() - 864e5);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
) : (
|
|
921
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
922
|
+
{
|
|
923
|
+
write() {
|
|
924
|
+
},
|
|
925
|
+
read() {
|
|
926
|
+
return null;
|
|
927
|
+
},
|
|
928
|
+
remove() {
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
);
|
|
932
|
+
function In(e) {
|
|
933
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
934
|
+
}
|
|
935
|
+
function kn(e, t) {
|
|
936
|
+
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
937
|
+
}
|
|
938
|
+
function et(e, t, n) {
|
|
939
|
+
let s = !In(t);
|
|
940
|
+
return e && (s || n == !1) ? kn(e, t) : t;
|
|
941
|
+
}
|
|
942
|
+
const Ie = (e) => e instanceof k ? { ...e } : e;
|
|
943
|
+
function j(e, t) {
|
|
944
|
+
t = t || {};
|
|
945
|
+
const n = {};
|
|
946
|
+
function s(u, l, d, R) {
|
|
947
|
+
return a.isPlainObject(u) && a.isPlainObject(l) ? a.merge.call({ caseless: R }, u, l) : a.isPlainObject(l) ? a.merge({}, l) : a.isArray(l) ? l.slice() : l;
|
|
948
|
+
}
|
|
949
|
+
function r(u, l, d, R) {
|
|
950
|
+
if (a.isUndefined(l)) {
|
|
951
|
+
if (!a.isUndefined(u))
|
|
952
|
+
return s(void 0, u, d, R);
|
|
953
|
+
} else return s(u, l, d, R);
|
|
954
|
+
}
|
|
955
|
+
function i(u, l) {
|
|
956
|
+
if (!a.isUndefined(l))
|
|
957
|
+
return s(void 0, l);
|
|
958
|
+
}
|
|
959
|
+
function o(u, l) {
|
|
960
|
+
if (a.isUndefined(l)) {
|
|
961
|
+
if (!a.isUndefined(u))
|
|
962
|
+
return s(void 0, u);
|
|
963
|
+
} else return s(void 0, l);
|
|
964
|
+
}
|
|
965
|
+
function c(u, l, d) {
|
|
966
|
+
if (d in t)
|
|
967
|
+
return s(u, l);
|
|
968
|
+
if (d in e)
|
|
969
|
+
return s(void 0, u);
|
|
970
|
+
}
|
|
971
|
+
const f = {
|
|
972
|
+
url: i,
|
|
973
|
+
method: i,
|
|
974
|
+
data: i,
|
|
975
|
+
baseURL: o,
|
|
976
|
+
transformRequest: o,
|
|
977
|
+
transformResponse: o,
|
|
978
|
+
paramsSerializer: o,
|
|
979
|
+
timeout: o,
|
|
980
|
+
timeoutMessage: o,
|
|
981
|
+
withCredentials: o,
|
|
982
|
+
withXSRFToken: o,
|
|
983
|
+
adapter: o,
|
|
984
|
+
responseType: o,
|
|
985
|
+
xsrfCookieName: o,
|
|
986
|
+
xsrfHeaderName: o,
|
|
987
|
+
onUploadProgress: o,
|
|
988
|
+
onDownloadProgress: o,
|
|
989
|
+
decompress: o,
|
|
990
|
+
maxContentLength: o,
|
|
991
|
+
maxBodyLength: o,
|
|
992
|
+
beforeRedirect: o,
|
|
993
|
+
transport: o,
|
|
994
|
+
httpAgent: o,
|
|
995
|
+
httpsAgent: o,
|
|
996
|
+
cancelToken: o,
|
|
997
|
+
socketPath: o,
|
|
998
|
+
responseEncoding: o,
|
|
999
|
+
validateStatus: c,
|
|
1000
|
+
headers: (u, l, d) => r(Ie(u), Ie(l), d, !0)
|
|
1001
|
+
};
|
|
1002
|
+
return a.forEach(Object.keys(Object.assign({}, e, t)), function(l) {
|
|
1003
|
+
const d = f[l] || r, R = d(e[l], t[l], l);
|
|
1004
|
+
a.isUndefined(R) && d !== c || (n[l] = R);
|
|
1005
|
+
}), n;
|
|
1006
|
+
}
|
|
1007
|
+
const tt = (e) => {
|
|
1008
|
+
const t = j({}, e);
|
|
1009
|
+
let { data: n, withXSRFToken: s, xsrfHeaderName: r, xsrfCookieName: i, headers: o, auth: c } = t;
|
|
1010
|
+
t.headers = o = k.from(o), t.url = We(et(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), c && o.set(
|
|
1011
|
+
"Authorization",
|
|
1012
|
+
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1013
|
+
);
|
|
1014
|
+
let f;
|
|
1015
|
+
if (a.isFormData(n)) {
|
|
1016
|
+
if (A.hasStandardBrowserEnv || A.hasStandardBrowserWebWorkerEnv)
|
|
1017
|
+
o.setContentType(void 0);
|
|
1018
|
+
else if ((f = o.getContentType()) !== !1) {
|
|
1019
|
+
const [u, ...l] = f ? f.split(";").map((d) => d.trim()).filter(Boolean) : [];
|
|
1020
|
+
o.setContentType([u || "multipart/form-data", ...l].join("; "));
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
if (A.hasStandardBrowserEnv && (s && a.isFunction(s) && (s = s(t)), s || s !== !1 && Nn(t.url))) {
|
|
1024
|
+
const u = r && i && Cn.read(i);
|
|
1025
|
+
u && o.set(r, u);
|
|
1026
|
+
}
|
|
1027
|
+
return t;
|
|
1028
|
+
}, Un = typeof XMLHttpRequest < "u", xn = Un && function(e) {
|
|
1029
|
+
return new Promise(function(n, s) {
|
|
1030
|
+
const r = tt(e);
|
|
1031
|
+
let i = r.data;
|
|
1032
|
+
const o = k.from(r.headers).normalize();
|
|
1033
|
+
let { responseType: c, onUploadProgress: f, onDownloadProgress: u } = r, l, d, R, w, h;
|
|
1034
|
+
function E() {
|
|
1035
|
+
w && w(), h && h(), r.cancelToken && r.cancelToken.unsubscribe(l), r.signal && r.signal.removeEventListener("abort", l);
|
|
1036
|
+
}
|
|
1037
|
+
let p = new XMLHttpRequest();
|
|
1038
|
+
p.open(r.method.toUpperCase(), r.url, !0), p.timeout = r.timeout;
|
|
1039
|
+
function S() {
|
|
1040
|
+
if (!p)
|
|
1041
|
+
return;
|
|
1042
|
+
const b = k.from(
|
|
1043
|
+
"getAllResponseHeaders" in p && p.getAllResponseHeaders()
|
|
1044
|
+
), N = {
|
|
1045
|
+
data: !c || c === "text" || c === "json" ? p.responseText : p.response,
|
|
1046
|
+
status: p.status,
|
|
1047
|
+
statusText: p.statusText,
|
|
1048
|
+
headers: b,
|
|
1049
|
+
config: e,
|
|
1050
|
+
request: p
|
|
1051
|
+
};
|
|
1052
|
+
Qe(function(B) {
|
|
1053
|
+
n(B), E();
|
|
1054
|
+
}, function(B) {
|
|
1055
|
+
s(B), E();
|
|
1056
|
+
}, N), p = null;
|
|
1057
|
+
}
|
|
1058
|
+
"onloadend" in p ? p.onloadend = S : p.onreadystatechange = function() {
|
|
1059
|
+
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(S);
|
|
1060
|
+
}, p.onabort = function() {
|
|
1061
|
+
p && (s(new m("Request aborted", m.ECONNABORTED, e, p)), p = null);
|
|
1062
|
+
}, p.onerror = function() {
|
|
1063
|
+
s(new m("Network Error", m.ERR_NETWORK, e, p)), p = null;
|
|
1064
|
+
}, p.ontimeout = function() {
|
|
1065
|
+
let P = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
|
|
1066
|
+
const N = r.transitional || Xe;
|
|
1067
|
+
r.timeoutErrorMessage && (P = r.timeoutErrorMessage), s(new m(
|
|
1068
|
+
P,
|
|
1069
|
+
N.clarifyTimeoutError ? m.ETIMEDOUT : m.ECONNABORTED,
|
|
1070
|
+
e,
|
|
1071
|
+
p
|
|
1072
|
+
)), p = null;
|
|
1073
|
+
}, i === void 0 && o.setContentType(null), "setRequestHeader" in p && a.forEach(o.toJSON(), function(P, N) {
|
|
1074
|
+
p.setRequestHeader(N, P);
|
|
1075
|
+
}), a.isUndefined(r.withCredentials) || (p.withCredentials = !!r.withCredentials), c && c !== "json" && (p.responseType = r.responseType), u && ([R, h] = Q(u, !0), p.addEventListener("progress", R)), f && p.upload && ([d, w] = Q(f), p.upload.addEventListener("progress", d), p.upload.addEventListener("loadend", w)), (r.cancelToken || r.signal) && (l = (b) => {
|
|
1076
|
+
p && (s(!b || b.type ? new K(null, e, p) : b), p.abort(), p = null);
|
|
1077
|
+
}, r.cancelToken && r.cancelToken.subscribe(l), r.signal && (r.signal.aborted ? l() : r.signal.addEventListener("abort", l)));
|
|
1078
|
+
const y = On(r.url);
|
|
1079
|
+
if (y && A.protocols.indexOf(y) === -1) {
|
|
1080
|
+
s(new m("Unsupported protocol " + y + ":", m.ERR_BAD_REQUEST, e));
|
|
1081
|
+
return;
|
|
1082
|
+
}
|
|
1083
|
+
p.send(i || null);
|
|
1084
|
+
});
|
|
1085
|
+
}, Ln = (e, t) => {
|
|
1086
|
+
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
1087
|
+
if (t || n) {
|
|
1088
|
+
let s = new AbortController(), r;
|
|
1089
|
+
const i = function(u) {
|
|
1090
|
+
if (!r) {
|
|
1091
|
+
r = !0, c();
|
|
1092
|
+
const l = u instanceof Error ? u : this.reason;
|
|
1093
|
+
s.abort(l instanceof m ? l : new K(l instanceof Error ? l.message : l));
|
|
1094
|
+
}
|
|
1095
|
+
};
|
|
1096
|
+
let o = t && setTimeout(() => {
|
|
1097
|
+
o = null, i(new m(`timeout ${t} of ms exceeded`, m.ETIMEDOUT));
|
|
1098
|
+
}, t);
|
|
1099
|
+
const c = () => {
|
|
1100
|
+
e && (o && clearTimeout(o), o = null, e.forEach((u) => {
|
|
1101
|
+
u.unsubscribe ? u.unsubscribe(i) : u.removeEventListener("abort", i);
|
|
1102
|
+
}), e = null);
|
|
1103
|
+
};
|
|
1104
|
+
e.forEach((u) => u.addEventListener("abort", i));
|
|
1105
|
+
const { signal: f } = s;
|
|
1106
|
+
return f.unsubscribe = () => a.asap(c), f;
|
|
1107
|
+
}
|
|
1108
|
+
}, Pn = function* (e, t) {
|
|
1109
|
+
let n = e.byteLength;
|
|
1110
|
+
if (n < t) {
|
|
1111
|
+
yield e;
|
|
1112
|
+
return;
|
|
1113
|
+
}
|
|
1114
|
+
let s = 0, r;
|
|
1115
|
+
for (; s < n; )
|
|
1116
|
+
r = s + t, yield e.slice(s, r), s = r;
|
|
1117
|
+
}, Fn = async function* (e, t) {
|
|
1118
|
+
for await (const n of Dn(e))
|
|
1119
|
+
yield* Pn(n, t);
|
|
1120
|
+
}, Dn = async function* (e) {
|
|
1121
|
+
if (e[Symbol.asyncIterator]) {
|
|
1122
|
+
yield* e;
|
|
1123
|
+
return;
|
|
1124
|
+
}
|
|
1125
|
+
const t = e.getReader();
|
|
1126
|
+
try {
|
|
1127
|
+
for (; ; ) {
|
|
1128
|
+
const { done: n, value: s } = await t.read();
|
|
1129
|
+
if (n)
|
|
1130
|
+
break;
|
|
1131
|
+
yield s;
|
|
1132
|
+
}
|
|
1133
|
+
} finally {
|
|
1134
|
+
await t.cancel();
|
|
1135
|
+
}
|
|
1136
|
+
}, ke = (e, t, n, s) => {
|
|
1137
|
+
const r = Fn(e, t);
|
|
1138
|
+
let i = 0, o, c = (f) => {
|
|
1139
|
+
o || (o = !0, s && s(f));
|
|
1140
|
+
};
|
|
1141
|
+
return new ReadableStream({
|
|
1142
|
+
async pull(f) {
|
|
1143
|
+
try {
|
|
1144
|
+
const { done: u, value: l } = await r.next();
|
|
1145
|
+
if (u) {
|
|
1146
|
+
c(), f.close();
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
let d = l.byteLength;
|
|
1150
|
+
if (n) {
|
|
1151
|
+
let R = i += d;
|
|
1152
|
+
n(R);
|
|
1153
|
+
}
|
|
1154
|
+
f.enqueue(new Uint8Array(l));
|
|
1155
|
+
} catch (u) {
|
|
1156
|
+
throw c(u), u;
|
|
1157
|
+
}
|
|
1158
|
+
},
|
|
1159
|
+
cancel(f) {
|
|
1160
|
+
return c(f), r.return();
|
|
1161
|
+
}
|
|
1162
|
+
}, {
|
|
1163
|
+
highWaterMark: 2
|
|
1164
|
+
});
|
|
1165
|
+
}, ie = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", nt = ie && typeof ReadableStream == "function", Bn = ie && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), st = (e, ...t) => {
|
|
1166
|
+
try {
|
|
1167
|
+
return !!e(...t);
|
|
1168
|
+
} catch {
|
|
1169
|
+
return !1;
|
|
1170
|
+
}
|
|
1171
|
+
}, qn = nt && st(() => {
|
|
1172
|
+
let e = !1;
|
|
1173
|
+
const t = new Request(A.origin, {
|
|
1174
|
+
body: new ReadableStream(),
|
|
1175
|
+
method: "POST",
|
|
1176
|
+
get duplex() {
|
|
1177
|
+
return e = !0, "half";
|
|
1178
|
+
}
|
|
1179
|
+
}).headers.has("Content-Type");
|
|
1180
|
+
return e && !t;
|
|
1181
|
+
}), Ue = 64 * 1024, pe = nt && st(() => a.isReadableStream(new Response("").body)), ee = {
|
|
1182
|
+
stream: pe && ((e) => e.body)
|
|
1183
|
+
};
|
|
1184
|
+
ie && ((e) => {
|
|
1185
|
+
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
|
|
1186
|
+
!ee[t] && (ee[t] = a.isFunction(e[t]) ? (n) => n[t]() : (n, s) => {
|
|
1187
|
+
throw new m(`Response type '${t}' is not supported`, m.ERR_NOT_SUPPORT, s);
|
|
1188
|
+
});
|
|
1189
|
+
});
|
|
1190
|
+
})(new Response());
|
|
1191
|
+
const Hn = async (e) => {
|
|
1192
|
+
if (e == null)
|
|
1193
|
+
return 0;
|
|
1194
|
+
if (a.isBlob(e))
|
|
1195
|
+
return e.size;
|
|
1196
|
+
if (a.isSpecCompliantForm(e))
|
|
1197
|
+
return (await new Request(A.origin, {
|
|
1198
|
+
method: "POST",
|
|
1199
|
+
body: e
|
|
1200
|
+
}).arrayBuffer()).byteLength;
|
|
1201
|
+
if (a.isArrayBufferView(e) || a.isArrayBuffer(e))
|
|
1202
|
+
return e.byteLength;
|
|
1203
|
+
if (a.isURLSearchParams(e) && (e = e + ""), a.isString(e))
|
|
1204
|
+
return (await Bn(e)).byteLength;
|
|
1205
|
+
}, Mn = async (e, t) => {
|
|
1206
|
+
const n = a.toFiniteNumber(e.getContentLength());
|
|
1207
|
+
return n ?? Hn(t);
|
|
1208
|
+
}, jn = ie && (async (e) => {
|
|
1209
|
+
let {
|
|
1210
|
+
url: t,
|
|
1211
|
+
method: n,
|
|
1212
|
+
data: s,
|
|
1213
|
+
signal: r,
|
|
1214
|
+
cancelToken: i,
|
|
1215
|
+
timeout: o,
|
|
1216
|
+
onDownloadProgress: c,
|
|
1217
|
+
onUploadProgress: f,
|
|
1218
|
+
responseType: u,
|
|
1219
|
+
headers: l,
|
|
1220
|
+
withCredentials: d = "same-origin",
|
|
1221
|
+
fetchOptions: R
|
|
1222
|
+
} = tt(e);
|
|
1223
|
+
u = u ? (u + "").toLowerCase() : "text";
|
|
1224
|
+
let w = Ln([r, i && i.toAbortSignal()], o), h;
|
|
1225
|
+
const E = w && w.unsubscribe && (() => {
|
|
1226
|
+
w.unsubscribe();
|
|
1227
|
+
});
|
|
1228
|
+
let p;
|
|
1229
|
+
try {
|
|
1230
|
+
if (f && qn && n !== "get" && n !== "head" && (p = await Mn(l, s)) !== 0) {
|
|
1231
|
+
let N = new Request(t, {
|
|
1232
|
+
method: "POST",
|
|
1233
|
+
body: s,
|
|
1234
|
+
duplex: "half"
|
|
1235
|
+
}), D;
|
|
1236
|
+
if (a.isFormData(s) && (D = N.headers.get("content-type")) && l.setContentType(D), N.body) {
|
|
1237
|
+
const [B, W] = Ne(
|
|
1238
|
+
p,
|
|
1239
|
+
Q(Ce(f))
|
|
1240
|
+
);
|
|
1241
|
+
s = ke(N.body, Ue, B, W);
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
a.isString(d) || (d = d ? "include" : "omit");
|
|
1245
|
+
const S = "credentials" in Request.prototype;
|
|
1246
|
+
h = new Request(t, {
|
|
1247
|
+
...R,
|
|
1248
|
+
signal: w,
|
|
1249
|
+
method: n.toUpperCase(),
|
|
1250
|
+
headers: l.normalize().toJSON(),
|
|
1251
|
+
body: s,
|
|
1252
|
+
duplex: "half",
|
|
1253
|
+
credentials: S ? d : void 0
|
|
1254
|
+
});
|
|
1255
|
+
let y = await fetch(h);
|
|
1256
|
+
const b = pe && (u === "stream" || u === "response");
|
|
1257
|
+
if (pe && (c || b && E)) {
|
|
1258
|
+
const N = {};
|
|
1259
|
+
["status", "statusText", "headers"].forEach((we) => {
|
|
1260
|
+
N[we] = y[we];
|
|
1261
|
+
});
|
|
1262
|
+
const D = a.toFiniteNumber(y.headers.get("content-length")), [B, W] = c && Ne(
|
|
1263
|
+
D,
|
|
1264
|
+
Q(Ce(c), !0)
|
|
1265
|
+
) || [];
|
|
1266
|
+
y = new Response(
|
|
1267
|
+
ke(y.body, Ue, B, () => {
|
|
1268
|
+
W && W(), E && E();
|
|
1269
|
+
}),
|
|
1270
|
+
N
|
|
1271
|
+
);
|
|
1272
|
+
}
|
|
1273
|
+
u = u || "text";
|
|
1274
|
+
let P = await ee[a.findKey(ee, u) || "text"](y, e);
|
|
1275
|
+
return !b && E && E(), await new Promise((N, D) => {
|
|
1276
|
+
Qe(N, D, {
|
|
1277
|
+
data: P,
|
|
1278
|
+
headers: k.from(y.headers),
|
|
1279
|
+
status: y.status,
|
|
1280
|
+
statusText: y.statusText,
|
|
1281
|
+
config: e,
|
|
1282
|
+
request: h
|
|
1283
|
+
});
|
|
1284
|
+
});
|
|
1285
|
+
} catch (S) {
|
|
1286
|
+
throw E && E(), S && S.name === "TypeError" && /Load failed|fetch/i.test(S.message) ? Object.assign(
|
|
1287
|
+
new m("Network Error", m.ERR_NETWORK, e, h),
|
|
1288
|
+
{
|
|
1289
|
+
cause: S.cause || S
|
|
1290
|
+
}
|
|
1291
|
+
) : m.from(S, S && S.code, e, h);
|
|
1292
|
+
}
|
|
1293
|
+
}), me = {
|
|
1294
|
+
http: tn,
|
|
1295
|
+
xhr: xn,
|
|
1296
|
+
fetch: jn
|
|
1297
|
+
};
|
|
1298
|
+
a.forEach(me, (e, t) => {
|
|
1299
|
+
if (e) {
|
|
1300
|
+
try {
|
|
1301
|
+
Object.defineProperty(e, "name", { value: t });
|
|
1302
|
+
} catch {
|
|
1303
|
+
}
|
|
1304
|
+
Object.defineProperty(e, "adapterName", { value: t });
|
|
1305
|
+
}
|
|
1306
|
+
});
|
|
1307
|
+
const xe = (e) => `- ${e}`, Gn = (e) => a.isFunction(e) || e === null || e === !1, rt = {
|
|
1308
|
+
getAdapter: (e) => {
|
|
1309
|
+
e = a.isArray(e) ? e : [e];
|
|
1310
|
+
const { length: t } = e;
|
|
1311
|
+
let n, s;
|
|
1312
|
+
const r = {};
|
|
1313
|
+
for (let i = 0; i < t; i++) {
|
|
1314
|
+
n = e[i];
|
|
1315
|
+
let o;
|
|
1316
|
+
if (s = n, !Gn(n) && (s = me[(o = String(n)).toLowerCase()], s === void 0))
|
|
1317
|
+
throw new m(`Unknown adapter '${o}'`);
|
|
1318
|
+
if (s)
|
|
1319
|
+
break;
|
|
1320
|
+
r[o || "#" + i] = s;
|
|
1321
|
+
}
|
|
1322
|
+
if (!s) {
|
|
1323
|
+
const i = Object.entries(r).map(
|
|
1324
|
+
([c, f]) => `adapter ${c} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1325
|
+
);
|
|
1326
|
+
let o = t ? i.length > 1 ? `since :
|
|
1327
|
+
` + i.map(xe).join(`
|
|
1328
|
+
`) : " " + xe(i[0]) : "as no adapter specified";
|
|
1329
|
+
throw new m(
|
|
1330
|
+
"There is no suitable adapter to dispatch the request " + o,
|
|
1331
|
+
"ERR_NOT_SUPPORT"
|
|
1332
|
+
);
|
|
1333
|
+
}
|
|
1334
|
+
return s;
|
|
1335
|
+
},
|
|
1336
|
+
adapters: me
|
|
1337
|
+
};
|
|
1338
|
+
function le(e) {
|
|
1339
|
+
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1340
|
+
throw new K(null, e);
|
|
1341
|
+
}
|
|
1342
|
+
function Le(e) {
|
|
1343
|
+
return le(e), e.headers = k.from(e.headers), e.data = ue.call(
|
|
1344
|
+
e,
|
|
1345
|
+
e.transformRequest
|
|
1346
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), rt.getAdapter(e.adapter || J.adapter)(e).then(function(s) {
|
|
1347
|
+
return le(e), s.data = ue.call(
|
|
1348
|
+
e,
|
|
1349
|
+
e.transformResponse,
|
|
1350
|
+
s
|
|
1351
|
+
), s.headers = k.from(s.headers), s;
|
|
1352
|
+
}, function(s) {
|
|
1353
|
+
return Ze(s) || (le(e), s && s.response && (s.response.data = ue.call(
|
|
1354
|
+
e,
|
|
1355
|
+
e.transformResponse,
|
|
1356
|
+
s.response
|
|
1357
|
+
), s.response.headers = k.from(s.response.headers))), Promise.reject(s);
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1360
|
+
const ot = "1.9.0", ae = {};
|
|
1361
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1362
|
+
ae[e] = function(s) {
|
|
1363
|
+
return typeof s === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1364
|
+
};
|
|
1365
|
+
});
|
|
1366
|
+
const Pe = {};
|
|
1367
|
+
ae.transitional = function(t, n, s) {
|
|
1368
|
+
function r(i, o) {
|
|
1369
|
+
return "[Axios v" + ot + "] Transitional option '" + i + "'" + o + (s ? ". " + s : "");
|
|
1370
|
+
}
|
|
1371
|
+
return (i, o, c) => {
|
|
1372
|
+
if (t === !1)
|
|
1373
|
+
throw new m(
|
|
1374
|
+
r(o, " has been removed" + (n ? " in " + n : "")),
|
|
1375
|
+
m.ERR_DEPRECATED
|
|
1376
|
+
);
|
|
1377
|
+
return n && !Pe[o] && (Pe[o] = !0, console.warn(
|
|
1378
|
+
r(
|
|
1379
|
+
o,
|
|
1380
|
+
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
1381
|
+
)
|
|
1382
|
+
)), t ? t(i, o, c) : !0;
|
|
1383
|
+
};
|
|
1384
|
+
};
|
|
1385
|
+
ae.spelling = function(t) {
|
|
1386
|
+
return (n, s) => (console.warn(`${s} is likely a misspelling of ${t}`), !0);
|
|
1387
|
+
};
|
|
1388
|
+
function zn(e, t, n) {
|
|
1389
|
+
if (typeof e != "object")
|
|
1390
|
+
throw new m("options must be an object", m.ERR_BAD_OPTION_VALUE);
|
|
1391
|
+
const s = Object.keys(e);
|
|
1392
|
+
let r = s.length;
|
|
1393
|
+
for (; r-- > 0; ) {
|
|
1394
|
+
const i = s[r], o = t[i];
|
|
1395
|
+
if (o) {
|
|
1396
|
+
const c = e[i], f = c === void 0 || o(c, i, e);
|
|
1397
|
+
if (f !== !0)
|
|
1398
|
+
throw new m("option " + i + " must be " + f, m.ERR_BAD_OPTION_VALUE);
|
|
1399
|
+
continue;
|
|
1400
|
+
}
|
|
1401
|
+
if (n !== !0)
|
|
1402
|
+
throw new m("Unknown option " + i, m.ERR_BAD_OPTION);
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
const Z = {
|
|
1406
|
+
assertOptions: zn,
|
|
1407
|
+
validators: ae
|
|
1408
|
+
}, L = Z.validators;
|
|
1409
|
+
let M = class {
|
|
1410
|
+
constructor(t) {
|
|
1411
|
+
this.defaults = t || {}, this.interceptors = {
|
|
1412
|
+
request: new Ae(),
|
|
1413
|
+
response: new Ae()
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
/**
|
|
1417
|
+
* Dispatch a request
|
|
1418
|
+
*
|
|
1419
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
1420
|
+
* @param {?Object} config
|
|
1421
|
+
*
|
|
1422
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
1423
|
+
*/
|
|
1424
|
+
async request(t, n) {
|
|
1425
|
+
try {
|
|
1426
|
+
return await this._request(t, n);
|
|
1427
|
+
} catch (s) {
|
|
1428
|
+
if (s instanceof Error) {
|
|
1429
|
+
let r = {};
|
|
1430
|
+
Error.captureStackTrace ? Error.captureStackTrace(r) : r = new Error();
|
|
1431
|
+
const i = r.stack ? r.stack.replace(/^.+\n/, "") : "";
|
|
1432
|
+
try {
|
|
1433
|
+
s.stack ? i && !String(s.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (s.stack += `
|
|
1434
|
+
` + i) : s.stack = i;
|
|
1435
|
+
} catch {
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
throw s;
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
_request(t, n) {
|
|
1442
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = j(this.defaults, n);
|
|
1443
|
+
const { transitional: s, paramsSerializer: r, headers: i } = n;
|
|
1444
|
+
s !== void 0 && Z.assertOptions(s, {
|
|
1445
|
+
silentJSONParsing: L.transitional(L.boolean),
|
|
1446
|
+
forcedJSONParsing: L.transitional(L.boolean),
|
|
1447
|
+
clarifyTimeoutError: L.transitional(L.boolean)
|
|
1448
|
+
}, !1), r != null && (a.isFunction(r) ? n.paramsSerializer = {
|
|
1449
|
+
serialize: r
|
|
1450
|
+
} : Z.assertOptions(r, {
|
|
1451
|
+
encode: L.function,
|
|
1452
|
+
serialize: L.function
|
|
1453
|
+
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), Z.assertOptions(n, {
|
|
1454
|
+
baseUrl: L.spelling("baseURL"),
|
|
1455
|
+
withXsrfToken: L.spelling("withXSRFToken")
|
|
1456
|
+
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1457
|
+
let o = i && a.merge(
|
|
1458
|
+
i.common,
|
|
1459
|
+
i[n.method]
|
|
1460
|
+
);
|
|
1461
|
+
i && a.forEach(
|
|
1462
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1463
|
+
(h) => {
|
|
1464
|
+
delete i[h];
|
|
1465
|
+
}
|
|
1466
|
+
), n.headers = k.concat(o, i);
|
|
1467
|
+
const c = [];
|
|
1468
|
+
let f = !0;
|
|
1469
|
+
this.interceptors.request.forEach(function(E) {
|
|
1470
|
+
typeof E.runWhen == "function" && E.runWhen(n) === !1 || (f = f && E.synchronous, c.unshift(E.fulfilled, E.rejected));
|
|
1471
|
+
});
|
|
1472
|
+
const u = [];
|
|
1473
|
+
this.interceptors.response.forEach(function(E) {
|
|
1474
|
+
u.push(E.fulfilled, E.rejected);
|
|
1475
|
+
});
|
|
1476
|
+
let l, d = 0, R;
|
|
1477
|
+
if (!f) {
|
|
1478
|
+
const h = [Le.bind(this), void 0];
|
|
1479
|
+
for (h.unshift.apply(h, c), h.push.apply(h, u), R = h.length, l = Promise.resolve(n); d < R; )
|
|
1480
|
+
l = l.then(h[d++], h[d++]);
|
|
1481
|
+
return l;
|
|
1482
|
+
}
|
|
1483
|
+
R = c.length;
|
|
1484
|
+
let w = n;
|
|
1485
|
+
for (d = 0; d < R; ) {
|
|
1486
|
+
const h = c[d++], E = c[d++];
|
|
1487
|
+
try {
|
|
1488
|
+
w = h(w);
|
|
1489
|
+
} catch (p) {
|
|
1490
|
+
E.call(this, p);
|
|
1491
|
+
break;
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
try {
|
|
1495
|
+
l = Le.call(this, w);
|
|
1496
|
+
} catch (h) {
|
|
1497
|
+
return Promise.reject(h);
|
|
1498
|
+
}
|
|
1499
|
+
for (d = 0, R = u.length; d < R; )
|
|
1500
|
+
l = l.then(u[d++], u[d++]);
|
|
1501
|
+
return l;
|
|
1502
|
+
}
|
|
1503
|
+
getUri(t) {
|
|
1504
|
+
t = j(this.defaults, t);
|
|
1505
|
+
const n = et(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
1506
|
+
return We(n, t.params, t.paramsSerializer);
|
|
1507
|
+
}
|
|
1508
|
+
};
|
|
1509
|
+
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1510
|
+
M.prototype[t] = function(n, s) {
|
|
1511
|
+
return this.request(j(s || {}, {
|
|
1512
|
+
method: t,
|
|
1513
|
+
url: n,
|
|
1514
|
+
data: (s || {}).data
|
|
1515
|
+
}));
|
|
1516
|
+
};
|
|
1517
|
+
});
|
|
1518
|
+
a.forEach(["post", "put", "patch"], function(t) {
|
|
1519
|
+
function n(s) {
|
|
1520
|
+
return function(i, o, c) {
|
|
1521
|
+
return this.request(j(c || {}, {
|
|
1522
|
+
method: t,
|
|
1523
|
+
headers: s ? {
|
|
1524
|
+
"Content-Type": "multipart/form-data"
|
|
1525
|
+
} : {},
|
|
1526
|
+
url: i,
|
|
1527
|
+
data: o
|
|
1528
|
+
}));
|
|
1529
|
+
};
|
|
1530
|
+
}
|
|
1531
|
+
M.prototype[t] = n(), M.prototype[t + "Form"] = n(!0);
|
|
1532
|
+
});
|
|
1533
|
+
let Kn = class it {
|
|
1534
|
+
constructor(t) {
|
|
1535
|
+
if (typeof t != "function")
|
|
1536
|
+
throw new TypeError("executor must be a function.");
|
|
1537
|
+
let n;
|
|
1538
|
+
this.promise = new Promise(function(i) {
|
|
1539
|
+
n = i;
|
|
1540
|
+
});
|
|
1541
|
+
const s = this;
|
|
1542
|
+
this.promise.then((r) => {
|
|
1543
|
+
if (!s._listeners) return;
|
|
1544
|
+
let i = s._listeners.length;
|
|
1545
|
+
for (; i-- > 0; )
|
|
1546
|
+
s._listeners[i](r);
|
|
1547
|
+
s._listeners = null;
|
|
1548
|
+
}), this.promise.then = (r) => {
|
|
1549
|
+
let i;
|
|
1550
|
+
const o = new Promise((c) => {
|
|
1551
|
+
s.subscribe(c), i = c;
|
|
1552
|
+
}).then(r);
|
|
1553
|
+
return o.cancel = function() {
|
|
1554
|
+
s.unsubscribe(i);
|
|
1555
|
+
}, o;
|
|
1556
|
+
}, t(function(i, o, c) {
|
|
1557
|
+
s.reason || (s.reason = new K(i, o, c), n(s.reason));
|
|
1558
|
+
});
|
|
1559
|
+
}
|
|
1560
|
+
/**
|
|
1561
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
1562
|
+
*/
|
|
1563
|
+
throwIfRequested() {
|
|
1564
|
+
if (this.reason)
|
|
1565
|
+
throw this.reason;
|
|
1566
|
+
}
|
|
1567
|
+
/**
|
|
1568
|
+
* Subscribe to the cancel signal
|
|
1569
|
+
*/
|
|
1570
|
+
subscribe(t) {
|
|
1571
|
+
if (this.reason) {
|
|
1572
|
+
t(this.reason);
|
|
1573
|
+
return;
|
|
1574
|
+
}
|
|
1575
|
+
this._listeners ? this._listeners.push(t) : this._listeners = [t];
|
|
1576
|
+
}
|
|
1577
|
+
/**
|
|
1578
|
+
* Unsubscribe from the cancel signal
|
|
1579
|
+
*/
|
|
1580
|
+
unsubscribe(t) {
|
|
1581
|
+
if (!this._listeners)
|
|
1582
|
+
return;
|
|
1583
|
+
const n = this._listeners.indexOf(t);
|
|
1584
|
+
n !== -1 && this._listeners.splice(n, 1);
|
|
1585
|
+
}
|
|
1586
|
+
toAbortSignal() {
|
|
1587
|
+
const t = new AbortController(), n = (s) => {
|
|
1588
|
+
t.abort(s);
|
|
1589
|
+
};
|
|
1590
|
+
return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
|
|
1591
|
+
}
|
|
1592
|
+
/**
|
|
1593
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
1594
|
+
* cancels the `CancelToken`.
|
|
1595
|
+
*/
|
|
1596
|
+
static source() {
|
|
1597
|
+
let t;
|
|
1598
|
+
return {
|
|
1599
|
+
token: new it(function(r) {
|
|
1600
|
+
t = r;
|
|
1601
|
+
}),
|
|
1602
|
+
cancel: t
|
|
1603
|
+
};
|
|
1604
|
+
}
|
|
1605
|
+
};
|
|
1606
|
+
function $n(e) {
|
|
1607
|
+
return function(n) {
|
|
1608
|
+
return e.apply(null, n);
|
|
1609
|
+
};
|
|
1610
|
+
}
|
|
1611
|
+
function vn(e) {
|
|
1612
|
+
return a.isObject(e) && e.isAxiosError === !0;
|
|
1613
|
+
}
|
|
1614
|
+
const Ee = {
|
|
1615
|
+
Continue: 100,
|
|
1616
|
+
SwitchingProtocols: 101,
|
|
1617
|
+
Processing: 102,
|
|
1618
|
+
EarlyHints: 103,
|
|
1619
|
+
Ok: 200,
|
|
1620
|
+
Created: 201,
|
|
1621
|
+
Accepted: 202,
|
|
1622
|
+
NonAuthoritativeInformation: 203,
|
|
1623
|
+
NoContent: 204,
|
|
1624
|
+
ResetContent: 205,
|
|
1625
|
+
PartialContent: 206,
|
|
1626
|
+
MultiStatus: 207,
|
|
1627
|
+
AlreadyReported: 208,
|
|
1628
|
+
ImUsed: 226,
|
|
1629
|
+
MultipleChoices: 300,
|
|
1630
|
+
MovedPermanently: 301,
|
|
1631
|
+
Found: 302,
|
|
1632
|
+
SeeOther: 303,
|
|
1633
|
+
NotModified: 304,
|
|
1634
|
+
UseProxy: 305,
|
|
1635
|
+
Unused: 306,
|
|
1636
|
+
TemporaryRedirect: 307,
|
|
1637
|
+
PermanentRedirect: 308,
|
|
1638
|
+
BadRequest: 400,
|
|
1639
|
+
Unauthorized: 401,
|
|
1640
|
+
PaymentRequired: 402,
|
|
1641
|
+
Forbidden: 403,
|
|
1642
|
+
NotFound: 404,
|
|
1643
|
+
MethodNotAllowed: 405,
|
|
1644
|
+
NotAcceptable: 406,
|
|
1645
|
+
ProxyAuthenticationRequired: 407,
|
|
1646
|
+
RequestTimeout: 408,
|
|
1647
|
+
Conflict: 409,
|
|
1648
|
+
Gone: 410,
|
|
1649
|
+
LengthRequired: 411,
|
|
1650
|
+
PreconditionFailed: 412,
|
|
1651
|
+
PayloadTooLarge: 413,
|
|
1652
|
+
UriTooLong: 414,
|
|
1653
|
+
UnsupportedMediaType: 415,
|
|
1654
|
+
RangeNotSatisfiable: 416,
|
|
1655
|
+
ExpectationFailed: 417,
|
|
1656
|
+
ImATeapot: 418,
|
|
1657
|
+
MisdirectedRequest: 421,
|
|
1658
|
+
UnprocessableEntity: 422,
|
|
1659
|
+
Locked: 423,
|
|
1660
|
+
FailedDependency: 424,
|
|
1661
|
+
TooEarly: 425,
|
|
1662
|
+
UpgradeRequired: 426,
|
|
1663
|
+
PreconditionRequired: 428,
|
|
1664
|
+
TooManyRequests: 429,
|
|
1665
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
1666
|
+
UnavailableForLegalReasons: 451,
|
|
1667
|
+
InternalServerError: 500,
|
|
1668
|
+
NotImplemented: 501,
|
|
1669
|
+
BadGateway: 502,
|
|
1670
|
+
ServiceUnavailable: 503,
|
|
1671
|
+
GatewayTimeout: 504,
|
|
1672
|
+
HttpVersionNotSupported: 505,
|
|
1673
|
+
VariantAlsoNegotiates: 506,
|
|
1674
|
+
InsufficientStorage: 507,
|
|
1675
|
+
LoopDetected: 508,
|
|
1676
|
+
NotExtended: 510,
|
|
1677
|
+
NetworkAuthenticationRequired: 511
|
|
1678
|
+
};
|
|
1679
|
+
Object.entries(Ee).forEach(([e, t]) => {
|
|
1680
|
+
Ee[t] = e;
|
|
1681
|
+
});
|
|
1682
|
+
function at(e) {
|
|
1683
|
+
const t = new M(e), n = Be(M.prototype.request, t);
|
|
1684
|
+
return a.extend(n, M.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(r) {
|
|
1685
|
+
return at(j(e, r));
|
|
1686
|
+
}, n;
|
|
1687
|
+
}
|
|
1688
|
+
const g = at(J);
|
|
1689
|
+
g.Axios = M;
|
|
1690
|
+
g.CanceledError = K;
|
|
1691
|
+
g.CancelToken = Kn;
|
|
1692
|
+
g.isCancel = Ze;
|
|
1693
|
+
g.VERSION = ot;
|
|
1694
|
+
g.toFormData = oe;
|
|
1695
|
+
g.AxiosError = m;
|
|
1696
|
+
g.Cancel = g.CanceledError;
|
|
1697
|
+
g.all = function(t) {
|
|
1698
|
+
return Promise.all(t);
|
|
1699
|
+
};
|
|
1700
|
+
g.spread = $n;
|
|
1701
|
+
g.isAxiosError = vn;
|
|
1702
|
+
g.mergeConfig = j;
|
|
1703
|
+
g.AxiosHeaders = k;
|
|
1704
|
+
g.formToJSON = (e) => Ye(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1705
|
+
g.getAdapter = rt.getAdapter;
|
|
1706
|
+
g.HttpStatusCode = Ee;
|
|
1707
|
+
g.default = g;
|
|
1708
|
+
const {
|
|
1709
|
+
Axios: Es,
|
|
1710
|
+
AxiosError: Vn,
|
|
1711
|
+
CanceledError: Rs,
|
|
1712
|
+
isCancel: gs,
|
|
1713
|
+
CancelToken: Ss,
|
|
1714
|
+
VERSION: ws,
|
|
1715
|
+
all: ys,
|
|
1716
|
+
Cancel: Ts,
|
|
1717
|
+
isAxiosError: bs,
|
|
1718
|
+
spread: Os,
|
|
1719
|
+
toFormData: As,
|
|
1720
|
+
AxiosHeaders: _s,
|
|
1721
|
+
HttpStatusCode: F,
|
|
1722
|
+
formToJSON: Ns,
|
|
1723
|
+
getAdapter: Cs,
|
|
1724
|
+
mergeConfig: Is
|
|
1725
|
+
} = g, Jn = (e) => (e.baseURL = De(), e.headers.Authorization = localStorage.getItem(C.TOKEN), e.headers["client-id"] = localStorage.getItem(C.CLIENT_ID), e.metadata = { startTime: /* @__PURE__ */ new Date() }, { ...e }), Wn = (e) => (e.baseURL = ft(), e.headers.Authorization = localStorage.getItem(C.TOKEN), e.headers["client-id"] = localStorage.getItem(C.CLIENT_ID), e.headers["Api-Version"] = "1.0", e.metadata = { startTime: /* @__PURE__ */ new Date() }, { ...e }), ks = (e, t, n) => {
|
|
1726
|
+
for (const s of e)
|
|
1727
|
+
t ? s.rej(t) : s.res(n);
|
|
1728
|
+
}, Xn = async (e) => new Promise((t, n) => {
|
|
1729
|
+
setTimeout(t, e);
|
|
1730
|
+
}), Yn = async (e, t) => (await Xn(t), e()), Fe = (e, t) => {
|
|
1731
|
+
var r, i;
|
|
1732
|
+
let n = "", s = t;
|
|
1733
|
+
typeof t == "string" ? n = t : t instanceof Vn ? (n = t.message, s = {
|
|
1734
|
+
message: t.message,
|
|
1735
|
+
cause: t.cause,
|
|
1736
|
+
status: t.status,
|
|
1737
|
+
data: (r = t == null ? void 0 : t.response) == null ? void 0 : r.data
|
|
1738
|
+
}) : n = t.message, (i = window.parent) == null || i.postMessage(
|
|
1739
|
+
{ type: "auth_error", details: { message: n, action: e, info: s } },
|
|
1740
|
+
"*"
|
|
1741
|
+
);
|
|
1742
|
+
}, Zn = async (e, t, n) => {
|
|
1743
|
+
var o, c, f;
|
|
1744
|
+
const s = e.config, r = localStorage.getItem(C.REFRESH_TOKEN), i = ((o = e.response) == null ? void 0 : o.status) || F.InternalServerError;
|
|
1745
|
+
if (!s || s.__retries === t)
|
|
1746
|
+
throw e;
|
|
1747
|
+
if (i === F.Unauthorized && s.url !== T.REFRESH_EMBED_TOKEN && s.url !== T.REFRESH_TOKEN && s.url !== T.SIGN_IN && s.url !== T.SIGN_UP && s.url !== T.OTP) {
|
|
1748
|
+
if (!r)
|
|
1749
|
+
throw Fe(
|
|
1750
|
+
"refresh_token",
|
|
1751
|
+
"no refresh token found to reauthenticate user"
|
|
1752
|
+
), e;
|
|
1753
|
+
try {
|
|
1754
|
+
const { token: u, data: l } = await ss.refreshAccessToken();
|
|
1755
|
+
return (c = s.url) != null && c.includes(T.EXCHANGE_TOKEN) && l && "id_token" in l && (s.data = JSON.stringify({ idToken: l.id_token })), s.headers && (s.headers.Authorization = `Bearer ${u}`), n(s);
|
|
1756
|
+
} catch (u) {
|
|
1757
|
+
if (!((f = s == null ? void 0 : s.url) != null && f.includes(T.EXCHANGE_TOKEN))) {
|
|
1758
|
+
const l = u instanceof Error ? u.message : "Unable to refresh access token.";
|
|
1759
|
+
Fe("refresh_token", l);
|
|
1760
|
+
}
|
|
1761
|
+
throw e;
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
if ([
|
|
1765
|
+
F.BadRequest,
|
|
1766
|
+
F.Unauthorized,
|
|
1767
|
+
F.Forbidden,
|
|
1768
|
+
F.InternalServerError,
|
|
1769
|
+
F.Conflict,
|
|
1770
|
+
F.NotFound,
|
|
1771
|
+
F.UnprocessableEntity
|
|
1772
|
+
].includes(i) || (s.__retries || (s.__retries = 0), s.__retries += 1, s.__retries > t))
|
|
1773
|
+
throw e;
|
|
1774
|
+
return Yn(
|
|
1775
|
+
() => n(s),
|
|
1776
|
+
Math.pow(10, s.__retries + 1) / 2
|
|
1777
|
+
// Exponential backoff 50ms, 500ms, 5000ms
|
|
1778
|
+
);
|
|
1779
|
+
}, Qn = g.create();
|
|
1780
|
+
Qn.interceptors.request.use((e) => (e.baseURL = De(), e.headers.Authorization = localStorage.getItem(C.TOKEN), e.metadata = { startTime: /* @__PURE__ */ new Date() }, { ...e }));
|
|
1781
|
+
const _ = g.create();
|
|
1782
|
+
_.interceptors.request.use((e) => (e = Jn(e), e));
|
|
1783
|
+
const es = g.create();
|
|
1784
|
+
es.interceptors.request.use((e) => (e = Wn(e), e));
|
|
1785
|
+
const ts = 3;
|
|
1786
|
+
_.interceptors.response.use(
|
|
1787
|
+
null,
|
|
1788
|
+
(e) => Zn(e, ts, _)
|
|
1789
|
+
);
|
|
1790
|
+
class ns {
|
|
1791
|
+
constructor() {
|
|
1792
|
+
O(this, "isRefreshingAccessToken", !1);
|
|
1793
|
+
O(this, "refreshAccessTokenQueue", []);
|
|
1794
|
+
O(this, "processRefreshAccessTokenQueue", (t, n) => {
|
|
1795
|
+
for (const s of this.refreshAccessTokenQueue)
|
|
1796
|
+
t || !n ? s.reject(t || new Error("Unable to refresh access token.")) : s.resolve(n);
|
|
1797
|
+
this.refreshAccessTokenQueue = [];
|
|
1798
|
+
});
|
|
1799
|
+
/**
|
|
1800
|
+
* Logs in a user with the provided email and password.
|
|
1801
|
+
*
|
|
1802
|
+
* @param params - The sign-in parameters containing email and password.
|
|
1803
|
+
* @returns A promise that resolves to a service response containing authentication data.
|
|
1804
|
+
*/
|
|
1805
|
+
O(this, "login", async (t) => {
|
|
1806
|
+
var n, s, r, i;
|
|
1807
|
+
try {
|
|
1808
|
+
const { data: o } = await _.post(T.SIGN_IN, {
|
|
1809
|
+
email_address: t.email,
|
|
1810
|
+
password: t.password
|
|
1811
|
+
}), c = await G.ensureQueryData({
|
|
1812
|
+
queryKey: [q.USER_REGIONS],
|
|
1813
|
+
queryFn: this.getRegions
|
|
1814
|
+
}), f = U(o.data), u = (n = o.data) == null ? void 0 : n.accessToken;
|
|
1815
|
+
return localStorage.setItem(C.TOKEN, u), {
|
|
1816
|
+
success: !0,
|
|
1817
|
+
data: U({
|
|
1818
|
+
...o.data,
|
|
1819
|
+
token: u,
|
|
1820
|
+
user: {
|
|
1821
|
+
...f.user,
|
|
1822
|
+
userRegion: c.find(
|
|
1823
|
+
(l) => l.code === o.data.user.user_region
|
|
1824
|
+
)
|
|
1825
|
+
}
|
|
1826
|
+
})
|
|
1827
|
+
};
|
|
1828
|
+
} catch (o) {
|
|
1829
|
+
return console.error(o), {
|
|
1830
|
+
success: !1,
|
|
1831
|
+
message: ((r = (s = o.response) == null ? void 0 : s.data) == null ? void 0 : r.message) || ((i = o == null ? void 0 : o.response) == null ? void 0 : i.data) || o.message || "error signing in"
|
|
1832
|
+
};
|
|
1833
|
+
}
|
|
1834
|
+
});
|
|
1835
|
+
/**
|
|
1836
|
+
* Registers a new user with the provided email, password, and region.
|
|
1837
|
+
*
|
|
1838
|
+
* @param params - The sign-up parameters containing email, password, and region.
|
|
1839
|
+
* @returns A promise that resolves to a service response containing authentication data.
|
|
1840
|
+
*/
|
|
1841
|
+
O(this, "signUp", async (t) => {
|
|
1842
|
+
var n, s, r, i, o;
|
|
1843
|
+
try {
|
|
1844
|
+
const { data: c } = await _.post(T.SIGN_UP, {
|
|
1845
|
+
user: {
|
|
1846
|
+
email_address: t.email,
|
|
1847
|
+
password: t.password,
|
|
1848
|
+
user_region: t.region
|
|
1849
|
+
},
|
|
1850
|
+
success_url: t.successUrl,
|
|
1851
|
+
cancel_url: t.cancelUrl,
|
|
1852
|
+
price_id: t.priceId
|
|
1853
|
+
}), f = await G.ensureQueryData({
|
|
1854
|
+
queryKey: [q.USER_REGIONS],
|
|
1855
|
+
queryFn: this.getRegions
|
|
1856
|
+
}), u = U(c.data), l = (n = c.data) == null ? void 0 : n.tokens.accessToken;
|
|
1857
|
+
return localStorage.setItem(C.TOKEN, l), {
|
|
1858
|
+
success: !0,
|
|
1859
|
+
data: {
|
|
1860
|
+
token: l,
|
|
1861
|
+
...(s = c.data) == null ? void 0 : s.tokens,
|
|
1862
|
+
user: {
|
|
1863
|
+
...u.user,
|
|
1864
|
+
userRegion: f.find(
|
|
1865
|
+
(d) => d.code === c.data.user.user_region
|
|
1866
|
+
)
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
};
|
|
1870
|
+
} catch (c) {
|
|
1871
|
+
return console.error(c), {
|
|
1872
|
+
success: !1,
|
|
1873
|
+
message: ((i = (r = c.response) == null ? void 0 : r.data) == null ? void 0 : i.message) || ((o = c.response) == null ? void 0 : o.data) || c.message || "error signing up"
|
|
1874
|
+
};
|
|
1875
|
+
}
|
|
1876
|
+
});
|
|
1877
|
+
O(this, "getOrCreateGoogleUser", async (t, n) => {
|
|
1878
|
+
var s, r, i, o, c;
|
|
1879
|
+
try {
|
|
1880
|
+
const { data: f } = await _.post(T.GOOGLE_AUTH, {
|
|
1881
|
+
google_access_token: t,
|
|
1882
|
+
user_region: n
|
|
1883
|
+
}), u = await G.ensureQueryData({
|
|
1884
|
+
queryKey: [q.USER_REGIONS],
|
|
1885
|
+
queryFn: this.getRegions
|
|
1886
|
+
}), l = U(f.data), d = (s = f.data) == null ? void 0 : s.tokens.accessToken;
|
|
1887
|
+
return localStorage.setItem(C.TOKEN, d), {
|
|
1888
|
+
success: !0,
|
|
1889
|
+
data: {
|
|
1890
|
+
token: d,
|
|
1891
|
+
...(r = f.data) == null ? void 0 : r.tokens,
|
|
1892
|
+
user: {
|
|
1893
|
+
...l.user,
|
|
1894
|
+
userRegion: u.find(
|
|
1895
|
+
(R) => R.code === f.data.user.user_region
|
|
1896
|
+
)
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
};
|
|
1900
|
+
} catch (f) {
|
|
1901
|
+
return console.error(f), {
|
|
1902
|
+
success: !1,
|
|
1903
|
+
message: ((o = (i = f.response) == null ? void 0 : i.data) == null ? void 0 : o.message) || ((c = f == null ? void 0 : f.response) == null ? void 0 : c.data) || f.message || "error getting or creating google user"
|
|
1904
|
+
};
|
|
1905
|
+
}
|
|
1906
|
+
});
|
|
1907
|
+
O(this, "resendVerificationEmail", async (t) => {
|
|
1908
|
+
var n, s, r;
|
|
1909
|
+
try {
|
|
1910
|
+
return (await _.post(
|
|
1911
|
+
T.RESEND_VERIFICATION_EMAIL,
|
|
1912
|
+
{
|
|
1913
|
+
email_address: t.email,
|
|
1914
|
+
success_url: t.successUrl,
|
|
1915
|
+
cancel_url: t.cancelUrl
|
|
1916
|
+
}
|
|
1917
|
+
)).data;
|
|
1918
|
+
} catch (i) {
|
|
1919
|
+
return console.error(i), {
|
|
1920
|
+
success: !1,
|
|
1921
|
+
message: ((s = (n = i.response) == null ? void 0 : n.data) == null ? void 0 : s.message) || ((r = i.response) == null ? void 0 : r.data) || i.message || "error resending verification email"
|
|
1922
|
+
};
|
|
1923
|
+
}
|
|
1924
|
+
});
|
|
1925
|
+
/**
|
|
1926
|
+
* Authenticates a user using an ID token.
|
|
1927
|
+
*
|
|
1928
|
+
* @param idToken - The ID token to authenticate with.
|
|
1929
|
+
* @param refreshToken - The refresh token for user
|
|
1930
|
+
* @returns A promise that resolves to a service response containing authentication data.
|
|
1931
|
+
*/
|
|
1932
|
+
O(this, "authenticateWithToken", async (t, n, s) => {
|
|
1933
|
+
var r, i, o;
|
|
1934
|
+
try {
|
|
1935
|
+
const { data: c } = await _.post(
|
|
1936
|
+
T.EXCHANGE_TOKEN,
|
|
1937
|
+
ht({
|
|
1938
|
+
idToken: t,
|
|
1939
|
+
refreshToken: n,
|
|
1940
|
+
exchangeTokenEndPoint: s
|
|
1941
|
+
})
|
|
1942
|
+
), f = await G.ensureQueryData({
|
|
1943
|
+
queryKey: [q.USER_REGIONS],
|
|
1944
|
+
queryFn: this.getRegions
|
|
1945
|
+
}), u = U(c.data);
|
|
1946
|
+
return {
|
|
1947
|
+
success: !0,
|
|
1948
|
+
data: {
|
|
1949
|
+
...u,
|
|
1950
|
+
user: {
|
|
1951
|
+
...u.user,
|
|
1952
|
+
userRegion: f.find(
|
|
1953
|
+
(l) => l.code === c.data.user.user_region
|
|
1954
|
+
)
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
};
|
|
1958
|
+
} catch (c) {
|
|
1959
|
+
return console.error(c), {
|
|
1960
|
+
success: !1,
|
|
1961
|
+
message: ((i = (r = c.response) == null ? void 0 : r.data) == null ? void 0 : i.message) || ((o = c == null ? void 0 : c.response) == null ? void 0 : o.data) || c.message || "error exchanging token"
|
|
1962
|
+
};
|
|
1963
|
+
}
|
|
1964
|
+
});
|
|
1965
|
+
/**
|
|
1966
|
+
* If token is available in local storage, check if it is valid and return user details
|
|
1967
|
+
*
|
|
1968
|
+
* @returns A promise that resolves to a service response containing the user details.
|
|
1969
|
+
*/
|
|
1970
|
+
O(this, "checkUser", async () => {
|
|
1971
|
+
try {
|
|
1972
|
+
const { data: t } = await _.get(T.ME), n = await G.ensureQueryData({
|
|
1973
|
+
queryKey: [q.USER_REGIONS],
|
|
1974
|
+
queryFn: this.getRegions
|
|
1975
|
+
}), s = {
|
|
1976
|
+
...t.data,
|
|
1977
|
+
userRegion: n.find(
|
|
1978
|
+
(r) => r.code === t.data.user_region
|
|
1979
|
+
)
|
|
1980
|
+
};
|
|
1981
|
+
return {
|
|
1982
|
+
success: !0,
|
|
1983
|
+
data: U(s)
|
|
1984
|
+
};
|
|
1985
|
+
} catch (t) {
|
|
1986
|
+
console.error(t);
|
|
1987
|
+
const { response: n } = t;
|
|
1988
|
+
return {
|
|
1989
|
+
success: !1,
|
|
1990
|
+
message: (n == null ? void 0 : n.data.message) || "error retrieving user details"
|
|
1991
|
+
};
|
|
1992
|
+
}
|
|
1993
|
+
});
|
|
1994
|
+
/**
|
|
1995
|
+
* @description Shared queued access-token refresh for all auth consumers.
|
|
1996
|
+
* This is the single place that coordinates concurrent refresh attempts so
|
|
1997
|
+
* Axios requests and non-Axios consumers, like FlightStream SSE, do not run
|
|
1998
|
+
* parallel refresh-token exchanges or race localStorage token writes.
|
|
1999
|
+
*/
|
|
2000
|
+
O(this, "refreshAccessToken", async () => {
|
|
2001
|
+
if (this.isRefreshingAccessToken)
|
|
2002
|
+
return new Promise((t, n) => {
|
|
2003
|
+
this.refreshAccessTokenQueue.push({ resolve: t, reject: n });
|
|
2004
|
+
});
|
|
2005
|
+
this.isRefreshingAccessToken = !0;
|
|
2006
|
+
try {
|
|
2007
|
+
const t = localStorage.getItem(C.REFRESH_TOKEN);
|
|
2008
|
+
if (!t)
|
|
2009
|
+
throw new Error("No refresh token found to reauthenticate user.");
|
|
2010
|
+
const s = localStorage.getItem(C.AUTH_FLOW) === lt.POST_MESSAGE ? this.refreshEmbedToken : this.refreshToken, { data: r, success: i, message: o } = await s(t);
|
|
2011
|
+
if (!i || !r)
|
|
2012
|
+
throw new Error(o || "Unable to refresh access token.");
|
|
2013
|
+
const c = r.token || r.accessToken;
|
|
2014
|
+
if (!c)
|
|
2015
|
+
throw new Error("Refresh response did not include an access token.");
|
|
2016
|
+
localStorage.setItem(C.TOKEN, c);
|
|
2017
|
+
const f = { token: c, data: r };
|
|
2018
|
+
return this.processRefreshAccessTokenQueue(null, f), f;
|
|
2019
|
+
} catch (t) {
|
|
2020
|
+
const n = t instanceof Error ? t : new Error("Unable to refresh access token.");
|
|
2021
|
+
throw this.processRefreshAccessTokenQueue(n), n;
|
|
2022
|
+
} finally {
|
|
2023
|
+
this.isRefreshingAccessToken = !1;
|
|
2024
|
+
}
|
|
2025
|
+
});
|
|
2026
|
+
/**
|
|
2027
|
+
* @description In the case of a 401 error, the refresh token is used to get a new access token and user details, by exchanging the
|
|
2028
|
+
* refresh token for a new id_token and in turn exchanging that for a new awayz token
|
|
2029
|
+
*
|
|
2030
|
+
* @param refreshToken - The refresh token
|
|
2031
|
+
*/
|
|
2032
|
+
O(this, "refreshEmbedToken", async (t) => {
|
|
2033
|
+
try {
|
|
2034
|
+
const { data: n } = await _.post(
|
|
2035
|
+
T.REFRESH_EMBED_TOKEN,
|
|
2036
|
+
{
|
|
2037
|
+
refreshToken: t
|
|
2038
|
+
}
|
|
2039
|
+
), s = n.data.token;
|
|
2040
|
+
return localStorage.setItem(C.TOKEN, s), {
|
|
2041
|
+
success: !0,
|
|
2042
|
+
data: n.data
|
|
2043
|
+
};
|
|
2044
|
+
} catch (n) {
|
|
2045
|
+
const { response: s } = n;
|
|
2046
|
+
return localStorage.removeItem("refreshToken"), localStorage.removeItem("token"), {
|
|
2047
|
+
success: !1,
|
|
2048
|
+
message: (s == null ? void 0 : s.data.message) || "error refreshing embed token"
|
|
2049
|
+
};
|
|
2050
|
+
}
|
|
2051
|
+
});
|
|
2052
|
+
/**
|
|
2053
|
+
* @description In the case of a 401 error, the refresh token is used to get a new access token and user details
|
|
2054
|
+
*
|
|
2055
|
+
* @param refreshToken - The refresh token
|
|
2056
|
+
*/
|
|
2057
|
+
O(this, "refreshToken", async (t) => {
|
|
2058
|
+
try {
|
|
2059
|
+
const { data: n } = await _.post(
|
|
2060
|
+
T.REFRESH_TOKEN,
|
|
2061
|
+
{
|
|
2062
|
+
refreshToken: t
|
|
2063
|
+
}
|
|
2064
|
+
), s = n.data.accessToken;
|
|
2065
|
+
return localStorage.setItem(C.TOKEN, s), {
|
|
2066
|
+
success: !0,
|
|
2067
|
+
data: {
|
|
2068
|
+
...n.data,
|
|
2069
|
+
token: s
|
|
2070
|
+
}
|
|
2071
|
+
};
|
|
2072
|
+
} catch (n) {
|
|
2073
|
+
const { response: s } = n;
|
|
2074
|
+
return localStorage.removeItem("refreshToken"), localStorage.removeItem("token"), {
|
|
2075
|
+
success: !1,
|
|
2076
|
+
message: (s == null ? void 0 : s.data.message) || "error refreshing access token"
|
|
2077
|
+
};
|
|
2078
|
+
}
|
|
2079
|
+
});
|
|
2080
|
+
/**
|
|
2081
|
+
* Retrieves the request limit for the authenticated user.
|
|
2082
|
+
*
|
|
2083
|
+
* @returns A promise that resolves to a service response containing the request limit data.
|
|
2084
|
+
*/
|
|
2085
|
+
O(this, "getRequestLimit", async () => (await _.get(T.REQUEST_LIMIT)).data);
|
|
2086
|
+
/**
|
|
2087
|
+
* Retrieves the regions available for user registration.
|
|
2088
|
+
*
|
|
2089
|
+
* @returns A promise that resolves to a service response containing the available regions.
|
|
2090
|
+
*/
|
|
2091
|
+
O(this, "getRegions", async () => {
|
|
2092
|
+
var n;
|
|
2093
|
+
const t = await _.get(T.REGIONS);
|
|
2094
|
+
return U((n = t.data) == null ? void 0 : n.data);
|
|
2095
|
+
});
|
|
2096
|
+
O(this, "getClientDetails", async () => {
|
|
2097
|
+
const { data: t } = await _.get(T.CLIENT);
|
|
2098
|
+
return U(t.data);
|
|
2099
|
+
});
|
|
2100
|
+
O(this, "validate2FA", async (t, n) => {
|
|
2101
|
+
var s, r, i;
|
|
2102
|
+
try {
|
|
2103
|
+
const { data: o } = await _.post(T.OTP, {
|
|
2104
|
+
email_address: t,
|
|
2105
|
+
otp: n
|
|
2106
|
+
}), c = await G.ensureQueryData({
|
|
2107
|
+
queryKey: [q.USER_REGIONS],
|
|
2108
|
+
queryFn: this.getRegions
|
|
2109
|
+
});
|
|
2110
|
+
return { success: !0, data: U({
|
|
2111
|
+
...o.data,
|
|
2112
|
+
user: {
|
|
2113
|
+
...o.data.user,
|
|
2114
|
+
userRegion: c.find(
|
|
2115
|
+
(u) => u.code === o.data.user.user_region
|
|
2116
|
+
)
|
|
2117
|
+
}
|
|
2118
|
+
}) };
|
|
2119
|
+
} catch (o) {
|
|
2120
|
+
return console.error(o), {
|
|
2121
|
+
success: !1,
|
|
2122
|
+
message: ((r = (s = o.response) == null ? void 0 : s.data) == null ? void 0 : r.message) || ((i = o == null ? void 0 : o.response) == null ? void 0 : i.data) || o.message || "error signing in"
|
|
2123
|
+
};
|
|
2124
|
+
}
|
|
2125
|
+
});
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
const ss = new ns();
|
|
2129
|
+
export {
|
|
2130
|
+
ss as A,
|
|
2131
|
+
q as E,
|
|
2132
|
+
U as a,
|
|
2133
|
+
mt as b,
|
|
2134
|
+
_ as c,
|
|
2135
|
+
g as d,
|
|
2136
|
+
Jn as e,
|
|
2137
|
+
Vn as f,
|
|
2138
|
+
es as g,
|
|
2139
|
+
Zn as h,
|
|
2140
|
+
Qn as i,
|
|
2141
|
+
ye as j,
|
|
2142
|
+
Wn as k,
|
|
2143
|
+
Xn as l,
|
|
2144
|
+
Yn as m,
|
|
2145
|
+
Fe as n,
|
|
2146
|
+
ks as p,
|
|
2147
|
+
ht as r,
|
|
2148
|
+
pt as t
|
|
2149
|
+
};
|