@gardenfi/core 2.0.7 → 2.0.9

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/index.js CHANGED
@@ -1,24 +1,24 @@
1
- var uu = Object.defineProperty;
2
- var cu = (e, t, r) => t in e ? uu(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var dr = (e, t, r) => cu(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { Orderbook as hu, isMainnet as Sn, getTimeLock as lu, isBitcoin as Hr, getBlockchainType as Bn, BlockchainType as Tt, EthereumLocalnet as du, ArbitrumLocalnet as pu } from "@gardenfi/orderbook";
5
- import { Environment as Pr, Url as un, with0x as Fn, checkAllowanceAndApprove as yu, Authorization as Qs, EventBroker as ga, Siwe as bu, sleep as wu, fetchBitcoinBlockNumber as Zs, fetchEVMBlockNumber as eo } from "@gardenfi/utils";
6
- import { BitcoinNetwork as to, Urgency as ro, BitcoinProvider as gu, BitcoinWallet as mu } from "@catalogfi/wallets";
7
- import { getContract as _u, sha256 as Pn, defineChain as vu, createWalletClient as no, custom as io } from "viem";
8
- import * as so from "varuint-bitcoin";
1
+ var fu = Object.defineProperty;
2
+ var uu = (e, t, r) => t in e ? fu(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var dr = (e, t, r) => uu(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { Orderbook as cu, isMainnet as Sn, getTimeLock as hu, isBitcoin as Hr, getBlockchainType as Bn, BlockchainType as Tt, EthereumLocalnet as lu, ArbitrumLocalnet as du } from "@gardenfi/orderbook";
5
+ import { Environment as Pr, Url as un, with0x as Fn, checkAllowanceAndApprove as pu, EventBroker as wa, Auth as yu, Siwe as bu, sleep as wu, fetchBitcoinBlockNumber as Qs, fetchEVMBlockNumber as Zs } from "@gardenfi/utils";
6
+ import { BitcoinNetwork as eo, Urgency as to, BitcoinProvider as gu, BitcoinWallet as mu } from "@catalogfi/wallets";
7
+ import { getContract as _u, sha256 as Pn, defineChain as vu, createWalletClient as ro, custom as no } from "viem";
8
+ import * as io from "varuint-bitcoin";
9
9
  import Eu from "varuint-bitcoin";
10
10
  import * as Qt from "tiny-secp256k1";
11
11
  import * as he from "bitcoinjs-lib";
12
12
  import { crypto as xu } from "bitcoinjs-lib";
13
13
  import Su from "bignumber.js";
14
- var ma = (e, t, r) => {
14
+ var ga = (e, t, r) => {
15
15
  if (!t.has(e))
16
16
  throw TypeError("Cannot " + r);
17
- }, Ui = (e, t, r) => (ma(e, t, "read from private field"), r ? r.call(e) : t.get(e)), Ci = (e, t, r) => {
17
+ }, Ui = (e, t, r) => (ga(e, t, "read from private field"), r ? r.call(e) : t.get(e)), Ci = (e, t, r) => {
18
18
  if (t.has(e))
19
19
  throw TypeError("Cannot add the same private member more than once");
20
20
  t instanceof WeakSet ? t.add(e) : t.set(e, r);
21
- }, Li = (e, t, r, n) => (ma(e, t, "write to private field"), t.set(e, r), r);
21
+ }, Li = (e, t, r, n) => (ga(e, t, "write to private field"), t.set(e, r), r);
22
22
  const Bu = (e) => new Promise((t) => setTimeout(t, e));
23
23
  class Pu {
24
24
  /**
@@ -67,7 +67,7 @@ class Yt {
67
67
  }
68
68
  return await this.parse(s);
69
69
  } catch (s) {
70
- n = oo(s);
70
+ n = so(s);
71
71
  continue;
72
72
  }
73
73
  throw new Error(n || "All APIs failed");
@@ -95,7 +95,7 @@ class Yt {
95
95
  }
96
96
  return await this.parse(s);
97
97
  } catch (s) {
98
- n = oo(s);
98
+ n = so(s);
99
99
  continue;
100
100
  }
101
101
  throw new Error(n || "All APIs failed");
@@ -152,7 +152,7 @@ class Yt {
152
152
  throw new Error(r);
153
153
  }
154
154
  }
155
- function oo(e) {
155
+ function so(e) {
156
156
  return (e == null ? void 0 : e.message) || (e == null ? void 0 : e.toString()) || "unknown error";
157
157
  }
158
158
  const Tn = (e) => new Pu((e == null ? void 0 : e.retryCount) ?? 2, (e == null ? void 0 : e.retryDelay) ?? 1e3), Kt = (e) => e.startsWith("0x") ? e.slice(2) : e;
@@ -206,8 +206,8 @@ function Au(e) {
206
206
  ]);
207
207
  }
208
208
  function Iu(e) {
209
- const t = so.encodingLength(e.length), r = Buffer.allocUnsafe(t);
210
- return so.encode(e.length, r), Buffer.concat([r, e]);
209
+ const t = io.encodingLength(e.length), r = Buffer.allocUnsafe(t);
210
+ return io.encode(e.length, r), Buffer.concat([r, e]);
211
211
  }
212
212
  function Ou(e, t) {
213
213
  if (e.compare(t) > 0) {
@@ -239,19 +239,19 @@ function Cy(e, t) {
239
239
  const Uu = (e) => {
240
240
  switch (e) {
241
241
  case Pr.MAINNET:
242
- return to.Mainnet;
242
+ return eo.Mainnet;
243
243
  case Pr.TESTNET:
244
- return to.Testnet;
244
+ return eo.Testnet;
245
245
  default:
246
246
  throw new Error(`Invalid bitcoin network ${e}`);
247
247
  }
248
248
  };
249
249
  var be = /* @__PURE__ */ ((e) => (e.Created = "Created", e.Matched = "Matched", e.InitiateDetected = "InitiateDetected", e.Initiated = "Initiated", e.CounterPartyInitiateDetected = "CounterPartyInitiateDetected", e.CounterPartyInitiated = "CounterPartyInitiated", e.RedeemDetected = "RedeemDetected", e.Redeemed = "Redeemed", e.CounterPartyRedeemDetected = "CounterPartyRedeemDetected", e.CounterPartyRedeemed = "CounterPartyRedeemed", e.Completed = "Completed", e.CounterPartySwapExpired = "CounterPartySwapExpired", e.Expired = "Expired", e.RefundDetected = "RefundDetected", e.Refunded = "Refunded", e.CounterPartyRefundDetected = "CounterPartyRefundDetected", e.CounterPartyRefunded = "CounterPartyRefunded", e.Cancelled = "Cancelled", e.DeadLineExceeded = "DeadLineExceeded", e))(be || {}), we = /* @__PURE__ */ ((e) => (e.Idle = "Idle", e.InitiateDetected = "InitiateDetected", e.Initiated = "Initiated", e.RedeemDetected = "RedeemDetected", e.Redeemed = "Redeemed", e.RefundDetected = "RefundDetected", e.Refunded = "Refunded", e.Expired = "Expired", e))(we || {});
250
- const _a = (e, t, r) => {
251
- const n = ao(
250
+ const ma = (e, t, r) => {
251
+ const n = oo(
252
252
  e.source_swap,
253
253
  t
254
- ), i = ao(
254
+ ), i = oo(
255
255
  e.destination_swap,
256
256
  r
257
257
  );
@@ -272,7 +272,7 @@ const _a = (e, t, r) => {
272
272
  e.create_order.additional_data.deadline
273
273
  );
274
274
  return i === we.Initiated ? be.CounterPartyInitiated : i === we.InitiateDetected ? be.CounterPartyInitiateDetected : Yn(s, 12) ? be.DeadLineExceeded : n === we.Initiated ? be.Initiated : Yn(s, 1) ? be.DeadLineExceeded : n === we.InitiateDetected ? be.InitiateDetected : n === we.Redeemed ? be.CounterPartyRedeemed : n === we.RedeemDetected ? be.CounterPartyRedeemDetected : be.Matched;
275
- }, ao = (e, t) => {
275
+ }, oo = (e, t) => {
276
276
  if (e.redeem_tx_hash)
277
277
  return Number(e.redeem_block_number) ? we.Redeemed : we.RedeemDetected;
278
278
  if (e.refund_tx_hash)
@@ -283,13 +283,13 @@ const _a = (e, t, r) => {
283
283
  }
284
284
  return e.initiate_tx_hash ? Number(e.initiate_block_number) ? we.Initiated : we.InitiateDetected : we.Idle;
285
285
  }, Ly = (e, t, r) => {
286
- const n = _a(
286
+ const n = ma(
287
287
  e,
288
288
  t,
289
289
  r
290
290
  );
291
- return va(n);
292
- }, va = (e) => {
291
+ return _a(n);
292
+ }, _a = (e) => {
293
293
  switch (e) {
294
294
  case be.Matched:
295
295
  return Pe.Initiate;
@@ -305,7 +305,7 @@ const _a = (e, t, r) => {
305
305
  }, Yn = (e, t = 0) => {
306
306
  const r = Date.now(), n = e * 1e3 + t * 36e5;
307
307
  return r >= n;
308
- }, Ny = (e) => e.filter((t) => !Ea(t)), Ea = (e) => {
308
+ }, Ny = (e) => e.filter((t) => !va(t)), va = (e) => {
309
309
  const { source_swap: t, create_order: r } = e, { initiate_tx_hash: n, initiate_block_number: i } = t, { deadline: s } = r.additional_data;
310
310
  return n && Number(i) ? !1 : n && !Number(i) ? Yn(Number(s), 12) : n ? !1 : Yn(Number(s), 1);
311
311
  }, Cu = [
@@ -714,13 +714,13 @@ class Lu {
714
714
  return j("Invalid order");
715
715
  const s = Fn(n.secret_hash), o = BigInt(n.timelock), a = Fn(i.redeemer), c = BigInt(i.amount);
716
716
  try {
717
- const l = await this.auth.getToken();
717
+ const l = await this.auth.getAuthHeaders();
718
718
  if (l.error) return j(l.error);
719
719
  const d = _u({
720
720
  address: Fn(r.source_swap.asset),
721
721
  abi: Cu,
722
722
  client: t
723
- }), g = await d.read.token(), x = await yu(
723
+ }), g = await d.read.token(), x = await pu(
724
724
  Number(c),
725
725
  g,
726
726
  r.source_swap.asset,
@@ -750,7 +750,10 @@ class Lu {
750
750
  amount: c,
751
751
  secretHash: s
752
752
  }
753
- }), B = await Yt.post(
753
+ }), A = {
754
+ ...l.val,
755
+ "Content-Type": "application/json"
756
+ }, T = await Yt.post(
754
757
  this.url.endpoint("initiate"),
755
758
  {
756
759
  body: JSON.stringify({
@@ -758,20 +761,17 @@ class Lu {
758
761
  signature: O,
759
762
  perform_on: "Source"
760
763
  }),
761
- headers: {
762
- Authorization: Qs(l.val),
763
- "Content-Type": "application/json"
764
- }
764
+ headers: A
765
765
  }
766
766
  );
767
- return B.error ? j(B.error) : B.result ? re(B.result) : j("Init: No result found");
767
+ return T.error ? j(T.error) : T.result ? re(T.result) : j("Init: No result found");
768
768
  } catch (l) {
769
769
  return console.log("init error :", l), j(String(l));
770
770
  }
771
771
  }
772
772
  async redeem(t, r) {
773
773
  try {
774
- const n = await this.auth.getToken();
774
+ const n = await this.auth.getAuthHeaders();
775
775
  if (n.error) return j(n.error);
776
776
  const i = await Yt.post(
777
777
  this.url.endpoint("redeem"),
@@ -782,7 +782,7 @@ class Lu {
782
782
  perform_on: "Destination"
783
783
  }),
784
784
  headers: {
785
- Authorization: Qs(n.val),
785
+ ...n.val,
786
786
  "Content-Type": "application/json"
787
787
  }
788
788
  }
@@ -802,7 +802,7 @@ const Nu = Buffer.from(
802
802
  ), Mu = Buffer.concat([Nu, Fu]), Hu = Buffer.from(
803
803
  "0250929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0",
804
804
  "hex"
805
- ), fo = {
805
+ ), ao = {
806
806
  failedToCreateInternalPubkey: "failed to create internal pubkey",
807
807
  failedToTweakPubkey: "failed to tweak pubkey"
808
808
  };
@@ -812,16 +812,16 @@ function $u() {
812
812
  e
813
813
  );
814
814
  if (!t)
815
- throw new Error(fo.failedToCreateInternalPubkey);
815
+ throw new Error(ao.failedToCreateInternalPubkey);
816
816
  const r = Qt.pointAdd(Hu, t);
817
- if (!r) throw new Error(fo.failedToCreateInternalPubkey);
817
+ if (!r) throw new Error(ao.failedToCreateInternalPubkey);
818
818
  return hs(Buffer.from(r));
819
819
  }
820
820
  var Mt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
821
821
  function Du(e) {
822
822
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
823
823
  }
824
- function xa(e) {
824
+ function Ea(e) {
825
825
  if (e.__esModule) return e;
826
826
  var t = e.default;
827
827
  if (typeof t == "function") {
@@ -849,7 +849,7 @@ for (var yr = 0, Gu = Ni.length; yr < Gu; ++yr)
849
849
  ct[yr] = Ni[yr], Xe[Ni.charCodeAt(yr)] = yr;
850
850
  Xe[45] = 62;
851
851
  Xe[95] = 63;
852
- function Sa(e) {
852
+ function xa(e) {
853
853
  var t = e.length;
854
854
  if (t % 4 > 0)
855
855
  throw new Error("Invalid string. Length must be a multiple of 4");
@@ -859,14 +859,14 @@ function Sa(e) {
859
859
  return [r, n];
860
860
  }
861
861
  function Wu(e) {
862
- var t = Sa(e), r = t[0], n = t[1];
862
+ var t = xa(e), r = t[0], n = t[1];
863
863
  return (r + n) * 3 / 4 - n;
864
864
  }
865
865
  function Vu(e, t, r) {
866
866
  return (t + r) * 3 / 4 - r;
867
867
  }
868
868
  function zu(e) {
869
- var t, r = Sa(e), n = r[0], i = r[1], s = new ju(Vu(e, n, i)), o = 0, a = i > 0 ? n - 4 : n, c;
869
+ var t, r = xa(e), n = r[0], i = r[1], s = new ju(Vu(e, n, i)), o = 0, a = i > 0 ? n - 4 : n, c;
870
870
  for (c = 0; c < a; c += 4)
871
871
  t = Xe[e.charCodeAt(c)] << 18 | Xe[e.charCodeAt(c + 1)] << 12 | Xe[e.charCodeAt(c + 2)] << 6 | Xe[e.charCodeAt(c + 3)], s[o++] = t >> 16 & 255, s[o++] = t >> 8 & 255, s[o++] = t & 255;
872
872
  return i === 2 && (t = Xe[e.charCodeAt(c)] << 2 | Xe[e.charCodeAt(c + 1)] >> 4, s[o++] = t & 255), i === 1 && (t = Xe[e.charCodeAt(c)] << 10 | Xe[e.charCodeAt(c + 1)] << 4 | Xe[e.charCodeAt(c + 2)] >> 2, s[o++] = t >> 8 & 255, s[o++] = t & 255), s;
@@ -906,12 +906,12 @@ Ss.read = function(e, t, r, n, i) {
906
906
  return (y ? -1 : 1) * o * Math.pow(2, s - n);
907
907
  };
908
908
  Ss.write = function(e, t, r, n, i, s) {
909
- var o, a, c, l = s * 8 - i - 1, d = (1 << l) - 1, g = d >> 1, x = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, y = n ? 0 : s - 1, O = n ? 1 : -1, B = t < 0 || t === 0 && 1 / t < 0 ? 1 : 0;
909
+ var o, a, c, l = s * 8 - i - 1, d = (1 << l) - 1, g = d >> 1, x = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, y = n ? 0 : s - 1, O = n ? 1 : -1, A = t < 0 || t === 0 && 1 / t < 0 ? 1 : 0;
910
910
  for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (a = isNaN(t) ? 1 : 0, o = d) : (o = Math.floor(Math.log(t) / Math.LN2), t * (c = Math.pow(2, -o)) < 1 && (o--, c *= 2), o + g >= 1 ? t += x / c : t += x * Math.pow(2, 1 - g), t * c >= 2 && (o++, c /= 2), o + g >= d ? (a = 0, o = d) : o + g >= 1 ? (a = (t * c - 1) * Math.pow(2, i), o = o + g) : (a = t * Math.pow(2, g - 1) * Math.pow(2, i), o = 0)); i >= 8; e[r + y] = a & 255, y += O, a /= 256, i -= 8)
911
911
  ;
912
912
  for (o = o << i | a, l += i; l > 0; e[r + y] = o & 255, y += O, o /= 256, l -= 8)
913
913
  ;
914
- e[r + y - O] |= B * 128;
914
+ e[r + y - O] |= A * 128;
915
915
  };
916
916
  /*!
917
917
  * The buffer module from node.js, for the browser.
@@ -976,7 +976,7 @@ Ss.write = function(e, t, r, n, i, s) {
976
976
  "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof h
977
977
  );
978
978
  if (Ve(h, ArrayBuffer) || h && Ve(h.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (Ve(h, SharedArrayBuffer) || h && Ve(h.buffer, SharedArrayBuffer)))
979
- return B(h, f, u);
979
+ return A(h, f, u);
980
980
  if (typeof h == "number")
981
981
  throw new TypeError(
982
982
  'The "value" argument must not be of type number. Received type number'
@@ -984,7 +984,7 @@ Ss.write = function(e, t, r, n, i, s) {
984
984
  const p = h.valueOf && h.valueOf();
985
985
  if (p != null && p !== h)
986
986
  return a.from(p, f, u);
987
- const v = A(h);
987
+ const v = T(h);
988
988
  if (v) return v;
989
989
  if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof h[Symbol.toPrimitive] == "function")
990
990
  return a.from(h[Symbol.toPrimitive]("string"), f, u);
@@ -1032,11 +1032,11 @@ Ss.write = function(e, t, r, n, i, s) {
1032
1032
  function O(h) {
1033
1033
  if (Ve(h, Uint8Array)) {
1034
1034
  const f = new Uint8Array(h);
1035
- return B(f.buffer, f.byteOffset, f.byteLength);
1035
+ return A(f.buffer, f.byteOffset, f.byteLength);
1036
1036
  }
1037
1037
  return y(h);
1038
1038
  }
1039
- function B(h, f, u) {
1039
+ function A(h, f, u) {
1040
1040
  if (f < 0 || h.byteLength < f)
1041
1041
  throw new RangeError('"offset" is outside of buffer bounds');
1042
1042
  if (h.byteLength < f + (u || 0))
@@ -1044,7 +1044,7 @@ Ss.write = function(e, t, r, n, i, s) {
1044
1044
  let p;
1045
1045
  return f === void 0 && u === void 0 ? p = new Uint8Array(h) : u === void 0 ? p = new Uint8Array(h, f) : p = new Uint8Array(h, f, u), Object.setPrototypeOf(p, a.prototype), p;
1046
1046
  }
1047
- function A(h) {
1047
+ function T(h) {
1048
1048
  if (a.isBuffer(h)) {
1049
1049
  const f = k(h.length) | 0, u = o(f);
1050
1050
  return u.length === 0 || h.copy(u, 0, 0, f), u;
@@ -1619,21 +1619,21 @@ Ss.write = function(e, t, r, n, i, s) {
1619
1619
  if (u + p > h.length) throw new RangeError("Index out of range");
1620
1620
  if (u < 0) throw new RangeError("Index out of range");
1621
1621
  }
1622
- function T(h, f, u, p, v) {
1622
+ function P(h, f, u, p, v) {
1623
1623
  return f = +f, u = u >>> 0, v || ht(h, f, u, 4), r.write(h, f, u, p, 23, 4), u + 4;
1624
1624
  }
1625
1625
  a.prototype.writeFloatLE = function(f, u, p) {
1626
- return T(this, f, u, !0, p);
1626
+ return P(this, f, u, !0, p);
1627
1627
  }, a.prototype.writeFloatBE = function(f, u, p) {
1628
- return T(this, f, u, !1, p);
1628
+ return P(this, f, u, !1, p);
1629
1629
  };
1630
- function P(h, f, u, p, v) {
1630
+ function B(h, f, u, p, v) {
1631
1631
  return f = +f, u = u >>> 0, v || ht(h, f, u, 8), r.write(h, f, u, p, 52, 8), u + 8;
1632
1632
  }
1633
1633
  a.prototype.writeDoubleLE = function(f, u, p) {
1634
- return P(this, f, u, !0, p);
1634
+ return B(this, f, u, !0, p);
1635
1635
  }, a.prototype.writeDoubleBE = function(f, u, p) {
1636
- return P(this, f, u, !1, p);
1636
+ return B(this, f, u, !1, p);
1637
1637
  }, a.prototype.copy = function(f, u, p, v) {
1638
1638
  if (!a.isBuffer(f)) throw new TypeError("argument should be a Buffer");
1639
1639
  if (p || (p = 0), !v && v !== 0 && (v = this.length), u >= f.length && (u = f.length), u || (u = 0), v > 0 && v < p && (v = p), v === p || f.length === 0 || this.length === 0) return 0;
@@ -1884,16 +1884,16 @@ var cn = {
1884
1884
  }
1885
1885
  };
1886
1886
  cn.Null = cn.Nil;
1887
- for (var uo in cn)
1888
- cn[uo].toJSON = (function(e) {
1887
+ for (var fo in cn)
1888
+ cn[fo].toJSON = (function(e) {
1889
1889
  return e;
1890
- }).bind(null, uo);
1890
+ }).bind(null, fo);
1891
1891
  var Bs = cn, Xt = Bs;
1892
- function Ba(e) {
1892
+ function Sa(e) {
1893
1893
  return e.name || e.toString().match(/function (.*?)\s*\(/)[1];
1894
1894
  }
1895
1895
  function Ps(e) {
1896
- return Xt.Nil(e) ? "" : Ba(e.constructor);
1896
+ return Xt.Nil(e) ? "" : Sa(e.constructor);
1897
1897
  }
1898
1898
  function Xu(e) {
1899
1899
  return Xt.Function(e) ? "" : Xt.String(e) ? JSON.stringify(e) : e && Xt.Object(e) ? "" : e;
@@ -1902,20 +1902,20 @@ function Ts(e, t) {
1902
1902
  Error.captureStackTrace && Error.captureStackTrace(e, t);
1903
1903
  }
1904
1904
  function Xn(e) {
1905
- return Xt.Function(e) ? e.toJSON ? e.toJSON() : Ba(e) : Xt.Array(e) ? "Array" : e && Xt.Object(e) ? "Object" : e !== void 0 ? e : "";
1905
+ return Xt.Function(e) ? e.toJSON ? e.toJSON() : Sa(e) : Xt.Array(e) ? "Array" : e && Xt.Object(e) ? "Object" : e !== void 0 ? e : "";
1906
1906
  }
1907
- function Pa(e, t, r) {
1907
+ function Ba(e, t, r) {
1908
1908
  var n = Xu(t);
1909
1909
  return "Expected " + Xn(e) + ", got" + (r !== "" ? " " + r : "") + (n !== "" ? " " + n : "");
1910
1910
  }
1911
1911
  function vt(e, t, r) {
1912
- r = r || Ps(t), this.message = Pa(e, t, r), Ts(this, vt), this.__type = e, this.__value = t, this.__valueTypeName = r;
1912
+ r = r || Ps(t), this.message = Ba(e, t, r), Ts(this, vt), this.__type = e, this.__value = t, this.__valueTypeName = r;
1913
1913
  }
1914
1914
  vt.prototype = Object.create(Error.prototype);
1915
1915
  vt.prototype.constructor = vt;
1916
1916
  function Ju(e, t, r, n, i) {
1917
1917
  var s = '" of type ';
1918
- return t === "key" && (s = '" with key type '), Pa('property "' + Xn(r) + s + Xn(e), n, i);
1918
+ return t === "key" && (s = '" with key type '), Ba('property "' + Xn(r) + s + Xn(e), n, i);
1919
1919
  }
1920
1920
  function Er(e, t, r, n, i) {
1921
1921
  e ? (i = i || Ps(n), this.message = Ju(e, r, t, n, i)) : this.message = 'Unexpected property "' + t + '"', Ts(this, vt), this.__label = r, this.__property = t, this.__type = e, this.__value = n, this.__valueTypeName = i;
@@ -1940,18 +1940,18 @@ function Zu(e, t, r) {
1940
1940
  e.__valueTypeName
1941
1941
  )), Ts(e), e;
1942
1942
  }
1943
- var Ta = {
1943
+ var Pa = {
1944
1944
  TfTypeError: vt,
1945
1945
  TfPropertyTypeError: Er,
1946
1946
  tfCustomError: Qu,
1947
1947
  tfSubError: Zu,
1948
1948
  tfJSON: Xn,
1949
1949
  getValueTypeName: Ps
1950
- }, Fi, co;
1950
+ }, Fi, uo;
1951
1951
  function ec() {
1952
- if (co) return Fi;
1953
- co = 1;
1954
- var e = Bs, t = Ta;
1952
+ if (uo) return Fi;
1953
+ uo = 1;
1954
+ var e = Bs, t = Pa;
1955
1955
  function r(E) {
1956
1956
  return Buffer.isBuffer(E);
1957
1957
  }
@@ -1992,10 +1992,10 @@ function ec() {
1992
1992
  function O(E) {
1993
1993
  return (E | 0) === E;
1994
1994
  }
1995
- function B(E) {
1995
+ function A(E) {
1996
1996
  return typeof E == "number" && E >= -d && E <= d && Math.floor(E) === E;
1997
1997
  }
1998
- function A(E) {
1998
+ function T(E) {
1999
1999
  return (E & 255) === E;
2000
2000
  }
2001
2001
  function k(E) {
@@ -2017,10 +2017,10 @@ function ec() {
2017
2017
  Int8: x,
2018
2018
  Int16: y,
2019
2019
  Int32: O,
2020
- Int53: B,
2020
+ Int53: A,
2021
2021
  Range: l,
2022
2022
  StringN: c,
2023
- UInt8: A,
2023
+ UInt8: T,
2024
2024
  UInt16: k,
2025
2025
  UInt32: U,
2026
2026
  UInt53: _
@@ -2031,7 +2031,7 @@ function ec() {
2031
2031
  }).bind(null, S);
2032
2032
  return Fi = m, Fi;
2033
2033
  }
2034
- var dn = Ta, Te = Bs, lt = dn.tfJSON, Aa = dn.TfTypeError, Ia = dn.TfPropertyTypeError, $r = dn.tfSubError, tc = dn.getValueTypeName, gt = {
2034
+ var dn = Pa, Te = Bs, lt = dn.tfJSON, Ta = dn.TfTypeError, Aa = dn.TfPropertyTypeError, $r = dn.tfSubError, tc = dn.getValueTypeName, gt = {
2035
2035
  arrayOf: function(t, r) {
2036
2036
  t = ut(t), r = r || {};
2037
2037
  function n(i, s) {
@@ -2100,7 +2100,7 @@ var dn = Ta, Te = Bs, lt = dn.tfJSON, Aa = dn.TfTypeError, Ia = dn.TfPropertyTyp
2100
2100
  if (o) {
2101
2101
  for (a in s)
2102
2102
  if (!r[a])
2103
- throw new Ia(void 0, a);
2103
+ throw new Aa(void 0, a);
2104
2104
  }
2105
2105
  return !0;
2106
2106
  }
@@ -2187,7 +2187,7 @@ function ut(e) {
2187
2187
  function De(e, t, r, n) {
2188
2188
  if (Te.Function(e)) {
2189
2189
  if (e(t, r)) return !0;
2190
- throw new Aa(n || e, t);
2190
+ throw new Ta(n || e, t);
2191
2191
  }
2192
2192
  return De(ut(e), t, r);
2193
2193
  }
@@ -2195,17 +2195,17 @@ for (var Nt in Te)
2195
2195
  De[Nt] = Te[Nt];
2196
2196
  for (Nt in gt)
2197
2197
  De[Nt] = gt[Nt];
2198
- var ho = ec();
2199
- for (Nt in ho)
2200
- De[Nt] = ho[Nt];
2198
+ var co = ec();
2199
+ for (Nt in co)
2200
+ De[Nt] = co[Nt];
2201
2201
  De.compile = ut;
2202
- De.TfTypeError = Aa;
2203
- De.TfPropertyTypeError = Ia;
2204
- var Oa = De;
2202
+ De.TfTypeError = Ta;
2203
+ De.TfPropertyTypeError = Aa;
2204
+ var Ia = De;
2205
2205
  (function(e) {
2206
2206
  Object.defineProperty(e, "__esModule", { value: !0 }), e.oneOf = e.Null = e.BufferN = e.Function = e.UInt32 = e.UInt8 = e.tuple = e.maybe = e.Hex = e.Buffer = e.String = e.Boolean = e.Array = e.Number = e.Hash256bit = e.Hash160bit = e.Buffer256bit = e.isTaptree = e.isTapleaf = e.TAPLEAF_VERSION_MASK = e.Satoshi = e.isPoint = e.stacksEqual = e.typeforce = void 0;
2207
2207
  const t = St;
2208
- e.typeforce = Oa;
2208
+ e.typeforce = Ia;
2209
2209
  const r = t.Buffer.alloc(32, 0), n = t.Buffer.from(
2210
2210
  "fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",
2211
2211
  "hex"
@@ -2241,9 +2241,9 @@ var Oa = De;
2241
2241
  var pn = {}, Ae = {};
2242
2242
  Object.defineProperty(Ae, "__esModule", { value: !0 });
2243
2243
  Ae.BufferReader = Ae.BufferWriter = Ae.cloneBuffer = Ae.reverseBuffer = Ae.writeUInt64LE = Ae.readUInt64LE = Ae.varuint = void 0;
2244
- const Jt = Le, { typeforce: ka } = Jt, hn = Eu;
2244
+ const Jt = Le, { typeforce: Oa } = Jt, hn = Eu;
2245
2245
  Ae.varuint = hn;
2246
- function Ra(e, t) {
2246
+ function ka(e, t) {
2247
2247
  if (typeof e != "number")
2248
2248
  throw new Error("cannot write a non-number as a number");
2249
2249
  if (e < 0)
@@ -2252,16 +2252,16 @@ function Ra(e, t) {
2252
2252
  if (Math.floor(e) !== e)
2253
2253
  throw new Error("value has a fractional component");
2254
2254
  }
2255
- function Ua(e, t) {
2255
+ function Ra(e, t) {
2256
2256
  const r = e.readUInt32LE(t);
2257
2257
  let n = e.readUInt32LE(t + 4);
2258
- return n *= 4294967296, Ra(n + r, 9007199254740991), n + r;
2258
+ return n *= 4294967296, ka(n + r, 9007199254740991), n + r;
2259
2259
  }
2260
- Ae.readUInt64LE = Ua;
2261
- function Ca(e, t, r) {
2262
- return Ra(t, 9007199254740991), e.writeInt32LE(t & -1, r), e.writeUInt32LE(Math.floor(t / 4294967296), r + 4), r + 8;
2260
+ Ae.readUInt64LE = Ra;
2261
+ function Ua(e, t, r) {
2262
+ return ka(t, 9007199254740991), e.writeInt32LE(t & -1, r), e.writeUInt32LE(Math.floor(t / 4294967296), r + 4), r + 8;
2263
2263
  }
2264
- Ae.writeUInt64LE = Ca;
2264
+ Ae.writeUInt64LE = Ua;
2265
2265
  function rc(e) {
2266
2266
  if (e.length < 1) return e;
2267
2267
  let t = e.length - 1, r = 0;
@@ -2280,7 +2280,7 @@ class As {
2280
2280
  return new As(Buffer.alloc(t));
2281
2281
  }
2282
2282
  constructor(t, r = 0) {
2283
- this.buffer = t, this.offset = r, ka(Jt.tuple(Jt.Buffer, Jt.UInt32), [t, r]);
2283
+ this.buffer = t, this.offset = r, Oa(Jt.tuple(Jt.Buffer, Jt.UInt32), [t, r]);
2284
2284
  }
2285
2285
  writeUInt8(t) {
2286
2286
  this.offset = this.buffer.writeUInt8(t, this.offset);
@@ -2292,7 +2292,7 @@ class As {
2292
2292
  this.offset = this.buffer.writeUInt32LE(t, this.offset);
2293
2293
  }
2294
2294
  writeUInt64(t) {
2295
- this.offset = Ca(this.buffer, t, this.offset);
2295
+ this.offset = Ua(this.buffer, t, this.offset);
2296
2296
  }
2297
2297
  writeVarInt(t) {
2298
2298
  hn.encode(t, this.buffer, this.offset), this.offset += hn.encode.bytes;
@@ -2317,7 +2317,7 @@ class As {
2317
2317
  Ae.BufferWriter = As;
2318
2318
  class ic {
2319
2319
  constructor(t, r = 0) {
2320
- this.buffer = t, this.offset = r, ka(Jt.tuple(Jt.Buffer, Jt.UInt32), [t, r]);
2320
+ this.buffer = t, this.offset = r, Oa(Jt.tuple(Jt.Buffer, Jt.UInt32), [t, r]);
2321
2321
  }
2322
2322
  readUInt8() {
2323
2323
  const t = this.buffer.readUInt8(this.offset);
@@ -2332,7 +2332,7 @@ class ic {
2332
2332
  return this.offset += 4, t;
2333
2333
  }
2334
2334
  readUInt64() {
2335
- const t = Ua(this.buffer, this.offset);
2335
+ const t = Ra(this.buffer, this.offset);
2336
2336
  return this.offset += 8, t;
2337
2337
  }
2338
2338
  readVarInt() {
@@ -2357,48 +2357,48 @@ class ic {
2357
2357
  Ae.BufferReader = ic;
2358
2358
  var $t = {}, Tr = {}, mt = {}, et = {};
2359
2359
  Object.defineProperty(et, "__esModule", { value: !0 });
2360
- et.isBytes = Na;
2360
+ et.isBytes = La;
2361
2361
  et.number = Jn;
2362
- et.bool = La;
2362
+ et.bool = Ca;
2363
2363
  et.bytes = Is;
2364
- et.hash = Fa;
2365
- et.exists = Ma;
2366
- et.output = Ha;
2364
+ et.hash = Na;
2365
+ et.exists = Fa;
2366
+ et.output = Ma;
2367
2367
  function Jn(e) {
2368
2368
  if (!Number.isSafeInteger(e) || e < 0)
2369
2369
  throw new Error(`positive integer expected, not ${e}`);
2370
2370
  }
2371
- function La(e) {
2371
+ function Ca(e) {
2372
2372
  if (typeof e != "boolean")
2373
2373
  throw new Error(`boolean expected, not ${e}`);
2374
2374
  }
2375
- function Na(e) {
2375
+ function La(e) {
2376
2376
  return e instanceof Uint8Array || e != null && typeof e == "object" && e.constructor.name === "Uint8Array";
2377
2377
  }
2378
2378
  function Is(e, ...t) {
2379
- if (!Na(e))
2379
+ if (!La(e))
2380
2380
  throw new Error("Uint8Array expected");
2381
2381
  if (t.length > 0 && !t.includes(e.length))
2382
2382
  throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`);
2383
2383
  }
2384
- function Fa(e) {
2384
+ function Na(e) {
2385
2385
  if (typeof e != "function" || typeof e.create != "function")
2386
2386
  throw new Error("Hash should be wrapped by utils.wrapConstructor");
2387
2387
  Jn(e.outputLen), Jn(e.blockLen);
2388
2388
  }
2389
- function Ma(e, t = !0) {
2389
+ function Fa(e, t = !0) {
2390
2390
  if (e.destroyed)
2391
2391
  throw new Error("Hash instance has been destroyed");
2392
2392
  if (t && e.finished)
2393
2393
  throw new Error("Hash#digest() has already been called");
2394
2394
  }
2395
- function Ha(e, t) {
2395
+ function Ma(e, t) {
2396
2396
  Is(e);
2397
2397
  const r = t.outputLen;
2398
2398
  if (e.length < r)
2399
2399
  throw new Error(`digestInto() expects output buffer of length at least ${r}`);
2400
2400
  }
2401
- const sc = { number: Jn, bool: La, bytes: Is, hash: Fa, exists: Ma, output: Ha };
2401
+ const sc = { number: Jn, bool: Ca, bytes: Is, hash: Na, exists: Fa, output: Ma };
2402
2402
  et.default = sc;
2403
2403
  var ui = {}, ci = {};
2404
2404
  Object.defineProperty(ci, "__esModule", { value: !0 });
@@ -2406,7 +2406,7 @@ ci.crypto = void 0;
2406
2406
  ci.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
2407
2407
  (function(e) {
2408
2408
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
2409
- Object.defineProperty(e, "__esModule", { value: !0 }), e.Hash = e.nextTick = e.byteSwapIfBE = e.byteSwap = e.isLE = e.rotl = e.rotr = e.createView = e.u32 = e.u8 = void 0, e.isBytes = n, e.byteSwap32 = d, e.bytesToHex = x, e.hexToBytes = B, e.asyncLoop = k, e.utf8ToBytes = U, e.toBytes = _, e.concatBytes = m, e.checkOpts = H, e.wrapConstructor = D, e.wrapConstructorWithOpts = R, e.wrapXOFConstructorWithOpts = z, e.randomBytes = Z;
2409
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.Hash = e.nextTick = e.byteSwapIfBE = e.byteSwap = e.isLE = e.rotl = e.rotr = e.createView = e.u32 = e.u8 = void 0, e.isBytes = n, e.byteSwap32 = d, e.bytesToHex = x, e.hexToBytes = A, e.asyncLoop = k, e.utf8ToBytes = U, e.toBytes = _, e.concatBytes = m, e.checkOpts = H, e.wrapConstructor = D, e.wrapConstructorWithOpts = R, e.wrapXOFConstructorWithOpts = z, e.randomBytes = Z;
2410
2410
  const t = ci, r = et;
2411
2411
  function n(C) {
2412
2412
  return C instanceof Uint8Array || C != null && typeof C == "object" && C.constructor.name === "Uint8Array";
@@ -2444,7 +2444,7 @@ ci.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
2444
2444
  if (C >= y._a && C <= y._f)
2445
2445
  return C - (y._a - 10);
2446
2446
  }
2447
- function B(C) {
2447
+ function A(C) {
2448
2448
  if (typeof C != "string")
2449
2449
  throw new Error("hex string expected, got " + typeof C);
2450
2450
  const M = C.length, W = M / 2;
@@ -2461,9 +2461,9 @@ ci.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis
2461
2461
  }
2462
2462
  return q;
2463
2463
  }
2464
- const A = async () => {
2464
+ const T = async () => {
2465
2465
  };
2466
- e.nextTick = A;
2466
+ e.nextTick = T;
2467
2467
  async function k(C, M, W) {
2468
2468
  let q = Date.now();
2469
2469
  for (let ae = 0; ae < C; ae++) {
@@ -2592,18 +2592,18 @@ let uc = class extends Dr.Hash {
2592
2592
  mt.HashMD = uc;
2593
2593
  Object.defineProperty(Tr, "__esModule", { value: !0 });
2594
2594
  Tr.ripemd160 = Tr.RIPEMD160 = void 0;
2595
- const cc = mt, rn = ui, hc = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]), $a = /* @__PURE__ */ new Uint8Array(new Array(16).fill(0).map((e, t) => t)), lc = /* @__PURE__ */ $a.map((e) => (9 * e + 5) % 16);
2596
- let Os = [$a], ks = [lc];
2595
+ const cc = mt, rn = ui, hc = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]), Ha = /* @__PURE__ */ new Uint8Array(new Array(16).fill(0).map((e, t) => t)), lc = /* @__PURE__ */ Ha.map((e) => (9 * e + 5) % 16);
2596
+ let Os = [Ha], ks = [lc];
2597
2597
  for (let e = 0; e < 4; e++)
2598
2598
  for (let t of [Os, ks])
2599
2599
  t.push(t[e].map((r) => hc[r]));
2600
- const Da = /* @__PURE__ */ [
2600
+ const $a = /* @__PURE__ */ [
2601
2601
  [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],
2602
2602
  [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],
2603
2603
  [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],
2604
2604
  [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],
2605
2605
  [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5]
2606
- ].map((e) => new Uint8Array(e)), dc = /* @__PURE__ */ Os.map((e, t) => e.map((r) => Da[t][r])), pc = /* @__PURE__ */ ks.map((e, t) => e.map((r) => Da[t][r])), yc = /* @__PURE__ */ new Uint32Array([
2606
+ ].map((e) => new Uint8Array(e)), dc = /* @__PURE__ */ Os.map((e, t) => e.map((r) => $a[t][r])), pc = /* @__PURE__ */ ks.map((e, t) => e.map((r) => $a[t][r])), yc = /* @__PURE__ */ new Uint32Array([
2607
2607
  0,
2608
2608
  1518500249,
2609
2609
  1859775393,
@@ -2616,11 +2616,11 @@ const Da = /* @__PURE__ */ [
2616
2616
  2053994217,
2617
2617
  0
2618
2618
  ]);
2619
- function lo(e, t, r, n) {
2619
+ function ho(e, t, r, n) {
2620
2620
  return e === 0 ? t ^ r ^ n : e === 1 ? t & r | ~t & n : e === 2 ? (t | ~r) ^ n : e === 3 ? t & n | r & ~n : t ^ (r | ~n);
2621
2621
  }
2622
2622
  const An = /* @__PURE__ */ new Uint32Array(16);
2623
- let ja = class extends cc.HashMD {
2623
+ let Da = class extends cc.HashMD {
2624
2624
  constructor() {
2625
2625
  super(64, 20, 8, !0), this.h0 = 1732584193, this.h1 = -271733879, this.h2 = -1732584194, this.h3 = 271733878, this.h4 = -1009589776;
2626
2626
  }
@@ -2636,13 +2636,13 @@ let ja = class extends cc.HashMD {
2636
2636
  An[y] = t.getUint32(r, !0);
2637
2637
  let n = this.h0 | 0, i = n, s = this.h1 | 0, o = s, a = this.h2 | 0, c = a, l = this.h3 | 0, d = l, g = this.h4 | 0, x = g;
2638
2638
  for (let y = 0; y < 5; y++) {
2639
- const O = 4 - y, B = yc[y], A = bc[y], k = Os[y], U = ks[y], _ = dc[y], m = pc[y];
2639
+ const O = 4 - y, A = yc[y], T = bc[y], k = Os[y], U = ks[y], _ = dc[y], m = pc[y];
2640
2640
  for (let S = 0; S < 16; S++) {
2641
- const E = (0, rn.rotl)(n + lo(y, s, a, l) + An[k[S]] + B, _[S]) + g | 0;
2641
+ const E = (0, rn.rotl)(n + ho(y, s, a, l) + An[k[S]] + A, _[S]) + g | 0;
2642
2642
  n = g, g = l, l = (0, rn.rotl)(a, 10) | 0, a = s, s = E;
2643
2643
  }
2644
2644
  for (let S = 0; S < 16; S++) {
2645
- const E = (0, rn.rotl)(i + lo(O, o, c, d) + An[U[S]] + A, m[S]) + x | 0;
2645
+ const E = (0, rn.rotl)(i + ho(O, o, c, d) + An[U[S]] + T, m[S]) + x | 0;
2646
2646
  i = x, x = d, d = (0, rn.rotl)(c, 10) | 0, c = o, o = E;
2647
2647
  }
2648
2648
  }
@@ -2655,8 +2655,8 @@ let ja = class extends cc.HashMD {
2655
2655
  this.destroyed = !0, this.buffer.fill(0), this.set(0, 0, 0, 0, 0);
2656
2656
  }
2657
2657
  };
2658
- Tr.RIPEMD160 = ja;
2659
- Tr.ripemd160 = (0, rn.wrapConstructor)(() => new ja());
2658
+ Tr.RIPEMD160 = Da;
2659
+ Tr.ripemd160 = (0, rn.wrapConstructor)(() => new Da());
2660
2660
  var Ar = {};
2661
2661
  Object.defineProperty(Ar, "__esModule", { value: !0 });
2662
2662
  Ar.sha1 = Ar.SHA1 = void 0;
@@ -2667,7 +2667,7 @@ const Hi = mt, Dn = ui, jr = /* @__PURE__ */ new Uint32Array([
2667
2667
  271733878,
2668
2668
  3285377520
2669
2669
  ]), At = /* @__PURE__ */ new Uint32Array(80);
2670
- class Ga extends Hi.HashMD {
2670
+ class ja extends Hi.HashMD {
2671
2671
  constructor() {
2672
2672
  super(64, 20, 8, !1), this.A = jr[0] | 0, this.B = jr[1] | 0, this.C = jr[2] | 0, this.D = jr[3] | 0, this.E = jr[4] | 0;
2673
2673
  }
@@ -2699,9 +2699,9 @@ class Ga extends Hi.HashMD {
2699
2699
  this.set(0, 0, 0, 0, 0), this.buffer.fill(0);
2700
2700
  }
2701
2701
  }
2702
- Ar.SHA1 = Ga;
2703
- Ar.sha1 = (0, Dn.wrapConstructor)(() => new Ga());
2704
- function po(e) {
2702
+ Ar.SHA1 = ja;
2703
+ Ar.sha1 = (0, Dn.wrapConstructor)(() => new ja());
2704
+ function lo(e) {
2705
2705
  if (!Number.isSafeInteger(e) || e < 0)
2706
2706
  throw new Error(`positive integer expected, not ${e}`);
2707
2707
  }
@@ -2720,15 +2720,15 @@ function Qn(e, t = !0) {
2720
2720
  if (t && e.finished)
2721
2721
  throw new Error("Hash#digest() has already been called");
2722
2722
  }
2723
- function Wa(e, t) {
2723
+ function Ga(e, t) {
2724
2724
  Rs(e);
2725
2725
  const r = t.outputLen;
2726
2726
  if (e.length < r)
2727
2727
  throw new Error(`digestInto() expects output buffer of length at least ${r}`);
2728
2728
  }
2729
2729
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
2730
- const gc = (e) => new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4)), $i = (e) => new DataView(e.buffer, e.byteOffset, e.byteLength), nt = (e, t) => e << 32 - t | e >>> t, yo = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68, mc = (e) => e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
2731
- function bo(e) {
2730
+ const gc = (e) => new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4)), $i = (e) => new DataView(e.buffer, e.byteOffset, e.byteLength), nt = (e, t) => e << 32 - t | e >>> t, po = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68, mc = (e) => e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
2731
+ function yo(e) {
2732
2732
  for (let t = 0; t < e.length; t++)
2733
2733
  e[t] = mc(e[t]);
2734
2734
  }
@@ -2740,7 +2740,7 @@ function _c(e) {
2740
2740
  function Us(e) {
2741
2741
  return typeof e == "string" && (e = _c(e)), Rs(e), e;
2742
2742
  }
2743
- let Va = class {
2743
+ let Wa = class {
2744
2744
  // Safe version that clones internal state
2745
2745
  clone() {
2746
2746
  return this._cloneInto();
@@ -2757,7 +2757,7 @@ function vc(e, t, r, n) {
2757
2757
  e.setUint32(t + c, o, n), e.setUint32(t + l, a, n);
2758
2758
  }
2759
2759
  const Ec = (e, t, r) => e & t ^ ~e & r, xc = (e, t, r) => e & t ^ e & r ^ t & r;
2760
- class Sc extends Va {
2760
+ class Sc extends Wa {
2761
2761
  constructor(t, r, n, i) {
2762
2762
  super(), this.blockLen = t, this.outputLen = r, this.padOffset = n, this.isLE = i, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(t), this.view = $i(this.buffer);
2763
2763
  }
@@ -2779,7 +2779,7 @@ class Sc extends Va {
2779
2779
  return this.length += t.length, this.roundClean(), this;
2780
2780
  }
2781
2781
  digestInto(t) {
2782
- Qn(this), Wa(t, this), this.finished = !0;
2782
+ Qn(this), Ga(t, this), this.finished = !0;
2783
2783
  const { buffer: r, view: n, blockLen: i, isLE: s } = this;
2784
2784
  let { pos: o } = this;
2785
2785
  r[o++] = 128, this.buffer.subarray(o).fill(0), this.padOffset > i - o && (this.process(n, 0), o = 0);
@@ -2898,13 +2898,13 @@ class Ls extends Sc {
2898
2898
  for (let g = 0; g < 16; g++, r += 4)
2899
2899
  Ot[g] = t.getUint32(r, !1);
2900
2900
  for (let g = 16; g < 64; g++) {
2901
- const x = Ot[g - 15], y = Ot[g - 2], O = nt(x, 7) ^ nt(x, 18) ^ x >>> 3, B = nt(y, 17) ^ nt(y, 19) ^ y >>> 10;
2902
- Ot[g] = B + Ot[g - 7] + O + Ot[g - 16] | 0;
2901
+ const x = Ot[g - 15], y = Ot[g - 2], O = nt(x, 7) ^ nt(x, 18) ^ x >>> 3, A = nt(y, 17) ^ nt(y, 19) ^ y >>> 10;
2902
+ Ot[g] = A + Ot[g - 7] + O + Ot[g - 16] | 0;
2903
2903
  }
2904
2904
  let { A: n, B: i, C: s, D: o, E: a, F: c, G: l, H: d } = this;
2905
2905
  for (let g = 0; g < 64; g++) {
2906
- const x = nt(a, 6) ^ nt(a, 11) ^ nt(a, 25), y = d + x + Ec(a, c, l) + Bc[g] + Ot[g] | 0, B = (nt(n, 2) ^ nt(n, 13) ^ nt(n, 22)) + xc(n, i, s) | 0;
2907
- d = l, l = c, c = a, a = o + y | 0, o = s, s = i, i = n, n = y + B | 0;
2906
+ const x = nt(a, 6) ^ nt(a, 11) ^ nt(a, 25), y = d + x + Ec(a, c, l) + Bc[g] + Ot[g] | 0, A = (nt(n, 2) ^ nt(n, 13) ^ nt(n, 22)) + xc(n, i, s) | 0;
2907
+ d = l, l = c, c = a, a = o + y | 0, o = s, s = i, i = n, n = y + A | 0;
2908
2908
  }
2909
2909
  n = n + this.A | 0, i = i + this.B | 0, s = s + this.C | 0, o = o + this.D | 0, a = a + this.E | 0, c = c + this.F | 0, l = l + this.G | 0, d = d + this.H | 0, this.set(n, i, s, o, a, c, l, d);
2910
2910
  }
@@ -2920,15 +2920,15 @@ class Pc extends Ls {
2920
2920
  super(), this.A = -1056596264, this.B = 914150663, this.C = 812702999, this.D = -150054599, this.E = -4191439, this.F = 1750603025, this.G = 1694076839, this.H = -1090891868, this.outputLen = 28;
2921
2921
  }
2922
2922
  }
2923
- const za = /* @__PURE__ */ Cs(() => new Ls()), Tc = /* @__PURE__ */ Cs(() => new Pc()), Ac = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2923
+ const Va = /* @__PURE__ */ Cs(() => new Ls()), Tc = /* @__PURE__ */ Cs(() => new Pc()), Ac = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2924
2924
  __proto__: null,
2925
2925
  SHA256: Ls,
2926
2926
  sha224: Tc,
2927
- sha256: za
2928
- }, Symbol.toStringTag, { value: "Module" })), qa = /* @__PURE__ */ xa(Ac);
2927
+ sha256: Va
2928
+ }, Symbol.toStringTag, { value: "Module" })), za = /* @__PURE__ */ Ea(Ac);
2929
2929
  (function(e) {
2930
2930
  Object.defineProperty(e, "__esModule", { value: !0 }), e.taggedHash = e.TAGGED_HASH_PREFIXES = e.TAGS = e.hash256 = e.hash160 = e.sha256 = e.sha1 = e.ripemd160 = void 0;
2931
- const t = Tr, r = Ar, n = qa;
2931
+ const t = Tr, r = Ar, n = za;
2932
2932
  function i(d) {
2933
2933
  return Buffer.from((0, t.ripemd160)(Uint8Array.from(d)));
2934
2934
  }
@@ -3741,22 +3741,22 @@ const ls = {
3741
3741
  OP_INVALIDOPCODE: 255
3742
3742
  };
3743
3743
  Zt.OPS = ls;
3744
- const Ka = {};
3745
- Zt.REVERSE_OPS = Ka;
3744
+ const qa = {};
3745
+ Zt.REVERSE_OPS = qa;
3746
3746
  for (const e of Object.keys(ls)) {
3747
3747
  const t = ls[e];
3748
- Ka[t] = e;
3748
+ qa[t] = e;
3749
3749
  }
3750
3750
  var Ft = {};
3751
3751
  Object.defineProperty(Ft, "__esModule", { value: !0 });
3752
3752
  Ft.decode = Ft.encode = Ft.encodingLength = void 0;
3753
3753
  const Lt = Zt;
3754
- function Ya(e) {
3754
+ function Ka(e) {
3755
3755
  return e < Lt.OPS.OP_PUSHDATA1 ? 1 : e <= 255 ? 2 : e <= 65535 ? 3 : 5;
3756
3756
  }
3757
- Ft.encodingLength = Ya;
3757
+ Ft.encodingLength = Ka;
3758
3758
  function Rc(e, t, r) {
3759
- const n = Ya(t);
3759
+ const n = Ka(t);
3760
3760
  return n === 1 ? e.writeUInt8(t, r) : n === 2 ? (e.writeUInt8(Lt.OPS.OP_PUSHDATA1, r), e.writeUInt8(t, r + 1)) : n === 3 ? (e.writeUInt8(Lt.OPS.OP_PUSHDATA2, r), e.writeUInt16LE(t, r + 1)) : (e.writeUInt8(Lt.OPS.OP_PUSHDATA4, r), e.writeUInt32LE(t, r + 1)), n;
3761
3761
  }
3762
3762
  Ft.encode = Rc;
@@ -3814,10 +3814,10 @@ function Nc(e) {
3814
3814
  return n[r - 1] & 128 ? n.writeUInt8(i ? 128 : 0, r - 1) : i && (n[r - 1] |= 128), n;
3815
3815
  }
3816
3816
  Ir.encode = Nc;
3817
- var qt = {}, wo;
3817
+ var qt = {}, bo;
3818
3818
  function Fc() {
3819
- if (wo) return qt;
3820
- wo = 1, Object.defineProperty(qt, "__esModule", { value: !0 }), qt.encode = qt.decode = void 0;
3819
+ if (bo) return qt;
3820
+ bo = 1, Object.defineProperty(qt, "__esModule", { value: !0 }), qt.encode = qt.decode = void 0;
3821
3821
  const e = _t, t = qe(), r = Le, { typeforce: n } = r, i = Buffer.alloc(1, 0);
3822
3822
  function s(l) {
3823
3823
  let d = 0;
@@ -3853,9 +3853,9 @@ function Fc() {
3853
3853
  }
3854
3854
  return qt.encode = c, qt;
3855
3855
  }
3856
- var go;
3856
+ var wo;
3857
3857
  function qe() {
3858
- return go || (go = 1, function(e) {
3858
+ return wo || (wo = 1, function(e) {
3859
3859
  Object.defineProperty(e, "__esModule", { value: !0 }), e.signature = e.number = e.isCanonicalScriptSignature = e.isDefinedHashType = e.isCanonicalPubKey = e.toStack = e.fromASM = e.toASM = e.decompile = e.compile = e.countNonPushOnlyOPs = e.isPushOnly = e.OPS = void 0;
3860
3860
  const t = _t, r = Zt;
3861
3861
  Object.defineProperty(e, "OPS", {
@@ -3889,19 +3889,19 @@ function qe() {
3889
3889
  function O(R) {
3890
3890
  return Buffer.isBuffer(R);
3891
3891
  }
3892
- function B(R) {
3892
+ function A(R) {
3893
3893
  return o.Array(R);
3894
3894
  }
3895
- function A(R) {
3895
+ function T(R) {
3896
3896
  return Buffer.isBuffer(R);
3897
3897
  }
3898
3898
  function k(R) {
3899
3899
  if (O(R)) return R;
3900
3900
  a(o.Array, R);
3901
- const z = R.reduce((M, W) => A(W) ? W.length === 1 && y(W) !== void 0 ? M + 1 : M + n.encodingLength(W.length) + W.length : M + 1, 0), Z = Buffer.allocUnsafe(z);
3901
+ const z = R.reduce((M, W) => T(W) ? W.length === 1 && y(W) !== void 0 ? M + 1 : M + n.encodingLength(W.length) + W.length : M + 1, 0), Z = Buffer.allocUnsafe(z);
3902
3902
  let C = 0;
3903
3903
  if (R.forEach((M) => {
3904
- if (A(M)) {
3904
+ if (T(M)) {
3905
3905
  const W = y(M);
3906
3906
  if (W !== void 0) {
3907
3907
  Z.writeUInt8(W, C), C += 1;
@@ -3915,7 +3915,7 @@ function qe() {
3915
3915
  }
3916
3916
  e.compile = k;
3917
3917
  function U(R) {
3918
- if (B(R)) return R;
3918
+ if (A(R)) return R;
3919
3919
  a(o.Buffer, R);
3920
3920
  const z = [];
3921
3921
  let Z = 0;
@@ -3938,7 +3938,7 @@ function qe() {
3938
3938
  if (O(R) && (R = U(R)), !R)
3939
3939
  throw new Error("Could not convert invalid chunks to ASM");
3940
3940
  return R.map((z) => {
3941
- if (A(z)) {
3941
+ if (T(z)) {
3942
3942
  const Z = y(z);
3943
3943
  if (Z === void 0) return z.toString("hex");
3944
3944
  z = Z;
@@ -3954,7 +3954,7 @@ function qe() {
3954
3954
  }
3955
3955
  e.fromASM = m;
3956
3956
  function S(R) {
3957
- return R = U(R), a(g, R), R.map((z) => A(z) ? z : z === r.OPS.OP_0 ? Buffer.allocUnsafe(0) : i.encode(z - c));
3957
+ return R = U(R), a(g, R), R.map((z) => T(z) ? z : z === r.OPS.OP_0 ? Buffer.allocUnsafe(0) : i.encode(z - c));
3958
3958
  }
3959
3959
  e.toStack = S;
3960
3960
  function E(R) {
@@ -3974,7 +3974,7 @@ function qe() {
3974
3974
  }
3975
3975
  Object.defineProperty(pn, "__esModule", { value: !0 });
3976
3976
  pn.Transaction = void 0;
3977
- const xe = Ae, Ne = $t, mo = qe(), Mc = qe(), ee = Le, { typeforce: it } = ee;
3977
+ const xe = Ae, Ne = $t, go = qe(), Mc = qe(), ee = Le, { typeforce: it } = ee;
3978
3978
  function at(e) {
3979
3979
  const t = e.length;
3980
3980
  return xe.varuint.encodingLength(t) + t;
@@ -3983,10 +3983,10 @@ function Hc(e) {
3983
3983
  const t = e.length;
3984
3984
  return xe.varuint.encodingLength(t) + e.reduce((r, n) => r + at(n), 0);
3985
3985
  }
3986
- const Ct = Buffer.allocUnsafe(0), _o = [], ji = Buffer.from(
3986
+ const Ct = Buffer.allocUnsafe(0), mo = [], ji = Buffer.from(
3987
3987
  "0000000000000000000000000000000000000000000000000000000000000000",
3988
3988
  "hex"
3989
- ), vo = Buffer.from(
3989
+ ), _o = Buffer.from(
3990
3990
  "0000000000000000000000000000000000000000000000000000000000000001",
3991
3991
  "hex"
3992
3992
  ), $c = Buffer.from("ffffffffffffffff", "hex"), Dc = {
@@ -4013,7 +4013,7 @@ class X {
4013
4013
  index: n.readUInt32(),
4014
4014
  script: n.readVarSlice(),
4015
4015
  sequence: n.readUInt32(),
4016
- witness: _o
4016
+ witness: mo
4017
4017
  });
4018
4018
  const l = n.readVarInt();
4019
4019
  for (let d = 0; d < l; ++d)
@@ -4058,7 +4058,7 @@ class X {
4058
4058
  index: r,
4059
4059
  script: i || Ct,
4060
4060
  sequence: n,
4061
- witness: _o
4061
+ witness: mo
4062
4062
  }) - 1;
4063
4063
  }
4064
4064
  addOutput(t, r) {
@@ -4111,16 +4111,16 @@ class X {
4111
4111
  ee.Number
4112
4112
  ),
4113
4113
  arguments
4114
- ), t >= this.ins.length) return vo;
4115
- const i = mo.compile(
4116
- mo.decompile(r).filter((a) => a !== Mc.OPS.OP_CODESEPARATOR)
4114
+ ), t >= this.ins.length) return _o;
4115
+ const i = go.compile(
4116
+ go.decompile(r).filter((a) => a !== Mc.OPS.OP_CODESEPARATOR)
4117
4117
  ), s = this.clone();
4118
4118
  if ((n & 31) === X.SIGHASH_NONE)
4119
4119
  s.outs = [], s.ins.forEach((a, c) => {
4120
4120
  c !== t && (a.sequence = 0);
4121
4121
  });
4122
4122
  else if ((n & 31) === X.SIGHASH_SINGLE) {
4123
- if (t >= this.outs.length) return vo;
4123
+ if (t >= this.outs.length) return _o;
4124
4124
  s.outs.length = t + 1;
4125
4125
  for (let a = 0; a < t; a++)
4126
4126
  s.outs[a] = Dc;
@@ -4146,7 +4146,7 @@ class X {
4146
4146
  ), n.length !== this.ins.length || r.length !== this.ins.length)
4147
4147
  throw new Error("Must supply prevout script and value for all inputs");
4148
4148
  const a = i === X.SIGHASH_DEFAULT ? X.SIGHASH_ALL : i & X.SIGHASH_OUTPUT_MASK, l = (i & X.SIGHASH_INPUT_MASK) === X.SIGHASH_ANYONECANPAY, d = a === X.SIGHASH_NONE, g = a === X.SIGHASH_SINGLE;
4149
- let x = Ct, y = Ct, O = Ct, B = Ct, A = Ct;
4149
+ let x = Ct, y = Ct, O = Ct, A = Ct, T = Ct;
4150
4150
  if (!l) {
4151
4151
  let m = xe.BufferWriter.withCapacity(
4152
4152
  36 * this.ins.length
@@ -4161,23 +4161,23 @@ class X {
4161
4161
  (S) => m.writeVarSlice(S)
4162
4162
  ), O = Ne.sha256(m.end()), m = xe.BufferWriter.withCapacity(
4163
4163
  4 * this.ins.length
4164
- ), this.ins.forEach((S) => m.writeUInt32(S.sequence)), B = Ne.sha256(m.end());
4164
+ ), this.ins.forEach((S) => m.writeUInt32(S.sequence)), A = Ne.sha256(m.end());
4165
4165
  }
4166
4166
  if (d || g) {
4167
4167
  if (g && t < this.outs.length) {
4168
4168
  const m = this.outs[t], S = xe.BufferWriter.withCapacity(
4169
4169
  8 + at(m.script)
4170
4170
  );
4171
- S.writeUInt64(m.value), S.writeVarSlice(m.script), A = Ne.sha256(S.end());
4171
+ S.writeUInt64(m.value), S.writeVarSlice(m.script), T = Ne.sha256(S.end());
4172
4172
  }
4173
4173
  } else {
4174
4174
  const m = this.outs.map((E) => 8 + at(E.script)).reduce((E, H) => E + H), S = xe.BufferWriter.withCapacity(m);
4175
4175
  this.outs.forEach((E) => {
4176
4176
  S.writeUInt64(E.value), S.writeVarSlice(E.script);
4177
- }), A = Ne.sha256(S.end());
4177
+ }), T = Ne.sha256(S.end());
4178
4178
  }
4179
4179
  const k = (s ? 2 : 0) + (o ? 1 : 0), U = 174 - (l ? 49 : 0) - (d ? 32 : 0) + (o ? 32 : 0) + (s ? 37 : 0), _ = xe.BufferWriter.withCapacity(U);
4180
- if (_.writeUInt8(i), _.writeInt32(this.version), _.writeUInt32(this.locktime), _.writeSlice(x), _.writeSlice(y), _.writeSlice(O), _.writeSlice(B), d || g || _.writeSlice(A), _.writeUInt8(k), l) {
4180
+ if (_.writeUInt8(i), _.writeInt32(this.version), _.writeUInt32(this.locktime), _.writeSlice(x), _.writeSlice(y), _.writeSlice(O), _.writeSlice(A), d || g || _.writeSlice(T), _.writeUInt8(k), l) {
4181
4181
  const m = this.ins[t];
4182
4182
  _.writeSlice(m.hash), _.writeUInt32(m.index), _.writeUInt64(n[t]), _.writeVarSlice(r[t]), _.writeUInt32(m.sequence);
4183
4183
  } else
@@ -4188,7 +4188,7 @@ class X {
4188
4188
  );
4189
4189
  m.writeVarSlice(o), _.writeSlice(Ne.sha256(m.end()));
4190
4190
  }
4191
- return g && _.writeSlice(A), s && (_.writeSlice(s), _.writeUInt8(0), _.writeUInt32(4294967295)), Ne.taggedHash(
4191
+ return g && _.writeSlice(T), s && (_.writeSlice(s), _.writeUInt8(0), _.writeUInt32(4294967295)), Ne.taggedHash(
4192
4192
  "TapSighash",
4193
4193
  Buffer.concat([Buffer.from([0]), _.end()])
4194
4194
  );
@@ -4272,7 +4272,7 @@ function Ns(e) {
4272
4272
  throw new RangeError("value out of range");
4273
4273
  }
4274
4274
  function nn(e, t, r) {
4275
- if (Ns(e), t || (t = Buffer.allocUnsafe(Xa(e))), !Buffer.isBuffer(t))
4275
+ if (Ns(e), t || (t = Buffer.allocUnsafe(Ya(e))), !Buffer.isBuffer(t))
4276
4276
  throw new TypeError("buffer must be a Buffer instance");
4277
4277
  return r || (r = 0), e < 253 ? (t.writeUInt8(e, r), Object.assign(nn, { bytes: 1 })) : e <= 65535 ? (t.writeUInt8(253, r), t.writeUInt16LE(e, r + 1), Object.assign(nn, { bytes: 3 })) : e <= 4294967295 ? (t.writeUInt8(254, r), t.writeUInt32LE(e, r + 1), Object.assign(nn, { bytes: 5 })) : (t.writeUInt8(255, r), t.writeUInt32LE(e >>> 0, r + 1), t.writeUInt32LE(e / 4294967296 | 0, r + 5), Object.assign(nn, { bytes: 9 })), t;
4278
4278
  }
@@ -4295,10 +4295,10 @@ function sn(e, t) {
4295
4295
  }
4296
4296
  }
4297
4297
  yn.decode = sn;
4298
- function Xa(e) {
4298
+ function Ya(e) {
4299
4299
  return Ns(e), e < 253 ? 1 : e <= 65535 ? 3 : e <= 4294967295 ? 5 : 9;
4300
4300
  }
4301
- yn.encodingLength = Xa;
4301
+ yn.encodingLength = Ya;
4302
4302
  var Gi = {}, hi = {}, Ce = {};
4303
4303
  Object.defineProperty(Ce, "__esModule", { value: !0 });
4304
4304
  Ce.testnet = Ce.regtest = Ce.bitcoin = void 0;
@@ -4391,7 +4391,7 @@ function Vc(e) {
4391
4391
  ze.value = Vc;
4392
4392
  Object.defineProperty(hi, "__esModule", { value: !0 });
4393
4393
  hi.p2data = void 0;
4394
- const zc = Ce, jn = qe(), st = Le, Eo = ze, xo = jn.OPS;
4394
+ const zc = Ce, jn = qe(), st = Le, vo = ze, Eo = jn.OPS;
4395
4395
  function qc(e, t) {
4396
4396
  if (!e.data && !e.output) throw new TypeError("Not enough data");
4397
4397
  t = Object.assign({ validate: !0 }, t || {}), (0, st.typeforce)(
@@ -4405,15 +4405,15 @@ function qc(e, t) {
4405
4405
  e
4406
4406
  );
4407
4407
  const n = { name: "embed", network: e.network || zc.bitcoin };
4408
- if (Eo.prop(n, "output", () => {
4408
+ if (vo.prop(n, "output", () => {
4409
4409
  if (e.data)
4410
- return jn.compile([xo.OP_RETURN].concat(e.data));
4411
- }), Eo.prop(n, "data", () => {
4410
+ return jn.compile([Eo.OP_RETURN].concat(e.data));
4411
+ }), vo.prop(n, "data", () => {
4412
4412
  if (e.output)
4413
4413
  return jn.decompile(e.output).slice(1);
4414
4414
  }), t.validate && e.output) {
4415
4415
  const i = jn.decompile(e.output);
4416
- if (i[0] !== xo.OP_RETURN) throw new TypeError("Output is invalid");
4416
+ if (i[0] !== Eo.OP_RETURN) throw new TypeError("Output is invalid");
4417
4417
  if (!i.slice(1).every(st.typeforce.Buffer))
4418
4418
  throw new TypeError("Output is invalid");
4419
4419
  if (e.data && !(0, st.stacksEqual)(e.data, n.data))
@@ -4529,7 +4529,7 @@ li.p2ms = Yc;
4529
4529
  var di = {};
4530
4530
  Object.defineProperty(di, "__esModule", { value: !0 });
4531
4531
  di.p2pk = void 0;
4532
- const Xc = Ce, mr = qe(), Ze = Le, br = ze, So = mr.OPS;
4532
+ const Xc = Ce, mr = qe(), Ze = Le, br = ze, xo = mr.OPS;
4533
4533
  function Jc(e, t) {
4534
4534
  if (!e.input && !e.output && !e.pubkey && !e.input && !e.signature)
4535
4535
  throw new TypeError("Not enough data");
@@ -4546,7 +4546,7 @@ function Jc(e, t) {
4546
4546
  const r = br.value(() => mr.decompile(e.input)), i = { name: "p2pk", network: e.network || Xc.bitcoin };
4547
4547
  if (br.prop(i, "output", () => {
4548
4548
  if (e.pubkey)
4549
- return mr.compile([e.pubkey, So.OP_CHECKSIG]);
4549
+ return mr.compile([e.pubkey, xo.OP_CHECKSIG]);
4550
4550
  }), br.prop(i, "pubkey", () => {
4551
4551
  if (e.output)
4552
4552
  return e.output.slice(1, -1);
@@ -4561,7 +4561,7 @@ function Jc(e, t) {
4561
4561
  return [];
4562
4562
  }), t.validate) {
4563
4563
  if (e.output) {
4564
- if (e.output[e.output.length - 1] !== So.OP_CHECKSIG)
4564
+ if (e.output[e.output.length - 1] !== xo.OP_CHECKSIG)
4565
4565
  throw new TypeError("Output is invalid");
4566
4566
  if (!(0, Ze.isPoint)(i.pubkey))
4567
4567
  throw new TypeError("Output pubkey is invalid");
@@ -4597,16 +4597,16 @@ function Qc(e) {
4597
4597
  throw new TypeError("Expected Uint8Array");
4598
4598
  if (y.length === 0)
4599
4599
  return "";
4600
- for (var O = 0, B = 0, A = 0, k = y.length; A !== k && y[A] === 0; )
4601
- A++, O++;
4602
- for (var U = (k - A) * l + 1 >>> 0, _ = new Uint8Array(U); A !== k; ) {
4603
- for (var m = y[A], S = 0, E = U - 1; (m !== 0 || S < B) && E !== -1; E--, S++)
4600
+ for (var O = 0, A = 0, T = 0, k = y.length; T !== k && y[T] === 0; )
4601
+ T++, O++;
4602
+ for (var U = (k - T) * l + 1 >>> 0, _ = new Uint8Array(U); T !== k; ) {
4603
+ for (var m = y[T], S = 0, E = U - 1; (m !== 0 || S < A) && E !== -1; E--, S++)
4604
4604
  m += 256 * _[E] >>> 0, _[E] = m % o >>> 0, m = m / o >>> 0;
4605
4605
  if (m !== 0)
4606
4606
  throw new Error("Non-zero carry");
4607
- B = S, A++;
4607
+ A = S, T++;
4608
4608
  }
4609
- for (var H = U - B; H !== U && _[H] === 0; )
4609
+ for (var H = U - A; H !== U && _[H] === 0; )
4610
4610
  H++;
4611
4611
  for (var D = a.repeat(O); H < U; ++H)
4612
4612
  D += e.charAt(_[H]);
@@ -4617,21 +4617,21 @@ function Qc(e) {
4617
4617
  throw new TypeError("Expected String");
4618
4618
  if (y.length === 0)
4619
4619
  return new Uint8Array();
4620
- for (var O = 0, B = 0, A = 0; y[O] === a; )
4621
- B++, O++;
4620
+ for (var O = 0, A = 0, T = 0; y[O] === a; )
4621
+ A++, O++;
4622
4622
  for (var k = (y.length - O) * c + 1 >>> 0, U = new Uint8Array(k); y[O]; ) {
4623
4623
  var _ = t[y.charCodeAt(O)];
4624
4624
  if (_ === 255)
4625
4625
  return;
4626
- for (var m = 0, S = k - 1; (_ !== 0 || m < A) && S !== -1; S--, m++)
4626
+ for (var m = 0, S = k - 1; (_ !== 0 || m < T) && S !== -1; S--, m++)
4627
4627
  _ += o * U[S] >>> 0, U[S] = _ % 256 >>> 0, _ = _ / 256 >>> 0;
4628
4628
  if (_ !== 0)
4629
4629
  throw new Error("Non-zero carry");
4630
- A = m, O++;
4630
+ T = m, O++;
4631
4631
  }
4632
- for (var E = k - A; E !== k && U[E] === 0; )
4632
+ for (var E = k - T; E !== k && U[E] === 0; )
4633
4633
  E++;
4634
- for (var H = new Uint8Array(B + (k - E)), D = B; E !== k; )
4634
+ for (var H = new Uint8Array(A + (k - E)), D = A; E !== k; )
4635
4635
  H[D++] = U[E++];
4636
4636
  return H;
4637
4637
  }
@@ -4674,14 +4674,14 @@ var rh = eh(th), Wi = rh, nh = function(e) {
4674
4674
  decode: i,
4675
4675
  decodeUnsafe: n
4676
4676
  };
4677
- }, { sha256: Bo } = qa, ih = nh;
4677
+ }, { sha256: So } = za, ih = nh;
4678
4678
  function sh(e) {
4679
- return Bo(Bo(e));
4679
+ return So(So(e));
4680
4680
  }
4681
4681
  var Fs = ih(sh);
4682
4682
  Object.defineProperty(pi, "__esModule", { value: !0 });
4683
4683
  pi.p2pkh = void 0;
4684
- const Vi = $t, oh = Ce, _r = qe(), Fe = Le, dt = ze, Po = Fs, Rt = _r.OPS;
4684
+ const Vi = $t, oh = Ce, _r = qe(), Fe = Le, dt = ze, Bo = Fs, Rt = _r.OPS;
4685
4685
  function ah(e, t) {
4686
4686
  if (!e.address && !e.hash && !e.output && !e.pubkey && !e.input)
4687
4687
  throw new TypeError("Not enough data");
@@ -4698,13 +4698,13 @@ function ah(e, t) {
4698
4698
  e
4699
4699
  );
4700
4700
  const r = dt.value(() => {
4701
- const o = Buffer.from(Po.decode(e.address)), a = o.readUInt8(0), c = o.slice(1);
4701
+ const o = Buffer.from(Bo.decode(e.address)), a = o.readUInt8(0), c = o.slice(1);
4702
4702
  return { version: a, hash: c };
4703
4703
  }), n = dt.value(() => _r.decompile(e.input)), i = e.network || oh.bitcoin, s = { name: "p2pkh", network: i };
4704
4704
  if (dt.prop(s, "address", () => {
4705
4705
  if (!s.hash) return;
4706
4706
  const o = Buffer.allocUnsafe(21);
4707
- return o.writeUInt8(i.pubKeyHash, 0), s.hash.copy(o, 1), Po.encode(o);
4707
+ return o.writeUInt8(i.pubKeyHash, 0), s.hash.copy(o, 1), Bo.encode(o);
4708
4708
  }), dt.prop(s, "hash", () => {
4709
4709
  if (e.output) return e.output.slice(3, 23);
4710
4710
  if (e.address) return r().hash;
@@ -4779,7 +4779,7 @@ pi.p2pkh = ah;
4779
4779
  var yi = {};
4780
4780
  Object.defineProperty(yi, "__esModule", { value: !0 });
4781
4781
  yi.p2sh = void 0;
4782
- const To = $t, fh = Ce, ft = qe(), ue = Le, ot = ze, Ao = Fs, Gr = ft.OPS;
4782
+ const Po = $t, fh = Ce, ft = qe(), ue = Le, ot = ze, To = Fs, Gr = ft.OPS;
4783
4783
  function uh(e, t) {
4784
4784
  if (!e.address && !e.hash && !e.output && !e.redeem && !e.input)
4785
4785
  throw new TypeError("Not enough data");
@@ -4807,7 +4807,7 @@ function uh(e, t) {
4807
4807
  let r = e.network;
4808
4808
  r || (r = e.redeem && e.redeem.network || fh.bitcoin);
4809
4809
  const n = { network: r }, i = ot.value(() => {
4810
- const a = Buffer.from(Ao.decode(e.address)), c = a.readUInt8(0), l = a.slice(1);
4810
+ const a = Buffer.from(To.decode(e.address)), c = a.readUInt8(0), l = a.slice(1);
4811
4811
  return { version: c, hash: l };
4812
4812
  }), s = ot.value(() => ft.decompile(e.input)), o = ot.value(() => {
4813
4813
  const a = s(), c = a[a.length - 1];
@@ -4821,11 +4821,11 @@ function uh(e, t) {
4821
4821
  if (ot.prop(n, "address", () => {
4822
4822
  if (!n.hash) return;
4823
4823
  const a = Buffer.allocUnsafe(21);
4824
- return a.writeUInt8(n.network.scriptHash, 0), n.hash.copy(a, 1), Ao.encode(a);
4824
+ return a.writeUInt8(n.network.scriptHash, 0), n.hash.copy(a, 1), To.encode(a);
4825
4825
  }), ot.prop(n, "hash", () => {
4826
4826
  if (e.output) return e.output.slice(2, 22);
4827
4827
  if (e.address) return i().hash;
4828
- if (n.redeem && n.redeem.output) return To.hash160(n.redeem.output);
4828
+ if (n.redeem && n.redeem.output) return Po.hash160(n.redeem.output);
4829
4829
  }), ot.prop(n, "output", () => {
4830
4830
  if (n.hash)
4831
4831
  return ft.compile([Gr.OP_HASH160, n.hash, Gr.OP_EQUAL]);
@@ -4877,7 +4877,7 @@ function uh(e, t) {
4877
4877
  throw new TypeError(
4878
4878
  "Redeem.output unspendable with more than 201 non-push ops"
4879
4879
  );
4880
- const g = To.hash160(l.output);
4880
+ const g = Po.hash160(l.output);
4881
4881
  if (a.length > 0 && !a.equals(g))
4882
4882
  throw new TypeError("Hash mismatch");
4883
4883
  a = g;
@@ -4922,16 +4922,16 @@ yi.p2sh = uh;
4922
4922
  var bi = {}, Et = {};
4923
4923
  Object.defineProperty(Et, "__esModule", { value: !0 });
4924
4924
  Et.bech32m = Et.bech32 = void 0;
4925
- const Zn = "qpzry9x8gf2tvdw0s3jn54khce6mua7l", Ja = {};
4925
+ const Zn = "qpzry9x8gf2tvdw0s3jn54khce6mua7l", Xa = {};
4926
4926
  for (let e = 0; e < Zn.length; e++) {
4927
4927
  const t = Zn.charAt(e);
4928
- Ja[t] = e;
4928
+ Xa[t] = e;
4929
4929
  }
4930
4930
  function xr(e) {
4931
4931
  const t = e >> 25;
4932
4932
  return (e & 33554431) << 5 ^ -(t >> 0 & 1) & 996825010 ^ -(t >> 1 & 1) & 642813549 ^ -(t >> 2 & 1) & 513874426 ^ -(t >> 3 & 1) & 1027748829 ^ -(t >> 4 & 1) & 705979059;
4933
4933
  }
4934
- function Io(e) {
4934
+ function Ao(e) {
4935
4935
  let t = 1;
4936
4936
  for (let r = 0; r < e.length; ++r) {
4937
4937
  const n = e.charCodeAt(r);
@@ -4976,14 +4976,14 @@ function lh(e) {
4976
4976
  return t;
4977
4977
  throw new Error(t);
4978
4978
  }
4979
- function Qa(e) {
4979
+ function Ja(e) {
4980
4980
  let t;
4981
4981
  e === "bech32" ? t = 1 : t = 734539939;
4982
4982
  function r(o, a, c) {
4983
4983
  if (c = c || 90, o.length + 7 + a.length > c)
4984
4984
  throw new TypeError("Exceeds length limit");
4985
4985
  o = o.toLowerCase();
4986
- let l = Io(o);
4986
+ let l = Ao(o);
4987
4987
  if (typeof l == "string")
4988
4988
  throw new Error(l);
4989
4989
  let d = o + "1";
@@ -5019,15 +5019,15 @@ function Qa(e) {
5019
5019
  const g = o.slice(0, d), x = o.slice(d + 1);
5020
5020
  if (x.length < 6)
5021
5021
  return "Data too short";
5022
- let y = Io(g);
5022
+ let y = Ao(g);
5023
5023
  if (typeof y == "string")
5024
5024
  return y;
5025
5025
  const O = [];
5026
- for (let B = 0; B < x.length; ++B) {
5027
- const A = x.charAt(B), k = Ja[A];
5026
+ for (let A = 0; A < x.length; ++A) {
5027
+ const T = x.charAt(A), k = Xa[T];
5028
5028
  if (k === void 0)
5029
- return "Unknown character " + A;
5030
- y = xr(y) ^ k, !(B + 6 >= x.length) && O.push(k);
5029
+ return "Unknown character " + T;
5030
+ y = xr(y) ^ k, !(A + 6 >= x.length) && O.push(k);
5031
5031
  }
5032
5032
  return y !== t ? "Invalid checksum for " + o : { prefix: g, words: O };
5033
5033
  }
@@ -5051,11 +5051,11 @@ function Qa(e) {
5051
5051
  fromWords: lh
5052
5052
  };
5053
5053
  }
5054
- Et.bech32 = Qa("bech32");
5055
- Et.bech32m = Qa("bech32m");
5054
+ Et.bech32 = Ja("bech32");
5055
+ Et.bech32m = Ja("bech32m");
5056
5056
  Object.defineProperty(bi, "__esModule", { value: !0 });
5057
5057
  bi.p2wpkh = void 0;
5058
- const zi = $t, dh = Ce, Gn = qe(), Se = Le, Ut = ze, On = Et, Oo = Gn.OPS, ph = Buffer.alloc(0);
5058
+ const zi = $t, dh = Ce, Gn = qe(), Se = Le, Ut = ze, On = Et, Io = Gn.OPS, ph = Buffer.alloc(0);
5059
5059
  function yh(e, t) {
5060
5060
  if (!e.address && !e.hash && !e.output && !e.pubkey && !e.witness)
5061
5061
  throw new TypeError("Not enough data");
@@ -5092,7 +5092,7 @@ function yh(e, t) {
5092
5092
  if (e.pubkey || i.pubkey) return zi.hash160(e.pubkey || i.pubkey);
5093
5093
  }), Ut.prop(i, "output", () => {
5094
5094
  if (i.hash)
5095
- return Gn.compile([Oo.OP_0, i.hash]);
5095
+ return Gn.compile([Io.OP_0, i.hash]);
5096
5096
  }), Ut.prop(i, "pubkey", () => {
5097
5097
  if (e.pubkey) return e.pubkey;
5098
5098
  if (e.witness)
@@ -5123,7 +5123,7 @@ function yh(e, t) {
5123
5123
  s = e.hash;
5124
5124
  }
5125
5125
  if (e.output) {
5126
- if (e.output.length !== 22 || e.output[0] !== Oo.OP_0 || e.output[1] !== 20)
5126
+ if (e.output.length !== 22 || e.output[0] !== Io.OP_0 || e.output[1] !== 20)
5127
5127
  throw new TypeError("Output is invalid");
5128
5128
  if (s.length > 0 && !s.equals(e.output.slice(2)))
5129
5129
  throw new TypeError("Hash mismatch");
@@ -5157,7 +5157,7 @@ bi.p2wpkh = yh;
5157
5157
  var wi = {};
5158
5158
  Object.defineProperty(wi, "__esModule", { value: !0 });
5159
5159
  wi.p2wsh = void 0;
5160
- const ko = $t, bh = Ce, wt = qe(), oe = Le, pt = ze, kn = Et, Ro = wt.OPS, qi = Buffer.alloc(0);
5160
+ const Oo = $t, bh = Ce, wt = qe(), oe = Le, pt = ze, kn = Et, ko = wt.OPS, qi = Buffer.alloc(0);
5161
5161
  function Rn(e) {
5162
5162
  return !!(Buffer.isBuffer(e) && e.length === 65 && e[0] === 4 && (0, oe.isPoint)(e));
5163
5163
  }
@@ -5203,10 +5203,10 @@ function wh(e, t) {
5203
5203
  }), pt.prop(s, "hash", () => {
5204
5204
  if (e.output) return e.output.slice(2);
5205
5205
  if (e.address) return r().data;
5206
- if (s.redeem && s.redeem.output) return ko.sha256(s.redeem.output);
5206
+ if (s.redeem && s.redeem.output) return Oo.sha256(s.redeem.output);
5207
5207
  }), pt.prop(s, "output", () => {
5208
5208
  if (s.hash)
5209
- return wt.compile([Ro.OP_0, s.hash]);
5209
+ return wt.compile([ko.OP_0, s.hash]);
5210
5210
  }), pt.prop(s, "redeem", () => {
5211
5211
  if (e.witness)
5212
5212
  return {
@@ -5244,7 +5244,7 @@ function wh(e, t) {
5244
5244
  o = e.hash;
5245
5245
  }
5246
5246
  if (e.output) {
5247
- if (e.output.length !== 34 || e.output[0] !== Ro.OP_0 || e.output[1] !== 32)
5247
+ if (e.output.length !== 34 || e.output[0] !== ko.OP_0 || e.output[1] !== 32)
5248
5248
  throw new TypeError("Output is invalid");
5249
5249
  const a = e.output.slice(2);
5250
5250
  if (o.length > 0 && !o.equals(a))
@@ -5268,7 +5268,7 @@ function wh(e, t) {
5268
5268
  throw new TypeError(
5269
5269
  "Redeem.output unspendable with more than 201 non-push ops"
5270
5270
  );
5271
- const c = ko.sha256(e.redeem.output);
5271
+ const c = Oo.sha256(e.redeem.output);
5272
5272
  if (o.length > 0 && !o.equals(c))
5273
5273
  throw new TypeError("Hash mismatch");
5274
5274
  o = c;
@@ -5370,27 +5370,27 @@ var Hs = {};
5370
5370
  Object.defineProperty(e, "__esModule", { value: !0 }), e.tweakKey = e.tapTweakHash = e.tapleafHash = e.findScriptPath = e.toHashTree = e.rootHashFromPath = e.MAX_TAPTREE_DEPTH = e.LEAF_VERSION_TAPSCRIPT = void 0;
5371
5371
  const t = St, r = er, n = $t, i = Ae, s = Le;
5372
5372
  e.LEAF_VERSION_TAPSCRIPT = 192, e.MAX_TAPTREE_DEPTH = 128;
5373
- const o = (B) => "left" in B && "right" in B;
5374
- function a(B, A) {
5375
- if (B.length < 33)
5373
+ const o = (A) => "left" in A && "right" in A;
5374
+ function a(A, T) {
5375
+ if (A.length < 33)
5376
5376
  throw new TypeError(
5377
- `The control-block length is too small. Got ${B.length}, expected min 33.`
5377
+ `The control-block length is too small. Got ${A.length}, expected min 33.`
5378
5378
  );
5379
- const k = (B.length - 33) / 32;
5380
- let U = A;
5379
+ const k = (A.length - 33) / 32;
5380
+ let U = T;
5381
5381
  for (let _ = 0; _ < k; _++) {
5382
- const m = B.slice(33 + 32 * _, 65 + 32 * _);
5382
+ const m = A.slice(33 + 32 * _, 65 + 32 * _);
5383
5383
  U.compare(m) < 0 ? U = y(U, m) : U = y(m, U);
5384
5384
  }
5385
5385
  return U;
5386
5386
  }
5387
5387
  e.rootHashFromPath = a;
5388
- function c(B) {
5389
- if ((0, s.isTapleaf)(B))
5390
- return { hash: d(B) };
5391
- const A = [c(B[0]), c(B[1])];
5392
- A.sort((_, m) => _.hash.compare(m.hash));
5393
- const [k, U] = A;
5388
+ function c(A) {
5389
+ if ((0, s.isTapleaf)(A))
5390
+ return { hash: d(A) };
5391
+ const T = [c(A[0]), c(A[1])];
5392
+ T.sort((_, m) => _.hash.compare(m.hash));
5393
+ const [k, U] = T;
5394
5394
  return {
5395
5395
  hash: y(k.hash, U.hash),
5396
5396
  left: k,
@@ -5398,55 +5398,55 @@ var Hs = {};
5398
5398
  };
5399
5399
  }
5400
5400
  e.toHashTree = c;
5401
- function l(B, A) {
5402
- if (o(B)) {
5403
- const k = l(B.left, A);
5404
- if (k !== void 0) return [...k, B.right.hash];
5405
- const U = l(B.right, A);
5406
- if (U !== void 0) return [...U, B.left.hash];
5407
- } else if (B.hash.equals(A))
5401
+ function l(A, T) {
5402
+ if (o(A)) {
5403
+ const k = l(A.left, T);
5404
+ if (k !== void 0) return [...k, A.right.hash];
5405
+ const U = l(A.right, T);
5406
+ if (U !== void 0) return [...U, A.left.hash];
5407
+ } else if (A.hash.equals(T))
5408
5408
  return [];
5409
5409
  }
5410
5410
  e.findScriptPath = l;
5411
- function d(B) {
5412
- const A = B.version || e.LEAF_VERSION_TAPSCRIPT;
5411
+ function d(A) {
5412
+ const T = A.version || e.LEAF_VERSION_TAPSCRIPT;
5413
5413
  return n.taggedHash(
5414
5414
  "TapLeaf",
5415
5415
  t.Buffer.concat([
5416
- t.Buffer.from([A]),
5417
- O(B.output)
5416
+ t.Buffer.from([T]),
5417
+ O(A.output)
5418
5418
  ])
5419
5419
  );
5420
5420
  }
5421
5421
  e.tapleafHash = d;
5422
- function g(B, A) {
5422
+ function g(A, T) {
5423
5423
  return n.taggedHash(
5424
5424
  "TapTweak",
5425
- t.Buffer.concat(A ? [B, A] : [B])
5425
+ t.Buffer.concat(T ? [A, T] : [A])
5426
5426
  );
5427
5427
  }
5428
5428
  e.tapTweakHash = g;
5429
- function x(B, A) {
5430
- if (!t.Buffer.isBuffer(B) || B.length !== 32 || A && A.length !== 32) return null;
5431
- const k = g(B, A), U = (0, r.getEccLib)().xOnlyPointAddTweak(B, k);
5429
+ function x(A, T) {
5430
+ if (!t.Buffer.isBuffer(A) || A.length !== 32 || T && T.length !== 32) return null;
5431
+ const k = g(A, T), U = (0, r.getEccLib)().xOnlyPointAddTweak(A, k);
5432
5432
  return !U || U.xOnlyPubkey === null ? null : {
5433
5433
  parity: U.parity,
5434
5434
  x: t.Buffer.from(U.xOnlyPubkey)
5435
5435
  };
5436
5436
  }
5437
5437
  e.tweakKey = x;
5438
- function y(B, A) {
5439
- return n.taggedHash("TapBranch", t.Buffer.concat([B, A]));
5438
+ function y(A, T) {
5439
+ return n.taggedHash("TapBranch", t.Buffer.concat([A, T]));
5440
5440
  }
5441
- function O(B) {
5442
- const A = i.varuint.encodingLength(B.length), k = t.Buffer.allocUnsafe(A);
5443
- return i.varuint.encode(B.length, k), t.Buffer.concat([k, B]);
5441
+ function O(A) {
5442
+ const T = i.varuint.encodingLength(A.length), k = t.Buffer.allocUnsafe(T);
5443
+ return i.varuint.encode(A.length, k), t.Buffer.concat([k, A]);
5444
5444
  }
5445
5445
  })(Hs);
5446
- var Me = {}, Uo;
5446
+ var Me = {}, Ro;
5447
5447
  function Eh() {
5448
- if (Uo) return Me;
5449
- Uo = 1, Object.defineProperty(Me, "__esModule", { value: !0 }), Me.toOutputScript = Me.fromOutputScript = Me.toBech32 = Me.toBase58Check = Me.fromBech32 = Me.fromBase58Check = void 0;
5448
+ if (Ro) return Me;
5449
+ Ro = 1, Object.defineProperty(Me, "__esModule", { value: !0 }), Me.toOutputScript = Me.fromOutputScript = Me.toBech32 = Me.toBase58Check = Me.fromBech32 = Me.fromBase58Check = void 0;
5450
5450
  const e = Ce, t = $s(), r = qe(), n = Le, i = Et, s = Fs, o = 40, a = 2, c = 16, l = 2, d = 80, g = "WARNING: Sending to a future segwit version address can lead to loss of funds. End users MUST be warned carefully in the GUI and asked if they wish to proceed with caution. Wallets should verify the segwit version from the output of fromBech32, then decide when it is safe to use which version of segwit.";
5451
5451
  function x(_, m) {
5452
5452
  const S = _.slice(2);
@@ -5457,7 +5457,7 @@ function Eh() {
5457
5457
  throw new TypeError("Invalid version for segwit address");
5458
5458
  if (_[1] !== S.length)
5459
5459
  throw new TypeError("Invalid script for segwit address");
5460
- return console.warn(g), A(S, E, m.bech32);
5460
+ return console.warn(g), T(S, E, m.bech32);
5461
5461
  }
5462
5462
  function y(_) {
5463
5463
  const m = Buffer.from(s.decode(_));
@@ -5484,7 +5484,7 @@ function Eh() {
5484
5484
  };
5485
5485
  }
5486
5486
  Me.fromBech32 = O;
5487
- function B(_, m) {
5487
+ function A(_, m) {
5488
5488
  (0, n.typeforce)(
5489
5489
  (0, n.tuple)(n.Hash160bit, n.UInt8),
5490
5490
  arguments
@@ -5492,12 +5492,12 @@ function Eh() {
5492
5492
  const S = Buffer.allocUnsafe(21);
5493
5493
  return S.writeUInt8(m, 0), _.copy(S, 1), s.encode(S);
5494
5494
  }
5495
- Me.toBase58Check = B;
5496
- function A(_, m, S) {
5495
+ Me.toBase58Check = A;
5496
+ function T(_, m, S) {
5497
5497
  const E = i.bech32.toWords(_);
5498
5498
  return E.unshift(m), m === 0 ? i.bech32.encode(S, E) : i.bech32m.encode(S, E);
5499
5499
  }
5500
- Me.toBech32 = A;
5500
+ Me.toBech32 = T;
5501
5501
  function k(_, m) {
5502
5502
  m = m || e.bitcoin;
5503
5503
  try {
@@ -5566,10 +5566,10 @@ function Eh() {
5566
5566
  }
5567
5567
  return Me.toOutputScript = U, Me;
5568
5568
  }
5569
- var Co;
5569
+ var Uo;
5570
5570
  function xh() {
5571
- if (Co) return Wr;
5572
- Co = 1, Object.defineProperty(Wr, "__esModule", { value: !0 }), Wr.p2tr = void 0;
5571
+ if (Uo) return Wr;
5572
+ Uo = 1, Object.defineProperty(Wr, "__esModule", { value: !0 }), Wr.p2tr = void 0;
5573
5573
  const e = St, t = Ce, r = qe(), n = Le, i = er, s = Hs, o = ze, a = Et, c = Eh(), l = r.OPS, d = 1, g = 80;
5574
5574
  function x(y, O) {
5575
5575
  if (!y.address && !y.output && !y.pubkey && !y.internalPubkey && !(y.witness && y.witness.length > 1))
@@ -5604,7 +5604,7 @@ function xh() {
5604
5604
  },
5605
5605
  y
5606
5606
  );
5607
- const B = o.value(() => (0, c.fromBech32)(y.address)), A = o.value(() => {
5607
+ const A = o.value(() => (0, c.fromBech32)(y.address)), T = o.value(() => {
5608
5608
  if (!(!y.witness || !y.witness.length))
5609
5609
  return y.witness.length >= 2 && y.witness[y.witness.length - 1][0] === g ? y.witness.slice(0, -1) : y.witness.slice();
5610
5610
  }), k = o.value(() => {
@@ -5618,7 +5618,7 @@ function xh() {
5618
5618
  }), o.prop(_, "hash", () => {
5619
5619
  const m = k();
5620
5620
  if (m) return m.hash;
5621
- const S = A();
5621
+ const S = T();
5622
5622
  if (S && S.length > 1) {
5623
5623
  const E = S[S.length - 1], H = E[0] & n.TAPLEAF_VERSION_MASK, D = S[S.length - 2], R = (0, s.tapleafHash)({
5624
5624
  output: D,
@@ -5631,7 +5631,7 @@ function xh() {
5631
5631
  if (_.pubkey)
5632
5632
  return r.compile([l.OP_1, _.pubkey]);
5633
5633
  }), o.prop(_, "redeemVersion", () => y.redeemVersion ? y.redeemVersion : y.redeem && y.redeem.redeemVersion !== void 0 && y.redeem.redeemVersion !== null ? y.redeem.redeemVersion : s.LEAF_VERSION_TAPSCRIPT), o.prop(_, "redeem", () => {
5634
- const m = A();
5634
+ const m = T();
5635
5635
  if (!(!m || m.length < 2))
5636
5636
  return {
5637
5637
  output: m[m.length - 2],
@@ -5641,19 +5641,19 @@ function xh() {
5641
5641
  }), o.prop(_, "pubkey", () => {
5642
5642
  if (y.pubkey) return y.pubkey;
5643
5643
  if (y.output) return y.output.slice(2);
5644
- if (y.address) return B().data;
5644
+ if (y.address) return A().data;
5645
5645
  if (_.internalPubkey) {
5646
5646
  const m = (0, s.tweakKey)(_.internalPubkey, _.hash);
5647
5647
  if (m) return m.x;
5648
5648
  }
5649
5649
  }), o.prop(_, "internalPubkey", () => {
5650
5650
  if (y.internalPubkey) return y.internalPubkey;
5651
- const m = A();
5651
+ const m = T();
5652
5652
  if (m && m.length > 1)
5653
5653
  return m[m.length - 1].slice(1, 33);
5654
5654
  }), o.prop(_, "signature", () => {
5655
5655
  if (y.signature) return y.signature;
5656
- const m = A();
5656
+ const m = T();
5657
5657
  if (!(!m || m.length !== 1))
5658
5658
  return m[0];
5659
5659
  }), o.prop(_, "witness", () => {
@@ -5679,13 +5679,13 @@ function xh() {
5679
5679
  }), O.validate) {
5680
5680
  let m = e.Buffer.from([]);
5681
5681
  if (y.address) {
5682
- if (U && U.bech32 !== B().prefix)
5682
+ if (U && U.bech32 !== A().prefix)
5683
5683
  throw new TypeError("Invalid prefix or Network mismatch");
5684
- if (B().version !== d)
5684
+ if (A().version !== d)
5685
5685
  throw new TypeError("Invalid address version");
5686
- if (B().data.length !== 32)
5686
+ if (A().data.length !== 32)
5687
5687
  throw new TypeError("Invalid address data");
5688
- m = B().data;
5688
+ m = A().data;
5689
5689
  }
5690
5690
  if (y.pubkey) {
5691
5691
  if (m.length > 0 && !m.equals(y.pubkey))
@@ -5718,7 +5718,7 @@ function xh() {
5718
5718
  if (!(0, s.findScriptPath)(S, H))
5719
5719
  throw new TypeError("Redeem script not in tree");
5720
5720
  }
5721
- const E = A();
5721
+ const E = T();
5722
5722
  if (y.redeem && _.redeem) {
5723
5723
  if (y.redeem.redeemVersion && y.redeem.redeemVersion !== _.redeem.redeemVersion)
5724
5724
  throw new TypeError("Redeem.redeemVersion and witness mismatch");
@@ -5771,9 +5771,9 @@ function xh() {
5771
5771
  }
5772
5772
  return Wr.p2tr = x, Wr;
5773
5773
  }
5774
- var Lo;
5774
+ var Co;
5775
5775
  function $s() {
5776
- return Lo || (Lo = 1, function(e) {
5776
+ return Co || (Co = 1, function(e) {
5777
5777
  Object.defineProperty(e, "__esModule", { value: !0 }), e.p2tr = e.p2wsh = e.p2wpkh = e.p2sh = e.p2pkh = e.p2pk = e.p2ms = e.embed = void 0;
5778
5778
  const t = hi;
5779
5779
  Object.defineProperty(e, "embed", {
@@ -5835,7 +5835,7 @@ function $s() {
5835
5835
  }
5836
5836
  Object.defineProperty(se, "__esModule", { value: !0 });
5837
5837
  se.signatureBlocksAction = se.checkInputForSig = se.pubkeyInScript = se.pubkeyPositionInScript = se.witnessStackToScriptWitness = se.isP2TR = se.isP2SHScript = se.isP2WSHScript = se.isP2WPKH = se.isP2PKH = se.isP2PK = se.isP2MS = void 0;
5838
- const No = yn, an = qe(), Un = pn, Sh = $t, or = $s();
5838
+ const Lo = yn, an = qe(), Un = pn, Sh = $t, or = $s();
5839
5839
  function ar(e) {
5840
5840
  return (t) => {
5841
5841
  try {
@@ -5858,8 +5858,8 @@ function Bh(e) {
5858
5858
  t = Buffer.concat([t, Buffer.from(o)]);
5859
5859
  }
5860
5860
  function n(o) {
5861
- const a = t.length, c = No.encodingLength(o);
5862
- t = Buffer.concat([t, Buffer.allocUnsafe(c)]), No.encode(o, t, a);
5861
+ const a = t.length, c = Lo.encodingLength(o);
5862
+ t = Buffer.concat([t, Buffer.allocUnsafe(c)]), Lo.encode(o, t, a);
5863
5863
  }
5864
5864
  function i(o) {
5865
5865
  n(o.length), r(o);
@@ -5870,23 +5870,23 @@ function Bh(e) {
5870
5870
  return s(e), t;
5871
5871
  }
5872
5872
  se.witnessStackToScriptWitness = Bh;
5873
- function Za(e, t) {
5873
+ function Qa(e, t) {
5874
5874
  const r = (0, Sh.hash160)(e), n = e.slice(1, 33), i = an.decompile(t);
5875
5875
  if (i === null) throw new Error("Unknown script error");
5876
5876
  return i.findIndex((s) => typeof s == "number" ? !1 : s.equals(e) || s.equals(r) || s.equals(n));
5877
5877
  }
5878
- se.pubkeyPositionInScript = Za;
5878
+ se.pubkeyPositionInScript = Qa;
5879
5879
  function Ph(e, t) {
5880
- return Za(e, t) !== -1;
5880
+ return Qa(e, t) !== -1;
5881
5881
  }
5882
5882
  se.pubkeyInScript = Ph;
5883
5883
  function Th(e, t) {
5884
5884
  return Ah(e).some(
5885
- (n) => ef(n, an.signature.decode, t)
5885
+ (n) => Za(n, an.signature.decode, t)
5886
5886
  );
5887
5887
  }
5888
5888
  se.checkInputForSig = Th;
5889
- function ef(e, t, r) {
5889
+ function Za(e, t, r) {
5890
5890
  const { hashType: n } = t(e), i = [];
5891
5891
  switch (n & Un.Transaction.SIGHASH_ANYONECANPAY && i.push("addInput"), n & 31) {
5892
5892
  case Un.Transaction.SIGHASH_ALL:
@@ -5898,7 +5898,7 @@ function ef(e, t, r) {
5898
5898
  }
5899
5899
  return i.indexOf(r) === -1;
5900
5900
  }
5901
- se.signatureBlocksAction = ef;
5901
+ se.signatureBlocksAction = Za;
5902
5902
  function Ah(e) {
5903
5903
  let t = [];
5904
5904
  if ((e.partialSig || []).length === 0) {
@@ -5963,7 +5963,7 @@ function Mh(e, t) {
5963
5963
  }
5964
5964
  }
5965
5965
  function Hh(e, t) {
5966
- const r = t && tf(t.leaves), { output: n } = (0, kh.p2tr)({
5966
+ const r = t && ef(t.leaves), { output: n } = (0, kh.p2tr)({
5967
5967
  internalPubkey: e,
5968
5968
  scriptTree: r
5969
5969
  });
@@ -5986,13 +5986,13 @@ function Dh(e) {
5986
5986
  return ds(e);
5987
5987
  }
5988
5988
  ge.tapTreeToList = Dh;
5989
- function tf(e = []) {
5989
+ function ef(e = []) {
5990
5990
  return e.length === 1 && e[0].depth === 0 ? {
5991
5991
  output: e[0].script,
5992
5992
  version: e[0].leafVersion
5993
5993
  } : zh(e);
5994
5994
  }
5995
- ge.tapTreeFromList = tf;
5995
+ ge.tapTreeFromList = ef;
5996
5996
  function jh(e, t) {
5997
5997
  return Wh(e).some(
5998
5998
  (n) => (0, Rh.signatureBlocksAction)(n, Gh, t)
@@ -6229,7 +6229,7 @@ class fn {
6229
6229
  if (a === 0) throw new Error(`${i} ${He.notFunded}`);
6230
6230
  for (let c = 0; c < o.length; c++)
6231
6231
  n.addInput(Buffer.from(o[c].txid, "hex").reverse(), o[c].vout);
6232
- return r ?? (r = await s.suggestFee(i, a, ro.MEDIUM)), n.addOutput(
6232
+ return r ?? (r = await s.suggestFee(i, a, to.MEDIUM)), n.addOutput(
6233
6233
  he.address.toOutputScript(t, this.network),
6234
6234
  a - r
6235
6235
  ), { tx: n, usedUtxos: o };
@@ -6251,7 +6251,7 @@ class fn {
6251
6251
  return t ?? (t = await (await this.signer.getProvider()).suggestFee(
6252
6252
  await this.signer.getAddress(),
6253
6253
  this.initiateAmount,
6254
- ro.MEDIUM
6254
+ to.MEDIUM
6255
6255
  )), await this.signer.send(this.address(), this.initiateAmount, t);
6256
6256
  }
6257
6257
  async generateRedeemSACP(t, r, n) {
@@ -6338,11 +6338,11 @@ class fn {
6338
6338
  throw new Error(
6339
6339
  He.invalidCounterpartySigForUTXO(t[g].utxo)
6340
6340
  );
6341
- const y = await this.signer.signSchnorr(x), O = Buffer.from(n.ins[g].hash).reverse().toString("hex"), B = t.find((A) => A.utxo === O);
6342
- if (!B)
6341
+ const y = await this.signer.signSchnorr(x), O = Buffer.from(n.ins[g].hash).reverse().toString("hex"), A = t.find((T) => T.utxo === O);
6342
+ if (!A)
6343
6343
  throw new Error(He.counterPartySigNotFound(O));
6344
6344
  n.setWitness(g, [
6345
- Buffer.from(B.sig, "hex"),
6345
+ Buffer.from(A.sig, "hex"),
6346
6346
  y,
6347
6347
  this.instantRefundLeaf(),
6348
6348
  this.generateControlBlockFor(
@@ -6601,7 +6601,7 @@ class tl {
6601
6601
  }
6602
6602
  }
6603
6603
  }
6604
- const Fo = {
6604
+ const No = {
6605
6605
  mainnet: {
6606
6606
  orderbook: "https://orderbookv2.garden.finance",
6607
6607
  quote: "https://pricev2.garden.finance",
@@ -6679,7 +6679,7 @@ class rl {
6679
6679
  }
6680
6680
  }
6681
6681
  }
6682
- var rf = {}, Or = {}, kr = {};
6682
+ var tf = {}, Or = {}, kr = {};
6683
6683
  Object.defineProperty(kr, "__esModule", { value: !0 });
6684
6684
  kr.testnet = kr.bitcoin = void 0;
6685
6685
  kr.bitcoin = {
@@ -6706,9 +6706,9 @@ kr.testnet = {
6706
6706
  scriptHash: 196,
6707
6707
  wif: 239
6708
6708
  };
6709
- var nf = {};
6709
+ var rf = {};
6710
6710
  (function(e) {
6711
- Object.defineProperty(e, "__esModule", { value: !0 }), e.maybe = e.Boolean = e.Array = e.Buffer256bit = e.Network = e.typeforce = void 0, e.typeforce = Oa, e.Network = e.typeforce.compile({
6711
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.maybe = e.Boolean = e.Array = e.Buffer256bit = e.Network = e.typeforce = void 0, e.typeforce = Ia, e.Network = e.typeforce.compile({
6712
6712
  messagePrefix: e.typeforce.oneOf(
6713
6713
  e.typeforce.Buffer,
6714
6714
  e.typeforce.String
@@ -6721,7 +6721,7 @@ var nf = {};
6721
6721
  scriptHash: e.typeforce.UInt8,
6722
6722
  wif: e.typeforce.UInt8
6723
6723
  }), e.Buffer256bit = e.typeforce.BufferN(32), e.Array = e.typeforce.Array, e.Boolean = e.typeforce.Boolean, e.maybe = e.typeforce.maybe;
6724
- })(nf);
6724
+ })(rf);
6725
6725
  var ys = { exports: {} }, bs = { exports: {} };
6726
6726
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
6727
6727
  (function(e, t) {
@@ -6791,7 +6791,7 @@ typeof Object.create == "function" ? ws.exports = function(t, r) {
6791
6791
  n.prototype = r.prototype, t.prototype = new n(), t.prototype.constructor = t;
6792
6792
  }
6793
6793
  };
6794
- var Ie = ws.exports, gs = { exports: {} }, js = { exports: {} }, Br = typeof Reflect == "object" ? Reflect : null, Mo = Br && typeof Br.apply == "function" ? Br.apply : function(t, r, n) {
6794
+ var Ie = ws.exports, gs = { exports: {} }, js = { exports: {} }, Br = typeof Reflect == "object" ? Reflect : null, Fo = Br && typeof Br.apply == "function" ? Br.apply : function(t, r, n) {
6795
6795
  return Function.prototype.apply.call(t, r, n);
6796
6796
  }, qn;
6797
6797
  Br && typeof Br.ownKeys == "function" ? qn = Br.ownKeys : Object.getOwnPropertySymbols ? qn = function(t) {
@@ -6802,7 +6802,7 @@ Br && typeof Br.ownKeys == "function" ? qn = Br.ownKeys : Object.getOwnPropertyS
6802
6802
  function fl(e) {
6803
6803
  console && console.warn && console.warn(e);
6804
6804
  }
6805
- var sf = Number.isNaN || function(t) {
6805
+ var nf = Number.isNaN || function(t) {
6806
6806
  return t !== t;
6807
6807
  };
6808
6808
  function ne() {
@@ -6814,7 +6814,7 @@ ne.EventEmitter = ne;
6814
6814
  ne.prototype._events = void 0;
6815
6815
  ne.prototype._eventsCount = 0;
6816
6816
  ne.prototype._maxListeners = void 0;
6817
- var Ho = 10;
6817
+ var Mo = 10;
6818
6818
  function mi(e) {
6819
6819
  if (typeof e != "function")
6820
6820
  throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof e);
@@ -6822,27 +6822,27 @@ function mi(e) {
6822
6822
  Object.defineProperty(ne, "defaultMaxListeners", {
6823
6823
  enumerable: !0,
6824
6824
  get: function() {
6825
- return Ho;
6825
+ return Mo;
6826
6826
  },
6827
6827
  set: function(e) {
6828
- if (typeof e != "number" || e < 0 || sf(e))
6828
+ if (typeof e != "number" || e < 0 || nf(e))
6829
6829
  throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + e + ".");
6830
- Ho = e;
6830
+ Mo = e;
6831
6831
  }
6832
6832
  });
6833
6833
  ne.init = function() {
6834
6834
  (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
6835
6835
  };
6836
6836
  ne.prototype.setMaxListeners = function(t) {
6837
- if (typeof t != "number" || t < 0 || sf(t))
6837
+ if (typeof t != "number" || t < 0 || nf(t))
6838
6838
  throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + t + ".");
6839
6839
  return this._maxListeners = t, this;
6840
6840
  };
6841
- function of(e) {
6841
+ function sf(e) {
6842
6842
  return e._maxListeners === void 0 ? ne.defaultMaxListeners : e._maxListeners;
6843
6843
  }
6844
6844
  ne.prototype.getMaxListeners = function() {
6845
- return of(this);
6845
+ return sf(this);
6846
6846
  };
6847
6847
  ne.prototype.emit = function(t) {
6848
6848
  for (var r = [], n = 1; n < arguments.length; n++) r.push(arguments[n]);
@@ -6862,13 +6862,13 @@ ne.prototype.emit = function(t) {
6862
6862
  if (c === void 0)
6863
6863
  return !1;
6864
6864
  if (typeof c == "function")
6865
- Mo(c, this, r);
6865
+ Fo(c, this, r);
6866
6866
  else
6867
- for (var l = c.length, d = hf(c, l), n = 0; n < l; ++n)
6868
- Mo(d[n], this, r);
6867
+ for (var l = c.length, d = cf(c, l), n = 0; n < l; ++n)
6868
+ Fo(d[n], this, r);
6869
6869
  return !0;
6870
6870
  };
6871
- function af(e, t, r, n) {
6871
+ function of(e, t, r, n) {
6872
6872
  var i, s, o;
6873
6873
  if (mi(r), s = e._events, s === void 0 ? (s = e._events = /* @__PURE__ */ Object.create(null), e._eventsCount = 0) : (s.newListener !== void 0 && (e.emit(
6874
6874
  "newListener",
@@ -6876,7 +6876,7 @@ function af(e, t, r, n) {
6876
6876
  r.listener ? r.listener : r
6877
6877
  ), s = e._events), o = s[t]), o === void 0)
6878
6878
  o = s[t] = r, ++e._eventsCount;
6879
- else if (typeof o == "function" ? o = s[t] = n ? [r, o] : [o, r] : n ? o.unshift(r) : o.push(r), i = of(e), i > 0 && o.length > i && !o.warned) {
6879
+ else if (typeof o == "function" ? o = s[t] = n ? [r, o] : [o, r] : n ? o.unshift(r) : o.push(r), i = sf(e), i > 0 && o.length > i && !o.warned) {
6880
6880
  o.warned = !0;
6881
6881
  var a = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit");
6882
6882
  a.name = "MaxListenersExceededWarning", a.emitter = e, a.type = t, a.count = o.length, fl(a);
@@ -6884,25 +6884,25 @@ function af(e, t, r, n) {
6884
6884
  return e;
6885
6885
  }
6886
6886
  ne.prototype.addListener = function(t, r) {
6887
- return af(this, t, r, !1);
6887
+ return of(this, t, r, !1);
6888
6888
  };
6889
6889
  ne.prototype.on = ne.prototype.addListener;
6890
6890
  ne.prototype.prependListener = function(t, r) {
6891
- return af(this, t, r, !0);
6891
+ return of(this, t, r, !0);
6892
6892
  };
6893
6893
  function ul() {
6894
6894
  if (!this.fired)
6895
6895
  return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
6896
6896
  }
6897
- function ff(e, t, r) {
6897
+ function af(e, t, r) {
6898
6898
  var n = { fired: !1, wrapFn: void 0, target: e, type: t, listener: r }, i = ul.bind(n);
6899
6899
  return i.listener = r, n.wrapFn = i, i;
6900
6900
  }
6901
6901
  ne.prototype.once = function(t, r) {
6902
- return mi(r), this.on(t, ff(this, t, r)), this;
6902
+ return mi(r), this.on(t, af(this, t, r)), this;
6903
6903
  };
6904
6904
  ne.prototype.prependOnceListener = function(t, r) {
6905
- return mi(r), this.prependListener(t, ff(this, t, r)), this;
6905
+ return mi(r), this.prependListener(t, af(this, t, r)), this;
6906
6906
  };
6907
6907
  ne.prototype.removeListener = function(t, r) {
6908
6908
  var n, i, s, o, a;
@@ -6944,24 +6944,24 @@ ne.prototype.removeAllListeners = function(t) {
6944
6944
  this.removeListener(t, r[i]);
6945
6945
  return this;
6946
6946
  };
6947
- function uf(e, t, r) {
6947
+ function ff(e, t, r) {
6948
6948
  var n = e._events;
6949
6949
  if (n === void 0)
6950
6950
  return [];
6951
6951
  var i = n[t];
6952
- return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? hl(i) : hf(i, i.length);
6952
+ return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? hl(i) : cf(i, i.length);
6953
6953
  }
6954
6954
  ne.prototype.listeners = function(t) {
6955
- return uf(this, t, !0);
6955
+ return ff(this, t, !0);
6956
6956
  };
6957
6957
  ne.prototype.rawListeners = function(t) {
6958
- return uf(this, t, !1);
6958
+ return ff(this, t, !1);
6959
6959
  };
6960
6960
  ne.listenerCount = function(e, t) {
6961
- return typeof e.listenerCount == "function" ? e.listenerCount(t) : cf.call(e, t);
6961
+ return typeof e.listenerCount == "function" ? e.listenerCount(t) : uf.call(e, t);
6962
6962
  };
6963
- ne.prototype.listenerCount = cf;
6964
- function cf(e) {
6963
+ ne.prototype.listenerCount = uf;
6964
+ function uf(e) {
6965
6965
  var t = this._events;
6966
6966
  if (t !== void 0) {
6967
6967
  var r = t[e];
@@ -6975,7 +6975,7 @@ function cf(e) {
6975
6975
  ne.prototype.eventNames = function() {
6976
6976
  return this._eventsCount > 0 ? qn(this._events) : [];
6977
6977
  };
6978
- function hf(e, t) {
6978
+ function cf(e, t) {
6979
6979
  for (var r = new Array(t), n = 0; n < t; ++n)
6980
6980
  r[n] = e[n];
6981
6981
  return r;
@@ -6998,13 +6998,13 @@ function ll(e, t) {
6998
6998
  function s() {
6999
6999
  typeof e.removeListener == "function" && e.removeListener("error", i), r([].slice.call(arguments));
7000
7000
  }
7001
- lf(e, t, s, { once: !0 }), t !== "error" && dl(e, i, { once: !0 });
7001
+ hf(e, t, s, { once: !0 }), t !== "error" && dl(e, i, { once: !0 });
7002
7002
  });
7003
7003
  }
7004
7004
  function dl(e, t, r) {
7005
- typeof e.on == "function" && lf(e, "error", t, r);
7005
+ typeof e.on == "function" && hf(e, "error", t, r);
7006
7006
  }
7007
- function lf(e, t, r, n) {
7007
+ function hf(e, t, r, n) {
7008
7008
  if (typeof e.on == "function")
7009
7009
  n.once ? e.once(t, r) : e.on(t, r);
7010
7010
  else if (typeof e.addEventListener == "function")
@@ -7014,69 +7014,69 @@ function lf(e, t, r, n) {
7014
7014
  else
7015
7015
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof e);
7016
7016
  }
7017
- var df = js.exports, pf = df.EventEmitter;
7017
+ var lf = js.exports, df = lf.EventEmitter;
7018
7018
  const pl = {}, yl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7019
7019
  __proto__: null,
7020
7020
  default: pl
7021
- }, Symbol.toStringTag, { value: "Module" })), Gs = /* @__PURE__ */ xa(yl);
7022
- var Xi, $o;
7021
+ }, Symbol.toStringTag, { value: "Module" })), Gs = /* @__PURE__ */ Ea(yl);
7022
+ var Xi, Ho;
7023
7023
  function bl() {
7024
- if ($o) return Xi;
7025
- $o = 1;
7026
- function e(O, B) {
7027
- var A = Object.keys(O);
7024
+ if (Ho) return Xi;
7025
+ Ho = 1;
7026
+ function e(O, A) {
7027
+ var T = Object.keys(O);
7028
7028
  if (Object.getOwnPropertySymbols) {
7029
7029
  var k = Object.getOwnPropertySymbols(O);
7030
- B && (k = k.filter(function(U) {
7030
+ A && (k = k.filter(function(U) {
7031
7031
  return Object.getOwnPropertyDescriptor(O, U).enumerable;
7032
- })), A.push.apply(A, k);
7032
+ })), T.push.apply(T, k);
7033
7033
  }
7034
- return A;
7034
+ return T;
7035
7035
  }
7036
7036
  function t(O) {
7037
- for (var B = 1; B < arguments.length; B++) {
7038
- var A = arguments[B] != null ? arguments[B] : {};
7039
- B % 2 ? e(Object(A), !0).forEach(function(k) {
7040
- r(O, k, A[k]);
7041
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(O, Object.getOwnPropertyDescriptors(A)) : e(Object(A)).forEach(function(k) {
7042
- Object.defineProperty(O, k, Object.getOwnPropertyDescriptor(A, k));
7037
+ for (var A = 1; A < arguments.length; A++) {
7038
+ var T = arguments[A] != null ? arguments[A] : {};
7039
+ A % 2 ? e(Object(T), !0).forEach(function(k) {
7040
+ r(O, k, T[k]);
7041
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(O, Object.getOwnPropertyDescriptors(T)) : e(Object(T)).forEach(function(k) {
7042
+ Object.defineProperty(O, k, Object.getOwnPropertyDescriptor(T, k));
7043
7043
  });
7044
7044
  }
7045
7045
  return O;
7046
7046
  }
7047
- function r(O, B, A) {
7048
- return B = o(B), B in O ? Object.defineProperty(O, B, { value: A, enumerable: !0, configurable: !0, writable: !0 }) : O[B] = A, O;
7047
+ function r(O, A, T) {
7048
+ return A = o(A), A in O ? Object.defineProperty(O, A, { value: T, enumerable: !0, configurable: !0, writable: !0 }) : O[A] = T, O;
7049
7049
  }
7050
- function n(O, B) {
7051
- if (!(O instanceof B))
7050
+ function n(O, A) {
7051
+ if (!(O instanceof A))
7052
7052
  throw new TypeError("Cannot call a class as a function");
7053
7053
  }
7054
- function i(O, B) {
7055
- for (var A = 0; A < B.length; A++) {
7056
- var k = B[A];
7054
+ function i(O, A) {
7055
+ for (var T = 0; T < A.length; T++) {
7056
+ var k = A[T];
7057
7057
  k.enumerable = k.enumerable || !1, k.configurable = !0, "value" in k && (k.writable = !0), Object.defineProperty(O, o(k.key), k);
7058
7058
  }
7059
7059
  }
7060
- function s(O, B, A) {
7061
- return B && i(O.prototype, B), Object.defineProperty(O, "prototype", { writable: !1 }), O;
7060
+ function s(O, A, T) {
7061
+ return A && i(O.prototype, A), Object.defineProperty(O, "prototype", { writable: !1 }), O;
7062
7062
  }
7063
7063
  function o(O) {
7064
- var B = a(O, "string");
7065
- return typeof B == "symbol" ? B : String(B);
7064
+ var A = a(O, "string");
7065
+ return typeof A == "symbol" ? A : String(A);
7066
7066
  }
7067
- function a(O, B) {
7067
+ function a(O, A) {
7068
7068
  if (typeof O != "object" || O === null) return O;
7069
- var A = O[Symbol.toPrimitive];
7070
- if (A !== void 0) {
7071
- var k = A.call(O, B || "default");
7069
+ var T = O[Symbol.toPrimitive];
7070
+ if (T !== void 0) {
7071
+ var k = T.call(O, A || "default");
7072
7072
  if (typeof k != "object") return k;
7073
7073
  throw new TypeError("@@toPrimitive must return a primitive value.");
7074
7074
  }
7075
- return (B === "string" ? String : Number)(O);
7075
+ return (A === "string" ? String : Number)(O);
7076
7076
  }
7077
7077
  var c = St, l = c.Buffer, d = Gs, g = d.inspect, x = g && g.custom || "inspect";
7078
- function y(O, B, A) {
7079
- l.prototype.copy.call(O, B, A);
7078
+ function y(O, A, T) {
7079
+ l.prototype.copy.call(O, A, T);
7080
7080
  }
7081
7081
  return Xi = /* @__PURE__ */ function() {
7082
7082
  function O() {
@@ -7084,18 +7084,18 @@ function bl() {
7084
7084
  }
7085
7085
  return s(O, [{
7086
7086
  key: "push",
7087
- value: function(A) {
7087
+ value: function(T) {
7088
7088
  var k = {
7089
- data: A,
7089
+ data: T,
7090
7090
  next: null
7091
7091
  };
7092
7092
  this.length > 0 ? this.tail.next = k : this.head = k, this.tail = k, ++this.length;
7093
7093
  }
7094
7094
  }, {
7095
7095
  key: "unshift",
7096
- value: function(A) {
7096
+ value: function(T) {
7097
7097
  var k = {
7098
- data: A,
7098
+ data: T,
7099
7099
  next: this.head
7100
7100
  };
7101
7101
  this.length === 0 && (this.tail = k), this.head = k, ++this.length;
@@ -7104,8 +7104,8 @@ function bl() {
7104
7104
  key: "shift",
7105
7105
  value: function() {
7106
7106
  if (this.length !== 0) {
7107
- var A = this.head.data;
7108
- return this.length === 1 ? this.head = this.tail = null : this.head = this.head.next, --this.length, A;
7107
+ var T = this.head.data;
7108
+ return this.length === 1 ? this.head = this.tail = null : this.head = this.head.next, --this.length, T;
7109
7109
  }
7110
7110
  }
7111
7111
  }, {
@@ -7115,25 +7115,25 @@ function bl() {
7115
7115
  }
7116
7116
  }, {
7117
7117
  key: "join",
7118
- value: function(A) {
7118
+ value: function(T) {
7119
7119
  if (this.length === 0) return "";
7120
- for (var k = this.head, U = "" + k.data; k = k.next; ) U += A + k.data;
7120
+ for (var k = this.head, U = "" + k.data; k = k.next; ) U += T + k.data;
7121
7121
  return U;
7122
7122
  }
7123
7123
  }, {
7124
7124
  key: "concat",
7125
- value: function(A) {
7125
+ value: function(T) {
7126
7126
  if (this.length === 0) return l.alloc(0);
7127
- for (var k = l.allocUnsafe(A >>> 0), U = this.head, _ = 0; U; )
7127
+ for (var k = l.allocUnsafe(T >>> 0), U = this.head, _ = 0; U; )
7128
7128
  y(U.data, k, _), _ += U.data.length, U = U.next;
7129
7129
  return k;
7130
7130
  }
7131
7131
  // Consumes a specified amount of bytes or characters from the buffered data.
7132
7132
  }, {
7133
7133
  key: "consume",
7134
- value: function(A, k) {
7134
+ value: function(T, k) {
7135
7135
  var U;
7136
- return A < this.head.data.length ? (U = this.head.data.slice(0, A), this.head.data = this.head.data.slice(A)) : A === this.head.data.length ? U = this.shift() : U = k ? this._getString(A) : this._getBuffer(A), U;
7136
+ return T < this.head.data.length ? (U = this.head.data.slice(0, T), this.head.data = this.head.data.slice(T)) : T === this.head.data.length ? U = this.shift() : U = k ? this._getString(T) : this._getBuffer(T), U;
7137
7137
  }
7138
7138
  }, {
7139
7139
  key: "first",
@@ -7143,11 +7143,11 @@ function bl() {
7143
7143
  // Consumes a specified amount of characters from the buffered data.
7144
7144
  }, {
7145
7145
  key: "_getString",
7146
- value: function(A) {
7146
+ value: function(T) {
7147
7147
  var k = this.head, U = 1, _ = k.data;
7148
- for (A -= _.length; k = k.next; ) {
7149
- var m = k.data, S = A > m.length ? m.length : A;
7150
- if (S === m.length ? _ += m : _ += m.slice(0, A), A -= S, A === 0) {
7148
+ for (T -= _.length; k = k.next; ) {
7149
+ var m = k.data, S = T > m.length ? m.length : T;
7150
+ if (S === m.length ? _ += m : _ += m.slice(0, T), T -= S, T === 0) {
7151
7151
  S === m.length ? (++U, k.next ? this.head = k.next : this.head = this.tail = null) : (this.head = k, k.data = m.slice(S));
7152
7152
  break;
7153
7153
  }
@@ -7158,11 +7158,11 @@ function bl() {
7158
7158
  // Consumes a specified amount of bytes from the buffered data.
7159
7159
  }, {
7160
7160
  key: "_getBuffer",
7161
- value: function(A) {
7162
- var k = l.allocUnsafe(A), U = this.head, _ = 1;
7163
- for (U.data.copy(k), A -= U.data.length; U = U.next; ) {
7164
- var m = U.data, S = A > m.length ? m.length : A;
7165
- if (m.copy(k, k.length - A, 0, S), A -= S, A === 0) {
7161
+ value: function(T) {
7162
+ var k = l.allocUnsafe(T), U = this.head, _ = 1;
7163
+ for (U.data.copy(k), T -= U.data.length; U = U.next; ) {
7164
+ var m = U.data, S = T > m.length ? m.length : T;
7165
+ if (m.copy(k, k.length - T, 0, S), T -= S, T === 0) {
7166
7166
  S === m.length ? (++_, U.next ? this.head = U.next : this.head = this.tail = null) : (this.head = U, U.data = m.slice(S));
7167
7167
  break;
7168
7168
  }
@@ -7173,7 +7173,7 @@ function bl() {
7173
7173
  // Make sure the linked list only shows the minimal necessary information.
7174
7174
  }, {
7175
7175
  key: x,
7176
- value: function(A, k) {
7176
+ value: function(T, k) {
7177
7177
  return g(this, t(t({}, k), {}, {
7178
7178
  // Only inspect one level.
7179
7179
  depth: 0,
@@ -7187,10 +7187,10 @@ function bl() {
7187
7187
  function wl(e, t) {
7188
7188
  var r = this, n = this._readableState && this._readableState.destroyed, i = this._writableState && this._writableState.destroyed;
7189
7189
  return n || i ? (t ? t(e) : e && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, process.nextTick(ms, this, e)) : process.nextTick(ms, this, e)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(e || null, function(s) {
7190
- !t && s ? r._writableState ? r._writableState.errorEmitted ? process.nextTick(Kn, r) : (r._writableState.errorEmitted = !0, process.nextTick(Do, r, s)) : process.nextTick(Do, r, s) : t ? (process.nextTick(Kn, r), t(s)) : process.nextTick(Kn, r);
7190
+ !t && s ? r._writableState ? r._writableState.errorEmitted ? process.nextTick(Kn, r) : (r._writableState.errorEmitted = !0, process.nextTick($o, r, s)) : process.nextTick($o, r, s) : t ? (process.nextTick(Kn, r), t(s)) : process.nextTick(Kn, r);
7191
7191
  }), this);
7192
7192
  }
7193
- function Do(e, t) {
7193
+ function $o(e, t) {
7194
7194
  ms(e, t), Kn(e);
7195
7195
  }
7196
7196
  function Kn(e) {
@@ -7206,7 +7206,7 @@ function ml(e, t) {
7206
7206
  var r = e._readableState, n = e._writableState;
7207
7207
  r && r.autoDestroy || n && n.autoDestroy ? e.destroy(t) : e.emit("error", t);
7208
7208
  }
7209
- var yf = {
7209
+ var pf = {
7210
7210
  destroy: wl,
7211
7211
  undestroy: gl,
7212
7212
  errorOrDestroy: ml
@@ -7214,7 +7214,7 @@ var yf = {
7214
7214
  function _l(e, t) {
7215
7215
  e.prototype = Object.create(t.prototype), e.prototype.constructor = e, e.__proto__ = t;
7216
7216
  }
7217
- var bf = {};
7217
+ var yf = {};
7218
7218
  function Je(e, t, r) {
7219
7219
  r || (r = Error);
7220
7220
  function n(s, o, a) {
@@ -7227,9 +7227,9 @@ function Je(e, t, r) {
7227
7227
  }
7228
7228
  return o;
7229
7229
  }(r);
7230
- i.prototype.name = r.name, i.prototype.code = e, bf[e] = i;
7230
+ i.prototype.name = r.name, i.prototype.code = e, yf[e] = i;
7231
7231
  }
7232
- function jo(e, t) {
7232
+ function Do(e, t) {
7233
7233
  if (Array.isArray(e)) {
7234
7234
  var r = e.length;
7235
7235
  return e = e.map(function(n) {
@@ -7255,10 +7255,10 @@ Je("ERR_INVALID_ARG_TYPE", function(e, t, r) {
7255
7255
  typeof t == "string" && vl(t, "not ") ? (n = "must not be", t = t.replace(/^not /, "")) : n = "must be";
7256
7256
  var i;
7257
7257
  if (El(e, " argument"))
7258
- i = "The ".concat(e, " ").concat(n, " ").concat(jo(t, "type"));
7258
+ i = "The ".concat(e, " ").concat(n, " ").concat(Do(t, "type"));
7259
7259
  else {
7260
7260
  var s = xl(e, ".") ? "property" : "argument";
7261
- i = 'The "'.concat(e, '" ').concat(s, " ").concat(n, " ").concat(jo(t, "type"));
7261
+ i = 'The "'.concat(e, '" ').concat(s, " ").concat(n, " ").concat(Do(t, "type"));
7262
7262
  }
7263
7263
  return i += ". Received type ".concat(typeof r), i;
7264
7264
  }, TypeError);
@@ -7278,7 +7278,7 @@ Je("ERR_UNKNOWN_ENCODING", function(e) {
7278
7278
  return "Unknown encoding: " + e;
7279
7279
  }, TypeError);
7280
7280
  Je("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
7281
- fr.codes = bf;
7281
+ fr.codes = yf;
7282
7282
  var Sl = fr.codes.ERR_INVALID_OPT_VALUE;
7283
7283
  function Bl(e, t, r) {
7284
7284
  return e.highWaterMark != null ? e.highWaterMark : t ? e[r] : null;
@@ -7294,7 +7294,7 @@ function Pl(e, t, r, n) {
7294
7294
  }
7295
7295
  return e.objectMode ? 16 : 16 * 1024;
7296
7296
  }
7297
- var wf = {
7297
+ var bf = {
7298
7298
  getHighWaterMark: Pl
7299
7299
  }, Tl = Al;
7300
7300
  function Al(e, t) {
@@ -7320,42 +7320,42 @@ function Ji(e) {
7320
7320
  var t = Mt.localStorage[e];
7321
7321
  return t == null ? !1 : String(t).toLowerCase() === "true";
7322
7322
  }
7323
- var Qi, Go;
7324
- function gf() {
7325
- if (Go) return Qi;
7326
- Go = 1, Qi = D;
7327
- function e(T) {
7328
- var P = this;
7323
+ var Qi, jo;
7324
+ function wf() {
7325
+ if (jo) return Qi;
7326
+ jo = 1, Qi = D;
7327
+ function e(P) {
7328
+ var B = this;
7329
7329
  this.next = null, this.entry = null, this.finish = function() {
7330
- ht(P, T);
7330
+ ht(B, P);
7331
7331
  };
7332
7332
  }
7333
7333
  var t;
7334
7334
  D.WritableState = E;
7335
7335
  var r = {
7336
7336
  deprecate: Tl
7337
- }, n = pf, i = St.Buffer, s = (typeof Mt < "u" ? Mt : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
7337
+ }, n = df, i = St.Buffer, s = (typeof Mt < "u" ? Mt : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
7338
7338
  };
7339
- function o(T) {
7340
- return i.from(T);
7339
+ function o(P) {
7340
+ return i.from(P);
7341
7341
  }
7342
- function a(T) {
7343
- return i.isBuffer(T) || T instanceof s;
7342
+ function a(P) {
7343
+ return i.isBuffer(P) || P instanceof s;
7344
7344
  }
7345
- var c = yf, l = wf, d = l.getHighWaterMark, g = fr.codes, x = g.ERR_INVALID_ARG_TYPE, y = g.ERR_METHOD_NOT_IMPLEMENTED, O = g.ERR_MULTIPLE_CALLBACK, B = g.ERR_STREAM_CANNOT_PIPE, A = g.ERR_STREAM_DESTROYED, k = g.ERR_STREAM_NULL_VALUES, U = g.ERR_STREAM_WRITE_AFTER_END, _ = g.ERR_UNKNOWN_ENCODING, m = c.errorOrDestroy;
7345
+ var c = pf, l = bf, d = l.getHighWaterMark, g = fr.codes, x = g.ERR_INVALID_ARG_TYPE, y = g.ERR_METHOD_NOT_IMPLEMENTED, O = g.ERR_MULTIPLE_CALLBACK, A = g.ERR_STREAM_CANNOT_PIPE, T = g.ERR_STREAM_DESTROYED, k = g.ERR_STREAM_NULL_VALUES, U = g.ERR_STREAM_WRITE_AFTER_END, _ = g.ERR_UNKNOWN_ENCODING, m = c.errorOrDestroy;
7346
7346
  Ie(D, n);
7347
7347
  function S() {
7348
7348
  }
7349
- function E(T, P, F) {
7350
- t = t || Rr(), T = T || {}, typeof F != "boolean" && (F = P instanceof t), this.objectMode = !!T.objectMode, F && (this.objectMode = this.objectMode || !!T.writableObjectMode), this.highWaterMark = d(this, T, "writableHighWaterMark", F), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
7351
- var G = T.decodeStrings === !1;
7352
- this.decodeStrings = !G, this.defaultEncoding = T.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(K) {
7353
- ae(P, K);
7354
- }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = T.emitClose !== !1, this.autoDestroy = !!T.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new e(this);
7349
+ function E(P, B, F) {
7350
+ t = t || Rr(), P = P || {}, typeof F != "boolean" && (F = B instanceof t), this.objectMode = !!P.objectMode, F && (this.objectMode = this.objectMode || !!P.writableObjectMode), this.highWaterMark = d(this, P, "writableHighWaterMark", F), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
7351
+ var G = P.decodeStrings === !1;
7352
+ this.decodeStrings = !G, this.defaultEncoding = P.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(K) {
7353
+ ae(B, K);
7354
+ }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = P.emitClose !== !1, this.autoDestroy = !!P.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new e(this);
7355
7355
  }
7356
7356
  E.prototype.getBuffer = function() {
7357
- for (var P = this.bufferedRequest, F = []; P; )
7358
- F.push(P), P = P.next;
7357
+ for (var B = this.bufferedRequest, F = []; B; )
7358
+ F.push(B), B = B.next;
7359
7359
  return F;
7360
7360
  }, function() {
7361
7361
  try {
@@ -7369,40 +7369,40 @@ function gf() {
7369
7369
  }();
7370
7370
  var H;
7371
7371
  typeof Symbol == "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] == "function" ? (H = Function.prototype[Symbol.hasInstance], Object.defineProperty(D, Symbol.hasInstance, {
7372
- value: function(P) {
7373
- return H.call(this, P) ? !0 : this !== D ? !1 : P && P._writableState instanceof E;
7372
+ value: function(B) {
7373
+ return H.call(this, B) ? !0 : this !== D ? !1 : B && B._writableState instanceof E;
7374
7374
  }
7375
- })) : H = function(P) {
7376
- return P instanceof this;
7375
+ })) : H = function(B) {
7376
+ return B instanceof this;
7377
7377
  };
7378
- function D(T) {
7378
+ function D(P) {
7379
7379
  t = t || Rr();
7380
- var P = this instanceof t;
7381
- if (!P && !H.call(D, this)) return new D(T);
7382
- this._writableState = new E(T, this, P), this.writable = !0, T && (typeof T.write == "function" && (this._write = T.write), typeof T.writev == "function" && (this._writev = T.writev), typeof T.destroy == "function" && (this._destroy = T.destroy), typeof T.final == "function" && (this._final = T.final)), n.call(this);
7380
+ var B = this instanceof t;
7381
+ if (!B && !H.call(D, this)) return new D(P);
7382
+ this._writableState = new E(P, this, B), this.writable = !0, P && (typeof P.write == "function" && (this._write = P.write), typeof P.writev == "function" && (this._writev = P.writev), typeof P.destroy == "function" && (this._destroy = P.destroy), typeof P.final == "function" && (this._final = P.final)), n.call(this);
7383
7383
  }
7384
7384
  D.prototype.pipe = function() {
7385
- m(this, new B());
7385
+ m(this, new A());
7386
7386
  };
7387
- function R(T, P) {
7387
+ function R(P, B) {
7388
7388
  var F = new U();
7389
- m(T, F), process.nextTick(P, F);
7389
+ m(P, F), process.nextTick(B, F);
7390
7390
  }
7391
- function z(T, P, F, G) {
7391
+ function z(P, B, F, G) {
7392
7392
  var K;
7393
- return F === null ? K = new k() : typeof F != "string" && !P.objectMode && (K = new x("chunk", ["string", "Buffer"], F)), K ? (m(T, K), process.nextTick(G, K), !1) : !0;
7393
+ return F === null ? K = new k() : typeof F != "string" && !B.objectMode && (K = new x("chunk", ["string", "Buffer"], F)), K ? (m(P, K), process.nextTick(G, K), !1) : !0;
7394
7394
  }
7395
- D.prototype.write = function(T, P, F) {
7396
- var G = this._writableState, K = !1, b = !G.objectMode && a(T);
7397
- return b && !i.isBuffer(T) && (T = o(T)), typeof P == "function" && (F = P, P = null), b ? P = "buffer" : P || (P = G.defaultEncoding), typeof F != "function" && (F = S), G.ending ? R(this, F) : (b || z(this, G, T, F)) && (G.pendingcb++, K = C(this, G, b, T, P, F)), K;
7395
+ D.prototype.write = function(P, B, F) {
7396
+ var G = this._writableState, K = !1, b = !G.objectMode && a(P);
7397
+ return b && !i.isBuffer(P) && (P = o(P)), typeof B == "function" && (F = B, B = null), b ? B = "buffer" : B || (B = G.defaultEncoding), typeof F != "function" && (F = S), G.ending ? R(this, F) : (b || z(this, G, P, F)) && (G.pendingcb++, K = C(this, G, b, P, B, F)), K;
7398
7398
  }, D.prototype.cork = function() {
7399
7399
  this._writableState.corked++;
7400
7400
  }, D.prototype.uncork = function() {
7401
- var T = this._writableState;
7402
- T.corked && (T.corked--, !T.writing && !T.corked && !T.bufferProcessing && T.bufferedRequest && Ge(this, T));
7403
- }, D.prototype.setDefaultEncoding = function(P) {
7404
- if (typeof P == "string" && (P = P.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((P + "").toLowerCase()) > -1)) throw new _(P);
7405
- return this._writableState.defaultEncoding = P, this;
7401
+ var P = this._writableState;
7402
+ P.corked && (P.corked--, !P.writing && !P.corked && !P.bufferProcessing && P.bufferedRequest && Ge(this, P));
7403
+ }, D.prototype.setDefaultEncoding = function(B) {
7404
+ if (typeof B == "string" && (B = B.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((B + "").toLowerCase()) > -1)) throw new _(B);
7405
+ return this._writableState.defaultEncoding = B, this;
7406
7406
  }, Object.defineProperty(D.prototype, "writableBuffer", {
7407
7407
  // making it explicit this property is not enumerable
7408
7408
  // because otherwise some prototype manipulation in
@@ -7412,8 +7412,8 @@ function gf() {
7412
7412
  return this._writableState && this._writableState.getBuffer();
7413
7413
  }
7414
7414
  });
7415
- function Z(T, P, F) {
7416
- return !T.objectMode && T.decodeStrings !== !1 && typeof P == "string" && (P = i.from(P, F)), P;
7415
+ function Z(P, B, F) {
7416
+ return !P.objectMode && P.decodeStrings !== !1 && typeof B == "string" && (B = i.from(B, F)), B;
7417
7417
  }
7418
7418
  Object.defineProperty(D.prototype, "writableHighWaterMark", {
7419
7419
  // making it explicit this property is not enumerable
@@ -7424,75 +7424,75 @@ function gf() {
7424
7424
  return this._writableState.highWaterMark;
7425
7425
  }
7426
7426
  });
7427
- function C(T, P, F, G, K, b) {
7427
+ function C(P, B, F, G, K, b) {
7428
7428
  if (!F) {
7429
- var w = Z(P, G, K);
7429
+ var w = Z(B, G, K);
7430
7430
  G !== w && (F = !0, K = "buffer", G = w);
7431
7431
  }
7432
- var N = P.objectMode ? 1 : G.length;
7433
- P.length += N;
7434
- var $ = P.length < P.highWaterMark;
7435
- if ($ || (P.needDrain = !0), P.writing || P.corked) {
7436
- var pe = P.lastBufferedRequest;
7437
- P.lastBufferedRequest = {
7432
+ var N = B.objectMode ? 1 : G.length;
7433
+ B.length += N;
7434
+ var $ = B.length < B.highWaterMark;
7435
+ if ($ || (B.needDrain = !0), B.writing || B.corked) {
7436
+ var pe = B.lastBufferedRequest;
7437
+ B.lastBufferedRequest = {
7438
7438
  chunk: G,
7439
7439
  encoding: K,
7440
7440
  isBuf: F,
7441
7441
  callback: b,
7442
7442
  next: null
7443
- }, pe ? pe.next = P.lastBufferedRequest : P.bufferedRequest = P.lastBufferedRequest, P.bufferedRequestCount += 1;
7443
+ }, pe ? pe.next = B.lastBufferedRequest : B.bufferedRequest = B.lastBufferedRequest, B.bufferedRequestCount += 1;
7444
7444
  } else
7445
- M(T, P, !1, N, G, K, b);
7445
+ M(P, B, !1, N, G, K, b);
7446
7446
  return $;
7447
7447
  }
7448
- function M(T, P, F, G, K, b, w) {
7449
- P.writelen = G, P.writecb = w, P.writing = !0, P.sync = !0, P.destroyed ? P.onwrite(new A("write")) : F ? T._writev(K, P.onwrite) : T._write(K, b, P.onwrite), P.sync = !1;
7448
+ function M(P, B, F, G, K, b, w) {
7449
+ B.writelen = G, B.writecb = w, B.writing = !0, B.sync = !0, B.destroyed ? B.onwrite(new T("write")) : F ? P._writev(K, B.onwrite) : P._write(K, b, B.onwrite), B.sync = !1;
7450
7450
  }
7451
- function W(T, P, F, G, K) {
7452
- --P.pendingcb, F ? (process.nextTick(K, G), process.nextTick(We, T, P), T._writableState.errorEmitted = !0, m(T, G)) : (K(G), T._writableState.errorEmitted = !0, m(T, G), We(T, P));
7451
+ function W(P, B, F, G, K) {
7452
+ --B.pendingcb, F ? (process.nextTick(K, G), process.nextTick(We, P, B), P._writableState.errorEmitted = !0, m(P, G)) : (K(G), P._writableState.errorEmitted = !0, m(P, G), We(P, B));
7453
7453
  }
7454
- function q(T) {
7455
- T.writing = !1, T.writecb = null, T.length -= T.writelen, T.writelen = 0;
7454
+ function q(P) {
7455
+ P.writing = !1, P.writecb = null, P.length -= P.writelen, P.writelen = 0;
7456
7456
  }
7457
- function ae(T, P) {
7458
- var F = T._writableState, G = F.sync, K = F.writecb;
7457
+ function ae(P, B) {
7458
+ var F = P._writableState, G = F.sync, K = F.writecb;
7459
7459
  if (typeof K != "function") throw new O();
7460
- if (q(F), P) W(T, F, G, P, K);
7460
+ if (q(F), B) W(P, F, G, B, K);
7461
7461
  else {
7462
- var b = rt(F) || T.destroyed;
7463
- !b && !F.corked && !F.bufferProcessing && F.bufferedRequest && Ge(T, F), G ? process.nextTick(fe, T, F, b, K) : fe(T, F, b, K);
7462
+ var b = rt(F) || P.destroyed;
7463
+ !b && !F.corked && !F.bufferProcessing && F.bufferedRequest && Ge(P, F), G ? process.nextTick(fe, P, F, b, K) : fe(P, F, b, K);
7464
7464
  }
7465
7465
  }
7466
- function fe(T, P, F, G) {
7467
- F || Qe(T, P), P.pendingcb--, G(), We(T, P);
7466
+ function fe(P, B, F, G) {
7467
+ F || Qe(P, B), B.pendingcb--, G(), We(P, B);
7468
7468
  }
7469
- function Qe(T, P) {
7470
- P.length === 0 && P.needDrain && (P.needDrain = !1, T.emit("drain"));
7469
+ function Qe(P, B) {
7470
+ B.length === 0 && B.needDrain && (B.needDrain = !1, P.emit("drain"));
7471
7471
  }
7472
- function Ge(T, P) {
7473
- P.bufferProcessing = !0;
7474
- var F = P.bufferedRequest;
7475
- if (T._writev && F && F.next) {
7476
- var G = P.bufferedRequestCount, K = new Array(G), b = P.corkedRequestsFree;
7472
+ function Ge(P, B) {
7473
+ B.bufferProcessing = !0;
7474
+ var F = B.bufferedRequest;
7475
+ if (P._writev && F && F.next) {
7476
+ var G = B.bufferedRequestCount, K = new Array(G), b = B.corkedRequestsFree;
7477
7477
  b.entry = F;
7478
7478
  for (var w = 0, N = !0; F; )
7479
7479
  K[w] = F, F.isBuf || (N = !1), F = F.next, w += 1;
7480
- K.allBuffers = N, M(T, P, !0, P.length, K, "", b.finish), P.pendingcb++, P.lastBufferedRequest = null, b.next ? (P.corkedRequestsFree = b.next, b.next = null) : P.corkedRequestsFree = new e(P), P.bufferedRequestCount = 0;
7480
+ K.allBuffers = N, M(P, B, !0, B.length, K, "", b.finish), B.pendingcb++, B.lastBufferedRequest = null, b.next ? (B.corkedRequestsFree = b.next, b.next = null) : B.corkedRequestsFree = new e(B), B.bufferedRequestCount = 0;
7481
7481
  } else {
7482
7482
  for (; F; ) {
7483
- var $ = F.chunk, pe = F.encoding, Y = F.callback, te = P.objectMode ? 1 : $.length;
7484
- if (M(T, P, !1, te, $, pe, Y), F = F.next, P.bufferedRequestCount--, P.writing)
7483
+ var $ = F.chunk, pe = F.encoding, Y = F.callback, te = B.objectMode ? 1 : $.length;
7484
+ if (M(P, B, !1, te, $, pe, Y), F = F.next, B.bufferedRequestCount--, B.writing)
7485
7485
  break;
7486
7486
  }
7487
- F === null && (P.lastBufferedRequest = null);
7487
+ F === null && (B.lastBufferedRequest = null);
7488
7488
  }
7489
- P.bufferedRequest = F, P.bufferProcessing = !1;
7489
+ B.bufferedRequest = F, B.bufferProcessing = !1;
7490
7490
  }
7491
- D.prototype._write = function(T, P, F) {
7491
+ D.prototype._write = function(P, B, F) {
7492
7492
  F(new y("_write()"));
7493
- }, D.prototype._writev = null, D.prototype.end = function(T, P, F) {
7493
+ }, D.prototype._writev = null, D.prototype.end = function(P, B, F) {
7494
7494
  var G = this._writableState;
7495
- return typeof T == "function" ? (F = T, T = null, P = null) : typeof P == "function" && (F = P, P = null), T != null && this.write(T, P), G.corked && (G.corked = 1, this.uncork()), G.ending || Bt(this, G, F), this;
7495
+ return typeof P == "function" ? (F = P, P = null, B = null) : typeof B == "function" && (F = B, B = null), P != null && this.write(P, B), G.corked && (G.corked = 1, this.uncork()), G.ending || Bt(this, G, F), this;
7496
7496
  }, Object.defineProperty(D.prototype, "writableLength", {
7497
7497
  // making it explicit this property is not enumerable
7498
7498
  // because otherwise some prototype manipulation in
@@ -7502,35 +7502,35 @@ function gf() {
7502
7502
  return this._writableState.length;
7503
7503
  }
7504
7504
  });
7505
- function rt(T) {
7506
- return T.ending && T.length === 0 && T.bufferedRequest === null && !T.finished && !T.writing;
7505
+ function rt(P) {
7506
+ return P.ending && P.length === 0 && P.bufferedRequest === null && !P.finished && !P.writing;
7507
7507
  }
7508
- function de(T, P) {
7509
- T._final(function(F) {
7510
- P.pendingcb--, F && m(T, F), P.prefinished = !0, T.emit("prefinish"), We(T, P);
7508
+ function de(P, B) {
7509
+ P._final(function(F) {
7510
+ B.pendingcb--, F && m(P, F), B.prefinished = !0, P.emit("prefinish"), We(P, B);
7511
7511
  });
7512
7512
  }
7513
- function ve(T, P) {
7514
- !P.prefinished && !P.finalCalled && (typeof T._final == "function" && !P.destroyed ? (P.pendingcb++, P.finalCalled = !0, process.nextTick(de, T, P)) : (P.prefinished = !0, T.emit("prefinish")));
7513
+ function ve(P, B) {
7514
+ !B.prefinished && !B.finalCalled && (typeof P._final == "function" && !B.destroyed ? (B.pendingcb++, B.finalCalled = !0, process.nextTick(de, P, B)) : (B.prefinished = !0, P.emit("prefinish")));
7515
7515
  }
7516
- function We(T, P) {
7517
- var F = rt(P);
7518
- if (F && (ve(T, P), P.pendingcb === 0 && (P.finished = !0, T.emit("finish"), P.autoDestroy))) {
7519
- var G = T._readableState;
7520
- (!G || G.autoDestroy && G.endEmitted) && T.destroy();
7516
+ function We(P, B) {
7517
+ var F = rt(B);
7518
+ if (F && (ve(P, B), B.pendingcb === 0 && (B.finished = !0, P.emit("finish"), B.autoDestroy))) {
7519
+ var G = P._readableState;
7520
+ (!G || G.autoDestroy && G.endEmitted) && P.destroy();
7521
7521
  }
7522
7522
  return F;
7523
7523
  }
7524
- function Bt(T, P, F) {
7525
- P.ending = !0, We(T, P), F && (P.finished ? process.nextTick(F) : T.once("finish", F)), P.ended = !0, T.writable = !1;
7524
+ function Bt(P, B, F) {
7525
+ B.ending = !0, We(P, B), F && (B.finished ? process.nextTick(F) : P.once("finish", F)), B.ended = !0, P.writable = !1;
7526
7526
  }
7527
- function ht(T, P, F) {
7528
- var G = T.entry;
7529
- for (T.entry = null; G; ) {
7527
+ function ht(P, B, F) {
7528
+ var G = P.entry;
7529
+ for (P.entry = null; G; ) {
7530
7530
  var K = G.callback;
7531
- P.pendingcb--, K(F), G = G.next;
7531
+ B.pendingcb--, K(F), G = G.next;
7532
7532
  }
7533
- P.corkedRequestsFree.next = T;
7533
+ B.corkedRequestsFree.next = P;
7534
7534
  }
7535
7535
  return Object.defineProperty(D.prototype, "destroyed", {
7536
7536
  // making it explicit this property is not enumerable
@@ -7540,24 +7540,24 @@ function gf() {
7540
7540
  get: function() {
7541
7541
  return this._writableState === void 0 ? !1 : this._writableState.destroyed;
7542
7542
  },
7543
- set: function(P) {
7544
- this._writableState && (this._writableState.destroyed = P);
7543
+ set: function(B) {
7544
+ this._writableState && (this._writableState.destroyed = B);
7545
7545
  }
7546
- }), D.prototype.destroy = c.destroy, D.prototype._undestroy = c.undestroy, D.prototype._destroy = function(T, P) {
7547
- P(T);
7546
+ }), D.prototype.destroy = c.destroy, D.prototype._undestroy = c.undestroy, D.prototype._destroy = function(P, B) {
7547
+ B(P);
7548
7548
  }, Qi;
7549
7549
  }
7550
- var Zi, Wo;
7550
+ var Zi, Go;
7551
7551
  function Rr() {
7552
- if (Wo) return Zi;
7553
- Wo = 1;
7552
+ if (Go) return Zi;
7553
+ Go = 1;
7554
7554
  var e = Object.keys || function(l) {
7555
7555
  var d = [];
7556
7556
  for (var g in l) d.push(g);
7557
7557
  return d;
7558
7558
  };
7559
7559
  Zi = o;
7560
- var t = _f(), r = gf();
7560
+ var t = mf(), r = wf();
7561
7561
  Ie(o, t);
7562
7562
  for (var n = e(r.prototype), i = 0; i < n.length; i++) {
7563
7563
  var s = n[i];
@@ -7611,7 +7611,7 @@ function Rr() {
7611
7611
  }
7612
7612
  }), Zi;
7613
7613
  }
7614
- var ti = {}, Ws = je.Buffer, Vo = Ws.isEncoding || function(e) {
7614
+ var ti = {}, Ws = je.Buffer, Wo = Ws.isEncoding || function(e) {
7615
7615
  switch (e = "" + e, e && e.toLowerCase()) {
7616
7616
  case "hex":
7617
7617
  case "utf8":
@@ -7655,7 +7655,7 @@ function Il(e) {
7655
7655
  }
7656
7656
  function Ol(e) {
7657
7657
  var t = Il(e);
7658
- if (typeof t != "string" && (Ws.isEncoding === Vo || !Vo(e))) throw new Error("Unknown encoding: " + e);
7658
+ if (typeof t != "string" && (Ws.isEncoding === Wo || !Wo(e))) throw new Error("Unknown encoding: " + e);
7659
7659
  return t || e;
7660
7660
  }
7661
7661
  ti.StringDecoder = bn;
@@ -7766,7 +7766,7 @@ function $l(e) {
7766
7766
  function Dl(e) {
7767
7767
  return e && e.length ? this.write(e) : "";
7768
7768
  }
7769
- var zo = fr.codes.ERR_STREAM_PREMATURE_CLOSE;
7769
+ var Vo = fr.codes.ERR_STREAM_PREMATURE_CLOSE;
7770
7770
  function jl(e) {
7771
7771
  var t = !1;
7772
7772
  return function() {
@@ -7783,8 +7783,8 @@ function Gl() {
7783
7783
  function Wl(e) {
7784
7784
  return e.setHeader && typeof e.abort == "function";
7785
7785
  }
7786
- function mf(e, t, r) {
7787
- if (typeof t == "function") return mf(e, null, t);
7786
+ function gf(e, t, r) {
7787
+ if (typeof t == "function") return gf(e, null, t);
7788
7788
  t || (t = {}), r = jl(r || Gl);
7789
7789
  var n = t.readable || t.readable !== !1 && e.readable, i = t.writable || t.writable !== !1 && e.writable, s = function() {
7790
7790
  e.writable || a();
@@ -7797,9 +7797,9 @@ function mf(e, t, r) {
7797
7797
  }, g = function() {
7798
7798
  var O;
7799
7799
  if (n && !c)
7800
- return (!e._readableState || !e._readableState.ended) && (O = new zo()), r.call(e, O);
7800
+ return (!e._readableState || !e._readableState.ended) && (O = new Vo()), r.call(e, O);
7801
7801
  if (i && !o)
7802
- return (!e._writableState || !e._writableState.ended) && (O = new zo()), r.call(e, O);
7802
+ return (!e._writableState || !e._writableState.ended) && (O = new Vo()), r.call(e, O);
7803
7803
  }, x = function() {
7804
7804
  e.req.on("finish", a);
7805
7805
  };
@@ -7807,10 +7807,10 @@ function mf(e, t, r) {
7807
7807
  e.removeListener("complete", a), e.removeListener("abort", g), e.removeListener("request", x), e.req && e.req.removeListener("finish", a), e.removeListener("end", s), e.removeListener("close", s), e.removeListener("finish", a), e.removeListener("end", l), e.removeListener("error", d), e.removeListener("close", g);
7808
7808
  };
7809
7809
  }
7810
- var Vs = mf, ts, qo;
7810
+ var Vs = gf, ts, zo;
7811
7811
  function Vl() {
7812
- if (qo) return ts;
7813
- qo = 1;
7812
+ if (zo) return ts;
7813
+ zo = 1;
7814
7814
  var e;
7815
7815
  function t(_, m, S) {
7816
7816
  return m = r(m), m in _ ? Object.defineProperty(_, m, { value: S, enumerable: !0, configurable: !0, writable: !0 }) : _[m] = S, _;
@@ -7846,7 +7846,7 @@ function Vl() {
7846
7846
  function O(_) {
7847
7847
  process.nextTick(y, _);
7848
7848
  }
7849
- function B(_, m) {
7849
+ function A(_, m) {
7850
7850
  return function(S, E) {
7851
7851
  _.then(function() {
7852
7852
  if (m[c]) {
@@ -7857,7 +7857,7 @@ function Vl() {
7857
7857
  }, E);
7858
7858
  };
7859
7859
  }
7860
- var A = Object.getPrototypeOf(function() {
7860
+ var T = Object.getPrototypeOf(function() {
7861
7861
  }), k = Object.setPrototypeOf((e = {
7862
7862
  get stream() {
7863
7863
  return this[g];
@@ -7876,7 +7876,7 @@ function Vl() {
7876
7876
  });
7877
7877
  var E = this[l], H;
7878
7878
  if (E)
7879
- H = new Promise(B(E, this));
7879
+ H = new Promise(A(E, this));
7880
7880
  else {
7881
7881
  var D = this[g].read();
7882
7882
  if (D !== null)
@@ -7898,7 +7898,7 @@ function Vl() {
7898
7898
  S(x(void 0, !0));
7899
7899
  });
7900
7900
  });
7901
- }), e), A), U = function(m) {
7901
+ }), e), T), U = function(m) {
7902
7902
  var S, E = Object.create(k, (S = {}, t(S, g, {
7903
7903
  value: m,
7904
7904
  writable: !0
@@ -7933,21 +7933,21 @@ function Vl() {
7933
7933
  };
7934
7934
  return ts = U, ts;
7935
7935
  }
7936
- var rs, Ko;
7936
+ var rs, qo;
7937
7937
  function zl() {
7938
- return Ko || (Ko = 1, rs = function() {
7938
+ return qo || (qo = 1, rs = function() {
7939
7939
  throw new Error("Readable.from is not available in the browser");
7940
7940
  }), rs;
7941
7941
  }
7942
- var ns, Yo;
7943
- function _f() {
7944
- if (Yo) return ns;
7945
- Yo = 1, ns = R;
7942
+ var ns, Ko;
7943
+ function mf() {
7944
+ if (Ko) return ns;
7945
+ Ko = 1, ns = R;
7946
7946
  var e;
7947
- R.ReadableState = D, df.EventEmitter;
7947
+ R.ReadableState = D, lf.EventEmitter;
7948
7948
  var t = function(w, N) {
7949
7949
  return w.listeners(N).length;
7950
- }, r = pf, n = St.Buffer, i = (typeof Mt < "u" ? Mt : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
7950
+ }, r = df, n = St.Buffer, i = (typeof Mt < "u" ? Mt : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() {
7951
7951
  };
7952
7952
  function s(b) {
7953
7953
  return n.from(b);
@@ -7958,7 +7958,7 @@ function _f() {
7958
7958
  var a = Gs, c;
7959
7959
  a && a.debuglog ? c = a.debuglog("stream") : c = function() {
7960
7960
  };
7961
- var l = bl(), d = yf, g = wf, x = g.getHighWaterMark, y = fr.codes, O = y.ERR_INVALID_ARG_TYPE, B = y.ERR_STREAM_PUSH_AFTER_EOF, A = y.ERR_METHOD_NOT_IMPLEMENTED, k = y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT, U, _, m;
7961
+ var l = bl(), d = pf, g = bf, x = g.getHighWaterMark, y = fr.codes, O = y.ERR_INVALID_ARG_TYPE, A = y.ERR_STREAM_PUSH_AFTER_EOF, T = y.ERR_METHOD_NOT_IMPLEMENTED, k = y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT, U, _, m;
7962
7962
  Ie(R, r);
7963
7963
  var S = d.errorOrDestroy, E = ["error", "close", "destroy", "pause", "resume"];
7964
7964
  function H(b, w, N) {
@@ -8005,7 +8005,7 @@ function _f() {
8005
8005
  if (typeof w != "string" && !Y.objectMode && Object.getPrototypeOf(w) !== n.prototype && (w = s(w)), $)
8006
8006
  Y.endEmitted ? S(b, new k()) : Z(b, Y, w, !0);
8007
8007
  else if (Y.ended)
8008
- S(b, new B());
8008
+ S(b, new A());
8009
8009
  else {
8010
8010
  if (Y.destroyed)
8011
8011
  return !1;
@@ -8049,7 +8049,7 @@ function _f() {
8049
8049
  var $ = w.needReadable;
8050
8050
  c("need readable", $), (w.length === 0 || w.length - b < w.highWaterMark) && ($ = !0, c("length less than watermark", $)), w.ended || w.reading ? ($ = !1, c("reading or ended", $)) : $ && (c("do read"), w.reading = !0, w.sync = !0, w.length === 0 && (w.needReadable = !0), this._read(w.highWaterMark), w.sync = !1, w.reading || (b = q(N, w)));
8051
8051
  var pe;
8052
- return b > 0 ? pe = P(b, w) : pe = null, pe === null ? (w.needReadable = w.length <= w.highWaterMark, b = 0) : (w.length -= b, w.awaitDrain = 0), w.length === 0 && (w.ended || (w.needReadable = !0), N !== b && w.ended && F(this)), pe !== null && this.emit("data", pe), pe;
8052
+ return b > 0 ? pe = B(b, w) : pe = null, pe === null ? (w.needReadable = w.length <= w.highWaterMark, b = 0) : (w.length -= b, w.awaitDrain = 0), w.length === 0 && (w.ended || (w.needReadable = !0), N !== b && w.ended && F(this)), pe !== null && this.emit("data", pe), pe;
8053
8053
  };
8054
8054
  function ae(b, w) {
8055
8055
  if (c("onEofChunk"), !w.ended) {
@@ -8066,7 +8066,7 @@ function _f() {
8066
8066
  }
8067
8067
  function Qe(b) {
8068
8068
  var w = b._readableState;
8069
- c("emitReadable_", w.destroyed, w.length, w.ended), !w.destroyed && (w.length || w.ended) && (b.emit("readable"), w.emittedReadable = !1), w.needReadable = !w.flowing && !w.ended && w.length <= w.highWaterMark, T(b);
8069
+ c("emitReadable_", w.destroyed, w.length, w.ended), !w.destroyed && (w.length || w.ended) && (b.emit("readable"), w.emittedReadable = !1), w.needReadable = !w.flowing && !w.ended && w.length <= w.highWaterMark, P(b);
8070
8070
  }
8071
8071
  function Ge(b, w) {
8072
8072
  w.readingMore || (w.readingMore = !0, process.nextTick(rt, b, w));
@@ -8080,7 +8080,7 @@ function _f() {
8080
8080
  w.readingMore = !1;
8081
8081
  }
8082
8082
  R.prototype._read = function(b) {
8083
- S(this, new A("_read()"));
8083
+ S(this, new T("_read()"));
8084
8084
  }, R.prototype.pipe = function(b, w) {
8085
8085
  var N = this, $ = this._readableState;
8086
8086
  switch ($.pipesCount) {
@@ -8135,7 +8135,7 @@ function _f() {
8135
8135
  function de(b) {
8136
8136
  return function() {
8137
8137
  var N = b._readableState;
8138
- c("pipeOnDrain", N.awaitDrain), N.awaitDrain && N.awaitDrain--, N.awaitDrain === 0 && t(b, "data") && (N.flowing = !0, T(b));
8138
+ c("pipeOnDrain", N.awaitDrain), N.awaitDrain && N.awaitDrain--, N.awaitDrain === 0 && t(b, "data") && (N.flowing = !0, P(b));
8139
8139
  };
8140
8140
  }
8141
8141
  R.prototype.unpipe = function(b) {
@@ -8180,12 +8180,12 @@ function _f() {
8180
8180
  w.resumeScheduled || (w.resumeScheduled = !0, process.nextTick(ht, b, w));
8181
8181
  }
8182
8182
  function ht(b, w) {
8183
- c("resume", w.reading), w.reading || b.read(0), w.resumeScheduled = !1, b.emit("resume"), T(b), w.flowing && !w.reading && b.read(0);
8183
+ c("resume", w.reading), w.reading || b.read(0), w.resumeScheduled = !1, b.emit("resume"), P(b), w.flowing && !w.reading && b.read(0);
8184
8184
  }
8185
8185
  R.prototype.pause = function() {
8186
8186
  return c("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (c("pause"), this._readableState.flowing = !1, this.emit("pause")), this._readableState.paused = !0, this;
8187
8187
  };
8188
- function T(b) {
8188
+ function P(b) {
8189
8189
  var w = b._readableState;
8190
8190
  for (c("flow", w.flowing); w.flowing && b.read() !== null; ) ;
8191
8191
  }
@@ -8243,7 +8243,7 @@ function _f() {
8243
8243
  set: function(w) {
8244
8244
  this._readableState && (this._readableState.flowing = w);
8245
8245
  }
8246
- }), R._fromList = P, Object.defineProperty(R.prototype, "readableLength", {
8246
+ }), R._fromList = B, Object.defineProperty(R.prototype, "readableLength", {
8247
8247
  // making it explicit this property is not enumerable
8248
8248
  // because otherwise some prototype manipulation in
8249
8249
  // userland will fail
@@ -8252,7 +8252,7 @@ function _f() {
8252
8252
  return this._readableState.length;
8253
8253
  }
8254
8254
  });
8255
- function P(b, w) {
8255
+ function B(b, w) {
8256
8256
  if (w.length === 0) return null;
8257
8257
  var N;
8258
8258
  return w.objectMode ? N = w.buffer.shift() : !b || b >= w.length ? (w.decoder ? N = w.buffer.join("") : w.buffer.length === 1 ? N = w.buffer.first() : N = w.buffer.concat(w.length), w.buffer.clear()) : N = w.buffer.consume(b, w.decoder), N;
@@ -8277,7 +8277,7 @@ function _f() {
8277
8277
  }
8278
8278
  return ns;
8279
8279
  }
8280
- var vf = xt, _i = fr.codes, ql = _i.ERR_METHOD_NOT_IMPLEMENTED, Kl = _i.ERR_MULTIPLE_CALLBACK, Yl = _i.ERR_TRANSFORM_ALREADY_TRANSFORMING, Xl = _i.ERR_TRANSFORM_WITH_LENGTH_0, vi = Rr();
8280
+ var _f = xt, _i = fr.codes, ql = _i.ERR_METHOD_NOT_IMPLEMENTED, Kl = _i.ERR_MULTIPLE_CALLBACK, Yl = _i.ERR_TRANSFORM_ALREADY_TRANSFORMING, Xl = _i.ERR_TRANSFORM_WITH_LENGTH_0, vi = Rr();
8281
8281
  Ie(xt, vi);
8282
8282
  function Jl(e, t) {
8283
8283
  var r = this._transformState;
@@ -8303,8 +8303,8 @@ function xt(e) {
8303
8303
  function Ql() {
8304
8304
  var e = this;
8305
8305
  typeof this._flush == "function" && !this._readableState.destroyed ? this._flush(function(t, r) {
8306
- Xo(e, t, r);
8307
- }) : Xo(this, null, null);
8306
+ Yo(e, t, r);
8307
+ }) : Yo(this, null, null);
8308
8308
  }
8309
8309
  xt.prototype.push = function(e, t) {
8310
8310
  return this._transformState.needTransform = !1, vi.prototype.push.call(this, e, t);
@@ -8328,17 +8328,17 @@ xt.prototype._destroy = function(e, t) {
8328
8328
  t(r);
8329
8329
  });
8330
8330
  };
8331
- function Xo(e, t, r) {
8331
+ function Yo(e, t, r) {
8332
8332
  if (t) return e.emit("error", t);
8333
8333
  if (r != null && e.push(r), e._writableState.length) throw new Xl();
8334
8334
  if (e._transformState.transforming) throw new Yl();
8335
8335
  return e.push(null);
8336
8336
  }
8337
- var Zl = ln, Ef = vf;
8338
- Ie(ln, Ef);
8337
+ var Zl = ln, vf = _f;
8338
+ Ie(ln, vf);
8339
8339
  function ln(e) {
8340
8340
  if (!(this instanceof ln)) return new ln(e);
8341
- Ef.call(this, e);
8341
+ vf.call(this, e);
8342
8342
  }
8343
8343
  ln.prototype._transform = function(e, t, r) {
8344
8344
  r(null, e);
@@ -8350,8 +8350,8 @@ function e0(e) {
8350
8350
  t || (t = !0, e.apply(void 0, arguments));
8351
8351
  };
8352
8352
  }
8353
- var xf = fr.codes, t0 = xf.ERR_MISSING_ARGS, r0 = xf.ERR_STREAM_DESTROYED;
8354
- function Jo(e) {
8353
+ var Ef = fr.codes, t0 = Ef.ERR_MISSING_ARGS, r0 = Ef.ERR_STREAM_DESTROYED;
8354
+ function Xo(e) {
8355
8355
  if (e) throw e;
8356
8356
  }
8357
8357
  function n0(e) {
@@ -8378,14 +8378,14 @@ function i0(e, t, r, n) {
8378
8378
  }
8379
8379
  };
8380
8380
  }
8381
- function Qo(e) {
8381
+ function Jo(e) {
8382
8382
  e();
8383
8383
  }
8384
8384
  function s0(e, t) {
8385
8385
  return e.pipe(t);
8386
8386
  }
8387
8387
  function o0(e) {
8388
- return !e.length || typeof e[e.length - 1] != "function" ? Jo : e.pop();
8388
+ return !e.length || typeof e[e.length - 1] != "function" ? Xo : e.pop();
8389
8389
  }
8390
8390
  function a0() {
8391
8391
  for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
@@ -8396,24 +8396,24 @@ function a0() {
8396
8396
  var i, s = t.map(function(o, a) {
8397
8397
  var c = a < t.length - 1, l = a > 0;
8398
8398
  return i0(o, c, l, function(d) {
8399
- i || (i = d), d && s.forEach(Qo), !c && (s.forEach(Qo), n(i));
8399
+ i || (i = d), d && s.forEach(Jo), !c && (s.forEach(Jo), n(i));
8400
8400
  });
8401
8401
  });
8402
8402
  return t.reduce(s0);
8403
8403
  }
8404
8404
  var f0 = a0;
8405
8405
  (function(e, t) {
8406
- t = e.exports = _f(), t.Stream = t, t.Readable = t, t.Writable = gf(), t.Duplex = Rr(), t.Transform = vf, t.PassThrough = Zl, t.finished = Vs, t.pipeline = f0;
8406
+ t = e.exports = mf(), t.Stream = t, t.Readable = t, t.Writable = wf(), t.Duplex = Rr(), t.Transform = _f, t.PassThrough = Zl, t.finished = Vs, t.pipeline = f0;
8407
8407
  })(gs, gs.exports);
8408
- var Sf = gs.exports, ri = je.Buffer, Bf = Sf.Transform, u0 = Ie;
8408
+ var xf = gs.exports, ri = je.Buffer, Sf = xf.Transform, u0 = Ie;
8409
8409
  function c0(e, t) {
8410
8410
  if (!ri.isBuffer(e) && typeof e != "string")
8411
8411
  throw new TypeError(t + " must be a string or a buffer");
8412
8412
  }
8413
8413
  function Dt(e) {
8414
- Bf.call(this), this._block = ri.allocUnsafe(e), this._blockSize = e, this._blockOffset = 0, this._length = [0, 0, 0, 0], this._finalized = !1;
8414
+ Sf.call(this), this._block = ri.allocUnsafe(e), this._blockSize = e, this._blockOffset = 0, this._length = [0, 0, 0, 0], this._finalized = !1;
8415
8415
  }
8416
- u0(Dt, Bf);
8416
+ u0(Dt, Sf);
8417
8417
  Dt.prototype._transform = function(e, t, r) {
8418
8418
  var n = null;
8419
8419
  try {
@@ -8458,11 +8458,11 @@ Dt.prototype.digest = function(e) {
8458
8458
  Dt.prototype._digest = function() {
8459
8459
  throw new Error("_digest is not implemented");
8460
8460
  };
8461
- var h0 = Dt, l0 = Ie, Pf = h0, d0 = je.Buffer, p0 = new Array(16);
8461
+ var h0 = Dt, l0 = Ie, Bf = h0, d0 = je.Buffer, p0 = new Array(16);
8462
8462
  function Ei() {
8463
- Pf.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878;
8463
+ Bf.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878;
8464
8464
  }
8465
- l0(Ei, Pf);
8465
+ l0(Ei, Bf);
8466
8466
  Ei.prototype._update = function() {
8467
8467
  for (var e = p0, t = 0; t < 16; ++t) e[t] = this._block.readInt32LE(t * 4);
8468
8468
  var r = this._a, n = this._b, i = this._c, s = this._d;
@@ -8488,15 +8488,15 @@ function Re(e, t, r, n, i, s, o) {
8488
8488
  function Ue(e, t, r, n, i, s, o) {
8489
8489
  return xi(e + (r ^ (t | ~n)) + i + s | 0, o) + t | 0;
8490
8490
  }
8491
- var y0 = Ei, ni = je.Buffer, Tf = Sf.Transform, b0 = Ie;
8491
+ var y0 = Ei, ni = je.Buffer, Pf = xf.Transform, b0 = Ie;
8492
8492
  function w0(e, t) {
8493
8493
  if (!ni.isBuffer(e) && typeof e != "string")
8494
8494
  throw new TypeError(t + " must be a string or a buffer");
8495
8495
  }
8496
8496
  function jt(e) {
8497
- Tf.call(this), this._block = ni.allocUnsafe(e), this._blockSize = e, this._blockOffset = 0, this._length = [0, 0, 0, 0], this._finalized = !1;
8497
+ Pf.call(this), this._block = ni.allocUnsafe(e), this._blockSize = e, this._blockOffset = 0, this._length = [0, 0, 0, 0], this._finalized = !1;
8498
8498
  }
8499
- b0(jt, Tf);
8499
+ b0(jt, Pf);
8500
8500
  jt.prototype._transform = function(e, t, r) {
8501
8501
  var n = null;
8502
8502
  try {
@@ -8541,7 +8541,7 @@ jt.prototype.digest = function(e) {
8541
8541
  jt.prototype._digest = function() {
8542
8542
  throw new Error("_digest is not implemented");
8543
8543
  };
8544
- var g0 = jt, ss = St.Buffer, m0 = Ie, Af = g0, _0 = new Array(16), zr = [
8544
+ var g0 = jt, ss = St.Buffer, m0 = Ie, Tf = g0, _0 = new Array(16), zr = [
8545
8545
  0,
8546
8546
  1,
8547
8547
  2,
@@ -8867,17 +8867,17 @@ var g0 = jt, ss = St.Buffer, m0 = Ie, Af = g0, _0 = new Array(16), zr = [
8867
8867
  11
8868
8868
  ], Xr = [0, 1518500249, 1859775393, 2400959708, 2840853838], Jr = [1352829926, 1548603684, 1836072691, 2053994217, 0];
8869
8869
  function Si() {
8870
- Af.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520;
8870
+ Tf.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520;
8871
8871
  }
8872
- m0(Si, Af);
8872
+ m0(Si, Tf);
8873
8873
  Si.prototype._update = function() {
8874
8874
  for (var e = _0, t = 0; t < 16; ++t) e[t] = this._block.readInt32LE(t * 4);
8875
8875
  for (var r = this._a | 0, n = this._b | 0, i = this._c | 0, s = this._d | 0, o = this._e | 0, a = this._a | 0, c = this._b | 0, l = this._c | 0, d = this._d | 0, g = this._e | 0, x = 0; x < 80; x += 1) {
8876
8876
  var y, O;
8877
- x < 16 ? (y = Zo(r, n, i, s, o, e[zr[x]], Xr[0], Kr[x]), O = na(a, c, l, d, g, e[qr[x]], Jr[0], Yr[x])) : x < 32 ? (y = ea(r, n, i, s, o, e[zr[x]], Xr[1], Kr[x]), O = ra(a, c, l, d, g, e[qr[x]], Jr[1], Yr[x])) : x < 48 ? (y = ta(r, n, i, s, o, e[zr[x]], Xr[2], Kr[x]), O = ta(a, c, l, d, g, e[qr[x]], Jr[2], Yr[x])) : x < 64 ? (y = ra(r, n, i, s, o, e[zr[x]], Xr[3], Kr[x]), O = ea(a, c, l, d, g, e[qr[x]], Jr[3], Yr[x])) : (y = na(r, n, i, s, o, e[zr[x]], Xr[4], Kr[x]), O = Zo(a, c, l, d, g, e[qr[x]], Jr[4], Yr[x])), r = o, o = s, s = tr(i, 10), i = n, n = y, a = g, g = d, d = tr(l, 10), l = c, c = O;
8877
+ x < 16 ? (y = Qo(r, n, i, s, o, e[zr[x]], Xr[0], Kr[x]), O = ra(a, c, l, d, g, e[qr[x]], Jr[0], Yr[x])) : x < 32 ? (y = Zo(r, n, i, s, o, e[zr[x]], Xr[1], Kr[x]), O = ta(a, c, l, d, g, e[qr[x]], Jr[1], Yr[x])) : x < 48 ? (y = ea(r, n, i, s, o, e[zr[x]], Xr[2], Kr[x]), O = ea(a, c, l, d, g, e[qr[x]], Jr[2], Yr[x])) : x < 64 ? (y = ta(r, n, i, s, o, e[zr[x]], Xr[3], Kr[x]), O = Zo(a, c, l, d, g, e[qr[x]], Jr[3], Yr[x])) : (y = ra(r, n, i, s, o, e[zr[x]], Xr[4], Kr[x]), O = Qo(a, c, l, d, g, e[qr[x]], Jr[4], Yr[x])), r = o, o = s, s = tr(i, 10), i = n, n = y, a = g, g = d, d = tr(l, 10), l = c, c = O;
8878
8878
  }
8879
- var B = this._b + i + d | 0;
8880
- this._b = this._c + s + g | 0, this._c = this._d + o + a | 0, this._d = this._e + r + c | 0, this._e = this._a + n + l | 0, this._a = B;
8879
+ var A = this._b + i + d | 0;
8880
+ this._b = this._c + s + g | 0, this._c = this._d + o + a | 0, this._d = this._e + r + c | 0, this._e = this._a + n + l | 0, this._a = A;
8881
8881
  };
8882
8882
  Si.prototype._digest = function() {
8883
8883
  this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update();
@@ -8887,27 +8887,27 @@ Si.prototype._digest = function() {
8887
8887
  function tr(e, t) {
8888
8888
  return e << t | e >>> 32 - t;
8889
8889
  }
8890
- function Zo(e, t, r, n, i, s, o, a) {
8890
+ function Qo(e, t, r, n, i, s, o, a) {
8891
8891
  return tr(e + (t ^ r ^ n) + s + o | 0, a) + i | 0;
8892
8892
  }
8893
- function ea(e, t, r, n, i, s, o, a) {
8893
+ function Zo(e, t, r, n, i, s, o, a) {
8894
8894
  return tr(e + (t & r | ~t & n) + s + o | 0, a) + i | 0;
8895
8895
  }
8896
- function ta(e, t, r, n, i, s, o, a) {
8896
+ function ea(e, t, r, n, i, s, o, a) {
8897
8897
  return tr(e + ((t | ~r) ^ n) + s + o | 0, a) + i | 0;
8898
8898
  }
8899
- function ra(e, t, r, n, i, s, o, a) {
8899
+ function ta(e, t, r, n, i, s, o, a) {
8900
8900
  return tr(e + (t & n | r & ~n) + s + o | 0, a) + i | 0;
8901
8901
  }
8902
- function na(e, t, r, n, i, s, o, a) {
8902
+ function ra(e, t, r, n, i, s, o, a) {
8903
8903
  return tr(e + (t ^ (r | ~n)) + s + o | 0, a) + i | 0;
8904
8904
  }
8905
- var v0 = Si, If = { exports: {} }, Of = je.Buffer;
8905
+ var v0 = Si, Af = { exports: {} }, If = je.Buffer;
8906
8906
  function Bi(e, t) {
8907
- this._block = Of.alloc(e), this._finalSize = t, this._blockSize = e, this._len = 0;
8907
+ this._block = If.alloc(e), this._finalSize = t, this._blockSize = e, this._len = 0;
8908
8908
  }
8909
8909
  Bi.prototype.update = function(e, t) {
8910
- typeof e == "string" && (t = t || "utf8", e = Of.from(e, t));
8910
+ typeof e == "string" && (t = t || "utf8", e = If.from(e, t));
8911
8911
  for (var r = this._block, n = this._blockSize, i = e.length, s = this._len, o = 0; o < i; ) {
8912
8912
  for (var a = s % n, c = Math.min(i - o, n - a), l = 0; l < c; l++)
8913
8913
  r[a + l] = e[o + l];
@@ -8932,16 +8932,16 @@ Bi.prototype.digest = function(e) {
8932
8932
  Bi.prototype._update = function() {
8933
8933
  throw new Error("_update must be implemented by subclass");
8934
8934
  };
8935
- var Cr = Bi, E0 = Ie, kf = Cr, x0 = je.Buffer, S0 = [
8935
+ var Cr = Bi, E0 = Ie, Of = Cr, x0 = je.Buffer, S0 = [
8936
8936
  1518500249,
8937
8937
  1859775393,
8938
8938
  -1894007588,
8939
8939
  -899497514
8940
8940
  ], B0 = new Array(80);
8941
8941
  function wn() {
8942
- this.init(), this._w = B0, kf.call(this, 64, 56);
8942
+ this.init(), this._w = B0, Of.call(this, 64, 56);
8943
8943
  }
8944
- E0(wn, kf);
8944
+ E0(wn, Of);
8945
8945
  wn.prototype.init = function() {
8946
8946
  return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
8947
8947
  };
@@ -8967,16 +8967,16 @@ wn.prototype._hash = function() {
8967
8967
  var e = x0.allocUnsafe(20);
8968
8968
  return e.writeInt32BE(this._a | 0, 0), e.writeInt32BE(this._b | 0, 4), e.writeInt32BE(this._c | 0, 8), e.writeInt32BE(this._d | 0, 12), e.writeInt32BE(this._e | 0, 16), e;
8969
8969
  };
8970
- var I0 = wn, O0 = Ie, Rf = Cr, k0 = je.Buffer, R0 = [
8970
+ var I0 = wn, O0 = Ie, kf = Cr, k0 = je.Buffer, R0 = [
8971
8971
  1518500249,
8972
8972
  1859775393,
8973
8973
  -1894007588,
8974
8974
  -899497514
8975
8975
  ], U0 = new Array(80);
8976
8976
  function gn() {
8977
- this.init(), this._w = U0, Rf.call(this, 64, 56);
8977
+ this.init(), this._w = U0, kf.call(this, 64, 56);
8978
8978
  }
8979
- O0(gn, Rf);
8979
+ O0(gn, kf);
8980
8980
  gn.prototype.init = function() {
8981
8981
  return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
8982
8982
  };
@@ -9005,7 +9005,7 @@ gn.prototype._hash = function() {
9005
9005
  var e = k0.allocUnsafe(20);
9006
9006
  return e.writeInt32BE(this._a | 0, 0), e.writeInt32BE(this._b | 0, 4), e.writeInt32BE(this._c | 0, 8), e.writeInt32BE(this._d | 0, 12), e.writeInt32BE(this._e | 0, 16), e;
9007
9007
  };
9008
- var M0 = gn, H0 = Ie, Uf = Cr, $0 = je.Buffer, D0 = [
9008
+ var M0 = gn, H0 = Ie, Rf = Cr, $0 = je.Buffer, D0 = [
9009
9009
  1116352408,
9010
9010
  1899447441,
9011
9011
  3049323471,
@@ -9072,9 +9072,9 @@ var M0 = gn, H0 = Ie, Uf = Cr, $0 = je.Buffer, D0 = [
9072
9072
  3329325298
9073
9073
  ], j0 = new Array(64);
9074
9074
  function mn() {
9075
- this.init(), this._w = j0, Uf.call(this, 64, 56);
9075
+ this.init(), this._w = j0, Rf.call(this, 64, 56);
9076
9076
  }
9077
- H0(mn, Uf);
9077
+ H0(mn, Rf);
9078
9078
  mn.prototype.init = function() {
9079
9079
  return this._a = 1779033703, this._b = 3144134277, this._c = 1013904242, this._d = 2773480762, this._e = 1359893119, this._f = 2600822924, this._g = 528734635, this._h = 1541459225, this;
9080
9080
  };
@@ -9109,7 +9109,7 @@ mn.prototype._hash = function() {
9109
9109
  var e = $0.allocUnsafe(32);
9110
9110
  return e.writeInt32BE(this._a, 0), e.writeInt32BE(this._b, 4), e.writeInt32BE(this._c, 8), e.writeInt32BE(this._d, 12), e.writeInt32BE(this._e, 16), e.writeInt32BE(this._f, 20), e.writeInt32BE(this._g, 24), e.writeInt32BE(this._h, 28), e;
9111
9111
  };
9112
- var Cf = mn, Y0 = Ie, X0 = Cf, J0 = Cr, Q0 = je.Buffer, Z0 = new Array(64);
9112
+ var Uf = mn, Y0 = Ie, X0 = Uf, J0 = Cr, Q0 = je.Buffer, Z0 = new Array(64);
9113
9113
  function Pi() {
9114
9114
  this.init(), this._w = Z0, J0.call(this, 64, 56);
9115
9115
  }
@@ -9121,7 +9121,7 @@ Pi.prototype._hash = function() {
9121
9121
  var e = Q0.allocUnsafe(28);
9122
9122
  return e.writeInt32BE(this._a, 0), e.writeInt32BE(this._b, 4), e.writeInt32BE(this._c, 8), e.writeInt32BE(this._d, 12), e.writeInt32BE(this._e, 16), e.writeInt32BE(this._f, 20), e.writeInt32BE(this._g, 24), e;
9123
9123
  };
9124
- var ed = Pi, td = Ie, Lf = Cr, rd = je.Buffer, ia = [
9124
+ var ed = Pi, td = Ie, Cf = Cr, rd = je.Buffer, na = [
9125
9125
  1116352408,
9126
9126
  3609767458,
9127
9127
  1899447441,
@@ -9284,22 +9284,22 @@ var ed = Pi, td = Ie, Lf = Cr, rd = je.Buffer, ia = [
9284
9284
  1246189591
9285
9285
  ], nd = new Array(160);
9286
9286
  function _n() {
9287
- this.init(), this._w = nd, Lf.call(this, 128, 112);
9287
+ this.init(), this._w = nd, Cf.call(this, 128, 112);
9288
9288
  }
9289
- td(_n, Lf);
9289
+ td(_n, Cf);
9290
9290
  _n.prototype.init = function() {
9291
9291
  return this._ah = 1779033703, this._bh = 3144134277, this._ch = 1013904242, this._dh = 2773480762, this._eh = 1359893119, this._fh = 2600822924, this._gh = 528734635, this._hh = 1541459225, this._al = 4089235720, this._bl = 2227873595, this._cl = 4271175723, this._dl = 1595750129, this._el = 2917565137, this._fl = 725511199, this._gl = 4215389547, this._hl = 327033209, this;
9292
9292
  };
9293
- function sa(e, t, r) {
9293
+ function ia(e, t, r) {
9294
9294
  return r ^ e & (t ^ r);
9295
9295
  }
9296
- function oa(e, t, r) {
9296
+ function sa(e, t, r) {
9297
9297
  return e & t | r & (e | t);
9298
9298
  }
9299
- function aa(e, t) {
9299
+ function oa(e, t) {
9300
9300
  return (e >>> 28 | t << 4) ^ (t >>> 2 | e << 30) ^ (t >>> 7 | e << 25);
9301
9301
  }
9302
- function fa(e, t) {
9302
+ function aa(e, t) {
9303
9303
  return (e >>> 14 | t << 18) ^ (e >>> 18 | t << 14) ^ (t >>> 9 | e << 23);
9304
9304
  }
9305
9305
  function id(e, t) {
@@ -9318,7 +9318,7 @@ function Be(e, t) {
9318
9318
  return e >>> 0 < t >>> 0 ? 1 : 0;
9319
9319
  }
9320
9320
  _n.prototype._update = function(e) {
9321
- for (var t = this._w, r = this._ah | 0, n = this._bh | 0, i = this._ch | 0, s = this._dh | 0, o = this._eh | 0, a = this._fh | 0, c = this._gh | 0, l = this._hh | 0, d = this._al | 0, g = this._bl | 0, x = this._cl | 0, y = this._dl | 0, O = this._el | 0, B = this._fl | 0, A = this._gl | 0, k = this._hl | 0, U = 0; U < 32; U += 2)
9321
+ for (var t = this._w, r = this._ah | 0, n = this._bh | 0, i = this._ch | 0, s = this._dh | 0, o = this._eh | 0, a = this._fh | 0, c = this._gh | 0, l = this._hh | 0, d = this._al | 0, g = this._bl | 0, x = this._cl | 0, y = this._dl | 0, O = this._el | 0, A = this._fl | 0, T = this._gl | 0, k = this._hl | 0, U = 0; U < 32; U += 2)
9322
9322
  t[U] = e.readInt32BE(U * 4), t[U + 1] = e.readInt32BE(U * 4 + 4);
9323
9323
  for (; U < 160; U += 2) {
9324
9324
  var _ = t[U - 30], m = t[U - 15 * 2 + 1], S = id(_, m), E = sd(m, _);
@@ -9328,12 +9328,12 @@ _n.prototype._update = function(e) {
9328
9328
  }
9329
9329
  for (var q = 0; q < 160; q += 2) {
9330
9330
  W = t[q], M = t[q + 1];
9331
- var ae = oa(r, n, i), fe = oa(d, g, x), Qe = aa(r, d), Ge = aa(d, r), rt = fa(o, O), de = fa(O, o), ve = ia[q], We = ia[q + 1], Bt = sa(o, a, c), ht = sa(O, B, A), T = k + de | 0, P = l + rt + Be(T, k) | 0;
9332
- T = T + ht | 0, P = P + Bt + Be(T, ht) | 0, T = T + We | 0, P = P + ve + Be(T, We) | 0, T = T + M | 0, P = P + W + Be(T, M) | 0;
9331
+ var ae = sa(r, n, i), fe = sa(d, g, x), Qe = oa(r, d), Ge = oa(d, r), rt = aa(o, O), de = aa(O, o), ve = na[q], We = na[q + 1], Bt = ia(o, a, c), ht = ia(O, A, T), P = k + de | 0, B = l + rt + Be(P, k) | 0;
9332
+ P = P + ht | 0, B = B + Bt + Be(P, ht) | 0, P = P + We | 0, B = B + ve + Be(P, We) | 0, P = P + M | 0, B = B + W + Be(P, M) | 0;
9333
9333
  var F = Ge + fe | 0, G = Qe + ae + Be(F, Ge) | 0;
9334
- l = c, k = A, c = a, A = B, a = o, B = O, O = y + T | 0, o = s + P + Be(O, y) | 0, s = i, y = x, i = n, x = g, n = r, g = d, d = T + F | 0, r = P + G + Be(d, T) | 0;
9334
+ l = c, k = T, c = a, T = A, a = o, A = O, O = y + P | 0, o = s + B + Be(O, y) | 0, s = i, y = x, i = n, x = g, n = r, g = d, d = P + F | 0, r = B + G + Be(d, P) | 0;
9335
9335
  }
9336
- this._al = this._al + d | 0, this._bl = this._bl + g | 0, this._cl = this._cl + x | 0, this._dl = this._dl + y | 0, this._el = this._el + O | 0, this._fl = this._fl + B | 0, this._gl = this._gl + A | 0, this._hl = this._hl + k | 0, this._ah = this._ah + r + Be(this._al, d) | 0, this._bh = this._bh + n + Be(this._bl, g) | 0, this._ch = this._ch + i + Be(this._cl, x) | 0, this._dh = this._dh + s + Be(this._dl, y) | 0, this._eh = this._eh + o + Be(this._el, O) | 0, this._fh = this._fh + a + Be(this._fl, B) | 0, this._gh = this._gh + c + Be(this._gl, A) | 0, this._hh = this._hh + l + Be(this._hl, k) | 0;
9336
+ this._al = this._al + d | 0, this._bl = this._bl + g | 0, this._cl = this._cl + x | 0, this._dl = this._dl + y | 0, this._el = this._el + O | 0, this._fl = this._fl + A | 0, this._gl = this._gl + T | 0, this._hl = this._hl + k | 0, this._ah = this._ah + r + Be(this._al, d) | 0, this._bh = this._bh + n + Be(this._bl, g) | 0, this._ch = this._ch + i + Be(this._cl, x) | 0, this._dh = this._dh + s + Be(this._dl, y) | 0, this._eh = this._eh + o + Be(this._el, O) | 0, this._fh = this._fh + a + Be(this._fl, A) | 0, this._gh = this._gh + c + Be(this._gl, T) | 0, this._hh = this._hh + l + Be(this._hl, k) | 0;
9337
9337
  };
9338
9338
  _n.prototype._hash = function() {
9339
9339
  var e = rd.allocUnsafe(64);
@@ -9342,7 +9342,7 @@ _n.prototype._hash = function() {
9342
9342
  }
9343
9343
  return t(this._ah, this._al, 0), t(this._bh, this._bl, 8), t(this._ch, this._cl, 16), t(this._dh, this._dl, 24), t(this._eh, this._el, 32), t(this._fh, this._fl, 40), t(this._gh, this._gl, 48), t(this._hh, this._hl, 56), e;
9344
9344
  };
9345
- var Nf = _n, fd = Ie, ud = Nf, cd = Cr, hd = je.Buffer, ld = new Array(160);
9345
+ var Lf = _n, fd = Ie, ud = Lf, cd = Cr, hd = je.Buffer, ld = new Array(160);
9346
9346
  function Ti() {
9347
9347
  this.init(), this._w = ld, cd.call(this, 128, 112);
9348
9348
  }
@@ -9357,7 +9357,7 @@ Ti.prototype._hash = function() {
9357
9357
  }
9358
9358
  return t(this._ah, this._al, 0), t(this._bh, this._bl, 8), t(this._ch, this._cl, 16), t(this._dh, this._dl, 24), t(this._eh, this._el, 32), t(this._fh, this._fl, 40), e;
9359
9359
  };
9360
- var dd = Ti, ur = If.exports = function(t) {
9360
+ var dd = Ti, ur = Af.exports = function(t) {
9361
9361
  t = t.toLowerCase();
9362
9362
  var r = ur[t];
9363
9363
  if (!r) throw new Error(t + " is not supported (we accept pull requests)");
@@ -9366,16 +9366,16 @@ var dd = Ti, ur = If.exports = function(t) {
9366
9366
  ur.sha = I0;
9367
9367
  ur.sha1 = M0;
9368
9368
  ur.sha224 = ed;
9369
- ur.sha256 = Cf;
9369
+ ur.sha256 = Uf;
9370
9370
  ur.sha384 = dd;
9371
- ur.sha512 = Nf;
9372
- var pd = If.exports, Ff = je.Buffer, Mf = Gs.Transform, yd = ti.StringDecoder, bd = Ie;
9371
+ ur.sha512 = Lf;
9372
+ var pd = Af.exports, Nf = je.Buffer, Ff = Gs.Transform, yd = ti.StringDecoder, bd = Ie;
9373
9373
  function tt(e) {
9374
- Mf.call(this), this.hashMode = typeof e == "string", this.hashMode ? this[e] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null;
9374
+ Ff.call(this), this.hashMode = typeof e == "string", this.hashMode ? this[e] = this._finalOrDigest : this.final = this._finalOrDigest, this._final && (this.__final = this._final, this._final = null), this._decoder = null, this._encoding = null;
9375
9375
  }
9376
- bd(tt, Mf);
9376
+ bd(tt, Ff);
9377
9377
  tt.prototype.update = function(e, t, r) {
9378
- typeof e == "string" && (e = Ff.from(e, t));
9378
+ typeof e == "string" && (e = Nf.from(e, t));
9379
9379
  var n = this._update(e);
9380
9380
  return this.hashMode ? this : (r && (n = this._toString(n, r)), n);
9381
9381
  };
@@ -9410,7 +9410,7 @@ tt.prototype._flush = function(e) {
9410
9410
  e(t);
9411
9411
  };
9412
9412
  tt.prototype._finalOrDigest = function(e) {
9413
- var t = this.__final() || Ff.alloc(0);
9413
+ var t = this.__final() || Nf.alloc(0);
9414
9414
  return e && (t = this._toString(t, e, !0)), t;
9415
9415
  };
9416
9416
  tt.prototype._toString = function(e, t, r) {
@@ -9418,11 +9418,11 @@ tt.prototype._toString = function(e, t, r) {
9418
9418
  var n = this._decoder.write(e);
9419
9419
  return r && (n += this._decoder.end()), n;
9420
9420
  };
9421
- var wd = tt, gd = Ie, md = y0, _d = v0, vd = pd, Hf = wd;
9421
+ var wd = tt, gd = Ie, md = y0, _d = v0, vd = pd, Mf = wd;
9422
9422
  function Ai(e) {
9423
- Hf.call(this, "digest"), this._hash = e;
9423
+ Mf.call(this, "digest"), this._hash = e;
9424
9424
  }
9425
- gd(Ai, Hf);
9425
+ gd(Ai, Mf);
9426
9426
  Ai.prototype._update = function(e) {
9427
9427
  this._hash.update(e);
9428
9428
  };
@@ -9449,16 +9449,16 @@ function xd(e) {
9449
9449
  throw new TypeError("Expected Buffer");
9450
9450
  if (y.length === 0)
9451
9451
  return "";
9452
- for (var O = 0, B = 0, A = 0, k = y.length; A !== k && y[A] === 0; )
9453
- A++, O++;
9454
- for (var U = (k - A) * l + 1 >>> 0, _ = new Uint8Array(U); A !== k; ) {
9455
- for (var m = y[A], S = 0, E = U - 1; (m !== 0 || S < B) && E !== -1; E--, S++)
9452
+ for (var O = 0, A = 0, T = 0, k = y.length; T !== k && y[T] === 0; )
9453
+ T++, O++;
9454
+ for (var U = (k - T) * l + 1 >>> 0, _ = new Uint8Array(U); T !== k; ) {
9455
+ for (var m = y[T], S = 0, E = U - 1; (m !== 0 || S < A) && E !== -1; E--, S++)
9456
9456
  m += 256 * _[E] >>> 0, _[E] = m % o >>> 0, m = m / o >>> 0;
9457
9457
  if (m !== 0)
9458
9458
  throw new Error("Non-zero carry");
9459
- B = S, A++;
9459
+ A = S, T++;
9460
9460
  }
9461
- for (var H = U - B; H !== U && _[H] === 0; )
9461
+ for (var H = U - A; H !== U && _[H] === 0; )
9462
9462
  H++;
9463
9463
  for (var D = a.repeat(O); H < U; ++H)
9464
9464
  D += e.charAt(_[H]);
@@ -9469,23 +9469,23 @@ function xd(e) {
9469
9469
  throw new TypeError("Expected String");
9470
9470
  if (y.length === 0)
9471
9471
  return Ln.alloc(0);
9472
- for (var O = 0, B = 0, A = 0; y[O] === a; )
9473
- B++, O++;
9472
+ for (var O = 0, A = 0, T = 0; y[O] === a; )
9473
+ A++, O++;
9474
9474
  for (var k = (y.length - O) * c + 1 >>> 0, U = new Uint8Array(k); O < y.length; ) {
9475
9475
  var _ = t[y.charCodeAt(O)];
9476
9476
  if (_ === 255)
9477
9477
  return;
9478
- for (var m = 0, S = k - 1; (_ !== 0 || m < A) && S !== -1; S--, m++)
9478
+ for (var m = 0, S = k - 1; (_ !== 0 || m < T) && S !== -1; S--, m++)
9479
9479
  _ += o * U[S] >>> 0, U[S] = _ % 256 >>> 0, _ = _ / 256 >>> 0;
9480
9480
  if (_ !== 0)
9481
9481
  throw new Error("Non-zero carry");
9482
- A = m, O++;
9482
+ T = m, O++;
9483
9483
  }
9484
- for (var E = k - A; E !== k && U[E] === 0; )
9484
+ for (var E = k - T; E !== k && U[E] === 0; )
9485
9485
  E++;
9486
- var H = Ln.allocUnsafe(B + (k - E));
9487
- H.fill(0, 0, B);
9488
- for (var D = B; E !== k; )
9486
+ var H = Ln.allocUnsafe(A + (k - E));
9487
+ H.fill(0, 0, A);
9488
+ for (var D = A; E !== k; )
9489
9489
  H[D++] = U[E++];
9490
9490
  return H;
9491
9491
  }
@@ -9529,13 +9529,13 @@ var Sd = xd, Bd = Sd, Pd = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrst
9529
9529
  decode: i,
9530
9530
  decodeUnsafe: n
9531
9531
  };
9532
- }, ua = Ed, Od = Id;
9532
+ }, fa = Ed, Od = Id;
9533
9533
  function kd(e) {
9534
- var t = ua("sha256").update(e).digest();
9535
- return ua("sha256").update(t).digest();
9534
+ var t = fa("sha256").update(e).digest();
9535
+ return fa("sha256").update(t).digest();
9536
9536
  }
9537
9537
  var Rd = Od(kd), _s = Rd;
9538
- function $f(e, t) {
9538
+ function Hf(e, t) {
9539
9539
  if (t !== void 0 && e[0] !== t) throw new Error("Invalid network version");
9540
9540
  if (e.length === 33)
9541
9541
  return {
@@ -9556,7 +9556,7 @@ function vs(e, t, r) {
9556
9556
  return n.writeUInt8(e, 0), t.copy(n, 1), r && (n[33] = 1), n;
9557
9557
  }
9558
9558
  function Ud(e, t) {
9559
- return $f(_s.decode(e), t);
9559
+ return Hf(_s.decode(e), t);
9560
9560
  }
9561
9561
  function Cd(e, t, r) {
9562
9562
  return typeof e == "number" ? _s.encode(vs(e, t, r)) : _s.encode(
@@ -9569,7 +9569,7 @@ function Cd(e, t, r) {
9569
9569
  }
9570
9570
  var Ld = {
9571
9571
  decode: Ud,
9572
- decodeRaw: $f,
9572
+ decodeRaw: Hf,
9573
9573
  encode: Cd,
9574
9574
  encodeRaw: vs
9575
9575
  }, Ii = {};
@@ -9774,7 +9774,7 @@ Object.defineProperty(Or, "__esModule", { value: !0 });
9774
9774
  Or.ECPairFactory = Or.networks = void 0;
9775
9775
  const Es = kr;
9776
9776
  Or.networks = Es;
9777
- const $e = nf, Fd = al, ca = Ld, Md = Ii, as = $e.typeforce.maybe(
9777
+ const $e = rf, Fd = al, ua = Ld, Md = Ii, as = $e.typeforce.maybe(
9778
9778
  $e.typeforce.compile({
9779
9779
  compressed: $e.maybe($e.Boolean),
9780
9780
  network: $e.maybe($e.Network)
@@ -9794,7 +9794,7 @@ function $d(e) {
9794
9794
  return $e.typeforce(e.isPoint, a), $e.typeforce(as, c), new o(void 0, a, c);
9795
9795
  }
9796
9796
  function i(a, c) {
9797
- const l = ca.decode(a), d = l.version;
9797
+ const l = ua.decode(a), d = l.version;
9798
9798
  if ($e.Array(c)) {
9799
9799
  if (c = c.filter((g) => d === g.wif).pop(), !c) throw new Error("Unknown network version");
9800
9800
  } else if (c = c || Es.bitcoin, d !== c.wif) throw new Error("Invalid network version");
@@ -9833,7 +9833,7 @@ function $d(e) {
9833
9833
  }
9834
9834
  toWIF() {
9835
9835
  if (!this.__D) throw new Error("Missing private key");
9836
- return ca.encode(this.network.wif, this.__D, this.compressed);
9836
+ return ua.encode(this.network.wif, this.__D, this.compressed);
9837
9837
  }
9838
9838
  tweak(c) {
9839
9839
  return this.privateKey ? this.tweakFromPrivateKey(c) : this.tweakFromPublicKey(c);
@@ -9914,9 +9914,9 @@ Or.ECPairFactory = $d;
9914
9914
  return t.networks;
9915
9915
  }
9916
9916
  });
9917
- })(rf);
9918
- const Dd = /* @__PURE__ */ Du(rf);
9919
- class ii extends ga {
9917
+ })(tf);
9918
+ const Dd = /* @__PURE__ */ Du(tf);
9919
+ class ii extends wa {
9920
9920
  get isInitialized() {
9921
9921
  return !!this.privKey;
9922
9922
  }
@@ -9996,23 +9996,26 @@ class ii extends ga {
9996
9996
  return re(c.toString("hex"));
9997
9997
  }
9998
9998
  }
9999
- class Dy extends ga {
9999
+ class Dy extends wa {
10000
10000
  constructor(t) {
10001
10001
  super(), this.getOrderThreshold = 20, this.refundSacpCache = /* @__PURE__ */ new Map(), this.environment = t.environment;
10002
- const r = t.environment === Pr.MAINNET ? Fo.mainnet : t.environment === Pr.TESTNET ? Fo.testnet : void 0;
10002
+ const r = t.environment === Pr.MAINNET ? No.mainnet : t.environment === Pr.TESTNET ? No.testnet : void 0;
10003
10003
  if (!r)
10004
10004
  throw new Error(
10005
10005
  "API not found, invalid environment " + t.environment
10006
10006
  );
10007
- if (this._auth = new bu(
10008
- new un(t.orderbookURl ?? r.orderbook),
10009
- t.evmWallet,
10010
- t.siweOpts
10011
- ), this._quote = t.quote ?? new rl(r.quote), this._orderBook = new hu({
10007
+ if (this._quote = t.quote ?? new rl(r.quote), this._orderbookUrl = new un(t.orderbookURl ?? r.orderbook), this._auth = new yu({
10008
+ siwe: t.apiKey ? void 0 : new bu(
10009
+ new un(t.orderbookURl ?? r.orderbook),
10010
+ t.evmWallet,
10011
+ t.siweOpts
10012
+ ),
10013
+ apiKey: t.apiKey
10014
+ }), this._orderBook = new cu({
10012
10015
  url: t.orderbookURl ?? r.orderbook,
10013
10016
  walletClient: t.evmWallet,
10014
10017
  auth: this._auth
10015
- }), this._orderbookUrl = new un(t.orderbookURl ?? r.orderbook), this._evmRelay = new Lu(this._orderbookUrl, this._auth), this._secretManager = t.secretManager ?? ii.fromWalletClient(t.evmWallet), this.orderExecutorCache = new el(), this._evmWallet = t.evmWallet, !t.evmWallet.account)
10018
+ }), this._evmRelay = new Lu(this._orderbookUrl, this._auth), this._secretManager = t.secretManager ?? ii.fromWalletClient(t.evmWallet), this.orderExecutorCache = new el(), this._evmWallet = t.evmWallet, !t.evmWallet.account)
10016
10019
  throw new Error("Account not found in evmWallet");
10017
10020
  this._blockNumberFetcher = t.blockNumberFetcher ?? new tl(r.info, t.environment);
10018
10021
  }
@@ -10048,17 +10051,7 @@ class Dy extends ga {
10048
10051
  async swap(t) {
10049
10052
  const r = await this.validateAndFillParams(t);
10050
10053
  if (r.error) return j(r.error);
10051
- const { sendAddress: n, receiveAddress: i, timelock: s } = r.val;
10052
- let o = t.nonce;
10053
- if (!o) {
10054
- if (!this._evmWallet.account) return j("EVM Wallet not found");
10055
- const B = await this._orderBook.getOrdersCount(
10056
- this._evmWallet.account.address
10057
- );
10058
- if (B.error) return j(B.error);
10059
- o = B.val + 1;
10060
- }
10061
- const a = await this._secretManager.generateSecret(o);
10054
+ const { sendAddress: n, receiveAddress: i, timelock: s } = r.val, o = Date.now().toString(), a = await this._secretManager.generateSecret(o);
10062
10055
  if (a.error) return j(a.error);
10063
10056
  const { strategyId: c, btcAddress: l } = t.additionalData, d = {
10064
10057
  strategy_id: c,
@@ -10075,7 +10068,7 @@ class Dy extends ga {
10075
10068
  source_amount: t.sendAmount,
10076
10069
  destination_amount: t.receiveAmount,
10077
10070
  fee: "1",
10078
- nonce: o.toString(),
10071
+ nonce: o,
10079
10072
  timelock: s,
10080
10073
  secret_hash: Kt(a.val.secretHash),
10081
10074
  min_destination_confirmations: t.minDestinationConfirmations ?? 0,
@@ -10103,7 +10096,7 @@ class Dy extends ga {
10103
10096
  if (n.error) return j(n.error);
10104
10097
  if (r < n)
10105
10098
  return j("Send amount should be greater than receive amount");
10106
- const i = lu(t.fromAsset.chain);
10099
+ const i = hu(t.fromAsset.chain);
10107
10100
  if (!i) return j("Unsupported chain for timelock");
10108
10101
  if (Hr(t.fromAsset.chain) || Hr(t.toAsset.chain)) {
10109
10102
  if (!t.additionalData.btcAddress)
@@ -10168,7 +10161,7 @@ class Dy extends ga {
10168
10161
  if (!n.error) {
10169
10162
  this.emit("onPendingOrdersChanged", n.val);
10170
10163
  for (let i = 0; i < n.val.length; i++) {
10171
- const s = n.val[i], o = va(s.status);
10164
+ const s = n.val[i], o = _a(s.status);
10172
10165
  if (Hr(s.source_swap.chain) && s.status === be.InitiateDetected) {
10173
10166
  const a = this.getWallet(s.source_swap.chain);
10174
10167
  if (a.error) {
@@ -10180,7 +10173,7 @@ class Dy extends ga {
10180
10173
  switch (o) {
10181
10174
  case Pe.Redeem: {
10182
10175
  const a = await this._secretManager.generateSecret(
10183
- Number(s.create_order.nonce)
10176
+ s.create_order.nonce
10184
10177
  );
10185
10178
  if (a.error) {
10186
10179
  this.emit("error", s, a.error);
@@ -10414,13 +10407,13 @@ class Dy extends ga {
10414
10407
  async fetchCurrentBlockNumbers(t, r) {
10415
10408
  if (!r || !r.source || !r.destination)
10416
10409
  return j("Provide wallets to fetch the current block number");
10417
- const n = Hr(t.source_swap.chain) ? await Zs(
10410
+ const n = Hr(t.source_swap.chain) ? await Qs(
10418
10411
  await r.source.getProvider()
10419
- ) : await eo(r.source);
10412
+ ) : await Zs(r.source);
10420
10413
  if (n.error) return j(n.error);
10421
- const i = Hr(t.destination_swap.chain) ? await Zs(
10414
+ const i = Hr(t.destination_swap.chain) ? await Qs(
10422
10415
  await r.destination.getProvider()
10423
- ) : await eo(r.destination);
10416
+ ) : await Zs(r.destination);
10424
10417
  return i.error ? j(i.error) : re({
10425
10418
  source: n.val,
10426
10419
  destination: i.val
@@ -10434,14 +10427,14 @@ class Dy extends ga {
10434
10427
  const n = [];
10435
10428
  for (let s = 0; s < t.length; s++) {
10436
10429
  const o = t[s];
10437
- if (Ea(o))
10430
+ if (va(o))
10438
10431
  continue;
10439
10432
  const a = o.source_swap.chain, c = o.destination_swap.chain, l = r == null ? void 0 : r.val[a], d = r == null ? void 0 : r.val[c];
10440
10433
  if (!l || !d) {
10441
10434
  this.emit("error", o, "Error while fetching CurrentBlockNumbers");
10442
10435
  continue;
10443
10436
  }
10444
- const g = _a(
10437
+ const g = ma(
10445
10438
  o,
10446
10439
  l,
10447
10440
  d
@@ -10462,10 +10455,10 @@ function cr(e) {
10462
10455
  ...e
10463
10456
  };
10464
10457
  }
10465
- const Df = "2.21.41";
10458
+ const $f = "2.21.41";
10466
10459
  let Qr = {
10467
10460
  getDocsUrl: ({ docsBaseUrl: e, docsPath: t = "", docsSlug: r }) => t ? `${e ?? "https://viem.sh"}${t}${r ? `#${r}` : ""}` : void 0,
10468
- version: `viem@${Df}`
10461
+ version: `viem@${$f}`
10469
10462
  };
10470
10463
  class le extends Error {
10471
10464
  constructor(t, r = {}) {
@@ -10512,14 +10505,14 @@ class le extends Error {
10512
10505
  configurable: !0,
10513
10506
  writable: !0,
10514
10507
  value: "BaseError"
10515
- }), this.details = n, this.docsPath = i, this.metaMessages = r.metaMessages, this.name = r.name ?? this.name, this.shortMessage = t, this.version = Df;
10508
+ }), this.details = n, this.docsPath = i, this.metaMessages = r.metaMessages, this.name = r.name ?? this.name, this.shortMessage = t, this.version = $f;
10516
10509
  }
10517
10510
  walk(t) {
10518
- return jf(this, t);
10511
+ return Df(this, t);
10519
10512
  }
10520
10513
  }
10521
- function jf(e, t) {
10522
- return t != null && t(e) ? e : e && typeof e == "object" && "cause" in e && e.cause !== void 0 ? jf(e.cause, t) : t ? null : e;
10514
+ function Df(e, t) {
10515
+ return t != null && t(e) ? e : e && typeof e == "object" && "cause" in e && e.cause !== void 0 ? Df(e.cause, t) : t ? null : e;
10523
10516
  }
10524
10517
  class jd extends le {
10525
10518
  constructor({ max: t, min: r, signed: n, size: i, value: s }) {
@@ -10548,7 +10541,7 @@ class Wd extends le {
10548
10541
  super(`Slice ${r === "start" ? "starting" : "ending"} at offset "${t}" is out-of-bounds (size: ${n}).`, { name: "SliceOffsetOutOfBoundsError" });
10549
10542
  }
10550
10543
  }
10551
- class Gf extends le {
10544
+ class jf extends le {
10552
10545
  constructor({ size: t, targetSize: r, type: n }) {
10553
10546
  super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`, { name: "SizeExceedsPaddingSizeError" });
10554
10547
  }
@@ -10561,7 +10554,7 @@ function Vd(e, { dir: t, size: r = 32 } = {}) {
10561
10554
  return e;
10562
10555
  const n = e.replace("0x", "");
10563
10556
  if (n.length > r * 2)
10564
- throw new Gf({
10557
+ throw new jf({
10565
10558
  size: Math.ceil(n.length / 2),
10566
10559
  targetSize: r,
10567
10560
  type: "hex"
@@ -10572,7 +10565,7 @@ function zd(e, { dir: t, size: r = 32 } = {}) {
10572
10565
  if (r === null)
10573
10566
  return e;
10574
10567
  if (e.length > r)
10575
- throw new Gf({
10568
+ throw new jf({
10576
10569
  size: e.length,
10577
10570
  targetSize: r,
10578
10571
  type: "bytes"
@@ -10586,7 +10579,7 @@ function zd(e, { dir: t, size: r = 32 } = {}) {
10586
10579
  }
10587
10580
  const qd = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
10588
10581
  function J(e, t = {}) {
10589
- return typeof e == "number" || typeof e == "bigint" ? Wf(e, t) : typeof e == "string" ? Xd(e, t) : typeof e == "boolean" ? Kd(e, t) : Gt(e, t);
10582
+ return typeof e == "number" || typeof e == "bigint" ? Gf(e, t) : typeof e == "string" ? Xd(e, t) : typeof e == "boolean" ? Kd(e, t) : Gt(e, t);
10590
10583
  }
10591
10584
  function Kd(e, t = {}) {
10592
10585
  const r = `0x${Number(e)}`;
@@ -10599,7 +10592,7 @@ function Gt(e, t = {}) {
10599
10592
  const n = `0x${r}`;
10600
10593
  return typeof t.size == "number" ? (Nr(n, { size: t.size }), Lr(n, { dir: "right", size: t.size })) : n;
10601
10594
  }
10602
- function Wf(e, t = {}) {
10595
+ function Gf(e, t = {}) {
10603
10596
  const { signed: r, size: n } = t, i = BigInt(e);
10604
10597
  let s;
10605
10598
  n ? r ? s = (1n << BigInt(n) * 8n - 1n) - 1n : s = 2n ** (BigInt(n) * 8n) - 1n : typeof e == "number" && (s = BigInt(Number.MAX_SAFE_INTEGER));
@@ -10623,8 +10616,8 @@ function Xd(e, t = {}) {
10623
10616
  return Gt(r, t);
10624
10617
  }
10625
10618
  const Jd = /* @__PURE__ */ new TextEncoder();
10626
- function Vf(e, t = {}) {
10627
- return typeof e == "number" || typeof e == "bigint" ? Zd(e, t) : typeof e == "boolean" ? Qd(e, t) : vn(e) ? rr(e, t) : zf(e, t);
10619
+ function Wf(e, t = {}) {
10620
+ return typeof e == "number" || typeof e == "bigint" ? Zd(e, t) : typeof e == "boolean" ? Qd(e, t) : vn(e) ? rr(e, t) : Vf(e, t);
10628
10621
  }
10629
10622
  function Qd(e, t = {}) {
10630
10623
  const r = new Uint8Array(1);
@@ -10638,7 +10631,7 @@ const bt = {
10638
10631
  a: 97,
10639
10632
  f: 102
10640
10633
  };
10641
- function ha(e) {
10634
+ function ca(e) {
10642
10635
  if (e >= bt.zero && e <= bt.nine)
10643
10636
  return e - bt.zero;
10644
10637
  if (e >= bt.A && e <= bt.F)
@@ -10653,7 +10646,7 @@ function rr(e, t = {}) {
10653
10646
  n.length % 2 && (n = `0${n}`);
10654
10647
  const i = n.length / 2, s = new Uint8Array(i);
10655
10648
  for (let o = 0, a = 0; o < i; o++) {
10656
- const c = ha(n.charCodeAt(a++)), l = ha(n.charCodeAt(a++));
10649
+ const c = ca(n.charCodeAt(a++)), l = ca(n.charCodeAt(a++));
10657
10650
  if (c === void 0 || l === void 0)
10658
10651
  throw new le(`Invalid byte sequence ("${n[a - 2]}${n[a - 1]}" in "${n}").`);
10659
10652
  s[o] = c * 16 + l;
@@ -10661,10 +10654,10 @@ function rr(e, t = {}) {
10661
10654
  return s;
10662
10655
  }
10663
10656
  function Zd(e, t) {
10664
- const r = Wf(e, t);
10657
+ const r = Gf(e, t);
10665
10658
  return rr(r);
10666
10659
  }
10667
- function zf(e, t = {}) {
10660
+ function Vf(e, t = {}) {
10668
10661
  const r = Jd.encode(e);
10669
10662
  return typeof t.size == "number" ? (Nr(r, { size: t.size }), Lr(r, { dir: "right", size: t.size })) : r;
10670
10663
  }
@@ -10703,7 +10696,7 @@ function zs(e, t) {
10703
10696
  type: e
10704
10697
  });
10705
10698
  }
10706
- const qf = {
10699
+ const zf = {
10707
10700
  "0x0": "legacy",
10708
10701
  "0x1": "eip2930",
10709
10702
  "0x2": "eip1559",
@@ -10724,7 +10717,7 @@ function qs(e) {
10724
10717
  nonce: e.nonce ? oi(e.nonce) : void 0,
10725
10718
  to: e.to ? e.to : null,
10726
10719
  transactionIndex: e.transactionIndex ? Number(e.transactionIndex) : null,
10727
- type: e.type ? qf[e.type] : void 0,
10720
+ type: e.type ? zf[e.type] : void 0,
10728
10721
  typeHex: e.type ? e.type : void 0,
10729
10722
  value: e.value ? BigInt(e.value) : void 0,
10730
10723
  v: e.v ? BigInt(e.v) : void 0
@@ -10802,7 +10795,7 @@ function op(e) {
10802
10795
  to: e.to ? e.to : null,
10803
10796
  transactionIndex: e.transactionIndex ? oi(e.transactionIndex) : null,
10804
10797
  status: e.status ? sp[e.status] : null,
10805
- type: e.type ? qf[e.type] || e.type : null
10798
+ type: e.type ? zf[e.type] || e.type : null
10806
10799
  };
10807
10800
  return e.blobGasPrice && (t.blobGasPrice = BigInt(e.blobGasPrice)), e.blobGasUsed && (t.blobGasUsed = BigInt(e.blobGasUsed)), t;
10808
10801
  }
@@ -10810,7 +10803,7 @@ const ap = /* @__PURE__ */ zs("transactionReceipt", op), Ks = 2n ** 256n - 1n;
10810
10803
  function En(e) {
10811
10804
  return `0x${e.reduce((t, r) => t + r.replace("0x", ""), "")}`;
10812
10805
  }
10813
- class la extends le {
10806
+ class ha extends le {
10814
10807
  constructor({ offset: t }) {
10815
10808
  super(`Offset \`${t}\` cannot be negative.`, {
10816
10809
  name: "NegativeOffsetError"
@@ -10850,7 +10843,7 @@ const cp = {
10850
10843
  },
10851
10844
  decrementPosition(e) {
10852
10845
  if (e < 0)
10853
- throw new la({ offset: e });
10846
+ throw new ha({ offset: e });
10854
10847
  const t = this.position - e;
10855
10848
  this.assertPosition(t), this.position = t;
10856
10849
  },
@@ -10859,7 +10852,7 @@ const cp = {
10859
10852
  },
10860
10853
  incrementPosition(e) {
10861
10854
  if (e < 0)
10862
- throw new la({ offset: e });
10855
+ throw new ha({ offset: e });
10863
10856
  const t = this.position + e;
10864
10857
  this.assertPosition(t), this.position = t;
10865
10858
  },
@@ -10949,19 +10942,19 @@ const cp = {
10949
10942
  this.positionReadCount.set(this.position, e + 1), e > 0 && this.recursiveReadCount++;
10950
10943
  }
10951
10944
  };
10952
- function Kf(e, { recursiveReadLimit: t = 8192 } = {}) {
10945
+ function qf(e, { recursiveReadLimit: t = 8192 } = {}) {
10953
10946
  const r = Object.create(cp);
10954
10947
  return r.bytes = e, r.dataView = new DataView(e.buffer, e.byteOffset, e.byteLength), r.positionReadCount = /* @__PURE__ */ new Map(), r.recursiveReadLimit = t, r;
10955
10948
  }
10956
10949
  function nr(e, t = "hex") {
10957
- const r = Yf(e), n = Kf(new Uint8Array(r.length));
10950
+ const r = Kf(e), n = qf(new Uint8Array(r.length));
10958
10951
  return r.encode(n), t === "hex" ? Gt(n.bytes) : n.bytes;
10959
10952
  }
10960
- function Yf(e) {
10961
- return Array.isArray(e) ? hp(e.map((t) => Yf(t))) : lp(e);
10953
+ function Kf(e) {
10954
+ return Array.isArray(e) ? hp(e.map((t) => Kf(t))) : lp(e);
10962
10955
  }
10963
10956
  function hp(e) {
10964
- const t = e.reduce((i, s) => i + s.length, 0), r = Xf(t);
10957
+ const t = e.reduce((i, s) => i + s.length, 0), r = Yf(t);
10965
10958
  return {
10966
10959
  length: t <= 55 ? 1 + t : 1 + r + t,
10967
10960
  encode(i) {
@@ -10972,7 +10965,7 @@ function hp(e) {
10972
10965
  };
10973
10966
  }
10974
10967
  function lp(e) {
10975
- const t = typeof e == "string" ? rr(e) : e, r = Xf(t.length);
10968
+ const t = typeof e == "string" ? rr(e) : e, r = Yf(t.length);
10976
10969
  return {
10977
10970
  length: t.length === 1 && t[0] < 128 ? 1 : t.length <= 55 ? 1 + t.length : 1 + r + t.length,
10978
10971
  encode(i) {
@@ -10980,7 +10973,7 @@ function lp(e) {
10980
10973
  }
10981
10974
  };
10982
10975
  }
10983
- function Xf(e) {
10976
+ function Yf(e) {
10984
10977
  if (e < 2 ** 8)
10985
10978
  return 1;
10986
10979
  if (e < 2 ** 16)
@@ -11046,13 +11039,13 @@ class gp extends le {
11046
11039
  super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
11047
11040
  }
11048
11041
  }
11049
- function Jf(e) {
11042
+ function Xf(e) {
11050
11043
  const { kzg: t } = e, r = e.to ?? (typeof e.blobs[0] == "string" ? "hex" : "bytes"), n = typeof e.blobs[0] == "string" ? e.blobs.map((s) => rr(s)) : e.blobs, i = [];
11051
11044
  for (const s of n)
11052
11045
  i.push(Uint8Array.from(t.blobToKzgCommitment(s)));
11053
11046
  return r === "bytes" ? i : i.map((s) => Gt(s));
11054
11047
  }
11055
- function Qf(e) {
11048
+ function Jf(e) {
11056
11049
  const { kzg: t } = e, r = e.to ?? (typeof e.blobs[0] == "string" ? "hex" : "bytes"), n = typeof e.blobs[0] == "string" ? e.blobs.map((o) => rr(o)) : e.blobs, i = typeof e.commitments[0] == "string" ? e.commitments.map((o) => rr(o)) : e.commitments, s = [];
11057
11050
  for (let o = 0; o < n.length; o++) {
11058
11051
  const a = n[o], c = i[o];
@@ -11061,7 +11054,7 @@ function Qf(e) {
11061
11054
  return r === "bytes" ? s : s.map((o) => Gt(o));
11062
11055
  }
11063
11056
  function mp(e, t) {
11064
- return za(vn(e, { strict: !1 }) ? Vf(e) : e);
11057
+ return Va(vn(e, { strict: !1 }) ? Wf(e) : e);
11065
11058
  }
11066
11059
  function _p(e) {
11067
11060
  const { commitment: t, version: r = 1 } = e, n = e.to ?? (typeof t == "string" ? "hex" : "bytes"), i = mp(t);
@@ -11077,9 +11070,9 @@ function vp(e) {
11077
11070
  }));
11078
11071
  return i;
11079
11072
  }
11080
- const da = 6, Zf = 32, Ys = 4096, eu = Zf * Ys, pa = eu * da - // terminator byte (0x80).
11073
+ const la = 6, Qf = 32, Ys = 4096, Zf = Qf * Ys, da = Zf * la - // terminator byte (0x80).
11081
11074
  1 - // zero byte (0x00) appended to each field element.
11082
- 1 * Ys * da, tu = 1;
11075
+ 1 * Ys * la, eu = 1;
11083
11076
  class Ep extends le {
11084
11077
  constructor({ maxSize: t, size: r }) {
11085
11078
  super("Blob size is too large.", {
@@ -11088,7 +11081,7 @@ class Ep extends le {
11088
11081
  });
11089
11082
  }
11090
11083
  }
11091
- class ru extends le {
11084
+ class tu extends le {
11092
11085
  constructor() {
11093
11086
  super("Blob data must not be empty.", { name: "EmptyBlobError" });
11094
11087
  }
@@ -11105,7 +11098,7 @@ class Sp extends le {
11105
11098
  constructor({ hash: t, version: r }) {
11106
11099
  super(`Versioned hash "${t}" version is invalid.`, {
11107
11100
  metaMessages: [
11108
- `Expected: ${tu}`,
11101
+ `Expected: ${eu}`,
11109
11102
  `Received: ${r}`
11110
11103
  ],
11111
11104
  name: "InvalidVersionedHashVersionError"
@@ -11115,19 +11108,19 @@ class Sp extends le {
11115
11108
  function Bp(e) {
11116
11109
  const t = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), r = typeof e.data == "string" ? rr(e.data) : e.data, n = Ur(r);
11117
11110
  if (!n)
11118
- throw new ru();
11119
- if (n > pa)
11111
+ throw new tu();
11112
+ if (n > da)
11120
11113
  throw new Ep({
11121
- maxSize: pa,
11114
+ maxSize: da,
11122
11115
  size: n
11123
11116
  });
11124
11117
  const i = [];
11125
11118
  let s = !0, o = 0;
11126
11119
  for (; s; ) {
11127
- const a = Kf(new Uint8Array(eu));
11120
+ const a = qf(new Uint8Array(Zf));
11128
11121
  let c = 0;
11129
11122
  for (; c < Ys; ) {
11130
- const l = r.slice(o, o + (Zf - 1));
11123
+ const l = r.slice(o, o + (Qf - 1));
11131
11124
  if (a.pushByte(0), a.pushBytes(l), l.length < 31) {
11132
11125
  a.pushByte(128), s = !1;
11133
11126
  break;
@@ -11139,7 +11132,7 @@ function Bp(e) {
11139
11132
  return t === "bytes" ? i.map((a) => a.bytes) : i.map((a) => Gt(a.bytes));
11140
11133
  }
11141
11134
  function Pp(e) {
11142
- const { data: t, kzg: r, to: n } = e, i = e.blobs ?? Bp({ data: t, to: n }), s = e.commitments ?? Jf({ blobs: i, kzg: r, to: n }), o = e.proofs ?? Qf({ blobs: i, commitments: s, kzg: r, to: n }), a = [];
11135
+ const { data: t, kzg: r, to: n } = e, i = e.blobs ?? Bp({ data: t, to: n }), s = e.commitments ?? Xf({ blobs: i, kzg: r, to: n }), o = e.proofs ?? Jf({ blobs: i, commitments: s, kzg: r, to: n }), a = [];
11143
11136
  for (let c = 0; c < i.length; c++)
11144
11137
  a.push({
11145
11138
  blob: i[c],
@@ -11193,7 +11186,7 @@ Object.defineProperty(ki, "nodeMessage", {
11193
11186
  writable: !0,
11194
11187
  value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/
11195
11188
  });
11196
- class nu extends le {
11189
+ class ru extends le {
11197
11190
  constructor({ cause: t, maxPriorityFeePerGas: r, maxFeePerGas: n } = {}) {
11198
11191
  super([
11199
11192
  `The provided tip (\`maxPriorityFeePerGas\`${r ? ` = ${xs(r)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n ? ` = ${xs(n)} gwei` : ""}).`
@@ -11204,13 +11197,13 @@ class nu extends le {
11204
11197
  });
11205
11198
  }
11206
11199
  }
11207
- Object.defineProperty(nu, "nodeMessage", {
11200
+ Object.defineProperty(ru, "nodeMessage", {
11208
11201
  enumerable: !0,
11209
11202
  configurable: !0,
11210
11203
  writable: !0,
11211
11204
  value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/
11212
11205
  });
11213
- class iu extends Map {
11206
+ class nu extends Map {
11214
11207
  constructor(t) {
11215
11208
  super(), Object.defineProperty(this, "maxSize", {
11216
11209
  enumerable: !0,
@@ -11231,9 +11224,9 @@ class iu extends Map {
11231
11224
  return this;
11232
11225
  }
11233
11226
  }
11234
- const Nn = /* @__PURE__ */ BigInt(2 ** 32 - 1), ya = /* @__PURE__ */ BigInt(32);
11227
+ const Nn = /* @__PURE__ */ BigInt(2 ** 32 - 1), pa = /* @__PURE__ */ BigInt(32);
11235
11228
  function Ap(e, t = !1) {
11236
- return t ? { h: Number(e & Nn), l: Number(e >> ya & Nn) } : { h: Number(e >> ya & Nn) | 0, l: Number(e & Nn) | 0 };
11229
+ return t ? { h: Number(e & Nn), l: Number(e >> pa & Nn) } : { h: Number(e >> pa & Nn) | 0, l: Number(e & Nn) | 0 };
11237
11230
  }
11238
11231
  function Ip(e, t = !1) {
11239
11232
  let r = new Uint32Array(e.length), n = new Uint32Array(e.length);
@@ -11243,28 +11236,28 @@ function Ip(e, t = !1) {
11243
11236
  }
11244
11237
  return [r, n];
11245
11238
  }
11246
- const Op = (e, t, r) => e << r | t >>> 32 - r, kp = (e, t, r) => t << r | e >>> 32 - r, Rp = (e, t, r) => t << r - 32 | e >>> 64 - r, Up = (e, t, r) => e << r - 32 | t >>> 64 - r, su = [], ou = [], au = [], Cp = /* @__PURE__ */ BigInt(0), Zr = /* @__PURE__ */ BigInt(1), Lp = /* @__PURE__ */ BigInt(2), Np = /* @__PURE__ */ BigInt(7), Fp = /* @__PURE__ */ BigInt(256), Mp = /* @__PURE__ */ BigInt(113);
11239
+ const Op = (e, t, r) => e << r | t >>> 32 - r, kp = (e, t, r) => t << r | e >>> 32 - r, Rp = (e, t, r) => t << r - 32 | e >>> 64 - r, Up = (e, t, r) => e << r - 32 | t >>> 64 - r, iu = [], su = [], ou = [], Cp = /* @__PURE__ */ BigInt(0), Zr = /* @__PURE__ */ BigInt(1), Lp = /* @__PURE__ */ BigInt(2), Np = /* @__PURE__ */ BigInt(7), Fp = /* @__PURE__ */ BigInt(256), Mp = /* @__PURE__ */ BigInt(113);
11247
11240
  for (let e = 0, t = Zr, r = 1, n = 0; e < 24; e++) {
11248
- [r, n] = [n, (2 * r + 3 * n) % 5], su.push(2 * (5 * n + r)), ou.push((e + 1) * (e + 2) / 2 % 64);
11241
+ [r, n] = [n, (2 * r + 3 * n) % 5], iu.push(2 * (5 * n + r)), su.push((e + 1) * (e + 2) / 2 % 64);
11249
11242
  let i = Cp;
11250
11243
  for (let s = 0; s < 7; s++)
11251
11244
  t = (t << Zr ^ (t >> Np) * Mp) % Fp, t & Lp && (i ^= Zr << (Zr << /* @__PURE__ */ BigInt(s)) - Zr);
11252
- au.push(i);
11245
+ ou.push(i);
11253
11246
  }
11254
- const [Hp, $p] = /* @__PURE__ */ Ip(au, !0), ba = (e, t, r) => r > 32 ? Rp(e, t, r) : Op(e, t, r), wa = (e, t, r) => r > 32 ? Up(e, t, r) : kp(e, t, r);
11247
+ const [Hp, $p] = /* @__PURE__ */ Ip(ou, !0), ya = (e, t, r) => r > 32 ? Rp(e, t, r) : Op(e, t, r), ba = (e, t, r) => r > 32 ? Up(e, t, r) : kp(e, t, r);
11255
11248
  function Dp(e, t = 24) {
11256
11249
  const r = new Uint32Array(10);
11257
11250
  for (let n = 24 - t; n < 24; n++) {
11258
11251
  for (let o = 0; o < 10; o++)
11259
11252
  r[o] = e[o] ^ e[o + 10] ^ e[o + 20] ^ e[o + 30] ^ e[o + 40];
11260
11253
  for (let o = 0; o < 10; o += 2) {
11261
- const a = (o + 8) % 10, c = (o + 2) % 10, l = r[c], d = r[c + 1], g = ba(l, d, 1) ^ r[a], x = wa(l, d, 1) ^ r[a + 1];
11254
+ const a = (o + 8) % 10, c = (o + 2) % 10, l = r[c], d = r[c + 1], g = ya(l, d, 1) ^ r[a], x = ba(l, d, 1) ^ r[a + 1];
11262
11255
  for (let y = 0; y < 50; y += 10)
11263
11256
  e[o + y] ^= g, e[o + y + 1] ^= x;
11264
11257
  }
11265
11258
  let i = e[2], s = e[3];
11266
11259
  for (let o = 0; o < 24; o++) {
11267
- const a = ou[o], c = ba(i, s, a), l = wa(i, s, a), d = su[o];
11260
+ const a = su[o], c = ya(i, s, a), l = ba(i, s, a), d = iu[o];
11268
11261
  i = e[d], s = e[d + 1], e[d] = c, e[d + 1] = l;
11269
11262
  }
11270
11263
  for (let o = 0; o < 50; o += 10) {
@@ -11277,15 +11270,15 @@ function Dp(e, t = 24) {
11277
11270
  }
11278
11271
  r.fill(0);
11279
11272
  }
11280
- class Xs extends Va {
11273
+ class Xs extends Wa {
11281
11274
  // NOTE: we accept arguments in bytes instead of bits here.
11282
11275
  constructor(t, r, n, i = !1, s = 24) {
11283
- if (super(), this.blockLen = t, this.suffix = r, this.outputLen = n, this.enableXOF = i, this.rounds = s, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, po(n), 0 >= this.blockLen || this.blockLen >= 200)
11276
+ if (super(), this.blockLen = t, this.suffix = r, this.outputLen = n, this.enableXOF = i, this.rounds = s, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, lo(n), 0 >= this.blockLen || this.blockLen >= 200)
11284
11277
  throw new Error("Sha3 supports only keccak-f1600 function");
11285
11278
  this.state = new Uint8Array(200), this.state32 = gc(this.state);
11286
11279
  }
11287
11280
  keccak() {
11288
- yo || bo(this.state32), Dp(this.state32, this.rounds), yo || bo(this.state32), this.posOut = 0, this.pos = 0;
11281
+ po || yo(this.state32), Dp(this.state32, this.rounds), po || yo(this.state32), this.posOut = 0, this.pos = 0;
11289
11282
  }
11290
11283
  update(t) {
11291
11284
  Qn(this);
@@ -11323,10 +11316,10 @@ class Xs extends Va {
11323
11316
  return this.writeInto(t);
11324
11317
  }
11325
11318
  xof(t) {
11326
- return po(t), this.xofInto(new Uint8Array(t));
11319
+ return lo(t), this.xofInto(new Uint8Array(t));
11327
11320
  }
11328
11321
  digestInto(t) {
11329
- if (Wa(t, this), this.finished)
11322
+ if (Ga(t, this), this.finished)
11330
11323
  throw new Error("digest() was already called");
11331
11324
  return this.writeInto(t), this.destroy(), t;
11332
11325
  }
@@ -11343,19 +11336,19 @@ class Xs extends Va {
11343
11336
  }
11344
11337
  const jp = (e, t, r) => Cs(() => new Xs(t, e, r)), Gp = /* @__PURE__ */ jp(1, 136, 256 / 8);
11345
11338
  function Wp(e, t) {
11346
- return Gp(vn(e, { strict: !1 }) ? Vf(e) : e);
11339
+ return Gp(vn(e, { strict: !1 }) ? Wf(e) : e);
11347
11340
  }
11348
- const fs = /* @__PURE__ */ new iu(8192);
11341
+ const fs = /* @__PURE__ */ new nu(8192);
11349
11342
  function Vp(e, t) {
11350
11343
  if (fs.has(`${e}.${t}`))
11351
11344
  return fs.get(`${e}.${t}`);
11352
- const r = e.substring(2).toLowerCase(), n = Wp(zf(r)), i = r.split("");
11345
+ const r = e.substring(2).toLowerCase(), n = Wp(Vf(r)), i = r.split("");
11353
11346
  for (let o = 0; o < 40; o += 2)
11354
11347
  n[o >> 1] >> 4 >= 8 && i[o] && (i[o] = i[o].toUpperCase()), (n[o >> 1] & 15) >= 8 && i[o + 1] && (i[o + 1] = i[o + 1].toUpperCase());
11355
11348
  const s = `0x${i.join("")}`;
11356
11349
  return fs.set(`${e}.${t}`, s), s;
11357
11350
  }
11358
- const zp = /^0x[a-fA-F0-9]{40}$/, us = /* @__PURE__ */ new iu(8192);
11351
+ const zp = /^0x[a-fA-F0-9]{40}$/, us = /* @__PURE__ */ new nu(8192);
11359
11352
  function sr(e, t) {
11360
11353
  const { strict: r = !0 } = t ?? {}, n = `${e}.${r}`;
11361
11354
  if (us.has(n))
@@ -11370,7 +11363,7 @@ function qp(e, t, r, { strict: n } = {}) {
11370
11363
  strict: n
11371
11364
  });
11372
11365
  }
11373
- function fu(e, t, r) {
11366
+ function au(e, t, r) {
11374
11367
  if (Ur(e) !== r - t)
11375
11368
  throw new Wd({
11376
11369
  offset: r,
@@ -11380,11 +11373,11 @@ function fu(e, t, r) {
11380
11373
  }
11381
11374
  function Kp(e, t, r, { strict: n } = {}) {
11382
11375
  const i = e.slice(t, r);
11383
- return n && fu(i, t, r), i;
11376
+ return n && au(i, t, r), i;
11384
11377
  }
11385
11378
  function Yp(e, t, r, { strict: n } = {}) {
11386
11379
  const i = `0x${e.replace("0x", "").slice(t * 2, r * 2)}`;
11387
- return n && fu(i, t, r), i;
11380
+ return n && au(i, t, r), i;
11388
11381
  }
11389
11382
  function Xp(e) {
11390
11383
  const { authorizationList: t } = e;
@@ -11402,12 +11395,12 @@ function Jp(e) {
11402
11395
  const { blobVersionedHashes: t } = e;
11403
11396
  if (t) {
11404
11397
  if (t.length === 0)
11405
- throw new ru();
11398
+ throw new tu();
11406
11399
  for (const r of t) {
11407
11400
  const n = Ur(r), i = oi(qp(r, 0, 1));
11408
11401
  if (n !== 32)
11409
11402
  throw new xp({ hash: r, size: n });
11410
- if (i !== tu)
11403
+ if (i !== eu)
11411
11404
  throw new Sp({
11412
11405
  hash: r,
11413
11406
  version: i
@@ -11425,7 +11418,7 @@ function Js(e) {
11425
11418
  if (n && n > Ks)
11426
11419
  throw new ki({ maxFeePerGas: n });
11427
11420
  if (r && n && r > n)
11428
- throw new nu({ maxFeePerGas: n, maxPriorityFeePerGas: r });
11421
+ throw new ru({ maxFeePerGas: n, maxPriorityFeePerGas: r });
11429
11422
  }
11430
11423
  function Qp(e) {
11431
11424
  const { chainId: t, maxPriorityFeePerGas: r, gasPrice: n, maxFeePerGas: i, to: s } = e;
@@ -11507,18 +11500,18 @@ function ny(e, t) {
11507
11500
  Jp(e);
11508
11501
  let x = e.blobVersionedHashes, y = e.sidecars;
11509
11502
  if (e.blobs && (typeof x > "u" || typeof y > "u")) {
11510
- const _ = typeof e.blobs[0] == "string" ? e.blobs : e.blobs.map((E) => Gt(E)), m = e.kzg, S = Jf({
11503
+ const _ = typeof e.blobs[0] == "string" ? e.blobs : e.blobs.map((E) => Gt(E)), m = e.kzg, S = Xf({
11511
11504
  blobs: _,
11512
11505
  kzg: m
11513
11506
  });
11514
11507
  if (typeof x > "u" && (x = vp({
11515
11508
  commitments: S
11516
11509
  })), typeof y > "u") {
11517
- const E = Qf({ blobs: _, commitments: S, kzg: m });
11510
+ const E = Jf({ blobs: _, commitments: S, kzg: m });
11518
11511
  y = Pp({ blobs: _, commitments: S, proofs: E });
11519
11512
  }
11520
11513
  }
11521
- const O = Ri(d), B = [
11514
+ const O = Ri(d), A = [
11522
11515
  J(r),
11523
11516
  i ? J(i) : "0x",
11524
11517
  l ? J(l) : "0x",
@@ -11531,16 +11524,16 @@ function ny(e, t) {
11531
11524
  a ? J(a) : "0x",
11532
11525
  x ?? [],
11533
11526
  ...xn(e, t)
11534
- ], A = [], k = [], U = [];
11527
+ ], T = [], k = [], U = [];
11535
11528
  if (y)
11536
11529
  for (let _ = 0; _ < y.length; _++) {
11537
11530
  const { blob: m, commitment: S, proof: E } = y[_];
11538
- A.push(m), k.push(S), U.push(E);
11531
+ T.push(m), k.push(S), U.push(E);
11539
11532
  }
11540
11533
  return En([
11541
11534
  "0x03",
11542
11535
  // If sidecars are enabled, envelope turns into a "wrapper":
11543
- nr(y ? [B, A, k, U] : B)
11536
+ nr(y ? [A, T, k, U] : A)
11544
11537
  ]);
11545
11538
  }
11546
11539
  function iy(e, t) {
@@ -11964,8 +11957,8 @@ const ai = {
11964
11957
  arbitrum: py,
11965
11958
  ethereum_sepolia: vy,
11966
11959
  arbitrum_sepolia: yy,
11967
- ethereum_localnet: du,
11968
- arbitrum_localnet: pu,
11960
+ ethereum_localnet: lu,
11961
+ arbitrum_localnet: du,
11969
11962
  base_sepolia: wy,
11970
11963
  base: by,
11971
11964
  bera_testnet: gy,
@@ -11978,10 +11971,10 @@ const ai = {
11978
11971
  if (r.id === ((n = t.chain) == null ? void 0 : n.id))
11979
11972
  return re({ message: "Already on the network", walletClient: t });
11980
11973
  await t.switchChain({ id: r.id });
11981
- const i = no({
11974
+ const i = ro({
11982
11975
  account: t.account,
11983
11976
  chain: r,
11984
- transport: io(window.ethereum)
11977
+ transport: no(window.ethereum)
11985
11978
  });
11986
11979
  return re({
11987
11980
  message: "Switched chain",
@@ -11991,10 +11984,10 @@ const ai = {
11991
11984
  if (Sy(i))
11992
11985
  try {
11993
11986
  await t.addChain({ chain: r });
11994
- const s = no({
11987
+ const s = ro({
11995
11988
  account: t.account,
11996
11989
  chain: r,
11997
- transport: io(window.ethereum)
11990
+ transport: no(window.ethereum)
11998
11991
  });
11999
11992
  return re({
12000
11993
  message: "Added network",
@@ -12010,14 +12003,14 @@ const ai = {
12010
12003
  return j("Chain not supported");
12011
12004
  }, Sy = (e) => typeof e == "object" && e !== null && "code" in e && e.code === 4902;
12012
12005
  export {
12013
- Fo as API,
12006
+ No as API,
12014
12007
  tl as BlockNumberFetcher,
12015
12008
  Lu as EvmRelay,
12016
12009
  Dy as Garden,
12017
12010
  Pe as OrderActions,
12018
12011
  be as OrderStatus,
12019
- _a as ParseOrderStatus,
12020
- ao as ParseSwapStatus,
12012
+ ma as ParseOrderStatus,
12013
+ oo as ParseSwapStatus,
12021
12014
  rl as Quote,
12022
12015
  ii as SecretManager,
12023
12016
  we as SwapStatus,
@@ -12027,7 +12020,7 @@ export {
12027
12020
  Ny as filterDeadlineExpiredOrders,
12028
12021
  Yn as isExpired,
12029
12022
  Ly as parseAction,
12030
- va as parseActionFromStatus,
12023
+ _a as parseActionFromStatus,
12031
12024
  jy as switchOrAddNetwork,
12032
12025
  Cy as validateBTCAddress
12033
12026
  };