@chainrails/react 0.2.22 → 0.2.24

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.
@@ -1,5 +1,5 @@
1
- import { useState as U, useRef as re, useEffect as k, useMemo as ye, useSyncExternalStore as Rt, useCallback as At, useLayoutEffect as vt, useDebugValue as Pt } from "react";
2
- import { jsxs as we, jsx as B } from "react/jsx-runtime";
1
+ import { useState as C, useRef as re, useEffect as x, useMemo as ye, useSyncExternalStore as Rt, useCallback as At, useLayoutEffect as vt, useDebugValue as Pt } from "react";
2
+ import { jsxs as we, jsx as M } from "react/jsx-runtime";
3
3
  import './index.css';class G extends Error {
4
4
  response;
5
5
  request;
@@ -50,7 +50,7 @@ const be = (() => {
50
50
  throw r;
51
51
  }
52
52
  return e && !t;
53
- })(), It = typeof globalThis.AbortController == "function", Be = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function", Ut = typeof globalThis.ReadableStream == "function", Ct = typeof globalThis.FormData == "function", $e = ["get", "post", "put", "patch", "head", "delete"], kt = {
53
+ })(), It = typeof globalThis.AbortController == "function", Be = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function", Ct = typeof globalThis.ReadableStream == "function", Ut = typeof globalThis.FormData == "function", $e = ["get", "post", "put", "patch", "head", "delete"], xt = {
54
54
  json: "application/json",
55
55
  text: "text/*",
56
56
  formData: "multipart/form-data",
@@ -59,7 +59,7 @@ const be = (() => {
59
59
  // Supported in modern Fetch implementations (for example, browsers and recent Node.js/undici).
60
60
  // We still feature-check at runtime before exposing the shortcut.
61
61
  bytes: "*/*"
62
- }, W = 2147483647, xt = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length, ze = Symbol("stop");
62
+ }, W = 2147483647, kt = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length, ze = Symbol("stop");
63
63
  class Le {
64
64
  options;
65
65
  constructor(t) {
@@ -104,7 +104,7 @@ const Dt = (e) => new Le(e), Ot = {
104
104
  if (e instanceof FormData) {
105
105
  let t = 0;
106
106
  for (const [s, n] of e)
107
- t += xt, t += new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length, t += typeof n == "string" ? new TextEncoder().encode(n).length : n.size;
107
+ t += kt, t += new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length, t += typeof n == "string" ? new TextEncoder().encode(n).length : n.size;
108
108
  return t;
109
109
  }
110
110
  if (e instanceof Blob)
@@ -164,7 +164,7 @@ const Dt = (e) => new Le(e), Ot = {
164
164
  duplex: "half",
165
165
  body: je(e.body, n, t)
166
166
  });
167
- }, I = (e) => e !== null && typeof e == "object", $ = (...e) => {
167
+ }, I = (e) => e !== null && typeof e == "object", B = (...e) => {
168
168
  for (const t of e)
169
169
  if ((!I(t) || Array.isArray(t)) && t !== void 0)
170
170
  throw new TypeError("The `options` argument must be an object");
@@ -175,14 +175,14 @@ const Dt = (e) => new Le(e), Ot = {
175
175
  n && o === "undefined" || o === void 0 ? s.delete(i) : s.set(i, o);
176
176
  return s;
177
177
  };
178
- function z(e, t, s) {
178
+ function $(e, t, s) {
179
179
  return Object.hasOwn(t, s) && t[s] === void 0 ? [] : oe(e[s] ?? [], t[s] ?? []);
180
180
  }
181
181
  const qe = (e = {}, t = {}) => ({
182
- beforeRequest: z(e, t, "beforeRequest"),
183
- beforeRetry: z(e, t, "beforeRetry"),
184
- afterResponse: z(e, t, "afterResponse"),
185
- beforeError: z(e, t, "beforeError")
182
+ beforeRequest: $(e, t, "beforeRequest"),
183
+ beforeRetry: $(e, t, "beforeRetry"),
184
+ afterResponse: $(e, t, "afterResponse"),
185
+ beforeError: $(e, t, "beforeError")
186
186
  }), Lt = (e, t) => {
187
187
  const s = new URLSearchParams();
188
188
  for (const n of [e, t])
@@ -323,7 +323,7 @@ class N {
323
323
  if (n.#e.onDownloadProgress) {
324
324
  if (typeof n.#e.onDownloadProgress != "function")
325
325
  throw new TypeError("The `onDownloadProgress` option must be a function");
326
- if (!Ut)
326
+ if (!Ct)
327
327
  throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
328
328
  return $t(o.clone(), n.#e.onDownloadProgress);
329
329
  }
@@ -332,7 +332,7 @@ class N {
332
332
  const o = n.#o, a = [];
333
333
  o && !o.bodyUsed && a.push(o.body?.cancel()), n.request.bodyUsed || a.push(n.request.body?.cancel()), await Promise.all(a);
334
334
  });
335
- for (const [o, a] of Object.entries(kt))
335
+ for (const [o, a] of Object.entries(xt))
336
336
  o === "bytes" && typeof globalThis.Response?.prototype?.bytes != "function" || (i[o] = async () => {
337
337
  n.request.headers.set("accept", n.request.headers.get("accept") || a);
338
338
  const c = await i;
@@ -387,7 +387,7 @@ class N {
387
387
  }
388
388
  It && Be && (this.#r = this.#e.signal ?? this.#t.signal, this.#n = new globalThis.AbortController(), this.#e.signal = this.#r ? AbortSignal.any([this.#r, this.#n.signal]) : this.#n.signal), be && (this.#e.duplex = "half"), this.#e.json !== void 0 && (this.#e.body = this.#e.stringifyJson?.(this.#e.json) ?? JSON.stringify(this.#e.json), this.#e.headers.set("content-type", this.#e.headers.get("content-type") ?? "application/json"));
389
389
  const n = s.headers && new globalThis.Headers(s.headers).has("content-type");
390
- if (this.#t instanceof globalThis.Request && (Ct && this.#e.body instanceof globalThis.FormData || this.#e.body instanceof URLSearchParams) && !n && this.#e.headers.delete("content-type"), this.request = new globalThis.Request(this.#t, this.#e), Yt(this.#e.searchParams)) {
390
+ if (this.#t instanceof globalThis.Request && (Ut && this.#e.body instanceof globalThis.FormData || this.#e.body instanceof URLSearchParams) && !n && this.#e.headers.delete("content-type"), this.request = new globalThis.Request(this.#t, this.#e), Yt(this.#e.searchParams)) {
391
391
  const i = "?" + (typeof this.#e.searchParams == "string" ? this.#e.searchParams.replace(/^\?/, "") : new URLSearchParams(N.#d(this.#e.searchParams)).toString()), o = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, i);
392
392
  this.request = new globalThis.Request(o, this.#e);
393
393
  }
@@ -499,10 +499,10 @@ class N {
499
499
  }
500
500
  /*! MIT License © Sindre Sorhus */
501
501
  const Q = (e) => {
502
- const t = (s, n) => N.create(s, $(e, n));
502
+ const t = (s, n) => N.create(s, B(e, n));
503
503
  for (const s of $e)
504
- t[s] = (n, r) => N.create(n, $(e, r, { method: s }));
505
- return t.create = (s) => Q($(s)), t.extend = (s) => (typeof s == "function" && (s = s(e ?? {})), Q($(e, s))), t.stop = ze, t.retry = Dt, t;
504
+ t[s] = (n, r) => N.create(n, B(e, r, { method: s }));
505
+ return t.create = (s) => Q(B(s)), t.extend = (s) => (typeof s == "function" && (s = s(e ?? {})), Q(B(e, s))), t.stop = ze, t.retry = Dt, t;
506
506
  }, Gt = Q();
507
507
  var S = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(S || {});
508
508
  const Fe = {
@@ -633,7 +633,7 @@ class tt extends v {
633
633
  super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
634
634
  }
635
635
  }
636
- function H(e, { dir: t, size: s = 32 } = {}) {
636
+ function F(e, { dir: t, size: s = 32 } = {}) {
637
637
  return typeof e == "string" ? Zt(e, { dir: t, size: s }) : Qt(e, { dir: t, size: s });
638
638
  }
639
639
  function Zt(e, { dir: t, size: s = 32 } = {}) {
@@ -697,7 +697,7 @@ function ss(e, t = {}) {
697
697
  });
698
698
  }
699
699
  const a = `0x${(s && r < 0 ? (1n << BigInt(n * 8)) + BigInt(r) : r).toString(16)}`;
700
- return n ? H(a, { size: n }) : a;
700
+ return n ? F(a, { size: n }) : a;
701
701
  }
702
702
  const ns = /* @__PURE__ */ new TextEncoder();
703
703
  function rs(e, t = {}) {
@@ -705,7 +705,7 @@ function rs(e, t = {}) {
705
705
  }
706
706
  function os(e, t = {}) {
707
707
  const s = new Uint8Array(1);
708
- return s[0] = Number(e), typeof t.size == "number" ? (ae(s, { size: t.size }), H(s, { size: t.size })) : s;
708
+ return s[0] = Number(e), typeof t.size == "number" ? (ae(s, { size: t.size }), F(s, { size: t.size })) : s;
709
709
  }
710
710
  const T = {
711
711
  zero: 48,
@@ -725,7 +725,7 @@ function Te(e) {
725
725
  }
726
726
  function st(e, t = {}) {
727
727
  let s = e;
728
- t.size && (ae(s, { size: t.size }), s = H(s, { dir: "right", size: t.size }));
728
+ t.size && (ae(s, { size: t.size }), s = F(s, { dir: "right", size: t.size }));
729
729
  let n = s.slice(2);
730
730
  n.length % 2 && (n = `0${n}`);
731
731
  const r = n.length / 2, i = new Uint8Array(r);
@@ -743,11 +743,11 @@ function is(e, t) {
743
743
  }
744
744
  function nt(e, t = {}) {
745
745
  const s = ns.encode(e);
746
- return typeof t.size == "number" ? (ae(s, { size: t.size }), H(s, { dir: "right", size: t.size })) : s;
746
+ return typeof t.size == "number" ? (ae(s, { size: t.size }), F(s, { dir: "right", size: t.size })) : s;
747
747
  }
748
- const L = /* @__PURE__ */ BigInt(2 ** 32 - 1), Re = /* @__PURE__ */ BigInt(32);
748
+ const z = /* @__PURE__ */ BigInt(2 ** 32 - 1), Re = /* @__PURE__ */ BigInt(32);
749
749
  function as(e, t = !1) {
750
- return t ? { h: Number(e & L), l: Number(e >> Re & L) } : { h: Number(e >> Re & L) | 0, l: Number(e & L) | 0 };
750
+ return t ? { h: Number(e & z), l: Number(e >> Re & z) } : { h: Number(e >> Re & z) | 0, l: Number(e & z) | 0 };
751
751
  }
752
752
  function cs(e, t = !1) {
753
753
  const s = e.length;
@@ -767,7 +767,7 @@ function Ae(e) {
767
767
  if (!Number.isSafeInteger(e) || e < 0)
768
768
  throw new Error("positive integer expected, got " + e);
769
769
  }
770
- function j(e, ...t) {
770
+ function L(e, ...t) {
771
771
  if (!ds(e))
772
772
  throw new Error("Uint8Array expected");
773
773
  if (t.length > 0 && !t.includes(e.length))
@@ -780,7 +780,7 @@ function ve(e, t = !0) {
780
780
  throw new Error("Hash#digest() has already been called");
781
781
  }
782
782
  function ps(e, t) {
783
- j(e);
783
+ L(e);
784
784
  const s = t.outputLen;
785
785
  if (e.length < s)
786
786
  throw new Error("digestInto() expects output buffer of length at least " + s);
@@ -808,7 +808,7 @@ function bs(e) {
808
808
  return new Uint8Array(new TextEncoder().encode(e));
809
809
  }
810
810
  function ot(e) {
811
- return typeof e == "string" && (e = bs(e)), j(e), e;
811
+ return typeof e == "string" && (e = bs(e)), L(e), e;
812
812
  }
813
813
  class Es {
814
814
  }
@@ -816,28 +816,28 @@ function Ss(e) {
816
816
  const t = (n) => e().update(ot(n)).digest(), s = e();
817
817
  return t.outputLen = s.outputLen, t.blockLen = s.blockLen, t.create = () => e(), t;
818
818
  }
819
- const Ts = BigInt(0), x = BigInt(1), Rs = BigInt(2), As = BigInt(7), vs = BigInt(256), Ps = BigInt(113), it = [], at = [], ct = [];
820
- for (let e = 0, t = x, s = 1, n = 0; e < 24; e++) {
819
+ const Ts = BigInt(0), k = BigInt(1), Rs = BigInt(2), As = BigInt(7), vs = BigInt(256), Ps = BigInt(113), it = [], at = [], ct = [];
820
+ for (let e = 0, t = k, s = 1, n = 0; e < 24; e++) {
821
821
  [s, n] = [n, (2 * s + 3 * n) % 5], it.push(2 * (5 * n + s)), at.push((e + 1) * (e + 2) / 2 % 64);
822
822
  let r = Ts;
823
823
  for (let i = 0; i < 7; i++)
824
- t = (t << x ^ (t >> As) * Ps) % vs, t & Rs && (r ^= x << (x << /* @__PURE__ */ BigInt(i)) - x);
824
+ t = (t << k ^ (t >> As) * Ps) % vs, t & Rs && (r ^= k << (k << /* @__PURE__ */ BigInt(i)) - k);
825
825
  ct.push(r);
826
826
  }
827
- const ut = cs(ct, !0), Is = ut[0], Us = ut[1], Ie = (e, t, s) => s > 32 ? fs(e, t, s) : us(e, t, s), Ue = (e, t, s) => s > 32 ? hs(e, t, s) : ls(e, t, s);
828
- function Cs(e, t = 24) {
827
+ const ut = cs(ct, !0), Is = ut[0], Cs = ut[1], Ie = (e, t, s) => s > 32 ? fs(e, t, s) : us(e, t, s), Ce = (e, t, s) => s > 32 ? hs(e, t, s) : ls(e, t, s);
828
+ function Us(e, t = 24) {
829
829
  const s = new Uint32Array(10);
830
830
  for (let n = 24 - t; n < 24; n++) {
831
831
  for (let o = 0; o < 10; o++)
832
832
  s[o] = e[o] ^ e[o + 10] ^ e[o + 20] ^ e[o + 30] ^ e[o + 40];
833
833
  for (let o = 0; o < 10; o += 2) {
834
- const a = (o + 8) % 10, c = (o + 2) % 10, u = s[c], l = s[c + 1], w = Ie(u, l, 1) ^ s[a], d = Ue(u, l, 1) ^ s[a + 1];
835
- for (let y = 0; y < 50; y += 10)
836
- e[o + y] ^= w, e[o + y + 1] ^= d;
834
+ const a = (o + 8) % 10, c = (o + 2) % 10, u = s[c], l = s[c + 1], w = Ie(u, l, 1) ^ s[a], d = Ce(u, l, 1) ^ s[a + 1];
835
+ for (let m = 0; m < 50; m += 10)
836
+ e[o + m] ^= w, e[o + m + 1] ^= d;
837
837
  }
838
838
  let r = e[2], i = e[3];
839
839
  for (let o = 0; o < 24; o++) {
840
- const a = at[o], c = Ie(r, i, a), u = Ue(r, i, a), l = it[o];
840
+ const a = at[o], c = Ie(r, i, a), u = Ce(r, i, a), l = it[o];
841
841
  r = e[l], i = e[l + 1], e[l] = c, e[l + 1] = u;
842
842
  }
843
843
  for (let o = 0; o < 50; o += 10) {
@@ -846,7 +846,7 @@ function Cs(e, t = 24) {
846
846
  for (let a = 0; a < 10; a++)
847
847
  e[o + a] ^= ~s[(a + 2) % 10] & s[(a + 4) % 10];
848
848
  }
849
- e[0] ^= Is[n], e[1] ^= Us[n];
849
+ e[0] ^= Is[n], e[1] ^= Cs[n];
850
850
  }
851
851
  rt(s);
852
852
  }
@@ -861,10 +861,10 @@ class ce extends Es {
861
861
  return this._cloneInto();
862
862
  }
863
863
  keccak() {
864
- Pe(this.state32), Cs(this.state32, this.rounds), Pe(this.state32), this.posOut = 0, this.pos = 0;
864
+ Pe(this.state32), Us(this.state32, this.rounds), Pe(this.state32), this.posOut = 0, this.pos = 0;
865
865
  }
866
866
  update(t) {
867
- ve(this), t = ot(t), j(t);
867
+ ve(this), t = ot(t), L(t);
868
868
  const { blockLen: s, state: n } = this, r = t.length;
869
869
  for (let i = 0; i < r; ) {
870
870
  const o = Math.min(s - this.pos, r - i);
@@ -882,7 +882,7 @@ class ce extends Es {
882
882
  t[n] ^= s, (s & 128) !== 0 && n === r - 1 && this.keccak(), t[r - 1] ^= 128, this.keccak();
883
883
  }
884
884
  writeInto(t) {
885
- ve(this, !1), j(t), this.finish();
885
+ ve(this, !1), L(t), this.finish();
886
886
  const s = this.state, { blockLen: n } = this;
887
887
  for (let r = 0, i = t.length; r < i; ) {
888
888
  this.posOut >= n && this.keccak();
@@ -915,9 +915,9 @@ class ce extends Es {
915
915
  return t || (t = new ce(s, n, r, o, i)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = i, t.suffix = n, t.outputLen = r, t.enableXOF = o, t.destroyed = this.destroyed, t;
916
916
  }
917
917
  }
918
- const ks = (e, t, s) => Ss(() => new ce(t, e, s)), xs = ks(1, 136, 256 / 8);
918
+ const xs = (e, t, s) => Ss(() => new ce(t, e, s)), ks = xs(1, 136, 256 / 8);
919
919
  function Ds(e, t) {
920
- return xs(ie(e, { strict: !1 }) ? rs(e) : e);
920
+ return ks(ie(e, { strict: !1 }) ? rs(e) : e);
921
921
  }
922
922
  class Os extends v {
923
923
  constructor({ address: t }) {
@@ -1050,7 +1050,7 @@ const Bs = {
1050
1050
  decimals: 6,
1051
1051
  logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
1052
1052
  logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
1053
- }, Ce = {
1053
+ }, Ue = {
1054
1054
  ARBITRUM_MAINNET: {
1055
1055
  ...Fe,
1056
1056
  tokens: {
@@ -1125,44 +1125,44 @@ const Bs = {
1125
1125
  var ee = /* @__PURE__ */ ((e) => (e.ARBITRUM = "ARBITRUM_MAINNET", e.ARBITRUM_TESTNET = "ARBITRUM_TESTNET", e.AVALANCHE = "AVALANCHE_MAINNET", e.AVALANCHE_TESTNET = "AVALANCHE_TESTNET", e.BASE = "BASE_MAINNET", e.BASE_TESTNET = "BASE_TESTNET", e.BSC = "BSC_MAINNET", e.ETHEREUM = "ETHEREUM_MAINNET", e.ETHEREUM_TESTNET = "ETHEREUM_TESTNET", e.STARKNET = "STARKNET_MAINNET", e))(ee || {}), ht = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(ht || {});
1126
1126
  const Ws = (e) => {
1127
1127
  const t = e?.trim().toUpperCase();
1128
- if (Ce[t])
1129
- return Ce[t];
1128
+ if (Ue[t])
1129
+ return Ue[t];
1130
1130
  };
1131
1131
  function Vs(e, t) {
1132
1132
  return Ws(e)?.tokens[t]?.address;
1133
1133
  }
1134
1134
  var ue = /* @__PURE__ */ ((e) => (e.PRODUCTION = "production", e.STAGING = "staging", e))(ue || {});
1135
- class h {
1135
+ class p {
1136
1136
  constructor({ api_key: t, env: s, seesion_token: n }) {
1137
1137
  this.api_key = t || "", this.sessionToken = n || "", this.env = s ?? ue.PRODUCTION;
1138
1138
  }
1139
1139
  static async config(t) {
1140
- if (!h.app) {
1140
+ if (!p.app) {
1141
1141
  if (!t)
1142
1142
  throw new Error("Please provide an api_key");
1143
- h.app = new h(t);
1143
+ p.app = new p(t);
1144
1144
  }
1145
- return t && (t.api_key !== void 0 && (h.app.api_key = t.api_key), t.seesion_token !== void 0 && (h.app.sessionToken = t.seesion_token), t.env !== void 0 && (h.app.env = t.env)), h.app;
1145
+ return t && (t.api_key !== void 0 && (p.app.api_key = t.api_key), t.seesion_token !== void 0 && (p.app.sessionToken = t.seesion_token), t.env !== void 0 && (p.app.env = t.env)), p.app;
1146
1146
  }
1147
1147
  static getApiKey() {
1148
- if (!h.app)
1148
+ if (!p.app)
1149
1149
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
1150
- return h.app.api_key;
1150
+ return p.app.api_key;
1151
1151
  }
1152
1152
  static getSessionToken() {
1153
- if (!h.app)
1153
+ if (!p.app)
1154
1154
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
1155
- return h.app.sessionToken;
1155
+ return p.app.sessionToken;
1156
1156
  }
1157
1157
  static getEnv() {
1158
- if (!h.app)
1158
+ if (!p.app)
1159
1159
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
1160
- return h.app.env === "internal" ? "staging" : h.app.env;
1160
+ return p.app.env === "internal" ? "staging" : p.app.env;
1161
1161
  }
1162
1162
  static getBaseUrl() {
1163
- if (!h.app)
1163
+ if (!p.app)
1164
1164
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
1165
- switch (h.app.env) {
1165
+ switch (p.app.env) {
1166
1166
  case "production":
1167
1167
  return "https://api.chainrails.io/api/v1";
1168
1168
  case "staging":
@@ -1174,23 +1174,23 @@ class h {
1174
1174
  }
1175
1175
  }
1176
1176
  static getPayModalUrl(t) {
1177
- if (!h.app)
1177
+ if (!p.app)
1178
1178
  throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
1179
- const s = h.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", n = Number(t), r = t && !isNaN(Number(t)) && n > 0 ? "/pay/" : "/deposit/", i = `${t && !isNaN(Number(t)) && n > 0 ? n * 100 : ""}`;
1179
+ const s = p.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", n = Number(t), r = t && !isNaN(Number(t)) && n > 0 ? "/pay/" : "/deposit/", i = `${t && !isNaN(Number(t)) && n > 0 ? n * 100 : ""}`;
1180
1180
  return s + r + i;
1181
1181
  }
1182
1182
  }
1183
1183
  let te = null;
1184
1184
  function Ys() {
1185
1185
  te = Gt.create({
1186
- prefixUrl: h.getBaseUrl(),
1186
+ prefixUrl: p.getBaseUrl(),
1187
1187
  headers: {
1188
1188
  "Content-Type": "application/json"
1189
1189
  },
1190
1190
  hooks: {
1191
1191
  beforeRequest: [
1192
1192
  (e) => {
1193
- const t = h.getSessionToken() || h.getApiKey();
1193
+ const t = p.getSessionToken() || p.getApiKey();
1194
1194
  e.headers.set("Authorization", `Bearer ${t}`);
1195
1195
  }
1196
1196
  ],
@@ -1201,83 +1201,83 @@ function Ys() {
1201
1201
  }
1202
1202
  });
1203
1203
  }
1204
- function m() {
1204
+ function g() {
1205
1205
  return te || Ys(), te;
1206
1206
  }
1207
1207
  class Xs {
1208
1208
  async getById(t) {
1209
- return await m().get("intents/" + t).json();
1209
+ return await g().get("intents/" + t).json();
1210
1210
  }
1211
1211
  async getForSender(t) {
1212
- return await m().get("intents/user/" + t).json();
1212
+ return await g().get("intents/user/" + t).json();
1213
1213
  }
1214
1214
  async getForAddress(t) {
1215
- return await m().get("intents/address/" + t).json();
1215
+ return await g().get("intents/address/" + t).json();
1216
1216
  }
1217
1217
  async getForSession(t) {
1218
- return await m().get("modal/sessions/intents/" + t).json();
1218
+ return await g().get("modal/sessions/intents/" + t).json();
1219
1219
  }
1220
1220
  async getAll(t) {
1221
- return await m().get("intents", { searchParams: t }).json();
1221
+ return await g().get("intents", { searchParams: t }).json();
1222
1222
  }
1223
1223
  async create(t) {
1224
- return await m().post("intents", { json: t }).json();
1224
+ return await g().post("intents", { json: t }).json();
1225
1225
  }
1226
1226
  async createForSession(t) {
1227
- return await m().post("modal/sessions/intents", { json: t }).json();
1227
+ return await g().post("modal/sessions/intents", { json: t }).json();
1228
1228
  }
1229
1229
  async update(t, s) {
1230
- return await m().post("intents", { json: s }).json();
1230
+ return await g().post("intents", { json: s }).json();
1231
1231
  }
1232
1232
  async triggerProcessing(t) {
1233
- return await m().post(`intents/${t}/trigger-processing`).json();
1233
+ return await g().post(`intents/${t}/trigger-processing`).json();
1234
1234
  }
1235
1235
  async triggerProcessingForSession(t) {
1236
- return await m().post(`modal/sessions/intents/${t}/process`).json();
1236
+ return await g().post(`modal/sessions/intents/${t}/process`).json();
1237
1237
  }
1238
1238
  }
1239
1239
  class Js {
1240
1240
  async getFromSpecificBridge(t) {
1241
- return await m().get("quotes/single", { searchParams: t }).json();
1241
+ return await g().get("quotes/single", { searchParams: t }).json();
1242
1242
  }
1243
1243
  async getFromAllBridges(t) {
1244
- return await m().get("quotes/multiple", { searchParams: t }).json();
1244
+ return await g().get("quotes/multiple", { searchParams: t }).json();
1245
1245
  }
1246
1246
  async getBestAcrossBridges(t) {
1247
- return await m().get("quotes/best", { searchParams: t }).json();
1247
+ return await g().get("quotes/best", { searchParams: t }).json();
1248
1248
  }
1249
1249
  async getAll(t) {
1250
- return await m().get("quotes/multi-source", { searchParams: t }).json();
1250
+ return await g().get("quotes/multi-source", { searchParams: t }).json();
1251
1251
  }
1252
1252
  async getAllForSession(t) {
1253
- return await m().get("modal/sessions/quotes", { searchParams: t }).json();
1253
+ return await g().get("modal/sessions/quotes", { searchParams: t }).json();
1254
1254
  }
1255
1255
  }
1256
1256
  class Gs {
1257
1257
  async getOptimalRoutes(t) {
1258
- return await m().get("router/optimal-route", { searchParams: t }).json();
1258
+ return await g().get("router/optimal-route", { searchParams: t }).json();
1259
1259
  }
1260
1260
  async getAllSupportedBridges() {
1261
- return await m().get("router/supported-bridges/all").json();
1261
+ return await g().get("router/supported-bridges/all").json();
1262
1262
  }
1263
1263
  async getSupportedBridges(t) {
1264
- return await m().get("router/supported-bridges/route", { searchParams: t }).json();
1264
+ return await g().get("router/supported-bridges/route", { searchParams: t }).json();
1265
1265
  }
1266
1266
  async getSupportedRoutes(t, s) {
1267
- return await m().get("router/supported-bridges/bridge/" + t, { searchParams: s }).json();
1267
+ return await g().get("router/supported-bridges/bridge/" + t, { searchParams: s }).json();
1268
1268
  }
1269
1269
  }
1270
1270
  class Zs {
1271
1271
  async getSupported(t) {
1272
- return await m().get("chains", { searchParams: t }).json();
1272
+ return await g().get("chains", { searchParams: t }).json();
1273
1273
  }
1274
1274
  }
1275
1275
  class Qs {
1276
1276
  async getClientInfo() {
1277
- return await m().get("client/auth/client-info").json();
1277
+ return await g().get("client/auth/client-info").json();
1278
1278
  }
1279
1279
  async getClientInfoForSession() {
1280
- return await m().get("modal/sessions/client").json();
1280
+ return await g().get("modal/sessions/client").json();
1281
1281
  }
1282
1282
  }
1283
1283
  class en {
@@ -1291,7 +1291,7 @@ class en {
1291
1291
  destinationChain: ee[t.destinationChain?.replace("_MAINNET", "")],
1292
1292
  amount: t.amount
1293
1293
  };
1294
- return m().post("modal/sessions", { json: s }).json().then((n) => ({ ...n, amount: s.amount }));
1294
+ return g().post("modal/sessions", { json: s }).json().then((n) => ({ ...n, amount: s.amount }));
1295
1295
  }
1296
1296
  }
1297
1297
  const vn = {
@@ -1319,48 +1319,52 @@ function Pn(e) {
1319
1319
  const {
1320
1320
  amount: t,
1321
1321
  styles: s,
1322
- isOpen: n,
1323
- isPending: r,
1324
- open: i,
1325
- close: o,
1326
- onCancel: a,
1327
- onSuccess: c,
1328
- session_url: u,
1329
- sessionToken: l
1330
- } = e, [w, d] = U(0), [y, b] = U(""), P = re(null);
1331
- h.config({
1322
+ excludedChains: n,
1323
+ isOpen: r,
1324
+ isPending: i,
1325
+ open: o,
1326
+ close: a,
1327
+ onCancel: c,
1328
+ onSuccess: u,
1329
+ session_url: l,
1330
+ sessionToken: w
1331
+ } = e, [d, m] = C(0), [b, H] = C(""), f = re(null);
1332
+ p.config({
1332
1333
  api_key: "",
1333
1334
  // @ts-expect-error
1334
1335
  env: e.env === "internal" ? "internal" : "production"
1335
- }), k(() => {
1336
- b(h.getPayModalUrl(t));
1337
- }, [t]), k(() => {
1338
- const f = document.body.style.overflow;
1339
- n ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow = f || "";
1340
- const g = (E) => {
1341
- E.data === "closed" && (o(), a?.()), E.data === "completed" && (window.setTimeout(o, 2e3), c?.());
1336
+ }), x(() => {
1337
+ H(p.getPayModalUrl(t));
1338
+ }, [t]), x(() => {
1339
+ const h = document.body.style.overflow;
1340
+ r ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow = h || "";
1341
+ const E = (P) => {
1342
+ P.data === "closed" && (a(), c?.()), P.data === "completed" && (window.setTimeout(a, 2e3), u?.());
1342
1343
  };
1343
- return window.addEventListener("message", g), () => {
1344
- document.body.style.overflow = f || "", window.removeEventListener("message", g);
1344
+ return window.addEventListener("message", E), () => {
1345
+ document.body.style.overflow = h || "", window.removeEventListener("message", E);
1345
1346
  };
1346
- }, [n, a, c]), k(() => {
1347
- if (!l) return;
1348
- const f = {
1347
+ }, [r, c, u]), x(() => {
1348
+ if (!w) return;
1349
+ const h = {
1349
1350
  type: "session",
1350
- session_token: l,
1351
- environment: h.getEnv() || ue.PRODUCTION,
1352
- styles: s
1351
+ session_token: w,
1352
+ environment: p.getEnv() || ue.PRODUCTION,
1353
+ styles: s,
1354
+ props: {
1355
+ excludedChains: n?.join(",")
1356
+ }
1353
1357
  };
1354
- P.current?.contentWindow?.postMessage(f, "https://app.chainrails.io"), P.current?.contentWindow?.postMessage(f, "https://chainrails-frontend-git-staging-horus-labs.vercel.app"), window.setTimeout(() => {
1355
- P.current?.contentWindow?.postMessage(f, "https://app.chainrails.io"), P.current?.contentWindow?.postMessage(f, "https://chainrails-frontend-git-staging-horus-labs.vercel.app");
1358
+ f.current?.contentWindow?.postMessage(h, "https://app.chainrails.io"), f.current?.contentWindow?.postMessage(h, "https://chainrails-frontend-git-staging-horus-labs.vercel.app"), window.setTimeout(() => {
1359
+ f.current?.contentWindow?.postMessage(h, "https://app.chainrails.io"), f.current?.contentWindow?.postMessage(h, "https://chainrails-frontend-git-staging-horus-labs.vercel.app");
1356
1360
  }, 1e3);
1357
- }, [l, w, n, s]);
1358
- function p() {
1359
- d(Math.random());
1361
+ }, [w, d, r, s]);
1362
+ function y() {
1363
+ m(Math.random());
1360
1364
  }
1361
1365
  return /* @__PURE__ */ we("div", {
1362
- className: tn("payment-modal-wrapper", w === 0 || r ? "loading" : "not-loading", n ? "open" : "closed"),
1363
- children: [(w === 0 || r) && /* @__PURE__ */ B("div", {
1366
+ className: tn("payment-modal-wrapper", d === 0 || i ? "loading" : "not-loading", r ? "open" : "closed"),
1367
+ children: [(d === 0 || i) && /* @__PURE__ */ M("div", {
1364
1368
  role: "status",
1365
1369
  className: "payment-modal-loader",
1366
1370
  children: /* @__PURE__ */ we("svg", {
@@ -1369,27 +1373,27 @@ function Pn(e) {
1369
1373
  viewBox: "0 0 100 101",
1370
1374
  fill: "none",
1371
1375
  xmlns: "http://www.w3.org/2000/svg",
1372
- children: [/* @__PURE__ */ B("path", {
1376
+ children: [/* @__PURE__ */ M("path", {
1373
1377
  d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",
1374
1378
  fill: "currentColor"
1375
- }), /* @__PURE__ */ B("path", {
1379
+ }), /* @__PURE__ */ M("path", {
1376
1380
  d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
1377
1381
  fill: "currentFill"
1378
1382
  })]
1379
1383
  })
1380
- }), /* @__PURE__ */ B("iframe", {
1384
+ }), /* @__PURE__ */ M("iframe", {
1381
1385
  allow: "clipboard-read *; clipboard-write *",
1382
- src: y || void 0,
1383
- onLoad: p,
1384
- className: `payment-modal ${w === 0 || r ? "invisible" : "visible"}`,
1386
+ src: b || void 0,
1387
+ onLoad: y,
1388
+ className: `payment-modal ${d === 0 || i ? "invisible" : "visible"}`,
1385
1389
  "data-id": t,
1386
- ref: P
1390
+ ref: f
1387
1391
  }, t)]
1388
1392
  });
1389
1393
  }
1390
- const sn = Symbol(), le = Symbol(), D = "a", pt = "f", ke = "p", gt = "c", mt = "t", fe = "h", O = "w", he = "o", de = "k";
1394
+ const sn = Symbol(), le = Symbol(), D = "a", pt = "f", xe = "p", gt = "c", mt = "t", fe = "h", O = "w", he = "o", de = "k";
1391
1395
  let nn = (e, t) => new Proxy(e, t);
1392
- const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) => e && (ne.has(e) ? ne.get(e) : se(e) === Object.prototype || se(e) === Array.prototype), _ = (e) => typeof e == "object" && e !== null, rn = (e) => Object.values(Object.getOwnPropertyDescriptors(e)).some((t) => !t.configurable && !t.writable), on = (e) => {
1396
+ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) => e && (ne.has(e) ? ne.get(e) : se(e) === Object.prototype || se(e) === Array.prototype), j = (e) => typeof e == "object" && e !== null, rn = (e) => Object.values(Object.getOwnPropertyDescriptors(e)).some((t) => !t.configurable && !t.writable), on = (e) => {
1393
1397
  if (Array.isArray(e))
1394
1398
  return Array.from(e);
1395
1399
  const t = Object.getOwnPropertyDescriptors(e);
@@ -1442,14 +1446,14 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
1442
1446
  }
1443
1447
  const [i, o] = r;
1444
1448
  let a = s && s.get(i);
1445
- return (!a || a[1][pt] !== !!o) && (a = an(i, !!o), a[1][ke] = nn(o || i, a[0]), s && s.set(i, a)), a[1][D] = t, a[1][gt] = s, a[1][mt] = n, a[1][ke];
1449
+ return (!a || a[1][pt] !== !!o) && (a = an(i, !!o), a[1][xe] = nn(o || i, a[0]), s && s.set(i, a)), a[1][D] = t, a[1][gt] = s, a[1][mt] = n, a[1][xe];
1446
1450
  }, cn = (e, t) => {
1447
1451
  const s = Reflect.ownKeys(e), n = Reflect.ownKeys(t);
1448
1452
  return s.length !== n.length || s.some((r, i) => r !== n[i]);
1449
1453
  }, bt = (e, t, s, n, r = Object.is) => {
1450
1454
  if (r(e, t))
1451
1455
  return !1;
1452
- if (!_(e) || !_(t))
1456
+ if (!j(e) || !j(t))
1453
1457
  return !0;
1454
1458
  const i = s.get(pe(e));
1455
1459
  if (!i)
@@ -1478,26 +1482,26 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
1478
1482
  if (o === null)
1479
1483
  throw new Error("invalid used");
1480
1484
  return o;
1481
- }, un = (e) => yt(e) && e[le] || null, xe = (e, t = !0) => {
1485
+ }, un = (e) => yt(e) && e[le] || null, ke = (e, t = !0) => {
1482
1486
  ne.set(e, t);
1483
1487
  }, ln = (e, t, s) => {
1484
1488
  const n = [], r = /* @__PURE__ */ new WeakSet(), i = (o, a) => {
1485
1489
  var c, u, l;
1486
1490
  if (r.has(o))
1487
1491
  return;
1488
- _(o) && r.add(o);
1489
- const w = _(o) && t.get(pe(o));
1492
+ j(o) && r.add(o);
1493
+ const w = j(o) && t.get(pe(o));
1490
1494
  if (w) {
1491
1495
  if ((c = w[fe]) === null || c === void 0 || c.forEach((d) => {
1492
- const y = `:has(${String(d)})`;
1493
- n.push(a ? [...a, y] : [y]);
1496
+ const m = `:has(${String(d)})`;
1497
+ n.push(a ? [...a, m] : [m]);
1494
1498
  }), w[O] === !0) {
1495
1499
  const d = ":ownKeys";
1496
1500
  n.push(a ? [...a, d] : [d]);
1497
1501
  } else
1498
1502
  (u = w[he]) === null || u === void 0 || u.forEach((d) => {
1499
- const y = `:hasOwn(${String(d)})`;
1500
- n.push(a ? [...a, y] : [y]);
1503
+ const m = `:hasOwn(${String(d)})`;
1504
+ n.push(a ? [...a, m] : [m]);
1501
1505
  });
1502
1506
  (l = w[de]) === null || l === void 0 || l.forEach((d) => {
1503
1507
  "value" in (Object.getOwnPropertyDescriptor(o, d) || {}) && i(o[d], a ? [...a, d] : [d]);
@@ -1505,12 +1509,12 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
1505
1509
  } else a && n.push(a);
1506
1510
  };
1507
1511
  return i(e), n;
1508
- }, q = {}, ge = (e) => typeof e == "object" && e !== null, fn = (e) => ge(e) && !me.has(e) && (Array.isArray(e) || !(Symbol.iterator in e)) && !(e instanceof WeakMap) && !(e instanceof WeakSet) && !(e instanceof Error) && !(e instanceof Number) && !(e instanceof Date) && !(e instanceof String) && !(e instanceof RegExp) && !(e instanceof ArrayBuffer) && !(e instanceof Promise), Et = (e, t) => {
1512
+ }, _ = {}, ge = (e) => typeof e == "object" && e !== null, fn = (e) => ge(e) && !me.has(e) && (Array.isArray(e) || !(Symbol.iterator in e)) && !(e instanceof WeakMap) && !(e instanceof WeakSet) && !(e instanceof Error) && !(e instanceof Number) && !(e instanceof Date) && !(e instanceof String) && !(e instanceof RegExp) && !(e instanceof ArrayBuffer) && !(e instanceof Promise), Et = (e, t) => {
1509
1513
  const s = De.get(e);
1510
1514
  if (s?.[0] === t)
1511
1515
  return s[1];
1512
1516
  const n = Array.isArray(e) ? [] : Object.create(Object.getPrototypeOf(e));
1513
- return xe(n, !0), De.set(e, [t, n]), Reflect.ownKeys(e).forEach((r) => {
1517
+ return ke(n, !0), De.set(e, [t, n]), Reflect.ownKeys(e).forEach((r) => {
1514
1518
  if (Object.getOwnPropertyDescriptor(n, r))
1515
1519
  return;
1516
1520
  const i = Reflect.get(e, r), { enumerable: o } = Reflect.getOwnPropertyDescriptor(
@@ -1524,9 +1528,9 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
1524
1528
  configurable: !0
1525
1529
  };
1526
1530
  if (me.has(i))
1527
- xe(i, !1);
1528
- else if (C.has(i)) {
1529
- const [c, u] = C.get(
1531
+ ke(i, !1);
1532
+ else if (U.has(i)) {
1533
+ const [c, u] = U.get(
1530
1534
  i
1531
1535
  );
1532
1536
  a.value = Et(c, u());
@@ -1542,76 +1546,76 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
1542
1546
  },
1543
1547
  set(r, i, o, a) {
1544
1548
  const c = !e() && Reflect.has(r, i), u = Reflect.get(r, i, a);
1545
- if (c && (Oe(u, o) || F.has(o) && Oe(u, F.get(o))))
1549
+ if (c && (Oe(u, o) || q.has(o) && Oe(u, q.get(o))))
1546
1550
  return !0;
1547
1551
  s(i), ge(o) && (o = un(o) || o);
1548
- const l = !C.has(o) && pn(o) ? St(o) : o;
1552
+ const l = !U.has(o) && pn(o) ? St(o) : o;
1549
1553
  return t(i, l), Reflect.set(r, i, l, a), n(["set", [i], o, u]), !0;
1550
1554
  }
1551
- }), C = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakSet(), De = /* @__PURE__ */ new WeakMap(), J = [1], F = /* @__PURE__ */ new WeakMap();
1555
+ }), U = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakSet(), De = /* @__PURE__ */ new WeakMap(), J = [1], q = /* @__PURE__ */ new WeakMap();
1552
1556
  let Oe = Object.is, dn = (e, t) => new Proxy(e, t), pn = fn, gn = Et, mn = hn;
1553
1557
  function St(e = {}) {
1554
1558
  if (!ge(e))
1555
1559
  throw new Error("object required");
1556
- const t = F.get(e);
1560
+ const t = q.get(e);
1557
1561
  if (t)
1558
1562
  return t;
1559
1563
  let s = J[0];
1560
- const n = /* @__PURE__ */ new Set(), r = (p, f = ++J[0]) => {
1561
- s !== f && (i = s = f, n.forEach((g) => g(p, f)));
1564
+ const n = /* @__PURE__ */ new Set(), r = (f, y = ++J[0]) => {
1565
+ s !== y && (i = s = y, n.forEach((h) => h(f, y)));
1562
1566
  };
1563
1567
  let i = s;
1564
- const o = (p = J[0]) => (i !== p && (i = p, c.forEach(([f]) => {
1565
- const g = f[1](p);
1566
- g > s && (s = g);
1567
- })), s), a = (p) => (f, g) => {
1568
- const E = [...f];
1569
- E[1] = [p, ...E[1]], r(E, g);
1570
- }, c = /* @__PURE__ */ new Map(), u = (p, f) => {
1571
- const g = !me.has(f) && C.get(f);
1572
- if (g) {
1573
- if ((q ? "production" : void 0) !== "production" && c.has(p))
1568
+ const o = (f = J[0]) => (i !== f && (i = f, c.forEach(([y]) => {
1569
+ const h = y[1](f);
1570
+ h > s && (s = h);
1571
+ })), s), a = (f) => (y, h) => {
1572
+ const E = [...y];
1573
+ E[1] = [f, ...E[1]], r(E, h);
1574
+ }, c = /* @__PURE__ */ new Map(), u = (f, y) => {
1575
+ const h = !me.has(y) && U.get(y);
1576
+ if (h) {
1577
+ if ((_ ? "production" : void 0) !== "production" && c.has(f))
1574
1578
  throw new Error("prop listener already exists");
1575
1579
  if (n.size) {
1576
- const E = g[2](a(p));
1577
- c.set(p, [g, E]);
1580
+ const E = h[2](a(f));
1581
+ c.set(f, [h, E]);
1578
1582
  } else
1579
- c.set(p, [g]);
1583
+ c.set(f, [h]);
1580
1584
  }
1581
- }, l = (p) => {
1582
- var f;
1583
- const g = c.get(p);
1584
- g && (c.delete(p), (f = g[1]) == null || f.call(g));
1585
- }, w = (p) => (n.add(p), n.size === 1 && c.forEach(([g, E], M) => {
1586
- if ((q ? "production" : void 0) !== "production" && E)
1585
+ }, l = (f) => {
1586
+ var y;
1587
+ const h = c.get(f);
1588
+ h && (c.delete(f), (y = h[1]) == null || y.call(h));
1589
+ }, w = (f) => (n.add(f), n.size === 1 && c.forEach(([h, E], P) => {
1590
+ if ((_ ? "production" : void 0) !== "production" && E)
1587
1591
  throw new Error("remove already exists");
1588
- const Tt = g[2](a(M));
1589
- c.set(M, [g, Tt]);
1592
+ const Tt = h[2](a(P));
1593
+ c.set(P, [h, Tt]);
1590
1594
  }), () => {
1591
- n.delete(p), n.size === 0 && c.forEach(([g, E], M) => {
1592
- E && (E(), c.set(M, [g]));
1595
+ n.delete(f), n.size === 0 && c.forEach(([h, E], P) => {
1596
+ E && (E(), c.set(P, [h]));
1593
1597
  });
1594
1598
  });
1595
1599
  let d = !0;
1596
- const y = mn(
1600
+ const m = mn(
1597
1601
  () => d,
1598
1602
  u,
1599
1603
  l,
1600
1604
  r
1601
- ), b = dn(e, y);
1602
- F.set(e, b);
1603
- const P = [e, o, w];
1604
- return C.set(b, P), Reflect.ownKeys(e).forEach((p) => {
1605
- const f = Object.getOwnPropertyDescriptor(
1605
+ ), b = dn(e, m);
1606
+ q.set(e, b);
1607
+ const H = [e, o, w];
1608
+ return U.set(b, H), Reflect.ownKeys(e).forEach((f) => {
1609
+ const y = Object.getOwnPropertyDescriptor(
1606
1610
  e,
1607
- p
1611
+ f
1608
1612
  );
1609
- "value" in f && f.writable && (b[p] = e[p]);
1613
+ "value" in y && y.writable && (b[f] = e[f]);
1610
1614
  }), d = !1, b;
1611
1615
  }
1612
1616
  function yn(e, t, s) {
1613
- const n = C.get(e);
1614
- (q ? "production" : void 0) !== "production" && !n && console.warn("Please use proxy object");
1617
+ const n = U.get(e);
1618
+ (_ ? "production" : void 0) !== "production" && !n && console.warn("Please use proxy object");
1615
1619
  let r;
1616
1620
  const i = [], o = n[2];
1617
1621
  let a = !1;
@@ -1625,14 +1629,14 @@ function yn(e, t, s) {
1625
1629
  };
1626
1630
  }
1627
1631
  function Ne(e) {
1628
- const t = C.get(e);
1629
- (q ? "production" : void 0) !== "production" && !t && console.warn("Please use proxy object");
1632
+ const t = U.get(e);
1633
+ (_ ? "production" : void 0) !== "production" && !t && console.warn("Please use proxy object");
1630
1634
  const [s, n] = t;
1631
1635
  return gn(s, n());
1632
1636
  }
1633
1637
  const wn = {}, bn = (e, t) => {
1634
1638
  const s = re(void 0);
1635
- k(() => {
1639
+ x(() => {
1636
1640
  s.current = ln(e, t);
1637
1641
  }), Pt(s.current);
1638
1642
  }, En = bn, Sn = /* @__PURE__ */ new WeakMap();
@@ -1682,7 +1686,7 @@ function In({
1682
1686
  onCancel: t,
1683
1687
  onSuccess: s
1684
1688
  }) {
1685
- const n = Tn(A), [r, i] = U(!1), [o, a] = U(Date.now()), c = n?.data?.sessionToken, u = n?.data?.amount;
1689
+ const n = Tn(A), [r, i] = C(!1), [o, a] = C(Date.now()), c = n?.data?.sessionToken, u = n?.data?.amount;
1686
1690
  function l() {
1687
1691
  c || window.setTimeout(() => {
1688
1692
  c && i(!0);
@@ -1692,18 +1696,18 @@ function In({
1692
1696
  i(!1);
1693
1697
  }
1694
1698
  const d = () => {
1695
- const y = Date.now();
1699
+ const m = Date.now();
1696
1700
  A.isPending = !0, A.error = null, A.data = null, fetch(e, {
1697
1701
  headers: {
1698
1702
  "Content-Type": "application/json"
1699
1703
  }
1700
1704
  }).then((b) => b.json()).then((b) => {
1701
- y < o || (A.data = b, A.isPending = !1, a(y));
1705
+ m < o || (A.data = b, A.isPending = !1, a(m));
1702
1706
  }).catch((b) => {
1703
- y < o || (A.error = b?.toString(), A.isPending = !1, a(y), setInterval(d, 5e3));
1707
+ m < o || (A.error = b?.toString(), A.isPending = !1, a(m), setInterval(d, 5e3));
1704
1708
  });
1705
1709
  };
1706
- return k(() => {
1710
+ return x(() => {
1707
1711
  d();
1708
1712
  }, [e]), {
1709
1713
  sessionToken: c,
@@ -1719,20 +1723,20 @@ function In({
1719
1723
  onCancel: t
1720
1724
  };
1721
1725
  }
1722
- function Un({
1726
+ function Cn({
1723
1727
  sessionToken: e,
1724
1728
  amount: t,
1725
1729
  onCancel: s,
1726
1730
  onSuccess: n
1727
1731
  }) {
1728
- const [r, i] = U(!1), [o, a] = U(e), [c, u] = U(t);
1732
+ const [r, i] = C(!1), [o, a] = C(e), [c, u] = C(t);
1729
1733
  function l({
1730
- sessionToken: y,
1734
+ sessionToken: m,
1731
1735
  amount: b
1732
1736
  }) {
1733
- a(y), u(b);
1737
+ a(m), u(b);
1734
1738
  }
1735
- k(() => {
1739
+ x(() => {
1736
1740
  a(e);
1737
1741
  }, [e]);
1738
1742
  function w() {
@@ -1755,11 +1759,11 @@ function Un({
1755
1759
  };
1756
1760
  }
1757
1761
  export {
1758
- h as Chainrails,
1762
+ p as Chainrails,
1759
1763
  Pn as PaymentModal,
1760
1764
  ee as chains,
1761
1765
  vn as crapi,
1762
1766
  ht as tokens,
1763
- Un as usePaymentModal,
1767
+ Cn as usePaymentModal,
1764
1768
  In as usePaymentSession
1765
1769
  };