@nowramp/form 0.2.4 → 0.2.5
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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/nowramp-form.iife.js +1 -1
- package/dist/nowramp-form.iife.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
}`;
|
|
9
9
|
document.head.appendChild(s);
|
|
10
10
|
})();
|
|
11
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),ft=require("@nowramp/sdk"),sa=require("react-dom");function fa(t,a,r){const[n,o]=i.useState(null),[l,u]=i.useState(!0),[s,d]=i.useState(null),c=i.useRef(null);(!c.current||c.current!==t)&&(c.current=new ft.RampApi({apiKey:"",...t}));const h=i.useCallback(async()=>{if(!t.projectId){d(new Error("projectId is required")),u(!1);return}u(!0),d(null);try{const p={};a&&(p.orderType=a),r&&(p.country=r);const f=await c.current.getSupported(p);o(f)}catch(p){d(p instanceof Error?p:new Error("Failed to fetch config"))}finally{u(!1)}},[t.projectId,a,r]);return i.useEffect(()=>{h()},[h]),{config:n,loading:l,error:s,refetch:h}}function xa(t,a){const[r,n]=i.useState(null),[o,l]=i.useState(!1),[u,s]=i.useState(null),d=i.useRef(null),c=i.useRef(""),h=`${t.apiUrl}|${t.projectId}`;(!d.current||c.current!==h)&&(d.current=new ft.RampApi({apiKey:"",...t}),c.current=h);const p=i.useRef(0);i.useEffect(()=>{const y=++p.current;if(!a||!t.projectId){n(null),l(!1);return}l(!0),s(null),d.current.getQuotes(a).then(j=>{p.current===y&&(n(j),l(!1))},j=>{p.current===y&&(s(j instanceof Error?j:new Error("Failed to fetch quotes")),n(null),l(!1))})},[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]);const f=i.useCallback(async()=>{if(!(!a||!t.projectId)){l(!0),s(null);try{const y=await d.current.getQuotes(a);n(y)}catch(y){s(y instanceof Error?y:new Error("Failed to fetch quotes"))}finally{l(!1)}}},[t.projectId,a]);return{quotes:r,loading:o,error:u,refetch:f}}function ya(t){const[a,r]=i.useState(null),[n,o]=i.useState(!1),[l,u]=i.useState(null),s=i.useRef(null),d=i.useRef(""),c=`${t.apiUrl}|${t.projectId}`;(!s.current||d.current!==c)&&(s.current=new ft.RampApi({apiKey:"",...t}),d.current=c);const h=i.useCallback(async f=>{o(!0),u(null);try{const y=await s.current.createCheckoutIntent(f);return r(y),y}catch(y){const j=y instanceof Error?y:new Error("Failed to create checkout intent");throw u(j),j}finally{o(!1)}},[]),p=i.useCallback(()=>{r(null),u(null)},[]);return{order:a,loading:n,error:l,createOrder:h,reset:p}}function ga(t,a,r){const[n,o]=i.useState(null),[l,u]=i.useState(!1),[s,d]=i.useState(null),c=i.useRef(null);c.current||(c.current=new ft.RampApi({apiKey:"",projectId:"",...t}));const h=i.useCallback(async()=>{if(a){u(!0),d(null);try{const p=await c.current.getTransaction(a);o(p)}catch(p){d(p instanceof Error?p:new Error("Failed to fetch status"))}finally{u(!1)}}},[a]);return i.useEffect(()=>{if(!a)return;const p=(r==null?void 0:r.initialDelay)??0;if(p>0){const f=setTimeout(h,p);return()=>clearTimeout(f)}h()},[h,a,r==null?void 0:r.initialDelay]),i.useEffect(()=>{if(!a||!(r!=null&&r.pollInterval)||!n||["completed","failed","cancelled","expired","refunded"].includes(n.status))return;const f=setInterval(h,r.pollInterval);return()=>clearInterval(f)},[a,r==null?void 0:r.pollInterval,n==null?void 0:n.status,h]),{status:n,loading:l,error:s,refetch:h}}const qe=[{code:"ad",name:"Andorra",defaultFiat:"EUR"},{code:"ae",name:"United Arab Emirates",defaultFiat:"AED"},{code:"af",name:"Afghanistan",defaultFiat:"USD"},{code:"ag",name:"Antigua and Barbuda",defaultFiat:"USD"},{code:"al",name:"Albania",defaultFiat:"ALL"},{code:"am",name:"Armenia",defaultFiat:"USD"},{code:"ao",name:"Angola",defaultFiat:"USD"},{code:"ar",name:"Argentina",defaultFiat:"ARS"},{code:"at",name:"Austria",defaultFiat:"EUR"},{code:"au",name:"Australia",defaultFiat:"AUD"},{code:"az",name:"Azerbaijan",defaultFiat:"USD"},{code:"ba",name:"Bosnia and Herzegovina",defaultFiat:"EUR"},{code:"bb",name:"Barbados",defaultFiat:"USD"},{code:"bd",name:"Bangladesh",defaultFiat:"USD"},{code:"be",name:"Belgium",defaultFiat:"EUR"},{code:"bf",name:"Burkina Faso",defaultFiat:"USD"},{code:"bg",name:"Bulgaria",defaultFiat:"EUR"},{code:"bh",name:"Bahrain",defaultFiat:"USD"},{code:"bi",name:"Burundi",defaultFiat:"USD"},{code:"bj",name:"Benin",defaultFiat:"USD"},{code:"bn",name:"Brunei",defaultFiat:"USD"},{code:"bo",name:"Bolivia",defaultFiat:"USD"},{code:"br",name:"Brazil",defaultFiat:"BRL"},{code:"bs",name:"Bahamas",defaultFiat:"USD"},{code:"bt",name:"Bhutan",defaultFiat:"USD"},{code:"bw",name:"Botswana",defaultFiat:"USD"},{code:"by",name:"Belarus",defaultFiat:"USD"},{code:"bz",name:"Belize",defaultFiat:"USD"},{code:"ca",name:"Canada",defaultFiat:"CAD"},{code:"cd",name:"DR Congo",defaultFiat:"USD"},{code:"cf",name:"Central African Republic",defaultFiat:"USD"},{code:"ch",name:"Switzerland",defaultFiat:"CHF"},{code:"ci",name:"Cote d'Ivoire",defaultFiat:"USD"},{code:"cl",name:"Chile",defaultFiat:"CLP"},{code:"cm",name:"Cameroon",defaultFiat:"USD"},{code:"cn",name:"China",defaultFiat:"USD"},{code:"co",name:"Colombia",defaultFiat:"USD"},{code:"cr",name:"Costa Rica",defaultFiat:"USD"},{code:"cu",name:"Cuba",defaultFiat:"USD"},{code:"cv",name:"Cape Verde",defaultFiat:"USD"},{code:"cy",name:"Cyprus",defaultFiat:"EUR"},{code:"cz",name:"Czech Republic",defaultFiat:"CZK"},{code:"de",name:"Germany",defaultFiat:"EUR"},{code:"dj",name:"Djibouti",defaultFiat:"USD"},{code:"dk",name:"Denmark",defaultFiat:"DKK"},{code:"dm",name:"Dominica",defaultFiat:"USD"},{code:"do",name:"Dominican Republic",defaultFiat:"USD"},{code:"dz",name:"Algeria",defaultFiat:"USD"},{code:"ec",name:"Ecuador",defaultFiat:"USD"},{code:"ee",name:"Estonia",defaultFiat:"EUR"},{code:"eg",name:"Egypt",defaultFiat:"USD"},{code:"er",name:"Eritrea",defaultFiat:"USD"},{code:"es",name:"Spain",defaultFiat:"EUR"},{code:"et",name:"Ethiopia",defaultFiat:"USD"},{code:"fi",name:"Finland",defaultFiat:"EUR"},{code:"fj",name:"Fiji",defaultFiat:"USD"},{code:"fr",name:"France",defaultFiat:"EUR"},{code:"ga",name:"Gabon",defaultFiat:"USD"},{code:"gb",name:"United Kingdom",defaultFiat:"GBP"},{code:"gd",name:"Grenada",defaultFiat:"USD"},{code:"ge",name:"Georgia",defaultFiat:"USD"},{code:"gh",name:"Ghana",defaultFiat:"USD"},{code:"gm",name:"Gambia",defaultFiat:"USD"},{code:"gn",name:"Guinea",defaultFiat:"USD"},{code:"gq",name:"Equatorial Guinea",defaultFiat:"USD"},{code:"gr",name:"Greece",defaultFiat:"EUR"},{code:"gt",name:"Guatemala",defaultFiat:"USD"},{code:"gw",name:"Guinea-Bissau",defaultFiat:"USD"},{code:"gy",name:"Guyana",defaultFiat:"USD"},{code:"hk",name:"Hong Kong",defaultFiat:"HKD"},{code:"hn",name:"Honduras",defaultFiat:"USD"},{code:"hr",name:"Croatia",defaultFiat:"EUR"},{code:"ht",name:"Haiti",defaultFiat:"USD"},{code:"hu",name:"Hungary",defaultFiat:"EUR"},{code:"id",name:"Indonesia",defaultFiat:"IDR"},{code:"ie",name:"Ireland",defaultFiat:"EUR"},{code:"il",name:"Israel",defaultFiat:"USD"},{code:"in",name:"India",defaultFiat:"INR"},{code:"iq",name:"Iraq",defaultFiat:"USD"},{code:"ir",name:"Iran",defaultFiat:"USD"},{code:"is",name:"Iceland",defaultFiat:"EUR"},{code:"it",name:"Italy",defaultFiat:"EUR"},{code:"jm",name:"Jamaica",defaultFiat:"USD"},{code:"jo",name:"Jordan",defaultFiat:"USD"},{code:"jp",name:"Japan",defaultFiat:"JPY"},{code:"ke",name:"Kenya",defaultFiat:"USD"},{code:"kg",name:"Kyrgyzstan",defaultFiat:"USD"},{code:"kh",name:"Cambodia",defaultFiat:"USD"},{code:"ki",name:"Kiribati",defaultFiat:"USD"},{code:"km",name:"Comoros",defaultFiat:"USD"},{code:"kn",name:"Saint Kitts and Nevis",defaultFiat:"USD"},{code:"kr",name:"South Korea",defaultFiat:"KRW"},{code:"kw",name:"Kuwait",defaultFiat:"USD"},{code:"kz",name:"Kazakhstan",defaultFiat:"USD"},{code:"la",name:"Laos",defaultFiat:"USD"},{code:"lb",name:"Lebanon",defaultFiat:"USD"},{code:"lc",name:"Saint Lucia",defaultFiat:"USD"},{code:"li",name:"Liechtenstein",defaultFiat:"CHF"},{code:"lk",name:"Sri Lanka",defaultFiat:"USD"},{code:"lr",name:"Liberia",defaultFiat:"USD"},{code:"ls",name:"Lesotho",defaultFiat:"ZAR"},{code:"lt",name:"Lithuania",defaultFiat:"EUR"},{code:"lu",name:"Luxembourg",defaultFiat:"EUR"},{code:"lv",name:"Latvia",defaultFiat:"EUR"},{code:"ly",name:"Libya",defaultFiat:"USD"},{code:"ma",name:"Morocco",defaultFiat:"USD"},{code:"mc",name:"Monaco",defaultFiat:"EUR"},{code:"md",name:"Moldova",defaultFiat:"EUR"},{code:"me",name:"Montenegro",defaultFiat:"EUR"},{code:"mg",name:"Madagascar",defaultFiat:"USD"},{code:"mk",name:"North Macedonia",defaultFiat:"EUR"},{code:"ml",name:"Mali",defaultFiat:"USD"},{code:"mm",name:"Myanmar",defaultFiat:"USD"},{code:"mn",name:"Mongolia",defaultFiat:"USD"},{code:"mr",name:"Mauritania",defaultFiat:"USD"},{code:"mt",name:"Malta",defaultFiat:"EUR"},{code:"mu",name:"Mauritius",defaultFiat:"USD"},{code:"mv",name:"Maldives",defaultFiat:"USD"},{code:"mw",name:"Malawi",defaultFiat:"USD"},{code:"mx",name:"Mexico",defaultFiat:"MXN"},{code:"my",name:"Malaysia",defaultFiat:"USD"},{code:"mz",name:"Mozambique",defaultFiat:"USD"},{code:"na",name:"Namibia",defaultFiat:"ZAR"},{code:"ne",name:"Niger",defaultFiat:"USD"},{code:"ng",name:"Nigeria",defaultFiat:"NGN"},{code:"ni",name:"Nicaragua",defaultFiat:"USD"},{code:"nl",name:"Netherlands",defaultFiat:"EUR"},{code:"no",name:"Norway",defaultFiat:"NOK"},{code:"np",name:"Nepal",defaultFiat:"USD"},{code:"nr",name:"Nauru",defaultFiat:"AUD"},{code:"nz",name:"New Zealand",defaultFiat:"NZD"},{code:"om",name:"Oman",defaultFiat:"USD"},{code:"pa",name:"Panama",defaultFiat:"USD"},{code:"pe",name:"Peru",defaultFiat:"USD"},{code:"pg",name:"Papua New Guinea",defaultFiat:"USD"},{code:"ph",name:"Philippines",defaultFiat:"PHP"},{code:"pk",name:"Pakistan",defaultFiat:"USD"},{code:"pl",name:"Poland",defaultFiat:"PLN"},{code:"pt",name:"Portugal",defaultFiat:"EUR"},{code:"pw",name:"Palau",defaultFiat:"USD"},{code:"py",name:"Paraguay",defaultFiat:"USD"},{code:"qa",name:"Qatar",defaultFiat:"QAR"},{code:"ro",name:"Romania",defaultFiat:"EUR"},{code:"rs",name:"Serbia",defaultFiat:"EUR"},{code:"ru",name:"Russia",defaultFiat:"USD"},{code:"rw",name:"Rwanda",defaultFiat:"USD"},{code:"sa",name:"Saudi Arabia",defaultFiat:"SAR"},{code:"sb",name:"Solomon Islands",defaultFiat:"USD"},{code:"sc",name:"Seychelles",defaultFiat:"USD"},{code:"sd",name:"Sudan",defaultFiat:"USD"},{code:"se",name:"Sweden",defaultFiat:"SEK"},{code:"sg",name:"Singapore",defaultFiat:"SGD"},{code:"si",name:"Slovenia",defaultFiat:"EUR"},{code:"sk",name:"Slovakia",defaultFiat:"EUR"},{code:"sl",name:"Sierra Leone",defaultFiat:"USD"},{code:"sm",name:"San Marino",defaultFiat:"EUR"},{code:"sn",name:"Senegal",defaultFiat:"USD"},{code:"so",name:"Somalia",defaultFiat:"USD"},{code:"sr",name:"Suriname",defaultFiat:"USD"},{code:"ss",name:"South Sudan",defaultFiat:"USD"},{code:"sv",name:"El Salvador",defaultFiat:"USD"},{code:"sy",name:"Syria",defaultFiat:"USD"},{code:"sz",name:"Eswatini",defaultFiat:"ZAR"},{code:"td",name:"Chad",defaultFiat:"USD"},{code:"tg",name:"Togo",defaultFiat:"USD"},{code:"th",name:"Thailand",defaultFiat:"THB"},{code:"tj",name:"Tajikistan",defaultFiat:"USD"},{code:"tl",name:"Timor-Leste",defaultFiat:"USD"},{code:"tm",name:"Turkmenistan",defaultFiat:"USD"},{code:"tn",name:"Tunisia",defaultFiat:"USD"},{code:"to",name:"Tonga",defaultFiat:"USD"},{code:"tr",name:"Turkey",defaultFiat:"TRY"},{code:"tt",name:"Trinidad and Tobago",defaultFiat:"USD"},{code:"tv",name:"Tuvalu",defaultFiat:"AUD"},{code:"tw",name:"Taiwan",defaultFiat:"TWD"},{code:"tz",name:"Tanzania",defaultFiat:"USD"},{code:"ua",name:"Ukraine",defaultFiat:"USD"},{code:"ug",name:"Uganda",defaultFiat:"USD"},{code:"us",name:"United States",defaultFiat:"USD"},{code:"uy",name:"Uruguay",defaultFiat:"USD"},{code:"uz",name:"Uzbekistan",defaultFiat:"USD"},{code:"va",name:"Vatican City",defaultFiat:"EUR"},{code:"vc",name:"Saint Vincent and the Grenadines",defaultFiat:"USD"},{code:"ve",name:"Venezuela",defaultFiat:"USD"},{code:"vn",name:"Vietnam",defaultFiat:"VND"},{code:"vu",name:"Vanuatu",defaultFiat:"USD"},{code:"ws",name:"Samoa",defaultFiat:"USD"},{code:"ye",name:"Yemen",defaultFiat:"USD"},{code:"za",name:"South Africa",defaultFiat:"ZAR"},{code:"zm",name:"Zambia",defaultFiat:"USD"},{code:"zw",name:"Zimbabwe",defaultFiat:"USD"}],xt=Object.fromEntries(qe.map(t=>[t.code,t]));function ct(t,a){if(!t)return"USD";const r=xt[t.toLowerCase()],n=(r==null?void 0:r.defaultFiat)||"USD";return!a||a.length===0||a.includes(n)?n:a.includes("USD")?"USD":a[0]||"USD"}const yt=!0;function Pt(t,a,r=yt){return t===void 0||a===void 0?r:t.length===0||a.length===0?!1:t.some(n=>a.includes(n))}function Or(t,a,r=yt){return t.filter(n=>Pt(n.providers,a,r))}function _r(t,a,r=yt){const n=[];for(const o of t){const l=o.networks.filter(u=>Pt(u.providers,a,r));l.length>0&&n.push(l.length===o.networks.length?o:{...o,networks:l})}return n}function Kr(t,a,r,n=yt){return r?t.filter(o=>o.supportedFiats.includes(r)&&Pt(o.providers,a,n)):[]}function Vr(t,a,r){const n={};let o=!1;if(!r.cryptoLocked&&!r.networkLocked){if(!(t.cryptoCurrency&&a.availableCryptos.some(s=>s.code===t.cryptoCurrency&&s.networks.some(d=>d.id===t.network)))&&a.availableCryptos.length>0){const d=a.availableCryptos.find(h=>h.code==="BTC")||a.availableCryptos[0],c=d.networks.find(h=>h.isDefault)||d.networks[0];d.code!==t.cryptoCurrency&&(n.cryptoCurrency=d.code,o=!0),c&&c.id!==t.network&&(n.network=c.id,o=!0)}}else if(!r.cryptoLocked&&r.networkLocked){if(!(t.cryptoCurrency&&a.availableCryptos.some(s=>s.code===t.cryptoCurrency&&s.networks.some(d=>d.id===t.network)))){const s=a.availableCryptos.find(d=>d.networks.some(c=>c.id===t.network));s&&s.code!==t.cryptoCurrency&&(n.cryptoCurrency=s.code,o=!0)}}else if(r.cryptoLocked&&!r.networkLocked){const u=a.availableCryptos.find(s=>s.code===t.cryptoCurrency);if(u&&!u.networks.some(d=>d.id===t.network)&&u.networks.length>0){const d=u.networks.find(c=>c.isDefault)||u.networks[0];d.id!==t.network&&(n.network=d.id,o=!0)}}if(!r.fiatLocked&&!(t.fiatCurrency&&a.availableFiats.some(s=>s.code===t.fiatCurrency))&&a.availableFiats.length>0){const d=a.availableFiats.find(c=>c.code==="USD")||a.availableFiats[0];d.code!==t.fiatCurrency&&(n.fiatCurrency=d.code,o=!0)}if(!(t.paymentMethodId&&a.availablePaymentMethods.some(u=>u.id===t.paymentMethodId))&&a.availablePaymentMethods.length>0){const s=a.availablePaymentMethods.find(d=>d.id.includes("card")||d.id.includes("debit"))||a.availablePaymentMethods[0];s.id!==t.paymentMethodId&&(n.paymentMethodId=s.id,o=!0)}return o?n:null}function Wr(t,a,r,n){var o,l,u;if(r.cryptoLocked){const s=(o=t.cryptos)==null?void 0:o.find(c=>c.code===a.cryptoCurrency);if(!s)return!0;const d=(l=s.networks)==null?void 0:l.find(c=>c.id===a.network);if(!d||d.providers!==void 0&&d.providers.length===0||d.providers!==void 0&&(n.availableFiats.length===0||n.availablePaymentMethods.length===0))return!0}if(r.networkLocked&&!r.cryptoLocked&&!n.availableCryptos.some(d=>d.networks.some(c=>c.id===a.network)))return!0;if(r.fiatLocked){const s=(u=t.fiats)==null?void 0:u.find(d=>d.code===a.fiatCurrency);if(!s||s.providers!==void 0&&s.providers.length===0||s.providers!==void 0&&n.availableCryptos.length===0)return!0}return!1}function ia(t,a){if(!t)return t;const r=t.indexOf(".");if(r===-1)return t;let n=t;return n.length-r-1>a&&(n=n.slice(0,r+a+1)),n=n.replace(/0+$/,"").replace(/\.$/,""),n}function Gr(t,a,r){return!t&&!!a&&!a.bestQuote&&!!r}function $r(t,a){if(!t.length)return null;if(a){const n=t.find(o=>o.gatewayId===a);if(n!=null&&n.reason)return n.reason}const r=t.map((n,o)=>({reason:n.reason,score:n.reason?Zr(n.reason):99,idx:o})).filter(n=>n.reason);return r.length?(r.sort((n,o)=>n.score-o.score||n.idx-o.idx),r[0].reason):null}function Zr(t){const a=t.toLowerCase();return/amount|out of range for|minimum|maximum/.test(a)?1:/currency|pair|network|chain/.test(a)?2:/country|region|location/.test(a)?3:/does not support|unsupported/.test(a)?4:5}const Xr=["completed","failed","cancelled","expired","refunded"],va={step:"amount",flowType:"buy",fiatCurrency:"USD",fiatAmount:"",cryptoCurrency:"",cryptoAmount:"",network:"",paymentMethodId:"",walletAddress:"",walletError:null,selectedProvider:null,selectedQuote:null,customerId:"",email:"",country:"",countrySource:"",errorMessage:null};function Yr(t,a){var r,n,o,l,u,s,d,c;switch(a.type){case"SET_STEP":return{...t,step:a.step,errorMessage:null};case"SET_FLOW_TYPE":return{...t,flowType:a.flowType,fiatAmount:"",cryptoAmount:"",fiatCurrency:(n=(r=a.fieldLocks)==null?void 0:r.sourceCurrency)!=null&&n.locked?t.fiatCurrency:"",cryptoCurrency:(l=(o=a.fieldLocks)==null?void 0:o.destinationCurrency)!=null&&l.locked?t.cryptoCurrency:"",network:(s=(u=a.fieldLocks)==null?void 0:u.network)!=null&&s.locked||(c=(d=a.fieldLocks)==null?void 0:d.destinationCurrency)!=null&&c.locked?t.network:"",paymentMethodId:"",selectedQuote:null,selectedProvider:null,errorMessage:null};case"SET_FIAT_CURRENCY":return{...t,fiatCurrency:a.currency};case"SET_FIAT_AMOUNT":return{...t,fiatAmount:a.amount};case"SET_CRYPTO_CURRENCY":return{...t,cryptoCurrency:a.currency,network:""};case"SET_CRYPTO_AMOUNT":return{...t,cryptoAmount:a.amount};case"SET_NETWORK":return{...t,network:a.network};case"SET_CRYPTO_CHAIN":return{...t,network:a.chain};case"SET_PAYMENT_METHOD":return{...t,paymentMethodId:a.methodId};case"SET_WALLET_ADDRESS":return{...t,walletAddress:a.address,walletError:null};case"SET_WALLET_ERROR":return{...t,walletError:a.message};case"SELECT_QUOTE":return{...t,selectedQuote:a.quote,selectedProvider:a.quote.gatewayId};case"CLEAR_QUOTE":return{...t,selectedQuote:null,selectedProvider:null};case"SET_CUSTOMER_ID":return{...t,customerId:a.customerId};case"SET_EMAIL":return{...t,email:a.email};case"SET_COUNTRY":return{...t,country:a.country,countrySource:"manual"};case"SET_COUNTRY_AUTO":return{...t,country:a.country,countrySource:"auto"};case"SET_ERROR":return{...t,step:"error",errorMessage:a.message};case"CLEAR_ERROR":return{...t,errorMessage:null};case"RESET":return va;default:return t}}const Ca=i.createContext(null);function ba(t){const a=i.useRef(t.defaultFiatCurrency!==void 0),{projectId:r,apiUrl:n="https://api.nowramp.com",assetBaseUrl:o="",flowType:l="buy",customerId:u="",brandId:s,defaultFiatCurrency:d="USD",defaultCryptoCurrency:c="BTC",defaultNetwork:h="",defaultFiatAmount:p="",defaultCryptoAmount:f="",defaultWalletAddress:y="",defaultGateway:j,defaultCountry:N,fieldLocks:x,partnerMetadata:k,statusPollInterval:D=5e3,onComplete:G,onError:$,children:ee}=t,Z=i.useMemo(()=>({apiUrl:n,projectId:r}),[n,r]),Y=h||(c==="BTC"?"bitcoin":c?c.toLowerCase():""),ge=l==="sell",Q=ge?!!f:!!p,C=(ge?!!(Q&&c&&Y):!!(Q&&c&&Y&&y))&&j?"confirm":"amount",T=p||(l==="buy"?"250":""),[m,L]=i.useReducer(Yr,{...va,step:C,flowType:l,fiatCurrency:d,cryptoCurrency:c,network:Y,fiatAmount:ia(T,2),cryptoAmount:ia(f,6),walletAddress:y,customerId:u,...N?{country:N.toLowerCase(),countrySource:"manual"}:{}}),w=m.flowType==="sell",{config:b,loading:z,error:ie}=fa(Z,m.flowType,m.country||void 0),ve=i.useRef(!1);i.useEffect(()=>{var I,F;if(ve.current||!(b!=null&&b.detectedCountry)||m.country)return;ve.current=!0;const v=b.detectedCountry.toLowerCase();L({type:"SET_COUNTRY_AUTO",country:v});const R=(I=b.fiats)==null?void 0:I.map(B=>B.code),E=ct(v,R);E!==m.fiatCurrency&&!((F=x==null?void 0:x.sourceCurrency)!=null&&F.locked)&&!a.current&&L({type:"SET_FIAT_CURRENCY",currency:E})},[b,m.country,m.fiatCurrency,x]);const ke=i.useRef(!1);i.useEffect(()=>{var E,I;if(ke.current||!N||!((E=b==null?void 0:b.fiats)!=null&&E.length))return;ke.current=!0;const v=b.fiats.map(F=>F.code),R=ct(N,v);R!==m.fiatCurrency&&!((I=x==null?void 0:x.sourceCurrency)!=null&&I.locked)&&!a.current&&L({type:"SET_FIAT_CURRENCY",currency:R})},[N,b,m.fiatCurrency,x]);const le=i.useRef(m.country);i.useEffect(()=>{var E,I;if(m.country===le.current||(le.current=m.country,m.countrySource==="manual"&&(Be.current=!1),m.countrySource!=="manual")||!((E=b==null?void 0:b.fiats)!=null&&E.length))return;const v=b.fiats.map(F=>F.code),R=ct(m.country,v);R!==m.fiatCurrency&&!((I=x==null?void 0:x.sourceCurrency)!=null&&I.locked)&&L({type:"SET_FIAT_CURRENCY",currency:R})},[m.country,m.countrySource,b,m.fiatCurrency,x]);const te=i.useRef(m.fiatCurrency);i.useEffect(()=>{var I;if(m.fiatCurrency===te.current||(te.current=m.fiatCurrency,w||!((I=b==null?void 0:b.fiats)!=null&&I.length)||!m.fiatAmount))return;const v=b.fiats.find(F=>F.code===m.fiatCurrency);if(!(v!=null&&v.minAmount))return;const R=parseFloat(m.fiatAmount),E=parseFloat(v.minAmount);!isNaN(R)&&!isNaN(E)&&R<E&&L({type:"SET_FIAT_AMOUNT",amount:String(Math.ceil(E))})},[m.fiatCurrency,m.fiatAmount,b,w]);const{availableFiats:ae,availableCryptos:K,availablePaymentMethods:ce}=i.useMemo(()=>{var E,I,F;if(!b)return{availableFiats:[],availableCryptos:[],availablePaymentMethods:[]};let v;if(m.cryptoCurrency&&m.network){const B=(E=b.cryptos)==null?void 0:E.find(ue=>ue.code===m.cryptoCurrency),oe=(I=B==null?void 0:B.networks)==null?void 0:I.find(ue=>ue.id===m.network);!B||!oe?v=[]:v=oe.providers}let R;if(m.fiatCurrency){const B=(F=b.fiats)==null?void 0:F.find(oe=>oe.code===m.fiatCurrency);B?R=B.providers:R=[]}return{availableFiats:Or(b.fiats??[],v),availableCryptos:_r(b.cryptos??[],R),availablePaymentMethods:Kr(b.paymentMethods??[],v,m.fiatCurrency)}},[b,m.cryptoCurrency,m.network,m.fiatCurrency]),We=i.useMemo(()=>{var v,R,E;return z||!b?!1:Wr(b,{cryptoCurrency:m.cryptoCurrency,network:m.network,fiatCurrency:m.fiatCurrency},{cryptoLocked:!!((v=x==null?void 0:x.destinationCurrency)!=null&&v.locked),networkLocked:!!((R=x==null?void 0:x.network)!=null&&R.locked),fiatLocked:!!((E=x==null?void 0:x.sourceCurrency)!=null&&E.locked)},{availableFiats:ae,availableCryptos:K,availablePaymentMethods:ce})},[z,b,x,m.cryptoCurrency,m.network,m.fiatCurrency,ae,K,ce]);i.useEffect(()=>{var R,E,I;if(z||ae.length===0&&K.length===0)return;const v=Vr({cryptoCurrency:m.cryptoCurrency,network:m.network,fiatCurrency:m.fiatCurrency,paymentMethodId:m.paymentMethodId},{availableFiats:ae,availableCryptos:K,availablePaymentMethods:ce},{cryptoLocked:!!((R=x==null?void 0:x.destinationCurrency)!=null&&R.locked),networkLocked:!!((E=x==null?void 0:x.network)!=null&&E.locked),fiatLocked:!!((I=x==null?void 0:x.sourceCurrency)!=null&&I.locked)});v&&(v.cryptoCurrency!==void 0&&L({type:"SET_CRYPTO_CURRENCY",currency:v.cryptoCurrency}),v.network!==void 0&&L({type:"SET_NETWORK",network:v.network}),v.fiatCurrency!==void 0&&L({type:"SET_FIAT_CURRENCY",currency:v.fiatCurrency}),v.paymentMethodId!==void 0&&L({type:"SET_PAYMENT_METHOD",methodId:v.paymentMethodId}))},[z,ae,K,ce,m.cryptoCurrency,m.network,m.fiatCurrency,m.paymentMethodId,x,L]);const q=i.useMemo(()=>{if(w){if(!m.cryptoAmount)return null;const F=parseFloat(m.cryptoAmount);return isNaN(F)||F<=0?"Enter a valid amount":null}if(!b||!m.fiatAmount)return null;const v=parseFloat(m.fiatAmount);if(isNaN(v))return null;const R=b.fiats.find(F=>F.code===m.fiatCurrency);if(!R)return null;const E=parseFloat(R.minAmount),I=parseFloat(R.maxAmount);return!isNaN(E)&&v<E?`Minimum amount is ${R.minAmount} ${m.fiatCurrency}`:!isNaN(I)&&v>I?`Maximum amount is ${R.maxAmount} ${m.fiatCurrency}`:null},[b,m.fiatAmount,m.fiatCurrency,m.cryptoAmount,w]),de=i.useMemo(()=>{const v=w?!!m.cryptoAmount:!!m.fiatAmount;return!b||!v||!m.fiatCurrency||!m.cryptoCurrency||!m.network||q||b.detectedCountry&&m.countrySource===""&&!N?null:{fiatCurrency:m.fiatCurrency,...w?{cryptoAmount:m.cryptoAmount}:{fiatAmount:m.fiatAmount},cryptoCurrency:m.cryptoCurrency,network:m.network,paymentMethodId:m.paymentMethodId||void 0,country:m.country||void 0,orderType:m.flowType}},[b,m.fiatCurrency,m.fiatAmount,m.cryptoAmount,m.cryptoCurrency,m.network,m.paymentMethodId,m.country,m.countrySource,q,w,m.flowType,N]),{quotes:O,loading:De,error:Ge,refetch:Ct}=xa(Z,de),re=Gr(De,O,de),Be=i.useRef(!1);i.useEffect(()=>{var v;Be.current||m.countrySource==="auto"&&((v=x==null?void 0:x.sourceCurrency)!=null&&v.locked||a.current||De||!de||Ge||!O||O.bestQuote||m.fiatCurrency!=="USD"&&(Be.current=!0,L({type:"SET_FIAT_CURRENCY",currency:"USD"}),L({type:"SET_FIAT_AMOUNT",amount:"250"})))},[O,De,Ge,de,m.countrySource,m.fiatCurrency]);const{order:we,loading:bt,error:ne,createOrder:P}=ya(Z),tt=15e3,{status:_,loading:St}=ga({apiUrl:n},(we==null?void 0:we.orderId)??null,{pollInterval:D,initialDelay:tt}),$e=i.useRef(null);i.useEffect(()=>{!(_!=null&&_.status)||!G||Xr.includes(_.status)&&$e.current!==_.orderId&&($e.current=_.orderId,G(_))},[_==null?void 0:_.status,_==null?void 0:_.orderId,G]),i.useEffect(()=>{const v=ie||ne;v&&$&&$(v)},[ie,ne,$]);const Ne=j||(b==null?void 0:b.defaultGateway)||null,at=i.useMemo(()=>{if(!re||!(O!=null&&O.unavailableGateways))return null;const v=O.preferredGatewayId||Ne;return $r(O.unavailableGateways,v)},[re,O,Ne]),Pe=i.useRef(Ne);Pe.current=Ne;const Ze=i.useRef(O);Ze.current=O;const Xe=i.useRef(s);Xe.current=s;const Re=i.useCallback(async()=>{var R,E,I;const v=((R=m.selectedQuote)==null?void 0:R.gatewayId)||((I=(E=Ze.current)==null?void 0:E.bestQuote)==null?void 0:I.gatewayId)||Pe.current;if(!v||!m.walletAddress){const F=[!v&&"gateway",!m.walletAddress&&"walletAddress"].filter(Boolean).join(", ");L({type:"SET_ERROR",message:`Missing required fields: ${F}`});return}try{await P({gateway:v,customerId:m.customerId||void 0,fiatCurrency:m.fiatCurrency,...w?{cryptoAmount:m.cryptoAmount}:{fiatAmount:m.fiatAmount},cryptoCurrency:m.cryptoCurrency,network:m.network,walletAddress:m.walletAddress,paymentMethodId:m.paymentMethodId||void 0,email:m.email||void 0,orderType:m.flowType,...Xe.current?{metadata:{brand:Xe.current}}:{},...k&&Object.keys(k).length>0?{partnerMetadata:k}:{}}),L({type:"SET_STEP",step:"checkout"})}catch(F){const B=F instanceof Error?F.message:"Failed to create order";/wallet|address/i.test(B)?L({type:"SET_WALLET_ERROR",message:B.replace(/^Failed to create checkout intent:\s*/i,"")}):L({type:"SET_ERROR",message:B})}},[m,P,w,k]),Ye=i.useCallback(v=>{L({type:"SET_STEP",step:v})},[]),jt=i.useCallback(()=>{const v=["confirm","amount","quotes","wallet","checkout","processing","complete"],R=v.indexOf(m.step);R>0&&L({type:"SET_STEP",step:v[R-1]})},[m.step,w]),kt=i.useMemo(()=>{const v=w?!!m.cryptoAmount:!!m.fiatAmount;switch(m.step){case"confirm":return!!(v&&m.cryptoCurrency&&m.network&&m.walletAddress&&!q);case"amount":return!!(v&&m.cryptoCurrency&&m.network&&!q);case"quotes":return!!m.selectedQuote;case"wallet":return!!m.walletAddress;default:return!1}},[m,q,w]),rt={apiConfig:Z,assetBaseUrl:o,config:b,configLoading:z,configError:ie,state:m,dispatch:L,quotes:O,quotesLoading:De,quotesError:Ge,fetchQuotes:Ct,order:we,orderLoading:bt,orderError:ne,createOrder:Re,orderStatus:_,orderStatusLoading:St,fieldLocks:x||null,defaultGateway:Ne,availableFiats:ae,availableCryptos:K,availablePaymentMethods:ce,selectionUnsupported:We,quotesEmpty:re,bestUnavailableReason:at,amountError:q,goToStep:Ye,goBack:jt,canProceed:kt};return e.jsx(Ca.Provider,{value:rt,children:ee})}function Me(){const t=i.useContext(Ca);if(!t)throw new Error("useRamp must be used within a RampProvider");return t}const et={"header.buy":"Buy","header.sell":"Sell","spend.label":"You spend","spend.placeholderFiat":"250","spend.placeholderCrypto":"0.01","receive.label":"You get","receive.fetchingRate":"Fetching best rate...","payment.label":"Payment method","payment.select":"Select","payment.noneAvailable":"No payment methods for this pair","provider.label":"By","provider.select":"Select","wallet.label":"Receiving wallet address","wallet.placeholderBuy":"Enter your receiving address","wallet.placeholderSell":"Enter your sending address","wallet.validating":"Validating address...","wallet.invalid":"Enter a valid wallet address","wallet.invalidServer":"Invalid wallet address","cta.buy":"Buy {crypto}","cta.sell":"Sell {crypto}","cta.gettingPrice":"Getting best price...","cta.processing":"Processing...","footer.poweredBy":"Powered by ","footer.brand":"NowRamp","rate.title":"Rate breakdown","rate.close":"Close","rate.updatesIn":"Rate updates in 00:{seconds}","rate.noQuote":"No quote available","rate.exchangeRate":"Exchange rate","rate.processingFee":"Processing fee","rate.networkFee":"Network fee","rate.provider":"Provider","rate.updatesInLabel":"Rate updates in","rate.networkFeeIncl":"Network fee incl.","rate.rateTooltip":"As the market is highly volatile, we can fix the exchange rate for no longer than 30 seconds.","rate.networkFeeTooltip":"Includes a fee charged by blockchain to execute the transaction.","rate.feeIncluded":"{percentage}% incl.","toast.orderCreated":"Order created","toast.redirecting":"Redirecting to checkout...","toast.orderFailed":"Order failed","toast.couldNotCreate":"Could not create order","toast.quoteError":"Quote error","toast.noProviders":"No providers","toast.somethingWrong":"Something went wrong","error.amountZero":"Amount should be more than 0","error.minAmountFiat":"Minimum amount is {min} {currency}","error.minAmountCrypto":"Minimum amount is {min} {currency}","error.noProviders":"No providers available for this combination","error.currencyUnavailableBuy":"This currency is not available for buy orders","error.currencyUnavailableSell":"This currency is not available for sell orders","parity.info":"You will be charged for {receiveAmount} {crypto}, the rest up to {spendAmount} {fiat} will be credited to your {partner} account","redirect.secureBadge":"Secure payment","redirect.title":"Continue Payment","redirect.description":"You'll be redirected to {gateway} to complete your payment.","redirect.countdown":"Redirecting in {seconds}...","redirect.openTab":"Open ACH in new tab","redirect.cancel":"Cancel","redirect.tabHelper":"If the new tab has not opened, click the button above.","checkout.noOrder":"No order found","checkout.goBack":"Go Back","checkout.expired":"Checkout expired","checkout.expiredDesc":"The session has expired. Please try again.","checkout.startOver":"Start over","checkout.cancel":"Cancel","checkout.loading":"Loading checkout...","checkout.iframeTitle":"Provider Checkout","checkout.widgetTitle":"Payment Checkout","checkout.unknownMethod":"Unknown checkout method","processing.default":"Processing your order...","processing.pending":"Waiting for payment confirmation...","processing.active":"Processing your transaction...","processing.generic":"Processing...","processing.checkingStatus":"Checking status...","processing.orderId":"Order ID","processing.provider":"Provider","processing.amount":"Amount","processing.receiving":"Receiving","processing.network":"Network","processing.toAddress":"To Address","processing.usuallyMinutes":"This usually takes a few minutes.","processing.safeToClose":"You can safely close this page - we'll send you an email when complete.","complete.buyTitle":"Purchase Complete!","complete.sellTitle":"Sale Complete!","complete.buyDesc":"Your {crypto} has been sent to your wallet.","complete.sellDesc":"Your {fiat} payout is being processed.","complete.amountBuy":"Amount Received","complete.amountSell":"Amount Sold","complete.paidBuy":"Amount Paid","complete.paidSell":"Payout Amount","complete.network":"Network","complete.wallet":"Wallet","complete.transaction":"Transaction","complete.provider":"Provider","complete.orderId":"Order ID","complete.completed":"Completed","complete.viewExplorer":"View on Explorer","complete.done":"Done","errorStep.failed":"Payment Failed","errorStep.cancelled":"Order Cancelled","errorStep.expired":"Order Expired","errorStep.refunded":"Order Refunded","errorStep.unknown":"Something Went Wrong","errorStep.failedBuy":"Your payment could not be processed. Please try again or use a different payment method.","errorStep.failedSell":"Your sale could not be processed. Please try again.","errorStep.cancelledBuy":"Your order was cancelled. No payment was processed.","errorStep.cancelledSell":"Your sale was cancelled. No crypto was transferred.","errorStep.expiredBuy":"Your order has expired. Please start a new purchase.","errorStep.expiredSell":"Your order has expired. Please start a new sale.","errorStep.refundedBuy":"Your payment has been refunded. The funds should appear in your account within 5-10 business days.","errorStep.refundedSell":"Your crypto has been returned. The funds should appear in your wallet shortly.","errorStep.genericDesc":"An unexpected error occurred. Please try again.","errorStep.orderId":"Order ID","errorStep.tryAgain":"Try Again","errorStep.startOver":"Start Over","errorStep.return":"Return","errorStep.needHelp":"Need help? Contact ","errorStep.reference":"Reference: {orderId}","confirm.buyTitle":"Confirm Purchase","confirm.sellTitle":"Confirm Sale","confirm.loading":"Loading...","confirm.provider":"Provider","confirm.youPay":"You pay","confirm.youSell":"You sell","confirm.youReceive":"You receive","confirm.wallet":"Wallet","confirm.network":"Network","confirm.refundAddress":"Refund address","confirm.parityNote":"Charged amount from provider may differ. The rest up to {amount} {crypto} will be credited to your {partner} account.","confirm.processing":"Processing...","confirm.confirmPay":"Confirm & Pay","confirm.confirmSell":"Confirm & Sell","confirm.payout":"{currency} payout","confirm.cryptoOnNetwork":"{crypto} on {network}","payment.name.card":"Card","payment.name.bankTransfer":"Bank Transfer","payment.name.ach":"ACH","modal.selectFiat":"Select fiat currency","modal.selectCrypto":"Select crypto currency","modal.choosePayment":"Choose payment method","modal.selectCountry":"Select your country","modal.selectLanguage":"Select language","modal.popular":"Popular","modal.recommended":"Recommended","modal.noCurrencies":"No currencies found","modal.noPaymentMethods":"No payment methods found","modal.noCountries":"No countries found","modal.noLanguages":"No languages found","modal.chooseRamp":"Choose Ramp","modal.bestPrice":"Best price","modal.noQuotes":"No quotes available for this request","modal.noProvidersFound":"No providers found","payment.unavailableFor":"No payment methods available for {currency}","skeleton.poweredBy":"Powered by NowRamp","error.createOrderFailed":"Failed to create order","errorStep.returnToMerchant":"Return to merchant","settings.location":"Location","settings.darkMode":"Dark Mode","settings.privacy":"Privacy policy","settings.terms":"Terms of use","settings.language":"Language"},Ie=[{code:"en",name:"English",english:"English"},{code:"es",name:"Español",english:"Spanish"},{code:"fr",name:"Français",english:"French"},{code:"de",name:"Deutsch",english:"German"},{code:"pt",name:"Português",english:"Portuguese"},{code:"it",name:"Italiano",english:"Italian"},{code:"nl",name:"Nederlands",english:"Dutch"},{code:"ru",name:"Русский",english:"Russian"},{code:"zh",name:"中文",english:"Chinese"},{code:"ja",name:"日本語",english:"Japanese"},{code:"ko",name:"한국어",english:"Korean"},{code:"ar",name:"العربية",english:"Arabic"},{code:"hi",name:"हिन्दी",english:"Hindi"},{code:"tr",name:"Türkçe",english:"Turkish"},{code:"pl",name:"Polski",english:"Polish"},{code:"vi",name:"Tiếng Việt",english:"Vietnamese"},{code:"th",name:"ไทย",english:"Thai"},{code:"id",name:"Bahasa Indonesia",english:"Indonesian"},{code:"uk",name:"Українська",english:"Ukrainian"},{code:"cs",name:"Čeština",english:"Czech"},{code:"bg",name:"Български",english:"Bulgarian"},{code:"hr",name:"Hrvatski",english:"Croatian"},{code:"da",name:"Dansk",english:"Danish"},{code:"et",name:"Eesti",english:"Estonian"},{code:"fi",name:"Suomi",english:"Finnish"},{code:"el",name:"Ελληνικά",english:"Greek"},{code:"hu",name:"Magyar",english:"Hungarian"},{code:"ga",name:"Gaeilge",english:"Irish"},{code:"lv",name:"Latviešu",english:"Latvian"},{code:"lt",name:"Lietuvių",english:"Lithuanian"},{code:"mt",name:"Malti",english:"Maltese"},{code:"ro",name:"Română",english:"Romanian"},{code:"sk",name:"Slovenčina",english:"Slovak"},{code:"sl",name:"Slovenščina",english:"Slovenian"},{code:"sv",name:"Svenska",english:"Swedish"},{code:"ur",name:"اردو",english:"Urdu"},{code:"fa",name:"فارسی",english:"Persian"},{code:"bn",name:"বাংলা",english:"Bengali"},{code:"ta",name:"தமிழ்",english:"Tamil"},{code:"te",name:"తెలుగు",english:"Telugu"},{code:"mr",name:"मराठी",english:"Marathi"},{code:"gu",name:"ગુજરાતી",english:"Gujarati"},{code:"kn",name:"ಕನ್ನಡ",english:"Kannada"},{code:"ml",name:"മലയാളം",english:"Malayalam"}],Sa=i.createContext(null),la={en:()=>Promise.resolve({default:et}),es:()=>Promise.resolve().then(()=>require("./es-t2vw4GtN.js")),fr:()=>Promise.resolve().then(()=>require("./fr-D69xhq2o.js")),de:()=>Promise.resolve().then(()=>require("./de-pdd7Ef_M.js")),pt:()=>Promise.resolve().then(()=>require("./pt-CasdsE3O.js")),it:()=>Promise.resolve().then(()=>require("./it-Ba7wBuRX.js")),nl:()=>Promise.resolve().then(()=>require("./nl-C7ITapV-.js")),ru:()=>Promise.resolve().then(()=>require("./ru-B5Y3xqwR.js")),zh:()=>Promise.resolve().then(()=>require("./zh-BqyKrwpt.js")),ja:()=>Promise.resolve().then(()=>require("./ja-CPBjvGS_.js")),ko:()=>Promise.resolve().then(()=>require("./ko-D-5KAati.js")),ar:()=>Promise.resolve().then(()=>require("./ar-DjxTD_0y.js")),hi:()=>Promise.resolve().then(()=>require("./hi-C0TISlxI.js")),tr:()=>Promise.resolve().then(()=>require("./tr-DtE7JayY.js")),pl:()=>Promise.resolve().then(()=>require("./pl-l0pfAgne.js")),vi:()=>Promise.resolve().then(()=>require("./vi-DjSOJLXz.js")),th:()=>Promise.resolve().then(()=>require("./th-BH9OczUI.js")),id:()=>Promise.resolve().then(()=>require("./id-qy3taLG1.js")),uk:()=>Promise.resolve().then(()=>require("./uk-CQTdYo3Q.js")),cs:()=>Promise.resolve().then(()=>require("./cs-KF3yjBNM.js")),bg:()=>Promise.resolve().then(()=>require("./bg-BimHE3F3.js")),hr:()=>Promise.resolve().then(()=>require("./hr-DT77Sn3q.js")),da:()=>Promise.resolve().then(()=>require("./da-Bna90FQo.js")),et:()=>Promise.resolve().then(()=>require("./et-tiMYfPWp.js")),fi:()=>Promise.resolve().then(()=>require("./fi-DIdZQl0k.js")),el:()=>Promise.resolve().then(()=>require("./el-DiDKgGMb.js")),hu:()=>Promise.resolve().then(()=>require("./hu-Dx2JGTJc.js")),ga:()=>Promise.resolve().then(()=>require("./ga-DM-F-bEJ.js")),lv:()=>Promise.resolve().then(()=>require("./lv-MGbTMx6O.js")),lt:()=>Promise.resolve().then(()=>require("./lt-Sq1I6sJl.js")),mt:()=>Promise.resolve().then(()=>require("./mt-BTwndFRN.js")),ro:()=>Promise.resolve().then(()=>require("./ro-S8nJb3-a.js")),sk:()=>Promise.resolve().then(()=>require("./sk-Dnsp_e_y.js")),sl:()=>Promise.resolve().then(()=>require("./sl-BHXMAUQW.js")),sv:()=>Promise.resolve().then(()=>require("./sv-70nUgQ0i.js")),ur:()=>Promise.resolve().then(()=>require("./ur-qHUuLPQ1.js")),fa:()=>Promise.resolve().then(()=>require("./fa-Bx3HrOrv.js")),bn:()=>Promise.resolve().then(()=>require("./bn-BlRnyHpx.js")),ta:()=>Promise.resolve().then(()=>require("./ta-BkvdJwvc.js")),te:()=>Promise.resolve().then(()=>require("./te-CfeGKsBy.js")),mr:()=>Promise.resolve().then(()=>require("./mr-BkSOwa0H.js")),gu:()=>Promise.resolve().then(()=>require("./gu-_eyxkfNd.js")),kn:()=>Promise.resolve().then(()=>require("./kn-0AnW6O7S.js")),ml:()=>Promise.resolve().then(()=>require("./ml-D_IGAglW.js"))},Fe={en:et};function ja(t,a){return a?t.replace(/\{(\w+)\}/g,(r,n)=>{const o=a[n];return o!==void 0?String(o):`{${n}}`}):t}function ka({defaultLocale:t="en",children:a}){const[r,n]=i.useState(t),[o,l]=i.useState(Fe[t]||et);i.useEffect(()=>{if(n(t),Fe[t])l(Fe[t]);else{const c=la[t];c&&c().then(h=>{Fe[t]=h.default,l(h.default)})}},[t]);const u=i.useCallback(c=>{if(n(c),Fe[c]){l(Fe[c]);return}const h=la[c];h&&h().then(p=>{Fe[c]=p.default,l(p.default)})},[]),s=i.useCallback((c,h)=>{const p=o[c]||et[c]||c;return ja(p,h)},[o]),d=i.useMemo(()=>({locale:r,setLocale:u,t:s,languages:Ie}),[r,u,s]);return e.jsx(Sa.Provider,{value:d,children:a})}function gt(){const t=i.useContext(Sa);return t||{locale:"en",setLocale:()=>{},t:(a,r)=>ja(et[a]||a,r),languages:Ie}}function U(){return gt().t}function wa({gatewayName:t,checkoutUrl:a,onCancel:r,redirectCountdown:n}){const o=U();return e.jsxs("div",{className:"flex flex-col items-center justify-center px-8 py-12 text-center flex-1",style:{background:"var(--t-redirect-bg)",color:"#ffffff"},children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 mb-6",style:{background:"rgba(255,255,255,0.2)",borderRadius:"var(--t-pill-radius)"},children:[e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[e.jsx("path",{d:"M6 1L2 3v3c0 2.5 1.7 4.8 4 5.5 2.3-.7 4-3 4-5.5V3L6 1z",fill:"#22c55e"}),e.jsx("path",{d:"M5 6.5l1 1 2-2.5",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsx("span",{className:"text-[11px] font-medium",children:o("redirect.secureBadge")})]}),e.jsx("h3",{className:"text-[20px] font-semibold mb-2",children:o("redirect.title")}),e.jsx("p",{className:"text-[14px] mb-2 opacity-90",children:o("redirect.description",{gateway:t})}),n!==null&&e.jsx("p",{className:"text-[13px] mb-6 opacity-70",children:o("redirect.countdown",{seconds:String(n)})}),e.jsxs("a",{href:a,className:"w-full font-medium text-[16px] flex items-center justify-center gap-2 transition-all",style:{height:52,borderRadius:"var(--t-cta-radius)",background:"#ffffff",color:"#000000",textDecoration:"none"},target:"_blank",rel:"noopener noreferrer",children:[o("redirect.openTab"),e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:e.jsx("path",{d:"M4 1.5h8.5V10M12 2L2 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsx("p",{className:"text-[11px] mt-2 opacity-60",children:o("redirect.tabHelper")}),e.jsx("button",{className:"w-full font-medium text-[14px] mt-2 transition-all",style:{height:48,borderRadius:"var(--t-cta-radius)",background:"rgba(255,255,255,0.2)",color:"#ffffff"},onClick:r,children:o("redirect.cancel")})]})}function fe({size:t=48}){const a=t<=14?1.5:t<=20?2:3;return e.jsx("div",{className:"shrink-0",style:{width:t,height:t,border:`${a}px solid var(--t-border)`,borderTopColor:"var(--t-text)",borderRadius:"50%",animation:"nramp-spin 0.8s linear infinite",display:"inline-block",verticalAlign:"middle"}})}function Na({className:t="",autoRedirect:a=!1,redirectDelay:r=3e3}){var y;const{order:n,orderStatus:o,goToStep:l,goBack:u}=Me(),s=U(),[d,c]=i.useState(!1),[h,p]=i.useState(null),f=n!=null&&n.checkout.expiresAt?Date.now()>n.checkout.expiresAt:!1;if(i.useEffect(()=>{if((n==null?void 0:n.checkout.method)==="redirect"&&a&&!f){p(Math.ceil(r/1e3));const j=setTimeout(()=>{window.location.href=n.checkout.url},r),N=setInterval(()=>{p(x=>x&&x>1?x-1:null)},1e3);return()=>{clearTimeout(j),clearInterval(N)}}},[n,a,r,f]),i.useEffect(()=>{o&&(o.status==="completed"?l("complete"):["failed","cancelled","expired"].includes(o.status)&&l("error"))},[o==null?void 0:o.status,l]),!n)return e.jsxs("div",{className:`flex flex-col items-center justify-center p-8 ${t}`,style:{color:"var(--t-text)"},children:[e.jsx("p",{className:"text-[15px] mb-4",children:s("checkout.noOrder")}),e.jsx("button",{className:"font-semibold text-[14px] transition-all",style:{height:48,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-surface)",color:"var(--t-text)",paddingLeft:24,paddingRight:24},onClick:u,children:s("checkout.goBack")})]});if(f)return e.jsxs("div",{className:`flex flex-col items-center justify-center p-8 text-center ${t}`,style:{color:"var(--t-text)"},children:[e.jsx("h3",{className:"text-[18px] font-semibold mb-2",children:s("checkout.expired")}),e.jsx("p",{className:"text-[14px] mb-6",style:{color:"var(--t-text-secondary)"},children:s("checkout.expiredDesc")}),e.jsx("button",{className:"w-full font-semibold text-[16px] transition-all",style:{height:60,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-cta-bg)",color:"var(--t-cta-text)"},onClick:u,children:s("checkout.startOver")})]});if(n.checkout.method==="iframe"){const j=n.checkout.url,N=((y=n.checkout.allowedFeatures)==null?void 0:y.join("; "))||"payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share";return sa.createPortal(e.jsxs("div",{style:{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",background:"#000"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",height:48,paddingLeft:8,paddingRight:16,background:"#111",flexShrink:0},children:e.jsxs("button",{onClick:u,style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"none",color:"#fff",fontSize:14,fontWeight:500,cursor:"pointer",padding:"8px 12px",borderRadius:6},children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),s("checkout.cancel")]})}),e.jsxs("div",{style:{flex:1,position:"relative",overflow:"hidden"},children:[!d&&e.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[e.jsx(fe,{size:32}),e.jsx("p",{style:{color:"#888",fontSize:14,marginTop:16},children:s("checkout.loading")})]}),e.jsx("iframe",{src:j,style:{display:d?"block":"none",width:"100%",height:"100%",border:"none"},allow:N,onLoad:()=>c(!0),title:s("checkout.iframeTitle")})]})]}),document.body)}if(n.checkout.method==="redirect")return e.jsx(wa,{gatewayName:n.gateway,checkoutUrl:n.checkout.url,onCancel:u,redirectCountdown:h});if(n.checkout.method==="widget"&&n.widgetConfig){const j=Qr(n.checkout.url,n.widgetConfig);return sa.createPortal(e.jsxs("div",{style:{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",background:"#000"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",height:48,paddingLeft:8,paddingRight:16,background:"#111",flexShrink:0},children:e.jsxs("button",{onClick:u,style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"none",color:"#fff",fontSize:14,fontWeight:500,cursor:"pointer",padding:"8px 12px",borderRadius:6},children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),s("checkout.cancel")]})}),e.jsxs("div",{style:{flex:1,position:"relative",overflow:"hidden"},children:[!d&&e.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[e.jsx(fe,{size:32}),e.jsx("p",{style:{color:"#888",fontSize:14,marginTop:16},children:s("checkout.loading")})]}),e.jsx("iframe",{src:j,style:{display:d?"block":"none",width:"100%",height:"100%",border:"none"},allow:"payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",onLoad:()=>c(!0),title:s("checkout.widgetTitle")})]})]}),document.body)}return e.jsxs("div",{className:`flex flex-col items-center justify-center p-8 ${t}`,style:{color:"var(--t-text)"},children:[e.jsx("p",{className:"text-[15px] mb-4",children:s("checkout.unknownMethod")}),e.jsx("button",{className:"font-semibold text-[14px] transition-all",style:{height:48,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-surface)",color:"var(--t-text)",paddingLeft:24,paddingRight:24},onClick:u,children:s("checkout.goBack")})]})}function Qr(t,a){const r=new URL("/en/partner/widget",t);for(const[n,o]of Object.entries(a))o!=null&&o!==""&&r.searchParams.set(n,String(o));return r.toString()}function Ra({className:t=""}){const{orderStatus:a,orderStatusLoading:r,goToStep:n}=Me(),o=U();i.useEffect(()=>{a&&(a.status==="completed"?n("complete"):["failed","cancelled","expired","refunded"].includes(a.status)&&n("error"))},[a==null?void 0:a.status,n]);const l=()=>{if(!a)return o("processing.default");switch(a.status){case"pending":return o("processing.pending");case"processing":return o("processing.active");default:return o("processing.generic")}};return e.jsxs("div",{className:`flex flex-col items-center justify-center px-8 py-12 text-center ${t}`,children:[e.jsx("div",{className:"mb-6",style:{animation:"processingPulse 1500ms ease-in-out infinite"},children:e.jsx(fe,{size:64})}),e.jsx("h2",{className:"text-[20px] font-semibold mb-3",style:{color:"var(--t-text)"},children:l()}),r&&e.jsx("p",{className:"text-[13px] mb-4",style:{color:"var(--t-text-muted)"},children:o("processing.checkingStatus")}),a&&e.jsxs("div",{className:"w-full mt-6 text-left",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius, 20px)",padding:16},children:[e.jsx(Ke,{label:o("processing.orderId"),value:a.orderId,mono:!0}),e.jsx(Ke,{label:o("processing.provider"),value:a.gateway}),e.jsx(Ke,{label:o("processing.amount"),value:`${a.fiatAmount} ${a.fiatCurrency}`}),e.jsx(Ke,{label:o("processing.receiving"),value:`${a.cryptoAmount||"..."} ${a.cryptoCurrency}`}),e.jsx(Ke,{label:o("processing.network"),value:a.network}),e.jsx(Ke,{label:o("processing.toAddress"),value:`${a.walletAddress.slice(0,10)}...${a.walletAddress.slice(-8)}`,mono:!0})]}),e.jsxs("div",{className:"mt-6",children:[e.jsx("p",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:o("processing.usuallyMinutes")}),e.jsx("p",{className:"text-[12px] mt-1",style:{color:"var(--t-text-muted)"},children:o("processing.safeToClose")})]})]})}function Ke({label:t,value:a,mono:r}){return e.jsxs("div",{className:"flex justify-between items-center py-2",style:{borderBottom:"1px solid var(--t-divider)"},children:[e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:t}),e.jsx("span",{className:`text-[13px] font-medium ${r?"font-mono":""}`,style:{color:"var(--t-text)"},children:a})]})}function Ea({className:t="",explorerUrl:a,onDone:r,doneButtonText:n}){const{orderStatus:o,state:l,dispatch:u}=Me(),s=U(),d=l.flowType==="sell",c=()=>{if(!(o!=null&&o.transactionHash))return null;if(!a){const f={ethereum:"https://etherscan.io/tx/{txHash}",polygon:"https://polygonscan.com/tx/{txHash}",arbitrum:"https://arbiscan.io/tx/{txHash}",optimism:"https://optimistic.etherscan.io/tx/{txHash}",base:"https://basescan.org/tx/{txHash}",bitcoin:"https://mempool.space/tx/{txHash}",solana:"https://solscan.io/tx/{txHash}",avalanche:"https://snowtrace.io/tx/{txHash}",fantom:"https://ftmscan.com/tx/{txHash}"};return(f[l.network]||f.ethereum).replace("{txHash}",o.transactionHash)}return a.replace("{txHash}",o.transactionHash)},h=()=>{r?r():u({type:"RESET"})},p=c();return e.jsxs("div",{className:`flex flex-col items-center px-8 py-12 text-center ${t}`,children:[e.jsx("div",{className:"flex items-center justify-center mb-5",style:{width:64,height:64,borderRadius:"50%",background:"var(--t-success, #10b981)"},children:e.jsx("svg",{viewBox:"0 0 24 24",width:"32",height:"32",fill:"none",stroke:"white",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M4.83 12 9 16.17 19.59 5.59",strokeDasharray:"24",strokeDashoffset:"0",style:{animation:"checkDraw 0.6s ease-out"}})})}),e.jsx("h2",{className:"text-[20px] font-semibold mb-2",style:{color:"var(--t-text)"},children:s(d?"complete.sellTitle":"complete.buyTitle")}),e.jsx("p",{className:"text-[14px] mb-6",style:{color:"var(--t-text-secondary)"},children:d?s("complete.sellDesc",{fiat:(o==null?void 0:o.fiatCurrency)||l.fiatCurrency}):s("complete.buyDesc",{crypto:(o==null?void 0:o.cryptoCurrency)||l.cryptoCurrency})}),o&&e.jsxs("div",{className:"w-full text-left mb-6",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius, 20px)",padding:16},children:[e.jsx(be,{label:s(d?"complete.amountSell":"complete.amountBuy"),value:`${o.cryptoAmount} ${o.cryptoCurrency}`,highlight:!0}),e.jsx(be,{label:s(d?"complete.paidSell":"complete.paidBuy"),value:`${o.fiatAmount} ${o.fiatCurrency}`}),e.jsx(be,{label:s("complete.network"),value:o.network}),e.jsx(be,{label:s("complete.wallet"),value:`${o.walletAddress.slice(0,10)}...${o.walletAddress.slice(-8)}`,mono:!0}),o.transactionHash&&e.jsx(be,{label:s("complete.transaction"),value:`${o.transactionHash.slice(0,10)}...${o.transactionHash.slice(-8)}`,mono:!0}),e.jsx(be,{label:s("complete.provider"),value:o.gateway}),e.jsx(be,{label:s("complete.orderId"),value:o.orderId,mono:!0}),o.completedAt&&e.jsx(be,{label:s("complete.completed"),value:new Date(o.completedAt).toLocaleString()})]}),e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[p&&e.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"w-full font-semibold text-[14px] flex items-center justify-center transition-all",style:{height:48,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-surface)",color:"var(--t-text)",textDecoration:"none"},children:s("complete.viewExplorer")}),e.jsx("button",{className:"w-full font-semibold text-[16px] transition-all",style:{height:60,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-cta-bg)",color:"var(--t-cta-text)"},onClick:h,children:n||s("complete.done")})]})]})}function be({label:t,value:a,mono:r,highlight:n}){return e.jsxs("div",{className:"flex justify-between items-center py-2",style:{borderBottom:"1px solid var(--t-divider)"},children:[e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:t}),e.jsx("span",{className:`text-[13px] font-medium ${r?"font-mono":""}`,style:{color:n?"var(--t-success, #10b981)":"var(--t-text)"},children:a})]})}function Aa({className:t="",onRetry:a,onDone:r,doneButtonText:n,supportEmail:o="support@nowramp.com"}){const{state:l,orderStatus:u,dispatch:s,goToStep:d}=Me(),c=U(),h=l.flowType==="sell",p=()=>{if(u)switch(u.status){case"failed":return c("errorStep.failed");case"cancelled":return c("errorStep.cancelled");case"expired":return c("errorStep.expired");case"refunded":return c("errorStep.refunded");default:return c("errorStep.unknown")}return c("errorStep.unknown")},f=()=>{if(l.errorMessage)return l.errorMessage;if(u)switch(u.status){case"failed":return c(h?"errorStep.failedSell":"errorStep.failedBuy");case"cancelled":return c(h?"errorStep.cancelledSell":"errorStep.cancelledBuy");case"expired":return c(h?"errorStep.expiredSell":"errorStep.expiredBuy");case"refunded":return c(h?"errorStep.refundedSell":"errorStep.refundedBuy");default:return c("errorStep.genericDesc")}return c("errorStep.genericDesc")},y=()=>{s({type:"CLEAR_ERROR"}),a?a():(s({type:"RESET"}),d("amount"))},j=()=>{s({type:"RESET"}),d("amount")};return e.jsxs("div",{className:`flex flex-col items-center px-8 py-12 text-center ${t}`,children:[e.jsx("div",{className:"flex items-center justify-center mb-5",style:{width:64,height:64,borderRadius:"50%",background:"var(--t-error, #EF4444)"},children:e.jsx("svg",{viewBox:"0 0 24 24",width:"32",height:"32",fill:"white",children:e.jsx("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"})})}),e.jsx("h2",{className:"text-[20px] font-semibold mb-2",style:{color:"var(--t-text)"},children:p()}),e.jsx("p",{className:"text-[14px] mb-6",style:{color:"var(--t-text-secondary)"},children:f()}),u&&e.jsx("div",{className:"w-full text-left mb-6",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius, 20px)",padding:16},children:e.jsxs("div",{className:"flex justify-between items-center py-2",children:[e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:c("errorStep.orderId")}),e.jsx("span",{className:"text-[13px] font-medium font-mono",style:{color:"var(--t-text)"},children:u.orderId})]})}),e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx("button",{className:"w-full font-semibold text-[16px] transition-all",style:{height:60,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-cta-bg)",color:"var(--t-cta-text)"},onClick:y,children:c("errorStep.tryAgain")}),e.jsx("button",{className:"w-full font-semibold text-[14px] transition-all",style:{height:48,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-surface)",color:"var(--t-text)"},onClick:j,children:c("errorStep.startOver")}),r&&e.jsx("button",{className:"w-full font-semibold text-[14px] transition-all mt-1",style:{height:48,borderRadius:"var(--t-cta-radius, 100px)",background:"transparent",color:"var(--t-text-secondary)",border:"1px solid var(--t-divider)"},onClick:r,"aria-label":n||c("errorStep.returnToMerchant"),children:n||c("errorStep.return")})]}),e.jsxs("div",{className:"mt-6",children:[e.jsxs("p",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:[c("errorStep.needHelp")," ",e.jsx("a",{href:`mailto:${o}`,className:"underline",style:{color:"var(--t-accent)"},children:o})]}),u&&e.jsx("p",{className:"text-[12px] mt-1",style:{color:"var(--t-text-muted)"},children:c("errorStep.reference",{orderId:u.orderId})})]})]})}const Ve={ethereum:{name:"Ethereum (ERC20)",shortName:"Ethereum",icon:"eth"},bitcoin:{name:"Bitcoin",icon:"btc"},solana:{name:"Solana",icon:"sol"},polygon:{name:"Polygon",icon:"pol"},arbitrum:{name:"Arbitrum",icon:"arb"},avalanche:{name:"Avalanche C-Chain",shortName:"Avalanche",icon:"avax"},litecoin:{name:"Litecoin",icon:"ltc"},tezos:{name:"Tezos",icon:"xtz"},sei:{name:"SEI",icon:"sei"},imx:{name:"Immutable X",shortName:"Immutable",icon:"imx"},galachain:{name:"Gala",icon:"gala"},zksync2:{name:"zkSync Era",shortName:"zkSync",icon:"zksync"},zks:{name:"zkSpace",icon:"zks"},"flow-evm":{name:"Flow (EVM)",shortName:"Flow",icon:"flow"},vara:{name:"Vara",icon:"vara"},venom:{name:"Venom",icon:"venom"},hsk:{name:"HashKey Chain",shortName:"HashKey",icon:"hsk"},mck:{name:"MCK",icon:"mck"},peer:{name:"Peer",icon:"peer"},goerli:{name:"Goerli Testnet",shortName:"Goerli",icon:"eth"},hbartestnet:{name:"Hedera Testnet",shortName:"Hedera",icon:"hbar"},arbitrumrinkeby:{name:"Arbitrum Testnet",shortName:"Arbitrum",icon:"arb"},dydxtestnet:{name:"dYdX Testnet",shortName:"dYdX",icon:"stark"},"zksync-rinkeby":{name:"zkSync Testnet",shortName:"zkSync",icon:"zksync"},ETH:{name:"Ethereum (ERC20)",shortName:"Ethereum",icon:"eth"},BSC:{name:"Binance Smart Chain (BEP20)",shortName:"Binance",icon:"bnb"},BTC:{name:"Bitcoin",icon:"btc"},SOL:{name:"Solana",icon:"sol"},MATIC:{name:"Polygon",icon:"pol"},ARB:{name:"Arbitrum",icon:"arb"},BASE:{name:"Base",icon:"base"},OPTIMISM:{name:"Optimism",icon:"op"},AVAX_C:{name:"Avalanche C-Chain",shortName:"Avalanche C",icon:"avax"},AVAX_X:{name:"Avalanche X-Chain",shortName:"Avalanche X",icon:"avax"},ADA:{name:"Cardano",icon:"ada"},DOT:{name:"Polkadot",icon:"dot"},TRON:{name:"Tron (TRC20)",shortName:"Tron",icon:"trx"},XRP:{name:"Ripple",icon:"xrp"},XLM:{name:"Stellar",icon:"xlm"},ALGO:{name:"Algorand",icon:"algo"},ATOM:{name:"Cosmos",icon:"atom"},NEAR:{name:"NEAR Protocol",shortName:"NEAR",icon:"near"},SUI:{name:"Sui",icon:"sui"},APT:{name:"Aptos",icon:"apt"},TON:{name:"Ton",icon:"ton"},FIL:{name:"Filecoin",icon:"fil"},FLOW:{name:"Flow",icon:"flow"},HBAR:{name:"Hedera Hashgraph",shortName:"Hedera",icon:"hbar"},INJ:{name:"Injective",icon:"inj"},SEI_EVM:{name:"SEI (EVM)",shortName:"SEI",icon:"sei"},ZKSYNC:{name:"zkSync",icon:"zksync"},LINEA:{name:"Linea",icon:"linea"},STARK:{name:"StarkNet",icon:"strk"},LN:{name:"Lightning",icon:"btc"},CELO:{name:"Celo",icon:"celo"},CRO:{name:"Cronos",icon:"cro"},FTM:{name:"Fantom",icon:"ftm"},GLMR:{name:"Moonbeam",icon:"glmr"},MOVR:{name:"Moonriver",icon:"movr"},KSM:{name:"Kusama",icon:"ksm"},EOS:{name:"EOS",icon:"eos"},ETC:{name:"Ethereum Classic",shortName:"ETH Classic",icon:"etc"},LTC:{name:"Litecoin",icon:"ltc"},BCH:{name:"Bitcoin Cash",shortName:"BTC Cash",icon:"bch"},DOGE:{name:"Dogecoin",icon:"doge"},BNB:{name:"Binance Chain (BEP2)",shortName:"Binance",icon:"bnb"},ONE:{name:"Harmony",icon:"one"},KLAY:{name:"Kaia",icon:"kaia"},RON:{name:"Ronin",icon:"ron"},LRC:{name:"Loopring",icon:"lrc"},ICP:{name:"Internet Computer",shortName:"ICP",icon:"icp"},EGLD:{name:"MultiversX",icon:"egld"},FLUX:{name:"Flux",icon:"flux"},KDA:{name:"Kadena",icon:"kda"},WAVES:{name:"Waves",icon:"waves"},XTZ:{name:"Tezos",icon:"xtz"},ACA:{name:"Acala",icon:"aca"},ALEO:{name:"Aleo",icon:"aleo"},ALPH:{name:"Alephium",icon:"alph"},APE:{name:"ApeChain",icon:"ape"},ASTR:{name:"Astar",icon:"astr"},AZERO:{name:"Aleph Zero",icon:"azero"},AZERO_EVM:{name:"Aleph Zero EVM",shortName:"Aleph Zero",icon:"azero"},BAJU:{name:"Bajun Network",shortName:"Bajun",icon:"baju"},BNCPOLKA:{name:"Bifrost Polkadot",shortName:"Bifrost",icon:"bnc"},BNC:{name:"Bifrost Kusama",shortName:"Bifrost",icon:"bnc"},BOBA:{name:"Boba Network",shortName:"Boba",icon:"boba"},BSX:{name:"Basilisk",icon:"bsx"},CHZ:{name:"Chiliz",icon:"chz"},VIC:{name:"Viction",icon:"vic"},CCD:{name:"Concordium",icon:"ccd"},COREUM:{name:"Coreum",icon:"coreum"},DINGO:{name:"Dingocoin",icon:"dingo"},HDX:{name:"Hydration",icon:"hdx"},PLMC:{name:"Polimec",icon:"plmc"},MNT:{name:"Mantle",icon:"mnt"},ERG:{name:"Ergo",icon:"erg"},ECLIPSE:{name:"Eclipse",icon:"eclipse"},FUEL:{name:"Fuel Ignition",shortName:"Fuel",icon:"fuel"},INK:{name:"Ink",icon:"ink"},SOPHON:{name:"Sophon",icon:"sophon"},UNICHAIN:{name:"Unichain",icon:"unichain"},WLD:{name:"Worldchain",icon:"wld"},ETHERLINK:{name:"Etherlink",icon:"etherlink"},MOB:{name:"MobileCoin",icon:"mob"},GALA:{name:"Gala",icon:"gala"},GUNZ:{name:"Gunz",icon:"gun"},HNT:{name:"Helium",icon:"hnt"},BITKUB:{name:"BitKub",icon:"kub"},IMMUTABLE_ZKEVM:{name:"Immutable-zkEVM",shortName:"Immutable",icon:"imx"},INIT:{name:"Initia",icon:"init"},INTR:{name:"Interlay",icon:"intr"},KINESIS:{name:"Kinesis",icon:"kag"},KAR:{name:"Karura",icon:"kar"},KCC:{name:"KuCoin Community Chain",shortName:"KuCoin",icon:"kcs"},KILT:{name:"KILT Spiritnet",shortName:"KILT",icon:"kilt"},KINT:{name:"Kintsugi",icon:"kint"},KMD:{name:"Komodo",icon:"kmd"},LSK:{name:"Lisk",icon:"lsk"},METIS:{name:"Metis Andromeda",shortName:"Metis",icon:"metis"},MYTH:{name:"Myth",icon:"myth"},OAS:{name:"Oasys",icon:"oas"},PEAQ_EVM:{name:"Peaq (EVM)",shortName:"Peaq",icon:"peaq"},PEN:{name:"Pendulum",icon:"pen"},PI:{name:"Pi",icon:"pi"},POLYX:{name:"Polymesh",icon:"polyx"},Q:{name:"QuantumCoin",icon:"q"},QRL:{name:"Quantum Resistant Ledger",shortName:"QRL",icon:"qrl"},QUBIC:{name:"Qubic",icon:"qubic"},RBX:{name:"ReserveBlock",icon:"rbx"},ROLLUX:{name:"Rollux",icon:"rollux"},THORCHAIN:{name:"Thorchain",icon:"rune"},S:{name:"Sonic",icon:"s"},SONIC:{name:"Sonic",icon:"s"},TERNOA:{name:"Ternoa",icon:"caps"},SX:{name:"SX Network",icon:"sol"},WAX:{name:"WAX",icon:"waxp"},XCH:{name:"Chia Chain",icon:"xch"},XPRT:{name:"Persistence",icon:"xprt"},ZETACHAIN:{name:"ZetaChain",icon:"zeta"},ZTG:{name:"Zeitgeist",icon:"ztg"},PLS:{name:"Pulsechain",icon:"pulsechain"},MEZO:{name:"Mezo",icon:"mezo"},BSV:{name:"Bitcoin SV",shortName:"BTC SV",icon:"btc"},MONAD:{name:"Monad",icon:"mon"},SUPRA:{name:"Supra",icon:"supra"},SOMI:{name:"Somnia",icon:"somi"},VERIFIEDX:{name:"VerifiedX",icon:"vfx"},MOVE:{name:"Movement",icon:"move"},FLR:{name:"Flare",icon:"flr"},ASSETHUB:{name:"Asset Hub Polkadot",shortName:"Asset Hub",icon:"dot"},BOB:{name:"BOB",icon:"btc"},GLUE:{name:"Glue",icon:"eth"},DYDX:{name:"StarkEx",icon:"stark"},OKC:{name:"OKX Chain",icon:"eth"},UNI_CHAIN:{name:"UNI",icon:"uni"},ZEC:{name:"ZCash",icon:"zec"}},Ht=[{code:"BTC",name:"Bitcoin",chains:["BTC","LN"],popular:!0},{code:"ETH",name:"Ethereum",chains:["ETH","ARB","BASE","BSC","OPTIMISM","LINEA","ZKSYNC","LRC","STARK","APE","ECLIPSE","FUEL","INK","SOPHON","UNICHAIN","WLD"],popular:!0},{code:"USDC",name:"USD Coin",chains:["ETH","SOL","ARB","BASE","BSC","MATIC","OPTIMISM","AVAX_C","ALGO","APT","CELO","FLOW","HBAR","LINEA","LRC","ZKSYNC","STARK","SUI","XLM","ECLIPSE","HDX","INK","LSK","METIS","MONAD","SEI_EVM","SONIC","SOPHON","SX","UNICHAIN","APE","BNCPOLKA","GLMR","PEAQ_EVM","PLMC","RON","UNI_CHAIN","WLD","BITKUB","BOB","DYDX","ETHERLINK","GLUE","ASSETHUB"],popular:!0},{code:"USDT",name:"Tether",chains:["ETH","BSC","TRON","ARB","MATIC","AVAX_C","SOL","OPTIMISM","ZKSYNC","STARK","APT","CELO","KLAY","LRC","LSK","ECLIPSE","ETHERLINK","OKC","PEAQ_EVM","BNCPOLKA","GLMR","HDX","PLMC","VIC","ASSETHUB"],popular:!0},{code:"SOL",name:"Solana",chains:["SOL"],popular:!0},{code:"XRP",name:"Ripple",chains:["XRP"],popular:!0},{code:"ADA",name:"Cardano",chains:["ADA"],popular:!0},{code:"DOGE",name:"Dogecoin",chains:["DOGE"],popular:!0},{code:"DOT",name:"Polkadot",chains:["DOT","BSC","BNCPOLKA","GLMR","HDX","PLMC"],popular:!0},{code:"AVAX",name:"Avalanche",chains:["AVAX_C","AVAX_X","BSC"],popular:!0},{code:"LINK",name:"ChainLink",chains:["ETH","BSC"],popular:!0},{code:"LTC",name:"Litecoin",chains:["LTC"],popular:!0},{code:"AAVE",name:"Aave",chains:["ETH","BSC"],popular:!1},{code:"ACA",name:"Acala",chains:["ACA"],popular:!1},{code:"ALEO",name:"Aleo",chains:["ALEO"],popular:!1},{code:"ALGO",name:"Algorand",chains:["ALGO"],popular:!1},{code:"ALPH",name:"Alephium",chains:["ALPH"],popular:!1},{code:"APE",name:"ApeCoin",chains:["APE","ETH"],popular:!1},{code:"APT",name:"Aptos",chains:["APT"],popular:!1},{code:"ARB",name:"Arbitrum",chains:["ARB"],popular:!1},{code:"ASTR",name:"Astar",chains:["ASTR"],popular:!1},{code:"ATOM",name:"Cosmos",chains:["ATOM"],popular:!1},{code:"AUDD",name:"Novatti Australian Digital Dollar",chains:["ETH"],popular:!1},{code:"AVT",name:"Aventus",chains:["ETH"],popular:!1},{code:"AXS",name:"Axie Infinity",chains:["ETH","RON"],popular:!1},{code:"AZERO",name:"Aleph Zero",chains:["AZERO","AZERO_EVM"],popular:!1},{code:"BAJU",name:"Bajun Network",chains:["BAJU"],popular:!1},{code:"BARSIK",name:"Hasbulla's Cat",chains:["SOL"],popular:!1},{code:"BAT",name:"Basic Attention Token",chains:["ETH","BSC"],popular:!1},{code:"BCH",name:"Bitcoin Cash",chains:["BCH"],popular:!1},{code:"BNB",name:"Binance Coin",chains:["BNB","BSC"],popular:!1},{code:"BNC",name:"Bifrost Native Coin",chains:["BNC","BNCPOLKA"],popular:!1},{code:"BOBA",name:"Boba Network",chains:["BOBA","ETH"],popular:!1},{code:"BORA",name:"Bora",chains:["KLAY"],popular:!1},{code:"BRETT",name:"Brett",chains:["BASE"],popular:!1},{code:"BSX",name:"Basilisk",chains:["BSX"],popular:!1},{code:"BZR",name:"Bazaars",chains:["ETH"],popular:!1},{code:"CAGA",name:"Crypto Asset Governance Alliance",chains:["ETH"],popular:!1},{code:"CAKE",name:"PancakeSwap",chains:["BSC"],popular:!1},{code:"CAPS",name:"Caps",chains:["TERNOA"],popular:!1},{code:"CELO",name:"Celo",chains:["CELO"],popular:!1},{code:"CHZ",name:"Chiliz",chains:["CHZ","BNB","ETH"],popular:!1},{code:"C98",name:"Coin98",chains:["VIC"],popular:!1},{code:"CCD",name:"Concordium",chains:["CCD"],popular:!1},{code:"COMP",name:"Compound",chains:["ETH","BSC"],popular:!1},{code:"COREUM",name:"Coreum",chains:["COREUM","XRP"],popular:!1},{code:"CRO",name:"Cronos",chains:["CRO"],popular:!1},{code:"CUSD",name:"Celo Dollar",chains:["CELO"],popular:!1},{code:"CVC",name:"Civic",chains:["ETH"],popular:!1},{code:"DAI",name:"Dai",chains:["ETH","BASE","MATIC"],popular:!1},{code:"DINGO",name:"Dingocoin",chains:["DINGO"],popular:!1},{code:"EGLD",name:"MultiversX",chains:["EGLD"],popular:!1},{code:"EMBER",name:"Ember Sword",chains:["MNT"],popular:!1},{code:"EOS",name:"EOS",chains:["EOS"],popular:!1},{code:"ERG",name:"Ergo",chains:["ERG"],popular:!1},{code:"ETC",name:"Ethereum Classic",chains:["ETC","BSC"],popular:!1},{code:"EUR",name:"EURC",chains:["BASE"],popular:!1},{code:"EUROC",name:"Euro Coin",chains:["ETH"],popular:!1},{code:"EURQ",name:"Quantoz EURQ",chains:["ETH"],popular:!1},{code:"EURR",name:"StablR EUR",chains:["ETH"],popular:!1},{code:"EUSD",name:"Electronic USD",chains:["MOB"],popular:!1},{code:"EXIT",name:"EXIT - Designer Token",chains:["BSC"],popular:!1},{code:"FDUSD",name:"First Digital USD",chains:["SUI"],popular:!1},{code:"FIL",name:"Filecoin",chains:["FIL","BSC"],popular:!1},{code:"FLOW",name:"Flow",chains:["FLOW"],popular:!1},{code:"FLR",name:"Flare",chains:["FLR"],popular:!1},{code:"FLUX",name:"Flux",chains:["FLUX"],popular:!1},{code:"FTM",name:"Fantom",chains:["FTM","ETH","BSC"],popular:!1},{code:"GALA",name:"Gala",chains:["GALA"],popular:!1},{code:"GLMR",name:"Moonbeam",chains:["GLMR"],popular:!1},{code:"GMX",name:"GMX",chains:["ARB"],popular:!1},{code:"GNUS",name:"Genius AI",chains:["ETH"],popular:!1},{code:"GRT",name:"The Graph",chains:["ETH","ARB"],popular:!1},{code:"GUN",name:"Gunz",chains:["GUNZ"],popular:!1},{code:"HBAR",name:"Hedera",chains:["HBAR"],popular:!1},{code:"HDX",name:"HydraDX",chains:["HDX"],popular:!1},{code:"HNT",name:"Helium",chains:["HNT"],popular:!1},{code:"HTP",name:"HowToPay",chains:["BSC"],popular:!1},{code:"HVLO",name:"Hivello",chains:["SOL"],popular:!1},{code:"ICP",name:"Internet Computer",chains:["ICP"],popular:!1},{code:"IMX",name:"Immutable X",chains:["ETH"],popular:!1},{code:"INIT",name:"Initia",chains:["INIT"],popular:!1},{code:"INJ",name:"Injective",chains:["INJ"],popular:!1},{code:"INTR",name:"Interlay",chains:["INTR"],popular:!1},{code:"JAM",name:"Jam Tune.FM",chains:["HBAR"],popular:!1},{code:"KAG",name:"Silver",chains:["KINESIS"],popular:!1},{code:"KAIA",name:"Kaia",chains:["KLAY"],popular:!1},{code:"KAR",name:"Karura",chains:["KAR"],popular:!1},{code:"KAU",name:"Gold",chains:["KINESIS"],popular:!1},{code:"KCS",name:"KuCoin Token",chains:["ETH","KCC"],popular:!1},{code:"KDA",name:"Kadena",chains:["KDA"],popular:!1},{code:"KILT",name:"KILT",chains:["KILT"],popular:!1},{code:"KINT",name:"Kintsugi",chains:["KINT"],popular:!1},{code:"KLV",name:"Klever",chains:["TRON"],popular:!1},{code:"KMD",name:"Komodo",chains:["KMD"],popular:!1},{code:"KSM",name:"Kusama",chains:["KSM"],popular:!1},{code:"KUB",name:"Bitkub Coin",chains:["BITKUB"],popular:!1},{code:"LOOKS",name:"LooksRare",chains:["ETH"],popular:!1},{code:"LRC",name:"Loopring",chains:["ETH","LRC"],popular:!1},{code:"LSK",name:"Lisk",chains:["LSK"],popular:!1},{code:"MANA",name:"Decentraland",chains:["ETH"],popular:!1},{code:"MBX",name:"Marblex",chains:["IMMUTABLE_ZKEVM","KLAY"],popular:!1},{code:"MELANIA",name:"Melania",chains:["SOL"],popular:!1},{code:"METAMASKUSD",name:"Metamask USD",chains:["ETH","LINEA"],popular:!1},{code:"METIS",name:"Metis",chains:["METIS"],popular:!1},{code:"MEZOUSD",name:"MUSD",chains:["ETH","MEZO"],popular:!1},{code:"MKR",name:"Maker",chains:["ETH","BSC"],popular:!1},{code:"MNEE",name:"MNEE",chains:["BSV","ETH"],popular:!1},{code:"MNT",name:"Mantle",chains:["ETH","MNT"],popular:!1},{code:"MOB",name:"MobileCoin",chains:["MOB"],popular:!1},{code:"MON",name:"Monad",chains:["MONAD"],popular:!1},{code:"MOVE",name:"Movement",chains:["MOVE"],popular:!1},{code:"MOVR",name:"Moonriver",chains:["MOVR"],popular:!1},{code:"MYTH",name:"Myth",chains:["MYTH"],popular:!1},{code:"NEAR",name:"NEAR Protocol",chains:["NEAR","BSC"],popular:!1},{code:"NEIRO",name:"NEIRO Ethereum",chains:["ETH"],popular:!1},{code:"OAS",name:"Oasys",chains:["OAS"],popular:!1},{code:"OMG",name:"OmiseGo",chains:["ETH"],popular:!1},{code:"OMUSD",name:"Open Money USD",chains:["ETH"],popular:!1},{code:"ONE",name:"Harmony",chains:["ONE","BNB","ETH"],popular:!1},{code:"OP",name:"Optimism",chains:["OPTIMISM"],popular:!1},{code:"ORDER",name:"Orderly Network",chains:["ETH"],popular:!1},{code:"PEAQ",name:"Peaq",chains:["PEAQ_EVM"],popular:!1},{code:"PEN",name:"Pendulum",chains:["PEN"],popular:!1},{code:"PERC",name:"Perion",chains:["ETH"],popular:!1},{code:"PI",name:"Pi",chains:["PI"],popular:!1},{code:"PLMC",name:"Polimec",chains:["PLMC"],popular:!1},{code:"POL",name:"Polygon",chains:["ETH","MATIC"],popular:!1},{code:"POLYX",name:"Polymesh",chains:["POLYX"],popular:!1},{code:"PROPC",name:"Propchain",chains:["ETH"],popular:!1},{code:"PSTAKE",name:"pSTAKE Finance",chains:["ETH"],popular:!1},{code:"Q",name:"QuantumCoin",chains:["Q"],popular:!1},{code:"QRDO",name:"Qredo",chains:["ETH"],popular:!1},{code:"QRL",name:"Quantum Resistant Ledger",chains:["QRL"],popular:!1},{code:"QUBIC",name:"QUBIC",chains:["QUBIC"],popular:!1},{code:"RBX",name:"ReserveBlock",chains:["RBX"],popular:!1},{code:"REVU",name:"Revuto",chains:["ADA"],popular:!1},{code:"RITE",name:"Ritestream",chains:["BSC"],popular:!1},{code:"RLUSD",name:"Ripple USD",chains:["ETH"],popular:!1},{code:"RON",name:"Ronin",chains:["RON"],popular:!1},{code:"RUNE",name:"THORChain",chains:["THORCHAIN"],popular:!1},{code:"S",name:"Sonic",chains:["S"],popular:!1},{code:"SAND",name:"The Sandbox",chains:["ETH","BSC"],popular:!1},{code:"SEI",name:"SEI",chains:["SEI_EVM"],popular:!1},{code:"SNX",name:"Synthetix",chains:["ETH"],popular:!1},{code:"SOIL",name:"Sun Minimeal",chains:["PLS"],popular:!1},{code:"SOLO",name:"Sologenic",chains:["XRP"],popular:!1},{code:"SOMI",name:"Somnia",chains:["SOMI"],popular:!1},{code:"STRK",name:"Starknet",chains:["STARK"],popular:!1},{code:"SUI",name:"Sui",chains:["SUI"],popular:!1},{code:"SUPR",name:"SuperDapp",chains:["ROLLUX"],popular:!1},{code:"SUPRA",name:"Supra",chains:["SUPRA"],popular:!1},{code:"SUSHI",name:"SushiSwap",chains:["ETH","BSC"],popular:!1},{code:"SYS",name:"Syscoin",chains:["ROLLUX"],popular:!1},{code:"TBTC",name:"tBTC",chains:["SUI","STARK"],popular:!1},{code:"TON",name:"Toncoin",chains:["TON"],popular:!1},{code:"TRUMP",name:"TRUMP",chains:["SOL"],popular:!1},{code:"TRX",name:"Tron",chains:["TRON","BSC"],popular:!1},{code:"TWT",name:"Trust Wallet Token",chains:["BSC"],popular:!1},{code:"UNI",name:"Uniswap",chains:["ETH","BSC"],popular:!1},{code:"URANIUM",name:"Uranium",chains:["ETHERLINK"],popular:!1},{code:"USD0",name:"Usual USD",chains:["ETH"],popular:!1},{code:"USD1",name:"World Liberty Financial USD",chains:["SOL"],popular:!1},{code:"USDE",name:"Ethena USDe",chains:["ETH"],popular:!1},{code:"USDP",name:"Pax Dollar",chains:["ETH"],popular:!1},{code:"USDQ",name:"Quantoz USDQ",chains:["ETH"],popular:!1},{code:"USDR",name:"StablR USD",chains:["ETH"],popular:!1},{code:"USDT0",name:"USDT0",chains:["INK"],popular:!1},{code:"VFX",name:"VerifiedX",chains:["VERIFIEDX"],popular:!1},{code:"VERSE",name:"Verse",chains:["ETH","MATIC"],popular:!1},{code:"VIC",name:"Viction",chains:["VIC"],popular:!1},{code:"WAL",name:"Walrus",chains:["SUI"],popular:!1},{code:"WAVES",name:"Waves",chains:["WAVES"],popular:!1},{code:"WAXP",name:"WAX",chains:["WAX"],popular:!1},{code:"WBTC",name:"Wrapped Bitcoin",chains:["ETH","STARK"],popular:!1},{code:"WETH",name:"Wrapped Ether",chains:["ETHERLINK"],popular:!1},{code:"WLD",name:"Worldcoin",chains:["WLD"],popular:!1},{code:"WLFI",name:"World Liberty Financial",chains:["ETH"],popular:!1},{code:"WOLF",name:"LandWolf",chains:["ETH"],popular:!1},{code:"WOMBAT",name:"Wombat",chains:["MATIC"],popular:!1},{code:"XCH",name:"Chia",chains:["XCH"],popular:!1},{code:"XLM",name:"Stellar Lumens",chains:["XLM","BSC"],popular:!1},{code:"XPRT",name:"Persistence",chains:["XPRT"],popular:!1},{code:"XTZ",name:"Tezos",chains:["XTZ","ETHERLINK"],popular:!1},{code:"YFI",name:"yearn.finance",chains:["ETH"],popular:!1},{code:"ZBU",name:"Zeebu",chains:["BSC"],popular:!1},{code:"ZEC",name:"ZCash",chains:["ZEC"],popular:!1},{code:"ZCHF",name:"Frankencoin",chains:["ETH"],popular:!1},{code:"ZETA",name:"Zeta",chains:["ETH","ZETACHAIN"],popular:!1},{code:"ZTG",name:"Zeitgeist",chains:["ZTG"],popular:!1}],zr=Object.fromEntries(Ht.map(t=>[t.code,t.name])),Ta={AED:"ae",ALL:"al",ARS:"ar",AUD:"au",BRL:"br",CAD:"ca",CHF:"ch",CLP:"cl",CZK:"cz",DKK:"dk",EUR:"eu",GBP:"gb",HKD:"hk",IDR:"id",INR:"in",JPY:"jp",KRW:"kr",MXN:"mx",NGN:"ng",NOK:"no",NZD:"nz",PHP:"ph",PLN:"pl",QAR:"qa",SAR:"sa",SEK:"se",SGD:"sg",THB:"th",TRY:"tr",TWD:"tw",USD:"us",VND:"vn",ZAR:"za"};function Ot(t,a=""){return`${a}/crypto-icons/${t.toLowerCase()}.svg`}function Fa(t,a=""){const r=Ta[t]||"us";return`${a}/flags/${r}.svg`}function dt(t){return Ve[t]||Ve[t.toLowerCase()]||Ve[t.toUpperCase()]||Ve[t.toUpperCase().replace(/-/g,"_")]||Ve[t.toLowerCase().replace(/-/g,"_")]}function La(t,a=""){return`${a}/provider-icons/${t.toLowerCase()}.svg`}function ut(t,a=""){const r=dt(t);return r?`${a}/crypto-icons/${r.icon}.svg`:`${a}/crypto-icons/${t.toLowerCase()}.svg`}const Ut=[{code:"ALL",name:"Albania Lek"},{code:"ARS",name:"Argentina Peso"},{code:"AUD",name:"Australian Dollar"},{code:"BRL",name:"Brazilian Real"},{code:"CAD",name:"Canadian Dollar"},{code:"EUR",name:"Euro"},{code:"GBP",name:"British Pound"},{code:"JPY",name:"Japanese Yen"},{code:"USD",name:"US Dollar"},{code:"CHF",name:"Swiss Franc"},{code:"MXN",name:"Mexican Peso"},{code:"INR",name:"Indian Rupee"}],Dt=[{id:"blue",name:"Blue",accent:"#0077FF"},{id:"violet",name:"Violet",accent:"#7C3AED"},{id:"green",name:"Green",accent:"#10B981"},{id:"orange",name:"Orange",accent:"#F59E0B"},{id:"rose",name:"Rose",accent:"#F43F5E"},{id:"mono",name:"Mono",accent:null}],Bt={USDC:{USD:.9962,EUR:1.0814,GBP:1.2573,JPY:.00667,CAD:.7198,AUD:.6384,BRL:.1726,CHF:1.1306,MXN:.0487,INR:.01187,ARS:855e-6,ALL:.01058},USDT:{USD:.9958,EUR:1.081,GBP:1.2568,JPY:.00666,CAD:.7194,AUD:.638,BRL:.1724,CHF:1.1301,MXN:.0486,INR:.01186,ARS:854e-6,ALL:.01057},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},ETH:{USD:316e-6,EUR:343e-6,GBP:399e-6,JPY:211e-8,CAD:228e-6,AUD:202e-6,BRL:547e-7,CHF:358e-6,MXN:154e-7,INR:376e-8,ARS:271e-9,ALL:335e-8},SOL:{USD:.00424,EUR:.004607,GBP:.005356,JPY:284e-7,CAD:.003063,AUD:.002716,BRL:734e-6,CHF:.004812,MXN:207e-6,INR:505e-7,ARS:364e-8,ALL:45e-6},XRP:{USD:.4081,EUR:.4432,GBP:.5153,JPY:.00273,CAD:.2948,AUD:.2614,BRL:.0707,CHF:.463,MXN:.01992,INR:.00486,ARS:35e-5,ALL:.00433},DOGE:{USD:3.896,EUR:4.232,GBP:4.92,JPY:.02607,CAD:2.815,AUD:2.496,BRL:.675,CHF:4.421,MXN:.1902,INR:.04641,ARS:.003345,ALL:.04134},ADA:{USD:1.333,EUR:1.448,GBP:1.683,JPY:.00892,CAD:.963,AUD:.854,BRL:.2309,CHF:1.512,MXN:.0651,INR:.01588,ARS:.001145,ALL:.01414}},Jr=new Set(["USDC","USDT","DAI","BUSD","TUSD","FDUSD","PYUSD","USDP","USDE","USDQ","USDR","USDT0","RLUSD","CUSD","EUSD","OMUSD","MEZOUSD","METAMASKUSD","USD0","USD1","AUDD","EUROC","EURQ","EURR","ZCHF"]);function _t(t){return Jr.has(t.toUpperCase())}function qr(t,a){var r,n;return((r=Bt[t])==null?void 0:r[a])??((n=Bt.USDC)==null?void 0:n[a])??1}function Ia(t){return parseFloat(t.replace(/,/g,""))||0}function mt(t){if(t===0)return"0";if(t>=1e3)return t.toLocaleString("en-US",{maximumFractionDigits:2});if(t>=1)return t.toFixed(2);if(t>=.01)return t.toFixed(4);const a=t.toPrecision(4);return parseFloat(a).toString()}const he=t=>/^#([0-9A-Fa-f]{3}){1,2}$/.test(t),ca=10,da=1e-4,Ma=(()=>{const t=[];for(const a of Ht)for(const r of a.chains)t.push({code:a.code,name:a.name,chain:r,popular:a.popular});return t})();function ua(t){return t.length<=12?t:`${t.slice(0,6)}...${t.slice(-6)}`}function Ua({className:t="",stablecoinParity:a,partnerName:r}){var Z;const{config:n,configLoading:o,state:l,defaultGateway:u,quotes:s,fetchQuotes:d,createOrder:c,orderLoading:h}=Me(),p=U(),f=l.flowType==="sell",[y,j]=i.useState(null),N=n==null?void 0:n.gateways.find(Y=>Y.id===u),x=(Z=s==null?void 0:s.bestQuote)!=null&&Z.exchangeRate?parseFloat(s.bestQuote.exchangeRate):null,k=parseFloat(l.fiatAmount)||0,D=!!(a&&r&&!f&&_t(l.cryptoCurrency)&&x),G=D&&l.cryptoCurrency.toUpperCase().includes(l.fiatCurrency.toUpperCase()),$=D&&k>0?mt(G?k:k/x):null,ee=async()=>{j(null);try{d(),await c()}catch(Y){const ge=Y instanceof Error?Y.message:p("error.createOrderFailed");j(ge)}};return o?e.jsxs("div",{className:`flex flex-col items-center justify-center p-12 ${t}`,children:[e.jsx(fe,{size:32}),e.jsx("p",{className:"text-[14px] mt-4",style:{color:"var(--t-text-secondary)"},children:p("confirm.loading")})]}):e.jsxs("div",{className:`flex flex-col items-center px-8 py-12 ${t}`,children:[e.jsx("h2",{className:"text-[20px] font-semibold mb-6",style:{color:"var(--t-text)"},children:p(f?"confirm.sellTitle":"confirm.buyTitle")}),e.jsxs("div",{className:"w-full text-left mb-6",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius, 20px)",padding:16},children:[N&&e.jsxs("div",{className:"flex justify-between items-center py-2",style:{borderBottom:"1px solid var(--t-divider)"},children:[e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:p("confirm.provider")}),e.jsxs("span",{className:"flex items-center gap-2",children:[N.logo&&e.jsx("img",{src:N.logo,alt:N.name,width:20,height:20,style:{borderRadius:4}}),e.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--t-text)"},children:N.name})]})]}),f?e.jsxs(e.Fragment,{children:[e.jsx(Le,{label:p("confirm.youSell"),value:`${l.cryptoAmount} ${l.cryptoCurrency}`,highlight:!0}),e.jsx(Le,{label:p("confirm.youReceive"),value:p("confirm.payout",{currency:l.fiatCurrency})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Le,{label:p("confirm.youPay"),value:`${l.fiatAmount} ${l.fiatCurrency}`,highlight:!0}),e.jsx(Le,{label:p("confirm.youReceive"),value:$?`${$} ${l.cryptoCurrency}`:p("confirm.cryptoOnNetwork",{crypto:l.cryptoCurrency,network:l.network})}),e.jsx(Le,{label:p("confirm.wallet"),value:ua(l.walletAddress),mono:!0}),D&&$&&e.jsx("div",{className:"py-2 text-[11px]",style:{color:"var(--t-text-muted)",lineHeight:"15px"},children:p("confirm.parityNote",{amount:$,crypto:l.cryptoCurrency,partner:r})})]}),e.jsx(Le,{label:p("confirm.network"),value:l.network}),f&&l.walletAddress&&e.jsx(Le,{label:p("confirm.refundAddress"),value:ua(l.walletAddress),mono:!0})]}),y&&e.jsx("p",{className:"text-[12px] mb-4",style:{color:"#EF4444"},children:y}),e.jsx("button",{className:"w-full font-semibold text-[16px] transition-all flex items-center justify-center gap-2",style:{height:60,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-cta-bg)",color:"var(--t-cta-text)",opacity:h?.7:1},disabled:h,onClick:ee,children:h?e.jsxs(e.Fragment,{children:[e.jsx(fe,{size:18}),p("confirm.processing")]}):p(f?"confirm.confirmSell":"confirm.confirmPay")})]})}function Le({label:t,value:a,mono:r,highlight:n}){return e.jsxs("div",{className:"flex justify-between items-center py-2",style:{borderBottom:"1px solid var(--t-divider)"},children:[e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:t}),e.jsx("span",{className:`text-[13px] font-medium ${r?"font-mono":""}`,style:{color:n?"var(--t-success, #10b981)":"var(--t-text)"},children:a})]})}function Se({isOpen:t,onClose:a,children:r,variant:n="bottom"}){const[o,l]=i.useState(!1),[u,s]=i.useState(!1);i.useEffect(()=>{if(t)l(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>s(!0)));else if(o){s(!1);const p=setTimeout(()=>l(!1),250);return()=>clearTimeout(p)}},[t]);const d=i.useCallback(()=>{s(!1),setTimeout(()=>a(),250)},[a]);if(i.useEffect(()=>{if(!t)return;const p=f=>{f.key==="Escape"&&d()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[t,d]),!o)return null;const c=n==="right"?"translateX(100%)":"translateY(24px)";return e.jsx("div",{className:"absolute inset-0 z-20 transition-opacity duration-250",style:{opacity:u?1:0,backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},children:e.jsx("div",{className:"absolute inset-0 flex flex-col transition-transform duration-250 ease-out",style:{background:"var(--t-modal-bg)",borderRadius:"var(--t-container-radius)",transform:u?"translate(0)":c},children:typeof r=="function"?r(d):r})})}function V({w:t,h:a,className:r=""}){return e.jsx("div",{className:`skeleton ${r}`,style:{width:t,height:a}})}function Da(){const t=U();return e.jsxs("div",{className:"flex-1 px-5 flex flex-col",children:[e.jsxs("div",{className:"px-[18px] pt-[14px] pb-[18px]",style:{background:"var(--t-surface)",borderRadius:5},children:[e.jsx(V,{w:70,h:14,className:"mb-3"}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(V,{w:120,h:32}),e.jsx(V,{w:75,h:32})]})]}),e.jsxs("div",{className:"px-[18px] pt-[12px] pb-[18px]",style:{background:"var(--t-surface)",borderRadius:5,marginTop:4},children:[e.jsx(V,{w:50,h:14,className:"mb-3"}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(V,{w:180,h:32}),e.jsx(V,{w:85,h:32})]})]}),e.jsxs("div",{className:"flex justify-between mt-3 px-[2px]",children:[e.jsx(V,{w:140,h:12}),e.jsx(V,{w:90,h:12})]}),e.jsxs("div",{className:"mt-8",children:[e.jsx(V,{w:65,h:14,className:"mb-2.5"}),e.jsx(V,{w:"100%",h:47})]}),e.jsx("div",{className:"flex-1"}),e.jsx(V,{w:"100%",h:60,className:"mb-2"}),e.jsx("div",{className:"text-center py-3",children:e.jsx("span",{className:"text-[11px]",style:{color:"var(--t-text-tertiary)"},children:t("skeleton.poweredBy")})})]})}function Ba({src:t,alt:a,size:r,className:n="",background:o}){const[l,u]=i.useState(!1),[s,d]=i.useState(!1),c=i.useRef(t);c.current!==t&&(c.current=t,u(!1),d(!1));const h=i.useCallback(()=>u(!0),[]),p=i.useCallback(()=>d(!0),[]);return e.jsxs("div",{className:`relative rounded-full shrink-0 ${n}`,style:{width:r,height:r,background:o},children:[!l&&!s&&e.jsx("div",{className:"absolute inset-0 rounded-full animate-pulse",style:{background:"var(--t-pill-bg, #333)"}}),s?e.jsx("div",{className:"absolute inset-0 rounded-full flex items-center justify-center font-bold",style:{background:"var(--t-pill-bg, #333)",color:"var(--t-text-muted)",fontSize:Math.max(8,r*.35)},children:a.slice(0,3)}):e.jsx("img",{src:t,alt:a,width:r,height:r,onLoad:h,onError:p,className:`rounded-full ${l?"opacity-100":"opacity-0"}`,style:{width:r,height:r,transition:"opacity 0.15s ease-in"}})]})}function Kt({ticker:t,size:a=32,baseUrl:r=""}){return e.jsx(Ba,{src:Ot(t,r),alt:t,size:a,background:"#ffffff"})}function vt({currencyCode:t,size:a=16,baseUrl:r=""}){return e.jsx(Ba,{src:Fa(t,r),alt:t,size:a})}function Vt({size:t=32,color:a="#888"}){return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 32 32",fill:"none",children:[e.jsx("circle",{cx:"16",cy:"16",r:"16",fill:a}),e.jsx("circle",{cx:"16",cy:"16",r:"8",stroke:"white",strokeWidth:"1.5",fill:"none"})]})}function en({size:t=24}){return e.jsx("div",{className:"rounded-full flex items-center justify-center shrink-0",style:{width:t,height:t,background:"var(--t-card-icon-bg)"},children:e.jsxs("svg",{width:t*.6,height:t*.58,viewBox:"0 0 25 24",fill:"none",children:[e.jsx("path",{d:"M23.292 7.5H1.70801L12.5 0.592773L23.292 7.5Z",stroke:"var(--t-card-icon-stroke)",strokeWidth:"1"}),e.jsx("rect",{x:"3",y:"10",width:"1.5",height:"11",fill:"var(--t-card-icon-stroke)"}),e.jsx("rect",{x:"9",y:"10",width:"1.5",height:"11",fill:"var(--t-card-icon-stroke)"}),e.jsx("rect",{x:"15",y:"10",width:"1.5",height:"11",fill:"var(--t-card-icon-stroke)"}),e.jsx("rect",{x:"21",y:"10",width:"1.5",height:"11",fill:"var(--t-card-icon-stroke)"}),e.jsx("rect",{y:"23",width:"25",height:"1",fill:"var(--t-card-icon-stroke)"})]})})}function Pa({size:t=32}){return e.jsx("div",{className:"rounded-full flex items-center justify-center text-white font-semibold shrink-0",style:{width:t,height:t,backgroundColor:"#333",fontSize:t*.45},children:"R"})}function tn({size:t=32}){return e.jsx("div",{className:"flex items-center justify-center shrink-0",style:{width:t,height:t,background:"#000",borderRadius:t*.2},children:e.jsx("svg",{width:t*.72,height:t*.288,viewBox:"0 0 50 20",fill:"none",children:e.jsx("path",{d:"M9.14529 2.57901C8.55528 3.25398 7.61984 3.7887 6.68351 3.70976C6.56186 2.7971 7.02999 1.82591 7.55883 1.23105C8.14846 0.535892 9.166 0.0403839 9.9999 0C10.1017 0.952461 9.71518 1.88488 9.14529 2.57901ZM9.98932 3.88805C10.5171 3.92756 12.0384 4.08587 13.0125 5.48951C12.9312 5.54899 11.2066 6.51813 11.2267 8.55562C11.247 10.9883 13.4176 11.7995 13.4379 11.8193C13.4176 11.8787 13.0939 12.9667 12.3023 14.0939C11.6126 15.083 10.902 16.052 9.76606 16.0717C8.67023 16.0915 8.30483 15.4389 7.04742 15.4389C5.78949 15.4389 5.38394 16.052 4.34875 16.0915C3.25329 16.1307 2.42185 15.0429 1.73195 14.054C0.310872 12.0564 -0.764097 8.41705 0.696758 5.96431C1.40722 4.73809 2.70553 3.96677 4.10507 3.94695C5.18064 3.92756 6.17501 4.63962 6.82446 4.63962C7.47376 4.63962 8.62918 3.80889 9.98932 3.88805ZM23.544 1.13133C26.4989 1.13133 28.5569 3.11593 28.5569 6.00514C28.5569 8.90473 26.4567 10.8997 23.4702 10.8997H20.1987V15.9694H17.8349V1.13133H23.544ZM20.1987 8.96648H22.9108C24.9692 8.96648 26.1402 7.88694 26.1402 6.01552C26.1402 4.14448 24.9688 3.07467 22.9212 3.07467H20.1987V8.96648ZM29.1434 12.8945C29.1434 10.9923 30.6314 9.90226 33.375 9.7378L36.3194 9.56295V8.74027C36.3194 7.53753 35.5071 6.87939 34.0613 6.87939C32.8683 6.87939 32.0028 7.47564 31.8242 8.39042H29.6919C29.7556 6.46802 31.6126 5.06972 34.1246 5.06972C36.8262 5.06972 38.5886 6.44746 38.5886 8.58634V15.969H36.4042V14.1901H36.3515C35.7287 15.3518 34.3565 16.0817 32.8683 16.0817C30.6734 16.0817 29.1434 14.8072 29.1434 12.8945ZM36.3195 11.9385V11.1054L33.6918 11.27C32.2138 11.3624 31.4442 11.897 31.4442 12.8325C31.4442 13.7375 32.2459 14.3238 33.5018 14.3238C35.1055 14.3238 36.3195 13.3262 36.3195 11.9385ZM40.597 19.9377V18.1592C40.7449 18.1794 41.1032 18.1999 41.2935 18.1999C42.3381 18.1999 42.9291 17.7688 43.288 16.6575L43.4992 15.9997L39.4992 5.20338H41.9686L44.7548 13.9638H44.8077L47.5936 5.20338H50L45.8524 16.5445C44.9024 19.1463 43.8155 20 41.515 20C41.3354 20 40.7549 19.9793 40.597 19.9377Z",fill:"white"})})})}function an({size:t=32}){return e.jsx("div",{className:"flex items-center justify-center shrink-0",style:{width:t,height:t,background:"#3C4043",borderRadius:t*.2},children:e.jsxs("svg",{width:t*.72,height:t*.296,viewBox:"0 0 51 21",fill:"none",children:[e.jsx("path",{d:"M50.9156 5.87122L44.6406 20.2837H42.6992L45.0289 15.2416L40.9009 5.87122H42.9451L45.929 13.0573H45.9689L48.8714 5.87122H50.9156Z",fill:"white"}),e.jsx("path",{d:"M39.3906 6.65832C38.5866 5.91563 37.4895 5.54547 36.0995 5.54547C34.314 5.54547 32.9657 6.19816 32.0513 7.50532L33.7084 8.54664C34.3211 7.66089 35.1512 7.21951 36.2011 7.21951C36.8967 7.21951 37.5008 7.44661 38.0194 7.9023C38.538 8.35948 38.7964 8.91352 38.7964 9.5665V9.99507C38.0751 9.58796 37.1536 9.38381 36.0366 9.38381C34.7297 9.38381 33.6839 9.68959 32.8998 10.3023C32.1172 10.9151 31.7256 11.738 31.7256 12.7706C31.7256 13.8033 32.0969 14.5675 32.8396 15.2216C33.5808 15.8758 34.5065 16.2016 35.6092 16.2016C36.9033 16.2016 37.9389 15.6302 38.7147 14.4876H38.7976V15.8761H40.5944V9.70955C40.5944 8.4167 40.1944 7.39982 39.3903 6.65862L39.3906 6.65832ZM37.8665 13.6501C37.2451 14.2343 36.5424 14.5272 35.7511 14.5272C35.1926 14.5272 34.7068 14.3645 34.2913 14.0387C33.8741 13.7103 33.6673 13.3032 33.6673 12.8132C33.6673 12.2675 33.923 11.8134 34.4344 11.4462C34.9443 11.079 35.5815 10.8948 36.3442 10.8948C37.3926 10.8948 38.211 11.1249 38.7967 11.5889C38.7967 12.3775 38.4867 13.0645 37.8668 13.6501H37.8665Z",fill:"white"}),e.jsx("path",{d:"M30.4166 2.52282C29.5296 1.67999 28.4552 1.25739 27.1883 1.25739H22.2017V15.8758H24.0813V9.95362H27.188C28.4678 9.95362 29.5448 9.53936 30.4163 8.70815C31.3175 7.87962 31.7661 6.84397 31.7661 5.60565C31.7661 4.36733 31.3175 3.36744 30.4163 2.52312L30.4166 2.52282ZM29.0895 7.40248C28.598 7.90525 27.9781 8.15798 27.2297 8.15798H24.0816V3.05272H27.2297C27.9781 3.05272 28.5983 3.31141 29.0895 3.82849C29.5937 4.33276 29.845 4.92554 29.845 5.60535C29.845 6.28516 29.5934 6.8994 29.0895 7.40218V7.40248Z",fill:"white"}),e.jsx("path",{d:"M16.2663 11.4026C15.8887 12.6964 15.1901 13.9058 14.2131 14.8354C14.1815 14.8655 14.1496 14.895 14.1178 14.9245C14.116 14.9263 14.1148 14.9277 14.113 14.9292C13.1524 15.8144 11.9487 16.4295 10.6737 16.7272C10.6621 16.7302 10.6502 16.7329 10.6385 16.7356C10.2484 16.8241 9.85204 16.8888 9.45357 16.929C8.81668 16.9928 8.17293 16.9928 7.53723 16.9222C7.22102 16.8873 6.9063 16.8348 6.59546 16.7639C6.49293 16.7407 6.39101 16.7156 6.28938 16.6882C5.16759 16.3884 4.11256 15.8564 3.20476 15.1337C3.0018 14.971 2.80599 14.7987 2.61823 14.6184C2.61257 14.613 2.60721 14.6077 2.60154 14.6026C1.93962 13.9657 1.38081 13.22 0.956413 12.4034C0.938829 12.3691 0.921246 12.3352 0.90396 12.3009C0.717393 11.9319 0.559138 11.5493 0.429793 11.1574C0.364822 10.9618 0.307302 10.7634 0.257233 10.5631C0.226834 10.443 0.199117 10.3226 0.174678 10.2013C0.141299 10.0397 0.112986 9.87702 0.0894411 9.714C-0.0509314 8.75165 -0.0267907 7.76517 0.166929 6.81118C0.176168 6.76468 0.185705 6.71879 0.195838 6.6723C0.345748 5.97997 0.582981 5.31 0.903662 4.67698C1.53102 3.42525 2.48025 2.33983 3.62498 1.53514H3.62528C3.73704 1.45616 3.85029 1.38076 3.96533 1.30775C3.99424 1.28957 4.02345 1.27169 4.05206 1.25351C4.11018 1.21774 4.16889 1.18257 4.2276 1.148C4.34562 1.07945 4.46513 1.01329 4.58643 0.950111C4.64723 0.918519 4.70773 0.887822 4.76912 0.858018C5.0755 0.707811 5.39111 0.576975 5.71418 0.466108C5.77021 0.446438 5.82624 0.427961 5.88227 0.409781C5.96661 0.38266 6.05095 0.356731 6.13619 0.332292C6.19312 0.315603 6.25064 0.300106 6.30786 0.284906C6.36448 0.269707 6.4217 0.255401 6.47863 0.241393C6.51111 0.233346 6.5433 0.225895 6.57579 0.218146C6.62764 0.206225 6.6792 0.194901 6.73136 0.183874C6.73464 0.183278 6.73762 0.182681 6.7406 0.181787C6.90481 0.147216 7.06992 0.117711 7.23593 0.093273C7.25262 0.0905907 7.2693 0.088205 7.28629 0.0861187C8.67482 -0.111774 10.114 0.0309834 11.4319 0.518561C12.4443 0.889311 13.3712 1.47882 14.1651 2.21048C13.899 2.4957 13.6138 2.76661 13.3378 3.04705C12.8151 3.56533 12.2971 4.08807 11.774 4.60605C11.7734 4.60545 11.7723 4.60486 11.7717 4.60367L11.7645 4.61082C11.2465 4.11639 10.6192 3.74564 9.9346 3.53642C9.1314 3.29412 8.26652 3.26044 7.44425 3.43658C7.14741 3.49946 6.85772 3.59066 6.57847 3.70779C6.57519 3.70898 6.57221 3.71047 6.56893 3.71166C5.95231 3.97393 5.38843 4.36047 4.92022 4.83881C4.3638 5.39941 3.94089 6.09352 3.68906 6.83979C3.68727 6.8386 3.68548 6.83711 3.68369 6.83591C3.31831 7.89571 3.32308 9.07889 3.68399 10.1384C3.68191 10.1402 3.67982 10.1417 3.67773 10.1435C3.67833 10.1446 3.67863 10.1458 3.67893 10.147C3.68071 10.1461 3.6822 10.1446 3.68399 10.1435C4.03567 11.1892 4.72501 12.1158 5.62835 12.7482C6.19371 13.1473 6.84014 13.428 7.51995 13.5654C8.18545 13.6987 8.87927 13.6844 9.54477 13.5705C10.2103 13.4564 10.8519 13.209 11.4128 12.8338C11.4128 12.8338 11.413 12.834 11.4134 12.8344C11.4164 12.8326 11.4194 12.8308 11.4221 12.8287C12.3081 12.2294 12.9301 11.2691 13.1095 10.2147H8.48467V6.90178H8.48944V6.89701H16.4797C16.7458 8.38955 16.6889 9.94378 16.2657 11.4029L16.2663 11.4026Z",fill:"white"})]})})}function Ha({size:t=32}){return e.jsx("div",{className:"rounded-full flex items-center justify-center shrink-0",style:{width:t,height:t,background:"#003087"},children:e.jsx("span",{className:"text-white font-bold",style:{fontSize:t*.38},children:"P"})})}function rn({size:t=32}){return e.jsx("div",{className:"flex items-center justify-center shrink-0",style:{width:t,height:t,background:"#1A1F71",borderRadius:t*.2},children:e.jsxs("svg",{width:t*.72,height:t*.234,viewBox:"0 0 43 14",fill:"none",children:[e.jsx("path",{d:"M18.3629 13.5165H14.9302L17.0772 0.240662H20.5097L18.3629 13.5165Z",fill:"white"}),e.jsx("path",{d:"M30.806 0.565203C30.1289 0.296586 29.055 0 27.7271 0C24.3372 0 21.95 1.80767 21.9354 4.3921C21.9072 6.29889 23.6445 7.35796 24.9439 7.99375C26.2719 8.64342 26.7234 9.06747 26.7234 9.64656C26.7099 10.5359 25.6502 10.9459 24.6619 10.9459C23.2914 10.9459 22.5571 10.7345 21.4412 10.2397L20.9891 10.0276L20.5088 13.0077C21.3139 13.3745 22.7972 13.7 24.3372 13.7143C27.939 13.7143 30.2839 11.9346 30.3117 9.18047C30.3254 7.66919 29.4081 6.51119 27.4303 5.56493C26.2297 4.95749 25.4944 4.54791 25.4944 3.92639C25.5085 3.36137 26.1163 2.78265 27.4716 2.78265C28.5876 2.75431 29.4075 3.02255 30.0286 3.29098L30.3391 3.43195L30.806 0.565203Z",fill:"white"}),e.jsx("path",{d:"M35.3681 8.81332C35.6508 8.05064 36.7386 5.09886 36.7386 5.09886C36.7243 5.1272 37.0207 4.3221 37.1902 3.82785L37.4301 4.97178C37.4301 4.97178 38.0802 8.14956 38.2213 8.81332C37.6848 8.81332 36.0461 8.81332 35.3681 8.81332ZM39.6053 0.240662H36.9501C36.1313 0.240662 35.5092 0.480559 35.156 1.34216L30.0571 13.5163H33.659C33.659 13.5163 34.2519 11.8777 34.3794 11.5248C34.7745 11.5248 38.2784 11.5248 38.7867 11.5248C38.8853 11.9909 39.1963 13.5163 39.1963 13.5163H42.3747L39.6053 0.240662Z",fill:"white"}),e.jsx("path",{d:"M12.0629 0.240662L8.70119 9.29349L8.33383 7.45747C7.71232 5.33894 5.76311 3.03721 3.58789 1.89272L6.66713 13.5024H10.2971L15.6927 0.240662H12.0629Z",fill:"white"}),e.jsx("path",{d:"M5.57939 0.240662H0.0565013L0 0.508903C4.3082 1.61059 7.16143 4.26616 8.3337 7.45803L7.13309 1.35661C6.93542 0.508715 6.32798 0.268631 5.57939 0.240662Z",fill:"white"})]})})}function nn({size:t=32}){const a=t*.8;return e.jsx("div",{className:"flex items-center justify-center shrink-0",style:{width:t,height:t},children:e.jsxs("svg",{width:a,height:a*.625,viewBox:"0 0 48 30",fill:"none",children:[e.jsx("circle",{cx:"18",cy:"15",r:"14",fill:"#EB001B"}),e.jsx("circle",{cx:"30",cy:"15",r:"14",fill:"#F79E1B"}),e.jsx("path",{d:"M24 2.35A14 14 0 0 1 24 27.65A14 14 0 0 1 24 2.35Z",fill:"#FF5F00"})]})})}function on({size:t=32}){const a=t*.56,r=a*.65,n=Math.max(2,a*.1),o=a*.2;return e.jsxs("div",{className:"flex items-center justify-center shrink-0",style:{width:t,height:t},children:[e.jsx("div",{style:{width:a,height:r,background:"#1A1F71",borderRadius:n,position:"relative",zIndex:2,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsxs("svg",{width:a*.7,height:r*.35,viewBox:"0 0 43 14",fill:"none",children:[e.jsx("path",{d:"M18.3629 13.5165H14.9302L17.0772 0.240662H20.5097L18.3629 13.5165Z",fill:"white"}),e.jsx("path",{d:"M12.0629 0.240662L8.70119 9.29349L8.33383 7.45747C7.71232 5.33894 5.76311 3.03721 3.58789 1.89272L6.66713 13.5024H10.2971L15.6927 0.240662H12.0629Z",fill:"white"}),e.jsx("path",{d:"M5.57939 0.240662H0.0565013L0 0.508903C4.3082 1.61059 7.16143 4.26616 8.3337 7.45803L7.13309 1.35661C6.93542 0.508715 6.32798 0.268631 5.57939 0.240662Z",fill:"white"}),e.jsx("path",{d:"M30.806 0.565203C30.1289 0.296586 29.055 0 27.7271 0C24.3372 0 21.95 1.80767 21.9354 4.3921C21.9072 6.29889 23.6445 7.35796 24.9439 7.99375C26.2719 8.64342 26.7234 9.06747 26.7234 9.64656C26.7099 10.5359 25.6502 10.9459 24.6619 10.9459C23.2914 10.9459 22.5571 10.7345 21.4412 10.2397L20.9891 10.0276L20.5088 13.0077C21.3139 13.3745 22.7972 13.7 24.3372 13.7143C27.939 13.7143 30.2839 11.9346 30.3117 9.18047C30.3254 7.66919 29.4081 6.51119 27.4303 5.56493C26.2297 4.95749 25.4944 4.54791 25.4944 3.92639C25.5085 3.36137 26.1163 2.78265 27.4716 2.78265C28.5876 2.75431 29.4075 3.02255 30.0286 3.29098L30.3391 3.43195L30.806 0.565203Z",fill:"white"}),e.jsx("path",{d:"M35.3681 8.81332C35.6508 8.05064 36.7386 5.09886 36.7386 5.09886C36.7243 5.1272 37.0207 4.3221 37.1902 3.82785L37.4301 4.97178C37.4301 4.97178 38.0802 8.14956 38.2213 8.81332C37.6848 8.81332 36.0461 8.81332 35.3681 8.81332ZM39.6053 0.240662H36.9501C36.1313 0.240662 35.5092 0.480559 35.156 1.34216L30.0571 13.5163H33.659C33.659 13.5163 34.2519 11.8777 34.3794 11.5248C34.7745 11.5248 38.2784 11.5248 38.7867 11.5248C38.8853 11.9909 39.1963 13.5163 39.1963 13.5163H42.3747L39.6053 0.240662Z",fill:"white"})]})}),e.jsx("div",{style:{width:a,height:r,background:"#252525",borderRadius:n,marginLeft:-o,position:"relative",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},children:e.jsxs("svg",{width:r*.85,height:r*.6,viewBox:"0 0 48 30",fill:"none",children:[e.jsx("circle",{cx:"18",cy:"15",r:"14",fill:"#EB001B"}),e.jsx("circle",{cx:"30",cy:"15",r:"14",fill:"#F79E1B"}),e.jsx("path",{d:"M24 2.35A14 14 0 0 1 24 27.65A14 14 0 0 1 24 2.35Z",fill:"#FF5F00"})]})})]})}function sn({size:t=18}){return e.jsx("div",{className:"rounded-full bg-white flex items-center justify-center shrink-0",style:{width:t,height:t},children:e.jsx("span",{className:"text-black font-bold",style:{fontSize:t*.55},children:"C"})})}function xe(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"var(--t-text-secondary)",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Oa(){return e.jsx("svg",{width:"8",height:"14",viewBox:"0 0 8 14",fill:"none",children:e.jsx("path",{d:"M1 1L7 7L1 13",stroke:"var(--t-icon-stroke)",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ln({onClick:t}){return e.jsx("button",{onClick:t,className:"hover:opacity-70 transition-opacity",children:e.jsx("svg",{width:"24",height:"16",viewBox:"0 0 24 16",fill:"none",children:e.jsx("path",{d:"M22.4004 12V4C22.4004 2.67452 21.3255 1.59961 20 1.59961H6.7998V14.4004H20V16H4V14.4004H5.2002V1.59961H4C2.67452 1.59961 1.59961 2.67452 1.59961 4V12C1.59961 13.3255 2.67452 14.4004 4 14.4004V16L3.79395 15.9951C1.68056 15.8879 0 14.14 0 12V4C0 1.79086 1.79086 6.44266e-08 4 0H20C22.2091 0 24 1.79086 24 4V12L23.9951 12.2061C23.8913 14.2512 22.2512 15.8913 20.2061 15.9951L20 16V14.4004C21.3255 14.4004 22.4004 13.3255 22.4004 12Z",fill:"var(--t-icon-stroke)"})})})}function cn({size:t=40}){return e.jsx("div",{className:"rounded-full flex items-center justify-center shrink-0",style:{width:t,height:t,background:"var(--t-surface)"},children:e.jsxs("svg",{width:t*.5,height:t*.5,viewBox:"0 0 20 20",fill:"none",children:[e.jsx("circle",{cx:"10",cy:"10",r:"7.5",stroke:"var(--t-text)",strokeWidth:"1.5"}),e.jsx("path",{d:"M10 2.5A7.5 7.5 0 0 1 10 17.5",fill:"var(--t-text)"})]})})}function _a({size:t=20}){const a=t*.6;return e.jsx("div",{className:"rounded-full flex items-center justify-center shrink-0",style:{width:t,height:t,background:"var(--t-payment-icon-bg)"},children:e.jsxs("svg",{width:a,height:a,viewBox:"0 0 12 12",fill:"none",children:[e.jsx("path",{d:"M11 3.5H1L6 0.5L11 3.5Z",stroke:"white",strokeWidth:"0.8"}),e.jsx("rect",{x:"1.5",y:"4.5",width:"0.8",height:"5",fill:"white"}),e.jsx("rect",{x:"4.2",y:"4.5",width:"0.8",height:"5",fill:"white"}),e.jsx("rect",{x:"6.9",y:"4.5",width:"0.8",height:"5",fill:"white"}),e.jsx("rect",{x:"9.6",y:"4.5",width:"0.8",height:"5",fill:"white"}),e.jsx("rect",{x:"0.5",y:"10.5",width:"11",height:"0.5",fill:"white"})]})})}function Ka({size:t=20}){const a=t*.6;return e.jsx("div",{className:"rounded-full flex items-center justify-center shrink-0",style:{width:t,height:t,background:"var(--t-payment-icon-bg)"},children:e.jsxs("svg",{width:a,height:a*.75,viewBox:"0 0 12 9",fill:"none",children:[e.jsx("rect",{x:"0.5",y:"0.5",width:"11",height:"8",rx:"1.5",stroke:"white",strokeWidth:"0.8",fill:"none"}),e.jsx("rect",{x:"0.5",y:"2.5",width:"11",height:"1.5",fill:"white"}),e.jsx("rect",{x:"2",y:"5.5",width:"3",height:"1",rx:"0.5",fill:"white"})]})})}function Va({size:t=20}){return e.jsx("div",{className:"rounded-full flex items-center justify-center shrink-0",style:{width:t,height:t,background:"var(--t-payment-icon-bg)"},children:e.jsxs("svg",{width:10,height:12,viewBox:"0 0 10 12",fill:"none",children:[e.jsx("path",{d:"M8.32 6.32C8.31 5.1 9.32 4.5 9.37 4.47C8.77 3.59 7.83 3.47 7.5 3.46C6.73 3.38 5.99 3.93 5.6 3.93C5.2 3.93 4.59 3.47 3.94 3.48C3.1 3.5 2.32 3.99 1.89 4.74C1.01 6.27 1.66 8.52 2.5 9.76C2.93 10.37 3.43 11.05 4.08 11.03C4.71 11 4.95 10.63 5.71 10.63C6.46 10.63 6.69 11.03 7.34 11.02C8.02 11 8.45 10.4 8.87 9.79C9.36 9.09 9.56 8.41 9.57 8.37C9.55 8.37 8.33 7.88 8.32 6.32Z",fill:"white"}),e.jsx("path",{d:"M7.13 2.57C7.49 2.12 7.74 1.5 7.67 0.88C7.15 0.91 6.51 1.24 6.13 1.68C5.79 2.08 5.5 2.72 5.58 3.32C6.16 3.37 6.76 3.02 7.13 2.57Z",fill:"white"})]})})}function Wa({size:t=20}){return e.jsx("div",{className:"rounded-full flex items-center justify-center shrink-0",style:{width:t,height:t,background:"var(--t-payment-icon-bg)"},children:e.jsxs("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",children:[e.jsx("path",{d:"M9.68 5.11C9.68 4.76 9.65 4.42 9.6 4.09H5V6.02H7.62C7.52 6.58 7.2 7.05 6.73 7.37V8.5H8.26C9.14 7.69 9.68 6.51 9.68 5.11Z",fill:"white"}),e.jsx("path",{d:"M5 9.58C6.28 9.58 7.35 9.14 8.26 8.5L6.73 7.37C6.33 7.64 5.81 7.79 5 7.79C3.78 7.79 2.73 6.97 2.38 5.87H0.8V7.04C1.71 8.84 3.22 9.58 5 9.58Z",fill:"white"}),e.jsx("path",{d:"M2.38 5.87C2.28 5.57 2.22 5.25 2.22 4.93C2.22 4.6 2.28 4.28 2.38 3.98V2.82H0.8C0.46 3.49 0.27 4.24 0.27 5.03C0.27 5.73 0.44 6.4 0.73 7L2.38 5.87Z",fill:"white"}),e.jsx("path",{d:"M5 2.07C5.74 2.07 6.39 2.32 6.91 2.82L8.29 1.45C7.35 0.57 6.28 0.07 5 0.07C3.22 0.07 1.71 1.14 0.8 2.82L2.38 3.98C2.73 2.88 3.78 2.07 5 2.07Z",fill:"white"})]})})}function dn({size:t=24}){const a=t*1.15;return e.jsxs("svg",{width:a,height:t,viewBox:"0 0 48 32",fill:"none",preserveAspectRatio:"xMidYMid meet",children:[e.jsx("path",{d:"M0 0H5.76C11.0619 0 15.36 4.47715 15.36 10V32H0V0Z",fill:"var(--t-text)"}),e.jsx("path",{d:"M16.32 0H22.08C27.3819 0 31.68 4.47715 31.68 10V32H16.32V0Z",fill:"var(--t-text)"}),e.jsx("path",{d:"M32.64 8C32.64 3.58172 36.0785 0 40.32 0C44.5615 0 48 3.58172 48 8C48 12.4183 44.5615 16 40.32 16C36.0785 16 32.64 12.4183 32.64 8Z",fill:"var(--t-text)"})]})}function pt({size:t=12}){return e.jsx("div",{className:"flex items-center justify-center rounded-full shrink-0",style:{width:t,height:t,background:"var(--t-text-secondary)"},children:e.jsx("span",{style:{fontSize:t*.75,fontWeight:500,lineHeight:1,letterSpacing:"0.18px",color:"var(--t-bg)"},children:"i"})})}function Ga({onClick:t}){return e.jsx("button",{onClick:t,className:"flex items-center justify-center rounded-full transition-opacity hover:opacity-70",style:{width:40,height:40},children:e.jsxs("svg",{width:"20",height:"4",viewBox:"0 0 20 4",fill:"none",children:[e.jsx("circle",{cx:"2",cy:"2",r:"2",fill:"var(--t-text)"}),e.jsx("circle",{cx:"10",cy:"2",r:"2",fill:"var(--t-text)"}),e.jsx("circle",{cx:"18",cy:"2",r:"2",fill:"var(--t-text)"})]})})}function un({size:t=16}){return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"7",cy:"7",r:"5.25",stroke:"var(--t-text-secondary)",strokeWidth:"1.2"}),e.jsx("path",{d:"M11 11l3.5 3.5",stroke:"var(--t-text-secondary)",strokeWidth:"1.2",strokeLinecap:"round"})]})}function mn({size:t=12}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M6 10V2M6 2L2.5 5.5M6 2l3.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function $a({size:t=14}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 14 14",fill:"none",children:e.jsx("path",{d:"M11.5 3.5L5.5 10.5L2.5 7.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ht({size:t=12}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M2 2l8 8M10 2l-8 8",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})}function Za(t,a=32,r){switch(t){case"bank":return e.jsx(_a,{size:a});case"card":return e.jsx(Ka,{size:a});case"applepay":return e.jsx(Va,{size:a});case"googlepay":return e.jsx(Wa,{size:a});case"revolut":return e.jsx(Pa,{size:a});case"paypal":return e.jsx(Ha,{size:a});case"visa":return e.jsx(rn,{size:a});case"mastercard":return e.jsx(nn,{size:a});default:return e.jsx(Vt,{size:a})}}function Xa({type:t,title:a,description:r,visible:n,onDismiss:o}){const[l,u]=i.useState(!1),[s,d]=i.useState(!1),c=i.useCallback(()=>{d(!0),setTimeout(()=>{u(!1),d(!1),o()},200)},[o]);if(i.useEffect(()=>{n&&(u(!0),d(!1))},[n]),i.useEffect(()=>{if(!n||!l)return;const p=setTimeout(c,5e3);return()=>clearTimeout(p)},[n,l,c]),!l)return null;const h=t==="success"?"var(--t-toast-success-bg)":"var(--t-toast-error-bg)";return e.jsx("div",{className:"absolute top-0 left-0 right-0 z-[25] px-3 pt-3",style:{animation:s?"slideUpToastOut 0.2s ease-in forwards":"slideDownToast 0.3s ease-out both"},children:e.jsxs("div",{className:"flex items-start gap-2.5 rounded-2xl px-4 py-3",style:{background:h,color:"#ffffff"},children:[e.jsx("span",{className:"mt-0.5 shrink-0",children:t==="success"?e.jsx($a,{size:14}):e.jsx(ht,{size:12})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[13px] font-medium leading-tight",children:a}),r&&e.jsx("div",{className:"text-[12px] leading-snug mt-0.5 opacity-90",children:r})]}),e.jsx("button",{onClick:c,className:"shrink-0 opacity-80 hover:opacity-100 transition-opacity mt-0.5",children:e.jsx(ht,{size:10})})]})})}function ye({width:t=46}){const a=t*.8695652173913043;return e.jsxs("svg",{width:t,height:a,viewBox:"0 0 48 32",fill:"none",preserveAspectRatio:"xMidYMid meet",children:[e.jsx("path",{d:"M0 0H5.76C11.0619 0 15.36 4.47715 15.36 10V32H0V0Z",fill:"var(--t-text)"}),e.jsx("path",{d:"M16.32 0H22.08C27.3819 0 31.68 4.47715 31.68 10V32H16.32V0Z",fill:"var(--t-text)"}),e.jsx("path",{d:"M32.64 8C32.64 3.58172 36.0785 0 40.32 0C44.5615 0 48 3.58172 48 8C48 12.4183 44.5615 16 40.32 16C36.0785 16 32.64 12.4183 32.64 8Z",fill:"var(--t-text)"})]})}function Ya(){return e.jsx("div",{className:"flex-1 flex items-center justify-center",style:{animation:"fadeInScale 0.5s ease-out both"},children:e.jsx(ye,{width:90})})}function Qa({isOpen:t,onClose:a,children:r}){return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute inset-0 z-[30] transition-opacity duration-300",style:{background:"rgba(0,0,0,0.4)",opacity:t?1:0,pointerEvents:t?"auto":"none",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},onClick:a}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 z-[31] transition-transform duration-300 ease-out sheet-inverted",style:{transform:t?"translateY(0)":"translateY(100%)",borderRadius:20,background:"var(--t-bg)",maxHeight:"70%",overflow:"visible",marginBottom:12,marginLeft:12,marginRight:12},children:r})]})}function je({onClick:t}){return e.jsx("button",{onClick:t,className:"flex items-center justify-center shrink-0 opacity-60 hover:opacity-100 transition-opacity",style:{width:40,height:40},children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:e.jsx("path",{d:"M3 3L11 11M11 3L3 11",stroke:"var(--t-text)",strokeWidth:"1.5",strokeLinecap:"round"})})})}function Ue({value:t,onChange:a,placeholder:r="",inline:n=!1}){return e.jsxs("div",{className:`flex items-center ${n?"":"mx-5 mb-5"}`,style:{height:48,borderRadius:100,backgroundColor:"var(--t-surface)",paddingLeft:16,paddingRight:12,gap:10},children:[e.jsx("div",{className:"shrink-0 flex items-center justify-center",style:{color:"var(--t-text-secondary)"},children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",children:[e.jsx("circle",{cx:"8.5",cy:"8.5",r:"6.25",stroke:"currentColor",strokeWidth:"1.4"}),e.jsx("path",{d:"M13.5 13.5l4 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}),e.jsx("input",{type:"text",value:t,onChange:o=>a(o.target.value),placeholder:r,className:"flex-1 min-w-0 focus-visible:outline-none",style:{height:"100%",border:"none",outline:"none",boxShadow:"none",color:"var(--t-text)",fontSize:14,backgroundColor:"transparent"}}),t&&e.jsx("button",{onClick:()=>a(""),className:"shrink-0 flex items-center justify-center",style:{width:20,height:20},children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M2 2l8 8M10 2l-8 8",stroke:"var(--t-text-secondary)",strokeWidth:"1.4",strokeLinecap:"round"})})})]})}const pn=["USD","EUR","GBP"];function za({onClose:t,onSelect:a,currencies:r,assetBaseUrl:n="",selectedCode:o}){const l=U(),[u,s]=i.useState(""),d=i.useMemo(()=>{if(!r||r.length===0)return Ut;const h=new Map(Ut.map(p=>[p.code,p.name]));return r.map(p=>({code:p.code,name:p.name||h.get(p.code)||p.code}))},[r]),c=i.useMemo(()=>{const h=u.trim().toLowerCase();if(!h){if(o){const p=d.find(f=>f.code===o);if(p){const f=d.filter(y=>y.code!==o);return[p,...f]}}return d}return d.filter(p=>p.code.toLowerCase().includes(h)||p.name.toLowerCase().includes(h))},[d,u,o]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative shrink-0",style:{height:128,background:"var(--t-header-bg)",backdropFilter:"blur(var(--t-header-blur))",WebkitBackdropFilter:"blur(var(--t-header-blur))"},children:[e.jsx("div",{className:"absolute",style:{left:12,top:20},children:e.jsx(ye,{width:46})}),e.jsx("p",{className:"absolute text-[16px] text-center truncate",style:{top:28,left:64,right:64,color:"var(--t-text)",lineHeight:"24px"},children:l("modal.selectFiat")}),e.jsx("div",{className:"absolute",style:{right:12,top:20},children:e.jsx(je,{onClick:t})}),e.jsx("div",{className:"absolute",style:{bottom:8,left:12,right:12},children:e.jsx(Ue,{value:u,onChange:s,inline:!0})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto custom-scroll px-3",children:[c.map((h,p)=>{const f=o===h.code;return e.jsxs("button",{onClick:()=>a(h.code),className:"flex items-center w-full card-press hover-item modal-item-in",style:{gap:16,animationDelay:`${Math.min(p*45,350)}ms`},children:[e.jsx(vt,{currencyCode:h.code,size:32,baseUrl:n}),e.jsxs("div",{className:"flex-1 flex items-center",style:{borderBottom:"1px solid var(--t-card-border)",paddingTop:20,paddingBottom:20,gap:10},children:[e.jsx("span",{className:"flex-1 text-[18px] text-left",style:{color:"var(--t-text)",lineHeight:"20px"},children:h.code}),pn.includes(h.code)&&e.jsx("span",{className:"text-[11px] font-medium",style:{border:"1.5px solid var(--t-card-border)",borderRadius:100,paddingLeft:8,paddingRight:8,color:"var(--t-text-secondary)",lineHeight:"20px",letterSpacing:"0.22px"},children:l("modal.popular")}),f&&e.jsx("div",{style:{width:40,height:20,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"var(--t-success, #4CD964)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]},h.code)}),c.length===0&&e.jsx("div",{className:"text-center py-10 text-[14px]",style:{color:"var(--t-text-muted)"},children:l("modal.noCurrencies")})]})]})}const ma=["BTC","ETH","SOL"];function pa({src:t,alt:a,size:r,className:n,style:o}){const[l,u]=i.useState(!1),[s,d]=i.useState(!1),c=i.useRef(t);c.current!==t&&(c.current=t,u(!1),d(!1));const h=i.useCallback(()=>u(!0),[]),p=i.useCallback(()=>d(!0),[]);return e.jsxs("div",{className:n,style:{...o,width:r,height:r,position:"relative"},children:[!l&&!s&&e.jsx("div",{className:"absolute inset-0 rounded-full animate-pulse",style:{background:"var(--t-pill-bg, #333)"}}),s?e.jsx("div",{className:"absolute inset-0 rounded-full flex items-center justify-center text-[10px] font-bold",style:{background:"var(--t-pill-bg, #333)",color:"var(--t-text-muted)"},children:a.slice(0,3)}):e.jsx("img",{src:t,alt:a,width:r,height:r,onLoad:h,onError:p,className:`rounded-full ${l?"opacity-100":"opacity-0"}`,style:{width:r,height:r,transition:"opacity 0.15s ease-in"}})]})}function Ja({onClose:t,onSelect:a,cryptos:r,assetBaseUrl:n="",selectedCode:o,selectedChain:l}){const u=U(),[s,d]=i.useState(""),c=i.useMemo(()=>{if(!r||r.length===0)return Ma;const f=[];for(const y of r){const j=y.networks||[],N=y.name||zr[y.code]||y.code;if(j.length===0)f.push({code:y.code,name:N,chain:y.code,popular:ma.includes(y.code)});else for(const x of j){const k=x.code||x.id||x.name||y.code;f.push({code:y.code,name:N,chain:k,chainName:x.name,popular:ma.includes(y.code)})}}return f},[r]),h=i.useCallback((f,y)=>o===f&&l===y,[o,l]),p=i.useMemo(()=>{var N;const f=s.trim().toLowerCase();if(!f){if(o&&l){const x=c.find(k=>k.code===o&&k.chain===l);if(x){const k=c.filter(D=>!(D.code===o&&D.chain===l));return[x,...k]}}return c}const y=f.split(/\s+/),j=[];for(const x of c){const k=dt(x.chain),D=k?k.name.toLowerCase():"",G=((N=k==null?void 0:k.shortName)==null?void 0:N.toLowerCase())||"",$=x.chain.toLowerCase(),ee=x.code.toLowerCase(),Z=x.name.toLowerCase(),Y=[ee,Z,D,G,$];if(!y.every(A=>Y.some(C=>C.includes(A))))continue;let Q=0;ee===f?Q+=100:ee.startsWith(y[0])&&(Q+=50),x.popular&&(Q+=10),y.length>1&&(D.includes(y[1])||G.includes(y[1])||$.includes(y[1]))&&(Q+=25),j.push({item:x,score:Q})}return j.sort((x,k)=>k.score-x.score),j.map(x=>x.item)},[c,s,o,l]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative shrink-0",style:{height:128,background:"var(--t-header-bg)",backdropFilter:"blur(var(--t-header-blur))",WebkitBackdropFilter:"blur(var(--t-header-blur))"},children:[e.jsx("div",{className:"absolute",style:{left:12,top:20},children:e.jsx(ye,{width:46})}),e.jsx("p",{className:"absolute text-[16px] text-center truncate",style:{top:28,left:64,right:64,color:"var(--t-text)",lineHeight:"24px"},children:u("modal.selectCrypto")}),e.jsx("div",{className:"absolute",style:{right:12,top:20},children:e.jsx(je,{onClick:t})}),e.jsx("div",{className:"absolute",style:{bottom:8,left:12,right:12},children:e.jsx(Ue,{value:s,onChange:d,inline:!0})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto custom-scroll px-3",children:[p.map((f,y)=>{const j=dt(f.chain),N=(j==null?void 0:j.name)||f.chainName||f.chain,x=h(f.code,f.chain);return e.jsxs("button",{onClick:()=>a(f.code,f.chain),className:"flex items-center w-full card-press hover-item modal-item-in",style:{gap:16,animationDelay:`${Math.min(y*45,350)}ms`},children:[e.jsxs("div",{className:"relative shrink-0",style:{width:40,height:40},children:[e.jsx("div",{className:"absolute top-0 left-0",style:{background:"#ffffff",borderRadius:"50%"},children:e.jsx(pa,{src:Ot(f.code,n),alt:f.code,size:32})}),e.jsx("div",{className:"absolute",style:{bottom:0,right:0,border:"1.5px solid var(--t-chain-border, var(--t-surface, #1C1C22))",borderRadius:"50%",background:"#ffffff"},children:e.jsx(pa,{src:ut(f.chain,n),alt:f.chain,size:16})})]}),e.jsxs("div",{className:"flex-1 flex items-center",style:{borderBottom:"1px solid var(--t-card-border)",paddingTop:20,paddingBottom:20,gap:10},children:[e.jsx("span",{className:"flex-1 text-[18px] text-left",style:{color:"var(--t-text)",lineHeight:"20px"},children:f.code}),e.jsx("span",{className:"text-[15px]",style:{color:"var(--t-text-secondary)"},children:N}),f.popular&&e.jsx("span",{className:"text-[11px] font-medium",style:{border:"1.5px solid var(--t-card-border)",borderRadius:100,paddingLeft:8,paddingRight:8,color:"var(--t-text-secondary)",lineHeight:"20px",letterSpacing:"0.22px"},children:u("modal.popular")}),x&&e.jsx("div",{style:{width:40,height:20,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"var(--t-success, #4CD964)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]},`${f.code}-${f.chain}`)}),p.length===0&&e.jsx("div",{className:"text-center py-10 text-[14px]",style:{color:"var(--t-text-muted)"},children:u("modal.noCurrencies")})]})]})}const hn={"debit-credit-card":"card","bank-transfer":"bank","ach-bank-transfer":"bank","payid-bank-transfer":"bank","sepa-bank-transfer":"bank",sepa:"bank","apple-pay":"applepay","google-pay":"googlepay",paypal:"paypal",revolut:"revolut"},fn={"debit-credit-card":"payment.name.card","bank-transfer":"payment.name.bankTransfer","ach-bank-transfer":"payment.name.ach"},xn={"apple-pay":"Apple Pay","google-pay":"Google Pay","payid-bank-transfer":"PayID",paypal:"PayPal",revolut:"Revolut"},yn={"sepa-bank-transfer":"SEPA",sepa:"SEPA","bank-transfer":"Bank","ach-bank-transfer":"ACH"};function Wt(t,a,r,n=!1){if(n){const u=yn[t];if(u)return u}const o=xn[t];if(o)return o;const l=fn[t];return l&&r?r(l):l&&{"debit-credit-card":"Card","bank-transfer":"Bank Transfer","ach-bank-transfer":"ACH"}[t]||a}function Gt(t,a,r=24){const n=hn[t];return n?Za(n,r):a?e.jsx("img",{src:a,alt:"",width:r,height:r,style:{borderRadius:"50%"}}):e.jsx(Vt,{size:r})}function gn({methods:t,selectedId:a,onOpenModal:r,fiatCurrency:n}){const o=U(),l=i.useMemo(()=>t.filter(s=>s.supportedFiats.includes(n)),[t,n]),u=l.find(s=>s.id===a)||l[0];return l.length===0?e.jsx("div",{className:"flex items-center justify-between px-[18px] pt-[12px] pb-[14px]",style:{background:"var(--t-surface)",borderBottomLeftRadius:5,borderBottomRightRadius:5},children:e.jsx("span",{className:"text-[12px]",style:{color:"var(--t-text-muted)"},children:o("payment.unavailableFor",{currency:n})})}):e.jsx(e.Fragment,{children:e.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&r()},className:"flex items-center justify-between w-full px-[18px] transition-colors",style:{background:"var(--t-surface)",borderBottomLeftRadius:5,borderBottomRightRadius:5,cursor:"pointer",height:42},children:[e.jsx("span",{className:"text-[12px]",style:{color:"var(--t-text-secondary)"},children:o("payment.label")}),e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"flex items-center justify-center",style:{width:20,height:20},children:u&&Gt(u.id,u.icon,20)}),e.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--t-text)"},children:u?Wt(u.id,u.name,o):o("payment.select")}),e.jsx(xe,{})]})]})})}function vn({methods:t,selectedId:a,onSelect:r,onClose:n}){const o=U(),[l,u]=i.useState(""),s=t.length>0?t[0].id:"",d=i.useMemo(()=>{const c=l.trim().toLowerCase();if(!c){if(a){const h=t.find(p=>p.id===a);if(h){const p=t.filter(f=>f.id!==a);return[h,...p]}}return t}return t.filter(h=>h.id.toLowerCase().includes(c)||h.name.toLowerCase().includes(c)||h.description&&h.description.toLowerCase().includes(c))},[t,l,a]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative shrink-0",style:{height:128,background:"var(--t-header-bg)",backdropFilter:"blur(var(--t-header-blur))",WebkitBackdropFilter:"blur(var(--t-header-blur))"},children:[e.jsx("div",{className:"absolute",style:{left:12,top:20},children:e.jsx(ye,{width:46})}),e.jsx("p",{className:"absolute text-[16px] text-center truncate",style:{top:28,left:64,right:64,color:"var(--t-text)",lineHeight:"24px"},children:o("modal.choosePayment")}),e.jsx("div",{className:"absolute",style:{right:12,top:20},children:e.jsx(je,{onClick:n})}),e.jsx("div",{className:"absolute",style:{bottom:8,left:12,right:12},children:e.jsx(Ue,{value:l,onChange:u,inline:!0})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto custom-scroll px-3",children:[d.map((c,h)=>{const p=c.id===a,f=Wt(c.id,c.name,o);return e.jsxs("button",{onClick:()=>r(c.id),className:"flex items-center w-full card-press hover-item modal-item-in",style:{gap:16,animationDelay:`${Math.min(h*45,350)}ms`},children:[e.jsx("span",{className:"flex items-center justify-center shrink-0",style:{width:32,height:32},children:Gt(c.id,c.icon,32)}),e.jsxs("div",{className:"flex-1 flex items-center",style:{borderBottom:"1px solid var(--t-card-border)",paddingTop:20,paddingBottom:20,gap:10},children:[e.jsx("span",{className:"flex-1 text-[18px] text-left",style:{color:"var(--t-text)",lineHeight:"20px"},children:f}),c.id===s&&e.jsx("span",{className:"text-[11px] font-medium",style:{border:"1.5px solid var(--t-card-border)",borderRadius:100,paddingLeft:8,paddingRight:8,color:"var(--t-text-secondary)",lineHeight:"20px",letterSpacing:"0.22px"},children:o("modal.recommended")}),p&&e.jsx("div",{style:{width:40,height:20,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"var(--t-success, #4CD964)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]},c.id)}),d.length===0&&e.jsx("div",{className:"text-center py-10 text-[14px]",style:{color:"var(--t-text-muted)"},children:o("modal.noPaymentMethods")})]})]})}function qa({checked:t,onChange:a,accentColor:r}){return e.jsx("button",{onClick:()=>a(!t),className:"relative shrink-0 transition-colors duration-200",style:{width:64,height:28,borderRadius:14,backgroundColor:t?r||"var(--t-toggle-on)":"var(--t-toggle-off)"},children:e.jsx("div",{className:"absolute top-[2px] bg-white shadow",style:{width:39,height:24,borderRadius:13,transform:t?"translateX(23px)":"translateX(2px)",transition:"transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)"}})})}const Cn=[{key:"settings.privacy",href:"https://nowramp.com/privacy-policy"},{key:"settings.terms",href:"https://nowramp.com/terms-and-conditions"}],lt={background:"var(--t-surface)",borderRadius:"var(--t-card-radius)"};function er({onClose:t,darkMode:a,onToggleDarkMode:r,skinId:n,onSelectSkin:o,showThemeToggle:l=!0,country:u,countryName:s,onLocationPress:d,onLanguagePress:c,assetBaseUrl:h=""}){var x;const{t:p,locale:f,languages:y}=gt(),[j,N]=i.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative shrink-0",style:{height:80,background:"var(--t-header-bg)",backdropFilter:"blur(var(--t-header-blur))",WebkitBackdropFilter:"blur(var(--t-header-blur))"},children:[e.jsx("div",{className:"absolute",style:{left:12,top:20},children:e.jsx(ye,{width:46})}),e.jsx("div",{className:"absolute",style:{right:12,top:20},children:e.jsx(je,{onClick:t})})]}),e.jsxs("div",{className:"px-3 flex-1 pt-4 overflow-y-auto custom-scroll",style:{display:"flex",flexDirection:"column",gap:8},children:[d&&e.jsxs("button",{onClick:d,className:"w-full text-left transition-colors card-press modal-item-in",style:{...lt,backgroundColor:"var(--t-surface)",color:"inherit",border:"none",cursor:"pointer",padding:"12px 16px"},children:[e.jsx("span",{className:"text-[13px] block mb-1.5",style:{color:"var(--t-text-secondary)"},children:p("settings.location")}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[u&&!j?e.jsx("img",{src:`${h}/flags/${u.toLowerCase()}.svg`,alt:u,width:28,height:28,style:{width:28,height:28,borderRadius:"50%",objectFit:"cover"},onError:()=>N(!0)}):e.jsx(bn,{size:28}),e.jsx("span",{className:"text-[15px] font-medium",style:{color:"var(--t-text)"},children:s||u})]}),e.jsx(xe,{})]})]}),l&&e.jsxs("div",{className:"flex items-center justify-between w-full px-4 modal-item-in",style:{...lt,paddingTop:14,paddingBottom:14,animationDelay:"60ms"},children:[e.jsx("span",{className:"font-medium text-[15px]",style:{color:"var(--t-text)"},children:p("settings.darkMode")}),e.jsx(qa,{checked:a,onChange:r})]}),c&&e.jsxs("button",{onClick:c,className:"flex items-center justify-between w-full transition-colors card-press modal-item-in",style:{...lt,backgroundColor:"var(--t-surface)",color:"inherit",border:"none",cursor:"pointer",padding:"14px 16px",margin:0,textAlign:"left",animationDelay:"120ms"},children:[e.jsx("span",{className:"font-medium text-[15px]",style:{color:"var(--t-text)"},children:p("settings.language")}),e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:((x=y.find(k=>k.code===f))==null?void 0:x.name)||f})]}),Cn.map((k,D)=>e.jsxs("a",{href:k.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between w-full px-4 transition-colors card-press modal-item-in",style:{...lt,textDecoration:"none",color:"inherit",paddingTop:14,paddingBottom:14,animationDelay:`${180+D*60}ms`},children:[e.jsx("span",{className:"font-medium text-[15px]",style:{color:"var(--t-text)"},children:p(k.key)}),e.jsx(Oa,{})]},k.key))]})]})}function bn({size:t=28}){return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 40 40",fill:"none",children:[e.jsx("circle",{cx:"20",cy:"20",r:"18",stroke:"var(--t-text-secondary)",strokeWidth:"1.5",fill:"none"}),e.jsx("ellipse",{cx:"20",cy:"20",rx:"9",ry:"18",stroke:"var(--t-text-secondary)",strokeWidth:"1.5",fill:"none"}),e.jsx("line",{x1:"2",y1:"20",x2:"38",y2:"20",stroke:"var(--t-text-secondary)",strokeWidth:"1.5"}),e.jsx("path",{d:"M5 12h30M5 28h30",stroke:"var(--t-text-secondary)",strokeWidth:"1.2"})]})}function tr({onClose:t,onSelect:a,assetBaseUrl:r="",selectedCode:n}){const o=U(),[l,u]=i.useState(""),s=i.useMemo(()=>{const d=l.trim().toLowerCase();if(!d){if(n){const c=n.toLowerCase(),h=xt[c];if(h){const p=qe.filter(f=>f.code!==c);return[h,...p]}}return qe}return qe.filter(c=>c.name.toLowerCase().includes(d)||c.code.includes(d)||c.defaultFiat.toLowerCase().includes(d))},[l,n]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative shrink-0",style:{height:128,background:"var(--t-header-bg)",backdropFilter:"blur(var(--t-header-blur))",WebkitBackdropFilter:"blur(var(--t-header-blur))"},children:[e.jsx("div",{className:"absolute",style:{left:12,top:20},children:e.jsx(ye,{width:46})}),e.jsx("p",{className:"absolute text-[16px] text-center truncate",style:{top:28,left:64,right:64,color:"var(--t-text)",lineHeight:"24px"},children:o("modal.selectCountry")}),e.jsx("div",{className:"absolute",style:{right:12,top:20},children:e.jsx(je,{onClick:t})}),e.jsx("div",{className:"absolute",style:{bottom:8,left:12,right:12},children:e.jsx(Ue,{value:l,onChange:u,inline:!0})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto custom-scroll px-3",children:[s.map((d,c)=>{const h=(n==null?void 0:n.toLowerCase())===d.code;return e.jsxs("button",{onClick:()=>a(d.code),className:"flex items-center w-full card-press hover-item modal-item-in",style:{gap:16,animationDelay:`${Math.min(c*45,350)}ms`},children:[e.jsx(Sn,{code:d.code,size:32,baseUrl:r}),e.jsxs("div",{className:"flex-1 flex items-center",style:{borderBottom:"1px solid var(--t-card-border)",paddingTop:20,paddingBottom:20,gap:10},children:[e.jsx("span",{className:"flex-1 text-[18px] text-left",style:{color:"var(--t-text)",lineHeight:"20px"},children:d.name}),h&&e.jsx("div",{style:{width:40,height:20,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"var(--t-success, #4CD964)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]},d.code)}),s.length===0&&e.jsx("div",{className:"text-center py-10 text-[14px]",style:{color:"var(--t-text-muted)"},children:o("modal.noCountries")})]})]})}function Sn({code:t,size:a=32,baseUrl:r=""}){const[n,o]=i.useState(!1);return n?e.jsx("div",{style:{width:a,height:a,borderRadius:"50%",background:"var(--t-pill-bg, #333)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a*.4,color:"var(--t-text-muted)"},children:t.toUpperCase().slice(0,2)}):e.jsx("img",{src:`${r}/flags/${t}.svg`,alt:t,width:a,height:a,style:{width:a,height:a,borderRadius:"50%",objectFit:"cover"},onError:()=>o(!0)})}function jn({onClose:t,onSelect:a,selectedCode:r}){const n=U(),[o,l]=i.useState(""),u=i.useMemo(()=>{const s=o.trim().toLowerCase();if(!s){if(r){const d=Ie.find(c=>c.code===r);if(d){const c=Ie.filter(h=>h.code!==r);return[d,...c]}}return Ie}return Ie.filter(d=>d.name.toLowerCase().includes(s)||d.english.toLowerCase().includes(s)||d.code.includes(s))},[o,r]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative shrink-0",style:{height:128,background:"var(--t-header-bg)",backdropFilter:"blur(var(--t-header-blur))",WebkitBackdropFilter:"blur(var(--t-header-blur))"},children:[e.jsx("div",{className:"absolute",style:{left:12,top:20},children:e.jsx(ye,{width:46})}),e.jsx("p",{className:"absolute text-[16px] text-center truncate",style:{top:28,left:64,right:64,color:"var(--t-text)",lineHeight:"24px"},children:n("modal.selectLanguage")}),e.jsx("div",{className:"absolute",style:{right:12,top:20},children:e.jsx(je,{onClick:t})}),e.jsx("div",{className:"absolute",style:{bottom:8,left:12,right:12},children:e.jsx(Ue,{value:o,onChange:l,inline:!0})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto custom-scroll px-3",children:[u.map((s,d)=>{const c=r===s.code;return e.jsx("button",{onClick:()=>a(s.code),className:"flex items-center w-full card-press hover-item modal-item-in",style:{gap:16,animationDelay:`${Math.min(d*45,350)}ms`},children:e.jsxs("div",{className:"flex-1 flex items-center",style:{borderBottom:"1px solid var(--t-card-border)",paddingTop:20,paddingBottom:20,paddingLeft:4,gap:10},children:[e.jsx("span",{className:"flex-1 text-[18px] text-left",style:{color:"var(--t-text)",lineHeight:"20px"},children:s.name}),e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-muted)"},children:s.english}),c&&e.jsx("div",{style:{width:40,height:20,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"var(--t-success, #4CD964)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})},s.code)}),u.length===0&&e.jsx("div",{className:"text-center py-10 text-[14px]",style:{color:"var(--t-text-muted)"},children:n("modal.noLanguages")})]})]})}function ar({tab:t,onTabSwitch:a,showFlowToggle:r,showSettings:n,onOpenSettings:o}){const l=U();return e.jsxs("div",{className:"absolute top-0 left-0 right-0 z-10 flex items-center justify-between px-3",style:{height:80,background:"var(--t-header-bg)",backdropFilter:"blur(var(--t-header-blur))",WebkitBackdropFilter:"blur(var(--t-header-blur))"},children:[e.jsx("div",{style:{width:46,display:"flex",alignItems:"center",justifyContent:"flex-start"},children:e.jsx(ye,{width:46})}),r?e.jsxs("div",{className:"relative flex",style:{border:"1.5px solid var(--t-tab-border)",borderRadius:"var(--t-pill-radius)",padding:4,gap:4},children:[e.jsx("div",{style:{position:"absolute",top:4,left:4,width:88,height:32,borderRadius:"var(--t-pill-radius)",background:"var(--t-tab-active-bg)",transform:t==="buy"?"translateX(0)":"translateX(92px)",transition:"transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:0}}),e.jsx("button",{onClick:()=>a("buy"),className:`text-[13px] font-medium transition-colors duration-200 tab-pill${t==="buy"?" tab-pill-active":""}`,style:{position:"relative",zIndex:1,width:88,height:32,borderRadius:"var(--t-pill-radius)",color:t==="buy"?"var(--t-tab-active-text)":"var(--t-tab-inactive-text)"},children:l("header.buy")}),e.jsx("button",{onClick:()=>a("sell"),className:`text-[13px] font-medium transition-colors duration-200 tab-pill${t==="sell"?" tab-pill-active":""}`,style:{position:"relative",zIndex:1,width:88,height:32,borderRadius:"var(--t-pill-radius)",color:t==="sell"?"var(--t-tab-active-text)":"var(--t-tab-inactive-text)"},children:l("header.sell")})]}):e.jsx("div",{}),e.jsx("div",{style:{width:40,display:"flex",alignItems:"center",justifyContent:"flex-end"},children:n?e.jsx(Ga,{onClick:o}):e.jsx("div",{style:{width:40}})})]})}function rr({amount:t,onAmountChange:a,currencyCode:r,isBuy:n,onOpenModal:o,assetBaseUrl:l,error:u,fieldLocks:s,onBlur:d,inputRef:c,chainCode:h,chainDisplay:p,getChainIconUrl:f,shaking:y,onFocus:j}){var x,k,D;const N=U();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`flex flex-col gap-[20px] p-4 card-hover${y?" error-shake":""}`,style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius)",...u?{border:"1px solid var(--t-error)"}:{}},children:[e.jsx("div",{className:"text-[16px]",style:{color:"var(--t-text-secondary)",lineHeight:"16px"},children:N("spend.label")}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("input",{ref:c,type:"text",value:t,onChange:a,onFocus:j,onBlur:d,placeholder:N(n?"spend.placeholderFiat":"spend.placeholderCrypto"),className:"bg-transparent outline-none w-0 flex-1 mr-3",style:{color:"var(--t-text)",fontSize:24,fontWeight:500,lineHeight:"32px",padding:0,border:"none",borderRadius:0,backgroundColor:"transparent",height:"auto",width:0},inputMode:"decimal",disabled:!!((x=s==null?void 0:s.sourceAmount)!=null&&x.locked)}),n?e.jsxs("button",{onClick:o,className:"flex items-center gap-[4px] shrink-0 transition-colors",style:{background:"var(--t-pill-solid-bg)",borderRadius:"var(--t-pill-radius)",paddingLeft:4,paddingRight:8,paddingTop:4,paddingBottom:4,border:"1px solid var(--t-pill-solid-border)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},disabled:!!((k=s==null?void 0:s.sourceCurrency)!=null&&k.locked),children:[e.jsx(vt,{currencyCode:r,size:24,baseUrl:l}),e.jsx("span",{className:"text-[14px] font-semibold",style:{color:"var(--t-text)",letterSpacing:"0.14px",lineHeight:"24px"},children:r}),e.jsx(xe,{})]}):e.jsxs("div",{className:"flex flex-col items-end shrink-0",children:[e.jsxs("button",{onClick:o,className:"flex items-center gap-[4px] transition-colors",style:{background:"var(--t-pill-solid-bg)",borderRadius:"var(--t-pill-radius)",paddingLeft:4,paddingRight:8,paddingTop:4,paddingBottom:4,border:"1px solid var(--t-pill-solid-border)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},disabled:!!((D=s==null?void 0:s.destinationCurrency)!=null&&D.locked),children:[e.jsx(Kt,{ticker:r,size:24,baseUrl:l}),e.jsx("span",{className:"text-[14px] font-semibold",style:{color:"var(--t-text)",letterSpacing:"0.14px",lineHeight:"24px"},children:r}),e.jsx(xe,{})]}),h&&f&&e.jsxs("div",{className:"flex items-center gap-1 mt-1.5 mr-0.5",children:[e.jsx("div",{className:"rounded-full",style:{width:14,height:14,background:"#ffffff"},children:e.jsx("img",{src:f(h,l),alt:h,width:14,height:14,className:"rounded-full",style:{width:14,height:14}})}),e.jsx("span",{className:"text-[12px]",style:{color:"var(--t-text-secondary)"},children:p})]})]})]})]}),u&&e.jsx("div",{className:"text-[12px] mt-1.5 text-center",style:{color:"var(--t-error)"},children:u})]})}function nr({char:t,height:a=38}){const r="0123456789",n=r.indexOf(t);return n===-1?e.jsx("span",{style:{display:"inline-block",textAlign:"center"},children:t}):e.jsx("span",{className:"digit-slot",style:{height:a,lineHeight:`${a}px`,textAlign:"center"},children:e.jsx("span",{className:"digit-slot-inner block",style:{transform:`translateY(-${n*a}px)`},children:r.split("").map(o=>e.jsx("span",{className:"block",style:{height:a,lineHeight:`${a}px`},children:o},o))})})}function or({value:t,height:a=38,className:r="",style:n={}}){return e.jsx("span",{className:r,style:{display:"inline-flex",fontVariantNumeric:"tabular-nums",...n},children:t.split("").map((o,l)=>e.jsx(nr,{char:o,height:a},l))})}function sr({amount:t,currencyCode:a,chainCode:r,chainDisplay:n,isBuy:o,onOpenModal:l,displayRate:u,assetBaseUrl:s,quotesLoading:d,onOpenRateBreakdown:c,fieldLocks:h,spendNumeric:p,getChainIconUrl:f,autoSelectPending:y,rateFlash:j}){var x,k;const N=U();return e.jsx("div",{className:"p-4 card-hover",style:{borderRadius:"var(--t-card-radius)",border:"1.5px solid var(--t-card-border)",background:"transparent"},children:e.jsxs("div",{className:"flex flex-col gap-[20px]",children:[e.jsx("div",{className:"text-[16px]",style:{color:"var(--t-text-secondary)",lineHeight:"16px"},children:N("receive.label")}),e.jsxs("div",{className:"flex flex-col gap-[8px]",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{className:j?"rate-flash":"",children:e.jsx(or,{value:p>0?t:"0",height:32,className:"font-medium",style:{color:p>0?"var(--t-text)":"var(--t-text-muted)",fontSize:24}})}),o?e.jsx("div",{className:"flex flex-col items-end shrink-0",children:e.jsxs("button",{onClick:l,className:"flex items-center gap-[4px] transition-colors",style:{background:"var(--t-pill-solid-bg)",borderRadius:"var(--t-pill-radius)",paddingLeft:4,paddingRight:8,paddingTop:4,paddingBottom:4,border:"1px solid var(--t-pill-solid-border)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},disabled:!!((x=h==null?void 0:h.destinationCurrency)!=null&&x.locked),children:[e.jsx(Kt,{ticker:a,size:24,baseUrl:s}),e.jsx("span",{className:"text-[14px] font-semibold",style:{color:"var(--t-text)",letterSpacing:"0.14px",lineHeight:"24px"},children:a}),e.jsx(xe,{})]})}):e.jsxs("button",{onClick:l,className:"flex items-center gap-[4px] shrink-0 transition-colors",style:{background:"var(--t-pill-solid-bg)",borderRadius:"var(--t-pill-radius)",paddingLeft:4,paddingRight:8,paddingTop:4,paddingBottom:4,border:"1px solid var(--t-pill-solid-border)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},disabled:!!((k=h==null?void 0:h.sourceCurrency)!=null&&k.locked),children:[e.jsx(vt,{currencyCode:a,size:24,baseUrl:s}),e.jsx("span",{className:"text-[14px] font-semibold",style:{color:"var(--t-text)",letterSpacing:"0.14px",lineHeight:"24px"},children:a}),e.jsx(xe,{})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex items-center gap-[4px]",children:d&&!y?e.jsxs(e.Fragment,{children:[e.jsx(fe,{size:12}),e.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--t-text-muted)",letterSpacing:"0.22px",lineHeight:"12px"},children:N("receive.fetchingRate")})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--t-text-muted)",letterSpacing:"0.22px",lineHeight:"12px"},children:u||" "}),u&&e.jsx("button",{onClick:c,className:"flex items-center justify-center opacity-60 hover:opacity-100 transition-opacity",children:e.jsx(pt,{size:12})})]})}),o&&r&&f&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"rounded-full",style:{width:12,height:12,background:"#ffffff"},children:e.jsx("img",{src:f(r,s),alt:r,width:12,height:12,className:"rounded-full",style:{width:12,height:12}})}),e.jsx("span",{className:"text-[11px]",style:{color:"var(--t-text-secondary)",letterSpacing:"0.22px",lineHeight:"12px"},children:n})]})]})]})]})})}function ir({selectedMethod:t,onOpenModal:a,getMethodIcon:r,getMethodDisplayName:n}){const o=U();return e.jsxs("div",{role:"button",tabIndex:0,onClick:a,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&a()},className:"flex items-center gap-[4px] p-4 transition-colors cursor-pointer card-press card-hover",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius)"},children:[e.jsx("span",{className:"text-[13px] flex-1",style:{color:"var(--t-text-secondary)",letterSpacing:"0.13px",lineHeight:"20px"},children:o("payment.label")}),e.jsxs("span",{className:"flex items-center gap-[6px]",children:[t&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"flex items-center justify-center",style:{width:20,height:20},children:r(t.id,t.icon,20)}),e.jsx("span",{className:"text-[14px] font-semibold",style:{color:"var(--t-text)",letterSpacing:"0.14px",lineHeight:"16px"},children:n(t.id,t.name)})]}),!t&&e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-muted)"},children:o("payment.select")}),e.jsx(xe,{})]})]})}function kn({selectedQuote:t,quotesLoading:a,onOpenModal:r,assetBaseUrl:n=""}){const o=U();return e.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&r()},className:"flex items-center gap-[4px] p-4 transition-colors cursor-pointer card-press card-hover",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius)"},children:[e.jsx("span",{className:"text-[13px] flex-1",style:{color:"var(--t-text-secondary)",letterSpacing:"0.13px",lineHeight:"20px"},children:o("provider.label")}),e.jsxs("span",{className:"flex items-center gap-[6px]",children:[a&&!t&&e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-muted)"},children:"..."}),!a&&!t&&e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-muted)"},children:o("provider.select")}),t&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"flex items-center justify-center overflow-hidden rounded-full",style:{width:20,height:20},children:e.jsx("img",{src:La(t.gatewayId,n),alt:"",width:20,height:20,className:"rounded-full",style:{width:20,height:20,objectFit:"cover"},onError:l=>{t.gatewayLogo&&l.target.src!==t.gatewayLogo&&(l.target.src=t.gatewayLogo)}})}),e.jsx("span",{className:"text-[14px] font-semibold",style:{color:"var(--t-text)",letterSpacing:"0.14px",lineHeight:"16px"},children:t.gatewayName})]}),e.jsx(xe,{})]})]})}function wn(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:e.jsx("path",{d:"M8 1l2.12 4.3 4.74.69-3.43 3.34.81 4.72L8 11.77l-4.24 2.28.81-4.72L1.14 5.99l4.74-.69L8 1z",fill:"var(--t-success)"})})}function Nn(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:[e.jsx("path",{d:"M14 7.5a6 6 0 11-12 0 6 6 0 0112 0z",stroke:"var(--t-accent)",strokeWidth:"1.5"}),e.jsx("path",{d:"M5.5 8l2 2 3.5-4",stroke:"var(--t-accent)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Rn({quote:t}){const a=U();return t.isBestRate?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(wn,{}),e.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--t-success)"},children:a("modal.bestPrice")})]}):t.isRecommended?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Nn,{}),e.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--t-accent)"},children:a("modal.recommended")})]}):t.rank&&t.rank<=3?e.jsxs("div",{className:"text-[11px]",style:{color:"var(--t-text-muted)"},children:["#",t.rank]}):null}function ha({gatewayId:t,gatewayLogo:a,assetBaseUrl:r=""}){const n=La(t,r);return e.jsx("span",{className:"rounded-full shrink-0 overflow-hidden inline-flex items-center justify-center",style:{width:36,height:36},children:e.jsx("img",{src:n,alt:"",width:36,height:36,className:"rounded-full",style:{width:36,height:36,objectFit:"cover"},onError:o=>{a&&o.target.src!==a&&(o.target.src=a)}})})}function En({pct:t}){if(t===0)return null;const a=t>0?"var(--t-success)":"var(--t-error)",r=t>0?"+":"";return e.jsxs("span",{className:"text-[11px] font-medium",style:{color:a},children:[r,t.toFixed(2),"%"]})}function An(){return e.jsx("div",{className:"space-y-3",children:[0,1,2].map(t=>e.jsxs("div",{className:"w-full flex items-center gap-3.5 modal-item-in",style:{borderRadius:5,height:64,paddingLeft:16,paddingRight:16,background:"var(--t-surface)",animationDelay:`${t*45}ms`},children:[e.jsx(V,{w:36,h:36,className:"rounded-full shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(V,{w:90,h:14,className:"mb-1.5"}),e.jsx(V,{w:60,h:12})]}),e.jsxs("div",{className:"text-right",children:[e.jsx(V,{w:40,h:10,className:"mb-1.5"}),e.jsx(V,{w:80,h:14})]})]},t))})}function lr({onClose:t,onSelect:a,quotes:r,quotesLoading:n,cryptoCurrency:o,selectedGatewayId:l,assetBaseUrl:u=""}){const s=U(),[d,c]=i.useState(""),h=i.useMemo(()=>{if(!(r!=null&&r.quotes))return[];const f=d.trim().toLowerCase();return f?r.quotes.filter(y=>y.gatewayName.toLowerCase().includes(f)):r.quotes},[r,d]),p=i.useMemo(()=>{const f=h.find(y=>parseFloat(y.cryptoAmount)>0);return f?parseFloat(f.cryptoAmount):0},[h]);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex justify-end px-5 pt-5",children:e.jsx(je,{onClick:t})}),e.jsx("h2",{className:"text-center text-[17px] font-medium mt-2 mb-6",style:{color:"var(--t-text)",fontSize:17,fontWeight:500,marginTop:8,marginBottom:24},children:s("modal.chooseRamp")}),e.jsx(Ue,{value:d,onChange:c}),e.jsxs("div",{className:"flex-1 overflow-y-auto custom-scroll px-5 space-y-3",children:[n?e.jsx(An,{}):h.length===0?e.jsx("div",{className:"text-center py-10 text-[14px]",style:{color:"var(--t-text-muted)"},children:r&&r.quotes.length===0?s("modal.noQuotes"):s("modal.noProvidersFound")}):h.map((f,y)=>{const j=y===0,N=l===f.gatewayId,x=parseFloat(f.cryptoAmount),k=x>0,D=x>=1?x.toFixed(4):x.toPrecision(6),G=!j&&p>0?(x-p)/p*100:0;return e.jsxs("button",{onClick:()=>k&&a(f),className:`w-full flex items-center gap-3 transition-colors modal-item-in${k?" card-press hover-item":""}`,style:{borderRadius:"var(--t-card-radius)",padding:"12px 16px",border:N&&k?"1.5px solid var(--t-accent)":"1.5px solid transparent",background:"var(--t-surface)",opacity:k?1:.45,cursor:k?"pointer":"default",animationDelay:`${Math.min(y*45,350)}ms`},children:[e.jsx(ha,{gatewayId:f.gatewayId,gatewayLogo:f.gatewayLogo,assetBaseUrl:u}),e.jsxs("div",{className:"text-left flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-[14px] leading-[18px]",style:{color:"var(--t-text)"},children:f.gatewayName}),k&&e.jsx(Rn,{quote:f})]}),e.jsx("div",{className:"text-right shrink-0",children:k?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] leading-[14px]",style:{color:"var(--t-text-secondary)"},children:j?s("receive.label"):e.jsx(En,{pct:G})}),e.jsxs("div",{className:"font-medium text-[13px] leading-[18px]",style:{color:"var(--t-text)"},children:[e.jsx("span",{className:"text-[10px] font-normal",style:{color:"var(--t-text-secondary)"},children:o})," ",D]})]}):e.jsx("span",{className:"text-[11px]",style:{color:"var(--t-text-muted)"},children:s("rate.noQuote")})})]},f.gatewayId)}),!n&&(r==null?void 0:r.unavailableGateways)&&r.unavailableGateways.length>0&&e.jsx("div",{className:"pt-2 space-y-1.5",children:r.unavailableGateways.map((f,y)=>e.jsxs("div",{className:"flex items-center gap-3 modal-item-in",style:{borderRadius:"var(--t-card-radius)",padding:"10px 16px",background:"var(--t-surface)",opacity:.45,animationDelay:`${Math.min((h.length+y)*45,500)}ms`},children:[e.jsx(ha,{gatewayId:f.gatewayId,assetBaseUrl:u}),e.jsx("div",{className:"text-left flex-1 min-w-0",children:e.jsx("div",{className:"font-medium text-[14px] leading-[18px]",style:{color:"var(--t-text)"},children:f.gatewayName})}),e.jsx("div",{className:"text-right shrink-0",children:e.jsx("span",{className:"text-[11px]",style:{color:"var(--t-text-muted)"},children:f.reason})})]},f.gatewayId))})]})]})}function cr({address:t,onChange:a,placeholder:r,error:n,validating:o,disabled:l,onFocus:u,onBlur:s,focused:d}){const c=U(),h=o&&t.trim().length>=10,[p,f]=i.useState(!1),y=i.useRef(n);return i.useEffect(()=>{if(n&&!y.current){f(!0);const j=setTimeout(()=>f(!1),400);return()=>clearTimeout(j)}y.current=n},[n]),e.jsxs("div",{children:[e.jsxs("div",{className:`flex flex-col gap-[4px] p-4 card-hover${p?" error-shake":""}`,style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius)"},children:[e.jsx("div",{className:"text-[13px]",style:{color:"var(--t-text-secondary)",letterSpacing:"0.13px",lineHeight:"20px"},children:c("wallet.label")}),e.jsxs("div",{className:"relative flex items-center",children:[e.jsx("input",{type:"text",value:t,onChange:j=>a(j.target.value),onFocus:u,onBlur:s,placeholder:r,spellCheck:!1,autoComplete:"off",className:"w-full bg-transparent text-[13px] outline-none",style:{color:"var(--t-text)",border:"none",padding:0,paddingRight:h?24:0,fontSize:13,lineHeight:"20px",letterSpacing:"0.13px",backgroundColor:"transparent"},disabled:l}),h&&e.jsx("div",{className:"absolute right-0 top-0 bottom-0 flex items-center",children:e.jsx(fe,{size:14})}),!t&&d&&!l&&e.jsx("div",{className:"absolute left-0 top-0 bottom-0 flex items-center",style:{pointerEvents:"none"},children:e.jsx("div",{style:{width:1,height:16,background:"var(--t-text)",animation:"fadeIn 0.5s ease-in-out infinite alternate"}})})]})]}),n&&e.jsx("div",{className:"text-[12px] mt-1.5 text-center",style:{color:"var(--t-error)"},children:n})]})}function dr({label:t,disabled:a,loading:r,onClick:n}){return e.jsx("button",{disabled:a,onClick:n,className:"w-full font-medium text-[18px] transition-all duration-150 cta-btn",style:{padding:"12px 24px",lineHeight:"28px",borderRadius:"var(--t-cta-radius)",background:"var(--t-cta-bg)",color:"var(--t-cta-text)",opacity:a?.4:1,cursor:a?"not-allowed":"pointer"},children:e.jsxs("span",{className:"flex items-center justify-center gap-2",children:[t,r&&e.jsx("div",{style:{width:18,height:18,border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",animation:"nramp-spin 0.8s linear infinite",opacity:.6}})]})})}function ur(){const t=U();return e.jsxs("div",{className:"text-center py-3",style:{height:16,lineHeight:"16px"},children:[e.jsx("span",{style:{fontSize:9,opacity:.5,color:"var(--t-text)",letterSpacing:"0.27px"},children:t("footer.poweredBy")}),e.jsx("span",{style:{fontSize:9,opacity:.65,color:"var(--t-text)",letterSpacing:"0.27px"},children:t("footer.brand")})]})}function mr({quote:t,isOpen:a,onClose:r,countdown:n,quotesLoading:o}){var c,h;const l=U();if(!a)return null;const u=p=>String(p).padStart(2,"0"),s=(t==null?void 0:t.fiatCurrency)==="USD"?"$":(t==null?void 0:t.fiatCurrency)==="EUR"?"€":(t==null?void 0:t.fiatCurrency)==="GBP"?"£":t!=null&&t.fiatCurrency?`${t.fiatCurrency} `:"$",d=p=>{const f=typeof p=="string"?parseFloat(p):p;return isNaN(f)?`${s}0.00`:`${s}${f.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`};return e.jsxs("div",{className:"px-5 py-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("div",{className:"flex items-center gap-2",children:o?e.jsx(fe,{size:16}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[12px]",style:{color:"var(--t-text-muted)"},children:l("rate.updatesInLabel")}),e.jsxs("span",{className:"text-[12px] font-medium px-2 py-0.5 rounded-full",style:{color:"var(--t-text)",border:"1px solid var(--t-border)"},children:["00:",u(n)]}),e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"flex items-center justify-center opacity-60 hover:opacity-100 transition-opacity cursor-help","aria-label":l("rate.rateTooltip"),children:e.jsx(pt,{size:12})}),e.jsx("div",{className:"info-tooltip pointer-events-none absolute left-1/2 z-50 w-[200px] px-3 py-2 rounded-xl text-[11px] leading-snug font-medium opacity-0 group-hover:opacity-100 transition-opacity duration-200",style:{background:"var(--t-tooltip-bg)",color:"var(--t-tooltip-text)",top:"calc(100% + 8px)",transform:"translateX(-50%)"},children:l("rate.rateTooltip")})]})]})}),e.jsx("button",{onClick:r,className:"flex items-center justify-center rounded-full transition-opacity hover:opacity-70",style:{width:28,height:28,background:"var(--t-surface)",color:"var(--t-text)"},children:e.jsx(ht,{size:10})})]}),t?e.jsxs("div",{className:"flex flex-col gap-4",children:[t.exchangeRate&&e.jsx("div",{className:"text-[28px] font-semibold",style:{color:"var(--t-text)"},children:d(t.exchangeRate)}),((c=t.fees)==null?void 0:c.processingFee)&&e.jsxs("div",{children:[e.jsxs("span",{className:"text-[13px] block mb-0.5",style:{color:"var(--t-text-secondary)"},children:[l("rate.processingFee"),t.fees.feePercentage?` ${l("rate.feeIncluded",{percentage:Math.round(parseFloat(String(t.fees.feePercentage))*100)/100})}`:""]}),e.jsx("span",{className:"text-[15px] font-semibold",style:{color:"var(--t-text)"},children:d(t.fees.processingFee)})]}),((h=t.fees)==null?void 0:h.networkFee)&&e.jsxs("div",{children:[e.jsxs("span",{className:"flex items-center gap-1 text-[13px] mb-0.5",style:{color:"var(--t-text-secondary)"},children:[l("rate.networkFeeIncl"),e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"flex items-center justify-center opacity-60 hover:opacity-100 transition-opacity cursor-help","aria-label":l("rate.networkFeeTooltip"),children:e.jsx(pt,{size:12})}),e.jsx("div",{className:"info-tooltip pointer-events-none absolute left-1/2 z-50 w-[220px] px-3 py-2 rounded-xl text-[11px] leading-snug font-medium opacity-0 group-hover:opacity-100 transition-opacity duration-200",style:{background:"var(--t-tooltip-bg)",color:"var(--t-tooltip-text)",bottom:"calc(100% + 8px)",transform:"translateX(-50%)"},children:l("rate.networkFeeTooltip")})]})]}),e.jsxs("span",{className:"text-[15px] font-semibold",style:{color:"var(--t-text)"},children:[d(t.fees.networkFee),t.exchangeRate&&e.jsxs("span",{className:"text-[13px] font-normal ml-1.5",style:{color:"var(--t-text-muted)"},children:["(",(parseFloat(t.fees.networkFee)/parseFloat(t.exchangeRate)).toFixed(8)," ",t.cryptoCurrency,")"]})]})]})]}):e.jsx("div",{className:"text-[13px] py-4 text-center",style:{color:"var(--t-text-muted)"},children:l("rate.noQuote")})]})}function Tn({className:t="",theme:a="dark",skinId:r="mono",accentColor:n,bgColor:o,bgImage:l,borderColor:u,borderRadius:s,surfaceColor:d,inputBgColor:c,textColor:h,textSecondaryColor:p,textMutedColor:f,successColor:y,showFlowToggle:j=!0,showSettings:N=!0,showThemeToggle:x=!0,autoRedirect:k=!1,explorerUrl:D,doneButtonText:G,supportEmail:$,stablecoinParity:ee,partnerName:Z,containerHeight:Y,locale:ge,onDone:Q}){var na,oa;const A=U(),{state:C,dispatch:T,config:m,configLoading:L,quotes:w,quotesLoading:b,quotesError:z,fetchQuotes:ie,createOrder:ve,orderLoading:ke,amountError:le,fieldLocks:te,apiConfig:ae,assetBaseUrl:K,availableFiats:ce,availableCryptos:We,availablePaymentMethods:q,selectionUnsupported:de,quotesEmpty:O,bestUnavailableReason:De}=Me(),{locale:Ge,setLocale:Ct}=gt(),[re,Be]=i.useState(a==="dark"),[we,bt]=i.useState(r),[ne,P]=i.useState(null),[tt,_]=i.useState(!1),[St,$e]=i.useState(!1),[Ne,at]=i.useState(!1),[Pe,Ze]=i.useState(!1),[Xe,Re]=i.useState(null),[Ye,jt]=i.useState(!0),[kt,rt]=i.useState(!1),[v,R]=i.useState(!1),[E,I]=i.useState(!1),[F,B]=i.useState(null),[oe,ue]=i.useState(!1),[hr,wt]=i.useState(30),[fr,$t]=i.useState(!1),[xr,Zt]=i.useState(!1),yr=i.useRef(null),Nt=i.useRef(),Rt=i.useRef(C.flowType),gr=Y??640,Xt=i.useRef(w);i.useEffect(()=>{w&&w!==Xt.current&&I(!1),Xt.current=w},[w]),i.useEffect(()=>{b&&!E&&T({type:"CLEAR_QUOTE"})},[b,E,T]),i.useEffect(()=>{E||v||w!=null&&w.bestQuote&&T({type:"SELECT_QUOTE",quote:w.bestQuote})},[w==null?void 0:w.bestQuote,E,v,T]),i.useEffect(()=>{Be(a==="dark")},[a]),i.useEffect(()=>{const g=setTimeout(()=>jt(!1),L?0:800);return()=>clearTimeout(g)},[L]),i.useEffect(()=>{if(Rt.current!==C.flowType&&!Ye){Rt.current=C.flowType,rt(!0),_(!1),$e(!1);const g=setTimeout(()=>rt(!1),350);return()=>clearTimeout(g)}Rt.current=C.flowType},[C.flowType,Ye]);const nt=C.flowType,M=nt==="buy",J=C.cryptoCurrency||"BTC",me=C.fiatCurrency||"USD",Et=M?C.fiatAmount:C.cryptoAmount,X=Ia(Et),pe=C.selectedQuote||(w==null?void 0:w.bestQuote)||null,Ce=pe!=null&&pe.exchangeRate?parseFloat(pe.exchangeRate):null,Qe=i.useRef(null);Ce&&J&&me&&(Qe.current={rate:Ce,crypto:J,fiat:me}),i.useEffect(()=>{(O||z)&&(Qe.current=null)},[O,z]),i.useEffect(()=>{X||(ue(!1),C.selectedQuote&&T({type:"CLEAR_QUOTE"}))},[X,C.selectedQuote,T]);const Ee=i.useMemo(()=>{if(pe){const g=M?pe.cryptoAmount:pe.fiatAmount;if(g)return g}return"0"},[pe,M]),At=i.useRef(Ee);i.useEffect(()=>{if(Ee!==At.current&&Ee!=="0"&&At.current!=="0"){$t(!0);const g=setTimeout(()=>$t(!1),500);return()=>clearTimeout(g)}At.current=Ee},[Ee]);const ze=!!(ee&&Z&&M&&_t(J)&&Ce),vr=ze&&J.toUpperCase().includes(me.toUpperCase()),Yt=ze&&X>0?mt(vr?X:X/Ce):null,Cr=ze&&Yt?Yt:Ee,br=i.useMemo(()=>{var W,Te,_e;const g=Ce||((W=Qe.current)==null?void 0:W.rate),S=Ce?J:(Te=Qe.current)==null?void 0:Te.crypto,H=Ce?me:(_e=Qe.current)==null?void 0:_e.fiat;return!g||!S||!H?"":`1 ${S} ≈ ${g.toFixed(2)} ${H}`},[J,me,Ce]);i.useEffect(()=>{const g=C.walletAddress.trim(),S=C.network;if(!g||g.length<10){Re(null),T({type:"SET_WALLET_ERROR",message:""});return}Ze(!0),Re(null);const H=new AbortController;return clearTimeout(Nt.current),Nt.current=setTimeout(async()=>{var W,Te,_e;try{const It=await(await fetch(`${ae.apiUrl}/public/validate/address`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:g,...S?{network:S}:{}}),signal:H.signal})).json(),Mt=((W=It.data)==null?void 0:W.attributes)||It.data||It;if(Mt.isValid)Re(!0),T({type:"SET_WALLET_ERROR",message:""});else{Re(!1);const Hr=((Te=Mt.errors)==null?void 0:Te[0])||((_e=Mt.details)==null?void 0:_e.formatMessage)||A("wallet.invalidServer");T({type:"SET_WALLET_ERROR",message:Hr})}}catch(Lt){if(Lt instanceof DOMException&&Lt.name==="AbortError")return;Re(null)}finally{H.signal.aborted||Ze(!1)}},500),()=>{clearTimeout(Nt.current),H.abort()}},[C.walletAddress,C.network,ae.apiUrl]);const ot=!Et||X===0,Tt=X>0&&(M?X<ca:X<da),Sr=!!le||Tt||tt&&ot,jr=X>0&&!le&&!Tt,Qt=C.walletAddress.trim().length>=10&&Xe!==!1&&!Pe,zt=jr&&(M?Qt:!0)&&!!C.cryptoCurrency&&!!C.network,kr=g=>{let S=g.target.value.replace(/[^0-9.,]/g,"");const H=M?2:6,W=S.indexOf(".");W!==-1&&S.length-W-1>H&&(S=S.slice(0,W+H+1)),T(M?{type:"SET_FIAT_AMOUNT",amount:S}:{type:"SET_CRYPTO_AMOUNT",amount:S})},wr=g=>{g!==nt&&T({type:"SET_FLOW_TYPE",flowType:g,fieldLocks:te})},Nr=i.useCallback(g=>{T({type:"SET_FIAT_CURRENCY",currency:g})},[T]),Rr=i.useCallback((g,S)=>{T({type:"SET_CRYPTO_CURRENCY",currency:g}),T({type:"SET_CRYPTO_CHAIN",chain:S})},[T]),Er=i.useCallback(g=>{T({type:"SET_PAYMENT_METHOD",methodId:g})},[T]),Ar=i.useCallback(g=>{T({type:"SET_COUNTRY",country:g}),P(null)},[T]),Tr=i.useCallback(()=>{P(null),setTimeout(()=>P("country"),280)},[]),Fr=i.useCallback(()=>{P(null),setTimeout(()=>P("language"),280)},[]),Lr=C.country?(na=xt[C.country.toLowerCase()])==null?void 0:na.name:void 0,Ir=()=>{if(!zt){(Sr||ot)&&(_(!0),Zt(!0),setTimeout(()=>Zt(!1),400));return}if(C.selectedQuote){ve().catch(g=>{B({type:"error",title:A("toast.orderFailed"),desc:g instanceof Error?g.message:A("toast.couldNotCreate")})});return}R(!0),ie()};i.useEffect(()=>{var g;if(!(!v||b)){if(w!=null&&w.bestQuote)R(!1),T({type:"SELECT_QUOTE",quote:w.bestQuote}),ve().catch(S=>{B({type:"error",title:A("toast.orderFailed"),desc:S instanceof Error?S.message:A("toast.couldNotCreate")})});else if(z){R(!1);const S=z.message||A("error.noProviders");T({type:"SET_ERROR",message:S}),B({type:"error",title:A("toast.quoteError"),desc:S})}else if(w&&!w.bestQuote){R(!1);const S=(g=w.unavailableGateways)==null?void 0:g.map(W=>W.reason).filter(Boolean),H=S!=null&&S.length?`${A("error.noProviders")}: ${S.join("; ")}`:A("error.noProviders");T({type:"SET_ERROR",message:H}),B({type:"error",title:A("toast.noProviders"),desc:H})}}},[v,w,b,z,T,ve]);const Jt=i.useRef(C.step);i.useEffect(()=>{const g=Jt.current;Jt.current=C.step,g!==C.step&&(C.step==="checkout"?B({type:"success",title:A("toast.orderCreated"),desc:A("toast.redirecting")}):C.step==="error"&&C.errorMessage&&B({type:"error",title:A("toast.somethingWrong"),desc:C.errorMessage}))},[C.step,C.errorMessage]);const He=C.step==="amount";i.useEffect(()=>{He||ue(!1)},[He]),i.useEffect(()=>{if(!oe||!He)return;wt(30);const g=setInterval(()=>{wt(S=>S<=1?(ie(),30):S-1)},1e3);return()=>clearInterval(g)},[oe,He,ie]),i.useEffect(()=>{oe&&He&&!b&&wt(30)},[b,oe,He]);const qt=re?"theme-dark":"theme-light",st=Dt.find(g=>g.id===we)||Dt[0],Mr=st.accent===null,Ur=n?he(n):!1,ea=g=>{const S=g.replace("#",""),H=parseInt(S.substring(0,2),16),W=parseInt(S.substring(2,4),16),Te=parseInt(S.substring(4,6),16);return(.299*H+.587*W+.114*Te)/255>.5?"#000000":"#ffffff"},ta=Ur?{"--t-accent":n,"--t-cta-bg":n,"--t-cta-text":ea(n)}:Mr?{"--t-accent":re?"#ffffff":"#111111","--t-cta-bg":re?"#ffffff":"#111111","--t-cta-text":re?"#000000":"#ffffff"}:{"--t-accent":st.accent,"--t-cta-bg":st.accent,"--t-cta-text":ea(st.accent)},se={};d&&he(d)&&(se["--t-surface"]=d,se["--t-modal-bg"]=d),c&&he(c)&&(se["--t-pill-bg"]=c,se["--t-close-bg"]=c),h&&he(h)&&(se["--t-text"]=h),p&&he(p)&&(se["--t-text-secondary"]=p),f&&he(f)&&(se["--t-text-muted"]=f,se["--t-text-tertiary"]=f),y&&he(y)&&(se["--t-success"]=y);const Ae={};o&&he(o)?Ae.backgroundColor=o:Ae.backgroundColor="var(--t-bg)",l&&(l.startsWith("https://")||l.startsWith("data:image/"))&&(Ae.backgroundImage=`url(${l})`,Ae.backgroundSize="cover",Ae.backgroundPosition="center");const it={};u&&he(u)&&(it.border=`1px solid ${u}`),s&&(it.borderRadius=s);const Je=C.network,Oe=Je?dt(Je):null,aa=(Oe==null?void 0:Oe.shortName)||(Oe==null?void 0:Oe.name)||Je,Dr=le||(tt&&(Tt||ot)?ot?A("error.amountZero"):M?A("error.minAmountFiat",{min:String(ca),currency:me}):A("error.minAmountCrypto",{min:String(da),currency:J}):void 0),Br=C.walletError?C.walletError:St&&!Qt&&!Pe?A("wallet.invalid"):void 0,Ft=q.filter(g=>g.supportedFiats.includes(C.fiatCurrency)),Pr=Ft.find(g=>g.id===C.paymentMethodId)||Ft[0],ra=C.step==="checkout"?e.jsx(Na,{autoRedirect:k}):C.step==="processing"?e.jsx(Ra,{}):C.step==="complete"?e.jsx(Ea,{explorerUrl:D,doneButtonText:G,onDone:Q}):C.step==="error"?e.jsx(Aa,{supportEmail:$,onDone:Q,doneButtonText:G}):C.step==="confirm"?e.jsx(Ua,{stablecoinParity:ze,partnerName:Z}):null;return ra?e.jsx("div",{className:`${qt} relative w-full max-w-[390px] overflow-hidden flex flex-col select-none transition-colors duration-[400ms] ${t}`,style:{fontFamily:"'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",height:gr,borderRadius:"var(--t-container-radius)",...Ae,...ta,...se,...it},children:ra}):e.jsxs("div",{className:`${qt} relative w-full max-w-[390px] overflow-hidden flex flex-col select-none transition-colors duration-[400ms] ${t}`,style:{fontFamily:"'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",minHeight:640,borderRadius:"var(--t-container-radius)",...Ae,...ta,...se,...it},children:[e.jsx(ar,{tab:nt,onTabSwitch:wr,showFlowToggle:j,showSettings:N,onOpenSettings:()=>P("settings"),darkMode:re}),Ye||kt||L?e.jsx("div",{className:"pt-[88px] px-3 flex-1 flex flex-col",children:L?e.jsx(Da,{}):e.jsx(Ya,{})}):e.jsxs("div",{className:"flex-1 overflow-hidden pt-[88px] px-3 flex flex-col gap-1 tab-fade-in",children:[e.jsx(rr,{amount:Et,onAmountChange:kr,currencyCode:M?me:J,isBuy:M,onOpenModal:()=>P(M?"fiat":"crypto"),assetBaseUrl:K,error:Dr,fieldLocks:te,onBlur:()=>_(!0),inputRef:yr,chainCode:M?void 0:Je,chainDisplay:M?void 0:aa,getChainIconUrl:M?void 0:ut,shaking:xr}),e.jsx(sr,{amount:Cr,currencyCode:M?J:me,chainCode:M?Je:void 0,chainDisplay:M?aa:void 0,isBuy:M,onOpenModal:()=>P(M?"crypto":"fiat"),displayRate:br,assetBaseUrl:K,quotesLoading:b,onOpenRateBreakdown:()=>{X>0&&ue(!0)},fieldLocks:te,spendNumeric:X,getChainIconUrl:M?ut:void 0,autoSelectPending:v,rateFlash:fr}),O&&X>0&&e.jsx("div",{className:"px-4 py-2.5 mt-1",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius)",fontSize:12,color:"var(--t-error)",lineHeight:"16px"},children:De||A("error.noProviders")}),ze&&X>0&&(w==null?void 0:w.bestQuote)&&e.jsxs("div",{className:"flex items-start gap-2 mt-1 px-4 py-2.5",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius)",fontSize:12,color:"var(--t-text-secondary)",lineHeight:"16px"},children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0,marginTop:1},children:[e.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M8 7v4M8 5.5v-.01",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),e.jsx("span",{children:A("parity.info",{receiveAmount:Ee,crypto:J,spendAmount:mt(X),fiat:me,partner:Z||""})})]}),(w||b)&&e.jsx(kn,{selectedQuote:C.selectedQuote,quotesLoading:b,onOpenModal:()=>P("provider"),assetBaseUrl:K}),(q.length>0||(m==null?void 0:m.paymentMethods)&&m.paymentMethods.length>0)&&(Ft.length>0?e.jsx(ir,{selectedMethod:Pr,onOpenModal:()=>P("payment"),darkMode:re,getMethodIcon:Gt,getMethodDisplayName:(g,S)=>Wt(g,S,A,!0)}):e.jsx("div",{className:"flex items-center justify-center px-4 mt-1",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius)",height:56},children:e.jsx("span",{className:"text-[12px]",style:{color:"var(--t-text-muted)"},children:A("payment.noneAvailable")})})),M&&e.jsx(cr,{address:C.walletAddress,onChange:g=>T({type:"SET_WALLET_ADDRESS",address:g}),placeholder:A("wallet.placeholderBuy"),isBuy:M,error:Br,validating:Pe,disabled:!!((oa=te==null?void 0:te.destinationAddress)!=null&&oa.locked),onFocus:()=>at(!0),onBlur:()=>{at(!1),$e(!0)},focused:Ne}),e.jsx("div",{className:"flex-1",style:{minHeight:16}}),de&&e.jsx("div",{className:"text-[12px] text-center mb-2",style:{color:"var(--t-error)"},children:A(M?"error.currencyUnavailableBuy":"error.currencyUnavailableSell")}),e.jsxs("div",{className:"flex flex-col gap-3 pb-3",children:[e.jsx(dr,{label:M?A("cta.buy",{crypto:J}):A("cta.sell",{crypto:J}),disabled:!zt||ke||v||de||O,loading:ke||v,onClick:Ir}),e.jsx(ur,{})]})]},nt),F&&e.jsx(Xa,{type:F.type,title:F.title,description:F.desc,visible:!!F,onDismiss:()=>B(null)}),e.jsx(Qa,{isOpen:oe,onClose:()=>ue(!1),children:e.jsx(mr,{quote:pe,isOpen:oe,onClose:()=>ue(!1),countdown:hr,quotesLoading:b})}),e.jsx(Se,{isOpen:ne==="fiat",onClose:()=>P(null),children:g=>e.jsx(za,{onClose:g,onSelect:S=>{Nr(S),g()},currencies:ce.map(S=>({code:S.code,name:S.code})),assetBaseUrl:K,selectedCode:C.fiatCurrency})}),e.jsx(Se,{isOpen:ne==="crypto",onClose:()=>P(null),children:g=>e.jsx(Ja,{onClose:g,onSelect:(S,H)=>{Rr(S,H),g()},cryptos:We.map(S=>{var H;return{code:S.code,name:S.code,networks:(H=S.networks)==null?void 0:H.map(W=>({code:W.id,name:W.name}))}}),assetBaseUrl:K,selectedCode:C.cryptoCurrency,selectedChain:C.network})}),e.jsx(Se,{isOpen:ne==="payment",onClose:()=>P(null),children:g=>e.jsx(vn,{methods:q,selectedId:C.paymentMethodId,onSelect:S=>{Er(S),g()},onClose:g})}),e.jsx(Se,{isOpen:ne==="provider",onClose:()=>P(null),children:g=>e.jsx(lr,{quotes:w,quotesLoading:b,cryptoCurrency:J,selectedGatewayId:C.selectedProvider,assetBaseUrl:K,onSelect:S=>{I(!0),T({type:"SELECT_QUOTE",quote:S}),g()},onClose:g})}),e.jsx(Se,{isOpen:ne==="settings",onClose:()=>P(null),variant:"right",children:g=>e.jsx(er,{onClose:g,darkMode:re,onToggleDarkMode:Be,skinId:we,onSelectSkin:S=>{bt(S)},showThemeToggle:x,country:C.country,countryName:Lr,onLocationPress:Tr,onLanguagePress:Fr,assetBaseUrl:K})}),e.jsx(Se,{isOpen:ne==="country",onClose:()=>P(null),children:g=>e.jsx(tr,{onClose:g,onSelect:S=>{Ar(S),g()},assetBaseUrl:K,selectedCode:C.country})}),e.jsx(Se,{isOpen:ne==="language",onClose:()=>P(null),children:g=>e.jsx(jn,{onClose:g,onSelect:S=>{Ct(S),g()},selectedCode:Ge})})]})}function pr({projectId:t,apiUrl:a,assetBaseUrl:r,flowType:n,customerId:o,brandId:l,defaultFiatCurrency:u,defaultCryptoCurrency:s,defaultNetwork:d,defaultFiatAmount:c,defaultCryptoAmount:h,defaultWalletAddress:p,defaultGateway:f,defaultCountry:y,fieldLocks:j,partnerMetadata:N,statusPollInterval:x,onComplete:k,onError:D,className:G,theme:$,skinId:ee,accentColor:Z,bgColor:Y,bgImage:ge,borderColor:Q,borderRadius:A,surfaceColor:C,inputBgColor:T,textColor:m,textSecondaryColor:L,textMutedColor:w,successColor:b,showFlowToggle:z,showSettings:ie,showThemeToggle:ve,autoRedirect:ke,explorerUrl:le,doneButtonText:te,supportEmail:ae,stablecoinParity:K,partnerName:ce,containerHeight:We,locale:q,onDone:de}){return e.jsx(ba,{projectId:t,apiUrl:a,assetBaseUrl:r,flowType:n,customerId:o,brandId:l,defaultFiatCurrency:u,defaultCryptoCurrency:s,defaultNetwork:d,defaultFiatAmount:c,defaultCryptoAmount:h,defaultWalletAddress:p,defaultGateway:f,defaultCountry:y,fieldLocks:j,partnerMetadata:N,statusPollInterval:x,onComplete:k,onError:D,children:e.jsx(ka,{defaultLocale:q||"en",children:e.jsx(Tn,{className:G,theme:$,skinId:ee,accentColor:Z,bgColor:Y,bgImage:ge,borderColor:Q,borderRadius:A,surfaceColor:C,inputBgColor:T,textColor:m,textSecondaryColor:L,textMutedColor:w,successColor:b,showFlowToggle:z,showSettings:ie,showThemeToggle:ve,autoRedirect:ke,explorerUrl:le,doneButtonText:te,supportEmail:ae,stablecoinParity:K,partnerName:ce,containerHeight:We,onDone:de})})})}function Fn({submitButtonText:t,rateRefreshInterval:a,...r}){return e.jsx(pr,{...r})}function Ln({skin:t,active:a,onClick:r,darkMode:n,dimmed:o}){const l=t.accent===null,u=32;return e.jsxs("button",{onClick:r,className:"relative shrink-0",style:{width:u,height:u,opacity:o?.4:1,transition:"opacity 0.2s"},children:[l?e.jsxs("svg",{width:u,height:u,viewBox:"0 0 32 32",children:[e.jsx("clipPath",{id:"mono-left",children:e.jsx("rect",{x:"0",y:"0",width:"16",height:"32"})}),e.jsx("clipPath",{id:"mono-right",children:e.jsx("rect",{x:"16",y:"0",width:"16",height:"32"})}),e.jsx("circle",{cx:"16",cy:"16",r:"15",fill:"#111111",clipPath:"url(#mono-left)"}),e.jsx("circle",{cx:"16",cy:"16",r:"15",fill:"#ffffff",clipPath:"url(#mono-right)"}),e.jsx("circle",{cx:"16",cy:"16",r:"15",fill:"none",stroke:n?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.1)",strokeWidth:"1"})]}):e.jsx("svg",{width:u,height:u,viewBox:"0 0 32 32",children:e.jsx("circle",{cx:"16",cy:"16",r:"15",fill:t.accent})}),a&&!o&&e.jsx("div",{className:"absolute inset-0 rounded-full",style:{boxShadow:"0 0 0 2px var(--t-bg), 0 0 0 4px var(--t-text)"}})]})}exports.AnimatedDigit=nr;exports.AnimatedNumber=or;exports.ApplePayIcon=tn;exports.ArrowUpIcon=mn;exports.BLOCKCHAINS=Ve;exports.BankIcon=en;exports.BottomSheet=Qa;exports.COUNTRIES=qe;exports.COUNTRY_MAP=xt;exports.CRYPTO_CHAIN_COMBOS=Ma;exports.CRYPTO_CURRENCIES=Ht;exports.CardIcon=on;exports.CheckmarkIcon=$a;exports.CheckoutForm=Fn;exports.CheckoutStep=Na;exports.ChevronDown=xe;exports.ChevronRight=Oa;exports.ChooseRampModal=lr;exports.CloseButton=je;exports.CoinifyIcon=sn;exports.CompleteStep=Ea;exports.ConfirmStep=Ua;exports.CountryPickerModal=tr;exports.CryptoCurrencyModal=Ja;exports.CryptoIcon=Kt;exports.CtaButton=dr;exports.DarkModeIcon=cn;exports.ErrorStep=Aa;exports.FIAT_CURRENCIES=Ut;exports.FIAT_TO_COUNTRY=Ta;exports.FiatCurrencyModal=za;exports.FiatFlag=vt;exports.Footer=ur;exports.FormSkeleton=Da;exports.GenericCoinIcon=Vt;exports.GooglePayIcon=an;exports.HeaderBar=ar;exports.I18nProvider=ka;exports.InfoIcon=pt;exports.LANGUAGES=Ie;exports.LoadingScreen=Ya;exports.MOCK_RATES=Bt;exports.MenuIcon=ln;exports.Modal=Se;exports.MoreDotsIcon=Ga;exports.NRLogo=ye;exports.NRLogoIcon=dn;exports.PayPalIcon=Ha;exports.PaymentAppleIcon=Va;exports.PaymentBankIcon=_a;exports.PaymentCard=ir;exports.PaymentCardsIcon=Ka;exports.PaymentGoogleIcon=Wa;exports.PaymentMethodSelector=gn;exports.ProcessingStep=Ra;exports.RampForm=pr;exports.RampProvider=ba;exports.RateBreakdown=mr;exports.ReceiveCard=sr;exports.RedirectScreen=wa;exports.RevolutIcon=Pa;exports.SKINS=Dt;exports.SearchIcon=un;exports.SearchInput=Ue;exports.SettingsScreen=er;exports.Skeleton=V;exports.SkinSwatch=Ln;exports.SpendCard=rr;exports.Spinner=fe;exports.Toast=Xa;exports.ToggleSwitch=qa;exports.WalletCard=cr;exports.XIcon=ht;exports.formatOutput=mt;exports.getChainIconUrl=ut;exports.getCryptoIconUrl=Ot;exports.getDefaultFiatForCountry=ct;exports.getFiatFlagUrl=Fa;exports.getMockRate=qr;exports.getPaymentIcon=Za;exports.isStablecoin=_t;exports.parseAmount=Ia;exports.useCheckoutIntent=ya;exports.useI18n=gt;exports.useQuotes=xa;exports.useRamp=Me;exports.useRampConfig=fa;exports.useT=U;exports.useTransaction=ga;
|
|
11
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),ft=require("@nowramp/sdk"),sa=require("react-dom");function fa(t,a,r){const[n,o]=i.useState(null),[l,u]=i.useState(!0),[s,d]=i.useState(null),c=i.useRef(null);(!c.current||c.current!==t)&&(c.current=new ft.RampApi({apiKey:"",...t}));const h=i.useCallback(async()=>{if(!t.projectId){d(new Error("projectId is required")),u(!1);return}u(!0),d(null);try{const p={};a&&(p.orderType=a),r&&(p.country=r);const f=await c.current.getSupported(p);o(f)}catch(p){d(p instanceof Error?p:new Error("Failed to fetch config"))}finally{u(!1)}},[t.projectId,a,r]);return i.useEffect(()=>{h()},[h]),{config:n,loading:l,error:s,refetch:h}}function xa(t,a){const[r,n]=i.useState(null),[o,l]=i.useState(!1),[u,s]=i.useState(null),d=i.useRef(null),c=i.useRef(""),h=`${t.apiUrl}|${t.projectId}`;(!d.current||c.current!==h)&&(d.current=new ft.RampApi({apiKey:"",...t}),c.current=h);const p=i.useRef(0);i.useEffect(()=>{const y=++p.current;if(!a||!t.projectId){n(null),l(!1);return}l(!0),s(null),d.current.getQuotes(a).then(j=>{p.current===y&&(n(j),l(!1))},j=>{p.current===y&&(s(j instanceof Error?j:new Error("Failed to fetch quotes")),n(null),l(!1))})},[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]);const f=i.useCallback(async()=>{if(!(!a||!t.projectId)){l(!0),s(null);try{const y=await d.current.getQuotes(a);n(y)}catch(y){s(y instanceof Error?y:new Error("Failed to fetch quotes"))}finally{l(!1)}}},[t.projectId,a]);return{quotes:r,loading:o,error:u,refetch:f}}function ya(t){const[a,r]=i.useState(null),[n,o]=i.useState(!1),[l,u]=i.useState(null),s=i.useRef(null),d=i.useRef(""),c=`${t.apiUrl}|${t.projectId}`;(!s.current||d.current!==c)&&(s.current=new ft.RampApi({apiKey:"",...t}),d.current=c);const h=i.useCallback(async f=>{o(!0),u(null);try{const y=await s.current.createCheckoutIntent(f);return r(y),y}catch(y){const j=y instanceof Error?y:new Error("Failed to create checkout intent");throw u(j),j}finally{o(!1)}},[]),p=i.useCallback(()=>{r(null),u(null)},[]);return{order:a,loading:n,error:l,createOrder:h,reset:p}}function ga(t,a,r){const[n,o]=i.useState(null),[l,u]=i.useState(!1),[s,d]=i.useState(null),c=i.useRef(null);c.current||(c.current=new ft.RampApi({apiKey:"",projectId:"",...t}));const h=i.useCallback(async()=>{if(a){u(!0),d(null);try{const p=await c.current.getTransaction(a);o(p)}catch(p){d(p instanceof Error?p:new Error("Failed to fetch status"))}finally{u(!1)}}},[a]);return i.useEffect(()=>{if(!a)return;const p=(r==null?void 0:r.initialDelay)??0;if(p>0){const f=setTimeout(h,p);return()=>clearTimeout(f)}h()},[h,a,r==null?void 0:r.initialDelay]),i.useEffect(()=>{if(!a||!(r!=null&&r.pollInterval)||!n||["completed","failed","cancelled","expired","refunded"].includes(n.status))return;const f=setInterval(h,r.pollInterval);return()=>clearInterval(f)},[a,r==null?void 0:r.pollInterval,n==null?void 0:n.status,h]),{status:n,loading:l,error:s,refetch:h}}const qe=[{code:"ad",name:"Andorra",defaultFiat:"EUR"},{code:"ae",name:"United Arab Emirates",defaultFiat:"AED"},{code:"af",name:"Afghanistan",defaultFiat:"USD"},{code:"ag",name:"Antigua and Barbuda",defaultFiat:"USD"},{code:"al",name:"Albania",defaultFiat:"ALL"},{code:"am",name:"Armenia",defaultFiat:"USD"},{code:"ao",name:"Angola",defaultFiat:"USD"},{code:"ar",name:"Argentina",defaultFiat:"ARS"},{code:"at",name:"Austria",defaultFiat:"EUR"},{code:"au",name:"Australia",defaultFiat:"AUD"},{code:"az",name:"Azerbaijan",defaultFiat:"USD"},{code:"ba",name:"Bosnia and Herzegovina",defaultFiat:"EUR"},{code:"bb",name:"Barbados",defaultFiat:"USD"},{code:"bd",name:"Bangladesh",defaultFiat:"USD"},{code:"be",name:"Belgium",defaultFiat:"EUR"},{code:"bf",name:"Burkina Faso",defaultFiat:"USD"},{code:"bg",name:"Bulgaria",defaultFiat:"EUR"},{code:"bh",name:"Bahrain",defaultFiat:"USD"},{code:"bi",name:"Burundi",defaultFiat:"USD"},{code:"bj",name:"Benin",defaultFiat:"USD"},{code:"bn",name:"Brunei",defaultFiat:"USD"},{code:"bo",name:"Bolivia",defaultFiat:"USD"},{code:"br",name:"Brazil",defaultFiat:"BRL"},{code:"bs",name:"Bahamas",defaultFiat:"USD"},{code:"bt",name:"Bhutan",defaultFiat:"USD"},{code:"bw",name:"Botswana",defaultFiat:"USD"},{code:"by",name:"Belarus",defaultFiat:"USD"},{code:"bz",name:"Belize",defaultFiat:"USD"},{code:"ca",name:"Canada",defaultFiat:"CAD"},{code:"cd",name:"DR Congo",defaultFiat:"USD"},{code:"cf",name:"Central African Republic",defaultFiat:"USD"},{code:"ch",name:"Switzerland",defaultFiat:"CHF"},{code:"ci",name:"Cote d'Ivoire",defaultFiat:"USD"},{code:"cl",name:"Chile",defaultFiat:"CLP"},{code:"cm",name:"Cameroon",defaultFiat:"USD"},{code:"cn",name:"China",defaultFiat:"USD"},{code:"co",name:"Colombia",defaultFiat:"USD"},{code:"cr",name:"Costa Rica",defaultFiat:"USD"},{code:"cu",name:"Cuba",defaultFiat:"USD"},{code:"cv",name:"Cape Verde",defaultFiat:"USD"},{code:"cy",name:"Cyprus",defaultFiat:"EUR"},{code:"cz",name:"Czech Republic",defaultFiat:"CZK"},{code:"de",name:"Germany",defaultFiat:"EUR"},{code:"dj",name:"Djibouti",defaultFiat:"USD"},{code:"dk",name:"Denmark",defaultFiat:"DKK"},{code:"dm",name:"Dominica",defaultFiat:"USD"},{code:"do",name:"Dominican Republic",defaultFiat:"USD"},{code:"dz",name:"Algeria",defaultFiat:"USD"},{code:"ec",name:"Ecuador",defaultFiat:"USD"},{code:"ee",name:"Estonia",defaultFiat:"EUR"},{code:"eg",name:"Egypt",defaultFiat:"USD"},{code:"er",name:"Eritrea",defaultFiat:"USD"},{code:"es",name:"Spain",defaultFiat:"EUR"},{code:"et",name:"Ethiopia",defaultFiat:"USD"},{code:"fi",name:"Finland",defaultFiat:"EUR"},{code:"fj",name:"Fiji",defaultFiat:"USD"},{code:"fr",name:"France",defaultFiat:"EUR"},{code:"ga",name:"Gabon",defaultFiat:"USD"},{code:"gb",name:"United Kingdom",defaultFiat:"GBP"},{code:"gd",name:"Grenada",defaultFiat:"USD"},{code:"ge",name:"Georgia",defaultFiat:"USD"},{code:"gh",name:"Ghana",defaultFiat:"USD"},{code:"gm",name:"Gambia",defaultFiat:"USD"},{code:"gn",name:"Guinea",defaultFiat:"USD"},{code:"gq",name:"Equatorial Guinea",defaultFiat:"USD"},{code:"gr",name:"Greece",defaultFiat:"EUR"},{code:"gt",name:"Guatemala",defaultFiat:"USD"},{code:"gw",name:"Guinea-Bissau",defaultFiat:"USD"},{code:"gy",name:"Guyana",defaultFiat:"USD"},{code:"hk",name:"Hong Kong",defaultFiat:"HKD"},{code:"hn",name:"Honduras",defaultFiat:"USD"},{code:"hr",name:"Croatia",defaultFiat:"EUR"},{code:"ht",name:"Haiti",defaultFiat:"USD"},{code:"hu",name:"Hungary",defaultFiat:"EUR"},{code:"id",name:"Indonesia",defaultFiat:"IDR"},{code:"ie",name:"Ireland",defaultFiat:"EUR"},{code:"il",name:"Israel",defaultFiat:"USD"},{code:"in",name:"India",defaultFiat:"INR"},{code:"iq",name:"Iraq",defaultFiat:"USD"},{code:"ir",name:"Iran",defaultFiat:"USD"},{code:"is",name:"Iceland",defaultFiat:"EUR"},{code:"it",name:"Italy",defaultFiat:"EUR"},{code:"jm",name:"Jamaica",defaultFiat:"USD"},{code:"jo",name:"Jordan",defaultFiat:"USD"},{code:"jp",name:"Japan",defaultFiat:"JPY"},{code:"ke",name:"Kenya",defaultFiat:"USD"},{code:"kg",name:"Kyrgyzstan",defaultFiat:"USD"},{code:"kh",name:"Cambodia",defaultFiat:"USD"},{code:"ki",name:"Kiribati",defaultFiat:"USD"},{code:"km",name:"Comoros",defaultFiat:"USD"},{code:"kn",name:"Saint Kitts and Nevis",defaultFiat:"USD"},{code:"kr",name:"South Korea",defaultFiat:"KRW"},{code:"kw",name:"Kuwait",defaultFiat:"USD"},{code:"kz",name:"Kazakhstan",defaultFiat:"USD"},{code:"la",name:"Laos",defaultFiat:"USD"},{code:"lb",name:"Lebanon",defaultFiat:"USD"},{code:"lc",name:"Saint Lucia",defaultFiat:"USD"},{code:"li",name:"Liechtenstein",defaultFiat:"CHF"},{code:"lk",name:"Sri Lanka",defaultFiat:"USD"},{code:"lr",name:"Liberia",defaultFiat:"USD"},{code:"ls",name:"Lesotho",defaultFiat:"ZAR"},{code:"lt",name:"Lithuania",defaultFiat:"EUR"},{code:"lu",name:"Luxembourg",defaultFiat:"EUR"},{code:"lv",name:"Latvia",defaultFiat:"EUR"},{code:"ly",name:"Libya",defaultFiat:"USD"},{code:"ma",name:"Morocco",defaultFiat:"USD"},{code:"mc",name:"Monaco",defaultFiat:"EUR"},{code:"md",name:"Moldova",defaultFiat:"EUR"},{code:"me",name:"Montenegro",defaultFiat:"EUR"},{code:"mg",name:"Madagascar",defaultFiat:"USD"},{code:"mk",name:"North Macedonia",defaultFiat:"EUR"},{code:"ml",name:"Mali",defaultFiat:"USD"},{code:"mm",name:"Myanmar",defaultFiat:"USD"},{code:"mn",name:"Mongolia",defaultFiat:"USD"},{code:"mr",name:"Mauritania",defaultFiat:"USD"},{code:"mt",name:"Malta",defaultFiat:"EUR"},{code:"mu",name:"Mauritius",defaultFiat:"USD"},{code:"mv",name:"Maldives",defaultFiat:"USD"},{code:"mw",name:"Malawi",defaultFiat:"USD"},{code:"mx",name:"Mexico",defaultFiat:"MXN"},{code:"my",name:"Malaysia",defaultFiat:"USD"},{code:"mz",name:"Mozambique",defaultFiat:"USD"},{code:"na",name:"Namibia",defaultFiat:"ZAR"},{code:"ne",name:"Niger",defaultFiat:"USD"},{code:"ng",name:"Nigeria",defaultFiat:"NGN"},{code:"ni",name:"Nicaragua",defaultFiat:"USD"},{code:"nl",name:"Netherlands",defaultFiat:"EUR"},{code:"no",name:"Norway",defaultFiat:"NOK"},{code:"np",name:"Nepal",defaultFiat:"USD"},{code:"nr",name:"Nauru",defaultFiat:"AUD"},{code:"nz",name:"New Zealand",defaultFiat:"NZD"},{code:"om",name:"Oman",defaultFiat:"USD"},{code:"pa",name:"Panama",defaultFiat:"USD"},{code:"pe",name:"Peru",defaultFiat:"USD"},{code:"pg",name:"Papua New Guinea",defaultFiat:"USD"},{code:"ph",name:"Philippines",defaultFiat:"PHP"},{code:"pk",name:"Pakistan",defaultFiat:"USD"},{code:"pl",name:"Poland",defaultFiat:"PLN"},{code:"pt",name:"Portugal",defaultFiat:"EUR"},{code:"pw",name:"Palau",defaultFiat:"USD"},{code:"py",name:"Paraguay",defaultFiat:"USD"},{code:"qa",name:"Qatar",defaultFiat:"QAR"},{code:"ro",name:"Romania",defaultFiat:"EUR"},{code:"rs",name:"Serbia",defaultFiat:"EUR"},{code:"ru",name:"Russia",defaultFiat:"USD"},{code:"rw",name:"Rwanda",defaultFiat:"USD"},{code:"sa",name:"Saudi Arabia",defaultFiat:"SAR"},{code:"sb",name:"Solomon Islands",defaultFiat:"USD"},{code:"sc",name:"Seychelles",defaultFiat:"USD"},{code:"sd",name:"Sudan",defaultFiat:"USD"},{code:"se",name:"Sweden",defaultFiat:"SEK"},{code:"sg",name:"Singapore",defaultFiat:"SGD"},{code:"si",name:"Slovenia",defaultFiat:"EUR"},{code:"sk",name:"Slovakia",defaultFiat:"EUR"},{code:"sl",name:"Sierra Leone",defaultFiat:"USD"},{code:"sm",name:"San Marino",defaultFiat:"EUR"},{code:"sn",name:"Senegal",defaultFiat:"USD"},{code:"so",name:"Somalia",defaultFiat:"USD"},{code:"sr",name:"Suriname",defaultFiat:"USD"},{code:"ss",name:"South Sudan",defaultFiat:"USD"},{code:"sv",name:"El Salvador",defaultFiat:"USD"},{code:"sy",name:"Syria",defaultFiat:"USD"},{code:"sz",name:"Eswatini",defaultFiat:"ZAR"},{code:"td",name:"Chad",defaultFiat:"USD"},{code:"tg",name:"Togo",defaultFiat:"USD"},{code:"th",name:"Thailand",defaultFiat:"THB"},{code:"tj",name:"Tajikistan",defaultFiat:"USD"},{code:"tl",name:"Timor-Leste",defaultFiat:"USD"},{code:"tm",name:"Turkmenistan",defaultFiat:"USD"},{code:"tn",name:"Tunisia",defaultFiat:"USD"},{code:"to",name:"Tonga",defaultFiat:"USD"},{code:"tr",name:"Turkey",defaultFiat:"TRY"},{code:"tt",name:"Trinidad and Tobago",defaultFiat:"USD"},{code:"tv",name:"Tuvalu",defaultFiat:"AUD"},{code:"tw",name:"Taiwan",defaultFiat:"TWD"},{code:"tz",name:"Tanzania",defaultFiat:"USD"},{code:"ua",name:"Ukraine",defaultFiat:"USD"},{code:"ug",name:"Uganda",defaultFiat:"USD"},{code:"us",name:"United States",defaultFiat:"USD"},{code:"uy",name:"Uruguay",defaultFiat:"USD"},{code:"uz",name:"Uzbekistan",defaultFiat:"USD"},{code:"va",name:"Vatican City",defaultFiat:"EUR"},{code:"vc",name:"Saint Vincent and the Grenadines",defaultFiat:"USD"},{code:"ve",name:"Venezuela",defaultFiat:"USD"},{code:"vn",name:"Vietnam",defaultFiat:"VND"},{code:"vu",name:"Vanuatu",defaultFiat:"USD"},{code:"ws",name:"Samoa",defaultFiat:"USD"},{code:"ye",name:"Yemen",defaultFiat:"USD"},{code:"za",name:"South Africa",defaultFiat:"ZAR"},{code:"zm",name:"Zambia",defaultFiat:"USD"},{code:"zw",name:"Zimbabwe",defaultFiat:"USD"}],xt=Object.fromEntries(qe.map(t=>[t.code,t]));function ct(t,a){if(!t)return"USD";const r=xt[t.toLowerCase()],n=(r==null?void 0:r.defaultFiat)||"USD";return!a||a.length===0||a.includes(n)?n:a.includes("USD")?"USD":a[0]||"USD"}const yt=!0;function Pt(t,a,r=yt){return t===void 0||a===void 0?r:t.length===0||a.length===0?!1:t.some(n=>a.includes(n))}function Or(t,a,r=yt){return t.filter(n=>Pt(n.providers,a,r))}function _r(t,a,r=yt){const n=[];for(const o of t){const l=o.networks.filter(u=>Pt(u.providers,a,r));l.length>0&&n.push(l.length===o.networks.length?o:{...o,networks:l})}return n}function Kr(t,a,r,n=yt){return r?t.filter(o=>o.supportedFiats.includes(r)&&Pt(o.providers,a,n)):[]}function Vr(t,a,r){const n={};let o=!1;if(!r.cryptoLocked&&!r.networkLocked){if(!(t.cryptoCurrency&&a.availableCryptos.some(s=>s.code===t.cryptoCurrency&&s.networks.some(d=>d.id===t.network)))&&a.availableCryptos.length>0){const d=a.availableCryptos.find(h=>h.code==="BTC")||a.availableCryptos[0],c=d.networks.find(h=>h.isDefault)||d.networks[0];d.code!==t.cryptoCurrency&&(n.cryptoCurrency=d.code,o=!0),c&&c.id!==t.network&&(n.network=c.id,o=!0)}}else if(!r.cryptoLocked&&r.networkLocked){if(!(t.cryptoCurrency&&a.availableCryptos.some(s=>s.code===t.cryptoCurrency&&s.networks.some(d=>d.id===t.network)))){const s=a.availableCryptos.find(d=>d.networks.some(c=>c.id===t.network));s&&s.code!==t.cryptoCurrency&&(n.cryptoCurrency=s.code,o=!0)}}else if(r.cryptoLocked&&!r.networkLocked){const u=a.availableCryptos.find(s=>s.code===t.cryptoCurrency);if(u&&!u.networks.some(d=>d.id===t.network)&&u.networks.length>0){const d=u.networks.find(c=>c.isDefault)||u.networks[0];d.id!==t.network&&(n.network=d.id,o=!0)}}if(!r.fiatLocked&&!(t.fiatCurrency&&a.availableFiats.some(s=>s.code===t.fiatCurrency))&&a.availableFiats.length>0){const d=a.availableFiats.find(c=>c.code==="USD")||a.availableFiats[0];d.code!==t.fiatCurrency&&(n.fiatCurrency=d.code,o=!0)}if(!(t.paymentMethodId&&a.availablePaymentMethods.some(u=>u.id===t.paymentMethodId))&&a.availablePaymentMethods.length>0){const s=a.availablePaymentMethods.find(d=>d.id.includes("card")||d.id.includes("debit"))||a.availablePaymentMethods[0];s.id!==t.paymentMethodId&&(n.paymentMethodId=s.id,o=!0)}return o?n:null}function Wr(t,a,r,n){var o,l,u;if(r.cryptoLocked){const s=(o=t.cryptos)==null?void 0:o.find(c=>c.code===a.cryptoCurrency);if(!s)return!0;const d=(l=s.networks)==null?void 0:l.find(c=>c.id===a.network);if(!d||d.providers!==void 0&&d.providers.length===0||d.providers!==void 0&&(n.availableFiats.length===0||n.availablePaymentMethods.length===0))return!0}if(r.networkLocked&&!r.cryptoLocked&&!n.availableCryptos.some(d=>d.networks.some(c=>c.id===a.network)))return!0;if(r.fiatLocked){const s=(u=t.fiats)==null?void 0:u.find(d=>d.code===a.fiatCurrency);if(!s||s.providers!==void 0&&s.providers.length===0||s.providers!==void 0&&n.availableCryptos.length===0)return!0}return!1}function ia(t,a){if(!t)return t;const r=t.indexOf(".");if(r===-1)return t;let n=t;return n.length-r-1>a&&(n=n.slice(0,r+a+1)),n=n.replace(/0+$/,"").replace(/\.$/,""),n}function Gr(t,a,r){return!t&&!!a&&!a.bestQuote&&!!r}function $r(t,a){if(!t.length)return null;if(a){const n=t.find(o=>o.gatewayId===a);if(n!=null&&n.reason)return n.reason}const r=t.map((n,o)=>({reason:n.reason,score:n.reason?Zr(n.reason):99,idx:o})).filter(n=>n.reason);return r.length?(r.sort((n,o)=>n.score-o.score||n.idx-o.idx),r[0].reason):null}function Zr(t){const a=t.toLowerCase();return/amount|out of range for|minimum|maximum/.test(a)?1:/currency|pair|network|chain/.test(a)?2:/country|region|location/.test(a)?3:/does not support|unsupported/.test(a)?4:5}const Xr=["completed","failed","cancelled","expired","refunded"],va={step:"amount",flowType:"buy",fiatCurrency:"USD",fiatAmount:"",cryptoCurrency:"",cryptoAmount:"",network:"",paymentMethodId:"",walletAddress:"",walletError:null,selectedProvider:null,selectedQuote:null,customerId:"",email:"",country:"",countrySource:"",errorMessage:null};function Yr(t,a){var r,n,o,l,u,s,d,c;switch(a.type){case"SET_STEP":return{...t,step:a.step,errorMessage:null};case"SET_FLOW_TYPE":return{...t,flowType:a.flowType,fiatAmount:"",cryptoAmount:"",fiatCurrency:(n=(r=a.fieldLocks)==null?void 0:r.sourceCurrency)!=null&&n.locked?t.fiatCurrency:"",cryptoCurrency:(l=(o=a.fieldLocks)==null?void 0:o.destinationCurrency)!=null&&l.locked?t.cryptoCurrency:"",network:(s=(u=a.fieldLocks)==null?void 0:u.network)!=null&&s.locked||(c=(d=a.fieldLocks)==null?void 0:d.destinationCurrency)!=null&&c.locked?t.network:"",paymentMethodId:"",selectedQuote:null,selectedProvider:null,errorMessage:null};case"SET_FIAT_CURRENCY":return{...t,fiatCurrency:a.currency};case"SET_FIAT_AMOUNT":return{...t,fiatAmount:a.amount};case"SET_CRYPTO_CURRENCY":return{...t,cryptoCurrency:a.currency,network:""};case"SET_CRYPTO_AMOUNT":return{...t,cryptoAmount:a.amount};case"SET_NETWORK":return{...t,network:a.network};case"SET_CRYPTO_CHAIN":return{...t,network:a.chain};case"SET_PAYMENT_METHOD":return{...t,paymentMethodId:a.methodId};case"SET_WALLET_ADDRESS":return{...t,walletAddress:a.address,walletError:null};case"SET_WALLET_ERROR":return{...t,walletError:a.message};case"SELECT_QUOTE":return{...t,selectedQuote:a.quote,selectedProvider:a.quote.gatewayId};case"CLEAR_QUOTE":return{...t,selectedQuote:null,selectedProvider:null};case"SET_CUSTOMER_ID":return{...t,customerId:a.customerId};case"SET_EMAIL":return{...t,email:a.email};case"SET_COUNTRY":return{...t,country:a.country,countrySource:"manual"};case"SET_COUNTRY_AUTO":return{...t,country:a.country,countrySource:"auto"};case"SET_ERROR":return{...t,step:"error",errorMessage:a.message};case"CLEAR_ERROR":return{...t,errorMessage:null};case"RESET":return va;default:return t}}const Ca=i.createContext(null);function ba(t){const a=i.useRef(t.defaultFiatCurrency!==void 0),{projectId:r,apiUrl:n="https://api.nowramp.com",assetBaseUrl:o="",flowType:l="buy",customerId:u="",brandId:s,defaultFiatCurrency:d="USD",defaultCryptoCurrency:c="BTC",defaultNetwork:h="",defaultFiatAmount:p="",defaultCryptoAmount:f="",defaultWalletAddress:y="",defaultGateway:j,defaultCountry:N,fieldLocks:x,partnerMetadata:k,statusPollInterval:D=5e3,onComplete:G,onError:$,children:ee}=t,Z=i.useMemo(()=>({apiUrl:n,projectId:r}),[n,r]),Y=h||(c==="BTC"?"bitcoin":c?c.toLowerCase():""),ge=l==="sell",Q=ge?!!f:!!p,C=(ge?!!(Q&&c&&Y):!!(Q&&c&&Y&&y))&&j?"confirm":"amount",T=p||(l==="buy"?"250":""),[m,L]=i.useReducer(Yr,{...va,step:C,flowType:l,fiatCurrency:d,cryptoCurrency:c,network:Y,fiatAmount:ia(T,2),cryptoAmount:ia(f,6),walletAddress:y,customerId:u,...N?{country:N.toLowerCase(),countrySource:"manual"}:{}}),w=m.flowType==="sell",{config:b,loading:z,error:ie}=fa(Z,m.flowType,m.country||void 0),ve=i.useRef(!1);i.useEffect(()=>{var I,F;if(ve.current||!(b!=null&&b.detectedCountry)||m.country)return;ve.current=!0;const v=b.detectedCountry.toLowerCase();L({type:"SET_COUNTRY_AUTO",country:v});const R=(I=b.fiats)==null?void 0:I.map(B=>B.code),E=ct(v,R);E!==m.fiatCurrency&&!((F=x==null?void 0:x.sourceCurrency)!=null&&F.locked)&&!a.current&&L({type:"SET_FIAT_CURRENCY",currency:E})},[b,m.country,m.fiatCurrency,x]);const ke=i.useRef(!1);i.useEffect(()=>{var E,I;if(ke.current||!N||!((E=b==null?void 0:b.fiats)!=null&&E.length))return;ke.current=!0;const v=b.fiats.map(F=>F.code),R=ct(N,v);R!==m.fiatCurrency&&!((I=x==null?void 0:x.sourceCurrency)!=null&&I.locked)&&!a.current&&L({type:"SET_FIAT_CURRENCY",currency:R})},[N,b,m.fiatCurrency,x]);const le=i.useRef(m.country);i.useEffect(()=>{var E,I;if(m.country===le.current||(le.current=m.country,m.countrySource==="manual"&&(Be.current=!1),m.countrySource!=="manual")||!((E=b==null?void 0:b.fiats)!=null&&E.length))return;const v=b.fiats.map(F=>F.code),R=ct(m.country,v);R!==m.fiatCurrency&&!((I=x==null?void 0:x.sourceCurrency)!=null&&I.locked)&&L({type:"SET_FIAT_CURRENCY",currency:R})},[m.country,m.countrySource,b,m.fiatCurrency,x]);const te=i.useRef(m.fiatCurrency);i.useEffect(()=>{var I;if(m.fiatCurrency===te.current||(te.current=m.fiatCurrency,w||!((I=b==null?void 0:b.fiats)!=null&&I.length)||!m.fiatAmount))return;const v=b.fiats.find(F=>F.code===m.fiatCurrency);if(!(v!=null&&v.minAmount))return;const R=parseFloat(m.fiatAmount),E=parseFloat(v.minAmount);!isNaN(R)&&!isNaN(E)&&R<E&&L({type:"SET_FIAT_AMOUNT",amount:String(Math.ceil(E))})},[m.fiatCurrency,m.fiatAmount,b,w]);const{availableFiats:ae,availableCryptos:K,availablePaymentMethods:ce}=i.useMemo(()=>{var E,I,F;if(!b)return{availableFiats:[],availableCryptos:[],availablePaymentMethods:[]};let v;if(m.cryptoCurrency&&m.network){const B=(E=b.cryptos)==null?void 0:E.find(ue=>ue.code===m.cryptoCurrency),oe=(I=B==null?void 0:B.networks)==null?void 0:I.find(ue=>ue.id===m.network);!B||!oe?v=[]:v=oe.providers}let R;if(m.fiatCurrency){const B=(F=b.fiats)==null?void 0:F.find(oe=>oe.code===m.fiatCurrency);B?R=B.providers:R=[]}return{availableFiats:Or(b.fiats??[],v),availableCryptos:_r(b.cryptos??[],R),availablePaymentMethods:Kr(b.paymentMethods??[],v,m.fiatCurrency)}},[b,m.cryptoCurrency,m.network,m.fiatCurrency]),We=i.useMemo(()=>{var v,R,E;return z||!b?!1:Wr(b,{cryptoCurrency:m.cryptoCurrency,network:m.network,fiatCurrency:m.fiatCurrency},{cryptoLocked:!!((v=x==null?void 0:x.destinationCurrency)!=null&&v.locked),networkLocked:!!((R=x==null?void 0:x.network)!=null&&R.locked),fiatLocked:!!((E=x==null?void 0:x.sourceCurrency)!=null&&E.locked)},{availableFiats:ae,availableCryptos:K,availablePaymentMethods:ce})},[z,b,x,m.cryptoCurrency,m.network,m.fiatCurrency,ae,K,ce]);i.useEffect(()=>{var R,E,I;if(z||ae.length===0&&K.length===0)return;const v=Vr({cryptoCurrency:m.cryptoCurrency,network:m.network,fiatCurrency:m.fiatCurrency,paymentMethodId:m.paymentMethodId},{availableFiats:ae,availableCryptos:K,availablePaymentMethods:ce},{cryptoLocked:!!((R=x==null?void 0:x.destinationCurrency)!=null&&R.locked),networkLocked:!!((E=x==null?void 0:x.network)!=null&&E.locked),fiatLocked:!!((I=x==null?void 0:x.sourceCurrency)!=null&&I.locked)});v&&(v.cryptoCurrency!==void 0&&L({type:"SET_CRYPTO_CURRENCY",currency:v.cryptoCurrency}),v.network!==void 0&&L({type:"SET_NETWORK",network:v.network}),v.fiatCurrency!==void 0&&L({type:"SET_FIAT_CURRENCY",currency:v.fiatCurrency}),v.paymentMethodId!==void 0&&L({type:"SET_PAYMENT_METHOD",methodId:v.paymentMethodId}))},[z,ae,K,ce,m.cryptoCurrency,m.network,m.fiatCurrency,m.paymentMethodId,x,L]);const q=i.useMemo(()=>{if(w){if(!m.cryptoAmount)return null;const F=parseFloat(m.cryptoAmount);return isNaN(F)||F<=0?"Enter a valid amount":null}if(!b||!m.fiatAmount)return null;const v=parseFloat(m.fiatAmount);if(isNaN(v))return null;const R=b.fiats.find(F=>F.code===m.fiatCurrency);if(!R)return null;const E=parseFloat(R.minAmount),I=parseFloat(R.maxAmount);return!isNaN(E)&&v<E?`Minimum amount is ${R.minAmount} ${m.fiatCurrency}`:!isNaN(I)&&v>I?`Maximum amount is ${R.maxAmount} ${m.fiatCurrency}`:null},[b,m.fiatAmount,m.fiatCurrency,m.cryptoAmount,w]),de=i.useMemo(()=>{const v=w?!!m.cryptoAmount:!!m.fiatAmount;return!b||!v||!m.fiatCurrency||!m.cryptoCurrency||!m.network||q||b.detectedCountry&&m.countrySource===""&&!N?null:{fiatCurrency:m.fiatCurrency,...w?{cryptoAmount:m.cryptoAmount}:{fiatAmount:m.fiatAmount},cryptoCurrency:m.cryptoCurrency,network:m.network,paymentMethodId:m.paymentMethodId||void 0,country:m.country||void 0,orderType:m.flowType}},[b,m.fiatCurrency,m.fiatAmount,m.cryptoAmount,m.cryptoCurrency,m.network,m.paymentMethodId,m.country,m.countrySource,q,w,m.flowType,N]),{quotes:O,loading:De,error:Ge,refetch:Ct}=xa(Z,de),re=Gr(De,O,de),Be=i.useRef(!1);i.useEffect(()=>{var v;Be.current||m.countrySource==="auto"&&((v=x==null?void 0:x.sourceCurrency)!=null&&v.locked||a.current||De||!de||Ge||!O||O.bestQuote||m.fiatCurrency!=="USD"&&(Be.current=!0,L({type:"SET_FIAT_CURRENCY",currency:"USD"}),L({type:"SET_FIAT_AMOUNT",amount:"250"})))},[O,De,Ge,de,m.countrySource,m.fiatCurrency]);const{order:we,loading:bt,error:ne,createOrder:P}=ya(Z),tt=15e3,{status:_,loading:St}=ga({apiUrl:n},(we==null?void 0:we.orderId)??null,{pollInterval:D,initialDelay:tt}),$e=i.useRef(null);i.useEffect(()=>{!(_!=null&&_.status)||!G||Xr.includes(_.status)&&$e.current!==_.orderId&&($e.current=_.orderId,G(_))},[_==null?void 0:_.status,_==null?void 0:_.orderId,G]),i.useEffect(()=>{const v=ie||ne;v&&$&&$(v)},[ie,ne,$]);const Ne=j||(b==null?void 0:b.defaultGateway)||null,at=i.useMemo(()=>{if(!re||!(O!=null&&O.unavailableGateways))return null;const v=O.preferredGatewayId||Ne;return $r(O.unavailableGateways,v)},[re,O,Ne]),Pe=i.useRef(Ne);Pe.current=Ne;const Ze=i.useRef(O);Ze.current=O;const Xe=i.useRef(s);Xe.current=s;const Re=i.useCallback(async()=>{var R,E,I;const v=((R=m.selectedQuote)==null?void 0:R.gatewayId)||((I=(E=Ze.current)==null?void 0:E.bestQuote)==null?void 0:I.gatewayId)||Pe.current;if(!v||!m.walletAddress){const F=[!v&&"gateway",!m.walletAddress&&"walletAddress"].filter(Boolean).join(", ");L({type:"SET_ERROR",message:`Missing required fields: ${F}`});return}try{await P({gateway:v,customerId:m.customerId||void 0,fiatCurrency:m.fiatCurrency,...w?{cryptoAmount:m.cryptoAmount}:{fiatAmount:m.fiatAmount},cryptoCurrency:m.cryptoCurrency,network:m.network,walletAddress:m.walletAddress,paymentMethodId:m.paymentMethodId||void 0,email:m.email||void 0,orderType:m.flowType,...Xe.current?{metadata:{brand:Xe.current}}:{},...k&&Object.keys(k).length>0?{partnerMetadata:k}:{}}),L({type:"SET_STEP",step:"checkout"})}catch(F){const B=F instanceof Error?F.message:"Failed to create order";/wallet|address/i.test(B)?L({type:"SET_WALLET_ERROR",message:B.replace(/^Failed to create checkout intent:\s*/i,"")}):L({type:"SET_ERROR",message:B})}},[m,P,w,k]),Ye=i.useCallback(v=>{L({type:"SET_STEP",step:v})},[]),jt=i.useCallback(()=>{const v=["confirm","amount","quotes","wallet","checkout","processing","complete"],R=v.indexOf(m.step);R>0&&L({type:"SET_STEP",step:v[R-1]})},[m.step,w]),kt=i.useMemo(()=>{const v=w?!!m.cryptoAmount:!!m.fiatAmount;switch(m.step){case"confirm":return!!(v&&m.cryptoCurrency&&m.network&&m.walletAddress&&!q);case"amount":return!!(v&&m.cryptoCurrency&&m.network&&!q);case"quotes":return!!m.selectedQuote;case"wallet":return!!m.walletAddress;default:return!1}},[m,q,w]),rt={apiConfig:Z,assetBaseUrl:o,config:b,configLoading:z,configError:ie,state:m,dispatch:L,quotes:O,quotesLoading:De,quotesError:Ge,fetchQuotes:Ct,order:we,orderLoading:bt,orderError:ne,createOrder:Re,orderStatus:_,orderStatusLoading:St,fieldLocks:x||null,defaultGateway:Ne,availableFiats:ae,availableCryptos:K,availablePaymentMethods:ce,selectionUnsupported:We,quotesEmpty:re,bestUnavailableReason:at,amountError:q,goToStep:Ye,goBack:jt,canProceed:kt};return e.jsx(Ca.Provider,{value:rt,children:ee})}function Me(){const t=i.useContext(Ca);if(!t)throw new Error("useRamp must be used within a RampProvider");return t}const et={"header.buy":"Buy","header.sell":"Sell","spend.label":"You spend","spend.placeholderFiat":"250","spend.placeholderCrypto":"0.01","receive.label":"You get","receive.fetchingRate":"Fetching best rate...","payment.label":"Payment method","payment.select":"Select","payment.noneAvailable":"No payment methods for this pair","provider.label":"By","provider.select":"Select","wallet.label":"Receiving wallet address","wallet.placeholderBuy":"Enter your receiving address","wallet.placeholderSell":"Enter your sending address","wallet.validating":"Validating address...","wallet.invalid":"Enter a valid wallet address","wallet.invalidServer":"Invalid wallet address","cta.buy":"Buy {crypto}","cta.sell":"Sell {crypto}","cta.gettingPrice":"Getting best price...","cta.processing":"Processing...","footer.poweredBy":"Powered by ","footer.brand":"NowRamp","rate.title":"Rate breakdown","rate.close":"Close","rate.updatesIn":"Rate updates in 00:{seconds}","rate.noQuote":"No quote available","rate.exchangeRate":"Exchange rate","rate.processingFee":"Processing fee","rate.networkFee":"Network fee","rate.provider":"Provider","rate.updatesInLabel":"Rate updates in","rate.networkFeeIncl":"Network fee incl.","rate.rateTooltip":"As the market is highly volatile, we can fix the exchange rate for no longer than 30 seconds.","rate.networkFeeTooltip":"Includes a fee charged by blockchain to execute the transaction.","rate.feeIncluded":"{percentage}% incl.","toast.orderCreated":"Order created","toast.redirecting":"Redirecting to checkout...","toast.orderFailed":"Order failed","toast.couldNotCreate":"Could not create order","toast.quoteError":"Quote error","toast.noProviders":"No providers","toast.somethingWrong":"Something went wrong","error.amountZero":"Amount should be more than 0","error.minAmountFiat":"Minimum amount is {min} {currency}","error.minAmountCrypto":"Minimum amount is {min} {currency}","error.noProviders":"No providers available for this combination","error.currencyUnavailableBuy":"This currency is not available for buy orders","error.currencyUnavailableSell":"This currency is not available for sell orders","parity.info":"You will be charged for {receiveAmount} {crypto}, the rest up to {spendAmount} {fiat} will be credited to your {partner} account","redirect.secureBadge":"Secure payment","redirect.title":"Continue Payment","redirect.description":"You'll be redirected to {gateway} to complete your payment.","redirect.countdown":"Redirecting in {seconds}...","redirect.openTab":"Open ACH in new tab","redirect.cancel":"Cancel","redirect.tabHelper":"If the new tab has not opened, click the button above.","checkout.noOrder":"No order found","checkout.goBack":"Go Back","checkout.expired":"Checkout expired","checkout.expiredDesc":"The session has expired. Please try again.","checkout.startOver":"Start over","checkout.cancel":"Cancel","checkout.loading":"Loading checkout...","checkout.iframeTitle":"Provider Checkout","checkout.widgetTitle":"Payment Checkout","checkout.unknownMethod":"Unknown checkout method","processing.default":"Processing your order...","processing.pending":"Waiting for payment confirmation...","processing.active":"Processing your transaction...","processing.generic":"Processing...","processing.checkingStatus":"Checking status...","processing.orderId":"Order ID","processing.provider":"Provider","processing.amount":"Amount","processing.receiving":"Receiving","processing.network":"Network","processing.toAddress":"To Address","processing.usuallyMinutes":"This usually takes a few minutes.","processing.safeToClose":"You can safely close this page - we'll send you an email when complete.","complete.buyTitle":"Purchase Complete!","complete.sellTitle":"Sale Complete!","complete.buyDesc":"Your {crypto} has been sent to your wallet.","complete.sellDesc":"Your {fiat} payout is being processed.","complete.amountBuy":"Amount Received","complete.amountSell":"Amount Sold","complete.paidBuy":"Amount Paid","complete.paidSell":"Payout Amount","complete.network":"Network","complete.wallet":"Wallet","complete.transaction":"Transaction","complete.provider":"Provider","complete.orderId":"Order ID","complete.completed":"Completed","complete.viewExplorer":"View on Explorer","complete.done":"Done","errorStep.failed":"Payment Failed","errorStep.cancelled":"Order Cancelled","errorStep.expired":"Order Expired","errorStep.refunded":"Order Refunded","errorStep.unknown":"Something Went Wrong","errorStep.failedBuy":"Your payment could not be processed. Please try again or use a different payment method.","errorStep.failedSell":"Your sale could not be processed. Please try again.","errorStep.cancelledBuy":"Your order was cancelled. No payment was processed.","errorStep.cancelledSell":"Your sale was cancelled. No crypto was transferred.","errorStep.expiredBuy":"Your order has expired. Please start a new purchase.","errorStep.expiredSell":"Your order has expired. Please start a new sale.","errorStep.refundedBuy":"Your payment has been refunded. The funds should appear in your account within 5-10 business days.","errorStep.refundedSell":"Your crypto has been returned. The funds should appear in your wallet shortly.","errorStep.genericDesc":"An unexpected error occurred. Please try again.","errorStep.orderId":"Order ID","errorStep.tryAgain":"Try Again","errorStep.startOver":"Start Over","errorStep.return":"Return","errorStep.needHelp":"Need help? Contact ","errorStep.reference":"Reference: {orderId}","confirm.buyTitle":"Confirm Purchase","confirm.sellTitle":"Confirm Sale","confirm.loading":"Loading...","confirm.provider":"Provider","confirm.youPay":"You pay","confirm.youSell":"You sell","confirm.youReceive":"You receive","confirm.wallet":"Wallet","confirm.network":"Network","confirm.refundAddress":"Refund address","confirm.parityNote":"Charged amount from provider may differ. The rest up to {amount} {crypto} will be credited to your {partner} account.","confirm.processing":"Processing...","confirm.confirmPay":"Confirm & Pay","confirm.confirmSell":"Confirm & Sell","confirm.payout":"{currency} payout","confirm.cryptoOnNetwork":"{crypto} on {network}","payment.name.card":"Card","payment.name.bankTransfer":"Bank Transfer","payment.name.ach":"ACH","modal.selectFiat":"Select fiat currency","modal.selectCrypto":"Select crypto currency","modal.choosePayment":"Choose payment method","modal.selectCountry":"Select your country","modal.selectLanguage":"Select language","modal.popular":"Popular","modal.recommended":"Recommended","modal.noCurrencies":"No currencies found","modal.noPaymentMethods":"No payment methods found","modal.noCountries":"No countries found","modal.noLanguages":"No languages found","modal.chooseRamp":"Choose Ramp","modal.bestPrice":"Best price","modal.noQuotes":"No quotes available for this request","modal.noProvidersFound":"No providers found","payment.unavailableFor":"No payment methods available for {currency}","skeleton.poweredBy":"Powered by NowRamp","error.createOrderFailed":"Failed to create order","errorStep.returnToMerchant":"Return to merchant","settings.location":"Location","settings.darkMode":"Dark Mode","settings.privacy":"Privacy policy","settings.terms":"Terms of use","settings.language":"Language"},Ie=[{code:"en",name:"English",english:"English"},{code:"es",name:"Español",english:"Spanish"},{code:"fr",name:"Français",english:"French"},{code:"de",name:"Deutsch",english:"German"},{code:"pt",name:"Português",english:"Portuguese"},{code:"it",name:"Italiano",english:"Italian"},{code:"nl",name:"Nederlands",english:"Dutch"},{code:"ru",name:"Русский",english:"Russian"},{code:"zh",name:"中文",english:"Chinese"},{code:"ja",name:"日本語",english:"Japanese"},{code:"ko",name:"한국어",english:"Korean"},{code:"ar",name:"العربية",english:"Arabic"},{code:"hi",name:"हिन्दी",english:"Hindi"},{code:"tr",name:"Türkçe",english:"Turkish"},{code:"pl",name:"Polski",english:"Polish"},{code:"vi",name:"Tiếng Việt",english:"Vietnamese"},{code:"th",name:"ไทย",english:"Thai"},{code:"id",name:"Bahasa Indonesia",english:"Indonesian"},{code:"uk",name:"Українська",english:"Ukrainian"},{code:"cs",name:"Čeština",english:"Czech"},{code:"bg",name:"Български",english:"Bulgarian"},{code:"hr",name:"Hrvatski",english:"Croatian"},{code:"da",name:"Dansk",english:"Danish"},{code:"et",name:"Eesti",english:"Estonian"},{code:"fi",name:"Suomi",english:"Finnish"},{code:"el",name:"Ελληνικά",english:"Greek"},{code:"hu",name:"Magyar",english:"Hungarian"},{code:"ga",name:"Gaeilge",english:"Irish"},{code:"lv",name:"Latviešu",english:"Latvian"},{code:"lt",name:"Lietuvių",english:"Lithuanian"},{code:"mt",name:"Malti",english:"Maltese"},{code:"ro",name:"Română",english:"Romanian"},{code:"sk",name:"Slovenčina",english:"Slovak"},{code:"sl",name:"Slovenščina",english:"Slovenian"},{code:"sv",name:"Svenska",english:"Swedish"},{code:"ur",name:"اردو",english:"Urdu"},{code:"fa",name:"فارسی",english:"Persian"},{code:"bn",name:"বাংলা",english:"Bengali"},{code:"ta",name:"தமிழ்",english:"Tamil"},{code:"te",name:"తెలుగు",english:"Telugu"},{code:"mr",name:"मराठी",english:"Marathi"},{code:"gu",name:"ગુજરાતી",english:"Gujarati"},{code:"kn",name:"ಕನ್ನಡ",english:"Kannada"},{code:"ml",name:"മലയാളം",english:"Malayalam"}],Sa=i.createContext(null),la={en:()=>Promise.resolve({default:et}),es:()=>Promise.resolve().then(()=>require("./es-t2vw4GtN.js")),fr:()=>Promise.resolve().then(()=>require("./fr-D69xhq2o.js")),de:()=>Promise.resolve().then(()=>require("./de-pdd7Ef_M.js")),pt:()=>Promise.resolve().then(()=>require("./pt-CasdsE3O.js")),it:()=>Promise.resolve().then(()=>require("./it-Ba7wBuRX.js")),nl:()=>Promise.resolve().then(()=>require("./nl-C7ITapV-.js")),ru:()=>Promise.resolve().then(()=>require("./ru-B5Y3xqwR.js")),zh:()=>Promise.resolve().then(()=>require("./zh-BqyKrwpt.js")),ja:()=>Promise.resolve().then(()=>require("./ja-CPBjvGS_.js")),ko:()=>Promise.resolve().then(()=>require("./ko-D-5KAati.js")),ar:()=>Promise.resolve().then(()=>require("./ar-DjxTD_0y.js")),hi:()=>Promise.resolve().then(()=>require("./hi-C0TISlxI.js")),tr:()=>Promise.resolve().then(()=>require("./tr-DtE7JayY.js")),pl:()=>Promise.resolve().then(()=>require("./pl-l0pfAgne.js")),vi:()=>Promise.resolve().then(()=>require("./vi-DjSOJLXz.js")),th:()=>Promise.resolve().then(()=>require("./th-BH9OczUI.js")),id:()=>Promise.resolve().then(()=>require("./id-qy3taLG1.js")),uk:()=>Promise.resolve().then(()=>require("./uk-CQTdYo3Q.js")),cs:()=>Promise.resolve().then(()=>require("./cs-KF3yjBNM.js")),bg:()=>Promise.resolve().then(()=>require("./bg-BimHE3F3.js")),hr:()=>Promise.resolve().then(()=>require("./hr-DT77Sn3q.js")),da:()=>Promise.resolve().then(()=>require("./da-Bna90FQo.js")),et:()=>Promise.resolve().then(()=>require("./et-tiMYfPWp.js")),fi:()=>Promise.resolve().then(()=>require("./fi-DIdZQl0k.js")),el:()=>Promise.resolve().then(()=>require("./el-DiDKgGMb.js")),hu:()=>Promise.resolve().then(()=>require("./hu-Dx2JGTJc.js")),ga:()=>Promise.resolve().then(()=>require("./ga-DM-F-bEJ.js")),lv:()=>Promise.resolve().then(()=>require("./lv-MGbTMx6O.js")),lt:()=>Promise.resolve().then(()=>require("./lt-Sq1I6sJl.js")),mt:()=>Promise.resolve().then(()=>require("./mt-BTwndFRN.js")),ro:()=>Promise.resolve().then(()=>require("./ro-S8nJb3-a.js")),sk:()=>Promise.resolve().then(()=>require("./sk-Dnsp_e_y.js")),sl:()=>Promise.resolve().then(()=>require("./sl-BHXMAUQW.js")),sv:()=>Promise.resolve().then(()=>require("./sv-70nUgQ0i.js")),ur:()=>Promise.resolve().then(()=>require("./ur-qHUuLPQ1.js")),fa:()=>Promise.resolve().then(()=>require("./fa-Bx3HrOrv.js")),bn:()=>Promise.resolve().then(()=>require("./bn-BlRnyHpx.js")),ta:()=>Promise.resolve().then(()=>require("./ta-BkvdJwvc.js")),te:()=>Promise.resolve().then(()=>require("./te-CfeGKsBy.js")),mr:()=>Promise.resolve().then(()=>require("./mr-BkSOwa0H.js")),gu:()=>Promise.resolve().then(()=>require("./gu-_eyxkfNd.js")),kn:()=>Promise.resolve().then(()=>require("./kn-0AnW6O7S.js")),ml:()=>Promise.resolve().then(()=>require("./ml-D_IGAglW.js"))},Fe={en:et};function ja(t,a){return a?t.replace(/\{(\w+)\}/g,(r,n)=>{const o=a[n];return o!==void 0?String(o):`{${n}}`}):t}function ka({defaultLocale:t="en",children:a}){const[r,n]=i.useState(t),[o,l]=i.useState(Fe[t]||et);i.useEffect(()=>{if(n(t),Fe[t])l(Fe[t]);else{const c=la[t];c&&c().then(h=>{Fe[t]=h.default,l(h.default)})}},[t]);const u=i.useCallback(c=>{if(n(c),Fe[c]){l(Fe[c]);return}const h=la[c];h&&h().then(p=>{Fe[c]=p.default,l(p.default)})},[]),s=i.useCallback((c,h)=>{const p=o[c]||et[c]||c;return ja(p,h)},[o]),d=i.useMemo(()=>({locale:r,setLocale:u,t:s,languages:Ie}),[r,u,s]);return e.jsx(Sa.Provider,{value:d,children:a})}function gt(){const t=i.useContext(Sa);return t||{locale:"en",setLocale:()=>{},t:(a,r)=>ja(et[a]||a,r),languages:Ie}}function U(){return gt().t}function wa({gatewayName:t,checkoutUrl:a,onCancel:r,redirectCountdown:n}){const o=U();return e.jsxs("div",{className:"flex flex-col items-center justify-center px-8 py-12 text-center flex-1",style:{background:"var(--t-redirect-bg)",color:"#ffffff"},children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 mb-6",style:{background:"rgba(255,255,255,0.2)",borderRadius:"var(--t-pill-radius)"},children:[e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[e.jsx("path",{d:"M6 1L2 3v3c0 2.5 1.7 4.8 4 5.5 2.3-.7 4-3 4-5.5V3L6 1z",fill:"#22c55e"}),e.jsx("path",{d:"M5 6.5l1 1 2-2.5",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsx("span",{className:"text-[11px] font-medium",children:o("redirect.secureBadge")})]}),e.jsx("h3",{className:"text-[20px] font-semibold mb-2",children:o("redirect.title")}),e.jsx("p",{className:"text-[14px] mb-2 opacity-90",children:o("redirect.description",{gateway:t})}),n!==null&&e.jsx("p",{className:"text-[13px] mb-6 opacity-70",children:o("redirect.countdown",{seconds:String(n)})}),e.jsxs("a",{href:a,className:"w-full font-medium text-[16px] flex items-center justify-center gap-2 transition-all",style:{height:52,borderRadius:"var(--t-cta-radius)",background:"#ffffff",color:"#000000",textDecoration:"none"},target:"_blank",rel:"noopener noreferrer",children:[o("redirect.openTab"),e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:e.jsx("path",{d:"M4 1.5h8.5V10M12 2L2 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsx("p",{className:"text-[11px] mt-2 opacity-60",children:o("redirect.tabHelper")}),e.jsx("button",{className:"w-full font-medium text-[14px] mt-2 transition-all",style:{height:48,borderRadius:"var(--t-cta-radius)",background:"rgba(255,255,255,0.2)",color:"#ffffff"},onClick:r,children:o("redirect.cancel")})]})}function fe({size:t=48}){const a=t<=14?1.5:t<=20?2:3;return e.jsx("div",{className:"shrink-0",style:{width:t,height:t,border:`${a}px solid var(--t-border)`,borderTopColor:"var(--t-text)",borderRadius:"50%",animation:"nramp-spin 0.8s linear infinite",display:"inline-block",verticalAlign:"middle"}})}function Na({className:t="",autoRedirect:a=!1,redirectDelay:r=3e3}){var y;const{order:n,orderStatus:o,goToStep:l,goBack:u}=Me(),s=U(),[d,c]=i.useState(!1),[h,p]=i.useState(null),f=n!=null&&n.checkout.expiresAt?Date.now()>n.checkout.expiresAt:!1;if(i.useEffect(()=>{if((n==null?void 0:n.checkout.method)==="redirect"&&a&&!f){p(Math.ceil(r/1e3));const j=setTimeout(()=>{window.location.href=n.checkout.url},r),N=setInterval(()=>{p(x=>x&&x>1?x-1:null)},1e3);return()=>{clearTimeout(j),clearInterval(N)}}},[n,a,r,f]),i.useEffect(()=>{o&&(o.status==="completed"?l("complete"):["failed","cancelled","expired"].includes(o.status)&&l("error"))},[o==null?void 0:o.status,l]),!n)return e.jsxs("div",{className:`flex flex-col items-center justify-center p-8 ${t}`,style:{color:"var(--t-text)"},children:[e.jsx("p",{className:"text-[15px] mb-4",children:s("checkout.noOrder")}),e.jsx("button",{className:"font-semibold text-[14px] transition-all",style:{height:48,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-surface)",color:"var(--t-text)",paddingLeft:24,paddingRight:24},onClick:u,children:s("checkout.goBack")})]});if(f)return e.jsxs("div",{className:`flex flex-col items-center justify-center p-8 text-center ${t}`,style:{color:"var(--t-text)"},children:[e.jsx("h3",{className:"text-[18px] font-semibold mb-2",children:s("checkout.expired")}),e.jsx("p",{className:"text-[14px] mb-6",style:{color:"var(--t-text-secondary)"},children:s("checkout.expiredDesc")}),e.jsx("button",{className:"w-full font-semibold text-[16px] transition-all",style:{height:60,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-cta-bg)",color:"var(--t-cta-text)"},onClick:u,children:s("checkout.startOver")})]});if(n.checkout.method==="iframe"){const j=n.checkout.url,N=((y=n.checkout.allowedFeatures)==null?void 0:y.join("; "))||"payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share";return sa.createPortal(e.jsxs("div",{style:{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",background:"#000"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",height:48,paddingLeft:8,paddingRight:16,background:"#111",flexShrink:0},children:e.jsxs("button",{onClick:u,style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"none",color:"#fff",fontSize:14,fontWeight:500,cursor:"pointer",padding:"8px 12px",borderRadius:6},children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),s("checkout.cancel")]})}),e.jsxs("div",{style:{flex:1,position:"relative",overflow:"hidden"},children:[!d&&e.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[e.jsx(fe,{size:32}),e.jsx("p",{style:{color:"#888",fontSize:14,marginTop:16},children:s("checkout.loading")})]}),e.jsx("iframe",{src:j,style:{display:d?"block":"none",width:"100%",height:"100%",border:"none"},allow:N,onLoad:()=>c(!0),title:s("checkout.iframeTitle")})]})]}),document.body)}if(n.checkout.method==="redirect")return e.jsx(wa,{gatewayName:n.gateway,checkoutUrl:n.checkout.url,onCancel:u,redirectCountdown:h});if(n.checkout.method==="widget"&&n.widgetConfig){const j=Qr(n.checkout.url,n.widgetConfig);return sa.createPortal(e.jsxs("div",{style:{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",background:"#000"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",height:48,paddingLeft:8,paddingRight:16,background:"#111",flexShrink:0},children:e.jsxs("button",{onClick:u,style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"none",color:"#fff",fontSize:14,fontWeight:500,cursor:"pointer",padding:"8px 12px",borderRadius:6},children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),s("checkout.cancel")]})}),e.jsxs("div",{style:{flex:1,position:"relative",overflow:"hidden"},children:[!d&&e.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[e.jsx(fe,{size:32}),e.jsx("p",{style:{color:"#888",fontSize:14,marginTop:16},children:s("checkout.loading")})]}),e.jsx("iframe",{src:j,style:{display:d?"block":"none",width:"100%",height:"100%",border:"none"},allow:"payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",onLoad:()=>c(!0),title:s("checkout.widgetTitle")})]})]}),document.body)}return e.jsxs("div",{className:`flex flex-col items-center justify-center p-8 ${t}`,style:{color:"var(--t-text)"},children:[e.jsx("p",{className:"text-[15px] mb-4",children:s("checkout.unknownMethod")}),e.jsx("button",{className:"font-semibold text-[14px] transition-all",style:{height:48,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-surface)",color:"var(--t-text)",paddingLeft:24,paddingRight:24},onClick:u,children:s("checkout.goBack")})]})}function Qr(t,a){const r=new URL("/en/partner/widget",t);for(const[n,o]of Object.entries(a))n!=="origin"&&o!=null&&o!==""&&r.searchParams.set(n,String(o));return r.toString()}function Ra({className:t=""}){const{orderStatus:a,orderStatusLoading:r,goToStep:n}=Me(),o=U();i.useEffect(()=>{a&&(a.status==="completed"?n("complete"):["failed","cancelled","expired","refunded"].includes(a.status)&&n("error"))},[a==null?void 0:a.status,n]);const l=()=>{if(!a)return o("processing.default");switch(a.status){case"pending":return o("processing.pending");case"processing":return o("processing.active");default:return o("processing.generic")}};return e.jsxs("div",{className:`flex flex-col items-center justify-center px-8 py-12 text-center ${t}`,children:[e.jsx("div",{className:"mb-6",style:{animation:"processingPulse 1500ms ease-in-out infinite"},children:e.jsx(fe,{size:64})}),e.jsx("h2",{className:"text-[20px] font-semibold mb-3",style:{color:"var(--t-text)"},children:l()}),r&&e.jsx("p",{className:"text-[13px] mb-4",style:{color:"var(--t-text-muted)"},children:o("processing.checkingStatus")}),a&&e.jsxs("div",{className:"w-full mt-6 text-left",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius, 20px)",padding:16},children:[e.jsx(Ke,{label:o("processing.orderId"),value:a.orderId,mono:!0}),e.jsx(Ke,{label:o("processing.provider"),value:a.gateway}),e.jsx(Ke,{label:o("processing.amount"),value:`${a.fiatAmount} ${a.fiatCurrency}`}),e.jsx(Ke,{label:o("processing.receiving"),value:`${a.cryptoAmount||"..."} ${a.cryptoCurrency}`}),e.jsx(Ke,{label:o("processing.network"),value:a.network}),e.jsx(Ke,{label:o("processing.toAddress"),value:`${a.walletAddress.slice(0,10)}...${a.walletAddress.slice(-8)}`,mono:!0})]}),e.jsxs("div",{className:"mt-6",children:[e.jsx("p",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:o("processing.usuallyMinutes")}),e.jsx("p",{className:"text-[12px] mt-1",style:{color:"var(--t-text-muted)"},children:o("processing.safeToClose")})]})]})}function Ke({label:t,value:a,mono:r}){return e.jsxs("div",{className:"flex justify-between items-center py-2",style:{borderBottom:"1px solid var(--t-divider)"},children:[e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:t}),e.jsx("span",{className:`text-[13px] font-medium ${r?"font-mono":""}`,style:{color:"var(--t-text)"},children:a})]})}function Ea({className:t="",explorerUrl:a,onDone:r,doneButtonText:n}){const{orderStatus:o,state:l,dispatch:u}=Me(),s=U(),d=l.flowType==="sell",c=()=>{if(!(o!=null&&o.transactionHash))return null;if(!a){const f={ethereum:"https://etherscan.io/tx/{txHash}",polygon:"https://polygonscan.com/tx/{txHash}",arbitrum:"https://arbiscan.io/tx/{txHash}",optimism:"https://optimistic.etherscan.io/tx/{txHash}",base:"https://basescan.org/tx/{txHash}",bitcoin:"https://mempool.space/tx/{txHash}",solana:"https://solscan.io/tx/{txHash}",avalanche:"https://snowtrace.io/tx/{txHash}",fantom:"https://ftmscan.com/tx/{txHash}"};return(f[l.network]||f.ethereum).replace("{txHash}",o.transactionHash)}return a.replace("{txHash}",o.transactionHash)},h=()=>{r?r():u({type:"RESET"})},p=c();return e.jsxs("div",{className:`flex flex-col items-center px-8 py-12 text-center ${t}`,children:[e.jsx("div",{className:"flex items-center justify-center mb-5",style:{width:64,height:64,borderRadius:"50%",background:"var(--t-success, #10b981)"},children:e.jsx("svg",{viewBox:"0 0 24 24",width:"32",height:"32",fill:"none",stroke:"white",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M4.83 12 9 16.17 19.59 5.59",strokeDasharray:"24",strokeDashoffset:"0",style:{animation:"checkDraw 0.6s ease-out"}})})}),e.jsx("h2",{className:"text-[20px] font-semibold mb-2",style:{color:"var(--t-text)"},children:s(d?"complete.sellTitle":"complete.buyTitle")}),e.jsx("p",{className:"text-[14px] mb-6",style:{color:"var(--t-text-secondary)"},children:d?s("complete.sellDesc",{fiat:(o==null?void 0:o.fiatCurrency)||l.fiatCurrency}):s("complete.buyDesc",{crypto:(o==null?void 0:o.cryptoCurrency)||l.cryptoCurrency})}),o&&e.jsxs("div",{className:"w-full text-left mb-6",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius, 20px)",padding:16},children:[e.jsx(be,{label:s(d?"complete.amountSell":"complete.amountBuy"),value:`${o.cryptoAmount} ${o.cryptoCurrency}`,highlight:!0}),e.jsx(be,{label:s(d?"complete.paidSell":"complete.paidBuy"),value:`${o.fiatAmount} ${o.fiatCurrency}`}),e.jsx(be,{label:s("complete.network"),value:o.network}),e.jsx(be,{label:s("complete.wallet"),value:`${o.walletAddress.slice(0,10)}...${o.walletAddress.slice(-8)}`,mono:!0}),o.transactionHash&&e.jsx(be,{label:s("complete.transaction"),value:`${o.transactionHash.slice(0,10)}...${o.transactionHash.slice(-8)}`,mono:!0}),e.jsx(be,{label:s("complete.provider"),value:o.gateway}),e.jsx(be,{label:s("complete.orderId"),value:o.orderId,mono:!0}),o.completedAt&&e.jsx(be,{label:s("complete.completed"),value:new Date(o.completedAt).toLocaleString()})]}),e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[p&&e.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"w-full font-semibold text-[14px] flex items-center justify-center transition-all",style:{height:48,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-surface)",color:"var(--t-text)",textDecoration:"none"},children:s("complete.viewExplorer")}),e.jsx("button",{className:"w-full font-semibold text-[16px] transition-all",style:{height:60,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-cta-bg)",color:"var(--t-cta-text)"},onClick:h,children:n||s("complete.done")})]})]})}function be({label:t,value:a,mono:r,highlight:n}){return e.jsxs("div",{className:"flex justify-between items-center py-2",style:{borderBottom:"1px solid var(--t-divider)"},children:[e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:t}),e.jsx("span",{className:`text-[13px] font-medium ${r?"font-mono":""}`,style:{color:n?"var(--t-success, #10b981)":"var(--t-text)"},children:a})]})}function Aa({className:t="",onRetry:a,onDone:r,doneButtonText:n,supportEmail:o="support@nowramp.com"}){const{state:l,orderStatus:u,dispatch:s,goToStep:d}=Me(),c=U(),h=l.flowType==="sell",p=()=>{if(u)switch(u.status){case"failed":return c("errorStep.failed");case"cancelled":return c("errorStep.cancelled");case"expired":return c("errorStep.expired");case"refunded":return c("errorStep.refunded");default:return c("errorStep.unknown")}return c("errorStep.unknown")},f=()=>{if(l.errorMessage)return l.errorMessage;if(u)switch(u.status){case"failed":return c(h?"errorStep.failedSell":"errorStep.failedBuy");case"cancelled":return c(h?"errorStep.cancelledSell":"errorStep.cancelledBuy");case"expired":return c(h?"errorStep.expiredSell":"errorStep.expiredBuy");case"refunded":return c(h?"errorStep.refundedSell":"errorStep.refundedBuy");default:return c("errorStep.genericDesc")}return c("errorStep.genericDesc")},y=()=>{s({type:"CLEAR_ERROR"}),a?a():(s({type:"RESET"}),d("amount"))},j=()=>{s({type:"RESET"}),d("amount")};return e.jsxs("div",{className:`flex flex-col items-center px-8 py-12 text-center ${t}`,children:[e.jsx("div",{className:"flex items-center justify-center mb-5",style:{width:64,height:64,borderRadius:"50%",background:"var(--t-error, #EF4444)"},children:e.jsx("svg",{viewBox:"0 0 24 24",width:"32",height:"32",fill:"white",children:e.jsx("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"})})}),e.jsx("h2",{className:"text-[20px] font-semibold mb-2",style:{color:"var(--t-text)"},children:p()}),e.jsx("p",{className:"text-[14px] mb-6",style:{color:"var(--t-text-secondary)"},children:f()}),u&&e.jsx("div",{className:"w-full text-left mb-6",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius, 20px)",padding:16},children:e.jsxs("div",{className:"flex justify-between items-center py-2",children:[e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:c("errorStep.orderId")}),e.jsx("span",{className:"text-[13px] font-medium font-mono",style:{color:"var(--t-text)"},children:u.orderId})]})}),e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx("button",{className:"w-full font-semibold text-[16px] transition-all",style:{height:60,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-cta-bg)",color:"var(--t-cta-text)"},onClick:y,children:c("errorStep.tryAgain")}),e.jsx("button",{className:"w-full font-semibold text-[14px] transition-all",style:{height:48,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-surface)",color:"var(--t-text)"},onClick:j,children:c("errorStep.startOver")}),r&&e.jsx("button",{className:"w-full font-semibold text-[14px] transition-all mt-1",style:{height:48,borderRadius:"var(--t-cta-radius, 100px)",background:"transparent",color:"var(--t-text-secondary)",border:"1px solid var(--t-divider)"},onClick:r,"aria-label":n||c("errorStep.returnToMerchant"),children:n||c("errorStep.return")})]}),e.jsxs("div",{className:"mt-6",children:[e.jsxs("p",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:[c("errorStep.needHelp")," ",e.jsx("a",{href:`mailto:${o}`,className:"underline",style:{color:"var(--t-accent)"},children:o})]}),u&&e.jsx("p",{className:"text-[12px] mt-1",style:{color:"var(--t-text-muted)"},children:c("errorStep.reference",{orderId:u.orderId})})]})]})}const Ve={ethereum:{name:"Ethereum (ERC20)",shortName:"Ethereum",icon:"eth"},bitcoin:{name:"Bitcoin",icon:"btc"},solana:{name:"Solana",icon:"sol"},polygon:{name:"Polygon",icon:"pol"},arbitrum:{name:"Arbitrum",icon:"arb"},avalanche:{name:"Avalanche C-Chain",shortName:"Avalanche",icon:"avax"},litecoin:{name:"Litecoin",icon:"ltc"},tezos:{name:"Tezos",icon:"xtz"},sei:{name:"SEI",icon:"sei"},imx:{name:"Immutable X",shortName:"Immutable",icon:"imx"},galachain:{name:"Gala",icon:"gala"},zksync2:{name:"zkSync Era",shortName:"zkSync",icon:"zksync"},zks:{name:"zkSpace",icon:"zks"},"flow-evm":{name:"Flow (EVM)",shortName:"Flow",icon:"flow"},vara:{name:"Vara",icon:"vara"},venom:{name:"Venom",icon:"venom"},hsk:{name:"HashKey Chain",shortName:"HashKey",icon:"hsk"},mck:{name:"MCK",icon:"mck"},peer:{name:"Peer",icon:"peer"},goerli:{name:"Goerli Testnet",shortName:"Goerli",icon:"eth"},hbartestnet:{name:"Hedera Testnet",shortName:"Hedera",icon:"hbar"},arbitrumrinkeby:{name:"Arbitrum Testnet",shortName:"Arbitrum",icon:"arb"},dydxtestnet:{name:"dYdX Testnet",shortName:"dYdX",icon:"stark"},"zksync-rinkeby":{name:"zkSync Testnet",shortName:"zkSync",icon:"zksync"},ETH:{name:"Ethereum (ERC20)",shortName:"Ethereum",icon:"eth"},BSC:{name:"Binance Smart Chain (BEP20)",shortName:"Binance",icon:"bnb"},BTC:{name:"Bitcoin",icon:"btc"},SOL:{name:"Solana",icon:"sol"},MATIC:{name:"Polygon",icon:"pol"},ARB:{name:"Arbitrum",icon:"arb"},BASE:{name:"Base",icon:"base"},OPTIMISM:{name:"Optimism",icon:"op"},AVAX_C:{name:"Avalanche C-Chain",shortName:"Avalanche C",icon:"avax"},AVAX_X:{name:"Avalanche X-Chain",shortName:"Avalanche X",icon:"avax"},ADA:{name:"Cardano",icon:"ada"},DOT:{name:"Polkadot",icon:"dot"},TRON:{name:"Tron (TRC20)",shortName:"Tron",icon:"trx"},XRP:{name:"Ripple",icon:"xrp"},XLM:{name:"Stellar",icon:"xlm"},ALGO:{name:"Algorand",icon:"algo"},ATOM:{name:"Cosmos",icon:"atom"},NEAR:{name:"NEAR Protocol",shortName:"NEAR",icon:"near"},SUI:{name:"Sui",icon:"sui"},APT:{name:"Aptos",icon:"apt"},TON:{name:"Ton",icon:"ton"},FIL:{name:"Filecoin",icon:"fil"},FLOW:{name:"Flow",icon:"flow"},HBAR:{name:"Hedera Hashgraph",shortName:"Hedera",icon:"hbar"},INJ:{name:"Injective",icon:"inj"},SEI_EVM:{name:"SEI (EVM)",shortName:"SEI",icon:"sei"},ZKSYNC:{name:"zkSync",icon:"zksync"},LINEA:{name:"Linea",icon:"linea"},STARK:{name:"StarkNet",icon:"strk"},LN:{name:"Lightning",icon:"btc"},CELO:{name:"Celo",icon:"celo"},CRO:{name:"Cronos",icon:"cro"},FTM:{name:"Fantom",icon:"ftm"},GLMR:{name:"Moonbeam",icon:"glmr"},MOVR:{name:"Moonriver",icon:"movr"},KSM:{name:"Kusama",icon:"ksm"},EOS:{name:"EOS",icon:"eos"},ETC:{name:"Ethereum Classic",shortName:"ETH Classic",icon:"etc"},LTC:{name:"Litecoin",icon:"ltc"},BCH:{name:"Bitcoin Cash",shortName:"BTC Cash",icon:"bch"},DOGE:{name:"Dogecoin",icon:"doge"},BNB:{name:"Binance Chain (BEP2)",shortName:"Binance",icon:"bnb"},ONE:{name:"Harmony",icon:"one"},KLAY:{name:"Kaia",icon:"kaia"},RON:{name:"Ronin",icon:"ron"},LRC:{name:"Loopring",icon:"lrc"},ICP:{name:"Internet Computer",shortName:"ICP",icon:"icp"},EGLD:{name:"MultiversX",icon:"egld"},FLUX:{name:"Flux",icon:"flux"},KDA:{name:"Kadena",icon:"kda"},WAVES:{name:"Waves",icon:"waves"},XTZ:{name:"Tezos",icon:"xtz"},ACA:{name:"Acala",icon:"aca"},ALEO:{name:"Aleo",icon:"aleo"},ALPH:{name:"Alephium",icon:"alph"},APE:{name:"ApeChain",icon:"ape"},ASTR:{name:"Astar",icon:"astr"},AZERO:{name:"Aleph Zero",icon:"azero"},AZERO_EVM:{name:"Aleph Zero EVM",shortName:"Aleph Zero",icon:"azero"},BAJU:{name:"Bajun Network",shortName:"Bajun",icon:"baju"},BNCPOLKA:{name:"Bifrost Polkadot",shortName:"Bifrost",icon:"bnc"},BNC:{name:"Bifrost Kusama",shortName:"Bifrost",icon:"bnc"},BOBA:{name:"Boba Network",shortName:"Boba",icon:"boba"},BSX:{name:"Basilisk",icon:"bsx"},CHZ:{name:"Chiliz",icon:"chz"},VIC:{name:"Viction",icon:"vic"},CCD:{name:"Concordium",icon:"ccd"},COREUM:{name:"Coreum",icon:"coreum"},DINGO:{name:"Dingocoin",icon:"dingo"},HDX:{name:"Hydration",icon:"hdx"},PLMC:{name:"Polimec",icon:"plmc"},MNT:{name:"Mantle",icon:"mnt"},ERG:{name:"Ergo",icon:"erg"},ECLIPSE:{name:"Eclipse",icon:"eclipse"},FUEL:{name:"Fuel Ignition",shortName:"Fuel",icon:"fuel"},INK:{name:"Ink",icon:"ink"},SOPHON:{name:"Sophon",icon:"sophon"},UNICHAIN:{name:"Unichain",icon:"unichain"},WLD:{name:"Worldchain",icon:"wld"},ETHERLINK:{name:"Etherlink",icon:"etherlink"},MOB:{name:"MobileCoin",icon:"mob"},GALA:{name:"Gala",icon:"gala"},GUNZ:{name:"Gunz",icon:"gun"},HNT:{name:"Helium",icon:"hnt"},BITKUB:{name:"BitKub",icon:"kub"},IMMUTABLE_ZKEVM:{name:"Immutable-zkEVM",shortName:"Immutable",icon:"imx"},INIT:{name:"Initia",icon:"init"},INTR:{name:"Interlay",icon:"intr"},KINESIS:{name:"Kinesis",icon:"kag"},KAR:{name:"Karura",icon:"kar"},KCC:{name:"KuCoin Community Chain",shortName:"KuCoin",icon:"kcs"},KILT:{name:"KILT Spiritnet",shortName:"KILT",icon:"kilt"},KINT:{name:"Kintsugi",icon:"kint"},KMD:{name:"Komodo",icon:"kmd"},LSK:{name:"Lisk",icon:"lsk"},METIS:{name:"Metis Andromeda",shortName:"Metis",icon:"metis"},MYTH:{name:"Myth",icon:"myth"},OAS:{name:"Oasys",icon:"oas"},PEAQ_EVM:{name:"Peaq (EVM)",shortName:"Peaq",icon:"peaq"},PEN:{name:"Pendulum",icon:"pen"},PI:{name:"Pi",icon:"pi"},POLYX:{name:"Polymesh",icon:"polyx"},Q:{name:"QuantumCoin",icon:"q"},QRL:{name:"Quantum Resistant Ledger",shortName:"QRL",icon:"qrl"},QUBIC:{name:"Qubic",icon:"qubic"},RBX:{name:"ReserveBlock",icon:"rbx"},ROLLUX:{name:"Rollux",icon:"rollux"},THORCHAIN:{name:"Thorchain",icon:"rune"},S:{name:"Sonic",icon:"s"},SONIC:{name:"Sonic",icon:"s"},TERNOA:{name:"Ternoa",icon:"caps"},SX:{name:"SX Network",icon:"sol"},WAX:{name:"WAX",icon:"waxp"},XCH:{name:"Chia Chain",icon:"xch"},XPRT:{name:"Persistence",icon:"xprt"},ZETACHAIN:{name:"ZetaChain",icon:"zeta"},ZTG:{name:"Zeitgeist",icon:"ztg"},PLS:{name:"Pulsechain",icon:"pulsechain"},MEZO:{name:"Mezo",icon:"mezo"},BSV:{name:"Bitcoin SV",shortName:"BTC SV",icon:"btc"},MONAD:{name:"Monad",icon:"mon"},SUPRA:{name:"Supra",icon:"supra"},SOMI:{name:"Somnia",icon:"somi"},VERIFIEDX:{name:"VerifiedX",icon:"vfx"},MOVE:{name:"Movement",icon:"move"},FLR:{name:"Flare",icon:"flr"},ASSETHUB:{name:"Asset Hub Polkadot",shortName:"Asset Hub",icon:"dot"},BOB:{name:"BOB",icon:"btc"},GLUE:{name:"Glue",icon:"eth"},DYDX:{name:"StarkEx",icon:"stark"},OKC:{name:"OKX Chain",icon:"eth"},UNI_CHAIN:{name:"UNI",icon:"uni"},ZEC:{name:"ZCash",icon:"zec"}},Ht=[{code:"BTC",name:"Bitcoin",chains:["BTC","LN"],popular:!0},{code:"ETH",name:"Ethereum",chains:["ETH","ARB","BASE","BSC","OPTIMISM","LINEA","ZKSYNC","LRC","STARK","APE","ECLIPSE","FUEL","INK","SOPHON","UNICHAIN","WLD"],popular:!0},{code:"USDC",name:"USD Coin",chains:["ETH","SOL","ARB","BASE","BSC","MATIC","OPTIMISM","AVAX_C","ALGO","APT","CELO","FLOW","HBAR","LINEA","LRC","ZKSYNC","STARK","SUI","XLM","ECLIPSE","HDX","INK","LSK","METIS","MONAD","SEI_EVM","SONIC","SOPHON","SX","UNICHAIN","APE","BNCPOLKA","GLMR","PEAQ_EVM","PLMC","RON","UNI_CHAIN","WLD","BITKUB","BOB","DYDX","ETHERLINK","GLUE","ASSETHUB"],popular:!0},{code:"USDT",name:"Tether",chains:["ETH","BSC","TRON","ARB","MATIC","AVAX_C","SOL","OPTIMISM","ZKSYNC","STARK","APT","CELO","KLAY","LRC","LSK","ECLIPSE","ETHERLINK","OKC","PEAQ_EVM","BNCPOLKA","GLMR","HDX","PLMC","VIC","ASSETHUB"],popular:!0},{code:"SOL",name:"Solana",chains:["SOL"],popular:!0},{code:"XRP",name:"Ripple",chains:["XRP"],popular:!0},{code:"ADA",name:"Cardano",chains:["ADA"],popular:!0},{code:"DOGE",name:"Dogecoin",chains:["DOGE"],popular:!0},{code:"DOT",name:"Polkadot",chains:["DOT","BSC","BNCPOLKA","GLMR","HDX","PLMC"],popular:!0},{code:"AVAX",name:"Avalanche",chains:["AVAX_C","AVAX_X","BSC"],popular:!0},{code:"LINK",name:"ChainLink",chains:["ETH","BSC"],popular:!0},{code:"LTC",name:"Litecoin",chains:["LTC"],popular:!0},{code:"AAVE",name:"Aave",chains:["ETH","BSC"],popular:!1},{code:"ACA",name:"Acala",chains:["ACA"],popular:!1},{code:"ALEO",name:"Aleo",chains:["ALEO"],popular:!1},{code:"ALGO",name:"Algorand",chains:["ALGO"],popular:!1},{code:"ALPH",name:"Alephium",chains:["ALPH"],popular:!1},{code:"APE",name:"ApeCoin",chains:["APE","ETH"],popular:!1},{code:"APT",name:"Aptos",chains:["APT"],popular:!1},{code:"ARB",name:"Arbitrum",chains:["ARB"],popular:!1},{code:"ASTR",name:"Astar",chains:["ASTR"],popular:!1},{code:"ATOM",name:"Cosmos",chains:["ATOM"],popular:!1},{code:"AUDD",name:"Novatti Australian Digital Dollar",chains:["ETH"],popular:!1},{code:"AVT",name:"Aventus",chains:["ETH"],popular:!1},{code:"AXS",name:"Axie Infinity",chains:["ETH","RON"],popular:!1},{code:"AZERO",name:"Aleph Zero",chains:["AZERO","AZERO_EVM"],popular:!1},{code:"BAJU",name:"Bajun Network",chains:["BAJU"],popular:!1},{code:"BARSIK",name:"Hasbulla's Cat",chains:["SOL"],popular:!1},{code:"BAT",name:"Basic Attention Token",chains:["ETH","BSC"],popular:!1},{code:"BCH",name:"Bitcoin Cash",chains:["BCH"],popular:!1},{code:"BNB",name:"Binance Coin",chains:["BNB","BSC"],popular:!1},{code:"BNC",name:"Bifrost Native Coin",chains:["BNC","BNCPOLKA"],popular:!1},{code:"BOBA",name:"Boba Network",chains:["BOBA","ETH"],popular:!1},{code:"BORA",name:"Bora",chains:["KLAY"],popular:!1},{code:"BRETT",name:"Brett",chains:["BASE"],popular:!1},{code:"BSX",name:"Basilisk",chains:["BSX"],popular:!1},{code:"BZR",name:"Bazaars",chains:["ETH"],popular:!1},{code:"CAGA",name:"Crypto Asset Governance Alliance",chains:["ETH"],popular:!1},{code:"CAKE",name:"PancakeSwap",chains:["BSC"],popular:!1},{code:"CAPS",name:"Caps",chains:["TERNOA"],popular:!1},{code:"CELO",name:"Celo",chains:["CELO"],popular:!1},{code:"CHZ",name:"Chiliz",chains:["CHZ","BNB","ETH"],popular:!1},{code:"C98",name:"Coin98",chains:["VIC"],popular:!1},{code:"CCD",name:"Concordium",chains:["CCD"],popular:!1},{code:"COMP",name:"Compound",chains:["ETH","BSC"],popular:!1},{code:"COREUM",name:"Coreum",chains:["COREUM","XRP"],popular:!1},{code:"CRO",name:"Cronos",chains:["CRO"],popular:!1},{code:"CUSD",name:"Celo Dollar",chains:["CELO"],popular:!1},{code:"CVC",name:"Civic",chains:["ETH"],popular:!1},{code:"DAI",name:"Dai",chains:["ETH","BASE","MATIC"],popular:!1},{code:"DINGO",name:"Dingocoin",chains:["DINGO"],popular:!1},{code:"EGLD",name:"MultiversX",chains:["EGLD"],popular:!1},{code:"EMBER",name:"Ember Sword",chains:["MNT"],popular:!1},{code:"EOS",name:"EOS",chains:["EOS"],popular:!1},{code:"ERG",name:"Ergo",chains:["ERG"],popular:!1},{code:"ETC",name:"Ethereum Classic",chains:["ETC","BSC"],popular:!1},{code:"EUR",name:"EURC",chains:["BASE"],popular:!1},{code:"EUROC",name:"Euro Coin",chains:["ETH"],popular:!1},{code:"EURQ",name:"Quantoz EURQ",chains:["ETH"],popular:!1},{code:"EURR",name:"StablR EUR",chains:["ETH"],popular:!1},{code:"EUSD",name:"Electronic USD",chains:["MOB"],popular:!1},{code:"EXIT",name:"EXIT - Designer Token",chains:["BSC"],popular:!1},{code:"FDUSD",name:"First Digital USD",chains:["SUI"],popular:!1},{code:"FIL",name:"Filecoin",chains:["FIL","BSC"],popular:!1},{code:"FLOW",name:"Flow",chains:["FLOW"],popular:!1},{code:"FLR",name:"Flare",chains:["FLR"],popular:!1},{code:"FLUX",name:"Flux",chains:["FLUX"],popular:!1},{code:"FTM",name:"Fantom",chains:["FTM","ETH","BSC"],popular:!1},{code:"GALA",name:"Gala",chains:["GALA"],popular:!1},{code:"GLMR",name:"Moonbeam",chains:["GLMR"],popular:!1},{code:"GMX",name:"GMX",chains:["ARB"],popular:!1},{code:"GNUS",name:"Genius AI",chains:["ETH"],popular:!1},{code:"GRT",name:"The Graph",chains:["ETH","ARB"],popular:!1},{code:"GUN",name:"Gunz",chains:["GUNZ"],popular:!1},{code:"HBAR",name:"Hedera",chains:["HBAR"],popular:!1},{code:"HDX",name:"HydraDX",chains:["HDX"],popular:!1},{code:"HNT",name:"Helium",chains:["HNT"],popular:!1},{code:"HTP",name:"HowToPay",chains:["BSC"],popular:!1},{code:"HVLO",name:"Hivello",chains:["SOL"],popular:!1},{code:"ICP",name:"Internet Computer",chains:["ICP"],popular:!1},{code:"IMX",name:"Immutable X",chains:["ETH"],popular:!1},{code:"INIT",name:"Initia",chains:["INIT"],popular:!1},{code:"INJ",name:"Injective",chains:["INJ"],popular:!1},{code:"INTR",name:"Interlay",chains:["INTR"],popular:!1},{code:"JAM",name:"Jam Tune.FM",chains:["HBAR"],popular:!1},{code:"KAG",name:"Silver",chains:["KINESIS"],popular:!1},{code:"KAIA",name:"Kaia",chains:["KLAY"],popular:!1},{code:"KAR",name:"Karura",chains:["KAR"],popular:!1},{code:"KAU",name:"Gold",chains:["KINESIS"],popular:!1},{code:"KCS",name:"KuCoin Token",chains:["ETH","KCC"],popular:!1},{code:"KDA",name:"Kadena",chains:["KDA"],popular:!1},{code:"KILT",name:"KILT",chains:["KILT"],popular:!1},{code:"KINT",name:"Kintsugi",chains:["KINT"],popular:!1},{code:"KLV",name:"Klever",chains:["TRON"],popular:!1},{code:"KMD",name:"Komodo",chains:["KMD"],popular:!1},{code:"KSM",name:"Kusama",chains:["KSM"],popular:!1},{code:"KUB",name:"Bitkub Coin",chains:["BITKUB"],popular:!1},{code:"LOOKS",name:"LooksRare",chains:["ETH"],popular:!1},{code:"LRC",name:"Loopring",chains:["ETH","LRC"],popular:!1},{code:"LSK",name:"Lisk",chains:["LSK"],popular:!1},{code:"MANA",name:"Decentraland",chains:["ETH"],popular:!1},{code:"MBX",name:"Marblex",chains:["IMMUTABLE_ZKEVM","KLAY"],popular:!1},{code:"MELANIA",name:"Melania",chains:["SOL"],popular:!1},{code:"METAMASKUSD",name:"Metamask USD",chains:["ETH","LINEA"],popular:!1},{code:"METIS",name:"Metis",chains:["METIS"],popular:!1},{code:"MEZOUSD",name:"MUSD",chains:["ETH","MEZO"],popular:!1},{code:"MKR",name:"Maker",chains:["ETH","BSC"],popular:!1},{code:"MNEE",name:"MNEE",chains:["BSV","ETH"],popular:!1},{code:"MNT",name:"Mantle",chains:["ETH","MNT"],popular:!1},{code:"MOB",name:"MobileCoin",chains:["MOB"],popular:!1},{code:"MON",name:"Monad",chains:["MONAD"],popular:!1},{code:"MOVE",name:"Movement",chains:["MOVE"],popular:!1},{code:"MOVR",name:"Moonriver",chains:["MOVR"],popular:!1},{code:"MYTH",name:"Myth",chains:["MYTH"],popular:!1},{code:"NEAR",name:"NEAR Protocol",chains:["NEAR","BSC"],popular:!1},{code:"NEIRO",name:"NEIRO Ethereum",chains:["ETH"],popular:!1},{code:"OAS",name:"Oasys",chains:["OAS"],popular:!1},{code:"OMG",name:"OmiseGo",chains:["ETH"],popular:!1},{code:"OMUSD",name:"Open Money USD",chains:["ETH"],popular:!1},{code:"ONE",name:"Harmony",chains:["ONE","BNB","ETH"],popular:!1},{code:"OP",name:"Optimism",chains:["OPTIMISM"],popular:!1},{code:"ORDER",name:"Orderly Network",chains:["ETH"],popular:!1},{code:"PEAQ",name:"Peaq",chains:["PEAQ_EVM"],popular:!1},{code:"PEN",name:"Pendulum",chains:["PEN"],popular:!1},{code:"PERC",name:"Perion",chains:["ETH"],popular:!1},{code:"PI",name:"Pi",chains:["PI"],popular:!1},{code:"PLMC",name:"Polimec",chains:["PLMC"],popular:!1},{code:"POL",name:"Polygon",chains:["ETH","MATIC"],popular:!1},{code:"POLYX",name:"Polymesh",chains:["POLYX"],popular:!1},{code:"PROPC",name:"Propchain",chains:["ETH"],popular:!1},{code:"PSTAKE",name:"pSTAKE Finance",chains:["ETH"],popular:!1},{code:"Q",name:"QuantumCoin",chains:["Q"],popular:!1},{code:"QRDO",name:"Qredo",chains:["ETH"],popular:!1},{code:"QRL",name:"Quantum Resistant Ledger",chains:["QRL"],popular:!1},{code:"QUBIC",name:"QUBIC",chains:["QUBIC"],popular:!1},{code:"RBX",name:"ReserveBlock",chains:["RBX"],popular:!1},{code:"REVU",name:"Revuto",chains:["ADA"],popular:!1},{code:"RITE",name:"Ritestream",chains:["BSC"],popular:!1},{code:"RLUSD",name:"Ripple USD",chains:["ETH"],popular:!1},{code:"RON",name:"Ronin",chains:["RON"],popular:!1},{code:"RUNE",name:"THORChain",chains:["THORCHAIN"],popular:!1},{code:"S",name:"Sonic",chains:["S"],popular:!1},{code:"SAND",name:"The Sandbox",chains:["ETH","BSC"],popular:!1},{code:"SEI",name:"SEI",chains:["SEI_EVM"],popular:!1},{code:"SNX",name:"Synthetix",chains:["ETH"],popular:!1},{code:"SOIL",name:"Sun Minimeal",chains:["PLS"],popular:!1},{code:"SOLO",name:"Sologenic",chains:["XRP"],popular:!1},{code:"SOMI",name:"Somnia",chains:["SOMI"],popular:!1},{code:"STRK",name:"Starknet",chains:["STARK"],popular:!1},{code:"SUI",name:"Sui",chains:["SUI"],popular:!1},{code:"SUPR",name:"SuperDapp",chains:["ROLLUX"],popular:!1},{code:"SUPRA",name:"Supra",chains:["SUPRA"],popular:!1},{code:"SUSHI",name:"SushiSwap",chains:["ETH","BSC"],popular:!1},{code:"SYS",name:"Syscoin",chains:["ROLLUX"],popular:!1},{code:"TBTC",name:"tBTC",chains:["SUI","STARK"],popular:!1},{code:"TON",name:"Toncoin",chains:["TON"],popular:!1},{code:"TRUMP",name:"TRUMP",chains:["SOL"],popular:!1},{code:"TRX",name:"Tron",chains:["TRON","BSC"],popular:!1},{code:"TWT",name:"Trust Wallet Token",chains:["BSC"],popular:!1},{code:"UNI",name:"Uniswap",chains:["ETH","BSC"],popular:!1},{code:"URANIUM",name:"Uranium",chains:["ETHERLINK"],popular:!1},{code:"USD0",name:"Usual USD",chains:["ETH"],popular:!1},{code:"USD1",name:"World Liberty Financial USD",chains:["SOL"],popular:!1},{code:"USDE",name:"Ethena USDe",chains:["ETH"],popular:!1},{code:"USDP",name:"Pax Dollar",chains:["ETH"],popular:!1},{code:"USDQ",name:"Quantoz USDQ",chains:["ETH"],popular:!1},{code:"USDR",name:"StablR USD",chains:["ETH"],popular:!1},{code:"USDT0",name:"USDT0",chains:["INK"],popular:!1},{code:"VFX",name:"VerifiedX",chains:["VERIFIEDX"],popular:!1},{code:"VERSE",name:"Verse",chains:["ETH","MATIC"],popular:!1},{code:"VIC",name:"Viction",chains:["VIC"],popular:!1},{code:"WAL",name:"Walrus",chains:["SUI"],popular:!1},{code:"WAVES",name:"Waves",chains:["WAVES"],popular:!1},{code:"WAXP",name:"WAX",chains:["WAX"],popular:!1},{code:"WBTC",name:"Wrapped Bitcoin",chains:["ETH","STARK"],popular:!1},{code:"WETH",name:"Wrapped Ether",chains:["ETHERLINK"],popular:!1},{code:"WLD",name:"Worldcoin",chains:["WLD"],popular:!1},{code:"WLFI",name:"World Liberty Financial",chains:["ETH"],popular:!1},{code:"WOLF",name:"LandWolf",chains:["ETH"],popular:!1},{code:"WOMBAT",name:"Wombat",chains:["MATIC"],popular:!1},{code:"XCH",name:"Chia",chains:["XCH"],popular:!1},{code:"XLM",name:"Stellar Lumens",chains:["XLM","BSC"],popular:!1},{code:"XPRT",name:"Persistence",chains:["XPRT"],popular:!1},{code:"XTZ",name:"Tezos",chains:["XTZ","ETHERLINK"],popular:!1},{code:"YFI",name:"yearn.finance",chains:["ETH"],popular:!1},{code:"ZBU",name:"Zeebu",chains:["BSC"],popular:!1},{code:"ZEC",name:"ZCash",chains:["ZEC"],popular:!1},{code:"ZCHF",name:"Frankencoin",chains:["ETH"],popular:!1},{code:"ZETA",name:"Zeta",chains:["ETH","ZETACHAIN"],popular:!1},{code:"ZTG",name:"Zeitgeist",chains:["ZTG"],popular:!1}],zr=Object.fromEntries(Ht.map(t=>[t.code,t.name])),Ta={AED:"ae",ALL:"al",ARS:"ar",AUD:"au",BRL:"br",CAD:"ca",CHF:"ch",CLP:"cl",CZK:"cz",DKK:"dk",EUR:"eu",GBP:"gb",HKD:"hk",IDR:"id",INR:"in",JPY:"jp",KRW:"kr",MXN:"mx",NGN:"ng",NOK:"no",NZD:"nz",PHP:"ph",PLN:"pl",QAR:"qa",SAR:"sa",SEK:"se",SGD:"sg",THB:"th",TRY:"tr",TWD:"tw",USD:"us",VND:"vn",ZAR:"za"};function Ot(t,a=""){return`${a}/crypto-icons/${t.toLowerCase()}.svg`}function Fa(t,a=""){const r=Ta[t]||"us";return`${a}/flags/${r}.svg`}function dt(t){return Ve[t]||Ve[t.toLowerCase()]||Ve[t.toUpperCase()]||Ve[t.toUpperCase().replace(/-/g,"_")]||Ve[t.toLowerCase().replace(/-/g,"_")]}function La(t,a=""){return`${a}/provider-icons/${t.toLowerCase()}.svg`}function ut(t,a=""){const r=dt(t);return r?`${a}/crypto-icons/${r.icon}.svg`:`${a}/crypto-icons/${t.toLowerCase()}.svg`}const Ut=[{code:"ALL",name:"Albania Lek"},{code:"ARS",name:"Argentina Peso"},{code:"AUD",name:"Australian Dollar"},{code:"BRL",name:"Brazilian Real"},{code:"CAD",name:"Canadian Dollar"},{code:"EUR",name:"Euro"},{code:"GBP",name:"British Pound"},{code:"JPY",name:"Japanese Yen"},{code:"USD",name:"US Dollar"},{code:"CHF",name:"Swiss Franc"},{code:"MXN",name:"Mexican Peso"},{code:"INR",name:"Indian Rupee"}],Dt=[{id:"blue",name:"Blue",accent:"#0077FF"},{id:"violet",name:"Violet",accent:"#7C3AED"},{id:"green",name:"Green",accent:"#10B981"},{id:"orange",name:"Orange",accent:"#F59E0B"},{id:"rose",name:"Rose",accent:"#F43F5E"},{id:"mono",name:"Mono",accent:null}],Bt={USDC:{USD:.9962,EUR:1.0814,GBP:1.2573,JPY:.00667,CAD:.7198,AUD:.6384,BRL:.1726,CHF:1.1306,MXN:.0487,INR:.01187,ARS:855e-6,ALL:.01058},USDT:{USD:.9958,EUR:1.081,GBP:1.2568,JPY:.00666,CAD:.7194,AUD:.638,BRL:.1724,CHF:1.1301,MXN:.0486,INR:.01186,ARS:854e-6,ALL:.01057},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},ETH:{USD:316e-6,EUR:343e-6,GBP:399e-6,JPY:211e-8,CAD:228e-6,AUD:202e-6,BRL:547e-7,CHF:358e-6,MXN:154e-7,INR:376e-8,ARS:271e-9,ALL:335e-8},SOL:{USD:.00424,EUR:.004607,GBP:.005356,JPY:284e-7,CAD:.003063,AUD:.002716,BRL:734e-6,CHF:.004812,MXN:207e-6,INR:505e-7,ARS:364e-8,ALL:45e-6},XRP:{USD:.4081,EUR:.4432,GBP:.5153,JPY:.00273,CAD:.2948,AUD:.2614,BRL:.0707,CHF:.463,MXN:.01992,INR:.00486,ARS:35e-5,ALL:.00433},DOGE:{USD:3.896,EUR:4.232,GBP:4.92,JPY:.02607,CAD:2.815,AUD:2.496,BRL:.675,CHF:4.421,MXN:.1902,INR:.04641,ARS:.003345,ALL:.04134},ADA:{USD:1.333,EUR:1.448,GBP:1.683,JPY:.00892,CAD:.963,AUD:.854,BRL:.2309,CHF:1.512,MXN:.0651,INR:.01588,ARS:.001145,ALL:.01414}},Jr=new Set(["USDC","USDT","DAI","BUSD","TUSD","FDUSD","PYUSD","USDP","USDE","USDQ","USDR","USDT0","RLUSD","CUSD","EUSD","OMUSD","MEZOUSD","METAMASKUSD","USD0","USD1","AUDD","EUROC","EURQ","EURR","ZCHF"]);function _t(t){return Jr.has(t.toUpperCase())}function qr(t,a){var r,n;return((r=Bt[t])==null?void 0:r[a])??((n=Bt.USDC)==null?void 0:n[a])??1}function Ia(t){return parseFloat(t.replace(/,/g,""))||0}function mt(t){if(t===0)return"0";if(t>=1e3)return t.toLocaleString("en-US",{maximumFractionDigits:2});if(t>=1)return t.toFixed(2);if(t>=.01)return t.toFixed(4);const a=t.toPrecision(4);return parseFloat(a).toString()}const he=t=>/^#([0-9A-Fa-f]{3}){1,2}$/.test(t),ca=10,da=1e-4,Ma=(()=>{const t=[];for(const a of Ht)for(const r of a.chains)t.push({code:a.code,name:a.name,chain:r,popular:a.popular});return t})();function ua(t){return t.length<=12?t:`${t.slice(0,6)}...${t.slice(-6)}`}function Ua({className:t="",stablecoinParity:a,partnerName:r}){var Z;const{config:n,configLoading:o,state:l,defaultGateway:u,quotes:s,fetchQuotes:d,createOrder:c,orderLoading:h}=Me(),p=U(),f=l.flowType==="sell",[y,j]=i.useState(null),N=n==null?void 0:n.gateways.find(Y=>Y.id===u),x=(Z=s==null?void 0:s.bestQuote)!=null&&Z.exchangeRate?parseFloat(s.bestQuote.exchangeRate):null,k=parseFloat(l.fiatAmount)||0,D=!!(a&&r&&!f&&_t(l.cryptoCurrency)&&x),G=D&&l.cryptoCurrency.toUpperCase().includes(l.fiatCurrency.toUpperCase()),$=D&&k>0?mt(G?k:k/x):null,ee=async()=>{j(null);try{d(),await c()}catch(Y){const ge=Y instanceof Error?Y.message:p("error.createOrderFailed");j(ge)}};return o?e.jsxs("div",{className:`flex flex-col items-center justify-center p-12 ${t}`,children:[e.jsx(fe,{size:32}),e.jsx("p",{className:"text-[14px] mt-4",style:{color:"var(--t-text-secondary)"},children:p("confirm.loading")})]}):e.jsxs("div",{className:`flex flex-col items-center px-8 py-12 ${t}`,children:[e.jsx("h2",{className:"text-[20px] font-semibold mb-6",style:{color:"var(--t-text)"},children:p(f?"confirm.sellTitle":"confirm.buyTitle")}),e.jsxs("div",{className:"w-full text-left mb-6",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius, 20px)",padding:16},children:[N&&e.jsxs("div",{className:"flex justify-between items-center py-2",style:{borderBottom:"1px solid var(--t-divider)"},children:[e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:p("confirm.provider")}),e.jsxs("span",{className:"flex items-center gap-2",children:[N.logo&&e.jsx("img",{src:N.logo,alt:N.name,width:20,height:20,style:{borderRadius:4}}),e.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--t-text)"},children:N.name})]})]}),f?e.jsxs(e.Fragment,{children:[e.jsx(Le,{label:p("confirm.youSell"),value:`${l.cryptoAmount} ${l.cryptoCurrency}`,highlight:!0}),e.jsx(Le,{label:p("confirm.youReceive"),value:p("confirm.payout",{currency:l.fiatCurrency})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Le,{label:p("confirm.youPay"),value:`${l.fiatAmount} ${l.fiatCurrency}`,highlight:!0}),e.jsx(Le,{label:p("confirm.youReceive"),value:$?`${$} ${l.cryptoCurrency}`:p("confirm.cryptoOnNetwork",{crypto:l.cryptoCurrency,network:l.network})}),e.jsx(Le,{label:p("confirm.wallet"),value:ua(l.walletAddress),mono:!0}),D&&$&&e.jsx("div",{className:"py-2 text-[11px]",style:{color:"var(--t-text-muted)",lineHeight:"15px"},children:p("confirm.parityNote",{amount:$,crypto:l.cryptoCurrency,partner:r})})]}),e.jsx(Le,{label:p("confirm.network"),value:l.network}),f&&l.walletAddress&&e.jsx(Le,{label:p("confirm.refundAddress"),value:ua(l.walletAddress),mono:!0})]}),y&&e.jsx("p",{className:"text-[12px] mb-4",style:{color:"#EF4444"},children:y}),e.jsx("button",{className:"w-full font-semibold text-[16px] transition-all flex items-center justify-center gap-2",style:{height:60,borderRadius:"var(--t-cta-radius, 100px)",background:"var(--t-cta-bg)",color:"var(--t-cta-text)",opacity:h?.7:1},disabled:h,onClick:ee,children:h?e.jsxs(e.Fragment,{children:[e.jsx(fe,{size:18}),p("confirm.processing")]}):p(f?"confirm.confirmSell":"confirm.confirmPay")})]})}function Le({label:t,value:a,mono:r,highlight:n}){return e.jsxs("div",{className:"flex justify-between items-center py-2",style:{borderBottom:"1px solid var(--t-divider)"},children:[e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:t}),e.jsx("span",{className:`text-[13px] font-medium ${r?"font-mono":""}`,style:{color:n?"var(--t-success, #10b981)":"var(--t-text)"},children:a})]})}function Se({isOpen:t,onClose:a,children:r,variant:n="bottom"}){const[o,l]=i.useState(!1),[u,s]=i.useState(!1);i.useEffect(()=>{if(t)l(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>s(!0)));else if(o){s(!1);const p=setTimeout(()=>l(!1),250);return()=>clearTimeout(p)}},[t]);const d=i.useCallback(()=>{s(!1),setTimeout(()=>a(),250)},[a]);if(i.useEffect(()=>{if(!t)return;const p=f=>{f.key==="Escape"&&d()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[t,d]),!o)return null;const c=n==="right"?"translateX(100%)":"translateY(24px)";return e.jsx("div",{className:"absolute inset-0 z-20 transition-opacity duration-250",style:{opacity:u?1:0,backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},children:e.jsx("div",{className:"absolute inset-0 flex flex-col transition-transform duration-250 ease-out",style:{background:"var(--t-modal-bg)",borderRadius:"var(--t-container-radius)",transform:u?"translate(0)":c},children:typeof r=="function"?r(d):r})})}function V({w:t,h:a,className:r=""}){return e.jsx("div",{className:`skeleton ${r}`,style:{width:t,height:a}})}function Da(){const t=U();return e.jsxs("div",{className:"flex-1 px-5 flex flex-col",children:[e.jsxs("div",{className:"px-[18px] pt-[14px] pb-[18px]",style:{background:"var(--t-surface)",borderRadius:5},children:[e.jsx(V,{w:70,h:14,className:"mb-3"}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(V,{w:120,h:32}),e.jsx(V,{w:75,h:32})]})]}),e.jsxs("div",{className:"px-[18px] pt-[12px] pb-[18px]",style:{background:"var(--t-surface)",borderRadius:5,marginTop:4},children:[e.jsx(V,{w:50,h:14,className:"mb-3"}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(V,{w:180,h:32}),e.jsx(V,{w:85,h:32})]})]}),e.jsxs("div",{className:"flex justify-between mt-3 px-[2px]",children:[e.jsx(V,{w:140,h:12}),e.jsx(V,{w:90,h:12})]}),e.jsxs("div",{className:"mt-8",children:[e.jsx(V,{w:65,h:14,className:"mb-2.5"}),e.jsx(V,{w:"100%",h:47})]}),e.jsx("div",{className:"flex-1"}),e.jsx(V,{w:"100%",h:60,className:"mb-2"}),e.jsx("div",{className:"text-center py-3",children:e.jsx("span",{className:"text-[11px]",style:{color:"var(--t-text-tertiary)"},children:t("skeleton.poweredBy")})})]})}function Ba({src:t,alt:a,size:r,className:n="",background:o}){const[l,u]=i.useState(!1),[s,d]=i.useState(!1),c=i.useRef(t);c.current!==t&&(c.current=t,u(!1),d(!1));const h=i.useCallback(()=>u(!0),[]),p=i.useCallback(()=>d(!0),[]);return e.jsxs("div",{className:`relative rounded-full shrink-0 ${n}`,style:{width:r,height:r,background:o},children:[!l&&!s&&e.jsx("div",{className:"absolute inset-0 rounded-full animate-pulse",style:{background:"var(--t-pill-bg, #333)"}}),s?e.jsx("div",{className:"absolute inset-0 rounded-full flex items-center justify-center font-bold",style:{background:"var(--t-pill-bg, #333)",color:"var(--t-text-muted)",fontSize:Math.max(8,r*.35)},children:a.slice(0,3)}):e.jsx("img",{src:t,alt:a,width:r,height:r,onLoad:h,onError:p,className:`rounded-full ${l?"opacity-100":"opacity-0"}`,style:{width:r,height:r,transition:"opacity 0.15s ease-in"}})]})}function Kt({ticker:t,size:a=32,baseUrl:r=""}){return e.jsx(Ba,{src:Ot(t,r),alt:t,size:a,background:"#ffffff"})}function vt({currencyCode:t,size:a=16,baseUrl:r=""}){return e.jsx(Ba,{src:Fa(t,r),alt:t,size:a})}function Vt({size:t=32,color:a="#888"}){return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 32 32",fill:"none",children:[e.jsx("circle",{cx:"16",cy:"16",r:"16",fill:a}),e.jsx("circle",{cx:"16",cy:"16",r:"8",stroke:"white",strokeWidth:"1.5",fill:"none"})]})}function en({size:t=24}){return e.jsx("div",{className:"rounded-full flex items-center justify-center shrink-0",style:{width:t,height:t,background:"var(--t-card-icon-bg)"},children:e.jsxs("svg",{width:t*.6,height:t*.58,viewBox:"0 0 25 24",fill:"none",children:[e.jsx("path",{d:"M23.292 7.5H1.70801L12.5 0.592773L23.292 7.5Z",stroke:"var(--t-card-icon-stroke)",strokeWidth:"1"}),e.jsx("rect",{x:"3",y:"10",width:"1.5",height:"11",fill:"var(--t-card-icon-stroke)"}),e.jsx("rect",{x:"9",y:"10",width:"1.5",height:"11",fill:"var(--t-card-icon-stroke)"}),e.jsx("rect",{x:"15",y:"10",width:"1.5",height:"11",fill:"var(--t-card-icon-stroke)"}),e.jsx("rect",{x:"21",y:"10",width:"1.5",height:"11",fill:"var(--t-card-icon-stroke)"}),e.jsx("rect",{y:"23",width:"25",height:"1",fill:"var(--t-card-icon-stroke)"})]})})}function Pa({size:t=32}){return e.jsx("div",{className:"rounded-full flex items-center justify-center text-white font-semibold shrink-0",style:{width:t,height:t,backgroundColor:"#333",fontSize:t*.45},children:"R"})}function tn({size:t=32}){return e.jsx("div",{className:"flex items-center justify-center shrink-0",style:{width:t,height:t,background:"#000",borderRadius:t*.2},children:e.jsx("svg",{width:t*.72,height:t*.288,viewBox:"0 0 50 20",fill:"none",children:e.jsx("path",{d:"M9.14529 2.57901C8.55528 3.25398 7.61984 3.7887 6.68351 3.70976C6.56186 2.7971 7.02999 1.82591 7.55883 1.23105C8.14846 0.535892 9.166 0.0403839 9.9999 0C10.1017 0.952461 9.71518 1.88488 9.14529 2.57901ZM9.98932 3.88805C10.5171 3.92756 12.0384 4.08587 13.0125 5.48951C12.9312 5.54899 11.2066 6.51813 11.2267 8.55562C11.247 10.9883 13.4176 11.7995 13.4379 11.8193C13.4176 11.8787 13.0939 12.9667 12.3023 14.0939C11.6126 15.083 10.902 16.052 9.76606 16.0717C8.67023 16.0915 8.30483 15.4389 7.04742 15.4389C5.78949 15.4389 5.38394 16.052 4.34875 16.0915C3.25329 16.1307 2.42185 15.0429 1.73195 14.054C0.310872 12.0564 -0.764097 8.41705 0.696758 5.96431C1.40722 4.73809 2.70553 3.96677 4.10507 3.94695C5.18064 3.92756 6.17501 4.63962 6.82446 4.63962C7.47376 4.63962 8.62918 3.80889 9.98932 3.88805ZM23.544 1.13133C26.4989 1.13133 28.5569 3.11593 28.5569 6.00514C28.5569 8.90473 26.4567 10.8997 23.4702 10.8997H20.1987V15.9694H17.8349V1.13133H23.544ZM20.1987 8.96648H22.9108C24.9692 8.96648 26.1402 7.88694 26.1402 6.01552C26.1402 4.14448 24.9688 3.07467 22.9212 3.07467H20.1987V8.96648ZM29.1434 12.8945C29.1434 10.9923 30.6314 9.90226 33.375 9.7378L36.3194 9.56295V8.74027C36.3194 7.53753 35.5071 6.87939 34.0613 6.87939C32.8683 6.87939 32.0028 7.47564 31.8242 8.39042H29.6919C29.7556 6.46802 31.6126 5.06972 34.1246 5.06972C36.8262 5.06972 38.5886 6.44746 38.5886 8.58634V15.969H36.4042V14.1901H36.3515C35.7287 15.3518 34.3565 16.0817 32.8683 16.0817C30.6734 16.0817 29.1434 14.8072 29.1434 12.8945ZM36.3195 11.9385V11.1054L33.6918 11.27C32.2138 11.3624 31.4442 11.897 31.4442 12.8325C31.4442 13.7375 32.2459 14.3238 33.5018 14.3238C35.1055 14.3238 36.3195 13.3262 36.3195 11.9385ZM40.597 19.9377V18.1592C40.7449 18.1794 41.1032 18.1999 41.2935 18.1999C42.3381 18.1999 42.9291 17.7688 43.288 16.6575L43.4992 15.9997L39.4992 5.20338H41.9686L44.7548 13.9638H44.8077L47.5936 5.20338H50L45.8524 16.5445C44.9024 19.1463 43.8155 20 41.515 20C41.3354 20 40.7549 19.9793 40.597 19.9377Z",fill:"white"})})})}function an({size:t=32}){return e.jsx("div",{className:"flex items-center justify-center shrink-0",style:{width:t,height:t,background:"#3C4043",borderRadius:t*.2},children:e.jsxs("svg",{width:t*.72,height:t*.296,viewBox:"0 0 51 21",fill:"none",children:[e.jsx("path",{d:"M50.9156 5.87122L44.6406 20.2837H42.6992L45.0289 15.2416L40.9009 5.87122H42.9451L45.929 13.0573H45.9689L48.8714 5.87122H50.9156Z",fill:"white"}),e.jsx("path",{d:"M39.3906 6.65832C38.5866 5.91563 37.4895 5.54547 36.0995 5.54547C34.314 5.54547 32.9657 6.19816 32.0513 7.50532L33.7084 8.54664C34.3211 7.66089 35.1512 7.21951 36.2011 7.21951C36.8967 7.21951 37.5008 7.44661 38.0194 7.9023C38.538 8.35948 38.7964 8.91352 38.7964 9.5665V9.99507C38.0751 9.58796 37.1536 9.38381 36.0366 9.38381C34.7297 9.38381 33.6839 9.68959 32.8998 10.3023C32.1172 10.9151 31.7256 11.738 31.7256 12.7706C31.7256 13.8033 32.0969 14.5675 32.8396 15.2216C33.5808 15.8758 34.5065 16.2016 35.6092 16.2016C36.9033 16.2016 37.9389 15.6302 38.7147 14.4876H38.7976V15.8761H40.5944V9.70955C40.5944 8.4167 40.1944 7.39982 39.3903 6.65862L39.3906 6.65832ZM37.8665 13.6501C37.2451 14.2343 36.5424 14.5272 35.7511 14.5272C35.1926 14.5272 34.7068 14.3645 34.2913 14.0387C33.8741 13.7103 33.6673 13.3032 33.6673 12.8132C33.6673 12.2675 33.923 11.8134 34.4344 11.4462C34.9443 11.079 35.5815 10.8948 36.3442 10.8948C37.3926 10.8948 38.211 11.1249 38.7967 11.5889C38.7967 12.3775 38.4867 13.0645 37.8668 13.6501H37.8665Z",fill:"white"}),e.jsx("path",{d:"M30.4166 2.52282C29.5296 1.67999 28.4552 1.25739 27.1883 1.25739H22.2017V15.8758H24.0813V9.95362H27.188C28.4678 9.95362 29.5448 9.53936 30.4163 8.70815C31.3175 7.87962 31.7661 6.84397 31.7661 5.60565C31.7661 4.36733 31.3175 3.36744 30.4163 2.52312L30.4166 2.52282ZM29.0895 7.40248C28.598 7.90525 27.9781 8.15798 27.2297 8.15798H24.0816V3.05272H27.2297C27.9781 3.05272 28.5983 3.31141 29.0895 3.82849C29.5937 4.33276 29.845 4.92554 29.845 5.60535C29.845 6.28516 29.5934 6.8994 29.0895 7.40218V7.40248Z",fill:"white"}),e.jsx("path",{d:"M16.2663 11.4026C15.8887 12.6964 15.1901 13.9058 14.2131 14.8354C14.1815 14.8655 14.1496 14.895 14.1178 14.9245C14.116 14.9263 14.1148 14.9277 14.113 14.9292C13.1524 15.8144 11.9487 16.4295 10.6737 16.7272C10.6621 16.7302 10.6502 16.7329 10.6385 16.7356C10.2484 16.8241 9.85204 16.8888 9.45357 16.929C8.81668 16.9928 8.17293 16.9928 7.53723 16.9222C7.22102 16.8873 6.9063 16.8348 6.59546 16.7639C6.49293 16.7407 6.39101 16.7156 6.28938 16.6882C5.16759 16.3884 4.11256 15.8564 3.20476 15.1337C3.0018 14.971 2.80599 14.7987 2.61823 14.6184C2.61257 14.613 2.60721 14.6077 2.60154 14.6026C1.93962 13.9657 1.38081 13.22 0.956413 12.4034C0.938829 12.3691 0.921246 12.3352 0.90396 12.3009C0.717393 11.9319 0.559138 11.5493 0.429793 11.1574C0.364822 10.9618 0.307302 10.7634 0.257233 10.5631C0.226834 10.443 0.199117 10.3226 0.174678 10.2013C0.141299 10.0397 0.112986 9.87702 0.0894411 9.714C-0.0509314 8.75165 -0.0267907 7.76517 0.166929 6.81118C0.176168 6.76468 0.185705 6.71879 0.195838 6.6723C0.345748 5.97997 0.582981 5.31 0.903662 4.67698C1.53102 3.42525 2.48025 2.33983 3.62498 1.53514H3.62528C3.73704 1.45616 3.85029 1.38076 3.96533 1.30775C3.99424 1.28957 4.02345 1.27169 4.05206 1.25351C4.11018 1.21774 4.16889 1.18257 4.2276 1.148C4.34562 1.07945 4.46513 1.01329 4.58643 0.950111C4.64723 0.918519 4.70773 0.887822 4.76912 0.858018C5.0755 0.707811 5.39111 0.576975 5.71418 0.466108C5.77021 0.446438 5.82624 0.427961 5.88227 0.409781C5.96661 0.38266 6.05095 0.356731 6.13619 0.332292C6.19312 0.315603 6.25064 0.300106 6.30786 0.284906C6.36448 0.269707 6.4217 0.255401 6.47863 0.241393C6.51111 0.233346 6.5433 0.225895 6.57579 0.218146C6.62764 0.206225 6.6792 0.194901 6.73136 0.183874C6.73464 0.183278 6.73762 0.182681 6.7406 0.181787C6.90481 0.147216 7.06992 0.117711 7.23593 0.093273C7.25262 0.0905907 7.2693 0.088205 7.28629 0.0861187C8.67482 -0.111774 10.114 0.0309834 11.4319 0.518561C12.4443 0.889311 13.3712 1.47882 14.1651 2.21048C13.899 2.4957 13.6138 2.76661 13.3378 3.04705C12.8151 3.56533 12.2971 4.08807 11.774 4.60605C11.7734 4.60545 11.7723 4.60486 11.7717 4.60367L11.7645 4.61082C11.2465 4.11639 10.6192 3.74564 9.9346 3.53642C9.1314 3.29412 8.26652 3.26044 7.44425 3.43658C7.14741 3.49946 6.85772 3.59066 6.57847 3.70779C6.57519 3.70898 6.57221 3.71047 6.56893 3.71166C5.95231 3.97393 5.38843 4.36047 4.92022 4.83881C4.3638 5.39941 3.94089 6.09352 3.68906 6.83979C3.68727 6.8386 3.68548 6.83711 3.68369 6.83591C3.31831 7.89571 3.32308 9.07889 3.68399 10.1384C3.68191 10.1402 3.67982 10.1417 3.67773 10.1435C3.67833 10.1446 3.67863 10.1458 3.67893 10.147C3.68071 10.1461 3.6822 10.1446 3.68399 10.1435C4.03567 11.1892 4.72501 12.1158 5.62835 12.7482C6.19371 13.1473 6.84014 13.428 7.51995 13.5654C8.18545 13.6987 8.87927 13.6844 9.54477 13.5705C10.2103 13.4564 10.8519 13.209 11.4128 12.8338C11.4128 12.8338 11.413 12.834 11.4134 12.8344C11.4164 12.8326 11.4194 12.8308 11.4221 12.8287C12.3081 12.2294 12.9301 11.2691 13.1095 10.2147H8.48467V6.90178H8.48944V6.89701H16.4797C16.7458 8.38955 16.6889 9.94378 16.2657 11.4029L16.2663 11.4026Z",fill:"white"})]})})}function Ha({size:t=32}){return e.jsx("div",{className:"rounded-full flex items-center justify-center shrink-0",style:{width:t,height:t,background:"#003087"},children:e.jsx("span",{className:"text-white font-bold",style:{fontSize:t*.38},children:"P"})})}function rn({size:t=32}){return e.jsx("div",{className:"flex items-center justify-center shrink-0",style:{width:t,height:t,background:"#1A1F71",borderRadius:t*.2},children:e.jsxs("svg",{width:t*.72,height:t*.234,viewBox:"0 0 43 14",fill:"none",children:[e.jsx("path",{d:"M18.3629 13.5165H14.9302L17.0772 0.240662H20.5097L18.3629 13.5165Z",fill:"white"}),e.jsx("path",{d:"M30.806 0.565203C30.1289 0.296586 29.055 0 27.7271 0C24.3372 0 21.95 1.80767 21.9354 4.3921C21.9072 6.29889 23.6445 7.35796 24.9439 7.99375C26.2719 8.64342 26.7234 9.06747 26.7234 9.64656C26.7099 10.5359 25.6502 10.9459 24.6619 10.9459C23.2914 10.9459 22.5571 10.7345 21.4412 10.2397L20.9891 10.0276L20.5088 13.0077C21.3139 13.3745 22.7972 13.7 24.3372 13.7143C27.939 13.7143 30.2839 11.9346 30.3117 9.18047C30.3254 7.66919 29.4081 6.51119 27.4303 5.56493C26.2297 4.95749 25.4944 4.54791 25.4944 3.92639C25.5085 3.36137 26.1163 2.78265 27.4716 2.78265C28.5876 2.75431 29.4075 3.02255 30.0286 3.29098L30.3391 3.43195L30.806 0.565203Z",fill:"white"}),e.jsx("path",{d:"M35.3681 8.81332C35.6508 8.05064 36.7386 5.09886 36.7386 5.09886C36.7243 5.1272 37.0207 4.3221 37.1902 3.82785L37.4301 4.97178C37.4301 4.97178 38.0802 8.14956 38.2213 8.81332C37.6848 8.81332 36.0461 8.81332 35.3681 8.81332ZM39.6053 0.240662H36.9501C36.1313 0.240662 35.5092 0.480559 35.156 1.34216L30.0571 13.5163H33.659C33.659 13.5163 34.2519 11.8777 34.3794 11.5248C34.7745 11.5248 38.2784 11.5248 38.7867 11.5248C38.8853 11.9909 39.1963 13.5163 39.1963 13.5163H42.3747L39.6053 0.240662Z",fill:"white"}),e.jsx("path",{d:"M12.0629 0.240662L8.70119 9.29349L8.33383 7.45747C7.71232 5.33894 5.76311 3.03721 3.58789 1.89272L6.66713 13.5024H10.2971L15.6927 0.240662H12.0629Z",fill:"white"}),e.jsx("path",{d:"M5.57939 0.240662H0.0565013L0 0.508903C4.3082 1.61059 7.16143 4.26616 8.3337 7.45803L7.13309 1.35661C6.93542 0.508715 6.32798 0.268631 5.57939 0.240662Z",fill:"white"})]})})}function nn({size:t=32}){const a=t*.8;return e.jsx("div",{className:"flex items-center justify-center shrink-0",style:{width:t,height:t},children:e.jsxs("svg",{width:a,height:a*.625,viewBox:"0 0 48 30",fill:"none",children:[e.jsx("circle",{cx:"18",cy:"15",r:"14",fill:"#EB001B"}),e.jsx("circle",{cx:"30",cy:"15",r:"14",fill:"#F79E1B"}),e.jsx("path",{d:"M24 2.35A14 14 0 0 1 24 27.65A14 14 0 0 1 24 2.35Z",fill:"#FF5F00"})]})})}function on({size:t=32}){const a=t*.56,r=a*.65,n=Math.max(2,a*.1),o=a*.2;return e.jsxs("div",{className:"flex items-center justify-center shrink-0",style:{width:t,height:t},children:[e.jsx("div",{style:{width:a,height:r,background:"#1A1F71",borderRadius:n,position:"relative",zIndex:2,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsxs("svg",{width:a*.7,height:r*.35,viewBox:"0 0 43 14",fill:"none",children:[e.jsx("path",{d:"M18.3629 13.5165H14.9302L17.0772 0.240662H20.5097L18.3629 13.5165Z",fill:"white"}),e.jsx("path",{d:"M12.0629 0.240662L8.70119 9.29349L8.33383 7.45747C7.71232 5.33894 5.76311 3.03721 3.58789 1.89272L6.66713 13.5024H10.2971L15.6927 0.240662H12.0629Z",fill:"white"}),e.jsx("path",{d:"M5.57939 0.240662H0.0565013L0 0.508903C4.3082 1.61059 7.16143 4.26616 8.3337 7.45803L7.13309 1.35661C6.93542 0.508715 6.32798 0.268631 5.57939 0.240662Z",fill:"white"}),e.jsx("path",{d:"M30.806 0.565203C30.1289 0.296586 29.055 0 27.7271 0C24.3372 0 21.95 1.80767 21.9354 4.3921C21.9072 6.29889 23.6445 7.35796 24.9439 7.99375C26.2719 8.64342 26.7234 9.06747 26.7234 9.64656C26.7099 10.5359 25.6502 10.9459 24.6619 10.9459C23.2914 10.9459 22.5571 10.7345 21.4412 10.2397L20.9891 10.0276L20.5088 13.0077C21.3139 13.3745 22.7972 13.7 24.3372 13.7143C27.939 13.7143 30.2839 11.9346 30.3117 9.18047C30.3254 7.66919 29.4081 6.51119 27.4303 5.56493C26.2297 4.95749 25.4944 4.54791 25.4944 3.92639C25.5085 3.36137 26.1163 2.78265 27.4716 2.78265C28.5876 2.75431 29.4075 3.02255 30.0286 3.29098L30.3391 3.43195L30.806 0.565203Z",fill:"white"}),e.jsx("path",{d:"M35.3681 8.81332C35.6508 8.05064 36.7386 5.09886 36.7386 5.09886C36.7243 5.1272 37.0207 4.3221 37.1902 3.82785L37.4301 4.97178C37.4301 4.97178 38.0802 8.14956 38.2213 8.81332C37.6848 8.81332 36.0461 8.81332 35.3681 8.81332ZM39.6053 0.240662H36.9501C36.1313 0.240662 35.5092 0.480559 35.156 1.34216L30.0571 13.5163H33.659C33.659 13.5163 34.2519 11.8777 34.3794 11.5248C34.7745 11.5248 38.2784 11.5248 38.7867 11.5248C38.8853 11.9909 39.1963 13.5163 39.1963 13.5163H42.3747L39.6053 0.240662Z",fill:"white"})]})}),e.jsx("div",{style:{width:a,height:r,background:"#252525",borderRadius:n,marginLeft:-o,position:"relative",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},children:e.jsxs("svg",{width:r*.85,height:r*.6,viewBox:"0 0 48 30",fill:"none",children:[e.jsx("circle",{cx:"18",cy:"15",r:"14",fill:"#EB001B"}),e.jsx("circle",{cx:"30",cy:"15",r:"14",fill:"#F79E1B"}),e.jsx("path",{d:"M24 2.35A14 14 0 0 1 24 27.65A14 14 0 0 1 24 2.35Z",fill:"#FF5F00"})]})})]})}function sn({size:t=18}){return e.jsx("div",{className:"rounded-full bg-white flex items-center justify-center shrink-0",style:{width:t,height:t},children:e.jsx("span",{className:"text-black font-bold",style:{fontSize:t*.55},children:"C"})})}function xe(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"var(--t-text-secondary)",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Oa(){return e.jsx("svg",{width:"8",height:"14",viewBox:"0 0 8 14",fill:"none",children:e.jsx("path",{d:"M1 1L7 7L1 13",stroke:"var(--t-icon-stroke)",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ln({onClick:t}){return e.jsx("button",{onClick:t,className:"hover:opacity-70 transition-opacity",children:e.jsx("svg",{width:"24",height:"16",viewBox:"0 0 24 16",fill:"none",children:e.jsx("path",{d:"M22.4004 12V4C22.4004 2.67452 21.3255 1.59961 20 1.59961H6.7998V14.4004H20V16H4V14.4004H5.2002V1.59961H4C2.67452 1.59961 1.59961 2.67452 1.59961 4V12C1.59961 13.3255 2.67452 14.4004 4 14.4004V16L3.79395 15.9951C1.68056 15.8879 0 14.14 0 12V4C0 1.79086 1.79086 6.44266e-08 4 0H20C22.2091 0 24 1.79086 24 4V12L23.9951 12.2061C23.8913 14.2512 22.2512 15.8913 20.2061 15.9951L20 16V14.4004C21.3255 14.4004 22.4004 13.3255 22.4004 12Z",fill:"var(--t-icon-stroke)"})})})}function cn({size:t=40}){return e.jsx("div",{className:"rounded-full flex items-center justify-center shrink-0",style:{width:t,height:t,background:"var(--t-surface)"},children:e.jsxs("svg",{width:t*.5,height:t*.5,viewBox:"0 0 20 20",fill:"none",children:[e.jsx("circle",{cx:"10",cy:"10",r:"7.5",stroke:"var(--t-text)",strokeWidth:"1.5"}),e.jsx("path",{d:"M10 2.5A7.5 7.5 0 0 1 10 17.5",fill:"var(--t-text)"})]})})}function _a({size:t=20}){const a=t*.6;return e.jsx("div",{className:"rounded-full flex items-center justify-center shrink-0",style:{width:t,height:t,background:"var(--t-payment-icon-bg)"},children:e.jsxs("svg",{width:a,height:a,viewBox:"0 0 12 12",fill:"none",children:[e.jsx("path",{d:"M11 3.5H1L6 0.5L11 3.5Z",stroke:"white",strokeWidth:"0.8"}),e.jsx("rect",{x:"1.5",y:"4.5",width:"0.8",height:"5",fill:"white"}),e.jsx("rect",{x:"4.2",y:"4.5",width:"0.8",height:"5",fill:"white"}),e.jsx("rect",{x:"6.9",y:"4.5",width:"0.8",height:"5",fill:"white"}),e.jsx("rect",{x:"9.6",y:"4.5",width:"0.8",height:"5",fill:"white"}),e.jsx("rect",{x:"0.5",y:"10.5",width:"11",height:"0.5",fill:"white"})]})})}function Ka({size:t=20}){const a=t*.6;return e.jsx("div",{className:"rounded-full flex items-center justify-center shrink-0",style:{width:t,height:t,background:"var(--t-payment-icon-bg)"},children:e.jsxs("svg",{width:a,height:a*.75,viewBox:"0 0 12 9",fill:"none",children:[e.jsx("rect",{x:"0.5",y:"0.5",width:"11",height:"8",rx:"1.5",stroke:"white",strokeWidth:"0.8",fill:"none"}),e.jsx("rect",{x:"0.5",y:"2.5",width:"11",height:"1.5",fill:"white"}),e.jsx("rect",{x:"2",y:"5.5",width:"3",height:"1",rx:"0.5",fill:"white"})]})})}function Va({size:t=20}){return e.jsx("div",{className:"rounded-full flex items-center justify-center shrink-0",style:{width:t,height:t,background:"var(--t-payment-icon-bg)"},children:e.jsxs("svg",{width:10,height:12,viewBox:"0 0 10 12",fill:"none",children:[e.jsx("path",{d:"M8.32 6.32C8.31 5.1 9.32 4.5 9.37 4.47C8.77 3.59 7.83 3.47 7.5 3.46C6.73 3.38 5.99 3.93 5.6 3.93C5.2 3.93 4.59 3.47 3.94 3.48C3.1 3.5 2.32 3.99 1.89 4.74C1.01 6.27 1.66 8.52 2.5 9.76C2.93 10.37 3.43 11.05 4.08 11.03C4.71 11 4.95 10.63 5.71 10.63C6.46 10.63 6.69 11.03 7.34 11.02C8.02 11 8.45 10.4 8.87 9.79C9.36 9.09 9.56 8.41 9.57 8.37C9.55 8.37 8.33 7.88 8.32 6.32Z",fill:"white"}),e.jsx("path",{d:"M7.13 2.57C7.49 2.12 7.74 1.5 7.67 0.88C7.15 0.91 6.51 1.24 6.13 1.68C5.79 2.08 5.5 2.72 5.58 3.32C6.16 3.37 6.76 3.02 7.13 2.57Z",fill:"white"})]})})}function Wa({size:t=20}){return e.jsx("div",{className:"rounded-full flex items-center justify-center shrink-0",style:{width:t,height:t,background:"var(--t-payment-icon-bg)"},children:e.jsxs("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",children:[e.jsx("path",{d:"M9.68 5.11C9.68 4.76 9.65 4.42 9.6 4.09H5V6.02H7.62C7.52 6.58 7.2 7.05 6.73 7.37V8.5H8.26C9.14 7.69 9.68 6.51 9.68 5.11Z",fill:"white"}),e.jsx("path",{d:"M5 9.58C6.28 9.58 7.35 9.14 8.26 8.5L6.73 7.37C6.33 7.64 5.81 7.79 5 7.79C3.78 7.79 2.73 6.97 2.38 5.87H0.8V7.04C1.71 8.84 3.22 9.58 5 9.58Z",fill:"white"}),e.jsx("path",{d:"M2.38 5.87C2.28 5.57 2.22 5.25 2.22 4.93C2.22 4.6 2.28 4.28 2.38 3.98V2.82H0.8C0.46 3.49 0.27 4.24 0.27 5.03C0.27 5.73 0.44 6.4 0.73 7L2.38 5.87Z",fill:"white"}),e.jsx("path",{d:"M5 2.07C5.74 2.07 6.39 2.32 6.91 2.82L8.29 1.45C7.35 0.57 6.28 0.07 5 0.07C3.22 0.07 1.71 1.14 0.8 2.82L2.38 3.98C2.73 2.88 3.78 2.07 5 2.07Z",fill:"white"})]})})}function dn({size:t=24}){const a=t*1.15;return e.jsxs("svg",{width:a,height:t,viewBox:"0 0 48 32",fill:"none",preserveAspectRatio:"xMidYMid meet",children:[e.jsx("path",{d:"M0 0H5.76C11.0619 0 15.36 4.47715 15.36 10V32H0V0Z",fill:"var(--t-text)"}),e.jsx("path",{d:"M16.32 0H22.08C27.3819 0 31.68 4.47715 31.68 10V32H16.32V0Z",fill:"var(--t-text)"}),e.jsx("path",{d:"M32.64 8C32.64 3.58172 36.0785 0 40.32 0C44.5615 0 48 3.58172 48 8C48 12.4183 44.5615 16 40.32 16C36.0785 16 32.64 12.4183 32.64 8Z",fill:"var(--t-text)"})]})}function pt({size:t=12}){return e.jsx("div",{className:"flex items-center justify-center rounded-full shrink-0",style:{width:t,height:t,background:"var(--t-text-secondary)"},children:e.jsx("span",{style:{fontSize:t*.75,fontWeight:500,lineHeight:1,letterSpacing:"0.18px",color:"var(--t-bg)"},children:"i"})})}function Ga({onClick:t}){return e.jsx("button",{onClick:t,className:"flex items-center justify-center rounded-full transition-opacity hover:opacity-70",style:{width:40,height:40},children:e.jsxs("svg",{width:"20",height:"4",viewBox:"0 0 20 4",fill:"none",children:[e.jsx("circle",{cx:"2",cy:"2",r:"2",fill:"var(--t-text)"}),e.jsx("circle",{cx:"10",cy:"2",r:"2",fill:"var(--t-text)"}),e.jsx("circle",{cx:"18",cy:"2",r:"2",fill:"var(--t-text)"})]})})}function un({size:t=16}){return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",children:[e.jsx("circle",{cx:"7",cy:"7",r:"5.25",stroke:"var(--t-text-secondary)",strokeWidth:"1.2"}),e.jsx("path",{d:"M11 11l3.5 3.5",stroke:"var(--t-text-secondary)",strokeWidth:"1.2",strokeLinecap:"round"})]})}function mn({size:t=12}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M6 10V2M6 2L2.5 5.5M6 2l3.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function $a({size:t=14}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 14 14",fill:"none",children:e.jsx("path",{d:"M11.5 3.5L5.5 10.5L2.5 7.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ht({size:t=12}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M2 2l8 8M10 2l-8 8",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})}function Za(t,a=32,r){switch(t){case"bank":return e.jsx(_a,{size:a});case"card":return e.jsx(Ka,{size:a});case"applepay":return e.jsx(Va,{size:a});case"googlepay":return e.jsx(Wa,{size:a});case"revolut":return e.jsx(Pa,{size:a});case"paypal":return e.jsx(Ha,{size:a});case"visa":return e.jsx(rn,{size:a});case"mastercard":return e.jsx(nn,{size:a});default:return e.jsx(Vt,{size:a})}}function Xa({type:t,title:a,description:r,visible:n,onDismiss:o}){const[l,u]=i.useState(!1),[s,d]=i.useState(!1),c=i.useCallback(()=>{d(!0),setTimeout(()=>{u(!1),d(!1),o()},200)},[o]);if(i.useEffect(()=>{n&&(u(!0),d(!1))},[n]),i.useEffect(()=>{if(!n||!l)return;const p=setTimeout(c,5e3);return()=>clearTimeout(p)},[n,l,c]),!l)return null;const h=t==="success"?"var(--t-toast-success-bg)":"var(--t-toast-error-bg)";return e.jsx("div",{className:"absolute top-0 left-0 right-0 z-[25] px-3 pt-3",style:{animation:s?"slideUpToastOut 0.2s ease-in forwards":"slideDownToast 0.3s ease-out both"},children:e.jsxs("div",{className:"flex items-start gap-2.5 rounded-2xl px-4 py-3",style:{background:h,color:"#ffffff"},children:[e.jsx("span",{className:"mt-0.5 shrink-0",children:t==="success"?e.jsx($a,{size:14}):e.jsx(ht,{size:12})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[13px] font-medium leading-tight",children:a}),r&&e.jsx("div",{className:"text-[12px] leading-snug mt-0.5 opacity-90",children:r})]}),e.jsx("button",{onClick:c,className:"shrink-0 opacity-80 hover:opacity-100 transition-opacity mt-0.5",children:e.jsx(ht,{size:10})})]})})}function ye({width:t=46}){const a=t*.8695652173913043;return e.jsxs("svg",{width:t,height:a,viewBox:"0 0 48 32",fill:"none",preserveAspectRatio:"xMidYMid meet",children:[e.jsx("path",{d:"M0 0H5.76C11.0619 0 15.36 4.47715 15.36 10V32H0V0Z",fill:"var(--t-text)"}),e.jsx("path",{d:"M16.32 0H22.08C27.3819 0 31.68 4.47715 31.68 10V32H16.32V0Z",fill:"var(--t-text)"}),e.jsx("path",{d:"M32.64 8C32.64 3.58172 36.0785 0 40.32 0C44.5615 0 48 3.58172 48 8C48 12.4183 44.5615 16 40.32 16C36.0785 16 32.64 12.4183 32.64 8Z",fill:"var(--t-text)"})]})}function Ya(){return e.jsx("div",{className:"flex-1 flex items-center justify-center",style:{animation:"fadeInScale 0.5s ease-out both"},children:e.jsx(ye,{width:90})})}function Qa({isOpen:t,onClose:a,children:r}){return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute inset-0 z-[30] transition-opacity duration-300",style:{background:"rgba(0,0,0,0.4)",opacity:t?1:0,pointerEvents:t?"auto":"none",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},onClick:a}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 z-[31] transition-transform duration-300 ease-out sheet-inverted",style:{transform:t?"translateY(0)":"translateY(100%)",borderRadius:20,background:"var(--t-bg)",maxHeight:"70%",overflow:"visible",marginBottom:12,marginLeft:12,marginRight:12},children:r})]})}function je({onClick:t}){return e.jsx("button",{onClick:t,className:"flex items-center justify-center shrink-0 opacity-60 hover:opacity-100 transition-opacity",style:{width:40,height:40},children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:e.jsx("path",{d:"M3 3L11 11M11 3L3 11",stroke:"var(--t-text)",strokeWidth:"1.5",strokeLinecap:"round"})})})}function Ue({value:t,onChange:a,placeholder:r="",inline:n=!1}){return e.jsxs("div",{className:`flex items-center ${n?"":"mx-5 mb-5"}`,style:{height:48,borderRadius:100,backgroundColor:"var(--t-surface)",paddingLeft:16,paddingRight:12,gap:10},children:[e.jsx("div",{className:"shrink-0 flex items-center justify-center",style:{color:"var(--t-text-secondary)"},children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",children:[e.jsx("circle",{cx:"8.5",cy:"8.5",r:"6.25",stroke:"currentColor",strokeWidth:"1.4"}),e.jsx("path",{d:"M13.5 13.5l4 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}),e.jsx("input",{type:"text",value:t,onChange:o=>a(o.target.value),placeholder:r,className:"flex-1 min-w-0 focus-visible:outline-none",style:{height:"100%",border:"none",outline:"none",boxShadow:"none",color:"var(--t-text)",fontSize:14,backgroundColor:"transparent"}}),t&&e.jsx("button",{onClick:()=>a(""),className:"shrink-0 flex items-center justify-center",style:{width:20,height:20},children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:e.jsx("path",{d:"M2 2l8 8M10 2l-8 8",stroke:"var(--t-text-secondary)",strokeWidth:"1.4",strokeLinecap:"round"})})})]})}const pn=["USD","EUR","GBP"];function za({onClose:t,onSelect:a,currencies:r,assetBaseUrl:n="",selectedCode:o}){const l=U(),[u,s]=i.useState(""),d=i.useMemo(()=>{if(!r||r.length===0)return Ut;const h=new Map(Ut.map(p=>[p.code,p.name]));return r.map(p=>({code:p.code,name:p.name||h.get(p.code)||p.code}))},[r]),c=i.useMemo(()=>{const h=u.trim().toLowerCase();if(!h){if(o){const p=d.find(f=>f.code===o);if(p){const f=d.filter(y=>y.code!==o);return[p,...f]}}return d}return d.filter(p=>p.code.toLowerCase().includes(h)||p.name.toLowerCase().includes(h))},[d,u,o]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative shrink-0",style:{height:128,background:"var(--t-header-bg)",backdropFilter:"blur(var(--t-header-blur))",WebkitBackdropFilter:"blur(var(--t-header-blur))"},children:[e.jsx("div",{className:"absolute",style:{left:12,top:20},children:e.jsx(ye,{width:46})}),e.jsx("p",{className:"absolute text-[16px] text-center truncate",style:{top:28,left:64,right:64,color:"var(--t-text)",lineHeight:"24px"},children:l("modal.selectFiat")}),e.jsx("div",{className:"absolute",style:{right:12,top:20},children:e.jsx(je,{onClick:t})}),e.jsx("div",{className:"absolute",style:{bottom:8,left:12,right:12},children:e.jsx(Ue,{value:u,onChange:s,inline:!0})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto custom-scroll px-3",children:[c.map((h,p)=>{const f=o===h.code;return e.jsxs("button",{onClick:()=>a(h.code),className:"flex items-center w-full card-press hover-item modal-item-in",style:{gap:16,animationDelay:`${Math.min(p*45,350)}ms`},children:[e.jsx(vt,{currencyCode:h.code,size:32,baseUrl:n}),e.jsxs("div",{className:"flex-1 flex items-center",style:{borderBottom:"1px solid var(--t-card-border)",paddingTop:20,paddingBottom:20,gap:10},children:[e.jsx("span",{className:"flex-1 text-[18px] text-left",style:{color:"var(--t-text)",lineHeight:"20px"},children:h.code}),pn.includes(h.code)&&e.jsx("span",{className:"text-[11px] font-medium",style:{border:"1.5px solid var(--t-card-border)",borderRadius:100,paddingLeft:8,paddingRight:8,color:"var(--t-text-secondary)",lineHeight:"20px",letterSpacing:"0.22px"},children:l("modal.popular")}),f&&e.jsx("div",{style:{width:40,height:20,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"var(--t-success, #4CD964)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]},h.code)}),c.length===0&&e.jsx("div",{className:"text-center py-10 text-[14px]",style:{color:"var(--t-text-muted)"},children:l("modal.noCurrencies")})]})]})}const ma=["BTC","ETH","SOL"];function pa({src:t,alt:a,size:r,className:n,style:o}){const[l,u]=i.useState(!1),[s,d]=i.useState(!1),c=i.useRef(t);c.current!==t&&(c.current=t,u(!1),d(!1));const h=i.useCallback(()=>u(!0),[]),p=i.useCallback(()=>d(!0),[]);return e.jsxs("div",{className:n,style:{...o,width:r,height:r,position:"relative"},children:[!l&&!s&&e.jsx("div",{className:"absolute inset-0 rounded-full animate-pulse",style:{background:"var(--t-pill-bg, #333)"}}),s?e.jsx("div",{className:"absolute inset-0 rounded-full flex items-center justify-center text-[10px] font-bold",style:{background:"var(--t-pill-bg, #333)",color:"var(--t-text-muted)"},children:a.slice(0,3)}):e.jsx("img",{src:t,alt:a,width:r,height:r,onLoad:h,onError:p,className:`rounded-full ${l?"opacity-100":"opacity-0"}`,style:{width:r,height:r,transition:"opacity 0.15s ease-in"}})]})}function Ja({onClose:t,onSelect:a,cryptos:r,assetBaseUrl:n="",selectedCode:o,selectedChain:l}){const u=U(),[s,d]=i.useState(""),c=i.useMemo(()=>{if(!r||r.length===0)return Ma;const f=[];for(const y of r){const j=y.networks||[],N=y.name||zr[y.code]||y.code;if(j.length===0)f.push({code:y.code,name:N,chain:y.code,popular:ma.includes(y.code)});else for(const x of j){const k=x.code||x.id||x.name||y.code;f.push({code:y.code,name:N,chain:k,chainName:x.name,popular:ma.includes(y.code)})}}return f},[r]),h=i.useCallback((f,y)=>o===f&&l===y,[o,l]),p=i.useMemo(()=>{var N;const f=s.trim().toLowerCase();if(!f){if(o&&l){const x=c.find(k=>k.code===o&&k.chain===l);if(x){const k=c.filter(D=>!(D.code===o&&D.chain===l));return[x,...k]}}return c}const y=f.split(/\s+/),j=[];for(const x of c){const k=dt(x.chain),D=k?k.name.toLowerCase():"",G=((N=k==null?void 0:k.shortName)==null?void 0:N.toLowerCase())||"",$=x.chain.toLowerCase(),ee=x.code.toLowerCase(),Z=x.name.toLowerCase(),Y=[ee,Z,D,G,$];if(!y.every(A=>Y.some(C=>C.includes(A))))continue;let Q=0;ee===f?Q+=100:ee.startsWith(y[0])&&(Q+=50),x.popular&&(Q+=10),y.length>1&&(D.includes(y[1])||G.includes(y[1])||$.includes(y[1]))&&(Q+=25),j.push({item:x,score:Q})}return j.sort((x,k)=>k.score-x.score),j.map(x=>x.item)},[c,s,o,l]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative shrink-0",style:{height:128,background:"var(--t-header-bg)",backdropFilter:"blur(var(--t-header-blur))",WebkitBackdropFilter:"blur(var(--t-header-blur))"},children:[e.jsx("div",{className:"absolute",style:{left:12,top:20},children:e.jsx(ye,{width:46})}),e.jsx("p",{className:"absolute text-[16px] text-center truncate",style:{top:28,left:64,right:64,color:"var(--t-text)",lineHeight:"24px"},children:u("modal.selectCrypto")}),e.jsx("div",{className:"absolute",style:{right:12,top:20},children:e.jsx(je,{onClick:t})}),e.jsx("div",{className:"absolute",style:{bottom:8,left:12,right:12},children:e.jsx(Ue,{value:s,onChange:d,inline:!0})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto custom-scroll px-3",children:[p.map((f,y)=>{const j=dt(f.chain),N=(j==null?void 0:j.name)||f.chainName||f.chain,x=h(f.code,f.chain);return e.jsxs("button",{onClick:()=>a(f.code,f.chain),className:"flex items-center w-full card-press hover-item modal-item-in",style:{gap:16,animationDelay:`${Math.min(y*45,350)}ms`},children:[e.jsxs("div",{className:"relative shrink-0",style:{width:40,height:40},children:[e.jsx("div",{className:"absolute top-0 left-0",style:{background:"#ffffff",borderRadius:"50%"},children:e.jsx(pa,{src:Ot(f.code,n),alt:f.code,size:32})}),e.jsx("div",{className:"absolute",style:{bottom:0,right:0,border:"1.5px solid var(--t-chain-border, var(--t-surface, #1C1C22))",borderRadius:"50%",background:"#ffffff"},children:e.jsx(pa,{src:ut(f.chain,n),alt:f.chain,size:16})})]}),e.jsxs("div",{className:"flex-1 flex items-center",style:{borderBottom:"1px solid var(--t-card-border)",paddingTop:20,paddingBottom:20,gap:10},children:[e.jsx("span",{className:"flex-1 text-[18px] text-left",style:{color:"var(--t-text)",lineHeight:"20px"},children:f.code}),e.jsx("span",{className:"text-[15px]",style:{color:"var(--t-text-secondary)"},children:N}),f.popular&&e.jsx("span",{className:"text-[11px] font-medium",style:{border:"1.5px solid var(--t-card-border)",borderRadius:100,paddingLeft:8,paddingRight:8,color:"var(--t-text-secondary)",lineHeight:"20px",letterSpacing:"0.22px"},children:u("modal.popular")}),x&&e.jsx("div",{style:{width:40,height:20,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"var(--t-success, #4CD964)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]},`${f.code}-${f.chain}`)}),p.length===0&&e.jsx("div",{className:"text-center py-10 text-[14px]",style:{color:"var(--t-text-muted)"},children:u("modal.noCurrencies")})]})]})}const hn={"debit-credit-card":"card","bank-transfer":"bank","ach-bank-transfer":"bank","payid-bank-transfer":"bank","sepa-bank-transfer":"bank",sepa:"bank","apple-pay":"applepay","google-pay":"googlepay",paypal:"paypal",revolut:"revolut"},fn={"debit-credit-card":"payment.name.card","bank-transfer":"payment.name.bankTransfer","ach-bank-transfer":"payment.name.ach"},xn={"apple-pay":"Apple Pay","google-pay":"Google Pay","payid-bank-transfer":"PayID",paypal:"PayPal",revolut:"Revolut"},yn={"sepa-bank-transfer":"SEPA",sepa:"SEPA","bank-transfer":"Bank","ach-bank-transfer":"ACH"};function Wt(t,a,r,n=!1){if(n){const u=yn[t];if(u)return u}const o=xn[t];if(o)return o;const l=fn[t];return l&&r?r(l):l&&{"debit-credit-card":"Card","bank-transfer":"Bank Transfer","ach-bank-transfer":"ACH"}[t]||a}function Gt(t,a,r=24){const n=hn[t];return n?Za(n,r):a?e.jsx("img",{src:a,alt:"",width:r,height:r,style:{borderRadius:"50%"}}):e.jsx(Vt,{size:r})}function gn({methods:t,selectedId:a,onOpenModal:r,fiatCurrency:n}){const o=U(),l=i.useMemo(()=>t.filter(s=>s.supportedFiats.includes(n)),[t,n]),u=l.find(s=>s.id===a)||l[0];return l.length===0?e.jsx("div",{className:"flex items-center justify-between px-[18px] pt-[12px] pb-[14px]",style:{background:"var(--t-surface)",borderBottomLeftRadius:5,borderBottomRightRadius:5},children:e.jsx("span",{className:"text-[12px]",style:{color:"var(--t-text-muted)"},children:o("payment.unavailableFor",{currency:n})})}):e.jsx(e.Fragment,{children:e.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&r()},className:"flex items-center justify-between w-full px-[18px] transition-colors",style:{background:"var(--t-surface)",borderBottomLeftRadius:5,borderBottomRightRadius:5,cursor:"pointer",height:42},children:[e.jsx("span",{className:"text-[12px]",style:{color:"var(--t-text-secondary)"},children:o("payment.label")}),e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"flex items-center justify-center",style:{width:20,height:20},children:u&&Gt(u.id,u.icon,20)}),e.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--t-text)"},children:u?Wt(u.id,u.name,o):o("payment.select")}),e.jsx(xe,{})]})]})})}function vn({methods:t,selectedId:a,onSelect:r,onClose:n}){const o=U(),[l,u]=i.useState(""),s=t.length>0?t[0].id:"",d=i.useMemo(()=>{const c=l.trim().toLowerCase();if(!c){if(a){const h=t.find(p=>p.id===a);if(h){const p=t.filter(f=>f.id!==a);return[h,...p]}}return t}return t.filter(h=>h.id.toLowerCase().includes(c)||h.name.toLowerCase().includes(c)||h.description&&h.description.toLowerCase().includes(c))},[t,l,a]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative shrink-0",style:{height:128,background:"var(--t-header-bg)",backdropFilter:"blur(var(--t-header-blur))",WebkitBackdropFilter:"blur(var(--t-header-blur))"},children:[e.jsx("div",{className:"absolute",style:{left:12,top:20},children:e.jsx(ye,{width:46})}),e.jsx("p",{className:"absolute text-[16px] text-center truncate",style:{top:28,left:64,right:64,color:"var(--t-text)",lineHeight:"24px"},children:o("modal.choosePayment")}),e.jsx("div",{className:"absolute",style:{right:12,top:20},children:e.jsx(je,{onClick:n})}),e.jsx("div",{className:"absolute",style:{bottom:8,left:12,right:12},children:e.jsx(Ue,{value:l,onChange:u,inline:!0})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto custom-scroll px-3",children:[d.map((c,h)=>{const p=c.id===a,f=Wt(c.id,c.name,o);return e.jsxs("button",{onClick:()=>r(c.id),className:"flex items-center w-full card-press hover-item modal-item-in",style:{gap:16,animationDelay:`${Math.min(h*45,350)}ms`},children:[e.jsx("span",{className:"flex items-center justify-center shrink-0",style:{width:32,height:32},children:Gt(c.id,c.icon,32)}),e.jsxs("div",{className:"flex-1 flex items-center",style:{borderBottom:"1px solid var(--t-card-border)",paddingTop:20,paddingBottom:20,gap:10},children:[e.jsx("span",{className:"flex-1 text-[18px] text-left",style:{color:"var(--t-text)",lineHeight:"20px"},children:f}),c.id===s&&e.jsx("span",{className:"text-[11px] font-medium",style:{border:"1.5px solid var(--t-card-border)",borderRadius:100,paddingLeft:8,paddingRight:8,color:"var(--t-text-secondary)",lineHeight:"20px",letterSpacing:"0.22px"},children:o("modal.recommended")}),p&&e.jsx("div",{style:{width:40,height:20,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"var(--t-success, #4CD964)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]},c.id)}),d.length===0&&e.jsx("div",{className:"text-center py-10 text-[14px]",style:{color:"var(--t-text-muted)"},children:o("modal.noPaymentMethods")})]})]})}function qa({checked:t,onChange:a,accentColor:r}){return e.jsx("button",{onClick:()=>a(!t),className:"relative shrink-0 transition-colors duration-200",style:{width:64,height:28,borderRadius:14,backgroundColor:t?r||"var(--t-toggle-on)":"var(--t-toggle-off)"},children:e.jsx("div",{className:"absolute top-[2px] bg-white shadow",style:{width:39,height:24,borderRadius:13,transform:t?"translateX(23px)":"translateX(2px)",transition:"transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)"}})})}const Cn=[{key:"settings.privacy",href:"https://nowramp.com/privacy-policy"},{key:"settings.terms",href:"https://nowramp.com/terms-and-conditions"}],lt={background:"var(--t-surface)",borderRadius:"var(--t-card-radius)"};function er({onClose:t,darkMode:a,onToggleDarkMode:r,skinId:n,onSelectSkin:o,showThemeToggle:l=!0,country:u,countryName:s,onLocationPress:d,onLanguagePress:c,assetBaseUrl:h=""}){var x;const{t:p,locale:f,languages:y}=gt(),[j,N]=i.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative shrink-0",style:{height:80,background:"var(--t-header-bg)",backdropFilter:"blur(var(--t-header-blur))",WebkitBackdropFilter:"blur(var(--t-header-blur))"},children:[e.jsx("div",{className:"absolute",style:{left:12,top:20},children:e.jsx(ye,{width:46})}),e.jsx("div",{className:"absolute",style:{right:12,top:20},children:e.jsx(je,{onClick:t})})]}),e.jsxs("div",{className:"px-3 flex-1 pt-4 overflow-y-auto custom-scroll",style:{display:"flex",flexDirection:"column",gap:8},children:[d&&e.jsxs("button",{onClick:d,className:"w-full text-left transition-colors card-press modal-item-in",style:{...lt,backgroundColor:"var(--t-surface)",color:"inherit",border:"none",cursor:"pointer",padding:"12px 16px"},children:[e.jsx("span",{className:"text-[13px] block mb-1.5",style:{color:"var(--t-text-secondary)"},children:p("settings.location")}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[u&&!j?e.jsx("img",{src:`${h}/flags/${u.toLowerCase()}.svg`,alt:u,width:28,height:28,style:{width:28,height:28,borderRadius:"50%",objectFit:"cover"},onError:()=>N(!0)}):e.jsx(bn,{size:28}),e.jsx("span",{className:"text-[15px] font-medium",style:{color:"var(--t-text)"},children:s||u})]}),e.jsx(xe,{})]})]}),l&&e.jsxs("div",{className:"flex items-center justify-between w-full px-4 modal-item-in",style:{...lt,paddingTop:14,paddingBottom:14,animationDelay:"60ms"},children:[e.jsx("span",{className:"font-medium text-[15px]",style:{color:"var(--t-text)"},children:p("settings.darkMode")}),e.jsx(qa,{checked:a,onChange:r})]}),c&&e.jsxs("button",{onClick:c,className:"flex items-center justify-between w-full transition-colors card-press modal-item-in",style:{...lt,backgroundColor:"var(--t-surface)",color:"inherit",border:"none",cursor:"pointer",padding:"14px 16px",margin:0,textAlign:"left",animationDelay:"120ms"},children:[e.jsx("span",{className:"font-medium text-[15px]",style:{color:"var(--t-text)"},children:p("settings.language")}),e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-secondary)"},children:((x=y.find(k=>k.code===f))==null?void 0:x.name)||f})]}),Cn.map((k,D)=>e.jsxs("a",{href:k.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between w-full px-4 transition-colors card-press modal-item-in",style:{...lt,textDecoration:"none",color:"inherit",paddingTop:14,paddingBottom:14,animationDelay:`${180+D*60}ms`},children:[e.jsx("span",{className:"font-medium text-[15px]",style:{color:"var(--t-text)"},children:p(k.key)}),e.jsx(Oa,{})]},k.key))]})]})}function bn({size:t=28}){return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 40 40",fill:"none",children:[e.jsx("circle",{cx:"20",cy:"20",r:"18",stroke:"var(--t-text-secondary)",strokeWidth:"1.5",fill:"none"}),e.jsx("ellipse",{cx:"20",cy:"20",rx:"9",ry:"18",stroke:"var(--t-text-secondary)",strokeWidth:"1.5",fill:"none"}),e.jsx("line",{x1:"2",y1:"20",x2:"38",y2:"20",stroke:"var(--t-text-secondary)",strokeWidth:"1.5"}),e.jsx("path",{d:"M5 12h30M5 28h30",stroke:"var(--t-text-secondary)",strokeWidth:"1.2"})]})}function tr({onClose:t,onSelect:a,assetBaseUrl:r="",selectedCode:n}){const o=U(),[l,u]=i.useState(""),s=i.useMemo(()=>{const d=l.trim().toLowerCase();if(!d){if(n){const c=n.toLowerCase(),h=xt[c];if(h){const p=qe.filter(f=>f.code!==c);return[h,...p]}}return qe}return qe.filter(c=>c.name.toLowerCase().includes(d)||c.code.includes(d)||c.defaultFiat.toLowerCase().includes(d))},[l,n]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative shrink-0",style:{height:128,background:"var(--t-header-bg)",backdropFilter:"blur(var(--t-header-blur))",WebkitBackdropFilter:"blur(var(--t-header-blur))"},children:[e.jsx("div",{className:"absolute",style:{left:12,top:20},children:e.jsx(ye,{width:46})}),e.jsx("p",{className:"absolute text-[16px] text-center truncate",style:{top:28,left:64,right:64,color:"var(--t-text)",lineHeight:"24px"},children:o("modal.selectCountry")}),e.jsx("div",{className:"absolute",style:{right:12,top:20},children:e.jsx(je,{onClick:t})}),e.jsx("div",{className:"absolute",style:{bottom:8,left:12,right:12},children:e.jsx(Ue,{value:l,onChange:u,inline:!0})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto custom-scroll px-3",children:[s.map((d,c)=>{const h=(n==null?void 0:n.toLowerCase())===d.code;return e.jsxs("button",{onClick:()=>a(d.code),className:"flex items-center w-full card-press hover-item modal-item-in",style:{gap:16,animationDelay:`${Math.min(c*45,350)}ms`},children:[e.jsx(Sn,{code:d.code,size:32,baseUrl:r}),e.jsxs("div",{className:"flex-1 flex items-center",style:{borderBottom:"1px solid var(--t-card-border)",paddingTop:20,paddingBottom:20,gap:10},children:[e.jsx("span",{className:"flex-1 text-[18px] text-left",style:{color:"var(--t-text)",lineHeight:"20px"},children:d.name}),h&&e.jsx("div",{style:{width:40,height:20,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"var(--t-success, #4CD964)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]},d.code)}),s.length===0&&e.jsx("div",{className:"text-center py-10 text-[14px]",style:{color:"var(--t-text-muted)"},children:o("modal.noCountries")})]})]})}function Sn({code:t,size:a=32,baseUrl:r=""}){const[n,o]=i.useState(!1);return n?e.jsx("div",{style:{width:a,height:a,borderRadius:"50%",background:"var(--t-pill-bg, #333)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a*.4,color:"var(--t-text-muted)"},children:t.toUpperCase().slice(0,2)}):e.jsx("img",{src:`${r}/flags/${t}.svg`,alt:t,width:a,height:a,style:{width:a,height:a,borderRadius:"50%",objectFit:"cover"},onError:()=>o(!0)})}function jn({onClose:t,onSelect:a,selectedCode:r}){const n=U(),[o,l]=i.useState(""),u=i.useMemo(()=>{const s=o.trim().toLowerCase();if(!s){if(r){const d=Ie.find(c=>c.code===r);if(d){const c=Ie.filter(h=>h.code!==r);return[d,...c]}}return Ie}return Ie.filter(d=>d.name.toLowerCase().includes(s)||d.english.toLowerCase().includes(s)||d.code.includes(s))},[o,r]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative shrink-0",style:{height:128,background:"var(--t-header-bg)",backdropFilter:"blur(var(--t-header-blur))",WebkitBackdropFilter:"blur(var(--t-header-blur))"},children:[e.jsx("div",{className:"absolute",style:{left:12,top:20},children:e.jsx(ye,{width:46})}),e.jsx("p",{className:"absolute text-[16px] text-center truncate",style:{top:28,left:64,right:64,color:"var(--t-text)",lineHeight:"24px"},children:n("modal.selectLanguage")}),e.jsx("div",{className:"absolute",style:{right:12,top:20},children:e.jsx(je,{onClick:t})}),e.jsx("div",{className:"absolute",style:{bottom:8,left:12,right:12},children:e.jsx(Ue,{value:o,onChange:l,inline:!0})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto custom-scroll px-3",children:[u.map((s,d)=>{const c=r===s.code;return e.jsx("button",{onClick:()=>a(s.code),className:"flex items-center w-full card-press hover-item modal-item-in",style:{gap:16,animationDelay:`${Math.min(d*45,350)}ms`},children:e.jsxs("div",{className:"flex-1 flex items-center",style:{borderBottom:"1px solid var(--t-card-border)",paddingTop:20,paddingBottom:20,paddingLeft:4,gap:10},children:[e.jsx("span",{className:"flex-1 text-[18px] text-left",style:{color:"var(--t-text)",lineHeight:"20px"},children:s.name}),e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-muted)"},children:s.english}),c&&e.jsx("div",{style:{width:40,height:20,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"var(--t-success, #4CD964)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})},s.code)}),u.length===0&&e.jsx("div",{className:"text-center py-10 text-[14px]",style:{color:"var(--t-text-muted)"},children:n("modal.noLanguages")})]})]})}function ar({tab:t,onTabSwitch:a,showFlowToggle:r,showSettings:n,onOpenSettings:o}){const l=U();return e.jsxs("div",{className:"absolute top-0 left-0 right-0 z-10 flex items-center justify-between px-3",style:{height:80,background:"var(--t-header-bg)",backdropFilter:"blur(var(--t-header-blur))",WebkitBackdropFilter:"blur(var(--t-header-blur))"},children:[e.jsx("div",{style:{width:46,display:"flex",alignItems:"center",justifyContent:"flex-start"},children:e.jsx(ye,{width:46})}),r?e.jsxs("div",{className:"relative flex",style:{border:"1.5px solid var(--t-tab-border)",borderRadius:"var(--t-pill-radius)",padding:4,gap:4},children:[e.jsx("div",{style:{position:"absolute",top:4,left:4,width:88,height:32,borderRadius:"var(--t-pill-radius)",background:"var(--t-tab-active-bg)",transform:t==="buy"?"translateX(0)":"translateX(92px)",transition:"transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:0}}),e.jsx("button",{onClick:()=>a("buy"),className:`text-[13px] font-medium transition-colors duration-200 tab-pill${t==="buy"?" tab-pill-active":""}`,style:{position:"relative",zIndex:1,width:88,height:32,borderRadius:"var(--t-pill-radius)",color:t==="buy"?"var(--t-tab-active-text)":"var(--t-tab-inactive-text)"},children:l("header.buy")}),e.jsx("button",{onClick:()=>a("sell"),className:`text-[13px] font-medium transition-colors duration-200 tab-pill${t==="sell"?" tab-pill-active":""}`,style:{position:"relative",zIndex:1,width:88,height:32,borderRadius:"var(--t-pill-radius)",color:t==="sell"?"var(--t-tab-active-text)":"var(--t-tab-inactive-text)"},children:l("header.sell")})]}):e.jsx("div",{}),e.jsx("div",{style:{width:40,display:"flex",alignItems:"center",justifyContent:"flex-end"},children:n?e.jsx(Ga,{onClick:o}):e.jsx("div",{style:{width:40}})})]})}function rr({amount:t,onAmountChange:a,currencyCode:r,isBuy:n,onOpenModal:o,assetBaseUrl:l,error:u,fieldLocks:s,onBlur:d,inputRef:c,chainCode:h,chainDisplay:p,getChainIconUrl:f,shaking:y,onFocus:j}){var x,k,D;const N=U();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`flex flex-col gap-[20px] p-4 card-hover${y?" error-shake":""}`,style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius)",...u?{border:"1px solid var(--t-error)"}:{}},children:[e.jsx("div",{className:"text-[16px]",style:{color:"var(--t-text-secondary)",lineHeight:"16px"},children:N("spend.label")}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("input",{ref:c,type:"text",value:t,onChange:a,onFocus:j,onBlur:d,placeholder:N(n?"spend.placeholderFiat":"spend.placeholderCrypto"),className:"bg-transparent outline-none w-0 flex-1 mr-3",style:{color:"var(--t-text)",fontSize:24,fontWeight:500,lineHeight:"32px",padding:0,border:"none",borderRadius:0,backgroundColor:"transparent",height:"auto",width:0},inputMode:"decimal",disabled:!!((x=s==null?void 0:s.sourceAmount)!=null&&x.locked)}),n?e.jsxs("button",{onClick:o,className:"flex items-center gap-[4px] shrink-0 transition-colors",style:{background:"var(--t-pill-solid-bg)",borderRadius:"var(--t-pill-radius)",paddingLeft:4,paddingRight:8,paddingTop:4,paddingBottom:4,border:"1px solid var(--t-pill-solid-border)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},disabled:!!((k=s==null?void 0:s.sourceCurrency)!=null&&k.locked),children:[e.jsx(vt,{currencyCode:r,size:24,baseUrl:l}),e.jsx("span",{className:"text-[14px] font-semibold",style:{color:"var(--t-text)",letterSpacing:"0.14px",lineHeight:"24px"},children:r}),e.jsx(xe,{})]}):e.jsxs("div",{className:"flex flex-col items-end shrink-0",children:[e.jsxs("button",{onClick:o,className:"flex items-center gap-[4px] transition-colors",style:{background:"var(--t-pill-solid-bg)",borderRadius:"var(--t-pill-radius)",paddingLeft:4,paddingRight:8,paddingTop:4,paddingBottom:4,border:"1px solid var(--t-pill-solid-border)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},disabled:!!((D=s==null?void 0:s.destinationCurrency)!=null&&D.locked),children:[e.jsx(Kt,{ticker:r,size:24,baseUrl:l}),e.jsx("span",{className:"text-[14px] font-semibold",style:{color:"var(--t-text)",letterSpacing:"0.14px",lineHeight:"24px"},children:r}),e.jsx(xe,{})]}),h&&f&&e.jsxs("div",{className:"flex items-center gap-1 mt-1.5 mr-0.5",children:[e.jsx("div",{className:"rounded-full",style:{width:14,height:14,background:"#ffffff"},children:e.jsx("img",{src:f(h,l),alt:h,width:14,height:14,className:"rounded-full",style:{width:14,height:14}})}),e.jsx("span",{className:"text-[12px]",style:{color:"var(--t-text-secondary)"},children:p})]})]})]})]}),u&&e.jsx("div",{className:"text-[12px] mt-1.5 text-center",style:{color:"var(--t-error)"},children:u})]})}function nr({char:t,height:a=38}){const r="0123456789",n=r.indexOf(t);return n===-1?e.jsx("span",{style:{display:"inline-block",textAlign:"center"},children:t}):e.jsx("span",{className:"digit-slot",style:{height:a,lineHeight:`${a}px`,textAlign:"center"},children:e.jsx("span",{className:"digit-slot-inner block",style:{transform:`translateY(-${n*a}px)`},children:r.split("").map(o=>e.jsx("span",{className:"block",style:{height:a,lineHeight:`${a}px`},children:o},o))})})}function or({value:t,height:a=38,className:r="",style:n={}}){return e.jsx("span",{className:r,style:{display:"inline-flex",fontVariantNumeric:"tabular-nums",...n},children:t.split("").map((o,l)=>e.jsx(nr,{char:o,height:a},l))})}function sr({amount:t,currencyCode:a,chainCode:r,chainDisplay:n,isBuy:o,onOpenModal:l,displayRate:u,assetBaseUrl:s,quotesLoading:d,onOpenRateBreakdown:c,fieldLocks:h,spendNumeric:p,getChainIconUrl:f,autoSelectPending:y,rateFlash:j}){var x,k;const N=U();return e.jsx("div",{className:"p-4 card-hover",style:{borderRadius:"var(--t-card-radius)",border:"1.5px solid var(--t-card-border)",background:"transparent"},children:e.jsxs("div",{className:"flex flex-col gap-[20px]",children:[e.jsx("div",{className:"text-[16px]",style:{color:"var(--t-text-secondary)",lineHeight:"16px"},children:N("receive.label")}),e.jsxs("div",{className:"flex flex-col gap-[8px]",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{className:j?"rate-flash":"",children:e.jsx(or,{value:p>0?t:"0",height:32,className:"font-medium",style:{color:p>0?"var(--t-text)":"var(--t-text-muted)",fontSize:24}})}),o?e.jsx("div",{className:"flex flex-col items-end shrink-0",children:e.jsxs("button",{onClick:l,className:"flex items-center gap-[4px] transition-colors",style:{background:"var(--t-pill-solid-bg)",borderRadius:"var(--t-pill-radius)",paddingLeft:4,paddingRight:8,paddingTop:4,paddingBottom:4,border:"1px solid var(--t-pill-solid-border)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},disabled:!!((x=h==null?void 0:h.destinationCurrency)!=null&&x.locked),children:[e.jsx(Kt,{ticker:a,size:24,baseUrl:s}),e.jsx("span",{className:"text-[14px] font-semibold",style:{color:"var(--t-text)",letterSpacing:"0.14px",lineHeight:"24px"},children:a}),e.jsx(xe,{})]})}):e.jsxs("button",{onClick:l,className:"flex items-center gap-[4px] shrink-0 transition-colors",style:{background:"var(--t-pill-solid-bg)",borderRadius:"var(--t-pill-radius)",paddingLeft:4,paddingRight:8,paddingTop:4,paddingBottom:4,border:"1px solid var(--t-pill-solid-border)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},disabled:!!((k=h==null?void 0:h.sourceCurrency)!=null&&k.locked),children:[e.jsx(vt,{currencyCode:a,size:24,baseUrl:s}),e.jsx("span",{className:"text-[14px] font-semibold",style:{color:"var(--t-text)",letterSpacing:"0.14px",lineHeight:"24px"},children:a}),e.jsx(xe,{})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex items-center gap-[4px]",children:d&&!y?e.jsxs(e.Fragment,{children:[e.jsx(fe,{size:12}),e.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--t-text-muted)",letterSpacing:"0.22px",lineHeight:"12px"},children:N("receive.fetchingRate")})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--t-text-muted)",letterSpacing:"0.22px",lineHeight:"12px"},children:u||" "}),u&&e.jsx("button",{onClick:c,className:"flex items-center justify-center opacity-60 hover:opacity-100 transition-opacity",children:e.jsx(pt,{size:12})})]})}),o&&r&&f&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"rounded-full",style:{width:12,height:12,background:"#ffffff"},children:e.jsx("img",{src:f(r,s),alt:r,width:12,height:12,className:"rounded-full",style:{width:12,height:12}})}),e.jsx("span",{className:"text-[11px]",style:{color:"var(--t-text-secondary)",letterSpacing:"0.22px",lineHeight:"12px"},children:n})]})]})]})]})})}function ir({selectedMethod:t,onOpenModal:a,getMethodIcon:r,getMethodDisplayName:n}){const o=U();return e.jsxs("div",{role:"button",tabIndex:0,onClick:a,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&a()},className:"flex items-center gap-[4px] p-4 transition-colors cursor-pointer card-press card-hover",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius)"},children:[e.jsx("span",{className:"text-[13px] flex-1",style:{color:"var(--t-text-secondary)",letterSpacing:"0.13px",lineHeight:"20px"},children:o("payment.label")}),e.jsxs("span",{className:"flex items-center gap-[6px]",children:[t&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"flex items-center justify-center",style:{width:20,height:20},children:r(t.id,t.icon,20)}),e.jsx("span",{className:"text-[14px] font-semibold",style:{color:"var(--t-text)",letterSpacing:"0.14px",lineHeight:"16px"},children:n(t.id,t.name)})]}),!t&&e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-muted)"},children:o("payment.select")}),e.jsx(xe,{})]})]})}function kn({selectedQuote:t,quotesLoading:a,onOpenModal:r,assetBaseUrl:n=""}){const o=U();return e.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&r()},className:"flex items-center gap-[4px] p-4 transition-colors cursor-pointer card-press card-hover",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius)"},children:[e.jsx("span",{className:"text-[13px] flex-1",style:{color:"var(--t-text-secondary)",letterSpacing:"0.13px",lineHeight:"20px"},children:o("provider.label")}),e.jsxs("span",{className:"flex items-center gap-[6px]",children:[a&&!t&&e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-muted)"},children:"..."}),!a&&!t&&e.jsx("span",{className:"text-[13px]",style:{color:"var(--t-text-muted)"},children:o("provider.select")}),t&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"flex items-center justify-center overflow-hidden rounded-full",style:{width:20,height:20},children:e.jsx("img",{src:La(t.gatewayId,n),alt:"",width:20,height:20,className:"rounded-full",style:{width:20,height:20,objectFit:"cover"},onError:l=>{t.gatewayLogo&&l.target.src!==t.gatewayLogo&&(l.target.src=t.gatewayLogo)}})}),e.jsx("span",{className:"text-[14px] font-semibold",style:{color:"var(--t-text)",letterSpacing:"0.14px",lineHeight:"16px"},children:t.gatewayName})]}),e.jsx(xe,{})]})]})}function wn(){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:e.jsx("path",{d:"M8 1l2.12 4.3 4.74.69-3.43 3.34.81 4.72L8 11.77l-4.24 2.28.81-4.72L1.14 5.99l4.74-.69L8 1z",fill:"var(--t-success)"})})}function Nn(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:[e.jsx("path",{d:"M14 7.5a6 6 0 11-12 0 6 6 0 0112 0z",stroke:"var(--t-accent)",strokeWidth:"1.5"}),e.jsx("path",{d:"M5.5 8l2 2 3.5-4",stroke:"var(--t-accent)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Rn({quote:t}){const a=U();return t.isBestRate?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(wn,{}),e.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--t-success)"},children:a("modal.bestPrice")})]}):t.isRecommended?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Nn,{}),e.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--t-accent)"},children:a("modal.recommended")})]}):t.rank&&t.rank<=3?e.jsxs("div",{className:"text-[11px]",style:{color:"var(--t-text-muted)"},children:["#",t.rank]}):null}function ha({gatewayId:t,gatewayLogo:a,assetBaseUrl:r=""}){const n=La(t,r);return e.jsx("span",{className:"rounded-full shrink-0 overflow-hidden inline-flex items-center justify-center",style:{width:36,height:36},children:e.jsx("img",{src:n,alt:"",width:36,height:36,className:"rounded-full",style:{width:36,height:36,objectFit:"cover"},onError:o=>{a&&o.target.src!==a&&(o.target.src=a)}})})}function En({pct:t}){if(t===0)return null;const a=t>0?"var(--t-success)":"var(--t-error)",r=t>0?"+":"";return e.jsxs("span",{className:"text-[11px] font-medium",style:{color:a},children:[r,t.toFixed(2),"%"]})}function An(){return e.jsx("div",{className:"space-y-3",children:[0,1,2].map(t=>e.jsxs("div",{className:"w-full flex items-center gap-3.5 modal-item-in",style:{borderRadius:5,height:64,paddingLeft:16,paddingRight:16,background:"var(--t-surface)",animationDelay:`${t*45}ms`},children:[e.jsx(V,{w:36,h:36,className:"rounded-full shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(V,{w:90,h:14,className:"mb-1.5"}),e.jsx(V,{w:60,h:12})]}),e.jsxs("div",{className:"text-right",children:[e.jsx(V,{w:40,h:10,className:"mb-1.5"}),e.jsx(V,{w:80,h:14})]})]},t))})}function lr({onClose:t,onSelect:a,quotes:r,quotesLoading:n,cryptoCurrency:o,selectedGatewayId:l,assetBaseUrl:u=""}){const s=U(),[d,c]=i.useState(""),h=i.useMemo(()=>{if(!(r!=null&&r.quotes))return[];const f=d.trim().toLowerCase();return f?r.quotes.filter(y=>y.gatewayName.toLowerCase().includes(f)):r.quotes},[r,d]),p=i.useMemo(()=>{const f=h.find(y=>parseFloat(y.cryptoAmount)>0);return f?parseFloat(f.cryptoAmount):0},[h]);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex justify-end px-5 pt-5",children:e.jsx(je,{onClick:t})}),e.jsx("h2",{className:"text-center text-[17px] font-medium mt-2 mb-6",style:{color:"var(--t-text)",fontSize:17,fontWeight:500,marginTop:8,marginBottom:24},children:s("modal.chooseRamp")}),e.jsx(Ue,{value:d,onChange:c}),e.jsxs("div",{className:"flex-1 overflow-y-auto custom-scroll px-5 space-y-3",children:[n?e.jsx(An,{}):h.length===0?e.jsx("div",{className:"text-center py-10 text-[14px]",style:{color:"var(--t-text-muted)"},children:r&&r.quotes.length===0?s("modal.noQuotes"):s("modal.noProvidersFound")}):h.map((f,y)=>{const j=y===0,N=l===f.gatewayId,x=parseFloat(f.cryptoAmount),k=x>0,D=x>=1?x.toFixed(4):x.toPrecision(6),G=!j&&p>0?(x-p)/p*100:0;return e.jsxs("button",{onClick:()=>k&&a(f),className:`w-full flex items-center gap-3 transition-colors modal-item-in${k?" card-press hover-item":""}`,style:{borderRadius:"var(--t-card-radius)",padding:"12px 16px",border:N&&k?"1.5px solid var(--t-accent)":"1.5px solid transparent",background:"var(--t-surface)",opacity:k?1:.45,cursor:k?"pointer":"default",animationDelay:`${Math.min(y*45,350)}ms`},children:[e.jsx(ha,{gatewayId:f.gatewayId,gatewayLogo:f.gatewayLogo,assetBaseUrl:u}),e.jsxs("div",{className:"text-left flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-[14px] leading-[18px]",style:{color:"var(--t-text)"},children:f.gatewayName}),k&&e.jsx(Rn,{quote:f})]}),e.jsx("div",{className:"text-right shrink-0",children:k?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] leading-[14px]",style:{color:"var(--t-text-secondary)"},children:j?s("receive.label"):e.jsx(En,{pct:G})}),e.jsxs("div",{className:"font-medium text-[13px] leading-[18px]",style:{color:"var(--t-text)"},children:[e.jsx("span",{className:"text-[10px] font-normal",style:{color:"var(--t-text-secondary)"},children:o})," ",D]})]}):e.jsx("span",{className:"text-[11px]",style:{color:"var(--t-text-muted)"},children:s("rate.noQuote")})})]},f.gatewayId)}),!n&&(r==null?void 0:r.unavailableGateways)&&r.unavailableGateways.length>0&&e.jsx("div",{className:"pt-2 space-y-1.5",children:r.unavailableGateways.map((f,y)=>e.jsxs("div",{className:"flex items-center gap-3 modal-item-in",style:{borderRadius:"var(--t-card-radius)",padding:"10px 16px",background:"var(--t-surface)",opacity:.45,animationDelay:`${Math.min((h.length+y)*45,500)}ms`},children:[e.jsx(ha,{gatewayId:f.gatewayId,assetBaseUrl:u}),e.jsx("div",{className:"text-left flex-1 min-w-0",children:e.jsx("div",{className:"font-medium text-[14px] leading-[18px]",style:{color:"var(--t-text)"},children:f.gatewayName})}),e.jsx("div",{className:"text-right shrink-0",children:e.jsx("span",{className:"text-[11px]",style:{color:"var(--t-text-muted)"},children:f.reason})})]},f.gatewayId))})]})]})}function cr({address:t,onChange:a,placeholder:r,error:n,validating:o,disabled:l,onFocus:u,onBlur:s,focused:d}){const c=U(),h=o&&t.trim().length>=10,[p,f]=i.useState(!1),y=i.useRef(n);return i.useEffect(()=>{if(n&&!y.current){f(!0);const j=setTimeout(()=>f(!1),400);return()=>clearTimeout(j)}y.current=n},[n]),e.jsxs("div",{children:[e.jsxs("div",{className:`flex flex-col gap-[4px] p-4 card-hover${p?" error-shake":""}`,style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius)"},children:[e.jsx("div",{className:"text-[13px]",style:{color:"var(--t-text-secondary)",letterSpacing:"0.13px",lineHeight:"20px"},children:c("wallet.label")}),e.jsxs("div",{className:"relative flex items-center",children:[e.jsx("input",{type:"text",value:t,onChange:j=>a(j.target.value),onFocus:u,onBlur:s,placeholder:r,spellCheck:!1,autoComplete:"off",className:"w-full bg-transparent text-[13px] outline-none",style:{color:"var(--t-text)",border:"none",padding:0,paddingRight:h?24:0,fontSize:13,lineHeight:"20px",letterSpacing:"0.13px",backgroundColor:"transparent"},disabled:l}),h&&e.jsx("div",{className:"absolute right-0 top-0 bottom-0 flex items-center",children:e.jsx(fe,{size:14})}),!t&&d&&!l&&e.jsx("div",{className:"absolute left-0 top-0 bottom-0 flex items-center",style:{pointerEvents:"none"},children:e.jsx("div",{style:{width:1,height:16,background:"var(--t-text)",animation:"fadeIn 0.5s ease-in-out infinite alternate"}})})]})]}),n&&e.jsx("div",{className:"text-[12px] mt-1.5 text-center",style:{color:"var(--t-error)"},children:n})]})}function dr({label:t,disabled:a,loading:r,onClick:n}){return e.jsx("button",{disabled:a,onClick:n,className:"w-full font-medium text-[18px] transition-all duration-150 cta-btn",style:{padding:"12px 24px",lineHeight:"28px",borderRadius:"var(--t-cta-radius)",background:"var(--t-cta-bg)",color:"var(--t-cta-text)",opacity:a?.4:1,cursor:a?"not-allowed":"pointer"},children:e.jsxs("span",{className:"flex items-center justify-center gap-2",children:[t,r&&e.jsx("div",{style:{width:18,height:18,border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",animation:"nramp-spin 0.8s linear infinite",opacity:.6}})]})})}function ur(){const t=U();return e.jsxs("div",{className:"text-center py-3",style:{height:16,lineHeight:"16px"},children:[e.jsx("span",{style:{fontSize:9,opacity:.5,color:"var(--t-text)",letterSpacing:"0.27px"},children:t("footer.poweredBy")}),e.jsx("span",{style:{fontSize:9,opacity:.65,color:"var(--t-text)",letterSpacing:"0.27px"},children:t("footer.brand")})]})}function mr({quote:t,isOpen:a,onClose:r,countdown:n,quotesLoading:o}){var c,h;const l=U();if(!a)return null;const u=p=>String(p).padStart(2,"0"),s=(t==null?void 0:t.fiatCurrency)==="USD"?"$":(t==null?void 0:t.fiatCurrency)==="EUR"?"€":(t==null?void 0:t.fiatCurrency)==="GBP"?"£":t!=null&&t.fiatCurrency?`${t.fiatCurrency} `:"$",d=p=>{const f=typeof p=="string"?parseFloat(p):p;return isNaN(f)?`${s}0.00`:`${s}${f.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`};return e.jsxs("div",{className:"px-5 py-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("div",{className:"flex items-center gap-2",children:o?e.jsx(fe,{size:16}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[12px]",style:{color:"var(--t-text-muted)"},children:l("rate.updatesInLabel")}),e.jsxs("span",{className:"text-[12px] font-medium px-2 py-0.5 rounded-full",style:{color:"var(--t-text)",border:"1px solid var(--t-border)"},children:["00:",u(n)]}),e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"flex items-center justify-center opacity-60 hover:opacity-100 transition-opacity cursor-help","aria-label":l("rate.rateTooltip"),children:e.jsx(pt,{size:12})}),e.jsx("div",{className:"info-tooltip pointer-events-none absolute left-1/2 z-50 w-[200px] px-3 py-2 rounded-xl text-[11px] leading-snug font-medium opacity-0 group-hover:opacity-100 transition-opacity duration-200",style:{background:"var(--t-tooltip-bg)",color:"var(--t-tooltip-text)",top:"calc(100% + 8px)",transform:"translateX(-50%)"},children:l("rate.rateTooltip")})]})]})}),e.jsx("button",{onClick:r,className:"flex items-center justify-center rounded-full transition-opacity hover:opacity-70",style:{width:28,height:28,background:"var(--t-surface)",color:"var(--t-text)"},children:e.jsx(ht,{size:10})})]}),t?e.jsxs("div",{className:"flex flex-col gap-4",children:[t.exchangeRate&&e.jsx("div",{className:"text-[28px] font-semibold",style:{color:"var(--t-text)"},children:d(t.exchangeRate)}),((c=t.fees)==null?void 0:c.processingFee)&&e.jsxs("div",{children:[e.jsxs("span",{className:"text-[13px] block mb-0.5",style:{color:"var(--t-text-secondary)"},children:[l("rate.processingFee"),t.fees.feePercentage?` ${l("rate.feeIncluded",{percentage:Math.round(parseFloat(String(t.fees.feePercentage))*100)/100})}`:""]}),e.jsx("span",{className:"text-[15px] font-semibold",style:{color:"var(--t-text)"},children:d(t.fees.processingFee)})]}),((h=t.fees)==null?void 0:h.networkFee)&&e.jsxs("div",{children:[e.jsxs("span",{className:"flex items-center gap-1 text-[13px] mb-0.5",style:{color:"var(--t-text-secondary)"},children:[l("rate.networkFeeIncl"),e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"flex items-center justify-center opacity-60 hover:opacity-100 transition-opacity cursor-help","aria-label":l("rate.networkFeeTooltip"),children:e.jsx(pt,{size:12})}),e.jsx("div",{className:"info-tooltip pointer-events-none absolute left-1/2 z-50 w-[220px] px-3 py-2 rounded-xl text-[11px] leading-snug font-medium opacity-0 group-hover:opacity-100 transition-opacity duration-200",style:{background:"var(--t-tooltip-bg)",color:"var(--t-tooltip-text)",bottom:"calc(100% + 8px)",transform:"translateX(-50%)"},children:l("rate.networkFeeTooltip")})]})]}),e.jsxs("span",{className:"text-[15px] font-semibold",style:{color:"var(--t-text)"},children:[d(t.fees.networkFee),t.exchangeRate&&e.jsxs("span",{className:"text-[13px] font-normal ml-1.5",style:{color:"var(--t-text-muted)"},children:["(",(parseFloat(t.fees.networkFee)/parseFloat(t.exchangeRate)).toFixed(8)," ",t.cryptoCurrency,")"]})]})]})]}):e.jsx("div",{className:"text-[13px] py-4 text-center",style:{color:"var(--t-text-muted)"},children:l("rate.noQuote")})]})}function Tn({className:t="",theme:a="dark",skinId:r="mono",accentColor:n,bgColor:o,bgImage:l,borderColor:u,borderRadius:s,surfaceColor:d,inputBgColor:c,textColor:h,textSecondaryColor:p,textMutedColor:f,successColor:y,showFlowToggle:j=!0,showSettings:N=!0,showThemeToggle:x=!0,autoRedirect:k=!1,explorerUrl:D,doneButtonText:G,supportEmail:$,stablecoinParity:ee,partnerName:Z,containerHeight:Y,locale:ge,onDone:Q}){var na,oa;const A=U(),{state:C,dispatch:T,config:m,configLoading:L,quotes:w,quotesLoading:b,quotesError:z,fetchQuotes:ie,createOrder:ve,orderLoading:ke,amountError:le,fieldLocks:te,apiConfig:ae,assetBaseUrl:K,availableFiats:ce,availableCryptos:We,availablePaymentMethods:q,selectionUnsupported:de,quotesEmpty:O,bestUnavailableReason:De}=Me(),{locale:Ge,setLocale:Ct}=gt(),[re,Be]=i.useState(a==="dark"),[we,bt]=i.useState(r),[ne,P]=i.useState(null),[tt,_]=i.useState(!1),[St,$e]=i.useState(!1),[Ne,at]=i.useState(!1),[Pe,Ze]=i.useState(!1),[Xe,Re]=i.useState(null),[Ye,jt]=i.useState(!0),[kt,rt]=i.useState(!1),[v,R]=i.useState(!1),[E,I]=i.useState(!1),[F,B]=i.useState(null),[oe,ue]=i.useState(!1),[hr,wt]=i.useState(30),[fr,$t]=i.useState(!1),[xr,Zt]=i.useState(!1),yr=i.useRef(null),Nt=i.useRef(),Rt=i.useRef(C.flowType),gr=Y??640,Xt=i.useRef(w);i.useEffect(()=>{w&&w!==Xt.current&&I(!1),Xt.current=w},[w]),i.useEffect(()=>{b&&!E&&T({type:"CLEAR_QUOTE"})},[b,E,T]),i.useEffect(()=>{E||v||w!=null&&w.bestQuote&&T({type:"SELECT_QUOTE",quote:w.bestQuote})},[w==null?void 0:w.bestQuote,E,v,T]),i.useEffect(()=>{Be(a==="dark")},[a]),i.useEffect(()=>{const g=setTimeout(()=>jt(!1),L?0:800);return()=>clearTimeout(g)},[L]),i.useEffect(()=>{if(Rt.current!==C.flowType&&!Ye){Rt.current=C.flowType,rt(!0),_(!1),$e(!1);const g=setTimeout(()=>rt(!1),350);return()=>clearTimeout(g)}Rt.current=C.flowType},[C.flowType,Ye]);const nt=C.flowType,M=nt==="buy",J=C.cryptoCurrency||"BTC",me=C.fiatCurrency||"USD",Et=M?C.fiatAmount:C.cryptoAmount,X=Ia(Et),pe=C.selectedQuote||(w==null?void 0:w.bestQuote)||null,Ce=pe!=null&&pe.exchangeRate?parseFloat(pe.exchangeRate):null,Qe=i.useRef(null);Ce&&J&&me&&(Qe.current={rate:Ce,crypto:J,fiat:me}),i.useEffect(()=>{(O||z)&&(Qe.current=null)},[O,z]),i.useEffect(()=>{X||(ue(!1),C.selectedQuote&&T({type:"CLEAR_QUOTE"}))},[X,C.selectedQuote,T]);const Ee=i.useMemo(()=>{if(pe){const g=M?pe.cryptoAmount:pe.fiatAmount;if(g)return g}return"0"},[pe,M]),At=i.useRef(Ee);i.useEffect(()=>{if(Ee!==At.current&&Ee!=="0"&&At.current!=="0"){$t(!0);const g=setTimeout(()=>$t(!1),500);return()=>clearTimeout(g)}At.current=Ee},[Ee]);const ze=!!(ee&&Z&&M&&_t(J)&&Ce),vr=ze&&J.toUpperCase().includes(me.toUpperCase()),Yt=ze&&X>0?mt(vr?X:X/Ce):null,Cr=ze&&Yt?Yt:Ee,br=i.useMemo(()=>{var W,Te,_e;const g=Ce||((W=Qe.current)==null?void 0:W.rate),S=Ce?J:(Te=Qe.current)==null?void 0:Te.crypto,H=Ce?me:(_e=Qe.current)==null?void 0:_e.fiat;return!g||!S||!H?"":`1 ${S} ≈ ${g.toFixed(2)} ${H}`},[J,me,Ce]);i.useEffect(()=>{const g=C.walletAddress.trim(),S=C.network;if(!g||g.length<10){Re(null),T({type:"SET_WALLET_ERROR",message:""});return}Ze(!0),Re(null);const H=new AbortController;return clearTimeout(Nt.current),Nt.current=setTimeout(async()=>{var W,Te,_e;try{const It=await(await fetch(`${ae.apiUrl}/public/validate/address`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:g,...S?{network:S}:{}}),signal:H.signal})).json(),Mt=((W=It.data)==null?void 0:W.attributes)||It.data||It;if(Mt.isValid)Re(!0),T({type:"SET_WALLET_ERROR",message:""});else{Re(!1);const Hr=((Te=Mt.errors)==null?void 0:Te[0])||((_e=Mt.details)==null?void 0:_e.formatMessage)||A("wallet.invalidServer");T({type:"SET_WALLET_ERROR",message:Hr})}}catch(Lt){if(Lt instanceof DOMException&&Lt.name==="AbortError")return;Re(null)}finally{H.signal.aborted||Ze(!1)}},500),()=>{clearTimeout(Nt.current),H.abort()}},[C.walletAddress,C.network,ae.apiUrl]);const ot=!Et||X===0,Tt=X>0&&(M?X<ca:X<da),Sr=!!le||Tt||tt&&ot,jr=X>0&&!le&&!Tt,Qt=C.walletAddress.trim().length>=10&&Xe!==!1&&!Pe,zt=jr&&(M?Qt:!0)&&!!C.cryptoCurrency&&!!C.network,kr=g=>{let S=g.target.value.replace(/[^0-9.,]/g,"");const H=M?2:6,W=S.indexOf(".");W!==-1&&S.length-W-1>H&&(S=S.slice(0,W+H+1)),T(M?{type:"SET_FIAT_AMOUNT",amount:S}:{type:"SET_CRYPTO_AMOUNT",amount:S})},wr=g=>{g!==nt&&T({type:"SET_FLOW_TYPE",flowType:g,fieldLocks:te})},Nr=i.useCallback(g=>{T({type:"SET_FIAT_CURRENCY",currency:g})},[T]),Rr=i.useCallback((g,S)=>{T({type:"SET_CRYPTO_CURRENCY",currency:g}),T({type:"SET_CRYPTO_CHAIN",chain:S})},[T]),Er=i.useCallback(g=>{T({type:"SET_PAYMENT_METHOD",methodId:g})},[T]),Ar=i.useCallback(g=>{T({type:"SET_COUNTRY",country:g}),P(null)},[T]),Tr=i.useCallback(()=>{P(null),setTimeout(()=>P("country"),280)},[]),Fr=i.useCallback(()=>{P(null),setTimeout(()=>P("language"),280)},[]),Lr=C.country?(na=xt[C.country.toLowerCase()])==null?void 0:na.name:void 0,Ir=()=>{if(!zt){(Sr||ot)&&(_(!0),Zt(!0),setTimeout(()=>Zt(!1),400));return}if(C.selectedQuote){ve().catch(g=>{B({type:"error",title:A("toast.orderFailed"),desc:g instanceof Error?g.message:A("toast.couldNotCreate")})});return}R(!0),ie()};i.useEffect(()=>{var g;if(!(!v||b)){if(w!=null&&w.bestQuote)R(!1),T({type:"SELECT_QUOTE",quote:w.bestQuote}),ve().catch(S=>{B({type:"error",title:A("toast.orderFailed"),desc:S instanceof Error?S.message:A("toast.couldNotCreate")})});else if(z){R(!1);const S=z.message||A("error.noProviders");T({type:"SET_ERROR",message:S}),B({type:"error",title:A("toast.quoteError"),desc:S})}else if(w&&!w.bestQuote){R(!1);const S=(g=w.unavailableGateways)==null?void 0:g.map(W=>W.reason).filter(Boolean),H=S!=null&&S.length?`${A("error.noProviders")}: ${S.join("; ")}`:A("error.noProviders");T({type:"SET_ERROR",message:H}),B({type:"error",title:A("toast.noProviders"),desc:H})}}},[v,w,b,z,T,ve]);const Jt=i.useRef(C.step);i.useEffect(()=>{const g=Jt.current;Jt.current=C.step,g!==C.step&&(C.step==="checkout"?B({type:"success",title:A("toast.orderCreated"),desc:A("toast.redirecting")}):C.step==="error"&&C.errorMessage&&B({type:"error",title:A("toast.somethingWrong"),desc:C.errorMessage}))},[C.step,C.errorMessage]);const He=C.step==="amount";i.useEffect(()=>{He||ue(!1)},[He]),i.useEffect(()=>{if(!oe||!He)return;wt(30);const g=setInterval(()=>{wt(S=>S<=1?(ie(),30):S-1)},1e3);return()=>clearInterval(g)},[oe,He,ie]),i.useEffect(()=>{oe&&He&&!b&&wt(30)},[b,oe,He]);const qt=re?"theme-dark":"theme-light",st=Dt.find(g=>g.id===we)||Dt[0],Mr=st.accent===null,Ur=n?he(n):!1,ea=g=>{const S=g.replace("#",""),H=parseInt(S.substring(0,2),16),W=parseInt(S.substring(2,4),16),Te=parseInt(S.substring(4,6),16);return(.299*H+.587*W+.114*Te)/255>.5?"#000000":"#ffffff"},ta=Ur?{"--t-accent":n,"--t-cta-bg":n,"--t-cta-text":ea(n)}:Mr?{"--t-accent":re?"#ffffff":"#111111","--t-cta-bg":re?"#ffffff":"#111111","--t-cta-text":re?"#000000":"#ffffff"}:{"--t-accent":st.accent,"--t-cta-bg":st.accent,"--t-cta-text":ea(st.accent)},se={};d&&he(d)&&(se["--t-surface"]=d,se["--t-modal-bg"]=d),c&&he(c)&&(se["--t-pill-bg"]=c,se["--t-close-bg"]=c),h&&he(h)&&(se["--t-text"]=h),p&&he(p)&&(se["--t-text-secondary"]=p),f&&he(f)&&(se["--t-text-muted"]=f,se["--t-text-tertiary"]=f),y&&he(y)&&(se["--t-success"]=y);const Ae={};o&&he(o)?Ae.backgroundColor=o:Ae.backgroundColor="var(--t-bg)",l&&(l.startsWith("https://")||l.startsWith("data:image/"))&&(Ae.backgroundImage=`url(${l})`,Ae.backgroundSize="cover",Ae.backgroundPosition="center");const it={};u&&he(u)&&(it.border=`1px solid ${u}`),s&&(it.borderRadius=s);const Je=C.network,Oe=Je?dt(Je):null,aa=(Oe==null?void 0:Oe.shortName)||(Oe==null?void 0:Oe.name)||Je,Dr=le||(tt&&(Tt||ot)?ot?A("error.amountZero"):M?A("error.minAmountFiat",{min:String(ca),currency:me}):A("error.minAmountCrypto",{min:String(da),currency:J}):void 0),Br=C.walletError?C.walletError:St&&!Qt&&!Pe?A("wallet.invalid"):void 0,Ft=q.filter(g=>g.supportedFiats.includes(C.fiatCurrency)),Pr=Ft.find(g=>g.id===C.paymentMethodId)||Ft[0],ra=C.step==="checkout"?e.jsx(Na,{autoRedirect:k}):C.step==="processing"?e.jsx(Ra,{}):C.step==="complete"?e.jsx(Ea,{explorerUrl:D,doneButtonText:G,onDone:Q}):C.step==="error"?e.jsx(Aa,{supportEmail:$,onDone:Q,doneButtonText:G}):C.step==="confirm"?e.jsx(Ua,{stablecoinParity:ze,partnerName:Z}):null;return ra?e.jsx("div",{className:`${qt} relative w-full max-w-[390px] overflow-hidden flex flex-col select-none transition-colors duration-[400ms] ${t}`,style:{fontFamily:"'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",height:gr,borderRadius:"var(--t-container-radius)",...Ae,...ta,...se,...it},children:ra}):e.jsxs("div",{className:`${qt} relative w-full max-w-[390px] overflow-hidden flex flex-col select-none transition-colors duration-[400ms] ${t}`,style:{fontFamily:"'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",minHeight:640,borderRadius:"var(--t-container-radius)",...Ae,...ta,...se,...it},children:[e.jsx(ar,{tab:nt,onTabSwitch:wr,showFlowToggle:j,showSettings:N,onOpenSettings:()=>P("settings"),darkMode:re}),Ye||kt||L?e.jsx("div",{className:"pt-[88px] px-3 flex-1 flex flex-col",children:L?e.jsx(Da,{}):e.jsx(Ya,{})}):e.jsxs("div",{className:"flex-1 overflow-hidden pt-[88px] px-3 flex flex-col gap-1 tab-fade-in",children:[e.jsx(rr,{amount:Et,onAmountChange:kr,currencyCode:M?me:J,isBuy:M,onOpenModal:()=>P(M?"fiat":"crypto"),assetBaseUrl:K,error:Dr,fieldLocks:te,onBlur:()=>_(!0),inputRef:yr,chainCode:M?void 0:Je,chainDisplay:M?void 0:aa,getChainIconUrl:M?void 0:ut,shaking:xr}),e.jsx(sr,{amount:Cr,currencyCode:M?J:me,chainCode:M?Je:void 0,chainDisplay:M?aa:void 0,isBuy:M,onOpenModal:()=>P(M?"crypto":"fiat"),displayRate:br,assetBaseUrl:K,quotesLoading:b,onOpenRateBreakdown:()=>{X>0&&ue(!0)},fieldLocks:te,spendNumeric:X,getChainIconUrl:M?ut:void 0,autoSelectPending:v,rateFlash:fr}),O&&X>0&&e.jsx("div",{className:"px-4 py-2.5 mt-1",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius)",fontSize:12,color:"var(--t-error)",lineHeight:"16px"},children:De||A("error.noProviders")}),ze&&X>0&&(w==null?void 0:w.bestQuote)&&e.jsxs("div",{className:"flex items-start gap-2 mt-1 px-4 py-2.5",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius)",fontSize:12,color:"var(--t-text-secondary)",lineHeight:"16px"},children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0,marginTop:1},children:[e.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M8 7v4M8 5.5v-.01",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),e.jsx("span",{children:A("parity.info",{receiveAmount:Ee,crypto:J,spendAmount:mt(X),fiat:me,partner:Z||""})})]}),(w||b)&&e.jsx(kn,{selectedQuote:C.selectedQuote,quotesLoading:b,onOpenModal:()=>P("provider"),assetBaseUrl:K}),(q.length>0||(m==null?void 0:m.paymentMethods)&&m.paymentMethods.length>0)&&(Ft.length>0?e.jsx(ir,{selectedMethod:Pr,onOpenModal:()=>P("payment"),darkMode:re,getMethodIcon:Gt,getMethodDisplayName:(g,S)=>Wt(g,S,A,!0)}):e.jsx("div",{className:"flex items-center justify-center px-4 mt-1",style:{background:"var(--t-surface)",borderRadius:"var(--t-card-radius)",height:56},children:e.jsx("span",{className:"text-[12px]",style:{color:"var(--t-text-muted)"},children:A("payment.noneAvailable")})})),M&&e.jsx(cr,{address:C.walletAddress,onChange:g=>T({type:"SET_WALLET_ADDRESS",address:g}),placeholder:A("wallet.placeholderBuy"),isBuy:M,error:Br,validating:Pe,disabled:!!((oa=te==null?void 0:te.destinationAddress)!=null&&oa.locked),onFocus:()=>at(!0),onBlur:()=>{at(!1),$e(!0)},focused:Ne}),e.jsx("div",{className:"flex-1",style:{minHeight:16}}),de&&e.jsx("div",{className:"text-[12px] text-center mb-2",style:{color:"var(--t-error)"},children:A(M?"error.currencyUnavailableBuy":"error.currencyUnavailableSell")}),e.jsxs("div",{className:"flex flex-col gap-3 pb-3",children:[e.jsx(dr,{label:M?A("cta.buy",{crypto:J}):A("cta.sell",{crypto:J}),disabled:!zt||ke||v||de||O,loading:ke||v,onClick:Ir}),e.jsx(ur,{})]})]},nt),F&&e.jsx(Xa,{type:F.type,title:F.title,description:F.desc,visible:!!F,onDismiss:()=>B(null)}),e.jsx(Qa,{isOpen:oe,onClose:()=>ue(!1),children:e.jsx(mr,{quote:pe,isOpen:oe,onClose:()=>ue(!1),countdown:hr,quotesLoading:b})}),e.jsx(Se,{isOpen:ne==="fiat",onClose:()=>P(null),children:g=>e.jsx(za,{onClose:g,onSelect:S=>{Nr(S),g()},currencies:ce.map(S=>({code:S.code,name:S.code})),assetBaseUrl:K,selectedCode:C.fiatCurrency})}),e.jsx(Se,{isOpen:ne==="crypto",onClose:()=>P(null),children:g=>e.jsx(Ja,{onClose:g,onSelect:(S,H)=>{Rr(S,H),g()},cryptos:We.map(S=>{var H;return{code:S.code,name:S.code,networks:(H=S.networks)==null?void 0:H.map(W=>({code:W.id,name:W.name}))}}),assetBaseUrl:K,selectedCode:C.cryptoCurrency,selectedChain:C.network})}),e.jsx(Se,{isOpen:ne==="payment",onClose:()=>P(null),children:g=>e.jsx(vn,{methods:q,selectedId:C.paymentMethodId,onSelect:S=>{Er(S),g()},onClose:g})}),e.jsx(Se,{isOpen:ne==="provider",onClose:()=>P(null),children:g=>e.jsx(lr,{quotes:w,quotesLoading:b,cryptoCurrency:J,selectedGatewayId:C.selectedProvider,assetBaseUrl:K,onSelect:S=>{I(!0),T({type:"SELECT_QUOTE",quote:S}),g()},onClose:g})}),e.jsx(Se,{isOpen:ne==="settings",onClose:()=>P(null),variant:"right",children:g=>e.jsx(er,{onClose:g,darkMode:re,onToggleDarkMode:Be,skinId:we,onSelectSkin:S=>{bt(S)},showThemeToggle:x,country:C.country,countryName:Lr,onLocationPress:Tr,onLanguagePress:Fr,assetBaseUrl:K})}),e.jsx(Se,{isOpen:ne==="country",onClose:()=>P(null),children:g=>e.jsx(tr,{onClose:g,onSelect:S=>{Ar(S),g()},assetBaseUrl:K,selectedCode:C.country})}),e.jsx(Se,{isOpen:ne==="language",onClose:()=>P(null),children:g=>e.jsx(jn,{onClose:g,onSelect:S=>{Ct(S),g()},selectedCode:Ge})})]})}function pr({projectId:t,apiUrl:a,assetBaseUrl:r,flowType:n,customerId:o,brandId:l,defaultFiatCurrency:u,defaultCryptoCurrency:s,defaultNetwork:d,defaultFiatAmount:c,defaultCryptoAmount:h,defaultWalletAddress:p,defaultGateway:f,defaultCountry:y,fieldLocks:j,partnerMetadata:N,statusPollInterval:x,onComplete:k,onError:D,className:G,theme:$,skinId:ee,accentColor:Z,bgColor:Y,bgImage:ge,borderColor:Q,borderRadius:A,surfaceColor:C,inputBgColor:T,textColor:m,textSecondaryColor:L,textMutedColor:w,successColor:b,showFlowToggle:z,showSettings:ie,showThemeToggle:ve,autoRedirect:ke,explorerUrl:le,doneButtonText:te,supportEmail:ae,stablecoinParity:K,partnerName:ce,containerHeight:We,locale:q,onDone:de}){return e.jsx(ba,{projectId:t,apiUrl:a,assetBaseUrl:r,flowType:n,customerId:o,brandId:l,defaultFiatCurrency:u,defaultCryptoCurrency:s,defaultNetwork:d,defaultFiatAmount:c,defaultCryptoAmount:h,defaultWalletAddress:p,defaultGateway:f,defaultCountry:y,fieldLocks:j,partnerMetadata:N,statusPollInterval:x,onComplete:k,onError:D,children:e.jsx(ka,{defaultLocale:q||"en",children:e.jsx(Tn,{className:G,theme:$,skinId:ee,accentColor:Z,bgColor:Y,bgImage:ge,borderColor:Q,borderRadius:A,surfaceColor:C,inputBgColor:T,textColor:m,textSecondaryColor:L,textMutedColor:w,successColor:b,showFlowToggle:z,showSettings:ie,showThemeToggle:ve,autoRedirect:ke,explorerUrl:le,doneButtonText:te,supportEmail:ae,stablecoinParity:K,partnerName:ce,containerHeight:We,onDone:de})})})}function Fn({submitButtonText:t,rateRefreshInterval:a,...r}){return e.jsx(pr,{...r})}function Ln({skin:t,active:a,onClick:r,darkMode:n,dimmed:o}){const l=t.accent===null,u=32;return e.jsxs("button",{onClick:r,className:"relative shrink-0",style:{width:u,height:u,opacity:o?.4:1,transition:"opacity 0.2s"},children:[l?e.jsxs("svg",{width:u,height:u,viewBox:"0 0 32 32",children:[e.jsx("clipPath",{id:"mono-left",children:e.jsx("rect",{x:"0",y:"0",width:"16",height:"32"})}),e.jsx("clipPath",{id:"mono-right",children:e.jsx("rect",{x:"16",y:"0",width:"16",height:"32"})}),e.jsx("circle",{cx:"16",cy:"16",r:"15",fill:"#111111",clipPath:"url(#mono-left)"}),e.jsx("circle",{cx:"16",cy:"16",r:"15",fill:"#ffffff",clipPath:"url(#mono-right)"}),e.jsx("circle",{cx:"16",cy:"16",r:"15",fill:"none",stroke:n?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.1)",strokeWidth:"1"})]}):e.jsx("svg",{width:u,height:u,viewBox:"0 0 32 32",children:e.jsx("circle",{cx:"16",cy:"16",r:"15",fill:t.accent})}),a&&!o&&e.jsx("div",{className:"absolute inset-0 rounded-full",style:{boxShadow:"0 0 0 2px var(--t-bg), 0 0 0 4px var(--t-text)"}})]})}exports.AnimatedDigit=nr;exports.AnimatedNumber=or;exports.ApplePayIcon=tn;exports.ArrowUpIcon=mn;exports.BLOCKCHAINS=Ve;exports.BankIcon=en;exports.BottomSheet=Qa;exports.COUNTRIES=qe;exports.COUNTRY_MAP=xt;exports.CRYPTO_CHAIN_COMBOS=Ma;exports.CRYPTO_CURRENCIES=Ht;exports.CardIcon=on;exports.CheckmarkIcon=$a;exports.CheckoutForm=Fn;exports.CheckoutStep=Na;exports.ChevronDown=xe;exports.ChevronRight=Oa;exports.ChooseRampModal=lr;exports.CloseButton=je;exports.CoinifyIcon=sn;exports.CompleteStep=Ea;exports.ConfirmStep=Ua;exports.CountryPickerModal=tr;exports.CryptoCurrencyModal=Ja;exports.CryptoIcon=Kt;exports.CtaButton=dr;exports.DarkModeIcon=cn;exports.ErrorStep=Aa;exports.FIAT_CURRENCIES=Ut;exports.FIAT_TO_COUNTRY=Ta;exports.FiatCurrencyModal=za;exports.FiatFlag=vt;exports.Footer=ur;exports.FormSkeleton=Da;exports.GenericCoinIcon=Vt;exports.GooglePayIcon=an;exports.HeaderBar=ar;exports.I18nProvider=ka;exports.InfoIcon=pt;exports.LANGUAGES=Ie;exports.LoadingScreen=Ya;exports.MOCK_RATES=Bt;exports.MenuIcon=ln;exports.Modal=Se;exports.MoreDotsIcon=Ga;exports.NRLogo=ye;exports.NRLogoIcon=dn;exports.PayPalIcon=Ha;exports.PaymentAppleIcon=Va;exports.PaymentBankIcon=_a;exports.PaymentCard=ir;exports.PaymentCardsIcon=Ka;exports.PaymentGoogleIcon=Wa;exports.PaymentMethodSelector=gn;exports.ProcessingStep=Ra;exports.RampForm=pr;exports.RampProvider=ba;exports.RateBreakdown=mr;exports.ReceiveCard=sr;exports.RedirectScreen=wa;exports.RevolutIcon=Pa;exports.SKINS=Dt;exports.SearchIcon=un;exports.SearchInput=Ue;exports.SettingsScreen=er;exports.Skeleton=V;exports.SkinSwatch=Ln;exports.SpendCard=rr;exports.Spinner=fe;exports.Toast=Xa;exports.ToggleSwitch=qa;exports.WalletCard=cr;exports.XIcon=ht;exports.formatOutput=mt;exports.getChainIconUrl=ut;exports.getCryptoIconUrl=Ot;exports.getDefaultFiatForCountry=ct;exports.getFiatFlagUrl=Fa;exports.getMockRate=qr;exports.getPaymentIcon=Za;exports.isStablecoin=_t;exports.parseAmount=Ia;exports.useCheckoutIntent=ya;exports.useI18n=gt;exports.useQuotes=xa;exports.useRamp=Me;exports.useRampConfig=fa;exports.useT=U;exports.useTransaction=ga;
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|