@nowramp/form 0.1.73 → 0.1.74

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
@@ -9,13 +9,13 @@
9
9
  document.head.appendChild(s);
10
10
  })();
11
11
  import { jsx as e, jsxs as o, Fragment as J } from "react/jsx-runtime";
12
- import ve, { useState as v, useRef as I, useCallback as B, useEffect as W, useMemo as Y, useReducer as ua, useContext as ma, createContext as fa } from "react";
12
+ import me, { useState as S, useRef as B, useCallback as O, useEffect as W, useMemo as Y, useReducer as ua, useContext as ma, createContext as fa } from "react";
13
13
  import { RampApi as Qe } from "@nowramp/sdk";
14
14
  import { createPortal as Ut } from "react-dom";
15
15
  function ha(t, a, n) {
16
- const [r, i] = v(null), [c, m] = v(!0), [s, u] = v(null), f = I(null);
16
+ const [r, l] = S(null), [c, m] = S(!0), [s, u] = S(null), f = B(null);
17
17
  (!f.current || f.current !== t) && (f.current = new Qe({ apiKey: "", ...t }));
18
- const h = B(async () => {
18
+ const h = O(async () => {
19
19
  if (!t.projectId) {
20
20
  u(new Error("projectId is required")), m(!1);
21
21
  return;
@@ -25,7 +25,7 @@ function ha(t, a, n) {
25
25
  const d = {};
26
26
  a && (d.orderType = a), n && (d.country = n);
27
27
  const p = await f.current.getSupported(d);
28
- i(p);
28
+ l(p);
29
29
  } catch (d) {
30
30
  u(d instanceof Error ? d : new Error("Failed to fetch config"));
31
31
  } finally {
@@ -37,67 +37,67 @@ function ha(t, a, n) {
37
37
  }, [h]), { config: r, loading: c, error: s, refetch: h };
38
38
  }
39
39
  function pa(t, a) {
40
- const [n, r] = v(null), [i, c] = v(!1), [m, s] = v(null), u = I(null), f = I(""), h = `${t.apiUrl}|${t.projectId}`;
40
+ const [n, r] = S(null), [l, c] = S(!1), [m, s] = S(null), u = B(null), f = B(""), h = `${t.apiUrl}|${t.projectId}`;
41
41
  (!u.current || f.current !== h) && (u.current = new Qe({ apiKey: "", ...t }), f.current = h);
42
- const d = I(0);
42
+ const d = B(0);
43
43
  W(() => {
44
- const g = ++d.current;
44
+ const C = ++d.current;
45
45
  if (!a || !t.projectId) {
46
46
  r(null), c(!1);
47
47
  return;
48
48
  }
49
49
  c(!0), s(null), u.current.getQuotes(a).then(
50
50
  (A) => {
51
- d.current === g && (r(A), c(!1));
51
+ d.current === C && (r(A), c(!1));
52
52
  },
53
53
  (A) => {
54
- d.current === g && (s(A instanceof Error ? A : new Error("Failed to fetch quotes")), r(null), c(!1));
54
+ d.current === C && (s(A instanceof Error ? A : new Error("Failed to fetch quotes")), r(null), c(!1));
55
55
  }
56
56
  );
57
57
  }, [t.projectId, a == null ? void 0 : a.fiatCurrency, a == null ? void 0 : a.fiatAmount, a == null ? void 0 : a.cryptoAmount, a == null ? void 0 : a.cryptoCurrency, a == null ? void 0 : a.network, a == null ? void 0 : a.paymentMethodId, a == null ? void 0 : a.country, a == null ? void 0 : a.orderType]);
58
- const p = B(async () => {
58
+ const p = O(async () => {
59
59
  if (!(!a || !t.projectId)) {
60
60
  c(!0), s(null);
61
61
  try {
62
- const g = await u.current.getQuotes(a);
63
- r(g);
64
- } catch (g) {
65
- s(g instanceof Error ? g : new Error("Failed to fetch quotes"));
62
+ const C = await u.current.getQuotes(a);
63
+ r(C);
64
+ } catch (C) {
65
+ s(C instanceof Error ? C : new Error("Failed to fetch quotes"));
66
66
  } finally {
67
67
  c(!1);
68
68
  }
69
69
  }
70
70
  }, [t.projectId, a]);
71
- return { quotes: n, loading: i, error: m, refetch: p };
71
+ return { quotes: n, loading: l, error: m, refetch: p };
72
72
  }
73
73
  function ya(t) {
74
- const [a, n] = v(null), [r, i] = v(!1), [c, m] = v(null), s = I(null), u = I(""), f = `${t.apiUrl}|${t.projectId}`;
74
+ const [a, n] = S(null), [r, l] = S(!1), [c, m] = S(null), s = B(null), u = B(""), f = `${t.apiUrl}|${t.projectId}`;
75
75
  (!s.current || u.current !== f) && (s.current = new Qe({ apiKey: "", ...t }), u.current = f);
76
- const h = B(async (p) => {
77
- i(!0), m(null);
76
+ const h = O(async (p) => {
77
+ l(!0), m(null);
78
78
  try {
79
- const g = await s.current.createCheckoutIntent(p);
80
- return n(g), g;
81
- } catch (g) {
82
- const A = g instanceof Error ? g : new Error("Failed to create checkout intent");
79
+ const C = await s.current.createCheckoutIntent(p);
80
+ return n(C), C;
81
+ } catch (C) {
82
+ const A = C instanceof Error ? C : new Error("Failed to create checkout intent");
83
83
  throw m(A), A;
84
84
  } finally {
85
- i(!1);
85
+ l(!1);
86
86
  }
87
- }, []), d = B(() => {
87
+ }, []), d = O(() => {
88
88
  n(null), m(null);
89
89
  }, []);
90
90
  return { order: a, loading: r, error: c, createOrder: h, reset: d };
91
91
  }
92
92
  function xa(t, a, n) {
93
- const [r, i] = v(null), [c, m] = v(!1), [s, u] = v(null), f = I(null);
93
+ const [r, l] = S(null), [c, m] = S(!1), [s, u] = S(null), f = B(null);
94
94
  f.current || (f.current = new Qe({ apiKey: "", projectId: "", ...t }));
95
- const h = B(async () => {
95
+ const h = O(async () => {
96
96
  if (a) {
97
97
  m(!0), u(null);
98
98
  try {
99
99
  const d = await f.current.getTransaction(a);
100
- i(d);
100
+ l(d);
101
101
  } catch (d) {
102
102
  u(d instanceof Error ? d : new Error("Failed to fetch status"));
103
103
  } finally {
@@ -409,7 +409,7 @@ function Ca({
409
409
  apiUrl: a = "https://api.nowramp.com",
410
410
  assetBaseUrl: n = "",
411
411
  flowType: r = "buy",
412
- customerId: i = "",
412
+ customerId: l = "",
413
413
  brandId: c,
414
414
  defaultFiatCurrency: m = "USD",
415
415
  defaultCryptoCurrency: s = "BTC",
@@ -418,199 +418,208 @@ function Ca({
418
418
  defaultCryptoAmount: h = "",
419
419
  defaultWalletAddress: d = "",
420
420
  defaultGateway: p,
421
- defaultCountry: g,
421
+ defaultCountry: C,
422
422
  fieldLocks: A,
423
- statusPollInterval: E = 5e3,
423
+ statusPollInterval: w = 5e3,
424
424
  onComplete: R,
425
425
  onError: P,
426
- children: ne
426
+ children: re
427
427
  }) {
428
- const V = Y(() => ({ apiUrl: a, projectId: t }), [a, t]), Z = u || (s ? s.toLowerCase() : ""), q = r === "sell", G = q ? !!h : !!f, y = (q ? !!(G && s && Z) : !!(G && s && Z && d)) && p ? "confirm" : "amount", L = f || (r === "buy" ? "250" : ""), [l, M] = ua(ga, {
428
+ const j = Y(() => ({ apiUrl: a, projectId: t }), [a, t]), Z = u || (s ? s.toLowerCase() : ""), q = r === "sell", $ = q ? !!h : !!f, x = (q ? !!($ && s && Z) : !!($ && s && Z && d)) && p ? "confirm" : "amount", k = f || (r === "buy" ? "250" : ""), [i, I] = ua(ga, {
429
429
  ...Vt,
430
- step: y,
430
+ step: x,
431
431
  flowType: r,
432
432
  fiatCurrency: m,
433
433
  cryptoCurrency: s,
434
434
  network: Z,
435
- fiatAmount: Dt(L, 2),
435
+ fiatAmount: Dt(k, 2),
436
436
  cryptoAmount: Dt(h, 6),
437
437
  walletAddress: d,
438
- customerId: i,
438
+ customerId: l,
439
439
  // If defaultCountry is provided, set it immediately with 'manual' source to skip auto-detection
440
- ...g ? { country: g.toLowerCase(), countrySource: "manual" } : {}
441
- }), w = l.flowType === "sell", {
442
- config: S,
443
- loading: he,
444
- error: pe
445
- } = ha(V, l.flowType, l.country || void 0), ye = I(!1);
446
- ve.useEffect(() => {
447
- var D;
448
- if (ye.current || !(S != null && S.detectedCountry) || l.country) return;
449
- ye.current = !0;
450
- const C = S.detectedCountry.toLowerCase();
451
- M({ type: "SET_COUNTRY_AUTO", country: C });
452
- const b = (D = S.fiats) == null ? void 0 : D.map((F) => F.code), U = ot(C, b);
453
- U !== l.fiatCurrency && M({ type: "SET_FIAT_CURRENCY", currency: U });
454
- }, [S, l.country, l.fiatCurrency]);
455
- const ie = I(!1);
456
- ve.useEffect(() => {
440
+ ...C ? { country: C.toLowerCase(), countrySource: "manual" } : {}
441
+ }), N = i.flowType === "sell", {
442
+ config: v,
443
+ loading: pe,
444
+ error: ye
445
+ } = ha(j, i.flowType, i.country || void 0), xe = B(!1);
446
+ me.useEffect(() => {
447
+ var L;
448
+ if (xe.current || !(v != null && v.detectedCountry) || i.country) return;
449
+ xe.current = !0;
450
+ const y = v.detectedCountry.toLowerCase();
451
+ I({ type: "SET_COUNTRY_AUTO", country: y });
452
+ const b = (L = v.fiats) == null ? void 0 : L.map((F) => F.code), U = ot(y, b);
453
+ U !== i.fiatCurrency && I({ type: "SET_FIAT_CURRENCY", currency: U });
454
+ }, [v, i.country, i.fiatCurrency]);
455
+ const le = B(!1);
456
+ me.useEffect(() => {
457
457
  var U;
458
- if (ie.current || !g || !((U = S == null ? void 0 : S.fiats) != null && U.length)) return;
459
- ie.current = !0;
460
- const C = S.fiats.map((D) => D.code), b = ot(g, C);
461
- b !== l.fiatCurrency && M({ type: "SET_FIAT_CURRENCY", currency: b });
462
- }, [g, S, l.fiatCurrency]);
463
- const se = I(l.country);
464
- ve.useEffect(() => {
458
+ if (le.current || !C || !((U = v == null ? void 0 : v.fiats) != null && U.length)) return;
459
+ le.current = !0;
460
+ const y = v.fiats.map((L) => L.code), b = ot(C, y);
461
+ b !== i.fiatCurrency && I({ type: "SET_FIAT_CURRENCY", currency: b });
462
+ }, [C, v, i.fiatCurrency]);
463
+ const de = B(i.country);
464
+ me.useEffect(() => {
465
465
  var U;
466
- if (l.country === se.current || (se.current = l.country, l.countrySource !== "manual") || !((U = S == null ? void 0 : S.fiats) != null && U.length)) return;
467
- const C = S.fiats.map((D) => D.code), b = ot(l.country, C);
468
- b !== l.fiatCurrency && M({ type: "SET_FIAT_CURRENCY", currency: b });
469
- }, [l.country, l.countrySource, S, l.fiatCurrency]), ve.useEffect(() => {
470
- var U, D, F;
471
- if (!S || !l.cryptoCurrency || l.network) return;
472
- const C = (U = S.cryptos) == null ? void 0 : U.find(($) => $.code === l.cryptoCurrency), b = ((D = C == null ? void 0 : C.networks) == null ? void 0 : D.find(($) => $.isDefault)) || ((F = C == null ? void 0 : C.networks) == null ? void 0 : F[0]);
473
- b != null && b.id && M({ type: "SET_NETWORK", network: b.id });
474
- }, [S, l.cryptoCurrency, l.network]), ve.useEffect(() => {
475
- var F, $;
476
- if (!((F = S == null ? void 0 : S.paymentMethods) != null && F.length)) return;
477
- const C = l.fiatCurrency, b = S.paymentMethods;
478
- if (l.paymentMethodId && b.some(
479
- (K) => K.id === l.paymentMethodId && K.supportedFiats.includes(C)
466
+ if (i.country === de.current || (de.current = i.country, i.countrySource !== "manual") || !((U = v == null ? void 0 : v.fiats) != null && U.length)) return;
467
+ const y = v.fiats.map((L) => L.code), b = ot(i.country, y);
468
+ b !== i.fiatCurrency && I({ type: "SET_FIAT_CURRENCY", currency: b });
469
+ }, [i.country, i.countrySource, v, i.fiatCurrency]);
470
+ const D = B(i.fiatCurrency);
471
+ me.useEffect(() => {
472
+ var L;
473
+ if (i.fiatCurrency === D.current || (D.current = i.fiatCurrency, N || !((L = v == null ? void 0 : v.fiats) != null && L.length) || !i.fiatAmount)) return;
474
+ const y = v.fiats.find((F) => F.code === i.fiatCurrency);
475
+ if (!(y != null && y.minAmount)) return;
476
+ const b = parseFloat(i.fiatAmount), U = parseFloat(y.minAmount);
477
+ !isNaN(b) && !isNaN(U) && b < U && I({ type: "SET_FIAT_AMOUNT", amount: String(Math.ceil(U)) });
478
+ }, [i.fiatCurrency, i.fiatAmount, v, N]), me.useEffect(() => {
479
+ var U, L, F;
480
+ if (!v || !i.cryptoCurrency || i.network) return;
481
+ const y = (U = v.cryptos) == null ? void 0 : U.find((K) => K.code === i.cryptoCurrency), b = ((L = y == null ? void 0 : y.networks) == null ? void 0 : L.find((K) => K.isDefault)) || ((F = y == null ? void 0 : y.networks) == null ? void 0 : F[0]);
482
+ b != null && b.id && I({ type: "SET_NETWORK", network: b.id });
483
+ }, [v, i.cryptoCurrency, i.network]), me.useEffect(() => {
484
+ var F, K;
485
+ if (!((F = v == null ? void 0 : v.paymentMethods) != null && F.length)) return;
486
+ const y = i.fiatCurrency, b = v.paymentMethods;
487
+ if (i.paymentMethodId && b.some(
488
+ (_) => _.id === i.paymentMethodId && _.supportedFiats.includes(y)
480
489
  ))
481
490
  return;
482
- const D = b.find(
483
- (Q) => Q.supportedFiats.includes(C) && (Q.id.includes("card") || Q.id.includes("debit"))
484
- ) || b.find((Q) => Q.supportedFiats.includes(C));
485
- M({ type: "SET_PAYMENT_METHOD", methodId: (D == null ? void 0 : D.id) || (($ = b[0]) == null ? void 0 : $.id) || "" });
486
- }, [S, l.fiatCurrency, l.paymentMethodId]);
487
- const k = Y(() => {
488
- if (w) {
489
- if (!l.cryptoAmount) return null;
490
- const F = parseFloat(l.cryptoAmount);
491
+ const L = b.find(
492
+ (M) => M.supportedFiats.includes(y) && (M.id.includes("card") || M.id.includes("debit"))
493
+ ) || b.find((M) => M.supportedFiats.includes(y));
494
+ I({ type: "SET_PAYMENT_METHOD", methodId: (L == null ? void 0 : L.id) || ((K = b[0]) == null ? void 0 : K.id) || "" });
495
+ }, [v, i.fiatCurrency, i.paymentMethodId]);
496
+ const ee = Y(() => {
497
+ if (N) {
498
+ if (!i.cryptoAmount) return null;
499
+ const F = parseFloat(i.cryptoAmount);
491
500
  return isNaN(F) || F <= 0 ? "Enter a valid amount" : null;
492
501
  }
493
- if (!S || !l.fiatAmount) return null;
494
- const C = parseFloat(l.fiatAmount);
495
- if (isNaN(C)) return null;
496
- const b = S.fiats.find((F) => F.code === l.fiatCurrency);
502
+ if (!v || !i.fiatAmount) return null;
503
+ const y = parseFloat(i.fiatAmount);
504
+ if (isNaN(y)) return null;
505
+ const b = v.fiats.find((F) => F.code === i.fiatCurrency);
497
506
  if (!b) return null;
498
- const U = parseFloat(b.minAmount), D = parseFloat(b.maxAmount);
499
- return !isNaN(U) && C < U ? `Minimum amount is ${b.minAmount} ${l.fiatCurrency}` : !isNaN(D) && C > D ? `Maximum amount is ${b.maxAmount} ${l.fiatCurrency}` : null;
500
- }, [S, l.fiatAmount, l.fiatCurrency, l.cryptoAmount, w]), be = Y(() => {
501
- const C = w ? !!l.cryptoAmount : !!l.fiatAmount;
502
- return !S || !C || !l.cryptoCurrency || !l.network || k ? null : {
503
- fiatCurrency: l.fiatCurrency,
504
- ...w ? { cryptoAmount: l.cryptoAmount } : { fiatAmount: l.fiatAmount },
505
- cryptoCurrency: l.cryptoCurrency,
506
- network: l.network,
507
- paymentMethodId: l.paymentMethodId || void 0,
508
- country: l.country || void 0,
509
- orderType: l.flowType
507
+ const U = parseFloat(b.minAmount), L = parseFloat(b.maxAmount);
508
+ return !isNaN(U) && y < U ? `Minimum amount is ${b.minAmount} ${i.fiatCurrency}` : !isNaN(L) && y > L ? `Maximum amount is ${b.maxAmount} ${i.fiatCurrency}` : null;
509
+ }, [v, i.fiatAmount, i.fiatCurrency, i.cryptoAmount, N]), X = Y(() => {
510
+ const y = N ? !!i.cryptoAmount : !!i.fiatAmount;
511
+ return !v || !y || !i.cryptoCurrency || !i.network || ee || v.detectedCountry && i.countrySource === "" && !C ? null : {
512
+ fiatCurrency: i.fiatCurrency,
513
+ ...N ? { cryptoAmount: i.cryptoAmount } : { fiatAmount: i.fiatAmount },
514
+ cryptoCurrency: i.cryptoCurrency,
515
+ network: i.network,
516
+ paymentMethodId: i.paymentMethodId || void 0,
517
+ country: i.country || void 0,
518
+ orderType: i.flowType
510
519
  };
511
- }, [S, l.fiatCurrency, l.fiatAmount, l.cryptoAmount, l.cryptoCurrency, l.network, l.paymentMethodId, l.country, k, w, l.flowType]), {
512
- quotes: j,
513
- loading: re,
520
+ }, [v, i.fiatCurrency, i.fiatAmount, i.cryptoAmount, i.cryptoCurrency, i.network, i.paymentMethodId, i.country, i.countrySource, ee, N, i.flowType, C]), {
521
+ quotes: Q,
522
+ loading: be,
514
523
  error: Ne,
515
- refetch: Ee
516
- } = pa(V, be), {
517
- order: de,
518
- loading: xe,
519
- error: O,
520
- createOrder: we
521
- } = ya(V), _e = 15e3, {
522
- status: ee,
523
- loading: Ve
524
+ refetch: Ue
525
+ } = pa(j, X), {
526
+ order: oe,
527
+ loading: G,
528
+ error: ge,
529
+ createOrder: De
530
+ } = ya(j), _e = 15e3, {
531
+ status: te,
532
+ loading: ze
524
533
  } = xa(
525
534
  { apiUrl: a },
526
- (de == null ? void 0 : de.orderId) ?? null,
527
- { pollInterval: E, initialDelay: _e }
535
+ (oe == null ? void 0 : oe.orderId) ?? null,
536
+ { pollInterval: w, initialDelay: _e }
528
537
  );
529
- ve.useEffect(() => {
530
- (ee == null ? void 0 : ee.status) === "completed" && R && R(ee);
531
- }, [ee == null ? void 0 : ee.status, R]), ve.useEffect(() => {
532
- const C = pe || O;
533
- C && P && P(C);
534
- }, [pe, O, P]);
535
- const Fe = p || (S == null ? void 0 : S.defaultGateway) || null, Me = I(Fe);
536
- Me.current = Fe;
537
- const Ae = I(j);
538
- Ae.current = j;
539
- const Re = I(c);
540
- Re.current = c;
541
- const ze = B(async () => {
542
- var b, U, D;
543
- const C = ((b = l.selectedQuote) == null ? void 0 : b.gatewayId) || ((D = (U = Ae.current) == null ? void 0 : U.bestQuote) == null ? void 0 : D.gatewayId) || Me.current;
544
- if (!C || !l.walletAddress) {
545
- const F = [!C && "gateway", !l.walletAddress && "walletAddress"].filter(Boolean).join(", ");
546
- M({ type: "SET_ERROR", message: `Missing required fields: ${F}` });
538
+ me.useEffect(() => {
539
+ (te == null ? void 0 : te.status) === "completed" && R && R(te);
540
+ }, [te == null ? void 0 : te.status, R]), me.useEffect(() => {
541
+ const y = ye || ge;
542
+ y && P && P(y);
543
+ }, [ye, ge, P]);
544
+ const Ee = p || (v == null ? void 0 : v.defaultGateway) || null, we = B(Ee);
545
+ we.current = Ee;
546
+ const Fe = B(Q);
547
+ Fe.current = Q;
548
+ const Me = B(c);
549
+ Me.current = c;
550
+ const Ce = O(async () => {
551
+ var b, U, L;
552
+ const y = ((b = i.selectedQuote) == null ? void 0 : b.gatewayId) || ((L = (U = Fe.current) == null ? void 0 : U.bestQuote) == null ? void 0 : L.gatewayId) || we.current;
553
+ if (!y || !i.walletAddress) {
554
+ const F = [!y && "gateway", !i.walletAddress && "walletAddress"].filter(Boolean).join(", ");
555
+ I({ type: "SET_ERROR", message: `Missing required fields: ${F}` });
547
556
  return;
548
557
  }
549
558
  try {
550
- await we({
551
- gateway: C,
552
- customerId: l.customerId || void 0,
553
- fiatCurrency: l.fiatCurrency,
554
- ...w ? { cryptoAmount: l.cryptoAmount } : { fiatAmount: l.fiatAmount },
555
- cryptoCurrency: l.cryptoCurrency,
556
- network: l.network,
557
- walletAddress: l.walletAddress,
558
- paymentMethodId: l.paymentMethodId || void 0,
559
- email: l.email || void 0,
560
- orderType: l.flowType,
561
- ...Re.current ? { metadata: { brand: Re.current } } : {}
562
- }), M({ type: "SET_STEP", step: "checkout" });
559
+ await De({
560
+ gateway: y,
561
+ customerId: i.customerId || void 0,
562
+ fiatCurrency: i.fiatCurrency,
563
+ ...N ? { cryptoAmount: i.cryptoAmount } : { fiatAmount: i.fiatAmount },
564
+ cryptoCurrency: i.cryptoCurrency,
565
+ network: i.network,
566
+ walletAddress: i.walletAddress,
567
+ paymentMethodId: i.paymentMethodId || void 0,
568
+ email: i.email || void 0,
569
+ orderType: i.flowType,
570
+ ...Me.current ? { metadata: { brand: Me.current } } : {}
571
+ }), I({ type: "SET_STEP", step: "checkout" });
563
572
  } catch (F) {
564
- const $ = F instanceof Error ? F.message : "Failed to create order";
565
- /wallet|address/i.test($) ? M({ type: "SET_WALLET_ERROR", message: $.replace(/^Failed to create checkout intent:\s*/i, "") }) : M({ type: "SET_ERROR", message: $ });
573
+ const K = F instanceof Error ? F.message : "Failed to create order";
574
+ /wallet|address/i.test(K) ? I({ type: "SET_WALLET_ERROR", message: K.replace(/^Failed to create checkout intent:\s*/i, "") }) : I({ type: "SET_ERROR", message: K });
566
575
  }
567
- }, [l, we, w]), ge = B((C) => {
568
- M({ type: "SET_STEP", step: C });
569
- }, []), Ie = B(() => {
570
- const C = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], b = C.indexOf(l.step);
571
- b > 0 && M({ type: "SET_STEP", step: C[b - 1] });
572
- }, [l.step, w]), Je = Y(() => {
573
- const C = w ? !!l.cryptoAmount : !!l.fiatAmount;
574
- switch (l.step) {
576
+ }, [i, De, N]), Ie = O((y) => {
577
+ I({ type: "SET_STEP", step: y });
578
+ }, []), Je = O(() => {
579
+ const y = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], b = y.indexOf(i.step);
580
+ b > 0 && I({ type: "SET_STEP", step: y[b - 1] });
581
+ }, [i.step, N]), qe = Y(() => {
582
+ const y = N ? !!i.cryptoAmount : !!i.fiatAmount;
583
+ switch (i.step) {
575
584
  case "confirm":
576
- return !!(C && l.cryptoCurrency && l.network && l.walletAddress && !k);
585
+ return !!(y && i.cryptoCurrency && i.network && i.walletAddress && !ee);
577
586
  case "amount":
578
- return !!(C && l.cryptoCurrency && l.network && !k);
587
+ return !!(y && i.cryptoCurrency && i.network && !ee);
579
588
  case "quotes":
580
- return !!l.selectedQuote;
589
+ return !!i.selectedQuote;
581
590
  case "wallet":
582
- return !!l.walletAddress;
591
+ return !!i.walletAddress;
583
592
  default:
584
593
  return !1;
585
594
  }
586
- }, [l, k, w]), qe = {
587
- apiConfig: V,
595
+ }, [i, ee, N]), Ve = {
596
+ apiConfig: j,
588
597
  assetBaseUrl: n,
589
- config: S,
590
- configLoading: he,
591
- configError: pe,
592
- state: l,
593
- dispatch: M,
594
- quotes: j,
595
- quotesLoading: re,
598
+ config: v,
599
+ configLoading: pe,
600
+ configError: ye,
601
+ state: i,
602
+ dispatch: I,
603
+ quotes: Q,
604
+ quotesLoading: be,
596
605
  quotesError: Ne,
597
- fetchQuotes: Ee,
598
- order: de,
599
- orderLoading: xe,
600
- orderError: O,
601
- createOrder: ze,
602
- orderStatus: ee,
603
- orderStatusLoading: Ve,
606
+ fetchQuotes: Ue,
607
+ order: oe,
608
+ orderLoading: G,
609
+ orderError: ge,
610
+ createOrder: Ce,
611
+ orderStatus: te,
612
+ orderStatusLoading: ze,
604
613
  fieldLocks: A || null,
605
- defaultGateway: Fe,
606
- amountError: k,
607
- goToStep: ge,
608
- goBack: Ie,
609
- canProceed: Je
614
+ defaultGateway: Ee,
615
+ amountError: ee,
616
+ goToStep: Ie,
617
+ goBack: Je,
618
+ canProceed: qe
610
619
  };
611
- return /* @__PURE__ */ e(jt.Provider, { value: qe, children: ne });
620
+ return /* @__PURE__ */ e(jt.Provider, { value: Ve, children: re });
612
621
  }
613
- function Ue() {
622
+ function ke() {
614
623
  const t = ma(jt);
615
624
  if (!t)
616
625
  throw new Error("useRamp must be used within a RampProvider");
@@ -1096,7 +1105,7 @@ function lt(t) {
1096
1105
  const a = t.toPrecision(4);
1097
1106
  return parseFloat(a).toString();
1098
1107
  }
1099
- const ce = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), Bt = 10, Ot = 1e-4, wa = (() => {
1108
+ const se = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), Bt = 10, Ot = 1e-4, wa = (() => {
1100
1109
  const t = [];
1101
1110
  for (const a of Gt)
1102
1111
  for (const n of a.chains)
@@ -1108,16 +1117,16 @@ function Wt({
1108
1117
  alt: a,
1109
1118
  size: n,
1110
1119
  className: r = "",
1111
- background: i
1120
+ background: l
1112
1121
  }) {
1113
- const [c, m] = v(!1), [s, u] = v(!1), f = I(t);
1122
+ const [c, m] = S(!1), [s, u] = S(!1), f = B(t);
1114
1123
  f.current !== t && (f.current = t, m(!1), u(!1));
1115
- const h = B(() => m(!0), []), d = B(() => u(!0), []);
1124
+ const h = O(() => m(!0), []), d = O(() => u(!0), []);
1116
1125
  return /* @__PURE__ */ o(
1117
1126
  "div",
1118
1127
  {
1119
1128
  className: `relative rounded-full shrink-0 ${r}`,
1120
- style: { width: n, height: n, background: i },
1129
+ style: { width: n, height: n, background: l },
1121
1130
  children: [
1122
1131
  !c && !s && /* @__PURE__ */ e(
1123
1132
  "div",
@@ -1281,7 +1290,7 @@ function Da({ size: t = 32 }) {
1281
1290
  );
1282
1291
  }
1283
1292
  function Fa({ size: t = 32 }) {
1284
- const a = t * 0.56, n = a * 0.65, r = Math.max(2, a * 0.1), i = a * 0.2;
1293
+ const a = t * 0.56, n = a * 0.65, r = Math.max(2, a * 0.1), l = a * 0.2;
1285
1294
  return /* @__PURE__ */ o("div", { className: "flex items-center justify-center shrink-0", style: { width: t, height: t }, children: [
1286
1295
  /* @__PURE__ */ e(
1287
1296
  "div",
@@ -1314,7 +1323,7 @@ function Fa({ size: t = 32 }) {
1314
1323
  height: n,
1315
1324
  background: "#252525",
1316
1325
  borderRadius: r,
1317
- marginLeft: -i,
1326
+ marginLeft: -l,
1318
1327
  position: "relative",
1319
1328
  zIndex: 1,
1320
1329
  display: "flex",
@@ -1425,11 +1434,11 @@ function Pa({
1425
1434
  onOpenModal: n,
1426
1435
  fiatCurrency: r
1427
1436
  }) {
1428
- const i = Y(
1437
+ const l = Y(
1429
1438
  () => t.filter((m) => m.supportedFiats.includes(r)),
1430
1439
  [t, r]
1431
- ), c = i.find((m) => m.id === a) || i[0];
1432
- return i.length === 0 ? /* @__PURE__ */ e(
1440
+ ), c = l.find((m) => m.id === a) || l[0];
1441
+ return l.length === 0 ? /* @__PURE__ */ e(
1433
1442
  "div",
1434
1443
  {
1435
1444
  className: "flex items-center justify-between px-[18px] pt-[12px] pb-[14px]",
@@ -1477,22 +1486,22 @@ function Ka({
1477
1486
  redirectDelay: n = 3e3
1478
1487
  }) {
1479
1488
  var p;
1480
- const { order: r, orderStatus: i, goToStep: c, goBack: m } = Ue(), [s, u] = v(!1), [f, h] = v(null), d = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
1489
+ const { order: r, orderStatus: l, goToStep: c, goBack: m } = ke(), [s, u] = S(!1), [f, h] = S(null), d = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
1481
1490
  if (W(() => {
1482
1491
  if ((r == null ? void 0 : r.checkout.method) === "redirect" && a && !d) {
1483
1492
  h(Math.ceil(n / 1e3));
1484
- const g = setTimeout(() => {
1493
+ const C = setTimeout(() => {
1485
1494
  window.location.href = r.checkout.url;
1486
1495
  }, n), A = setInterval(() => {
1487
- h((E) => E && E > 1 ? E - 1 : null);
1496
+ h((w) => w && w > 1 ? w - 1 : null);
1488
1497
  }, 1e3);
1489
1498
  return () => {
1490
- clearTimeout(g), clearInterval(A);
1499
+ clearTimeout(C), clearInterval(A);
1491
1500
  };
1492
1501
  }
1493
1502
  }, [r, a, n, d]), W(() => {
1494
- i && (i.status === "completed" ? c("complete") : ["failed", "cancelled", "expired"].includes(i.status) && c("error"));
1495
- }, [i == null ? void 0 : i.status, c]), !r)
1503
+ l && (l.status === "completed" ? c("complete") : ["failed", "cancelled", "expired"].includes(l.status) && c("error"));
1504
+ }, [l == null ? void 0 : l.status, c]), !r)
1496
1505
  return /* @__PURE__ */ o(
1497
1506
  "div",
1498
1507
  {
@@ -1546,7 +1555,7 @@ function Ka({
1546
1555
  }
1547
1556
  );
1548
1557
  if (r.checkout.method === "iframe") {
1549
- const g = r.checkout.url, A = ((p = r.checkout.allowedFeatures) == null ? void 0 : p.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share";
1558
+ const C = r.checkout.url, A = ((p = r.checkout.allowedFeatures) == null ? void 0 : p.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share";
1550
1559
  return Ut(
1551
1560
  /* @__PURE__ */ o(
1552
1561
  "div",
@@ -1618,7 +1627,7 @@ function Ka({
1618
1627
  /* @__PURE__ */ e(
1619
1628
  "iframe",
1620
1629
  {
1621
- src: g,
1630
+ src: C,
1622
1631
  style: {
1623
1632
  display: s ? "block" : "none",
1624
1633
  width: "100%",
@@ -1694,7 +1703,7 @@ function Ka({
1694
1703
  }
1695
1704
  );
1696
1705
  if (r.checkout.method === "widget" && r.widgetConfig) {
1697
- const g = _a(r.checkout.url, r.widgetConfig);
1706
+ const C = _a(r.checkout.url, r.widgetConfig);
1698
1707
  return Ut(
1699
1708
  /* @__PURE__ */ o(
1700
1709
  "div",
@@ -1766,7 +1775,7 @@ function Ka({
1766
1775
  /* @__PURE__ */ e(
1767
1776
  "iframe",
1768
1777
  {
1769
- src: g,
1778
+ src: C,
1770
1779
  style: {
1771
1780
  display: s ? "block" : "none",
1772
1781
  width: "100%",
@@ -1814,16 +1823,16 @@ function Ka({
1814
1823
  }
1815
1824
  function _a(t, a) {
1816
1825
  const n = new URL("/en/partner/widget", t);
1817
- for (const [r, i] of Object.entries(a))
1818
- i != null && i !== "" && n.searchParams.set(r, String(i));
1826
+ for (const [r, l] of Object.entries(a))
1827
+ l != null && l !== "" && n.searchParams.set(r, String(l));
1819
1828
  return n.toString();
1820
1829
  }
1821
1830
  function Va({ className: t = "" }) {
1822
- const { orderStatus: a, orderStatusLoading: n, goToStep: r } = Ue();
1831
+ const { orderStatus: a, orderStatusLoading: n, goToStep: r } = ke();
1823
1832
  W(() => {
1824
1833
  a && (a.status === "completed" ? r("complete") : ["failed", "cancelled", "expired", "refunded"].includes(a.status) && r("error"));
1825
1834
  }, [a == null ? void 0 : a.status, r]);
1826
- const i = () => {
1835
+ const l = () => {
1827
1836
  if (!a) return "Processing your order...";
1828
1837
  switch (a.status) {
1829
1838
  case "pending":
@@ -1836,28 +1845,28 @@ function Va({ className: t = "" }) {
1836
1845
  };
1837
1846
  return /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center px-8 py-12 text-center ${t}`, children: [
1838
1847
  /* @__PURE__ */ e("div", { className: "mb-6", children: /* @__PURE__ */ e("div", { className: "nramp-spinner-large nramp-spinner" }) }),
1839
- /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: i() }),
1848
+ /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: l() }),
1840
1849
  n && /* @__PURE__ */ e("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: "Checking status..." }),
1841
1850
  a && /* @__PURE__ */ o("div", { className: "w-full mt-6 text-left", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
1842
- /* @__PURE__ */ e(Le, { label: "Order ID", value: a.orderId, mono: !0 }),
1843
- /* @__PURE__ */ e(Le, { label: "Provider", value: a.gateway }),
1851
+ /* @__PURE__ */ e(Te, { label: "Order ID", value: a.orderId, mono: !0 }),
1852
+ /* @__PURE__ */ e(Te, { label: "Provider", value: a.gateway }),
1844
1853
  /* @__PURE__ */ e(
1845
- Le,
1854
+ Te,
1846
1855
  {
1847
1856
  label: "Amount",
1848
1857
  value: `${a.fiatAmount} ${a.fiatCurrency}`
1849
1858
  }
1850
1859
  ),
1851
1860
  /* @__PURE__ */ e(
1852
- Le,
1861
+ Te,
1853
1862
  {
1854
1863
  label: "Receiving",
1855
1864
  value: `${a.cryptoAmount || "..."} ${a.cryptoCurrency}`
1856
1865
  }
1857
1866
  ),
1858
- /* @__PURE__ */ e(Le, { label: "Network", value: a.network }),
1867
+ /* @__PURE__ */ e(Te, { label: "Network", value: a.network }),
1859
1868
  /* @__PURE__ */ e(
1860
- Le,
1869
+ Te,
1861
1870
  {
1862
1871
  label: "To Address",
1863
1872
  value: `${a.walletAddress.slice(0, 10)}...${a.walletAddress.slice(-8)}`,
@@ -1871,7 +1880,7 @@ function Va({ className: t = "" }) {
1871
1880
  ] })
1872
1881
  ] });
1873
1882
  }
1874
- function Le({ label: t, value: a, mono: n }) {
1883
+ function Te({ label: t, value: a, mono: n }) {
1875
1884
  return /* @__PURE__ */ o(
1876
1885
  "div",
1877
1886
  {
@@ -1897,8 +1906,8 @@ function ja({
1897
1906
  onDone: n,
1898
1907
  doneButtonText: r = "Done"
1899
1908
  }) {
1900
- const { orderStatus: i, state: c, dispatch: m } = Ue(), s = c.flowType === "sell", u = () => {
1901
- if (!(i != null && i.transactionHash)) return null;
1909
+ const { orderStatus: l, state: c, dispatch: m } = ke(), s = c.flowType === "sell", u = () => {
1910
+ if (!(l != null && l.transactionHash)) return null;
1902
1911
  if (!a) {
1903
1912
  const d = {
1904
1913
  ethereum: "https://etherscan.io/tx/{txHash}",
@@ -1911,9 +1920,9 @@ function ja({
1911
1920
  avalanche: "https://snowtrace.io/tx/{txHash}",
1912
1921
  fantom: "https://ftmscan.com/tx/{txHash}"
1913
1922
  };
1914
- return (d[c.network] || d.ethereum).replace("{txHash}", i.transactionHash);
1923
+ return (d[c.network] || d.ethereum).replace("{txHash}", l.transactionHash);
1915
1924
  }
1916
- return a.replace("{txHash}", i.transactionHash);
1925
+ return a.replace("{txHash}", l.transactionHash);
1917
1926
  }, f = () => {
1918
1927
  n ? n() : m({ type: "RESET" });
1919
1928
  }, h = u();
@@ -1927,47 +1936,47 @@ function ja({
1927
1936
  }
1928
1937
  ),
1929
1938
  /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: s ? "Sale Complete!" : "Purchase Complete!" }),
1930
- /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: s ? `Your ${(i == null ? void 0 : i.fiatCurrency) || c.fiatCurrency} payout is being processed.` : `Your ${(i == null ? void 0 : i.cryptoCurrency) || c.cryptoCurrency} has been sent to your wallet.` }),
1931
- i && /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
1939
+ /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: s ? `Your ${(l == null ? void 0 : l.fiatCurrency) || c.fiatCurrency} payout is being processed.` : `Your ${(l == null ? void 0 : l.cryptoCurrency) || c.cryptoCurrency} has been sent to your wallet.` }),
1940
+ l && /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
1932
1941
  /* @__PURE__ */ e(
1933
- me,
1942
+ fe,
1934
1943
  {
1935
1944
  label: s ? "Amount Sold" : "Amount Received",
1936
- value: `${i.cryptoAmount} ${i.cryptoCurrency}`,
1945
+ value: `${l.cryptoAmount} ${l.cryptoCurrency}`,
1937
1946
  highlight: !0
1938
1947
  }
1939
1948
  ),
1940
1949
  /* @__PURE__ */ e(
1941
- me,
1950
+ fe,
1942
1951
  {
1943
1952
  label: s ? "Payout Amount" : "Amount Paid",
1944
- value: `${i.fiatAmount} ${i.fiatCurrency}`
1953
+ value: `${l.fiatAmount} ${l.fiatCurrency}`
1945
1954
  }
1946
1955
  ),
1947
- /* @__PURE__ */ e(me, { label: "Network", value: i.network }),
1956
+ /* @__PURE__ */ e(fe, { label: "Network", value: l.network }),
1948
1957
  /* @__PURE__ */ e(
1949
- me,
1958
+ fe,
1950
1959
  {
1951
1960
  label: "Wallet",
1952
- value: `${i.walletAddress.slice(0, 10)}...${i.walletAddress.slice(-8)}`,
1961
+ value: `${l.walletAddress.slice(0, 10)}...${l.walletAddress.slice(-8)}`,
1953
1962
  mono: !0
1954
1963
  }
1955
1964
  ),
1956
- i.transactionHash && /* @__PURE__ */ e(
1957
- me,
1965
+ l.transactionHash && /* @__PURE__ */ e(
1966
+ fe,
1958
1967
  {
1959
1968
  label: "Transaction",
1960
- value: `${i.transactionHash.slice(0, 10)}...${i.transactionHash.slice(-8)}`,
1969
+ value: `${l.transactionHash.slice(0, 10)}...${l.transactionHash.slice(-8)}`,
1961
1970
  mono: !0
1962
1971
  }
1963
1972
  ),
1964
- /* @__PURE__ */ e(me, { label: "Provider", value: i.gateway }),
1965
- /* @__PURE__ */ e(me, { label: "Order ID", value: i.orderId, mono: !0 }),
1966
- i.completedAt && /* @__PURE__ */ e(
1967
- me,
1973
+ /* @__PURE__ */ e(fe, { label: "Provider", value: l.gateway }),
1974
+ /* @__PURE__ */ e(fe, { label: "Order ID", value: l.orderId, mono: !0 }),
1975
+ l.completedAt && /* @__PURE__ */ e(
1976
+ fe,
1968
1977
  {
1969
1978
  label: "Completed",
1970
- value: new Date(i.completedAt).toLocaleString()
1979
+ value: new Date(l.completedAt).toLocaleString()
1971
1980
  }
1972
1981
  )
1973
1982
  ] }),
@@ -1995,7 +2004,7 @@ function ja({
1995
2004
  ] })
1996
2005
  ] });
1997
2006
  }
1998
- function me({ label: t, value: a, mono: n, highlight: r }) {
2007
+ function fe({ label: t, value: a, mono: n, highlight: r }) {
1999
2008
  return /* @__PURE__ */ o(
2000
2009
  "div",
2001
2010
  {
@@ -2020,9 +2029,9 @@ function Ga({
2020
2029
  onRetry: a,
2021
2030
  supportEmail: n = "support@nowramp.com"
2022
2031
  }) {
2023
- const { state: r, orderStatus: i, dispatch: c, goToStep: m } = Ue(), s = r.flowType === "sell", u = () => {
2024
- if (i)
2025
- switch (i.status) {
2032
+ const { state: r, orderStatus: l, dispatch: c, goToStep: m } = ke(), s = r.flowType === "sell", u = () => {
2033
+ if (l)
2034
+ switch (l.status) {
2026
2035
  case "failed":
2027
2036
  return "Payment Failed";
2028
2037
  case "cancelled":
@@ -2037,8 +2046,8 @@ function Ga({
2037
2046
  return "Something Went Wrong";
2038
2047
  }, f = () => {
2039
2048
  if (r.errorMessage) return r.errorMessage;
2040
- if (i)
2041
- switch (i.status) {
2049
+ if (l)
2050
+ switch (l.status) {
2042
2051
  case "failed":
2043
2052
  return s ? "Your sale could not be processed. Please try again." : "Your payment could not be processed. Please try again or use a different payment method.";
2044
2053
  case "cancelled":
@@ -2067,9 +2076,9 @@ function Ga({
2067
2076
  ),
2068
2077
  /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: u() }),
2069
2078
  /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: f() }),
2070
- i && /* @__PURE__ */ e("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", children: [
2079
+ l && /* @__PURE__ */ e("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", children: [
2071
2080
  /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Order ID" }),
2072
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children: i.orderId })
2081
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children: l.orderId })
2073
2082
  ] }) }),
2074
2083
  /* @__PURE__ */ o("div", { className: "w-full flex flex-col gap-2", children: [
2075
2084
  /* @__PURE__ */ e(
@@ -2105,9 +2114,9 @@ function Ga({
2105
2114
  }
2106
2115
  )
2107
2116
  ] }),
2108
- i && /* @__PURE__ */ o("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: [
2117
+ l && /* @__PURE__ */ o("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: [
2109
2118
  "Reference: ",
2110
- i.orderId
2119
+ l.orderId
2111
2120
  ] })
2112
2121
  ] })
2113
2122
  ] });
@@ -2119,23 +2128,23 @@ function $a({ className: t = "", stablecoinParity: a, partnerName: n }) {
2119
2128
  var q;
2120
2129
  const {
2121
2130
  config: r,
2122
- configLoading: i,
2131
+ configLoading: l,
2123
2132
  state: c,
2124
2133
  defaultGateway: m,
2125
2134
  quotes: s,
2126
2135
  fetchQuotes: u,
2127
2136
  createOrder: f,
2128
2137
  orderLoading: h
2129
- } = Ue(), d = c.flowType === "sell", [p, g] = v(null), A = r == null ? void 0 : r.gateways.find((G) => G.id === m), E = (q = s == null ? void 0 : s.bestQuote) != null && q.exchangeRate ? parseFloat(s.bestQuote.exchangeRate) : null, R = parseFloat(c.fiatAmount) || 0, P = !!(a && n && !d && Xt(c.cryptoCurrency) && E), ne = P && c.cryptoCurrency.toUpperCase().includes(c.fiatCurrency.toUpperCase()), V = P && R > 0 ? lt(ne ? R : R / E) : null, Z = async () => {
2130
- g(null);
2138
+ } = ke(), d = c.flowType === "sell", [p, C] = S(null), A = r == null ? void 0 : r.gateways.find(($) => $.id === m), w = (q = s == null ? void 0 : s.bestQuote) != null && q.exchangeRate ? parseFloat(s.bestQuote.exchangeRate) : null, R = parseFloat(c.fiatAmount) || 0, P = !!(a && n && !d && Xt(c.cryptoCurrency) && w), re = P && c.cryptoCurrency.toUpperCase().includes(c.fiatCurrency.toUpperCase()), j = P && R > 0 ? lt(re ? R : R / w) : null, Z = async () => {
2139
+ C(null);
2131
2140
  try {
2132
2141
  u(), await f();
2133
- } catch (G) {
2134
- const fe = G instanceof Error ? G.message : "Failed to create order";
2135
- g(fe);
2142
+ } catch ($) {
2143
+ const he = $ instanceof Error ? $.message : "Failed to create order";
2144
+ C(he);
2136
2145
  }
2137
2146
  };
2138
- return i ? /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
2147
+ return l ? /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
2139
2148
  /* @__PURE__ */ e("div", { className: "nramp-spinner" }),
2140
2149
  /* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading..." })
2141
2150
  ] }) : /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 ${t}`, children: [
@@ -2157,13 +2166,13 @@ function $a({ className: t = "", stablecoinParity: a, partnerName: n }) {
2157
2166
  Se,
2158
2167
  {
2159
2168
  label: "You receive",
2160
- value: V ? `${V} ${c.cryptoCurrency}` : `${c.cryptoCurrency} on ${c.network}`
2169
+ value: j ? `${j} ${c.cryptoCurrency}` : `${c.cryptoCurrency} on ${c.network}`
2161
2170
  }
2162
2171
  ),
2163
2172
  /* @__PURE__ */ e(Se, { label: "Wallet", value: Kt(c.walletAddress), mono: !0 }),
2164
- P && V && /* @__PURE__ */ o("div", { className: "py-2 text-[11px]", style: { color: "var(--t-text-muted)", lineHeight: "15px" }, children: [
2173
+ P && j && /* @__PURE__ */ o("div", { className: "py-2 text-[11px]", style: { color: "var(--t-text-muted)", lineHeight: "15px" }, children: [
2165
2174
  "Charged amount from provider may differ. The rest up to ",
2166
- V,
2175
+ j,
2167
2176
  " ",
2168
2177
  c.cryptoCurrency,
2169
2178
  " will be credited to your ",
@@ -2208,17 +2217,17 @@ function He({
2208
2217
  onClose: a,
2209
2218
  children: n
2210
2219
  }) {
2211
- const [r, i] = v(!1), [c, m] = v(!1);
2220
+ const [r, l] = S(!1), [c, m] = S(!1);
2212
2221
  W(() => {
2213
2222
  if (t)
2214
- i(!0), requestAnimationFrame(() => requestAnimationFrame(() => m(!0)));
2223
+ l(!0), requestAnimationFrame(() => requestAnimationFrame(() => m(!0)));
2215
2224
  else if (r) {
2216
2225
  m(!1);
2217
- const u = setTimeout(() => i(!1), 250);
2226
+ const u = setTimeout(() => l(!1), 250);
2218
2227
  return () => clearTimeout(u);
2219
2228
  }
2220
2229
  }, [t]);
2221
- const s = B(() => {
2230
+ const s = O(() => {
2222
2231
  m(!1), setTimeout(() => a(), 250);
2223
2232
  }, [a]);
2224
2233
  return W(() => {
@@ -2245,7 +2254,7 @@ function He({
2245
2254
  }
2246
2255
  function Xa({ char: t, height: a = 38 }) {
2247
2256
  const n = "0123456789", r = n.indexOf(t);
2248
- return r === -1 ? /* @__PURE__ */ e("span", { children: t }) : /* @__PURE__ */ e("span", { className: "digit-slot", style: { height: a, lineHeight: `${a}px` }, children: /* @__PURE__ */ e("span", { className: "digit-slot-inner block", style: { transform: `translateY(-${r * a}px)` }, children: n.split("").map((i) => /* @__PURE__ */ e("span", { className: "block", style: { height: a, lineHeight: `${a}px` }, children: i }, i)) }) });
2257
+ return r === -1 ? /* @__PURE__ */ e("span", { children: t }) : /* @__PURE__ */ e("span", { className: "digit-slot", style: { height: a, lineHeight: `${a}px` }, children: /* @__PURE__ */ e("span", { className: "digit-slot-inner block", style: { transform: `translateY(-${r * a}px)` }, children: n.split("").map((l) => /* @__PURE__ */ e("span", { className: "block", style: { height: a, lineHeight: `${a}px` }, children: l }, l)) }) });
2249
2258
  }
2250
2259
  function Wa({
2251
2260
  value: t,
@@ -2253,9 +2262,9 @@ function Wa({
2253
2262
  className: n = "",
2254
2263
  style: r = {}
2255
2264
  }) {
2256
- return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", ...r }, children: t.split("").map((i, c) => /* @__PURE__ */ e(Xa, { char: i, height: a }, c)) });
2265
+ return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", ...r }, children: t.split("").map((l, c) => /* @__PURE__ */ e(Xa, { char: l, height: a }, c)) });
2257
2266
  }
2258
- function _({
2267
+ function V({
2259
2268
  w: t,
2260
2269
  h: a,
2261
2270
  className: n = ""
@@ -2265,33 +2274,33 @@ function _({
2265
2274
  function Ya() {
2266
2275
  return /* @__PURE__ */ o("div", { className: "flex-1 px-5 flex flex-col", children: [
2267
2276
  /* @__PURE__ */ o("div", { className: "px-[18px] pt-[14px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5 }, children: [
2268
- /* @__PURE__ */ e(_, { w: 70, h: 14, className: "mb-3" }),
2277
+ /* @__PURE__ */ e(V, { w: 70, h: 14, className: "mb-3" }),
2269
2278
  /* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
2270
- /* @__PURE__ */ e(_, { w: 120, h: 32 }),
2271
- /* @__PURE__ */ e(_, { w: 75, h: 32 })
2279
+ /* @__PURE__ */ e(V, { w: 120, h: 32 }),
2280
+ /* @__PURE__ */ e(V, { w: 75, h: 32 })
2272
2281
  ] })
2273
2282
  ] }),
2274
2283
  /* @__PURE__ */ o("div", { className: "px-[18px] pt-[12px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5, marginTop: 4 }, children: [
2275
- /* @__PURE__ */ e(_, { w: 50, h: 14, className: "mb-3" }),
2284
+ /* @__PURE__ */ e(V, { w: 50, h: 14, className: "mb-3" }),
2276
2285
  /* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
2277
- /* @__PURE__ */ e(_, { w: 180, h: 32 }),
2278
- /* @__PURE__ */ e(_, { w: 85, h: 32 })
2286
+ /* @__PURE__ */ e(V, { w: 180, h: 32 }),
2287
+ /* @__PURE__ */ e(V, { w: 85, h: 32 })
2279
2288
  ] })
2280
2289
  ] }),
2281
2290
  /* @__PURE__ */ o("div", { className: "flex justify-between mt-3 px-[2px]", children: [
2282
- /* @__PURE__ */ e(_, { w: 140, h: 12 }),
2283
- /* @__PURE__ */ e(_, { w: 90, h: 12 })
2291
+ /* @__PURE__ */ e(V, { w: 140, h: 12 }),
2292
+ /* @__PURE__ */ e(V, { w: 90, h: 12 })
2284
2293
  ] }),
2285
2294
  /* @__PURE__ */ o("div", { className: "mt-8", children: [
2286
- /* @__PURE__ */ e(_, { w: 65, h: 14, className: "mb-2.5" }),
2287
- /* @__PURE__ */ e(_, { w: "100%", h: 47 })
2295
+ /* @__PURE__ */ e(V, { w: 65, h: 14, className: "mb-2.5" }),
2296
+ /* @__PURE__ */ e(V, { w: "100%", h: 47 })
2288
2297
  ] }),
2289
2298
  /* @__PURE__ */ e("div", { className: "flex-1" }),
2290
- /* @__PURE__ */ e(_, { w: "100%", h: 60, className: "mb-2" }),
2299
+ /* @__PURE__ */ e(V, { w: "100%", h: 60, className: "mb-2" }),
2291
2300
  /* @__PURE__ */ e("div", { className: "text-center py-3", children: /* @__PURE__ */ e("span", { className: "text-[11px]", style: { color: "var(--t-text-tertiary)" }, children: "Powered by NowRamp" }) })
2292
2301
  ] });
2293
2302
  }
2294
- function De({ onClick: t }) {
2303
+ function Le({ onClick: t }) {
2295
2304
  return /* @__PURE__ */ e(
2296
2305
  "button",
2297
2306
  {
@@ -2309,7 +2318,7 @@ function Ke({
2309
2318
  onChange: a,
2310
2319
  placeholder: n = ""
2311
2320
  }) {
2312
- const [r, i] = v(!1);
2321
+ const [r, l] = S(!1);
2313
2322
  return /* @__PURE__ */ o("div", { className: "relative mx-5 mb-5", children: [
2314
2323
  /* @__PURE__ */ e(
2315
2324
  "input",
@@ -2317,8 +2326,8 @@ function Ke({
2317
2326
  type: "text",
2318
2327
  value: t,
2319
2328
  onChange: (c) => a(c.target.value),
2320
- onFocus: () => i(!0),
2321
- onBlur: () => i(!1),
2329
+ onFocus: () => l(!0),
2330
+ onBlur: () => l(!1),
2322
2331
  placeholder: n,
2323
2332
  style: { height: 47, borderRadius: 4.5, border: `1px solid ${r ? "var(--t-border-focus)" : "var(--t-border)"}`, outline: "none", boxShadow: "none", color: "var(--t-text)", padding: `0 ${t ? 40 : 14}px 0 14px`, fontSize: 14, backgroundColor: "transparent" },
2324
2333
  className: "w-full outline-none transition-colors"
@@ -2340,9 +2349,9 @@ function Za({
2340
2349
  onSelect: a,
2341
2350
  currencies: n,
2342
2351
  assetBaseUrl: r = "",
2343
- selectedCode: i
2352
+ selectedCode: l
2344
2353
  }) {
2345
- const [c, m] = v(""), s = Y(() => {
2354
+ const [c, m] = S(""), s = Y(() => {
2346
2355
  if (!n || n.length === 0) return Ft;
2347
2356
  const f = new Map(Ft.map((h) => [h.code, h.name]));
2348
2357
  return n.map((h) => ({
@@ -2352,10 +2361,10 @@ function Za({
2352
2361
  }, [n]), u = Y(() => {
2353
2362
  const f = c.trim().toLowerCase();
2354
2363
  if (!f) {
2355
- if (i) {
2356
- const h = s.find((d) => d.code === i);
2364
+ if (l) {
2365
+ const h = s.find((d) => d.code === l);
2357
2366
  if (h) {
2358
- const d = s.filter((p) => p.code !== i);
2367
+ const d = s.filter((p) => p.code !== l);
2359
2368
  return [h, ...d];
2360
2369
  }
2361
2370
  }
@@ -2364,9 +2373,9 @@ function Za({
2364
2373
  return s.filter(
2365
2374
  (h) => h.code.toLowerCase().includes(f) || h.name.toLowerCase().includes(f)
2366
2375
  );
2367
- }, [s, c, i]);
2376
+ }, [s, c, l]);
2368
2377
  return /* @__PURE__ */ o(J, { children: [
2369
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
2378
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Le, { onClick: t }) }),
2370
2379
  /* @__PURE__ */ e(
2371
2380
  "h2",
2372
2381
  {
@@ -2384,7 +2393,7 @@ function Za({
2384
2393
  /* @__PURE__ */ e(Ke, { value: c, onChange: m }),
2385
2394
  /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2386
2395
  u.map((f, h) => {
2387
- const d = f.name !== f.code ? f.name : "", p = i === f.code;
2396
+ const d = f.name !== f.code ? f.name : "", p = l === f.code;
2388
2397
  return /* @__PURE__ */ o("div", { children: [
2389
2398
  /* @__PURE__ */ o(
2390
2399
  "button",
@@ -2423,11 +2432,11 @@ function Za({
2423
2432
  ] })
2424
2433
  ] });
2425
2434
  }
2426
- function _t({ src: t, alt: a, size: n, className: r, style: i }) {
2427
- const [c, m] = v(!1), [s, u] = v(!1), f = I(t);
2435
+ function _t({ src: t, alt: a, size: n, className: r, style: l }) {
2436
+ const [c, m] = S(!1), [s, u] = S(!1), f = B(t);
2428
2437
  f.current !== t && (f.current = t, m(!1), u(!1));
2429
- const h = B(() => m(!0), []), d = B(() => u(!0), []);
2430
- return /* @__PURE__ */ o("div", { className: r, style: { ...i, width: n, height: n, position: "relative" }, children: [
2438
+ const h = O(() => m(!0), []), d = O(() => u(!0), []);
2439
+ return /* @__PURE__ */ o("div", { className: r, style: { ...l, width: n, height: n, position: "relative" }, children: [
2431
2440
  !c && !s && /* @__PURE__ */ e(
2432
2441
  "div",
2433
2442
  {
@@ -2457,51 +2466,51 @@ function _t({ src: t, alt: a, size: n, className: r, style: i }) {
2457
2466
  )
2458
2467
  ] });
2459
2468
  }
2460
- function Qa({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selectedCode: i, selectedChain: c }) {
2461
- const [m, s] = v(""), u = Y(() => {
2469
+ function Qa({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selectedCode: l, selectedChain: c }) {
2470
+ const [m, s] = S(""), u = Y(() => {
2462
2471
  if (!n || n.length === 0) return wa;
2463
2472
  const d = [];
2464
2473
  for (const p of n) {
2465
- const g = p.networks || [], A = p.name || va[p.code] || p.code;
2466
- if (g.length === 0)
2474
+ const C = p.networks || [], A = p.name || va[p.code] || p.code;
2475
+ if (C.length === 0)
2467
2476
  d.push({ code: p.code, name: A, chain: p.code, popular: !1 });
2468
2477
  else
2469
- for (const E of g) {
2470
- const R = E.code || E.id || E.name || p.code;
2478
+ for (const w of C) {
2479
+ const R = w.code || w.id || w.name || p.code;
2471
2480
  d.push({
2472
2481
  code: p.code,
2473
2482
  name: A,
2474
2483
  chain: R,
2475
- chainName: E.name,
2484
+ chainName: w.name,
2476
2485
  popular: !1
2477
2486
  });
2478
2487
  }
2479
2488
  }
2480
2489
  return d;
2481
- }, [n]), f = B((d, p) => i === d && c === p, [i, c]), h = Y(() => {
2490
+ }, [n]), f = O((d, p) => l === d && c === p, [l, c]), h = Y(() => {
2482
2491
  var A;
2483
2492
  const d = m.trim().toLowerCase();
2484
2493
  if (!d) {
2485
- if (i && c) {
2486
- const E = u.find((R) => R.code === i && R.chain === c);
2487
- if (E) {
2488
- const R = u.filter((P) => !(P.code === i && P.chain === c));
2489
- return [E, ...R];
2494
+ if (l && c) {
2495
+ const w = u.find((R) => R.code === l && R.chain === c);
2496
+ if (w) {
2497
+ const R = u.filter((P) => !(P.code === l && P.chain === c));
2498
+ return [w, ...R];
2490
2499
  }
2491
2500
  }
2492
2501
  return u;
2493
2502
  }
2494
- const p = d.split(/\s+/), g = [];
2495
- for (const E of u) {
2496
- const R = Ze(E.chain), P = R ? R.name.toLowerCase() : "", ne = ((A = R == null ? void 0 : R.shortName) == null ? void 0 : A.toLowerCase()) || "", V = E.chain.toLowerCase(), Z = E.code.toLowerCase(), q = E.name.toLowerCase(), G = [Z, q, P, ne, V];
2497
- if (!p.every((L) => G.some((l) => l.includes(L)))) continue;
2498
- let y = 0;
2499
- Z === d ? y += 100 : Z.startsWith(p[0]) && (y += 50), E.popular && (y += 10), p.length > 1 && (P.includes(p[1]) || ne.includes(p[1]) || V.includes(p[1])) && (y += 25), g.push({ item: E, score: y });
2503
+ const p = d.split(/\s+/), C = [];
2504
+ for (const w of u) {
2505
+ const R = Ze(w.chain), P = R ? R.name.toLowerCase() : "", re = ((A = R == null ? void 0 : R.shortName) == null ? void 0 : A.toLowerCase()) || "", j = w.chain.toLowerCase(), Z = w.code.toLowerCase(), q = w.name.toLowerCase(), $ = [Z, q, P, re, j];
2506
+ if (!p.every((k) => $.some((i) => i.includes(k)))) continue;
2507
+ let x = 0;
2508
+ Z === d ? x += 100 : Z.startsWith(p[0]) && (x += 50), w.popular && (x += 10), p.length > 1 && (P.includes(p[1]) || re.includes(p[1]) || j.includes(p[1])) && (x += 25), C.push({ item: w, score: x });
2500
2509
  }
2501
- return g.sort((E, R) => R.score - E.score), g.map((E) => E.item);
2502
- }, [u, m, i, c]);
2510
+ return C.sort((w, R) => R.score - w.score), C.map((w) => w.item);
2511
+ }, [u, m, l, c]);
2503
2512
  return /* @__PURE__ */ o(J, { children: [
2504
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
2513
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Le, { onClick: t }) }),
2505
2514
  /* @__PURE__ */ e(
2506
2515
  "h2",
2507
2516
  {
@@ -2513,7 +2522,7 @@ function Qa({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
2513
2522
  /* @__PURE__ */ e(Ke, { value: m, onChange: s }),
2514
2523
  /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2515
2524
  h.map((d, p) => {
2516
- const g = Ze(d.chain), A = (g == null ? void 0 : g.name) || d.chainName || d.chain, E = d.name !== d.code ? d.name : "", R = f(d.code, d.chain);
2525
+ const C = Ze(d.chain), A = (C == null ? void 0 : C.name) || d.chainName || d.chain, w = d.name !== d.code ? d.name : "", R = f(d.code, d.chain);
2517
2526
  return /* @__PURE__ */ o("div", { children: [
2518
2527
  /* @__PURE__ */ o(
2519
2528
  "button",
@@ -2569,12 +2578,12 @@ function Qa({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
2569
2578
  children: d.code
2570
2579
  }
2571
2580
  ),
2572
- E && /* @__PURE__ */ e(
2581
+ w && /* @__PURE__ */ e(
2573
2582
  "span",
2574
2583
  {
2575
2584
  className: "text-[13px]",
2576
2585
  style: { color: "var(--t-text-secondary)" },
2577
- children: E
2586
+ children: w
2578
2587
  }
2579
2588
  )
2580
2589
  ] }) }),
@@ -2607,8 +2616,8 @@ function za({
2607
2616
  onSelect: n,
2608
2617
  onClose: r
2609
2618
  }) {
2610
- const [i, c] = v(""), m = Y(() => {
2611
- const s = i.trim().toLowerCase();
2619
+ const [l, c] = S(""), m = Y(() => {
2620
+ const s = l.trim().toLowerCase();
2612
2621
  if (!s) {
2613
2622
  if (a) {
2614
2623
  const u = t.find((f) => f.id === a);
@@ -2622,9 +2631,9 @@ function za({
2622
2631
  return t.filter(
2623
2632
  (u) => u.id.toLowerCase().includes(s) || u.name.toLowerCase().includes(s) || u.description && u.description.toLowerCase().includes(s)
2624
2633
  );
2625
- }, [t, i, a]);
2634
+ }, [t, l, a]);
2626
2635
  return /* @__PURE__ */ o(J, { children: [
2627
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: r }) }),
2636
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Le, { onClick: r }) }),
2628
2637
  /* @__PURE__ */ e(
2629
2638
  "h2",
2630
2639
  {
@@ -2633,7 +2642,7 @@ function za({
2633
2642
  children: "Choose payment method"
2634
2643
  }
2635
2644
  ),
2636
- /* @__PURE__ */ e(Ke, { value: i, onChange: c }),
2645
+ /* @__PURE__ */ e(Ke, { value: l, onChange: c }),
2637
2646
  /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2638
2647
  m.map((s, u) => {
2639
2648
  const f = s.id === a, h = Yt(s.id, s.name);
@@ -2730,16 +2739,16 @@ function en({
2730
2739
  darkMode: a,
2731
2740
  onToggleDarkMode: n,
2732
2741
  skinId: r,
2733
- onSelectSkin: i,
2742
+ onSelectSkin: l,
2734
2743
  showThemeToggle: c = !0,
2735
2744
  country: m,
2736
2745
  countryName: s,
2737
2746
  onLocationPress: u,
2738
2747
  assetBaseUrl: f = ""
2739
2748
  }) {
2740
- const [h, d] = v(!1);
2749
+ const [h, d] = S(!1);
2741
2750
  return /* @__PURE__ */ o(J, { children: [
2742
- /* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
2751
+ /* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(Le, { onClick: t }) }),
2743
2752
  /* @__PURE__ */ o("div", { className: "px-5 flex-1 pt-6 overflow-y-auto custom-scroll", children: [
2744
2753
  u && /* @__PURE__ */ o(J, { children: [
2745
2754
  /* @__PURE__ */ e("div", { style: { borderTop: "1px solid var(--t-divider)" }, children: /* @__PURE__ */ o(
@@ -2844,8 +2853,8 @@ function an({
2844
2853
  assetBaseUrl: n = "",
2845
2854
  selectedCode: r
2846
2855
  }) {
2847
- const [i, c] = v(""), m = Y(() => {
2848
- const s = i.trim().toLowerCase();
2856
+ const [l, c] = S(""), m = Y(() => {
2857
+ const s = l.trim().toLowerCase();
2849
2858
  if (!s) {
2850
2859
  if (r) {
2851
2860
  const u = r.toLowerCase(), f = st[u];
@@ -2859,9 +2868,9 @@ function an({
2859
2868
  return Ye.filter(
2860
2869
  (u) => u.name.toLowerCase().includes(s) || u.code.includes(s) || u.defaultFiat.toLowerCase().includes(s)
2861
2870
  );
2862
- }, [i, r]);
2871
+ }, [l, r]);
2863
2872
  return /* @__PURE__ */ o(J, { children: [
2864
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
2873
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Le, { onClick: t }) }),
2865
2874
  /* @__PURE__ */ e(
2866
2875
  "h2",
2867
2876
  {
@@ -2876,7 +2885,7 @@ function an({
2876
2885
  children: "Select your country"
2877
2886
  }
2878
2887
  ),
2879
- /* @__PURE__ */ e(Ke, { value: i, onChange: c }),
2888
+ /* @__PURE__ */ e(Ke, { value: l, onChange: c }),
2880
2889
  /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
2881
2890
  m.map((s, u) => {
2882
2891
  const f = (r == null ? void 0 : r.toLowerCase()) === s.code;
@@ -2919,7 +2928,7 @@ function an({
2919
2928
  ] });
2920
2929
  }
2921
2930
  function nn({ code: t, size: a = 32, baseUrl: n = "" }) {
2922
- const [r, i] = v(!1);
2931
+ const [r, l] = S(!1);
2923
2932
  return r ? /* @__PURE__ */ e(
2924
2933
  "div",
2925
2934
  {
@@ -2944,7 +2953,7 @@ function nn({ code: t, size: a = 32, baseUrl: n = "" }) {
2944
2953
  width: a,
2945
2954
  height: a,
2946
2955
  style: { width: a, height: a, borderRadius: "50%", objectFit: "cover" },
2947
- onError: () => i(!0)
2956
+ onError: () => l(!0)
2948
2957
  }
2949
2958
  );
2950
2959
  }
@@ -2953,7 +2962,7 @@ function rn({
2953
2962
  theme: a = "dark",
2954
2963
  skinId: n = "mono",
2955
2964
  accentColor: r,
2956
- bgColor: i,
2965
+ bgColor: l,
2957
2966
  bgImage: c,
2958
2967
  borderColor: m,
2959
2968
  borderRadius: s,
@@ -2962,159 +2971,159 @@ function rn({
2962
2971
  textColor: h,
2963
2972
  textSecondaryColor: d,
2964
2973
  textMutedColor: p,
2965
- successColor: g,
2974
+ successColor: C,
2966
2975
  showFlowToggle: A = !0,
2967
- showSettings: E = !0,
2976
+ showSettings: w = !0,
2968
2977
  showThemeToggle: R = !0,
2969
2978
  autoRedirect: P = !1,
2970
- explorerUrl: ne,
2971
- doneButtonText: V = "Done",
2979
+ explorerUrl: re,
2980
+ doneButtonText: j = "Done",
2972
2981
  supportEmail: Z,
2973
2982
  stablecoinParity: q,
2974
- partnerName: G,
2975
- onDone: fe
2983
+ partnerName: $,
2984
+ onDone: he
2976
2985
  }) {
2977
2986
  var bt, Nt, Et, wt, At, Rt, Tt, kt, Lt;
2978
2987
  const {
2979
- state: y,
2980
- dispatch: L,
2981
- config: l,
2982
- configLoading: M,
2983
- quotes: w,
2984
- quotesLoading: S,
2985
- quotesError: he,
2986
- fetchQuotes: pe,
2987
- createOrder: ye,
2988
- orderLoading: ie,
2989
- amountError: se,
2990
- fieldLocks: k,
2991
- apiConfig: be,
2992
- assetBaseUrl: j
2993
- } = Ue(), [re, Ne] = v(a === "dark"), [Ee, de] = v(n), [xe, O] = v(null), [we, _e] = v(!1), [ee, Ve] = v(!1), [Fe, Me] = v(!1), [Ae, Re] = v(!1), [ze, ge] = v(null), [Ie, Je] = v(!0), [qe, C] = v(!1), [b, U] = v(!1), D = I(null), F = I(), $ = I(y.flowType);
2988
+ state: x,
2989
+ dispatch: k,
2990
+ config: i,
2991
+ configLoading: I,
2992
+ quotes: N,
2993
+ quotesLoading: v,
2994
+ quotesError: pe,
2995
+ fetchQuotes: ye,
2996
+ createOrder: xe,
2997
+ orderLoading: le,
2998
+ amountError: de,
2999
+ fieldLocks: D,
3000
+ apiConfig: ee,
3001
+ assetBaseUrl: X
3002
+ } = ke(), [Q, be] = S(a === "dark"), [Ne, Ue] = S(n), [oe, G] = S(null), [ge, De] = S(!1), [_e, te] = S(!1), [ze, Ee] = S(!1), [we, Fe] = S(!1), [Me, Ce] = S(null), [Ie, Je] = S(!0), [qe, Ve] = S(!1), [y, b] = S(!1), U = B(null), L = B(), F = B(x.flowType);
2994
3003
  W(() => {
2995
- Ne(a === "dark");
3004
+ be(a === "dark");
2996
3005
  }, [a]), W(() => {
2997
- const x = setTimeout(() => Je(!1), M ? 0 : 800);
2998
- return () => clearTimeout(x);
2999
- }, [M]), W(() => {
3000
- if ($.current !== y.flowType && !Ie) {
3001
- $.current = y.flowType, C(!0), _e(!1), Ve(!1);
3002
- const x = setTimeout(() => C(!1), 350);
3003
- return () => clearTimeout(x);
3006
+ const g = setTimeout(() => Je(!1), I ? 0 : 800);
3007
+ return () => clearTimeout(g);
3008
+ }, [I]), W(() => {
3009
+ if (F.current !== x.flowType && !Ie) {
3010
+ F.current = x.flowType, Ve(!0), De(!1), te(!1);
3011
+ const g = setTimeout(() => Ve(!1), 350);
3012
+ return () => clearTimeout(g);
3004
3013
  }
3005
- $.current = y.flowType;
3006
- }, [y.flowType, Ie]);
3007
- const Q = y.flowType, K = Q === "buy", X = y.cryptoCurrency || "BTC", te = y.fiatCurrency || "USD", et = K ? y.fiatAmount : y.cryptoAmount, z = Ea(et), ue = (bt = w == null ? void 0 : w.bestQuote) != null && bt.exchangeRate ? parseFloat(w.bestQuote.exchangeRate) : null, je = I(null);
3008
- ue && X && te && (je.current = { rate: ue, crypto: X, fiat: te });
3014
+ F.current = x.flowType;
3015
+ }, [x.flowType, Ie]);
3016
+ const K = x.flowType, M = K === "buy", _ = x.cryptoCurrency || "BTC", ae = x.fiatCurrency || "USD", et = M ? x.fiatAmount : x.cryptoAmount, z = Ea(et), ue = (bt = N == null ? void 0 : N.bestQuote) != null && bt.exchangeRate ? parseFloat(N.bestQuote.exchangeRate) : null, je = B(null);
3017
+ ue && _ && ae && (je.current = { rate: ue, crypto: _, fiat: ae });
3009
3018
  const ut = Y(() => {
3010
- if (w != null && w.bestQuote) {
3011
- const x = K ? w.bestQuote.cryptoAmount : w.bestQuote.fiatAmount;
3012
- if (x) return x;
3019
+ if (N != null && N.bestQuote) {
3020
+ const g = M ? N.bestQuote.cryptoAmount : N.bestQuote.fiatAmount;
3021
+ if (g) return g;
3013
3022
  }
3014
3023
  return "0";
3015
- }, [w, K]), Be = !!(q && G && K && Xt(X) && ue), Qt = Be && X.toUpperCase().includes(te.toUpperCase()), mt = Be && z > 0 ? lt(Qt ? z : z / ue) : null, zt = Be && mt ? mt : ut, Jt = Y(() => {
3016
- var H, oe, ke;
3017
- const x = ue || ((H = je.current) == null ? void 0 : H.rate), N = ue ? X : (oe = je.current) == null ? void 0 : oe.crypto, T = ue ? te : (ke = je.current) == null ? void 0 : ke.fiat;
3018
- return !x || !N || !T ? "" : `1 ${N} ≈ ${x.toFixed(2)} ${T}`;
3019
- }, [X, te, ue]);
3024
+ }, [N, M]), Be = !!(q && $ && M && Xt(_) && ue), Qt = Be && _.toUpperCase().includes(ae.toUpperCase()), mt = Be && z > 0 ? lt(Qt ? z : z / ue) : null, zt = Be && mt ? mt : ut, Jt = Y(() => {
3025
+ var H, ie, Re;
3026
+ const g = ue || ((H = je.current) == null ? void 0 : H.rate), E = ue ? _ : (ie = je.current) == null ? void 0 : ie.crypto, T = ue ? ae : (Re = je.current) == null ? void 0 : Re.fiat;
3027
+ return !g || !E || !T ? "" : `1 ${E} ≈ ${g.toFixed(2)} ${T}`;
3028
+ }, [_, ae, ue]);
3020
3029
  W(() => {
3021
- const x = y.walletAddress.trim(), N = y.network;
3022
- if (!x || x.length < 10) {
3023
- ge(null), L({ type: "SET_WALLET_ERROR", message: "" });
3030
+ const g = x.walletAddress.trim(), E = x.network;
3031
+ if (!g || g.length < 10) {
3032
+ Ce(null), k({ type: "SET_WALLET_ERROR", message: "" });
3024
3033
  return;
3025
3034
  }
3026
- Re(!0), ge(null);
3035
+ Fe(!0), Ce(null);
3027
3036
  const T = new AbortController();
3028
- return clearTimeout(F.current), F.current = setTimeout(async () => {
3029
- var H, oe, ke;
3037
+ return clearTimeout(L.current), L.current = setTimeout(async () => {
3038
+ var H, ie, Re;
3030
3039
  try {
3031
- const nt = await (await fetch(`${be.apiUrl}/public/validate/address`, {
3040
+ const nt = await (await fetch(`${ee.apiUrl}/public/validate/address`, {
3032
3041
  method: "POST",
3033
3042
  headers: { "Content-Type": "application/json" },
3034
- body: JSON.stringify({ address: x, ...N ? { network: N } : {} }),
3043
+ body: JSON.stringify({ address: g, ...E ? { network: E } : {} }),
3035
3044
  signal: T.signal
3036
3045
  })).json(), rt = ((H = nt.data) == null ? void 0 : H.attributes) || nt.data || nt;
3037
3046
  if (rt.isValid)
3038
- ge(!0), L({ type: "SET_WALLET_ERROR", message: "" });
3047
+ Ce(!0), k({ type: "SET_WALLET_ERROR", message: "" });
3039
3048
  else {
3040
- ge(!1);
3041
- const da = ((oe = rt.errors) == null ? void 0 : oe[0]) || ((ke = rt.details) == null ? void 0 : ke.formatMessage) || "Invalid wallet address";
3042
- L({ type: "SET_WALLET_ERROR", message: da });
3049
+ Ce(!1);
3050
+ const da = ((ie = rt.errors) == null ? void 0 : ie[0]) || ((Re = rt.details) == null ? void 0 : Re.formatMessage) || "Invalid wallet address";
3051
+ k({ type: "SET_WALLET_ERROR", message: da });
3043
3052
  }
3044
3053
  } catch (at) {
3045
3054
  if (at instanceof DOMException && at.name === "AbortError") return;
3046
- ge(null);
3055
+ Ce(null);
3047
3056
  } finally {
3048
- T.signal.aborted || Re(!1);
3057
+ T.signal.aborted || Fe(!1);
3049
3058
  }
3050
3059
  }, 500), () => {
3051
- clearTimeout(F.current), T.abort();
3060
+ clearTimeout(L.current), T.abort();
3052
3061
  };
3053
- }, [y.walletAddress, y.network, be.apiUrl]);
3054
- const ft = !et || z === 0, ht = z > 0 && (K ? z < Bt : z < Ot), pt = !!se || ht || we && ft, qt = z > 0 && !se && !ht, tt = y.walletAddress.trim().length >= 10 && ze !== !1 && !Ae, Ge = qt && tt && !!y.cryptoCurrency && !!y.network, ea = (x) => {
3055
- let N = x.target.value.replace(/[^0-9.,]/g, "");
3056
- const T = K ? 2 : 6, H = N.indexOf(".");
3057
- H !== -1 && N.length - H - 1 > T && (N = N.slice(0, H + T + 1)), L(K ? { type: "SET_FIAT_AMOUNT", amount: N } : { type: "SET_CRYPTO_AMOUNT", amount: N });
3058
- }, yt = (x) => {
3059
- x !== Q && L({ type: "SET_FLOW_TYPE", flowType: x });
3060
- }, ta = B(
3061
- (x) => {
3062
- L({ type: "SET_FIAT_CURRENCY", currency: x });
3062
+ }, [x.walletAddress, x.network, ee.apiUrl]);
3063
+ const ft = !et || z === 0, ht = z > 0 && (M ? z < Bt : z < Ot), pt = !!de || ht || ge && ft, qt = z > 0 && !de && !ht, tt = x.walletAddress.trim().length >= 10 && Me !== !1 && !we, Ge = qt && tt && !!x.cryptoCurrency && !!x.network, ea = (g) => {
3064
+ let E = g.target.value.replace(/[^0-9.,]/g, "");
3065
+ const T = M ? 2 : 6, H = E.indexOf(".");
3066
+ H !== -1 && E.length - H - 1 > T && (E = E.slice(0, H + T + 1)), k(M ? { type: "SET_FIAT_AMOUNT", amount: E } : { type: "SET_CRYPTO_AMOUNT", amount: E });
3067
+ }, yt = (g) => {
3068
+ g !== K && k({ type: "SET_FLOW_TYPE", flowType: g });
3069
+ }, ta = O(
3070
+ (g) => {
3071
+ k({ type: "SET_FIAT_CURRENCY", currency: g });
3063
3072
  },
3064
- [L]
3065
- ), aa = B(
3066
- (x, N) => {
3067
- L({ type: "SET_CRYPTO_CURRENCY", currency: x }), L({ type: "SET_CRYPTO_CHAIN", chain: N });
3073
+ [k]
3074
+ ), aa = O(
3075
+ (g, E) => {
3076
+ k({ type: "SET_CRYPTO_CURRENCY", currency: g }), k({ type: "SET_CRYPTO_CHAIN", chain: E });
3068
3077
  },
3069
- [L]
3070
- ), na = B(
3071
- (x) => {
3072
- L({ type: "SET_PAYMENT_METHOD", methodId: x });
3078
+ [k]
3079
+ ), na = O(
3080
+ (g) => {
3081
+ k({ type: "SET_PAYMENT_METHOD", methodId: g });
3073
3082
  },
3074
- [L]
3075
- ), ra = B(
3076
- (x) => {
3077
- L({ type: "SET_COUNTRY", country: x }), O(null);
3083
+ [k]
3084
+ ), ra = O(
3085
+ (g) => {
3086
+ k({ type: "SET_COUNTRY", country: g }), G(null);
3078
3087
  },
3079
- [L]
3080
- ), oa = B(() => {
3081
- O(null), setTimeout(() => O("country"), 280);
3082
- }, []), ia = y.country ? (Nt = st[y.country.toLowerCase()]) == null ? void 0 : Nt.name : void 0, la = () => {
3083
- Ge && (U(!0), pe());
3088
+ [k]
3089
+ ), oa = O(() => {
3090
+ G(null), setTimeout(() => G("country"), 280);
3091
+ }, []), ia = x.country ? (Nt = st[x.country.toLowerCase()]) == null ? void 0 : Nt.name : void 0, la = () => {
3092
+ Ge && (b(!0), ye());
3084
3093
  };
3085
3094
  W(() => {
3086
- var x;
3087
- if (!(!b || S)) {
3088
- if (w != null && w.bestQuote)
3089
- U(!1), L({ type: "SELECT_QUOTE", quote: w.bestQuote }), ye().catch(() => {
3095
+ var g;
3096
+ if (!(!y || v)) {
3097
+ if (N != null && N.bestQuote)
3098
+ b(!1), k({ type: "SELECT_QUOTE", quote: N.bestQuote }), xe().catch(() => {
3090
3099
  });
3091
- else if (he)
3092
- U(!1), L({ type: "SET_ERROR", message: he.message || "No quotes available" });
3093
- else if (w && !w.bestQuote) {
3094
- U(!1);
3095
- const N = (x = w.unavailableGateways) == null ? void 0 : x.map((H) => H.reason).filter(Boolean), T = N != null && N.length ? `No providers available: ${N.join("; ")}` : "No providers available for this currency/network combination";
3096
- L({ type: "SET_ERROR", message: T });
3100
+ else if (pe)
3101
+ b(!1), k({ type: "SET_ERROR", message: pe.message || "No quotes available" });
3102
+ else if (N && !N.bestQuote) {
3103
+ b(!1);
3104
+ const E = (g = N.unavailableGateways) == null ? void 0 : g.map((H) => H.reason).filter(Boolean), T = E != null && E.length ? `No providers available: ${E.join("; ")}` : "No providers available for this currency/network combination";
3105
+ k({ type: "SET_ERROR", message: T });
3097
3106
  }
3098
3107
  }
3099
- }, [b, w, S, he, L, ye]);
3100
- const xt = re ? "theme-dark" : "theme-light", $e = Mt.find((x) => x.id === Ee) || Mt[0], ca = $e.accent === null, sa = r ? ce(r) : !1, gt = (x) => {
3101
- const N = x.replace("#", ""), T = parseInt(N.substring(0, 2), 16), H = parseInt(N.substring(2, 4), 16), oe = parseInt(N.substring(4, 6), 16);
3102
- return (0.299 * T + 0.587 * H + 0.114 * oe) / 255 > 0.5 ? "#000000" : "#ffffff";
3108
+ }, [y, N, v, pe, k, xe]);
3109
+ const xt = Q ? "theme-dark" : "theme-light", $e = Mt.find((g) => g.id === Ne) || Mt[0], ca = $e.accent === null, sa = r ? se(r) : !1, gt = (g) => {
3110
+ const E = g.replace("#", ""), T = parseInt(E.substring(0, 2), 16), H = parseInt(E.substring(2, 4), 16), ie = parseInt(E.substring(4, 6), 16);
3111
+ return (0.299 * T + 0.587 * H + 0.114 * ie) / 255 > 0.5 ? "#000000" : "#ffffff";
3103
3112
  }, Ct = sa ? { "--t-accent": r, "--t-cta-bg": r, "--t-cta-text": gt(r) } : ca ? {
3104
- "--t-accent": re ? "#ffffff" : "#111111",
3105
- "--t-cta-bg": re ? "#ffffff" : "#111111",
3106
- "--t-cta-text": re ? "#000000" : "#ffffff"
3113
+ "--t-accent": Q ? "#ffffff" : "#111111",
3114
+ "--t-cta-bg": Q ? "#ffffff" : "#111111",
3115
+ "--t-cta-text": Q ? "#000000" : "#ffffff"
3107
3116
  } : {
3108
3117
  "--t-accent": $e.accent,
3109
3118
  "--t-cta-bg": $e.accent,
3110
3119
  "--t-cta-text": gt($e.accent)
3111
- }, ae = {};
3112
- u && ce(u) && (ae["--t-surface"] = u, ae["--t-modal-bg"] = u), f && ce(f) && (ae["--t-pill-bg"] = f, ae["--t-close-bg"] = f), h && ce(h) && (ae["--t-text"] = h), d && ce(d) && (ae["--t-text-secondary"] = d), p && ce(p) && (ae["--t-text-muted"] = p, ae["--t-text-tertiary"] = p), g && ce(g) && (ae["--t-success"] = g);
3113
- const Ce = {};
3114
- i && ce(i) ? Ce.backgroundColor = i : Ce.backgroundColor = "var(--t-bg)", c && (c.startsWith("https://") || c.startsWith("data:image/")) && (Ce.backgroundImage = `url(${c})`, Ce.backgroundSize = "cover", Ce.backgroundPosition = "center");
3115
- const Xe = re ? "#ffffff" : "#111111", We = {};
3116
- m && ce(m) && (We.border = `1px solid ${m}`), s && (We.borderRadius = s);
3117
- const vt = y.step === "checkout" ? /* @__PURE__ */ e(Ka, { autoRedirect: P }) : y.step === "processing" ? /* @__PURE__ */ e(Va, {}) : y.step === "complete" ? /* @__PURE__ */ e(ja, { explorerUrl: ne, doneButtonText: V, onDone: fe }) : y.step === "error" ? /* @__PURE__ */ e(Ga, { supportEmail: Z }) : y.step === "confirm" ? /* @__PURE__ */ e($a, { stablecoinParity: Be, partnerName: G }) : null;
3120
+ }, ne = {};
3121
+ u && se(u) && (ne["--t-surface"] = u, ne["--t-modal-bg"] = u), f && se(f) && (ne["--t-pill-bg"] = f, ne["--t-close-bg"] = f), h && se(h) && (ne["--t-text"] = h), d && se(d) && (ne["--t-text-secondary"] = d), p && se(p) && (ne["--t-text-muted"] = p, ne["--t-text-tertiary"] = p), C && se(C) && (ne["--t-success"] = C);
3122
+ const ve = {};
3123
+ l && se(l) ? ve.backgroundColor = l : ve.backgroundColor = "var(--t-bg)", c && (c.startsWith("https://") || c.startsWith("data:image/")) && (ve.backgroundImage = `url(${c})`, ve.backgroundSize = "cover", ve.backgroundPosition = "center");
3124
+ const Xe = Q ? "#ffffff" : "#111111", We = {};
3125
+ m && se(m) && (We.border = `1px solid ${m}`), s && (We.borderRadius = s);
3126
+ const vt = x.step === "checkout" ? /* @__PURE__ */ e(Ka, { autoRedirect: P }) : x.step === "processing" ? /* @__PURE__ */ e(Va, {}) : x.step === "complete" ? /* @__PURE__ */ e(ja, { explorerUrl: re, doneButtonText: j, onDone: he }) : x.step === "error" ? /* @__PURE__ */ e(Ga, { supportEmail: Z }) : x.step === "confirm" ? /* @__PURE__ */ e($a, { stablecoinParity: Be, partnerName: $ }) : null;
3118
3127
  if (vt)
3119
3128
  return /* @__PURE__ */ e(
3120
3129
  "div",
@@ -3122,28 +3131,28 @@ function rn({
3122
3131
  className: `${xt} relative w-full max-w-[390px] h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
3123
3132
  style: {
3124
3133
  fontFamily: "'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
3125
- ...Ce,
3134
+ ...ve,
3126
3135
  ...Ct,
3127
- ...ae,
3136
+ ...ne,
3128
3137
  ...We
3129
3138
  },
3130
3139
  children: vt
3131
3140
  }
3132
3141
  );
3133
- const le = y.network, Te = le ? Ze(le) : null, St = (Te == null ? void 0 : Te.shortName) || (Te == null ? void 0 : Te.name) || le;
3142
+ const ce = x.network, Ae = ce ? Ze(ce) : null, St = (Ae == null ? void 0 : Ae.shortName) || (Ae == null ? void 0 : Ae.name) || ce;
3134
3143
  return /* @__PURE__ */ o(
3135
3144
  "div",
3136
3145
  {
3137
3146
  className: `${xt} relative w-full max-w-[390px] min-h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
3138
3147
  style: {
3139
3148
  fontFamily: "'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
3140
- ...Ce,
3149
+ ...ve,
3141
3150
  ...Ct,
3142
- ...ae,
3151
+ ...ne,
3143
3152
  ...We
3144
3153
  },
3145
3154
  children: [
3146
- E && /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${A ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(Ma, { onClick: () => O("settings") }) }),
3155
+ w && /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${A ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(Ma, { onClick: () => G("settings") }) }),
3147
3156
  A ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center pt-3 pb-5", children: [
3148
3157
  /* @__PURE__ */ o("div", { className: "flex", style: { width: 165 }, children: [
3149
3158
  /* @__PURE__ */ e(
@@ -3151,7 +3160,7 @@ function rn({
3151
3160
  {
3152
3161
  onClick: () => yt("buy"),
3153
3162
  className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
3154
- style: { color: Q === "buy" ? "var(--t-text)" : "var(--t-text-secondary)" },
3163
+ style: { color: K === "buy" ? "var(--t-text)" : "var(--t-text-secondary)" },
3155
3164
  children: "Buy"
3156
3165
  }
3157
3166
  ),
@@ -3160,7 +3169,7 @@ function rn({
3160
3169
  {
3161
3170
  onClick: () => yt("sell"),
3162
3171
  className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
3163
- style: { color: Q === "sell" ? "var(--t-text)" : "var(--t-text-secondary)" },
3172
+ style: { color: K === "sell" ? "var(--t-text)" : "var(--t-text-secondary)" },
3164
3173
  children: "Sell"
3165
3174
  }
3166
3175
  )
@@ -3173,14 +3182,14 @@ function rn({
3173
3182
  className: "absolute top-0 h-full transition-all duration-300 ease-in-out",
3174
3183
  style: {
3175
3184
  width: "50%",
3176
- left: Q === "buy" ? "0%" : "50%",
3185
+ left: K === "buy" ? "0%" : "50%",
3177
3186
  background: "var(--t-accent)"
3178
3187
  }
3179
3188
  }
3180
3189
  )
3181
3190
  ] })
3182
3191
  ] }) : null,
3183
- Ie || qe || M ? /* @__PURE__ */ e(Ya, {}) : /* @__PURE__ */ o("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
3192
+ Ie || qe || I ? /* @__PURE__ */ e(Ya, {}) : /* @__PURE__ */ o("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
3184
3193
  /* @__PURE__ */ o(
3185
3194
  "div",
3186
3195
  {
@@ -3188,7 +3197,7 @@ function rn({
3188
3197
  style: {
3189
3198
  background: "var(--t-surface)",
3190
3199
  borderRadius: 5,
3191
- border: we && pt ? "1px solid #EF4444" : "1px solid transparent",
3200
+ border: ge && pt ? "1px solid #EF4444" : "1px solid transparent",
3192
3201
  minHeight: 102
3193
3202
  },
3194
3203
  children: [
@@ -3197,22 +3206,22 @@ function rn({
3197
3206
  /* @__PURE__ */ e(
3198
3207
  "input",
3199
3208
  {
3200
- ref: D,
3209
+ ref: U,
3201
3210
  type: "text",
3202
3211
  value: et,
3203
3212
  onChange: ea,
3204
- onBlur: () => _e(!0),
3205
- placeholder: K ? "250" : "0.01",
3213
+ onBlur: () => De(!0),
3214
+ placeholder: M ? "250" : "0.01",
3206
3215
  className: "bg-transparent outline-none w-0 flex-1 mr-3",
3207
3216
  style: { color: "var(--t-text)", fontSize: 24, fontWeight: 600, lineHeight: "32px", padding: 0, border: "none", borderRadius: 0, backgroundColor: "transparent", height: "auto", width: 0 },
3208
3217
  inputMode: "decimal",
3209
- disabled: !!((Et = k == null ? void 0 : k.sourceAmount) != null && Et.locked)
3218
+ disabled: !!((Et = D == null ? void 0 : D.sourceAmount) != null && Et.locked)
3210
3219
  }
3211
3220
  ),
3212
- K ? /* @__PURE__ */ o(
3221
+ M ? /* @__PURE__ */ o(
3213
3222
  "button",
3214
3223
  {
3215
- onClick: () => O("fiat"),
3224
+ onClick: () => G("fiat"),
3216
3225
  className: "flex items-center gap-1.5 shrink-0 transition-colors",
3217
3226
  style: {
3218
3227
  background: "var(--t-pill-bg)",
@@ -3221,10 +3230,10 @@ function rn({
3221
3230
  paddingLeft: 10,
3222
3231
  paddingRight: 10
3223
3232
  },
3224
- disabled: !!((wt = k == null ? void 0 : k.sourceCurrency) != null && wt.locked),
3233
+ disabled: !!((wt = D == null ? void 0 : D.sourceCurrency) != null && wt.locked),
3225
3234
  children: [
3226
- /* @__PURE__ */ e(ct, { currencyCode: te, size: 16, baseUrl: j }),
3227
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Xe }, children: te }),
3235
+ /* @__PURE__ */ e(ct, { currencyCode: ae, size: 16, baseUrl: X }),
3236
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Xe }, children: ae }),
3228
3237
  /* @__PURE__ */ e(Pe, {})
3229
3238
  ]
3230
3239
  }
@@ -3232,7 +3241,7 @@ function rn({
3232
3241
  /* @__PURE__ */ o(
3233
3242
  "button",
3234
3243
  {
3235
- onClick: () => O("crypto"),
3244
+ onClick: () => G("crypto"),
3236
3245
  className: "flex items-center gap-1.5 transition-colors",
3237
3246
  style: {
3238
3247
  background: "var(--t-pill-bg)",
@@ -3241,20 +3250,20 @@ function rn({
3241
3250
  paddingLeft: 10,
3242
3251
  paddingRight: 10
3243
3252
  },
3244
- disabled: !!((At = k == null ? void 0 : k.destinationCurrency) != null && At.locked),
3253
+ disabled: !!((At = D == null ? void 0 : D.destinationCurrency) != null && At.locked),
3245
3254
  children: [
3246
- /* @__PURE__ */ e(Ht, { ticker: X, size: 16, baseUrl: j }),
3247
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Xe }, children: X }),
3255
+ /* @__PURE__ */ e(Ht, { ticker: _, size: 16, baseUrl: X }),
3256
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Xe }, children: _ }),
3248
3257
  /* @__PURE__ */ e(Pe, {})
3249
3258
  ]
3250
3259
  }
3251
3260
  ),
3252
- le && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
3261
+ ce && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
3253
3262
  /* @__PURE__ */ e("div", { className: "rounded-full", style: { width: 14, height: 14, background: "#ffffff" }, children: /* @__PURE__ */ e(
3254
3263
  "img",
3255
3264
  {
3256
- src: it(le, j),
3257
- alt: le,
3265
+ src: it(ce, X),
3266
+ alt: ce,
3258
3267
  width: 14,
3259
3268
  height: 14,
3260
3269
  className: "rounded-full",
@@ -3268,7 +3277,7 @@ function rn({
3268
3277
  ]
3269
3278
  }
3270
3279
  ),
3271
- we && pt && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: se || (ft ? "Amount should be more than 0" : K ? `Minimum amount is ${Bt} ${te}` : `Minimum amount is ${Ot} ${X}`) }),
3280
+ ge && pt && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: de || (ft ? "Amount should be more than 0" : M ? `Minimum amount is ${Bt} ${ae}` : `Minimum amount is ${Ot} ${_}`) }),
3272
3281
  /* @__PURE__ */ o(
3273
3282
  "div",
3274
3283
  {
@@ -3285,7 +3294,7 @@ function rn({
3285
3294
  children: [
3286
3295
  /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
3287
3296
  /* @__PURE__ */ o("div", { className: "flex items-start justify-between", children: [
3288
- S && !b ? /* @__PURE__ */ e(_, { w: 180, h: 32 }) : /* @__PURE__ */ e(
3297
+ v && !y ? /* @__PURE__ */ e(V, { w: 180, h: 32 }) : /* @__PURE__ */ e(
3289
3298
  Wa,
3290
3299
  {
3291
3300
  value: z > 0 ? zt : "0",
@@ -3294,11 +3303,11 @@ function rn({
3294
3303
  style: { color: z > 0 ? "var(--t-text)" : "var(--t-text-muted)", fontSize: 24 }
3295
3304
  }
3296
3305
  ),
3297
- K ? /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
3306
+ M ? /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
3298
3307
  /* @__PURE__ */ o(
3299
3308
  "button",
3300
3309
  {
3301
- onClick: () => O("crypto"),
3310
+ onClick: () => G("crypto"),
3302
3311
  className: "flex items-center gap-1.5 transition-colors",
3303
3312
  style: {
3304
3313
  background: "var(--t-pill-bg)",
@@ -3307,20 +3316,20 @@ function rn({
3307
3316
  paddingLeft: 10,
3308
3317
  paddingRight: 10
3309
3318
  },
3310
- disabled: !!((Rt = k == null ? void 0 : k.destinationCurrency) != null && Rt.locked),
3319
+ disabled: !!((Rt = D == null ? void 0 : D.destinationCurrency) != null && Rt.locked),
3311
3320
  children: [
3312
- /* @__PURE__ */ e(Ht, { ticker: X, size: 16, baseUrl: j }),
3313
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Xe }, children: X }),
3321
+ /* @__PURE__ */ e(Ht, { ticker: _, size: 16, baseUrl: X }),
3322
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Xe }, children: _ }),
3314
3323
  /* @__PURE__ */ e(Pe, {})
3315
3324
  ]
3316
3325
  }
3317
3326
  ),
3318
- le && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
3327
+ ce && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
3319
3328
  /* @__PURE__ */ e("div", { className: "rounded-full", style: { width: 14, height: 14, background: "#ffffff" }, children: /* @__PURE__ */ e(
3320
3329
  "img",
3321
3330
  {
3322
- src: it(le, j),
3323
- alt: le,
3331
+ src: it(ce, X),
3332
+ alt: ce,
3324
3333
  width: 14,
3325
3334
  height: 14,
3326
3335
  className: "rounded-full",
@@ -3332,7 +3341,7 @@ function rn({
3332
3341
  ] }) : /* @__PURE__ */ o(
3333
3342
  "button",
3334
3343
  {
3335
- onClick: () => O("fiat"),
3344
+ onClick: () => G("fiat"),
3336
3345
  className: "flex items-center gap-1.5 shrink-0 transition-colors",
3337
3346
  style: {
3338
3347
  background: "var(--t-pill-bg)",
@@ -3341,10 +3350,10 @@ function rn({
3341
3350
  paddingLeft: 10,
3342
3351
  paddingRight: 10
3343
3352
  },
3344
- disabled: !!((Tt = k == null ? void 0 : k.sourceCurrency) != null && Tt.locked),
3353
+ disabled: !!((Tt = D == null ? void 0 : D.sourceCurrency) != null && Tt.locked),
3345
3354
  children: [
3346
- /* @__PURE__ */ e(ct, { currencyCode: te, size: 16, baseUrl: j }),
3347
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Xe }, children: te }),
3355
+ /* @__PURE__ */ e(ct, { currencyCode: ae, size: 16, baseUrl: X }),
3356
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Xe }, children: ae }),
3348
3357
  /* @__PURE__ */ e(Pe, {})
3349
3358
  ]
3350
3359
  }
@@ -3353,7 +3362,7 @@ function rn({
3353
3362
  ]
3354
3363
  }
3355
3364
  ),
3356
- Be && z > 0 && (w == null ? void 0 : w.bestQuote) && /* @__PURE__ */ o(
3365
+ Be && z > 0 && (N == null ? void 0 : N.bestQuote) && /* @__PURE__ */ o(
3357
3366
  "div",
3358
3367
  {
3359
3368
  className: "flex items-start gap-2 mt-[2px] px-[14px] py-[10px]",
@@ -3367,13 +3376,13 @@ function rn({
3367
3376
  "You will be charged for ",
3368
3377
  ut,
3369
3378
  " ",
3370
- X,
3379
+ _,
3371
3380
  ", the rest up to ",
3372
3381
  lt(z),
3373
3382
  " ",
3374
- te,
3383
+ ae,
3375
3384
  " will be credited to your ",
3376
- G,
3385
+ $,
3377
3386
  " account"
3378
3387
  ] })
3379
3388
  ]
@@ -3385,38 +3394,38 @@ function rn({
3385
3394
  className: "flex items-center justify-between mt-[2px] px-[18px] pt-[12px] pb-[14px]",
3386
3395
  style: {
3387
3396
  background: "var(--t-surface)",
3388
- ...(kt = l == null ? void 0 : l.paymentMethods) != null && kt.length ? {} : { borderBottomLeftRadius: 5, borderBottomRightRadius: 5 }
3397
+ ...(kt = i == null ? void 0 : i.paymentMethods) != null && kt.length ? {} : { borderBottomLeftRadius: 5, borderBottomRightRadius: 5 }
3389
3398
  },
3390
- children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: g ? "var(--t-success)" : "var(--t-text-secondary)" }, children: Jt || " " })
3399
+ children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: C ? "var(--t-success)" : "var(--t-text-secondary)" }, children: Jt || " " })
3391
3400
  }
3392
3401
  ),
3393
- (l == null ? void 0 : l.paymentMethods) && l.paymentMethods.length > 0 && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: /* @__PURE__ */ e(
3402
+ (i == null ? void 0 : i.paymentMethods) && i.paymentMethods.length > 0 && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: /* @__PURE__ */ e(
3394
3403
  Pa,
3395
3404
  {
3396
- methods: l.paymentMethods,
3397
- selectedId: y.paymentMethodId,
3398
- onOpenModal: () => O("payment"),
3399
- fiatCurrency: y.fiatCurrency
3405
+ methods: i.paymentMethods,
3406
+ selectedId: x.paymentMethodId,
3407
+ onOpenModal: () => G("payment"),
3408
+ fiatCurrency: x.fiatCurrency
3400
3409
  }
3401
3410
  ) }),
3402
3411
  /* @__PURE__ */ o("div", { className: "mt-8", children: [
3403
- /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: K ? "Receiving wallet address" : "Sending wallet address" }),
3412
+ /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: M ? "Receiving wallet address" : "Sending wallet address" }),
3404
3413
  /* @__PURE__ */ e(
3405
3414
  "input",
3406
3415
  {
3407
3416
  type: "text",
3408
- value: y.walletAddress,
3409
- onChange: (x) => L({ type: "SET_WALLET_ADDRESS", address: x.target.value }),
3410
- onFocus: () => Me(!0),
3417
+ value: x.walletAddress,
3418
+ onChange: (g) => k({ type: "SET_WALLET_ADDRESS", address: g.target.value }),
3419
+ onFocus: () => Ee(!0),
3411
3420
  onBlur: () => {
3412
- Me(!1), Ve(!0);
3421
+ Ee(!1), te(!0);
3413
3422
  },
3414
- placeholder: K ? "Enter your receiving address" : "Enter your sending address",
3423
+ placeholder: M ? "Enter your receiving address" : "Enter your sending address",
3415
3424
  spellCheck: !1,
3416
3425
  autoComplete: "off",
3417
3426
  className: "w-full bg-transparent text-[13px] outline-none transition-colors",
3418
3427
  style: {
3419
- border: y.walletError || ee && !tt ? "1px solid #EF4444" : Fe ? "1px solid var(--t-border-focus)" : "1px solid var(--t-border)",
3428
+ border: x.walletError || _e && !tt ? "1px solid #EF4444" : ze ? "1px solid var(--t-border-focus)" : "1px solid var(--t-border)",
3420
3429
  outline: "none",
3421
3430
  boxShadow: "none",
3422
3431
  borderRadius: 3.5,
@@ -3426,16 +3435,16 @@ function rn({
3426
3435
  fontSize: 13,
3427
3436
  backgroundColor: "transparent"
3428
3437
  },
3429
- disabled: !!((Lt = k == null ? void 0 : k.destinationAddress) != null && Lt.locked)
3438
+ disabled: !!((Lt = D == null ? void 0 : D.destinationAddress) != null && Lt.locked)
3430
3439
  }
3431
3440
  ),
3432
- y.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: y.walletError }) : ee && !tt && !Ae ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : Ae && y.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
3441
+ x.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: x.walletError }) : _e && !tt && !we ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : we && x.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
3433
3442
  ] }),
3434
3443
  /* @__PURE__ */ e("div", { className: "flex-1", style: { minHeight: 16 } }),
3435
3444
  /* @__PURE__ */ e(
3436
3445
  "button",
3437
3446
  {
3438
- disabled: !Ge || ie || b,
3447
+ disabled: !Ge || le || y,
3439
3448
  onClick: la,
3440
3449
  className: "w-full font-semibold text-[16px] transition-all",
3441
3450
  style: {
@@ -3443,92 +3452,92 @@ function rn({
3443
3452
  borderRadius: 5,
3444
3453
  background: "var(--t-cta-bg)",
3445
3454
  color: "var(--t-cta-text)",
3446
- opacity: Ge && !ie && !b ? 1 : 0.4,
3447
- cursor: Ge && !ie && !b ? "pointer" : "not-allowed"
3455
+ opacity: Ge && !le && !y ? 1 : 0.4,
3456
+ cursor: Ge && !le && !y ? "pointer" : "not-allowed"
3448
3457
  },
3449
- children: b ? "Getting best price..." : ie ? "Processing..." : K ? `Buy ${X}` : `Sell ${X}`
3458
+ children: y ? "Getting best price..." : le ? "Processing..." : M ? `Buy ${_}` : `Sell ${_}`
3450
3459
  }
3451
3460
  ),
3452
3461
  /* @__PURE__ */ e("div", { className: "text-center py-3", children: /* @__PURE__ */ e("span", { className: "text-[11px]", style: { color: "var(--t-text-tertiary)" }, children: "Powered by NowRamp" }) })
3453
- ] }, Q),
3454
- /* @__PURE__ */ e(He, { isOpen: xe === "fiat", onClose: () => O(null), children: (x) => {
3455
- var N;
3462
+ ] }, K),
3463
+ /* @__PURE__ */ e(He, { isOpen: oe === "fiat", onClose: () => G(null), children: (g) => {
3464
+ var E;
3456
3465
  return /* @__PURE__ */ e(
3457
3466
  Za,
3458
3467
  {
3459
- onClose: x,
3468
+ onClose: g,
3460
3469
  onSelect: (T) => {
3461
- ta(T), x();
3470
+ ta(T), g();
3462
3471
  },
3463
- currencies: (N = l == null ? void 0 : l.fiats) == null ? void 0 : N.map((T) => ({ code: T.code, name: T.code })),
3464
- assetBaseUrl: j,
3465
- selectedCode: y.fiatCurrency
3472
+ currencies: (E = i == null ? void 0 : i.fiats) == null ? void 0 : E.map((T) => ({ code: T.code, name: T.code })),
3473
+ assetBaseUrl: X,
3474
+ selectedCode: x.fiatCurrency
3466
3475
  }
3467
3476
  );
3468
3477
  } }),
3469
- /* @__PURE__ */ e(He, { isOpen: xe === "crypto", onClose: () => O(null), children: (x) => {
3470
- var N;
3478
+ /* @__PURE__ */ e(He, { isOpen: oe === "crypto", onClose: () => G(null), children: (g) => {
3479
+ var E;
3471
3480
  return /* @__PURE__ */ e(
3472
3481
  Qa,
3473
3482
  {
3474
- onClose: x,
3483
+ onClose: g,
3475
3484
  onSelect: (T, H) => {
3476
- aa(T, H), x();
3485
+ aa(T, H), g();
3477
3486
  },
3478
- cryptos: (N = l == null ? void 0 : l.cryptos) == null ? void 0 : N.map((T) => {
3487
+ cryptos: (E = i == null ? void 0 : i.cryptos) == null ? void 0 : E.map((T) => {
3479
3488
  var H;
3480
3489
  return {
3481
3490
  code: T.code,
3482
3491
  name: T.code,
3483
- networks: (H = T.networks) == null ? void 0 : H.map((oe) => ({ code: oe.id, name: oe.name }))
3492
+ networks: (H = T.networks) == null ? void 0 : H.map((ie) => ({ code: ie.id, name: ie.name }))
3484
3493
  };
3485
3494
  }),
3486
- assetBaseUrl: j,
3487
- selectedCode: y.cryptoCurrency,
3488
- selectedChain: y.network
3495
+ assetBaseUrl: X,
3496
+ selectedCode: x.cryptoCurrency,
3497
+ selectedChain: x.network
3489
3498
  }
3490
3499
  );
3491
3500
  } }),
3492
- /* @__PURE__ */ e(He, { isOpen: xe === "payment", onClose: () => O(null), children: (x) => {
3493
- var N;
3501
+ /* @__PURE__ */ e(He, { isOpen: oe === "payment", onClose: () => G(null), children: (g) => {
3502
+ var E;
3494
3503
  return /* @__PURE__ */ e(
3495
3504
  za,
3496
3505
  {
3497
- methods: ((N = l == null ? void 0 : l.paymentMethods) == null ? void 0 : N.filter((T) => T.supportedFiats.includes(y.fiatCurrency))) || [],
3498
- selectedId: y.paymentMethodId,
3506
+ methods: ((E = i == null ? void 0 : i.paymentMethods) == null ? void 0 : E.filter((T) => T.supportedFiats.includes(x.fiatCurrency))) || [],
3507
+ selectedId: x.paymentMethodId,
3499
3508
  onSelect: (T) => {
3500
- na(T), x();
3509
+ na(T), g();
3501
3510
  },
3502
- onClose: x
3511
+ onClose: g
3503
3512
  }
3504
3513
  );
3505
3514
  } }),
3506
- /* @__PURE__ */ e(He, { isOpen: xe === "settings", onClose: () => O(null), children: (x) => /* @__PURE__ */ e(
3515
+ /* @__PURE__ */ e(He, { isOpen: oe === "settings", onClose: () => G(null), children: (g) => /* @__PURE__ */ e(
3507
3516
  en,
3508
3517
  {
3509
- onClose: x,
3510
- darkMode: re,
3511
- onToggleDarkMode: Ne,
3512
- skinId: Ee,
3513
- onSelectSkin: (N) => {
3514
- de(N);
3518
+ onClose: g,
3519
+ darkMode: Q,
3520
+ onToggleDarkMode: be,
3521
+ skinId: Ne,
3522
+ onSelectSkin: (E) => {
3523
+ Ue(E);
3515
3524
  },
3516
3525
  showThemeToggle: R,
3517
- country: y.country,
3526
+ country: x.country,
3518
3527
  countryName: ia,
3519
3528
  onLocationPress: oa,
3520
- assetBaseUrl: j
3529
+ assetBaseUrl: X
3521
3530
  }
3522
3531
  ) }),
3523
- /* @__PURE__ */ e(He, { isOpen: xe === "country", onClose: () => O(null), children: (x) => /* @__PURE__ */ e(
3532
+ /* @__PURE__ */ e(He, { isOpen: oe === "country", onClose: () => G(null), children: (g) => /* @__PURE__ */ e(
3524
3533
  an,
3525
3534
  {
3526
- onClose: x,
3527
- onSelect: (N) => {
3528
- ra(N), x();
3535
+ onClose: g,
3536
+ onSelect: (E) => {
3537
+ ra(E), g();
3529
3538
  },
3530
- assetBaseUrl: j,
3531
- selectedCode: y.country
3539
+ assetBaseUrl: X,
3540
+ selectedCode: x.country
3532
3541
  }
3533
3542
  ) })
3534
3543
  ]
@@ -3540,7 +3549,7 @@ function on({
3540
3549
  apiUrl: a,
3541
3550
  assetBaseUrl: n,
3542
3551
  flowType: r,
3543
- customerId: i,
3552
+ customerId: l,
3544
3553
  brandId: c,
3545
3554
  defaultFiatCurrency: m,
3546
3555
  defaultCryptoCurrency: s,
@@ -3549,35 +3558,35 @@ function on({
3549
3558
  defaultCryptoAmount: h,
3550
3559
  defaultWalletAddress: d,
3551
3560
  defaultGateway: p,
3552
- defaultCountry: g,
3561
+ defaultCountry: C,
3553
3562
  fieldLocks: A,
3554
- statusPollInterval: E,
3563
+ statusPollInterval: w,
3555
3564
  onComplete: R,
3556
3565
  onError: P,
3557
- className: ne,
3558
- theme: V,
3566
+ className: re,
3567
+ theme: j,
3559
3568
  skinId: Z,
3560
3569
  accentColor: q,
3561
- bgColor: G,
3562
- bgImage: fe,
3563
- borderColor: y,
3564
- borderRadius: L,
3565
- surfaceColor: l,
3566
- inputBgColor: M,
3567
- textColor: w,
3568
- textSecondaryColor: S,
3569
- textMutedColor: he,
3570
- successColor: pe,
3571
- showFlowToggle: ye,
3572
- showSettings: ie,
3573
- showThemeToggle: se,
3574
- autoRedirect: k,
3575
- explorerUrl: be,
3576
- doneButtonText: j,
3577
- supportEmail: re,
3578
- stablecoinParity: Ne,
3579
- partnerName: Ee,
3580
- onDone: de
3570
+ bgColor: $,
3571
+ bgImage: he,
3572
+ borderColor: x,
3573
+ borderRadius: k,
3574
+ surfaceColor: i,
3575
+ inputBgColor: I,
3576
+ textColor: N,
3577
+ textSecondaryColor: v,
3578
+ textMutedColor: pe,
3579
+ successColor: ye,
3580
+ showFlowToggle: xe,
3581
+ showSettings: le,
3582
+ showThemeToggle: de,
3583
+ autoRedirect: D,
3584
+ explorerUrl: ee,
3585
+ doneButtonText: X,
3586
+ supportEmail: Q,
3587
+ stablecoinParity: be,
3588
+ partnerName: Ne,
3589
+ onDone: Ue
3581
3590
  }) {
3582
3591
  return /* @__PURE__ */ e(
3583
3592
  Ca,
@@ -3586,7 +3595,7 @@ function on({
3586
3595
  apiUrl: a,
3587
3596
  assetBaseUrl: n,
3588
3597
  flowType: r,
3589
- customerId: i,
3598
+ customerId: l,
3590
3599
  brandId: c,
3591
3600
  defaultFiatCurrency: m,
3592
3601
  defaultCryptoCurrency: s,
@@ -3595,38 +3604,38 @@ function on({
3595
3604
  defaultCryptoAmount: h,
3596
3605
  defaultWalletAddress: d,
3597
3606
  defaultGateway: p,
3598
- defaultCountry: g,
3607
+ defaultCountry: C,
3599
3608
  fieldLocks: A,
3600
- statusPollInterval: E,
3609
+ statusPollInterval: w,
3601
3610
  onComplete: R,
3602
3611
  onError: P,
3603
3612
  children: /* @__PURE__ */ e(
3604
3613
  rn,
3605
3614
  {
3606
- className: ne,
3607
- theme: V,
3615
+ className: re,
3616
+ theme: j,
3608
3617
  skinId: Z,
3609
3618
  accentColor: q,
3610
- bgColor: G,
3611
- bgImage: fe,
3612
- borderColor: y,
3613
- borderRadius: L,
3614
- surfaceColor: l,
3615
- inputBgColor: M,
3616
- textColor: w,
3617
- textSecondaryColor: S,
3618
- textMutedColor: he,
3619
- successColor: pe,
3620
- showFlowToggle: ye,
3621
- showSettings: ie,
3622
- showThemeToggle: se,
3623
- autoRedirect: k,
3624
- explorerUrl: be,
3625
- doneButtonText: j,
3626
- supportEmail: re,
3627
- stablecoinParity: Ne,
3628
- partnerName: Ee,
3629
- onDone: de
3619
+ bgColor: $,
3620
+ bgImage: he,
3621
+ borderColor: x,
3622
+ borderRadius: k,
3623
+ surfaceColor: i,
3624
+ inputBgColor: I,
3625
+ textColor: N,
3626
+ textSecondaryColor: v,
3627
+ textMutedColor: pe,
3628
+ successColor: ye,
3629
+ showFlowToggle: xe,
3630
+ showSettings: le,
3631
+ showThemeToggle: de,
3632
+ autoRedirect: D,
3633
+ explorerUrl: ee,
3634
+ doneButtonText: X,
3635
+ supportEmail: Q,
3636
+ stablecoinParity: be,
3637
+ partnerName: Ne,
3638
+ onDone: Ue
3630
3639
  }
3631
3640
  )
3632
3641
  }
@@ -3644,7 +3653,7 @@ function xn({
3644
3653
  active: a,
3645
3654
  onClick: n,
3646
3655
  darkMode: r,
3647
- dimmed: i
3656
+ dimmed: l
3648
3657
  }) {
3649
3658
  const c = t.accent === null, m = 32;
3650
3659
  return /* @__PURE__ */ o(
@@ -3652,7 +3661,7 @@ function xn({
3652
3661
  {
3653
3662
  onClick: n,
3654
3663
  className: "relative shrink-0",
3655
- style: { width: m, height: m, opacity: i ? 0.4 : 1, transition: "opacity 0.2s" },
3664
+ style: { width: m, height: m, opacity: l ? 0.4 : 1, transition: "opacity 0.2s" },
3656
3665
  children: [
3657
3666
  c ? /* @__PURE__ */ o("svg", { width: m, height: m, viewBox: "0 0 32 32", children: [
3658
3667
  /* @__PURE__ */ e("clipPath", { id: "mono-left", children: /* @__PURE__ */ e("rect", { x: "0", y: "0", width: "16", height: "32" }) }),
@@ -3661,7 +3670,7 @@ function xn({
3661
3670
  /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "#ffffff", clipPath: "url(#mono-right)" }),
3662
3671
  /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "none", stroke: r ? "rgba(255,255,255,0.15)" : "rgba(0,0,0,0.1)", strokeWidth: "1" })
3663
3672
  ] }) : /* @__PURE__ */ e("svg", { width: m, height: m, viewBox: "0 0 32 32", children: /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: t.accent }) }),
3664
- a && !i && /* @__PURE__ */ e(
3673
+ a && !l && /* @__PURE__ */ e(
3665
3674
  "div",
3666
3675
  {
3667
3676
  className: "absolute inset-0 rounded-full",
@@ -3704,14 +3713,14 @@ function sn() {
3704
3713
  background: "var(--t-surface)"
3705
3714
  },
3706
3715
  children: [
3707
- /* @__PURE__ */ e(_, { w: 36, h: 36, className: "rounded-full shrink-0" }),
3716
+ /* @__PURE__ */ e(V, { w: 36, h: 36, className: "rounded-full shrink-0" }),
3708
3717
  /* @__PURE__ */ o("div", { className: "flex-1", children: [
3709
- /* @__PURE__ */ e(_, { w: 90, h: 14, className: "mb-1.5" }),
3710
- /* @__PURE__ */ e(_, { w: 60, h: 12 })
3718
+ /* @__PURE__ */ e(V, { w: 90, h: 14, className: "mb-1.5" }),
3719
+ /* @__PURE__ */ e(V, { w: 60, h: 12 })
3711
3720
  ] }),
3712
3721
  /* @__PURE__ */ o("div", { className: "text-right", children: [
3713
- /* @__PURE__ */ e(_, { w: 40, h: 10, className: "mb-1.5" }),
3714
- /* @__PURE__ */ e(_, { w: 80, h: 14 })
3722
+ /* @__PURE__ */ e(V, { w: 40, h: 10, className: "mb-1.5" }),
3723
+ /* @__PURE__ */ e(V, { w: 80, h: 14 })
3715
3724
  ] })
3716
3725
  ]
3717
3726
  },
@@ -3723,15 +3732,15 @@ function gn({
3723
3732
  onSelect: a,
3724
3733
  quotes: n,
3725
3734
  quotesLoading: r,
3726
- cryptoCurrency: i
3735
+ cryptoCurrency: l
3727
3736
  }) {
3728
- const [c, m] = v(""), s = Y(() => {
3737
+ const [c, m] = S(""), s = Y(() => {
3729
3738
  if (!(n != null && n.quotes)) return [];
3730
3739
  const u = c.trim().toLowerCase();
3731
3740
  return u ? n.quotes.filter((f) => f.gatewayName.toLowerCase().includes(u)) : n.quotes;
3732
3741
  }, [n, c]);
3733
3742
  return /* @__PURE__ */ o(J, { children: [
3734
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(De, { onClick: t }) }),
3743
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Le, { onClick: t }) }),
3735
3744
  /* @__PURE__ */ e(
3736
3745
  "h2",
3737
3746
  {
@@ -3766,7 +3775,7 @@ function gn({
3766
3775
  /* @__PURE__ */ o("div", { className: "text-right shrink-0", children: [
3767
3776
  /* @__PURE__ */ e("div", { className: "text-[11px]", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
3768
3777
  /* @__PURE__ */ o("div", { className: "font-medium text-[14px]", style: { color: "var(--t-text)" }, children: [
3769
- i,
3778
+ l,
3770
3779
  " ",
3771
3780
  p
3772
3781
  ] })
@@ -3807,7 +3816,7 @@ export {
3807
3816
  Pe as ChevronDown,
3808
3817
  Pt as ChevronRight,
3809
3818
  gn as ChooseRampModal,
3810
- De as CloseButton,
3819
+ Le as CloseButton,
3811
3820
  pn as CoinifyIcon,
3812
3821
  ja as CompleteStep,
3813
3822
  $a as ConfirmStep,
@@ -3835,7 +3844,7 @@ export {
3835
3844
  Mt as SKINS,
3836
3845
  Ke as SearchInput,
3837
3846
  en as SettingsScreen,
3838
- _ as Skeleton,
3847
+ V as Skeleton,
3839
3848
  xn as SkinSwatch,
3840
3849
  Ja as ToggleSwitch,
3841
3850
  lt as formatOutput,
@@ -3849,7 +3858,7 @@ export {
3849
3858
  Ea as parseAmount,
3850
3859
  ya as useCheckoutIntent,
3851
3860
  pa as useQuotes,
3852
- Ue as useRamp,
3861
+ ke as useRamp,
3853
3862
  ha as useRampConfig,
3854
3863
  xa as useTransaction
3855
3864
  };