@orbs-network/spot-ui 0.0.21 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/spot-ui.js CHANGED
@@ -1144,7 +1144,7 @@ const U = "0x0000000000000000000000000000000000000000", H = {
1144
1144
  };
1145
1145
  var zt = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, De = Math.ceil, J = Math.floor, q = "[BigNumber Error] ", Le = q + "Number primitive has more than 15 significant digits: ", te = 1e14, S = 14, ke = 9007199254740991, Se = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], ce = 1e7, V = 1e9;
1146
1146
  function je(e) {
1147
- var n, i, y, p = b.prototype = { constructor: b, toString: null, valueOf: null }, A = new b(1), g = 20, E = 4, w = -7, T = 21, B = -1e7, C = 1e7, k = !1, P = 1, R = 0, ue = {
1147
+ var n, i, y, c = b.prototype = { constructor: b, toString: null, valueOf: null }, A = new b(1), g = 20, E = 4, w = -7, T = 21, B = -1e7, C = 1e7, k = !1, P = 1, R = 0, ue = {
1148
1148
  prefix: "",
1149
1149
  groupSize: 3,
1150
1150
  secondaryGroupSize: 0,
@@ -1156,7 +1156,7 @@ function je(e) {
1156
1156
  suffix: ""
1157
1157
  }, re = "0123456789abcdefghijklmnopqrstuvwxyz", fe = !0;
1158
1158
  function b(t, a) {
1159
- var s, u, o, c, m, r, d, f, l = this;
1159
+ var s, u, o, p, m, r, d, f, l = this;
1160
1160
  if (!(l instanceof b)) return new b(t, a);
1161
1161
  if (a == null) {
1162
1162
  if (t && t._isBigNumber === !0) {
@@ -1165,8 +1165,8 @@ function je(e) {
1165
1165
  }
1166
1166
  if ((r = typeof t == "number") && t * 0 == 0) {
1167
1167
  if (l.s = 1 / t < 0 ? (t = -t, -1) : 1, t === ~~t) {
1168
- for (c = 0, m = t; m >= 10; m /= 10, c++) ;
1169
- c > C ? l.c = l.e = null : (l.e = c, l.c = [t]);
1168
+ for (p = 0, m = t; m >= 10; m /= 10, p++) ;
1169
+ p > C ? l.c = l.e = null : (l.e = p, l.c = [t]);
1170
1170
  return;
1171
1171
  }
1172
1172
  f = String(t);
@@ -1174,7 +1174,7 @@ function je(e) {
1174
1174
  if (!zt.test(f = String(t))) return y(l, f, r);
1175
1175
  l.s = f.charCodeAt(0) == 45 ? (f = f.slice(1), -1) : 1;
1176
1176
  }
1177
- (c = f.indexOf(".")) > -1 && (f = f.replace(".", "")), (m = f.search(/e/i)) > 0 ? (c < 0 && (c = m), c += +f.slice(m + 1), f = f.substring(0, m)) : c < 0 && (c = f.length);
1177
+ (p = f.indexOf(".")) > -1 && (f = f.replace(".", "")), (m = f.search(/e/i)) > 0 ? (p < 0 && (p = m), p += +f.slice(m + 1), f = f.substring(0, m)) : p < 0 && (p = f.length);
1178
1178
  } else {
1179
1179
  if (I(a, 2, re.length, "Base"), a == 10 && fe)
1180
1180
  return l = new b(t), X(l, g + l.e + 1, E);
@@ -1184,32 +1184,32 @@ function je(e) {
1184
1184
  throw Error(Le + t);
1185
1185
  } else
1186
1186
  l.s = f.charCodeAt(0) === 45 ? (f = f.slice(1), -1) : 1;
1187
- for (s = re.slice(0, a), c = m = 0, d = f.length; m < d; m++)
1187
+ for (s = re.slice(0, a), p = m = 0, d = f.length; m < d; m++)
1188
1188
  if (s.indexOf(u = f.charAt(m)) < 0) {
1189
1189
  if (u == ".") {
1190
- if (m > c) {
1191
- c = d;
1190
+ if (m > p) {
1191
+ p = d;
1192
1192
  continue;
1193
1193
  }
1194
1194
  } else if (!o && (f == f.toUpperCase() && (f = f.toLowerCase()) || f == f.toLowerCase() && (f = f.toUpperCase()))) {
1195
- o = !0, m = -1, c = 0;
1195
+ o = !0, m = -1, p = 0;
1196
1196
  continue;
1197
1197
  }
1198
1198
  return y(l, String(t), r, a);
1199
1199
  }
1200
- r = !1, f = i(f, a, 10, l.s), (c = f.indexOf(".")) > -1 ? f = f.replace(".", "") : c = f.length;
1200
+ r = !1, f = i(f, a, 10, l.s), (p = f.indexOf(".")) > -1 ? f = f.replace(".", "") : p = f.length;
1201
1201
  }
1202
1202
  for (m = 0; f.charCodeAt(m) === 48; m++) ;
1203
1203
  for (d = f.length; f.charCodeAt(--d) === 48; ) ;
1204
1204
  if (f = f.slice(m, ++d)) {
1205
1205
  if (d -= m, r && b.DEBUG && d > 15 && (t > ke || t !== J(t)))
1206
1206
  throw Error(Le + l.s * t);
1207
- if ((c = c - m - 1) > C)
1207
+ if ((p = p - m - 1) > C)
1208
1208
  l.c = l.e = null;
1209
- else if (c < B)
1209
+ else if (p < B)
1210
1210
  l.c = [l.e = 0];
1211
1211
  else {
1212
- if (l.e = c, l.c = [], m = (c + 1) % S, c < 0 && (m += S), m < d) {
1212
+ if (l.e = p, l.c = [], m = (p + 1) % S, p < 0 && (m += S), m < d) {
1213
1213
  for (m && l.c.push(+f.slice(0, m)), d -= S; m < d; )
1214
1214
  l.c.push(+f.slice(m, m += S));
1215
1215
  m = S - (f = f.slice(m)).length;
@@ -1267,9 +1267,9 @@ function je(e) {
1267
1267
  }, b.isBigNumber = function(t) {
1268
1268
  if (!t || t._isBigNumber !== !0) return !1;
1269
1269
  if (!b.DEBUG) return !0;
1270
- var a, s, u = t.c, o = t.e, c = t.s;
1270
+ var a, s, u = t.c, o = t.e, p = t.s;
1271
1271
  e: if ({}.toString.call(u) == "[object Array]") {
1272
- if ((c === 1 || c === -1) && o >= -V && o <= V && o === J(o)) {
1272
+ if ((p === 1 || p === -1) && o >= -V && o <= V && o === J(o)) {
1273
1273
  if (u[0] === 0) {
1274
1274
  if (o === 0 && u.length === 1) return !0;
1275
1275
  break e;
@@ -1280,7 +1280,7 @@ function je(e) {
1280
1280
  if (s !== 0) return !0;
1281
1281
  }
1282
1282
  }
1283
- } else if (u === null && o === null && (c === null || c === 1 || c === -1))
1283
+ } else if (u === null && o === null && (p === null || p === 1 || p === -1))
1284
1284
  return !0;
1285
1285
  throw Error(q + "Invalid BigNumber: " + t);
1286
1286
  }, b.maximum = b.max = function() {
@@ -1294,7 +1294,7 @@ function je(e) {
1294
1294
  return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
1295
1295
  };
1296
1296
  return function(s) {
1297
- var u, o, c, m, r, d = 0, f = [], l = new b(A);
1297
+ var u, o, p, m, r, d = 0, f = [], l = new b(A);
1298
1298
  if (s == null ? s = g : I(s, 0, V), m = De(s / S), k)
1299
1299
  if (crypto.getRandomValues) {
1300
1300
  for (u = crypto.getRandomValues(new Uint32Array(m *= 2)); d < m; )
@@ -1311,28 +1311,28 @@ function je(e) {
1311
1311
  r = a(), r < 9e15 && (f[d++] = r % 1e14);
1312
1312
  for (m = f[--d], s %= S, m && s && (r = Se[S - s], f[d] = J(m / r) * r); f[d] === 0; f.pop(), d--) ;
1313
1313
  if (d < 0)
1314
- f = [c = 0];
1314
+ f = [p = 0];
1315
1315
  else {
1316
- for (c = -1; f[0] === 0; f.splice(0, 1), c -= S) ;
1316
+ for (p = -1; f[0] === 0; f.splice(0, 1), p -= S) ;
1317
1317
  for (d = 1, r = f[0]; r >= 10; r /= 10, d++) ;
1318
- d < S && (c -= S - d);
1318
+ d < S && (p -= S - d);
1319
1319
  }
1320
- return l.e = c, l.c = f, l;
1320
+ return l.e = p, l.c = f, l;
1321
1321
  };
1322
1322
  })(), b.sum = function() {
1323
1323
  for (var t = 1, a = arguments, s = new b(a[0]); t < a.length; ) s = s.plus(a[t++]);
1324
1324
  return s;
1325
1325
  }, i = /* @__PURE__ */ (function() {
1326
1326
  var t = "0123456789";
1327
- function a(s, u, o, c) {
1327
+ function a(s, u, o, p) {
1328
1328
  for (var m, r = [0], d, f = 0, l = s.length; f < l; ) {
1329
1329
  for (d = r.length; d--; r[d] *= u) ;
1330
- for (r[0] += c.indexOf(s.charAt(f++)), m = 0; m < r.length; m++)
1330
+ for (r[0] += p.indexOf(s.charAt(f++)), m = 0; m < r.length; m++)
1331
1331
  r[m] > o - 1 && (r[m + 1] == null && (r[m + 1] = 0), r[m + 1] += r[m] / o | 0, r[m] %= o);
1332
1332
  }
1333
1333
  return r.reverse();
1334
1334
  }
1335
- return function(s, u, o, c, m) {
1335
+ return function(s, u, o, p, m) {
1336
1336
  var r, d, f, l, h, F, D, v, N = s.indexOf("."), L = g, O = E;
1337
1337
  for (N >= 0 && (l = R, R = 0, s = s.replace(".", ""), v = new b(u), F = v.pow(s.length - N), R = l, v.c = a(
1338
1338
  oe(Y(F.c), F.e, "0"),
@@ -1341,7 +1341,7 @@ function je(e) {
1341
1341
  t
1342
1342
  ), v.e = v.c.length), D = a(s, u, o, m ? (r = re, t) : (r = t, re)), f = l = D.length; D[--l] == 0; D.pop()) ;
1343
1343
  if (!D[0]) return r.charAt(0);
1344
- if (N < 0 ? --f : (F.c = D, F.e = f, F.s = c, F = n(F, v, L, O, o), D = F.c, h = F.r, f = F.e), d = f + L + 1, N = D[d], l = o / 2, h = h || d < 0 || D[d + 1] != null, h = O < 4 ? (N != null || h) && (O == 0 || O == (F.s < 0 ? 3 : 2)) : N > l || N == l && (O == 4 || h || O == 6 && D[d - 1] & 1 || O == (F.s < 0 ? 8 : 7)), d < 1 || !D[0])
1344
+ if (N < 0 ? --f : (F.c = D, F.e = f, F.s = p, F = n(F, v, L, O, o), D = F.c, h = F.r, f = F.e), d = f + L + 1, N = D[d], l = o / 2, h = h || d < 0 || D[d + 1] != null, h = O < 4 ? (N != null || h) && (O == 0 || O == (F.s < 0 ? 3 : 2)) : N > l || N == l && (O == 4 || h || O == 6 && D[d - 1] & 1 || O == (F.s < 0 ? 8 : 7)), d < 1 || !D[0])
1345
1345
  s = h ? oe(r.charAt(1), -L, r.charAt(0)) : r.charAt(0);
1346
1346
  else {
1347
1347
  if (D.length = d, h)
@@ -1354,30 +1354,30 @@ function je(e) {
1354
1354
  return s;
1355
1355
  };
1356
1356
  })(), n = /* @__PURE__ */ (function() {
1357
- function t(u, o, c) {
1357
+ function t(u, o, p) {
1358
1358
  var m, r, d, f, l = 0, h = u.length, F = o % ce, D = o / ce | 0;
1359
1359
  for (u = u.slice(); h--; )
1360
- d = u[h] % ce, f = u[h] / ce | 0, m = D * d + f * F, r = F * d + m % ce * ce + l, l = (r / c | 0) + (m / ce | 0) + D * f, u[h] = r % c;
1360
+ d = u[h] % ce, f = u[h] / ce | 0, m = D * d + f * F, r = F * d + m % ce * ce + l, l = (r / p | 0) + (m / ce | 0) + D * f, u[h] = r % p;
1361
1361
  return l && (u = [l].concat(u)), u;
1362
1362
  }
1363
- function a(u, o, c, m) {
1363
+ function a(u, o, p, m) {
1364
1364
  var r, d;
1365
- if (c != m)
1366
- d = c > m ? 1 : -1;
1365
+ if (p != m)
1366
+ d = p > m ? 1 : -1;
1367
1367
  else
1368
- for (r = d = 0; r < c; r++)
1368
+ for (r = d = 0; r < p; r++)
1369
1369
  if (u[r] != o[r]) {
1370
1370
  d = u[r] > o[r] ? 1 : -1;
1371
1371
  break;
1372
1372
  }
1373
1373
  return d;
1374
1374
  }
1375
- function s(u, o, c, m) {
1376
- for (var r = 0; c--; )
1377
- u[c] -= r, r = u[c] < o[c] ? 1 : 0, u[c] = r * m + u[c] - o[c];
1375
+ function s(u, o, p, m) {
1376
+ for (var r = 0; p--; )
1377
+ u[p] -= r, r = u[p] < o[p] ? 1 : 0, u[p] = r * m + u[p] - o[p];
1378
1378
  for (; !u[0] && u.length > 1; u.splice(0, 1)) ;
1379
1379
  }
1380
- return function(u, o, c, m, r) {
1380
+ return function(u, o, p, m, r) {
1381
1381
  var d, f, l, h, F, D, v, N, L, O, _, W, he, Fe, Ce, ae, me, Q = u.s == o.s ? 1 : -1, z = u.c, M = o.c;
1382
1382
  if (!z || !z[0] || !M || !M[0])
1383
1383
  return new b(
@@ -1387,7 +1387,7 @@ function je(e) {
1387
1387
  z && z[0] == 0 || !M ? Q * 0 : Q / 0
1388
1388
  )
1389
1389
  );
1390
- for (N = new b(Q), L = N.c = [], f = u.e - o.e, Q = c + f + 1, r || (r = te, f = ee(u.e / S) - ee(o.e / S), Q = Q / S | 0), l = 0; M[l] == (z[l] || 0); l++) ;
1390
+ for (N = new b(Q), L = N.c = [], f = u.e - o.e, Q = p + f + 1, r || (r = te, f = ee(u.e / S) - ee(o.e / S), Q = Q / S | 0), l = 0; M[l] == (z[l] || 0); l++) ;
1391
1391
  if (M[l] > (z[l] || 0) && f--, Q < 0)
1392
1392
  L.push(1), h = !0;
1393
1393
  else {
@@ -1410,30 +1410,30 @@ function je(e) {
1410
1410
  }
1411
1411
  if (r == te) {
1412
1412
  for (l = 1, Q = L[0]; Q >= 10; Q /= 10, l++) ;
1413
- X(N, c + (N.e = l + f * S - 1) + 1, m, h);
1413
+ X(N, p + (N.e = l + f * S - 1) + 1, m, h);
1414
1414
  } else
1415
1415
  N.e = f, N.r = +h;
1416
1416
  return N;
1417
1417
  };
1418
1418
  })();
1419
1419
  function we(t, a, s, u) {
1420
- var o, c, m, r, d;
1420
+ var o, p, m, r, d;
1421
1421
  if (s == null ? s = E : I(s, 0, 8), !t.c) return t.toString();
1422
1422
  if (o = t.c[0], m = t.e, a == null)
1423
1423
  d = Y(t.c), d = u == 1 || u == 2 && (m <= w || m >= T) ? ge(d, m) : oe(d, m, "0");
1424
- else if (t = X(new b(t), a, s), c = t.e, d = Y(t.c), r = d.length, u == 1 || u == 2 && (a <= c || c <= w)) {
1424
+ else if (t = X(new b(t), a, s), p = t.e, d = Y(t.c), r = d.length, u == 1 || u == 2 && (a <= p || p <= w)) {
1425
1425
  for (; r < a; d += "0", r++) ;
1426
- d = ge(d, c);
1427
- } else if (a -= m + (u === 2 && c > m), d = oe(d, c, "0"), c + 1 > r) {
1426
+ d = ge(d, p);
1427
+ } else if (a -= m + (u === 2 && p > m), d = oe(d, p, "0"), p + 1 > r) {
1428
1428
  if (--a > 0) for (d += "."; a--; d += "0") ;
1429
- } else if (a += c - r, a > 0)
1430
- for (c + 1 == r && (d += "."); a--; d += "0") ;
1429
+ } else if (a += p - r, a > 0)
1430
+ for (p + 1 == r && (d += "."); a--; d += "0") ;
1431
1431
  return t.s < 0 && o ? "-" + d : d;
1432
1432
  }
1433
1433
  function Ue(t, a) {
1434
- for (var s, u, o = 1, c = new b(t[0]); o < t.length; o++)
1435
- u = new b(t[o]), (!u.s || (s = le(c, u)) === a || s === 0 && c.s === a) && (c = u);
1436
- return c;
1434
+ for (var s, u, o = 1, p = new b(t[0]); o < t.length; o++)
1435
+ u = new b(t[o]), (!u.s || (s = le(p, u)) === a || s === 0 && p.s === a) && (p = u);
1436
+ return p;
1437
1437
  }
1438
1438
  function Te(t, a, s) {
1439
1439
  for (var u = 1, o = a.length; !a[--o]; a.pop()) ;
@@ -1442,10 +1442,10 @@ function je(e) {
1442
1442
  }
1443
1443
  y = /* @__PURE__ */ (function() {
1444
1444
  var t = /^(-?)0([xbo])(?=\w[\w.]*$)/i, a = /^([^.]+)\.$/, s = /^\.([^.]+)$/, u = /^-?(Infinity|NaN)$/, o = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
1445
- return function(c, m, r, d) {
1445
+ return function(p, m, r, d) {
1446
1446
  var f, l = r ? m : m.replace(o, "");
1447
1447
  if (u.test(l))
1448
- c.s = isNaN(l) ? null : l < 0 ? -1 : 1;
1448
+ p.s = isNaN(l) ? null : l < 0 ? -1 : 1;
1449
1449
  else {
1450
1450
  if (!r && (l = l.replace(t, function(h, F, D) {
1451
1451
  return f = (D = D.toLowerCase()) == "x" ? 16 : D == "b" ? 2 : 8, !d || d == f ? F : h;
@@ -1453,46 +1453,46 @@ function je(e) {
1453
1453
  return new b(l, f);
1454
1454
  if (b.DEBUG)
1455
1455
  throw Error(q + "Not a" + (d ? " base " + d : "") + " number: " + m);
1456
- c.s = null;
1456
+ p.s = null;
1457
1457
  }
1458
- c.c = c.e = null;
1458
+ p.c = p.e = null;
1459
1459
  };
1460
1460
  })();
1461
1461
  function X(t, a, s, u) {
1462
- var o, c, m, r, d, f, l, h = t.c, F = Se;
1462
+ var o, p, m, r, d, f, l, h = t.c, F = Se;
1463
1463
  if (h) {
1464
1464
  e: {
1465
1465
  for (o = 1, r = h[0]; r >= 10; r /= 10, o++) ;
1466
- if (c = a - o, c < 0)
1467
- c += S, m = a, d = h[f = 0], l = J(d / F[o - m - 1] % 10);
1468
- else if (f = De((c + 1) / S), f >= h.length)
1466
+ if (p = a - o, p < 0)
1467
+ p += S, m = a, d = h[f = 0], l = J(d / F[o - m - 1] % 10);
1468
+ else if (f = De((p + 1) / S), f >= h.length)
1469
1469
  if (u) {
1470
1470
  for (; h.length <= f; h.push(0)) ;
1471
- d = l = 0, o = 1, c %= S, m = c - S + 1;
1471
+ d = l = 0, o = 1, p %= S, m = p - S + 1;
1472
1472
  } else
1473
1473
  break e;
1474
1474
  else {
1475
1475
  for (d = r = h[f], o = 1; r >= 10; r /= 10, o++) ;
1476
- c %= S, m = c - S + o, l = m < 0 ? 0 : J(d / F[o - m - 1] % 10);
1476
+ p %= S, m = p - S + o, l = m < 0 ? 0 : J(d / F[o - m - 1] % 10);
1477
1477
  }
1478
1478
  if (u = u || a < 0 || // Are there any non-zero digits after the rounding digit?
1479
1479
  // The expression n % pows10[d - j - 1] returns all digits of n to the right
1480
1480
  // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
1481
1481
  h[f + 1] != null || (m < 0 ? d : d % F[o - m - 1]), u = s < 4 ? (l || u) && (s == 0 || s == (t.s < 0 ? 3 : 2)) : l > 5 || l == 5 && (s == 4 || u || s == 6 && // Check whether the digit to the left of the rounding digit is odd.
1482
- (c > 0 ? m > 0 ? d / F[o - m] : 0 : h[f - 1]) % 10 & 1 || s == (t.s < 0 ? 8 : 7)), a < 1 || !h[0])
1482
+ (p > 0 ? m > 0 ? d / F[o - m] : 0 : h[f - 1]) % 10 & 1 || s == (t.s < 0 ? 8 : 7)), a < 1 || !h[0])
1483
1483
  return h.length = 0, u ? (a -= t.e + 1, h[0] = F[(S - a % S) % S], t.e = -a || 0) : h[0] = t.e = 0, t;
1484
- if (c == 0 ? (h.length = f, r = 1, f--) : (h.length = f + 1, r = F[S - c], h[f] = m > 0 ? J(d / F[o - m] % F[m]) * r : 0), u)
1484
+ if (p == 0 ? (h.length = f, r = 1, f--) : (h.length = f + 1, r = F[S - p], h[f] = m > 0 ? J(d / F[o - m] % F[m]) * r : 0), u)
1485
1485
  for (; ; )
1486
1486
  if (f == 0) {
1487
- for (c = 1, m = h[0]; m >= 10; m /= 10, c++) ;
1487
+ for (p = 1, m = h[0]; m >= 10; m /= 10, p++) ;
1488
1488
  for (m = h[0] += r, r = 1; m >= 10; m /= 10, r++) ;
1489
- c != r && (t.e++, h[0] == te && (h[0] = 1));
1489
+ p != r && (t.e++, h[0] == te && (h[0] = 1));
1490
1490
  break;
1491
1491
  } else {
1492
1492
  if (h[f] += r, h[f] != te) break;
1493
1493
  h[f--] = 0, r = 1;
1494
1494
  }
1495
- for (c = h.length; h[--c] === 0; h.pop()) ;
1495
+ for (p = h.length; h[--p] === 0; h.pop()) ;
1496
1496
  }
1497
1497
  t.e > C ? t.c = t.e = null : t.e < B && (t.c = [t.e = 0]);
1498
1498
  }
@@ -1502,24 +1502,24 @@ function je(e) {
1502
1502
  var a, s = t.e;
1503
1503
  return s === null ? t.toString() : (a = Y(t.c), a = s <= w || s >= T ? ge(a, s) : oe(a, s, "0"), t.s < 0 ? "-" + a : a);
1504
1504
  }
1505
- return p.absoluteValue = p.abs = function() {
1505
+ return c.absoluteValue = c.abs = function() {
1506
1506
  var t = new b(this);
1507
1507
  return t.s < 0 && (t.s = 1), t;
1508
- }, p.comparedTo = function(t, a) {
1508
+ }, c.comparedTo = function(t, a) {
1509
1509
  return le(this, new b(t, a));
1510
- }, p.decimalPlaces = p.dp = function(t, a) {
1511
- var s, u, o, c = this;
1510
+ }, c.decimalPlaces = c.dp = function(t, a) {
1511
+ var s, u, o, p = this;
1512
1512
  if (t != null)
1513
- return I(t, 0, V), a == null ? a = E : I(a, 0, 8), X(new b(c), t + c.e + 1, a);
1514
- if (!(s = c.c)) return null;
1513
+ return I(t, 0, V), a == null ? a = E : I(a, 0, 8), X(new b(p), t + p.e + 1, a);
1514
+ if (!(s = p.c)) return null;
1515
1515
  if (u = ((o = s.length - 1) - ee(this.e / S)) * S, o = s[o]) for (; o % 10 == 0; o /= 10, u--) ;
1516
1516
  return u < 0 && (u = 0), u;
1517
- }, p.dividedBy = p.div = function(t, a) {
1517
+ }, c.dividedBy = c.div = function(t, a) {
1518
1518
  return n(this, new b(t, a), g, E);
1519
- }, p.dividedToIntegerBy = p.idiv = function(t, a) {
1519
+ }, c.dividedToIntegerBy = c.idiv = function(t, a) {
1520
1520
  return n(this, new b(t, a), 0, 1);
1521
- }, p.exponentiatedBy = p.pow = function(t, a) {
1522
- var s, u, o, c, m, r, d, f, l, h = this;
1521
+ }, c.exponentiatedBy = c.pow = function(t, a) {
1522
+ var s, u, o, p, m, r, d, f, l, h = this;
1523
1523
  if (t = new b(t), t.c && !t.isInteger())
1524
1524
  throw Error(q + "Exponent not an integer: " + ie(t));
1525
1525
  if (a != null && (a = new b(a)), r = t.e > 14, !h.c || !h.c[0] || h.c[0] == 1 && !h.e && h.c.length == 1 || !t.c || !t.c[0])
@@ -1529,13 +1529,13 @@ function je(e) {
1529
1529
  u = !d && h.isInteger() && a.isInteger(), u && (h = h.mod(a));
1530
1530
  } else {
1531
1531
  if (t.e > 9 && (h.e > 0 || h.e < -1 || (h.e == 0 ? h.c[0] > 1 || r && h.c[1] >= 24e7 : h.c[0] < 8e13 || r && h.c[0] <= 9999975e7)))
1532
- return c = h.s < 0 && be(t) ? -0 : 0, h.e > -1 && (c = 1 / c), new b(d ? 1 / c : c);
1533
- R && (c = De(R / S + 2));
1532
+ return p = h.s < 0 && be(t) ? -0 : 0, h.e > -1 && (p = 1 / p), new b(d ? 1 / p : p);
1533
+ R && (p = De(R / S + 2));
1534
1534
  }
1535
1535
  for (r ? (s = new b(0.5), d && (t.s = 1), f = be(t)) : (o = Math.abs(+ie(t)), f = o % 2), l = new b(A); ; ) {
1536
1536
  if (f) {
1537
1537
  if (l = l.times(h), !l.c) break;
1538
- c ? l.c.length > c && (l.c.length = c) : u && (l = l.mod(a));
1538
+ p ? l.c.length > p && (l.c.length = p) : u && (l = l.mod(a));
1539
1539
  }
1540
1540
  if (o) {
1541
1541
  if (o = J(o / 2), o === 0) break;
@@ -1546,36 +1546,36 @@ function je(e) {
1546
1546
  if (o = +ie(t), o === 0) break;
1547
1547
  f = o % 2;
1548
1548
  }
1549
- h = h.times(h), c ? h.c && h.c.length > c && (h.c.length = c) : u && (h = h.mod(a));
1549
+ h = h.times(h), p ? h.c && h.c.length > p && (h.c.length = p) : u && (h = h.mod(a));
1550
1550
  }
1551
- return u ? l : (d && (l = A.div(l)), a ? l.mod(a) : c ? X(l, R, E, m) : l);
1552
- }, p.integerValue = function(t) {
1551
+ return u ? l : (d && (l = A.div(l)), a ? l.mod(a) : p ? X(l, R, E, m) : l);
1552
+ }, c.integerValue = function(t) {
1553
1553
  var a = new b(this);
1554
1554
  return t == null ? t = E : I(t, 0, 8), X(a, a.e + 1, t);
1555
- }, p.isEqualTo = p.eq = function(t, a) {
1555
+ }, c.isEqualTo = c.eq = function(t, a) {
1556
1556
  return le(this, new b(t, a)) === 0;
1557
- }, p.isFinite = function() {
1557
+ }, c.isFinite = function() {
1558
1558
  return !!this.c;
1559
- }, p.isGreaterThan = p.gt = function(t, a) {
1559
+ }, c.isGreaterThan = c.gt = function(t, a) {
1560
1560
  return le(this, new b(t, a)) > 0;
1561
- }, p.isGreaterThanOrEqualTo = p.gte = function(t, a) {
1561
+ }, c.isGreaterThanOrEqualTo = c.gte = function(t, a) {
1562
1562
  return (a = le(this, new b(t, a))) === 1 || a === 0;
1563
- }, p.isInteger = function() {
1563
+ }, c.isInteger = function() {
1564
1564
  return !!this.c && ee(this.e / S) > this.c.length - 2;
1565
- }, p.isLessThan = p.lt = function(t, a) {
1565
+ }, c.isLessThan = c.lt = function(t, a) {
1566
1566
  return le(this, new b(t, a)) < 0;
1567
- }, p.isLessThanOrEqualTo = p.lte = function(t, a) {
1567
+ }, c.isLessThanOrEqualTo = c.lte = function(t, a) {
1568
1568
  return (a = le(this, new b(t, a))) === -1 || a === 0;
1569
- }, p.isNaN = function() {
1569
+ }, c.isNaN = function() {
1570
1570
  return !this.s;
1571
- }, p.isNegative = function() {
1571
+ }, c.isNegative = function() {
1572
1572
  return this.s < 0;
1573
- }, p.isPositive = function() {
1573
+ }, c.isPositive = function() {
1574
1574
  return this.s > 0;
1575
- }, p.isZero = function() {
1575
+ }, c.isZero = function() {
1576
1576
  return !!this.c && this.c[0] == 0;
1577
- }, p.minus = function(t, a) {
1578
- var s, u, o, c, m = this, r = m.s;
1577
+ }, c.minus = function(t, a) {
1578
+ var s, u, o, p, m = this, r = m.s;
1579
1579
  if (t = new b(t, a), a = t.s, !r || !a) return new b(NaN);
1580
1580
  if (r != a)
1581
1581
  return t.s = -a, m.plus(t);
@@ -1589,15 +1589,15 @@ function je(e) {
1589
1589
  ));
1590
1590
  }
1591
1591
  if (d = ee(d), f = ee(f), l = l.slice(), r = d - f) {
1592
- for ((c = r < 0) ? (r = -r, o = l) : (f = d, o = h), o.reverse(), a = r; a--; o.push(0)) ;
1592
+ for ((p = r < 0) ? (r = -r, o = l) : (f = d, o = h), o.reverse(), a = r; a--; o.push(0)) ;
1593
1593
  o.reverse();
1594
1594
  } else
1595
- for (u = (c = (r = l.length) < (a = h.length)) ? r : a, r = a = 0; a < u; a++)
1595
+ for (u = (p = (r = l.length) < (a = h.length)) ? r : a, r = a = 0; a < u; a++)
1596
1596
  if (l[a] != h[a]) {
1597
- c = l[a] < h[a];
1597
+ p = l[a] < h[a];
1598
1598
  break;
1599
1599
  }
1600
- if (c && (o = l, l = h, h = o, t.s = -t.s), a = (u = h.length) - (s = l.length), a > 0) for (; a--; l[s++] = 0) ;
1600
+ if (p && (o = l, l = h, h = o, t.s = -t.s), a = (u = h.length) - (s = l.length), a > 0) for (; a--; l[s++] = 0) ;
1601
1601
  for (a = te - 1; u > r; ) {
1602
1602
  if (l[--u] < h[u]) {
1603
1603
  for (s = u; s && !l[--s]; l[s] = a) ;
@@ -1607,86 +1607,86 @@ function je(e) {
1607
1607
  }
1608
1608
  for (; l[0] == 0; l.splice(0, 1), --f) ;
1609
1609
  return l[0] ? Te(t, l, f) : (t.s = E == 3 ? -1 : 1, t.c = [t.e = 0], t);
1610
- }, p.modulo = p.mod = function(t, a) {
1610
+ }, c.modulo = c.mod = function(t, a) {
1611
1611
  var s, u, o = this;
1612
1612
  return t = new b(t, a), !o.c || !t.s || t.c && !t.c[0] ? new b(NaN) : !t.c || o.c && !o.c[0] ? new b(o) : (P == 9 ? (u = t.s, t.s = 1, s = n(o, t, 0, 3), t.s = u, s.s *= u) : s = n(o, t, 0, P), t = o.minus(s.times(t)), !t.c[0] && P == 1 && (t.s = o.s), t);
1613
- }, p.multipliedBy = p.times = function(t, a) {
1614
- var s, u, o, c, m, r, d, f, l, h, F, D, v, N, L, O = this, _ = O.c, W = (t = new b(t, a)).c;
1613
+ }, c.multipliedBy = c.times = function(t, a) {
1614
+ var s, u, o, p, m, r, d, f, l, h, F, D, v, N, L, O = this, _ = O.c, W = (t = new b(t, a)).c;
1615
1615
  if (!_ || !W || !_[0] || !W[0])
1616
1616
  return !O.s || !t.s || _ && !_[0] && !W || W && !W[0] && !_ ? t.c = t.e = t.s = null : (t.s *= O.s, !_ || !W ? t.c = t.e = null : (t.c = [0], t.e = 0)), t;
1617
1617
  for (u = ee(O.e / S) + ee(t.e / S), t.s *= O.s, d = _.length, h = W.length, d < h && (v = _, _ = W, W = v, o = d, d = h, h = o), o = d + h, v = []; o--; v.push(0)) ;
1618
1618
  for (N = te, L = ce, o = h; --o >= 0; ) {
1619
- for (s = 0, F = W[o] % L, D = W[o] / L | 0, m = d, c = o + m; c > o; )
1620
- f = _[--m] % L, l = _[m] / L | 0, r = D * f + l * F, f = F * f + r % L * L + v[c] + s, s = (f / N | 0) + (r / L | 0) + D * l, v[c--] = f % N;
1621
- v[c] = s;
1619
+ for (s = 0, F = W[o] % L, D = W[o] / L | 0, m = d, p = o + m; p > o; )
1620
+ f = _[--m] % L, l = _[m] / L | 0, r = D * f + l * F, f = F * f + r % L * L + v[p] + s, s = (f / N | 0) + (r / L | 0) + D * l, v[p--] = f % N;
1621
+ v[p] = s;
1622
1622
  }
1623
1623
  return s ? ++u : v.splice(0, 1), Te(t, v, u);
1624
- }, p.negated = function() {
1624
+ }, c.negated = function() {
1625
1625
  var t = new b(this);
1626
1626
  return t.s = -t.s || null, t;
1627
- }, p.plus = function(t, a) {
1627
+ }, c.plus = function(t, a) {
1628
1628
  var s, u = this, o = u.s;
1629
1629
  if (t = new b(t, a), a = t.s, !o || !a) return new b(NaN);
1630
1630
  if (o != a)
1631
1631
  return t.s = -a, u.minus(t);
1632
- var c = u.e / S, m = t.e / S, r = u.c, d = t.c;
1633
- if (!c || !m) {
1632
+ var p = u.e / S, m = t.e / S, r = u.c, d = t.c;
1633
+ if (!p || !m) {
1634
1634
  if (!r || !d) return new b(o / 0);
1635
1635
  if (!r[0] || !d[0]) return d[0] ? t : new b(r[0] ? u : o * 0);
1636
1636
  }
1637
- if (c = ee(c), m = ee(m), r = r.slice(), o = c - m) {
1638
- for (o > 0 ? (m = c, s = d) : (o = -o, s = r), s.reverse(); o--; s.push(0)) ;
1637
+ if (p = ee(p), m = ee(m), r = r.slice(), o = p - m) {
1638
+ for (o > 0 ? (m = p, s = d) : (o = -o, s = r), s.reverse(); o--; s.push(0)) ;
1639
1639
  s.reverse();
1640
1640
  }
1641
1641
  for (o = r.length, a = d.length, o - a < 0 && (s = d, d = r, r = s, a = o), o = 0; a; )
1642
1642
  o = (r[--a] = r[a] + d[a] + o) / te | 0, r[a] = te === r[a] ? 0 : r[a] % te;
1643
1643
  return o && (r = [o].concat(r), ++m), Te(t, r, m);
1644
- }, p.precision = p.sd = function(t, a) {
1645
- var s, u, o, c = this;
1644
+ }, c.precision = c.sd = function(t, a) {
1645
+ var s, u, o, p = this;
1646
1646
  if (t != null && t !== !!t)
1647
- return I(t, 1, V), a == null ? a = E : I(a, 0, 8), X(new b(c), t, a);
1648
- if (!(s = c.c)) return null;
1647
+ return I(t, 1, V), a == null ? a = E : I(a, 0, 8), X(new b(p), t, a);
1648
+ if (!(s = p.c)) return null;
1649
1649
  if (o = s.length - 1, u = o * S + 1, o = s[o]) {
1650
1650
  for (; o % 10 == 0; o /= 10, u--) ;
1651
1651
  for (o = s[0]; o >= 10; o /= 10, u++) ;
1652
1652
  }
1653
- return t && c.e + 1 > u && (u = c.e + 1), u;
1654
- }, p.shiftedBy = function(t) {
1653
+ return t && p.e + 1 > u && (u = p.e + 1), u;
1654
+ }, c.shiftedBy = function(t) {
1655
1655
  return I(t, -ke, ke), this.times("1e" + t);
1656
- }, p.squareRoot = p.sqrt = function() {
1657
- var t, a, s, u, o, c = this, m = c.c, r = c.s, d = c.e, f = g + 4, l = new b("0.5");
1656
+ }, c.squareRoot = c.sqrt = function() {
1657
+ var t, a, s, u, o, p = this, m = p.c, r = p.s, d = p.e, f = g + 4, l = new b("0.5");
1658
1658
  if (r !== 1 || !m || !m[0])
1659
- return new b(!r || r < 0 && (!m || m[0]) ? NaN : m ? c : 1 / 0);
1660
- if (r = Math.sqrt(+ie(c)), r == 0 || r == 1 / 0 ? (a = Y(m), (a.length + d) % 2 == 0 && (a += "0"), r = Math.sqrt(+a), d = ee((d + 1) / 2) - (d < 0 || d % 2), r == 1 / 0 ? a = "5e" + d : (a = r.toExponential(), a = a.slice(0, a.indexOf("e") + 1) + d), s = new b(a)) : s = new b(r + ""), s.c[0]) {
1659
+ return new b(!r || r < 0 && (!m || m[0]) ? NaN : m ? p : 1 / 0);
1660
+ if (r = Math.sqrt(+ie(p)), r == 0 || r == 1 / 0 ? (a = Y(m), (a.length + d) % 2 == 0 && (a += "0"), r = Math.sqrt(+a), d = ee((d + 1) / 2) - (d < 0 || d % 2), r == 1 / 0 ? a = "5e" + d : (a = r.toExponential(), a = a.slice(0, a.indexOf("e") + 1) + d), s = new b(a)) : s = new b(r + ""), s.c[0]) {
1661
1661
  for (d = s.e, r = d + f, r < 3 && (r = 0); ; )
1662
- if (o = s, s = l.times(o.plus(n(c, o, f, 1))), Y(o.c).slice(0, r) === (a = Y(s.c)).slice(0, r))
1662
+ if (o = s, s = l.times(o.plus(n(p, o, f, 1))), Y(o.c).slice(0, r) === (a = Y(s.c)).slice(0, r))
1663
1663
  if (s.e < d && --r, a = a.slice(r - 3, r + 1), a == "9999" || !u && a == "4999") {
1664
- if (!u && (X(o, o.e + g + 2, 0), o.times(o).eq(c))) {
1664
+ if (!u && (X(o, o.e + g + 2, 0), o.times(o).eq(p))) {
1665
1665
  s = o;
1666
1666
  break;
1667
1667
  }
1668
1668
  f += 4, r += 4, u = 1;
1669
1669
  } else {
1670
- (!+a || !+a.slice(1) && a.charAt(0) == "5") && (X(s, s.e + g + 2, 1), t = !s.times(s).eq(c));
1670
+ (!+a || !+a.slice(1) && a.charAt(0) == "5") && (X(s, s.e + g + 2, 1), t = !s.times(s).eq(p));
1671
1671
  break;
1672
1672
  }
1673
1673
  }
1674
1674
  return X(s, s.e + g + 1, E, t);
1675
- }, p.toExponential = function(t, a) {
1675
+ }, c.toExponential = function(t, a) {
1676
1676
  return t != null && (I(t, 0, V), t++), we(this, t, a, 1);
1677
- }, p.toFixed = function(t, a) {
1677
+ }, c.toFixed = function(t, a) {
1678
1678
  return t != null && (I(t, 0, V), t = t + this.e + 1), we(this, t, a);
1679
- }, p.toFormat = function(t, a, s) {
1679
+ }, c.toFormat = function(t, a, s) {
1680
1680
  var u, o = this;
1681
1681
  if (s == null)
1682
1682
  t != null && a && typeof a == "object" ? (s = a, a = null) : t && typeof t == "object" ? (s = t, t = a = null) : s = ue;
1683
1683
  else if (typeof s != "object")
1684
1684
  throw Error(q + "Argument not an object: " + s);
1685
1685
  if (u = o.toFixed(t, a), o.c) {
1686
- var c, m = u.split("."), r = +s.groupSize, d = +s.secondaryGroupSize, f = s.groupSeparator || "", l = m[0], h = m[1], F = o.s < 0, D = F ? l.slice(1) : l, v = D.length;
1687
- if (d && (c = r, r = d, d = c, v -= c), r > 0 && v > 0) {
1688
- for (c = v % r || r, l = D.substr(0, c); c < v; c += r) l += f + D.substr(c, r);
1689
- d > 0 && (l += f + D.slice(c)), F && (l = "-" + l);
1686
+ var p, m = u.split("."), r = +s.groupSize, d = +s.secondaryGroupSize, f = s.groupSeparator || "", l = m[0], h = m[1], F = o.s < 0, D = F ? l.slice(1) : l, v = D.length;
1687
+ if (d && (p = r, r = d, d = p, v -= p), r > 0 && v > 0) {
1688
+ for (p = v % r || r, l = D.substr(0, p); p < v; p += r) l += f + D.substr(p, r);
1689
+ d > 0 && (l += f + D.slice(p)), F && (l = "-" + l);
1690
1690
  }
1691
1691
  u = h ? l + (s.decimalSeparator || "") + ((d = +s.fractionGroupSize) ? h.replace(
1692
1692
  new RegExp("\\d{" + d + "}\\B", "g"),
@@ -1694,47 +1694,47 @@ function je(e) {
1694
1694
  ) : h) : l;
1695
1695
  }
1696
1696
  return (s.prefix || "") + u + (s.suffix || "");
1697
- }, p.toFraction = function(t) {
1698
- var a, s, u, o, c, m, r, d, f, l, h, F, D = this, v = D.c;
1697
+ }, c.toFraction = function(t) {
1698
+ var a, s, u, o, p, m, r, d, f, l, h, F, D = this, v = D.c;
1699
1699
  if (t != null && (r = new b(t), !r.isInteger() && (r.c || r.s !== 1) || r.lt(A)))
1700
1700
  throw Error(q + "Argument " + (r.isInteger() ? "out of range: " : "not an integer: ") + ie(r));
1701
1701
  if (!v) return new b(D);
1702
- for (a = new b(A), f = s = new b(A), u = d = new b(A), F = Y(v), c = a.e = F.length - D.e - 1, a.c[0] = Se[(m = c % S) < 0 ? S + m : m], t = !t || r.comparedTo(a) > 0 ? c > 0 ? a : f : r, m = C, C = 1 / 0, r = new b(F), d.c[0] = 0; l = n(r, a, 0, 1), o = s.plus(l.times(u)), o.comparedTo(t) != 1; )
1702
+ for (a = new b(A), f = s = new b(A), u = d = new b(A), F = Y(v), p = a.e = F.length - D.e - 1, a.c[0] = Se[(m = p % S) < 0 ? S + m : m], t = !t || r.comparedTo(a) > 0 ? p > 0 ? a : f : r, m = C, C = 1 / 0, r = new b(F), d.c[0] = 0; l = n(r, a, 0, 1), o = s.plus(l.times(u)), o.comparedTo(t) != 1; )
1703
1703
  s = u, u = o, f = d.plus(l.times(o = f)), d = o, a = r.minus(l.times(o = a)), r = o;
1704
- return o = n(t.minus(s), u, 0, 1), d = d.plus(o.times(f)), s = s.plus(o.times(u)), d.s = f.s = D.s, c = c * 2, h = n(f, u, c, E).minus(D).abs().comparedTo(
1705
- n(d, s, c, E).minus(D).abs()
1704
+ return o = n(t.minus(s), u, 0, 1), d = d.plus(o.times(f)), s = s.plus(o.times(u)), d.s = f.s = D.s, p = p * 2, h = n(f, u, p, E).minus(D).abs().comparedTo(
1705
+ n(d, s, p, E).minus(D).abs()
1706
1706
  ) < 1 ? [f, u] : [d, s], C = m, h;
1707
- }, p.toNumber = function() {
1707
+ }, c.toNumber = function() {
1708
1708
  return +ie(this);
1709
- }, p.toPrecision = function(t, a) {
1709
+ }, c.toPrecision = function(t, a) {
1710
1710
  return t != null && I(t, 1, V), we(this, t, a, 2);
1711
- }, p.toString = function(t) {
1711
+ }, c.toString = function(t) {
1712
1712
  var a, s = this, u = s.s, o = s.e;
1713
1713
  return o === null ? u ? (a = "Infinity", u < 0 && (a = "-" + a)) : a = "NaN" : (t == null ? a = o <= w || o >= T ? ge(Y(s.c), o) : oe(Y(s.c), o, "0") : t === 10 && fe ? (s = X(new b(s), g + o + 1, E), a = oe(Y(s.c), s.e, "0")) : (I(t, 2, re.length, "Base"), a = i(oe(Y(s.c), o, "0"), 10, t, u, !0)), u < 0 && s.c[0] && (a = "-" + a)), a;
1714
- }, p.valueOf = p.toJSON = function() {
1714
+ }, c.valueOf = c.toJSON = function() {
1715
1715
  return ie(this);
1716
- }, p._isBigNumber = !0, p[Symbol.toStringTag] = "BigNumber", p[Symbol.for("nodejs.util.inspect.custom")] = p.valueOf, e != null && b.set(e), b;
1716
+ }, c._isBigNumber = !0, c[Symbol.toStringTag] = "BigNumber", c[Symbol.for("nodejs.util.inspect.custom")] = c.valueOf, e != null && b.set(e), b;
1717
1717
  }
1718
1718
  function ee(e) {
1719
1719
  var n = e | 0;
1720
1720
  return e > 0 || e === n ? n : n - 1;
1721
1721
  }
1722
1722
  function Y(e) {
1723
- for (var n, i, y = 1, p = e.length, A = e[0] + ""; y < p; ) {
1723
+ for (var n, i, y = 1, c = e.length, A = e[0] + ""; y < c; ) {
1724
1724
  for (n = e[y++] + "", i = S - n.length; i--; n = "0" + n) ;
1725
1725
  A += n;
1726
1726
  }
1727
- for (p = A.length; A.charCodeAt(--p) === 48; ) ;
1728
- return A.slice(0, p + 1 || 1);
1727
+ for (c = A.length; A.charCodeAt(--c) === 48; ) ;
1728
+ return A.slice(0, c + 1 || 1);
1729
1729
  }
1730
1730
  function le(e, n) {
1731
- var i, y, p = e.c, A = n.c, g = e.s, E = n.s, w = e.e, T = n.e;
1731
+ var i, y, c = e.c, A = n.c, g = e.s, E = n.s, w = e.e, T = n.e;
1732
1732
  if (!g || !E) return null;
1733
- if (i = p && !p[0], y = A && !A[0], i || y) return i ? y ? 0 : -E : g;
1733
+ if (i = c && !c[0], y = A && !A[0], i || y) return i ? y ? 0 : -E : g;
1734
1734
  if (g != E) return g;
1735
- if (i = g < 0, y = w == T, !p || !A) return y ? 0 : !p ^ i ? 1 : -1;
1735
+ if (i = g < 0, y = w == T, !c || !A) return y ? 0 : !c ^ i ? 1 : -1;
1736
1736
  if (!y) return w > T ^ i ? 1 : -1;
1737
- for (E = (w = p.length) < (T = A.length) ? w : T, g = 0; g < E; g++) if (p[g] != A[g]) return p[g] > A[g] ^ i ? 1 : -1;
1737
+ for (E = (w = c.length) < (T = A.length) ? w : T, g = 0; g < E; g++) if (c[g] != A[g]) return c[g] > A[g] ^ i ? 1 : -1;
1738
1738
  return w == T ? 0 : w > T ^ i ? 1 : -1;
1739
1739
  }
1740
1740
  function I(e, n, i, y) {
@@ -1749,13 +1749,13 @@ function ge(e, n) {
1749
1749
  return (e.length > 1 ? e.charAt(0) + "." + e.slice(1) : e) + (n < 0 ? "e" : "e+") + n;
1750
1750
  }
1751
1751
  function oe(e, n, i) {
1752
- var y, p;
1752
+ var y, c;
1753
1753
  if (n < 0) {
1754
- for (p = i + "."; ++n; p += i) ;
1755
- e = p + e;
1754
+ for (c = i + "."; ++n; c += i) ;
1755
+ e = c + e;
1756
1756
  } else if (y = e.length, ++n > y) {
1757
- for (p = i, n -= y; --n; p += i) ;
1758
- e += p;
1757
+ for (c = i, n -= y; --n; c += i) ;
1758
+ e += c;
1759
1759
  } else n < y && (e = e.slice(0, n) + "." + e.slice(n));
1760
1760
  return e;
1761
1761
  }
@@ -1776,9 +1776,9 @@ function Ee(e, n) {
1776
1776
  }
1777
1777
  function Ht(e, n, i) {
1778
1778
  if (typeof e != "string") return Ve(e);
1779
- const y = ".", p = e.replace(new RegExp(`[^${y}\\d-]+`, "g"), "");
1779
+ const y = ".", c = e.replace(new RegExp(`[^${y}\\d-]+`, "g"), "");
1780
1780
  return Ve(
1781
- p
1781
+ c
1782
1782
  );
1783
1783
  }
1784
1784
  const Nn = (e) => !!Yt.find((n) => Ee(n, e || ""));
@@ -1794,19 +1794,19 @@ function Kt(e) {
1794
1794
  }
1795
1795
  const pe = (e) => e ? e.value * e.unit : 0, qt = (e) => !e || e === "NaN" ? "0" : x(e).decimalPlaces(0).toFixed(), Mn = (e) => Object.values(H).find((n) => n.id === e), Gt = (e) => {
1796
1796
  if (!e) return;
1797
- const n = e.map((A) => K(A)), i = Object.entries(Zt).filter(([A]) => n.includes(A)).flatMap(([, A]) => A), y = e.map((A) => A.exchangeAddress), p = new Set(
1797
+ const n = e.map((A) => K(A)), i = Object.entries(Zt).filter(([A]) => n.includes(A)).flatMap(([, A]) => A), y = e.map((A) => A.exchangeAddress), c = new Set(
1798
1798
  [...y, ...i].map((A) => A.toLowerCase())
1799
1799
  );
1800
- return Array.from(p);
1800
+ return Array.from(c);
1801
1801
  }, Un = (e, n) => e.version === 1 ? (e.fillDelay || 0) * 1e3 + Je(n) : (e.fillDelay || 0) * 1e3, Xe = (e) => typeof window > "u" ? null : new URLSearchParams(window.location.search).get(e), Ln = (e) => rn().filter((n) => n.name === e).map((n) => n.chainId), Vn = (e, n, i) => {
1802
1802
  if (!x(e.srcAmountFilled || 0).gt(0) || !x(e.dstAmountFilled || 0).gt(0))
1803
1803
  return "";
1804
- const y = xe(n, e.srcAmountFilled), p = xe(i, e.dstAmountFilled);
1805
- return x(p).div(y).toFixed();
1804
+ const y = xe(n, e.srcAmountFilled), c = xe(i, e.dstAmountFilled);
1805
+ return x(c).div(y).toFixed();
1806
1806
  }, Wn = (e, n, i) => {
1807
1807
  if (e.type === G.TWAP_MARKET) return "";
1808
- const y = xe(n, e.srcAmountPerTrade), p = xe(i, e.dstMinAmountPerTrade);
1809
- return x(p).div(y).toFixed();
1808
+ const y = xe(n, e.srcAmountPerTrade), c = xe(i, e.dstMinAmountPerTrade);
1809
+ return x(c).div(y).toFixed();
1810
1810
  }, We = "https://order-sink-dev.orbs.network", Be = "https://order-sink.orbs.network";
1811
1811
  let Pe;
1812
1812
  const zn = (e) => {
@@ -2042,7 +2042,7 @@ var Oe, Ke;
2042
2042
  function an() {
2043
2043
  if (Ke) return Oe;
2044
2044
  Ke = 1;
2045
- const e = nn, n = (p) => tn(`./out/${p}.sol/${p}.json`).abi, i = () => ({
2045
+ const e = nn, n = (c) => tn(`./out/${c}.sol/${c}.json`).abi, i = () => ({
2046
2046
  wm: n("WM"),
2047
2047
  repermit: n("RePermit"),
2048
2048
  reactor: n("OrderReactor"),
@@ -2050,9 +2050,9 @@ function an() {
2050
2050
  refinery: n("Refinery"),
2051
2051
  adapter: n("DefaultDexAdapter")
2052
2052
  });
2053
- function y(p, A) {
2054
- if (!p || !(A != null && A.trim())) return;
2055
- const { dex: g, ...E } = e["*"] ?? {}, w = e[p];
2053
+ function y(c, A) {
2054
+ if (!c || !(A != null && A.trim())) return;
2055
+ const { dex: g, ...E } = e["*"] ?? {}, w = e[c];
2056
2056
  if (!w) return;
2057
2057
  const { dex: T, ...B } = w, C = T == null ? void 0 : T[A];
2058
2058
  if (C)
@@ -2063,22 +2063,22 @@ function an() {
2063
2063
  var Ze = an();
2064
2064
  const ra = (e, n, i) => {
2065
2065
  if (!e || !n || !i) return;
2066
- const y = x(e).times(n), p = x(10).pow(i);
2067
- return y.div(p).toFixed(0);
2066
+ const y = x(e).times(n), c = x(10).pow(i);
2067
+ return y.div(c).toFixed(0);
2068
2068
  }, ia = (e, n, i, y) => {
2069
2069
  if (i || !y || !e || !n)
2070
2070
  return x(0).toString();
2071
- const p = x(e).times(x(n)), A = x(10).pow(y), g = p.div(A);
2071
+ const c = x(e).times(x(n)), A = x(10).pow(y), g = c.div(A);
2072
2072
  return x.max(1, g).integerValue(x.ROUND_FLOOR).toFixed(0);
2073
2073
  }, oa = (e, n, i, y) => {
2074
2074
  if (e === j.TWAP || e === j.LIMIT)
2075
2075
  return "0";
2076
2076
  if (!y || !n || !i) return;
2077
- const p = x(n).times(x(i)), A = x(10).pow(y), g = p.div(A);
2077
+ const c = x(n).times(x(i)), A = x(10).pow(y), g = c.div(A);
2078
2078
  return x.max(1, g).integerValue(x.ROUND_FLOOR).toFixed(0) || "0";
2079
2079
  }, da = (e, n, i, y) => {
2080
- const p = pe(i) * 2 * n, A = Kt(p);
2081
- return y || (e === j.LIMIT ? { unit: ne.Days, value: 7 } : e === j.STOP_LOSS || e === j.TAKE_PROFIT ? { unit: ne.Days, value: 1 } : { unit: A, value: Number(x(p / A).toFixed(2)) });
2080
+ const c = pe(i) * 2 * n, A = Kt(c);
2081
+ return y || (e === j.LIMIT ? { unit: ne.Days, value: 7 } : e === j.STOP_LOSS || e === j.TAKE_PROFIT ? { unit: ne.Days, value: 1 } : { unit: A, value: Number(x(c / A).toFixed(2)) });
2082
2082
  }, ca = (e, n, i) => n !== j.TWAP ? 1 : i !== void 0 ? i : e, pa = (e, n, i, y) => {
2083
2083
  if (!n || !i || !y) return 1;
2084
2084
  const A = x(i).times(n).div(y).integerValue(x.ROUND_FLOOR).toNumber(), g = Math.floor(
@@ -2135,9 +2135,9 @@ const ra = (e, n, i) => {
2135
2135
  var g;
2136
2136
  const i = (g = Object.entries($).find(
2137
2137
  ([E, w]) => w.chainId === n && E.toLowerCase().indexOf(e.toLowerCase()) >= 0
2138
- )) == null ? void 0 : g[1], { abi: y, ...p } = Ze.config(n, e);
2138
+ )) == null ? void 0 : g[1], { abi: y, ...c } = Ze.config(n, e);
2139
2139
  return {
2140
- ...p,
2140
+ ...c,
2141
2141
  partner: e,
2142
2142
  twapConfig: i
2143
2143
  };
@@ -2145,10 +2145,10 @@ const ra = (e, n, i) => {
2145
2145
  const e = Ze.raw;
2146
2146
  return Object.entries(e).filter(([n]) => n !== "*").flatMap(([n, i]) => {
2147
2147
  const y = i == null ? void 0 : i.dex;
2148
- return !y || typeof y != "object" ? [] : Object.entries(y).map(([p]) => ({
2148
+ return !y || typeof y != "object" ? [] : Object.entries(y).map(([c]) => ({
2149
2149
  chainId: Number(n),
2150
- name: p,
2151
- config: sn(p, Number(n))
2150
+ name: c,
2151
+ config: sn(c, Number(n))
2152
2152
  }));
2153
2153
  }).sort((n, i) => n.name.localeCompare(i.name));
2154
2154
  }, Fa = ({
@@ -2156,7 +2156,7 @@ const ra = (e, n, i) => {
2156
2156
  srcToken: n,
2157
2157
  dstToken: i,
2158
2158
  srcAmount: y,
2159
- deadlineMillis: p,
2159
+ deadlineMillis: c,
2160
2160
  fillDelayMillis: A,
2161
2161
  slippage: g,
2162
2162
  account: E,
@@ -2165,7 +2165,7 @@ const ra = (e, n, i) => {
2165
2165
  triggerAmountPerTrade: B,
2166
2166
  config: C
2167
2167
  }) => {
2168
- const k = Date.now().toString(), P = parseInt((A / 1e3).toFixed(0)), R = qt(p / 1e3), ue = Xe(Ye.FRESHNESS), re = ue ? parseInt(ue) : 60, fe = {
2168
+ const k = Date.now().toString(), P = parseInt((A / 1e3).toFixed(0)), R = qt(c / 1e3), ue = Xe(Ye.FRESHNESS), re = ue ? parseInt(ue) : 60, fe = {
2169
2169
  permitted: {
2170
2170
  token: n,
2171
2171
  amount: y
@@ -2214,7 +2214,7 @@ const ra = (e, n, i) => {
2214
2214
  types: en,
2215
2215
  primaryType: Jt
2216
2216
  };
2217
- }, on = "0.0.21", dn = {
2217
+ }, on = "0.0.23", dn = {
2218
2218
  version: on
2219
2219
  }, cn = 0.7, pn = `https://bi.orbs.network/putes/twap-ui-${cn}`, et = dn.version;
2220
2220
  let Ie = "unknown";
@@ -2226,7 +2226,7 @@ function ve() {
2226
2226
  return `id_${e + n + i}`;
2227
2227
  }
2228
2228
  const ln = (e, n, i) => {
2229
- var y, p, A, g, E, w, T, B, C;
2229
+ var y, c, A, g, E, w, T, B, C;
2230
2230
  return {
2231
2231
  spotVersion: et,
2232
2232
  partner: e.partner,
@@ -2242,7 +2242,7 @@ const ln = (e, n, i) => {
2242
2242
  wm: e.wm,
2243
2243
  chainName: ((y = e.twapConfig) == null ? void 0 : y.chainName) || "",
2244
2244
  chainId: i || 0,
2245
- twapVersion: ((p = e.twapConfig) == null ? void 0 : p.twapVersion) || 0,
2245
+ twapVersion: ((c = e.twapConfig) == null ? void 0 : c.twapVersion) || 0,
2246
2246
  twapAddress: ((A = e.twapConfig) == null ? void 0 : A.twapAddress) || "",
2247
2247
  lensAddress: ((g = e.twapConfig) == null ? void 0 : g.lensAddress) || "",
2248
2248
  bidDelaySeconds: ((E = e.twapConfig) == null ? void 0 : E.bidDelaySeconds) || 0,
@@ -2282,8 +2282,8 @@ class un {
2282
2282
  }, i ? (await qe(this.data), y == null || y()) : (clearTimeout(this.timeout), this.timeout = setTimeout(() => {
2283
2283
  qe(this.data), y == null || y();
2284
2284
  }, 1e3));
2285
- } catch (p) {
2286
- console.error("Failed to update and send BI", p);
2285
+ } catch (c) {
2286
+ console.error("Failed to update and send BI", c);
2287
2287
  }
2288
2288
  }
2289
2289
  onCancelOrderRequest(n, i) {
@@ -2344,7 +2344,7 @@ class un {
2344
2344
  account: n,
2345
2345
  chainId: i,
2346
2346
  module: y,
2347
- srcToken: p,
2347
+ srcToken: c,
2348
2348
  dstToken: A,
2349
2349
  fromTokenAmount: g,
2350
2350
  srcChunkAmount: E,
@@ -2359,8 +2359,8 @@ class un {
2359
2359
  this.updateAndSend({
2360
2360
  toTokenAddress: A.address,
2361
2361
  toTokenSymbol: A.symbol,
2362
- fromTokenAddress: p.address,
2363
- fromTokenSymbol: p.symbol,
2362
+ fromTokenAddress: c.address,
2363
+ fromTokenSymbol: c.symbol,
2364
2364
  fromTokenAmount: g,
2365
2365
  chunksAmount: R,
2366
2366
  srcChunkAmount: E,
@@ -2392,8 +2392,8 @@ class un {
2392
2392
  });
2393
2393
  }
2394
2394
  init(n, i, y) {
2395
- var p;
2396
- this.config = n, y !== ((p = this.data) == null ? void 0 : p.chainId) && (this.data = {
2395
+ var c;
2396
+ this.config = n, y !== ((c = this.data) == null ? void 0 : c.chainId) && (this.data = {
2397
2397
  _id: ve(),
2398
2398
  action: "module-import",
2399
2399
  uiVersion: Ie,
@@ -2457,12 +2457,12 @@ class un {
2457
2457
  }
2458
2458
  }
2459
2459
  const _e = new un(), fn = (e) => {
2460
- var p;
2461
- const n = x(e.order.witness.output.limit || 0).gt(1), i = x(e.order.witness.output.stop || 0).gt(0), y = ((p = e.metadata.chunks) == null ? void 0 : p.length) || x(e.order.witness.input.maxAmount).div(x(e.order.witness.input.amount)).toNumber();
2460
+ var c;
2461
+ const n = x(e.order.witness.output.limit || 0).gt(1), i = x(e.order.witness.output.stop || 0).gt(0), y = ((c = e.metadata.chunks) == null ? void 0 : c.length) || x(e.order.witness.input.maxAmount).div(x(e.order.witness.input.amount)).toNumber();
2462
2462
  return i && n ? G.TRIGGER_PRICE_LIMIT : i ? G.TRIGGER_PRICE_MARKET : !n && y <= 1 ? G.TWAP_MARKET : y >= 1 && n ? G.TWAP_LIMIT : n ? G.LIMIT : G.TWAP_MARKET;
2463
2463
  }, mn = (e) => {
2464
- var p;
2465
- const n = ((p = e.metadata.chunks) == null ? void 0 : p.filter((A) => A.status === "success").length) || 0, i = e.metadata.expectedChunks || 0, y = x(n).dividedBy(i).toNumber();
2464
+ var c;
2465
+ const n = ((c = e.metadata.chunks) == null ? void 0 : c.filter((A) => A.status === "success").length) || 0, i = e.metadata.expectedChunks || 0, y = x(n).dividedBy(i).toNumber();
2466
2466
  return y >= 0.99 ? 100 : y <= 0 ? 0 : Number((y * 100).toFixed(2));
2467
2467
  }, yn = (e, n) => e.metadata.status === "completed" || n >= 99 ? se.Completed : ["pending", "eligible"].includes(e.metadata.status) ? se.Open : e.metadata.description.toLowerCase() === "cancelled by contract" ? se.Canceled : se.Expired, hn = (e) => {
2468
2468
  var i;
@@ -2477,7 +2477,7 @@ const _e = new un(), fn = (e) => {
2477
2477
  const i = e.length;
2478
2478
  return i >= n && ((y = e[i - 1]) == null ? void 0 : y.timestamp) || 0;
2479
2479
  }, bn = (e) => x(e.metadata.displayOnlyInputTokenPriceUSD).dividedBy(1e18).toFixed(), tt = (e) => {
2480
- const n = mn(e), i = Number(e.order.witness.output.limit) === 1 ? "" : e.order.witness.output.limit, y = e.metadata.expectedChunks || 1, p = hn(e);
2480
+ const n = mn(e), i = Number(e.order.witness.output.limit) === 1 ? "" : e.order.witness.output.limit, y = e.metadata.expectedChunks || 1, c = hn(e);
2481
2481
  return {
2482
2482
  id: e.hash,
2483
2483
  hash: e.hash,
@@ -2485,9 +2485,9 @@ const _e = new un(), fn = (e) => {
2485
2485
  type: fn(e),
2486
2486
  maker: e.order.witness.swapper,
2487
2487
  progress: n,
2488
- srcAmountFilled: p.reduce((A, g) => A.plus(g.inAmount), new x(0)).toFixed() || "",
2489
- dstAmountFilled: p.reduce((A, g) => A.plus(g.outAmount), new x(0)).toFixed() || "",
2490
- fills: p,
2488
+ srcAmountFilled: c.reduce((A, g) => A.plus(g.inAmount), new x(0)).toFixed() || "",
2489
+ dstAmountFilled: c.reduce((A, g) => A.plus(g.outAmount), new x(0)).toFixed() || "",
2490
+ fills: c,
2491
2491
  srcTokenAddress: e.order.witness.input.token,
2492
2492
  dstTokenAddress: e.order.witness.output.token,
2493
2493
  orderDollarValueIn: bn(e),
@@ -2502,7 +2502,7 @@ const _e = new un(), fn = (e) => {
2502
2502
  totalTradesAmount: y,
2503
2503
  isMarketPrice: x(i || 0).lte(1),
2504
2504
  chainId: e.order.witness.chainid,
2505
- filledOrderTimestamp: An(p, y),
2505
+ filledOrderTimestamp: An(c, y),
2506
2506
  status: yn(e, n),
2507
2507
  rawOrder: e
2508
2508
  };
@@ -2512,14 +2512,18 @@ const _e = new un(), fn = (e) => {
2512
2512
  account: i,
2513
2513
  exchange: y
2514
2514
  }) => {
2515
- if (!i) return [];
2516
- const p = y ? `&exchange=${y}` : "";
2517
- return (await (await fetch(
2518
- `${Qe()}/orders?swapper=${i}&chainId=${e}${p}`,
2519
- {
2520
- signal: n
2521
- }
2522
- )).json()).orders.map(tt);
2515
+ try {
2516
+ if (!i) return [];
2517
+ const c = y ? `&exchange=${y}` : "";
2518
+ return (await (await fetch(
2519
+ `${Qe()}/orders?swapper=${i}&chainId=${e}${c}`,
2520
+ {
2521
+ signal: n
2522
+ }
2523
+ )).json()).orders.map(tt);
2524
+ } catch {
2525
+ return [];
2526
+ }
2523
2527
  }, Da = async (e, n) => {
2524
2528
  try {
2525
2529
  const i = {
@@ -2528,13 +2532,13 @@ const _e = new un(), fn = (e) => {
2528
2532
  status: "pending"
2529
2533
  };
2530
2534
  console.log("body", i), _e.onCreateOrderRequest();
2531
- const p = await (await fetch(`${Qe()}/orders/new`, {
2535
+ const c = await (await fetch(`${Qe()}/orders/new`, {
2532
2536
  method: "POST",
2533
2537
  body: JSON.stringify(i)
2534
2538
  })).json();
2535
- if (!p.success)
2536
- throw new Error(`error:${p.message}, code:${p.code}`);
2537
- const A = tt(p.signedOrder);
2539
+ if (!c.success)
2540
+ throw new Error(`error:${c.message}, code:${c.code}`);
2541
+ const A = tt(c.signedOrder);
2538
2542
  return _e.onCreateOrderSuccess(A.id), A;
2539
2543
  } catch (i) {
2540
2544
  throw _e.onCreateOrderError(i), console.error(i), i;
@@ -2547,7 +2551,7 @@ const _e = new un(), fn = (e) => {
2547
2551
  buildQuery: n,
2548
2552
  extractResults: i,
2549
2553
  signal: y,
2550
- retries: p = 1,
2554
+ retries: c = 1,
2551
2555
  limit: A = 1e3,
2552
2556
  page: g
2553
2557
  }) => {
@@ -2555,7 +2559,7 @@ const _e = new un(), fn = (e) => {
2555
2559
  if (!E) throw new Dn();
2556
2560
  const w = async (C) => {
2557
2561
  let k = 0;
2558
- for (; k <= p; )
2562
+ for (; k <= c; )
2559
2563
  try {
2560
2564
  const P = await fetch(E, {
2561
2565
  method: "POST",
@@ -2569,7 +2573,7 @@ const _e = new un(), fn = (e) => {
2569
2573
  throw new Error(R.errors[0].message);
2570
2574
  return i(R);
2571
2575
  } catch (P) {
2572
- if (k === p) throw P;
2576
+ if (k === c) throw P;
2573
2577
  await new Promise((R) => setTimeout(R, 500 * 2 ** k)), k++;
2574
2578
  }
2575
2579
  return [];
@@ -2616,7 +2620,7 @@ const _e = new un(), fn = (e) => {
2616
2620
  return !i && n === 1 ? G.TWAP_MARKET : n > 1 && i ? G.TWAP_LIMIT : i ? G.LIMIT : G.TWAP_MARKET;
2617
2621
  }, En = (e, n, i, y) => {
2618
2622
  var k;
2619
- const p = nt(i || []), A = new x(e.ask_srcAmount || 0).div(e.ask_srcBidAmount).integerValue(x.ROUND_FLOOR).toNumber(), E = (i == null ? void 0 : i.length) === A ? (k = i == null ? void 0 : i[(i == null ? void 0 : i.length) - 1]) == null ? void 0 : k.timestamp : void 0, w = p.reduce((P, R) => P.plus(R.inAmount), new x(0)).toFixed(), T = p.reduce((P, R) => P.plus(R.outAmount), new x(0)).toFixed(), B = at(e.ask_srcAmount, w), C = Ge(e.ask_dstMinAmount, A);
2623
+ const c = nt(i || []), A = new x(e.ask_srcAmount || 0).div(e.ask_srcBidAmount).integerValue(x.ROUND_FLOOR).toNumber(), E = (i == null ? void 0 : i.length) === A ? (k = i == null ? void 0 : i[(i == null ? void 0 : i.length) - 1]) == null ? void 0 : k.timestamp : void 0, w = c.reduce((P, R) => P.plus(R.inAmount), new x(0)).toFixed(), T = c.reduce((P, R) => P.plus(R.outAmount), new x(0)).toFixed(), B = at(e.ask_srcAmount, w), C = Ge(e.ask_dstMinAmount, A);
2620
2624
  return {
2621
2625
  version: 1,
2622
2626
  id: e.Contract_id.toString(),
@@ -2633,7 +2637,7 @@ const _e = new un(), fn = (e) => {
2633
2637
  orderDollarValueIn: x(e.dollarValueIn || 0).toFixed(6),
2634
2638
  srcAmount: e.ask_srcAmount,
2635
2639
  dstMinAmountTotal: x(e.ask_dstMinAmount).multipliedBy(A).toString(),
2636
- fills: p,
2640
+ fills: c,
2637
2641
  fillDelay: e.ask_fillDelay,
2638
2642
  deadline: e.ask_deadline * 1e3,
2639
2643
  createdAt: new Date(e.timestamp).getTime(),
@@ -2660,7 +2664,7 @@ const _e = new un(), fn = (e) => {
2660
2664
  ), y = de(
2661
2665
  e.inTokenSymbols,
2662
2666
  (k) => `"${k.toUpperCase()}"`
2663
- ), p = de(
2667
+ ), c = de(
2664
2668
  e.outTokenSymbols,
2665
2669
  (k) => `"${k.toUpperCase()}"`
2666
2670
  ), A = de(
@@ -2684,7 +2688,7 @@ const _e = new un(), fn = (e) => {
2684
2688
  w ? `Contract_id_in: [${w.join(", ")}]` : "",
2685
2689
  B ? `dollarValueIn_gte: ${B}` : "",
2686
2690
  y ? `srcTokenSymbol_in: [${y.join(", ")}]` : "",
2687
- p ? `dstTokenSymbol_in: [${p.join(", ")}]` : "",
2691
+ c ? `dstTokenSymbol_in: [${c.join(", ")}]` : "",
2688
2692
  A ? `srcTokenAddress_in: [${A.join(", ")}]` : "",
2689
2693
  g ? `dstTokenAddress_in: [${g.join(", ")}]` : "",
2690
2694
  e != null && e.startDate ? `blockTimestamp_gte: ${e.startDate}` : "",
@@ -2698,9 +2702,9 @@ async function Tn({
2698
2702
  signal: n,
2699
2703
  page: i,
2700
2704
  limit: y,
2701
- filters: p
2705
+ filters: c
2702
2706
  }) {
2703
- const A = y || 1e3, g = wn(p);
2707
+ const A = y || 1e3, g = wn(c);
2704
2708
  return await Me({
2705
2709
  chainId: e,
2706
2710
  signal: n,
@@ -2787,9 +2791,9 @@ const Cn = async ({
2787
2791
  orders: n,
2788
2792
  signal: i
2789
2793
  }) => {
2790
- const y = Ne(n.map((C) => C.Contract_id)), p = Ne(n.map((C) => C.twapAddress)).filter(Boolean);
2794
+ const y = Ne(n.map((C) => C.Contract_id)), c = Ne(n.map((C) => C.twapAddress)).filter(Boolean);
2791
2795
  if (y.length === 0) return [];
2792
- const A = y.join(", "), g = p.map((C) => `"${C}"`).join(", "), E = p.length ? `twapAddress_in: [${g}]` : "", T = `where: { ${[
2796
+ const A = y.join(", "), g = c.map((C) => `"${C}"`).join(", "), E = c.length ? `twapAddress_in: [${g}]` : "", T = `where: { ${[
2793
2797
  `TWAP_id_in: [${A}]`,
2794
2798
  E
2795
2799
  ].filter(Boolean).join(", ")} }`;
@@ -2834,29 +2838,33 @@ const kn = async ({
2834
2838
  signal: n,
2835
2839
  page: i,
2836
2840
  limit: y,
2837
- filters: p
2841
+ filters: c
2838
2842
  }) => {
2839
- const A = await Tn({
2840
- chainId: e,
2841
- signal: n,
2842
- page: i,
2843
- limit: y,
2844
- filters: p
2845
- }), [g, E] = await Promise.all([
2846
- Cn({ chainId: e, orders: A, signal: n }),
2847
- Fn({ chainId: e, orders: A, signal: n })
2848
- ]);
2849
- return A.map((T) => {
2850
- const B = g == null ? void 0 : g.filter(
2851
- (C) => C.TWAP_id === Number(T.Contract_id) && Ee(C.exchange, T.exchange) && Ee(C.twapAddress, T.twapAddress)
2852
- );
2853
- return En(
2854
- T,
2855
- e,
2856
- B,
2857
- Sn(T, B || [], E)
2858
- );
2859
- }).sort((T, B) => B.createdAt - T.createdAt);
2843
+ try {
2844
+ const A = await Tn({
2845
+ chainId: e,
2846
+ signal: n,
2847
+ page: i,
2848
+ limit: y,
2849
+ filters: c
2850
+ }), [g, E] = await Promise.all([
2851
+ Cn({ chainId: e, orders: A, signal: n }),
2852
+ Fn({ chainId: e, orders: A, signal: n })
2853
+ ]);
2854
+ return A.map((T) => {
2855
+ const B = g == null ? void 0 : g.filter(
2856
+ (C) => C.TWAP_id === Number(T.Contract_id) && Ee(C.exchange, T.exchange) && Ee(C.twapAddress, T.twapAddress)
2857
+ );
2858
+ return En(
2859
+ T,
2860
+ e,
2861
+ B,
2862
+ Sn(T, B || [], E)
2863
+ );
2864
+ }).sort((T, B) => B.createdAt - T.createdAt);
2865
+ } catch {
2866
+ return [];
2867
+ }
2860
2868
  }, Sn = (e, n, i) => {
2861
2869
  var E;
2862
2870
  const y = (E = i == null ? void 0 : i.find(
@@ -2872,11 +2880,11 @@ const kn = async ({
2872
2880
  page: n,
2873
2881
  chainId: i,
2874
2882
  limit: y,
2875
- config: p,
2883
+ config: c,
2876
2884
  account: A
2877
2885
  }) => (await Promise.all([
2878
- p ? kn({ chainId: i, signal: e, page: n, limit: y, filters: { accounts: [A], configs: p.twapConfig ? [p.twapConfig] : [] } }) : Promise.resolve([]),
2879
- gn({ chainId: i, signal: e, account: A, exchange: p == null ? void 0 : p.adapter })
2886
+ c ? kn({ chainId: i, signal: e, page: n, limit: y, filters: { accounts: [A], configs: c.twapConfig ? [c.twapConfig] : [] } }) : Promise.resolve([]),
2887
+ gn({ chainId: i, signal: e, account: A, exchange: c == null ? void 0 : c.adapter })
2880
2888
  ]).then(([w, T]) => [...w, ...T])).sort((w, T) => T.createdAt - w.createdAt);
2881
2889
  export {
2882
2890
  sa as CRASH_ERROR_MESSAGE,