@1money/protocol-ts-sdk 2.0.1 → 2.0.2
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/.claude/projects/-Users-bobbytalvin-Desktop-Github-1money-protocol-ts-sdk/memory/MEMORY.md +1 -0
- package/.claude/projects/-Users-bobbytalvin-Desktop-Github-1money-protocol-ts-sdk/memory/feedback_security_dismissed.md +21 -0
- package/.claude/settings.local.json +7 -1
- package/es/api/index.js +1 -2
- package/es/client/index.js +1 -2
- package/es/index.js +2 -4
- package/es/utils/index.js +1 -2
- package/lib/api/index.js +12 -13
- package/lib/client/index.js +12 -13
- package/lib/index.js +13 -15
- package/lib/utils/index.js +1 -2
- package/package.json +1 -1
- package/umd/1money-protocol-ts-sdk.min.js +3 -3
package/.claude/projects/-Users-bobbytalvin-Desktop-Github-1money-protocol-ts-sdk/memory/MEMORY.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
- [feedback_security_dismissed.md](feedback_security_dismissed.md) - Security issues intentionally kept as-is: loose equality in client predicates, withCredentials default
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dismissed-security-findings
|
|
3
|
+
description: Security issues intentionally kept as-is in the SDK client — do not re-flag in future reviews
|
|
4
|
+
type: feedback
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Loose equality (`==`) in default client predicates is intentional
|
|
8
|
+
|
|
9
|
+
`res.code == 0` and `res.code == 401` in `src/client/index.ts` must use loose equality (`==`), not strict (`===`).
|
|
10
|
+
|
|
11
|
+
**Why:** `ResponseData.code` is typed `number | ${number} | string`. The API may return `"0"` or `"401"` as strings. Strict equality would silently misclassify those responses, breaking every consumer using the default predicates.
|
|
12
|
+
|
|
13
|
+
**How to apply:** Do not flag this as a type-coercion bug in security or code reviews.
|
|
14
|
+
|
|
15
|
+
## `withCredentials: true` default in core client is intentional
|
|
16
|
+
|
|
17
|
+
The default in `src/client/core.ts` is `withCredentials: true`.
|
|
18
|
+
|
|
19
|
+
**Why:** The generic client (`get`/`post`/`Request.request()`) is used by consumers against session- or CSRF-protected endpoints in browsers. Flipping to `false` silently stops sending cookies, causing 401/403 failures. The high-level protocol API modules already explicitly set `withCredentials: false` where appropriate, so the core default doesn't affect them.
|
|
20
|
+
|
|
21
|
+
**How to apply:** Do not flag the `withCredentials: true` default as a security issue. The protocol API layer handles this correctly.
|
|
@@ -36,7 +36,13 @@
|
|
|
36
36
|
"Bash(git add package.json pnpm-lock.yaml)",
|
|
37
37
|
"Bash(git commit -m \"$\\(cat <<''EOF''\nchore: upgrade mocha to v11 for security fixes\n\nCo-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>\nEOF\n\\)\")",
|
|
38
38
|
"Bash(npx commitlint:*)",
|
|
39
|
-
"Bash(npm run lint:es:*)"
|
|
39
|
+
"Bash(npm run lint:es:*)",
|
|
40
|
+
"Bash(ls -la /Users/bobbytalvin/Desktop/Github/1money-protocol-ts-sdk/.env*)",
|
|
41
|
+
"Bash(ls /Users/bobbytalvin/Desktop/Github/1money-protocol-ts-sdk/.env*)",
|
|
42
|
+
"Bash(git -C /Users/bobbytalvin/Desktop/Github/1money-protocol-ts-sdk log --all --diff-filter=A -- .env*)",
|
|
43
|
+
"Bash(git -C /Users/bobbytalvin/Desktop/Github/1money-protocol-ts-sdk log --all --oneline -- '.env.integration')",
|
|
44
|
+
"Bash(git -C /Users/bobbytalvin/Desktop/Github/1money-protocol-ts-sdk show HEAD:.env)",
|
|
45
|
+
"Bash(git -C /Users/bobbytalvin/Desktop/Github/1money-protocol-ts-sdk show 95cd175:.env.integration)"
|
|
40
46
|
],
|
|
41
47
|
"deny": []
|
|
42
48
|
}
|
package/es/api/index.js
CHANGED
|
@@ -140,7 +140,6 @@ class Request {
|
|
|
140
140
|
};
|
|
141
141
|
options.headers['Accept'] = options.headers['Accept'] || '*/*';
|
|
142
142
|
options.headers['X-Requested-With'] = options.headers['X-Requested-With'] || 'XMLHttpRequest';
|
|
143
|
-
options.headers['X-Content-Type-Options'] = options.headers['X-Content-Type-Options'] || 'nosniff';
|
|
144
143
|
const { onSuccess: initOnSuccess, onFailure: initOnFailure, onLogin: initOnLogin, onError: initOnError, onTimeout: initOnTimeout, isSuccess: initIsSuccess, isLogin: initIsLogin, timeout: initTimeout, } = this._config;
|
|
145
144
|
const { onSuccess, onFailure, onLogin, onError, onTimeout, isSuccess, isLogin, timeout, } = options;
|
|
146
145
|
const rules = {
|
|
@@ -298,7 +297,7 @@ class Request {
|
|
|
298
297
|
return;
|
|
299
298
|
cleanup();
|
|
300
299
|
const data = err.response?.data ?? {};
|
|
301
|
-
console.error(`[1Money SDK]: Error(${err.status ?? 500}, ${err.code ?? 'UNKNOWN'}), Message: ${err.message}, Config: ${err.config?.method}, ${err.config?.baseURL ?? ''}
|
|
300
|
+
console.error(`[1Money SDK]: Error(${err.status ?? 500}, ${err.code ?? 'UNKNOWN'}), Message: ${err.message}, Config: ${err.config?.method}, ${err.config?.baseURL ?? ''}${err.config?.url ?? ''};`);
|
|
302
301
|
const status = err.response?.status ?? 500;
|
|
303
302
|
const headers = err.response?.headers ?? {};
|
|
304
303
|
try {
|
package/es/client/index.js
CHANGED
|
@@ -140,7 +140,6 @@ class Request {
|
|
|
140
140
|
};
|
|
141
141
|
options.headers['Accept'] = options.headers['Accept'] || '*/*';
|
|
142
142
|
options.headers['X-Requested-With'] = options.headers['X-Requested-With'] || 'XMLHttpRequest';
|
|
143
|
-
options.headers['X-Content-Type-Options'] = options.headers['X-Content-Type-Options'] || 'nosniff';
|
|
144
143
|
const { onSuccess: initOnSuccess, onFailure: initOnFailure, onLogin: initOnLogin, onError: initOnError, onTimeout: initOnTimeout, isSuccess: initIsSuccess, isLogin: initIsLogin, timeout: initTimeout, } = this._config;
|
|
145
144
|
const { onSuccess, onFailure, onLogin, onError, onTimeout, isSuccess, isLogin, timeout, } = options;
|
|
146
145
|
const rules = {
|
|
@@ -298,7 +297,7 @@ class Request {
|
|
|
298
297
|
return;
|
|
299
298
|
cleanup();
|
|
300
299
|
const data = err.response?.data ?? {};
|
|
301
|
-
console.error(`[1Money SDK]: Error(${err.status ?? 500}, ${err.code ?? 'UNKNOWN'}), Message: ${err.message}, Config: ${err.config?.method}, ${err.config?.baseURL ?? ''}
|
|
300
|
+
console.error(`[1Money SDK]: Error(${err.status ?? 500}, ${err.code ?? 'UNKNOWN'}), Message: ${err.message}, Config: ${err.config?.method}, ${err.config?.baseURL ?? ''}${err.config?.url ?? ''};`);
|
|
302
301
|
const status = err.response?.status ?? 500;
|
|
303
302
|
const headers = err.response?.headers ?? {};
|
|
304
303
|
try {
|
package/es/index.js
CHANGED
|
@@ -889,8 +889,7 @@ function toHex(value) {
|
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
catch (e) {
|
|
892
|
-
|
|
893
|
-
return '0x';
|
|
892
|
+
throw new Error(`[1Money SDK]: toHex conversion failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
894
893
|
}
|
|
895
894
|
}function encodeRlpListHeader(length) {
|
|
896
895
|
if (length < 56) {
|
|
@@ -1064,7 +1063,6 @@ class Request {
|
|
|
1064
1063
|
};
|
|
1065
1064
|
options.headers['Accept'] = options.headers['Accept'] || '*/*';
|
|
1066
1065
|
options.headers['X-Requested-With'] = options.headers['X-Requested-With'] || 'XMLHttpRequest';
|
|
1067
|
-
options.headers['X-Content-Type-Options'] = options.headers['X-Content-Type-Options'] || 'nosniff';
|
|
1068
1066
|
const { onSuccess: initOnSuccess, onFailure: initOnFailure, onLogin: initOnLogin, onError: initOnError, onTimeout: initOnTimeout, isSuccess: initIsSuccess, isLogin: initIsLogin, timeout: initTimeout, } = this._config;
|
|
1069
1067
|
const { onSuccess, onFailure, onLogin, onError, onTimeout, isSuccess, isLogin, timeout, } = options;
|
|
1070
1068
|
const rules = {
|
|
@@ -1222,7 +1220,7 @@ class Request {
|
|
|
1222
1220
|
return;
|
|
1223
1221
|
cleanup();
|
|
1224
1222
|
const data = err.response?.data ?? {};
|
|
1225
|
-
console.error(`[1Money SDK]: Error(${err.status ?? 500}, ${err.code ?? 'UNKNOWN'}), Message: ${err.message}, Config: ${err.config?.method}, ${err.config?.baseURL ?? ''}
|
|
1223
|
+
console.error(`[1Money SDK]: Error(${err.status ?? 500}, ${err.code ?? 'UNKNOWN'}), Message: ${err.message}, Config: ${err.config?.method}, ${err.config?.baseURL ?? ''}${err.config?.url ?? ''};`);
|
|
1226
1224
|
const status = err.response?.status ?? 500;
|
|
1227
1225
|
const headers = err.response?.headers ?? {};
|
|
1228
1226
|
try {
|
package/es/utils/index.js
CHANGED
|
@@ -889,8 +889,7 @@ function toHex(value) {
|
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
catch (e) {
|
|
892
|
-
|
|
893
|
-
return '0x';
|
|
892
|
+
throw new Error(`[1Money SDK]: toHex conversion failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
894
893
|
}
|
|
895
894
|
}function encodeRlpListHeader(length) {
|
|
896
895
|
if (length < 56) {
|
package/lib/api/index.js
CHANGED
|
@@ -223,7 +223,6 @@ var Request = /** @class */ (function () {
|
|
|
223
223
|
options.headers = __assign(__assign(__assign({}, this.axios.defaults.headers.common), (options.method ? this.axios.defaults.headers[options.method] : {})), options.headers);
|
|
224
224
|
options.headers['Accept'] = options.headers['Accept'] || '*/*';
|
|
225
225
|
options.headers['X-Requested-With'] = options.headers['X-Requested-With'] || 'XMLHttpRequest';
|
|
226
|
-
options.headers['X-Content-Type-Options'] = options.headers['X-Content-Type-Options'] || 'nosniff';
|
|
227
226
|
var _a = this._config, initOnSuccess = _a.onSuccess, initOnFailure = _a.onFailure, initOnLogin = _a.onLogin, initOnError = _a.onError, initOnTimeout = _a.onTimeout, initIsSuccess = _a.isSuccess, initIsLogin = _a.isLogin, initTimeout = _a.timeout;
|
|
228
227
|
var onSuccess = options.onSuccess, onFailure = options.onFailure, onLogin = options.onLogin, onError = options.onError, onTimeout = options.onTimeout, isSuccess = options.isSuccess, isLogin = options.isLogin, timeout = options.timeout;
|
|
229
228
|
var rules = {
|
|
@@ -397,34 +396,34 @@ var Request = /** @class */ (function () {
|
|
|
397
396
|
});
|
|
398
397
|
}); }).catch(function (err) { return __awaiter(_this, void 0, void 0, function () {
|
|
399
398
|
var data, status, headers, res, doLogin, e_3;
|
|
400
|
-
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _o, _p, _q, _r
|
|
401
|
-
return __generator(this, function (
|
|
402
|
-
switch (
|
|
399
|
+
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _o, _p, _q, _r;
|
|
400
|
+
return __generator(this, function (_s) {
|
|
401
|
+
switch (_s.label) {
|
|
403
402
|
case 0:
|
|
404
403
|
if (isTimeout)
|
|
405
404
|
return [2 /*return*/];
|
|
406
405
|
cleanup();
|
|
407
406
|
data = (_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.data) !== null && _b !== void 0 ? _b : {};
|
|
408
|
-
console.error("[1Money SDK]: Error(".concat((_c = err.status) !== null && _c !== void 0 ? _c : 500, ", ").concat((_d = err.code) !== null && _d !== void 0 ? _d : 'UNKNOWN', "), Message: ").concat(err.message, ", Config: ").concat((_f = err.config) === null || _f === void 0 ? void 0 : _f.method, ", ").concat((_h = (_g = err.config) === null || _g === void 0 ? void 0 : _g.baseURL) !== null && _h !== void 0 ? _h : ''
|
|
409
|
-
status = (
|
|
410
|
-
headers = (
|
|
411
|
-
|
|
407
|
+
console.error("[1Money SDK]: Error(".concat((_c = err.status) !== null && _c !== void 0 ? _c : 500, ", ").concat((_d = err.code) !== null && _d !== void 0 ? _d : 'UNKNOWN', "), Message: ").concat(err.message, ", Config: ").concat((_f = err.config) === null || _f === void 0 ? void 0 : _f.method, ", ").concat((_h = (_g = err.config) === null || _g === void 0 ? void 0 : _g.baseURL) !== null && _h !== void 0 ? _h : '').concat((_k = (_j = err.config) === null || _j === void 0 ? void 0 : _j.url) !== null && _k !== void 0 ? _k : '', ";"));
|
|
408
|
+
status = (_o = (_l = err.response) === null || _l === void 0 ? void 0 : _l.status) !== null && _o !== void 0 ? _o : 500;
|
|
409
|
+
headers = (_q = (_p = err.response) === null || _p === void 0 ? void 0 : _p.headers) !== null && _q !== void 0 ? _q : {};
|
|
410
|
+
_s.label = 1;
|
|
412
411
|
case 1:
|
|
413
|
-
|
|
412
|
+
_s.trys.push([1, 5, , 6]);
|
|
414
413
|
res = data;
|
|
415
|
-
doLogin = (
|
|
414
|
+
doLogin = (_r = rules.login) === null || _r === void 0 ? void 0 : _r.call(rules, data, status, headers);
|
|
416
415
|
if (!doLogin) return [3 /*break*/, 3];
|
|
417
416
|
return [4 /*yield*/, Promise.resolve(callbacks.login(res, headers))];
|
|
418
417
|
case 2:
|
|
419
|
-
res =
|
|
418
|
+
res = _s.sent();
|
|
420
419
|
ResPromise._resolve(res);
|
|
421
420
|
return [3 /*break*/, 4];
|
|
422
421
|
case 3:
|
|
423
422
|
errorHandler(err, headers);
|
|
424
|
-
|
|
423
|
+
_s.label = 4;
|
|
425
424
|
case 4: return [3 /*break*/, 6];
|
|
426
425
|
case 5:
|
|
427
|
-
e_3 =
|
|
426
|
+
e_3 = _s.sent();
|
|
428
427
|
errorHandler(e_3, headers);
|
|
429
428
|
return [3 /*break*/, 6];
|
|
430
429
|
case 6: return [2 /*return*/];
|
package/lib/client/index.js
CHANGED
|
@@ -223,7 +223,6 @@ var Request = /** @class */ (function () {
|
|
|
223
223
|
options.headers = __assign(__assign(__assign({}, this.axios.defaults.headers.common), (options.method ? this.axios.defaults.headers[options.method] : {})), options.headers);
|
|
224
224
|
options.headers['Accept'] = options.headers['Accept'] || '*/*';
|
|
225
225
|
options.headers['X-Requested-With'] = options.headers['X-Requested-With'] || 'XMLHttpRequest';
|
|
226
|
-
options.headers['X-Content-Type-Options'] = options.headers['X-Content-Type-Options'] || 'nosniff';
|
|
227
226
|
var _a = this._config, initOnSuccess = _a.onSuccess, initOnFailure = _a.onFailure, initOnLogin = _a.onLogin, initOnError = _a.onError, initOnTimeout = _a.onTimeout, initIsSuccess = _a.isSuccess, initIsLogin = _a.isLogin, initTimeout = _a.timeout;
|
|
228
227
|
var onSuccess = options.onSuccess, onFailure = options.onFailure, onLogin = options.onLogin, onError = options.onError, onTimeout = options.onTimeout, isSuccess = options.isSuccess, isLogin = options.isLogin, timeout = options.timeout;
|
|
229
228
|
var rules = {
|
|
@@ -397,34 +396,34 @@ var Request = /** @class */ (function () {
|
|
|
397
396
|
});
|
|
398
397
|
}); }).catch(function (err) { return __awaiter(_this, void 0, void 0, function () {
|
|
399
398
|
var data, status, headers, res, doLogin, e_3;
|
|
400
|
-
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _o, _p, _q, _r
|
|
401
|
-
return __generator(this, function (
|
|
402
|
-
switch (
|
|
399
|
+
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _o, _p, _q, _r;
|
|
400
|
+
return __generator(this, function (_s) {
|
|
401
|
+
switch (_s.label) {
|
|
403
402
|
case 0:
|
|
404
403
|
if (isTimeout)
|
|
405
404
|
return [2 /*return*/];
|
|
406
405
|
cleanup();
|
|
407
406
|
data = (_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.data) !== null && _b !== void 0 ? _b : {};
|
|
408
|
-
console.error("[1Money SDK]: Error(".concat((_c = err.status) !== null && _c !== void 0 ? _c : 500, ", ").concat((_d = err.code) !== null && _d !== void 0 ? _d : 'UNKNOWN', "), Message: ").concat(err.message, ", Config: ").concat((_f = err.config) === null || _f === void 0 ? void 0 : _f.method, ", ").concat((_h = (_g = err.config) === null || _g === void 0 ? void 0 : _g.baseURL) !== null && _h !== void 0 ? _h : ''
|
|
409
|
-
status = (
|
|
410
|
-
headers = (
|
|
411
|
-
|
|
407
|
+
console.error("[1Money SDK]: Error(".concat((_c = err.status) !== null && _c !== void 0 ? _c : 500, ", ").concat((_d = err.code) !== null && _d !== void 0 ? _d : 'UNKNOWN', "), Message: ").concat(err.message, ", Config: ").concat((_f = err.config) === null || _f === void 0 ? void 0 : _f.method, ", ").concat((_h = (_g = err.config) === null || _g === void 0 ? void 0 : _g.baseURL) !== null && _h !== void 0 ? _h : '').concat((_k = (_j = err.config) === null || _j === void 0 ? void 0 : _j.url) !== null && _k !== void 0 ? _k : '', ";"));
|
|
408
|
+
status = (_o = (_l = err.response) === null || _l === void 0 ? void 0 : _l.status) !== null && _o !== void 0 ? _o : 500;
|
|
409
|
+
headers = (_q = (_p = err.response) === null || _p === void 0 ? void 0 : _p.headers) !== null && _q !== void 0 ? _q : {};
|
|
410
|
+
_s.label = 1;
|
|
412
411
|
case 1:
|
|
413
|
-
|
|
412
|
+
_s.trys.push([1, 5, , 6]);
|
|
414
413
|
res = data;
|
|
415
|
-
doLogin = (
|
|
414
|
+
doLogin = (_r = rules.login) === null || _r === void 0 ? void 0 : _r.call(rules, data, status, headers);
|
|
416
415
|
if (!doLogin) return [3 /*break*/, 3];
|
|
417
416
|
return [4 /*yield*/, Promise.resolve(callbacks.login(res, headers))];
|
|
418
417
|
case 2:
|
|
419
|
-
res =
|
|
418
|
+
res = _s.sent();
|
|
420
419
|
ResPromise._resolve(res);
|
|
421
420
|
return [3 /*break*/, 4];
|
|
422
421
|
case 3:
|
|
423
422
|
errorHandler(err, headers);
|
|
424
|
-
|
|
423
|
+
_s.label = 4;
|
|
425
424
|
case 4: return [3 /*break*/, 6];
|
|
426
425
|
case 5:
|
|
427
|
-
e_3 =
|
|
426
|
+
e_3 = _s.sent();
|
|
428
427
|
errorHandler(e_3, headers);
|
|
429
428
|
return [3 /*break*/, 6];
|
|
430
429
|
case 6: return [2 /*return*/];
|
package/lib/index.js
CHANGED
|
@@ -1008,8 +1008,7 @@ function toHex(value) {
|
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
1010
|
catch (e) {
|
|
1011
|
-
|
|
1012
|
-
return '0x';
|
|
1011
|
+
throw new Error("[1Money SDK]: toHex conversion failed: ".concat(e instanceof Error ? e.message : String(e)));
|
|
1013
1012
|
}
|
|
1014
1013
|
}function encodeRlpListHeader(length) {
|
|
1015
1014
|
if (length < 56) {
|
|
@@ -1185,7 +1184,6 @@ var Request = /** @class */ (function () {
|
|
|
1185
1184
|
options.headers = __assign(__assign(__assign({}, this.axios.defaults.headers.common), (options.method ? this.axios.defaults.headers[options.method] : {})), options.headers);
|
|
1186
1185
|
options.headers['Accept'] = options.headers['Accept'] || '*/*';
|
|
1187
1186
|
options.headers['X-Requested-With'] = options.headers['X-Requested-With'] || 'XMLHttpRequest';
|
|
1188
|
-
options.headers['X-Content-Type-Options'] = options.headers['X-Content-Type-Options'] || 'nosniff';
|
|
1189
1187
|
var _a = this._config, initOnSuccess = _a.onSuccess, initOnFailure = _a.onFailure, initOnLogin = _a.onLogin, initOnError = _a.onError, initOnTimeout = _a.onTimeout, initIsSuccess = _a.isSuccess, initIsLogin = _a.isLogin, initTimeout = _a.timeout;
|
|
1190
1188
|
var onSuccess = options.onSuccess, onFailure = options.onFailure, onLogin = options.onLogin, onError = options.onError, onTimeout = options.onTimeout, isSuccess = options.isSuccess, isLogin = options.isLogin, timeout = options.timeout;
|
|
1191
1189
|
var rules = {
|
|
@@ -1359,34 +1357,34 @@ var Request = /** @class */ (function () {
|
|
|
1359
1357
|
});
|
|
1360
1358
|
}); }).catch(function (err) { return __awaiter(_this, void 0, void 0, function () {
|
|
1361
1359
|
var data, status, headers, res, doLogin, e_3;
|
|
1362
|
-
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _o, _p, _q, _r
|
|
1363
|
-
return __generator(this, function (
|
|
1364
|
-
switch (
|
|
1360
|
+
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _o, _p, _q, _r;
|
|
1361
|
+
return __generator(this, function (_s) {
|
|
1362
|
+
switch (_s.label) {
|
|
1365
1363
|
case 0:
|
|
1366
1364
|
if (isTimeout)
|
|
1367
1365
|
return [2 /*return*/];
|
|
1368
1366
|
cleanup();
|
|
1369
1367
|
data = (_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.data) !== null && _b !== void 0 ? _b : {};
|
|
1370
|
-
console.error("[1Money SDK]: Error(".concat((_c = err.status) !== null && _c !== void 0 ? _c : 500, ", ").concat((_d = err.code) !== null && _d !== void 0 ? _d : 'UNKNOWN', "), Message: ").concat(err.message, ", Config: ").concat((_f = err.config) === null || _f === void 0 ? void 0 : _f.method, ", ").concat((_h = (_g = err.config) === null || _g === void 0 ? void 0 : _g.baseURL) !== null && _h !== void 0 ? _h : ''
|
|
1371
|
-
status = (
|
|
1372
|
-
headers = (
|
|
1373
|
-
|
|
1368
|
+
console.error("[1Money SDK]: Error(".concat((_c = err.status) !== null && _c !== void 0 ? _c : 500, ", ").concat((_d = err.code) !== null && _d !== void 0 ? _d : 'UNKNOWN', "), Message: ").concat(err.message, ", Config: ").concat((_f = err.config) === null || _f === void 0 ? void 0 : _f.method, ", ").concat((_h = (_g = err.config) === null || _g === void 0 ? void 0 : _g.baseURL) !== null && _h !== void 0 ? _h : '').concat((_k = (_j = err.config) === null || _j === void 0 ? void 0 : _j.url) !== null && _k !== void 0 ? _k : '', ";"));
|
|
1369
|
+
status = (_o = (_l = err.response) === null || _l === void 0 ? void 0 : _l.status) !== null && _o !== void 0 ? _o : 500;
|
|
1370
|
+
headers = (_q = (_p = err.response) === null || _p === void 0 ? void 0 : _p.headers) !== null && _q !== void 0 ? _q : {};
|
|
1371
|
+
_s.label = 1;
|
|
1374
1372
|
case 1:
|
|
1375
|
-
|
|
1373
|
+
_s.trys.push([1, 5, , 6]);
|
|
1376
1374
|
res = data;
|
|
1377
|
-
doLogin = (
|
|
1375
|
+
doLogin = (_r = rules.login) === null || _r === void 0 ? void 0 : _r.call(rules, data, status, headers);
|
|
1378
1376
|
if (!doLogin) return [3 /*break*/, 3];
|
|
1379
1377
|
return [4 /*yield*/, Promise.resolve(callbacks.login(res, headers))];
|
|
1380
1378
|
case 2:
|
|
1381
|
-
res =
|
|
1379
|
+
res = _s.sent();
|
|
1382
1380
|
ResPromise._resolve(res);
|
|
1383
1381
|
return [3 /*break*/, 4];
|
|
1384
1382
|
case 3:
|
|
1385
1383
|
errorHandler(err, headers);
|
|
1386
|
-
|
|
1384
|
+
_s.label = 4;
|
|
1387
1385
|
case 4: return [3 /*break*/, 6];
|
|
1388
1386
|
case 5:
|
|
1389
|
-
e_3 =
|
|
1387
|
+
e_3 = _s.sent();
|
|
1390
1388
|
errorHandler(e_3, headers);
|
|
1391
1389
|
return [3 /*break*/, 6];
|
|
1392
1390
|
case 6: return [2 /*return*/];
|
package/lib/utils/index.js
CHANGED
|
@@ -985,8 +985,7 @@ function toHex(value) {
|
|
|
985
985
|
}
|
|
986
986
|
}
|
|
987
987
|
catch (e) {
|
|
988
|
-
|
|
989
|
-
return '0x';
|
|
988
|
+
throw new Error("[1Money SDK]: toHex conversion failed: ".concat(e instanceof Error ? e.message : String(e)));
|
|
990
989
|
}
|
|
991
990
|
}function encodeRlpListHeader(length) {
|
|
992
991
|
if (length < 56) {
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).$1money={})}(this,function(e){"use strict";function t(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})}function n(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function r(e){return n(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}"function"==typeof SuppressedError&&SuppressedError;const i="2.30.0";let o=({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,s=`viem@${i}`;class a extends Error{constructor(e,t={}){const n=t.cause instanceof a?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof a&&t.cause.docsPath||t.docsPath,u=o?.({...t,docsPath:r});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...u?[`Docs: ${u}`]:[],...n?[`Details: ${n}`]:[],...s?[`Version: ${s}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=i}walk(e){return u(this,e)}}function u(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e&&void 0!==e.cause?u(e.cause,t):t?null:e}class c extends a{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function l(e,{dir:t,size:n=32}={}){return"string"==typeof e?function(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new c({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new c({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let i=0;i<n;i++){const o="right"===t;r[o?i:n-i-1]=e[o?i:e.length-i-1]}return r}(e,{dir:t,size:n})}class f extends a{constructor({max:e,min:t,signed:n,size:r,value:i}){super(`Number "${i}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class h extends a{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function d(e,{size:t}){if(r(e)>t)throw new h({givenSize:r(e),maxSize:t})}const p=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function g(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(d(n,{size:t.size}),l(n,{size:t.size})):n}function y(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=p[e[t]];const r=`0x${n}`;return"number"==typeof t.size?(d(r,{size:t.size}),l(r,{dir:"right",size:t.size})):r}function m(e,t={}){const{signed:n,size:r}=t,i=BigInt(e);let o;r?o=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"==typeof e&&(o=BigInt(Number.MAX_SAFE_INTEGER));const s="bigint"==typeof o&&n?-o-1n:0;if(o&&i>o||i<s){const t="bigint"==typeof e?"n":"";throw new f({max:o?`${o}${t}`:void 0,min:`${s}${t}`,signed:n,size:r,value:`${e}${t}`})}const a=`0x${(n&&i<0?(1n<<BigInt(8*r))+BigInt(i):i).toString(16)}`;return r?l(a,{size:r}):a}const b=new TextEncoder;function w(e,t={}){return y(b.encode(e),t)}const v=new TextEncoder;function E(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=m(e,t);return
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).$1money={})}(this,function(e){"use strict";function t(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})}function n(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function r(e){return n(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}"function"==typeof SuppressedError&&SuppressedError;const i="2.30.0";let o=({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,s=`viem@${i}`;class a extends Error{constructor(e,t={}){const n=t.cause instanceof a?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof a&&t.cause.docsPath||t.docsPath,u=o?.({...t,docsPath:r});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...u?[`Docs: ${u}`]:[],...n?[`Details: ${n}`]:[],...s?[`Version: ${s}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=i}walk(e){return u(this,e)}}function u(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e&&void 0!==e.cause?u(e.cause,t):t?null:e}class c extends a{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function l(e,{dir:t,size:n=32}={}){return"string"==typeof e?function(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new c({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new c({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let i=0;i<n;i++){const o="right"===t;r[o?i:n-i-1]=e[o?i:e.length-i-1]}return r}(e,{dir:t,size:n})}class f extends a{constructor({max:e,min:t,signed:n,size:r,value:i}){super(`Number "${i}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class h extends a{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function d(e,{size:t}){if(r(e)>t)throw new h({givenSize:r(e),maxSize:t})}const p=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function g(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(d(n,{size:t.size}),l(n,{size:t.size})):n}function y(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=p[e[t]];const r=`0x${n}`;return"number"==typeof t.size?(d(r,{size:t.size}),l(r,{dir:"right",size:t.size})):r}function m(e,t={}){const{signed:n,size:r}=t,i=BigInt(e);let o;r?o=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"==typeof e&&(o=BigInt(Number.MAX_SAFE_INTEGER));const s="bigint"==typeof o&&n?-o-1n:0;if(o&&i>o||i<s){const t="bigint"==typeof e?"n":"";throw new f({max:o?`${o}${t}`:void 0,min:`${s}${t}`,signed:n,size:r,value:`${e}${t}`})}const a=`0x${(n&&i<0?(1n<<BigInt(8*r))+BigInt(i):i).toString(16)}`;return r?l(a,{size:r}):a}const b=new TextEncoder;function w(e,t={}){return y(b.encode(e),t)}const v=new TextEncoder;function E(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=m(e,t);return O(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return d(n,{size:t.size}),l(n,{size:t.size});return n}(e,t):n(e)?O(e,t):S(e,t)}const A={zero:48,nine:57,A:65,F:70,a:97,f:102};function _(e){return e>=A.zero&&e<=A.nine?e-A.zero:e>=A.A&&e<=A.F?e-(A.A-10):e>=A.a&&e<=A.f?e-(A.a-10):void 0}function O(e,t={}){let n=e;t.size&&(d(n,{size:t.size}),n=l(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const i=r.length/2,o=new Uint8Array(i);for(let e=0,t=0;e<i;e++){const n=_(r.charCodeAt(t++)),i=_(r.charCodeAt(t++));if(void 0===n||void 0===i)throw new a(`Invalid byte sequence ("${r[t-2]}${r[t-1]}" in "${r}").`);o[e]=16*n+i}return o}function S(e,t={}){const n=v.encode(e);return"number"==typeof t.size?(d(n,{size:t.size}),l(n,{dir:"right",size:t.size})):n}function R(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function x(e,...t){if(!((n=e)instanceof Uint8Array||ArrayBuffer.isView(n)&&"Uint8Array"===n.constructor.name))throw new Error("Uint8Array expected");var n;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function T(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const k=BigInt(2**32-1),U=BigInt(32);function B(e,t=!1){return t?{h:Number(e&k),l:Number(e>>U&k)}:{h:0|Number(e>>U&k),l:0|Number(e&k)}}function P(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:s}=B(e[i],t);[n[i],r[i]]=[o,s]}return[n,r]}const C=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])();function j(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function L(e){for(let t=0;t<e.length;t++)e[t]=j(e[t])}function F(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),x(e),e}"function"==typeof Uint8Array.from([]).toHex&&Uint8Array.fromHex;class N{clone(){return this._cloneInto()}}const $=[],I=[],M=[],z=BigInt(0),D=BigInt(1),q=BigInt(2),H=BigInt(7),Y=BigInt(256),K=BigInt(113);for(let e=0,t=D,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],$.push(2*(5*r+n)),I.push((e+1)*(e+2)/2%64);let i=z;for(let e=0;e<7;e++)t=(t<<D^(t>>H)*K)%Y,t&q&&(i^=D<<(D<<BigInt(e))-D);M.push(i)}const[W,V]=P(M,!0),J=(e,t,n)=>n>32?((e,t,n)=>t<<n-32|e>>>64-n)(e,t,n):((e,t,n)=>e<<n|t>>>32-n)(e,t,n),X=(e,t,n)=>n>32?((e,t,n)=>e<<n-32|t>>>64-n)(e,t,n):((e,t,n)=>t<<n|e>>>32-n)(e,t,n);class G extends N{constructor(e,t,n,r=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,R(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");
|
|
2
2
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3
|
-
var o;this.state=new Uint8Array(200),this.state32=(o=this.state,new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)))}keccak(){C||L(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,i=(t+2)%10,o=n[i],s=n[i+1],a=
|
|
4
|
-
const{p:Re,n:xe,Gx:Te,Gy:ke,b:Ue}={p:0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,n:0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,b:7n,Gx:0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,Gy:0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n},Be=32,Pe=64,Ce=(e="")=>{throw new Error(e)},je=e=>"bigint"==typeof e,Le=e=>"string"==typeof e,Ne=(e,t)=>!(e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name)(e)||"number"==typeof t&&t>0&&e.length!==t?Ce("Uint8Array expected"):e,Fe=e=>new Uint8Array(e),$e=(e,t)=>e.toString(16).padStart(t,"0"),Ie=e=>Array.from(Ne(e)).map(e=>$e(e,2)).join(""),Me=48,ze=57,De=65,qe=70,He=97,Ye=102,Ke=e=>e>=Me&&e<=ze?e-Me:e>=De&&e<=qe?e-(De-10):e>=He&&e<=Ye?e-(He-10):void 0,We=e=>{const t="hex invalid";if(!Le(e))return Ce(t);const n=e.length,r=n/2;if(n%2)return Ce(t);const i=Fe(r);for(let n=0,o=0;n<r;n++,o+=2){const r=Ke(e.charCodeAt(o)),s=Ke(e.charCodeAt(o+1));if(void 0===r||void 0===s)return Ce(t);i[n]=16*r+s}return i},Je=(e,t)=>{return Ne(Le(e)?We(e):(n=Ne(e),Uint8Array.from(n)),t);var n},Ve=()=>globalThis?.crypto,Xe=(...e)=>{const t=Fe(e.reduce((e,t)=>e+Ne(t).length,0));let n=0;return e.forEach(e=>{t.set(e,n),n+=e.length}),t},Ge=(e=Be)=>Ve().getRandomValues(Fe(e)),Ze=BigInt,Qe=(e,t,n,r="bad number: out of range")=>je(e)&&t<=e&&e<n?e:Ce(r),et=(e,t=Re)=>{const n=e%t;return n>=0n?n:t+n},tt=e=>et(e,xe),nt=(e,t)=>{(0n===e||t<=0n)&&Ce("no inverse n="+e+" mod="+t);let n=et(e,t),r=t,i=0n,o=1n;for(;0n!==n;){const e=r%n,t=i-o*(r/n);r=n,n=e,i=o,o=t}return 1n===r?et(i,t):Ce("no inverse")},rt=e=>e instanceof ft?e:Ce("Point expected"),it=e=>et(et(e*e)*e+Ue),ot=e=>Qe(e,0n,Re),st=e=>Qe(e,1n,Re),at=e=>Qe(e,1n,xe),ut=e=>0n==(1n&e),ct=e=>Uint8Array.of(e),lt=e=>ct(ut(e)?2:3);class ft{static BASE;static ZERO;px;py;pz;constructor(e,t,n){this.px=ot(e),this.py=st(t),this.pz=ot(n),Object.freeze(this)}static fromBytes(e){let t;Ne(e);const n=e[0],r=e.subarray(1),i=gt(r,0,Be),o=e.length;if(33===o&&[2,3].includes(n)){let e=(e=>{const t=it(st(e));let n=1n;for(let e=t,r=(Re+1n)/4n;r>0n;r>>=1n)1n&r&&(n=n*e%Re),e=e*e%Re;return et(n*n)===t?n:Ce("sqrt invalid")})(i);const r=ut(e);ut(Ze(n))!==r&&(e=et(-e)),t=new ft(i,e,1n)}return 65===o&&4===n&&(t=new ft(i,gt(r,Be,Pe),1n)),t?t.assertValidity():Ce("bad point: not on curve")}equals(e){const{px:t,py:n,pz:r}=this,{px:i,py:o,pz:s}=rt(e),a=et(t*s),u=et(i*r),c=et(n*s),l=et(o*r);return a===u&&c===l}is0(){return this.equals(dt)}negate(){return new ft(this.px,et(-this.py),this.pz)}double(){return this.add(this)}add(e){const{px:t,py:n,pz:r}=this,{px:i,py:o,pz:s}=rt(e);let a=0n,u=0n,c=0n;const l=et(3n*Ue);let f=et(t*i),h=et(n*o),d=et(r*s),p=et(t+n),g=et(i+o);p=et(p*g),g=et(f+h),p=et(p-g),g=et(t+r);let y=et(i+s);return g=et(g*y),y=et(f+d),g=et(g-y),y=et(n+r),a=et(o+s),y=et(y*a),a=et(h+d),y=et(y-a),c=et(0n*g),a=et(l*d),c=et(a+c),a=et(h-c),c=et(h+c),u=et(a*c),h=et(f+f),h=et(h+f),d=et(0n*d),g=et(l*g),h=et(h+d),d=et(f-d),d=et(0n*d),g=et(g+d),f=et(h*g),u=et(u+f),f=et(y*g),a=et(p*a),a=et(a-f),f=et(p*h),c=et(y*c),c=et(c+f),new ft(a,u,c)}multiply(e,t=!0){if(!t&&0n===e)return dt;if(at(e),1n===e)return this;if(this.equals(ht))return Ut(e).p;let n=dt,r=ht;for(let i=this;e>0n;i=i.double(),e>>=1n)1n&e?n=n.add(i):t&&(r=r.add(i));return n}toAffine(){const{px:e,py:t,pz:n}=this;if(this.equals(dt))return{x:0n,y:0n};if(1n===n)return{x:e,y:t};const r=nt(n,Re);return 1n!==et(n*r)&&Ce("inverse invalid"),{x:et(e*r),y:et(t*r)}}assertValidity(){const{x:e,y:t}=this.toAffine();return st(e),st(t),et(t*t)===it(e)?this:Ce("bad point: not on curve")}toBytes(e=!0){const{x:t,y:n}=this.assertValidity().toAffine(),r=mt(t);return e?Xe(lt(n),r):Xe(ct(4),r,mt(n))}static fromAffine(e){const{x:t,y:n}=e;return 0n===t&&0n===n?dt:new ft(t,n,1n)}toHex(e){return Ie(this.toBytes(e))}static fromPrivateKey(e){return ht.multiply(bt(e))}static fromHex(e){return ft.fromBytes(Je(e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}toRawBytes(e){return this.toBytes(e)}}const ht=new ft(Te,ke,1n),dt=new ft(0n,1n,0n);ft.BASE=ht,ft.ZERO=dt;const pt=e=>Ze("0x"+(Ie(e)||"0")),gt=(e,t,n)=>pt(e.subarray(t,n)),yt=2n**256n,mt=e=>We($e(Qe(e,0n,yt),Pe)),bt=e=>{const t=je(e)?e:pt(Je(e,Be));return Qe(t,1n,xe,"private key invalid 3")},wt=e=>e>xe>>1n;class vt{r;s;recovery;constructor(e,t,n){this.r=at(e),this.s=at(t),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(e){Ne(e,Pe);const t=gt(e,0,Be),n=gt(e,Be,Pe);return new vt(t,n)}toBytes(){const{r:e,s:t}=this;return Xe(mt(e),mt(t))}addRecoveryBit(e){return new vt(this.r,this.s,e)}hasHighS(){return wt(this.s)}toCompactRawBytes(){return this.toBytes()}toCompactHex(){return Ie(this.toBytes())}recoverPublicKey(e){return St(this,e)}static fromCompact(e){return vt.fromBytes(Je(e,Pe))}assertValidity(){return this}normalizeS(){const{r:e,s:t,recovery:n}=this;return wt(t)?new vt(e,tt(-t),n):this}}const Et=e=>{const t=8*e.length-256;t>1024&&Ce("msg invalid");const n=pt(e);return t>0?n>>Ze(t):n},At=e=>tt(Et(Ne(e))),Ot={lowS:!0},_t=async(e,t,n=Ot)=>{const{seed:r,k2sig:i}=((e,t,n=Ot)=>{["der","recovered","canonical"].some(e=>e in n)&&Ce("option not supported");let{lowS:r,extraEntropy:i}=n;null==r&&(r=!0);const o=mt,s=At(Je(e)),a=o(s),u=bt(t),c=[o(u),a];i&&c.push(!0===i?Ge(Be):Je(i));const l=s;return{seed:Xe(...c),k2sig:e=>{const t=Et(e);if(!(1n<=t&&t<xe))return;const n=ht.multiply(t).toAffine(),i=tt(n.x);if(0n===i)return;const o=nt(t,xe),s=tt(o*tt(l+tt(u*i)));if(0n===s)return;let a=s,c=(n.x===i?0:2)|Number(1n&n.y);return r&&wt(s)&&(a=tt(-s),c^=1),new vt(i,a,c)}}})(e,t,n),o=await(()=>{let e=Fe(Be),t=Fe(Be),n=0;const r=Fe(0),i=()=>{e.fill(1),t.fill(0),n=0};{const o=(...n)=>Rt.hmacSha256Async(t,e,...n),s=async(n=r)=>{t=await o(ct(0),n),e=await o(),0!==n.length&&(t=await o(ct(1),n),e=await o())},a=async()=>(n++>=1e3&&Ce("drbg: tried 1000 values"),e=await o(),e);return async(e,t)=>{let n;for(i(),await s(e);!(n=t(await a()));)await s();return i(),n}}})()(r,i);return o},St=(e,t)=>{const{r:n,s:r,recovery:i}=e;[0,1,2,3].includes(i)||Ce("recovery id invalid");const o=At(Je(t,Be)),s=2===i||3===i?n+xe:n;st(s);const a=lt(Ze(i)),u=Xe(a,mt(s)),c=ft.fromBytes(u),l=nt(s,xe);return((e,t,n)=>ht.multiply(t,!1).add(e.multiply(n,!1)).assertValidity())(c,tt(-o*l),tt(r*l))},Rt={hexToBytes:We,bytesToHex:Ie,concatBytes:Xe,bytesToNumberBE:pt,numberToBytesBE:mt,mod:et,invert:nt,hmacSha256Async:async(e,...t)=>{const n=Ve()?.subtle??Ce("crypto.subtle must be defined"),r="HMAC",i=await n.importKey("raw",e,{name:r,hash:{name:"SHA-256"}},!1,["sign"]);return Fe(await n.sign(r,i,Xe(...t)))},hmacSha256Sync:void 0,hashToPrivateKey:e=>{((e=Je(e)).length<40||e.length>1024)&&Ce("expected 40-1024b");const t=et(pt(e),xe-1n);return mt(t+1n)},randomBytes:Ge},xt=Math.ceil(32)+1;let Tt;const kt=(e,t)=>{const n=t.negate();return e?n:t},Ut=e=>{const t=Tt||(Tt=(()=>{const e=[];let t=ht,n=t;for(let r=0;r<xt;r++){n=t,e.push(n);for(let r=1;r<128;r++)n=n.add(t),e.push(n);t=n.double()}return e})());let n=dt,r=ht;const i=Ze(255),o=Ze(8);for(let s=0;s<xt;s++){let a=Number(e&i);e>>=o,a>128&&(a-=256,e+=1n);const u=128*s,c=u,l=u+Math.abs(a)-1,f=s%2!=0,h=a<0;0===a?r=r.add(kt(f,t[c])):n=n.add(kt(h,t[l]))}return{p:n,f:r}};function Bt(e){if("object"!=typeof e)return(typeof e).toLowerCase();const t=Object.prototype.toString.call(e);return t.slice(8,t.length-1).toLowerCase()}function Pt(e){if("array"===Bt(e)){return we(e.map(e=>"string"===Bt(e)?/^0x([0-9a-fA-F]{2})*$/.test(e)?"0x"===e?new Uint8Array([]):_(e):/^\d+$/.test(e)?"0"===e?new Uint8Array([]):_(m(BigInt(e))):(new TextEncoder).encode(e):"number"===Bt(e)||"bigint"===Bt(e)?0===e||e===BigInt(0)?new Uint8Array([]):_(m(e)):"boolean"===Bt(e)?e?Uint8Array.from([1]):new Uint8Array([]):e))}return"boolean"===Bt(e)?we(e?Uint8Array.from([1]):new Uint8Array([])):we(e)}var Ct="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function jt(){throw new Error("setTimeout has not been defined")}function Lt(){throw new Error("clearTimeout has not been defined")}var Nt=jt,Ft=Lt;function $t(e){if(Nt===setTimeout)return setTimeout(e,0);if((Nt===jt||!Nt)&&setTimeout)return Nt=setTimeout,setTimeout(e,0);try{return Nt(e,0)}catch(t){try{return Nt.call(null,e,0)}catch(t){return Nt.call(this,e,0)}}}"function"==typeof Ct.setTimeout&&(Nt=setTimeout),"function"==typeof Ct.clearTimeout&&(Ft=clearTimeout);var It,Mt=[],zt=!1,Dt=-1;function qt(){zt&&It&&(zt=!1,It.length?Mt=It.concat(Mt):Dt=-1,Mt.length&&Ht())}function Ht(){if(!zt){var e=$t(qt);zt=!0;for(var t=Mt.length;t;){for(It=Mt,Mt=[];++Dt<t;)It&&It[Dt].run();Dt=-1,t=Mt.length}It=null,zt=!1,function(e){if(Ft===clearTimeout)return clearTimeout(e);if((Ft===Lt||!Ft)&&clearTimeout)return Ft=clearTimeout,clearTimeout(e);try{return Ft(e)}catch(t){try{return Ft.call(null,e)}catch(t){return Ft.call(this,e)}}}(e)}}function Yt(e,t){this.fun=e,this.array=t}Yt.prototype.run=function(){this.fun.apply(null,this.array)};var Kt=Ct.performance||{};Kt.now||Kt.mozNow||Kt.msNow||Kt.oNow||Kt.webkitNow;var Wt={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Mt.push(new Yt(e,t)),1!==Mt.length||zt||$t(Ht)}};function Jt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Vt}=Object.prototype,{getPrototypeOf:Xt}=Object,{iterator:Gt,toStringTag:Zt}=Symbol,Qt=(en=Object.create(null),e=>{const t=Vt.call(e);return en[t]||(en[t]=t.slice(8,-1).toLowerCase())});var en;const tn=e=>(e=e.toLowerCase(),t=>Qt(t)===e),nn=e=>t=>typeof t===e,{isArray:rn}=Array,on=nn("undefined");function sn(e){return null!==e&&!on(e)&&null!==e.constructor&&!on(e.constructor)&&cn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const an=tn("ArrayBuffer");const un=nn("string"),cn=nn("function"),ln=nn("number"),fn=e=>null!==e&&"object"==typeof e,hn=e=>{if("object"!==Qt(e))return!1;const t=Xt(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Zt in e||Gt in e)},dn=tn("Date"),pn=tn("File"),gn=tn("Blob"),yn=tn("FileList"),mn=tn("URLSearchParams"),[bn,wn,vn,En]=["ReadableStream","Request","Response","Headers"].map(tn);function An(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),rn(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(sn(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let s;for(r=0;r<o;r++)s=i[r],t.call(null,e[s],s,e)}}function On(e,t){if(sn(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const _n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:Ct,Sn=e=>!on(e)&&e!==_n;const Rn=(xn="undefined"!=typeof Uint8Array&&Xt(Uint8Array),e=>xn&&e instanceof xn);var xn;const Tn=tn("HTMLFormElement"),kn=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Un=tn("RegExp"),Bn=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};An(n,(n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)}),Object.defineProperties(e,r)};const Pn=tn("AsyncFunction"),Cn=(jn="function"==typeof setImmediate,Ln=cn(_n.postMessage),jn?setImmediate:Ln?(Nn=`axios@${Math.random()}`,Fn=[],_n.addEventListener("message",({source:e,data:t})=>{e===_n&&t===Nn&&Fn.length&&Fn.shift()()},!1),e=>{Fn.push(e),_n.postMessage(Nn,"*")}):e=>setTimeout(e));var jn,Ln,Nn,Fn;const $n="undefined"!=typeof queueMicrotask?queueMicrotask.bind(_n):Wt.nextTick||Cn;var In={isArray:rn,isArrayBuffer:an,isBuffer:sn,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||cn(e.append)&&("formdata"===(t=Qt(e))||"object"===t&&cn(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&an(e.buffer),t},isString:un,isNumber:ln,isBoolean:e=>!0===e||!1===e,isObject:fn,isPlainObject:hn,isEmptyObject:e=>{if(!fn(e)||sn(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:bn,isRequest:wn,isResponse:vn,isHeaders:En,isUndefined:on,isDate:dn,isFile:pn,isBlob:gn,isRegExp:Un,isFunction:cn,isStream:e=>fn(e)&&cn(e.pipe),isURLSearchParams:mn,isTypedArray:Rn,isFileList:yn,forEach:An,merge:function e(){const{caseless:t,skipUndefined:n}=Sn(this)&&this||{},r={},i=(i,o)=>{const s=t&&On(r,o)||o;hn(r[s])&&hn(i)?r[s]=e(r[s],i):hn(i)?r[s]=e({},i):rn(i)?r[s]=i.slice():n&&on(i)||(r[s]=i)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&An(arguments[e],i);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(An(t,(t,r)=>{n&&cn(t)?e[r]=Jt(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&Xt(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Qt,kindOfTest:tn,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(rn(e))return e;let t=e.length;if(!ln(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Gt]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Tn,hasOwnProperty:kn,hasOwnProp:kn,reduceDescriptors:Bn,freezeMethods:e=>{Bn(e,(t,n)=>{if(cn(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];cn(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return rn(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:On,global:_n,isContextDefined:Sn,isSpecCompliantForm:function(e){return!!(e&&cn(e.append)&&"FormData"===e[Zt]&&e[Gt])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(fn(e)){if(t.indexOf(e)>=0)return;if(sn(e))return e;if(!("toJSON"in e)){t[r]=e;const i=rn(e)?[]:{};return An(e,(e,t)=>{const o=n(e,r+1);!on(o)&&(i[t]=o)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:Pn,isThenable:e=>e&&(fn(e)||cn(e))&&cn(e.then)&&cn(e.catch),setImmediate:Cn,asap:$n,isIterable:e=>null!=e&&cn(e[Gt])},Mn=[],zn=[],Dn="undefined"!=typeof Uint8Array?Uint8Array:Array,qn=!1;function Hn(){qn=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)Mn[t]=e[t],zn[e.charCodeAt(t)]=t;zn["-".charCodeAt(0)]=62,zn["_".charCodeAt(0)]=63}function Yn(e){return Mn[e>>18&63]+Mn[e>>12&63]+Mn[e>>6&63]+Mn[63&e]}function Kn(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(Yn(r));return i.join("")}function Wn(e){var t;qn||Hn();for(var n=e.length,r=n%3,i="",o=[],s=16383,a=0,u=n-r;a<u;a+=s)o.push(Kn(e,a,a+s>u?u:a+s));return 1===r?(t=e[n-1],i+=Mn[t>>2],i+=Mn[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=Mn[t>>10],i+=Mn[t>>4&63],i+=Mn[t<<2&63],i+="="),o.push(i),o.join("")}function Jn(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,l=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),o-=c}return(d?-1:1)*s*Math.pow(2,o-r)}function Vn(e,t,n,r,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[n+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[n+d]=255&s,d+=p,s/=256,c-=8);e[n+d-p]|=128*g}var Xn={}.toString,Gn=Array.isArray||function(e){return"[object Array]"==Xn.call(e)};function Zn(){return er.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Qn(e,t){if(Zn()<t)throw new RangeError("Invalid typed array length");return er.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=er.prototype:(null===e&&(e=new er(t)),e.length=t),e}function er(e,t,n){if(!(er.TYPED_ARRAY_SUPPORT||this instanceof er))return new er(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return rr(this,e)}return tr(this,e,t,n)}function tr(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);er.TYPED_ARRAY_SUPPORT?(e=t).__proto__=er.prototype:e=ir(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!er.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|ar(t,n);e=Qn(e,r);var i=e.write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(sr(t)){var n=0|or(t.length);return 0===(e=Qn(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?Qn(e,0):ir(e,t);if("Buffer"===t.type&&Gn(t.data))return ir(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function nr(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function rr(e,t){if(nr(t),e=Qn(e,t<0?0:0|or(t)),!er.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function ir(e,t){var n=t.length<0?0:0|or(t.length);e=Qn(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function or(e){if(e>=Zn())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Zn().toString(16)+" bytes");return 0|e}function sr(e){return!(null==e||!e._isBuffer)}function ar(e,t){if(sr(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return jr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Lr(e).length;default:if(r)return jr(e).length;t=(""+t).toLowerCase(),r=!0}}function ur(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Or(this,t,n);case"utf8":case"utf-8":return wr(this,t,n);case"ascii":return Er(this,t,n);case"latin1":case"binary":return Ar(this,t,n);case"base64":return br(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _r(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function cr(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function lr(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=er.from(t,r)),sr(t))return 0===t.length?-1:fr(e,t,n,r,i);if("number"==typeof t)return t&=255,er.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):fr(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function fr(e,t,n,r,i){var o,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=n;o<a;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var f=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){f=!1;break}if(f)return o}return-1}function hr(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function dr(e,t,n,r){return Nr(jr(t,e.length-n),e,n,r)}function pr(e,t,n,r){return Nr(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function gr(e,t,n,r){return pr(e,t,n,r)}function yr(e,t,n,r){return Nr(Lr(t),e,n,r)}function mr(e,t,n,r){return Nr(function(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function br(e,t,n){return 0===t&&n===e.length?Wn(e):Wn(e.slice(t,n))}function wr(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,s,a,u,c=e[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=vr)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=vr));return n}(r)}er.TYPED_ARRAY_SUPPORT=void 0===Ct.TYPED_ARRAY_SUPPORT||Ct.TYPED_ARRAY_SUPPORT,Zn(),er.poolSize=8192,er._augment=function(e){return e.__proto__=er.prototype,e},er.from=function(e,t,n){return tr(null,e,t,n)},er.TYPED_ARRAY_SUPPORT&&(er.prototype.__proto__=Uint8Array.prototype,er.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&er[Symbol.species]),er.alloc=function(e,t,n){return function(e,t,n,r){return nr(t),t<=0?Qn(e,t):void 0!==n?"string"==typeof r?Qn(e,t).fill(n,r):Qn(e,t).fill(n):Qn(e,t)}(null,e,t,n)},er.allocUnsafe=function(e){return rr(null,e)},er.allocUnsafeSlow=function(e){return rr(null,e)},er.isBuffer=function(e){return null!=e&&(!!e._isBuffer||Fr(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Fr(e.slice(0,0))}(e))},er.compare=function(e,t){if(!sr(e)||!sr(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},er.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},er.concat=function(e,t){if(!Gn(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return er.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=er.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!sr(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},er.byteLength=ar,er.prototype._isBuffer=!0,er.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)cr(this,t,t+1);return this},er.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)cr(this,t,t+3),cr(this,t+1,t+2);return this},er.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)cr(this,t,t+7),cr(this,t+1,t+6),cr(this,t+2,t+5),cr(this,t+3,t+4);return this},er.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?wr(this,0,e):ur.apply(this,arguments)},er.prototype.equals=function(e){if(!sr(e))throw new TypeError("Argument must be a Buffer");return this===e||0===er.compare(this,e)},er.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},er.prototype.compare=function(e,t,n,r,i){if(!sr(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(r,i),c=e.slice(t,n),l=0;l<a;++l)if(u[l]!==c[l]){o=u[l],s=c[l];break}return o<s?-1:s<o?1:0},er.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},er.prototype.indexOf=function(e,t,n){return lr(this,e,t,n,!0)},er.prototype.lastIndexOf=function(e,t,n){return lr(this,e,t,n,!1)},er.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return hr(this,e,t,n);case"utf8":case"utf-8":return dr(this,e,t,n);case"ascii":return pr(this,e,t,n);case"latin1":case"binary":return gr(this,e,t,n);case"base64":return yr(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return mr(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},er.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var vr=4096;function Er(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function Ar(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function Or(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=Cr(e[o]);return i}function _r(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function Sr(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function Rr(e,t,n,r,i,o){if(!sr(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function xr(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Tr(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function kr(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Ur(e,t,n,r,i){return i||kr(e,0,n,4),Vn(e,t,n,r,23,4),n+4}function Br(e,t,n,r,i){return i||kr(e,0,n,8),Vn(e,t,n,r,52,8),n+8}er.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),er.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=er.prototype;else{var i=t-e;n=new er(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},er.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||Sr(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},er.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||Sr(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},er.prototype.readUInt8=function(e,t){return t||Sr(e,1,this.length),this[e]},er.prototype.readUInt16LE=function(e,t){return t||Sr(e,2,this.length),this[e]|this[e+1]<<8},er.prototype.readUInt16BE=function(e,t){return t||Sr(e,2,this.length),this[e]<<8|this[e+1]},er.prototype.readUInt32LE=function(e,t){return t||Sr(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},er.prototype.readUInt32BE=function(e,t){return t||Sr(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},er.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||Sr(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},er.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||Sr(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},er.prototype.readInt8=function(e,t){return t||Sr(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},er.prototype.readInt16LE=function(e,t){t||Sr(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},er.prototype.readInt16BE=function(e,t){t||Sr(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},er.prototype.readInt32LE=function(e,t){return t||Sr(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},er.prototype.readInt32BE=function(e,t){return t||Sr(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},er.prototype.readFloatLE=function(e,t){return t||Sr(e,4,this.length),Jn(this,e,!0,23,4)},er.prototype.readFloatBE=function(e,t){return t||Sr(e,4,this.length),Jn(this,e,!1,23,4)},er.prototype.readDoubleLE=function(e,t){return t||Sr(e,8,this.length),Jn(this,e,!0,52,8)},er.prototype.readDoubleBE=function(e,t){return t||Sr(e,8,this.length),Jn(this,e,!1,52,8)},er.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||Rr(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},er.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||Rr(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},er.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,1,255,0),er.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},er.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,2,65535,0),er.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):xr(this,e,t,!0),t+2},er.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,2,65535,0),er.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):xr(this,e,t,!1),t+2},er.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,4,4294967295,0),er.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Tr(this,e,t,!0),t+4},er.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,4,4294967295,0),er.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Tr(this,e,t,!1),t+4},er.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Rr(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},er.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Rr(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},er.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,1,127,-128),er.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},er.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,2,32767,-32768),er.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):xr(this,e,t,!0),t+2},er.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,2,32767,-32768),er.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):xr(this,e,t,!1),t+2},er.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,4,2147483647,-2147483648),er.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Tr(this,e,t,!0),t+4},er.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),er.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Tr(this,e,t,!1),t+4},er.prototype.writeFloatLE=function(e,t,n){return Ur(this,e,t,!0,n)},er.prototype.writeFloatBE=function(e,t,n){return Ur(this,e,t,!1,n)},er.prototype.writeDoubleLE=function(e,t,n){return Br(this,e,t,!0,n)},er.prototype.writeDoubleBE=function(e,t,n){return Br(this,e,t,!1,n)},er.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!er.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},er.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!er.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=sr(e)?e:jr(new er(e,r).toString()),a=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var Pr=/[^+\/0-9A-Za-z-_]/g;function Cr(e){return e<16?"0"+e.toString(16):e.toString(16)}function jr(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Lr(e){return function(e){var t,n,r,i,o,s;qn||Hn();var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[a-2]?2:"="===e[a-1]?1:0,s=new Dn(3*a/4-o),r=o>0?a-4:a;var u=0;for(t=0,n=0;t<r;t+=4,n+=3)i=zn[e.charCodeAt(t)]<<18|zn[e.charCodeAt(t+1)]<<12|zn[e.charCodeAt(t+2)]<<6|zn[e.charCodeAt(t+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=zn[e.charCodeAt(t)]<<2|zn[e.charCodeAt(t+1)]>>4,s[u++]=255&i):1===o&&(i=zn[e.charCodeAt(t)]<<10|zn[e.charCodeAt(t+1)]<<4|zn[e.charCodeAt(t+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Pr,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Nr(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Fr(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function $r(e,t,n,r,i){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),i&&(this.response=i,this.status=i.status?i.status:null)}In.inherits($r,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:In.toJSONObject(this.config),code:this.code,status:this.status}}});const Ir=$r.prototype,Mr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Mr[e]={value:e}}),Object.defineProperties($r,Mr),Object.defineProperty(Ir,"isAxiosError",{value:!0}),$r.from=(e,t,n,r,i,o)=>{const s=Object.create(Ir);In.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",u=null==t&&e?e.code:t;return $r.call(s,a,u,n,r,i),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",o&&Object.assign(s,o),s};function zr(e){return In.isPlainObject(e)||In.isArray(e)}function Dr(e){return In.endsWith(e,"[]")?e.slice(0,-2):e}function qr(e,t,n){return e?e.concat(t).map(function(e,t){return e=Dr(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Hr=In.toFlatObject(In,{},null,function(e){return/^is[A-Z]/.test(e)});function Yr(e,t,n){if(!In.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=In.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!In.isUndefined(t[e])})).metaTokens,i=n.visitor||c,o=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&In.isSpecCompliantForm(t);if(!In.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(In.isDate(e))return e.toISOString();if(In.isBoolean(e))return e.toString();if(!a&&In.isBlob(e))throw new $r("Blob is not supported. Use a Buffer instead.");return In.isArrayBuffer(e)||In.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):er.from(e):e}function c(e,n,i){let a=e;if(e&&!i&&"object"==typeof e)if(In.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(In.isArray(e)&&function(e){return In.isArray(e)&&!e.some(zr)}(e)||(In.isFileList(e)||In.endsWith(n,"[]"))&&(a=In.toArray(e)))return n=Dr(n),a.forEach(function(e,r){!In.isUndefined(e)&&null!==e&&t.append(!0===s?qr([n],r,o):null===s?n:n+"[]",u(e))}),!1;return!!zr(e)||(t.append(qr(i,n,o),u(e)),!1)}const l=[],f=Object.assign(Hr,{defaultVisitor:c,convertValue:u,isVisitable:zr});if(!In.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!In.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),In.forEach(n,function(n,o){!0===(!(In.isUndefined(n)||null===n)&&i.call(t,n,In.isString(o)?o.trim():o,r,f))&&e(n,r?r.concat(o):[o])}),l.pop()}}(e),t}function Kr(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Wr(e,t){this._pairs=[],e&&Yr(e,this,t)}const Jr=Wr.prototype;function Vr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Xr(e,t,n){if(!t)return e;const r=n&&n.encode||Vr;In.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(o=i?i(t,n):In.isURLSearchParams(t)?t.toString():new Wr(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}Jr.append=function(e,t){this._pairs.push([e,t])},Jr.toString=function(e){const t=e?function(t){return e.call(this,t,Kr)}:Kr;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class Gr{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){In.forEach(this.handlers,function(t){null!==t&&e(t)})}}var Zr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Qr={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Wr,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ei="undefined"!=typeof window&&"undefined"!=typeof document,ti="object"==typeof navigator&&navigator||void 0,ni=ei&&(!ti||["ReactNative","NativeScript","NS"].indexOf(ti.product)<0),ri="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ii=ei&&window.location.href||"http://localhost";var oi={...Object.freeze({__proto__:null,hasBrowserEnv:ei,hasStandardBrowserEnv:ni,hasStandardBrowserWebWorkerEnv:ri,navigator:ti,origin:ii}),...Qr};function si(e){function t(e,n,r,i){let o=e[i++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),a=i>=e.length;if(o=!o&&In.isArray(r)?r.length:o,a)return In.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!s;r[o]&&In.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],i)&&In.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}(r[o])),!s}if(In.isFormData(e)&&In.isFunction(e.entries)){const n={};return In.forEachEntry(e,(e,r)=>{t(function(e){return In.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const ai={transitional:Zr,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=In.isObject(e);i&&In.isHTMLForm(e)&&(e=new FormData(e));if(In.isFormData(e))return r?JSON.stringify(si(e)):e;if(In.isArrayBuffer(e)||In.isBuffer(e)||In.isStream(e)||In.isFile(e)||In.isBlob(e)||In.isReadableStream(e))return e;if(In.isArrayBufferView(e))return e.buffer;if(In.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Yr(e,new oi.classes.URLSearchParams,{visitor:function(e,t,n,r){return oi.isNode&&In.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=In.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Yr(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(In.isString(e))try{return(t||JSON.parse)(e),In.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ai.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(In.isResponse(e)||In.isReadableStream(e))return e;if(e&&In.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw $r.from(e,$r.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:oi.classes.FormData,Blob:oi.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};In.forEach(["delete","get","head","post","put","patch"],e=>{ai.headers[e]={}});const ui=In.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ci=Symbol("internals");function li(e){return e&&String(e).trim().toLowerCase()}function fi(e){return!1===e||null==e?e:In.isArray(e)?e.map(fi):String(e)}function hi(e,t,n,r,i){return In.isFunction(r)?r.call(this,t,n):(i&&(t=n),In.isString(t)?In.isString(r)?-1!==t.indexOf(r):In.isRegExp(r)?r.test(t):void 0:void 0)}let di=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=li(t);if(!i)throw new Error("header name must be a non-empty string");const o=In.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=fi(e))}const o=(e,t)=>In.forEach(e,(e,n)=>i(e,n,t));if(In.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(In.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&ui[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(In.isObject(e)&&In.isIterable(e)){let n,r,i={};for(const t of e){if(!In.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?In.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=li(e)){const n=In.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(In.isFunction(t))return t.call(this,e,n);if(In.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=li(e)){const n=In.findKey(this,e);return!(!n||void 0===this[n]||t&&!hi(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=li(e)){const i=In.findKey(n,e);!i||t&&!hi(0,n[i],i,t)||(delete n[i],r=!0)}}return In.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!hi(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return In.forEach(this,(r,i)=>{const o=In.findKey(n,i);if(o)return t[o]=fi(r),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();s!==i&&delete t[i],t[s]=fi(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return In.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&In.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[ci]=this[ci]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=li(e);t[r]||(!function(e,t){const n=In.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return In.isArray(e)?e.forEach(r):r(e),this}};function pi(e,t){const n=this||ai,r=t||n,i=di.from(r.headers);let o=r.data;return In.forEach(e,function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function gi(e){return!(!e||!e.__CANCEL__)}function yi(e,t,n){$r.call(this,null==e?"canceled":e,$r.ERR_CANCELED,t,n),this.name="CanceledError"}function mi(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new $r("Request failed with status code "+n.status,[$r.ERR_BAD_REQUEST,$r.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}di.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),In.reduceDescriptors(di.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),In.freezeMethods(di),In.inherits(yi,$r,{__CANCEL__:!0});const bi=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const u=Date.now(),c=r[s];i||(i=u),n[o]=a,r[o]=u;let l=s,f=0;for(;l!==o;)f+=n[l++],l%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),u-i<t)return;const h=c&&u-c;return h?Math.round(1e3*f/h):void 0}}(50,250);return function(e,t){let n,r,i=0,o=1e3/t;const s=(t,o=Date.now())=>{i=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-i;a>=o?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},o-a)))},()=>n&&s(n)]}(n=>{const o=n.loaded,s=n.lengthComputable?n.total:void 0,a=o-r,u=i(a);r=o;e({loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:u||void 0,estimated:u&&s&&o<=s?(s-o)/u:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},wi=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},vi=e=>(...t)=>In.asap(()=>e(...t));var Ei=oi.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,oi.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(oi.origin),oi.navigator&&/(msie|trident)/i.test(oi.navigator.userAgent)):()=>!0,Ai=oi.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const s=[e+"="+encodeURIComponent(t)];In.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),In.isString(r)&&s.push("path="+r),In.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Oi(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const _i=e=>e instanceof di?{...e}:e;function Si(e,t){t=t||{};const n={};function r(e,t,n,r){return In.isPlainObject(e)&&In.isPlainObject(t)?In.merge.call({caseless:r},e,t):In.isPlainObject(t)?In.merge({},t):In.isArray(t)?t.slice():t}function i(e,t,n,i){return In.isUndefined(t)?In.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function o(e,t){if(!In.isUndefined(t))return r(void 0,t)}function s(e,t){return In.isUndefined(t)?In.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}const u={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>i(_i(e),_i(t),0,!0)};return In.forEach(Object.keys({...e,...t}),function(r){const o=u[r]||i,s=o(e[r],t[r],r);In.isUndefined(s)&&o!==a||(n[r]=s)}),n}var Ri=e=>{const t=Si({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;if(t.headers=s=di.from(s),t.url=Xr(Oi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),In.isFormData(n))if(oi.hasStandardBrowserEnv||oi.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(In.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(oi.hasStandardBrowserEnv&&(r&&In.isFunction(r)&&(r=r(t)),r||!1!==r&&Ei(t.url))){const e=i&&o&&Ai.read(o);e&&s.set(i,e)}return t};var xi="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Ri(e);let i=r.data;const o=di.from(r.headers).normalize();let s,a,u,c,l,{responseType:f,onUploadProgress:h,onDownloadProgress:d}=r;function p(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let g=new XMLHttpRequest;function y(){if(!g)return;const r=di.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());mi(function(e){t(e),p()},function(e){n(e),p()},{data:f&&"text"!==f&&"json"!==f?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(y)},g.onabort=function(){g&&(n(new $r("Request aborted",$r.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=new $r(t&&t.message?t.message:"Network Error",$r.ERR_NETWORK,e,g);r.event=t||null,n(r),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||Zr;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new $r(t,i.clarifyTimeoutError?$r.ETIMEDOUT:$r.ECONNABORTED,e,g)),g=null},void 0===i&&o.setContentType(null),"setRequestHeader"in g&&In.forEach(o.toJSON(),function(e,t){g.setRequestHeader(t,e)}),In.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),f&&"json"!==f&&(g.responseType=r.responseType),d&&([u,l]=bi(d,!0),g.addEventListener("progress",u)),h&&g.upload&&([a,c]=bi(h),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(s=t=>{g&&(n(!t||t.type?new yi(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const m=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);m&&-1===oi.protocols.indexOf(m)?n(new $r("Unsupported protocol "+m+":",$r.ERR_BAD_REQUEST,e)):g.send(i||null)})};const Ti=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof $r?t:new yi(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,i(new $r(`timeout ${t} of ms exceeded`,$r.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:a}=r;return a.unsubscribe=()=>In.asap(s),a}},ki=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},Ui=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Bi=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of Ui(e))yield*ki(n,t)}(e,t);let o,s=0,a=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return a(),void e.close();let o=r.byteLength;if(n){let e=s+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),i.return())},{highWaterMark:2})},{isFunction:Pi}=In,Ci=(({Request:e,Response:t})=>({Request:e,Response:t}))(In.global),{ReadableStream:ji,TextEncoder:Li}=In.global,Ni=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Fi=e=>{e=In.merge.call({skipUndefined:!0},Ci,e);const{fetch:t,Request:n,Response:r}=e,i=t?Pi(t):"function"==typeof fetch,o=Pi(n),s=Pi(r);if(!i)return!1;const a=i&&Pi(ji),u=i&&("function"==typeof Li?(e=>t=>e.encode(t))(new Li):async e=>new Uint8Array(await new n(e).arrayBuffer())),c=o&&a&&Ni(()=>{let e=!1;const t=new n(oi.origin,{body:new ji,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),l=s&&a&&Ni(()=>In.isReadableStream(new r("").body)),f={stream:l&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new $r(`Response type '${e}' is not supported`,$r.ERR_NOT_SUPPORT,n)})});const h=async(e,t)=>{const r=In.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(In.isBlob(e))return e.size;if(In.isSpecCompliantForm(e)){const t=new n(oi.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return In.isArrayBufferView(e)||In.isArrayBuffer(e)?e.byteLength:(In.isURLSearchParams(e)&&(e+=""),In.isString(e)?(await u(e)).byteLength:void 0)})(t):r};return async e=>{let{url:i,method:s,data:a,signal:u,cancelToken:d,timeout:p,onDownloadProgress:g,onUploadProgress:y,responseType:m,headers:b,withCredentials:w="same-origin",fetchOptions:v}=Ri(e),E=t||fetch;m=m?(m+"").toLowerCase():"text";let A=Ti([u,d&&d.toAbortSignal()],p),O=null;const _=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let S;try{if(y&&c&&"get"!==s&&"head"!==s&&0!==(S=await h(b,a))){let e,t=new n(i,{method:"POST",body:a,duplex:"half"});if(In.isFormData(a)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,n]=wi(S,bi(vi(y)));a=Bi(t.body,65536,e,n)}}In.isString(w)||(w=w?"include":"omit");const t=o&&"credentials"in n.prototype,u={...v,signal:A,method:s.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};O=o&&new n(i,u);let d=await(o?E(O,v):E(i,u));const p=l&&("stream"===m||"response"===m);if(l&&(g||p&&_)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=d[t]});const t=In.toFiniteNumber(d.headers.get("content-length")),[n,i]=g&&wi(t,bi(vi(g),!0))||[];d=new r(Bi(d.body,65536,n,()=>{i&&i(),_&&_()}),e)}m=m||"text";let R=await f[In.findKey(f,m)||"text"](d,e);return!p&&_&&_(),await new Promise((t,n)=>{mi(t,n,{data:R,headers:di.from(d.headers),status:d.status,statusText:d.statusText,config:e,request:O})})}catch(t){if(_&&_(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new $r("Network Error",$r.ERR_NETWORK,e,O),{cause:t.cause||t});throw $r.from(t,t&&t.code,e,O)}}},$i=new Map,Ii=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let s,a,u=o.length,c=$i;for(;u--;)s=o[u],a=c.get(s),void 0===a&&c.set(s,a=u?new Map:Fi(t)),c=a;return a};Ii();const Mi={http:null,xhr:xi,fetch:{get:Ii}};In.forEach(Mi,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const zi=e=>`- ${e}`,Di=e=>In.isFunction(e)||null===e||!1===e;var qi=(e,t)=>{e=In.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let s=0;s<n;s++){let n;if(r=e[s],i=r,!Di(r)&&(i=Mi[(n=String(r)).toLowerCase()],void 0===i))throw new $r(`Unknown adapter '${n}'`);if(i&&(In.isFunction(i)||(i=i.get(t))))break;o[n||"#"+s]=i}if(!i){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new $r("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(zi).join("\n"):" "+zi(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return i};function Hi(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yi(null,e)}function Yi(e){Hi(e),e.headers=di.from(e.headers),e.data=pi.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return qi(e.adapter||ai.adapter,e)(e).then(function(t){return Hi(e),t.data=pi.call(e,e.transformResponse,t),t.headers=di.from(t.headers),t},function(t){return gi(t)||(Hi(e),t&&t.response&&(t.response.data=pi.call(e,e.transformResponse,t.response),t.response.headers=di.from(t.response.headers))),Promise.reject(t)})}const Ki="1.12.2",Wi={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wi[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ji={};Wi.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Ki+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new $r(r(i," has been removed"+(t?" in "+t:"")),$r.ERR_DEPRECATED);return t&&!Ji[i]&&(Ji[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},Wi.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Vi={assertOptions:function(e,t,n){if("object"!=typeof e)throw new $r("options must be an object",$r.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new $r("option "+o+" must be "+n,$r.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new $r("Unknown option "+o,$r.ERR_BAD_OPTION)}},validators:Wi};const Xi=Vi.validators;let Gi=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Gr,response:new Gr}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Si(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Vi.assertOptions(n,{silentJSONParsing:Xi.transitional(Xi.boolean),forcedJSONParsing:Xi.transitional(Xi.boolean),clarifyTimeoutError:Xi.transitional(Xi.boolean)},!1),null!=r&&(In.isFunction(r)?t.paramsSerializer={serialize:r}:Vi.assertOptions(r,{encode:Xi.function,serialize:Xi.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Vi.assertOptions(t,{baseUrl:Xi.spelling("baseURL"),withXsrfToken:Xi.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&In.merge(i.common,i[t.method]);i&&In.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=di.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const u=[];let c;this.interceptors.response.forEach(function(e){u.push(e.fulfilled,e.rejected)});let l,f=0;if(!a){const e=[Yi.bind(this),void 0];for(e.unshift(...s),e.push(...u),l=e.length,c=Promise.resolve(t);f<l;)c=c.then(e[f++],e[f++]);return c}l=s.length;let h=t;for(;f<l;){const e=s[f++],t=s[f++];try{h=e(h)}catch(e){t.call(this,e);break}}try{c=Yi.call(this,h)}catch(e){return Promise.reject(e)}for(f=0,l=u.length;f<l;)c=c.then(u[f++],u[f++]);return c}getUri(e){return Xr(Oi((e=Si(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};In.forEach(["delete","get","head","options"],function(e){Gi.prototype[e]=function(t,n){return this.request(Si(n||{},{method:e,url:t,data:(n||{}).data}))}}),In.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,i){return this.request(Si(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Gi.prototype[e]=t(),Gi.prototype[e+"Form"]=t(!0)});const Zi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Zi).forEach(([e,t])=>{Zi[t]=e});const Qi=function e(t){const n=new Gi(t),r=Jt(Gi.prototype.request,n);return In.extend(r,Gi.prototype,n,{allOwnKeys:!0}),In.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Si(t,n))},r}(ai);Qi.Axios=Gi,Qi.CanceledError=yi,Qi.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new yi(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},Qi.isCancel=gi,Qi.VERSION=Ki,Qi.toFormData=Yr,Qi.AxiosError=$r,Qi.Cancel=Qi.CanceledError,Qi.all=function(e){return Promise.all(e)},Qi.spread=function(e){return function(t){return e.apply(null,t)}},Qi.isAxiosError=function(e){return In.isObject(e)&&!0===e.isAxiosError},Qi.mergeConfig=Si,Qi.AxiosHeaders=di,Qi.formToJSON=e=>si(In.isHTMLForm(e)?new FormData(e):e),Qi.getAdapter=qi,Qi.HttpStatusCode=Zi,Qi.default=Qi;const{Axios:eo,AxiosError:to,CanceledError:no,isCancel:ro,CancelToken:io,VERSION:oo,all:so,Cancel:ao,isAxiosError:uo,spread:co,toFormData:lo,AxiosHeaders:fo,HttpStatusCode:ho,formToJSON:po,getAdapter:go,mergeConfig:yo}=Qi;class mo{constructor(){this.promiseWrapper=new Promise((e,t)=>{this._resolve=e,this._reject=t}),this._restScope=["success","failure","error","login","timeout"];for(let e=0;e<this._restScope.length;e++){const t=this._restScope[e];t&&(this.promiseWrapper[t]=e=>{"function"==typeof e&&(this[`_${t}`]=e);const n=this.promiseWrapper;delete n[t];const r=this._restScope.slice();return r.splice(r.indexOf(t),1),r.every(e=>!!e&&!n[e])&&delete n.rest,n})}this.promiseWrapper.rest=(e,t)=>{"function"==typeof e&&(this._rest=e);const n=this.promiseWrapper;if(delete n.rest,this._restScope=t||this._restScope,0===this._restScope.length)console.warn('[1Money SDK]: The ".rest(cb, scope)" scope is empty and will never be triggered!');else{let e=0;this._restScope.forEach(t=>{t&&(n[t]?delete n[t]:e++)}),e===this._restScope.length&&console.warn(`[1Money SDK]: The "${this._restScope.join(", ")}" had been called and the "rest" will never be triggered!`)}return n}}}const bo=new class{constructor(e){this._config=e||{},this.axios=Qi,this.parseError=this.parseError.bind(this),this.setting=this.setting.bind(this),this.request=this.request.bind(this)}parseError(e){var t,n,r,i,o,s,a,u,c;"string"==typeof e&&(e=new Error(e)),(!e||"object"!==Bt(e)&&"error"!==Bt(e))&&(e=new Error("Unknown error occurred"));const l=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"Error",f=null!==(i=null!==(n=null==e?void 0:e.message)&&void 0!==n?n:null===(r=null==e?void 0:e.toString)||void 0===r?void 0:r.call(e))&&void 0!==i?i:"Unknown error",h=null!==(o=null==e?void 0:e.stack)&&void 0!==o?o:"",d=null!==(a=null===(s=null==e?void 0:e.response)||void 0===s?void 0:s.status)&&void 0!==a?a:500,p=null!==(c=null===(u=null==e?void 0:e.response)||void 0===u?void 0:u.data)&&void 0!==c?c:void 0;return"number"!=typeof d||d<100||d>599?{name:"InvalidStatusError",message:"Invalid HTTP status code",stack:h,status:500,data:p}:{name:l,message:f,stack:h,status:d,data:p}}mergeSignals(...e){const t=new AbortController,n=()=>t.abort(),r=[];for(const i of e){if(i.aborted){t.abort();break}i.addEventListener("abort",n),r.push(()=>i.removeEventListener("abort",n))}return{signal:t.signal,cleanup:()=>r.forEach(e=>e())}}setting(e){if(!e)return console.warn("[1Money SDK]: setting method required correct parameters!");this._config=Object.assign(Object.assign({},this._config),e)}request(e){e.withCredentials="boolean"!=typeof e.withCredentials||e.withCredentials,e.headers=Object.assign(Object.assign(Object.assign({},this.axios.defaults.headers.common),e.method?this.axios.defaults.headers[e.method]:{}),e.headers),e.headers.Accept=e.headers.Accept||"*/*",e.headers["X-Requested-With"]=e.headers["X-Requested-With"]||"XMLHttpRequest",e.headers["X-Content-Type-Options"]=e.headers["X-Content-Type-Options"]||"nosniff";const{onSuccess:n,onFailure:r,onLogin:i,onError:o,onTimeout:s,isSuccess:a,isLogin:u,timeout:c}=this._config,{onSuccess:l,onFailure:f,onLogin:h,onError:d,onTimeout:p,isSuccess:g,isLogin:y,timeout:m}=e,b={success:null!=g?g:a,login:null!=y?y:u},w=new mo;return Promise.resolve().then(()=>{var a,u,g,y,v,E,A,O,_,S,R,x,T,k,U,B,P,C,j,L;const N={success:null!==(y=null!==(g=null!==(u=null!==(a=w._success)&&void 0!==a?a:~w._restScope.indexOf("success")?w._rest:void 0)&&void 0!==u?u:l)&&void 0!==g?g:n)&&void 0!==y?y:(e,t)=>e,failure:null!==(O=null!==(A=null!==(E=null!==(v=w._failure)&&void 0!==v?v:~w._restScope.indexOf("failure")?w._rest:void 0)&&void 0!==E?E:f)&&void 0!==A?A:r)&&void 0!==O?O:(e,t)=>e,error:null!==(x=null!==(R=null!==(S=null!==(_=w._error)&&void 0!==_?_:~w._restScope.indexOf("error")?w._rest:void 0)&&void 0!==S?S:d)&&void 0!==R?R:o)&&void 0!==x?x:(e,t)=>e,login:null!==(B=null!==(U=null!==(k=null!==(T=w._login)&&void 0!==T?T:~w._restScope.indexOf("login")?w._rest:void 0)&&void 0!==k?k:h)&&void 0!==U?U:i)&&void 0!==B?B:(e,t)=>e,timeout:null!==(L=null!==(j=null!==(C=null!==(P=w._timeout)&&void 0!==P?P:~w._restScope.indexOf("timeout")?w._rest:void 0)&&void 0!==C?C:p)&&void 0!==j?j:s)&&void 0!==L?L:(e,t)=>e},F=(w._success||w._rest&&w._restScope.indexOf("success"),w._failure||w._rest&&w._restScope.indexOf("failure"),w._login||w._rest&&w._restScope.indexOf("login"),!!(w._error||w._rest&&~w._restScope.indexOf("error")||d||o)),$=!!(w._timeout||w._rest&&~w._restScope.indexOf("timeout")||p||s),I=!!(w._success||w._rest&&~w._restScope.indexOf("success")),M=!!(w._failure||w._rest&&~w._restScope.indexOf("failure")),z=!!(w._login||w._rest&&~w._restScope.indexOf("login")),D=!!(w._error||w._rest&&~w._restScope.indexOf("error")),q=!!(w._timeout||w._rest&&~w._restScope.indexOf("timeout")),H=(e,n)=>t(this,void 0,void 0,function*(){try{let t=this.parseError(e);const r=yield Promise.resolve(N.error(t,n));D&&(t=r),F?w._resolve(t):w._reject(t)}catch(e){w._reject(this.parseError(e))}});let Y=null,K=!1;const W=null!=m?m:c,J=new AbortController;let V=null;if(e.signal){const t=this.mergeSignals(e.signal,J.signal);e.signal=t.signal,V=t.cleanup}else e.signal=J.signal;const X=()=>{null!==Y&&(clearTimeout(Y),Y=null),V&&(V(),V=null)};W&&(Y=setTimeout(()=>t(this,void 0,void 0,function*(){var t,n;try{K=!0,X(),J.abort();let n=this.parseError("timeout");const r=yield Promise.resolve(N.timeout(n,null!==(t=e.headers)&&void 0!==t?t:{}));q&&(n=r),$?w._resolve(n):w._reject(n)}catch(t){H(t,null!==(n=e.headers)&&void 0!==n?n:{})}}),W)),this.axios(e).then(e=>t(this,void 0,void 0,function*(){var t,n;if(K)return;X();const{status:r,data:i,headers:o}=e;try{const e=null===(t=b.success)||void 0===t?void 0:t.call(b,i,r,o),s=null===(n=b.login)||void 0===n?void 0:n.call(b,i,r,o);let a=i;if(s){const e=yield Promise.resolve(N.login(i,o));z&&(a=e)}else if(e){const e=yield Promise.resolve(N.success(i,o));I&&(a=e)}else{const e=yield Promise.resolve(N.failure(i,o));M&&(a=e)}w._resolve(a)}catch(e){H(e,o)}})).catch(e=>t(this,void 0,void 0,function*(){var t,n,r,i,o,s,a,u,c,l,f,h,d,p,g,y,m,v;if(K)return;X();const E=null!==(n=null===(t=e.response)||void 0===t?void 0:t.data)&&void 0!==n?n:{};console.error(`[1Money SDK]: Error(${null!==(r=e.status)&&void 0!==r?r:500}, ${null!==(i=e.code)&&void 0!==i?i:"UNKNOWN"}), Message: ${e.message}, Config: ${null===(o=e.config)||void 0===o?void 0:o.method}, ${null!==(a=null===(s=e.config)||void 0===s?void 0:s.baseURL)&&void 0!==a?a:""}, ${null!==(c=null===(u=e.config)||void 0===u?void 0:u.url)&&void 0!==c?c:""}, ${JSON.stringify(null!==(f=null===(l=e.config)||void 0===l?void 0:l.headers)&&void 0!==f?f:{})}, Request: ${JSON.stringify(null!==(d=null===(h=e.config)||void 0===h?void 0:h.data)&&void 0!==d?d:{})}, Response: ${JSON.stringify(E)};`);const A=null!==(g=null===(p=e.response)||void 0===p?void 0:p.status)&&void 0!==g?g:500,O=null!==(m=null===(y=e.response)||void 0===y?void 0:y.headers)&&void 0!==m?m:{};try{let t=E;(null===(v=b.login)||void 0===v?void 0:v.call(b,E,A,O))?(t=yield Promise.resolve(N.login(t,O)),w._resolve(t)):H(e,O)}catch(e){H(e,O)}}))}),w.promiseWrapper}}({isSuccess:(e,t)=>200===t&&0==e.code,isLogin:(e,t)=>401===t||401==e.code,timeout:1e4});function wo(e,t){return bo.request(Object.assign(Object.assign({},t),{method:"get",url:e}))}function vo(e,t,n){return bo.request(Object.assign(Object.assign({},n),{method:"post",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))}function Eo(e){const{baseURL:t,headers:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["baseURL","headers"]);bo.axios.defaults.baseURL=t||("undefined"!=typeof window?location.origin:void 0),n&&(bo.axios.defaults.headers.common=Object.assign(Object.assign({},bo.axios.defaults.headers.common),n)),bo.setting(r)}var Ao={get:wo,post:vo,postForm:function(e,t,n){return bo.request(Object.assign(Object.assign({},n),{method:"post",url:e,data:t,headers:Object.assign({"Content-Type":"multipart/form-data"},null==n?void 0:n.headers)}))},del:function(e,t,n){return bo.request(Object.assign(Object.assign({},n),{method:"delete",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},put:function(e,t,n){return bo.request(Object.assign(Object.assign({},n),{method:"put",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},patch:function(e,t,n){return bo.request(Object.assign(Object.assign({},n),{method:"patch",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},setInitConfig:Eo,axiosStatic:bo.axios};const Oo="https://api.1money.network",_o="v1",So=`/${_o}/accounts`,Ro={getNonce:e=>wo(`${So}/nonce?address=${e}`,{withCredentials:!1}),getBbNonce:e=>wo(`${So}/bbnonce?address=${e}`,{withCredentials:!1}),getTokenAccount:(e,t)=>wo(`${So}/token_account?address=${e}&token=${t}`,{withCredentials:!1})},xo=`/${_o}/checkpoints`,To={getNumber:()=>wo(`${xo}/number`,{withCredentials:!1}),getByHash:(e,t=!1)=>wo(`${xo}/by_hash?hash=${e}&full=${t}`,{withCredentials:!1}),getByNumber:(e,t=!1)=>wo(`${xo}/by_number?number=${e}&full=${t}`,{withCredentials:!1}),getReceiptsByNumber:e=>wo(`${xo}/receipts/by_number?number=${e}`,{withCredentials:!1})},ko=`/${_o}/tokens`,Uo={getTokenMetadata:e=>wo(`${ko}/token_metadata?token=${e}`,{withCredentials:!1}),manageBlacklist:e=>vo(`${ko}/manage_blacklist`,e,{withCredentials:!1}),manageWhitelist:e=>vo(`${ko}/manage_whitelist`,e,{withCredentials:!1}),burnToken:e=>vo(`${ko}/burn`,e,{withCredentials:!1}),grantAuthority:e=>vo(`${ko}/grant_authority`,e,{withCredentials:!1}),issueToken:e=>vo(`${ko}/issue`,e,{withCredentials:!1}),mintToken:e=>vo(`${ko}/mint`,e,{withCredentials:!1}),pauseToken:e=>vo(`${ko}/pause`,e,{withCredentials:!1}),updateMetadata:e=>vo(`${ko}/update_metadata`,e,{withCredentials:!1}),bridgeAndMint:e=>vo(`${ko}/bridge_and_mint`,e,{withCredentials:!1}),burnAndBridge:e=>vo(`${ko}/burn_and_bridge`,e,{withCredentials:!1}),clawbackToken:e=>vo(`${ko}/clawback`,e,{withCredentials:!1})},Bo=`/${_o}/transactions`,Po={getByHash:e=>wo(`${Bo}/by_hash?hash=${e}`,{withCredentials:!1}),getReceiptByHash:e=>wo(`${Bo}/receipt/by_hash?hash=${e}`,{withCredentials:!1}),getFinalizedByHash:e=>wo(`${Bo}/finalized/by_hash?hash=${e}`,{withCredentials:!1}),estimateFee:(e,t,n,r)=>wo(`${Bo}/estimate_fee?from=${e}&value=${n}&to=${t}&token=${r}`,{withCredentials:!1}),payment:e=>vo(`${Bo}/payment`,e,{withCredentials:!1})},Co=`/${_o}/chains`,jo={getChainId:()=>wo(`${Co}/chain_id`,{withCredentials:!1})};var Lo,No,Fo,$o;function Io(e){const t=(null==e?void 0:e.network)||"mainnet";let n=Oo;switch(t){case"mainnet":n=Oo;break;case"testnet":n="https://api.testnet.1money.network";break;case"local":n="http://localhost:18555"}return Eo({baseURL:n,isSuccess:(e,t)=>200===t,timeout:(null==e?void 0:e.timeout)||1e4}),{accounts:Ro,checkpoints:To,tokens:Uo,transactions:Po,chain:jo}}!function(e){e.MasterMint="MasterMintBurn",e.MintBurnTokens="MintBurnTokens",e.Pause="Pause",e.ManageList="ManageList",e.UpdateMetadata="UpdateMetadata",e.Bridge="Bridge",e.Clawback="Clawback"}(Lo||(Lo={})),function(e){e.Grant="Grant",e.Revoke="Revoke"}(No||(No={})),function(e){e.Add="Add",e.Remove="Remove"}(Fo||(Fo={})),function(e){e.Pause="Pause",e.Unpause="Unpause"}($o||($o={}));const Mo=BigInt("0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0");function zo(e,t){return Q(we([ve(e),"boolean"==typeof t.v?t.v?Uint8Array.from([1]):new Uint8Array([]):BigInt(t.v),_(t.r),_(t.s)]))}function Do(e){const n=Q(e.rlpBytes),r=t=>(function(e){if(BigInt(e.s)>Mo)throw new Error("[1Money SDK]: Invalid signature - high S value detected (potential malleability)")}(t),{kind:e.kind,unsigned:e.unsigned,signatureHash:n,txHash:zo(e.rlpBytes,t),signature:t,toRequest:()=>e.toRequest(e.unsigned,t)});return{kind:e.kind,unsigned:e.unsigned,rlpBytes:e.rlpBytes,signatureHash:n,attachSignature:r,sign:e=>t(this,void 0,void 0,function*(){return r(yield e.signDigest(n))})}}const qo=/^\d+$/;function Ho(e,t){throw new Error(`[1Money SDK]: Invalid ${e}: ${String(t)}`)}function Yo(e,t){(!Number.isSafeInteger(t)||t<=0)&&Ho(e,t)}function Ko(e,t){(!Number.isSafeInteger(t)||t<0)&&Ho(e,t)}function Wo(e,t){qo.test(t)||Ho(e,t)}function Jo(e,t){ie(t)||Ho(e,t)}function Vo(e){Yo("chain_id",e.chain_id),Ko("nonce",e.nonce)}function Xo(e){Jo("recipient",e.recipient),Wo("value",e.value),Jo("token",e.token)}function Go(e){Wo("value",e.value),Jo("token",e.token)}function Zo(e){Vo(e),Xo(e);return Do({kind:"payment",unsigned:e,rlpBytes:Se(_e.list([_e.uint(e.chain_id),_e.uint(e.nonce),_e.address(e.recipient),_e.uint(e.value),_e.address(e.token)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function Qo(e){var t,n;Vo(e),Jo("authority_address",e.authority_address),Jo("token",e.token),t="value",void 0!==(n=e.value)&&Wo(t,n);const r=[_e.uint(e.chain_id),_e.uint(e.nonce),_e.string(e.action),_e.string(e.authority_type),_e.address(e.authority_address),_e.address(e.token)];void 0!==e.value&&r.push(_e.uint(e.value));return Do({kind:"tokenAuthority",unsigned:e,rlpBytes:Se(_e.list(r)),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function es(e){Vo(e),Xo(e),Yo("source_chain_id",e.source_chain_id);return Do({kind:"tokenBridgeAndMint",unsigned:e,rlpBytes:Se(_e.list([_e.uint(e.chain_id),_e.uint(e.nonce),_e.address(e.recipient),_e.uint(e.value),_e.address(e.token),_e.uint(e.source_chain_id),_e.string(e.source_tx_hash),_e.string(e.bridge_metadata)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function ts(e){Vo(e),Go(e);return Do({kind:"tokenBurn",unsigned:e,rlpBytes:Se(_e.list([_e.uint(e.chain_id),_e.uint(e.nonce),_e.uint(e.value),_e.address(e.token)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function ns(e){Vo(e),Jo("sender",e.sender),Go(e),Yo("destination_chain_id",e.destination_chain_id),Jo("destination_address",e.destination_address),Wo("escrow_fee",e.escrow_fee);return Do({kind:"tokenBurnAndBridge",unsigned:e,rlpBytes:Se(_e.list([_e.uint(e.chain_id),_e.uint(e.nonce),_e.address(e.sender),_e.uint(e.value),_e.address(e.token),_e.uint(e.destination_chain_id),_e.string(e.destination_address),_e.uint(e.escrow_fee),_e.string(e.bridge_metadata),_e.hex(e.bridge_param)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function rs(e){Vo(e),Xo(e),Jo("from",e.from);return Do({kind:"tokenClawback",unsigned:e,rlpBytes:Se(_e.list([_e.uint(e.chain_id),_e.uint(e.nonce),_e.address(e.token),_e.address(e.from),_e.address(e.recipient),_e.uint(e.value)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function is(e){var t;Vo(e),Ko("decimals",e.decimals),Jo("master_authority",e.master_authority);const n=null===(t=e.clawback_enabled)||void 0===t||t,r=Object.assign(Object.assign({},e),{clawback_enabled:n});return Do({kind:"tokenIssue",unsigned:r,rlpBytes:Se(_e.list([_e.uint(r.chain_id),_e.uint(r.nonce),_e.string(r.symbol),_e.string(r.name),_e.uint(r.decimals),_e.address(r.master_authority),_e.bool(r.is_private),_e.bool(n)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function os(e){Vo(e),Jo("address",e.address),Jo("token",e.token);return Do({kind:"tokenManageList",unsigned:e,rlpBytes:Se(_e.list([_e.uint(e.chain_id),_e.uint(e.nonce),_e.string(e.action),_e.address(e.address),_e.address(e.token)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function ss(e){Vo(e),Jo("token",e.token);const t=e.additional_metadata.map(e=>_e.list([_e.string(e.key),_e.string(e.value)]));return Do({kind:"tokenMetadata",unsigned:e,rlpBytes:Se(_e.list([_e.uint(e.chain_id),_e.uint(e.nonce),_e.string(e.name),_e.string(e.uri),_e.address(e.token),_e.list(t)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function as(e){Vo(e),Xo(e);return Do({kind:"tokenMint",unsigned:e,rlpBytes:Se(_e.list([_e.uint(e.chain_id),_e.uint(e.nonce),_e.address(e.recipient),_e.uint(e.value),_e.address(e.token)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function us(e){Vo(e),Jo("token",e.token);return Do({kind:"tokenPause",unsigned:e,rlpBytes:Se(_e.list([_e.uint(e.chain_id),_e.uint(e.nonce),_e.string(e.action),_e.address(e.token)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}const cs=/^0x[0-9a-fA-F]{64}$/;const ls={payment:Zo,tokenManageList:os,tokenBurn:ts,tokenAuthority:Qo,tokenIssue:is,tokenMint:as,tokenPause:us,tokenMetadata:ss,tokenBridgeAndMint:es,tokenBurnAndBridge:ns,tokenClawback:rs};var fs={api:Io,client:Ao};e.TransactionBuilder=ls,e._typeof=Bt,e.api=Io,e.calcSignedTxHash=zo,e.calcTxHash=function(e,t){const n=Pt(e),r=we("boolean"==typeof t.v?t.v?Uint8Array.from([1]):new Uint8Array([]):BigInt(t.v)),i=we(_(t.r)),o=we(_(t.s)),s=new Uint8Array(r.length+i.length+o.length);s.set(r,0),s.set(i,r.length),s.set(o,r.length+i.length);const a=function(e){if(e<56)return Uint8Array.from([192+e]);{const t=[];let n=e;for(;n>0;)t.unshift(255&n),n>>=8;return Uint8Array.from([247+t.length,...t])}}(n.length+s.length),u=new Uint8Array(a.length+n.length+s.length);return u.set(a,0),u.set(n,a.length),u.set(s,a.length+n.length),Q(u)},e.client=Ao,e.createPreparedTx=Do,e.createPrivateKeySigner=function(e){const n=_(e);return{signDigest:e=>t(this,void 0,void 0,function*(){if(!cs.test(e))throw new Error(`[1Money SDK]: Invalid digest: ${e}`);const t=yield _t(_(e),n,{lowS:!0}),r=t.toCompactRawBytes(),i=r.subarray(0,32),o=r.subarray(32,64);return{r:y(i),s:y(o),v:t.recovery}})}},e.default=fs,e.deriveTokenAddress=function(e,t){const n=e.startsWith("0x")?_(e):S(e),r=t.startsWith("0x")?_(t):S(t),i=new Uint8Array(n.length+r.length);return i.set(n,0),i.set(r,n.length),y(_(Q(i)).slice(12))},e.encodePayload=Pt,e.encodeRlpPayload=Se,e.preparePaymentTx=Zo,e.prepareTokenAuthorityTx=Qo,e.prepareTokenBridgeAndMintTx=es,e.prepareTokenBurnAndBridgeTx=ns,e.prepareTokenBurnTx=ts,e.prepareTokenClawbackTx=rs,e.prepareTokenIssueTx=is,e.prepareTokenManageListTx=os,e.prepareTokenMetadataTx=ss,e.prepareTokenMintTx=as,e.prepareTokenPauseTx=us,e.rlpValue=_e,e.safePromiseAll=function(e){return e&&e.length?Promise.all(e):Promise.resolve([])},e.safePromiseLine=function(e){return t(this,void 0,void 0,function*(){if(!e||!e.length)return[];const t=[];for(let n=0;n<e.length;n++)try{t.push(yield e[n](n))}catch(e){}return t})},e.signMessage=function(e,n){return t(this,void 0,void 0,function*(){const t=_(Q(Pt(e))),r=_(n),i=yield _t(t,r,{lowS:!0}),o=i.toCompactRawBytes(),s=o.subarray(0,32),a=o.subarray(32,64);return{r:y(s),s:y(a),v:i.recovery}})},e.toHex=function(e){const t=Bt(e);try{switch(t){case"boolean":return g(e);case"number":case"bigint":return m(e);case"string":if(/^-?\d+$/.test(e))try{return m(BigInt(e))}catch(t){return m(+e)}return w(e);case"uint8array":case"uint16array":case"uint32array":case"int8array":case"int16array":case"int32array":case"arraybuffer":return y(e);case"array":return 0===e.length?"0x":e.every(e=>"number"==typeof e)?y(Uint8Array.from(e)):y(S(JSON.stringify(e)));default:return y(S(JSON.stringify(e)))}}catch(e){return console.error("[1Money SDK]: toHex error:",e),"0x"}},Object.defineProperty(e,"__esModule",{value:!0})});
|
|
3
|
+
var o;this.state=new Uint8Array(200),this.state32=(o=this.state,new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)))}keccak(){C||L(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,i=(t+2)%10,o=n[i],s=n[i+1],a=J(o,s,1)^n[r],u=X(o,s,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=a,e[t+n+1]^=u}let t=e[2],i=e[3];for(let n=0;n<24;n++){const r=I[n],o=J(t,i,r),s=X(t,i,r),a=$[n];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=W[r],e[1]^=V[r]}n.fill(0)}(this.state32,this.rounds),C||L(this.state32),this.posOut=0,this.pos=0}update(e){T(this);const{blockLen:t,state:n}=this,r=(e=F(e)).length;for(let i=0;i<r;){const o=Math.min(t-this.pos,r-i);for(let t=0;t<o;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,128&t&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){T(this,!1),x(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return R(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(function(e,t){x(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return e||(e=new G(t,n,r,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Z=((e,t,n)=>function(e){const t=t=>e().update(F(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}(()=>new G(t,e,n)))(1,136,32);function Q(e,t){const r=t||"hex",i=Z(n(e,{strict:!1})?E(e):e);return"bytes"===r?i:function(e,t={}){return"number"==typeof e||"bigint"==typeof e?m(e,t):"string"==typeof e?w(e,t):"boolean"==typeof e?g(e,t):y(e,t)}(i)}class ee extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const e=this.keys().next().value;e&&this.delete(e)}return this}}const te=new ee(8192);const ne=/^0x[a-fA-F0-9]{40}$/,re=new ee(8192);function ie(e,t){const{strict:n=!0}={},r=`${e}.${n}`;if(re.has(r))return re.get(r);const i=!(!ne.test(e)||e.toLowerCase()!==e&&n&&function(e,t){if(te.has(`${e}.${t}`))return te.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=Q(S(n),"bytes"),i=n.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&i[e]&&(i[e]=i[e].toUpperCase()),(15&r[e>>1])>=8&&i[e+1]&&(i[e+1]=i[e+1].toUpperCase());const o=`0x${i.join("")}`;return te.set(`${e}.${t}`,o),o}(e)!==e);return re.set(r,i),i}class oe extends Error{constructor(e,t,n){super(t??e.code),this.type=e,void 0!==n&&(this.stack=n)}getMetadata(){return this.type}toObject(){return{type:this.getMetadata(),message:this.message??"",stack:this.stack??"",className:this.constructor.name}}}function se(e,t){return new oe({code:"ETHEREUMJS_DEFAULT_ERROR_CODE"},e,t)}function ae(e){if(0===e[0])throw se("invalid RLP: extra zeros");return function(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw se("Invalid byte sequence");return t}(function(e){let t="";for(let n=0;n<e.length;n++)t+=fe[e[n]];return t}(e))}function ue(e,t){if(e<56)return Uint8Array.from([e+t]);const n=ye(e),r=ye(t+55+n.length/2);return Uint8Array.from(pe(r+n))}function ce(e,t,n){if(n>e.length)throw se("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,n)}function le(e){let t,n,r,i,o;const s=[],a=e[0];if(a<=127)return{data:e.slice(0,1),remainder:e.subarray(1)};if(a<=183){if(t=a-127,r=128===a?Uint8Array.from([]):ce(e,1,t),2===t&&r[0]<128)throw se("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:r,remainder:e.subarray(t)}}if(a<=191){if(n=a-182,e.length-1<n)throw se("invalid RLP: not enough bytes for string length");if(t=ae(ce(e,1,n)),t<=55)throw se("invalid RLP: expected string length to be greater than 55");return r=ce(e,n,t+n),{data:r,remainder:e.subarray(t+n)}}if(a<=247){for(t=a-191,i=ce(e,1,t);i.length;)o=le(i),s.push(o.data),i=o.remainder;return{data:s,remainder:e.subarray(t)}}{if(n=a-246,t=ae(ce(e,1,n)),t<56)throw se("invalid RLP: encoded list too short");const r=n+t;if(r>e.length)throw se("invalid RLP: total length is larger than the data");for(i=ce(e,n,r);i.length;)o=le(i),s.push(o.data),i=o.remainder;return{data:s,remainder:e.subarray(r)}}}const fe=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const he={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function de(e){return e>=he._0&&e<=he._9?e-he._0:e>=he._A&&e<=he._F?e-(he._A-10):e>=he._a&&e<=he._f?e-(he._a-10):void 0}function pe(e){if("0x"===e.slice(0,2)&&(e=e.slice(0,2)),"string"!=typeof e)throw se("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw se("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=de(e.charCodeAt(i)),o=de(e.charCodeAt(i+1));if(void 0===n||void 0===o){throw se('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i)}r[t]=16*n+o}return r}function ge(...e){if(1===e.length)return e[0];const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n}function ye(e){if(e<0)throw se("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function me(e){return e.length>=2&&"0"===e[0]&&"x"===e[1]}function be(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return me(e)?pe((n="string"!=typeof(r=e)?r:me(r)?r.slice(2):r).length%2?`0${n}`:n):(t=e,(new TextEncoder).encode(t));var t,n,r;if("number"==typeof e||"bigint"==typeof e)return e?pe(ye(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw se("toBytes: received unsupported type "+typeof e)}function we(e){if(Array.isArray(e)){const t=[];let n=0;for(let r=0;r<e.length;r++){const i=we(e[r]);t.push(i),n+=i.length}return ge(ue(n,192),...t)}const t=be(e);return 1===t.length&&t[0]<128?t:ge(ue(t.length,128),t)}function ve(e,t=!1){if(null==e||0===e.length)return Uint8Array.from([]);const n=le(be(e));if(t)return{data:n.data,remainder:n.remainder.slice()};if(0!==n.remainder.length)throw se("invalid RLP: remainder must be zero");return n.data}const Ee=/^0x[0-9a-fA-F]{40}$/,Ae=/^0x([0-9a-fA-F]{2})*$/;function _e(e){if(null==e)return new Uint8Array([]);switch(e.kind){case"string":return(new TextEncoder).encode(e.value);case"uint":{if("string"==typeof e.value&&!/^\d+$/.test(e.value))throw new Error(`[1Money SDK]: Invalid uint string: ${e.value}`);const t="bigint"==typeof e.value?e.value:BigInt(e.value);return t===BigInt(0)?new Uint8Array([]):O(m(t))}case"bool":return e.value?Uint8Array.from([1]):new Uint8Array([]);case"bytes":return e.value;case"list":return e.value.map(e=>_e(e));case"address":case"hex":if(!Ae.test(e.value))throw new Error(`[1Money SDK]: Invalid hex value: ${e.value}`);if("address"===e.kind&&!Ee.test(e.value))throw new Error(`[1Money SDK]: Invalid address value: ${e.value}`);return"0x"===e.value?new Uint8Array([]):O(e.value)}}const Oe={address:e=>({kind:"address",value:e}),hex:e=>({kind:"hex",value:e}),string:e=>({kind:"string",value:e}),uint:e=>({kind:"uint",value:e}),bool:e=>({kind:"bool",value:e}),bytes:e=>({kind:"bytes",value:e}),list:e=>({kind:"list",value:e})};function Se(e){return we(_e(e))}/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */
|
|
4
|
+
const{p:Re,n:xe,Gx:Te,Gy:ke,b:Ue}={p:0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,n:0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,b:7n,Gx:0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,Gy:0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n},Be=32,Pe=64,Ce=(e="")=>{throw new Error(e)},je=e=>"bigint"==typeof e,Le=e=>"string"==typeof e,Fe=(e,t)=>!(e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name)(e)||"number"==typeof t&&t>0&&e.length!==t?Ce("Uint8Array expected"):e,Ne=e=>new Uint8Array(e),$e=(e,t)=>e.toString(16).padStart(t,"0"),Ie=e=>Array.from(Fe(e)).map(e=>$e(e,2)).join(""),Me=48,ze=57,De=65,qe=70,He=97,Ye=102,Ke=e=>e>=Me&&e<=ze?e-Me:e>=De&&e<=qe?e-(De-10):e>=He&&e<=Ye?e-(He-10):void 0,We=e=>{const t="hex invalid";if(!Le(e))return Ce(t);const n=e.length,r=n/2;if(n%2)return Ce(t);const i=Ne(r);for(let n=0,o=0;n<r;n++,o+=2){const r=Ke(e.charCodeAt(o)),s=Ke(e.charCodeAt(o+1));if(void 0===r||void 0===s)return Ce(t);i[n]=16*r+s}return i},Ve=(e,t)=>{return Fe(Le(e)?We(e):(n=Fe(e),Uint8Array.from(n)),t);var n},Je=()=>globalThis?.crypto,Xe=(...e)=>{const t=Ne(e.reduce((e,t)=>e+Fe(t).length,0));let n=0;return e.forEach(e=>{t.set(e,n),n+=e.length}),t},Ge=(e=Be)=>Je().getRandomValues(Ne(e)),Ze=BigInt,Qe=(e,t,n,r="bad number: out of range")=>je(e)&&t<=e&&e<n?e:Ce(r),et=(e,t=Re)=>{const n=e%t;return n>=0n?n:t+n},tt=e=>et(e,xe),nt=(e,t)=>{(0n===e||t<=0n)&&Ce("no inverse n="+e+" mod="+t);let n=et(e,t),r=t,i=0n,o=1n;for(;0n!==n;){const e=r%n,t=i-o*(r/n);r=n,n=e,i=o,o=t}return 1n===r?et(i,t):Ce("no inverse")},rt=e=>e instanceof ft?e:Ce("Point expected"),it=e=>et(et(e*e)*e+Ue),ot=e=>Qe(e,0n,Re),st=e=>Qe(e,1n,Re),at=e=>Qe(e,1n,xe),ut=e=>0n==(1n&e),ct=e=>Uint8Array.of(e),lt=e=>ct(ut(e)?2:3);class ft{static BASE;static ZERO;px;py;pz;constructor(e,t,n){this.px=ot(e),this.py=st(t),this.pz=ot(n),Object.freeze(this)}static fromBytes(e){let t;Fe(e);const n=e[0],r=e.subarray(1),i=gt(r,0,Be),o=e.length;if(33===o&&[2,3].includes(n)){let e=(e=>{const t=it(st(e));let n=1n;for(let e=t,r=(Re+1n)/4n;r>0n;r>>=1n)1n&r&&(n=n*e%Re),e=e*e%Re;return et(n*n)===t?n:Ce("sqrt invalid")})(i);const r=ut(e);ut(Ze(n))!==r&&(e=et(-e)),t=new ft(i,e,1n)}return 65===o&&4===n&&(t=new ft(i,gt(r,Be,Pe),1n)),t?t.assertValidity():Ce("bad point: not on curve")}equals(e){const{px:t,py:n,pz:r}=this,{px:i,py:o,pz:s}=rt(e),a=et(t*s),u=et(i*r),c=et(n*s),l=et(o*r);return a===u&&c===l}is0(){return this.equals(dt)}negate(){return new ft(this.px,et(-this.py),this.pz)}double(){return this.add(this)}add(e){const{px:t,py:n,pz:r}=this,{px:i,py:o,pz:s}=rt(e);let a=0n,u=0n,c=0n;const l=et(3n*Ue);let f=et(t*i),h=et(n*o),d=et(r*s),p=et(t+n),g=et(i+o);p=et(p*g),g=et(f+h),p=et(p-g),g=et(t+r);let y=et(i+s);return g=et(g*y),y=et(f+d),g=et(g-y),y=et(n+r),a=et(o+s),y=et(y*a),a=et(h+d),y=et(y-a),c=et(0n*g),a=et(l*d),c=et(a+c),a=et(h-c),c=et(h+c),u=et(a*c),h=et(f+f),h=et(h+f),d=et(0n*d),g=et(l*g),h=et(h+d),d=et(f-d),d=et(0n*d),g=et(g+d),f=et(h*g),u=et(u+f),f=et(y*g),a=et(p*a),a=et(a-f),f=et(p*h),c=et(y*c),c=et(c+f),new ft(a,u,c)}multiply(e,t=!0){if(!t&&0n===e)return dt;if(at(e),1n===e)return this;if(this.equals(ht))return Ut(e).p;let n=dt,r=ht;for(let i=this;e>0n;i=i.double(),e>>=1n)1n&e?n=n.add(i):t&&(r=r.add(i));return n}toAffine(){const{px:e,py:t,pz:n}=this;if(this.equals(dt))return{x:0n,y:0n};if(1n===n)return{x:e,y:t};const r=nt(n,Re);return 1n!==et(n*r)&&Ce("inverse invalid"),{x:et(e*r),y:et(t*r)}}assertValidity(){const{x:e,y:t}=this.toAffine();return st(e),st(t),et(t*t)===it(e)?this:Ce("bad point: not on curve")}toBytes(e=!0){const{x:t,y:n}=this.assertValidity().toAffine(),r=mt(t);return e?Xe(lt(n),r):Xe(ct(4),r,mt(n))}static fromAffine(e){const{x:t,y:n}=e;return 0n===t&&0n===n?dt:new ft(t,n,1n)}toHex(e){return Ie(this.toBytes(e))}static fromPrivateKey(e){return ht.multiply(bt(e))}static fromHex(e){return ft.fromBytes(Ve(e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}toRawBytes(e){return this.toBytes(e)}}const ht=new ft(Te,ke,1n),dt=new ft(0n,1n,0n);ft.BASE=ht,ft.ZERO=dt;const pt=e=>Ze("0x"+(Ie(e)||"0")),gt=(e,t,n)=>pt(e.subarray(t,n)),yt=2n**256n,mt=e=>We($e(Qe(e,0n,yt),Pe)),bt=e=>{const t=je(e)?e:pt(Ve(e,Be));return Qe(t,1n,xe,"private key invalid 3")},wt=e=>e>xe>>1n;class vt{r;s;recovery;constructor(e,t,n){this.r=at(e),this.s=at(t),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(e){Fe(e,Pe);const t=gt(e,0,Be),n=gt(e,Be,Pe);return new vt(t,n)}toBytes(){const{r:e,s:t}=this;return Xe(mt(e),mt(t))}addRecoveryBit(e){return new vt(this.r,this.s,e)}hasHighS(){return wt(this.s)}toCompactRawBytes(){return this.toBytes()}toCompactHex(){return Ie(this.toBytes())}recoverPublicKey(e){return St(this,e)}static fromCompact(e){return vt.fromBytes(Ve(e,Pe))}assertValidity(){return this}normalizeS(){const{r:e,s:t,recovery:n}=this;return wt(t)?new vt(e,tt(-t),n):this}}const Et=e=>{const t=8*e.length-256;t>1024&&Ce("msg invalid");const n=pt(e);return t>0?n>>Ze(t):n},At=e=>tt(Et(Fe(e))),_t={lowS:!0},Ot=async(e,t,n=_t)=>{const{seed:r,k2sig:i}=((e,t,n=_t)=>{["der","recovered","canonical"].some(e=>e in n)&&Ce("option not supported");let{lowS:r,extraEntropy:i}=n;null==r&&(r=!0);const o=mt,s=At(Ve(e)),a=o(s),u=bt(t),c=[o(u),a];i&&c.push(!0===i?Ge(Be):Ve(i));const l=s;return{seed:Xe(...c),k2sig:e=>{const t=Et(e);if(!(1n<=t&&t<xe))return;const n=ht.multiply(t).toAffine(),i=tt(n.x);if(0n===i)return;const o=nt(t,xe),s=tt(o*tt(l+tt(u*i)));if(0n===s)return;let a=s,c=(n.x===i?0:2)|Number(1n&n.y);return r&&wt(s)&&(a=tt(-s),c^=1),new vt(i,a,c)}}})(e,t,n),o=await(()=>{let e=Ne(Be),t=Ne(Be),n=0;const r=Ne(0),i=()=>{e.fill(1),t.fill(0),n=0};{const o=(...n)=>Rt.hmacSha256Async(t,e,...n),s=async(n=r)=>{t=await o(ct(0),n),e=await o(),0!==n.length&&(t=await o(ct(1),n),e=await o())},a=async()=>(n++>=1e3&&Ce("drbg: tried 1000 values"),e=await o(),e);return async(e,t)=>{let n;for(i(),await s(e);!(n=t(await a()));)await s();return i(),n}}})()(r,i);return o},St=(e,t)=>{const{r:n,s:r,recovery:i}=e;[0,1,2,3].includes(i)||Ce("recovery id invalid");const o=At(Ve(t,Be)),s=2===i||3===i?n+xe:n;st(s);const a=lt(Ze(i)),u=Xe(a,mt(s)),c=ft.fromBytes(u),l=nt(s,xe);return((e,t,n)=>ht.multiply(t,!1).add(e.multiply(n,!1)).assertValidity())(c,tt(-o*l),tt(r*l))},Rt={hexToBytes:We,bytesToHex:Ie,concatBytes:Xe,bytesToNumberBE:pt,numberToBytesBE:mt,mod:et,invert:nt,hmacSha256Async:async(e,...t)=>{const n=Je()?.subtle??Ce("crypto.subtle must be defined"),r="HMAC",i=await n.importKey("raw",e,{name:r,hash:{name:"SHA-256"}},!1,["sign"]);return Ne(await n.sign(r,i,Xe(...t)))},hmacSha256Sync:void 0,hashToPrivateKey:e=>{((e=Ve(e)).length<40||e.length>1024)&&Ce("expected 40-1024b");const t=et(pt(e),xe-1n);return mt(t+1n)},randomBytes:Ge},xt=Math.ceil(32)+1;let Tt;const kt=(e,t)=>{const n=t.negate();return e?n:t},Ut=e=>{const t=Tt||(Tt=(()=>{const e=[];let t=ht,n=t;for(let r=0;r<xt;r++){n=t,e.push(n);for(let r=1;r<128;r++)n=n.add(t),e.push(n);t=n.double()}return e})());let n=dt,r=ht;const i=Ze(255),o=Ze(8);for(let s=0;s<xt;s++){let a=Number(e&i);e>>=o,a>128&&(a-=256,e+=1n);const u=128*s,c=u,l=u+Math.abs(a)-1,f=s%2!=0,h=a<0;0===a?r=r.add(kt(f,t[c])):n=n.add(kt(h,t[l]))}return{p:n,f:r}};function Bt(e){if("object"!=typeof e)return(typeof e).toLowerCase();const t=Object.prototype.toString.call(e);return t.slice(8,t.length-1).toLowerCase()}function Pt(e){if("array"===Bt(e)){return we(e.map(e=>"string"===Bt(e)?/^0x([0-9a-fA-F]{2})*$/.test(e)?"0x"===e?new Uint8Array([]):O(e):/^\d+$/.test(e)?"0"===e?new Uint8Array([]):O(m(BigInt(e))):(new TextEncoder).encode(e):"number"===Bt(e)||"bigint"===Bt(e)?0===e||e===BigInt(0)?new Uint8Array([]):O(m(e)):"boolean"===Bt(e)?e?Uint8Array.from([1]):new Uint8Array([]):e))}return"boolean"===Bt(e)?we(e?Uint8Array.from([1]):new Uint8Array([])):we(e)}var Ct="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function jt(){throw new Error("setTimeout has not been defined")}function Lt(){throw new Error("clearTimeout has not been defined")}var Ft=jt,Nt=Lt;function $t(e){if(Ft===setTimeout)return setTimeout(e,0);if((Ft===jt||!Ft)&&setTimeout)return Ft=setTimeout,setTimeout(e,0);try{return Ft(e,0)}catch(t){try{return Ft.call(null,e,0)}catch(t){return Ft.call(this,e,0)}}}"function"==typeof Ct.setTimeout&&(Ft=setTimeout),"function"==typeof Ct.clearTimeout&&(Nt=clearTimeout);var It,Mt=[],zt=!1,Dt=-1;function qt(){zt&&It&&(zt=!1,It.length?Mt=It.concat(Mt):Dt=-1,Mt.length&&Ht())}function Ht(){if(!zt){var e=$t(qt);zt=!0;for(var t=Mt.length;t;){for(It=Mt,Mt=[];++Dt<t;)It&&It[Dt].run();Dt=-1,t=Mt.length}It=null,zt=!1,function(e){if(Nt===clearTimeout)return clearTimeout(e);if((Nt===Lt||!Nt)&&clearTimeout)return Nt=clearTimeout,clearTimeout(e);try{return Nt(e)}catch(t){try{return Nt.call(null,e)}catch(t){return Nt.call(this,e)}}}(e)}}function Yt(e,t){this.fun=e,this.array=t}Yt.prototype.run=function(){this.fun.apply(null,this.array)};var Kt=Ct.performance||{};Kt.now||Kt.mozNow||Kt.msNow||Kt.oNow||Kt.webkitNow;var Wt={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Mt.push(new Yt(e,t)),1!==Mt.length||zt||$t(Ht)}};function Vt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Jt}=Object.prototype,{getPrototypeOf:Xt}=Object,{iterator:Gt,toStringTag:Zt}=Symbol,Qt=(en=Object.create(null),e=>{const t=Jt.call(e);return en[t]||(en[t]=t.slice(8,-1).toLowerCase())});var en;const tn=e=>(e=e.toLowerCase(),t=>Qt(t)===e),nn=e=>t=>typeof t===e,{isArray:rn}=Array,on=nn("undefined");function sn(e){return null!==e&&!on(e)&&null!==e.constructor&&!on(e.constructor)&&cn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const an=tn("ArrayBuffer");const un=nn("string"),cn=nn("function"),ln=nn("number"),fn=e=>null!==e&&"object"==typeof e,hn=e=>{if("object"!==Qt(e))return!1;const t=Xt(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Zt in e||Gt in e)},dn=tn("Date"),pn=tn("File"),gn=tn("Blob"),yn=tn("FileList"),mn=tn("URLSearchParams"),[bn,wn,vn,En]=["ReadableStream","Request","Response","Headers"].map(tn);function An(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),rn(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(sn(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let s;for(r=0;r<o;r++)s=i[r],t.call(null,e[s],s,e)}}function _n(e,t){if(sn(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const On="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:Ct,Sn=e=>!on(e)&&e!==On;const Rn=(xn="undefined"!=typeof Uint8Array&&Xt(Uint8Array),e=>xn&&e instanceof xn);var xn;const Tn=tn("HTMLFormElement"),kn=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Un=tn("RegExp"),Bn=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};An(n,(n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)}),Object.defineProperties(e,r)};const Pn=tn("AsyncFunction"),Cn=(jn="function"==typeof setImmediate,Ln=cn(On.postMessage),jn?setImmediate:Ln?(Fn=`axios@${Math.random()}`,Nn=[],On.addEventListener("message",({source:e,data:t})=>{e===On&&t===Fn&&Nn.length&&Nn.shift()()},!1),e=>{Nn.push(e),On.postMessage(Fn,"*")}):e=>setTimeout(e));var jn,Ln,Fn,Nn;const $n="undefined"!=typeof queueMicrotask?queueMicrotask.bind(On):Wt.nextTick||Cn;var In={isArray:rn,isArrayBuffer:an,isBuffer:sn,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||cn(e.append)&&("formdata"===(t=Qt(e))||"object"===t&&cn(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&an(e.buffer),t},isString:un,isNumber:ln,isBoolean:e=>!0===e||!1===e,isObject:fn,isPlainObject:hn,isEmptyObject:e=>{if(!fn(e)||sn(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:bn,isRequest:wn,isResponse:vn,isHeaders:En,isUndefined:on,isDate:dn,isFile:pn,isBlob:gn,isRegExp:Un,isFunction:cn,isStream:e=>fn(e)&&cn(e.pipe),isURLSearchParams:mn,isTypedArray:Rn,isFileList:yn,forEach:An,merge:function e(){const{caseless:t,skipUndefined:n}=Sn(this)&&this||{},r={},i=(i,o)=>{const s=t&&_n(r,o)||o;hn(r[s])&&hn(i)?r[s]=e(r[s],i):hn(i)?r[s]=e({},i):rn(i)?r[s]=i.slice():n&&on(i)||(r[s]=i)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&An(arguments[e],i);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(An(t,(t,r)=>{n&&cn(t)?e[r]=Vt(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&Xt(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Qt,kindOfTest:tn,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(rn(e))return e;let t=e.length;if(!ln(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Gt]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Tn,hasOwnProperty:kn,hasOwnProp:kn,reduceDescriptors:Bn,freezeMethods:e=>{Bn(e,(t,n)=>{if(cn(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];cn(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return rn(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:_n,global:On,isContextDefined:Sn,isSpecCompliantForm:function(e){return!!(e&&cn(e.append)&&"FormData"===e[Zt]&&e[Gt])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(fn(e)){if(t.indexOf(e)>=0)return;if(sn(e))return e;if(!("toJSON"in e)){t[r]=e;const i=rn(e)?[]:{};return An(e,(e,t)=>{const o=n(e,r+1);!on(o)&&(i[t]=o)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:Pn,isThenable:e=>e&&(fn(e)||cn(e))&&cn(e.then)&&cn(e.catch),setImmediate:Cn,asap:$n,isIterable:e=>null!=e&&cn(e[Gt])},Mn=[],zn=[],Dn="undefined"!=typeof Uint8Array?Uint8Array:Array,qn=!1;function Hn(){qn=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)Mn[t]=e[t],zn[e.charCodeAt(t)]=t;zn["-".charCodeAt(0)]=62,zn["_".charCodeAt(0)]=63}function Yn(e){return Mn[e>>18&63]+Mn[e>>12&63]+Mn[e>>6&63]+Mn[63&e]}function Kn(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(Yn(r));return i.join("")}function Wn(e){var t;qn||Hn();for(var n=e.length,r=n%3,i="",o=[],s=16383,a=0,u=n-r;a<u;a+=s)o.push(Kn(e,a,a+s>u?u:a+s));return 1===r?(t=e[n-1],i+=Mn[t>>2],i+=Mn[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=Mn[t>>10],i+=Mn[t>>4&63],i+=Mn[t<<2&63],i+="="),o.push(i),o.join("")}function Vn(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,l=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),o-=c}return(d?-1:1)*s*Math.pow(2,o-r)}function Jn(e,t,n,r,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[n+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[n+d]=255&s,d+=p,s/=256,c-=8);e[n+d-p]|=128*g}var Xn={}.toString,Gn=Array.isArray||function(e){return"[object Array]"==Xn.call(e)};function Zn(){return er.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Qn(e,t){if(Zn()<t)throw new RangeError("Invalid typed array length");return er.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=er.prototype:(null===e&&(e=new er(t)),e.length=t),e}function er(e,t,n){if(!(er.TYPED_ARRAY_SUPPORT||this instanceof er))return new er(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return rr(this,e)}return tr(this,e,t,n)}function tr(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);er.TYPED_ARRAY_SUPPORT?(e=t).__proto__=er.prototype:e=ir(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!er.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|ar(t,n);e=Qn(e,r);var i=e.write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(sr(t)){var n=0|or(t.length);return 0===(e=Qn(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?Qn(e,0):ir(e,t);if("Buffer"===t.type&&Gn(t.data))return ir(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function nr(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function rr(e,t){if(nr(t),e=Qn(e,t<0?0:0|or(t)),!er.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function ir(e,t){var n=t.length<0?0:0|or(t.length);e=Qn(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function or(e){if(e>=Zn())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Zn().toString(16)+" bytes");return 0|e}function sr(e){return!(null==e||!e._isBuffer)}function ar(e,t){if(sr(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return jr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Lr(e).length;default:if(r)return jr(e).length;t=(""+t).toLowerCase(),r=!0}}function ur(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return _r(this,t,n);case"utf8":case"utf-8":return wr(this,t,n);case"ascii":return Er(this,t,n);case"latin1":case"binary":return Ar(this,t,n);case"base64":return br(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Or(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function cr(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function lr(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=er.from(t,r)),sr(t))return 0===t.length?-1:fr(e,t,n,r,i);if("number"==typeof t)return t&=255,er.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):fr(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function fr(e,t,n,r,i){var o,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=n;o<a;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var f=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){f=!1;break}if(f)return o}return-1}function hr(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function dr(e,t,n,r){return Fr(jr(t,e.length-n),e,n,r)}function pr(e,t,n,r){return Fr(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function gr(e,t,n,r){return pr(e,t,n,r)}function yr(e,t,n,r){return Fr(Lr(t),e,n,r)}function mr(e,t,n,r){return Fr(function(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function br(e,t,n){return 0===t&&n===e.length?Wn(e):Wn(e.slice(t,n))}function wr(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,s,a,u,c=e[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=vr)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=vr));return n}(r)}er.TYPED_ARRAY_SUPPORT=void 0===Ct.TYPED_ARRAY_SUPPORT||Ct.TYPED_ARRAY_SUPPORT,Zn(),er.poolSize=8192,er._augment=function(e){return e.__proto__=er.prototype,e},er.from=function(e,t,n){return tr(null,e,t,n)},er.TYPED_ARRAY_SUPPORT&&(er.prototype.__proto__=Uint8Array.prototype,er.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&er[Symbol.species]),er.alloc=function(e,t,n){return function(e,t,n,r){return nr(t),t<=0?Qn(e,t):void 0!==n?"string"==typeof r?Qn(e,t).fill(n,r):Qn(e,t).fill(n):Qn(e,t)}(null,e,t,n)},er.allocUnsafe=function(e){return rr(null,e)},er.allocUnsafeSlow=function(e){return rr(null,e)},er.isBuffer=function(e){return null!=e&&(!!e._isBuffer||Nr(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Nr(e.slice(0,0))}(e))},er.compare=function(e,t){if(!sr(e)||!sr(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},er.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},er.concat=function(e,t){if(!Gn(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return er.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=er.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!sr(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},er.byteLength=ar,er.prototype._isBuffer=!0,er.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)cr(this,t,t+1);return this},er.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)cr(this,t,t+3),cr(this,t+1,t+2);return this},er.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)cr(this,t,t+7),cr(this,t+1,t+6),cr(this,t+2,t+5),cr(this,t+3,t+4);return this},er.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?wr(this,0,e):ur.apply(this,arguments)},er.prototype.equals=function(e){if(!sr(e))throw new TypeError("Argument must be a Buffer");return this===e||0===er.compare(this,e)},er.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},er.prototype.compare=function(e,t,n,r,i){if(!sr(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(r,i),c=e.slice(t,n),l=0;l<a;++l)if(u[l]!==c[l]){o=u[l],s=c[l];break}return o<s?-1:s<o?1:0},er.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},er.prototype.indexOf=function(e,t,n){return lr(this,e,t,n,!0)},er.prototype.lastIndexOf=function(e,t,n){return lr(this,e,t,n,!1)},er.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return hr(this,e,t,n);case"utf8":case"utf-8":return dr(this,e,t,n);case"ascii":return pr(this,e,t,n);case"latin1":case"binary":return gr(this,e,t,n);case"base64":return yr(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return mr(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},er.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var vr=4096;function Er(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function Ar(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function _r(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=Cr(e[o]);return i}function Or(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function Sr(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function Rr(e,t,n,r,i,o){if(!sr(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function xr(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Tr(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function kr(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Ur(e,t,n,r,i){return i||kr(e,0,n,4),Jn(e,t,n,r,23,4),n+4}function Br(e,t,n,r,i){return i||kr(e,0,n,8),Jn(e,t,n,r,52,8),n+8}er.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),er.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=er.prototype;else{var i=t-e;n=new er(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},er.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||Sr(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},er.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||Sr(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},er.prototype.readUInt8=function(e,t){return t||Sr(e,1,this.length),this[e]},er.prototype.readUInt16LE=function(e,t){return t||Sr(e,2,this.length),this[e]|this[e+1]<<8},er.prototype.readUInt16BE=function(e,t){return t||Sr(e,2,this.length),this[e]<<8|this[e+1]},er.prototype.readUInt32LE=function(e,t){return t||Sr(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},er.prototype.readUInt32BE=function(e,t){return t||Sr(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},er.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||Sr(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},er.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||Sr(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},er.prototype.readInt8=function(e,t){return t||Sr(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},er.prototype.readInt16LE=function(e,t){t||Sr(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},er.prototype.readInt16BE=function(e,t){t||Sr(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},er.prototype.readInt32LE=function(e,t){return t||Sr(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},er.prototype.readInt32BE=function(e,t){return t||Sr(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},er.prototype.readFloatLE=function(e,t){return t||Sr(e,4,this.length),Vn(this,e,!0,23,4)},er.prototype.readFloatBE=function(e,t){return t||Sr(e,4,this.length),Vn(this,e,!1,23,4)},er.prototype.readDoubleLE=function(e,t){return t||Sr(e,8,this.length),Vn(this,e,!0,52,8)},er.prototype.readDoubleBE=function(e,t){return t||Sr(e,8,this.length),Vn(this,e,!1,52,8)},er.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||Rr(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},er.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||Rr(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},er.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,1,255,0),er.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},er.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,2,65535,0),er.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):xr(this,e,t,!0),t+2},er.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,2,65535,0),er.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):xr(this,e,t,!1),t+2},er.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,4,4294967295,0),er.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Tr(this,e,t,!0),t+4},er.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,4,4294967295,0),er.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Tr(this,e,t,!1),t+4},er.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Rr(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},er.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Rr(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},er.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,1,127,-128),er.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},er.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,2,32767,-32768),er.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):xr(this,e,t,!0),t+2},er.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,2,32767,-32768),er.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):xr(this,e,t,!1),t+2},er.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,4,2147483647,-2147483648),er.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Tr(this,e,t,!0),t+4},er.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||Rr(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),er.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Tr(this,e,t,!1),t+4},er.prototype.writeFloatLE=function(e,t,n){return Ur(this,e,t,!0,n)},er.prototype.writeFloatBE=function(e,t,n){return Ur(this,e,t,!1,n)},er.prototype.writeDoubleLE=function(e,t,n){return Br(this,e,t,!0,n)},er.prototype.writeDoubleBE=function(e,t,n){return Br(this,e,t,!1,n)},er.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!er.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},er.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!er.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=sr(e)?e:jr(new er(e,r).toString()),a=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var Pr=/[^+\/0-9A-Za-z-_]/g;function Cr(e){return e<16?"0"+e.toString(16):e.toString(16)}function jr(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Lr(e){return function(e){var t,n,r,i,o,s;qn||Hn();var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[a-2]?2:"="===e[a-1]?1:0,s=new Dn(3*a/4-o),r=o>0?a-4:a;var u=0;for(t=0,n=0;t<r;t+=4,n+=3)i=zn[e.charCodeAt(t)]<<18|zn[e.charCodeAt(t+1)]<<12|zn[e.charCodeAt(t+2)]<<6|zn[e.charCodeAt(t+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=zn[e.charCodeAt(t)]<<2|zn[e.charCodeAt(t+1)]>>4,s[u++]=255&i):1===o&&(i=zn[e.charCodeAt(t)]<<10|zn[e.charCodeAt(t+1)]<<4|zn[e.charCodeAt(t+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Pr,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Fr(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Nr(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function $r(e,t,n,r,i){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),i&&(this.response=i,this.status=i.status?i.status:null)}In.inherits($r,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:In.toJSONObject(this.config),code:this.code,status:this.status}}});const Ir=$r.prototype,Mr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Mr[e]={value:e}}),Object.defineProperties($r,Mr),Object.defineProperty(Ir,"isAxiosError",{value:!0}),$r.from=(e,t,n,r,i,o)=>{const s=Object.create(Ir);In.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",u=null==t&&e?e.code:t;return $r.call(s,a,u,n,r,i),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",o&&Object.assign(s,o),s};function zr(e){return In.isPlainObject(e)||In.isArray(e)}function Dr(e){return In.endsWith(e,"[]")?e.slice(0,-2):e}function qr(e,t,n){return e?e.concat(t).map(function(e,t){return e=Dr(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Hr=In.toFlatObject(In,{},null,function(e){return/^is[A-Z]/.test(e)});function Yr(e,t,n){if(!In.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=In.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!In.isUndefined(t[e])})).metaTokens,i=n.visitor||c,o=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&In.isSpecCompliantForm(t);if(!In.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(In.isDate(e))return e.toISOString();if(In.isBoolean(e))return e.toString();if(!a&&In.isBlob(e))throw new $r("Blob is not supported. Use a Buffer instead.");return In.isArrayBuffer(e)||In.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):er.from(e):e}function c(e,n,i){let a=e;if(e&&!i&&"object"==typeof e)if(In.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(In.isArray(e)&&function(e){return In.isArray(e)&&!e.some(zr)}(e)||(In.isFileList(e)||In.endsWith(n,"[]"))&&(a=In.toArray(e)))return n=Dr(n),a.forEach(function(e,r){!In.isUndefined(e)&&null!==e&&t.append(!0===s?qr([n],r,o):null===s?n:n+"[]",u(e))}),!1;return!!zr(e)||(t.append(qr(i,n,o),u(e)),!1)}const l=[],f=Object.assign(Hr,{defaultVisitor:c,convertValue:u,isVisitable:zr});if(!In.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!In.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),In.forEach(n,function(n,o){!0===(!(In.isUndefined(n)||null===n)&&i.call(t,n,In.isString(o)?o.trim():o,r,f))&&e(n,r?r.concat(o):[o])}),l.pop()}}(e),t}function Kr(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Wr(e,t){this._pairs=[],e&&Yr(e,this,t)}const Vr=Wr.prototype;function Jr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Xr(e,t,n){if(!t)return e;const r=n&&n.encode||Jr;In.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(o=i?i(t,n):In.isURLSearchParams(t)?t.toString():new Wr(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}Vr.append=function(e,t){this._pairs.push([e,t])},Vr.toString=function(e){const t=e?function(t){return e.call(this,t,Kr)}:Kr;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class Gr{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){In.forEach(this.handlers,function(t){null!==t&&e(t)})}}var Zr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Qr={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Wr,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ei="undefined"!=typeof window&&"undefined"!=typeof document,ti="object"==typeof navigator&&navigator||void 0,ni=ei&&(!ti||["ReactNative","NativeScript","NS"].indexOf(ti.product)<0),ri="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ii=ei&&window.location.href||"http://localhost";var oi={...Object.freeze({__proto__:null,hasBrowserEnv:ei,hasStandardBrowserEnv:ni,hasStandardBrowserWebWorkerEnv:ri,navigator:ti,origin:ii}),...Qr};function si(e){function t(e,n,r,i){let o=e[i++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),a=i>=e.length;if(o=!o&&In.isArray(r)?r.length:o,a)return In.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!s;r[o]&&In.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],i)&&In.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}(r[o])),!s}if(In.isFormData(e)&&In.isFunction(e.entries)){const n={};return In.forEachEntry(e,(e,r)=>{t(function(e){return In.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const ai={transitional:Zr,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=In.isObject(e);i&&In.isHTMLForm(e)&&(e=new FormData(e));if(In.isFormData(e))return r?JSON.stringify(si(e)):e;if(In.isArrayBuffer(e)||In.isBuffer(e)||In.isStream(e)||In.isFile(e)||In.isBlob(e)||In.isReadableStream(e))return e;if(In.isArrayBufferView(e))return e.buffer;if(In.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Yr(e,new oi.classes.URLSearchParams,{visitor:function(e,t,n,r){return oi.isNode&&In.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=In.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Yr(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(In.isString(e))try{return(t||JSON.parse)(e),In.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ai.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(In.isResponse(e)||In.isReadableStream(e))return e;if(e&&In.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw $r.from(e,$r.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:oi.classes.FormData,Blob:oi.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};In.forEach(["delete","get","head","post","put","patch"],e=>{ai.headers[e]={}});const ui=In.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ci=Symbol("internals");function li(e){return e&&String(e).trim().toLowerCase()}function fi(e){return!1===e||null==e?e:In.isArray(e)?e.map(fi):String(e)}function hi(e,t,n,r,i){return In.isFunction(r)?r.call(this,t,n):(i&&(t=n),In.isString(t)?In.isString(r)?-1!==t.indexOf(r):In.isRegExp(r)?r.test(t):void 0:void 0)}let di=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=li(t);if(!i)throw new Error("header name must be a non-empty string");const o=In.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=fi(e))}const o=(e,t)=>In.forEach(e,(e,n)=>i(e,n,t));if(In.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(In.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&ui[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(In.isObject(e)&&In.isIterable(e)){let n,r,i={};for(const t of e){if(!In.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?In.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=li(e)){const n=In.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(In.isFunction(t))return t.call(this,e,n);if(In.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=li(e)){const n=In.findKey(this,e);return!(!n||void 0===this[n]||t&&!hi(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=li(e)){const i=In.findKey(n,e);!i||t&&!hi(0,n[i],i,t)||(delete n[i],r=!0)}}return In.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!hi(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return In.forEach(this,(r,i)=>{const o=In.findKey(n,i);if(o)return t[o]=fi(r),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();s!==i&&delete t[i],t[s]=fi(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return In.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&In.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[ci]=this[ci]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=li(e);t[r]||(!function(e,t){const n=In.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return In.isArray(e)?e.forEach(r):r(e),this}};function pi(e,t){const n=this||ai,r=t||n,i=di.from(r.headers);let o=r.data;return In.forEach(e,function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function gi(e){return!(!e||!e.__CANCEL__)}function yi(e,t,n){$r.call(this,null==e?"canceled":e,$r.ERR_CANCELED,t,n),this.name="CanceledError"}function mi(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new $r("Request failed with status code "+n.status,[$r.ERR_BAD_REQUEST,$r.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}di.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),In.reduceDescriptors(di.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),In.freezeMethods(di),In.inherits(yi,$r,{__CANCEL__:!0});const bi=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const u=Date.now(),c=r[s];i||(i=u),n[o]=a,r[o]=u;let l=s,f=0;for(;l!==o;)f+=n[l++],l%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),u-i<t)return;const h=c&&u-c;return h?Math.round(1e3*f/h):void 0}}(50,250);return function(e,t){let n,r,i=0,o=1e3/t;const s=(t,o=Date.now())=>{i=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-i;a>=o?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},o-a)))},()=>n&&s(n)]}(n=>{const o=n.loaded,s=n.lengthComputable?n.total:void 0,a=o-r,u=i(a);r=o;e({loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:u||void 0,estimated:u&&s&&o<=s?(s-o)/u:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},wi=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},vi=e=>(...t)=>In.asap(()=>e(...t));var Ei=oi.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,oi.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(oi.origin),oi.navigator&&/(msie|trident)/i.test(oi.navigator.userAgent)):()=>!0,Ai=oi.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const s=[e+"="+encodeURIComponent(t)];In.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),In.isString(r)&&s.push("path="+r),In.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function _i(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Oi=e=>e instanceof di?{...e}:e;function Si(e,t){t=t||{};const n={};function r(e,t,n,r){return In.isPlainObject(e)&&In.isPlainObject(t)?In.merge.call({caseless:r},e,t):In.isPlainObject(t)?In.merge({},t):In.isArray(t)?t.slice():t}function i(e,t,n,i){return In.isUndefined(t)?In.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function o(e,t){if(!In.isUndefined(t))return r(void 0,t)}function s(e,t){return In.isUndefined(t)?In.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}const u={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>i(Oi(e),Oi(t),0,!0)};return In.forEach(Object.keys({...e,...t}),function(r){const o=u[r]||i,s=o(e[r],t[r],r);In.isUndefined(s)&&o!==a||(n[r]=s)}),n}var Ri=e=>{const t=Si({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;if(t.headers=s=di.from(s),t.url=Xr(_i(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),In.isFormData(n))if(oi.hasStandardBrowserEnv||oi.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(In.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(oi.hasStandardBrowserEnv&&(r&&In.isFunction(r)&&(r=r(t)),r||!1!==r&&Ei(t.url))){const e=i&&o&&Ai.read(o);e&&s.set(i,e)}return t};var xi="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Ri(e);let i=r.data;const o=di.from(r.headers).normalize();let s,a,u,c,l,{responseType:f,onUploadProgress:h,onDownloadProgress:d}=r;function p(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let g=new XMLHttpRequest;function y(){if(!g)return;const r=di.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());mi(function(e){t(e),p()},function(e){n(e),p()},{data:f&&"text"!==f&&"json"!==f?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(y)},g.onabort=function(){g&&(n(new $r("Request aborted",$r.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=new $r(t&&t.message?t.message:"Network Error",$r.ERR_NETWORK,e,g);r.event=t||null,n(r),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||Zr;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new $r(t,i.clarifyTimeoutError?$r.ETIMEDOUT:$r.ECONNABORTED,e,g)),g=null},void 0===i&&o.setContentType(null),"setRequestHeader"in g&&In.forEach(o.toJSON(),function(e,t){g.setRequestHeader(t,e)}),In.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),f&&"json"!==f&&(g.responseType=r.responseType),d&&([u,l]=bi(d,!0),g.addEventListener("progress",u)),h&&g.upload&&([a,c]=bi(h),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(s=t=>{g&&(n(!t||t.type?new yi(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const m=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);m&&-1===oi.protocols.indexOf(m)?n(new $r("Unsupported protocol "+m+":",$r.ERR_BAD_REQUEST,e)):g.send(i||null)})};const Ti=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof $r?t:new yi(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,i(new $r(`timeout ${t} of ms exceeded`,$r.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:a}=r;return a.unsubscribe=()=>In.asap(s),a}},ki=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},Ui=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Bi=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of Ui(e))yield*ki(n,t)}(e,t);let o,s=0,a=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return a(),void e.close();let o=r.byteLength;if(n){let e=s+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),i.return())},{highWaterMark:2})},{isFunction:Pi}=In,Ci=(({Request:e,Response:t})=>({Request:e,Response:t}))(In.global),{ReadableStream:ji,TextEncoder:Li}=In.global,Fi=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ni=e=>{e=In.merge.call({skipUndefined:!0},Ci,e);const{fetch:t,Request:n,Response:r}=e,i=t?Pi(t):"function"==typeof fetch,o=Pi(n),s=Pi(r);if(!i)return!1;const a=i&&Pi(ji),u=i&&("function"==typeof Li?(e=>t=>e.encode(t))(new Li):async e=>new Uint8Array(await new n(e).arrayBuffer())),c=o&&a&&Fi(()=>{let e=!1;const t=new n(oi.origin,{body:new ji,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),l=s&&a&&Fi(()=>In.isReadableStream(new r("").body)),f={stream:l&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new $r(`Response type '${e}' is not supported`,$r.ERR_NOT_SUPPORT,n)})});const h=async(e,t)=>{const r=In.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(In.isBlob(e))return e.size;if(In.isSpecCompliantForm(e)){const t=new n(oi.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return In.isArrayBufferView(e)||In.isArrayBuffer(e)?e.byteLength:(In.isURLSearchParams(e)&&(e+=""),In.isString(e)?(await u(e)).byteLength:void 0)})(t):r};return async e=>{let{url:i,method:s,data:a,signal:u,cancelToken:d,timeout:p,onDownloadProgress:g,onUploadProgress:y,responseType:m,headers:b,withCredentials:w="same-origin",fetchOptions:v}=Ri(e),E=t||fetch;m=m?(m+"").toLowerCase():"text";let A=Ti([u,d&&d.toAbortSignal()],p),_=null;const O=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let S;try{if(y&&c&&"get"!==s&&"head"!==s&&0!==(S=await h(b,a))){let e,t=new n(i,{method:"POST",body:a,duplex:"half"});if(In.isFormData(a)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,n]=wi(S,bi(vi(y)));a=Bi(t.body,65536,e,n)}}In.isString(w)||(w=w?"include":"omit");const t=o&&"credentials"in n.prototype,u={...v,signal:A,method:s.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};_=o&&new n(i,u);let d=await(o?E(_,v):E(i,u));const p=l&&("stream"===m||"response"===m);if(l&&(g||p&&O)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=d[t]});const t=In.toFiniteNumber(d.headers.get("content-length")),[n,i]=g&&wi(t,bi(vi(g),!0))||[];d=new r(Bi(d.body,65536,n,()=>{i&&i(),O&&O()}),e)}m=m||"text";let R=await f[In.findKey(f,m)||"text"](d,e);return!p&&O&&O(),await new Promise((t,n)=>{mi(t,n,{data:R,headers:di.from(d.headers),status:d.status,statusText:d.statusText,config:e,request:_})})}catch(t){if(O&&O(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new $r("Network Error",$r.ERR_NETWORK,e,_),{cause:t.cause||t});throw $r.from(t,t&&t.code,e,_)}}},$i=new Map,Ii=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let s,a,u=o.length,c=$i;for(;u--;)s=o[u],a=c.get(s),void 0===a&&c.set(s,a=u?new Map:Ni(t)),c=a;return a};Ii();const Mi={http:null,xhr:xi,fetch:{get:Ii}};In.forEach(Mi,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const zi=e=>`- ${e}`,Di=e=>In.isFunction(e)||null===e||!1===e;var qi=(e,t)=>{e=In.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let s=0;s<n;s++){let n;if(r=e[s],i=r,!Di(r)&&(i=Mi[(n=String(r)).toLowerCase()],void 0===i))throw new $r(`Unknown adapter '${n}'`);if(i&&(In.isFunction(i)||(i=i.get(t))))break;o[n||"#"+s]=i}if(!i){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new $r("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(zi).join("\n"):" "+zi(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return i};function Hi(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yi(null,e)}function Yi(e){Hi(e),e.headers=di.from(e.headers),e.data=pi.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return qi(e.adapter||ai.adapter,e)(e).then(function(t){return Hi(e),t.data=pi.call(e,e.transformResponse,t),t.headers=di.from(t.headers),t},function(t){return gi(t)||(Hi(e),t&&t.response&&(t.response.data=pi.call(e,e.transformResponse,t.response),t.response.headers=di.from(t.response.headers))),Promise.reject(t)})}const Ki="1.12.2",Wi={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wi[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Vi={};Wi.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Ki+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new $r(r(i," has been removed"+(t?" in "+t:"")),$r.ERR_DEPRECATED);return t&&!Vi[i]&&(Vi[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},Wi.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Ji={assertOptions:function(e,t,n){if("object"!=typeof e)throw new $r("options must be an object",$r.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new $r("option "+o+" must be "+n,$r.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new $r("Unknown option "+o,$r.ERR_BAD_OPTION)}},validators:Wi};const Xi=Ji.validators;let Gi=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Gr,response:new Gr}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Si(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Ji.assertOptions(n,{silentJSONParsing:Xi.transitional(Xi.boolean),forcedJSONParsing:Xi.transitional(Xi.boolean),clarifyTimeoutError:Xi.transitional(Xi.boolean)},!1),null!=r&&(In.isFunction(r)?t.paramsSerializer={serialize:r}:Ji.assertOptions(r,{encode:Xi.function,serialize:Xi.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Ji.assertOptions(t,{baseUrl:Xi.spelling("baseURL"),withXsrfToken:Xi.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&In.merge(i.common,i[t.method]);i&&In.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=di.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const u=[];let c;this.interceptors.response.forEach(function(e){u.push(e.fulfilled,e.rejected)});let l,f=0;if(!a){const e=[Yi.bind(this),void 0];for(e.unshift(...s),e.push(...u),l=e.length,c=Promise.resolve(t);f<l;)c=c.then(e[f++],e[f++]);return c}l=s.length;let h=t;for(;f<l;){const e=s[f++],t=s[f++];try{h=e(h)}catch(e){t.call(this,e);break}}try{c=Yi.call(this,h)}catch(e){return Promise.reject(e)}for(f=0,l=u.length;f<l;)c=c.then(u[f++],u[f++]);return c}getUri(e){return Xr(_i((e=Si(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};In.forEach(["delete","get","head","options"],function(e){Gi.prototype[e]=function(t,n){return this.request(Si(n||{},{method:e,url:t,data:(n||{}).data}))}}),In.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,i){return this.request(Si(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Gi.prototype[e]=t(),Gi.prototype[e+"Form"]=t(!0)});const Zi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Zi).forEach(([e,t])=>{Zi[t]=e});const Qi=function e(t){const n=new Gi(t),r=Vt(Gi.prototype.request,n);return In.extend(r,Gi.prototype,n,{allOwnKeys:!0}),In.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Si(t,n))},r}(ai);Qi.Axios=Gi,Qi.CanceledError=yi,Qi.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new yi(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},Qi.isCancel=gi,Qi.VERSION=Ki,Qi.toFormData=Yr,Qi.AxiosError=$r,Qi.Cancel=Qi.CanceledError,Qi.all=function(e){return Promise.all(e)},Qi.spread=function(e){return function(t){return e.apply(null,t)}},Qi.isAxiosError=function(e){return In.isObject(e)&&!0===e.isAxiosError},Qi.mergeConfig=Si,Qi.AxiosHeaders=di,Qi.formToJSON=e=>si(In.isHTMLForm(e)?new FormData(e):e),Qi.getAdapter=qi,Qi.HttpStatusCode=Zi,Qi.default=Qi;const{Axios:eo,AxiosError:to,CanceledError:no,isCancel:ro,CancelToken:io,VERSION:oo,all:so,Cancel:ao,isAxiosError:uo,spread:co,toFormData:lo,AxiosHeaders:fo,HttpStatusCode:ho,formToJSON:po,getAdapter:go,mergeConfig:yo}=Qi;class mo{constructor(){this.promiseWrapper=new Promise((e,t)=>{this._resolve=e,this._reject=t}),this._restScope=["success","failure","error","login","timeout"];for(let e=0;e<this._restScope.length;e++){const t=this._restScope[e];t&&(this.promiseWrapper[t]=e=>{"function"==typeof e&&(this[`_${t}`]=e);const n=this.promiseWrapper;delete n[t];const r=this._restScope.slice();return r.splice(r.indexOf(t),1),r.every(e=>!!e&&!n[e])&&delete n.rest,n})}this.promiseWrapper.rest=(e,t)=>{"function"==typeof e&&(this._rest=e);const n=this.promiseWrapper;if(delete n.rest,this._restScope=t||this._restScope,0===this._restScope.length)console.warn('[1Money SDK]: The ".rest(cb, scope)" scope is empty and will never be triggered!');else{let e=0;this._restScope.forEach(t=>{t&&(n[t]?delete n[t]:e++)}),e===this._restScope.length&&console.warn(`[1Money SDK]: The "${this._restScope.join(", ")}" had been called and the "rest" will never be triggered!`)}return n}}}const bo=new class{constructor(e){this._config=e||{},this.axios=Qi,this.parseError=this.parseError.bind(this),this.setting=this.setting.bind(this),this.request=this.request.bind(this)}parseError(e){var t,n,r,i,o,s,a,u,c;"string"==typeof e&&(e=new Error(e)),(!e||"object"!==Bt(e)&&"error"!==Bt(e))&&(e=new Error("Unknown error occurred"));const l=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"Error",f=null!==(i=null!==(n=null==e?void 0:e.message)&&void 0!==n?n:null===(r=null==e?void 0:e.toString)||void 0===r?void 0:r.call(e))&&void 0!==i?i:"Unknown error",h=null!==(o=null==e?void 0:e.stack)&&void 0!==o?o:"",d=null!==(a=null===(s=null==e?void 0:e.response)||void 0===s?void 0:s.status)&&void 0!==a?a:500,p=null!==(c=null===(u=null==e?void 0:e.response)||void 0===u?void 0:u.data)&&void 0!==c?c:void 0;return"number"!=typeof d||d<100||d>599?{name:"InvalidStatusError",message:"Invalid HTTP status code",stack:h,status:500,data:p}:{name:l,message:f,stack:h,status:d,data:p}}mergeSignals(...e){const t=new AbortController,n=()=>t.abort(),r=[];for(const i of e){if(i.aborted){t.abort();break}i.addEventListener("abort",n),r.push(()=>i.removeEventListener("abort",n))}return{signal:t.signal,cleanup:()=>r.forEach(e=>e())}}setting(e){if(!e)return console.warn("[1Money SDK]: setting method required correct parameters!");this._config=Object.assign(Object.assign({},this._config),e)}request(e){e.withCredentials="boolean"!=typeof e.withCredentials||e.withCredentials,e.headers=Object.assign(Object.assign(Object.assign({},this.axios.defaults.headers.common),e.method?this.axios.defaults.headers[e.method]:{}),e.headers),e.headers.Accept=e.headers.Accept||"*/*",e.headers["X-Requested-With"]=e.headers["X-Requested-With"]||"XMLHttpRequest";const{onSuccess:n,onFailure:r,onLogin:i,onError:o,onTimeout:s,isSuccess:a,isLogin:u,timeout:c}=this._config,{onSuccess:l,onFailure:f,onLogin:h,onError:d,onTimeout:p,isSuccess:g,isLogin:y,timeout:m}=e,b={success:null!=g?g:a,login:null!=y?y:u},w=new mo;return Promise.resolve().then(()=>{var a,u,g,y,v,E,A,_,O,S,R,x,T,k,U,B,P,C,j,L;const F={success:null!==(y=null!==(g=null!==(u=null!==(a=w._success)&&void 0!==a?a:~w._restScope.indexOf("success")?w._rest:void 0)&&void 0!==u?u:l)&&void 0!==g?g:n)&&void 0!==y?y:(e,t)=>e,failure:null!==(_=null!==(A=null!==(E=null!==(v=w._failure)&&void 0!==v?v:~w._restScope.indexOf("failure")?w._rest:void 0)&&void 0!==E?E:f)&&void 0!==A?A:r)&&void 0!==_?_:(e,t)=>e,error:null!==(x=null!==(R=null!==(S=null!==(O=w._error)&&void 0!==O?O:~w._restScope.indexOf("error")?w._rest:void 0)&&void 0!==S?S:d)&&void 0!==R?R:o)&&void 0!==x?x:(e,t)=>e,login:null!==(B=null!==(U=null!==(k=null!==(T=w._login)&&void 0!==T?T:~w._restScope.indexOf("login")?w._rest:void 0)&&void 0!==k?k:h)&&void 0!==U?U:i)&&void 0!==B?B:(e,t)=>e,timeout:null!==(L=null!==(j=null!==(C=null!==(P=w._timeout)&&void 0!==P?P:~w._restScope.indexOf("timeout")?w._rest:void 0)&&void 0!==C?C:p)&&void 0!==j?j:s)&&void 0!==L?L:(e,t)=>e},N=(w._success||w._rest&&w._restScope.indexOf("success"),w._failure||w._rest&&w._restScope.indexOf("failure"),w._login||w._rest&&w._restScope.indexOf("login"),!!(w._error||w._rest&&~w._restScope.indexOf("error")||d||o)),$=!!(w._timeout||w._rest&&~w._restScope.indexOf("timeout")||p||s),I=!!(w._success||w._rest&&~w._restScope.indexOf("success")),M=!!(w._failure||w._rest&&~w._restScope.indexOf("failure")),z=!!(w._login||w._rest&&~w._restScope.indexOf("login")),D=!!(w._error||w._rest&&~w._restScope.indexOf("error")),q=!!(w._timeout||w._rest&&~w._restScope.indexOf("timeout")),H=(e,n)=>t(this,void 0,void 0,function*(){try{let t=this.parseError(e);const r=yield Promise.resolve(F.error(t,n));D&&(t=r),N?w._resolve(t):w._reject(t)}catch(e){w._reject(this.parseError(e))}});let Y=null,K=!1;const W=null!=m?m:c,V=new AbortController;let J=null;if(e.signal){const t=this.mergeSignals(e.signal,V.signal);e.signal=t.signal,J=t.cleanup}else e.signal=V.signal;const X=()=>{null!==Y&&(clearTimeout(Y),Y=null),J&&(J(),J=null)};W&&(Y=setTimeout(()=>t(this,void 0,void 0,function*(){var t,n;try{K=!0,X(),V.abort();let n=this.parseError("timeout");const r=yield Promise.resolve(F.timeout(n,null!==(t=e.headers)&&void 0!==t?t:{}));q&&(n=r),$?w._resolve(n):w._reject(n)}catch(t){H(t,null!==(n=e.headers)&&void 0!==n?n:{})}}),W)),this.axios(e).then(e=>t(this,void 0,void 0,function*(){var t,n;if(K)return;X();const{status:r,data:i,headers:o}=e;try{const e=null===(t=b.success)||void 0===t?void 0:t.call(b,i,r,o),s=null===(n=b.login)||void 0===n?void 0:n.call(b,i,r,o);let a=i;if(s){const e=yield Promise.resolve(F.login(i,o));z&&(a=e)}else if(e){const e=yield Promise.resolve(F.success(i,o));I&&(a=e)}else{const e=yield Promise.resolve(F.failure(i,o));M&&(a=e)}w._resolve(a)}catch(e){H(e,o)}})).catch(e=>t(this,void 0,void 0,function*(){var t,n,r,i,o,s,a,u,c,l,f,h,d,p;if(K)return;X();const g=null!==(n=null===(t=e.response)||void 0===t?void 0:t.data)&&void 0!==n?n:{};console.error(`[1Money SDK]: Error(${null!==(r=e.status)&&void 0!==r?r:500}, ${null!==(i=e.code)&&void 0!==i?i:"UNKNOWN"}), Message: ${e.message}, Config: ${null===(o=e.config)||void 0===o?void 0:o.method}, ${null!==(a=null===(s=e.config)||void 0===s?void 0:s.baseURL)&&void 0!==a?a:""}${null!==(c=null===(u=e.config)||void 0===u?void 0:u.url)&&void 0!==c?c:""};`);const y=null!==(f=null===(l=e.response)||void 0===l?void 0:l.status)&&void 0!==f?f:500,m=null!==(d=null===(h=e.response)||void 0===h?void 0:h.headers)&&void 0!==d?d:{};try{let t=g;(null===(p=b.login)||void 0===p?void 0:p.call(b,g,y,m))?(t=yield Promise.resolve(F.login(t,m)),w._resolve(t)):H(e,m)}catch(e){H(e,m)}}))}),w.promiseWrapper}}({isSuccess:(e,t)=>200===t&&0==e.code,isLogin:(e,t)=>401===t||401==e.code,timeout:1e4});function wo(e,t){return bo.request(Object.assign(Object.assign({},t),{method:"get",url:e}))}function vo(e,t,n){return bo.request(Object.assign(Object.assign({},n),{method:"post",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))}function Eo(e){const{baseURL:t,headers:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["baseURL","headers"]);bo.axios.defaults.baseURL=t||("undefined"!=typeof window?location.origin:void 0),n&&(bo.axios.defaults.headers.common=Object.assign(Object.assign({},bo.axios.defaults.headers.common),n)),bo.setting(r)}var Ao={get:wo,post:vo,postForm:function(e,t,n){return bo.request(Object.assign(Object.assign({},n),{method:"post",url:e,data:t,headers:Object.assign({"Content-Type":"multipart/form-data"},null==n?void 0:n.headers)}))},del:function(e,t,n){return bo.request(Object.assign(Object.assign({},n),{method:"delete",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},put:function(e,t,n){return bo.request(Object.assign(Object.assign({},n),{method:"put",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},patch:function(e,t,n){return bo.request(Object.assign(Object.assign({},n),{method:"patch",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},setInitConfig:Eo,axiosStatic:bo.axios};const _o="https://api.1money.network",Oo="v1",So=`/${Oo}/accounts`,Ro={getNonce:e=>wo(`${So}/nonce?address=${e}`,{withCredentials:!1}),getBbNonce:e=>wo(`${So}/bbnonce?address=${e}`,{withCredentials:!1}),getTokenAccount:(e,t)=>wo(`${So}/token_account?address=${e}&token=${t}`,{withCredentials:!1})},xo=`/${Oo}/checkpoints`,To={getNumber:()=>wo(`${xo}/number`,{withCredentials:!1}),getByHash:(e,t=!1)=>wo(`${xo}/by_hash?hash=${e}&full=${t}`,{withCredentials:!1}),getByNumber:(e,t=!1)=>wo(`${xo}/by_number?number=${e}&full=${t}`,{withCredentials:!1}),getReceiptsByNumber:e=>wo(`${xo}/receipts/by_number?number=${e}`,{withCredentials:!1})},ko=`/${Oo}/tokens`,Uo={getTokenMetadata:e=>wo(`${ko}/token_metadata?token=${e}`,{withCredentials:!1}),manageBlacklist:e=>vo(`${ko}/manage_blacklist`,e,{withCredentials:!1}),manageWhitelist:e=>vo(`${ko}/manage_whitelist`,e,{withCredentials:!1}),burnToken:e=>vo(`${ko}/burn`,e,{withCredentials:!1}),grantAuthority:e=>vo(`${ko}/grant_authority`,e,{withCredentials:!1}),issueToken:e=>vo(`${ko}/issue`,e,{withCredentials:!1}),mintToken:e=>vo(`${ko}/mint`,e,{withCredentials:!1}),pauseToken:e=>vo(`${ko}/pause`,e,{withCredentials:!1}),updateMetadata:e=>vo(`${ko}/update_metadata`,e,{withCredentials:!1}),bridgeAndMint:e=>vo(`${ko}/bridge_and_mint`,e,{withCredentials:!1}),burnAndBridge:e=>vo(`${ko}/burn_and_bridge`,e,{withCredentials:!1}),clawbackToken:e=>vo(`${ko}/clawback`,e,{withCredentials:!1})},Bo=`/${Oo}/transactions`,Po={getByHash:e=>wo(`${Bo}/by_hash?hash=${e}`,{withCredentials:!1}),getReceiptByHash:e=>wo(`${Bo}/receipt/by_hash?hash=${e}`,{withCredentials:!1}),getFinalizedByHash:e=>wo(`${Bo}/finalized/by_hash?hash=${e}`,{withCredentials:!1}),estimateFee:(e,t,n,r)=>wo(`${Bo}/estimate_fee?from=${e}&value=${n}&to=${t}&token=${r}`,{withCredentials:!1}),payment:e=>vo(`${Bo}/payment`,e,{withCredentials:!1})},Co=`/${Oo}/chains`,jo={getChainId:()=>wo(`${Co}/chain_id`,{withCredentials:!1})};var Lo,Fo,No,$o;function Io(e){const t=(null==e?void 0:e.network)||"mainnet";let n=_o;switch(t){case"mainnet":n=_o;break;case"testnet":n="https://api.testnet.1money.network";break;case"local":n="http://localhost:18555"}return Eo({baseURL:n,isSuccess:(e,t)=>200===t,timeout:(null==e?void 0:e.timeout)||1e4}),{accounts:Ro,checkpoints:To,tokens:Uo,transactions:Po,chain:jo}}!function(e){e.MasterMint="MasterMintBurn",e.MintBurnTokens="MintBurnTokens",e.Pause="Pause",e.ManageList="ManageList",e.UpdateMetadata="UpdateMetadata",e.Bridge="Bridge",e.Clawback="Clawback"}(Lo||(Lo={})),function(e){e.Grant="Grant",e.Revoke="Revoke"}(Fo||(Fo={})),function(e){e.Add="Add",e.Remove="Remove"}(No||(No={})),function(e){e.Pause="Pause",e.Unpause="Unpause"}($o||($o={}));const Mo=BigInt("0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0");function zo(e,t){return Q(we([ve(e),"boolean"==typeof t.v?t.v?Uint8Array.from([1]):new Uint8Array([]):BigInt(t.v),O(t.r),O(t.s)]))}function Do(e){const n=Q(e.rlpBytes),r=t=>(function(e){if(BigInt(e.s)>Mo)throw new Error("[1Money SDK]: Invalid signature - high S value detected (potential malleability)")}(t),{kind:e.kind,unsigned:e.unsigned,signatureHash:n,txHash:zo(e.rlpBytes,t),signature:t,toRequest:()=>e.toRequest(e.unsigned,t)});return{kind:e.kind,unsigned:e.unsigned,rlpBytes:e.rlpBytes,signatureHash:n,attachSignature:r,sign:e=>t(this,void 0,void 0,function*(){return r(yield e.signDigest(n))})}}const qo=/^\d+$/;function Ho(e,t){throw new Error(`[1Money SDK]: Invalid ${e}: ${String(t)}`)}function Yo(e,t){(!Number.isSafeInteger(t)||t<=0)&&Ho(e,t)}function Ko(e,t){(!Number.isSafeInteger(t)||t<0)&&Ho(e,t)}function Wo(e,t){qo.test(t)||Ho(e,t)}function Vo(e,t){ie(t)||Ho(e,t)}function Jo(e){Yo("chain_id",e.chain_id),Ko("nonce",e.nonce)}function Xo(e){Vo("recipient",e.recipient),Wo("value",e.value),Vo("token",e.token)}function Go(e){Wo("value",e.value),Vo("token",e.token)}function Zo(e){Jo(e),Xo(e);return Do({kind:"payment",unsigned:e,rlpBytes:Se(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.address(e.recipient),Oe.uint(e.value),Oe.address(e.token)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function Qo(e){var t,n;Jo(e),Vo("authority_address",e.authority_address),Vo("token",e.token),t="value",void 0!==(n=e.value)&&Wo(t,n);const r=[Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.string(e.action),Oe.string(e.authority_type),Oe.address(e.authority_address),Oe.address(e.token)];void 0!==e.value&&r.push(Oe.uint(e.value));return Do({kind:"tokenAuthority",unsigned:e,rlpBytes:Se(Oe.list(r)),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function es(e){Jo(e),Xo(e),Yo("source_chain_id",e.source_chain_id);return Do({kind:"tokenBridgeAndMint",unsigned:e,rlpBytes:Se(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.address(e.recipient),Oe.uint(e.value),Oe.address(e.token),Oe.uint(e.source_chain_id),Oe.string(e.source_tx_hash),Oe.string(e.bridge_metadata)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function ts(e){Jo(e),Go(e);return Do({kind:"tokenBurn",unsigned:e,rlpBytes:Se(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.uint(e.value),Oe.address(e.token)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function ns(e){Jo(e),Vo("sender",e.sender),Go(e),Yo("destination_chain_id",e.destination_chain_id),Vo("destination_address",e.destination_address),Wo("escrow_fee",e.escrow_fee);return Do({kind:"tokenBurnAndBridge",unsigned:e,rlpBytes:Se(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.address(e.sender),Oe.uint(e.value),Oe.address(e.token),Oe.uint(e.destination_chain_id),Oe.string(e.destination_address),Oe.uint(e.escrow_fee),Oe.string(e.bridge_metadata),Oe.hex(e.bridge_param)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function rs(e){Jo(e),Xo(e),Vo("from",e.from);return Do({kind:"tokenClawback",unsigned:e,rlpBytes:Se(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.address(e.token),Oe.address(e.from),Oe.address(e.recipient),Oe.uint(e.value)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function is(e){var t;Jo(e),Ko("decimals",e.decimals),Vo("master_authority",e.master_authority);const n=null===(t=e.clawback_enabled)||void 0===t||t,r=Object.assign(Object.assign({},e),{clawback_enabled:n});return Do({kind:"tokenIssue",unsigned:r,rlpBytes:Se(Oe.list([Oe.uint(r.chain_id),Oe.uint(r.nonce),Oe.string(r.symbol),Oe.string(r.name),Oe.uint(r.decimals),Oe.address(r.master_authority),Oe.bool(r.is_private),Oe.bool(n)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function os(e){Jo(e),Vo("address",e.address),Vo("token",e.token);return Do({kind:"tokenManageList",unsigned:e,rlpBytes:Se(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.string(e.action),Oe.address(e.address),Oe.address(e.token)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function ss(e){Jo(e),Vo("token",e.token);const t=e.additional_metadata.map(e=>Oe.list([Oe.string(e.key),Oe.string(e.value)]));return Do({kind:"tokenMetadata",unsigned:e,rlpBytes:Se(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.string(e.name),Oe.string(e.uri),Oe.address(e.token),Oe.list(t)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function as(e){Jo(e),Xo(e);return Do({kind:"tokenMint",unsigned:e,rlpBytes:Se(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.address(e.recipient),Oe.uint(e.value),Oe.address(e.token)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function us(e){Jo(e),Vo("token",e.token);return Do({kind:"tokenPause",unsigned:e,rlpBytes:Se(Oe.list([Oe.uint(e.chain_id),Oe.uint(e.nonce),Oe.string(e.action),Oe.address(e.token)])),toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}const cs=/^0x[0-9a-fA-F]{64}$/;const ls={payment:Zo,tokenManageList:os,tokenBurn:ts,tokenAuthority:Qo,tokenIssue:is,tokenMint:as,tokenPause:us,tokenMetadata:ss,tokenBridgeAndMint:es,tokenBurnAndBridge:ns,tokenClawback:rs};var fs={api:Io,client:Ao};e.TransactionBuilder=ls,e._typeof=Bt,e.api=Io,e.calcSignedTxHash=zo,e.calcTxHash=function(e,t){const n=Pt(e),r=we("boolean"==typeof t.v?t.v?Uint8Array.from([1]):new Uint8Array([]):BigInt(t.v)),i=we(O(t.r)),o=we(O(t.s)),s=new Uint8Array(r.length+i.length+o.length);s.set(r,0),s.set(i,r.length),s.set(o,r.length+i.length);const a=function(e){if(e<56)return Uint8Array.from([192+e]);{const t=[];let n=e;for(;n>0;)t.unshift(255&n),n>>=8;return Uint8Array.from([247+t.length,...t])}}(n.length+s.length),u=new Uint8Array(a.length+n.length+s.length);return u.set(a,0),u.set(n,a.length),u.set(s,a.length+n.length),Q(u)},e.client=Ao,e.createPreparedTx=Do,e.createPrivateKeySigner=function(e){const n=O(e);return{signDigest:e=>t(this,void 0,void 0,function*(){if(!cs.test(e))throw new Error(`[1Money SDK]: Invalid digest: ${e}`);const t=yield Ot(O(e),n,{lowS:!0}),r=t.toCompactRawBytes(),i=r.subarray(0,32),o=r.subarray(32,64);return{r:y(i),s:y(o),v:t.recovery}})}},e.default=fs,e.deriveTokenAddress=function(e,t){const n=e.startsWith("0x")?O(e):S(e),r=t.startsWith("0x")?O(t):S(t),i=new Uint8Array(n.length+r.length);return i.set(n,0),i.set(r,n.length),y(O(Q(i)).slice(12))},e.encodePayload=Pt,e.encodeRlpPayload=Se,e.preparePaymentTx=Zo,e.prepareTokenAuthorityTx=Qo,e.prepareTokenBridgeAndMintTx=es,e.prepareTokenBurnAndBridgeTx=ns,e.prepareTokenBurnTx=ts,e.prepareTokenClawbackTx=rs,e.prepareTokenIssueTx=is,e.prepareTokenManageListTx=os,e.prepareTokenMetadataTx=ss,e.prepareTokenMintTx=as,e.prepareTokenPauseTx=us,e.rlpValue=Oe,e.safePromiseAll=function(e){return e&&e.length?Promise.all(e):Promise.resolve([])},e.safePromiseLine=function(e){return t(this,void 0,void 0,function*(){if(!e||!e.length)return[];const t=[];for(let n=0;n<e.length;n++)try{t.push(yield e[n](n))}catch(e){}return t})},e.signMessage=function(e,n){return t(this,void 0,void 0,function*(){const t=O(Q(Pt(e))),r=O(n),i=yield Ot(t,r,{lowS:!0}),o=i.toCompactRawBytes(),s=o.subarray(0,32),a=o.subarray(32,64);return{r:y(s),s:y(a),v:i.recovery}})},e.toHex=function(e){const t=Bt(e);try{switch(t){case"boolean":return g(e);case"number":case"bigint":return m(e);case"string":if(/^-?\d+$/.test(e))try{return m(BigInt(e))}catch(t){return m(+e)}return w(e);case"uint8array":case"uint16array":case"uint32array":case"int8array":case"int16array":case"int32array":case"arraybuffer":return y(e);case"array":return 0===e.length?"0x":e.every(e=>"number"==typeof e)?y(Uint8Array.from(e)):y(S(JSON.stringify(e)));default:return y(S(JSON.stringify(e)))}}catch(e){throw new Error(`[1Money SDK]: toHex conversion failed: ${e instanceof Error?e.message:String(e)}`)}},Object.defineProperty(e,"__esModule",{value:!0})});
|