@nowramp/form 0.1.36 → 0.1.37

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
@@ -4,105 +4,105 @@
4
4
  if(document.getElementById(id))return;
5
5
  var s=document.createElement('style');
6
6
  s.id=id;
7
- s.textContent=`@layer nowramp-form{.theme-dark{--t-bg: #000000;--t-surface: rgba(255,255,255,.1);--t-surface-hover: rgba(255,255,255,.14);--t-text: #ffffff;--t-text-secondary: rgba(255,255,255,.4);--t-text-tertiary: rgba(255,255,255,.3);--t-text-muted: rgba(255,255,255,.5);--t-border: rgba(255,255,255,.2);--t-border-focus: rgba(255,255,255,.5);--t-pill-bg: rgba(255,255,255,.1);--t-pill-hover: rgba(255,255,255,.15);--t-badge-bg: rgba(255,255,255,.15);--t-divider: rgba(255,255,255,.2);--t-close-bg: rgba(255,255,255,.1);--t-close-hover: rgba(255,255,255,.2);--t-icon-stroke: rgba(255,255,255,.4);--t-icon-close: rgba(255,255,255,.6);--t-accent: #0077FF;--t-cta-bg: var(--t-accent);--t-cta-text: #ffffff;--t-cta-hover: rgba(255,255,255,.9);--t-cta-active: rgba(255,255,255,.8);--t-modal-bg: #000000;--t-chain-border: #000000;--t-skeleton-from: rgba(255,255,255,.06);--t-skeleton-mid: rgba(255,255,255,.12);--t-scrollbar: rgba(255,255,255,.15);--t-card-icon-bg: rgba(255,255,255,.1);--t-card-icon-stroke: rgba(255,255,255,.6);--t-success: #10b981;--t-error: #EF4444}.theme-light{--t-bg: #F2F3F5;--t-surface: rgba(0,0,0,.05);--t-surface-hover: rgba(0,0,0,.08);--t-text: #111111;--t-text-secondary: rgba(0,0,0,.45);--t-text-tertiary: rgba(0,0,0,.3);--t-text-muted: rgba(0,0,0,.5);--t-border: rgba(0,0,0,.12);--t-border-focus: rgba(0,0,0,.3);--t-pill-bg: rgba(0,0,0,.06);--t-pill-hover: rgba(0,0,0,.1);--t-badge-bg: rgba(0,0,0,.08);--t-divider: rgba(0,0,0,.1);--t-close-bg: rgba(0,0,0,.06);--t-close-hover: rgba(0,0,0,.12);--t-icon-stroke: rgba(0,0,0,.35);--t-icon-close: rgba(0,0,0,.5);--t-accent: #0077FF;--t-cta-bg: var(--t-accent);--t-cta-text: #ffffff;--t-cta-hover: #222222;--t-cta-active: #333333;--t-modal-bg: #F2F3F5;--t-chain-border: #F2F3F5;--t-skeleton-from: rgba(0,0,0,.04);--t-skeleton-mid: rgba(0,0,0,.08);--t-scrollbar: rgba(0,0,0,.12);--t-card-icon-bg: rgba(0,0,0,.06);--t-card-icon-stroke: rgba(0,0,0,.5);--t-success: #10b981;--t-error: #EF4444}.custom-scroll::-webkit-scrollbar{width:4px}.custom-scroll::-webkit-scrollbar-track{background:transparent}.custom-scroll::-webkit-scrollbar-thumb{background:var(--t-scrollbar);border-radius:2px}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.skeleton{background:linear-gradient(90deg,var(--t-skeleton-from) 25%,var(--t-skeleton-mid) 50%,var(--t-skeleton-from) 75%);background-size:200% 100%;animation:shimmer 1.5s ease-in-out infinite;border-radius:4px}@keyframes fadeIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.tab-fade-in{animation:fadeIn .3s ease-out both}.digit-slot{display:inline-block;overflow:hidden;vertical-align:top}.digit-slot-inner{transition:transform .35s cubic-bezier(.33,1,.68,1)}@keyframes nramp-spin{to{transform:rotate(360deg)}}.nramp-spinner{width:40px;height:40px;border:3px solid var(--t-border);border-top-color:var(--t-accent);border-radius:50%;animation:nramp-spin .8s linear infinite;margin:0 auto}.nramp-spinner-large{width:60px;height:60px;border-width:4px}.nramp-spinner-inline{width:16px;height:16px;border-width:2px;display:inline-block}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.right-3{right:.75rem}.top-0{top:0}.top-1\\/2{top:50%}.top-\\[3px\\]{top:3px}.z-20{z-index:20}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-2\\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mr-0\\.5{margin-right:.125rem}.mr-3{margin-right:.75rem}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-\\[2px\\]{margin-top:2px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-\\[640px\\]{height:640px}.h-full{height:100%}.min-h-\\[640px\\]{min-height:640px}.w-0{width:0px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\\[390px\\]{max-width:390px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-3\\.5{gap:.875rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-white\\/20{border-color:#fff3}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-12{padding:3rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\\[18px\\]{padding-left:18px;padding-right:18px}.px-\\[2px\\]{padding-left:2px;padding-right:2px}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\\.5{padding-top:.875rem;padding-bottom:.875rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-1{padding-bottom:.25rem}.pb-2\\.5{padding-bottom:.625rem}.pb-5{padding-bottom:1.25rem}.pb-\\[14px\\]{padding-bottom:14px}.pb-\\[18px\\]{padding-bottom:18px}.pt-3{padding-top:.75rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.pt-\\[12px\\]{padding-top:12px}.pt-\\[14px\\]{padding-top:14px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.text-\\[17px\\]{font-size:17px}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.text-\\[48px\\]{font-size:48px}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.lowercase{text-transform:lowercase}.leading-tight{line-height:1.25}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.hover\\:opacity-70:hover{opacity:.7}
7
+ s.textContent=`@layer nowramp-form{.theme-dark{--t-bg: #000000;--t-surface: rgba(255,255,255,.1);--t-surface-hover: rgba(255,255,255,.14);--t-text: #ffffff;--t-text-secondary: rgba(255,255,255,.4);--t-text-tertiary: rgba(255,255,255,.3);--t-text-muted: rgba(255,255,255,.5);--t-border: rgba(255,255,255,.2);--t-border-focus: rgba(255,255,255,.5);--t-pill-bg: rgba(255,255,255,.1);--t-pill-hover: rgba(255,255,255,.15);--t-badge-bg: rgba(255,255,255,.15);--t-divider: rgba(255,255,255,.2);--t-close-bg: rgba(255,255,255,.1);--t-close-hover: rgba(255,255,255,.2);--t-icon-stroke: rgba(255,255,255,.4);--t-icon-close: rgba(255,255,255,.6);--t-accent: #0077FF;--t-cta-bg: var(--t-accent);--t-cta-text: #ffffff;--t-cta-hover: rgba(255,255,255,.9);--t-cta-active: rgba(255,255,255,.8);--t-modal-bg: #000000;--t-chain-border: #000000;--t-skeleton-from: rgba(255,255,255,.06);--t-skeleton-mid: rgba(255,255,255,.12);--t-scrollbar: rgba(255,255,255,.15);--t-card-icon-bg: rgba(255,255,255,.1);--t-card-icon-stroke: rgba(255,255,255,.6);--t-success: #10b981;--t-error: #EF4444}.theme-light{--t-bg: #F2F3F5;--t-surface: rgba(0,0,0,.05);--t-surface-hover: rgba(0,0,0,.08);--t-text: #111111;--t-text-secondary: rgba(0,0,0,.45);--t-text-tertiary: rgba(0,0,0,.3);--t-text-muted: rgba(0,0,0,.5);--t-border: rgba(0,0,0,.12);--t-border-focus: rgba(0,0,0,.3);--t-pill-bg: rgba(0,0,0,.06);--t-pill-hover: rgba(0,0,0,.1);--t-badge-bg: rgba(0,0,0,.08);--t-divider: rgba(0,0,0,.1);--t-close-bg: rgba(0,0,0,.06);--t-close-hover: rgba(0,0,0,.12);--t-icon-stroke: rgba(0,0,0,.35);--t-icon-close: rgba(0,0,0,.5);--t-accent: #0077FF;--t-cta-bg: var(--t-accent);--t-cta-text: #ffffff;--t-cta-hover: #222222;--t-cta-active: #333333;--t-modal-bg: #F2F3F5;--t-chain-border: #F2F3F5;--t-skeleton-from: rgba(0,0,0,.04);--t-skeleton-mid: rgba(0,0,0,.08);--t-scrollbar: rgba(0,0,0,.12);--t-card-icon-bg: rgba(0,0,0,.06);--t-card-icon-stroke: rgba(0,0,0,.5);--t-success: #10b981;--t-error: #EF4444}.custom-scroll::-webkit-scrollbar{width:4px}.custom-scroll::-webkit-scrollbar-track{background:transparent}.custom-scroll::-webkit-scrollbar-thumb{background:var(--t-scrollbar);border-radius:2px}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.skeleton{background:linear-gradient(90deg,var(--t-skeleton-from) 25%,var(--t-skeleton-mid) 50%,var(--t-skeleton-from) 75%);background-size:200% 100%;animation:shimmer 1.5s ease-in-out infinite;border-radius:4px}@keyframes fadeIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.tab-fade-in{animation:fadeIn .3s ease-out both}.digit-slot{display:inline-block;overflow:hidden;vertical-align:top}.digit-slot-inner{transition:transform .35s cubic-bezier(.33,1,.68,1)}@keyframes nramp-spin{to{transform:rotate(360deg)}}.nramp-spinner{width:40px;height:40px;border:3px solid var(--t-border);border-top-color:var(--t-accent);border-radius:50%;animation:nramp-spin .8s linear infinite;margin:0 auto}.nramp-spinner-large{width:60px;height:60px;border-width:4px}.nramp-spinner-inline{width:16px;height:16px;border-width:2px;display:inline-block}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.right-3{right:.75rem}.top-0{top:0}.top-1\\/2{top:50%}.top-\\[3px\\]{top:3px}.z-20{z-index:20}.mx-5{margin-left:1.25rem;margin-right:1.25rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-2\\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mr-0\\.5{margin-right:.125rem}.mr-3{margin-right:.75rem}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-\\[2px\\]{margin-top:2px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-\\[640px\\]{height:640px}.h-full{height:100%}.min-h-\\[640px\\]{min-height:640px}.w-0{width:0px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\\[390px\\]{max-width:390px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-3\\.5{gap:.875rem}.gap-4{gap:1rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-white\\/20{border-color:#fff3}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.p-12{padding:3rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\\[18px\\]{padding-left:18px;padding-right:18px}.px-\\[2px\\]{padding-left:2px;padding-right:2px}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\\.5{padding-top:.875rem;padding-bottom:.875rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-1{padding-bottom:.25rem}.pb-2\\.5{padding-bottom:.625rem}.pb-5{padding-bottom:1.25rem}.pb-\\[14px\\]{padding-bottom:14px}.pb-\\[18px\\]{padding-bottom:18px}.pt-3{padding-top:.75rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.pt-\\[12px\\]{padding-top:12px}.pt-\\[14px\\]{padding-top:14px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.text-\\[17px\\]{font-size:17px}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.text-\\[48px\\]{font-size:48px}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.lowercase{text-transform:lowercase}.leading-tight{line-height:1.25}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.hover\\:opacity-70:hover{opacity:.7}
8
8
  }`;
9
9
  document.head.appendChild(s);
10
10
  })();
11
- import { jsx as e, jsxs as o, Fragment as le } from "react/jsx-runtime";
12
- import Ue, { useState as C, useRef as U, useCallback as $, useEffect as H, useMemo as X, useReducer as St, useContext as wt, createContext as Tt } from "react";
13
- import { RampApi as ke } from "@nowramp/sdk";
14
- function Rt(t, a) {
15
- const [n, l] = C(null), [r, d] = C(!0), [u, m] = C(null), c = U(null);
16
- (!c.current || c.current !== t) && (c.current = new ke({ apiKey: "", ...t }));
17
- const i = $(async () => {
11
+ import { jsx as e, jsxs as l, Fragment as J } from "react/jsx-runtime";
12
+ import ke, { useState as N, useRef as D, useCallback as _, useEffect as U, useMemo as F, useReducer as Rt, useContext as kt, createContext as Lt } from "react";
13
+ import { RampApi as Me } from "@nowramp/sdk";
14
+ function It(t, a) {
15
+ const [n, s] = N(null), [r, u] = N(!0), [m, i] = N(null), o = D(null);
16
+ (!o.current || o.current !== t) && (o.current = new Me({ apiKey: "", ...t }));
17
+ const d = _(async () => {
18
18
  if (!t.projectId) {
19
- m(new Error("projectId is required")), d(!1);
19
+ i(new Error("projectId is required")), u(!1);
20
20
  return;
21
21
  }
22
- d(!0), m(null);
22
+ u(!0), i(null);
23
23
  try {
24
- const h = await c.current.getSupported(a);
25
- l(h);
24
+ const h = await o.current.getSupported(a);
25
+ s(h);
26
26
  } catch (h) {
27
- m(h instanceof Error ? h : new Error("Failed to fetch config"));
27
+ i(h instanceof Error ? h : new Error("Failed to fetch config"));
28
28
  } finally {
29
- d(!1);
29
+ u(!1);
30
30
  }
31
31
  }, [t.projectId, a]);
32
- return H(() => {
33
- i();
34
- }, [i]), { config: n, loading: r, error: u, refetch: i };
32
+ return U(() => {
33
+ d();
34
+ }, [d]), { config: n, loading: r, error: m, refetch: d };
35
35
  }
36
- function kt(t, a) {
37
- const [n, l] = C(null), [r, d] = C(!1), [u, m] = C(null), c = U(null), i = U(""), h = `${t.apiUrl}|${t.projectId}`;
38
- (!c.current || i.current !== h) && (c.current = new ke({ apiKey: "", ...t }), i.current = h);
39
- const f = U(0);
40
- H(() => {
36
+ function Mt(t, a) {
37
+ const [n, s] = N(null), [r, u] = N(!1), [m, i] = N(null), o = D(null), d = D(""), h = `${t.apiUrl}|${t.projectId}`;
38
+ (!o.current || d.current !== h) && (o.current = new Me({ apiKey: "", ...t }), d.current = h);
39
+ const f = D(0);
40
+ U(() => {
41
41
  const g = ++f.current;
42
42
  if (!a || !t.projectId) {
43
- l(null), d(!1);
43
+ s(null), u(!1);
44
44
  return;
45
45
  }
46
- d(!0), m(null), c.current.getQuotes(a).then(
46
+ u(!0), i(null), o.current.getQuotes(a).then(
47
47
  (p) => {
48
- f.current === g && (l(p), d(!1));
48
+ f.current === g && (s(p), u(!1));
49
49
  },
50
50
  (p) => {
51
- f.current === g && (m(p instanceof Error ? p : new Error("Failed to fetch quotes")), l(null), d(!1));
51
+ f.current === g && (i(p instanceof Error ? p : new Error("Failed to fetch quotes")), s(null), u(!1));
52
52
  }
53
53
  );
54
54
  }, [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]);
55
- const x = $(async () => {
55
+ const x = _(async () => {
56
56
  if (!(!a || !t.projectId)) {
57
- d(!0), m(null);
57
+ u(!0), i(null);
58
58
  try {
59
- const g = await c.current.getQuotes(a);
60
- l(g);
59
+ const g = await o.current.getQuotes(a);
60
+ s(g);
61
61
  } catch (g) {
62
- m(g instanceof Error ? g : new Error("Failed to fetch quotes"));
62
+ i(g instanceof Error ? g : new Error("Failed to fetch quotes"));
63
63
  } finally {
64
- d(!1);
64
+ u(!1);
65
65
  }
66
66
  }
67
67
  }, [t.projectId, a]);
68
- return { quotes: n, loading: r, error: u, refetch: x };
68
+ return { quotes: n, loading: r, error: m, refetch: x };
69
69
  }
70
- function Lt(t) {
71
- const [a, n] = C(null), [l, r] = C(!1), [d, u] = C(null), m = U(null), c = U(""), i = `${t.apiUrl}|${t.projectId}`;
72
- (!m.current || c.current !== i) && (m.current = new ke({ apiKey: "", ...t }), c.current = i);
73
- const h = $(async (x) => {
74
- r(!0), u(null);
70
+ function Bt(t) {
71
+ const [a, n] = N(null), [s, r] = N(!1), [u, m] = N(null), i = D(null), o = D(""), d = `${t.apiUrl}|${t.projectId}`;
72
+ (!i.current || o.current !== d) && (i.current = new Me({ apiKey: "", ...t }), o.current = d);
73
+ const h = _(async (x) => {
74
+ r(!0), m(null);
75
75
  try {
76
- const g = await m.current.createCheckoutIntent(x);
76
+ const g = await i.current.createCheckoutIntent(x);
77
77
  return n(g), g;
78
78
  } catch (g) {
79
79
  const p = g instanceof Error ? g : new Error("Failed to create checkout intent");
80
- throw u(p), p;
80
+ throw m(p), p;
81
81
  } finally {
82
82
  r(!1);
83
83
  }
84
- }, []), f = $(() => {
85
- n(null), u(null);
84
+ }, []), f = _(() => {
85
+ n(null), m(null);
86
86
  }, []);
87
- return { order: a, loading: l, error: d, createOrder: h, reset: f };
87
+ return { order: a, loading: s, error: u, createOrder: h, reset: f };
88
88
  }
89
- function It(t, a, n) {
90
- const [l, r] = C(null), [d, u] = C(!1), [m, c] = C(null), i = U(null);
91
- i.current || (i.current = new ke({ apiKey: "", projectId: "", ...t }));
92
- const h = $(async () => {
89
+ function Ot(t, a, n) {
90
+ const [s, r] = N(null), [u, m] = N(!1), [i, o] = N(null), d = D(null);
91
+ d.current || (d.current = new Me({ apiKey: "", projectId: "", ...t }));
92
+ const h = _(async () => {
93
93
  if (a) {
94
- u(!0), c(null);
94
+ m(!0), o(null);
95
95
  try {
96
- const f = await i.current.getTransaction(a);
96
+ const f = await d.current.getTransaction(a);
97
97
  r(f);
98
98
  } catch (f) {
99
- c(f instanceof Error ? f : new Error("Failed to fetch status"));
99
+ o(f instanceof Error ? f : new Error("Failed to fetch status"));
100
100
  } finally {
101
- u(!1);
101
+ m(!1);
102
102
  }
103
103
  }
104
104
  }, [a]);
105
- return H(() => {
105
+ return U(() => {
106
106
  if (!a) return;
107
107
  const f = (n == null ? void 0 : n.initialDelay) ?? 0;
108
108
  if (f > 0) {
@@ -110,21 +110,21 @@ function It(t, a, n) {
110
110
  return () => clearTimeout(x);
111
111
  }
112
112
  h();
113
- }, [h, a, n == null ? void 0 : n.initialDelay]), H(() => {
114
- if (!a || !(n != null && n.pollInterval) || !l || ["completed", "failed", "cancelled", "expired", "refunded"].includes(l.status))
113
+ }, [h, a, n == null ? void 0 : n.initialDelay]), U(() => {
114
+ if (!a || !(n != null && n.pollInterval) || !s || ["completed", "failed", "cancelled", "expired", "refunded"].includes(s.status))
115
115
  return;
116
116
  const x = setInterval(h, n.pollInterval);
117
117
  return () => clearInterval(x);
118
- }, [a, n == null ? void 0 : n.pollInterval, l == null ? void 0 : l.status, h]), { status: l, loading: d, error: m, refetch: h };
118
+ }, [a, n == null ? void 0 : n.pollInterval, s == null ? void 0 : s.status, h]), { status: s, loading: u, error: i, refetch: h };
119
119
  }
120
- function rt(t, a) {
120
+ function lt(t, a) {
121
121
  if (!t) return t;
122
122
  const n = t.indexOf(".");
123
123
  if (n === -1) return t;
124
- let l = t;
125
- return l.length - n - 1 > a && (l = l.slice(0, n + a + 1)), l = l.replace(/0+$/, "").replace(/\.$/, ""), l;
124
+ let s = t;
125
+ return s.length - n - 1 > a && (s = s.slice(0, n + a + 1)), s = s.replace(/0+$/, "").replace(/\.$/, ""), s;
126
126
  }
127
- const mt = {
127
+ const ht = {
128
128
  step: "amount",
129
129
  flowType: "buy",
130
130
  fiatCurrency: "USD",
@@ -142,7 +142,7 @@ const mt = {
142
142
  country: "",
143
143
  errorMessage: null
144
144
  };
145
- function Bt(t, a) {
145
+ function Pt(t, a) {
146
146
  switch (a.type) {
147
147
  case "SET_STEP":
148
148
  return { ...t, step: a.step, errorMessage: null };
@@ -152,6 +152,7 @@ function Bt(t, a) {
152
152
  flowType: a.flowType,
153
153
  fiatAmount: "",
154
154
  cryptoAmount: "",
155
+ paymentMethodId: "",
155
156
  selectedQuote: null,
156
157
  selectedProvider: null,
157
158
  errorMessage: null
@@ -191,880 +192,193 @@ function Bt(t, a) {
191
192
  case "CLEAR_ERROR":
192
193
  return { ...t, errorMessage: null };
193
194
  case "RESET":
194
- return mt;
195
+ return ht;
195
196
  default:
196
197
  return t;
197
198
  }
198
199
  }
199
- const pt = Tt(null);
200
- function Mt({
200
+ const ft = Lt(null);
201
+ function Ht({
201
202
  projectId: t,
202
203
  apiUrl: a = "https://api.nowramp.com",
203
204
  assetBaseUrl: n = "",
204
- flowType: l = "buy",
205
+ flowType: s = "buy",
205
206
  customerId: r = "",
206
- defaultFiatCurrency: d = "USD",
207
- defaultCryptoCurrency: u = "BTC",
208
- defaultNetwork: m = "",
209
- defaultFiatAmount: c = "",
210
- defaultCryptoAmount: i = "",
207
+ defaultFiatCurrency: u = "USD",
208
+ defaultCryptoCurrency: m = "BTC",
209
+ defaultNetwork: i = "",
210
+ defaultFiatAmount: o = "",
211
+ defaultCryptoAmount: d = "",
211
212
  defaultWalletAddress: h = "",
212
213
  defaultGateway: f,
213
214
  fieldLocks: x,
214
215
  statusPollInterval: g = 5e3,
215
216
  onComplete: p,
216
217
  onError: b,
217
- children: L
218
+ children: S
218
219
  }) {
219
- const O = X(() => ({ apiUrl: a, projectId: t }), [a, t]), A = m || (u ? u.toLowerCase() : ""), G = l === "sell", j = G ? !!i : !!c, Z = (G ? !!(j && u && A) : !!(j && u && A && h)) && f ? "confirm" : "amount", [s, P] = St(Bt, {
220
- ...mt,
221
- step: Z,
222
- flowType: l,
223
- fiatCurrency: d,
224
- cryptoCurrency: u,
225
- network: A,
226
- fiatAmount: rt(c, 2),
227
- cryptoAmount: rt(i, 6),
220
+ const P = F(() => ({ apiUrl: a, projectId: t }), [a, t]), w = i || (m ? m.toLowerCase() : ""), G = s === "sell", Q = G ? !!d : !!o, z = (G ? !!(Q && m && w) : !!(Q && m && w && h)) && f ? "confirm" : "amount", [c, O] = Rt(Pt, {
221
+ ...ht,
222
+ step: z,
223
+ flowType: s,
224
+ fiatCurrency: u,
225
+ cryptoCurrency: m,
226
+ network: w,
227
+ fiatAmount: lt(o, 2),
228
+ cryptoAmount: lt(d, 6),
228
229
  walletAddress: h,
229
230
  customerId: r
230
- }), v = s.flowType === "sell", {
231
- config: I,
232
- loading: D,
233
- error: F
234
- } = Rt(O, s.flowType);
235
- Ue.useEffect(() => {
236
- var R, k, w;
237
- if (!I || !s.cryptoCurrency || s.network) return;
238
- const N = (R = I.cryptos) == null ? void 0 : R.find((_) => _.code === s.cryptoCurrency), S = ((k = N == null ? void 0 : N.networks) == null ? void 0 : k.find((_) => _.isDefault)) || ((w = N == null ? void 0 : N.networks) == null ? void 0 : w[0]);
239
- S != null && S.id && P({ type: "SET_NETWORK", network: S.id });
240
- }, [I, s.cryptoCurrency, s.network]);
241
- const K = X(() => {
242
- if (v) {
243
- if (!s.cryptoAmount) return null;
244
- const w = parseFloat(s.cryptoAmount);
245
- return isNaN(w) || w <= 0 ? "Enter a valid amount" : null;
231
+ }), C = c.flowType === "sell", {
232
+ config: L,
233
+ loading: K,
234
+ error: X
235
+ } = It(P, c.flowType);
236
+ ke.useEffect(() => {
237
+ var R, k, T;
238
+ if (!L || !c.cryptoCurrency || c.network) return;
239
+ const v = (R = L.cryptos) == null ? void 0 : R.find((H) => H.code === c.cryptoCurrency), E = ((k = v == null ? void 0 : v.networks) == null ? void 0 : k.find((H) => H.isDefault)) || ((T = v == null ? void 0 : v.networks) == null ? void 0 : T[0]);
240
+ E != null && E.id && O({ type: "SET_NETWORK", network: E.id });
241
+ }, [L, c.cryptoCurrency, c.network]), ke.useEffect(() => {
242
+ var k, T;
243
+ if (!((k = L == null ? void 0 : L.paymentMethods) != null && k.length)) return;
244
+ const v = c.fiatCurrency, E = L.paymentMethods;
245
+ if (c.paymentMethodId && E.some(
246
+ (W) => W.id === c.paymentMethodId && W.supportedFiats.includes(v)
247
+ ))
248
+ return;
249
+ const R = E.find((H) => H.supportedFiats.includes(v));
250
+ O({ type: "SET_PAYMENT_METHOD", methodId: (R == null ? void 0 : R.id) || ((T = E[0]) == null ? void 0 : T.id) || "" });
251
+ }, [L, c.fiatCurrency, c.paymentMethodId]);
252
+ const $ = F(() => {
253
+ if (C) {
254
+ if (!c.cryptoAmount) return null;
255
+ const T = parseFloat(c.cryptoAmount);
256
+ return isNaN(T) || T <= 0 ? "Enter a valid amount" : null;
246
257
  }
247
- if (!I || !s.fiatAmount) return null;
248
- const N = parseFloat(s.fiatAmount);
249
- if (isNaN(N)) return null;
250
- const S = I.fiats.find((w) => w.code === s.fiatCurrency);
251
- if (!S) return null;
252
- const R = parseFloat(S.minAmount), k = parseFloat(S.maxAmount);
253
- return !isNaN(R) && N < R ? `Minimum amount is ${S.minAmount} ${s.fiatCurrency}` : !isNaN(k) && N > k ? `Maximum amount is ${S.maxAmount} ${s.fiatCurrency}` : null;
254
- }, [I, s.fiatAmount, s.fiatCurrency, s.cryptoAmount, v]), ge = X(() => {
255
- const N = v ? !!s.cryptoAmount : !!s.fiatAmount;
256
- return !I || !N || !s.cryptoCurrency || !s.network || K ? null : {
257
- fiatCurrency: s.fiatCurrency,
258
- ...v ? { cryptoAmount: s.cryptoAmount } : { fiatAmount: s.fiatAmount },
259
- cryptoCurrency: s.cryptoCurrency,
260
- network: s.network,
261
- paymentMethodId: s.paymentMethodId || void 0,
262
- country: s.country || void 0,
263
- orderType: s.flowType
258
+ if (!L || !c.fiatAmount) return null;
259
+ const v = parseFloat(c.fiatAmount);
260
+ if (isNaN(v)) return null;
261
+ const E = L.fiats.find((T) => T.code === c.fiatCurrency);
262
+ if (!E) return null;
263
+ const R = parseFloat(E.minAmount), k = parseFloat(E.maxAmount);
264
+ return !isNaN(R) && v < R ? `Minimum amount is ${E.minAmount} ${c.fiatCurrency}` : !isNaN(k) && v > k ? `Maximum amount is ${E.maxAmount} ${c.fiatCurrency}` : null;
265
+ }, [L, c.fiatAmount, c.fiatCurrency, c.cryptoAmount, C]), Ne = F(() => {
266
+ const v = C ? !!c.cryptoAmount : !!c.fiatAmount;
267
+ return !L || !v || !c.cryptoCurrency || !c.network || $ ? null : {
268
+ fiatCurrency: c.fiatCurrency,
269
+ ...C ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
270
+ cryptoCurrency: c.cryptoCurrency,
271
+ network: c.network,
272
+ paymentMethodId: c.paymentMethodId || void 0,
273
+ country: c.country || void 0,
274
+ orderType: c.flowType
264
275
  };
265
- }, [I, s.fiatCurrency, s.fiatAmount, s.cryptoAmount, s.cryptoCurrency, s.network, s.paymentMethodId, s.country, K, v, s.flowType]), {
276
+ }, [L, c.fiatCurrency, c.fiatAmount, c.cryptoAmount, c.cryptoCurrency, c.network, c.paymentMethodId, c.country, $, C, c.flowType]), {
266
277
  quotes: he,
267
278
  loading: fe,
268
279
  error: Y,
269
280
  refetch: ye
270
- } = kt(O, ge), {
271
- order: ee,
272
- loading: ve,
273
- error: ce,
274
- createOrder: se
275
- } = Lt(O), Ne = 15e3, {
281
+ } = Mt(P, Ne), {
282
+ order: ae,
283
+ loading: Ce,
284
+ error: se,
285
+ createOrder: ce
286
+ } = Bt(P), be = 15e3, {
276
287
  status: V,
277
- loading: te
278
- } = It(
288
+ loading: ne
289
+ } = Ot(
279
290
  { apiUrl: a },
280
- (ee == null ? void 0 : ee.orderId) ?? null,
281
- { pollInterval: g, initialDelay: Ne }
291
+ (ae == null ? void 0 : ae.orderId) ?? null,
292
+ { pollInterval: g, initialDelay: be }
282
293
  );
283
- Ue.useEffect(() => {
294
+ ke.useEffect(() => {
284
295
  (V == null ? void 0 : V.status) === "completed" && p && p(V);
285
- }, [V == null ? void 0 : V.status, p]), Ue.useEffect(() => {
286
- const N = F || ce;
287
- N && b && b(N);
288
- }, [F, ce, b]);
289
- const ae = f || (I == null ? void 0 : I.defaultGateway) || null, Ce = U(ae);
290
- Ce.current = ae;
291
- const be = U(he);
292
- be.current = he;
293
- const Ee = $(async () => {
294
- var S, R, k;
295
- const N = ((S = s.selectedQuote) == null ? void 0 : S.gatewayId) || ((k = (R = be.current) == null ? void 0 : R.bestQuote) == null ? void 0 : k.gatewayId) || Ce.current;
296
- if (!N || !s.walletAddress) {
297
- const w = [!N && "gateway", !s.walletAddress && "walletAddress"].filter(Boolean).join(", ");
298
- P({ type: "SET_ERROR", message: `Missing required fields: ${w}` });
296
+ }, [V == null ? void 0 : V.status, p]), ke.useEffect(() => {
297
+ const v = X || se;
298
+ v && b && b(v);
299
+ }, [X, se, b]);
300
+ const re = f || (L == null ? void 0 : L.defaultGateway) || null, Ee = D(re);
301
+ Ee.current = re;
302
+ const Ae = D(he);
303
+ Ae.current = he;
304
+ const we = _(async () => {
305
+ var E, R, k;
306
+ const v = ((E = c.selectedQuote) == null ? void 0 : E.gatewayId) || ((k = (R = Ae.current) == null ? void 0 : R.bestQuote) == null ? void 0 : k.gatewayId) || Ee.current;
307
+ if (!v || !c.walletAddress) {
308
+ const T = [!v && "gateway", !c.walletAddress && "walletAddress"].filter(Boolean).join(", ");
309
+ O({ type: "SET_ERROR", message: `Missing required fields: ${T}` });
299
310
  return;
300
311
  }
301
312
  try {
302
- await se({
303
- gateway: N,
304
- customerId: s.customerId || void 0,
305
- fiatCurrency: s.fiatCurrency,
306
- ...v ? { cryptoAmount: s.cryptoAmount } : { fiatAmount: s.fiatAmount },
307
- cryptoCurrency: s.cryptoCurrency,
308
- network: s.network,
309
- walletAddress: s.walletAddress,
310
- paymentMethodId: s.paymentMethodId || void 0,
311
- email: s.email || void 0,
312
- orderType: s.flowType
313
- }), P({ type: "SET_STEP", step: "checkout" });
314
- } catch (w) {
315
- const _ = w instanceof Error ? w.message : "Failed to create order";
316
- /wallet|address/i.test(_) ? P({ type: "SET_WALLET_ERROR", message: _.replace(/^Failed to create checkout intent:\s*/i, "") }) : P({ type: "SET_ERROR", message: _ });
313
+ await ce({
314
+ gateway: v,
315
+ customerId: c.customerId || void 0,
316
+ fiatCurrency: c.fiatCurrency,
317
+ ...C ? { cryptoAmount: c.cryptoAmount } : { fiatAmount: c.fiatAmount },
318
+ cryptoCurrency: c.cryptoCurrency,
319
+ network: c.network,
320
+ walletAddress: c.walletAddress,
321
+ paymentMethodId: c.paymentMethodId || void 0,
322
+ email: c.email || void 0,
323
+ orderType: c.flowType
324
+ }), O({ type: "SET_STEP", step: "checkout" });
325
+ } catch (T) {
326
+ const H = T instanceof Error ? T.message : "Failed to create order";
327
+ /wallet|address/i.test(H) ? O({ type: "SET_WALLET_ERROR", message: H.replace(/^Failed to create checkout intent:\s*/i, "") }) : O({ type: "SET_ERROR", message: H });
317
328
  }
318
- }, [s, se, v]), J = $((N) => {
319
- P({ type: "SET_STEP", step: N });
320
- }, []), ie = $(() => {
321
- const N = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], S = N.indexOf(s.step);
322
- S > 0 && P({ type: "SET_STEP", step: N[S - 1] });
323
- }, [s.step, v]), Ie = X(() => {
324
- const N = v ? !!s.cryptoAmount : !!s.fiatAmount;
325
- switch (s.step) {
329
+ }, [c, ce, C]), q = _((v) => {
330
+ O({ type: "SET_STEP", step: v });
331
+ }, []), ie = _(() => {
332
+ const v = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], E = v.indexOf(c.step);
333
+ E > 0 && O({ type: "SET_STEP", step: v[E - 1] });
334
+ }, [c.step, C]), Oe = F(() => {
335
+ const v = C ? !!c.cryptoAmount : !!c.fiatAmount;
336
+ switch (c.step) {
326
337
  case "confirm":
327
- return !!(N && s.cryptoCurrency && s.network && s.walletAddress && !K);
338
+ return !!(v && c.cryptoCurrency && c.network && c.walletAddress && !$);
328
339
  case "amount":
329
- return !!(N && s.cryptoCurrency && s.network && !K);
340
+ return !!(v && c.cryptoCurrency && c.network && !$);
330
341
  case "quotes":
331
- return !!s.selectedQuote;
342
+ return !!c.selectedQuote;
332
343
  case "wallet":
333
- return !!s.walletAddress;
344
+ return !!c.walletAddress;
334
345
  default:
335
346
  return !1;
336
347
  }
337
- }, [s, K, v]), xe = {
338
- apiConfig: O,
348
+ }, [c, $, C]), xe = {
349
+ apiConfig: P,
339
350
  assetBaseUrl: n,
340
- config: I,
341
- configLoading: D,
342
- configError: F,
343
- state: s,
344
- dispatch: P,
351
+ config: L,
352
+ configLoading: K,
353
+ configError: X,
354
+ state: c,
355
+ dispatch: O,
345
356
  quotes: he,
346
357
  quotesLoading: fe,
347
358
  quotesError: Y,
348
359
  fetchQuotes: ye,
349
- order: ee,
350
- orderLoading: ve,
351
- orderError: ce,
352
- createOrder: Ee,
360
+ order: ae,
361
+ orderLoading: Ce,
362
+ orderError: se,
363
+ createOrder: we,
353
364
  orderStatus: V,
354
- orderStatusLoading: te,
365
+ orderStatusLoading: ne,
355
366
  fieldLocks: x || null,
356
- defaultGateway: ae,
357
- amountError: K,
358
- goToStep: J,
367
+ defaultGateway: re,
368
+ amountError: $,
369
+ goToStep: q,
359
370
  goBack: ie,
360
- canProceed: Ie
371
+ canProceed: Oe
361
372
  };
362
- return /* @__PURE__ */ e(pt.Provider, { value: xe, children: L });
373
+ return /* @__PURE__ */ e(ft.Provider, { value: xe, children: S });
363
374
  }
364
375
  function pe() {
365
- const t = wt(pt);
376
+ const t = kt(ft);
366
377
  if (!t)
367
378
  throw new Error("useRamp must be used within a RampProvider");
368
379
  return t;
369
380
  }
370
- function Ot({
371
- className: t = "",
372
- iframeHeight: a = 600,
373
- autoRedirect: n = !1,
374
- redirectDelay: l = 3e3
375
- }) {
376
- var g;
377
- const { order: r, orderStatus: d, goToStep: u, goBack: m } = pe(), [c, i] = C(!1), [h, f] = C(null), x = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
378
- if (H(() => {
379
- if ((r == null ? void 0 : r.checkout.method) === "redirect" && n && !x) {
380
- f(Math.ceil(l / 1e3));
381
- const p = setTimeout(() => {
382
- window.location.href = r.checkout.url;
383
- }, l), b = setInterval(() => {
384
- f((L) => L && L > 1 ? L - 1 : null);
385
- }, 1e3);
386
- return () => {
387
- clearTimeout(p), clearInterval(b);
388
- };
389
- }
390
- }, [r, n, l, x]), H(() => {
391
- d && (d.status === "completed" ? u("complete") : ["failed", "cancelled", "expired"].includes(d.status) && u("error"));
392
- }, [d == null ? void 0 : d.status, u]), !r)
393
- return /* @__PURE__ */ o(
394
- "div",
395
- {
396
- className: `flex flex-col items-center justify-center p-8 ${t}`,
397
- style: { color: "var(--t-text)" },
398
- children: [
399
- /* @__PURE__ */ e("p", { className: "text-[15px] mb-4", children: "No order found" }),
400
- /* @__PURE__ */ e(
401
- "button",
402
- {
403
- className: "font-semibold text-[14px] transition-all",
404
- style: {
405
- height: 48,
406
- borderRadius: 5,
407
- background: "var(--t-surface)",
408
- color: "var(--t-text)",
409
- paddingLeft: 24,
410
- paddingRight: 24
411
- },
412
- onClick: m,
413
- children: "Go Back"
414
- }
415
- )
416
- ]
417
- }
418
- );
419
- if (x)
420
- return /* @__PURE__ */ o(
421
- "div",
422
- {
423
- className: `flex flex-col items-center justify-center p-8 text-center ${t}`,
424
- style: { color: "var(--t-text)" },
425
- children: [
426
- /* @__PURE__ */ e("h3", { className: "text-[18px] font-semibold mb-2", children: "Checkout expired" }),
427
- /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: "The session has expired. Please try again." }),
428
- /* @__PURE__ */ e(
429
- "button",
430
- {
431
- className: "w-full font-semibold text-[16px] transition-all",
432
- style: {
433
- height: 60,
434
- borderRadius: 5,
435
- background: "var(--t-cta-bg)",
436
- color: "var(--t-cta-text)"
437
- },
438
- onClick: m,
439
- children: "Start over"
440
- }
441
- )
442
- ]
443
- }
444
- );
445
- if (r.checkout.method === "iframe")
446
- return /* @__PURE__ */ e("div", { className: `flex flex-col flex-1 ${t}`, children: /* @__PURE__ */ o(
447
- "div",
448
- {
449
- className: "relative flex-1",
450
- style: {
451
- height: a,
452
- borderRadius: 5,
453
- overflow: "hidden",
454
- background: "var(--t-surface)"
455
- },
456
- children: [
457
- !c && /* @__PURE__ */ o("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
458
- /* @__PURE__ */ e("div", { className: "nramp-spinner" }),
459
- /* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading checkout..." })
460
- ] }),
461
- /* @__PURE__ */ e(
462
- "iframe",
463
- {
464
- src: r.checkout.url,
465
- style: {
466
- display: c ? "block" : "none",
467
- width: "100%",
468
- height: "100%",
469
- border: "none"
470
- },
471
- allow: ((g = r.checkout.allowedFeatures) == null ? void 0 : g.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
472
- onLoad: () => i(!0),
473
- title: "Provider Checkout"
474
- }
475
- )
476
- ]
477
- }
478
- ) });
479
- if (r.checkout.method === "redirect")
480
- return /* @__PURE__ */ o(
481
- "div",
482
- {
483
- className: `flex flex-col items-center justify-center p-8 text-center ${t}`,
484
- style: { color: "var(--t-text)" },
485
- children: [
486
- /* @__PURE__ */ e("div", { className: "text-[48px] mb-4", children: "🔗" }),
487
- /* @__PURE__ */ e("h3", { className: "text-[18px] font-semibold mb-2", children: "Complete Payment" }),
488
- /* @__PURE__ */ o("p", { className: "text-[14px] mb-4", style: { color: "var(--t-text-secondary)" }, children: [
489
- "You'll be redirected to ",
490
- r.gateway,
491
- " to complete your payment."
492
- ] }),
493
- h !== null && /* @__PURE__ */ o("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: [
494
- "Redirecting in ",
495
- h,
496
- "..."
497
- ] }),
498
- /* @__PURE__ */ o(
499
- "a",
500
- {
501
- href: r.checkout.url,
502
- className: "w-full font-semibold text-[16px] flex items-center justify-center transition-all",
503
- style: {
504
- height: 60,
505
- borderRadius: 5,
506
- background: "var(--t-cta-bg)",
507
- color: "var(--t-cta-text)",
508
- textDecoration: "none"
509
- },
510
- target: "_blank",
511
- rel: "noopener noreferrer",
512
- children: [
513
- "Continue to ",
514
- r.gateway
515
- ]
516
- }
517
- ),
518
- /* @__PURE__ */ e(
519
- "button",
520
- {
521
- className: "w-full font-semibold text-[14px] mt-2 transition-all",
522
- style: {
523
- height: 48,
524
- borderRadius: 5,
525
- background: "var(--t-surface)",
526
- color: "var(--t-text)"
527
- },
528
- onClick: m,
529
- children: "Cancel"
530
- }
531
- )
532
- ]
533
- }
534
- );
535
- if (r.checkout.method === "widget" && r.widgetConfig) {
536
- const p = Pt(r.checkout.url, r.widgetConfig);
537
- return /* @__PURE__ */ e("div", { className: `flex flex-col flex-1 ${t}`, children: /* @__PURE__ */ o(
538
- "div",
539
- {
540
- className: "relative flex-1",
541
- style: {
542
- height: a,
543
- borderRadius: 5,
544
- overflow: "hidden",
545
- background: "var(--t-surface)"
546
- },
547
- children: [
548
- !c && /* @__PURE__ */ o("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
549
- /* @__PURE__ */ e("div", { className: "nramp-spinner" }),
550
- /* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading checkout..." })
551
- ] }),
552
- /* @__PURE__ */ e(
553
- "iframe",
554
- {
555
- src: p,
556
- style: {
557
- display: c ? "block" : "none",
558
- width: "100%",
559
- height: "100%",
560
- border: "none"
561
- },
562
- allow: "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
563
- onLoad: () => i(!0),
564
- title: "Payment Checkout"
565
- }
566
- )
567
- ]
568
- }
569
- ) });
570
- }
571
- return /* @__PURE__ */ o(
572
- "div",
573
- {
574
- className: `flex flex-col items-center justify-center p-8 ${t}`,
575
- style: { color: "var(--t-text)" },
576
- children: [
577
- /* @__PURE__ */ e("p", { className: "text-[15px] mb-4", children: "Unknown checkout method" }),
578
- /* @__PURE__ */ e(
579
- "button",
580
- {
581
- className: "font-semibold text-[14px] transition-all",
582
- style: {
583
- height: 48,
584
- borderRadius: 5,
585
- background: "var(--t-surface)",
586
- color: "var(--t-text)",
587
- paddingLeft: 24,
588
- paddingRight: 24
589
- },
590
- onClick: m,
591
- children: "Go Back"
592
- }
593
- )
594
- ]
595
- }
596
- );
597
- }
598
- function Pt(t, a) {
599
- const n = new URL("/en/partner/widget", t);
600
- for (const [l, r] of Object.entries(a))
601
- r != null && r !== "" && n.searchParams.set(l, String(r));
602
- return n.toString();
603
- }
604
- function Ht({ className: t = "" }) {
605
- const { orderStatus: a, orderStatusLoading: n, goToStep: l } = pe();
606
- H(() => {
607
- a && (a.status === "completed" ? l("complete") : ["failed", "cancelled", "expired", "refunded"].includes(a.status) && l("error"));
608
- }, [a == null ? void 0 : a.status, l]);
609
- const r = () => {
610
- if (!a) return "Processing your order...";
611
- switch (a.status) {
612
- case "pending":
613
- return "Waiting for payment confirmation...";
614
- case "processing":
615
- return "Processing your transaction...";
616
- default:
617
- return "Processing...";
618
- }
619
- };
620
- return /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center px-8 py-12 text-center ${t}`, children: [
621
- /* @__PURE__ */ e("div", { className: "mb-6", children: /* @__PURE__ */ e("div", { className: "nramp-spinner-large nramp-spinner" }) }),
622
- /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: r() }),
623
- n && /* @__PURE__ */ e("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: "Checking status..." }),
624
- a && /* @__PURE__ */ o("div", { className: "w-full mt-6 text-left", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
625
- /* @__PURE__ */ e(me, { label: "Order ID", value: a.orderId, mono: !0 }),
626
- /* @__PURE__ */ e(me, { label: "Provider", value: a.gateway }),
627
- /* @__PURE__ */ e(
628
- me,
629
- {
630
- label: "Amount",
631
- value: `${a.fiatAmount} ${a.fiatCurrency}`
632
- }
633
- ),
634
- /* @__PURE__ */ e(
635
- me,
636
- {
637
- label: "Receiving",
638
- value: `${a.cryptoAmount || "..."} ${a.cryptoCurrency}`
639
- }
640
- ),
641
- /* @__PURE__ */ e(me, { label: "Network", value: a.network }),
642
- /* @__PURE__ */ e(
643
- me,
644
- {
645
- label: "To Address",
646
- value: `${a.walletAddress.slice(0, 10)}...${a.walletAddress.slice(-8)}`,
647
- mono: !0
648
- }
649
- )
650
- ] }),
651
- /* @__PURE__ */ o("div", { className: "mt-6", children: [
652
- /* @__PURE__ */ e("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "This usually takes a few minutes." }),
653
- /* @__PURE__ */ e("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: "You can safely close this page - we'll send you an email when complete." })
654
- ] })
655
- ] });
656
- }
657
- function me({ label: t, value: a, mono: n }) {
658
- return /* @__PURE__ */ o(
659
- "div",
660
- {
661
- className: "flex justify-between items-center py-2",
662
- style: { borderBottom: "1px solid var(--t-divider)" },
663
- children: [
664
- /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
665
- /* @__PURE__ */ e(
666
- "span",
667
- {
668
- className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
669
- style: { color: "var(--t-text)" },
670
- children: a
671
- }
672
- )
673
- ]
674
- }
675
- );
676
- }
677
- function Ut({
678
- className: t = "",
679
- explorerUrl: a,
680
- onDone: n,
681
- doneButtonText: l = "Done"
682
- }) {
683
- const { orderStatus: r, state: d, dispatch: u } = pe(), m = d.flowType === "sell", c = () => {
684
- if (!(r != null && r.transactionHash)) return null;
685
- if (!a) {
686
- const f = {
687
- ethereum: "https://etherscan.io/tx/{txHash}",
688
- polygon: "https://polygonscan.com/tx/{txHash}",
689
- arbitrum: "https://arbiscan.io/tx/{txHash}",
690
- optimism: "https://optimistic.etherscan.io/tx/{txHash}",
691
- base: "https://basescan.org/tx/{txHash}",
692
- bitcoin: "https://mempool.space/tx/{txHash}",
693
- solana: "https://solscan.io/tx/{txHash}",
694
- avalanche: "https://snowtrace.io/tx/{txHash}",
695
- fantom: "https://ftmscan.com/tx/{txHash}"
696
- };
697
- return (f[d.network] || f.ethereum).replace("{txHash}", r.transactionHash);
698
- }
699
- return a.replace("{txHash}", r.transactionHash);
700
- }, i = () => {
701
- n ? n() : u({ type: "RESET" });
702
- }, h = c();
703
- return /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
704
- /* @__PURE__ */ e(
705
- "div",
706
- {
707
- className: "flex items-center justify-center mb-5",
708
- style: { width: 64, height: 64, borderRadius: "50%", background: "var(--t-success, #10b981)" },
709
- children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: "32", height: "32", fill: "white", children: /* @__PURE__ */ e("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z" }) })
710
- }
711
- ),
712
- /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: m ? "Sale Complete!" : "Purchase Complete!" }),
713
- /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: m ? `Your ${(r == null ? void 0 : r.fiatCurrency) || d.fiatCurrency} payout is being processed.` : `Your ${(r == null ? void 0 : r.cryptoCurrency) || d.cryptoCurrency} has been sent to your wallet.` }),
714
- r && /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
715
- /* @__PURE__ */ e(
716
- q,
717
- {
718
- label: m ? "Amount Sold" : "Amount Received",
719
- value: `${r.cryptoAmount} ${r.cryptoCurrency}`,
720
- highlight: !0
721
- }
722
- ),
723
- /* @__PURE__ */ e(
724
- q,
725
- {
726
- label: m ? "Payout Amount" : "Amount Paid",
727
- value: `${r.fiatAmount} ${r.fiatCurrency}`
728
- }
729
- ),
730
- /* @__PURE__ */ e(q, { label: "Network", value: r.network }),
731
- /* @__PURE__ */ e(
732
- q,
733
- {
734
- label: "Wallet",
735
- value: `${r.walletAddress.slice(0, 10)}...${r.walletAddress.slice(-8)}`,
736
- mono: !0
737
- }
738
- ),
739
- r.transactionHash && /* @__PURE__ */ e(
740
- q,
741
- {
742
- label: "Transaction",
743
- value: `${r.transactionHash.slice(0, 10)}...${r.transactionHash.slice(-8)}`,
744
- mono: !0
745
- }
746
- ),
747
- /* @__PURE__ */ e(q, { label: "Provider", value: r.gateway }),
748
- /* @__PURE__ */ e(q, { label: "Order ID", value: r.orderId, mono: !0 }),
749
- r.completedAt && /* @__PURE__ */ e(
750
- q,
751
- {
752
- label: "Completed",
753
- value: new Date(r.completedAt).toLocaleString()
754
- }
755
- )
756
- ] }),
757
- /* @__PURE__ */ o("div", { className: "w-full flex flex-col gap-2", children: [
758
- h && /* @__PURE__ */ e(
759
- "a",
760
- {
761
- href: h,
762
- target: "_blank",
763
- rel: "noopener noreferrer",
764
- className: "w-full font-semibold text-[14px] flex items-center justify-center transition-all",
765
- style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)", textDecoration: "none" },
766
- children: "View on Explorer"
767
- }
768
- ),
769
- /* @__PURE__ */ e(
770
- "button",
771
- {
772
- className: "w-full font-semibold text-[16px] transition-all",
773
- style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
774
- onClick: i,
775
- children: l
776
- }
777
- )
778
- ] })
779
- ] });
780
- }
781
- function q({ label: t, value: a, mono: n, highlight: l }) {
782
- return /* @__PURE__ */ o(
783
- "div",
784
- {
785
- className: "flex justify-between items-center py-2",
786
- style: { borderBottom: "1px solid var(--t-divider)" },
787
- children: [
788
- /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
789
- /* @__PURE__ */ e(
790
- "span",
791
- {
792
- className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
793
- style: { color: l ? "var(--t-success, #10b981)" : "var(--t-text)" },
794
- children: a
795
- }
796
- )
797
- ]
798
- }
799
- );
800
- }
801
- function Dt({
802
- className: t = "",
803
- onRetry: a,
804
- supportEmail: n = "support@nowramp.com"
805
- }) {
806
- const { state: l, orderStatus: r, dispatch: d, goToStep: u } = pe(), m = l.flowType === "sell", c = () => {
807
- if (r)
808
- switch (r.status) {
809
- case "failed":
810
- return "Payment Failed";
811
- case "cancelled":
812
- return "Order Cancelled";
813
- case "expired":
814
- return "Order Expired";
815
- case "refunded":
816
- return "Order Refunded";
817
- default:
818
- return "Something Went Wrong";
819
- }
820
- return "Something Went Wrong";
821
- }, i = () => {
822
- if (l.errorMessage) return l.errorMessage;
823
- if (r)
824
- switch (r.status) {
825
- case "failed":
826
- return m ? "Your sale could not be processed. Please try again." : "Your payment could not be processed. Please try again or use a different payment method.";
827
- case "cancelled":
828
- return m ? "Your sale was cancelled. No crypto was transferred." : "Your order was cancelled. No payment was processed.";
829
- case "expired":
830
- return m ? "Your order has expired. Please start a new sale." : "Your order has expired. Please start a new purchase.";
831
- case "refunded":
832
- return m ? "Your crypto has been returned. The funds should appear in your wallet shortly." : "Your payment has been refunded. The funds should appear in your account within 5-10 business days.";
833
- default:
834
- return "An unexpected error occurred. Please try again.";
835
- }
836
- return "An unexpected error occurred. Please try again.";
837
- }, h = () => {
838
- d({ type: "CLEAR_ERROR" }), a ? a() : (d({ type: "RESET" }), u("amount"));
839
- }, f = () => {
840
- d({ type: "RESET" }), u("amount");
841
- };
842
- return /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
843
- /* @__PURE__ */ e(
844
- "div",
845
- {
846
- className: "flex items-center justify-center mb-5",
847
- style: { width: 64, height: 64, borderRadius: "50%", background: "var(--t-error, #EF4444)" },
848
- children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: "32", height: "32", fill: "white", children: /* @__PURE__ */ e("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" }) })
849
- }
850
- ),
851
- /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: c() }),
852
- /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: i() }),
853
- r && /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
854
- /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
855
- /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Order ID" }),
856
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children: r.orderId })
857
- ] }),
858
- /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", children: [
859
- /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Status" }),
860
- /* @__PURE__ */ e(
861
- "span",
862
- {
863
- className: "text-[12px] font-medium px-2 py-0.5",
864
- style: { background: "rgba(239,68,68,0.15)", color: "#EF4444", borderRadius: 4 },
865
- children: r.gatewayStatus
866
- }
867
- )
868
- ] })
869
- ] }),
870
- /* @__PURE__ */ o("div", { className: "w-full flex flex-col gap-2", children: [
871
- /* @__PURE__ */ e(
872
- "button",
873
- {
874
- className: "w-full font-semibold text-[16px] transition-all",
875
- style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
876
- onClick: h,
877
- children: "Try Again"
878
- }
879
- ),
880
- /* @__PURE__ */ e(
881
- "button",
882
- {
883
- className: "w-full font-semibold text-[14px] transition-all",
884
- style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)" },
885
- onClick: f,
886
- children: "Start Over"
887
- }
888
- )
889
- ] }),
890
- /* @__PURE__ */ o("div", { className: "mt-6", children: [
891
- /* @__PURE__ */ o("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: [
892
- "Need help? Contact",
893
- " ",
894
- /* @__PURE__ */ e(
895
- "a",
896
- {
897
- href: `mailto:${n}`,
898
- className: "underline",
899
- style: { color: "var(--t-accent)" },
900
- children: n
901
- }
902
- )
903
- ] }),
904
- r && /* @__PURE__ */ o("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: [
905
- "Reference: ",
906
- r.orderId
907
- ] })
908
- ] })
909
- ] });
910
- }
911
- function ot(t) {
912
- return t.length <= 12 ? t : `${t.slice(0, 6)}...${t.slice(-6)}`;
913
- }
914
- function Ft({ className: t = "" }) {
915
- const {
916
- config: a,
917
- configLoading: n,
918
- state: l,
919
- defaultGateway: r,
920
- fetchQuotes: d,
921
- createOrder: u,
922
- orderLoading: m
923
- } = pe(), c = l.flowType === "sell", [i, h] = C(null), f = a == null ? void 0 : a.gateways.find((g) => g.id === r), x = async () => {
924
- h(null);
925
- try {
926
- d(), await u();
927
- } catch (g) {
928
- const p = g instanceof Error ? g.message : "Failed to create order";
929
- h(p);
930
- }
931
- };
932
- return n ? /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
933
- /* @__PURE__ */ e("div", { className: "nramp-spinner" }),
934
- /* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading..." })
935
- ] }) : /* @__PURE__ */ o("div", { className: `flex flex-col items-center px-8 py-12 ${t}`, children: [
936
- /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-6", style: { color: "var(--t-text)" }, children: c ? "Confirm Sale" : "Confirm Purchase" }),
937
- /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
938
- f && /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
939
- /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Provider" }),
940
- /* @__PURE__ */ o("span", { className: "flex items-center gap-2", children: [
941
- f.logo && /* @__PURE__ */ e("img", { src: f.logo, alt: f.name, width: 20, height: 20, style: { borderRadius: 4 } }),
942
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: f.name })
943
- ] })
944
- ] }),
945
- c ? /* @__PURE__ */ o(le, { children: [
946
- /* @__PURE__ */ e(oe, { label: "You sell", value: `${l.cryptoAmount} ${l.cryptoCurrency}`, highlight: !0 }),
947
- /* @__PURE__ */ e(oe, { label: "You receive", value: `${l.fiatCurrency} payout` })
948
- ] }) : /* @__PURE__ */ o(le, { children: [
949
- /* @__PURE__ */ e(oe, { label: "You pay", value: `${l.fiatAmount} ${l.fiatCurrency}`, highlight: !0 }),
950
- /* @__PURE__ */ e(oe, { label: "You receive", value: `${l.cryptoCurrency} on ${l.network}` }),
951
- /* @__PURE__ */ e(oe, { label: "Wallet", value: ot(l.walletAddress), mono: !0 })
952
- ] }),
953
- /* @__PURE__ */ e(oe, { label: "Network", value: l.network }),
954
- c && l.walletAddress && /* @__PURE__ */ e(oe, { label: "Refund address", value: ot(l.walletAddress), mono: !0 })
955
- ] }),
956
- i && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: i }),
957
- /* @__PURE__ */ e(
958
- "button",
959
- {
960
- className: "w-full font-semibold text-[16px] transition-all flex items-center justify-center gap-2",
961
- style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", opacity: m ? 0.7 : 1 },
962
- disabled: m,
963
- onClick: x,
964
- children: m ? /* @__PURE__ */ o(le, { children: [
965
- /* @__PURE__ */ e("span", { className: "nramp-spinner-inline" }),
966
- "Processing..."
967
- ] }) : c ? "Confirm & Sell" : "Confirm & Pay"
968
- }
969
- )
970
- ] });
971
- }
972
- function oe({ label: t, value: a, mono: n, highlight: l }) {
973
- return /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
974
- /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
975
- /* @__PURE__ */ e(
976
- "span",
977
- {
978
- className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
979
- style: { color: l ? "var(--t-success, #10b981)" : "var(--t-text)" },
980
- children: a
981
- }
982
- )
983
- ] });
984
- }
985
- function De({
986
- isOpen: t,
987
- onClose: a,
988
- children: n
989
- }) {
990
- const [l, r] = C(!1), [d, u] = C(!1);
991
- H(() => {
992
- if (t)
993
- r(!0), requestAnimationFrame(() => requestAnimationFrame(() => u(!0)));
994
- else if (l) {
995
- u(!1);
996
- const c = setTimeout(() => r(!1), 250);
997
- return () => clearTimeout(c);
998
- }
999
- }, [t]);
1000
- const m = $(() => {
1001
- u(!1), setTimeout(() => a(), 250);
1002
- }, [a]);
1003
- return l ? /* @__PURE__ */ e(
1004
- "div",
1005
- {
1006
- className: "absolute inset-0 z-20 transition-opacity duration-250",
1007
- style: { opacity: d ? 1 : 0 },
1008
- children: /* @__PURE__ */ e(
1009
- "div",
1010
- {
1011
- className: "absolute inset-0 flex flex-col transition-transform duration-250 ease-out",
1012
- style: { background: "var(--t-modal-bg)", transform: d ? "translateY(0)" : "translateY(24px)" },
1013
- children: typeof n == "function" ? n(m) : n
1014
- }
1015
- )
1016
- }
1017
- ) : null;
1018
- }
1019
- function Kt({ char: t, height: a = 38 }) {
1020
- const n = "0123456789", l = n.indexOf(t);
1021
- return l === -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(-${l * a}px)` }, children: n.split("").map((r) => /* @__PURE__ */ e("span", { className: "block", style: { height: a, lineHeight: `${a}px` }, children: r }, r)) }) });
1022
- }
1023
- function _t({
1024
- value: t,
1025
- height: a = 38,
1026
- className: n = "",
1027
- style: l = {}
1028
- }) {
1029
- return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", ...l }, children: t.split("").map((r, d) => /* @__PURE__ */ e(Kt, { char: r, height: a }, d)) });
1030
- }
1031
- function B({
1032
- w: t,
1033
- h: a,
1034
- className: n = ""
1035
- }) {
1036
- return /* @__PURE__ */ e("div", { className: `skeleton ${n}`, style: { width: t, height: a } });
1037
- }
1038
- function Xt() {
1039
- return /* @__PURE__ */ o("div", { className: "flex-1 px-5 flex flex-col", children: [
1040
- /* @__PURE__ */ o("div", { className: "px-[18px] pt-[14px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5 }, children: [
1041
- /* @__PURE__ */ e(B, { w: 70, h: 14, className: "mb-3" }),
1042
- /* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
1043
- /* @__PURE__ */ e(B, { w: 120, h: 32 }),
1044
- /* @__PURE__ */ e(B, { w: 75, h: 32 })
1045
- ] })
1046
- ] }),
1047
- /* @__PURE__ */ o("div", { className: "px-[18px] pt-[12px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5, marginTop: 4 }, children: [
1048
- /* @__PURE__ */ e(B, { w: 50, h: 14, className: "mb-3" }),
1049
- /* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
1050
- /* @__PURE__ */ e(B, { w: 180, h: 32 }),
1051
- /* @__PURE__ */ e(B, { w: 85, h: 32 })
1052
- ] })
1053
- ] }),
1054
- /* @__PURE__ */ o("div", { className: "flex justify-between mt-3 px-[2px]", children: [
1055
- /* @__PURE__ */ e(B, { w: 140, h: 12 }),
1056
- /* @__PURE__ */ e(B, { w: 90, h: 12 })
1057
- ] }),
1058
- /* @__PURE__ */ o("div", { className: "mt-8", children: [
1059
- /* @__PURE__ */ e(B, { w: 65, h: 14, className: "mb-2.5" }),
1060
- /* @__PURE__ */ e(B, { w: "100%", h: 47 })
1061
- ] }),
1062
- /* @__PURE__ */ e("div", { className: "flex-1" }),
1063
- /* @__PURE__ */ e(B, { w: "100%", h: 60, className: "mb-2" }),
1064
- /* @__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" }) })
1065
- ] });
1066
- }
1067
- const Re = {
381
+ const Ie = {
1068
382
  ETH: { name: "Ethereum (ERC20)", shortName: "Ethereum", icon: "eth" },
1069
383
  BSC: { name: "Binance Smart Chain (BEP20)", shortName: "Binance", icon: "bnb" },
1070
384
  BTC: { name: "Bitcoin", icon: "btc" },
@@ -1198,7 +512,7 @@ const Re = {
1198
512
  OKC: { name: "OKX Chain", icon: "eth" },
1199
513
  UNI_CHAIN: { name: "UNI", icon: "uni" },
1200
514
  ZEC: { name: "ZCash", icon: "zec" }
1201
- }, $t = [
515
+ }, Ut = [
1202
516
  // --- Popular / Top coins ---
1203
517
  { code: "BTC", name: "Bitcoin", chains: ["BTC", "LN"], popular: !0 },
1204
518
  { code: "ETH", name: "Ethereum", chains: ["ETH", "ARB", "BASE", "BSC", "OPTIMISM", "LINEA", "ZKSYNC", "LRC", "STARK", "APE", "ECLIPSE", "FUEL", "INK", "SOPHON", "UNICHAIN", "WLD"], popular: !0 },
@@ -1391,7 +705,7 @@ const Re = {
1391
705
  { code: "ZCHF", name: "Frankencoin", chains: ["ETH"], popular: !1 },
1392
706
  { code: "ZETA", name: "Zeta", chains: ["ETH", "ZETACHAIN"], popular: !1 },
1393
707
  { code: "ZTG", name: "Zeitgeist", chains: ["ZTG"], popular: !1 }
1394
- ], Gt = {
708
+ ], Dt = {
1395
709
  USD: "us",
1396
710
  EUR: "eu",
1397
711
  GBP: "gb",
@@ -1405,18 +719,18 @@ const Re = {
1405
719
  ARS: "ar",
1406
720
  ALL: "al"
1407
721
  };
1408
- function ht(t, a = "") {
722
+ function yt(t, a = "") {
1409
723
  return `${a}/crypto-icons/${t.toLowerCase()}.svg`;
1410
724
  }
1411
- function Wt(t, a = "") {
1412
- const n = Gt[t] || "us";
725
+ function Ft(t, a = "") {
726
+ const n = Dt[t] || "us";
1413
727
  return `${a}/flags/${n}.svg`;
1414
728
  }
1415
- function Ke(t, a = "") {
1416
- const n = Re[t];
729
+ function _e(t, a = "") {
730
+ const n = Ie[t];
1417
731
  return n ? `${a}/crypto-icons/${n.icon}.svg` : `${a}/crypto-icons/${t.toLowerCase()}.svg`;
1418
732
  }
1419
- const lt = [
733
+ const st = [
1420
734
  { code: "ALL", name: "Albania Lek" },
1421
735
  { code: "ARS", name: "Argentina Peso" },
1422
736
  { code: "AUD", name: "Australian Dollar" },
@@ -1436,7 +750,7 @@ const lt = [
1436
750
  { id: "orange", name: "Orange", accent: "#F59E0B" },
1437
751
  { id: "rose", name: "Rose", accent: "#F43F5E" },
1438
752
  { id: "mono", name: "Mono", accent: null }
1439
- ], st = {
753
+ ], it = {
1440
754
  USDC: { USD: 0.9962, EUR: 1.0814, GBP: 1.2573, JPY: 667e-5, CAD: 0.7198, AUD: 0.6384, BRL: 0.1726, CHF: 1.1306, MXN: 0.0487, INR: 0.01187, ARS: 855e-6, ALL: 0.01058 },
1441
755
  USDT: { USD: 0.9958, EUR: 1.081, GBP: 1.2568, JPY: 666e-5, CAD: 0.7194, AUD: 0.638, BRL: 0.1724, CHF: 1.1301, MXN: 0.0486, INR: 0.01186, ARS: 854e-6, ALL: 0.01057 },
1442
756
  BTC: { USD: 104e-7, EUR: 1129e-8, GBP: 1313e-8, JPY: 696e-10, CAD: 751e-8, AUD: 666e-8, BRL: 18e-7, CHF: 118e-7, MXN: 508e-9, INR: 124e-9, ARS: 892e-11, ALL: 11e-8 },
@@ -1446,240 +760,1069 @@ const lt = [
1446
760
  DOGE: { USD: 3.896, EUR: 4.232, GBP: 4.92, JPY: 0.02607, CAD: 2.815, AUD: 2.496, BRL: 0.675, CHF: 4.421, MXN: 0.1902, INR: 0.04641, ARS: 3345e-6, ALL: 0.04134 },
1447
761
  ADA: { USD: 1.333, EUR: 1.448, GBP: 1.683, JPY: 892e-5, CAD: 0.963, AUD: 0.854, BRL: 0.2309, CHF: 1.512, MXN: 0.0651, INR: 0.01588, ARS: 1145e-6, ALL: 0.01414 }
1448
762
  };
1449
- function xa(t, a) {
1450
- var n, l;
1451
- return ((n = st[t]) == null ? void 0 : n[a]) ?? ((l = st.USDC) == null ? void 0 : l[a]) ?? 1;
763
+ function Aa(t, a) {
764
+ var n, s;
765
+ return ((n = it[t]) == null ? void 0 : n[a]) ?? ((s = it.USDC) == null ? void 0 : s[a]) ?? 1;
766
+ }
767
+ function Kt(t) {
768
+ return parseFloat(t.replace(/,/g, "")) || 0;
769
+ }
770
+ function wa(t) {
771
+ if (t === 0) return "0";
772
+ if (t >= 1e3) return t.toLocaleString("en-US", { maximumFractionDigits: 2 });
773
+ if (t >= 1) return t.toFixed(2);
774
+ if (t >= 0.01) return t.toFixed(4);
775
+ const a = t.toPrecision(4);
776
+ return parseFloat(a).toString();
777
+ }
778
+ const Ke = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), dt = 10, ut = 1e-4, _t = (() => {
779
+ const t = [];
780
+ for (const a of Ut)
781
+ for (const n of a.chains)
782
+ t.push({ code: a.code, name: a.name, chain: n, popular: a.popular });
783
+ return t;
784
+ })();
785
+ function mt({ ticker: t, size: a = 32, baseUrl: n = "" }) {
786
+ return /* @__PURE__ */ e(
787
+ "img",
788
+ {
789
+ src: yt(t, n),
790
+ alt: t,
791
+ width: a,
792
+ height: a,
793
+ className: "rounded-full shrink-0",
794
+ style: { width: a, height: a }
795
+ }
796
+ );
797
+ }
798
+ function Xe({ currencyCode: t, size: a = 16, baseUrl: n = "" }) {
799
+ return /* @__PURE__ */ e(
800
+ "img",
801
+ {
802
+ src: Ft(t, n),
803
+ alt: t,
804
+ width: a,
805
+ height: a,
806
+ className: "rounded-full shrink-0",
807
+ style: { width: a, height: a }
808
+ }
809
+ );
810
+ }
811
+ function $e({ size: t = 32, color: a = "#888" }) {
812
+ return /* @__PURE__ */ l("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
813
+ /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "16", fill: a }),
814
+ /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "8", stroke: "white", strokeWidth: "1.5", fill: "none" })
815
+ ] });
816
+ }
817
+ function Xt({ size: t = 24 }) {
818
+ return /* @__PURE__ */ l("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
819
+ /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "16", fill: "#0077FF" }),
820
+ /* @__PURE__ */ e("path", { d: "M8 15l8-6 8 6H8z", fill: "white" }),
821
+ /* @__PURE__ */ e("rect", { x: "10", y: "16", width: "2", height: "6", fill: "white" }),
822
+ /* @__PURE__ */ e("rect", { x: "15", y: "16", width: "2", height: "6", fill: "white" }),
823
+ /* @__PURE__ */ e("rect", { x: "20", y: "16", width: "2", height: "6", fill: "white" }),
824
+ /* @__PURE__ */ e("rect", { x: "8", y: "22", width: "16", height: "2", rx: "0.5", fill: "white" })
825
+ ] });
826
+ }
827
+ function $t({ size: t = 32 }) {
828
+ return /* @__PURE__ */ e(
829
+ "div",
830
+ {
831
+ className: "rounded-full flex items-center justify-center text-white font-semibold shrink-0",
832
+ style: { width: t, height: t, backgroundColor: "#333", fontSize: t * 0.45 },
833
+ children: "R"
834
+ }
835
+ );
836
+ }
837
+ function Gt({ size: t = 32 }) {
838
+ return /* @__PURE__ */ e(
839
+ "div",
840
+ {
841
+ className: "rounded-full bg-black border border-white/20 flex items-center justify-center text-white shrink-0",
842
+ style: { width: t, height: t, fontSize: t * 0.3 },
843
+ children: /* @__PURE__ */ e("span", { style: { fontFamily: "-apple-system, system-ui, sans-serif", fontWeight: 600 }, children: "Pay" })
844
+ }
845
+ );
846
+ }
847
+ function jt({ size: t = 32 }) {
848
+ return /* @__PURE__ */ l(
849
+ "div",
850
+ {
851
+ className: "rounded-full bg-white flex items-center justify-center shrink-0",
852
+ style: { width: t, height: t, fontSize: t * 0.28, fontWeight: 700, color: "#333" },
853
+ children: [
854
+ "G",
855
+ /* @__PURE__ */ e("span", { style: { color: "#4285F4", fontSize: t * 0.2 }, children: "Pay" })
856
+ ]
857
+ }
858
+ );
859
+ }
860
+ function Yt({ size: t = 32 }) {
861
+ return /* @__PURE__ */ e(
862
+ "div",
863
+ {
864
+ className: "rounded-full flex items-center justify-center shrink-0",
865
+ style: { width: t, height: t, background: "#003087" },
866
+ children: /* @__PURE__ */ e("span", { className: "text-white font-bold", style: { fontSize: t * 0.38 }, children: "P" })
867
+ }
868
+ );
869
+ }
870
+ function Vt({ size: t = 32 }) {
871
+ return /* @__PURE__ */ e(
872
+ "div",
873
+ {
874
+ className: "rounded-full flex items-center justify-center shrink-0",
875
+ style: { width: t, height: t, background: "var(--t-card-icon-bg)" },
876
+ children: /* @__PURE__ */ l("svg", { width: t * 0.55, height: t * 0.55, viewBox: "0 0 18 14", fill: "none", children: [
877
+ /* @__PURE__ */ e("rect", { x: "0.5", y: "0.5", width: "17", height: "13", rx: "2", stroke: "var(--t-card-icon-stroke)" }),
878
+ /* @__PURE__ */ e("rect", { y: "3", width: "18", height: "3", fill: "var(--t-card-icon-stroke)" })
879
+ ] })
880
+ }
881
+ );
1452
882
  }
1453
- function Yt(t) {
1454
- return parseFloat(t.replace(/,/g, "")) || 0;
883
+ function Sa({ size: t = 18 }) {
884
+ return /* @__PURE__ */ e(
885
+ "div",
886
+ {
887
+ className: "rounded-full bg-white flex items-center justify-center shrink-0",
888
+ style: { width: t, height: t },
889
+ children: /* @__PURE__ */ e("span", { className: "text-black font-bold", style: { fontSize: t * 0.55 }, children: "C" })
890
+ }
891
+ );
1455
892
  }
1456
- function ga(t) {
1457
- if (t === 0) return "0";
1458
- if (t >= 1e3) return t.toLocaleString("en-US", { maximumFractionDigits: 2 });
1459
- if (t >= 1) return t.toFixed(2);
1460
- if (t >= 0.01) return t.toFixed(4);
1461
- const a = t.toPrecision(4);
1462
- return parseFloat(a).toString();
893
+ function ge() {
894
+ return /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ e("path", { d: "M3 4.5L6 7.5L9 4.5", stroke: "var(--t-text-secondary)", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }) });
1463
895
  }
1464
- const Fe = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), it = 10, dt = 1e-4, Vt = (() => {
1465
- const t = [];
1466
- for (const a of $t)
1467
- for (const n of a.chains)
1468
- t.push({ code: a.code, name: a.name, chain: n, popular: a.popular });
1469
- return t;
1470
- })();
1471
- function ut({ ticker: t, size: a = 32, baseUrl: n = "" }) {
896
+ function Wt() {
897
+ return /* @__PURE__ */ e("svg", { width: "8", height: "14", viewBox: "0 0 8 14", fill: "none", children: /* @__PURE__ */ e("path", { d: "M1 1L7 7L1 13", stroke: "var(--t-icon-stroke)", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }) });
898
+ }
899
+ function Qt({ onClick: t }) {
900
+ return /* @__PURE__ */ e("button", { onClick: t, className: "hover:opacity-70 transition-opacity", children: /* @__PURE__ */ e("svg", { width: "24", height: "16", viewBox: "0 0 24 16", fill: "none", children: /* @__PURE__ */ e(
901
+ "path",
902
+ {
903
+ d: "M4 0.799805H20C21.7673 0.799805 23.2002 2.23269 23.2002 4V12C23.2002 13.7673 21.7673 15.2002 20 15.2002H4C2.23269 15.2002 0.799805 13.7673 0.799805 12V4C0.799805 2.23269 2.23269 0.799805 4 0.799805Z",
904
+ stroke: "var(--t-icon-stroke)",
905
+ strokeWidth: "1.6"
906
+ }
907
+ ) }) });
908
+ }
909
+ function Zt({ size: t = 40 }) {
1472
910
  return /* @__PURE__ */ e(
1473
- "img",
911
+ "div",
1474
912
  {
1475
- src: ht(t, n),
1476
- alt: t,
1477
- width: a,
1478
- height: a,
1479
- className: "rounded-full shrink-0",
1480
- style: { width: a, height: a }
913
+ className: "rounded-full flex items-center justify-center shrink-0",
914
+ style: { width: t, height: t, background: "var(--t-surface)" },
915
+ children: /* @__PURE__ */ l("svg", { width: t * 0.5, height: t * 0.5, viewBox: "0 0 20 20", fill: "none", children: [
916
+ /* @__PURE__ */ e("circle", { cx: "10", cy: "10", r: "7.5", stroke: "var(--t-text)", strokeWidth: "1.5" }),
917
+ /* @__PURE__ */ e("path", { d: "M10 2.5A7.5 7.5 0 0 1 10 17.5", fill: "var(--t-text)" })
918
+ ] })
1481
919
  }
1482
920
  );
1483
921
  }
1484
- function _e({ currencyCode: t, size: a = 16, baseUrl: n = "" }) {
922
+ function Jt(t, a = 32) {
923
+ switch (t) {
924
+ case "revolut":
925
+ return /* @__PURE__ */ e($t, { size: a });
926
+ case "applepay":
927
+ return /* @__PURE__ */ e(Gt, { size: a });
928
+ case "card":
929
+ return /* @__PURE__ */ e(Vt, { size: a });
930
+ case "googlepay":
931
+ return /* @__PURE__ */ e(jt, { size: a });
932
+ case "paypal":
933
+ return /* @__PURE__ */ e(Yt, { size: a });
934
+ case "bank":
935
+ return /* @__PURE__ */ e(Xt, { size: a });
936
+ default:
937
+ return /* @__PURE__ */ e($e, { size: a });
938
+ }
939
+ }
940
+ function Le({
941
+ isOpen: t,
942
+ onClose: a,
943
+ children: n
944
+ }) {
945
+ const [s, r] = N(!1), [u, m] = N(!1);
946
+ U(() => {
947
+ if (t)
948
+ r(!0), requestAnimationFrame(() => requestAnimationFrame(() => m(!0)));
949
+ else if (s) {
950
+ m(!1);
951
+ const o = setTimeout(() => r(!1), 250);
952
+ return () => clearTimeout(o);
953
+ }
954
+ }, [t]);
955
+ const i = _(() => {
956
+ m(!1), setTimeout(() => a(), 250);
957
+ }, [a]);
958
+ return s ? /* @__PURE__ */ e(
959
+ "div",
960
+ {
961
+ className: "absolute inset-0 z-20 transition-opacity duration-250",
962
+ style: { opacity: u ? 1 : 0 },
963
+ children: /* @__PURE__ */ e(
964
+ "div",
965
+ {
966
+ className: "absolute inset-0 flex flex-col transition-transform duration-250 ease-out",
967
+ style: { background: "var(--t-modal-bg)", transform: u ? "translateY(0)" : "translateY(24px)" },
968
+ children: typeof n == "function" ? n(i) : n
969
+ }
970
+ )
971
+ }
972
+ ) : null;
973
+ }
974
+ function ve({ onClick: t }) {
1485
975
  return /* @__PURE__ */ e(
1486
- "img",
976
+ "button",
1487
977
  {
1488
- src: Wt(t, n),
1489
- alt: t,
1490
- width: a,
1491
- height: a,
1492
- className: "rounded-full shrink-0",
1493
- style: { width: a, height: a }
978
+ onClick: t,
979
+ className: "flex items-center justify-center transition-colors rounded-full shrink-0",
980
+ style: { width: 30, height: 30, backgroundColor: "var(--t-close-bg)" },
981
+ onMouseEnter: (a) => a.currentTarget.style.backgroundColor = "var(--t-close-hover)",
982
+ onMouseLeave: (a) => a.currentTarget.style.backgroundColor = "var(--t-close-bg)",
983
+ children: /* @__PURE__ */ e("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ e("path", { d: "M1 1L9 9M9 1L1 9", stroke: "var(--t-icon-close)", strokeWidth: "1.4", strokeLinecap: "round" }) })
1494
984
  }
1495
985
  );
1496
986
  }
1497
- function ft({ size: t = 32, color: a = "#888" }) {
1498
- return /* @__PURE__ */ o("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
1499
- /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "16", fill: a }),
1500
- /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "8", stroke: "white", strokeWidth: "1.5", fill: "none" })
987
+ function Be({
988
+ value: t,
989
+ onChange: a,
990
+ placeholder: n = ""
991
+ }) {
992
+ return /* @__PURE__ */ l("div", { className: "relative mx-5 mb-5", children: [
993
+ /* @__PURE__ */ e(
994
+ "input",
995
+ {
996
+ type: "text",
997
+ value: t,
998
+ onChange: (s) => a(s.target.value),
999
+ placeholder: n,
1000
+ style: { height: 47, borderRadius: 4.5, borderColor: "var(--t-border)", color: "var(--t-text)", paddingLeft: 14, paddingRight: t ? 40 : 14, fontSize: 14 },
1001
+ className: "w-full bg-transparent border outline-none transition-colors"
1002
+ }
1003
+ ),
1004
+ t && /* @__PURE__ */ e(
1005
+ "button",
1006
+ {
1007
+ onClick: () => a(""),
1008
+ className: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center transition-colors rounded",
1009
+ style: { width: 22, height: 22, backgroundColor: "var(--t-close-bg)", borderRadius: 4 },
1010
+ children: /* @__PURE__ */ e("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", children: /* @__PURE__ */ e("path", { d: "M1 1L7 7M7 1L1 7", stroke: "var(--t-icon-close)", strokeWidth: "1.2", strokeLinecap: "round" }) })
1011
+ }
1012
+ )
1501
1013
  ] });
1502
1014
  }
1503
- function jt({ size: t = 24 }) {
1504
- return /* @__PURE__ */ o("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
1505
- /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "16", fill: "#0077FF" }),
1506
- /* @__PURE__ */ e("path", { d: "M8 15l8-6 8 6H8z", fill: "white" }),
1507
- /* @__PURE__ */ e("rect", { x: "10", y: "16", width: "2", height: "6", fill: "white" }),
1508
- /* @__PURE__ */ e("rect", { x: "15", y: "16", width: "2", height: "6", fill: "white" }),
1509
- /* @__PURE__ */ e("rect", { x: "20", y: "16", width: "2", height: "6", fill: "white" }),
1510
- /* @__PURE__ */ e("rect", { x: "8", y: "22", width: "16", height: "2", rx: "0.5", fill: "white" })
1015
+ function zt({
1016
+ methods: t,
1017
+ selectedId: a,
1018
+ onSelect: n,
1019
+ onClose: s
1020
+ }) {
1021
+ const [r, u] = N(""), m = F(() => {
1022
+ const i = r.trim().toLowerCase();
1023
+ return i ? t.filter(
1024
+ (o) => o.id.toLowerCase().includes(i) || o.name.toLowerCase().includes(i) || o.description && o.description.toLowerCase().includes(i)
1025
+ ) : t;
1026
+ }, [t, r]);
1027
+ return /* @__PURE__ */ l(J, { children: [
1028
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: s }) }),
1029
+ /* @__PURE__ */ e(
1030
+ "h2",
1031
+ {
1032
+ className: "text-center text-[17px] font-medium mt-2 mb-6",
1033
+ style: { color: "var(--t-text)" },
1034
+ children: "Choose payment method"
1035
+ }
1036
+ ),
1037
+ /* @__PURE__ */ e(Be, { value: r, onChange: u }),
1038
+ /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
1039
+ m.map((i) => {
1040
+ const o = i.id === a;
1041
+ return /* @__PURE__ */ l(
1042
+ "button",
1043
+ {
1044
+ onClick: () => n(i.id),
1045
+ className: "flex items-center gap-4 w-full transition-colors",
1046
+ style: {
1047
+ color: "var(--t-text)",
1048
+ paddingTop: 18,
1049
+ paddingBottom: 18
1050
+ },
1051
+ children: [
1052
+ /* @__PURE__ */ e("span", { className: "flex items-center justify-center shrink-0", style: { width: 32, height: 32 }, children: xt(i.id, i.icon, 32) }),
1053
+ /* @__PURE__ */ e("span", { className: "text-left flex-1", children: /* @__PURE__ */ e(
1054
+ "span",
1055
+ {
1056
+ className: "font-semibold text-[15px] leading-tight",
1057
+ style: { color: o ? "var(--t-accent)" : "var(--t-text)" },
1058
+ children: i.name
1059
+ }
1060
+ ) })
1061
+ ]
1062
+ },
1063
+ i.id
1064
+ );
1065
+ }),
1066
+ m.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No payment methods found" })
1067
+ ] })
1511
1068
  ] });
1512
1069
  }
1513
- function Qt({ size: t = 32 }) {
1514
- return /* @__PURE__ */ e(
1070
+ const qt = {
1071
+ "debit-credit-card": "card",
1072
+ "bank-transfer": "bank",
1073
+ "apple-pay": "applepay",
1074
+ "google-pay": "googlepay",
1075
+ paypal: "paypal",
1076
+ revolut: "revolut"
1077
+ };
1078
+ function xt(t, a, n = 24) {
1079
+ const s = qt[t];
1080
+ return s ? Jt(s, n) : a ? /* @__PURE__ */ e("img", { src: a, alt: "", width: n, height: n, style: { borderRadius: "50%" } }) : /* @__PURE__ */ e($e, { size: n });
1081
+ }
1082
+ function ea({
1083
+ methods: t,
1084
+ selectedId: a,
1085
+ onSelect: n,
1086
+ fiatCurrency: s
1087
+ }) {
1088
+ const [r, u] = N(!1), m = F(
1089
+ () => t.filter((o) => o.supportedFiats.includes(s)),
1090
+ [t, s]
1091
+ ), i = m.find((o) => o.id === a) || m[0];
1092
+ return m.length === 0 ? /* @__PURE__ */ e(
1093
+ "div",
1094
+ {
1095
+ className: "flex items-center justify-between px-[18px] pt-[12px] pb-[14px]",
1096
+ style: {
1097
+ background: "var(--t-surface)",
1098
+ borderBottomLeftRadius: 5,
1099
+ borderBottomRightRadius: 5
1100
+ },
1101
+ children: /* @__PURE__ */ l("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: [
1102
+ "No payment methods available for ",
1103
+ s
1104
+ ] })
1105
+ }
1106
+ ) : /* @__PURE__ */ l(J, { children: [
1107
+ /* @__PURE__ */ l(
1108
+ "div",
1109
+ {
1110
+ role: "button",
1111
+ tabIndex: 0,
1112
+ onClick: () => u(!0),
1113
+ onKeyDown: (o) => {
1114
+ (o.key === "Enter" || o.key === " ") && u(!0);
1115
+ },
1116
+ className: "flex items-center justify-between w-full px-[18px] transition-colors",
1117
+ style: {
1118
+ background: "var(--t-surface)",
1119
+ borderBottomLeftRadius: 5,
1120
+ borderBottomRightRadius: 5,
1121
+ cursor: "pointer",
1122
+ height: 42
1123
+ },
1124
+ children: [
1125
+ /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Payment method" }),
1126
+ /* @__PURE__ */ l("span", { className: "flex items-center gap-2", children: [
1127
+ /* @__PURE__ */ e("span", { className: "flex items-center justify-center", style: { width: 20, height: 20 }, children: i && xt(i.id, i.icon, 20) }),
1128
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: (i == null ? void 0 : i.name) || "Select" }),
1129
+ /* @__PURE__ */ e(ge, {})
1130
+ ] })
1131
+ ]
1132
+ }
1133
+ ),
1134
+ /* @__PURE__ */ e(Le, { isOpen: r, onClose: () => u(!1), children: (o) => /* @__PURE__ */ e(
1135
+ zt,
1136
+ {
1137
+ methods: m,
1138
+ selectedId: a,
1139
+ onSelect: (d) => {
1140
+ n(d), o();
1141
+ },
1142
+ onClose: o
1143
+ }
1144
+ ) })
1145
+ ] });
1146
+ }
1147
+ function ta({
1148
+ className: t = "",
1149
+ iframeHeight: a = 600,
1150
+ autoRedirect: n = !1,
1151
+ redirectDelay: s = 3e3
1152
+ }) {
1153
+ var g;
1154
+ const { order: r, orderStatus: u, goToStep: m, goBack: i } = pe(), [o, d] = N(!1), [h, f] = N(null), x = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
1155
+ if (U(() => {
1156
+ if ((r == null ? void 0 : r.checkout.method) === "redirect" && n && !x) {
1157
+ f(Math.ceil(s / 1e3));
1158
+ const p = setTimeout(() => {
1159
+ window.location.href = r.checkout.url;
1160
+ }, s), b = setInterval(() => {
1161
+ f((S) => S && S > 1 ? S - 1 : null);
1162
+ }, 1e3);
1163
+ return () => {
1164
+ clearTimeout(p), clearInterval(b);
1165
+ };
1166
+ }
1167
+ }, [r, n, s, x]), U(() => {
1168
+ u && (u.status === "completed" ? m("complete") : ["failed", "cancelled", "expired"].includes(u.status) && m("error"));
1169
+ }, [u == null ? void 0 : u.status, m]), !r)
1170
+ return /* @__PURE__ */ l(
1171
+ "div",
1172
+ {
1173
+ className: `flex flex-col items-center justify-center p-8 ${t}`,
1174
+ style: { color: "var(--t-text)" },
1175
+ children: [
1176
+ /* @__PURE__ */ e("p", { className: "text-[15px] mb-4", children: "No order found" }),
1177
+ /* @__PURE__ */ e(
1178
+ "button",
1179
+ {
1180
+ className: "font-semibold text-[14px] transition-all",
1181
+ style: {
1182
+ height: 48,
1183
+ borderRadius: 5,
1184
+ background: "var(--t-surface)",
1185
+ color: "var(--t-text)",
1186
+ paddingLeft: 24,
1187
+ paddingRight: 24
1188
+ },
1189
+ onClick: i,
1190
+ children: "Go Back"
1191
+ }
1192
+ )
1193
+ ]
1194
+ }
1195
+ );
1196
+ if (x)
1197
+ return /* @__PURE__ */ l(
1198
+ "div",
1199
+ {
1200
+ className: `flex flex-col items-center justify-center p-8 text-center ${t}`,
1201
+ style: { color: "var(--t-text)" },
1202
+ children: [
1203
+ /* @__PURE__ */ e("h3", { className: "text-[18px] font-semibold mb-2", children: "Checkout expired" }),
1204
+ /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: "The session has expired. Please try again." }),
1205
+ /* @__PURE__ */ e(
1206
+ "button",
1207
+ {
1208
+ className: "w-full font-semibold text-[16px] transition-all",
1209
+ style: {
1210
+ height: 60,
1211
+ borderRadius: 5,
1212
+ background: "var(--t-cta-bg)",
1213
+ color: "var(--t-cta-text)"
1214
+ },
1215
+ onClick: i,
1216
+ children: "Start over"
1217
+ }
1218
+ )
1219
+ ]
1220
+ }
1221
+ );
1222
+ if (r.checkout.method === "iframe")
1223
+ return /* @__PURE__ */ e("div", { className: `flex flex-col flex-1 ${t}`, children: /* @__PURE__ */ l(
1224
+ "div",
1225
+ {
1226
+ className: "relative flex-1",
1227
+ style: {
1228
+ height: a,
1229
+ borderRadius: 5,
1230
+ overflow: "hidden",
1231
+ background: "var(--t-surface)"
1232
+ },
1233
+ children: [
1234
+ !o && /* @__PURE__ */ l("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
1235
+ /* @__PURE__ */ e("div", { className: "nramp-spinner" }),
1236
+ /* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading checkout..." })
1237
+ ] }),
1238
+ /* @__PURE__ */ e(
1239
+ "iframe",
1240
+ {
1241
+ src: r.checkout.url,
1242
+ style: {
1243
+ display: o ? "block" : "none",
1244
+ width: "100%",
1245
+ height: "100%",
1246
+ border: "none"
1247
+ },
1248
+ allow: ((g = r.checkout.allowedFeatures) == null ? void 0 : g.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
1249
+ onLoad: () => d(!0),
1250
+ title: "Provider Checkout"
1251
+ }
1252
+ )
1253
+ ]
1254
+ }
1255
+ ) });
1256
+ if (r.checkout.method === "redirect")
1257
+ return /* @__PURE__ */ l(
1258
+ "div",
1259
+ {
1260
+ className: `flex flex-col items-center justify-center p-8 text-center ${t}`,
1261
+ style: { color: "var(--t-text)" },
1262
+ children: [
1263
+ /* @__PURE__ */ e("div", { className: "text-[48px] mb-4", children: "🔗" }),
1264
+ /* @__PURE__ */ e("h3", { className: "text-[18px] font-semibold mb-2", children: "Complete Payment" }),
1265
+ /* @__PURE__ */ l("p", { className: "text-[14px] mb-4", style: { color: "var(--t-text-secondary)" }, children: [
1266
+ "You'll be redirected to ",
1267
+ r.gateway,
1268
+ " to complete your payment."
1269
+ ] }),
1270
+ h !== null && /* @__PURE__ */ l("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: [
1271
+ "Redirecting in ",
1272
+ h,
1273
+ "..."
1274
+ ] }),
1275
+ /* @__PURE__ */ l(
1276
+ "a",
1277
+ {
1278
+ href: r.checkout.url,
1279
+ className: "w-full font-semibold text-[16px] flex items-center justify-center transition-all",
1280
+ style: {
1281
+ height: 60,
1282
+ borderRadius: 5,
1283
+ background: "var(--t-cta-bg)",
1284
+ color: "var(--t-cta-text)",
1285
+ textDecoration: "none"
1286
+ },
1287
+ target: "_blank",
1288
+ rel: "noopener noreferrer",
1289
+ children: [
1290
+ "Continue to ",
1291
+ r.gateway
1292
+ ]
1293
+ }
1294
+ ),
1295
+ /* @__PURE__ */ e(
1296
+ "button",
1297
+ {
1298
+ className: "w-full font-semibold text-[14px] mt-2 transition-all",
1299
+ style: {
1300
+ height: 48,
1301
+ borderRadius: 5,
1302
+ background: "var(--t-surface)",
1303
+ color: "var(--t-text)"
1304
+ },
1305
+ onClick: i,
1306
+ children: "Cancel"
1307
+ }
1308
+ )
1309
+ ]
1310
+ }
1311
+ );
1312
+ if (r.checkout.method === "widget" && r.widgetConfig) {
1313
+ const p = aa(r.checkout.url, r.widgetConfig);
1314
+ return /* @__PURE__ */ e("div", { className: `flex flex-col flex-1 ${t}`, children: /* @__PURE__ */ l(
1315
+ "div",
1316
+ {
1317
+ className: "relative flex-1",
1318
+ style: {
1319
+ height: a,
1320
+ borderRadius: 5,
1321
+ overflow: "hidden",
1322
+ background: "var(--t-surface)"
1323
+ },
1324
+ children: [
1325
+ !o && /* @__PURE__ */ l("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
1326
+ /* @__PURE__ */ e("div", { className: "nramp-spinner" }),
1327
+ /* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading checkout..." })
1328
+ ] }),
1329
+ /* @__PURE__ */ e(
1330
+ "iframe",
1331
+ {
1332
+ src: p,
1333
+ style: {
1334
+ display: o ? "block" : "none",
1335
+ width: "100%",
1336
+ height: "100%",
1337
+ border: "none"
1338
+ },
1339
+ allow: "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
1340
+ onLoad: () => d(!0),
1341
+ title: "Payment Checkout"
1342
+ }
1343
+ )
1344
+ ]
1345
+ }
1346
+ ) });
1347
+ }
1348
+ return /* @__PURE__ */ l(
1515
1349
  "div",
1516
1350
  {
1517
- className: "rounded-full flex items-center justify-center text-white font-semibold shrink-0",
1518
- style: { width: t, height: t, backgroundColor: "#333", fontSize: t * 0.45 },
1519
- children: "R"
1351
+ className: `flex flex-col items-center justify-center p-8 ${t}`,
1352
+ style: { color: "var(--t-text)" },
1353
+ children: [
1354
+ /* @__PURE__ */ e("p", { className: "text-[15px] mb-4", children: "Unknown checkout method" }),
1355
+ /* @__PURE__ */ e(
1356
+ "button",
1357
+ {
1358
+ className: "font-semibold text-[14px] transition-all",
1359
+ style: {
1360
+ height: 48,
1361
+ borderRadius: 5,
1362
+ background: "var(--t-surface)",
1363
+ color: "var(--t-text)",
1364
+ paddingLeft: 24,
1365
+ paddingRight: 24
1366
+ },
1367
+ onClick: i,
1368
+ children: "Go Back"
1369
+ }
1370
+ )
1371
+ ]
1520
1372
  }
1521
1373
  );
1522
1374
  }
1523
- function Zt({ size: t = 32 }) {
1524
- return /* @__PURE__ */ e(
1525
- "div",
1526
- {
1527
- className: "rounded-full bg-black border border-white/20 flex items-center justify-center text-white shrink-0",
1528
- style: { width: t, height: t, fontSize: t * 0.3 },
1529
- children: /* @__PURE__ */ e("span", { style: { fontFamily: "-apple-system, system-ui, sans-serif", fontWeight: 600 }, children: "Pay" })
1375
+ function aa(t, a) {
1376
+ const n = new URL("/en/partner/widget", t);
1377
+ for (const [s, r] of Object.entries(a))
1378
+ r != null && r !== "" && n.searchParams.set(s, String(r));
1379
+ return n.toString();
1380
+ }
1381
+ function na({ className: t = "" }) {
1382
+ const { orderStatus: a, orderStatusLoading: n, goToStep: s } = pe();
1383
+ U(() => {
1384
+ a && (a.status === "completed" ? s("complete") : ["failed", "cancelled", "expired", "refunded"].includes(a.status) && s("error"));
1385
+ }, [a == null ? void 0 : a.status, s]);
1386
+ const r = () => {
1387
+ if (!a) return "Processing your order...";
1388
+ switch (a.status) {
1389
+ case "pending":
1390
+ return "Waiting for payment confirmation...";
1391
+ case "processing":
1392
+ return "Processing your transaction...";
1393
+ default:
1394
+ return "Processing...";
1530
1395
  }
1531
- );
1396
+ };
1397
+ return /* @__PURE__ */ l("div", { className: `flex flex-col items-center justify-center px-8 py-12 text-center ${t}`, children: [
1398
+ /* @__PURE__ */ e("div", { className: "mb-6", children: /* @__PURE__ */ e("div", { className: "nramp-spinner-large nramp-spinner" }) }),
1399
+ /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: r() }),
1400
+ n && /* @__PURE__ */ e("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: "Checking status..." }),
1401
+ a && /* @__PURE__ */ l("div", { className: "w-full mt-6 text-left", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
1402
+ /* @__PURE__ */ e(me, { label: "Order ID", value: a.orderId, mono: !0 }),
1403
+ /* @__PURE__ */ e(me, { label: "Provider", value: a.gateway }),
1404
+ /* @__PURE__ */ e(
1405
+ me,
1406
+ {
1407
+ label: "Amount",
1408
+ value: `${a.fiatAmount} ${a.fiatCurrency}`
1409
+ }
1410
+ ),
1411
+ /* @__PURE__ */ e(
1412
+ me,
1413
+ {
1414
+ label: "Receiving",
1415
+ value: `${a.cryptoAmount || "..."} ${a.cryptoCurrency}`
1416
+ }
1417
+ ),
1418
+ /* @__PURE__ */ e(me, { label: "Network", value: a.network }),
1419
+ /* @__PURE__ */ e(
1420
+ me,
1421
+ {
1422
+ label: "To Address",
1423
+ value: `${a.walletAddress.slice(0, 10)}...${a.walletAddress.slice(-8)}`,
1424
+ mono: !0
1425
+ }
1426
+ )
1427
+ ] }),
1428
+ /* @__PURE__ */ l("div", { className: "mt-6", children: [
1429
+ /* @__PURE__ */ e("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "This usually takes a few minutes." }),
1430
+ /* @__PURE__ */ e("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: "You can safely close this page - we'll send you an email when complete." })
1431
+ ] })
1432
+ ] });
1532
1433
  }
1533
- function Jt({ size: t = 32 }) {
1534
- return /* @__PURE__ */ o(
1434
+ function me({ label: t, value: a, mono: n }) {
1435
+ return /* @__PURE__ */ l(
1535
1436
  "div",
1536
1437
  {
1537
- className: "rounded-full bg-white flex items-center justify-center shrink-0",
1538
- style: { width: t, height: t, fontSize: t * 0.28, fontWeight: 700, color: "#333" },
1438
+ className: "flex justify-between items-center py-2",
1439
+ style: { borderBottom: "1px solid var(--t-divider)" },
1539
1440
  children: [
1540
- "G",
1541
- /* @__PURE__ */ e("span", { style: { color: "#4285F4", fontSize: t * 0.2 }, children: "Pay" })
1441
+ /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
1442
+ /* @__PURE__ */ e(
1443
+ "span",
1444
+ {
1445
+ className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
1446
+ style: { color: "var(--t-text)" },
1447
+ children: a
1448
+ }
1449
+ )
1542
1450
  ]
1543
1451
  }
1544
1452
  );
1545
1453
  }
1546
- function zt({ size: t = 32 }) {
1547
- return /* @__PURE__ */ e(
1454
+ function ra({
1455
+ className: t = "",
1456
+ explorerUrl: a,
1457
+ onDone: n,
1458
+ doneButtonText: s = "Done"
1459
+ }) {
1460
+ const { orderStatus: r, state: u, dispatch: m } = pe(), i = u.flowType === "sell", o = () => {
1461
+ if (!(r != null && r.transactionHash)) return null;
1462
+ if (!a) {
1463
+ const f = {
1464
+ ethereum: "https://etherscan.io/tx/{txHash}",
1465
+ polygon: "https://polygonscan.com/tx/{txHash}",
1466
+ arbitrum: "https://arbiscan.io/tx/{txHash}",
1467
+ optimism: "https://optimistic.etherscan.io/tx/{txHash}",
1468
+ base: "https://basescan.org/tx/{txHash}",
1469
+ bitcoin: "https://mempool.space/tx/{txHash}",
1470
+ solana: "https://solscan.io/tx/{txHash}",
1471
+ avalanche: "https://snowtrace.io/tx/{txHash}",
1472
+ fantom: "https://ftmscan.com/tx/{txHash}"
1473
+ };
1474
+ return (f[u.network] || f.ethereum).replace("{txHash}", r.transactionHash);
1475
+ }
1476
+ return a.replace("{txHash}", r.transactionHash);
1477
+ }, d = () => {
1478
+ n ? n() : m({ type: "RESET" });
1479
+ }, h = o();
1480
+ return /* @__PURE__ */ l("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
1481
+ /* @__PURE__ */ e(
1482
+ "div",
1483
+ {
1484
+ className: "flex items-center justify-center mb-5",
1485
+ style: { width: 64, height: 64, borderRadius: "50%", background: "var(--t-success, #10b981)" },
1486
+ children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: "32", height: "32", fill: "white", children: /* @__PURE__ */ e("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z" }) })
1487
+ }
1488
+ ),
1489
+ /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: i ? "Sale Complete!" : "Purchase Complete!" }),
1490
+ /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: i ? `Your ${(r == null ? void 0 : r.fiatCurrency) || u.fiatCurrency} payout is being processed.` : `Your ${(r == null ? void 0 : r.cryptoCurrency) || u.cryptoCurrency} has been sent to your wallet.` }),
1491
+ r && /* @__PURE__ */ l("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
1492
+ /* @__PURE__ */ e(
1493
+ te,
1494
+ {
1495
+ label: i ? "Amount Sold" : "Amount Received",
1496
+ value: `${r.cryptoAmount} ${r.cryptoCurrency}`,
1497
+ highlight: !0
1498
+ }
1499
+ ),
1500
+ /* @__PURE__ */ e(
1501
+ te,
1502
+ {
1503
+ label: i ? "Payout Amount" : "Amount Paid",
1504
+ value: `${r.fiatAmount} ${r.fiatCurrency}`
1505
+ }
1506
+ ),
1507
+ /* @__PURE__ */ e(te, { label: "Network", value: r.network }),
1508
+ /* @__PURE__ */ e(
1509
+ te,
1510
+ {
1511
+ label: "Wallet",
1512
+ value: `${r.walletAddress.slice(0, 10)}...${r.walletAddress.slice(-8)}`,
1513
+ mono: !0
1514
+ }
1515
+ ),
1516
+ r.transactionHash && /* @__PURE__ */ e(
1517
+ te,
1518
+ {
1519
+ label: "Transaction",
1520
+ value: `${r.transactionHash.slice(0, 10)}...${r.transactionHash.slice(-8)}`,
1521
+ mono: !0
1522
+ }
1523
+ ),
1524
+ /* @__PURE__ */ e(te, { label: "Provider", value: r.gateway }),
1525
+ /* @__PURE__ */ e(te, { label: "Order ID", value: r.orderId, mono: !0 }),
1526
+ r.completedAt && /* @__PURE__ */ e(
1527
+ te,
1528
+ {
1529
+ label: "Completed",
1530
+ value: new Date(r.completedAt).toLocaleString()
1531
+ }
1532
+ )
1533
+ ] }),
1534
+ /* @__PURE__ */ l("div", { className: "w-full flex flex-col gap-2", children: [
1535
+ h && /* @__PURE__ */ e(
1536
+ "a",
1537
+ {
1538
+ href: h,
1539
+ target: "_blank",
1540
+ rel: "noopener noreferrer",
1541
+ className: "w-full font-semibold text-[14px] flex items-center justify-center transition-all",
1542
+ style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)", textDecoration: "none" },
1543
+ children: "View on Explorer"
1544
+ }
1545
+ ),
1546
+ /* @__PURE__ */ e(
1547
+ "button",
1548
+ {
1549
+ className: "w-full font-semibold text-[16px] transition-all",
1550
+ style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
1551
+ onClick: d,
1552
+ children: s
1553
+ }
1554
+ )
1555
+ ] })
1556
+ ] });
1557
+ }
1558
+ function te({ label: t, value: a, mono: n, highlight: s }) {
1559
+ return /* @__PURE__ */ l(
1548
1560
  "div",
1549
1561
  {
1550
- className: "rounded-full flex items-center justify-center shrink-0",
1551
- style: { width: t, height: t, background: "#003087" },
1552
- children: /* @__PURE__ */ e("span", { className: "text-white font-bold", style: { fontSize: t * 0.38 }, children: "P" })
1562
+ className: "flex justify-between items-center py-2",
1563
+ style: { borderBottom: "1px solid var(--t-divider)" },
1564
+ children: [
1565
+ /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
1566
+ /* @__PURE__ */ e(
1567
+ "span",
1568
+ {
1569
+ className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
1570
+ style: { color: s ? "var(--t-success, #10b981)" : "var(--t-text)" },
1571
+ children: a
1572
+ }
1573
+ )
1574
+ ]
1553
1575
  }
1554
1576
  );
1555
1577
  }
1556
- function qt({ size: t = 32 }) {
1557
- return /* @__PURE__ */ e(
1558
- "div",
1559
- {
1560
- className: "rounded-full flex items-center justify-center shrink-0",
1561
- style: { width: t, height: t, background: "var(--t-card-icon-bg)" },
1562
- children: /* @__PURE__ */ o("svg", { width: t * 0.55, height: t * 0.55, viewBox: "0 0 18 14", fill: "none", children: [
1563
- /* @__PURE__ */ e("rect", { x: "0.5", y: "0.5", width: "17", height: "13", rx: "2", stroke: "var(--t-card-icon-stroke)" }),
1564
- /* @__PURE__ */ e("rect", { y: "3", width: "18", height: "3", fill: "var(--t-card-icon-stroke)" })
1578
+ function oa({
1579
+ className: t = "",
1580
+ onRetry: a,
1581
+ supportEmail: n = "support@nowramp.com"
1582
+ }) {
1583
+ const { state: s, orderStatus: r, dispatch: u, goToStep: m } = pe(), i = s.flowType === "sell", o = () => {
1584
+ if (r)
1585
+ switch (r.status) {
1586
+ case "failed":
1587
+ return "Payment Failed";
1588
+ case "cancelled":
1589
+ return "Order Cancelled";
1590
+ case "expired":
1591
+ return "Order Expired";
1592
+ case "refunded":
1593
+ return "Order Refunded";
1594
+ default:
1595
+ return "Something Went Wrong";
1596
+ }
1597
+ return "Something Went Wrong";
1598
+ }, d = () => {
1599
+ if (s.errorMessage) return s.errorMessage;
1600
+ if (r)
1601
+ switch (r.status) {
1602
+ case "failed":
1603
+ return i ? "Your sale could not be processed. Please try again." : "Your payment could not be processed. Please try again or use a different payment method.";
1604
+ case "cancelled":
1605
+ return i ? "Your sale was cancelled. No crypto was transferred." : "Your order was cancelled. No payment was processed.";
1606
+ case "expired":
1607
+ return i ? "Your order has expired. Please start a new sale." : "Your order has expired. Please start a new purchase.";
1608
+ case "refunded":
1609
+ return i ? "Your crypto has been returned. The funds should appear in your wallet shortly." : "Your payment has been refunded. The funds should appear in your account within 5-10 business days.";
1610
+ default:
1611
+ return "An unexpected error occurred. Please try again.";
1612
+ }
1613
+ return "An unexpected error occurred. Please try again.";
1614
+ }, h = () => {
1615
+ u({ type: "CLEAR_ERROR" }), a ? a() : (u({ type: "RESET" }), m("amount"));
1616
+ }, f = () => {
1617
+ u({ type: "RESET" }), m("amount");
1618
+ };
1619
+ return /* @__PURE__ */ l("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
1620
+ /* @__PURE__ */ e(
1621
+ "div",
1622
+ {
1623
+ className: "flex items-center justify-center mb-5",
1624
+ style: { width: 64, height: 64, borderRadius: "50%", background: "var(--t-error, #EF4444)" },
1625
+ children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: "32", height: "32", fill: "white", children: /* @__PURE__ */ e("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" }) })
1626
+ }
1627
+ ),
1628
+ /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: o() }),
1629
+ /* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: d() }),
1630
+ r && /* @__PURE__ */ l("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
1631
+ /* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
1632
+ /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Order ID" }),
1633
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children: r.orderId })
1634
+ ] }),
1635
+ /* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", children: [
1636
+ /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Status" }),
1637
+ /* @__PURE__ */ e(
1638
+ "span",
1639
+ {
1640
+ className: "text-[12px] font-medium px-2 py-0.5",
1641
+ style: { background: "rgba(239,68,68,0.15)", color: "#EF4444", borderRadius: 4 },
1642
+ children: r.gatewayStatus
1643
+ }
1644
+ )
1565
1645
  ] })
1566
- }
1567
- );
1568
- }
1569
- function va({ size: t = 18 }) {
1570
- return /* @__PURE__ */ e(
1571
- "div",
1572
- {
1573
- className: "rounded-full bg-white flex items-center justify-center shrink-0",
1574
- style: { width: t, height: t },
1575
- children: /* @__PURE__ */ e("span", { className: "text-black font-bold", style: { fontSize: t * 0.55 }, children: "C" })
1576
- }
1577
- );
1578
- }
1579
- function Te() {
1580
- return /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ e("path", { d: "M3 4.5L6 7.5L9 4.5", stroke: "var(--t-text-secondary)", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }) });
1581
- }
1582
- function ea() {
1583
- return /* @__PURE__ */ e("svg", { width: "8", height: "14", viewBox: "0 0 8 14", fill: "none", children: /* @__PURE__ */ e("path", { d: "M1 1L7 7L1 13", stroke: "var(--t-icon-stroke)", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }) });
1584
- }
1585
- function ta({ onClick: t }) {
1586
- return /* @__PURE__ */ e("button", { onClick: t, className: "hover:opacity-70 transition-opacity", children: /* @__PURE__ */ e("svg", { width: "24", height: "16", viewBox: "0 0 24 16", fill: "none", children: /* @__PURE__ */ e(
1587
- "path",
1588
- {
1589
- d: "M4 0.799805H20C21.7673 0.799805 23.2002 2.23269 23.2002 4V12C23.2002 13.7673 21.7673 15.2002 20 15.2002H4C2.23269 15.2002 0.799805 13.7673 0.799805 12V4C0.799805 2.23269 2.23269 0.799805 4 0.799805Z",
1590
- stroke: "var(--t-icon-stroke)",
1591
- strokeWidth: "1.6"
1592
- }
1593
- ) }) });
1594
- }
1595
- function aa({ size: t = 40 }) {
1596
- return /* @__PURE__ */ e(
1597
- "div",
1598
- {
1599
- className: "rounded-full flex items-center justify-center shrink-0",
1600
- style: { width: t, height: t, background: "var(--t-surface)" },
1601
- children: /* @__PURE__ */ o("svg", { width: t * 0.5, height: t * 0.5, viewBox: "0 0 20 20", fill: "none", children: [
1602
- /* @__PURE__ */ e("circle", { cx: "10", cy: "10", r: "7.5", stroke: "var(--t-text)", strokeWidth: "1.5" }),
1603
- /* @__PURE__ */ e("path", { d: "M10 2.5A7.5 7.5 0 0 1 10 17.5", fill: "var(--t-text)" })
1646
+ ] }),
1647
+ /* @__PURE__ */ l("div", { className: "w-full flex flex-col gap-2", children: [
1648
+ /* @__PURE__ */ e(
1649
+ "button",
1650
+ {
1651
+ className: "w-full font-semibold text-[16px] transition-all",
1652
+ style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
1653
+ onClick: h,
1654
+ children: "Try Again"
1655
+ }
1656
+ ),
1657
+ /* @__PURE__ */ e(
1658
+ "button",
1659
+ {
1660
+ className: "w-full font-semibold text-[14px] transition-all",
1661
+ style: { height: 48, borderRadius: 5, background: "var(--t-surface)", color: "var(--t-text)" },
1662
+ onClick: f,
1663
+ children: "Start Over"
1664
+ }
1665
+ )
1666
+ ] }),
1667
+ /* @__PURE__ */ l("div", { className: "mt-6", children: [
1668
+ /* @__PURE__ */ l("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: [
1669
+ "Need help? Contact",
1670
+ " ",
1671
+ /* @__PURE__ */ e(
1672
+ "a",
1673
+ {
1674
+ href: `mailto:${n}`,
1675
+ className: "underline",
1676
+ style: { color: "var(--t-accent)" },
1677
+ children: n
1678
+ }
1679
+ )
1680
+ ] }),
1681
+ r && /* @__PURE__ */ l("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: [
1682
+ "Reference: ",
1683
+ r.orderId
1604
1684
  ] })
1605
- }
1606
- );
1685
+ ] })
1686
+ ] });
1607
1687
  }
1608
- function Na(t, a = 32) {
1609
- switch (t) {
1610
- case "revolut":
1611
- return /* @__PURE__ */ e(Qt, { size: a });
1612
- case "applepay":
1613
- return /* @__PURE__ */ e(Zt, { size: a });
1614
- case "card":
1615
- return /* @__PURE__ */ e(qt, { size: a });
1616
- case "googlepay":
1617
- return /* @__PURE__ */ e(Jt, { size: a });
1618
- case "paypal":
1619
- return /* @__PURE__ */ e(zt, { size: a });
1620
- case "bank":
1621
- return /* @__PURE__ */ e(jt, { size: a });
1622
- default:
1623
- return /* @__PURE__ */ e(ft, { size: a });
1624
- }
1688
+ function pt(t) {
1689
+ return t.length <= 12 ? t : `${t.slice(0, 6)}...${t.slice(-6)}`;
1625
1690
  }
1626
- function Le({ onClick: t }) {
1627
- return /* @__PURE__ */ e(
1628
- "button",
1629
- {
1630
- onClick: t,
1631
- className: "flex items-center justify-center transition-colors rounded-full shrink-0",
1632
- style: { width: 30, height: 30, backgroundColor: "var(--t-close-bg)" },
1633
- onMouseEnter: (a) => a.currentTarget.style.backgroundColor = "var(--t-close-hover)",
1634
- onMouseLeave: (a) => a.currentTarget.style.backgroundColor = "var(--t-close-bg)",
1635
- children: /* @__PURE__ */ e("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ e("path", { d: "M1 1L9 9M9 1L1 9", stroke: "var(--t-icon-close)", strokeWidth: "1.4", strokeLinecap: "round" }) })
1691
+ function la({ className: t = "" }) {
1692
+ const {
1693
+ config: a,
1694
+ configLoading: n,
1695
+ state: s,
1696
+ defaultGateway: r,
1697
+ fetchQuotes: u,
1698
+ createOrder: m,
1699
+ orderLoading: i
1700
+ } = pe(), o = s.flowType === "sell", [d, h] = N(null), f = a == null ? void 0 : a.gateways.find((g) => g.id === r), x = async () => {
1701
+ h(null);
1702
+ try {
1703
+ u(), await m();
1704
+ } catch (g) {
1705
+ const p = g instanceof Error ? g.message : "Failed to create order";
1706
+ h(p);
1636
1707
  }
1637
- );
1638
- }
1639
- function Xe({
1640
- value: t,
1641
- onChange: a,
1642
- placeholder: n = ""
1643
- }) {
1644
- return /* @__PURE__ */ o("div", { className: "relative mx-5 mb-5", children: [
1708
+ };
1709
+ return n ? /* @__PURE__ */ l("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
1710
+ /* @__PURE__ */ e("div", { className: "nramp-spinner" }),
1711
+ /* @__PURE__ */ e("p", { className: "text-[14px] mt-4", style: { color: "var(--t-text-secondary)" }, children: "Loading..." })
1712
+ ] }) : /* @__PURE__ */ l("div", { className: `flex flex-col items-center px-8 py-12 ${t}`, children: [
1713
+ /* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-6", style: { color: "var(--t-text)" }, children: o ? "Confirm Sale" : "Confirm Purchase" }),
1714
+ /* @__PURE__ */ l("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
1715
+ f && /* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
1716
+ /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Provider" }),
1717
+ /* @__PURE__ */ l("span", { className: "flex items-center gap-2", children: [
1718
+ f.logo && /* @__PURE__ */ e("img", { src: f.logo, alt: f.name, width: 20, height: 20, style: { borderRadius: 4 } }),
1719
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: f.name })
1720
+ ] })
1721
+ ] }),
1722
+ o ? /* @__PURE__ */ l(J, { children: [
1723
+ /* @__PURE__ */ e(le, { label: "You sell", value: `${s.cryptoAmount} ${s.cryptoCurrency}`, highlight: !0 }),
1724
+ /* @__PURE__ */ e(le, { label: "You receive", value: `${s.fiatCurrency} payout` })
1725
+ ] }) : /* @__PURE__ */ l(J, { children: [
1726
+ /* @__PURE__ */ e(le, { label: "You pay", value: `${s.fiatAmount} ${s.fiatCurrency}`, highlight: !0 }),
1727
+ /* @__PURE__ */ e(le, { label: "You receive", value: `${s.cryptoCurrency} on ${s.network}` }),
1728
+ /* @__PURE__ */ e(le, { label: "Wallet", value: pt(s.walletAddress), mono: !0 })
1729
+ ] }),
1730
+ /* @__PURE__ */ e(le, { label: "Network", value: s.network }),
1731
+ o && s.walletAddress && /* @__PURE__ */ e(le, { label: "Refund address", value: pt(s.walletAddress), mono: !0 })
1732
+ ] }),
1733
+ d && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: d }),
1645
1734
  /* @__PURE__ */ e(
1646
- "input",
1735
+ "button",
1647
1736
  {
1648
- type: "text",
1649
- value: t,
1650
- onChange: (l) => a(l.target.value),
1651
- placeholder: n,
1652
- style: { height: 47, borderRadius: 4.5, borderColor: "var(--t-border)", color: "var(--t-text)", paddingLeft: 14, paddingRight: t ? 40 : 14, fontSize: 14 },
1653
- className: "w-full bg-transparent border outline-none transition-colors"
1737
+ className: "w-full font-semibold text-[16px] transition-all flex items-center justify-center gap-2",
1738
+ style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", opacity: i ? 0.7 : 1 },
1739
+ disabled: i,
1740
+ onClick: x,
1741
+ children: i ? /* @__PURE__ */ l(J, { children: [
1742
+ /* @__PURE__ */ e("span", { className: "nramp-spinner-inline" }),
1743
+ "Processing..."
1744
+ ] }) : o ? "Confirm & Sell" : "Confirm & Pay"
1654
1745
  }
1655
- ),
1656
- t && /* @__PURE__ */ e(
1657
- "button",
1746
+ )
1747
+ ] });
1748
+ }
1749
+ function le({ label: t, value: a, mono: n, highlight: s }) {
1750
+ return /* @__PURE__ */ l("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
1751
+ /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
1752
+ /* @__PURE__ */ e(
1753
+ "span",
1658
1754
  {
1659
- onClick: () => a(""),
1660
- className: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center transition-colors rounded",
1661
- style: { width: 22, height: 22, backgroundColor: "var(--t-close-bg)", borderRadius: 4 },
1662
- children: /* @__PURE__ */ e("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", children: /* @__PURE__ */ e("path", { d: "M1 1L7 7M7 1L1 7", stroke: "var(--t-icon-close)", strokeWidth: "1.2", strokeLinecap: "round" }) })
1755
+ className: `text-[13px] font-medium ${n ? "font-mono" : ""}`,
1756
+ style: { color: s ? "var(--t-success, #10b981)" : "var(--t-text)" },
1757
+ children: a
1663
1758
  }
1664
1759
  )
1665
1760
  ] });
1666
1761
  }
1667
- function na({ onClose: t, onSelect: a, currencies: n, assetBaseUrl: l = "" }) {
1668
- const [r, d] = C(""), u = X(() => {
1669
- if (!n || n.length === 0) return lt;
1670
- const c = new Map(lt.map((i) => [i.code, i.name]));
1671
- return n.map((i) => ({
1672
- code: i.code,
1673
- name: i.name || c.get(i.code) || i.code
1762
+ function sa({ char: t, height: a = 38 }) {
1763
+ const n = "0123456789", s = n.indexOf(t);
1764
+ return s === -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(-${s * a}px)` }, children: n.split("").map((r) => /* @__PURE__ */ e("span", { className: "block", style: { height: a, lineHeight: `${a}px` }, children: r }, r)) }) });
1765
+ }
1766
+ function ca({
1767
+ value: t,
1768
+ height: a = 38,
1769
+ className: n = "",
1770
+ style: s = {}
1771
+ }) {
1772
+ return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", ...s }, children: t.split("").map((r, u) => /* @__PURE__ */ e(sa, { char: r, height: a }, u)) });
1773
+ }
1774
+ function M({
1775
+ w: t,
1776
+ h: a,
1777
+ className: n = ""
1778
+ }) {
1779
+ return /* @__PURE__ */ e("div", { className: `skeleton ${n}`, style: { width: t, height: a } });
1780
+ }
1781
+ function ia() {
1782
+ return /* @__PURE__ */ l("div", { className: "flex-1 px-5 flex flex-col", children: [
1783
+ /* @__PURE__ */ l("div", { className: "px-[18px] pt-[14px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5 }, children: [
1784
+ /* @__PURE__ */ e(M, { w: 70, h: 14, className: "mb-3" }),
1785
+ /* @__PURE__ */ l("div", { className: "flex justify-between items-center", children: [
1786
+ /* @__PURE__ */ e(M, { w: 120, h: 32 }),
1787
+ /* @__PURE__ */ e(M, { w: 75, h: 32 })
1788
+ ] })
1789
+ ] }),
1790
+ /* @__PURE__ */ l("div", { className: "px-[18px] pt-[12px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5, marginTop: 4 }, children: [
1791
+ /* @__PURE__ */ e(M, { w: 50, h: 14, className: "mb-3" }),
1792
+ /* @__PURE__ */ l("div", { className: "flex justify-between items-center", children: [
1793
+ /* @__PURE__ */ e(M, { w: 180, h: 32 }),
1794
+ /* @__PURE__ */ e(M, { w: 85, h: 32 })
1795
+ ] })
1796
+ ] }),
1797
+ /* @__PURE__ */ l("div", { className: "flex justify-between mt-3 px-[2px]", children: [
1798
+ /* @__PURE__ */ e(M, { w: 140, h: 12 }),
1799
+ /* @__PURE__ */ e(M, { w: 90, h: 12 })
1800
+ ] }),
1801
+ /* @__PURE__ */ l("div", { className: "mt-8", children: [
1802
+ /* @__PURE__ */ e(M, { w: 65, h: 14, className: "mb-2.5" }),
1803
+ /* @__PURE__ */ e(M, { w: "100%", h: 47 })
1804
+ ] }),
1805
+ /* @__PURE__ */ e("div", { className: "flex-1" }),
1806
+ /* @__PURE__ */ e(M, { w: "100%", h: 60, className: "mb-2" }),
1807
+ /* @__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" }) })
1808
+ ] });
1809
+ }
1810
+ function da({ onClose: t, onSelect: a, currencies: n, assetBaseUrl: s = "" }) {
1811
+ const [r, u] = N(""), m = F(() => {
1812
+ if (!n || n.length === 0) return st;
1813
+ const o = new Map(st.map((d) => [d.code, d.name]));
1814
+ return n.map((d) => ({
1815
+ code: d.code,
1816
+ name: d.name || o.get(d.code) || d.code
1674
1817
  }));
1675
- }, [n]), m = X(() => {
1676
- const c = r.trim().toLowerCase();
1677
- return c ? u.filter(
1678
- (i) => i.code.toLowerCase().includes(c) || i.name.toLowerCase().includes(c)
1679
- ) : u;
1680
- }, [u, r]);
1681
- return /* @__PURE__ */ o(le, { children: [
1682
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Le, { onClick: t }) }),
1818
+ }, [n]), i = F(() => {
1819
+ const o = r.trim().toLowerCase();
1820
+ return o ? m.filter(
1821
+ (d) => d.code.toLowerCase().includes(o) || d.name.toLowerCase().includes(o)
1822
+ ) : m;
1823
+ }, [m, r]);
1824
+ return /* @__PURE__ */ l(J, { children: [
1825
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
1683
1826
  /* @__PURE__ */ e(
1684
1827
  "h2",
1685
1828
  {
@@ -1688,64 +1831,64 @@ function na({ onClose: t, onSelect: a, currencies: n, assetBaseUrl: l = "" }) {
1688
1831
  children: "Select fiat currency"
1689
1832
  }
1690
1833
  ),
1691
- /* @__PURE__ */ e(Xe, { value: r, onChange: d }),
1692
- /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
1693
- m.map((c) => /* @__PURE__ */ o(
1834
+ /* @__PURE__ */ e(Be, { value: r, onChange: u }),
1835
+ /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
1836
+ i.map((o) => /* @__PURE__ */ l(
1694
1837
  "button",
1695
1838
  {
1696
- onClick: () => a(c.code),
1839
+ onClick: () => a(o.code),
1697
1840
  className: "flex items-center gap-3.5 w-full py-3.5 transition-colors",
1698
1841
  style: { color: "var(--t-text)" },
1699
1842
  children: [
1700
- /* @__PURE__ */ e(_e, { currencyCode: c.code, size: 32, baseUrl: l }),
1701
- /* @__PURE__ */ o("div", { className: "text-left", children: [
1702
- /* @__PURE__ */ e("div", { className: "font-semibold text-[15px] leading-tight", children: c.code }),
1703
- /* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children: c.name })
1843
+ /* @__PURE__ */ e(Xe, { currencyCode: o.code, size: 32, baseUrl: s }),
1844
+ /* @__PURE__ */ l("div", { className: "text-left", children: [
1845
+ /* @__PURE__ */ e("div", { className: "font-semibold text-[15px] leading-tight", children: o.code }),
1846
+ /* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children: o.name })
1704
1847
  ] })
1705
1848
  ]
1706
1849
  },
1707
- c.code
1850
+ o.code
1708
1851
  )),
1709
- m.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
1852
+ i.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
1710
1853
  ] })
1711
1854
  ] });
1712
1855
  }
1713
- function ra({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: l = "" }) {
1714
- const [r, d] = C(""), u = X(() => {
1715
- if (!n || n.length === 0) return Vt;
1716
- const c = [];
1717
- for (const i of n) {
1718
- const h = i.networks || [];
1856
+ function ua({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: s = "" }) {
1857
+ const [r, u] = N(""), m = F(() => {
1858
+ if (!n || n.length === 0) return _t;
1859
+ const o = [];
1860
+ for (const d of n) {
1861
+ const h = d.networks || [];
1719
1862
  if (h.length === 0)
1720
- c.push({ code: i.code, name: i.name || i.code, chain: i.code, popular: !1 });
1863
+ o.push({ code: d.code, name: d.name || d.code, chain: d.code, popular: !1 });
1721
1864
  else
1722
1865
  for (const f of h) {
1723
- const x = f.code || f.id || f.name || i.code;
1724
- c.push({
1725
- code: i.code,
1726
- name: i.name || i.code,
1866
+ const x = f.code || f.id || f.name || d.code;
1867
+ o.push({
1868
+ code: d.code,
1869
+ name: d.name || d.code,
1727
1870
  chain: x,
1728
1871
  chainName: f.name,
1729
1872
  popular: !1
1730
1873
  });
1731
1874
  }
1732
1875
  }
1733
- return c;
1734
- }, [n]), m = X(() => {
1876
+ return o;
1877
+ }, [n]), i = F(() => {
1735
1878
  var f;
1736
- const c = r.trim().toLowerCase();
1737
- if (!c) return u;
1738
- const i = c.split(/\s+/), h = [];
1739
- for (const x of u) {
1740
- const g = Re[x.chain], p = g ? g.name.toLowerCase() : "", b = ((f = g == null ? void 0 : g.shortName) == null ? void 0 : f.toLowerCase()) || "", L = x.chain.toLowerCase(), O = x.code.toLowerCase(), A = x.name.toLowerCase(), G = [O, A, p, b, L];
1741
- if (!i.every((Z) => G.some((s) => s.includes(Z)))) continue;
1742
- let W = 0;
1743
- O === c ? W += 100 : O.startsWith(i[0]) && (W += 50), x.popular && (W += 10), i.length > 1 && (p.includes(i[1]) || b.includes(i[1]) || L.includes(i[1])) && (W += 25), h.push({ item: x, score: W });
1879
+ const o = r.trim().toLowerCase();
1880
+ if (!o) return m;
1881
+ const d = o.split(/\s+/), h = [];
1882
+ for (const x of m) {
1883
+ const g = Ie[x.chain], p = g ? g.name.toLowerCase() : "", b = ((f = g == null ? void 0 : g.shortName) == null ? void 0 : f.toLowerCase()) || "", S = x.chain.toLowerCase(), P = x.code.toLowerCase(), w = x.name.toLowerCase(), G = [P, w, p, b, S];
1884
+ if (!d.every((z) => G.some((c) => c.includes(z)))) continue;
1885
+ let j = 0;
1886
+ P === o ? j += 100 : P.startsWith(d[0]) && (j += 50), x.popular && (j += 10), d.length > 1 && (p.includes(d[1]) || b.includes(d[1]) || S.includes(d[1])) && (j += 25), h.push({ item: x, score: j });
1744
1887
  }
1745
1888
  return h.sort((x, g) => g.score - x.score), h.map((x) => x.item);
1746
- }, [u, r]);
1747
- return /* @__PURE__ */ o(le, { children: [
1748
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Le, { onClick: t }) }),
1889
+ }, [m, r]);
1890
+ return /* @__PURE__ */ l(J, { children: [
1891
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
1749
1892
  /* @__PURE__ */ e(
1750
1893
  "h2",
1751
1894
  {
@@ -1754,22 +1897,22 @@ function ra({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: l = "" }) {
1754
1897
  children: "Select crypto currency"
1755
1898
  }
1756
1899
  ),
1757
- /* @__PURE__ */ e(Xe, { value: r, onChange: d }),
1758
- /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
1759
- m.map((c) => {
1760
- const i = Re[c.chain], h = (i == null ? void 0 : i.name) || c.chainName || c.chain;
1761
- return /* @__PURE__ */ o(
1900
+ /* @__PURE__ */ e(Be, { value: r, onChange: u }),
1901
+ /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
1902
+ i.map((o) => {
1903
+ const d = Ie[o.chain], h = (d == null ? void 0 : d.name) || o.chainName || o.chain;
1904
+ return /* @__PURE__ */ l(
1762
1905
  "button",
1763
1906
  {
1764
- onClick: () => a(c.code, c.chain),
1907
+ onClick: () => a(o.code, o.chain),
1765
1908
  className: "flex items-center gap-3.5 w-full py-3.5 transition-colors",
1766
1909
  children: [
1767
- /* @__PURE__ */ o("div", { className: "relative shrink-0", style: { width: 40, height: 40 }, children: [
1910
+ /* @__PURE__ */ l("div", { className: "relative shrink-0", style: { width: 40, height: 40 }, children: [
1768
1911
  /* @__PURE__ */ e(
1769
1912
  "img",
1770
1913
  {
1771
- src: ht(c.code, l),
1772
- alt: c.code,
1914
+ src: yt(o.code, s),
1915
+ alt: o.code,
1773
1916
  width: 32,
1774
1917
  height: 32,
1775
1918
  className: "rounded-full absolute top-0 left-0",
@@ -1779,8 +1922,8 @@ function ra({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: l = "" }) {
1779
1922
  /* @__PURE__ */ e(
1780
1923
  "img",
1781
1924
  {
1782
- src: Ke(c.chain, l),
1783
- alt: c.chain,
1925
+ src: _e(o.chain, s),
1926
+ alt: o.chain,
1784
1927
  width: 16,
1785
1928
  height: 16,
1786
1929
  className: "rounded-full absolute",
@@ -1794,28 +1937,28 @@ function ra({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: l = "" }) {
1794
1937
  }
1795
1938
  )
1796
1939
  ] }),
1797
- /* @__PURE__ */ o("div", { className: "text-left flex-1 min-w-0", children: [
1940
+ /* @__PURE__ */ l("div", { className: "text-left flex-1 min-w-0", children: [
1798
1941
  /* @__PURE__ */ e(
1799
1942
  "div",
1800
1943
  {
1801
1944
  className: "font-semibold text-[15px] leading-tight",
1802
1945
  style: { color: "var(--t-text)" },
1803
- children: c.code
1946
+ children: o.code
1804
1947
  }
1805
1948
  ),
1806
- /* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children: c.name })
1949
+ /* @__PURE__ */ e("div", { className: "text-[13px] mt-0.5", style: { color: "var(--t-text-secondary)" }, children: o.name })
1807
1950
  ] }),
1808
1951
  /* @__PURE__ */ e("div", { className: "text-right shrink-0", children: /* @__PURE__ */ e("div", { className: "text-[13px]", style: { color: "var(--t-text-muted)" }, children: h }) })
1809
1952
  ]
1810
1953
  },
1811
- `${c.code}-${c.chain}`
1954
+ `${o.code}-${o.chain}`
1812
1955
  );
1813
1956
  }),
1814
- m.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
1957
+ i.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No currencies found" })
1815
1958
  ] })
1816
1959
  ] });
1817
1960
  }
1818
- function oa({
1961
+ function ma({
1819
1962
  checked: t,
1820
1963
  onChange: a,
1821
1964
  accentColor: n = "var(--t-accent)"
@@ -1845,23 +1988,23 @@ function oa({
1845
1988
  }
1846
1989
  );
1847
1990
  }
1848
- const la = [
1991
+ const pa = [
1849
1992
  { label: "Privacy policy", href: "https://nowramp.com/privacy-policy" },
1850
1993
  { label: "Terms of use", href: "https://nowramp.com/terms-and-conditions" }
1851
1994
  ];
1852
- function ca({
1995
+ function ha({
1853
1996
  onClose: t,
1854
1997
  darkMode: a,
1855
1998
  onToggleDarkMode: n,
1856
- skinId: l,
1999
+ skinId: s,
1857
2000
  onSelectSkin: r
1858
2001
  }) {
1859
- return /* @__PURE__ */ o(le, { children: [
1860
- /* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(Le, { onClick: t }) }),
1861
- /* @__PURE__ */ o("div", { className: "px-5 flex-1 pt-6 overflow-y-auto custom-scroll", children: [
1862
- /* @__PURE__ */ e("div", { style: { borderTop: "1px solid var(--t-divider)" }, children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between w-full py-5", children: [
1863
- /* @__PURE__ */ o("div", { className: "flex items-center gap-3.5", children: [
1864
- /* @__PURE__ */ e(aa, { size: 40 }),
2002
+ return /* @__PURE__ */ l(J, { children: [
2003
+ /* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
2004
+ /* @__PURE__ */ l("div", { className: "px-5 flex-1 pt-6 overflow-y-auto custom-scroll", children: [
2005
+ /* @__PURE__ */ e("div", { style: { borderTop: "1px solid var(--t-divider)" }, children: /* @__PURE__ */ l("div", { className: "flex items-center justify-between w-full py-5", children: [
2006
+ /* @__PURE__ */ l("div", { className: "flex items-center gap-3.5", children: [
2007
+ /* @__PURE__ */ e(Zt, { size: 40 }),
1865
2008
  /* @__PURE__ */ e(
1866
2009
  "span",
1867
2010
  {
@@ -1871,14 +2014,14 @@ function ca({
1871
2014
  }
1872
2015
  )
1873
2016
  ] }),
1874
- /* @__PURE__ */ e(oa, { checked: a, onChange: n, accentColor: "#4CD964" })
2017
+ /* @__PURE__ */ e(ma, { checked: a, onChange: n, accentColor: "#4CD964" })
1875
2018
  ] }) }),
1876
2019
  /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider)" } }),
1877
- la.map((d) => /* @__PURE__ */ o("div", { children: [
1878
- /* @__PURE__ */ o(
2020
+ pa.map((u) => /* @__PURE__ */ l("div", { children: [
2021
+ /* @__PURE__ */ l(
1879
2022
  "a",
1880
2023
  {
1881
- href: d.href,
2024
+ href: u.href,
1882
2025
  target: "_blank",
1883
2026
  rel: "noopener noreferrer",
1884
2027
  className: "flex items-center justify-between w-full py-5 transition-colors",
@@ -1888,201 +2031,206 @@ function ca({
1888
2031
  {
1889
2032
  className: "font-medium text-[15px]",
1890
2033
  style: { color: "var(--t-text)" },
1891
- children: d.label
2034
+ children: u.label
1892
2035
  }
1893
2036
  ),
1894
- /* @__PURE__ */ e(ea, {})
2037
+ /* @__PURE__ */ e(Wt, {})
1895
2038
  ]
1896
2039
  }
1897
2040
  ),
1898
2041
  /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider)" } })
1899
- ] }, d.label))
2042
+ ] }, u.label))
1900
2043
  ] })
1901
2044
  ] });
1902
2045
  }
1903
- function sa({
2046
+ function fa({
1904
2047
  className: t = "",
1905
2048
  theme: a = "dark",
1906
2049
  skinId: n = "mono",
1907
- accentColor: l,
2050
+ accentColor: s,
1908
2051
  bgColor: r,
1909
- bgImage: d,
1910
- borderColor: u,
1911
- borderRadius: m,
1912
- showFlowToggle: c = !0,
1913
- autoRedirect: i = !1,
2052
+ bgImage: u,
2053
+ borderColor: m,
2054
+ borderRadius: i,
2055
+ showFlowToggle: o = !0,
2056
+ autoRedirect: d = !1,
1914
2057
  explorerUrl: h,
1915
2058
  doneButtonText: f = "Done",
1916
2059
  supportEmail: x,
1917
2060
  onDone: g
1918
2061
  }) {
1919
- var Je, ze, qe, et, tt, at, nt;
2062
+ var ze, qe, et, tt, at, nt, rt, ot;
1920
2063
  const {
1921
2064
  state: p,
1922
2065
  dispatch: b,
1923
- config: L,
1924
- configLoading: O,
1925
- quotes: A,
2066
+ config: S,
2067
+ configLoading: P,
2068
+ quotes: w,
1926
2069
  quotesLoading: G,
1927
- quotesError: j,
1928
- fetchQuotes: W,
1929
- createOrder: Z,
1930
- orderLoading: s,
1931
- amountError: P,
1932
- fieldLocks: v,
1933
- apiConfig: I,
1934
- assetBaseUrl: D
1935
- } = pe(), [F, K] = C(a === "dark"), [ge, he] = C(n), [fe, Y] = C(null), [ye, ee] = C(!1), [ve, ce] = C(!1), [se, Ne] = C(!1), [V, te] = C(null), [ae, Ce] = C(!0), [be, Ee] = C(!1), [J, ie] = C(!1), Ie = U(null), xe = U(), N = U(p.flowType);
1936
- H(() => {
1937
- K(a === "dark");
1938
- }, [a]), H(() => {
1939
- const y = setTimeout(() => Ce(!1), O ? 0 : 800);
2070
+ quotesError: Q,
2071
+ fetchQuotes: j,
2072
+ createOrder: z,
2073
+ orderLoading: c,
2074
+ amountError: O,
2075
+ fieldLocks: C,
2076
+ apiConfig: L,
2077
+ assetBaseUrl: K
2078
+ } = pe(), [X, $] = N(a === "dark"), [Ne, he] = N(n), [fe, Y] = N(null), [ye, ae] = N(!1), [Ce, se] = N(!1), [ce, be] = N(!1), [V, ne] = N(null), [re, Ee] = N(!0), [Ae, we] = N(!1), [q, ie] = N(!1), Oe = D(null), xe = D(), v = D(p.flowType);
2079
+ U(() => {
2080
+ $(a === "dark");
2081
+ }, [a]), U(() => {
2082
+ const y = setTimeout(() => Ee(!1), P ? 0 : 800);
1940
2083
  return () => clearTimeout(y);
1941
- }, [O]), H(() => {
1942
- if (N.current !== p.flowType && !ae) {
1943
- N.current = p.flowType, Ee(!0), ee(!1), ce(!1);
1944
- const y = setTimeout(() => Ee(!1), 350);
2084
+ }, [P]), U(() => {
2085
+ if (v.current !== p.flowType && !re) {
2086
+ v.current = p.flowType, we(!0), ae(!1), se(!1);
2087
+ const y = setTimeout(() => we(!1), 350);
1945
2088
  return () => clearTimeout(y);
1946
2089
  }
1947
- N.current = p.flowType;
1948
- }, [p.flowType, ae]);
1949
- const S = p.flowType, R = S === "buy", k = p.cryptoCurrency || "BTC", w = p.fiatCurrency || "USD", _ = R ? p.fiatAmount : p.cryptoAmount, ne = Yt(_), de = (Je = A == null ? void 0 : A.bestQuote) != null && Je.exchangeRate ? parseFloat(A.bestQuote.exchangeRate) : null, Ae = U(null);
1950
- de && k && w && (Ae.current = { rate: de, crypto: k, fiat: w });
1951
- const yt = X(() => {
1952
- if (A != null && A.bestQuote) {
1953
- const y = R ? A.bestQuote.cryptoAmount : A.bestQuote.fiatAmount;
2090
+ v.current = p.flowType;
2091
+ }, [p.flowType, re]);
2092
+ const E = p.flowType, R = E === "buy", k = p.cryptoCurrency || "BTC", T = p.fiatCurrency || "USD", H = R ? p.fiatAmount : p.cryptoAmount, W = Kt(H), de = (ze = w == null ? void 0 : w.bestQuote) != null && ze.exchangeRate ? parseFloat(w.bestQuote.exchangeRate) : null, Se = D(null);
2093
+ de && k && T && (Se.current = { rate: de, crypto: k, fiat: T });
2094
+ const gt = F(() => {
2095
+ if (w != null && w.bestQuote) {
2096
+ const y = R ? w.bestQuote.cryptoAmount : w.bestQuote.fiatAmount;
1954
2097
  if (y) return y;
1955
2098
  }
1956
2099
  return "0";
1957
- }, [A, R]), xt = X(() => {
1958
- var M, z, Oe;
1959
- const y = de || ((M = Ae.current) == null ? void 0 : M.rate), E = de ? k : (z = Ae.current) == null ? void 0 : z.crypto, T = de ? w : (Oe = Ae.current) == null ? void 0 : Oe.fiat;
1960
- return !y || !E || !T ? "" : `1 ${E} ≈ ${y.toFixed(2)} ${T}`;
1961
- }, [k, w, de]);
1962
- H(() => {
1963
- const y = p.walletAddress.trim(), E = p.network;
2100
+ }, [w, R]), vt = F(() => {
2101
+ var B, ee, Ue;
2102
+ const y = de || ((B = Se.current) == null ? void 0 : B.rate), A = de ? k : (ee = Se.current) == null ? void 0 : ee.crypto, I = de ? T : (Ue = Se.current) == null ? void 0 : Ue.fiat;
2103
+ return !y || !A || !I ? "" : `1 ${A} ≈ ${y.toFixed(2)} ${I}`;
2104
+ }, [k, T, de]);
2105
+ U(() => {
2106
+ const y = p.walletAddress.trim(), A = p.network;
1964
2107
  if (!y || y.length < 10) {
1965
- te(null), b({ type: "SET_WALLET_ERROR", message: "" });
2108
+ ne(null), b({ type: "SET_WALLET_ERROR", message: "" });
1966
2109
  return;
1967
2110
  }
1968
- return Ne(!0), te(null), clearTimeout(xe.current), xe.current = setTimeout(async () => {
1969
- var T, M, z;
2111
+ return be(!0), ne(null), clearTimeout(xe.current), xe.current = setTimeout(async () => {
2112
+ var I, B, ee;
1970
2113
  try {
1971
- const Pe = await (await fetch(`${I.apiUrl}/public/validate/address`, {
2114
+ const De = await (await fetch(`${L.apiUrl}/public/validate/address`, {
1972
2115
  method: "POST",
1973
2116
  headers: { "Content-Type": "application/json" },
1974
- body: JSON.stringify({ address: y, ...E ? { network: E } : {} })
1975
- })).json(), He = ((T = Pe.data) == null ? void 0 : T.attributes) || Pe.data || Pe;
1976
- if (He.isValid)
1977
- te(!0), b({ type: "SET_WALLET_ERROR", message: "" });
2117
+ body: JSON.stringify({ address: y, ...A ? { network: A } : {} })
2118
+ })).json(), Fe = ((I = De.data) == null ? void 0 : I.attributes) || De.data || De;
2119
+ if (Fe.isValid)
2120
+ ne(!0), b({ type: "SET_WALLET_ERROR", message: "" });
1978
2121
  else {
1979
- te(!1);
1980
- const At = ((M = He.errors) == null ? void 0 : M[0]) || ((z = He.details) == null ? void 0 : z.formatMessage) || "Invalid wallet address";
1981
- b({ type: "SET_WALLET_ERROR", message: At });
2122
+ ne(!1);
2123
+ const Tt = ((B = Fe.errors) == null ? void 0 : B[0]) || ((ee = Fe.details) == null ? void 0 : ee.formatMessage) || "Invalid wallet address";
2124
+ b({ type: "SET_WALLET_ERROR", message: Tt });
1982
2125
  }
1983
2126
  } catch {
1984
- te(null);
2127
+ ne(null);
1985
2128
  } finally {
1986
- Ne(!1);
2129
+ be(!1);
1987
2130
  }
1988
2131
  }, 500), () => clearTimeout(xe.current);
1989
- }, [p.walletAddress, p.network, I.apiUrl]);
1990
- const $e = !_ || ne === 0, Ge = ne > 0 && (R ? ne < it : ne < dt), We = !!P || Ge || ye && $e, gt = ne > 0 && !P && !Ge, Be = p.walletAddress.trim().length >= 10 && V !== !1 && !se, Se = gt && Be && !!p.cryptoCurrency && !!p.network, vt = (y) => {
1991
- let E = y.target.value.replace(/[^0-9.,]/g, "");
1992
- const T = R ? 2 : 6, M = E.indexOf(".");
1993
- M !== -1 && E.length - M - 1 > T && (E = E.slice(0, M + T + 1)), b(R ? { type: "SET_FIAT_AMOUNT", amount: E } : { type: "SET_CRYPTO_AMOUNT", amount: E });
1994
- }, Ye = (y) => {
1995
- y !== S && b({ type: "SET_FLOW_TYPE", flowType: y });
1996
- }, Nt = $(
2132
+ }, [p.walletAddress, p.network, L.apiUrl]);
2133
+ const Ge = !H || W === 0, je = W > 0 && (R ? W < dt : W < ut), Ye = !!O || je || ye && Ge, Nt = W > 0 && !O && !je, Pe = p.walletAddress.trim().length >= 10 && V !== !1 && !ce, Te = Nt && Pe && !!p.cryptoCurrency && !!p.network, Ct = (y) => {
2134
+ let A = y.target.value.replace(/[^0-9.,]/g, "");
2135
+ const I = R ? 2 : 6, B = A.indexOf(".");
2136
+ B !== -1 && A.length - B - 1 > I && (A = A.slice(0, B + I + 1)), b(R ? { type: "SET_FIAT_AMOUNT", amount: A } : { type: "SET_CRYPTO_AMOUNT", amount: A });
2137
+ }, Ve = (y) => {
2138
+ y !== E && b({ type: "SET_FLOW_TYPE", flowType: y });
2139
+ }, bt = _(
1997
2140
  (y) => {
1998
2141
  b({ type: "SET_FIAT_CURRENCY", currency: y });
1999
2142
  },
2000
2143
  [b]
2001
- ), Ct = $(
2002
- (y, E) => {
2003
- b({ type: "SET_CRYPTO_CURRENCY", currency: y }), b({ type: "SET_CRYPTO_CHAIN", chain: E });
2144
+ ), Et = _(
2145
+ (y, A) => {
2146
+ b({ type: "SET_CRYPTO_CURRENCY", currency: y }), b({ type: "SET_CRYPTO_CHAIN", chain: A });
2004
2147
  },
2005
2148
  [b]
2006
- ), bt = () => {
2007
- Se && (ie(!0), W());
2149
+ ), At = _(
2150
+ (y) => {
2151
+ b({ type: "SET_PAYMENT_METHOD", methodId: y });
2152
+ },
2153
+ [b]
2154
+ ), wt = () => {
2155
+ Te && (ie(!0), j());
2008
2156
  };
2009
- H(() => {
2157
+ U(() => {
2010
2158
  var y;
2011
- if (!(!J || G)) {
2012
- if (A != null && A.bestQuote)
2013
- ie(!1), b({ type: "SELECT_QUOTE", quote: A.bestQuote }), Z().catch(() => {
2159
+ if (!(!q || G)) {
2160
+ if (w != null && w.bestQuote)
2161
+ ie(!1), b({ type: "SELECT_QUOTE", quote: w.bestQuote }), z().catch(() => {
2014
2162
  });
2015
- else if (j)
2016
- ie(!1), b({ type: "SET_ERROR", message: j.message || "No quotes available" });
2017
- else if (A && !A.bestQuote) {
2163
+ else if (Q)
2164
+ ie(!1), b({ type: "SET_ERROR", message: Q.message || "No quotes available" });
2165
+ else if (w && !w.bestQuote) {
2018
2166
  ie(!1);
2019
- const E = (y = A.unavailableGateways) == null ? void 0 : y.map((M) => M.reason).filter(Boolean), T = E != null && E.length ? `No providers available: ${E.join("; ")}` : "No providers available for this currency/network combination";
2020
- b({ type: "SET_ERROR", message: T });
2167
+ const A = (y = w.unavailableGateways) == null ? void 0 : y.map((B) => B.reason).filter(Boolean), I = A != null && A.length ? `No providers available: ${A.join("; ")}` : "No providers available for this currency/network combination";
2168
+ b({ type: "SET_ERROR", message: I });
2021
2169
  }
2022
2170
  }
2023
- }, [J, A, G, j, b, Z]);
2024
- const Ve = F ? "theme-dark" : "theme-light", Me = ct.find((y) => y.id === ge) || ct[0], Et = Me.accent === null, je = (l ? Fe(l) : !1) ? { "--t-accent": l, "--t-cta-bg": l, "--t-cta-text": "#ffffff" } : Et ? {
2025
- "--t-accent": F ? "#ffffff" : "#111111",
2026
- "--t-cta-bg": F ? "#ffffff" : "#111111",
2027
- "--t-cta-text": F ? "#000000" : "#ffffff"
2171
+ }, [q, w, G, Q, b, z]);
2172
+ const We = X ? "theme-dark" : "theme-light", He = ct.find((y) => y.id === Ne) || ct[0], St = He.accent === null, Qe = (s ? Ke(s) : !1) ? { "--t-accent": s, "--t-cta-bg": s, "--t-cta-text": "#ffffff" } : St ? {
2173
+ "--t-accent": X ? "#ffffff" : "#111111",
2174
+ "--t-cta-bg": X ? "#ffffff" : "#111111",
2175
+ "--t-cta-text": X ? "#000000" : "#ffffff"
2028
2176
  } : {
2029
- "--t-accent": Me.accent,
2030
- "--t-cta-bg": Me.accent,
2177
+ "--t-accent": He.accent,
2178
+ "--t-cta-bg": He.accent,
2031
2179
  "--t-cta-text": "#ffffff"
2032
- }, re = {};
2033
- r && Fe(r) ? re.backgroundColor = r : re.backgroundColor = "var(--t-bg)", d && (re.backgroundImage = `url(${d})`, re.backgroundSize = "cover", re.backgroundPosition = "center");
2034
- const we = {};
2035
- u && Fe(u) && (we.border = `1px solid ${u}`), m && (we.borderRadius = m);
2036
- const Qe = p.step === "checkout" ? /* @__PURE__ */ e(Ot, { autoRedirect: i }) : p.step === "processing" ? /* @__PURE__ */ e(Ht, {}) : p.step === "complete" ? /* @__PURE__ */ e(Ut, { explorerUrl: h, doneButtonText: f, onDone: g }) : p.step === "error" ? /* @__PURE__ */ e(Dt, { supportEmail: x }) : p.step === "confirm" ? /* @__PURE__ */ e(Ft, {}) : null;
2037
- if (Qe)
2180
+ }, oe = {};
2181
+ r && Ke(r) ? oe.backgroundColor = r : oe.backgroundColor = "var(--t-bg)", u && (oe.backgroundImage = `url(${u})`, oe.backgroundSize = "cover", oe.backgroundPosition = "center");
2182
+ const Re = {};
2183
+ m && Ke(m) && (Re.border = `1px solid ${m}`), i && (Re.borderRadius = i);
2184
+ const Ze = p.step === "checkout" ? /* @__PURE__ */ e(ta, { autoRedirect: d }) : p.step === "processing" ? /* @__PURE__ */ e(na, {}) : p.step === "complete" ? /* @__PURE__ */ e(ra, { explorerUrl: h, doneButtonText: f, onDone: g }) : p.step === "error" ? /* @__PURE__ */ e(oa, { supportEmail: x }) : p.step === "confirm" ? /* @__PURE__ */ e(la, {}) : null;
2185
+ if (Ze)
2038
2186
  return /* @__PURE__ */ e(
2039
2187
  "div",
2040
2188
  {
2041
- className: `${Ve} relative w-full max-w-[390px] h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
2189
+ className: `${We} relative w-full max-w-[390px] h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
2042
2190
  style: {
2043
2191
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
2044
- ...re,
2045
- ...je,
2046
- ...we
2192
+ ...oe,
2193
+ ...Qe,
2194
+ ...Re
2047
2195
  },
2048
- children: Qe
2196
+ children: Ze
2049
2197
  }
2050
2198
  );
2051
- const Q = p.network, ue = Q ? Re[Q] : null, Ze = (ue == null ? void 0 : ue.shortName) || (ue == null ? void 0 : ue.name) || Q;
2052
- return /* @__PURE__ */ o(
2199
+ const Z = p.network, ue = Z ? Ie[Z] : null, Je = (ue == null ? void 0 : ue.shortName) || (ue == null ? void 0 : ue.name) || Z;
2200
+ return /* @__PURE__ */ l(
2053
2201
  "div",
2054
2202
  {
2055
- className: `${Ve} relative w-full max-w-[390px] min-h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
2203
+ className: `${We} relative w-full max-w-[390px] min-h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
2056
2204
  style: {
2057
2205
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
2058
- ...re,
2059
- ...je,
2060
- ...we
2206
+ ...oe,
2207
+ ...Qe,
2208
+ ...Re
2061
2209
  },
2062
2210
  children: [
2063
- /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${c ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(ta, { onClick: () => Y("settings") }) }),
2064
- c ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center pt-3 pb-5", children: [
2065
- /* @__PURE__ */ o("div", { className: "flex", style: { width: 165 }, children: [
2211
+ /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${o ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(Qt, { onClick: () => Y("settings") }) }),
2212
+ o ? /* @__PURE__ */ l("div", { className: "flex flex-col items-center pt-3 pb-5", children: [
2213
+ /* @__PURE__ */ l("div", { className: "flex", style: { width: 165 }, children: [
2066
2214
  /* @__PURE__ */ e(
2067
2215
  "button",
2068
2216
  {
2069
- onClick: () => Ye("buy"),
2217
+ onClick: () => Ve("buy"),
2070
2218
  className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
2071
- style: { color: S === "buy" ? "var(--t-text)" : "var(--t-text-secondary)" },
2219
+ style: { color: E === "buy" ? "var(--t-text)" : "var(--t-text-secondary)" },
2072
2220
  children: "Buy"
2073
2221
  }
2074
2222
  ),
2075
2223
  /* @__PURE__ */ e(
2076
2224
  "button",
2077
2225
  {
2078
- onClick: () => Ye("sell"),
2226
+ onClick: () => Ve("sell"),
2079
2227
  className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
2080
- style: { color: S === "sell" ? "var(--t-text)" : "var(--t-text-secondary)" },
2228
+ style: { color: E === "sell" ? "var(--t-text)" : "var(--t-text-secondary)" },
2081
2229
  children: "Sell"
2082
2230
  }
2083
2231
  )
2084
2232
  ] }),
2085
- /* @__PURE__ */ o("div", { className: "relative", style: { width: 165, height: 1 }, children: [
2233
+ /* @__PURE__ */ l("div", { className: "relative", style: { width: 165, height: 1 }, children: [
2086
2234
  /* @__PURE__ */ e("div", { className: "absolute inset-0", style: { background: "var(--t-divider)" } }),
2087
2235
  /* @__PURE__ */ e(
2088
2236
  "div",
@@ -2090,42 +2238,42 @@ function sa({
2090
2238
  className: "absolute top-0 h-full transition-all duration-300 ease-in-out",
2091
2239
  style: {
2092
2240
  width: "50%",
2093
- left: S === "buy" ? "0%" : "50%",
2241
+ left: E === "buy" ? "0%" : "50%",
2094
2242
  background: "var(--t-accent)"
2095
2243
  }
2096
2244
  }
2097
2245
  )
2098
2246
  ] })
2099
2247
  ] }) : null,
2100
- ae || be || O ? /* @__PURE__ */ e(Xt, {}) : /* @__PURE__ */ o("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
2101
- /* @__PURE__ */ o(
2248
+ re || Ae || P ? /* @__PURE__ */ e(ia, {}) : /* @__PURE__ */ l("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
2249
+ /* @__PURE__ */ l(
2102
2250
  "div",
2103
2251
  {
2104
2252
  className: "px-[18px] pt-[14px] pb-[18px]",
2105
2253
  style: {
2106
2254
  background: "var(--t-surface)",
2107
2255
  borderRadius: 5,
2108
- border: ye && We ? "1px solid #EF4444" : "1px solid transparent"
2256
+ border: ye && Ye ? "1px solid #EF4444" : "1px solid transparent"
2109
2257
  },
2110
2258
  children: [
2111
2259
  /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You spend" }),
2112
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
2260
+ /* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
2113
2261
  /* @__PURE__ */ e(
2114
2262
  "input",
2115
2263
  {
2116
- ref: Ie,
2264
+ ref: Oe,
2117
2265
  type: "text",
2118
- value: _,
2119
- onChange: vt,
2120
- onBlur: () => ee(!0),
2266
+ value: H,
2267
+ onChange: Ct,
2268
+ onBlur: () => ae(!0),
2121
2269
  placeholder: R ? "250" : "0.01",
2122
2270
  className: "bg-transparent outline-none w-0 flex-1 mr-3",
2123
2271
  style: { color: "var(--t-text)", fontSize: 24, fontWeight: 600, lineHeight: "32px" },
2124
2272
  inputMode: "decimal",
2125
- disabled: !!((ze = v == null ? void 0 : v.sourceAmount) != null && ze.locked)
2273
+ disabled: !!((qe = C == null ? void 0 : C.sourceAmount) != null && qe.locked)
2126
2274
  }
2127
2275
  ),
2128
- R ? /* @__PURE__ */ o(
2276
+ R ? /* @__PURE__ */ l(
2129
2277
  "button",
2130
2278
  {
2131
2279
  onClick: () => Y("fiat"),
@@ -2137,15 +2285,15 @@ function sa({
2137
2285
  paddingLeft: 10,
2138
2286
  paddingRight: 10
2139
2287
  },
2140
- disabled: !!((qe = v == null ? void 0 : v.sourceCurrency) != null && qe.locked),
2288
+ disabled: !!((et = C == null ? void 0 : C.sourceCurrency) != null && et.locked),
2141
2289
  children: [
2142
- /* @__PURE__ */ e(_e, { currencyCode: w, size: 16, baseUrl: D }),
2143
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: w }),
2144
- /* @__PURE__ */ e(Te, {})
2290
+ /* @__PURE__ */ e(Xe, { currencyCode: T, size: 16, baseUrl: K }),
2291
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: T }),
2292
+ /* @__PURE__ */ e(ge, {})
2145
2293
  ]
2146
2294
  }
2147
- ) : /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
2148
- /* @__PURE__ */ o(
2295
+ ) : /* @__PURE__ */ l("div", { className: "flex flex-col items-end shrink-0", children: [
2296
+ /* @__PURE__ */ l(
2149
2297
  "button",
2150
2298
  {
2151
2299
  onClick: () => Y("crypto"),
@@ -2157,35 +2305,35 @@ function sa({
2157
2305
  paddingLeft: 10,
2158
2306
  paddingRight: 10
2159
2307
  },
2160
- disabled: !!((et = v == null ? void 0 : v.destinationCurrency) != null && et.locked),
2308
+ disabled: !!((tt = C == null ? void 0 : C.destinationCurrency) != null && tt.locked),
2161
2309
  children: [
2162
- /* @__PURE__ */ e(ut, { ticker: k, size: 16, baseUrl: D }),
2310
+ /* @__PURE__ */ e(mt, { ticker: k, size: 16, baseUrl: K }),
2163
2311
  /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: k }),
2164
- /* @__PURE__ */ e(Te, {})
2312
+ /* @__PURE__ */ e(ge, {})
2165
2313
  ]
2166
2314
  }
2167
2315
  ),
2168
- Q && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
2316
+ Z && /* @__PURE__ */ l("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
2169
2317
  /* @__PURE__ */ e(
2170
2318
  "img",
2171
2319
  {
2172
- src: Ke(Q, D),
2173
- alt: Q,
2320
+ src: _e(Z, K),
2321
+ alt: Z,
2174
2322
  width: 14,
2175
2323
  height: 14,
2176
2324
  className: "rounded-full",
2177
2325
  style: { width: 14, height: 14 }
2178
2326
  }
2179
2327
  ),
2180
- /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: Ze })
2328
+ /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: Je })
2181
2329
  ] })
2182
2330
  ] })
2183
2331
  ] })
2184
2332
  ]
2185
2333
  }
2186
2334
  ),
2187
- ye && We && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: P || ($e ? "Amount should be more than 0" : R ? `Minimum amount is ${it} ${w}` : `Minimum amount is ${dt} ${k}`) }),
2188
- /* @__PURE__ */ o(
2335
+ ye && Ye && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: O || (Ge ? "Amount should be more than 0" : R ? `Minimum amount is ${dt} ${T}` : `Minimum amount is ${ut} ${k}`) }),
2336
+ /* @__PURE__ */ l(
2189
2337
  "div",
2190
2338
  {
2191
2339
  className: "px-[18px] pt-[12px] pb-[14px]",
@@ -2199,18 +2347,18 @@ function sa({
2199
2347
  },
2200
2348
  children: [
2201
2349
  /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
2202
- /* @__PURE__ */ o("div", { className: "flex items-start justify-between", children: [
2203
- G ? /* @__PURE__ */ e(B, { w: 180, h: 32 }) : /* @__PURE__ */ e(
2204
- _t,
2350
+ /* @__PURE__ */ l("div", { className: "flex items-start justify-between", children: [
2351
+ G ? /* @__PURE__ */ e(M, { w: 180, h: 32 }) : /* @__PURE__ */ e(
2352
+ ca,
2205
2353
  {
2206
- value: ne > 0 ? yt : "0",
2354
+ value: W > 0 ? gt : "0",
2207
2355
  height: 32,
2208
2356
  className: "font-semibold",
2209
- style: { color: ne > 0 ? "var(--t-text)" : "var(--t-text-muted)", fontSize: 24 }
2357
+ style: { color: W > 0 ? "var(--t-text)" : "var(--t-text-muted)", fontSize: 24 }
2210
2358
  }
2211
2359
  ),
2212
- R ? /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
2213
- /* @__PURE__ */ o(
2360
+ R ? /* @__PURE__ */ l("div", { className: "flex flex-col items-end shrink-0", children: [
2361
+ /* @__PURE__ */ l(
2214
2362
  "button",
2215
2363
  {
2216
2364
  onClick: () => Y("crypto"),
@@ -2222,29 +2370,29 @@ function sa({
2222
2370
  paddingLeft: 10,
2223
2371
  paddingRight: 10
2224
2372
  },
2225
- disabled: !!((tt = v == null ? void 0 : v.destinationCurrency) != null && tt.locked),
2373
+ disabled: !!((at = C == null ? void 0 : C.destinationCurrency) != null && at.locked),
2226
2374
  children: [
2227
- /* @__PURE__ */ e(ut, { ticker: k, size: 16, baseUrl: D }),
2375
+ /* @__PURE__ */ e(mt, { ticker: k, size: 16, baseUrl: K }),
2228
2376
  /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: k }),
2229
- /* @__PURE__ */ e(Te, {})
2377
+ /* @__PURE__ */ e(ge, {})
2230
2378
  ]
2231
2379
  }
2232
2380
  ),
2233
- Q && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
2381
+ Z && /* @__PURE__ */ l("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
2234
2382
  /* @__PURE__ */ e(
2235
2383
  "img",
2236
2384
  {
2237
- src: Ke(Q, D),
2238
- alt: Q,
2385
+ src: _e(Z, K),
2386
+ alt: Z,
2239
2387
  width: 14,
2240
2388
  height: 14,
2241
2389
  className: "rounded-full",
2242
2390
  style: { width: 14, height: 14 }
2243
2391
  }
2244
2392
  ),
2245
- /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: Ze })
2393
+ /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: Je })
2246
2394
  ] })
2247
- ] }) : /* @__PURE__ */ o(
2395
+ ] }) : /* @__PURE__ */ l(
2248
2396
  "button",
2249
2397
  {
2250
2398
  onClick: () => Y("fiat"),
@@ -2256,11 +2404,11 @@ function sa({
2256
2404
  paddingLeft: 10,
2257
2405
  paddingRight: 10
2258
2406
  },
2259
- disabled: !!((at = v == null ? void 0 : v.sourceCurrency) != null && at.locked),
2407
+ disabled: !!((nt = C == null ? void 0 : C.sourceCurrency) != null && nt.locked),
2260
2408
  children: [
2261
- /* @__PURE__ */ e(_e, { currencyCode: w, size: 16, baseUrl: D }),
2262
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: w }),
2263
- /* @__PURE__ */ e(Te, {})
2409
+ /* @__PURE__ */ e(Xe, { currencyCode: T, size: 16, baseUrl: K }),
2410
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: T }),
2411
+ /* @__PURE__ */ e(ge, {})
2264
2412
  ]
2265
2413
  }
2266
2414
  )
@@ -2272,11 +2420,23 @@ function sa({
2272
2420
  "div",
2273
2421
  {
2274
2422
  className: "flex items-center justify-between mt-[2px] px-[18px] pt-[12px] pb-[14px]",
2275
- style: { background: "var(--t-surface)" },
2276
- children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: xt || " " })
2423
+ style: {
2424
+ background: "var(--t-surface)",
2425
+ ...(rt = S == null ? void 0 : S.paymentMethods) != null && rt.length ? {} : { borderBottomLeftRadius: 5, borderBottomRightRadius: 5 }
2426
+ },
2427
+ children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: vt || " " })
2277
2428
  }
2278
2429
  ),
2279
- /* @__PURE__ */ o("div", { className: "mt-8", children: [
2430
+ (S == null ? void 0 : S.paymentMethods) && S.paymentMethods.length > 0 && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: /* @__PURE__ */ e(
2431
+ ea,
2432
+ {
2433
+ methods: S.paymentMethods,
2434
+ selectedId: p.paymentMethodId,
2435
+ onSelect: At,
2436
+ fiatCurrency: p.fiatCurrency
2437
+ }
2438
+ ) }),
2439
+ /* @__PURE__ */ l("div", { className: "mt-8", children: [
2280
2440
  /* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "Wallet address" }),
2281
2441
  /* @__PURE__ */ e(
2282
2442
  "input",
@@ -2284,88 +2444,88 @@ function sa({
2284
2444
  type: "text",
2285
2445
  value: p.walletAddress,
2286
2446
  onChange: (y) => b({ type: "SET_WALLET_ADDRESS", address: y.target.value }),
2287
- onBlur: () => ce(!0),
2447
+ onBlur: () => se(!0),
2288
2448
  placeholder: "Enter your wallet address",
2289
2449
  spellCheck: !1,
2290
2450
  autoComplete: "off",
2291
2451
  className: "w-full bg-transparent text-[13px] outline-none transition-colors",
2292
2452
  style: {
2293
- border: p.walletError || ve && !Be ? "1px solid #EF4444" : "1px solid var(--t-border)",
2453
+ border: p.walletError || Ce && !Pe ? "1px solid #EF4444" : "1px solid var(--t-border)",
2294
2454
  borderRadius: 3.5,
2295
2455
  height: 47,
2296
2456
  paddingLeft: 14,
2297
2457
  paddingRight: 14,
2298
2458
  color: "var(--t-text)"
2299
2459
  },
2300
- disabled: !!((nt = v == null ? void 0 : v.destinationAddress) != null && nt.locked)
2460
+ disabled: !!((ot = C == null ? void 0 : C.destinationAddress) != null && ot.locked)
2301
2461
  }
2302
2462
  ),
2303
- p.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: p.walletError }) : ve && !Be && !se ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : se && p.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
2463
+ p.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: p.walletError }) : Ce && !Pe && !ce ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : ce && p.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
2304
2464
  ] }),
2305
2465
  /* @__PURE__ */ e("div", { className: "flex-1" }),
2306
2466
  /* @__PURE__ */ e(
2307
2467
  "button",
2308
2468
  {
2309
- disabled: !Se || s || J,
2310
- onClick: bt,
2469
+ disabled: !Te || c || q,
2470
+ onClick: wt,
2311
2471
  className: "w-full font-semibold text-[16px] transition-all",
2312
2472
  style: {
2313
2473
  height: 60,
2314
2474
  borderRadius: 5,
2315
2475
  background: "var(--t-cta-bg)",
2316
2476
  color: "var(--t-cta-text)",
2317
- opacity: Se && !s && !J ? 1 : 0.4,
2318
- cursor: Se && !s && !J ? "pointer" : "not-allowed"
2477
+ opacity: Te && !c && !q ? 1 : 0.4,
2478
+ cursor: Te && !c && !q ? "pointer" : "not-allowed"
2319
2479
  },
2320
- children: J ? "Getting best price..." : s ? "Processing..." : R ? `Buy ${k}` : `Sell ${k}`
2480
+ children: q ? "Getting best price..." : c ? "Processing..." : R ? `Buy ${k}` : `Sell ${k}`
2321
2481
  }
2322
2482
  ),
2323
2483
  /* @__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" }) })
2324
- ] }, S),
2325
- /* @__PURE__ */ e(De, { isOpen: fe === "fiat", onClose: () => Y(null), children: (y) => {
2326
- var E;
2484
+ ] }, E),
2485
+ /* @__PURE__ */ e(Le, { isOpen: fe === "fiat", onClose: () => Y(null), children: (y) => {
2486
+ var A;
2327
2487
  return /* @__PURE__ */ e(
2328
- na,
2488
+ da,
2329
2489
  {
2330
2490
  onClose: y,
2331
- onSelect: (T) => {
2332
- Nt(T), y();
2491
+ onSelect: (I) => {
2492
+ bt(I), y();
2333
2493
  },
2334
- currencies: (E = L == null ? void 0 : L.fiats) == null ? void 0 : E.map((T) => ({ code: T.code, name: T.code })),
2335
- assetBaseUrl: D
2494
+ currencies: (A = S == null ? void 0 : S.fiats) == null ? void 0 : A.map((I) => ({ code: I.code, name: I.code })),
2495
+ assetBaseUrl: K
2336
2496
  }
2337
2497
  );
2338
2498
  } }),
2339
- /* @__PURE__ */ e(De, { isOpen: fe === "crypto", onClose: () => Y(null), children: (y) => {
2340
- var E;
2499
+ /* @__PURE__ */ e(Le, { isOpen: fe === "crypto", onClose: () => Y(null), children: (y) => {
2500
+ var A;
2341
2501
  return /* @__PURE__ */ e(
2342
- ra,
2502
+ ua,
2343
2503
  {
2344
2504
  onClose: y,
2345
- onSelect: (T, M) => {
2346
- Ct(T, M), y();
2505
+ onSelect: (I, B) => {
2506
+ Et(I, B), y();
2347
2507
  },
2348
- cryptos: (E = L == null ? void 0 : L.cryptos) == null ? void 0 : E.map((T) => {
2349
- var M;
2508
+ cryptos: (A = S == null ? void 0 : S.cryptos) == null ? void 0 : A.map((I) => {
2509
+ var B;
2350
2510
  return {
2351
- code: T.code,
2352
- name: T.code,
2353
- networks: (M = T.networks) == null ? void 0 : M.map((z) => ({ code: z.id, name: z.name }))
2511
+ code: I.code,
2512
+ name: I.code,
2513
+ networks: (B = I.networks) == null ? void 0 : B.map((ee) => ({ code: ee.id, name: ee.name }))
2354
2514
  };
2355
2515
  }),
2356
- assetBaseUrl: D
2516
+ assetBaseUrl: K
2357
2517
  }
2358
2518
  );
2359
2519
  } }),
2360
- /* @__PURE__ */ e(De, { isOpen: fe === "settings", onClose: () => Y(null), children: (y) => /* @__PURE__ */ e(
2361
- ca,
2520
+ /* @__PURE__ */ e(Le, { isOpen: fe === "settings", onClose: () => Y(null), children: (y) => /* @__PURE__ */ e(
2521
+ ha,
2362
2522
  {
2363
2523
  onClose: y,
2364
- darkMode: F,
2365
- onToggleDarkMode: K,
2366
- skinId: ge,
2367
- onSelectSkin: (E) => {
2368
- he(E);
2524
+ darkMode: X,
2525
+ onToggleDarkMode: $,
2526
+ skinId: Ne,
2527
+ onSelectSkin: (A) => {
2528
+ he(A);
2369
2529
  }
2370
2530
  }
2371
2531
  ) })
@@ -2373,51 +2533,51 @@ function sa({
2373
2533
  }
2374
2534
  );
2375
2535
  }
2376
- function ia({
2536
+ function ya({
2377
2537
  projectId: t,
2378
2538
  apiUrl: a,
2379
2539
  assetBaseUrl: n,
2380
- flowType: l,
2540
+ flowType: s,
2381
2541
  customerId: r,
2382
- defaultFiatCurrency: d,
2383
- defaultCryptoCurrency: u,
2384
- defaultNetwork: m,
2385
- defaultFiatAmount: c,
2386
- defaultCryptoAmount: i,
2542
+ defaultFiatCurrency: u,
2543
+ defaultCryptoCurrency: m,
2544
+ defaultNetwork: i,
2545
+ defaultFiatAmount: o,
2546
+ defaultCryptoAmount: d,
2387
2547
  defaultWalletAddress: h,
2388
2548
  defaultGateway: f,
2389
2549
  fieldLocks: x,
2390
2550
  statusPollInterval: g,
2391
2551
  onComplete: p,
2392
2552
  onError: b,
2393
- className: L,
2394
- theme: O,
2395
- skinId: A,
2553
+ className: S,
2554
+ theme: P,
2555
+ skinId: w,
2396
2556
  accentColor: G,
2397
- bgColor: j,
2398
- bgImage: W,
2399
- borderColor: Z,
2400
- borderRadius: s,
2401
- showFlowToggle: P,
2402
- autoRedirect: v,
2403
- explorerUrl: I,
2404
- doneButtonText: D,
2405
- supportEmail: F,
2406
- onDone: K
2557
+ bgColor: Q,
2558
+ bgImage: j,
2559
+ borderColor: z,
2560
+ borderRadius: c,
2561
+ showFlowToggle: O,
2562
+ autoRedirect: C,
2563
+ explorerUrl: L,
2564
+ doneButtonText: K,
2565
+ supportEmail: X,
2566
+ onDone: $
2407
2567
  }) {
2408
2568
  return /* @__PURE__ */ e(
2409
- Mt,
2569
+ Ht,
2410
2570
  {
2411
2571
  projectId: t,
2412
2572
  apiUrl: a,
2413
2573
  assetBaseUrl: n,
2414
- flowType: l,
2574
+ flowType: s,
2415
2575
  customerId: r,
2416
- defaultFiatCurrency: d,
2417
- defaultCryptoCurrency: u,
2418
- defaultNetwork: m,
2419
- defaultFiatAmount: c,
2420
- defaultCryptoAmount: i,
2576
+ defaultFiatCurrency: u,
2577
+ defaultCryptoCurrency: m,
2578
+ defaultNetwork: i,
2579
+ defaultFiatAmount: o,
2580
+ defaultCryptoAmount: d,
2421
2581
  defaultWalletAddress: h,
2422
2582
  defaultGateway: f,
2423
2583
  fieldLocks: x,
@@ -2425,56 +2585,56 @@ function ia({
2425
2585
  onComplete: p,
2426
2586
  onError: b,
2427
2587
  children: /* @__PURE__ */ e(
2428
- sa,
2588
+ fa,
2429
2589
  {
2430
- className: L,
2431
- theme: O,
2432
- skinId: A,
2590
+ className: S,
2591
+ theme: P,
2592
+ skinId: w,
2433
2593
  accentColor: G,
2434
- bgColor: j,
2435
- bgImage: W,
2436
- borderColor: Z,
2437
- borderRadius: s,
2438
- showFlowToggle: P,
2439
- autoRedirect: v,
2440
- explorerUrl: I,
2441
- doneButtonText: D,
2442
- supportEmail: F,
2443
- onDone: K
2594
+ bgColor: Q,
2595
+ bgImage: j,
2596
+ borderColor: z,
2597
+ borderRadius: c,
2598
+ showFlowToggle: O,
2599
+ autoRedirect: C,
2600
+ explorerUrl: L,
2601
+ doneButtonText: K,
2602
+ supportEmail: X,
2603
+ onDone: $
2444
2604
  }
2445
2605
  )
2446
2606
  }
2447
2607
  );
2448
2608
  }
2449
- function Ca({
2609
+ function Ta({
2450
2610
  submitButtonText: t,
2451
2611
  rateRefreshInterval: a,
2452
2612
  ...n
2453
2613
  }) {
2454
- return /* @__PURE__ */ e(ia, { ...n });
2614
+ return /* @__PURE__ */ e(ya, { ...n });
2455
2615
  }
2456
- function ba({
2616
+ function Ra({
2457
2617
  skin: t,
2458
2618
  active: a,
2459
2619
  onClick: n,
2460
- darkMode: l,
2620
+ darkMode: s,
2461
2621
  dimmed: r
2462
2622
  }) {
2463
- const d = t.accent === null, u = 32;
2464
- return /* @__PURE__ */ o(
2623
+ const u = t.accent === null, m = 32;
2624
+ return /* @__PURE__ */ l(
2465
2625
  "button",
2466
2626
  {
2467
2627
  onClick: n,
2468
2628
  className: "relative shrink-0",
2469
- style: { width: u, height: u, opacity: r ? 0.4 : 1, transition: "opacity 0.2s" },
2629
+ style: { width: m, height: m, opacity: r ? 0.4 : 1, transition: "opacity 0.2s" },
2470
2630
  children: [
2471
- d ? /* @__PURE__ */ o("svg", { width: u, height: u, viewBox: "0 0 32 32", children: [
2631
+ u ? /* @__PURE__ */ l("svg", { width: m, height: m, viewBox: "0 0 32 32", children: [
2472
2632
  /* @__PURE__ */ e("clipPath", { id: "mono-left", children: /* @__PURE__ */ e("rect", { x: "0", y: "0", width: "16", height: "32" }) }),
2473
2633
  /* @__PURE__ */ e("clipPath", { id: "mono-right", children: /* @__PURE__ */ e("rect", { x: "16", y: "0", width: "16", height: "32" }) }),
2474
2634
  /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "#111111", clipPath: "url(#mono-left)" }),
2475
2635
  /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "#ffffff", clipPath: "url(#mono-right)" }),
2476
- /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "none", stroke: l ? "rgba(255,255,255,0.15)" : "rgba(0,0,0,0.1)", strokeWidth: "1" })
2477
- ] }) : /* @__PURE__ */ e("svg", { width: u, height: u, viewBox: "0 0 32 32", children: /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: t.accent }) }),
2636
+ /* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "none", stroke: s ? "rgba(255,255,255,0.15)" : "rgba(0,0,0,0.1)", strokeWidth: "1" })
2637
+ ] }) : /* @__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 }) }),
2478
2638
  a && !r && /* @__PURE__ */ e(
2479
2639
  "div",
2480
2640
  {
@@ -2486,13 +2646,13 @@ function ba({
2486
2646
  }
2487
2647
  );
2488
2648
  }
2489
- function da({ quote: t }) {
2490
- return t.isBestRate ? /* @__PURE__ */ e("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Best price" }) : t.isRecommended ? /* @__PURE__ */ e("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Recommended" }) : t.rank && t.rank <= 3 ? /* @__PURE__ */ o("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: [
2649
+ function xa({ quote: t }) {
2650
+ return t.isBestRate ? /* @__PURE__ */ e("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Best price" }) : t.isRecommended ? /* @__PURE__ */ e("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Recommended" }) : t.rank && t.rank <= 3 ? /* @__PURE__ */ l("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: [
2491
2651
  "#",
2492
2652
  t.rank
2493
2653
  ] }) : null;
2494
2654
  }
2495
- function ua({ quote: t }) {
2655
+ function ga({ quote: t }) {
2496
2656
  return t.gatewayLogo ? /* @__PURE__ */ e(
2497
2657
  "img",
2498
2658
  {
@@ -2503,10 +2663,10 @@ function ua({ quote: t }) {
2503
2663
  className: "rounded-full shrink-0",
2504
2664
  style: { width: 36, height: 36 }
2505
2665
  }
2506
- ) : /* @__PURE__ */ e(ft, { size: 36 });
2666
+ ) : /* @__PURE__ */ e($e, { size: 36 });
2507
2667
  }
2508
- function ma() {
2509
- return /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ o(
2668
+ function va() {
2669
+ return /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ l(
2510
2670
  "div",
2511
2671
  {
2512
2672
  className: "w-full flex items-center gap-3.5",
@@ -2518,34 +2678,34 @@ function ma() {
2518
2678
  background: "var(--t-surface)"
2519
2679
  },
2520
2680
  children: [
2521
- /* @__PURE__ */ e(B, { w: 36, h: 36, className: "rounded-full shrink-0" }),
2522
- /* @__PURE__ */ o("div", { className: "flex-1", children: [
2523
- /* @__PURE__ */ e(B, { w: 90, h: 14, className: "mb-1.5" }),
2524
- /* @__PURE__ */ e(B, { w: 60, h: 12 })
2681
+ /* @__PURE__ */ e(M, { w: 36, h: 36, className: "rounded-full shrink-0" }),
2682
+ /* @__PURE__ */ l("div", { className: "flex-1", children: [
2683
+ /* @__PURE__ */ e(M, { w: 90, h: 14, className: "mb-1.5" }),
2684
+ /* @__PURE__ */ e(M, { w: 60, h: 12 })
2525
2685
  ] }),
2526
- /* @__PURE__ */ o("div", { className: "text-right", children: [
2527
- /* @__PURE__ */ e(B, { w: 40, h: 10, className: "mb-1.5" }),
2528
- /* @__PURE__ */ e(B, { w: 80, h: 14 })
2686
+ /* @__PURE__ */ l("div", { className: "text-right", children: [
2687
+ /* @__PURE__ */ e(M, { w: 40, h: 10, className: "mb-1.5" }),
2688
+ /* @__PURE__ */ e(M, { w: 80, h: 14 })
2529
2689
  ] })
2530
2690
  ]
2531
2691
  },
2532
2692
  t
2533
2693
  )) });
2534
2694
  }
2535
- function Ea({
2695
+ function ka({
2536
2696
  onClose: t,
2537
2697
  onSelect: a,
2538
2698
  quotes: n,
2539
- quotesLoading: l,
2699
+ quotesLoading: s,
2540
2700
  cryptoCurrency: r
2541
2701
  }) {
2542
- const [d, u] = C(""), m = X(() => {
2702
+ const [u, m] = N(""), i = F(() => {
2543
2703
  if (!(n != null && n.quotes)) return [];
2544
- const c = d.trim().toLowerCase();
2545
- return c ? n.quotes.filter((i) => i.gatewayName.toLowerCase().includes(c)) : n.quotes;
2546
- }, [n, d]);
2547
- return /* @__PURE__ */ o(le, { children: [
2548
- /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Le, { onClick: t }) }),
2704
+ const o = u.trim().toLowerCase();
2705
+ return o ? n.quotes.filter((d) => d.gatewayName.toLowerCase().includes(o)) : n.quotes;
2706
+ }, [n, u]);
2707
+ return /* @__PURE__ */ l(J, { children: [
2708
+ /* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ve, { onClick: t }) }),
2549
2709
  /* @__PURE__ */ e(
2550
2710
  "h2",
2551
2711
  {
@@ -2554,14 +2714,14 @@ function Ea({
2554
2714
  children: "Choose Ramp"
2555
2715
  }
2556
2716
  ),
2557
- /* @__PURE__ */ e(Xe, { value: d, onChange: u }),
2558
- /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5 space-y-2", children: [
2559
- l ? /* @__PURE__ */ e(ma, {}) : m.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: n && n.quotes.length === 0 ? "No quotes available for this request" : "No providers found" }) : m.map((c, i) => {
2560
- const h = i === 0, f = parseFloat(c.cryptoAmount), x = f >= 1 ? f.toFixed(4) : f.toPrecision(6);
2561
- return /* @__PURE__ */ o(
2717
+ /* @__PURE__ */ e(Be, { value: u, onChange: m }),
2718
+ /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto custom-scroll px-5 space-y-2", children: [
2719
+ s ? /* @__PURE__ */ e(va, {}) : i.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: n && n.quotes.length === 0 ? "No quotes available for this request" : "No providers found" }) : i.map((o, d) => {
2720
+ const h = d === 0, f = parseFloat(o.cryptoAmount), x = f >= 1 ? f.toFixed(4) : f.toPrecision(6);
2721
+ return /* @__PURE__ */ l(
2562
2722
  "button",
2563
2723
  {
2564
- onClick: () => a(c),
2724
+ onClick: () => a(o),
2565
2725
  className: "w-full flex items-center gap-3.5 transition-colors",
2566
2726
  style: {
2567
2727
  borderRadius: h ? 4.5 : 5,
@@ -2572,14 +2732,14 @@ function Ea({
2572
2732
  background: h ? "transparent" : "var(--t-surface)"
2573
2733
  },
2574
2734
  children: [
2575
- /* @__PURE__ */ e(ua, { quote: c }),
2576
- /* @__PURE__ */ o("div", { className: "text-left flex-1 min-w-0", children: [
2577
- /* @__PURE__ */ e("div", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children: c.gatewayName }),
2578
- /* @__PURE__ */ e(da, { quote: c })
2735
+ /* @__PURE__ */ e(ga, { quote: o }),
2736
+ /* @__PURE__ */ l("div", { className: "text-left flex-1 min-w-0", children: [
2737
+ /* @__PURE__ */ e("div", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children: o.gatewayName }),
2738
+ /* @__PURE__ */ e(xa, { quote: o })
2579
2739
  ] }),
2580
- /* @__PURE__ */ o("div", { className: "text-right shrink-0", children: [
2740
+ /* @__PURE__ */ l("div", { className: "text-right shrink-0", children: [
2581
2741
  /* @__PURE__ */ e("div", { className: "text-[11px]", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
2582
- /* @__PURE__ */ o("div", { className: "font-medium text-[14px]", style: { color: "var(--t-text)" }, children: [
2742
+ /* @__PURE__ */ l("div", { className: "font-medium text-[14px]", style: { color: "var(--t-text)" }, children: [
2583
2743
  r,
2584
2744
  " ",
2585
2745
  x
@@ -2587,78 +2747,79 @@ function Ea({
2587
2747
  ] })
2588
2748
  ]
2589
2749
  },
2590
- c.gatewayId
2750
+ o.gatewayId
2591
2751
  );
2592
2752
  }),
2593
- !l && (n == null ? void 0 : n.unavailableGateways) && n.unavailableGateways.length > 0 && /* @__PURE__ */ e("div", { className: "pt-3", children: n.unavailableGateways.map((c) => /* @__PURE__ */ o(
2753
+ !s && (n == null ? void 0 : n.unavailableGateways) && n.unavailableGateways.length > 0 && /* @__PURE__ */ e("div", { className: "pt-3", children: n.unavailableGateways.map((o) => /* @__PURE__ */ l(
2594
2754
  "div",
2595
2755
  {
2596
2756
  className: "flex items-center justify-between py-2 text-[12px]",
2597
2757
  style: { color: "var(--t-text-muted)" },
2598
2758
  children: [
2599
- /* @__PURE__ */ e("span", { children: c.gatewayName }),
2600
- /* @__PURE__ */ e("span", { children: c.reason })
2759
+ /* @__PURE__ */ e("span", { children: o.gatewayName }),
2760
+ /* @__PURE__ */ e("span", { children: o.reason })
2601
2761
  ]
2602
2762
  },
2603
- c.gatewayId
2763
+ o.gatewayId
2604
2764
  )) })
2605
2765
  ] })
2606
2766
  ] });
2607
2767
  }
2608
2768
  export {
2609
- Kt as AnimatedDigit,
2610
- _t as AnimatedNumber,
2611
- Zt as ApplePayIcon,
2612
- Re as BLOCKCHAINS,
2613
- jt as BankIcon,
2614
- Vt as CRYPTO_CHAIN_COMBOS,
2615
- $t as CRYPTO_CURRENCIES,
2616
- qt as CardIcon,
2617
- Ca as CheckoutForm,
2618
- Ot as CheckoutStep,
2619
- Te as ChevronDown,
2620
- ea as ChevronRight,
2621
- Ea as ChooseRampModal,
2622
- Le as CloseButton,
2623
- va as CoinifyIcon,
2624
- Ut as CompleteStep,
2625
- Ft as ConfirmStep,
2626
- ra as CryptoCurrencyModal,
2627
- ut as CryptoIcon,
2628
- aa as DarkModeIcon,
2629
- Dt as ErrorStep,
2630
- lt as FIAT_CURRENCIES,
2631
- Gt as FIAT_TO_COUNTRY,
2632
- na as FiatCurrencyModal,
2633
- _e as FiatFlag,
2634
- Xt as FormSkeleton,
2635
- ft as GenericCoinIcon,
2636
- Jt as GooglePayIcon,
2637
- st as MOCK_RATES,
2638
- ta as MenuIcon,
2639
- De as Modal,
2640
- zt as PayPalIcon,
2641
- Ht as ProcessingStep,
2642
- ia as RampForm,
2643
- Mt as RampProvider,
2644
- Qt as RevolutIcon,
2769
+ sa as AnimatedDigit,
2770
+ ca as AnimatedNumber,
2771
+ Gt as ApplePayIcon,
2772
+ Ie as BLOCKCHAINS,
2773
+ Xt as BankIcon,
2774
+ _t as CRYPTO_CHAIN_COMBOS,
2775
+ Ut as CRYPTO_CURRENCIES,
2776
+ Vt as CardIcon,
2777
+ Ta as CheckoutForm,
2778
+ ta as CheckoutStep,
2779
+ ge as ChevronDown,
2780
+ Wt as ChevronRight,
2781
+ ka as ChooseRampModal,
2782
+ ve as CloseButton,
2783
+ Sa as CoinifyIcon,
2784
+ ra as CompleteStep,
2785
+ la as ConfirmStep,
2786
+ ua as CryptoCurrencyModal,
2787
+ mt as CryptoIcon,
2788
+ Zt as DarkModeIcon,
2789
+ oa as ErrorStep,
2790
+ st as FIAT_CURRENCIES,
2791
+ Dt as FIAT_TO_COUNTRY,
2792
+ da as FiatCurrencyModal,
2793
+ Xe as FiatFlag,
2794
+ ia as FormSkeleton,
2795
+ $e as GenericCoinIcon,
2796
+ jt as GooglePayIcon,
2797
+ it as MOCK_RATES,
2798
+ Qt as MenuIcon,
2799
+ Le as Modal,
2800
+ Yt as PayPalIcon,
2801
+ ea as PaymentMethodSelector,
2802
+ na as ProcessingStep,
2803
+ ya as RampForm,
2804
+ Ht as RampProvider,
2805
+ $t as RevolutIcon,
2645
2806
  ct as SKINS,
2646
- Xe as SearchInput,
2647
- ca as SettingsScreen,
2648
- B as Skeleton,
2649
- ba as SkinSwatch,
2650
- oa as ToggleSwitch,
2651
- ga as formatOutput,
2652
- Ke as getChainIconUrl,
2653
- ht as getCryptoIconUrl,
2654
- Wt as getFiatFlagUrl,
2655
- xa as getMockRate,
2656
- Na as getPaymentIcon,
2657
- Yt as parseAmount,
2658
- Lt as useCheckoutIntent,
2659
- kt as useQuotes,
2807
+ Be as SearchInput,
2808
+ ha as SettingsScreen,
2809
+ M as Skeleton,
2810
+ Ra as SkinSwatch,
2811
+ ma as ToggleSwitch,
2812
+ wa as formatOutput,
2813
+ _e as getChainIconUrl,
2814
+ yt as getCryptoIconUrl,
2815
+ Ft as getFiatFlagUrl,
2816
+ Aa as getMockRate,
2817
+ Jt as getPaymentIcon,
2818
+ Kt as parseAmount,
2819
+ Bt as useCheckoutIntent,
2820
+ Mt as useQuotes,
2660
2821
  pe as useRamp,
2661
- Rt as useRampConfig,
2662
- It as useTransaction
2822
+ It as useRampConfig,
2823
+ Ot as useTransaction
2663
2824
  };
2664
2825
  //# sourceMappingURL=index.js.map