@privy-io/react-auth 1.81.3 → 1.83.0

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/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{$ as Fn,$a as Rt,A as Qs,Aa as Nr,B as Vu,Ba as am,C as Dn,Ca as sm,D as Gu,Da as lm,E as Ti,Ea as Hd,F as qu,Fa as cm,G as Uo,Ga as dm,H as Ir,Ha as pm,I as Ma,Ia as Ve,J as zu,Ja as rl,K as Xs,Ka as ft,L as Ku,La as um,M as Ne,Ma as _,N as Yu,Na as _e,O as Qu,Oa as V,P as Ld,Pa as mm,Q as Un,Qa as fm,R as Nd,Ra as hm,S as Zs,Sa as Oe,T as Xu,Ta as N,U as Od,Ua as Pi,V as Dd,Va as xi,W as Js,Wa as H,X as Ia,Xa as J,Y as Wa,Ya as ym,Z as js,Za as er,_ as La,_a as gm,a as Lu,aa as Bn,ab as Na,b as zs,ba as Hn,bb as Oa,c as Wd,ca as $s,cb as Cm,d as Nu,da as Ud,db as vm,e as $t,ea as Fd,eb as Ri,f as Mr,fa as Vn,fb as wm,g as w,ga as Fo,gb as bm,h as Ou,ha as Bd,hb as Jr,i as Ie,ia as Si,ib as ki,j as pe,ja as Zu,jb as ho,k as st,ka as Ju,kb as Et,l as On,la as ju,lb as Da,m as fr,ma as $u,mb as Em,n as Du,na as em,nb as Q0,o as mo,oa as Ai,ob as X0,p as ka,pa as Zr,pb as Z0,q as j,qa as tm,r as $o,ra as el,s as Ks,sa as rm,t as Uu,ta as Wr,u as Ys,ua as om,v as Fu,va as tl,w as Bt,wa as nm,x as Bu,xa as Lr,y as Hu,ya as fo,z as _a,za as im}from"./chunk-XBTZ7LOU.js";import{getAddress as No}from"@ethersproject/address";import{Web3Provider as Ru}from"@ethersproject/providers";import{createStore as eA}from"mipd";import{useEffect as po,useMemo as tA,useRef as Ra,useState as lt}from"react";import{isAndroid as rA}from"react-device-detect";import{ProviderErrors as oA,calculateTotalGasEstimate as nA,populateTransactionRequest as iA}from"@privy-io/js-sdk-core";var ol="/api/v1/sessions",nl="/api/v1/sessions/logout",Tm="/api/v1/sessions/fork",il="/api/v1/sessions/fork/recover",Sm="/api/v1/siwe/init",Am="/api/v1/siwe/authenticate",Pm="/api/v1/siwe/link",xm="/api/v1/siwe/unlink",Rm="/api/v1/farcaster/init",km="/api/v1/farcaster/authenticate",_m="/api/v1/farcaster/link",Mm="/api/v1/farcaster/status",Im="/api/v1/farcaster/unlink",Wm="/api/v1/passwordless/init",Lm="/api/v1/passwordless/authenticate",Nm="/api/v1/passwordless/link",Om="/api/v1/passwordless/unlink",Dm="/api/v1/passwordless/update",Um="/api/v1/passwordless_sms/init",Fm="/api/v1/passwordless_sms/link",Bm="/api/v1/passwordless_sms/unlink",Hm="/api/v1/passwordless_sms/authenticate",Vm="/api/v1/passwordless_sms/update",al="/api/v1/oauth/init",Gm="/api/v1/oauth/authenticate",sl="/api/v1/oauth/link",qm="/api/v1/oauth/unlink",zm="/api/v1/recovery/oauth/init",Km="/api/v1/recovery/oauth/init_icloud",Ym="/api/v1/recovery/oauth/authenticate",Qm="/api/v1/passkeys/link/init",Xm="/api/v1/passkeys/authenticate/init",Zm="/api/v1/passkeys/link",Jm="/api/v1/passkeys/authenticate",jm="/api/v1/passkeys/unlink",$m="/api/v1/telegram/authenticate",ef="/api/v1/telegram/link",tf="/api/v1/telegram/unlink";var rf="/api/v1/mfa/passwordless_sms/init",of="/api/v1/mfa/passkeys/init",nf="/api/v1/users/me/accept_terms",ll="/api/v1/analytics_events",af="/api/v1/custom_jwt_account/authenticate",sf="/api/v1/guest/authenticate",lf="/api/v1/plugins/moonpay_on_ramp/sign",cf="/api/v1/funding/coinbase_on_ramp/init",df="/api/v1/funding/coinbase_on_ramp/status";var _i=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(af,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw pe(t)}}async link(){throw new Error("Unimplemented")}};var en=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(Lm,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw pe(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(Nm,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw pe(t)}}async sendCodeEmail(t,r){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new w("Email must be set when initialzing authentication.");try{return await this.api.post(Wm,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw pe(o)}}},cl=class extends en{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new w("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Dm,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw pe(r)}}};import{isMobile as J0,isIOS as j0}from"react-device-detect";var dl=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(pl))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var pl={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function pf(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function uf(e,t){let r=pf(t);if(r.deepLink)return Cf(r.deepLink,e);if(r.universalLink)return Vd(r.universalLink,e);throw new w(`Unsupported wallet ${t.id}`)}function mf(e,t){let r=pf(t);if(r.universalLink)return Vd(r.universalLink,e)}var ff="WALLETCONNECT_DEEPLINK_CHOICE";function hf(){try{localStorage.removeItem(ff)}catch{}}function yf({href:e,name:t}){try{localStorage.setItem(ff,JSON.stringify({href:e,name:t}))}catch{}}function gf(e){return e.startsWith("http://")||e.startsWith("https://")}function Cf(e,t){if(gf(e))return Vd(e,t);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function Vd(e,t){if(!gf(e))return Cf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function ul(e,t){window.open(e,t,"noreferrer noopener")}var Xe=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var Ua=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Xe(this._startChannelOnce.bind(this)),this.pollForReady=new Xe(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("Auth flow must be initialized first");try{let t=await this.api.post(km,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new w("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw pe(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(_m,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw pe(t)}}async _startChannelOnce(){if(!this.api)throw new w("Auth flow has no API instance");let t=await this.api.post(Rm,{token:this.captchaToken});J0&&!j0&&t.connect_uri&&ul(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new w("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("Auth flow must be initialized first");let t=await this.api.get(Mm,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};import{base64url as wf}from"jose";async function vf(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function Fa(e){return crypto.getRandomValues(new Uint8Array(e))}var Mi=class{constructor(t){this.meta={guestCredential:this.getOrCreateGuestCredential(t)}}getOrCreateGuestCredential(t){let r=js(t);if(ka()){if(j.get(r))return j.get(r);{let o=wf.encode(Fa(32));return j.put(r,o),o}}return wf.encode(Fa(32))}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(sf,{guest_credential:this.meta.guestCredential});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw pe(t)}}async link(){throw new Error("Linking is not supported for the guest flow")}};import{base64url as bf}from"jose";var $0="S256",eC="S256";function Gn(){return bf.encode(Fa(36))}function Ii(){return Gn()}async function Wi(e,t=$0){if(t==eC){let r=await vf(e);return bf.encode(r)}else return e}function Ef(){let e=j.get(Bn);if(!e)throw new w("Authentication error.");return e}function ml(){return!!j.get(Hn)}var yo=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:ml();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=Ef();try{let r=await this.api.post(Gm,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return j.del(Bn),this.meta.headless&&j.del(Hn),{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=pe(r);throw o.privyErrorCode?new w(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new w("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new w("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=j.get(Bn);if(!t)throw new w("Authentication error.");try{let r=await this.api.post(sl,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return j.del(Bn),r}catch(r){throw pe(r)}}async getAuthorizationUrl(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.provider)throw new w("Provider must be set when initializing OAuth authentication.");let t=Gn();j.put(Bn,t);let r=Ii();j.put(Fn,r);let o=await Wi(t);this.meta.headless&&j.put(Hn,!0);try{return await this.api.post(al,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw pe(n)}}};function Gd(e){return e.charAt(0).toUpperCase()+e.slice(1)}import{jsx as Tf,jsxs as tC}from"react/jsx-runtime";var fl=({style:e,...t})=>tC("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[Tf("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),Tf("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});import{jsx as Ba,jsxs as rC}from"react/jsx-runtime";var hl=({style:e,...t})=>rC("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[Ba("g",{clipPath:"url(#clip0)",children:Ba("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),Ba("defs",{children:Ba("clipPath",{id:"clip0",children:Ba("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as Sf}from"react/jsx-runtime";var yl=({style:e,...t})=>Sf("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:Sf("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});import oC from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as nC}from"react/jsx-runtime";var Af=({style:e})=>nC(oC,{style:{color:"var(--privy-color-error)",...e}});import{jsx as gl,jsxs as iC}from"react/jsx-runtime";var Cl=({style:e,...t})=>iC("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[gl("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),gl("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),gl("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),gl("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});import{jsx as Or,jsxs as vl}from"react/jsx-runtime";function wl(e){return vl("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[vl("defs",{children:[vl("linearGradient",{id:"b",children:[Or("stop",{offset:"0",stopColor:"#3771c8"}),Or("stop",{stopColor:"#3771c8",offset:".128"}),Or("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),vl("linearGradient",{id:"a",children:[Or("stop",{offset:"0",stopColor:"#fd5"}),Or("stop",{offset:".1",stopColor:"#fd5"}),Or("stop",{offset:".5",stopColor:"#ff543e"}),Or("stop",{offset:"1",stopColor:"#c837ab"})]}),Or("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),Or("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),Or("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),Or("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),Or("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}import{jsx as bl}from"react/jsx-runtime";function El({style:e,...t}){return bl("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:bl("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:bl("g",{transform:"scale(5.12,5.12)",children:bl("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}import{jsx as Pf,jsxs as aC}from"react/jsx-runtime";function Tl(e){return aC("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[Pf("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),Pf("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}import{jsx as qd,jsxs as sC}from"react/jsx-runtime";function Sl(e){return sC("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[qd("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),qd("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),qd("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}import{jsx as xf}from"react/jsx-runtime";var Al=({style:e,...t})=>xf("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:xf("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var Rf={google:{name:"Google",component:Cl},discord:{name:"Discord",component:hl},github:{name:"Github",component:yl},linkedin:{name:"LinkedIn",component:El},twitter:{name:"Twitter",component:Al},spotify:{name:"Spotify",component:Tl},instagram:{name:"Instagram",component:wl},tiktok:{name:"Tiktok",component:Sl},apple:{name:"Apple",component:fl}},Ha=e=>e in Rf?Rf[e]:{name:"Unknown",component:Af};function kf(e,t){let r={detail:"",retryable:!1},o=Gd(t);if(e?.privyErrorCode==="linked_to_another_user"&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode==="invalid_credentials"&&(r.retryable=!0,r.detail="Something went wrong. Try again."),e.privyErrorCode==="oauth_user_denied"&&(r.detail=`Retry and check ${o} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode==="too_many_requests"&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("provider rate limit")){let n=Ha(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=Ha(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return e?.privyErrorCode==="cannot_link_more_of_type"&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode==="oauth_unexpected"&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}function Va(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");if(!t||!r||!o)return{inProgress:!1};let n=!1;try{n=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:ml(),popupFlow:window.opener!==null&&n}}function qn(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),j.del(Fn),window.history.replaceState({},"",e)}var zn=class{constructor(t){this.initAuthenticateOnce=new Xe(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Xe(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new w("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new w("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let r=await t.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),o=await this.api.post(Jm,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(r){throw r.name==="NotAllowedError"?new w("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):pe(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let r=this.meta.initLinkResponse.options,o=await t.startRegistration(this._transformInitLinkOptionsToCamelCase(r));return await this.api.post(Zm,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new w("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):pe(r)}}async _initAuthenticateOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(Xm,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(Qm,{})}_transformInitLinkOptionsToCamelCase(t){return{rp:t.rp,user:{id:t.user.id,name:t.user.name,displayName:t.user.display_name},challenge:t.challenge,pubKeyCredParams:t.pub_key_cred_params.map(r=>({type:r.type,alg:r.alg})),timeout:t.timeout,excludeCredentials:t.exclude_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports})),authenticatorSelection:{authenticatorAttachment:t.authenticator_selection?.authenticator_attachment,requireResidentKey:t.authenticator_selection?.require_resident_key,residentKey:t.authenticator_selection?.resident_key,userVerification:t.authenticator_selection?.user_verification},attestation:t.attestation,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props?.rk,hmacCreateSecret:t.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,attestation_object:t.response.attestationObject,authenticator_data:t.response.authenticatorData},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}_transformInitAuthenticateOptionsToCamelCase(t){return{challenge:t.challenge,allowCredentials:t.allow_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports}))||[],timeout:t.timeout,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props,hmacCreateSecret:t.extensions?.hmac_create_secret},userVerification:t.user_verification}}_transformAuthenticationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}};var Pl=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,i="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",a=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
1
+ import{$ as zn,$a as km,A as $s,Aa as gm,B as em,Ba as Wr,C as Gn,Ca as Cm,D as tm,Da as vm,E as Mi,Ea as wm,F as rm,Fa as Xd,G as Fo,Ga as bm,H as _r,Ha as Em,I as Ua,Ia as Tm,J as om,Ja as Ne,K as el,Ka as sl,L as nm,La as mt,M as Le,Ma as Sm,N as im,Na as I,O as am,Oa as Pe,P as Vd,Pa as V,Q as qn,Qa as Am,R as Gd,Ra as Pm,S as tl,Sa as xm,T as sm,Ta as Oe,U as qd,Ua as D,V as zd,Va as Li,W as rl,Wa as Ni,X as Fa,Xa as B,Y as Ba,Ya as J,Z as ol,Za as Rm,_ as Ha,_a as jt,a as Ku,aa as Kn,ab as Pt,b as Zs,ba as Yn,bb as Ho,c as Hd,ca as Qn,cb as Zd,d as Yu,da as nl,db as Va,e as Jt,ea as Kd,eb as _m,f as kr,fa as Yd,fb as Mm,g as v,ga as Xn,gb as Oi,h as Qu,ha as Bo,hb as Im,i as _e,ia as Qd,ib as Wm,j as ie,ja as Ii,jb as Vo,k as it,ka as lm,kb as Di,l as Vn,la as cm,lb as yo,m as ur,ma as dm,mb as wt,n as Xu,na as pm,nb as Ga,o as fo,oa as um,ob as Lm,p as Oa,pa as Wi,pb as rC,q as X,qa as Zr,qb as oC,r as on,ra as mm,s as Js,sa as il,t as Zu,ta as fm,u as js,ua as Mr,v as Ju,va as hm,w as Xr,wa as al,x as ju,xa as ym,y as $u,ya as Ir,z as Da,za as ho}from"./chunk-AAHAMVFD.js";import{getAddress as xi}from"@ethersproject/address";import{Web3Provider as Bu}from"@ethersproject/providers";import{createStore as aA}from"mipd";import{useEffect as co,useMemo as sA,useRef as Na,useState as ut}from"react";import{isAndroid as lA}from"react-device-detect";import{ProviderErrors as cA,calculateTotalGasEstimate as dA,populateTransactionRequest as pA}from"@privy-io/js-sdk-core";var ll="/api/v1/sessions",cl="/api/v1/sessions/logout",Nm="/api/v1/sessions/fork",dl="/api/v1/sessions/fork/recover",Om="/api/v1/siwe/init",Dm="/api/v1/siwe/authenticate",Um="/api/v1/siwe/link",Fm="/api/v1/siwe/unlink",Bm="/api/v1/farcaster/init",Hm="/api/v1/farcaster/authenticate",Vm="/api/v1/farcaster/link",Gm="/api/v1/farcaster/status",qm="/api/v1/farcaster/unlink",zm="/api/v1/passwordless/init",Km="/api/v1/passwordless/authenticate",Ym="/api/v1/passwordless/link",Qm="/api/v1/passwordless/unlink",Xm="/api/v1/passwordless/update",Zm="/api/v1/passwordless_sms/init",Jm="/api/v1/passwordless_sms/link",jm="/api/v1/passwordless_sms/unlink",$m="/api/v1/passwordless_sms/authenticate",ef="/api/v1/passwordless_sms/update",pl="/api/v1/oauth/init",ul="/api/v1/oauth/authenticate",ml="/api/v1/oauth/link",tf="/api/v1/oauth/unlink",rf="/api/v1/recovery/oauth/init",of="/api/v1/recovery/oauth/init_icloud",nf="/api/v1/recovery/oauth/authenticate",af="/api/v1/passkeys/link/init",sf="/api/v1/passkeys/authenticate/init",lf="/api/v1/passkeys/link",cf="/api/v1/passkeys/authenticate",df="/api/v1/passkeys/unlink",pf="/api/v1/telegram/authenticate",uf="/api/v1/telegram/link",mf="/api/v1/telegram/unlink";var ff="/api/v1/mfa/passwordless_sms/init",hf="/api/v1/mfa/passkeys/init",yf="/api/v1/users/me/accept_terms",fl="/api/v1/analytics_events",gf="/api/v1/custom_jwt_account/authenticate",Cf="/api/v1/guest/authenticate",vf="/api/v1/plugins/moonpay_on_ramp/sign",wf="/api/v1/funding/coinbase_on_ramp/init",bf="/api/v1/funding/coinbase_on_ramp/status";var Ui=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new v("Auth flow has no API instance");try{let t=await this.api.post(gf,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ie(t)}}async link(){throw new Error("Unimplemented")}};var nn=class{constructor(t,r,o=!1){this.meta={email:t,captchaToken:r,disableSignup:o}}async authenticate(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new v("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(Km,{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ie(t)}}async link(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new v("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(Ym,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw ie(t)}}async sendCodeEmail(t,r){if(!this.api)throw new v("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new v("Email must be set when initialzing authentication.");try{return await this.api.post(zm,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw ie(o)}}},hl=class extends nn{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r,disableSignup:!1}}async link(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new v("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Xm,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw ie(r)}}};import{isMobile as nC,isIOS as iC}from"react-device-detect";var yl=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(gl))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var gl={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function Ef(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function Tf(e,t){let r=Ef(t);if(r.deepLink)return kf(r.deepLink,e);if(r.universalLink)return Jd(r.universalLink,e);throw new v(`Unsupported wallet ${t.id}`)}function Sf(e,t){let r=Ef(t);if(r.universalLink)return Jd(r.universalLink,e)}var Af="WALLETCONNECT_DEEPLINK_CHOICE";function Pf(){try{localStorage.removeItem(Af)}catch{}}function xf({href:e,name:t}){try{localStorage.setItem(Af,JSON.stringify({href:e,name:t}))}catch{}}function Rf(e){return e.startsWith("http://")||e.startsWith("https://")}function kf(e,t){if(Rf(e))return Jd(e,t);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function Jd(e,t){if(!Rf(e))return kf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function Cl(e,t){window.open(e,t,"noreferrer noopener")}var Je=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var qa=class{constructor(t,r=!1){this._meta={disableSignup:!1};this.captchaToken=t,this.startChannelOnce=new Je(this._startChannelOnce.bind(this)),this.pollForReady=new Je(this._pollForReady.bind(this)),this._meta.disableSignup=r}get meta(){return this._meta}async authenticate(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.channelToken)throw new v("Auth flow must be initialized first");try{let t=await this.api.post(Hm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});if(!t)throw new v("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ie(t)}}async link(){if(!this.api)throw new v("Auth flow has no API instance");try{return await this.api.post(Vm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw ie(t)}}async _startChannelOnce(){if(!this.api)throw new v("Auth flow has no API instance");let t=await this.api.post(Bm,{token:this.captchaToken});nC&&!iC&&t.connect_uri&&Cl(t.connect_uri,"_blank"),this._meta={...this._meta,connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new v("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.channelToken)throw new v("Auth flow must be initialized first");let t=await this.api.get(Gm,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};import{base64url as Mf}from"jose";async function _f(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function za(e){return crypto.getRandomValues(new Uint8Array(e))}var Fi=class{constructor(t){this.meta={guestCredential:this.getOrCreateGuestCredential(t)}}getOrCreateGuestCredential(t){let r=ol(t);if(Oa()){if(X.get(r))return X.get(r);{let o=Mf.encode(za(32));return X.put(r,o),o}}return Mf.encode(za(32))}async authenticate(){if(!this.api)throw new v("Auth flow has no API instance");try{let t=await this.api.post(Cf,{guest_credential:this.meta.guestCredential});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ie(t)}}async link(){throw new Error("Linking is not supported for the guest flow")}};import{base64url as If}from"jose";var aC="S256",sC="S256";function Zn(){return If.encode(za(36))}function Bi(){return Zn()}async function Hi(e,t=aC){if(t==sC){let r=await _f(e);return If.encode(r)}else return e}function Wf(){let e=X.get(Kn);if(!e)throw new v("Authentication error.");return e}function vl(){return!!X.get(Yn)}function Lf(){return!!X.get(Qn)}var go=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:vl();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new v("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new v("User denied confirmation during OAuth flow");let t=Wf();try{let r=await this.api.post(ul,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return X.del(Kn),X.del(Yn),X.del(Qn),{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=ie(r);throw o.privyErrorCode?new v(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new v("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new v("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new v("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new v("User denied confirmation during OAuth flow");let t=X.get(Kn);if(!t)throw new v("Authentication error.");try{let r=await this.api.post(ml,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(Kn),r}catch(r){throw ie(r)}}async getAuthorizationUrl(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.provider)throw new v("Provider must be set when initializing OAuth authentication.");let t=Zn();X.put(Kn,t);let r=Bi();X.put(zn,r);let o=await Hi(t);this.meta.headless&&X.put(Yn,!0),this.meta.disableSignup&&X.put(Qn,!0);try{return await this.api.post(pl,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw ie(n)}}};function jd(e){return e.charAt(0).toUpperCase()+e.slice(1)}import{jsx as Nf,jsxs as lC}from"react/jsx-runtime";var wl=({style:e,...t})=>lC("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[Nf("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),Nf("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});import{jsx as Ka,jsxs as cC}from"react/jsx-runtime";var bl=({style:e,...t})=>cC("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[Ka("g",{clipPath:"url(#clip0)",children:Ka("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),Ka("defs",{children:Ka("clipPath",{id:"clip0",children:Ka("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as Of}from"react/jsx-runtime";var El=({style:e,...t})=>Of("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:Of("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});import dC from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as pC}from"react/jsx-runtime";var Df=({style:e})=>pC(dC,{style:{color:"var(--privy-color-error)",...e}});import{jsx as Tl,jsxs as uC}from"react/jsx-runtime";var Sl=({style:e,...t})=>uC("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[Tl("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),Tl("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),Tl("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),Tl("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});import{jsx as Lr,jsxs as Al}from"react/jsx-runtime";function Pl(e){return Al("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[Al("defs",{children:[Al("linearGradient",{id:"b",children:[Lr("stop",{offset:"0",stopColor:"#3771c8"}),Lr("stop",{stopColor:"#3771c8",offset:".128"}),Lr("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),Al("linearGradient",{id:"a",children:[Lr("stop",{offset:"0",stopColor:"#fd5"}),Lr("stop",{offset:".1",stopColor:"#fd5"}),Lr("stop",{offset:".5",stopColor:"#ff543e"}),Lr("stop",{offset:"1",stopColor:"#c837ab"})]}),Lr("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),Lr("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),Lr("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),Lr("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),Lr("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}import{jsx as xl}from"react/jsx-runtime";function Rl({style:e,...t}){return xl("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:xl("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:xl("g",{transform:"scale(5.12,5.12)",children:xl("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}import{jsx as Uf,jsxs as mC}from"react/jsx-runtime";function kl(e){return mC("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[Uf("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),Uf("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}import{jsx as $d,jsxs as fC}from"react/jsx-runtime";function _l(e){return fC("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[$d("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),$d("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),$d("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}import{jsx as Ff}from"react/jsx-runtime";var Ml=({style:e,...t})=>Ff("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:Ff("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var Bf={google:{name:"Google",component:Sl},discord:{name:"Discord",component:bl},github:{name:"Github",component:El},linkedin:{name:"LinkedIn",component:Rl},twitter:{name:"Twitter",component:Ml},spotify:{name:"Spotify",component:kl},instagram:{name:"Instagram",component:Pl},tiktok:{name:"Tiktok",component:_l},apple:{name:"Apple",component:wl}},Ya=e=>e in Bf?Bf[e]:{name:"Unknown",component:Df};function Hf(e,t){let r={detail:"",retryable:!1},o=jd(t);if(e?.privyErrorCode==="linked_to_another_user"&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode==="invalid_credentials"&&(r.retryable=!0,r.detail="Something went wrong. Try again."),e.privyErrorCode==="oauth_user_denied"&&(r.detail=`Retry and check ${o} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode==="too_many_requests"&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("provider rate limit")){let n=Ya(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=Ya(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return e?.privyErrorCode==="cannot_link_more_of_type"&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode==="oauth_unexpected"&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}function Qa(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");if(!t||!r||!o)return{inProgress:!1};let n=!1;try{n=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:vl(),popupFlow:window.opener!==null&&n,disableSignup:Lf()}}function Jn(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),X.del(zn),window.history.replaceState({},"",e)}var jn=class{constructor(t){this.initAuthenticateOnce=new Je(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Je(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new v("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new v("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new v("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new v("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let r=await t.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),o=await this.api.post(cf,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(r){throw r.name==="NotAllowedError"?new v("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):ie(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new v("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new v("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let r=this.meta.initLinkResponse.options,o=await t.startRegistration(this._transformInitLinkOptionsToCamelCase(r));return await this.api.post(lf,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new v("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):ie(r)}}async _initAuthenticateOnce(){if(!this.api)throw new v("Auth flow has no API instance");return await this.api.post(sf,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new v("Auth flow has no API instance");return await this.api.post(af,{})}_transformInitLinkOptionsToCamelCase(t){return{rp:t.rp,user:{id:t.user.id,name:t.user.name,displayName:t.user.display_name},challenge:t.challenge,pubKeyCredParams:t.pub_key_cred_params.map(r=>({type:r.type,alg:r.alg})),timeout:t.timeout,excludeCredentials:t.exclude_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports})),authenticatorSelection:{authenticatorAttachment:t.authenticator_selection?.authenticator_attachment,requireResidentKey:t.authenticator_selection?.require_resident_key,residentKey:t.authenticator_selection?.resident_key,userVerification:t.authenticator_selection?.user_verification},attestation:t.attestation,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props?.rk,hmacCreateSecret:t.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,attestation_object:t.response.attestationObject,authenticator_data:t.response.authenticatorData},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}_transformInitAuthenticateOptionsToCamelCase(t){return{challenge:t.challenge,allowCredentials:t.allow_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports}))||[],timeout:t.timeout,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props,hmacCreateSecret:t.extensions?.hmac_create_secret},userVerification:t.user_verification}}_transformAuthenticationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}};var Il=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,i="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",a=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
2
2
  ${e}
3
3
 
4
4
  ${i}
@@ -9,7 +9,7 @@ Chain ID: ${t}
9
9
  Nonce: ${r}
10
10
  Issued At: ${a}
11
11
  Resources:
12
- - https://privy.io`};var Bo=class{constructor(t,r,o){this.getNonceOnce=new Xe(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o,this.client=r}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.client)throw new w("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign(),o=await this.client.authenticateWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:o.user,token:o.token,refresh_token:o.refresh_token,identity_token:o.identity_token,is_new_user:o.is_new_user}}catch(t){throw pe(t)}}async link(){if(!this.client)throw new w("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign();return await this.client.linkWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw pe(t)}}async sign(){if(!this.client)throw new w("SiweFlow has no client instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new w("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async _getNonceOnce(){if(!this.client)throw new w("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildSiweMessage(){if(!this.client)throw new w("SiweFlow has no client instance");let t=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=Pl({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var tn=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(Hm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw pe(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Fm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw pe(t)}}async sendSmsCode(t,r){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new w("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Um,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw pe(o)}}},xl=class extends tn{constructor(r,o,n){super(o,n);this.meta={phoneNumber:o,captchaToken:n,oldPhoneNumber:r}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new w("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(Vm,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(r){throw pe(r)}}};var Li=class{constructor(t){this.meta={captchaToken:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post($m,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw pe(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(ef,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw pe(t)}}};function zd(e){let t={detail:"",retryable:!1};return e?.privyErrorCode==="linked_to_another_user"&&(t.detail="This account has already been linked to another user."),e?.privyErrorCode==="disallowed_login_method"&&(t.detail="Login with Telegram not allowed."),e?.privyErrorCode==="invalid_data"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="cannot_link_more_of_type"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="invalid_credentials"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="too_many_requests"&&(t.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),t}function Mf(){let e;if(e=lC(),e)return _f(),{...e,flowType:"login-url"};if(e=cC(),e)return _f(),{...e,flowType:"web-app"}}function lC(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),r=e.get("hash"),o=Number(e.get("auth_date")||""),n=e.get("first_name"),i=e.get("last_name")||void 0,a=e.get("username")||void 0,l=e.get("photo_url")||void 0;if(!(!t||!n||!o||!r))return{id:t,first_name:n,last_name:i,username:a,photo_url:l,auth_date:o,hash:r}}function cC(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id")||void 0,o=t.get("user"),n=Number(t.get("auth_date")||""),i=t.get("hash"),a=t.get("chat_instance")||void 0,l=t.get("chat_type")||void 0,s=t.get("start_param")||void 0;if(!(!o||!n||!i))return{query_id:r,user:o,auth_date:n,hash:i,chat_instance:a,chat_type:l,start_param:s}}function _f(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),e.hash="",window.history.replaceState({},"",e)}import{v4 as qC}from"uuid";function te(e){return e?new Date(e*1e3):null}function dC(e){let t=[];for(let r of e){let o=r.type;switch(r.type){case"wallet":let n={address:r.address,type:r.type,imported:r.imported,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at),chainType:r.chain_type,chainId:r.chain_id,walletClient:r.wallet_client_type==="privy"?"privy":"unknown",walletClientType:r.wallet_client_type,connectorType:r.connector_type,recoveryMethod:r.recovery_method,walletIndex:r.wallet_index};t.push(n);break;case"cross_app":let i={type:r.type,subject:r.subject,embeddedWallets:r.embedded_wallets,smartWallets:r.smart_wallets,providerApp:{id:r.provider_app_id},verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(i);break;case"email":let a={address:r.address,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(a);break;case"phone":let l={number:r.phoneNumber,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(l);break;case"google_oauth":let s={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(s);break;case"spotify_oauth":let d={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(d);break;case"instagram_oauth":let m={subject:r.subject,username:r.username,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(m);break;case"twitter_oauth":let f={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(f);break;case"discord_oauth":let u={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(u);break;case"github_oauth":let g={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(g);break;case"tiktok_oauth":let v={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(v);break;case"linkedin_oauth":let C={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(C);break;case"apple_oauth":let b={subject:r.subject,email:r.email,type:r.type,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(b);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)});break;case"farcaster":let A={type:r.type,fid:r.fid,ownerAddress:r.owner_address,displayName:r.display_name,username:r.username,bio:r.bio,pfp:r.profile_picture_url,url:r.homepage_url,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(A);break;case"passkey":let k={type:r.type,enrolledInMfa:r.enrolled_in_mfa,credentialId:r.credential_id,authenticatorName:r.authenticator_name,createdWithDevice:r.created_with_device,createdWithOs:r.created_with_os,createdWithBrowser:r.created_with_browser,verifiedAt:te(r.verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(k);break;case"telegram":let S={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,verifiedAt:te(r.first_verified_at),firstVerifiedAt:te(r.first_verified_at),latestVerifiedAt:te(r.latest_verified_at)};t.push(S);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function tr(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var Se=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum"&&t.walletIndex===0)||null,If=e=>e?.linkedAccounts.filter(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum"),Kn=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,Rl=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,pC=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Ht=(e,t)=>Se(e)||Kn(e)?!1:t==="all-users"||t==="users-without-wallets"&&!pC(e)?.length;function Vt(e){if(!e)return null;let t=dC(e.linked_accounts),r=tr(t,"wallet"),o=tr(t,"email"),n=tr(t,"phone"),i=tr(t,"google_oauth"),a=tr(t,"twitter_oauth"),l=tr(t,"discord_oauth"),s=tr(t,"github_oauth"),d=tr(t,"spotify_oauth"),m=tr(t,"instagram_oauth"),f=tr(t,"tiktok_oauth"),u=tr(t,"linkedin_oauth"),g=tr(t,"apple_oauth"),v=tr(t,"farcaster"),C=tr(t,"telegram"),b=e.mfa_methods.map(({type:k,verified_at:S})=>({type:k,verifiedAt:te(S)}));return{id:e.id,createdAt:te(e.created_at),linkedAccounts:t,email:o&&{address:o?.address},phone:n&&{number:n?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported,walletIndex:r.walletIndex},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:a&&{subject:a.subject,username:a.username,name:a.name,profilePictureUrl:a.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:s&&{subject:s.subject,username:s.username,name:s.name,email:s.email},spotify:d&&{subject:d.subject,email:d.email,name:d.name},instagram:m&&{subject:m.subject,username:m.username},tiktok:f&&{subject:f.subject,username:f.username,name:f.name},linkedin:u&&{subject:u.subject,name:u.name,email:u.email,vanityName:u.vanityName},apple:g&&{subject:g.subject,email:g.email},farcaster:v&&{fid:v.fid,ownerAddress:v.ownerAddress,displayName:v.displayName,username:v.username,bio:v.bio,pfp:v.pfp,url:v.url,signerPublicKey:v.signerPublicKey},telegram:C&&{telegramUserId:C.telegramUserId,firstName:C.firstName,lastName:C.lastName,username:C.username,photoUrl:C.photoUrl},mfaMethods:b.map(k=>k.type),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}import{getAddress as Kf}from"@ethersproject/address";import{isHexString as DC}from"@ethersproject/bytes";import UC from"eventemitter3";import vC from"@coinbase/wallet-sdk";import{jsx as Wf,jsxs as uC}from"react/jsx-runtime";var Ho=({style:e,...t})=>uC("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[Wf("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),Wf("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});import{getAddress as vo}from"@ethersproject/address";import{Web3Provider as Ff}from"@ethersproject/providers";import{default as gC}from"eventemitter3";import yC from"eventemitter3";var mC=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation"],Lf=e=>mC.includes(e);import{ErrorCode as fC}from"@ethersproject/logger";import{ProviderErrors as Yn}from"@privy-io/js-sdk-core";var Ni=class extends Ie{constructor(){super("Wallet timeout");this.type="wallet_error"}},Oi=class extends Ie{constructor(){super("User rejected connection");this.type="wallet_error"}},jr=e=>{if(e instanceof Ie)return e;if(e?.code&&e?.reason){let t=new Tt(e);return e.code===fC.ACTION_REJECTED&&(t.details=Yn.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Tt(e):new Ie("Unknown connector error",e)},Dr=class extends $t{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Tt=class extends Dr{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(Yn).find(i=>i.eipCode===o.code);this.details=n||Yn.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=Yn.E32002_CONNECTION_ALREADY_PENDING:this.details=Yn.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=Yn.E32002_WALLET_LOCKED))}},hC={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1}},go={...hC,...Yn};var $e=class{constructor(t,r){this.removeListener=(t,r)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,r)}catch{console.warn("Unable to remove wallet provider listener")}};this.walletTimeout=(t=new Ni,r=this.rpcTimeoutDuration)=>new Promise((o,n)=>setTimeout(()=>{n(t)},r));this.setWalletProvider=t=>{this.walletProvider&&this._subscriptions.forEach(r=>{this.removeListener(r.eventName,r.listener)}),this.walletProvider=t,this._subscriptions.forEach(r=>{this.walletProvider?.on(r.eventName,r.listener)})};this.walletProvider=t,this.rpcTimeoutDuration=r||Vn,this._subscriptions=[]}on(t,r){if(this.walletProvider)return this.walletProvider.on(t,r);this._subscriptions.push({eventName:t,listener:r})}async request(t){if(!this.walletProvider)throw new Ie(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),this.walletTimeout()]).catch(r=>{throw jr(r)})}},rn=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},Ga=class extends yC{constructor(r,o,n,i,a,l=1){super();this.walletProxy=r,this.address=o,this.chainId=l,this.rpcConfig=n,this.chains=i,this.provider=Ir(l,this.chains,n,{appId:a}),this.rpcTimeoutDuration=Di(n,"privy"),this.appId=a}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new rn(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Ae()||!this.address)throw new rn("Disconnected",4900);return(await Df(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new rn(`Invalid params for ${r.method}`,4200);let o;if(typeof r.params[0]=="string")o=r.params[0];else if("chainId"in r.params[0]&&typeof r.params[0].chainId=="string")o=r.params[0].chainId;else throw new rn(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Ir(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",o)}async handlePersonalSign(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for personal_sign");let o=r.params[0],n=r.params[1];return await Nf(o,void 0,n)}async handleSignedTypedData(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_signTypedData_v4");let o=typeof r.params[1]=="string"?JSON.parse(r.params[1]):r.params[1];return await Of(Ma(o))}async handleEstimateGas(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_estimateGas");delete r.params[0].gasPrice,delete r.params[0].maxFeePerGas,delete r.params[0].maxPriorityFeePerGas;let o={...r.params[0],chainId:Dn(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch(n){console.warn(`Gas estimation failed with error: ${n}. Retrying gas estimation by omitting the 'from' address`);try{return delete o.from,await this.provider.send("eth_estimateGas",[o])}catch(i){throw console.warn(`Gas estimation failed with error: ${i} when omitting the 'from' address`),n}}}async request(r){switch(console.debug("Embedded1193Provider.request() called with args",r),r.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return Dn(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(r);case"eth_sendTransaction":return this.handleSendTransaction(r);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(r);case"personal_sign":return this.handlePersonalSign(r);case"eth_signTypedData_v4":return this.handleSignedTypedData(r);default:break}if(Lf(r.method)){let o=await Ae();if(await Uf(),!o||!this.address)throw new rn("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:o,request:{method:r.method,params:r.params}})).response.data}catch(n){throw console.error(n),new rn("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Ae();if(!r||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:r})).address}catch(o){return console.error(o),null}}},Co=class extends $e{constructor(r){super(r,r.rpcTimeoutDuration)}},on=class extends $e{constructor(t){super(t,t.rpcTimeoutDuration)}sendAsync(t,r){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var CC=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},rr=class extends gC{constructor(r,o,n,i){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=Ti(r),this.walletClientType==="privy"&&j.put($s(o.address),r)}),this.emit("walletsUpdated")};this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")};this.onConnect=()=>{this.connected=!0,this.syncAccounts()};this.wallets=[],this.walletClientType=r,this.chains=o,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=Di(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,i){let a=async()=>!!this.wallets.find(l=>vo(l.address)===vo(r));return{address:vo(r),chainId:o,meta:n,imported:i,switchChain:async l=>{if(!a)throw new Ie("Wallet is not currently connected.");let s=this.wallets.find(g=>vo(g.address)===vo(r))?.chainId;if(!s)throw new Ie("Unable to determine current chainId.");let d,m;if(typeof l=="number"?(d=`0x${l.toString(16)}`,m=l):(d=l,m=Number(l)),s===Ti(d))return;let f=this.chains.find(g=>g.id===m);if(!f)throw new Ie(`Unsupported chainId: ${l}`);let u=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:d}]})};try{return await u()}catch(g){if(CC(g,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:d,chainName:f.name,nativeCurrency:f.nativeCurrency,rpcUrls:[f.rpcUrls.default?.http[0]??""],blockExplorerUrls:[f.blockExplorers?.default.url??""]}]}),u();throw this.walletClientType==="rainbow"&&g.message?.includes("wallet_switchEthereumChain")?new Ie(`Rainbow does not support the chainId ${o}`):g}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new Ie("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new Ie("Wallet is not currently connected.");return new Ff(new Co(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new Ie("Wallet is not currently connected.");return new on(this.proxyProvider)},sign:async l=>{if(!await a())throw new Ie("Wallet is not currently connected.");return await this.sign(l)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let d=await _a(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,d),Array.isArray(d)&&(o=d)}}catch(d){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",d)}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],i=vo(n),a=[],l;if(this.walletClientType==="privy"){let d=j.get($s(i));this.chains.find(m=>m.id===Number(d))||(j.del($s(i)),d=null),l=d||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:l}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${l} on initialization`)}}else try{let d=await _a(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,d),typeof d=="string")l=d;else if(typeof d=="number")l=`0x${d.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(d){console.warn(`Failed to get chainId from provider, defaulting to ${Bd}`,d),l=Bd}let s=Ti(l);if(!a.find(d=>vo(d.address)===i)){let d={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet(vo(n),s,d,this.connectorType==="embedded_imported"))}kl(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>vo(n)===vo(o.address)))||null}async isConnected(){let r=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(r)&&r.length>0}async sign(r){return await this.connect({showPrompt:!1}),new Ff(new Co(this.proxyProvider)).getSigner().signMessage(r)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}};var wC=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],Bf=(e,t)=>e.makeWeb3Provider({options:t}),_l,Ml=class extends rr{constructor(r,o,n,i,a,l){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.displayName="Coinbase Wallet";if(this.proxyProvider=new $e(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"all",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!_l){let s=[o.id].concat(r.map(m=>m.id)),d=this.connectionOptions!=="eoaOnly"?s.filter(m=>!wC.includes(m)):[];d.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${d.join(", ")}`),_l=new vC({appName:a,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(Bf(_l,this.connectionOptions))}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:Ho,id:"com.coinbase.wallet"}}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new Ie("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw jr(r)}}updateConnectionPreference(r){this.connectionOptions=r,this.walletClientType=r==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(Bf(_l,this.connectionOptions))}};var qa=class extends rr{constructor(r,o,n,i,a=!1){super("privy",o,n,i);this.connectorType="embedded";this.proxyProvider=r,a&&(this.connectorType="embedded_imported"),this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[Dn(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Ai,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};import{jsx as Hf}from"react/jsx-runtime";var Ui=({style:e,...t})=>Hf("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:Hf("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});import{jsx as hr,jsxs as bC}from"react/jsx-runtime";var Fi=({style:e,...t})=>bC("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[hr("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),hr("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),hr("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),hr("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),hr("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),hr("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),hr("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),hr("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),hr("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),hr("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),hr("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),hr("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),hr("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});import{jsx as Vf,jsxs as EC}from"react/jsx-runtime";var wo=({style:e,...t})=>EC("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[Vf("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),Vf("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var Hi=class extends rr{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new $e(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l)}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new Ie("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw jr(r)}}},Bi,Vi=class extends rr{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";zs(this,Bi,void 0);this.proxyProvider=new $e(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?Wd(this,Bi,{name:"MetaMask",icon:Fi,id:"io.metamask"}):a==="phantom"&&Wd(this,Bi,{name:"Phantom",icon:wo,id:"phantom"})}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return Lu(this,Bi)??{name:"Browser Extension",icon:Ui,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new Ie("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw jr(r)}}};Bi=new WeakMap;import{getAddress as DR}from"@ethersproject/address";import{Web3Provider as FR}from"@ethersproject/providers";import{isMobile as TC}from"react-device-detect";var Il=class extends Hi{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{TC||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new Ie("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw jr(t)}}};var Wl=class extends rr{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new $e(void 0,Vn);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw new Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw new Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(r){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${r}`)}};var Ll=class extends Wl{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:wo,id:"phantom"}}};import{EthereumProvider as WC,OPTIONAL_EVENTS as LC,OPTIONAL_METHODS as NC}from"@walletconnect/ethereum-provider";import{isMobile as OC}from"react-device-detect";import{createContext as AC,useContext as PC,useEffect as Kd,useRef as xC,useState as RC}from"react";import{jsx as SC}from"react/jsx-runtime";function Gf({src:e,...t}){return SC("img",{src:e,...t,style:{display:"none"}})}import{jsx as _C,jsxs as MC}from"react/jsx-runtime";var qf=AC({ready:!1,app:dm,currentScreen:null,lastScreen:null,navigate:ft,navigateBack:ft,resetNavigation:ft,setModalData:ft,onUserCloseViaDialogOrKeybindRef:void 0}),kC=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],zf=e=>{let t=Ve(),r=e.authenticated,[o,n]=RC(e.initialScreen);Kd(()=>{!r&&!kC.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=xC(null);Kd(()=>{e.open||(i.current=null)},[e.open]),Kd(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return MC(qf.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&_C(Gf,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},P=()=>PC(qf);import{jsx as Gi,jsxs as IC}from"react/jsx-runtime";var za=({style:e,...t})=>{let{app:r}=P();return IC("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[Gi("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),Gi("g",{clipPath:"url(#clip0_1765_9946)",children:Gi("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),Gi("defs",{children:Gi("clipPath",{id:"clip0_1765_9946",children:Gi("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var $r=class extends rr{constructor(r,o,n,i,a,l,s,d){super(d||"unknown",n,i,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.privyAppName=s,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new $e(void 0,this.rpcTimeoutDuration),d&&(this.walletEntry=pl[d],this.walletClientType=d)}async initialize(){let r=await this.createProvider();if(this.provider=r,this.proxyProvider.setWalletProvider(r),this.subscribeListeners(),r.session){if(this.walletProvider?.session?.peer.metadata.url){let n=dl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=n?.entry,this.walletClientType=n?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:o}=await import("@walletconnect/modal");this.modal=new o({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(n=>{!n.open&&!this.walletProvider?.session&&this.onQrModalClosed&&this.onQrModalClosed()})}async connect(r){return r.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return this.walletClientType==="metamask"?{name:"MetaMask",icon:Fi,id:"io.metamask"}:{name:Vu(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||za,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(r){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=pl[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,hf(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new Oi)};this.onQrModalClosed=n,(async()=>{let a="",l=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(l?.length&&(a=l[0]),!a||a==="")throw new Ie("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=dl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Di(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(jr(a));return}o(new Ie("Unknown error during connection"))}).finally(()=>this.modal?.closeModal())})}disconnect(){this.walletProvider?.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect Wallet Connect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(r){this.proxyProvider.setWalletProvider(r)}async createProvider(){let r={};for(let a of this.chains){let l=qu(a.id,this.chains,this.rpcConfig,this.privyAppId);l&&(r[a.id]=l)}let o=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(a=>a.id),i=await WC.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:LC,optionalMethods:NC,rpcMap:r,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),OC&&this.walletEntry){let{redirect:l,href:s}=uf(a,this.walletEntry);yf({href:s,name:this.walletEntry.displayName}),this.redirectUri=l;let d=mf(a,this.walletEntry);d?.redirect&&(this.fallbackUniversalRedirectUri=d.redirect),ul(l,"_self")}else this.modal?.openModal({uri:a,chains:[this.defaultChain.id]})}),i.on("connect",()=>{if(this.modal?.closeModal(),i.session?.peer.metadata.url){let a=dl(i.session?.peer.metadata.url);this.walletEntry=a?.entry,this.walletClientType=a?.walletClientType||"unknown"}}),i}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider?.enable()}};var Qd=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>DC(o)).map(o=>Kf(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Di=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||Vn:Vn,Ka=class extends UC{constructor(r,o,n,i,a,l,s,d,m,f,u){super();this.getEthereumProvider=()=>{let r=this.wallets[0],o=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===r?.address));return!r||!o?new $e:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=i,this.defaultChain=a,this.walletConnectors=[],this.initialized=!1,this.store=l,this.walletList=s,this.shouldEnforceDefaultChainOnConnect=d,this.externalWalletConfig=m,this.privyAppName=f,this.privyAppLogo=u,this.storedConnections=Yd()}get wallets(){let r=new Set,o=this.walletConnectors.flatMap(i=>i.wallets).sort((i,a)=>i.connectedAt&&a.connectedAt?a.connectedAt-i.connectedAt:0).filter(i=>{let a=`${i.address}${i.walletClientType}${i.connectorType}`;return r.has(a)?!1:(r.add(a),!0)}),n=o.findIndex(i=>i.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&o.unshift(o.splice(n,1)[0]),o}async initialize(){if(this.initialized)return;j.get(Ud)&&(j.getKeys().forEach(o=>{o.startsWith("walletconnect")&&j.del(o)}),j.del(Ud));let r=Gu(this.store,this.walletList,this.externalWalletConfig).then(o=>{o.forEach(({type:n,eip6963InjectedProvider:i,legacyInjectedProvider:a})=>{this.createWalletConnector("injected",n,{eip6963InjectedProvider:i,legacyInjectedProvider:a})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!$o()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),this.externalWalletConfig.walletConnect.enabled&&this.createWalletConnector("wallet_connect_v2","unknown"),await r,this.initialized=!0}findWalletConnector(r,o){return r==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===r)??null:this.walletConnectors.find(n=>n.connectorType===r&&n.walletClientType===o)??null}onInitialized(r){r.wallets.forEach(o=>{let n=this.storedConnections.find(i=>i.address===o.address&&i.connectorType===o.connectorType&&i.walletClientType===o.walletClientType);n&&(o.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(r){r.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new Ga(r,o,this.rpcConfig,this.chains,i,n.id),s=new qa(l,this.chains,n,this.rpcConfig);this.addWalletConnector(s)}}addImportedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded_imported","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new Ga(r,o,this.rpcConfig,this.chains,i,n.id),s=!0,d=new qa(l,this.chains,n,this.rpcConfig,s);this.addWalletConnector(d)}}removeEmbeddedWalletConnector(){let r=this.findWalletConnector("embedded","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=Yd(),this.emit("walletsUpdated")}}removeImportedWalletConnector(){let r=this.findWalletConnector("embedded_imported","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=Yd(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof $r&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new Il(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new Vi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new Vi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new Vi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Hi(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Ml(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new Ll(this.defaultChain):new $r(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,o)})();return l&&this.addWalletConnector(l),l||null}addWalletConnector(r){this.walletConnectors.push(r),r.on("initialized",()=>this.onInitialized(r)),r.on("walletsUpdated",()=>this.onWalletsUpdated(r)),r.initialize().catch(o=>{console.debug("Failed to initialize connector",o)})}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));j.put(Fd,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return n?n.sign(r):null}setActiveWallet(r){this.activeWallet=Kf(r),this.emit("walletsUpdated")}};function kl(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],n=t[r];if(o?.address!==n?.address||o?.chainId!==n?.chainId||o?.connectorType!==n?.connectorType||o?.connectedAt!==n?.connectedAt||o?.walletClientType!==n?.walletClientType||o?.isConnected!==n?.isConnected||o?.linked!==n?.linked)return!1}return!0}var FC=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",Yd=()=>{let e=j.get(Fd);return e&&Array.isArray(e)&&e.map(o=>FC(o)).every(Boolean)?e:[]};import{ofetch as BC}from"ofetch";var HC=[ol,il,nl,ll],Nl=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Ld,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=BC.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:i,options:a})=>{let l=new Headers(a.headers);l.set("privy-app-id",this.appId),this.appClientId&&l.set("privy-client-id",this.appClientId),l.set("privy-ca-id",this.clientAnalyticsId||""),l.set("privy-client",`react-auth:${this.sdkVersion}`);let s=HC.includes(i.toString());if(!l.has("authorization")){let d=await this.client.getAccessToken({disableAutoRefresh:s});d!==null&&l.set("authorization",`Bearer ${d}`)}a.headers=l,a.retryDelay&&(a.retryDelay=a.retryDelay*3)},onRequestError:({error:i})=>{if(i instanceof DOMException&&i.name==="AbortError")throw new Ou}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw pe(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw pe(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw pe(o)}}};var Yf=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});import nn from"js-cookie";function Qf(e){return e instanceof en?"email":e instanceof tn?"sms":e instanceof Bo?"siwe":e instanceof Mi?"guest":e instanceof _i?"custom_auth":e instanceof yo?e.meta.provider:null}import{isSafari as VC}from"react-device-detect";function Ol(){return!(VC&&window.location.origin.startsWith("http://localhost"))}import*as Xf from"jose";var Ur=class{static parse(t){try{return new Ur(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Xf.decodeJwt(t)}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(t=0){let r=Date.now(),o=(this.expiration-t)*1e3;return r>=o}};var GC=30,Dl=class{constructor(){this.authenticateOnce=new Xe(async t=>this._authenticate(t)),this.linkOnce=new Xe(async t=>this._link(t)),this.refreshOnce=new Xe(this._refresh.bind(this)),this.destroyOnce=new Xe(this._destroy.bind(this)),this.forkSessionOnce=new Xe(this._forkSession.bind(this))}get token(){try{let t=j.get(Un);return typeof t=="string"?new Ur(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=j.get(Zs);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=j.get(Ia);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=j.get(La(t));if(typeof r=="string"){let o=new Ur(r);return o.isExpired()?(j.del(La(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=nn.get(Js);return t!==void 0&&t.length>0}catch(t){console.error(t)}return!1}hasRefreshCredentials(){return this.mightHaveServerCookies||typeof this.token=="string"&&typeof this.refreshToken=="string"&&this.refreshToken!==em}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Ur.parse(this.token);return t!==null&&!t.isExpired(GC)}authenticate(t){return this.authenticateOnce.execute(t)}link(t){return this.linkOnce.execute(t)}refresh(){return this.refreshOnce.execute()}forkSession(){return this.forkSessionOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(t,r){typeof r=="string"?j.put(La(t),r):j.del(La(t))}async _authenticate(t){try{let r=await t.authenticate(),{user:o,is_new_user:n,oauth_tokens:i}=r;this.handleTokenResponse(r);let a=i,l=a?{provider:a.provider,accessToken:a.access_token,accessTokenExpiresInSeconds:a.access_token_expires_in_seconds,refreshToken:a.refresh_token,refreshTokenExpiresInSeconds:i.refresh_token_expires_in_seconds,scopes:a.scopes}:void 0,s=Qf(t);return s&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:s,isNewUser:n}}),s==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:Vt(o),isNewUser:n,oAuthTokens:l}}catch(r){throw console.warn("Error authenticating session"),st(r)}}async _link(t){try{let r=await t.link(),o=r.oauth_tokens,n=o?{provider:o.provider,accessToken:o.access_token,accessTokenExpiresInSeconds:o.access_token_expires_in_seconds,refreshToken:o.refresh_token,refreshTokenExpiresInSeconds:o.refresh_token_expires_in_seconds,scopes:o.scopes}:void 0;return{user:Vt(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),st(r)}}async _refresh(){if(!this.api)throw new w("Session has no API instance");if(!this.client)throw new w("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,r=this.refreshToken,o=this.forkedToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let n;if(t&&r||this.mightHaveServerCookies){let i={};t&&(i.authorization=`Bearer ${t}`);let a=r?{refresh_token:r}:{};n=await this.api.post(ol,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(il,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),Vt(n.user)}catch(n){if(n instanceof Mr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw st(n)}}handleTokenResponse(t){t.session_update_action?t.session_update_action==="set"?(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token)):t.session_update_action==="clear"?this.destroyLocalState():t.session_update_action==="ignore"&&t.token&&(this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token)):(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token))}async _destroy(){try{await this.api?.post(nl,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new w("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(Tm,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw st(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=j.get(Un);if(j.put(Un,t),!this.client?.useServerCookies){let o=Ur.parse(t)?.expiration;nn.set(Nd,t,{sameSite:"Strict",secure:Ol(),expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else j.del(Un),nn.remove(Nd),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(j.put(Zs,t),this.client?.useServerCookies||nn.set(Js,"t",{sameSite:"Strict",secure:Ol(),expires:30})):(j.del(Zs),nn.remove(Xu),nn.remove(Js))}storeIdentityToken(t){if(this.client?.useServerCookies)return;j.put(Od,t);let r=Ur.parse(t)?.expiration;nn.set(Dd,t,{sameSite:"Strict",secure:Ol(),expires:r?new Date(r*1e3):void 0})}clearIdentityToken(){j.del(Od),nn.remove(Dd)}clearForkedToken(){j.del(Ia)}};var Xd,Ul,Zf,Ya=class{constructor(t){zs(this,Ul);this.apiUrl=t.apiUrl||Xs,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||Ku,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=Nu(this,Ul,Zf).call(this),Xd||(Xd=new Dl),this.session=Xd,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:i,walletList:a,shouldEnforceDefaultChainOnConnect:l,externalWalletConfig:s,appName:d}){this.connectors||(this.connectors=new Ka(this.appId,t,r,o,n,i,a,l,s,d))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new Nl({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=t,t}updateApiUrl(t){this.apiUrl=t||this.fallbackApiUrl,this.api=this.generateApi(),t&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new w("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new w("No auth flow in progress.");let{oAuthTokens:t}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:t}}storeProviderAccessToken(t,r){this.session.storeProviderAccessToken(t,r)}getProviderAccessToken(t){return this.session.getProviderAccessToken(t)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(t){t.linkedAccounts.filter(o=>o.type==="cross_app").forEach(o=>{this.storeProviderAccessToken(o.providerApp.id,null)})}startAuthFlow(t){return t.api=this.api,this.authFlow=t,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(rf,{action:"verify"})}catch(t){throw pe(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(of,{});return Yf(t.options)}catch(t){throw pe(t)}}async acceptTerms(){try{let t=await this.api.post(nf,{});return Vt(t)}catch(t){throw st(t)}}async unlinkEmail(t){try{let r=await this.api.post(Om,{address:t});return await this.getAuthenticatedUser()??Vt(r)}catch(r){throw st(r)}}async unlinkPhone(t){try{let r=await this.api.post(Bm,{phoneNumber:t});return await this.getAuthenticatedUser()??Vt(r)}catch(r){throw st(r)}}async unlinkWallet(t){try{let r=await this.api.post(xm,{address:t});return await this.getAuthenticatedUser()??Vt(r)}catch(r){throw st(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(qm,{provider:t,subject:r});return await this.getAuthenticatedUser()??Vt(o)}catch(o){throw st(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(Im,{fid:t});return await this.getAuthenticatedUser()??Vt(r)}catch(r){throw st(r)}}async unlinkTelegram(t){try{let r=await this.api.post(tf,{telegram_user_id:t});return await this.getAuthenticatedUser()??Vt(r)}catch(r){throw st(r)}}async unlinkPasskey(t){try{let r=await this.api.post(jm,{credential_id:t});return await this.getAuthenticatedUser()??Vt(r)}catch(r){throw st(r)}}async createAnalyticsEvent({eventName:t,payload:r,timestamp:o,options:n}){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(ll,{event_name:t,client_id:this.clientAnalyticsId,payload:{...r||{},clientTimestamp:o?o.toISOString():new Date().toISOString()}},{retry:-1,keepalive:n?.keepAlive??!1})}catch{}}async signMoonpayOnRampUrl(t){try{return this.api.post(lf,t)}catch(r){throw st(r)}}async initCoinbaseOnRamp(t){try{return this.api.post(cf,t)}catch(r){throw st(r)}}async getCoinbaseOnRampStatus({partnerUserId:t}){try{return this.api.get(`${df}?partnerUserId=${t}`)}catch(r){throw st(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?this.session.hasRefreshCredentials()?Ur.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:(this.session.destroyLocalState(),null):!t?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let t={},r=this.session.token;r&&(t.authorization=`Bearer ${r}`);let o=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:t}),n=o.telegram_auth_config?{botId:o.telegram_auth_config.bot_id,botName:o.telegram_auth_config.bot_name,linkEnabled:o.telegram_auth_config.link_enabled,seamlessAuthEnabled:o.telegram_auth_config.seamless_auth_enabled}:void 0,i=o.funding_config?{methods:o.funding_config.methods,defaultRecommendedAmount:o.funding_config.default_recommended_amount,defaultRecommendedCurrency:o.funding_config.default_recommended_currency,promptFundingOnWalletCreation:o.funding_config.prompt_funding_on_wallet_creation}:void 0;return{id:o.id,name:o.name,verificationKey:o.verification_key,logoUrl:o.logo_url||void 0,accentColor:o.accent_color||void 0,showWalletLoginFirst:o.show_wallet_login_first,allowlistConfig:{errorTitle:o.allowlist_config.error_title,errorDetail:o.allowlist_config.error_detail,errorCtaText:o.allowlist_config.cta_text,errorCtaLink:o.allowlist_config.cta_link},walletAuth:o.wallet_auth,emailAuth:o.email_auth,smsAuth:o.sms_auth,googleOAuth:o.google_oauth,twitterOAuth:o.twitter_oauth,discordOAuth:o.discord_oauth,githubOAuth:o.github_oauth,spotifyOAuth:o.spotify_oauth,instagramOAuth:o.instagram_oauth,tiktokOAuth:o.tiktok_oauth,linkedinOAuth:o.linkedin_oauth,appleOAuth:o.apple_oauth,farcasterAuth:o.farcaster_auth,passkeyAuth:o.passkey_auth,telegramAuth:o.telegram_auth,termsAndConditionsUrl:o.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:o.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:o.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:o.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:o.privacy_policy_url,requireUsersAcceptTerms:o.require_users_accept_terms,customApiUrl:o.custom_api_url,walletConnectCloudProjectId:o.wallet_connect_cloud_project_id,fiatOnRampEnabled:o.fiat_on_ramp_enabled,captchaEnabled:o.captcha_enabled,captchaSiteKey:o.captcha_site_key,createdAt:new Date(o.created_at*1e3),updatedAt:new Date(o.updated_at*1e3),mfaMethods:o.mfa_methods,enforceWalletUis:o.enforce_wallet_uis,legacyWalletUiConfig:o.legacy_wallet_ui_config,telegramAuthConfiguration:n,fundingConfig:i}}catch(t){throw st(t)}}async getUsdTokenPrice(t){try{return(await this.api.get(`/api/v1/token_price?chainId=${t.id}&tokenSymbol=${t.nativeCurrency.symbol}`)).usd}catch{console.error(`Unable to fetch token price for chain with id ${t.id}`);return}}async requestFarcasterSignerStatus(t){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:t})}catch(r){throw console.error("Unable to fetch Farcaster signer status"),r}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:t,captchaToken:r}){try{return(await this.api.post(Sm,{address:t,token:r})).nonce}catch(o){throw st(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(Am,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(Pm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiwe({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){try{let a=await this.linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i});return Vt(a)}catch(a){throw st(a)}}async setCustomMetadata(t){try{let r=await this.api.post("api/v1/users/custom_metadata",{custom_metadata:t});return await this.getAuthenticatedUser()??Vt(r)}catch(r){throw st(r)}}};Ul=new WeakSet,Zf=function(){if(typeof window>"u")return null;try{let r=j.get(Wa);if(typeof r=="string"&&r.length>0)return r}catch{}let t=qC();try{return j.put(Wa,t),t}catch{return t}};import{Turnstile as ZC}from"@marsidev/react-turnstile";import{useEffect as JC,useMemo as jC}from"react";import{useMemo as zC,useRef as KC,useContext as YC,useState as Zd,createContext as QC}from"react";import{jsx as XC}from"react/jsx-runtime";var Jf=QC({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:ft,setError:ft,setExecuting:ft,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:ft,reset:ft,execute:ft}),yr=class extends $t{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},jf=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=KC(null),[i,a]=Zd(),[l,s]=Zd(),[d,m]=Zd(!1),f=zC(()=>o?!d&&!i&&!l?{status:"ready"}:d&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,i,l,d]);return XC(Jf.Provider,{value:{...f,ref:n,enabled:o,siteKey:r,appId:t,setToken:a,setError:s,setExecuting:m,remove(){o&&(n.current?.remove(),m(!1),s(void 0),a(void 0))},reset(){o&&(n.current?.reset(),m(!1),s(void 0),a(void 0))},execute(){o&&(m(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await Hu(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new yr("Captcha failed",null,"captcha_timeout")}}},children:e})},Pe=()=>YC(Jf);import{jsx as $f}from"react/jsx-runtime";var Jd=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=Pe(),[,s]=jC(()=>r?.split("t:")||[],[r]);if(JC(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return $f("div",{className:"hidden h-0 w-0",children:$f(ZC,{...e,ref:l,siteKey:s,options:{action:o,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),a(!1)},onSuccess:d=>{e.onSuccess?.(d),i(d),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};import{useCallback as NS,useEffect as f0,useRef as OS,useState as DS}from"react";import g0 from"styled-components";function jd(e){Oe("configureMfa",e)}import wv from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import ah from"styled-components";import Qn,{css as eh}from"styled-components";import ep from"styled-components";import{Fragment as ev,jsx as $d,jsxs as tv}from"react/jsx-runtime";var ct=({success:e,fail:t})=>tv(ev,{children:[$d(dt,{className:e?"success":t?"fail":""}),$d(Qa,{className:e?"success":t?"fail":""})]}),dt=ep.span`
12
+ - https://privy.io`};var Go=class{constructor(t,r,o,n=!1){this._meta={disableSignup:!1};this.getNonceOnce=new Je(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o,this.client=r,this._meta.disableSignup=n}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new v("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign(),o=await this.client.authenticateWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return{user:o.user,token:o.token,refresh_token:o.refresh_token,identity_token:o.identity_token,is_new_user:o.is_new_user}}catch(t){throw ie(t)}}async link(){if(!this.client)throw new v("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign();return await this.client.linkWithSiweInternal({message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw ie(t)}}async sign(){if(!this.client)throw new v("SiweFlow has no client instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new v("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async _getNonceOnce(){if(!this.client)throw new v("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildSiweMessage(){if(!this.client)throw new v("SiweFlow has no client instance");let t=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=Il({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var an=class{constructor(t,r,o=!1){this.meta={phoneNumber:t,captchaToken:r,disableSignup:o}}async authenticate(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new v("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post($m,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ie(t)}}async link(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new v("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Jm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ie(t)}}async sendSmsCode(t,r){if(!this.api)throw new v("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new v("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Zm,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw ie(o)}}},Wl=class extends an{constructor(r,o,n){super(o,n);this.meta={phoneNumber:o,captchaToken:n,oldPhoneNumber:r,disableSignup:!1}}async link(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new v("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(ef,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(r){throw ie(r)}}};var Vi=class{constructor(t,r=!1){this.meta={disableSignup:!1};this.meta={captchaToken:t,disableSignup:!1},this.meta.disableSignup=r}async authenticate(){if(!this.api)throw new v("Auth flow has no API instance");try{let t=await this.api.post(pf,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ie(t)}}async link(){if(!this.api)throw new v("Auth flow has no API instance");try{return await this.api.post(uf,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw ie(t)}}};function ep(e){let t={detail:"",retryable:!1};return e?.privyErrorCode==="linked_to_another_user"&&(t.detail="This account has already been linked to another user."),e?.privyErrorCode==="disallowed_login_method"&&(t.detail="Login with Telegram not allowed."),e?.privyErrorCode==="invalid_data"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="cannot_link_more_of_type"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="invalid_credentials"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="too_many_requests"&&(t.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),t}function Gf(){let e;if(e=hC(),e)return Vf(),{...e,flowType:"login-url"};if(e=yC(),e)return Vf(),{...e,flowType:"web-app"}}function hC(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),r=e.get("hash"),o=Number(e.get("auth_date")||""),n=e.get("first_name"),i=e.get("last_name")||void 0,a=e.get("username")||void 0,l=e.get("photo_url")||void 0;if(!(!t||!n||!o||!r))return{id:t,first_name:n,last_name:i,username:a,photo_url:l,auth_date:o,hash:r}}function yC(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id")||void 0,o=t.get("user"),n=Number(t.get("auth_date")||""),i=t.get("hash"),a=t.get("chat_instance")||void 0,l=t.get("chat_type")||void 0,s=t.get("start_param")||void 0;if(!(!o||!n||!i))return{query_id:r,user:o,auth_date:n,hash:i,chat_instance:a,chat_type:l,start_param:s}}function Vf(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),e.hash="",window.history.replaceState({},"",e)}import{v4 as jC}from"uuid";import{getAddress as qf}from"@ethersproject/address";function ee(e){return e?new Date(e*1e3):null}function gC(e){let t=[];for(let r of e){let o=r.type;switch(r.type){case"wallet":let n={address:r.address,type:r.type,imported:r.imported,verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at),chainType:r.chain_type,chainId:r.chain_id,walletClient:r.wallet_client_type==="privy"?"privy":"unknown",walletClientType:r.wallet_client_type,connectorType:r.connector_type,recoveryMethod:r.recovery_method,walletIndex:r.wallet_index};t.push(n);break;case"cross_app":let i={type:r.type,subject:r.subject,embeddedWallets:r.embedded_wallets,smartWallets:r.smart_wallets,providerApp:{id:r.provider_app_id},verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at)};t.push(i);break;case"email":let a={address:r.address,type:r.type,verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at)};t.push(a);break;case"phone":let l={number:r.phoneNumber,type:r.type,verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at)};t.push(l);break;case"google_oauth":let s={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at)};t.push(s);break;case"spotify_oauth":let d={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at)};t.push(d);break;case"instagram_oauth":let u={subject:r.subject,username:r.username,type:r.type,verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at)};t.push(u);break;case"twitter_oauth":let m={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at)};t.push(m);break;case"discord_oauth":let f={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at)};t.push(f);break;case"github_oauth":let y={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at)};t.push(y);break;case"tiktok_oauth":let b={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at)};t.push(b);break;case"linkedin_oauth":let C={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at)};t.push(C);break;case"apple_oauth":let w={subject:r.subject,email:r.email,type:r.type,verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at)};t.push(w);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at)});break;case"farcaster":let A={type:r.type,fid:r.fid,ownerAddress:r.owner_address,displayName:r.display_name,username:r.username,bio:r.bio,pfp:r.profile_picture_url,url:r.homepage_url,verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(A);break;case"passkey":let k={type:r.type,enrolledInMfa:r.enrolled_in_mfa,credentialId:r.credential_id,authenticatorName:r.authenticator_name,createdWithDevice:r.created_with_device,createdWithOs:r.created_with_os,createdWithBrowser:r.created_with_browser,verifiedAt:ee(r.verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at)};t.push(k);break;case"telegram":let T={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,verifiedAt:ee(r.first_verified_at),firstVerifiedAt:ee(r.first_verified_at),latestVerifiedAt:ee(r.latest_verified_at)};t.push(T);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function $t(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var Me=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum"&&t.walletIndex===0)||null,tp=e=>e?.linkedAccounts.filter(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum"),CC=e=>e?.linkedAccounts.filter(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.chainType==="ethereum"),$n=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,Ll=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,Nl=(e,t)=>{let r=CC(e).find(n=>qf(n.address)===qf(t)),o=r?r.imported?r:Me(e):void 0;return{signingWallet:r,rootWallet:o}},vC=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),bt=(e,t)=>Me(e)||$n(e)?!1:t==="all-users"||t==="users-without-wallets"&&!vC(e)?.length;function Ut(e){if(!e)return null;let t=gC(e.linked_accounts),r=$t(t,"wallet"),o=$t(t,"email"),n=$t(t,"phone"),i=$t(t,"google_oauth"),a=$t(t,"twitter_oauth"),l=$t(t,"discord_oauth"),s=$t(t,"github_oauth"),d=$t(t,"spotify_oauth"),u=$t(t,"instagram_oauth"),m=$t(t,"tiktok_oauth"),f=$t(t,"linkedin_oauth"),y=$t(t,"apple_oauth"),b=$t(t,"farcaster"),C=$t(t,"telegram"),w=e.mfa_methods.map(({type:k,verified_at:T})=>({type:k,verifiedAt:ee(T)}));return{id:e.id,createdAt:ee(e.created_at),linkedAccounts:t,email:o&&{address:o?.address},phone:n&&{number:n?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported,walletIndex:r.walletIndex},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:a&&{subject:a.subject,username:a.username,name:a.name,profilePictureUrl:a.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:s&&{subject:s.subject,username:s.username,name:s.name,email:s.email},spotify:d&&{subject:d.subject,email:d.email,name:d.name},instagram:u&&{subject:u.subject,username:u.username},tiktok:m&&{subject:m.subject,username:m.username,name:m.name},linkedin:f&&{subject:f.subject,name:f.name,email:f.email,vanityName:f.vanityName},apple:y&&{subject:y.subject,email:y.email},farcaster:b&&{fid:b.fid,ownerAddress:b.ownerAddress,displayName:b.displayName,username:b.username,bio:b.bio,pfp:b.pfp,url:b.url,signerPublicKey:b.signerPublicKey},telegram:C&&{telegramUserId:C.telegramUserId,firstName:C.firstName,lastName:C.lastName,username:C.username,photoUrl:C.photoUrl},mfaMethods:w.map(k=>k.type),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}import{getAddress as nh}from"@ethersproject/address";import{isHexString as zC}from"@ethersproject/bytes";import KC from"eventemitter3";import xC from"@coinbase/wallet-sdk";import{jsx as zf,jsxs as wC}from"react/jsx-runtime";var qo=({style:e,...t})=>wC("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[zf("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),zf("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});import{getAddress as wo}from"@ethersproject/address";import{Web3Provider as Jf}from"@ethersproject/providers";import{default as AC}from"eventemitter3";import SC from"eventemitter3";var bC=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation"],Kf=e=>bC.includes(e);import{ErrorCode as EC}from"@ethersproject/logger";import{ProviderErrors as ei}from"@privy-io/js-sdk-core";var Gi=class extends _e{constructor(){super("Wallet timeout");this.type="wallet_error"}},qi=class extends _e{constructor(){super("User rejected connection");this.type="wallet_error"}},Jr=e=>{if(e instanceof _e)return e;if(e?.code&&e?.reason){let t=new Et(e);return e.code===EC.ACTION_REJECTED&&(t.details=ei.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Et(e):new _e("Unknown connector error",e)},Nr=class extends Jt{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Et=class extends Nr{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(ei).find(i=>i.eipCode===o.code);this.details=n||ei.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=ei.E32002_CONNECTION_ALREADY_PENDING:this.details=ei.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=ei.E32002_WALLET_LOCKED))}},TC={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1}},Co={...TC,...ei};var $e=class{constructor(t,r){this.removeListener=(t,r)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,r)}catch{console.warn("Unable to remove wallet provider listener")}};this.walletTimeout=(t=new Gi,r=this.rpcTimeoutDuration)=>new Promise((o,n)=>setTimeout(()=>{n(t)},r));this.setWalletProvider=t=>{this.walletProvider&&this._subscriptions.forEach(r=>{this.removeListener(r.eventName,r.listener)}),this.walletProvider=t,this._subscriptions.forEach(r=>{this.walletProvider?.on(r.eventName,r.listener)})};this.walletProvider=t,this.rpcTimeoutDuration=r||Xn,this._subscriptions=[]}on(t,r){if(this.walletProvider)return this.walletProvider.on(t,r);this._subscriptions.push({eventName:t,listener:r})}async request(t){if(!this.walletProvider)throw new _e(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),this.walletTimeout()]).catch(r=>{throw Jr(r)})}},sn=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},Xa=class extends SC{constructor({walletProxy:r,address:o,rootAddress:n,rpcConfig:i,chains:a,appId:l,chainId:s=1,walletIndex:d}){super();this.walletProxy=r,this.address=o,this.rootAddress=n,this.chainId=s,this.rpcConfig=i,this.chains=a,this.provider=_r(s,this.chains,i,{appId:l}),this.rpcTimeoutDuration=zi(i,"privy"),this.appId=l,this.walletIndex=d}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new sn(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await we()||!this.address)throw new sn("Disconnected",4900);return(await Xf(o,void 0,void 0,this.address)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new sn(`Invalid params for ${r.method}`,4200);let o;if(typeof r.params[0]=="string")o=r.params[0];else if("chainId"in r.params[0]&&typeof r.params[0].chainId=="string")o=r.params[0].chainId;else throw new sn(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=_r(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",o)}async handlePersonalSign(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for personal_sign");let o=r.params[0],n=r.params[1];return await Yf(o,void 0,n)}async handleSignedTypedData(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_signTypedData_v4");let o=r.params[0],n=typeof r.params[1]=="string"?JSON.parse(r.params[1]):r.params[1];return await Qf(Ua(n),void 0,o)}async handleEstimateGas(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_estimateGas");delete r.params[0].gasPrice,delete r.params[0].maxFeePerGas,delete r.params[0].maxPriorityFeePerGas;let o={...r.params[0],chainId:Gn(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch(n){console.warn(`Gas estimation failed with error: ${n}. Retrying gas estimation by omitting the 'from' address`);try{return delete o.from,await this.provider.send("eth_estimateGas",[o])}catch(i){throw console.warn(`Gas estimation failed with error: ${i} when omitting the 'from' address`),n}}}async request(r){switch(console.debug("Embedded1193Provider.request() called with args",r),r.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return Gn(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(r);case"eth_sendTransaction":return this.handleSendTransaction(r);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(r);case"personal_sign":return this.handlePersonalSign(r);case"eth_signTypedData_v4":return this.handleSignedTypedData(r);default:break}if(Kf(r.method)){let o=await we();if(await Zf(),!o||!this.address)throw new sn("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.rootAddress,accessToken:o,hdWalletIndex:this.walletIndex,request:{method:r.method,params:r.params}})).response.data}catch(n){throw console.error(n),new sn("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await we();if(!r||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:r})).address}catch(o){return console.error(o),null}}},vo=class extends $e{constructor(r){super(r,r.rpcTimeoutDuration)}},ln=class extends $e{constructor(t){super(t,t.rpcTimeoutDuration)}sendAsync(t,r){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var PC=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},er=class extends AC{constructor(r,o,n,i){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=Mi(r),this.walletClientType==="privy"&&X.put(nl(o.address),r)}),this.emit("walletsUpdated")};this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")};this.onConnect=()=>{this.connected=!0,this.syncAccounts()};this.wallets=[],this.walletClientType=r,this.chains=o,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=zi(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,i){let a=async()=>!!this.wallets.find(l=>wo(l.address)===wo(r));return{address:wo(r),chainId:o,meta:n,imported:i,switchChain:async l=>{if(!a)throw new _e("Wallet is not currently connected.");let s=this.wallets.find(y=>wo(y.address)===wo(r))?.chainId;if(!s)throw new _e("Unable to determine current chainId.");let d,u;if(typeof l=="number"?(d=`0x${l.toString(16)}`,u=l):(d=l,u=Number(l)),s===Mi(d))return;let m=this.chains.find(y=>y.id===u);if(!m)throw new _e(`Unsupported chainId: ${l}`);let f=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:d}]})};try{return await f()}catch(y){if(PC(y,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:d,chainName:m.name,nativeCurrency:m.nativeCurrency,rpcUrls:[m.rpcUrls.default?.http[0]??""],blockExplorerUrls:[m.blockExplorers?.default.url??""]}]}),f();throw this.walletClientType==="rainbow"&&y.message?.includes("wallet_switchEthereumChain")?new _e(`Rainbow does not support the chainId ${o}`):y}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new _e("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new _e("Wallet is not currently connected.");return new Jf(new vo(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new _e("Wallet is not currently connected.");return new ln(this.proxyProvider)},sign:async l=>{if(!await a())throw new _e("Wallet is not currently connected.");return await this.sign(l)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let d=await Da(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,d),Array.isArray(d)&&(o=d)}}catch(d){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",d)}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],i=wo(n),a=[],l;if(this.walletClientType==="privy"){let d=X.get(nl(i));this.chains.find(u=>u.id===Number(d))||(X.del(nl(i)),d=null),l=d||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:l}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${l} on initialization`)}}else try{let d=await Da(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,d),typeof d=="string")l=d;else if(typeof d=="number")l=`0x${d.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(d){console.warn(`Failed to get chainId from provider, defaulting to ${Qd}`,d),l=Qd}let s=Mi(l);if(!a.find(d=>wo(d.address)===i)){let d={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet(wo(n),s,d,this.connectorType==="embedded_imported"))}Ol(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>wo(n)===wo(o.address)))||null}async isConnected(){let r=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(r)&&r.length>0}async sign(r){return await this.connect({showPrompt:!1}),new Jf(new vo(this.proxyProvider)).getSigner().signMessage(r)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}};var RC=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],jf=(e,t)=>e.makeWeb3Provider({options:t}),Dl,Ul=class extends er{constructor(r,o,n,i,a,l){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.displayName="Coinbase Wallet";if(this.proxyProvider=new $e(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"all",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!Dl){let s=[o.id].concat(r.map(u=>u.id)),d=this.connectionOptions!=="eoaOnly"?s.filter(u=>!RC.includes(u)):[];d.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${d.join(", ")}`),Dl=new xC({appName:a,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(jf(Dl,this.connectionOptions))}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:qo,id:"com.coinbase.wallet"}}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new _e("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw Jr(r)}}updateConnectionPreference(r){this.connectionOptions=r,this.walletClientType=r==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(jf(Dl,this.connectionOptions))}};var Za=class extends er{constructor({provider:r,chains:o,defaultChain:n,rpcConfig:i,imported:a,walletIndex:l}){super("privy",o,n,i);this.connectorType="embedded";this.proxyProvider=r,this.walletIndex=l,a&&(this.connectorType="embedded_imported"),this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[Gn(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Wi,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};import{jsx as $f}from"react/jsx-runtime";var Ki=({style:e,...t})=>$f("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:$f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});import{jsx as mr,jsxs as kC}from"react/jsx-runtime";var Yi=({style:e,...t})=>kC("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[mr("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),mr("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),mr("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),mr("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),mr("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),mr("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),mr("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),mr("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),mr("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),mr("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),mr("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),mr("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),mr("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});import{jsx as eh,jsxs as _C}from"react/jsx-runtime";var bo=({style:e,...t})=>_C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[eh("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),eh("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var Xi=class extends er{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new $e(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l)}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new _e("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Jr(r)}}},Qi,Zi=class extends er{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";Zs(this,Qi,void 0);this.proxyProvider=new $e(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?Hd(this,Qi,{name:"MetaMask",icon:Yi,id:"io.metamask"}):a==="phantom"&&Hd(this,Qi,{name:"Phantom",icon:bo,id:"phantom"})}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return Ku(this,Qi)??{name:"Browser Extension",icon:Ki,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new _e("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Jr(r)}}};Qi=new WeakMap;import{getAddress as qR}from"@ethersproject/address";import{Web3Provider as KR}from"@ethersproject/providers";import{isMobile as MC}from"react-device-detect";var Fl=class extends Xi{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{MC||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new _e("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw Jr(t)}}};var Bl=class extends er{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new $e(void 0,Xn);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw new Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw new Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(r){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${r}`)}};var Hl=class extends Bl{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:bo,id:"phantom"}}};import{EthereumProvider as HC,OPTIONAL_EVENTS as VC,OPTIONAL_METHODS as GC}from"@walletconnect/ethereum-provider";import{isMobile as qC}from"react-device-detect";import{createContext as WC,useContext as LC,useEffect as rp,useRef as NC,useState as OC}from"react";import{jsx as IC}from"react/jsx-runtime";function th({src:e,...t}){return IC("img",{src:e,...t,style:{display:"none"}})}import{jsx as UC,jsxs as FC}from"react/jsx-runtime";var rh=WC({ready:!1,app:Em,currentScreen:null,lastScreen:null,navigate:mt,navigateBack:mt,resetNavigation:mt,setModalData:mt,onUserCloseViaDialogOrKeybindRef:void 0}),DC=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],oh=e=>{let t=Ne(),r=e.authenticated,[o,n]=OC(e.initialScreen);rp(()=>{!r&&!DC.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=NC(null);rp(()=>{e.open||(i.current=null)},[e.open]),rp(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return FC(rh.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&UC(th,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},R=()=>LC(rh);import{jsx as Ji,jsxs as BC}from"react/jsx-runtime";var Ja=({style:e,...t})=>{let{app:r}=R();return BC("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[Ji("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),Ji("g",{clipPath:"url(#clip0_1765_9946)",children:Ji("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),Ji("defs",{children:Ji("clipPath",{id:"clip0_1765_9946",children:Ji("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var jr=class extends er{constructor(r,o,n,i,a,l,s,d){super(d||"unknown",n,i,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.privyAppName=s,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new $e(void 0,this.rpcTimeoutDuration),d&&(this.walletEntry=gl[d],this.walletClientType=d)}async initialize(){let r=await this.createProvider();if(this.provider=r,this.proxyProvider.setWalletProvider(r),this.subscribeListeners(),r.session){if(this.walletProvider?.session?.peer.metadata.url){let n=yl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=n?.entry,this.walletClientType=n?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:o}=await import("@walletconnect/modal");this.modal=new o({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(n=>{!n.open&&!this.walletProvider?.session&&this.onQrModalClosed&&this.onQrModalClosed()})}async connect(r){return r.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return this.walletClientType==="metamask"?{name:"MetaMask",icon:Yi,id:"io.metamask"}:{name:em(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Ja,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(r){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=gl[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,Pf(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new qi)};this.onQrModalClosed=n,(async()=>{let a="",l=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(l?.length&&(a=l[0]),!a||a==="")throw new _e("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=yl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=zi(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(Jr(a));return}o(new _e("Unknown error during connection"))}).finally(()=>this.modal?.closeModal())})}disconnect(){this.walletProvider?.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect Wallet Connect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(r){this.proxyProvider.setWalletProvider(r)}async createProvider(){let r={};for(let a of this.chains){let l=rm(a.id,this.chains,this.rpcConfig,this.privyAppId);l&&(r[a.id]=l)}let o=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(a=>a.id),i=await HC.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:VC,optionalMethods:GC,rpcMap:r,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),qC&&this.walletEntry){let{redirect:l,href:s}=Tf(a,this.walletEntry);xf({href:s,name:this.walletEntry.displayName}),this.redirectUri=l;let d=Sf(a,this.walletEntry);d?.redirect&&(this.fallbackUniversalRedirectUri=d.redirect),Cl(l,"_self")}else this.modal?.openModal({uri:a,chains:[this.defaultChain.id]})}),i.on("connect",()=>{if(this.modal?.closeModal(),i.session?.peer.metadata.url){let a=yl(i.session?.peer.metadata.url);this.walletEntry=a?.entry,this.walletClientType=a?.walletClientType||"unknown"}}),i}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider?.enable()}};var np=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>zC(o)).map(o=>nh(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},zi=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||Xn:Xn,ja=class extends KC{constructor(r,o,n,i,a,l,s,d,u,m,f){super();this.getEthereumProvider=()=>{let r=this.wallets[0],o=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===r?.address));return!r||!o?new $e:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=i,this.defaultChain=a,this.walletConnectors=[],this.initialized=!1,this.store=l,this.walletList=s,this.shouldEnforceDefaultChainOnConnect=d,this.externalWalletConfig=u,this.privyAppName=m,this.privyAppLogo=f,this.storedConnections=op()}get wallets(){let r=new Set,o=this.walletConnectors.flatMap(i=>i.wallets).sort((i,a)=>i.connectedAt&&a.connectedAt?a.connectedAt-i.connectedAt:0).filter(i=>{let a=`${i.address}${i.walletClientType}${i.connectorType}`;return r.has(a)?!1:(r.add(a),!0)}),n=o.findIndex(i=>i.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&o.unshift(o.splice(n,1)[0]),o}async initialize(){if(this.initialized)return;X.get(Kd)&&(X.getKeys().forEach(o=>{o.startsWith("walletconnect")&&X.del(o)}),X.del(Kd));let r=tm(this.store,this.walletList,this.externalWalletConfig).then(o=>{o.forEach(({type:n,eip6963InjectedProvider:i,legacyInjectedProvider:a})=>{this.createWalletConnector("injected",n,{eip6963InjectedProvider:i,legacyInjectedProvider:a})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!on()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),this.externalWalletConfig.walletConnect.enabled&&this.createWalletConnector("wallet_connect_v2","unknown"),await r,this.initialized=!0}findWalletConnector(r,o){return r==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===r)??null:this.walletConnectors.find(n=>n.connectorType===r&&n.walletClientType===o)??null}findEmbeddedWalletConnectors(){return this.walletConnectors.filter(r=>r.connectorType==="embedded")}onInitialized(r){r.wallets.forEach(o=>{let n=this.storedConnections.find(i=>i.address===o.address&&i.connectorType===o.connectorType&&i.walletClientType===o.walletClientType);n&&(o.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(r){r.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnectors({walletProxy:r,rootWallet:o,embeddedWallets:n,defaultChain:i,appId:a}){for(let l of n){let s=this.findEmbeddedWalletConnectors().find(d=>d.walletIndex===l.walletIndex);if(s)s.proxyProvider.walletProxy=r;else{let d=new Xa({walletProxy:r,address:l.address,rootAddress:o.address,rpcConfig:this.rpcConfig,chains:this.chains,appId:a,chainId:i.id,walletIndex:l.walletIndex}),u=new Za({provider:d,chains:this.chains,defaultChain:i,rpcConfig:this.rpcConfig,imported:!1,walletIndex:l.walletIndex});this.addWalletConnector(u)}}}addImportedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded_imported","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new Xa({walletProxy:r,rootAddress:o,address:o,walletIndex:0,rpcConfig:this.rpcConfig,chains:this.chains,appId:i,chainId:n.id}),s=new Za({provider:l,chains:this.chains,walletIndex:0,defaultChain:n,rpcConfig:this.rpcConfig,imported:!0});this.addWalletConnector(s)}}removeEmbeddedWalletConnectors(){this.walletConnectors=this.walletConnectors.filter(r=>r.connectorType!=="embedded"),this.saveConnectionHistory(),this.storedConnections=op(),this.emit("walletsUpdated")}removeImportedWalletConnector(){let r=this.findWalletConnector("embedded_imported","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=op(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof jr&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new Fl(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new Zi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new Zi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new Zi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Xi(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Ul(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new Hl(this.defaultChain):new jr(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,o)})();return l&&this.addWalletConnector(l),l||null}addWalletConnector(r){this.walletConnectors.push(r),r.on("initialized",()=>this.onInitialized(r)),r.on("walletsUpdated",()=>this.onWalletsUpdated(r)),r.initialize().catch(o=>{console.debug("Failed to initialize connector",o)})}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));X.put(Yd,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return n?n.sign(r):null}setActiveWallet(r){this.activeWallet=nh(r),this.emit("walletsUpdated")}};function Ol(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],n=t[r];if(o?.address!==n?.address||o?.chainId!==n?.chainId||o?.connectorType!==n?.connectorType||o?.connectedAt!==n?.connectedAt||o?.walletClientType!==n?.walletClientType||o?.isConnected!==n?.isConnected||o?.linked!==n?.linked)return!1}return!0}var YC=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",op=()=>{let e=X.get(Yd);return e&&Array.isArray(e)&&e.map(o=>YC(o)).every(Boolean)?e:[]};import{ofetch as QC}from"ofetch";var XC=[ll,dl,cl,fl],Vl=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Vd,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=QC.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:i,options:a})=>{let l=new Headers(a.headers);l.set("privy-app-id",this.appId),this.appClientId&&l.set("privy-client-id",this.appClientId),l.set("privy-ca-id",this.clientAnalyticsId||""),l.set("privy-client",`react-auth:${this.sdkVersion}`);let s=XC.includes(i.toString());if(!l.has("authorization")){let d=await this.client.getAccessToken({disableAutoRefresh:s});d!==null&&l.set("authorization",`Bearer ${d}`)}a.headers=l,a.retryDelay&&(a.retryDelay=a.retryDelay*3)},onRequestError:({error:i})=>{if(i instanceof DOMException&&i.name==="AbortError")throw new Qu}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw ie(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw ie(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw ie(o)}}};var ih=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});import cn from"js-cookie";function ah(e){return e instanceof nn?"email":e instanceof an?"sms":e instanceof Go?"siwe":e instanceof Fi?"guest":e instanceof Ui?"custom_auth":e instanceof go?e.meta.provider:null}import{isSafari as ZC}from"react-device-detect";function Gl(){return!(ZC&&window.location.origin.startsWith("http://localhost"))}import*as sh from"jose";var Or=class{static parse(t){try{return new Or(t)}catch{return null}}constructor(t){this.value=t,this._decoded=sh.decodeJwt(t)}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(t=0){let r=Date.now(),o=(this.expiration-t)*1e3;return r>=o}};var JC=30,ql=class{constructor(){this.authenticateOnce=new Je(async t=>this._authenticate(t)),this.linkOnce=new Je(async t=>this._link(t)),this.refreshOnce=new Je(this._refresh.bind(this)),this.destroyOnce=new Je(this._destroy.bind(this)),this.forkSessionOnce=new Je(this._forkSession.bind(this))}get token(){try{let t=X.get(qn);return typeof t=="string"?new Or(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=X.get(tl);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=X.get(Fa);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=X.get(Ha(t));if(typeof r=="string"){let o=new Or(r);return o.isExpired()?(X.del(Ha(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=cn.get(rl);return t!==void 0&&t.length>0}catch(t){console.error(t)}return!1}hasRefreshCredentials(){return this.mightHaveServerCookies||typeof this.token=="string"&&typeof this.refreshToken=="string"&&this.refreshToken!==um}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Or.parse(this.token);return t!==null&&!t.isExpired(JC)}authenticate(t){return this.authenticateOnce.execute(t)}link(t){return this.linkOnce.execute(t)}refresh(){return this.refreshOnce.execute()}forkSession(){return this.forkSessionOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(t,r){typeof r=="string"?X.put(Ha(t),r):X.del(Ha(t))}async _authenticate(t){try{let r=await t.authenticate(),{user:o,is_new_user:n,oauth_tokens:i}=r;this.handleTokenResponse(r);let a=i,l=a?{provider:a.provider,accessToken:a.access_token,accessTokenExpiresInSeconds:a.access_token_expires_in_seconds,refreshToken:a.refresh_token,refreshTokenExpiresInSeconds:i.refresh_token_expires_in_seconds,scopes:a.scopes}:void 0,s=ah(t);return s&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:s,isNewUser:n}}),s==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:Ut(o),isNewUser:n,oAuthTokens:l}}catch(r){throw console.warn("Error authenticating session"),it(r)}}async _link(t){try{let r=await t.link(),o=r.oauth_tokens,n=o?{provider:o.provider,accessToken:o.access_token,accessTokenExpiresInSeconds:o.access_token_expires_in_seconds,refreshToken:o.refresh_token,refreshTokenExpiresInSeconds:o.refresh_token_expires_in_seconds,scopes:o.scopes}:void 0;return{user:Ut(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),it(r)}}async _refresh(){if(!this.api)throw new v("Session has no API instance");if(!this.client)throw new v("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,r=this.refreshToken,o=this.forkedToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let n;if(t&&r||this.mightHaveServerCookies){let i={};t&&(i.authorization=`Bearer ${t}`);let a=r?{refresh_token:r}:{};n=await this.api.post(ll,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(dl,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),Ut(n.user)}catch(n){if(n instanceof kr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw it(n)}}handleTokenResponse(t){t.session_update_action?t.session_update_action==="set"?(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token)):t.session_update_action==="clear"?this.destroyLocalState():t.session_update_action==="ignore"&&t.token&&(this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token)):(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token))}async _destroy(){try{await this.api?.post(cl,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new v("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(Nm,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw it(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=X.get(qn);if(X.put(qn,t),!this.client?.useServerCookies){let o=Or.parse(t)?.expiration;cn.set(Gd,t,{sameSite:"Strict",secure:Gl(),expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else X.del(qn),cn.remove(Gd),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(X.put(tl,t),this.client?.useServerCookies||cn.set(rl,"t",{sameSite:"Strict",secure:Gl(),expires:30})):(X.del(tl),cn.remove(sm),cn.remove(rl))}storeIdentityToken(t){if(this.client?.useServerCookies)return;X.put(qd,t);let r=Or.parse(t)?.expiration;cn.set(zd,t,{sameSite:"Strict",secure:Gl(),expires:r?new Date(r*1e3):void 0})}clearIdentityToken(){X.del(qd),cn.remove(zd)}clearForkedToken(){X.del(Fa)}};var ip,zl,lh,$a=class{constructor(t){Zs(this,zl);this.apiUrl=t.apiUrl||el,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||nm,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=Yu(this,zl,lh).call(this),ip||(ip=new ql),this.session=ip,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:i,walletList:a,shouldEnforceDefaultChainOnConnect:l,externalWalletConfig:s,appName:d}){this.connectors||(this.connectors=new ja(this.appId,t,r,o,n,i,a,l,s,d))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new Vl({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=t,t}updateApiUrl(t){this.apiUrl=t||this.fallbackApiUrl,this.api=this.generateApi(),t&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new v("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new v("No auth flow in progress.");let{oAuthTokens:t}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:t}}storeProviderAccessToken(t,r){this.session.storeProviderAccessToken(t,r)}getProviderAccessToken(t){return this.session.getProviderAccessToken(t)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(t){t.linkedAccounts.filter(o=>o.type==="cross_app").forEach(o=>{this.storeProviderAccessToken(o.providerApp.id,null)})}startAuthFlow(t){return t.api=this.api,this.authFlow=t,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(ff,{action:"verify"})}catch(t){throw ie(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(hf,{});return ih(t.options)}catch(t){throw ie(t)}}async acceptTerms(){try{let t=await this.api.post(yf,{});return Ut(t)}catch(t){throw it(t)}}async unlinkEmail(t){try{let r=await this.api.post(Qm,{address:t});return await this.getAuthenticatedUser()??Ut(r)}catch(r){throw it(r)}}async unlinkPhone(t){try{let r=await this.api.post(jm,{phoneNumber:t});return await this.getAuthenticatedUser()??Ut(r)}catch(r){throw it(r)}}async unlinkWallet(t){try{let r=await this.api.post(Fm,{address:t});return await this.getAuthenticatedUser()??Ut(r)}catch(r){throw it(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(tf,{provider:t,subject:r});return await this.getAuthenticatedUser()??Ut(o)}catch(o){throw it(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(qm,{fid:t});return await this.getAuthenticatedUser()??Ut(r)}catch(r){throw it(r)}}async unlinkTelegram(t){try{let r=await this.api.post(mf,{telegram_user_id:t});return await this.getAuthenticatedUser()??Ut(r)}catch(r){throw it(r)}}async unlinkPasskey(t){try{let r=await this.api.post(df,{credential_id:t});return await this.getAuthenticatedUser()??Ut(r)}catch(r){throw it(r)}}async createAnalyticsEvent({eventName:t,payload:r,timestamp:o,options:n}){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(fl,{event_name:t,client_id:this.clientAnalyticsId,payload:{...r||{},clientTimestamp:o?o.toISOString():new Date().toISOString()}},{retry:-1,keepalive:n?.keepAlive??!1})}catch{}}async signMoonpayOnRampUrl(t){try{return this.api.post(vf,t)}catch(r){throw it(r)}}async initCoinbaseOnRamp(t){try{return this.api.post(wf,t)}catch(r){throw it(r)}}async getCoinbaseOnRampStatus({partnerUserId:t}){try{return this.api.get(`${bf}?partnerUserId=${t}`)}catch(r){throw it(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?this.session.hasRefreshCredentials()?Or.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:(this.session.destroyLocalState(),null):!t?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let t={},r=this.session.token;r&&(t.authorization=`Bearer ${r}`);let o=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:t}),n=o.telegram_auth_config?{botId:o.telegram_auth_config.bot_id,botName:o.telegram_auth_config.bot_name,linkEnabled:o.telegram_auth_config.link_enabled,seamlessAuthEnabled:o.telegram_auth_config.seamless_auth_enabled}:void 0,i=o.funding_config?{methods:o.funding_config.methods,defaultRecommendedAmount:o.funding_config.default_recommended_amount,defaultRecommendedCurrency:o.funding_config.default_recommended_currency,promptFundingOnWalletCreation:o.funding_config.prompt_funding_on_wallet_creation}:void 0;return{id:o.id,name:o.name,verificationKey:o.verification_key,logoUrl:o.logo_url||void 0,accentColor:o.accent_color||void 0,showWalletLoginFirst:o.show_wallet_login_first,allowlistConfig:{errorTitle:o.allowlist_config.error_title,errorDetail:o.allowlist_config.error_detail,errorCtaText:o.allowlist_config.cta_text,errorCtaLink:o.allowlist_config.cta_link},walletAuth:o.wallet_auth,emailAuth:o.email_auth,smsAuth:o.sms_auth,googleOAuth:o.google_oauth,twitterOAuth:o.twitter_oauth,discordOAuth:o.discord_oauth,githubOAuth:o.github_oauth,spotifyOAuth:o.spotify_oauth,instagramOAuth:o.instagram_oauth,tiktokOAuth:o.tiktok_oauth,linkedinOAuth:o.linkedin_oauth,appleOAuth:o.apple_oauth,farcasterAuth:o.farcaster_auth,passkeyAuth:o.passkey_auth,telegramAuth:o.telegram_auth,termsAndConditionsUrl:o.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:o.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:o.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:o.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:o.privacy_policy_url,requireUsersAcceptTerms:o.require_users_accept_terms,customApiUrl:o.custom_api_url,walletConnectCloudProjectId:o.wallet_connect_cloud_project_id,fiatOnRampEnabled:o.fiat_on_ramp_enabled,captchaEnabled:o.captcha_enabled,captchaSiteKey:o.captcha_site_key,createdAt:new Date(o.created_at*1e3),updatedAt:new Date(o.updated_at*1e3),mfaMethods:o.mfa_methods,enforceWalletUis:o.enforce_wallet_uis,legacyWalletUiConfig:o.legacy_wallet_ui_config,telegramAuthConfiguration:n,fundingConfig:i}}catch(t){throw it(t)}}async getUsdTokenPrice(t){try{return(await this.api.get(`/api/v1/token_price?chainId=${t.id}&tokenSymbol=${t.nativeCurrency.symbol}`)).usd}catch{console.error(`Unable to fetch token price for chain with id ${t.id}`);return}}async requestFarcasterSignerStatus(t){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:t})}catch(r){throw console.error("Unable to fetch Farcaster signer status"),r}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:t,captchaToken:r}){try{return(await this.api.post(Om,{address:t,token:r})).nonce}catch(o){throw it(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i,mode:a}){return await this.api.post(Dm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i,mode:a})}async linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(Um,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiwe({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){try{let a=await this.linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i});return Ut(a)}catch(a){throw it(a)}}async setCustomMetadata(t){try{let r=await this.api.post("api/v1/users/custom_metadata",{custom_metadata:t});return await this.getAuthenticatedUser()??Ut(r)}catch(r){throw it(r)}}};zl=new WeakSet,lh=function(){if(typeof window>"u")return null;try{let r=X.get(Ba);if(typeof r=="string"&&r.length>0)return r}catch{}let t=jC();try{return X.put(Ba,t),t}catch{return t}};import{Turnstile as nv}from"@marsidev/react-turnstile";import{useEffect as iv,useMemo as av}from"react";import{useMemo as $C,useRef as ev,useContext as tv,useState as ap,createContext as rv}from"react";import{jsx as ov}from"react/jsx-runtime";var ch=rv({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:mt,setError:mt,setExecuting:mt,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:mt,reset:mt,execute:mt}),fr=class extends Jt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},dh=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=ev(null),[i,a]=ap(),[l,s]=ap(),[d,u]=ap(!1),m=$C(()=>o?!d&&!i&&!l?{status:"ready"}:d&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,i,l,d]);return ov(ch.Provider,{value:{...m,ref:n,enabled:o,siteKey:r,appId:t,setToken:a,setError:s,setExecuting:u,remove(){o&&(n.current?.remove(),u(!1),s(void 0),a(void 0))},reset(){o&&(n.current?.reset(),u(!1),s(void 0),a(void 0))},execute(){o&&(u(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await $u(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new fr("Captcha failed",null,"captcha_timeout")}}},children:e})},Te=()=>tv(ch);import{jsx as ph}from"react/jsx-runtime";var sp=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=Te(),[,s]=av(()=>r?.split("t:")||[],[r]);if(iv(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return ph("div",{className:"hidden h-0 w-0",children:ph(nv,{...e,ref:l,siteKey:s,options:{action:o,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),a(!1)},onSuccess:d=>{e.onSuccess?.(d),i(d),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};import{useCallback as HS,useEffect as x0,useRef as VS,useState as GS}from"react";import _0 from"styled-components";function lp(e){Oe("configureMfa",e)}import Rv from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import Ch from"styled-components";import ti,{css as uh}from"styled-components";import dp from"styled-components";import{Fragment as lv,jsx as cp,jsxs as cv}from"react/jsx-runtime";var st=({success:e,fail:t})=>cv(lv,{children:[cp(lt,{className:e?"success":t?"fail":""}),cp(es,{className:e?"success":t?"fail":""})]}),lt=dp.span`
13
13
  && {
14
14
  width: 82px;
15
15
  height: 82px;
@@ -42,13 +42,13 @@ Resources:
42
42
  border-color: var(--privy-color-error);
43
43
  border-bottom-color: var(--privy-color-error);
44
44
  }
45
- `,Qa=ep(dt)`
45
+ `,es=dp(lt)`
46
46
  && {
47
47
  border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
48
48
  animation: none;
49
49
  opacity: 0.5;
50
50
  }
51
- `,bo=e=>$d($C,{color:e.color||"var(--privy-color-foreground-3)"}),$C=ep(dt)`
51
+ `,Eo=e=>cp(sv,{color:e.color||"var(--privy-color-foreground-3)"}),sv=dp(lt)`
52
52
  && {
53
53
  height: 1rem;
54
54
  width: 1rem;
@@ -58,7 +58,7 @@ Resources:
58
58
  /* Override default Loader to match button transitions */
59
59
  transition: border-color 200ms ease;
60
60
  }
61
- `;import{jsx as or,jsxs as Bl}from"react/jsx-runtime";var Xa=Qn.button`
61
+ `;import{jsx as tr,jsxs as Yl}from"react/jsx-runtime";var ts=ti.button`
62
62
  display: flex;
63
63
  flex-direction: row;
64
64
  align-items: center;
@@ -80,7 +80,7 @@ Resources:
80
80
  && {
81
81
  padding: 12px 16px;
82
82
  }
83
- `,U=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>or(th,{disabled:t||r,...n,children:t?Bl("span",{children:[or(bo,{}),o?or("span",{children:o}):null]}):e}),Vo=({children:e,loading:t,disabled:r,...o})=>or(rv,{disabled:r,...o,children:t?or(bo,{color:"var(--privy-color-foreground-accent)"}):e}),rv=Qn(Xa)`
83
+ `,F=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>tr(mh,{disabled:t||r,...n,children:t?Yl("span",{children:[tr(Eo,{}),o?tr("span",{children:o}):null]}):e}),zo=({children:e,loading:t,disabled:r,...o})=>tr(dv,{disabled:r,...o,children:t?tr(Eo,{color:"var(--privy-color-foreground-accent)"}):e}),dv=ti(ts)`
84
84
  position: relative;
85
85
 
86
86
  && {
@@ -106,7 +106,7 @@ Resources:
106
106
  color: var(--privy-color-foreground-accent);
107
107
  background-color: var(--privy-color-accent-dark);
108
108
  }
109
- `,Fl=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>or(th,{as:"a",disabled:t||r,...n,children:t?Bl("span",{children:[or(bo,{}),o?or("span",{children:o}):null]}):e}),th=Qn(Xa)`
109
+ `,Kl=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>tr(mh,{as:"a",disabled:t||r,...n,children:t?Yl("span",{children:[tr(Eo,{}),o?tr("span",{children:o}):null]}):e}),mh=ti(ts)`
110
110
  position: relative;
111
111
 
112
112
  && {
@@ -132,7 +132,7 @@ Resources:
132
132
  }
133
133
 
134
134
  /* If an anchor tag, :disabled isn't a thing, so manually set state */
135
- ${e=>e.disabled?eh`
135
+ ${e=>e.disabled?uh`
136
136
  &&&,
137
137
  &&&:hover,
138
138
  &&&:active {
@@ -151,7 +151,7 @@ Resources:
151
151
  opacity: 1;
152
152
  animation: fadein 200ms ease;
153
153
  }
154
- `,eo=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>or(ov,{disabled:t||r,...n,children:t?Bl("span",{children:[or(bo,{}),o?or("span",{children:o}):null]}):e}),ov=Qn(Xa)`
154
+ `,$r=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>tr(pv,{disabled:t||r,...n,children:t?Yl("span",{children:[tr(Eo,{}),o?tr("span",{children:o}):null]}):e}),pv=ti(ts)`
155
155
  && {
156
156
  border-width: 1px;
157
157
  border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"};
@@ -180,7 +180,7 @@ Resources:
180
180
  opacity: 1;
181
181
  animation: fadein 200ms ease;
182
182
  }
183
- `,an=Qn.button`
183
+ `,dn=ti.button`
184
184
  && {
185
185
  padding: 12px 16px;
186
186
  font-weight: 500;
@@ -193,7 +193,7 @@ Resources:
193
193
  transition: opacity 200ms ease, background-color 200ms ease, color 200ms ease;
194
194
  user-select: none;
195
195
 
196
- ${e=>e.invisible&&eh`
196
+ ${e=>e.invisible&&uh`
197
197
  pointer-events: none;
198
198
  `}
199
199
 
@@ -211,10 +211,10 @@ Resources:
211
211
  cursor: not-allowed;
212
212
  }
213
213
  }
214
- `,V_=Qn.div`
214
+ `,X_=ti.div`
215
215
  /* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
216
216
  height: 44px;
217
- `,qi=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>Bl(nv,{isSubmitting:o,onClick:t,disabled:r,...n,children:[or("span",{children:e}),or("span",{children:or(bo,{})})]}),nv=Qn.button`
217
+ `,ji=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>Yl(uv,{isSubmitting:o,onClick:t,disabled:r,...n,children:[tr("span",{children:e}),tr("span",{children:tr(Eo,{})})]}),uv=ti.button`
218
218
  && {
219
219
  color: var(--privy-color-accent);
220
220
  font-size: 16px;
@@ -256,7 +256,7 @@ Resources:
256
256
  cursor: not-allowed;
257
257
  }
258
258
  }
259
- `;import iv from"styled-components";var rh=iv.span`
259
+ `;import mv from"styled-components";var fh=mv.span`
260
260
  && {
261
261
  width: 82px;
262
262
  height: 82px;
@@ -268,7 +268,7 @@ Resources:
268
268
  display: inline-block;
269
269
  box-sizing: border-box;
270
270
  }
271
- `;import av from"@heroicons/react/24/outline/ArrowLeftIcon";import sv from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import lv from"@heroicons/react/24/outline/XMarkIcon";import zi from"styled-components";import{jsx as nr,jsxs as oh}from"react/jsx-runtime";var cv=({backFn:e})=>nr("div",{children:nr(tp,{onClick:e,children:nr(av,{height:"16px",width:"16px",strokeWidth:2})})}),dv=({infoFn:e})=>nr("div",{children:nr(uv,{"aria-label":"info",onClick:e,children:nr(sv,{height:"22px",width:"22px",strokeWidth:2})})}),pv=e=>nr("div",{children:nr(tp,{"aria-label":"close modal",onClick:e.onClose,children:nr(lv,{height:"16px",width:"16px",strokeWidth:2})})});var R=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:i}=_(),a=Ve();return oh(mv,{children:[oh(fv,{children:[e&&nr(cv,{backFn:e}),t&&nr(dv,{infoFn:t})]}),o&&nr(yv,{id:"privy-dialog-title",children:o}),nr(hv,{children:!a.render.standalone&&n&&nr(pv,{onClose:r||(()=>i())})})]})},tp=zi.button`
271
+ `;import fv from"@heroicons/react/24/outline/ArrowLeftIcon";import hv from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import yv from"@heroicons/react/24/outline/XMarkIcon";import $i from"styled-components";import{jsx as rr,jsxs as hh}from"react/jsx-runtime";var gv=({backFn:e})=>rr("div",{children:rr(pp,{onClick:e,children:rr(fv,{height:"16px",width:"16px",strokeWidth:2})})}),Cv=({infoFn:e})=>rr("div",{children:rr(wv,{"aria-label":"info",onClick:e,children:rr(hv,{height:"22px",width:"22px",strokeWidth:2})})}),vv=e=>rr("div",{children:rr(pp,{"aria-label":"close modal",onClick:e.onClose,children:rr(yv,{height:"16px",width:"16px",strokeWidth:2})})});var _=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:i}=I(),a=Ne();return hh(bv,{children:[hh(Ev,{children:[e&&rr(gv,{backFn:e}),t&&rr(Cv,{infoFn:t})]}),o&&rr(Sv,{id:"privy-dialog-title",children:o}),rr(Tv,{children:!a.render.standalone&&n&&rr(vv,{onClose:r||(()=>i())})})]})},pp=$i.button`
272
272
  && {
273
273
  cursor: pointer;
274
274
  display: flex;
@@ -287,11 +287,11 @@ Resources:
287
287
  opacity: 1;
288
288
  }
289
289
  }
290
- `,uv=zi(tp)`
290
+ `,wv=$i(pp)`
291
291
  && {
292
292
  background-color: transparent;
293
293
  }
294
- `,mv=zi.div`
294
+ `,bv=$i.div`
295
295
  padding: 16px 0;
296
296
  display: flex;
297
297
  align-items: center;
@@ -303,23 +303,23 @@ Resources:
303
303
  font-weight: 600;
304
304
  color: var(--privy-color-foreground);
305
305
  }
306
- `,fv=zi.div`
306
+ `,Ev=$i.div`
307
307
  flex: 1;
308
308
  align-items: center;
309
309
  display: flex;
310
310
  gap: 8px;
311
- `,hv=zi.div`
311
+ `,Tv=$i.div`
312
312
  flex: 1;
313
313
  display: flex;
314
314
  justify-content: flex-end;
315
- `,yv=zi.div`
315
+ `,Sv=$i.div`
316
316
  overflow: hidden;
317
317
  white-space: nowrap;
318
318
  max-width: 100%;
319
319
  text-overflow: ellipsis;
320
320
  text-align: center;
321
321
  color: var(--privy-color-foreground-2);
322
- `;import gv from"styled-components";var Cv=gv.div`
322
+ `;import Av from"styled-components";var Pv=Av.div`
323
323
  display: flex;
324
324
  flex-direction: column;
325
325
  justify-content: center;
@@ -342,15 +342,15 @@ Resources:
342
342
  left: -19px;
343
343
  top: -19px;
344
344
  }
345
- `,nt=Cv;import sn,{css as vv}from"styled-components";var gr=sn.div`
345
+ `,rt=Pv;import pn,{css as xv}from"styled-components";var hr=pn.div`
346
346
  text-align: left;
347
347
  flex-grow: 1;
348
- `,Hl=sn.div`
348
+ `,Ql=pn.div`
349
349
  display: flex;
350
350
  flex-direction: column;
351
351
  justify-content: flex-end;
352
352
  flex-grow: 1;
353
- `,ir=sn.div`
353
+ `,or=pn.div`
354
354
  display: flex;
355
355
  flex-direction: column;
356
356
  gap: 12px;
@@ -365,13 +365,13 @@ Resources:
365
365
  &::-webkit-scrollbar {
366
366
  display: none;
367
367
  }
368
- `,nh=sn(ir)`
368
+ `,yh=pn(or)`
369
369
  ${e=>{if(e.colorScheme==="light")return"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;";if(e.colorScheme==="dark")return"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;"}}
370
370
 
371
371
  background-repeat: no-repeat;
372
372
  background-size: 100% 32px, 100% 16px;
373
373
  background-attachment: local, scroll;
374
- `,ih=vv`
374
+ `,gh=xv`
375
375
  && {
376
376
  width: 100%;
377
377
  font-size: 16px;
@@ -408,22 +408,22 @@ Resources:
408
408
  max-width: 24px;
409
409
  }
410
410
  }
411
- `,Vl=sn.div`
411
+ `,Xl=pn.div`
412
412
  text-align: center;
413
413
  font-size: 14px;
414
414
  margin-bottom: 24px;
415
- `,xe=sn.button`
416
- ${ih}
417
- `,rp=sn.a`
418
- ${ih}
419
- `,to=sn.div`
415
+ `,Se=pn.button`
416
+ ${gh}
417
+ `,up=pn.a`
418
+ ${gh}
419
+ `,eo=pn.div`
420
420
  width: 100%;
421
421
  height: 100%;
422
422
  min-height: inherit;
423
423
  display: flex;
424
424
  flex-direction: column;
425
425
  ${e=>e.if?"display: none;":""}
426
- `;import{Fragment as Tv,jsx as Xn,jsxs as Za}from"react/jsx-runtime";var sh=()=>{let{navigate:e,app:t}=P();return Za(Tv,{children:[Xn(R,{}),Za(bv,{children:[Xn(nt,{children:Za("div",{children:[Xn(rh,{color:"var(--privy-color-warn-light)"}),Xn(wv,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),Za(Ev,{children:[Xn("h3",{children:"Account not found"}),Za("p",{children:["Please try logging in again or go to ",t.name," to create an account."]})]}),Xn(gr,{}),Xn(U,{onClick:()=>e("LANDING"),children:"Try logging in again"})]})]})},bv=ah.div`
426
+ `;import{Fragment as Mv,jsx as ri,jsxs as rs}from"react/jsx-runtime";var vh=()=>{let{navigate:e,app:t}=R();return rs(Mv,{children:[ri(_,{}),rs(kv,{children:[ri(rt,{children:rs("div",{children:[ri(fh,{color:"var(--privy-color-warn-light)"}),ri(Rv,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),rs(_v,{children:[ri("h3",{children:"Account not found"}),rs("p",{children:["Please try logging in again or go to ",t.name," to create an account."]})]}),ri(hr,{}),ri(F,{onClick:()=>e("LANDING"),children:"Try logging in again"})]})]})},kv=Ch.div`
427
427
  display: flex;
428
428
  flex-direction: column;
429
429
  align-items: center;
@@ -432,11 +432,11 @@ Resources:
432
432
  width: 100%;
433
433
  padding-bottom: 16px;
434
434
  margin-top: 24px;
435
- `,Ev=ah.div`
435
+ `,_v=Ch.div`
436
436
  display: flex;
437
437
  flex-direction: column;
438
438
  gap: 8px;
439
- `;import ch from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import Sv from"@heroicons/react/24/solid/DocumentCheckIcon";import Av from"styled-components";import Ct from"styled-components";var Be=Ct.div`
439
+ `;import bh from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import Iv from"@heroicons/react/24/solid/DocumentCheckIcon";import Wv from"styled-components";import yt from"styled-components";var He=yt.div`
440
440
  display: flex;
441
441
  flex-direction: column;
442
442
  align-items: center;
@@ -444,17 +444,17 @@ Resources:
444
444
  @media (max-width: 440px) {
445
445
  padding: 10px 10px 20px;
446
446
  }
447
- `,fe=Ct.div`
447
+ `,me=yt.div`
448
448
  font-size: 18px;
449
449
  line-height: 30px;
450
450
  text-align: center;
451
451
  font-weight: 600;
452
452
  margin-bottom: 10px;
453
- `,ye=Ct.div`
453
+ `,he=yt.div`
454
454
  font-size: 0.875rem;
455
455
 
456
456
  text-align: center;
457
- `,Fr=Ct.div`
457
+ `,Dr=yt.div`
458
458
  display: flex;
459
459
  flex-direction: column;
460
460
  align-items: center;
@@ -464,7 +464,7 @@ Resources:
464
464
  @media (max-width: 440px) {
465
465
  padding: 10px 10px 20px;
466
466
  }
467
- `,Zn=Ct.div`
467
+ `,oi=yt.div`
468
468
  display: flex;
469
469
  flex-direction: column;
470
470
  align-items: stretch;
@@ -472,7 +472,7 @@ Resources:
472
472
  padding: 1rem 0rem 0rem;
473
473
  flex-grow: 1;
474
474
  width: 100%;
475
- `,ar=Ct.div`
475
+ `,nr=yt.div`
476
476
  width: 25px;
477
477
  display: flex;
478
478
  align-items: center;
@@ -484,19 +484,19 @@ Resources:
484
484
  width: 25px !important;
485
485
  color: var(--privy-color-accent);
486
486
  }
487
- `,sr=Ct.div`
487
+ `,ir=yt.div`
488
488
  display: flex;
489
489
  align-items: center;
490
490
  gap: 10px;
491
491
  font-size: 0.875rem;
492
492
  line-height: 1rem;
493
493
  text-align: left;
494
- `,_t=Ct.div`
494
+ `,Rt=yt.div`
495
495
  display: flex;
496
496
  flex-direction: column;
497
497
  gap: 10px;
498
498
  padding-top: 20px;
499
- `,Gl=Ct.div`
499
+ `,Zl=yt.div`
500
500
  display: flex;
501
501
  flex-direction: column;
502
502
  align-items: stretch;
@@ -504,11 +504,11 @@ Resources:
504
504
  padding: 1rem 0rem 0rem;
505
505
  flex-grow: 1;
506
506
  width: 100%;
507
- `,ql=Ct.div`
507
+ `,Jl=yt.div`
508
508
  display: flex;
509
509
  gap: 5px;
510
510
  width: 100%;
511
- `,zl=Ct.button`
511
+ `,jl=yt.button`
512
512
  && {
513
513
  background-color: transparent;
514
514
  color: var(--privy-color-foreground-3);
@@ -526,7 +526,7 @@ Resources:
526
526
  &&:hover {
527
527
  color: var(--privy-color-error);
528
528
  }
529
- `,Kl=Ct.div`
529
+ `,$l=yt.div`
530
530
  display: flex;
531
531
  align-items: center;
532
532
  gap: 0.5rem;
@@ -536,7 +536,7 @@ Resources:
536
536
  height: 20px !important;
537
537
  width: 20px !important;
538
538
  }
539
- `,Jn=Ct.div`
539
+ `,ni=yt.div`
540
540
  display: flex;
541
541
  align-items: center;
542
542
  gap: 6px;
@@ -550,15 +550,15 @@ Resources:
550
550
  display: flex !important;
551
551
  align-items: flex-end;
552
552
  }
553
- `,Yl=Ct.div`
553
+ `,ec=yt.div`
554
554
  width: 100%;
555
555
  display: flex;
556
556
  justify-content: space-between;
557
- `,lh=Ct.p`
557
+ `,wh=yt.p`
558
558
  text-align: left;
559
559
  width: 100%;
560
560
  color: var(--privy-color-foreground-3) !important;
561
- `,Ja=Ct.button`
561
+ `,os=yt.button`
562
562
  display: flex;
563
563
  flex-direction: row;
564
564
  align-items: center;
@@ -588,7 +588,7 @@ Resources:
588
588
  &:hover {
589
589
  text-decoration: underline;
590
590
  }
591
- `,et=Ct.div`
591
+ `,et=yt.div`
592
592
  display: flex;
593
593
  align-items: center;
594
594
  justify-content: center;
@@ -603,12 +603,12 @@ Resources:
603
603
  width: auto !important;
604
604
  color: white;
605
605
  }
606
- `,Ql=Ct.div`
606
+ `,tc=yt.div`
607
607
  color: var(--privy-color-error);
608
- `;import{Fragment as Rv,jsx as Eo,jsxs as ja}from"react/jsx-runtime";var dh=()=>{let{user:e,logout:t}=V(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:i}=P(),{acceptTerms:a,closePrivyModal:l,createAnalyticsEvent:s}=_(),d=f=>{f?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=d;let m=async f=>{f.preventDefault(),await a(),e&&Ht(e,r?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:u=>{console.error(u),s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:u,screen:"AffirmativeConsentScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return Eo(Pv,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:m,onDecline:d})},Pv=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>ja(Rv,{children:[Eo(R,{closeable:!1}),Eo(Sv,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),Eo(fe,{style:{marginTop:24},children:"One last step"}),Eo(ye,{children:"By signing up, you agree to our terms and privacy policy."}),ja(ir,{style:{marginTop:24},children:[e&&ja(rp,{target:"_blank",href:e,children:["View Terms ",Eo(ch,{style:{marginLeft:"auto"}})]}),t&&ja(rp,{target:"_blank",href:t,children:["View Privacy Policy ",Eo(ch,{style:{marginLeft:"auto"}})]})]}),ja(xv,{style:{marginTop:24},children:[Eo(eo,{onClick:o,children:"No thanks"}),Eo(U,{onClick:r,children:"Accept"})]}),Eo(H,{})]}),xv=Av.div`
608
+ `;import{Fragment as Ov,jsx as To,jsxs as ns}from"react/jsx-runtime";var Eh=()=>{let{user:e,logout:t}=V(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:i}=R(),{acceptTerms:a,closePrivyModal:l,createAnalyticsEvent:s}=I(),d=m=>{m?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=d;let u=async m=>{m.preventDefault(),await a(),e&&bt(e,r?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:f=>{console.error(f),s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:f,screen:"AffirmativeConsentScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return To(Lv,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:u,onDecline:d})},Lv=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>ns(Ov,{children:[To(_,{closeable:!1}),To(Iv,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),To(me,{style:{marginTop:24},children:"One last step"}),To(he,{children:"By signing up, you agree to our terms and privacy policy."}),ns(or,{style:{marginTop:24},children:[e&&ns(up,{target:"_blank",href:e,children:["View Terms ",To(bh,{style:{marginLeft:"auto"}})]}),t&&ns(up,{target:"_blank",href:t,children:["View Privacy Policy ",To(bh,{style:{marginLeft:"auto"}})]})]}),ns(Nv,{style:{marginTop:24},children:[To($r,{onClick:o,children:"No thanks"}),To(F,{onClick:r,children:"Accept"})]}),To(B,{})]}),Nv=Wv.div`
609
609
  display: flex;
610
610
  gap: 10px;
611
- `;import uh from"styled-components";import kv from"styled-components";var Xl=kv.span`
611
+ `;import Sh from"styled-components";import Dv from"styled-components";var rc=Dv.span`
612
612
  && {
613
613
  width: 82px;
614
614
  height: 82px;
@@ -623,7 +623,7 @@ Resources:
623
623
  transition: border-color 800ms;
624
624
  border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
625
625
  }
626
- `;import{jsx as ph}from"react/jsx-runtime";var Zl=({style:e,...t})=>ph("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...t,children:ph("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});import{Fragment as op,jsx as To,jsxs as Jl}from"react/jsx-runtime";var mh=()=>{let{navigate:e,app:t}=P(),r=t?.allowlistConfig.errorTitle||"You don't have access to this app",o=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return Jl(op,{children:[To(R,{}),Jl(_v,{children:[To(nt,{children:Jl("div",{children:[To(Xl,{}),To(Zl,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),Jl(Mv,{children:[typeof r=="string"?To("h3",{children:r}):To(op,{children:r}),typeof o=="string"?To("p",{children:o}):To(op,{children:o})]}),t?.allowlistConfig.errorCtaLink?To(U,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):To(U,{onClick:()=>{e("LANDING")},children:n})]})]})},_v=uh.div`
626
+ `;import{jsx as Th}from"react/jsx-runtime";var oc=({style:e,...t})=>Th("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...t,children:Th("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});import{Fragment as mp,jsx as So,jsxs as nc}from"react/jsx-runtime";var Ah=()=>{let{navigate:e,app:t}=R(),r=t?.allowlistConfig.errorTitle||"You don't have access to this app",o=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return nc(mp,{children:[So(_,{}),nc(Uv,{children:[So(rt,{children:nc("div",{children:[So(rc,{}),So(oc,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),nc(Fv,{children:[typeof r=="string"?So("h3",{children:r}):So(mp,{children:r}),typeof o=="string"?So("p",{children:o}):So(mp,{children:o})]}),t?.allowlistConfig.errorCtaLink?So(F,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):So(F,{onClick:()=>{e("LANDING")},children:n})]})]})},Uv=Sh.div`
627
627
  display: flex;
628
628
  flex-direction: column;
629
629
  align-items: center;
@@ -631,11 +631,11 @@ Resources:
631
631
  gap: 24px;
632
632
  width: 100%;
633
633
  padding-bottom: 16px;
634
- `,Mv=uh.div`
634
+ `,Fv=Sh.div`
635
635
  display: flex;
636
636
  flex-direction: column;
637
637
  gap: 8px;
638
- `;import Lv from"@heroicons/react/20/solid/CheckIcon";import Nv from"@heroicons/react/24/outline/EnvelopeIcon";import Ov from"@heroicons/react/24/outline/PhoneIcon";import{useEffect as ip,useState as es}from"react";import{isMobile as Dv}from"react-device-detect";import $n from"styled-components";import lr from"styled-components";var cr=lr.div`
638
+ `;import Vv from"@heroicons/react/20/solid/CheckIcon";import Gv from"@heroicons/react/24/outline/EnvelopeIcon";import qv from"@heroicons/react/24/outline/PhoneIcon";import{useEffect as hp,useState as as}from"react";import{isMobile as zv}from"react-device-detect";import ai from"styled-components";import ar from"styled-components";var sr=ar.div`
639
639
  display: flex;
640
640
  flex-direction: column;
641
641
  align-items: flex-start;
@@ -643,36 +643,36 @@ Resources:
643
643
  margin-top: auto;
644
644
  gap: 16px;
645
645
  flex-grow: 100;
646
- `,St=lr.div`
646
+ `,Tt=ar.div`
647
647
  display: flex;
648
648
  flex-direction: column;
649
649
  align-items: center;
650
650
  justify-content: center;
651
651
  flex-grow: 1;
652
652
  width: 100%;
653
- `,fh=lr.div`
653
+ `,Ph=ar.div`
654
654
  display: flex;
655
655
  flex-direction: column;
656
656
  align-items: center;
657
657
  width: 100%;
658
- `,Ki=lr(St)`
658
+ `,ea=ar(Tt)`
659
659
  padding: 20px 0;
660
- `,Cr=lr(St)`
660
+ `,yr=ar(Tt)`
661
661
  gap: 16px;
662
- `,ln=lr.div`
662
+ `,un=ar.div`
663
663
  display: flex;
664
664
  flex-direction: column;
665
665
  width: 100%;
666
- `,Ze=lr.div`
666
+ `,je=ar.div`
667
667
  display: flex;
668
668
  flex-direction: column;
669
669
  gap: 8px;
670
- `,zM=lr.div`
670
+ `,jM=ar.div`
671
671
  display: flex;
672
672
  flex-direction: column;
673
673
  justify-content: space-between;
674
674
  height: 100%;
675
- `,hh=lr.div`
675
+ `,xh=ar.div`
676
676
  display: flex;
677
677
  flex-direction: column;
678
678
  justify-content: flex-start;
@@ -695,15 +695,15 @@ Resources:
695
695
  color: var(--privy-color-foreground-3);
696
696
  font-size: 14px;
697
697
  }
698
- `,ie=lr.div`
698
+ `,re=ar.div`
699
699
  height: 16px;
700
- `,ae=lr.div`
700
+ `,oe=ar.div`
701
701
  height: 12px;
702
- `,yh=lr.div`
702
+ `,Rh=ar.div`
703
703
  position: relative;
704
- `,Yi=lr.div`
704
+ `,ta=ar.div`
705
705
  height: ${e=>e.height??"12"}px;
706
- `,gh=lr.div`
706
+ `,kh=ar.div`
707
707
  background-color: var(--privy-color-accent);
708
708
  display: flex;
709
709
  justify-content: center;
@@ -711,9 +711,9 @@ Resources:
711
711
  border-radius: 50%;
712
712
  border-color: white;
713
713
  border-width: 2px !important;
714
- `;import np from"styled-components";import{Fragment as Wv,jsx as $a,jsxs as vh}from"react/jsx-runtime";var jn=({title:e,description:t,children:r,...o})=>$a(Ch,{...o,children:vh(Wv,{children:[$a("h3",{children:e}),typeof t=="string"?$a("p",{children:t}):t,r]})}),So=np(jn)`
714
+ `;import fp from"styled-components";import{Fragment as Hv,jsx as is,jsxs as Mh}from"react/jsx-runtime";var ii=({title:e,description:t,children:r,...o})=>is(_h,{...o,children:Mh(Hv,{children:[is("h3",{children:e}),typeof t=="string"?is("p",{children:t}):t,r]})}),Ao=fp(ii)`
715
715
  margin-bottom: 24px;
716
- `,ve=({title:e,description:t,icon:r,children:o,...n})=>vh(Iv,{...n,children:[r||null,$a("h3",{children:e}),t&&typeof t=="string"?$a("p",{children:t}):t,o]}),Ch=np.div`
716
+ `,Ce=({title:e,description:t,icon:r,children:o,...n})=>Mh(Bv,{...n,children:[r||null,is("h3",{children:e}),t&&typeof t=="string"?is("p",{children:t}):t,o]}),_h=fp.div`
717
717
  display: flex;
718
718
  flex-direction: column;
719
719
  justify-content: flex-start;
@@ -733,7 +733,7 @@ Resources:
733
733
  color: var(--privy-color-foreground-2);
734
734
  font-size: 14px;
735
735
  }
736
- `,Iv=np(Ch)`
736
+ `,Bv=fp(_h)`
737
737
  align-items: center;
738
738
  text-align: center;
739
739
  gap: 16px;
@@ -741,7 +741,7 @@ Resources:
741
741
  h3 {
742
742
  margin-bottom: 24px;
743
743
  }
744
- `;import{Fragment as Kv,jsx as Gt,jsxs as Go}from"react/jsx-runtime";var ap=6,wh=new Array(ap).fill(""),Uv=1400,Fv=30;var Eh=()=>{let{app:e,navigate:t,lastScreen:r,navigateBack:o,setModalData:n,onUserCloseViaDialogOrKeybindRef:i}=P(),{closePrivyModal:a,resendEmailCode:l,resendSmsCode:s,getAuthMeta:d,loginWithCode:m,updateWallets:f,createAnalyticsEvent:u}=_(),{authenticated:g,logout:v,user:C}=V(),[b,A]=es(wh),[k,S]=es(!1),[x,T]=es(null),[M,D]=es(null),[B,K]=es(0);i.current=()=>null;let Q=d()?.email?0:1,L=Ne,X=L-500;ip(()=>{if(B){let Y=setTimeout(()=>{K(B-1)},1e3);return()=>clearTimeout(Y)}},[B]),ip(()=>{if(g&&k&&C){if(e?.legal.requireUsersAcceptTerms&&!C.hasAcceptedTerms){let ne=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},X);return()=>clearTimeout(ne)}if(Ht(C,e?.embeddedWallets?.createOnLogin)){let ne=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:me=>{console.error(me),u({eventName:"embedded_wallet_creation_failure_logout",payload:{error:me,screen:"AwaitingPasswordlessCodeScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},X);return()=>clearTimeout(ne)}else{f();let ne=setTimeout(()=>a({shouldCallAuthOnSuccess:!0,isSuccess:!0}),L);return()=>clearTimeout(ne)}}},[g,k,C]),ip(()=>{if(x&&M===0){let Y=setTimeout(()=>{A(wh),T(null),document.querySelector("input[name=code-0]")?.focus()},Uv);return()=>clearTimeout(Y)}},[x]);let I=Y=>{Y.preventDefault();let ne=Y.currentTarget.value.replace(" ","");if(ne==="")return;if(isNaN(Number(ne))){T("Code should be numeric"),D(1);return}T(null),D(null);let me=Number(Y.currentTarget.name?.charAt(5)),be=[...ne||[""]].slice(0,ap-me),ue=[...b.slice(0,me),...be,...b.slice(me+be.length)];A(ue);let Re=be.length,gt=Math.min(Math.max(me+Re,0),ap-1);isNaN(Number(Y.currentTarget.value))||document.querySelector(`input[name=code-${gt}]`)?.focus(),ue.every(tt=>tt&&!isNaN(+tt))&&(document.querySelector(`input[name=code-${gt}]`)?.blur(),m(ue.join("")).then(()=>S(!0)).catch(le=>{if(le instanceof Mr&&le.privyErrorCode==="invalid_credentials")T("Invalid or expired verification code");else if(le instanceof Mr&&le.privyErrorCode==="cannot_link_more_of_type")T(le.message);else if(le instanceof Mr&&le.privyErrorCode==="max_accounts_reached"){console.error(new mo(le).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else if(le instanceof Mr&&le.privyErrorCode==="user_does_not_exist"){t("ACCOUNT_NOT_FOUND_SCREEN");return}else if(le instanceof Mr&&le.privyErrorCode==="linked_to_another_user"){n({errorModalData:{error:le,previousScreen:r??"AWAITING_PASSWORDLESS_CODE"}}),t("ERROR_SCREEN",!1);return}else T("Issue verifying code");D(0)}))},q=Y=>{M===1&&(T(null),D(null));let ne=[...b.slice(0,Y),"",...b.slice(Y+1)];A(ne),Y>0&&document.querySelector(`input[name=code-${Y-1}]`)?.focus()},Le=Q==0?Gt(Nv,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):Gt(Ov,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),oe=Q==0?Go("p",{children:["Please check ",Gt(bh,{children:d()?.email})," for an email from privy.io and enter your code below."]}):Go("p",{children:["Please check ",Gt(bh,{children:d()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return Go(Kv,{children:[Gt(R,{backFn:()=>o()},"header"),Go(Bv,{children:[Gt(ve,{title:"Enter confirmation code",description:oe,icon:Le}),Go(fh,{children:[Go(Hv,{children:[Gt(Vv,{fail:!!x,success:k,children:Gt("span",{children:x||(k?"Success!":"")})}),Gt("div",{children:b.map((Y,ne)=>Gt("input",{name:`code-${ne}`,type:"text",value:b[ne],onChange:I,onKeyUp:me=>{me.key==="Backspace"&&q(ne)},inputMode:"numeric",autoFocus:ne===0,pattern:"[0-9]",className:`${k?"success":""} ${x?"fail":""}`,autoComplete:Dv?"one-time-code":"off"},ne))})]}),Go(Gv,{children:[Go("span",{children:["Didn't get ",Q==0?"an email":"a message","?"]}),B?Go(zv,{children:[Gt(Lv,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),Gt("span",{children:"Code sent"})]}):Gt(qv,{children:Gt("button",{onClick:async()=>{K(Fv),Q==0?await l():await s()},children:"Resend code"})})]})]})]}),Gt(H,{})]})},Bv=$n.div`
744
+ `;import{Fragment as e4,jsx as Ft,jsxs as Ko}from"react/jsx-runtime";var yp=6,Ih=new Array(yp).fill(""),Kv=1400,Yv=30;var Lh=()=>{let{app:e,navigate:t,lastScreen:r,navigateBack:o,setModalData:n,onUserCloseViaDialogOrKeybindRef:i}=R(),{closePrivyModal:a,resendEmailCode:l,resendSmsCode:s,getAuthMeta:d,loginWithCode:u,updateWallets:m,createAnalyticsEvent:f}=I(),{authenticated:y,logout:b,user:C}=V(),[w,A]=as(Ih),[k,T]=as(!1),[P,S]=as(null),[M,N]=as(null),[H,x]=as(0);i.current=()=>null;let K=d()?.email?0:1,W=Le,Q=W-500;hp(()=>{if(H){let ae=setTimeout(()=>{x(H-1)},1e3);return()=>clearTimeout(ae)}},[H]),hp(()=>{if(y&&k&&C){if(e?.legal.requireUsersAcceptTerms&&!C.hasAcceptedTerms){let se=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},Q);return()=>clearTimeout(se)}if(bt(C,e?.embeddedWallets?.createOnLogin)){let se=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:We=>{console.error(We),f({eventName:"embedded_wallet_creation_failure_logout",payload:{error:We,screen:"AwaitingPasswordlessCodeScreen"}}),b()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},Q);return()=>clearTimeout(se)}else{m();let se=setTimeout(()=>a({shouldCallAuthOnSuccess:!0,isSuccess:!0}),W);return()=>clearTimeout(se)}}},[y,k,C]),hp(()=>{if(P&&M===0){let ae=setTimeout(()=>{A(Ih),S(null),document.querySelector("input[name=code-0]")?.focus()},Kv);return()=>clearTimeout(ae)}},[P]);let pe=ae=>{ae.preventDefault();let se=ae.currentTarget.value.replace(" ","");if(se==="")return;if(isNaN(Number(se))){S("Code should be numeric"),N(1);return}S(null),N(null);let We=Number(ae.currentTarget.name?.charAt(5)),Ee=[...se||[""]].slice(0,yp-We),ge=[...w.slice(0,We),...Ee,...w.slice(We+Ee.length)];A(ge);let le=Ee.length,Ze=Math.min(Math.max(We+le,0),yp-1);isNaN(Number(ae.currentTarget.value))||document.querySelector(`input[name=code-${Ze}]`)?.focus(),ge.every(at=>at&&!isNaN(+at))&&(document.querySelector(`input[name=code-${Ze}]`)?.blur(),u(ge.join("")).then(()=>T(!0)).catch(ce=>{if(ce instanceof kr&&ce.privyErrorCode==="invalid_credentials")S("Invalid or expired verification code");else if(ce instanceof kr&&ce.privyErrorCode==="cannot_link_more_of_type")S(ce.message);else if(ce instanceof kr&&ce.privyErrorCode==="max_accounts_reached"){console.error(new fo(ce).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else if(ce instanceof kr&&ce.privyErrorCode==="user_does_not_exist"){t("ACCOUNT_NOT_FOUND_SCREEN");return}else if(ce instanceof kr&&ce.privyErrorCode==="linked_to_another_user"){n({errorModalData:{error:ce,previousScreen:r??"AWAITING_PASSWORDLESS_CODE"}}),t("ERROR_SCREEN",!1);return}else S("Issue verifying code");N(0)}))},q=ae=>{M===1&&(S(null),N(null));let se=[...w.slice(0,ae),"",...w.slice(ae+1)];A(se),ae>0&&document.querySelector(`input[name=code-${ae-1}]`)?.focus()},ue=K==0?Ft(Gv,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):Ft(qv,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),Z=K==0?Ko("p",{children:["Please check ",Ft(Wh,{children:d()?.email})," for an email from privy.io and enter your code below."]}):Ko("p",{children:["Please check ",Ft(Wh,{children:d()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return Ko(e4,{children:[Ft(_,{backFn:()=>o()},"header"),Ko(Qv,{children:[Ft(Ce,{title:"Enter confirmation code",description:Z,icon:ue}),Ko(Ph,{children:[Ko(Xv,{children:[Ft(Zv,{fail:!!P,success:k,children:Ft("span",{children:P||(k?"Success!":"")})}),Ft("div",{children:w.map((ae,se)=>Ft("input",{name:`code-${se}`,type:"text",value:w[se],onChange:pe,onKeyUp:We=>{We.key==="Backspace"&&q(se)},inputMode:"numeric",autoFocus:se===0,pattern:"[0-9]",className:`${k?"success":""} ${P?"fail":""}`,autoComplete:zv?"one-time-code":"off"},se))})]}),Ko(Jv,{children:[Ko("span",{children:["Didn't get ",K==0?"an email":"a message","?"]}),H?Ko($v,{children:[Ft(Vv,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),Ft("span",{children:"Code sent"})]}):Ft(jv,{children:Ft("button",{onClick:async()=>{x(Yv),K==0?await l():await s()},children:"Resend code"})})]})]})]}),Ft(B,{})]})},Qv=ai.div`
745
745
  display: flex;
746
746
  flex-direction: column;
747
747
  align-items: flex-start;
@@ -749,7 +749,7 @@ Resources:
749
749
  margin: auto;
750
750
  gap: 16px;
751
751
  flex-grow: 1;
752
- `,Hv=$n.div`
752
+ `,Xv=ai.div`
753
753
  display: flex;
754
754
  flex-direction: column;
755
755
  width: 100%;
@@ -806,7 +806,7 @@ Resources:
806
806
  transform: translate(1px, 0px);
807
807
  }
808
808
  }
809
- `,Vv=$n.div`
809
+ `,Zv=ai.div`
810
810
  line-height: 20px;
811
811
  height: 20px;
812
812
  font-size: 13px;
@@ -814,7 +814,7 @@ Resources:
814
814
  display: flex;
815
815
  justify-content: flex-end;
816
816
  width: 100%;
817
- `,Gv=$n.div`
817
+ `,Jv=ai.div`
818
818
  font-size: 13px;
819
819
  color: var(--privy-color-foreground);
820
820
  display: flex;
@@ -825,13 +825,13 @@ Resources:
825
825
  // Equal opposing size buffer to account for auto margining when the
826
826
  // success/fail text does not show up
827
827
  padding-bottom: 32px;
828
- `,qv=$n.div`
828
+ `,jv=ai.div`
829
829
  color: var(--privy-color-accent);
830
830
  padding: 2px 0;
831
831
  > button {
832
832
  text-decoration: underline;
833
833
  }
834
- `,zv=$n.div`
834
+ `,$v=ai.div`
835
835
  display: flex;
836
836
  align-items: center;
837
837
  justify-content: center;
@@ -840,10 +840,10 @@ Resources:
840
840
  gap: 4px;
841
841
  background: var(--privy-color-background-2);
842
842
  color: var(--privy-color-foreground-2);
843
- `,bh=$n.span`
843
+ `,Wh=ai.span`
844
844
  font-weight: 500;
845
845
  word-break: break-all;
846
- `;import Jv from"@heroicons/react/24/solid/CheckCircleIcon";import jv from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as sp,useRef as $v,useState as Xi}from"react";import e4 from"styled-components";import Yv from"styled-components";import{Fragment as Zv,jsx as Qi,jsxs as Xv}from"react/jsx-runtime";var Th=({icon:e})=>{let t=e;return Qi(Zv,{children:Qi(Qv,{children:Xv("div",{children:[Qi(ct,{}),typeof t=="string"?Qi("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?Qi(t,{style:{width:"38px",height:"38px"}}):Qi("span",{})]})})})},Qv=Yv.div`
846
+ `;import i4 from"@heroicons/react/24/solid/CheckCircleIcon";import a4 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as gp,useRef as s4,useState as oa}from"react";import l4 from"styled-components";import t4 from"styled-components";import{Fragment as n4,jsx as ra,jsxs as o4}from"react/jsx-runtime";var Nh=({icon:e})=>{let t=e;return ra(n4,{children:ra(r4,{children:o4("div",{children:[ra(st,{}),typeof t=="string"?ra("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?ra(t,{style:{width:"38px",height:"38px"}}):ra("span",{})]})})})},r4=t4.div`
847
847
  display: flex;
848
848
  flex-direction: column;
849
849
  justify-content: center;
@@ -866,14 +866,14 @@ Resources:
866
866
  left: -19px;
867
867
  top: -19px;
868
868
  }
869
- `;import{Fragment as r4,jsx as ro,jsxs as lp}from"react/jsx-runtime";var Ah=500,Sh=Ah*2,Ph=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:i}=P(),{status:a,token:l,waitForResult:s,reset:d,execute:m}=Pe(),f=$v([]),u=X=>{f.current=[X,...f.current]},[g,v]=Xi(!0);sp(()=>{let X=setTimeout(v,Sh,!1);return u(X),()=>{f.current.forEach(I=>clearTimeout(I)),f.current=[]}},[]);let[C,b]=Xi(""),[A,k]=Xi("Checking that you are a human..."),[S,x]=Xi(ro(U,{onClick:()=>{},disabled:!0,children:"Continue"})),[T,M]=Xi(!1),[D,B]=Xi(3),K=r?.captchaModalData,Q=async X=>{try{await K?.callback(X),K?.onSuccessNavigateTo&&n(K?.onSuccessNavigateTo,!1)}catch(I){if(I instanceof yr)return;{let q={error:I,previousScreen:e||"LANDING"};i({errorModalData:q}),n(K?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};sp(()=>{if(a==="success"){let X=setTimeout(async()=>{let I=await s();!I||K?.userIntentRequired||Q(I)},Sh);u(X)}else if(a==="ready"){let X=setTimeout(()=>{a==="ready"&&m()},Ah);u(X)}},[a]),sp(()=>{if(!g)switch(a){case"success":b("Success!"),k("CAPTCHA passed successfully."),x(ro(U,{onClick:()=>{M(!0),Q(l)},disabled:!K?.userIntentRequired,loading:T,children:K?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":b(""),k("Checking that you are a human..."),x(ro(U,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":b("Something went wrong"),D<=0?(k("If you use an adblocker or VPN, try disabling and re-attempting."),x(null)):(k("You did not pass CAPTCHA. Please try again."),x(ro(U,{onClick:L,children:"Retry"})));break;case"ready":default:break}},[a,g,T]);let L=async()=>{if(D<=0)return;B(I=>I-1),d(),m();let X=await s();!X||K?.userIntentRequired||Q(X)};return lp(r4,{children:[ro(R,{backFn:!e||t===e?void 0:o}),lp(t4,{children:[a==="success"?ro(Jv,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?ro(jv,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):ro(Th,{}),lp(Ze,{children:[C?ro("h3",{children:C}):null,ro("p",{children:A})]}),S]}),ro(J,{})]})},t4=e4.div`
869
+ `;import{Fragment as d4,jsx as to,jsxs as Cp}from"react/jsx-runtime";var Dh=500,Oh=Dh*2,Uh=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:i}=R(),{status:a,token:l,waitForResult:s,reset:d,execute:u}=Te(),m=s4([]),f=Q=>{m.current=[Q,...m.current]},[y,b]=oa(!0);gp(()=>{let Q=setTimeout(b,Oh,!1);return f(Q),()=>{m.current.forEach(pe=>clearTimeout(pe)),m.current=[]}},[]);let[C,w]=oa(""),[A,k]=oa("Checking that you are a human..."),[T,P]=oa(to(F,{onClick:()=>{},disabled:!0,children:"Continue"})),[S,M]=oa(!1),[N,H]=oa(3),x=r?.captchaModalData,K=async Q=>{try{await x?.callback(Q),x?.onSuccessNavigateTo&&n(x?.onSuccessNavigateTo,!1)}catch(pe){if(pe instanceof fr)return;{let q={error:pe,previousScreen:e||"LANDING"};i({errorModalData:q}),n(x?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};gp(()=>{if(a==="success"){let Q=setTimeout(async()=>{let pe=await s();!pe||x?.userIntentRequired||K(pe)},Oh);f(Q)}else if(a==="ready"){let Q=setTimeout(()=>{a==="ready"&&u()},Dh);f(Q)}},[a]),gp(()=>{if(!y)switch(a){case"success":w("Success!"),k("CAPTCHA passed successfully."),P(to(F,{onClick:()=>{M(!0),K(l)},disabled:!x?.userIntentRequired,loading:S,children:x?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":w(""),k("Checking that you are a human..."),P(to(F,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":w("Something went wrong"),N<=0?(k("If you use an adblocker or VPN, try disabling and re-attempting."),P(null)):(k("You did not pass CAPTCHA. Please try again."),P(to(F,{onClick:W,children:"Retry"})));break;case"ready":default:break}},[a,y,S]);let W=async()=>{if(N<=0)return;H(pe=>pe-1),d(),u();let Q=await s();!Q||x?.userIntentRequired||K(Q)};return Cp(d4,{children:[to(_,{backFn:!e||t===e?void 0:o}),Cp(c4,{children:[a==="success"?to(i4,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?to(a4,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):to(Nh,{}),Cp(je,{children:[C?to("h3",{children:C}):null,to("p",{children:A})]}),T]}),to(J,{})]})},c4=l4.div`
870
870
  display: flex;
871
871
  flex-direction: column;
872
872
  align-items: center;
873
873
  justify-content: center;
874
874
  gap: 24px;
875
875
  width: 100%;
876
- `;import{isMobile as Dh}from"react-device-detect";import Uh from"styled-components";import o4 from"@heroicons/react/24/outline/WalletIcon";import{jsx as cp}from"react/jsx-runtime";var jl=({icon:e,name:t})=>typeof e=="string"?cp("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?cp(o4,{}):e?cp(e,{}):null;import{jsx as oo,jsxs as xh}from"react/jsx-runtime";var Rh=({...e})=>xh("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[oo("defs",{children:xh("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[oo("stop",{offset:"0",stopColor:"#f1562b"}),oo("stop",{offset:"0.3",stopColor:"#f1542b"}),oo("stop",{offset:"0.41",stopColor:"#f04d2a"}),oo("stop",{offset:"0.49",stopColor:"#ef4229"}),oo("stop",{offset:"0.5",stopColor:"#ef4029"}),oo("stop",{offset:"0.56",stopColor:"#e83e28"}),oo("stop",{offset:"0.67",stopColor:"#e13c26"}),oo("stop",{offset:"1",stopColor:"#df3c26"})]})}),oo("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),oo("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});import{jsx as no,jsxs as ts}from"react/jsx-runtime";var kh=({style:e,...t})=>ts("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[no("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),no("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:no("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),ts("g",{mask:"url(#mask0_16909_31415)",children:[no("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),no("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),no("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),no("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),ts("defs",{children:[ts("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[no("stop",{stopColor:"#002D72"}),no("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),ts("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[no("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),no("stop",{offset:"1",stopColor:"#002D72"})]})]})]});import{jsx as vr,jsxs as Zi}from"react/jsx-runtime";var _h=e=>Zi("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[vr("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),vr("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),vr("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),vr("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),vr("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),Zi("defs",{children:[Zi("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"white"}),vr("stop",{offset:"1",stopColor:"white"})]}),Zi("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"#8697FF"}),vr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),Zi("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"#8697FF"}),vr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),Zi("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"white"}),vr("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});import{jsx as he,jsxs as wr}from"react/jsx-runtime";var Mh=({style:e,...t})=>wr("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[he("g",{clipPath:"url(#clip0_5_32)",children:wr("g",{clipPath:"url(#clip1_5_32)",children:[he("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:he("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),he("g",{mask:"url(#mask0_5_32)",children:he("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),he("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),he("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),he("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),he("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),he("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),he("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),he("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),he("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),he("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),wr("defs",{children:[wr("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[he("stop",{stopColor:"#174299"}),he("stop",{offset:"1",stopColor:"#001E59"})]}),wr("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[he("stop",{offset:"0.770277",stopColor:"#FF4000"}),he("stop",{offset:"1",stopColor:"#8754C9"})]}),wr("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[he("stop",{stopColor:"#FF4000"}),he("stop",{offset:"1",stopColor:"#8754C9"})]}),wr("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[he("stop",{stopColor:"#8754C9"}),he("stop",{offset:"1",stopColor:"#FF4000"})]}),wr("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[he("stop",{offset:"0.723929",stopColor:"#FFF700"}),he("stop",{offset:"1",stopColor:"#FF9901"})]}),wr("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[he("stop",{stopColor:"#FFF700"}),he("stop",{offset:"1",stopColor:"#FF9901"})]}),wr("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[he("stop",{stopColor:"#FFF700"}),he("stop",{offset:"1",stopColor:"#FF9901"})]}),wr("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[he("stop",{offset:"0.59513",stopColor:"#00AAFF"}),he("stop",{offset:"1",stopColor:"#01DA40"})]}),wr("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[he("stop",{stopColor:"#00AAFF"}),he("stop",{offset:"1",stopColor:"#01DA40"})]}),wr("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[he("stop",{stopColor:"#00AAFF"}),he("stop",{offset:"1",stopColor:"#01DA40"})]}),he("clipPath",{id:"clip0_5_32",children:he("rect",{width:"120",height:"120",fill:"white"})}),he("clipPath",{id:"clip1_5_32",children:he("rect",{width:"120",height:"120",fill:"white"})})]})]});import{jsx as $l,jsxs as n4}from"react/jsx-runtime";var Ih=({style:e,...t})=>n4("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[$l("rect",{width:"28",height:"28",rx:"3",fill:"#12FF80"}),$l("path",{d:"M22.5151 13.9979H20.4244C19.7981 13.9979 19.2945 14.5058 19.2945 15.128V18.163C19.2945 18.7894 18.7866 19.2931 18.1645 19.2931H9.8398C9.21344 19.2931 8.70981 19.8011 8.70981 20.4233V22.5185C8.70981 23.145 9.21767 23.6487 9.8398 23.6487H18.6427C19.2691 23.6487 19.7642 23.1407 19.7642 22.5185V20.8423C19.7642 20.2159 20.2721 19.7757 20.8942 19.7757H22.5151C23.1415 19.7757 23.6451 19.2677 23.6451 18.6455V15.1196C23.6451 14.4889 23.1373 13.9979 22.5151 13.9979Z",fill:"black"}),$l("path",{d:"M8.7098 9.84127C8.7098 9.21481 9.21766 8.71111 9.83978 8.71111H18.156C18.7823 8.71111 19.286 8.20317 19.286 7.58095V5.48995C19.286 4.86349 18.7781 4.35979 18.156 4.35979H9.35732C8.73096 4.35979 8.22733 4.86772 8.22733 5.48995V7.10264C8.22733 7.7291 7.71947 8.2328 7.09734 8.2328H5.48912C4.86276 8.2328 4.35913 8.74074 4.35913 9.36296V12.8931C4.35913 13.5196 4.86699 13.9979 5.49335 13.9979H7.58404C8.2104 13.9979 8.71403 13.4899 8.71403 12.8677L8.7098 9.84127Z",fill:"black"}),$l("path",{d:"M13.0139 11.8011H15.0242C15.6802 11.8011 16.2092 12.3344 16.2092 12.9862V14.9968C16.2092 15.6529 15.6759 16.182 15.0242 16.182H13.0139C12.3579 16.182 11.8289 15.6487 11.8289 14.9968V12.9862C11.8289 12.3302 12.3621 11.8011 13.0139 11.8011Z",fill:"black"})]});import{jsx as Ao,jsxs as Wh}from"react/jsx-runtime";var Lh=({style:e,...t})=>Wh("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[Ao("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),Wh("g",{children:[Ao("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),Ao("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),Ao("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),Ao("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),Ao("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),Ao("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),Ao("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),Ao("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),Ao("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});import{jsx as rs,jsxs as Nh}from"react/jsx-runtime";var Oh=({style:e,...t})=>Nh("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[Nh("g",{clipPath:"url(#clip0_1704_1423)",children:[rs("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),rs("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),rs("defs",{children:rs("clipPath",{id:"clip0_1704_1423",children:rs("rect",{width:"176",height:"176",fill:"white"})})})]});var Br={coinbase_wallet:{logo:Ho,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:Ho,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Fi,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:wo,displayName:"Phantom"},rainbow:{logo:Mh,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:za,displayName:"WalletConnect"},zerion:{logo:Oh,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:Rh,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:kh,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:Lh,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:_h,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:Ih}},cn=(e,t,r)=>{if(Br[e]?.displayName)return e==="coinbase_wallet"?Br[r].displayName:Br[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},ec=(e,t,r)=>{if(Br[e]?.logo)return e==="coinbase_wallet"?Br[r].logo:Br[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return za};function Ji(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}import{jsx as tc,jsxs as s4}from"react/jsx-runtime";var ei=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=P(),{connectWallet:a}=_(),l=Rt(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,d=window.matchMedia("(display-mode: standalone)").matches,m;return n.connectorType==="phantom"?m=()=>{$o()?(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(Dh?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&Dh&&!d&&!Ks()?m=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:m=()=>{Ji(window.navigator.userAgent)&&!event?.isTrusted||(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},s4(i4,{onClick:m,children:[tc(jl,{icon:ec(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),tc("span",{children:cn(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),l?.walletClientType===s?tc(a4,{color:"gray",children:"Recent"}):tc("span",{id:"connect-text",children:"Connect"})]})},i4=Uh(xe)`
876
+ `;import{isMobile as Xh}from"react-device-detect";import Zh from"styled-components";import p4 from"@heroicons/react/24/outline/WalletIcon";import{jsx as vp}from"react/jsx-runtime";var ic=({icon:e,name:t})=>typeof e=="string"?vp("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?vp(p4,{}):e?vp(e,{}):null;import{jsx as ro,jsxs as Fh}from"react/jsx-runtime";var Bh=({...e})=>Fh("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[ro("defs",{children:Fh("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[ro("stop",{offset:"0",stopColor:"#f1562b"}),ro("stop",{offset:"0.3",stopColor:"#f1542b"}),ro("stop",{offset:"0.41",stopColor:"#f04d2a"}),ro("stop",{offset:"0.49",stopColor:"#ef4229"}),ro("stop",{offset:"0.5",stopColor:"#ef4029"}),ro("stop",{offset:"0.56",stopColor:"#e83e28"}),ro("stop",{offset:"0.67",stopColor:"#e13c26"}),ro("stop",{offset:"1",stopColor:"#df3c26"})]})}),ro("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),ro("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});import{jsx as oo,jsxs as ss}from"react/jsx-runtime";var Hh=({style:e,...t})=>ss("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[oo("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),oo("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:oo("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),ss("g",{mask:"url(#mask0_16909_31415)",children:[oo("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),oo("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),oo("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),oo("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),ss("defs",{children:[ss("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[oo("stop",{stopColor:"#002D72"}),oo("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),ss("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[oo("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),oo("stop",{offset:"1",stopColor:"#002D72"})]})]})]});import{jsx as gr,jsxs as na}from"react/jsx-runtime";var Vh=e=>na("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[gr("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),gr("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),gr("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),gr("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),gr("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),na("defs",{children:[na("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[gr("stop",{stopColor:"white"}),gr("stop",{offset:"1",stopColor:"white"})]}),na("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[gr("stop",{stopColor:"#8697FF"}),gr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),na("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[gr("stop",{stopColor:"#8697FF"}),gr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),na("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[gr("stop",{stopColor:"white"}),gr("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});import{jsx as fe,jsxs as Cr}from"react/jsx-runtime";var Gh=({style:e,...t})=>Cr("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[fe("g",{clipPath:"url(#clip0_5_32)",children:Cr("g",{clipPath:"url(#clip1_5_32)",children:[fe("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:fe("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),fe("g",{mask:"url(#mask0_5_32)",children:fe("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),fe("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),fe("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),fe("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),fe("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),fe("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),fe("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),fe("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),fe("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),fe("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),Cr("defs",{children:[Cr("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[fe("stop",{stopColor:"#174299"}),fe("stop",{offset:"1",stopColor:"#001E59"})]}),Cr("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[fe("stop",{offset:"0.770277",stopColor:"#FF4000"}),fe("stop",{offset:"1",stopColor:"#8754C9"})]}),Cr("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[fe("stop",{stopColor:"#FF4000"}),fe("stop",{offset:"1",stopColor:"#8754C9"})]}),Cr("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[fe("stop",{stopColor:"#8754C9"}),fe("stop",{offset:"1",stopColor:"#FF4000"})]}),Cr("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[fe("stop",{offset:"0.723929",stopColor:"#FFF700"}),fe("stop",{offset:"1",stopColor:"#FF9901"})]}),Cr("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[fe("stop",{stopColor:"#FFF700"}),fe("stop",{offset:"1",stopColor:"#FF9901"})]}),Cr("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[fe("stop",{stopColor:"#FFF700"}),fe("stop",{offset:"1",stopColor:"#FF9901"})]}),Cr("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[fe("stop",{offset:"0.59513",stopColor:"#00AAFF"}),fe("stop",{offset:"1",stopColor:"#01DA40"})]}),Cr("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[fe("stop",{stopColor:"#00AAFF"}),fe("stop",{offset:"1",stopColor:"#01DA40"})]}),Cr("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[fe("stop",{stopColor:"#00AAFF"}),fe("stop",{offset:"1",stopColor:"#01DA40"})]}),fe("clipPath",{id:"clip0_5_32",children:fe("rect",{width:"120",height:"120",fill:"white"})}),fe("clipPath",{id:"clip1_5_32",children:fe("rect",{width:"120",height:"120",fill:"white"})})]})]});import{jsx as ac,jsxs as u4}from"react/jsx-runtime";var qh=({style:e,...t})=>u4("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[ac("rect",{width:"28",height:"28",rx:"3",fill:"#12FF80"}),ac("path",{d:"M22.5151 13.9979H20.4244C19.7981 13.9979 19.2945 14.5058 19.2945 15.128V18.163C19.2945 18.7894 18.7866 19.2931 18.1645 19.2931H9.8398C9.21344 19.2931 8.70981 19.8011 8.70981 20.4233V22.5185C8.70981 23.145 9.21767 23.6487 9.8398 23.6487H18.6427C19.2691 23.6487 19.7642 23.1407 19.7642 22.5185V20.8423C19.7642 20.2159 20.2721 19.7757 20.8942 19.7757H22.5151C23.1415 19.7757 23.6451 19.2677 23.6451 18.6455V15.1196C23.6451 14.4889 23.1373 13.9979 22.5151 13.9979Z",fill:"black"}),ac("path",{d:"M8.7098 9.84127C8.7098 9.21481 9.21766 8.71111 9.83978 8.71111H18.156C18.7823 8.71111 19.286 8.20317 19.286 7.58095V5.48995C19.286 4.86349 18.7781 4.35979 18.156 4.35979H9.35732C8.73096 4.35979 8.22733 4.86772 8.22733 5.48995V7.10264C8.22733 7.7291 7.71947 8.2328 7.09734 8.2328H5.48912C4.86276 8.2328 4.35913 8.74074 4.35913 9.36296V12.8931C4.35913 13.5196 4.86699 13.9979 5.49335 13.9979H7.58404C8.2104 13.9979 8.71403 13.4899 8.71403 12.8677L8.7098 9.84127Z",fill:"black"}),ac("path",{d:"M13.0139 11.8011H15.0242C15.6802 11.8011 16.2092 12.3344 16.2092 12.9862V14.9968C16.2092 15.6529 15.6759 16.182 15.0242 16.182H13.0139C12.3579 16.182 11.8289 15.6487 11.8289 14.9968V12.9862C11.8289 12.3302 12.3621 11.8011 13.0139 11.8011Z",fill:"black"})]});import{jsx as Po,jsxs as zh}from"react/jsx-runtime";var Kh=({style:e,...t})=>zh("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[Po("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),zh("g",{children:[Po("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),Po("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),Po("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),Po("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),Po("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),Po("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),Po("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),Po("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),Po("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});import{jsx as ls,jsxs as Yh}from"react/jsx-runtime";var Qh=({style:e,...t})=>Yh("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[Yh("g",{clipPath:"url(#clip0_1704_1423)",children:[ls("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),ls("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),ls("defs",{children:ls("clipPath",{id:"clip0_1704_1423",children:ls("rect",{width:"176",height:"176",fill:"white"})})})]});var Ur={coinbase_wallet:{logo:qo,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:qo,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Yi,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:bo,displayName:"Phantom"},rainbow:{logo:Gh,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Ja,displayName:"WalletConnect"},zerion:{logo:Qh,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:Bh,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:Hh,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:Kh,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:Vh,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:qh}},mn=(e,t,r)=>{if(Ur[e]?.displayName)return e==="coinbase_wallet"?Ur[r].displayName:Ur[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},sc=(e,t,r)=>{if(Ur[e]?.logo)return e==="coinbase_wallet"?Ur[r].logo:Ur[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Ja};function ia(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}import{jsx as lc,jsxs as h4}from"react/jsx-runtime";var si=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=R(),{connectWallet:a}=I(),l=Pt(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,d=window.matchMedia("(display-mode: standalone)").matches,u;return n.connectorType==="phantom"?u=()=>{on()?(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(Xh?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&Xh&&!d&&!Js()?u=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:u=()=>{ia(window.navigator.userAgent)&&!event?.isTrusted||(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},h4(m4,{onClick:u,children:[lc(ic,{icon:sc(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),lc("span",{children:mn(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),l?.walletClientType===s?lc(f4,{color:"gray",children:"Recent"}):lc("span",{id:"connect-text",children:"Connect"})]})},m4=Zh(Se)`
877
877
  /* Show "Connect" on hover */
878
878
  > #connect-text {
879
879
  font-weight: 500;
@@ -895,16 +895,16 @@ Resources:
895
895
  display: none;
896
896
  }
897
897
  }
898
- `,a4=Uh(er)`
898
+ `,f4=Zh(jt)`
899
899
  margin-left: auto;
900
- `;import{Fragment as u4,jsx as ji,jsxs as m4}from"react/jsx-runtime";var l4=["coinbase_wallet"],c4=["metamask","okx_wallet","rainbow","uniswap","uniswap_extension","zerion","rabby_wallet","cryptocom"],d4=["safe"],p4=["phantom"],$i=({connectOnly:e})=>{let{connectors:t}=_(),{app:r}=P(),o=dn(r.appearance.walletList,t,e,r.appearance.walletList,r.externalWallets.walletConnect.enabled);return m4(u4,{children:[...o]})},dn=(e,t,r,o,n)=>{let i=[],a=[],l=[],s=t.find(d=>d.connectorType==="wallet_connect_v2");for(let d of e)if(d==="detected_wallets"){let m=t.filter(({connectorType:f,walletClientType:u})=>u==="uniswap_wallet_extension"||u==="uniswap_extension"?!o.includes("uniswap"):u==="crypto.com_wallet_extension"?!o.includes("cryptocom"):f==="injected"&&!o.includes(u));for(let f of m){let{walletClientType:u,walletBranding:g}=f;(u==="unknown"?a:i).push(ji(ei,{connectOnly:r,provider:u,logo:g.icon,displayName:g.name,connector:f},`${d}-${u}`))}}else if(p4.includes(d)){let m=t.find(f=>f.connectorType==="injected"&&f.walletClientType===d||f.connectorType===d);m&&i.push(ji(ei,{connectOnly:r,provider:d,connector:m},d))}else if(c4.includes(d)){let m=t.find(f=>d==="uniswap"?f.walletClientType==="uniswap_wallet_extension"||f.walletClientType==="uniswap_extension":d==="cryptocom"?f.walletClientType==="crypto.com_wallet_extension":f.connectorType==="injected"&&f.walletClientType===d);n&&!m&&(m=s),m&&i.push(ji(ei,{connectOnly:r,provider:d,connector:m,logo:m.connectorType==="injected"?m.walletBranding.icon:void 0,displayName:m.connectorType==="injected"?m.walletBranding.name:void 0},d))}else if(l4.includes(d)){let m=t.find(({connectorType:f})=>f===d);m&&i.push(ji(ei,{connectOnly:r,provider:d,connector:m},d))}else d4.includes(d)?s&&l.push(ji(ei,{connectOnly:r,provider:d,connector:s},d)):d==="wallet_connect"&&s&&l.push(ji(ei,{connectOnly:r,provider:d,connector:s},d));return[...a,...i,...l]};import{Fragment as f4,jsx as os,jsxs as h4}from"react/jsx-runtime";var Fh=()=>{let{app:e}=P(),{linkingOrConnectingHint:t}=_(),r=t?`Connect the wallet with address ${Bt(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return h4(f4,{children:[os(R,{},"header"),os(So,{title:"Connect your wallet",description:r}),os(ir,{children:os($i,{connectOnly:!0})}),os(H,{})]})};import{Fragment as y4,jsx as ea,jsxs as g4}from"react/jsx-runtime";var Bh=()=>{let{app:e}=P(),{linkingOrConnectingHint:t}=_(),r=t?`Connect the wallet with address ${Bt(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return g4(y4,{children:[ea(R,{},"header"),ea(jn,{title:"Connect your wallet",description:r}),ea(ir,{children:ea($i,{connectOnly:!0})}),e&&ea(xi,{app:e,alwaysShowImplicitConsent:!0}),ea(H,{})]})};import{useEffect as Kh,useState as Yh}from"react";import{isMobile as A4}from"react-device-detect";import P4 from"styled-components";import{useEffect as dp,useState as pn}from"react";import{isMobile as rc}from"react-device-detect";import qh from"styled-components";import{useEffect as Hh,useRef as C4}from"react";var v4=(e,t)=>{let r=C4(()=>{});Hh(()=>{r.current=e}),Hh(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},Vh=v4;import{useState as w4,useEffect as b4,useCallback as E4}from"react";function Gh(){let[e,t]=w4(!1),r=E4(()=>{document.hidden&&t(!0)},[]);return b4(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}import{Fragment as up,jsx as vt,jsxs as ta}from"react/jsx-runtime";var pp=2,mp=e=>e?.privyErrorCode==="linked_to_another_user"?go.ERROR_USER_EXISTS:e instanceof Tt&&!e.details.default?e.details:e instanceof Ni?go.ERROR_TIMED_OUT:e instanceof Oi?go.ERROR_USER_REJECTED_CONNECTION:e?.privyErrorCode==="cannot_link_more_of_type"?go.ERROR_USER_LIMIT_REACHED:go.ERROR_WALLET_CONNECTION,zh=()=>{let[e,t]=pn(!1),[r,o]=pn(!1),[n,i]=pn(void 0),{authenticated:a,logout:l}=V(),{app:s,navigate:d,navigateBack:m,lastScreen:f,currentScreen:u,setModalData:g}=P(),{getAuthFlow:v,walletConnectionStatus:C,closePrivyModal:b,initLoginWithWallet:A,loginWithWallet:k,updateWallets:S,createAnalyticsEvent:x}=_(),{walletConnectors:T}=V(),[M,D]=pn(0),{user:B}=V(),[K]=pn(B?.linkedAccounts.length||0),[Q,L]=pn(""),[X,I]=pn(""),[q,Le]=pn(!1),{hasTabbedAway:oe}=Gh(),{enabled:Y,token:ne}=Pe(),me=rc&&C?.connector?.connectorType==="wallet_connect_v2"||rc&&C?.connector?.connectorType==="coinbase_wallet"||rc&&C?.connector?.connectorType==="injected"&&C?.connector?.walletClientType==="phantom",be=C?.status==="connected",ue=C?.status==="switching_to_supported_chain";dp(()=>{let ce=v(),z=ce instanceof Bo?ce:void 0;if(be&&!z&&(Y&&!ne&&!a?(g({captchaModalData:{callback:ee=>A(C.connectedWallet,ee).then(()=>{Le(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),d("CAPTCHA_SCREEN",!1)):A(C.connectedWallet,ne).then(()=>{Le(!0)})),z&&me&&be&&!z.preparedMessage){z.buildSiweMessage();return}!z||me||!be||r||(async()=>{o(!0),i(void 0);try{C?.connector?.connectorType==="wallet_connect_v2"&&C?.connector?.walletClientType==="metamask"&&await Bu(2500),await gt()}catch(ee){console.warn("Auto-prompted signature failed",ee)}finally{o(!1)}})()},[M,be,q]),dp(()=>{if(B&&e){let z=Ne-500;if(s?.legal.requireUsersAcceptTerms&&!B.hasAcceptedTerms){let ke=setTimeout(()=>{d("AFFIRMATIVE_CONSENT_SCREEN")},z);return()=>clearTimeout(ke)}if(Ht(B,s?.embeddedWallets?.createOnLogin)){let ke=setTimeout(()=>{g({createWallet:{onSuccess:()=>{},onFailure:xt=>{console.error(xt),x({eventName:"embedded_wallet_creation_failure_logout",payload:{error:xt,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),d("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},z);return()=>clearTimeout(ke)}S();let ee=setTimeout(()=>b({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Ne);return()=>clearTimeout(ee)}},[B,e]);let Re=ce=>{if(ce?.privyErrorCode==="allowlist_rejected"){d("ALLOWLIST_REJECTION_SCREEN");return}else if(ce?.privyErrorCode==="max_accounts_reached"){console.error(new mo(ce).toString()),d("USER_LIMIT_REACHED_SCREEN");return}else if(ce?.privyErrorCode==="user_does_not_exist"){d("ACCOUNT_NOT_FOUND_SCREEN");return}i(mp(ce))};async function gt(){try{await k(),t(!0)}catch(ce){Re(ce)}finally{o(!1)}}dp(()=>{C?.connectError&&Re(C?.connectError)},[C]),Vh(()=>{let ce=tt==="wallet_connect_v2"&&C?.connector instanceof $r?C.connector.redirectUri:void 0;ce&&L(ce);let z=tt==="wallet_connect_v2"&&C?.connector instanceof $r?C.connector.fallbackUniversalRedirectUri:void 0;z&&I(z)},C?.connector instanceof $r&&!Q?500:null);let tt=C?.connector?.connectorType||"injected",le=C?.connector?.walletClientType||"unknown",Jt=Br[le]?.displayName||C?.connector?.walletBranding.name||"Browser Extension",Do=Br[le]?.logo||C?.connector?.walletBranding.icon||(ce=>vt(Ui,{...ce})),rt=Jt==="Browser Extension"?Jt.toLowerCase():Jt,Fe;e?Fe=`Successfully connected with ${rt}`:n?Fe=n.message:ue?Fe="Switching networks":be?Fe=r&&me?"Signing":"Sign to verify":Fe=`Waiting for ${rt}`;let ze="Don\u2019t see your wallet? Check your other browser windows.";if(e){let ce=B?.linkedAccounts.length||0;K===ce?ze="Wallet was already linked.":ze="You\u2019re good to go!"}else M>=pp&&n?ze="Unable to connect wallet":n?ze=n.detail:ue?ze="Switch your wallet to the requested network.":be&&me?ze="Sign the message in your wallet to verify it belongs to you.":le==="metamask"&&rc?ze="Click continue to open and connect MetaMask.":le==="metamask"?ze="For the best experience, connect only one wallet at a time.":tt==="wallet_connect"?ze="Open your mobile wallet app to continue":tt==="coinbase_wallet"&&(Ks()||(Qd(B)?ze="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":ze="Open the Coinbase app on your phone to continue."));let W=T?.walletConnectors?.find(ce=>ce.walletClientType==="coinbase_wallet"),se=le==="coinbase_wallet"&&(Qd(B)||n===go.ERROR_USER_EXISTS);return ta(up,{children:[vt(R,{backFn:!f||u===f?void 0:m}),ta(T4,{children:[vt(fp,{walletLogo:Do,success:e,fail:!!n}),ta(Ze,{children:[vt("h3",{children:Fe}),vt("p",{children:ze}),!be&&Q&&!oe?ta("p",{children:["Still here?"," ",vt("a",{href:Q,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),X&&ta(up,{children:[" ","or"," ",vt("a",{href:X,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]}):null]}),se?vt(U,{onClick:()=>W&&W?.disconnect(),disabled:e,children:"Use a different wallet"}):n==go.ERROR_USER_EXISTS&&u!==f?vt(U,{onClick:m,children:"Use a different wallet"}):be&&!e&&me?vt(U,{onClick:()=>{o(!0),gt()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&M<pp?vt(U,{onClick:()=>{D(M+1),i(void 0),be?(o(!0),gt()):C?.connectRetry()},disabled:!e&&(!n?.retryable||M>=pp),children:"Retry"}):!e&&!n?vt(U,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),vt(J,{})]})},T4=qh.div`
900
+ `;import{Fragment as w4,jsx as aa,jsxs as b4}from"react/jsx-runtime";var y4=["coinbase_wallet"],g4=["metamask","okx_wallet","rainbow","uniswap","uniswap_extension","zerion","rabby_wallet","cryptocom"],C4=["safe"],v4=["phantom"],sa=({connectOnly:e})=>{let{connectors:t}=I(),{app:r,data:o}=R(),n=fn(o?.externalConnectWallet?.walletList??r.appearance.walletList,t,e,r.appearance.walletList,r.externalWallets.walletConnect.enabled);return b4(w4,{children:[...n]})},fn=(e,t,r,o,n)=>{let i=[],a=[],l=[],s=t.find(d=>d.connectorType==="wallet_connect_v2");for(let d of e)if(d==="detected_wallets"){let u=t.filter(({connectorType:m,walletClientType:f})=>f==="uniswap_wallet_extension"||f==="uniswap_extension"?!o.includes("uniswap"):f==="crypto.com_wallet_extension"?!o.includes("cryptocom"):m==="injected"&&!o.includes(f));for(let m of u){let{walletClientType:f,walletBranding:y}=m;(f==="unknown"?a:i).push(aa(si,{connectOnly:r,provider:f,logo:y.icon,displayName:y.name,connector:m},`${d}-${f}`))}}else if(v4.includes(d)){let u=t.find(m=>m.connectorType==="injected"&&m.walletClientType===d||m.connectorType===d);u&&i.push(aa(si,{connectOnly:r,provider:d,connector:u},d))}else if(g4.includes(d)){let u=t.find(m=>d==="uniswap"?m.walletClientType==="uniswap_wallet_extension"||m.walletClientType==="uniswap_extension":d==="cryptocom"?m.walletClientType==="crypto.com_wallet_extension":m.connectorType==="injected"&&m.walletClientType===d);n&&!u&&(u=s),u&&i.push(aa(si,{connectOnly:r,provider:d,connector:u,logo:u.connectorType==="injected"?u.walletBranding.icon:void 0,displayName:u.connectorType==="injected"?u.walletBranding.name:void 0},d))}else if(y4.includes(d)){let u=t.find(({connectorType:m})=>m===d);u&&i.push(aa(si,{connectOnly:r,provider:d,connector:u},d))}else C4.includes(d)?s&&l.push(aa(si,{connectOnly:r,provider:d,connector:s},d)):d==="wallet_connect"&&s&&l.push(aa(si,{connectOnly:r,provider:d,connector:s},d));return[...a,...i,...l]};import{Fragment as E4,jsx as cs,jsxs as T4}from"react/jsx-runtime";var Jh=()=>{let{app:e,data:t}=R(),r=t?.externalConnectWallet?.suggestedAddress,o=r?`Connect the wallet with address ${Xr(r)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return T4(E4,{children:[cs(_,{},"header"),cs(Ao,{title:"Connect your wallet",description:o}),cs(or,{children:cs(sa,{connectOnly:!0})}),cs(B,{})]})};import{Fragment as S4,jsx as li,jsxs as jh}from"react/jsx-runtime";var $h=()=>{let{app:e,data:t}=R(),r=t?.externalConnectWallet?.suggestedAddress,o=r?jh("span",{children:["Connect the wallet with address ",li(Ho,{showCopyIcon:!1,address:r})," ",e?.name?`to ${e.name}.`:"."]}):`Connect a wallet to your ${e?.name} account`;return jh(S4,{children:[li(_,{},"header"),li(ii,{title:"Connect your wallet",description:o}),li(or,{children:li(sa,{connectOnly:!0})}),e&&li(Ni,{app:e,alwaysShowImplicitConsent:!0}),li(B,{})]})};import{useEffect as iy,useState as ay}from"react";import{isMobile as I4}from"react-device-detect";import W4 from"styled-components";import{useEffect as wp,useState as hn}from"react";import{isMobile as cc}from"react-device-detect";import oy from"styled-components";import{useEffect as ey,useRef as A4}from"react";var P4=(e,t)=>{let r=A4(()=>{});ey(()=>{r.current=e}),ey(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},ty=P4;import{useState as x4,useEffect as R4,useCallback as k4}from"react";function ry(){let[e,t]=x4(!1),r=k4(()=>{document.hidden&&t(!0)},[]);return R4(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}import{Fragment as Ep,jsx as gt,jsxs as la}from"react/jsx-runtime";var bp=2,Tp=e=>e?.privyErrorCode==="linked_to_another_user"?Co.ERROR_USER_EXISTS:e instanceof Et&&!e.details.default?e.details:e instanceof Gi?Co.ERROR_TIMED_OUT:e instanceof qi?Co.ERROR_USER_REJECTED_CONNECTION:e?.privyErrorCode==="cannot_link_more_of_type"?Co.ERROR_USER_LIMIT_REACHED:Co.ERROR_WALLET_CONNECTION,ny=()=>{let[e,t]=hn(!1),[r,o]=hn(!1),[n,i]=hn(void 0),{authenticated:a,logout:l}=V(),{app:s,navigate:d,navigateBack:u,lastScreen:m,currentScreen:f,setModalData:y,data:b}=R(),{getAuthFlow:C,walletConnectionStatus:w,closePrivyModal:A,initLoginWithWallet:k,loginWithWallet:T,updateWallets:P,createAnalyticsEvent:S}=I(),{walletConnectors:M}=V(),[N,H]=hn(0),{user:x}=V(),[K]=hn(x?.linkedAccounts.length||0),[W,Q]=hn(""),[pe,q]=hn(""),[ue,Z]=hn(!1),{hasTabbedAway:ae}=ry(),{enabled:se,token:We}=Te(),Ee=cc&&w?.connector?.connectorType==="wallet_connect_v2"||cc&&w?.connector?.connectorType==="coinbase_wallet"||cc&&w?.connector?.connectorType==="injected"&&w?.connector?.walletClientType==="phantom",ge=w?.status==="connected",le=w?.status==="switching_to_supported_chain";wp(()=>{let j=C(),Fe=j instanceof Go?j:void 0;if(ge&&!Fe&&(se&&!We&&!a?(y({captchaModalData:{callback:Oo=>k(w.connectedWallet,Oo,b?.login?.disableSignup).then(()=>{Z(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),d("CAPTCHA_SCREEN",!1)):k(w.connectedWallet,We,b?.login?.disableSignup).then(()=>{Z(!0)})),Fe&&Ee&&ge&&!Fe.preparedMessage){Fe.buildSiweMessage();return}!Fe||Ee||!ge||r||(async()=>{o(!0),i(void 0);try{w?.connector?.connectorType==="wallet_connect_v2"&&w?.connector?.walletClientType==="metamask"&&await ju(2500),await at()}catch(Oo){console.warn("Auto-prompted signature failed",Oo)}finally{o(!1)}})()},[N,ge,ue]),wp(()=>{if(x&&e){let Fe=Le-500;if(s?.legal.requireUsersAcceptTerms&&!x.hasAcceptedTerms){let Fn=setTimeout(()=>{d("AFFIRMATIVE_CONSENT_SCREEN")},Fe);return()=>clearTimeout(Fn)}if(bt(x,s?.embeddedWallets?.createOnLogin)){let Fn=setTimeout(()=>{y({createWallet:{onSuccess:()=>{},onFailure:Bn=>{console.error(Bn),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Bn,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),d("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},Fe);return()=>clearTimeout(Fn)}P();let Oo=setTimeout(()=>A({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Le);return()=>clearTimeout(Oo)}},[x,e]);let Ze=j=>{if(j?.privyErrorCode==="allowlist_rejected"){d("ALLOWLIST_REJECTION_SCREEN");return}else if(j?.privyErrorCode==="max_accounts_reached"){console.error(new fo(j).toString()),d("USER_LIMIT_REACHED_SCREEN");return}else if(j?.privyErrorCode==="user_does_not_exist"){d("ACCOUNT_NOT_FOUND_SCREEN");return}i(Tp(j))};async function at(){try{await T(),t(!0)}catch(j){Ze(j)}finally{o(!1)}}wp(()=>{w?.connectError&&Ze(w?.connectError)},[w]),ty(()=>{let j=ce==="wallet_connect_v2"&&w?.connector instanceof jr?w.connector.redirectUri:void 0;j&&Q(j);let Fe=ce==="wallet_connect_v2"&&w?.connector instanceof jr?w.connector.fallbackUniversalRedirectUri:void 0;Fe&&q(Fe)},w?.connector instanceof jr&&!W?500:null);let ce=w?.connector?.connectorType||"injected",tt=w?.connector?.walletClientType||"unknown",Dt=Ur[tt]?.displayName||w?.connector?.walletBranding.name||"Browser Extension",Yr=Ur[tt]?.logo||w?.connector?.walletBranding.icon||(j=>gt(Ki,{...j})),L=Dt==="Browser Extension"?Dt.toLowerCase():Dt,Re;e?Re=`Successfully connected with ${L}`:n?Re=n.message:le?Re="Switching networks":ge?Re=r&&Ee?"Signing":"Sign to verify":Re=`Waiting for ${L}`;let ze="Don\u2019t see your wallet? Check your other browser windows.";if(e){let j=x?.linkedAccounts.length||0;K===j?ze="Wallet was already linked.":ze="You\u2019re good to go!"}else N>=bp&&n?ze="Unable to connect wallet":n?ze=n.detail:le?ze="Switch your wallet to the requested network.":ge&&Ee?ze="Sign the message in your wallet to verify it belongs to you.":tt==="metamask"&&cc?ze="Click continue to open and connect MetaMask.":tt==="metamask"?ze="For the best experience, connect only one wallet at a time.":ce==="wallet_connect"?ze="Open your mobile wallet app to continue":ce==="coinbase_wallet"&&(Js()||(np(x)?ze="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":ze="Open the Coinbase app on your phone to continue."));let U=M?.walletConnectors?.find(j=>j.walletClientType==="coinbase_wallet"),Y=tt==="coinbase_wallet"&&(np(x)||n===Co.ERROR_USER_EXISTS);return la(Ep,{children:[gt(_,{backFn:!m||f===m?void 0:u}),la(_4,{children:[gt(Sp,{walletLogo:Yr,success:e,fail:!!n}),la(je,{children:[gt("h3",{children:Re}),gt("p",{children:ze}),!ge&&W&&!ae?la("p",{children:["Still here?"," ",gt("a",{href:W,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),pe&&la(Ep,{children:[" ","or"," ",gt("a",{href:pe,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]}):null]}),Y?gt(F,{onClick:()=>U&&U?.disconnect(),disabled:e,children:"Use a different wallet"}):n==Co.ERROR_USER_EXISTS&&f!==m?gt(F,{onClick:u,children:"Use a different wallet"}):ge&&!e&&Ee?gt(F,{onClick:()=>{o(!0),at()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&N<bp?gt(F,{onClick:()=>{H(N+1),i(void 0),ge?(o(!0),at()):w?.connectRetry()},disabled:!e&&(!n?.retryable||N>=bp),children:"Retry"}):!e&&!n?gt(F,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),gt(J,{})]})},_4=oy.div`
901
901
  display: flex;
902
902
  flex-direction: column;
903
903
  align-items: center;
904
904
  justify-content: center;
905
905
  gap: 24px;
906
906
  width: 100%;
907
- `,S4=qh.div`
907
+ `,M4=oy.div`
908
908
  display: flex;
909
909
  flex-direction: column;
910
910
  justify-content: center;
@@ -927,14 +927,14 @@ Resources:
927
927
  left: -19px;
928
928
  top: -19px;
929
929
  }
930
- `,fp=e=>{let t=e.walletLogo;return vt(up,{children:vt(S4,{children:ta("div",{children:[vt(ct,{success:e.success,fail:e.fail}),typeof t=="string"?vt("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):vt(t,{style:{width:"38px",height:"38px"}})]})})})};import{Fragment as R4,jsx as qo,jsxs as hp}from"react/jsx-runtime";var oc=2,Qh=()=>{let{navigateBack:e,navigate:t,lastScreen:r,currentScreen:o,data:n}=P(),{walletConnectionStatus:i,closePrivyModal:a}=_(),[l,s]=Yh(void 0),[d,m]=Yh(0),f=i?.status==="connected",u=i?.status==="switching_to_supported_chain";Kh(()=>{if(f){let T;if(n?.externalConnectWallet?.onCompleteNavigateTo){let M=n.externalConnectWallet.onCompleteNavigateTo;T=setTimeout(()=>{t(M)},Ne)}else T=setTimeout(a,Ne);return()=>clearTimeout(T)}},[f]);let g=T=>{s(mp(T))};Kh(()=>{i?.connectError&&g(i?.connectError)},[i]);let v=i?.connector?.connectorType||"injected",C=i?.connector?.walletClientType||"unknown",b=Br[C]?.displayName||i?.connector?.walletBranding.name||"Browser Extension",A=Br[C]?.logo||i?.connector?.walletBranding.icon||(T=>qo(Ui,{...T})),k=b==="Browser Extension"?b.toLowerCase():b,S;f?S=`Successfully connected with ${k}`:l?S=l.message:u?S="Switching networks":S=`Waiting for ${k}`;let x="Don\u2019t see your wallet? Check your other browser windows.";return f?x="You\u2019re good to go!":d>=oc&&l?x="Unable to connect wallet":l?x=l.detail:u?x="Switch your wallet to the requested network.":C==="metamask"&&A4?x="Click to continue to open and connect MetaMask.":C==="metamask"?x="For the best experience, connect only one wallet at a time.":v==="wallet_connect_v2"?x="Open your mobile wallet app to continue":v==="coinbase_wallet"&&(x="Open the Coinbase app on your phone to continue."),hp(R4,{children:[qo(R,{backFn:o===r?void 0:e}),hp(x4,{children:[qo(fp,{walletLogo:A,success:f,fail:!!l}),hp(Ze,{children:[qo("h3",{children:S}),qo("p",{children:x})]}),l==go.ERROR_USER_EXISTS?qo(U,{onClick:e,children:"Use a different wallet"}):!f&&l?.retryable&&d<oc?qo(U,{onClick:()=>{m(d+1),s(void 0),i?.connectRetry()},disabled:!f&&(!l?.retryable||d>=oc),children:"Retry"}):!f&&l&&d>=oc?qo(U,{onClick:e,children:"Use a different wallet"}):null]}),qo(J,{})]})},x4=P4.div`
930
+ `,Sp=e=>{let t=e.walletLogo;return gt(Ep,{children:gt(M4,{children:la("div",{children:[gt(st,{success:e.success,fail:e.fail}),typeof t=="string"?gt("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):gt(t,{style:{width:"38px",height:"38px"}})]})})})};import{Fragment as N4,jsx as Yo,jsxs as Ap}from"react/jsx-runtime";var dc=2,sy=()=>{let{navigateBack:e,navigate:t,lastScreen:r,currentScreen:o,data:n}=R(),{walletConnectionStatus:i,closePrivyModal:a}=I(),[l,s]=ay(void 0),[d,u]=ay(0),m=i?.status==="connected",f=i?.status==="switching_to_supported_chain";iy(()=>{if(m){let S;if(n?.externalConnectWallet?.onCompleteNavigateTo){let M=n.externalConnectWallet.onCompleteNavigateTo;S=setTimeout(()=>{t(M)},Le)}else S=setTimeout(a,Le);return()=>clearTimeout(S)}},[m]);let y=S=>{s(Tp(S))};iy(()=>{i?.connectError&&y(i?.connectError)},[i]);let b=i?.connector?.connectorType||"injected",C=i?.connector?.walletClientType||"unknown",w=Ur[C]?.displayName||i?.connector?.walletBranding.name||"Browser Extension",A=Ur[C]?.logo||i?.connector?.walletBranding.icon||(S=>Yo(Ki,{...S})),k=w==="Browser Extension"?w.toLowerCase():w,T;m?T=`Successfully connected with ${k}`:l?T=l.message:f?T="Switching networks":T=`Waiting for ${k}`;let P="Don\u2019t see your wallet? Check your other browser windows.";return m?P="You\u2019re good to go!":d>=dc&&l?P="Unable to connect wallet":l?P=l.detail:f?P="Switch your wallet to the requested network.":C==="metamask"&&I4?P="Click to continue to open and connect MetaMask.":C==="metamask"?P="For the best experience, connect only one wallet at a time.":b==="wallet_connect_v2"?P="Open your mobile wallet app to continue":b==="coinbase_wallet"&&(P="Open the Coinbase app on your phone to continue."),Ap(N4,{children:[Yo(_,{backFn:o===r?void 0:e}),Ap(L4,{children:[Yo(Sp,{walletLogo:A,success:m,fail:!!l}),Ap(je,{children:[Yo("h3",{children:T}),Yo("p",{children:P})]}),l==Co.ERROR_USER_EXISTS?Yo(F,{onClick:e,children:"Use a different wallet"}):!m&&l?.retryable&&d<dc?Yo(F,{onClick:()=>{u(d+1),s(void 0),i?.connectRetry()},disabled:!m&&(!l?.retryable||d>=dc),children:"Retry"}):!m&&l&&d>=dc?Yo(F,{onClick:e,children:"Use a different wallet"}):null]}),Yo(J,{})]})},L4=W4.div`
931
931
  display: flex;
932
932
  flex-direction: column;
933
933
  align-items: center;
934
934
  justify-content: center;
935
935
  gap: 24px;
936
936
  width: 100%;
937
- `;import{useEffect as Jh,useMemo as k4,useState as _4}from"react";import M4 from"styled-components";import{jsx as Xh}from"react/jsx-runtime";var Zh=({name:e,logoUrl:t})=>{let r=`${e??"Provider app"} logo`;return typeof t=="string"?Xh("img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):Xh("span",{})};import{Fragment as W4,jsx as zo,jsxs as nc}from"react/jsx-runtime";var jh=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t}=P(),{crossAppAuthFlow:r,updateWallets:o,closePrivyModal:n}=_(),[i,a]=_4({}),l={id:e?.crossAppAuth?.appId??"",name:e?.crossAppAuth?.name??"app",logoUrl:e?.crossAppAuth?.logoUrl},s=Ne,d=new w(`There was an issue connecting your ${l.name} account. Please try again.`),m=new Xe(async v=>{if(!e?.crossAppAuth?.popup){a({error:d});return}try{let C=await r({appId:v,popup:e.crossAppAuth.popup});a({data:C})}catch(C){C instanceof w?a({error:C}):C instanceof Mr?(e?.crossAppAuth?.popup&&e.crossAppAuth.popup.close(),a({error:d})):a({error:d})}}),f=()=>{i.data&&(o(),e?.crossAppAuth?.onSuccess(i.data),n({shouldCallAuthOnSuccess:!0,isSuccess:!0})),e?.crossAppAuth?.onError(i.error??new w("User canceled flow")),n({shouldCallAuthOnSuccess:!1,isSuccess:!1})};t.current=f,Jh(()=>{l.id.length&&m.execute(l.id)},[l.id]),Jh(()=>{if(!i.data)return;let v=setTimeout(f,s);return()=>clearTimeout(v)},[i.data]);let{title:u,subtitle:g}=k4(()=>i.data?{title:`Successfully connected with ${l.name}`,subtitle:"You're good to go!"}:i.error?{title:"Authentication failed",subtitle:i.error.message}:{title:`Connecting to ${l.name}`,subtitle:`Please check the pop-up from ${l.name} to continue`},[i,l.name]);return nc(W4,{children:[zo(R,{onClose:f}),zo(ie,{}),nc(I4,{children:[zo(nt,{children:nc("div",{children:[zo(ct,{success:!!i.data,fail:!!i.error}),zo(Zh,{name:l.name,logoUrl:l.logoUrl})]})}),nc(Ze,{children:[zo("h3",{children:u}),zo("p",{children:g})]})]}),zo(ae,{}),zo(J,{})]})},I4=M4.div`
937
+ `;import{useEffect as dy,useMemo as O4,useState as D4}from"react";import U4 from"styled-components";import{jsx as ly}from"react/jsx-runtime";var cy=({name:e,logoUrl:t})=>{let r=`${e??"Provider app"} logo`;return typeof t=="string"?ly("img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):ly("span",{})};import{Fragment as B4,jsx as Qo,jsxs as pc}from"react/jsx-runtime";var py=()=>{let e=Ne(),{data:t,navigate:r,setModalData:o,onUserCloseViaDialogOrKeybindRef:n}=R(),{crossAppAuthFlow:i,updateWallets:a,closePrivyModal:l,createAnalyticsEvent:s}=I(),{logout:d}=Zd(),[u,m]=D4({}),f=t?.crossAppAuth,y={id:f.appId,name:f.name,logoUrl:f.logoUrl},b=Le,C=new v(`There was an issue connecting your ${y.name} account. Please try again.`),w=new Je(async P=>{if(!f.popup){m({error:C});return}try{let S=await i({appId:P,popup:f.popup,action:f.action});m({data:S})}catch(S){S instanceof v?m({error:S}):S instanceof kr?(f.popup&&f.popup.close(),m({error:C})):m({error:C})}}),A=()=>{u.data&&(a(),f.onSuccess(u.data),l({shouldCallAuthOnSuccess:!0,isSuccess:!0})),f.onError(u.error??new v("User canceled flow")),l({shouldCallAuthOnSuccess:!1,isSuccess:!1})};n.current=A,dy(()=>{y.id.length&&w.execute(y.id)},[y.id]),dy(()=>{if(!u.data)return;let P=u.data;if(e.legal.requireUsersAcceptTerms&&!P.hasAcceptedTerms){let M=setTimeout(()=>{r("AFFIRMATIVE_CONSENT_SCREEN")},b);return()=>clearTimeout(M)}if(bt(P,e.embeddedWallets?.createOnLogin)){let M=setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:N=>{console.error(N),s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:N,provider:`privy:${y.id}`,screen:"CrossAppAuthScreen"}}),d()},callAuthOnSuccessOnClose:!0}}),r("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},b);return()=>clearTimeout(M)}let S=setTimeout(A,b);return()=>clearTimeout(S)},[u.data]);let{title:k,subtitle:T}=O4(()=>u.data?{title:`Successfully connected with ${y.name}`,subtitle:"You're good to go!"}:u.error?{title:"Authentication failed",subtitle:u.error.message}:{title:`Connecting to ${y.name}`,subtitle:`Please check the pop-up from ${y.name} to continue`},[u,y.name]);return pc(B4,{children:[Qo(_,{onClose:A}),Qo(re,{}),pc(F4,{children:[Qo(rt,{children:pc("div",{children:[Qo(st,{success:!!u.data,fail:!!u.error}),Qo(cy,{name:y.name,logoUrl:y.logoUrl})]})}),pc(je,{children:[Qo("h3",{children:k}),Qo("p",{children:T})]})]}),Qo(oe,{}),Qo(J,{})]})},F4=U4.div`
938
938
  display: flex;
939
939
  flex-direction: column;
940
940
  align-items: center;
@@ -942,7 +942,7 @@ Resources:
942
942
  margin-left: 27px;
943
943
  margin-right: 27px;
944
944
  gap: 24px;
945
- `;import B4 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as H4,useMemo as V4,useState as G4}from"react";import q4 from"styled-components";import ic from"styled-components";import{jsx as yp,jsxs as U4}from"react/jsx-runtime";var ac=()=>yp(L4,{children:U4(N4,{children:[yp(O4,{}),yp(D4,{})]})}),L4=ic.div`
945
+ `;import Y4 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as Q4,useMemo as X4,useState as Z4}from"react";import J4 from"styled-components";import uc from"styled-components";import{jsx as Pp,jsxs as z4}from"react/jsx-runtime";var mc=()=>Pp(H4,{children:z4(V4,{children:[Pp(G4,{}),Pp(q4,{})]})}),H4=uc.div`
946
946
  display: flex;
947
947
  justify-content: center;
948
948
  align-items: center;
@@ -954,14 +954,14 @@ Resources:
954
954
  @media all and (display-mode: standalone) {
955
955
  margin-bottom: 30px;
956
956
  }
957
- `,N4=ic.div`
957
+ `,V4=uc.div`
958
958
  position: relative;
959
959
  height: 140px;
960
960
  width: 140px;
961
961
 
962
962
  opacity: 1;
963
963
  animation: fadein 200ms ease;
964
- `,O4=ic.div`
964
+ `,G4=uc.div`
965
965
  position: absolute;
966
966
  top: 0;
967
967
  right: 0;
@@ -974,7 +974,7 @@ Resources:
974
974
  border: 4px solid var(--privy-color-accent-light);
975
975
  border-radius: 50%;
976
976
  }
977
- `,D4=ic.div`
977
+ `,q4=uc.div`
978
978
  position: absolute;
979
979
  top: 0;
980
980
  right: 0;
@@ -998,9 +998,9 @@ Resources:
998
998
  transform: rotate(360deg);
999
999
  }
1000
1000
  }
1001
- `;var $h=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];var De=class extends Error{constructor(r,o){super(o);this.type=r}};function ra(e){let t=e.type;return typeof t=="string"&&$h.includes(t)}function F4(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function ti(e){return ra(e)&&e.type==="wallet_not_on_device"}function ey(e){return ra(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function ri(e){return!!(ra(e)&&e.type==="mfa_timeout")}function oi(e){return!!(ra(e)&&e.type==="missing_or_invalid_mfa")}function gp(e){return!!(ra(e)&&e.type==="mfa_verification_max_attempts_reached")}function sc(e){return!!(ra(e)&&e.message.includes("code 429"))}function lc(e){return!!(F4(e)&&e.message==="MFA canceled")}function Cp({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function cc({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r,isResettingPassword:o,showAutomaticRecovery:n}){return n?"EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN":r||t.length===1?Cp({isCreatingWallet:e==="create",skipSplashScreen:o}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function dc(e){switch(e){case"user-passcode":return"EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN";case"google-drive":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";case"icloud":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";default:throw new Error("Recovery method not supported")}}async function vp({api:e,provider:t}){let r=Gn(),o=Ii(),n=await Wi(r);try{return t==="icloud"?{url:(await e.post(Km,{client_type:"web"})).url}:{url:(await e.post(zm,{redirect_to:window.location.href,code_challenge:n,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(i){throw pe(i)}}async function ty({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new w("User denied confirmation during OAuth flow");try{return(await e.post(Ym,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(i){let a=pe(i);throw a.privyErrorCode?new w(a.message||"Invalid code during OAuth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during OAuth flow"?new w("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new w("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}import{Fragment as oy,jsx as oa,jsxs as wp}from"react/jsx-runtime";var ry=1,ny=()=>{let{authenticated:e,user:t,getAccessToken:r}=V(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:i}=_(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:d}=P(),m=V4(()=>Date.now(),[]),[f,u]=G4(!1),{onCompleteNavigateTo:g,onFailure:v,shouldForceMFA:C,address:b}=l?.connectWallet,A=S=>{f||(u(!0),v(typeof S=="string"?new Error(S):S))};H4(()=>{let S=b?t?.linkedAccounts.find(M=>M.type==="wallet"&&M.walletClientType==="privy"&&M.address===b):Se(t),x;return!e||!S?A("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let M=await r();if(!M)return A("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:M,address:S.address}),C&&await i.verifyMfa({accessToken:M});let D=(Date.now()-m)/1e3;g==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&D<ry?x=setTimeout(()=>{a(g,!1)},(ry-D)*1e3):a(g,!1)}catch(D){if(ti(D)&&S.recoveryMethod==="privy"){let B=await r();if(!B)return A("User must be authenticated and have a Privy wallet before it can be recovered");try{n({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:S.address}}),(await i?.recover({address:S.address,accessToken:B,recoveryMethod:S.recoveryMethod}))?.address||A(new Error("Unable to recover wallet")),g?a(g):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:S.address}}),a(g)}catch{A("An error has occurred, please try again.")}}else if(ti(D)&&S.recoveryMethod!=="privy"){s({...l,recoverWallet:{privyWallet:S,onCompleteNavigateTo:g,onFailure:v},recoveryOAuthStatus:{provider:S.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}});let B=dc(S.recoveryMethod);a(B)}else A(D)}})(),()=>clearTimeout(x)):void 0},[e,t,i]);let k=()=>{A("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return d.current=k,wp(oy,{children:[oa(R,{onClose:k}),f?wp(oy,{children:[wp(Cr,{children:[oa(B4,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),oa(ve,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),oa(U,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):oa(ac,{}),oa(z4,{})]})},z4=q4.div`
1001
+ `;var uy=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];var De=class extends Error{constructor(r,o){super(o);this.type=r}};function ca(e){let t=e.type;return typeof t=="string"&&uy.includes(t)}function K4(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function ci(e){return ca(e)&&e.type==="wallet_not_on_device"}function my(e){return ca(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function di(e){return!!(ca(e)&&e.type==="mfa_timeout")}function pi(e){return!!(ca(e)&&e.type==="missing_or_invalid_mfa")}function xp(e){return!!(ca(e)&&e.type==="mfa_verification_max_attempts_reached")}function fc(e){return!!(ca(e)&&e.message.includes("code 429"))}function hc(e){return!!(K4(e)&&e.message==="MFA canceled")}function Rp({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function yc({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r,isResettingPassword:o,showAutomaticRecovery:n}){return n?"EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN":r||t.length===1?Rp({isCreatingWallet:e==="create",skipSplashScreen:o}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function gc(e){switch(e){case"user-passcode":return"EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN";case"google-drive":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";case"icloud":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";default:throw new Error("Recovery method not supported")}}async function kp({api:e,provider:t}){let r=Zn(),o=Bi(),n=await Hi(r);try{return t==="icloud"?{url:(await e.post(of,{client_type:"web"})).url}:{url:(await e.post(rf,{redirect_to:window.location.href,code_challenge:n,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(i){throw ie(i)}}async function fy({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new v("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new v("User denied confirmation during OAuth flow");try{return(await e.post(nf,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(i){let a=ie(i);throw a.privyErrorCode?new v(a.message||"Invalid code during OAuth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during OAuth flow"?new v("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new v("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}import{Fragment as yy,jsx as da,jsxs as _p}from"react/jsx-runtime";var hy=1,gy=()=>{let{authenticated:e,user:t,getAccessToken:r}=V(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:i}=I(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:d}=R(),u=X4(()=>Date.now(),[]),[m,f]=Z4(!1),{onCompleteNavigateTo:y,onFailure:b,shouldForceMFA:C,address:w}=l?.connectWallet,A=T=>{m||(f(!0),b(typeof T=="string"?new Error(T):T))};Q4(()=>{let T=w?t?.linkedAccounts.find(M=>M.type==="wallet"&&M.walletClientType==="privy"&&M.address===w):Me(t),P;return!e||!T?A("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let M=await r();if(!M)return A("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:M,address:T.address}),C&&await i.verifyMfa({accessToken:M});let N=(Date.now()-u)/1e3;y==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&N<hy?P=setTimeout(()=>{a(y,!1)},(hy-N)*1e3):a(y,!1)}catch(N){if(ci(N)&&T.recoveryMethod==="privy"){let H=await r();if(!H)return A("User must be authenticated and have a Privy wallet before it can be recovered");try{n({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:T.address}}),(await i?.recover({address:T.address,accessToken:H,recoveryMethod:T.recoveryMethod}))?.address||A(new Error("Unable to recover wallet")),y?a(y):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:T.address}}),a(y)}catch{A("An error has occurred, please try again.")}}else if(ci(N)&&T.recoveryMethod!=="privy"){s({...l,recoverWallet:{privyWallet:T,onCompleteNavigateTo:y,onFailure:b},recoveryOAuthStatus:{provider:T.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}});let H=gc(T.recoveryMethod);a(H)}else A(N)}})(),()=>clearTimeout(P)):void 0},[e,t,i]);let k=()=>{A("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return d.current=k,_p(yy,{children:[da(_,{onClose:k}),m?_p(yy,{children:[_p(yr,{children:[da(Y4,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),da(Ce,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),da(F,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):da(mc,{}),da(j4,{})]})},j4=J4.div`
1002
1002
  height: 44px;
1003
- `;import K4 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as Y4}from"react";import{Fragment as Q4,jsx as na,jsxs as iy}from"react/jsx-runtime";var ay=()=>{let{user:e}=V(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=_(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=P(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:d}=i.createWallet,m=()=>{let f=Se(e);f?(o(),l(f)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:d})};return Y4(()=>{let f=setTimeout(m,Yu);return()=>clearTimeout(f)},[]),a.current=m,iy(Q4,{children:[na(R,{onClose:m}),na(ie,{}),iy(Cr,{children:[na(K4,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),na(ve,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),na(ae,{}),na(H,{})]})};import{useEffect as cy,useRef as rw,useState as bp}from"react";import Ep from"styled-components";import{ExclamationTriangleIcon as X4}from"@heroicons/react/24/outline";import Z4 from"styled-components";import{jsx as j4,jsxs as $4}from"react/jsx-runtime";var sy=({children:e,theme:t})=>$4(J4,{$theme:t,children:[j4(X4,{width:"1.25rem",color:t==="dark"?"#FDE68A":"var(--privy-color-warn)"}),e]}),J4=Z4.div`
1003
+ `;import $4 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as ew}from"react";import{Fragment as tw,jsx as pa,jsxs as Cy}from"react/jsx-runtime";var vy=()=>{let{user:e}=V(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=I(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=R(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:d}=i.createWallet,u=()=>{let m=Me(e);m?(o(),l(m)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:d})};return ew(()=>{let m=setTimeout(u,im);return()=>clearTimeout(m)},[]),a.current=u,Cy(tw,{children:[pa(_,{onClose:u}),pa(re,{}),Cy(yr,{children:[pa($4,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),pa(Ce,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),pa(oe,{}),pa(B,{})]})};import{useEffect as Ey,useRef as cw,useState as Mp}from"react";import Ip from"styled-components";import{ExclamationTriangleIcon as rw}from"@heroicons/react/24/outline";import ow from"styled-components";import{jsx as iw,jsxs as aw}from"react/jsx-runtime";var wy=({children:e,theme:t})=>aw(nw,{$theme:t,children:[iw(rw,{width:"1.25rem",color:t==="dark"?"#FDE68A":"var(--privy-color-warn)"}),e]}),nw=ow.div`
1004
1004
  display: flex;
1005
1005
  gap: 0.5rem;
1006
1006
  background-color: ${e=>e.$theme==="dark"?"var(--privy-color-background-2)":"var(--privy-color-background)"};
@@ -1020,7 +1020,7 @@ Resources:
1020
1020
  && {
1021
1021
  border-radius: var(--privy-border-radius-sm);
1022
1022
  }
1023
- `;import ew from"styled-components";var Hr=ew.span`
1023
+ `;import sw from"styled-components";var Fr=sw.span`
1024
1024
  margin-top: 4px;
1025
1025
  color: var(--privy-color-foreground);
1026
1026
  text-align: center;
@@ -1032,25 +1032,25 @@ Resources:
1032
1032
  && a {
1033
1033
  color: var(--privy-color-accent);
1034
1034
  }
1035
- `;import tw from"styled-components";var io=tw.span`
1035
+ `;import lw from"styled-components";var no=lw.span`
1036
1036
  color: var(--privy-color-foreground);
1037
1037
  font-size: 1.125rem;
1038
1038
  font-weight: 600;
1039
1039
  line-height: 1.875rem; /* 166.667% */
1040
1040
  text-align: center;
1041
- `;import{Fragment as aw,jsx as Vr,jsxs as pc}from"react/jsx-runtime";var dy=()=>{let[e,t]=bp(null),{authenticated:r,user:o,getAccessToken:n}=V(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=_(),s=Ve(),{data:d,onUserCloseViaDialogOrKeybindRef:m}=P(),{onFailure:f,onSuccess:u,origin:g,appId:v,appClientId:C,wallet:b}=d.keyExport,A=S=>{i({shouldCallAuthOnSuccess:!1}),f(typeof S=="string"?new Error(S):S)},k=()=>{i({shouldCallAuthOnSuccess:!1}),u(),a({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:b.address}})};return cy(()=>{if(!r||!b)return A("User must be authenticated before exporting their wallet");n().then(t,A)},[r,o]),m.current=k,pc(aw,{children:[Vr(R,{onClose:k}),pc(nw,{children:[Vr(io,{children:"Transfer wallet"}),pc(Hr,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",Vr("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),Vr(sy,{theme:s.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),Vr(Ri,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:b.address,showIcon:!0}),Vr("div",{style:{width:"100%"},children:e&&Vr(ow,{origin:g,appId:v,appClientId:C,accessToken:e,clientAnalyticsId:l,wallet:b,dimensions:{height:"44px"}})})]}),Vr(H,{})]})};function ow(e){let[t,r]=bp(e.dimensions.width),[o,n]=bp(void 0),i=rw(null);cy(()=>{if(i.current&&t===void 0){let{width:s}=i.current.getBoundingClientRect();r(s)}let l=getComputedStyle(document.documentElement);n({background:l.getPropertyValue("--privy-color-background"),background2:l.getPropertyValue("--privy-color-background-2"),foreground3:l.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:l.getPropertyValue("--privy-color-foreground-accent"),accent:l.getPropertyValue("--privy-color-accent"),accentDark:l.getPropertyValue("--privy-color-accent-dark"),success:l.getPropertyValue("--privy-color-success")})},[]);let a=e.wallet.chainType==="ethereum"&&!e.wallet.imported;return Vr("div",{ref:i,children:t&&pc(iw,{children:[Vr("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:Qs(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.wallet.address,width:`${t}px`,caid:e.clientAnalyticsId,phrase_export:a,...o},{token:e.accessToken})}),Vr(ly,{children:"Loading..."}),a&&Vr(ly,{children:"Loading..."})]})})}var nw=Ep.div`
1041
+ `;import{Fragment as mw,jsx as Br,jsxs as Cc}from"react/jsx-runtime";var Ty=()=>{let[e,t]=Mp(null),{authenticated:r,user:o,getAccessToken:n}=V(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=I(),s=Ne(),{data:d,onUserCloseViaDialogOrKeybindRef:u}=R(),{onFailure:m,onSuccess:f,origin:y,appId:b,appClientId:C,wallet:w}=d.keyExport,A=T=>{i({shouldCallAuthOnSuccess:!1}),m(typeof T=="string"?new Error(T):T)},k=()=>{i({shouldCallAuthOnSuccess:!1}),f(),a({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:w.address}})};return Ey(()=>{if(!r||!w)return A("User must be authenticated before exporting their wallet");n().then(t,A)},[r,o]),u.current=k,Cc(mw,{children:[Br(_,{onClose:k}),Cc(pw,{children:[Br(no,{children:"Transfer wallet"}),Cc(Fr,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",Br("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),Br(wy,{theme:s.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),Br(Oi,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:w.address,showIcon:!0}),Br("div",{style:{width:"100%"},children:e&&Br(dw,{origin:y,appId:b,appClientId:C,accessToken:e,clientAnalyticsId:l,wallet:w,dimensions:{height:"44px"}})})]}),Br(B,{})]})};function dw(e){let[t,r]=Mp(e.dimensions.width),[o,n]=Mp(void 0),i=cw(null);Ey(()=>{if(i.current&&t===void 0){let{width:s}=i.current.getBoundingClientRect();r(s)}let l=getComputedStyle(document.documentElement);n({background:l.getPropertyValue("--privy-color-background"),background2:l.getPropertyValue("--privy-color-background-2"),foreground3:l.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:l.getPropertyValue("--privy-color-foreground-accent"),accent:l.getPropertyValue("--privy-color-accent"),accentDark:l.getPropertyValue("--privy-color-accent-dark"),success:l.getPropertyValue("--privy-color-success")})},[]);let a=e.wallet.chainType==="ethereum"&&!e.wallet.imported;return Br("div",{ref:i,children:t&&Cc(uw,{children:[Br("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:$s(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.wallet.address,width:`${t}px`,caid:e.clientAnalyticsId,phrase_export:a,...o},{token:e.accessToken})}),Br(by,{children:"Loading..."}),a&&Br(by,{children:"Loading..."})]})})}var pw=Ip.div`
1042
1042
  display: flex;
1043
1043
  flex-direction: column;
1044
1044
  gap: 1.25rem;
1045
1045
  text-align: left;
1046
- `,iw=Ep.div`
1046
+ `,uw=Ip.div`
1047
1047
  overflow: visible;
1048
1048
  position: relative;
1049
1049
  overflow: none;
1050
1050
  height: 44px;
1051
1051
  display: flex;
1052
1052
  gap: 12px;
1053
- `,ly=Ep.div`
1053
+ `,by=Ip.div`
1054
1054
  display: flex;
1055
1055
  align-items: center;
1056
1056
  justify-content: center;
@@ -1061,9 +1061,9 @@ Resources:
1061
1061
  border-radius: var(--privy-border-radius-md);
1062
1062
  background-color: var(--privy-color-background-2);
1063
1063
  color: var(--privy-color-foreground-3);
1064
- `;import cw from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as dw,useState as py}from"react";import pw from"styled-components";import{useCallback as sw,useRef as lw}from"react";function uc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=_(),o=lw(!1);return{createWallet:sw(async i=>{let a=await Ae();if(!a)throw t({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),new Error("An error has occured, please login again.");try{t({eventName:"embedded_wallet_creation_started"});let l=await r(Si);if(!l)throw new Error("walletProxy does not exist.");let s=2e4,d=new Promise((g,v)=>{setTimeout(()=>{v(new Error("walletProxy.create timed out."))},s)});if(!await Promise.race([l.create({accessToken:a,recoveryPassword:i}),d]))throw new Error("walletProxy.create did not send a response.");let f=await e();if(!f)throw new Error("Failed to refresh user.");let u=Se(f);if(!u)throw new Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:u.address}}),o.current=!0,u}catch(l){if(o.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:l.toString()}}),console.warn(l),l}},[])}}import{Fragment as mw,jsx as ia,jsxs as uy}from"react/jsx-runtime";var my=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=P(),[i,a]=py(""),{embeddedWallets:l}=Ve(),{authenticated:s}=V(),{closePrivyModal:d}=_(),{onSuccess:m,onFailure:f,callAuthOnSuccessOnClose:u}=o.createWallet,g=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:v}=uc(),[C,b]=py(null),A=new Xe(async()=>{try{let S=await v();if(!S)return;b(S),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(S){a(S.message)}});dw(()=>{if(!s){r("LANDING"),f(new Error("User must be authenticated before creating a Privy wallet"));return}if(g){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let S=cc({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:l.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1});return r(S)}A.execute()},[g,s]);let k=()=>{C?(m(C),d({shouldCallAuthOnSuccess:u})):(f(new fr("User wallet creation failed")),d({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,i?uy(mw,{children:[ia(R,{closeable:!1}),uy(Cr,{children:[ia(cw,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),ia(ve,{title:"Something went wrong",description:i})]}),ia(U,{onClick:k,children:"Close"}),ia(uw,{})]}):ia(ac,{})},uw=pw.div`
1064
+ `;import yw from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as gw,useState as Sy}from"react";import Cw from"styled-components";import{useCallback as fw,useRef as hw}from"react";function vc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=I(),o=hw(!1);return{createWallet:fw(async i=>{let a=await we();if(!a)throw t({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),new Error("An error has occured, please login again.");try{t({eventName:"embedded_wallet_creation_started"});let l=await r(Ii);if(!l)throw new Error("walletProxy does not exist.");let s=2e4,d=new Promise((y,b)=>{setTimeout(()=>{b(new Error("walletProxy.create timed out."))},s)});if(!await Promise.race([l.create({accessToken:a,recoveryPassword:i}),d]))throw new Error("walletProxy.create did not send a response.");let m=await e();if(!m)throw new Error("Failed to refresh user.");let f=Me(m);if(!f)throw new Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:f.address}}),o.current=!0,f}catch(l){if(o.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:l.toString()}}),console.warn(l),l}},[])}}import{Fragment as ww,jsx as ua,jsxs as Ay}from"react/jsx-runtime";var Py=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=R(),[i,a]=Sy(""),{embeddedWallets:l}=Ne(),{authenticated:s}=V(),{closePrivyModal:d}=I(),{onSuccess:u,onFailure:m,callAuthOnSuccessOnClose:f}=o.createWallet,y=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:b}=vc(),[C,w]=Sy(null),A=new Je(async()=>{try{let T=await b();if(!T)return;w(T),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(T){a(T.message)}});gw(()=>{if(!s){r("LANDING"),m(new Error("User must be authenticated before creating a Privy wallet"));return}if(y){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let T=yc({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:l.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1});return r(T)}A.execute()},[y,s]);let k=()=>{C?(u(C),d({shouldCallAuthOnSuccess:f})):(m(new ur("User wallet creation failed")),d({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,i?Ay(ww,{children:[ua(_,{closeable:!1}),Ay(yr,{children:[ua(yw,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),ua(Ce,{title:"Something went wrong",description:i})]}),ua(F,{onClick:k,children:"Close"}),ua(vw,{})]}):ua(mc,{})},vw=Cw.div`
1065
1065
  height: 44px;
1066
- `;import{useEffect as a5,useState as gc}from"react";import{useCallback as kp,useEffect as i5}from"react";import Cw from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useEffect as vw,useState as Ap}from"react";import fw from"@heroicons/react/24/outline/ArrowPathIcon";import hw from"@heroicons/react/24/outline/EyeIcon";import yw from"@heroicons/react/24/outline/EyeSlashIcon";import Mt,{css as Tp}from"styled-components";var gw=Tp`
1066
+ `;import{useEffect as m5,useState as Sc}from"react";import{useCallback as Fp,useEffect as u5}from"react";import Aw from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useEffect as Pw,useState as Np}from"react";import bw from"@heroicons/react/24/outline/ArrowPathIcon";import Ew from"@heroicons/react/24/outline/EyeIcon";import Tw from"@heroicons/react/24/outline/EyeSlashIcon";import kt,{css as Wp}from"styled-components";var Sw=Wp`
1067
1067
  font-size: 14px;
1068
1068
  font-style: normal;
1069
1069
  font-weight: 400;
@@ -1071,8 +1071,8 @@ Resources:
1071
1071
  letter-spacing: -0.008px;
1072
1072
  text-align: left;
1073
1073
  transition: color 0.1s ease-in;
1074
- `,mc=Mt.span`
1075
- ${gw}
1074
+ `,wc=kt.span`
1075
+ ${Sw}
1076
1076
  transition: color 0.1s ease-in;
1077
1077
  color: ${({error:e})=>e?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
1078
1078
  text-transform: ${({error:e})=>e?"":"capitalize"};
@@ -1080,18 +1080,18 @@ Resources:
1080
1080
  &[aria-hidden='true'] {
1081
1081
  visibility: hidden;
1082
1082
  }
1083
- `,un=Mt.div`
1083
+ `,yn=kt.div`
1084
1084
  display: flex;
1085
1085
  flex-direction: column;
1086
1086
  justify-content: center;
1087
1087
  flex-grow: 1;
1088
- `,mn=Mt(U)`
1089
- ${e=>e.hideAnimations&&Tp`
1088
+ `,gn=kt(F)`
1089
+ ${e=>e.hideAnimations&&Wp`
1090
1090
  && {
1091
1091
  transition: none;
1092
1092
  }
1093
1093
  `}
1094
- `,fy=Tp`
1094
+ `,xy=Wp`
1095
1095
  && {
1096
1096
  width: 100%;
1097
1097
  border-width: 1px;
@@ -1106,8 +1106,8 @@ Resources:
1106
1106
  font-weight: 300;
1107
1107
  line-height: 22px; /* 137.5% */
1108
1108
  }
1109
- `,aa=Mt.input`
1110
- ${fy}
1109
+ `,ma=kt.input`
1110
+ ${xy}
1111
1111
 
1112
1112
  &::placeholder {
1113
1113
  color: var(--privy-color-foreground-3);
@@ -1118,15 +1118,15 @@ Resources:
1118
1118
  overflow: hidden;
1119
1119
  text-overflow: ellipsis;
1120
1120
  white-space: nowrap;
1121
- `,hy=Mt.div`
1122
- ${fy}
1123
- `,fn=Mt.div`
1121
+ `,Ry=kt.div`
1122
+ ${xy}
1123
+ `,Cn=kt.div`
1124
1124
  position: relative;
1125
1125
  width: 100%;
1126
1126
  display: flex;
1127
1127
  align-items: center;
1128
1128
  justify-content: ${({centered:e})=>e?"center":"space-between"};
1129
- `,hn=Mt.div`
1129
+ `,vn=kt.div`
1130
1130
  display: flex;
1131
1131
  flex-direction: column;
1132
1132
  align-items: center;
@@ -1148,12 +1148,12 @@ Resources:
1148
1148
  font-weight: 400;
1149
1149
  line-height: 20px;
1150
1150
  }
1151
- `,ns=Mt.div`
1151
+ `,ds=kt.div`
1152
1152
  display: flex;
1153
1153
  flex-direction: column;
1154
1154
  gap: 10px;
1155
1155
  padding-bottom: 1rem;
1156
- `,is=Mt.div`
1156
+ `,ps=kt.div`
1157
1157
  display: flex;
1158
1158
  text-align: left;
1159
1159
  align-items: center;
@@ -1173,13 +1173,13 @@ Resources:
1173
1173
  > :first-child {
1174
1174
  min-width: 24px;
1175
1175
  }
1176
- `,FO=Mt.div`
1176
+ `,YO=kt.div`
1177
1177
  height: var(--privy-height-modal-full);
1178
1178
 
1179
1179
  @media (max-width: 440px) {
1180
1180
  height: var(--privy-height-modal-compact);
1181
1181
  }
1182
- `,Sp=Mt(Xa)`
1182
+ `,Lp=kt(ts)`
1183
1183
  display: flex;
1184
1184
  flex: 1;
1185
1185
  gap: 4px;
@@ -1191,7 +1191,7 @@ Resources:
1191
1191
  border-color: var(--privy-color-foreground-3);
1192
1192
  border-width: 1px;
1193
1193
  }
1194
- `,sa=Mt.div`
1194
+ `,fa=kt.div`
1195
1195
  position: absolute;
1196
1196
  right: 0.5rem;
1197
1197
 
@@ -1199,7 +1199,7 @@ Resources:
1199
1199
  flex-direction: row;
1200
1200
  justify-content: space-around;
1201
1201
  align-items: center;
1202
- `,yy=Mt(fw)`
1202
+ `,ky=kt(bw)`
1203
1203
  height: 1.25rem;
1204
1204
  width: 1.25rem;
1205
1205
  stroke: var(--privy-color-accent);
@@ -1208,7 +1208,7 @@ Resources:
1208
1208
  :active {
1209
1209
  stroke: var(--privy-color-accent-light);
1210
1210
  }
1211
- `,la=Mt(yw)`
1211
+ `,ha=kt(Tw)`
1212
1212
  height: 1.25rem;
1213
1213
  width: 1.25rem;
1214
1214
  stroke: var(--privy-color-accent);
@@ -1217,7 +1217,7 @@ Resources:
1217
1217
  :active {
1218
1218
  stroke: var(--privy-color-accent-light);
1219
1219
  }
1220
- `,ca=Mt(hw)`
1220
+ `,ya=kt(Ew)`
1221
1221
  height: 1.25rem;
1222
1222
  width: 1.25rem;
1223
1223
  stroke: var(--privy-color-accent);
@@ -1226,7 +1226,7 @@ Resources:
1226
1226
  :active {
1227
1227
  stroke: var(--privy-color-accent-light);
1228
1228
  }
1229
- `,gy=Mt.progress`
1229
+ `,_y=kt.progress`
1230
1230
  height: 4px;
1231
1231
  width: 100%;
1232
1232
  margin: 8px 0;
@@ -1242,7 +1242,7 @@ Resources:
1242
1242
  transition: all 0.1s ease-out;
1243
1243
  background: ${({label:e})=>e==="Strong"&&"#78dca6"||e==="Medium"&&"var(--privy-color-warn)"||"var(--privy-color-error)"};
1244
1244
  }
1245
- `;import{Fragment as ww,jsx as br,jsxs as fc}from"react/jsx-runtime";var Cy=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i,a]=Ap(!0),[l,s]=Ap(!1),[d,m]=Ap(""),f=r===d;return vw(()=>{d&&!l&&s(!0)},[d]),fc(ww,{children:[br(R,{closeable:!1,backFn:n}),br(ie,{}),fc(un,{children:[fc(hn,{children:[br(Cw,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),br("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),br("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),fc(fn,{children:[br(aa,{value:d,onChange:u=>m(u.target.value),onKeyUp:u=>{u.key==="Enter"&&o()},onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),br(sa,{style:{right:"0.75rem"},children:i?br(la,{onClick:()=>a(!1)}):br(ca,{onClick:()=>a(!0)})})]}),br(mc,{"aria-hidden":!l||f,error:!0,children:"Passwords do not match"})]}),br(mn,{onClick:o,loading:t,disabled:!f,hideAnimations:e,children:"Continue"}),br(ae,{}),br(H,{})]})};import Sw from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as Aw}from"react";import Pw from"styled-components";import ss from"styled-components";import{jsx as as,jsxs as Tw}from"react/jsx-runtime";var vy=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>as("label",{children:Tw(bw,{className:e,children:[as(by,{checked:t,...o}),as(Ew,{color:r,checked:t,children:as(wy,{viewBox:"0 0 24 24",children:as("polyline",{points:"20 6 9 17 4 12"})})})]})});var JO=ss.label`
1245
+ `;import{Fragment as xw,jsx as vr,jsxs as bc}from"react/jsx-runtime";var My=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i,a]=Np(!0),[l,s]=Np(!1),[d,u]=Np(""),m=r===d;return Pw(()=>{d&&!l&&s(!0)},[d]),bc(xw,{children:[vr(_,{closeable:!1,backFn:n}),vr(re,{}),bc(yn,{children:[bc(vn,{children:[vr(Aw,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),vr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),vr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),bc(Cn,{children:[vr(ma,{value:d,onChange:f=>u(f.target.value),onKeyUp:f=>{f.key==="Enter"&&o()},onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),vr(fa,{style:{right:"0.75rem"},children:i?vr(ha,{onClick:()=>a(!1)}):vr(ya,{onClick:()=>a(!0)})})]}),vr(wc,{"aria-hidden":!l||m,error:!0,children:"Passwords do not match"})]}),vr(gn,{onClick:o,loading:t,disabled:!m,hideAnimations:e,children:"Continue"}),vr(oe,{}),vr(B,{})]})};import Mw from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as Iw}from"react";import Ww from"styled-components";import ms from"styled-components";import{jsx as us,jsxs as _w}from"react/jsx-runtime";var Iy=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>us("label",{children:_w(Rw,{className:e,children:[us(Ly,{checked:t,...o}),us(kw,{color:r,checked:t,children:us(Wy,{viewBox:"0 0 24 24",children:us("polyline",{points:"20 6 9 17 4 12"})})})]})});var iD=ms.label`
1246
1246
  && {
1247
1247
  cursor: pointer;
1248
1248
  display: flex;
@@ -1254,14 +1254,14 @@ Resources:
1254
1254
  border: 1px solid var(--privy-color-foreground-4);
1255
1255
  width: 100%;
1256
1256
  }
1257
- `,bw=ss.div`
1257
+ `,Rw=ms.div`
1258
1258
  display: inline-block;
1259
1259
  vertical-align: middle;
1260
- `,wy=ss.svg`
1260
+ `,Wy=ms.svg`
1261
1261
  fill: none;
1262
1262
  stroke: white;
1263
1263
  stroke-width: 3px;
1264
- `,by=ss.input.attrs({type:"checkbox"})`
1264
+ `,Ly=ms.input.attrs({type:"checkbox"})`
1265
1265
  border: 0;
1266
1266
  clip: rect(0 0 0 0);
1267
1267
  clippath: inset(50%);
@@ -1272,7 +1272,7 @@ Resources:
1272
1272
  position: absolute;
1273
1273
  white-space: nowrap;
1274
1274
  width: 1px;
1275
- `,Ew=ss.div`
1275
+ `,kw=ms.div`
1276
1276
  display: inline-block;
1277
1277
  width: 18px;
1278
1278
  height: 18px;
@@ -1287,28 +1287,28 @@ Resources:
1287
1287
  border-width: 1px;
1288
1288
  }
1289
1289
 
1290
- ${by}:focus + & {
1290
+ ${Ly}:focus + & {
1291
1291
  box-shadow: 0 0 0 1px ${e=>e.color};
1292
1292
  }
1293
1293
 
1294
- ${wy} {
1294
+ ${Wy} {
1295
1295
  visibility: ${e=>e.checked?"visible":"hidden"};
1296
1296
  }
1297
- `;import{Fragment as Ey,jsx as Gr,jsxs as ls}from"react/jsx-runtime";var Ty=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i,a]=Aw(!1);return ls(Ey,{children:[Gr(R,{closeable:!1,backFn:o}),Gr(ie,{}),ls(un,{children:[ls(hn,{children:[Gr(Sw,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),Gr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),Gr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),Gr(ns,{children:ls(is,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[Gr(vy,{color:"var(--privy-color-error)",readOnly:!0,checked:i}),Gr(Ey,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),ls(xw,{children:[n.initiatedBy==="user"&&Gr(eo,{onClick:n.onCancel,disabled:t,children:"Cancel"}),Gr(mn,{onClick:r,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),Gr(ae,{}),Gr(H,{})]})},xw=Pw.div`
1297
+ `;import{Fragment as Ny,jsx as Hr,jsxs as fs}from"react/jsx-runtime";var Oy=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i,a]=Iw(!1);return fs(Ny,{children:[Hr(_,{closeable:!1,backFn:o}),Hr(re,{}),fs(yn,{children:[fs(vn,{children:[Hr(Mw,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),Hr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),Hr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),Hr(ds,{children:fs(ps,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[Hr(Iy,{color:"var(--privy-color-error)",readOnly:!0,checked:i}),Hr(Ny,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),fs(Lw,{children:[n.initiatedBy==="user"&&Hr($r,{onClick:n.onCancel,disabled:t,children:"Cancel"}),Hr(gn,{onClick:r,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),Hr(oe,{}),Hr(B,{})]})},Lw=Ww.div`
1298
1298
  display: flex;
1299
1299
  gap: 10px;
1300
- `;import Gw from"@heroicons/react/24/outline/KeyIcon";import _y from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as My,useMemo as Pp,useEffect as qw}from"react";import Iy from"styled-components";import Rw from"fast-password-entropy";import*as Sy from"secure-password-utilities";import{DEFAULT_WORDLIST as kw}from"secure-password-utilities/wordlists";var _w=95,Mw=8,Iw=3,Ww=.3,Lw=/[a-z]/,Nw=/[A-Z]/,Ow=/[0-9]/,Dw="a-zA-Z0-9",Ay="!@#$%^&*()\\-_+.",Py=`${Dw}${Ay}`,Uw=new RegExp(`[${Ay}]`),Fw=new RegExp(`[${Py}]`),xy=new RegExp(`^[${Py}]{6,}$`),Ry=(e="")=>{let t=e.split("").filter(r=>!Fw.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},hc=()=>Sy.generatePassphrase(4,kw);function Bw(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function Hw(e){if(e.length<Mw)return 0;let t=0;Lw.test(e)&&(t+=1),Nw.test(e)&&(t+=1),Ow.test(e)&&(t+=1),Uw.test(e)&&(t+=1);let r=t/Iw;return Math.max(0,Math.min(1,r))}function Vw(e=""){let t=Hw(e),r=Rw(e)/_w;return(t*Ww+r)/2}function ky(e=""){let t=Vw(e);return{value:t,label:Bw(t)}}import{Fragment as Yw,jsx as It,jsxs as Po}from"react/jsx-runtime";var Wy=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:i,onClose:a,onBack:l,onPasswordChange:s,onPasswordGenerate:d})=>{let[m,f]=My(!1),[u,g]=My(!1);qw(()=>{r&&!u&&g(!0)},[r]);let v=Pp(()=>u?(r?.length||0)<6?"Password must be at least 6 characters":xy.test(r||"")?null:`Invalid characters used ( ${Ry(r).join(" ")} )`:null,[r,u]),C=Pp(()=>v?{value:0,label:"Weak"}:ky(r),[r,v]),b=Pp(()=>!!(!r?.length||v),[v,r]);return Po(Yw,{children:[It(R,{onClose:a,closeable:o.initiatedBy==="user",backFn:l}),It(ie,{}),Po(un,{children:[Po(hn,{children:[It(Gw,{height:48,width:48,stroke:"var(--privy-color-accent)"}),Po("h3",{style:{color:"var(--privy-color-foreground)"},children:[n?"Reset":"Set"," your password"]}),It("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),Po(fn,{children:[It(aa,{value:r,onChange:A=>s(A.target.value),onKeyUp:A=>{A.key==="Enter"&&i()},placeholder:"enter or generate a strong password",type:m?"password":"text",style:{paddingRight:"3.8rem"}}),Po(sa,{style:{width:"3.5rem"},children:[m?It(la,{onClick:()=>f(!1)}):It(ca,{onClick:()=>f(!0)}),It(yy,{onClick:d})]})]}),It(gy,{value:C.value===0?.01:C.value,label:C.label}),It(mc,{error:!!v,children:v||`Password Strength: ${u?C.label:"--"}`}),Po(Kw,{children:[It(zw,{children:Po(ns,{children:[Po(is,{children:[It(_y,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),Po(is,{children:[It(_y,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),It(mn,{onClick:i,loading:t,disabled:b,hideAnimations:e,children:"Continue"})]})]}),It(ae,{}),It(H,{})]})},zw=Iy(ns)`
1300
+ `;import Zw from"@heroicons/react/24/outline/KeyIcon";import Gy from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as qy,useMemo as Op,useEffect as Jw}from"react";import zy from"styled-components";import Nw from"fast-password-entropy";import*as Dy from"secure-password-utilities";import{DEFAULT_WORDLIST as Ow}from"secure-password-utilities/wordlists";var Dw=95,Uw=8,Fw=3,Bw=.3,Hw=/[a-z]/,Vw=/[A-Z]/,Gw=/[0-9]/,qw="a-zA-Z0-9",Uy="!@#$%^&*()\\-_+.",Fy=`${qw}${Uy}`,zw=new RegExp(`[${Uy}]`),Kw=new RegExp(`[${Fy}]`),By=new RegExp(`^[${Fy}]{6,}$`),Hy=(e="")=>{let t=e.split("").filter(r=>!Kw.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},Ec=()=>Dy.generatePassphrase(4,Ow);function Yw(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function Qw(e){if(e.length<Uw)return 0;let t=0;Hw.test(e)&&(t+=1),Vw.test(e)&&(t+=1),Gw.test(e)&&(t+=1),zw.test(e)&&(t+=1);let r=t/Fw;return Math.max(0,Math.min(1,r))}function Xw(e=""){let t=Qw(e),r=Nw(e)/Dw;return(t*Bw+r)/2}function Vy(e=""){let t=Xw(e);return{value:t,label:Yw(t)}}import{Fragment as e5,jsx as _t,jsxs as xo}from"react/jsx-runtime";var Ky=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:i,onClose:a,onBack:l,onPasswordChange:s,onPasswordGenerate:d})=>{let[u,m]=qy(!1),[f,y]=qy(!1);Jw(()=>{r&&!f&&y(!0)},[r]);let b=Op(()=>f?(r?.length||0)<6?"Password must be at least 6 characters":By.test(r||"")?null:`Invalid characters used ( ${Hy(r).join(" ")} )`:null,[r,f]),C=Op(()=>b?{value:0,label:"Weak"}:Vy(r),[r,b]),w=Op(()=>!!(!r?.length||b),[b,r]);return xo(e5,{children:[_t(_,{onClose:a,closeable:o.initiatedBy==="user",backFn:l}),_t(re,{}),xo(yn,{children:[xo(vn,{children:[_t(Zw,{height:48,width:48,stroke:"var(--privy-color-accent)"}),xo("h3",{style:{color:"var(--privy-color-foreground)"},children:[n?"Reset":"Set"," your password"]}),_t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),xo(Cn,{children:[_t(ma,{value:r,onChange:A=>s(A.target.value),onKeyUp:A=>{A.key==="Enter"&&i()},placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),xo(fa,{style:{width:"3.5rem"},children:[u?_t(ha,{onClick:()=>m(!1)}):_t(ya,{onClick:()=>m(!0)}),_t(ky,{onClick:d})]})]}),_t(_y,{value:C.value===0?.01:C.value,label:C.label}),_t(wc,{error:!!b,children:b||`Password Strength: ${f?C.label:"--"}`}),xo($w,{children:[_t(jw,{children:xo(ds,{children:[xo(ps,{children:[_t(Gy,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),xo(ps,{children:[_t(Gy,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),_t(gn,{onClick:i,loading:t,disabled:w,hideAnimations:e,children:"Continue"})]})]}),_t(oe,{}),_t(B,{})]})},jw=zy(ds)`
1301
1301
  flex: 1;
1302
1302
  padding-top: 1rem;
1303
- `,Kw=Iy.div`
1303
+ `,$w=zy.div`
1304
1304
  display: flex;
1305
1305
  flex-direction: column;
1306
1306
  height: 100%;
1307
- `;import Qw from"@heroicons/react/24/outline/ArrowDownTrayIcon";import Xw from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import Zw from"@heroicons/react/24/outline/DocumentDuplicateIcon";import Jw from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as jw,useCallback as Ly}from"react";import{Fragment as xp,jsx as dr,jsxs as ni}from"react/jsx-runtime";var Ny=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:i})=>{let[a,l]=jw(!1),s=Ly(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),d=Ly(()=>{let m=document.createElement("a"),f=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),u=new Blob([$w(r,o)],{type:"text/plain"}),g=URL.createObjectURL(u);m.href=g,m.target="_blank",m.download=`${f}-privy-wallet-recovery.txt`,document.body.appendChild(m),m.click(),setTimeout(()=>{m.remove(),URL.revokeObjectURL(g)},5e3)},[o]);return ni(xp,{children:[dr(R,{backFn:i,closeable:!1}),dr(ie,{}),ni(un,{children:[ni(hn,{children:[dr(Jw,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),dr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),dr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),dr(fn,{centered:!0,children:dr(hy,{children:o})}),ni("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[dr(Sp,{onClick:s,children:a?ni(xp,{children:[dr(Xw,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):ni(xp,{children:[dr(Zw,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),ni(Sp,{onClick:d,children:[dr(Qw,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),dr(mn,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),dr(ae,{}),dr(H,{})]})},$w=(e,t)=>`Your wallet recovery password for ${e} is
1307
+ `;import t5 from"@heroicons/react/24/outline/ArrowDownTrayIcon";import r5 from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import o5 from"@heroicons/react/24/outline/DocumentDuplicateIcon";import n5 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as i5,useCallback as Yy}from"react";import{Fragment as Dp,jsx as lr,jsxs as ui}from"react/jsx-runtime";var Qy=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:i})=>{let[a,l]=i5(!1),s=Yy(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),d=Yy(()=>{let u=document.createElement("a"),m=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),f=new Blob([a5(r,o)],{type:"text/plain"}),y=URL.createObjectURL(f);u.href=y,u.target="_blank",u.download=`${m}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(y)},5e3)},[o]);return ui(Dp,{children:[lr(_,{backFn:i,closeable:!1}),lr(re,{}),ui(yn,{children:[ui(vn,{children:[lr(n5,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),lr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),lr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),lr(Cn,{centered:!0,children:lr(Ry,{children:o})}),ui("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[lr(Lp,{onClick:s,children:a?ui(Dp,{children:[lr(r5,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):ui(Dp,{children:[lr(o5,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),ui(Lp,{onClick:d,children:[lr(t5,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),lr(gn,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),lr(oe,{}),lr(B,{})]})},a5=(e,t)=>`Your wallet recovery password for ${e} is
1308
1308
 
1309
1309
  ${t}
1310
1310
 
1311
- You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;import e5 from"@heroicons/react/24/solid/CheckCircleIcon";import t5 from"@heroicons/react/24/solid/XCircleIcon";import{Fragment as r5,jsx as Ko,jsxs as Rp}from"react/jsx-runtime";var Oy=({error:e,onClose:t})=>Rp(r5,{children:[Ko(R,{closeable:!1}),Ko(ie,{}),e?Rp(Cr,{children:[Ko(t5,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),Ko(ve,{title:"Something went wrong",description:e})]}):Rp(Cr,{children:[Ko(e5,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),Ko(ve,{title:"Success"})]}),Ko(U,{onClick:t,children:"Close"}),Ko(ae,{}),Ko(H,{})]});import{useReducer as o5}from"react";var n5=(e,t)=>{switch(e){case"creating":return t==="back"?e:"saving";case"saving":return t==="back"?"creating":"confirming";case"confirming":return t==="back"?"saving":"finalizing";case"finalizing":return t==="back"?"confirming":"done";default:return e}},Dy=()=>{let[e,t]=o5(n5,"creating");return{send:t,state:e}};import{jsx as cs}from"react/jsx-runtime";var yc=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=P(),{send:n,state:i}=Dy(),a=kp(async()=>{i==="finalizing"&&await e(),n("next")},[i,n,e]);i5(()=>{let d;return i==="done"&&t.config.initiatedBy==="automatic"&&(d=setTimeout(()=>t.onClose?.(),Ne)),()=>{d&&clearTimeout(d)}},[i,t.config.initiatedBy,t.onClose]);let l=kp(()=>{n("back")},[n]),s=kp(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return i==="creating"?cs(Wy,{...t,onSubmit:a,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?s:void 0}):i==="saving"?cs(Ny,{...t,onSubmit:a,onBack:l}):i==="confirming"?cs(Cy,{...t,onSubmit:a,onBack:l}):i==="finalizing"?cs(Ty,{...t,onSubmit:a,onBack:l}):i==="done"?cs(Oy,{...t,onSubmit:a}):null};import{jsx as s5}from"react/jsx-runtime";var Uy=()=>{let[e,t]=gc(null),[r,o]=gc(!1),[n,i]=gc(null),[a,l]=gc(""),{authenticated:s,getAccessToken:d,user:m}=V(),{walletProxy:f,refreshUser:u,closePrivyModal:g,createAnalyticsEvent:v}=_(),{app:C,navigate:b,data:A,onUserCloseViaDialogOrKeybindRef:k}=P(),{onSuccess:S,onFailure:x}=A.createWallet,T=Se(m),M=e?.recoveryMethod==="user-passcode",D=T?.recoveryMethod==="user-passcode";a5(()=>{s||(b("LANDING"),x(new Du("User must be authenticated before setting a password on a Privy wallet")))},[s]);let B=()=>{if(n){x(n),g({shouldCallAuthOnSuccess:!1});return}if(!M){x(new fr("Exited before password was added to wallet")),g({shouldCallAuthOnSuccess:!1});return}S(e),g({shouldCallAuthOnSuccess:!1})};k.current=B;let K=async()=>{let L=await d();if(L&&T?.address&&a&&f)try{if(v({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:T.address,existingRecoveryMethod:T.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:D}}),!(await f.setRecovery({accessToken:L,address:T.address,recoveryPassword:a,recoveryMethod:"user-passcode"})).address){i(new fr("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:T.address,existingRecoveryMethod:T.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:D,reason:"error setting password"}});return}let I=await u(),q=Se(I);if(!q){i(new fr("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:T.address,existingRecoveryMethod:T.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:D,reason:"wallet disconnected"}});return}t(q),v({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:T.address,existingRecoveryMethod:T.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:D}})}catch(X){console.warn(X),i(X instanceof Error?X:new Error("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:T.address,reason:X}})}},Q=async()=>{M?(S(e),g({shouldCallAuthOnSuccess:!1})):(o(!0),i(null),await K(),o(!1))};return s5(yc,{appName:C?.name||"privy",config:{initiatedBy:"user",onCancel:B},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:a,isResettingPassword:D,onPasswordGenerate:()=>l(hc()),onPasswordChange:l,onSubmit:Q,onClose:B})};import l5 from"@heroicons/react/24/outline/UserCircleIcon";import c5 from"@heroicons/react/24/solid/LockClosedIcon";import{Fragment as d5,jsx as Yo,jsxs as Cc}from"react/jsx-runtime";var Fy=()=>{let{closePrivyModal:e}=_(),{data:t,setModalData:r,navigate:o,onUserCloseViaDialogOrKeybindRef:n}=P(),{onSuccess:i,onFailure:a}=t.setWalletPassword,l=()=>{a(new fr("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return n.current=l,Cc(d5,{children:[Yo(R,{onClose:l}),Yo(ie,{}),Cc(Cr,{children:[Cc(yh,{children:[Yo(l5,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),Yo(gh,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:Yo(c5,{width:"12px",height:"12px",fill:"white"})})]}),Cc(ve,{title:"Secure Your Account",children:["Please set a password to secure your account.",Yo("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),Yo(U,{onClick:()=>{r({createWallet:{onFailure:a,onSuccess:i,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),Yo(ae,{}),Yo(H,{})]})};import p5 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import u5 from"@heroicons/react/24/outline/PhoneIcon";import By from"styled-components";import{Fragment as y5,jsx as qr,jsxs as vc}from"react/jsx-runtime";var m5=(e,t)=>{let r=qr(p5,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof w)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:r};case"insufficient_balance":return{title:"Insufficient balance",detail:e.message,ctaText:"Try again",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else{if(e instanceof De&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:qr(u5,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof $t)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:r};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:r};case"allowlist_rejected":return{title:t.errorTitle||"You don't have access to this app",detail:t.errorDetail||"Have you been invited?",ctaText:t.errorCtaText||"Try another account",icon:qr(Zl,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case"captcha_failure":return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:qr("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:qr("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:r};case"not_supported":return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:r};case"too_many_requests":return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else return e instanceof Mr&&e.status&&[400,422].includes(e.status)?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:r}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}},Hy=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=P(),i=r?.errorModalData?.previousScreen||(o===n?void 0:o);return qr(ii,{error:r?.errorModalData?.error||new Error,backFn:()=>i?e(i,!1):t(),onClick:()=>e(i||"LANDING",!1)})},ii=({error:e,backFn:t,onClick:r})=>{let{reset:o}=Pe(),{app:n}=P(),i=m5(e,n.allowlistConfig),a=()=>{if(e instanceof $t&&(e.privyErrorCode==="invalid_captcha"&&o(),e.privyErrorCode==="allowlist_rejected"&&n.allowlistConfig.errorCtaLink)){window.location.href=n.allowlistConfig.errorCtaLink;return}r?.()};return vc(y5,{children:[qr(R,{backFn:t}),vc(f5,{children:[qr(nt,{children:vc("div",{children:[qr(Xl,{color:"var(--privy-color-error)"}),i.icon]})}),vc(h5,{children:[qr("h3",{children:i.title}),qr("p",{children:i.detail})]}),qr(U,{color:"var(--privy-color-error)",onClick:a,children:i.ctaText})]})]})},f5=By.div`
1311
+ You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;import s5 from"@heroicons/react/24/solid/CheckCircleIcon";import l5 from"@heroicons/react/24/solid/XCircleIcon";import{Fragment as c5,jsx as Xo,jsxs as Up}from"react/jsx-runtime";var Xy=({error:e,onClose:t})=>Up(c5,{children:[Xo(_,{closeable:!1}),Xo(re,{}),e?Up(yr,{children:[Xo(l5,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),Xo(Ce,{title:"Something went wrong",description:e})]}):Up(yr,{children:[Xo(s5,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),Xo(Ce,{title:"Success"})]}),Xo(F,{onClick:t,children:"Close"}),Xo(oe,{}),Xo(B,{})]});import{useReducer as d5}from"react";var p5=(e,t)=>{switch(e){case"creating":return t==="back"?e:"saving";case"saving":return t==="back"?"creating":"confirming";case"confirming":return t==="back"?"saving":"finalizing";case"finalizing":return t==="back"?"confirming":"done";default:return e}},Zy=()=>{let[e,t]=d5(p5,"creating");return{send:t,state:e}};import{jsx as hs}from"react/jsx-runtime";var Tc=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=R(),{send:n,state:i}=Zy(),a=Fp(async()=>{i==="finalizing"&&await e(),n("next")},[i,n,e]);u5(()=>{let d;return i==="done"&&t.config.initiatedBy==="automatic"&&(d=setTimeout(()=>t.onClose?.(),Le)),()=>{d&&clearTimeout(d)}},[i,t.config.initiatedBy,t.onClose]);let l=Fp(()=>{n("back")},[n]),s=Fp(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return i==="creating"?hs(Ky,{...t,onSubmit:a,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?s:void 0}):i==="saving"?hs(Qy,{...t,onSubmit:a,onBack:l}):i==="confirming"?hs(My,{...t,onSubmit:a,onBack:l}):i==="finalizing"?hs(Oy,{...t,onSubmit:a,onBack:l}):i==="done"?hs(Xy,{...t,onSubmit:a}):null};import{jsx as f5}from"react/jsx-runtime";var Jy=()=>{let[e,t]=Sc(null),[r,o]=Sc(!1),[n,i]=Sc(null),[a,l]=Sc(""),{authenticated:s,getAccessToken:d,user:u}=V(),{walletProxy:m,refreshUser:f,closePrivyModal:y,createAnalyticsEvent:b}=I(),{app:C,navigate:w,data:A,onUserCloseViaDialogOrKeybindRef:k}=R(),{onSuccess:T,onFailure:P}=A.createWallet,S=Me(u),M=e?.recoveryMethod==="user-passcode",N=S?.recoveryMethod==="user-passcode";m5(()=>{s||(w("LANDING"),P(new Xu("User must be authenticated before setting a password on a Privy wallet")))},[s]);let H=()=>{if(n){P(n),y({shouldCallAuthOnSuccess:!1});return}if(!M){P(new ur("Exited before password was added to wallet")),y({shouldCallAuthOnSuccess:!1});return}T(e),y({shouldCallAuthOnSuccess:!1})};k.current=H;let x=async()=>{let W=await d();if(W&&S?.address&&a&&m)try{if(b({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:S.address,existingRecoveryMethod:S.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:N}}),!(await m.setRecovery({accessToken:W,address:S.address,recoveryPassword:a,recoveryMethod:"user-passcode"})).address){i(new ur("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:S.address,existingRecoveryMethod:S.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:N,reason:"error setting password"}});return}let pe=await f(),q=Me(pe);if(!q){i(new ur("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:S.address,existingRecoveryMethod:S.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:N,reason:"wallet disconnected"}});return}t(q),b({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:S.address,existingRecoveryMethod:S.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:N}})}catch(Q){console.warn(Q),i(Q instanceof Error?Q:new Error("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:S.address,reason:Q}})}},K=async()=>{M?(T(e),y({shouldCallAuthOnSuccess:!1})):(o(!0),i(null),await x(),o(!1))};return f5(Tc,{appName:C?.name||"privy",config:{initiatedBy:"user",onCancel:H},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:a,isResettingPassword:N,onPasswordGenerate:()=>l(Ec()),onPasswordChange:l,onSubmit:K,onClose:H})};import h5 from"@heroicons/react/24/outline/UserCircleIcon";import y5 from"@heroicons/react/24/solid/LockClosedIcon";import{Fragment as g5,jsx as Zo,jsxs as Ac}from"react/jsx-runtime";var jy=()=>{let{closePrivyModal:e}=I(),{data:t,setModalData:r,navigate:o,onUserCloseViaDialogOrKeybindRef:n}=R(),{onSuccess:i,onFailure:a}=t.setWalletPassword,l=()=>{a(new ur("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return n.current=l,Ac(g5,{children:[Zo(_,{onClose:l}),Zo(re,{}),Ac(yr,{children:[Ac(Rh,{children:[Zo(h5,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),Zo(kh,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:Zo(y5,{width:"12px",height:"12px",fill:"white"})})]}),Ac(Ce,{title:"Secure Your Account",children:["Please set a password to secure your account.",Zo("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),Zo(F,{onClick:()=>{r({createWallet:{onFailure:a,onSuccess:i,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),Zo(oe,{}),Zo(B,{})]})};import C5 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import v5 from"@heroicons/react/24/outline/PhoneIcon";import $y from"styled-components";import{Fragment as T5,jsx as Vr,jsxs as Pc}from"react/jsx-runtime";var w5=(e,t)=>{let r=Vr(C5,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof v)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:r};case"insufficient_balance":return{title:"Insufficient balance",detail:e.message,ctaText:"Try again",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else{if(e instanceof De&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:Vr(v5,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof Jt)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:r};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:r};case"allowlist_rejected":return{title:t.errorTitle||"You don't have access to this app",detail:t.errorDetail||"Have you been invited?",ctaText:t.errorCtaText||"Try another account",icon:Vr(oc,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case"captcha_failure":return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:Vr("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:Vr("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:r};case"not_supported":return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:r};case"too_many_requests":return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else return e instanceof kr&&e.status&&[400,422].includes(e.status)?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:r}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}},eg=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=R(),i=r?.errorModalData?.previousScreen||(o===n?void 0:o);return Vr(mi,{error:r?.errorModalData?.error||new Error,backFn:()=>i?e(i,!1):t(),onClick:()=>e(i||"LANDING",!1)})},mi=({error:e,backFn:t,onClick:r})=>{let{reset:o}=Te(),{app:n}=R(),i=w5(e,n.allowlistConfig),a=()=>{if(e instanceof Jt&&(e.privyErrorCode==="invalid_captcha"&&o(),e.privyErrorCode==="allowlist_rejected"&&n.allowlistConfig.errorCtaLink)){window.location.href=n.allowlistConfig.errorCtaLink;return}r?.()};return Pc(T5,{children:[Vr(_,{backFn:t}),Pc(b5,{children:[Vr(rt,{children:Pc("div",{children:[Vr(rc,{color:"var(--privy-color-error)"}),i.icon]})}),Pc(E5,{children:[Vr("h3",{children:i.title}),Vr("p",{children:i.detail})]}),Vr(F,{color:"var(--privy-color-error)",onClick:a,children:i.ctaText})]})]})},b5=$y.div`
1312
1312
  display: flex;
1313
1313
  flex-direction: column;
1314
1314
  align-items: center;
@@ -1316,11 +1316,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1316
1316
  gap: 24px;
1317
1317
  width: 100%;
1318
1318
  padding-bottom: 16px;
1319
- `,h5=By.div`
1319
+ `,E5=$y.div`
1320
1320
  display: flex;
1321
1321
  flex-direction: column;
1322
1322
  gap: 8px;
1323
- `;import{useEffect as Yy,useRef as O5,useState as Mp}from"react";import{isIOS as D5,isMobile as Qy}from"react-device-detect";import Jy from"styled-components";import{useState as g5}from"react";import C5 from"styled-components";import{jsx as Vy}from"react/jsx-runtime";var da=({style:e,color:t,...r})=>Vy("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:t||"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...r,children:Vy("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});import{jsx as Gy,jsxs as w5}from"react/jsx-runtime";var yn=e=>{let[t,r]=g5(!1);return w5(v5,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?Gy(da,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):Gy(wm,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},v5=C5.button`
1323
+ `;import{useEffect as ag,useRef as G5,useState as Hp}from"react";import{isIOS as q5,isMobile as sg}from"react-device-detect";import dg from"styled-components";import{useState as S5}from"react";import A5 from"styled-components";import{jsx as tg}from"react/jsx-runtime";var ga=({style:e,color:t,...r})=>tg("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:t||"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...r,children:tg("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});import{jsx as rg,jsxs as x5}from"react/jsx-runtime";var wn=e=>{let[t,r]=S5(!1);return x5(P5,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?rg(ga,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):rg(Im,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},P5=A5.button`
1324
1324
  display: flex;
1325
1325
  align-items: center;
1326
1326
  gap: 6px;
@@ -1358,7 +1358,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1358
1358
  width: 14px;
1359
1359
  height: 14px;
1360
1360
  }
1361
- `;import{useState as b5}from"react";import E5 from"styled-components";import{jsx as S5}from"react/jsx-runtime";var wc=e=>{let[t,r]=b5(!1);return S5(T5,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},T5=E5.a`
1361
+ `;import{useState as R5}from"react";import k5 from"styled-components";import{jsx as M5}from"react/jsx-runtime";var xc=e=>{let[t,r]=R5(!1);return M5(_5,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},_5=k5.a`
1362
1362
  display: flex;
1363
1363
  align-items: center;
1364
1364
  gap: 6px;
@@ -1396,7 +1396,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1396
1396
  width: 14px;
1397
1397
  height: 14px;
1398
1398
  }
1399
- `;import A5 from"qrcode";import P5 from"react";import x5 from"styled-components";import{jsx as qy}from"react/jsx-runtime";var zy=()=>qy("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:qy("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});import{Fragment as ds,jsx as qt,jsxs as Ky}from"react/jsx-runtime";var Er=7,_p=(e,t,r,o,n)=>{for(let i=t;i<t+o;i++)for(let a=r;a<r+n;a++){let l=e?.[a];l&&l[i]&&(l[i]=0)}return e},R5=(e,t)=>{let r=A5.create(e,{errorCorrectionLevel:t}).modules,o=Fu(Array.from(r.data),r.size);return o=_p(o,0,0,Er,Er),o=_p(o,o.length-Er,0,Er,Er),o=_p(o,0,o.length-Er,Er,Er),o},k5=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>qt(ds,{children:[0,1,2].map(i=>qt("circle",{r:r*(Er-i*2)/2,cx:e+r*Er/2,cy:t+r*Er/2,fill:i%2!==0?o:n},`finder-${e}-${t}-${i}`))}),_5=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-Er)*e,0],[0,(t-Er)*e]];return qt(ds,{children:n.map(([i,a])=>qt(k5,{x:i,y:a,cellSize:e,bgColor:r,fgColor:o},`finder-${i}-${a}`))})},M5=({matrix:e,cellSize:t,color:r})=>qt(ds,{children:e.map((i,a)=>i.map((l,s)=>l?qt("rect",{height:t-.2*2,width:t-.2*2,x:a*t+t*(.2/2),y:s*t+t*(.2/2),rx:t*.5,ry:t*.5,fill:r},`cell-${a}-${s}`):qt(P5.Fragment,{},`circle-${a}-${s}`)))}),I5=({cellSize:e,matrixSize:t,element:r,sizePercentage:o,bgColor:n})=>{if(!r)return qt(ds,{});let i=t*(o||.14),a=Math.floor(t/2-i/2),l=Math.floor(t/2+i/2);(l-a)%2!==t%2&&(l+=1);let s=(l-a)*e,d=.1,m=s-s*d*2,f=r,u=a*e;return Ky(ds,{children:[qt("rect",{x:a*e,y:a*e,width:s,height:s,fill:n}),qt(f,{x:u+s*d,y:u+s*d,height:m,width:m})]})},W5=e=>{let t=e.outputSize,r=R5(e.url,e.errorCorrectionLevel),o=t/r.length,n=zu(o*2,{min:t*.025,max:t*.036});return Ky("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%",padding:`${n}px`},children:[qt(M5,{matrix:r,cellSize:o,color:e.fgColor}),qt(_5,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),qt(I5,{cellSize:o,element:e.logo?.element,bgColor:e.bgColor,matrixSize:r.length})]})},L5=x5.div`
1399
+ `;import I5 from"qrcode";import W5 from"react";import L5 from"styled-components";import{jsx as og}from"react/jsx-runtime";var ng=()=>og("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:og("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});import{Fragment as ys,jsx as Bt,jsxs as ig}from"react/jsx-runtime";var wr=7,Bp=(e,t,r,o,n)=>{for(let i=t;i<t+o;i++)for(let a=r;a<r+n;a++){let l=e?.[a];l&&l[i]&&(l[i]=0)}return e},N5=(e,t)=>{let r=I5.create(e,{errorCorrectionLevel:t}).modules,o=Ju(Array.from(r.data),r.size);return o=Bp(o,0,0,wr,wr),o=Bp(o,o.length-wr,0,wr,wr),o=Bp(o,0,o.length-wr,wr,wr),o},O5=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>Bt(ys,{children:[0,1,2].map(i=>Bt("circle",{r:r*(wr-i*2)/2,cx:e+r*wr/2,cy:t+r*wr/2,fill:i%2!==0?o:n},`finder-${e}-${t}-${i}`))}),D5=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-wr)*e,0],[0,(t-wr)*e]];return Bt(ys,{children:n.map(([i,a])=>Bt(O5,{x:i,y:a,cellSize:e,bgColor:r,fgColor:o},`finder-${i}-${a}`))})},U5=({matrix:e,cellSize:t,color:r})=>Bt(ys,{children:e.map((i,a)=>i.map((l,s)=>l?Bt("rect",{height:t-.2*2,width:t-.2*2,x:a*t+t*(.2/2),y:s*t+t*(.2/2),rx:t*.5,ry:t*.5,fill:r},`cell-${a}-${s}`):Bt(W5.Fragment,{},`circle-${a}-${s}`)))}),F5=({cellSize:e,matrixSize:t,element:r,sizePercentage:o,bgColor:n})=>{if(!r)return Bt(ys,{});let i=t*(o||.14),a=Math.floor(t/2-i/2),l=Math.floor(t/2+i/2);(l-a)%2!==t%2&&(l+=1);let s=(l-a)*e,d=.1,u=s-s*d*2,m=r,f=a*e;return ig(ys,{children:[Bt("rect",{x:a*e,y:a*e,width:s,height:s,fill:n}),Bt(m,{x:f+s*d,y:f+s*d,height:u,width:u})]})},B5=e=>{let t=e.outputSize,r=N5(e.url,e.errorCorrectionLevel),o=t/r.length,n=om(o*2,{min:t*.025,max:t*.036});return ig("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%",padding:`${n}px`},children:[Bt(U5,{matrix:r,cellSize:o,color:e.fgColor}),Bt(D5,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),Bt(F5,{cellSize:o,element:e.logo?.element,bgColor:e.bgColor,matrixSize:r.length})]})},H5=L5.div`
1400
1400
  display: flex;
1401
1401
  justify-content: center;
1402
1402
  align-items: center;
@@ -1410,7 +1410,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1410
1410
  border-color: ${e=>e.borderColor};
1411
1411
  border-radius: var(--privy-border-radius-md);
1412
1412
  }
1413
- `,gn=e=>{let{appearance:t}=Ve(),r=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",n=e.size||160,i=t.palette.colorScheme==="dark"?r:o;return qt(L5,{size:n,bgColor:r,fgColor:o,borderColor:i,children:qt(W5,{url:e.url,logo:{element:e.squareLogoElement??zy},outputSize:n,bgColor:r,fgColor:o,errorCorrectionLevel:e.errorCorrectionLevel||"Q"})})};import{jsx as bc,jsxs as N5}from"react/jsx-runtime";var xo=({style:e,...t})=>N5("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...e},...t,children:[bc("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),bc("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),bc("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),bc("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});import{Fragment as Ec,jsx as We,jsxs as Ro}from"react/jsx-runtime";var Xy="#8a63d2",jy=1e3,U5=jy*2,F5=jy*120,$y=()=>{let{authenticated:e,logout:t,ready:r,user:o}=V(),{lastScreen:n,navigate:i,navigateBack:a,setModalData:l,app:s}=P(),{getAuthFlow:d,loginWithFarcaster:m,closePrivyModal:f,createAnalyticsEvent:u}=_(),[g,v]=Mp(void 0),[C,b]=Mp(!1),[A,k]=Mp(!1),S=O5([]),x=Ne,T=d(),M=T?.meta.connectUri;return Yy(()=>{let D=Date.now(),B=setInterval(async()=>{let K=await T.pollForReady.execute(),Q=Date.now()-D;if(K){clearInterval(B),b(!0);try{await m(),k(!0)}catch(L){let X={retryable:!1,message:"Authentication failed"};if(L?.privyErrorCode==="allowlist_rejected"){i("ALLOWLIST_REJECTION_SCREEN");return}else if(L?.privyErrorCode==="max_accounts_reached"){console.error(new mo(L).toString()),i("USER_LIMIT_REACHED_SCREEN");return}else if(L?.privyErrorCode==="user_does_not_exist"){i("ACCOUNT_NOT_FOUND_SCREEN");return}else L?.privyErrorCode==="linked_to_another_user"?X.detail="This account has already been linked to another user.":L?.privyErrorCode==="invalid_credentials"?(X.retryable=!0,X.detail="Something went wrong. Try again."):L?.privyErrorCode==="too_many_requests"&&(X.detail="Too many requests. Please wait before trying again.");v(X)}}else Q>F5&&(clearInterval(B),v({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},U5);return()=>{clearInterval(B),S.current.forEach(K=>clearTimeout(K))}},[]),Yy(()=>{if(r&&e&&A&&o){if(s?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let B=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},x);return()=>clearTimeout(B)}A&&(Ht(o,s?.embeddedWallets.createOnLogin)?S.current.push(setTimeout(()=>{l({createWallet:{onSuccess:()=>{},onFailure:B=>{console.error(B),u({eventName:"embedded_wallet_creation_failure_logout",payload:{error:B,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},x)):S.current.push(setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),x)))}},[A,r,e,o]),Qy||C?Ro(Ec,{children:[We(R,{backFn:n?a:void 0,onClose:f},"header"),We(ie,{}),D5?We(Ec,{children:Ro(B5,{children:[We(nt,{children:Ro("div",{children:[We(ct,{success:A,fail:!!g}),We(xo,{style:{width:"38px",height:"38px"}})]})}),Ro(Ze,{children:[We(fe,{children:g?g.message:"Sign in with Farcaster"}),We(ye,{children:g?g.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),M&&We(U,{onClick:D=>{D.preventDefault(),window.location.href=M},children:"Open Warpcast app"})]})}):We(Ec,{children:Ro(Zy,{children:[We(nt,{children:Ro("div",{children:[We(ct,{success:A,fail:!!g}),We(xo,{style:{width:"38px",height:"38px"}})]})}),Ro(Ze,{children:[We(fe,{children:g?g.message:"Signing in with Farcaster"}),We(ye,{children:g?g.detail:"This should only take a moment"}),We(St,{children:M&&Qy&&We(wc,{text:"Take me to Warpcast",url:M,color:Xy})})]})]})}),We(J,{})]}):Ro(Ec,{children:[We(R,{backFn:n?a:void 0,onClose:f},"header"),We(ie,{}),We(Zy,{children:Ro("div",{children:[We(fe,{children:"Sign in with Farcaster"}),We(ye,{children:"Scan with your phone's camera to continue."}),We(Ki,{children:M?We(gn,{url:M,size:275,squareLogoElement:xo}):We(dt,{})}),Ro(St,{children:[We(ye,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),M&&We(yn,{text:M,itemName:"link",color:Xy})]})]})}),We(J,{})]})},Zy=Jy.div`
1413
+ `,bn=e=>{let{appearance:t}=Ne(),r=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",n=e.size||160,i=t.palette.colorScheme==="dark"?r:o;return Bt(H5,{size:n,bgColor:r,fgColor:o,borderColor:i,children:Bt(B5,{url:e.url,logo:{element:e.squareLogoElement??ng},outputSize:n,bgColor:r,fgColor:o,errorCorrectionLevel:e.errorCorrectionLevel||"Q"})})};import{jsx as Rc,jsxs as V5}from"react/jsx-runtime";var Ro=({style:e,...t})=>V5("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...e},...t,children:[Rc("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),Rc("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),Rc("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),Rc("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});import{Fragment as kc,jsx as Ie,jsxs as ko}from"react/jsx-runtime";var lg="#8a63d2",pg=1e3,z5=pg*2,K5=pg*120,ug=()=>{let{authenticated:e,logout:t,ready:r,user:o}=V(),{lastScreen:n,navigate:i,navigateBack:a,setModalData:l,app:s}=R(),{getAuthFlow:d,loginWithFarcaster:u,closePrivyModal:m,createAnalyticsEvent:f}=I(),[y,b]=Hp(void 0),[C,w]=Hp(!1),[A,k]=Hp(!1),T=G5([]),P=Le,S=d(),M=S?.meta.connectUri;return ag(()=>{let N=Date.now(),H=setInterval(async()=>{let x=await S.pollForReady.execute(),K=Date.now()-N;if(x){clearInterval(H),w(!0);try{await u(),k(!0)}catch(W){let Q={retryable:!1,message:"Authentication failed"};if(W?.privyErrorCode==="allowlist_rejected"){i("ALLOWLIST_REJECTION_SCREEN");return}else if(W?.privyErrorCode==="max_accounts_reached"){console.error(new fo(W).toString()),i("USER_LIMIT_REACHED_SCREEN");return}else if(W?.privyErrorCode==="user_does_not_exist"){i("ACCOUNT_NOT_FOUND_SCREEN");return}else W?.privyErrorCode==="linked_to_another_user"?Q.detail="This account has already been linked to another user.":W?.privyErrorCode==="invalid_credentials"?(Q.retryable=!0,Q.detail="Something went wrong. Try again."):W?.privyErrorCode==="too_many_requests"&&(Q.detail="Too many requests. Please wait before trying again.");b(Q)}}else K>K5&&(clearInterval(H),b({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},z5);return()=>{clearInterval(H),T.current.forEach(x=>clearTimeout(x))}},[]),ag(()=>{if(r&&e&&A&&o){if(s?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let H=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},P);return()=>clearTimeout(H)}A&&(bt(o,s?.embeddedWallets.createOnLogin)?T.current.push(setTimeout(()=>{l({createWallet:{onSuccess:()=>{},onFailure:H=>{console.error(H),f({eventName:"embedded_wallet_creation_failure_logout",payload:{error:H,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},P)):T.current.push(setTimeout(()=>m({shouldCallAuthOnSuccess:!0,isSuccess:!0}),P)))}},[A,r,e,o]),sg||C?ko(kc,{children:[Ie(_,{backFn:n?a:void 0,onClose:m},"header"),Ie(re,{}),q5?Ie(kc,{children:ko(Y5,{children:[Ie(rt,{children:ko("div",{children:[Ie(st,{success:A,fail:!!y}),Ie(Ro,{style:{width:"38px",height:"38px"}})]})}),ko(je,{children:[Ie(me,{children:y?y.message:"Sign in with Farcaster"}),Ie(he,{children:y?y.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),M&&Ie(F,{onClick:N=>{N.preventDefault(),window.location.href=M},children:"Open Warpcast app"})]})}):Ie(kc,{children:ko(cg,{children:[Ie(rt,{children:ko("div",{children:[Ie(st,{success:A,fail:!!y}),Ie(Ro,{style:{width:"38px",height:"38px"}})]})}),ko(je,{children:[Ie(me,{children:y?y.message:"Signing in with Farcaster"}),Ie(he,{children:y?y.detail:"This should only take a moment"}),Ie(Tt,{children:M&&sg&&Ie(xc,{text:"Take me to Warpcast",url:M,color:lg})})]})]})}),Ie(J,{})]}):ko(kc,{children:[Ie(_,{backFn:n?a:void 0,onClose:m},"header"),Ie(re,{}),Ie(cg,{children:ko("div",{children:[Ie(me,{children:"Sign in with Farcaster"}),Ie(he,{children:"Scan with your phone's camera to continue."}),Ie(ea,{children:M?Ie(bn,{url:M,size:275,squareLogoElement:Ro}):Ie(lt,{})}),ko(Tt,{children:[Ie(he,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),M&&Ie(wn,{text:M,itemName:"link",color:lg})]})]})}),Ie(J,{})]})},cg=dg.div`
1414
1414
  display: flex;
1415
1415
  flex-direction: column;
1416
1416
  align-items: center;
@@ -1418,14 +1418,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1418
1418
  margin-left: 27px;
1419
1419
  margin-right: 27px;
1420
1420
  gap: 24px;
1421
- `,B5=Jy.div`
1421
+ `,Y5=dg.div`
1422
1422
  display: flex;
1423
1423
  flex-direction: column;
1424
1424
  align-items: center;
1425
1425
  justify-content: center;
1426
1426
  gap: 24px;
1427
1427
  width: 100%;
1428
- `;import{useEffect as H5,useRef as V5,useState as Ip}from"react";import{isIOS as G5,isMobile as eg}from"react-device-detect";import og from"styled-components";import{Fragment as Tc,jsx as Ue,jsxs as ao}from"react/jsx-runtime";var tg="#8a63d2",ng=1e3,q5=ng*2,z5=ng*300,ig=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=P(),{requestFarcasterSignerStatus:n,closePrivyModal:i}=_(),[a,l]=Ip(void 0),[s,d]=Ip(!1),[m,f]=Ip(!1),u=V5([]),g=Ne,v=r?.farcasterSigner;H5(()=>{let b=Date.now(),A=setInterval(async()=>{if(!v?.public_key){clearInterval(A),l({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}v.status==="approved"&&(clearInterval(A),d(!1),f(!0),u.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),g)));let k=await n(v?.public_key),S=Date.now()-b;k.status==="approved"?(clearInterval(A),d(!1),f(!0),u.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),g))):S>z5?(clearInterval(A),l({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):k.status==="revoked"&&(clearInterval(A),l({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},q5);return()=>{clearInterval(A),u.current.forEach(k=>clearTimeout(k))}},[]);let C=v?.status==="pending_approval"?v.signer_approval_url:void 0;return eg||s?ao(Tc,{children:[Ue(R,{backFn:e?t:void 0,onClose:i},"header"),Ue(ie,{}),G5?Ue(Tc,{children:ao(K5,{children:[Ue(nt,{children:ao("div",{children:[Ue(ct,{success:m,fail:!!a}),Ue(xo,{style:{width:"38px",height:"38px"}})]})}),ao(Ze,{children:[Ue(fe,{children:a?a.message:"Add a signer to Farcaster"}),Ue(ye,{children:a?a.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),C&&Ue(U,{onClick:b=>{b.preventDefault(),window.location.href=C},children:"Open Warpcast app"})]})}):Ue(Tc,{children:ao(rg,{children:[Ue(nt,{children:ao("div",{children:[Ue(ct,{success:m,fail:!!a}),Ue(xo,{style:{width:"38px",height:"38px"}})]})}),ao(Ze,{children:[Ue(fe,{children:a?a.message:"Requesting signer from Farcaster"}),Ue(ye,{children:a?a.detail:"This should only take a moment"}),Ue(St,{children:C&&eg&&Ue(wc,{text:"Take me to Warpcast",url:C,color:tg})})]})]})}),Ue(J,{})]}):ao(Tc,{children:[Ue(R,{backFn:e?t:void 0,onClose:i},"header"),Ue(ie,{}),Ue(rg,{children:ao("div",{children:[Ue(fe,{children:"Add a signer to Farcaster"}),ao(ye,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),Ue(Ki,{children:v?.status==="pending_approval"?Ue(gn,{url:v.signer_approval_url,size:275,squareLogoElement:xo}):Ue(dt,{})}),ao(St,{children:[Ue(ye,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),v?.status==="pending_approval"&&Ue(yn,{text:v.signer_approval_url,itemName:"link",color:tg})]})]})}),Ue(J,{})]})},rg=og.div`
1428
+ `;import{useEffect as Q5,useRef as X5,useState as Vp}from"react";import{isIOS as Z5,isMobile as mg}from"react-device-detect";import yg from"styled-components";import{Fragment as _c,jsx as Ue,jsxs as io}from"react/jsx-runtime";var fg="#8a63d2",gg=1e3,J5=gg*2,j5=gg*300,Cg=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=R(),{requestFarcasterSignerStatus:n,closePrivyModal:i}=I(),[a,l]=Vp(void 0),[s,d]=Vp(!1),[u,m]=Vp(!1),f=X5([]),y=Le,b=r?.farcasterSigner;Q5(()=>{let w=Date.now(),A=setInterval(async()=>{if(!b?.public_key){clearInterval(A),l({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}b.status==="approved"&&(clearInterval(A),d(!1),m(!0),f.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),y)));let k=await n(b?.public_key),T=Date.now()-w;k.status==="approved"?(clearInterval(A),d(!1),m(!0),f.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),y))):T>j5?(clearInterval(A),l({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):k.status==="revoked"&&(clearInterval(A),l({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},J5);return()=>{clearInterval(A),f.current.forEach(k=>clearTimeout(k))}},[]);let C=b?.status==="pending_approval"?b.signer_approval_url:void 0;return mg||s?io(_c,{children:[Ue(_,{backFn:e?t:void 0,onClose:i},"header"),Ue(re,{}),Z5?Ue(_c,{children:io($5,{children:[Ue(rt,{children:io("div",{children:[Ue(st,{success:u,fail:!!a}),Ue(Ro,{style:{width:"38px",height:"38px"}})]})}),io(je,{children:[Ue(me,{children:a?a.message:"Add a signer to Farcaster"}),Ue(he,{children:a?a.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),C&&Ue(F,{onClick:w=>{w.preventDefault(),window.location.href=C},children:"Open Warpcast app"})]})}):Ue(_c,{children:io(hg,{children:[Ue(rt,{children:io("div",{children:[Ue(st,{success:u,fail:!!a}),Ue(Ro,{style:{width:"38px",height:"38px"}})]})}),io(je,{children:[Ue(me,{children:a?a.message:"Requesting signer from Farcaster"}),Ue(he,{children:a?a.detail:"This should only take a moment"}),Ue(Tt,{children:C&&mg&&Ue(xc,{text:"Take me to Warpcast",url:C,color:fg})})]})]})}),Ue(J,{})]}):io(_c,{children:[Ue(_,{backFn:e?t:void 0,onClose:i},"header"),Ue(re,{}),Ue(hg,{children:io("div",{children:[Ue(me,{children:"Add a signer to Farcaster"}),io(he,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),Ue(ea,{children:b?.status==="pending_approval"?Ue(bn,{url:b.signer_approval_url,size:275,squareLogoElement:Ro}):Ue(lt,{})}),io(Tt,{children:[Ue(he,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),b?.status==="pending_approval"&&Ue(wn,{text:b.signer_approval_url,itemName:"link",color:fg})]})]})}),Ue(J,{})]})},hg=yg.div`
1429
1429
  display: flex;
1430
1430
  flex-direction: column;
1431
1431
  align-items: center;
@@ -1433,14 +1433,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1433
1433
  margin-left: 27px;
1434
1434
  margin-right: 27px;
1435
1435
  gap: 24px;
1436
- `,K5=og.div`
1436
+ `,$5=yg.div`
1437
1437
  display: flex;
1438
1438
  flex-direction: column;
1439
1439
  align-items: center;
1440
1440
  justify-content: center;
1441
1441
  gap: 24px;
1442
1442
  width: 100%;
1443
- `;import Q6 from"@heroicons/react/24/outline/CheckCircleIcon";import{useEffect as Cn,useState as Qt}from"react";import{createPublicClient as Xg,createWalletClient as X6,custom as Z6,encodeFunctionData as J6,http as Zg,parseEther as j6,publicActions as $6}from"viem";import{jsx as Y5}from"react/jsx-runtime";function Wt({title:e}){let{currentScreen:t,navigateBack:r,navigate:o,data:n}=P(),i;return t==="FUNDING_MANUAL_TRANSFER_SCREEN"?i=r:t===n?.funding?.methodScreen?n.funding.comingFromSendTransactionScreen?i=()=>o("EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"):i=void 0:i=n?.funding?.methodScreen?()=>o(n.funding.methodScreen):void 0,Y5(R,{title:e,backFn:i})}import Sc from"styled-components";import{jsx as Wp,jsxs as j5}from"react/jsx-runtime";var pa=({size:e})=>Wp(Q5,{$size:e,children:j5(X5,{children:[Wp(Z5,{}),Wp(J5,{})]})}),Q5=Sc.div`
1443
+ `;import t7 from"@heroicons/react/24/outline/CheckCircleIcon";import{useEffect as En,useState as qt}from"react";import{createPublicClient as l1,createWalletClient as r7,custom as o7,encodeFunctionData as n7,http as c1,parseEther as i7,publicActions as a7}from"viem";import{jsx as e6}from"react/jsx-runtime";function Mt({title:e}){let{currentScreen:t,navigateBack:r,navigate:o,data:n}=R(),i;return t==="FUNDING_MANUAL_TRANSFER_SCREEN"?i=r:t===n?.funding?.methodScreen?n.funding.comingFromSendTransactionScreen?i=()=>o("EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"):i=void 0:i=n?.funding?.methodScreen?()=>o(n.funding.methodScreen):void 0,e6(_,{title:e,backFn:i})}import Mc from"styled-components";import{jsx as Gp,jsxs as i6}from"react/jsx-runtime";var Ca=({size:e})=>Gp(t6,{$size:e,children:i6(r6,{children:[Gp(o6,{}),Gp(n6,{})]})}),t6=Mc.div`
1444
1444
  --spinner-size: ${e=>e.$size?e.$size:"96px"};
1445
1445
 
1446
1446
  display: flex;
@@ -1451,14 +1451,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1451
1451
  @media all and (display-mode: standalone) {
1452
1452
  margin-bottom: 30px;
1453
1453
  }
1454
- `,X5=Sc.div`
1454
+ `,r6=Mc.div`
1455
1455
  position: relative;
1456
1456
  height: var(--spinner-size);
1457
1457
  width: var(--spinner-size);
1458
1458
 
1459
1459
  opacity: 1;
1460
1460
  animation: fadein 200ms ease;
1461
- `,Z5=Sc.div`
1461
+ `,o6=Mc.div`
1462
1462
  position: absolute;
1463
1463
  top: 0;
1464
1464
  right: 0;
@@ -1471,7 +1471,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1471
1471
  border: 4px solid #f1f2f9;
1472
1472
  border-radius: 50%;
1473
1473
  }
1474
- `,J5=Sc.div`
1474
+ `,n6=Mc.div`
1475
1475
  position: absolute;
1476
1476
  top: 0;
1477
1477
  right: 0;
@@ -1495,22 +1495,22 @@ You will need this password to access your ${e} wallet on a new device. Please k
1495
1495
  transform: rotate(360deg);
1496
1496
  }
1497
1497
  }
1498
- `;function $5(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function Ac(e){let t=e.filter(r=>!cm.has(r.id));return Hd.concat(t)}import{useState as Lp,useEffect as e6}from"react";var ko=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=_(),[n,i]=Lp(!0),[a,l]=Lp(void 0),[s,d]=Lp(void 0);return e6(()=>{let m=e.chainId||Fo,u=Ac(o).find(v=>v.id===Number(m));(async()=>{if(!t){i(!1);return}if(!u){i(!1),l(new Error(`Unable to fetch token price on chain id ${m}`));return}try{i(!0);let v=await r(u);v?d(v):l(new Error(`Unable to fetch token price on chain id ${u.id}`))}catch(v){l(v)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};var ps=[{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];var Pc=({amount:e,decimals:t})=>Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(e/10n**BigInt(t));var ag="0x0000000000000000000000000000000000000000",sg=({destinationCurrency:e,...t})=>({tradeType:"EXACT_OUTPUT",originCurrency:ag,destinationCurrency:e??ag,...t}),t6="https://api.testnets.relay.link/execute/swap",r6="https://api.relay.link/execute/swap",lg=async({input:e,isTestnet:t})=>{let r=await fetch(t?t6:r6,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),o=await r.json();if(!r.ok&&(typeof o.message!="string"||!o.message.startsWith("Invalid address")))throw console.error("Relay error:",o),new Error(o.message??"Error fetching quote from relay");return o},cg=e=>{let t=e.steps[0]?.items?.[0];if(t)return{from:t.data.from,to:t.data.to,value:Number(t.data.value),chainId:Number(t.data.chainId),data:t.data.data}};import{createPublicClient as o6,http as n6}from"viem";var dg=({chains:e,appId:t,address:r,rpcConfig:o})=>Promise.all(e.map(async n=>({balance:await o6({chain:n,transport:n6(Uo(n,o,t))}).getBalance({address:r}).catch(()=>0n),chain:n})));import{createPublicClient as i6,http as a6}from"viem";var pg=async({chain:e,address:t,appId:r,rpcConfig:o,erc20Address:n})=>({balance:await i6({chain:e,transport:a6(Uo(e,o,r))}).readContract({address:n,abi:s6,functionName:"balanceOf",args:[t]}).catch(()=>0n),chain:e}),s6=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];import ug from"styled-components";var xc=ug.span`
1498
+ `;function a6(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function Ic(e){let t=e.filter(r=>!bm.has(r.id));return Xd.concat(t)}import{useState as qp,useEffect as s6}from"react";var _o=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=I(),[n,i]=qp(!0),[a,l]=qp(void 0),[s,d]=qp(void 0);return s6(()=>{let u=e.chainId||Bo,f=Ic(o).find(b=>b.id===Number(u));(async()=>{if(!t){i(!1);return}if(!f){i(!1),l(new Error(`Unable to fetch token price on chain id ${u}`));return}try{i(!0);let b=await r(f);b?d(b):l(new Error(`Unable to fetch token price on chain id ${f.id}`))}catch(b){l(b)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};var gs=[{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];var Wc=({amount:e,decimals:t})=>Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(e/10n**BigInt(t));var Jo="sdk_fiat_on_ramp_completed_with_status";var vg="0x0000000000000000000000000000000000000000",wg=({destinationCurrency:e,...t})=>({tradeType:"EXACT_OUTPUT",originCurrency:vg,destinationCurrency:e??vg,...t}),l6="https://api.testnets.relay.link/execute/swap",c6="https://api.relay.link/execute/swap",bg=async({input:e,isTestnet:t})=>{let r=await fetch(t?l6:c6,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),o=await r.json();if(!r.ok&&(typeof o.message!="string"||!o.message.startsWith("Invalid address")))throw console.error("Relay error:",o),new Error(o.message??"Error fetching quote from relay");return o},Eg=e=>{let t=e.steps[0]?.items?.[0];if(t)return{from:t.data.from,to:t.data.to,value:Number(t.data.value),chainId:Number(t.data.chainId),data:t.data.data}};import{createPublicClient as d6,http as p6}from"viem";var Tg=({chains:e,appId:t,address:r,rpcConfig:o})=>Promise.all(e.map(async n=>({balance:await d6({chain:n,transport:p6(Fo(n,o,t))}).getBalance({address:r}).catch(()=>0n),chain:n})));import{createPublicClient as u6,http as m6}from"viem";var Sg=async({chain:e,address:t,appId:r,rpcConfig:o,erc20Address:n})=>({balance:await u6({chain:e,transport:m6(Fo(e,o,r))}).readContract({address:n,abi:f6,functionName:"balanceOf",args:[t]}).catch(()=>0n),chain:e}),f6=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];import Ag from"styled-components";var Lc=Ag.span`
1499
1499
  display: flex;
1500
1500
  flex-direction: column;
1501
1501
  gap: 0.35rem;
1502
1502
  width: 100%;
1503
- `,Lt=ug.span`
1503
+ `,It=Ag.span`
1504
1504
  display: flex;
1505
1505
  width: 100%;
1506
1506
  justify-content: space-between;
1507
1507
  gap: 0.5rem;
1508
- `;import l6 from"styled-components";var Nt=l6.span`
1508
+ `;import h6 from"styled-components";var Wt=h6.span`
1509
1509
  color: var(--privy-color-foreground-3);
1510
1510
  font-size: 0.875rem;
1511
1511
  font-weight: 400;
1512
1512
  line-height: 1.375rem; /* 157.143% */
1513
- `;import _g from"styled-components";import c6 from"styled-components";var zt=c6.span`
1513
+ `;import Gg from"styled-components";import y6 from"styled-components";var Ht=y6.span`
1514
1514
  color: var(--privy-color-foreground);
1515
1515
  font-size: 0.875rem;
1516
1516
  font-weight: 500;
@@ -1518,21 +1518,21 @@ You will need this password to access your ${e} wallet on a new device. Please k
1518
1518
  word-break: break-all;
1519
1519
  text-align: right;
1520
1520
 
1521
- ${ym}
1522
- `;import h6 from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as Kt,jsxs as Rc}from"react/jsx-runtime";var mg=e=>Kt("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...e,children:Kt("g",{id:"Layer_x0020_1",children:Rc("g",{id:"_2405588477232",children:[Kt("rect",{fill:"none",width:"2500",height:"2500"}),Kt("g",{children:Rc("g",{children:[Kt("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),Kt("g",{children:Rc("g",{children:[Kt("g",{children:Kt("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),Kt("g",{children:Kt("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),Kt("g",{children:Kt("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),Kt("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),Rc("g",{children:[Kt("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),Kt("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})});import{jsx as fg,jsxs as d6}from"react/jsx-runtime";var hg=e=>d6("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[fg("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),fg("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]});import{jsx as yg,jsxs as p6}from"react/jsx-runtime";var gg=e=>p6("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[yg("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),yg("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]});import{jsx as Cg}from"react/jsx-runtime";var vg=e=>Cg("svg",{version:"1.1",id:"Symbol",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlSpace:"preserve",x:"0px",y:"0px",viewBox:"0 0 384 383",enableBackground:"new 0 0 384 383;",...e,children:Cg("path",{d:`M383.5,0H0.5v383h383V249.3h-63.6C298,298.1,248.7,332,192.3,332c-77.8,0-140.8-63.6-140.8-140.8
1523
- C51.4,114,114.5,51,192.3,51C249.8,51,299.1,86,321,135.9h62.5V0z`})});import{jsx as ua,jsxs as wg}from"react/jsx-runtime";var bg=e=>wg("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[ua("rect",{width:"199.4",height:"207.623",fill:"#121212"}),wg("g",{"clip-path":"url(#clip0_2303_643)",children:[ua("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),ua("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),ua("defs",{children:ua("clipPath",{id:"clip0_2303_643",children:ua("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]});import{jsx as us,jsxs as u6}from"react/jsx-runtime";var Eg=e=>u6("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...e,children:[us("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),us("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),us("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),us("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),us("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]});import{jsx as Np,jsxs as m6}from"react/jsx-runtime";var Tg=e=>m6("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Np("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),Np("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),Np("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]});import{jsx as Sg,jsxs as f6}from"react/jsx-runtime";var Ag=e=>f6("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Sg("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),Sg("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]});import{jsx as kc,jsxs as Pg}from"react/jsx-runtime";var xg=e=>Pg("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[kc("rect",{width:"30",height:"30",fill:"url(#pattern0)"}),Pg("defs",{children:[kc("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:kc("use",{xlinkHref:"#image0_1_18",transform:"scale(0.00041841)"})}),kc("image",{id:"image0_1_18",width:"2390",height:"2390",xlinkHref:"data:image/png;base64,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"})]})]});import{jsx as Rg}from"react/jsx-runtime";var y6={[Zr.id]:mg,[el.id]:hg,[Wr.id]:gg,[tl.id]:vg,[nm.id]:bg,[Lr.id]:Eg,[fo.id]:Tg,[Nr.id]:Ag,[lm.id]:xg},ma=({chainId:e,...t})=>{let r=y6[e];return r?Rg(r,{...t}):Rg(h6,{...t})};import{Fragment as v6,jsx as ms,jsxs as kg}from"react/jsx-runtime";var Mg=({balance:e,className:t,chain:r})=>ms(vm,{className:t,$state:void 0,children:ms(_c,{balance:e,chain:r})}),_c=({balance:e,chain:t})=>kg(v6,{children:[kg(g6,{children:[ms(C6,{chainId:t.id}),ms(zt,{children:t.name})]}),ms(er,{isLoading:!1,isPulsing:!1,color:"gray",children:e})]}),g6=_g.div`
1521
+ ${Rm}
1522
+ `;import E6 from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as Vt,jsxs as Nc}from"react/jsx-runtime";var Pg=e=>Vt("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...e,children:Vt("g",{id:"Layer_x0020_1",children:Nc("g",{id:"_2405588477232",children:[Vt("rect",{fill:"none",width:"2500",height:"2500"}),Vt("g",{children:Nc("g",{children:[Vt("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),Vt("g",{children:Nc("g",{children:[Vt("g",{children:Vt("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),Vt("g",{children:Vt("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),Vt("g",{children:Vt("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),Vt("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),Nc("g",{children:[Vt("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),Vt("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})});import{jsx as xg,jsxs as g6}from"react/jsx-runtime";var Rg=e=>g6("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[xg("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),xg("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]});import{jsx as kg,jsxs as C6}from"react/jsx-runtime";var _g=e=>C6("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[kg("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),kg("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]});import{jsx as Mg}from"react/jsx-runtime";var Ig=e=>Mg("svg",{version:"1.1",id:"Symbol",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlSpace:"preserve",x:"0px",y:"0px",viewBox:"0 0 384 383",enableBackground:"new 0 0 384 383;",...e,children:Mg("path",{d:`M383.5,0H0.5v383h383V249.3h-63.6C298,298.1,248.7,332,192.3,332c-77.8,0-140.8-63.6-140.8-140.8
1523
+ C51.4,114,114.5,51,192.3,51C249.8,51,299.1,86,321,135.9h62.5V0z`})});import{jsx as va,jsxs as Wg}from"react/jsx-runtime";var Lg=e=>Wg("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[va("rect",{width:"199.4",height:"207.623",fill:"#121212"}),Wg("g",{"clip-path":"url(#clip0_2303_643)",children:[va("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),va("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),va("defs",{children:va("clipPath",{id:"clip0_2303_643",children:va("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]});import{jsx as Cs,jsxs as v6}from"react/jsx-runtime";var Ng=e=>v6("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...e,children:[Cs("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),Cs("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),Cs("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),Cs("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),Cs("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]});import{jsx as zp,jsxs as w6}from"react/jsx-runtime";var Og=e=>w6("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[zp("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),zp("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),zp("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]});import{jsx as Dg,jsxs as b6}from"react/jsx-runtime";var Ug=e=>b6("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Dg("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),Dg("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]});import{jsx as Oc,jsxs as Fg}from"react/jsx-runtime";var Bg=e=>Fg("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Oc("rect",{width:"30",height:"30",fill:"url(#pattern0)"}),Fg("defs",{children:[Oc("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:Oc("use",{xlinkHref:"#image0_1_18",transform:"scale(0.00041841)"})}),Oc("image",{id:"image0_1_18",width:"2390",height:"2390",xlinkHref:"data:image/png;base64,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"})]})]});import{jsx as Hg}from"react/jsx-runtime";var T6={[Zr.id]:Pg,[il.id]:Rg,[Mr.id]:_g,[al.id]:Ig,[ym.id]:Lg,[Ir.id]:Ng,[ho.id]:Og,[Wr.id]:Ug,[wm.id]:Bg},wa=({chainId:e,...t})=>{let r=T6[e];return r?Hg(r,{...t}):Hg(E6,{...t})};import{Fragment as P6,jsx as vs,jsxs as Vg}from"react/jsx-runtime";var qg=({balance:e,className:t,chain:r})=>vs(Mm,{className:t,$state:void 0,children:vs(Dc,{balance:e,chain:r})}),Dc=({balance:e,chain:t})=>Vg(P6,{children:[Vg(S6,{children:[vs(A6,{chainId:t.id}),vs(Ht,{children:t.name})]}),vs(jt,{isLoading:!1,isPulsing:!1,color:"gray",children:e})]}),S6=Gg.div`
1524
1524
  display: flex;
1525
1525
  align-items: center;
1526
- `,C6=_g(ma)`
1526
+ `,A6=Gg(wa)`
1527
1527
  height: 1.25rem;
1528
1528
  width: 1.25rem;
1529
1529
  display: inline-block;
1530
1530
  margin-right: 0.5rem;
1531
1531
  border-radius: 4px;
1532
- `;import{Menu as Mc}from"@headlessui/react";import{ChevronDownIcon as w6}from"@heroicons/react/24/outline";import hs from"styled-components";import{jsx as fs,jsxs as Ig}from"react/jsx-runtime";var Wg=({options:e,onSelect:t,selected:r,className:o})=>Ig(Mc,{as:b6,children:[Ig(Mc.Button,{as:S6,children:[fs(_c,{balance:r.balance,chain:r.chain}),fs(Op,{height:16})]}),fs(Mc.Items,{as:E6,className:o,anchor:"bottom",children:e.map((n,i)=>fs(Mc.Item,{as:T6,onClick:()=>t(i),children:fs(_c,{balance:n.balance,chain:n.chain})},i))})]}),b6=hs.div`
1532
+ `;import{Menu as Uc}from"@headlessui/react";import{ChevronDownIcon as x6}from"@heroicons/react/24/outline";import bs from"styled-components";import{jsx as ws,jsxs as zg}from"react/jsx-runtime";var Kg=({options:e,onSelect:t,selected:r,className:o})=>zg(Uc,{as:R6,children:[zg(Uc.Button,{as:M6,children:[ws(Dc,{balance:r.balance,chain:r.chain}),ws(Kp,{height:16})]}),ws(Uc.Items,{as:k6,className:o,anchor:"bottom",children:e.map((n,i)=>ws(Uc.Item,{as:_6,onClick:()=>t(i),children:ws(Dc,{balance:n.balance,chain:n.chain})},i))})]}),R6=bs.div`
1533
1533
  width: 100%;
1534
1534
  position: relative;
1535
- `,E6=hs.div`
1535
+ `,k6=bs.div`
1536
1536
  width: 100%;
1537
1537
  margin-top: 0.5rem;
1538
1538
  position: absolute;
@@ -1546,7 +1546,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1546
1546
  }
1547
1547
 
1548
1548
  z-index: 1;
1549
- `,T6=hs.button`
1549
+ `,_6=bs.button`
1550
1550
  width: 100%;
1551
1551
  display: flex;
1552
1552
  justify-content: space-between;
@@ -1562,27 +1562,27 @@ You will need this password to access your ${e} wallet on a new device. Please k
1562
1562
  :hover {
1563
1563
  background: var(--privy-color-background-2);
1564
1564
  }
1565
- `,Op=hs(w6)`
1565
+ `,Kp=bs(x6)`
1566
1566
  height: 1rem;
1567
1567
  margin-left: 0.5rem;
1568
- `,S6=hs.button`
1569
- ${Cm}
1568
+ `,M6=bs.button`
1569
+ ${_m}
1570
1570
 
1571
1571
  /* Push the chip all the way to the right */
1572
1572
  span {
1573
1573
  margin-left: auto;
1574
1574
  }
1575
1575
 
1576
- ${Op} {
1576
+ ${Kp} {
1577
1577
  transition: rotate 100ms ease-in;
1578
1578
  }
1579
1579
 
1580
1580
  &[aria-expanded='true'] {
1581
- ${Op} {
1581
+ ${Kp} {
1582
1582
  rotate: -180deg;
1583
1583
  }
1584
1584
  }
1585
- `;import Kr,{keyframes as V6}from"styled-components";import A6 from"@heroicons/react/24/outline/ClockIcon";import P6 from"@heroicons/react/24/outline/TrashIcon";import x6 from"@heroicons/react/24/solid/CheckBadgeIcon";import R6 from"@heroicons/react/24/solid/CheckCircleIcon";import k6 from"@heroicons/react/24/solid/LockClosedIcon";import{useEffect as _6,useState as ys}from"react";import zr,{css as Ug}from"styled-components";import{jsx as Lg}from"react/jsx-runtime";var ai=({style:e,...t})=>Lg("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:Lg("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});import{jsx as Ke,jsxs as Ng}from"react/jsx-runtime";var si=({style:e,...t})=>Ng("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},xmlns:"http://www.w3.org/2000/svg",...t,children:[Ng("g",{clipPath:"url(#clip0_113_33841)",children:[Ke("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),Ke("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),Ke("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),Ke("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),Ke("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),Ke("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),Ke("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),Ke("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),Ke("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),Ke("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),Ke("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),Ke("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),Ke("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),Ke("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),Ke("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),Ke("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),Ke("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),Ke("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),Ke("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),Ke("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),Ke("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),Ke("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),Ke("defs",{children:Ke("clipPath",{id:"clip0_113_33841",children:Ke("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});import{Fragment as Dp,jsx as we,jsxs as pr}from"react/jsx-runtime";var Og=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=ys([]),a=t?e.length:2,l=d=>d.authenticatorName?d.createdWithBrowser?`${d.authenticatorName} on ${d.createdWithBrowser}`:d.authenticatorName:d.createdWithBrowser?d.createdWithOs?`${d.createdWithBrowser} on ${d.createdWithOs}`:`${d.createdWithBrowser}`:"Unknown device",s=async d=>{i(m=>m.concat([d])),await r(d),i(m=>m.filter(f=>f!==d))};return pr("div",{children:[we(O6,{children:"Your passkeys"}),pr(Bg,{children:[e.slice(0,a).map(d=>pr(F6,{children:[pr("div",{children:[we(D6,{children:l(d)}),pr(U6,{children:["Last used: ",(d.latestVerifiedAt??d.verifiedAt).toLocaleString()]})]}),we(H6,{disabled:n.includes(d.credentialId),onClick:()=>s(d.credentialId),children:n.includes(d.credentialId)?we(bo,{}):we(P6,{height:"1.6em"})})]},d.credentialId)),e.length>2&&!t&&we(Up,{onClick:o,children:"View all"})]})]})},M6=()=>pr(Bg,{children:[pr(sr,{children:[we(ar,{children:we(x6,{})}),"Log in with Touch ID, Face ID, or a security key."]}),pr(sr,{children:[we(ar,{children:we(k6,{})}),"More secure than a password."]}),pr(sr,{children:[we(ar,{children:we(A6,{})}),"Takes seconds to set up and use."]})]}),Fg=()=>{let{user:e,unlinkPasskey:t}=V(),{linkWithPasskey:r,closePrivyModal:o}=_(),n=e?.linkedAccounts.filter(C=>C.type==="passkey"),[i,a]=ys(!1),[l,s]=ys(""),[d,m]=ys(!1),[f,u]=ys(!1);_6(()=>{n.length===0&&u(!1)},[n.length]);let g=()=>{a(!0),r().then(()=>m(!0)).catch(C=>{if(C instanceof $t){if(C.privyErrorCode==="cannot_link_more_of_type"){s("Cannot link more passkeys to account.");return}else if(C.privyErrorCode==="passkey_not_allowed"){s("Passkey request timed out or rejected by user.");return}}s("Unknown error occurred.")}).finally(()=>{a(!1)})},v=async C=>(a(!0),await t(C).then(()=>m(!0)).catch(b=>{if(b instanceof $t&&b.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{a(!1)}));return d?pr(Dp,{children:[we(R,{onClose:()=>o()},"header"),we(Be,{children:we(et,{status:"success",children:we(R6,{})})}),we(Dg,{children:"Passkey added"}),we(L6,{children:"From now on, you can use your passkey to log in."}),we(_t,{children:we(U,{onClick:()=>o(),children:"Done"})}),we(J,{})]}):f?pr(Dp,{children:[we(R,{backFn:()=>u(!1),onClose:()=>o()},"header"),we(Og,{passkeys:n,expanded:f,onUnlink:v,onExpand:()=>u(!0)}),we(J,{})]}):pr(Dp,{children:[we(R,{onClose:()=>o()},"header"),we(Be,{children:pr(Ic,{children:[we(ai,{}),we(si,{})]})}),we(Dg,{children:"Secure your account with a passkey"}),we(N6,{}),n.length===0?we(M6,{}):we(Og,{passkeys:n,expanded:f,onUnlink:v,onExpand:()=>u(!0)}),pr(_t,{style:{marginTop:"12px"},children:[l&&we(I6,{fail:!0,children:l}),we(U,{onClick:g,loading:i,children:"Add new passkey"})]}),we(J,{})]})},Ic=zr.div`
1585
+ `;import qr,{keyframes as X6}from"styled-components";import I6 from"@heroicons/react/24/outline/ClockIcon";import W6 from"@heroicons/react/24/outline/TrashIcon";import L6 from"@heroicons/react/24/solid/CheckBadgeIcon";import N6 from"@heroicons/react/24/solid/CheckCircleIcon";import O6 from"@heroicons/react/24/solid/LockClosedIcon";import{useEffect as D6,useState as Es}from"react";import Gr,{css as Jg}from"styled-components";import{jsx as Yg}from"react/jsx-runtime";var fi=({style:e,...t})=>Yg("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:Yg("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});import{jsx as Ye,jsxs as Qg}from"react/jsx-runtime";var hi=({style:e,...t})=>Qg("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},xmlns:"http://www.w3.org/2000/svg",...t,children:[Qg("g",{clipPath:"url(#clip0_113_33841)",children:[Ye("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),Ye("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),Ye("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),Ye("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),Ye("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),Ye("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),Ye("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),Ye("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),Ye("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),Ye("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),Ye("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),Ye("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),Ye("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),Ye("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),Ye("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),Ye("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),Ye("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),Ye("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),Ye("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),Ye("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),Ye("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),Ye("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),Ye("defs",{children:Ye("clipPath",{id:"clip0_113_33841",children:Ye("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});import{Fragment as Yp,jsx as ve,jsxs as cr}from"react/jsx-runtime";var Xg=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=Es([]),a=t?e.length:2,l=d=>d.authenticatorName?d.createdWithBrowser?`${d.authenticatorName} on ${d.createdWithBrowser}`:d.authenticatorName:d.createdWithBrowser?d.createdWithOs?`${d.createdWithBrowser} on ${d.createdWithOs}`:`${d.createdWithBrowser}`:"Unknown device",s=async d=>{i(u=>u.concat([d])),await r(d),i(u=>u.filter(m=>m!==d))};return cr("div",{children:[ve(G6,{children:"Your passkeys"}),cr($g,{children:[e.slice(0,a).map(d=>cr(K6,{children:[cr("div",{children:[ve(q6,{children:l(d)}),cr(z6,{children:["Last used: ",(d.latestVerifiedAt??d.verifiedAt).toLocaleString()]})]}),ve(Q6,{disabled:n.includes(d.credentialId),onClick:()=>s(d.credentialId),children:n.includes(d.credentialId)?ve(Eo,{}):ve(W6,{height:"1.6em"})})]},d.credentialId)),e.length>2&&!t&&ve(Qp,{onClick:o,children:"View all"})]})]})},U6=()=>cr($g,{children:[cr(ir,{children:[ve(nr,{children:ve(L6,{})}),"Log in with Touch ID, Face ID, or a security key."]}),cr(ir,{children:[ve(nr,{children:ve(O6,{})}),"More secure than a password."]}),cr(ir,{children:[ve(nr,{children:ve(I6,{})}),"Takes seconds to set up and use."]})]}),jg=()=>{let{user:e,unlinkPasskey:t}=V(),{linkWithPasskey:r,closePrivyModal:o}=I(),n=e?.linkedAccounts.filter(C=>C.type==="passkey"),[i,a]=Es(!1),[l,s]=Es(""),[d,u]=Es(!1),[m,f]=Es(!1);D6(()=>{n.length===0&&f(!1)},[n.length]);let y=()=>{a(!0),r().then(()=>u(!0)).catch(C=>{if(C instanceof Jt){if(C.privyErrorCode==="cannot_link_more_of_type"){s("Cannot link more passkeys to account.");return}else if(C.privyErrorCode==="passkey_not_allowed"){s("Passkey request timed out or rejected by user.");return}}s("Unknown error occurred.")}).finally(()=>{a(!1)})},b=async C=>(a(!0),await t(C).then(()=>u(!0)).catch(w=>{if(w instanceof Jt&&w.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{a(!1)}));return d?cr(Yp,{children:[ve(_,{onClose:()=>o()},"header"),ve(He,{children:ve(et,{status:"success",children:ve(N6,{})})}),ve(Zg,{children:"Passkey added"}),ve(H6,{children:"From now on, you can use your passkey to log in."}),ve(Rt,{children:ve(F,{onClick:()=>o(),children:"Done"})}),ve(J,{})]}):m?cr(Yp,{children:[ve(_,{backFn:()=>f(!1),onClose:()=>o()},"header"),ve(Xg,{passkeys:n,expanded:m,onUnlink:b,onExpand:()=>f(!0)}),ve(J,{})]}):cr(Yp,{children:[ve(_,{onClose:()=>o()},"header"),ve(He,{children:cr(Fc,{children:[ve(fi,{}),ve(hi,{})]})}),ve(Zg,{children:"Secure your account with a passkey"}),ve(V6,{}),n.length===0?ve(U6,{}):ve(Xg,{passkeys:n,expanded:m,onUnlink:b,onExpand:()=>f(!0)}),cr(Rt,{style:{marginTop:"12px"},children:[l&&ve(F6,{fail:!0,children:l}),ve(F,{onClick:y,loading:i,children:"Add new passkey"})]}),ve(J,{})]})},Fc=Gr.div`
1586
1586
  display: flex;
1587
1587
  align-items: center;
1588
1588
  justify-content: center;
@@ -1598,7 +1598,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1598
1598
  stroke: var(--privy-color-accent) !important;
1599
1599
  fill: var(--privy-color-accent) !important;
1600
1600
  }
1601
- `,I6=zr.div`
1601
+ `,F6=Gr.div`
1602
1602
  line-height: 20px;
1603
1603
  height: 20px;
1604
1604
  font-size: 13px;
@@ -1606,7 +1606,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1606
1606
  display: flex;
1607
1607
  justify-content: flex-beginngin;
1608
1608
  width: 100%;
1609
- `,W6=Ug`
1609
+ `,B6=Jg`
1610
1610
  && {
1611
1611
  width: 100%;
1612
1612
  font-size: 0.875rem;
@@ -1631,9 +1631,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
1631
1631
  box-shadow: none;
1632
1632
  }
1633
1633
  }
1634
- `,Up=zr.button`
1635
- ${W6}
1636
- `,Bg=zr.div`
1634
+ `,Qp=Gr.button`
1635
+ ${B6}
1636
+ `,$g=Gr.div`
1637
1637
  display: flex;
1638
1638
  flex-direction: column;
1639
1639
  align-items: stretch;
@@ -1641,18 +1641,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1641
1641
  padding: 0.5rem 0rem 0rem;
1642
1642
  flex-grow: 1;
1643
1643
  width: 100%;
1644
- `,Dg=zr.div`
1644
+ `,Zg=Gr.div`
1645
1645
  font-size: 18px;
1646
1646
  line-height: 18px;
1647
1647
  text-align: center;
1648
1648
  font-weight: 600;
1649
- `,L6=zr.div`
1649
+ `,H6=Gr.div`
1650
1650
  font-size: 0.875rem;
1651
1651
  text-align: center;
1652
1652
  margin-top: 10px;
1653
- `,N6=zr.div`
1653
+ `,V6=Gr.div`
1654
1654
  height: 32px;
1655
- `,O6=zr.div`
1655
+ `,G6=Gr.div`
1656
1656
  line-height: 20px;
1657
1657
  height: 20px;
1658
1658
  font-size: 1em;
@@ -1660,18 +1660,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1660
1660
  display: flex;
1661
1661
  justify-content: flex-beginning;
1662
1662
  width: 100%;
1663
- `,D6=zr.div`
1663
+ `,q6=Gr.div`
1664
1664
  font-size: 1em;
1665
1665
  line-height: 1.3em;
1666
1666
  font-weight: 500;
1667
1667
  color: var(--privy-color-foreground-2);
1668
1668
  padding: 0.2em 0;
1669
- `,U6=zr.div`
1669
+ `,z6=Gr.div`
1670
1670
  font-size: 0.875rem;
1671
1671
  line-height: 1rem;
1672
1672
  color: #64668b;
1673
1673
  padding: 0.2em 0;
1674
- `,F6=zr.div`
1674
+ `,K6=Gr.div`
1675
1675
  display: flex;
1676
1676
  align-items: center;
1677
1677
  justify-content: space-between;
@@ -1684,7 +1684,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1684
1684
  border: 1px solid #e2e3f0 !important;
1685
1685
  width: 100%;
1686
1686
  height: 5em;
1687
- `,B6=Ug`
1687
+ `,Y6=Jg`
1688
1688
  :focus,
1689
1689
  :hover,
1690
1690
  :active {
@@ -1701,15 +1701,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
1701
1701
  svg:hover {
1702
1702
  color: var(--privy-color-foreground-3);
1703
1703
  }
1704
- `,H6=zr.button`
1705
- ${B6}
1706
- `;var Hg=Kr.div`
1704
+ `,Q6=Gr.button`
1705
+ ${Y6}
1706
+ `;var e1=qr.div`
1707
1707
  display: flex;
1708
1708
  flex-direction: column;
1709
1709
  gap: 12px;
1710
1710
  padding-top: 24px;
1711
1711
  padding-bottom: 24px;
1712
- `,Wc=Kr.div`
1712
+ `,Bc=qr.div`
1713
1713
  width: 24px;
1714
1714
  height: 24px;
1715
1715
  display: flex;
@@ -1719,19 +1719,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
1719
1719
  svg {
1720
1720
  border-radius: var(--privy-border-radius-sm);
1721
1721
  }
1722
- `,fa=Kr.div`
1722
+ `,ba=qr.div`
1723
1723
  display: flex;
1724
1724
  flex-direction: column;
1725
1725
  justify-content: center;
1726
1726
  align-items: center;
1727
1727
  gap: 8px;
1728
- `,ha=Kr.div`
1728
+ `,Ea=qr.div`
1729
1729
  display: flex;
1730
1730
  align-items: baseline;
1731
1731
  gap: 4px;
1732
- `,Lc=Kr.div`
1732
+ `,Hc=qr.div`
1733
1733
  font-size: 42px !important;
1734
- `,Vg=Kr.input`
1734
+ `,t1=qr.input`
1735
1735
  font-size: 42px !important;
1736
1736
  text-align: right;
1737
1737
  background-color: var(--privy-color-background);
@@ -1746,17 +1746,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
1746
1746
  border: none !important;
1747
1747
  box-shadow: none !important;
1748
1748
  }
1749
- `,Gg=Kr.div`
1749
+ `,r1=qr.div`
1750
1750
  cursor: pointer;
1751
1751
  padding-left: 4px;
1752
- `,ya=Kr.div`
1752
+ `,Ta=qr.div`
1753
1753
  font-size: 18px;
1754
- `,ga=Kr.div`
1754
+ `,Sa=qr.div`
1755
1755
  font-size: 12px;
1756
1756
  color: var(--privy-color-foreground-3);
1757
1757
  // we need this container to maintain a static height if there's no content
1758
1758
  height: 20px;
1759
- `,qg=Kr.div`
1759
+ `,o1=qr.div`
1760
1760
  display: flex;
1761
1761
  flex-direction: row;
1762
1762
  line-height: 22px;
@@ -1766,31 +1766,31 @@ You will need this password to access your ${e} wallet on a new device. Please k
1766
1766
  margin-right: 6px;
1767
1767
  margin: auto;
1768
1768
  }
1769
- `,zg=Kr(Up)`
1769
+ `,n1=qr(Qp)`
1770
1770
  margin-top: 16px;
1771
- `,G6=V6`
1771
+ `,Z6=X6`
1772
1772
  from {
1773
1773
  opacity: 0;
1774
1774
  }
1775
1775
  to {
1776
1776
  opacity: 1;
1777
1777
  }
1778
- `,Kg=Kr(an)`
1778
+ `,i1=qr(dn)`
1779
1779
  border-radius: var(--privy-border-radius-md) !important;
1780
- animation: ${G6} 0.3s ease-in-out;
1781
- `;import{Fragment as q6,jsx as Yt,jsxs as gs}from"react/jsx-runtime";var Yg=({displayName:e,errorMessage:t,configuredFundingChain:r,formattedBalance:o,fundingAmount:n,fundingCurrency:i,fundingAmountInUsd:a,options:l,selectedOption:s,isPreparing:d,isSubmitting:m,onSubmit:f,onSelect:u})=>gs(q6,{children:[Yt(Wt,{}),Yt(ie,{}),Yt(io,{children:"Transfer from another network"}),gs(Hr,{children:["You need more funds on the ",r.name," network. Bridge from another blockchain network."]}),gs(fa,{style:{marginTop:"2rem"},children:[gs(ha,{children:[Yt(Lc,{children:n}),Yt(ya,{children:i})]}),a&&Yt(ga,{children:a})]}),Yt(Lt,{style:{marginTop:"1.5rem"},children:Yt(Nt,{children:"From"})}),Yt(Wg,{selected:{chain:s.chain,balance:Et(s.balance,s.chain.nativeCurrency.symbol,3,!0)},options:l.map(({chain:g,balance:v})=>({chain:g,balance:Et(v,g.nativeCurrency.symbol,3,!0)})),onSelect:u}),Yt(Lt,{children:Yt(Nt,{style:{marginTop:"1.5rem"},children:"To"})}),Yt(Mg,{chain:r,balance:o}),Yt(Na,{style:{marginTop:"1rem"},children:t}),gs(Vo,{style:{marginTop:"1rem"},loading:m||d,disabled:d||m,onClick:f,children:["Confirm with ",e]}),Yt(ae,{}),Yt(H,{})]});import z6 from"styled-components";import{Fragment as Y6,jsx as At,jsxs as li}from"react/jsx-runtime";var Qg=({wallet:e,displayName:t,addressToFund:r,chain:o,isBridging:n,isErc20Flow:i,totalPriceInNativeCurrency:a,totalPriceInUsd:l,gasPriceInNativeCurrency:s,gasPriceInUsd:d})=>li(Y6,{children:[At(Wt,{}),At(pa,{}),At(St,{style:{marginTop:"16px"},children:At(jl,{icon:ec(e.walletClientType,e.connectorType,e.walletClientType),name:e.walletClientType})}),At(ve,{style:{marginTop:"8px",marginBottom:"12px"},title:`${n?"Bridging":"Confirming"} with ${t}`}),!n&&!i&&li(xc,{children:[li(Lt,{children:[At(Nt,{children:"Total"}),At(zt,{children:l||a})]}),li(Lt,{children:[At(Nt,{children:"To"}),At(zt,{children:At(Oa,{address:r,showCopyIcon:!1})})]}),li(Lt,{children:[At(Nt,{children:"Network"}),At(zt,{children:li(K6,{children:[At(ma,{chainId:o.id,height:16,width:16})," ",o.name]})})]}),s&&li(Lt,{children:[At(Nt,{children:"Estimated fee"}),At(zt,{children:d||s})]})]}),At(Yi,{height:24}),At(H,{})]}),K6=z6.div`
1780
+ animation: ${Z6} 0.3s ease-in-out;
1781
+ `;import{Fragment as J6,jsx as Gt,jsxs as Ts}from"react/jsx-runtime";var a1=({displayName:e,errorMessage:t,configuredFundingChain:r,formattedBalance:o,fundingAmount:n,fundingCurrency:i,fundingAmountInUsd:a,options:l,selectedOption:s,isPreparing:d,isSubmitting:u,onSubmit:m,onSelect:f})=>Ts(J6,{children:[Gt(Mt,{}),Gt(re,{}),Gt(no,{children:"Transfer from another network"}),Ts(Fr,{children:["You need more funds on the ",r.name," network. Bridge from another blockchain network."]}),Ts(ba,{style:{marginTop:"2rem"},children:[Ts(Ea,{children:[Gt(Hc,{children:n}),Gt(Ta,{children:i})]}),a&&Gt(Sa,{children:a})]}),Gt(It,{style:{marginTop:"1.5rem"},children:Gt(Wt,{children:"From"})}),Gt(Kg,{selected:{chain:s.chain,balance:wt(s.balance,s.chain.nativeCurrency.symbol,3,!0)},options:l.map(({chain:y,balance:b})=>({chain:y,balance:wt(b,y.nativeCurrency.symbol,3,!0)})),onSelect:f}),Gt(It,{children:Gt(Wt,{style:{marginTop:"1.5rem"},children:"To"})}),Gt(qg,{chain:r,balance:o}),Gt(Va,{style:{marginTop:"1rem"},children:t}),Ts(zo,{style:{marginTop:"1rem"},loading:u||d,disabled:d||u,onClick:m,children:["Confirm with ",e]}),Gt(oe,{}),Gt(B,{})]});import j6 from"styled-components";import{Fragment as e7,jsx as St,jsxs as yi}from"react/jsx-runtime";var s1=({wallet:e,displayName:t,addressToFund:r,chain:o,isBridging:n,isErc20Flow:i,totalPriceInNativeCurrency:a,totalPriceInUsd:l,gasPriceInNativeCurrency:s,gasPriceInUsd:d})=>yi(e7,{children:[St(Mt,{}),St(Ca,{}),St(Tt,{style:{marginTop:"16px"},children:St(ic,{icon:sc(e.walletClientType,e.connectorType,e.walletClientType),name:e.walletClientType})}),St(Ce,{style:{marginTop:"8px",marginBottom:"12px"},title:`${n?"Bridging":"Confirming"} with ${t}`}),!n&&!i&&yi(Lc,{children:[yi(It,{children:[St(Wt,{children:"Total"}),St(Ht,{children:l||a})]}),yi(It,{children:[St(Wt,{children:"To"}),St(Ht,{children:St(Ho,{address:r,showCopyIcon:!1})})]}),yi(It,{children:[St(Wt,{children:"Network"}),St(Ht,{children:yi($6,{children:[St(wa,{chainId:o.id,height:16,width:16})," ",o.name]})})]}),s&&yi(It,{children:[St(Wt,{children:"Estimated fee"}),St(Ht,{children:d||s})]})]}),St(ta,{height:24}),St(B,{})]}),$6=j6.div`
1782
1782
  display: flex;
1783
1783
  flex-direction: row;
1784
1784
  align-items: center;
1785
1785
  gap: 4px;
1786
- `;import{Fragment as Jg,jsx as Yr,jsxs as Fp}from"react/jsx-runtime";var jg=()=>{let{rpcConfig:e,appId:t,closePrivyModal:r}=_(),{navigate:o,setModalData:n,app:i,data:a}=P(),{wallets:l}=Jr(),[s,d]=Qt(!1),[m,f]=Qt(0n),[u,g]=Qt(!1),[v,C]=Qt(null),[b,A]=Qt(null),[k,S]=Qt([]),[x,T]=Qt(0),[M,D]=Qt(!1),[B,K]=Qt(!1),[Q,L]=Qt(!1),[X,I]=Qt(!1),{erc20ContractInfo:q,erc20Address:Le,address:oe,chain:Y,amount:ne}=a.funding;Cn(()=>{Le&&!q&&C(new Error("Unable to fetch token details"))},[]);let me=!!Le&&!!q,be=me?BigInt(parseFloat(ne)*10**q.decimals):j6(ne),ue=l[0],[Re,gt]=Qt(null);Cn(()=>{(async()=>{if(!ue)return;let kr=await ue.getEthereumProvider(),_r=X6({account:ue.address,transport:Z6(kr)}).extend($6);gt(_r)})().catch(console.error)},[ue]);let[tt,le]=Qt(0n);Cn(()=>{Xg({chain:Y,transport:Zg(Uo(Y,e,t))}).getBalance({address:oe}).then(le).catch(console.error)},[]);let[Jt,Do]=Qt(0n);Cn(()=>{me&&pg({chain:Y,address:oe,appId:t,rpcConfig:e,erc20Address:Le}).then(Ft=>Do(Ft.balance)).catch(console.error)},[]);let{tokenPrice:rt}=ko({chainId:Y.id}),[Fe,ze]=Qt({to:oe,chain:Y,value:be,data:void 0});Cn(()=>{(async()=>{if(!Re||!ue||M||Q)return;D(!0);let kr,_r=Xg({chain:Y,transport:Zg(Uo(Y,e,t))});if(me&&!Fe.data){if(!await _r.simulateContract({address:Le,chain:Y,abi:ps,functionName:"transfer",args:[oe,be],account:ue.address}).catch(Xr=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",Xr)})){D(!1),g(!0);return}D(!1),ze({to:Le,chain:Y,data:J6({abi:ps,functionName:"transfer",args:[oe,be]}),value:"0x0"});return}try{kr=await _r.prepareTransactionRequest({account:ue.address,to:Fe.to,chain:Fe.chain,data:Fe.data,value:BigInt(Fe.value??0)})}catch(Te){console.error(Te),k.length>1&&A(Te.shortMessage??"Something went wrong")}if(!kr){D(!1),g(!0);return}D(!1),L(!0),d(!0),f(kr.gas);try{await Re.switchChain({id:Fe.chain.id})}catch{await Re.addChain({chain:Fe.chain}),await Re.switchChain({id:Fe.chain.id})}let jo;try{jo=await Re.sendTransaction(kr)}catch(Te){console.error(Te);let Xr=Te;Xr.name==="TransactionExecutionError"&&(k.length<1?C(new w(Xr.shortMessage,void 0,"transaction_failure")):A(Te.shortMessage??"Something went wrong"))}if(!jo){L(!1);return}await Re.waitForTransactionReceipt({hash:jo}),L(!1),I(!0)})().catch(console.error)},[Re,Fe]),Cn(()=>{(async()=>{if(!u||!Re||!ue)return;let _r=Ac(i.chains).filter(Je=>Je.id!==a.funding.chain.id&&!!Je.testnet==!!a.funding.chain.testnet);me&&_r.unshift(a.funding.chain);let jo=await dg({chains:_r,address:ue.address,appId:t,rpcConfig:e}),Te=me?jo.filter(Je=>Je.balance>0n):jo.filter(Je=>Je.balance>be);if(Te.length<1){C(new w(`Wallet ${Bt(ue.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}Te.sort((Je,wi)=>Number(wi.balance-Je.balance));let Xr=(await Promise.allSettled(Te.map(async Je=>({quote:await lg({isTestnet:!!a.funding?.chain.testnet,input:sg({amount:be.toString(),user:ue.address,recipient:oe,destinationChainId:Y.id,destinationCurrency:Le,originChainId:Je.chain.id})}),...Je})))).filter(Je=>Je.status==="fulfilled").map(Je=>Je.value);if(Xr.length<1){C(new w(`Wallet ${Bt(ue.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}let vi=Xr.map(Je=>({bridgeTx:cg(Je.quote),balance:Je.balance,chain:Je.chain})).filter(Je=>!!Je.bridgeTx);if(vi.length>1){S(vi);return}let Nn=vi[0];if(!Nn){C(new w(`Wallet ${Bt(ue.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}K(!0),ze({data:Nn.bridgeTx.data,to:Nn.bridgeTx.to,value:Nn.bridgeTx.value,chain:Nn.chain})})().catch(console.error)},[u]),Cn(()=>{if(!v)return;let Ft={error:v,previousScreen:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};n({funding:a?.funding,sendTransaction:a?.sendTransaction,errorModalData:Ft}),o("ERROR_SCREEN",!1)},[v]);let W=ue?cn(ue.walletClientType,ue.connectorType,ue.walletClientType)||"wallet":null,se=!me&&rt?ki(a?.funding?.amount??"0",rt):void 0,ce=me?m:Da([m,be]),z=ce&&rt?ho(ce,rt):void 0,ee=ce?Et(ce,"ETH"):void 0,ke=m&&rt?ho(m,rt):void 0,xt=m?Et(m,"ETH"):void 0;if(Cn(()=>{if(!X)return;let Ft=setTimeout(r,Qu);return()=>clearTimeout(Ft)},[X]),X)return Fp(Jg,{children:[Yr(Wt,{}),Yr(ie,{}),Fp(Cr,{children:[Yr(Q6,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),Yr(ve,{title:"Success!",description:`You\u2019ve successfully added ${ne} ${me?q.symbol:Y.nativeCurrency.symbol} to your ${i.name} wallet. It may take a minute before the funds are available to use.`})]}),Yr(ae,{}),Yr(H,{})]});let Md=me?`${Pc({amount:Jt,decimals:q.decimals})} ${q.symbol}`:Et(tt,Y.nativeCurrency.symbol,3,!0),Jo=k[x];return k.length>1&&Jo?Yr(Yg,{displayName:W,configuredFundingChain:Y,formattedBalance:Md,fundingAmount:ne,fundingCurrency:me?q.symbol:Y.nativeCurrency.symbol,fundingAmountInUsd:se,options:k,selectedOption:Jo,isPreparing:M,isSubmitting:Q,errorMessage:b,onSubmit:()=>{ze({to:Jo.bridgeTx.to,data:Jo.bridgeTx.data,value:Jo.bridgeTx.value,chain:Jo.chain})},onSelect:Ft=>{Ft!==x&&(A(null),T(Ft))}}):s&&m&&ue&&a?.funding?Yr(Qg,{wallet:ue,displayName:W,addressToFund:oe,isBridging:B,isErc20Flow:me,totalPriceInUsd:z,totalPriceInNativeCurrency:ee,gasPriceInUsd:ke,gasPriceInNativeCurrency:xt,chain:a.funding.chain}):Fp(Jg,{children:[Yr(Wt,{}),Yr(pa,{}),Yr("div",{style:{marginTop:"1rem"}}),Yr(H,{})]})};import i7 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import a7 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as s7,useMemo as l7,useState as n1}from"react";import i1 from"styled-components";async function Nc({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find(i=>i.provider_app_id===r);if(!n)throw new w("Invalid connected app");return{name:n.provider_app_name,logoUrl:n.provider_app_icon_url||void 0,apiUrl:n.provider_app_custom_api_url,readOnly:n.read_only}}async function $g({api:e,appId:t}){let r=Gn(),o=Ii(),n=await Wi(r);try{let{url:i}=await e.post(al,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:n,state_code:o});return{url:i,stateCode:o,codeVerifier:r}}catch(i){throw pe(i)}}async function e1({api:e,appId:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new w("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new w("User denied confirmation during cross-app auth flow");try{let a=(await e.post(sl,{authorization_code:n,state_code:r,code_verifier:o,provider:`privy:${t}`})).oauth_tokens?.access_token;return console.debug(),a}catch(i){let a=pe(i);throw a.privyErrorCode?new w(a.message||"Invalid code during cross-app auth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during cross-app auth flow"?new w("Invalid code during cross-app auth flow.",void 0,"oauth_user_denied"):new w("Invalid code during cross-app auth flow.",void 0,"unknown_auth_error")}}var Oc=async({user:e,address:t,client:r,request:o,requesterAppId:n,reconnect:i})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:t,method:o.method}});let a=e?.linkedAccounts.find(u=>!!(u.type==="cross_app"&&u.embeddedWallets.find(g=>g.address===t)));if(!e||!a)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:t}}),new w("Cannot request a signature with this wallet address");let l=r.getProviderAccessToken(a.providerApp.id),s=await Nc({api:r.api,requesterAppId:n,providerAppId:a.providerApp.id});if(!l){if(s.readOnly)throw console.error("cannot transact against a read-only provider app"),new w("Cannot transact against a read-only provider app");await i({appId:a.providerApp.id})&&(l=r.getProviderAccessToken(a.providerApp.id))}if(!l)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:t}}),new w("Transactions require a valid token");let d=window.open(void 0,void 0,Cs({w:400,h:680}));if(!d)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:t}}),new w("Failed to initialize signature request");let m=new URL(`${s.apiUrl}/oauth/transact`);return m.searchParams.set("token",l||""),m.searchParams.set("request",e7(o)),d.location=m.href,new Promise((u,g)=>{let C=setTimeout(()=>{k(),g(new w("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),b=setInterval(()=>{d.closed&&(k(),g(new w("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),A=S=>{S.data&&(S.data.token?.action==="set"&&S.data.token?.value!==void 0?r.storeProviderAccessToken(a.providerApp.id,S.data.token.value):S.data.token?.action==="clear"&&r.storeProviderAccessToken(a.providerApp.id,null),S.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&S.data.result&&(k(),u(S.data.result),r.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:t,method:o.method}})),S.data.type==="PRIVY_CROSS_APP_ACTION_ERROR"&&S.data.error&&(k(),g(S.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:S.data.error,address:t}})))};window.addEventListener("message",A);let k=()=>{d.close(),clearInterval(b),clearTimeout(C),window.removeEventListener("message",A)}})},e7=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),Cs=({w:e,h:t})=>{let r=window.screenLeft!==void 0?window.screenLeft:window.screenX,o=window.screenTop!==void 0?window.screenTop:window.screenY,n=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,i=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,a=n/window.screen.availWidth,l=i/window.screen.availHeight,s=(n-e)/2/a+r,d=(i-t)/2/l+o;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${s},top=${d}`};var Ca="sdk_fiat_on_ramp_completed_with_status";var t7=new Set([Lr.id,Wr.id,fo.id,Nr.id,Zr.id]),r7=new Set([Lr.id,Wr.id,Nr.id,fo.id]),o7={[Lr.id]:"ethereum",[Wr.id]:"base",[fo.id]:"optimism",[Nr.id]:"polygon",[Zr.id]:"arbitrum"},t1=(e,t)=>{switch(t){case"native-currency":return t7.has(e);case"USDC":return r7.has(e);default:return console.warn("Unknown asset passed to Coinbase Onramp"),!1}};function r1(e){let t=o7[e];if(!t)throw new w(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}function n7(e){return e.startsWith(".")?`0${e}`:e}var o1=({input:e,amount:t,blockchain:r})=>{let o=new URL("https://pay.coinbase.com/buy/select-asset");return o.searchParams.set("appId",e.app_id),o.searchParams.set("sessionToken",e.session_token),o.searchParams.set("defaultExperience","buy"),o.searchParams.set("presetCryptoAmount",n7(t)),o.searchParams.set("defaultNetwork",r),o.searchParams.set("partnerUserId",e.partner_user_id),{url:o}};import{Fragment as l1,jsx as Tr,jsxs as vs}from"react/jsx-runtime";var c7=240,a1=1500,d7=Math.floor(c7*1e3/a1),s1=()=>{let{data:e,setModalData:t,navigate:r}=P(),{closePrivyModal:o,createAnalyticsEvent:n,initCoinbaseOnRamp:i,getCoinbaseOnRampStatus:a}=_(),l=e?.funding,s=l.isUSDC?"USDC":"ETH",[d,m]=n1(!1),[f,u]=n1(!1);return s7(()=>{if(d)return;m(!0);let g=async()=>{try{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp"}});let C=window.open(void 0,void 0,Cs({w:440,h:680})),b=r1(l.chain.id),A=await i({addresses:[{address:l.address,blockchains:[b]}],assets:[s]}),{url:k}=o1({input:A,amount:l.amount,blockchain:b});if(!C)throw new Error("Unable to initiate Coinbase Onramp flow.");C.location=k.toString();let S=0,x=!1;for(;S<d7;){S++;let{status:T}=await a({partnerUserId:A.partner_user_id});if(T==="success"){x=!0;break}if(T==="failure")throw new Error("There was an error completing Coinbase Onramp flow.");if(C.closed)throw new Error("User exited Coinbase Onramp flow before transaction response.");await new Promise(M=>setTimeout(M,a1))}if(!x)throw new Error("Timed out waiting for transaction response from Coinbase Onramp.");n({eventName:Ca,payload:{status:"success",provider:"coinbase-onramp"}}),u(!0)}catch(C){console.error(C),n({eventName:Ca,payload:{status:"failure",provider:"coinbase-onramp",error:C.message}}),t({funding:{...l,errorMessage:"Something went wrong adding funds from Coinbase Onramp. Please try again or use another method to fund your wallet."}}),r("FUNDING_METHOD_SELECTION_SCREEN")}finally{m(!1)}},v=setTimeout(()=>void g(),500);return()=>clearTimeout(v)},[]),vs(l1,{children:[Tr(R,{title:"Fund account"},"header"),Tr(u7,{isSucccess:f,onClickCta:o}),Tr(H,{})]})},p7=e=>e?{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"}:{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""},u7=({isSucccess:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=l7(()=>p7(e),[e]);return vs(l1,{children:[vs(g7,{children:[Tr(h7,{isSucccess:e}),vs(Ze,{children:[Tr("h3",{children:r}),Tr(y7,{children:o})]})]}),n&&Tr(U,{onClick:t,children:n})]})},m7=e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)",f7=e=>e?a7:()=>Tr(i7,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),h7=({isSucccess:e})=>{if(!e){let o="var(--privy-color-foreground-4)";return vs("div",{style:{position:"relative"},children:[Tr(dt,{color:o,style:{position:"absolute"}}),Tr(Qa,{color:o}),Tr(Ho,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let t=f7(e),r=m7(e);return Tr("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&Tr(t,{width:"4rem",height:"4rem",color:r})})},y7=i1.p`
1786
+ `;import{Fragment as d1,jsx as zr,jsxs as Xp}from"react/jsx-runtime";var p1=()=>{let{rpcConfig:e,appId:t,closePrivyModal:r,createAnalyticsEvent:o}=I(),{navigate:n,setModalData:i,app:a,data:l}=R(),{wallets:s}=Vo(),[d,u]=qt(!1),[m,f]=qt(0n),[y,b]=qt(!1),[C,w]=qt(null),[A,k]=qt(null),[T,P]=qt([]),[S,M]=qt(0),[N,H]=qt(!1),[x,K]=qt(!1),[W,Q]=qt(!1),[pe,q]=qt(!1),{erc20ContractInfo:ue,erc20Address:Z,address:ae,chain:se,amount:We}=l.funding;En(()=>{Z&&!ue&&w(new Error("Unable to fetch token details"))},[]);let Ee=!!Z&&!!ue,ge=Ee?BigInt(parseFloat(We)*10**ue.decimals):i7(We),le=s[0],[Ze,at]=qt(null);En(()=>{(async()=>{if(!le)return;let Be=await le.getEthereumProvider(),po=r7({account:le.address,transport:o7(Be)}).extend(a7);at(po)})().catch(console.error)},[le]);let[ce,tt]=qt(0n);En(()=>{l1({chain:se,transport:c1(Fo(se,e,t))}).getBalance({address:ae}).then(tt).catch(console.error)},[]);let[Dt,Yr]=qt(0n);En(()=>{Ee&&Sg({chain:se,address:ae,appId:t,rpcConfig:e,erc20Address:Z}).then(Yt=>Yr(Yt.balance)).catch(console.error)},[]);let{tokenPrice:L}=_o({chainId:se.id}),[Re,ze]=qt({to:ae,chain:se,value:ge,data:void 0});En(()=>{(async()=>{if(!Ze||!le||N||W)return;H(!0);let Be,po=l1({chain:Re.chain,transport:c1(Fo(se,e,t))});if(Ee&&!Re.data){if(!await po.simulateContract({address:Z,chain:Re.chain,abi:gs,functionName:"transfer",args:[ae,ge],account:le.address}).catch(uo=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",uo)})){H(!1),b(!0);return}H(!1),ze({to:Z,chain:Re.chain,data:n7({abi:gs,functionName:"transfer",args:[ae,ge]}),value:"0x0"});return}try{Be=await po.prepareTransactionRequest({account:le.address,to:Re.to,chain:Re.chain,data:Re.data,value:BigInt(Re.value??0)})}catch(Qt){console.error(Qt),T.length>1&&k(Qt.shortMessage??"Something went wrong")}if(!Be){H(!1),b(!0);return}H(!1),Q(!0),u(!0),f(Be.gas);try{await Ze.switchChain({id:Re.chain.id})}catch{await Ze.addChain({chain:Re.chain}),await Ze.switchChain({id:Re.chain.id})}let Do;try{Do=await Ze.sendTransaction(Be),o({eventName:Jo,payload:{provider:"external",status:"success",address:le.address,chainId:Re.chain.id,value:Re.value?.toString(),txHash:Do}})}catch(Qt){console.error(Qt);let uo=Qt;uo.name==="TransactionExecutionError"&&(T.length<1?w(new v(uo.shortMessage,void 0,"transaction_failure")):k(Qt.shortMessage??"Something went wrong"))}if(!Do){Q(!1);return}await Ze.waitForTransactionReceipt({hash:Do}),Q(!1),q(!0)})().catch(console.error)},[Ze,Re]),En(()=>{(async()=>{if(!y||!Ze||!le)return;let po=Ic(a.chains).filter(Ke=>Ke.id!==l.funding.chain.id&&!!Ke.testnet==!!l.funding.chain.testnet);Ee&&po.unshift(l.funding.chain);let Do=await Tg({chains:po,address:le.address,appId:t,rpcConfig:e}),Qt=Ee?Do.filter(Ke=>Ke.balance>0n):Do.filter(Ke=>Ke.balance>ge);if(Qt.length<1){w(new v(`Wallet ${Xr(le.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}Qt.sort((Ke,Bd)=>Number(Bd.balance-Ke.balance));let uo=(await Promise.allSettled(Qt.map(async Ke=>({quote:await bg({isTestnet:!!l.funding?.chain.testnet,input:wg({amount:ge.toString(),user:le.address,recipient:ae,destinationChainId:se.id,destinationCurrency:Z,originChainId:Ke.chain.id})}),...Ke})))).filter(Ke=>Ke.status==="fulfilled").map(Ke=>Ke.value);if(uo.length<1){w(new v(`Wallet ${Xr(le.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}let Uo=uo.map(Ke=>({bridgeTx:Eg(Ke.quote),balance:Ke.balance,chain:Ke.chain})).filter(Ke=>!!Ke.bridgeTx);if(Uo.length>1){P(Uo);return}let Hn=Uo[0];if(!Hn){w(new v(`Wallet ${Xr(le.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}K(!0),ze({data:Hn.bridgeTx.data,to:Hn.bridgeTx.to,value:Hn.bridgeTx.value,chain:Hn.chain})})().catch(console.error)},[y]),En(()=>{if(!C)return;let Yt={error:C,previousScreen:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};i({funding:l?.funding,sendTransaction:l?.sendTransaction,errorModalData:Yt}),n("ERROR_SCREEN",!1)},[C]);let U=le?mn(le.walletClientType,le.connectorType,le.walletClientType)||"wallet":null,Y=!Ee&&L?Di(l?.funding?.amount??"0",L):void 0,j=Ee?m:Ga([m,ge]),Fe=j&&L?yo(j,L):void 0,Oo=j?wt(j,"ETH"):void 0,Fn=m&&L?yo(m,L):void 0,Bn=m?wt(m,"ETH"):void 0;if(En(()=>{if(!pe)return;let Yt=setTimeout(r,am);return()=>clearTimeout(Yt)},[pe]),pe)return Xp(d1,{children:[zr(Mt,{}),zr(re,{}),Xp(yr,{children:[zr(t7,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),zr(Ce,{title:"Success!",description:`You\u2019ve successfully added ${We} ${Ee?ue.symbol:se.nativeCurrency.symbol} to your ${a.name} wallet. It may take a minute before the funds are available to use.`})]}),zr(oe,{}),zr(B,{})]});let Ri=Ee?`${Wc({amount:Dt,decimals:ue.decimals})} ${ue.symbol}`:wt(ce,se.nativeCurrency.symbol,3,!0),Qr=T[S];return T.length>1&&Qr?zr(a1,{displayName:U,configuredFundingChain:se,formattedBalance:Ri,fundingAmount:We,fundingCurrency:Ee?ue.symbol:se.nativeCurrency.symbol,fundingAmountInUsd:Y,options:T,selectedOption:Qr,isPreparing:N,isSubmitting:W,errorMessage:A,onSubmit:()=>{ze({to:Qr.bridgeTx.to,data:Qr.bridgeTx.data,value:Qr.bridgeTx.value,chain:Qr.chain})},onSelect:Yt=>{Yt!==S&&(k(null),M(Yt))}}):d&&m&&le&&l?.funding?zr(s1,{wallet:le,displayName:U,addressToFund:ae,isBridging:x,isErc20Flow:Ee,totalPriceInUsd:Fe,totalPriceInNativeCurrency:Oo,gasPriceInUsd:Fn,gasPriceInNativeCurrency:Bn,chain:l.funding.chain}):Xp(d1,{children:[zr(Mt,{}),zr(Ca,{}),zr("div",{style:{marginTop:"1rem"}}),zr(B,{})]})};import u7 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import m7 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as f7,useMemo as h7,useState as g1}from"react";import C1 from"styled-components";var Vc=class{constructor({authorizationCode:t,stateCode:r,codeVerifier:o,provider:n}){this.meta={authorizationCode:t,stateCode:r,codeVerifier:o,provider:n}}async authenticate(){if(!this.api)throw new v("Auth flow has no API instance");try{return await this.api.post(ul,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(t){throw ie(t)}}async link(){if(!this.api)throw new v("Auth flow has no API instance");try{return await this.api.post(ml,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(t){throw ie(t)}}};async function Gc({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find(i=>i.provider_app_id===r);if(!n)throw new v("Invalid connected app");return{name:n.provider_app_name,logoUrl:n.provider_app_icon_url||void 0,apiUrl:n.provider_app_custom_api_url,readOnly:n.read_only}}async function u1({api:e,appId:t}){let r=Zn(),o=Bi(),n=await Hi(r);try{let{url:i}=await e.post(pl,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:n,state_code:o});return{url:i,stateCode:o,codeVerifier:r}}catch(i){throw ie(i)}}async function m1({appId:e,stateCode:t,codeVerifier:r,authorizationCode:o,action:n,client:i}){if(!o||!t)throw new v("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(o==="undefined")throw new v("User denied confirmation during cross-app auth flow");try{let a=new Vc({authorizationCode:o,stateCode:t,codeVerifier:r,provider:`privy:${e}`});i.startAuthFlow(a);let s=(n==="link"?await i.link():await i.authenticate()).oAuthTokens?.accessToken;return console.debug(),s}catch(a){let l=ie(a);throw l.privyErrorCode?new v(l.message||"Invalid code during cross-app auth flow.",void 0,l.privyErrorCode):l.message==="User denied confirmation during cross-app auth flow"?new v("Invalid code during cross-app auth flow.",void 0,"oauth_user_denied"):new v("Invalid code during cross-app auth flow.",void 0,"unknown_auth_error")}}var qc=async({user:e,address:t,client:r,request:o,requesterAppId:n,reconnect:i})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:t,method:o.method}});let a=e?.linkedAccounts.find(f=>!!(f.type==="cross_app"&&f.embeddedWallets.find(y=>y.address===t)));if(!e||!a)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:t}}),new v("Cannot request a signature with this wallet address");let l=r.getProviderAccessToken(a.providerApp.id),s=await Gc({api:r.api,requesterAppId:n,providerAppId:a.providerApp.id});if(!l){if(s.readOnly)throw console.error("cannot transact against a read-only provider app"),new v("Cannot transact against a read-only provider app");await i({appId:a.providerApp.id,action:"link"})&&(l=r.getProviderAccessToken(a.providerApp.id))}if(!l)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:t}}),new v("Transactions require a valid token");let d=window.open(void 0,void 0,Ss({w:400,h:680}));if(!d)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:t}}),new v("Failed to initialize signature request");let u=new URL(`${s.apiUrl}/oauth/transact`);return u.searchParams.set("token",l||""),u.searchParams.set("request",s7(o)),d.location=u.href,new Promise((f,y)=>{let C=setTimeout(()=>{k(),y(new v("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),w=setInterval(()=>{d.closed&&(k(),y(new v("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),A=T=>{T.data&&(T.data.token?.action==="set"&&T.data.token?.value!==void 0?r.storeProviderAccessToken(a.providerApp.id,T.data.token.value):T.data.token?.action==="clear"&&r.storeProviderAccessToken(a.providerApp.id,null),T.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&T.data.result&&(k(),f(T.data.result),r.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:t,method:o.method}})),T.data.type==="PRIVY_CROSS_APP_ACTION_ERROR"&&T.data.error&&(k(),y(T.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:T.data.error,address:t}})))};window.addEventListener("message",A);let k=()=>{d.close(),clearInterval(w),clearTimeout(C),window.removeEventListener("message",A)}})},s7=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),Ss=({w:e,h:t})=>{let r=window.screenLeft!==void 0?window.screenLeft:window.screenX,o=window.screenTop!==void 0?window.screenTop:window.screenY,n=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,i=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,a=n/window.screen.availWidth,l=i/window.screen.availHeight,s=(n-e)/2/a+r,d=(i-t)/2/l+o;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${s},top=${d}`};var l7=new Set([Ir.id,Mr.id,ho.id,Wr.id,Zr.id]),c7=new Set([Ir.id,Mr.id,Wr.id,ho.id]),d7={[Ir.id]:"ethereum",[Mr.id]:"base",[ho.id]:"optimism",[Wr.id]:"polygon",[Zr.id]:"arbitrum"},f1=(e,t)=>{switch(t){case"native-currency":return l7.has(e);case"USDC":return c7.has(e);default:return console.warn("Unknown asset passed to Coinbase Onramp"),!1}};function h1(e){let t=d7[e];if(!t)throw new v(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}function p7(e){return e.startsWith(".")?`0${e}`:e}var y1=({input:e,amount:t,blockchain:r})=>{let o=new URL("https://pay.coinbase.com/buy/select-asset");return o.searchParams.set("appId",e.app_id),o.searchParams.set("sessionToken",e.session_token),o.searchParams.set("defaultExperience","buy"),o.searchParams.set("presetCryptoAmount",p7(t)),o.searchParams.set("defaultNetwork",r),o.searchParams.set("partnerUserId",e.partner_user_id),{url:o}};import{Fragment as b1,jsx as br,jsxs as As}from"react/jsx-runtime";var y7=240,v1=1500,g7=Math.floor(y7*1e3/v1),w1=()=>{let{data:e,setModalData:t,navigate:r}=R(),{closePrivyModal:o,createAnalyticsEvent:n,initCoinbaseOnRamp:i,getCoinbaseOnRampStatus:a}=I(),l=e?.funding,s=l.isUSDC?"USDC":"ETH",[d,u]=g1(!1),[m,f]=g1(!1);return f7(()=>{if(d)return;u(!0);let y=async()=>{try{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:l.amount,chainId:l.chain.id}});let C=window.open(void 0,void 0,Ss({w:440,h:680})),w=h1(l.chain.id),A=await i({addresses:[{address:l.address,blockchains:[w]}],assets:[s]}),{url:k}=y1({input:A,amount:l.amount,blockchain:w});if(!C)throw new Error("Unable to initiate Coinbase Onramp flow.");C.location=k.toString();let T=0,P=!1;for(;T<g7;){T++;let{status:S}=await a({partnerUserId:A.partner_user_id});if(S==="success"){P=!0;break}if(S==="failure")throw new Error("There was an error completing Coinbase Onramp flow.");if(C.closed)throw new Error("User exited Coinbase Onramp flow before transaction response.");await new Promise(M=>setTimeout(M,v1))}if(!P)throw new Error("Timed out waiting for transaction response from Coinbase Onramp.");f(!0)}catch(C){console.error(C),n({eventName:Jo,payload:{status:"failure",provider:"coinbase-onramp",error:C.message}}),t({funding:{...l,errorMessage:"Something went wrong adding funds from Coinbase Onramp. Please try again or use another method to fund your wallet."}}),r("FUNDING_METHOD_SELECTION_SCREEN")}finally{u(!1)}},b=setTimeout(()=>void y(),500);return()=>clearTimeout(b)},[]),As(b1,{children:[br(_,{title:"Fund account"},"header"),br(v7,{isSucccess:m,onClickCta:o}),br(B,{})]})},C7=e=>e?{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"}:{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""},v7=({isSucccess:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=h7(()=>C7(e),[e]);return As(b1,{children:[As(S7,{children:[br(E7,{isSucccess:e}),As(je,{children:[br("h3",{children:r}),br(T7,{children:o})]})]}),n&&br(F,{onClick:t,children:n})]})},w7=e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)",b7=e=>e?m7:()=>br(u7,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),E7=({isSucccess:e})=>{if(!e){let o="var(--privy-color-foreground-4)";return As("div",{style:{position:"relative"},children:[br(lt,{color:o,style:{position:"absolute"}}),br(es,{color:o}),br(qo,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let t=b7(e),r=w7(e);return br("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&br(t,{width:"4rem",height:"4rem",color:r})})},T7=C1.p`
1787
1787
  font-size: 1rem;
1788
1788
  color: var(--privy-color-foreground-3);
1789
1789
  margin-bottom: 1rem;
1790
1790
  display: flex;
1791
1791
  flex-direction: column;
1792
1792
  gap: 1rem;
1793
- `,g7=i1.div`
1793
+ `,S7=C1.div`
1794
1794
  display: flex;
1795
1795
  flex-direction: column;
1796
1796
  align-items: center;
@@ -1798,7 +1798,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1798
1798
  margin-left: 1.75rem;
1799
1799
  margin-right: 1.75rem;
1800
1800
  padding: 2rem 0;
1801
- `;import{getAddress as C1}from"@ethersproject/address";import W7 from"@heroicons/react/24/outline/PencilIcon";import L7 from"@heroicons/react/24/outline/WalletIcon";import{useEffect as v1,useRef as N7,useState as O7}from"react";import{ExclamationTriangleIcon as C7}from"@heroicons/react/24/outline";import v7 from"styled-components";import{jsx as b7,jsxs as E7}from"react/jsx-runtime";var c1=({children:e})=>E7(w7,{children:[b7(C7,{width:"3rem",color:"var(--privy-color-error)"}),e]}),w7=v7.div`
1801
+ `;import{getAddress as _1}from"@ethersproject/address";import B7 from"@heroicons/react/24/outline/PencilIcon";import H7 from"@heroicons/react/24/outline/WalletIcon";import{useEffect as M1,useRef as V7,useState as G7}from"react";import{ExclamationTriangleIcon as A7}from"@heroicons/react/24/outline";import P7 from"styled-components";import{jsx as R7,jsxs as k7}from"react/jsx-runtime";var E1=({children:e})=>k7(x7,{children:[R7(A7,{width:"3rem",color:"var(--privy-color-error)"}),e]}),x7=P7.div`
1802
1802
  display: flex;
1803
1803
  gap: 0.5rem;
1804
1804
  background-color: var(--privy-color-error-light);
@@ -1817,11 +1817,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1817
1817
  border: 1px solid var(--privy-color-error);
1818
1818
  border-radius: var(--privy-border-radius-sm);
1819
1819
  }
1820
- `;import{createPublicClient as T7,http as S7}from"viem";var Dc=async({address:e,chain:t,rpcConfig:r,privyAppId:o})=>{try{let n=T7({chain:t,transport:S7(Uo(t,r,o))}),[i,a]=await Promise.all([n.readContract({abi:d1,address:e,functionName:"symbol"}),n.readContract({abi:d1,address:e,functionName:"decimals"})]);return{decimals:a,symbol:i}}catch(n){return console.log(n),null}},d1=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];import{ofetch as A7}from"ofetch";import{useEffect as P7,useRef as x7,useState as R7}from"react";var Uc="moonpay",k7=new Set([Lr.id,Zr.id,Wr.id,Nr.id]),_7=new Set([Lr.id,Zr.id,fo.id,Wr.id,Nr.id]);function p1(e,t){switch(e){case Zr.id:return t==="native-currency"?"ETH_ARBITRUM":"USDC_ARBITRUM";case 43114:return"AVAX_CCHAIN";case Wr.id:return t==="native-currency"?"ETH_BASE":"USDC_BASE";case tl.id:return"CELO_CELO";case Nr.id:return t==="native-currency"?"MATIC_POLYGON":"USDC_POLYGON";case Lr.id:return t==="native-currency"?"ETH_ETHEREUM":"USDC_ETHEREUM";default:return console.warn(`Chain ${e} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}function u1(e){return parseFloat(e)}function m1(e){return!!e&&e.config!==void 0&&e.provider!==void 0}function f1(e){return!!e&&(e.chain!==void 0||e.amount!==void 0)}async function h1(e,t,r,o,n=!1){let i=r.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},a=r.uiConfig||{accentColor:o.accent,theme:o.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:n,config:{...r,...i,...a}})}async function M7(e,t){let r=t?Ju:Zu,o=t?$u:ju;return A7(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function y1(e,t=!1){let[r,o]=R7(null),{createAnalyticsEvent:n}=_(),{data:i,navigate:a,setModalData:l}=P(),s=i?.funding,d=x7(0);return P7(()=>{let m=setInterval(async()=>{if(e)try{let[f]=await M7(e,t),u=f.status==="waitingAuthorization"&&f.paymentMethod==="credit_debit_card"?"pending":f.status;if(["failed","completed","awaitingAuthorization"].includes(u)&&(n({eventName:Ca,payload:{status:u,provider:Uc,paymentMethod:f.paymentMethod,cardPaymentType:f.cardPaymentType,currency:f.currency?.code,baseCurrencyAmount:f.baseCurrencyAmount,quoteCurrencyAmount:f.quoteCurrencyAmount,feeAmount:f.feeAmount,extraFeeAmount:f.extraFeeAmount,networkFeeAmount:f.networkFeeAmount}}),clearInterval(m)),u==="failed"||u==="serviceFailure"){l({funding:{...s,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),a("FUNDING_METHOD_SELECTION_SCREEN");return}o(u)}catch(f){f.response?.status!==404&&(d.current+=1),d.current>=3&&(n({eventName:Ca,payload:{status:"serviceFailure",provider:Uc}}),clearInterval(m),l({funding:{...s,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),a("FUNDING_METHOD_SELECTION_SCREEN"))}},3e3);return()=>clearInterval(m)},[e,d]),r}var g1=(e,t)=>{switch(t){case"native-currency":return k7.has(e);case"USDC":return _7.has(e);default:return console.warn("Unknown asset passed to MoonPay Onramp"),!1}};import{jsx as Bp,jsxs as I7}from"react/jsx-runtime";var va=({size:e=61,...t})=>Bp("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:I7("g",{id:"moonpay_symbol_wht 2",children:[Bp("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),Bp("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});import{Fragment as w1,jsx as wt,jsxs as vn}from"react/jsx-runtime";var b1=()=>{let{wallets:e}=Jr(),{navigate:t,data:r,setModalData:o}=P(),n=Ve(),i=r?.funding,a=N7(null),[l,s]=O7(!1);v1(()=>{a.current&&a.current.style.setProperty("--funding-input-length",Math.max(i.amount.length,1).toString())},[i.amount,a.current]);let d=n.fundingConfig?.methods.slice()??[],{tokenPrice:m}=ko({chainId:i.chain.id});v1(()=>{i.erc20Address&&i.chain&&!i.erc20ContractInfo&&Dc({address:i.erc20Address,chain:i.chain,rpcConfig:n.rpcConfig,privyAppId:n.id}).then(T=>o({...r,funding:{...r.funding,erc20ContractInfo:T?{symbol:T.symbol,decimals:T.decimals}:void 0}})).catch(console.error)},[i.erc20Address,i.chain]);let f=m?ki(i.amount,m):void 0,u=e.find(T=>C1(T.address)===C1(i.address)),g=u&&u.walletClientType!=="privy"?cn(u.walletClientType,u.connectorType,u.walletClientType):n.name,v=parseFloat(i.amount),C=!isNaN(v)&&v>0,b=!!(i.erc20Address&&!i.erc20ContractInfo),A=i.isUSDC?"USDC":i.erc20Address?void 0:"native-currency",k=A&&g1(Number(i.chain.id),A),S=A&&t1(Number(i.chain.id),A),x=i.erc20Address||!i.erc20Address&&!i.isUSDC;return vn(w1,{children:[wt(Wt,{}),vn("h3",{children:["Add funds to your"," ",g?.toLowerCase().endsWith("wallet")?g:g+" wallet"]}),wt(ln,{style:{marginTop:"32px"},children:wt(fa,{children:b?wt(pa,{size:"50px"}):vn(w1,{children:[vn(ha,{onClick:()=>a.current?.focus(),children:[wt(Vg,{ref:a,value:i.amount,onFocus:()=>s(!0),onBlur:()=>s(!1),onChange:T=>{let M=T.target.value;/^[0-9.]*$/.test(M)&&M.split(".").length-1<=1&&o({...r,funding:{...i,amount:M}})}}),wt(ya,{children:i.erc20Address?i.erc20ContractInfo?.symbol:i.chain.nativeCurrency.symbol}),!l&&wt(Gg,{children:wt(W7,{width:12,height:12})})]}),!i.erc20Address&&wt(ga,{children:f&&C?f:""})]})})}),vn(Hg,{children:[i.errorMessage&&wt(c1,{children:i.errorMessage}),d.sort().map(T=>{switch(T){case"moonpay":return k?vn(xe,{disabled:!C||b,onClick:()=>{t("MOONPAY_PROMPT_SCREEN")},children:[wt(Wc,{children:wt(va,{style:{width:24}})}),"Moonpay"]},T):null;case"coinbase-onramp":return S?vn(xe,{disabled:!C||b,onClick:()=>{t("COINBASE_ONRAMP_STATUS_SCREEN")},children:[wt(Wc,{children:wt(Ho,{style:{width:24}})}),"Coinbase Onramp"]},T):null;case"external":return x?vn(xe,{disabled:!C||b,onClick:()=>{t("FUNDING_TRANSFER_FROM_WALLET_SCREEN")},children:[wt(Wc,{children:wt(L7,{style:{width:24}})}),"Transfer from wallet"]},T):null}}),wt(zg,{disabled:!C,onClick:()=>t("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),wt(H,{})]})};import{formatUnits as D7}from"@ethersproject/units";import U7 from"@heroicons/react/24/outline/DocumentDuplicateIcon";import F7 from"@heroicons/react/24/outline/InformationCircleIcon";import B7 from"@heroicons/react/24/outline/QrCodeIcon";import{useEffect as H7,useMemo as V7,useState as Hp}from"react";import wa from"styled-components";import{Fragment as Fc,jsx as Ye,jsxs as Ot}from"react/jsx-runtime";var G7=2e3,E1=()=>{let{wallets:e}=Jr(),{app:t,data:r,setModalData:o,navigate:n,lastScreen:i}=P(),{chains:a,rpcConfig:l,appId:s,closePrivyModal:d}=_(),[m,f]=Hp("default"),[u,g]=Hp(void 0),v=r?.funding,{tokenPrice:C}=ko({chainId:v.chain.id}),b=C?ki(v.amount,C):void 0,A=e.find(T=>Bt(T.address)===Bt(v.address)),k=A&&A.walletClientType!=="privy"?cn(A.walletClientType,A.connectorType,A.walletClientType):t.name;if(!v)return o({errorModalData:{error:new Error("Couldn't find funding config"),previousScreen:i||"FUNDING_METHOD_SELECTION_SCREEN"},funding:r?.funding,sendTransaction:r?.sendTransaction}),n("ERROR_SCREEN"),Ye(Fc,{});H7(()=>{let T=Ir(v.chain.id,a,l,{appId:s});function M(){T.getBalance(v.address).then(B=>g(parseFloat(D7(B,"ether")))).catch(()=>g(void 0))}let D=setInterval(M,G7);return M(),()=>clearInterval(D)},[]);let S=V7(()=>u!==void 0?u>=parseFloat(v.amount):!1,[u,v.amount]),x=Ot(Fc,{children:[Ye(Ri,{title:"Your wallet",errMsg:void 0,isLoading:!v||u===void 0,isPulsing:!S,balance:`${u!==void 0?u.toPrecision(2):""} ETH`,address:v.address,statusColor:S?"green":"gray"}),S&&Ye(Kg,{onClick:()=>d(),children:"Close"})]});return m==="qr-code"?Ot(Fc,{children:[Ye(R,{backFn:()=>f("default")}),Ot(ln,{style:{gap:"24px",marginBottom:"24px"},children:[Ot("div",{children:[Ye(fe,{children:"Scan QR code"}),Ot(ye,{children:["Scan this code using your mobile wallet to send funds to your ",k," ","wallet."]})]}),Ye(gn,{url:v.address,size:200,squareLogoElement:q7}),x]}),Ye(H,{})]}):Ot(Fc,{children:[Ye(Wt,{}),Ye(ve,{title:"Send funds",description:"Send funds directly to your wallet by copying your wallet address or scanning a QR code."}),Ot(ln,{style:{gap:"16px"},children:[Ot(Y7,{children:[Ye(F7,{height:"20px",width:"20px",color:"var(--privy-color-accent-light)"}),Ot(Q7,{children:["Make sure to send on ",v.chain.name,"."]})]}),Ot(X7,{children:[Ye(Yi,{height:16}),Ot(fa,{children:[Ot(ha,{children:[Ye(Lc,{children:v.amount}),Ye(ya,{children:v.chain.nativeCurrency.symbol})]}),Ye(ga,{children:b?`${b} USD`:"..."}),Ot(qg,{children:[Ye(ma,{chainId:v.chain.id,height:16,width:16})," ",v.chain.name]})]}),Ye(Yi,{height:8}),Ot(K7,{children:[Ye(z7,{text:v.address}),Ye(S1,{onClick:()=>f("qr-code"),children:Ot(T1,{children:[Ye(B7,{height:"16px",width:"16px"}),"Scan code"]})})]})]}),x]}),Ye(Yi,{height:16}),Ye(H,{})]})},q7=({...e})=>Ye(Ai,{color:"black",...e}),z7=e=>{let[t,r]=Hp(!1);return Ye(S1,{onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},children:Ot(T1,{children:[t?Ye(da,{style:{height:"16px",width:"16px"},strokeWidth:"2"}):Ye(U7,{style:{height:"16px",width:"16px"}}),t?"Copied":"Copy address"]})})},K7=wa.div`
1820
+ `;import{createPublicClient as _7,http as M7}from"viem";var zc=async({address:e,chain:t,rpcConfig:r,privyAppId:o})=>{try{let n=_7({chain:t,transport:M7(Fo(t,r,o))}),[i,a]=await Promise.all([n.readContract({abi:T1,address:e,functionName:"symbol"}),n.readContract({abi:T1,address:e,functionName:"decimals"})]);return{decimals:a,symbol:i}}catch(n){return console.log(n),null}},T1=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];import{ofetch as I7}from"ofetch";import{useEffect as W7,useRef as L7,useState as N7}from"react";var Kc="moonpay",O7=new Set([Ir.id,Zr.id,Mr.id,Wr.id]),D7=new Set([Ir.id,Zr.id,ho.id,Mr.id,Wr.id]);function S1(e,t){switch(e){case Zr.id:return t==="native-currency"?"ETH_ARBITRUM":"USDC_ARBITRUM";case 43114:return"AVAX_CCHAIN";case Mr.id:return t==="native-currency"?"ETH_BASE":"USDC_BASE";case al.id:return"CELO_CELO";case Wr.id:return t==="native-currency"?"MATIC_POLYGON":"USDC_POLYGON";case Ir.id:return t==="native-currency"?"ETH_ETHEREUM":"USDC_ETHEREUM";default:return console.warn(`Chain ${e} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}function A1(e){return parseFloat(e)}function P1(e){return!!e&&e.config!==void 0&&e.provider!==void 0}function Yc(e){return!!e&&(e.chain!==void 0||e.amount!==void 0)}async function x1(e,t,r,o,n=!1){let i=r.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},a=r.uiConfig||{accentColor:o.accent,theme:o.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:n,config:{...r,...i,...a}})}async function U7(e,t){let r=t?cm:lm,o=t?pm:dm;return I7(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function R1(e,t=!1){let[r,o]=N7(null),{createAnalyticsEvent:n}=I(),{data:i,navigate:a,setModalData:l}=R(),s=i?.funding,d=L7(0);return W7(()=>{let u=setInterval(async()=>{if(e)try{let[m]=await U7(e,t),f=m.status==="waitingAuthorization"&&m.paymentMethod==="credit_debit_card"?"pending":m.status;if(["failed","completed","awaitingAuthorization"].includes(f)&&(n({eventName:Jo,payload:{status:f,provider:Kc,paymentMethod:m.paymentMethod,cardPaymentType:m.cardPaymentType,currency:m.currency?.code,baseCurrencyAmount:m.baseCurrencyAmount,quoteCurrencyAmount:m.quoteCurrencyAmount,feeAmount:m.feeAmount,extraFeeAmount:m.extraFeeAmount,networkFeeAmount:m.networkFeeAmount,isSandbox:t}}),clearInterval(u)),f==="failed"||f==="serviceFailure"){l({funding:{...s,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),a("FUNDING_METHOD_SELECTION_SCREEN");return}o(f)}catch(m){m.response?.status!==404&&(d.current+=1),d.current>=3&&(n({eventName:Jo,payload:{status:"serviceFailure",provider:Kc}}),clearInterval(u),l({funding:{...s,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),a("FUNDING_METHOD_SELECTION_SCREEN"))}},3e3);return()=>clearInterval(u)},[e,d]),r}var k1=(e,t)=>{switch(t){case"native-currency":return O7.has(e);case"USDC":return D7.has(e);default:return console.warn("Unknown asset passed to MoonPay Onramp"),!1}};import{jsx as Zp,jsxs as F7}from"react/jsx-runtime";var Aa=({size:e=61,...t})=>Zp("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:F7("g",{id:"moonpay_symbol_wht 2",children:[Zp("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),Zp("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});import{Fragment as I1,jsx as Ct,jsxs as Tn}from"react/jsx-runtime";var W1=()=>{let{wallets:e}=Vo(),{navigate:t,data:r,setModalData:o}=R(),n=Ne(),i=r?.funding,a=V7(null),[l,s]=G7(!1);M1(()=>{a.current&&a.current.style.setProperty("--funding-input-length",Math.max(i.amount.length,1).toString())},[i.amount,a.current]);let d=n.fundingConfig?.methods.slice()??[],{tokenPrice:u}=_o({chainId:i.chain.id});M1(()=>{i.erc20Address&&i.chain&&!i.erc20ContractInfo&&zc({address:i.erc20Address,chain:i.chain,rpcConfig:n.rpcConfig,privyAppId:n.id}).then(S=>o({...r,funding:{...r.funding,erc20ContractInfo:S?{symbol:S.symbol,decimals:S.decimals}:void 0}})).catch(console.error)},[i.erc20Address,i.chain]);let m=u?Di(i.amount,u):void 0,f=e.find(S=>_1(S.address)===_1(i.address)),y=f&&f.walletClientType!=="privy"?mn(f.walletClientType,f.connectorType,f.walletClientType):n.name,b=parseFloat(i.amount),C=!isNaN(b)&&b>0,w=!!(i.erc20Address&&!i.erc20ContractInfo),A=i.isUSDC?"USDC":i.erc20Address?void 0:"native-currency",k=A&&k1(Number(i.chain.id),A),T=A&&f1(Number(i.chain.id),A),P=i.erc20Address||!i.erc20Address&&!i.isUSDC;return Tn(I1,{children:[Ct(Mt,{}),Tn("h3",{children:["Add funds to your"," ",y?.toLowerCase().endsWith("wallet")?y:y+" wallet"]}),Ct(un,{style:{marginTop:"32px"},children:Ct(ba,{children:w?Ct(Ca,{size:"50px"}):Tn(I1,{children:[Tn(Ea,{onClick:()=>a.current?.focus(),children:[Ct(t1,{ref:a,value:i.amount,onFocus:()=>s(!0),onBlur:()=>s(!1),onChange:S=>{let M=S.target.value;/^[0-9.]*$/.test(M)&&M.split(".").length-1<=1&&o({...r,funding:{...i,amount:M}})}}),Ct(Ta,{children:i.erc20Address?i.erc20ContractInfo?.symbol:i.chain.nativeCurrency.symbol}),!l&&Ct(r1,{children:Ct(B7,{width:12,height:12})})]}),!i.erc20Address&&Ct(Sa,{children:m&&C?m:""})]})})}),Tn(e1,{children:[i.errorMessage&&Ct(E1,{children:i.errorMessage}),d.sort().map(S=>{switch(S){case"moonpay":return k?Tn(Se,{disabled:!C||w,onClick:()=>{t("MOONPAY_PROMPT_SCREEN")},children:[Ct(Bc,{children:Ct(Aa,{style:{width:24}})}),"Moonpay"]},S):null;case"coinbase-onramp":return T?Tn(Se,{disabled:!C||w,onClick:()=>{t("COINBASE_ONRAMP_STATUS_SCREEN")},children:[Ct(Bc,{children:Ct(qo,{style:{width:24}})}),"Coinbase Onramp"]},S):null;case"external":return P?Tn(Se,{disabled:!C||w,onClick:()=>{t("FUNDING_TRANSFER_FROM_WALLET_SCREEN")},children:[Ct(Bc,{children:Ct(H7,{style:{width:24}})}),"Transfer from wallet"]},S):null}}),Ct(n1,{disabled:!C,onClick:()=>t("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),Ct(B,{})]})};import{formatUnits as q7}from"@ethersproject/units";import z7 from"@heroicons/react/24/outline/DocumentDuplicateIcon";import K7 from"@heroicons/react/24/outline/InformationCircleIcon";import Y7 from"@heroicons/react/24/outline/QrCodeIcon";import{useEffect as Q7,useMemo as X7,useState as Jp}from"react";import Pa from"styled-components";import{Fragment as Qc,jsx as Qe,jsxs as Lt}from"react/jsx-runtime";var Z7=2e3,L1=()=>{let{wallets:e}=Vo(),{app:t,data:r,setModalData:o,navigate:n,lastScreen:i}=R(),{chains:a,rpcConfig:l,appId:s,closePrivyModal:d,createAnalyticsEvent:u}=I(),[m,f]=Jp("default"),[y,b]=Jp(void 0),C=r?.funding,{tokenPrice:w}=_o({chainId:C.chain.id}),A=w?Di(C.amount,w):void 0,k=e.find(M=>Xr(M.address)===Xr(C.address)),T=k&&k.walletClientType!=="privy"?mn(k.walletClientType,k.connectorType,k.walletClientType):t.name;if(!C)return o({errorModalData:{error:new Error("Couldn't find funding config"),previousScreen:i||"FUNDING_METHOD_SELECTION_SCREEN"},funding:r?.funding,sendTransaction:r?.sendTransaction}),n("ERROR_SCREEN"),Qe(Qc,{});Q7(()=>{let M=_r(C.chain.id,a,l,{appId:s});function N(){M.getBalance(C.address).then(x=>{let K=parseFloat(q7(x,"ether"));b(W=>(W&&K>W&&u({eventName:Jo,payload:{provider:"manual",status:"success",address:k?.address,value:(K-W).toString()}}),K))}).catch(()=>b(void 0))}let H=setInterval(N,Z7);return N(),()=>clearInterval(H)},[]);let P=X7(()=>y!==void 0?y>=parseFloat(C.amount):!1,[y,C.amount]),S=Lt(Qc,{children:[Qe(Oi,{title:"Your wallet",errMsg:void 0,isLoading:!C||y===void 0,isPulsing:!P,balance:`${y!==void 0?y.toPrecision(2):""} ETH`,address:C.address,statusColor:P?"green":"gray"}),P&&Qe(i1,{onClick:()=>d(),children:"Close"})]});return m==="qr-code"?Lt(Qc,{children:[Qe(_,{backFn:()=>f("default")}),Lt(un,{style:{gap:"24px",marginBottom:"24px"},children:[Lt("div",{children:[Qe(me,{children:"Scan QR code"}),Lt(he,{children:["Scan this code using your mobile wallet to send funds to your ",T," ","wallet."]})]}),Qe(bn,{url:C.address,size:200,squareLogoElement:J7}),S]}),Qe(B,{})]}):Lt(Qc,{children:[Qe(Mt,{}),Qe(Ce,{title:"Send funds",description:"Send funds directly to your wallet by copying your wallet address or scanning a QR code."}),Lt(un,{style:{gap:"16px"},children:[Lt(e8,{children:[Qe(K7,{height:"20px",width:"20px",color:"var(--privy-color-accent-light)"}),Lt(t8,{children:["Make sure to send on ",C.chain.name,"."]})]}),Lt(r8,{children:[Qe(ta,{height:16}),Lt(ba,{children:[Lt(Ea,{children:[Qe(Hc,{children:C.amount}),Qe(Ta,{children:C.chain.nativeCurrency.symbol})]}),Qe(Sa,{children:A?`${A} USD`:"..."}),Lt(o1,{children:[Qe(wa,{chainId:C.chain.id,height:16,width:16})," ",C.chain.name]})]}),Qe(ta,{height:8}),Lt($7,{children:[Qe(j7,{text:C.address}),Qe(O1,{onClick:()=>f("qr-code"),children:Lt(N1,{children:[Qe(Y7,{height:"16px",width:"16px"}),"Scan code"]})})]})]}),S]}),Qe(ta,{height:16}),Qe(B,{})]})},J7=({...e})=>Qe(Wi,{color:"black",...e}),j7=e=>{let[t,r]=Jp(!1);return Qe(O1,{onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},children:Lt(N1,{children:[t?Qe(ga,{style:{height:"16px",width:"16px"},strokeWidth:"2"}):Qe(z7,{style:{height:"16px",width:"16px"}}),t?"Copied":"Copy address"]})})},$7=Pa.div`
1821
1821
  display: flex;
1822
1822
  flex-direction: row;
1823
1823
  gap: 8px;
1824
- `,Y7=wa.div`
1824
+ `,e8=Pa.div`
1825
1825
  display: flex;
1826
1826
  flex-direction: row;
1827
1827
  padding: 8px;
@@ -1830,11 +1830,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1830
1830
  svg {
1831
1831
  margin-right: 12px;
1832
1832
  }
1833
- `,Q7=wa.div`
1833
+ `,t8=Pa.div`
1834
1834
  line-height: 20px;
1835
1835
  font-size: 18px
1836
1836
  text-align: center;
1837
- `,X7=wa.div`
1837
+ `,r8=Pa.div`
1838
1838
  display: flex;
1839
1839
  flex-direction: column;
1840
1840
  background-color: var(--privy-color-background-2);
@@ -1844,11 +1844,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1844
1844
  }
1845
1845
  padding: 16px;
1846
1846
  gap: 8px;
1847
- `,T1=wa.span`
1847
+ `,N1=Pa.span`
1848
1848
  display: flex;
1849
1849
  align-items: center;
1850
1850
  margin: auto;
1851
- `,S1=wa.button`
1851
+ `,O1=Pa.button`
1852
1852
  display: flex;
1853
1853
  align-items: center;
1854
1854
  width: 100%;
@@ -1885,7 +1885,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1885
1885
  width: 18px;
1886
1886
  height: 18px;
1887
1887
  }
1888
- `;import{useEffect as c8,useState as d8}from"react";import Z7 from"@heroicons/react/24/outline/ClockIcon";import J7 from"@heroicons/react/24/outline/EyeSlashIcon";import j7 from"@heroicons/react/24/outline/LinkIcon";import _o from"styled-components";import{Fragment as A1,jsx as Xt,jsxs as ci}from"react/jsx-runtime";var Vp=({title:e,desc:t,icon:r})=>ci(n8,{children:[Xt(a8,{children:r}),ci(i8,{children:[Xt(r8,{children:e}),Xt(o8,{children:t})]})]}),P1=({app:e,signedUrl:t,onContinue:r})=>ci(A1,{children:[ci(e8,{children:[Xt(va,{size:"3.75rem"}),ci(t8,{children:[e?.name," uses ",Xt("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),ci(s8,{children:[Xt(Vp,{icon:Xt(j7,{width:"1rem"}),title:"Purchase assets to fund your account",desc:ci(A1,{children:["Connect a payment method (",Xt("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),Xt(Vp,{icon:Xt(Z7,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),Xt(Vp,{icon:Xt(J7,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),Xt(l8,{className:"mobile-only"})]}),Xt($7,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),Xt(Fl,{disabled:!t,href:t??"#",target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),$7=_o.span`
1888
+ `;import{useEffect as y8,useState as g8}from"react";import o8 from"@heroicons/react/24/outline/ClockIcon";import n8 from"@heroicons/react/24/outline/EyeSlashIcon";import i8 from"@heroicons/react/24/outline/LinkIcon";import Mo from"styled-components";import{Fragment as D1,jsx as zt,jsxs as gi}from"react/jsx-runtime";var jp=({title:e,desc:t,icon:r})=>gi(p8,{children:[zt(m8,{children:r}),gi(u8,{children:[zt(c8,{children:e}),zt(d8,{children:t})]})]}),U1=({app:e,signedUrl:t,onContinue:r})=>gi(D1,{children:[gi(s8,{children:[zt(Aa,{size:"3.75rem"}),gi(l8,{children:[e?.name," uses ",zt("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),gi(f8,{children:[zt(jp,{icon:zt(i8,{width:"1rem"}),title:"Purchase assets to fund your account",desc:gi(D1,{children:["Connect a payment method (",zt("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),zt(jp,{icon:zt(o8,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),zt(jp,{icon:zt(n8,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),zt(h8,{className:"mobile-only"})]}),zt(a8,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),zt(Kl,{disabled:!t,href:t??"#",target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),a8=Mo.span`
1889
1889
  display: inline-block;
1890
1890
  color: var(--privy-color-foreground-3);
1891
1891
  text-align: center;
@@ -1894,13 +1894,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
1894
1894
  font-weight: 400;
1895
1895
  line-height: 140%; /* 0.875rem */
1896
1896
  margin-bottom: 0.25rem;
1897
- `,e8=_o.div`
1897
+ `,s8=Mo.div`
1898
1898
  display: flex;
1899
1899
  flex-direction: column;
1900
1900
  align-items: center;
1901
1901
  justify-content: center;
1902
1902
  padding: 1.5rem 0;
1903
- `,t8=_o.span`
1903
+ `,l8=Mo.span`
1904
1904
  color: var(--privy-color-foreground);
1905
1905
  text-align: center;
1906
1906
  font-size: 1.125rem;
@@ -1909,46 +1909,46 @@ You will need this password to access your ${e} wallet on a new device. Please k
1909
1909
  margin: 1.5rem 0;
1910
1910
  text-align: center;
1911
1911
  max-width: 19.5rem;
1912
- `,r8=_o.span`
1912
+ `,c8=Mo.span`
1913
1913
  color: var(--privy-color-foreground);
1914
1914
  font-size: 0.875rem;
1915
1915
  font-weight: 500;
1916
1916
  line-height: 1.225rem;
1917
1917
  width: 100%;
1918
- `,o8=_o.span`
1918
+ `,d8=Mo.span`
1919
1919
  color: var(--privy-color-foreground-2);
1920
1920
  font-size: 0.875rem;
1921
1921
  font-weight: 400;
1922
1922
  line-height: 1.225rem;
1923
- `,n8=_o.div`
1923
+ `,p8=Mo.div`
1924
1924
  display: flex;
1925
1925
  align-items: flex-start;
1926
1926
  gap: 0.5rem;
1927
1927
  align-self: stretch;
1928
- `,i8=_o.div`
1928
+ `,u8=Mo.div`
1929
1929
  display: flex;
1930
1930
  flex-direction: column;
1931
1931
  gap: 0.25rem;
1932
1932
  align-items: flex-start;
1933
1933
  text-align: left;
1934
1934
  flex: 1 0 0;
1935
- `,a8=_o.div`
1935
+ `,m8=Mo.div`
1936
1936
  padding-top: 2px;
1937
- `,s8=_o.div`
1937
+ `,f8=Mo.div`
1938
1938
  display: flex;
1939
1939
  flex-direction: column;
1940
1940
  gap: 1.25rem;
1941
1941
  margin: 0 0.5rem;
1942
- `,l8=_o.div`
1942
+ `,h8=Mo.div`
1943
1943
  margin: 30px 0;
1944
- `;import{Fragment as p8,jsx as Gp,jsxs as u8}from"react/jsx-runtime";var x1=()=>{let{app:e,data:t,navigate:r,setModalData:o}=P(),{createAnalyticsEvent:n,getMoonpaySignedUrl:i}=_(),[a,l]=d8(null),s=t?.funding,d=s.isUSDC?"USDC":"native-currency";return c8(()=>{if(a||!s)return;async function m(){if(!e.fundingConfig)return;let{signedUrl:f,externalTransactionId:u}=await i(s.address,{...e.fundingMethodConfig.moonpay,...s.moonpayConfigOverride,currencyCode:s.moonpayConfigOverride?.currencyCode??p1(s.chain.id,d),quoteCurrencyAmount:s.moonpayConfigOverride?.quoteCurrencyAmount??u1(s.amount)});l(f),o({moonpayStatus:{externalTransactionId:u},funding:t?.funding})}m()},[a,s]),u8(p8,{children:[Gp(Wt,{}),Gp(P1,{app:e,signedUrl:a,onContinue:()=>{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:Uc}}),r("MOONPAY_STATUS_SCREEN")}}),Gp(H,{})]})};import m8 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import f8 from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as h8}from"react";import R1 from"styled-components";import{Fragment as _1,jsx as Sr,jsxs as ws}from"react/jsx-runtime";var k1=()=>{let{app:e,data:t}=P(),{closePrivyModal:r}=_(),{externalTransactionId:o}=t?.moonpayStatus,n=y1(o||null,e.fundingMethodConfig.moonpay.useSandbox??!1);return ws(_1,{children:[Sr(R,{title:"Fund account"},"header"),Sr(g8,{status:n,onClickCta:r}),Sr(H,{})]})},y8=e=>{switch(e){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}},g8=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=h8(()=>y8(e),[e]);return ws(_1,{children:[ws(E8,{children:[Sr(w8,{status:e}),ws(Ze,{children:[Sr("h3",{children:r}),Sr(b8,{children:o})]})]}),n&&Sr(U,{onClick:t,children:n})]})},C8=e=>e?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[e]:"var(--privy-color-foreground-4)",v8=e=>{switch(e){case"completed":return f8;case"waitingAuthorization":return()=>Sr(m8,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},w8=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return ws("div",{style:{position:"relative"},children:[Sr(dt,{color:o,style:{position:"absolute"}}),Sr(Qa,{color:o}),Sr(va,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=v8(e),r=C8(e);return Sr("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&Sr(t,{width:"4rem",height:"4rem",color:r})})},b8=R1.p`
1944
+ `;import{Fragment as C8,jsx as $p,jsxs as v8}from"react/jsx-runtime";var F1=()=>{let{app:e,data:t,navigate:r,setModalData:o}=R(),{createAnalyticsEvent:n,getMoonpaySignedUrl:i}=I(),[a,l]=g8(null),s=t?.funding,d=s.isUSDC?"USDC":"native-currency";return y8(()=>{if(a||!s)return;async function u(){if(!e.fundingConfig)return;let{signedUrl:m,externalTransactionId:f}=await i(s.address,{...e.fundingMethodConfig.moonpay,...s.moonpayConfigOverride,currencyCode:s.moonpayConfigOverride?.currencyCode??S1(s.chain.id,d),quoteCurrencyAmount:s.moonpayConfigOverride?.quoteCurrencyAmount??A1(s.amount)});l(m),o({moonpayStatus:{externalTransactionId:f},funding:t?.funding})}u()},[a,s]),v8(C8,{children:[$p(Mt,{}),$p(U1,{app:e,signedUrl:a,onContinue:()=>{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:Kc}}),r("MOONPAY_STATUS_SCREEN")}}),$p(B,{})]})};import w8 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import b8 from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as E8}from"react";import B1 from"styled-components";import{Fragment as V1,jsx as Er,jsxs as Ps}from"react/jsx-runtime";var H1=()=>{let{app:e,data:t}=R(),{closePrivyModal:r}=I(),{externalTransactionId:o}=t?.moonpayStatus,n=R1(o||null,e.fundingMethodConfig.moonpay.useSandbox??!1);return Ps(V1,{children:[Er(_,{title:"Fund account"},"header"),Er(S8,{status:n,onClickCta:r}),Er(B,{})]})},T8=e=>{switch(e){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}},S8=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=E8(()=>T8(e),[e]);return Ps(V1,{children:[Ps(k8,{children:[Er(x8,{status:e}),Ps(je,{children:[Er("h3",{children:r}),Er(R8,{children:o})]})]}),n&&Er(F,{onClick:t,children:n})]})},A8=e=>e?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[e]:"var(--privy-color-foreground-4)",P8=e=>{switch(e){case"completed":return b8;case"waitingAuthorization":return()=>Er(w8,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},x8=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return Ps("div",{style:{position:"relative"},children:[Er(lt,{color:o,style:{position:"absolute"}}),Er(es,{color:o}),Er(Aa,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=P8(e),r=A8(e);return Er("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&Er(t,{width:"4rem",height:"4rem",color:r})})},R8=B1.p`
1945
1945
  font-size: 1rem;
1946
1946
  color: var(--privy-color-foreground-3);
1947
1947
  margin-bottom: 1rem;
1948
1948
  display: flex;
1949
1949
  flex-direction: column;
1950
1950
  gap: 1rem;
1951
- `,E8=R1.div`
1951
+ `,k8=B1.div`
1952
1952
  display: flex;
1953
1953
  flex-direction: column;
1954
1954
  align-items: center;
@@ -1956,7 +1956,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1956
1956
  margin-left: 1.75rem;
1957
1957
  margin-right: 1.75rem;
1958
1958
  padding: 2rem 0;
1959
- `;import{useEffect as _8,useState as M8}from"react";import T8,{css as S8}from"styled-components";import{jsx as P8}from"react/jsx-runtime";var Bc=()=>{let{enabled:e,token:t}=Pe(),{navigate:r,setModalData:o}=P(),{initLoginWithPasskey:n}=_();return P8(qp,{onClick:async()=>{e&&!t?(o({captchaModalData:{callback:a=>n(a),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSKEY_SYSTEM_DIALOGUE",onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):(await n(),r("AWAITING_PASSKEY_SYSTEM_DIALOGUE"))},children:"I have a passkey"})},A8=S8`
1959
+ `;import{useEffect as D8,useState as U8}from"react";import _8,{css as M8}from"styled-components";import{jsx as W8}from"react/jsx-runtime";var Xc=()=>{let{enabled:e,token:t}=Te(),{navigate:r,setModalData:o}=R(),{initLoginWithPasskey:n}=I();return W8(eu,{onClick:async()=>{e&&!t?(o({captchaModalData:{callback:a=>n(a),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSKEY_SYSTEM_DIALOGUE",onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):(await n(),r("AWAITING_PASSKEY_SYSTEM_DIALOGUE"))},children:"I have a passkey"})},I8=M8`
1960
1960
  && {
1961
1961
  width: 100%;
1962
1962
  font-size: 0.875rem;
@@ -1981,9 +1981,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
1981
1981
  box-shadow: none;
1982
1982
  }
1983
1983
  }
1984
- `,qp=T8.button`
1985
- ${A8}
1986
- `;import x8 from"@heroicons/react/24/outline/ChevronRightIcon";import R8 from"@heroicons/react/24/outline/WalletIcon";import{jsx as zp,jsxs as k8}from"react/jsx-runtime";var Hc=({onClick:e,text:t})=>k8(xe,{onClick:e,children:[zp(R8,{}),zp(gr,{children:t}),zp(x8,{})]});import{Fragment as M1,jsx as wn,jsxs as Vc}from"react/jsx-runtime";var I1=()=>{let{connectors:e}=_(),{app:t,setModalData:r,data:o,navigate:n}=P(),[i,a]=M8("default"),l=dn(t.appearance.walletList,e,!0,t.appearance.walletList,t.externalWallets.walletConnect.enabled),s=wn(Hc,{text:"More wallets",onClick:()=>a("overflow")});return _8(()=>{r({...o,externalConnectWallet:{onCompleteNavigateTo:"FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"}})},[]),i==="overflow"?Vc(M1,{children:[wn(R,{backFn:()=>a("default")},"header"),Vc(ir,{children:[wn(Hr,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),l]}),wn(H,{})]}):Vc(M1,{children:[wn(Wt,{}),wn(ve,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),Vc(ir,{children:[...l.length>3?l.slice(0,2):l,l.length>3&&s,wn(qp,{onClick:()=>n("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),wn(H,{})]})};import I8 from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import W8 from"styled-components";import{Fragment as N8,jsx as bn,jsxs as O8}from"react/jsx-runtime";var W1=()=>{let{closePrivyModal:e}=_();return O8(N8,{children:[bn(R,{},"header"),bn(L8,{children:bn(I8,{style:{width:32,height:32}})}),bn(So,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),bn(cr,{children:bn(U,{onClick:()=>e(),children:"Close"})}),bn(ae,{}),bn(H,{})]})},L8=W8.div`
1984
+ `,eu=_8.button`
1985
+ ${I8}
1986
+ `;import L8 from"@heroicons/react/24/outline/ChevronRightIcon";import N8 from"@heroicons/react/24/outline/WalletIcon";import{jsx as tu,jsxs as O8}from"react/jsx-runtime";var Zc=({onClick:e,text:t})=>O8(Se,{onClick:e,children:[tu(N8,{}),tu(hr,{children:t}),tu(L8,{})]});import{Fragment as G1,jsx as Sn,jsxs as Jc}from"react/jsx-runtime";var q1=()=>{let{connectors:e}=I(),{app:t,setModalData:r,data:o,navigate:n}=R(),[i,a]=U8("default"),l=fn(t.appearance.walletList,e,!0,t.appearance.walletList,t.externalWallets.walletConnect.enabled),s=Sn(Zc,{text:"More wallets",onClick:()=>a("overflow")});return D8(()=>{r({...o,externalConnectWallet:{onCompleteNavigateTo:"FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"}})},[]),i==="overflow"?Jc(G1,{children:[Sn(_,{backFn:()=>a("default")},"header"),Jc(or,{children:[Sn(Fr,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),l]}),Sn(B,{})]}):Jc(G1,{children:[Sn(Mt,{}),Sn(Ce,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),Jc(or,{children:[...l.length>3?l.slice(0,2):l,l.length>3&&s,Sn(eu,{onClick:()=>n("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),Sn(B,{})]})};import F8 from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import B8 from"styled-components";import{Fragment as V8,jsx as An,jsxs as G8}from"react/jsx-runtime";var z1=()=>{let{closePrivyModal:e}=I();return G8(V8,{children:[An(_,{},"header"),An(H8,{children:An(F8,{style:{width:32,height:32}})}),An(Ao,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),An(sr,{children:An(F,{onClick:()=>e(),children:"Close"})}),An(oe,{}),An(B,{})]})},H8=B8.div`
1987
1987
  border-radius: 50%;
1988
1988
  height: 68px;
1989
1989
  width: 68px;
@@ -1993,18 +1993,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1993
1993
  background-color: var(--privy-color-accent);
1994
1994
  color: white;
1995
1995
  margin: 0 auto 24px auto;
1996
- `;import*as D1 from"react-device-detect";import B8 from"styled-components";import Kp from"styled-components";import{jsx as L1}from"react/jsx-runtime";var N1=({style:e,...t})=>L1("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:L1("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});import{jsx as U8,jsxs as F8}from"react/jsx-runtime";var O1=Kp.div`
1996
+ `;import*as X1 from"react-device-detect";import Y8 from"styled-components";import ru from"styled-components";import{jsx as K1}from"react/jsx-runtime";var Y1=({style:e,...t})=>K1("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:K1("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});import{jsx as z8,jsxs as K8}from"react/jsx-runtime";var Q1=ru.div`
1997
1997
  display: flex;
1998
1998
  flex-direction: column;
1999
1999
  justify-content: flex-start;
2000
2000
  gap: 4px;
2001
- `,Yp=Kp.div`
2001
+ `,ou=ru.div`
2002
2002
  &&& {
2003
2003
  margin-left: 7px; /* TODO: This is a total hack */
2004
2004
  border-left: 2px solid var(--privy-color-foreground-4);
2005
2005
  height: 12px;
2006
2006
  }
2007
- `,Gc=({children:e})=>F8(D8,{children:[U8(N1,{style:{width:"16px",height:"16px"}}),e]}),D8=Kp.div`
2007
+ `,jc=({children:e})=>K8(q8,{children:[z8(Y1,{style:{width:"16px",height:"16px"}}),e]}),q8=ru.div`
2008
2008
  display: flex;
2009
2009
  justify-content: flex-start;
2010
2010
  justify-items: center;
@@ -2022,22 +2022,22 @@ You will need this password to access your ${e} wallet on a new device. Please k
2022
2022
  margin-bottom: auto;
2023
2023
  }
2024
2024
  }
2025
- `;import{Fragment as G8,jsx as Pt,jsxs as bs}from"react/jsx-runtime";var H8=()=>bs(V8,{children:[Pt(jn,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),Pt(St,{children:Pt(wo,{style:{width:"152px",height:"152px"}})}),bs(O1,{children:[Pt(Gc,{children:bs("div",{children:[Pt("span",{children:"Install the "}),Pt("a",{href:D1.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",target:"_blank",children:"Phantom browser extension"})]})}),Pt(Yp,{}),Pt(Gc,{children:"Set up your first wallet"}),Pt(Yp,{}),Pt(Gc,{children:"Store your recovery phrase in a safe place!"})]}),Pt(an,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),U1=()=>{let{navigateBack:e}=P();return bs(G8,{children:[Pt(R,{backFn:e},"header"),Pt(ie,{}),Pt(H8,{}),Pt(ae,{}),bs(J,{children:[Pt("span",{children:"Still not sure? "}),Pt("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},V8=B8(St)`
2025
+ `;import{Fragment as Z8,jsx as At,jsxs as xs}from"react/jsx-runtime";var Q8=()=>xs(X8,{children:[At(ii,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),At(Tt,{children:At(bo,{style:{width:"152px",height:"152px"}})}),xs(Q1,{children:[At(jc,{children:xs("div",{children:[At("span",{children:"Install the "}),At("a",{href:X1.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",target:"_blank",children:"Phantom browser extension"})]})}),At(ou,{}),At(jc,{children:"Set up your first wallet"}),At(ou,{}),At(jc,{children:"Store your recovery phrase in a safe place!"})]}),At(dn,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),Z1=()=>{let{navigateBack:e}=R();return xs(Z8,{children:[At(_,{backFn:e},"header"),At(re,{}),At(Q8,{}),At(oe,{}),xs(J,{children:[At("span",{children:"Still not sure? "}),At("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},X8=Y8(Tt)`
2026
2026
  gap: 30px;
2027
2027
 
2028
2028
  > :first-child > svg {
2029
2029
  margin-top: 20px;
2030
2030
  }
2031
- `;import W9 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as L9,useState as r2}from"react";import N9 from"styled-components";var q8={apple_oauth:"apple",custom_auth:"custom",discord_oauth:"discord",email:"email",farcaster:"farcaster",github_oauth:"github",google_oauth:"google",instagram_oauth:"instagram",linkedin_oauth:"linkedin",passkey:"passkey",phone:"sms",spotify_oauth:"spotify",telegram:"telegram",tiktok_oauth:"tiktok",twitter_oauth:"twitter",wallet:"siwe",cross_app:"privy:",guest:"guest"},En=e=>{let t=q8[e];return e==="wallet"||e==="phone"?{displayName:e,loginMethod:t}:{displayName:t,loginMethod:t}};import Y8 from"styled-components";import z8 from"react";import{jsx as K8}from"react/jsx-runtime";var F1=()=>{let{app:e}=P(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?K8("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?z8.cloneElement(t,{alt:r,style:o}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};import{jsx as B1}from"react/jsx-runtime";var qc=e=>{let{app:t}=P();return t?.appearance.logo?B1(Q8,{...e,children:B1(F1,{})}):null},Q8=Y8.div`
2031
+ `;import B9 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as H9,useState as f2}from"react";import V9 from"styled-components";var J8={apple_oauth:"apple",custom_auth:"custom",discord_oauth:"discord",email:"email",farcaster:"farcaster",github_oauth:"github",google_oauth:"google",instagram_oauth:"instagram",linkedin_oauth:"linkedin",passkey:"passkey",phone:"sms",spotify_oauth:"spotify",telegram:"telegram",tiktok_oauth:"tiktok",twitter_oauth:"twitter",wallet:"siwe",cross_app:"privy:",guest:"guest"},Pn=e=>{let t=J8[e];return e==="wallet"||e==="phone"?{displayName:e,loginMethod:t}:{displayName:t,loginMethod:t}};import e9 from"styled-components";import j8 from"react";import{jsx as $8}from"react/jsx-runtime";var J1=()=>{let{app:e}=R(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?$8("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?j8.cloneElement(t,{alt:r,style:o}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};import{jsx as j1}from"react/jsx-runtime";var $c=e=>{let{app:t}=R();return t?.appearance.logo?j1(t9,{...e,children:j1(J1,{})}):null},t9=e9.div`
2032
2032
  display: flex;
2033
2033
  flex-direction: column;
2034
2034
  align-items: center;
2035
2035
  padding: 24px 0;
2036
2036
  flex-grow: 1;
2037
2037
  justify-content: center;
2038
- `;import e9 from"@heroicons/react/24/outline/EnvelopeIcon";import{useRef as t9}from"react";import X8 from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as Z8,useState as Qp}from"react";import V1 from"styled-components";import{Fragment as $8,jsx as di,jsxs as H1}from"react/jsx-runtime";var zc=Z8((e,t)=>{let[r,o]=Qp(e.defaultValue||""),[n,i]=Qp(!1),{authenticated:a}=V(),{initLoginWithEmail:l}=_(),{navigate:s,setModalData:d,currentScreen:m}=P(),{enabled:f,token:u}=Pe(),[g,v]=Qp(!1),{accountType:C}=Rt(),b=Ys(r),A=n,k=n||!b,S=T=>{i(!0),l(r,T).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(M=>{d({errorModalData:{error:M,previousScreen:m||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},x=()=>{f&&!u&&!a?(d({captchaModalData:{callback:T=>l(r,T),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):S(u)};return H1($8,{children:[di(J8,{children:H1(j8,{stacked:e.stacked,children:[di(X8,{}),di("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onFocus:()=>v(!0),onChange:T=>o(T.target.value),onKeyUp:T=>{T.key==="Enter"&&x()},value:r,autoComplete:"email"}),C==="email"&&!g?di(er,{color:"gray",children:"Recent"}):e.stacked?di("span",{}):di(qi,{isSubmitting:A,onClick:x,disabled:k,children:"Submit"})]})}),e.stacked?di(U,{loadingText:null,loading:A,disabled:k,onClick:x,children:"Submit"}):null]})}),J8=V1.div`
2038
+ `;import s9 from"@heroicons/react/24/outline/EnvelopeIcon";import{useRef as l9}from"react";import r9 from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as o9,useState as nu}from"react";import e2 from"styled-components";import{Fragment as a9,jsx as Ci,jsxs as $1}from"react/jsx-runtime";var ed=o9((e,t)=>{let[r,o]=nu(e.defaultValue||""),[n,i]=nu(!1),{authenticated:a}=V(),{initLoginWithEmail:l}=I(),{navigate:s,setModalData:d,currentScreen:u,data:m}=R(),{enabled:f,token:y}=Te(),[b,C]=nu(!1),{accountType:w}=Pt(),A=js(r),k=n,T=n||!A,P=M=>{i(!0),l(r,M,m?.login?.disableSignup).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(N=>{d({errorModalData:{error:N,previousScreen:u||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},S=()=>{f&&!y&&!a?(d({captchaModalData:{callback:M=>l(r,M),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):P(y)};return $1(a9,{children:[Ci(n9,{children:$1(i9,{stacked:e.stacked,children:[Ci(r9,{}),Ci("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onFocus:()=>C(!0),onChange:M=>o(M.target.value),onKeyUp:M=>{M.key==="Enter"&&S()},value:r,autoComplete:"email"}),w==="email"&&!b?Ci(jt,{color:"gray",children:"Recent"}):e.stacked?Ci("span",{}):Ci(ji,{isSubmitting:k,onClick:S,disabled:T,children:"Submit"})]})}),e.stacked?Ci(F,{loadingText:null,loading:k,disabled:T,onClick:S,children:"Submit"}):null]})}),n9=e2.div`
2039
2039
  width: 100%;
2040
- `,j8=V1.label`
2040
+ `,i9=e2.label`
2041
2041
  display: block;
2042
2042
  position: relative;
2043
2043
  width: 100%;
@@ -2104,11 +2104,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
2104
2104
  && > input::placeholder {
2105
2105
  color: var(--privy-color-foreground-3);
2106
2106
  }
2107
- `;import{Fragment as r9,jsx as Kc,jsxs as G1}from"react/jsx-runtime";var Yc=({isEditable:e,setIsEditable:t,defaultValue:r})=>{let o=t9(null);return G1(r9,{children:[Kc(to,{if:!e,children:Kc(zc,{ref:o,defaultValue:r})}),Kc(to,{if:e,children:G1(xe,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[Kc(e9,{})," Continue with Email"]})})]})};import{useState as o9}from"react";import n9 from"styled-components";import{jsx as Xp,jsxs as a9}from"react/jsx-runtime";var Qc=()=>{let[e,t]=o9(!1),{currentScreen:r,navigate:o,setModalData:n}=P(),{enabled:i,token:a}=Pe(),{initLoginWithFarcaster:l}=_(),{accountType:s}=Rt();return a9(xe,{onClick:async()=>{t(!0);try{i&&!a?(n({captchaModalData:{callback:m=>l(m),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await l(a),o("AWAITING_FARCASTER_CONNECTION"))}catch(m){n({errorModalData:{error:m,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[Xp(xo,{})," Farcaster",e&&Xp(bo,{}),s==="farcaster"&&Xp(i9,{color:"gray",children:"Recent"})]})},i9=n9(er)`
2107
+ `;import{Fragment as c9,jsx as td,jsxs as t2}from"react/jsx-runtime";var rd=({isEditable:e,setIsEditable:t,defaultValue:r})=>{let o=l9(null);return t2(c9,{children:[td(eo,{if:!e,children:td(ed,{ref:o,defaultValue:r})}),td(eo,{if:e,children:t2(Se,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[td(s9,{})," Continue with Email"]})})]})};import{useState as d9}from"react";import p9 from"styled-components";import{jsx as iu,jsxs as m9}from"react/jsx-runtime";var od=()=>{let[e,t]=d9(!1),{currentScreen:r,navigate:o,setModalData:n,data:i}=R(),{enabled:a,token:l}=Te(),{initLoginWithFarcaster:s}=I(),{accountType:d}=Pt();return m9(Se,{onClick:async()=>{t(!0);try{a&&!l?(n({captchaModalData:{callback:m=>s(m,i?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await s(l,i?.login?.disableSignup),o("AWAITING_FARCASTER_CONNECTION"))}catch(m){n({errorModalData:{error:m,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[iu(Ro,{})," Farcaster",e&&iu(Eo,{}),d==="farcaster"&&iu(u9,{color:"gray",children:"Recent"})]})},u9=p9(jt)`
2108
2108
  margin-left: auto;
2109
- `;import v9 from"@heroicons/react/24/outline/PhoneIcon";import{useRef as w9}from"react";import{forwardRef as f9,useEffect as h9,useState as Jc}from"react";import J1 from"styled-components";import s9 from"libphonenumber-js/examples.mobile.json";import{isPossiblePhoneNumber as l9,AsYouType as q1,getCountries as c9,getCountryCallingCode as Xc,getExampleNumber as d9}from"libphonenumber-js/min";import{jsx as m9,jsxs as u9}from"react/jsx-runtime";var Es=(e,t)=>l9(String(e),t),Zc=(e,t)=>`+${Xc(t)} ${e}`,z1=e=>`*${e.replaceAll("-","").slice(-4)}`,K1=e=>new q1(e),p9=c9().map(e=>({code:e,callCode:Xc(e)})),Y1=e=>{let t=d9(e,s9)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},Q1=({value:e,onChange:t})=>m9("select",{value:e,onChange:t,children:p9.map(r=>u9("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))}),X1=e=>{let t=new q1;t.input(e);let r=t.getCountry()||"US",o=t.getCallingCode()||"1";return{countryCode:r,phone:e.replace("+"+o,"")}};import{Fragment as C9,jsx as pi,jsxs as Z1}from"react/jsx-runtime";var Tn=f9((e,t)=>{let{app:r}=P(),[o,n]=Jc(!1),{accountType:i}=Rt(),[a,l]=Jc(""),[s,d]=Jc(r?.intl.defaultCountry??"US"),m=Es(a,s),f=K1(s),u=Y1(s),g=Xc(s),v=!m,[C,b]=Jc(!1),A=g.length,k=T=>{let M=T.target.value;d(M),l(""),e.onChange&&e.onChange({rawPhoneNumber:a,qualifiedPhoneNumber:Zc(a,M),countryCode:M,isValid:Es(a,s)})},S=(T,M)=>{try{let D=T.replace(/\D/g,""),B=a.replace(/\D/g,""),K=D===B?T:f.input(T);l(K),e.onChange&&e.onChange({rawPhoneNumber:K,qualifiedPhoneNumber:Zc(T,M),countryCode:M,isValid:Es(T,M)})}catch(D){console.error("Error processing phone number:",D)}},x=()=>{b(!0);let T=Zc(a,s);e.onSubmit({rawPhoneNumber:a,qualifiedPhoneNumber:T,countryCode:s,isValid:Es(a,s)}).finally(()=>b(!1))};return h9(()=>{if(e.defaultValue){let T=X1(e.defaultValue);f.reset(),k({target:{value:T.countryCode}}),S(T.phone,T.countryCode)}},[e.defaultValue]),Z1(C9,{children:[pi(y9,{children:Z1(g9,{callingCodeLength:A,stacked:e.stacked,children:[pi(Q1,{value:s,onChange:k}),pi("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:u,onFocus:()=>n(!0),onChange:T=>{S(T.target.value,s)},onKeyUp:T=>{T.key==="Enter"&&x()},value:a,autoComplete:"tel"}),i==="phone"&&!o&&!e.hideRecent?pi(er,{color:"gray",children:"Recent"}):!e.stacked&&!e.noIncludeSubmitButton?pi(qi,{isSubmitting:C,onClick:x,disabled:v,children:"Submit"}):pi("span",{})]})}),e.stacked&&!e.noIncludeSubmitButton?pi(U,{loading:C,loadingText:null,onClick:x,disabled:v,children:"Submit"}):null]})}),y9=J1.div`
2109
+ `;import P9 from"@heroicons/react/24/outline/PhoneIcon";import{useRef as x9}from"react";import{forwardRef as b9,useEffect as E9,useState as ad}from"react";import c2 from"styled-components";import f9 from"libphonenumber-js/examples.mobile.json";import{isPossiblePhoneNumber as h9,AsYouType as r2,getCountries as y9,getCountryCallingCode as nd,getExampleNumber as g9}from"libphonenumber-js/min";import{jsx as w9,jsxs as v9}from"react/jsx-runtime";var Rs=(e,t)=>h9(String(e),t),id=(e,t)=>`+${nd(t)} ${e}`,o2=e=>`*${e.replaceAll("-","").slice(-4)}`,n2=e=>new r2(e),C9=y9().map(e=>({code:e,callCode:nd(e)})),i2=e=>{let t=g9(e,f9)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},a2=({value:e,onChange:t})=>w9("select",{value:e,onChange:t,children:C9.map(r=>v9("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))}),s2=e=>{let t=new r2;t.input(e);let r=t.getCountry()||"US",o=t.getCallingCode()||"1";return{countryCode:r,phone:e.replace("+"+o,"")}};import{Fragment as A9,jsx as vi,jsxs as l2}from"react/jsx-runtime";var xn=b9((e,t)=>{let{app:r}=R(),[o,n]=ad(!1),{accountType:i}=Pt(),[a,l]=ad(""),[s,d]=ad(r?.intl.defaultCountry??"US"),u=Rs(a,s),m=n2(s),f=i2(s),y=nd(s),b=!u,[C,w]=ad(!1),A=y.length,k=S=>{let M=S.target.value;d(M),l(""),e.onChange&&e.onChange({rawPhoneNumber:a,qualifiedPhoneNumber:id(a,M),countryCode:M,isValid:Rs(a,s)})},T=(S,M)=>{try{let N=S.replace(/\D/g,""),H=a.replace(/\D/g,""),x=N===H?S:m.input(S);l(x),e.onChange&&e.onChange({rawPhoneNumber:x,qualifiedPhoneNumber:id(S,M),countryCode:M,isValid:Rs(S,M)})}catch(N){console.error("Error processing phone number:",N)}},P=()=>{w(!0);let S=id(a,s);e.onSubmit({rawPhoneNumber:a,qualifiedPhoneNumber:S,countryCode:s,isValid:Rs(a,s)}).finally(()=>w(!1))};return E9(()=>{if(e.defaultValue){let S=s2(e.defaultValue);m.reset(),k({target:{value:S.countryCode}}),T(S.phone,S.countryCode)}},[e.defaultValue]),l2(A9,{children:[vi(T9,{children:l2(S9,{callingCodeLength:A,stacked:e.stacked,children:[vi(a2,{value:s,onChange:k}),vi("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:f,onFocus:()=>n(!0),onChange:S=>{T(S.target.value,s)},onKeyUp:S=>{S.key==="Enter"&&P()},value:a,autoComplete:"tel"}),i==="phone"&&!o&&!e.hideRecent?vi(jt,{color:"gray",children:"Recent"}):!e.stacked&&!e.noIncludeSubmitButton?vi(ji,{isSubmitting:C,onClick:P,disabled:b,children:"Submit"}):vi("span",{})]})}),e.stacked&&!e.noIncludeSubmitButton?vi(F,{loading:C,loadingText:null,onClick:P,disabled:b,children:"Submit"}):null]})}),T9=c2.div`
2110
2110
  width: 100%;
2111
- `,g9=J1.label`
2111
+ `,S9=c2.label`
2112
2112
  --country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
2113
2113
  --phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px));
2114
2114
  display: block;
@@ -2201,15 +2201,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
2201
2201
  && > input::placeholder {
2202
2202
  color: var(--privy-color-foreground-3);
2203
2203
  }
2204
- `;import{Fragment as b9,jsx as jc,jsxs as j1}from"react/jsx-runtime";var $c=({isEditable:e,setIsEditable:t,defaultValue:r})=>{let o=w9(null),{authenticated:n}=V(),{navigate:i,setModalData:a,currentScreen:l}=P(),{initLoginWithSms:s}=_(),{enabled:d,token:m}=Pe();async function f({qualifiedPhoneNumber:u}){if(d&&!m&&!n)a({captchaModalData:{callback:g=>s(u,g),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),i("CAPTCHA_SCREEN");else try{await s(u,m),i("AWAITING_PASSWORDLESS_CODE")}catch(g){a({errorModalData:{error:g,previousScreen:l||"LANDING"}}),i("ERROR_SCREEN")}}return j1(b9,{children:[jc(to,{if:!e,children:jc(Tn,{ref:o,onSubmit:f,defaultValue:r})}),jc(to,{if:e,children:j1(xe,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[jc(v9,{})," Continue with SMS"]})})]})};import{useState as E9}from"react";import T9 from"styled-components";import{jsx as Mo,jsxs as P9}from"react/jsx-runtime";var S9={apple:{logo:Mo(fl,{}),displayName:"Apple"},discord:{logo:Mo(hl,{}),displayName:"Discord"},github:{logo:Mo(yl,{}),displayName:"GitHub"},google:{logo:Mo(Cl,{}),displayName:"Google"},linkedin:{logo:Mo(El,{}),displayName:"LinkedIn"},spotify:{logo:Mo(Tl,{}),displayName:"Spotify"},instagram:{logo:Mo(wl,{}),displayName:"Instagram"},twitter:{logo:Mo(Al,{}),displayName:"Twitter"},tiktok:{logo:Mo(Sl,{}),displayName:"TikTok"}},pt=({provider:e})=>{let{enabled:t,token:r}=Pe(),{navigate:o,setModalData:n}=P(),[i,a]=E9(!1),{initLoginWithOAuth:l}=_(),{accountType:s}=Rt(),d=s?En(s):null,{displayName:m,logo:f}=S9[e];return P9(xe,{onClick:()=>{a(!0),t&&!r?(n({captchaModalData:{callback:g=>l(e,g),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):l(e)},disabled:i,children:[f," ",m,d?.loginMethod===e&&Mo(A9,{color:"gray",children:"Recent"})]})},A9=T9(er)`
2204
+ `;import{Fragment as R9,jsx as sd,jsxs as d2}from"react/jsx-runtime";var ld=({isEditable:e,setIsEditable:t,defaultValue:r})=>{let o=x9(null),{authenticated:n}=V(),{navigate:i,setModalData:a,currentScreen:l,data:s}=R(),{initLoginWithSms:d}=I(),{enabled:u,token:m}=Te();async function f({qualifiedPhoneNumber:y}){if(u&&!m&&!n)a({captchaModalData:{callback:b=>d(y,b,s?.login?.disableSignup),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),i("CAPTCHA_SCREEN");else try{await d(y,m,s?.login?.disableSignup),i("AWAITING_PASSWORDLESS_CODE")}catch(b){a({errorModalData:{error:b,previousScreen:l||"LANDING"}}),i("ERROR_SCREEN")}}return d2(R9,{children:[sd(eo,{if:!e,children:sd(xn,{ref:o,onSubmit:f,defaultValue:r})}),sd(eo,{if:e,children:d2(Se,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[sd(P9,{})," Continue with SMS"]})})]})};import{useState as k9}from"react";import _9 from"styled-components";import{jsx as Io,jsxs as W9}from"react/jsx-runtime";var M9={apple:{logo:Io(wl,{}),displayName:"Apple"},discord:{logo:Io(bl,{}),displayName:"Discord"},github:{logo:Io(El,{}),displayName:"GitHub"},google:{logo:Io(Sl,{}),displayName:"Google"},linkedin:{logo:Io(Rl,{}),displayName:"LinkedIn"},spotify:{logo:Io(kl,{}),displayName:"Spotify"},instagram:{logo:Io(Pl,{}),displayName:"Instagram"},twitter:{logo:Io(Ml,{}),displayName:"Twitter"},tiktok:{logo:Io(_l,{}),displayName:"TikTok"}},ct=({provider:e})=>{let{enabled:t,token:r}=Te(),{navigate:o,setModalData:n,data:i}=R(),[a,l]=k9(!1),{initLoginWithOAuth:s}=I(),{accountType:d}=Pt(),u=d?Pn(d):null,{displayName:m,logo:f}=M9[e];return W9(Se,{onClick:()=>{l(!0),t&&!r?(n({captchaModalData:{callback:b=>s(e,b,i?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):s(e,void 0,i?.login?.disableSignup)},disabled:a,children:[f," ",m,u?.loginMethod===e&&Io(I9,{color:"gray",children:"Recent"})]})},I9=_9(jt)`
2205
2205
  margin-left: auto;
2206
- `;import{useState as x9}from"react";import R9 from"styled-components";import{jsx as Sn,jsxs as $1}from"react/jsx-runtime";function ed(e){return $1("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[Sn("defs",{children:$1("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[Sn("stop",{offset:"0",stopColor:"#1d93d2"}),Sn("stop",{offset:"1",stopColor:"#38b0e3"})]})}),Sn("title",{children:"Telegram_logo"}),Sn("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),Sn("path",{d:"M81.229,128.772l14.237,39.406s1.78,3.687,3.686,3.687,30.255-29.492,30.255-29.492l31.525-60.89L81.737,118.6Z",fill:"#c8daea"}),Sn("path",{d:"M100.106,138.878l-2.733,29.046s-1.144,8.9,7.754,0,17.415-15.763,17.415-15.763",fill:"#a9c6d8"}),Sn("path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}import{jsx as e2,jsxs as _9}from"react/jsx-runtime";var td=()=>{let{enabled:e,token:t}=Pe(),{navigate:r,setModalData:o}=P(),[n,i]=x9(!1),{initLoginWithTelegram:a}=_(),{accountType:l}=Rt();async function s(m){try{await a(m),r("TELEGRAM_AUTH_SCREEN")}catch(f){console.error(f),i(!1)}}async function d(){if(i(!0),e&&!t){o({captchaModalData:{callback:s,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN");return}await s()}return _9(xe,{onClick:d,disabled:n,children:[e2(ed,{}),"Telegram",l==="telegram"&&e2(k9,{color:"gray",children:"Recent"})]})},k9=R9(er)`
2206
+ `;import{useState as L9}from"react";import N9 from"styled-components";import{jsx as Rn,jsxs as p2}from"react/jsx-runtime";function cd(e){return p2("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[Rn("defs",{children:p2("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[Rn("stop",{offset:"0",stopColor:"#1d93d2"}),Rn("stop",{offset:"1",stopColor:"#38b0e3"})]})}),Rn("title",{children:"Telegram_logo"}),Rn("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),Rn("path",{d:"M81.229,128.772l14.237,39.406s1.78,3.687,3.686,3.687,30.255-29.492,30.255-29.492l31.525-60.89L81.737,118.6Z",fill:"#c8daea"}),Rn("path",{d:"M100.106,138.878l-2.733,29.046s-1.144,8.9,7.754,0,17.415-15.763,17.415-15.763",fill:"#a9c6d8"}),Rn("path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}import{jsx as u2,jsxs as D9}from"react/jsx-runtime";var dd=()=>{let{enabled:e,token:t}=Te(),{navigate:r,setModalData:o,data:n}=R(),[i,a]=L9(!1),{initLoginWithTelegram:l}=I(),{accountType:s}=Pt();async function d(m){try{await l(m,n?.login?.disableSignup),r("TELEGRAM_AUTH_SCREEN")}catch(f){console.error(f),a(!1)}}async function u(){if(a(!0),e&&!t){o({captchaModalData:{callback:d,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN");return}await d()}return D9(Se,{onClick:u,disabled:i,children:[u2(cd,{}),"Telegram",s==="telegram"&&u2(O9,{color:"gray",children:"Recent"})]})},O9=N9(jt)`
2207
2207
  margin-left: auto;
2208
- `;import M9 from"@heroicons/react/24/outline/ChevronRightIcon";import{jsx as t2,jsxs as I9}from"react/jsx-runtime";var rd=({onClick:e,text:t,icon:r})=>I9(xe,{onClick:e,children:[r,t2(gr,{children:t}),t2(M9,{})]});import{Fragment as Zp,jsx as it,jsxs as nd}from"react/jsx-runtime";var id=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=_(),{app:o,onUserCloseViaDialogOrKeybindRef:n,data:i}=P(),{appearance:{palette:{colorScheme:a}}}=Ve(),{accountType:l,walletClientType:s}=Rt(),d=l?En(l):null,m=o.loginMethodsAndOrder?.primary??[],f=o.loginMethodsAndOrder?.overflow??[],u=[...m,...f],g=o.loginMethods.passkey,v=i?.login,C=[];s&&u.includes(s)?C.push(s):l&&u.includes(d?.loginMethod)&&C.push(d?.loginMethod);let[b,A]=r2("default"),[k,S]=r2(l==="phone"?"sms":"email");L9(()=>{l==="phone"&&S("sms");let q=u.indexOf("sms"),Le=u.indexOf("email");q>-1&&q<Le&&S("sms")},[l,m,f]);let x=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{A("default")},150)};n.current=x;let T=q=>q==="email"?it(Yc,{isEditable:k==="email",setIsEditable:()=>{S("email")},defaultValue:v?.prefill?.type==="email"?v.prefill.value:void 0},q):q==="sms"?it($c,{isEditable:k==="sms",setIsEditable:()=>{S("sms")},defaultValue:v?.prefill?.type==="phone"?v.prefill.value:void 0},q):q==="apple"?it(pt,{provider:"apple"},q):q==="discord"?it(pt,{provider:"discord"},q):q==="farcaster"?it(Qc,{},q):q==="github"?it(pt,{provider:"github"},q):q==="google"?it(pt,{provider:"google"},q):q==="linkedin"?it(pt,{provider:"linkedin"},q):q==="spotify"?it(pt,{provider:"spotify"},q):q==="instagram"?it(pt,{provider:"instagram"},q):q==="tiktok"?it(pt,{provider:"tiktok"},q):q==="twitter"?it(pt,{provider:"twitter"},q):q==="telegram"?it(td,{},q):dn([q],r,e,u,o.externalWallets.walletConnect.enabled),M=C.flatMap(T),D=m.filter(q=>q!==s&&q!==d?.loginMethod).flatMap(T),B=f.filter(q=>q!==s&&q!==d?.loginMethod).flatMap(T),K=[...M,...D,...B],Q=O9({primary:D.length+M.length,overflow:B.length}),[L,X]=Uu(K,Q),I=b==="default"?void 0:()=>{A("default")};return nd(Zp,{children:[it(R,{title:o.appearance.landingHeader,onClose:x,backFn:I}),b==="default"&&it(D9,{}),b==="default"&&(typeof o.appearance.loginMessage=="string"?it(Vl,{children:o.appearance.loginMessage}):o.appearance.loginMessage),it(Hl,{style:{overflow:"hidden"},children:nd(nh,{colorScheme:a,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[b==="default"&&nd(Zp,{children:[...L,X.length>0&&it(rd,{text:"More options",icon:it(W9,{}),onClick:()=>A("overflow")})]}),b==="overflow"&&nd(Zp,{children:[...X]}),g&&b==="default"&&it(Bc,{})]})}),o&&it(xi,{app:o}),it(H,{})]})},od=5,O9=({primary:e,overflow:t})=>e<od?e:e===od&&t===0?od:od-1,D9=N9(qc)`
2208
+ `;import U9 from"@heroicons/react/24/outline/ChevronRightIcon";import{jsx as m2,jsxs as F9}from"react/jsx-runtime";var pd=({onClick:e,text:t,icon:r})=>F9(Se,{onClick:e,children:[r,m2(hr,{children:t}),m2(U9,{})]});import{Fragment as au,jsx as ot,jsxs as md}from"react/jsx-runtime";var fd=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=I(),{app:o,onUserCloseViaDialogOrKeybindRef:n,data:i}=R(),{appearance:{palette:{colorScheme:a}}}=Ne(),{accountType:l,walletClientType:s}=Pt(),d=l?Pn(l):null,u=o.loginMethodsAndOrder?.primary??[],m=o.loginMethodsAndOrder?.overflow??[],f=[...u,...m],y=o.loginMethods.passkey,b=i?.login,C=[];s&&f.includes(s)?C.push(s):l&&f.includes(d?.loginMethod)&&C.push(d?.loginMethod);let[w,A]=f2("default"),[k,T]=f2(l==="phone"?"sms":"email");H9(()=>{l==="phone"&&T("sms");let q=f.indexOf("sms"),ue=f.indexOf("email");q>-1&&q<ue&&T("sms")},[l,u,m]);let P=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{A("default")},150)};n.current=P;let S=q=>q==="email"?ot(rd,{isEditable:k==="email",setIsEditable:()=>{T("email")},defaultValue:b?.prefill?.type==="email"?b.prefill.value:void 0},q):q==="sms"?ot(ld,{isEditable:k==="sms",setIsEditable:()=>{T("sms")},defaultValue:b?.prefill?.type==="phone"?b.prefill.value:void 0},q):q==="apple"?ot(ct,{provider:"apple"},q):q==="discord"?ot(ct,{provider:"discord"},q):q==="farcaster"?ot(od,{},q):q==="github"?ot(ct,{provider:"github"},q):q==="google"?ot(ct,{provider:"google"},q):q==="linkedin"?ot(ct,{provider:"linkedin"},q):q==="spotify"?ot(ct,{provider:"spotify"},q):q==="instagram"?ot(ct,{provider:"instagram"},q):q==="tiktok"?ot(ct,{provider:"tiktok"},q):q==="twitter"?ot(ct,{provider:"twitter"},q):q==="telegram"?ot(dd,{},q):fn([q],r,e,f,o.externalWallets.walletConnect.enabled),M=C.flatMap(S),N=u.filter(q=>q!==s&&q!==d?.loginMethod).flatMap(S),H=m.filter(q=>q!==s&&q!==d?.loginMethod).flatMap(S),x=[...M,...N,...H],K=G9({primary:N.length+M.length,overflow:H.length}),[W,Q]=Zu(x,K),pe=w==="default"?void 0:()=>{A("default")};return md(au,{children:[ot(_,{title:o.appearance.landingHeader,onClose:P,backFn:pe}),w==="default"&&ot(q9,{}),w==="default"&&(typeof o.appearance.loginMessage=="string"?ot(Xl,{children:o.appearance.loginMessage}):o.appearance.loginMessage),ot(Ql,{style:{overflow:"hidden"},children:md(yh,{colorScheme:a,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[w==="default"&&md(au,{children:[...W,Q.length>0&&ot(pd,{text:"More options",icon:ot(B9,{}),onClick:()=>A("overflow")})]}),w==="overflow"&&md(au,{children:[...Q]}),y&&w==="default"&&ot(Xc,{})]})}),o&&ot(Ni,{app:o}),ot(B,{})]})},ud=5,G9=({primary:e,overflow:t})=>e<ud?e:e===ud&&t===0?ud:ud-1,q9=V9($c)`
2209
2209
  margin-bottom: 16px;
2210
- `;import U9 from"@heroicons/react/24/outline/EnvelopeIcon";import F9 from"@heroicons/react/24/outline/PhoneIcon";import B9 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as H9,useMemo as i2,useState as a2}from"react";import V9 from"styled-components";import{toObjectKeys as G9}from"@privy-io/js-sdk-core";import{jsx as Ts,jsxs as o2}from"react/jsx-runtime";var n2=({...e})=>o2("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[o2("g",{clipPath:"url(#clip0_2856_1743)",children:[Ts("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Ts("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Ts("defs",{children:Ts("clipPath",{id:"clip0_2856_1743",children:Ts("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});import{Fragment as Ss,jsx as Ge,jsxs as ba}from"react/jsx-runtime";var ad=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=_(),{data:o,onUserCloseViaDialogOrKeybindRef:n}=P(),i=Ve(),{accountType:a,walletClientType:l}=Rt(),s=a?En(a):null,d=o?.login,m=i2(()=>d?.loginMethods?G9(d.loginMethods,!0):null,[d]),{email:f,sms:u,google:g,twitter:v,discord:C,github:b,spotify:A,instagram:k,tiktok:S,linkedin:x,apple:T,wallet:M,farcaster:D,telegram:B}=m??i.loginMethods,{passkey:K}=i.loginMethods,Q=[f&&"email",u&&"sms",g&&"google",v&&"twitter",C&&"discord",b&&"github",A&&"spotify",k&&"instagram",S&&"tiktok",x&&"linkedin",T&&"apple",D&&"farcaster",B&&"telegram"].filter(se=>!!se),L=Q.length>0,X=i2(()=>M&&!L?"web3-first":M&&i?.appearance.loginGroupPriority||"web2-first",[M,L,i?.appearance.loginGroupPriority]),I=i?.appearance.hideDirectWeb2Inputs,[q,Le]=a2("default"),[oe,Y]=a2(s2({mostRecentlyUsedAccountType:a,smsAvailable:u,emailAvailable:f,prefilledType:d?.prefill?.type}));H9(()=>{Y(s2({mostRecentlyUsedAccountType:a,smsAvailable:u,emailAvailable:f,prefilledType:d?.prefill?.type}))},[f,u,a]);let ne=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{Le("default")},150)};n.current=ne;let me=[];l&&M?me.push(l):s?.loginMethod&&Q.includes(s.loginMethod)&&me.push(s.loginMethod);let be=se=>se==="email"?Ge(Yc,{isEditable:oe==="email",setIsEditable:()=>{Y("email")},defaultValue:d?.prefill?.type==="email"?d.prefill.value:void 0},se):se==="sms"?Ge($c,{isEditable:oe==="sms",setIsEditable:()=>{Y("sms")},defaultValue:d?.prefill?.type==="phone"?d.prefill.value:void 0},se):se==="apple"?Ge(pt,{provider:"apple"},se):se==="discord"?Ge(pt,{provider:"discord"},se):se==="farcaster"?Ge(Qc,{},se):se==="github"?Ge(pt,{provider:"github"},se):se==="google"?Ge(pt,{provider:"google"},se):se==="linkedin"?Ge(pt,{provider:"linkedin"},se):se==="tiktok"?Ge(pt,{provider:"tiktok"},se):se==="spotify"?Ge(pt,{provider:"spotify"},se):se==="instagram"?Ge(pt,{provider:"instagram"},se):se==="twitter"?Ge(pt,{provider:"twitter"},se):se==="telegram"?Ge(td,{},se):dn([se],r,e,[],i.externalWallets.walletConnect.enabled),ue=dn(i.appearance.walletList.filter(se=>se!==l),r,e,[...i.appearance.walletList,l],i.externalWallets.walletConnect.enabled),Re=Q.filter(se=>se!==s?.loginMethod).flatMap(be),gt=me.flatMap(be);X==="web3-first"&&q==="default"?ue.unshift(...gt):X==="web2-first"&&Re.unshift(...gt);let tt=q==="default"?void 0:()=>{Le("default")},le=Q.filter(se=>se!=="email"&&se!=="sms"),Jt=z9({priority:X,email:f,sms:u,social:le}),Do=K9({priority:X,email:f,sms:u,social:le}),rt=Y9({priority:X}),Fe=Ge(Hc,{text:rt,onClick:()=>Le("web3-overflow")}),ze=Ge(rd,{text:Jt,icon:Do,onClick:()=>Le("web2-overflow")}),W=I?0:1;return ba(Ss,{children:[Ge(R,{title:i.appearance.landingHeader,onClose:ne,backFn:tt}),q==="default"&&Ge(q9,{}),q==="default"&&(typeof i.appearance.loginMessage=="string"?Ge(Vl,{children:i.appearance.loginMessage}):i.appearance.loginMessage),Ge(Hl,{style:{overflow:"hidden",padding:2},children:ba(ir,{children:[q==="default"&&X==="web2-first"&&ba(Ss,{children:[...Re.length>4?Re.slice(0,3):Re,Re.length>4&&ze,M&&Fe]}),q==="default"&&X==="web3-first"&&ba(Ss,{children:[M&&ba(Ss,{children:[...ue.length>4?ue.slice(0,3):ue,ue.length>4&&Fe]}),Re.length>W&&ze,Re.length===W&&Re[0]]}),q==="web2-overflow"&&ba(Ss,{children:[...X==="web3-first"?Re:Re.slice(3)]}),...q==="web3-overflow"?ue:[],K&&q==="default"&&Ge(Bc,{})]})}),i&&Ge(xi,{app:i}),Ge(H,{})]})},q9=V9(qc)`
2210
+ `;import z9 from"@heroicons/react/24/outline/EnvelopeIcon";import K9 from"@heroicons/react/24/outline/PhoneIcon";import Y9 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as Q9,useMemo as g2,useState as C2}from"react";import X9 from"styled-components";import{toObjectKeys as Z9}from"@privy-io/js-sdk-core";import{jsx as ks,jsxs as h2}from"react/jsx-runtime";var y2=({...e})=>h2("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[h2("g",{clipPath:"url(#clip0_2856_1743)",children:[ks("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),ks("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),ks("defs",{children:ks("clipPath",{id:"clip0_2856_1743",children:ks("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});import{Fragment as _s,jsx as Ge,jsxs as xa}from"react/jsx-runtime";var hd=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=I(),{data:o,onUserCloseViaDialogOrKeybindRef:n}=R(),i=Ne(),{accountType:a,walletClientType:l}=Pt(),s=a?Pn(a):null,d=o?.login,u=g2(()=>d?.loginMethods?Z9(d.loginMethods,!0):null,[d]),{email:m,sms:f,google:y,twitter:b,discord:C,github:w,spotify:A,instagram:k,tiktok:T,linkedin:P,apple:S,wallet:M,farcaster:N,telegram:H}=u??i.loginMethods,{passkey:x}=i.loginMethods,K=[m&&"email",f&&"sms",y&&"google",b&&"twitter",C&&"discord",w&&"github",A&&"spotify",k&&"instagram",T&&"tiktok",P&&"linkedin",S&&"apple",N&&"farcaster",H&&"telegram"].filter(U=>!!U),W=K.length>0,Q=g2(()=>M&&!W?"web3-first":M&&i?.appearance.loginGroupPriority||"web2-first",[M,W,i?.appearance.loginGroupPriority]),pe=i?.appearance.hideDirectWeb2Inputs,[q,ue]=C2("default"),[Z,ae]=C2(v2({mostRecentlyUsedAccountType:a,smsAvailable:f,emailAvailable:m,prefilledType:d?.prefill?.type}));Q9(()=>{ae(v2({mostRecentlyUsedAccountType:a,smsAvailable:f,emailAvailable:m,prefilledType:d?.prefill?.type}))},[m,f,a]);let se=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{ue("default")},150)};n.current=se;let We=[];l&&M?We.push(l):s?.loginMethod&&K.includes(s.loginMethod)&&We.push(s.loginMethod);let Ee=U=>U==="email"?Ge(rd,{isEditable:Z==="email",setIsEditable:()=>{ae("email")},defaultValue:d?.prefill?.type==="email"?d.prefill.value:void 0},U):U==="sms"?Ge(ld,{isEditable:Z==="sms",setIsEditable:()=>{ae("sms")},defaultValue:d?.prefill?.type==="phone"?d.prefill.value:void 0},U):U==="apple"?Ge(ct,{provider:"apple"},U):U==="discord"?Ge(ct,{provider:"discord"},U):U==="farcaster"?Ge(od,{},U):U==="github"?Ge(ct,{provider:"github"},U):U==="google"?Ge(ct,{provider:"google"},U):U==="linkedin"?Ge(ct,{provider:"linkedin"},U):U==="tiktok"?Ge(ct,{provider:"tiktok"},U):U==="spotify"?Ge(ct,{provider:"spotify"},U):U==="instagram"?Ge(ct,{provider:"instagram"},U):U==="twitter"?Ge(ct,{provider:"twitter"},U):U==="telegram"?Ge(dd,{},U):fn([U],r,e,[],i.externalWallets.walletConnect.enabled),ge=fn(i.appearance.walletList.filter(U=>U!==l),r,e,[...i.appearance.walletList,l],i.externalWallets.walletConnect.enabled),le=K.filter(U=>U!==s?.loginMethod).flatMap(Ee),Ze=We.flatMap(Ee);Q==="web3-first"&&q==="default"?ge.unshift(...Ze):Q==="web2-first"&&le.unshift(...Ze);let at=q==="default"?void 0:()=>{ue("default")},ce=K.filter(U=>U!=="email"&&U!=="sms"),tt=j9({priority:Q,email:m,sms:f,social:ce}),Dt=$9({priority:Q,email:m,sms:f,social:ce}),Yr=eb({priority:Q}),L=Ge(Zc,{text:Yr,onClick:()=>ue("web3-overflow")}),Re=Ge(pd,{text:tt,icon:Dt,onClick:()=>ue("web2-overflow")}),ze=pe?0:1;return xa(_s,{children:[Ge(_,{title:i.appearance.landingHeader,onClose:se,backFn:at}),q==="default"&&Ge(J9,{}),q==="default"&&(typeof i.appearance.loginMessage=="string"?Ge(Xl,{children:i.appearance.loginMessage}):i.appearance.loginMessage),Ge(Ql,{style:{overflow:"hidden",padding:2},children:xa(or,{children:[q==="default"&&Q==="web2-first"&&xa(_s,{children:[...le.length>4?le.slice(0,3):le,le.length>4&&Re,M&&L]}),q==="default"&&Q==="web3-first"&&xa(_s,{children:[M&&xa(_s,{children:[...ge.length>4?ge.slice(0,3):ge,ge.length>4&&L]}),le.length>ze&&Re,le.length===ze&&le[0]]}),q==="web2-overflow"&&xa(_s,{children:[...Q==="web3-first"?le:le.slice(3)]}),...q==="web3-overflow"?ge:[],x&&q==="default"&&Ge(Xc,{})]})}),i&&Ge(Ni,{app:i}),Ge(B,{})]})},J9=X9($c)`
2211
2211
  margin-bottom: 16px;
2212
- `,z9=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"?"Other socials":t&&r&&o.length>0||t&&o.length>0?"Log in with email or socials":r&&o.length>0?"Log in with sms or socials":t&&r?"Continue with email or sms":t?"Continue with email":r?"Continue with sms":"Log in with a social account",K9=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?Ge(B9,{}):t&&r?Ge(n2,{}):t?Ge(U9,{}):r?Ge(F9,{}):null,Y9=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets",s2=({mostRecentlyUsedAccountType:e,smsAvailable:t,emailAvailable:r,prefilledType:o})=>r&&(e==="email"&&o!=="phone"||o==="email")?"email":t&&(e==="phone"||o==="phone")?"sms":"email";import{jsx as l2}from"react/jsx-runtime";var c2=()=>{let{app:e}=P();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?l2(id,{connectOnly:!0}):l2(ad,{connectOnly:!0})};import{jsx as d2}from"react/jsx-runtime";var p2=()=>{let{app:e}=P();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?d2(id,{connectOnly:!1}):d2(ad,{connectOnly:!1})};import Q9 from"@heroicons/react/24/outline/EnvelopeIcon";import{Fragment as X9,jsx as An,jsxs as Z9}from"react/jsx-runtime";var u2=()=>{let{app:e}=P();return Z9(X9,{children:[An(R,{},"header"),An(ie,{}),An(ve,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:An(Q9,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),An(cr,{children:An(zc,{stacked:!0})}),An(ae,{}),An(H,{})]})};import J9 from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as j9,jsx as Pn,jsxs as $9}from"react/jsx-runtime";var m2=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=P(),{initLoginWithSms:i}=_();async function a({qualifiedPhoneNumber:l}){try{await i(l),o("AWAITING_PASSWORDLESS_CODE")}catch(s){n({errorModalData:{error:s,previousScreen:r?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),o("ERROR_SCREEN")}}return $9(j9,{children:[Pn(R,{},"header"),Pn(ie,{}),Pn(ve,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:Pn(J9,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),Pn(cr,{children:Pn(Tn,{stacked:!0,onSubmit:a,hideRecent:!0})}),Pn(ae,{}),Pn(H,{})]})};import{Fragment as eb,jsx as As,jsxs as tb}from"react/jsx-runtime";var f2=()=>{let{linkingOrConnectingHint:e}=_(),{app:t}=P(),r=e?`Link the wallet with address ${Bt(e)} ${t?.name?`to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return tb(eb,{children:[As(R,{},"header"),As(So,{title:"Link your wallet",description:r}),As(ir,{children:As($i,{connectOnly:!1})}),As(H,{})]})};import{jsx as h2,jsxs as rb}from"react/jsx-runtime";var y2=({style:e,...t})=>rb("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[h2("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),h2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});import{Fragment as ob,jsx as xn,jsxs as g2}from"react/jsx-runtime";var C2=()=>{let{closePrivyModal:e}=_(),{navigate:t}=P();return g2(ob,{children:[xn(R,{},"header"),xn(ie,{}),xn(y2,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),xn(So,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),g2(cr,{children:[xn(U,{onClick:()=>t("LANDING"),children:"Try again"}),xn(eo,{onClick:()=>e(),children:"Cancel"})]}),xn(ae,{}),xn(H,{})]})};import Bb from"@heroicons/react/24/solid/CheckBadgeIcon";import Hb from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import Vb from"@heroicons/react/24/solid/IdentificationIcon";import Gb from"@heroicons/react/24/solid/PhoneIcon";import qb from"@heroicons/react/24/solid/QuestionMarkCircleIcon";import M2 from"@heroicons/react/24/solid/ShieldCheckIcon";import{useEffect as zb,useState as Ea}from"react";import{useContext as nb}from"react";function Ps(){let{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}=nb(_e);return{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}}import{useContext as ib}from"react";function so(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenroll:a,enrollInMfa:l}=ib(_e);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenrollWithSms:()=>a("sms"),unenrollWithTotp:()=>a("totp"),unenrollWithPasskey:()=>a("passkey"),showMfaEnrollmentModal:()=>l(!0),closeMfaEnrollmentModal:()=>l(!1)}}import ab from"styled-components";import{jsx as v2,jsxs as lb}from"react/jsx-runtime";var w2=e=>lb(sb,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[v2("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),v2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]}),sb=ab.svg`
2212
+ `,j9=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"?"Other socials":t&&r&&o.length>0||t&&o.length>0?"Log in with email or socials":r&&o.length>0?"Log in with sms or socials":t&&r?"Continue with email or sms":t?"Continue with email":r?"Continue with sms":"Log in with a social account",$9=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?Ge(Y9,{}):t&&r?Ge(y2,{}):t?Ge(z9,{}):r?Ge(K9,{}):null,eb=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets",v2=({mostRecentlyUsedAccountType:e,smsAvailable:t,emailAvailable:r,prefilledType:o})=>r&&(e==="email"&&o!=="phone"||o==="email")?"email":t&&(e==="phone"||o==="phone")?"sms":"email";import{jsx as w2}from"react/jsx-runtime";var b2=()=>{let{app:e}=R();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?w2(fd,{connectOnly:!0}):w2(hd,{connectOnly:!0})};import{jsx as E2}from"react/jsx-runtime";var T2=()=>{let{app:e}=R();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?E2(fd,{connectOnly:!1}):E2(hd,{connectOnly:!1})};import tb from"@heroicons/react/24/outline/EnvelopeIcon";import{Fragment as rb,jsx as kn,jsxs as ob}from"react/jsx-runtime";var S2=()=>{let{app:e}=R();return ob(rb,{children:[kn(_,{},"header"),kn(re,{}),kn(Ce,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:kn(tb,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),kn(sr,{children:kn(ed,{stacked:!0})}),kn(oe,{}),kn(B,{})]})};import nb from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as ib,jsx as _n,jsxs as ab}from"react/jsx-runtime";var A2=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=R(),{initLoginWithSms:i}=I();async function a({qualifiedPhoneNumber:l}){try{await i(l),o("AWAITING_PASSWORDLESS_CODE")}catch(s){n({errorModalData:{error:s,previousScreen:r?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),o("ERROR_SCREEN")}}return ab(ib,{children:[_n(_,{},"header"),_n(re,{}),_n(Ce,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:_n(nb,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),_n(sr,{children:_n(xn,{stacked:!0,onSubmit:a,hideRecent:!0})}),_n(oe,{}),_n(B,{})]})};import{Fragment as sb,jsx as Ra,jsxs as P2}from"react/jsx-runtime";var x2=()=>{let{app:e,data:t}=R(),r=t?.externalConnectWallet?.suggestedAddress,o=r?P2("span",{children:["Link the wallet with address ",Ra(Ho,{showCopyIcon:!1,address:r})," ",e?.name?`to ${e.name}.`:"."]}):`Link a wallet to your ${e?.name} account`;return P2(sb,{children:[Ra(_,{},"header"),Ra(Ao,{title:"Link your wallet",description:o}),Ra(or,{children:Ra(sa,{connectOnly:!1})}),Ra(B,{})]})};import{jsx as R2,jsxs as lb}from"react/jsx-runtime";var k2=({style:e,...t})=>lb("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[R2("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),R2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});import{Fragment as cb,jsx as Mn,jsxs as _2}from"react/jsx-runtime";var M2=()=>{let{closePrivyModal:e}=I(),{navigate:t}=R();return _2(cb,{children:[Mn(_,{},"header"),Mn(re,{}),Mn(k2,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),Mn(Ao,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),_2(sr,{children:[Mn(F,{onClick:()=>t("LANDING"),children:"Try again"}),Mn($r,{onClick:()=>e(),children:"Cancel"})]}),Mn(oe,{}),Mn(B,{})]})};import Kb from"@heroicons/react/24/solid/CheckBadgeIcon";import Yb from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import Qb from"@heroicons/react/24/solid/IdentificationIcon";import Xb from"@heroicons/react/24/solid/PhoneIcon";import Zb from"@heroicons/react/24/solid/QuestionMarkCircleIcon";import q2 from"@heroicons/react/24/solid/ShieldCheckIcon";import{useEffect as Jb,useState as ka}from"react";import{useContext as db}from"react";function Ms(){let{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}=db(Pe);return{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}}import{useContext as pb}from"react";function ao(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenroll:a,enrollInMfa:l}=pb(Pe);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenrollWithSms:()=>a("sms"),unenrollWithTotp:()=>a("totp"),unenrollWithPasskey:()=>a("passkey"),showMfaEnrollmentModal:()=>l(!0),closeMfaEnrollmentModal:()=>l(!1)}}import ub from"styled-components";import{jsx as I2,jsxs as fb}from"react/jsx-runtime";var W2=e=>fb(mb,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[I2("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),I2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]}),mb=ub.svg`
2213
2213
  height: 90px;
2214
2214
  width: 90px;
2215
2215
 
@@ -2220,7 +2220,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2220
2220
  > path {
2221
2221
  fill: white;
2222
2222
  }
2223
- `;import Jp from"@heroicons/react/20/solid/CheckIcon";import cb from"@heroicons/react/24/outline/ChevronRightIcon";import db from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import pb from"@heroicons/react/24/outline/FingerPrintIcon";import ub from"@heroicons/react/24/outline/PhoneIcon";import jp from"@heroicons/react/24/outline/TrashIcon";import mb from"@heroicons/react/24/solid/ShieldCheckIcon";import{Fragment as fb,jsx as Me,jsxs as ur}from"react/jsx-runtime";var b2=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,isPasskeyLoading:i,error:a,onClose:l,onBackToIntro:s,handleSelectMethod:d,setRemovingMfaMethod:m})=>{let f=t.reduce((g,v)=>({...g,[v]:!0}),{}),u=r.reduce((g,v)=>({...g,[v]:!0}),{});return ur(fb,{children:[Me(R,{backFn:e?s:void 0,onClose:l},"header"),Me(Be,{children:Me(et,{children:Me(mb,{})})}),Me(fe,{children:"Choose a verification method"}),t.length>0?Me(ye,{children:"To add or delete verification methods, verification is required."}):Me(ye,{children:"How would you like to verify your identity? You can change this later."}),a&&Me(Ql,{style:{marginTop:"1.25rem"},children:a.message}),ur(Gl,{children:[(u.totp||f.totp)&&ur(ql,{children:[Me(xe,{style:{justifyContent:"center"},disabled:f.totp||n,onClick:()=>d("totp"),children:n?Me(dt,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):ur(Yl,{children:[ur(Kl,{children:[Me(db,{}),"Authenticator App"]}),f.totp?ur(Jn,{children:[Me(Jp,{}),"Added"]}):Me(Jn,{children:"Recommended"})]})}),f.totp&&Me(zl,{onClick:()=>m("totp"),children:Me(jp,{})})]},"totp"),(u.sms||f.sms)&&ur(ql,{children:[Me(xe,{disabled:f.sms||o,onClick:()=>d("sms"),children:ur(Yl,{children:[ur(Kl,{children:[Me(ub,{}),"SMS"]}),f.sms&&ur(Jn,{children:[Me(Jp,{}),"Added"]}),o&&Me(Jn,{children:"Disabled"})]})}),f.sms&&Me(zl,{onClick:()=>m("sms"),children:Me(jp,{})})]},"sms"),(u.passkey||f.passkey)&&ur(ql,{children:[Me(xe,{style:{justifyContent:"center"},onClick:()=>d("passkey"),disabled:f.passkey||i,children:i?Me(dt,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):ur(Yl,{children:[ur(Kl,{children:[Me(pb,{}),"Passkey"]}),f.passkey?ur(Jn,{children:[Me(Jp,{}),"Added"]}):Me(Jn,{isAccent:!0,children:Me(cb,{})})]})}),f.passkey&&Me(zl,{onClick:()=>m("passkey"),children:Me(jp,{})})]},"passkey")]}),Me(J,{})]})};import hb from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import yb from"@heroicons/react/24/outline/ClockIcon";import gb from"@heroicons/react/24/outline/ShieldCheckIcon";import Cb from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as vb,useState as xs}from"react";import sd from"styled-components";import{Fragment as $p,jsx as ge,jsxs as Qr}from"react/jsx-runtime";var T2=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=V(),{data:n}=P(),{initLinkWithPasskey:i,linkWithPasskey:a}=_(),{initEnrollmentWithPasskey:l,submitEnrollmentWithPasskey:s}=so(),[d,m]=xs(!1),[f,u]=xs(!1),[g,v]=xs(!1),[C,b]=xs(null),A=vb(()=>o?.linkedAccounts.filter(T=>T.type==="passkey")??[],[o]),k=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},S=async T=>{m(!0);try{await l(),await s({credentialIds:T}),v(!0)}catch(M){b(M)}finally{m(!1)}},x=async()=>{u(!0),b(null);try{await i();let M=(await a())?.linkedAccounts.filter(D=>D.type==="passkey").map(D=>D.credentialId)??[];await S(M)}catch(T){b(T)}finally{u(!1)}};return A.length===0||f?ge(wb,{onReset:r,onClose:t,onClick:x,isCreating:f}):g?ge(Eb,{onClick:k,onClose:k}):C?ge(ii,{error:C,backFn:()=>b(null),onClick:()=>b(null)}):ge(bb,{passkeys:A,isSubmitting:d,isCreating:f,onReset:r,onClose:t,onSubmitEnrollment:()=>S(A.map(T=>T.credentialId)),onAddPasskey:x})},wb=({onReset:e,onClose:t,onClick:r,isCreating:o})=>Qr($p,{children:[ge(R,{backFn:e,onClose:t},"header"),ge(Be,{children:Qr(Ic,{children:[ge(ai,{}),ge(si,{})]})}),ge(fe,{children:"Set up passkey verification"}),Qr(Zn,{children:[Qr(sr,{children:[ge(ar,{children:ge(gb,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),Qr(sr,{children:[ge(ar,{children:ge(yb,{})}),"Takes seconds to set up and use"]}),Qr(sr,{children:[ge(ar,{children:ge(hb,{})}),"Use your passkey to verify transactions and login to your account"]})]}),ge(U,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),ge(J,{})]}),bb=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:i,isCreating:a})=>{let[l,s]=xs(!1),d=l?n.length:n.length>3?2:3;return Qr($p,{children:[ge(R,{backFn:l?()=>s(!1):e,onClose:t},"header"),!l&&ge(Be,{children:Qr(Ic,{children:[ge(ai,{}),ge(si,{})]})}),ge(fe,{children:"Enable your passkeys for verification"}),Qr(Zn,{children:[n.slice(0,d).map(m=>Qr(Tb,{children:[ge(Sb,{children:Pb(m)}),Qr(Ab,{children:["Last used: ",m.latestVerifiedAt?.toLocaleString()]})]},m.credentialId)),!l&&n.length>3&&ge(E2,{onClick:()=>s(!0),children:"View All"})]}),ge(U,{style:{marginTop:"1.5rem"},onClick:o,loading:i,children:"Enable passkeys"}),n.length<5&&ge(E2,{style:{marginTop:"0.5rem"},onClick:r,disabled:a,children:a?ge(dt,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),ge(J,{})]})},Eb=({onClick:e,onClose:t})=>Qr($p,{children:[ge(R,{onClose:t},"header"),ge(Be,{children:ge(et,{status:"success",children:ge(Cb,{})})}),ge(fe,{children:"Passkey verification added"}),ge(ye,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),ge(_t,{children:ge(U,{onClick:e,children:"Done"})}),ge(J,{})]}),Tb=sd.div`
2223
+ `;import su from"@heroicons/react/20/solid/CheckIcon";import hb from"@heroicons/react/24/outline/ChevronRightIcon";import yb from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import gb from"@heroicons/react/24/outline/FingerPrintIcon";import Cb from"@heroicons/react/24/outline/PhoneIcon";import lu from"@heroicons/react/24/outline/TrashIcon";import vb from"@heroicons/react/24/solid/ShieldCheckIcon";import{Fragment as wb,jsx as xe,jsxs as dr}from"react/jsx-runtime";var L2=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,isPasskeyLoading:i,error:a,onClose:l,onBackToIntro:s,handleSelectMethod:d,setRemovingMfaMethod:u})=>{let m=t.reduce((y,b)=>({...y,[b]:!0}),{}),f=r.reduce((y,b)=>({...y,[b]:!0}),{});return dr(wb,{children:[xe(_,{backFn:e?s:void 0,onClose:l},"header"),xe(He,{children:xe(et,{children:xe(vb,{})})}),xe(me,{children:"Choose a verification method"}),t.length>0?xe(he,{children:"To add or delete verification methods, verification is required."}):xe(he,{children:"How would you like to verify your identity? You can change this later."}),a&&xe(tc,{style:{marginTop:"1.25rem"},children:a.message}),dr(Zl,{children:[(f.totp||m.totp)&&dr(Jl,{children:[xe(Se,{style:{justifyContent:"center"},disabled:m.totp||n,onClick:()=>d("totp"),children:n?xe(lt,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):dr(ec,{children:[dr($l,{children:[xe(yb,{}),"Authenticator App"]}),m.totp?dr(ni,{children:[xe(su,{}),"Added"]}):xe(ni,{children:"Recommended"})]})}),m.totp&&xe(jl,{onClick:()=>u("totp"),children:xe(lu,{})})]},"totp"),(f.sms||m.sms)&&dr(Jl,{children:[xe(Se,{disabled:m.sms||o,onClick:()=>d("sms"),children:dr(ec,{children:[dr($l,{children:[xe(Cb,{}),"SMS"]}),m.sms&&dr(ni,{children:[xe(su,{}),"Added"]}),o&&xe(ni,{children:"Disabled"})]})}),m.sms&&xe(jl,{onClick:()=>u("sms"),children:xe(lu,{})})]},"sms"),(f.passkey||m.passkey)&&dr(Jl,{children:[xe(Se,{style:{justifyContent:"center"},onClick:()=>d("passkey"),disabled:m.passkey||i,children:i?xe(lt,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):dr(ec,{children:[dr($l,{children:[xe(gb,{}),"Passkey"]}),m.passkey?dr(ni,{children:[xe(su,{}),"Added"]}):xe(ni,{isAccent:!0,children:xe(hb,{})})]})}),m.passkey&&xe(jl,{onClick:()=>u("passkey"),children:xe(lu,{})})]},"passkey")]}),xe(J,{})]})};import bb from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import Eb from"@heroicons/react/24/outline/ClockIcon";import Tb from"@heroicons/react/24/outline/ShieldCheckIcon";import Sb from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as Ab,useState as Is}from"react";import yd from"styled-components";import{Fragment as cu,jsx as ye,jsxs as Kr}from"react/jsx-runtime";var O2=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=V(),{data:n}=R(),{initLinkWithPasskey:i,linkWithPasskey:a}=I(),{initEnrollmentWithPasskey:l,submitEnrollmentWithPasskey:s}=ao(),[d,u]=Is(!1),[m,f]=Is(!1),[y,b]=Is(!1),[C,w]=Is(null),A=Ab(()=>o?.linkedAccounts.filter(S=>S.type==="passkey")??[],[o]),k=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},T=async S=>{u(!0);try{await l(),await s({credentialIds:S}),b(!0)}catch(M){w(M)}finally{u(!1)}},P=async()=>{f(!0),w(null);try{await i();let M=(await a())?.linkedAccounts.filter(N=>N.type==="passkey").map(N=>N.credentialId)??[];await T(M)}catch(S){w(S)}finally{f(!1)}};return A.length===0||m?ye(Pb,{onReset:r,onClose:t,onClick:P,isCreating:m}):y?ye(Rb,{onClick:k,onClose:k}):C?ye(mi,{error:C,backFn:()=>w(null),onClick:()=>w(null)}):ye(xb,{passkeys:A,isSubmitting:d,isCreating:m,onReset:r,onClose:t,onSubmitEnrollment:()=>T(A.map(S=>S.credentialId)),onAddPasskey:P})},Pb=({onReset:e,onClose:t,onClick:r,isCreating:o})=>Kr(cu,{children:[ye(_,{backFn:e,onClose:t},"header"),ye(He,{children:Kr(Fc,{children:[ye(fi,{}),ye(hi,{})]})}),ye(me,{children:"Set up passkey verification"}),Kr(oi,{children:[Kr(ir,{children:[ye(nr,{children:ye(Tb,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),Kr(ir,{children:[ye(nr,{children:ye(Eb,{})}),"Takes seconds to set up and use"]}),Kr(ir,{children:[ye(nr,{children:ye(bb,{})}),"Use your passkey to verify transactions and login to your account"]})]}),ye(F,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),ye(J,{})]}),xb=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:i,isCreating:a})=>{let[l,s]=Is(!1),d=l?n.length:n.length>3?2:3;return Kr(cu,{children:[ye(_,{backFn:l?()=>s(!1):e,onClose:t},"header"),!l&&ye(He,{children:Kr(Fc,{children:[ye(fi,{}),ye(hi,{})]})}),ye(me,{children:"Enable your passkeys for verification"}),Kr(oi,{children:[n.slice(0,d).map(u=>Kr(kb,{children:[ye(_b,{children:Ib(u)}),Kr(Mb,{children:["Last used: ",u.latestVerifiedAt?.toLocaleString()]})]},u.credentialId)),!l&&n.length>3&&ye(N2,{onClick:()=>s(!0),children:"View All"})]}),ye(F,{style:{marginTop:"1.5rem"},onClick:o,loading:i,children:"Enable passkeys"}),n.length<5&&ye(N2,{style:{marginTop:"0.5rem"},onClick:r,disabled:a,children:a?ye(lt,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),ye(J,{})]})},Rb=({onClick:e,onClose:t})=>Kr(cu,{children:[ye(_,{onClose:t},"header"),ye(He,{children:ye(et,{status:"success",children:ye(Sb,{})})}),ye(me,{children:"Passkey verification added"}),ye(he,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),ye(Rt,{children:ye(F,{onClick:e,children:"Done"})}),ye(J,{})]}),kb=yd.div`
2224
2224
  && {
2225
2225
  padding: 0.75rem 1rem;
2226
2226
  text-align: left;
@@ -2228,19 +2228,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
2228
2228
  border: 1px solid var(--privy-color-foreground-4);
2229
2229
  width: 100%;
2230
2230
  }
2231
- `,Sb=sd.div`
2231
+ `,_b=yd.div`
2232
2232
  font-size: 0.875rem;
2233
2233
  line-height: 1.375rem;
2234
2234
  font-weight: 500;
2235
2235
 
2236
2236
  color: var(--privy-color-foreground-1);
2237
- `,Ab=sd.div`
2237
+ `,Mb=yd.div`
2238
2238
  font-size: 0.75rem;
2239
2239
  font-weight: 400;
2240
2240
  line-height: 1.125rem;
2241
2241
 
2242
2242
  color: var(--privy-color-foreground-2);
2243
- `,Pb=e=>e.authenticatorName?e.createdWithBrowser?`${e.authenticatorName} on ${e.createdWithBrowser}`:e.authenticatorName:e.createdWithBrowser?e.createdWithOs?`${e.createdWithBrowser} on ${e.createdWithOs}`:`${e.createdWithBrowser}`:"Unknown device",E2=sd.button`
2243
+ `,Ib=e=>e.authenticatorName?e.createdWithBrowser?`${e.authenticatorName} on ${e.createdWithBrowser}`:e.authenticatorName:e.createdWithBrowser?e.createdWithOs?`${e.createdWithBrowser} on ${e.createdWithOs}`:`${e.createdWithBrowser}`:"Unknown device",N2=yd.button`
2244
2244
  && {
2245
2245
  width: 100%;
2246
2246
  font-size: 0.875rem;
@@ -2265,7 +2265,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2265
2265
  box-shadow: none;
2266
2266
  }
2267
2267
  }
2268
- `;import Nb from"@heroicons/react/24/solid/CheckCircleIcon";import P2 from"@heroicons/react/24/solid/PhoneIcon";import{useState as ld}from"react";import{useState as eu}from"react";import{isMobile as xb}from"react-device-detect";import A2 from"styled-components";import{Fragment as Lb,jsx as Rs,jsxs as Wb}from"react/jsx-runtime";var ks=6,Rb=new Array(ks).fill("");function kb(e){return e.replace(/\s+/g,"")}function tu(e){return/^[0-9]{1}$/.test(e)}function S2(e){return e.length===ks&&e.every(tu)}function _b(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var ui=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,i]=eu(Rb),[a,l]=eu(null),[s,d]=eu(null),m=async v=>{v.preventDefault();let C=kb(v.currentTarget.value);if(C==="")return;let b=_b(n,tu),A=C.split(""),k=!A.every(tu),S=A.length+b>ks;if(k){l("Passcode can only be numbers"),d(1);return}if(S){l("Passcode must be exactly 6 numbers"),d(1);return}l(null),d(null);let x=Number(v.currentTarget.name?.charAt(4)),T=[...C||[""]].slice(0,ks-x),M=[...n.slice(0,x),...T,...n.slice(x+T.length)];i(M);let D=T.length,B=Math.min(Math.max(x+D,0),ks-1);if(document.querySelector(`input[name=pin-${B}]`)?.focus(),S2(M))try{await e(M.join("")),document.querySelector(`input[name=pin-${B}]`)?.blur()}catch(Q){d(1),l(Q.message)}else try{await e(null)}catch(Q){d(1),l(Q.message)}},f=v=>{s===1&&(l(null),d(null));let C=[...n.slice(0,v),"",...n.slice(v+1)];i(C),v>0&&document.querySelector(`input[name=pin-${v-1}]`)?.focus(),S2(C)?e(C.join("")):e(null)},g=o?"success":!!(r||a)?"fail":"";return Rs(Lb,{children:Wb(Mb,{children:[Rs("div",{children:n.map((v,C)=>Rs("input",{name:`pin-${C}`,type:"text",value:n[C],onChange:m,onKeyUp:b=>{b.key==="Backspace"&&f(C)},inputMode:"numeric",autoFocus:C===0,pattern:"[0-9]",className:g,autoComplete:xb?"one-time-code":"off",disabled:t},C))}),Rs("div",{children:Rs(Ib,{fail:!!r||!!a,children:r||a})})]})})},Mb=A2.div`
2268
+ `;import Hb from"@heroicons/react/24/solid/CheckCircleIcon";import F2 from"@heroicons/react/24/solid/PhoneIcon";import{useState as gd}from"react";import{useState as du}from"react";import{isMobile as Wb}from"react-device-detect";import U2 from"styled-components";import{Fragment as Bb,jsx as Ws,jsxs as Fb}from"react/jsx-runtime";var Ls=6,Lb=new Array(Ls).fill("");function Nb(e){return e.replace(/\s+/g,"")}function pu(e){return/^[0-9]{1}$/.test(e)}function D2(e){return e.length===Ls&&e.every(pu)}function Ob(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var wi=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,i]=du(Lb),[a,l]=du(null),[s,d]=du(null),u=async b=>{b.preventDefault();let C=Nb(b.currentTarget.value);if(C==="")return;let w=Ob(n,pu),A=C.split(""),k=!A.every(pu),T=A.length+w>Ls;if(k){l("Passcode can only be numbers"),d(1);return}if(T){l("Passcode must be exactly 6 numbers"),d(1);return}l(null),d(null);let P=Number(b.currentTarget.name?.charAt(4)),S=[...C||[""]].slice(0,Ls-P),M=[...n.slice(0,P),...S,...n.slice(P+S.length)];i(M);let N=S.length,H=Math.min(Math.max(P+N,0),Ls-1);if(document.querySelector(`input[name=pin-${H}]`)?.focus(),D2(M))try{await e(M.join("")),document.querySelector(`input[name=pin-${H}]`)?.blur()}catch(K){d(1),l(K.message)}else try{await e(null)}catch(K){d(1),l(K.message)}},m=b=>{s===1&&(l(null),d(null));let C=[...n.slice(0,b),"",...n.slice(b+1)];i(C),b>0&&document.querySelector(`input[name=pin-${b-1}]`)?.focus(),D2(C)?e(C.join("")):e(null)},y=o?"success":!!(r||a)?"fail":"";return Ws(Bb,{children:Fb(Db,{children:[Ws("div",{children:n.map((b,C)=>Ws("input",{name:`pin-${C}`,type:"text",value:n[C],onChange:u,onKeyUp:w=>{w.key==="Backspace"&&m(C)},inputMode:"numeric",autoFocus:C===0,pattern:"[0-9]",className:y,autoComplete:Wb?"one-time-code":"off",disabled:t},C))}),Ws("div",{children:Ws(Ub,{fail:!!r||!!a,children:r||a})})]})})},Db=U2.div`
2269
2269
  display: flex;
2270
2270
  flex-direction: column;
2271
2271
  width: 100%;
@@ -2333,7 +2333,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2333
2333
  transform: translate(1px, 0px);
2334
2334
  }
2335
2335
  }
2336
- `,Ib=A2.div`
2336
+ `,Ub=U2.div`
2337
2337
  line-height: 20px;
2338
2338
  font-size: 13px;
2339
2339
  display: flex;
@@ -2341,7 +2341,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2341
2341
  width: 100%;
2342
2342
 
2343
2343
  color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
2344
- `;import{Fragment as ru,jsx as qe,jsxs as mi}from"react/jsx-runtime";var x2=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=ld(""),[i,a]=ld(!1),[l,s]=ld(null),[d,m]=ld("enroll"),{initEnrollmentWithSms:f,submitEnrollmentWithSms:u}=so(),{app:g,data:v}=P();function C(){v?.mfaEnrollmentFlow?.onSuccess(),e()}async function b({qualifiedPhoneNumber:S}){try{await f({phoneNumber:S}),n(S),m("verify")}catch(x){s(x)}}async function A(S){try{if(!S)return;await u({phoneNumber:o,mfaCode:S}),a(!0)}catch(x){throw sc(x)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):oi(x)?new Error("The code you entered is not valid"):ri(x)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):lc(x)?new Error("Verification canceled"):new Error("Unknown error")}}function k(){d==="verify"?m("enroll"):t()}return l?qe(ii,{error:l,backFn:()=>s(null),onClick:()=>s(null)}):d==="enroll"?mi(ru,{children:[qe(R,{backFn:t,onClose:r},"header"),qe(Be,{children:qe(et,{children:qe(P2,{})})}),qe(fe,{children:"Set up SMS verification"}),qe(ye,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),mi(Fr,{children:[qe(Tn,{onSubmit:b,hideRecent:!0}),mi(lh,{children:["By providing your mobile number, you agree to receive text messages from ",g?.name,". Some carrier charges may apply"]})]}),qe(J,{})]}):i?mi(ru,{children:[qe(R,{onClose:C},"header"),qe(Be,{children:qe(et,{status:"success",children:qe(Nb,{})})}),qe(fe,{children:"SMS verification added"}),qe(ye,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),qe(_t,{children:qe(U,{onClick:C,children:"Done"})}),qe(J,{})]}):mi(ru,{children:[qe(R,{backFn:k,onClose:r},"header"),qe(Be,{children:qe(et,{children:qe(P2,{})})}),qe(fe,{children:"Enter enrollment code"}),mi(Fr,{children:[qe(ui,{onChange:A}),mi(ye,{children:["To continue, enter the 6-digit code sent to ",qe("strong",{children:z1(o)})]})]}),qe(J,{})]})};import Ub from"@heroicons/react/24/solid/CheckCircleIcon";import Fb from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import{useState as k2}from"react";import Ob from"@heroicons/react/24/solid/ShieldCheckIcon";import{jsx as Db}from"react/jsx-runtime";var R2=({size:e,authUrl:t})=>Db(gn,{url:t,squareLogoElement:Ob,size:e,fgColor:"#1F1F1F"});import{Fragment as ou,jsx as He,jsxs as _s}from"react/jsx-runtime";var _2=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,i]=k2("enroll"),[a,l]=k2(!1),{submitEnrollmentWithTotp:s}=so(),{data:d}=P();function m(){d?.mfaEnrollmentFlow?.onSuccess(),e()}function f(){i("verify")}async function u(v){try{if(!v)return;await s({mfaCode:v}),l(!0)}catch(C){throw sc(C)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):oi(C)?new Error("The code you entered is not valid"):ri(C)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):lc(C)?new Error("Verification canceled"):new Error("Unknown error")}}function g(){n==="verify"?i("enroll"):r()}return n==="enroll"?_s(ou,{children:[He(R,{backFn:r,onClose:t},"header"),He(fe,{children:"Scan QR code"}),He(ye,{children:"Open your authenticator app and scan the QR code to continue."}),He(Ki,{children:He(R2,{authUrl:o.authUrl,size:200})}),_s(_t,{children:[He(St,{children:He(yn,{itemName:"secret",text:o.secret})}),He(U,{onClick:f,children:"Continue"})]}),He(J,{})]}):a?_s(ou,{children:[He(R,{onClose:m},"header"),He(Be,{children:He(et,{status:"success",children:He(Ub,{})})}),He(fe,{children:"Authenticator app verification added"}),He(ye,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),He(_t,{children:He(U,{onClick:m,children:"Done"})}),He(J,{})]}):_s(ou,{children:[He(R,{backFn:g,onClose:t},"header"),He(Be,{children:He(et,{children:He(Fb,{})})}),He(fe,{children:"Enter enrollment code"}),He(Fr,{children:He(ui,{onChange:u})}),_s(ye,{children:["To continue, enter the 6-digit code generated from your ",He("strong",{children:"authenticator app"})]}),He(J,{})]})};import{Fragment as Ta,jsx as $,jsxs as Ar}from"react/jsx-runtime";var I2=()=>{let{user:e,enrollInMfa:t}=V(),[r,o]=Ea(null),{unenrollWithSms:n,unenrollWithTotp:i,unenrollWithPasskey:a}=so(),{app:l,ready:s,data:d,onUserCloseViaDialogOrKeybindRef:m}=P(),{closePrivyModal:f}=_(),{promptMfa:u}=Ps(),{initEnrollmentWithTotp:g}=so(),[v,C]=Ea(!1),[b,A]=Ea(null),[k,S]=Ea(null),x=()=>{f({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),A(null)},500)},{initEnrollmentWithPasskey:T,submitEnrollmentWithPasskey:M}=so(),[D,B]=Ea(!1),[K,Q]=Ea(null);m.current=x;let L=e?.mfaMethods.includes("sms"),X=!!e?.phone,I=e?.mfaMethods.includes("totp"),q=e?.mfaMethods.includes("passkey"),Le=L||I||q,oe=e?.linkedAccounts.filter(le=>le.type==="passkey").map(le=>le.credentialId)??[];zb(()=>{Le&&C(!0)},[Le]);function Y(){o(null),A(null)}function ne(){C(!1)}async function me(){B(!0);try{await T(),await M({credentialIds:oe})}catch(le){Q(le)}finally{B(!1)}}async function be(le){if(await u().catch(Q),le==="totp"){A(le),S(null),g().then(Jt=>{S(Jt)}).catch(()=>{S(null),Y()});return}if(le==="passkey"&&oe.length===1)return await me();A(le)}if(!s||!e||!l)return Ar(Ta,{children:[$(R,{onClose:x},"header"),$(Be,{children:$(w2,{})}),$(Fr,{children:$(dt,{})}),$(J,{})]});async function ue(){o(null);try{await n()}catch{o(null)}}async function Re(){o(null);try{await i()}catch{o(null)}}async function gt(){o(null);try{await u(),await a()}catch{o(null)}}if(r==="sms")return Ar(Ta,{children:[$(R,{backFn:Y,onClose:x},"header"),$(Be,{children:$(et,{children:$(Gb,{})})}),$(fe,{children:"Remove SMS verification?"}),Ar(ye,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),$(_t,{children:$(U,{warn:!0,onClick:ue,children:"Remove SMS for MFA"})}),$(J,{})]});if(r==="totp")return Ar(Ta,{children:[$(R,{backFn:Y,onClose:x},"header"),$(Be,{children:$(et,{children:$(Hb,{})})}),$(fe,{children:"Remove Authenticator App verification?"}),Ar(ye,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),$(_t,{children:$(U,{warn:!0,onClick:Re,children:"Remove Authenticator App for MFA"})}),$(J,{})]});if(r==="passkey")return Ar(Ta,{children:[$(R,{backFn:Y,onClose:x},"header"),$(Be,{children:$(et,{children:$(qb,{})})}),$(fe,{children:"Are you sure you want to remove passkey verification?"}),$(ye,{children:"This will disable any passkeys you have set up for verification. You\u2019ll still be able to login with your passkeys if you\u2019ve set up passkey login."}),$(_t,{children:$(U,{warn:!0,onClick:gt,children:"Yes, remove"})}),$(J,{})]});if(d.mfaEnrollmentFlow.mfaMethods.length===0&&!Le)return Ar(Ta,{children:[$(R,{onClose:x},"header"),$(Be,{children:$(et,{children:$(M2,{})})}),$(fe,{children:"Add more security"}),Ar(ye,{children:[l?.name," does not have any verification methods enabled."]}),$(_t,{children:$(U,{onClick:x,children:"Close"})}),$(J,{})]});let tt=!Le&&!v;return tt?Ar(Ta,{children:[$(R,{onClose:x},"header"),$(Be,{children:$(et,{children:$(M2,{})})}),$(fe,{children:"Transaction Protection"}),$(ye,{children:"Set up transaction protection to add an extra layer of security to your account"}),Ar(Zn,{children:[Ar(sr,{children:[$(ar,{children:$(Bb,{})}),"Enable 2-Step verification for your ",l?.name," wallet."]}),Ar(sr,{children:[$(ar,{children:$(Vb,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),Ar(_t,{children:[$(U,{onClick:()=>C(!0),children:"Continue"}),$(eo,{onClick:x,children:"Not now"})]}),$(J,{})]}):b==="sms"?$(x2,{onComplete:x,onReset:Y,onClose:x}):b==="totp"&&k?$(_2,{onComplete:x,onClose:x,onReset:Y,totpInfo:k}):b==="passkey"?$(T2,{onComplete:x,onReset:Y,onClose:x}):$(b2,{showIntro:tt,userMfaMethods:e.mfaMethods,appMfaMethods:l.mfa.methods,userHasAuthSms:X,onBackToIntro:ne,handleSelectMethod:be,isTotpLoading:b==="totp"&&!k,isPasskeyLoading:D,error:K,onClose:x,setRemovingMfaMethod:o})};import SE from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import AE from"@heroicons/react/24/outline/FingerPrintIcon";import PE from"@heroicons/react/24/outline/PhoneIcon";import xE from"@heroicons/react/24/outline/ShieldCheckIcon";import RE from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import kE from"@heroicons/react/24/solid/PhoneIcon";import{useEffect as _E,useState as Ws}from"react";import{useMemo as hE,useEffect as yE,useState as e3}from"react";import gE from"styled-components";import{calculateTotalGasEstimate as CE,populateTransactionRequest as vE}from"@privy-io/js-sdk-core";import j2 from"styled-components";import L2 from"styled-components";import{jsx as W2,jsxs as Qb}from"react/jsx-runtime";var cd=({label:e,children:t,valueStyles:r})=>Qb(Kb,{children:[W2("div",{children:e}),W2(Yb,{style:{...r},children:t})]}),Kb=L2.div`
2344
+ `;import{Fragment as uu,jsx as qe,jsxs as bi}from"react/jsx-runtime";var B2=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=gd(""),[i,a]=gd(!1),[l,s]=gd(null),[d,u]=gd("enroll"),{initEnrollmentWithSms:m,submitEnrollmentWithSms:f}=ao(),{app:y,data:b}=R();function C(){b?.mfaEnrollmentFlow?.onSuccess(),e()}async function w({qualifiedPhoneNumber:T}){try{await m({phoneNumber:T}),n(T),u("verify")}catch(P){s(P)}}async function A(T){try{if(!T)return;await f({phoneNumber:o,mfaCode:T}),a(!0)}catch(P){throw fc(P)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):pi(P)?new Error("The code you entered is not valid"):di(P)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):hc(P)?new Error("Verification canceled"):new Error("Unknown error")}}function k(){d==="verify"?u("enroll"):t()}return l?qe(mi,{error:l,backFn:()=>s(null),onClick:()=>s(null)}):d==="enroll"?bi(uu,{children:[qe(_,{backFn:t,onClose:r},"header"),qe(He,{children:qe(et,{children:qe(F2,{})})}),qe(me,{children:"Set up SMS verification"}),qe(he,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),bi(Dr,{children:[qe(xn,{onSubmit:w,hideRecent:!0}),bi(wh,{children:["By providing your mobile number, you agree to receive text messages from ",y?.name,". Some carrier charges may apply"]})]}),qe(J,{})]}):i?bi(uu,{children:[qe(_,{onClose:C},"header"),qe(He,{children:qe(et,{status:"success",children:qe(Hb,{})})}),qe(me,{children:"SMS verification added"}),qe(he,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),qe(Rt,{children:qe(F,{onClick:C,children:"Done"})}),qe(J,{})]}):bi(uu,{children:[qe(_,{backFn:k,onClose:r},"header"),qe(He,{children:qe(et,{children:qe(F2,{})})}),qe(me,{children:"Enter enrollment code"}),bi(Dr,{children:[qe(wi,{onChange:A}),bi(he,{children:["To continue, enter the 6-digit code sent to ",qe("strong",{children:o2(o)})]})]}),qe(J,{})]})};import qb from"@heroicons/react/24/solid/CheckCircleIcon";import zb from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import{useState as V2}from"react";import Vb from"@heroicons/react/24/solid/ShieldCheckIcon";import{jsx as Gb}from"react/jsx-runtime";var H2=({size:e,authUrl:t})=>Gb(bn,{url:t,squareLogoElement:Vb,size:e,fgColor:"#1F1F1F"});import{Fragment as mu,jsx as Ve,jsxs as Ns}from"react/jsx-runtime";var G2=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,i]=V2("enroll"),[a,l]=V2(!1),{submitEnrollmentWithTotp:s}=ao(),{data:d}=R();function u(){d?.mfaEnrollmentFlow?.onSuccess(),e()}function m(){i("verify")}async function f(b){try{if(!b)return;await s({mfaCode:b}),l(!0)}catch(C){throw fc(C)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):pi(C)?new Error("The code you entered is not valid"):di(C)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):hc(C)?new Error("Verification canceled"):new Error("Unknown error")}}function y(){n==="verify"?i("enroll"):r()}return n==="enroll"?Ns(mu,{children:[Ve(_,{backFn:r,onClose:t},"header"),Ve(me,{children:"Scan QR code"}),Ve(he,{children:"Open your authenticator app and scan the QR code to continue."}),Ve(ea,{children:Ve(H2,{authUrl:o.authUrl,size:200})}),Ns(Rt,{children:[Ve(Tt,{children:Ve(wn,{itemName:"secret",text:o.secret})}),Ve(F,{onClick:m,children:"Continue"})]}),Ve(J,{})]}):a?Ns(mu,{children:[Ve(_,{onClose:u},"header"),Ve(He,{children:Ve(et,{status:"success",children:Ve(qb,{})})}),Ve(me,{children:"Authenticator app verification added"}),Ve(he,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),Ve(Rt,{children:Ve(F,{onClick:u,children:"Done"})}),Ve(J,{})]}):Ns(mu,{children:[Ve(_,{backFn:y,onClose:t},"header"),Ve(He,{children:Ve(et,{children:Ve(zb,{})})}),Ve(me,{children:"Enter enrollment code"}),Ve(Dr,{children:Ve(wi,{onChange:f})}),Ns(he,{children:["To continue, enter the 6-digit code generated from your ",Ve("strong",{children:"authenticator app"})]}),Ve(J,{})]})};import{Fragment as _a,jsx as $,jsxs as Tr}from"react/jsx-runtime";var z2=()=>{let{user:e,enrollInMfa:t}=V(),[r,o]=ka(null),{unenrollWithSms:n,unenrollWithTotp:i,unenrollWithPasskey:a}=ao(),{app:l,ready:s,data:d,onUserCloseViaDialogOrKeybindRef:u}=R(),{closePrivyModal:m}=I(),{promptMfa:f}=Ms(),{initEnrollmentWithTotp:y}=ao(),[b,C]=ka(!1),[w,A]=ka(null),[k,T]=ka(null),P=()=>{m({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),A(null)},500)},{initEnrollmentWithPasskey:S,submitEnrollmentWithPasskey:M}=ao(),[N,H]=ka(!1),[x,K]=ka(null);u.current=P;let W=e?.mfaMethods.includes("sms"),Q=!!e?.phone,pe=e?.mfaMethods.includes("totp"),q=e?.mfaMethods.includes("passkey"),ue=W||pe||q,Z=e?.linkedAccounts.filter(ce=>ce.type==="passkey").map(ce=>ce.credentialId)??[];Jb(()=>{ue&&C(!0)},[ue]);function ae(){o(null),A(null)}function se(){C(!1)}async function We(){H(!0);try{await S(),await M({credentialIds:Z})}catch(ce){K(ce)}finally{H(!1)}}async function Ee(ce){if(await f().catch(K),ce==="totp"){A(ce),T(null),y().then(tt=>{T(tt)}).catch(()=>{T(null),ae()});return}if(ce==="passkey"&&Z.length===1)return await We();A(ce)}if(!s||!e||!l)return Tr(_a,{children:[$(_,{onClose:P},"header"),$(He,{children:$(W2,{})}),$(Dr,{children:$(lt,{})}),$(J,{})]});async function ge(){o(null);try{await n()}catch{o(null)}}async function le(){o(null);try{await i()}catch{o(null)}}async function Ze(){o(null);try{await f(),await a()}catch{o(null)}}if(r==="sms")return Tr(_a,{children:[$(_,{backFn:ae,onClose:P},"header"),$(He,{children:$(et,{children:$(Xb,{})})}),$(me,{children:"Remove SMS verification?"}),Tr(he,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),$(Rt,{children:$(F,{warn:!0,onClick:ge,children:"Remove SMS for MFA"})}),$(J,{})]});if(r==="totp")return Tr(_a,{children:[$(_,{backFn:ae,onClose:P},"header"),$(He,{children:$(et,{children:$(Yb,{})})}),$(me,{children:"Remove Authenticator App verification?"}),Tr(he,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),$(Rt,{children:$(F,{warn:!0,onClick:le,children:"Remove Authenticator App for MFA"})}),$(J,{})]});if(r==="passkey")return Tr(_a,{children:[$(_,{backFn:ae,onClose:P},"header"),$(He,{children:$(et,{children:$(Zb,{})})}),$(me,{children:"Are you sure you want to remove passkey verification?"}),$(he,{children:"This will disable any passkeys you have set up for verification. You\u2019ll still be able to login with your passkeys if you\u2019ve set up passkey login."}),$(Rt,{children:$(F,{warn:!0,onClick:Ze,children:"Yes, remove"})}),$(J,{})]});if(d.mfaEnrollmentFlow.mfaMethods.length===0&&!ue)return Tr(_a,{children:[$(_,{onClose:P},"header"),$(He,{children:$(et,{children:$(q2,{})})}),$(me,{children:"Add more security"}),Tr(he,{children:[l?.name," does not have any verification methods enabled."]}),$(Rt,{children:$(F,{onClick:P,children:"Close"})}),$(J,{})]});let at=!ue&&!b;return at?Tr(_a,{children:[$(_,{onClose:P},"header"),$(He,{children:$(et,{children:$(q2,{})})}),$(me,{children:"Transaction Protection"}),$(he,{children:"Set up transaction protection to add an extra layer of security to your account"}),Tr(oi,{children:[Tr(ir,{children:[$(nr,{children:$(Kb,{})}),"Enable 2-Step verification for your ",l?.name," wallet."]}),Tr(ir,{children:[$(nr,{children:$(Qb,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),Tr(Rt,{children:[$(F,{onClick:()=>C(!0),children:"Continue"}),$($r,{onClick:P,children:"Not now"})]}),$(J,{})]}):w==="sms"?$(B2,{onComplete:P,onReset:ae,onClose:P}):w==="totp"&&k?$(G2,{onComplete:P,onClose:P,onReset:ae,totpInfo:k}):w==="passkey"?$(O2,{onComplete:P,onReset:ae,onClose:P}):$(L2,{showIntro:at,userMfaMethods:e.mfaMethods,appMfaMethods:l.mfa.methods,userHasAuthSms:Q,onBackToIntro:se,handleSelectMethod:Ee,isTotpLoading:w==="totp"&&!k,isPasskeyLoading:N,error:x,onClose:P,setRemovingMfaMethod:o})};import kE from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import _E from"@heroicons/react/24/outline/FingerPrintIcon";import ME from"@heroicons/react/24/outline/PhoneIcon";import IE from"@heroicons/react/24/outline/ShieldCheckIcon";import WE from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import LE from"@heroicons/react/24/solid/PhoneIcon";import{useEffect as NE,useState as Us}from"react";import{useMemo as wE,useEffect as bE,useState as u3}from"react";import EE from"styled-components";import{calculateTotalGasEstimate as TE,populateTransactionRequest as SE}from"@privy-io/js-sdk-core";import p3 from"styled-components";import Y2 from"styled-components";import{jsx as K2,jsxs as eE}from"react/jsx-runtime";var Cd=({label:e,children:t,valueStyles:r})=>eE(jb,{children:[K2("div",{children:e}),K2($b,{style:{...r},children:t})]}),jb=Y2.div`
2345
2345
  display: flex;
2346
2346
  align-items: center;
2347
2347
  justify-content: space-between;
@@ -2356,7 +2356,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2356
2356
  color: var(--privy-color-foreground-2);
2357
2357
  text-align: right;
2358
2358
  }
2359
- `,Yb=L2.div`
2359
+ `,$b=Y2.div`
2360
2360
  font-size: 14px;
2361
2361
  line-height: 100%;
2362
2362
  display: flex;
@@ -2365,28 +2365,28 @@ You will need this password to access your ${e} wallet on a new device. Please k
2365
2365
  border-radius: var(--privy-border-radius-full);
2366
2366
  background-color: var(--privy-color-background-2);
2367
2367
  padding: 4px 8px;
2368
- `;import pd from"styled-components";import{Fragment as jb,jsx as dd,jsxs as N2}from"react/jsx-runtime";var O2=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Da(e),n=t?ho(o,t):void 0,i=Et(o,r);return dd(D2,{children:n||i})},nu=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Da(e),n=t?ho(o,t):void 0,i=Et(o,r);return dd(D2,{children:n?N2(jb,{children:[dd(Xb,{children:"USD"}),n==="<$0.01"?N2(Jb,{children:[dd(Zb,{children:"<"}),"$0.01"]}):n]}):i})},D2=pd.span`
2368
+ `;import wd from"styled-components";import{Fragment as nE,jsx as vd,jsxs as Q2}from"react/jsx-runtime";var X2=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ga(e),n=t?yo(o,t):void 0,i=wt(o,r);return vd(Z2,{children:n||i})},fu=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ga(e),n=t?yo(o,t):void 0,i=wt(o,r);return vd(Z2,{children:n?Q2(nE,{children:[vd(tE,{children:"USD"}),n==="<$0.01"?Q2(oE,{children:[vd(rE,{children:"<"}),"$0.01"]}):n]}):i})},Z2=wd.span`
2369
2369
  font-size: 14px;
2370
2370
  line-height: 140%;
2371
2371
  display: flex;
2372
2372
  gap: 4px;
2373
2373
  align-items: center;
2374
- `,Xb=pd.span`
2374
+ `,tE=wd.span`
2375
2375
  font-size: 12px;
2376
2376
  line-height: 12px;
2377
2377
  color: var(--privy-color-foreground-3);
2378
- `,Zb=pd.span`
2378
+ `,rE=wd.span`
2379
2379
  font-size: 10px;
2380
- `,Jb=pd.span`
2380
+ `,oE=wd.span`
2381
2381
  display: flex;
2382
2382
  align-items: center;
2383
- `;import iu from"styled-components";import{QuantityToBigNumber as U2}from"@privy-io/js-sdk-core";import{jsx as Rn,jsxs as ud}from"react/jsx-runtime";var F2=({gas:e,tokenPrice:t,tokenSymbol:r})=>ud(ln,{style:{paddingBottom:"12px"},children:[ud(H2,{children:[Rn(G2,{children:"Est. Fees"}),Rn("div",{children:Rn(nu,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&Rn(V2,{children:`${Et(e,r)}`})]}),B2=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=U2(e.value||0).add(U2(t)).toHexString();return ud(ln,{children:[ud(H2,{children:[Rn(G2,{children:"Total (including fees)"}),Rn("div",{children:Rn(nu,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&Rn(V2,{children:Et(n,o)})]})},H2=iu.div`
2383
+ `;import hu from"styled-components";import{QuantityToBigNumber as J2}from"@privy-io/js-sdk-core";import{jsx as In,jsxs as bd}from"react/jsx-runtime";var j2=({gas:e,tokenPrice:t,tokenSymbol:r})=>bd(un,{style:{paddingBottom:"12px"},children:[bd(e3,{children:[In(r3,{children:"Est. Fees"}),In("div",{children:In(fu,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&In(t3,{children:`${wt(e,r)}`})]}),$2=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=J2(e.value||0).add(J2(t)).toHexString();return bd(un,{children:[bd(e3,{children:[In(r3,{children:"Total (including fees)"}),In("div",{children:In(fu,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&In(t3,{children:wt(n,o)})]})},e3=hu.div`
2384
2384
  display: flex;
2385
2385
  flex-direction: row;
2386
2386
  justify-content: space-between;
2387
2387
  align-items: center;
2388
2388
  padding-top: 4px;
2389
- `,V2=iu.div`
2389
+ `,t3=hu.div`
2390
2390
  display: flex;
2391
2391
  flex-direction: row;
2392
2392
  height: 12px;
@@ -2395,23 +2395,23 @@ You will need this password to access your ${e} wallet on a new device. Please k
2395
2395
  line-height: 12px;
2396
2396
  color: var(--privy-color-foreground-3);
2397
2397
  font-weight: 400;
2398
- `,G2=iu.div`
2398
+ `,r3=hu.div`
2399
2399
  font-size: 14px;
2400
2400
  line-height: 22.4px;
2401
2401
  font-weight: 400;
2402
- `;import $b from"@heroicons/react/24/outline/ChevronDownIcon";import{useContext as fi,useState as eE}from"react";import kn from"styled-components";import{createContext as q2,useContext as Wj}from"react";var Sa=q2(void 0);var Ms=q2(void 0);import{Fragment as lE,jsx as lo,jsxs as z2}from"react/jsx-runtime";var K2=({defaultValue:e,children:t})=>{let[r,o]=eE(e||null),n=i=>{o(r===i?null:i)};return lo(Sa.Provider,{value:{activePanel:r,togglePanel:n},children:lo(tE,{children:t})})},Y2=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=fi(Sa),n=r===e;return lo(Ms.Provider,{value:{onToggle:()=>o(e),value:e},children:lo(iE,{isActive:n,"data-open":n,children:t})})},Q2=({children:e})=>{let{activePanel:t}=fi(Sa),{onToggle:r,value:o}=fi(Ms),n=t===o;return z2(lE,{children:[z2(rE,{onClick:r,"data-open":n,children:[lo(nE,{children:e}),lo(sE,{isactive:n,children:lo($b,{height:"16px",width:"16px",strokeWidth:"2"})})]}),lo(oE,{})]})},X2=({children:e})=>{let{activePanel:t}=fi(Sa),{value:r}=fi(Ms);return lo(aE,{"data-open":t===r,children:lo(J2,{children:e})})},Z2=({children:e})=>{let{activePanel:t}=fi(Sa),{value:r}=fi(Ms);return lo(J2,{children:typeof e=="function"?e({isActive:t===r}):e})},tE=kn.div`
2402
+ `;import iE from"@heroicons/react/24/outline/ChevronDownIcon";import{useContext as Ei,useState as aE}from"react";import Wn from"styled-components";import{createContext as o3,useContext as Kj}from"react";var Ma=o3(void 0);var Os=o3(void 0);import{Fragment as fE,jsx as so,jsxs as n3}from"react/jsx-runtime";var i3=({defaultValue:e,children:t})=>{let[r,o]=aE(e||null),n=i=>{o(r===i?null:i)};return so(Ma.Provider,{value:{activePanel:r,togglePanel:n},children:so(sE,{children:t})})},a3=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=Ei(Ma),n=r===e;return so(Os.Provider,{value:{onToggle:()=>o(e),value:e},children:so(pE,{isActive:n,"data-open":n,children:t})})},s3=({children:e})=>{let{activePanel:t}=Ei(Ma),{onToggle:r,value:o}=Ei(Os),n=t===o;return n3(fE,{children:[n3(lE,{onClick:r,"data-open":n,children:[so(dE,{children:e}),so(mE,{isactive:n,children:so(iE,{height:"16px",width:"16px",strokeWidth:"2"})})]}),so(cE,{})]})},l3=({children:e})=>{let{activePanel:t}=Ei(Ma),{value:r}=Ei(Os);return so(uE,{"data-open":t===r,children:so(d3,{children:e})})},c3=({children:e})=>{let{activePanel:t}=Ei(Ma),{value:r}=Ei(Os);return so(d3,{children:typeof e=="function"?e({isActive:t===r}):e})},sE=Wn.div`
2403
2403
  display: flex;
2404
2404
  flex-direction: column;
2405
2405
  width: 100%;
2406
2406
  gap: 8px;
2407
- `,rE=kn.div`
2407
+ `,lE=Wn.div`
2408
2408
  display: flex;
2409
2409
  justify-content: space-between;
2410
2410
  align-items: center;
2411
2411
  width: 100%;
2412
2412
  cursor: pointer;
2413
2413
  padding-bottom: 8px;
2414
- `,oE=kn.div`
2414
+ `,cE=Wn.div`
2415
2415
  width: 100%;
2416
2416
 
2417
2417
  && {
@@ -2419,13 +2419,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
2419
2419
  border-color: var(--privy-color-foreground-4);
2420
2420
  }
2421
2421
  padding-bottom: 12px;
2422
- `,nE=kn.div`
2422
+ `,dE=Wn.div`
2423
2423
  font-size: 14px;
2424
2424
  font-weight: 500;
2425
2425
  line-height: 19.6px;
2426
2426
  width: 100%;
2427
2427
  padding-right: 8px;
2428
- `,iE=kn.div`
2428
+ `,pE=Wn.div`
2429
2429
  display: flex;
2430
2430
  flex-direction: column;
2431
2431
  width: 100%;
@@ -2437,7 +2437,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2437
2437
  border-color: var(--privy-color-foreground-4);
2438
2438
  border-radius: var(--privy-border-radius-md);
2439
2439
  }
2440
- `,aE=kn.div`
2440
+ `,uE=Wn.div`
2441
2441
  position: relative;
2442
2442
  overflow: hidden;
2443
2443
  transition: max-height 25ms ease-out;
@@ -2449,36 +2449,29 @@ You will need this password to access your ${e} wallet on a new device. Please k
2449
2449
  &[data-open='false'] {
2450
2450
  max-height: 0;
2451
2451
  }
2452
- `,J2=kn.div`
2452
+ `,d3=Wn.div`
2453
2453
  display: flex;
2454
2454
  flex-direction: column;
2455
2455
  gap: 12px;
2456
2456
  flex: 1 1 auto;
2457
2457
  min-height: 1px;
2458
- `,sE=kn.div`
2458
+ `,mE=Wn.div`
2459
2459
  transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
2460
- `;import cE from"styled-components";import{jsx as pE}from"react/jsx-runtime";var au=({walletAddress:e,chainId:t=Fo})=>pE(dE,{href:Em(t,e),target:"_blank",children:Bt(e)}),dE=cE.a`
2460
+ `;import hE from"styled-components";import{jsx as gE}from"react/jsx-runtime";var yu=({walletAddress:e,chainId:t=Bo})=>gE(yE,{href:Lm(t,e),target:"_blank",children:Xr(e)}),yE=hE.a`
2461
2461
  &:hover {
2462
2462
  text-decoration: underline;
2463
2463
  }
2464
- `;import{jsx as Pr,jsxs as su}from"react/jsx-runtime";var md=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=r?.value||0,s=Ve();return Pr(K2,{...s.render.standalone?{defaultValue:"details"}:{},children:su(Y2,{value:"details",children:[Pr(Q2,{children:su(uE,{children:[Pr("div",{children:o?.title||o?.actionDescription||"Details"}),Pr(mE,{children:Pr(O2,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),su(X2,{children:[Pr(cd,{label:"From",children:Pr(au,{walletAddress:e,chainId:r.chainId||Fo})}),Pr(cd,{label:"To",children:Pr(au,{walletAddress:t,chainId:r.chainId||Fo})}),o&&o.action&&Pr(cd,{label:"Action",children:o.action}),i&&Pr(F2,{transactionData:r,gas:i,tokenPrice:n,tokenSymbol:a})]}),Pr(Z2,{children:({isActive:d})=>Pr(B2,{transactionData:r,displayFee:d,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},uE=j2.div`
2464
+ `;import{jsx as Sr,jsxs as gu}from"react/jsx-runtime";var Ed=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=r?.value||0,s=Ne();return Sr(i3,{...s.render.standalone?{defaultValue:"details"}:{},children:gu(a3,{value:"details",children:[Sr(s3,{children:gu(CE,{children:[Sr("div",{children:o?.title||o?.actionDescription||"Details"}),Sr(vE,{children:Sr(X2,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),gu(l3,{children:[Sr(Cd,{label:"From",children:Sr(yu,{walletAddress:e,chainId:r.chainId||Bo})}),Sr(Cd,{label:"To",children:Sr(yu,{walletAddress:t,chainId:r.chainId||Bo})}),o&&o.action&&Sr(Cd,{label:"Action",children:o.action}),i&&Sr(j2,{transactionData:r,gas:i,tokenPrice:n,tokenSymbol:a})]}),Sr(c3,{children:({isActive:d})=>Sr($2,{transactionData:r,displayFee:d,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},CE=p3.div`
2465
2465
  display: flex;
2466
2466
  flex-direction: row;
2467
2467
  justify-content: space-between;
2468
- `,mE=j2.div`
2468
+ `,vE=p3.div`
2469
2469
  flex-shrink: 0;
2470
2470
  padding-left: 8px;
2471
- `;import fE from"styled-components";var $2=fE.img`
2472
- && {
2473
- height: ${e=>e.size==="sm"?"65px":"140px"};
2474
- width: ${e=>e.size==="sm"?"65px":"140px"};
2475
- border-radius: 16px;
2476
- margin-bottom: 12px;
2477
- }
2478
- `;import{jsx as t3}from"react/jsx-runtime";var Is=({pendingTransaction:e})=>{let{getAccessToken:t}=V(),{wallets:r}=Jr(),{walletProxy:o,rpcConfig:n,chains:i,appId:a,nativeTokenSymbolForChainId:l}=_(),[s,d]=e3(null),[m,f]=e3(e),{tokenPrice:u}=ko(m),g=l(e.chainId)||"ETH",v=hE(()=>r.find(C=>C.walletClientType==="privy"),[r]);return yE(()=>{async function C(){if(!await t()||!o||!v)return m;let A=Ir(m.chainId,i,n,{appId:a}),k=await vE(v.address,m,A),{totalGasEstimate:S}=await CE(k,A);return d(S.toHexString()),k}C().then(f).catch(console.error)},[o]),v?t3(wE,{children:t3(md,{from:v.address,to:m.to,txn:m,gas:s??void 0,tokenPrice:u,tokenSymbol:g})}):null},wE=gE.div`
2471
+ `;import{jsx as m3}from"react/jsx-runtime";var Ds=({pendingTransaction:e})=>{let{getAccessToken:t}=V(),{wallets:r}=Vo(),{walletProxy:o,rpcConfig:n,chains:i,appId:a,nativeTokenSymbolForChainId:l}=I(),[s,d]=u3(null),[u,m]=u3(e),{tokenPrice:f}=_o(u),y=l(e.chainId)||"ETH",b=wE(()=>r.find(C=>C.walletClientType==="privy"),[r]);return bE(()=>{async function C(){if(!await t()||!o||!b)return u;let A=_r(u.chainId,i,n,{appId:a}),k=await SE(b.address,u,A),{totalGasEstimate:T}=await TE(k,A);return d(T.toHexString()),k}C().then(m).catch(console.error)},[o]),b?m3(AE,{children:m3(Ed,{from:b.address,to:u.to,txn:u,gas:s??void 0,tokenPrice:f,tokenSymbol:y})}):null},AE=EE.div`
2479
2472
  width: 100%;
2480
2473
  padding: 1rem 0;
2481
- `;import bE from"@heroicons/react/24/outline/CalendarIcon";import EE from"@heroicons/react/24/outline/ExclamationTriangleIcon";import TE from"@heroicons/react/24/outline/ShieldCheckIcon";import{Fragment as r3,jsx as Dt,jsxs as Aa}from"react/jsx-runtime";var o3=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:i,submitSuccess:a})=>{let{pendingTransaction:l}=_();return Aa(r3,{children:[Dt(R,{onClose:r},"header"),Dt(nt,{children:Aa("div",{children:[Dt(ct,{success:a,fail:!!t}),t?Dt(EE,{style:{width:"38px",height:"38px"}}):Dt(ai,{style:{width:"38px",height:"38px"}})]})}),Dt(fe,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),Aa(Zn,{children:[Aa(sr,{children:[Dt(ar,{children:Dt(TE,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),Aa(sr,{children:[Dt(ar,{children:Dt(bE,{})}),"You last added a passkey on"," ",i?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),l&&Dt(Fr,{children:Dt(Is,{pendingTransaction:l})}),t&&Aa(r3,{children:[Dt(Ql,{style:{marginTop:"1.25rem"},children:t.message}),Dt(U,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&Dt(Ja,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),Dt(J,{})]})};import{Fragment as lu,jsx as Ee,jsxs as co}from"react/jsx-runtime";var cu=({open:e,onClose:t})=>{let{user:r}=V(),[o,n]=Ws(null),{init:i,cancel:a,submit:l}=Ps(),[s,d]=Ws(!1),[m,f]=Ws(!1),[u,g]=Ws(null),[v,C]=Ws(null);_E(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?k(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let b=T=>gp(T)?(d(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):oi(T)?(d(!1),new Error("The code you entered is not valid")):ri(T)?(d(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(T),d(!1),new Error("Something went wrong."));async function A(T){C(null);try{if(!T||!o)return;await l(o,T),f(!0),d(!1),t()}catch(M){throw b(M)}}async function k(T){if(T==="passkey"){try{n(T);let M=await i(T);if(!M)throw new Error("something went wrong");g(M),await l(T,M),f(!0),d(!1),t()}catch(M){C(b(M))}return}try{n(T),await i(T)}catch(M){console.error(M)}}let S=()=>{n(null),C(null),a(),t()},x=()=>{n(null),C(null)};if(!e||!r)return null;if(o==="passkey"){let T=r.linkedAccounts.filter(M=>M.type==="passkey"&&M.enrolledInMfa).sort((M,D)=>D.firstVerifiedAt.valueOf()-M.firstVerifiedAt.valueOf())[0];return Ee(o3,{account:T,selectedMethod:o,submitSuccess:m,hasBlockingError:s,error:v,onClose:S,onBack:x,handleSubmit:()=>A(u).catch(C)})}return o?Ee(ME,{submitSuccess:m,hasBlockingError:s,handleSubmitCode:A,selectedMethod:o,onClose:S,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):co(lu,{children:[Ee(R,{onClose:S},"header"),Ee(Be,{children:Ee(et,{children:Ee(xE,{})})}),Ee(fe,{children:"Verify your identity"}),Ee(ye,{children:"Choose a verification method"}),co(Gl,{children:[r.mfaMethods.includes("totp")&&co(xe,{onClick:()=>k("totp"),children:[Ee(SE,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&co(xe,{onClick:()=>k("sms"),children:[Ee(PE,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&co(xe,{onClick:()=>k("passkey"),children:[Ee(AE,{}),"Passkey"]},"passkey")]}),Ee(J,{})]})},ME=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:i})=>{let{app:a}=P(),{pendingTransaction:l}=_();switch(e){case"sms":return co(lu,{children:[Ee(R,{onClose:o},"header"),Ee(Be,{children:Ee(et,{children:Ee(kE,{})})}),Ee(fe,{children:"Enter verification code"}),co(Fr,{children:[Ee(ui,{success:t,disabled:r,onChange:i}),co(ye,{children:["To continue, please enter the 6-digit code sent to your ",Ee("strong",{children:"mobile device"})]}),l&&Ee(Is,{pendingTransaction:l})]}),n&&Ee(Ja,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),Ee(eo,{onClick:o,children:"Not now"}),Ee(J,{})]});case"totp":return co(lu,{children:[Ee(R,{onClose:o},"header"),Ee(Be,{children:Ee(et,{children:Ee(RE,{})})}),Ee(fe,{children:"Enter verification code"}),co(Fr,{children:[Ee(ui,{success:t,disabled:r,onChange:i}),co(ye,{children:["To continue, please enter the 6-digit code generated from your"," ",Ee("strong",{children:"authenticator app"})]}),l&&Ee(Is,{pendingTransaction:l})]}),n&&Ee(Ja,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),Ee(eo,{onClick:o,children:"Not now"}),Ee(J,{})]});default:return null}};import{useEffect as n3,useState as i3}from"react";import IE from"styled-components";import{Fragment as LE,jsx as Io,jsxs as fd}from"react/jsx-runtime";var a3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=V(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=P(),{getAuthMeta:s,initLoginWithOAuth:d,loginWithOAuth:m,updateWallets:f,setReadyToTrue:u,closePrivyModal:g,createAnalyticsEvent:v}=_(),[C,b]=i3(!1),[A,k]=i3(void 0),S=s()?.provider||"google",{name:x,component:T}=Ha(S),M=Pi(),D=Ne;n3(()=>{m(S).then(Q=>{b(!0),u(!0),Q&&M("login","onOAuthLoginComplete",Q)}).catch(Q=>{if(u(!1),Q?.privyErrorCode==="allowlist_rejected"){k(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(Q?.privyErrorCode==="max_accounts_reached"){console.error(new mo(Q).toString()),k(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(Q?.privyErrorCode==="user_does_not_exist"){k(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:L,detail:X}=kf(Q,S);k({retryable:L,detail:X,message:"Authentication failed"})}).finally(()=>{qn()})},[x,S]),n3(()=>{if(r&&e&&C&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let L=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},D);return()=>clearTimeout(L)}if(Ht(o,n?.embeddedWallets?.createOnLogin)){let L=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:X=>{console.error(X),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:X,provider:S,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},D);return()=>clearTimeout(L)}else{let L=setTimeout(()=>g({shouldCallAuthOnSuccess:!0,isSuccess:!0}),D);return f(),()=>clearTimeout(L)}}},[r,e,C,o]);let B=C?`Successfully connected with ${x}`:A?A.message:`Verifying connection to ${x}`,K="";return C?K="You\u2019re good to go!":A?K=A.detail:K="Just a few moments more",fd(LE,{children:[Io(R,{}),Io(ie,{}),fd(WE,{children:[Io(nt,{children:fd("div",{children:[Io(ct,{success:C,fail:!!A}),Io(T,{style:{width:"38px",height:"38px"}})]})}),fd(Ze,{children:[Io("h3",{children:B}),Io("p",{children:K})]}),A&&A?.retryable?Io(an,{onClick:()=>{qn(),d(S),k(void 0)},disabled:!C&&!A?.retryable,children:"Retry"}):null]}),Io(ae,{}),Io(J,{})]})},WE=IE.div`
2474
+ `;import PE from"@heroicons/react/24/outline/CalendarIcon";import xE from"@heroicons/react/24/outline/ExclamationTriangleIcon";import RE from"@heroicons/react/24/outline/ShieldCheckIcon";import{Fragment as f3,jsx as Nt,jsxs as Ia}from"react/jsx-runtime";var h3=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:i,submitSuccess:a})=>{let{pendingTransaction:l}=I();return Ia(f3,{children:[Nt(_,{onClose:r},"header"),Nt(rt,{children:Ia("div",{children:[Nt(st,{success:a,fail:!!t}),t?Nt(xE,{style:{width:"38px",height:"38px"}}):Nt(fi,{style:{width:"38px",height:"38px"}})]})}),Nt(me,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),Ia(oi,{children:[Ia(ir,{children:[Nt(nr,{children:Nt(RE,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),Ia(ir,{children:[Nt(nr,{children:Nt(PE,{})}),"You last added a passkey on"," ",i?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),l&&Nt(Dr,{children:Nt(Ds,{pendingTransaction:l})}),t&&Ia(f3,{children:[Nt(tc,{style:{marginTop:"1.25rem"},children:t.message}),Nt(F,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&Nt(os,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),Nt(J,{})]})};import{Fragment as Cu,jsx as be,jsxs as lo}from"react/jsx-runtime";var vu=({open:e,onClose:t})=>{let{user:r}=V(),[o,n]=Us(null),{init:i,cancel:a,submit:l}=Ms(),[s,d]=Us(!1),[u,m]=Us(!1),[f,y]=Us(null),[b,C]=Us(null);NE(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?k(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let w=S=>xp(S)?(d(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):pi(S)?(d(!1),new Error("The code you entered is not valid")):di(S)?(d(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(S),d(!1),new Error("Something went wrong."));async function A(S){C(null);try{if(!S||!o)return;await l(o,S),m(!0),d(!1),t()}catch(M){throw w(M)}}async function k(S){if(S==="passkey"){try{n(S);let M=await i(S);if(!M)throw new Error("something went wrong");y(M),await l(S,M),m(!0),d(!1),t()}catch(M){C(w(M))}return}try{n(S),await i(S)}catch(M){console.error(M)}}let T=()=>{n(null),C(null),a(),t()},P=()=>{n(null),C(null)};if(!e||!r)return null;if(o==="passkey"){let S=r.linkedAccounts.filter(M=>M.type==="passkey"&&M.enrolledInMfa).sort((M,N)=>N.firstVerifiedAt.valueOf()-M.firstVerifiedAt.valueOf())[0];return be(h3,{account:S,selectedMethod:o,submitSuccess:u,hasBlockingError:s,error:b,onClose:T,onBack:P,handleSubmit:()=>A(f).catch(C)})}return o?be(OE,{submitSuccess:u,hasBlockingError:s,handleSubmitCode:A,selectedMethod:o,onClose:T,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):lo(Cu,{children:[be(_,{onClose:T},"header"),be(He,{children:be(et,{children:be(IE,{})})}),be(me,{children:"Verify your identity"}),be(he,{children:"Choose a verification method"}),lo(Zl,{children:[r.mfaMethods.includes("totp")&&lo(Se,{onClick:()=>k("totp"),children:[be(kE,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&lo(Se,{onClick:()=>k("sms"),children:[be(ME,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&lo(Se,{onClick:()=>k("passkey"),children:[be(_E,{}),"Passkey"]},"passkey")]}),be(J,{})]})},OE=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:i})=>{let{app:a}=R(),{pendingTransaction:l}=I();switch(e){case"sms":return lo(Cu,{children:[be(_,{onClose:o},"header"),be(He,{children:be(et,{children:be(LE,{})})}),be(me,{children:"Enter verification code"}),lo(Dr,{children:[be(wi,{success:t,disabled:r,onChange:i}),lo(he,{children:["To continue, please enter the 6-digit code sent to your ",be("strong",{children:"mobile device"})]}),l&&be(Ds,{pendingTransaction:l})]}),n&&be(os,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),be($r,{onClick:o,children:"Not now"}),be(J,{})]});case"totp":return lo(Cu,{children:[be(_,{onClose:o},"header"),be(He,{children:be(et,{children:be(WE,{})})}),be(me,{children:"Enter verification code"}),lo(Dr,{children:[be(wi,{success:t,disabled:r,onChange:i}),lo(he,{children:["To continue, please enter the 6-digit code generated from your"," ",be("strong",{children:"authenticator app"})]}),l&&be(Ds,{pendingTransaction:l})]}),n&&be(os,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),be($r,{onClick:o,children:"Not now"}),be(J,{})]});default:return null}};import{useEffect as y3,useState as g3}from"react";import DE from"styled-components";import{Fragment as FE,jsx as Wo,jsxs as Td}from"react/jsx-runtime";var C3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=V(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=R(),{getAuthMeta:s,initLoginWithOAuth:d,loginWithOAuth:u,updateWallets:m,setReadyToTrue:f,closePrivyModal:y,createAnalyticsEvent:b}=I(),[C,w]=g3(!1),[A,k]=g3(void 0),T=s()?.provider||"google",{name:P,component:S}=Ya(T),M=Li(),N=Le;y3(()=>{u(T).then(K=>{w(!0),f(!0),K&&M("login","onOAuthLoginComplete",K)}).catch(K=>{if(f(!1),K?.privyErrorCode==="allowlist_rejected"){k(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(K?.privyErrorCode==="max_accounts_reached"){console.error(new fo(K).toString()),k(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(K?.privyErrorCode==="user_does_not_exist"){k(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:W,detail:Q}=Hf(K,T);k({retryable:W,detail:Q,message:"Authentication failed"})}).finally(()=>{Jn()})},[P,T]),y3(()=>{if(r&&e&&C&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let W=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},N);return()=>clearTimeout(W)}if(bt(o,n?.embeddedWallets?.createOnLogin)){let W=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:Q=>{console.error(Q),b({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Q,provider:T,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},N);return()=>clearTimeout(W)}else{let W=setTimeout(()=>y({shouldCallAuthOnSuccess:!0,isSuccess:!0}),N);return m(),()=>clearTimeout(W)}}},[r,e,C,o]);let H=C?`Successfully connected with ${P}`:A?A.message:`Verifying connection to ${P}`,x="";return C?x="You\u2019re good to go!":A?x=A.detail:x="Just a few moments more",Td(FE,{children:[Wo(_,{}),Wo(re,{}),Td(UE,{children:[Wo(rt,{children:Td("div",{children:[Wo(st,{success:C,fail:!!A}),Wo(S,{style:{width:"38px",height:"38px"}})]})}),Td(je,{children:[Wo("h3",{children:H}),Wo("p",{children:x})]}),A&&A?.retryable?Wo(dn,{onClick:()=>{Jn(),d(T),k(void 0)},disabled:!C&&!A?.retryable,children:"Retry"}):null]}),Wo(oe,{}),Wo(J,{})]})},UE=DE.div`
2482
2475
  display: flex;
2483
2476
  flex-direction: column;
2484
2477
  align-items: center;
@@ -2486,17 +2479,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
2486
2479
  margin-left: 27px;
2487
2480
  margin-right: 27px;
2488
2481
  gap: 24px;
2489
- `;import{useEffect as du,useRef as NE,useState as s3}from"react";import l3 from"styled-components";import{Fragment as DE,jsx as Qo,jsxs as hd}from"react/jsx-runtime";var c3=()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=P(),{loginWithPasskey:o,closePrivyModal:n}=_(),i=Ne,[a,l]=s3("loading"),[s,d]=s3(null),m=NE([]),f=b=>{m.current=[b,...m.current]};du(()=>()=>{m.current.forEach(b=>clearTimeout(b)),m.current=[]},[]);let u=()=>{switch(a){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},g=()=>{switch(a){case"loading":return`Please follow prompts to verify your passkey.
2490
- You will have to sign up with another method first to register a passkey for your account.`;case"success":return"You've successfully logged in with your passkey.";case"error":if(s instanceof $t){if(s.privyErrorCode==="cannot_link_more_of_type")return"Cannot link more passkeys to account.";if(s.privyErrorCode==="passkey_not_allowed")return`Passkey request timed out or rejected by user.
2482
+ `;import{useEffect as wu,useRef as BE,useState as v3}from"react";import w3 from"styled-components";import{Fragment as VE,jsx as jo,jsxs as Sd}from"react/jsx-runtime";var b3=()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=R(),{loginWithPasskey:o,closePrivyModal:n}=I(),i=Le,[a,l]=v3("loading"),[s,d]=v3(null),u=BE([]),m=w=>{u.current=[w,...u.current]};wu(()=>()=>{u.current.forEach(w=>clearTimeout(w)),u.current=[]},[]);let f=()=>{switch(a){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},y=()=>{switch(a){case"loading":return`Please follow prompts to verify your passkey.
2483
+ You will have to sign up with another method first to register a passkey for your account.`;case"success":return"You've successfully logged in with your passkey.";case"error":if(s instanceof Jt){if(s.privyErrorCode==="cannot_link_more_of_type")return"Cannot link more passkeys to account.";if(s.privyErrorCode==="passkey_not_allowed")return`Passkey request timed out or rejected by user.
2491
2484
  You will have to sign up with another method first to register a passkey for your account.`}return`An unknown error occurred.
2492
- You will have to sign up with another method first to register a passkey for your account.`}},v=()=>{switch(a){case"loading":case"success":return Qo(U,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return Qo(U,{onClick:C,disabled:!1,children:"Retry"})}},C=async()=>{l("loading");try{await o(),l("success")}catch(b){d(b),l("error")}};return du(()=>{a==="success"&&f(setTimeout(()=>{n({shouldCallAuthOnSuccess:!0,isSuccess:!0})},i))},[a]),du(()=>{C()},[]),hd(DE,{children:[Qo(R,{backFn:!e||t===e?void 0:r}),hd(OE,{children:[Qo(nt,{children:hd("div",{children:[Qo(ct,{success:a==="success",fail:a==="error"}),Qo(si,{style:{width:"38px",height:"38px"}})]})}),hd(Ze,{children:[Qo("h3",{children:u()}),Qo("p",{style:{whiteSpace:"pre-wrap"},children:g()})]}),v()]}),Qo(J,{})]})},OE=l3.div`
2485
+ You will have to sign up with another method first to register a passkey for your account.`}},b=()=>{switch(a){case"loading":case"success":return jo(F,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return jo(F,{onClick:C,disabled:!1,children:"Retry"})}},C=async()=>{l("loading");try{await o(),l("success")}catch(w){d(w),l("error")}};return wu(()=>{a==="success"&&m(setTimeout(()=>{n({shouldCallAuthOnSuccess:!0,isSuccess:!0})},i))},[a]),wu(()=>{C()},[]),Sd(VE,{children:[jo(_,{backFn:!e||t===e?void 0:r}),Sd(HE,{children:[jo(rt,{children:Sd("div",{children:[jo(st,{success:a==="success",fail:a==="error"}),jo(hi,{style:{width:"38px",height:"38px"}})]})}),Sd(je,{children:[jo("h3",{children:f()}),jo("p",{style:{whiteSpace:"pre-wrap"},children:y()})]}),b()]}),jo(J,{})]})},HE=w3.div`
2493
2486
  display: flex;
2494
2487
  flex-direction: column;
2495
2488
  align-items: center;
2496
2489
  justify-content: center;
2497
2490
  gap: 24px;
2498
2491
  width: 100%;
2499
- `,_ee=l3.div`
2492
+ `,Hee=w3.div`
2500
2493
  display: flex;
2501
2494
  align-items: center;
2502
2495
  justify-content: center;
@@ -2512,9 +2505,9 @@ You will have to sign up with another method first to register a passkey for you
2512
2505
  stroke: var(--privy-color-accent) !important;
2513
2506
  fill: var(--privy-color-accent) !important;
2514
2507
  }
2515
- `;import{useEffect as FE,useState as p3}from"react";import BE from"styled-components";import{isMobile as UE}from"react-device-detect";var d3=(e,t)=>{let r=new URL(window.location.href),o=encodeURIComponent(r.href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=injected&privy_wallet_client=phantom`);if(!$o()&&UE)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};import{Fragment as VE,jsx as Xo,jsxs as u3}from"react/jsx-runtime";var m3=()=>{let{forkSession:e,ready:t,authenticated:r}=V(),[o,n]=p3(""),[i,a]=p3(!1);FE(()=>{t&&r&&e().then(n)},[t,r]);let l=d3(o,!i),s={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return t&&(s.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",s.footnote="Once you're done, you can always return here and refresh to view your updated account."),i&&(s.title="Still here?",s.description="You may need to install the Phantom mobile app.",s.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),u3(VE,{children:[Xo(R,{},"header"),Xo(ie,{}),Xo(So,{title:s.title,description:s.description}),u3(cr,{children:[Xo(HE,{children:Xo(wo,{style:{width:"72px",height:"72px"}})}),Xo(Fl,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?Xo("p",{children:s.footnote}):null]}),Xo(ae,{}),Xo(H,{})]})},HE=BE(St)`
2508
+ `;import{useEffect as qE,useState as T3}from"react";import zE from"styled-components";import{isMobile as GE}from"react-device-detect";var E3=(e,t)=>{let r=new URL(window.location.href),o=encodeURIComponent(r.href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=injected&privy_wallet_client=phantom`);if(!on()&&GE)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};import{Fragment as YE,jsx as $o,jsxs as S3}from"react/jsx-runtime";var A3=()=>{let{forkSession:e,ready:t,authenticated:r}=V(),[o,n]=T3(""),[i,a]=T3(!1);qE(()=>{t&&r&&e().then(n)},[t,r]);let l=E3(o,!i),s={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return t&&(s.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",s.footnote="Once you're done, you can always return here and refresh to view your updated account."),i&&(s.title="Still here?",s.description="You may need to install the Phantom mobile app.",s.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),S3(YE,{children:[$o(_,{},"header"),$o(re,{}),$o(Ao,{title:s.title,description:s.description}),S3(sr,{children:[$o(KE,{children:$o(bo,{style:{width:"72px",height:"72px"}})}),$o(Kl,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?$o("p",{children:s.footnote}):null]}),$o(oe,{}),$o(B,{})]})},KE=zE(Tt)`
2516
2509
  margin: 16px auto;
2517
- `;import GE from"@heroicons/react/24/outline/ShieldCheckIcon";import{useEffect as qE,useState as yd}from"react";import gd,{css as zE}from"styled-components";import{Fragment as ZE,jsx as Zt,jsxs as hi}from"react/jsx-runtime";var f3=()=>{let[e,t]=yd(!0),{authenticated:r,getAccessToken:o}=V(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=_(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:d}=P(),[m,f]=yd(void 0),[u,g]=yd(""),[v,C]=yd(!1),{privyWallet:b,onCompleteNavigateTo:A,onSuccess:k,onFailure:S}=s.recoverWallet,x=(D="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),S(typeof D=="string"?new fr(D):D)};d.current=x,qE(()=>{if(!r||!b)return x("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let T=D=>{D&&f(D)};return hi(ZE,{children:[Zt(R,{onClose:x}),Zt(ie,{}),hi(YE,{children:[hi(KE,{children:[Zt(GE,{height:48,width:48,stroke:"var(--privy-color-accent)"}),Zt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),Zt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),hi("div",{children:[hi(fn,{children:[Zt(aa,{type:e?"password":"text",onChange:D=>T(D.target.value),disabled:v,style:{paddingRight:"2.3rem"}}),Zt(sa,{style:{right:"0.75rem"},children:e?Zt(la,{onClick:()=>t(!1)}):Zt(ca,{onClick:()=>t(!0)})})]}),!!u&&Zt(QE,{children:u})]}),hi("div",{children:[hi(hh,{children:[Zt("h4",{children:"Why is this necessary?"}),Zt("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),Zt(XE,{loading:v||!n,disabled:!m,onClick:async()=>{C(!0);let D=await o();if(D&&b&&m!==null)try{a({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:b.address}}),await n?.recover({address:b.address,accessToken:D,recoveryPin:m,recoveryMethod:b.recoveryMethod}),g(""),A?l(A):i({shouldCallAuthOnSuccess:!1}),k?.(b),a({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:b.address}})}catch(B){ey(B)?g("Invalid recovery password, please try again."):g("An error has occurred, please try again.")}finally{C(!1)}else return x("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!b&&v,children:"Recover your account"})]})]}),Zt(ae,{}),Zt(H,{})]})},KE=gd.div`
2510
+ `;import QE from"@heroicons/react/24/outline/ShieldCheckIcon";import{useEffect as XE,useState as Ad}from"react";import Pd,{css as ZE}from"styled-components";import{Fragment as tT,jsx as Kt,jsxs as Ti}from"react/jsx-runtime";var P3=()=>{let[e,t]=Ad(!0),{authenticated:r,getAccessToken:o}=V(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=I(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:d}=R(),[u,m]=Ad(void 0),[f,y]=Ad(""),[b,C]=Ad(!1),{privyWallet:w,onCompleteNavigateTo:A,onSuccess:k,onFailure:T}=s.recoverWallet,P=(N="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),T(typeof N=="string"?new ur(N):N)};d.current=P,XE(()=>{if(!r||!w)return P("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let S=N=>{N&&m(N)};return Ti(tT,{children:[Kt(_,{onClose:P}),Kt(re,{}),Ti(jE,{children:[Ti(JE,{children:[Kt(QE,{height:48,width:48,stroke:"var(--privy-color-accent)"}),Kt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),Kt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),Ti("div",{children:[Ti(Cn,{children:[Kt(ma,{type:e?"password":"text",onChange:N=>S(N.target.value),disabled:b,style:{paddingRight:"2.3rem"}}),Kt(fa,{style:{right:"0.75rem"},children:e?Kt(ha,{onClick:()=>t(!1)}):Kt(ya,{onClick:()=>t(!0)})})]}),!!f&&Kt($E,{children:f})]}),Ti("div",{children:[Ti(xh,{children:[Kt("h4",{children:"Why is this necessary?"}),Kt("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),Kt(eT,{loading:b||!n,disabled:!u,onClick:async()=>{C(!0);let N=await o();if(N&&w&&u!==null)try{a({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:w.address}}),await n?.recover({address:w.address,accessToken:N,recoveryPin:u,recoveryMethod:w.recoveryMethod}),y(""),A?l(A):i({shouldCallAuthOnSuccess:!1}),k?.(w),a({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:w.address}})}catch(H){my(H)?y("Invalid recovery password, please try again."):y("An error has occurred, please try again.")}finally{C(!1)}else return P("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!w&&b,children:"Recover your account"})]})]}),Kt(oe,{}),Kt(B,{})]})},JE=Pd.div`
2518
2511
  display: flex;
2519
2512
  flex-direction: column;
2520
2513
  align-items: center;
@@ -2536,40 +2529,40 @@ You will have to sign up with another method first to register a passkey for you
2536
2529
  font-weight: 400;
2537
2530
  line-height: 20px;
2538
2531
  }
2539
- `,YE=gd.div`
2532
+ `,jE=Pd.div`
2540
2533
  display: flex;
2541
2534
  flex-direction: column;
2542
2535
  justify-content: space-between;
2543
- `,QE=gd.div`
2536
+ `,$E=Pd.div`
2544
2537
  line-height: 20px;
2545
2538
  height: 20px;
2546
2539
  font-size: 13px;
2547
2540
  color: var(--privy-color-error);
2548
2541
  text-align: left;
2549
2542
  margin-top: 0.5rem;
2550
- `,XE=gd(U)`
2551
- ${e=>e.hideAnimations&&zE`
2543
+ `,eT=Pd(F)`
2544
+ ${e=>e.hideAnimations&&ZE`
2552
2545
  && {
2553
2546
  // Remove animations because the recoverWallet task on the iframe partially
2554
2547
  // blocks the renderer, so the animation stutters and doesn't look good
2555
2548
  transition: none;
2556
2549
  }
2557
2550
  `}
2558
- `;import{useCallback as JE,useEffect as v3,useState as pu}from"react";import{jsx as Cd,jsxs as h3}from"react/jsx-runtime";var vd=e=>h3("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[Cd("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992 0 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),Cd("defs",{children:h3("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[Cd("stop",{stopColor:"#3E82F4"}),Cd("stop",{offset:1,stopColor:"#93DCF7"})]})})]});import{jsx as Zo,jsxs as y3}from"react/jsx-runtime";var wd=({style:e,...t})=>y3("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[y3("g",{clipPath:"url(#clip0_2115_829)",children:[Zo("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),Zo("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),Zo("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),Zo("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),Zo("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),Zo("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),Zo("defs",{children:Zo("clipPath",{id:"clip0_2115_829",children:Zo("rect",{width:"16",height:"14",fill:"white"})})})]});import g3 from"styled-components";var Ls=g3.div`
2551
+ `;import{useCallback as rT,useEffect as M3,useState as bu}from"react";import{jsx as xd,jsxs as x3}from"react/jsx-runtime";var Rd=e=>x3("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[xd("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992 0 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),xd("defs",{children:x3("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[xd("stop",{stopColor:"#3E82F4"}),xd("stop",{offset:1,stopColor:"#93DCF7"})]})})]});import{jsx as en,jsxs as R3}from"react/jsx-runtime";var kd=({style:e,...t})=>R3("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[R3("g",{clipPath:"url(#clip0_2115_829)",children:[en("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),en("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),en("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),en("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),en("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),en("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),en("defs",{children:en("clipPath",{id:"clip0_2115_829",children:en("rect",{width:"16",height:"14",fill:"white"})})})]});import k3 from"styled-components";var Fs=k3.div`
2559
2552
  display: flex;
2560
2553
  flex-direction: column;
2561
2554
  gap: 12px;
2562
2555
  padding-top: 24px;
2563
2556
  padding-bottom: 24px;
2564
- `,C3=g3.div`
2557
+ `,_3=k3.div`
2565
2558
  padding-bottom: 24px;
2566
- `;import{Fragment as b3,jsx as _n,jsxs as bd}from"react/jsx-runtime";var w3={"google-drive":{name:"Google Drive",component:wd},icloud:{name:"iCloud",component:vd}},E3=()=>{let{logout:e}=V(),{navigate:t,setModalData:r,data:o}=P(),{recoveryOAuthFlow:n,closePrivyModal:i,createAnalyticsEvent:a}=_(),[l,s]=pu(!1),{provider:d,action:m,isInAccountCreateFlow:f}=o?.recoveryOAuthStatus,[u,g]=pu(void 0),[v,C]=pu(m==="create-wallet");if(d==="user-passcode")throw new Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let b=w3[d].name,A=w3[d].component,k=o?.recoverWallet?.onCompleteNavigateTo,S=new Xe(async(Q="create-wallet")=>(C(!0),new Promise((L,X)=>{setTimeout(async()=>{try{let I=window.open();await n(d,Q,I),s(!0),L()}catch{g({message:`${Q==="recover"?"Recovery":"Back up"} with ${b} unsuccessful`,detail:m==="recover"?`Please verify that you are selecting the ${b} account associated with your backup.`:"",retryable:!0}),X()}},0)})));v3(()=>{m!=="recover"&&S.execute(f?"create-wallet":"set-recovery")},[]),v3(()=>{if(!l)return;let Q=setTimeout(()=>{f?(r({createWallet:{onSuccess:()=>{},onFailure:L=>{a({eventName:"embedded_wallet_creation_failure_logout",payload:{error:L,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):i({shouldCallAuthOnSuccess:!1})},Ne);return()=>clearTimeout(Q)},[l]);let x=JE(async()=>{await S.execute("recover"),k?t(k):s(!0)},[]),T=d==="google-drive"?"Google Drive":"Apple iCloud",M=m==="recover"?"recovered":"backed up",D=m==="recover"?"Recovering":"Backing up",B=l&&`Successfully ${M} with ${T}.`||u&&u.message||`${D} with ${T}...`,K=u?u.detail:"";return bd(b3,{children:[_n(R,{}),v?_n(b3,{children:bd(Ls,{children:[_n(ve,{title:B,icon:_n(A,{style:{width:"38px",height:"38px"}}),description:K}),u&&u?.retryable?_n(U,{onClick:()=>{qn(),g(void 0),m==="create-wallet"?S.execute("create-wallet"):x()},disabled:!l&&!u?.retryable,children:"Try again"}):null]})}):bd(Ls,{children:[_n(ve,{title:"Confirm it's really you",icon:_n(A,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${T} where your account is backed up.`}),bd(U,{onClick:x,children:["Confirm with ",T]})]}),_n(H,{})]})};import{useEffect as T3,useState as Ns}from"react";import{jsx as jE}from"react/jsx-runtime";var S3=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=P(),[n,i]=Ns(""),[a,l]=Ns(!1),[s,d]=Ns(),[m,f]=Ns(null),{authenticated:u}=V(),{closePrivyModal:g,isNewUserThisSession:v,initializeWalletProxy:C}=_(),{onSuccess:b,onFailure:A,callAuthOnSuccessOnClose:k}=r.createWallet,{createWallet:S}=uc(),[x,T]=Ns(null),M=new Xe(async()=>{try{let K=await S(s);if(!K)return;T(K),v?t("EMBEDDED_WALLET_CREATED_SCREEN"):(b(K),g({shouldCallAuthOnSuccess:k}))}catch(K){i(K.message)}});T3(()=>{m||C(3e4).then(K=>f(K))},[m]),T3(()=>{if(!u){t("LANDING"),A(new Error("User must be authenticated before creating a Privy wallet"));return}},[u]);let D=()=>{x&&x?.recoveryMethod!=="user-passcode"?(A(new fr("User created a wallet but failed to set a password for it")),g({shouldCallAuthOnSuccess:!1})):x?(b(x),g({shouldCallAuthOnSuccess:k})):(A(new fr("User wallet creation failed")),g({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let B=async()=>{l(!0);let K=250;return M.execute().then(()=>new Promise(Q=>setTimeout(Q,K))).finally(()=>l(!1))};return jE(yc,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!m,buttonLoading:a,buttonHideAnimations:!x&&a,isResettingPassword:!1,error:n,password:s||"",onClose:D,onPasswordChange:d,onPasswordGenerate:()=>d(hc()),onSubmit:B})};import $E from"@heroicons/react/24/outline/LockClosedIcon";import eT from"@heroicons/react/24/outline/PencilSquareIcon";import tT from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import{useState as rT}from"react";import oT from"styled-components";import{Fragment as mu,jsx as bt,jsxs as Mn}from"react/jsx-runtime";var uu=oT.div`
2559
+ `;import{Fragment as W3,jsx as Ln,jsxs as _d}from"react/jsx-runtime";var I3={"google-drive":{name:"Google Drive",component:kd},icloud:{name:"iCloud",component:Rd}},L3=()=>{let{logout:e}=V(),{navigate:t,setModalData:r,data:o}=R(),{recoveryOAuthFlow:n,closePrivyModal:i,createAnalyticsEvent:a}=I(),[l,s]=bu(!1),{provider:d,action:u,isInAccountCreateFlow:m}=o?.recoveryOAuthStatus,[f,y]=bu(void 0),[b,C]=bu(u==="create-wallet");if(d==="user-passcode")throw new Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let w=I3[d].name,A=I3[d].component,k=o?.recoverWallet?.onCompleteNavigateTo,T=new Je(async(K="create-wallet")=>(C(!0),new Promise((W,Q)=>{setTimeout(async()=>{try{let pe=window.open();await n(d,K,pe),s(!0),W()}catch{y({message:`${K==="recover"?"Recovery":"Back up"} with ${w} unsuccessful`,detail:u==="recover"?`Please verify that you are selecting the ${w} account associated with your backup.`:"",retryable:!0}),Q()}},0)})));M3(()=>{u!=="recover"&&T.execute(m?"create-wallet":"set-recovery")},[]),M3(()=>{if(!l)return;let K=setTimeout(()=>{m?(r({createWallet:{onSuccess:()=>{},onFailure:W=>{a({eventName:"embedded_wallet_creation_failure_logout",payload:{error:W,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):i({shouldCallAuthOnSuccess:!1})},Le);return()=>clearTimeout(K)},[l]);let P=rT(async()=>{await T.execute("recover"),k?t(k):s(!0)},[]),S=d==="google-drive"?"Google Drive":"Apple iCloud",M=u==="recover"?"recovered":"backed up",N=u==="recover"?"Recovering":"Backing up",H=l&&`Successfully ${M} with ${S}.`||f&&f.message||`${N} with ${S}...`,x=f?f.detail:"";return _d(W3,{children:[Ln(_,{}),b?Ln(W3,{children:_d(Fs,{children:[Ln(Ce,{title:H,icon:Ln(A,{style:{width:"38px",height:"38px"}}),description:x}),f&&f?.retryable?Ln(F,{onClick:()=>{Jn(),y(void 0),u==="create-wallet"?T.execute("create-wallet"):P()},disabled:!l&&!f?.retryable,children:"Try again"}):null]})}):_d(Fs,{children:[Ln(Ce,{title:"Confirm it's really you",icon:Ln(A,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${S} where your account is backed up.`}),_d(F,{onClick:P,children:["Confirm with ",S]})]}),Ln(B,{})]})};import{useEffect as N3,useState as Bs}from"react";import{jsx as oT}from"react/jsx-runtime";var O3=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=R(),[n,i]=Bs(""),[a,l]=Bs(!1),[s,d]=Bs(),[u,m]=Bs(null),{authenticated:f}=V(),{closePrivyModal:y,isNewUserThisSession:b,initializeWalletProxy:C}=I(),{onSuccess:w,onFailure:A,callAuthOnSuccessOnClose:k}=r.createWallet,{createWallet:T}=vc(),[P,S]=Bs(null),M=new Je(async()=>{try{let x=await T(s);if(!x)return;S(x),b?t("EMBEDDED_WALLET_CREATED_SCREEN"):(w(x),y({shouldCallAuthOnSuccess:k}))}catch(x){i(x.message)}});N3(()=>{u||C(3e4).then(x=>m(x))},[u]),N3(()=>{if(!f){t("LANDING"),A(new Error("User must be authenticated before creating a Privy wallet"));return}},[f]);let N=()=>{P&&P?.recoveryMethod!=="user-passcode"?(A(new ur("User created a wallet but failed to set a password for it")),y({shouldCallAuthOnSuccess:!1})):P?(w(P),y({shouldCallAuthOnSuccess:k})):(A(new ur("User wallet creation failed")),y({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let H=async()=>{l(!0);let x=250;return M.execute().then(()=>new Promise(K=>setTimeout(K,x))).finally(()=>l(!1))};return oT(Tc,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!u,buttonLoading:a,buttonHideAnimations:!P&&a,isResettingPassword:!1,error:n,password:s||"",onClose:N,onPasswordChange:d,onPasswordGenerate:()=>d(Ec()),onSubmit:H})};import nT from"@heroicons/react/24/outline/LockClosedIcon";import iT from"@heroicons/react/24/outline/PencilSquareIcon";import aT from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import{useState as sT}from"react";import lT from"styled-components";import{Fragment as Tu,jsx as vt,jsxs as Nn}from"react/jsx-runtime";var Eu=lT.div`
2567
2560
  width: 24px;
2568
2561
  height: 24px;
2569
2562
  display: flex;
2570
2563
  justify-content: center;
2571
2564
  align-items: center;
2572
- `,nT={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},iT=({onClose:e})=>Mn(C3,{children:[bt(ve,{title:"Why do I need to secure my account?",icon:bt(tT,{width:48}),description:Mn(mu,{children:[bt("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),bt("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It\u2019s important you don\u2019t lose access to the method you choose."})]})}),bt(U,{onClick:e,children:"Select backup method"})]}),A3=()=>{let[e,t]=rT(!1),{navigate:r,lastScreen:o,navigateBack:n,setModalData:i,data:a,onUserCloseViaDialogOrKeybindRef:l}=P(),{user:s}=V(),{embeddedWallets:d}=Ve(),{closePrivyModal:m}=_(),f=Se(s),u=f===null,{isInAccountCreateFlow:g,isResettingPassword:v}=a.recoverySelection,C=f&&f.recoveryMethod!=="privy",b=C?"Update backup method":"Secure your account",A=C?Mn("span",{children:["Your account is currently secured using"," ",bt("strong",{children:nT[f?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function k(x){i({recoveryOAuthStatus:{provider:x,action:u?"create-wallet":"set-recovery",isInAccountCreateFlow:g}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}function S(){a?.setWalletPassword?.onFailure(new Error("User exited set recovery flow")),m({shouldCallAuthOnSuccess:a?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return l.current=S,Mn(mu,{children:[bt(R,{onClose:S,backFn:e?()=>t(!1):o?n:void 0,infoFn:o||e?void 0:()=>t(!0)},"header"),e?bt(iT,{onClose:()=>t(!1)}):Mn(mu,{children:[bt(ve,{title:b,icon:bt($E,{width:48}),description:A}),bt(Ls,{children:d.userOwnedRecoveryOptions.filter(x=>["icloud","google-drive"].includes(f?.recoveryMethod||"")?x!==f?.recoveryMethod:!0).sort().map(x=>{switch(x){case"google-drive":return Mn(xe,{onClick:()=>k("google-drive"),children:[bt(uu,{children:bt(wd,{style:{width:18}})}),"Back up to Google Drive"]},x);case"icloud":return Mn(xe,{onClick:()=>k("icloud"),children:[bt(uu,{children:bt(vd,{style:{width:24}})}),"Back up to Apple iCloud"]},x);case"user-passcode":return Mn(xe,{onClick:()=>{let T=Cp({isCreatingWallet:u,skipSplashScreen:!0});r(T)},children:[bt(uu,{children:bt(eT,{style:{width:18}})}),v?"Reset your":"Set a"," password"]},x);default:return null}})})]}),bt(H,{})]})};import sT from"@heroicons/react/24/outline/ExclamationTriangleIcon";import lT from"@heroicons/react/24/outline/LockClosedIcon";import{useState as fu}from"react";import aT from"styled-components";var P3=aT.div`
2565
+ `,cT={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},dT=({onClose:e})=>Nn(_3,{children:[vt(Ce,{title:"Why do I need to secure my account?",icon:vt(aT,{width:48}),description:Nn(Tu,{children:[vt("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),vt("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It\u2019s important you don\u2019t lose access to the method you choose."})]})}),vt(F,{onClick:e,children:"Select backup method"})]}),D3=()=>{let[e,t]=sT(!1),{navigate:r,lastScreen:o,navigateBack:n,setModalData:i,data:a,onUserCloseViaDialogOrKeybindRef:l}=R(),{user:s}=V(),{embeddedWallets:d}=Ne(),{closePrivyModal:u}=I(),m=Me(s),f=m===null,{isInAccountCreateFlow:y,isResettingPassword:b}=a.recoverySelection,C=m&&m.recoveryMethod!=="privy",w=C?"Update backup method":"Secure your account",A=C?Nn("span",{children:["Your account is currently secured using"," ",vt("strong",{children:cT[m?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function k(P){i({recoveryOAuthStatus:{provider:P,action:f?"create-wallet":"set-recovery",isInAccountCreateFlow:y}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}function T(){a?.setWalletPassword?.onFailure(new Error("User exited set recovery flow")),u({shouldCallAuthOnSuccess:a?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return l.current=T,Nn(Tu,{children:[vt(_,{onClose:T,backFn:e?()=>t(!1):o?n:void 0,infoFn:o||e?void 0:()=>t(!0)},"header"),e?vt(dT,{onClose:()=>t(!1)}):Nn(Tu,{children:[vt(Ce,{title:w,icon:vt(nT,{width:48}),description:A}),vt(Fs,{children:d.userOwnedRecoveryOptions.filter(P=>["icloud","google-drive"].includes(m?.recoveryMethod||"")?P!==m?.recoveryMethod:!0).sort().map(P=>{switch(P){case"google-drive":return Nn(Se,{onClick:()=>k("google-drive"),children:[vt(Eu,{children:vt(kd,{style:{width:18}})}),"Back up to Google Drive"]},P);case"icloud":return Nn(Se,{onClick:()=>k("icloud"),children:[vt(Eu,{children:vt(Rd,{style:{width:24}})}),"Back up to Apple iCloud"]},P);case"user-passcode":return Nn(Se,{onClick:()=>{let S=Rp({isCreatingWallet:f,skipSplashScreen:!0});r(S)},children:[vt(Eu,{children:vt(iT,{style:{width:18}})}),b?"Reset your":"Set a"," password"]},P);default:return null}})})]}),vt(B,{})]})};import uT from"@heroicons/react/24/outline/ExclamationTriangleIcon";import mT from"@heroicons/react/24/outline/LockClosedIcon";import{useState as Su}from"react";import pT from"styled-components";var U3=pT.div`
2573
2566
  && {
2574
2567
  border-width: 4px;
2575
2568
  }
@@ -2582,9 +2575,9 @@ You will have to sign up with another method first to register a passkey for you
2582
2575
  border-style: solid;
2583
2576
  border-color: ${e=>e.$color??"var(--privy-color-accent)"};
2584
2577
  border-radius: 50%;
2585
- `;import{Fragment as x3,jsx as mr,jsxs as R3}from"react/jsx-runtime";var k3=()=>{let{user:e,getAccessToken:t}=V(),r=Se(e),{walletProxy:o,refreshUser:n,closePrivyModal:i}=_(),a=P(),[l,s]=fu(!1),[d,m]=fu(null),[f,u]=fu(null);function g(){if(!l){if(f){a.data?.setWalletPassword?.onFailure(f),i();return}if(!d){a.data?.setWalletPassword?.onFailure(new Error("User exited set recovery flow")),i();return}}}a.onUserCloseViaDialogOrKeybindRef.current=g;async function v(){s(!0);try{let b=await t();if(!b||!o||!r)return;if(!(await o.setRecovery({recoveryMethod:"privy",address:r.address,accessToken:b})).address)throw new Error("Unable to set recovery on wallet");let k=await n();if(!k)throw new Error("Unable to set recovery on wallet");let S=Se(k);if(!S)throw new Error("Unabled to set recovery on wallet");m(!!k),setTimeout(()=>{a.data?.setWalletPassword?.onSuccess(S),i()},Ne)}catch(b){u(b)}finally{s(!1)}}let C=!!(l||d);return f?R3(x3,{children:[mr(R,{onClose:g},"header"),mr(P3,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:mr(sT,{height:38,width:38,stroke:"var(--privy-color-error)"})}),mr(io,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),mr(gr,{style:{minHeight:"2rem"}}),mr(Vo,{onClick:()=>u(null),children:"Try again"}),mr(H,{})]}):R3(x3,{children:[mr(R,{onClose:g},"header"),mr(lT,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),mr(io,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),mr(Hr,{style:{marginTop:"1rem"},children:"When you log into a new device, you\u2019ll only need to authenticate to access your account. Never get logged out if you forget your password."}),mr(gr,{style:{minHeight:"2rem"}}),mr(Vo,{loading:l,disabled:C,onClick:()=>v(),children:d?"Success":"Confirm"}),mr(H,{})]})};import{getAddress as G3}from"@ethersproject/address";import{useEffect as JT,useMemo as xd,useState as Os}from"react";import{ProviderErrors as K3,QuantityToBigNumber as q3}from"@privy-io/js-sdk-core";import{EtherscanProvider as _re}from"@ethersproject/providers";import{QuantityToBigNumber as cT}from"@privy-io/js-sdk-core";async function Ed(e,t,r,o,n,i){o=Object.assign({chainId:Fo},o),dT(o);let l=(await r.rpc({address:t,accessToken:e,requesterAppId:i,request:{method:"eth_signTransaction",params:[o]}})).response.data;return await n.sendTransaction(l)}async function Td(e,t,r,o){let n=await o.getBalance(e),i=t.value||0,l=!n.sub(cT(i)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function dT(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!pT(o))throw new Error(`Transaction request property '${r}' must be a valid number, bigint, or hex string representing a quantity`)}if(typeof e.chainId!="number")throw new Error("Transaction request property 'chainId' must be a number")}function pT(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&uT(e);return t||r||o}function uT(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Sd(e){return{to:e.to,from:e.from,contractAddress:e.contractAddress,transactionIndex:e.transactionIndex,root:e.root,logsBloom:e.logsBloom,blockHash:e.blockHash,transactionHash:e.transactionHash,logs:e.logs,blockNumber:e.blockNumber,confirmations:e.confirmations,byzantium:e.byzantium,type:e.type,status:e.status,gasUsed:e.gasUsed.toHexString(),cumulativeGasUsed:e.cumulativeGasUsed.toHexString(),effectiveGasPrice:e.effectiveGasPrice?e.effectiveGasPrice.toHexString():void 0}}var hu=["FUNDING_METHOD_SELECTION_SCREEN","FUNDING_TRANSFER_FROM_WALLET_SCREEN","FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN","FUNDING_MANUAL_TRANSFER_SCREEN","MOONPAY_PROMPT_SCREEN","MOONPAY_STATUS_SCREEN"],_3={["FUNDING_METHOD_SELECTION_SCREEN"]:null,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:"external",["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:"external",["FUNDING_MANUAL_TRANSFER_SCREEN"]:"manual",["MOONPAY_PROMPT_SCREEN"]:"moonpay",["MOONPAY_STATUS_SCREEN"]:"moonpay"},mT={moonpay:"MOONPAY_PROMPT_SCREEN","coinbase-onramp":"COINBASE_ONRAMP_STATUS_SCREEN",external:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};function Ad({fundingMethods:e}){if(e.length===0)throw new Error("Wallet funding is not enabled");return e.length===1?mT[e[0]]:"FUNDING_METHOD_SELECTION_SCREEN"}import M3 from"styled-components";import{Fragment as CT,jsx as Qe,jsxs as Wo}from"react/jsx-runtime";var I3=({img:e,submitError:t,prepareError:r,onClose:o,action:n,amount:i,title:a,subtitle:l,total:s,to:d,network:m,hasFunds:f,fee:u,from:g,cta:v,chain:C,isSubmitting:b,isPreparing:A,isTokenPriceLoading:k,isTokenContractInfoLoading:S,symbol:x,balance:T,onClick:M,spender:D})=>Wo(CT,{children:[Qe(R,{onClose:o}),e&&Qe(gT,{children:e}),Qe(io,{style:{marginTop:e?"1.5rem":0},children:a}),Qe(Hr,{children:l}),Wo(xc,{style:{marginTop:"2rem"},children:[s&&Wo(Lt,{children:[Qe(Nt,{children:"Total"}),Qe(zt,{$isLoading:A||k,children:s})]}),n&&n!=="transaction"&&Wo(Lt,{children:[Qe(Nt,{children:"Action"}),Qe(zt,{children:n})]}),i?Wo(Lt,{children:[Qe(Nt,{children:"Amount"}),Wo(zt,{$isLoading:S,children:[yT(i)," ",x]})]}):null,D?Wo(Lt,{children:[Qe(Nt,{children:"Spender"}),Qe(zt,{children:Qe(Oa,{address:D,url:C?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,d&&Wo(Lt,{children:[Qe(Nt,{children:"To"}),Qe(zt,{children:Qe(Oa,{address:d,url:C?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),Wo(Lt,{children:[Qe(Nt,{children:"Network"}),Qe(zt,{children:m})]}),Wo(Lt,{children:[Qe(Nt,{children:"Estimated fee"}),Qe(zt,{$isLoading:A||k,children:u})]})]}),Qe(gr,{}),t?Qe(Na,{style:{marginTop:"2rem"},children:t.message}):r?Qe(Na,{style:{marginTop:"2rem"},children:hT}):null,Qe(fT,{$useSmallMargins:!!(r||t),address:g,balance:T,isLoading:A||k,errMsg:!A&&!r&&!t&&!f?`Add funds on ${C?.name} to complete transaction.`:void 0}),Qe(Vo,{style:{marginTop:"1rem"},loading:b,disabled:A,onClick:M,children:v}),Qe(H,{})]}),fT=M3(Ri)`
2578
+ `;import{Fragment as F3,jsx as pr,jsxs as B3}from"react/jsx-runtime";var H3=()=>{let{user:e,getAccessToken:t}=V(),r=Me(e),{walletProxy:o,refreshUser:n,closePrivyModal:i}=I(),a=R(),[l,s]=Su(!1),[d,u]=Su(null),[m,f]=Su(null);function y(){if(!l){if(m){a.data?.setWalletPassword?.onFailure(m),i();return}if(!d){a.data?.setWalletPassword?.onFailure(new Error("User exited set recovery flow")),i();return}}}a.onUserCloseViaDialogOrKeybindRef.current=y;async function b(){s(!0);try{let w=await t();if(!w||!o||!r)return;if(!(await o.setRecovery({recoveryMethod:"privy",address:r.address,accessToken:w})).address)throw new Error("Unable to set recovery on wallet");let k=await n();if(!k)throw new Error("Unable to set recovery on wallet");let T=Me(k);if(!T)throw new Error("Unabled to set recovery on wallet");u(!!k),setTimeout(()=>{a.data?.setWalletPassword?.onSuccess(T),i()},Le)}catch(w){f(w)}finally{s(!1)}}let C=!!(l||d);return m?B3(F3,{children:[pr(_,{onClose:y},"header"),pr(U3,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:pr(uT,{height:38,width:38,stroke:"var(--privy-color-error)"})}),pr(no,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),pr(hr,{style:{minHeight:"2rem"}}),pr(zo,{onClick:()=>f(null),children:"Try again"}),pr(B,{})]}):B3(F3,{children:[pr(_,{onClose:y},"header"),pr(mT,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),pr(no,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),pr(Fr,{style:{marginTop:"1rem"},children:"When you log into a new device, you\u2019ll only need to authenticate to access your account. Never get logged out if you forget your password."}),pr(hr,{style:{minHeight:"2rem"}}),pr(zo,{loading:l,disabled:C,onClick:()=>b(),children:d?"Success":"Confirm"}),pr(B,{})]})};import{useEffect as rS,useMemo as ku,useState as Hs}from"react";import{ProviderErrors as n0,QuantityToBigNumber as r0}from"@privy-io/js-sdk-core";import{EtherscanProvider as Hre}from"@ethersproject/providers";import{QuantityToBigNumber as fT}from"@privy-io/js-sdk-core";async function Md({accessToken:e,rootWallet:t,transactingWallet:r,walletProxy:o,transactionRequest:n,provider:i,requesterAppId:a}){n=Object.assign({chainId:Bo},n),hT(n);let s=(await o.rpc({address:t.address,hdWalletIndex:r.walletIndex??void 0,accessToken:e,requesterAppId:a,request:{method:"eth_signTransaction",params:[n]}})).response.data;return await i.sendTransaction(s)}async function Id(e,t,r,o){let n=await o.getBalance(e),i=t.value||0,l=!n.sub(fT(i)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function hT(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!yT(o))throw new Error(`Transaction request property '${r}' must be a valid number, bigint, or hex string representing a quantity`)}if(typeof e.chainId!="number")throw new Error("Transaction request property 'chainId' must be a number")}function yT(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&gT(e);return t||r||o}function gT(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Wd(e){return{to:e.to,from:e.from,contractAddress:e.contractAddress,transactionIndex:e.transactionIndex,root:e.root,logsBloom:e.logsBloom,blockHash:e.blockHash,transactionHash:e.transactionHash,logs:e.logs,blockNumber:e.blockNumber,confirmations:e.confirmations,byzantium:e.byzantium,type:e.type,status:e.status,gasUsed:e.gasUsed.toHexString(),cumulativeGasUsed:e.cumulativeGasUsed.toHexString(),effectiveGasPrice:e.effectiveGasPrice?e.effectiveGasPrice.toHexString():void 0}}function Ld(e){let r=new RegExp(/^eip155:(?<chainId>\d+)$/gm).exec(e)?.groups?.chainId;if(r)return parseInt(r);throw new Error("Chain ID not compatible with CAIP-2 format.")}var Au={[Ir.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[vm.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[ho.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[gm.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[Wr.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[Cm.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[Mr.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[hm.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[il.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[fm.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[Zr.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[mm.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"},V3=(e,t)=>e===Au[t.id];var Pu=({address:e,appConfig:t,fundWalletConfig:r,methodScreen:o,chainIdOverride:n,comingFromSendTransactionScreen:i=!1})=>{if(!t.fundingConfig||t.fundingConfig.methods.length===0)return;let a;n?a=n:Yc(r)&&r.chain?a=r.chain.id:a=Ld(t.fundingConfig.defaultRecommendedCurrency.chain);let l=t.chains.find(f=>f.id===a);if(!l)throw new v(`Funding chain ${a} is not in PrivyProvider chains list`);let s=Yc(r)&&r.amount?r.amount:t.fundingConfig.defaultRecommendedAmount,d,u=!1;function m(){if(!a)return;let f=Au[a];t.fundingConfig?.methods.includes("external")&&!f&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),d=f,u=!0}return Yc(r)&&"asset"in r?r.asset==="USDC"?m():typeof r.asset!="string"&&"erc20"in r.asset&&(d=r.asset.erc20,u=V3(d,l)):t.fundingConfig.defaultRecommendedCurrency.asset==="USDC"&&m(),{address:e,amount:s,chain:l,erc20Address:d,erc20ContractInfo:u?{symbol:"USDC",decimals:6}:void 0,isUSDC:u,methodScreen:o,comingFromSendTransactionScreen:i,...P1(r)?{moonpayConfigOverride:r.config}:{}}};var xu=["FUNDING_METHOD_SELECTION_SCREEN","FUNDING_TRANSFER_FROM_WALLET_SCREEN","FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN","FUNDING_MANUAL_TRANSFER_SCREEN","MOONPAY_PROMPT_SCREEN","MOONPAY_STATUS_SCREEN"],G3={["FUNDING_METHOD_SELECTION_SCREEN"]:null,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:"external",["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:"external",["FUNDING_MANUAL_TRANSFER_SCREEN"]:"manual",["MOONPAY_PROMPT_SCREEN"]:"moonpay",["MOONPAY_STATUS_SCREEN"]:"moonpay"},CT={moonpay:"MOONPAY_PROMPT_SCREEN","coinbase-onramp":"COINBASE_ONRAMP_STATUS_SCREEN",external:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};function Nd({fundingMethods:e}){if(e.length===0)throw new Error("Wallet funding is not enabled");return e.length===1?CT[e[0]]:"FUNDING_METHOD_SELECTION_SCREEN"}import q3 from"styled-components";import{Fragment as TT,jsx as Xe,jsxs as Lo}from"react/jsx-runtime";var z3=({img:e,submitError:t,prepareError:r,onClose:o,action:n,amount:i,title:a,subtitle:l,total:s,to:d,network:u,hasFunds:m,fee:f,from:y,cta:b,chain:C,isSubmitting:w,isPreparing:A,isTokenPriceLoading:k,isTokenContractInfoLoading:T,symbol:P,balance:S,onClick:M,spender:N})=>Lo(TT,{children:[Xe(_,{onClose:o}),e&&Xe(ET,{children:e}),Xe(no,{style:{marginTop:e?"1.5rem":0},children:a}),Xe(Fr,{children:l}),Lo(Lc,{style:{marginTop:"2rem"},children:[s&&Lo(It,{children:[Xe(Wt,{children:"Total"}),Xe(Ht,{$isLoading:A||k,children:s})]}),n&&n!=="transaction"&&Lo(It,{children:[Xe(Wt,{children:"Action"}),Xe(Ht,{children:n})]}),i?Lo(It,{children:[Xe(Wt,{children:"Amount"}),Lo(Ht,{$isLoading:T,children:[bT(i)," ",P]})]}):null,N?Lo(It,{children:[Xe(Wt,{children:"Spender"}),Xe(Ht,{children:Xe(Ho,{address:N,url:C?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,d&&Lo(It,{children:[Xe(Wt,{children:"To"}),Xe(Ht,{children:Xe(Ho,{address:d,url:C?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),Lo(It,{children:[Xe(Wt,{children:"Network"}),Xe(Ht,{children:u})]}),Lo(It,{children:[Xe(Wt,{children:"Estimated fee"}),Xe(Ht,{$isLoading:A||k,children:f})]})]}),Xe(hr,{}),t?Xe(Va,{style:{marginTop:"2rem"},children:t.message}):r?Xe(Va,{style:{marginTop:"2rem"},children:wT}):null,Xe(vT,{$useSmallMargins:!!(r||t),address:y,balance:S,isLoading:A||k,errMsg:!A&&!r&&!t&&!m?`Add funds on ${C?.name} to complete transaction.`:void 0}),Xe(zo,{style:{marginTop:"1rem"},loading:w,disabled:A,onClick:M,children:b}),Xe(B,{})]}),vT=q3(Oi)`
2586
2579
  ${e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;"}
2587
- `,hT="There was an error preparing your transaction. Your transaction request will likely fail.",yT=e=>e.toLocaleString(),gT=M3.div`
2580
+ `,wT="There was an error preparing your transaction. Your transaction request will likely fail.",bT=e=>e.toLocaleString(),ET=q3.div`
2588
2581
  display: flex;
2589
2582
  width: 100%;
2590
2583
  justify-content: center;
@@ -2594,12 +2587,12 @@ You will have to sign up with another method first to register a passkey for you
2594
2587
  object-fit: contain;
2595
2588
  border-radius: var(--privy-border-radius-sm);
2596
2589
  }
2597
- `;import wT from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import bT from"@heroicons/react/24/outline/ClipboardDocumentIcon";import ET from"@heroicons/react/24/outline/ExclamationCircleIcon";import{useState as TT}from"react";import xr from"styled-components";import{ErrorCode as Pd}from"@ethersproject/logger";var vT=new Set([Pd.CALL_EXCEPTION,Pd.NONCE_EXPIRED,Pd.REPLACEMENT_UNDERPRICED,Pd.TRANSACTION_REPLACED]),W3=e=>{let t;return e.code&&e.code!==-32e3&&vT.has(e.code)&&(t=e.transactionHash),t},L3=e=>e.code==="SERVER_ERROR"?e.error?.message??e.reason??e.message??"unknown error":e.error?.code==="SERVER_ERROR"?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error";import{Fragment as DT,jsx as Ut,jsxs as yi}from"react/jsx-runtime";var ST=e=>{let t=e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",r=W3(e),o=L3(e);return{errorCode:t,transactionHash:r,errorMessage:o}},AT=()=>yi(kT,{children:[Ut(MT,{}),Ut(_T,{})]}),U3=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=_(),[i,a]=TT(!1),{errorCode:l,transactionHash:s,errorMessage:d}=ST(e),m=n.find(f=>f.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return yi(DT,{children:[Ut(R,{onClose:r}),yi(PT,{children:[Ut(AT,{}),Ut(xT,{children:l}),Ut(RT,{children:"Please try again."}),yi(O3,{children:[Ut(N3,{children:"Error message"}),Ut(D3,{clickable:!1,children:d})]}),s&&yi(O3,{children:[Ut(N3,{children:"Transaction hash"}),yi(WT,{children:["Copy this hash to view details about the transaction on a"," ",Ut("u",{children:Ut("a",{href:m,children:"block explorer"})}),"."]}),yi(D3,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(s),a(!0)},children:[s,Ut(OT,{clicked:i})]})]}),Ut(IT,{onClick:()=>o({resetNonce:!!s}),children:"Retry transaction"})]}),Ut(J,{})]})},PT=xr.div`
2590
+ `;import AT from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import PT from"@heroicons/react/24/outline/ClipboardDocumentIcon";import xT from"@heroicons/react/24/outline/ExclamationCircleIcon";import{useState as RT}from"react";import Ar from"styled-components";import{ErrorCode as Od}from"@ethersproject/logger";var ST=new Set([Od.CALL_EXCEPTION,Od.NONCE_EXPIRED,Od.REPLACEMENT_UNDERPRICED,Od.TRANSACTION_REPLACED]),K3=e=>{let t;return e.code&&e.code!==-32e3&&ST.has(e.code)&&(t=e.transactionHash),t},Y3=e=>e.code==="SERVER_ERROR"?e.error?.message??e.reason??e.message??"unknown error":e.error?.code==="SERVER_ERROR"?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error";import{Fragment as VT,jsx as Ot,jsxs as Si}from"react/jsx-runtime";var kT=e=>{let t=e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",r=K3(e),o=Y3(e);return{errorCode:t,transactionHash:r,errorMessage:o}},_T=()=>Si(LT,{children:[Ot(OT,{}),Ot(NT,{})]}),J3=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=I(),[i,a]=RT(!1),{errorCode:l,transactionHash:s,errorMessage:d}=kT(e),u=n.find(m=>m.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return Si(VT,{children:[Ot(_,{onClose:r}),Si(MT,{children:[Ot(_T,{}),Ot(IT,{children:l}),Ot(WT,{children:"Please try again."}),Si(X3,{children:[Ot(Q3,{children:"Error message"}),Ot(Z3,{clickable:!1,children:d})]}),s&&Si(X3,{children:[Ot(Q3,{children:"Transaction hash"}),Si(UT,{children:["Copy this hash to view details about the transaction on a"," ",Ot("u",{children:Ot("a",{href:u,children:"block explorer"})}),"."]}),Si(Z3,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(s),a(!0)},children:[s,Ot(HT,{clicked:i})]})]}),Ot(DT,{onClick:()=>o({resetNonce:!!s}),children:"Retry transaction"})]}),Ot(J,{})]})},MT=Ar.div`
2598
2591
  display: flex;
2599
2592
  flex-direction: column;
2600
2593
  align-items: center;
2601
2594
  justify-content: center;
2602
- `,xT=xr.span`
2595
+ `,IT=Ar.span`
2603
2596
  color: var(--privy-color-foreground);
2604
2597
  text-align: center;
2605
2598
  font-size: 1.125rem;
@@ -2607,7 +2600,7 @@ You will have to sign up with another method first to register a passkey for you
2607
2600
  line-height: 1.25rem; /* 111.111% */
2608
2601
  text-align: center;
2609
2602
  margin: 10px;
2610
- `,RT=xr.span`
2603
+ `,WT=Ar.span`
2611
2604
  margin-top: 4px;
2612
2605
  margin-bottom: 10px;
2613
2606
  color: var(--privy-color-foreground-3);
@@ -2618,7 +2611,7 @@ You will have to sign up with another method first to register a passkey for you
2618
2611
  font-weight: 400;
2619
2612
  line-height: 20px; /* 142.857% */
2620
2613
  letter-spacing: -0.008px;
2621
- `,kT=xr.div`
2614
+ `,LT=Ar.div`
2622
2615
  position: relative;
2623
2616
  width: 60px;
2624
2617
  height: 60px;
@@ -2626,37 +2619,37 @@ You will have to sign up with another method first to register a passkey for you
2626
2619
  display: flex;
2627
2620
  justify-content: center;
2628
2621
  align-items: center;
2629
- `,_T=xr(ET)`
2622
+ `,NT=Ar(xT)`
2630
2623
  position: absolute;
2631
2624
  width: 35px;
2632
2625
  height: 35px;
2633
2626
  color: var(--privy-color-error);
2634
- `,MT=xr.div`
2627
+ `,OT=Ar.div`
2635
2628
  position: absolute;
2636
2629
  width: 60px;
2637
2630
  height: 60px;
2638
2631
  border-radius: 50%;
2639
2632
  background-color: var(--privy-color-error);
2640
2633
  opacity: 0.1;
2641
- `,IT=xr(U)`
2634
+ `,DT=Ar(F)`
2642
2635
  && {
2643
2636
  margin-top: 24px;
2644
2637
  }
2645
2638
  transition: color 350ms ease, background-color 350ms ease;
2646
- `,N3=xr.span`
2639
+ `,Q3=Ar.span`
2647
2640
  width: 100%;
2648
2641
  text-align: left;
2649
2642
  font-size: 0.825rem;
2650
2643
  color: var(--privy-color-foreground);
2651
2644
  padding: 4px;
2652
- `,O3=xr.div`
2645
+ `,X3=Ar.div`
2653
2646
  width: 100%;
2654
2647
  margin: 5px;
2655
2648
  display: flex;
2656
2649
  flex-direction: column;
2657
2650
  justify-content: center;
2658
2651
  align-items: center;
2659
- `,WT=xr.text`
2652
+ `,UT=Ar.text`
2660
2653
  position: relative;
2661
2654
  width: 100%;
2662
2655
  padding: 5px;
@@ -2664,7 +2657,7 @@ You will have to sign up with another method first to register a passkey for you
2664
2657
  color: var(--privy-color-foreground-3);
2665
2658
  text-align: left;
2666
2659
  word-wrap: break-word;
2667
- `,D3=xr.span`
2660
+ `,Z3=Ar.span`
2668
2661
  position: relative;
2669
2662
  width: 100%;
2670
2663
  background-color: var(--privy-color-background-2);
@@ -2682,24 +2675,31 @@ You will have to sign up with another method first to register a passkey for you
2682
2675
  &:hover {
2683
2676
  background-color: var(--privy-color-foreground-4);
2684
2677
  }`}
2685
- `,LT=xr(bT)`
2678
+ `,FT=Ar(PT)`
2686
2679
  position: absolute;
2687
2680
  top: 13px;
2688
2681
  right: 13px;
2689
2682
  width: 24px;
2690
2683
  height: 24px;
2691
- `,NT=xr(wT)`
2684
+ `,BT=Ar(AT)`
2692
2685
  position: absolute;
2693
2686
  top: 13px;
2694
2687
  right: 13px;
2695
2688
  width: 24px;
2696
2689
  height: 24px;
2697
- `,OT=({clicked:e})=>e?Ut(NT,{}):Ut(LT,{});import{BigNumber as yu}from"@ethersproject/bignumber";import UT from"styled-components";import{Fragment as HT,jsx as gi,jsxs as VT}from"react/jsx-runtime";var FT=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=yu.from(e.gasUsed),o=yu.from(e.effectiveGasPrice),n=r.mul(o);if(t){let i=yu.from(t);n=n.add(i)}return n.toString()}catch{return}else return},F3=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a,receiptHeader:l,receiptDescription:s})=>VT(HT,{children:[gi(R,{onClose:o}),gi(jn,{title:l??"Transaction complete!",description:s??"You're all set."}),gi(md,{tokenPrice:n,from:t.from,to:t.to,gas:FT(t,a),txn:e,transactionInfo:r,tokenSymbol:i}),gi(gr,{}),gi(BT,{loading:!1,onClick:o,children:"All Done"}),gi(ae,{}),gi(H,{})]}),BT=UT(U)`
2690
+ `,HT=({clicked:e})=>e?Ot(BT,{}):Ot(FT,{});import{BigNumber as Ru}from"@ethersproject/bignumber";import GT from"styled-components";import{Fragment as KT,jsx as Ai,jsxs as YT}from"react/jsx-runtime";var qT=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=Ru.from(e.gasUsed),o=Ru.from(e.effectiveGasPrice),n=r.mul(o);if(t){let i=Ru.from(t);n=n.add(i)}return n.toString()}catch{return}else return},j3=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a,receiptHeader:l,receiptDescription:s})=>YT(KT,{children:[Ai(_,{onClose:o}),Ai(ii,{title:l??"Transaction complete!",description:s??"You're all set."}),Ai(Ed,{tokenPrice:n,from:t.from,to:t.to,gas:qT(t,a),txn:e,transactionInfo:r,tokenSymbol:i}),Ai(hr,{}),Ai(zT,{loading:!1,onClick:o,children:"All Done"}),Ai(oe,{}),Ai(B,{})]}),zT=GT(F)`
2698
2691
  && {
2699
2692
  margin-top: 24px;
2700
2693
  }
2701
2694
  transition: color 350ms ease, background-color 350ms ease;
2702
- `;import{decodeFunctionData as B3}from"viem";var H3=e=>{let t=qT(e);if(t)return{action:"approve",isErc20Ish:!0,functionName:t.functionName,spender:t.args[0],amount:t.args[1]};let r=zT(e);return r?{action:"transfer",isErc20Ish:!0,functionName:r.functionName,amount:r.args[1]}:{action:"transaction",isErc20Ish:!1}},GT=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],qT=e=>{try{return B3({abi:GT,data:e})}catch{return null}},zT=e=>{try{return B3({abi:ps,data:e})}catch{return null}};import{BigNumber as KT}from"@ethersproject/bignumber";import{useEffect as YT,useState as QT}from"react";import{calculateTotalGasEstimate as XT,populateTransactionRequest as ZT}from"@privy-io/js-sdk-core";var V3=(e,t)=>{let[r,o]=QT(null),{getAccessToken:n,user:i}=V(),{walletProxy:a}=_(),l=Se(i),s=async()=>{if(!await n()||!a||!l)return null;let m=[],f=await ZT(l.address,e,t).catch(b=>(m.push(b),e)),{totalGasEstimate:u,l1ExecutionFeeEstimate:g}=await XT(f,t).catch(b=>(m.push(b),{totalGasEstimate:null,l1ExecutionFeeEstimate:null})),{balance:v,hasSufficientFunds:C}=await Td(l.address,f,u??KT.from(0),t).catch(b=>(m.push(b),{balance:null,hasSufficientFunds:!1}));return{tx:f,totalGasEstimate:u,l1ExecutionFeeEstimate:g,balance:v,hasFunds:C,errors:m}};return YT(()=>{r&&o(null),s().then(o)},[e]),r};import{jsx as Ds}from"react/jsx-runtime";var z3=new Tt(new Dr("There was an issue preparing your transaction",K3.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),Y3=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t,setModalData:r,navigate:o}=P(),{rpcConfig:n,chains:i,closePrivyModal:a,walletProxy:l}=_(),{getAccessToken:s,user:d}=V(),{wallets:m}=Jr(),f=Ve(),[u,g]=Os(e?.sendTransaction?.transactionRequest),[v,C]=Os(null),[b,A]=Os(!1),[k,S]=Os(null),[x,T]=Os(null);if(!u||!e?.sendTransaction)return Ds(ii,{error:new Error("Invalid transaction request"),onClick:()=>{e?.sendTransaction?.onFailure(z3),a({shouldCallAuthOnSuccess:!1})}});let M=xd(()=>u.from?m.find(ce=>G3(ce.address)===G3(u.from)):Se(d),[u.from]),D=xd(()=>i.find(ce=>Number(ce.id)===Number(u.chainId)),[u.chainId]),B=D?.nativeCurrency.symbol??"ETH",{action:K,amount:Q,spender:L,isErc20Ish:X}=xd(()=>H3(u.data),[u.data]);JT(()=>{u.to&&D&&X&&Dc({address:u.to,chain:D,rpcConfig:f.rpcConfig,privyAppId:f.id}).then(C).catch(console.error)},[u.to,D]);let{tokenPrice:I,isTokenPriceLoading:q}=ko(u),Le=xd(()=>Ir(Number(u.chainId),i,n,{appId:f.id}),[u.chainId,n]),oe=V3(u,Le),Y=()=>{if(!b)return k?(e?.sendTransaction?.onSuccess(k.response),a({shouldCallAuthOnSuccess:!1})):!x&&!oe?.errors[0]?(e?.sendTransaction?.onFailure(new Tt(new Dr("The user rejected the request",K3.E4001_USER_REJECTED_REQUEST.eipCode))),a({shouldCallAuthOnSuccess:!1})):(e?.sendTransaction?.onFailure(x??oe?.errors[0]??z3),a({shouldCallAuthOnSuccess:!1}))};t.current=Y;let ne=async()=>{A(!0);try{let ce=await s();if(b||!ce||!M||!l)return;let z=await Ed(ce,M.address,l,oe?.tx??u,Le,e.sendTransaction?.requesterAppId),ee=await z.wait();S({receipt:Sd(ee),response:z})}catch(ce){console.warn({transaction:oe?.tx??u,error:ce}),T(ce)}finally{A(!1)}},me=async()=>{if(!Se(d))return;if(!f.fundingConfig||f.fundingConfig.methods.length===0||!e.funding)throw new Error("Funding wallet is not enabled");let z=Ad({fundingMethods:f.fundingConfig?.methods});r({...e,funding:{...e?.funding,methodScreen:z}}),o(z)},be=f.embeddedWallets.priceDisplay.primary==="fiat-currency",ue=q3(oe?.tx.value??0).add(q3(oe?.totalGasEstimate?.toBigInt()??0)).toHexString(),Re=Et(ue,B),gt=be&&I?ho(ue,I):void 0,tt=Et(oe?.totalGasEstimate?.toString()??0,B),le=be&&I?ho(oe?.totalGasEstimate?.toString()??0,I):void 0,Jt=Et(oe?.balance?.toString()??0,B,void 0,!0),Do=be&&I?ho(oe?.balance?.toString()??0,I):void 0,rt=e.sendTransaction?.uiOptions?.transactionInfo?.title||(K==="approve"?"Confirm address":`Approve ${K}`),Fe=e.sendTransaction?.uiOptions?.description||`${f.name} wants your permission to approve the following transaction.`,ze=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?Ds("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,W=oe&&!oe.errors[0]&&!oe.hasFunds&&f.fundingConfig&&f.fundingConfig.methods.length>0,se=W?"Add funds":e.sendTransaction?.uiOptions?.buttonText||"Approve";return k?.receipt?Ds(F3,{txn:oe?.tx??u,onClose:Y,receipt:k.receipt,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,tokenPrice:I,tokenSymbol:B,l1GasEstimate:oe?.l1ExecutionFeeEstimate?.toString(),receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription}):x?Ds(U3,{transactionError:x,chainId:oe?.tx.chainId??u.chainId,onClose:Y,onRetry:({resetNonce:ce})=>{T(null);let z={...oe?.tx??u};ce&&(z.nonce=void 0),g(z)}}):Ds(I3,{isSubmitting:b,submitError:x,isPreparing:!oe,isTokenPriceLoading:q,isTokenContractInfoLoading:!v,prepareError:oe?.errors[0],symbol:v?.symbol,chain:D,img:ze,title:rt,subtitle:Fe,spender:L,total:u.value?gt??Re:void 0,fee:le??tt,to:u.to,network:f.chains.find(ce=>ce.id===u.chainId)?.name??"",from:M?.address??"",cta:se,hasFunds:oe?.hasFunds,action:K,balance:Do??Jt,amount:Q&&v?Pc({amount:Q,decimals:v.decimals}):Q,onClose:Y,onClick:W?me:ne})};import{isHexString as jT}from"@ethersproject/bytes";import{toUtf8String as $T}from"@ethersproject/strings";import{useEffect as Q3,useState as Us}from"react";import Pa from"styled-components";import{ProviderErrors as gu}from"@privy-io/js-sdk-core";import{Fragment as Z3,jsx as at,jsxs as Fs}from"react/jsx-runtime";var eS=e=>{if(!jT(e))return e;try{return $T(e)}catch{return e}},tS=e=>JSON.stringify(e,null,2),rS=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?at(nS,{children:Object.entries(r).map(([o,n])=>Fs("li",{children:[Fs("strong",{children:[o,":"]})," ",t(n)]},o))}):at("span",{children:String(r)});return at("div",{children:t(e)})},oS=e=>{let{types:t,primaryType:r,...o}=e.typedData;return Fs(Z3,{children:[at(Cu,{children:at(rS,{data:o})}),at(yn,{text:tS(e.typedData),itemName:"full payload to clipboard"})," "]})},X3=()=>{let{authenticated:e}=V(),{initializeWalletProxy:t,closePrivyModal:r}=_(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:i}=P(),[a,l]=Us(!0),[s,d]=Us(""),[m,f]=Us(),[u,g]=Us(null),[v,C]=Us(!1),b=u!==null;Q3(()=>{e||o("LANDING")},[e]),Q3(()=>{t(Si).then(K=>{l(!1),K||(d("An error has occurred, please try again."),f(new Tt(new Dr(s,gu.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:A,data:k,confirmAndSign:S,onSuccess:x,onFailure:T,uiOptions:M}=n.signMessage,D={title:M.title||"Sign message",description:M.description||"Signing this message will not cost you any fees.",buttonText:M.buttonText||"Sign and continue"},B=K=>{K?x(K):T(m||new Tt(new Dr("The user rejected the request.",gu.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{g(null),d(""),f(void 0)},200)};return i.current=()=>{B(u)},Fs(Z3,{children:[at(R,{onClose:()=>B(u)}),at(ie,{}),M.iconUrl&&typeof M.iconUrl=="string"?at(sS,{children:at($2,{size:"sm",src:M.iconUrl,alt:"app image"})}):null,at(io,{children:D.title}),at(Hr,{children:D.description}),A==="personal_sign"&&at(Cu,{children:eS(k)}),A==="eth_signTypedData_v4"&&at(oS,{typedData:k}),A==="solana_signMessage"&&at(Cu,{children:k}),at(lS,{}),at(iS,{fail:!0,children:s}),at(Vo,{disabled:v||b||a,loading:v,onClick:async()=>{C(!0),d("");try{let K=await S();g(K),C(!1),setTimeout(()=>{B(K)},Ne)}catch(K){console.error(K),d("An error has occurred, please try again."),f(new Tt(new Dr(s,gu.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),C(!1)}},children:v?"Signing...":b?Fs(aS,{children:[at(da,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",at("span",{children:"Success"})]}):D.buttonText}),at(ae,{}),at(H,{})]})},Cu=Pa.div`
2695
+ `;import{decodeFunctionData as $3}from"viem";var e0=e=>{let t=XT(e);if(t)return{action:"approve",isErc20Ish:!0,functionName:t.functionName,spender:t.args[0],amount:t.args[1]};let r=ZT(e);return r?{action:"transfer",isErc20Ish:!0,functionName:r.functionName,amount:r.args[1]}:{action:"transaction",isErc20Ish:!1}},QT=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],XT=e=>{try{return $3({abi:QT,data:e})}catch{return null}},ZT=e=>{try{return $3({abi:gs,data:e})}catch{return null}};import{BigNumber as JT}from"@ethersproject/bignumber";import{useEffect as jT,useState as $T}from"react";import{calculateTotalGasEstimate as eS,populateTransactionRequest as tS}from"@privy-io/js-sdk-core";var t0=(e,t,r)=>{let[o,n]=$T(null),{getAccessToken:i}=V(),{walletProxy:a}=I(),l=async()=>{if(!await i()||!a||!t)return null;let d=[],u=await tS(t.address,e,r).catch(C=>(d.push(C),e)),{totalGasEstimate:m,l1ExecutionFeeEstimate:f}=await eS(u,r).catch(C=>(d.push(C),{totalGasEstimate:null,l1ExecutionFeeEstimate:null})),{balance:y,hasSufficientFunds:b}=await Id(t.address,u,m??JT.from(0),r).catch(C=>(d.push(C),{balance:null,hasSufficientFunds:!1}));return{tx:u,totalGasEstimate:m,l1ExecutionFeeEstimate:f,balance:y,hasFunds:b,errors:d}};return jT(()=>{o&&n(null),l().then(n)},[e]),o};import{jsx as Vs}from"react/jsx-runtime";var o0=new Et(new Nr("There was an issue preparing your transaction",n0.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),i0=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t,setModalData:r,navigate:o}=R(),{rpcConfig:n,chains:i,closePrivyModal:a,walletProxy:l}=I(),{getAccessToken:s,user:d}=V(),u=Ne(),[m,f]=Hs(e?.sendTransaction?.transactionRequest),[y,b]=Hs(null),[C,w]=Hs(!1),[A,k]=Hs(null),[T,P]=Hs(null);if(!m||!e?.sendTransaction||!e?.sendTransaction.transactingWallet)return Vs(mi,{error:new Error("Invalid transaction request"),onClick:()=>{e?.sendTransaction?.onFailure(o0),a({shouldCallAuthOnSuccess:!1})}});let S=e.sendTransaction.rootWallet,M=e.sendTransaction.transactingWallet,N=ku(()=>i.find(Y=>Number(Y.id)===Number(m.chainId)),[m.chainId]),H=N?.nativeCurrency.symbol??"ETH",{action:x,amount:K,spender:W,isErc20Ish:Q}=ku(()=>e0(m.data),[m.data]);rS(()=>{m.to&&N&&Q&&zc({address:m.to,chain:N,rpcConfig:u.rpcConfig,privyAppId:u.id}).then(b).catch(console.error)},[m.to,N]);let{tokenPrice:pe,isTokenPriceLoading:q}=_o(m),ue=ku(()=>_r(Number(m.chainId),i,n,{appId:u.id}),[m.chainId,n]),Z=t0(m,M,ue),ae=()=>{if(!C)return A?(e?.sendTransaction?.onSuccess(A.response),a({shouldCallAuthOnSuccess:!1})):!T&&!Z?.errors[0]?(e?.sendTransaction?.onFailure(new Et(new Nr("The user rejected the request",n0.E4001_USER_REJECTED_REQUEST.eipCode))),a({shouldCallAuthOnSuccess:!1})):(e?.sendTransaction?.onFailure(T??Z?.errors[0]??o0),a({shouldCallAuthOnSuccess:!1}))};t.current=ae;let se=async()=>{w(!0);try{let Y=await s();if(C||!Y||!M||!l||!d)return;let j=await Md({accessToken:Y,transactingWallet:M,rootWallet:S,walletProxy:l,transactionRequest:Z?.tx??m,provider:ue,requesterAppId:e.sendTransaction?.requesterAppId}),Fe=await j.wait();k({receipt:Wd(Fe),response:j})}catch(Y){console.warn({transaction:Z?.tx??m,error:Y}),P(Y)}finally{w(!1)}},We=async()=>{if(!M)return;if(!u.fundingConfig||u.fundingConfig.methods.length===0||!e.funding)throw new Error("Funding wallet is not enabled");let Y=Nd({fundingMethods:u.fundingConfig?.methods});r({...e,funding:{...e?.funding,methodScreen:Y}}),o(Y)},Ee=u.embeddedWallets.priceDisplay.primary==="fiat-currency",ge=r0(Z?.tx.value??0).add(r0(Z?.totalGasEstimate?.toBigInt()??0)).toHexString(),le=wt(ge,H),Ze=Ee&&pe?yo(ge,pe):void 0,at=wt(Z?.totalGasEstimate?.toString()??0,H),ce=Ee&&pe?yo(Z?.totalGasEstimate?.toString()??0,pe):void 0,tt=wt(Z?.balance?.toString()??0,H,void 0,!0),Dt=Ee&&pe?yo(Z?.balance?.toString()??0,pe):void 0,Yr=e.sendTransaction?.uiOptions?.transactionInfo?.title||(x==="approve"?"Confirm address":`Approve ${x}`),L=e.sendTransaction?.uiOptions?.description||`${u.name} wants your permission to approve the following transaction.`,Re=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?Vs("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ze=Z&&!Z.errors[0]&&!Z.hasFunds&&u.fundingConfig&&u.fundingConfig.methods.length>0,U=ze?"Add funds":e.sendTransaction?.uiOptions?.buttonText||"Approve";return A?.receipt?Vs(j3,{txn:Z?.tx??m,onClose:ae,receipt:A.receipt,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,tokenPrice:pe,tokenSymbol:H,l1GasEstimate:Z?.l1ExecutionFeeEstimate?.toString(),receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription}):T?Vs(J3,{transactionError:T,chainId:Z?.tx.chainId??m.chainId,onClose:ae,onRetry:({resetNonce:Y})=>{P(null);let j={...Z?.tx??m};Y&&(j.nonce=void 0),f(j)}}):Vs(z3,{isSubmitting:C,submitError:T,isPreparing:!Z,isTokenPriceLoading:q,isTokenContractInfoLoading:!y,prepareError:Z?.errors[0],symbol:y?.symbol,chain:N,img:Re,title:Yr,subtitle:L,spender:W,total:m.value?Ze??le:void 0,fee:ce??at,to:m.to,network:u.chains.find(Y=>Y.id===m.chainId)?.name??"",from:M?.address??"",cta:U,hasFunds:Z?.hasFunds,action:x,balance:Dt??tt,amount:K&&y?Wc({amount:K,decimals:y.decimals}):K,onClose:ae,onClick:ze?We:se})};import{isHexString as nS}from"@ethersproject/bytes";import{toUtf8String as iS}from"@ethersproject/strings";import{useEffect as s0,useState as Gs}from"react";import Wa from"styled-components";import{ProviderErrors as _u}from"@privy-io/js-sdk-core";import oS from"styled-components";var a0=oS.img`
2696
+ && {
2697
+ height: ${e=>e.size==="sm"?"65px":"140px"};
2698
+ width: ${e=>e.size==="sm"?"65px":"140px"};
2699
+ border-radius: 16px;
2700
+ margin-bottom: 12px;
2701
+ }
2702
+ `;import{Fragment as c0,jsx as nt,jsxs as qs}from"react/jsx-runtime";var aS=e=>{if(!nS(e))return e;try{return iS(e)}catch{return e}},sS=e=>JSON.stringify(e,null,2),lS=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?nt(dS,{children:Object.entries(r).map(([o,n])=>qs("li",{children:[qs("strong",{children:[o,":"]})," ",t(n)]},o))}):nt("span",{children:String(r)});return nt("div",{children:t(e)})},cS=e=>{let{types:t,primaryType:r,...o}=e.typedData;return qs(c0,{children:[nt(Mu,{children:nt(lS,{data:o})}),nt(wn,{text:sS(e.typedData),itemName:"full payload to clipboard"})," "]})},l0=()=>{let{authenticated:e}=V(),{initializeWalletProxy:t,closePrivyModal:r}=I(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:i}=R(),[a,l]=Gs(!0),[s,d]=Gs(""),[u,m]=Gs(),[f,y]=Gs(null),[b,C]=Gs(!1),w=f!==null;s0(()=>{e||o("LANDING")},[e]),s0(()=>{t(Ii).then(x=>{l(!1),x||(d("An error has occurred, please try again."),m(new Et(new Nr(s,_u.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:A,data:k,confirmAndSign:T,onSuccess:P,onFailure:S,uiOptions:M}=n.signMessage,N={title:M.title||"Sign message",description:M.description||"Signing this message will not cost you any fees.",buttonText:M.buttonText||"Sign and continue"},H=x=>{x?P(x):S(u||new Et(new Nr("The user rejected the request.",_u.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{y(null),d(""),m(void 0)},200)};return i.current=()=>{H(f)},qs(c0,{children:[nt(_,{onClose:()=>H(f)}),nt(re,{}),M.iconUrl&&typeof M.iconUrl=="string"?nt(mS,{children:nt(a0,{size:"sm",src:M.iconUrl,alt:"app image"})}):null,nt(no,{children:N.title}),nt(Fr,{children:N.description}),A==="personal_sign"&&nt(Mu,{children:aS(k)}),A==="eth_signTypedData_v4"&&nt(cS,{typedData:k}),A==="solana_signMessage"&&nt(Mu,{children:k}),nt(fS,{}),nt(pS,{fail:!0,children:s}),nt(zo,{disabled:b||w||a,loading:b,onClick:async()=>{C(!0),d("");try{let x=await T();y(x),C(!1),setTimeout(()=>{H(x)},Le)}catch(x){console.error(x),d("An error has occurred, please try again."),m(new Et(new Nr(s,_u.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),C(!1)}},children:b?"Signing...":w?qs(uS,{children:[nt(ga,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",nt("span",{children:"Success"})]}):N.buttonText}),nt(oe,{}),nt(B,{})]})},Mu=Wa.div`
2703
2703
  margin-top: 1.5rem;
2704
2704
  background-color: var(--privy-color-background-2);
2705
2705
  border-radius: var(--privy-border-radius-md);
@@ -2718,7 +2718,7 @@ You will have to sign up with another method first to register a passkey for you
2718
2718
  display: none; /* Safari and Chrome */
2719
2719
  }
2720
2720
  }
2721
- `,nS=Pa.ul`
2721
+ `,dS=Wa.ul`
2722
2722
  margin-left: 12px !important;
2723
2723
  white-space: nowrap;
2724
2724
 
@@ -2730,7 +2730,7 @@ You will have to sign up with another method first to register a passkey for you
2730
2730
  font-weight: 500 !important;
2731
2731
  }
2732
2732
  }
2733
- `,iS=Pa.div`
2733
+ `,pS=Wa.div`
2734
2734
  line-height: 20px;
2735
2735
  height: 20px;
2736
2736
  font-size: 13px;
@@ -2740,20 +2740,20 @@ You will have to sign up with another method first to register a passkey for you
2740
2740
  width: 100%;
2741
2741
  margin-top: 16px;
2742
2742
  margin-bottom: 4px;
2743
- `,aS=Pa.span`
2743
+ `,uS=Wa.span`
2744
2744
  display: flex;
2745
2745
  align-items: center;
2746
2746
  gap: 8px;
2747
- `,sS=Pa.div`
2747
+ `,mS=Wa.div`
2748
2748
  display: flex;
2749
2749
  flex-direction: column;
2750
2750
  justify-content: center;
2751
2751
  align-items: center;
2752
2752
  width: 100%;
2753
2753
  height: 82px;
2754
- `,lS=Pa.div`
2754
+ `,fS=Wa.div`
2755
2755
  flex-grow: 1;
2756
- `;import{useEffect as J3,useState as j3}from"react";import cS from"styled-components";import{Fragment as pS,jsx as Lo,jsxs as Rd}from"react/jsx-runtime";var $3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=V(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=P(),{initLoginWithTelegram:s,loginWithTelegram:d,updateWallets:m,setReadyToTrue:f,closePrivyModal:u,createAnalyticsEvent:g}=_(),[v,C]=j3(!1),[b,A]=j3(void 0),k=Ne;async function S(){try{await d(),C(!0),f(!0)}catch(M){if(M?.privyErrorCode==="allowlist_rejected"){A(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(M?.privyErrorCode==="max_accounts_reached"){console.error(new mo(M).toString()),A(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(M?.privyErrorCode==="user_does_not_exist"){A(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:D,detail:B}=zd(M);A({retryable:D,detail:B,message:"Authentication failed"})}}J3(()=>{S()},[]),J3(()=>{if(!(r&&e&&v&&o))return;if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let B=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},k);return()=>clearTimeout(B)}if(Ht(o,n?.embeddedWallets?.createOnLogin)){let B=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:K=>{console.error(K),g({eventName:"embedded_wallet_creation_failure_logout",payload:{error:K,provider:"telegram",screen:"TelegramAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},k);return()=>clearTimeout(B)}m();let D=setTimeout(()=>u({shouldCallAuthOnSuccess:!0,isSuccess:!0}),k);return()=>clearTimeout(D)},[r,e,v,o]);let x=v?"Successfully connected with Telegram":b?b.message:"Verifying connection to Telegram",T="";return v?T="You\u2019re good to go!":b?T=b.detail:T="Just a few moments more",Rd(pS,{children:[Lo(R,{}),Lo(ie,{}),Rd(dS,{children:[Lo(nt,{children:Rd("div",{children:[Lo(ct,{success:v,fail:!!b}),Lo(ed,{style:{width:"38px",height:"38px"}})]})}),Rd(Ze,{children:[Lo("h3",{children:x}),Lo("p",{children:T})]}),b&&b?.retryable?Lo(an,{onClick:()=>{s().then(async()=>S()).catch(M=>{let{retryable:D,detail:B}=zd(M);A({retryable:D,detail:B,message:"Authentication failed"})}),A(void 0)},disabled:!v&&!b?.retryable,children:"Retry"}):null]}),Lo(ae,{}),Lo(J,{})]})},dS=cS.div`
2756
+ `;import{useEffect as d0,useState as p0}from"react";import hS from"styled-components";import{Fragment as gS,jsx as No,jsxs as Dd}from"react/jsx-runtime";var u0=()=>{let{authenticated:e,logout:t,ready:r,user:o}=V(),{app:n,setModalData:i,navigate:a,resetNavigation:l,data:s}=R(),{initLoginWithTelegram:d,loginWithTelegram:u,updateWallets:m,setReadyToTrue:f,closePrivyModal:y,createAnalyticsEvent:b}=I(),[C,w]=p0(!1),[A,k]=p0(void 0),T=Le;async function P(){try{await u(),w(!0),f(!0)}catch(N){if(N?.privyErrorCode==="allowlist_rejected"){k(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(N?.privyErrorCode==="max_accounts_reached"){console.error(new fo(N).toString()),k(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(N?.privyErrorCode==="user_does_not_exist"){k(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:H,detail:x}=ep(N);k({retryable:H,detail:x,message:"Authentication failed"})}}d0(()=>{P()},[]),d0(()=>{if(!(r&&e&&C&&o))return;if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let x=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},T);return()=>clearTimeout(x)}if(bt(o,n?.embeddedWallets?.createOnLogin)){let x=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:K=>{console.error(K),b({eventName:"embedded_wallet_creation_failure_logout",payload:{error:K,provider:"telegram",screen:"TelegramAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},T);return()=>clearTimeout(x)}m();let H=setTimeout(()=>y({shouldCallAuthOnSuccess:!0,isSuccess:!0}),T);return()=>clearTimeout(H)},[r,e,C,o]);let S=C?"Successfully connected with Telegram":A?A.message:"Verifying connection to Telegram",M="";return C?M="You\u2019re good to go!":A?M=A.detail:M="Just a few moments more",Dd(gS,{children:[No(_,{}),No(re,{}),Dd(yS,{children:[No(rt,{children:Dd("div",{children:[No(st,{success:C,fail:!!A}),No(cd,{style:{width:"38px",height:"38px"}})]})}),Dd(je,{children:[No("h3",{children:S}),No("p",{children:M})]}),A&&A?.retryable?No(dn,{onClick:()=>{d(void 0,s?.login?.disableSignup).then(async()=>P()).catch(N=>{let{retryable:H,detail:x}=ep(N);k({retryable:H,detail:x,message:"Authentication failed"})}),k(void 0)},disabled:!C&&!A?.retryable,children:"Retry"}):null]}),No(oe,{}),No(J,{})]})},yS=hS.div`
2757
2757
  display: flex;
2758
2758
  flex-direction: column;
2759
2759
  align-items: center;
@@ -2761,9 +2761,9 @@ You will have to sign up with another method first to register a passkey for you
2761
2761
  margin-left: 27px;
2762
2762
  margin-right: 27px;
2763
2763
  gap: 24px;
2764
- `;import gS from"@heroicons/react/24/outline/EnvelopeIcon";import uS from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as mS,useState as e0}from"react";import r0 from"styled-components";import{Fragment as yS,jsx as Bs,jsxs as t0}from"react/jsx-runtime";var o0=mS((e,t)=>{let[r,o]=e0(""),[n,i]=e0(!1),{authenticated:a,user:l}=V(),{initUpdateEmail:s}=_(),{navigate:d,setModalData:m,currentScreen:f}=P(),{enabled:u,token:g}=Pe(),v=Ys(r),C=n,b=n||!v,A=async S=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");i(!0);try{await s(l.email.address,r,S),d("AWAITING_PASSWORDLESS_CODE")}catch(x){m({errorModalData:{error:x,previousScreen:f||"LANDING"}})}i(!1)},k=()=>{u&&!g&&!a?(m({captchaModalData:{callback:S=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,r,S)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),d("CAPTCHA_SCREEN")):A(g)};return t0(yS,{children:[Bs(fS,{children:t0(hS,{children:[Bs(uS,{}),Bs("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:S=>o(S.target.value),onKeyUp:S=>{S.key==="Enter"&&k()},value:r,autoComplete:"email"}),e.stacked?null:Bs(qi,{isSubmitting:C,onClick:k,disabled:b,children:"Submit"})]})}),e.stacked?Bs(U,{loadingText:null,loading:C,disabled:b,onClick:k,children:"Submit"}):null]})}),fS=r0.div`
2764
+ `;import TS from"@heroicons/react/24/outline/EnvelopeIcon";import CS from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as vS,useState as m0}from"react";import h0 from"styled-components";import{Fragment as ES,jsx as zs,jsxs as f0}from"react/jsx-runtime";var y0=vS((e,t)=>{let[r,o]=m0(""),[n,i]=m0(!1),{authenticated:a,user:l}=V(),{initUpdateEmail:s}=I(),{navigate:d,setModalData:u,currentScreen:m}=R(),{enabled:f,token:y}=Te(),b=js(r),C=n,w=n||!b,A=async T=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");i(!0);try{await s(l.email.address,r,T),d("AWAITING_PASSWORDLESS_CODE")}catch(P){u({errorModalData:{error:P,previousScreen:m||"LANDING"}})}i(!1)},k=()=>{f&&!y&&!a?(u({captchaModalData:{callback:T=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,r,T)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),d("CAPTCHA_SCREEN")):A(y)};return f0(ES,{children:[zs(wS,{children:f0(bS,{children:[zs(CS,{}),zs("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:T=>o(T.target.value),onKeyUp:T=>{T.key==="Enter"&&k()},value:r,autoComplete:"email"}),e.stacked?null:zs(ji,{isSubmitting:C,onClick:k,disabled:w,children:"Submit"})]})}),e.stacked?zs(F,{loadingText:null,loading:C,disabled:w,onClick:k,children:"Submit"}):null]})}),wS=h0.div`
2765
2765
  width: 100%;
2766
- `,hS=r0.label`
2766
+ `,bS=h0.label`
2767
2767
  display: block;
2768
2768
  position: relative;
2769
2769
  width: 100%;
@@ -2821,7 +2821,7 @@ You will have to sign up with another method first to register a passkey for you
2821
2821
  && > input::placeholder {
2822
2822
  color: var(--privy-color-foreground-3);
2823
2823
  }
2824
- `;import{Fragment as CS,jsx as In,jsxs as vS}from"react/jsx-runtime";var n0=()=>vS(CS,{children:[In(R,{},"header"),In(ie,{}),In(ve,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:In(gS,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),In(cr,{children:In(o0,{stacked:!0})}),In(ae,{}),In(H,{})]});import wS from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as bS,jsx as Wn,jsxs as ES}from"react/jsx-runtime";var i0=()=>{let{currentScreen:e,data:t,navigate:r,setModalData:o}=P(),{user:n}=V(),{initUpdatePhone:i}=_();async function a({qualifiedPhoneNumber:l}){try{if(!n?.phone?.number)throw new Error("User is required to have an phone number to update it.");await i(n?.phone?.number,l),r("AWAITING_PASSWORDLESS_CODE")}catch(s){o({errorModalData:{error:s,previousScreen:t?.errorModalData?.previousScreen||e||"LINK_PHONE_SCREEN"}}),r("ERROR_SCREEN")}}return ES(bS,{children:[Wn(R,{},"header"),Wn(ie,{}),Wn(ve,{title:"Update your phone number",description:"Add the phone number you'd like to use going forward. We'll send you a confirmation code",icon:Wn(wS,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Wn(cr,{children:Wn(Tn,{stacked:!0,onSubmit:a,hideRecent:!0})}),Wn(ae,{}),Wn(H,{})]})};import wu from"styled-components";import{jsx as a0}from"react/jsx-runtime";var s0=({style:e,...t})=>a0("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...t,children:a0("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})});import{Fragment as PS,jsx as Ci,jsxs as vu}from"react/jsx-runtime";var l0=()=>{let{navigate:e}=P();return vu(PS,{children:[Ci(R,{}),vu(TS,{children:[Ci(SS,{children:Ci(s0,{})}),vu(AS,{children:[Ci("h3",{children:"Unable to sign in"}),Ci("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),Ci(U,{onClick:()=>{e("LANDING")},children:"Go back"})]}),Ci(H,{})]})},TS=wu.div`
2824
+ `;import{Fragment as SS,jsx as On,jsxs as AS}from"react/jsx-runtime";var g0=()=>AS(SS,{children:[On(_,{},"header"),On(re,{}),On(Ce,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:On(TS,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),On(sr,{children:On(y0,{stacked:!0})}),On(oe,{}),On(B,{})]});import PS from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as xS,jsx as Dn,jsxs as RS}from"react/jsx-runtime";var C0=()=>{let{currentScreen:e,data:t,navigate:r,setModalData:o}=R(),{user:n}=V(),{initUpdatePhone:i}=I();async function a({qualifiedPhoneNumber:l}){try{if(!n?.phone?.number)throw new Error("User is required to have an phone number to update it.");await i(n?.phone?.number,l),r("AWAITING_PASSWORDLESS_CODE")}catch(s){o({errorModalData:{error:s,previousScreen:t?.errorModalData?.previousScreen||e||"LINK_PHONE_SCREEN"}}),r("ERROR_SCREEN")}}return RS(xS,{children:[Dn(_,{},"header"),Dn(re,{}),Dn(Ce,{title:"Update your phone number",description:"Add the phone number you'd like to use going forward. We'll send you a confirmation code",icon:Dn(PS,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Dn(sr,{children:Dn(xn,{stacked:!0,onSubmit:a,hideRecent:!0})}),Dn(oe,{}),Dn(B,{})]})};import Wu from"styled-components";import{jsx as v0}from"react/jsx-runtime";var w0=({style:e,...t})=>v0("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...t,children:v0("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})});import{Fragment as IS,jsx as Pi,jsxs as Iu}from"react/jsx-runtime";var b0=()=>{let{navigate:e}=R();return Iu(IS,{children:[Pi(_,{}),Iu(kS,{children:[Pi(_S,{children:Pi(w0,{})}),Iu(MS,{children:[Pi("h3",{children:"Unable to sign in"}),Pi("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),Pi(F,{onClick:()=>{e("LANDING")},children:"Go back"})]}),Pi(B,{})]})},kS=Wu.div`
2825
2825
  display: flex;
2826
2826
  flex-direction: column;
2827
2827
  align-items: center;
@@ -2830,7 +2830,7 @@ You will have to sign up with another method first to register a passkey for you
2830
2830
  width: 100%;
2831
2831
  padding-top: 8px;
2832
2832
  padding-bottom: 32px;
2833
- `,SS=wu.div`
2833
+ `,_S=Wu.div`
2834
2834
  display: flex;
2835
2835
  align-items: center;
2836
2836
  justify-content: center;
@@ -2839,11 +2839,11 @@ You will have to sign up with another method first to register a passkey for you
2839
2839
  color: var(--privy-color-error);
2840
2840
  background-color: var(--privy-color-error-light);
2841
2841
  border-radius: 50%;
2842
- `,AS=wu.div`
2842
+ `,MS=Wu.div`
2843
2843
  display: flex;
2844
2844
  flex-direction: column;
2845
2845
  gap: 8px;
2846
- `;import RS,{createGlobalStyle as kS}from"styled-components";var xS=`
2846
+ `;import LS,{createGlobalStyle as NS}from"styled-components";var WS=`
2847
2847
  *,
2848
2848
  ::before,
2849
2849
  ::after {
@@ -3073,7 +3073,7 @@ You will have to sign up with another method first to register a passkey for you
3073
3073
  [hidden] {
3074
3074
  display: none;
3075
3075
  }
3076
- `,c0=xS;var d0=kS`
3076
+ `,E0=WS;var T0=NS`
3077
3077
  :root {
3078
3078
  // Borders
3079
3079
  --privy-border-radius-sm: 6px;
@@ -3108,10 +3108,10 @@ You will have to sign up with another method first to register a passkey for you
3108
3108
  --privy-height-modal-full: 620px;
3109
3109
  --privy-height-modal-compact: 480px;
3110
3110
  };
3111
- `,bu=RS.div`
3111
+ `,Lu=LS.div`
3112
3112
  // css normalize only the privy application to avoid conflicts
3113
3113
  // with consuming application
3114
- ${c0}
3114
+ ${E0}
3115
3115
 
3116
3116
  // Privy styles
3117
3117
  color: var(--privy-color-foreground-2);
@@ -3162,7 +3162,7 @@ You will have to sign up with another method first to register a passkey for you
3162
3162
  opacity: 1;
3163
3163
  }
3164
3164
  }
3165
- `;import{Dialog as p0,Transition as Eu}from"@headlessui/react";import Tu from"react";import Hs from"styled-components";import{jsx as xa,jsxs as LS}from"react/jsx-runtime";var u0=({children:e,open:t,onClick:r,...o})=>xa(Eu,{show:t,as:Tu.Fragment,children:LS(p0,{onClose:r,...o,as:MS,children:[xa(Eu.Child,{as:Tu.Fragment,enterFrom:"entering",leaveTo:"leaving",children:xa(_S,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),xa(IS,{children:xa(Eu.Child,{as:Tu.Fragment,enterFrom:"entering",leaveTo:"leaving",children:xa(p0.Panel,{as:WS,children:e})})})]})}),_S=Hs.div`
3165
+ `;import{Dialog as S0,Transition as Nu}from"@headlessui/react";import Ou from"react";import Ks from"styled-components";import{jsx as La,jsxs as BS}from"react/jsx-runtime";var A0=({children:e,open:t,onClick:r,...o})=>La(Nu,{show:t,as:Ou.Fragment,children:BS(S0,{onClose:r,...o,as:DS,children:[La(Nu.Child,{as:Ou.Fragment,enterFrom:"entering",leaveTo:"leaving",children:La(OS,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),La(US,{children:La(Nu.Child,{as:Ou.Fragment,enterFrom:"entering",leaveTo:"leaving",children:La(S0.Panel,{as:FS,children:e})})})]})}),OS=Ks.div`
3166
3166
  position: fixed;
3167
3167
  inset: 0;
3168
3168
 
@@ -3175,10 +3175,10 @@ You will have to sign up with another method first to register a passkey for you
3175
3175
  backdrop-filter: unset;
3176
3176
  -webkit-backdrop-filter: unset;
3177
3177
  }
3178
- `,MS=Hs.div`
3178
+ `,DS=Ks.div`
3179
3179
  position: relative;
3180
3180
  z-index: 999999;
3181
- `,IS=Hs.div`
3181
+ `,US=Ks.div`
3182
3182
  position: fixed;
3183
3183
  inset: 0;
3184
3184
  display: flex;
@@ -3186,7 +3186,7 @@ You will have to sign up with another method first to register a passkey for you
3186
3186
  justify-content: center;
3187
3187
  width: 100vw;
3188
3188
  min-height: 100vh;
3189
- `,WS=Hs.div`
3189
+ `,FS=Ks.div`
3190
3190
  // reset some default dialog styles
3191
3191
  padding: 0;
3192
3192
  background: transparent;
@@ -3233,13 +3233,13 @@ You will have to sign up with another method first to register a passkey for you
3233
3233
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
3234
3234
  border-radius: var(--privy-border-radius-lg);
3235
3235
  }
3236
- `,m0=Hs.div`
3236
+ `,P0=Ks.div`
3237
3237
  display: flex;
3238
3238
  flex-direction: column;
3239
3239
  align-items: center;
3240
3240
  justify-content: center;
3241
3241
  height: 100%;
3242
- `;import{Fragment as h0,jsx as ut,jsxs as y0}from"react/jsx-runtime";var US={["LANDING"]:p2,["CONNECT_OR_CREATE"]:c2,["AWAITING_PASSWORDLESS_CODE"]:Eh,["AWAITING_CONNECTION"]:zh,["AWAITING_CONNECT_ONLY_CONNECTION"]:Qh,["AWAITING_FARCASTER_CONNECTION"]:$y,["AWAITING_FARCASTER_SIGNER"]:ig,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:c3,["PHANTOM_INTERSTITIAL_SCREEN"]:m3,["LOGIN_FAILED_SCREEN"]:C2,["AWAITING_OAUTH_SCREEN"]:a3,["CROSS_APP_AUTH_SCREEN"]:jh,["ALLOWLIST_REJECTION_SCREEN"]:mh,["ACCOUNT_NOT_FOUND_SCREEN"]:sh,["USER_LIMIT_REACHED_SCREEN"]:l0,["INSTALL_PHANTOM_SCREEN"]:U1,["LINK_EMAIL_SCREEN"]:u2,["LINK_PHONE_SCREEN"]:m2,["LINK_WALLET_SCREEN"]:f2,["LINK_PASSKEY_SCREEN"]:Fg,["UPDATE_EMAIL_SCREEN"]:n0,["UPDATE_PHONE_SCREEN"]:i0,["CONNECT_ONLY_LANDING_SCREEN"]:Bh,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Fh,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:my,["EMBEDDED_WALLET_CREATED_SCREEN"]:ay,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:ny,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:f3,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:A3,["EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN"]:k3,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:E3,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:dy,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:X3,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:Y3,["FUNDING_METHOD_SELECTION_SCREEN"]:b1,["MOONPAY_PROMPT_SCREEN"]:x1,["MOONPAY_STATUS_SCREEN"]:k1,["COINBASE_ONRAMP_STATUS_SCREEN"]:s1,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:I1,["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:jg,["FUNDING_MANUAL_TRANSFER_SCREEN"]:E1,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:Fy,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:Uy,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:S3,["MFA_ENROLLMENT_FLOW_SCREEN"]:I2,["CAPTCHA_SCREEN"]:Ph,["ERROR_SCREEN"]:Hy,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:W1,["AFFIRMATIVE_CONSENT_SCREEN"]:dh,["TELEGRAM_AUTH_SCREEN"]:$3},FS=["LANDING","AWAITING_CONNECTION"],C0=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=V(),{headless:n}=Ve(),{ready:i,currentScreen:a}=P(),{status:l,execute:s,reset:d,enabled:m}=Pe(),f=o&&a&&FS.includes(a)&&!n&&l==="ready";if(f0(()=>{f&&s()},[f]),f0(()=>{!o&&m&&d()},[o,m]),(!r||!i)&&a!=="AWAITING_OAUTH_SCREEN"&&a!=="CROSS_APP_AUTH_SCREEN"&&a!=="TELEGRAM_AUTH_SCREEN")return y0(h0,{children:[ut(R,{}),ut(ie,{}),ut(m0,{children:ut(dt,{})}),ut(ae,{}),ut(J,{})]});if(!a&&e)return ut(cu,{open:e,onClose:t});if(!a)return null;let u=US[a];return y0(h0,{children:[ut(to,{if:!!e,children:ut(u,{})}),ut(to,{if:!e,children:ut(cu,{open:e,onClose:t})})]})},BS=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=OS(null),o=mm(r);return ut(VS,{style:{height:o},id:"privy-modal-content",children:ut("div",{ref:r,children:ut(C0,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},HS=()=>{let{closePrivyModal:e}=_(),{onUserCloseViaDialogOrKeybindRef:t}=P();return{gracefulClosePrivyModal:NS(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},Su=({open:e})=>{let{app:t}=P(),{gracefulClosePrivyModal:r}=HS(),[o,n]=DS(!1);jd({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=e||o;return t.render.standalone?ut(bu,{children:ut(v0,{id:"privy-modal-content",children:ut(C0,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})}):ut(u0,{open:i,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:ut(bu,{children:ut(BS,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})})},v0=g0.div`
3242
+ `;import{Fragment as R0,jsx as dt,jsxs as k0}from"react/jsx-runtime";var qS={["LANDING"]:T2,["CONNECT_OR_CREATE"]:b2,["AWAITING_PASSWORDLESS_CODE"]:Lh,["AWAITING_CONNECTION"]:ny,["AWAITING_CONNECT_ONLY_CONNECTION"]:sy,["AWAITING_FARCASTER_CONNECTION"]:ug,["AWAITING_FARCASTER_SIGNER"]:Cg,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:b3,["PHANTOM_INTERSTITIAL_SCREEN"]:A3,["LOGIN_FAILED_SCREEN"]:M2,["AWAITING_OAUTH_SCREEN"]:C3,["CROSS_APP_AUTH_SCREEN"]:py,["ALLOWLIST_REJECTION_SCREEN"]:Ah,["ACCOUNT_NOT_FOUND_SCREEN"]:vh,["USER_LIMIT_REACHED_SCREEN"]:b0,["INSTALL_PHANTOM_SCREEN"]:Z1,["LINK_EMAIL_SCREEN"]:S2,["LINK_PHONE_SCREEN"]:A2,["LINK_WALLET_SCREEN"]:x2,["LINK_PASSKEY_SCREEN"]:jg,["UPDATE_EMAIL_SCREEN"]:g0,["UPDATE_PHONE_SCREEN"]:C0,["CONNECT_ONLY_LANDING_SCREEN"]:$h,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Jh,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:Py,["EMBEDDED_WALLET_CREATED_SCREEN"]:vy,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:gy,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:P3,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:D3,["EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN"]:H3,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:L3,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Ty,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:l0,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:i0,["FUNDING_METHOD_SELECTION_SCREEN"]:W1,["MOONPAY_PROMPT_SCREEN"]:F1,["MOONPAY_STATUS_SCREEN"]:H1,["COINBASE_ONRAMP_STATUS_SCREEN"]:w1,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:q1,["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:p1,["FUNDING_MANUAL_TRANSFER_SCREEN"]:L1,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:jy,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:Jy,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:O3,["MFA_ENROLLMENT_FLOW_SCREEN"]:z2,["CAPTCHA_SCREEN"]:Uh,["ERROR_SCREEN"]:eg,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:z1,["AFFIRMATIVE_CONSENT_SCREEN"]:Eh,["TELEGRAM_AUTH_SCREEN"]:u0},zS=["LANDING","AWAITING_CONNECTION"],M0=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=V(),{headless:n}=Ne(),{ready:i,currentScreen:a}=R(),{status:l,execute:s,reset:d,enabled:u}=Te(),m=o&&a&&zS.includes(a)&&!n&&l==="ready";if(x0(()=>{m&&s()},[m]),x0(()=>{!o&&u&&d()},[o,u]),(!r||!i)&&a!=="AWAITING_OAUTH_SCREEN"&&a!=="CROSS_APP_AUTH_SCREEN"&&a!=="TELEGRAM_AUTH_SCREEN")return k0(R0,{children:[dt(_,{}),dt(re,{}),dt(P0,{children:dt(lt,{})}),dt(oe,{}),dt(J,{})]});if(!a&&e)return dt(vu,{open:e,onClose:t});if(!a)return null;let f=qS[a];return k0(R0,{children:[dt(eo,{if:!!e,children:dt(f,{})}),dt(eo,{if:!e,children:dt(vu,{open:e,onClose:t})})]})},KS=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=VS(null),o=Am(r);return dt(QS,{style:{height:o},id:"privy-modal-content",children:dt("div",{ref:r,children:dt(M0,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},YS=()=>{let{closePrivyModal:e}=I(),{onUserCloseViaDialogOrKeybindRef:t}=R();return{gracefulClosePrivyModal:HS(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},Du=({open:e})=>{let{app:t}=R(),{gracefulClosePrivyModal:r}=YS(),[o,n]=GS(!1);lp({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=e||o;return t.render.standalone?dt(Lu,{children:dt(I0,{id:"privy-modal-content",children:dt(M0,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})}):dt(A0,{open:i,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:dt(Lu,{children:dt(KS,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})})},I0=_0.div`
3243
3243
  display: flex;
3244
3244
  flex-direction: column;
3245
3245
  text-align: center;
@@ -3248,7 +3248,7 @@ You will have to sign up with another method first to register a passkey for you
3248
3248
  width: 100%;
3249
3249
  background: var(--privy-color-background);
3250
3250
  padding: 0 16px;
3251
- `,VS=g0(v0)`
3251
+ `,QS=_0(I0)`
3252
3252
  transition: height 150ms ease-out;
3253
3253
  overflow: hidden;
3254
3254
 
@@ -3262,4 +3262,4 @@ You will have to sign up with another method first to register a passkey for you
3262
3262
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
3263
3263
  border-radius: var(--privy-border-radius-lg);
3264
3264
  }
3265
- `;import{useRef as w0,useEffect as GS}from"react";import{jsx as zS}from"react/jsx-runtime";function qS({botUsername:e,scriptHost:t}){let r=document.createElement("script"),{origin:o}=new URL(t);return r.async=!0,r.src=`${o}/js/telegram-login.js`,r.setAttribute("data-telegram-login",e),r.setAttribute("data-request-access","write"),r.setAttribute("data-lang","en"),r}function b0(e){let t=w0(null),r=w0();return GS(()=>{r.current?.remove(),r.current=qS(e),t.current?.after(r.current)},[e]),zS("div",{ref:t,hidden:!0})}import{useState as KS}from"react";import{useEffect as E0,useRef as T0}from"react";var kd=class{constructor(){this.callbacks={}}enqueue(t,r){this.callbacks[t]=r}dequeue(t,r){let o=this.callbacks[r];if(!o)throw new Error(`cannot dequeue ${t} event: no event found for id ${r}`);switch(delete this.callbacks[r],t){case"privy:iframe:ready":return o;case"privy:wallet:create":return o;case"privy:wallet:create-additional":return o;case"privy:wallet:import":return o;case"privy:wallet:connect":return o;case"privy:wallet:recover":return o;case"privy:wallet:rpc":return o;case"privy:wallet:set-recovery":return o;case"privy:mfa:verify":return o;case"privy:mfa:init-enrollment":return o;case"privy:mfa:submit-enrollment":return o;case"privy:mfa:unenroll":return o;case"privy:mfa:clear":return o;case"privy:farcaster:init-signer":return o;case"privy:farcaster:sign":return o;case"privy:solana-wallet:create":return o;case"privy:solana-wallet:connect":return o;case"privy:solana-wallet:recover":return o;case"privy:solana-wallet:rpc":return o;default:throw new Error(`invalid wallet event type ${t}`)}}};async function Ln(e,t,r,o,n,i=!1){let a=i,l=async m=>{if(a&&t&&t.length>0){m===(i?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new De("missing_or_invalid_mfa","MFA verification failed, retry."));let f=await new Promise((u,g)=>{r.current={resolve:u,reject:g};let v=1e3*60*5;setTimeout(()=>{let C=new De("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(C),g(C)},v)});return await e(f)}return await e()},s=4,d=null;for(let m=0;m<s;m++)try{d=await l(m),o.current?.resolve(void 0);break}catch(f){if(f.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),f}if(d===null){let m=new De("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(m),m}return d}import{jsx as jS}from"react/jsx-runtime";var YS=function(e){return()=>`id-${e++}`}(0);function QS(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function ht(e){return e.error!==void 0}var mt=new kd,Au=new Map,XS=(e,t)=>typeof t=="bigint"?t.toString():t,ZS=(e,t)=>`${e}${JSON.stringify(t,XS)}`;function yt(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=ZS(e,t);if(e==="privy:wallet:create"){let l=Au.get(i);if(l)return l}let a=new Promise((l,s)=>{let d=YS();mt.enqueue(d,{resolve:l,reject:s}),n.postMessage({id:d,event:e,data:t},o)}).finally(()=>{Au.delete(i)});return Au.set(i,a),a}function JS(e){switch(e.event){case"privy:iframe:ready":let t=mt.dequeue(e.event,e.id);return ht(e)?t.reject(new De(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=mt.dequeue(e.event,e.id);return ht(e)?r.reject(new De(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:create-additional":let o=mt.dequeue(e.event,e.id);return ht(e)?o.reject(new De(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:import":let n=mt.dequeue(e.event,e.id);return ht(e)?n.reject(new De(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:connect":let i=mt.dequeue(e.event,e.id);return ht(e)?i.reject(new De(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:recover":let a=mt.dequeue(e.event,e.id);return ht(e)?a.reject(new De(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:rpc":let l=mt.dequeue(e.event,e.id);return ht(e)?l.reject(new De(e.error.type,e.error.message)):l.resolve(e.data);case"privy:wallet:set-recovery":let s=mt.dequeue(e.event,e.id);return ht(e)?s.reject(new De(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:verify":let d=mt.dequeue(e.event,e.id);return ht(e)?d.reject(new De(e.error.type,e.error.message)):d.resolve(e.data);case"privy:mfa:init-enrollment":{let g=mt.dequeue(e.event,e.id);return ht(e)?g.reject(new De(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:mfa:submit-enrollment":{let g=mt.dequeue(e.event,e.id);return ht(e)?g.reject(new De(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:mfa:unenroll":{let g=mt.dequeue(e.event,e.id);return ht(e)?g.reject(new De(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:mfa:clear":{let g=mt.dequeue(e.event,e.id);return ht(e)?g.reject(new De(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:farcaster:init-signer":{let g=mt.dequeue(e.event,e.id);return ht(e)?g.reject(new De(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:farcaster:sign":{let g=mt.dequeue(e.event,e.id);return ht(e)?g.reject(new De(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:solana-wallet:create":let m=mt.dequeue(e.event,e.id);return ht(e)?m.reject(new De(e.error.type,e.error.message)):m.resolve(e.data);case"privy:solana-wallet:connect":let f=mt.dequeue(e.event,e.id);return ht(e)?f.reject(new De(e.error.type,e.error.message)):f.resolve(e.data);case"privy:solana-wallet:recover":let u=mt.dequeue(e.event,e.id);return ht(e)?u.reject(new De(e.error.type,e.error.message)):u.resolve(e.data);case"privy:solana-wallet:rpc":{let g=mt.dequeue(e.event,e.id);return ht(e)?g.reject(new De(e.error.type,e.error.message)):g.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function S0(e){let t=T0(null),r=T0(e.mfaMethods),o=Pi(),[n,i]=KS(!1);return E0(()=>{r.current=e.mfaMethods},[e.mfaMethods]),E0(()=>{if(!n)return;let a=t.current;if(!a)return;function l(u){u&&u.origin===e.origin&&QS(u.data)&&JS(u.data)}let s={create(u){return yt("privy:wallet:create",u,a,e.origin)},createAdditional(u){return yt("privy:wallet:create-additional",u,a,e.origin)},import(u){return yt("privy:wallet:import",u,a,e.origin)},connect(u){return yt("privy:wallet:connect",u,a,e.origin)},recover(u){return Ln(g=>yt("privy:wallet:recover",{...u,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!u.recoveryMethod||u.recoveryMethod==="privy")},rpc(u){return Ln(g=>yt("privy:wallet:rpc",{...u,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(u){return yt("privy:solana-wallet:create",u,a,e.origin)},connectSolana(u){return yt("privy:solana-wallet:connect",u,a,e.origin)},recoverSolana(u){return yt("privy:solana-wallet:recover",u,a,e.origin)},rpcSolana(u){return yt("privy:solana-wallet:rpc",u,a,e.origin)},setRecovery(u){return Ln(g=>yt("privy:wallet:set-recovery",{...u,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(u){return Ln(g=>yt("privy:mfa:verify",{...u,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(u){return Ln(g=>yt("privy:mfa:init-enrollment",{...u,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(u){return Ln(g=>yt("privy:mfa:submit-enrollment",{...u,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(u){return Ln(g=>yt("privy:mfa:unenroll",{...u,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(u){return yt("privy:mfa:clear",u,a,e.origin)},initFarcasterSigner(u){return yt("privy:farcaster:init-signer",u,a,e.origin)},signFarcasterMessage(u){return yt("privy:farcaster:sign",u,a,e.origin)}};window.addEventListener("message",l);let d=()=>e.onLoad(s),m=(...u)=>{console.warn("Privy iframe failed to load: ",...u),e.onLoadFailed()},f=new AbortController;return _a(()=>yt("privy:iframe:ready",{},a,e.origin),{abortSignal:f.signal}).then(d,m),()=>{window.removeEventListener("message",l),f.abort()}},[n]),jS("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:Qs(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var _d=class{constructor(t,r){this.walletProxy=t,this.address=r}async handleSignMessage(t){if(!t.params||typeof t.params.message!="string")throw new Error("Message must be provided as a string for Solana signMessage RPC");return await P0({message:t.params.message})}async request(t){if(console.debug("EmbeddedSolanaProvider.request() called with args",t),!await Ae())throw new Error("User must be authenticated to use embedded Solana wallet");if(!await A0())throw new w("Unable to connect to Solana embedded wallet");switch(t.method){case"signMessage":return await this.handleSignMessage(t);default:throw new Error("Embedded Solana provider does not yet support this RPC method.")}}};function x0(e){let r=new RegExp(/^eip155:(?<chainId>\d+)$/gm).exec(e)?.groups?.chainId;if(r)return parseInt(r);throw new Error("Chain ID not compatible with CAIP-2 format.")}async function R0({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{let a=setTimeout(()=>{n(new w("Authorization request timed out after 2 minutes.")),l()},12e4);function l(){t?.close(),window.removeEventListener("message",m)}let s,d=setInterval(()=>{t?.closed&&!s&&(l(),clearInterval(d),clearTimeout(a),n(new w("User rejected request")))},300);function m(f){f.data&&(f.data.type==="PRIVY_OAUTH_RESPONSE"&&f.data.stateCode&&f.data.authorizationCode&&(clearTimeout(a),o(f.data),l()),f.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(a),n(new w(f.data.error)),l()),f.data.type==="PRIVY_OAUTH_USE_BROADCAST_CHANNEL"&&(s=new BroadcastChannel("popup-privy-oauth"),s.onmessage=m))}window.addEventListener("message",m)})}var Pu={[Lr.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[sm.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[fo.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[im.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[Nr.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[am.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[Wr.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[om.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[el.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[rm.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[Zr.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[tm.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"},k0=(e,t)=>e===Pu[t.id];var $S="https://cdn.apple-cloudkit.com";async function xu({url:e,popup:t,provider:r}){return t.location=e,new Promise((n,i)=>{function a(){t?.close(),window.removeEventListener("message",l)}function l(s){s.data&&(s.data.type==="PRIVY_OAUTH_RESPONSE"&&s.data.stateCode&&s.data.authorizationCode&&(n(s.data),a()),s.origin===$S&&s.data.ckSession&&(n({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:s.data.ckSession}),a()),s.data.type==="PRIVY_OAUTH_ERROR"&&(i(s.data.error),a()))}window.addEventListener("message",l)})}var _0=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});import{jsx as Rr,jsxs as M0}from"react/jsx-runtime";var Oo;function aA(e){return typeof e=="string"&&e.length===25}function Ae(){if(!Oo){let e=j.get(Un);return Promise.resolve(e||null)}return Oo.getAccessToken()}var I0,Nf=(e,t,r)=>I0(e,t,r),W0,Of=(e,t)=>W0(e,t),L0,Df=(e,t)=>L0(e,t),N0,Uf=()=>N0(),O0,A0=()=>O0(),D0,P0=({message:e})=>D0({message:e}),sA=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;j.put(Ia,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},lA=({config:e,...t})=>{if(typeof window<"u"&&["localhost","127.0.0.1"].indexOf(window.location.hostname)<0&&window.location.protocol!=="https:")throw new w("Embedded wallet is only available over HTTPS");if(!aA(t.appId))throw new w("Cannot initialize the Privy provider with an invalid Privy app ID");Oo||(Oo=new Ya({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl}));let r=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&r.embeddedWallets?.createOnLogin===void 0&&(r.embeddedWallets||(r.embeddedWallets={}),r.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),Rr(pm,{client:Oo,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:Rr(cA,{...t,client:Oo})})},cA=e=>{let t=e.client,[r,o]=lt(!1),[n,i]=lt(!1),[a,l]=lt(!1),[s,d]=lt(null),[m,f]=lt([]),[u,g]=lt(null),v=Ra(m),[C,b]=lt(!1),[A,k]=lt(null),[S,x]=lt(!1),[T,M]=lt({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:ft}),[D,B]=lt({status:"initial"}),[K,Q]=lt(null),[L,X]=lt(null),I=Ve(),q=rl(),[Le,oe]=lt(!0),[Y,ne]=lt({}),[me,be]=lt(null),[ue,Re]=lt(null),[gt,tt]=lt(!1),[le,Jt]=lt(!1),[Do,rt]=lt(I.customAuth?.enabled?{status:"initial"}:{status:"not-enabled"}),Fe=Ra(null),ze=Ra(null),W=Ra(fm),[se,ce]=lt(!1);t.onStoreToken=c=>{c&&N(W,"accessToken","onAccessTokenGranted",c)},t.onDeleteToken=()=>{d(null),l(!1),N(W,"accessToken","onAccessTokenRemoved")};let z=Ra(null),ee=Ra(null),ke=c=>{k(c),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:c}})},xt=c=>{I.embeddedWallets.createOnLogin!=="off"&&oe(!0),ke(c)};po(()=>{let c=Kn(s);if(!c||!L){g(null);return}let p={address:c.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:Ai,id:"io.privy.solana.wallet"},getProvider:async()=>new _d(L,c.address)};g(p)},[L,s]),po(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnector();return}let c=Se(s),p=Rl(s);if(c||t.connectors?.removeEmbeddedWalletConnector(),p||t.connectors?.removeImportedWalletConnector(),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!L){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}c&&t.connectors.addEmbeddedWalletConnector(L,c.address,I.defaultChain,e.appId),p&&t.connectors.addImportedWalletConnector(L,p.address,I.defaultChain,e.appId)},[L,s]),po(()=>{L&&ue?.(L)},[L]),po(()=>{(async()=>{if(!I.customAuth?.enabled){rt({status:"not-enabled"});return}oe(!0),rt({status:"loading"});let{getCustomAccessToken:p,isLoading:h}=I.customAuth;if(!(!n||h))try{let y=await p();if(!y&&a){await bi.logout(),rt({status:"done"}),N(W,"customAuth","onUnauthenticated");return}if(!y){rt({status:"done"});return}if(a){rt({status:"done"});return}t.startAuthFlow(new _i(y));let{user:E,isNewUser:O}=await t.authenticate();if(!E){await bi.logout(),rt({status:"error",error:new w("Failed to sync with custom auth provider")}),N(W,"customAuth","onUnauthenticated");return}O!==void 0&&N(W,"login","onComplete",E,O,!1,"custom",null),N(W,"customAuth","onAuthenticated",{user:E}),rt({status:"done"}),d(E||null),b(O||!1),l(!0),Jt(!0)}catch(y){throw console.warn(y),a&&(await bi.logout(),N(W,"customAuth","onUnauthenticated")),N(W,"login","onError",y.privyErrorCode||"unknown_auth_error"),rt({status:"error",error:y}),y}})()},[I.customAuth?.enabled,I.customAuth?.getCustomAccessToken,I.customAuth?.isLoading,n,a]),po(()=>{le&&L&&s&&Ht(s,I.embeddedWallets.createOnLogin)&&(Jt(!1),Id(s,Si).catch(console.error))},[le&&L&&s]),po(()=>{async function c(){let p=Md(),h=Jo();sA();let y=eA();t.initializeConnectorManager({walletConnectCloudProjectId:I.walletConnectCloudProjectId,rpcConfig:I.rpcConfig,chains:I.chains,defaultChain:I.defaultChain,store:y,walletList:I.appearance.walletList,shouldEnforceDefaultChainOnConnect:I.shouldEnforceDefaultChainOnConnect,externalWalletConfig:I.externalWallets,appName:I.name??"Privy"});let E;t.connectors?.on("connectorInitialized",()=>{E&&clearTimeout(E);let G=t.connectors.walletConnectors.length,Z=t.connectors.walletConnectors.reduce((de,Ce)=>de+(Ce.initialized?1:0),0);Z===G?ce(!0):E=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:Z,expected:G}),ce(!0)},1500)}),t.connectors?.initialize().then(()=>{jo()});let O=await t.getAuthenticatedUser(),F=!!O;if(I.customAuth?.enabled||(l(!!O),O&&N(W,"login","onComplete",O,!1,!0,null,null),d(O)),p){ee.current=F?"link":"login";return}if(h&&!F){ee.current="login",xt("TELEGRAM_AUTH_SCREEN");return}re.setReadyToTrue(!!O)}!n&&q&&c()},[t,me,n,q]),po(()=>{if(!n)return;if(!s){tt(!0);return}if(!!!s.linkedAccounts.find(h=>h.type==="wallet"&&h.walletClientType==="privy")){tt(!0);return}let p=!!m.find(h=>h.walletClientType==="privy");tt(p)},[n,s,m]);let Md=()=>{let c=Va();if(c.inProgress&&c.popupFlow){if(window.opener.location.origin!==window.location.origin){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."});return}if(c.authorizationCode==="error"){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:c.stateCode,authorizationCode:c.authorizationCode});return}let p="privy:";function h(y){return y.startsWith(p)}return c.inProgress&&h(c.provider)&&!c.popupFlow&&(new BroadcastChannel("popup-privy-oauth").postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:c.stateCode,authorizationCode:c.authorizationCode}),window.close()),!c.inProgress||c.headless?!1:(t.startAuthFlow(new yo(c)),xt("AWAITING_OAUTH_SCREEN"),!0)},Jo=()=>{let c=Mf();if(!c||!I.loginMethods.telegram||!I.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let p=new Li;return t.startAuthFlow(p),c.flowType==="login-url"&&(p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult={id:c.id,first_name:c.first_name,last_name:c.last_name,auth_date:c.auth_date,username:c.username,photo_url:c.photo_url,hash:c.hash}),c.flowType==="web-app"&&(p.meta.telegramAuthResult=void 0,p.meta.telegramWebAppData={query_id:c.query_id,user:c.user,auth_date:c.auth_date,hash:c.hash,chat_instance:c.chat_instance,chat_type:c.chat_type,start_param:c.start_param}),!0},Ft=async(c,p,h,y)=>{let E=await t.connectors?.createWalletConnector(c,p)||null;kr(E,p,h,y)};async function kr(c,p,h,y){if(c)M({status:"disconnected",connectedWallet:null,connectError:null,connector:c,connectRetry:ft});else return M({status:"disconnected",connectedWallet:null,connectError:new Ie("Unable to connect to wallet."),connector:null,connectRetry:ft}),y?.(null,h);c instanceof $r&&p&&await c.resetConnection(p),M({connector:c,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>kr(c,p,h,y)});try{let E=await c.connect({showPrompt:!0});if(I.shouldEnforceDefaultChainOnConnect&&!I.chains.find(O=>O.id===Number(E?.chainId.replace("eip155:","")))&&!(E?.connectorType==="wallet_connect_v2"&&E?.walletClientType==="metamask")){M(O=>({...O,connector:c,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:ft}));try{await E?.switchChain(I.defaultChain.id),E&&(E.chainId=Ti(Dn(I.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${I.defaultChain.id}`)}}return M(O=>({...O,status:"connected",connectedWallet:E,connectError:null,connectRetry:ft})),E&&N(W,"connectWallet","onSuccess",E),y?.(E,h)}catch(E){return E instanceof $t?(console.warn(E.cause?E.cause:E.message),N(W,"connectWallet","onError",E.privyErrorCode||"generic_connect_wallet_error")):(console.warn(E),N(W,"connectWallet","onError","unknown_connect_wallet_error")),M(O=>({...O,status:"disconnected",connectedWallet:null,connectError:E})),y?.(null,h)}}let _r=async(c,p)=>{if(c===null)return;let h=new Bo(c,t,p);t.startAuthFlow(h)},jo=()=>{let c=new URLSearchParams(window.location.search),p=c.get("privy_connector"),h=c.get("privy_wallet_client");if(!p||!h)return;if(h==="phantom"&&!$o()&&xt("LOGIN_FAILED_SCREEN"),!t.connectors)throw new w("Connector not initialized");ke("AWAITING_CONNECTION");let y=new URL(window.location.href);y.searchParams.delete("privy_connector"),y.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",y),Ft(p,h,void 0,_r)};po(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(d)},[n,a,s,t]);let Te=c=>{if(!a)throw N(W,"linkAccount","onError","must_be_authenticated",{linkMethod:c}),new w("User must be authenticated before linking an account.")},Xr=()=>{Te("siwe"),z.current="siwe",ee.current="link",ke("LINK_WALLET_SCREEN")},vi=c=>{if(!a||!s)return!1;if(c.walletClientType==="privy")return!0;for(let p of s.linkedAccounts)if(p.type==="wallet"&&p.address===c.address&&p.walletClientType!=="privy")return!0;return!1},Nn=async c=>{if(!t.connectors)throw new w("Connector not initialized");let p=t.connectors.findWalletConnector(c.connectorType,c.walletClientType)||null;if(M(h=>({...h,connector:p,status:"connected",connectedWallet:c,connectError:null,connectRetry:ft})),I.captchaEnabled&&!a){let h={callback:y=>_r(c,y),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};ne({captchaModalData:h}),xt("CAPTCHA_SCREEN")}else await _r(c),xt("AWAITING_CONNECTION")},Je=async(c,p)=>{let{signedUrl:h,externalTransactionId:y}=await h1(t,c,p??{},I.appearance.palette,I.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:h,externalTransactionId:y}},wi=()=>{f(c=>{let p=t.connectors?.wallets.map(h=>({...h,linked:vi(h),loginOrLink:async()=>{if(!await h.isConnected())throw new w("Wallet is not connected");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new w("Cannot link or login with embedded wallet");Nn(h)},fund:async y=>{await re.fundWallet(h.address,y)},unlink:async()=>{if(!a)throw new w("User is not authenticated.");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new w("Cannot unlink an embedded wallet");let y=await t.unlinkWallet(h.address);d(y)}}))||[];return kl(c,p)?c:p})};po(()=>{wi()},[s?.linkedAccounts,a,n]),po(()=>{if(n){if(!t.connectors)throw new w("Connector not initialized");wi(),t.connectors.on("walletsUpdated",wi)}},[n]);let G0=c=>{if(c&&"suggestedAddress"in c&&c.suggestedAddress){let p=No(c.suggestedAddress);Q(p)}ke(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};po(()=>{if(!m[0])return;let c=m[0],p=v.current.find(y=>y.address===c.address),h;if(c.walletClientType==="privy"?h=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===c.address&&y.walletClientType==="privy"):h=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===c.address&&y.walletClientType!=="privy"),!p&&h){let y=Object.assign({},s);y.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported,walletIndex:h.walletIndex},d(y)}v.current=m},[m]);let Id=async(c,p,h)=>{let y=Se(c);if(y&&!h?.createAdditional)throw N(W,"createWallet","onError","embedded_wallet_already_exists"),new Error("User already has an embedded wallet.");let[E,O]=await Promise.all([re.initializeWalletProxy(p),Ae()]);if(!E&&I.customAuth?.enabled)throw N(W,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!E||!O||I.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((F,G)=>{oe(!0),ne({createWallet:{onSuccess:de=>{N(W,"createWallet","onSuccess",de),F(de)},onFailure:de=>{N(W,"createWallet","onError","unknown_embedded_wallet_error"),G(de)},callAuthOnSuccessOnClose:!1}}),ke("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{if(!y)await E.create({accessToken:O});else{let Z=If(c),Ce=(Z?.length?Math.max(...Z.map(je=>je.walletIndex)):y.walletIndex)+1;await re.recoverEmbeddedEthereumWallet(),await E.createAdditional({accessToken:O,primaryWalletAddress:y?.address,hdWalletIndex:Ce})}let F=await re.refreshUser(),G=Se(F);if(!G)throw N(W,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return N(W,"createWallet","onSuccess",G),G}},q0=c=>{if(!I.chains.map(p=>p.id).includes(c))throw new Ie(`Chain ID ${c} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},ku=(c,p,h)=>new Promise(async(y,E)=>{let{requesterAppId:O}=p||{};if(!a||!s){N(W,"sendTransaction","onError","must_be_authenticated"),E(new Error("User must be authenticated before signing with a Privy wallet"));return}let F=c.from,G=F?s?.linkedAccounts.find(ot=>ot.type==="wallet"&&ot.walletClientType==="privy"&&No(ot.address)===No(F)):Se(s);if(!G){N(W,"sendTransaction","onError","embedded_wallet_not_found"),E(new Error("Must have a Privy wallet before signing"));return}oe(!0);let Z=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,de=c.chainId?Number(c.chainId):Z.chainId;q0(de);let Ce=Object.assign({},c,{chainId:de}),je=async()=>{let ot=await Ae();if(!ot||!L){N(W,"sendTransaction","onError","embedded_wallet_not_found"),E(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await re.recoverEmbeddedEthereumWallet()){N(W,"sendTransaction","onError","unknown_connect_wallet_error"),E(new Error("Unable to connect to wallet"));return}let Ei=Ir(Ce.chainId,I.chains,I.rpcConfig,{appId:e.appId}),uo=await iA(G.address,Ce,Ei);if(I.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:K0}=await nA(uo,Ei),{hasSufficientFunds:Y0}=await Td(G.address,uo,K0,Ei);if(!Y0)throw new Tt(new Dr("Wallet has insufficient funds for this transaction.",oA.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let Wu=await Ed(ot,G.address,L,uo,Ei,O);N(W,"sendTransaction","onSuccess",Wu),y(Wu)}catch(qs){N(W,"sendTransaction","onError","transaction_failure"),E(qs)}};if(I.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),je();else{let ot={transactionRequest:Ce,onSuccess:uo=>{N(W,"sendTransaction","onSuccess",uo),y(uo)},onFailure:uo=>{N(W,"sendTransaction","onError","transaction_failure"),E(uo)},uiOptions:p||{},fundWalletConfig:h,requesterAppId:O},qs={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:uo=>{N(W,"sendTransaction","onError","unknown_connect_wallet_error"),E(uo)}},Ei=Mu({address:G.address,fundWalletConfig:h,chainIdOverride:Ce.chainId,comingFromSendTransactionScreen:!0});ne({connectWallet:qs,sendTransaction:ot,funding:Ei}),ke("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function _u(){return new Promise(async(c,p)=>{let h=await Ae();if(!h||!L)throw new Error("Must have valid access token to enroll in MFA");try{await L.verifyMfa({accessToken:h}),c()}catch(y){p(y)}})}let Vs=c=>c?.linkedAccounts.filter(p=>p.latestVerifiedAt!==null&&!(p.type==="wallet"&&p.walletClientType==="privy")).sort((p,h)=>h.latestVerifiedAt.getTime()-p.latestVerifiedAt.getTime())[0],jt=c=>{let p=s?.linkedAccounts.filter(E=>E.type===c).length??0,{displayName:h,loginMethod:y}=En(c);if(c==="passkey"&&p>=5||c!=="passkey"&&p>=1)throw N(W,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:y}),new w(`User already has an account of type ${h} linked.`)},Mu=({address:c,fundWalletConfig:p,methodScreen:h,chainIdOverride:y=null,comingFromSendTransactionScreen:E=!1})=>{if(!I.fundingConfig||I.fundingConfig.methods.length===0)return;let O,F,G,Z,de=!1;if(f1(p)&&p.chain){if(O=p.chain.id,F=p.chain,G=p.amount??I.fundingConfig.defaultRecommendedAmount,"asset"in p)if(p.asset==="USDC"){let Ce=Pu[O];I.fundingConfig.methods.includes("external")&&!Ce&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),Z=Ce,de=!0}else typeof p.asset!="string"&&"erc20"in p.asset&&(Z=p.asset.erc20,de=k0(Z,p.chain))}else O=x0(I.fundingConfig.defaultRecommendedCurrency.chain),F=I.chains.find(Ce=>Ce.id===O),G=I.fundingConfig.defaultRecommendedAmount;if(y&&I.chains.find(Ce=>Ce.id===y)&&(F=I.chains.find(Ce=>Ce.id===y)),!F)throw new w("Funding chain is not in PrivyProvider chains list");return{address:c,amount:G,chain:F,erc20Address:Z,erc20ContractInfo:de?{symbol:"USDC",decimals:6}:void 0,isUSDC:de,methodScreen:h,comingFromSendTransactionScreen:E,...m1(p)?{moonpayConfigOverride:p.config}:{}}};async function Iu({showAutomaticRecovery:c=!1,legacySetWalletPasswordFlow:p=!1}){k(null);let h=p?"setWalletPassword":"setWalletRecovery";if(!a||!s)throw N(W,h,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let y=Se(s);if(!y||!L)throw N(W,h,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if(Kn(s))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await _u()}catch(O){throw N(W,h,"onError","missing_or_invalid_mfa"),O}return new Promise((O,F)=>{oe(!0);let G={onSuccess:je=>{N(W,h,"onSuccess","user-passcode",je),O(je)},onFailure:je=>{N(W,h,"onError","user_exited_set_password_flow"),F(je)},callAuthOnSuccessOnClose:!1},Z=y.recoveryMethod==="user-passcode",Ce={onCompleteNavigateTo:cc({walletAction:"update",availableRecoveryMethods:I.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:p,isResettingPassword:Z,showAutomaticRecovery:c}),shouldForceMFA:!1,onFailure:je=>{N(W,h,"onError","unknown_connect_wallet_error"),F(je)}};ne({setWalletPassword:G,createWallet:G,connectWallet:Ce,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:Z}}),ke("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function Gs({appId:c}){Te(`privy:${c}`),z.current=`privy:${c}`,ee.current="link";let p=window.open(void 0,void 0,Cs({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:c}}),new Promise(async(h,y)=>{let{name:E,logoUrl:O}=await Nc({api:t.api,providerAppId:c,requesterAppId:I.id});ne({crossAppAuth:{appId:c,name:E,logoUrl:O,popup:p,onSuccess:h,onError:y}}),xt("CROSS_APP_AUTH_SCREEN")})}let bi={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:G0,importWallet:async({privateKey:c})=>{Te("siwe");let[p,h]=await Promise.all([re.initializeWalletProxy(15e3),Ae()]);if(p&&h){await p.import({privateKey:c,accessToken:h});let y=await re.refreshUser(),E=Rl(y);if(!E)throw N(W,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return N(W,"createWallet","onSuccess",E),E}else throw new w("User is not authenticated")},linkWallet:Xr,linkCrossAppAccount:Gs,linkEmail:()=>{Te("email"),jt("email"),z.current="email",ee.current="link",ke("LINK_EMAIL_SCREEN")},linkPhone:()=>{Te("sms"),jt("phone"),z.current="sms",ee.current="link",ke("LINK_PHONE_SCREEN")},linkGoogle:async()=>{Te("google"),jt("google_oauth"),ee.current="link",await re.initLoginWithOAuth("google")},linkTwitter:async()=>{Te("twitter"),jt("twitter_oauth"),ee.current="link",await re.initLoginWithOAuth("twitter")},linkDiscord:async()=>{Te("discord"),jt("discord_oauth"),ee.current="link",await re.initLoginWithOAuth("discord")},linkGithub:async()=>{Te("github"),jt("github_oauth"),ee.current="link",await re.initLoginWithOAuth("github")},linkSpotify:async()=>{Te("spotify"),jt("spotify_oauth"),ee.current="link",await re.initLoginWithOAuth("spotify")},linkInstagram:async()=>{Te("instagram"),jt("instagram_oauth"),ee.current="link",await re.initLoginWithOAuth("instagram")},linkTiktok:async()=>{Te("tiktok"),jt("tiktok_oauth"),ee.current="link",await re.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{Te("linkedin"),jt("linkedin_oauth"),ee.current="link",await re.initLoginWithOAuth("linkedin")},linkApple:async()=>{Te("apple"),jt("apple_oauth"),ee.current="link",await re.initLoginWithOAuth("apple")},linkPasskey:async()=>{Te("passkey"),jt("passkey"),await re.initLinkWithPasskey(),ke("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{Te("telegram"),jt("telegram"),ee.current="link",z.current="telegram",await re.initLoginWithTelegram(),ke("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{Te("farcaster"),jt("farcaster"),await re.initLoginWithFarcaster(),ee.current="link",z.current="farcaster",ke("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(Te("email"),!s?.email)throw new w("User does not have an email linked to their account.");ee.current="link",z.current="email",ke("UPDATE_EMAIL_SCREEN")},updatePhone:()=>{if(Te("sms"),!s?.phone)throw new w("User does not have a phone number linked to their account.");ee.current="link",z.current="sms",ke("UPDATE_PHONE_SCREEN")},login:async c=>{c&&"target"in c&&c&&(c=void 0);let p="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!n){let h=await new Promise(y=>{be(E=>y.bind(E))});if(be(null),h){console.warn(p);return}}if(s&&!s.isGuest){console.warn(p);return}ee.current="login",ne({login:c}),xt("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(c=>{be(()=>c)}),be(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}xt("CONNECT_OR_CREATE")},logout:async()=>{if(s&&t.clearProviderAcccessTokens(s),k(null),await t.logout(),s&&L)try{await L.clearMfa({userId:s.id})}catch{}d(null),l(!1),N(W,"logout","onSuccess"),ee.current=null,z.current=null,o(!1),j.del(Wa),j.del(js(I.id))},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new $e;let c=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===c?.address));return!c||!p?new $e:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new Ru(new Co(new $e));let c=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===c?.address));return!c||!p?new Ru(new Co(new $e)):new Ru(new Co(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new on(new $e);let c=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===c?.address));return!c||!p?new on(new $e):new on(p.proxyProvider)},unlinkWallet:async c=>{let p=await t.unlinkWallet(c);return d(p),p},unlinkEmail:async c=>{let p=await t.unlinkEmail(c);return d(p),p},unlinkPhone:async c=>{let p=await t.unlinkPhone(c);return d(p),p},unlinkGoogle:async c=>{let p=await t.unlinkOAuth("google",c);return d(p),p},unlinkTwitter:async c=>{let p=await t.unlinkOAuth("twitter",c);return d(p),p},unlinkDiscord:async c=>{let p=await t.unlinkOAuth("discord",c);return d(p),p},unlinkGithub:async c=>{let p=await t.unlinkOAuth("github",c);return d(p),p},unlinkSpotify:async c=>{let p=await t.unlinkOAuth("spotify",c);return d(p),p},unlinkInstagram:async c=>{let p=await t.unlinkOAuth("instagram",c);return d(p),p},unlinkTiktok:async c=>{let p=await t.unlinkOAuth("tiktok",c);return d(p),p},unlinkLinkedIn:async c=>{let p=await t.unlinkOAuth("linkedin",c);return d(p),p},unlinkApple:async c=>{let p=await t.unlinkOAuth("apple",c);return d(p),p},unlinkFarcaster:async c=>{let p=await t.unlinkFarcaster(c);return d(p),p},unlinkTelegram:async c=>{let p=await t.unlinkTelegram(c);return d(p),p},unlinkPasskey:async c=>{let p=await t.unlinkPasskey(c);return d(p),p},unlinkCrossAppAccount:async({subject:c})=>{let p=s?.linkedAccounts.find(y=>y.type==="cross_app"&&y.subject===c)?.providerApp;if(!p)throw new w("Invalid subject");t.storeProviderAccessToken(p.id,null);let h=await t.unlinkOAuth(`privy:${p.id}`,c);return d(h),h},setActiveWallet:async c=>{let p=m.find(y=>No(y.address)===No(c)),h=s?.linkedAccounts.find(y=>y.type==="wallet"&&No(y.address)===No(c));if(!p||!await p.isConnected())Q(c),Xr();else if(!p.linked)p.loginOrLink();else{let y=Object.assign({},s);y.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported,walletIndex:h.walletIndex},d(y)}},forkSession:()=>t.forkSession(),createWallet:async c=>{if(c&&"target"in c&&c&&(c=void 0),!a||!s)throw N(W,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return Id(s,15e3,c)},setWalletRecovery:async c=>Iu({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:c?.showAutomaticRecovery??!1}),setWalletPassword:async()=>Iu({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(c,p,h)=>new Promise(async(y,E)=>{let{requesterAppId:O}=p||{};if(!a||!s){N(W,"signMessage","onError","must_be_authenticated"),E(new Error("User must be authenticated before signing with a Privy wallet"));return}let F=h?s?.linkedAccounts.find(Z=>Z.type==="wallet"&&Z.walletClientType==="privy"&&No(Z.address)===No(h)):Se(s);if(!F){N(W,"signMessage","onError","embedded_wallet_not_found"),E(new Error("Must have a Privy wallet before signing"));return}if(typeof c!="string"||c.length<1){N(W,"signMessage","onError","invalid_message"),E(new Error("Message must be a non-empty string"));return}oe(!0);let G=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Z=await Ae();if(!L||!Z)throw new Error("Unable to connect to wallet");if(!await re.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:F.address,requesterAppId:O}});let{response:Ce}=await L.rpc({accessToken:Z,address:F.address,requesterAppId:O,request:{method:"personal_sign",params:[c,F.address]}}),je=Ce.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:F.address,requesterAppId:O}}),je};if(I.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Z=await G();N(W,"signMessage","onSuccess",Z),y(Z)}catch(Z){N(W,"signMessage","onError","unable_to_sign"),E(Z??new Tt("Unable to sign message"))}}else{let Ce={method:"personal_sign",data:c,confirmAndSign:G,onSuccess:ot=>{N(W,"signMessage","onSuccess",ot),y(ot)},onFailure:ot=>{N(W,"signMessage","onError","unable_to_sign"),E(ot)},uiOptions:p||{}},je={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:ot=>{N(W,"signMessage","onError","unknown_connect_wallet_error"),E(ot)},address:F.address};ne({signMessage:Ce,connectWallet:je}),ke("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(c,p)=>new Promise(async(h,y)=>{let{requesterAppId:E}=p||{};if(!a||!s){N(W,"signTypedData","onError","must_be_authenticated"),y(new Error("User must be authenticated before signing with a Privy wallet"));return}let O=Se(s);if(!O){N(W,"signTypedData","onError","embedded_wallet_not_found"),y(new Error("Must have a Privy wallet before signing"));return}oe(!0);let F=Ma(c),G=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Z=await Ae();if(!L||!Z)throw new Error("Unable to connect to wallet");if(!await re.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:O.address,requesterAppId:E}});let{response:Ce}=await L.rpc({accessToken:Z,address:O.address,requesterAppId:E,request:{method:"eth_signTypedData_v4",params:[O.address,F]}}),je=Ce.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:O.address,requesterAppId:E}}),je};if(I.embeddedWallets.noPromptOnSignature||(I.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Z=await G();N(W,"signTypedData","onSuccess",Z),h(Z)}catch(Z){N(W,"signTypedData","onError","unable_to_sign"),y(Z??new Tt("Unable to sign message"))}}else{let Ce={method:"eth_signTypedData_v4",data:F,confirmAndSign:G,onSuccess:ot=>{N(W,"signTypedData","onSuccess",ot),h(ot)},onFailure:ot=>{N(W,"signTypedData","onError","unable_to_sign"),y(ot)},uiOptions:p||{}},je={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:ot=>{N(W,"signMessage","onError","unknown_connect_wallet_error"),y(ot)}};ne({signMessage:Ce,connectWallet:je}),ke("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(c,p,h)=>{let E=await(await ku(c,p,h)).wait();return Sd(E)},exportWallet:c=>new Promise(async(p,h)=>{if(!a||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}c&&"target"in c&&c&&(c=void 0);let y=c?.address,E=s.linkedAccounts.filter(de=>de.type==="wallet"&&de.walletClientType==="privy"&&de.chainType==="ethereum"),O=y?E.find(de=>de.address===No(y)):E.find(de=>!de.imported)||E[0];if(!O){h(new Error("Must have a Privy wallet before exporting"));return}oe(!0);let F={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:h,address:O.address,shouldForceMFA:!0};if(ne(Y),!await Ae()||!L){h(new Error("Must have valid access token to enroll in MFA"));return}if(!L){h(new Error("Must have a Privy wallet before exporting"));return}let Z={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:O,onSuccess:p,onFailure:h};ne({keyExport:Z,connectWallet:F}),ke("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:_u,async init(c){switch(c){case"sms":await t.initMfaSmsVerification();return;case"passkey":return await t.initMfaPasskeyVerification();case"totp":return;default:throw new Error(`Unsupported MFA method: ${c}`)}},async submit(c,p){switch(c){case"totp":case"sms":if(typeof p!="string")throw new w("Invalid MFA code");Fe.current?.resolve({mfaMethod:c,mfaCode:p,relyingParty:window.origin}),await new Promise((O,F)=>{ze.current={resolve:O,reject:F}});break;case"passkey":if(typeof p=="string")throw new w("Invalid authenticator response");let y=await(await import("@simplewebauthn/browser")).startAuthentication(p),E=_0(y);Fe.current?.resolve({mfaMethod:c,mfaCode:E,relyingParty:window.origin}),await new Promise((O,F)=>{ze.current={resolve:O,reject:F}});break;default:throw Fe.current?.reject(new w("Unsupported MFA method")),new w(`Unsupported MFA method: ${c}`)}},cancel(){Fe.current?.reject(new w("MFA canceled"))},async initEnrollmentWithSms(c){let p=await Ae();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:c.phoneNumber})},enrollInMfa(c){return new Promise((p,h)=>{if(!c){re.closePrivyModal(),p();return}I.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),ne({mfaEnrollmentFlow:{mfaMethods:I.mfa.methods,onSuccess:p,onFailure:h}}),ke("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let c=await Ae();if(!c||!L)throw new Error("Must have valid access token to enroll in MFA");let p=await L.initEnrollMfa({method:"totp",accessToken:c});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(c){let p=await Ae();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:c.phoneNumber,code:c.mfaCode});let h=await t.getAuthenticatedUser();d(h)},async submitEnrollmentWithTotp(c){let p=await Ae();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"totp",accessToken:p,code:c.mfaCode});let h=await t.getAuthenticatedUser();d(h)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:c}){let p=await Ae();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:c});let h=await t.getAuthenticatedUser();d(h)},async unenroll(c){let p=await Ae();if(!p||!L)throw new Error("Must have valid access token to remove MFA");c==="passkey"?await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await L.unenrollMfa({method:c,accessToken:p});let h=await t.getAuthenticatedUser();d(h)},requestFarcasterSignerFromWarpcast:async()=>{let c=await Ae(),p=s?.linkedAccounts.find(E=>E.type==="wallet"&&E.walletClientType==="privy");if(!c)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await re.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");let y=await L.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:c,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(y.status==="approved"){let E=await t.getAuthenticatedUser();d(E||s||null)}ne({farcasterSigner:y}),ke("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let c=await Ae(),p=s?.linkedAccounts.find(E=>E.type==="wallet"&&E.walletClientType==="privy");if(!c)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await re.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");return(E=>Uint8Array.from(E.match(/.{1,2}/g).map(O=>parseInt(O,16))))(s.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async c=>{let p=await Ae(),h=s?.linkedAccounts.find(F=>F.type==="wallet"&&F.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!h)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await re.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");let E=await import("@simplewebauthn/browser"),O=await L.signFarcasterMessage({address:h.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{hash:E.bufferToBase64URLString(c)},fid:BigInt(s.farcaster.fid),relyingParty:window.origin});return new Uint8Array(E.base64URLStringToBuffer(O.signature))},createGuestAccount:async()=>{if(s&&!s.isGuest)throw new Error("User cannot already be authenticated to create a guest account");return s?.isGuest?s:re.loginWithGuestAccountFlow()},isHeadlessOAuthLoading:S,loginWithCode(c){return re.loginWithCode(c)},initLoginWithEmail(c){return re.initLoginWithEmail(c)},initLoginWithSms(c){return re.initLoginWithSms(c)},otpState:D,fundWallet(c,p){return re.fundWallet(c,p)},initLoginWithHeadlessOAuth(c,p){return re.initLoginWithHeadlessOAuth(c,p)},loginWithHeadlessOAuth(c){return re.loginWithHeadlessOAuth(c)},generateSiweMessage({address:c,chainId:p}){return re.generateSiweMessage({address:c,chainId:p})},linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:y,connectorType:E}){return Te("siwe"),re.linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:y,connectorType:E})},signMessageWithCrossAppWallet(c,{address:p}){return Oc({user:s,client:t,address:p,requesterAppId:I.id,request:{method:"personal_sign",params:[c,p]},reconnect:Gs})},signTypedDataWithCrossAppWallet(c,{address:p}){let h=Ma(c);return Oc({user:s,client:t,address:p,requesterAppId:I.id,request:{method:"eth_signTypedData_v4",params:[p,h]},reconnect:Gs})},sendTransactionWithCrossAppWallet(c,{address:p}){return Oc({user:s,client:t,address:p,requesterAppId:I.id,request:{method:"eth_sendTransaction",params:[c]},reconnect:Gs})},setCustomMetadata(c){return re.setCustomMetadataForUser(c)},isModalOpen:r,mfaMethods:I.mfa.methods};I0=bi.signMessage,W0=bi.signTypedData,L0=async(...c)=>{let p=await ku(...c);return I.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let re=(()=>({isNewUserThisSession:C,linkingOrConnectingHint:K,pendingTransaction:null,walletConnectionStatus:T,connectors:t.connectors?.walletConnectors??[],rpcConfig:I.rpcConfig,chains:I.chains,appId:e.appId,showFiatPrices:I.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,customAuthStatus:Do,nativeTokenSymbolForChainId:c=>I.chains.find(p=>p.id===Number(c))?.nativeCurrency.symbol,initializeWalletProxy:async c=>{if(L)return L;let p=new Promise(E=>{Re(()=>O=>E(O))}),h=new Promise(E=>setTimeout(()=>E(null),c)),y=await Promise.race([p,h]);return Re(null),y},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:async(c={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s,h;p&&z.current&&(h=Vs(s)),ee.current==="login"?c.shouldCallAuthOnSuccess&&p&&z.current?(N(W,"login","onComplete",s,C,!1,z.current,h??null),e.onSuccess?.(s,C)):N(W,"login","onError","exited_auth_flow"):ee.current==="link"&&h&&(c.isSuccess&&p&&z.current?N(W,"linkAccount","onSuccess",s,z.current,h):z.current&&N(W,"linkAccount","onError","exited_link_flow",{linkMethod:z.current}));let y=A&&hu.includes(A),E=A==="ERROR_SCREEN"&&Y.errorModalData&&hu.includes(Y.errorModalData.previousScreen);if((y||E)&&Y.funding){let O=_3[A]??null,F=Ir(Y.funding.chain.id,I.chains,I.rpcConfig,{appId:e.appId}),G;try{G=(await F.getBalance(Y.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}N(W,"fundWallet","onUserExited",{address:Y.funding.address,chain:Y.funding.chain,fundingMethod:O,balance:G})}Q(null),ee.current=null,z.current=null,b(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:async({message:c})=>new Promise(async(p,h)=>{let y=async()=>{let E=await t.getAccessToken();if(!E)throw new Error("User must be authenticated to use their embedded wallet.");if(!u)throw new Error("User must have an embedded Solana wallet to sign messages for Solana.");let O=re.walletProxy??await re.initializeWalletProxy(15e3);if(!O)throw new Error("Failed to initialize embedded wallet proxy.");let{response:F}=await O.rpcSolana({accessToken:E,publicKey:u.address,request:{method:"signMessage",params:{message:c}}});return F.data.signature};if(I.embeddedWallets.noPromptOnSignature)try{let E=await y();p({signature:E})}catch(E){h(E)}else ne({signMessage:{method:"solana_signMessage",data:c,confirmAndSign:y,onSuccess:G=>{p({signature:G})},onFailure:G=>{h(G)},uiOptions:{}}}),xt("EMBEDDED_WALLET_SIGN_REQUEST_SCREEN")}),openPrivyModal:ke,connectWallet:kr,initLoginWithWallet:async(c,p)=>{z.current="siwe",_r(c,p)},loginWithWallet:async()=>{if(!n)throw new On;if(!(t.authFlow instanceof Bo))throw new w("Must initialize SIWE flow first.");let c=await t.getAccessToken(),p,h;if(c!==null)try{({user:p}=await t.link()),z.current="siwe"}catch(y){throw N(W,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),y}else try{({user:p,isNewUser:h}=await t.authenticate()),z.current="siwe"}catch(y){throw N(W,"login","onError",y.privyErrorCode||"generic_connect_wallet_error"),y}d(p||s||null),b(h||!1),l(!0)},initLoginWithFarcaster:async c=>{let p=new Ua(c);t.startAuthFlow(p);try{z.current="farcaster",await p.initializeFarcasterConnect()}catch(h){throw ee.current==="login"?N(W,"login","onError",h.privyErrorCode||"unknown_auth_error"):ee.current==="link"&&N(W,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"farcaster"}),h}},loginWithFarcaster:async()=>{if(!n)throw new On;if(!(t.authFlow instanceof Ua))throw new w("Must initialize Farcaster flow first.");let c=await t.getAccessToken(),p,h;if(c!==null)try{({user:p}=await t.link()),z.current="farcaster"}catch(y){throw N(W,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"farcaster"}),y}else try{({user:p,isNewUser:h}=await t.authenticate()),z.current="farcaster"}catch(y){throw N(W,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}d(p||null),b(h||!1),l(!0)},async loginWithGuestAccountFlow(){let c=new Mi(this.appId);t.startAuthFlow(c);try{ee.current="login",z.current="guest";let p=await t.authenticate(),{user:h,isNewUser:y}=p;if(y=y||!1,!h)throw new w("Unable to authenticate guest account");if(Ht(h,I.embeddedWallets.createOnLogin))try{await Id(h,15e3),h=await re.refreshUser()}catch{d(h),console.warn("Unable to create embedded wallet for guest account")}else d(h);return b(y),l(!0),N(W,"login","onComplete",h,y,!1,"guest",null),h}catch(p){throw N(W,"login","onError",p.privyErrorCode||"unknown_auth_error"),p}},async crossAppAuthFlow({appId:c,popup:p}){let h=`privy:${c}`;z.current=h;let{url:y,stateCode:E,codeVerifier:O}=await $g({api:t.api,appId:c});if(!y)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:c}}),new w("No authorization URL returned for cross-app auth.");try{let F=await R0({url:y,popup:p,provider:h}),G=F.stateCode,Z=F.authorizationCode;if(G!==E)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:h,storedStateCode:E??"",returnedStateCode:G??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let de=await e1({api:Oo.api,appId:c,codeVerifier:O,stateCode:G,authorizationCode:Z});de&&t.storeProviderAccessToken(c,de);let Ce=await re.refreshUser();if(!Ce)throw new w("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:c}}),Ce}catch(F){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:F.toString(),provider:h}}),F}},async initLoginWithOAuth(c,p){if(z.current=c,ka()){if(c==="google"&&Ji(window.navigator.userAgent)){xt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{xt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}c==="twitter"&&window.opener&&window.opener.postMessage({type:"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"},"*"),j.del(Hn);let h=new yo({provider:c});p&&h.addCaptchaToken(p),t.startAuthFlow(h);let y=await t.authFlow.getAuthorizationUrl();y&&y.url&&(c==="twitter"&&rA&&(y.url=y.url.replace("x.com","twitter.com")),window.location.assign(y.url))},async initLoginWithTelegram(c){if(!n)throw new On;z.current="telegram";let p=new Li(c);t.startAuthFlow(p),p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult=await new Promise((h,y)=>{if(!I.loginConfig.telegramAuthConfiguration)return y(new w("Telegram Auth configuration is not loaded"));if(!window.Telegram)return y(new w("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:I.loginConfig.telegramAuthConfiguration.botId,request_access:!0},E=>E?h(E):y(new w("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Li))throw new w("Must initialize Telegram flow before calling loginWithTelegram");let c,p;if(ee.current==="login")try{let h=await t.authenticate();c=h.user,p=h.isNewUser,z.current="telegram"}catch(h){throw N(W,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}else if(ee.current==="link")try{c=(await t.link()).user,z.current="telegram"}catch(h){throw N(W,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}else throw new w("Unknown auth intent");d(c),b(p||!1),l(!0)},async recoveryOAuthFlow(c,p,h){let y,E;function O(F){if(!F)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:c}}),new w("Recovery OAuth failed")}switch(c){case"google-drive":{let{url:F,codeVerifier:G,stateCode:Z}=await vp({api:Oo.api,provider:c});O(F);let de,Ce;try{let je=await xu({url:F,popup:h,provider:c});if(de=je.stateCode,Ce=je.authorizationCode,de!==Z)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c,storedStateCode:Z??"",returnedStateCode:de??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(je){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:je.toString(),provider:c}}),new w("Recovery OAuth failed")}[y,E]=await Promise.all([Ae(),ty({api:Oo.api,provider:c,codeVerifier:G,stateCode:de,authorizationCode:Ce})]);break}case"icloud":{let{url:F}=await vp({api:Oo.api,provider:c});O(F);let{ckWebAuthToken:G}=await xu({url:F,popup:h,provider:c});E=G,y=await Ae();break}}if(!L)throw new w("Cannot connect to wallet proxy");if(!y)throw new w("Unable to authorize user");switch(p){case"recover":let F=Y.recoverWallet?.privyWallet?.address;if(!F)throw new w("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:F,recoveryMethod:c}}),await L.recover({address:F,accessToken:y,recoveryAccessToken:E,recoveryMethod:c}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:F,recoveryMethod:c}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await L.create({accessToken:y,recoveryAccessToken:E,recoveryMethod:c});let G=await re.refreshUser(),Z=Se(G);if(!Z)throw N(W,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:Z.address}}),N(W,"createWallet","onSuccess",Z);break;case"set-recovery":let de=Se(s);if(!de)throw N(W,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:de.address,existingRecoveryMethod:de.recoveryMethod,targetRecoveryMethod:c}}),await L.setRecovery({address:de.address,accessToken:y,recoveryAccessToken:E,recoveryMethod:c});let Ce=Se(await re.refreshUser());if(!Ce)throw N(W,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:de.address,existingRecoveryMethod:de.recoveryMethod,targetRecoveryMethod:c}}),N(W,"setWalletRecovery","onSuccess",c,Ce);break;default:throw new w("Unsupported recovery action")}},async loginWithOAuth(c){if(!(t.authFlow instanceof yo))throw new w("Must initialize OAuth flow before calling loginWithOAuth");let p=j.get(Fn),h=t.authFlow.meta.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c,storedStateCode:p??"",returnedStateCode:h??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let y=await t.getAccessToken(),E,O,F;if(y!==null)try{let G=await t.link();E=G.user,F=G.oAuthTokens,z.current=c}catch(G){throw N(W,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account",{linkMethod:c}),G}else try{let G=await t.authenticate();E=G.user,O=G.isNewUser,F=G.oAuthTokens,z.current=c}catch(G){throw ee.current==="login"?N(W,"login","onError",G.privyErrorCode||"unknown_auth_error"):ee.current==="link"&&N(W,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account",{linkMethod:c}),G}return d(E),b(O||!1),l(!0),F&&E&&N(W,"oAuthAuthorization","onOAuthTokenGrant",F,{user:E}),F},async initLoginWithPasskey(c){let p=new zn(c);t.startAuthFlow(p),ee.current="login";try{z.current="passkey",await p.initAuthenticationFlow()}catch(h){throw N(W,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}},async loginWithPasskey(){if(!n)throw new On;if(!(t.authFlow instanceof zn))throw new w("Must initialize Passkey flow first.");if(z.current!=="passkey")throw new w("Must init login with Passkey flow first.");let c,p;try{z.current="passkey",{user:c,isNewUser:p}=await t.authenticate()}catch(h){throw N(W,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}d(c),b(p||!1),l(!0)},async initLinkWithPasskey(c){let p=new zn(c);t.startAuthFlow(p),ee.current="link",z.current="passkey";try{await p.initLinkFlow()}catch(h){throw N(W,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"passkey"}),h}},async linkWithPasskey(){if(!n)throw new On;if(!(t.authFlow instanceof zn))throw new w("Must initialize Passkey flow first.");if(z.current!=="passkey")throw new w("Must init login with Passkey flow first.");let c;try{z.current="passkey",{user:c}=await t.link()}catch(p){throw N(W,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account",{linkMethod:"passkey"}),p}return d(c||s||null),c},async initLoginWithHeadlessOAuth(c,p){if(ka()){if(c==="google"&&Ji(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.")}else throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let h=new yo({provider:c,headless:!0});p&&h.addCaptchaToken(p);let y=await t.startAuthFlow(h).getAuthorizationUrl();y?.url&&window.location.assign(y.url)},async loginWithHeadlessOAuth(c){x(!0),t.startAuthFlow(new yo(c));let p=j.get(Fn),h=c.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c.provider,storedStateCode:p??"",returnedStateCode:h??""}}),x(!1),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let y=await t.getAccessToken(),E,O,F;if(y!==null)try{({user:E,oAuthTokens:F}=await t.link()),z.current=c.provider;let G=Vs(E);E&&G&&N(W,"linkAccount","onSuccess",E,z.current,G)}catch(G){throw N(W,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account",{linkMethod:c.provider}),G}else try{({user:E,isNewUser:O,oAuthTokens:F}=await t.authenticate()),z.current=c.provider;let G=Vs(E);E&&G&&(ee.current==="login"&&O!==void 0?N(W,"login","onComplete",E,O,!1,z.current,G):ee.current==="link"&&N(W,"linkAccount","onSuccess",E,z.current,G))}catch(G){throw ee.current==="login"?N(W,"login","onError",G.privyErrorCode||"unknown_auth_error"):ee.current==="link"&&N(W,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account",{linkMethod:c.provider}),G}return d(E),b(O||!1),l(!0),x(!1),F&&E&&N(W,"oAuthAuthorization","onOAuthTokenGrant",F,{user:E}),E??void 0},initLoginWithEmail:async(c,p)=>{let h=new en(c,p);t.startAuthFlow(h);try{z.current="email",await h.sendCodeEmail()}catch(y){throw ee.current==="login"?N(W,"login","onError",y.privyErrorCode||"unknown_auth_error"):ee.current==="link"&&N(W,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"email"}),y}},initUpdateEmail:async(c,p,h)=>{let y=new cl(c,p,h);t.startAuthFlow(y),await y.sendCodeEmail()},initUpdatePhone:async(c,p,h)=>{let y=new xl(c,p,h);t.startAuthFlow(y),await y.sendSmsCode()},initLoginWithSms:async(c,p)=>{B({status:"sending-code"});let h=new tn(c,p);t.startAuthFlow(h);try{z.current="sms",await h.sendSmsCode(),B({status:"awaiting-code-input"})}catch(y){throw B({status:"error",error:y}),ee.current==="login"?N(W,"login","onError",y.privyErrorCode||"unknown_auth_error"):ee.current==="link"&&N(W,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"sms"}),y}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async c=>{if(B({status:"submitting-code"}),!n){let y=new On;throw B({status:"error",error:y}),y}if(t.authFlow instanceof en)t.authFlow.meta.emailCode=c.trim();else if(t.authFlow instanceof tn)t.authFlow.meta.smsCode=c.trim();else{let y=new w("Must initialize a passwordless code flow first");throw B({status:"error",error:y}),y}await Ae();let p,h;if(ee.current==="link")try{({user:p}=await t.link())}catch(y){throw B({status:"error",error:y}),N(W,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:z.current}),y}else try{({user:p,isNewUser:h}=await t.authenticate())}catch(y){throw B({status:"error",error:y}),N(W,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}d(p||s||null),b(h||!1),l(!0),B({status:"done"})},generateSiweMessage:async({address:c,chainId:p,captchaToken:h})=>{ee.current="link",z.current="siwe";let y=await t.generateSiweNonce({address:c,captchaToken:h}),E=p.replace("eip155:","");return Pl({address:c,chainId:E,nonce:y})},linkWithSiwe:async({message:c,signature:p,chainId:h,walletClientType:y,connectorType:E})=>{let O;try{O=await t.linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:y,connectorType:E}),O=await re.refreshUser()??O;let F=Vs(O);F&&N(W,"linkAccount","onSuccess",O,"siwe",F)}catch(F){throw N(W,"linkAccount","onError",F.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),ee.current=null,z.current=null,F}d(O||s||null),ee.current=null,z.current=null},refreshUser:async()=>{let c=await t.getAuthenticatedUser();return d(c),c},walletProxy:L,createAnalyticsEvent:({eventName:c,payload:p,timestamp:h})=>t.createAnalyticsEvent({eventName:c,payload:p,timestamp:h}),acceptTerms:async()=>{let c=await t.acceptTerms();return d(c),c},getUsdTokenPrice:c=>t.getUsdTokenPrice(c),recoverEmbeddedEthereumWallet:async c=>new Promise(async(p,h)=>{let y=Se(c?.user??s)||Rl(c?.user??s),E=await Ae();if(!E||!L||!y){h(new Error("Must have valid access token and Privy wallet to recover wallet"));return}oe(!0);try{await L.connect({accessToken:E,address:y.address}),p(!0)}catch(O){if(ti(O)&&y.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:y.address}}),(await L.recover({address:y.address,accessToken:E,recoveryMethod:y.recoveryMethod})).address||h(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:y.address}}),p(!0);else if(ti(O)&&y.recoveryMethod!=="privy"){ne({recoverWallet:{privyWallet:y,onFailure:h,onSuccess:()=>p(!0)},recoveryOAuthStatus:{provider:y.recoveryMethod,action:"recover"}});let F=dc(y.recoveryMethod);ke(F)}else h(O)}}),embeddedSolanaWallet:u,createEmbeddedSolanaWallet:async()=>{oe(!0);let c=await Ae(),p=await re.refreshUser(),h=Kn(p),y=Se(p);if(!p||!c)throw new w("User must be logged in to create a Solana wallet");if(h)throw new w("User already has an embedded Solana wallet.");if(y)if(y.recoveryMethod==="privy")await re.recoverEmbeddedEthereumWallet({user:p});else throw new w("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");let E=await re.initializeWalletProxy(15e3);if(!E)throw new w("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await E.createSolana({accessToken:c,ethereumAddress:y?.address});let O=await re.refreshUser(),F=Kn(O);if(!F)throw new w("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:F.address}}),F}catch(O){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new w("Failed to create Solana embedded wallet with error ",O)}},exportSolanaWallet:c=>new Promise(async(p,h)=>{if(!a||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}let y=c?.address,E=s.linkedAccounts.filter(Z=>Z.type==="wallet"&&Z.walletClientType==="privy"&&Z.chainType==="solana"),O=y?E.find(Z=>Z.address.toLowerCase()===y.toLowerCase()):E.find(Z=>!Z.imported)||E[0];if(!O){h(new Error("Must have a Privy wallet before exporting"));return}if(oe(!0),!await Ae()||!L){h(new Error("Must have valid access token to enroll in MFA"));return}if(!L){h(new Error("Must have a Privy wallet before exporting"));return}await re.recoverEmbeddedSolanaWallet();let G={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:O,onSuccess:p,onFailure:h};ne({keyExport:G}),ke("EMBEDDED_WALLET_KEY_EXPORT_SCREEN")}),recoverEmbeddedSolanaWallet:async()=>new Promise(async(c,p)=>{let h=Kn(s),y=await Ae();if(!y||!L||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}oe(!0);try{await L.connectSolana({accessToken:y,publicKey:h.address}),c(!0)}catch(E){ti(E)&&h.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await L.recoverSolana({publicKey:h.address,accessToken:y})).publicKey||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:h.address}}),c(!0)):p(E)}}),getMoonpaySignedUrl:Je,initCoinbaseOnRamp:t.initCoinbaseOnRamp.bind(t),getCoinbaseOnRampStatus:t.getCoinbaseOnRampStatus.bind(t),setReadyToTrue:c=>{i(!0),me?.(c)},updateWallets:()=>wi(),fundWallet:async(c,p)=>{if(!I.fundingConfig||I.fundingConfig.methods.length===0)throw new Error("Wallet funding is not enabled");let h=Ad({fundingMethods:I.fundingConfig.methods});ne({funding:Mu({address:c,fundWalletConfig:p,methodScreen:h})}),ke(h)},requestFarcasterSignerStatus:async c=>{let p=await Ae(),h=s?.linkedAccounts.find(E=>E.type==="wallet"&&E.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!h)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");let y=await t.requestFarcasterSignerStatus(c);if(y.status==="approved"){let E=await t.getAuthenticatedUser();d(E||s||null)}return y},connectCoinbaseSmartWallet:async()=>{I.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let c=t.connectors?.findWalletConnector("coinbase_wallet","coinbase_smart_wallet")||t.connectors?.findWalletConnector("coinbase_wallet","coinbase_wallet");if(c)return c.updateConnectionPreference("smartWalletOnly"),kr(c);await Ft("coinbase_wallet","coinbase_smart_wallet")},setCustomMetadataForUser:async c=>{try{let p=await t.setCustomMetadata(c);return d(p),N(W,"setCustomMetadata","onSuccess",p),p}catch(p){throw N(W,"setCustomMetadata","onError",p.privyErrorCode||"unknown_auth_error"),p}}}))();N0=re.recoverEmbeddedEthereumWallet,O0=re.recoverEmbeddedSolanaWallet,D0=re.solanaSignMessage;let z0=tA(()=>({wallets:m,ready:gt&&se}),[m,gt,se]);return Rr(_e.Provider,{value:bi,children:Rr(hm.Provider,{value:W,children:Rr(bm.Provider,{value:z0,children:Rr(jf,{...I,children:M0(um.Provider,{value:re,children:[Rr(gm,{children:M0(zf,{data:Y,setModalData:ne,setInitialScreen:k,initialScreen:A,authenticated:a,open:r,children:[e.children,!I.headless&&I.captchaEnabled&&n&&!a&&Rr(Jd,{delayedExecution:!1}),Rr(d0,{theme:{...I.appearance.palette||{}}}),!I.render.standalone&&Rr(Su,{open:r})]})}),Le&&q?Rr(S0,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:Fe,mfaSubmitPromise:ze,onLoad:X,onLoadFailed:()=>null}):null,I.loginConfig.telegramAuthConfiguration&&Rr(to,{if:!0,children:Rr(b0,{scriptHost:e.apiUrl||Xs,botUsername:I.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};import{useCallback as U0,useEffect as dA}from"react";var pA=e=>{Oe("login",e);let t=Pe(),r=rl(),{initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:n,isHeadlessOAuthLoading:i,ready:a,user:l}=V(),s=U0(async m=>{if(t.enabled&&t.status!=="success")throw new yr(t.error,null,"captcha_failure");return o(m.provider,t.token)},[o,t]),d=U0(async()=>{let m=Va();if(l)return console.warn("Cannot login with OAuth when already logged in"),l;if(!m.inProgress)throw new Error("Cannot login with OAuth because no OAuth flow is in progress");if(!m.popupFlow)try{return await n(m)}catch(f){throw f}finally{qn()}},[n]);return dA(()=>{let m=Va();a&&r&&m.inProgress&&m.headless&&!m.popupFlow&&d()},[a,r]),{initOAuth:s,loginWithOAuth:d,loading:i}};import{useCallback as F0}from"react";var uA=()=>{let e=Pe(),{initLoginWithEmail:t,loginWithCode:r}=V(),o=F0(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=F0(async({code:i})=>{if(e.enabled&&e.status==="error")throw new yr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};import{useCallback as B0}from"react";var mA=()=>{let e=Pe(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=V(),n=B0(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=B0(async({code:a})=>{if(e.enabled&&e.status!=="success")throw new yr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:n,loginWithCode:i,state:o}};import{useCallback as H0}from"react";var fA=()=>{let e=Pe(),{generateSiweMessage:t,linkWithSiwe:r}=V(),o=H0(async({address:i,chainId:a})=>{if(!i||!a)throw new Error("wallet address and chainId required to generate nonce");return t({address:i,chainId:a}).then(l=>l)},[t]),n=H0(async({signature:i,message:a,chainId:l,walletClientType:s,connectorType:d})=>{if(e.enabled&&e.status!=="success")throw new yr(e.error,null,"captcha_failure");return r({message:a,signature:i,chainId:l,walletClientType:s,connectorType:d})},[r,e.status]);return{generateSiweMessage:o,linkWithSiwe:n}};import{useContext as hA}from"react";function yA(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:m,linkSpotify:f,linkInstagram:u,linkTelegram:g,linkFarcaster:v}=hA(_e);return Oe("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:m,linkSpotify:f,linkInstagram:u,linkFarcaster:v,linkTelegram:g}}import{useContext as gA}from"react";function CA(e){let{connectWallet:t}=gA(_e);return Oe("connectWallet",e),{connectWallet:t}}import{useContext as vA}from"react";function wA(e){let{createWallet:t}=vA(_e);return Oe("createWallet",e),{createWallet:t}}var bA=()=>{let{embeddedSolanaWallet:e,exportSolanaWallet:t,createEmbeddedSolanaWallet:r}=_();return{createWallet:r,exportWallet:t,wallets:e?[e]:[]}};var EA=()=>{let{connectCoinbaseSmartWallet:e}=_();return{connectCoinbaseSmartWallet:e}};var TA=()=>{let{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=V();return{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:n}};import{useContext as SA}from"react";function AA(e){let{sendTransaction:t}=SA(_e);return Oe("sendTransaction",e),{sendTransaction:t}}import{useContext as PA}from"react";function xA(e){let{setWalletPassword:t}=PA(_e);return Oe("setWalletPassword",e),{setWalletPassword:t}}import{useContext as RA}from"react";function kA(){let{createGuestAccount:e}=RA(_e);return{createGuestAccount:e}}import{useContext as _A}from"react";function MA(e){let{setWalletRecovery:t}=_A(_e);return Oe("setWalletRecovery",e),{setWalletRecovery:t}}import{useContext as IA}from"react";function WA(e){let{signMessage:t}=IA(_e);return Oe("signMessage",e),{signMessage:t}}import{useContext as LA}from"react";function NA(e){let{signTypedData:t}=LA(_e);return Oe("signTypedData",e),{signTypedData:t}}import{useContext as OA}from"react";var DA=()=>{let{isModalOpen:e}=OA(_e);return{isOpen:e}};import{useContext as UA}from"react";function FA(e){let{getAccessToken:t}=UA(_e);return Oe("accessToken",e),{getAccessToken:t}}function BA(e){let{authenticated:t,user:r}=V(),{initLoginWithOAuth:o}=_(),n=Pi();return Oe("oAuthAuthorization",e),{reauthorize:i=>HA(t,r,o,n,i.provider)}}var HA=async(e,t,r,o,n)=>{if(!e)throw o("linkAccount","onError","must_be_authenticated",{linkMethod:n}),new w("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some(a=>a.type.includes(n)))throw new w(`OAuth account of type ${n} not linked to the account.`);await r(n)};var VA=e=>{let{customAuthStatus:t}=_();return Oe("customAuth",e),{status:t}};var GA=V0;function V0(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=V();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}import{useContext as qA}from"react";function zA(e){let{setCustomMetadata:t}=qA(_e);return Oe("setCustomMetadata",e),{setCustomMetadata:t}}function KA(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}export{Co as AsExternalProvider,Jd as Captcha,Ka as ConnectorManager,Su as LoginModal,Ya as PrivyClient,lA as PrivyProvider,$e as PrivyProxyProvider,Hd as SUPPORTED_CHAINS,Ld as VERSION,rr as WalletConnector,$5 as addRpcUrlOverrideToChain,gp as errorIndicatesMaxMfaRetries,ri as errorIndicatesMfaTimeout,oi as errorIndicatesMfaVerificationFailed,Ae as getAccessToken,KA as getEmbeddedConnectedWallet,EA as useConnectCoinbaseSmartWallet,CA as useConnectWallet,wA as useCreateWallet,TA as useCrossAppAccounts,VA as useCustomAuth,GA as useExperimentalFarcasterSigner,V0 as useFarcasterSigner,Z0 as useFundWallet,kA as useGuestAccounts,yA as useLinkAccount,fA as useLinkWithSiwe,Q0 as useLogin,uA as useLoginWithEmail,pA as useLoginWithOAuth,mA as useLoginWithSms,X0 as useLogout,Ps as useMfa,so as useMfaEnrollment,DA as useModalStatus,BA as useOAuthTokens,V as usePrivy,jd as useRegisterMfaListener,AA as useSendTransaction,zA as useSetCustomMetadata,xA as useSetWalletPassword,MA as useSetWalletRecovery,WA as useSignMessage,NA as useSignTypedData,bA as useSolanaWallets,FA as useToken,Jr as useWallets};
3265
+ `;import{useRef as W0,useEffect as XS}from"react";import{jsx as JS}from"react/jsx-runtime";function ZS({botUsername:e,scriptHost:t}){let r=document.createElement("script"),{origin:o}=new URL(t);return r.async=!0,r.src=`${o}/js/telegram-login.js`,r.setAttribute("data-telegram-login",e),r.setAttribute("data-request-access","write"),r.setAttribute("data-lang","en"),r}function L0(e){let t=W0(null),r=W0();return XS(()=>{r.current?.remove(),r.current=ZS(e),t.current?.after(r.current)},[e]),JS("div",{ref:t,hidden:!0})}import{useState as jS}from"react";import{useEffect as N0,useRef as O0}from"react";var Ud=class{constructor(){this.callbacks={}}enqueue(t,r){this.callbacks[t]=r}dequeue(t,r){let o=this.callbacks[r];if(!o)throw new Error(`cannot dequeue ${t} event: no event found for id ${r}`);switch(delete this.callbacks[r],t){case"privy:iframe:ready":return o;case"privy:wallet:create":return o;case"privy:wallet:create-additional":return o;case"privy:wallet:import":return o;case"privy:wallet:connect":return o;case"privy:wallet:recover":return o;case"privy:wallet:rpc":return o;case"privy:wallet:set-recovery":return o;case"privy:mfa:verify":return o;case"privy:mfa:init-enrollment":return o;case"privy:mfa:submit-enrollment":return o;case"privy:mfa:unenroll":return o;case"privy:mfa:clear":return o;case"privy:farcaster:init-signer":return o;case"privy:farcaster:sign":return o;case"privy:solana-wallet:create":return o;case"privy:solana-wallet:connect":return o;case"privy:solana-wallet:recover":return o;case"privy:solana-wallet:rpc":return o;default:throw new Error(`invalid wallet event type ${t}`)}}};async function Un(e,t,r,o,n,i=!1){let a=i,l=async u=>{if(a&&t&&t.length>0){u===(i?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new De("missing_or_invalid_mfa","MFA verification failed, retry."));let m=await new Promise((f,y)=>{r.current={resolve:f,reject:y};let b=1e3*60*5;setTimeout(()=>{let C=new De("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(C),y(C)},b)});return await e(m)}return await e()},s=4,d=null;for(let u=0;u<s;u++)try{d=await l(u),o.current?.resolve(void 0);break}catch(m){if(m.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),m}if(d===null){let u=new De("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(u),u}return d}import{jsx as nA}from"react/jsx-runtime";var $S=function(e){return()=>`id-${e++}`}(0);function eA(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function ft(e){return e.error!==void 0}var pt=new Ud,Uu=new Map,tA=(e,t)=>typeof t=="bigint"?t.toString():t,rA=(e,t)=>`${e}${JSON.stringify(t,tA)}`;function ht(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=rA(e,t);if(e==="privy:wallet:create"){let l=Uu.get(i);if(l)return l}let a=new Promise((l,s)=>{let d=$S();pt.enqueue(d,{resolve:l,reject:s}),n.postMessage({id:d,event:e,data:t},o)}).finally(()=>{Uu.delete(i)});return Uu.set(i,a),a}function oA(e){switch(e.event){case"privy:iframe:ready":let t=pt.dequeue(e.event,e.id);return ft(e)?t.reject(new De(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=pt.dequeue(e.event,e.id);return ft(e)?r.reject(new De(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:create-additional":let o=pt.dequeue(e.event,e.id);return ft(e)?o.reject(new De(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:import":let n=pt.dequeue(e.event,e.id);return ft(e)?n.reject(new De(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:connect":let i=pt.dequeue(e.event,e.id);return ft(e)?i.reject(new De(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:recover":let a=pt.dequeue(e.event,e.id);return ft(e)?a.reject(new De(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:rpc":let l=pt.dequeue(e.event,e.id);return ft(e)?l.reject(new De(e.error.type,e.error.message)):l.resolve(e.data);case"privy:wallet:set-recovery":let s=pt.dequeue(e.event,e.id);return ft(e)?s.reject(new De(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:verify":let d=pt.dequeue(e.event,e.id);return ft(e)?d.reject(new De(e.error.type,e.error.message)):d.resolve(e.data);case"privy:mfa:init-enrollment":{let y=pt.dequeue(e.event,e.id);return ft(e)?y.reject(new De(e.error.type,e.error.message)):y.resolve(e.data)}case"privy:mfa:submit-enrollment":{let y=pt.dequeue(e.event,e.id);return ft(e)?y.reject(new De(e.error.type,e.error.message)):y.resolve(e.data)}case"privy:mfa:unenroll":{let y=pt.dequeue(e.event,e.id);return ft(e)?y.reject(new De(e.error.type,e.error.message)):y.resolve(e.data)}case"privy:mfa:clear":{let y=pt.dequeue(e.event,e.id);return ft(e)?y.reject(new De(e.error.type,e.error.message)):y.resolve(e.data)}case"privy:farcaster:init-signer":{let y=pt.dequeue(e.event,e.id);return ft(e)?y.reject(new De(e.error.type,e.error.message)):y.resolve(e.data)}case"privy:farcaster:sign":{let y=pt.dequeue(e.event,e.id);return ft(e)?y.reject(new De(e.error.type,e.error.message)):y.resolve(e.data)}case"privy:solana-wallet:create":let u=pt.dequeue(e.event,e.id);return ft(e)?u.reject(new De(e.error.type,e.error.message)):u.resolve(e.data);case"privy:solana-wallet:connect":let m=pt.dequeue(e.event,e.id);return ft(e)?m.reject(new De(e.error.type,e.error.message)):m.resolve(e.data);case"privy:solana-wallet:recover":let f=pt.dequeue(e.event,e.id);return ft(e)?f.reject(new De(e.error.type,e.error.message)):f.resolve(e.data);case"privy:solana-wallet:rpc":{let y=pt.dequeue(e.event,e.id);return ft(e)?y.reject(new De(e.error.type,e.error.message)):y.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function D0(e){let t=O0(null),r=O0(e.mfaMethods),o=Li(),[n,i]=jS(!1);return N0(()=>{r.current=e.mfaMethods},[e.mfaMethods]),N0(()=>{if(!n)return;let a=t.current;if(!a)return;function l(f){f&&f.origin===e.origin&&eA(f.data)&&oA(f.data)}let s={create(f){return ht("privy:wallet:create",f,a,e.origin)},createAdditional(f){return ht("privy:wallet:create-additional",f,a,e.origin)},import(f){return ht("privy:wallet:import",f,a,e.origin)},connect(f){return ht("privy:wallet:connect",f,a,e.origin)},recover(f){return Un(y=>ht("privy:wallet:recover",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!f.recoveryMethod||f.recoveryMethod==="privy")},rpc(f){return Un(y=>ht("privy:wallet:rpc",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(f){return ht("privy:solana-wallet:create",f,a,e.origin)},connectSolana(f){return ht("privy:solana-wallet:connect",f,a,e.origin)},recoverSolana(f){return ht("privy:solana-wallet:recover",f,a,e.origin)},rpcSolana(f){return ht("privy:solana-wallet:rpc",f,a,e.origin)},setRecovery(f){return Un(y=>ht("privy:wallet:set-recovery",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(f){return Un(y=>ht("privy:mfa:verify",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(f){return Un(y=>ht("privy:mfa:init-enrollment",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(f){return Un(y=>ht("privy:mfa:submit-enrollment",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(f){return Un(y=>ht("privy:mfa:unenroll",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(f){return ht("privy:mfa:clear",f,a,e.origin)},initFarcasterSigner(f){return ht("privy:farcaster:init-signer",f,a,e.origin)},signFarcasterMessage(f){return ht("privy:farcaster:sign",f,a,e.origin)}};window.addEventListener("message",l);let d=()=>e.onLoad(s),u=(...f)=>{console.warn("Privy iframe failed to load: ",...f),e.onLoadFailed()},m=new AbortController;return Da(()=>ht("privy:iframe:ready",{},a,e.origin),{abortSignal:m.signal}).then(d,u),()=>{window.removeEventListener("message",l),m.abort()}},[n]),nA("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:$s(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var Fd=class{constructor(t,r){this.walletProxy=t,this.address=r}async handleSignMessage(t){if(!t.params||typeof t.params.message!="string")throw new Error("Message must be provided as a string for Solana signMessage RPC");return await F0({message:t.params.message})}async request(t){if(console.debug("EmbeddedSolanaProvider.request() called with args",t),!await we())throw new Error("User must be authenticated to use embedded Solana wallet");if(!await U0())throw new v("Unable to connect to Solana embedded wallet");switch(t.method){case"signMessage":return await this.handleSignMessage(t);default:throw new Error("Embedded Solana provider does not yet support this RPC method.")}}};async function B0({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{let a=setTimeout(()=>{n(new v("Authorization request timed out after 2 minutes.")),l()},12e4);function l(){t?.close(),window.removeEventListener("message",u)}let s,d=setInterval(()=>{t?.closed&&!s&&(l(),clearInterval(d),clearTimeout(a),n(new v("User rejected request")))},300);function u(m){m.data&&(m.data.type==="PRIVY_OAUTH_RESPONSE"&&m.data.stateCode&&m.data.authorizationCode&&(clearTimeout(a),o(m.data),l()),m.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(a),n(new v(m.data.error)),l()),m.data.type==="PRIVY_OAUTH_USE_BROADCAST_CHANNEL"&&(s=new BroadcastChannel("popup-privy-oauth"),s.onmessage=u))}window.addEventListener("message",u)})}var iA="https://cdn.apple-cloudkit.com";async function Fu({url:e,popup:t,provider:r}){return t.location=e,new Promise((n,i)=>{function a(){t?.close(),window.removeEventListener("message",l)}function l(s){s.data&&(s.data.type==="PRIVY_OAUTH_RESPONSE"&&s.data.stateCode&&s.data.authorizationCode&&(n(s.data),a()),s.origin===iA&&s.data.ckSession&&(n({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:s.data.ckSession}),a()),s.data.type==="PRIVY_OAUTH_ERROR"&&(i(s.data.error),a()))}window.addEventListener("message",l)})}var H0=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});import{jsx as Pr,jsxs as V0}from"react/jsx-runtime";var tn;function uA(e){return typeof e=="string"&&e.length===25}function we(){if(!tn){let e=X.get(qn);return Promise.resolve(e||null)}return tn.getAccessToken()}var G0,Yf=(e,t,r)=>G0(e,t,r),q0,Qf=(e,t,r)=>q0(e,t,r),z0,Xf=(e,t,r,o)=>z0(e,t,r,o),K0,Zf=()=>K0(),Y0,U0=()=>Y0(),Q0,F0=({message:e})=>Q0({message:e}),mA=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;X.put(Fa,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},fA=({config:e,...t})=>{if(typeof window<"u"&&["localhost","127.0.0.1"].indexOf(window.location.hostname)<0&&window.location.protocol!=="https:")throw new v("Embedded wallet is only available over HTTPS");if(!uA(t.appId))throw new v("Cannot initialize the Privy provider with an invalid Privy app ID");tn||(tn=new $a({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl}));let r=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&r.embeddedWallets?.createOnLogin===void 0&&(r.embeddedWallets||(r.embeddedWallets={}),r.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),Pr(Tm,{client:tn,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:Pr(hA,{...t,client:tn})})},hA=e=>{let t=e.client,[r,o]=ut(!1),[n,i]=ut(!1),[a,l]=ut(!1),[s,d]=ut(null),[u,m]=ut([]),[f,y]=ut(null),b=Na(u),[C,w]=ut(!1),[A,k]=ut(null),[T,P]=ut(!1),[S,M]=ut({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:mt}),[N,H]=ut({status:"initial"}),[x,K]=ut(null),W=Ne(),Q=sl(),[pe,q]=ut(!0),[ue,Z]=ut({}),[ae,se]=ut(null),[We,Ee]=ut(null),[ge,le]=ut(!1),[Ze,at]=ut(!1),[ce,tt]=ut(W.customAuth?.enabled?{status:"initial"}:{status:"not-enabled"}),Dt=Na(null),Yr=Na(null),L=Na(Pm),[Re,ze]=ut(!1);t.onStoreToken=c=>{c&&D(L,"accessToken","onAccessTokenGranted",c)},t.onDeleteToken=()=>{d(null),l(!1),D(L,"accessToken","onAccessTokenRemoved")};let U=Na(null),Y=Na(null),j=c=>{k(c),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:c}})},Fe=c=>{W.embeddedWallets.createOnLogin!=="off"&&q(!0),j(c)};co(()=>{let c=$n(s);if(!c||!x){y(null);return}let p={address:c.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:Wi,id:"io.privy.solana.wallet"},getProvider:async()=>new Fd(x,c.address)};y(p)},[x,s]),co(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnectors();return}let c=Me(s),p=tp(s),h=Ll(s);if((!c||!p.length)&&t.connectors?.removeEmbeddedWalletConnectors(),h||t.connectors?.removeImportedWalletConnector(),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!x){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}c&&t.connectors.addEmbeddedWalletConnectors({walletProxy:x,rootWallet:c,embeddedWallets:p,defaultChain:W.defaultChain,appId:e.appId}),h&&t.connectors.addImportedWalletConnector(x,h.address,W.defaultChain,e.appId)},[x,s]),co(()=>{x&&We?.(x)},[x]),co(()=>{(async()=>{if(!W.customAuth?.enabled){tt({status:"not-enabled"});return}q(!0),tt({status:"loading"});let{getCustomAccessToken:p,isLoading:h}=W.customAuth;if(!(!n||h))try{let g=await p();if(!g&&a){await ki.logout(),tt({status:"done"}),D(L,"customAuth","onUnauthenticated");return}if(!g){tt({status:"done"});return}if(a){tt({status:"done"});return}t.startAuthFlow(new Ui(g));let{user:E,isNewUser:O}=await t.authenticate();if(!E){await ki.logout(),tt({status:"error",error:new v("Failed to sync with custom auth provider")}),D(L,"customAuth","onUnauthenticated");return}O!==void 0&&D(L,"login","onComplete",E,O,!1,"custom",null),D(L,"customAuth","onAuthenticated",{user:E}),tt({status:"done"}),d(E||null),w(O||!1),l(!0),at(!0)}catch(g){throw console.warn(g),a&&(await ki.logout(),D(L,"customAuth","onUnauthenticated")),D(L,"login","onError",g.privyErrorCode||"unknown_auth_error"),tt({status:"error",error:g}),g}})()},[W.customAuth?.enabled,W.customAuth?.getCustomAccessToken,W.customAuth?.isLoading,n,a]),co(()=>{Ze&&x&&s&&bt(s,W.embeddedWallets.createOnLogin)&&(at(!1),Ke(s,Ii).catch(console.error))},[Ze&&x&&s]),co(()=>{async function c(){let p=Oo(),h=Fn();mA();let g=aA();t.initializeConnectorManager({walletConnectCloudProjectId:W.walletConnectCloudProjectId,rpcConfig:W.rpcConfig,chains:W.chains,defaultChain:W.defaultChain,store:g,walletList:W.appearance.walletList,shouldEnforceDefaultChainOnConnect:W.shouldEnforceDefaultChainOnConnect,externalWalletConfig:W.externalWallets,appName:W.name??"Privy"});let E;t.connectors?.on("connectorInitialized",()=>{E&&clearTimeout(E);let G=t.connectors.walletConnectors.length,ne=t.connectors.walletConnectors.reduce((de,Ae)=>de+(Ae.initialized?1:0),0);ne===G?ze(!0):E=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:ne,expected:G}),ze(!0)},1500)}),t.connectors?.initialize().then(()=>{Yt()});let O=await t.getAuthenticatedUser(),z=!!O;if(W.customAuth?.enabled||(l(!!O),O&&D(L,"login","onComplete",O,!1,!0,null,null),d(O)),p){Y.current=z?"link":"login";return}if(h&&!z){Y.current="login",Fe("TELEGRAM_AUTH_SCREEN");return}te.setReadyToTrue(!!O)}!n&&Q&&c()},[t,ae,n,Q]),co(()=>{if(!n)return;if(!s){le(!0);return}if(!!!s.linkedAccounts.find(h=>h.type==="wallet"&&h.walletClientType==="privy")){le(!0);return}let p=!!u.find(h=>h.walletClientType==="privy");le(p)},[n,s,u]);let Oo=()=>{let c=Qa();if(c.inProgress&&c.popupFlow){if(window.opener.location.origin!==window.location.origin){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."});return}if(c.authorizationCode==="error"){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:c.stateCode,authorizationCode:c.authorizationCode});return}let p="privy:";function h(g){return g.startsWith(p)}return c.inProgress&&h(c.provider)&&!c.popupFlow&&(new BroadcastChannel("popup-privy-oauth").postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:c.stateCode,authorizationCode:c.authorizationCode}),window.close()),!c.inProgress||c.headless?!1:(t.startAuthFlow(new go(c)),Fe("AWAITING_OAUTH_SCREEN"),!0)},Fn=()=>{let c=Gf();if(!c||!W.loginMethods.telegram||!W.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let p=new Vi;return t.startAuthFlow(p),c.flowType==="login-url"&&(p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult={id:c.id,first_name:c.first_name,last_name:c.last_name,auth_date:c.auth_date,username:c.username,photo_url:c.photo_url,hash:c.hash}),c.flowType==="web-app"&&(p.meta.telegramAuthResult=void 0,p.meta.telegramWebAppData={query_id:c.query_id,user:c.user,auth_date:c.auth_date,hash:c.hash,chat_instance:c.chat_instance,chat_type:c.chat_type,start_param:c.start_param}),!0},Bn=async(c,p,h,g)=>{let E=await t.connectors?.createWalletConnector(c,p)||null;Ri(E,p,h,g)};async function Ri(c,p,h,g){if(c)M({status:"disconnected",connectedWallet:null,connectError:null,connector:c,connectRetry:mt});else return M({status:"disconnected",connectedWallet:null,connectError:new _e("Unable to connect to wallet."),connector:null,connectRetry:mt}),g?.(null,h);c instanceof jr&&p&&await c.resetConnection(p),M({connector:c,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Ri(c,p,h,g)});try{let E=await c.connect({showPrompt:!0});if(W.shouldEnforceDefaultChainOnConnect&&!W.chains.find(O=>O.id===Number(E?.chainId.replace("eip155:","")))&&!(E?.connectorType==="wallet_connect_v2"&&E?.walletClientType==="metamask")){M(O=>({...O,connector:c,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:mt}));try{await E?.switchChain(W.defaultChain.id),E&&(E.chainId=Mi(Gn(W.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${W.defaultChain.id}`)}}return M(O=>({...O,status:"connected",connectedWallet:E,connectError:null,connectRetry:mt})),E&&D(L,"connectWallet","onSuccess",E),g?.(E,h)}catch(E){return E instanceof Jt?(console.warn(E.cause?E.cause:E.message),D(L,"connectWallet","onError",E.privyErrorCode||"generic_connect_wallet_error")):(console.warn(E),D(L,"connectWallet","onError","unknown_connect_wallet_error")),M(O=>({...O,status:"disconnected",connectedWallet:null,connectError:E})),g?.(null,h)}}let Qr=async(c,p,h)=>{if(c===null)return;let g=new Go(c,t,p,h);t.startAuthFlow(g)},Yt=()=>{let c=new URLSearchParams(window.location.search),p=c.get("privy_connector"),h=c.get("privy_wallet_client");if(!p||!h)return;if(h==="phantom"&&!on()&&Fe("LOGIN_FAILED_SCREEN"),!t.connectors)throw new v("Connector not initialized");j("AWAITING_CONNECTION");let g=new URL(window.location.href);g.searchParams.delete("privy_connector"),g.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",g),Bn(p,h,void 0,Qr)};co(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(d)},[n,a,s,t]);let Be=c=>{if(!a)throw D(L,"linkAccount","onError","must_be_authenticated",{linkMethod:c}),new v("User must be authenticated before linking an account.")},po=()=>{Be("siwe"),U.current="siwe",Y.current="link",j("LINK_WALLET_SCREEN")},Do=c=>{if(!a||!s)return!1;if(c.walletClientType==="privy")return!0;for(let p of s.linkedAccounts)if(p.type==="wallet"&&p.address===c.address&&p.walletClientType!=="privy")return!0;return!1},Qt=async c=>{if(!t.connectors)throw new v("Connector not initialized");let p=t.connectors.findWalletConnector(c.connectorType,c.walletClientType)||null;if(M(h=>({...h,connector:p,status:"connected",connectedWallet:c,connectError:null,connectRetry:mt})),W.captchaEnabled&&!a){let h={callback:g=>Qr(c,g),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};Z({captchaModalData:h}),Fe("CAPTCHA_SCREEN")}else await Qr(c),Fe("AWAITING_CONNECTION")},uo=async(c,p)=>{let{signedUrl:h,externalTransactionId:g}=await x1(t,c,p??{},W.appearance.palette,W.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:h,externalTransactionId:g}},Uo=()=>{m(c=>{let p=t.connectors?.wallets.map(h=>({...h,linked:Do(h),loginOrLink:async()=>{if(!await h.isConnected())throw new v("Wallet is not connected");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new v("Cannot link or login with embedded wallet");Qt(h)},fund:async g=>{await te.fundWallet(h.address,g)},unlink:async()=>{if(!a)throw new v("User is not authenticated.");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new v("Cannot unlink an embedded wallet");let g=await t.unlinkWallet(h.address);d(g)}}))||[];return Ol(c,p)?c:p})};co(()=>{Uo()},[s?.linkedAccounts,a,n]),co(()=>{if(n){if(!t.connectors)throw new v("Connector not initialized");Uo(),t.connectors.on("walletsUpdated",Uo)}},[n]);let Hn=c=>{c&&"target"in c&&c&&(c=void 0),Z({externalConnectWallet:{walletList:c?.walletList&&c?.walletList.length>0?c.walletList:void 0,suggestedAddress:c?.suggestedAddress}}),j(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};co(()=>{if(!u[0])return;let c=u[0],p=b.current.find(g=>g.address===c.address),h;if(c.walletClientType==="privy"?h=s?.linkedAccounts.find(g=>g.type==="wallet"&&g.address===c.address&&g.walletClientType==="privy"):h=s?.linkedAccounts.find(g=>g.type==="wallet"&&g.address===c.address&&g.walletClientType!=="privy"),!p&&h){let g=Object.assign({},s);g.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported,walletIndex:h.walletIndex},d(g)}b.current=u},[u]);let Ke=async(c,p,h)=>{let g=Me(c);if(g&&!h?.createAdditional)throw D(L,"createWallet","onError","embedded_wallet_already_exists"),new Error("User already has an embedded wallet.");let[E,O]=await Promise.all([te.initializeWalletProxy(p),we()]);if(!E&&W.customAuth?.enabled)throw D(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!E||!O||W.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((z,G)=>{q(!0),Z({createWallet:{onSuccess:de=>{D(L,"createWallet","onSuccess",de),z(de)},onFailure:de=>{D(L,"createWallet","onError","unknown_embedded_wallet_error"),G(de)},callAuthOnSuccessOnClose:!1}}),j("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{if(!g)await E.create({accessToken:O});else{let ne=tp(c),Ae=(ne?.length?Math.max(...ne.map(ke=>ke.walletIndex)):g.walletIndex)+1;await te.recoverEmbeddedEthereumWallet(),await E.createAdditional({accessToken:O,primaryWalletAddress:g?.address,hdWalletIndex:Ae})}let z=await te.refreshUser(),G=Me(z);if(!G)throw D(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return D(L,"createWallet","onSuccess",G),G}},Bd=c=>{if(!W.chains.map(p=>p.id).includes(c))throw new _e(`Chain ID ${c} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},Hu=(c,p,h,g)=>new Promise(async(E,O)=>{let{requesterAppId:z}=p||{};if(!a||!s){D(L,"sendTransaction","onError","must_be_authenticated"),O(new Error("User must be authenticated before signing with a Privy wallet"));return}let G=g??Me(s)?.address;if(!G)throw new v("User must have an embedded wallet to send a transaction.");let{signingWallet:ne,rootWallet:de}=Nl(s,G);if(!de||!ne){D(L,"sendTransaction","onError","embedded_wallet_not_found"),O(new Error("Must have a Privy wallet before signing"));return}q(!0);let Ae=qu.wallets.find(Zt=>Zt.walletClientType==="privy"&&xi(Zt.address)===xi(ne.address)),ke=await Ae?.getEthereumProvider();if(!Ae||!ke)throw new v(`Cannot sendTransaction before embedded wallet ${ne.address} is connected`);let rn=c.chainId?Number(c.chainId):Ld(Ae.chainId);Bd(rn);let xr=Object.assign({},c,{chainId:rn}),Rr=async()=>{let Zt=await we();if(!Zt||!x){D(L,"sendTransaction","onError","embedded_wallet_not_found"),O(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await te.recoverEmbeddedEthereumWallet()){D(L,"sendTransaction","onError","unknown_connect_wallet_error"),O(new Error("Unable to connect to wallet"));return}let _i=_r(xr.chainId,W.chains,W.rpcConfig,{appId:e.appId}),mo=await pA(ne.address,xr,_i);if(W.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:eC}=await dA(mo,_i),{hasSufficientFunds:tC}=await Id(ne.address,mo,eC,_i);if(!tC)throw new Et(new Nr("Wallet has insufficient funds for this transaction.",cA.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let zu=await Md({accessToken:Zt,rootWallet:de,transactingWallet:ne,walletProxy:x,transactionRequest:mo,provider:_i,requesterAppId:z});D(L,"sendTransaction","onSuccess",zu),E(zu)}catch(Xs){D(L,"sendTransaction","onError","transaction_failure"),O(Xs)}};if(W.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),Rr();else{let Zt={transactionRequest:xr,transactingWallet:ne,rootWallet:de,onSuccess:mo=>{D(L,"sendTransaction","onSuccess",mo),E(mo)},onFailure:mo=>{D(L,"sendTransaction","onError","transaction_failure"),O(mo)},uiOptions:p||{},fundWalletConfig:h,requesterAppId:z},Xs={address:de.address,onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:mo=>{D(L,"sendTransaction","onError","unknown_connect_wallet_error"),O(mo)}},_i=Pu({address:ne.address,appConfig:W,fundWalletConfig:h,chainIdOverride:xr.chainId,comingFromSendTransactionScreen:!0});Z({connectWallet:Xs,sendTransaction:Zt,funding:_i}),j("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function Vu(){return new Promise(async(c,p)=>{let h=await we();if(!h||!x)throw new Error("Must have valid access token to enroll in MFA");try{await x.verifyMfa({accessToken:h}),c()}catch(g){p(g)}})}let Ys=c=>c?.linkedAccounts.filter(p=>p.latestVerifiedAt!==null&&!(p.type==="wallet"&&p.walletClientType==="privy")).sort((p,h)=>h.latestVerifiedAt.getTime()-p.latestVerifiedAt.getTime())[0],Xt=c=>{let p=s?.linkedAccounts.filter(E=>E.type===c).length??0,{displayName:h,loginMethod:g}=Pn(c);if(c==="passkey"&&p>=5||c!=="passkey"&&p>=1)throw D(L,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:g}),new v(`User already has an account of type ${h} linked.`)};async function Gu({showAutomaticRecovery:c=!1,legacySetWalletPasswordFlow:p=!1}){k(null);let h=p?"setWalletPassword":"setWalletRecovery";if(!a||!s)throw D(L,h,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let g=Me(s);if(!g||!x)throw D(L,h,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if($n(s))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await Vu()}catch(O){throw D(L,h,"onError","missing_or_invalid_mfa"),O}return new Promise((O,z)=>{q(!0);let G={onSuccess:ke=>{D(L,h,"onSuccess","user-passcode",ke),O(ke)},onFailure:ke=>{D(L,h,"onError","user_exited_set_password_flow"),z(ke)},callAuthOnSuccessOnClose:!1},ne=g.recoveryMethod==="user-passcode",Ae={onCompleteNavigateTo:yc({walletAction:"update",availableRecoveryMethods:W.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:p,isResettingPassword:ne,showAutomaticRecovery:c}),shouldForceMFA:!1,onFailure:ke=>{D(L,h,"onError","unknown_connect_wallet_error"),z(ke)}};Z({setWalletPassword:G,createWallet:G,connectWallet:Ae,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:ne}}),j("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function Qs({appId:c,action:p}){let h=await we();if(p==="link"&&!h)throw D(L,"linkAccount","onError","must_be_authenticated",{linkMethod:`privy:${c}`}),new v("User must be authenticated before linking an account.");if(p==="login"&&h)throw D(L,"login","onError","unknown_auth_error"),new v("Attempted to log in, but user is already logged in. Use a `link` helper instead.");U.current=`privy:${c}`,Y.current=p;let g=window.open(void 0,void 0,Ss({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:c}}),new Promise(async(E,O)=>{let{name:z,logoUrl:G}=await Gc({api:t.api,providerAppId:c,requesterAppId:W.id});Z({crossAppAuth:{appId:c,name:z,logoUrl:G,action:p,popup:g,onSuccess:E,onError:O}}),Fe("CROSS_APP_AUTH_SCREEN")})}let ki={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:Hn,importWallet:async({privateKey:c})=>{Be("siwe");let[p,h]=await Promise.all([te.initializeWalletProxy(15e3),we()]);if(p&&h){await p.import({privateKey:c,accessToken:h});let g=await te.refreshUser(),E=Ll(g);if(!E)throw D(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return D(L,"createWallet","onSuccess",E),E}else throw new v("User is not authenticated")},linkWallet:po,startCrossAppAuthFlow:Qs,linkEmail:()=>{Be("email"),Xt("email"),U.current="email",Y.current="link",j("LINK_EMAIL_SCREEN")},linkPhone:()=>{Be("sms"),Xt("phone"),U.current="sms",Y.current="link",j("LINK_PHONE_SCREEN")},linkGoogle:async()=>{Be("google"),Xt("google_oauth"),Y.current="link",await te.initLoginWithOAuth("google")},linkTwitter:async()=>{Be("twitter"),Xt("twitter_oauth"),Y.current="link",await te.initLoginWithOAuth("twitter")},linkDiscord:async()=>{Be("discord"),Xt("discord_oauth"),Y.current="link",await te.initLoginWithOAuth("discord")},linkGithub:async()=>{Be("github"),Xt("github_oauth"),Y.current="link",await te.initLoginWithOAuth("github")},linkSpotify:async()=>{Be("spotify"),Xt("spotify_oauth"),Y.current="link",await te.initLoginWithOAuth("spotify")},linkInstagram:async()=>{Be("instagram"),Xt("instagram_oauth"),Y.current="link",await te.initLoginWithOAuth("instagram")},linkTiktok:async()=>{Be("tiktok"),Xt("tiktok_oauth"),Y.current="link",await te.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{Be("linkedin"),Xt("linkedin_oauth"),Y.current="link",await te.initLoginWithOAuth("linkedin")},linkApple:async()=>{Be("apple"),Xt("apple_oauth"),Y.current="link",await te.initLoginWithOAuth("apple")},linkPasskey:async()=>{Be("passkey"),Xt("passkey"),await te.initLinkWithPasskey(),j("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{Be("telegram"),Xt("telegram"),Y.current="link",U.current="telegram",await te.initLoginWithTelegram(),j("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{Be("farcaster"),Xt("farcaster"),await te.initLoginWithFarcaster(),Y.current="link",U.current="farcaster",j("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(Be("email"),!s?.email)throw new v("User does not have an email linked to their account.");Y.current="link",U.current="email",j("UPDATE_EMAIL_SCREEN")},updatePhone:()=>{if(Be("sms"),!s?.phone)throw new v("User does not have a phone number linked to their account.");Y.current="link",U.current="sms",j("UPDATE_PHONE_SCREEN")},login:async c=>{c&&"target"in c&&c&&(c=void 0);let p="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!n){let h=await new Promise(g=>{se(E=>g.bind(E))});if(se(null),h){console.warn(p);return}}if(s&&!s.isGuest){console.warn(p);return}Y.current="login",Z({login:c}),Fe("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(c=>{se(()=>c)}),se(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}Fe("CONNECT_OR_CREATE")},logout:async()=>{if(s&&t.clearProviderAcccessTokens(s),k(null),await t.logout(),s&&x)try{await x.clearMfa({userId:s.id})}catch{}d(null),l(!1),D(L,"logout","onSuccess"),Y.current=null,U.current=null,o(!1),X.del(Ba),X.del(ol(W.id))},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new $e;let c=u.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(g=>g.address===c?.address));return!c||!p?new $e:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new Bu(new vo(new $e));let c=u.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(g=>g.address===c?.address));return!c||!p?new Bu(new vo(new $e)):new Bu(new vo(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new ln(new $e);let c=u.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(g=>g.address===c?.address));return!c||!p?new ln(new $e):new ln(p.proxyProvider)},unlinkWallet:async c=>{let p=await t.unlinkWallet(c);return d(p),p},unlinkEmail:async c=>{let p=await t.unlinkEmail(c);return d(p),p},unlinkPhone:async c=>{let p=await t.unlinkPhone(c);return d(p),p},unlinkGoogle:async c=>{let p=await t.unlinkOAuth("google",c);return d(p),p},unlinkTwitter:async c=>{let p=await t.unlinkOAuth("twitter",c);return d(p),p},unlinkDiscord:async c=>{let p=await t.unlinkOAuth("discord",c);return d(p),p},unlinkGithub:async c=>{let p=await t.unlinkOAuth("github",c);return d(p),p},unlinkSpotify:async c=>{let p=await t.unlinkOAuth("spotify",c);return d(p),p},unlinkInstagram:async c=>{let p=await t.unlinkOAuth("instagram",c);return d(p),p},unlinkTiktok:async c=>{let p=await t.unlinkOAuth("tiktok",c);return d(p),p},unlinkLinkedIn:async c=>{let p=await t.unlinkOAuth("linkedin",c);return d(p),p},unlinkApple:async c=>{let p=await t.unlinkOAuth("apple",c);return d(p),p},unlinkFarcaster:async c=>{let p=await t.unlinkFarcaster(c);return d(p),p},unlinkTelegram:async c=>{let p=await t.unlinkTelegram(c);return d(p),p},unlinkPasskey:async c=>{let p=await t.unlinkPasskey(c);return d(p),p},unlinkCrossAppAccount:async({subject:c})=>{let p=s?.linkedAccounts.find(g=>g.type==="cross_app"&&g.subject===c)?.providerApp;if(!p)throw new v("Invalid subject");t.storeProviderAccessToken(p.id,null);let h=await t.unlinkOAuth(`privy:${p.id}`,c);return d(h),h},setActiveWallet:async c=>{let p=u.find(g=>xi(g.address)===xi(c)),h=s?.linkedAccounts.find(g=>g.type==="wallet"&&xi(g.address)===xi(c));if(!p||!await p.isConnected())Z({externalConnectWallet:{suggestedAddress:c}}),po();else if(!p.linked)p.loginOrLink();else{let g=Object.assign({},s);g.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported,walletIndex:h.walletIndex},d(g)}},forkSession:()=>t.forkSession(),createWallet:async c=>{if(c&&"target"in c&&c&&(c=void 0),!a||!s)throw D(L,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return Ke(s,15e3,c)},setWalletRecovery:async c=>Gu({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:c?.showAutomaticRecovery??!1}),setWalletPassword:async()=>Gu({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(c,p,h)=>new Promise(async(g,E)=>{let{requesterAppId:O}=p||{};if(!a||!s){D(L,"signMessage","onError","must_be_authenticated"),E(new Error("User must be authenticated before signing with a Privy wallet"));return}let z=h??Me(s)?.address;if(!z)throw new v("User must have an embedded wallet to sign a message.");let{signingWallet:G,rootWallet:ne}=Nl(s,z);if(!G||!ne){D(L,"signMessage","onError","embedded_wallet_not_found"),E(new Error("Must have a Privy wallet before signing"));return}if(typeof c!="string"||c.length<1){D(L,"signMessage","onError","invalid_message"),E(new Error("Message must be a non-empty string"));return}q(!0);let de=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Ae=await we();if(!x||!Ae)throw new Error("Unable to connect to wallet");if(!await te.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:G.address,requesterAppId:O}});let{response:rn}=await x.rpc({accessToken:Ae,address:ne.address,hdWalletIndex:G.walletIndex??void 0,requesterAppId:O,request:{method:"personal_sign",params:[c,G.address]}}),xr=rn.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:G.address,requesterAppId:O}}),xr};if(W.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Ae=await de();D(L,"signMessage","onSuccess",Ae),g(Ae)}catch(Ae){D(L,"signMessage","onError","unable_to_sign"),E(Ae??new Et("Unable to sign message"))}}else{let rn={method:"personal_sign",data:c,confirmAndSign:de,onSuccess:Rr=>{D(L,"signMessage","onSuccess",Rr),g(Rr)},onFailure:Rr=>{D(L,"signMessage","onError","unable_to_sign"),E(Rr)},uiOptions:p||{}},xr={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Rr=>{D(L,"signMessage","onError","unknown_connect_wallet_error"),E(Rr)},address:ne.address};Z({signMessage:rn,connectWallet:xr}),j("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(c,p,h)=>new Promise(async(g,E)=>{let{requesterAppId:O}=p||{};if(!a||!s){D(L,"signTypedData","onError","must_be_authenticated"),E(new Error("User must be authenticated before signing with a Privy wallet"));return}let z=h??Me(s)?.address;if(!z)throw new v("User must have an embedded wallet to sign a message.");let{signingWallet:G,rootWallet:ne}=Nl(s,z);if(!ne||!G){D(L,"signTypedData","onError","embedded_wallet_not_found"),E(new Error("Must have a Privy wallet before signing"));return}q(!0);let de=Ua(c),Ae=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let ke=await we();if(!x||!ke)throw new Error("Unable to connect to wallet");if(!await te.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:G.address,requesterAppId:O}});let{response:xr}=await x.rpc({accessToken:ke,address:ne.address,hdWalletIndex:G.walletIndex??void 0,requesterAppId:O,request:{method:"eth_signTypedData_v4",params:[G.address,de]}}),Rr=xr.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:G.address,requesterAppId:O}}),Rr};if(W.embeddedWallets.noPromptOnSignature||(W.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ke=await Ae();D(L,"signTypedData","onSuccess",ke),g(ke)}catch(ke){D(L,"signTypedData","onError","unable_to_sign"),E(ke??new Et("Unable to sign message"))}}else{let xr={method:"eth_signTypedData_v4",data:de,confirmAndSign:Ae,onSuccess:Zt=>{D(L,"signTypedData","onSuccess",Zt),g(Zt)},onFailure:Zt=>{D(L,"signTypedData","onError","unable_to_sign"),E(Zt)},uiOptions:p||{}},Rr={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Zt=>{D(L,"signMessage","onError","unknown_connect_wallet_error"),E(Zt)}};Z({signMessage:xr,connectWallet:Rr}),j("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(c,p,h,g)=>{let O=await(await Hu(c,p,h,g)).wait();return Wd(O)},exportWallet:c=>new Promise(async(p,h)=>{if(!a||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}c&&"target"in c&&c&&(c=void 0);let g=c?.address,E=s.linkedAccounts.filter(de=>de.type==="wallet"&&de.walletClientType==="privy"&&de.chainType==="ethereum"),O=g?E.find(de=>de.address===xi(g)):E.find(de=>!de.imported)||E[0];if(!O){h(new Error("Must have a Privy wallet before exporting"));return}q(!0);let z={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:h,address:O.address,shouldForceMFA:!0};if(Z(ue),!await we()||!x){h(new Error("Must have valid access token to enroll in MFA"));return}if(!x){h(new Error("Must have a Privy wallet before exporting"));return}let ne={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:O,onSuccess:p,onFailure:h};Z({keyExport:ne,connectWallet:z}),j("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:Vu,async init(c){switch(c){case"sms":await t.initMfaSmsVerification();return;case"passkey":return await t.initMfaPasskeyVerification();case"totp":return;default:throw new Error(`Unsupported MFA method: ${c}`)}},async submit(c,p){switch(c){case"totp":case"sms":if(typeof p!="string")throw new v("Invalid MFA code");Dt.current?.resolve({mfaMethod:c,mfaCode:p,relyingParty:window.origin}),await new Promise((O,z)=>{Yr.current={resolve:O,reject:z}});break;case"passkey":if(typeof p=="string")throw new v("Invalid authenticator response");let g=await(await import("@simplewebauthn/browser")).startAuthentication(p),E=H0(g);Dt.current?.resolve({mfaMethod:c,mfaCode:E,relyingParty:window.origin}),await new Promise((O,z)=>{Yr.current={resolve:O,reject:z}});break;default:throw Dt.current?.reject(new v("Unsupported MFA method")),new v(`Unsupported MFA method: ${c}`)}},cancel(){Dt.current?.reject(new v("MFA canceled"))},async initEnrollmentWithSms(c){let p=await we();if(!p||!x)throw new Error("Must have valid access token to enroll in MFA");await x.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:c.phoneNumber})},enrollInMfa(c){return new Promise((p,h)=>{if(!c){te.closePrivyModal(),p();return}W.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),Z({mfaEnrollmentFlow:{mfaMethods:W.mfa.methods,onSuccess:p,onFailure:h}}),j("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let c=await we();if(!c||!x)throw new Error("Must have valid access token to enroll in MFA");let p=await x.initEnrollMfa({method:"totp",accessToken:c});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(c){let p=await we();if(!p||!x)throw new Error("Must have valid access token to enroll in MFA");await x.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:c.phoneNumber,code:c.mfaCode});let h=await t.getAuthenticatedUser();d(h)},async submitEnrollmentWithTotp(c){let p=await we();if(!p||!x)throw new Error("Must have valid access token to enroll in MFA");await x.submitEnrollMfa({method:"totp",accessToken:p,code:c.mfaCode});let h=await t.getAuthenticatedUser();d(h)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:c}){let p=await we();if(!p||!x)throw new Error("Must have valid access token to enroll in MFA");await x.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:c});let h=await t.getAuthenticatedUser();d(h)},async unenroll(c){let p=await we();if(!p||!x)throw new Error("Must have valid access token to remove MFA");c==="passkey"?await x.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await x.unenrollMfa({method:c,accessToken:p});let h=await t.getAuthenticatedUser();d(h)},requestFarcasterSignerFromWarpcast:async()=>{let c=await we(),p=s?.linkedAccounts.find(E=>E.type==="wallet"&&E.walletClientType==="privy");if(!c)throw new Error("Must have valid access token to connect with Farcaster");if(!x||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await te.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");let g=await x.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:c,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(g.status==="approved"){let E=await t.getAuthenticatedUser();d(E||s||null)}Z({farcasterSigner:g}),j("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let c=await we(),p=s?.linkedAccounts.find(E=>E.type==="wallet"&&E.walletClientType==="privy");if(!c)throw new Error("Must have valid access token to connect with Farcaster");if(!x||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await te.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");return(E=>Uint8Array.from(E.match(/.{1,2}/g).map(O=>parseInt(O,16))))(s.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async c=>{let p=await we(),h=s?.linkedAccounts.find(z=>z.type==="wallet"&&z.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!x||!h)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await te.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");let E=await import("@simplewebauthn/browser"),O=await x.signFarcasterMessage({address:h.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{hash:E.bufferToBase64URLString(c)},fid:BigInt(s.farcaster.fid),relyingParty:window.origin});return new Uint8Array(E.base64URLStringToBuffer(O.signature))},createGuestAccount:async()=>{if(s&&!s.isGuest)throw new Error("User cannot already be authenticated to create a guest account");return s?.isGuest?s:te.loginWithGuestAccountFlow()},isHeadlessOAuthLoading:T,loginWithCode(c){return te.loginWithCode(c)},initLoginWithEmail(c){return te.initLoginWithEmail(c)},initLoginWithSms(c){return te.initLoginWithSms(c)},otpState:N,fundWallet(c,p){return te.fundWallet(c,p)},initLoginWithHeadlessOAuth(c,p){return te.initLoginWithHeadlessOAuth(c,p)},loginWithHeadlessOAuth(c){return te.loginWithHeadlessOAuth(c)},generateSiweMessage({address:c,chainId:p}){return te.generateSiweMessage({address:c,chainId:p})},linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:g,connectorType:E}){return Be("siwe"),te.linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:g,connectorType:E})},signMessageWithCrossAppWallet(c,{address:p}){return qc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"personal_sign",params:[c,p]},reconnect:Qs})},signTypedDataWithCrossAppWallet(c,{address:p}){let h=Ua(c);return qc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_signTypedData_v4",params:[p,h]},reconnect:Qs})},sendTransactionWithCrossAppWallet(c,{address:p}){return qc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_sendTransaction",params:[c]},reconnect:Qs})},setCustomMetadata(c){return te.setCustomMetadataForUser(c)},isModalOpen:r,mfaMethods:W.mfa.methods};G0=ki.signMessage,q0=ki.signTypedData,z0=async(...c)=>{let p=await Hu(...c);return W.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let te=(()=>({isNewUserThisSession:C,pendingTransaction:null,walletConnectionStatus:S,connectors:t.connectors?.walletConnectors??[],rpcConfig:W.rpcConfig,chains:W.chains,appId:e.appId,showFiatPrices:W.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,customAuthStatus:ce,nativeTokenSymbolForChainId:c=>W.chains.find(p=>p.id===Number(c))?.nativeCurrency.symbol,initializeWalletProxy:async c=>{if(x)return x;let p=new Promise(E=>{Ee(()=>O=>E(O))}),h=new Promise(E=>setTimeout(()=>E(null),c)),g=await Promise.race([p,h]);return Ee(null),g},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:async(c={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s,h;p&&U.current&&(h=Ys(s)),Y.current==="login"?c.shouldCallAuthOnSuccess&&p&&U.current?(D(L,"login","onComplete",s,C,!1,U.current,h??null),e.onSuccess?.(s,C)):D(L,"login","onError","exited_auth_flow"):Y.current==="link"&&h&&(c.isSuccess&&p&&U.current?D(L,"linkAccount","onSuccess",s,U.current,h):U.current&&D(L,"linkAccount","onError","exited_link_flow",{linkMethod:U.current}));let g=A&&xu.includes(A),E=A==="ERROR_SCREEN"&&ue.errorModalData&&xu.includes(ue.errorModalData.previousScreen);if((g||E)&&ue.funding){let O=G3[A]??null,z=_r(ue.funding.chain.id,W.chains,W.rpcConfig,{appId:e.appId}),G;try{G=(await z.getBalance(ue.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}D(L,"fundWallet","onUserExited",{address:ue.funding.address,chain:ue.funding.chain,fundingMethod:O,balance:G})}Z({...ue,externalConnectWallet:{suggestedAddress:void 0}}),Y.current=null,U.current=null,w(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:async({message:c})=>new Promise(async(p,h)=>{let g=async()=>{let E=await t.getAccessToken();if(!E)throw new Error("User must be authenticated to use their embedded wallet.");if(!f)throw new Error("User must have an embedded Solana wallet to sign messages for Solana.");let O=te.walletProxy??await te.initializeWalletProxy(15e3);if(!O)throw new Error("Failed to initialize embedded wallet proxy.");let{response:z}=await O.rpcSolana({accessToken:E,publicKey:f.address,request:{method:"signMessage",params:{message:c}}});return z.data.signature};if(W.embeddedWallets.noPromptOnSignature)try{let E=await g();p({signature:E})}catch(E){h(E)}else Z({signMessage:{method:"solana_signMessage",data:c,confirmAndSign:g,onSuccess:G=>{p({signature:G})},onFailure:G=>{h(G)},uiOptions:{}}}),Fe("EMBEDDED_WALLET_SIGN_REQUEST_SCREEN")}),openPrivyModal:j,connectWallet:Ri,initLoginWithWallet:async(c,p,h)=>{U.current="siwe",Qr(c,p,h)},loginWithWallet:async()=>{if(!n)throw new Vn;if(!(t.authFlow instanceof Go))throw new v("Must initialize SIWE flow first.");let c=await t.getAccessToken(),p,h;if(c!==null)try{({user:p}=await t.link()),U.current="siwe"}catch(g){throw D(L,"linkAccount","onError",g.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),g}else try{({user:p,isNewUser:h}=await t.authenticate()),U.current="siwe"}catch(g){throw D(L,"login","onError",g.privyErrorCode||"generic_connect_wallet_error"),g}d(p||s||null),w(h||!1),l(!0)},initLoginWithFarcaster:async(c,p)=>{let h=new qa(c,p);t.startAuthFlow(h);try{U.current="farcaster",await h.initializeFarcasterConnect()}catch(g){throw Y.current==="login"?D(L,"login","onError",g.privyErrorCode||"unknown_auth_error"):Y.current==="link"&&D(L,"linkAccount","onError",g.privyErrorCode||"unknown_auth_error",{linkMethod:"farcaster"}),g}},loginWithFarcaster:async()=>{if(!n)throw new Vn;if(!(t.authFlow instanceof qa))throw new v("Must initialize Farcaster flow first.");let c=await t.getAccessToken(),p,h;if(c!==null)try{({user:p}=await t.link()),U.current="farcaster"}catch(g){throw D(L,"linkAccount","onError",g.privyErrorCode||"failed_to_link_account",{linkMethod:"farcaster"}),g}else try{({user:p,isNewUser:h}=await t.authenticate()),U.current="farcaster"}catch(g){throw D(L,"login","onError",g.privyErrorCode||"unknown_auth_error"),g}d(p||null),w(h||!1),l(!0)},async loginWithGuestAccountFlow(){let c=new Fi(this.appId);t.startAuthFlow(c);try{Y.current="login",U.current="guest";let p=await t.authenticate(),{user:h,isNewUser:g}=p;if(g=g||!1,!h)throw new v("Unable to authenticate guest account");if(bt(h,W.embeddedWallets.createOnLogin))try{await Ke(h,15e3),h=await te.refreshUser()}catch{d(h),console.warn("Unable to create embedded wallet for guest account")}else d(h);return w(g),l(!0),D(L,"login","onComplete",h,g,!1,"guest",null),h}catch(p){throw D(L,"login","onError",p.privyErrorCode||"unknown_auth_error"),p}},async crossAppAuthFlow({appId:c,popup:p,action:h}){let g=`privy:${c}`;U.current=g;let{url:E,stateCode:O,codeVerifier:z}=await u1({api:t.api,appId:c});if(!E)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:c}}),new v("No authorization URL returned for cross-app auth.");try{let G=await B0({url:E,popup:p,provider:g}),ne=G.stateCode,de=G.authorizationCode;if(ne!==O)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:g,storedStateCode:O??"",returnedStateCode:ne??""}}),new v("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let Ae=await m1({appId:c,codeVerifier:z,stateCode:ne,authorizationCode:de,action:h,client:t});Ae&&t.storeProviderAccessToken(c,Ae);let ke=await te.refreshUser();if(!ke)throw new v("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:c}}),ke}catch(G){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:G.toString(),provider:g}}),G}},async initLoginWithOAuth(c,p,h){if(U.current=c,Oa()){if(c==="google"&&ia(window.navigator.userAgent)){Fe("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{Fe("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}c==="twitter"&&window.opener&&window.opener.postMessage({type:"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"},"*"),X.del(Yn),X.del(Qn);let g=new go({provider:c,disableSignup:!!h});p&&g.addCaptchaToken(p),t.startAuthFlow(g);let E=await t.authFlow.getAuthorizationUrl();E&&E.url&&(c==="twitter"&&lA&&(E.url=E.url.replace("x.com","twitter.com")),window.location.assign(E.url))},async initLoginWithTelegram(c,p){if(!n)throw new Vn;U.current="telegram";let h=new Vi(c,p);t.startAuthFlow(h),h.meta.telegramWebAppData=void 0,h.meta.telegramAuthResult=await new Promise((g,E)=>{if(!W.loginConfig.telegramAuthConfiguration)return E(new v("Telegram Auth configuration is not loaded"));if(!window.Telegram)return E(new v("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:W.loginConfig.telegramAuthConfiguration.botId,request_access:!0},O=>O?g(O):E(new v("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Vi))throw new v("Must initialize Telegram flow before calling loginWithTelegram");let c,p;if(Y.current==="login")try{let h=await t.authenticate();c=h.user,p=h.isNewUser,U.current="telegram"}catch(h){throw D(L,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}else if(Y.current==="link")try{c=(await t.link()).user,U.current="telegram"}catch(h){throw D(L,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}else throw new v("Unknown auth intent");d(c),w(p||!1),l(!0)},async recoveryOAuthFlow(c,p,h){let g,E;function O(z){if(!z)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:c}}),new v("Recovery OAuth failed")}switch(c){case"google-drive":{let{url:z,codeVerifier:G,stateCode:ne}=await kp({api:tn.api,provider:c});O(z);let de,Ae;try{let ke=await Fu({url:z,popup:h,provider:c});if(de=ke.stateCode,Ae=ke.authorizationCode,de!==ne)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c,storedStateCode:ne??"",returnedStateCode:de??""}}),new v("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(ke){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:ke.toString(),provider:c}}),new v("Recovery OAuth failed")}[g,E]=await Promise.all([we(),fy({api:tn.api,provider:c,codeVerifier:G,stateCode:de,authorizationCode:Ae})]);break}case"icloud":{let{url:z}=await kp({api:tn.api,provider:c});O(z);let{ckWebAuthToken:G}=await Fu({url:z,popup:h,provider:c});E=G,g=await we();break}}if(!x)throw new v("Cannot connect to wallet proxy");if(!g)throw new v("Unable to authorize user");switch(p){case"recover":let z=ue.recoverWallet?.privyWallet?.address;if(!z)throw new v("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:z,recoveryMethod:c}}),await x.recover({address:z,accessToken:g,recoveryAccessToken:E,recoveryMethod:c}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:z,recoveryMethod:c}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await x.create({accessToken:g,recoveryAccessToken:E,recoveryMethod:c});let G=await te.refreshUser(),ne=Me(G);if(!ne)throw D(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:ne.address}}),D(L,"createWallet","onSuccess",ne);break;case"set-recovery":let de=Me(s);if(!de)throw D(L,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:de.address,existingRecoveryMethod:de.recoveryMethod,targetRecoveryMethod:c}}),await x.setRecovery({address:de.address,accessToken:g,recoveryAccessToken:E,recoveryMethod:c});let Ae=Me(await te.refreshUser());if(!Ae)throw D(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:de.address,existingRecoveryMethod:de.recoveryMethod,targetRecoveryMethod:c}}),D(L,"setWalletRecovery","onSuccess",c,Ae);break;default:throw new v("Unsupported recovery action")}},async loginWithOAuth(c){if(!(t.authFlow instanceof go))throw new v("Must initialize OAuth flow before calling loginWithOAuth");let p=X.get(zn),h=t.authFlow.meta.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c,storedStateCode:p??"",returnedStateCode:h??""}}),new v("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let g=await t.getAccessToken(),E,O,z;if(g!==null)try{let G=await t.link();E=G.user,z=G.oAuthTokens,U.current=c}catch(G){throw D(L,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account",{linkMethod:c}),G}else try{let G=await t.authenticate();E=G.user,O=G.isNewUser,z=G.oAuthTokens,U.current=c}catch(G){throw Y.current==="login"?D(L,"login","onError",G.privyErrorCode||"unknown_auth_error"):Y.current==="link"&&D(L,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account",{linkMethod:c}),G}return d(E),w(O||!1),l(!0),z&&E&&D(L,"oAuthAuthorization","onOAuthTokenGrant",z,{user:E}),z},async initLoginWithPasskey(c){let p=new jn(c);t.startAuthFlow(p),Y.current="login";try{U.current="passkey",await p.initAuthenticationFlow()}catch(h){throw D(L,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}},async loginWithPasskey(){if(!n)throw new Vn;if(!(t.authFlow instanceof jn))throw new v("Must initialize Passkey flow first.");if(U.current!=="passkey")throw new v("Must init login with Passkey flow first.");let c,p;try{U.current="passkey",{user:c,isNewUser:p}=await t.authenticate()}catch(h){throw D(L,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}d(c),w(p||!1),l(!0)},async initLinkWithPasskey(c){let p=new jn(c);t.startAuthFlow(p),Y.current="link",U.current="passkey";try{await p.initLinkFlow()}catch(h){throw D(L,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"passkey"}),h}},async linkWithPasskey(){if(!n)throw new Vn;if(!(t.authFlow instanceof jn))throw new v("Must initialize Passkey flow first.");if(U.current!=="passkey")throw new v("Must init login with Passkey flow first.");let c;try{U.current="passkey",{user:c}=await t.link()}catch(p){throw D(L,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account",{linkMethod:"passkey"}),p}return d(c||s||null),c},async initLoginWithHeadlessOAuth(c,p){if(Oa()){if(c==="google"&&ia(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.")}else throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let h=new go({provider:c,headless:!0,disableSignup:!1});p&&h.addCaptchaToken(p);let g=await t.startAuthFlow(h).getAuthorizationUrl();g?.url&&window.location.assign(g.url)},async loginWithHeadlessOAuth(c){P(!0),t.startAuthFlow(new go(c));let p=X.get(zn),h=c.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c.provider,storedStateCode:p??"",returnedStateCode:h??""}}),P(!1),new v("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let g=await t.getAccessToken(),E,O,z;if(g!==null)try{({user:E,oAuthTokens:z}=await t.link()),U.current=c.provider;let G=Ys(E);E&&G&&D(L,"linkAccount","onSuccess",E,U.current,G)}catch(G){throw P(!1),D(L,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account",{linkMethod:c.provider}),G}else try{({user:E,isNewUser:O,oAuthTokens:z}=await t.authenticate()),U.current=c.provider;let G=Ys(E);E&&G&&O!==void 0&&Y.current==="login"&&D(L,"login","onComplete",E,O,!1,U.current,G)}catch(G){throw P(!1),D(L,"login","onError",G.privyErrorCode||"unknown_auth_error"),G}return d(E),w(O||!1),l(!0),P(!1),z&&E&&D(L,"oAuthAuthorization","onOAuthTokenGrant",z,{user:E}),E??void 0},initLoginWithEmail:async(c,p,h)=>{let g=new nn(c,p,h);t.startAuthFlow(g);try{U.current="email",await g.sendCodeEmail()}catch(E){throw Y.current==="login"?D(L,"login","onError",E.privyErrorCode||"unknown_auth_error"):Y.current==="link"&&D(L,"linkAccount","onError",E.privyErrorCode||"failed_to_link_account",{linkMethod:"email"}),E}},initUpdateEmail:async(c,p,h)=>{let g=new hl(c,p,h);t.startAuthFlow(g),await g.sendCodeEmail()},initUpdatePhone:async(c,p,h)=>{let g=new Wl(c,p,h);t.startAuthFlow(g),await g.sendSmsCode()},initLoginWithSms:async(c,p,h)=>{H({status:"sending-code"});let g=new an(c,p,h);t.startAuthFlow(g);try{U.current="sms",await g.sendSmsCode(),H({status:"awaiting-code-input"})}catch(E){throw H({status:"error",error:E}),Y.current==="login"?D(L,"login","onError",E.privyErrorCode||"unknown_auth_error"):Y.current==="link"&&D(L,"linkAccount","onError",E.privyErrorCode||"failed_to_link_account",{linkMethod:"sms"}),E}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async c=>{if(H({status:"submitting-code"}),!n){let g=new Vn;throw H({status:"error",error:g}),g}if(t.authFlow instanceof nn)t.authFlow.meta.emailCode=c.trim();else if(t.authFlow instanceof an)t.authFlow.meta.smsCode=c.trim();else{let g=new v("Must initialize a passwordless code flow first");throw H({status:"error",error:g}),g}await we();let p,h;if(Y.current==="link")try{({user:p}=await t.link())}catch(g){throw H({status:"error",error:g}),D(L,"linkAccount","onError",g.privyErrorCode||"failed_to_link_account",{linkMethod:U.current}),g}else try{({user:p,isNewUser:h}=await t.authenticate())}catch(g){throw H({status:"error",error:g}),D(L,"login","onError",g.privyErrorCode||"unknown_auth_error"),g}d(p||s||null),w(h||!1),l(!0),H({status:"done"})},generateSiweMessage:async({address:c,chainId:p,captchaToken:h})=>{Y.current="link",U.current="siwe";let g=await t.generateSiweNonce({address:c,captchaToken:h}),E=p.replace("eip155:","");return Il({address:c,chainId:E,nonce:g})},linkWithSiwe:async({message:c,signature:p,chainId:h,walletClientType:g,connectorType:E})=>{let O;try{O=await t.linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:g,connectorType:E}),O=await te.refreshUser()??O;let z=Ys(O);z&&D(L,"linkAccount","onSuccess",O,"siwe",z)}catch(z){throw D(L,"linkAccount","onError",z.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),Y.current=null,U.current=null,z}d(O||s||null),Y.current=null,U.current=null},refreshUser:async()=>{let c=await t.getAuthenticatedUser();return l(!!c),d(c),c},walletProxy:x,createAnalyticsEvent:({eventName:c,payload:p,timestamp:h})=>t.createAnalyticsEvent({eventName:c,payload:p,timestamp:h}),acceptTerms:async()=>{let c=await t.acceptTerms();return d(c),c},getUsdTokenPrice:c=>t.getUsdTokenPrice(c),recoverEmbeddedEthereumWallet:async c=>new Promise(async(p,h)=>{let g=Me(c?.user??s)||Ll(c?.user??s),E=await we();if(!E||!x||!g){h(new Error("Must have valid access token and Privy wallet to recover wallet"));return}q(!0);try{await x.connect({accessToken:E,address:g.address}),p(!0)}catch(O){if(ci(O)&&g.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:g.address}}),(await x.recover({address:g.address,accessToken:E,recoveryMethod:g.recoveryMethod})).address||h(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:g.address}}),p(!0);else if(ci(O)&&g.recoveryMethod!=="privy"){Z({recoverWallet:{privyWallet:g,onFailure:h,onSuccess:()=>p(!0)},recoveryOAuthStatus:{provider:g.recoveryMethod,action:"recover"}});let z=gc(g.recoveryMethod);j(z)}else h(O)}}),embeddedSolanaWallet:f,createEmbeddedSolanaWallet:async()=>{q(!0);let c=await we(),p=await te.refreshUser(),h=$n(p),g=Me(p);if(!p||!c)throw new v("User must be logged in to create a Solana wallet");if(h)throw new v("User already has an embedded Solana wallet.");if(g)if(g.recoveryMethod==="privy")await te.recoverEmbeddedEthereumWallet({user:p});else throw new v("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");let E=await te.initializeWalletProxy(15e3);if(!E)throw new v("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await E.createSolana({accessToken:c,ethereumAddress:g?.address});let O=await te.refreshUser(),z=$n(O);if(!z)throw new v("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:z.address}}),z}catch(O){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new v("Failed to create Solana embedded wallet with error ",O)}},exportSolanaWallet:c=>new Promise(async(p,h)=>{if(!a||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}let g=c?.address,E=s.linkedAccounts.filter(ne=>ne.type==="wallet"&&ne.walletClientType==="privy"&&ne.chainType==="solana"),O=g?E.find(ne=>ne.address.toLowerCase()===g.toLowerCase()):E.find(ne=>!ne.imported)||E[0];if(!O){h(new Error("Must have a Privy wallet before exporting"));return}if(q(!0),!await we()||!x){h(new Error("Must have valid access token to enroll in MFA"));return}if(!x){h(new Error("Must have a Privy wallet before exporting"));return}await te.recoverEmbeddedSolanaWallet();let G={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:O,onSuccess:p,onFailure:h};Z({keyExport:G}),j("EMBEDDED_WALLET_KEY_EXPORT_SCREEN")}),recoverEmbeddedSolanaWallet:async()=>new Promise(async(c,p)=>{let h=$n(s),g=await we();if(!g||!x||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}q(!0);try{await x.connectSolana({accessToken:g,publicKey:h.address}),c(!0)}catch(E){ci(E)&&h.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await x.recoverSolana({publicKey:h.address,accessToken:g})).publicKey||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:h.address}}),c(!0)):p(E)}}),getMoonpaySignedUrl:uo,initCoinbaseOnRamp:t.initCoinbaseOnRamp.bind(t),getCoinbaseOnRampStatus:t.getCoinbaseOnRampStatus.bind(t),setReadyToTrue:c=>{i(!0),ae?.(c)},updateWallets:()=>Uo(),fundWallet:async(c,p)=>{if(!W.fundingConfig||W.fundingConfig.methods.length===0)throw new Error("Wallet funding is not enabled");let h=Nd({fundingMethods:W.fundingConfig.methods});Z({funding:Pu({address:c,appConfig:W,fundWalletConfig:p,methodScreen:h})}),j(h)},requestFarcasterSignerStatus:async c=>{let p=await we(),h=s?.linkedAccounts.find(E=>E.type==="wallet"&&E.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!x||!h)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");let g=await t.requestFarcasterSignerStatus(c);if(g.status==="approved"){let E=await t.getAuthenticatedUser();d(E||s||null)}return g},connectCoinbaseSmartWallet:async()=>{W.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let c=t.connectors?.findWalletConnector("coinbase_wallet","coinbase_smart_wallet")||t.connectors?.findWalletConnector("coinbase_wallet","coinbase_wallet");if(c)return c.updateConnectionPreference("smartWalletOnly"),Ri(c);await Bn("coinbase_wallet","coinbase_smart_wallet")},setCustomMetadataForUser:async c=>{try{let p=await t.setCustomMetadata(c);return d(p),D(L,"setCustomMetadata","onSuccess",p),p}catch(p){throw D(L,"setCustomMetadata","onError",p.privyErrorCode||"unknown_auth_error"),p}}}))();K0=te.recoverEmbeddedEthereumWallet,Y0=te.recoverEmbeddedSolanaWallet,Q0=te.solanaSignMessage;let qu=sA(()=>({wallets:u,ready:ge&&Re}),[u,ge,Re]);return Pr(Pe.Provider,{value:ki,children:Pr(xm.Provider,{value:L,children:Pr(Wm.Provider,{value:qu,children:Pr(dh,{...W,children:V0(Sm.Provider,{value:te,children:[Pr(km,{children:V0(oh,{data:ue,setModalData:Z,setInitialScreen:k,initialScreen:A,authenticated:a,open:r,children:[e.children,!W.headless&&W.captchaEnabled&&n&&!a&&Pr(sp,{delayedExecution:!1}),Pr(T0,{theme:{...W.appearance.palette||{}}}),!W.render.standalone&&Pr(Du,{open:r})]})}),pe&&Q?Pr(D0,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:Dt,mfaSubmitPromise:Yr,onLoad:K,onLoadFailed:()=>null}):null,W.loginConfig.telegramAuthConfiguration&&Pr(eo,{if:!0,children:Pr(L0,{scriptHost:e.apiUrl||el,botUsername:W.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};import{useCallback as X0,useEffect as yA}from"react";var gA=e=>{Oe("login",e);let t=Te(),r=sl(),{initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:n,isHeadlessOAuthLoading:i,ready:a,user:l}=V(),s=X0(async u=>{if(t.enabled&&t.status!=="success")throw new fr(t.error,null,"captcha_failure");return o(u.provider,t.token)},[o,t]),d=X0(async()=>{let u=Qa();if(l)return console.warn("Cannot login with OAuth when already logged in"),l;if(!u.inProgress)throw new Error("Cannot login with OAuth because no OAuth flow is in progress");if(!u.popupFlow)try{return await n(u)}catch(m){throw m}finally{Jn()}},[n]);return yA(()=>{let u=Qa();a&&r&&u.inProgress&&u.headless&&!u.popupFlow&&d()},[a,r]),{initOAuth:s,loginWithOAuth:d,loading:i}};import{useCallback as Z0}from"react";var CA=()=>{let e=Te(),{initLoginWithEmail:t,loginWithCode:r}=V(),o=Z0(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=Z0(async({code:i})=>{if(e.enabled&&e.status==="error")throw new fr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};import{useCallback as J0}from"react";var vA=()=>{let e=Te(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=V(),n=J0(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=J0(async({code:a})=>{if(e.enabled&&e.status!=="success")throw new fr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:n,loginWithCode:i,state:o}};import{useCallback as j0}from"react";var wA=()=>{let e=Te(),{generateSiweMessage:t,linkWithSiwe:r}=V(),o=j0(async({address:i,chainId:a})=>{if(!i||!a)throw new Error("wallet address and chainId required to generate nonce");return t({address:i,chainId:a}).then(l=>l)},[t]),n=j0(async({signature:i,message:a,chainId:l,walletClientType:s,connectorType:d})=>{if(e.enabled&&e.status!=="success")throw new fr(e.error,null,"captcha_failure");return r({message:a,signature:i,chainId:l,walletClientType:s,connectorType:d})},[r,e.status]);return{generateSiweMessage:o,linkWithSiwe:n}};import{useContext as bA}from"react";function EA(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:u,linkSpotify:m,linkInstagram:f,linkTelegram:y,linkFarcaster:b}=bA(Pe);return Oe("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:u,linkSpotify:m,linkInstagram:f,linkFarcaster:b,linkTelegram:y}}import{useContext as TA}from"react";function SA(e){let{connectWallet:t}=TA(Pe);return Oe("connectWallet",e),{connectWallet:t}}import{useContext as AA}from"react";function PA(e){let{createWallet:t}=AA(Pe);return Oe("createWallet",e),{createWallet:t}}var xA=()=>{let{embeddedSolanaWallet:e,exportSolanaWallet:t,createEmbeddedSolanaWallet:r}=I();return{createWallet:r,exportWallet:t,wallets:e?[e]:[]}};var RA=()=>{let{connectCoinbaseSmartWallet:e}=I();return{connectCoinbaseSmartWallet:e}};var kA=()=>{let{startCrossAppAuthFlow:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=V();return{loginWithCrossAppAccount:({appId:i})=>e({appId:i,action:"login"}),linkCrossAppAccount:({appId:i})=>e({appId:i,action:"link"}),unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:n}};import{useContext as _A}from"react";function MA(e){let{sendTransaction:t}=_A(Pe);return Oe("sendTransaction",e),{sendTransaction:t}}import{useContext as IA}from"react";function WA(e){let{setWalletPassword:t}=IA(Pe);return Oe("setWalletPassword",e),{setWalletPassword:t}}import{useContext as LA}from"react";function NA(){let{createGuestAccount:e}=LA(Pe);return{createGuestAccount:e}}import{useContext as OA}from"react";function DA(e){let{setWalletRecovery:t}=OA(Pe);return Oe("setWalletRecovery",e),{setWalletRecovery:t}}import{useContext as UA}from"react";function FA(e){let{signMessage:t}=UA(Pe);return Oe("signMessage",e),{signMessage:t}}import{useContext as BA}from"react";function HA(e){let{signTypedData:t}=BA(Pe);return Oe("signTypedData",e),{signTypedData:t}}import{useContext as VA}from"react";var GA=()=>{let{isModalOpen:e}=VA(Pe);return{isOpen:e}};import{useContext as qA}from"react";function zA(e){let{getAccessToken:t}=qA(Pe);return Oe("accessToken",e),{getAccessToken:t}}function KA(e){let{authenticated:t,user:r}=V(),{initLoginWithOAuth:o}=I(),n=Li();return Oe("oAuthAuthorization",e),{reauthorize:i=>YA(t,r,o,n,i.provider)}}var YA=async(e,t,r,o,n)=>{if(!e)throw o("linkAccount","onError","must_be_authenticated",{linkMethod:n}),new v("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some(a=>a.type.includes(n)))throw new v(`OAuth account of type ${n} not linked to the account.`);await r(n)};var QA=e=>{let{customAuthStatus:t}=I();return Oe("customAuth",e),{status:t}};var XA=$0;function $0(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=V();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}import{useContext as ZA}from"react";function JA(e){let{setCustomMetadata:t}=ZA(Pe);return Oe("setCustomMetadata",e),{setCustomMetadata:t}}function jA(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}export{vo as AsExternalProvider,sp as Captcha,ja as ConnectorManager,Du as LoginModal,$a as PrivyClient,fA as PrivyProvider,$e as PrivyProxyProvider,Xd as SUPPORTED_CHAINS,Vd as VERSION,er as WalletConnector,a6 as addRpcUrlOverrideToChain,xp as errorIndicatesMaxMfaRetries,di as errorIndicatesMfaTimeout,pi as errorIndicatesMfaVerificationFailed,we as getAccessToken,jA as getEmbeddedConnectedWallet,RA as useConnectCoinbaseSmartWallet,SA as useConnectWallet,PA as useCreateWallet,kA as useCrossAppAccounts,QA as useCustomAuth,XA as useExperimentalFarcasterSigner,$0 as useFarcasterSigner,oC as useFundWallet,NA as useGuestAccounts,EA as useLinkAccount,wA as useLinkWithSiwe,rC as useLogin,CA as useLoginWithEmail,gA as useLoginWithOAuth,vA as useLoginWithSms,Zd as useLogout,Ms as useMfa,ao as useMfaEnrollment,GA as useModalStatus,KA as useOAuthTokens,V as usePrivy,lp as useRegisterMfaListener,MA as useSendTransaction,JA as useSetCustomMetadata,WA as useSetWalletPassword,DA as useSetWalletRecovery,FA as useSignMessage,HA as useSignTypedData,xA as useSolanaWallets,zA as useToken,Vo as useWallets};