@privy-io/react-auth 1.82.0 → 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/chunk-AAHAMVFD.js +118 -0
- package/dist/esm/chunk-AAHAMVFD.js +118 -0
- package/dist/esm/index.js +316 -316
- package/dist/esm/ui.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +310 -310
- package/dist/{types-b7a1b923.d.ts → types-1f13692b.d.ts} +5 -0
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +8 -8
- package/package.json +3 -3
- package/dist/chunk-K2LQRC3N.js +0 -118
- package/dist/esm/chunk-K2LQRC3N.js +0 -118
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as Bn,$a as xt,A as js,Aa as Nr,B as Ju,Ba as hm,C as Un,Ca as ym,D as ju,Da as gm,E as Ai,Ea as zd,F as $u,Fa as Cm,G as Uo,Ga as vm,H as Ir,Ha as wm,I as La,Ia as Le,J as em,Ja as al,K as $s,Ka as pt,L as tm,La as bm,M as We,Ma as L,N as rm,Na as xe,O as om,Oa as K,P as Ud,Pa as Em,Q as Fn,Qa as Tm,R as Fd,Ra as Sm,S as el,Sa as Ne,T as nm,Ta as O,U as Bd,Ua as Ri,V as Hd,Va as ki,W as tl,Wa as G,X as Na,Xa as Z,Y as Oa,Ya as Am,Z as rl,Za as $t,_ as Da,_a as Pm,a as Gu,aa as Hn,ab as Kd,b as Xs,ba as Vn,bb as Ua,c as Dd,ca as ol,cb as Fa,d as qu,da as Vd,db as xm,e as jt,ea as Gd,eb as Rm,f as Mr,fa as Gn,fb as _i,g as w,ga as Fo,gb as km,h as zu,ha as qd,hb as _m,i as _e,ia as Pi,ib as Bo,j as ae,ja as im,jb as Mi,k as ot,ka as am,kb as yo,l as Dn,la as sm,lb as bt,m as fr,ma as lm,mb as Ba,n as Ku,na as cm,nb as Mm,o as fo,oa as xi,ob as j0,p as Ia,pa as Zr,pb as $0,q as J,qa as dm,r as en,ra as nl,s as Zs,sa as pm,t as Yu,ta as Wr,u as Js,ua as um,v as Qu,va as il,w as Ut,wa as mm,x as Xu,xa as Lr,y as Zu,ya as ho,z as Wa,za as fm}from"./chunk-K2LQRC3N.js";import{getAddress as wi}from"@ethersproject/address";import{Web3Provider as Ou}from"@ethersproject/providers";import{createStore as nA}from"mipd";import{useEffect as co,useMemo as iA,useRef as _a,useState as dt}from"react";import{isAndroid as aA}from"react-device-detect";import{ProviderErrors as sA,calculateTotalGasEstimate as lA,populateTransactionRequest as cA}from"@privy-io/js-sdk-core";var sl="/api/v1/sessions",ll="/api/v1/sessions/logout",Im="/api/v1/sessions/fork",cl="/api/v1/sessions/fork/recover",Wm="/api/v1/siwe/init",Lm="/api/v1/siwe/authenticate",Nm="/api/v1/siwe/link",Om="/api/v1/siwe/unlink",Dm="/api/v1/farcaster/init",Um="/api/v1/farcaster/authenticate",Fm="/api/v1/farcaster/link",Bm="/api/v1/farcaster/status",Hm="/api/v1/farcaster/unlink",Vm="/api/v1/passwordless/init",Gm="/api/v1/passwordless/authenticate",qm="/api/v1/passwordless/link",zm="/api/v1/passwordless/unlink",Km="/api/v1/passwordless/update",Ym="/api/v1/passwordless_sms/init",Qm="/api/v1/passwordless_sms/link",Xm="/api/v1/passwordless_sms/unlink",Zm="/api/v1/passwordless_sms/authenticate",Jm="/api/v1/passwordless_sms/update",dl="/api/v1/oauth/init",pl="/api/v1/oauth/authenticate",ul="/api/v1/oauth/link",jm="/api/v1/oauth/unlink",$m="/api/v1/recovery/oauth/init",ef="/api/v1/recovery/oauth/init_icloud",tf="/api/v1/recovery/oauth/authenticate",rf="/api/v1/passkeys/link/init",of="/api/v1/passkeys/authenticate/init",nf="/api/v1/passkeys/link",af="/api/v1/passkeys/authenticate",sf="/api/v1/passkeys/unlink",lf="/api/v1/telegram/authenticate",cf="/api/v1/telegram/link",df="/api/v1/telegram/unlink";var pf="/api/v1/mfa/passwordless_sms/init",uf="/api/v1/mfa/passkeys/init",mf="/api/v1/users/me/accept_terms",ml="/api/v1/analytics_events",ff="/api/v1/custom_jwt_account/authenticate",hf="/api/v1/guest/authenticate",yf="/api/v1/plugins/moonpay_on_ramp/sign",gf="/api/v1/funding/coinbase_on_ramp/init",Cf="/api/v1/funding/coinbase_on_ramp/status";var Ii=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(ff,{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 ae(t)}}async link(){throw new Error("Unimplemented")}};var tn=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(Gm,{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 ae(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(qm,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw ae(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(Vm,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw ae(o)}}},fl=class extends tn{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(Km,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw ae(r)}}};import{isMobile as eC,isIOS as tC}from"react-device-detect";var hl=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(yl))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var yl={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 vf(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function wf(e,t){let r=vf(t);if(r.deepLink)return Pf(r.deepLink,e);if(r.universalLink)return Yd(r.universalLink,e);throw new w(`Unsupported wallet ${t.id}`)}function bf(e,t){let r=vf(t);if(r.universalLink)return Yd(r.universalLink,e)}var Ef="WALLETCONNECT_DEEPLINK_CHOICE";function Tf(){try{localStorage.removeItem(Ef)}catch{}}function Sf({href:e,name:t}){try{localStorage.setItem(Ef,JSON.stringify({href:e,name:t}))}catch{}}function Af(e){return e.startsWith("http://")||e.startsWith("https://")}function Pf(e,t){if(Af(e))return Yd(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 Yd(e,t){if(!Af(e))return Pf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function gl(e,t){window.open(e,t,"noreferrer noopener")}var Ye=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 Ha=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Ye(this._startChannelOnce.bind(this)),this.pollForReady=new Ye(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(Um,{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 ae(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(Fm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw ae(t)}}async _startChannelOnce(){if(!this.api)throw new w("Auth flow has no API instance");let t=await this.api.post(Dm,{token:this.captchaToken});eC&&!tC&&t.connect_uri&&gl(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(Bm,{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 Rf}from"jose";async function xf(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function Va(e){return crypto.getRandomValues(new Uint8Array(e))}var Wi=class{constructor(t){this.meta={guestCredential:this.getOrCreateGuestCredential(t)}}getOrCreateGuestCredential(t){let r=rl(t);if(Ia()){if(J.get(r))return J.get(r);{let o=Rf.encode(Va(32));return J.put(r,o),o}}return Rf.encode(Va(32))}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(hf,{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 ae(t)}}async link(){throw new Error("Linking is not supported for the guest flow")}};import{base64url as kf}from"jose";var rC="S256",oC="S256";function qn(){return kf.encode(Va(36))}function Li(){return qn()}async function Ni(e,t=rC){if(t==oC){let r=await xf(e);return kf.encode(r)}else return e}function _f(){let e=J.get(Hn);if(!e)throw new w("Authentication error.");return e}function Cl(){return!!J.get(Vn)}var go=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Cl();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=_f();try{let r=await this.api.post(pl,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return J.del(Hn),this.meta.headless&&J.del(Vn),{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=ae(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(Hn);if(!t)throw new w("Authentication error.");try{let r=await this.api.post(ul,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return J.del(Hn),r}catch(r){throw ae(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=qn();J.put(Hn,t);let r=Li();J.put(Bn,r);let o=await Ni(t);this.meta.headless&&J.put(Vn,!0);try{return await this.api.post(dl,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw ae(n)}}};function Qd(e){return e.charAt(0).toUpperCase()+e.slice(1)}import{jsx as Mf,jsxs as nC}from"react/jsx-runtime";var vl=({style:e,...t})=>nC("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:[Mf("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"}),Mf("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 Ga,jsxs as iC}from"react/jsx-runtime";var wl=({style:e,...t})=>iC("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:[Ga("g",{clipPath:"url(#clip0)",children:Ga("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"})}),Ga("defs",{children:Ga("clipPath",{id:"clip0",children:Ga("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as If}from"react/jsx-runtime";var bl=({style:e,...t})=>If("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:If("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 aC from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as sC}from"react/jsx-runtime";var Wf=({style:e})=>sC(aC,{style:{color:"var(--privy-color-error)",...e}});import{jsx as El,jsxs as lC}from"react/jsx-runtime";var Tl=({style:e,...t})=>lC("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:[El("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"}),El("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"}),El("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"}),El("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 Sl}from"react/jsx-runtime";function Al(e){return Sl("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:[Sl("defs",{children:[Sl("linearGradient",{id:"b",children:[Or("stop",{offset:"0",stopColor:"#3771c8"}),Or("stop",{stopColor:"#3771c8",offset:".128"}),Or("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),Sl("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 Pl}from"react/jsx-runtime";function xl({style:e,...t}){return Pl("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:Pl("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:Pl("g",{transform:"scale(5.12,5.12)",children:Pl("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 Lf,jsxs as cC}from"react/jsx-runtime";function Rl(e){return cC("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[Lf("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"}),Lf("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 Xd,jsxs as dC}from"react/jsx-runtime";function kl(e){return dC("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:[Xd("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"}),Xd("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"}),Xd("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 Nf}from"react/jsx-runtime";var _l=({style:e,...t})=>Nf("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:Nf("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 Of={google:{name:"Google",component:Tl},discord:{name:"Discord",component:wl},github:{name:"Github",component:bl},linkedin:{name:"LinkedIn",component:xl},twitter:{name:"Twitter",component:_l},spotify:{name:"Spotify",component:Rl},instagram:{name:"Instagram",component:Al},tiktok:{name:"Tiktok",component:kl},apple:{name:"Apple",component:vl}},qa=e=>e in Of?Of[e]:{name:"Unknown",component:Wf};function Df(e,t){let r={detail:"",retryable:!1},o=Qd(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=qa(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=qa(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 za(){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:Cl(),popupFlow:window.opener!==null&&n}}function zn(){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(Bn),window.history.replaceState({},"",e)}var Kn=class{constructor(t){this.initAuthenticateOnce=new Ye(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Ye(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(af,{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"):ae(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(nf,{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"):ae(r)}}async _initAuthenticateOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(of,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(rf,{})}_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 Ml=({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 Ho=class{constructor(t,r,o){this.getNonceOnce=new Ye(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 ae(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 ae(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=Ml({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var rn=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(Zm,{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 ae(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(Qm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ae(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(Ym,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw ae(o)}}},Il=class extends rn{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(Jm,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(r){throw ae(r)}}};var Oi=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(lf,{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 ae(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(cf,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw ae(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 Ff(){let e;if(e=pC(),e)return Uf(),{...e,flowType:"login-url"};if(e=uC(),e)return Uf(),{...e,flowType:"web-app"}}function pC(){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 uC(){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 Uf(){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";import{getAddress as Bf}from"@ethersproject/address";function $(e){return e?new Date(e*1e3):null}function mC(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:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(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:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(i);break;case"email":let a={address:r.address,type:r.type,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(a);break;case"phone":let l={number:r.phoneNumber,type:r.type,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(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:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(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:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(d);break;case"instagram_oauth":let u={subject:r.subject,username:r.username,type:r.type,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(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:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(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:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(f);break;case"github_oauth":let g={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(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:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(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:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(C);break;case"apple_oauth":let b={subject:r.subject,email:r.email,type:r.type,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(b);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(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:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(A);break;case"passkey":let _={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:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(_);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:$(r.first_verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(S);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function er(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,Jd=e=>e?.linkedAccounts.filter(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum"),fC=e=>e?.linkedAccounts.filter(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.chainType==="ethereum"),Yn=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,Wl=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,Ll=(e,t)=>{let r=fC(e).find(n=>Bf(n.address)===Bf(t)),o=r?r.imported?r:Me(e):void 0;return{signingWallet:r,rootWallet:o}},hC=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Et=(e,t)=>Me(e)||Yn(e)?!1:t==="all-users"||t==="users-without-wallets"&&!hC(e)?.length;function Ft(e){if(!e)return null;let t=mC(e.linked_accounts),r=er(t,"wallet"),o=er(t,"email"),n=er(t,"phone"),i=er(t,"google_oauth"),a=er(t,"twitter_oauth"),l=er(t,"discord_oauth"),s=er(t,"github_oauth"),d=er(t,"spotify_oauth"),u=er(t,"instagram_oauth"),m=er(t,"tiktok_oauth"),f=er(t,"linkedin_oauth"),g=er(t,"apple_oauth"),v=er(t,"farcaster"),C=er(t,"telegram"),b=e.mfa_methods.map(({type:_,verified_at:S})=>({type:_,verifiedAt:$(S)}));return{id:e.id,createdAt:$(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: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(_=>_.type),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}import{getAddress as eh}from"@ethersproject/address";import{isHexString as HC}from"@ethersproject/bytes";import VC from"eventemitter3";import TC from"@coinbase/wallet-sdk";import{jsx as Hf,jsxs as yC}from"react/jsx-runtime";var Vo=({style:e,...t})=>yC("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:[Hf("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),Hf("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 Yf}from"@ethersproject/providers";import{default as bC}from"eventemitter3";import wC from"eventemitter3";var gC=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation"],Vf=e=>gC.includes(e);import{ErrorCode as CC}from"@ethersproject/logger";import{ProviderErrors as Qn}from"@privy-io/js-sdk-core";var Di=class extends _e{constructor(){super("Wallet timeout");this.type="wallet_error"}},Ui=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 Tt(e);return e.code===CC.ACTION_REJECTED&&(t.details=Qn.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Tt(e):new _e("Unknown connector error",e)},Dr=class extends jt{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(Qn).find(i=>i.eipCode===o.code);this.details=n||Qn.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=Qn.E32002_CONNECTION_ALREADY_PENDING:this.details=Qn.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=Qn.E32002_WALLET_LOCKED))}},vC={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={...vC,...Qn};var Ze=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 Di,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||Gn,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)})}},on=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},Ka=class extends wC{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=Ir(s,this.chains,i,{appId:l}),this.rpcTimeoutDuration=Fi(i,"privy"),this.appId=l,this.walletIndex=d}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new on(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await be()||!this.address)throw new on("Disconnected",4900);return(await zf(o,void 0,void 0,this.address)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new on(`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 on(`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 Gf(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(La(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:Un(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 Un(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(Vf(r.method)){let o=await be();if(await Kf(),!o||!this.address)throw new on("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 on("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await be();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 Ze{constructor(r){super(r,r.rpcTimeoutDuration)}},nn=class extends Ze{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 EC=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},tr=class extends bC{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=Ai(r),this.walletClientType==="privy"&&J.put(ol(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=Fi(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(g=>wo(g.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===Ai(d))return;let m=this.chains.find(g=>g.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(g){if(EC(g,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"&&g.message?.includes("wallet_switchEthereumChain")?new _e(`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 _e("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new _e("Wallet is not currently connected.");return new Yf(new vo(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new _e("Wallet is not currently connected.");return new nn(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 Wa(()=>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=J.get(ol(i));this.chains.find(u=>u.id===Number(d))||(J.del(ol(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 Wa(()=>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=Ai(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"))}Nl(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 Yf(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 SC=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],Qf=(e,t)=>e.makeWeb3Provider({options:t}),Ol,Dl=class extends tr{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 Ze(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"),!Ol){let s=[o.id].concat(r.map(u=>u.id)),d=this.connectionOptions!=="eoaOnly"?s.filter(u=>!SC.includes(u)):[];d.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${d.join(", ")}`),Ol=new TC({appName:a,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(Qf(Ol,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:Vo,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(Qf(Ol,this.connectionOptions))}};var Ya=class extends tr{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:[Un(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:xi,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};import{jsx as Xf}from"react/jsx-runtime";var Bi=({style:e,...t})=>Xf("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:Xf("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 AC}from"react/jsx-runtime";var Hi=({style:e,...t})=>AC("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 Zf,jsxs as PC}from"react/jsx-runtime";var bo=({style:e,...t})=>PC("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:[Zf("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),Zf("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 Gi=class extends tr{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new Ze(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)}}},Vi,qi=class extends tr{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";Xs(this,Vi,void 0);this.proxyProvider=new Ze(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?Dd(this,Vi,{name:"MetaMask",icon:Hi,id:"io.metamask"}):a==="phantom"&&Dd(this,Vi,{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 Gu(this,Vi)??{name:"Browser Extension",icon:Bi,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)}}};Vi=new WeakMap;import{getAddress as VR}from"@ethersproject/address";import{Web3Provider as qR}from"@ethersproject/providers";import{isMobile as xC}from"react-device-detect";var Ul=class extends Gi{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{xC||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 Fl=class extends tr{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new Ze(void 0,Gn);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 Bl=class extends Fl{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:bo,id:"phantom"}}};import{EthereumProvider as DC,OPTIONAL_EVENTS as UC,OPTIONAL_METHODS as FC}from"@walletconnect/ethereum-provider";import{isMobile as BC}from"react-device-detect";import{createContext as kC,useContext as _C,useEffect as jd,useRef as MC,useState as IC}from"react";import{jsx as RC}from"react/jsx-runtime";function Jf({src:e,...t}){return RC("img",{src:e,...t,style:{display:"none"}})}import{jsx as LC,jsxs as NC}from"react/jsx-runtime";var jf=kC({ready:!1,app:vm,currentScreen:null,lastScreen:null,navigate:pt,navigateBack:pt,resetNavigation:pt,setModalData:pt,onUserCloseViaDialogOrKeybindRef:void 0}),WC=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],$f=e=>{let t=Le(),r=e.authenticated,[o,n]=IC(e.initialScreen);jd(()=>{!r&&!WC.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=MC(null);jd(()=>{e.open||(i.current=null)},[e.open]),jd(()=>{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 NC(jf.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&LC(Jf,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},x=()=>_C(jf);import{jsx as zi,jsxs as OC}from"react/jsx-runtime";var Qa=({style:e,...t})=>{let{app:r}=x();return OC("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:[zi("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),zi("g",{clipPath:"url(#clip0_1765_9946)",children:zi("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"})}),zi("defs",{children:zi("clipPath",{id:"clip0_1765_9946",children:zi("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var jr=class extends tr{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 Ze(void 0,this.rpcTimeoutDuration),d&&(this.walletEntry=yl[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=hl(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:Hi,id:"io.metamask"}:{name:Ju(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Qa,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=yl[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,Tf(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new Ui)};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=hl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Fi(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=$u(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 DC.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:UC,optionalMethods:FC,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(),BC&&this.walletEntry){let{redirect:l,href:s}=wf(a,this.walletEntry);Sf({href:s,name:this.walletEntry.displayName}),this.redirectUri=l;let d=bf(a,this.walletEntry);d?.redirect&&(this.fallbackUniversalRedirectUri=d.redirect),gl(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=hl(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 ep=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>HC(o)).map(o=>eh(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Fi=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||Gn:Gn,Xa=class extends VC{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 Ze: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=$d()}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(Vd)&&(J.getKeys().forEach(o=>{o.startsWith("walletconnect")&&J.del(o)}),J.del(Vd));let r=ju(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"),!en()&&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 Ka({walletProxy:r,address:l.address,rootAddress:o.address,rpcConfig:this.rpcConfig,chains:this.chains,appId:a,chainId:i.id,walletIndex:l.walletIndex}),u=new Ya({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 Ka({walletProxy:r,rootAddress:o,address:o,walletIndex:0,rpcConfig:this.rpcConfig,chains:this.chains,appId:i,chainId:n.id}),s=new Ya({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=$d(),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=$d(),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 Ul(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new qi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new qi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new qi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Gi(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Dl(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new Bl(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}));J.put(Gd,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=eh(r),this.emit("walletsUpdated")}};function Nl(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 GC=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",$d=()=>{let e=J.get(Gd);return e&&Array.isArray(e)&&e.map(o=>GC(o)).every(Boolean)?e:[]};import{ofetch as qC}from"ofetch";var zC=[sl,cl,ll,ml],Hl=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Ud,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=zC.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 zu}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw ae(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw ae(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw ae(o)}}};var th=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 an from"js-cookie";function rh(e){return e instanceof tn?"email":e instanceof rn?"sms":e instanceof Ho?"siwe":e instanceof Wi?"guest":e instanceof Ii?"custom_auth":e instanceof go?e.meta.provider:null}import{isSafari as KC}from"react-device-detect";function Vl(){return!(KC&&window.location.origin.startsWith("http://localhost"))}import*as oh from"jose";var Ur=class{static parse(t){try{return new Ur(t)}catch{return null}}constructor(t){this.value=t,this._decoded=oh.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 YC=30,Gl=class{constructor(){this.authenticateOnce=new Ye(async t=>this._authenticate(t)),this.linkOnce=new Ye(async t=>this._link(t)),this.refreshOnce=new Ye(this._refresh.bind(this)),this.destroyOnce=new Ye(this._destroy.bind(this)),this.forkSessionOnce=new Ye(this._forkSession.bind(this))}get token(){try{let t=J.get(Fn);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(el);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=J.get(Na);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=J.get(Da(t));if(typeof r=="string"){let o=new Ur(r);return o.isExpired()?(J.del(Da(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=an.get(tl);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!==cm}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Ur.parse(this.token);return t!==null&&!t.isExpired(YC)}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(Da(t),r):J.del(Da(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=rh(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:Ft(o),isNewUser:n,oAuthTokens:l}}catch(r){throw console.warn("Error authenticating session"),ot(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:Ft(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),ot(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(sl,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(cl,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),Ft(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 ot(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(ll,{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(Im,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw ot(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=J.get(Fn);if(J.put(Fn,t),!this.client?.useServerCookies){let o=Ur.parse(t)?.expiration;an.set(Fd,t,{sameSite:"Strict",secure:Vl(),expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else J.del(Fn),an.remove(Fd),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(J.put(el,t),this.client?.useServerCookies||an.set(tl,"t",{sameSite:"Strict",secure:Vl(),expires:30})):(J.del(el),an.remove(nm),an.remove(tl))}storeIdentityToken(t){if(this.client?.useServerCookies)return;J.put(Bd,t);let r=Ur.parse(t)?.expiration;an.set(Hd,t,{sameSite:"Strict",secure:Vl(),expires:r?new Date(r*1e3):void 0})}clearIdentityToken(){J.del(Bd),an.remove(Hd)}clearForkedToken(){J.del(Na)}};var tp,ql,nh,Za=class{constructor(t){Xs(this,ql);this.apiUrl=t.apiUrl||$s,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||tm,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=qu(this,ql,nh).call(this),tp||(tp=new Gl),this.session=tp,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 Xa(this.appId,t,r,o,n,i,a,l,s,d))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new Hl({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(pf,{action:"verify"})}catch(t){throw ae(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(uf,{});return th(t.options)}catch(t){throw ae(t)}}async acceptTerms(){try{let t=await this.api.post(mf,{});return Ft(t)}catch(t){throw ot(t)}}async unlinkEmail(t){try{let r=await this.api.post(zm,{address:t});return await this.getAuthenticatedUser()??Ft(r)}catch(r){throw ot(r)}}async unlinkPhone(t){try{let r=await this.api.post(Xm,{phoneNumber:t});return await this.getAuthenticatedUser()??Ft(r)}catch(r){throw ot(r)}}async unlinkWallet(t){try{let r=await this.api.post(Om,{address:t});return await this.getAuthenticatedUser()??Ft(r)}catch(r){throw ot(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(jm,{provider:t,subject:r});return await this.getAuthenticatedUser()??Ft(o)}catch(o){throw ot(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(Hm,{fid:t});return await this.getAuthenticatedUser()??Ft(r)}catch(r){throw ot(r)}}async unlinkTelegram(t){try{let r=await this.api.post(df,{telegram_user_id:t});return await this.getAuthenticatedUser()??Ft(r)}catch(r){throw ot(r)}}async unlinkPasskey(t){try{let r=await this.api.post(sf,{credential_id:t});return await this.getAuthenticatedUser()??Ft(r)}catch(r){throw ot(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(ml,{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(yf,t)}catch(r){throw ot(r)}}async initCoinbaseOnRamp(t){try{return this.api.post(gf,t)}catch(r){throw ot(r)}}async getCoinbaseOnRampStatus({partnerUserId:t}){try{return this.api.get(`${Cf}?partnerUserId=${t}`)}catch(r){throw ot(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 ot(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(Wm,{address:t,token:r})).nonce}catch(o){throw ot(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(Lm,{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(Nm,{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 Ft(a)}catch(a){throw ot(a)}}async setCustomMetadata(t){try{let r=await this.api.post("api/v1/users/custom_metadata",{custom_metadata:t});return await this.getAuthenticatedUser()??Ft(r)}catch(r){throw ot(r)}}};ql=new WeakSet,nh=function(){if(typeof window>"u")return null;try{let r=J.get(Oa);if(typeof r=="string"&&r.length>0)return r}catch{}let t=QC();try{return J.put(Oa,t),t}catch{return t}};import{Turnstile as ev}from"@marsidev/react-turnstile";import{useEffect as tv,useMemo as rv}from"react";import{useMemo as XC,useRef as ZC,useContext as JC,useState as rp,createContext as jC}from"react";import{jsx as $C}from"react/jsx-runtime";var ih=jC({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:pt,setError:pt,setExecuting:pt,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:pt,reset:pt,execute:pt}),yr=class extends jt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},ah=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=ZC(null),[i,a]=rp(),[l,s]=rp(),[d,u]=rp(!1),m=XC(()=>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 $C(ih.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 Zu(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new yr("Captcha failed",null,"captcha_timeout")}}},children:e})},Ae=()=>JC(ih);import{jsx as sh}from"react/jsx-runtime";var op=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=Ae(),[,s]=rv(()=>r?.split("t:")||[],[r]);if(tv(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return sh("div",{className:"hidden h-0 w-0",children:sh(ev,{...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 FS,useEffect as b0,useRef as BS,useState as HS}from"react";import S0 from"styled-components";function np(e){Ne("configureMfa",e)}import Sv from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import fh from"styled-components";import Xn,{css as lh}from"styled-components";import ap from"styled-components";import{Fragment as nv,jsx as ip,jsxs as iv}from"react/jsx-runtime";var it=({success:e,fail:t})=>iv(nv,{children:[ip(at,{className:e?"success":t?"fail":""}),ip(Ja,{className:e?"success":t?"fail":""})]}),at=ap.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
|
-
`,
|
|
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
|
-
`,Eo=e=>
|
|
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
|
|
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
|
-
`,F=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>
|
|
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
|
-
`,
|
|
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?
|
|
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
|
-
`,$r=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>
|
|
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
|
-
`,
|
|
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&&
|
|
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
|
-
`,
|
|
214
|
+
`,X_=ti.div`
|
|
215
215
|
/* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
|
|
216
216
|
height: 44px;
|
|
217
|
-
`,
|
|
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
|
|
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
|
|
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
|
-
`,
|
|
290
|
+
`,wv=$i(pp)`
|
|
291
291
|
&& {
|
|
292
292
|
background-color: transparent;
|
|
293
293
|
}
|
|
294
|
-
`,
|
|
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
|
-
`,
|
|
306
|
+
`,Ev=$i.div`
|
|
307
307
|
flex: 1;
|
|
308
308
|
align-items: center;
|
|
309
309
|
display: flex;
|
|
310
310
|
gap: 8px;
|
|
311
|
-
`,
|
|
311
|
+
`,Tv=$i.div`
|
|
312
312
|
flex: 1;
|
|
313
313
|
display: flex;
|
|
314
314
|
justify-content: flex-end;
|
|
315
|
-
`,
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
411
|
+
`,Xl=pn.div`
|
|
412
412
|
text-align: center;
|
|
413
413
|
font-size: 14px;
|
|
414
414
|
margin-bottom: 24px;
|
|
415
|
-
`,
|
|
416
|
-
${
|
|
417
|
-
`,
|
|
418
|
-
${
|
|
419
|
-
`,eo=
|
|
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
|
|
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
|
-
`,
|
|
435
|
+
`,_v=Ch.div`
|
|
436
436
|
display: flex;
|
|
437
437
|
flex-direction: column;
|
|
438
438
|
gap: 8px;
|
|
439
|
-
`;import
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
453
|
+
`,he=yt.div`
|
|
454
454
|
font-size: 0.875rem;
|
|
455
455
|
|
|
456
456
|
text-align: center;
|
|
457
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
494
|
+
`,Rt=yt.div`
|
|
495
495
|
display: flex;
|
|
496
496
|
flex-direction: column;
|
|
497
497
|
gap: 10px;
|
|
498
498
|
padding-top: 20px;
|
|
499
|
-
`,
|
|
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
|
-
`,
|
|
507
|
+
`,Jl=yt.div`
|
|
508
508
|
display: flex;
|
|
509
509
|
gap: 5px;
|
|
510
510
|
width: 100%;
|
|
511
|
-
`,
|
|
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
|
-
|
|
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
|
-
`,
|
|
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
|
-
|
|
553
|
+
`,ec=yt.div`
|
|
554
554
|
width: 100%;
|
|
555
555
|
display: flex;
|
|
556
556
|
justify-content: space-between;
|
|
557
|
-
`,
|
|
557
|
+
`,wh=yt.p`
|
|
558
558
|
text-align: left;
|
|
559
559
|
width: 100%;
|
|
560
560
|
color: var(--privy-color-foreground-3) !important;
|
|
561
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
606
|
+
`,tc=yt.div`
|
|
607
607
|
color: var(--privy-color-error);
|
|
608
|
-
`;import{Fragment as
|
|
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
|
|
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
|
|
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
|
-
`,
|
|
634
|
+
`,Fv=Sh.div`
|
|
635
635
|
display: flex;
|
|
636
636
|
flex-direction: column;
|
|
637
637
|
gap: 8px;
|
|
638
|
-
`;import
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
653
|
+
`,Ph=ar.div`
|
|
654
654
|
display: flex;
|
|
655
655
|
flex-direction: column;
|
|
656
656
|
align-items: center;
|
|
657
657
|
width: 100%;
|
|
658
|
-
`,
|
|
658
|
+
`,ea=ar(Tt)`
|
|
659
659
|
padding: 20px 0;
|
|
660
|
-
`,
|
|
660
|
+
`,yr=ar(Tt)`
|
|
661
661
|
gap: 16px;
|
|
662
|
-
`,
|
|
662
|
+
`,un=ar.div`
|
|
663
663
|
display: flex;
|
|
664
664
|
flex-direction: column;
|
|
665
665
|
width: 100%;
|
|
666
|
-
`,
|
|
666
|
+
`,je=ar.div`
|
|
667
667
|
display: flex;
|
|
668
668
|
flex-direction: column;
|
|
669
669
|
gap: 8px;
|
|
670
|
-
`,
|
|
670
|
+
`,jM=ar.div`
|
|
671
671
|
display: flex;
|
|
672
672
|
flex-direction: column;
|
|
673
673
|
justify-content: space-between;
|
|
674
674
|
height: 100%;
|
|
675
|
-
`,
|
|
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
|
-
`,
|
|
698
|
+
`,re=ar.div`
|
|
699
699
|
height: 16px;
|
|
700
|
-
`,
|
|
700
|
+
`,oe=ar.div`
|
|
701
701
|
height: 12px;
|
|
702
|
-
`,
|
|
702
|
+
`,Rh=ar.div`
|
|
703
703
|
position: relative;
|
|
704
|
-
`,
|
|
704
|
+
`,ta=ar.div`
|
|
705
705
|
height: ${e=>e.height??"12"}px;
|
|
706
|
-
`,
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
|
|
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
|
-
`,
|
|
843
|
+
`,Wh=ai.span`
|
|
844
844
|
font-weight: 500;
|
|
845
845
|
word-break: break-all;
|
|
846
|
-
`;import
|
|
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
|
|
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 zh}from"react-device-detect";import Kh from"styled-components";import s4 from"@heroicons/react/24/outline/WalletIcon";import{jsx as hp}from"react/jsx-runtime";var nc=({icon:e,name:t})=>typeof e=="string"?hp("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?hp(s4,{}):e?hp(e,{}):null;import{jsx as ro,jsxs as Nh}from"react/jsx-runtime";var Oh=({...e})=>Nh("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[ro("defs",{children:Nh("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 ns}from"react/jsx-runtime";var Dh=({style:e,...t})=>ns("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"})}),ns("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"}})]}),ns("defs",{children:[ns("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"})]}),ns("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 vr,jsxs as ji}from"react/jsx-runtime";var Uh=e=>ji("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)"}),ji("defs",{children:[ji("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"})]}),ji("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"})]}),ji("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"})]}),ji("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 Fh=({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 ic,jsxs as l4}from"react/jsx-runtime";var Bh=({style:e,...t})=>l4("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:[ic("rect",{width:"28",height:"28",rx:"3",fill:"#12FF80"}),ic("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"}),ic("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"}),ic("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 Hh}from"react/jsx-runtime";var Vh=({style:e,...t})=>Hh("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"}),Hh("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 is,jsxs as Gh}from"react/jsx-runtime";var qh=({style:e,...t})=>Gh("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:[Gh("g",{clipPath:"url(#clip0_1704_1423)",children:[is("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"}),is("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"})]}),is("defs",{children:is("clipPath",{id:"clip0_1704_1423",children:is("rect",{width:"176",height:"176",fill:"white"})})})]});var Br={coinbase_wallet:{logo:Vo,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:Vo,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Hi,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:bo,displayName:"Phantom"},rainbow:{logo:Fh,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Qa,displayName:"WalletConnect"},zerion:{logo:qh,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:Oh,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:Dh,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:Vh,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:Uh,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:Bh}},dn=(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"},ac=(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 Qa};function $i(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 sc,jsxs as p4}from"react/jsx-runtime";var ti=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=x(),{connectWallet:a}=L(),l=xt(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,d=window.matchMedia("(display-mode: standalone)").matches,u;return n.connectorType==="phantom"?u=()=>{en()?(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(zh?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&zh&&!d&&!Zs()?u=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:u=()=>{$i(window.navigator.userAgent)&&!event?.isTrusted||(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},p4(c4,{onClick:u,children:[sc(nc,{icon:ac(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),sc("span",{children:dn(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),l?.walletClientType===s?sc(d4,{color:"gray",children:"Recent"}):sc("span",{id:"connect-text",children:"Connect"})]})},c4=Kh(Pe)`
|
|
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
|
-
`,
|
|
898
|
+
`,f4=Zh(jt)`
|
|
899
899
|
margin-left: auto;
|
|
900
|
-
`;import{Fragment as
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
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
|
|
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
|
-
`,
|
|
1075
|
-
${
|
|
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
|
-
`,
|
|
1083
|
+
`,yn=kt.div`
|
|
1084
1084
|
display: flex;
|
|
1085
1085
|
flex-direction: column;
|
|
1086
1086
|
justify-content: center;
|
|
1087
1087
|
flex-grow: 1;
|
|
1088
|
-
`,
|
|
1089
|
-
${e=>e.hideAnimations&&
|
|
1088
|
+
`,gn=kt(F)`
|
|
1089
|
+
${e=>e.hideAnimations&&Wp`
|
|
1090
1090
|
&& {
|
|
1091
1091
|
transition: none;
|
|
1092
1092
|
}
|
|
1093
1093
|
`}
|
|
1094
|
-
`,
|
|
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
|
-
`,
|
|
1110
|
-
${
|
|
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
|
-
`,
|
|
1122
|
-
${
|
|
1123
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
1151
|
+
`,ds=kt.div`
|
|
1152
1152
|
display: flex;
|
|
1153
1153
|
flex-direction: column;
|
|
1154
1154
|
gap: 10px;
|
|
1155
1155
|
padding-bottom: 1rem;
|
|
1156
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
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
|
-
`,
|
|
1257
|
+
`,Rw=ms.div`
|
|
1258
1258
|
display: inline-block;
|
|
1259
1259
|
vertical-align: middle;
|
|
1260
|
-
`,
|
|
1260
|
+
`,Wy=ms.svg`
|
|
1261
1261
|
fill: none;
|
|
1262
1262
|
stroke: white;
|
|
1263
1263
|
stroke-width: 3px;
|
|
1264
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
${
|
|
1290
|
+
${Ly}:focus + & {
|
|
1291
1291
|
box-shadow: 0 0 0 1px ${e=>e.color};
|
|
1292
1292
|
}
|
|
1293
1293
|
|
|
1294
|
-
${
|
|
1294
|
+
${Wy} {
|
|
1295
1295
|
visibility: ${e=>e.checked?"visible":"hidden"};
|
|
1296
1296
|
}
|
|
1297
|
-
`;import{Fragment as
|
|
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
|
|
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
|
-
|
|
1303
|
+
`,$w=zy.div`
|
|
1304
1304
|
display: flex;
|
|
1305
1305
|
flex-direction: column;
|
|
1306
1306
|
height: 100%;
|
|
1307
|
-
`;import
|
|
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
|
|
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
|
-
`,
|
|
1319
|
+
`,E5=$y.div`
|
|
1320
1320
|
display: flex;
|
|
1321
1321
|
flex-direction: column;
|
|
1322
1322
|
gap: 8px;
|
|
1323
|
-
`;import{useEffect as
|
|
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
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
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
|
-
`,
|
|
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
|
|
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
|
|
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
|
-
${
|
|
1522
|
-
`;import
|
|
1523
|
-
C51.4,114,114.5,51,192.3,51C249.8,51,299.1,86,321,135.9h62.5V0z`})});import{jsx as fa,jsxs as Rg}from"react/jsx-runtime";var kg=e=>Rg("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[fa("rect",{width:"199.4",height:"207.623",fill:"#121212"}),Rg("g",{"clip-path":"url(#clip0_2303_643)",children:[fa("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),fa("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"})]}),fa("defs",{children:fa("clipPath",{id:"clip0_2303_643",children:fa("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]});import{jsx as hs,jsxs as y6}from"react/jsx-runtime";var _g=e=>y6("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:[hs("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),hs("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),hs("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),hs("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),hs("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]});import{jsx as Hp,jsxs as g6}from"react/jsx-runtime";var Mg=e=>g6("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Hp("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),Hp("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"}),Hp("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 Ig,jsxs as C6}from"react/jsx-runtime";var Wg=e=>C6("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Ig("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),Ig("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 Nc,jsxs as Lg}from"react/jsx-runtime";var Ng=e=>Lg("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Nc("rect",{width:"30",height:"30",fill:"url(#pattern0)"}),Lg("defs",{children:[Nc("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:Nc("use",{xlinkHref:"#image0_1_18",transform:"scale(0.00041841)"})}),Nc("image",{id:"image0_1_18",width:"2390",height:"2390",xlinkHref:"data:image/png;base64,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"})]})]});import{jsx as Og}from"react/jsx-runtime";var w6={[Zr.id]:bg,[nl.id]:Tg,[Wr.id]:Ag,[il.id]:xg,[mm.id]:kg,[Lr.id]:_g,[ho.id]:Mg,[Nr.id]:Wg,[gm.id]:Ng},ha=({chainId:e,...t})=>{let r=w6[e];return r?Og(r,{...t}):Og(v6,{...t})};import{Fragment as T6,jsx as ys,jsxs as Dg}from"react/jsx-runtime";var Fg=({balance:e,className:t,chain:r})=>ys(Rm,{className:t,$state:void 0,children:ys(Oc,{balance:e,chain:r})}),Oc=({balance:e,chain:t})=>Dg(T6,{children:[Dg(b6,{children:[ys(E6,{chainId:t.id}),ys(Vt,{children:t.name})]}),ys($t,{isLoading:!1,isPulsing:!1,color:"gray",children:e})]}),b6=Ug.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
|
-
`,
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
1565
|
+
`,Kp=bs(x6)`
|
|
1566
1566
|
height: 1rem;
|
|
1567
1567
|
margin-left: 0.5rem;
|
|
1568
|
-
`,
|
|
1569
|
-
${
|
|
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
|
-
${
|
|
1576
|
+
${Kp} {
|
|
1577
1577
|
transition: rotate 100ms ease-in;
|
|
1578
1578
|
}
|
|
1579
1579
|
|
|
1580
1580
|
&[aria-expanded='true'] {
|
|
1581
|
-
${
|
|
1581
|
+
${Kp} {
|
|
1582
1582
|
rotate: -180deg;
|
|
1583
1583
|
}
|
|
1584
1584
|
}
|
|
1585
|
-
`;import Kr,{keyframes as K6}from"styled-components";import k6 from"@heroicons/react/24/outline/ClockIcon";import _6 from"@heroicons/react/24/outline/TrashIcon";import M6 from"@heroicons/react/24/solid/CheckBadgeIcon";import I6 from"@heroicons/react/24/solid/CheckCircleIcon";import W6 from"@heroicons/react/24/solid/LockClosedIcon";import{useEffect as L6,useState as vs}from"react";import zr,{css as Kg}from"styled-components";import{jsx as Vg}from"react/jsx-runtime";var si=({style:e,...t})=>Vg("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:Vg("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 Ge,jsxs as Gg}from"react/jsx-runtime";var li=({style:e,...t})=>Gg("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:[Gg("g",{clipPath:"url(#clip0_113_33841)",children:[Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"})]}),Ge("defs",{children:Ge("clipPath",{id:"clip0_113_33841",children:Ge("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});import{Fragment as Gp,jsx as we,jsxs as dr}from"react/jsx-runtime";var qg=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=vs([]),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 dr("div",{children:[we(B6,{children:"Your passkeys"}),dr(Qg,{children:[e.slice(0,a).map(d=>dr(G6,{children:[dr("div",{children:[we(H6,{children:l(d)}),dr(V6,{children:["Last used: ",(d.latestVerifiedAt??d.verifiedAt).toLocaleString()]})]}),we(z6,{disabled:n.includes(d.credentialId),onClick:()=>s(d.credentialId),children:n.includes(d.credentialId)?we(Eo,{}):we(_6,{height:"1.6em"})})]},d.credentialId)),e.length>2&&!t&&we(qp,{onClick:o,children:"View all"})]})]})},N6=()=>dr(Qg,{children:[dr(ar,{children:[we(ir,{children:we(M6,{})}),"Log in with Touch ID, Face ID, or a security key."]}),dr(ar,{children:[we(ir,{children:we(W6,{})}),"More secure than a password."]}),dr(ar,{children:[we(ir,{children:we(k6,{})}),"Takes seconds to set up and use."]})]}),Yg=()=>{let{user:e,unlinkPasskey:t}=K(),{linkWithPasskey:r,closePrivyModal:o}=L(),n=e?.linkedAccounts.filter(C=>C.type==="passkey"),[i,a]=vs(!1),[l,s]=vs(""),[d,u]=vs(!1),[m,f]=vs(!1);L6(()=>{n.length===0&&f(!1)},[n.length]);let g=()=>{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)})},v=async C=>(a(!0),await t(C).then(()=>u(!0)).catch(b=>{if(b instanceof jt&&b.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{a(!1)}));return d?dr(Gp,{children:[we(R,{onClose:()=>o()},"header"),we(Fe,{children:we(Je,{status:"success",children:we(I6,{})})}),we(zg,{children:"Passkey added"}),we(U6,{children:"From now on, you can use your passkey to log in."}),we(kt,{children:we(F,{onClick:()=>o(),children:"Done"})}),we(Z,{})]}):m?dr(Gp,{children:[we(R,{backFn:()=>f(!1),onClose:()=>o()},"header"),we(qg,{passkeys:n,expanded:m,onUnlink:v,onExpand:()=>f(!0)}),we(Z,{})]}):dr(Gp,{children:[we(R,{onClose:()=>o()},"header"),we(Fe,{children:dr(Uc,{children:[we(si,{}),we(li,{})]})}),we(zg,{children:"Secure your account with a passkey"}),we(F6,{}),n.length===0?we(N6,{}):we(qg,{passkeys:n,expanded:m,onUnlink:v,onExpand:()=>f(!0)}),dr(kt,{style:{marginTop:"12px"},children:[l&&we(O6,{fail:!0,children:l}),we(F,{onClick:g,loading:i,children:"Add new passkey"})]}),we(Z,{})]})},Uc=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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
1635
|
-
${
|
|
1636
|
-
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
1649
|
+
`,H6=Gr.div`
|
|
1650
1650
|
font-size: 0.875rem;
|
|
1651
1651
|
text-align: center;
|
|
1652
1652
|
margin-top: 10px;
|
|
1653
|
-
`,
|
|
1653
|
+
`,V6=Gr.div`
|
|
1654
1654
|
height: 32px;
|
|
1655
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
1705
|
-
${
|
|
1706
|
-
`;var
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
1728
|
+
`,Ea=qr.div`
|
|
1729
1729
|
display: flex;
|
|
1730
1730
|
align-items: baseline;
|
|
1731
1731
|
gap: 4px;
|
|
1732
|
-
`,
|
|
1732
|
+
`,Hc=qr.div`
|
|
1733
1733
|
font-size: 42px !important;
|
|
1734
|
-
`,
|
|
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
|
-
`,
|
|
1749
|
+
`,r1=qr.div`
|
|
1750
1750
|
cursor: pointer;
|
|
1751
1751
|
padding-left: 4px;
|
|
1752
|
-
`,
|
|
1752
|
+
`,Ta=qr.div`
|
|
1753
1753
|
font-size: 18px;
|
|
1754
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
|
|
1769
|
+
`,n1=qr(Qp)`
|
|
1770
1770
|
margin-top: 16px;
|
|
1771
|
-
`,
|
|
1771
|
+
`,Z6=X6`
|
|
1772
1772
|
from {
|
|
1773
1773
|
opacity: 0;
|
|
1774
1774
|
}
|
|
1775
1775
|
to {
|
|
1776
1776
|
opacity: 1;
|
|
1777
1777
|
}
|
|
1778
|
-
`,
|
|
1778
|
+
`,i1=qr(dn)`
|
|
1779
1779
|
border-radius: var(--privy-border-radius-md) !important;
|
|
1780
|
-
animation: ${
|
|
1781
|
-
`;import{Fragment as
|
|
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 i1,jsx as Yr,jsxs as zp}from"react/jsx-runtime";var a1=()=>{let{rpcConfig:e,appId:t,closePrivyModal:r}=L(),{navigate:o,setModalData:n,app:i,data:a}=x(),{wallets:l}=Bo(),[s,d]=zt(!1),[u,m]=zt(0n),[f,g]=zt(!1),[v,C]=zt(null),[b,A]=zt(null),[_,S]=zt([]),[P,E]=zt(0),[k,D]=zt(!1),[H,M]=zt(!1),[X,W]=zt(!1),[Y,Ce]=zt(!1),{erc20ContractInfo:q,erc20Address:pe,address:Q,chain:ee,amount:ue}=a.funding;vn(()=>{pe&&!q&&C(new Error("Unable to fetch token details"))},[]);let me=!!pe&&!!q,Te=me?BigInt(parseFloat(ue)*10**q.decimals):r7(ue),ce=l[0],[Se,ft]=zt(null);vn(()=>{(async()=>{if(!ce)return;let Oo=await ce.getEthereumProvider(),Ue=$6({account:ce.address,transport:e7(Oo)}).extend(o7);ft(Ue)})().catch(console.error)},[ce]);let[tt,le]=zt(0n);vn(()=>{o1({chain:ee,transport:n1(Uo(ee,e,t))}).getBalance({address:Q}).then(le).catch(console.error)},[]);let[nt,mr]=zt(0n);vn(()=>{me&&vg({chain:ee,address:Q,appId:t,rpcConfig:e,erc20Address:pe}).then(wt=>mr(wt.balance)).catch(console.error)},[]);let{tokenPrice:vt}=_o({chainId:ee.id}),[I,Ke]=zt({to:Q,chain:ee,value:Te,data:void 0});vn(()=>{(async()=>{if(!Se||!ce||k||X)return;D(!0);let Oo,Ue=o1({chain:ee,transport:n1(Uo(ee,e,t))});if(me&&!I.data){if(!await Ue.simulateContract({address:pe,chain:ee,abi:fs,functionName:"transfer",args:[Q,Te],account:ce.address}).catch(po=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",po)})){D(!1),g(!0);return}D(!1),Ke({to:pe,chain:ee,data:t7({abi:fs,functionName:"transfer",args:[Q,Te]}),value:"0x0"});return}try{Oo=await Ue.prepareTransactionRequest({account:ce.address,to:I.to,chain:I.chain,data:I.data,value:BigInt(I.value??0)})}catch(Xt){console.error(Xt),_.length>1&&A(Xt.shortMessage??"Something went wrong")}if(!Oo){D(!1),g(!0);return}D(!1),W(!0),d(!0),m(Oo.gas);try{await Se.switchChain({id:I.chain.id})}catch{await Se.addChain({chain:I.chain}),await Se.switchChain({id:I.chain.id})}let Do;try{Do=await Se.sendTransaction(Oo)}catch(Xt){console.error(Xt);let po=Xt;po.name==="TransactionExecutionError"&&(_.length<1?C(new w(po.shortMessage,void 0,"transaction_failure")):A(Xt.shortMessage??"Something went wrong"))}if(!Do){W(!1);return}await Se.waitForTransactionReceipt({hash:Do}),W(!1),Ce(!0)})().catch(console.error)},[Se,I]),vn(()=>{(async()=>{if(!f||!Se||!ce)return;let Ue=Mc(i.chains).filter(Xe=>Xe.id!==a.funding.chain.id&&!!Xe.testnet==!!a.funding.chain.testnet);me&&Ue.unshift(a.funding.chain);let Do=await Cg({chains:Ue,address:ce.address,appId:t,rpcConfig:e}),Xt=me?Do.filter(Xe=>Xe.balance>0n):Do.filter(Xe=>Xe.balance>Te);if(Xt.length<1){C(new w(`Wallet ${Ut(ce.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}Xt.sort((Xe,Ma)=>Number(Ma.balance-Xe.balance));let po=(await Promise.allSettled(Xt.map(async Xe=>({quote:await yg({isTestnet:!!a.funding?.chain.testnet,input:hg({amount:Te.toString(),user:ce.address,recipient:Q,destinationChainId:ee.id,destinationCurrency:pe,originChainId:Xe.chain.id})}),...Xe})))).filter(Xe=>Xe.status==="fulfilled").map(Xe=>Xe.value);if(po.length<1){C(new w(`Wallet ${Ut(ce.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}let Ei=po.map(Xe=>({bridgeTx:gg(Xe.quote),balance:Xe.balance,chain:Xe.chain})).filter(Xe=>!!Xe.bridgeTx);if(Ei.length>1){S(Ei);return}let uo=Ei[0];if(!uo){C(new w(`Wallet ${Ut(ce.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}M(!0),Ke({data:uo.bridgeTx.data,to:uo.bridgeTx.to,value:uo.bridgeTx.value,chain:uo.chain})})().catch(console.error)},[f]),vn(()=>{if(!v)return;let wt={error:v,previousScreen:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};n({funding:a?.funding,sendTransaction:a?.sendTransaction,errorModalData:wt}),o("ERROR_SCREEN",!1)},[v]);let Qt=ce?dn(ce.walletClientType,ce.connectorType,ce.walletClientType)||"wallet":null,U=!me&&vt?Mi(a?.funding?.amount??"0",vt):void 0,B=me?u:Ba([u,Te]),se=B&&vt?yo(B,vt):void 0,rt=B?bt(B,"ETH"):void 0,On=u&&vt?yo(u,vt):void 0,bi=u?bt(u,"ETH"):void 0;if(vn(()=>{if(!Y)return;let wt=setTimeout(r,om);return()=>clearTimeout(wt)},[Y]),Y)return zp(i1,{children:[Yr(It,{}),Yr(oe,{}),zp(Cr,{children:[Yr(j6,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),Yr(ve,{title:"Success!",description:`You\u2019ve successfully added ${ue} ${me?q.symbol:ee.nativeCurrency.symbol} to your ${i.name} wallet. It may take a minute before the funds are available to use.`})]}),Yr(ne,{}),Yr(G,{})]});let zs=me?`${Ic({amount:nt,decimals:q.decimals})} ${q.symbol}`:bt(tt,ee.nativeCurrency.symbol,3,!0),Xr=_[P];return _.length>1&&Xr?Yr(t1,{displayName:Qt,configuredFundingChain:ee,formattedBalance:zs,fundingAmount:ue,fundingCurrency:me?q.symbol:ee.nativeCurrency.symbol,fundingAmountInUsd:U,options:_,selectedOption:Xr,isPreparing:k,isSubmitting:X,errorMessage:b,onSubmit:()=>{Ke({to:Xr.bridgeTx.to,data:Xr.bridgeTx.data,value:Xr.bridgeTx.value,chain:Xr.chain})},onSelect:wt=>{wt!==P&&(A(null),E(wt))}}):s&&u&&ce&&a?.funding?Yr(r1,{wallet:ce,displayName:Qt,addressToFund:Q,isBridging:H,isErc20Flow:me,totalPriceInUsd:se,totalPriceInNativeCurrency:rt,gasPriceInUsd:On,gasPriceInNativeCurrency:bi,chain:a.funding.chain}):zp(i1,{children:[Yr(It,{}),Yr(ma,{}),Yr("div",{style:{marginTop:"1rem"}}),Yr(G,{})]})};import c7 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import d7 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as p7,useMemo as u7,useState as u1}from"react";import m1 from"styled-components";var Hc=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 w("Auth flow has no API instance");try{return await this.api.post(pl,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(t){throw ae(t)}}async link(){if(!this.api)throw new w("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 ae(t)}}};async function Vc({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 s1({api:e,appId:t}){let r=qn(),o=Li(),n=await Ni(r);try{let{url:i}=await e.post(dl,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:n,state_code:o});return{url:i,stateCode:o,codeVerifier:r}}catch(i){throw ae(i)}}async function l1({appId:e,stateCode:t,codeVerifier:r,authorizationCode:o,action:n,client:i}){if(!o||!t)throw new w("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(o==="undefined")throw new w("User denied confirmation during cross-app auth flow");try{let a=new Hc({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=ae(a);throw l.privyErrorCode?new w(l.message||"Invalid code during cross-app auth flow.",void 0,l.privyErrorCode):l.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 Gc=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(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 Vc({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,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 w("Transactions require a valid token");let d=window.open(void 0,void 0,bs({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 u=new URL(`${s.apiUrl}/oauth/transact`);return u.searchParams.set("token",l||""),u.searchParams.set("request",n7(o)),d.location=u.href,new Promise((f,g)=>{let C=setTimeout(()=>{_(),g(new w("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),b=setInterval(()=>{d.closed&&(_(),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&&(_(),f(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&&(_(),g(S.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:S.data.error,address:t}})))};window.addEventListener("message",A);let _=()=>{d.close(),clearInterval(b),clearTimeout(C),window.removeEventListener("message",A)}})},n7=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),bs=({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 wa="sdk_fiat_on_ramp_completed_with_status";var i7=new Set([Lr.id,Wr.id,ho.id,Nr.id,Zr.id]),a7=new Set([Lr.id,Wr.id,Nr.id,ho.id]),s7={[Lr.id]:"ethereum",[Wr.id]:"base",[ho.id]:"optimism",[Nr.id]:"polygon",[Zr.id]:"arbitrum"},c1=(e,t)=>{switch(t){case"native-currency":return i7.has(e);case"USDC":return a7.has(e);default:return console.warn("Unknown asset passed to Coinbase Onramp"),!1}};function d1(e){let t=s7[e];if(!t)throw new w(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}function l7(e){return e.startsWith(".")?`0${e}`:e}var p1=({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",l7(t)),o.searchParams.set("defaultNetwork",r),o.searchParams.set("partnerUserId",e.partner_user_id),{url:o}};import{Fragment as y1,jsx as Tr,jsxs as Es}from"react/jsx-runtime";var m7=240,f1=1500,f7=Math.floor(m7*1e3/f1),h1=()=>{let{data:e,setModalData:t,navigate:r}=x(),{closePrivyModal:o,createAnalyticsEvent:n,initCoinbaseOnRamp:i,getCoinbaseOnRampStatus:a}=L(),l=e?.funding,s=l.isUSDC?"USDC":"ETH",[d,u]=u1(!1),[m,f]=u1(!1);return p7(()=>{if(d)return;u(!0);let g=async()=>{try{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp"}});let C=window.open(void 0,void 0,bs({w:440,h:680})),b=d1(l.chain.id),A=await i({addresses:[{address:l.address,blockchains:[b]}],assets:[s]}),{url:_}=p1({input:A,amount:l.amount,blockchain:b});if(!C)throw new Error("Unable to initiate Coinbase Onramp flow.");C.location=_.toString();let S=0,P=!1;for(;S<f7;){S++;let{status:E}=await a({partnerUserId:A.partner_user_id});if(E==="success"){P=!0;break}if(E==="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(k=>setTimeout(k,f1))}if(!P)throw new Error("Timed out waiting for transaction response from Coinbase Onramp.");n({eventName:wa,payload:{status:"success",provider:"coinbase-onramp"}}),f(!0)}catch(C){console.error(C),n({eventName:wa,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)}},v=setTimeout(()=>void g(),500);return()=>clearTimeout(v)},[]),Es(y1,{children:[Tr(R,{title:"Fund account"},"header"),Tr(y7,{isSucccess:m,onClickCta:o}),Tr(G,{})]})},h7=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:""},y7=({isSucccess:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=u7(()=>h7(e),[e]);return Es(y1,{children:[Es(b7,{children:[Tr(v7,{isSucccess:e}),Es(Qe,{children:[Tr("h3",{children:r}),Tr(w7,{children:o})]})]}),n&&Tr(F,{onClick:t,children:n})]})},g7=e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)",C7=e=>e?d7:()=>Tr(c7,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),v7=({isSucccess:e})=>{if(!e){let o="var(--privy-color-foreground-4)";return Es("div",{style:{position:"relative"},children:[Tr(at,{color:o,style:{position:"absolute"}}),Tr(Ja,{color:o}),Tr(Vo,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let t=C7(e),r=g7(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})})},w7=m1.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
|
-
`,
|
|
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
|
|
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 x7,http as R7}from"viem";var qc=async({address:e,chain:t,rpcConfig:r,privyAppId:o})=>{try{let n=x7({chain:t,transport:R7(Uo(t,r,o))}),[i,a]=await Promise.all([n.readContract({abi:C1,address:e,functionName:"symbol"}),n.readContract({abi:C1,address:e,functionName:"decimals"})]);return{decimals:a,symbol:i}}catch(n){return console.log(n),null}},C1=[{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 k7}from"ofetch";import{useEffect as _7,useRef as M7,useState as I7}from"react";var zc="moonpay",W7=new Set([Lr.id,Zr.id,Wr.id,Nr.id]),L7=new Set([Lr.id,Zr.id,ho.id,Wr.id,Nr.id]);function v1(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 il.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 w1(e){return parseFloat(e)}function b1(e){return!!e&&e.config!==void 0&&e.provider!==void 0}function E1(e){return!!e&&(e.chain!==void 0||e.amount!==void 0)}async function T1(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 N7(e,t){let r=t?am:im,o=t?lm:sm;return k7(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function S1(e,t=!1){let[r,o]=I7(null),{createAnalyticsEvent:n}=L(),{data:i,navigate:a,setModalData:l}=x(),s=i?.funding,d=M7(0);return _7(()=>{let u=setInterval(async()=>{if(e)try{let[m]=await N7(e,t),f=m.status==="waitingAuthorization"&&m.paymentMethod==="credit_debit_card"?"pending":m.status;if(["failed","completed","awaitingAuthorization"].includes(f)&&(n({eventName:wa,payload:{status:f,provider:zc,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}}),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:wa,payload:{status:"serviceFailure",provider:zc}}),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 A1=(e,t)=>{switch(t){case"native-currency":return W7.has(e);case"USDC":return L7.has(e);default:return console.warn("Unknown asset passed to MoonPay Onramp"),!1}};import{jsx as Kp,jsxs as O7}from"react/jsx-runtime";var ba=({size:e=61,...t})=>Kp("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:O7("g",{id:"moonpay_symbol_wht 2",children:[Kp("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),Kp("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 R1,jsx as gt,jsxs as wn}from"react/jsx-runtime";var k1=()=>{let{wallets:e}=Bo(),{navigate:t,data:r,setModalData:o}=x(),n=Le(),i=r?.funding,a=F7(null),[l,s]=B7(!1);x1(()=>{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});x1(()=>{i.erc20Address&&i.chain&&!i.erc20ContractInfo&&qc({address:i.erc20Address,chain:i.chain,rpcConfig:n.rpcConfig,privyAppId:n.id}).then(E=>o({...r,funding:{...r.funding,erc20ContractInfo:E?{symbol:E.symbol,decimals:E.decimals}:void 0}})).catch(console.error)},[i.erc20Address,i.chain]);let m=u?Mi(i.amount,u):void 0,f=e.find(E=>P1(E.address)===P1(i.address)),g=f&&f.walletClientType!=="privy"?dn(f.walletClientType,f.connectorType,f.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",_=A&&A1(Number(i.chain.id),A),S=A&&c1(Number(i.chain.id),A),P=i.erc20Address||!i.erc20Address&&!i.isUSDC;return wn(R1,{children:[gt(It,{}),wn("h3",{children:["Add funds to your"," ",g?.toLowerCase().endsWith("wallet")?g:g+" wallet"]}),gt(cn,{style:{marginTop:"32px"},children:gt(ya,{children:b?gt(ma,{size:"50px"}):wn(R1,{children:[wn(ga,{onClick:()=>a.current?.focus(),children:[gt(Zg,{ref:a,value:i.amount,onFocus:()=>s(!0),onBlur:()=>s(!1),onChange:E=>{let k=E.target.value;/^[0-9.]*$/.test(k)&&k.split(".").length-1<=1&&o({...r,funding:{...i,amount:k}})}}),gt(Ca,{children:i.erc20Address?i.erc20ContractInfo?.symbol:i.chain.nativeCurrency.symbol}),!l&>(Jg,{children:gt(D7,{width:12,height:12})})]}),!i.erc20Address&>(va,{children:m&&C?m:""})]})})}),wn(Xg,{children:[i.errorMessage&>(g1,{children:i.errorMessage}),d.sort().map(E=>{switch(E){case"moonpay":return _?wn(Pe,{disabled:!C||b,onClick:()=>{t("MOONPAY_PROMPT_SCREEN")},children:[gt(Fc,{children:gt(ba,{style:{width:24}})}),"Moonpay"]},E):null;case"coinbase-onramp":return S?wn(Pe,{disabled:!C||b,onClick:()=>{t("COINBASE_ONRAMP_STATUS_SCREEN")},children:[gt(Fc,{children:gt(Vo,{style:{width:24}})}),"Coinbase Onramp"]},E):null;case"external":return P?wn(Pe,{disabled:!C||b,onClick:()=>{t("FUNDING_TRANSFER_FROM_WALLET_SCREEN")},children:[gt(Fc,{children:gt(U7,{style:{width:24}})}),"Transfer from wallet"]},E):null}}),gt($g,{disabled:!C,onClick:()=>t("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),gt(G,{})]})};import{formatUnits as H7}from"@ethersproject/units";import V7 from"@heroicons/react/24/outline/DocumentDuplicateIcon";import G7 from"@heroicons/react/24/outline/InformationCircleIcon";import q7 from"@heroicons/react/24/outline/QrCodeIcon";import{useEffect as z7,useMemo as K7,useState as Yp}from"react";import Ea from"styled-components";import{Fragment as Kc,jsx as qe,jsxs as Nt}from"react/jsx-runtime";var Y7=2e3,_1=()=>{let{wallets:e}=Bo(),{app:t,data:r,setModalData:o,navigate:n,lastScreen:i}=x(),{chains:a,rpcConfig:l,appId:s,closePrivyModal:d}=L(),[u,m]=Yp("default"),[f,g]=Yp(void 0),v=r?.funding,{tokenPrice:C}=_o({chainId:v.chain.id}),b=C?Mi(v.amount,C):void 0,A=e.find(E=>Ut(E.address)===Ut(v.address)),_=A&&A.walletClientType!=="privy"?dn(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"),qe(Kc,{});z7(()=>{let E=Ir(v.chain.id,a,l,{appId:s});function k(){E.getBalance(v.address).then(H=>g(parseFloat(H7(H,"ether")))).catch(()=>g(void 0))}let D=setInterval(k,Y7);return k(),()=>clearInterval(D)},[]);let S=K7(()=>f!==void 0?f>=parseFloat(v.amount):!1,[f,v.amount]),P=Nt(Kc,{children:[qe(_i,{title:"Your wallet",errMsg:void 0,isLoading:!v||f===void 0,isPulsing:!S,balance:`${f!==void 0?f.toPrecision(2):""} ETH`,address:v.address,statusColor:S?"green":"gray"}),S&&qe(e1,{onClick:()=>d(),children:"Close"})]});return u==="qr-code"?Nt(Kc,{children:[qe(R,{backFn:()=>m("default")}),Nt(cn,{style:{gap:"24px",marginBottom:"24px"},children:[Nt("div",{children:[qe(fe,{children:"Scan QR code"}),Nt(ye,{children:["Scan this code using your mobile wallet to send funds to your ",_," ","wallet."]})]}),qe(Cn,{url:v.address,size:200,squareLogoElement:Q7}),P]}),qe(G,{})]}):Nt(Kc,{children:[qe(It,{}),qe(ve,{title:"Send funds",description:"Send funds directly to your wallet by copying your wallet address or scanning a QR code."}),Nt(cn,{style:{gap:"16px"},children:[Nt(J7,{children:[qe(G7,{height:"20px",width:"20px",color:"var(--privy-color-accent-light)"}),Nt(j7,{children:["Make sure to send on ",v.chain.name,"."]})]}),Nt($7,{children:[qe(Xi,{height:16}),Nt(ya,{children:[Nt(ga,{children:[qe(Bc,{children:v.amount}),qe(Ca,{children:v.chain.nativeCurrency.symbol})]}),qe(va,{children:b?`${b} USD`:"..."}),Nt(jg,{children:[qe(ha,{chainId:v.chain.id,height:16,width:16})," ",v.chain.name]})]}),qe(Xi,{height:8}),Nt(Z7,{children:[qe(X7,{text:v.address}),qe(I1,{onClick:()=>m("qr-code"),children:Nt(M1,{children:[qe(q7,{height:"16px",width:"16px"}),"Scan code"]})})]})]}),P]}),qe(Xi,{height:16}),qe(G,{})]})},Q7=({...e})=>qe(xi,{color:"black",...e}),X7=e=>{let[t,r]=Yp(!1);return qe(I1,{onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},children:Nt(M1,{children:[t?qe(ua,{style:{height:"16px",width:"16px"},strokeWidth:"2"}):qe(V7,{style:{height:"16px",width:"16px"}}),t?"Copied":"Copy address"]})})},Z7=Ea.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
|
-
`,
|
|
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
|
-
`,
|
|
1833
|
+
`,t8=Pa.div`
|
|
1834
1834
|
line-height: 20px;
|
|
1835
1835
|
font-size: 18px
|
|
1836
1836
|
text-align: center;
|
|
1837
|
-
|
|
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
|
-
`,
|
|
1847
|
+
`,N1=Pa.span`
|
|
1848
1848
|
display: flex;
|
|
1849
1849
|
align-items: center;
|
|
1850
1850
|
margin: auto;
|
|
1851
|
-
`,
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
1935
|
+
`,m8=Mo.div`
|
|
1936
1936
|
padding-top: 2px;
|
|
1937
|
-
`,
|
|
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
|
-
`,
|
|
1942
|
+
`,h8=Mo.div`
|
|
1943
1943
|
margin: 30px 0;
|
|
1944
|
-
`;import{Fragment as
|
|
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
|
-
`,
|
|
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
|
|
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
|
-
`,
|
|
1985
|
-
${
|
|
1986
|
-
`;import
|
|
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
|
|
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
|
-
|
|
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
|
-
`,
|
|
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
|
|
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
|
|
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
|
|
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
|
-
`,
|
|
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
|
|
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
|
|
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
|
-
`,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
`,
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
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
|
-
`,
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
2374
|
+
`,tE=wd.span`
|
|
2375
2375
|
font-size: 12px;
|
|
2376
2376
|
line-height: 12px;
|
|
2377
2377
|
color: var(--privy-color-foreground-3);
|
|
2378
|
-
`,
|
|
2378
|
+
`,rE=wd.span`
|
|
2379
2379
|
font-size: 10px;
|
|
2380
|
-
`,
|
|
2380
|
+
`,oE=wd.span`
|
|
2381
2381
|
display: flex;
|
|
2382
2382
|
align-items: center;
|
|
2383
|
-
`;import
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
2398
|
+
`,r3=hu.div`
|
|
2399
2399
|
font-size: 14px;
|
|
2400
2400
|
line-height: 22.4px;
|
|
2401
2401
|
font-weight: 400;
|
|
2402
|
-
`;import
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
2440
|
+
`,uE=Wn.div`
|
|
2441
2441
|
position: relative;
|
|
2442
2442
|
overflow: hidden;
|
|
2443
2443
|
transition: max-height 25ms ease-out;
|
|
@@ -2449,29 +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
|
-
`,
|
|
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
|
-
`,
|
|
2458
|
+
`,mE=Wn.div`
|
|
2459
2459
|
transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
|
|
2460
|
-
`;import
|
|
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
|
|
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
|
-
`,
|
|
2468
|
+
`,vE=p3.div`
|
|
2469
2469
|
flex-shrink: 0;
|
|
2470
2470
|
padding-left: 8px;
|
|
2471
|
-
`;import{jsx as
|
|
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`
|
|
2472
2472
|
width: 100%;
|
|
2473
2473
|
padding: 1rem 0;
|
|
2474
|
-
`;import
|
|
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`
|
|
2475
2475
|
display: flex;
|
|
2476
2476
|
flex-direction: column;
|
|
2477
2477
|
align-items: center;
|
|
@@ -2479,17 +2479,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2479
2479
|
margin-left: 27px;
|
|
2480
2480
|
margin-right: 27px;
|
|
2481
2481
|
gap: 24px;
|
|
2482
|
-
`;import{useEffect as
|
|
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
|
|
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.
|
|
2484
2484
|
You will have to sign up with another method first to register a passkey for your account.`}return`An unknown error occurred.
|
|
2485
|
-
You will have to sign up with another method first to register a passkey for your account.`}},
|
|
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`
|
|
2486
2486
|
display: flex;
|
|
2487
2487
|
flex-direction: column;
|
|
2488
2488
|
align-items: center;
|
|
2489
2489
|
justify-content: center;
|
|
2490
2490
|
gap: 24px;
|
|
2491
2491
|
width: 100%;
|
|
2492
|
-
`,
|
|
2492
|
+
`,Hee=w3.div`
|
|
2493
2493
|
display: flex;
|
|
2494
2494
|
align-items: center;
|
|
2495
2495
|
justify-content: center;
|
|
@@ -2505,9 +2505,9 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2505
2505
|
stroke: var(--privy-color-accent) !important;
|
|
2506
2506
|
fill: var(--privy-color-accent) !important;
|
|
2507
2507
|
}
|
|
2508
|
-
`;import{useEffect as
|
|
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)`
|
|
2509
2509
|
margin: 16px auto;
|
|
2510
|
-
`;import
|
|
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`
|
|
2511
2511
|
display: flex;
|
|
2512
2512
|
flex-direction: column;
|
|
2513
2513
|
align-items: center;
|
|
@@ -2529,40 +2529,40 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2529
2529
|
font-weight: 400;
|
|
2530
2530
|
line-height: 20px;
|
|
2531
2531
|
}
|
|
2532
|
-
`,
|
|
2532
|
+
`,jE=Pd.div`
|
|
2533
2533
|
display: flex;
|
|
2534
2534
|
flex-direction: column;
|
|
2535
2535
|
justify-content: space-between;
|
|
2536
|
-
|
|
2536
|
+
`,$E=Pd.div`
|
|
2537
2537
|
line-height: 20px;
|
|
2538
2538
|
height: 20px;
|
|
2539
2539
|
font-size: 13px;
|
|
2540
2540
|
color: var(--privy-color-error);
|
|
2541
2541
|
text-align: left;
|
|
2542
2542
|
margin-top: 0.5rem;
|
|
2543
|
-
`,
|
|
2544
|
-
${e=>e.hideAnimations&&
|
|
2543
|
+
`,eT=Pd(F)`
|
|
2544
|
+
${e=>e.hideAnimations&&ZE`
|
|
2545
2545
|
&& {
|
|
2546
2546
|
// Remove animations because the recoverWallet task on the iframe partially
|
|
2547
2547
|
// blocks the renderer, so the animation stutters and doesn't look good
|
|
2548
2548
|
transition: none;
|
|
2549
2549
|
}
|
|
2550
2550
|
`}
|
|
2551
|
-
`;import{useCallback as
|
|
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`
|
|
2552
2552
|
display: flex;
|
|
2553
2553
|
flex-direction: column;
|
|
2554
2554
|
gap: 12px;
|
|
2555
2555
|
padding-top: 24px;
|
|
2556
2556
|
padding-bottom: 24px;
|
|
2557
|
-
`,
|
|
2557
|
+
`,_3=k3.div`
|
|
2558
2558
|
padding-bottom: 24px;
|
|
2559
|
-
`;import{Fragment as
|
|
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`
|
|
2560
2560
|
width: 24px;
|
|
2561
2561
|
height: 24px;
|
|
2562
2562
|
display: flex;
|
|
2563
2563
|
justify-content: center;
|
|
2564
2564
|
align-items: center;
|
|
2565
|
-
`,
|
|
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`
|
|
2566
2566
|
&& {
|
|
2567
2567
|
border-width: 4px;
|
|
2568
2568
|
}
|
|
@@ -2575,9 +2575,9 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2575
2575
|
border-style: solid;
|
|
2576
2576
|
border-color: ${e=>e.$color??"var(--privy-color-accent)"};
|
|
2577
2577
|
border-radius: 50%;
|
|
2578
|
-
`;import{Fragment as
|
|
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)`
|
|
2579
2579
|
${e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;"}
|
|
2580
|
-
`,
|
|
2580
|
+
`,wT="There was an error preparing your transaction. Your transaction request will likely fail.",bT=e=>e.toLocaleString(),ET=q3.div`
|
|
2581
2581
|
display: flex;
|
|
2582
2582
|
width: 100%;
|
|
2583
2583
|
justify-content: center;
|
|
@@ -2587,12 +2587,12 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2587
2587
|
object-fit: contain;
|
|
2588
2588
|
border-radius: var(--privy-border-radius-sm);
|
|
2589
2589
|
}
|
|
2590
|
-
`;import
|
|
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`
|
|
2591
2591
|
display: flex;
|
|
2592
2592
|
flex-direction: column;
|
|
2593
2593
|
align-items: center;
|
|
2594
2594
|
justify-content: center;
|
|
2595
|
-
`,
|
|
2595
|
+
`,IT=Ar.span`
|
|
2596
2596
|
color: var(--privy-color-foreground);
|
|
2597
2597
|
text-align: center;
|
|
2598
2598
|
font-size: 1.125rem;
|
|
@@ -2600,7 +2600,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2600
2600
|
line-height: 1.25rem; /* 111.111% */
|
|
2601
2601
|
text-align: center;
|
|
2602
2602
|
margin: 10px;
|
|
2603
|
-
`,
|
|
2603
|
+
`,WT=Ar.span`
|
|
2604
2604
|
margin-top: 4px;
|
|
2605
2605
|
margin-bottom: 10px;
|
|
2606
2606
|
color: var(--privy-color-foreground-3);
|
|
@@ -2611,7 +2611,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2611
2611
|
font-weight: 400;
|
|
2612
2612
|
line-height: 20px; /* 142.857% */
|
|
2613
2613
|
letter-spacing: -0.008px;
|
|
2614
|
-
`,
|
|
2614
|
+
`,LT=Ar.div`
|
|
2615
2615
|
position: relative;
|
|
2616
2616
|
width: 60px;
|
|
2617
2617
|
height: 60px;
|
|
@@ -2619,37 +2619,37 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2619
2619
|
display: flex;
|
|
2620
2620
|
justify-content: center;
|
|
2621
2621
|
align-items: center;
|
|
2622
|
-
`,
|
|
2622
|
+
`,NT=Ar(xT)`
|
|
2623
2623
|
position: absolute;
|
|
2624
2624
|
width: 35px;
|
|
2625
2625
|
height: 35px;
|
|
2626
2626
|
color: var(--privy-color-error);
|
|
2627
|
-
`,
|
|
2627
|
+
`,OT=Ar.div`
|
|
2628
2628
|
position: absolute;
|
|
2629
2629
|
width: 60px;
|
|
2630
2630
|
height: 60px;
|
|
2631
2631
|
border-radius: 50%;
|
|
2632
2632
|
background-color: var(--privy-color-error);
|
|
2633
2633
|
opacity: 0.1;
|
|
2634
|
-
`,
|
|
2634
|
+
`,DT=Ar(F)`
|
|
2635
2635
|
&& {
|
|
2636
2636
|
margin-top: 24px;
|
|
2637
2637
|
}
|
|
2638
2638
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2639
|
-
`,
|
|
2639
|
+
`,Q3=Ar.span`
|
|
2640
2640
|
width: 100%;
|
|
2641
2641
|
text-align: left;
|
|
2642
2642
|
font-size: 0.825rem;
|
|
2643
2643
|
color: var(--privy-color-foreground);
|
|
2644
2644
|
padding: 4px;
|
|
2645
|
-
`,
|
|
2645
|
+
`,X3=Ar.div`
|
|
2646
2646
|
width: 100%;
|
|
2647
2647
|
margin: 5px;
|
|
2648
2648
|
display: flex;
|
|
2649
2649
|
flex-direction: column;
|
|
2650
2650
|
justify-content: center;
|
|
2651
2651
|
align-items: center;
|
|
2652
|
-
`,
|
|
2652
|
+
`,UT=Ar.text`
|
|
2653
2653
|
position: relative;
|
|
2654
2654
|
width: 100%;
|
|
2655
2655
|
padding: 5px;
|
|
@@ -2657,7 +2657,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2657
2657
|
color: var(--privy-color-foreground-3);
|
|
2658
2658
|
text-align: left;
|
|
2659
2659
|
word-wrap: break-word;
|
|
2660
|
-
`,
|
|
2660
|
+
`,Z3=Ar.span`
|
|
2661
2661
|
position: relative;
|
|
2662
2662
|
width: 100%;
|
|
2663
2663
|
background-color: var(--privy-color-background-2);
|
|
@@ -2675,31 +2675,31 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2675
2675
|
&:hover {
|
|
2676
2676
|
background-color: var(--privy-color-foreground-4);
|
|
2677
2677
|
}`}
|
|
2678
|
-
`,
|
|
2678
|
+
`,FT=Ar(PT)`
|
|
2679
2679
|
position: absolute;
|
|
2680
2680
|
top: 13px;
|
|
2681
2681
|
right: 13px;
|
|
2682
2682
|
width: 24px;
|
|
2683
2683
|
height: 24px;
|
|
2684
|
-
`,
|
|
2684
|
+
`,BT=Ar(AT)`
|
|
2685
2685
|
position: absolute;
|
|
2686
2686
|
top: 13px;
|
|
2687
2687
|
right: 13px;
|
|
2688
2688
|
width: 24px;
|
|
2689
2689
|
height: 24px;
|
|
2690
|
-
`,
|
|
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)`
|
|
2691
2691
|
&& {
|
|
2692
2692
|
margin-top: 24px;
|
|
2693
2693
|
}
|
|
2694
2694
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2695
|
-
`;import{decodeFunctionData as
|
|
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
2696
|
&& {
|
|
2697
2697
|
height: ${e=>e.size==="sm"?"65px":"140px"};
|
|
2698
2698
|
width: ${e=>e.size==="sm"?"65px":"140px"};
|
|
2699
2699
|
border-radius: 16px;
|
|
2700
2700
|
margin-bottom: 12px;
|
|
2701
2701
|
}
|
|
2702
|
-
`;import{Fragment as
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
2743
|
+
`,uS=Wa.span`
|
|
2744
2744
|
display: flex;
|
|
2745
2745
|
align-items: center;
|
|
2746
2746
|
gap: 8px;
|
|
2747
|
-
`,
|
|
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
|
-
`,
|
|
2754
|
+
`,fS=Wa.div`
|
|
2755
2755
|
flex-grow: 1;
|
|
2756
|
-
`;import{useEffect as
|
|
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
|
|
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
|
-
`,
|
|
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
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
2842
|
+
`,MS=Wu.div`
|
|
2843
2843
|
display: flex;
|
|
2844
2844
|
flex-direction: column;
|
|
2845
2845
|
gap: 8px;
|
|
2846
|
-
`;import
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
3111
|
+
`,Lu=LS.div`
|
|
3112
3112
|
// css normalize only the privy application to avoid conflicts
|
|
3113
3113
|
// with consuming application
|
|
3114
|
-
${
|
|
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
|
|
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
|
-
`,
|
|
3178
|
+
`,DS=Ks.div`
|
|
3179
3179
|
position: relative;
|
|
3180
3180
|
z-index: 999999;
|
|
3181
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
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
|
-
`,
|
|
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 x0,useEffect as YS}from"react";import{jsx as XS}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 R0(e){let t=x0(null),r=x0();return YS(()=>{r.current?.remove(),r.current=QS(e),t.current?.after(r.current)},[e]),XS("div",{ref:t,hidden:!0})}import{useState as ZS}from"react";import{useEffect as k0,useRef as _0}from"react";var Nd=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 Nn(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 Oe("missing_or_invalid_mfa","MFA verification failed, retry."));let m=await new Promise((f,g)=>{r.current={resolve:f,reject:g};let v=1e3*60*5;setTimeout(()=>{let C=new Oe("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(C),g(C)},v)});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 Oe("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(u),u}return d}import{jsx as rA}from"react/jsx-runtime";var JS=function(e){return()=>`id-${e++}`}(0);function jS(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function ut(e){return e.error!==void 0}var ct=new Nd,Iu=new Map,$S=(e,t)=>typeof t=="bigint"?t.toString():t,eA=(e,t)=>`${e}${JSON.stringify(t,$S)}`;function mt(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=eA(e,t);if(e==="privy:wallet:create"){let l=Iu.get(i);if(l)return l}let a=new Promise((l,s)=>{let d=JS();ct.enqueue(d,{resolve:l,reject:s}),n.postMessage({id:d,event:e,data:t},o)}).finally(()=>{Iu.delete(i)});return Iu.set(i,a),a}function tA(e){switch(e.event){case"privy:iframe:ready":let t=ct.dequeue(e.event,e.id);return ut(e)?t.reject(new Oe(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=ct.dequeue(e.event,e.id);return ut(e)?r.reject(new Oe(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:create-additional":let o=ct.dequeue(e.event,e.id);return ut(e)?o.reject(new Oe(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:import":let n=ct.dequeue(e.event,e.id);return ut(e)?n.reject(new Oe(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:connect":let i=ct.dequeue(e.event,e.id);return ut(e)?i.reject(new Oe(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:recover":let a=ct.dequeue(e.event,e.id);return ut(e)?a.reject(new Oe(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:rpc":let l=ct.dequeue(e.event,e.id);return ut(e)?l.reject(new Oe(e.error.type,e.error.message)):l.resolve(e.data);case"privy:wallet:set-recovery":let s=ct.dequeue(e.event,e.id);return ut(e)?s.reject(new Oe(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:verify":let d=ct.dequeue(e.event,e.id);return ut(e)?d.reject(new Oe(e.error.type,e.error.message)):d.resolve(e.data);case"privy:mfa:init-enrollment":{let g=ct.dequeue(e.event,e.id);return ut(e)?g.reject(new Oe(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:mfa:submit-enrollment":{let g=ct.dequeue(e.event,e.id);return ut(e)?g.reject(new Oe(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:mfa:unenroll":{let g=ct.dequeue(e.event,e.id);return ut(e)?g.reject(new Oe(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:mfa:clear":{let g=ct.dequeue(e.event,e.id);return ut(e)?g.reject(new Oe(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:farcaster:init-signer":{let g=ct.dequeue(e.event,e.id);return ut(e)?g.reject(new Oe(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:farcaster:sign":{let g=ct.dequeue(e.event,e.id);return ut(e)?g.reject(new Oe(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:solana-wallet:create":let u=ct.dequeue(e.event,e.id);return ut(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data);case"privy:solana-wallet:connect":let m=ct.dequeue(e.event,e.id);return ut(e)?m.reject(new Oe(e.error.type,e.error.message)):m.resolve(e.data);case"privy:solana-wallet:recover":let f=ct.dequeue(e.event,e.id);return ut(e)?f.reject(new Oe(e.error.type,e.error.message)):f.resolve(e.data);case"privy:solana-wallet:rpc":{let g=ct.dequeue(e.event,e.id);return ut(e)?g.reject(new Oe(e.error.type,e.error.message)):g.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function M0(e){let t=_0(null),r=_0(e.mfaMethods),o=Ri(),[n,i]=ZS(!1);return k0(()=>{r.current=e.mfaMethods},[e.mfaMethods]),k0(()=>{if(!n)return;let a=t.current;if(!a)return;function l(f){f&&f.origin===e.origin&&jS(f.data)&&tA(f.data)}let s={create(f){return mt("privy:wallet:create",f,a,e.origin)},createAdditional(f){return mt("privy:wallet:create-additional",f,a,e.origin)},import(f){return mt("privy:wallet:import",f,a,e.origin)},connect(f){return mt("privy:wallet:connect",f,a,e.origin)},recover(f){return Nn(g=>mt("privy:wallet:recover",{...f,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!f.recoveryMethod||f.recoveryMethod==="privy")},rpc(f){return Nn(g=>mt("privy:wallet:rpc",{...f,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(f){return mt("privy:solana-wallet:create",f,a,e.origin)},connectSolana(f){return mt("privy:solana-wallet:connect",f,a,e.origin)},recoverSolana(f){return mt("privy:solana-wallet:recover",f,a,e.origin)},rpcSolana(f){return mt("privy:solana-wallet:rpc",f,a,e.origin)},setRecovery(f){return Nn(g=>mt("privy:wallet:set-recovery",{...f,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(f){return Nn(g=>mt("privy:mfa:verify",{...f,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(f){return Nn(g=>mt("privy:mfa:init-enrollment",{...f,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(f){return Nn(g=>mt("privy:mfa:submit-enrollment",{...f,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(f){return Nn(g=>mt("privy:mfa:unenroll",{...f,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(f){return mt("privy:mfa:clear",f,a,e.origin)},initFarcasterSigner(f){return mt("privy:farcaster:init-signer",f,a,e.origin)},signFarcasterMessage(f){return mt("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 Wa(()=>mt("privy:iframe:ready",{},a,e.origin),{abortSignal:m.signal}).then(d,u),()=>{window.removeEventListener("message",l),m.abort()}},[n]),rA("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:js(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var Od=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 W0({message:t.params.message})}async request(t){if(console.debug("EmbeddedSolanaProvider.request() called with args",t),!await be())throw new Error("User must be authenticated to use embedded Solana wallet");if(!await I0())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 Wu(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 L0({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",u)}let s,d=setInterval(()=>{t?.closed&&!s&&(l(),clearInterval(d),clearTimeout(a),n(new w("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 w(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 Lu={[Lr.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[ym.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[ho.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[fm.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[Nr.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[hm.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[Wr.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[um.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[nl.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[pm.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[Zr.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[dm.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"},N0=(e,t)=>e===Lu[t.id];var oA="https://cdn.apple-cloudkit.com";async function Nu({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===oA&&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 O0=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 D0}from"react/jsx-runtime";var jo;function dA(e){return typeof e=="string"&&e.length===25}function be(){if(!jo){let e=J.get(Fn);return Promise.resolve(e||null)}return jo.getAccessToken()}var U0,Gf=(e,t,r)=>U0(e,t,r),F0,qf=(e,t,r)=>F0(e,t,r),B0,zf=(e,t,r,o)=>B0(e,t,r,o),H0,Kf=()=>H0(),V0,I0=()=>V0(),G0,W0=({message:e})=>G0({message:e}),pA=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;J.put(Na,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},uA=({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(!dA(t.appId))throw new w("Cannot initialize the Privy provider with an invalid Privy app ID");jo||(jo=new Za({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(wm,{client:jo,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:Rr(mA,{...t,client:jo})})},mA=e=>{let t=e.client,[r,o]=dt(!1),[n,i]=dt(!1),[a,l]=dt(!1),[s,d]=dt(null),[u,m]=dt([]),[f,g]=dt(null),v=_a(u),[C,b]=dt(!1),[A,_]=dt(null),[S,P]=dt(!1),[E,k]=dt({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:pt}),[D,H]=dt({status:"initial"}),[M,X]=dt(null),W=Le(),Y=al(),[Ce,q]=dt(!0),[pe,Q]=dt({}),[ee,ue]=dt(null),[me,Te]=dt(null),[ce,Se]=dt(!1),[ft,tt]=dt(!1),[le,nt]=dt(W.customAuth?.enabled?{status:"initial"}:{status:"not-enabled"}),mr=_a(null),vt=_a(null),I=_a(Tm),[Ke,Qt]=dt(!1);t.onStoreToken=c=>{c&&O(I,"accessToken","onAccessTokenGranted",c)},t.onDeleteToken=()=>{d(null),l(!1),O(I,"accessToken","onAccessTokenRemoved")};let U=_a(null),B=_a(null),se=c=>{_(c),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:c}})},rt=c=>{W.embeddedWallets.createOnLogin!=="off"&&q(!0),se(c)};co(()=>{let c=Yn(s);if(!c||!M){g(null);return}let p={address:c.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:xi,id:"io.privy.solana.wallet"},getProvider:async()=>new Od(M,c.address)};g(p)},[M,s]),co(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnectors();return}let c=Me(s),p=Jd(s),h=Wl(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(!M){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}c&&t.connectors.addEmbeddedWalletConnectors({walletProxy:M,rootWallet:c,embeddedWallets:p,defaultChain:W.defaultChain,appId:e.appId}),h&&t.connectors.addImportedWalletConnector(M,h.address,W.defaultChain,e.appId)},[M,s]),co(()=>{M&&me?.(M)},[M]),co(()=>{(async()=>{if(!W.customAuth?.enabled){nt({status:"not-enabled"});return}q(!0),nt({status:"loading"});let{getCustomAccessToken:p,isLoading:h}=W.customAuth;if(!(!n||h))try{let y=await p();if(!y&&a){await Ti.logout(),nt({status:"done"}),O(I,"customAuth","onUnauthenticated");return}if(!y){nt({status:"done"});return}if(a){nt({status:"done"});return}t.startAuthFlow(new Ii(y));let{user:T,isNewUser:N}=await t.authenticate();if(!T){await Ti.logout(),nt({status:"error",error:new w("Failed to sync with custom auth provider")}),O(I,"customAuth","onUnauthenticated");return}N!==void 0&&O(I,"login","onComplete",T,N,!1,"custom",null),O(I,"customAuth","onAuthenticated",{user:T}),nt({status:"done"}),d(T||null),b(N||!1),l(!0),tt(!0)}catch(y){throw console.warn(y),a&&(await Ti.logout(),O(I,"customAuth","onUnauthenticated")),O(I,"login","onError",y.privyErrorCode||"unknown_auth_error"),nt({status:"error",error:y}),y}})()},[W.customAuth?.enabled,W.customAuth?.getCustomAccessToken,W.customAuth?.isLoading,n,a]),co(()=>{ft&&M&&s&&Et(s,W.embeddedWallets.createOnLogin)&&(tt(!1),Ma(s,Pi).catch(console.error))},[ft&&M&&s]),co(()=>{async function c(){let p=On(),h=bi();pA();let y=nA();t.initializeConnectorManager({walletConnectCloudProjectId:W.walletConnectCloudProjectId,rpcConfig:W.rpcConfig,chains:W.chains,defaultChain:W.defaultChain,store:y,walletList:W.appearance.walletList,shouldEnforceDefaultChainOnConnect:W.shouldEnforceDefaultChainOnConnect,externalWalletConfig:W.externalWallets,appName:W.name??"Privy"});let T;t.connectors?.on("connectorInitialized",()=>{T&&clearTimeout(T);let V=t.connectors.walletConnectors.length,re=t.connectors.walletConnectors.reduce((ie,de)=>ie+(de.initialized?1:0),0);re===V?Qt(!0):T=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:re,expected:V}),Qt(!0)},1500)}),t.connectors?.initialize().then(()=>{Oo()});let N=await t.getAuthenticatedUser(),z=!!N;if(W.customAuth?.enabled||(l(!!N),N&&O(I,"login","onComplete",N,!1,!0,null,null),d(N)),p){B.current=z?"link":"login";return}if(h&&!z){B.current="login",rt("TELEGRAM_AUTH_SCREEN");return}te.setReadyToTrue(!!N)}!n&&Y&&c()},[t,ee,n,Y]),co(()=>{if(!n)return;if(!s){Se(!0);return}if(!!!s.linkedAccounts.find(h=>h.type==="wallet"&&h.walletClientType==="privy")){Se(!0);return}let p=!!u.find(h=>h.walletClientType==="privy");Se(p)},[n,s,u]);let On=()=>{let c=za();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 go(c)),rt("AWAITING_OAUTH_SCREEN"),!0)},bi=()=>{let c=Ff();if(!c||!W.loginMethods.telegram||!W.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let p=new Oi;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},zs=async(c,p,h,y)=>{let T=await t.connectors?.createWalletConnector(c,p)||null;Xr(T,p,h,y)};async function Xr(c,p,h,y){if(c)k({status:"disconnected",connectedWallet:null,connectError:null,connector:c,connectRetry:pt});else return k({status:"disconnected",connectedWallet:null,connectError:new _e("Unable to connect to wallet."),connector:null,connectRetry:pt}),y?.(null,h);c instanceof jr&&p&&await c.resetConnection(p),k({connector:c,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Xr(c,p,h,y)});try{let T=await c.connect({showPrompt:!0});if(W.shouldEnforceDefaultChainOnConnect&&!W.chains.find(N=>N.id===Number(T?.chainId.replace("eip155:","")))&&!(T?.connectorType==="wallet_connect_v2"&&T?.walletClientType==="metamask")){k(N=>({...N,connector:c,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:pt}));try{await T?.switchChain(W.defaultChain.id),T&&(T.chainId=Ai(Un(W.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${W.defaultChain.id}`)}}return k(N=>({...N,status:"connected",connectedWallet:T,connectError:null,connectRetry:pt})),T&&O(I,"connectWallet","onSuccess",T),y?.(T,h)}catch(T){return T instanceof jt?(console.warn(T.cause?T.cause:T.message),O(I,"connectWallet","onError",T.privyErrorCode||"generic_connect_wallet_error")):(console.warn(T),O(I,"connectWallet","onError","unknown_connect_wallet_error")),k(N=>({...N,status:"disconnected",connectedWallet:null,connectError:T})),y?.(null,h)}}let wt=async(c,p)=>{if(c===null)return;let h=new Ho(c,t,p);t.startAuthFlow(h)},Oo=()=>{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"&&!en()&&rt("LOGIN_FAILED_SCREEN"),!t.connectors)throw new w("Connector not initialized");se("AWAITING_CONNECTION");let y=new URL(window.location.href);y.searchParams.delete("privy_connector"),y.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",y),zs(p,h,void 0,wt)};co(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(d)},[n,a,s,t]);let Ue=c=>{if(!a)throw O(I,"linkAccount","onError","must_be_authenticated",{linkMethod:c}),new w("User must be authenticated before linking an account.")},Do=()=>{Ue("siwe"),U.current="siwe",B.current="link",se("LINK_WALLET_SCREEN")},Xt=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},po=async c=>{if(!t.connectors)throw new w("Connector not initialized");let p=t.connectors.findWalletConnector(c.connectorType,c.walletClientType)||null;if(k(h=>({...h,connector:p,status:"connected",connectedWallet:c,connectError:null,connectRetry:pt})),W.captchaEnabled&&!a){let h={callback:y=>wt(c,y),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};Q({captchaModalData:h}),rt("CAPTCHA_SCREEN")}else await wt(c),rt("AWAITING_CONNECTION")},Ei=async(c,p)=>{let{signedUrl:h,externalTransactionId:y}=await T1(t,c,p??{},W.appearance.palette,W.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:h,externalTransactionId:y}},uo=()=>{m(c=>{let p=t.connectors?.wallets.map(h=>({...h,linked:Xt(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");po(h)},fund:async y=>{await te.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 Nl(c,p)?c:p})};co(()=>{uo()},[s?.linkedAccounts,a,n]),co(()=>{if(n){if(!t.connectors)throw new w("Connector not initialized");uo(),t.connectors.on("walletsUpdated",uo)}},[n]);let Xe=c=>{c&&"target"in c&&c&&(c=void 0),Q({externalConnectWallet:{walletList:c?.walletList&&c?.walletList.length>0?c.walletList:void 0,suggestedAddress:c?.suggestedAddress}}),se(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};co(()=>{if(!u[0])return;let c=u[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=u},[u]);let Ma=async(c,p,h)=>{let y=Me(c);if(y&&!h?.createAdditional)throw O(I,"createWallet","onError","embedded_wallet_already_exists"),new Error("User already has an embedded wallet.");let[T,N]=await Promise.all([te.initializeWalletProxy(p),be()]);if(!T&&W.customAuth?.enabled)throw O(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!T||!N||W.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((z,V)=>{q(!0),Q({createWallet:{onSuccess:ie=>{O(I,"createWallet","onSuccess",ie),z(ie)},onFailure:ie=>{O(I,"createWallet","onError","unknown_embedded_wallet_error"),V(ie)},callAuthOnSuccessOnClose:!1}}),se("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{if(!y)await T.create({accessToken:N});else{let re=Jd(c),de=(re?.length?Math.max(...re.map(ke=>ke.walletIndex)):y.walletIndex)+1;await te.recoverEmbeddedEthereumWallet(),await T.createAdditional({accessToken:N,primaryWalletAddress:y?.address,hdWalletIndex:de})}let z=await te.refreshUser(),V=Me(z);if(!V)throw O(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return O(I,"createWallet","onSuccess",V),V}},X0=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")},Du=(c,p,h,y)=>new Promise(async(T,N)=>{let{requesterAppId:z}=p||{};if(!a||!s){O(I,"sendTransaction","onError","must_be_authenticated"),N(new Error("User must be authenticated before signing with a Privy wallet"));return}let V=y??Me(s)?.address;if(!V)throw new w("User must have an embedded wallet to send a transaction.");let{signingWallet:re,rootWallet:ie}=Ll(s,V);if(!ie||!re){O(I,"sendTransaction","onError","embedded_wallet_not_found"),N(new Error("Must have a Privy wallet before signing"));return}q(!0);let de=Hu.wallets.find(Jt=>Jt.walletClientType==="privy"&&wi(Jt.address)===wi(re.address)),ke=await de?.getEthereumProvider();if(!de||!ke)throw new w(`Cannot sendTransaction before embedded wallet ${re.address} is connected`);let $o=c.chainId?Number(c.chainId):Wu(de.chainId);X0($o);let kr=Object.assign({},c,{chainId:$o}),_r=async()=>{let Jt=await be();if(!Jt||!M){O(I,"sendTransaction","onError","embedded_wallet_not_found"),N(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await te.recoverEmbeddedEthereumWallet()){O(I,"sendTransaction","onError","unknown_connect_wallet_error"),N(new Error("Unable to connect to wallet"));return}let Si=Ir(kr.chainId,W.chains,W.rpcConfig,{appId:e.appId}),mo=await cA(re.address,kr,Si);if(W.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:Z0}=await lA(mo,Si),{hasSufficientFunds:J0}=await _d(re.address,mo,Z0,Si);if(!J0)throw new Tt(new Dr("Wallet has insufficient funds for this transaction.",sA.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let Vu=await kd({accessToken:Jt,rootWallet:ie,transactingWallet:re,walletProxy:M,transactionRequest:mo,provider:Si,requesterAppId:z});O(I,"sendTransaction","onSuccess",Vu),T(Vu)}catch(Qs){O(I,"sendTransaction","onError","transaction_failure"),N(Qs)}};if(W.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),_r();else{let Jt={transactionRequest:kr,transactingWallet:re,rootWallet:ie,onSuccess:mo=>{O(I,"sendTransaction","onSuccess",mo),T(mo)},onFailure:mo=>{O(I,"sendTransaction","onError","transaction_failure"),N(mo)},uiOptions:p||{},fundWalletConfig:h,requesterAppId:z},Qs={address:ie.address,onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:mo=>{O(I,"sendTransaction","onError","unknown_connect_wallet_error"),N(mo)}},Si=Fu({address:re.address,fundWalletConfig:h,chainIdOverride:kr.chainId,comingFromSendTransactionScreen:!0});Q({connectWallet:Qs,sendTransaction:Jt,funding:Si}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function Uu(){return new Promise(async(c,p)=>{let h=await be();if(!h||!M)throw new Error("Must have valid access token to enroll in MFA");try{await M.verifyMfa({accessToken:h}),c()}catch(y){p(y)}})}let Ks=c=>c?.linkedAccounts.filter(p=>p.latestVerifiedAt!==null&&!(p.type==="wallet"&&p.walletClientType==="privy")).sort((p,h)=>h.latestVerifiedAt.getTime()-p.latestVerifiedAt.getTime())[0],Zt=c=>{let p=s?.linkedAccounts.filter(T=>T.type===c).length??0,{displayName:h,loginMethod:y}=Tn(c);if(c==="passkey"&&p>=5||c!=="passkey"&&p>=1)throw O(I,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:y}),new w(`User already has an account of type ${h} linked.`)},Fu=({address:c,fundWalletConfig:p,methodScreen:h,chainIdOverride:y=null,comingFromSendTransactionScreen:T=!1})=>{if(!W.fundingConfig||W.fundingConfig.methods.length===0)return;let N,z,V,re,ie=!1;if(E1(p)&&p.chain){if(N=p.chain.id,z=p.chain,V=p.amount??W.fundingConfig.defaultRecommendedAmount,"asset"in p)if(p.asset==="USDC"){let de=Lu[N];W.fundingConfig.methods.includes("external")&&!de&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),re=de,ie=!0}else typeof p.asset!="string"&&"erc20"in p.asset&&(re=p.asset.erc20,ie=N0(re,p.chain))}else N=Wu(W.fundingConfig.defaultRecommendedCurrency.chain),z=W.chains.find(de=>de.id===N),V=W.fundingConfig.defaultRecommendedAmount;if(y&&W.chains.find(de=>de.id===y)&&(z=W.chains.find(de=>de.id===y)),!z)throw new w("Funding chain is not in PrivyProvider chains list");return{address:c,amount:V,chain:z,erc20Address:re,erc20ContractInfo:ie?{symbol:"USDC",decimals:6}:void 0,isUSDC:ie,methodScreen:h,comingFromSendTransactionScreen:T,...b1(p)?{moonpayConfigOverride:p.config}:{}}};async function Bu({showAutomaticRecovery:c=!1,legacySetWalletPasswordFlow:p=!1}){_(null);let h=p?"setWalletPassword":"setWalletRecovery";if(!a||!s)throw O(I,h,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let y=Me(s);if(!y||!M)throw O(I,h,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if(Yn(s))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await Uu()}catch(N){throw O(I,h,"onError","missing_or_invalid_mfa"),N}return new Promise((N,z)=>{q(!0);let V={onSuccess:ke=>{O(I,h,"onSuccess","user-passcode",ke),N(ke)},onFailure:ke=>{O(I,h,"onError","user_exited_set_password_flow"),z(ke)},callAuthOnSuccessOnClose:!1},re=y.recoveryMethod==="user-passcode",de={onCompleteNavigateTo:hc({walletAction:"update",availableRecoveryMethods:W.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:p,isResettingPassword:re,showAutomaticRecovery:c}),shouldForceMFA:!1,onFailure:ke=>{O(I,h,"onError","unknown_connect_wallet_error"),z(ke)}};Q({setWalletPassword:V,createWallet:V,connectWallet:de,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:re}}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function Ys({appId:c,action:p}){let h=await be();if(p==="link"&&!h)throw O(I,"linkAccount","onError","must_be_authenticated",{linkMethod:`privy:${c}`}),new w("User must be authenticated before linking an account.");if(p==="login"&&h)throw O(I,"login","onError","unknown_auth_error"),new w("Attempted to log in, but user is already logged in. Use a `link` helper instead.");U.current=`privy:${c}`,B.current=p;let y=window.open(void 0,void 0,bs({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:c}}),new Promise(async(T,N)=>{let{name:z,logoUrl:V}=await Vc({api:t.api,providerAppId:c,requesterAppId:W.id});Q({crossAppAuth:{appId:c,name:z,logoUrl:V,action:p,popup:y,onSuccess:T,onError:N}}),rt("CROSS_APP_AUTH_SCREEN")})}let Ti={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:Xe,importWallet:async({privateKey:c})=>{Ue("siwe");let[p,h]=await Promise.all([te.initializeWalletProxy(15e3),be()]);if(p&&h){await p.import({privateKey:c,accessToken:h});let y=await te.refreshUser(),T=Wl(y);if(!T)throw O(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return O(I,"createWallet","onSuccess",T),T}else throw new w("User is not authenticated")},linkWallet:Do,startCrossAppAuthFlow:Ys,linkEmail:()=>{Ue("email"),Zt("email"),U.current="email",B.current="link",se("LINK_EMAIL_SCREEN")},linkPhone:()=>{Ue("sms"),Zt("phone"),U.current="sms",B.current="link",se("LINK_PHONE_SCREEN")},linkGoogle:async()=>{Ue("google"),Zt("google_oauth"),B.current="link",await te.initLoginWithOAuth("google")},linkTwitter:async()=>{Ue("twitter"),Zt("twitter_oauth"),B.current="link",await te.initLoginWithOAuth("twitter")},linkDiscord:async()=>{Ue("discord"),Zt("discord_oauth"),B.current="link",await te.initLoginWithOAuth("discord")},linkGithub:async()=>{Ue("github"),Zt("github_oauth"),B.current="link",await te.initLoginWithOAuth("github")},linkSpotify:async()=>{Ue("spotify"),Zt("spotify_oauth"),B.current="link",await te.initLoginWithOAuth("spotify")},linkInstagram:async()=>{Ue("instagram"),Zt("instagram_oauth"),B.current="link",await te.initLoginWithOAuth("instagram")},linkTiktok:async()=>{Ue("tiktok"),Zt("tiktok_oauth"),B.current="link",await te.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{Ue("linkedin"),Zt("linkedin_oauth"),B.current="link",await te.initLoginWithOAuth("linkedin")},linkApple:async()=>{Ue("apple"),Zt("apple_oauth"),B.current="link",await te.initLoginWithOAuth("apple")},linkPasskey:async()=>{Ue("passkey"),Zt("passkey"),await te.initLinkWithPasskey(),se("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{Ue("telegram"),Zt("telegram"),B.current="link",U.current="telegram",await te.initLoginWithTelegram(),se("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{Ue("farcaster"),Zt("farcaster"),await te.initLoginWithFarcaster(),B.current="link",U.current="farcaster",se("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(Ue("email"),!s?.email)throw new w("User does not have an email linked to their account.");B.current="link",U.current="email",se("UPDATE_EMAIL_SCREEN")},updatePhone:()=>{if(Ue("sms"),!s?.phone)throw new w("User does not have a phone number linked to their account.");B.current="link",U.current="sms",se("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=>{ue(T=>y.bind(T))});if(ue(null),h){console.warn(p);return}}if(s&&!s.isGuest){console.warn(p);return}B.current="login",Q({login:c}),rt("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(c=>{ue(()=>c)}),ue(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}rt("CONNECT_OR_CREATE")},logout:async()=>{if(s&&t.clearProviderAcccessTokens(s),_(null),await t.logout(),s&&M)try{await M.clearMfa({userId:s.id})}catch{}d(null),l(!1),O(I,"logout","onSuccess"),B.current=null,U.current=null,o(!1),J.del(Oa),J.del(rl(W.id))},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new Ze;let c=u.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 Ze:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new Ou(new vo(new Ze));let c=u.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 Ou(new vo(new Ze)):new Ou(new vo(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new nn(new Ze);let c=u.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 nn(new Ze):new nn(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=u.find(y=>wi(y.address)===wi(c)),h=s?.linkedAccounts.find(y=>y.type==="wallet"&&wi(y.address)===wi(c));if(!p||!await p.isConnected())Q({externalConnectWallet:{suggestedAddress:c}}),Do();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 O(I,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return Ma(s,15e3,c)},setWalletRecovery:async c=>Bu({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:c?.showAutomaticRecovery??!1}),setWalletPassword:async()=>Bu({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(c,p,h)=>new Promise(async(y,T)=>{let{requesterAppId:N}=p||{};if(!a||!s){O(I,"signMessage","onError","must_be_authenticated"),T(new Error("User must be authenticated before signing with a Privy wallet"));return}let z=h??Me(s)?.address;if(!z)throw new w("User must have an embedded wallet to sign a message.");let{signingWallet:V,rootWallet:re}=Ll(s,z);if(!V||!re){O(I,"signMessage","onError","embedded_wallet_not_found"),T(new Error("Must have a Privy wallet before signing"));return}if(typeof c!="string"||c.length<1){O(I,"signMessage","onError","invalid_message"),T(new Error("Message must be a non-empty string"));return}q(!0);let ie=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let de=await be();if(!M||!de)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:V.address,requesterAppId:N}});let{response:$o}=await M.rpc({accessToken:de,address:re.address,hdWalletIndex:V.walletIndex??void 0,requesterAppId:N,request:{method:"personal_sign",params:[c,V.address]}}),kr=$o.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:V.address,requesterAppId:N}}),kr};if(W.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let de=await ie();O(I,"signMessage","onSuccess",de),y(de)}catch(de){O(I,"signMessage","onError","unable_to_sign"),T(de??new Tt("Unable to sign message"))}}else{let $o={method:"personal_sign",data:c,confirmAndSign:ie,onSuccess:_r=>{O(I,"signMessage","onSuccess",_r),y(_r)},onFailure:_r=>{O(I,"signMessage","onError","unable_to_sign"),T(_r)},uiOptions:p||{}},kr={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:_r=>{O(I,"signMessage","onError","unknown_connect_wallet_error"),T(_r)},address:re.address};Q({signMessage:$o,connectWallet:kr}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(c,p,h)=>new Promise(async(y,T)=>{let{requesterAppId:N}=p||{};if(!a||!s){O(I,"signTypedData","onError","must_be_authenticated"),T(new Error("User must be authenticated before signing with a Privy wallet"));return}let z=h??Me(s)?.address;if(!z)throw new w("User must have an embedded wallet to sign a message.");let{signingWallet:V,rootWallet:re}=Ll(s,z);if(!re||!V){O(I,"signTypedData","onError","embedded_wallet_not_found"),T(new Error("Must have a Privy wallet before signing"));return}q(!0);let ie=La(c),de=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let ke=await be();if(!M||!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:V.address,requesterAppId:N}});let{response:kr}=await M.rpc({accessToken:ke,address:re.address,hdWalletIndex:V.walletIndex??void 0,requesterAppId:N,request:{method:"eth_signTypedData_v4",params:[V.address,ie]}}),_r=kr.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:V.address,requesterAppId:N}}),_r};if(W.embeddedWallets.noPromptOnSignature||(W.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ke=await de();O(I,"signTypedData","onSuccess",ke),y(ke)}catch(ke){O(I,"signTypedData","onError","unable_to_sign"),T(ke??new Tt("Unable to sign message"))}}else{let kr={method:"eth_signTypedData_v4",data:ie,confirmAndSign:de,onSuccess:Jt=>{O(I,"signTypedData","onSuccess",Jt),y(Jt)},onFailure:Jt=>{O(I,"signTypedData","onError","unable_to_sign"),T(Jt)},uiOptions:p||{}},_r={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Jt=>{O(I,"signMessage","onError","unknown_connect_wallet_error"),T(Jt)}};Q({signMessage:kr,connectWallet:_r}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(c,p,h,y)=>{let N=await(await Du(c,p,h,y)).wait();return Md(N)},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,T=s.linkedAccounts.filter(ie=>ie.type==="wallet"&&ie.walletClientType==="privy"&&ie.chainType==="ethereum"),N=y?T.find(ie=>ie.address===wi(y)):T.find(ie=>!ie.imported)||T[0];if(!N){h(new Error("Must have a Privy wallet before exporting"));return}q(!0);let z={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:h,address:N.address,shouldForceMFA:!0};if(Q(pe),!await be()||!M){h(new Error("Must have valid access token to enroll in MFA"));return}if(!M){h(new Error("Must have a Privy wallet before exporting"));return}let re={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:N,onSuccess:p,onFailure:h};Q({keyExport:re,connectWallet:z}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:Uu,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");mr.current?.resolve({mfaMethod:c,mfaCode:p,relyingParty:window.origin}),await new Promise((N,z)=>{vt.current={resolve:N,reject:z}});break;case"passkey":if(typeof p=="string")throw new w("Invalid authenticator response");let y=await(await import("@simplewebauthn/browser")).startAuthentication(p),T=O0(y);mr.current?.resolve({mfaMethod:c,mfaCode:T,relyingParty:window.origin}),await new Promise((N,z)=>{vt.current={resolve:N,reject:z}});break;default:throw mr.current?.reject(new w("Unsupported MFA method")),new w(`Unsupported MFA method: ${c}`)}},cancel(){mr.current?.reject(new w("MFA canceled"))},async initEnrollmentWithSms(c){let p=await be();if(!p||!M)throw new Error("Must have valid access token to enroll in MFA");await M.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."),Q({mfaEnrollmentFlow:{mfaMethods:W.mfa.methods,onSuccess:p,onFailure:h}}),se("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let c=await be();if(!c||!M)throw new Error("Must have valid access token to enroll in MFA");let p=await M.initEnrollMfa({method:"totp",accessToken:c});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(c){let p=await be();if(!p||!M)throw new Error("Must have valid access token to enroll in MFA");await M.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:c.phoneNumber,code:c.mfaCode});let h=await t.getAuthenticatedUser();d(h)},async submitEnrollmentWithTotp(c){let p=await be();if(!p||!M)throw new Error("Must have valid access token to enroll in MFA");await M.submitEnrollMfa({method:"totp",accessToken:p,code:c.mfaCode});let h=await t.getAuthenticatedUser();d(h)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:c}){let p=await be();if(!p||!M)throw new Error("Must have valid access token to enroll in MFA");await M.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:c});let h=await t.getAuthenticatedUser();d(h)},async unenroll(c){let p=await be();if(!p||!M)throw new Error("Must have valid access token to remove MFA");c==="passkey"?await M.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await M.unenrollMfa({method:c,accessToken:p});let h=await t.getAuthenticatedUser();d(h)},requestFarcasterSignerFromWarpcast:async()=>{let c=await be(),p=s?.linkedAccounts.find(T=>T.type==="wallet"&&T.walletClientType==="privy");if(!c)throw new Error("Must have valid access token to connect with Farcaster");if(!M||!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 y=await M.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:c,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(y.status==="approved"){let T=await t.getAuthenticatedUser();d(T||s||null)}Q({farcasterSigner:y}),se("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let c=await be(),p=s?.linkedAccounts.find(T=>T.type==="wallet"&&T.walletClientType==="privy");if(!c)throw new Error("Must have valid access token to connect with Farcaster");if(!M||!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(T=>Uint8Array.from(T.match(/.{1,2}/g).map(N=>parseInt(N,16))))(s.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async c=>{let p=await be(),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(!M||!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 T=await import("@simplewebauthn/browser"),N=await M.signFarcasterMessage({address:h.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{hash:T.bufferToBase64URLString(c)},fid:BigInt(s.farcaster.fid),relyingParty:window.origin});return new Uint8Array(T.base64URLStringToBuffer(N.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:S,loginWithCode(c){return te.loginWithCode(c)},initLoginWithEmail(c){return te.initLoginWithEmail(c)},initLoginWithSms(c){return te.initLoginWithSms(c)},otpState:D,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:y,connectorType:T}){return Ue("siwe"),te.linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:y,connectorType:T})},signMessageWithCrossAppWallet(c,{address:p}){return Gc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"personal_sign",params:[c,p]},reconnect:Ys})},signTypedDataWithCrossAppWallet(c,{address:p}){let h=La(c);return Gc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_signTypedData_v4",params:[p,h]},reconnect:Ys})},sendTransactionWithCrossAppWallet(c,{address:p}){return Gc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_sendTransaction",params:[c]},reconnect:Ys})},setCustomMetadata(c){return te.setCustomMetadataForUser(c)},isModalOpen:r,mfaMethods:W.mfa.methods};U0=Ti.signMessage,F0=Ti.signTypedData,B0=async(...c)=>{let p=await Du(...c);return W.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let te=(()=>({isNewUserThisSession:C,pendingTransaction:null,walletConnectionStatus:E,connectors:t.connectors?.walletConnectors??[],rpcConfig:W.rpcConfig,chains:W.chains,appId:e.appId,showFiatPrices:W.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,customAuthStatus:le,nativeTokenSymbolForChainId:c=>W.chains.find(p=>p.id===Number(c))?.nativeCurrency.symbol,initializeWalletProxy:async c=>{if(M)return M;let p=new Promise(T=>{Te(()=>N=>T(N))}),h=new Promise(T=>setTimeout(()=>T(null),c)),y=await Promise.race([p,h]);return Te(null),y},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:async(c={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s,h;p&&U.current&&(h=Ks(s)),B.current==="login"?c.shouldCallAuthOnSuccess&&p&&U.current?(O(I,"login","onComplete",s,C,!1,U.current,h??null),e.onSuccess?.(s,C)):O(I,"login","onError","exited_auth_flow"):B.current==="link"&&h&&(c.isSuccess&&p&&U.current?O(I,"linkAccount","onSuccess",s,U.current,h):U.current&&O(I,"linkAccount","onError","exited_link_flow",{linkMethod:U.current}));let y=A&&bu.includes(A),T=A==="ERROR_SCREEN"&&pe.errorModalData&&bu.includes(pe.errorModalData.previousScreen);if((y||T)&&pe.funding){let N=D3[A]??null,z=Ir(pe.funding.chain.id,W.chains,W.rpcConfig,{appId:e.appId}),V;try{V=(await z.getBalance(pe.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}O(I,"fundWallet","onUserExited",{address:pe.funding.address,chain:pe.funding.chain,fundingMethod:N,balance:V})}Q({...pe,externalConnectWallet:{suggestedAddress:void 0}}),B.current=null,U.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 T=await t.getAccessToken();if(!T)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 N=te.walletProxy??await te.initializeWalletProxy(15e3);if(!N)throw new Error("Failed to initialize embedded wallet proxy.");let{response:z}=await N.rpcSolana({accessToken:T,publicKey:f.address,request:{method:"signMessage",params:{message:c}}});return z.data.signature};if(W.embeddedWallets.noPromptOnSignature)try{let T=await y();p({signature:T})}catch(T){h(T)}else Q({signMessage:{method:"solana_signMessage",data:c,confirmAndSign:y,onSuccess:V=>{p({signature:V})},onFailure:V=>{h(V)},uiOptions:{}}}),rt("EMBEDDED_WALLET_SIGN_REQUEST_SCREEN")}),openPrivyModal:se,connectWallet:Xr,initLoginWithWallet:async(c,p)=>{U.current="siwe",wt(c,p)},loginWithWallet:async()=>{if(!n)throw new Dn;if(!(t.authFlow instanceof Ho))throw new w("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(y){throw O(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),y}else try{({user:p,isNewUser:h}=await t.authenticate()),U.current="siwe"}catch(y){throw O(I,"login","onError",y.privyErrorCode||"generic_connect_wallet_error"),y}d(p||s||null),b(h||!1),l(!0)},initLoginWithFarcaster:async c=>{let p=new Ha(c);t.startAuthFlow(p);try{U.current="farcaster",await p.initializeFarcasterConnect()}catch(h){throw B.current==="login"?O(I,"login","onError",h.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(I,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"farcaster"}),h}},loginWithFarcaster:async()=>{if(!n)throw new Dn;if(!(t.authFlow instanceof Ha))throw new w("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(y){throw O(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"farcaster"}),y}else try{({user:p,isNewUser:h}=await t.authenticate()),U.current="farcaster"}catch(y){throw O(I,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}d(p||null),b(h||!1),l(!0)},async loginWithGuestAccountFlow(){let c=new Wi(this.appId);t.startAuthFlow(c);try{B.current="login",U.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(Et(h,W.embeddedWallets.createOnLogin))try{await Ma(h,15e3),h=await te.refreshUser()}catch{d(h),console.warn("Unable to create embedded wallet for guest account")}else d(h);return b(y),l(!0),O(I,"login","onComplete",h,y,!1,"guest",null),h}catch(p){throw O(I,"login","onError",p.privyErrorCode||"unknown_auth_error"),p}},async crossAppAuthFlow({appId:c,popup:p,action:h}){let y=`privy:${c}`;U.current=y;let{url:T,stateCode:N,codeVerifier:z}=await s1({api:t.api,appId:c});if(!T)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 V=await L0({url:T,popup:p,provider:y}),re=V.stateCode,ie=V.authorizationCode;if(re!==N)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:y,storedStateCode:N??"",returnedStateCode:re??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let de=await l1({appId:c,codeVerifier:z,stateCode:re,authorizationCode:ie,action:h,client:t});de&&t.storeProviderAccessToken(c,de);let ke=await te.refreshUser();if(!ke)throw new w("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:c}}),ke}catch(V){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:V.toString(),provider:y}}),V}},async initLoginWithOAuth(c,p){if(U.current=c,Ia()){if(c==="google"&&$i(window.navigator.userAgent)){rt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{rt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}c==="twitter"&&window.opener&&window.opener.postMessage({type:"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"},"*"),J.del(Vn);let h=new go({provider:c});p&&h.addCaptchaToken(p),t.startAuthFlow(h);let y=await t.authFlow.getAuthorizationUrl();y&&y.url&&(c==="twitter"&&aA&&(y.url=y.url.replace("x.com","twitter.com")),window.location.assign(y.url))},async initLoginWithTelegram(c){if(!n)throw new Dn;U.current="telegram";let p=new Oi(c);t.startAuthFlow(p),p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult=await new Promise((h,y)=>{if(!W.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:W.loginConfig.telegramAuthConfiguration.botId,request_access:!0},T=>T?h(T):y(new w("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Oi))throw new w("Must initialize Telegram flow before calling loginWithTelegram");let c,p;if(B.current==="login")try{let h=await t.authenticate();c=h.user,p=h.isNewUser,U.current="telegram"}catch(h){throw O(I,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}else if(B.current==="link")try{c=(await t.link()).user,U.current="telegram"}catch(h){throw O(I,"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,T;function N(z){if(!z)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:z,codeVerifier:V,stateCode:re}=await Ap({api:jo.api,provider:c});N(z);let ie,de;try{let ke=await Nu({url:z,popup:h,provider:c});if(ie=ke.stateCode,de=ke.authorizationCode,ie!==re)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c,storedStateCode:re??"",returnedStateCode:ie??""}}),new w("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 w("Recovery OAuth failed")}[y,T]=await Promise.all([be(),cy({api:jo.api,provider:c,codeVerifier:V,stateCode:ie,authorizationCode:de})]);break}case"icloud":{let{url:z}=await Ap({api:jo.api,provider:c});N(z);let{ckWebAuthToken:V}=await Nu({url:z,popup:h,provider:c});T=V,y=await be();break}}if(!M)throw new w("Cannot connect to wallet proxy");if(!y)throw new w("Unable to authorize user");switch(p){case"recover":let z=pe.recoverWallet?.privyWallet?.address;if(!z)throw new w("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:z,recoveryMethod:c}}),await M.recover({address:z,accessToken:y,recoveryAccessToken:T,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 M.create({accessToken:y,recoveryAccessToken:T,recoveryMethod:c});let V=await te.refreshUser(),re=Me(V);if(!re)throw O(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:re.address}}),O(I,"createWallet","onSuccess",re);break;case"set-recovery":let ie=Me(s);if(!ie)throw O(I,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:ie.address,existingRecoveryMethod:ie.recoveryMethod,targetRecoveryMethod:c}}),await M.setRecovery({address:ie.address,accessToken:y,recoveryAccessToken:T,recoveryMethod:c});let de=Me(await te.refreshUser());if(!de)throw O(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:ie.address,existingRecoveryMethod:ie.recoveryMethod,targetRecoveryMethod:c}}),O(I,"setWalletRecovery","onSuccess",c,de);break;default:throw new w("Unsupported recovery action")}},async loginWithOAuth(c){if(!(t.authFlow instanceof go))throw new w("Must initialize OAuth flow before calling loginWithOAuth");let p=J.get(Bn),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(),T,N,z;if(y!==null)try{let V=await t.link();T=V.user,z=V.oAuthTokens,U.current=c}catch(V){throw O(I,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account",{linkMethod:c}),V}else try{let V=await t.authenticate();T=V.user,N=V.isNewUser,z=V.oAuthTokens,U.current=c}catch(V){throw B.current==="login"?O(I,"login","onError",V.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(I,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account",{linkMethod:c}),V}return d(T),b(N||!1),l(!0),z&&T&&O(I,"oAuthAuthorization","onOAuthTokenGrant",z,{user:T}),z},async initLoginWithPasskey(c){let p=new Kn(c);t.startAuthFlow(p),B.current="login";try{U.current="passkey",await p.initAuthenticationFlow()}catch(h){throw O(I,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}},async loginWithPasskey(){if(!n)throw new Dn;if(!(t.authFlow instanceof Kn))throw new w("Must initialize Passkey flow first.");if(U.current!=="passkey")throw new w("Must init login with Passkey flow first.");let c,p;try{U.current="passkey",{user:c,isNewUser:p}=await t.authenticate()}catch(h){throw O(I,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}d(c),b(p||!1),l(!0)},async initLinkWithPasskey(c){let p=new Kn(c);t.startAuthFlow(p),B.current="link",U.current="passkey";try{await p.initLinkFlow()}catch(h){throw O(I,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"passkey"}),h}},async linkWithPasskey(){if(!n)throw new Dn;if(!(t.authFlow instanceof Kn))throw new w("Must initialize Passkey flow first.");if(U.current!=="passkey")throw new w("Must init login with Passkey flow first.");let c;try{U.current="passkey",{user:c}=await t.link()}catch(p){throw O(I,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account",{linkMethod:"passkey"}),p}return d(c||s||null),c},async initLoginWithHeadlessOAuth(c,p){if(Ia()){if(c==="google"&&$i(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});p&&h.addCaptchaToken(p);let y=await t.startAuthFlow(h).getAuthorizationUrl();y?.url&&window.location.assign(y.url)},async loginWithHeadlessOAuth(c){P(!0),t.startAuthFlow(new go(c));let p=J.get(Bn),h=c.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c.provider,storedStateCode:p??"",returnedStateCode:h??""}}),P(!1),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let y=await t.getAccessToken(),T,N,z;if(y!==null)try{({user:T,oAuthTokens:z}=await t.link()),U.current=c.provider;let V=Ks(T);T&&V&&O(I,"linkAccount","onSuccess",T,U.current,V)}catch(V){throw P(!1),O(I,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account",{linkMethod:c.provider}),V}else try{({user:T,isNewUser:N,oAuthTokens:z}=await t.authenticate()),U.current=c.provider;let V=Ks(T);T&&V&&(B.current==="login"&&N!==void 0?O(I,"login","onComplete",T,N,!1,U.current,V):B.current==="link"&&O(I,"linkAccount","onSuccess",T,U.current,V))}catch(V){throw P(!1),B.current==="login"?O(I,"login","onError",V.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(I,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account",{linkMethod:c.provider}),V}return d(T),b(N||!1),l(!0),P(!1),z&&T&&O(I,"oAuthAuthorization","onOAuthTokenGrant",z,{user:T}),T??void 0},initLoginWithEmail:async(c,p)=>{let h=new tn(c,p);t.startAuthFlow(h);try{U.current="email",await h.sendCodeEmail()}catch(y){throw B.current==="login"?O(I,"login","onError",y.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"email"}),y}},initUpdateEmail:async(c,p,h)=>{let y=new fl(c,p,h);t.startAuthFlow(y),await y.sendCodeEmail()},initUpdatePhone:async(c,p,h)=>{let y=new Il(c,p,h);t.startAuthFlow(y),await y.sendSmsCode()},initLoginWithSms:async(c,p)=>{H({status:"sending-code"});let h=new rn(c,p);t.startAuthFlow(h);try{U.current="sms",await h.sendSmsCode(),H({status:"awaiting-code-input"})}catch(y){throw H({status:"error",error:y}),B.current==="login"?O(I,"login","onError",y.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(I,"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(H({status:"submitting-code"}),!n){let y=new Dn;throw H({status:"error",error:y}),y}if(t.authFlow instanceof tn)t.authFlow.meta.emailCode=c.trim();else if(t.authFlow instanceof rn)t.authFlow.meta.smsCode=c.trim();else{let y=new w("Must initialize a passwordless code flow first");throw H({status:"error",error:y}),y}await be();let p,h;if(B.current==="link")try{({user:p}=await t.link())}catch(y){throw H({status:"error",error:y}),O(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:U.current}),y}else try{({user:p,isNewUser:h}=await t.authenticate())}catch(y){throw H({status:"error",error:y}),O(I,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}d(p||s||null),b(h||!1),l(!0),H({status:"done"})},generateSiweMessage:async({address:c,chainId:p,captchaToken:h})=>{B.current="link",U.current="siwe";let y=await t.generateSiweNonce({address:c,captchaToken:h}),T=p.replace("eip155:","");return Ml({address:c,chainId:T,nonce:y})},linkWithSiwe:async({message:c,signature:p,chainId:h,walletClientType:y,connectorType:T})=>{let N;try{N=await t.linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:y,connectorType:T}),N=await te.refreshUser()??N;let z=Ks(N);z&&O(I,"linkAccount","onSuccess",N,"siwe",z)}catch(z){throw O(I,"linkAccount","onError",z.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),B.current=null,U.current=null,z}d(N||s||null),B.current=null,U.current=null},refreshUser:async()=>{let c=await t.getAuthenticatedUser();return l(!!c),d(c),c},walletProxy:M,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=Me(c?.user??s)||Wl(c?.user??s),T=await be();if(!T||!M||!y){h(new Error("Must have valid access token and Privy wallet to recover wallet"));return}q(!0);try{await M.connect({accessToken:T,address:y.address}),p(!0)}catch(N){if(ri(N)&&y.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:y.address}}),(await M.recover({address:y.address,accessToken:T,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(ri(N)&&y.recoveryMethod!=="privy"){Q({recoverWallet:{privyWallet:y,onFailure:h,onSuccess:()=>p(!0)},recoveryOAuthStatus:{provider:y.recoveryMethod,action:"recover"}});let z=yc(y.recoveryMethod);se(z)}else h(N)}}),embeddedSolanaWallet:f,createEmbeddedSolanaWallet:async()=>{q(!0);let c=await be(),p=await te.refreshUser(),h=Yn(p),y=Me(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 te.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 T=await te.initializeWalletProxy(15e3);if(!T)throw new w("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await T.createSolana({accessToken:c,ethereumAddress:y?.address});let N=await te.refreshUser(),z=Yn(N);if(!z)throw new w("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:z.address}}),z}catch(N){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new w("Failed to create Solana embedded wallet with error ",N)}},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,T=s.linkedAccounts.filter(re=>re.type==="wallet"&&re.walletClientType==="privy"&&re.chainType==="solana"),N=y?T.find(re=>re.address.toLowerCase()===y.toLowerCase()):T.find(re=>!re.imported)||T[0];if(!N){h(new Error("Must have a Privy wallet before exporting"));return}if(q(!0),!await be()||!M){h(new Error("Must have valid access token to enroll in MFA"));return}if(!M){h(new Error("Must have a Privy wallet before exporting"));return}await te.recoverEmbeddedSolanaWallet();let V={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:N,onSuccess:p,onFailure:h};Q({keyExport:V}),se("EMBEDDED_WALLET_KEY_EXPORT_SCREEN")}),recoverEmbeddedSolanaWallet:async()=>new Promise(async(c,p)=>{let h=Yn(s),y=await be();if(!y||!M||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}q(!0);try{await M.connectSolana({accessToken:y,publicKey:h.address}),c(!0)}catch(T){ri(T)&&h.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await M.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(T)}}),getMoonpaySignedUrl:Ei,initCoinbaseOnRamp:t.initCoinbaseOnRamp.bind(t),getCoinbaseOnRampStatus:t.getCoinbaseOnRampStatus.bind(t),setReadyToTrue:c=>{i(!0),ee?.(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=Id({fundingMethods:W.fundingConfig.methods});Q({funding:Fu({address:c,fundWalletConfig:p,methodScreen:h})}),se(h)},requestFarcasterSignerStatus:async c=>{let p=await be(),h=s?.linkedAccounts.find(T=>T.type==="wallet"&&T.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!M||!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 T=await t.getAuthenticatedUser();d(T||s||null)}return y},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"),Xr(c);await zs("coinbase_wallet","coinbase_smart_wallet")},setCustomMetadataForUser:async c=>{try{let p=await t.setCustomMetadata(c);return d(p),O(I,"setCustomMetadata","onSuccess",p),p}catch(p){throw O(I,"setCustomMetadata","onError",p.privyErrorCode||"unknown_auth_error"),p}}}))();H0=te.recoverEmbeddedEthereumWallet,V0=te.recoverEmbeddedSolanaWallet,G0=te.solanaSignMessage;let Hu=iA(()=>({wallets:u,ready:ce&&Ke}),[u,ce,Ke]);return Rr(xe.Provider,{value:Ti,children:Rr(Sm.Provider,{value:I,children:Rr(_m.Provider,{value:Hu,children:Rr(ah,{...W,children:D0(bm.Provider,{value:te,children:[Rr(Pm,{children:D0($f,{data:pe,setModalData:Q,setInitialScreen:_,initialScreen:A,authenticated:a,open:r,children:[e.children,!W.headless&&W.captchaEnabled&&n&&!a&&Rr(op,{delayedExecution:!1}),Rr(g0,{theme:{...W.appearance.palette||{}}}),!W.render.standalone&&Rr(Mu,{open:r})]})}),Ce&&Y?Rr(M0,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:mr,mfaSubmitPromise:vt,onLoad:X,onLoadFailed:()=>null}):null,W.loginConfig.telegramAuthConfiguration&&Rr(eo,{if:!0,children:Rr(R0,{scriptHost:e.apiUrl||$s,botUsername:W.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};import{useCallback as q0,useEffect as fA}from"react";var hA=e=>{Ne("login",e);let t=Ae(),r=al(),{initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:n,isHeadlessOAuthLoading:i,ready:a,user:l}=K(),s=q0(async u=>{if(t.enabled&&t.status!=="success")throw new yr(t.error,null,"captcha_failure");return o(u.provider,t.token)},[o,t]),d=q0(async()=>{let u=za();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{zn()}},[n]);return fA(()=>{let u=za();a&&r&&u.inProgress&&u.headless&&!u.popupFlow&&d()},[a,r]),{initOAuth:s,loginWithOAuth:d,loading:i}};import{useCallback as z0}from"react";var yA=()=>{let e=Ae(),{initLoginWithEmail:t,loginWithCode:r}=K(),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 yr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};import{useCallback as K0}from"react";var gA=()=>{let e=Ae(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=K(),n=K0(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=K0(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 Y0}from"react";var CA=()=>{let e=Ae(),{generateSiweMessage:t,linkWithSiwe:r}=K(),o=Y0(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=Y0(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 vA}from"react";function wA(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:g,linkFarcaster:v}=vA(xe);return Ne("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:v,linkTelegram:g}}import{useContext as bA}from"react";function EA(e){let{connectWallet:t}=bA(xe);return Ne("connectWallet",e),{connectWallet:t}}import{useContext as TA}from"react";function SA(e){let{createWallet:t}=TA(xe);return Ne("createWallet",e),{createWallet:t}}var AA=()=>{let{embeddedSolanaWallet:e,exportSolanaWallet:t,createEmbeddedSolanaWallet:r}=L();return{createWallet:r,exportWallet:t,wallets:e?[e]:[]}};var PA=()=>{let{connectCoinbaseSmartWallet:e}=L();return{connectCoinbaseSmartWallet:e}};var xA=()=>{let{startCrossAppAuthFlow:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=K();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 RA}from"react";function kA(e){let{sendTransaction:t}=RA(xe);return Ne("sendTransaction",e),{sendTransaction:t}}import{useContext as _A}from"react";function MA(e){let{setWalletPassword:t}=_A(xe);return Ne("setWalletPassword",e),{setWalletPassword:t}}import{useContext as IA}from"react";function WA(){let{createGuestAccount:e}=IA(xe);return{createGuestAccount:e}}import{useContext as LA}from"react";function NA(e){let{setWalletRecovery:t}=LA(xe);return Ne("setWalletRecovery",e),{setWalletRecovery:t}}import{useContext as OA}from"react";function DA(e){let{signMessage:t}=OA(xe);return Ne("signMessage",e),{signMessage:t}}import{useContext as UA}from"react";function FA(e){let{signTypedData:t}=UA(xe);return Ne("signTypedData",e),{signTypedData:t}}import{useContext as BA}from"react";var HA=()=>{let{isModalOpen:e}=BA(xe);return{isOpen:e}};import{useContext as VA}from"react";function GA(e){let{getAccessToken:t}=VA(xe);return Ne("accessToken",e),{getAccessToken:t}}function qA(e){let{authenticated:t,user:r}=K(),{initLoginWithOAuth:o}=L(),n=Ri();return Ne("oAuthAuthorization",e),{reauthorize:i=>zA(t,r,o,n,i.provider)}}var zA=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 KA=e=>{let{customAuthStatus:t}=L();return Ne("customAuth",e),{status:t}};var YA=Q0;function Q0(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=K();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}import{useContext as QA}from"react";function XA(e){let{setCustomMetadata:t}=QA(xe);return Ne("setCustomMetadata",e),{setCustomMetadata:t}}function ZA(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}export{vo as AsExternalProvider,op as Captcha,Xa as ConnectorManager,Mu as LoginModal,Za as PrivyClient,uA as PrivyProvider,Ze as PrivyProxyProvider,zd as SUPPORTED_CHAINS,Ud as VERSION,tr as WalletConnector,o6 as addRpcUrlOverrideToChain,Tp as errorIndicatesMaxMfaRetries,oi as errorIndicatesMfaTimeout,ni as errorIndicatesMfaVerificationFailed,be as getAccessToken,ZA as getEmbeddedConnectedWallet,PA as useConnectCoinbaseSmartWallet,EA as useConnectWallet,SA as useCreateWallet,xA as useCrossAppAccounts,KA as useCustomAuth,YA as useExperimentalFarcasterSigner,Q0 as useFarcasterSigner,$0 as useFundWallet,WA as useGuestAccounts,wA as useLinkAccount,CA as useLinkWithSiwe,j0 as useLogin,yA as useLoginWithEmail,hA as useLoginWithOAuth,gA as useLoginWithSms,Kd as useLogout,ks as useMfa,ao as useMfaEnrollment,HA as useModalStatus,qA as useOAuthTokens,K as usePrivy,np as useRegisterMfaListener,kA as useSendTransaction,XA as useSetCustomMetadata,MA as useSetWalletPassword,NA as useSetWalletRecovery,DA as useSignMessage,FA as useSignTypedData,AA as useSolanaWallets,GA as useToken,Bo 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};
|