@orbs-network/spot-ui 0.0.17 → 0.0.18

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 Wt = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, Fe = Math.ceil, J = Math.floor, q = "[BigNumber Error] ", Ue = q + "Number primitive has more than 15 significant digits: ", te = 1e14, S = 14, De = 9007199254740991, ke = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], ce = 1e7, V = 1e9;
1146
1146
  function Ge(e) {
1147
- var n, o, y, l = b.prototype = { constructor: b, toString: null, valueOf: null }, A = new b(1), g = 20, x = 4, w = -7, T = 21, B = -1e7, F = 1e7, k = !1, R = 1, P = 0, ue = {
1147
+ var n, o, y, p = b.prototype = { constructor: b, toString: null, valueOf: null }, A = new b(1), g = 20, x = 4, w = -7, T = 21, B = -1e7, F = 1e7, k = !1, R = 1, P = 0, ue = {
1148
1148
  prefix: "",
1149
1149
  groupSize: 3,
1150
1150
  secondaryGroupSize: 0,
@@ -1156,34 +1156,34 @@ function Ge(e) {
1156
1156
  suffix: ""
1157
1157
  }, re = "0123456789abcdefghijklmnopqrstuvwxyz", fe = !0;
1158
1158
  function b(t, a) {
1159
- var s, u, i, c, m, r, d, f, p = this;
1160
- if (!(p instanceof b)) return new b(t, a);
1159
+ var s, u, i, c, m, r, d, f, l = this;
1160
+ if (!(l instanceof b)) return new b(t, a);
1161
1161
  if (a == null) {
1162
1162
  if (t && t._isBigNumber === !0) {
1163
- p.s = t.s, !t.c || t.e > F ? p.c = p.e = null : t.e < B ? p.c = [p.e = 0] : (p.e = t.e, p.c = t.c.slice());
1163
+ l.s = t.s, !t.c || t.e > F ? l.c = l.e = null : t.e < B ? l.c = [l.e = 0] : (l.e = t.e, l.c = t.c.slice());
1164
1164
  return;
1165
1165
  }
1166
1166
  if ((r = typeof t == "number") && t * 0 == 0) {
1167
- if (p.s = 1 / t < 0 ? (t = -t, -1) : 1, t === ~~t) {
1167
+ if (l.s = 1 / t < 0 ? (t = -t, -1) : 1, t === ~~t) {
1168
1168
  for (c = 0, m = t; m >= 10; m /= 10, c++) ;
1169
- c > F ? p.c = p.e = null : (p.e = c, p.c = [t]);
1169
+ c > F ? l.c = l.e = null : (l.e = c, l.c = [t]);
1170
1170
  return;
1171
1171
  }
1172
1172
  f = String(t);
1173
1173
  } else {
1174
- if (!Wt.test(f = String(t))) return y(p, f, r);
1175
- p.s = f.charCodeAt(0) == 45 ? (f = f.slice(1), -1) : 1;
1174
+ if (!Wt.test(f = String(t))) return y(l, f, r);
1175
+ l.s = f.charCodeAt(0) == 45 ? (f = f.slice(1), -1) : 1;
1176
1176
  }
1177
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);
1178
1178
  } else {
1179
1179
  if (I(a, 2, re.length, "Base"), a == 10 && fe)
1180
- return p = new b(t), X(p, g + p.e + 1, x);
1180
+ return l = new b(t), X(l, g + l.e + 1, x);
1181
1181
  if (f = String(t), r = typeof t == "number") {
1182
- if (t * 0 != 0) return y(p, f, r, a);
1183
- if (p.s = 1 / t < 0 ? (f = f.slice(1), -1) : 1, b.DEBUG && f.replace(/^0\.0*|\./, "").length > 15)
1182
+ if (t * 0 != 0) return y(l, f, r, a);
1183
+ if (l.s = 1 / t < 0 ? (f = f.slice(1), -1) : 1, b.DEBUG && f.replace(/^0\.0*|\./, "").length > 15)
1184
1184
  throw Error(Ue + t);
1185
1185
  } else
1186
- p.s = f.charCodeAt(0) === 45 ? (f = f.slice(1), -1) : 1;
1186
+ l.s = f.charCodeAt(0) === 45 ? (f = f.slice(1), -1) : 1;
1187
1187
  for (s = re.slice(0, a), c = m = 0, d = f.length; m < d; m++)
1188
1188
  if (s.indexOf(u = f.charAt(m)) < 0) {
1189
1189
  if (u == ".") {
@@ -1195,31 +1195,31 @@ function Ge(e) {
1195
1195
  i = !0, m = -1, c = 0;
1196
1196
  continue;
1197
1197
  }
1198
- return y(p, String(t), r, a);
1198
+ return y(l, String(t), r, a);
1199
1199
  }
1200
- r = !1, f = o(f, a, 10, p.s), (c = f.indexOf(".")) > -1 ? f = f.replace(".", "") : c = f.length;
1200
+ r = !1, f = o(f, a, 10, l.s), (c = f.indexOf(".")) > -1 ? f = f.replace(".", "") : c = 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 > De || t !== J(t)))
1206
- throw Error(Ue + p.s * t);
1206
+ throw Error(Ue + l.s * t);
1207
1207
  if ((c = c - m - 1) > F)
1208
- p.c = p.e = null;
1208
+ l.c = l.e = null;
1209
1209
  else if (c < B)
1210
- p.c = [p.e = 0];
1210
+ l.c = [l.e = 0];
1211
1211
  else {
1212
- if (p.e = c, p.c = [], m = (c + 1) % S, c < 0 && (m += S), m < d) {
1213
- for (m && p.c.push(+f.slice(0, m)), d -= S; m < d; )
1214
- p.c.push(+f.slice(m, m += S));
1212
+ if (l.e = c, l.c = [], m = (c + 1) % S, c < 0 && (m += S), m < d) {
1213
+ for (m && l.c.push(+f.slice(0, m)), d -= S; m < d; )
1214
+ l.c.push(+f.slice(m, m += S));
1215
1215
  m = S - (f = f.slice(m)).length;
1216
1216
  } else
1217
1217
  m -= d;
1218
1218
  for (; m--; f += "0") ;
1219
- p.c.push(+f);
1219
+ l.c.push(+f);
1220
1220
  }
1221
1221
  } else
1222
- p.c = [p.e = 0];
1222
+ l.c = [l.e = 0];
1223
1223
  }
1224
1224
  b.clone = Ge, b.ROUND_UP = 0, b.ROUND_DOWN = 1, b.ROUND_CEIL = 2, b.ROUND_FLOOR = 3, b.ROUND_HALF_UP = 4, b.ROUND_HALF_DOWN = 5, b.ROUND_HALF_EVEN = 6, b.ROUND_HALF_CEIL = 7, b.ROUND_HALF_FLOOR = 8, b.EUCLID = 9, b.config = b.set = function(t) {
1225
1225
  var a, s;
@@ -1294,7 +1294,7 @@ function Ge(e) {
1294
1294
  return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
1295
1295
  };
1296
1296
  return function(s) {
1297
- var u, i, c, m, r, d = 0, f = [], p = new b(A);
1297
+ var u, i, c, m, r, d = 0, f = [], l = new b(A);
1298
1298
  if (s == null ? s = g : I(s, 0, V), m = Fe(s / S), k)
1299
1299
  if (crypto.getRandomValues) {
1300
1300
  for (u = crypto.getRandomValues(new Uint32Array(m *= 2)); d < m; )
@@ -1317,7 +1317,7 @@ function Ge(e) {
1317
1317
  for (d = 1, r = f[0]; r >= 10; r /= 10, d++) ;
1318
1318
  d < S && (c -= S - d);
1319
1319
  }
1320
- return p.e = c, p.c = f, p;
1320
+ return l.e = c, 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++]);
@@ -1325,7 +1325,7 @@ function Ge(e) {
1325
1325
  }, o = /* @__PURE__ */ (function() {
1326
1326
  var t = "0123456789";
1327
1327
  function a(s, u, i, c) {
1328
- for (var m, r = [0], d, f = 0, p = s.length; f < p; ) {
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
1330
  for (r[0] += c.indexOf(s.charAt(f++)), m = 0; m < r.length; m++)
1331
1331
  r[m] > i - 1 && (r[m + 1] == null && (r[m + 1] = 0), r[m + 1] += r[m] / i | 0, r[m] %= i);
@@ -1333,32 +1333,32 @@ function Ge(e) {
1333
1333
  return r.reverse();
1334
1334
  }
1335
1335
  return function(s, u, i, c, m) {
1336
- var r, d, f, p, h, C, D, v, N = s.indexOf("."), L = g, O = x;
1337
- for (N >= 0 && (p = P, P = 0, s = s.replace(".", ""), v = new b(u), C = v.pow(s.length - N), P = p, v.c = a(
1336
+ var r, d, f, l, h, C, D, v, N = s.indexOf("."), L = g, O = x;
1337
+ for (N >= 0 && (l = P, P = 0, s = s.replace(".", ""), v = new b(u), C = v.pow(s.length - N), P = l, v.c = a(
1338
1338
  oe(Y(C.c), C.e, "0"),
1339
1339
  10,
1340
1340
  i,
1341
1341
  t
1342
- ), v.e = v.c.length), D = a(s, u, i, m ? (r = re, t) : (r = t, re)), f = p = D.length; D[--p] == 0; D.pop()) ;
1342
+ ), v.e = v.c.length), D = a(s, u, i, 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 : (C.c = D, C.e = f, C.s = c, C = n(C, v, L, O, i), D = C.c, h = C.r, f = C.e), d = f + L + 1, N = D[d], p = i / 2, h = h || d < 0 || D[d + 1] != null, h = O < 4 ? (N != null || h) && (O == 0 || O == (C.s < 0 ? 3 : 2)) : N > p || N == p && (O == 4 || h || O == 6 && D[d - 1] & 1 || O == (C.s < 0 ? 8 : 7)), d < 1 || !D[0])
1344
+ if (N < 0 ? --f : (C.c = D, C.e = f, C.s = c, C = n(C, v, L, O, i), D = C.c, h = C.r, f = C.e), d = f + L + 1, N = D[d], l = i / 2, h = h || d < 0 || D[d + 1] != null, h = O < 4 ? (N != null || h) && (O == 0 || O == (C.s < 0 ? 3 : 2)) : N > l || N == l && (O == 4 || h || O == 6 && D[d - 1] & 1 || O == (C.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)
1348
1348
  for (--i; ++D[--d] > i; )
1349
1349
  D[d] = 0, d || (++f, D = [1].concat(D));
1350
- for (p = D.length; !D[--p]; ) ;
1351
- for (N = 0, s = ""; N <= p; s += r.charAt(D[N++])) ;
1350
+ for (l = D.length; !D[--l]; ) ;
1351
+ for (N = 0, s = ""; N <= l; s += r.charAt(D[N++])) ;
1352
1352
  s = oe(s, f, r.charAt(0));
1353
1353
  }
1354
1354
  return s;
1355
1355
  };
1356
1356
  })(), n = /* @__PURE__ */ (function() {
1357
1357
  function t(u, i, c) {
1358
- var m, r, d, f, p = 0, h = u.length, C = i % ce, D = i / ce | 0;
1358
+ var m, r, d, f, l = 0, h = u.length, C = i % ce, D = i / ce | 0;
1359
1359
  for (u = u.slice(); h--; )
1360
- d = u[h] % ce, f = u[h] / ce | 0, m = D * d + f * C, r = C * d + m % ce * ce + p, p = (r / c | 0) + (m / ce | 0) + D * f, u[h] = r % c;
1361
- return p && (u = [p].concat(u)), u;
1360
+ d = u[h] % ce, f = u[h] / ce | 0, m = D * d + f * C, r = C * d + m % ce * ce + l, l = (r / c | 0) + (m / ce | 0) + D * f, u[h] = r % c;
1361
+ return l && (u = [l].concat(u)), u;
1362
1362
  }
1363
1363
  function a(u, i, c, m) {
1364
1364
  var r, d;
@@ -1378,7 +1378,7 @@ function Ge(e) {
1378
1378
  for (; !u[0] && u.length > 1; u.splice(0, 1)) ;
1379
1379
  }
1380
1380
  return function(u, i, c, m, r) {
1381
- var d, f, p, h, C, D, v, N, L, O, _, W, he, Te, Ce, ae, me, Q = u.s == i.s ? 1 : -1, z = u.c, M = i.c;
1381
+ var d, f, l, h, C, D, v, N, L, O, _, W, he, Te, Ce, ae, me, Q = u.s == i.s ? 1 : -1, z = u.c, M = i.c;
1382
1382
  if (!z || !z[0] || !M || !M[0])
1383
1383
  return new b(
1384
1384
  // Return NaN if either NaN, or both Infinity or 0.
@@ -1387,11 +1387,11 @@ function Ge(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 - i.e, Q = c + f + 1, r || (r = te, f = ee(u.e / S) - ee(i.e / S), Q = Q / S | 0), p = 0; M[p] == (z[p] || 0); p++) ;
1391
- if (M[p] > (z[p] || 0) && f--, Q < 0)
1390
+ for (N = new b(Q), L = N.c = [], f = u.e - i.e, Q = c + f + 1, r || (r = te, f = ee(u.e / S) - ee(i.e / S), Q = Q / S | 0), l = 0; M[l] == (z[l] || 0); l++) ;
1391
+ if (M[l] > (z[l] || 0) && f--, Q < 0)
1392
1392
  L.push(1), h = !0;
1393
1393
  else {
1394
- for (Te = z.length, ae = M.length, p = 0, Q += 2, C = J(r / (M[0] + 1)), C > 1 && (M = t(M, C, r), z = t(z, C, r), ae = M.length, Te = z.length), he = ae, O = z.slice(0, ae), _ = O.length; _ < ae; O[_++] = 0) ;
1394
+ for (Te = z.length, ae = M.length, l = 0, Q += 2, C = J(r / (M[0] + 1)), C > 1 && (M = t(M, C, r), z = t(z, C, r), ae = M.length, Te = z.length), he = ae, O = z.slice(0, ae), _ = O.length; _ < ae; O[_++] = 0) ;
1395
1395
  me = M.slice(), me = [0].concat(me), Ce = M[0], M[1] >= r / 2 && Ce++;
1396
1396
  do {
1397
1397
  if (C = 0, d = a(M, O, ae, _), d < 0) {
@@ -1404,13 +1404,13 @@ function Ge(e) {
1404
1404
  for (; a(M, O, ae, _) < 1; )
1405
1405
  C++, s(O, ae < _ ? me : M, _, r), _ = O.length;
1406
1406
  } else d === 0 && (C++, O = [0]);
1407
- L[p++] = C, O[0] ? O[_++] = z[he] || 0 : (O = [z[he]], _ = 1);
1407
+ L[l++] = C, O[0] ? O[_++] = z[he] || 0 : (O = [z[he]], _ = 1);
1408
1408
  } while ((he++ < Te || O[0] != null) && Q--);
1409
1409
  h = O[0] != null, L[0] || L.splice(0, 1);
1410
1410
  }
1411
1411
  if (r == te) {
1412
- for (p = 1, Q = L[0]; Q >= 10; Q /= 10, p++) ;
1413
- X(N, c + (N.e = p + f * S - 1) + 1, m, h);
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);
1414
1414
  } else
1415
1415
  N.e = f, N.r = +h;
1416
1416
  return N;
@@ -1443,14 +1443,14 @@ function Ge(e) {
1443
1443
  y = /* @__PURE__ */ (function() {
1444
1444
  var t = /^(-?)0([xbo])(?=\w[\w.]*$)/i, a = /^([^.]+)\.$/, s = /^\.([^.]+)$/, u = /^-?(Infinity|NaN)$/, i = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
1445
1445
  return function(c, m, r, d) {
1446
- var f, p = r ? m : m.replace(i, "");
1447
- if (u.test(p))
1448
- c.s = isNaN(p) ? null : p < 0 ? -1 : 1;
1446
+ var f, l = r ? m : m.replace(i, "");
1447
+ if (u.test(l))
1448
+ c.s = isNaN(l) ? null : l < 0 ? -1 : 1;
1449
1449
  else {
1450
- if (!r && (p = p.replace(t, function(h, C, D) {
1450
+ if (!r && (l = l.replace(t, function(h, C, D) {
1451
1451
  return f = (D = D.toLowerCase()) == "x" ? 16 : D == "b" ? 2 : 8, !d || d == f ? C : h;
1452
- }), d && (f = d, p = p.replace(a, "$1").replace(s, "0.$1")), m != p))
1453
- return new b(p, f);
1452
+ }), d && (f = d, l = l.replace(a, "$1").replace(s, "0.$1")), m != l))
1453
+ return new b(l, f);
1454
1454
  if (b.DEBUG)
1455
1455
  throw Error(q + "Not a" + (d ? " base " + d : "") + " number: " + m);
1456
1456
  c.s = null;
@@ -1459,26 +1459,26 @@ function Ge(e) {
1459
1459
  };
1460
1460
  })();
1461
1461
  function X(t, a, s, u) {
1462
- var i, c, m, r, d, f, p, h = t.c, C = ke;
1462
+ var i, c, m, r, d, f, l, h = t.c, C = ke;
1463
1463
  if (h) {
1464
1464
  e: {
1465
1465
  for (i = 1, r = h[0]; r >= 10; r /= 10, i++) ;
1466
1466
  if (c = a - i, c < 0)
1467
- c += S, m = a, d = h[f = 0], p = J(d / C[i - m - 1] % 10);
1467
+ c += S, m = a, d = h[f = 0], l = J(d / C[i - m - 1] % 10);
1468
1468
  else if (f = Fe((c + 1) / S), f >= h.length)
1469
1469
  if (u) {
1470
1470
  for (; h.length <= f; h.push(0)) ;
1471
- d = p = 0, i = 1, c %= S, m = c - S + 1;
1471
+ d = l = 0, i = 1, c %= S, m = c - S + 1;
1472
1472
  } else
1473
1473
  break e;
1474
1474
  else {
1475
1475
  for (d = r = h[f], i = 1; r >= 10; r /= 10, i++) ;
1476
- c %= S, m = c - S + i, p = m < 0 ? 0 : J(d / C[i - m - 1] % 10);
1476
+ c %= S, m = c - S + i, l = m < 0 ? 0 : J(d / C[i - 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
- h[f + 1] != null || (m < 0 ? d : d % C[i - m - 1]), u = s < 4 ? (p || u) && (s == 0 || s == (t.s < 0 ? 3 : 2)) : p > 5 || p == 5 && (s == 4 || u || s == 6 && // Check whether the digit to the left of the rounding digit is odd.
1481
+ h[f + 1] != null || (m < 0 ? d : d % C[i - 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
1482
  (c > 0 ? m > 0 ? d / C[i - 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] = C[(S - a % S) % S], t.e = -a || 0) : h[0] = t.e = 0, t;
1484
1484
  if (c == 0 ? (h.length = f, r = 1, f--) : (h.length = f + 1, r = C[S - c], h[f] = m > 0 ? J(d / C[i - m] % C[m]) * r : 0), u)
@@ -1502,28 +1502,28 @@ function Ge(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 l.absoluteValue = l.abs = function() {
1505
+ return p.absoluteValue = p.abs = function() {
1506
1506
  var t = new b(this);
1507
1507
  return t.s < 0 && (t.s = 1), t;
1508
- }, l.comparedTo = function(t, a) {
1508
+ }, p.comparedTo = function(t, a) {
1509
1509
  return le(this, new b(t, a));
1510
- }, l.decimalPlaces = l.dp = function(t, a) {
1510
+ }, p.decimalPlaces = p.dp = function(t, a) {
1511
1511
  var s, u, i, c = this;
1512
1512
  if (t != null)
1513
1513
  return I(t, 0, V), a == null ? a = x : I(a, 0, 8), X(new b(c), t + c.e + 1, a);
1514
1514
  if (!(s = c.c)) return null;
1515
1515
  if (u = ((i = s.length - 1) - ee(this.e / S)) * S, i = s[i]) for (; i % 10 == 0; i /= 10, u--) ;
1516
1516
  return u < 0 && (u = 0), u;
1517
- }, l.dividedBy = l.div = function(t, a) {
1517
+ }, p.dividedBy = p.div = function(t, a) {
1518
1518
  return n(this, new b(t, a), g, x);
1519
- }, l.dividedToIntegerBy = l.idiv = function(t, a) {
1519
+ }, p.dividedToIntegerBy = p.idiv = function(t, a) {
1520
1520
  return n(this, new b(t, a), 0, 1);
1521
- }, l.exponentiatedBy = l.pow = function(t, a) {
1522
- var s, u, i, c, m, r, d, f, p, h = this;
1521
+ }, p.exponentiatedBy = p.pow = function(t, a) {
1522
+ var s, u, i, c, 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])
1526
- return p = new b(Math.pow(+ie(h), r ? t.s * (2 - be(t)) : +ie(t))), a ? p.mod(a) : p;
1526
+ return l = new b(Math.pow(+ie(h), r ? t.s * (2 - be(t)) : +ie(t))), a ? l.mod(a) : l;
1527
1527
  if (d = t.s < 0, a) {
1528
1528
  if (a.c ? !a.c[0] : !a.s) return new b(NaN);
1529
1529
  u = !d && h.isInteger() && a.isInteger(), u && (h = h.mod(a));
@@ -1532,10 +1532,10 @@ function Ge(e) {
1532
1532
  return c = h.s < 0 && be(t) ? -0 : 0, h.e > -1 && (c = 1 / c), new b(d ? 1 / c : c);
1533
1533
  P && (c = Fe(P / S + 2));
1534
1534
  }
1535
- for (r ? (s = new b(0.5), d && (t.s = 1), f = be(t)) : (i = Math.abs(+ie(t)), f = i % 2), p = new b(A); ; ) {
1535
+ for (r ? (s = new b(0.5), d && (t.s = 1), f = be(t)) : (i = Math.abs(+ie(t)), f = i % 2), l = new b(A); ; ) {
1536
1536
  if (f) {
1537
- if (p = p.times(h), !p.c) break;
1538
- c ? p.c.length > c && (p.c.length = c) : u && (p = p.mod(a));
1537
+ if (l = l.times(h), !l.c) break;
1538
+ c ? l.c.length > c && (l.c.length = c) : u && (l = l.mod(a));
1539
1539
  }
1540
1540
  if (i) {
1541
1541
  if (i = J(i / 2), i === 0) break;
@@ -1548,83 +1548,83 @@ function Ge(e) {
1548
1548
  }
1549
1549
  h = h.times(h), c ? h.c && h.c.length > c && (h.c.length = c) : u && (h = h.mod(a));
1550
1550
  }
1551
- return u ? p : (d && (p = A.div(p)), a ? p.mod(a) : c ? X(p, P, x, m) : p);
1552
- }, l.integerValue = function(t) {
1551
+ return u ? l : (d && (l = A.div(l)), a ? l.mod(a) : c ? X(l, P, x, m) : l);
1552
+ }, p.integerValue = function(t) {
1553
1553
  var a = new b(this);
1554
1554
  return t == null ? t = x : I(t, 0, 8), X(a, a.e + 1, t);
1555
- }, l.isEqualTo = l.eq = function(t, a) {
1555
+ }, p.isEqualTo = p.eq = function(t, a) {
1556
1556
  return le(this, new b(t, a)) === 0;
1557
- }, l.isFinite = function() {
1557
+ }, p.isFinite = function() {
1558
1558
  return !!this.c;
1559
- }, l.isGreaterThan = l.gt = function(t, a) {
1559
+ }, p.isGreaterThan = p.gt = function(t, a) {
1560
1560
  return le(this, new b(t, a)) > 0;
1561
- }, l.isGreaterThanOrEqualTo = l.gte = function(t, a) {
1561
+ }, p.isGreaterThanOrEqualTo = p.gte = function(t, a) {
1562
1562
  return (a = le(this, new b(t, a))) === 1 || a === 0;
1563
- }, l.isInteger = function() {
1563
+ }, p.isInteger = function() {
1564
1564
  return !!this.c && ee(this.e / S) > this.c.length - 2;
1565
- }, l.isLessThan = l.lt = function(t, a) {
1565
+ }, p.isLessThan = p.lt = function(t, a) {
1566
1566
  return le(this, new b(t, a)) < 0;
1567
- }, l.isLessThanOrEqualTo = l.lte = function(t, a) {
1567
+ }, p.isLessThanOrEqualTo = p.lte = function(t, a) {
1568
1568
  return (a = le(this, new b(t, a))) === -1 || a === 0;
1569
- }, l.isNaN = function() {
1569
+ }, p.isNaN = function() {
1570
1570
  return !this.s;
1571
- }, l.isNegative = function() {
1571
+ }, p.isNegative = function() {
1572
1572
  return this.s < 0;
1573
- }, l.isPositive = function() {
1573
+ }, p.isPositive = function() {
1574
1574
  return this.s > 0;
1575
- }, l.isZero = function() {
1575
+ }, p.isZero = function() {
1576
1576
  return !!this.c && this.c[0] == 0;
1577
- }, l.minus = function(t, a) {
1577
+ }, p.minus = function(t, a) {
1578
1578
  var s, u, i, c, 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);
1582
- var d = m.e / S, f = t.e / S, p = m.c, h = t.c;
1582
+ var d = m.e / S, f = t.e / S, l = m.c, h = t.c;
1583
1583
  if (!d || !f) {
1584
- if (!p || !h) return p ? (t.s = -a, t) : new b(h ? m : NaN);
1585
- if (!p[0] || !h[0])
1586
- return h[0] ? (t.s = -a, t) : new b(p[0] ? m : (
1584
+ if (!l || !h) return l ? (t.s = -a, t) : new b(h ? m : NaN);
1585
+ if (!l[0] || !h[0])
1586
+ return h[0] ? (t.s = -a, t) : new b(l[0] ? m : (
1587
1587
  // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
1588
1588
  x == 3 ? -0 : 0
1589
1589
  ));
1590
1590
  }
1591
- if (d = ee(d), f = ee(f), p = p.slice(), r = d - f) {
1592
- for ((c = r < 0) ? (r = -r, i = p) : (f = d, i = h), i.reverse(), a = r; a--; i.push(0)) ;
1591
+ if (d = ee(d), f = ee(f), l = l.slice(), r = d - f) {
1592
+ for ((c = r < 0) ? (r = -r, i = l) : (f = d, i = h), i.reverse(), a = r; a--; i.push(0)) ;
1593
1593
  i.reverse();
1594
1594
  } else
1595
- for (u = (c = (r = p.length) < (a = h.length)) ? r : a, r = a = 0; a < u; a++)
1596
- if (p[a] != h[a]) {
1597
- c = p[a] < h[a];
1595
+ for (u = (c = (r = l.length) < (a = h.length)) ? r : a, r = a = 0; a < u; a++)
1596
+ if (l[a] != h[a]) {
1597
+ c = l[a] < h[a];
1598
1598
  break;
1599
1599
  }
1600
- if (c && (i = p, p = h, h = i, t.s = -t.s), a = (u = h.length) - (s = p.length), a > 0) for (; a--; p[s++] = 0) ;
1600
+ if (c && (i = l, l = h, h = i, 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
- if (p[--u] < h[u]) {
1603
- for (s = u; s && !p[--s]; p[s] = a) ;
1604
- --p[s], p[u] += te;
1602
+ if (l[--u] < h[u]) {
1603
+ for (s = u; s && !l[--s]; l[s] = a) ;
1604
+ --l[s], l[u] += te;
1605
1605
  }
1606
- p[u] -= h[u];
1606
+ l[u] -= h[u];
1607
1607
  }
1608
- for (; p[0] == 0; p.splice(0, 1), --f) ;
1609
- return p[0] ? we(t, p, f) : (t.s = x == 3 ? -1 : 1, t.c = [t.e = 0], t);
1610
- }, l.modulo = l.mod = function(t, a) {
1608
+ for (; l[0] == 0; l.splice(0, 1), --f) ;
1609
+ return l[0] ? we(t, l, f) : (t.s = x == 3 ? -1 : 1, t.c = [t.e = 0], t);
1610
+ }, p.modulo = p.mod = function(t, a) {
1611
1611
  var s, u, i = this;
1612
1612
  return t = new b(t, a), !i.c || !t.s || t.c && !t.c[0] ? new b(NaN) : !t.c || i.c && !i.c[0] ? new b(i) : (R == 9 ? (u = t.s, t.s = 1, s = n(i, t, 0, 3), t.s = u, s.s *= u) : s = n(i, t, 0, R), t = i.minus(s.times(t)), !t.c[0] && R == 1 && (t.s = i.s), t);
1613
- }, l.multipliedBy = l.times = function(t, a) {
1614
- var s, u, i, c, m, r, d, f, p, h, C, D, v, N, L, O = this, _ = O.c, W = (t = new b(t, a)).c;
1613
+ }, p.multipliedBy = p.times = function(t, a) {
1614
+ var s, u, i, c, m, r, d, f, l, h, C, 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, i = d, d = h, h = i), i = d + h, v = []; i--; v.push(0)) ;
1618
1618
  for (N = te, L = ce, i = h; --i >= 0; ) {
1619
1619
  for (s = 0, C = W[i] % L, D = W[i] / L | 0, m = d, c = i + m; c > i; )
1620
- f = _[--m] % L, p = _[m] / L | 0, r = D * f + p * C, f = C * f + r % L * L + v[c] + s, s = (f / N | 0) + (r / L | 0) + D * p, v[c--] = f % N;
1620
+ f = _[--m] % L, l = _[m] / L | 0, r = D * f + l * C, f = C * f + r % L * L + v[c] + s, s = (f / N | 0) + (r / L | 0) + D * l, v[c--] = f % N;
1621
1621
  v[c] = s;
1622
1622
  }
1623
1623
  return s ? ++u : v.splice(0, 1), we(t, v, u);
1624
- }, l.negated = function() {
1624
+ }, p.negated = function() {
1625
1625
  var t = new b(this);
1626
1626
  return t.s = -t.s || null, t;
1627
- }, l.plus = function(t, a) {
1627
+ }, p.plus = function(t, a) {
1628
1628
  var s, u = this, i = u.s;
1629
1629
  if (t = new b(t, a), a = t.s, !i || !a) return new b(NaN);
1630
1630
  if (i != a)
@@ -1641,7 +1641,7 @@ function Ge(e) {
1641
1641
  for (i = r.length, a = d.length, i - a < 0 && (s = d, d = r, r = s, a = i), i = 0; a; )
1642
1642
  i = (r[--a] = r[a] + d[a] + i) / te | 0, r[a] = te === r[a] ? 0 : r[a] % te;
1643
1643
  return i && (r = [i].concat(r), ++m), we(t, r, m);
1644
- }, l.precision = l.sd = function(t, a) {
1644
+ }, p.precision = p.sd = function(t, a) {
1645
1645
  var s, u, i, c = this;
1646
1646
  if (t != null && t !== !!t)
1647
1647
  return I(t, 1, V), a == null ? a = x : I(a, 0, 8), X(new b(c), t, a);
@@ -1651,15 +1651,15 @@ function Ge(e) {
1651
1651
  for (i = s[0]; i >= 10; i /= 10, u++) ;
1652
1652
  }
1653
1653
  return t && c.e + 1 > u && (u = c.e + 1), u;
1654
- }, l.shiftedBy = function(t) {
1654
+ }, p.shiftedBy = function(t) {
1655
1655
  return I(t, -De, De), this.times("1e" + t);
1656
- }, l.squareRoot = l.sqrt = function() {
1657
- var t, a, s, u, i, c = this, m = c.c, r = c.s, d = c.e, f = g + 4, p = new b("0.5");
1656
+ }, p.squareRoot = p.sqrt = function() {
1657
+ var t, a, s, u, i, c = this, m = c.c, r = c.s, d = c.e, f = g + 4, l = new b("0.5");
1658
1658
  if (r !== 1 || !m || !m[0])
1659
1659
  return new b(!r || r < 0 && (!m || m[0]) ? NaN : m ? c : 1 / 0);
1660
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]) {
1661
1661
  for (d = s.e, r = d + f, r < 3 && (r = 0); ; )
1662
- if (i = s, s = p.times(i.plus(n(c, i, f, 1))), Y(i.c).slice(0, r) === (a = Y(s.c)).slice(0, r))
1662
+ if (i = s, s = l.times(i.plus(n(c, i, f, 1))), Y(i.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
1664
  if (!u && (X(i, i.e + g + 2, 0), i.times(i).eq(c))) {
1665
1665
  s = i;
@@ -1672,69 +1672,69 @@ function Ge(e) {
1672
1672
  }
1673
1673
  }
1674
1674
  return X(s, s.e + g + 1, x, t);
1675
- }, l.toExponential = function(t, a) {
1675
+ }, p.toExponential = function(t, a) {
1676
1676
  return t != null && (I(t, 0, V), t++), xe(this, t, a, 1);
1677
- }, l.toFixed = function(t, a) {
1677
+ }, p.toFixed = function(t, a) {
1678
1678
  return t != null && (I(t, 0, V), t = t + this.e + 1), xe(this, t, a);
1679
- }, l.toFormat = function(t, a, s) {
1679
+ }, p.toFormat = function(t, a, s) {
1680
1680
  var u, i = 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 = i.toFixed(t, a), i.c) {
1686
- var c, m = u.split("."), r = +s.groupSize, d = +s.secondaryGroupSize, f = s.groupSeparator || "", p = m[0], h = m[1], C = i.s < 0, D = C ? p.slice(1) : p, v = D.length;
1686
+ var c, m = u.split("."), r = +s.groupSize, d = +s.secondaryGroupSize, f = s.groupSeparator || "", l = m[0], h = m[1], C = i.s < 0, D = C ? l.slice(1) : l, v = D.length;
1687
1687
  if (d && (c = r, r = d, d = c, v -= c), r > 0 && v > 0) {
1688
- for (c = v % r || r, p = D.substr(0, c); c < v; c += r) p += f + D.substr(c, r);
1689
- d > 0 && (p += f + D.slice(c)), C && (p = "-" + p);
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)), C && (l = "-" + l);
1690
1690
  }
1691
- u = h ? p + (s.decimalSeparator || "") + ((d = +s.fractionGroupSize) ? h.replace(
1691
+ u = h ? l + (s.decimalSeparator || "") + ((d = +s.fractionGroupSize) ? h.replace(
1692
1692
  new RegExp("\\d{" + d + "}\\B", "g"),
1693
1693
  "$&" + (s.fractionGroupSeparator || "")
1694
- ) : h) : p;
1694
+ ) : h) : l;
1695
1695
  }
1696
1696
  return (s.prefix || "") + u + (s.suffix || "");
1697
- }, l.toFraction = function(t) {
1698
- var a, s, u, i, c, m, r, d, f, p, h, C, D = this, v = D.c;
1697
+ }, p.toFraction = function(t) {
1698
+ var a, s, u, i, c, m, r, d, f, l, h, C, 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), C = Y(v), c = a.e = C.length - D.e - 1, a.c[0] = ke[(m = c % S) < 0 ? S + m : m], t = !t || r.comparedTo(a) > 0 ? c > 0 ? a : f : r, m = F, F = 1 / 0, r = new b(C), d.c[0] = 0; p = n(r, a, 0, 1), i = s.plus(p.times(u)), i.comparedTo(t) != 1; )
1703
- s = u, u = i, f = d.plus(p.times(i = f)), d = i, a = r.minus(p.times(i = a)), r = i;
1702
+ for (a = new b(A), f = s = new b(A), u = d = new b(A), C = Y(v), c = a.e = C.length - D.e - 1, a.c[0] = ke[(m = c % S) < 0 ? S + m : m], t = !t || r.comparedTo(a) > 0 ? c > 0 ? a : f : r, m = F, F = 1 / 0, r = new b(C), d.c[0] = 0; l = n(r, a, 0, 1), i = s.plus(l.times(u)), i.comparedTo(t) != 1; )
1703
+ s = u, u = i, f = d.plus(l.times(i = f)), d = i, a = r.minus(l.times(i = a)), r = i;
1704
1704
  return i = n(t.minus(s), u, 0, 1), d = d.plus(i.times(f)), s = s.plus(i.times(u)), d.s = f.s = D.s, c = c * 2, h = n(f, u, c, x).minus(D).abs().comparedTo(
1705
1705
  n(d, s, c, x).minus(D).abs()
1706
1706
  ) < 1 ? [f, u] : [d, s], F = m, h;
1707
- }, l.toNumber = function() {
1707
+ }, p.toNumber = function() {
1708
1708
  return +ie(this);
1709
- }, l.toPrecision = function(t, a) {
1709
+ }, p.toPrecision = function(t, a) {
1710
1710
  return t != null && I(t, 1, V), xe(this, t, a, 2);
1711
- }, l.toString = function(t) {
1711
+ }, p.toString = function(t) {
1712
1712
  var a, s = this, u = s.s, i = s.e;
1713
1713
  return i === null ? u ? (a = "Infinity", u < 0 && (a = "-" + a)) : a = "NaN" : (t == null ? a = i <= w || i >= T ? ge(Y(s.c), i) : oe(Y(s.c), i, "0") : t === 10 && fe ? (s = X(new b(s), g + i + 1, x), a = oe(Y(s.c), s.e, "0")) : (I(t, 2, re.length, "Base"), a = o(oe(Y(s.c), i, "0"), 10, t, u, !0)), u < 0 && s.c[0] && (a = "-" + a)), a;
1714
- }, l.valueOf = l.toJSON = function() {
1714
+ }, p.valueOf = p.toJSON = function() {
1715
1715
  return ie(this);
1716
- }, l._isBigNumber = !0, l[Symbol.toStringTag] = "BigNumber", l[Symbol.for("nodejs.util.inspect.custom")] = l.valueOf, e != null && b.set(e), b;
1716
+ }, p._isBigNumber = !0, p[Symbol.toStringTag] = "BigNumber", p[Symbol.for("nodejs.util.inspect.custom")] = p.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, o, y = 1, l = e.length, A = e[0] + ""; y < l; ) {
1723
+ for (var n, o, y = 1, p = e.length, A = e[0] + ""; y < p; ) {
1724
1724
  for (n = e[y++] + "", o = S - n.length; o--; n = "0" + n) ;
1725
1725
  A += n;
1726
1726
  }
1727
- for (l = A.length; A.charCodeAt(--l) === 48; ) ;
1728
- return A.slice(0, l + 1 || 1);
1727
+ for (p = A.length; A.charCodeAt(--p) === 48; ) ;
1728
+ return A.slice(0, p + 1 || 1);
1729
1729
  }
1730
1730
  function le(e, n) {
1731
- var o, y, l = e.c, A = n.c, g = e.s, x = n.s, w = e.e, T = n.e;
1731
+ var o, y, p = e.c, A = n.c, g = e.s, x = n.s, w = e.e, T = n.e;
1732
1732
  if (!g || !x) return null;
1733
- if (o = l && !l[0], y = A && !A[0], o || y) return o ? y ? 0 : -x : g;
1733
+ if (o = p && !p[0], y = A && !A[0], o || y) return o ? y ? 0 : -x : g;
1734
1734
  if (g != x) return g;
1735
- if (o = g < 0, y = w == T, !l || !A) return y ? 0 : !l ^ o ? 1 : -1;
1735
+ if (o = g < 0, y = w == T, !p || !A) return y ? 0 : !p ^ o ? 1 : -1;
1736
1736
  if (!y) return w > T ^ o ? 1 : -1;
1737
- for (x = (w = l.length) < (T = A.length) ? w : T, g = 0; g < x; g++) if (l[g] != A[g]) return l[g] > A[g] ^ o ? 1 : -1;
1737
+ for (x = (w = p.length) < (T = A.length) ? w : T, g = 0; g < x; g++) if (p[g] != A[g]) return p[g] > A[g] ^ o ? 1 : -1;
1738
1738
  return w == T ? 0 : w > T ^ o ? 1 : -1;
1739
1739
  }
1740
1740
  function I(e, n, o, 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, o) {
1752
- var y, l;
1752
+ var y, p;
1753
1753
  if (n < 0) {
1754
- for (l = o + "."; ++n; l += o) ;
1755
- e = l + e;
1754
+ for (p = o + "."; ++n; p += o) ;
1755
+ e = p + e;
1756
1756
  } else if (y = e.length, ++n > y) {
1757
- for (l = o, n -= y; --n; l += o) ;
1758
- e += l;
1757
+ for (p = o, n -= y; --n; p += o) ;
1758
+ e += p;
1759
1759
  } else n < y && (e = e.slice(0, n) + "." + e.slice(n));
1760
1760
  return e;
1761
1761
  }
@@ -1776,8 +1776,8 @@ function Ee(e, n) {
1776
1776
  }
1777
1777
  function $t(e, n, o) {
1778
1778
  if (typeof e != "string") return Le(e);
1779
- const y = ".", l = e.replace(new RegExp(`[^${y}\\d-]+`, "g"), "");
1780
- return Le(l);
1779
+ const y = ".", p = e.replace(new RegExp(`[^${y}\\d-]+`, "g"), "");
1780
+ return Le(p);
1781
1781
  }
1782
1782
  const In = (e) => !!Qt.find((n) => Ee(n, e || ""));
1783
1783
  function Ht(e) {
@@ -1785,8 +1785,8 @@ function Ht(e) {
1785
1785
  }
1786
1786
  const pe = (e) => e ? e.value * e.unit : 0, Kt = (e) => !e || e === "NaN" ? "0" : E(e).decimalPlaces(0).toFixed(), Nn = (e) => Object.values(H).find((n) => n.id === e), qt = (e) => {
1787
1787
  if (!e) return;
1788
- const n = e.map((A) => K(A)), o = Object.entries(Yt).filter(([A]) => n.includes(A)).flatMap(([, A]) => A), y = e.map((A) => A.exchangeAddress), l = new Set([...y, ...o].map((A) => A.toLowerCase()));
1789
- return Array.from(l);
1788
+ const n = e.map((A) => K(A)), o = Object.entries(Yt).filter(([A]) => n.includes(A)).flatMap(([, A]) => A), y = e.map((A) => A.exchangeAddress), p = new Set([...y, ...o].map((A) => A.toLowerCase()));
1789
+ return Array.from(p);
1790
1790
  }, Mn = (e, n) => e.version === 1 ? (e.fillDelay || 0) * 1e3 + Ze(n) : (e.fillDelay || 0) * 1e3, je = (e) => typeof window > "u" ? null : new URLSearchParams(window.location.search).get(e), Un = (e) => sn().filter((n) => n.name === e).map((n) => n.chainId), Ve = "https://order-sink-dev.orbs.network", Se = "https://order-sink.orbs.network";
1791
1791
  let _e;
1792
1792
  const Ln = (e) => {
@@ -2022,7 +2022,7 @@ var Be, He;
2022
2022
  function nn() {
2023
2023
  if (He) return Be;
2024
2024
  He = 1;
2025
- const e = tn, n = (l) => en(`./out/${l}.sol/${l}.json`).abi, o = () => ({
2025
+ const e = tn, n = (p) => en(`./out/${p}.sol/${p}.json`).abi, o = () => ({
2026
2026
  wm: n("WM"),
2027
2027
  repermit: n("RePermit"),
2028
2028
  reactor: n("OrderReactor"),
@@ -2030,9 +2030,9 @@ function nn() {
2030
2030
  refinery: n("Refinery"),
2031
2031
  adapter: n("DefaultDexAdapter")
2032
2032
  });
2033
- function y(l, A) {
2034
- if (!l || !(A != null && A.trim())) return;
2035
- const { dex: g, ...x } = e["*"] ?? {}, w = e[l];
2033
+ function y(p, A) {
2034
+ if (!p || !(A != null && A.trim())) return;
2035
+ const { dex: g, ...x } = e["*"] ?? {}, w = e[p];
2036
2036
  if (!w) return;
2037
2037
  const { dex: T, ...B } = w, F = T == null ? void 0 : T[A];
2038
2038
  if (F)
@@ -2043,22 +2043,22 @@ function nn() {
2043
2043
  var Ye = nn();
2044
2044
  const na = (e, n, o) => {
2045
2045
  if (!e || !n || !o) return;
2046
- const y = E(e).times(n), l = E(10).pow(o);
2047
- return y.div(l).toFixed(0);
2046
+ const y = E(e).times(n), p = E(10).pow(o);
2047
+ return y.div(p).toFixed(0);
2048
2048
  }, aa = (e, n, o, y) => {
2049
2049
  if (o || !y || !e || !n)
2050
2050
  return E(0).toString();
2051
- const l = E(e).times(E(n)), A = E(10).pow(y), g = l.div(A);
2051
+ const p = E(e).times(E(n)), A = E(10).pow(y), g = p.div(A);
2052
2052
  return E.max(1, g).integerValue(E.ROUND_FLOOR).toFixed(0);
2053
2053
  }, sa = (e, n, o, y) => {
2054
2054
  if (e === G.TWAP || e === G.LIMIT)
2055
2055
  return "0";
2056
2056
  if (!y || !n || !o) return;
2057
- const l = E(n).times(E(o)), A = E(10).pow(y), g = l.div(A);
2057
+ const p = E(n).times(E(o)), A = E(10).pow(y), g = p.div(A);
2058
2058
  return E.max(1, g).integerValue(E.ROUND_FLOOR).toFixed(0) || "0";
2059
2059
  }, ra = (e, n, o, y) => {
2060
- const l = pe(o) * 2 * n, A = Ht(l);
2061
- return y || (e === G.LIMIT ? { unit: ne.Days, value: 7 } : e === G.STOP_LOSS || e === G.TAKE_PROFIT ? { unit: ne.Days, value: 1 } : { unit: A, value: Number(E(l / A).toFixed(2)) });
2060
+ const p = pe(o) * 2 * n, A = Ht(p);
2061
+ return y || (e === G.LIMIT ? { unit: ne.Days, value: 7 } : e === G.STOP_LOSS || e === G.TAKE_PROFIT ? { unit: ne.Days, value: 1 } : { unit: A, value: Number(E(p / A).toFixed(2)) });
2062
2062
  }, ia = (e, n, o) => n !== G.TWAP ? 1 : o !== void 0 ? o : e, oa = (e, n, o, y) => {
2063
2063
  if (!n || !o || !y) return 1;
2064
2064
  const A = E(o).times(n).div(y).integerValue(E.ROUND_FLOOR).toNumber(), g = Math.floor(
@@ -2111,29 +2111,24 @@ const na = (e, n, o) => {
2111
2111
  }), Ea = (e, n, o) => ({
2112
2112
  isError: o === G.TWAP && E(e).isGreaterThan(n),
2113
2113
  value: n
2114
- }), an = (e, n) => {
2115
- var o;
2116
- try {
2117
- if (!e || !n) throw new Error("Invalid chainId or _dex");
2118
- const y = (o = Object.entries($).find(
2119
- ([x, w]) => w.chainId === e && x.toLowerCase().indexOf(n.toLowerCase()) >= 0
2120
- )) == null ? void 0 : o[1], { abi: l, ...A } = Ye.config(e, n);
2121
- return {
2122
- ...A,
2123
- partner: n,
2124
- twapConfig: y
2125
- };
2126
- } catch {
2127
- return;
2128
- }
2114
+ }), an = (e, n = 0) => {
2115
+ var g;
2116
+ const o = (g = Object.entries($).find(
2117
+ ([x, w]) => w.chainId === n && x.toLowerCase().indexOf(e.toLowerCase()) >= 0
2118
+ )) == null ? void 0 : g[1], { abi: y, ...p } = Ye.config(n, e);
2119
+ return {
2120
+ ...p,
2121
+ partner: e,
2122
+ twapConfig: o
2123
+ };
2129
2124
  }, sn = () => {
2130
2125
  const e = Ye.raw;
2131
2126
  return Object.entries(e).filter(([n]) => n !== "*").flatMap(([n, o]) => {
2132
2127
  const y = o == null ? void 0 : o.dex;
2133
- return !y || typeof y != "object" ? [] : Object.entries(y).map(([l]) => ({
2128
+ return !y || typeof y != "object" ? [] : Object.entries(y).map(([p]) => ({
2134
2129
  chainId: Number(n),
2135
- name: l,
2136
- config: an(Number(n), l)
2130
+ name: p,
2131
+ config: an(p, Number(n))
2137
2132
  }));
2138
2133
  }).sort((n, o) => n.name.localeCompare(o.name));
2139
2134
  }, xa = ({
@@ -2141,7 +2136,7 @@ const na = (e, n, o) => {
2141
2136
  srcToken: n,
2142
2137
  dstToken: o,
2143
2138
  srcAmount: y,
2144
- deadlineMillis: l,
2139
+ deadlineMillis: p,
2145
2140
  fillDelayMillis: A,
2146
2141
  slippage: g,
2147
2142
  account: x,
@@ -2150,7 +2145,7 @@ const na = (e, n, o) => {
2150
2145
  triggerAmountPerTrade: B,
2151
2146
  config: F
2152
2147
  }) => {
2153
- const k = Date.now().toString(), R = parseInt((A / 1e3).toFixed(0)), P = Kt(l / 1e3), ue = je(Qe.FRESHNESS), re = ue ? parseInt(ue) : 60, fe = {
2148
+ const k = Date.now().toString(), R = parseInt((A / 1e3).toFixed(0)), P = Kt(p / 1e3), ue = je(Qe.FRESHNESS), re = ue ? parseInt(ue) : 60, fe = {
2154
2149
  permitted: {
2155
2150
  token: n,
2156
2151
  amount: y
@@ -2199,7 +2194,7 @@ const na = (e, n, o) => {
2199
2194
  types: Jt,
2200
2195
  primaryType: Zt
2201
2196
  };
2202
- }, rn = "0.0.17", on = {
2197
+ }, rn = "0.0.18", on = {
2203
2198
  version: rn
2204
2199
  }, dn = 0.7, cn = `https://bi.orbs.network/putes/twap-ui-${dn}`, Je = on.version;
2205
2200
  let Pe = "unknown";
@@ -2211,7 +2206,7 @@ function Oe() {
2211
2206
  return `id_${e + n + o}`;
2212
2207
  }
2213
2208
  const pn = (e, n, o) => {
2214
- var y, l, A, g, x, w, T, B, F;
2209
+ var y, p, A, g, x, w, T, B, F;
2215
2210
  return {
2216
2211
  spotVersion: Je,
2217
2212
  partner: e.partner,
@@ -2227,7 +2222,7 @@ const pn = (e, n, o) => {
2227
2222
  wm: e.wm,
2228
2223
  chainName: ((y = e.twapConfig) == null ? void 0 : y.chainName) || "",
2229
2224
  chainId: o || 0,
2230
- twapVersion: ((l = e.twapConfig) == null ? void 0 : l.twapVersion) || 0,
2225
+ twapVersion: ((p = e.twapConfig) == null ? void 0 : p.twapVersion) || 0,
2231
2226
  twapAddress: ((A = e.twapConfig) == null ? void 0 : A.twapAddress) || "",
2232
2227
  lensAddress: ((g = e.twapConfig) == null ? void 0 : g.lensAddress) || "",
2233
2228
  bidDelaySeconds: ((x = e.twapConfig) == null ? void 0 : x.bidDelaySeconds) || 0,
@@ -2267,8 +2262,8 @@ class ln {
2267
2262
  }, o ? (await Ke(this.data), y == null || y()) : (clearTimeout(this.timeout), this.timeout = setTimeout(() => {
2268
2263
  Ke(this.data), y == null || y();
2269
2264
  }, 1e3));
2270
- } catch (l) {
2271
- console.error("Failed to update and send BI", l);
2265
+ } catch (p) {
2266
+ console.error("Failed to update and send BI", p);
2272
2267
  }
2273
2268
  }
2274
2269
  onCancelOrderRequest(n, o) {
@@ -2329,7 +2324,7 @@ class ln {
2329
2324
  account: n,
2330
2325
  chainId: o,
2331
2326
  module: y,
2332
- srcToken: l,
2327
+ srcToken: p,
2333
2328
  dstToken: A,
2334
2329
  fromTokenAmount: g,
2335
2330
  srcChunkAmount: x,
@@ -2344,8 +2339,8 @@ class ln {
2344
2339
  this.updateAndSend({
2345
2340
  toTokenAddress: A.address,
2346
2341
  toTokenSymbol: A.symbol,
2347
- fromTokenAddress: l.address,
2348
- fromTokenSymbol: l.symbol,
2342
+ fromTokenAddress: p.address,
2343
+ fromTokenSymbol: p.symbol,
2349
2344
  fromTokenAmount: g,
2350
2345
  chunksAmount: P,
2351
2346
  srcChunkAmount: x,
@@ -2377,8 +2372,8 @@ class ln {
2377
2372
  });
2378
2373
  }
2379
2374
  init(n, o, y) {
2380
- var l;
2381
- this.config = n, y !== ((l = this.data) == null ? void 0 : l.chainId) && (this.data = {
2375
+ var p;
2376
+ this.config = n, y !== ((p = this.data) == null ? void 0 : p.chainId) && (this.data = {
2382
2377
  _id: Oe(),
2383
2378
  action: "module-import",
2384
2379
  uiVersion: Pe,
@@ -2442,12 +2437,12 @@ class ln {
2442
2437
  }
2443
2438
  }
2444
2439
  const ve = new ln(), un = (e) => {
2445
- var l;
2446
- const n = E(e.order.witness.output.limit || 0).gt(1), o = E(e.order.witness.output.stop || 0).gt(0), y = ((l = e.metadata.chunks) == null ? void 0 : l.length) || E(e.order.witness.input.maxAmount).div(E(e.order.witness.input.amount)).toNumber();
2440
+ var p;
2441
+ const n = E(e.order.witness.output.limit || 0).gt(1), o = E(e.order.witness.output.stop || 0).gt(0), y = ((p = e.metadata.chunks) == null ? void 0 : p.length) || E(e.order.witness.input.maxAmount).div(E(e.order.witness.input.amount)).toNumber();
2447
2442
  return o && n ? j.TRIGGER_PRICE_LIMIT : o ? j.TRIGGER_PRICE_MARKET : !n && y <= 1 ? j.TWAP_MARKET : y >= 1 && n ? j.TWAP_LIMIT : n ? j.LIMIT : j.TWAP_MARKET;
2448
2443
  }, fn = (e) => {
2449
- var l;
2450
- const n = ((l = e.metadata.chunks) == null ? void 0 : l.filter((A) => A.status === "success").length) || 0, o = e.metadata.expectedChunks || 0, y = E(n).dividedBy(o).toNumber();
2444
+ var p;
2445
+ const n = ((p = e.metadata.chunks) == null ? void 0 : p.filter((A) => A.status === "success").length) || 0, o = e.metadata.expectedChunks || 0, y = E(n).dividedBy(o).toNumber();
2451
2446
  return y >= 0.99 ? 100 : y <= 0 ? 0 : Number((y * 100).toFixed(2));
2452
2447
  }, mn = (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, yn = (e) => {
2453
2448
  var o;
@@ -2462,7 +2457,7 @@ const ve = new ln(), un = (e) => {
2462
2457
  const o = e.length;
2463
2458
  return o >= n && ((y = e[o - 1]) == null ? void 0 : y.timestamp) || 0;
2464
2459
  }, et = (e) => {
2465
- const n = fn(e), o = Number(e.order.witness.output.limit) === 1 ? "" : e.order.witness.output.limit, y = e.metadata.expectedChunks || 1, l = yn(e);
2460
+ const n = fn(e), o = Number(e.order.witness.output.limit) === 1 ? "" : e.order.witness.output.limit, y = e.metadata.expectedChunks || 1, p = yn(e);
2466
2461
  return {
2467
2462
  id: e.hash,
2468
2463
  hash: e.hash,
@@ -2470,13 +2465,13 @@ const ve = new ln(), un = (e) => {
2470
2465
  type: un(e),
2471
2466
  maker: e.order.witness.swapper,
2472
2467
  progress: n,
2473
- srcAmountFilled: l.reduce((A, g) => A.plus(g.inAmount), new E(0)).toFixed() || "",
2474
- dstAmountFilled: l.reduce((A, g) => A.plus(g.outAmount), new E(0)).toFixed() || "",
2475
- fills: l,
2468
+ srcAmountFilled: p.reduce((A, g) => A.plus(g.inAmount), new E(0)).toFixed() || "",
2469
+ dstAmountFilled: p.reduce((A, g) => A.plus(g.outAmount), new E(0)).toFixed() || "",
2470
+ fills: p,
2476
2471
  srcTokenAddress: e.order.witness.input.token,
2477
2472
  dstTokenAddress: e.order.witness.output.token,
2478
2473
  orderDollarValueIn: e.metadata.displayOnlyInputTokenPriceUSD ? E(e.metadata.displayOnlyInputTokenPriceUSD).toFixed(6) : "",
2479
- fillDelay: e.order.witness.epoch,
2474
+ fillDelay: e.order.witness.epoch * 1e3,
2480
2475
  deadline: Number(e.order.deadline) * 1e3,
2481
2476
  createdAt: new Date(e.timestamp).getTime(),
2482
2477
  srcAmount: e.order.witness.input.maxAmount,
@@ -2487,7 +2482,7 @@ const ve = new ln(), un = (e) => {
2487
2482
  totalTradesAmount: y,
2488
2483
  isMarketPrice: E(o || 0).lte(1),
2489
2484
  chainId: e.order.witness.chainid,
2490
- filledOrderTimestamp: hn(l, y),
2485
+ filledOrderTimestamp: hn(p, y),
2491
2486
  status: mn(e, n),
2492
2487
  rawOrder: e
2493
2488
  };
@@ -2501,13 +2496,13 @@ const ve = new ln(), un = (e) => {
2501
2496
  status: "pending"
2502
2497
  };
2503
2498
  console.log("body", o), ve.onCreateOrderRequest();
2504
- const l = await (await fetch(`${Xe()}/orders/new`, {
2499
+ const p = await (await fetch(`${Xe()}/orders/new`, {
2505
2500
  method: "POST",
2506
2501
  body: JSON.stringify(o)
2507
2502
  })).json();
2508
- if (!l.success)
2509
- throw new Error(`error:${l.message}, code:${l.code}`);
2510
- const A = et(l.signedOrder);
2503
+ if (!p.success)
2504
+ throw new Error(`error:${p.message}, code:${p.code}`);
2505
+ const A = et(p.signedOrder);
2511
2506
  return ve.onCreateOrderSuccess(A.id), A;
2512
2507
  } catch (o) {
2513
2508
  throw ve.onCreateOrderError(o), console.error(o), o;
@@ -2520,7 +2515,7 @@ const ve = new ln(), un = (e) => {
2520
2515
  buildQuery: n,
2521
2516
  extractResults: o,
2522
2517
  signal: y,
2523
- retries: l = 1,
2518
+ retries: p = 1,
2524
2519
  limit: A = 1e3,
2525
2520
  page: g
2526
2521
  }) => {
@@ -2528,7 +2523,7 @@ const ve = new ln(), un = (e) => {
2528
2523
  if (!x) throw new Cn();
2529
2524
  const w = async (F) => {
2530
2525
  let k = 0;
2531
- for (; k <= l; )
2526
+ for (; k <= p; )
2532
2527
  try {
2533
2528
  const R = await fetch(x, {
2534
2529
  method: "POST",
@@ -2542,7 +2537,7 @@ const ve = new ln(), un = (e) => {
2542
2537
  throw new Error(P.errors[0].message);
2543
2538
  return o(P);
2544
2539
  } catch (R) {
2545
- if (k === l) throw R;
2540
+ if (k === p) throw R;
2546
2541
  await new Promise((P) => setTimeout(P, 500 * 2 ** k)), k++;
2547
2542
  }
2548
2543
  return [];
@@ -2589,7 +2584,7 @@ const ve = new ln(), un = (e) => {
2589
2584
  return !o && n === 1 ? j.TWAP_MARKET : n > 1 && o ? j.TWAP_LIMIT : o ? j.LIMIT : j.TWAP_MARKET;
2590
2585
  }, gn = (e, n, o, y) => {
2591
2586
  var k;
2592
- const l = tt(o || []), A = new E(e.ask_srcAmount || 0).div(e.ask_srcBidAmount).integerValue(E.ROUND_FLOOR).toNumber(), x = (o == null ? void 0 : o.length) === A ? (k = o == null ? void 0 : o[(o == null ? void 0 : o.length) - 1]) == null ? void 0 : k.timestamp : void 0, w = l.reduce((R, P) => R.plus(P.inAmount), new E(0)).toFixed(), T = l.reduce((R, P) => R.plus(P.outAmount), new E(0)).toFixed(), B = nt(e.ask_srcAmount, w), F = qe(e.ask_dstMinAmount, A);
2587
+ const p = tt(o || []), A = new E(e.ask_srcAmount || 0).div(e.ask_srcBidAmount).integerValue(E.ROUND_FLOOR).toNumber(), x = (o == null ? void 0 : o.length) === A ? (k = o == null ? void 0 : o[(o == null ? void 0 : o.length) - 1]) == null ? void 0 : k.timestamp : void 0, w = p.reduce((R, P) => R.plus(P.inAmount), new E(0)).toFixed(), T = p.reduce((R, P) => R.plus(P.outAmount), new E(0)).toFixed(), B = nt(e.ask_srcAmount, w), F = qe(e.ask_dstMinAmount, A);
2593
2588
  return {
2594
2589
  version: 1,
2595
2590
  id: e.Contract_id.toString(),
@@ -2606,7 +2601,7 @@ const ve = new ln(), un = (e) => {
2606
2601
  orderDollarValueIn: E(e.dollarValueIn || 0).toFixed(6),
2607
2602
  srcAmount: e.ask_srcAmount,
2608
2603
  dstMinAmountTotal: E(e.ask_dstMinAmount).multipliedBy(A).toString(),
2609
- fills: l,
2604
+ fills: p,
2610
2605
  fillDelay: e.ask_fillDelay,
2611
2606
  deadline: e.ask_deadline * 1e3,
2612
2607
  createdAt: new Date(e.timestamp).getTime(),
@@ -2633,7 +2628,7 @@ const ve = new ln(), un = (e) => {
2633
2628
  ), y = de(
2634
2629
  e.inTokenSymbols,
2635
2630
  (k) => `"${k.toUpperCase()}"`
2636
- ), l = de(
2631
+ ), p = de(
2637
2632
  e.outTokenSymbols,
2638
2633
  (k) => `"${k.toUpperCase()}"`
2639
2634
  ), A = de(
@@ -2657,7 +2652,7 @@ const ve = new ln(), un = (e) => {
2657
2652
  w ? `Contract_id_in: [${w.join(", ")}]` : "",
2658
2653
  B ? `dollarValueIn_gte: ${B}` : "",
2659
2654
  y ? `srcTokenSymbol_in: [${y.join(", ")}]` : "",
2660
- l ? `dstTokenSymbol_in: [${l.join(", ")}]` : "",
2655
+ p ? `dstTokenSymbol_in: [${p.join(", ")}]` : "",
2661
2656
  A ? `srcTokenAddress_in: [${A.join(", ")}]` : "",
2662
2657
  g ? `dstTokenAddress_in: [${g.join(", ")}]` : "",
2663
2658
  e != null && e.startDate ? `blockTimestamp_gte: ${e.startDate}` : "",
@@ -2671,9 +2666,9 @@ async function xn({
2671
2666
  signal: n,
2672
2667
  page: o,
2673
2668
  limit: y,
2674
- filters: l
2669
+ filters: p
2675
2670
  }) {
2676
- const A = y || 1e3, g = En(l);
2671
+ const A = y || 1e3, g = En(p);
2677
2672
  return await Ne({
2678
2673
  chainId: e,
2679
2674
  signal: n,
@@ -2760,9 +2755,9 @@ const Tn = async ({
2760
2755
  orders: n,
2761
2756
  signal: o
2762
2757
  }) => {
2763
- const y = Ie(n.map((F) => F.Contract_id)), l = Ie(n.map((F) => F.twapAddress)).filter(Boolean);
2758
+ const y = Ie(n.map((F) => F.Contract_id)), p = Ie(n.map((F) => F.twapAddress)).filter(Boolean);
2764
2759
  if (y.length === 0) return [];
2765
- const A = y.join(", "), g = l.map((F) => `"${F}"`).join(", "), x = l.length ? `twapAddress_in: [${g}]` : "", T = `where: { ${[
2760
+ const A = y.join(", "), g = p.map((F) => `"${F}"`).join(", "), x = p.length ? `twapAddress_in: [${g}]` : "", T = `where: { ${[
2766
2761
  `TWAP_id_in: [${A}]`,
2767
2762
  x
2768
2763
  ].filter(Boolean).join(", ")} }`;
@@ -2807,14 +2802,14 @@ const Fn = async ({
2807
2802
  signal: n,
2808
2803
  page: o,
2809
2804
  limit: y,
2810
- filters: l
2805
+ filters: p
2811
2806
  }) => {
2812
2807
  const A = await xn({
2813
2808
  chainId: e,
2814
2809
  signal: n,
2815
2810
  page: o,
2816
2811
  limit: y,
2817
- filters: l
2812
+ filters: p
2818
2813
  }), [g, x] = await Promise.all([
2819
2814
  Tn({ chainId: e, orders: A, signal: n }),
2820
2815
  wn({ chainId: e, orders: A, signal: n })
@@ -2845,10 +2840,10 @@ const Fn = async ({
2845
2840
  page: n,
2846
2841
  chainId: o,
2847
2842
  limit: y,
2848
- config: l,
2843
+ config: p,
2849
2844
  account: A
2850
2845
  }) => (await Promise.all([
2851
- l ? Fn({ chainId: o, signal: e, page: n, limit: y, filters: { accounts: [A], configs: [l] } }) : Promise.resolve([]),
2846
+ p ? Fn({ chainId: o, signal: e, page: n, limit: y, filters: { accounts: [A], configs: [p] } }) : Promise.resolve([]),
2852
2847
  An({ chainId: o, signal: e, account: A })
2853
2848
  ]).then(([w, T]) => [...w, ...T])).sort((w, T) => T.createdAt - w.createdAt);
2854
2849
  export {