@argent/x-shared 1.34.5 → 1.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/bips-CP71ZN9a.js +1 -0
  2. package/dist/bips-zBtnMbia.mjs +114 -0
  3. package/dist/chains/starknet/address.d.ts +2 -2
  4. package/dist/errors/swap.d.ts +12 -0
  5. package/dist/features/swap/index.d.ts +3 -0
  6. package/dist/features/swap/models/index.d.ts +3 -0
  7. package/dist/features/swap/models/order.model.d.ts +48 -0
  8. package/dist/features/swap/models/quote.model.d.ts +82 -0
  9. package/dist/features/swap/models/trade.model.d.ts +186 -0
  10. package/dist/features/swap/services/implementation.d.ts +14 -0
  11. package/dist/features/swap/services/index.d.ts +2 -0
  12. package/dist/features/swap/services/interface.d.ts +8 -0
  13. package/dist/features/swap/services/order.mock.d.ts +7 -0
  14. package/dist/features/swap/services/quote.mock.d.ts +29 -0
  15. package/dist/features/swap/tests/token.mock.d.ts +2 -0
  16. package/dist/features/swap/tests/trade.mock.d.ts +2 -0
  17. package/dist/features/swap/tests/walletAccount.mock.d.ts +43 -0
  18. package/dist/features/swap/utils/index.d.ts +2 -0
  19. package/dist/features/swap/utils/slippage.d.ts +16 -0
  20. package/dist/features/swap/utils/totalFee.d.ts +5 -0
  21. package/dist/index.js +2 -2
  22. package/dist/index.mjs +1326 -1407
  23. package/dist/nfts/BackendNftService.d.ts +2 -4
  24. package/dist/nfts/INFTService.d.ts +1 -1
  25. package/dist/simulation.js +1 -1
  26. package/dist/simulation.mjs +101 -100
  27. package/dist/swap.d.ts +2 -0
  28. package/dist/swap.js +1 -0
  29. package/dist/swap.mjs +183 -0
  30. package/dist/tokens/service/implementation.d.ts +3 -3
  31. package/dist/tokens/service/interface.d.ts +2 -2
  32. package/dist/tokens/service/types/defiPosition.model.d.ts +117 -0
  33. package/dist/tokens/service/types/index.d.ts +1 -0
  34. package/dist/tokens/service/types/{token.model.d.ts → webToken.model.d.ts} +27 -18
  35. package/dist/transactionVersion-CACUj2ch.mjs +793 -0
  36. package/dist/transactionVersion-CaRQ5Df4.js +1 -0
  37. package/dist/utils/bips.d.ts +7 -0
  38. package/dist/utils/index.d.ts +1 -0
  39. package/dist/webToken.model-Cl4dvcmj.mjs +1881 -0
  40. package/dist/webToken.model-Dsd8Rd3e.js +1 -0
  41. package/package.json +9 -2
  42. package/dist/transactionVersion-CL9JUEKt.js +0 -1
  43. package/dist/transactionVersion-CpEa4gsg.mjs +0 -2661
@@ -0,0 +1,1881 @@
1
+ import { z as t } from "zod";
2
+ import { validateChecksumAddress as qr, validateAndParseAddress as zr, getChecksumAddress as Hr, num as Xe, constants as Wr, CairoCustomEnum as Yr } from "starknet";
3
+ import { memoize as fr, noop as Zr } from "lodash-es";
4
+ import { createContext as Kr, useContext as Jr, useEffect as Qr } from "react";
5
+ import "swr";
6
+ import { jsx as et } from "react/jsx-runtime";
7
+ function rn(s, f) {
8
+ let [O, L = ""] = s.split(".");
9
+ const A = O.startsWith("-");
10
+ return A && (O = O.slice(1)), L.length > f ? Number(L[f]) >= 5 ? L = (BigInt(L.slice(0, f)) + 1n).toString().padStart(f, "0") : L = L.slice(0, f) : L = L.padEnd(f, "0"), {
11
+ value: BigInt(`${A ? "-" : ""}${O}${L}`),
12
+ decimals: f
13
+ };
14
+ }
15
+ const hr = t.string().refine((s) => {
16
+ if (s.toLowerCase() === s)
17
+ return !0;
18
+ try {
19
+ return qr(s) && at(s);
20
+ } catch {
21
+ }
22
+ return !1;
23
+ }, "Invalid address (checksum error)"), rt = t.string().refine((s) => {
24
+ try {
25
+ return zr(s);
26
+ } catch {
27
+ }
28
+ return !1;
29
+ }, "Invalid address (validation error)"), be = t.string().regex(/^0x[0-9a-fA-F]+$/, "Invalid address"), tt = be.min(50, "Addresses must at least be 50 characters long").max(66, "Addresses must at most be 66 characters long"), nt = be.length(66, "Address must be 66 characters long"), Re = tt.pipe(hr).transform((s) => `0x${(s.startsWith("0x") ? s.slice(2) : s).padStart(64, "0")}`), tn = Re.or(t.literal("")).transform((s) => s === "" ? void 0 : s).optional(), er = be.transform((s) => `0x${s.replace(/^0x/, "").toLowerCase().padStart(64, "0")}`), st = (s) => Re.safeParse(s).success, it = st, _e = (s) => Hr(s), nn = (s) => {
30
+ const f = _e(s), O = f.slice(0, 2), L = f.slice(2, 6), A = f.slice(-4);
31
+ return `${O}${L}…${A}`;
32
+ }, sn = (s) => {
33
+ const f = _e(s), O = f.slice(0, 2), A = f.slice(2).match(/.{1,4}/g) || [];
34
+ return `${O} ${A.join(" ")}`;
35
+ }, at = (s) => !/^0x[0-9a-f]{63,64}$/.test(s), ot = (s, f) => {
36
+ try {
37
+ return !s || !f ? !1 : Xe.hexToDecimalString(s) === Xe.hexToDecimalString(f);
38
+ } catch {
39
+ }
40
+ return !1;
41
+ }, ct = (s) => {
42
+ try {
43
+ return Xe.toBigInt(be.parse(s)) === Wr.ZERO;
44
+ } catch {
45
+ }
46
+ return !1;
47
+ }, an = (s, f) => !!(f != null && f.some((O) => ot(O, s))), on = fr((s) => {
48
+ const f = s.slice(0, 6), O = s.slice(-4);
49
+ return `${f}…${O}`;
50
+ }), cn = fr((s, f) => {
51
+ if (s.length < f)
52
+ return s;
53
+ const O = Math.floor((f - 1) / 2), L = s.slice(0, O), A = s.slice(-O);
54
+ return `${L}…${A}`;
55
+ }), ln = t.string().regex(/^[a-zA-Z0-9.-]*$/g, "Invalid address character").max(66, "Address cannot be over 66 characters"), lt = nt.pipe(hr).pipe(rt), je = t.string().regex(/^([a-zA-Z0-9-]+\.)+argent.xyz$/, "Invalid Argent name").max(253, "Argent name cannot be over 253 characters"), ut = (s) => je.safeParse(s).success, ft = (s, f) => {
56
+ try {
57
+ return f ? Ve(s) === Ve(f) : !1;
58
+ } catch {
59
+ }
60
+ return !1;
61
+ }, Ve = (s) => je.parse(s).toLowerCase(), rr = t.string().regex(/^([a-zA-Z0-9-]+\.)+stark$/, "Invalid Starknet ID").max(50, "Starknet ID cannot be over 50 characters"), ht = (s) => rr.safeParse(s).success, Et = (s, f) => {
62
+ try {
63
+ return f ? qe(s) === qe(f) : !1;
64
+ } catch {
65
+ }
66
+ return !1;
67
+ }, qe = (s) => rr.parse(s).toLowerCase(), tr = t.union([
68
+ je,
69
+ rr
70
+ ]), un = t.union([
71
+ Re,
72
+ tr
73
+ ]), fn = t.union([
74
+ lt,
75
+ tr
76
+ ]), hn = (s) => tr.safeParse(s).success, En = (s, f) => {
77
+ try {
78
+ return f ? ft(s, f) || Et(s, f) : !1;
79
+ } catch {
80
+ }
81
+ return !1;
82
+ }, pn = (s) => ht(s) ? qe(s) : ut(s) ? Ve(s) : _e(s), pt = t.union([t.literal("0"), t.literal("1")]);
83
+ function dt(s) {
84
+ var f = [];
85
+ if (s.length === 0)
86
+ return "";
87
+ if (typeof s[0] != "string")
88
+ throw new TypeError("Url must be a string. Received " + s[0]);
89
+ if (s[0].match(/^[^/:]+:\/*$/) && s.length > 1) {
90
+ var O = s.shift();
91
+ s[0] = O + s[0];
92
+ }
93
+ s[0].match(/^file:\/\/\//) ? s[0] = s[0].replace(/^([^/:]+):\/*/, "$1:///") : s[0] = s[0].replace(/^([^/:]+):\/*/, "$1://");
94
+ for (var L = 0; L < s.length; L++) {
95
+ var A = s[L];
96
+ if (typeof A != "string")
97
+ throw new TypeError("Url must be a string. Received " + A);
98
+ A !== "" && (L > 0 && (A = A.replace(/^[\/]+/, "")), L < s.length - 1 ? A = A.replace(/[\/]+$/, "") : A = A.replace(/[\/]+$/, "/"), f.push(A));
99
+ }
100
+ var M = f.join("/");
101
+ M = M.replace(/\/(\?|&|#[^!])/g, "$1");
102
+ var x = M.split("?");
103
+ return M = x.shift() + (x.length > 0 ? "?" : "") + x.join("&"), M;
104
+ }
105
+ function mt() {
106
+ var s;
107
+ return typeof arguments[0] == "object" ? s = arguments[0] : s = [].slice.call(arguments), dt(s);
108
+ }
109
+ class ke extends Error {
110
+ constructor({ code: f, message: O, options: L = {} }, A) {
111
+ const { error: M, context: x } = L;
112
+ super(O, { cause: M }), this.errorMessages = A, this.name = "BaseError", this.context = x, this.code = f, this.setMessageByCode(f, O);
113
+ }
114
+ setMessageByCode(f, O) {
115
+ !f || !this.errorMessages || O || (this.message = this.errorMessages[f]);
116
+ }
117
+ toString() {
118
+ return this.message || "";
119
+ }
120
+ }
121
+ var ze;
122
+ (function(s) {
123
+ s.NOT_VALID = "Invalid address", s.NOT_FOUND = "Address not found", s.STARKNAME_NOT_FOUND = "Stark name not found", s.STARKNAME_ERROR = "Could not get address from stark name", s.STARKNAME_INVALID_ADDRESS = "Stark name resolved to an invalid address", s.ARGENT_NAME_NOT_FOUND = "Argent name not found", s.NO_ADDRESS_FROM_ARGENT_NAME = "Could not get address from Argent name", s.ARGENT_NAME_INVALID_ADDRESS = "Argent name resolved to an invalid address", s.NO_ADDRESS_FROM_DOMAIN = "Could not get address from domain", s.ARGENT_NAME_INVALID_NETWORK = "Argent name is not enabled on the requested network";
124
+ })(ze || (ze = {}));
125
+ class ye extends ke {
126
+ constructor(f) {
127
+ super(f, ze), this.name = "AddressError";
128
+ }
129
+ }
130
+ class nr extends Error {
131
+ constructor(f, O, L) {
132
+ super(f), this.status = O, this.data = L, Object.setPrototypeOf(this, nr.prototype);
133
+ }
134
+ }
135
+ var ar;
136
+ (function(s) {
137
+ s.FAILED_TO_FETCH_URL = "Failed to fetch url", s.FAILED_TO_POST_URL = "Failed to post url";
138
+ })(ar || (ar = {}));
139
+ const dn = t.object({
140
+ walletAddress: er,
141
+ ens: je,
142
+ chain: t.enum(["ethereum", "starknet"]),
143
+ deleted: t.boolean(),
144
+ walletDeployed: t.boolean()
145
+ }).or(t.object({
146
+ status: t.string()
147
+ }));
148
+ async function mn(s, f, O, L = "starknet") {
149
+ const A = {
150
+ ens: s,
151
+ chain: L
152
+ }, M = new URLSearchParams(A), x = mt(O, "wallet", `?${M}`);
153
+ try {
154
+ const k = await f.get(x), D = k && "walletAddress" in k ? k.walletAddress : void 0;
155
+ if (!D)
156
+ throw new ye({
157
+ code: "NO_ADDRESS_FROM_ARGENT_NAME"
158
+ });
159
+ if (ct(D))
160
+ throw new ye({
161
+ code: "ARGENT_NAME_NOT_FOUND",
162
+ message: `${s} not found`
163
+ });
164
+ if (!it(D))
165
+ throw new ye({
166
+ code: "ARGENT_NAME_INVALID_ADDRESS",
167
+ message: `${s} resolved to an invalid address (${D})`
168
+ });
169
+ return _e(D);
170
+ } catch (k) {
171
+ throw k instanceof nr && k.status === 404 ? new ye({
172
+ code: "ARGENT_NAME_NOT_FOUND",
173
+ message: `${s} not found`
174
+ }) : k;
175
+ }
176
+ }
177
+ var He;
178
+ (function(s) {
179
+ s.NOT_VALID = "Invalid call";
180
+ })(He || (He = {}));
181
+ class gn extends ke {
182
+ constructor(f) {
183
+ super(f, He), this.name = "CallError";
184
+ }
185
+ }
186
+ var We;
187
+ (function(s) {
188
+ s.NO_NETWORK_OR_MULTICALL = "Missing networkId or multicall", s.NOT_FOUND = "Network not found";
189
+ })(We || (We = {}));
190
+ class In extends ke {
191
+ constructor(f) {
192
+ super(f, We), this.name = "NetworkError";
193
+ }
194
+ }
195
+ const ve = t.union([t.string(), t.number(), t.bigint()]), gt = t.object({
196
+ low: ve,
197
+ high: ve
198
+ }), It = t.array(t.string()).and(t.object({
199
+ __compiled__: t.boolean().optional()
200
+ }).optional()), Rt = t.lazy(() => t.array(t.union([Pe, t.array(Pe), sr]))), Pe = t.union([
201
+ ve,
202
+ gt,
203
+ t.any(),
204
+ t.boolean()
205
+ ]), Nt = t.lazy(() => t.record(t.union([Pe, t.array(Pe), sr]))), sr = t.lazy(() => t.union([Nt, Rt])), At = t.union([sr, It]).optional(), Ot = t.lazy(() => t.object({
206
+ contractAddress: t.string(),
207
+ calldata: At,
208
+ entrypoint: t.string().optional()
209
+ })), Rn = t.lazy(() => Ot.and(t.object({
210
+ entrypoint: t.string()
211
+ }))), le = t.string().refine((s) => typeof parseInt(s) == "number"), Nn = t.tuple([le]), An = t.tuple([le]), On = t.object({
212
+ new_threshold: t.string().refine((s) => typeof parseInt(s) == "number"),
213
+ signers_to_add: t.array(le)
214
+ }), Sn = t.object({
215
+ new_threshold: t.string().refine((s) => typeof parseInt(s) == "number"),
216
+ signers_to_remove: t.array(le)
217
+ }), Tn = t.object({
218
+ signer_to_remove: le,
219
+ signer_to_add: le
220
+ }), wn = t.tuple([le]), vn = t.tuple([le]), Ln = t.tuple([le]), yn = t.tuple([le]).rest(le), Cn = t.object({
221
+ recipient: Re,
222
+ amount: t.object({
223
+ low: ve,
224
+ high: ve
225
+ })
226
+ }), St = t.string().regex(/^(0x)?[0-9a-fA-F]+$/, "Invalid hex string"), Er = St.transform((s) => {
227
+ const f = s.startsWith("0x") ? s.slice(2) : s;
228
+ return `0x${f.length % 2 === 0 ? f : `0${f}`}`;
229
+ }), Dn = t.object({
230
+ cairoVersion: pt,
231
+ accountClassHash: Er
232
+ }), Tt = t.array(t.string()), Pn = t.object({
233
+ implementation: t.string(),
234
+ selector: Er,
235
+ calldata: Tt
236
+ }), bn = t.object({
237
+ owner: t.string(),
238
+ guardian: t.string().optional().transform((s) => s ?? "0")
239
+ });
240
+ var or;
241
+ (function(s) {
242
+ s.Starknet = "Starknet", s.Secp256k1 = "Secp256k1", s.Secp256r1 = "Secp256r1", s.Eip191 = "Eip191", s.Webauthn = "Webauthn";
243
+ })(or || (or = {}));
244
+ function _n(s, f) {
245
+ const O = {
246
+ Starknet: void 0,
247
+ Secp256k1: void 0,
248
+ Secp256r1: void 0,
249
+ Eip191: void 0,
250
+ Webauthn: void 0
251
+ };
252
+ return O[f] = s, new Yr(O);
253
+ }
254
+ var Ye;
255
+ (function(s) {
256
+ s.NOT_FOUND = "Account not found", s.CALCULATED_ADDRESS_NO_MATCH = "Calculated address does not match account address";
257
+ })(Ye || (Ye = {}));
258
+ class jn extends ke {
259
+ constructor(f) {
260
+ super(f, Ye), this.name = "AccountError";
261
+ }
262
+ }
263
+ function wt(s) {
264
+ return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
265
+ }
266
+ var Ze = { exports: {} };
267
+ (function(s, f) {
268
+ f = s.exports = P;
269
+ var O;
270
+ typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? O = function() {
271
+ var e = Array.prototype.slice.call(arguments, 0);
272
+ e.unshift("SEMVER"), console.log.apply(console, e);
273
+ } : O = function() {
274
+ }, f.SEMVER_SPEC_VERSION = "2.0.0";
275
+ var L = 256, A = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
276
+ 9007199254740991, M = 16, x = L - 6, k = f.re = [], D = f.safeRe = [], I = f.src = [], d = f.tokens = {}, K = 0;
277
+ function b(e) {
278
+ d[e] = K++;
279
+ }
280
+ var pe = "[a-zA-Z0-9-]", ne = [
281
+ ["\\s", 1],
282
+ ["\\d", L],
283
+ [pe, x]
284
+ ];
285
+ function de(e) {
286
+ for (var a = 0; a < ne.length; a++) {
287
+ var c = ne[a][0], R = ne[a][1];
288
+ e = e.split(c + "*").join(c + "{0," + R + "}").split(c + "+").join(c + "{1," + R + "}");
289
+ }
290
+ return e;
291
+ }
292
+ b("NUMERICIDENTIFIER"), I[d.NUMERICIDENTIFIER] = "0|[1-9]\\d*", b("NUMERICIDENTIFIERLOOSE"), I[d.NUMERICIDENTIFIERLOOSE] = "\\d+", b("NONNUMERICIDENTIFIER"), I[d.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-]" + pe + "*", b("MAINVERSION"), I[d.MAINVERSION] = "(" + I[d.NUMERICIDENTIFIER] + ")\\.(" + I[d.NUMERICIDENTIFIER] + ")\\.(" + I[d.NUMERICIDENTIFIER] + ")", b("MAINVERSIONLOOSE"), I[d.MAINVERSIONLOOSE] = "(" + I[d.NUMERICIDENTIFIERLOOSE] + ")\\.(" + I[d.NUMERICIDENTIFIERLOOSE] + ")\\.(" + I[d.NUMERICIDENTIFIERLOOSE] + ")", b("PRERELEASEIDENTIFIER"), I[d.PRERELEASEIDENTIFIER] = "(?:" + I[d.NUMERICIDENTIFIER] + "|" + I[d.NONNUMERICIDENTIFIER] + ")", b("PRERELEASEIDENTIFIERLOOSE"), I[d.PRERELEASEIDENTIFIERLOOSE] = "(?:" + I[d.NUMERICIDENTIFIERLOOSE] + "|" + I[d.NONNUMERICIDENTIFIER] + ")", b("PRERELEASE"), I[d.PRERELEASE] = "(?:-(" + I[d.PRERELEASEIDENTIFIER] + "(?:\\." + I[d.PRERELEASEIDENTIFIER] + ")*))", b("PRERELEASELOOSE"), I[d.PRERELEASELOOSE] = "(?:-?(" + I[d.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + I[d.PRERELEASEIDENTIFIERLOOSE] + ")*))", b("BUILDIDENTIFIER"), I[d.BUILDIDENTIFIER] = pe + "+", b("BUILD"), I[d.BUILD] = "(?:\\+(" + I[d.BUILDIDENTIFIER] + "(?:\\." + I[d.BUILDIDENTIFIER] + ")*))", b("FULL"), b("FULLPLAIN"), I[d.FULLPLAIN] = "v?" + I[d.MAINVERSION] + I[d.PRERELEASE] + "?" + I[d.BUILD] + "?", I[d.FULL] = "^" + I[d.FULLPLAIN] + "$", b("LOOSEPLAIN"), I[d.LOOSEPLAIN] = "[v=\\s]*" + I[d.MAINVERSIONLOOSE] + I[d.PRERELEASELOOSE] + "?" + I[d.BUILD] + "?", b("LOOSE"), I[d.LOOSE] = "^" + I[d.LOOSEPLAIN] + "$", b("GTLT"), I[d.GTLT] = "((?:<|>)?=?)", b("XRANGEIDENTIFIERLOOSE"), I[d.XRANGEIDENTIFIERLOOSE] = I[d.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*", b("XRANGEIDENTIFIER"), I[d.XRANGEIDENTIFIER] = I[d.NUMERICIDENTIFIER] + "|x|X|\\*", b("XRANGEPLAIN"), I[d.XRANGEPLAIN] = "[v=\\s]*(" + I[d.XRANGEIDENTIFIER] + ")(?:\\.(" + I[d.XRANGEIDENTIFIER] + ")(?:\\.(" + I[d.XRANGEIDENTIFIER] + ")(?:" + I[d.PRERELEASE] + ")?" + I[d.BUILD] + "?)?)?", b("XRANGEPLAINLOOSE"), I[d.XRANGEPLAINLOOSE] = "[v=\\s]*(" + I[d.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + I[d.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + I[d.XRANGEIDENTIFIERLOOSE] + ")(?:" + I[d.PRERELEASELOOSE] + ")?" + I[d.BUILD] + "?)?)?", b("XRANGE"), I[d.XRANGE] = "^" + I[d.GTLT] + "\\s*" + I[d.XRANGEPLAIN] + "$", b("XRANGELOOSE"), I[d.XRANGELOOSE] = "^" + I[d.GTLT] + "\\s*" + I[d.XRANGEPLAINLOOSE] + "$", b("COERCE"), I[d.COERCE] = "(^|[^\\d])(\\d{1," + M + "})(?:\\.(\\d{1," + M + "}))?(?:\\.(\\d{1," + M + "}))?(?:$|[^\\d])", b("COERCERTL"), k[d.COERCERTL] = new RegExp(I[d.COERCE], "g"), D[d.COERCERTL] = new RegExp(de(I[d.COERCE]), "g"), b("LONETILDE"), I[d.LONETILDE] = "(?:~>?)", b("TILDETRIM"), I[d.TILDETRIM] = "(\\s*)" + I[d.LONETILDE] + "\\s+", k[d.TILDETRIM] = new RegExp(I[d.TILDETRIM], "g"), D[d.TILDETRIM] = new RegExp(de(I[d.TILDETRIM]), "g");
293
+ var me = "$1~";
294
+ b("TILDE"), I[d.TILDE] = "^" + I[d.LONETILDE] + I[d.XRANGEPLAIN] + "$", b("TILDELOOSE"), I[d.TILDELOOSE] = "^" + I[d.LONETILDE] + I[d.XRANGEPLAINLOOSE] + "$", b("LONECARET"), I[d.LONECARET] = "(?:\\^)", b("CARETTRIM"), I[d.CARETTRIM] = "(\\s*)" + I[d.LONECARET] + "\\s+", k[d.CARETTRIM] = new RegExp(I[d.CARETTRIM], "g"), D[d.CARETTRIM] = new RegExp(de(I[d.CARETTRIM]), "g");
295
+ var Te = "$1^";
296
+ b("CARET"), I[d.CARET] = "^" + I[d.LONECARET] + I[d.XRANGEPLAIN] + "$", b("CARETLOOSE"), I[d.CARETLOOSE] = "^" + I[d.LONECARET] + I[d.XRANGEPLAINLOOSE] + "$", b("COMPARATORLOOSE"), I[d.COMPARATORLOOSE] = "^" + I[d.GTLT] + "\\s*(" + I[d.LOOSEPLAIN] + ")$|^$", b("COMPARATOR"), I[d.COMPARATOR] = "^" + I[d.GTLT] + "\\s*(" + I[d.FULLPLAIN] + ")$|^$", b("COMPARATORTRIM"), I[d.COMPARATORTRIM] = "(\\s*)" + I[d.GTLT] + "\\s*(" + I[d.LOOSEPLAIN] + "|" + I[d.XRANGEPLAIN] + ")", k[d.COMPARATORTRIM] = new RegExp(I[d.COMPARATORTRIM], "g"), D[d.COMPARATORTRIM] = new RegExp(de(I[d.COMPARATORTRIM]), "g");
297
+ var T = "$1$2$3";
298
+ b("HYPHENRANGE"), I[d.HYPHENRANGE] = "^\\s*(" + I[d.XRANGEPLAIN] + ")\\s+-\\s+(" + I[d.XRANGEPLAIN] + ")\\s*$", b("HYPHENRANGELOOSE"), I[d.HYPHENRANGELOOSE] = "^\\s*(" + I[d.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + I[d.XRANGEPLAINLOOSE] + ")\\s*$", b("STAR"), I[d.STAR] = "(<|>)?=?\\s*\\*";
299
+ for (var re = 0; re < K; re++)
300
+ O(re, I[re]), k[re] || (k[re] = new RegExp(I[re]), D[re] = new RegExp(de(I[re])));
301
+ f.parse = ue;
302
+ function ue(e, a) {
303
+ if ((!a || typeof a != "object") && (a = {
304
+ loose: !!a,
305
+ includePrerelease: !1
306
+ }), e instanceof P)
307
+ return e;
308
+ if (typeof e != "string" || e.length > L)
309
+ return null;
310
+ var c = a.loose ? D[d.LOOSE] : D[d.FULL];
311
+ if (!c.test(e))
312
+ return null;
313
+ try {
314
+ return new P(e, a);
315
+ } catch {
316
+ return null;
317
+ }
318
+ }
319
+ f.valid = we;
320
+ function we(e, a) {
321
+ var c = ue(e, a);
322
+ return c ? c.version : null;
323
+ }
324
+ f.clean = J;
325
+ function J(e, a) {
326
+ var c = ue(e.trim().replace(/^[=v]+/, ""), a);
327
+ return c ? c.version : null;
328
+ }
329
+ f.SemVer = P;
330
+ function P(e, a) {
331
+ if ((!a || typeof a != "object") && (a = {
332
+ loose: !!a,
333
+ includePrerelease: !1
334
+ }), e instanceof P) {
335
+ if (e.loose === a.loose)
336
+ return e;
337
+ e = e.version;
338
+ } else if (typeof e != "string")
339
+ throw new TypeError("Invalid Version: " + e);
340
+ if (e.length > L)
341
+ throw new TypeError("version is longer than " + L + " characters");
342
+ if (!(this instanceof P))
343
+ return new P(e, a);
344
+ O("SemVer", e, a), this.options = a, this.loose = !!a.loose;
345
+ var c = e.trim().match(a.loose ? D[d.LOOSE] : D[d.FULL]);
346
+ if (!c)
347
+ throw new TypeError("Invalid Version: " + e);
348
+ if (this.raw = e, this.major = +c[1], this.minor = +c[2], this.patch = +c[3], this.major > A || this.major < 0)
349
+ throw new TypeError("Invalid major version");
350
+ if (this.minor > A || this.minor < 0)
351
+ throw new TypeError("Invalid minor version");
352
+ if (this.patch > A || this.patch < 0)
353
+ throw new TypeError("Invalid patch version");
354
+ c[4] ? this.prerelease = c[4].split(".").map(function(R) {
355
+ if (/^[0-9]+$/.test(R)) {
356
+ var S = +R;
357
+ if (S >= 0 && S < A)
358
+ return S;
359
+ }
360
+ return R;
361
+ }) : this.prerelease = [], this.build = c[5] ? c[5].split(".") : [], this.format();
362
+ }
363
+ P.prototype.format = function() {
364
+ return this.version = this.major + "." + this.minor + "." + this.patch, this.prerelease.length && (this.version += "-" + this.prerelease.join(".")), this.version;
365
+ }, P.prototype.toString = function() {
366
+ return this.version;
367
+ }, P.prototype.compare = function(e) {
368
+ return O("SemVer.compare", this.version, this.options, e), e instanceof P || (e = new P(e, this.options)), this.compareMain(e) || this.comparePre(e);
369
+ }, P.prototype.compareMain = function(e) {
370
+ return e instanceof P || (e = new P(e, this.options)), E(this.major, e.major) || E(this.minor, e.minor) || E(this.patch, e.patch);
371
+ }, P.prototype.comparePre = function(e) {
372
+ if (e instanceof P || (e = new P(e, this.options)), this.prerelease.length && !e.prerelease.length)
373
+ return -1;
374
+ if (!this.prerelease.length && e.prerelease.length)
375
+ return 1;
376
+ if (!this.prerelease.length && !e.prerelease.length)
377
+ return 0;
378
+ var a = 0;
379
+ do {
380
+ var c = this.prerelease[a], R = e.prerelease[a];
381
+ if (O("prerelease compare", a, c, R), c === void 0 && R === void 0)
382
+ return 0;
383
+ if (R === void 0)
384
+ return 1;
385
+ if (c === void 0)
386
+ return -1;
387
+ if (c === R)
388
+ continue;
389
+ return E(c, R);
390
+ } while (++a);
391
+ }, P.prototype.compareBuild = function(e) {
392
+ e instanceof P || (e = new P(e, this.options));
393
+ var a = 0;
394
+ do {
395
+ var c = this.build[a], R = e.build[a];
396
+ if (O("prerelease compare", a, c, R), c === void 0 && R === void 0)
397
+ return 0;
398
+ if (R === void 0)
399
+ return 1;
400
+ if (c === void 0)
401
+ return -1;
402
+ if (c === R)
403
+ continue;
404
+ return E(c, R);
405
+ } while (++a);
406
+ }, P.prototype.inc = function(e, a) {
407
+ switch (e) {
408
+ case "premajor":
409
+ this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", a);
410
+ break;
411
+ case "preminor":
412
+ this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", a);
413
+ break;
414
+ case "prepatch":
415
+ this.prerelease.length = 0, this.inc("patch", a), this.inc("pre", a);
416
+ break;
417
+ case "prerelease":
418
+ this.prerelease.length === 0 && this.inc("patch", a), this.inc("pre", a);
419
+ break;
420
+ case "major":
421
+ (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
422
+ break;
423
+ case "minor":
424
+ (this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
425
+ break;
426
+ case "patch":
427
+ this.prerelease.length === 0 && this.patch++, this.prerelease = [];
428
+ break;
429
+ case "pre":
430
+ if (this.prerelease.length === 0)
431
+ this.prerelease = [0];
432
+ else {
433
+ for (var c = this.prerelease.length; --c >= 0; )
434
+ typeof this.prerelease[c] == "number" && (this.prerelease[c]++, c = -2);
435
+ c === -1 && this.prerelease.push(0);
436
+ }
437
+ a && (this.prerelease[0] === a ? isNaN(this.prerelease[1]) && (this.prerelease = [a, 0]) : this.prerelease = [a, 0]);
438
+ break;
439
+ default:
440
+ throw new Error("invalid increment argument: " + e);
441
+ }
442
+ return this.format(), this.raw = this.version, this;
443
+ }, f.inc = r;
444
+ function r(e, a, c, R) {
445
+ typeof c == "string" && (R = c, c = void 0);
446
+ try {
447
+ return new P(e, c).inc(a, R).version;
448
+ } catch {
449
+ return null;
450
+ }
451
+ }
452
+ f.diff = n;
453
+ function n(e, a) {
454
+ if (q(e, a))
455
+ return null;
456
+ var c = ue(e), R = ue(a), S = "";
457
+ if (c.prerelease.length || R.prerelease.length) {
458
+ S = "pre";
459
+ var w = "prerelease";
460
+ }
461
+ for (var v in c)
462
+ if ((v === "major" || v === "minor" || v === "patch") && c[v] !== R[v])
463
+ return S + v;
464
+ return w;
465
+ }
466
+ f.compareIdentifiers = E;
467
+ var i = /^[0-9]+$/;
468
+ function E(e, a) {
469
+ var c = i.test(e), R = i.test(a);
470
+ return c && R && (e = +e, a = +a), e === a ? 0 : c && !R ? -1 : R && !c ? 1 : e < a ? -1 : 1;
471
+ }
472
+ f.rcompareIdentifiers = l;
473
+ function l(e, a) {
474
+ return E(a, e);
475
+ }
476
+ f.major = h;
477
+ function h(e, a) {
478
+ return new P(e, a).major;
479
+ }
480
+ f.minor = g;
481
+ function g(e, a) {
482
+ return new P(e, a).minor;
483
+ }
484
+ f.patch = o;
485
+ function o(e, a) {
486
+ return new P(e, a).patch;
487
+ }
488
+ f.compare = u;
489
+ function u(e, a, c) {
490
+ return new P(e, c).compare(new P(a, c));
491
+ }
492
+ f.compareLoose = m;
493
+ function m(e, a) {
494
+ return u(e, a, !0);
495
+ }
496
+ f.compareBuild = p;
497
+ function p(e, a, c) {
498
+ var R = new P(e, c), S = new P(a, c);
499
+ return R.compare(S) || R.compareBuild(S);
500
+ }
501
+ f.rcompare = N;
502
+ function N(e, a, c) {
503
+ return u(a, e, c);
504
+ }
505
+ f.sort = y;
506
+ function y(e, a) {
507
+ return e.sort(function(c, R) {
508
+ return f.compareBuild(c, R, a);
509
+ });
510
+ }
511
+ f.rsort = C;
512
+ function C(e, a) {
513
+ return e.sort(function(c, R) {
514
+ return f.compareBuild(R, c, a);
515
+ });
516
+ }
517
+ f.gt = F;
518
+ function F(e, a, c) {
519
+ return u(e, a, c) > 0;
520
+ }
521
+ f.lt = V;
522
+ function V(e, a, c) {
523
+ return u(e, a, c) < 0;
524
+ }
525
+ f.eq = q;
526
+ function q(e, a, c) {
527
+ return u(e, a, c) === 0;
528
+ }
529
+ f.neq = B;
530
+ function B(e, a, c) {
531
+ return u(e, a, c) !== 0;
532
+ }
533
+ f.gte = X;
534
+ function X(e, a, c) {
535
+ return u(e, a, c) >= 0;
536
+ }
537
+ f.lte = H;
538
+ function H(e, a, c) {
539
+ return u(e, a, c) <= 0;
540
+ }
541
+ f.cmp = ge;
542
+ function ge(e, a, c, R) {
543
+ switch (a) {
544
+ case "===":
545
+ return typeof e == "object" && (e = e.version), typeof c == "object" && (c = c.version), e === c;
546
+ case "!==":
547
+ return typeof e == "object" && (e = e.version), typeof c == "object" && (c = c.version), e !== c;
548
+ case "":
549
+ case "=":
550
+ case "==":
551
+ return q(e, c, R);
552
+ case "!=":
553
+ return B(e, c, R);
554
+ case ">":
555
+ return F(e, c, R);
556
+ case ">=":
557
+ return X(e, c, R);
558
+ case "<":
559
+ return V(e, c, R);
560
+ case "<=":
561
+ return H(e, c, R);
562
+ default:
563
+ throw new TypeError("Invalid operator: " + a);
564
+ }
565
+ }
566
+ f.Comparator = Z;
567
+ function Z(e, a) {
568
+ if ((!a || typeof a != "object") && (a = {
569
+ loose: !!a,
570
+ includePrerelease: !1
571
+ }), e instanceof Z) {
572
+ if (e.loose === !!a.loose)
573
+ return e;
574
+ e = e.value;
575
+ }
576
+ if (!(this instanceof Z))
577
+ return new Z(e, a);
578
+ e = e.trim().split(/\s+/).join(" "), O("comparator", e, a), this.options = a, this.loose = !!a.loose, this.parse(e), this.semver === fe ? this.value = "" : this.value = this.operator + this.semver.version, O("comp", this);
579
+ }
580
+ var fe = {};
581
+ Z.prototype.parse = function(e) {
582
+ var a = this.options.loose ? D[d.COMPARATORLOOSE] : D[d.COMPARATOR], c = e.match(a);
583
+ if (!c)
584
+ throw new TypeError("Invalid comparator: " + e);
585
+ this.operator = c[1] !== void 0 ? c[1] : "", this.operator === "=" && (this.operator = ""), c[2] ? this.semver = new P(c[2], this.options.loose) : this.semver = fe;
586
+ }, Z.prototype.toString = function() {
587
+ return this.value;
588
+ }, Z.prototype.test = function(e) {
589
+ if (O("Comparator.test", e, this.options.loose), this.semver === fe || e === fe)
590
+ return !0;
591
+ if (typeof e == "string")
592
+ try {
593
+ e = new P(e, this.options);
594
+ } catch {
595
+ return !1;
596
+ }
597
+ return ge(e, this.operator, this.semver, this.options);
598
+ }, Z.prototype.intersects = function(e, a) {
599
+ if (!(e instanceof Z))
600
+ throw new TypeError("a Comparator is required");
601
+ (!a || typeof a != "object") && (a = {
602
+ loose: !!a,
603
+ includePrerelease: !1
604
+ });
605
+ var c;
606
+ if (this.operator === "")
607
+ return this.value === "" ? !0 : (c = new G(e.value, a), Le(this.value, c, a));
608
+ if (e.operator === "")
609
+ return e.value === "" ? !0 : (c = new G(this.value, a), Le(e.semver, c, a));
610
+ var R = (this.operator === ">=" || this.operator === ">") && (e.operator === ">=" || e.operator === ">"), S = (this.operator === "<=" || this.operator === "<") && (e.operator === "<=" || e.operator === "<"), w = this.semver.version === e.semver.version, v = (this.operator === ">=" || this.operator === "<=") && (e.operator === ">=" || e.operator === "<="), $ = ge(this.semver, "<", e.semver, a) && (this.operator === ">=" || this.operator === ">") && (e.operator === "<=" || e.operator === "<"), j = ge(this.semver, ">", e.semver, a) && (this.operator === "<=" || this.operator === "<") && (e.operator === ">=" || e.operator === ">");
611
+ return R || S || w && v || $ || j;
612
+ }, f.Range = G;
613
+ function G(e, a) {
614
+ if ((!a || typeof a != "object") && (a = {
615
+ loose: !!a,
616
+ includePrerelease: !1
617
+ }), e instanceof G)
618
+ return e.loose === !!a.loose && e.includePrerelease === !!a.includePrerelease ? e : new G(e.raw, a);
619
+ if (e instanceof Z)
620
+ return new G(e.value, a);
621
+ if (!(this instanceof G))
622
+ return new G(e, a);
623
+ if (this.options = a, this.loose = !!a.loose, this.includePrerelease = !!a.includePrerelease, this.raw = e.trim().split(/\s+/).join(" "), this.set = this.raw.split("||").map(function(c) {
624
+ return this.parseRange(c.trim());
625
+ }, this).filter(function(c) {
626
+ return c.length;
627
+ }), !this.set.length)
628
+ throw new TypeError("Invalid SemVer Range: " + this.raw);
629
+ this.format();
630
+ }
631
+ G.prototype.format = function() {
632
+ return this.range = this.set.map(function(e) {
633
+ return e.join(" ").trim();
634
+ }).join("||").trim(), this.range;
635
+ }, G.prototype.toString = function() {
636
+ return this.range;
637
+ }, G.prototype.parseRange = function(e) {
638
+ var a = this.options.loose, c = a ? D[d.HYPHENRANGELOOSE] : D[d.HYPHENRANGE];
639
+ e = e.replace(c, jr), O("hyphen replace", e), e = e.replace(D[d.COMPARATORTRIM], T), O("comparator trim", e, D[d.COMPARATORTRIM]), e = e.replace(D[d.TILDETRIM], me), e = e.replace(D[d.CARETTRIM], Te), e = e.split(/\s+/).join(" ");
640
+ var R = a ? D[d.COMPARATORLOOSE] : D[d.COMPARATOR], S = e.split(" ").map(function(w) {
641
+ return Y(w, this.options);
642
+ }, this).join(" ").split(/\s+/);
643
+ return this.options.loose && (S = S.filter(function(w) {
644
+ return !!w.match(R);
645
+ })), S = S.map(function(w) {
646
+ return new Z(w, this.options);
647
+ }, this), S;
648
+ }, G.prototype.intersects = function(e, a) {
649
+ if (!(e instanceof G))
650
+ throw new TypeError("a Range is required");
651
+ return this.set.some(function(c) {
652
+ return Ne(c, a) && e.set.some(function(R) {
653
+ return Ne(R, a) && c.every(function(S) {
654
+ return R.every(function(w) {
655
+ return S.intersects(w, a);
656
+ });
657
+ });
658
+ });
659
+ });
660
+ };
661
+ function Ne(e, a) {
662
+ for (var c = !0, R = e.slice(), S = R.pop(); c && R.length; )
663
+ c = R.every(function(w) {
664
+ return S.intersects(w, a);
665
+ }), S = R.pop();
666
+ return c;
667
+ }
668
+ f.toComparators = Q;
669
+ function Q(e, a) {
670
+ return new G(e, a).set.map(function(c) {
671
+ return c.map(function(R) {
672
+ return R.value;
673
+ }).join(" ").trim().split(" ");
674
+ });
675
+ }
676
+ function Y(e, a) {
677
+ return O("comp", e, a), e = Cr(e, a), O("caret", e), e = Lr(e, a), O("tildes", e), e = Pr(e, a), O("xrange", e), e = _r(e, a), O("stars", e), e;
678
+ }
679
+ function U(e) {
680
+ return !e || e.toLowerCase() === "x" || e === "*";
681
+ }
682
+ function Lr(e, a) {
683
+ return e.trim().split(/\s+/).map(function(c) {
684
+ return yr(c, a);
685
+ }).join(" ");
686
+ }
687
+ function yr(e, a) {
688
+ var c = a.loose ? D[d.TILDELOOSE] : D[d.TILDE];
689
+ return e.replace(c, function(R, S, w, v, $) {
690
+ O("tilde", e, R, S, w, v, $);
691
+ var j;
692
+ return U(S) ? j = "" : U(w) ? j = ">=" + S + ".0.0 <" + (+S + 1) + ".0.0" : U(v) ? j = ">=" + S + "." + w + ".0 <" + S + "." + (+w + 1) + ".0" : $ ? (O("replaceTilde pr", $), j = ">=" + S + "." + w + "." + v + "-" + $ + " <" + S + "." + (+w + 1) + ".0") : j = ">=" + S + "." + w + "." + v + " <" + S + "." + (+w + 1) + ".0", O("tilde return", j), j;
693
+ });
694
+ }
695
+ function Cr(e, a) {
696
+ return e.trim().split(/\s+/).map(function(c) {
697
+ return Dr(c, a);
698
+ }).join(" ");
699
+ }
700
+ function Dr(e, a) {
701
+ O("caret", e, a);
702
+ var c = a.loose ? D[d.CARETLOOSE] : D[d.CARET];
703
+ return e.replace(c, function(R, S, w, v, $) {
704
+ O("caret", e, R, S, w, v, $);
705
+ var j;
706
+ return U(S) ? j = "" : U(w) ? j = ">=" + S + ".0.0 <" + (+S + 1) + ".0.0" : U(v) ? S === "0" ? j = ">=" + S + "." + w + ".0 <" + S + "." + (+w + 1) + ".0" : j = ">=" + S + "." + w + ".0 <" + (+S + 1) + ".0.0" : $ ? (O("replaceCaret pr", $), S === "0" ? w === "0" ? j = ">=" + S + "." + w + "." + v + "-" + $ + " <" + S + "." + w + "." + (+v + 1) : j = ">=" + S + "." + w + "." + v + "-" + $ + " <" + S + "." + (+w + 1) + ".0" : j = ">=" + S + "." + w + "." + v + "-" + $ + " <" + (+S + 1) + ".0.0") : (O("no pr"), S === "0" ? w === "0" ? j = ">=" + S + "." + w + "." + v + " <" + S + "." + w + "." + (+v + 1) : j = ">=" + S + "." + w + "." + v + " <" + S + "." + (+w + 1) + ".0" : j = ">=" + S + "." + w + "." + v + " <" + (+S + 1) + ".0.0"), O("caret return", j), j;
707
+ });
708
+ }
709
+ function Pr(e, a) {
710
+ return O("replaceXRanges", e, a), e.split(/\s+/).map(function(c) {
711
+ return br(c, a);
712
+ }).join(" ");
713
+ }
714
+ function br(e, a) {
715
+ e = e.trim();
716
+ var c = a.loose ? D[d.XRANGELOOSE] : D[d.XRANGE];
717
+ return e.replace(c, function(R, S, w, v, $, j) {
718
+ O("xRange", e, R, S, w, v, $, j);
719
+ var he = U(w), Ee = he || U(v), se = Ee || U($), te = se;
720
+ return S === "=" && te && (S = ""), j = a.includePrerelease ? "-0" : "", he ? S === ">" || S === "<" ? R = "<0.0.0-0" : R = "*" : S && te ? (Ee && (v = 0), $ = 0, S === ">" ? (S = ">=", Ee ? (w = +w + 1, v = 0, $ = 0) : (v = +v + 1, $ = 0)) : S === "<=" && (S = "<", Ee ? w = +w + 1 : v = +v + 1), R = S + w + "." + v + "." + $ + j) : Ee ? R = ">=" + w + ".0.0" + j + " <" + (+w + 1) + ".0.0" + j : se && (R = ">=" + w + "." + v + ".0" + j + " <" + w + "." + (+v + 1) + ".0" + j), O("xRange return", R), R;
721
+ });
722
+ }
723
+ function _r(e, a) {
724
+ return O("replaceStars", e, a), e.trim().replace(D[d.STAR], "");
725
+ }
726
+ function jr(e, a, c, R, S, w, v, $, j, he, Ee, se, te) {
727
+ return U(c) ? a = "" : U(R) ? a = ">=" + c + ".0.0" : U(S) ? a = ">=" + c + "." + R + ".0" : a = ">=" + a, U(j) ? $ = "" : U(he) ? $ = "<" + (+j + 1) + ".0.0" : U(Ee) ? $ = "<" + j + "." + (+he + 1) + ".0" : se ? $ = "<=" + j + "." + he + "." + Ee + "-" + se : $ = "<=" + $, (a + " " + $).trim();
728
+ }
729
+ G.prototype.test = function(e) {
730
+ if (!e)
731
+ return !1;
732
+ if (typeof e == "string")
733
+ try {
734
+ e = new P(e, this.options);
735
+ } catch {
736
+ return !1;
737
+ }
738
+ for (var a = 0; a < this.set.length; a++)
739
+ if (kr(this.set[a], e, this.options))
740
+ return !0;
741
+ return !1;
742
+ };
743
+ function kr(e, a, c) {
744
+ for (var R = 0; R < e.length; R++)
745
+ if (!e[R].test(a))
746
+ return !1;
747
+ if (a.prerelease.length && !c.includePrerelease) {
748
+ for (R = 0; R < e.length; R++)
749
+ if (O(e[R].semver), e[R].semver !== fe && e[R].semver.prerelease.length > 0) {
750
+ var S = e[R].semver;
751
+ if (S.major === a.major && S.minor === a.minor && S.patch === a.patch)
752
+ return !0;
753
+ }
754
+ return !1;
755
+ }
756
+ return !0;
757
+ }
758
+ f.satisfies = Le;
759
+ function Le(e, a, c) {
760
+ try {
761
+ a = new G(a, c);
762
+ } catch {
763
+ return !1;
764
+ }
765
+ return a.test(e);
766
+ }
767
+ f.maxSatisfying = Fr;
768
+ function Fr(e, a, c) {
769
+ var R = null, S = null;
770
+ try {
771
+ var w = new G(a, c);
772
+ } catch {
773
+ return null;
774
+ }
775
+ return e.forEach(function(v) {
776
+ w.test(v) && (!R || S.compare(v) === -1) && (R = v, S = new P(R, c));
777
+ }), R;
778
+ }
779
+ f.minSatisfying = Ur;
780
+ function Ur(e, a, c) {
781
+ var R = null, S = null;
782
+ try {
783
+ var w = new G(a, c);
784
+ } catch {
785
+ return null;
786
+ }
787
+ return e.forEach(function(v) {
788
+ w.test(v) && (!R || S.compare(v) === 1) && (R = v, S = new P(R, c));
789
+ }), R;
790
+ }
791
+ f.minVersion = Br;
792
+ function Br(e, a) {
793
+ e = new G(e, a);
794
+ var c = new P("0.0.0");
795
+ if (e.test(c) || (c = new P("0.0.0-0"), e.test(c)))
796
+ return c;
797
+ c = null;
798
+ for (var R = 0; R < e.set.length; ++R) {
799
+ var S = e.set[R];
800
+ S.forEach(function(w) {
801
+ var v = new P(w.semver.version);
802
+ switch (w.operator) {
803
+ case ">":
804
+ v.prerelease.length === 0 ? v.patch++ : v.prerelease.push(0), v.raw = v.format();
805
+ case "":
806
+ case ">=":
807
+ (!c || F(c, v)) && (c = v);
808
+ break;
809
+ case "<":
810
+ case "<=":
811
+ break;
812
+ default:
813
+ throw new Error("Unexpected operation: " + w.operator);
814
+ }
815
+ });
816
+ }
817
+ return c && e.test(c) ? c : null;
818
+ }
819
+ f.validRange = xr;
820
+ function xr(e, a) {
821
+ try {
822
+ return new G(e, a).range || "*";
823
+ } catch {
824
+ return null;
825
+ }
826
+ }
827
+ f.ltr = Mr;
828
+ function Mr(e, a, c) {
829
+ return Ue(e, a, "<", c);
830
+ }
831
+ f.gtr = Gr;
832
+ function Gr(e, a, c) {
833
+ return Ue(e, a, ">", c);
834
+ }
835
+ f.outside = Ue;
836
+ function Ue(e, a, c, R) {
837
+ e = new P(e, R), a = new G(a, R);
838
+ var S, w, v, $, j;
839
+ switch (c) {
840
+ case ">":
841
+ S = F, w = H, v = V, $ = ">", j = ">=";
842
+ break;
843
+ case "<":
844
+ S = V, w = X, v = F, $ = "<", j = "<=";
845
+ break;
846
+ default:
847
+ throw new TypeError('Must provide a hilo val of "<" or ">"');
848
+ }
849
+ if (Le(e, a, R))
850
+ return !1;
851
+ for (var he = 0; he < a.set.length; ++he) {
852
+ var Ee = a.set[he], se = null, te = null;
853
+ if (Ee.forEach(function(Ae) {
854
+ Ae.semver === fe && (Ae = new Z(">=0.0.0")), se = se || Ae, te = te || Ae, S(Ae.semver, se.semver, R) ? se = Ae : v(Ae.semver, te.semver, R) && (te = Ae);
855
+ }), se.operator === $ || se.operator === j || (!te.operator || te.operator === $) && w(e, te.semver))
856
+ return !1;
857
+ if (te.operator === j && v(e, te.semver))
858
+ return !1;
859
+ }
860
+ return !0;
861
+ }
862
+ f.prerelease = $r;
863
+ function $r(e, a) {
864
+ var c = ue(e, a);
865
+ return c && c.prerelease.length ? c.prerelease : null;
866
+ }
867
+ f.intersects = Xr;
868
+ function Xr(e, a, c) {
869
+ return e = new G(e, c), a = new G(a, c), e.intersects(a);
870
+ }
871
+ f.coerce = Vr;
872
+ function Vr(e, a) {
873
+ if (e instanceof P)
874
+ return e;
875
+ if (typeof e == "number" && (e = String(e)), typeof e != "string")
876
+ return null;
877
+ a = a || {};
878
+ var c = null;
879
+ if (!a.rtl)
880
+ c = e.match(D[d.COERCE]);
881
+ else {
882
+ for (var R; (R = D[d.COERCERTL].exec(e)) && (!c || c.index + c[0].length !== e.length); )
883
+ (!c || R.index + R[0].length !== c.index + c[0].length) && (c = R), D[d.COERCERTL].lastIndex = R.index + R[1].length + R[2].length;
884
+ D[d.COERCERTL].lastIndex = -1;
885
+ }
886
+ return c === null ? null : ue(c[2] + "." + (c[3] || "0") + "." + (c[4] || "0"), a);
887
+ }
888
+ })(Ze, Ze.exports);
889
+ var vt = Ze.exports;
890
+ const kn = /* @__PURE__ */ wt(vt), Fn = (s) => s == null ? [] : Array.isArray(s) ? s : [s], Un = t.any().refine((s) => typeof s == "bigint", {
891
+ message: "Value must be a BigInt"
892
+ }).transform((s) => BigInt(s));
893
+ var Lt = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, Be = Math.ceil, ae = Math.floor, ee = "[BigNumber Error] ", cr = ee + "Number primitive has more than 15 significant digits: ", ce = 1e14, _ = 14, xe = 9007199254740991, Me = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], Oe = 1e7, W = 1e9;
894
+ function pr(s) {
895
+ var f, O, L, A = T.prototype = { constructor: T, toString: null, valueOf: null }, M = new T(1), x = 20, k = 4, D = -7, I = 21, d = -1e7, K = 1e7, b = !1, pe = 1, ne = 0, de = {
896
+ prefix: "",
897
+ groupSize: 3,
898
+ secondaryGroupSize: 0,
899
+ groupSeparator: ",",
900
+ decimalSeparator: ".",
901
+ fractionGroupSize: 0,
902
+ fractionGroupSeparator: " ",
903
+ // non-breaking space
904
+ suffix: ""
905
+ }, me = "0123456789abcdefghijklmnopqrstuvwxyz", Te = !0;
906
+ function T(r, n) {
907
+ var i, E, l, h, g, o, u, m, p = this;
908
+ if (!(p instanceof T)) return new T(r, n);
909
+ if (n == null) {
910
+ if (r && r._isBigNumber === !0) {
911
+ p.s = r.s, !r.c || r.e > K ? p.c = p.e = null : r.e < d ? p.c = [p.e = 0] : (p.e = r.e, p.c = r.c.slice());
912
+ return;
913
+ }
914
+ if ((o = typeof r == "number") && r * 0 == 0) {
915
+ if (p.s = 1 / r < 0 ? (r = -r, -1) : 1, r === ~~r) {
916
+ for (h = 0, g = r; g >= 10; g /= 10, h++) ;
917
+ h > K ? p.c = p.e = null : (p.e = h, p.c = [r]);
918
+ return;
919
+ }
920
+ m = String(r);
921
+ } else {
922
+ if (!Lt.test(m = String(r))) return L(p, m, o);
923
+ p.s = m.charCodeAt(0) == 45 ? (m = m.slice(1), -1) : 1;
924
+ }
925
+ (h = m.indexOf(".")) > -1 && (m = m.replace(".", "")), (g = m.search(/e/i)) > 0 ? (h < 0 && (h = g), h += +m.slice(g + 1), m = m.substring(0, g)) : h < 0 && (h = m.length);
926
+ } else {
927
+ if (z(n, 2, me.length, "Base"), n == 10 && Te)
928
+ return p = new T(r), J(p, x + p.e + 1, k);
929
+ if (m = String(r), o = typeof r == "number") {
930
+ if (r * 0 != 0) return L(p, m, o, n);
931
+ if (p.s = 1 / r < 0 ? (m = m.slice(1), -1) : 1, T.DEBUG && m.replace(/^0\.0*|\./, "").length > 15)
932
+ throw Error(cr + r);
933
+ } else
934
+ p.s = m.charCodeAt(0) === 45 ? (m = m.slice(1), -1) : 1;
935
+ for (i = me.slice(0, n), h = g = 0, u = m.length; g < u; g++)
936
+ if (i.indexOf(E = m.charAt(g)) < 0) {
937
+ if (E == ".") {
938
+ if (g > h) {
939
+ h = u;
940
+ continue;
941
+ }
942
+ } else if (!l && (m == m.toUpperCase() && (m = m.toLowerCase()) || m == m.toLowerCase() && (m = m.toUpperCase()))) {
943
+ l = !0, g = -1, h = 0;
944
+ continue;
945
+ }
946
+ return L(p, String(r), o, n);
947
+ }
948
+ o = !1, m = O(m, n, 10, p.s), (h = m.indexOf(".")) > -1 ? m = m.replace(".", "") : h = m.length;
949
+ }
950
+ for (g = 0; m.charCodeAt(g) === 48; g++) ;
951
+ for (u = m.length; m.charCodeAt(--u) === 48; ) ;
952
+ if (m = m.slice(g, ++u)) {
953
+ if (u -= g, o && T.DEBUG && u > 15 && (r > xe || r !== ae(r)))
954
+ throw Error(cr + p.s * r);
955
+ if ((h = h - g - 1) > K)
956
+ p.c = p.e = null;
957
+ else if (h < d)
958
+ p.c = [p.e = 0];
959
+ else {
960
+ if (p.e = h, p.c = [], g = (h + 1) % _, h < 0 && (g += _), g < u) {
961
+ for (g && p.c.push(+m.slice(0, g)), u -= _; g < u; )
962
+ p.c.push(+m.slice(g, g += _));
963
+ g = _ - (m = m.slice(g)).length;
964
+ } else
965
+ g -= u;
966
+ for (; g--; m += "0") ;
967
+ p.c.push(+m);
968
+ }
969
+ } else
970
+ p.c = [p.e = 0];
971
+ }
972
+ T.clone = pr, T.ROUND_UP = 0, T.ROUND_DOWN = 1, T.ROUND_CEIL = 2, T.ROUND_FLOOR = 3, T.ROUND_HALF_UP = 4, T.ROUND_HALF_DOWN = 5, T.ROUND_HALF_EVEN = 6, T.ROUND_HALF_CEIL = 7, T.ROUND_HALF_FLOOR = 8, T.EUCLID = 9, T.config = T.set = function(r) {
973
+ var n, i;
974
+ if (r != null)
975
+ if (typeof r == "object") {
976
+ if (r.hasOwnProperty(n = "DECIMAL_PLACES") && (i = r[n], z(i, 0, W, n), x = i), r.hasOwnProperty(n = "ROUNDING_MODE") && (i = r[n], z(i, 0, 8, n), k = i), r.hasOwnProperty(n = "EXPONENTIAL_AT") && (i = r[n], i && i.pop ? (z(i[0], -W, 0, n), z(i[1], 0, W, n), D = i[0], I = i[1]) : (z(i, -W, W, n), D = -(I = i < 0 ? -i : i))), r.hasOwnProperty(n = "RANGE"))
977
+ if (i = r[n], i && i.pop)
978
+ z(i[0], -W, -1, n), z(i[1], 1, W, n), d = i[0], K = i[1];
979
+ else if (z(i, -W, W, n), i)
980
+ d = -(K = i < 0 ? -i : i);
981
+ else
982
+ throw Error(ee + n + " cannot be zero: " + i);
983
+ if (r.hasOwnProperty(n = "CRYPTO"))
984
+ if (i = r[n], i === !!i)
985
+ if (i)
986
+ if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
987
+ b = i;
988
+ else
989
+ throw b = !i, Error(ee + "crypto unavailable");
990
+ else
991
+ b = i;
992
+ else
993
+ throw Error(ee + n + " not true or false: " + i);
994
+ if (r.hasOwnProperty(n = "MODULO_MODE") && (i = r[n], z(i, 0, 9, n), pe = i), r.hasOwnProperty(n = "POW_PRECISION") && (i = r[n], z(i, 0, W, n), ne = i), r.hasOwnProperty(n = "FORMAT"))
995
+ if (i = r[n], typeof i == "object") de = i;
996
+ else throw Error(ee + n + " not an object: " + i);
997
+ if (r.hasOwnProperty(n = "ALPHABET"))
998
+ if (i = r[n], typeof i == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(i))
999
+ Te = i.slice(0, 10) == "0123456789", me = i;
1000
+ else
1001
+ throw Error(ee + n + " invalid: " + i);
1002
+ } else
1003
+ throw Error(ee + "Object expected: " + r);
1004
+ return {
1005
+ DECIMAL_PLACES: x,
1006
+ ROUNDING_MODE: k,
1007
+ EXPONENTIAL_AT: [D, I],
1008
+ RANGE: [d, K],
1009
+ CRYPTO: b,
1010
+ MODULO_MODE: pe,
1011
+ POW_PRECISION: ne,
1012
+ FORMAT: de,
1013
+ ALPHABET: me
1014
+ };
1015
+ }, T.isBigNumber = function(r) {
1016
+ if (!r || r._isBigNumber !== !0) return !1;
1017
+ if (!T.DEBUG) return !0;
1018
+ var n, i, E = r.c, l = r.e, h = r.s;
1019
+ e: if ({}.toString.call(E) == "[object Array]") {
1020
+ if ((h === 1 || h === -1) && l >= -W && l <= W && l === ae(l)) {
1021
+ if (E[0] === 0) {
1022
+ if (l === 0 && E.length === 1) return !0;
1023
+ break e;
1024
+ }
1025
+ if (n = (l + 1) % _, n < 1 && (n += _), String(E[0]).length == n) {
1026
+ for (n = 0; n < E.length; n++)
1027
+ if (i = E[n], i < 0 || i >= ce || i !== ae(i)) break e;
1028
+ if (i !== 0) return !0;
1029
+ }
1030
+ }
1031
+ } else if (E === null && l === null && (h === null || h === 1 || h === -1))
1032
+ return !0;
1033
+ throw Error(ee + "Invalid BigNumber: " + r);
1034
+ }, T.maximum = T.max = function() {
1035
+ return ue(arguments, -1);
1036
+ }, T.minimum = T.min = function() {
1037
+ return ue(arguments, 1);
1038
+ }, T.random = function() {
1039
+ var r = 9007199254740992, n = Math.random() * r & 2097151 ? function() {
1040
+ return ae(Math.random() * r);
1041
+ } : function() {
1042
+ return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
1043
+ };
1044
+ return function(i) {
1045
+ var E, l, h, g, o, u = 0, m = [], p = new T(M);
1046
+ if (i == null ? i = x : z(i, 0, W), g = Be(i / _), b)
1047
+ if (crypto.getRandomValues) {
1048
+ for (E = crypto.getRandomValues(new Uint32Array(g *= 2)); u < g; )
1049
+ o = E[u] * 131072 + (E[u + 1] >>> 11), o >= 9e15 ? (l = crypto.getRandomValues(new Uint32Array(2)), E[u] = l[0], E[u + 1] = l[1]) : (m.push(o % 1e14), u += 2);
1050
+ u = g / 2;
1051
+ } else if (crypto.randomBytes) {
1052
+ for (E = crypto.randomBytes(g *= 7); u < g; )
1053
+ o = (E[u] & 31) * 281474976710656 + E[u + 1] * 1099511627776 + E[u + 2] * 4294967296 + E[u + 3] * 16777216 + (E[u + 4] << 16) + (E[u + 5] << 8) + E[u + 6], o >= 9e15 ? crypto.randomBytes(7).copy(E, u) : (m.push(o % 1e14), u += 7);
1054
+ u = g / 7;
1055
+ } else
1056
+ throw b = !1, Error(ee + "crypto unavailable");
1057
+ if (!b)
1058
+ for (; u < g; )
1059
+ o = n(), o < 9e15 && (m[u++] = o % 1e14);
1060
+ for (g = m[--u], i %= _, g && i && (o = Me[_ - i], m[u] = ae(g / o) * o); m[u] === 0; m.pop(), u--) ;
1061
+ if (u < 0)
1062
+ m = [h = 0];
1063
+ else {
1064
+ for (h = -1; m[0] === 0; m.splice(0, 1), h -= _) ;
1065
+ for (u = 1, o = m[0]; o >= 10; o /= 10, u++) ;
1066
+ u < _ && (h -= _ - u);
1067
+ }
1068
+ return p.e = h, p.c = m, p;
1069
+ };
1070
+ }(), T.sum = function() {
1071
+ for (var r = 1, n = arguments, i = new T(n[0]); r < n.length; ) i = i.plus(n[r++]);
1072
+ return i;
1073
+ }, O = /* @__PURE__ */ function() {
1074
+ var r = "0123456789";
1075
+ function n(i, E, l, h) {
1076
+ for (var g, o = [0], u, m = 0, p = i.length; m < p; ) {
1077
+ for (u = o.length; u--; o[u] *= E) ;
1078
+ for (o[0] += h.indexOf(i.charAt(m++)), g = 0; g < o.length; g++)
1079
+ o[g] > l - 1 && (o[g + 1] == null && (o[g + 1] = 0), o[g + 1] += o[g] / l | 0, o[g] %= l);
1080
+ }
1081
+ return o.reverse();
1082
+ }
1083
+ return function(i, E, l, h, g) {
1084
+ var o, u, m, p, N, y, C, F, V = i.indexOf("."), q = x, B = k;
1085
+ for (V >= 0 && (p = ne, ne = 0, i = i.replace(".", ""), F = new T(E), y = F.pow(i.length - V), ne = p, F.c = n(
1086
+ Ie(ie(y.c), y.e, "0"),
1087
+ 10,
1088
+ l,
1089
+ r
1090
+ ), F.e = F.c.length), C = n(i, E, l, g ? (o = me, r) : (o = r, me)), m = p = C.length; C[--p] == 0; C.pop()) ;
1091
+ if (!C[0]) return o.charAt(0);
1092
+ if (V < 0 ? --m : (y.c = C, y.e = m, y.s = h, y = f(y, F, q, B, l), C = y.c, N = y.r, m = y.e), u = m + q + 1, V = C[u], p = l / 2, N = N || u < 0 || C[u + 1] != null, N = B < 4 ? (V != null || N) && (B == 0 || B == (y.s < 0 ? 3 : 2)) : V > p || V == p && (B == 4 || N || B == 6 && C[u - 1] & 1 || B == (y.s < 0 ? 8 : 7)), u < 1 || !C[0])
1093
+ i = N ? Ie(o.charAt(1), -q, o.charAt(0)) : o.charAt(0);
1094
+ else {
1095
+ if (C.length = u, N)
1096
+ for (--l; ++C[--u] > l; )
1097
+ C[u] = 0, u || (++m, C = [1].concat(C));
1098
+ for (p = C.length; !C[--p]; ) ;
1099
+ for (V = 0, i = ""; V <= p; i += o.charAt(C[V++])) ;
1100
+ i = Ie(i, m, o.charAt(0));
1101
+ }
1102
+ return i;
1103
+ };
1104
+ }(), f = /* @__PURE__ */ function() {
1105
+ function r(E, l, h) {
1106
+ var g, o, u, m, p = 0, N = E.length, y = l % Oe, C = l / Oe | 0;
1107
+ for (E = E.slice(); N--; )
1108
+ u = E[N] % Oe, m = E[N] / Oe | 0, g = C * u + m * y, o = y * u + g % Oe * Oe + p, p = (o / h | 0) + (g / Oe | 0) + C * m, E[N] = o % h;
1109
+ return p && (E = [p].concat(E)), E;
1110
+ }
1111
+ function n(E, l, h, g) {
1112
+ var o, u;
1113
+ if (h != g)
1114
+ u = h > g ? 1 : -1;
1115
+ else
1116
+ for (o = u = 0; o < h; o++)
1117
+ if (E[o] != l[o]) {
1118
+ u = E[o] > l[o] ? 1 : -1;
1119
+ break;
1120
+ }
1121
+ return u;
1122
+ }
1123
+ function i(E, l, h, g) {
1124
+ for (var o = 0; h--; )
1125
+ E[h] -= o, o = E[h] < l[h] ? 1 : 0, E[h] = o * g + E[h] - l[h];
1126
+ for (; !E[0] && E.length > 1; E.splice(0, 1)) ;
1127
+ }
1128
+ return function(E, l, h, g, o) {
1129
+ var u, m, p, N, y, C, F, V, q, B, X, H, ge, Z, fe, G, Ne, Q = E.s == l.s ? 1 : -1, Y = E.c, U = l.c;
1130
+ if (!Y || !Y[0] || !U || !U[0])
1131
+ return new T(
1132
+ // Return NaN if either NaN, or both Infinity or 0.
1133
+ !E.s || !l.s || (Y ? U && Y[0] == U[0] : !U) ? NaN : (
1134
+ // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
1135
+ Y && Y[0] == 0 || !U ? Q * 0 : Q / 0
1136
+ )
1137
+ );
1138
+ for (V = new T(Q), q = V.c = [], m = E.e - l.e, Q = h + m + 1, o || (o = ce, m = oe(E.e / _) - oe(l.e / _), Q = Q / _ | 0), p = 0; U[p] == (Y[p] || 0); p++) ;
1139
+ if (U[p] > (Y[p] || 0) && m--, Q < 0)
1140
+ q.push(1), N = !0;
1141
+ else {
1142
+ for (Z = Y.length, G = U.length, p = 0, Q += 2, y = ae(o / (U[0] + 1)), y > 1 && (U = r(U, y, o), Y = r(Y, y, o), G = U.length, Z = Y.length), ge = G, B = Y.slice(0, G), X = B.length; X < G; B[X++] = 0) ;
1143
+ Ne = U.slice(), Ne = [0].concat(Ne), fe = U[0], U[1] >= o / 2 && fe++;
1144
+ do {
1145
+ if (y = 0, u = n(U, B, G, X), u < 0) {
1146
+ if (H = B[0], G != X && (H = H * o + (B[1] || 0)), y = ae(H / fe), y > 1)
1147
+ for (y >= o && (y = o - 1), C = r(U, y, o), F = C.length, X = B.length; n(C, B, F, X) == 1; )
1148
+ y--, i(C, G < F ? Ne : U, F, o), F = C.length, u = 1;
1149
+ else
1150
+ y == 0 && (u = y = 1), C = U.slice(), F = C.length;
1151
+ if (F < X && (C = [0].concat(C)), i(B, C, X, o), X = B.length, u == -1)
1152
+ for (; n(U, B, G, X) < 1; )
1153
+ y++, i(B, G < X ? Ne : U, X, o), X = B.length;
1154
+ } else u === 0 && (y++, B = [0]);
1155
+ q[p++] = y, B[0] ? B[X++] = Y[ge] || 0 : (B = [Y[ge]], X = 1);
1156
+ } while ((ge++ < Z || B[0] != null) && Q--);
1157
+ N = B[0] != null, q[0] || q.splice(0, 1);
1158
+ }
1159
+ if (o == ce) {
1160
+ for (p = 1, Q = q[0]; Q >= 10; Q /= 10, p++) ;
1161
+ J(V, h + (V.e = p + m * _ - 1) + 1, g, N);
1162
+ } else
1163
+ V.e = m, V.r = +N;
1164
+ return V;
1165
+ };
1166
+ }();
1167
+ function re(r, n, i, E) {
1168
+ var l, h, g, o, u;
1169
+ if (i == null ? i = k : z(i, 0, 8), !r.c) return r.toString();
1170
+ if (l = r.c[0], g = r.e, n == null)
1171
+ u = ie(r.c), u = E == 1 || E == 2 && (g <= D || g >= I) ? De(u, g) : Ie(u, g, "0");
1172
+ else if (r = J(new T(r), n, i), h = r.e, u = ie(r.c), o = u.length, E == 1 || E == 2 && (n <= h || h <= D)) {
1173
+ for (; o < n; u += "0", o++) ;
1174
+ u = De(u, h);
1175
+ } else if (n -= g, u = Ie(u, h, "0"), h + 1 > o) {
1176
+ if (--n > 0) for (u += "."; n--; u += "0") ;
1177
+ } else if (n += h - o, n > 0)
1178
+ for (h + 1 == o && (u += "."); n--; u += "0") ;
1179
+ return r.s < 0 && l ? "-" + u : u;
1180
+ }
1181
+ function ue(r, n) {
1182
+ for (var i, E, l = 1, h = new T(r[0]); l < r.length; l++)
1183
+ E = new T(r[l]), (!E.s || (i = Se(h, E)) === n || i === 0 && h.s === n) && (h = E);
1184
+ return h;
1185
+ }
1186
+ function we(r, n, i) {
1187
+ for (var E = 1, l = n.length; !n[--l]; n.pop()) ;
1188
+ for (l = n[0]; l >= 10; l /= 10, E++) ;
1189
+ return (i = E + i * _ - 1) > K ? r.c = r.e = null : i < d ? r.c = [r.e = 0] : (r.e = i, r.c = n), r;
1190
+ }
1191
+ L = /* @__PURE__ */ function() {
1192
+ var r = /^(-?)0([xbo])(?=\w[\w.]*$)/i, n = /^([^.]+)\.$/, i = /^\.([^.]+)$/, E = /^-?(Infinity|NaN)$/, l = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
1193
+ return function(h, g, o, u) {
1194
+ var m, p = o ? g : g.replace(l, "");
1195
+ if (E.test(p))
1196
+ h.s = isNaN(p) ? null : p < 0 ? -1 : 1;
1197
+ else {
1198
+ if (!o && (p = p.replace(r, function(N, y, C) {
1199
+ return m = (C = C.toLowerCase()) == "x" ? 16 : C == "b" ? 2 : 8, !u || u == m ? y : N;
1200
+ }), u && (m = u, p = p.replace(n, "$1").replace(i, "0.$1")), g != p))
1201
+ return new T(p, m);
1202
+ if (T.DEBUG)
1203
+ throw Error(ee + "Not a" + (u ? " base " + u : "") + " number: " + g);
1204
+ h.s = null;
1205
+ }
1206
+ h.c = h.e = null;
1207
+ };
1208
+ }();
1209
+ function J(r, n, i, E) {
1210
+ var l, h, g, o, u, m, p, N = r.c, y = Me;
1211
+ if (N) {
1212
+ e: {
1213
+ for (l = 1, o = N[0]; o >= 10; o /= 10, l++) ;
1214
+ if (h = n - l, h < 0)
1215
+ h += _, g = n, u = N[m = 0], p = ae(u / y[l - g - 1] % 10);
1216
+ else if (m = Be((h + 1) / _), m >= N.length)
1217
+ if (E) {
1218
+ for (; N.length <= m; N.push(0)) ;
1219
+ u = p = 0, l = 1, h %= _, g = h - _ + 1;
1220
+ } else
1221
+ break e;
1222
+ else {
1223
+ for (u = o = N[m], l = 1; o >= 10; o /= 10, l++) ;
1224
+ h %= _, g = h - _ + l, p = g < 0 ? 0 : ae(u / y[l - g - 1] % 10);
1225
+ }
1226
+ if (E = E || n < 0 || // Are there any non-zero digits after the rounding digit?
1227
+ // The expression n % pows10[d - j - 1] returns all digits of n to the right
1228
+ // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
1229
+ N[m + 1] != null || (g < 0 ? u : u % y[l - g - 1]), E = i < 4 ? (p || E) && (i == 0 || i == (r.s < 0 ? 3 : 2)) : p > 5 || p == 5 && (i == 4 || E || i == 6 && // Check whether the digit to the left of the rounding digit is odd.
1230
+ (h > 0 ? g > 0 ? u / y[l - g] : 0 : N[m - 1]) % 10 & 1 || i == (r.s < 0 ? 8 : 7)), n < 1 || !N[0])
1231
+ return N.length = 0, E ? (n -= r.e + 1, N[0] = y[(_ - n % _) % _], r.e = -n || 0) : N[0] = r.e = 0, r;
1232
+ if (h == 0 ? (N.length = m, o = 1, m--) : (N.length = m + 1, o = y[_ - h], N[m] = g > 0 ? ae(u / y[l - g] % y[g]) * o : 0), E)
1233
+ for (; ; )
1234
+ if (m == 0) {
1235
+ for (h = 1, g = N[0]; g >= 10; g /= 10, h++) ;
1236
+ for (g = N[0] += o, o = 1; g >= 10; g /= 10, o++) ;
1237
+ h != o && (r.e++, N[0] == ce && (N[0] = 1));
1238
+ break;
1239
+ } else {
1240
+ if (N[m] += o, N[m] != ce) break;
1241
+ N[m--] = 0, o = 1;
1242
+ }
1243
+ for (h = N.length; N[--h] === 0; N.pop()) ;
1244
+ }
1245
+ r.e > K ? r.c = r.e = null : r.e < d && (r.c = [r.e = 0]);
1246
+ }
1247
+ return r;
1248
+ }
1249
+ function P(r) {
1250
+ var n, i = r.e;
1251
+ return i === null ? r.toString() : (n = ie(r.c), n = i <= D || i >= I ? De(n, i) : Ie(n, i, "0"), r.s < 0 ? "-" + n : n);
1252
+ }
1253
+ return A.absoluteValue = A.abs = function() {
1254
+ var r = new T(this);
1255
+ return r.s < 0 && (r.s = 1), r;
1256
+ }, A.comparedTo = function(r, n) {
1257
+ return Se(this, new T(r, n));
1258
+ }, A.decimalPlaces = A.dp = function(r, n) {
1259
+ var i, E, l, h = this;
1260
+ if (r != null)
1261
+ return z(r, 0, W), n == null ? n = k : z(n, 0, 8), J(new T(h), r + h.e + 1, n);
1262
+ if (!(i = h.c)) return null;
1263
+ if (E = ((l = i.length - 1) - oe(this.e / _)) * _, l = i[l]) for (; l % 10 == 0; l /= 10, E--) ;
1264
+ return E < 0 && (E = 0), E;
1265
+ }, A.dividedBy = A.div = function(r, n) {
1266
+ return f(this, new T(r, n), x, k);
1267
+ }, A.dividedToIntegerBy = A.idiv = function(r, n) {
1268
+ return f(this, new T(r, n), 0, 1);
1269
+ }, A.exponentiatedBy = A.pow = function(r, n) {
1270
+ var i, E, l, h, g, o, u, m, p, N = this;
1271
+ if (r = new T(r), r.c && !r.isInteger())
1272
+ throw Error(ee + "Exponent not an integer: " + P(r));
1273
+ if (n != null && (n = new T(n)), o = r.e > 14, !N.c || !N.c[0] || N.c[0] == 1 && !N.e && N.c.length == 1 || !r.c || !r.c[0])
1274
+ return p = new T(Math.pow(+P(N), o ? r.s * (2 - Ce(r)) : +P(r))), n ? p.mod(n) : p;
1275
+ if (u = r.s < 0, n) {
1276
+ if (n.c ? !n.c[0] : !n.s) return new T(NaN);
1277
+ E = !u && N.isInteger() && n.isInteger(), E && (N = N.mod(n));
1278
+ } else {
1279
+ if (r.e > 9 && (N.e > 0 || N.e < -1 || (N.e == 0 ? N.c[0] > 1 || o && N.c[1] >= 24e7 : N.c[0] < 8e13 || o && N.c[0] <= 9999975e7)))
1280
+ return h = N.s < 0 && Ce(r) ? -0 : 0, N.e > -1 && (h = 1 / h), new T(u ? 1 / h : h);
1281
+ ne && (h = Be(ne / _ + 2));
1282
+ }
1283
+ for (o ? (i = new T(0.5), u && (r.s = 1), m = Ce(r)) : (l = Math.abs(+P(r)), m = l % 2), p = new T(M); ; ) {
1284
+ if (m) {
1285
+ if (p = p.times(N), !p.c) break;
1286
+ h ? p.c.length > h && (p.c.length = h) : E && (p = p.mod(n));
1287
+ }
1288
+ if (l) {
1289
+ if (l = ae(l / 2), l === 0) break;
1290
+ m = l % 2;
1291
+ } else if (r = r.times(i), J(r, r.e + 1, 1), r.e > 14)
1292
+ m = Ce(r);
1293
+ else {
1294
+ if (l = +P(r), l === 0) break;
1295
+ m = l % 2;
1296
+ }
1297
+ N = N.times(N), h ? N.c && N.c.length > h && (N.c.length = h) : E && (N = N.mod(n));
1298
+ }
1299
+ return E ? p : (u && (p = M.div(p)), n ? p.mod(n) : h ? J(p, ne, k, g) : p);
1300
+ }, A.integerValue = function(r) {
1301
+ var n = new T(this);
1302
+ return r == null ? r = k : z(r, 0, 8), J(n, n.e + 1, r);
1303
+ }, A.isEqualTo = A.eq = function(r, n) {
1304
+ return Se(this, new T(r, n)) === 0;
1305
+ }, A.isFinite = function() {
1306
+ return !!this.c;
1307
+ }, A.isGreaterThan = A.gt = function(r, n) {
1308
+ return Se(this, new T(r, n)) > 0;
1309
+ }, A.isGreaterThanOrEqualTo = A.gte = function(r, n) {
1310
+ return (n = Se(this, new T(r, n))) === 1 || n === 0;
1311
+ }, A.isInteger = function() {
1312
+ return !!this.c && oe(this.e / _) > this.c.length - 2;
1313
+ }, A.isLessThan = A.lt = function(r, n) {
1314
+ return Se(this, new T(r, n)) < 0;
1315
+ }, A.isLessThanOrEqualTo = A.lte = function(r, n) {
1316
+ return (n = Se(this, new T(r, n))) === -1 || n === 0;
1317
+ }, A.isNaN = function() {
1318
+ return !this.s;
1319
+ }, A.isNegative = function() {
1320
+ return this.s < 0;
1321
+ }, A.isPositive = function() {
1322
+ return this.s > 0;
1323
+ }, A.isZero = function() {
1324
+ return !!this.c && this.c[0] == 0;
1325
+ }, A.minus = function(r, n) {
1326
+ var i, E, l, h, g = this, o = g.s;
1327
+ if (r = new T(r, n), n = r.s, !o || !n) return new T(NaN);
1328
+ if (o != n)
1329
+ return r.s = -n, g.plus(r);
1330
+ var u = g.e / _, m = r.e / _, p = g.c, N = r.c;
1331
+ if (!u || !m) {
1332
+ if (!p || !N) return p ? (r.s = -n, r) : new T(N ? g : NaN);
1333
+ if (!p[0] || !N[0])
1334
+ return N[0] ? (r.s = -n, r) : new T(p[0] ? g : (
1335
+ // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
1336
+ k == 3 ? -0 : 0
1337
+ ));
1338
+ }
1339
+ if (u = oe(u), m = oe(m), p = p.slice(), o = u - m) {
1340
+ for ((h = o < 0) ? (o = -o, l = p) : (m = u, l = N), l.reverse(), n = o; n--; l.push(0)) ;
1341
+ l.reverse();
1342
+ } else
1343
+ for (E = (h = (o = p.length) < (n = N.length)) ? o : n, o = n = 0; n < E; n++)
1344
+ if (p[n] != N[n]) {
1345
+ h = p[n] < N[n];
1346
+ break;
1347
+ }
1348
+ if (h && (l = p, p = N, N = l, r.s = -r.s), n = (E = N.length) - (i = p.length), n > 0) for (; n--; p[i++] = 0) ;
1349
+ for (n = ce - 1; E > o; ) {
1350
+ if (p[--E] < N[E]) {
1351
+ for (i = E; i && !p[--i]; p[i] = n) ;
1352
+ --p[i], p[E] += ce;
1353
+ }
1354
+ p[E] -= N[E];
1355
+ }
1356
+ for (; p[0] == 0; p.splice(0, 1), --m) ;
1357
+ return p[0] ? we(r, p, m) : (r.s = k == 3 ? -1 : 1, r.c = [r.e = 0], r);
1358
+ }, A.modulo = A.mod = function(r, n) {
1359
+ var i, E, l = this;
1360
+ return r = new T(r, n), !l.c || !r.s || r.c && !r.c[0] ? new T(NaN) : !r.c || l.c && !l.c[0] ? new T(l) : (pe == 9 ? (E = r.s, r.s = 1, i = f(l, r, 0, 3), r.s = E, i.s *= E) : i = f(l, r, 0, pe), r = l.minus(i.times(r)), !r.c[0] && pe == 1 && (r.s = l.s), r);
1361
+ }, A.multipliedBy = A.times = function(r, n) {
1362
+ var i, E, l, h, g, o, u, m, p, N, y, C, F, V, q, B = this, X = B.c, H = (r = new T(r, n)).c;
1363
+ if (!X || !H || !X[0] || !H[0])
1364
+ return !B.s || !r.s || X && !X[0] && !H || H && !H[0] && !X ? r.c = r.e = r.s = null : (r.s *= B.s, !X || !H ? r.c = r.e = null : (r.c = [0], r.e = 0)), r;
1365
+ for (E = oe(B.e / _) + oe(r.e / _), r.s *= B.s, u = X.length, N = H.length, u < N && (F = X, X = H, H = F, l = u, u = N, N = l), l = u + N, F = []; l--; F.push(0)) ;
1366
+ for (V = ce, q = Oe, l = N; --l >= 0; ) {
1367
+ for (i = 0, y = H[l] % q, C = H[l] / q | 0, g = u, h = l + g; h > l; )
1368
+ m = X[--g] % q, p = X[g] / q | 0, o = C * m + p * y, m = y * m + o % q * q + F[h] + i, i = (m / V | 0) + (o / q | 0) + C * p, F[h--] = m % V;
1369
+ F[h] = i;
1370
+ }
1371
+ return i ? ++E : F.splice(0, 1), we(r, F, E);
1372
+ }, A.negated = function() {
1373
+ var r = new T(this);
1374
+ return r.s = -r.s || null, r;
1375
+ }, A.plus = function(r, n) {
1376
+ var i, E = this, l = E.s;
1377
+ if (r = new T(r, n), n = r.s, !l || !n) return new T(NaN);
1378
+ if (l != n)
1379
+ return r.s = -n, E.minus(r);
1380
+ var h = E.e / _, g = r.e / _, o = E.c, u = r.c;
1381
+ if (!h || !g) {
1382
+ if (!o || !u) return new T(l / 0);
1383
+ if (!o[0] || !u[0]) return u[0] ? r : new T(o[0] ? E : l * 0);
1384
+ }
1385
+ if (h = oe(h), g = oe(g), o = o.slice(), l = h - g) {
1386
+ for (l > 0 ? (g = h, i = u) : (l = -l, i = o), i.reverse(); l--; i.push(0)) ;
1387
+ i.reverse();
1388
+ }
1389
+ for (l = o.length, n = u.length, l - n < 0 && (i = u, u = o, o = i, n = l), l = 0; n; )
1390
+ l = (o[--n] = o[n] + u[n] + l) / ce | 0, o[n] = ce === o[n] ? 0 : o[n] % ce;
1391
+ return l && (o = [l].concat(o), ++g), we(r, o, g);
1392
+ }, A.precision = A.sd = function(r, n) {
1393
+ var i, E, l, h = this;
1394
+ if (r != null && r !== !!r)
1395
+ return z(r, 1, W), n == null ? n = k : z(n, 0, 8), J(new T(h), r, n);
1396
+ if (!(i = h.c)) return null;
1397
+ if (l = i.length - 1, E = l * _ + 1, l = i[l]) {
1398
+ for (; l % 10 == 0; l /= 10, E--) ;
1399
+ for (l = i[0]; l >= 10; l /= 10, E++) ;
1400
+ }
1401
+ return r && h.e + 1 > E && (E = h.e + 1), E;
1402
+ }, A.shiftedBy = function(r) {
1403
+ return z(r, -xe, xe), this.times("1e" + r);
1404
+ }, A.squareRoot = A.sqrt = function() {
1405
+ var r, n, i, E, l, h = this, g = h.c, o = h.s, u = h.e, m = x + 4, p = new T("0.5");
1406
+ if (o !== 1 || !g || !g[0])
1407
+ return new T(!o || o < 0 && (!g || g[0]) ? NaN : g ? h : 1 / 0);
1408
+ if (o = Math.sqrt(+P(h)), o == 0 || o == 1 / 0 ? (n = ie(g), (n.length + u) % 2 == 0 && (n += "0"), o = Math.sqrt(+n), u = oe((u + 1) / 2) - (u < 0 || u % 2), o == 1 / 0 ? n = "5e" + u : (n = o.toExponential(), n = n.slice(0, n.indexOf("e") + 1) + u), i = new T(n)) : i = new T(o + ""), i.c[0]) {
1409
+ for (u = i.e, o = u + m, o < 3 && (o = 0); ; )
1410
+ if (l = i, i = p.times(l.plus(f(h, l, m, 1))), ie(l.c).slice(0, o) === (n = ie(i.c)).slice(0, o))
1411
+ if (i.e < u && --o, n = n.slice(o - 3, o + 1), n == "9999" || !E && n == "4999") {
1412
+ if (!E && (J(l, l.e + x + 2, 0), l.times(l).eq(h))) {
1413
+ i = l;
1414
+ break;
1415
+ }
1416
+ m += 4, o += 4, E = 1;
1417
+ } else {
1418
+ (!+n || !+n.slice(1) && n.charAt(0) == "5") && (J(i, i.e + x + 2, 1), r = !i.times(i).eq(h));
1419
+ break;
1420
+ }
1421
+ }
1422
+ return J(i, i.e + x + 1, k, r);
1423
+ }, A.toExponential = function(r, n) {
1424
+ return r != null && (z(r, 0, W), r++), re(this, r, n, 1);
1425
+ }, A.toFixed = function(r, n) {
1426
+ return r != null && (z(r, 0, W), r = r + this.e + 1), re(this, r, n);
1427
+ }, A.toFormat = function(r, n, i) {
1428
+ var E, l = this;
1429
+ if (i == null)
1430
+ r != null && n && typeof n == "object" ? (i = n, n = null) : r && typeof r == "object" ? (i = r, r = n = null) : i = de;
1431
+ else if (typeof i != "object")
1432
+ throw Error(ee + "Argument not an object: " + i);
1433
+ if (E = l.toFixed(r, n), l.c) {
1434
+ var h, g = E.split("."), o = +i.groupSize, u = +i.secondaryGroupSize, m = i.groupSeparator || "", p = g[0], N = g[1], y = l.s < 0, C = y ? p.slice(1) : p, F = C.length;
1435
+ if (u && (h = o, o = u, u = h, F -= h), o > 0 && F > 0) {
1436
+ for (h = F % o || o, p = C.substr(0, h); h < F; h += o) p += m + C.substr(h, o);
1437
+ u > 0 && (p += m + C.slice(h)), y && (p = "-" + p);
1438
+ }
1439
+ E = N ? p + (i.decimalSeparator || "") + ((u = +i.fractionGroupSize) ? N.replace(
1440
+ new RegExp("\\d{" + u + "}\\B", "g"),
1441
+ "$&" + (i.fractionGroupSeparator || "")
1442
+ ) : N) : p;
1443
+ }
1444
+ return (i.prefix || "") + E + (i.suffix || "");
1445
+ }, A.toFraction = function(r) {
1446
+ var n, i, E, l, h, g, o, u, m, p, N, y, C = this, F = C.c;
1447
+ if (r != null && (o = new T(r), !o.isInteger() && (o.c || o.s !== 1) || o.lt(M)))
1448
+ throw Error(ee + "Argument " + (o.isInteger() ? "out of range: " : "not an integer: ") + P(o));
1449
+ if (!F) return new T(C);
1450
+ for (n = new T(M), m = i = new T(M), E = u = new T(M), y = ie(F), h = n.e = y.length - C.e - 1, n.c[0] = Me[(g = h % _) < 0 ? _ + g : g], r = !r || o.comparedTo(n) > 0 ? h > 0 ? n : m : o, g = K, K = 1 / 0, o = new T(y), u.c[0] = 0; p = f(o, n, 0, 1), l = i.plus(p.times(E)), l.comparedTo(r) != 1; )
1451
+ i = E, E = l, m = u.plus(p.times(l = m)), u = l, n = o.minus(p.times(l = n)), o = l;
1452
+ return l = f(r.minus(i), E, 0, 1), u = u.plus(l.times(m)), i = i.plus(l.times(E)), u.s = m.s = C.s, h = h * 2, N = f(m, E, h, k).minus(C).abs().comparedTo(
1453
+ f(u, i, h, k).minus(C).abs()
1454
+ ) < 1 ? [m, E] : [u, i], K = g, N;
1455
+ }, A.toNumber = function() {
1456
+ return +P(this);
1457
+ }, A.toPrecision = function(r, n) {
1458
+ return r != null && z(r, 1, W), re(this, r, n, 2);
1459
+ }, A.toString = function(r) {
1460
+ var n, i = this, E = i.s, l = i.e;
1461
+ return l === null ? E ? (n = "Infinity", E < 0 && (n = "-" + n)) : n = "NaN" : (r == null ? n = l <= D || l >= I ? De(ie(i.c), l) : Ie(ie(i.c), l, "0") : r === 10 && Te ? (i = J(new T(i), x + l + 1, k), n = Ie(ie(i.c), i.e, "0")) : (z(r, 2, me.length, "Base"), n = O(Ie(ie(i.c), l, "0"), 10, r, E, !0)), E < 0 && i.c[0] && (n = "-" + n)), n;
1462
+ }, A.valueOf = A.toJSON = function() {
1463
+ return P(this);
1464
+ }, A._isBigNumber = !0, A[Symbol.toStringTag] = "BigNumber", A[Symbol.for("nodejs.util.inspect.custom")] = A.valueOf, s != null && T.set(s), T;
1465
+ }
1466
+ function oe(s) {
1467
+ var f = s | 0;
1468
+ return s > 0 || s === f ? f : f - 1;
1469
+ }
1470
+ function ie(s) {
1471
+ for (var f, O, L = 1, A = s.length, M = s[0] + ""; L < A; ) {
1472
+ for (f = s[L++] + "", O = _ - f.length; O--; f = "0" + f) ;
1473
+ M += f;
1474
+ }
1475
+ for (A = M.length; M.charCodeAt(--A) === 48; ) ;
1476
+ return M.slice(0, A + 1 || 1);
1477
+ }
1478
+ function Se(s, f) {
1479
+ var O, L, A = s.c, M = f.c, x = s.s, k = f.s, D = s.e, I = f.e;
1480
+ if (!x || !k) return null;
1481
+ if (O = A && !A[0], L = M && !M[0], O || L) return O ? L ? 0 : -k : x;
1482
+ if (x != k) return x;
1483
+ if (O = x < 0, L = D == I, !A || !M) return L ? 0 : !A ^ O ? 1 : -1;
1484
+ if (!L) return D > I ^ O ? 1 : -1;
1485
+ for (k = (D = A.length) < (I = M.length) ? D : I, x = 0; x < k; x++) if (A[x] != M[x]) return A[x] > M[x] ^ O ? 1 : -1;
1486
+ return D == I ? 0 : D > I ^ O ? 1 : -1;
1487
+ }
1488
+ function z(s, f, O, L) {
1489
+ if (s < f || s > O || s !== ae(s))
1490
+ throw Error(ee + (L || "Argument") + (typeof s == "number" ? s < f || s > O ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(s));
1491
+ }
1492
+ function Ce(s) {
1493
+ var f = s.c.length - 1;
1494
+ return oe(s.e / _) == f && s.c[f] % 2 != 0;
1495
+ }
1496
+ function De(s, f) {
1497
+ return (s.length > 1 ? s.charAt(0) + "." + s.slice(1) : s) + (f < 0 ? "e" : "e+") + f;
1498
+ }
1499
+ function Ie(s, f, O) {
1500
+ var L, A;
1501
+ if (f < 0) {
1502
+ for (A = O + "."; ++f; A += O) ;
1503
+ s = A + s;
1504
+ } else if (L = s.length, ++f > L) {
1505
+ for (A = O, f -= L; --f; A += O) ;
1506
+ s += A;
1507
+ } else f < L && (s = s.slice(0, f) + "." + s.slice(f));
1508
+ return s;
1509
+ }
1510
+ var Bn = pr();
1511
+ const xn = t.boolean().transform((s) => String(s)), Mn = t.string().transform((s) => s === "true");
1512
+ var Ke;
1513
+ (function(s) {
1514
+ s[s.function = 0] = "function", s[s.l1_handler = 1] = "l1_handler", s[s.constructor = 2] = "constructor";
1515
+ })(Ke || (Ke = {}));
1516
+ const dr = t.array(t.string()), Ge = t.object({
1517
+ selector: t.string(),
1518
+ offset: t.string(),
1519
+ builtins: dr.optional()
1520
+ }), mr = t.object({
1521
+ CONSTRUCTOR: t.array(Ge),
1522
+ EXTERNAL: t.array(Ge),
1523
+ L1_HANDLER: t.array(Ge)
1524
+ }), Gn = t.string(), yt = t.object({
1525
+ builtins: dr,
1526
+ data: t.array(t.string())
1527
+ }), Je = t.object({
1528
+ name: t.string(),
1529
+ type: t.union([t.literal("felt"), t.literal("felt*"), t.string()])
1530
+ }), Ct = t.nativeEnum(Ke), Dt = t.object({
1531
+ inputs: t.array(Je),
1532
+ name: t.string(),
1533
+ outputs: t.array(Je),
1534
+ stateMutability: t.literal("view").optional(),
1535
+ state_mutability: t.string().optional(),
1536
+ type: Ct
1537
+ }), Qe = t.object({
1538
+ name: t.string(),
1539
+ type: t.union([t.literal("felt"), t.literal("felt*"), t.string()]),
1540
+ kind: t.union([t.literal("key"), t.literal("data")])
1541
+ }), Pt = t.object({
1542
+ name: t.string(),
1543
+ type: t.literal("event"),
1544
+ data: t.array(Qe),
1545
+ keys: t.array(Qe)
1546
+ }), bt = t.object({
1547
+ name: t.string(),
1548
+ members: t.array(Qe),
1549
+ kind: t.literal("struct"),
1550
+ type: t.literal("event")
1551
+ }), _t = t.object({
1552
+ members: t.array(Je.and(t.object({
1553
+ offset: t.number()
1554
+ }))),
1555
+ name: t.string(),
1556
+ size: t.number(),
1557
+ type: t.literal("struct")
1558
+ }), jt = t.union([bt, Pt]), gr = t.array(t.union([Dt, jt, _t, t.any()])), kt = t.object({
1559
+ program: yt,
1560
+ entry_points_by_type: mr,
1561
+ abi: gr
1562
+ }), Ir = t.array(t.string()), Ft = t.object({
1563
+ type_names: t.array(t.tuple([t.number(), t.string()])),
1564
+ libfunc_names: t.array(t.tuple([t.number(), t.string()])),
1565
+ user_func_names: t.array(t.tuple([t.number(), t.string()]))
1566
+ }), $e = t.object({
1567
+ selector: t.string(),
1568
+ function_idx: t.number()
1569
+ }), Ut = t.object({
1570
+ CONSTRUCTOR: t.array($e),
1571
+ EXTERNAL: t.array($e),
1572
+ L1_HANDLER: t.array($e)
1573
+ }), Bt = t.object({
1574
+ sierra_program: Ir,
1575
+ sierra_program_debug_info: Ft.optional(),
1576
+ contract_class_version: t.string(),
1577
+ entry_points_by_type: Ut,
1578
+ abi: gr
1579
+ }), xt = t.array(t.tuple([t.number(), t.array(t.string())])), Mt = t.object({
1580
+ prime: t.string(),
1581
+ compiler_version: t.string(),
1582
+ bytecode: Ir,
1583
+ hints: t.array(t.any()),
1584
+ pythonic_hints: xt,
1585
+ entry_points_by_type: mr
1586
+ }), $n = Mt, Xn = t.union([
1587
+ kt,
1588
+ Bt
1589
+ ]), Rr = Kr(null), Nr = () => Jr(Rr), Vn = () => {
1590
+ var s;
1591
+ return !!((s = Nr()) != null && s.emitter);
1592
+ }, qn = ({ emitter: s, children: f }) => /* @__PURE__ */ et(Rr.Provider, { value: {
1593
+ emitter: s
1594
+ }, children: f });
1595
+ let lr = !1;
1596
+ const Ar = () => {
1597
+ var O;
1598
+ const s = (O = Nr()) == null ? void 0 : O.emitter;
1599
+ if (!s && !lr) {
1600
+ lr = !0;
1601
+ return;
1602
+ }
1603
+ return s;
1604
+ }, zn = () => {
1605
+ const s = Ar();
1606
+ return s ? s.emit.bind(s) : Zr;
1607
+ }, Hn = () => {
1608
+ const s = Ar();
1609
+ return (O, L) => {
1610
+ Qr(() => s ? s.on(O, L) : void 0, [O, L]);
1611
+ };
1612
+ }, Gt = t.union([
1613
+ t.literal("concentratedLiquidityPosition"),
1614
+ t.literal("collateralizedDebtPosition")
1615
+ ]), Wn = t.object({
1616
+ status: t.literal("initialising")
1617
+ }).or(t.object({
1618
+ status: t.literal("initialised"),
1619
+ balances: t.array(t.object({
1620
+ tokenAddress: er,
1621
+ tokenBalance: t.string()
1622
+ }))
1623
+ })), ir = t.object({
1624
+ id: t.number(),
1625
+ address: Re,
1626
+ brandColor: t.string().optional(),
1627
+ name: t.string(),
1628
+ symbol: t.string(),
1629
+ decimals: t.number(),
1630
+ iconUrl: t.string().optional(),
1631
+ sendable: t.boolean(),
1632
+ popular: t.boolean(),
1633
+ refundable: t.boolean(),
1634
+ listed: t.boolean(),
1635
+ tradable: t.boolean(),
1636
+ category: t.union([
1637
+ t.literal("tokens"),
1638
+ t.literal("currencies"),
1639
+ t.literal("savings")
1640
+ ]),
1641
+ pricingId: t.number().optional(),
1642
+ dappId: t.string().optional(),
1643
+ marketData: t.object({
1644
+ marketCap: t.number(),
1645
+ marketCap24hChange: t.number(),
1646
+ dailyVolume: t.number(),
1647
+ rank: t.number()
1648
+ }).optional(),
1649
+ tags: t.array(t.string()).optional()
1650
+ }), Yn = t.object({
1651
+ tokens: t.array(ir)
1652
+ }), Zn = ir, Or = t.object({
1653
+ pricingId: t.number(),
1654
+ ethValue: t.string(),
1655
+ ccyValue: t.string(),
1656
+ ethDayChange: t.string(),
1657
+ ccyDayChange: t.string()
1658
+ }), Kn = t.object({
1659
+ prices: t.array(Or)
1660
+ }), ur = t.object({
1661
+ tokenAddress: er,
1662
+ principal: t.string(),
1663
+ accruedFees: t.string(),
1664
+ minPrice: t.string(),
1665
+ maxPrice: t.string(),
1666
+ currentPrice: t.string()
1667
+ }), Sr = t.object({
1668
+ tokenAddress: Re.optional(),
1669
+ totalBalances: t.record(t.string())
1670
+ }), Tr = Sr.extend({
1671
+ tokenId: t.string(),
1672
+ data: t.object({
1673
+ poolFeePercentage: t.string(),
1674
+ tickSpacingPercentage: t.string().optional(),
1675
+ token0: ur,
1676
+ token1: ur
1677
+ })
1678
+ }), Jn = t.array(Tr), wr = Sr.extend({
1679
+ data: t.object({
1680
+ apy: t.string().optional(),
1681
+ group: t.number().optional(),
1682
+ collateral: t.boolean(),
1683
+ debt: t.boolean(),
1684
+ lending: t.boolean()
1685
+ })
1686
+ }), Qn = t.array(wr), $t = t.array(Tr.or(wr)), Xt = t.object({
1687
+ name: t.string(),
1688
+ manageUrl: t.string(),
1689
+ type: Gt,
1690
+ groups: t.record(t.object({
1691
+ name: t.string().optional(),
1692
+ healthRatio: t.string().optional()
1693
+ })).optional(),
1694
+ positions: $t
1695
+ }), Vt = t.object({
1696
+ dappId: t.string(),
1697
+ products: t.array(Xt)
1698
+ }), es = t.object({
1699
+ dapps: t.array(Vt)
1700
+ }), qt = t.object({
1701
+ name: t.string().optional(),
1702
+ tokenAddress: Re,
1703
+ amount: t.string().optional(),
1704
+ claimUrl: t.string().optional(),
1705
+ claimStart: t.number(),
1706
+ claimEnd: t.number().optional()
1707
+ }), rs = t.object({
1708
+ accountAddress: Re,
1709
+ chain: t.string(),
1710
+ airdrops: t.array(qt)
1711
+ }), Fe = t.object({
1712
+ address: Re,
1713
+ networkId: t.string({ required_error: "Network is required" })
1714
+ }, { required_error: "Token is required" }), ts = Fe.required().extend({
1715
+ balance: t.string()
1716
+ }), vr = Fe.required().extend({
1717
+ id: t.number().optional(),
1718
+ name: t.string().optional(),
1719
+ symbol: t.string().optional(),
1720
+ decimals: t.coerce.number().optional(),
1721
+ iconUrl: t.string().url("").optional().or(t.literal("")),
1722
+ // fallback since some iconUrls are empty, causing validation to fail
1723
+ pricingId: t.number().optional(),
1724
+ category: t.string().optional(),
1725
+ dappId: t.string().optional(),
1726
+ brandColor: t.string().optional()
1727
+ }), zt = vr.extend({
1728
+ balance: t.string()
1729
+ }), Ht = vr.extend({
1730
+ currencyValue: t.string(),
1731
+ currencySymbol: t.string().optional(),
1732
+ ccyDayChange: t.string().optional(),
1733
+ ethDayChange: t.string().optional(),
1734
+ unitCurrencyValue: t.string().optional()
1735
+ }), Wt = Ht.extend({
1736
+ ...zt.shape
1737
+ }), ns = t.array(Wt), ss = Fe.extend({
1738
+ ...Or.shape
1739
+ }), is = Fe.extend({
1740
+ ...ir.shape
1741
+ });
1742
+ export {
1743
+ lt as $,
1744
+ ye as A,
1745
+ Bn as B,
1746
+ gn as C,
1747
+ es as D,
1748
+ Cn as E,
1749
+ Fn as F,
1750
+ hr as G,
1751
+ nr as H,
1752
+ rt as I,
1753
+ be as J,
1754
+ tt as K,
1755
+ nt as L,
1756
+ or as M,
1757
+ In as N,
1758
+ tn as O,
1759
+ nn as P,
1760
+ sn as Q,
1761
+ an as R,
1762
+ on as S,
1763
+ cn as T,
1764
+ tr as U,
1765
+ un as V,
1766
+ fn as W,
1767
+ hn as X,
1768
+ En as Y,
1769
+ pn as Z,
1770
+ ln as _,
1771
+ ar as a,
1772
+ Pt as a$,
1773
+ je as a0,
1774
+ ft as a1,
1775
+ Ve as a2,
1776
+ pt as a3,
1777
+ dn as a4,
1778
+ Et as a5,
1779
+ qe as a6,
1780
+ ke as a7,
1781
+ ir as a8,
1782
+ Or as a9,
1783
+ gt as aA,
1784
+ It as aB,
1785
+ Rt as aC,
1786
+ Pe as aD,
1787
+ Nt as aE,
1788
+ sr as aF,
1789
+ At as aG,
1790
+ Ot as aH,
1791
+ le as aI,
1792
+ Nn as aJ,
1793
+ An as aK,
1794
+ On as aL,
1795
+ Sn as aM,
1796
+ Tn as aN,
1797
+ wn as aO,
1798
+ vn as aP,
1799
+ Ln as aQ,
1800
+ yn as aR,
1801
+ dr as aS,
1802
+ Ge as aT,
1803
+ mr as aU,
1804
+ Gn as aV,
1805
+ yt as aW,
1806
+ Je as aX,
1807
+ Ct as aY,
1808
+ Dt as aZ,
1809
+ Qe as a_,
1810
+ Kn as aa,
1811
+ ur as ab,
1812
+ Tr as ac,
1813
+ Jn as ad,
1814
+ wr as ae,
1815
+ Qn as af,
1816
+ $t as ag,
1817
+ Xt as ah,
1818
+ Vt as ai,
1819
+ qt as aj,
1820
+ rs as ak,
1821
+ Gt as al,
1822
+ Fe as am,
1823
+ ts as an,
1824
+ vr as ao,
1825
+ zt as ap,
1826
+ Ht as aq,
1827
+ Wt as ar,
1828
+ ns as as,
1829
+ ss as at,
1830
+ is as au,
1831
+ Un as av,
1832
+ St as aw,
1833
+ xn as ax,
1834
+ Mn as ay,
1835
+ ve as az,
1836
+ it as b,
1837
+ bt as b0,
1838
+ _t as b1,
1839
+ jt as b2,
1840
+ gr as b3,
1841
+ kt as b4,
1842
+ Ir as b5,
1843
+ Ft as b6,
1844
+ $e as b7,
1845
+ Ut as b8,
1846
+ Bt as b9,
1847
+ xt as ba,
1848
+ Mt as bb,
1849
+ $n as bc,
1850
+ Xn as bd,
1851
+ Nr as be,
1852
+ Vn as bf,
1853
+ qn as bg,
1854
+ Ar as bh,
1855
+ zn as bi,
1856
+ Hn as bj,
1857
+ Rn as c,
1858
+ st as d,
1859
+ ht as e,
1860
+ ut as f,
1861
+ mn as g,
1862
+ ot as h,
1863
+ ct as i,
1864
+ Dn as j,
1865
+ jn as k,
1866
+ _n as l,
1867
+ Pn as m,
1868
+ _e as n,
1869
+ bn as o,
1870
+ rn as p,
1871
+ er as q,
1872
+ rr as r,
1873
+ kn as s,
1874
+ Re as t,
1875
+ mt as u,
1876
+ Er as v,
1877
+ wt as w,
1878
+ Yn as x,
1879
+ Zn as y,
1880
+ Wn as z
1881
+ };