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