@privy-io/react-auth 1.58.0 → 1.58.1-beta-20240304165452

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Qg=Object.create;var pa=Object.defineProperty;var Zg=Object.getOwnPropertyDescriptor;var Xg=Object.getOwnPropertyNames;var ev=Object.getPrototypeOf,tv=Object.prototype.hasOwnProperty;var ov=(e,t)=>{for(var o in t)pa(e,o,{get:t[o],enumerable:!0})},md=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Xg(t))!tv.call(e,n)&&n!==o&&pa(e,n,{get:()=>t[n],enumerable:!(r=Zg(t,n))||r.enumerable});return e};var f=(e,t,o)=>(o=e!=null?Qg(ev(e)):{},md(t||!e||!e.__esModule?pa(o,"default",{value:e,enumerable:!0}):o,e)),rv=e=>md(pa({},"__esModule",{value:!0}),e);var xl=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)};var fd=(e,t,o)=>(xl(e,t,"read from private field"),o?o.call(e):t.get(e)),ua=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o)},Sl=(e,t,o,r)=>(xl(e,t,"write to private field"),r?r.call(e,o):t.set(e,o),o);var hd=(e,t,o)=>(xl(e,t,"access private method"),o);var Pb={};ov(Pb,{AsExternalProvider:()=>ho,Captcha:()=>as,ConnectorManager:()=>Ln,PrivyClient:()=>On,PrivyProvider:()=>Pg,PrivyProxyProvider:()=>Se,SUPPORTED_CHAINS:()=>Mn,VERSION:()=>ba,WalletConnector:()=>vt,addRpcUrlOverrideToChain:()=>jg,errorIndicatesMaxMfaRetries:()=>As,errorIndicatesMfaTimeout:()=>Zr,errorIndicatesMfaVerificationFailed:()=>Xr,getAccessToken:()=>Ke,useConnectWallet:()=>Mg,useCreateWallet:()=>Ng,useLogin:()=>Sg,useLoginWithEmail:()=>kg,useLoginWithSms:()=>Rg,useLogout:()=>Ag,useMfa:()=>cn,useMfaEnrollment:()=>ui,useModalStatus:()=>zg,usePrivy:()=>z,useRegisterMfaListener:()=>ds,useSendTransaction:()=>Og,useSetWalletPassword:()=>Ug,useSignMessage:()=>Bg,useSignTypedData:()=>Gg,useToken:()=>qg,useWallets:()=>vi});module.exports=rv(Pb);var la=require("@ethersproject/address"),Ei=require("@ethersproject/providers"),wg=require("mipd"),J=require("react");var yd=require("ofetch"),rt=class extends Error{constructor(o,r,n){super(o);r instanceof Error&&(this.cause=r),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},Io=class extends rt{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},w=class extends rt{constructor(o,r,n){super(o,r,n);this.type="client_error"}},ma=class extends w{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var Z=class extends rt{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},ue=e=>{if(e instanceof rt)return e;if(!(e instanceof yd.FetchError))return ft(e);if(!e.response)return new Io("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.data;return new Io(t||"ApiError",e.response.status,o||r,e,n)},ft=e=>e instanceof rt?e:e instanceof Error?new w(e.message,e):new w(`Internal error: ${e}`);var vn=class extends w{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Nt=class extends w{constructor(t="Embedded wallet error",o){super(t,o,"unknown_embedded_wallet_error")}},fa=class extends w{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var ha=()=>"/api/v1/sessions",ya=()=>"/api/v1/sessions/logout",gd=()=>"/api/v1/sessions/fork",ga=()=>"/api/v1/sessions/fork/recover",vd=()=>"/api/v1/siwe/init",wd=()=>"/api/v1/siwe/authenticate",Cd=()=>"/api/v1/siwe/link",bd=()=>"/api/v1/farcaster/init",Ed=()=>"/api/v1/farcaster/authenticate",Td=()=>"/api/v1/farcaster/link",Pd=()=>"/api/v1/farcaster/status",xd=()=>"/api/v1/passwordless/init",Sd=()=>"/api/v1/passwordless/authenticate",_d=()=>"/api/v1/passwordless/link",Ad=()=>"/api/v1/passwordless/update",kd=()=>"/api/v1/passwordless_sms/init",Rd=()=>"/api/v1/passwordless_sms/authenticate",Id=()=>"/api/v1/passwordless_sms/link",Md=()=>"/api/v1/oauth/init",Wd=()=>"/api/v1/oauth/authenticate",Nd=()=>"/api/v1/oauth/link",Ld=()=>"/api/v1/siwe/unlink",Od=()=>"/api/v1/passwordless/unlink",Dd=()=>"/api/v1/passwordless_sms/unlink",Ud=()=>"/api/v1/oauth/unlink",Fd=()=>"/api/v1/farcaster/unlink",Bd=()=>"/api/v1/analytics_events",Hd=()=>"/api/v1/plugins/moonpay_on_ramp/sign",Gd=()=>"/api/v1/custom_jwt_account/authenticate",Vd=()=>"/api/v1/mfa/passwordless_sms/init";var zd=()=>"/api/v1/mfa/passwordless_sms/enroll";var $d=()=>"/api/v1/users/me/accept_terms";var wn=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=Gd(),o=await this.api.post(t,{token:this.meta.token});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw ue(t)}}async link(){throw new Error("Unimplemented")}};var Cr=class{constructor(t,o){this.meta={email:t,captchaToken:o}}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=Sd(),o=await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw ue(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{let t=_d();return await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw ue(t)}}async sendCodeEmail(t,o){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.email=t),o&&(this.meta.captchaToken=o),!this.meta.email)throw new w("Email must be set when initialzing authentication.");try{let r=xd();return await this.api.post(r,{email:this.meta.email,token:this.meta.captchaToken})}catch(r){throw ue(r)}}},va=class extends Cr{constructor(o,r,n){super(r,n);this.meta={email:r,captchaToken:n,oldAddress:o}}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{let o=Ad();return await this.api.post(o,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(o){throw ue(o)}}};var qd=require("react-device-detect");var ht=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 xi=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new ht(this._startChannelOnce.bind(this)),this.pollForReady=new ht(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(Ed(),{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,is_new_user:t.is_new_user}}catch(t){throw ue(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(Td(),{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw ue(t)}}async _startChannelOnce(){if(!this.api)throw new w("Auth flow has no API instance");let t=await this.api.post(bd(),{token:this.captchaToken});qd.isMobile&&t.connect_uri&&window.open(t.connect_uri,"_blank","noopener noreferrer"),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(Pd(),{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}};var Nl=require("jose");var jd="1.58.0";var wa="4df5e2316331463a9130964bd6078dfa",Kd="fe9c30fc-3bc5-4064-91e2-6ab5887f8f4d",Yd="34357d3c125c2bcf2ce2bc3309d98715",Ca="https://auth.privy.io",Jd=2e4,yt=1400,Qd=2500,ba=jd;var zr="privy:token",_l="privy-token",Ea="privy:refresh_token",Al="privy-refresh-token",Ta="privy-session",Si="privy:session_transfer_token",iv="privy:wallet",_i="privy:caid",Cn="privy:state_code",bn="privy:code_verifier",Pa=e=>`${iv}:${e}`,kl="privy:connectors",Rl="privy:connections";var $r=12e4,tr=1,Il="0x1",En=3e4,Zd="https://api.moonpay.com/v1",Xd="https://api.moonpay.com/v1",ep="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",tp="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",op="0x420000000000000000000000000000000000000F",rp=["function getL1Fee(bytes memory _data) external view returns (uint256)"];async function np(e){let t=new TextEncoder().encode(e),o=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(o)}function ip(e){return crypto.getRandomValues(new Uint8Array(e))}var xa=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,o){o!==void 0?this._cache[t]=o:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},Ml=class{get(t){let o=localStorage.getItem(t);return o===null?void 0:JSON.parse(o)}put(t,o){o!==void 0?localStorage.setItem(t,JSON.stringify(o)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}},Wl=class{get(t){let o=sessionStorage.getItem(t);return o===null?void 0:JSON.parse(o)}put(t,o){o!==void 0?sessionStorage.setItem(t,JSON.stringify(o)):this.del(t)}del(t){sessionStorage.removeItem(t)}getKeys(){return Object.entries(sessionStorage).map(([t])=>t)}};function ap(){try{let e="privy:__session_storage__test",t="blobby";return window.sessionStorage.setItem(e,t),window.sessionStorage.removeItem(e),!0}catch{return!1}}function av(){return typeof window<"u"&&window.localStorage?new Ml:new xa}function sv(){return typeof window<"u"&&window.sessionStorage?new Wl:new xa}var uo=sv(),ce=av();var lv="S256",cv="S256",br=class{constructor(t,o,r){this.meta={provider:t},this.meta.authorizationCode=o,this.meta.stateCode=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=uo.get(bn);if(!t)throw new w("Authentication error.");try{let o=Wd(),r=await this.api.post(o,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return uo.del(bn),{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(o){let r=ue(o);throw r.privyErrorCode?new w(r.message||"Invalid code during OAuth flow.",void 0,r.privyErrorCode):r.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=uo.get(bn);if(!t)throw new w("Authentication error.");try{let o=Nd(),r=await this.api.post(o,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return uo.del(bn),r}catch(o){throw ue(o)}}createCodeVerifier(){return Nl.base64url.encode(ip(36))}createStateCode(){return this.createCodeVerifier()}async deriveCodeChallengeFromCodeVerifier(t,o=lv){if(o==cv){let r=await np(t);return Nl.base64url.encode(r)}else return t}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=this.createCodeVerifier();uo.put(bn,t);let o=this.createStateCode();uo.put(Cn,o);let r=await this.deriveCodeChallengeFromCodeVerifier(t);try{let n=Md();return await this.api.post(n,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:r,state_code:o})}catch(n){throw ue(n)}}};var qr=class{constructor(t,o){this.createSiweMessage=(t,o,r,n,i,a,l)=>`${r} wants you to sign in with your Ethereum account:
1
+ "use strict";var Qg=Object.create;var pa=Object.defineProperty;var Zg=Object.getOwnPropertyDescriptor;var Xg=Object.getOwnPropertyNames;var ev=Object.getPrototypeOf,tv=Object.prototype.hasOwnProperty;var ov=(e,t)=>{for(var o in t)pa(e,o,{get:t[o],enumerable:!0})},md=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Xg(t))!tv.call(e,n)&&n!==o&&pa(e,n,{get:()=>t[n],enumerable:!(r=Zg(t,n))||r.enumerable});return e};var f=(e,t,o)=>(o=e!=null?Qg(ev(e)):{},md(t||!e||!e.__esModule?pa(o,"default",{value:e,enumerable:!0}):o,e)),rv=e=>md(pa({},"__esModule",{value:!0}),e);var xl=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)};var fd=(e,t,o)=>(xl(e,t,"read from private field"),o?o.call(e):t.get(e)),ua=(e,t,o)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,o)},Sl=(e,t,o,r)=>(xl(e,t,"write to private field"),r?r.call(e,o):t.set(e,o),o);var hd=(e,t,o)=>(xl(e,t,"access private method"),o);var Pb={};ov(Pb,{AsExternalProvider:()=>ho,Captcha:()=>as,ConnectorManager:()=>Ln,PrivyClient:()=>On,PrivyProvider:()=>Pg,PrivyProxyProvider:()=>Se,SUPPORTED_CHAINS:()=>Mn,VERSION:()=>ba,WalletConnector:()=>vt,addRpcUrlOverrideToChain:()=>jg,errorIndicatesMaxMfaRetries:()=>As,errorIndicatesMfaTimeout:()=>Zr,errorIndicatesMfaVerificationFailed:()=>Xr,getAccessToken:()=>Ke,useConnectWallet:()=>Mg,useCreateWallet:()=>Ng,useLogin:()=>Sg,useLoginWithEmail:()=>kg,useLoginWithSms:()=>Rg,useLogout:()=>Ag,useMfa:()=>cn,useMfaEnrollment:()=>ui,useModalStatus:()=>zg,usePrivy:()=>z,useRegisterMfaListener:()=>ds,useSendTransaction:()=>Og,useSetWalletPassword:()=>Ug,useSignMessage:()=>Bg,useSignTypedData:()=>Gg,useToken:()=>qg,useWallets:()=>vi});module.exports=rv(Pb);var la=require("@ethersproject/address"),Ei=require("@ethersproject/providers"),wg=require("mipd"),J=require("react");var yd=require("ofetch"),rt=class extends Error{constructor(o,r,n){super(o);r instanceof Error&&(this.cause=r),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},Io=class extends rt{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},w=class extends rt{constructor(o,r,n){super(o,r,n);this.type="client_error"}},ma=class extends w{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var Z=class extends rt{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},me=e=>{if(e instanceof rt)return e;if(!(e instanceof yd.FetchError))return ft(e);if(!e.response)return new Io("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.data;return new Io(t||"ApiError",e.response.status,o||r,e,n)},ft=e=>e instanceof rt?e:e instanceof Error?new w(e.message,e):new w(`Internal error: ${e}`);var vn=class extends w{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Nt=class extends w{constructor(t="Embedded wallet error",o){super(t,o,"unknown_embedded_wallet_error")}},fa=class extends w{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var ha=()=>"/api/v1/sessions",ya=()=>"/api/v1/sessions/logout",gd=()=>"/api/v1/sessions/fork",ga=()=>"/api/v1/sessions/fork/recover",vd=()=>"/api/v1/siwe/init",wd=()=>"/api/v1/siwe/authenticate",Cd=()=>"/api/v1/siwe/link",bd=()=>"/api/v1/farcaster/init",Ed=()=>"/api/v1/farcaster/authenticate",Td=()=>"/api/v1/farcaster/link",Pd=()=>"/api/v1/farcaster/status",xd=()=>"/api/v1/passwordless/init",Sd=()=>"/api/v1/passwordless/authenticate",_d=()=>"/api/v1/passwordless/link",Ad=()=>"/api/v1/passwordless/update",kd=()=>"/api/v1/passwordless_sms/init",Rd=()=>"/api/v1/passwordless_sms/authenticate",Id=()=>"/api/v1/passwordless_sms/link",Md=()=>"/api/v1/oauth/init",Wd=()=>"/api/v1/oauth/authenticate",Nd=()=>"/api/v1/oauth/link",Ld=()=>"/api/v1/siwe/unlink",Od=()=>"/api/v1/passwordless/unlink",Dd=()=>"/api/v1/passwordless_sms/unlink",Ud=()=>"/api/v1/oauth/unlink",Fd=()=>"/api/v1/farcaster/unlink",Bd=()=>"/api/v1/analytics_events",Hd=()=>"/api/v1/plugins/moonpay_on_ramp/sign",Gd=()=>"/api/v1/custom_jwt_account/authenticate",Vd=()=>"/api/v1/mfa/passwordless_sms/init";var zd=()=>"/api/v1/mfa/passwordless_sms/enroll";var $d=()=>"/api/v1/users/me/accept_terms";var wn=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=Gd(),o=await this.api.post(t,{token:this.meta.token});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw me(t)}}async link(){throw new Error("Unimplemented")}};var Cr=class{constructor(t,o){this.meta={email:t,captchaToken:o}}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=Sd(),o=await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw me(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{let t=_d();return await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw me(t)}}async sendCodeEmail(t,o){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.email=t),o&&(this.meta.captchaToken=o),!this.meta.email)throw new w("Email must be set when initialzing authentication.");try{let r=xd();return await this.api.post(r,{email:this.meta.email,token:this.meta.captchaToken})}catch(r){throw me(r)}}},va=class extends Cr{constructor(o,r,n){super(r,n);this.meta={email:r,captchaToken:n,oldAddress:o}}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{let o=Ad();return await this.api.post(o,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(o){throw me(o)}}};var qd=require("react-device-detect");var ht=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 xi=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new ht(this._startChannelOnce.bind(this)),this.pollForReady=new ht(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(Ed(),{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,is_new_user:t.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(Td(),{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw me(t)}}async _startChannelOnce(){if(!this.api)throw new w("Auth flow has no API instance");let t=await this.api.post(bd(),{token:this.captchaToken});qd.isMobile&&t.connect_uri&&window.open(t.connect_uri,"_blank","noopener noreferrer"),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(Pd(),{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}};var Nl=require("jose");var jd="1.58.1-beta-20240304165452";var wa="4df5e2316331463a9130964bd6078dfa",Kd="fe9c30fc-3bc5-4064-91e2-6ab5887f8f4d",Yd="34357d3c125c2bcf2ce2bc3309d98715",Ca="https://auth.privy.io",Jd=2e4,yt=1400,Qd=2500,ba=jd;var zr="privy:token",_l="privy-token",Ea="privy:refresh_token",Al="privy-refresh-token",Ta="privy-session",Si="privy:session_transfer_token",iv="privy:wallet",_i="privy:caid",Cn="privy:state_code",bn="privy:code_verifier",Pa=e=>`${iv}:${e}`,kl="privy:connectors",Rl="privy:connections";var $r=12e4,tr=1,Il="0x1",En=3e4,Zd="https://api.moonpay.com/v1",Xd="https://api.moonpay.com/v1",ep="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",tp="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",op="0x420000000000000000000000000000000000000F",rp=["function getL1Fee(bytes memory _data) external view returns (uint256)"];async function np(e){let t=new TextEncoder().encode(e),o=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(o)}function ip(e){return crypto.getRandomValues(new Uint8Array(e))}var xa=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,o){o!==void 0?this._cache[t]=o:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},Ml=class{get(t){let o=localStorage.getItem(t);return o===null?void 0:JSON.parse(o)}put(t,o){o!==void 0?localStorage.setItem(t,JSON.stringify(o)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}},Wl=class{get(t){let o=sessionStorage.getItem(t);return o===null?void 0:JSON.parse(o)}put(t,o){o!==void 0?sessionStorage.setItem(t,JSON.stringify(o)):this.del(t)}del(t){sessionStorage.removeItem(t)}getKeys(){return Object.entries(sessionStorage).map(([t])=>t)}};function ap(){try{let e="privy:__session_storage__test",t="blobby";return window.sessionStorage.setItem(e,t),window.sessionStorage.removeItem(e),!0}catch{return!1}}function av(){return typeof window<"u"&&window.localStorage?new Ml:new xa}function sv(){return typeof window<"u"&&window.sessionStorage?new Wl:new xa}var uo=sv(),de=av();var lv="S256",cv="S256",br=class{constructor(t,o,r){this.meta={provider:t},this.meta.authorizationCode=o,this.meta.stateCode=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=uo.get(bn);if(!t)throw new w("Authentication error.");try{let o=Wd(),r=await this.api.post(o,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return uo.del(bn),{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(o){let r=me(o);throw r.privyErrorCode?new w(r.message||"Invalid code during OAuth flow.",void 0,r.privyErrorCode):r.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=uo.get(bn);if(!t)throw new w("Authentication error.");try{let o=Nd(),r=await this.api.post(o,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return uo.del(bn),r}catch(o){throw me(o)}}createCodeVerifier(){return Nl.base64url.encode(ip(36))}createStateCode(){return this.createCodeVerifier()}async deriveCodeChallengeFromCodeVerifier(t,o=lv){if(o==cv){let r=await np(t);return Nl.base64url.encode(r)}else return t}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=this.createCodeVerifier();uo.put(bn,t);let o=this.createStateCode();uo.put(Cn,o);let r=await this.deriveCodeChallengeFromCodeVerifier(t);try{let n=Md();return await this.api.post(n,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:r,state_code:o})}catch(n){throw me(n)}}};var qr=class{constructor(t,o){this.createSiweMessage=(t,o,r,n,i,a,l)=>`${r} wants you to sign in with your Ethereum account:
2
2
  ${o}
3
3
 
4
4
  ${l}
@@ -9,7 +9,7 @@ Chain ID: ${t}
9
9
  Nonce: ${a}
10
10
  Issued At: ${i}
11
11
  Resources:
12
- - https://privy.io`;this.getNonceOnce=new ht(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(wd(),{message:t,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(t){throw ue(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign();return await this.api.post(Cd(),{message:t,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw ue(t)}}async sign(){if(!this.api)throw new w("Auth flow has no API 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.api)throw new w("Auth flow has no API instance");let t=this.wallet.address;return(await this.api.post(vd(),{address:t,token:this.captchaToken})).nonce}async buildSiweMessage(){if(!this.api)throw new w("Auth flow has no API instance");let t=this.wallet.address,o=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=this.prepareMessage(o,t,this.nonce),this.preparedMessage}prepareMessage(t,o,r){let n=window.location.host,i=window.location.origin,a="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",l=new Date().toISOString();return this.createSiweMessage(t,o,n,i,l,r,a)}};var jr=class{constructor(t,o){this.meta={phoneNumber:t,captchaToken:o}}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=Rd(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw ue(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{let t=Id();return await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ue(t)}}async sendSmsCode(t,o){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),o&&(this.meta.captchaToken=o),!this.meta.phoneNumber)throw new w("phone nNumber must be set when initialzing authentication.");try{let r=kd();return await this.api.post(r,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(r){throw ue(r)}}};var pu=require("uuid");function gt(e){return new Date(e*1e3)}function dv(e){let t=[];for(let o of e){let r=o.type;switch(o.type){case"wallet":let n={address:o.address,type:o.type,verifiedAt:gt(o.verified_at),chainType:"ethereum",chainId:o.chain_id,walletClient:o.wallet_client_type==="privy"?"privy":"unknown",walletClientType:o.wallet_client_type,connectorType:o.connector_type,recoveryMethod:o.recovery_method};t.push(n);break;case"email":let i={address:o.address,type:o.type,verifiedAt:gt(o.verified_at)};t.push(i);break;case"phone":let a={number:o.phoneNumber,type:o.type,verifiedAt:gt(o.verified_at)};t.push(a);break;case"google_oauth":let l={subject:o.subject,email:o.email,name:o.name,type:o.type,verifiedAt:gt(o.verified_at)};t.push(l);break;case"spotify_oauth":let s={subject:o.subject,email:o.email,name:o.name,type:o.type,verifiedAt:gt(o.verified_at)};t.push(s);break;case"twitter_oauth":let c={subject:o.subject,username:o.username,name:o.name,type:o.type,profilePictureUrl:o.profile_picture_url,verifiedAt:gt(o.verified_at)};t.push(c);break;case"discord_oauth":let m={subject:o.subject,username:o.username,email:o.email,type:o.type,verifiedAt:gt(o.verified_at)};t.push(m);break;case"github_oauth":let h={subject:o.subject,username:o.username,name:o.name,email:o.email,type:o.type,verifiedAt:gt(o.verified_at)};t.push(h);break;case"tiktok_oauth":let g={subject:o.subject,username:o.username,name:o.name,type:o.type,verifiedAt:gt(o.verified_at)};t.push(g);break;case"linkedin_oauth":let v={subject:o.subject,name:o.name,email:o.email,type:o.type,verifiedAt:gt(o.verified_at)};t.push(v);break;case"apple_oauth":let b={subject:o.subject,email:o.email,type:o.type,verifiedAt:gt(o.verified_at)};t.push(b);break;case"custom_auth":t.push({type:o.type,customUserId:o.custom_user_id,verifiedAt:gt(o.verified_at)});break;case"farcaster":let E={type:o.type,fid:o.fid,ownerAddress:o.owner_address,displayName:o.display_name,username:o.username,bio:o.bio,pfp:o.profile_picture_url,url:o.homepage_url,verifiedAt:gt(o.verified_at)};t.push(E);break;default:console.warn(`Unrecognized account type: ${r}. Please consider upgrading the Privy SDK.`)}}return t}function jt(e,t){return e.sort((o,r)=>r.verifiedAt.getTime()-o.verifiedAt.getTime()),e.find(o=>o.type===t)}var Ae=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy")||null,pv=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Kt=(e,t)=>t==="all-users"&&!Ae(e)||t==="users-without-wallets"&&!pv(e)?.length;function Lt(e){if(!e)return null;let t=dv(e.linked_accounts),o=jt(t,"wallet"),r=jt(t,"email"),n=jt(t,"phone"),i=jt(t,"google_oauth"),a=jt(t,"twitter_oauth"),l=jt(t,"discord_oauth"),s=jt(t,"github_oauth"),c=jt(t,"spotify_oauth"),m=jt(t,"tiktok_oauth"),h=jt(t,"linkedin_oauth"),g=jt(t,"apple_oauth"),v=jt(t,"farcaster"),b=e.mfa_methods.map(({type:x,verified_at:T})=>({type:x,verifiedAt:gt(T)}));return{id:e.id,createdAt:gt(e.created_at),linkedAccounts:t,email:r&&{address:r?.address},phone:n&&{number:n?.number},wallet:o&&{address:o.address,chainType:o.chainType,chainId:o.chainId,walletClient:o.walletClient,walletClientType:o.walletClientType,connectorType:o.connectorType,recoveryMethod:o.recoveryMethod},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:c&&{subject:c.subject,email:c.email,name:c.name},tiktok:m&&{subject:m.subject,username:m.username,name:m.name},linkedin:h&&{subject:h.subject,name:h.name,email:h.email},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},mfaMethods:b.map(x=>x.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var $l=require("@ethersproject/address"),su=f(require("eventemitter3"));function sp(){let e=window,t=e.ethereum;if(!t)return[];let o=[];if(t.providers?.length)for(let r of t.providers)r&&o.push(r);return o.push(e.ethereum),o}var Sa=e=>{if(e.isApexWallet)return"Apex Wallet";if(e.isAvalanche)return"Core Wallet";if(e.isBackpack)return"Backpack";if(e.isBifrost)return"Bifrost Wallet";if(e.isBitKeep)return"BitKeep";if(e.isBitski)return"Bitski";if(e.isBlockWallet)return"BlockWallet";if(e.isBraveWallet)return"Brave Wallet";if(e.isClover)return"Clover";if(e.isCoin98)return"Coin98 Wallet";if(e.isCoinbaseWallet)return"Coinbase Wallet";if(e.isDawn)return"Dawn Wallet";if(e.isDefiant)return"Defiant";if(e.isDesig)return"Desig Wallet";if(e.isEnkrypt)return"Enkrypt";if(e.isExodus)return"Exodus";if(e.isFordefi)return"Fordefi";if(e.isFrame)return"Frame";if(e.isFrontier)return"Frontier Wallet";if(e.isGamestop)return"GameStop Wallet";if(e.isHaqqWallet)return"HAQQ Wallet";if(e.isHyperPay)return"HyperPay Wallet";if(e.isImToken)return"ImToken";if(e.isHaloWallet)return"Halo Wallet";if(e.isKuCoinWallet)return"KuCoin Wallet";if(e.isMathWallet)return"MathWallet";if(e.isNovaWallet)return"Nova Wallet";if(e.isOkxWallet||e.isOKExWallet)return"OKX Wallet";if(e.isOneInchIOSWallet||e.isOneInchAndroidWallet)return"1inch Wallet";if(e.isOneKey)return"OneKey Wallet";if(e.isOpera)return"Opera";if(e.isPhantom)return"Phantom";if(e.isPortal)return"Ripio Portal";if(e.isRabby)return"Rabby Wallet";if(e.isRainbow)return"Rainbow";if(e.isSafePal)return"SafePal Wallet";if(e.isStatus)return"Status";if(e.isSubWallet)return"SubWallet";if(e.isTalisman)return"Talisman";if(e.isTally||e.isTaho)return"Taho";if(e.isTokenPocket)return"TokenPocket";if(e.isTokenary)return"Tokenary";if(e.isTrust||e.isTrustWallet)return"Trust Wallet";if(e.isTTWallet)return"TTWallet";if(e.isXDEFI)return"XDEFI Wallet";if(e.isZeal)return"Zeal";if(e.isZerion)return"Zerion";if(e.isMetaMask)return"MetaMask"};var Ll=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Sa(e)!=="MetaMask")return!1;if(e.providers){for(let o of e.providers)if(!Ll(o))return!1}return!0},Er=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),lp=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0}return!1};var cp=(e,t)=>{let o=[],r=[];for(let[n,i]of e.entries())n<t?o.push(i):r.push(i);return[o,r]},_a=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),dp=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},Tr=(e,t=3,o=4)=>{if(!e)return"";let r=2,n=3;if(t+o+r+n>=e.length)return e;let i=e.slice(0,r+t),a=e.slice(e.length-o,e.length);return`${i}...${a}`},Ol=e=>new Promise(t=>setTimeout(t,e));function pp(e,{interval:t=100,timeout:o=5e3}={}){return new Promise((r,n)=>{let i=0,a,l=()=>{if(i>=o){n("Max attempts reached without result");return}if(a=e(),i+=t,a!=null){r(a);return}setTimeout(l,t)};l()})}var up=(e,t={})=>{let o=t.delayMs||150,r=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<r;){if(t.abortSignal?.aborted)return;e().then(()=>{a=!0,n()},(...s)=>{a=!0,i(...s)}),l+=1,await Ol(o)}a||i(new Error("Exceeded max attempts before resolving function"))})},Aa=(e,t,o={})=>{let r=new URL(t,e);for(let[n,i]of Object.entries(o))r.searchParams.set(n,i);return r.href};var Dl=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Kr=e=>typeof e=="string"?e:"0x"+e.toString(16);async function mp(e,t,o=3e3){let r=!1,n=window;return new Promise(i=>{n.ethereum?a():(window.addEventListener("ethereum#initialized",a,{once:!0}),setTimeout(()=>{a()},o));function a(){if(r)return;r=!0,window.removeEventListener("ethereum#initialized",a);let l=e.getProviders(),s=[];for(let c of l)t.includes("coinbase_wallet")&&c.info.rdns==="com.coinbase.wallet"||s.push({type:c.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:c});for(let c of sp()){let m=Sa(c);if(!l.some(h=>h.info.name===m)){if(Ll(c,!0)&&!s.find(h=>h.type==="metamask")){s.push({type:"metamask",legacyInjectedProvider:c});continue}if(m==="Phantom"&&!s.find(h=>h.type==="phantom")){s.push({type:"phantom",legacyInjectedProvider:c});continue}s.find(h=>h.type==="unknown_browser_extension")||s.push({type:"unknown_browser_extension",legacyInjectedProvider:c})}}i(s)}})}function Tn(e){return`eip155:${String(Number(e))}`}var mo=(e,t,o)=>{let r=Number(e),n=t.find(a=>a.id===r);if(!n)throw new Z(`Unsupported chainId ${e}`,4901);let i;if(n.rpcUrls.privyWalletOverride&&n.rpcUrls.privyWalletOverride.http[0]?i=n.rpcUrls.privyWalletOverride.http[0]:o.rpcUrls&&o.rpcUrls[r]?i=o.rpcUrls[r]:n.rpcUrls.infura?.http[0]?i=n.rpcUrls.infura.http[0]+"/"+wa:n.rpcUrls.blast?.http[0]?i=n.rpcUrls.blast.http[0]+"/"+Kd:i=n.rpcUrls.default?.http[0],!i)throw new Z(`No RPC url found for ${e}`);return i},fp=(e,t)=>{let o=Number(e),r=t.find(n=>n.id===o);if(!r)throw new Z(`Unsupported chainId ${e}`,4901);return r.blockExplorers?.default.url},ka=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},o=Object.entries(e.domain).map(([r,n])=>{if(n!=null&&typeof r=="string"&&r in t)return{name:r,type:t[r]}}).filter(r=>r!==void 0);return{...e,types:{...e.types,EIP712Domain:o}}};var Tp=f(require("@coinbase/wallet-sdk"));var Ai=require("react/jsx-runtime"),ki=({style:e,...t})=>(0,Ai.jsxs)("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:[(0,Ai.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,Ai.jsx)("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"})]});var yo=require("@ethersproject/address"),Fl=require("@ethersproject/providers"),Ep=f(require("eventemitter3"));var Ul=require("@ethersproject/providers"),gp=f(require("eventemitter3"));var uv=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],hp=e=>uv.includes(e);var yp=require("@ethersproject/logger");var Pn=class extends Z{constructor(){super("Wallet timeout");this.type="wallet_error"}},xn=class extends Z{constructor(){super("User rejected connection");this.type="wallet_error"}},fo=e=>{if(e instanceof Z)return e;if(e?.code&&e?.reason){let t=new nt(e);return e.code===yp.ErrorCode.ACTION_REJECTED&&(t.details=St.E4001_USER_REJECTED_REQUEST),t}return e?.code?new nt(e):new Z("Unknown connector error",e)},Wo=class extends rt{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},nt=class extends Wo{constructor(o){let r=o;super(r.message,r.code,r.data);let n=Object.values(St).find(i=>i.eipCode===r.code);this.details=n||St.UNKNOWN_ERROR,r.code===-32002&&(r.message?.includes("already pending for origin")?r.message?.includes("wallet_requestPermissions")?this.details=St.E32002_CONNECTION_ALREADY_PENDING:this.details=St.E32002_REQUEST_ALREADY_PENDING:r.message?.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=St.E32002_WALLET_LOCKED))}},mv={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}},fv={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},hv={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},St={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...hv,...fv},or={...mv,...St};var Se=class{constructor(t,o){this.removeListener=(t,o)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,o)}catch{console.warn("Unable to remove wallet provider listener")}};this.walletTimeout=(t=new Pn,o=this.rpcTimeoutDuration)=>new Promise((r,n)=>setTimeout(()=>{n(t)},o));this.setWalletProvider=t=>{this.walletProvider&&this._subscriptions.forEach(o=>{this.removeListener(o.eventName,o.listener)}),this.walletProvider=t,this._subscriptions.forEach(o=>{this.walletProvider?.on(o.eventName,o.listener)})};this.walletProvider=t,this.rpcTimeoutDuration=o||$r,this._subscriptions=[]}on(t,o){if(this.walletProvider)return this.walletProvider.on(t,o);this._subscriptions.push({eventName:t,listener:o})}async request(t){if(!this.walletProvider)throw new Z(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),this.walletTimeout()]).catch(o=>{throw fo(o)})}},Pr=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},Ra=class extends gp.default{constructor(o,r,n,i,a=1){super();this.walletProxy=o,this.address=r,this.chainId=a,this.rpcConfig=n,this.chains=i,this.provider=new Ul.StaticJsonRpcProvider(mo(a,this.chains,n)),this.rpcTimeoutDuration=Sn(n,"privy")}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new Pr(`Invalid params for ${o.method}`,4200);let r=o.params[0];if(!await Ke()||!this.address)throw new Pr("Disconnected",4900);return(await Cp(r)).hash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new Pr(`Invalid params for ${o.method}`,4200);let r;if(typeof o.params[0]=="string")r=o.params[0];else if("chainId"in o.params[0]&&typeof o.params[0].chainId=="string")r=o.params[0].chainId;else throw new Pr(`Invalid params for ${o.method}`,4200);this.chainId=Number(r),this.provider=new Ul.StaticJsonRpcProvider(mo(this.chainId,this.chains,this.rpcConfig)),this.emit("chainChanged",r)}async handlePersonalSign(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for personal_sign");let r=o.params[0];return await vp(r)}async handleSignedTypedData(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_signTypedData_v4");let r=typeof o.params[1]=="string"?JSON.parse(o.params[1]):o.params[1];return await wp(ka(r))}async handleEstimateGas(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");delete o.params[0].gasPrice,delete o.params[0].maxFeePerGas,delete o.params[0].maxPriorityFeePerGas;let r={...o.params[0],chainId:Kr(this.chainId)};try{return await this.provider.send("eth_estimateGas",[r])}catch{return delete r.from,await this.provider.send("eth_estimateGas",[r])}}async request(o){switch(console.debug("Embedded1193Provider.request() called with args",o),o.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return Kr(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(o);case"eth_sendTransaction":return this.handleSendTransaction(o);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(o);case"personal_sign":return this.handlePersonalSign(o);case"eth_signTypedData_v4":return this.handleSignedTypedData(o);default:break}if(hp(o.method)){let r=await Ke();if(await bp(),!r||!this.address)throw new Pr("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:r,request:{method:o.method,params:o.params}})).response.data}catch(n){throw console.error(n),new Pr("Disconnected",4900)}}else return this.provider.send(o.method,o.params)}async connect(){let o=await Ke();if(!o||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:o})).address}catch(r){return console.error(r),null}}},ho=class extends Se{constructor(o){super(o,o.rpcTimeoutDuration)}},xr=class extends Se{constructor(t){super(t,t.rpcTimeoutDuration)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var yv=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},vt=class extends Ep.default{constructor(o,r,n,i){super();this.onAccountsChanged=o=>{o.length===0?this.onDisconnect():this.syncAccounts(o)};this.onChainChanged=o=>{this.wallets.forEach(r=>{r.chainId=Tn(o),this.walletClientType==="privy"&&ce.put(Pa(r.address),o)}),this.emit("walletsUpdated")};this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")};this.onConnect=()=>{this.connected=!0,this.syncAccounts()};this.wallets=[],this.walletClientType=o,this.chains=r,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=Sn(i,o),this.connected=!1,this.initialized=!1}buildConnectedWallet(o,r,n){let i=async()=>!!this.wallets.find(a=>(0,yo.getAddress)(a.address)===(0,yo.getAddress)(o));return{address:(0,yo.getAddress)(o),chainId:r,meta:n,switchChain:async a=>{if(!i)throw new Z("Wallet is not currently connected.");let l=this.wallets.find(g=>(0,yo.getAddress)(g.address)===(0,yo.getAddress)(o))?.chainId;if(!l)throw new Z("Unable to determine current chainId.");let s,c;if(typeof a=="number"?(s=`0x${a.toString(16)}`,c=a):(s=a,c=Number(a)),l===Tn(s))return;let m=this.chains.find(g=>g.id===c);if(!m)throw new Z(`Unsupported chainId: ${a}`);let h=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})};try{return await h()}catch(g){if(yv(g,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:s,chainName:m.name,nativeCurrency:m.nativeCurrency,rpcUrls:[m.rpcUrls.default?.http[0]??""],blockExplorerUrls:[m.blockExplorers?.default.url??""]}]}),h();throw this.walletClientType==="rainbow"&&g.message?.includes("wallet_switchEthereumChain")?new Z(`Rainbow does not support the chainId ${r}`):g}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new Z("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await i())throw new Z("Wallet is not currently connected.");return new Fl.Web3Provider(new ho(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new Z("Wallet is not currently connected.");return new xr(this.proxyProvider)},sign:async a=>{if(!await i())throw new Z("Wallet is not currently connected.");return await this.sign(a)},disconnect:()=>{this.disconnect()}}}async syncAccounts(o){let r=o;try{if(r===void 0){let c=await this.proxyProvider.request({method:"eth_accounts"});Array.isArray(c)&&(r=c)}}catch{console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.")}if(!r||!Array.isArray(r)||r.length<=0||!r[0])return;let n=r[0],i=(0,yo.getAddress)(n),a=[],l;if(this.walletClientType==="privy"){let c=ce.get(Pa(i));this.chains.find(m=>m.id===Number(c))||(ce.del(Pa(i)),c=null),l=c||`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 c=await this.proxyProvider.request({method:"eth_chainId"});if(typeof c=="string")l=c;else if(typeof c=="number")l=`0x${c.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(c){console.warn(`Failed to get chainId from provider, defaulting to ${Il}`,c),l=Il}let s=Tn(l);if(!a.find(c=>(0,yo.getAddress)(c.address)===i)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet((0,yo.getAddress)(n),s,c))}Ia(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let o=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((r,n)=>n.connectedAt-r.connectedAt).find(r=>o.find(n=>(0,yo.getAddress)(n)===(0,yo.getAddress)(r.address)))||null}async isConnected(){let o=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(o)&&o.length>0}async sign(o){return await this.connect({showPrompt:!1}),new Fl.Web3Provider(new ho(this.proxyProvider)).getSigner().signMessage(o)}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 gv=e=>{let t=`https://mainnet.infura.io/v3/${wa}`,o=1;return e.makeWeb3Provider(t,o)},Ma,Wa=class extends vt{constructor(o,r,n){super("coinbase_wallet",o,r,n);this.connectorType="coinbase_wallet";this.proxyProvider=new Se(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),Ma||(Ma=new Tp.default({appName:"Privy",darkMode:!1,headlessMode:!1,enableMobileWalletLink:!0})),this.proxyProvider.setWalletProvider(gv(Ma)),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}async connect(o){return o.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){Ma.disconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:ki,id:"com.coinbase.wallet"}}async promptConnection(){try{let o=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!o||o.length===0||!o[0])throw new Z("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([o[0]])}catch(o){throw fo(o)}}};var Bl=require("react/jsx-runtime"),Na=({...e})=>(0,Bl.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,Bl.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var La=class extends vt{constructor(o,r,n,i){super("privy",r,n,i);this.connectorType="embedded";this.proxyProvider=o,this.subscribeListeners(),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}async connect(o){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[Kr(o?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Na,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var Hl=require("react/jsx-runtime"),_n=({style:e,...t})=>(0,Hl.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,Hl.jsx)("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"})});var it=require("react/jsx-runtime"),An=({style:e,...t})=>(0,it.jsxs)("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:[(0,it.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,it.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"})]});var Ri=require("react/jsx-runtime"),No=({style:e,...t})=>(0,Ri.jsxs)("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:[(0,Ri.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,Ri.jsx)("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 Rn=class extends vt{constructor(o,r,n,i,a){super(a||"unknown",o,r,n);this.connectorType="injected";this.proxyProvider=new Se(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}async connect(o){return o.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 o=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!o||o.length===0||!o[0])throw new Z("Unable to retrieve accounts");await this.syncAccounts([o[0]])}catch(o){throw fo(o)}}},kn,In=class extends vt{constructor(o,r,n,i,a){super(a??"unknown",o,r,n);this.connectorType="injected";ua(this,kn,void 0);this.proxyProvider=new Se(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0}),a==="metamask"?Sl(this,kn,{name:"MetaMask",icon:An,id:"io.metamask"}):a==="phantom"&&Sl(this,kn,{name:"Phantom",icon:No,id:"phantom"})}async connect(o){return o.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return fd(this,kn)??{name:"Browser Extension",icon:_n,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let o=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!o||o.length===0||!o[0])throw new Z("Unable to retrieve accounts");await this.syncAccounts([o[0]])}catch(o){throw fo(o)}}};kn=new WeakMap;var vv=require("@ethersproject/address"),wv=require("@ethersproject/providers"),Pp=require("react-device-detect");var Oa=class extends Rn{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{Pp.isMobile||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 Z("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw fo(t)}}};var Da=class extends vt{constructor(o,r){super(o,[],r,{});this.connectorType="null";this.proxyProvider=new Se(void 0,$r);this.connectorType=o}get walletBranding(){return{name:"Wallet",id:""}}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(o){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${o}`)}};var Ua=class extends Da{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:No,id:"phantom"}}};var Nn=require("@walletconnect/ethereum-provider"),au=require("react-device-detect");var Jt=require("react");var xp=require("react/jsx-runtime");function Fa({src:e,...t}){return(0,xp.jsx)("img",{src:e,...t,style:{display:"none"}})}var Lo=require("react"),Vp=require("react");var Yt={appearance:{theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:Yd,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},captchaEnabled:!1,_render:{inDialog:!0,inParentNodeId:null},fiatOnRamp:{useSandbox:!1}};var Sp=({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],o=[];e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `input.primary.length`");for(let r of e.primary)t.includes(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let r of e.overflow??[])!t.includes(r)&&!o.includes(r)?o.push(r):console.warn(`Duplicated login method: ${r}`);return{primary:t,overflow:o}};var Cv=new Set(["metamask","coinbase_wallet","rainbow","zerion","phantom","wallet_connect","detected_wallets"]),bv=e=>Cv.has(e),Ev=(e,t,o)=>o.indexOf(e)===t,_p=({input:e})=>e?e.filter(bv).filter(Ev):Yt.appearance.walletList;var Ba={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}};var Ha={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]},default:{http:["https://goerli-rollup.arbitrum.io/rpc"]},public:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"},default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var Ga={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0};var Ap={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}};var kp={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0};var Va={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}},testnet:!0};var za={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{blast:{http:["https://base-goerli.blastapi.io"],webSocket:["wss://base-goerli.blastapi.io"]},default:{http:["https://goerli.base.org"]},public:{http:["https://goerli.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://goerli.basescan.org"},default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var $a={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0};var Rp={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1};var Ip={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0};var Mp={id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}};var Wp={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}};var Np={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var Lp={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}};var Op={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-mainnet.infura.io/v3"],webSocket:["wss://linea-mainnet.infura.io/ws/v3"]},default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1};var Dp={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0};var qa={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}};var ja={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}};var Ka={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"],webSocket:["wss://opt-goerli.g.alchemy.com/v2"]},infura:{http:["https://optimism-goerli.infura.io/v3"],webSocket:["wss://optimism-goerli.infura.io/ws/v3"]},default:{http:["https://goerli.optimism.io"]},public:{http:["https://goerli.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var Ya={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0};var Ii={id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}};var Mi={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mumbai.g.alchemy.com/v2"],webSocket:["wss://polygon-mumbai.g.alchemy.com/v2"]},infura:{http:["https://polygon-mumbai.infura.io/v3"],webSocket:["wss://polygon-mumbai.infura.io/ws/v3"]},default:{http:["https://matic-mumbai.chainstacklabs.com"]},public:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"},default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var Up={id:17001,name:"Redstone Holesky",network:"redstone-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.holesky.redstone.xyz"]},public:{http:["https://rpc.holesky.redstone.xyz"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"},default:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"}}};var Fp={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0};var Ja={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}};var Qa={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0};var Za={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0};var Mn=[Ba,Ha,Ga,Np,Fp,qa,ja,Ka,Ya,Ii,Mi,Rp,Ip,Mp,Wp,Va,za,$a,Op,Dp,Ap,kp,Ja,Za,Qa,Lp,Up],C2=new Set(Mn.map(e=>e.id));var _r=f(require("tinycolor2")),Bp="#FFFFFF",Tv="#000000",Pv=Bp,xv="#1E1E1D";function Sv(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}function Sr(e,t){let o=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,_r.default)({...e.toHsl(),l:o})}function Hp({backgroundTheme:e,accentHex:t,successHex:o="#51BA81",warnHex:r="#FFB74D",errorHex:n="#EC6351",whiteHex:i=Bp,blackHex:a=Tv}){let l;switch(e){case"light":l=Pv;break;case"dark":l=xv;break;default:l=e;break}let s=(0,_r.default)(l),c=(0,_r.default)(t),m=(0,_r.default)(o),h=(0,_r.default)(r),g=(0,_r.default)(n),v=Sv(s.getLuminance()),b=Sr(s,v==="light"?-.04:.11),E=Sr(s,v==="light"?-.88:.87),x=Sr(s,v==="light"?-.77:.75),T=Sr(s,v==="light"?-.43:.45).desaturate(v==="light"?60:20),A=Sr(s,v==="light"?-.08:.25).desaturate(v==="light"?60:20),R=Sr(c,.15),I=Sr(c,-.06),k=(0,_r.default)(c.getLuminance()>.5?a:i),D=Sr(m,-.16);return{colorScheme:v,background:s.toHslString(),background2:b.toHslString(),foreground:E.toHslString(),foreground2:x.toHslString(),foreground3:T.toHslString(),foreground4:A.toHslString(),accent:c.toHslString(),accentLight:R.toHslString(),accentDark:I.toHslString(),foregroundAccent:k.toHslString(),success:m.toHslString(),successDark:D.toHslString(),error:g.toHslString(),warn:h.toHslString()}}function Gl(e,t){let o=["google","twitter","discord","spotify","tiktok","linkedin","github","apple","farcaster"],r=t?.loginMethods?.filter(pe=>o.includes(pe)),n,i,a,l,s,c,m,h,g,v,b,E;t?.loginMethods?(n=t.loginMethods.includes("email"),i=t.loginMethods.includes("sms"),a=t.loginMethods.includes("wallet"),l=r?.includes("google"),s=r?.includes("twitter"),c=r?.includes("discord"),h=r?.includes("spotify"),m=r?.includes("tiktok"),v=r?.includes("github"),g=r?.includes("linkedin"),b=r?.includes("apple"),E=r?.includes("farcaster")):(n=e.emailAuth,i=e.smsAuth,a=e.walletAuth,l=e.googleOAuth,s=e.twitterOAuth,c=e.discordOAuth,v=e.githubOAuth,h=e.spotifyOAuth,m=e.tiktokOAuth,g=e.linkedinOAuth,b=e.appleOAuth,E=e.farcasterAuth);let x=[n,i].filter(Boolean),T=[l,s,c,v,h,m,g,b,E].filter(Boolean),A=[a].filter(Boolean);if(x.length+T.length+A.length===0)throw new Error("You must enable at least one login method");let R=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;R&&A.length===0?(console.warn("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),R=!1):!R&&T.length+x.length===0&&(console.warn("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),R=!0);let I=_p({isWalletLoginEnabled:a,input:t?.appearance?.walletList});t?.loginMethods&&t.loginMethodsAndOrder&&console.warn("You should only configure one of `loginMethods` or `appearance.loginMethods`"),t?.appearance?.walletList&&t.loginMethodsAndOrder&&console.warn("You should only configure one of `appearance.walletList` or `appearance.loginMethods`");let k=Sp({input:t?.loginMethodsAndOrder}),D=t?.intl?.defaultCountry??"US",{chains:U,defaultChain:B}=_v({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),G=!!t?.defaultChain||!!t?.supportedChains,j=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,O,K=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?j?O=t?.embeddedWallets?.noPromptOnSignature??!0:O=t?.embeddedWallets?.noPromptOnSignature??K:O=K,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&O!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,palette:Hp({backgroundTheme:t?.appearance?.theme??Yt.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Yt.appearance.accentColor}),loginGroupPriority:R?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:I},loginMethods:{wallet:a,email:n,sms:i,google:l,twitter:s,discord:c,github:v,spotify:h,tiktok:m,linkedin:g,apple:b,farcaster:E},loginMethodsAndOrder:k,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Yt.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Yt.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Yt.rpcConfig.rpcTimeouts},chains:U,defaultChain:B,intl:{defaultCountry:D},shouldEnforceDefaultChainOnConnect:G,captchaEnabled:e.captchaEnabled??Yt.captchaEnabled,captchaSiteKey:e.captchaSiteKey,embeddedWallets:{...e.embeddedWalletConfig,...j?{createOnLogin:"all-users",requireUserPasswordOnCreate:!1}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...t?.embeddedWallets,noPromptOnSignature:O},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:j?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??Yt.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1},render:{inDialog:t?._render?.inDialog??Yt._render.inDialog,inParentNodeId:t?._render?.inParentNodeId??Yt._render.inParentNodeId}}}function Gp(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:o,additionalChains:r,supportedChains:n,defaultChain:i,...a}=e;return{...a,...r?{additionalChains:r.map(s=>s.id)}:void 0,...n?{supportedChains:n.map(s=>s.id)}:void 0,...i?{defaultChain:i.id}:void 0,...o?{...o,...o.logo&&typeof o.logo?{logo:"component"}:void 0}:void 0,legacyCreateEmbeddedWalletFlag:t}}function _v({additionalChains:e,supportedChains:t,defaultChainFromConfig:o,hasRpcConfigDefined:r}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(t.length===0)throw new Error("`supportedChains` must contain at least one chain");t.filter(s=>s.rpcUrls.privyWalletOverride).length>0&&r&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map(s=>s.rpcUrls.privyWalletOverride?s:Mn.find(m=>m.id===s.id)??s)}else n=Mn.concat(e??[]);let i=t?n[0]:qa,a=o??i;if(!n.find(l=>l.id===a.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:a}}var jp=require("react/jsx-runtime"),zp={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserPasswordOnCreate:!1},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},Vl=Gl(zp),zl=(0,Vp.createContext)({appConfig:Vl,isServerConfigLoaded:!1}),$p=({children:e,legacyCreateEmbeddedWalletFlag:t,client:o,clientConfig:r})=>{let[n,i]=(0,Lo.useState)(null),a=(0,Lo.useMemo)(()=>Gl(n??zp,r),[n,r]);return(0,Lo.useEffect)(()=>{let l=Gp(r,t);o.createAnalyticsEvent("sdk_initialize",l)},[r,t]),(0,Lo.useEffect)(()=>{n||(async()=>{try{let s=await o.getServerConfig();s.customApiUrl&&o.updateApiUrl(s.customApiUrl),i(s)}catch(s){console.warn("Error generating app config: ",s)}})()},[]),(0,jp.jsx)(zl.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},Xa=()=>{let{appConfig:e}=(0,Lo.useContext)(zl);return e},qp=()=>{let{isServerConfigLoaded:e}=(0,Lo.useContext)(zl);return e};var P=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var es=require("react/jsx-runtime"),Kp=(0,Jt.createContext)({ready:!1,app:Vl,currentScreen:null,lastScreen:null,navigate:P,navigateBack:P,resetNavigation:P,setModalData:P,onUserCloseViaDialogOrKeybindRef:void 0}),Av=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Yp=e=>{let t=Xa(),o=e.authenticated,[r,n]=(0,Jt.useState)(e.initialScreen);(0,Jt.useEffect)(()=>{!o&&!Av.includes(e.initialScreen)&&e.setInitialScreen(null)},[o]);let i=(0,Jt.useRef)(null);(0,Jt.useEffect)(()=>{e.open||(i.current=null)},[e.open]),(0,Jt.useEffect)(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:r,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(r)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return(0,es.jsxs)(Kp.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,es.jsx)(Fa,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},S=()=>(0,Jt.useContext)(Kp);var rr=require("react/jsx-runtime"),Wi=({style:e,...t})=>{let{app:o}=S();return(0,rr.jsxs)("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:[(0,rr.jsx)("rect",{width:"28",height:"28",rx:"3",fill:o?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,rr.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,rr.jsx)("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"})}),(0,rr.jsx)("defs",{children:(0,rr.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,rr.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var ts=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[o,r]of Object.entries(Wn))if(t.includes(r.hostname))return{walletClientType:o,entry:r}};var Wn={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"}},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"}},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"}}};function kv(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}var Jp=e=>e in Wn,Qp=e=>{let t=Wn[e].mobile;if("native"in t)return t.native};function Zp(e,t){let o=kv(t);if(o.deepLink)return ru(o.deepLink,e);if(o.universalLink)return nu(o.universalLink,e);throw new w(`Unsupported wallet ${t.id}`)}var Xp="WALLETCONNECT_DEEPLINK_CHOICE";function eu(){try{localStorage.removeItem(Xp)}catch{}}function tu({href:e,name:t}){try{localStorage.setItem(Xp,JSON.stringify({href:e,name:t}))}catch{}}function ou(e){return e.startsWith("http://")||e.startsWith("https://")}function ru(e,t){if(ou(e))return nu(e,t);let o=e;o.includes("://")||(o=e.replaceAll("/","").replaceAll(":",""),o=`${o}://`),o.endsWith("/")||(o=`${o}/`);let r=encodeURIComponent(t);return{redirect:`${o}wc?uri=${r}`,href:o}}function nu(e,t){if(!ou(e))return ru(e,t);let o=e;o.endsWith("/")||(o=`${o}/`);let r=encodeURIComponent(t);return{redirect:`${o}wc?uri=${r}`,href:o}}function iu(e,t){window.open(e,t,"noreferrer noopener")}var Oo=class extends vt{constructor(o,r,n,i,a,l){super(l||"unknown",n,i,r);this.connectorType="wallet_connect_v2";this.walletConnectCloudProjectId=o,this.rpcConfig=r,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new Se(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=Wn[l],this.walletClientType=l),this.createProvider().then(s=>{if(this.provider=s,this.proxyProvider.setWalletProvider(s),this.subscribeListeners(),s.session){if(this.walletProvider?.session?.peer.metadata.url){let c=ts(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=c?.entry,this.walletClientType=c?.walletClientType||"unknown"}this.connected=!0,this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}else this.emit("initialized"),this.initialized=!0}),import("@walletconnect/modal").then(({WalletConnectModal:s})=>{this.modal=new s({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(c=>{!c.open&&!this.walletProvider?.session&&this.onQrModalClosed&&this.onQrModalClosed()})})}async connect(o){return o.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return this.walletClientType==="metamask"?{name:"MetaMask",icon:An,id:"io.metamask"}:{name:Dl(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Wi,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(o){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=Wn[o],this.walletClientType=o,this.redirectUri=void 0,eu(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((o,r)=>{let n=()=>{r(new xn)};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 Z("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=ts(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Sn(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),o()})().catch(a=>{if(a){r(fo(a));return}r(new Z("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(o){this.proxyProvider.setWalletProvider(o)}async createProvider(){let o={};for(let a of this.chains){let l=mo(a.id,this.chains,this.rpcConfig);l&&(o[a.id]=l)}let r=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(a=>a.id),i=await Nn.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:r,optionalChains:n,optionalEvents:Nn.OPTIONAL_EVENTS,optionalMethods:Nn.OPTIONAL_METHODS,rpcMap:o,showQrModal:!1});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),au.isMobile&&this.walletEntry){let{redirect:l,href:s}=Zp(a,this.walletEntry);tu({href:s,name:this.walletEntry.displayName}),this.redirectUri=l,iu(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=ts(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 ql=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses");return t?!!e?.linkedAccounts.filter(r=>r.type=="wallet"&&r.address===(0,$l.getAddress)(t)).length:!1},Sn=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||$r:$r,Ln=class extends su.default{constructor(o,r,n,i,a,l,s){super();this.getEthereumProvider=()=>{let o=this.wallets[0],r=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===o?.address));return!o||!r?new Se:r.proxyProvider};this.walletConnectCloudProjectId=o,this.rpcConfig=r,this.chains=n,this.defaultChain=i,this.walletConnectors=[],this.initialized=!1,this.store=a,this.walletList=l,this.shouldEnforceDefaultChainOnConnect=s,this.initializedWalletConnectors=0,this.walletsReady=!1,this.storedConnections=this.loadConnectionHistory()}get wallets(){let o=new Set,r=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 o.has(a)?!1:(o.add(a),!0)}),n=r.findIndex(i=>i.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&r.unshift(r.splice(n,1)[0]),r}async initialize(){if(this.initialized)return;ce.get(kl)&&(ce.getKeys().forEach(r=>{r.startsWith("walletconnect")&&ce.del(r)}),ce.del(kl));let o=mp(this.store,this.walletList).then(r=>{r.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"),!Er()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),this.createWalletConnector("wallet_connect_v2","unknown"),await o,this.initialized=!0}findWalletConnector(o,r){return o==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===o)||null:this.walletConnectors.find(n=>n.connectorType===o&&n.walletClientType===r)||null}onInitialized(o){o.wallets.forEach(r=>{let n=this.storedConnections.find(i=>i.address===r.address&&i.connectorType===r.connectorType&&i.walletClientType===r.walletClientType);n&&(r.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.initializedWalletConnectors++,this.walletsReady=this.initializedWalletConnectors===this.walletConnectors.length}onWalletsUpdated(o){o.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(o,r,n){let i=this.findWalletConnector("embedded","privy");if(i)i.proxyProvider.walletProxy=o;else{let a=new Ra(o,r,this.rpcConfig,this.chains,n.id),l=new La(a,this.chains,n,this.rpcConfig);this.addWalletConnector(l)}}removeEmbeddedWalletConnector(){let o=this.findWalletConnector("embedded","privy");if(o){let r=this.walletConnectors.indexOf(o);this.walletConnectors.splice(r,1),this.saveConnectionHistory(),this.storedConnections=this.loadConnectionHistory(),this.emit("walletsUpdated")}}async createWalletConnector(o,r,n){let i=this.findWalletConnector(o,r);if(i)return i instanceof Oo&&i.resetConnection(r),i;let l=(()=>{if(o==="injected"){if(r==="metamask"&&n?.eip6963InjectedProvider)return new Oa(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(r==="metamask"&&n?.legacyInjectedProvider)return new In(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(r==="phantom"&&n?.legacyInjectedProvider)return new In(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&r==="unknown_browser_extension")return new In(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Rn(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,r)}else return o==="coinbase_wallet"?new Wa(this.chains,this.defaultChain,this.rpcConfig):o==="phantom"?new Ua(this.defaultChain):new Oo(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,r)})();return l&&this.addWalletConnector(l),l||null}addWalletConnector(o){this.walletConnectors.push(o),o.on("initialized",()=>this.onInitialized(o)),o.on("walletsUpdated",()=>this.onWalletsUpdated(o))}loadConnectionHistory(){let o=a=>a&&typeof a.address=="string"&&typeof a.connectorType=="string"&&typeof a.walletClientType=="string"&&typeof a.connectedAt=="number",r=ce.get(Rl);return r&&Array.isArray(r)&&r.map(a=>o(a)).every(Boolean)?r:[]}saveConnectionHistory(){let o=this.wallets.map(r=>({address:r.address,connectorType:r.connectorType,walletClientType:r.walletClientType,connectedAt:r.connectedAt}));ce.put(Rl,o)}async activeWalletSign(o){let r=this.wallets,n=r.length>0?r[0]:null;return n?n.sign(o):null}setActiveWallet(o){this.activeWallet=(0,$l.getAddress)(o),this.emit("walletsUpdated")}};function Ia(e,t){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++){let r=e[o],n=t[o];if(r?.address!==n?.address||r?.chainId!==n?.chainId||r?.connectorType!==n?.connectorType||r?.connectedAt!==n?.connectedAt||r?.walletClientType!==n?.walletClientType||r?.isConnected!==n?.isConnected||r?.linked!==n?.linked)return!1}return!0}var lu=require("ofetch");var Rv=[ha(),ga(),ya()],os=class{constructor(t,o,r){this.appId=t,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=ba,this.client=o,this.defaults=r,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=lu.ofetch.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:n,options:i})=>{let a=new Headers(i.headers);a.set("privy-app-id",this.appId),a.set("privy-ca-id",this.clientAnalyticsId||""),a.set("privy-client",`react-auth:${this.sdkVersion}`);let l=!Rv.includes(n.toString());if(!a.has("authorization")&&l){let s=await this.client.getAccessToken();s!==null&&a.set("authorization",`Bearer ${s}`)}i.headers=a},onRequestError:({error:n})=>{if(n instanceof DOMException&&n.name==="AbortError")throw new ma}})}async get(t,o){try{return await this.baseFetch(t,o)}catch(r){throw ue(r)}}async post(t,o,r){try{return await this.baseFetch(t,{method:"POST",...o?{body:o}:{},...r})}catch(n){throw ue(n)}}async delete(t,o){try{return await this.baseFetch(t,{method:"DELETE",...o})}catch(r){throw ue(r)}}};var Ar=f(require("js-cookie"));function cu(e){return e instanceof Cr?"email":e instanceof jr?"sms":e instanceof qr?"siwe":e instanceof wn?"custom_auth":e instanceof br?e.meta.provider:null}var du=f(require("jose")),Do=class{static parse(t){try{return new Do(t)}catch{return null}}constructor(t){this.value=t,this._decoded=du.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 o=Date.now(),r=(this.expiration-t)*1e3;return o>=r}};var Iv=30,rs=class{constructor(){this.authenticateOnce=new ht(async t=>this._authenticate(t)),this.linkOnce=new ht(async t=>this._link(t)),this.refreshOnce=new ht(this._refresh.bind(this)),this.destroyOnce=new ht(this._destroy.bind(this)),this.forkSessionOnce=new ht(this._forkSession.bind(this))}get token(){try{let t=ce.get(zr);return typeof t=="string"?new Do(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=ce.get(Ea);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=ce.get(Si);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get mightHaveServerCookies(){try{let t=Ar.default.get(Ta);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"}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Do.parse(this.token);return t!==null&&!t.isExpired(Iv)}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()}async _authenticate(t){try{let{token:o,refresh_token:r,user:n,is_new_user:i}=await t.authenticate();this.storeToken(o),this.storeRefreshToken(r);let a=cu(t);return a&&this.client&&this.client.createAnalyticsEvent("sdk_authenticate",{method:a,isNewUser:i}),a==="siwe"&&this.client&&this.client.createAnalyticsEvent("sdk_authenticate_siwe",{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}),{user:Lt(n),isNewUser:i}}catch(o){throw console.warn("Error authenticating session"),ft(o)}}async _link(t){try{let o=await t.link();return Lt(o)}catch(o){throw console.warn("Error linking account"),ft(o)}}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,o=this.refreshToken,r=this.forkedToken;try{let n;if(t&&o||this.mightHaveServerCookies){let i={};t&&(i.authorization=`Bearer ${t}`);let a=o?{refresh_token:o}:{};n=await this.api.post(ha(),a,{headers:i}),r&&this.clearForkedToken()}else if(r)n=await this.api.post(ga(),{refresh_token:r}),this.clearForkedToken();else return null;return n.session_update_action==="set"&&(this.storeToken(n.token),this.storeRefreshToken(n.refresh_token)),n.session_update_action==="clear"&&this.destroyLocalState(),Lt(n.user)}catch(n){if(n instanceof Io&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw ft(n)}}async _destroy(){try{await this.api?.post(ya(),{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 o=await this.api.post(gd(),{refresh_token:t});return this.storeToken(o.token),this.storeRefreshToken(o.refresh_token),o.new_session_refresh_token}catch(o){throw ft(o)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null),this.clearForkedToken(),this.client?.onDeleteToken?.()}storeToken(t){if(typeof t=="string"){let o=ce.get(zr);if(ce.put(zr,t),o!==t&&this.client?.onStoreToken?.(t),!this.client?.useServerCookies){let r=Do.parse(t)?.expiration;Ar.default.set(_l,t,{sameSite:"Strict",secure:!0,expires:r?new Date(r*1e3):void 0})}}else ce.del(zr),Ar.default.remove(_l)}storeRefreshToken(t){typeof t=="string"?(ce.put(Ea,t),this.client?.useServerCookies||(Ar.default.set(Ta,"t",{sameSite:"Strict",secure:!0,expires:30}),Ar.default.set(Al,t,{sameSite:"Strict",secure:!0,expires:30}))):(ce.del(Ea),Ar.default.remove(Al),Ar.default.remove(Ta))}clearForkedToken(){ce.del(Si)}};var jl,ns,uu,On=class{constructor(t){ua(this,ns);this.apiUrl=t.apiUrl||Ca,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||Jd,this.appId=t.appId,this.clientAnalyticsId=hd(this,ns,uu).call(this),jl||(jl=new rs),this.session=jl,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager(t,o,r,n,i,a,l){this.connectors||(this.connectors=new Ln(t,o,r,n,i,a,l))}generateApi(){let t=new os(this.appId,this,{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)}link(){if(!this.authFlow)throw new w("No auth flow in progress.");return this.session.link(this.authFlow)}async logout(){await this.session.destroy(),this.authFlow=void 0}startAuthFlow(t){t.api=this.api,this.authFlow=t}startMfaFlow(t){t.api=this.api,this.mfaFlow=t}async unlinkEmail(t){try{let o=await this.api.post(Od(),{address:t});return Lt(o)}catch(o){throw ft(o)}}async acceptTerms(){try{let t=await this.api.post($d(),{});return Lt(t)}catch(t){throw ft(t)}}async unlinkPhone(t){try{let o=await this.api.post(Dd(),{phoneNumber:t});return Lt(o)}catch(o){throw ft(o)}}async unlinkWallet(t){try{let o=await this.api.post(Ld(),{address:t});return Lt(o)}catch(o){throw ft(o)}}async unlinkOAuth(t,o){try{let r=await this.api.post(Ud(),{provider:t,subject:o});return Lt(r)}catch(r){throw ft(r)}}async unlinkFarcaster(t){try{let o=await this.api.post(Fd(),{fid:t});return Lt(o)}catch(o){throw ft(o)}}async createAnalyticsEvent(t,o,r){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(Bd(),{event_name:t,client_id:this.clientAnalyticsId,payload:{...o||{},clientTimestamp:r?r.toISOString():new Date().toISOString()}})}catch{}}async signMoonpayOnRampUrl(t){try{return this.api.post(Hd(),t)}catch(o){throw ft(o)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?Do.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:!t?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let t=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl});return{id:t.id,name:t.name,verificationKey:t.verification_key,logoUrl:t.logo_url||void 0,accentColor:t.accent_color||void 0,showWalletLoginFirst:t.show_wallet_login_first,allowlistConfig:{errorTitle:t.allowlist_config.error_title,errorDetail:t.allowlist_config.error_detail,errorCtaText:t.allowlist_config.cta_text,errorCtaLink:t.allowlist_config.cta_link},walletAuth:t.wallet_auth,emailAuth:t.email_auth,smsAuth:t.sms_auth,googleOAuth:t.google_oauth,twitterOAuth:t.twitter_oauth,discordOAuth:t.discord_oauth,githubOAuth:t.github_oauth,spotifyOAuth:t.spotify_oauth,tiktokOAuth:t.tiktok_oauth,linkedinOAuth:t.linkedin_oauth,appleOAuth:t.apple_oauth,farcasterAuth:t.farcaster_auth,termsAndConditionsUrl:t.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:t.embedded_wallet_config?.create_on_login,requireUserPasswordOnCreate:t.embedded_wallet_config?.require_user_password_on_create},privacyPolicyUrl:t.privacy_policy_url,requireUsersAcceptTerms:t.require_users_accept_terms,customApiUrl:t.custom_api_url,walletConnectCloudProjectId:t.wallet_connect_cloud_project_id,fiatOnRampEnabled:t.fiat_on_ramp_enabled,captchaEnabled:t.captcha_enabled,captchaSiteKey:t.captcha_site_key,twitterOAuthOnMobileEnabled:t.twitter_oauth_on_mobile_enabled,createdAt:new Date(t.created_at*1e3),updatedAt:new Date(t.updated_at*1e3),mfaMethods:t.mfa_methods,enforceWalletUis:t.enforce_wallet_uis,legacyWalletUiConfig:t.legacy_wallet_ui_config}}catch(t){throw ft(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 forkSession(){return await this.session.forkSession()}};ns=new WeakSet,uu=function(){if(typeof window>"u")return null;try{let o=ce.get(_i);if(typeof o=="string"&&o.length>0)return o}catch{}let t=(0,pu.v4)();try{return ce.put(_i,t),t}catch{return t}};var yu=require("@marsidev/react-turnstile"),is=require("react");var Qt=require("react");var hu=require("react/jsx-runtime"),mu=(0,Qt.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:P,setError:P,setExecuting:P,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:P,reset:P,execute:P}),nr=class extends rt{constructor(o,r,n){super(o||"Captcha failed");this.type="Captcha";r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},fu=({children:e,id:t,captchaSiteKey:o,captchaEnabled:r})=>{let n=(0,Qt.useRef)(null),[i,a]=(0,Qt.useState)(),[l,s]=(0,Qt.useState)(),[c,m]=(0,Qt.useState)(!1),h=(0,Qt.useMemo)(()=>r?!c&&!i&&!l?{status:"ready"}:c&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[r,i,l,c]);return(0,hu.jsx)(mu.Provider,{value:{...h,ref:n,enabled:r,siteKey:o,appId:t,setToken:a,setError:s,setExecuting:m,remove(){r&&(n.current?.remove(),m(!1),s(void 0),a(void 0))},reset(){r&&(n.current?.reset(),m(!1),s(void 0),a(void 0))},execute(){r&&(m(!0),n.current?.execute())},async waitForResult(){if(!r)return"";try{return await pp(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new nr("Captcha failed",null,"captcha_timeout")}}},children:e})},_e=()=>(0,Qt.useContext)(mu);var Kl=require("react/jsx-runtime"),as=e=>{let{enabled:t,siteKey:o,appId:r,setError:n,setToken:i,setExecuting:a,ref:l}=_e(),[,s]=(0,is.useMemo)(()=>o?.split("t:")||[],[o]);if((0,is.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return(0,Kl.jsx)("div",{className:"hidden h-0 w-0",children:(0,Kl.jsx)(yu.Turnstile,{...e,ref:l,siteKey:s,options:{action:r,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:c=>{e.onSuccess?.(c),i(c),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};var gr=require("react"),hg=f(require("react-dom"));var ss=require("react");var Yl=(0,ss.createContext)({isNewUserThisSession:!1,isLinking:!1,linkingHint:null,walletConnectionStatus:null,mipdStore:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,nativeTokenSymbolForChainId:P,initializeWalletProxy:P,getAuthMeta:P,getAuthFlow:P,closePrivyModal:P,openPrivyModal:P,connectWallet:P,initLoginWithWallet:P,loginWithWallet:P,initLoginWithFarcaster:P,loginWithFarcaster:P,loginWithCode:P,initLoginWithEmail:P,initLoginWithSms:P,initUpdateEmail:P,resendEmailCode:P,resendSmsCode:P,initLoginWithOAuth:P,loginWithOAuth:P,refreshUser:P,walletProxy:null,createAnalyticsEvent:P,acceptTerms:P,getUsdTokenPrice:P,recoverEmbeddedWallet:P,getFiatOnRampConfig:P,updateWallets:P,setReadyToTrue:P}),W=()=>(0,ss.useContext)(Yl);var ls=require("react");var ge=(0,ls.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:P,login:P,connectOrCreateWallet:P,linkEmail:P,linkPhone:P,linkFarcaster:P,linkWallet:P,linkGoogle:P,linkTwitter:P,linkDiscord:P,linkGithub:P,linkSpotify:P,linkTiktok:P,linkLinkedIn:P,linkApple:P,updateEmail:P,logout:P,getAccessToken:P,getEthereumProvider:P,getEthersProvider:P,getWeb3jsProvider:P,unlinkEmail:P,unlinkPhone:P,unlinkWallet:P,unlinkGoogle:P,unlinkTwitter:P,unlinkDiscord:P,unlinkGithub:P,unlinkSpotify:P,unlinkTiktok:P,unlinkLinkedIn:P,unlinkApple:P,unlinkFarcaster:P,setActiveWallet:P,forkSession:P,createWallet:P,signMessage:P,signTypedData:P,enrollInMfa:P,initEnrollmentWithSms:P,initEnrollmentWithTotp:P,promptMfa:P,init:P,submitEnrollmentWithSms:P,submitEnrollmentWithTotp:P,unenroll:P,submit:P,cancel:P,sendTransaction:P,exportWallet:P,setWalletPassword:P,initLoginWithEmail:P,initLoginWithSms:P,loginWithCode:P,isModalOpen:!1}),z=()=>(0,ls.useContext)(ge);var cs=require("react"),gu=e=>{let[t,o]=(0,cs.useState)("auto");return(0,cs.useEffect)(()=>{let r=new ResizeObserver(n=>{o(n[0]?.contentRect.height??"auto")});return e.current&&r.observe(e.current),()=>{e.current&&r.unobserve(e.current)}},[e.current]),t};var Dn=require("react"),vu={login:{onComplete:[],onError:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]}},Jl=(0,Dn.createContext)(void 0),wu=()=>(0,Dn.useContext)(Jl);function Be(e,t){if(!t)return;let r=wu().current[e];return(0,Dn.useEffect)(()=>{for(let[n,i]of Object.entries(t))r.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),r[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))r.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),r[n]=r[n]?.filter(a=>a!==i)}},[t])}function H(e,t,o,...r){for(let n of e.current[t][o])n(...r)}function Cu(){let e=wu();return(t,o,...r)=>H(e,t,o,...r)}function ds(e){Be("configureMfa",e)}var ic=f(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),ku=f(require("@heroicons/react/24/solid/DocumentCheckIcon")),Ru=f(require("styled-components"));var Xt=f(require("styled-components"));var ps=f(require("styled-components")),kr=require("react/jsx-runtime"),Rr=({success:e,fail:t})=>(0,kr.jsxs)(kr.Fragment,{children:[(0,kr.jsx)(Zt,{className:e?"success":t?"fail":""}),(0,kr.jsx)(Ql,{className:e?"success":t?"fail":""})]}),Zt=ps.default.span`
12
+ - https://privy.io`;this.getNonceOnce=new ht(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(wd(),{message:t,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(t){throw me(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign();return await this.api.post(Cd(),{message:t,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw me(t)}}async sign(){if(!this.api)throw new w("Auth flow has no API 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.api)throw new w("Auth flow has no API instance");let t=this.wallet.address;return(await this.api.post(vd(),{address:t,token:this.captchaToken})).nonce}async buildSiweMessage(){if(!this.api)throw new w("Auth flow has no API instance");let t=this.wallet.address,o=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=this.prepareMessage(o,t,this.nonce),this.preparedMessage}prepareMessage(t,o,r){let n=window.location.host,i=window.location.origin,a="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",l=new Date().toISOString();return this.createSiweMessage(t,o,n,i,l,r,a)}};var jr=class{constructor(t,o){this.meta={phoneNumber:t,captchaToken:o}}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=Rd(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw me(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{let t=Id();return await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw me(t)}}async sendSmsCode(t,o){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),o&&(this.meta.captchaToken=o),!this.meta.phoneNumber)throw new w("phone nNumber must be set when initialzing authentication.");try{let r=kd();return await this.api.post(r,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(r){throw me(r)}}};var pu=require("uuid");function gt(e){return new Date(e*1e3)}function dv(e){let t=[];for(let o of e){let r=o.type;switch(o.type){case"wallet":let n={address:o.address,type:o.type,verifiedAt:gt(o.verified_at),chainType:"ethereum",chainId:o.chain_id,walletClient:o.wallet_client_type==="privy"?"privy":"unknown",walletClientType:o.wallet_client_type,connectorType:o.connector_type,recoveryMethod:o.recovery_method};t.push(n);break;case"email":let i={address:o.address,type:o.type,verifiedAt:gt(o.verified_at)};t.push(i);break;case"phone":let a={number:o.phoneNumber,type:o.type,verifiedAt:gt(o.verified_at)};t.push(a);break;case"google_oauth":let l={subject:o.subject,email:o.email,name:o.name,type:o.type,verifiedAt:gt(o.verified_at)};t.push(l);break;case"spotify_oauth":let s={subject:o.subject,email:o.email,name:o.name,type:o.type,verifiedAt:gt(o.verified_at)};t.push(s);break;case"twitter_oauth":let c={subject:o.subject,username:o.username,name:o.name,type:o.type,profilePictureUrl:o.profile_picture_url,verifiedAt:gt(o.verified_at)};t.push(c);break;case"discord_oauth":let m={subject:o.subject,username:o.username,email:o.email,type:o.type,verifiedAt:gt(o.verified_at)};t.push(m);break;case"github_oauth":let h={subject:o.subject,username:o.username,name:o.name,email:o.email,type:o.type,verifiedAt:gt(o.verified_at)};t.push(h);break;case"tiktok_oauth":let g={subject:o.subject,username:o.username,name:o.name,type:o.type,verifiedAt:gt(o.verified_at)};t.push(g);break;case"linkedin_oauth":let v={subject:o.subject,name:o.name,email:o.email,type:o.type,verifiedAt:gt(o.verified_at)};t.push(v);break;case"apple_oauth":let b={subject:o.subject,email:o.email,type:o.type,verifiedAt:gt(o.verified_at)};t.push(b);break;case"custom_auth":t.push({type:o.type,customUserId:o.custom_user_id,verifiedAt:gt(o.verified_at)});break;case"farcaster":let T={type:o.type,fid:o.fid,ownerAddress:o.owner_address,displayName:o.display_name,username:o.username,bio:o.bio,pfp:o.profile_picture_url,url:o.homepage_url,verifiedAt:gt(o.verified_at)};t.push(T);break;default:console.warn(`Unrecognized account type: ${r}. Please consider upgrading the Privy SDK.`)}}return t}function jt(e,t){return e.sort((o,r)=>r.verifiedAt.getTime()-o.verifiedAt.getTime()),e.find(o=>o.type===t)}var Ae=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy")||null,pv=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Kt=(e,t)=>t==="all-users"&&!Ae(e)||t==="users-without-wallets"&&!pv(e)?.length;function Lt(e){if(!e)return null;let t=dv(e.linked_accounts),o=jt(t,"wallet"),r=jt(t,"email"),n=jt(t,"phone"),i=jt(t,"google_oauth"),a=jt(t,"twitter_oauth"),l=jt(t,"discord_oauth"),s=jt(t,"github_oauth"),c=jt(t,"spotify_oauth"),m=jt(t,"tiktok_oauth"),h=jt(t,"linkedin_oauth"),g=jt(t,"apple_oauth"),v=jt(t,"farcaster"),b=e.mfa_methods.map(({type:x,verified_at:E})=>({type:x,verifiedAt:gt(E)}));return{id:e.id,createdAt:gt(e.created_at),linkedAccounts:t,email:r&&{address:r?.address},phone:n&&{number:n?.number},wallet:o&&{address:o.address,chainType:o.chainType,chainId:o.chainId,walletClient:o.walletClient,walletClientType:o.walletClientType,connectorType:o.connectorType,recoveryMethod:o.recoveryMethod},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:c&&{subject:c.subject,email:c.email,name:c.name},tiktok:m&&{subject:m.subject,username:m.username,name:m.name},linkedin:h&&{subject:h.subject,name:h.name,email:h.email},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},mfaMethods:b.map(x=>x.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var $l=require("@ethersproject/address"),su=f(require("eventemitter3"));function sp(){let e=window,t=e.ethereum;if(!t)return[];let o=[];if(t.providers?.length)for(let r of t.providers)r&&o.push(r);return o.push(e.ethereum),o}var Sa=e=>{if(e.isApexWallet)return"Apex Wallet";if(e.isAvalanche)return"Core Wallet";if(e.isBackpack)return"Backpack";if(e.isBifrost)return"Bifrost Wallet";if(e.isBitKeep)return"BitKeep";if(e.isBitski)return"Bitski";if(e.isBlockWallet)return"BlockWallet";if(e.isBraveWallet)return"Brave Wallet";if(e.isClover)return"Clover";if(e.isCoin98)return"Coin98 Wallet";if(e.isCoinbaseWallet)return"Coinbase Wallet";if(e.isDawn)return"Dawn Wallet";if(e.isDefiant)return"Defiant";if(e.isDesig)return"Desig Wallet";if(e.isEnkrypt)return"Enkrypt";if(e.isExodus)return"Exodus";if(e.isFordefi)return"Fordefi";if(e.isFrame)return"Frame";if(e.isFrontier)return"Frontier Wallet";if(e.isGamestop)return"GameStop Wallet";if(e.isHaqqWallet)return"HAQQ Wallet";if(e.isHyperPay)return"HyperPay Wallet";if(e.isImToken)return"ImToken";if(e.isHaloWallet)return"Halo Wallet";if(e.isKuCoinWallet)return"KuCoin Wallet";if(e.isMathWallet)return"MathWallet";if(e.isNovaWallet)return"Nova Wallet";if(e.isOkxWallet||e.isOKExWallet)return"OKX Wallet";if(e.isOneInchIOSWallet||e.isOneInchAndroidWallet)return"1inch Wallet";if(e.isOneKey)return"OneKey Wallet";if(e.isOpera)return"Opera";if(e.isPhantom)return"Phantom";if(e.isPortal)return"Ripio Portal";if(e.isRabby)return"Rabby Wallet";if(e.isRainbow)return"Rainbow";if(e.isSafePal)return"SafePal Wallet";if(e.isStatus)return"Status";if(e.isSubWallet)return"SubWallet";if(e.isTalisman)return"Talisman";if(e.isTally||e.isTaho)return"Taho";if(e.isTokenPocket)return"TokenPocket";if(e.isTokenary)return"Tokenary";if(e.isTrust||e.isTrustWallet)return"Trust Wallet";if(e.isTTWallet)return"TTWallet";if(e.isXDEFI)return"XDEFI Wallet";if(e.isZeal)return"Zeal";if(e.isZerion)return"Zerion";if(e.isMetaMask)return"MetaMask"};var Ll=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Sa(e)!=="MetaMask")return!1;if(e.providers){for(let o of e.providers)if(!Ll(o))return!1}return!0},Er=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),lp=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0}return!1};var cp=(e,t)=>{let o=[],r=[];for(let[n,i]of e.entries())n<t?o.push(i):r.push(i);return[o,r]},_a=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),dp=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},Tr=(e,t=3,o=4)=>{if(!e)return"";let r=2,n=3;if(t+o+r+n>=e.length)return e;let i=e.slice(0,r+t),a=e.slice(e.length-o,e.length);return`${i}...${a}`},Ol=e=>new Promise(t=>setTimeout(t,e));function pp(e,{interval:t=100,timeout:o=5e3}={}){return new Promise((r,n)=>{let i=0,a,l=()=>{if(i>=o){n("Max attempts reached without result");return}if(a=e(),i+=t,a!=null){r(a);return}setTimeout(l,t)};l()})}var up=(e,t={})=>{let o=t.delayMs||150,r=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<r;){if(t.abortSignal?.aborted)return;e().then(()=>{a=!0,n()},(...s)=>{a=!0,i(...s)}),l+=1,await Ol(o)}a||i(new Error("Exceeded max attempts before resolving function"))})},Aa=(e,t,o={})=>{let r=new URL(t,e);for(let[n,i]of Object.entries(o))r.searchParams.set(n,i);return r.href};var Dl=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Kr=e=>typeof e=="string"?e:"0x"+e.toString(16);async function mp(e,t,o=3e3){let r=!1,n=window;return new Promise(i=>{n.ethereum?a():(window.addEventListener("ethereum#initialized",a,{once:!0}),setTimeout(()=>{a()},o));function a(){if(r)return;r=!0,window.removeEventListener("ethereum#initialized",a);let l=e.getProviders(),s=[];for(let c of l)t.includes("coinbase_wallet")&&c.info.rdns==="com.coinbase.wallet"||s.push({type:c.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:c});for(let c of sp()){let m=Sa(c);if(!l.some(h=>h.info.name===m)){if(Ll(c,!0)&&!s.find(h=>h.type==="metamask")){s.push({type:"metamask",legacyInjectedProvider:c});continue}if(m==="Phantom"&&!s.find(h=>h.type==="phantom")){s.push({type:"phantom",legacyInjectedProvider:c});continue}s.find(h=>h.type==="unknown_browser_extension")||s.push({type:"unknown_browser_extension",legacyInjectedProvider:c})}}i(s)}})}function Tn(e){return`eip155:${String(Number(e))}`}var mo=(e,t,o)=>{let r=Number(e),n=t.find(a=>a.id===r);if(!n)throw new Z(`Unsupported chainId ${e}`,4901);let i;if(n.rpcUrls.privyWalletOverride&&n.rpcUrls.privyWalletOverride.http[0]?i=n.rpcUrls.privyWalletOverride.http[0]:o.rpcUrls&&o.rpcUrls[r]?i=o.rpcUrls[r]:n.rpcUrls.infura?.http[0]?i=n.rpcUrls.infura.http[0]+"/"+wa:n.rpcUrls.blast?.http[0]?i=n.rpcUrls.blast.http[0]+"/"+Kd:i=n.rpcUrls.default?.http[0],!i)throw new Z(`No RPC url found for ${e}`);return i},fp=(e,t)=>{let o=Number(e),r=t.find(n=>n.id===o);if(!r)throw new Z(`Unsupported chainId ${e}`,4901);return r.blockExplorers?.default.url},ka=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},o=Object.entries(e.domain).map(([r,n])=>{if(n!=null&&typeof r=="string"&&r in t)return{name:r,type:t[r]}}).filter(r=>r!==void 0);return{...e,types:{...e.types,EIP712Domain:o}}};var Tp=f(require("@coinbase/wallet-sdk"));var Ai=require("react/jsx-runtime"),ki=({style:e,...t})=>(0,Ai.jsxs)("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:[(0,Ai.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,Ai.jsx)("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"})]});var yo=require("@ethersproject/address"),Fl=require("@ethersproject/providers"),Ep=f(require("eventemitter3"));var Ul=require("@ethersproject/providers"),gp=f(require("eventemitter3"));var uv=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],hp=e=>uv.includes(e);var yp=require("@ethersproject/logger");var Pn=class extends Z{constructor(){super("Wallet timeout");this.type="wallet_error"}},xn=class extends Z{constructor(){super("User rejected connection");this.type="wallet_error"}},fo=e=>{if(e instanceof Z)return e;if(e?.code&&e?.reason){let t=new nt(e);return e.code===yp.ErrorCode.ACTION_REJECTED&&(t.details=St.E4001_USER_REJECTED_REQUEST),t}return e?.code?new nt(e):new Z("Unknown connector error",e)},Wo=class extends rt{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},nt=class extends Wo{constructor(o){let r=o;super(r.message,r.code,r.data);let n=Object.values(St).find(i=>i.eipCode===r.code);this.details=n||St.UNKNOWN_ERROR,r.code===-32002&&(r.message?.includes("already pending for origin")?r.message?.includes("wallet_requestPermissions")?this.details=St.E32002_CONNECTION_ALREADY_PENDING:this.details=St.E32002_REQUEST_ALREADY_PENDING:r.message?.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=St.E32002_WALLET_LOCKED))}},mv={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}},fv={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},hv={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},St={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...hv,...fv},or={...mv,...St};var Se=class{constructor(t,o){this.removeListener=(t,o)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,o)}catch{console.warn("Unable to remove wallet provider listener")}};this.walletTimeout=(t=new Pn,o=this.rpcTimeoutDuration)=>new Promise((r,n)=>setTimeout(()=>{n(t)},o));this.setWalletProvider=t=>{this.walletProvider&&this._subscriptions.forEach(o=>{this.removeListener(o.eventName,o.listener)}),this.walletProvider=t,this._subscriptions.forEach(o=>{this.walletProvider?.on(o.eventName,o.listener)})};this.walletProvider=t,this.rpcTimeoutDuration=o||$r,this._subscriptions=[]}on(t,o){if(this.walletProvider)return this.walletProvider.on(t,o);this._subscriptions.push({eventName:t,listener:o})}async request(t){if(!this.walletProvider)throw new Z(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),this.walletTimeout()]).catch(o=>{throw fo(o)})}},Pr=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},Ra=class extends gp.default{constructor(o,r,n,i,a=1){super();this.walletProxy=o,this.address=r,this.chainId=a,this.rpcConfig=n,this.chains=i,this.provider=new Ul.StaticJsonRpcProvider(mo(a,this.chains,n)),this.rpcTimeoutDuration=Sn(n,"privy")}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new Pr(`Invalid params for ${o.method}`,4200);let r=o.params[0];if(!await Ke()||!this.address)throw new Pr("Disconnected",4900);return(await Cp(r)).hash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new Pr(`Invalid params for ${o.method}`,4200);let r;if(typeof o.params[0]=="string")r=o.params[0];else if("chainId"in o.params[0]&&typeof o.params[0].chainId=="string")r=o.params[0].chainId;else throw new Pr(`Invalid params for ${o.method}`,4200);this.chainId=Number(r),this.provider=new Ul.StaticJsonRpcProvider(mo(this.chainId,this.chains,this.rpcConfig)),this.emit("chainChanged",r)}async handlePersonalSign(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for personal_sign");let r=o.params[0];return await vp(r)}async handleSignedTypedData(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_signTypedData_v4");let r=typeof o.params[1]=="string"?JSON.parse(o.params[1]):o.params[1];return await wp(ka(r))}async handleEstimateGas(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");delete o.params[0].gasPrice,delete o.params[0].maxFeePerGas,delete o.params[0].maxPriorityFeePerGas;let r={...o.params[0],chainId:Kr(this.chainId)};try{return await this.provider.send("eth_estimateGas",[r])}catch{return delete r.from,await this.provider.send("eth_estimateGas",[r])}}async request(o){switch(console.debug("Embedded1193Provider.request() called with args",o),o.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return Kr(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(o);case"eth_sendTransaction":return this.handleSendTransaction(o);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(o);case"personal_sign":return this.handlePersonalSign(o);case"eth_signTypedData_v4":return this.handleSignedTypedData(o);default:break}if(hp(o.method)){let r=await Ke();if(await bp(),!r||!this.address)throw new Pr("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:r,request:{method:o.method,params:o.params}})).response.data}catch(n){throw console.error(n),new Pr("Disconnected",4900)}}else return this.provider.send(o.method,o.params)}async connect(){let o=await Ke();if(!o||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:o})).address}catch(r){return console.error(r),null}}},ho=class extends Se{constructor(o){super(o,o.rpcTimeoutDuration)}},xr=class extends Se{constructor(t){super(t,t.rpcTimeoutDuration)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var yv=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},vt=class extends Ep.default{constructor(o,r,n,i){super();this.onAccountsChanged=o=>{o.length===0?this.onDisconnect():this.syncAccounts(o)};this.onChainChanged=o=>{this.wallets.forEach(r=>{r.chainId=Tn(o),this.walletClientType==="privy"&&de.put(Pa(r.address),o)}),this.emit("walletsUpdated")};this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")};this.onConnect=()=>{this.connected=!0,this.syncAccounts()};this.wallets=[],this.walletClientType=o,this.chains=r,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=Sn(i,o),this.connected=!1,this.initialized=!1}buildConnectedWallet(o,r,n){let i=async()=>!!this.wallets.find(a=>(0,yo.getAddress)(a.address)===(0,yo.getAddress)(o));return{address:(0,yo.getAddress)(o),chainId:r,meta:n,switchChain:async a=>{if(!i)throw new Z("Wallet is not currently connected.");let l=this.wallets.find(g=>(0,yo.getAddress)(g.address)===(0,yo.getAddress)(o))?.chainId;if(!l)throw new Z("Unable to determine current chainId.");let s,c;if(typeof a=="number"?(s=`0x${a.toString(16)}`,c=a):(s=a,c=Number(a)),l===Tn(s))return;let m=this.chains.find(g=>g.id===c);if(!m)throw new Z(`Unsupported chainId: ${a}`);let h=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})};try{return await h()}catch(g){if(yv(g,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:s,chainName:m.name,nativeCurrency:m.nativeCurrency,rpcUrls:[m.rpcUrls.default?.http[0]??""],blockExplorerUrls:[m.blockExplorers?.default.url??""]}]}),h();throw this.walletClientType==="rainbow"&&g.message?.includes("wallet_switchEthereumChain")?new Z(`Rainbow does not support the chainId ${r}`):g}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new Z("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await i())throw new Z("Wallet is not currently connected.");return new Fl.Web3Provider(new ho(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new Z("Wallet is not currently connected.");return new xr(this.proxyProvider)},sign:async a=>{if(!await i())throw new Z("Wallet is not currently connected.");return await this.sign(a)},disconnect:()=>{this.disconnect()}}}async syncAccounts(o){let r=o;try{if(r===void 0){let c=await this.proxyProvider.request({method:"eth_accounts"});Array.isArray(c)&&(r=c)}}catch{console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.")}if(!r||!Array.isArray(r)||r.length<=0||!r[0])return;let n=r[0],i=(0,yo.getAddress)(n),a=[],l;if(this.walletClientType==="privy"){let c=de.get(Pa(i));this.chains.find(m=>m.id===Number(c))||(de.del(Pa(i)),c=null),l=c||`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 c=await this.proxyProvider.request({method:"eth_chainId"});if(typeof c=="string")l=c;else if(typeof c=="number")l=`0x${c.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(c){console.warn(`Failed to get chainId from provider, defaulting to ${Il}`,c),l=Il}let s=Tn(l);if(!a.find(c=>(0,yo.getAddress)(c.address)===i)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet((0,yo.getAddress)(n),s,c))}Ia(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let o=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((r,n)=>n.connectedAt-r.connectedAt).find(r=>o.find(n=>(0,yo.getAddress)(n)===(0,yo.getAddress)(r.address)))||null}async isConnected(){let o=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(o)&&o.length>0}async sign(o){return await this.connect({showPrompt:!1}),new Fl.Web3Provider(new ho(this.proxyProvider)).getSigner().signMessage(o)}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 gv=e=>{let t=`https://mainnet.infura.io/v3/${wa}`,o=1;return e.makeWeb3Provider(t,o)},Ma,Wa=class extends vt{constructor(o,r,n){super("coinbase_wallet",o,r,n);this.connectorType="coinbase_wallet";this.proxyProvider=new Se(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),Ma||(Ma=new Tp.default({appName:"Privy",darkMode:!1,headlessMode:!1,enableMobileWalletLink:!0})),this.proxyProvider.setWalletProvider(gv(Ma)),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}async connect(o){return o.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){Ma.disconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:ki,id:"com.coinbase.wallet"}}async promptConnection(){try{let o=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!o||o.length===0||!o[0])throw new Z("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([o[0]])}catch(o){throw fo(o)}}};var Bl=require("react/jsx-runtime"),Na=({...e})=>(0,Bl.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,Bl.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var La=class extends vt{constructor(o,r,n,i){super("privy",r,n,i);this.connectorType="embedded";this.proxyProvider=o,this.subscribeListeners(),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}async connect(o){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[Kr(o?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Na,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var Hl=require("react/jsx-runtime"),_n=({style:e,...t})=>(0,Hl.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,Hl.jsx)("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"})});var it=require("react/jsx-runtime"),An=({style:e,...t})=>(0,it.jsxs)("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:[(0,it.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,it.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"}),(0,it.jsx)("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"})]});var Ri=require("react/jsx-runtime"),No=({style:e,...t})=>(0,Ri.jsxs)("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:[(0,Ri.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,Ri.jsx)("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 Rn=class extends vt{constructor(o,r,n,i,a){super(a||"unknown",o,r,n);this.connectorType="injected";this.proxyProvider=new Se(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}async connect(o){return o.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 o=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!o||o.length===0||!o[0])throw new Z("Unable to retrieve accounts");await this.syncAccounts([o[0]])}catch(o){throw fo(o)}}},kn,In=class extends vt{constructor(o,r,n,i,a){super(a??"unknown",o,r,n);this.connectorType="injected";ua(this,kn,void 0);this.proxyProvider=new Se(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0}),a==="metamask"?Sl(this,kn,{name:"MetaMask",icon:An,id:"io.metamask"}):a==="phantom"&&Sl(this,kn,{name:"Phantom",icon:No,id:"phantom"})}async connect(o){return o.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return fd(this,kn)??{name:"Browser Extension",icon:_n,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let o=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!o||o.length===0||!o[0])throw new Z("Unable to retrieve accounts");await this.syncAccounts([o[0]])}catch(o){throw fo(o)}}};kn=new WeakMap;var vv=require("@ethersproject/address"),wv=require("@ethersproject/providers"),Pp=require("react-device-detect");var Oa=class extends Rn{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{Pp.isMobile||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 Z("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw fo(t)}}};var Da=class extends vt{constructor(o,r){super(o,[],r,{});this.connectorType="null";this.proxyProvider=new Se(void 0,$r);this.connectorType=o}get walletBranding(){return{name:"Wallet",id:""}}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(o){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${o}`)}};var Ua=class extends Da{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:No,id:"phantom"}}};var Nn=require("@walletconnect/ethereum-provider"),au=require("react-device-detect");var Jt=require("react");var xp=require("react/jsx-runtime");function Fa({src:e,...t}){return(0,xp.jsx)("img",{src:e,...t,style:{display:"none"}})}var Lo=require("react"),Vp=require("react");var Yt={appearance:{theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:Yd,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},captchaEnabled:!1,_render:{inDialog:!0,inParentNodeId:null},fiatOnRamp:{useSandbox:!1}};var Sp=({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],o=[];e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `input.primary.length`");for(let r of e.primary.slice(1))t.includes(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let r of e.overflow??[])!t.includes(r)&&!o.includes(r)?o.push(r):console.warn(`Duplicated login method: ${r}`);return{primary:t,overflow:o}};var Cv=new Set(["metamask","coinbase_wallet","rainbow","zerion","phantom","wallet_connect","detected_wallets"]),bv=e=>Cv.has(e),Ev=(e,t,o)=>o.indexOf(e)===t,_p=({input:e})=>e?e.filter(bv).filter(Ev):Yt.appearance.walletList;var Ba={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}};var Ha={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]},default:{http:["https://goerli-rollup.arbitrum.io/rpc"]},public:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"},default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var Ga={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0};var Ap={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}};var kp={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0};var Va={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}},testnet:!0};var za={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{blast:{http:["https://base-goerli.blastapi.io"],webSocket:["wss://base-goerli.blastapi.io"]},default:{http:["https://goerli.base.org"]},public:{http:["https://goerli.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://goerli.basescan.org"},default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var $a={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0};var Rp={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1};var Ip={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0};var Mp={id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}};var Wp={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}};var Np={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var Lp={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}};var Op={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-mainnet.infura.io/v3"],webSocket:["wss://linea-mainnet.infura.io/ws/v3"]},default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1};var Dp={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0};var qa={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}};var ja={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}};var Ka={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"],webSocket:["wss://opt-goerli.g.alchemy.com/v2"]},infura:{http:["https://optimism-goerli.infura.io/v3"],webSocket:["wss://optimism-goerli.infura.io/ws/v3"]},default:{http:["https://goerli.optimism.io"]},public:{http:["https://goerli.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var Ya={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0};var Ii={id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}};var Mi={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mumbai.g.alchemy.com/v2"],webSocket:["wss://polygon-mumbai.g.alchemy.com/v2"]},infura:{http:["https://polygon-mumbai.infura.io/v3"],webSocket:["wss://polygon-mumbai.infura.io/ws/v3"]},default:{http:["https://matic-mumbai.chainstacklabs.com"]},public:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"},default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var Up={id:17001,name:"Redstone Holesky",network:"redstone-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.holesky.redstone.xyz"]},public:{http:["https://rpc.holesky.redstone.xyz"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"},default:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"}}};var Fp={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0};var Ja={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}};var Qa={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0};var Za={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0};var Mn=[Ba,Ha,Ga,Np,Fp,qa,ja,Ka,Ya,Ii,Mi,Rp,Ip,Mp,Wp,Va,za,$a,Op,Dp,Ap,kp,Ja,Za,Qa,Lp,Up],C2=new Set(Mn.map(e=>e.id));var _r=f(require("tinycolor2")),Bp="#FFFFFF",Tv="#000000",Pv=Bp,xv="#1E1E1D";function Sv(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}function Sr(e,t){let o=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,_r.default)({...e.toHsl(),l:o})}function Hp({backgroundTheme:e,accentHex:t,successHex:o="#51BA81",warnHex:r="#FFB74D",errorHex:n="#EC6351",whiteHex:i=Bp,blackHex:a=Tv}){let l;switch(e){case"light":l=Pv;break;case"dark":l=xv;break;default:l=e;break}let s=(0,_r.default)(l),c=(0,_r.default)(t),m=(0,_r.default)(o),h=(0,_r.default)(r),g=(0,_r.default)(n),v=Sv(s.getLuminance()),b=Sr(s,v==="light"?-.04:.11),T=Sr(s,v==="light"?-.88:.87),x=Sr(s,v==="light"?-.77:.75),E=Sr(s,v==="light"?-.43:.45).desaturate(v==="light"?60:20),k=Sr(s,v==="light"?-.08:.25).desaturate(v==="light"?60:20),I=Sr(c,.15),M=Sr(c,-.06),S=(0,_r.default)(c.getLuminance()>.5?a:i),O=Sr(m,-.16);return{colorScheme:v,background:s.toHslString(),background2:b.toHslString(),foreground:T.toHslString(),foreground2:x.toHslString(),foreground3:E.toHslString(),foreground4:k.toHslString(),accent:c.toHslString(),accentLight:I.toHslString(),accentDark:M.toHslString(),foregroundAccent:S.toHslString(),success:m.toHslString(),successDark:O.toHslString(),error:g.toHslString(),warn:h.toHslString()}}function Gl(e,t,o){let r=o?console.warn:()=>{},n=["google","twitter","discord","spotify","tiktok","linkedin","github","apple","farcaster"],i=t?.loginMethods?.filter(Q=>n.includes(Q)),a,l,s,c,m,h,g,v,b,T,x,E;t?.loginMethods?(a=t.loginMethods.includes("email"),l=t.loginMethods.includes("sms"),s=t.loginMethods.includes("wallet"),c=i?.includes("google"),m=i?.includes("twitter"),h=i?.includes("discord"),v=i?.includes("spotify"),g=i?.includes("tiktok"),T=i?.includes("github"),b=i?.includes("linkedin"),x=i?.includes("apple"),E=i?.includes("farcaster")):(a=e.emailAuth,l=e.smsAuth,s=e.walletAuth,c=e.googleOAuth,m=e.twitterOAuth,h=e.discordOAuth,T=e.githubOAuth,v=e.spotifyOAuth,g=e.tiktokOAuth,b=e.linkedinOAuth,x=e.appleOAuth,E=e.farcasterAuth);let k=[a,l].filter(Boolean),I=[c,m,h,T,v,g,b,x,E].filter(Boolean),M=[s].filter(Boolean);if(k.length+I.length+M.length===0)throw new Error("You must enable at least one login method");let S=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;S&&M.length===0?(r("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),S=!1):!S&&I.length+k.length===0&&(r("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),S=!0);let O=_p({isWalletLoginEnabled:s,input:t?.appearance?.walletList});t?.loginMethods&&t.loginMethodsAndOrder&&r("You should only configure one of `loginMethods` or `loginMethodsAndOrder`"),t?.appearance?.walletList&&t.loginMethodsAndOrder&&r("You should only configure one of `appearance.walletList` or `loginMethodsAndOrder`");let D=Sp({input:t?.loginMethodsAndOrder}),B=t?.intl?.defaultCountry??"US",{chains:G,defaultChain:K}=_v({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),U=!!t?.defaultChain||!!t?.supportedChains,j=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,R,le=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?j?R=t?.embeddedWallets?.noPromptOnSignature??!0:R=t?.embeddedWallets?.noPromptOnSignature??le:R=le,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&R!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,palette:Hp({backgroundTheme:t?.appearance?.theme??Yt.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Yt.appearance.accentColor}),loginGroupPriority:S?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:O},loginMethods:{wallet:s,email:a,sms:l,google:c,twitter:m,discord:h,github:T,spotify:v,tiktok:g,linkedin:b,apple:x,farcaster:E},loginMethodsAndOrder:D,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Yt.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Yt.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Yt.rpcConfig.rpcTimeouts},chains:G,defaultChain:K,intl:{defaultCountry:B},shouldEnforceDefaultChainOnConnect:U,captchaEnabled:e.captchaEnabled??Yt.captchaEnabled,captchaSiteKey:e.captchaSiteKey,embeddedWallets:{...e.embeddedWalletConfig,...j?{createOnLogin:"all-users",requireUserPasswordOnCreate:!1}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...t?.embeddedWallets,noPromptOnSignature:R},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:j?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??Yt.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1},render:{inDialog:t?._render?.inDialog??Yt._render.inDialog,inParentNodeId:t?._render?.inParentNodeId??Yt._render.inParentNodeId}}}function Gp(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:o,additionalChains:r,supportedChains:n,defaultChain:i,...a}=e;return{...a,...r?{additionalChains:r.map(s=>s.id)}:void 0,...n?{supportedChains:n.map(s=>s.id)}:void 0,...i?{defaultChain:i.id}:void 0,...o?{...o,...o.logo&&typeof o.logo?{logo:"component"}:void 0}:void 0,legacyCreateEmbeddedWalletFlag:t}}function _v({additionalChains:e,supportedChains:t,defaultChainFromConfig:o,hasRpcConfigDefined:r}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(t.length===0)throw new Error("`supportedChains` must contain at least one chain");t.filter(s=>s.rpcUrls.privyWalletOverride).length>0&&r&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map(s=>s.rpcUrls.privyWalletOverride?s:Mn.find(m=>m.id===s.id)??s)}else n=Mn.concat(e??[]);let i=t?n[0]:qa,a=o??i;if(!n.find(l=>l.id===a.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:a}}var jp=require("react/jsx-runtime"),zp={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserPasswordOnCreate:!1},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},Vl=Gl(zp,void 0,!1),zl=(0,Vp.createContext)({appConfig:Vl,isServerConfigLoaded:!1}),$p=({children:e,legacyCreateEmbeddedWalletFlag:t,client:o,clientConfig:r})=>{let[n,i]=(0,Lo.useState)(null),a=(0,Lo.useMemo)(()=>Gl(n??zp,r,!!n),[n,r]);return(0,Lo.useEffect)(()=>{let l=Gp(r,t);o.createAnalyticsEvent("sdk_initialize",l)},[r,t]),(0,Lo.useEffect)(()=>{n||(async()=>{try{let s=await o.getServerConfig();s.customApiUrl&&o.updateApiUrl(s.customApiUrl),i(s)}catch(s){console.warn("Error generating app config: ",s)}})()},[]),(0,jp.jsx)(zl.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},Xa=()=>{let{appConfig:e}=(0,Lo.useContext)(zl);return e},qp=()=>{let{isServerConfigLoaded:e}=(0,Lo.useContext)(zl);return e};var P=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var es=require("react/jsx-runtime"),Kp=(0,Jt.createContext)({ready:!1,app:Vl,currentScreen:null,lastScreen:null,navigate:P,navigateBack:P,resetNavigation:P,setModalData:P,onUserCloseViaDialogOrKeybindRef:void 0}),Av=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Yp=e=>{let t=Xa(),o=e.authenticated,[r,n]=(0,Jt.useState)(e.initialScreen);(0,Jt.useEffect)(()=>{!o&&!Av.includes(e.initialScreen)&&e.setInitialScreen(null)},[o]);let i=(0,Jt.useRef)(null);(0,Jt.useEffect)(()=>{e.open||(i.current=null)},[e.open]),(0,Jt.useEffect)(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:r,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(r)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return(0,es.jsxs)(Kp.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,es.jsx)(Fa,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},_=()=>(0,Jt.useContext)(Kp);var rr=require("react/jsx-runtime"),Wi=({style:e,...t})=>{let{app:o}=_();return(0,rr.jsxs)("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:[(0,rr.jsx)("rect",{width:"28",height:"28",rx:"3",fill:o?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,rr.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,rr.jsx)("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"})}),(0,rr.jsx)("defs",{children:(0,rr.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,rr.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var ts=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[o,r]of Object.entries(Wn))if(t.includes(r.hostname))return{walletClientType:o,entry:r}};var Wn={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"}},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"}},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"}}};function kv(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}var Jp=e=>e in Wn,Qp=e=>{let t=Wn[e].mobile;if("native"in t)return t.native};function Zp(e,t){let o=kv(t);if(o.deepLink)return ru(o.deepLink,e);if(o.universalLink)return nu(o.universalLink,e);throw new w(`Unsupported wallet ${t.id}`)}var Xp="WALLETCONNECT_DEEPLINK_CHOICE";function eu(){try{localStorage.removeItem(Xp)}catch{}}function tu({href:e,name:t}){try{localStorage.setItem(Xp,JSON.stringify({href:e,name:t}))}catch{}}function ou(e){return e.startsWith("http://")||e.startsWith("https://")}function ru(e,t){if(ou(e))return nu(e,t);let o=e;o.includes("://")||(o=e.replaceAll("/","").replaceAll(":",""),o=`${o}://`),o.endsWith("/")||(o=`${o}/`);let r=encodeURIComponent(t);return{redirect:`${o}wc?uri=${r}`,href:o}}function nu(e,t){if(!ou(e))return ru(e,t);let o=e;o.endsWith("/")||(o=`${o}/`);let r=encodeURIComponent(t);return{redirect:`${o}wc?uri=${r}`,href:o}}function iu(e,t){window.open(e,t,"noreferrer noopener")}var Oo=class extends vt{constructor(o,r,n,i,a,l){super(l||"unknown",n,i,r);this.connectorType="wallet_connect_v2";this.walletConnectCloudProjectId=o,this.rpcConfig=r,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new Se(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=Wn[l],this.walletClientType=l),this.createProvider().then(s=>{if(this.provider=s,this.proxyProvider.setWalletProvider(s),this.subscribeListeners(),s.session){if(this.walletProvider?.session?.peer.metadata.url){let c=ts(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=c?.entry,this.walletClientType=c?.walletClientType||"unknown"}this.connected=!0,this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}else this.emit("initialized"),this.initialized=!0}),import("@walletconnect/modal").then(({WalletConnectModal:s})=>{this.modal=new s({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(c=>{!c.open&&!this.walletProvider?.session&&this.onQrModalClosed&&this.onQrModalClosed()})})}async connect(o){return o.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return this.walletClientType==="metamask"?{name:"MetaMask",icon:An,id:"io.metamask"}:{name:Dl(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Wi,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(o){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=Wn[o],this.walletClientType=o,this.redirectUri=void 0,eu(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((o,r)=>{let n=()=>{r(new xn)};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 Z("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=ts(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Sn(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),o()})().catch(a=>{if(a){r(fo(a));return}r(new Z("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(o){this.proxyProvider.setWalletProvider(o)}async createProvider(){let o={};for(let a of this.chains){let l=mo(a.id,this.chains,this.rpcConfig);l&&(o[a.id]=l)}let r=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(a=>a.id),i=await Nn.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:r,optionalChains:n,optionalEvents:Nn.OPTIONAL_EVENTS,optionalMethods:Nn.OPTIONAL_METHODS,rpcMap:o,showQrModal:!1});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),au.isMobile&&this.walletEntry){let{redirect:l,href:s}=Zp(a,this.walletEntry);tu({href:s,name:this.walletEntry.displayName}),this.redirectUri=l,iu(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=ts(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 ql=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses");return t?!!e?.linkedAccounts.filter(r=>r.type=="wallet"&&r.address===(0,$l.getAddress)(t)).length:!1},Sn=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||$r:$r,Ln=class extends su.default{constructor(o,r,n,i,a,l,s){super();this.getEthereumProvider=()=>{let o=this.wallets[0],r=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===o?.address));return!o||!r?new Se:r.proxyProvider};this.walletConnectCloudProjectId=o,this.rpcConfig=r,this.chains=n,this.defaultChain=i,this.walletConnectors=[],this.initialized=!1,this.store=a,this.walletList=l,this.shouldEnforceDefaultChainOnConnect=s,this.initializedWalletConnectors=0,this.walletsReady=!1,this.storedConnections=this.loadConnectionHistory()}get wallets(){let o=new Set,r=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 o.has(a)?!1:(o.add(a),!0)}),n=r.findIndex(i=>i.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&r.unshift(r.splice(n,1)[0]),r}async initialize(){if(this.initialized)return;de.get(kl)&&(de.getKeys().forEach(r=>{r.startsWith("walletconnect")&&de.del(r)}),de.del(kl));let o=mp(this.store,this.walletList).then(r=>{r.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"),!Er()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),this.createWalletConnector("wallet_connect_v2","unknown"),await o,this.initialized=!0}findWalletConnector(o,r){return o==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===o)||null:this.walletConnectors.find(n=>n.connectorType===o&&n.walletClientType===r)||null}onInitialized(o){o.wallets.forEach(r=>{let n=this.storedConnections.find(i=>i.address===r.address&&i.connectorType===r.connectorType&&i.walletClientType===r.walletClientType);n&&(r.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.initializedWalletConnectors++,this.walletsReady=this.initializedWalletConnectors===this.walletConnectors.length}onWalletsUpdated(o){o.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(o,r,n){let i=this.findWalletConnector("embedded","privy");if(i)i.proxyProvider.walletProxy=o;else{let a=new Ra(o,r,this.rpcConfig,this.chains,n.id),l=new La(a,this.chains,n,this.rpcConfig);this.addWalletConnector(l)}}removeEmbeddedWalletConnector(){let o=this.findWalletConnector("embedded","privy");if(o){let r=this.walletConnectors.indexOf(o);this.walletConnectors.splice(r,1),this.saveConnectionHistory(),this.storedConnections=this.loadConnectionHistory(),this.emit("walletsUpdated")}}async createWalletConnector(o,r,n){let i=this.findWalletConnector(o,r);if(i)return i instanceof Oo&&i.resetConnection(r),i;let l=(()=>{if(o==="injected"){if(r==="metamask"&&n?.eip6963InjectedProvider)return new Oa(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(r==="metamask"&&n?.legacyInjectedProvider)return new In(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(r==="phantom"&&n?.legacyInjectedProvider)return new In(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&r==="unknown_browser_extension")return new In(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Rn(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,r)}else return o==="coinbase_wallet"?new Wa(this.chains,this.defaultChain,this.rpcConfig):o==="phantom"?new Ua(this.defaultChain):new Oo(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,r)})();return l&&this.addWalletConnector(l),l||null}addWalletConnector(o){this.walletConnectors.push(o),o.on("initialized",()=>this.onInitialized(o)),o.on("walletsUpdated",()=>this.onWalletsUpdated(o))}loadConnectionHistory(){let o=a=>a&&typeof a.address=="string"&&typeof a.connectorType=="string"&&typeof a.walletClientType=="string"&&typeof a.connectedAt=="number",r=de.get(Rl);return r&&Array.isArray(r)&&r.map(a=>o(a)).every(Boolean)?r:[]}saveConnectionHistory(){let o=this.wallets.map(r=>({address:r.address,connectorType:r.connectorType,walletClientType:r.walletClientType,connectedAt:r.connectedAt}));de.put(Rl,o)}async activeWalletSign(o){let r=this.wallets,n=r.length>0?r[0]:null;return n?n.sign(o):null}setActiveWallet(o){this.activeWallet=(0,$l.getAddress)(o),this.emit("walletsUpdated")}};function Ia(e,t){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++){let r=e[o],n=t[o];if(r?.address!==n?.address||r?.chainId!==n?.chainId||r?.connectorType!==n?.connectorType||r?.connectedAt!==n?.connectedAt||r?.walletClientType!==n?.walletClientType||r?.isConnected!==n?.isConnected||r?.linked!==n?.linked)return!1}return!0}var lu=require("ofetch");var Rv=[ha(),ga(),ya()],os=class{constructor(t,o,r){this.appId=t,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=ba,this.client=o,this.defaults=r,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=lu.ofetch.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:n,options:i})=>{let a=new Headers(i.headers);a.set("privy-app-id",this.appId),a.set("privy-ca-id",this.clientAnalyticsId||""),a.set("privy-client",`react-auth:${this.sdkVersion}`);let l=!Rv.includes(n.toString());if(!a.has("authorization")&&l){let s=await this.client.getAccessToken();s!==null&&a.set("authorization",`Bearer ${s}`)}i.headers=a},onRequestError:({error:n})=>{if(n instanceof DOMException&&n.name==="AbortError")throw new ma}})}async get(t,o){try{return await this.baseFetch(t,o)}catch(r){throw me(r)}}async post(t,o,r){try{return await this.baseFetch(t,{method:"POST",...o?{body:o}:{},...r})}catch(n){throw me(n)}}async delete(t,o){try{return await this.baseFetch(t,{method:"DELETE",...o})}catch(r){throw me(r)}}};var Ar=f(require("js-cookie"));function cu(e){return e instanceof Cr?"email":e instanceof jr?"sms":e instanceof qr?"siwe":e instanceof wn?"custom_auth":e instanceof br?e.meta.provider:null}var du=f(require("jose")),Do=class{static parse(t){try{return new Do(t)}catch{return null}}constructor(t){this.value=t,this._decoded=du.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 o=Date.now(),r=(this.expiration-t)*1e3;return o>=r}};var Iv=30,rs=class{constructor(){this.authenticateOnce=new ht(async t=>this._authenticate(t)),this.linkOnce=new ht(async t=>this._link(t)),this.refreshOnce=new ht(this._refresh.bind(this)),this.destroyOnce=new ht(this._destroy.bind(this)),this.forkSessionOnce=new ht(this._forkSession.bind(this))}get token(){try{let t=de.get(zr);return typeof t=="string"?new Do(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=de.get(Ea);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=de.get(Si);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get mightHaveServerCookies(){try{let t=Ar.default.get(Ta);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"}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Do.parse(this.token);return t!==null&&!t.isExpired(Iv)}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()}async _authenticate(t){try{let{token:o,refresh_token:r,user:n,is_new_user:i}=await t.authenticate();this.storeToken(o),this.storeRefreshToken(r);let a=cu(t);return a&&this.client&&this.client.createAnalyticsEvent("sdk_authenticate",{method:a,isNewUser:i}),a==="siwe"&&this.client&&this.client.createAnalyticsEvent("sdk_authenticate_siwe",{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}),{user:Lt(n),isNewUser:i}}catch(o){throw console.warn("Error authenticating session"),ft(o)}}async _link(t){try{let o=await t.link();return Lt(o)}catch(o){throw console.warn("Error linking account"),ft(o)}}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,o=this.refreshToken,r=this.forkedToken;try{let n;if(t&&o||this.mightHaveServerCookies){let i={};t&&(i.authorization=`Bearer ${t}`);let a=o?{refresh_token:o}:{};n=await this.api.post(ha(),a,{headers:i}),r&&this.clearForkedToken()}else if(r)n=await this.api.post(ga(),{refresh_token:r}),this.clearForkedToken();else return null;return n.session_update_action==="set"&&(this.storeToken(n.token),this.storeRefreshToken(n.refresh_token)),n.session_update_action==="clear"&&this.destroyLocalState(),Lt(n.user)}catch(n){if(n instanceof Io&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw ft(n)}}async _destroy(){try{await this.api?.post(ya(),{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 o=await this.api.post(gd(),{refresh_token:t});return this.storeToken(o.token),this.storeRefreshToken(o.refresh_token),o.new_session_refresh_token}catch(o){throw ft(o)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null),this.clearForkedToken(),this.client?.onDeleteToken?.()}storeToken(t){if(typeof t=="string"){let o=de.get(zr);if(de.put(zr,t),o!==t&&this.client?.onStoreToken?.(t),!this.client?.useServerCookies){let r=Do.parse(t)?.expiration;Ar.default.set(_l,t,{sameSite:"Strict",secure:!0,expires:r?new Date(r*1e3):void 0})}}else de.del(zr),Ar.default.remove(_l)}storeRefreshToken(t){typeof t=="string"?(de.put(Ea,t),this.client?.useServerCookies||(Ar.default.set(Ta,"t",{sameSite:"Strict",secure:!0,expires:30}),Ar.default.set(Al,t,{sameSite:"Strict",secure:!0,expires:30}))):(de.del(Ea),Ar.default.remove(Al),Ar.default.remove(Ta))}clearForkedToken(){de.del(Si)}};var jl,ns,uu,On=class{constructor(t){ua(this,ns);this.apiUrl=t.apiUrl||Ca,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||Jd,this.appId=t.appId,this.clientAnalyticsId=hd(this,ns,uu).call(this),jl||(jl=new rs),this.session=jl,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager(t,o,r,n,i,a,l){this.connectors||(this.connectors=new Ln(t,o,r,n,i,a,l))}generateApi(){let t=new os(this.appId,this,{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)}link(){if(!this.authFlow)throw new w("No auth flow in progress.");return this.session.link(this.authFlow)}async logout(){await this.session.destroy(),this.authFlow=void 0}startAuthFlow(t){t.api=this.api,this.authFlow=t}startMfaFlow(t){t.api=this.api,this.mfaFlow=t}async unlinkEmail(t){try{let o=await this.api.post(Od(),{address:t});return Lt(o)}catch(o){throw ft(o)}}async acceptTerms(){try{let t=await this.api.post($d(),{});return Lt(t)}catch(t){throw ft(t)}}async unlinkPhone(t){try{let o=await this.api.post(Dd(),{phoneNumber:t});return Lt(o)}catch(o){throw ft(o)}}async unlinkWallet(t){try{let o=await this.api.post(Ld(),{address:t});return Lt(o)}catch(o){throw ft(o)}}async unlinkOAuth(t,o){try{let r=await this.api.post(Ud(),{provider:t,subject:o});return Lt(r)}catch(r){throw ft(r)}}async unlinkFarcaster(t){try{let o=await this.api.post(Fd(),{fid:t});return Lt(o)}catch(o){throw ft(o)}}async createAnalyticsEvent(t,o,r){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(Bd(),{event_name:t,client_id:this.clientAnalyticsId,payload:{...o||{},clientTimestamp:r?r.toISOString():new Date().toISOString()}})}catch{}}async signMoonpayOnRampUrl(t){try{return this.api.post(Hd(),t)}catch(o){throw ft(o)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?Do.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:!t?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let t=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl});return{id:t.id,name:t.name,verificationKey:t.verification_key,logoUrl:t.logo_url||void 0,accentColor:t.accent_color||void 0,showWalletLoginFirst:t.show_wallet_login_first,allowlistConfig:{errorTitle:t.allowlist_config.error_title,errorDetail:t.allowlist_config.error_detail,errorCtaText:t.allowlist_config.cta_text,errorCtaLink:t.allowlist_config.cta_link},walletAuth:t.wallet_auth,emailAuth:t.email_auth,smsAuth:t.sms_auth,googleOAuth:t.google_oauth,twitterOAuth:t.twitter_oauth,discordOAuth:t.discord_oauth,githubOAuth:t.github_oauth,spotifyOAuth:t.spotify_oauth,tiktokOAuth:t.tiktok_oauth,linkedinOAuth:t.linkedin_oauth,appleOAuth:t.apple_oauth,farcasterAuth:t.farcaster_auth,termsAndConditionsUrl:t.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:t.embedded_wallet_config?.create_on_login,requireUserPasswordOnCreate:t.embedded_wallet_config?.require_user_password_on_create},privacyPolicyUrl:t.privacy_policy_url,requireUsersAcceptTerms:t.require_users_accept_terms,customApiUrl:t.custom_api_url,walletConnectCloudProjectId:t.wallet_connect_cloud_project_id,fiatOnRampEnabled:t.fiat_on_ramp_enabled,captchaEnabled:t.captcha_enabled,captchaSiteKey:t.captcha_site_key,twitterOAuthOnMobileEnabled:t.twitter_oauth_on_mobile_enabled,createdAt:new Date(t.created_at*1e3),updatedAt:new Date(t.updated_at*1e3),mfaMethods:t.mfa_methods,enforceWalletUis:t.enforce_wallet_uis,legacyWalletUiConfig:t.legacy_wallet_ui_config}}catch(t){throw ft(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 forkSession(){return await this.session.forkSession()}};ns=new WeakSet,uu=function(){if(typeof window>"u")return null;try{let o=de.get(_i);if(typeof o=="string"&&o.length>0)return o}catch{}let t=(0,pu.v4)();try{return de.put(_i,t),t}catch{return t}};var yu=require("@marsidev/react-turnstile"),is=require("react");var Qt=require("react");var hu=require("react/jsx-runtime"),mu=(0,Qt.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:P,setError:P,setExecuting:P,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:P,reset:P,execute:P}),nr=class extends rt{constructor(o,r,n){super(o||"Captcha failed");this.type="Captcha";r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},fu=({children:e,id:t,captchaSiteKey:o,captchaEnabled:r})=>{let n=(0,Qt.useRef)(null),[i,a]=(0,Qt.useState)(),[l,s]=(0,Qt.useState)(),[c,m]=(0,Qt.useState)(!1),h=(0,Qt.useMemo)(()=>r?!c&&!i&&!l?{status:"ready"}:c&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[r,i,l,c]);return(0,hu.jsx)(mu.Provider,{value:{...h,ref:n,enabled:r,siteKey:o,appId:t,setToken:a,setError:s,setExecuting:m,remove(){r&&(n.current?.remove(),m(!1),s(void 0),a(void 0))},reset(){r&&(n.current?.reset(),m(!1),s(void 0),a(void 0))},execute(){r&&(m(!0),n.current?.execute())},async waitForResult(){if(!r)return"";try{return await pp(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new nr("Captcha failed",null,"captcha_timeout")}}},children:e})},_e=()=>(0,Qt.useContext)(mu);var Kl=require("react/jsx-runtime"),as=e=>{let{enabled:t,siteKey:o,appId:r,setError:n,setToken:i,setExecuting:a,ref:l}=_e(),[,s]=(0,is.useMemo)(()=>o?.split("t:")||[],[o]);if((0,is.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return(0,Kl.jsx)("div",{className:"hidden h-0 w-0",children:(0,Kl.jsx)(yu.Turnstile,{...e,ref:l,siteKey:s,options:{action:r,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:c=>{e.onSuccess?.(c),i(c),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};var gr=require("react"),hg=f(require("react-dom"));var ss=require("react");var Yl=(0,ss.createContext)({isNewUserThisSession:!1,isLinking:!1,linkingHint:null,walletConnectionStatus:null,mipdStore:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,nativeTokenSymbolForChainId:P,initializeWalletProxy:P,getAuthMeta:P,getAuthFlow:P,closePrivyModal:P,openPrivyModal:P,connectWallet:P,initLoginWithWallet:P,loginWithWallet:P,initLoginWithFarcaster:P,loginWithFarcaster:P,loginWithCode:P,initLoginWithEmail:P,initLoginWithSms:P,initUpdateEmail:P,resendEmailCode:P,resendSmsCode:P,initLoginWithOAuth:P,loginWithOAuth:P,refreshUser:P,walletProxy:null,createAnalyticsEvent:P,acceptTerms:P,getUsdTokenPrice:P,recoverEmbeddedWallet:P,getFiatOnRampConfig:P,updateWallets:P,setReadyToTrue:P}),W=()=>(0,ss.useContext)(Yl);var ls=require("react");var ge=(0,ls.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:P,login:P,connectOrCreateWallet:P,linkEmail:P,linkPhone:P,linkFarcaster:P,linkWallet:P,linkGoogle:P,linkTwitter:P,linkDiscord:P,linkGithub:P,linkSpotify:P,linkTiktok:P,linkLinkedIn:P,linkApple:P,updateEmail:P,logout:P,getAccessToken:P,getEthereumProvider:P,getEthersProvider:P,getWeb3jsProvider:P,unlinkEmail:P,unlinkPhone:P,unlinkWallet:P,unlinkGoogle:P,unlinkTwitter:P,unlinkDiscord:P,unlinkGithub:P,unlinkSpotify:P,unlinkTiktok:P,unlinkLinkedIn:P,unlinkApple:P,unlinkFarcaster:P,setActiveWallet:P,forkSession:P,createWallet:P,signMessage:P,signTypedData:P,enrollInMfa:P,initEnrollmentWithSms:P,initEnrollmentWithTotp:P,promptMfa:P,init:P,submitEnrollmentWithSms:P,submitEnrollmentWithTotp:P,unenroll:P,submit:P,cancel:P,sendTransaction:P,exportWallet:P,setWalletPassword:P,initLoginWithEmail:P,initLoginWithSms:P,loginWithCode:P,isModalOpen:!1}),z=()=>(0,ls.useContext)(ge);var cs=require("react"),gu=e=>{let[t,o]=(0,cs.useState)("auto");return(0,cs.useEffect)(()=>{let r=new ResizeObserver(n=>{o(n[0]?.contentRect.height??"auto")});return e.current&&r.observe(e.current),()=>{e.current&&r.unobserve(e.current)}},[e.current]),t};var Dn=require("react"),vu={login:{onComplete:[],onError:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]}},Jl=(0,Dn.createContext)(void 0),wu=()=>(0,Dn.useContext)(Jl);function Be(e,t){if(!t)return;let r=wu().current[e];return(0,Dn.useEffect)(()=>{for(let[n,i]of Object.entries(t))r.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),r[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))r.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),r[n]=r[n]?.filter(a=>a!==i)}},[t])}function H(e,t,o,...r){for(let n of e.current[t][o])n(...r)}function Cu(){let e=wu();return(t,o,...r)=>H(e,t,o,...r)}function ds(e){Be("configureMfa",e)}var ic=f(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),ku=f(require("@heroicons/react/24/solid/DocumentCheckIcon")),Ru=f(require("styled-components"));var Xt=f(require("styled-components"));var ps=f(require("styled-components")),kr=require("react/jsx-runtime"),Rr=({success:e,fail:t})=>(0,kr.jsxs)(kr.Fragment,{children:[(0,kr.jsx)(Zt,{className:e?"success":t?"fail":""}),(0,kr.jsx)(Ql,{className:e?"success":t?"fail":""})]}),Zt=ps.default.span`
13
13
  && {
14
14
  width: 82px;
15
15
  height: 82px;
@@ -277,7 +277,7 @@ Resources:
277
277
  @media all and (display-mode: standalone) {
278
278
  padding-bottom: 30px;
279
279
  }
280
- `;var Tu=f(require("@heroicons/react/24/outline/ArrowLeftIcon")),Pu=f(require("@heroicons/react/24/outline/XMarkIcon")),hs=f(require("styled-components"));var wt=require("react/jsx-runtime"),Eu=()=>(0,wt.jsx)("div",{}),Lv=({backFn:e})=>(0,wt.jsx)("div",{children:(0,wt.jsx)(xu,{onClick:e,children:(0,wt.jsx)(Tu.default,{height:"16px",width:"16px",strokeWidth:2})})}),Ov=e=>(0,wt.jsx)("div",{children:(0,wt.jsx)(xu,{"aria-label":"close modal",onClick:e.onClose,children:(0,wt.jsx)(Pu.default,{height:"16px",width:"16px",strokeWidth:2})})});var _=({backFn:e,onClose:t,title:o,closeable:r=!0})=>{let{closePrivyModal:n}=W(),{app:i}=S();return(0,wt.jsxs)(Dv,{children:[e?(0,wt.jsx)(Lv,{backFn:e}):(0,wt.jsx)(Eu,{}),o&&(0,wt.jsx)(Uv,{id:"privy-dialog-title",children:o}),i?.render.inDialog&&r?(0,wt.jsx)(Ov,{onClose:t||(()=>n())}):(0,wt.jsx)(Eu,{})]})},xu=hs.default.button`
280
+ `;var Tu=f(require("@heroicons/react/24/outline/ArrowLeftIcon")),Pu=f(require("@heroicons/react/24/outline/XMarkIcon")),hs=f(require("styled-components"));var wt=require("react/jsx-runtime"),Eu=()=>(0,wt.jsx)("div",{}),Lv=({backFn:e})=>(0,wt.jsx)("div",{children:(0,wt.jsx)(xu,{onClick:e,children:(0,wt.jsx)(Tu.default,{height:"16px",width:"16px",strokeWidth:2})})}),Ov=e=>(0,wt.jsx)("div",{children:(0,wt.jsx)(xu,{"aria-label":"close modal",onClick:e.onClose,children:(0,wt.jsx)(Pu.default,{height:"16px",width:"16px",strokeWidth:2})})});var A=({backFn:e,onClose:t,title:o,closeable:r=!0})=>{let{closePrivyModal:n}=W(),{app:i}=_();return(0,wt.jsxs)(Dv,{children:[e?(0,wt.jsx)(Lv,{backFn:e}):(0,wt.jsx)(Eu,{}),o&&(0,wt.jsx)(Uv,{id:"privy-dialog-title",children:o}),i?.render.inDialog&&r?(0,wt.jsx)(Ov,{onClose:t||(()=>n())}):(0,wt.jsx)(Eu,{})]})},xu=hs.default.button`
281
281
  && {
282
282
  cursor: pointer;
283
283
  display: flex;
@@ -565,7 +565,7 @@ Resources:
565
565
  width: auto !important;
566
566
  color: white;
567
567
  }
568
- `;var Ge=require("react/jsx-runtime"),Iu=()=>{let{user:e,logout:t}=z(),{app:o,onUserCloseViaDialogOrKeybindRef:r,setModalData:n,navigate:i}=S(),{acceptTerms:a,closePrivyModal:l}=W(),s=m=>{m?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};r.current=s;let c=async m=>{m.preventDefault(),await a(),e&&Kt(e,o?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:h=>console.error(h),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return(0,Ge.jsx)(Fv,{termsAndConditionsUrl:o?.legal.termsAndConditionsUrl,privacyPolicyUrl:o?.legal.privacyPolicyUrl,onAccept:c,onDecline:s})},Fv=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:o,onDecline:r})=>(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(_,{closeable:!1}),(0,Ge.jsx)(ku.default,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),(0,Ge.jsx)(Ne,{style:{marginTop:24},children:"One last step"}),(0,Ge.jsx)(ke,{children:"By signing up, you agree to our terms and privacy policy."}),(0,Ge.jsxs)(eo,{style:{marginTop:24},children:[e&&(0,Ge.jsxs)(ec,{target:"_blank",href:e,children:["View Terms ",(0,Ge.jsx)(ic.default,{style:{marginLeft:"auto"}})]}),t&&(0,Ge.jsxs)(ec,{target:"_blank",href:t,children:["View Privacy Policy ",(0,Ge.jsx)(ic.default,{style:{marginLeft:"auto"}})]})]}),(0,Ge.jsxs)(Bv,{style:{marginTop:24},children:[(0,Ge.jsx)(go,{onClick:r,children:"No thanks"}),(0,Ge.jsx)(F,{onClick:o,children:"Accept"})]}),(0,Ge.jsx)($,{protectedByPrivy:!0})]}),Bv=Ru.default.div`
568
+ `;var Ge=require("react/jsx-runtime"),Iu=()=>{let{user:e,logout:t}=z(),{app:o,onUserCloseViaDialogOrKeybindRef:r,setModalData:n,navigate:i}=_(),{acceptTerms:a,closePrivyModal:l}=W(),s=m=>{m?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};r.current=s;let c=async m=>{m.preventDefault(),await a(),e&&Kt(e,o?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:h=>console.error(h),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return(0,Ge.jsx)(Fv,{termsAndConditionsUrl:o?.legal.termsAndConditionsUrl,privacyPolicyUrl:o?.legal.privacyPolicyUrl,onAccept:c,onDecline:s})},Fv=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:o,onDecline:r})=>(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(A,{closeable:!1}),(0,Ge.jsx)(ku.default,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),(0,Ge.jsx)(Ne,{style:{marginTop:24},children:"One last step"}),(0,Ge.jsx)(ke,{children:"By signing up, you agree to our terms and privacy policy."}),(0,Ge.jsxs)(eo,{style:{marginTop:24},children:[e&&(0,Ge.jsxs)(ec,{target:"_blank",href:e,children:["View Terms ",(0,Ge.jsx)(ic.default,{style:{marginLeft:"auto"}})]}),t&&(0,Ge.jsxs)(ec,{target:"_blank",href:t,children:["View Privacy Policy ",(0,Ge.jsx)(ic.default,{style:{marginLeft:"auto"}})]})]}),(0,Ge.jsxs)(Bv,{style:{marginTop:24},children:[(0,Ge.jsx)(go,{onClick:r,children:"No thanks"}),(0,Ge.jsx)(F,{onClick:o,children:"Accept"})]}),(0,Ge.jsx)($,{protectedByPrivy:!0})]}),Bv=Ru.default.div`
569
569
  display: flex;
570
570
  gap: 10px;
571
571
  `;var Ps=f(require("styled-components"));var Mu=f(require("styled-components")),Es=Mu.default.span`
@@ -583,7 +583,7 @@ Resources:
583
583
  transition: border-color 800ms;
584
584
  border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
585
585
  }
586
- `;var ac=require("react/jsx-runtime"),Ts=({style:e,...t})=>(0,ac.jsx)("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:(0,ac.jsx)("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"})});var He=require("react/jsx-runtime"),Wu=()=>{let{navigate:e,app:t}=S(),o=t?.allowlistConfig.errorTitle||"You don't have access to this app",r=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(_,{}),(0,He.jsxs)(Hv,{children:[(0,He.jsx)(Vv,{children:(0,He.jsxs)("div",{children:[(0,He.jsx)(Es,{}),(0,He.jsx)(Ts,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),(0,He.jsxs)(Gv,{children:[typeof o=="string"?(0,He.jsx)("h3",{children:o}):(0,He.jsx)(He.Fragment,{children:o}),typeof r=="string"?(0,He.jsx)("p",{children:r}):(0,He.jsx)(He.Fragment,{children:r})]}),t?.allowlistConfig.errorCtaLink?(0,He.jsx)(F,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):(0,He.jsx)(F,{onClick:()=>{e("LANDING")},children:n})]})]})},Hv=Ps.default.div`
586
+ `;var ac=require("react/jsx-runtime"),Ts=({style:e,...t})=>(0,ac.jsx)("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:(0,ac.jsx)("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"})});var He=require("react/jsx-runtime"),Wu=()=>{let{navigate:e,app:t}=_(),o=t?.allowlistConfig.errorTitle||"You don't have access to this app",r=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)(A,{}),(0,He.jsxs)(Hv,{children:[(0,He.jsx)(Vv,{children:(0,He.jsxs)("div",{children:[(0,He.jsx)(Es,{}),(0,He.jsx)(Ts,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),(0,He.jsxs)(Gv,{children:[typeof o=="string"?(0,He.jsx)("h3",{children:o}):(0,He.jsx)(He.Fragment,{children:o}),typeof r=="string"?(0,He.jsx)("p",{children:r}):(0,He.jsx)(He.Fragment,{children:r})]}),t?.allowlistConfig.errorCtaLink?(0,He.jsx)(F,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):(0,He.jsx)(F,{onClick:()=>{e("LANDING")},children:n})]})]})},Hv=Ps.default.div`
587
587
  display: flex;
588
588
  flex-direction: column;
589
589
  align-items: center;
@@ -722,7 +722,7 @@ Resources:
722
722
  h3 {
723
723
  margin-bottom: 24px;
724
724
  }
725
- `;var ae=require("react/jsx-runtime"),lc=6,Fu=new Array(lc).fill(""),$v=1400;var zu=()=>{let{app:e,navigate:t,navigateBack:o,setModalData:r,onUserCloseViaDialogOrKeybindRef:n}=S(),{closePrivyModal:i,resendEmailCode:a,resendSmsCode:l,getAuthMeta:s,loginWithCode:c,updateWallets:m}=W(),{authenticated:h,user:g}=z(),[v,b]=(0,Wr.useState)(Fu),[E,x]=(0,Wr.useState)(!1),[T,A]=(0,Wr.useState)(null),[R,I]=(0,Wr.useState)(null);n.current=()=>null;let k=s()?.email?0:1,D=e?.render.inDialog?yt:0,U=e?.render.inDialog?D-500:0;(0,Wr.useEffect)(()=>{if(h&&E&&g){if(e?.legal.requireUsersAcceptTerms&&!g.hasAcceptedTerms){let M=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},U);return()=>clearTimeout(M)}if(Kt(g,e?.embeddedWallets?.createOnLogin)){let M=setTimeout(()=>{r({createWallet:{onSuccess:()=>{},onFailure:pe=>console.error(pe),callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},U);return()=>clearTimeout(M)}else{m();let M=setTimeout(i,D);return()=>clearTimeout(M)}}},[h,E,g]),(0,Wr.useEffect)(()=>{if(T&&R===0){let K=setTimeout(()=>{b(Fu),A(null),document.querySelector("input[name=code-0]")?.focus()},$v);return()=>clearTimeout(K)}},[T]);let B=K=>{K.preventDefault();let M=K.currentTarget.value.replace(" ","");if(M==="")return;if(isNaN(Number(M))){A("Code should be numeric"),I(1);return}A(null),I(null);let pe=Number(K.currentTarget.name?.charAt(5)),he=[...M||[""]].slice(0,lc-pe),Q=[...v.slice(0,pe),...he,...v.slice(pe+he.length)];b(Q);let ct=he.length,Me=Math.min(Math.max(pe+ct,0),lc-1);isNaN(Number(K.currentTarget.value))||document.querySelector(`input[name=code-${Me}]`)?.focus(),Q.every(Tt=>Tt&&!isNaN(+Tt))&&(document.querySelector(`input[name=code-${Me}]`)?.blur(),c(Q.join("")).then(()=>x(!0)).catch(qe=>{qe?.status===422?A("Invalid or expired verification code"):qe instanceof Io&&qe.privyErrorCode==="cannot_link_more_of_type"?A(qe.message):A("Issue verifying code"),I(0)}))},G=K=>{R===1&&(A(null),I(null));let M=[...v.slice(0,K),"",...v.slice(K+1)];b(M),K>0&&document.querySelector(`input[name=code-${K-1}]`)?.focus()},j=k==0?(0,ae.jsx)(Hu.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):(0,ae.jsx)(Gu.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),O=k==0?(0,ae.jsxs)("p",{children:["Please check ",(0,ae.jsx)(Bu,{children:s()?.email})," for an email from privy.io and enter your code below."]}):(0,ae.jsxs)("p",{children:["Please check ",(0,ae.jsx)(Bu,{children:s()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(_,{backFn:()=>o()},"header"),(0,ae.jsxs)(qv,{children:[(0,ae.jsx)(Le,{title:"Enter confirmation code",description:O,icon:j}),(0,ae.jsxs)(Nu,{children:[(0,ae.jsxs)(jv,{children:[(0,ae.jsx)(Kv,{fail:!!T,success:E,children:(0,ae.jsx)("span",{children:T||(E?"Success!":"")})}),(0,ae.jsx)("div",{children:v.map((K,M)=>(0,ae.jsx)("input",{name:`code-${M}`,type:"text",value:v[M],onChange:B,onKeyUp:pe=>{pe.key==="Backspace"&&G(M)},inputMode:"numeric",autoFocus:M===0,pattern:"[0-9]",className:`${E?"success":""} ${T?"fail":""}`,autoComplete:Vu.isMobile?"one-time-code":"off"},M))})]}),(0,ae.jsx)(Yv,{children:k==0?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)("span",{children:"Didn't get an email?"}),(0,ae.jsx)("button",{onClick:a,children:"Resend code"})]}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)("span",{children:"Didn't get a message?"}),(0,ae.jsx)("button",{onClick:l,children:"Resend code"})]})})]})]}),(0,ae.jsx)($,{protectedByPrivy:!0})]})},qv=Hn.default.div`
725
+ `;var ae=require("react/jsx-runtime"),lc=6,Fu=new Array(lc).fill(""),$v=1400;var zu=()=>{let{app:e,navigate:t,navigateBack:o,setModalData:r,onUserCloseViaDialogOrKeybindRef:n}=_(),{closePrivyModal:i,resendEmailCode:a,resendSmsCode:l,getAuthMeta:s,loginWithCode:c,updateWallets:m}=W(),{authenticated:h,user:g}=z(),[v,b]=(0,Wr.useState)(Fu),[T,x]=(0,Wr.useState)(!1),[E,k]=(0,Wr.useState)(null),[I,M]=(0,Wr.useState)(null);n.current=()=>null;let S=s()?.email?0:1,O=e?.render.inDialog?yt:0,D=e?.render.inDialog?O-500:0;(0,Wr.useEffect)(()=>{if(h&&T&&g){if(e?.legal.requireUsersAcceptTerms&&!g.hasAcceptedTerms){let R=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},D);return()=>clearTimeout(R)}if(Kt(g,e?.embeddedWallets?.createOnLogin)){let R=setTimeout(()=>{r({createWallet:{onSuccess:()=>{},onFailure:le=>console.error(le),callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},D);return()=>clearTimeout(R)}else{m();let R=setTimeout(i,O);return()=>clearTimeout(R)}}},[h,T,g]),(0,Wr.useEffect)(()=>{if(E&&I===0){let j=setTimeout(()=>{b(Fu),k(null),document.querySelector("input[name=code-0]")?.focus()},$v);return()=>clearTimeout(j)}},[E]);let B=j=>{j.preventDefault();let R=j.currentTarget.value.replace(" ","");if(R==="")return;if(isNaN(Number(R))){k("Code should be numeric"),M(1);return}k(null),M(null);let le=Number(j.currentTarget.name?.charAt(5)),ue=[...R||[""]].slice(0,lc-le),Q=[...v.slice(0,le),...ue,...v.slice(le+ue.length)];b(Q);let ct=ue.length,Me=Math.min(Math.max(le+ct,0),lc-1);isNaN(Number(j.currentTarget.value))||document.querySelector(`input[name=code-${Me}]`)?.focus(),Q.every(Tt=>Tt&&!isNaN(+Tt))&&(document.querySelector(`input[name=code-${Me}]`)?.blur(),c(Q.join("")).then(()=>x(!0)).catch(qe=>{qe?.status===422?k("Invalid or expired verification code"):qe instanceof Io&&qe.privyErrorCode==="cannot_link_more_of_type"?k(qe.message):k("Issue verifying code"),M(0)}))},G=j=>{I===1&&(k(null),M(null));let R=[...v.slice(0,j),"",...v.slice(j+1)];b(R),j>0&&document.querySelector(`input[name=code-${j-1}]`)?.focus()},K=S==0?(0,ae.jsx)(Hu.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):(0,ae.jsx)(Gu.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),U=S==0?(0,ae.jsxs)("p",{children:["Please check ",(0,ae.jsx)(Bu,{children:s()?.email})," for an email from privy.io and enter your code below."]}):(0,ae.jsxs)("p",{children:["Please check ",(0,ae.jsx)(Bu,{children:s()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(A,{backFn:()=>o()},"header"),(0,ae.jsxs)(qv,{children:[(0,ae.jsx)(Le,{title:"Enter confirmation code",description:U,icon:K}),(0,ae.jsxs)(Nu,{children:[(0,ae.jsxs)(jv,{children:[(0,ae.jsx)(Kv,{fail:!!E,success:T,children:(0,ae.jsx)("span",{children:E||(T?"Success!":"")})}),(0,ae.jsx)("div",{children:v.map((j,R)=>(0,ae.jsx)("input",{name:`code-${R}`,type:"text",value:v[R],onChange:B,onKeyUp:le=>{le.key==="Backspace"&&G(R)},inputMode:"numeric",autoFocus:R===0,pattern:"[0-9]",className:`${T?"success":""} ${E?"fail":""}`,autoComplete:Vu.isMobile?"one-time-code":"off"},R))})]}),(0,ae.jsx)(Yv,{children:S==0?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)("span",{children:"Didn't get an email?"}),(0,ae.jsx)("button",{onClick:a,children:"Resend code"})]}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)("span",{children:"Didn't get a message?"}),(0,ae.jsx)("button",{onClick:l,children:"Resend code"})]})})]})]}),(0,ae.jsx)($,{protectedByPrivy:!0})]})},qv=Hn.default.div`
726
726
  display: flex;
727
727
  flex-direction: column;
728
728
  align-items: flex-start;
@@ -834,14 +834,14 @@ Resources:
834
834
  left: -19px;
835
835
  top: -19px;
836
836
  }
837
- `;var Qe=require("react/jsx-runtime"),Qu=500,ju=Qu*2,Zu=()=>{let{lastScreen:e,currentScreen:t,data:o,navigateBack:r,navigate:n,setModalData:i}=S(),{status:a,token:l,waitForResult:s,reset:c,execute:m}=_e(),h=(0,Ot.useRef)([]),g=K=>{h.current=[K,...h.current]},[v,b]=(0,Ot.useState)(!0);(0,Ot.useEffect)(()=>{let K=setTimeout(b,ju,!1);return g(K),()=>{h.current.forEach(M=>clearTimeout(M)),h.current=[]}},[]);let[E,x]=(0,Ot.useState)(""),[T,A]=(0,Ot.useState)("Checking that you are a human..."),[R,I]=(0,Ot.useState)((0,Qe.jsx)(F,{onClick:()=>{},disabled:!0,children:"Continue"})),[k,D]=(0,Ot.useState)(!1),[U,B]=(0,Ot.useState)(3),G=o?.captchaModalData,j=async K=>{try{await G?.callback(K),G?.onSuccessNavigateTo&&n(G?.onSuccessNavigateTo,!1)}catch(M){if(M instanceof nr)return;{let pe={error:M,previousScreen:e||"LANDING"};i({errorModalData:pe}),n(G?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};(0,Ot.useEffect)(()=>{if(a==="success"){let K=setTimeout(async()=>{let M=await s();!M||G?.userIntentRequired||j(M)},ju);g(K)}else if(a==="ready"){let K=setTimeout(()=>{a==="ready"&&m()},Qu);g(K)}},[a]),(0,Ot.useEffect)(()=>{if(!v)switch(a){case"success":x("Success!"),A("CAPTCHA passed successfully."),I((0,Qe.jsx)(F,{onClick:()=>{D(!0),j(l)},disabled:!G?.userIntentRequired,loading:k,children:G?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":x(""),A("Checking that you are a human..."),I((0,Qe.jsx)(F,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":x("Something went wrong"),U<=0?(A("If you use an adblocker or VPN, try disabling and re-attempting."),I(null)):(A("You did not pass CAPTCHA. Please try again."),I((0,Qe.jsx)(F,{onClick:O,children:"Retry"})));break;case"ready":default:break}},[a,v,k]);let O=async()=>{if(U<=0)return;B(M=>M-1),c(),m();let K=await s();!K||G?.userIntentRequired||j(K)};return(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(_,{backFn:!e||t===e?void 0:r}),(0,Qe.jsxs)(Qv,{children:[a==="success"?(0,Qe.jsx)(Ku.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?(0,Qe.jsx)(Yu.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):(0,Qe.jsx)(qu,{}),(0,Qe.jsxs)(ro,{children:[E?(0,Qe.jsx)("h3",{children:E}):null,(0,Qe.jsx)("p",{children:T})]}),R]}),(0,Qe.jsx)(oe,{})]})},Qv=Ju.default.div`
837
+ `;var Qe=require("react/jsx-runtime"),Qu=500,ju=Qu*2,Zu=()=>{let{lastScreen:e,currentScreen:t,data:o,navigateBack:r,navigate:n,setModalData:i}=_(),{status:a,token:l,waitForResult:s,reset:c,execute:m}=_e(),h=(0,Ot.useRef)([]),g=j=>{h.current=[j,...h.current]},[v,b]=(0,Ot.useState)(!0);(0,Ot.useEffect)(()=>{let j=setTimeout(b,ju,!1);return g(j),()=>{h.current.forEach(R=>clearTimeout(R)),h.current=[]}},[]);let[T,x]=(0,Ot.useState)(""),[E,k]=(0,Ot.useState)("Checking that you are a human..."),[I,M]=(0,Ot.useState)((0,Qe.jsx)(F,{onClick:()=>{},disabled:!0,children:"Continue"})),[S,O]=(0,Ot.useState)(!1),[D,B]=(0,Ot.useState)(3),G=o?.captchaModalData,K=async j=>{try{await G?.callback(j),G?.onSuccessNavigateTo&&n(G?.onSuccessNavigateTo,!1)}catch(R){if(R instanceof nr)return;{let le={error:R,previousScreen:e||"LANDING"};i({errorModalData:le}),n(G?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};(0,Ot.useEffect)(()=>{if(a==="success"){let j=setTimeout(async()=>{let R=await s();!R||G?.userIntentRequired||K(R)},ju);g(j)}else if(a==="ready"){let j=setTimeout(()=>{a==="ready"&&m()},Qu);g(j)}},[a]),(0,Ot.useEffect)(()=>{if(!v)switch(a){case"success":x("Success!"),k("CAPTCHA passed successfully."),M((0,Qe.jsx)(F,{onClick:()=>{O(!0),K(l)},disabled:!G?.userIntentRequired,loading:S,children:G?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":x(""),k("Checking that you are a human..."),M((0,Qe.jsx)(F,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":x("Something went wrong"),D<=0?(k("If you use an adblocker or VPN, try disabling and re-attempting."),M(null)):(k("You did not pass CAPTCHA. Please try again."),M((0,Qe.jsx)(F,{onClick:U,children:"Retry"})));break;case"ready":default:break}},[a,v,S]);let U=async()=>{if(D<=0)return;B(R=>R-1),c(),m();let j=await s();!j||G?.userIntentRequired||K(j)};return(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(A,{backFn:!e||t===e?void 0:r}),(0,Qe.jsxs)(Qv,{children:[a==="success"?(0,Qe.jsx)(Ku.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?(0,Qe.jsx)(Yu.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):(0,Qe.jsx)(qu,{}),(0,Qe.jsxs)(ro,{children:[T?(0,Qe.jsx)("h3",{children:T}):null,(0,Qe.jsx)("p",{children:E})]}),I]}),(0,Qe.jsx)(oe,{})]})},Qv=Ju.default.div`
838
838
  display: flex;
839
839
  flex-direction: column;
840
840
  align-items: center;
841
841
  justify-content: center;
842
842
  gap: 24px;
843
843
  width: 100%;
844
- `;var om=f(require("@heroicons/react/24/outline/WalletIcon")),rm=require("react-device-detect"),nm=f(require("styled-components"));var bt=require("react/jsx-runtime"),Xu=({...e})=>(0,bt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,bt.jsx)("defs",{children:(0,bt.jsxs)("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:[(0,bt.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,bt.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,bt.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,bt.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,bt.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,bt.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,bt.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,bt.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,bt.jsx)("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"}),(0,bt.jsx)("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"})]});var V=require("react/jsx-runtime"),em=({style:e,...t})=>(0,V.jsxs)("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:[(0,V.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,V.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,V.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,V.jsx)("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"})}),(0,V.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,V.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,V.jsx)("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)"}),(0,V.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,V.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,V.jsx)("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),(0,V.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,V.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,V.jsx)("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)"}),(0,V.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,V.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,V.jsxs)("defs",{children:[(0,V.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,V.jsx)("stop",{stopColor:"#174299"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,V.jsxs)("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[(0,V.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,V.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,V.jsx)("stop",{stopColor:"#FF4000"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,V.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,V.jsx)("stop",{stopColor:"#8754C9"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,V.jsxs)("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[(0,V.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,V.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,V.jsx)("stop",{stopColor:"#FFF700"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,V.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,V.jsx)("stop",{stopColor:"#FFF700"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,V.jsxs)("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[(0,V.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,V.jsxs)("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[(0,V.jsx)("stop",{stopColor:"#00AAFF"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,V.jsxs)("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:[(0,V.jsx)("stop",{stopColor:"#00AAFF"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,V.jsx)("clipPath",{id:"clip0_5_32",children:(0,V.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,V.jsx)("clipPath",{id:"clip1_5_32",children:(0,V.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var sr=require("react/jsx-runtime"),tm=({style:e,...t})=>(0,sr.jsxs)("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:[(0,sr.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,sr.jsx)("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"}),(0,sr.jsx)("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"})]}),(0,sr.jsx)("defs",{children:(0,sr.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,sr.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var lr=require("react/jsx-runtime"),Fo={coinbase_wallet:{logo:ki,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:An,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:No,displayName:"Phantom"},rainbow:{logo:em,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Wi,displayName:"WalletConnect"},zerion:{logo:tm,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:Xu,displayName:"Brave Wallet",rdns:"com.brave.wallet"}},Gn=({provider:e,displayName:t,logo:o,connectOnly:r,connector:n})=>{let{navigate:i}=S(),{connectWallet:a}=W(),l=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,s;return n.connectorType==="phantom"?s=()=>{Er()?(a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(rm.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:s=()=>{a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},(0,lr.jsxs)(tw,{onClick:s,children:[(0,lr.jsx)(ew,{icon:Xv(e,n.connectorType)??o,name:n.walletClientType}),(0,lr.jsx)("span",{style:{textTransform:"capitalize"},children:Zv(e,n.connectorType)||t||n.walletClientType}),(0,lr.jsx)("span",{id:"connect-text",children:"Connect"})]})},Zv=(e,t)=>{if(Fo[e]?.displayName)return Fo[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},Xv=(e,t)=>{if(Fo[e]?.logo)return Fo[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Wi},ew=({icon:e,name:t})=>typeof e=="string"?(0,lr.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?(0,lr.jsx)(om.default,{}):e?(0,lr.jsx)(e,{}):null,tw=(0,nm.default)(We)`
844
+ `;var om=f(require("@heroicons/react/24/outline/WalletIcon")),rm=require("react-device-detect"),nm=f(require("styled-components"));var bt=require("react/jsx-runtime"),Xu=({...e})=>(0,bt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,bt.jsx)("defs",{children:(0,bt.jsxs)("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:[(0,bt.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,bt.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,bt.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,bt.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,bt.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,bt.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,bt.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,bt.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,bt.jsx)("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"}),(0,bt.jsx)("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"})]});var V=require("react/jsx-runtime"),em=({style:e,...t})=>(0,V.jsxs)("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:[(0,V.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,V.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,V.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,V.jsx)("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"})}),(0,V.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,V.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,V.jsx)("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)"}),(0,V.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,V.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,V.jsx)("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),(0,V.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,V.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,V.jsx)("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)"}),(0,V.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,V.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,V.jsxs)("defs",{children:[(0,V.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,V.jsx)("stop",{stopColor:"#174299"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,V.jsxs)("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[(0,V.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,V.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,V.jsx)("stop",{stopColor:"#FF4000"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,V.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,V.jsx)("stop",{stopColor:"#8754C9"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,V.jsxs)("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[(0,V.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,V.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,V.jsx)("stop",{stopColor:"#FFF700"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,V.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,V.jsx)("stop",{stopColor:"#FFF700"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,V.jsxs)("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[(0,V.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,V.jsxs)("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[(0,V.jsx)("stop",{stopColor:"#00AAFF"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,V.jsxs)("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:[(0,V.jsx)("stop",{stopColor:"#00AAFF"}),(0,V.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,V.jsx)("clipPath",{id:"clip0_5_32",children:(0,V.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,V.jsx)("clipPath",{id:"clip1_5_32",children:(0,V.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var sr=require("react/jsx-runtime"),tm=({style:e,...t})=>(0,sr.jsxs)("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:[(0,sr.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,sr.jsx)("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"}),(0,sr.jsx)("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"})]}),(0,sr.jsx)("defs",{children:(0,sr.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,sr.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var lr=require("react/jsx-runtime"),Fo={coinbase_wallet:{logo:ki,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:An,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:No,displayName:"Phantom"},rainbow:{logo:em,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Wi,displayName:"WalletConnect"},zerion:{logo:tm,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:Xu,displayName:"Brave Wallet",rdns:"com.brave.wallet"}},Gn=({provider:e,displayName:t,logo:o,connectOnly:r,connector:n})=>{let{navigate:i}=_(),{connectWallet:a}=W(),l=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,s;return n.connectorType==="phantom"?s=()=>{Er()?(a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(rm.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:s=()=>{a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},(0,lr.jsxs)(t1,{onClick:s,children:[(0,lr.jsx)(e1,{icon:Xv(e,n.connectorType)??o,name:n.walletClientType}),(0,lr.jsx)("span",{style:{textTransform:"capitalize"},children:Zv(e,n.connectorType)||t||n.walletClientType}),(0,lr.jsx)("span",{id:"connect-text",children:"Connect"})]})},Zv=(e,t)=>{if(Fo[e]?.displayName)return Fo[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},Xv=(e,t)=>{if(Fo[e]?.logo)return Fo[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Wi},e1=({icon:e,name:t})=>typeof e=="string"?(0,lr.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?(0,lr.jsx)(om.default,{}):e?(0,lr.jsx)(e,{}):null,t1=(0,nm.default)(We)`
845
845
  /* Show "Connect" on hover */
846
846
  > #connect-text {
847
847
  font-weight: 500;
@@ -863,23 +863,23 @@ Resources:
863
863
  display: none;
864
864
  }
865
865
  }
866
- `;var Bo=require("react/jsx-runtime"),ow=["coinbase_wallet"],rw=["metamask","rainbow","zerion"],nw=["phantom"],Vn=({connectOnly:e})=>{let{connectors:t}=W(),{app:o}=S(),r=Li(o.appearance.walletList,t,e,o.appearance.walletList);return(0,Bo.jsxs)(Bo.Fragment,{children:[...r]})},Li=(e,t,o,r)=>{let n=[],i=[],a=[],l=t.find(s=>s.connectorType==="wallet_connect_v2");for(let s of e)if(s==="detected_wallets"){let c=t.filter(({connectorType:m,walletClientType:h})=>m==="injected"&&!r.includes(h));for(let m of c){let{walletClientType:h,walletBranding:g}=m;(h==="unknown"?i:n).push((0,Bo.jsx)(Gn,{connectOnly:o,provider:h,logo:g.icon,displayName:g.name,connector:m},`${s}-${h}`))}}else if(nw.includes(s)){let c=t.find(m=>m.connectorType==="injected"&&m.walletClientType===s||m.connectorType===s);c&&n.push((0,Bo.jsx)(Gn,{connectOnly:o,provider:s,connector:c},s))}else if(rw.includes(s)){let c=t.find(m=>m.connectorType==="injected"&&m.walletClientType===s)??l;c&&n.push((0,Bo.jsx)(Gn,{connectOnly:o,provider:s,connector:c},s))}else if(ow.includes(s)){let c=t.find(({connectorType:m})=>m===s);c&&n.push((0,Bo.jsx)(Gn,{connectOnly:o,provider:s,connector:c},s))}else s==="wallet_connect"&&l&&a.push((0,Bo.jsx)(Gn,{connectOnly:o,provider:s,connector:l},s));return[...i,...n,...a]};var Ho=require("react/jsx-runtime"),im=()=>{let{app:e}=S(),t=`Connect a wallet to ${e?.name}`;return(0,Ho.jsxs)(Ho.Fragment,{children:[(0,Ho.jsx)(_,{},"header"),(0,Ho.jsx)(Uo,{title:"Connect your wallet",description:t}),(0,Ho.jsx)(eo,{children:(0,Ho.jsx)(Vn,{connectOnly:!0})}),(0,Ho.jsx)($,{protectedByPrivy:!0})]})};var dm=f(require("styled-components"));var cm=f(require("styled-components"));var am=f(require("react"));var lm=require("react/jsx-runtime"),sm=()=>{let{app:e}=S(),t=e?.appearance?.logo,o=`${e?.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?(0,lm.jsx)("img",{src:t,alt:o,style:r}):t.type==="svg"||t.type==="img"?am.default.cloneElement(t,{alt:o,style:r}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};var cc=require("react/jsx-runtime"),zn=e=>{let{app:t}=S();return t?.appearance.logo?(0,cc.jsx)(iw,{...e,children:(0,cc.jsx)(sm,{})}):null},iw=cm.default.div`
866
+ `;var Bo=require("react/jsx-runtime"),o1=["coinbase_wallet"],r1=["metamask","rainbow","zerion"],n1=["phantom"],Vn=({connectOnly:e})=>{let{connectors:t}=W(),{app:o}=_(),r=Li(o.appearance.walletList,t,e,o.appearance.walletList);return(0,Bo.jsxs)(Bo.Fragment,{children:[...r]})},Li=(e,t,o,r)=>{let n=[],i=[],a=[],l=t.find(s=>s.connectorType==="wallet_connect_v2");for(let s of e)if(s==="detected_wallets"){let c=t.filter(({connectorType:m,walletClientType:h})=>m==="injected"&&!r.includes(h));for(let m of c){let{walletClientType:h,walletBranding:g}=m;(h==="unknown"?i:n).push((0,Bo.jsx)(Gn,{connectOnly:o,provider:h,logo:g.icon,displayName:g.name,connector:m},`${s}-${h}`))}}else if(n1.includes(s)){let c=t.find(m=>m.connectorType==="injected"&&m.walletClientType===s||m.connectorType===s);c&&n.push((0,Bo.jsx)(Gn,{connectOnly:o,provider:s,connector:c},s))}else if(r1.includes(s)){let c=t.find(m=>m.connectorType==="injected"&&m.walletClientType===s)??l;c&&n.push((0,Bo.jsx)(Gn,{connectOnly:o,provider:s,connector:c},s))}else if(o1.includes(s)){let c=t.find(({connectorType:m})=>m===s);c&&n.push((0,Bo.jsx)(Gn,{connectOnly:o,provider:s,connector:c},s))}else s==="wallet_connect"&&l&&a.push((0,Bo.jsx)(Gn,{connectOnly:o,provider:s,connector:l},s));return[...i,...n,...a]};var Ho=require("react/jsx-runtime"),im=()=>{let{app:e}=_(),t=`Connect a wallet to ${e?.name}`;return(0,Ho.jsxs)(Ho.Fragment,{children:[(0,Ho.jsx)(A,{},"header"),(0,Ho.jsx)(Uo,{title:"Connect your wallet",description:t}),(0,Ho.jsx)(eo,{children:(0,Ho.jsx)(Vn,{connectOnly:!0})}),(0,Ho.jsx)($,{protectedByPrivy:!0})]})};var dm=f(require("styled-components"));var cm=f(require("styled-components"));var am=f(require("react"));var lm=require("react/jsx-runtime"),sm=()=>{let{app:e}=_(),t=e?.appearance?.logo,o=`${e?.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?(0,lm.jsx)("img",{src:t,alt:o,style:r}):t.type==="svg"||t.type==="img"?am.default.cloneElement(t,{alt:o,style:r}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};var cc=require("react/jsx-runtime"),zn=e=>{let{app:t}=_();return t?.appearance.logo?(0,cc.jsx)(i1,{...e,children:(0,cc.jsx)(sm,{})}):null},i1=cm.default.div`
867
867
  display: flex;
868
868
  flex-direction: column;
869
869
  align-items: center;
870
870
  padding: 24px 0;
871
871
  flex-grow: 1;
872
872
  justify-content: center;
873
- `;var bo=require("react/jsx-runtime"),pm=()=>{let{app:e}=S();return(0,bo.jsxs)(bo.Fragment,{children:[(0,bo.jsx)(_,{},"header"),(0,bo.jsx)(aw,{}),(0,bo.jsx)(eo,{children:(0,bo.jsx)(Vn,{connectOnly:!0})}),e&&(0,bo.jsx)(Fn,{app:e,alwaysShowImplicitConsent:!0}),(0,bo.jsx)($,{protectedByPrivy:!0})]})},aw=(0,dm.default)(zn)`
873
+ `;var bo=require("react/jsx-runtime"),pm=()=>{let{app:e}=_();return(0,bo.jsxs)(bo.Fragment,{children:[(0,bo.jsx)(A,{},"header"),(0,bo.jsx)(a1,{}),(0,bo.jsx)(eo,{children:(0,bo.jsx)(Vn,{connectOnly:!0})}),e&&(0,bo.jsx)(Fn,{app:e,alwaysShowImplicitConsent:!0}),(0,bo.jsx)($,{protectedByPrivy:!0})]})},a1=(0,dm.default)(zn)`
874
874
  margin-bottom: 16px;
875
- `;var jn=require("react"),hm=require("react-device-detect"),ym=f(require("styled-components"));var no=require("react"),qn=require("react-device-detect"),mm=require("react-use"),pc=f(require("styled-components"));var $n=require("react");function um(){let[e,t]=(0,$n.useState)(!1),o=(0,$n.useCallback)(()=>{document.hidden&&t(!0)},[]);return(0,$n.useEffect)(()=>(document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)),[o]),{hasTabbedAway:e,reset:()=>t(!1)}}var ve=require("react/jsx-runtime"),dc=2,uc=e=>e?.privyErrorCode==="linked_to_another_user"?or.ERROR_USER_EXISTS:e instanceof nt&&!e.details.default?e.details:e instanceof Pn?or.ERROR_TIMED_OUT:e instanceof xn?or.ERROR_USER_REJECTED_CONNECTION:or.ERROR_WALLET_CONNECTION,fm=()=>{let[e,t]=(0,no.useState)(!1),[o,r]=(0,no.useState)(!1),[n,i]=(0,no.useState)(void 0),{authenticated:a}=z(),{app:l,navigate:s,navigateBack:c,lastScreen:m,currentScreen:h,setModalData:g}=S(),{getAuthFlow:v,walletConnectionStatus:b,closePrivyModal:E,initLoginWithWallet:x,loginWithWallet:T,updateWallets:A}=W(),{walletConnectors:R}=z(),[I,k]=(0,no.useState)(0),{user:D}=z(),[U]=(0,no.useState)(D?.linkedAccounts.length||0),[B,G]=(0,no.useState)(""),[j,O]=(0,no.useState)(!1),{hasTabbedAway:K}=um(),{enabled:M,token:pe}=_e(),he=qn.isMobile&&b?.connector?.connectorType==="wallet_connect_v2"||qn.isMobile&&b?.connector?.connectorType==="coinbase_wallet"||qn.isMobile&&b?.connector?.connectorType==="injected"&&b?.connector?.walletClientType==="phantom",Q=b?.status==="connected",ct=b?.status==="switching_to_supported_chain";(0,no.useEffect)(()=>{let N=v();if(Q&&!N&&(M&&!pe&&!a?(g({captchaModalData:{callback:dt=>x(b.connectedWallet,dt).then(()=>{O(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN",!1)):x(b.connectedWallet,pe).then(()=>{O(!0)})),N&&he&&Q&&!N.preparedMessage){N.buildSiweMessage();return}!N||he||!Q||o||(async()=>{r(!0),i(void 0);try{b?.connector?.connectorType==="wallet_connect_v2"&&b?.connector?.walletClientType==="metamask"&&await Ol(2500),await Tt()}catch(dt){console.warn("Auto-prompted signature failed",dt)}finally{r(!1)}})()},[I,Q,j]),(0,no.useEffect)(()=>{if(D&&e){let N=l?.render.inDialog?yt:0,dt=l?.render.inDialog?N-500:0;if(l?.legal.requireUsersAcceptTerms&&!D.hasAcceptedTerms){let re=setTimeout(()=>{s("AFFIRMATIVE_CONSENT_SCREEN")},dt);return()=>clearTimeout(re)}if(Kt(D,l?.embeddedWallets?.createOnLogin)){let re=setTimeout(()=>{g({createWallet:{onSuccess:()=>{},onFailure:$t=>console.error($t),callAuthOnSuccessOnClose:!0}}),s("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},dt);return()=>clearTimeout(re)}A();let Ti=setTimeout(E,yt);return()=>clearTimeout(Ti)}},[D,e]);let Me=N=>{if(N?.privyErrorCode==="allowlist_rejected"){s("ALLOWLIST_REJECTION_SCREEN");return}i(uc(N))};async function Tt(){try{if(await T(),!l?.render.inDialog)return E();t(!0)}catch(N){Me(N)}finally{r(!1)}}(0,no.useEffect)(()=>{b?.connectError&&Me(b?.connectError)},[b]),(0,mm.useInterval)(()=>{let N=qe==="wallet_connect_v2"&&b?.connector instanceof Oo?b.connector.redirectUri:void 0;N&&G(N)},b?.connector instanceof Oo&&!B?500:null);let qe=b?.connector?.connectorType||"injected",le=b?.connector?.walletClientType||"unknown",Zo=Fo[le]?.displayName||b?.connector?.walletBranding.name||"Browser Extension",lo=Fo[le]?.logo||b?.connector?.walletBranding.icon||(N=>(0,ve.jsx)(_n,{...N})),fn=Zo==="Browser Extension"?Zo.toLowerCase():Zo,Pt;e?Pt=`Successfully connected with ${fn}`:n?Pt=n.message:ct?Pt="Switching networks":Q?Pt=o&&he?"Signing":"Sign to verify":Pt=`Waiting for ${fn}`;let je="Don\u2019t see your wallet? Check your other browser windows.";if(e){let N=D?.linkedAccounts.length||0;U===N?je="Wallet was already linked.":je="You\u2019re good to go!"}else I>=dc&&n?je="Unable to connect wallet":n?je=n.detail:ct?je="Switch your wallet to the requested network.":Q&&he?je="Sign the message in your wallet to verify it belongs to you.":le==="metamask"&&qn.isMobile?je="Click continue to open and connect MetaMask.":le==="metamask"?je="For the best experience, connect only one wallet at a time.":qe==="wallet_connect"?je="Open your mobile wallet app to continue":qe==="coinbase_wallet"&&(lp()||(ql(D)?je="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":je="Open the Coinbase app on your phone to continue."));let Ro=R?.walletConnectors?.find(N=>N.walletClientType==="coinbase_wallet"),hn=le==="coinbase_wallet"&&(ql(D)||n===or.ERROR_USER_EXISTS);return(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)(_,{backFn:!m||h===m?void 0:c}),(0,ve.jsxs)(lw,{children:[(0,ve.jsx)(mc,{walletLogo:lo,success:e,fail:!!n}),(0,ve.jsxs)(ro,{children:[(0,ve.jsx)("h3",{children:Pt}),(0,ve.jsx)("p",{children:je}),!Q&&B&&!K?(0,ve.jsxs)("p",{children:["Still here?"," ",(0,ve.jsx)("a",{href:B,target:"_blank",style:{textDecoration:"underline"},children:"Try again"})]}):null]}),hn?(0,ve.jsx)(F,{onClick:()=>Ro&&Ro?.disconnect(),disabled:e,children:"Use a different wallet"}):n==or.ERROR_USER_EXISTS&&h!==m?(0,ve.jsx)(F,{onClick:c,children:"Use a different wallet"}):Q&&!e&&he?(0,ve.jsx)(F,{onClick:()=>{r(!0),Tt(),sw(le)},disabled:o,children:o?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&I<dc?(0,ve.jsx)(F,{onClick:()=>{k(I+1),i(void 0),Q?(r(!0),Tt()):b?.connectRetry()},disabled:!e&&(!n?.retryable||I>=dc),children:"Retry"}):!e&&!n?(0,ve.jsx)(F,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),(0,ve.jsx)(oe,{})]})},sw=e=>{if(!qn.isMobile||!Jp(e))return;let t=Qp(e);t&&window.open(t,"_self","noopener,noreferrer")},lw=pc.default.div`
875
+ `;var jn=require("react"),hm=require("react-device-detect"),ym=f(require("styled-components"));var no=require("react"),qn=require("react-device-detect"),mm=require("react-use"),pc=f(require("styled-components"));var $n=require("react");function um(){let[e,t]=(0,$n.useState)(!1),o=(0,$n.useCallback)(()=>{document.hidden&&t(!0)},[]);return(0,$n.useEffect)(()=>(document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)),[o]),{hasTabbedAway:e,reset:()=>t(!1)}}var ve=require("react/jsx-runtime"),dc=2,uc=e=>e?.privyErrorCode==="linked_to_another_user"?or.ERROR_USER_EXISTS:e instanceof nt&&!e.details.default?e.details:e instanceof Pn?or.ERROR_TIMED_OUT:e instanceof xn?or.ERROR_USER_REJECTED_CONNECTION:or.ERROR_WALLET_CONNECTION,fm=()=>{let[e,t]=(0,no.useState)(!1),[o,r]=(0,no.useState)(!1),[n,i]=(0,no.useState)(void 0),{authenticated:a}=z(),{app:l,navigate:s,navigateBack:c,lastScreen:m,currentScreen:h,setModalData:g}=_(),{getAuthFlow:v,walletConnectionStatus:b,closePrivyModal:T,initLoginWithWallet:x,loginWithWallet:E,updateWallets:k}=W(),{walletConnectors:I}=z(),[M,S]=(0,no.useState)(0),{user:O}=z(),[D]=(0,no.useState)(O?.linkedAccounts.length||0),[B,G]=(0,no.useState)(""),[K,U]=(0,no.useState)(!1),{hasTabbedAway:j}=um(),{enabled:R,token:le}=_e(),ue=qn.isMobile&&b?.connector?.connectorType==="wallet_connect_v2"||qn.isMobile&&b?.connector?.connectorType==="coinbase_wallet"||qn.isMobile&&b?.connector?.connectorType==="injected"&&b?.connector?.walletClientType==="phantom",Q=b?.status==="connected",ct=b?.status==="switching_to_supported_chain";(0,no.useEffect)(()=>{let N=v();if(Q&&!N&&(R&&!le&&!a?(g({captchaModalData:{callback:dt=>x(b.connectedWallet,dt).then(()=>{U(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN",!1)):x(b.connectedWallet,le).then(()=>{U(!0)})),N&&ue&&Q&&!N.preparedMessage){N.buildSiweMessage();return}!N||ue||!Q||o||(async()=>{r(!0),i(void 0);try{b?.connector?.connectorType==="wallet_connect_v2"&&b?.connector?.walletClientType==="metamask"&&await Ol(2500),await Tt()}catch(dt){console.warn("Auto-prompted signature failed",dt)}finally{r(!1)}})()},[M,Q,K]),(0,no.useEffect)(()=>{if(O&&e){let N=l?.render.inDialog?yt:0,dt=l?.render.inDialog?N-500:0;if(l?.legal.requireUsersAcceptTerms&&!O.hasAcceptedTerms){let re=setTimeout(()=>{s("AFFIRMATIVE_CONSENT_SCREEN")},dt);return()=>clearTimeout(re)}if(Kt(O,l?.embeddedWallets?.createOnLogin)){let re=setTimeout(()=>{g({createWallet:{onSuccess:()=>{},onFailure:$t=>console.error($t),callAuthOnSuccessOnClose:!0}}),s("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},dt);return()=>clearTimeout(re)}k();let Ti=setTimeout(T,yt);return()=>clearTimeout(Ti)}},[O,e]);let Me=N=>{if(N?.privyErrorCode==="allowlist_rejected"){s("ALLOWLIST_REJECTION_SCREEN");return}i(uc(N))};async function Tt(){try{if(await E(),!l?.render.inDialog)return T();t(!0)}catch(N){Me(N)}finally{r(!1)}}(0,no.useEffect)(()=>{b?.connectError&&Me(b?.connectError)},[b]),(0,mm.useInterval)(()=>{let N=qe==="wallet_connect_v2"&&b?.connector instanceof Oo?b.connector.redirectUri:void 0;N&&G(N)},b?.connector instanceof Oo&&!B?500:null);let qe=b?.connector?.connectorType||"injected",ce=b?.connector?.walletClientType||"unknown",Zo=Fo[ce]?.displayName||b?.connector?.walletBranding.name||"Browser Extension",lo=Fo[ce]?.logo||b?.connector?.walletBranding.icon||(N=>(0,ve.jsx)(_n,{...N})),fn=Zo==="Browser Extension"?Zo.toLowerCase():Zo,Pt;e?Pt=`Successfully connected with ${fn}`:n?Pt=n.message:ct?Pt="Switching networks":Q?Pt=o&&ue?"Signing":"Sign to verify":Pt=`Waiting for ${fn}`;let je="Don\u2019t see your wallet? Check your other browser windows.";if(e){let N=O?.linkedAccounts.length||0;D===N?je="Wallet was already linked.":je="You\u2019re good to go!"}else M>=dc&&n?je="Unable to connect wallet":n?je=n.detail:ct?je="Switch your wallet to the requested network.":Q&&ue?je="Sign the message in your wallet to verify it belongs to you.":ce==="metamask"&&qn.isMobile?je="Click continue to open and connect MetaMask.":ce==="metamask"?je="For the best experience, connect only one wallet at a time.":qe==="wallet_connect"?je="Open your mobile wallet app to continue":qe==="coinbase_wallet"&&(lp()||(ql(O)?je="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":je="Open the Coinbase app on your phone to continue."));let Ro=I?.walletConnectors?.find(N=>N.walletClientType==="coinbase_wallet"),hn=ce==="coinbase_wallet"&&(ql(O)||n===or.ERROR_USER_EXISTS);return(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)(A,{backFn:!m||h===m?void 0:c}),(0,ve.jsxs)(l1,{children:[(0,ve.jsx)(mc,{walletLogo:lo,success:e,fail:!!n}),(0,ve.jsxs)(ro,{children:[(0,ve.jsx)("h3",{children:Pt}),(0,ve.jsx)("p",{children:je}),!Q&&B&&!j?(0,ve.jsxs)("p",{children:["Still here?"," ",(0,ve.jsx)("a",{href:B,target:"_blank",style:{textDecoration:"underline"},children:"Try again"})]}):null]}),hn?(0,ve.jsx)(F,{onClick:()=>Ro&&Ro?.disconnect(),disabled:e,children:"Use a different wallet"}):n==or.ERROR_USER_EXISTS&&h!==m?(0,ve.jsx)(F,{onClick:c,children:"Use a different wallet"}):Q&&!e&&ue?(0,ve.jsx)(F,{onClick:()=>{r(!0),Tt(),s1(ce)},disabled:o,children:o?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&M<dc?(0,ve.jsx)(F,{onClick:()=>{S(M+1),i(void 0),Q?(r(!0),Tt()):b?.connectRetry()},disabled:!e&&(!n?.retryable||M>=dc),children:"Retry"}):!e&&!n?(0,ve.jsx)(F,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),(0,ve.jsx)(oe,{})]})},s1=e=>{if(!qn.isMobile||!Jp(e))return;let t=Qp(e);t&&window.open(t,"_self","noopener,noreferrer")},l1=pc.default.div`
876
876
  display: flex;
877
877
  flex-direction: column;
878
878
  align-items: center;
879
879
  justify-content: center;
880
880
  gap: 24px;
881
881
  width: 100%;
882
- `,cw=pc.default.div`
882
+ `,c1=pc.default.div`
883
883
  display: flex;
884
884
  flex-direction: column;
885
885
  justify-content: center;
@@ -902,14 +902,14 @@ Resources:
902
902
  left: -19px;
903
903
  top: -19px;
904
904
  }
905
- `,mc=e=>{let t=e.walletLogo;return(0,ve.jsx)(ve.Fragment,{children:(0,ve.jsx)(cw,{children:(0,ve.jsxs)("div",{children:[(0,ve.jsx)(Rr,{success:e.success,fail:e.fail}),typeof t=="string"?(0,ve.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):(0,ve.jsx)(t,{style:{width:"38px",height:"38px"}})]})})})};var st=require("react/jsx-runtime"),_s=2,gm=()=>{let{navigateBack:e,lastScreen:t,currentScreen:o}=S(),{walletConnectionStatus:r,closePrivyModal:n}=W(),[i,a]=(0,jn.useState)(void 0),[l,s]=(0,jn.useState)(0),c=r?.status==="connected",m=r?.status==="switching_to_supported_chain";(0,jn.useEffect)(()=>{if(c){let R=setTimeout(n,yt);return()=>clearTimeout(R)}},[c]);let h=R=>{a(uc(R))};(0,jn.useEffect)(()=>{r?.connectError&&h(r?.connectError)},[r]);let g=r?.connector?.connectorType||"injected",v=r?.connector?.walletClientType||"unknown",b=Fo[v]?.displayName||r?.connector?.walletBranding.name||"Browser Extension",E=Fo[v]?.logo||r?.connector?.walletBranding.icon||(R=>(0,st.jsx)(_n,{...R})),x=b==="Browser Extension"?b.toLowerCase():b,T;c?T=`Successfully connected with ${x}`:i?T=i.message:m?T="Switching networks":T=`Waiting for ${x}`;let A="Don\u2019t see your wallet? Check your other browser windows.";return c?A="You\u2019re good to go!":l>=_s&&i?A="Unable to connect wallet":i?A=i.detail:m?A="Switch your wallet to the requested network.":v==="metamask"&&hm.isMobile?A="Click to continue to open and connect MetaMask.":v==="metamask"?A="For the best experience, connect only one wallet at a time.":g==="wallet_connect_v2"?A="Open your mobile wallet app to continue":g==="coinbase_wallet"&&(A="Open the Coinbase app on your phone to continue."),(0,st.jsxs)(st.Fragment,{children:[(0,st.jsx)(_,{backFn:o===t?void 0:e}),(0,st.jsxs)(dw,{children:[(0,st.jsx)(mc,{walletLogo:E,success:c,fail:!!i}),(0,st.jsxs)(ro,{children:[(0,st.jsx)("h3",{children:T}),(0,st.jsx)("p",{children:A})]}),i==or.ERROR_USER_EXISTS?(0,st.jsx)(F,{onClick:e,children:"Use a different wallet"}):!c&&i?.retryable&&l<_s?(0,st.jsx)(F,{onClick:()=>{s(l+1),a(void 0),r?.connectRetry()},disabled:!c&&(!i?.retryable||l>=_s),children:"Retry"}):!c&&i&&l>=_s?(0,st.jsx)(F,{onClick:e,children:"Use a different wallet"}):null]}),(0,st.jsx)(oe,{})]})},dw=ym.default.div`
905
+ `,mc=e=>{let t=e.walletLogo;return(0,ve.jsx)(ve.Fragment,{children:(0,ve.jsx)(c1,{children:(0,ve.jsxs)("div",{children:[(0,ve.jsx)(Rr,{success:e.success,fail:e.fail}),typeof t=="string"?(0,ve.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):(0,ve.jsx)(t,{style:{width:"38px",height:"38px"}})]})})})};var st=require("react/jsx-runtime"),_s=2,gm=()=>{let{navigateBack:e,lastScreen:t,currentScreen:o}=_(),{walletConnectionStatus:r,closePrivyModal:n}=W(),[i,a]=(0,jn.useState)(void 0),[l,s]=(0,jn.useState)(0),c=r?.status==="connected",m=r?.status==="switching_to_supported_chain";(0,jn.useEffect)(()=>{if(c){let I=setTimeout(n,yt);return()=>clearTimeout(I)}},[c]);let h=I=>{a(uc(I))};(0,jn.useEffect)(()=>{r?.connectError&&h(r?.connectError)},[r]);let g=r?.connector?.connectorType||"injected",v=r?.connector?.walletClientType||"unknown",b=Fo[v]?.displayName||r?.connector?.walletBranding.name||"Browser Extension",T=Fo[v]?.logo||r?.connector?.walletBranding.icon||(I=>(0,st.jsx)(_n,{...I})),x=b==="Browser Extension"?b.toLowerCase():b,E;c?E=`Successfully connected with ${x}`:i?E=i.message:m?E="Switching networks":E=`Waiting for ${x}`;let k="Don\u2019t see your wallet? Check your other browser windows.";return c?k="You\u2019re good to go!":l>=_s&&i?k="Unable to connect wallet":i?k=i.detail:m?k="Switch your wallet to the requested network.":v==="metamask"&&hm.isMobile?k="Click to continue to open and connect MetaMask.":v==="metamask"?k="For the best experience, connect only one wallet at a time.":g==="wallet_connect_v2"?k="Open your mobile wallet app to continue":g==="coinbase_wallet"&&(k="Open the Coinbase app on your phone to continue."),(0,st.jsxs)(st.Fragment,{children:[(0,st.jsx)(A,{backFn:o===t?void 0:e}),(0,st.jsxs)(d1,{children:[(0,st.jsx)(mc,{walletLogo:T,success:c,fail:!!i}),(0,st.jsxs)(ro,{children:[(0,st.jsx)("h3",{children:E}),(0,st.jsx)("p",{children:k})]}),i==or.ERROR_USER_EXISTS?(0,st.jsx)(F,{onClick:e,children:"Use a different wallet"}):!c&&i?.retryable&&l<_s?(0,st.jsx)(F,{onClick:()=>{s(l+1),a(void 0),r?.connectRetry()},disabled:!c&&(!i?.retryable||l>=_s),children:"Retry"}):!c&&i&&l>=_s?(0,st.jsx)(F,{onClick:e,children:"Use a different wallet"}):null]}),(0,st.jsx)(oe,{})]})},d1=ym.default.div`
906
906
  display: flex;
907
907
  flex-direction: column;
908
908
  align-items: center;
909
909
  justify-content: center;
910
910
  gap: 24px;
911
911
  width: 100%;
912
- `;var Em=f(require("@heroicons/react/24/solid/XCircleIcon")),Jn=require("react"),Tm=f(require("styled-components"));var Oi=f(require("styled-components")),Kn=require("react/jsx-runtime"),Yn=()=>(0,Kn.jsx)(pw,{children:(0,Kn.jsxs)(uw,{children:[(0,Kn.jsx)(mw,{}),(0,Kn.jsx)(fw,{})]})}),pw=Oi.default.div`
912
+ `;var Em=f(require("@heroicons/react/24/solid/XCircleIcon")),Jn=require("react"),Tm=f(require("styled-components"));var Oi=f(require("styled-components")),Kn=require("react/jsx-runtime"),Yn=()=>(0,Kn.jsx)(p1,{children:(0,Kn.jsxs)(u1,{children:[(0,Kn.jsx)(m1,{}),(0,Kn.jsx)(f1,{})]})}),p1=Oi.default.div`
913
913
  display: flex;
914
914
  justify-content: center;
915
915
  align-items: center;
@@ -921,14 +921,14 @@ Resources:
921
921
  @media all and (display-mode: standalone) {
922
922
  margin-bottom: 30px;
923
923
  }
924
- `,uw=Oi.default.div`
924
+ `,u1=Oi.default.div`
925
925
  position: relative;
926
926
  height: 140px;
927
927
  width: 140px;
928
928
 
929
929
  opacity: 1;
930
930
  animation: fadein 200ms ease;
931
- `,mw=Oi.default.div`
931
+ `,m1=Oi.default.div`
932
932
  position: absolute;
933
933
  top: 0;
934
934
  right: 0;
@@ -941,7 +941,7 @@ Resources:
941
941
  border: 4px solid var(--privy-color-accent-light);
942
942
  border-radius: 50%;
943
943
  }
944
- `,fw=Oi.default.div`
944
+ `,f1=Oi.default.div`
945
945
  position: absolute;
946
946
  top: 0;
947
947
  right: 0;
@@ -965,13 +965,13 @@ Resources:
965
965
  transform: rotate(360deg);
966
966
  }
967
967
  }
968
- `;var vm=["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 Ve=class extends Error{constructor(o,r){super(r);this.type=o}};function Jr(e){let t=e.type;return typeof t=="string"&&vm.includes(t)}function hw(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function Qr(e){return Jr(e)&&e.type==="wallet_not_on_device"}function wm(e){return Jr(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function Cm(e){return!!(Jr(e)&&e.type==="insufficient_funds"||e.code==="INSUFFICIENT_FUNDS")}function Zr(e){return!!(Jr(e)&&e.type==="mfa_timeout")}function Xr(e){return!!(Jr(e)&&e.type==="missing_or_invalid_mfa")}function As(e){return!!(Jr(e)&&e.type==="mfa_verification_max_attempts_reached")}function fc(e){return!!(Jr(e)&&e.message.includes("code 429"))}function hc(e){return!!(hw(e)&&e.message==="MFA canceled")}var kt=require("react/jsx-runtime"),bm=1,Pm=()=>{let{authenticated:e,user:t,getAccessToken:o}=z(),{closePrivyModal:r,createAnalyticsEvent:n,walletProxy:i}=W(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=S(),m=(0,Jn.useMemo)(()=>Date.now(),[]),[h,g]=(0,Jn.useState)(!1),{onCompleteNavigateTo:v,onFailure:b}=l?.connectWallet,E=T=>{h||(g(!0),b(typeof T=="string"?new Error(T):T))};(0,Jn.useEffect)(()=>{let T=Ae(t),A;return!e||!T?E("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let I=await o();if(!I)return E("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:I,address:T.address});let k=(Date.now()-m)/1e3;v==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&k<bm?A=setTimeout(()=>{a(v)},(bm-k)*1e3):a(v)}catch(k){if(Qr(k)&&T.recoveryMethod==="privy"){let D=await o();if(!D)return E("User must be authenticated and have a Privy wallet before it can be recovered");try{n("embedded_wallet_pinless_recovery_started",{walletAddress:T.address}),(await i?.recover({address:T.address,accessToken:D}))?.address||E(new Error("Unable to recover wallet")),v?a(v):r({shouldCallAuthOnSuccess:!1}),n("embedded_wallet_recovery_completed",{walletAddress:T.address}),a(v)}catch{E("An error has occurred, please try again.")}}else Qr(k)?(s({...l,recoverWallet:{privyWallet:T,onCompleteNavigateTo:v,onFailure:b}}),a("EMBEDDED_WALLET_RECOVERY_SCREEN")):E(k)}})(),()=>clearTimeout(A)):void 0},[e,t,i]);let x=()=>{E("User exited before wallet could be connected"),r({shouldCallAuthOnSuccess:!1})};return c.current=x,(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(_,{onClose:x}),h?(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsxs)(vo,{children:[(0,kt.jsx)(Em.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,kt.jsx)(Le,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),(0,kt.jsx)(F,{onClick:()=>r({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):(0,kt.jsx)(Yn,{}),(0,kt.jsx)(yw,{})]})},yw=Tm.default.div`
968
+ `;var vm=["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 Ve=class extends Error{constructor(o,r){super(r);this.type=o}};function Jr(e){let t=e.type;return typeof t=="string"&&vm.includes(t)}function h1(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function Qr(e){return Jr(e)&&e.type==="wallet_not_on_device"}function wm(e){return Jr(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function Cm(e){return!!(Jr(e)&&e.type==="insufficient_funds"||e.code==="INSUFFICIENT_FUNDS")}function Zr(e){return!!(Jr(e)&&e.type==="mfa_timeout")}function Xr(e){return!!(Jr(e)&&e.type==="missing_or_invalid_mfa")}function As(e){return!!(Jr(e)&&e.type==="mfa_verification_max_attempts_reached")}function fc(e){return!!(Jr(e)&&e.message.includes("code 429"))}function hc(e){return!!(h1(e)&&e.message==="MFA canceled")}var kt=require("react/jsx-runtime"),bm=1,Pm=()=>{let{authenticated:e,user:t,getAccessToken:o}=z(),{closePrivyModal:r,createAnalyticsEvent:n,walletProxy:i}=W(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=_(),m=(0,Jn.useMemo)(()=>Date.now(),[]),[h,g]=(0,Jn.useState)(!1),{onCompleteNavigateTo:v,onFailure:b}=l?.connectWallet,T=E=>{h||(g(!0),b(typeof E=="string"?new Error(E):E))};(0,Jn.useEffect)(()=>{let E=Ae(t),k;return!e||!E?T("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let M=await o();if(!M)return T("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:M,address:E.address});let S=(Date.now()-m)/1e3;v==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&S<bm?k=setTimeout(()=>{a(v)},(bm-S)*1e3):a(v)}catch(S){if(Qr(S)&&E.recoveryMethod==="privy"){let O=await o();if(!O)return T("User must be authenticated and have a Privy wallet before it can be recovered");try{n("embedded_wallet_pinless_recovery_started",{walletAddress:E.address}),(await i?.recover({address:E.address,accessToken:O}))?.address||T(new Error("Unable to recover wallet")),v?a(v):r({shouldCallAuthOnSuccess:!1}),n("embedded_wallet_recovery_completed",{walletAddress:E.address}),a(v)}catch{T("An error has occurred, please try again.")}}else Qr(S)?(s({...l,recoverWallet:{privyWallet:E,onCompleteNavigateTo:v,onFailure:b}}),a("EMBEDDED_WALLET_RECOVERY_SCREEN")):T(S)}})(),()=>clearTimeout(k)):void 0},[e,t,i]);let x=()=>{T("User exited before wallet could be connected"),r({shouldCallAuthOnSuccess:!1})};return c.current=x,(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(A,{onClose:x}),h?(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsxs)(vo,{children:[(0,kt.jsx)(Em.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,kt.jsx)(Le,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),(0,kt.jsx)(F,{onClick:()=>r({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):(0,kt.jsx)(Yn,{}),(0,kt.jsx)(y1,{})]})},y1=Tm.default.div`
969
969
  height: 44px;
970
- `;var xm=f(require("@heroicons/react/24/solid/CheckCircleIcon")),Sm=require("react");var io=require("react/jsx-runtime"),_m=()=>{let{user:e}=z(),{closePrivyModal:t,isNewUserThisSession:o,updateWallets:r}=W(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=S(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,m=()=>{let h=Ae(e);h?(r(),l(h)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return(0,Sm.useEffect)(()=>{let h=setTimeout(m,Qd);return()=>clearTimeout(h)},[]),a.current=m,(0,io.jsxs)(io.Fragment,{children:[(0,io.jsx)(_,{onClose:m}),(0,io.jsx)(X,{}),(0,io.jsxs)(vo,{children:[(0,io.jsx)(xm.default,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,io.jsx)(Le,{title:o?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:o?"You\u2019ve successfully created an account.":"Your account is secured."})]}),(0,io.jsx)(ee,{}),(0,io.jsx)($,{protectedByPrivy:!0})]})};var Rm=f(require("@heroicons/react/20/solid/ExclamationTriangleIcon")),Im=f(require("@heroicons/react/24/outline/ArrowRightOnRectangleIcon")),cr=require("react"),dr=f(require("styled-components"));var ne=require("react/jsx-runtime"),Mm=()=>{let[e,t]=(0,cr.useState)(null),{authenticated:o,user:r,getAccessToken:n}=z(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=W(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=S(),m=Ae(r)?.address,{onFailure:h,onSuccess:g,origin:v,appId:b}=s.keyExport,E=T=>{i({shouldCallAuthOnSuccess:!1}),h(typeof T=="string"?new Error(T):T)},x=()=>{i({shouldCallAuthOnSuccess:!1}),g(),a("embedded_wallet_key_export_completed",{walletAddress:m})};return(0,cr.useEffect)(()=>{let T=Ae(r);if(!o||!T)return E("User must be authenticated before exporting their wallet");n().then(t,E)},[o,r]),c.current=x,(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(_,{onClose:x}),(0,ne.jsxs)(ww,{children:[(0,ne.jsxs)(Le,{icon:(0,ne.jsx)(Im.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[(0,ne.jsxs)(Tw,{children:[(0,ne.jsx)(vw,{style:{marginRight:6}}),Tr(m)]}),(0,ne.jsx)("p",{children:"You can bring your account with you to another site using an external wallet."})]}),(0,ne.jsxs)(Cw,{children:[(0,ne.jsxs)(Am,{children:[(0,ne.jsx)(km,{children:"1"}),(0,ne.jsxs)("span",{children:[(0,ne.jsx)("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Follow the guide"})," ","to transfer your account to your wallet of choice."]})]}),(0,ne.jsxs)(Am,{children:[(0,ne.jsx)(km,{children:"2"}),(0,ne.jsx)("span",{children:"Copy this key into your other wallet"})]})]}),(0,ne.jsx)("div",{style:{width:"100%"},children:e&&(0,ne.jsx)(gw,{origin:v,appId:b,accessToken:e,clientAnalyticsId:l,address:m,dimensions:{height:"44px"}})}),(0,ne.jsxs)(Pw,{children:[(0,ne.jsxs)("div",{children:[(0,ne.jsx)(Rm.default,{viewBox:"0 0 20 18"}),(0,ne.jsx)("h4",{children:"Warning"})]}),(0,ne.jsx)("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),(0,ne.jsx)($,{protectedByPrivy:!0})]})};function gw(e){let[t,o]=(0,cr.useState)(e.dimensions.width),[r,n]=(0,cr.useState)(void 0),i=(0,cr.useRef)(null);return(0,cr.useEffect)(()=>{if(i.current&&t===void 0){let{width:l}=i.current.getBoundingClientRect();o(l)}let a=getComputedStyle(document.documentElement);n({background2:a.getPropertyValue("--privy-color-background-2"),foreground3:a.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:a.getPropertyValue("--privy-color-foreground-accent"),accent:a.getPropertyValue("--privy-color-accent"),accentDark:a.getPropertyValue("--privy-color-accent-dark"),success:a.getPropertyValue("--privy-color-success")})},[]),(0,ne.jsx)("div",{ref:i,children:t&&(0,ne.jsxs)(bw,{children:[(0,ne.jsx)("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:Aa(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{token:e.accessToken,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...r})}),(0,ne.jsx)(Ew,{children:"Loading..."})]})})}function vw(e){return(0,ne.jsx)("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:(0,ne.jsx)("path",{d:"M14 8.81335C14 7.98493 13.3284 7.31335 12.5 7.31335H10C10 8.41792 9.10457 9.31335 8 9.31335C6.89543 9.31335 6 8.41792 6 7.31335H3.5C2.67157 7.31335 2 7.98493 2 8.81335M14 8.81335V12.8134C14 13.6418 13.3284 14.3134 12.5 14.3134H3.5C2.67157 14.3134 2 13.6418 2 12.8134V8.81335M14 8.81335V6.81335M2 8.81335V6.81335M14 6.81335C14 5.98493 13.3284 5.31335 12.5 5.31335H3.5C2.67157 5.31335 2 5.98493 2 6.81335M14 6.81335V4.81335C14 3.98493 13.3284 3.31335 12.5 3.31335H3.5C2.67157 3.31335 2 3.98493 2 4.81335V6.81335",stroke:"var(--privy-color-foreground-3)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var ww=dr.default.div`
970
+ `;var xm=f(require("@heroicons/react/24/solid/CheckCircleIcon")),Sm=require("react");var io=require("react/jsx-runtime"),_m=()=>{let{user:e}=z(),{closePrivyModal:t,isNewUserThisSession:o,updateWallets:r}=W(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=_(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,m=()=>{let h=Ae(e);h?(r(),l(h)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return(0,Sm.useEffect)(()=>{let h=setTimeout(m,Qd);return()=>clearTimeout(h)},[]),a.current=m,(0,io.jsxs)(io.Fragment,{children:[(0,io.jsx)(A,{onClose:m}),(0,io.jsx)(X,{}),(0,io.jsxs)(vo,{children:[(0,io.jsx)(xm.default,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,io.jsx)(Le,{title:o?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:o?"You\u2019ve successfully created an account.":"Your account is secured."})]}),(0,io.jsx)(ee,{}),(0,io.jsx)($,{protectedByPrivy:!0})]})};var Rm=f(require("@heroicons/react/20/solid/ExclamationTriangleIcon")),Im=f(require("@heroicons/react/24/outline/ArrowRightOnRectangleIcon")),cr=require("react"),dr=f(require("styled-components"));var ne=require("react/jsx-runtime"),Mm=()=>{let[e,t]=(0,cr.useState)(null),{authenticated:o,user:r,getAccessToken:n}=z(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=W(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),m=Ae(r)?.address,{onFailure:h,onSuccess:g,origin:v,appId:b}=s.keyExport,T=E=>{i({shouldCallAuthOnSuccess:!1}),h(typeof E=="string"?new Error(E):E)},x=()=>{i({shouldCallAuthOnSuccess:!1}),g(),a("embedded_wallet_key_export_completed",{walletAddress:m})};return(0,cr.useEffect)(()=>{let E=Ae(r);if(!o||!E)return T("User must be authenticated before exporting their wallet");n().then(t,T)},[o,r]),c.current=x,(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(A,{onClose:x}),(0,ne.jsxs)(w1,{children:[(0,ne.jsxs)(Le,{icon:(0,ne.jsx)(Im.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[(0,ne.jsxs)(T1,{children:[(0,ne.jsx)(v1,{style:{marginRight:6}}),Tr(m)]}),(0,ne.jsx)("p",{children:"You can bring your account with you to another site using an external wallet."})]}),(0,ne.jsxs)(C1,{children:[(0,ne.jsxs)(Am,{children:[(0,ne.jsx)(km,{children:"1"}),(0,ne.jsxs)("span",{children:[(0,ne.jsx)("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Follow the guide"})," ","to transfer your account to your wallet of choice."]})]}),(0,ne.jsxs)(Am,{children:[(0,ne.jsx)(km,{children:"2"}),(0,ne.jsx)("span",{children:"Copy this key into your other wallet"})]})]}),(0,ne.jsx)("div",{style:{width:"100%"},children:e&&(0,ne.jsx)(g1,{origin:v,appId:b,accessToken:e,clientAnalyticsId:l,address:m,dimensions:{height:"44px"}})}),(0,ne.jsxs)(P1,{children:[(0,ne.jsxs)("div",{children:[(0,ne.jsx)(Rm.default,{viewBox:"0 0 20 18"}),(0,ne.jsx)("h4",{children:"Warning"})]}),(0,ne.jsx)("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),(0,ne.jsx)($,{protectedByPrivy:!0})]})};function g1(e){let[t,o]=(0,cr.useState)(e.dimensions.width),[r,n]=(0,cr.useState)(void 0),i=(0,cr.useRef)(null);return(0,cr.useEffect)(()=>{if(i.current&&t===void 0){let{width:l}=i.current.getBoundingClientRect();o(l)}let a=getComputedStyle(document.documentElement);n({background2:a.getPropertyValue("--privy-color-background-2"),foreground3:a.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:a.getPropertyValue("--privy-color-foreground-accent"),accent:a.getPropertyValue("--privy-color-accent"),accentDark:a.getPropertyValue("--privy-color-accent-dark"),success:a.getPropertyValue("--privy-color-success")})},[]),(0,ne.jsx)("div",{ref:i,children:t&&(0,ne.jsxs)(b1,{children:[(0,ne.jsx)("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:Aa(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{token:e.accessToken,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...r})}),(0,ne.jsx)(E1,{children:"Loading..."})]})})}function v1(e){return(0,ne.jsx)("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:(0,ne.jsx)("path",{d:"M14 8.81335C14 7.98493 13.3284 7.31335 12.5 7.31335H10C10 8.41792 9.10457 9.31335 8 9.31335C6.89543 9.31335 6 8.41792 6 7.31335H3.5C2.67157 7.31335 2 7.98493 2 8.81335M14 8.81335V12.8134C14 13.6418 13.3284 14.3134 12.5 14.3134H3.5C2.67157 14.3134 2 13.6418 2 12.8134V8.81335M14 8.81335V6.81335M2 8.81335V6.81335M14 6.81335C14 5.98493 13.3284 5.31335 12.5 5.31335H3.5C2.67157 5.31335 2 5.98493 2 6.81335M14 6.81335V4.81335C14 3.98493 13.3284 3.31335 12.5 3.31335H3.5C2.67157 3.31335 2 3.98493 2 4.81335V6.81335",stroke:"var(--privy-color-foreground-3)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var w1=dr.default.div`
971
971
  display: flex;
972
972
  flex-direction: column;
973
973
  text-align: left;
974
- `,Cw=dr.default.div`
974
+ `,C1=dr.default.div`
975
975
  display: flex;
976
976
  flex-direction: column;
977
977
  gap: 24px;
@@ -1001,11 +1001,11 @@ Resources:
1001
1001
  border-radius: 100%;
1002
1002
  background: var(--privy-color-background);
1003
1003
  color: var(--privy-color-accent);
1004
- `,bw=dr.default.div`
1004
+ `,b1=dr.default.div`
1005
1005
  overflow: visible;
1006
1006
  position: relative;
1007
1007
  height: 44px;
1008
- `,Ew=dr.default.div`
1008
+ `,E1=dr.default.div`
1009
1009
  position: absolute;
1010
1010
  display: flex;
1011
1011
  align-items: center;
@@ -1017,7 +1017,7 @@ Resources:
1017
1017
  border-radius: var(--privy-border-radius-md);
1018
1018
  background-color: var(--privy-color-background-2);
1019
1019
  color: var(--privy-color-foreground-3);
1020
- `,Tw=dr.default.div`
1020
+ `,T1=dr.default.div`
1021
1021
  display: flex;
1022
1022
  align-items: center;
1023
1023
  padding-top: 1px;
@@ -1030,7 +1030,7 @@ Resources:
1030
1030
  font-size: 12px;
1031
1031
  font-weight: 500;
1032
1032
  margin: auto;
1033
- `,Pw=dr.default.div`
1033
+ `,P1=dr.default.div`
1034
1034
  border: 1px solid var(--privy-color-background-2) !important;
1035
1035
  border-radius: var(--privy-border-radius-md);
1036
1036
  padding: 16px;
@@ -1052,7 +1052,7 @@ Resources:
1052
1052
  color: var(--privy-color-error);
1053
1053
  }
1054
1054
  }
1055
- `;var yf=f(require("@heroicons/react/24/solid/XCircleIcon")),Eo=require("react"),gf=f(require("styled-components"));var Hi=require("react");var Bm=f(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),ei=require("react");var Wm=f(require("@heroicons/react/24/outline/ArrowPathIcon")),Nm=f(require("@heroicons/react/24/outline/EyeIcon")),Lm=f(require("@heroicons/react/24/outline/EyeSlashIcon")),Oe=f(require("styled-components"));var xw=Oe.css`
1055
+ `;var yf=f(require("@heroicons/react/24/solid/XCircleIcon")),Eo=require("react"),gf=f(require("styled-components"));var Hi=require("react");var Bm=f(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),ei=require("react");var Wm=f(require("@heroicons/react/24/outline/ArrowPathIcon")),Nm=f(require("@heroicons/react/24/outline/EyeIcon")),Lm=f(require("@heroicons/react/24/outline/EyeSlashIcon")),Oe=f(require("styled-components"));var x1=Oe.css`
1056
1056
  font-size: 14px;
1057
1057
  font-style: normal;
1058
1058
  font-weight: 400;
@@ -1061,7 +1061,7 @@ Resources:
1061
1061
  text-align: left;
1062
1062
  transition: color 0.1s ease-in;
1063
1063
  `,ks=Oe.default.span`
1064
- ${xw}
1064
+ ${x1}
1065
1065
  transition: color 0.1s ease-in;
1066
1066
  color: ${({error:e})=>e?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
1067
1067
  text-transform: ${({error:e})=>e?"":"capitalize"};
@@ -1227,7 +1227,7 @@ Resources:
1227
1227
  transition: all 0.1s ease-out;
1228
1228
  background: ${({label:e})=>e==="Strong"&&"#78dca6"||e==="Medium"&&"var(--privy-color-warn)"||"var(--privy-color-error)"};
1229
1229
  }
1230
- `;var De=require("react/jsx-runtime"),Hm=({buttonHideAnimations:e,buttonLoading:t,password:o,onSubmit:r,onBack:n})=>{let[i,a]=(0,ei.useState)(!0),[l,s]=(0,ei.useState)(!1),[c,m]=(0,ei.useState)(""),h=o===c;return(0,ei.useEffect)(()=>{c&&!l&&s(!0)},[c]),(0,De.jsxs)(De.Fragment,{children:[(0,De.jsx)(_,{title:"Confirm Password",closeable:!1,backFn:n}),(0,De.jsx)(X,{}),(0,De.jsxs)(Nr,{children:[(0,De.jsxs)(Dr,{children:[(0,De.jsx)(Bm.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,De.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),(0,De.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),(0,De.jsxs)(Or,{children:[(0,De.jsx)(en,{value:c,onChange:g=>m(g.target.value),onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text"}),(0,De.jsx)(Qn,{style:{right:"0.75rem"},children:i?(0,De.jsx)(Zn,{onClick:()=>a(!1)}):(0,De.jsx)(Xn,{onClick:()=>a(!0)})})]}),(0,De.jsx)(ks,{"aria-hidden":!l||h,error:!0,children:"Passwords do not match"})]}),(0,De.jsx)(Lr,{onClick:r,loading:t,disabled:!h,hideAnimations:e,children:"Continue"}),(0,De.jsx)(ee,{}),(0,De.jsx)($,{protectedByPrivy:!0})]})};var $m=f(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),qm=require("react"),jm=f(require("styled-components"));var Fi=f(require("styled-components")),Ur=require("react/jsx-runtime"),Gm=({className:e,checked:t,color:o="var(--privy-color-accent)",...r})=>(0,Ur.jsx)("label",{children:(0,Ur.jsxs)(Sw,{className:e,children:[(0,Ur.jsx)(zm,{checked:t,...r}),(0,Ur.jsx)(_w,{color:o,checked:t,children:(0,Ur.jsx)(Vm,{viewBox:"0 0 24 24",children:(0,Ur.jsx)("polyline",{points:"20 6 9 17 4 12"})})})]})}),Sw=Fi.default.div`
1230
+ `;var De=require("react/jsx-runtime"),Hm=({buttonHideAnimations:e,buttonLoading:t,password:o,onSubmit:r,onBack:n})=>{let[i,a]=(0,ei.useState)(!0),[l,s]=(0,ei.useState)(!1),[c,m]=(0,ei.useState)(""),h=o===c;return(0,ei.useEffect)(()=>{c&&!l&&s(!0)},[c]),(0,De.jsxs)(De.Fragment,{children:[(0,De.jsx)(A,{title:"Confirm Password",closeable:!1,backFn:n}),(0,De.jsx)(X,{}),(0,De.jsxs)(Nr,{children:[(0,De.jsxs)(Dr,{children:[(0,De.jsx)(Bm.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,De.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),(0,De.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),(0,De.jsxs)(Or,{children:[(0,De.jsx)(en,{value:c,onChange:g=>m(g.target.value),onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text"}),(0,De.jsx)(Qn,{style:{right:"0.75rem"},children:i?(0,De.jsx)(Zn,{onClick:()=>a(!1)}):(0,De.jsx)(Xn,{onClick:()=>a(!0)})})]}),(0,De.jsx)(ks,{"aria-hidden":!l||h,error:!0,children:"Passwords do not match"})]}),(0,De.jsx)(Lr,{onClick:r,loading:t,disabled:!h,hideAnimations:e,children:"Continue"}),(0,De.jsx)(ee,{}),(0,De.jsx)($,{protectedByPrivy:!0})]})};var $m=f(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),qm=require("react"),jm=f(require("styled-components"));var Fi=f(require("styled-components")),Ur=require("react/jsx-runtime"),Gm=({className:e,checked:t,color:o="var(--privy-color-accent)",...r})=>(0,Ur.jsx)("label",{children:(0,Ur.jsxs)(S1,{className:e,children:[(0,Ur.jsx)(zm,{checked:t,...r}),(0,Ur.jsx)(_1,{color:o,checked:t,children:(0,Ur.jsx)(Vm,{viewBox:"0 0 24 24",children:(0,Ur.jsx)("polyline",{points:"20 6 9 17 4 12"})})})]})}),S1=Fi.default.div`
1231
1231
  display: inline-block;
1232
1232
  vertical-align: middle;
1233
1233
  `,Vm=Fi.default.svg`
@@ -1245,7 +1245,7 @@ Resources:
1245
1245
  position: absolute;
1246
1246
  white-space: nowrap;
1247
1247
  width: 1px;
1248
- `,_w=Fi.default.div`
1248
+ `,_1=Fi.default.div`
1249
1249
  display: inline-block;
1250
1250
  width: 18px;
1251
1251
  height: 18px;
@@ -1267,23 +1267,23 @@ Resources:
1267
1267
  ${Vm} {
1268
1268
  visibility: ${e=>e.checked?"visible":"hidden"};
1269
1269
  }
1270
- `;var Ie=require("react/jsx-runtime"),Km=({buttonHideAnimations:e,buttonLoading:t,onSubmit:o,onBack:r,config:n})=>{let[i,a]=(0,qm.useState)(!1);return(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)(_,{title:"Confirm Password",closeable:!1,backFn:r}),(0,Ie.jsx)(X,{}),(0,Ie.jsxs)(Nr,{children:[(0,Ie.jsxs)(Dr,{children:[(0,Ie.jsx)($m.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),(0,Ie.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),(0,Ie.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),(0,Ie.jsx)(Di,{children:(0,Ie.jsxs)(Ui,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[(0,Ie.jsx)(Gm,{color:"var(--privy-color-error)",checked:i}),(0,Ie.jsx)(Ie.Fragment,{children:"I understand losing my password means losing my account."})]})})]}),(0,Ie.jsxs)(Aw,{children:[n.initiatedBy==="user"&&(0,Ie.jsx)(go,{onClick:n.onCancel,disabled:t,children:"Cancel"}),(0,Ie.jsx)(Lr,{onClick:o,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),(0,Ie.jsx)(ee,{}),(0,Ie.jsx)($,{protectedByPrivy:!0})]})},Aw=jm.default.div`
1270
+ `;var Ie=require("react/jsx-runtime"),Km=({buttonHideAnimations:e,buttonLoading:t,onSubmit:o,onBack:r,config:n})=>{let[i,a]=(0,qm.useState)(!1);return(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)(A,{title:"Confirm Password",closeable:!1,backFn:r}),(0,Ie.jsx)(X,{}),(0,Ie.jsxs)(Nr,{children:[(0,Ie.jsxs)(Dr,{children:[(0,Ie.jsx)($m.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),(0,Ie.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),(0,Ie.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),(0,Ie.jsx)(Di,{children:(0,Ie.jsxs)(Ui,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[(0,Ie.jsx)(Gm,{color:"var(--privy-color-error)",checked:i}),(0,Ie.jsx)(Ie.Fragment,{children:"I understand losing my password means losing my account."})]})})]}),(0,Ie.jsxs)(A1,{children:[n.initiatedBy==="user"&&(0,Ie.jsx)(go,{onClick:n.onCancel,disabled:t,children:"Cancel"}),(0,Ie.jsx)(Lr,{onClick:o,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),(0,Ie.jsx)(ee,{}),(0,Ie.jsx)($,{protectedByPrivy:!0})]})},A1=jm.default.div`
1271
1271
  display: flex;
1272
1272
  gap: 10px;
1273
- `;var rf=f(require("@heroicons/react/24/outline/KeyIcon")),gc=f(require("@heroicons/react/24/solid/CheckCircleIcon")),pr=require("react"),vc=f(require("styled-components"));var Ym=f(require("fast-password-entropy")),Jm=f(require("secure-password-utilities")),Qm=require("secure-password-utilities/wordlists"),kw=95,Rw=8,Iw=3,Mw=.3,Ww=/[a-z]/,Nw=/[A-Z]/,Lw=/[0-9]/,Ow="a-zA-Z0-9",Zm="!@#$%^&*()\\-_+.",Xm=`${Ow}${Zm}`,Dw=new RegExp(`[${Zm}]`),Uw=new RegExp(`[${Xm}]`),ef=new RegExp(`^[${Xm}]{6,}$`),tf=(e="")=>{let t=e.split("").filter(o=>!Uw.test(o)).map(o=>o.replace(" ","SPACE"));return[...new Set(t)]},Rs=()=>Jm.generatePassphrase(4,Qm.DEFAULT_WORDLIST);function Fw(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function Bw(e){if(e.length<Rw)return 0;let t=0;Ww.test(e)&&(t+=1),Nw.test(e)&&(t+=1),Lw.test(e)&&(t+=1),Dw.test(e)&&(t+=1);let o=t/Iw;return Math.max(0,Math.min(1,o))}function Hw(e=""){let t=Bw(e),o=(0,Ym.default)(e)/kw;return(t*Mw+o)/2}function of(e=""){let t=Hw(e);return{value:t,label:Fw(t)}}var se=require("react/jsx-runtime"),nf=({buttonHideAnimations:e,buttonLoading:t,password:o="",config:r,onSubmit:n,onClose:i,onPasswordChange:a,onPasswordGenerate:l})=>{let[s,c]=(0,pr.useState)(!1),[m,h]=(0,pr.useState)(!1);(0,pr.useEffect)(()=>{o&&!m&&h(!0)},[o]);let g=(0,pr.useMemo)(()=>m?(o?.length||0)<6?"Password must be at least 6 characters":ef.test(o||"")?null:`Invalid characters used ( ${tf(o).join(" ")} )`:null,[o,m]),v=(0,pr.useMemo)(()=>g?{value:0,label:"Weak"}:of(o),[o,g]),b=(0,pr.useMemo)(()=>!!(!o?.length||g),[g,o]);return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(_,{onClose:i,title:"Secure your account",closeable:r.initiatedBy==="user"}),(0,se.jsx)(X,{}),(0,se.jsxs)(Nr,{children:[(0,se.jsxs)(Dr,{children:[(0,se.jsx)(rf.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,se.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Set your password"}),(0,se.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),(0,se.jsxs)(Or,{children:[(0,se.jsx)(en,{value:o,onChange:E=>a(E.target.value),placeholder:"enter or generate a strong password",type:s?"password":"text"}),(0,se.jsxs)(Qn,{style:{width:"3.5rem"},children:[s?(0,se.jsx)(Zn,{onClick:()=>c(!1)}):(0,se.jsx)(Xn,{onClick:()=>c(!0)}),(0,se.jsx)(Um,{onClick:l})]})]}),(0,se.jsx)(Fm,{value:v.value===0?.01:v.value,label:v.label}),(0,se.jsx)(ks,{error:!!g,children:g||`Password Strength: ${m?v.label:"--"}`}),(0,se.jsxs)(Vw,{children:[(0,se.jsx)(Gw,{children:(0,se.jsxs)(Di,{children:[(0,se.jsxs)(Ui,{children:[(0,se.jsx)(gc.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),(0,se.jsxs)(Ui,{children:[(0,se.jsx)(gc.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"You will only be asked to enter it when signing on to a new device."]})]})}),(0,se.jsx)(Lr,{onClick:n,loading:t,disabled:b,hideAnimations:e,children:"Continue"})]})]}),(0,se.jsx)(ee,{}),(0,se.jsx)($,{protectedByPrivy:!0})]})},Gw=(0,vc.default)(Di)`
1273
+ `;var rf=f(require("@heroicons/react/24/outline/KeyIcon")),gc=f(require("@heroicons/react/24/solid/CheckCircleIcon")),pr=require("react"),vc=f(require("styled-components"));var Ym=f(require("fast-password-entropy")),Jm=f(require("secure-password-utilities")),Qm=require("secure-password-utilities/wordlists"),k1=95,R1=8,I1=3,M1=.3,W1=/[a-z]/,N1=/[A-Z]/,L1=/[0-9]/,O1="a-zA-Z0-9",Zm="!@#$%^&*()\\-_+.",Xm=`${O1}${Zm}`,D1=new RegExp(`[${Zm}]`),U1=new RegExp(`[${Xm}]`),ef=new RegExp(`^[${Xm}]{6,}$`),tf=(e="")=>{let t=e.split("").filter(o=>!U1.test(o)).map(o=>o.replace(" ","SPACE"));return[...new Set(t)]},Rs=()=>Jm.generatePassphrase(4,Qm.DEFAULT_WORDLIST);function F1(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function B1(e){if(e.length<R1)return 0;let t=0;W1.test(e)&&(t+=1),N1.test(e)&&(t+=1),L1.test(e)&&(t+=1),D1.test(e)&&(t+=1);let o=t/I1;return Math.max(0,Math.min(1,o))}function H1(e=""){let t=B1(e),o=(0,Ym.default)(e)/k1;return(t*M1+o)/2}function of(e=""){let t=H1(e);return{value:t,label:F1(t)}}var se=require("react/jsx-runtime"),nf=({buttonHideAnimations:e,buttonLoading:t,password:o="",config:r,onSubmit:n,onClose:i,onPasswordChange:a,onPasswordGenerate:l})=>{let[s,c]=(0,pr.useState)(!1),[m,h]=(0,pr.useState)(!1);(0,pr.useEffect)(()=>{o&&!m&&h(!0)},[o]);let g=(0,pr.useMemo)(()=>m?(o?.length||0)<6?"Password must be at least 6 characters":ef.test(o||"")?null:`Invalid characters used ( ${tf(o).join(" ")} )`:null,[o,m]),v=(0,pr.useMemo)(()=>g?{value:0,label:"Weak"}:of(o),[o,g]),b=(0,pr.useMemo)(()=>!!(!o?.length||g),[g,o]);return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(A,{onClose:i,title:"Secure your account",closeable:r.initiatedBy==="user"}),(0,se.jsx)(X,{}),(0,se.jsxs)(Nr,{children:[(0,se.jsxs)(Dr,{children:[(0,se.jsx)(rf.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,se.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Set your password"}),(0,se.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),(0,se.jsxs)(Or,{children:[(0,se.jsx)(en,{value:o,onChange:T=>a(T.target.value),placeholder:"enter or generate a strong password",type:s?"password":"text"}),(0,se.jsxs)(Qn,{style:{width:"3.5rem"},children:[s?(0,se.jsx)(Zn,{onClick:()=>c(!1)}):(0,se.jsx)(Xn,{onClick:()=>c(!0)}),(0,se.jsx)(Um,{onClick:l})]})]}),(0,se.jsx)(Fm,{value:v.value===0?.01:v.value,label:v.label}),(0,se.jsx)(ks,{error:!!g,children:g||`Password Strength: ${m?v.label:"--"}`}),(0,se.jsxs)(V1,{children:[(0,se.jsx)(G1,{children:(0,se.jsxs)(Di,{children:[(0,se.jsxs)(Ui,{children:[(0,se.jsx)(gc.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),(0,se.jsxs)(Ui,{children:[(0,se.jsx)(gc.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"You will only be asked to enter it when signing on to a new device."]})]})}),(0,se.jsx)(Lr,{onClick:n,loading:t,disabled:b,hideAnimations:e,children:"Continue"})]})]}),(0,se.jsx)(ee,{}),(0,se.jsx)($,{protectedByPrivy:!0})]})},G1=(0,vc.default)(Di)`
1274
1274
  flex: 1;
1275
1275
  padding-top: 1rem;
1276
- `,Vw=vc.default.div`
1276
+ `,V1=vc.default.div`
1277
1277
  display: flex;
1278
1278
  flex-direction: column;
1279
1279
  height: 100%;
1280
- `;var af=f(require("@heroicons/react/24/outline/ArrowDownTrayIcon")),sf=f(require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon")),lf=f(require("@heroicons/react/24/outline/DocumentDuplicateIcon")),cf=f(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Bi=require("react");var we=require("react/jsx-runtime"),df=({buttonHideAnimations:e,buttonLoading:t,appName:o,password:r,onSubmit:n,onBack:i})=>{let[a,l]=(0,Bi.useState)(!1),s=(0,Bi.useCallback)(()=>{l(!0),r&&navigator.clipboard.writeText(r)},[r]),c=(0,Bi.useCallback)(()=>{let m=document.createElement("a"),h=o.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),g=new Blob([zw(o,r)],{type:"text/plain"}),v=URL.createObjectURL(g);m.href=v,m.target="_blank",m.download=`${h}-privy-wallet-recovery.txt`,document.body.appendChild(m),m.click(),setTimeout(()=>{m.remove(),URL.revokeObjectURL(v)},5e3)},[r]);return(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(_,{backFn:i,title:"Save Password",closeable:!1}),(0,we.jsx)(X,{}),(0,we.jsxs)(Nr,{children:[(0,we.jsxs)(Dr,{children:[(0,we.jsx)(cf.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,we.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),(0,we.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset if you lose your device. Make sure to secure it to keep your assets safe."})]}),(0,we.jsx)(Or,{centered:!0,children:(0,we.jsx)(Dm,{children:r})}),(0,we.jsxs)("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[(0,we.jsx)(yc,{onClick:s,children:a?(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(sf.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(lf.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),(0,we.jsxs)(yc,{onClick:c,children:[(0,we.jsx)(af.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),(0,we.jsx)(Lr,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),(0,we.jsx)(ee,{}),(0,we.jsx)($,{protectedByPrivy:!0})]})},zw=(e,t)=>`Your wallet recovery password for ${e} is
1280
+ `;var af=f(require("@heroicons/react/24/outline/ArrowDownTrayIcon")),sf=f(require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon")),lf=f(require("@heroicons/react/24/outline/DocumentDuplicateIcon")),cf=f(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Bi=require("react");var we=require("react/jsx-runtime"),df=({buttonHideAnimations:e,buttonLoading:t,appName:o,password:r,onSubmit:n,onBack:i})=>{let[a,l]=(0,Bi.useState)(!1),s=(0,Bi.useCallback)(()=>{l(!0),r&&navigator.clipboard.writeText(r)},[r]),c=(0,Bi.useCallback)(()=>{let m=document.createElement("a"),h=o.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),g=new Blob([z1(o,r)],{type:"text/plain"}),v=URL.createObjectURL(g);m.href=v,m.target="_blank",m.download=`${h}-privy-wallet-recovery.txt`,document.body.appendChild(m),m.click(),setTimeout(()=>{m.remove(),URL.revokeObjectURL(v)},5e3)},[r]);return(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(A,{backFn:i,title:"Save Password",closeable:!1}),(0,we.jsx)(X,{}),(0,we.jsxs)(Nr,{children:[(0,we.jsxs)(Dr,{children:[(0,we.jsx)(cf.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,we.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),(0,we.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset if you lose your device. Make sure to secure it to keep your assets safe."})]}),(0,we.jsx)(Or,{centered:!0,children:(0,we.jsx)(Dm,{children:r})}),(0,we.jsxs)("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[(0,we.jsx)(yc,{onClick:s,children:a?(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(sf.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(lf.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),(0,we.jsxs)(yc,{onClick:c,children:[(0,we.jsx)(af.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),(0,we.jsx)(Lr,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),(0,we.jsx)(ee,{}),(0,we.jsx)($,{protectedByPrivy:!0})]})},z1=(e,t)=>`Your wallet recovery password for ${e} is
1281
1281
 
1282
1282
  ${t}
1283
1283
 
1284
- You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var pf=f(require("@heroicons/react/24/solid/CheckCircleIcon")),uf=f(require("@heroicons/react/24/solid/XCircleIcon"));var lt=require("react/jsx-runtime"),mf=({error:e,onClose:t})=>(0,lt.jsxs)(lt.Fragment,{children:[(0,lt.jsx)(_,{closeable:!1}),(0,lt.jsx)(X,{}),e?(0,lt.jsxs)(vo,{children:[(0,lt.jsx)(uf.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,lt.jsx)(Le,{title:"Something went wrong",description:e})]}):(0,lt.jsxs)(vo,{children:[(0,lt.jsx)(pf.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,lt.jsx)(Le,{title:"Success"})]}),(0,lt.jsx)(F,{onClick:t,children:"Close"}),(0,lt.jsx)(ee,{}),(0,lt.jsx)($,{protectedByPrivy:!0})]});var ff=require("react"),$w=(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}},hf=()=>{let[e,t]=(0,ff.useReducer)($w,"creating");return{send:t,state:e}};var ti=require("react/jsx-runtime"),Is=({onSubmit:e,...t})=>{let{send:o,state:r}=hf(),n=(0,Hi.useCallback)(async()=>{r==="finalizing"&&await e(),o("next")},[r,o,e]);(0,Hi.useEffect)(()=>{let a;return r==="done"&&t.config.initiatedBy==="automatic"&&(a=setTimeout(()=>t.onClose?.(),yt)),()=>{a&&clearTimeout(a)}},[r,t.config.initiatedBy,t.onClose]);let i=(0,Hi.useCallback)(()=>{o("back")},[o]);return r==="creating"?(0,ti.jsx)(nf,{...t,onSubmit:n}):r==="saving"?(0,ti.jsx)(df,{...t,onSubmit:n,onBack:i}):r==="confirming"?(0,ti.jsx)(Hm,{...t,onSubmit:n,onBack:i}):r==="finalizing"?(0,ti.jsx)(Km,{...t,onSubmit:n,onBack:i}):r==="done"?(0,ti.jsx)(mf,{...t,onSubmit:n}):null};var Dt=require("react/jsx-runtime"),vf=()=>{let{app:e,navigate:t,data:o,onUserCloseViaDialogOrKeybindRef:r}=S(),[n,i]=(0,Eo.useState)(""),[a,l]=(0,Eo.useState)(!1),[s,c]=(0,Eo.useState)(),[m,h]=(0,Eo.useState)(null),[g,v]=(0,Eo.useState)(null),b=(0,Eo.useRef)(!1),{authenticated:E,getAccessToken:x}=z(),{refreshUser:T,closePrivyModal:A,createAnalyticsEvent:R,isNewUserThisSession:I,initializeWalletProxy:k}=W(),{onSuccess:D,onFailure:U,callAuthOnSuccessOnClose:B}=o.createWallet,G=e?.embeddedWallets.requireUserPasswordOnCreate===!0,j=!!(!n||b.current)&&!G,O=new ht(async()=>M());(0,Eo.useEffect)(()=>{m||k(3e4).then(he=>h(he))},[m]),(0,Eo.useEffect)(()=>{if(!E){t("LANDING"),U(new Error("User must be authenticated before creating a Privy wallet"));return}!G&&!a&&!b.current&&(l(!0),O.execute().finally(()=>l(!1)))},[G,E]);let K=()=>{G&&g&&g?.recoveryMethod!=="user-passcode"?U(new Nt("User created a wallet but failed to set a password for it")):g?D(g):U(new Nt("User wallet creation failed")),A({shouldCallAuthOnSuccess:B})};r.current=()=>null;let M=async function(){let he=await x();if(he)try{R("embedded_wallet_creation_started");let Q=await k(En);if(!Q)throw new Error("walletProxy does not exist.");let ct=1e4,Me=new Promise((Zo,lo)=>{setTimeout(()=>{lo(new Error("walletProxy.create timed out."))},ct)});if(!await Promise.race([Q.create({accessToken:he,recoveryPassword:s}),Me]))throw new Error("walletProxy.create did not send a response.");let qe=await T();if(!qe)throw new Error("Failed to refresh user.");let le=Ae(qe);if(!le)throw new Error("Updated user is missing embedded wallet.");v(le),R("embedded_wallet_creation_completed",{walletAddress:le.address}),i(""),b.current=!0,G?t("EMBEDDED_WALLET_CREATED_SCREEN"):I?t("EMBEDDED_WALLET_CREATED_SCREEN"):le&&(D(le),A({shouldCallAuthOnSuccess:B}))}catch(Q){if(b.current)return;R("embedded_wallet_creation_failed",{error:Q.toString()}),i("An error has occurred, please try again."),console.warn(Q)}else i("An error has occured, please login again."),R("embedded_wallet_creation_failed",{error:"Missing access token for user."})},pe=async()=>{if(!G)return A({shouldCallAuthOnSuccess:B});l(!0);let he=250;return O.execute().then(()=>new Promise(Q=>setTimeout(Q,he))).finally(()=>l(!1))};return!G&&n?(0,Dt.jsxs)(Dt.Fragment,{children:[(0,Dt.jsx)(_,{closeable:!1}),(0,Dt.jsxs)(vo,{children:[(0,Dt.jsx)(yf.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Dt.jsx)(Le,{title:"Something went wrong",description:n})]}),(0,Dt.jsx)(F,{onClick:K,children:"Close"}),(0,Dt.jsx)(qw,{})]}):j?(0,Dt.jsx)(Yn,{}):(0,Dt.jsx)(Is,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:j||!m,buttonLoading:a,buttonHideAnimations:!g&&a,error:n,password:s||"",onClose:K,onPasswordChange:c,onPasswordGenerate:()=>c(Rs()),onSubmit:pe})},qw=gf.default.div`
1284
+ You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var pf=f(require("@heroicons/react/24/solid/CheckCircleIcon")),uf=f(require("@heroicons/react/24/solid/XCircleIcon"));var lt=require("react/jsx-runtime"),mf=({error:e,onClose:t})=>(0,lt.jsxs)(lt.Fragment,{children:[(0,lt.jsx)(A,{closeable:!1}),(0,lt.jsx)(X,{}),e?(0,lt.jsxs)(vo,{children:[(0,lt.jsx)(uf.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,lt.jsx)(Le,{title:"Something went wrong",description:e})]}):(0,lt.jsxs)(vo,{children:[(0,lt.jsx)(pf.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,lt.jsx)(Le,{title:"Success"})]}),(0,lt.jsx)(F,{onClick:t,children:"Close"}),(0,lt.jsx)(ee,{}),(0,lt.jsx)($,{protectedByPrivy:!0})]});var ff=require("react"),$1=(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}},hf=()=>{let[e,t]=(0,ff.useReducer)($1,"creating");return{send:t,state:e}};var ti=require("react/jsx-runtime"),Is=({onSubmit:e,...t})=>{let{send:o,state:r}=hf(),n=(0,Hi.useCallback)(async()=>{r==="finalizing"&&await e(),o("next")},[r,o,e]);(0,Hi.useEffect)(()=>{let a;return r==="done"&&t.config.initiatedBy==="automatic"&&(a=setTimeout(()=>t.onClose?.(),yt)),()=>{a&&clearTimeout(a)}},[r,t.config.initiatedBy,t.onClose]);let i=(0,Hi.useCallback)(()=>{o("back")},[o]);return r==="creating"?(0,ti.jsx)(nf,{...t,onSubmit:n}):r==="saving"?(0,ti.jsx)(df,{...t,onSubmit:n,onBack:i}):r==="confirming"?(0,ti.jsx)(Hm,{...t,onSubmit:n,onBack:i}):r==="finalizing"?(0,ti.jsx)(Km,{...t,onSubmit:n,onBack:i}):r==="done"?(0,ti.jsx)(mf,{...t,onSubmit:n}):null};var Dt=require("react/jsx-runtime"),vf=()=>{let{app:e,navigate:t,data:o,onUserCloseViaDialogOrKeybindRef:r}=_(),[n,i]=(0,Eo.useState)(""),[a,l]=(0,Eo.useState)(!1),[s,c]=(0,Eo.useState)(),[m,h]=(0,Eo.useState)(null),[g,v]=(0,Eo.useState)(null),b=(0,Eo.useRef)(!1),{authenticated:T,getAccessToken:x}=z(),{refreshUser:E,closePrivyModal:k,createAnalyticsEvent:I,isNewUserThisSession:M,initializeWalletProxy:S}=W(),{onSuccess:O,onFailure:D,callAuthOnSuccessOnClose:B}=o.createWallet,G=e?.embeddedWallets.requireUserPasswordOnCreate===!0,K=!!(!n||b.current)&&!G,U=new ht(async()=>R());(0,Eo.useEffect)(()=>{m||S(3e4).then(ue=>h(ue))},[m]),(0,Eo.useEffect)(()=>{if(!T){t("LANDING"),D(new Error("User must be authenticated before creating a Privy wallet"));return}!G&&!a&&!b.current&&(l(!0),U.execute().finally(()=>l(!1)))},[G,T]);let j=()=>{G&&g&&g?.recoveryMethod!=="user-passcode"?D(new Nt("User created a wallet but failed to set a password for it")):g?O(g):D(new Nt("User wallet creation failed")),k({shouldCallAuthOnSuccess:B})};r.current=()=>null;let R=async function(){let ue=await x();if(ue)try{I("embedded_wallet_creation_started");let Q=await S(En);if(!Q)throw new Error("walletProxy does not exist.");let ct=1e4,Me=new Promise((Zo,lo)=>{setTimeout(()=>{lo(new Error("walletProxy.create timed out."))},ct)});if(!await Promise.race([Q.create({accessToken:ue,recoveryPassword:s}),Me]))throw new Error("walletProxy.create did not send a response.");let qe=await E();if(!qe)throw new Error("Failed to refresh user.");let ce=Ae(qe);if(!ce)throw new Error("Updated user is missing embedded wallet.");v(ce),I("embedded_wallet_creation_completed",{walletAddress:ce.address}),i(""),b.current=!0,G?t("EMBEDDED_WALLET_CREATED_SCREEN"):M?t("EMBEDDED_WALLET_CREATED_SCREEN"):ce&&(O(ce),k({shouldCallAuthOnSuccess:B}))}catch(Q){if(b.current)return;I("embedded_wallet_creation_failed",{error:Q.toString()}),i("An error has occurred, please try again."),console.warn(Q)}else i("An error has occured, please login again."),I("embedded_wallet_creation_failed",{error:"Missing access token for user."})},le=async()=>{if(!G)return k({shouldCallAuthOnSuccess:B});l(!0);let ue=250;return U.execute().then(()=>new Promise(Q=>setTimeout(Q,ue))).finally(()=>l(!1))};return!G&&n?(0,Dt.jsxs)(Dt.Fragment,{children:[(0,Dt.jsx)(A,{closeable:!1}),(0,Dt.jsxs)(vo,{children:[(0,Dt.jsx)(yf.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Dt.jsx)(Le,{title:"Something went wrong",description:n})]}),(0,Dt.jsx)(F,{onClick:j,children:"Close"}),(0,Dt.jsx)(q1,{})]}):K?(0,Dt.jsx)(Yn,{}):(0,Dt.jsx)(Is,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:K||!m,buttonLoading:a,buttonHideAnimations:!g&&a,error:n,password:s||"",onClose:j,onPasswordChange:c,onPasswordGenerate:()=>c(Rs()),onSubmit:le})},q1=gf.default.div`
1285
1285
  height: 44px;
1286
- `;var tn=require("react");var Cf=require("react/jsx-runtime"),wf=()=>{let[e,t]=(0,tn.useState)(null),[o,r]=(0,tn.useState)(!1),[n,i]=(0,tn.useState)(null),[a,l]=(0,tn.useState)(""),{authenticated:s,getAccessToken:c,user:m}=z(),{walletProxy:h,refreshUser:g,closePrivyModal:v,createAnalyticsEvent:b}=W(),{app:E,navigate:x,data:T,onUserCloseViaDialogOrKeybindRef:A}=S(),{onSuccess:R,onFailure:I}=T.createWallet,k=Ae(m),D=e?.recoveryMethod==="user-passcode";(0,tn.useEffect)(()=>{s||(x("LANDING"),I(new fa("User must be authenticated before setting a password on a Privy wallet")))},[s]);let U=()=>{if(n){I(n),v({shouldCallAuthOnSuccess:!1});return}if(!D){I(new Nt("Exited before password was added to wallet")),v({shouldCallAuthOnSuccess:!1});return}R(e),v({shouldCallAuthOnSuccess:!1})};A.current=U;let B=async()=>{let j=await c();if(j&&k?.address&&a&&h)try{if(b("embedded_wallet_set_password_started",{walletAddress:k.address}),!(await h.setRecoveryPassword({accessToken:j,address:k.address,recoveryPassword:a})).address){i(new Nt("Error setting password on privy wallet")),b("embedded_wallet_set_password_failed",{walletAddress:k.address,reason:"error setting password"});return}let K=await g(),M=Ae(K);if(!M){i(new Nt("Error setting password on privy wallet")),b("embedded_wallet_set_password_failed",{walletAddress:k.address,reason:"wallet disconnected"});return}t(M),b("embedded_wallet_set_password_completed",{walletAddress:k.address})}catch(O){console.warn(O),i(O instanceof Error?O:new Error("Error setting password on privy wallet")),b("embedded_wallet_set_password_failed",{walletAddress:k.address,reason:O})}},G=async()=>{D?(R(e),v({shouldCallAuthOnSuccess:!1})):(r(!0),i(null),await B(),r(!1))};return(0,Cf.jsx)(Is,{appName:E?.name||"privy",config:{initiatedBy:"user",onCancel:U},error:n?"An error has occurred, please try again.":void 0,buttonLoading:o,buttonHideAnimations:!1,password:a,onPasswordGenerate:()=>l(Rs()),onPasswordChange:l,onSubmit:G,onClose:U})};var bf=f(require("@heroicons/react/24/outline/UserCircleIcon")),Ef=f(require("@heroicons/react/24/solid/LockClosedIcon"));var et=require("react/jsx-runtime"),Tf=()=>{let{user:e}=z(),{closePrivyModal:t,createAnalyticsEvent:o}=W(),{data:r,setModalData:n,navigate:i,onUserCloseViaDialogOrKeybindRef:a}=S(),{onSuccess:l,onFailure:s}=r.setWalletPassword,c=()=>{s(new Nt("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return a.current=c,(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(_,{onClose:c}),(0,et.jsx)(X,{}),(0,et.jsxs)(vo,{children:[(0,et.jsxs)(Ou,{children:[(0,et.jsx)(bf.default,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,et.jsx)(Du,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:(0,et.jsx)(Ef.default,{width:"12px",height:"12px",fill:"white"})})]}),(0,et.jsxs)(Le,{title:"Secure Your Account",children:["Please set a password to secure your account.",(0,et.jsx)("p",{children:"Losing this password will make your account inaccessible on new devices. You will only be asked for it when you log on to a new device."})]})]}),(0,et.jsx)(F,{onClick:()=>{let h=Ae(e);o("embedded_wallet_set_password_started",{walletAddress:h?.address}),n({createWallet:{onFailure:s,onSuccess:l,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),i("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),(0,et.jsx)(ee,{}),(0,et.jsx)($,{protectedByPrivy:!0})]})};var Pf=f(require("@heroicons/react/24/outline/ShieldCheckIcon")),on=require("react"),rn=f(require("styled-components"));var Ee=require("react/jsx-runtime"),xf=()=>{let[e,t]=(0,on.useState)(!0),{authenticated:o,getAccessToken:r}=z(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=W(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=S(),[m,h]=(0,on.useState)(void 0),[g,v]=(0,on.useState)(""),[b,E]=(0,on.useState)(!1),{privyWallet:x,onCompleteNavigateTo:T,onSuccess:A,onFailure:R}=s.recoverWallet,I=(U="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),R(typeof U=="string"?new Nt(U):U)};c.current=I,(0,on.useEffect)(()=>{if(!o||!x)return I("User must be authenticated and have a Privy wallet before it can be recovered")},[o]);let k=U=>{U&&h(U)};return(0,Ee.jsxs)(Ee.Fragment,{children:[(0,Ee.jsx)(_,{onClose:I}),(0,Ee.jsx)(X,{}),(0,Ee.jsxs)(Kw,{children:[(0,Ee.jsxs)(jw,{children:[(0,Ee.jsx)(Pf.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Ee.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Load your account"}),(0,Ee.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),(0,Ee.jsxs)("div",{children:[(0,Ee.jsxs)(Or,{children:[(0,Ee.jsx)(en,{type:e?"password":"text",onChange:U=>k(U.target.value),disabled:b}),(0,Ee.jsx)(Qn,{style:{right:"0.75rem"},children:e?(0,Ee.jsx)(Zn,{onClick:()=>t(!1)}):(0,Ee.jsx)(Xn,{onClick:()=>t(!0)})})]}),!!g&&(0,Ee.jsx)(Yw,{children:g})]}),(0,Ee.jsxs)("div",{children:[(0,Ee.jsxs)(Lu,{children:[(0,Ee.jsx)("h4",{children:"Why is this necessary?"}),(0,Ee.jsx)("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),(0,Ee.jsx)(Jw,{loading:b||!n,disabled:!m,onClick:async()=>{E(!0);let U=await r();if(U&&x&&m!==null)try{a("embedded_wallet_recovery_started",{walletAddress:x.address}),await n?.recover({address:x.address,accessToken:U,recoveryPin:m}),v(""),T?l(T):i({shouldCallAuthOnSuccess:!1}),A?.(x),a("embedded_wallet_recovery_completed",{walletAddress:x.address})}catch(B){wm(B)?v("Invalid recovery password, please try again."):v("An error has occurred, please try again.")}finally{E(!1)}else return I("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!x&&b,children:"Recover your account"})]})]}),(0,Ee.jsx)(ee,{}),(0,Ee.jsx)($,{protectedByPrivy:!0})]})},jw=rn.default.div`
1286
+ `;var tn=require("react");var Cf=require("react/jsx-runtime"),wf=()=>{let[e,t]=(0,tn.useState)(null),[o,r]=(0,tn.useState)(!1),[n,i]=(0,tn.useState)(null),[a,l]=(0,tn.useState)(""),{authenticated:s,getAccessToken:c,user:m}=z(),{walletProxy:h,refreshUser:g,closePrivyModal:v,createAnalyticsEvent:b}=W(),{app:T,navigate:x,data:E,onUserCloseViaDialogOrKeybindRef:k}=_(),{onSuccess:I,onFailure:M}=E.createWallet,S=Ae(m),O=e?.recoveryMethod==="user-passcode";(0,tn.useEffect)(()=>{s||(x("LANDING"),M(new fa("User must be authenticated before setting a password on a Privy wallet")))},[s]);let D=()=>{if(n){M(n),v({shouldCallAuthOnSuccess:!1});return}if(!O){M(new Nt("Exited before password was added to wallet")),v({shouldCallAuthOnSuccess:!1});return}I(e),v({shouldCallAuthOnSuccess:!1})};k.current=D;let B=async()=>{let K=await c();if(K&&S?.address&&a&&h)try{if(b("embedded_wallet_set_password_started",{walletAddress:S.address}),!(await h.setRecoveryPassword({accessToken:K,address:S.address,recoveryPassword:a})).address){i(new Nt("Error setting password on privy wallet")),b("embedded_wallet_set_password_failed",{walletAddress:S.address,reason:"error setting password"});return}let j=await g(),R=Ae(j);if(!R){i(new Nt("Error setting password on privy wallet")),b("embedded_wallet_set_password_failed",{walletAddress:S.address,reason:"wallet disconnected"});return}t(R),b("embedded_wallet_set_password_completed",{walletAddress:S.address})}catch(U){console.warn(U),i(U instanceof Error?U:new Error("Error setting password on privy wallet")),b("embedded_wallet_set_password_failed",{walletAddress:S.address,reason:U})}},G=async()=>{O?(I(e),v({shouldCallAuthOnSuccess:!1})):(r(!0),i(null),await B(),r(!1))};return(0,Cf.jsx)(Is,{appName:T?.name||"privy",config:{initiatedBy:"user",onCancel:D},error:n?"An error has occurred, please try again.":void 0,buttonLoading:o,buttonHideAnimations:!1,password:a,onPasswordGenerate:()=>l(Rs()),onPasswordChange:l,onSubmit:G,onClose:D})};var bf=f(require("@heroicons/react/24/outline/UserCircleIcon")),Ef=f(require("@heroicons/react/24/solid/LockClosedIcon"));var et=require("react/jsx-runtime"),Tf=()=>{let{user:e}=z(),{closePrivyModal:t,createAnalyticsEvent:o}=W(),{data:r,setModalData:n,navigate:i,onUserCloseViaDialogOrKeybindRef:a}=_(),{onSuccess:l,onFailure:s}=r.setWalletPassword,c=()=>{s(new Nt("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return a.current=c,(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(A,{onClose:c}),(0,et.jsx)(X,{}),(0,et.jsxs)(vo,{children:[(0,et.jsxs)(Ou,{children:[(0,et.jsx)(bf.default,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,et.jsx)(Du,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:(0,et.jsx)(Ef.default,{width:"12px",height:"12px",fill:"white"})})]}),(0,et.jsxs)(Le,{title:"Secure Your Account",children:["Please set a password to secure your account.",(0,et.jsx)("p",{children:"Losing this password will make your account inaccessible on new devices. You will only be asked for it when you log on to a new device."})]})]}),(0,et.jsx)(F,{onClick:()=>{let h=Ae(e);o("embedded_wallet_set_password_started",{walletAddress:h?.address}),n({createWallet:{onFailure:s,onSuccess:l,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),i("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),(0,et.jsx)(ee,{}),(0,et.jsx)($,{protectedByPrivy:!0})]})};var Pf=f(require("@heroicons/react/24/outline/ShieldCheckIcon")),on=require("react"),rn=f(require("styled-components"));var Ee=require("react/jsx-runtime"),xf=()=>{let[e,t]=(0,on.useState)(!0),{authenticated:o,getAccessToken:r}=z(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=W(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),[m,h]=(0,on.useState)(void 0),[g,v]=(0,on.useState)(""),[b,T]=(0,on.useState)(!1),{privyWallet:x,onCompleteNavigateTo:E,onSuccess:k,onFailure:I}=s.recoverWallet,M=(D="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),I(typeof D=="string"?new Nt(D):D)};c.current=M,(0,on.useEffect)(()=>{if(!o||!x)return M("User must be authenticated and have a Privy wallet before it can be recovered")},[o]);let S=D=>{D&&h(D)};return(0,Ee.jsxs)(Ee.Fragment,{children:[(0,Ee.jsx)(A,{onClose:M}),(0,Ee.jsx)(X,{}),(0,Ee.jsxs)(K1,{children:[(0,Ee.jsxs)(j1,{children:[(0,Ee.jsx)(Pf.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Ee.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Load your account"}),(0,Ee.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),(0,Ee.jsxs)("div",{children:[(0,Ee.jsxs)(Or,{children:[(0,Ee.jsx)(en,{type:e?"password":"text",onChange:D=>S(D.target.value),disabled:b}),(0,Ee.jsx)(Qn,{style:{right:"0.75rem"},children:e?(0,Ee.jsx)(Zn,{onClick:()=>t(!1)}):(0,Ee.jsx)(Xn,{onClick:()=>t(!0)})})]}),!!g&&(0,Ee.jsx)(Y1,{children:g})]}),(0,Ee.jsxs)("div",{children:[(0,Ee.jsxs)(Lu,{children:[(0,Ee.jsx)("h4",{children:"Why is this necessary?"}),(0,Ee.jsx)("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),(0,Ee.jsx)(J1,{loading:b||!n,disabled:!m,onClick:async()=>{T(!0);let D=await r();if(D&&x&&m!==null)try{a("embedded_wallet_recovery_started",{walletAddress:x.address}),await n?.recover({address:x.address,accessToken:D,recoveryPin:m}),v(""),E?l(E):i({shouldCallAuthOnSuccess:!1}),k?.(x),a("embedded_wallet_recovery_completed",{walletAddress:x.address})}catch(B){wm(B)?v("Invalid recovery password, please try again."):v("An error has occurred, please try again.")}finally{T(!1)}else return M("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!x&&b,children:"Recover your account"})]})]}),(0,Ee.jsx)(ee,{}),(0,Ee.jsx)($,{protectedByPrivy:!0})]})},j1=rn.default.div`
1287
1287
  display: flex;
1288
1288
  flex-direction: column;
1289
1289
  align-items: center;
@@ -1305,18 +1305,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1305
1305
  font-weight: 400;
1306
1306
  line-height: 20px;
1307
1307
  }
1308
- `,Kw=rn.default.div`
1308
+ `,K1=rn.default.div`
1309
1309
  display: flex;
1310
1310
  flex-direction: column;
1311
1311
  justify-content: space-between;
1312
- `,Yw=rn.default.div`
1312
+ `,Y1=rn.default.div`
1313
1313
  line-height: 20px;
1314
1314
  height: 20px;
1315
1315
  font-size: 13px;
1316
1316
  color: var(--privy-color-error);
1317
1317
  text-align: left;
1318
1318
  margin-top: 0.5rem;
1319
- `,Jw=(0,rn.default)(F)`
1319
+ `,J1=(0,rn.default)(F)`
1320
1320
  ${e=>e.hideAnimations&&rn.css`
1321
1321
  && {
1322
1322
  // Remove animations because the recoverWallet task on the iframe partially
@@ -1324,7 +1324,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1324
1324
  transition: none;
1325
1325
  }
1326
1326
  `}
1327
- `;var Sf=f(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),_f=f(require("@heroicons/react/24/outline/PhoneIcon")),Ms=f(require("styled-components"));var ze=require("react/jsx-runtime"),Qw=e=>{let t=(0,ze.jsx)(Sf.default,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof w)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else{if(e instanceof Ve&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:(0,ze.jsx)(_f.default,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof rt)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:t};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:t};case"allowlist_rejected":return{title:"You don't have access to this app",detail:"Have you been invited?",ctaText:"Try another account",icon:(0,ze.jsx)(Ts,{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:(0,ze.jsx)("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:(0,ze.jsx)("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else return e instanceof Io&&e.status===422?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:t}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}},Af=()=>{let{navigate:e,navigateBack:t,data:o,lastScreen:r,currentScreen:n}=S(),{reset:i}=_e(),a=o?.errorModalData,l=Qw(a?.error||new Error),s=c=>{if(c instanceof rt)switch(c.privyErrorCode){case"invalid_captcha":return()=>i()}return()=>{}};return(0,ze.jsxs)(ze.Fragment,{children:[(0,ze.jsx)(_,{backFn:!r||n===r?void 0:t}),(0,ze.jsxs)(Zw,{children:[(0,ze.jsx)(e1,{children:(0,ze.jsxs)("div",{children:[(0,ze.jsx)(Es,{color:"var(--privy-color-error)"}),l.icon]})}),(0,ze.jsxs)(Xw,{children:[(0,ze.jsx)("h3",{children:l.title}),(0,ze.jsx)("p",{children:l.detail})]}),(0,ze.jsx)(F,{color:"var(--privy-color-error)",onClick:()=>{s(a?.error||new Error)(),e(r||"LANDING",!1)},children:l.ctaText})]})]})},Zw=Ms.default.div`
1327
+ `;var Sf=f(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),_f=f(require("@heroicons/react/24/outline/PhoneIcon")),Ms=f(require("styled-components"));var ze=require("react/jsx-runtime"),Q1=e=>{let t=(0,ze.jsx)(Sf.default,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof w)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else{if(e instanceof Ve&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:(0,ze.jsx)(_f.default,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof rt)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:t};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:t};case"allowlist_rejected":return{title:"You don't have access to this app",detail:"Have you been invited?",ctaText:"Try another account",icon:(0,ze.jsx)(Ts,{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:(0,ze.jsx)("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:(0,ze.jsx)("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else return e instanceof Io&&e.status===422?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:t}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}},Af=()=>{let{navigate:e,navigateBack:t,data:o,lastScreen:r,currentScreen:n}=_(),{reset:i}=_e(),a=o?.errorModalData,l=Q1(a?.error||new Error),s=c=>{if(c instanceof rt)switch(c.privyErrorCode){case"invalid_captcha":return()=>i()}return()=>{}};return(0,ze.jsxs)(ze.Fragment,{children:[(0,ze.jsx)(A,{backFn:!r||n===r?void 0:t}),(0,ze.jsxs)(Z1,{children:[(0,ze.jsx)(ew,{children:(0,ze.jsxs)("div",{children:[(0,ze.jsx)(Es,{color:"var(--privy-color-error)"}),l.icon]})}),(0,ze.jsxs)(X1,{children:[(0,ze.jsx)("h3",{children:l.title}),(0,ze.jsx)("p",{children:l.detail})]}),(0,ze.jsx)(F,{color:"var(--privy-color-error)",onClick:()=>{s(a?.error||new Error)(),e(r||"LANDING",!1)},children:l.ctaText})]})]})},Z1=Ms.default.div`
1328
1328
  display: flex;
1329
1329
  flex-direction: column;
1330
1330
  align-items: center;
@@ -1332,11 +1332,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1332
1332
  gap: 24px;
1333
1333
  width: 100%;
1334
1334
  padding-bottom: 16px;
1335
- `,Xw=Ms.default.div`
1335
+ `,X1=Ms.default.div`
1336
1336
  display: flex;
1337
1337
  flex-direction: column;
1338
1338
  gap: 8px;
1339
- `,e1=Ms.default.div`
1339
+ `,ew=Ms.default.div`
1340
1340
  display: flex;
1341
1341
  flex-direction: column;
1342
1342
  justify-content: center;
@@ -1359,7 +1359,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1359
1359
  left: -19px;
1360
1360
  top: -19px;
1361
1361
  }
1362
- `;var ur=require("react"),Ec=require("react-device-detect"),Tc=f(require("styled-components"));var Rf=require("react"),If=f(require("styled-components"));var wc=require("react/jsx-runtime"),Ws=({style:e,color:t,...o})=>(0,wc.jsx)("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},...o,children:(0,wc.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});var Ns=require("react/jsx-runtime"),kf=({color:e,...t})=>(0,Ns.jsx)("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 115.77 122.88",xmlSpace:"preserve",...t,children:(0,Ns.jsx)("g",{children:(0,Ns.jsx)("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});var Gi=require("react/jsx-runtime"),oi=e=>{let[t,o]=(0,Rf.useState)(!1);return(0,Gi.jsxs)(t1,{color:e.color,onClick:()=>{o(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>o(!1),1500)},justCopied:t,children:[t?(0,Gi.jsx)(Ws,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):(0,Gi.jsx)(kf,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},t1=If.default.button`
1362
+ `;var ur=require("react"),Ec=require("react-device-detect"),Tc=f(require("styled-components"));var Rf=require("react"),If=f(require("styled-components"));var wc=require("react/jsx-runtime"),Ws=({style:e,color:t,...o})=>(0,wc.jsx)("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},...o,children:(0,wc.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});var Ns=require("react/jsx-runtime"),kf=({color:e,...t})=>(0,Ns.jsx)("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 115.77 122.88",xmlSpace:"preserve",...t,children:(0,Ns.jsx)("g",{children:(0,Ns.jsx)("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});var Gi=require("react/jsx-runtime"),oi=e=>{let[t,o]=(0,Rf.useState)(!1);return(0,Gi.jsxs)(tw,{color:e.color,onClick:()=>{o(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>o(!1),1500)},justCopied:t,children:[t?(0,Gi.jsx)(Ws,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):(0,Gi.jsx)(kf,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},tw=If.default.button`
1363
1363
  display: flex;
1364
1364
  align-items: center;
1365
1365
  gap: 6px;
@@ -1397,7 +1397,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1397
1397
  width: 14px;
1398
1398
  height: 14px;
1399
1399
  }
1400
- `;var Mf=require("react"),Wf=f(require("styled-components")),Lf=require("react/jsx-runtime"),Nf=e=>{let[t,o]=(0,Mf.useState)(!1);return(0,Lf.jsx)(o1,{color:e.color,onClick:()=>{o(!0),window.open(e.url,"_blank"),setTimeout(()=>o(!1),1500)},justOpened:t,children:e.text})},o1=Wf.default.button`
1400
+ `;var Mf=require("react"),Wf=f(require("styled-components")),Lf=require("react/jsx-runtime"),Nf=e=>{let[t,o]=(0,Mf.useState)(!1);return(0,Lf.jsx)(ow,{color:e.color,onClick:()=>{o(!0),window.open(e.url,"_blank"),setTimeout(()=>o(!1),1500)},justOpened:t,children:e.text})},ow=Wf.default.button`
1401
1401
  display: flex;
1402
1402
  align-items: center;
1403
1403
  gap: 6px;
@@ -1435,7 +1435,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1435
1435
  width: 14px;
1436
1436
  height: 14px;
1437
1437
  }
1438
- `;var Uf=f(require("qrcode")),Ff=f(require("react")),Bf=f(require("styled-components"));var Cc=require("react/jsx-runtime"),Of=()=>(0,Cc.jsx)("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:(0,Cc.jsx)("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});var xe=require("react/jsx-runtime"),Ut=7,bc=(e,t,o,r,n)=>{for(let i=t;i<t+r;i++)for(let a=o;a<o+n;a++){let l=e?.[a];l&&l[i]&&(l[i]=0)}return e},r1=e=>{let t=Uf.default.create(e,{errorCorrectionLevel:"high"}).modules,o=dp(Array.from(t.data),t.size);return o=bc(o,0,0,Ut,Ut),o=bc(o,o.length-Ut,0,Ut,Ut),o=bc(o,0,o.length-Ut,Ut,Ut),o},n1=({x:e,y:t,cellSize:o,bgColor:r,fgColor:n})=>(0,xe.jsx)(xe.Fragment,{children:[0,1,2].map(i=>(0,xe.jsx)("circle",{r:o*(Ut-i*2)/2,cx:e+o*Ut/2,cy:t+o*Ut/2,fill:i%2!==0?r:n},`finder-${e}-${t}-${i}`))}),i1=({cellSize:e,matrixSize:t,bgColor:o,fgColor:r})=>{let n=[[0,0],[(t-Ut)*e,0],[0,(t-Ut)*e]];return(0,xe.jsx)(xe.Fragment,{children:n.map(([i,a])=>(0,xe.jsx)(n1,{x:i,y:a,cellSize:e,bgColor:o,fgColor:r},`finder-${i}-${a}`))})},a1=({matrix:e,cellSize:t,color:o})=>(0,xe.jsx)(xe.Fragment,{children:e.map((r,n)=>r.map((i,a)=>i?(0,xe.jsx)("circle",{r:t/2.5,cx:n*t+t/2,cy:a*t+t/2,fill:o},`circle-${n}-${a}`):(0,xe.jsx)(Ff.default.Fragment,{},`circle-${n}-${a}`)))}),Df=(e,t)=>e-e%t,s1=({outputSize:e,cellSize:t,element:o,size:r,padding:n,bgColor:i})=>{if(!o)return(0,xe.jsx)(xe.Fragment,{});let a=r||40,l=n||4,s=o,c=e/2-a/2-l;return(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)("rect",{x:Df(c,t),y:Df(c,t),width:a+l*2+(c%t?t+.5:.5),height:a+l*2+(c%t?t+.5:.5),fill:i}),(0,xe.jsx)(s,{x:e/2-a/2,y:e/2-a/2,height:a,width:a})]})},l1=e=>{let t=e.outputSize,o=r1(e.url),r=t/o.length;return(0,xe.jsxs)("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[(0,xe.jsx)(a1,{matrix:o,cellSize:r,color:e.fgColor}),(0,xe.jsx)(i1,{cellSize:r,matrixSize:o.length,fgColor:e.fgColor,bgColor:e.bgColor}),(0,xe.jsx)(s1,{outputSize:e.outputSize,cellSize:r,element:e.logo?.element,bgColor:e.bgColor})]})},c1=Bf.default.div`
1438
+ `;var Uf=f(require("qrcode")),Ff=f(require("react")),Bf=f(require("styled-components"));var Cc=require("react/jsx-runtime"),Of=()=>(0,Cc.jsx)("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:(0,Cc.jsx)("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});var xe=require("react/jsx-runtime"),Ut=7,bc=(e,t,o,r,n)=>{for(let i=t;i<t+r;i++)for(let a=o;a<o+n;a++){let l=e?.[a];l&&l[i]&&(l[i]=0)}return e},rw=e=>{let t=Uf.default.create(e,{errorCorrectionLevel:"high"}).modules,o=dp(Array.from(t.data),t.size);return o=bc(o,0,0,Ut,Ut),o=bc(o,o.length-Ut,0,Ut,Ut),o=bc(o,0,o.length-Ut,Ut,Ut),o},nw=({x:e,y:t,cellSize:o,bgColor:r,fgColor:n})=>(0,xe.jsx)(xe.Fragment,{children:[0,1,2].map(i=>(0,xe.jsx)("circle",{r:o*(Ut-i*2)/2,cx:e+o*Ut/2,cy:t+o*Ut/2,fill:i%2!==0?r:n},`finder-${e}-${t}-${i}`))}),iw=({cellSize:e,matrixSize:t,bgColor:o,fgColor:r})=>{let n=[[0,0],[(t-Ut)*e,0],[0,(t-Ut)*e]];return(0,xe.jsx)(xe.Fragment,{children:n.map(([i,a])=>(0,xe.jsx)(nw,{x:i,y:a,cellSize:e,bgColor:o,fgColor:r},`finder-${i}-${a}`))})},aw=({matrix:e,cellSize:t,color:o})=>(0,xe.jsx)(xe.Fragment,{children:e.map((r,n)=>r.map((i,a)=>i?(0,xe.jsx)("circle",{r:t/2.5,cx:n*t+t/2,cy:a*t+t/2,fill:o},`circle-${n}-${a}`):(0,xe.jsx)(Ff.default.Fragment,{},`circle-${n}-${a}`)))}),Df=(e,t)=>e-e%t,sw=({outputSize:e,cellSize:t,element:o,size:r,padding:n,bgColor:i})=>{if(!o)return(0,xe.jsx)(xe.Fragment,{});let a=r||40,l=n||4,s=o,c=e/2-a/2-l;return(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)("rect",{x:Df(c,t),y:Df(c,t),width:a+l*2+(c%t?t+.5:.5),height:a+l*2+(c%t?t+.5:.5),fill:i}),(0,xe.jsx)(s,{x:e/2-a/2,y:e/2-a/2,height:a,width:a})]})},lw=e=>{let t=e.outputSize,o=rw(e.url),r=t/o.length;return(0,xe.jsxs)("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[(0,xe.jsx)(aw,{matrix:o,cellSize:r,color:e.fgColor}),(0,xe.jsx)(iw,{cellSize:r,matrixSize:o.length,fgColor:e.fgColor,bgColor:e.bgColor}),(0,xe.jsx)(sw,{outputSize:e.outputSize,cellSize:r,element:e.logo?.element,bgColor:e.bgColor})]})},cw=Bf.default.div`
1439
1439
  display: flex;
1440
1440
  justify-content: center;
1441
1441
  align-items: center;
@@ -1450,7 +1450,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1450
1450
  border-color: ${e=>e.fgColor};
1451
1451
  border-radius: var(--privy-border-radius-md);
1452
1452
  }
1453
- `,Ls=e=>{let t=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",r=e.size||160;return(0,xe.jsx)(c1,{size:r,bgColor:t,fgColor:o,children:(0,xe.jsx)(l1,{url:e.url,logo:{element:e.squareLogoElement??Of},outputSize:r,bgColor:t,fgColor:o})})};var nn=require("react/jsx-runtime"),Vi=({style:e,...t})=>(0,nn.jsxs)("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:[(0,nn.jsx)("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),(0,nn.jsx)("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"}),(0,nn.jsx)("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"}),(0,nn.jsx)("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"})]});var ie=require("react/jsx-runtime"),Hf="#8a63d2",Vf=1e3,d1=Vf*2,p1=Vf*120,zf=()=>{let{ready:e,authenticated:t,user:o}=z(),{lastScreen:r,navigate:n,navigateBack:i,setModalData:a,app:l}=S(),{getAuthFlow:s,loginWithFarcaster:c,closePrivyModal:m}=W(),[h,g]=(0,ur.useState)(void 0),[v,b]=(0,ur.useState)(!1),[E,x]=(0,ur.useState)(!1),T=(0,ur.useRef)([]),A=l?.render.inDialog?yt:0,R=s(),I=R?.meta.connectUri;return(0,ur.useEffect)(()=>{let k=Date.now(),D=setInterval(async()=>{let U=await R.pollForReady.execute(),B=Date.now()-k;if(U){clearInterval(D),b(!0);try{await c(),x(!0)}catch(G){let j={retryable:!1,message:"Authentication failed"};if(G?.privyErrorCode==="allowlist_rejected"){n("ALLOWLIST_REJECTION_SCREEN");return}else G?.privyErrorCode==="linked_to_another_user"?j.detail="This account has already been linked to another user.":G?.privyErrorCode==="invalid_credentials"?(j.retryable=!0,j.detail="Something went wrong. Try again."):G?.privyErrorCode==="too_many_requests"&&(j.detail="Too many requests. Please wait before trying again.");g(j)}}else B>p1&&(clearInterval(D),g({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},d1);return()=>{clearInterval(D),T.current.forEach(U=>clearTimeout(U))}},[]),(0,ur.useEffect)(()=>{if(e&&t&&E&&o){if(l?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let D=setTimeout(()=>{n("AFFIRMATIVE_CONSENT_SCREEN")},A);return()=>clearTimeout(D)}E&&(Kt(o,l?.embeddedWallets.createOnLogin)?T.current.push(setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:D=>console.error(D),callAuthOnSuccessOnClose:!0}}),n("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},A)):T.current.push(setTimeout(m,A)))}},[E,e,t,o]),Ec.isMobile||v?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(_,{backFn:r?i:void 0,onClose:m},"header"),(0,ie.jsx)(X,{}),(0,ie.jsxs)(Gf,{children:[(0,ie.jsx)(u1,{children:(0,ie.jsxs)("div",{children:[(0,ie.jsx)(Rr,{success:E,fail:!!h}),(0,ie.jsx)(Vi,{style:{width:"38px",height:"38px"}})]})}),(0,ie.jsxs)(ro,{children:[(0,ie.jsx)(Ne,{children:h?h.message:"Signing in with Farcaster"}),(0,ie.jsx)(ke,{children:h?h.detail:"This should only take a moment"}),(0,ie.jsx)(oo,{children:I&&Ec.isMobile&&(0,ie.jsx)(Nf,{text:"Take me to Warpcast",url:I,color:Hf})})]})]}),(0,ie.jsx)(oe,{})]}):(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(_,{backFn:r?i:void 0,onClose:m},"header"),(0,ie.jsx)(X,{}),(0,ie.jsx)(Gf,{children:(0,ie.jsxs)("div",{children:[(0,ie.jsx)(Ne,{children:"Sign in with Farcaster"}),(0,ie.jsx)(ke,{children:"Scan with your phone's camera to continue."}),(0,ie.jsx)(xs,{children:I?(0,ie.jsx)(Ls,{url:I,size:275,squareLogoElement:Vi}):(0,ie.jsx)(Zt,{})}),(0,ie.jsxs)(oo,{children:[(0,ie.jsx)(ke,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),I&&(0,ie.jsx)(oi,{text:I,itemName:"link",color:Hf})]})]})}),(0,ie.jsx)(oe,{})]})},Gf=Tc.default.div`
1453
+ `,Ls=e=>{let t=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",r=e.size||160;return(0,xe.jsx)(cw,{size:r,bgColor:t,fgColor:o,children:(0,xe.jsx)(lw,{url:e.url,logo:{element:e.squareLogoElement??Of},outputSize:r,bgColor:t,fgColor:o})})};var nn=require("react/jsx-runtime"),Vi=({style:e,...t})=>(0,nn.jsxs)("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:[(0,nn.jsx)("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),(0,nn.jsx)("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"}),(0,nn.jsx)("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"}),(0,nn.jsx)("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"})]});var ie=require("react/jsx-runtime"),Hf="#8a63d2",Vf=1e3,dw=Vf*2,pw=Vf*120,zf=()=>{let{ready:e,authenticated:t,user:o}=z(),{lastScreen:r,navigate:n,navigateBack:i,setModalData:a,app:l}=_(),{getAuthFlow:s,loginWithFarcaster:c,closePrivyModal:m}=W(),[h,g]=(0,ur.useState)(void 0),[v,b]=(0,ur.useState)(!1),[T,x]=(0,ur.useState)(!1),E=(0,ur.useRef)([]),k=l?.render.inDialog?yt:0,I=s(),M=I?.meta.connectUri;return(0,ur.useEffect)(()=>{let S=Date.now(),O=setInterval(async()=>{let D=await I.pollForReady.execute(),B=Date.now()-S;if(D){clearInterval(O),b(!0);try{await c(),x(!0)}catch(G){let K={retryable:!1,message:"Authentication failed"};if(G?.privyErrorCode==="allowlist_rejected"){n("ALLOWLIST_REJECTION_SCREEN");return}else G?.privyErrorCode==="linked_to_another_user"?K.detail="This account has already been linked to another user.":G?.privyErrorCode==="invalid_credentials"?(K.retryable=!0,K.detail="Something went wrong. Try again."):G?.privyErrorCode==="too_many_requests"&&(K.detail="Too many requests. Please wait before trying again.");g(K)}}else B>pw&&(clearInterval(O),g({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},dw);return()=>{clearInterval(O),E.current.forEach(D=>clearTimeout(D))}},[]),(0,ur.useEffect)(()=>{if(e&&t&&T&&o){if(l?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let O=setTimeout(()=>{n("AFFIRMATIVE_CONSENT_SCREEN")},k);return()=>clearTimeout(O)}T&&(Kt(o,l?.embeddedWallets.createOnLogin)?E.current.push(setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:O=>console.error(O),callAuthOnSuccessOnClose:!0}}),n("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},k)):E.current.push(setTimeout(m,k)))}},[T,e,t,o]),Ec.isMobile||v?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(A,{backFn:r?i:void 0,onClose:m},"header"),(0,ie.jsx)(X,{}),(0,ie.jsxs)(Gf,{children:[(0,ie.jsx)(uw,{children:(0,ie.jsxs)("div",{children:[(0,ie.jsx)(Rr,{success:T,fail:!!h}),(0,ie.jsx)(Vi,{style:{width:"38px",height:"38px"}})]})}),(0,ie.jsxs)(ro,{children:[(0,ie.jsx)(Ne,{children:h?h.message:"Signing in with Farcaster"}),(0,ie.jsx)(ke,{children:h?h.detail:"This should only take a moment"}),(0,ie.jsx)(oo,{children:M&&Ec.isMobile&&(0,ie.jsx)(Nf,{text:"Take me to Warpcast",url:M,color:Hf})})]})]}),(0,ie.jsx)(oe,{})]}):(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(A,{backFn:r?i:void 0,onClose:m},"header"),(0,ie.jsx)(X,{}),(0,ie.jsx)(Gf,{children:(0,ie.jsxs)("div",{children:[(0,ie.jsx)(Ne,{children:"Sign in with Farcaster"}),(0,ie.jsx)(ke,{children:"Scan with your phone's camera to continue."}),(0,ie.jsx)(xs,{children:M?(0,ie.jsx)(Ls,{url:M,size:275,squareLogoElement:Vi}):(0,ie.jsx)(Zt,{})}),(0,ie.jsxs)(oo,{children:[(0,ie.jsx)(ke,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),M&&(0,ie.jsx)(oi,{text:M,itemName:"link",color:Hf})]})]})}),(0,ie.jsx)(oe,{})]})},Gf=Tc.default.div`
1454
1454
  display: flex;
1455
1455
  flex-direction: column;
1456
1456
  align-items: center;
@@ -1458,7 +1458,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1458
1458
  margin-left: 27px;
1459
1459
  margin-right: 27px;
1460
1460
  gap: 24px;
1461
- `,u1=Tc.default.div`
1461
+ `,uw=Tc.default.div`
1462
1462
  display: flex;
1463
1463
  flex-direction: column;
1464
1464
  justify-content: center;
@@ -1481,7 +1481,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1481
1481
  left: -19px;
1482
1482
  top: -19px;
1483
1483
  }
1484
- `;var $f=f(require("@heroicons/react/24/outline/ClockIcon")),qf=f(require("@heroicons/react/24/outline/EyeSlashIcon")),jf=f(require("@heroicons/react/24/outline/LinkIcon")),To=f(require("styled-components"));var ri=require("react/jsx-runtime"),Os=({size:e=61,...t})=>(0,ri.jsx)("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,ri.jsxs)("g",{id:"moonpay_symbol_wht 2",children:[(0,ri.jsx)("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),(0,ri.jsx)("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"})]})});var Ce=require("react/jsx-runtime"),Pc=({title:e,desc:t,icon:o})=>(0,Ce.jsxs)(v1,{children:[(0,Ce.jsx)(C1,{children:o}),(0,Ce.jsxs)(w1,{children:[(0,Ce.jsx)(y1,{children:e}),(0,Ce.jsx)(g1,{children:t})]})]}),Kf=({app:e,signedUrl:t,onContinue:o})=>(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsxs)(f1,{children:[(0,Ce.jsx)(Os,{size:"3.75rem"}),(0,Ce.jsxs)(h1,{children:[e?.name," uses ",(0,Ce.jsx)("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),(0,Ce.jsxs)(b1,{children:[(0,Ce.jsx)(Pc,{icon:(0,Ce.jsx)(jf.default,{width:"1rem"}),title:"Purchase assets to fund your account",desc:(0,Ce.jsxs)(Ce.Fragment,{children:["Connect a payment method (",(0,Ce.jsx)("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),(0,Ce.jsx)(Pc,{icon:(0,Ce.jsx)($f.default,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),(0,Ce.jsx)(Pc,{icon:(0,Ce.jsx)(qf.default,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),(0,Ce.jsx)(E1,{className:"mobile-only"})]}),(0,Ce.jsx)(m1,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),(0,Ce.jsx)(ms,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:o,children:"Continue to Moonpay"})]}),m1=To.default.span`
1484
+ `;var $f=f(require("@heroicons/react/24/outline/ClockIcon")),qf=f(require("@heroicons/react/24/outline/EyeSlashIcon")),jf=f(require("@heroicons/react/24/outline/LinkIcon")),To=f(require("styled-components"));var ri=require("react/jsx-runtime"),Os=({size:e=61,...t})=>(0,ri.jsx)("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,ri.jsxs)("g",{id:"moonpay_symbol_wht 2",children:[(0,ri.jsx)("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),(0,ri.jsx)("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"})]})});var Ce=require("react/jsx-runtime"),Pc=({title:e,desc:t,icon:o})=>(0,Ce.jsxs)(vw,{children:[(0,Ce.jsx)(Cw,{children:o}),(0,Ce.jsxs)(ww,{children:[(0,Ce.jsx)(yw,{children:e}),(0,Ce.jsx)(gw,{children:t})]})]}),Kf=({app:e,signedUrl:t,onContinue:o})=>(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsxs)(fw,{children:[(0,Ce.jsx)(Os,{size:"3.75rem"}),(0,Ce.jsxs)(hw,{children:[e?.name," uses ",(0,Ce.jsx)("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),(0,Ce.jsxs)(bw,{children:[(0,Ce.jsx)(Pc,{icon:(0,Ce.jsx)(jf.default,{width:"1rem"}),title:"Purchase assets to fund your account",desc:(0,Ce.jsxs)(Ce.Fragment,{children:["Connect a payment method (",(0,Ce.jsx)("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),(0,Ce.jsx)(Pc,{icon:(0,Ce.jsx)($f.default,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),(0,Ce.jsx)(Pc,{icon:(0,Ce.jsx)(qf.default,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),(0,Ce.jsx)(Ew,{className:"mobile-only"})]}),(0,Ce.jsx)(mw,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),(0,Ce.jsx)(ms,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:o,children:"Continue to Moonpay"})]}),mw=To.default.span`
1485
1485
  display: inline-block;
1486
1486
  color: var(--privy-color-foreground-3);
1487
1487
  text-align: center;
@@ -1490,13 +1490,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
1490
1490
  font-weight: 400;
1491
1491
  line-height: 140%; /* 0.875rem */
1492
1492
  margin-bottom: 0.25rem;
1493
- `,f1=To.default.div`
1493
+ `,fw=To.default.div`
1494
1494
  display: flex;
1495
1495
  flex-direction: column;
1496
1496
  align-items: center;
1497
1497
  justify-content: center;
1498
1498
  padding: 1.5rem 0;
1499
- `,h1=To.default.span`
1499
+ `,hw=To.default.span`
1500
1500
  color: var(--privy-color-foreground);
1501
1501
  text-align: center;
1502
1502
  font-size: 1.125rem;
@@ -1505,46 +1505,46 @@ You will need this password to access your ${e} wallet on a new device. Please k
1505
1505
  margin: 1.5rem 0;
1506
1506
  text-align: center;
1507
1507
  max-width: 19.5rem;
1508
- `,y1=To.default.span`
1508
+ `,yw=To.default.span`
1509
1509
  color: var(--privy-color-foreground);
1510
1510
  font-size: 0.875rem;
1511
1511
  font-weight: 500;
1512
1512
  line-height: 1.225rem;
1513
1513
  width: 100%;
1514
- `,g1=To.default.span`
1514
+ `,gw=To.default.span`
1515
1515
  color: var(--privy-color-foreground-2);
1516
1516
  font-size: 0.875rem;
1517
1517
  font-weight: 400;
1518
1518
  line-height: 1.225rem;
1519
- `,v1=To.default.div`
1519
+ `,vw=To.default.div`
1520
1520
  display: flex;
1521
1521
  align-items: flex-start;
1522
1522
  gap: 0.5rem;
1523
1523
  align-self: stretch;
1524
- `,w1=To.default.div`
1524
+ `,ww=To.default.div`
1525
1525
  display: flex;
1526
1526
  flex-direction: column;
1527
1527
  gap: 0.25rem;
1528
1528
  align-items: flex-start;
1529
1529
  text-align: left;
1530
1530
  flex: 1 0 0;
1531
- `,C1=To.default.div`
1531
+ `,Cw=To.default.div`
1532
1532
  padding-top: 2px;
1533
- `,b1=To.default.div`
1533
+ `,bw=To.default.div`
1534
1534
  display: flex;
1535
1535
  flex-direction: column;
1536
1536
  gap: 1.25rem;
1537
1537
  margin: 0 0.5rem;
1538
- `,E1=To.default.div`
1538
+ `,Ew=To.default.div`
1539
1539
  margin: 30px 0;
1540
- `;var Jf=require("ofetch"),ni=require("react");var Ds="moonpay",Yf="sdk_fiat_on_ramp_completed_with_status";async function Qf(e,t,o,r,n=!1){let i=o.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},a=o.uiConfig||{accentColor:r.accent,theme:r.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:n,config:{...o,...i,...a}})}async function T1(e,t){let o=t?Xd:Zd,r=t?tp:ep;return(0,Jf.ofetch)(`${o}/transactions/ext/${e}`,{query:{apiKey:r}})}function Zf(e,t=!1){let[o,r]=(0,ni.useState)(null),{createAnalyticsEvent:n}=W(),i=(0,ni.useRef)(0);return(0,ni.useEffect)(()=>{let a=setInterval(async()=>{if(e)try{let[l]=await T1(e,t),s=l.status==="waitingAuthorization"&&l.paymentMethod==="credit_debit_card"?"pending":l.status;r(s),["failed","completed","awaitingAuthorization"].includes(s)&&(n(Yf,{status:s,provider:Ds,paymentMethod:l.paymentMethod,cardPaymentType:l.cardPaymentType,currency:l.currency?.code,baseCurrencyAmount:l.baseCurrencyAmount,quoteCurrencyAmount:l.quoteCurrencyAmount,feeAmount:l.feeAmount,extraFeeAmount:l.extraFeeAmount,networkFeeAmount:l.networkFeeAmount}),clearInterval(a))}catch(l){l.response?.status!==404&&(i.current+=1),i.current>=3&&(r("serviceFailure"),n(Yf,{status:"serviceFailure",provider:Ds}),clearInterval(a))}},3e3);return()=>clearInterval(a)},[e,i]),o}var Fr=require("react/jsx-runtime"),Xf=()=>{let{app:e,data:t,navigate:o}=S(),{createAnalyticsEvent:r}=W(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:(0,Fr.jsxs)(Fr.Fragment,{children:[(0,Fr.jsx)(_,{title:"Fund account"},"header"),(0,Fr.jsx)(Kf,{app:e,signedUrl:n,onContinue:()=>{r("sdk_fiat_on_ramp_started",{provider:Ds}),o("FIAT_ON_RAMP_STATUS_SCREEN")}}),(0,Fr.jsx)($,{protectedByPrivy:!0})]})};var eh=f(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),th=f(require("@heroicons/react/24/solid/CheckCircleIcon")),oh=f(require("@heroicons/react/24/solid/XCircleIcon")),rh=require("react"),xc=f(require("styled-components"));var me=require("react/jsx-runtime"),nh=()=>{let{app:e,data:t}=S(),{closePrivyModal:o}=W(),{externalTransactionId:r}=t?.fiatOnRampStatus,n=Zf(r||null,e.fiatOnRamp.useSandbox);return(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)(_,{title:"Fund account"},"header"),(0,me.jsx)(x1,{status:n,onClickCta:o}),(0,me.jsx)($,{protectedByPrivy:!0})]})},P1=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"failed":return{title:"Something went wrong!",body:(0,me.jsxs)(me.Fragment,{children:[(0,me.jsxs)("p",{children:["It looks like there was an issue with your payment. Please contact"," ",(0,me.jsx)("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),(0,me.jsx)("p",{style:{fontStyle:"italic"},children:"Note that debit cards typically work better than credit cards here."})]}),cta:"Done"};case"serviceFailure":return{title:"Something went wrong!",body:"MoonPay ran into an error when processing your transaction. Try again?",cta:"Done"};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:""}}},x1=({status:e,onClickCta:t})=>{let{title:o,body:r,cta:n}=(0,rh.useMemo)(()=>P1(e),[e]);return(0,me.jsxs)(me.Fragment,{children:[(0,me.jsxs)(R1,{children:[(0,me.jsx)(A1,{status:e}),(0,me.jsxs)(ro,{children:[(0,me.jsx)("h3",{children:o}),(0,me.jsx)(k1,{children:r})]})]}),n&&(0,me.jsx)(F,{onClick:t,children:n})]})},S1=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)",_1=e=>{switch(e){case"serviceFailure":case"failed":return oh.default;case"completed":return th.default;case"waitingAuthorization":return()=>(0,me.jsx)(eh.default,{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}},A1=({status:e})=>{if(!e||e==="pending"){let r="var(--privy-color-foreground-4)";return(0,me.jsxs)("div",{style:{position:"relative"},children:[(0,me.jsx)(Zt,{color:r,style:{position:"absolute"}}),(0,me.jsx)(Ql,{color:r}),(0,me.jsx)(Os,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=_1(e),o=S1(e);return(0,me.jsx)("div",{style:{borderColor:o,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,me.jsx)(t,{width:"4rem",height:"4rem",color:o})})},k1=xc.default.p`
1540
+ `;var Jf=require("ofetch"),ni=require("react");var Ds="moonpay",Yf="sdk_fiat_on_ramp_completed_with_status";async function Qf(e,t,o,r,n=!1){let i=o.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},a=o.uiConfig||{accentColor:r.accent,theme:r.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:n,config:{...o,...i,...a}})}async function Tw(e,t){let o=t?Xd:Zd,r=t?tp:ep;return(0,Jf.ofetch)(`${o}/transactions/ext/${e}`,{query:{apiKey:r}})}function Zf(e,t=!1){let[o,r]=(0,ni.useState)(null),{createAnalyticsEvent:n}=W(),i=(0,ni.useRef)(0);return(0,ni.useEffect)(()=>{let a=setInterval(async()=>{if(e)try{let[l]=await Tw(e,t),s=l.status==="waitingAuthorization"&&l.paymentMethod==="credit_debit_card"?"pending":l.status;r(s),["failed","completed","awaitingAuthorization"].includes(s)&&(n(Yf,{status:s,provider:Ds,paymentMethod:l.paymentMethod,cardPaymentType:l.cardPaymentType,currency:l.currency?.code,baseCurrencyAmount:l.baseCurrencyAmount,quoteCurrencyAmount:l.quoteCurrencyAmount,feeAmount:l.feeAmount,extraFeeAmount:l.extraFeeAmount,networkFeeAmount:l.networkFeeAmount}),clearInterval(a))}catch(l){l.response?.status!==404&&(i.current+=1),i.current>=3&&(r("serviceFailure"),n(Yf,{status:"serviceFailure",provider:Ds}),clearInterval(a))}},3e3);return()=>clearInterval(a)},[e,i]),o}var Fr=require("react/jsx-runtime"),Xf=()=>{let{app:e,data:t,navigate:o}=_(),{createAnalyticsEvent:r}=W(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:(0,Fr.jsxs)(Fr.Fragment,{children:[(0,Fr.jsx)(A,{title:"Fund account"},"header"),(0,Fr.jsx)(Kf,{app:e,signedUrl:n,onContinue:()=>{r("sdk_fiat_on_ramp_started",{provider:Ds}),o("FIAT_ON_RAMP_STATUS_SCREEN")}}),(0,Fr.jsx)($,{protectedByPrivy:!0})]})};var eh=f(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),th=f(require("@heroicons/react/24/solid/CheckCircleIcon")),oh=f(require("@heroicons/react/24/solid/XCircleIcon")),rh=require("react"),xc=f(require("styled-components"));var fe=require("react/jsx-runtime"),nh=()=>{let{app:e,data:t}=_(),{closePrivyModal:o}=W(),{externalTransactionId:r}=t?.fiatOnRampStatus,n=Zf(r||null,e.fiatOnRamp.useSandbox);return(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(A,{title:"Fund account"},"header"),(0,fe.jsx)(xw,{status:n,onClickCta:o}),(0,fe.jsx)($,{protectedByPrivy:!0})]})},Pw=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"failed":return{title:"Something went wrong!",body:(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsxs)("p",{children:["It looks like there was an issue with your payment. Please contact"," ",(0,fe.jsx)("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),(0,fe.jsx)("p",{style:{fontStyle:"italic"},children:"Note that debit cards typically work better than credit cards here."})]}),cta:"Done"};case"serviceFailure":return{title:"Something went wrong!",body:"MoonPay ran into an error when processing your transaction. Try again?",cta:"Done"};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:""}}},xw=({status:e,onClickCta:t})=>{let{title:o,body:r,cta:n}=(0,rh.useMemo)(()=>Pw(e),[e]);return(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsxs)(Rw,{children:[(0,fe.jsx)(Aw,{status:e}),(0,fe.jsxs)(ro,{children:[(0,fe.jsx)("h3",{children:o}),(0,fe.jsx)(kw,{children:r})]})]}),n&&(0,fe.jsx)(F,{onClick:t,children:n})]})},Sw=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)",_w=e=>{switch(e){case"serviceFailure":case"failed":return oh.default;case"completed":return th.default;case"waitingAuthorization":return()=>(0,fe.jsx)(eh.default,{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}},Aw=({status:e})=>{if(!e||e==="pending"){let r="var(--privy-color-foreground-4)";return(0,fe.jsxs)("div",{style:{position:"relative"},children:[(0,fe.jsx)(Zt,{color:r,style:{position:"absolute"}}),(0,fe.jsx)(Ql,{color:r}),(0,fe.jsx)(Os,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=_w(e),o=Sw(e);return(0,fe.jsx)("div",{style:{borderColor:o,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,fe.jsx)(t,{width:"4rem",height:"4rem",color:o})})},kw=xc.default.p`
1541
1541
  font-size: 1rem;
1542
1542
  color: var(--privy-color-foreground-3);
1543
1543
  margin-bottom: 1rem;
1544
1544
  display: flex;
1545
1545
  flex-direction: column;
1546
1546
  gap: 1rem;
1547
- `,R1=xc.default.div`
1547
+ `,Rw=xc.default.div`
1548
1548
  display: flex;
1549
1549
  flex-direction: column;
1550
1550
  align-items: center;
@@ -1552,7 +1552,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1552
1552
  margin-left: 1.75rem;
1553
1553
  margin-right: 1.75rem;
1554
1554
  padding: 2rem 0;
1555
- `;var ih=f(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),ah=f(require("styled-components"));var Ft=require("react/jsx-runtime"),sh=()=>{let{closePrivyModal:e}=W();return(0,Ft.jsxs)(Ft.Fragment,{children:[(0,Ft.jsx)(_,{},"header"),(0,Ft.jsx)(I1,{children:(0,Ft.jsx)(ih.default,{style:{width:32,height:32}})}),(0,Ft.jsx)(Uo,{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"}}),(0,Ft.jsx)(to,{children:(0,Ft.jsx)(F,{onClick:()=>e(),children:"Close"})}),(0,Ft.jsx)(ee,{}),(0,Ft.jsx)($,{protectedByPrivy:!0})]})},I1=ah.default.div`
1555
+ `;var ih=f(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),ah=f(require("styled-components"));var Ft=require("react/jsx-runtime"),sh=()=>{let{closePrivyModal:e}=W();return(0,Ft.jsxs)(Ft.Fragment,{children:[(0,Ft.jsx)(A,{},"header"),(0,Ft.jsx)(Iw,{children:(0,Ft.jsx)(ih.default,{style:{width:32,height:32}})}),(0,Ft.jsx)(Uo,{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"}}),(0,Ft.jsx)(to,{children:(0,Ft.jsx)(F,{onClick:()=>e(),children:"Close"})}),(0,Ft.jsx)(ee,{}),(0,Ft.jsx)($,{protectedByPrivy:!0})]})},Iw=ah.default.div`
1556
1556
  border-radius: 50%;
1557
1557
  height: 68px;
1558
1558
  width: 68px;
@@ -1573,7 +1573,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1573
1573
  border-left: 2px solid var(--privy-color-foreground-4);
1574
1574
  height: 12px;
1575
1575
  }
1576
- `,Fs=({children:e})=>(0,Bs.jsxs)(M1,{children:[(0,Bs.jsx)(lh,{style:{width:"16px",height:"16px"}}),e]}),M1=Us.default.div`
1576
+ `,Fs=({children:e})=>(0,Bs.jsxs)(Mw,{children:[(0,Bs.jsx)(lh,{style:{width:"16px",height:"16px"}}),e]}),Mw=Us.default.div`
1577
1577
  display: flex;
1578
1578
  justify-content: flex-start;
1579
1579
  justify-items: center;
@@ -1591,15 +1591,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
1591
1591
  margin-bottom: auto;
1592
1592
  }
1593
1593
  }
1594
- `;var Te=require("react/jsx-runtime"),W1=()=>{let{navigate:e}=S(),t="https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en";return dh.isFirefox&&(t="https://addons.mozilla.org/en-US/firefox/addon/phantom-app/"),(0,Te.jsxs)(N1,{children:[(0,Te.jsx)(Ni,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),(0,Te.jsx)(oo,{children:(0,Te.jsx)(No,{style:{width:"152px",height:"152px"}})}),(0,Te.jsxs)(ch,{children:[(0,Te.jsx)(Fs,{children:(0,Te.jsxs)("div",{children:[(0,Te.jsx)("span",{children:"Install the "}),(0,Te.jsx)("a",{href:t,target:"_blank",children:"Phantom browser extension"})]})}),(0,Te.jsx)(_c,{}),(0,Te.jsx)(Fs,{children:"Set up your first wallet"}),(0,Te.jsx)(_c,{}),(0,Te.jsx)(Fs,{children:"Store your recovery phrase in a safe place!"})]}),(0,Te.jsx)(fs,{onClick:()=>e("LANDING"),children:"Done! I have my wallet"})]})},uh=()=>{let{navigateBack:e}=S();return(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(_,{backFn:e},"header"),(0,Te.jsx)(X,{}),(0,Te.jsx)(W1,{}),(0,Te.jsx)(ee,{}),(0,Te.jsxs)(oe,{children:[(0,Te.jsx)("span",{children:"Still not sure? "}),(0,Te.jsx)("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},N1=(0,ph.default)(oo)`
1594
+ `;var Te=require("react/jsx-runtime"),Ww=()=>{let{navigate:e}=_(),t="https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en";return dh.isFirefox&&(t="https://addons.mozilla.org/en-US/firefox/addon/phantom-app/"),(0,Te.jsxs)(Nw,{children:[(0,Te.jsx)(Ni,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),(0,Te.jsx)(oo,{children:(0,Te.jsx)(No,{style:{width:"152px",height:"152px"}})}),(0,Te.jsxs)(ch,{children:[(0,Te.jsx)(Fs,{children:(0,Te.jsxs)("div",{children:[(0,Te.jsx)("span",{children:"Install the "}),(0,Te.jsx)("a",{href:t,target:"_blank",children:"Phantom browser extension"})]})}),(0,Te.jsx)(_c,{}),(0,Te.jsx)(Fs,{children:"Set up your first wallet"}),(0,Te.jsx)(_c,{}),(0,Te.jsx)(Fs,{children:"Store your recovery phrase in a safe place!"})]}),(0,Te.jsx)(fs,{onClick:()=>e("LANDING"),children:"Done! I have my wallet"})]})},uh=()=>{let{navigateBack:e}=_();return(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(A,{backFn:e},"header"),(0,Te.jsx)(X,{}),(0,Te.jsx)(Ww,{}),(0,Te.jsx)(ee,{}),(0,Te.jsxs)(oe,{children:[(0,Te.jsx)("span",{children:"Still not sure? "}),(0,Te.jsx)("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},Nw=(0,ph.default)(oo)`
1595
1595
  gap: 30px;
1596
1596
 
1597
1597
  > :first-child > svg {
1598
1598
  margin-top: 20px;
1599
1599
  }
1600
- `;var xh=f(require("@heroicons/react/24/outline/UserCircleIcon")),Ji=require("react"),Sh=require("react-device-detect"),_h=f(require("styled-components"));var fh=f(require("@heroicons/react/24/outline/EnvelopeIcon")),hh=require("react");var mh=f(require("@heroicons/react/24/outline/EnvelopeIcon")),zi=require("react"),Ac=f(require("styled-components"));var Po=require("react/jsx-runtime"),Hs=(0,zi.forwardRef)((e,t)=>{let[o,r]=(0,zi.useState)(""),[n,i]=(0,zi.useState)(!1),{authenticated:a}=z(),{initLoginWithEmail:l}=W(),{navigate:s,setModalData:c,currentScreen:m}=S(),{enabled:h,token:g}=_e(),v=_a(o),b=n,E=n||!v,x=A=>{i(!0),l(o,A).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(R=>{c({errorModalData:{error:R,previousScreen:m||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},T=()=>{h&&!g&&!a?(c({captchaModalData:{callback:A=>l(o,A),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):x(g)};return(0,Po.jsxs)(Po.Fragment,{children:[(0,Po.jsx)(L1,{children:(0,Po.jsxs)(O1,{children:[(0,Po.jsx)(mh.default,{}),(0,Po.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:A=>r(A.target.value),onKeyUp:A=>{A.key==="Enter"&&T()},value:o,autoComplete:"email"}),e.stacked?null:(0,Po.jsx)(Un,{isSubmitting:b,onClick:T,disabled:E,children:"Submit"})]})}),e.stacked?(0,Po.jsx)(F,{loadingText:null,loading:b,disabled:E,onClick:T,children:"Submit"}):null]})}),L1=Ac.default.div`
1600
+ `;var xh=f(require("@heroicons/react/24/outline/UserCircleIcon")),Ji=require("react"),Sh=require("react-device-detect"),_h=f(require("styled-components"));var fh=f(require("@heroicons/react/24/outline/EnvelopeIcon")),hh=require("react");var mh=f(require("@heroicons/react/24/outline/EnvelopeIcon")),zi=require("react"),Ac=f(require("styled-components"));var Po=require("react/jsx-runtime"),Hs=(0,zi.forwardRef)((e,t)=>{let[o,r]=(0,zi.useState)(""),[n,i]=(0,zi.useState)(!1),{authenticated:a}=z(),{initLoginWithEmail:l}=W(),{navigate:s,setModalData:c,currentScreen:m}=_(),{enabled:h,token:g}=_e(),v=_a(o),b=n,T=n||!v,x=k=>{i(!0),l(o,k).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(I=>{c({errorModalData:{error:I,previousScreen:m||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},E=()=>{h&&!g&&!a?(c({captchaModalData:{callback:k=>l(o,k),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):x(g)};return(0,Po.jsxs)(Po.Fragment,{children:[(0,Po.jsx)(Lw,{children:(0,Po.jsxs)(Ow,{children:[(0,Po.jsx)(mh.default,{}),(0,Po.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:k=>r(k.target.value),onKeyUp:k=>{k.key==="Enter"&&E()},value:o,autoComplete:"email"}),e.stacked?null:(0,Po.jsx)(Un,{isSubmitting:b,onClick:E,disabled:T,children:"Submit"})]})}),e.stacked?(0,Po.jsx)(F,{loadingText:null,loading:b,disabled:T,onClick:E,children:"Submit"}):null]})}),Lw=Ac.default.div`
1601
1601
  width: 100%;
1602
- `,O1=Ac.default.label`
1602
+ `,Ow=Ac.default.label`
1603
1603
  display: block;
1604
1604
  position: relative;
1605
1605
  width: 100%;
@@ -1657,9 +1657,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
1657
1657
  && > input::placeholder {
1658
1658
  color: var(--privy-color-foreground-3);
1659
1659
  }
1660
- `;var Go=require("react/jsx-runtime"),Gs=({isEditable:e,setIsEditable:t})=>{let o=(0,hh.useRef)(null);return(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(ar,{if:!e,children:(0,Go.jsx)(Hs,{ref:o})}),(0,Go.jsx)(ar,{if:e,children:(0,Go.jsxs)(We,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[(0,Go.jsx)(fh.default,{})," Continue with Email"]})})]})};var yh=require("react");var ii=require("react/jsx-runtime"),Vs=()=>{let[e,t]=(0,yh.useState)(!1),{currentScreen:o,navigate:r,setModalData:n}=S(),{enabled:i,token:a}=_e(),{initLoginWithFarcaster:l}=W();return(0,ii.jsxs)(We,{onClick:async()=>{t(!0);try{i&&!a?(n({captchaModalData:{callback:c=>l(c),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):(await l(a),r("AWAITING_FARCASTER_CONNECTION"))}catch(c){n({errorModalData:{error:c,previousScreen:o||"LANDING"}}),r("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[(0,ii.jsx)(Vi,{})," Farcaster",e&&(0,ii.jsx)("span",{children:(0,ii.jsx)(Yr,{})})]})};var Eh=f(require("@heroicons/react/24/outline/PhoneIcon")),Th=require("react");var ai=require("react"),kc=f(require("styled-components"));var gh=f(require("libphonenumber-js/examples.mobile.json")),Bt=require("libphonenumber-js/min"),$s=require("react/jsx-runtime");var $i=(e,t)=>(0,Bt.isPossiblePhoneNumber)(String(e),t),zs=(e,t)=>`+${(0,Bt.getCountryCallingCode)(t)} ${e}`,vh=e=>`*${e.replaceAll("-","").slice(-4)}`,wh=e=>new Bt.AsYouType(e),D1=(0,Bt.getCountries)().map(e=>({code:e,callCode:(0,Bt.getCountryCallingCode)(e)})),Ch=e=>(0,Bt.getExampleNumber)(e,gh.default)?.formatNational(),bh=({value:e,onChange:t})=>(0,$s.jsx)("select",{value:e,onChange:t,children:D1.map(o=>(0,$s.jsxs)("option",{value:o.code,children:[o.code," +",o.callCode]},o.code))});var xo=require("react/jsx-runtime"),si=(0,ai.forwardRef)((e,t)=>{let{app:o}=S(),[r,n]=(0,ai.useState)(""),[i,a]=(0,ai.useState)(o?.intl.defaultCountry??"US"),l=$i(r,i),s=wh(i),c=Ch(i),m=(0,Bt.getCountryCallingCode)(i),h=!l,[g,v]=(0,ai.useState)(!1),b=m.length,E=A=>{let R=A.target.value;a(R),n(""),e.onChange&&e.onChange({rawPhoneNumber:r,qualifiedPhoneNumber:zs(r,R),countryCode:R,isValid:$i(r,i)})},x=A=>{try{let R=A.replace(/\D/g,""),I=r.replace(/\D/g,""),k=R===I?A:s.input(A);n(k),e.onChange&&e.onChange({rawPhoneNumber:k,qualifiedPhoneNumber:zs(A,i),countryCode:i,isValid:$i(A,i)})}catch(R){console.error("Error processing phone number:",R)}},T=()=>{v(!0);let A=zs(r,i);e.onSubmit({rawPhoneNumber:r,qualifiedPhoneNumber:A,countryCode:i,isValid:$i(r,i)}).finally(()=>v(!1))};return(0,xo.jsxs)(xo.Fragment,{children:[(0,xo.jsx)(U1,{children:(0,xo.jsxs)(F1,{callingCodeLength:b,children:[(0,xo.jsx)(bh,{value:i,onChange:E}),(0,xo.jsx)("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:c,onChange:A=>{x(A.target.value)},onKeyUp:A=>{A.key==="Enter"&&T()},value:r,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?(0,xo.jsx)(Un,{isSubmitting:g,onClick:T,disabled:h,children:"Submit"}):null]})}),e.stacked&&!e.noIncludeSubmitButton?(0,xo.jsx)(F,{loading:g,loadingText:null,onClick:T,disabled:h,children:"Submit"}):null]})}),U1=kc.default.div`
1660
+ `;var Go=require("react/jsx-runtime"),Gs=({isEditable:e,setIsEditable:t})=>{let o=(0,hh.useRef)(null);return(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(ar,{if:!e,children:(0,Go.jsx)(Hs,{ref:o})}),(0,Go.jsx)(ar,{if:e,children:(0,Go.jsxs)(We,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[(0,Go.jsx)(fh.default,{})," Continue with Email"]})})]})};var yh=require("react");var ii=require("react/jsx-runtime"),Vs=()=>{let[e,t]=(0,yh.useState)(!1),{currentScreen:o,navigate:r,setModalData:n}=_(),{enabled:i,token:a}=_e(),{initLoginWithFarcaster:l}=W();return(0,ii.jsxs)(We,{onClick:async()=>{t(!0);try{i&&!a?(n({captchaModalData:{callback:c=>l(c),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):(await l(a),r("AWAITING_FARCASTER_CONNECTION"))}catch(c){n({errorModalData:{error:c,previousScreen:o||"LANDING"}}),r("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[(0,ii.jsx)(Vi,{})," Farcaster",e&&(0,ii.jsx)("span",{children:(0,ii.jsx)(Yr,{})})]})};var Eh=f(require("@heroicons/react/24/outline/PhoneIcon")),Th=require("react");var ai=require("react"),kc=f(require("styled-components"));var gh=f(require("libphonenumber-js/examples.mobile.json")),Bt=require("libphonenumber-js/min"),$s=require("react/jsx-runtime");var $i=(e,t)=>(0,Bt.isPossiblePhoneNumber)(String(e),t),zs=(e,t)=>`+${(0,Bt.getCountryCallingCode)(t)} ${e}`,vh=e=>`*${e.replaceAll("-","").slice(-4)}`,wh=e=>new Bt.AsYouType(e),Dw=(0,Bt.getCountries)().map(e=>({code:e,callCode:(0,Bt.getCountryCallingCode)(e)})),Ch=e=>(0,Bt.getExampleNumber)(e,gh.default)?.formatNational(),bh=({value:e,onChange:t})=>(0,$s.jsx)("select",{value:e,onChange:t,children:Dw.map(o=>(0,$s.jsxs)("option",{value:o.code,children:[o.code," +",o.callCode]},o.code))});var xo=require("react/jsx-runtime"),si=(0,ai.forwardRef)((e,t)=>{let{app:o}=_(),[r,n]=(0,ai.useState)(""),[i,a]=(0,ai.useState)(o?.intl.defaultCountry??"US"),l=$i(r,i),s=wh(i),c=Ch(i),m=(0,Bt.getCountryCallingCode)(i),h=!l,[g,v]=(0,ai.useState)(!1),b=m.length,T=k=>{let I=k.target.value;a(I),n(""),e.onChange&&e.onChange({rawPhoneNumber:r,qualifiedPhoneNumber:zs(r,I),countryCode:I,isValid:$i(r,i)})},x=k=>{try{let I=k.replace(/\D/g,""),M=r.replace(/\D/g,""),S=I===M?k:s.input(k);n(S),e.onChange&&e.onChange({rawPhoneNumber:S,qualifiedPhoneNumber:zs(k,i),countryCode:i,isValid:$i(k,i)})}catch(I){console.error("Error processing phone number:",I)}},E=()=>{v(!0);let k=zs(r,i);e.onSubmit({rawPhoneNumber:r,qualifiedPhoneNumber:k,countryCode:i,isValid:$i(r,i)}).finally(()=>v(!1))};return(0,xo.jsxs)(xo.Fragment,{children:[(0,xo.jsx)(Uw,{children:(0,xo.jsxs)(Fw,{callingCodeLength:b,children:[(0,xo.jsx)(bh,{value:i,onChange:T}),(0,xo.jsx)("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:c,onChange:k=>{x(k.target.value)},onKeyUp:k=>{k.key==="Enter"&&E()},value:r,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?(0,xo.jsx)(Un,{isSubmitting:g,onClick:E,disabled:h,children:"Submit"}):null]})}),e.stacked&&!e.noIncludeSubmitButton?(0,xo.jsx)(F,{loading:g,loadingText:null,onClick:E,disabled:h,children:"Submit"}):null]})}),Uw=kc.default.div`
1661
1661
  width: 100%;
1662
- `,F1=kc.default.label`
1662
+ `,Fw=kc.default.label`
1663
1663
  --country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
1664
1664
  --phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px));
1665
1665
  display: block;
@@ -1745,11 +1745,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1745
1745
  && > input::placeholder {
1746
1746
  color: var(--privy-color-foreground-3);
1747
1747
  }
1748
- `;var Vo=require("react/jsx-runtime"),qs=({isEditable:e,setIsEditable:t})=>{let o=(0,Th.useRef)(null),{authenticated:r}=z(),{navigate:n,setModalData:i,currentScreen:a}=S(),{initLoginWithSms:l}=W(),{enabled:s,token:c}=_e();async function m({qualifiedPhoneNumber:h}){if(s&&!c&&!r)i({captchaModalData:{callback:g=>l(h,g),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(h,c),n("AWAITING_PASSWORDLESS_CODE")}catch(g){i({errorModalData:{error:g,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return(0,Vo.jsxs)(Vo.Fragment,{children:[(0,Vo.jsx)(ar,{if:!e,children:(0,Vo.jsx)(si,{ref:o,onSubmit:m})}),(0,Vo.jsx)(ar,{if:e,children:(0,Vo.jsxs)(We,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[(0,Vo.jsx)(Eh.default,{})," Continue with SMS"]})})]})};var qi=require("react/jsx-runtime"),js=({style:e,...t})=>(0,qi.jsxs)("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:[(0,qi.jsx)("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"}),(0,qi.jsx)("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"})]});var Br=require("react/jsx-runtime"),Ks=({style:e,...t})=>(0,Br.jsxs)("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:[(0,Br.jsx)("g",{clipPath:"url(#clip0)",children:(0,Br.jsx)("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"})}),(0,Br.jsx)("defs",{children:(0,Br.jsx)("clipPath",{id:"clip0",children:(0,Br.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var Rc=require("react/jsx-runtime"),Ys=({style:e,...t})=>(0,Rc.jsx)("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:(0,Rc.jsx)("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:"#171515"})});var an=require("react/jsx-runtime"),Js=({style:e,...t})=>(0,an.jsxs)("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:[(0,an.jsx)("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"}),(0,an.jsx)("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"}),(0,an.jsx)("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"}),(0,an.jsx)("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"})]});var ji=require("react/jsx-runtime");function Qs({style:e,...t}){return(0,ji.jsx)("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:(0,ji.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,ji.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,ji.jsx)("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"})})})})}var Ki=require("react/jsx-runtime");function Zs(e){return(0,Ki.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,Ki.jsx)("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"}),(0,Ki.jsx)("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"})]})}var li=require("react/jsx-runtime");function Xs(e){return(0,li.jsxs)("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:[(0,li.jsx)("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"}),(0,li.jsx)("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"}),(0,li.jsx)("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"})]})}var Ic=require("react/jsx-runtime"),el=({style:e,...t})=>(0,Ic.jsx)("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:(0,Ic.jsx)("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:"#000000"})});var So=require("react/jsx-runtime"),B1={apple:{logo:(0,So.jsx)(js,{}),displayName:"Apple"},discord:{logo:(0,So.jsx)(Ks,{}),displayName:"Discord"},github:{logo:(0,So.jsx)(Ys,{}),displayName:"GitHub"},google:{logo:(0,So.jsx)(Js,{}),displayName:"Google"},linkedin:{logo:(0,So.jsx)(Qs,{}),displayName:"LinkedIn"},spotify:{logo:(0,So.jsx)(Zs,{}),displayName:"Spotify"},twitter:{logo:(0,So.jsx)(el,{}),displayName:"Twitter"},tiktok:{logo:(0,So.jsx)(Xs,{}),displayName:"TikTok"}},tt=({provider:e})=>{let{enabled:t,token:o}=_e(),{navigate:r,setModalData:n}=S(),{initLoginWithOAuth:i}=W(),{displayName:a,logo:l}=B1[e];return(0,So.jsxs)(We,{onClick:()=>{t&&!o?(n({captchaModalData:{callback:c=>i(e,c),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):i(e)},children:[l," ",a]})};var Ph=f(require("@heroicons/react/24/outline/ChevronRightIcon"));var Yi=require("react/jsx-runtime"),tl=({onClick:e,text:t,icon:o})=>(0,Yi.jsxs)(We,{onClick:e,children:[o,(0,Yi.jsx)(ys,{children:t}),(0,Yi.jsx)(Ph.default,{})]});var be=require("react/jsx-runtime"),rl=({connectOnly:e})=>{let{closePrivyModal:t,connectors:o}=W(),{app:r,onUserCloseViaDialogOrKeybindRef:n}=S(),i=r.loginMethodsAndOrder?.primary??[],a=r.loginMethodsAndOrder?.overflow??[],l=[...i,...a],[s,c]=(0,Ji.useState)("default"),[m,h]=(0,Ji.useState)("email");(0,Ji.useEffect)(()=>{let k=l.indexOf("sms"),D=l.indexOf("email");k>-1&&k<D&&h("sms")},[i,a]);let g=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{c("default")},150)};n.current=g;let v=k=>k==="email"?(0,be.jsx)(Gs,{isEditable:m==="email",setIsEditable:()=>{h("email")}},k):k==="sms"?(0,be.jsx)(qs,{isEditable:m==="sms",setIsEditable:()=>{h("sms")}},k):k==="apple"?(0,be.jsx)(tt,{provider:"apple"},k):k==="discord"?(0,be.jsx)(tt,{provider:"discord"},k):k==="farcaster"?(0,be.jsx)(Vs,{},k):k==="github"?(0,be.jsx)(tt,{provider:"github"},k):k==="google"?(0,be.jsx)(tt,{provider:"google"},k):k==="linkedin"?(0,be.jsx)(tt,{provider:"linkedin"},k):k==="tiktok"?(0,be.jsx)(tt,{provider:"tiktok"},k):k==="twitter"&&(!Sh.isMobile||r?.loginConfig.twitterOAuthOnMobileEnabled)?(0,be.jsx)(tt,{provider:"twitter"},k):Li([k],o,e,l),b=i.map(v).flat(),E=a.map(v).flat(),x=[...b,...E],T=H1({primary:b.length,overflow:E.length}),[A,R]=cp(x,T);return(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(_,{title:"Log in or sign up",onClose:g,backFn:s==="default"?void 0:()=>{c("default")}}),s==="default"&&(0,be.jsx)(G1,{}),(0,be.jsx)(gs,{style:{overflow:"hidden",padding:2},children:(0,be.jsxs)(eo,{children:[s==="default"&&(0,be.jsxs)(be.Fragment,{children:[...A,R.length>0&&(0,be.jsx)(tl,{text:"More options",icon:(0,be.jsx)(xh.default,{}),onClick:()=>c("overflow")})]}),s==="overflow"&&(0,be.jsxs)(be.Fragment,{children:[...R]})]})}),r&&(0,be.jsx)(Fn,{app:r}),(0,be.jsx)($,{protectedByPrivy:!0})]})},ol=5,H1=({primary:e,overflow:t})=>e<ol?e:e===ol&&t===0?ol:ol-1,G1=(0,_h.default)(zn)`
1748
+ `;var Vo=require("react/jsx-runtime"),qs=({isEditable:e,setIsEditable:t})=>{let o=(0,Th.useRef)(null),{authenticated:r}=z(),{navigate:n,setModalData:i,currentScreen:a}=_(),{initLoginWithSms:l}=W(),{enabled:s,token:c}=_e();async function m({qualifiedPhoneNumber:h}){if(s&&!c&&!r)i({captchaModalData:{callback:g=>l(h,g),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(h,c),n("AWAITING_PASSWORDLESS_CODE")}catch(g){i({errorModalData:{error:g,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return(0,Vo.jsxs)(Vo.Fragment,{children:[(0,Vo.jsx)(ar,{if:!e,children:(0,Vo.jsx)(si,{ref:o,onSubmit:m})}),(0,Vo.jsx)(ar,{if:e,children:(0,Vo.jsxs)(We,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[(0,Vo.jsx)(Eh.default,{})," Continue with SMS"]})})]})};var qi=require("react/jsx-runtime"),js=({style:e,...t})=>(0,qi.jsxs)("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:[(0,qi.jsx)("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"}),(0,qi.jsx)("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"})]});var Br=require("react/jsx-runtime"),Ks=({style:e,...t})=>(0,Br.jsxs)("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:[(0,Br.jsx)("g",{clipPath:"url(#clip0)",children:(0,Br.jsx)("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"})}),(0,Br.jsx)("defs",{children:(0,Br.jsx)("clipPath",{id:"clip0",children:(0,Br.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var Rc=require("react/jsx-runtime"),Ys=({style:e,...t})=>(0,Rc.jsx)("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:(0,Rc.jsx)("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:"#171515"})});var an=require("react/jsx-runtime"),Js=({style:e,...t})=>(0,an.jsxs)("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:[(0,an.jsx)("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"}),(0,an.jsx)("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"}),(0,an.jsx)("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"}),(0,an.jsx)("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"})]});var ji=require("react/jsx-runtime");function Qs({style:e,...t}){return(0,ji.jsx)("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:(0,ji.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,ji.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,ji.jsx)("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"})})})})}var Ki=require("react/jsx-runtime");function Zs(e){return(0,Ki.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,Ki.jsx)("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"}),(0,Ki.jsx)("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"})]})}var li=require("react/jsx-runtime");function Xs(e){return(0,li.jsxs)("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:[(0,li.jsx)("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"}),(0,li.jsx)("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"}),(0,li.jsx)("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"})]})}var Ic=require("react/jsx-runtime"),el=({style:e,...t})=>(0,Ic.jsx)("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:(0,Ic.jsx)("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:"#000000"})});var So=require("react/jsx-runtime"),Bw={apple:{logo:(0,So.jsx)(js,{}),displayName:"Apple"},discord:{logo:(0,So.jsx)(Ks,{}),displayName:"Discord"},github:{logo:(0,So.jsx)(Ys,{}),displayName:"GitHub"},google:{logo:(0,So.jsx)(Js,{}),displayName:"Google"},linkedin:{logo:(0,So.jsx)(Qs,{}),displayName:"LinkedIn"},spotify:{logo:(0,So.jsx)(Zs,{}),displayName:"Spotify"},twitter:{logo:(0,So.jsx)(el,{}),displayName:"Twitter"},tiktok:{logo:(0,So.jsx)(Xs,{}),displayName:"TikTok"}},tt=({provider:e})=>{let{enabled:t,token:o}=_e(),{navigate:r,setModalData:n}=_(),{initLoginWithOAuth:i}=W(),{displayName:a,logo:l}=Bw[e];return(0,So.jsxs)(We,{onClick:()=>{t&&!o?(n({captchaModalData:{callback:c=>i(e,c),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):i(e)},children:[l," ",a]})};var Ph=f(require("@heroicons/react/24/outline/ChevronRightIcon"));var Yi=require("react/jsx-runtime"),tl=({onClick:e,text:t,icon:o})=>(0,Yi.jsxs)(We,{onClick:e,children:[o,(0,Yi.jsx)(ys,{children:t}),(0,Yi.jsx)(Ph.default,{})]});var be=require("react/jsx-runtime"),rl=({connectOnly:e})=>{let{closePrivyModal:t,connectors:o}=W(),{app:r,onUserCloseViaDialogOrKeybindRef:n}=_(),i=r.loginMethodsAndOrder?.primary??[],a=r.loginMethodsAndOrder?.overflow??[],l=[...i,...a],[s,c]=(0,Ji.useState)("default"),[m,h]=(0,Ji.useState)("email");(0,Ji.useEffect)(()=>{let S=l.indexOf("sms"),O=l.indexOf("email");S>-1&&S<O&&h("sms")},[i,a]);let g=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{c("default")},150)};n.current=g;let v=S=>S==="email"?(0,be.jsx)(Gs,{isEditable:m==="email",setIsEditable:()=>{h("email")}},S):S==="sms"?(0,be.jsx)(qs,{isEditable:m==="sms",setIsEditable:()=>{h("sms")}},S):S==="apple"?(0,be.jsx)(tt,{provider:"apple"},S):S==="discord"?(0,be.jsx)(tt,{provider:"discord"},S):S==="farcaster"?(0,be.jsx)(Vs,{},S):S==="github"?(0,be.jsx)(tt,{provider:"github"},S):S==="google"?(0,be.jsx)(tt,{provider:"google"},S):S==="linkedin"?(0,be.jsx)(tt,{provider:"linkedin"},S):S==="tiktok"?(0,be.jsx)(tt,{provider:"tiktok"},S):S==="twitter"&&(!Sh.isMobile||r?.loginConfig.twitterOAuthOnMobileEnabled)?(0,be.jsx)(tt,{provider:"twitter"},S):Li([S],o,e,l),b=i.map(v).flat(),T=a.map(v).flat(),x=[...b,...T],E=Hw({primary:b.length,overflow:T.length}),[k,I]=cp(x,E);return(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(A,{title:"Log in or sign up",onClose:g,backFn:s==="default"?void 0:()=>{c("default")}}),s==="default"&&(0,be.jsx)(Gw,{}),(0,be.jsx)(gs,{style:{overflow:"hidden",padding:2},children:(0,be.jsxs)(eo,{children:[s==="default"&&(0,be.jsxs)(be.Fragment,{children:[...k,I.length>0&&(0,be.jsx)(tl,{text:"More options",icon:(0,be.jsx)(xh.default,{}),onClick:()=>c("overflow")})]}),s==="overflow"&&(0,be.jsxs)(be.Fragment,{children:[...I]})]})}),r&&(0,be.jsx)(Fn,{app:r}),(0,be.jsx)($,{protectedByPrivy:!0})]})},ol=5,Hw=({primary:e,overflow:t})=>e<ol?e:e===ol&&t===0?ol:ol-1,Gw=(0,_h.default)(zn)`
1749
1749
  margin-bottom: 16px;
1750
- `;var Mh=f(require("@heroicons/react/24/outline/EnvelopeIcon")),Wh=f(require("@heroicons/react/24/outline/PhoneIcon")),Nh=f(require("@heroicons/react/24/outline/UserCircleIcon")),Qi=require("react"),Lh=require("react-device-detect"),Oh=f(require("styled-components"));var mr=require("react/jsx-runtime"),Ah=({...e})=>(0,mr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[(0,mr.jsxs)("g",{clipPath:"url(#clip0_2856_1743)",children:[(0,mr.jsx)("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"}),(0,mr.jsx)("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"})]}),(0,mr.jsx)("defs",{children:(0,mr.jsx)("clipPath",{id:"clip0_2856_1743",children:(0,mr.jsx)("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});var kh=f(require("@heroicons/react/24/outline/ChevronRightIcon")),Rh=f(require("@heroicons/react/24/outline/WalletIcon"));var ci=require("react/jsx-runtime"),Ih=({onClick:e,text:t})=>(0,ci.jsxs)(We,{onClick:e,children:[(0,ci.jsx)(Rh.default,{}),(0,ci.jsx)(ys,{children:t}),(0,ci.jsx)(kh.default,{})]});var te=require("react/jsx-runtime"),nl=({connectOnly:e})=>{let{closePrivyModal:t,connectors:o}=W(),{app:r,onUserCloseViaDialogOrKeybindRef:n}=S(),{email:i,sms:a,google:l,twitter:s,discord:c,github:m,spotify:h,tiktok:g,linkedin:v,apple:b,wallet:E,farcaster:x}=r?.loginMethods??{},T=r?.appearance.loginGroupPriority||"web2-first",A=r?.appearance.hideDirectWeb2Inputs,[R,I]=(0,Qi.useState)("default"),[k,D]=(0,Qi.useState)(i?"email":"sms");(0,Qi.useEffect)(()=>{D(i?"email":"sms")},[i]);let U=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{I("default")},150)};n.current=U;let B=[i&&(0,te.jsx)(Gs,{isEditable:k==="email",setIsEditable:()=>{D("email")}}),a&&(0,te.jsx)(qs,{isEditable:k==="sms",setIsEditable:()=>{D("sms")}})].filter(Boolean),G=[l&&(0,te.jsx)(tt,{provider:"google"}),s&&(!Lh.isMobile||r?.loginConfig.twitterOAuthOnMobileEnabled)&&(0,te.jsx)(tt,{provider:"twitter"}),c&&(0,te.jsx)(tt,{provider:"discord"}),m&&(0,te.jsx)(tt,{provider:"github"}),h&&(0,te.jsx)(tt,{provider:"spotify"}),g&&(0,te.jsx)(tt,{provider:"tiktok"}),v&&(0,te.jsx)(tt,{provider:"linkedin"}),b&&(0,te.jsx)(tt,{provider:"apple"}),x&&(0,te.jsx)(Vs,{})].filter(Boolean),j=Li(r.appearance.walletList,o,e,r.appearance.walletList),O=R==="default"?void 0:()=>{I("default")},K=z1({priority:T,email:i,sms:a,social:G}),M=$1({priority:T,email:i,sms:a,social:G}),pe=q1({priority:T,email:i,sms:a,social:G}),he=(0,te.jsx)(Ih,{text:pe,onClick:()=>I("web3-overflow")}),Q=(0,te.jsx)(tl,{text:K,icon:M,onClick:()=>I("web2-overflow")}),ct=A?0:1;return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(_,{title:"Log in or sign up",onClose:U,backFn:O}),R==="default"&&(0,te.jsx)(V1,{}),(0,te.jsx)(gs,{style:{overflow:"hidden",padding:2},children:(0,te.jsxs)(eo,{children:[R==="default"&&T==="web2-first"&&(0,te.jsxs)(te.Fragment,{children:[...B,...G.length+B.length>4?G.slice(0,3-B.length):G,B.length+G.length>4&&Q,E&&he]}),R==="default"&&T==="web3-first"&&(0,te.jsxs)(te.Fragment,{children:[E&&(0,te.jsxs)(te.Fragment,{children:[...j.length>4?j.slice(0,3):j,j.length>4&&he]}),B.length+G.length>ct&&Q,B.length+G.length===ct&&B.length?B[0]:null,B.length+G.length===ct&&G.length?G[0]:null]}),R==="web2-overflow"&&(0,te.jsxs)(te.Fragment,{children:[...T==="web3-first"?B:[],...G]}),...R==="web3-overflow"?j:[]]})}),r&&(0,te.jsx)(Fn,{app:r}),(0,te.jsx)($,{protectedByPrivy:!0})]})},V1=(0,Oh.default)(zn)`
1750
+ `;var Mh=f(require("@heroicons/react/24/outline/EnvelopeIcon")),Wh=f(require("@heroicons/react/24/outline/PhoneIcon")),Nh=f(require("@heroicons/react/24/outline/UserCircleIcon")),Qi=require("react"),Lh=require("react-device-detect"),Oh=f(require("styled-components"));var mr=require("react/jsx-runtime"),Ah=({...e})=>(0,mr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[(0,mr.jsxs)("g",{clipPath:"url(#clip0_2856_1743)",children:[(0,mr.jsx)("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"}),(0,mr.jsx)("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"})]}),(0,mr.jsx)("defs",{children:(0,mr.jsx)("clipPath",{id:"clip0_2856_1743",children:(0,mr.jsx)("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});var kh=f(require("@heroicons/react/24/outline/ChevronRightIcon")),Rh=f(require("@heroicons/react/24/outline/WalletIcon"));var ci=require("react/jsx-runtime"),Ih=({onClick:e,text:t})=>(0,ci.jsxs)(We,{onClick:e,children:[(0,ci.jsx)(Rh.default,{}),(0,ci.jsx)(ys,{children:t}),(0,ci.jsx)(kh.default,{})]});var te=require("react/jsx-runtime"),nl=({connectOnly:e})=>{let{closePrivyModal:t,connectors:o}=W(),{app:r,onUserCloseViaDialogOrKeybindRef:n}=_(),{email:i,sms:a,google:l,twitter:s,discord:c,github:m,spotify:h,tiktok:g,linkedin:v,apple:b,wallet:T,farcaster:x}=r?.loginMethods??{},E=r?.appearance.loginGroupPriority||"web2-first",k=r?.appearance.hideDirectWeb2Inputs,[I,M]=(0,Qi.useState)("default"),[S,O]=(0,Qi.useState)(i?"email":"sms");(0,Qi.useEffect)(()=>{O(i?"email":"sms")},[i]);let D=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{M("default")},150)};n.current=D;let B=[i&&(0,te.jsx)(Gs,{isEditable:S==="email",setIsEditable:()=>{O("email")}}),a&&(0,te.jsx)(qs,{isEditable:S==="sms",setIsEditable:()=>{O("sms")}})].filter(Boolean),G=[l&&(0,te.jsx)(tt,{provider:"google"}),s&&(!Lh.isMobile||r?.loginConfig.twitterOAuthOnMobileEnabled)&&(0,te.jsx)(tt,{provider:"twitter"}),c&&(0,te.jsx)(tt,{provider:"discord"}),m&&(0,te.jsx)(tt,{provider:"github"}),h&&(0,te.jsx)(tt,{provider:"spotify"}),g&&(0,te.jsx)(tt,{provider:"tiktok"}),v&&(0,te.jsx)(tt,{provider:"linkedin"}),b&&(0,te.jsx)(tt,{provider:"apple"}),x&&(0,te.jsx)(Vs,{})].filter(Boolean),K=Li(r.appearance.walletList,o,e,r.appearance.walletList),U=I==="default"?void 0:()=>{M("default")},j=zw({priority:E,email:i,sms:a,social:G}),R=$w({priority:E,email:i,sms:a,social:G}),le=qw({priority:E,email:i,sms:a,social:G}),ue=(0,te.jsx)(Ih,{text:le,onClick:()=>M("web3-overflow")}),Q=(0,te.jsx)(tl,{text:j,icon:R,onClick:()=>M("web2-overflow")}),ct=k?0:1;return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(A,{title:"Log in or sign up",onClose:D,backFn:U}),I==="default"&&(0,te.jsx)(Vw,{}),(0,te.jsx)(gs,{style:{overflow:"hidden",padding:2},children:(0,te.jsxs)(eo,{children:[I==="default"&&E==="web2-first"&&(0,te.jsxs)(te.Fragment,{children:[...B,...G.length+B.length>4?G.slice(0,3-B.length):G,B.length+G.length>4&&Q,T&&ue]}),I==="default"&&E==="web3-first"&&(0,te.jsxs)(te.Fragment,{children:[T&&(0,te.jsxs)(te.Fragment,{children:[...K.length>4?K.slice(0,3):K,K.length>4&&ue]}),B.length+G.length>ct&&Q,B.length+G.length===ct&&B.length?B[0]:null,B.length+G.length===ct&&G.length?G[0]:null]}),I==="web2-overflow"&&(0,te.jsxs)(te.Fragment,{children:[...E==="web3-first"?B:[],...G]}),...I==="web3-overflow"?K:[]]})}),r&&(0,te.jsx)(Fn,{app:r}),(0,te.jsx)($,{protectedByPrivy:!0})]})},Vw=(0,Oh.default)(zn)`
1751
1751
  margin-bottom: 16px;
1752
- `,z1=({priority:e,email:t,sms:o,social:r})=>e==="web2-first"?"Other socials":t&&o&&r.length>0||t&&r.length>0?"Log in with email or socials":o&&r.length>0?"Log in with sms or socials":t&&o?"Continue with email or sms":t?"Continue with email":o?"Continue with sms":"Log in with a social account",$1=({priority:e,email:t,sms:o,social:r})=>e==="web2-first"||r.length>0?(0,te.jsx)(Nh.default,{}):t&&o?(0,te.jsx)(Ah,{}):t?(0,te.jsx)(Mh.default,{}):o?(0,te.jsx)(Wh.default,{}):null,q1=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";var Mc=require("react/jsx-runtime"),Dh=()=>{let{app:e}=S();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Mc.jsx)(rl,{connectOnly:!0}):(0,Mc.jsx)(nl,{connectOnly:!0})};var Wc=require("react/jsx-runtime"),Uh=()=>{let{app:e}=S();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Wc.jsx)(rl,{connectOnly:!1}):(0,Wc.jsx)(nl,{connectOnly:!1})};var Fh=f(require("@heroicons/react/24/outline/EnvelopeIcon"));var Ht=require("react/jsx-runtime"),Bh=()=>{let{app:e}=S();return(0,Ht.jsxs)(Ht.Fragment,{children:[(0,Ht.jsx)(_,{},"header"),(0,Ht.jsx)(X,{}),(0,Ht.jsx)(Le,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:(0,Ht.jsx)(Fh.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Ht.jsx)(to,{children:(0,Ht.jsx)(Hs,{stacked:!0})}),(0,Ht.jsx)(ee,{}),(0,Ht.jsx)($,{protectedByPrivy:!0})]})};var Hh=f(require("@heroicons/react/24/outline/PhoneIcon"));var Gt=require("react/jsx-runtime"),Gh=()=>{let{app:e,currentScreen:t,data:o,navigate:r,setModalData:n}=S(),{initLoginWithSms:i}=W();async function a({qualifiedPhoneNumber:l}){try{await i(l),r("AWAITING_PASSWORDLESS_CODE")}catch(s){n({errorModalData:{error:s,previousScreen:o?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),r("ERROR_SCREEN")}}return(0,Gt.jsxs)(Gt.Fragment,{children:[(0,Gt.jsx)(_,{},"header"),(0,Gt.jsx)(X,{}),(0,Gt.jsx)(Le,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:(0,Gt.jsx)(Hh.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),(0,Gt.jsx)(to,{children:(0,Gt.jsx)(si,{stacked:!0,onSubmit:a})}),(0,Gt.jsx)(ee,{}),(0,Gt.jsx)($,{protectedByPrivy:!0})]})};var zo=require("react/jsx-runtime"),Vh=()=>{let{linkingHint:e}=W(),{app:t}=S(),o=e?`Select the wallet with ${Tr(e)} and follow the instructions to reconnect your wallet${t?.name?` to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return(0,zo.jsxs)(zo.Fragment,{children:[(0,zo.jsx)(_,{},"header"),(0,zo.jsx)(Uo,{title:`${e?"Reconnect":"Connect"} your wallet`,description:o}),(0,zo.jsx)(eo,{children:(0,zo.jsx)(Vn,{connectOnly:!1})}),(0,zo.jsx)($,{protectedByPrivy:!0})]})};var Zi=require("react/jsx-runtime"),zh=({style:e,...t})=>(0,Zi.jsxs)("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:[(0,Zi.jsx)("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),(0,Zi.jsx)("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"})]});var Rt=require("react/jsx-runtime"),$h=()=>{let{closePrivyModal:e}=W(),{navigate:t}=S();return(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)(_,{},"header"),(0,Rt.jsx)(X,{}),(0,Rt.jsx)(zh,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),(0,Rt.jsx)(Uo,{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"}}),(0,Rt.jsxs)(to,{children:[(0,Rt.jsx)(F,{onClick:()=>t("LANDING"),children:"Try again"}),(0,Rt.jsx)(go,{onClick:()=>e(),children:"Cancel"})]}),(0,Rt.jsx)(ee,{}),(0,Rt.jsx)($,{protectedByPrivy:!0})]})};var Oc=f(require("@heroicons/react/20/solid/CheckIcon")),ry=f(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),ny=f(require("@heroicons/react/24/outline/FingerPrintIcon")),iy=f(require("@heroicons/react/24/outline/PhoneIcon")),Dc=f(require("@heroicons/react/24/outline/TrashIcon")),ay=f(require("@heroicons/react/24/solid/CheckBadgeIcon")),Uc=f(require("@heroicons/react/24/solid/CheckCircleIcon")),Fc=f(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),sy=f(require("@heroicons/react/24/solid/IdentificationIcon")),ll=f(require("@heroicons/react/24/solid/PhoneIcon")),sl=f(require("@heroicons/react/24/solid/ShieldCheckIcon")),Vt=require("react");var al=require("react"),Yh=require("react-device-detect"),Lc=f(require("styled-components"));var sn=require("@headlessui/react"),il=f(require("react")),ln=f(require("styled-components")),fr=require("react/jsx-runtime"),qh=({children:e,open:t,onClick:o,...r})=>(0,fr.jsx)(sn.Transition,{show:t,as:il.default.Fragment,children:(0,fr.jsxs)(sn.Dialog,{onClose:o,...r,as:K1,children:[(0,fr.jsx)(sn.Transition.Child,{as:il.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,fr.jsx)(j1,{"aria-hidden":"true"})}),(0,fr.jsx)(Y1,{children:(0,fr.jsx)(sn.Transition.Child,{as:il.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,fr.jsx)(sn.Dialog.Panel,{as:J1,children:e})})})]})}),di=ln.default.div`
1752
+ `,zw=({priority:e,email:t,sms:o,social:r})=>e==="web2-first"?"Other socials":t&&o&&r.length>0||t&&r.length>0?"Log in with email or socials":o&&r.length>0?"Log in with sms or socials":t&&o?"Continue with email or sms":t?"Continue with email":o?"Continue with sms":"Log in with a social account",$w=({priority:e,email:t,sms:o,social:r})=>e==="web2-first"||r.length>0?(0,te.jsx)(Nh.default,{}):t&&o?(0,te.jsx)(Ah,{}):t?(0,te.jsx)(Mh.default,{}):o?(0,te.jsx)(Wh.default,{}):null,qw=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";var Mc=require("react/jsx-runtime"),Dh=()=>{let{app:e}=_();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Mc.jsx)(rl,{connectOnly:!0}):(0,Mc.jsx)(nl,{connectOnly:!0})};var Wc=require("react/jsx-runtime"),Uh=()=>{let{app:e}=_();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Wc.jsx)(rl,{connectOnly:!1}):(0,Wc.jsx)(nl,{connectOnly:!1})};var Fh=f(require("@heroicons/react/24/outline/EnvelopeIcon"));var Ht=require("react/jsx-runtime"),Bh=()=>{let{app:e}=_();return(0,Ht.jsxs)(Ht.Fragment,{children:[(0,Ht.jsx)(A,{},"header"),(0,Ht.jsx)(X,{}),(0,Ht.jsx)(Le,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:(0,Ht.jsx)(Fh.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Ht.jsx)(to,{children:(0,Ht.jsx)(Hs,{stacked:!0})}),(0,Ht.jsx)(ee,{}),(0,Ht.jsx)($,{protectedByPrivy:!0})]})};var Hh=f(require("@heroicons/react/24/outline/PhoneIcon"));var Gt=require("react/jsx-runtime"),Gh=()=>{let{app:e,currentScreen:t,data:o,navigate:r,setModalData:n}=_(),{initLoginWithSms:i}=W();async function a({qualifiedPhoneNumber:l}){try{await i(l),r("AWAITING_PASSWORDLESS_CODE")}catch(s){n({errorModalData:{error:s,previousScreen:o?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),r("ERROR_SCREEN")}}return(0,Gt.jsxs)(Gt.Fragment,{children:[(0,Gt.jsx)(A,{},"header"),(0,Gt.jsx)(X,{}),(0,Gt.jsx)(Le,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:(0,Gt.jsx)(Hh.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),(0,Gt.jsx)(to,{children:(0,Gt.jsx)(si,{stacked:!0,onSubmit:a})}),(0,Gt.jsx)(ee,{}),(0,Gt.jsx)($,{protectedByPrivy:!0})]})};var zo=require("react/jsx-runtime"),Vh=()=>{let{linkingHint:e}=W(),{app:t}=_(),o=e?`Select the wallet with ${Tr(e)} and follow the instructions to reconnect your wallet${t?.name?` to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return(0,zo.jsxs)(zo.Fragment,{children:[(0,zo.jsx)(A,{},"header"),(0,zo.jsx)(Uo,{title:`${e?"Reconnect":"Connect"} your wallet`,description:o}),(0,zo.jsx)(eo,{children:(0,zo.jsx)(Vn,{connectOnly:!1})}),(0,zo.jsx)($,{protectedByPrivy:!0})]})};var Zi=require("react/jsx-runtime"),zh=({style:e,...t})=>(0,Zi.jsxs)("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:[(0,Zi.jsx)("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),(0,Zi.jsx)("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"})]});var Rt=require("react/jsx-runtime"),$h=()=>{let{closePrivyModal:e}=W(),{navigate:t}=_();return(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)(A,{},"header"),(0,Rt.jsx)(X,{}),(0,Rt.jsx)(zh,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),(0,Rt.jsx)(Uo,{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"}}),(0,Rt.jsxs)(to,{children:[(0,Rt.jsx)(F,{onClick:()=>t("LANDING"),children:"Try again"}),(0,Rt.jsx)(go,{onClick:()=>e(),children:"Cancel"})]}),(0,Rt.jsx)(ee,{}),(0,Rt.jsx)($,{protectedByPrivy:!0})]})};var Oc=f(require("@heroicons/react/20/solid/CheckIcon")),ry=f(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),ny=f(require("@heroicons/react/24/outline/FingerPrintIcon")),iy=f(require("@heroicons/react/24/outline/PhoneIcon")),Dc=f(require("@heroicons/react/24/outline/TrashIcon")),ay=f(require("@heroicons/react/24/solid/CheckBadgeIcon")),Uc=f(require("@heroicons/react/24/solid/CheckCircleIcon")),Fc=f(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),sy=f(require("@heroicons/react/24/solid/IdentificationIcon")),ll=f(require("@heroicons/react/24/solid/PhoneIcon")),sl=f(require("@heroicons/react/24/solid/ShieldCheckIcon")),Vt=require("react");var al=require("react"),Yh=require("react-device-detect"),Lc=f(require("styled-components"));var sn=require("@headlessui/react"),il=f(require("react")),ln=f(require("styled-components")),fr=require("react/jsx-runtime"),qh=({children:e,open:t,onClick:o,...r})=>(0,fr.jsx)(sn.Transition,{show:t,as:il.default.Fragment,children:(0,fr.jsxs)(sn.Dialog,{onClose:o,...r,as:Kw,children:[(0,fr.jsx)(sn.Transition.Child,{as:il.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,fr.jsx)(jw,{"aria-hidden":"true"})}),(0,fr.jsx)(Yw,{children:(0,fr.jsx)(sn.Transition.Child,{as:il.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,fr.jsx)(sn.Dialog.Panel,{as:Jw,children:e})})})]})}),di=ln.default.div`
1753
1753
  display: flex;
1754
1754
  flex-direction: column;
1755
1755
  text-align: center;
@@ -1772,7 +1772,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1772
1772
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
1773
1773
  border-radius: var(--privy-border-radius-lg);
1774
1774
  }
1775
- `,j1=ln.default.div`
1775
+ `,jw=ln.default.div`
1776
1776
  position: fixed;
1777
1777
  inset: 0;
1778
1778
 
@@ -1785,10 +1785,10 @@ You will need this password to access your ${e} wallet on a new device. Please k
1785
1785
  backdrop-filter: unset;
1786
1786
  -webkit-backdrop-filter: unset;
1787
1787
  }
1788
- `,K1=ln.default.div`
1788
+ `,Kw=ln.default.div`
1789
1789
  position: relative;
1790
1790
  z-index: 999999;
1791
- `,Y1=ln.default.div`
1791
+ `,Yw=ln.default.div`
1792
1792
  position: fixed;
1793
1793
  inset: 0;
1794
1794
  display: flex;
@@ -1796,7 +1796,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1796
1796
  justify-content: center;
1797
1797
  width: 100vw;
1798
1798
  min-height: 100vh;
1799
- `,J1=ln.default.div`
1799
+ `,Jw=ln.default.div`
1800
1800
  // reset some default dialog styles
1801
1801
  padding: 0;
1802
1802
  background: transparent;
@@ -1849,7 +1849,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1849
1849
  align-items: center;
1850
1850
  justify-content: center;
1851
1851
  height: 100%;
1852
- `;var $o=require("react/jsx-runtime"),Xi=6,Q1=new Array(Xi).fill("");function Z1(e){return e.replace(/\s+/g,"")}function Nc(e){return/^[0-9]{1}$/.test(e)}function Kh(e){return e.length===Xi&&e.every(Nc)}function X1(e,t){return e.reduce((o,r)=>o+Number(t(r)),0)}var pi=({onChange:e,disabled:t,errorReasonOverride:o,success:r})=>{let[n,i]=(0,al.useState)(Q1),[a,l]=(0,al.useState)(null),[s,c]=(0,al.useState)(null),m=async b=>{b.preventDefault();let E=Z1(b.currentTarget.value);if(E==="")return;let x=X1(n,Nc),T=E.split(""),A=!T.every(Nc),R=T.length+x>Xi;if(A){l("Passcode can only be numbers"),c(1);return}if(R){l("Passcode must be exactly 6 numbers"),c(1);return}l(null),c(null);let I=Number(b.currentTarget.name?.charAt(4)),k=[...E||[""]].slice(0,Xi-I),D=[...n.slice(0,I),...k,...n.slice(I+k.length)];i(D);let U=k.length,B=Math.min(Math.max(I+U,0),Xi-1);if(document.querySelector(`input[name=pin-${B}]`)?.focus(),Kh(D))try{await e(D.join("")),document.querySelector(`input[name=pin-${B}]`)?.blur()}catch(j){c(1),l(j.message)}else try{await e(null)}catch(j){c(1),l(j.message)}},h=b=>{s===1&&(l(null),c(null));let E=[...n.slice(0,b),"",...n.slice(b+1)];i(E),b>0&&document.querySelector(`input[name=pin-${b-1}]`)?.focus(),Kh(E)?e(E.join("")):e(null)},v=r?"success":!!(o||a)?"fail":"";return(0,$o.jsx)($o.Fragment,{children:(0,$o.jsxs)(eC,{children:[(0,$o.jsx)("div",{children:n.map((b,E)=>(0,$o.jsx)("input",{name:`pin-${E}`,type:"text",value:n[E],onChange:m,onKeyUp:x=>{x.key==="Backspace"&&h(E)},inputMode:"numeric",autoFocus:E===0,pattern:"[0-9]",className:v,autoComplete:Yh.isMobile?"one-time-code":"off",disabled:t},E))}),(0,$o.jsx)("div",{children:(0,$o.jsx)(tC,{fail:!!o||!!a,children:o||a})})]})})},eC=Lc.default.div`
1852
+ `;var $o=require("react/jsx-runtime"),Xi=6,Qw=new Array(Xi).fill("");function Zw(e){return e.replace(/\s+/g,"")}function Nc(e){return/^[0-9]{1}$/.test(e)}function Kh(e){return e.length===Xi&&e.every(Nc)}function Xw(e,t){return e.reduce((o,r)=>o+Number(t(r)),0)}var pi=({onChange:e,disabled:t,errorReasonOverride:o,success:r})=>{let[n,i]=(0,al.useState)(Qw),[a,l]=(0,al.useState)(null),[s,c]=(0,al.useState)(null),m=async b=>{b.preventDefault();let T=Zw(b.currentTarget.value);if(T==="")return;let x=Xw(n,Nc),E=T.split(""),k=!E.every(Nc),I=E.length+x>Xi;if(k){l("Passcode can only be numbers"),c(1);return}if(I){l("Passcode must be exactly 6 numbers"),c(1);return}l(null),c(null);let M=Number(b.currentTarget.name?.charAt(4)),S=[...T||[""]].slice(0,Xi-M),O=[...n.slice(0,M),...S,...n.slice(M+S.length)];i(O);let D=S.length,B=Math.min(Math.max(M+D,0),Xi-1);if(document.querySelector(`input[name=pin-${B}]`)?.focus(),Kh(O))try{await e(O.join("")),document.querySelector(`input[name=pin-${B}]`)?.blur()}catch(K){c(1),l(K.message)}else try{await e(null)}catch(K){c(1),l(K.message)}},h=b=>{s===1&&(l(null),c(null));let T=[...n.slice(0,b),"",...n.slice(b+1)];i(T),b>0&&document.querySelector(`input[name=pin-${b-1}]`)?.focus(),Kh(T)?e(T.join("")):e(null)},v=r?"success":!!(o||a)?"fail":"";return(0,$o.jsx)($o.Fragment,{children:(0,$o.jsxs)(eC,{children:[(0,$o.jsx)("div",{children:n.map((b,T)=>(0,$o.jsx)("input",{name:`pin-${T}`,type:"text",value:n[T],onChange:m,onKeyUp:x=>{x.key==="Backspace"&&h(T)},inputMode:"numeric",autoFocus:T===0,pattern:"[0-9]",className:v,autoComplete:Yh.isMobile?"one-time-code":"off",disabled:t},T))}),(0,$o.jsx)("div",{children:(0,$o.jsx)(tC,{fail:!!o||!!a,children:o||a})})]})})},eC=Lc.default.div`
1853
1853
  display: flex;
1854
1854
  flex-direction: column;
1855
1855
  width: 100%;
@@ -1939,7 +1939,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1939
1939
  > path {
1940
1940
  fill: white;
1941
1941
  }
1942
- `;var ey=f(require("@heroicons/react/24/solid/ShieldCheckIcon"));var oy=require("react/jsx-runtime");var ty=({size:e,authUrl:t})=>(0,oy.jsx)(Ls,{url:t,squareLogoElement:ey.default,size:e,fgColor:"#1F1F1F"});var u=require("react/jsx-runtime"),ly=()=>{let{user:e,enrollInMfa:t}=z(),[o,r]=(0,Vt.useState)(null),{unenrollWithSms:n,unenrollWithTotp:i}=ui(),{app:a,ready:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=S(),{closePrivyModal:m}=W(),{promptMfa:h}=cn(),[g,v]=(0,Vt.useState)(s?.mfaEnrollmentFlow?.seenIntro||!1),[b,E]=(0,Vt.useState)(s?.mfaEnrollmentFlow?.selectedMfaMethod||null),x=()=>{m({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{r(null),E(null)},500)};c.current=x;let T=e?.mfaMethods.includes("sms"),A=!!e?.phone,R=e?.mfaMethods.includes("totp"),I=T||R;(0,Vt.useEffect)(()=>{I&&v(!0)},[I]);function k(){r(null),E(null)}function D(){v(!1)}async function U(O){await h(),E(O)}if(!l||!e||!a)return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(_,{onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Xh,{})}),(0,u.jsx)(Ir,{children:(0,u.jsx)(Zt,{})}),(0,u.jsx)(oe,{})]});async function B(){r(null);try{await n()}catch{r(null)}}async function G(){r(null);try{await i()}catch{r(null)}}if(o==="sms")return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(_,{backFn:k,onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(ll.default,{})})}),(0,u.jsx)(Ne,{children:"Remove SMS verification?"}),(0,u.jsxs)(ke,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),(0,u.jsx)(Mr,{children:(0,u.jsx)(F,{warn:!0,onClick:B,children:"Remove SMS for MFA"})}),(0,u.jsx)(oe,{})]});if(o==="totp")return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(_,{backFn:k,onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(Fc.default,{})})}),(0,u.jsx)(Ne,{children:"Remove Authenticator App verification?"}),(0,u.jsxs)(ke,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),(0,u.jsx)(Mr,{children:(0,u.jsx)(F,{warn:!0,onClick:G,children:"Remove Authenticator App for MFA"})}),(0,u.jsx)(oe,{})]});if(s.mfaEnrollmentFlow.mfaMethods.length===0&&!I)return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(_,{onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(sl.default,{})})}),(0,u.jsx)(Ne,{children:"Add more security"}),(0,u.jsxs)(ke,{children:[a?.name," does not have any verification methods enabled."]}),(0,u.jsx)(Mr,{children:(0,u.jsx)(F,{onClick:x,children:"Close"})}),(0,u.jsx)(oe,{})]});let j=!I&&!g;if(j)return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(_,{onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(sl.default,{})})}),(0,u.jsx)(Ne,{children:"Transaction Protection"}),(0,u.jsx)(ke,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,u.jsxs)(_u,{children:[(0,u.jsxs)(oc,{children:[(0,u.jsx)(tc,{children:(0,u.jsx)(ay.default,{})}),"Enable 2-Step verification for your ",a?.name," wallet."]}),(0,u.jsxs)(oc,{children:[(0,u.jsx)(tc,{children:(0,u.jsx)(sy.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,u.jsxs)(Mr,{children:[(0,u.jsx)(F,{onClick:()=>v(!0),children:"Continue"}),(0,u.jsx)(go,{onClick:x,children:"Not now"})]}),(0,u.jsx)(oe,{})]});switch(b){case"sms":return(0,u.jsx)(rC,{onComplete:x,onReset:k,onClose:x});case"totp":return(0,u.jsx)(nC,{onComplete:x,onClose:x,onReset:k});default:return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(_,{backFn:j?D:void 0,onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(sl.default,{})})}),(0,u.jsx)(Ne,{children:"Choose a verification method"}),I?(0,u.jsx)(ke,{children:"To add or delete verification methods, verification is required."}):(0,u.jsx)(ke,{children:"How would you like to verify your identity? You can change this later."}),(0,u.jsxs)(vs,{children:[(s.mfaEnrollmentFlow.mfaMethods.includes("totp")||R)&&(0,u.jsxs)(ws,{children:[(0,u.jsx)(We,{disabled:R,onClick:()=>U("totp"),children:(0,u.jsxs)(bs,{children:[(0,u.jsxs)(Cs,{children:[(0,u.jsx)(ry.default,{}),"Authenticator App"]}),R?(0,u.jsxs)(Bn,{children:[(0,u.jsx)(Oc.default,{}),"Added"]}):(0,u.jsx)(Bn,{children:"Recommended"})]})}),R&&(0,u.jsx)(rc,{id:"remove",onClick:()=>r("totp"),children:(0,u.jsx)(Dc.default,{})})]},"totp"),(s.mfaEnrollmentFlow.mfaMethods.includes("sms")||T)&&(0,u.jsxs)(ws,{children:[(0,u.jsx)(We,{disabled:T||A,onClick:()=>U("sms"),children:(0,u.jsxs)(bs,{children:[(0,u.jsxs)(Cs,{children:[(0,u.jsx)(iy.default,{}),"SMS"]}),T&&(0,u.jsxs)(Bn,{children:[(0,u.jsx)(Oc.default,{}),"Added"]}),A&&(0,u.jsx)(Bn,{children:"Disabled"})]})}),T&&(0,u.jsx)(rc,{id:"remove",onClick:()=>r("sms"),children:(0,u.jsx)(Dc.default,{})})]},"sms"),(0,u.jsx)(ws,{children:(0,u.jsx)(We,{disabled:!0,children:(0,u.jsxs)(bs,{children:[(0,u.jsxs)(Cs,{children:[(0,u.jsx)(ny.default,{}),"Passkey"]}),(0,u.jsx)(Bn,{isAccent:!0,children:"Coming soon"})]})})},"passkey")]}),(0,u.jsx)(oe,{})]})}},rC=({onComplete:e,onReset:t,onClose:o})=>{let[r,n]=(0,Vt.useState)(""),[i,a]=(0,Vt.useState)(!1),[l,s]=(0,Vt.useState)("enroll"),{initEnrollmentWithSms:c,submitEnrollmentWithSms:m}=ui(),{app:h,data:g,currentScreen:v,navigate:b,setModalData:E}=S();function x(){g?.mfaEnrollmentFlow?.onSuccess(),e()}async function T({qualifiedPhoneNumber:I}){try{await c({phoneNumber:I}),n(I),s("verify")}catch(k){E({mfaEnrollmentFlow:g?.mfaEnrollmentFlow?{...g?.mfaEnrollmentFlow,selectedMfaMethod:"sms",seenIntro:!0}:void 0,errorModalData:{error:k,previousScreen:v||"MFA_ENROLLMENT_FLOW_SCREEN"}}),b("ERROR_SCREEN")}}async function A(I){try{if(!I)return;await m({phoneNumber:r,mfaCode:I}),a(!0)}catch(k){throw fc(k)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Xr(k)?new Error("The code you entered is not valid"):Zr(k)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):hc(k)?new Error("Verification canceled"):new Error("Unknown error")}}function R(){l==="verify"?s("enroll"):t()}return l==="enroll"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(_,{backFn:t,onClose:o},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(ll.default,{})})}),(0,u.jsx)(Ne,{children:"Set up SMS verification"}),(0,u.jsx)(ke,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,u.jsxs)(Ir,{children:[(0,u.jsx)(si,{onSubmit:T}),(0,u.jsxs)(Au,{children:["By providing your mobile number, you agree to receive text messages from ",h?.name,". Some carrier charges may apply"]})]}),(0,u.jsx)(oe,{})]}):i?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(_,{onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{status:"success",children:(0,u.jsx)(Uc.default,{})})}),(0,u.jsx)(Ne,{children:"SMS verification added"}),(0,u.jsx)(ke,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,u.jsx)(Mr,{children:(0,u.jsx)(F,{onClick:x,children:"Done"})}),(0,u.jsx)(oe,{})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(_,{backFn:R,onClose:o},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(ll.default,{})})}),(0,u.jsx)(Ne,{children:"Enter enrollment code"}),(0,u.jsxs)(Ir,{children:[(0,u.jsx)(pi,{onChange:A}),(0,u.jsxs)(ke,{children:["To continue, enter the 6-digit code sent to ",(0,u.jsx)("strong",{children:vh(r)})]})]}),(0,u.jsx)(oe,{})]})},nC=({onComplete:e,onClose:t,onReset:o})=>{let[r,n]=(0,Vt.useState)("enroll"),[i,a]=(0,Vt.useState)(null),[l,s]=(0,Vt.useState)(!1),{initEnrollmentWithTotp:c,submitEnrollmentWithTotp:m}=ui(),{data:h}=S();(0,Vt.useEffect)(()=>{a(null),c().then(x=>{a(x)}).catch(()=>{a(null),o()})},[]);function g(){h?.mfaEnrollmentFlow?.onSuccess(),e()}function v(){n("verify")}async function b(x){try{if(!x)return;await m({mfaCode:x}),s(!0)}catch(T){throw fc(T)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Xr(T)?new Error("The code you entered is not valid"):Zr(T)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):hc(T)?new Error("Verification canceled"):new Error("Unknown error")}}function E(){r==="verify"?n("enroll"):o()}return r==="enroll"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(_,{backFn:o,onClose:t},"header"),(0,u.jsx)(Ne,{children:"Scan QR code"}),(0,u.jsx)(ke,{children:"Open your authenticator app and scan the QR code to continue."}),(0,u.jsx)(xs,{children:i?.authUrl?(0,u.jsx)(ty,{authUrl:i.authUrl,size:200}):(0,u.jsx)(Zt,{})}),(0,u.jsxs)(Mr,{children:[(0,u.jsx)(oo,{children:i?.secret&&(0,u.jsx)(oi,{itemName:"secret",text:i.secret})}),(0,u.jsx)(F,{onClick:v,children:"Continue"})]}),(0,u.jsx)(oe,{})]}):l?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(_,{onClose:g},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{status:"success",children:(0,u.jsx)(Uc.default,{})})}),(0,u.jsx)(Ne,{children:"Authenticator app verification added"}),(0,u.jsx)(ke,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,u.jsx)(Mr,{children:(0,u.jsx)(F,{onClick:g,children:"Done"})}),(0,u.jsx)(oe,{})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(_,{backFn:E,onClose:t},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(Fc.default,{})})}),(0,u.jsx)(Ne,{children:"Enter enrollment code"}),(0,u.jsx)(Ir,{children:(0,u.jsx)(pi,{onChange:b})}),(0,u.jsxs)(ke,{children:["To continue, enter the 6-digit code generated from your ",(0,u.jsx)("strong",{children:"authenticator app"})]}),(0,u.jsx)(oe,{})]})};var By=f(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),Hy=f(require("@heroicons/react/24/outline/PhoneIcon")),Gy=f(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),Vy=f(require("@heroicons/react/24/solid/PhoneIcon")),zy=f(require("@heroicons/react/24/solid/ShieldCheckIcon")),wi=require("react");var Uy=require("@ethersproject/providers"),pn=require("react"),Fy=f(require("styled-components"));var qc=f(require("styled-components"));var Bc=f(require("styled-components")),ta=require("react/jsx-runtime"),cl=({label:e,children:t,valueStyles:o})=>(0,ta.jsxs)(iC,{children:[(0,ta.jsx)("div",{children:e}),(0,ta.jsx)(aC,{style:{...o},children:t})]}),iC=Bc.default.div`
1942
+ `;var ey=f(require("@heroicons/react/24/solid/ShieldCheckIcon"));var oy=require("react/jsx-runtime");var ty=({size:e,authUrl:t})=>(0,oy.jsx)(Ls,{url:t,squareLogoElement:ey.default,size:e,fgColor:"#1F1F1F"});var u=require("react/jsx-runtime"),ly=()=>{let{user:e,enrollInMfa:t}=z(),[o,r]=(0,Vt.useState)(null),{unenrollWithSms:n,unenrollWithTotp:i}=ui(),{app:a,ready:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=_(),{closePrivyModal:m}=W(),{promptMfa:h}=cn(),[g,v]=(0,Vt.useState)(s?.mfaEnrollmentFlow?.seenIntro||!1),[b,T]=(0,Vt.useState)(s?.mfaEnrollmentFlow?.selectedMfaMethod||null),x=()=>{m({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{r(null),T(null)},500)};c.current=x;let E=e?.mfaMethods.includes("sms"),k=!!e?.phone,I=e?.mfaMethods.includes("totp"),M=E||I;(0,Vt.useEffect)(()=>{M&&v(!0)},[M]);function S(){r(null),T(null)}function O(){v(!1)}async function D(U){await h(),T(U)}if(!l||!e||!a)return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Xh,{})}),(0,u.jsx)(Ir,{children:(0,u.jsx)(Zt,{})}),(0,u.jsx)(oe,{})]});async function B(){r(null);try{await n()}catch{r(null)}}async function G(){r(null);try{await i()}catch{r(null)}}if(o==="sms")return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{backFn:S,onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(ll.default,{})})}),(0,u.jsx)(Ne,{children:"Remove SMS verification?"}),(0,u.jsxs)(ke,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),(0,u.jsx)(Mr,{children:(0,u.jsx)(F,{warn:!0,onClick:B,children:"Remove SMS for MFA"})}),(0,u.jsx)(oe,{})]});if(o==="totp")return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{backFn:S,onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(Fc.default,{})})}),(0,u.jsx)(Ne,{children:"Remove Authenticator App verification?"}),(0,u.jsxs)(ke,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),(0,u.jsx)(Mr,{children:(0,u.jsx)(F,{warn:!0,onClick:G,children:"Remove Authenticator App for MFA"})}),(0,u.jsx)(oe,{})]});if(s.mfaEnrollmentFlow.mfaMethods.length===0&&!M)return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(sl.default,{})})}),(0,u.jsx)(Ne,{children:"Add more security"}),(0,u.jsxs)(ke,{children:[a?.name," does not have any verification methods enabled."]}),(0,u.jsx)(Mr,{children:(0,u.jsx)(F,{onClick:x,children:"Close"})}),(0,u.jsx)(oe,{})]});let K=!M&&!g;if(K)return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(sl.default,{})})}),(0,u.jsx)(Ne,{children:"Transaction Protection"}),(0,u.jsx)(ke,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,u.jsxs)(_u,{children:[(0,u.jsxs)(oc,{children:[(0,u.jsx)(tc,{children:(0,u.jsx)(ay.default,{})}),"Enable 2-Step verification for your ",a?.name," wallet."]}),(0,u.jsxs)(oc,{children:[(0,u.jsx)(tc,{children:(0,u.jsx)(sy.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,u.jsxs)(Mr,{children:[(0,u.jsx)(F,{onClick:()=>v(!0),children:"Continue"}),(0,u.jsx)(go,{onClick:x,children:"Not now"})]}),(0,u.jsx)(oe,{})]});switch(b){case"sms":return(0,u.jsx)(rC,{onComplete:x,onReset:S,onClose:x});case"totp":return(0,u.jsx)(nC,{onComplete:x,onClose:x,onReset:S});default:return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{backFn:K?O:void 0,onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(sl.default,{})})}),(0,u.jsx)(Ne,{children:"Choose a verification method"}),M?(0,u.jsx)(ke,{children:"To add or delete verification methods, verification is required."}):(0,u.jsx)(ke,{children:"How would you like to verify your identity? You can change this later."}),(0,u.jsxs)(vs,{children:[(s.mfaEnrollmentFlow.mfaMethods.includes("totp")||I)&&(0,u.jsxs)(ws,{children:[(0,u.jsx)(We,{disabled:I,onClick:()=>D("totp"),children:(0,u.jsxs)(bs,{children:[(0,u.jsxs)(Cs,{children:[(0,u.jsx)(ry.default,{}),"Authenticator App"]}),I?(0,u.jsxs)(Bn,{children:[(0,u.jsx)(Oc.default,{}),"Added"]}):(0,u.jsx)(Bn,{children:"Recommended"})]})}),I&&(0,u.jsx)(rc,{id:"remove",onClick:()=>r("totp"),children:(0,u.jsx)(Dc.default,{})})]},"totp"),(s.mfaEnrollmentFlow.mfaMethods.includes("sms")||E)&&(0,u.jsxs)(ws,{children:[(0,u.jsx)(We,{disabled:E||k,onClick:()=>D("sms"),children:(0,u.jsxs)(bs,{children:[(0,u.jsxs)(Cs,{children:[(0,u.jsx)(iy.default,{}),"SMS"]}),E&&(0,u.jsxs)(Bn,{children:[(0,u.jsx)(Oc.default,{}),"Added"]}),k&&(0,u.jsx)(Bn,{children:"Disabled"})]})}),E&&(0,u.jsx)(rc,{id:"remove",onClick:()=>r("sms"),children:(0,u.jsx)(Dc.default,{})})]},"sms"),(0,u.jsx)(ws,{children:(0,u.jsx)(We,{disabled:!0,children:(0,u.jsxs)(bs,{children:[(0,u.jsxs)(Cs,{children:[(0,u.jsx)(ny.default,{}),"Passkey"]}),(0,u.jsx)(Bn,{isAccent:!0,children:"Coming soon"})]})})},"passkey")]}),(0,u.jsx)(oe,{})]})}},rC=({onComplete:e,onReset:t,onClose:o})=>{let[r,n]=(0,Vt.useState)(""),[i,a]=(0,Vt.useState)(!1),[l,s]=(0,Vt.useState)("enroll"),{initEnrollmentWithSms:c,submitEnrollmentWithSms:m}=ui(),{app:h,data:g,currentScreen:v,navigate:b,setModalData:T}=_();function x(){g?.mfaEnrollmentFlow?.onSuccess(),e()}async function E({qualifiedPhoneNumber:M}){try{await c({phoneNumber:M}),n(M),s("verify")}catch(S){T({mfaEnrollmentFlow:g?.mfaEnrollmentFlow?{...g?.mfaEnrollmentFlow,selectedMfaMethod:"sms",seenIntro:!0}:void 0,errorModalData:{error:S,previousScreen:v||"MFA_ENROLLMENT_FLOW_SCREEN"}}),b("ERROR_SCREEN")}}async function k(M){try{if(!M)return;await m({phoneNumber:r,mfaCode:M}),a(!0)}catch(S){throw fc(S)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Xr(S)?new Error("The code you entered is not valid"):Zr(S)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):hc(S)?new Error("Verification canceled"):new Error("Unknown error")}}function I(){l==="verify"?s("enroll"):t()}return l==="enroll"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{backFn:t,onClose:o},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(ll.default,{})})}),(0,u.jsx)(Ne,{children:"Set up SMS verification"}),(0,u.jsx)(ke,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,u.jsxs)(Ir,{children:[(0,u.jsx)(si,{onSubmit:E}),(0,u.jsxs)(Au,{children:["By providing your mobile number, you agree to receive text messages from ",h?.name,". Some carrier charges may apply"]})]}),(0,u.jsx)(oe,{})]}):i?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{onClose:x},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{status:"success",children:(0,u.jsx)(Uc.default,{})})}),(0,u.jsx)(Ne,{children:"SMS verification added"}),(0,u.jsx)(ke,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,u.jsx)(Mr,{children:(0,u.jsx)(F,{onClick:x,children:"Done"})}),(0,u.jsx)(oe,{})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{backFn:I,onClose:o},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(ll.default,{})})}),(0,u.jsx)(Ne,{children:"Enter enrollment code"}),(0,u.jsxs)(Ir,{children:[(0,u.jsx)(pi,{onChange:k}),(0,u.jsxs)(ke,{children:["To continue, enter the 6-digit code sent to ",(0,u.jsx)("strong",{children:vh(r)})]})]}),(0,u.jsx)(oe,{})]})},nC=({onComplete:e,onClose:t,onReset:o})=>{let[r,n]=(0,Vt.useState)("enroll"),[i,a]=(0,Vt.useState)(null),[l,s]=(0,Vt.useState)(!1),{initEnrollmentWithTotp:c,submitEnrollmentWithTotp:m}=ui(),{data:h}=_();(0,Vt.useEffect)(()=>{a(null),c().then(x=>{a(x)}).catch(()=>{a(null),o()})},[]);function g(){h?.mfaEnrollmentFlow?.onSuccess(),e()}function v(){n("verify")}async function b(x){try{if(!x)return;await m({mfaCode:x}),s(!0)}catch(E){throw fc(E)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Xr(E)?new Error("The code you entered is not valid"):Zr(E)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):hc(E)?new Error("Verification canceled"):new Error("Unknown error")}}function T(){r==="verify"?n("enroll"):o()}return r==="enroll"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{backFn:o,onClose:t},"header"),(0,u.jsx)(Ne,{children:"Scan QR code"}),(0,u.jsx)(ke,{children:"Open your authenticator app and scan the QR code to continue."}),(0,u.jsx)(xs,{children:i?.authUrl?(0,u.jsx)(ty,{authUrl:i.authUrl,size:200}):(0,u.jsx)(Zt,{})}),(0,u.jsxs)(Mr,{children:[(0,u.jsx)(oo,{children:i?.secret&&(0,u.jsx)(oi,{itemName:"secret",text:i.secret})}),(0,u.jsx)(F,{onClick:v,children:"Continue"})]}),(0,u.jsx)(oe,{})]}):l?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{onClose:g},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{status:"success",children:(0,u.jsx)(Uc.default,{})})}),(0,u.jsx)(Ne,{children:"Authenticator app verification added"}),(0,u.jsx)(ke,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,u.jsx)(Mr,{children:(0,u.jsx)(F,{onClick:g,children:"Done"})}),(0,u.jsx)(oe,{})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(A,{backFn:T,onClose:t},"header"),(0,u.jsx)(at,{children:(0,u.jsx)(Ct,{children:(0,u.jsx)(Fc.default,{})})}),(0,u.jsx)(Ne,{children:"Enter enrollment code"}),(0,u.jsx)(Ir,{children:(0,u.jsx)(pi,{onChange:b})}),(0,u.jsxs)(ke,{children:["To continue, enter the 6-digit code generated from your ",(0,u.jsx)("strong",{children:"authenticator app"})]}),(0,u.jsx)(oe,{})]})};var By=f(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),Hy=f(require("@heroicons/react/24/outline/PhoneIcon")),Gy=f(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),Vy=f(require("@heroicons/react/24/solid/PhoneIcon")),zy=f(require("@heroicons/react/24/solid/ShieldCheckIcon")),wi=require("react");var Uy=require("@ethersproject/providers"),pn=require("react"),Fy=f(require("styled-components"));var qc=f(require("styled-components"));var Bc=f(require("styled-components")),ta=require("react/jsx-runtime"),cl=({label:e,children:t,valueStyles:o})=>(0,ta.jsxs)(iC,{children:[(0,ta.jsx)("div",{children:e}),(0,ta.jsx)(aC,{style:{...o},children:t})]}),iC=Bc.default.div`
1943
1943
  display: flex;
1944
1944
  align-items: center;
1945
1945
  justify-content: space-between;
@@ -2160,10 +2160,10 @@ You will need this password to access your ${e} wallet on a new device. Please k
2160
2160
  overflow: hidden;
2161
2161
  max-width: 275px;
2162
2162
  text-overflow: ellipsis;
2163
- `;var Wy=require("@ethersproject/abstract-signer"),so=require("@ethersproject/bignumber"),Ny=require("@ethersproject/contracts"),MC=require("@ethersproject/providers"),Ly=require("@ethersproject/transactions");var Yc=require("@ethersproject/units"),Ry=require("ofetch");var Iy=[Ii.id,Mi.id],Kc=e=>({maxPriorityFee:(0,Yc.parseUnits)(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:(0,Yc.parseUnits)(e.maxFee.toFixed(9),"gwei").toHexString()}),IC=e=>({safeLow:Kc(e.safeLow),standard:Kc(e.standard),fast:Kc(e.fast)}),My=async e=>{let t="";switch(e){case Ii.id:t="https://gasstation.polygon.technology/v2";break;case Mi.id:t="https://gasstation-testnet.polygon.technology/v2";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}return IC(await(0,Ry.ofetch)(t))};function yr(e){if(typeof e=="number"||typeof e=="bigint"||typeof e=="string")return e;if(typeof e.toHexString=="function")return e.toHexString();throw new Error(`Expected numeric value but received ${e}`)}function WC(e){let t={};return e.to!==void 0&&(t.to=e.to),e.data!==void 0&&(t.data=e.data),e.chainId!==void 0&&(t.chainId=e.chainId),e.type!==void 0&&(t.type=e.type),e.accessList!==void 0&&(t.accessList=e.accessList),e.nonce!==void 0&&(t.nonce=yr(e.nonce)),e.gasLimit!==void 0&&(t.gasLimit=yr(e.gasLimit)),e.gasPrice!==void 0&&(t.gasPrice=yr(e.gasPrice)),e.value!==void 0&&(t.value=yr(e.value)),e.maxFeePerGas!==void 0&&(t.maxFeePerGas=yr(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.maxPriorityFeePerGas=yr(e.maxPriorityFeePerGas)),t}function NC(e){let t={};return e.to!==void 0&&(t.to=e.to),e.data!==void 0&&(t.data=e.data),e.chainId!==void 0&&(t.chainId=e.chainId),e.type!==void 0&&(t.type=e.type),e.accessList!==void 0&&(t.accessList=e.accessList),e.nonce!==void 0&&(t.nonce=Ue(e.nonce).toNumber()),e.gasLimit!==void 0&&(t.gasLimit=Ue(e.gasLimit)),e.gasPrice!==void 0&&(t.gasPrice=Ue(e.gasPrice)),e.value!==void 0&&(t.value=Ue(e.value)),e.maxFeePerGas!==void 0&&(t.maxFeePerGas=Ue(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.maxPriorityFeePerGas=Ue(e.maxPriorityFeePerGas)),t}async function yi(e,t,o){t.chainId=Number(t.chainId),Dy(t);let r=new Wy.VoidSigner(e,o);if(t.gas&&(t.gasLimit=t.gas,delete t.gas),Iy.includes(t.chainId)&&(!t.maxPriorityFeePerGas||!t.maxFeePerGas))try{let{standard:i}=await My(t.chainId);t.maxPriorityFeePerGas||(t.maxPriorityFeePerGas=i.maxPriorityFee),t.maxFeePerGas||(t.maxFeePerGas=i.maxFee)}catch(i){throw new Error(`Failed to set gas prices from Polygon gas station with error: ${i}.`)}if(LC(t.chainId)&&!t.maxFeePerGas)try{let{lastBaseFeePerGas:i}=await r.getFeeData();if(i){let a=i.mul(so.BigNumber.from(120)).div(so.BigNumber.from(100));t.maxFeePerGas=yr(a),t.maxPriorityFeePerGas=yr(so.BigNumber.from(0))}}catch(i){throw new Error(`Failed to set gas price for Arbitrum transaction: ${i}.`)}if(Jc(t.chainId)&&(!t.maxPriorityFeePerGas||!t.maxFeePerGas)&&!t.gasPrice)try{if(t.type=2,!t.maxPriorityFeePerGas){let i=await o.send("eth_maxPriorityFeePerGas",[]);t.maxPriorityFeePerGas=i}if(t.maxFeePerGas&&(console.warn("maxFeePerGas is specified without maxPriorityFeePerGas - this can result in hung transactions."),t.maxPriorityFeePerGas>=t.maxFeePerGas))throw new Error("Overridden maxFeePerGas is less than or equal to the calculated maxPriorityFeePerGas. Please set both values or maxPriorityFeePerGas alone for correct gas estimation.");if(!t.maxFeePerGas){let{lastBaseFeePerGas:i}=await r.getFeeData();if(!i)throw new Error("Unable to fetch baseFee for last block.");let s=so.BigNumber.from(i).mul(so.BigNumber.from(126)).div(so.BigNumber.from(100)).add(so.BigNumber.from(t.maxPriorityFeePerGas));t.maxFeePerGas=yr(s)}}catch(i){throw new Error(`Failed to set gas price for OP stack transaction: ${i}.`)}OC(t.chainId)&&t.type!=0&&((t.type==1||t.type==2)&&console.warn("Transaction request type specified is incompatible for chain and will result in undefined behavior. Please use transaction type 0."),t.type===void 0&&(t.type=0));let n=await r.populateTransaction({to:t.to,from:t.from,nonce:t.nonce,gasLimit:t.gasLimit,gasPrice:t.gasPrice,data:t.data,value:t.value,chainId:t.chainId,type:t.type,accessList:t.accessList,maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas});return WC(n)}async function ml(e,t,o,r,n){r=Object.assign({chainId:tr},r),Dy(r);let a=(await o.rpc({address:t,accessToken:e,request:{method:"eth_signTransaction",params:[r]}})).response.data;return await n.sendTransaction(a)}async function Oy(e,t,o,r){let n=await r.getBalance(e),i=t.value||0,l=!n.sub(Ue(i)).sub(o).isNegative();return{balance:n,hasSufficientFunds:l}}function Jc(e){return[Va.id,za.id,$a.id,ja.id,Ka.id,Ya.id,Ja.id,Za.id,Qa.id].includes(e)}function LC(e){return[Ba.id,Ha.id,Ga.id].includes(e)}function OC(e){return[56,97].includes(e)}async function Qc(e,t){if(!e.chainId||e.chainId&&!Jc(e.chainId))return so.BigNumber.from(0);let o=so.BigNumber.from(0);try{let r=new Ny.Contract(op,rp,t),n=NC(e),i=(0,Ly.serialize)(n);o=await r.getL1Fee(i)}catch{}return o}async function fl(e,t){delete e.from;let o=so.BigNumber.from(0),r=so.BigNumber.from(0);if(e.gasLimit?o=Ue(e.gasLimit):o=await t.estimateGas(e),e.type==2)if(e.maxFeePerGas)r=Ue(e.maxFeePerGas);else{let i=await t.getFeeData();i.maxFeePerGas&&(r=i.maxFeePerGas)}else if(e.type==0||e.type==1)if(e.gasPrice)r=Ue(e.gasPrice);else{let i=await t.getFeeData();i.gasPrice&&(r=i.gasPrice)}else if(e.gasPrice)r=Ue(e.gasPrice);else{let i=await t.getFeeData();i.gasPrice&&(r=i.gasPrice)}let n=o.mul(r);if(e.chainId&&Jc(e.chainId))try{let i=await Qc(e,t);n=n.add(i)}catch{}return n}function Dy(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let o of t){let r=e[o];if(!(typeof r>"u")&&!DC(r))throw new Error(`Transaction request property '${o}' 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 DC(e){let t=typeof e=="number",o=typeof e=="bigint",r=typeof e=="string"&&UC(e);return t||o||r}function UC(e){return/^-?0x[a-f0-9]+$/i.test(e)}function hl(e){return{to:e.to,from:e.from,contractAddress:e.contractAddress,transactionIndex:e.transactionIndex,root:e.root,logsBloom:e.logsBloom,blockHash:e.blockHash,transactionHash:e.transactionHash,logs:e.logs,blockNumber:e.blockNumber,confirmations:e.confirmations,byzantium:e.byzantium,type:e.type,status:e.status,gasUsed:e.gasUsed.toHexString(),cumulativeGasUsed:e.cumulativeGasUsed.toHexString(),effectiveGasPrice:e.effectiveGasPrice?e.effectiveGasPrice.toHexString():void 0}}var gi=require("react");var yl=e=>{let{showFiatPrices:t,getUsdTokenPrice:o,chains:r}=W(),[n,i]=(0,gi.useState)(!0),[a,l]=(0,gi.useState)(void 0),[s,c]=(0,gi.useState)(void 0);return(0,gi.useEffect)(()=>{let m=e.chainId||tr,h=r.find(v=>v.id===Number(m));if(!h)throw new Z(`Unsupported chain: ${m}`);(async()=>{if(!t){i(!1);return}try{i(!0);let v=await o(h);v?c(v):l(new Error(`Unable to fetch token price on chain id ${h.id}`))}catch(v){l(v)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};var gl=require("react"),Zc=(0,gl.createContext)(null);function vi(){let e=(0,gl.useContext)(Zc);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}var Xc=require("react/jsx-runtime"),ed=({pendingTransaction:e})=>{let{getAccessToken:t}=z(),{wallets:o}=vi(),{walletProxy:r,rpcConfig:n,chains:i,nativeTokenSymbolForChainId:a}=W(),[l,s]=(0,pn.useState)(e),{tokenPrice:c}=yl(l),[m,h]=(0,pn.useState)(null),g=a(e.chainId)||"ETH",v=(0,pn.useMemo)(()=>o.find(b=>b.walletClientType==="privy"),[o]);return(0,pn.useEffect)(()=>{async function b(){if(!await t()||!r||!v)return l;let x=new Uy.StaticJsonRpcProvider(mo(l.chainId,i,n)),T=await fl(l,x);return h(Ue(T.toBigInt()).toHexString()),yi(v.address,l,x)}b().then(E=>{s(E)})},[r]),v?(0,Xc.jsx)(FC,{children:(0,Xc.jsx)(fi,{from:v.address,to:l.to,txn:l,gas:m??void 0,tokenPrice:c,tokenSymbol:g})}):null},FC=Fy.default.div`
2163
+ `;var Wy=require("@ethersproject/abstract-signer"),so=require("@ethersproject/bignumber"),Ny=require("@ethersproject/contracts"),MC=require("@ethersproject/providers"),Ly=require("@ethersproject/transactions");var Yc=require("@ethersproject/units"),Ry=require("ofetch");var Iy=[Ii.id,Mi.id],Kc=e=>({maxPriorityFee:(0,Yc.parseUnits)(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:(0,Yc.parseUnits)(e.maxFee.toFixed(9),"gwei").toHexString()}),IC=e=>({safeLow:Kc(e.safeLow),standard:Kc(e.standard),fast:Kc(e.fast)}),My=async e=>{let t="";switch(e){case Ii.id:t="https://gasstation.polygon.technology/v2";break;case Mi.id:t="https://gasstation-testnet.polygon.technology/v2";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}return IC(await(0,Ry.ofetch)(t))};function yr(e){if(typeof e=="number"||typeof e=="bigint"||typeof e=="string")return e;if(typeof e.toHexString=="function")return e.toHexString();throw new Error(`Expected numeric value but received ${e}`)}function WC(e){let t={};return e.to!==void 0&&(t.to=e.to),e.data!==void 0&&(t.data=e.data),e.chainId!==void 0&&(t.chainId=e.chainId),e.type!==void 0&&(t.type=e.type),e.accessList!==void 0&&(t.accessList=e.accessList),e.nonce!==void 0&&(t.nonce=yr(e.nonce)),e.gasLimit!==void 0&&(t.gasLimit=yr(e.gasLimit)),e.gasPrice!==void 0&&(t.gasPrice=yr(e.gasPrice)),e.value!==void 0&&(t.value=yr(e.value)),e.maxFeePerGas!==void 0&&(t.maxFeePerGas=yr(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.maxPriorityFeePerGas=yr(e.maxPriorityFeePerGas)),t}function NC(e){let t={};return e.to!==void 0&&(t.to=e.to),e.data!==void 0&&(t.data=e.data),e.chainId!==void 0&&(t.chainId=e.chainId),e.type!==void 0&&(t.type=e.type),e.accessList!==void 0&&(t.accessList=e.accessList),e.nonce!==void 0&&(t.nonce=Ue(e.nonce).toNumber()),e.gasLimit!==void 0&&(t.gasLimit=Ue(e.gasLimit)),e.gasPrice!==void 0&&(t.gasPrice=Ue(e.gasPrice)),e.value!==void 0&&(t.value=Ue(e.value)),e.maxFeePerGas!==void 0&&(t.maxFeePerGas=Ue(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.maxPriorityFeePerGas=Ue(e.maxPriorityFeePerGas)),t}async function yi(e,t,o){t.chainId=Number(t.chainId),Dy(t);let r=new Wy.VoidSigner(e,o);if(t.gas&&(t.gasLimit=t.gas,delete t.gas),Iy.includes(t.chainId)&&(!t.maxPriorityFeePerGas||!t.maxFeePerGas))try{let{standard:i}=await My(t.chainId);t.maxPriorityFeePerGas||(t.maxPriorityFeePerGas=i.maxPriorityFee),t.maxFeePerGas||(t.maxFeePerGas=i.maxFee)}catch(i){throw new Error(`Failed to set gas prices from Polygon gas station with error: ${i}.`)}if(LC(t.chainId)&&!t.maxFeePerGas)try{let{lastBaseFeePerGas:i}=await r.getFeeData();if(i){let a=i.mul(so.BigNumber.from(120)).div(so.BigNumber.from(100));t.maxFeePerGas=yr(a),t.maxPriorityFeePerGas=yr(so.BigNumber.from(0))}}catch(i){throw new Error(`Failed to set gas price for Arbitrum transaction: ${i}.`)}if(Jc(t.chainId)&&(!t.maxPriorityFeePerGas||!t.maxFeePerGas)&&!t.gasPrice)try{if(t.type=2,!t.maxPriorityFeePerGas){let i=await o.send("eth_maxPriorityFeePerGas",[]);t.maxPriorityFeePerGas=i}if(t.maxFeePerGas&&(console.warn("maxFeePerGas is specified without maxPriorityFeePerGas - this can result in hung transactions."),t.maxPriorityFeePerGas>=t.maxFeePerGas))throw new Error("Overridden maxFeePerGas is less than or equal to the calculated maxPriorityFeePerGas. Please set both values or maxPriorityFeePerGas alone for correct gas estimation.");if(!t.maxFeePerGas){let{lastBaseFeePerGas:i}=await r.getFeeData();if(!i)throw new Error("Unable to fetch baseFee for last block.");let s=so.BigNumber.from(i).mul(so.BigNumber.from(126)).div(so.BigNumber.from(100)).add(so.BigNumber.from(t.maxPriorityFeePerGas));t.maxFeePerGas=yr(s)}}catch(i){throw new Error(`Failed to set gas price for OP stack transaction: ${i}.`)}OC(t.chainId)&&t.type!=0&&((t.type==1||t.type==2)&&console.warn("Transaction request type specified is incompatible for chain and will result in undefined behavior. Please use transaction type 0."),t.type===void 0&&(t.type=0));let n=await r.populateTransaction({to:t.to,from:t.from,nonce:t.nonce,gasLimit:t.gasLimit,gasPrice:t.gasPrice,data:t.data,value:t.value,chainId:t.chainId,type:t.type,accessList:t.accessList,maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas});return WC(n)}async function ml(e,t,o,r,n){r=Object.assign({chainId:tr},r),Dy(r);let a=(await o.rpc({address:t,accessToken:e,request:{method:"eth_signTransaction",params:[r]}})).response.data;return await n.sendTransaction(a)}async function Oy(e,t,o,r){let n=await r.getBalance(e),i=t.value||0,l=!n.sub(Ue(i)).sub(o).isNegative();return{balance:n,hasSufficientFunds:l}}function Jc(e){return[Va.id,za.id,$a.id,ja.id,Ka.id,Ya.id,Ja.id,Za.id,Qa.id].includes(e)}function LC(e){return[Ba.id,Ha.id,Ga.id].includes(e)}function OC(e){return[56,97].includes(e)}async function Qc(e,t){if(!e.chainId||e.chainId&&!Jc(e.chainId))return so.BigNumber.from(0);let o=so.BigNumber.from(0);try{let r=new Ny.Contract(op,rp,t),n=NC(e),i=(0,Ly.serialize)(n);o=await r.getL1Fee(i)}catch{}return o}async function fl(e,t){delete e.from;let o=so.BigNumber.from(0),r=so.BigNumber.from(0);if(e.gasLimit?o=Ue(e.gasLimit):o=await t.estimateGas(e),e.type==2)if(e.maxFeePerGas)r=Ue(e.maxFeePerGas);else{let i=await t.getFeeData();i.maxFeePerGas&&(r=i.maxFeePerGas)}else if(e.type==0||e.type==1)if(e.gasPrice)r=Ue(e.gasPrice);else{let i=await t.getFeeData();i.gasPrice&&(r=i.gasPrice)}else if(e.gasPrice)r=Ue(e.gasPrice);else{let i=await t.getFeeData();i.gasPrice&&(r=i.gasPrice)}let n=o.mul(r);if(e.chainId&&Jc(e.chainId))try{let i=await Qc(e,t);n=n.add(i)}catch{}return n}function Dy(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let o of t){let r=e[o];if(!(typeof r>"u")&&!DC(r))throw new Error(`Transaction request property '${o}' 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 DC(e){let t=typeof e=="number",o=typeof e=="bigint",r=typeof e=="string"&&UC(e);return t||o||r}function UC(e){return/^-?0x[a-f0-9]+$/i.test(e)}function hl(e){return{to:e.to,from:e.from,contractAddress:e.contractAddress,transactionIndex:e.transactionIndex,root:e.root,logsBloom:e.logsBloom,blockHash:e.blockHash,transactionHash:e.transactionHash,logs:e.logs,blockNumber:e.blockNumber,confirmations:e.confirmations,byzantium:e.byzantium,type:e.type,status:e.status,gasUsed:e.gasUsed.toHexString(),cumulativeGasUsed:e.cumulativeGasUsed.toHexString(),effectiveGasPrice:e.effectiveGasPrice?e.effectiveGasPrice.toHexString():void 0}}var gi=require("react");var yl=e=>{let{showFiatPrices:t,getUsdTokenPrice:o,chains:r}=W(),[n,i]=(0,gi.useState)(!0),[a,l]=(0,gi.useState)(void 0),[s,c]=(0,gi.useState)(void 0);return(0,gi.useEffect)(()=>{let m=e.chainId||tr,h=r.find(v=>v.id===Number(m));if(!h)throw new Z(`Unsupported chain: ${m}`);(async()=>{if(!t){i(!1);return}try{i(!0);let v=await o(h);v?c(v):l(new Error(`Unable to fetch token price on chain id ${h.id}`))}catch(v){l(v)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};var gl=require("react"),Zc=(0,gl.createContext)(null);function vi(){let e=(0,gl.useContext)(Zc);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}var Xc=require("react/jsx-runtime"),ed=({pendingTransaction:e})=>{let{getAccessToken:t}=z(),{wallets:o}=vi(),{walletProxy:r,rpcConfig:n,chains:i,nativeTokenSymbolForChainId:a}=W(),[l,s]=(0,pn.useState)(e),{tokenPrice:c}=yl(l),[m,h]=(0,pn.useState)(null),g=a(e.chainId)||"ETH",v=(0,pn.useMemo)(()=>o.find(b=>b.walletClientType==="privy"),[o]);return(0,pn.useEffect)(()=>{async function b(){if(!await t()||!r||!v)return l;let x=new Uy.StaticJsonRpcProvider(mo(l.chainId,i,n)),E=await fl(l,x);return h(Ue(E.toBigInt()).toHexString()),yi(v.address,l,x)}b().then(T=>{s(T)})},[r]),v?(0,Xc.jsx)(FC,{children:(0,Xc.jsx)(fi,{from:v.address,to:l.to,txn:l,gas:m??void 0,tokenPrice:c,tokenSymbol:g})}):null},FC=Fy.default.div`
2164
2164
  width: 100%;
2165
2165
  padding: 1rem 0;
2166
- `;var q=require("react/jsx-runtime"),td=({open:e,onClose:t})=>{let{user:o}=z(),[r,n]=(0,wi.useState)(null),{init:i,cancel:a}=cn();(0,wi.useEffect)(()=>{e&&o?.mfaMethods&&o.mfaMethods.length>0?l(o.mfaMethods[0]):n(null)},[o?.mfaMethods,e]);async function l(c){try{n(c),await i(c)}catch(m){console.error(m)}}let s=()=>{n(null),a(),t()};return!e||!o?null:r?(0,q.jsx)(BC,{selectedMethod:r,onClose:s,onBack:o.mfaMethods.length>1?()=>n(null):void 0}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(_,{onClose:s},"header"),(0,q.jsx)(at,{children:(0,q.jsx)(Ct,{children:(0,q.jsx)(zy.default,{})})}),(0,q.jsx)(Ne,{children:"Verify your identity"}),(0,q.jsx)(ke,{children:"Choose a verification method"}),(0,q.jsxs)(vs,{children:[o.mfaMethods.includes("totp")&&(0,q.jsxs)(We,{onClick:()=>l("totp"),children:[(0,q.jsx)(By.default,{}),"Authenticator App"]},"totp"),o.mfaMethods.includes("sms")&&(0,q.jsxs)(We,{onClick:()=>l("sms"),children:[(0,q.jsx)(Hy.default,{}),"SMS"]},"sms")]}),(0,q.jsx)(oe,{})]})},BC=({selectedMethod:e,onClose:t,onBack:o})=>{let{app:r}=S(),{pendingTransaction:n}=W(),[i,a]=(0,wi.useState)(!1),[l,s]=(0,wi.useState)(!1),{submit:c}=cn();async function m(h){try{if(!h)return;await c(e,h),s(!0),a(!1),t()}catch(g){throw As(g)?(a(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):Xr(g)?(a(!1),new Error("The code you entered is not valid")):Zr(g)?(a(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(a(!1),new Error("Unknown error"))}}switch(e){case"sms":return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(_,{onClose:t},"header"),(0,q.jsx)(at,{children:(0,q.jsx)(Ct,{children:(0,q.jsx)(Vy.default,{})})}),(0,q.jsx)(Ne,{children:"Enter verification code"}),(0,q.jsxs)(Ir,{children:[(0,q.jsx)(pi,{success:l,disabled:i,onChange:m}),(0,q.jsxs)(ke,{children:["To continue, please enter the 6-digit code sent to your ",(0,q.jsx)("strong",{children:"mobile device"})]}),n&&(0,q.jsx)(ed,{pendingTransaction:n})]}),o&&(0,q.jsx)(nc,{theme:r?.appearance.palette.colorScheme,onClick:o,children:"Choose another method"}),(0,q.jsx)(go,{onClick:t,children:"Not now"}),(0,q.jsx)(oe,{})]});case"totp":return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(_,{onClose:t},"header"),(0,q.jsx)(at,{children:(0,q.jsx)(Ct,{children:(0,q.jsx)(Gy.default,{})})}),(0,q.jsx)(Ne,{children:"Enter verification code"}),(0,q.jsxs)(Ir,{children:[(0,q.jsx)(pi,{success:l,disabled:i,onChange:m}),(0,q.jsxs)(ke,{children:["To continue, please enter the 6-digit code generated from your"," ",(0,q.jsx)("strong",{children:"authenticator app"})]}),n&&(0,q.jsx)(ed,{pendingTransaction:n})]}),o&&(0,q.jsx)(nc,{theme:r?.appearance.palette.colorScheme,onClick:o,children:"Choose another method"}),(0,q.jsx)(go,{onClick:t,children:"Not now"}),(0,q.jsx)(oe,{})]});default:return null}};var Ci=require("react"),rd=f(require("styled-components"));function od(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Xe=require("react/jsx-runtime"),$y={google:{name:"Google",component:Js},discord:{name:"Discord",component:Ks},github:{name:"Github",component:Ys},linkedin:{name:"LinkedIn",component:Qs},twitter:{name:"Twitter",component:el},spotify:{name:"Spotify",component:Zs},tiktok:{name:"Tiktok",component:Xs},apple:{name:"Apple",component:js}},vl=()=>{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"),uo.del(Cn),window.history.pushState({},"",e)},qy=()=>{let{ready:e,user:t,authenticated:o}=z(),{app:r,setModalData:n,navigate:i,resetNavigation:a}=S(),{getAuthMeta:l,initLoginWithOAuth:s,loginWithOAuth:c,updateWallets:m,setReadyToTrue:h,closePrivyModal:g}=W(),[v,b]=(0,Ci.useState)(!1),[E,x]=(0,Ci.useState)(void 0),T=l()?.provider||"google",A=$y[T].name,R=$y[T].component,I=r?.render.inDialog?yt:0;(0,Ci.useEffect)(()=>{c(T).then(()=>{vl(),b(!0)}).catch(U=>{let B={retryable:!1,message:"Authentication failed"};if(U?.privyErrorCode==="allowlist_rejected"){x(void 0),a(),i("ALLOWLIST_REJECTION_SCREEN"),vl();return}else U?.privyErrorCode==="linked_to_another_user"?B.detail="This account has already been linked to another user.":U?.privyErrorCode==="invalid_credentials"?(B.retryable=!0,B.detail="Something went wrong. Try again."):U.privyErrorCode==="oauth_user_denied"?(B.detail=`Retry and check ${od(T)} to finish connecting your account.`,B.retryable=!0):U?.privyErrorCode==="too_many_requests"?B.detail="Too many requests. Please wait before trying again.":U?.privyErrorCode==="oauth_account_suspended"&&(B.detail=`Your ${A} account is suspended. Please try another login method.`);vl(),x(B)}).finally(()=>{h()})},[A,T]),(0,Ci.useEffect)(()=>{if(e&&o&&v&&t){if(r?.legal.requireUsersAcceptTerms&&!t.hasAcceptedTerms){let B=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},I);return()=>clearTimeout(B)}if(Kt(t,r?.embeddedWallets?.createOnLogin)){let B=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:G=>console.error(G),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},I);return()=>clearTimeout(B)}else{let B=setTimeout(g,I);return m(),()=>clearTimeout(B)}}},[e,o,v,t]);let k=v?`Successfully connected with ${A}`:E?E.message:`Verifying connection to ${A}`,D="";return v?D="You\u2019re good to go!":E?D=E.detail:D="Just a few moments more",(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(_,{}),(0,Xe.jsx)(X,{}),(0,Xe.jsxs)(HC,{children:[(0,Xe.jsx)(GC,{children:(0,Xe.jsxs)("div",{children:[(0,Xe.jsx)(Rr,{success:v,fail:!!E}),(0,Xe.jsx)(R,{style:{width:"38px",height:"38px"}})]})}),(0,Xe.jsxs)(ro,{children:[(0,Xe.jsx)("h3",{children:k}),(0,Xe.jsx)("p",{children:D})]}),E&&E?.retryable?(0,Xe.jsx)(fs,{onClick:()=>{vl(),s(T),x(void 0)},disabled:!v&&!E?.retryable,children:"Retry"}):null]}),(0,Xe.jsx)(ee,{}),(0,Xe.jsx)(oe,{})]})},HC=rd.default.div`
2166
+ `;var q=require("react/jsx-runtime"),td=({open:e,onClose:t})=>{let{user:o}=z(),[r,n]=(0,wi.useState)(null),{init:i,cancel:a}=cn();(0,wi.useEffect)(()=>{e&&o?.mfaMethods&&o.mfaMethods.length>0?l(o.mfaMethods[0]):n(null)},[o?.mfaMethods,e]);async function l(c){try{n(c),await i(c)}catch(m){console.error(m)}}let s=()=>{n(null),a(),t()};return!e||!o?null:r?(0,q.jsx)(BC,{selectedMethod:r,onClose:s,onBack:o.mfaMethods.length>1?()=>n(null):void 0}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(A,{onClose:s},"header"),(0,q.jsx)(at,{children:(0,q.jsx)(Ct,{children:(0,q.jsx)(zy.default,{})})}),(0,q.jsx)(Ne,{children:"Verify your identity"}),(0,q.jsx)(ke,{children:"Choose a verification method"}),(0,q.jsxs)(vs,{children:[o.mfaMethods.includes("totp")&&(0,q.jsxs)(We,{onClick:()=>l("totp"),children:[(0,q.jsx)(By.default,{}),"Authenticator App"]},"totp"),o.mfaMethods.includes("sms")&&(0,q.jsxs)(We,{onClick:()=>l("sms"),children:[(0,q.jsx)(Hy.default,{}),"SMS"]},"sms")]}),(0,q.jsx)(oe,{})]})},BC=({selectedMethod:e,onClose:t,onBack:o})=>{let{app:r}=_(),{pendingTransaction:n}=W(),[i,a]=(0,wi.useState)(!1),[l,s]=(0,wi.useState)(!1),{submit:c}=cn();async function m(h){try{if(!h)return;await c(e,h),s(!0),a(!1),t()}catch(g){throw As(g)?(a(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):Xr(g)?(a(!1),new Error("The code you entered is not valid")):Zr(g)?(a(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(a(!1),new Error("Unknown error"))}}switch(e){case"sms":return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(A,{onClose:t},"header"),(0,q.jsx)(at,{children:(0,q.jsx)(Ct,{children:(0,q.jsx)(Vy.default,{})})}),(0,q.jsx)(Ne,{children:"Enter verification code"}),(0,q.jsxs)(Ir,{children:[(0,q.jsx)(pi,{success:l,disabled:i,onChange:m}),(0,q.jsxs)(ke,{children:["To continue, please enter the 6-digit code sent to your ",(0,q.jsx)("strong",{children:"mobile device"})]}),n&&(0,q.jsx)(ed,{pendingTransaction:n})]}),o&&(0,q.jsx)(nc,{theme:r?.appearance.palette.colorScheme,onClick:o,children:"Choose another method"}),(0,q.jsx)(go,{onClick:t,children:"Not now"}),(0,q.jsx)(oe,{})]});case"totp":return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(A,{onClose:t},"header"),(0,q.jsx)(at,{children:(0,q.jsx)(Ct,{children:(0,q.jsx)(Gy.default,{})})}),(0,q.jsx)(Ne,{children:"Enter verification code"}),(0,q.jsxs)(Ir,{children:[(0,q.jsx)(pi,{success:l,disabled:i,onChange:m}),(0,q.jsxs)(ke,{children:["To continue, please enter the 6-digit code generated from your"," ",(0,q.jsx)("strong",{children:"authenticator app"})]}),n&&(0,q.jsx)(ed,{pendingTransaction:n})]}),o&&(0,q.jsx)(nc,{theme:r?.appearance.palette.colorScheme,onClick:o,children:"Choose another method"}),(0,q.jsx)(go,{onClick:t,children:"Not now"}),(0,q.jsx)(oe,{})]});default:return null}};var Ci=require("react"),rd=f(require("styled-components"));function od(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Xe=require("react/jsx-runtime"),$y={google:{name:"Google",component:Js},discord:{name:"Discord",component:Ks},github:{name:"Github",component:Ys},linkedin:{name:"LinkedIn",component:Qs},twitter:{name:"Twitter",component:el},spotify:{name:"Spotify",component:Zs},tiktok:{name:"Tiktok",component:Xs},apple:{name:"Apple",component:js}},vl=()=>{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"),uo.del(Cn),window.history.pushState({},"",e)},qy=()=>{let{ready:e,user:t,authenticated:o}=z(),{app:r,setModalData:n,navigate:i,resetNavigation:a}=_(),{getAuthMeta:l,initLoginWithOAuth:s,loginWithOAuth:c,updateWallets:m,setReadyToTrue:h,closePrivyModal:g}=W(),[v,b]=(0,Ci.useState)(!1),[T,x]=(0,Ci.useState)(void 0),E=l()?.provider||"google",k=$y[E].name,I=$y[E].component,M=r?.render.inDialog?yt:0;(0,Ci.useEffect)(()=>{c(E).then(()=>{vl(),b(!0)}).catch(D=>{let B={retryable:!1,message:"Authentication failed"};if(D?.privyErrorCode==="allowlist_rejected"){x(void 0),a(),i("ALLOWLIST_REJECTION_SCREEN"),vl();return}else D?.privyErrorCode==="linked_to_another_user"?B.detail="This account has already been linked to another user.":D?.privyErrorCode==="invalid_credentials"?(B.retryable=!0,B.detail="Something went wrong. Try again."):D.privyErrorCode==="oauth_user_denied"?(B.detail=`Retry and check ${od(E)} to finish connecting your account.`,B.retryable=!0):D?.privyErrorCode==="too_many_requests"?B.detail="Too many requests. Please wait before trying again.":D?.privyErrorCode==="oauth_account_suspended"&&(B.detail=`Your ${k} account is suspended. Please try another login method.`);vl(),x(B)}).finally(()=>{h()})},[k,E]),(0,Ci.useEffect)(()=>{if(e&&o&&v&&t){if(r?.legal.requireUsersAcceptTerms&&!t.hasAcceptedTerms){let B=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},M);return()=>clearTimeout(B)}if(Kt(t,r?.embeddedWallets?.createOnLogin)){let B=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:G=>console.error(G),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},M);return()=>clearTimeout(B)}else{let B=setTimeout(g,M);return m(),()=>clearTimeout(B)}}},[e,o,v,t]);let S=v?`Successfully connected with ${k}`:T?T.message:`Verifying connection to ${k}`,O="";return v?O="You\u2019re good to go!":T?O=T.detail:O="Just a few moments more",(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(A,{}),(0,Xe.jsx)(X,{}),(0,Xe.jsxs)(HC,{children:[(0,Xe.jsx)(GC,{children:(0,Xe.jsxs)("div",{children:[(0,Xe.jsx)(Rr,{success:v,fail:!!T}),(0,Xe.jsx)(I,{style:{width:"38px",height:"38px"}})]})}),(0,Xe.jsxs)(ro,{children:[(0,Xe.jsx)("h3",{children:S}),(0,Xe.jsx)("p",{children:O})]}),T&&T?.retryable?(0,Xe.jsx)(fs,{onClick:()=>{vl(),s(E),x(void 0)},disabled:!v&&!T?.retryable,children:"Retry"}):null]}),(0,Xe.jsx)(ee,{}),(0,Xe.jsx)(oe,{})]})},HC=rd.default.div`
2167
2167
  display: flex;
2168
2168
  flex-direction: column;
2169
2169
  align-items: center;
@@ -2194,14 +2194,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
2194
2194
  left: -19px;
2195
2195
  top: -19px;
2196
2196
  }
2197
- `;var aa=require("react"),Yy=f(require("styled-components"));var jy=require("react-device-detect");var Ky=(e,t)=>{let o=new URL(window.location.href),r=encodeURIComponent(o.href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=injected&privy_wallet_client=phantom`);if(!Er()&&jy.isMobile)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${r}?ref=${r}`};var Et=require("react/jsx-runtime"),Jy=()=>{let{forkSession:e,ready:t,authenticated:o}=z(),[r,n]=(0,aa.useState)(""),[i,a]=(0,aa.useState)(!1);(0,aa.useEffect)(()=>{t&&o&&e().then(n)},[t,o]);let l=Ky(r,!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."),(0,Et.jsxs)(Et.Fragment,{children:[(0,Et.jsx)(_,{},"header"),(0,Et.jsx)(X,{}),(0,Et.jsx)(Uo,{title:s.title,description:s.description}),(0,Et.jsxs)(to,{children:[(0,Et.jsx)(VC,{children:(0,Et.jsx)(No,{style:{width:"72px",height:"72px"}})}),(0,Et.jsx)(ms,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?(0,Et.jsx)("p",{children:s.footnote}):null]}),(0,Et.jsx)(ee,{}),(0,Et.jsx)($,{protectedByPrivy:!0})]})},VC=(0,Yy.default)(oo)`
2197
+ `;var aa=require("react"),Yy=f(require("styled-components"));var jy=require("react-device-detect");var Ky=(e,t)=>{let o=new URL(window.location.href),r=encodeURIComponent(o.href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=injected&privy_wallet_client=phantom`);if(!Er()&&jy.isMobile)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${r}?ref=${r}`};var Et=require("react/jsx-runtime"),Jy=()=>{let{forkSession:e,ready:t,authenticated:o}=z(),[r,n]=(0,aa.useState)(""),[i,a]=(0,aa.useState)(!1);(0,aa.useEffect)(()=>{t&&o&&e().then(n)},[t,o]);let l=Ky(r,!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."),(0,Et.jsxs)(Et.Fragment,{children:[(0,Et.jsx)(A,{},"header"),(0,Et.jsx)(X,{}),(0,Et.jsx)(Uo,{title:s.title,description:s.description}),(0,Et.jsxs)(to,{children:[(0,Et.jsx)(VC,{children:(0,Et.jsx)(No,{style:{width:"72px",height:"72px"}})}),(0,Et.jsx)(ms,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?(0,Et.jsx)("p",{children:s.footnote}):null]}),(0,Et.jsx)(ee,{}),(0,Et.jsx)($,{protectedByPrivy:!0})]})},VC=(0,Yy.default)(oo)`
2198
2198
  margin: 16px auto;
2199
- `;var tg=require("@ethersproject/bignumber"),og=require("@ethersproject/providers"),$e=require("react"),un=f(require("styled-components"));function Qy(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND":"UNKNOWN"}var wl=require("@ethersproject/bignumber"),Zy=f(require("styled-components"));var Yo=require("react/jsx-runtime"),zC=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let o=wl.BigNumber.from(e.gasUsed),r=wl.BigNumber.from(e.effectiveGasPrice),n=o.mul(r);if(t){let i=wl.BigNumber.from(t);n=n.add(i)}return n.toString()}catch{return}else return},Xy=({txn:e,receipt:t,transactionInfo:o,onClose:r,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a})=>(0,Yo.jsxs)(Yo.Fragment,{children:[(0,Yo.jsx)(_,{onClose:r}),(0,Yo.jsx)(Ni,{title:"Transaction complete!",description:"You're all set."}),(0,Yo.jsx)(fi,{tokenPrice:n,from:t.from,to:t.to,gas:zC(t,a),txn:e,transactionInfo:o,tokenSymbol:i}),(0,Yo.jsx)($C,{loading:!1,onClick:r,children:"All Done"}),(0,Yo.jsx)(oe,{})]}),$C=(0,Zy.default)(F)`
2199
+ `;var tg=require("@ethersproject/bignumber"),og=require("@ethersproject/providers"),$e=require("react"),un=f(require("styled-components"));function Qy(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND":"UNKNOWN"}var wl=require("@ethersproject/bignumber"),Zy=f(require("styled-components"));var Yo=require("react/jsx-runtime"),zC=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let o=wl.BigNumber.from(e.gasUsed),r=wl.BigNumber.from(e.effectiveGasPrice),n=o.mul(r);if(t){let i=wl.BigNumber.from(t);n=n.add(i)}return n.toString()}catch{return}else return},Xy=({txn:e,receipt:t,transactionInfo:o,onClose:r,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a})=>(0,Yo.jsxs)(Yo.Fragment,{children:[(0,Yo.jsx)(A,{onClose:r}),(0,Yo.jsx)(Ni,{title:"Transaction complete!",description:"You're all set."}),(0,Yo.jsx)(fi,{tokenPrice:n,from:t.from,to:t.to,gas:zC(t,a),txn:e,transactionInfo:o,tokenSymbol:i}),(0,Yo.jsx)($C,{loading:!1,onClick:r,children:"All Done"}),(0,Yo.jsx)(oe,{})]}),$C=(0,Zy.default)(F)`
2200
2200
  && {
2201
2201
  margin-top: 24px;
2202
2202
  }
2203
2203
  transition: color 350ms ease, background-color 350ms ease;
2204
- `;var fe=require("react/jsx-runtime");var qC=({txn:e,txnFamily:t,uiOptions:o,tokenSymbol:r,tokenPrice:n})=>{if(t==="CONTRACT_CALL"){if(o.transactionInfo?.contractInfo)return(0,fe.jsx)(jc,{contractInfo:o.transactionInfo.contractInfo,description:o.description});if(o.senderInfo)return(0,fe.jsx)(jc,{contractInfo:o.senderInfo,description:o.description||o.senderInfo.actionText})}return(0,fe.jsx)(fe.Fragment,{children:(0,fe.jsx)(ky,{description:o.description||o.transactionInfo?.description||"",txn:e,tokenSymbol:r,tokenPrice:n})})},rg=()=>{let{authenticated:e,getAccessToken:t}=z(),{wallets:o}=vi(),{walletProxy:r,closePrivyModal:n,getFiatOnRampConfig:i,rpcConfig:a,chains:l,nativeTokenSymbolForChainId:s}=W(),{app:c,navigate:m,data:h,onUserCloseViaDialogOrKeybindRef:g,setModalData:v}=S(),{transactionRequest:b,onSuccess:E,onFailure:x,uiOptions:T,fundWalletConfig:A}=h.sendTransaction,[R,I]=(0,$e.useState)(null),[k,D]=(0,$e.useState)(null),[U,B]=(0,$e.useState)(""),[G,j]=(0,$e.useState)(),[O,K]=(0,$e.useState)(!1),M=()=>{B(""),j(void 0)},pe=(pt,Wt,qt)=>{B(pt),j(new nt(new Wo(Wt??pt,qt??St.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))},[he,Q]=(0,$e.useState)(!1),[ct,Me]=(0,$e.useState)(!0),[Tt,qe]=(0,$e.useState)(null),[le,Zo]=(0,$e.useState)(b),{tokenPrice:lo,isTokenPriceLoading:fn}=yl(le),Pt=s(b.chainId)||"ETH",[je,Ro]=(0,$e.useState)(null),[hn,N]=(0,$e.useState)(null),[dt,Ti]=(0,$e.useState)(!0);(0,$e.useEffect)(()=>{e||(m("LANDING"),x(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let re=(0,$e.useMemo)(()=>o.find(pt=>pt.walletClientType==="privy"),[o]),$t=async()=>{if(!re)return console.warn("No privy wallet found, cannot fund wallet.");let{signedUrl:pt,externalTransactionId:Wt}=await i(re.address,{config:A?.config||{}});v({fiatOnRampPrompt:{signedUrl:pt},fiatOnRampStatus:{externalTransactionId:Wt}}),m("FIAT_ON_RAMP_PROMPT_SCREEN")},Vr=(0,$e.useMemo)(()=>new og.StaticJsonRpcProvider(mo(le.chainId,l,a)),[le.chainId,a]);(0,$e.useEffect)(()=>{let pt=()=>{Me(!1),pe("Wallet has insufficient funds for this transaction."),c?.fiatOnRamp.enabled&&K(!0)};async function Wt(){let qt=le;if(!await t()||!r||!re)return;try{qt=await yi(re.address,le,Vr),Zo(qt)}catch(co){Cm(co)?pt():pe("There was an error preparing your transaction. Please try again.",co.reason)}let wr=tg.BigNumber.from(0);try{wr=await fl(qt,Vr),Ro(Ue(wr.toBigInt()).toHexString());let co=await Qc(le,Vr);N(Ue(co.toBigInt()).toHexString())}catch{Ro(null)}try{let{balance:co,hasSufficientFunds:da}=await Oy(re.address,qt,wr,Vr);qe(co.toHexString()),da||pt()}catch(co){console.warn(`Failed to fetch wallet balance with error: ${co}`)}Ti(!1)}Wt()},[r]);let ca=Qy(le),Pi=ca==="SEND"?`Send ${Pt}`:"Review transaction",vr={modalTitle:T.header||T.modalTitle||Pi,buttonText:T.buttonText||"Submit"},yn=()=>{he||(k?E(k):x(G||new nt(new Wo("The user rejected the request",St.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}))};return g.current=yn,lo===void 0&&fn||dt?(0,fe.jsxs)(fe.Fragment,{children:[T.transactionInfo?.contractInfo?.imgUrl&&(0,fe.jsx)(Fa,{src:T.transactionInfo?.contractInfo?.imgUrl}),(0,fe.jsx)(_,{title:vr.modalTitle,onClose:yn}),(0,fe.jsx)(eg,{children:(0,fe.jsx)(Yn,{})})]}):R!==null?(0,fe.jsx)(Xy,{txn:le,onClose:yn,receipt:R,transactionInfo:T.transactionInfo,tokenPrice:lo,tokenSymbol:Pt,l1GasEstimate:hn}):(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(_,{title:vr.modalTitle,onClose:yn}),(0,fe.jsxs)(eg,{children:[(0,fe.jsxs)(JC,{children:[(0,fe.jsx)(qC,{txn:le,txnFamily:ca,uiOptions:T,tokenSymbol:Pt,tokenPrice:lo}),re?(0,fe.jsx)(fi,{from:re.address,to:le.to,txn:le,transactionInfo:T.transactionInfo,gas:je||void 0,tokenPrice:lo,tokenSymbol:Pt}):null]}),(0,fe.jsxs)(QC,{children:[(0,fe.jsx)(jC,{children:U}),(0,fe.jsx)(_y,{txn:le,address:re?.address??"",hasFunds:ct,balance:Tt}),(0,fe.jsxs)(KC,{children:[O&&(0,fe.jsx)(F,{onClick:$t,children:"Add Funds"}),(0,fe.jsx)(YC,{disabled:he||!ct,loading:!r||he,loadingText:he?"Submitting (may take a few minutes)...":"Loading...",onClick:async()=>{Q(!0);let pt=await t();if(pt&&!he&&re)try{let Wt=await ml(pt,re.address,r,le,Vr);D(Wt);let qt=await Wt.wait();I(hl(qt)),M()}catch(Wt){let qt="There was an error processing your transaction. Please contact support.";console.warn({transaction:le,error:Wt}),pe(qt,Wt.reason)}finally{Q(!1)}},children:vr.buttonText})]})]})]})]})},eg=un.default.div`
2204
+ `;var he=require("react/jsx-runtime");var qC=({txn:e,txnFamily:t,uiOptions:o,tokenSymbol:r,tokenPrice:n})=>{if(t==="CONTRACT_CALL"){if(o.transactionInfo?.contractInfo)return(0,he.jsx)(jc,{contractInfo:o.transactionInfo.contractInfo,description:o.description});if(o.senderInfo)return(0,he.jsx)(jc,{contractInfo:o.senderInfo,description:o.description||o.senderInfo.actionText})}return(0,he.jsx)(he.Fragment,{children:(0,he.jsx)(ky,{description:o.description||o.transactionInfo?.description||"",txn:e,tokenSymbol:r,tokenPrice:n})})},rg=()=>{let{authenticated:e,getAccessToken:t}=z(),{wallets:o}=vi(),{walletProxy:r,closePrivyModal:n,getFiatOnRampConfig:i,rpcConfig:a,chains:l,nativeTokenSymbolForChainId:s}=W(),{app:c,navigate:m,data:h,onUserCloseViaDialogOrKeybindRef:g,setModalData:v}=_(),{transactionRequest:b,onSuccess:T,onFailure:x,uiOptions:E,fundWalletConfig:k}=h.sendTransaction,[I,M]=(0,$e.useState)(null),[S,O]=(0,$e.useState)(null),[D,B]=(0,$e.useState)(""),[G,K]=(0,$e.useState)(),[U,j]=(0,$e.useState)(!1),R=()=>{B(""),K(void 0)},le=(pt,Wt,qt)=>{B(pt),K(new nt(new Wo(Wt??pt,qt??St.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))},[ue,Q]=(0,$e.useState)(!1),[ct,Me]=(0,$e.useState)(!0),[Tt,qe]=(0,$e.useState)(null),[ce,Zo]=(0,$e.useState)(b),{tokenPrice:lo,isTokenPriceLoading:fn}=yl(ce),Pt=s(b.chainId)||"ETH",[je,Ro]=(0,$e.useState)(null),[hn,N]=(0,$e.useState)(null),[dt,Ti]=(0,$e.useState)(!0);(0,$e.useEffect)(()=>{e||(m("LANDING"),x(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let re=(0,$e.useMemo)(()=>o.find(pt=>pt.walletClientType==="privy"),[o]),$t=async()=>{if(!re)return console.warn("No privy wallet found, cannot fund wallet.");let{signedUrl:pt,externalTransactionId:Wt}=await i(re.address,{config:k?.config||{}});v({fiatOnRampPrompt:{signedUrl:pt},fiatOnRampStatus:{externalTransactionId:Wt}}),m("FIAT_ON_RAMP_PROMPT_SCREEN")},Vr=(0,$e.useMemo)(()=>new og.StaticJsonRpcProvider(mo(ce.chainId,l,a)),[ce.chainId,a]);(0,$e.useEffect)(()=>{let pt=()=>{Me(!1),le("Wallet has insufficient funds for this transaction."),c?.fiatOnRamp.enabled&&j(!0)};async function Wt(){let qt=ce;if(!await t()||!r||!re)return;try{qt=await yi(re.address,ce,Vr),Zo(qt)}catch(co){Cm(co)?pt():le("There was an error preparing your transaction. Please try again.",co.reason)}let wr=tg.BigNumber.from(0);try{wr=await fl(qt,Vr),Ro(Ue(wr.toBigInt()).toHexString());let co=await Qc(ce,Vr);N(Ue(co.toBigInt()).toHexString())}catch{Ro(null)}try{let{balance:co,hasSufficientFunds:da}=await Oy(re.address,qt,wr,Vr);qe(co.toHexString()),da||pt()}catch(co){console.warn(`Failed to fetch wallet balance with error: ${co}`)}Ti(!1)}Wt()},[r]);let ca=Qy(ce),Pi=ca==="SEND"?`Send ${Pt}`:"Review transaction",vr={modalTitle:E.header||E.modalTitle||Pi,buttonText:E.buttonText||"Submit"},yn=()=>{ue||(S?T(S):x(G||new nt(new Wo("The user rejected the request",St.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}))};return g.current=yn,lo===void 0&&fn||dt?(0,he.jsxs)(he.Fragment,{children:[E.transactionInfo?.contractInfo?.imgUrl&&(0,he.jsx)(Fa,{src:E.transactionInfo?.contractInfo?.imgUrl}),(0,he.jsx)(A,{title:vr.modalTitle,onClose:yn}),(0,he.jsx)(eg,{children:(0,he.jsx)(Yn,{})})]}):I!==null?(0,he.jsx)(Xy,{txn:ce,onClose:yn,receipt:I,transactionInfo:E.transactionInfo,tokenPrice:lo,tokenSymbol:Pt,l1GasEstimate:hn}):(0,he.jsxs)(he.Fragment,{children:[(0,he.jsx)(A,{title:vr.modalTitle,onClose:yn}),(0,he.jsxs)(eg,{children:[(0,he.jsxs)(JC,{children:[(0,he.jsx)(qC,{txn:ce,txnFamily:ca,uiOptions:E,tokenSymbol:Pt,tokenPrice:lo}),re?(0,he.jsx)(fi,{from:re.address,to:ce.to,txn:ce,transactionInfo:E.transactionInfo,gas:je||void 0,tokenPrice:lo,tokenSymbol:Pt}):null]}),(0,he.jsxs)(QC,{children:[(0,he.jsx)(jC,{children:D}),(0,he.jsx)(_y,{txn:ce,address:re?.address??"",hasFunds:ct,balance:Tt}),(0,he.jsxs)(KC,{children:[U&&(0,he.jsx)(F,{onClick:$t,children:"Add Funds"}),(0,he.jsx)(YC,{disabled:ue||!ct,loading:!r||ue,loadingText:ue?"Submitting (may take a few minutes)...":"Loading...",onClick:async()=>{Q(!0);let pt=await t();if(pt&&!ue&&re)try{let Wt=await ml(pt,re.address,r,ce,Vr);O(Wt);let qt=await Wt.wait();M(hl(qt)),R()}catch(Wt){let qt="There was an error processing your transaction. Please contact support.";console.warn({transaction:ce,error:Wt}),le(qt,Wt.reason)}finally{Q(!1)}},children:vr.buttonText})]})]})]})]})},eg=un.default.div`
2205
2205
  display: flex;
2206
2206
  flex-direction: column;
2207
2207
  justify-content: space-between;
@@ -2230,7 +2230,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2230
2230
  display: flex;
2231
2231
  flex-direction: column;
2232
2232
  gap: 8px;
2233
- `;var ng=require("@ethersproject/bytes"),ig=require("@ethersproject/strings"),Gr=require("react"),_o=f(require("styled-components"));var de=require("react/jsx-runtime"),ZC=e=>{if(!(0,ng.isHexString)(e))return e;try{return(0,ig.toUtf8String)(e)}catch{return e}},XC=e=>JSON.stringify(e,null,2),eb=({data:e})=>{let t=o=>typeof o=="object"&&o!==null?(0,de.jsx)(ib,{children:Object.entries(o).map(([r,n])=>(0,de.jsxs)("li",{children:[(0,de.jsxs)("strong",{children:[r,":"]})," ",t(n)]},r))}):(0,de.jsx)("span",{children:String(o)});return(0,de.jsx)("div",{children:t(e)})},tb=e=>{let{types:t,primaryType:o,...r}=e.typedData;return(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(sg,{children:(0,de.jsx)(eb,{data:r})}),(0,de.jsx)(oi,{text:XC(e.typedData),itemName:"full payload to clipboard"})," "]})},ag=()=>{let{authenticated:e}=z(),{initializeWalletProxy:t,closePrivyModal:o}=W(),{navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:i}=S(),[a,l]=(0,Gr.useState)(!0),[s,c]=(0,Gr.useState)(""),[m,h]=(0,Gr.useState)(),[g,v]=(0,Gr.useState)(null),b=g!==null;(0,Gr.useEffect)(()=>{e||r("LANDING")},[e]),(0,Gr.useEffect)(()=>{t(En).then(U=>{l(!1),U||(c("An error has occurred, please try again."),h(new nt(new Wo(s,St.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:E,data:x,confirmAndSign:T,onSuccess:A,onFailure:R,uiOptions:I}=n.signMessage,k={title:I.title||"Sign message",description:I.description||"Signing this message will not cost you any fees.",buttonText:I.buttonText||"Sign and continue"},D=U=>{U?A(U):R(m||new nt(new Wo("The user rejected the request.",St.E4001_USER_REJECTED_REQUEST.eipCode))),o({shouldCallAuthOnSuccess:!1}),v(null),c(""),h(void 0)};return i.current=()=>{D(g)},(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(_,{onClose:()=>D(g)}),(0,de.jsx)(X,{}),(0,de.jsxs)(ob,{children:[(0,de.jsx)(rb,{children:k.title}),(0,de.jsx)(nb,{children:k.description}),E==="personal_sign"&&(0,de.jsx)(sg,{children:ZC(x)}),E==="eth_signTypedData_v4"&&(0,de.jsx)(tb,{typedData:x}),(0,de.jsx)(ab,{fail:!0,children:s}),(0,de.jsx)(lb,{success:b,loading:a,disabled:b,onClick:async()=>{try{let U=await T();v(U),c(""),setTimeout(()=>{D(U)},yt)}catch{c("An error has occurred, please try again."),h(new nt(new Wo(s,St.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}},children:b?(0,de.jsxs)(sb,{children:[(0,de.jsx)(Ws,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",(0,de.jsx)("span",{children:"Success"})]}):k.buttonText})]}),(0,de.jsx)(ee,{}),(0,de.jsx)($,{protectedByPrivy:!0})]})},ob=_o.default.div`
2233
+ `;var ng=require("@ethersproject/bytes"),ig=require("@ethersproject/strings"),Gr=require("react"),_o=f(require("styled-components"));var pe=require("react/jsx-runtime"),ZC=e=>{if(!(0,ng.isHexString)(e))return e;try{return(0,ig.toUtf8String)(e)}catch{return e}},XC=e=>JSON.stringify(e,null,2),eb=({data:e})=>{let t=o=>typeof o=="object"&&o!==null?(0,pe.jsx)(ib,{children:Object.entries(o).map(([r,n])=>(0,pe.jsxs)("li",{children:[(0,pe.jsxs)("strong",{children:[r,":"]})," ",t(n)]},r))}):(0,pe.jsx)("span",{children:String(o)});return(0,pe.jsx)("div",{children:t(e)})},tb=e=>{let{types:t,primaryType:o,...r}=e.typedData;return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(sg,{children:(0,pe.jsx)(eb,{data:r})}),(0,pe.jsx)(oi,{text:XC(e.typedData),itemName:"full payload to clipboard"})," "]})},ag=()=>{let{authenticated:e}=z(),{initializeWalletProxy:t,closePrivyModal:o}=W(),{navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:i}=_(),[a,l]=(0,Gr.useState)(!0),[s,c]=(0,Gr.useState)(""),[m,h]=(0,Gr.useState)(),[g,v]=(0,Gr.useState)(null),b=g!==null;(0,Gr.useEffect)(()=>{e||r("LANDING")},[e]),(0,Gr.useEffect)(()=>{t(En).then(D=>{l(!1),D||(c("An error has occurred, please try again."),h(new nt(new Wo(s,St.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:T,data:x,confirmAndSign:E,onSuccess:k,onFailure:I,uiOptions:M}=n.signMessage,S={title:M.title||"Sign message",description:M.description||"Signing this message will not cost you any fees.",buttonText:M.buttonText||"Sign and continue"},O=D=>{D?k(D):I(m||new nt(new Wo("The user rejected the request.",St.E4001_USER_REJECTED_REQUEST.eipCode))),o({shouldCallAuthOnSuccess:!1}),v(null),c(""),h(void 0)};return i.current=()=>{O(g)},(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(A,{onClose:()=>O(g)}),(0,pe.jsx)(X,{}),(0,pe.jsxs)(ob,{children:[(0,pe.jsx)(rb,{children:S.title}),(0,pe.jsx)(nb,{children:S.description}),T==="personal_sign"&&(0,pe.jsx)(sg,{children:ZC(x)}),T==="eth_signTypedData_v4"&&(0,pe.jsx)(tb,{typedData:x}),(0,pe.jsx)(ab,{fail:!0,children:s}),(0,pe.jsx)(lb,{success:b,loading:a,disabled:b,onClick:async()=>{try{let D=await E();v(D),c(""),setTimeout(()=>{O(D)},yt)}catch{c("An error has occurred, please try again."),h(new nt(new Wo(s,St.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}},children:b?(0,pe.jsxs)(sb,{children:[(0,pe.jsx)(Ws,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",(0,pe.jsx)("span",{children:"Success"})]}):S.buttonText})]}),(0,pe.jsx)(ee,{}),(0,pe.jsx)($,{protectedByPrivy:!0})]})},ob=_o.default.div`
2234
2234
  display: flex;
2235
2235
  flex-direction: column;
2236
2236
  align-items: center;
@@ -2306,7 +2306,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2306
2306
  color: #ffffff;
2307
2307
  }
2308
2308
  `}
2309
- `;var dg=f(require("@heroicons/react/24/outline/EnvelopeIcon"));var lg=f(require("@heroicons/react/24/outline/EnvelopeIcon")),sa=require("react"),nd=f(require("styled-components"));var Ao=require("react/jsx-runtime"),cg=(0,sa.forwardRef)((e,t)=>{let[o,r]=(0,sa.useState)(""),[n,i]=(0,sa.useState)(!1),{authenticated:a,user:l}=z(),{initUpdateEmail:s}=W(),{navigate:c,setModalData:m,currentScreen:h}=S(),{enabled:g,token:v}=_e(),b=_a(o),E=n,x=n||!b,T=async R=>{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,o,R),c("AWAITING_PASSWORDLESS_CODE")}catch(I){m({errorModalData:{error:I,previousScreen:h||"LANDING"}})}i(!1)},A=()=>{g&&!v&&!a?(m({captchaModalData:{callback:R=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,o,R)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):T(v)};return(0,Ao.jsxs)(Ao.Fragment,{children:[(0,Ao.jsx)(cb,{children:(0,Ao.jsxs)(db,{children:[(0,Ao.jsx)(lg.default,{}),(0,Ao.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:R=>r(R.target.value),onKeyUp:R=>{R.key==="Enter"&&A()},value:o,autoComplete:"email"}),e.stacked?null:(0,Ao.jsx)(Un,{isSubmitting:E,onClick:A,disabled:x,children:"Submit"})]})}),e.stacked?(0,Ao.jsx)(F,{loadingText:null,loading:E,disabled:x,onClick:A,children:"Submit"}):null]})}),cb=nd.default.div`
2309
+ `;var dg=f(require("@heroicons/react/24/outline/EnvelopeIcon"));var lg=f(require("@heroicons/react/24/outline/EnvelopeIcon")),sa=require("react"),nd=f(require("styled-components"));var Ao=require("react/jsx-runtime"),cg=(0,sa.forwardRef)((e,t)=>{let[o,r]=(0,sa.useState)(""),[n,i]=(0,sa.useState)(!1),{authenticated:a,user:l}=z(),{initUpdateEmail:s}=W(),{navigate:c,setModalData:m,currentScreen:h}=_(),{enabled:g,token:v}=_e(),b=_a(o),T=n,x=n||!b,E=async I=>{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,o,I),c("AWAITING_PASSWORDLESS_CODE")}catch(M){m({errorModalData:{error:M,previousScreen:h||"LANDING"}})}i(!1)},k=()=>{g&&!v&&!a?(m({captchaModalData:{callback:I=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,o,I)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):E(v)};return(0,Ao.jsxs)(Ao.Fragment,{children:[(0,Ao.jsx)(cb,{children:(0,Ao.jsxs)(db,{children:[(0,Ao.jsx)(lg.default,{}),(0,Ao.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:I=>r(I.target.value),onKeyUp:I=>{I.key==="Enter"&&k()},value:o,autoComplete:"email"}),e.stacked?null:(0,Ao.jsx)(Un,{isSubmitting:T,onClick:k,disabled:x,children:"Submit"})]})}),e.stacked?(0,Ao.jsx)(F,{loadingText:null,loading:T,disabled:x,onClick:k,children:"Submit"}):null]})}),cb=nd.default.div`
2310
2310
  width: 100%;
2311
2311
  `,db=nd.default.label`
2312
2312
  display: block;
@@ -2366,7 +2366,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2366
2366
  && > input::placeholder {
2367
2367
  color: var(--privy-color-foreground-3);
2368
2368
  }
2369
- `;var zt=require("react/jsx-runtime"),pg=()=>(0,zt.jsxs)(zt.Fragment,{children:[(0,zt.jsx)(_,{},"header"),(0,zt.jsx)(X,{}),(0,zt.jsx)(Le,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:(0,zt.jsx)(dg.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,zt.jsx)(to,{children:(0,zt.jsx)(cg,{stacked:!0})}),(0,zt.jsx)(ee,{}),(0,zt.jsx)($,{protectedByPrivy:!0})]});var Cl=f(require("styled-components"));var pb=`
2369
+ `;var zt=require("react/jsx-runtime"),pg=()=>(0,zt.jsxs)(zt.Fragment,{children:[(0,zt.jsx)(A,{},"header"),(0,zt.jsx)(X,{}),(0,zt.jsx)(Le,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:(0,zt.jsx)(dg.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,zt.jsx)(to,{children:(0,zt.jsx)(cg,{stacked:!0})}),(0,zt.jsx)(ee,{}),(0,zt.jsx)($,{protectedByPrivy:!0})]});var Cl=f(require("styled-components"));var pb=`
2370
2370
  *,
2371
2371
  ::before,
2372
2372
  ::after {
@@ -2690,4 +2690,4 @@ You will need this password to access your ${e} wallet on a new device. Please k
2690
2690
  opacity: 1;
2691
2691
  }
2692
2692
  }
2693
- `;var Fe=require("react/jsx-runtime"),ub={["LANDING"]:Uh,["CONNECT_OR_CREATE"]:Dh,["AWAITING_PASSWORDLESS_CODE"]:zu,["AWAITING_CONNECTION"]:fm,["AWAITING_CONNECT_ONLY_CONNECTION"]:gm,["AWAITING_FARCASTER_CONNECTION"]:zf,["PHANTOM_INTERSTITIAL_SCREEN"]:Jy,["LOGIN_FAILED_SCREEN"]:$h,["AWAITING_OAUTH_SCREEN"]:qy,["ALLOWLIST_REJECTION_SCREEN"]:Wu,["INSTALL_PHANTOM_SCREEN"]:uh,["LINK_EMAIL_SCREEN"]:Bh,["LINK_PHONE_SCREEN"]:Gh,["LINK_WALLET_SCREEN"]:Vh,["UPDATE_EMAIL_SCREEN"]:pg,["CONNECT_ONLY_LANDING_SCREEN"]:pm,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:im,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:vf,["EMBEDDED_WALLET_CREATED_SCREEN"]:_m,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:Pm,["EMBEDDED_WALLET_RECOVERY_SCREEN"]:xf,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Mm,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:ag,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:rg,["FIAT_ON_RAMP_PROMPT_SCREEN"]:Xf,["FIAT_ON_RAMP_STATUS_SCREEN"]:nh,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:Tf,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:wf,["MFA_ENROLLMENT_FLOW_SCREEN"]:ly,["CAPTCHA_SCREEN"]:Zu,["ERROR_SCREEN"]:Af,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:sh,["AFFIRMATIVE_CONSENT_SCREEN"]:Iu},mb=["LANDING","AWAITING_CONNECTION"],fb=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:o,isModalOpen:r}=z(),{headless:n}=W(),{ready:i,currentScreen:a}=S(),{status:l,execute:s,reset:c,enabled:m}=_e(),h=(0,gr.useRef)(null),g=gu(h),v=r&&a&&mb.includes(a)&&!n&&l==="ready";if((0,gr.useEffect)(()=>{v&&s()},[v]),(0,gr.useEffect)(()=>{!r&&m&&c()},[r,m]),(!o||!i)&&a!=="AWAITING_OAUTH_SCREEN")return(0,Fe.jsxs)(di,{children:[(0,Fe.jsx)(_,{}),(0,Fe.jsx)(X,{}),(0,Fe.jsx)(jh,{children:(0,Fe.jsx)(Zt,{})}),(0,Fe.jsx)(ee,{}),(0,Fe.jsx)(oe,{})]});if(!a&&e)return(0,Fe.jsx)(di,{style:{height:g},children:(0,Fe.jsx)("div",{ref:h,children:(0,Fe.jsx)(td,{open:e,onClose:t})})});if(!a)return null;let b=ub[a];return(0,Fe.jsx)(di,{style:{height:g},children:(0,Fe.jsxs)("div",{ref:h,children:[(0,Fe.jsx)(ar,{if:!!e,children:(0,Fe.jsx)(b,{})}),(0,Fe.jsx)(ar,{if:!e,children:(0,Fe.jsx)(td,{open:e,onClose:t})})]})})},hb=()=>{let{closePrivyModal:e}=W(),{onUserCloseViaDialogOrKeybindRef:t}=S();return{gracefulClosePrivyModal:(0,gr.useCallback)(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},yg=({open:e})=>{let{app:t}=S(),{gracefulClosePrivyModal:o}=hb(),[r,n]=(0,gr.useState)(!1);ds({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=(0,Fe.jsx)(fg,{children:(0,Fe.jsx)(fb,{isMfaVerifying:r,onMfaVerificationComplete:()=>n(!1)})}),a=e||r,l=t?.render.inDialog?(0,Fe.jsx)(qh,{open:a,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>o(),children:i}):i;if(typeof window<"u"&&t?.render.inParentNodeId){let s=document.getElementById(t.render.inParentNodeId);if(s)return hg.default.createPortal(l,s)}return l};var El=require("react");var bl=class{constructor(){this.callbacks={}}enqueue(t,o){this.callbacks[t]=o}dequeue(t,o){let r=this.callbacks[o];if(!r)throw new Error(`cannot dequeue ${t} event: no event found for id ${o}`);switch(delete this.callbacks[o],t){case"privy:iframe:ready":return r;case"privy:wallet:create":return r;case"privy:wallet:connect":return r;case"privy:wallet:recover":return r;case"privy:wallet:rpc":return r;case"privy:wallet:set-recovery-password":return r;case"privy:mfa:verify":return r;case"privy:mfa:init-enrollment":return r;case"privy:mfa:submit-enrollment":return r;case"privy:mfa:unenroll":return r;default:throw new Error(`invalid wallet event type ${t}`)}}};async function mn(e,t,o,r,n,i=!1){let a=i,l=async m=>{if(a&&t&&t.length>0){m===(i?0:1)?n("configureMfa","onMfaRequired",t):r.current?.reject(new Ve("missing_or_invalid_mfa","MFA verification failed, retry."));let h=await new Promise((g,v)=>{o.current={resolve:g,reject:v};let b=1e3*60*5;setTimeout(()=>{let E=new Ve("mfa_timeout","Timed out waiting for MFA code");r.current?.reject(E),v(E)},b)});return await e(h)}return await e()},s=4,c=null;for(let m=0;m<s;m++)try{c=await l(m),r.current?.resolve(void 0);break}catch(h){if(h.type==="missing_or_invalid_mfa")a=!0;else throw r.current?.resolve(void 0),h}if(c===null){let m=new Ve("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw r.current?.reject(m),m}return c}var vg=require("react/jsx-runtime"),yb=function(e){return()=>`id-${e++}`}(0);function gb(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function Jo(e){return e.error!==void 0}var ko=new bl,id=new Map,vb=(e,t)=>typeof t=="bigint"?t.toString():t,wb=(e,t)=>`${e}${JSON.stringify(t,vb)}`;function Qo(e,t,o){let r=o.contentWindow;if(!r)throw new Error("iframe not initialized");let n=wb(e,t);if(e==="privy:wallet:create"){let a=id.get(n);if(a)return a}let i=new Promise((a,l)=>{let s=yb();ko.enqueue(s,{resolve:a,reject:l}),r.postMessage({id:s,event:e,data:t},"*")}).finally(()=>{id.delete(n)});return id.set(n,i),i}function Cb(e){switch(e.event){case"privy:iframe:ready":let t=ko.dequeue(e.event,e.id);return Jo(e)?t.reject(new Ve(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let o=ko.dequeue(e.event,e.id);return Jo(e)?o.reject(new Ve(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let r=ko.dequeue(e.event,e.id);return Jo(e)?r.reject(new Ve(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:recover":let n=ko.dequeue(e.event,e.id);return Jo(e)?n.reject(new Ve(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let i=ko.dequeue(e.event,e.id);return Jo(e)?i.reject(new Ve(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:set-recovery-password":let a=ko.dequeue(e.event,e.id);return Jo(e)?a.reject(new Ve(e.error.type,e.error.message)):a.resolve(e.data);case"privy:mfa:verify":let l=ko.dequeue(e.event,e.id);return Jo(e)?l.reject(new Ve(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let s=ko.dequeue(e.event,e.id);return Jo(e)?s.reject(new Ve(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:submit-enrollment":{let s=ko.dequeue(e.event,e.id);return Jo(e)?s.reject(new Ve(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:unenroll":{let s=ko.dequeue(e.event,e.id);return Jo(e)?s.reject(new Ve(e.error.type,e.error.message)):s.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function gg(e){let t=(0,El.useRef)(null),o=Cu();return(0,El.useEffect)(()=>{let r=t.current;if(!r)return;function n(c){c&&c.origin===e.origin&&gb(c.data)&&Cb(c.data)}let i={create(c){return Qo("privy:wallet:create",c,r)},connect(c){return Qo("privy:wallet:connect",c,r)},recover(c){return mn(m=>Qo("privy:wallet:recover",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)},rpc(c){return mn(m=>Qo("privy:wallet:rpc",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},setRecoveryPassword(c){return mn(m=>Qo("privy:wallet:set-recovery-password",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(c){return mn(m=>Qo("privy:mfa:verify",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(c){return mn(m=>Qo("privy:mfa:init-enrollment",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(c){return Qo("privy:mfa:submit-enrollment",c,r)},unenrollMfa(c){return mn(m=>Qo("privy:mfa:unenroll",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)}};window.addEventListener("message",n);let a=()=>e.onLoad(i),l=(...c)=>{console.warn("Privy iframe failed to load: ",...c),e.onLoadFailed()},s=new AbortController;return up(()=>Qo("privy:iframe:ready",{},r),{abortSignal:s.signal}).then(a,l),()=>{window.removeEventListener("message",n),s.abort()}},[t.current,e.mfaMethods]),(0,vg.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},src:Aa(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId})})}function ad(e){let t=e.toLowerCase();return["fbav","fban","instagram","snapchat"].some(r=>t.includes(r))}var Tl=class{constructor(t,o){this.meta={action:t,phoneNumber:o}}async init(){if(!this.meta.action)throw new w("action required");if(!this.api)throw new w("Auth flow has no API instance");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new w("phone number must be set when initialzing authentication.");try{let t=Vd();await this.api.post(t,{action:this.meta.action,phoneNumber:this.meta.phoneNumber})}catch(t){throw ue(t)}}async authenticate(){if(!this.meta.action)throw new w("action required");if(!this.api)throw new w("Mfa flow has no API instance");if(!this.meta.smsCode)throw new w("sms code must be set prior to calling authenticate.");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new w("phone number must be set prior to calling authenticate.");try{let t=zd(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return Lt(o)}catch(t){throw ue(t)}}};var Mt=require("react/jsx-runtime"),bi;function bb(e){return typeof e=="string"&&e.length===25}function Ke(){if(!bi){let e=ce.get(zr);return Promise.resolve(e||null)}return bi.getAccessToken()}var Cg,vp=(e,t)=>Cg(e,t),bg,wp=(e,t)=>bg(e,t),Eg,Cp=(e,t)=>Eg(e,t),Tg,bp=()=>Tg(),Eb=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;ce.put(Si,t);let o=new URL(window.location.href);o.searchParams.delete("privy_token"),window.history.pushState({},"",o)},Pg=({config:e,...t})=>{if(!bb(t.appId))throw new w("Cannot initialize the Privy provider with an invalid Privy app ID");bi||(bi=new On({appId:t.appId,apiUrl:t.apiUrl||Ca}));let o=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&o.embeddedWallets?.createOnLogin===void 0&&(o.embeddedWallets||(o.embeddedWallets={}),o.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."),(0,Mt.jsx)($p,{client:bi,clientConfig:o,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,Mt.jsx)(Tb,{...t,config:o,client:bi})})},Tb=e=>{let t=e.client,[o,r]=(0,J.useState)(!1),[n,i]=(0,J.useState)(!1),[a,l]=(0,J.useState)(!1),[s,c]=(0,J.useState)(null),[m,h]=(0,J.useState)(!1),[g,v]=(0,J.useState)([]),b=(0,J.useRef)(g),[E,x]=(0,J.useState)(!1),[T,A]=(0,J.useState)(null),[R,I]=(0,J.useState)(!1),[k,D]=(0,J.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:P}),[U,B]=(0,J.useState)(null),[G,j]=(0,J.useState)(null),[O,K]=(0,J.useState)(null),M=Xa(),pe=qp(),[he,Q]=(0,J.useState)(!0),[ct,Me]=(0,J.useState)({}),[Tt,qe]=(0,J.useState)(null),[le,Zo]=(0,J.useState)(null),[lo,fn]=(0,J.useState)(!1),[Pt,je]=(0,J.useState)(!1),Ro=(0,J.useRef)(null),hn=(0,J.useRef)(null),N=(0,J.useRef)(vu);t.onStoreToken=d=>{d&&H(N,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{H(N,"accessToken","onAccessTokenRemoved")};let dt=(0,J.useRef)(),Ti=(0,J.useCallback)(d=>{let p=t.connectors?.walletsReady||!1;return a&&s?.linkedAccounts?.some(C=>C.type==="wallet"&&C.walletClientType==="privy")?p&&d?.some(C=>C?.walletClientType==="privy"):p},[a,s?.linkedAccounts,t?.connectors?.walletsReady]),re=d=>{A(d),setTimeout(()=>{r(!0)},15),t.createAnalyticsEvent("modal_open",{initialScreen:d})},$t=d=>{M.embeddedWallets.createOnLogin!=="off"&&Q(!0),re(d)};(0,J.useEffect)(()=>{if(!O||!s){t.connectors?.removeEmbeddedWalletConnector();return}let d=s?.linkedAccounts.filter(p=>p.type==="wallet"&&p.walletClientType==="privy");if(d&&d.length>0){let p=d[0].address;t.connectors?.addEmbeddedWalletConnector(O,p,M.defaultChain)}},[O,s]),(0,J.useEffect)(()=>{O&&le?.(O)},[O]),(0,J.useEffect)(()=>{(async()=>{if(!M.customAuth?.enabled)return;Q(!0);let{getCustomAccessToken:p,isLoading:y}=M.customAuth;if(!(!n||y))try{let C=await p();if(!C){await gn.logout();return}if(a)return;t.startAuthFlow(new wn(C));let{user:L,isNewUser:Y}=await t.authenticate();L||await gn.logout(),c(L||null),x(Y||!1),l(!0),je(!0)}catch(C){console.warn(C),a&&await gn.logout()}})()},[M.customAuth?.enabled,M.customAuth?.getCustomAccessToken,M.customAuth?.isLoading,n,a]),(0,J.useEffect)(()=>{Pt&&O&&s&&Kt(s,e.config?.embeddedWallets?.createOnLogin)&&(je(!1),da(s,En).catch(console.error))},[Pt&&O&&s]),(0,J.useEffect)(()=>{async function d(){let p=Vr();Eb();let y=(0,wg.createStore)();B(y),t.initializeConnectorManager(M.walletConnectCloudProjectId,M.rpcConfig,M.chains,M.defaultChain,y,M.appearance.walletList,M.shouldEnforceDefaultChainOnConnect),t.connectors?.initialize().then(()=>{yn()});let C=await t.getAuthenticatedUser();e.config?.customAuth?.enabled||(l(!!C),C&&H(N,"login","onComplete",C,!1,!0,null),c(C)),p||Re.setReadyToTrue(),p&&C&&h(!0)}!n&&pe&&d()},[t,Tt,n,pe]);let Vr=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_oauth_code"),y=d.get("privy_oauth_state"),C=d.get("privy_oauth_provider");return p&&y&&C?(t.startAuthFlow(new br(C,p,y)),$t("AWAITING_OAUTH_SCREEN"),!0):!1},ca=async(d,p,y,C)=>{let L=await t.connectors?.createWalletConnector(d,p)||null;Pi(L,p,y,C)};async function Pi(d,p,y,C){if(!d)return D({status:"disconnected",connectedWallet:null,connectError:new Z("Unable to connect to wallet."),connector:null,connectRetry:P}),C?.(null,y);d instanceof Oo&&p&&await d.resetConnection(p),D({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Pi(d,p,y,C)});try{let L=await d.connect({showPrompt:!0});if(M.shouldEnforceDefaultChainOnConnect&&!M.chains.find(Y=>Y.id===Number(L?.chainId))&&!(L?.connectorType==="wallet_connect_v2"&&L?.walletClientType==="metamask")){D(Y=>({...Y,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:P}));try{await L?.switchChain(M.defaultChain.id),L&&(L.chainId=Tn(Kr(M.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${M.defaultChain.id}`)}}return D(Y=>({...Y,status:"connected",connectedWallet:L,connectError:null,connectRetry:P})),L&&!R&&H(N,"connectWallet","onSuccess",L),C?.(L,y)}catch(L){return L instanceof rt?(console.warn(L.cause?L.cause:L.message),R||H(N,"connectWallet","onError",L.privyErrorCode||"generic_connect_wallet_error")):(console.warn(L),R||H(N,"connectWallet","onError","unknown_connect_wallet_error")),D(Y=>({...Y,status:"disconnected",connectedWallet:null,connectError:L})),C?.(null,y)}}let vr=async(d,p)=>{if(d===null)return;let y=new qr(d,p);t.startAuthFlow(y)},yn=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),y=d.get("privy_wallet_client");if(!p||!y)return;if(y==="phantom"&&!Er()&&$t("LOGIN_FAILED_SCREEN"),!t.connectors)throw new w("Connector not initialized");re("AWAITING_CONNECTION");let C=new URL(window.location.href);C.searchParams.delete("privy_connector"),C.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",C),ca(p,y,void 0,vr)};(0,J.useEffect)(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let pt=()=>{if(!a)throw new w("User must be authenticated before linking a wallet.");h(!0),re("LINK_WALLET_SCREEN")},Wt=d=>{if(!a||!s)return!1;if(d.walletClientType==="privy")return!0;for(let p of s.linkedAccounts)if(p.type==="wallet"&&p.address===d.address&&p.walletClientType!=="privy")return!0;return!1},qt=async d=>{if(!t.connectors)throw new w("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(D(y=>({...y,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:P})),M.captchaEnabled&&!a){let y={callback:C=>vr(d,C),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};Me({captchaModalData:y}),$t("CAPTCHA_SCREEN")}else await vr(d),$t("AWAITING_CONNECTION")},Pl=async(d,p)=>{if(!M.fiatOnRamp.enabled)throw new w("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:y,externalTransactionId:C}=await Qf(t,d,p?.config??{},M.appearance.palette,M.fiatOnRamp.useSandbox);return{signedUrl:y,externalTransactionId:C}}else throw new w("Unsupported fund provider. Currently supported option is `moonpay`.")},wr=()=>{v(d=>{let p=t.connectors?.wallets.map(y=>({...y,linked:Wt(y),loginOrLink:async()=>{if(!await y.isConnected())throw new w("Wallet is not connected");if(y.connectorType==="embedded"&&y.walletClientType==="privy")throw new w("Cannot link or login with embedded wallet");qt(y)},fund:async C=>{let{signedUrl:L,externalTransactionId:Y}=await Pl(y.address,C);Me({fiatOnRampPrompt:{signedUrl:L},fiatOnRampStatus:{externalTransactionId:Y}}),re("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!a)throw new w("User is not authenticated.");if(y.connectorType==="embedded"&&y.walletClientType==="privy")throw new w("Cannot unlink an embedded wallet");let C=await t.unlinkWallet(y.address);c(C)}}))||[];return fn(Ti(p)),Ia(d,p)?d:p})};(0,J.useEffect)(()=>{wr()},[s?.linkedAccounts,a,n]),(0,J.useEffect)(()=>{if(n){if(!t.connectors)throw new w("Connector not initialized");wr(),t.connectors.on("walletsUpdated",wr)}},[n]);let co=()=>{re(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,J.useEffect)(()=>{if(!g[0])return;let d=g[0],p=b.current.find(C=>C.address===d.address),y;if(d.walletClientType==="privy"?y=s?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===d.address&&C.walletClientType==="privy"):y=s?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===d.address&&C.walletClientType!=="privy"),!p&&y){let C=Object.assign({},s);C.wallet=y&&{address:y.address,chainType:y.chainType,chainId:y.chainId,walletClient:y.walletClient,walletClientType:y.walletClientType,connectorType:y.connectorType},c(C)}b.current=g},[g]);let da=async(d,p)=>{if(Ae(d))throw H(N,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[C,L]=await Promise.all([Re.initializeWalletProxy(p),Ke()]);if(!C&&e.config?.customAuth?.enabled)throw H(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!C||!L||e.config?.embeddedWallets?.requireUserPasswordOnCreate)return new Promise((Y,Pe)=>{Q(!0),Me({createWallet:{onSuccess:xt=>{H(N,"createWallet","onSuccess",xt),Y(xt)},onFailure:xt=>{H(N,"createWallet","onError","unknown_embedded_wallet_error"),Pe(xt)},callAuthOnSuccessOnClose:!1}}),re("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await C.create({accessToken:L});let Y=await Re.refreshUser(),Pe=Ae(Y);if(!Pe)throw H(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return H(N,"createWallet","onSuccess",Pe),Pe}},Kg=d=>{if(!M.chains.map(p=>p.id).includes(d))throw new Z(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},cd=(d,p,y)=>new Promise(async(C,L)=>{if(!a||!s){H(N,"sendTransaction","onError","must_be_authenticated"),L(new Error("User must be authenticated before signing with a Privy wallet"));return}let Y=Ae(s);if(!Y){H(N,"sendTransaction","onError","embedded_wallet_not_found"),L(new Error("Must have a Privy wallet before signing"));return}Q(!0);let Pe=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,ut=d.chainId?Number(d.chainId):Pe.chainId;Kg(ut);let xt=Object.assign({},d,{chainId:ut}),Xo=async()=>{let mt=await Ke();if(!mt||!O){H(N,"sendTransaction","onError","embedded_wallet_not_found"),L(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await Re.recoverEmbeddedWallet()){H(N,"sendTransaction","onError","unknown_connect_wallet_error"),L(new Error("Unable to connect to wallet"));return}let er=new Ei.StaticJsonRpcProvider(mo(xt.chainId,M.chains,M.rpcConfig)),Jg=await yi(Y.address,xt,er),ud=await ml(mt,Y.address,O,Jg,er);H(N,"sendTransaction","onSuccess",ud),C(ud)}catch(po){H(N,"sendTransaction","onError","transaction_failure"),L(po)}};if(M.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),Xo();else{let mt={transactionRequest:xt,onSuccess:er=>{H(N,"sendTransaction","onSuccess",er),C(er)},onFailure:er=>{H(N,"sendTransaction","onError","transaction_failure"),L(er)},uiOptions:p||{},fundWalletConfig:y},po={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:er=>{H(N,"sendTransaction","onError","unknown_connect_wallet_error"),L(er)}};Me({connectWallet:po,sendTransaction:mt}),re("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function dd(){return new Promise(async(d,p)=>{let y=await Ke();if(!y||!O)throw new Error("Must have valid access token to enroll in MFA");try{await O.verifyMfa({accessToken:y}),d()}catch(C){p(C)}})}let gn={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:co,linkWallet:pt,linkEmail:()=>{if(!a)throw new w("User must be authenticated before linking an email address.");if(s?.email)throw new w("User already has an email linked to their account.");h(!0),re("LINK_EMAIL_SCREEN")},linkPhone:()=>{if(!a)throw new w("User must be authenticated before linking a phone number.");if(s?.phone)throw new w("User already has a phone number linked to their account.");h(!0),re("LINK_PHONE_SCREEN")},linkGoogle:async()=>{if(!a)throw new w("User must be authenticated before linking a Google account.");if(s?.google)throw new w("User already has a Google account linked to their account.");await Re.initLoginWithOAuth("google")},linkTwitter:async()=>{if(!a)throw new w("User must be authenticated before linking a Twitter account.");if(s?.twitter)throw new w("User already has a Twitter account linked to their account.");await Re.initLoginWithOAuth("twitter")},linkDiscord:async()=>{if(!a)throw new w("User must be authenticated before linking a Discord account.");if(s?.discord)throw new w("User already has a Discord account linked to their account.");await Re.initLoginWithOAuth("discord")},linkGithub:async()=>{if(!a)throw new w("User must be authenticated before linking a GitHub account.");if(s?.github)throw new w("User already has a Github account linked to their account.");await Re.initLoginWithOAuth("github")},linkSpotify:async()=>{if(!a)throw new w("User must be authenticated before linking a Spotify account.");if(s?.spotify)throw new w("User already has a Spotify account linked to their account.");await Re.initLoginWithOAuth("spotify")},linkTiktok:async()=>{if(!a)throw new w("User must be authenticated before linking a TikTok account.");if(s?.tiktok)throw new w("User already has a Tiktok account linked to their account.");await Re.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{if(!a)throw new w("User must be authenticated before linking a LinkedIn account.");if(s?.linkedin)throw new w("User already has a LinkedIn account linked to their account.");await Re.initLoginWithOAuth("linkedin")},linkApple:async()=>{if(!a)throw new w("User must be authenticated before linking an Apple account.");await Re.initLoginWithOAuth("apple")},linkFarcaster:async()=>{if(!a)throw new w("User must be authenticated before linking a Farcaster account.");await Re.initLoginWithFarcaster(),h(!0),re("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(!a)throw new w("User must be authenticated before updating an email address.");if(!s?.email)throw new w("User does not have an email linked to their account.");h(!0),re("UPDATE_EMAIL_SCREEN")},login:async()=>{if(n||(await new Promise(d=>{qe(()=>d)}),qe(null)),a){console.warn("Attempted to log in, but user is already logged in. Use a `link` helper instead.");return}I(!0),$t("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{qe(()=>d)}),qe(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(g[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}$t("CONNECT_OR_CREATE")},logout:async()=>{await t.logout(),c(null),l(!1),A(null),H(N,"logout","onSuccess"),h(!1),r(!1),ce.del(_i)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new Se;let d=g.find(y=>s.wallet&&y.address===s.wallet.address),p=t.connectors?.walletConnectors.find(y=>y.wallets.find(C=>C.address===d?.address));return!d||!p?new Se:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new Ei.Web3Provider(new ho(new Se));let d=g.find(y=>s.wallet&&y.address===s.wallet.address),p=t.connectors?.walletConnectors.find(y=>y.wallets.find(C=>C.address===d?.address));return!d||!p?new Ei.Web3Provider(new ho(new Se)):new Ei.Web3Provider(new ho(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new xr(new Se);let d=g.find(y=>s.wallet&&y.address===s.wallet.address),p=t.connectors?.walletConnectors.find(y=>y.wallets.find(C=>C.address===d?.address));return!d||!p?new xr(new Se):new xr(p.proxyProvider)},unlinkWallet:async d=>{let p=await t.unlinkWallet(d);return c(p),p},unlinkEmail:async d=>{let p=await t.unlinkEmail(d);return c(p),p},unlinkPhone:async d=>{let p=await t.unlinkPhone(d);return c(p),p},unlinkGoogle:async d=>{let p=await t.unlinkOAuth("google",d);return c(p),p},unlinkTwitter:async d=>{let p=await t.unlinkOAuth("twitter",d);return c(p),p},unlinkDiscord:async d=>{let p=await t.unlinkOAuth("discord",d);return c(p),p},unlinkGithub:async d=>{let p=await t.unlinkOAuth("github",d);return c(p),p},unlinkSpotify:async d=>{let p=await t.unlinkOAuth("spotify",d);return c(p),p},unlinkTiktok:async d=>{let p=await t.unlinkOAuth("tiktok",d);return c(p),p},unlinkLinkedIn:async d=>{let p=await t.unlinkOAuth("linkedin",d);return c(p),p},unlinkApple:async d=>{let p=await t.unlinkOAuth("apple",d);return c(p),p},unlinkFarcaster:async d=>{let p=await t.unlinkFarcaster(d);return c(p),p},setActiveWallet:async d=>{let p=g.find(C=>(0,la.getAddress)(C.address)===(0,la.getAddress)(d)),y=s?.linkedAccounts.find(C=>C.type==="wallet"&&(0,la.getAddress)(C.address)===(0,la.getAddress)(d));if(!p||!await p.isConnected())j(d),pt();else if(!p.linked)p.loginOrLink();else{let C=Object.assign({},s);C.wallet=y&&{address:y.address,chainType:y.chainType,chainId:y.chainId,walletClient:y.walletClient,walletClientType:y.walletClientType,connectorType:y.connectorType},c(C)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw H(N,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return da(s,15e3)},setWalletPassword:async()=>{if(!a||!s)throw H(N,"setWalletPassword","onError","must_be_authenticated"),new Error("User must be authenticated before adding password to Privy wallet");let d=Ae(s);if(!d||!O)throw H(N,"setWalletPassword","onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a password");if(d.recoveryMethod==="user-passcode")throw H(N,"setWalletPassword","onError","embedded_wallet_password_already_exists"),new Error("Cannot set password. Embedded wallet already has a password.");try{await dd()}catch(p){throw H(N,"setWalletPassword","onError","missing_mfa_credentials"),p}return new Promise((p,y)=>{Q(!0);let C={onSuccess:Y=>{H(N,"setWalletPassword","onSuccess",Y),p(Y)},onFailure:Y=>{H(N,"setWalletPassword","onError","user_exited_set_password_flow"),y(Y)},callAuthOnSuccessOnClose:!1},L={onCompleteNavigateTo:"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",onFailure:Y=>{H(N,"setWalletPassword","onError","unknown_connect_wallet_error"),y(Y)}};Me({setWalletPassword:C,connectWallet:L}),re("EMBEDDED_WALLET_CONNECTING_SCREEN")})},signMessage:(d,p)=>new Promise(async(y,C)=>{if(!a||!s){H(N,"signMessage","onError","must_be_authenticated"),C(new Error("User must be authenticated before signing with a Privy wallet"));return}let L=Ae(s);if(!L){H(N,"signMessage","onError","embedded_wallet_not_found"),C(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){H(N,"signMessage","onError","invalid_message"),C(new Error("Message must be a non-empty string"));return}Q(!0);let Y=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Pe=await Ke();if(!O||!Pe)throw new Error("Unable to connect to wallet");if(!await Re.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_message_started",{walletAddress:L.address});let{response:xt}=await O.rpc({accessToken:Pe,address:L.address,request:{method:"personal_sign",params:[d,L.address]}}),Xo=xt.data;return t.createAnalyticsEvent("embedded_wallet_sign_message_completed",{walletAddress:L.address}),Xo};if(M.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Pe=await Y();H(N,"signMessage","onSuccess",Pe),y(Pe)}catch(Pe){H(N,"signMessage","onError","unable_to_sign"),C(Pe??new nt("Unable to sign message"))}}else{let xt={method:"personal_sign",data:d,confirmAndSign:Y,onSuccess:mt=>{H(N,"signMessage","onSuccess",mt),y(mt)},onFailure:mt=>{H(N,"signMessage","onError","unable_to_sign"),C(mt)},uiOptions:p||{}},Xo={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:mt=>{H(N,"signMessage","onError","unknown_connect_wallet_error"),C(mt)}};Me({signMessage:xt,connectWallet:Xo}),re("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(y,C)=>{if(!a||!s){H(N,"signTypedData","onError","must_be_authenticated"),C(new Error("User must be authenticated before signing with a Privy wallet"));return}let L=Ae(s);if(!L){H(N,"signTypedData","onError","embedded_wallet_not_found"),C(new Error("Must have a Privy wallet before signing"));return}Q(!0);let Y=ka(d),Pe=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let ut=await Ke();if(!O||!ut)throw new Error("Unable to connect to wallet");if(!await Re.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_typed_data_started",{walletAddress:L.address});let{response:Xo}=await O.rpc({accessToken:ut,address:L.address,request:{method:"eth_signTypedData_v4",params:[L.address,Y]}}),mt=Xo.data;return t.createAnalyticsEvent("embedded_wallet_sign_typed_data_completed",{walletAddress:L.address}),mt};if(M.embeddedWallets.noPromptOnSignature||(M.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ut=await Pe();H(N,"signTypedData","onSuccess",ut),y(ut)}catch(ut){H(N,"signTypedData","onError","unable_to_sign"),C(ut??new nt("Unable to sign message"))}}else{let Xo={method:"eth_signTypedData_v4",data:Y,confirmAndSign:Pe,onSuccess:po=>{H(N,"signTypedData","onSuccess",po),y(po)},onFailure:po=>{H(N,"signTypedData","onError","unable_to_sign"),C(po)},uiOptions:p||{}},mt={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:po=>{H(N,"signMessage","onError","unknown_connect_wallet_error"),C(po)}};Me({signMessage:Xo,connectWallet:mt}),re("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,y)=>{let L=await(await cd(d,p,y)).wait();return hl(L)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}let y=Ae(s);if(!y){p(new Error("Must have a Privy wallet before exporting"));return}Q(!0);let C={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p},L=await Ke();if(!L||!O){p(new Error("Must have valid access token to enroll in MFA"));return}if(!O){p(new Error("Must have a Privy wallet before exporting"));return}try{try{await O.connect({accessToken:L,address:y.address}),await O.verifyMfa({accessToken:L})}catch(Pe){if(Qr(Pe))await Re.recoverEmbeddedWallet();else throw Pe}}catch(Pe){p(Pe);return}let Y={appId:e.appId,origin:t.apiUrl,onSuccess:d,onFailure:p};Me({keyExport:Y,connectWallet:C}),re("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:dd,async init(d){let p;switch(d){case"sms":p=new Tl("verify");break;case"totp":return;default:throw new Error(`Unsupported MFA method: ${d}`)}t.startMfaFlow(p),await p.init()},async submit(d,p){switch(d){case"totp":case"sms":Ro.current?.resolve({mfaMethod:d,mfaCode:p}),await new Promise((y,C)=>{hn.current={resolve:y,reject:C}});break;default:throw Ro.current?.reject(new w("Unsupported MFA method")),new w(`Unsupported MFA method: ${d}`)}},cancel(){Ro.current?.reject(new w("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Ke();if(!p||!O)throw new Error("Must have valid access token to enroll in MFA");await O.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,y)=>{if(!d){Re.closePrivyModal(),p();return}M.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."),Me({mfaEnrollmentFlow:{mfaMethods:M.mfa.methods,onSuccess:p,onFailure:y}}),re("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Ke();if(!d||!O)throw new Error("Must have valid access token to enroll in MFA");let p=await O.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await Ke();if(!p||!O)throw new Error("Must have valid access token to enroll in MFA");await O.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let y=await t.getAuthenticatedUser();c(y)},async submitEnrollmentWithTotp(d){let p=await Ke();if(!p||!O)throw new Error("Must have valid access token to enroll in MFA");await O.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let y=await t.getAuthenticatedUser();c(y)},async unenroll(d){let p=await Ke();if(!p||!O)throw new Error("Must have valid access token to remove MFA");await O.unenrollMfa({method:d,accessToken:p});let y=await t.getAuthenticatedUser();c(y)},loginWithCode(d){return Re.loginWithCode(d)},initLoginWithEmail(d){return Re.initLoginWithEmail(d)},initLoginWithSms(d){return Re.initLoginWithSms(d)},isModalOpen:o};Cg=gn.signMessage,bg=gn.signTypedData,Eg=async(...d)=>{let p=await cd(...d);return M.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let pd=!!e.config?.headless,Re=(()=>({headless:pd,isNewUserThisSession:E,isLinking:m,linkingHint:G,pendingTransaction:null,walletConnectionStatus:k,mipdStore:U,connectors:t.connectors?.walletConnectors??[],rpcConfig:M.rpcConfig,chains:M.chains,showFiatPrices:M.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>M.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(O)return O;let p=new Promise(L=>{Zo(()=>Y=>L(Y))}),y=new Promise(L=>setTimeout(()=>L(null),d)),C=await Promise.race([p,y]);return Zo(null),C},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0})=>{let p=n&&a&&s;d.shouldCallAuthOnSuccess&&p?(H(N,"login","onComplete",s,E,!1,dt.current??null),e.onSuccess?.(s,E)):R&&H(N,"login","onError","exited_auth_flow"),j(null),I(!1),h(!1),x(!1),r(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent("modal_closed")},openPrivyModal:re,connectWallet:Pi,initLoginWithWallet:async(d,p)=>{dt.current="siwe",vr(d,p)},loginWithWallet:async()=>{if(!n)throw new vn;if(!(t.authFlow instanceof qr))throw new w("Must initialize SIWE flow first.");let d,p;if(a)d=await t.link();else try{({user:d,isNewUser:p}=await t.authenticate())}catch(y){throw H(N,"login","onError",y.privyErrorCode||"generic_connect_wallet_error"),y}c(d||s||null),x(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new xi(d);t.startAuthFlow(p);try{dt.current="farcaster",await p.initializeFarcasterConnect()}catch(y){throw H(N,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}},loginWithFarcaster:async()=>{if(!n)throw new vn;if(!(t.authFlow instanceof xi))throw new w("Must initialize Farcaster flow first.");let d,p;if(a)d=await t.link();else try{({user:d,isNewUser:p}=await t.authenticate())}catch(y){throw H(N,"login","onError",y.privyErrorCode||"generic_connect_wallet_error"),y}c(d||null),x(p||!1),l(!0)},initLoginWithOAuth:async(d,p)=>{if(ap()){if(d==="google"&&ad(window.navigator.userAgent)){$t("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{$t("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}let y=new br(d);p&&y.addCaptchaToken(p),t.startAuthFlow(y);let C=await t.authFlow.getAuthorizationUrl();C&&C.url&&window.location.assign(C.url)},loginWithOAuth:async d=>{if(!(t.authFlow instanceof br))throw new w("Must initialize OAuth flow before calling loginWithOAuth");let p=uo.get(Cn),y=t.authFlow.meta.stateCode;if(p!==y)throw t.createAnalyticsEvent("possible_phishing_attempt",{provider:d,storedStateCode:p??"",returnedStateCode:y??""}),new w("Unexpected auth flow. This may be a phishing attempt.");let C,L;if(a)C=await t.link();else try{({user:C,isNewUser:L}=await t.authenticate()),dt.current=d}catch(Y){throw H(N,"login","onError",Y.privyErrorCode||"unknown_auth_error"),Y}c(C),x(L||!1),l(!0)},initLoginWithEmail:async(d,p)=>{let y=new Cr(d,p);t.startAuthFlow(y);try{dt.current="email",await y.sendCodeEmail()}catch(C){throw H(N,"login","onError",C.privyErrorCode||"unknown_auth_error"),C}},initUpdateEmail:async(d,p,y)=>{let C=new va(d,p,y);t.startAuthFlow(C),await C.sendCodeEmail()},initLoginWithSms:async(d,p)=>{let y=new jr(d,p);t.startAuthFlow(y);try{dt.current="sms",await y.sendSmsCode()}catch(C){throw H(N,"login","onError",C.privyErrorCode||"unknown_auth_error"),C}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(!n)throw new vn;if(t.authFlow instanceof Cr)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof jr)t.authFlow.meta.smsCode=d.trim();else throw new w("Must initialize a passwordless code flow first");let p,y;a?p=await t.link():{user:p,isNewUser:y}=await t.authenticate(),c(p||s||null),x(y||!1),l(!0)},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:O,createAnalyticsEvent:(d,p,y)=>t.createAnalyticsEvent(d,p,y),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedWallet:async()=>new Promise(async(d,p)=>{let y=s?.linkedAccounts.find(L=>L.type==="wallet"&&L.walletClientType==="privy"),C=await Ke();if(!C||!O||!y){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Q(!0);try{await O.connect({accessToken:C,address:y.address}),d(!0)}catch(L){Qr(L)&&y.recoveryMethod==="privy"?(t.createAnalyticsEvent("embedded_wallet_pinless_recovery_started",{walletAddress:y.address}),(await O.recover({address:y.address,accessToken:C})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent("embedded_wallet_recovery_completed",{walletAddress:y.address}),d(!0)):Qr(L)?(Me({recoverWallet:{privyWallet:y,onFailure:p,onSuccess:()=>d(!0)}}),re("EMBEDDED_WALLET_RECOVERY_SCREEN")):p(L)}}),getFiatOnRampConfig:Pl,setReadyToTrue:()=>{i(!0),Tt?.()},updateWallets:()=>wr()}))();Tg=Re.recoverEmbeddedWallet;let Yg=(0,J.useMemo)(()=>({wallets:g,ready:lo}),[g,lo]);return(0,Mt.jsx)(ge.Provider,{value:gn,children:(0,Mt.jsx)(Jl.Provider,{value:N,children:(0,Mt.jsx)(Zc.Provider,{value:Yg,children:(0,Mt.jsxs)(fu,{...M,children:[e.children,(0,Mt.jsxs)(Yl.Provider,{value:Re,children:[!pd&&M.captchaEnabled&&n&&!a&&(0,Mt.jsx)(as,{delayedExecution:!1}),(0,Mt.jsx)(mg,{theme:{...M.appearance.palette||{}}}),(0,Mt.jsx)(Yp,{data:ct,setModalData:Me,setInitialScreen:A,initialScreen:T,authenticated:a,open:o,children:(0,Mt.jsx)(yg,{open:o})}),he&&pe?(0,Mt.jsx)(gg,{appId:e.appId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:Ro,mfaSubmitPromise:hn,onLoad:K,onLoadFailed:()=>null}):null]})]})})})})};var xg=require("react");function Sg(e){let{login:t}=(0,xg.useContext)(ge);return Be("login",e),{login:t}}var _g=require("react");function Ag(e){let{logout:t}=(0,_g.useContext)(ge);return Be("logout",e),{logout:t}}var sd=require("react");var kg=()=>{let e=_e(),{initLoginWithEmail:t,loginWithCode:o}=z(),r=(0,sd.useCallback)(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return e.status==="disabled",t(i)},[t]),n=(0,sd.useCallback)(async({code:i})=>{if(e.enabled&&e.status==="error")throw new nr(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};var ld=require("react");var Rg=()=>{let e=_e(),{initLoginWithSms:t,loginWithCode:o}=z(),r=(0,ld.useCallback)(async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");return e.status==="disabled",t(i)},[t]),n=(0,ld.useCallback)(async({code:i})=>{if(e.enabled&&e.status!=="success")throw new nr(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};var Ig=require("react");function Mg(e){let{connectWallet:t}=(0,Ig.useContext)(ge);return Be("connectWallet",e),{connectWallet:t}}var Wg=require("react");function Ng(e){let{createWallet:t}=(0,Wg.useContext)(ge);return Be("createWallet",e),{createWallet:t}}var Lg=require("react");function Og(e){let{sendTransaction:t}=(0,Lg.useContext)(ge);return Be("sendTransaction",e),{sendTransaction:t}}var Dg=require("react");function Ug(e){let{setWalletPassword:t}=(0,Dg.useContext)(ge);return Be("setWalletPassword",e),{setWalletPassword:t}}var Fg=require("react");function Bg(e){let{signMessage:t}=(0,Fg.useContext)(ge);return Be("signMessage",e),{signMessage:t}}var Hg=require("react");function Gg(e){let{signTypedData:t}=(0,Hg.useContext)(ge);return Be("signTypedData",e),{signTypedData:t}}var Vg=require("react");var zg=()=>{let{isModalOpen:e}=(0,Vg.useContext)(ge);return{isOpen:e}};var $g=require("react");function qg(e){let{getAccessToken:t}=(0,$g.useContext)(ge);return Be("accessToken",e),{getAccessToken:t}}function jg(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}0&&(module.exports={AsExternalProvider,Captcha,ConnectorManager,PrivyClient,PrivyProvider,PrivyProxyProvider,SUPPORTED_CHAINS,VERSION,WalletConnector,addRpcUrlOverrideToChain,errorIndicatesMaxMfaRetries,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,getAccessToken,useConnectWallet,useCreateWallet,useLogin,useLoginWithEmail,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSignMessage,useSignTypedData,useToken,useWallets});
2693
+ `;var Fe=require("react/jsx-runtime"),ub={["LANDING"]:Uh,["CONNECT_OR_CREATE"]:Dh,["AWAITING_PASSWORDLESS_CODE"]:zu,["AWAITING_CONNECTION"]:fm,["AWAITING_CONNECT_ONLY_CONNECTION"]:gm,["AWAITING_FARCASTER_CONNECTION"]:zf,["PHANTOM_INTERSTITIAL_SCREEN"]:Jy,["LOGIN_FAILED_SCREEN"]:$h,["AWAITING_OAUTH_SCREEN"]:qy,["ALLOWLIST_REJECTION_SCREEN"]:Wu,["INSTALL_PHANTOM_SCREEN"]:uh,["LINK_EMAIL_SCREEN"]:Bh,["LINK_PHONE_SCREEN"]:Gh,["LINK_WALLET_SCREEN"]:Vh,["UPDATE_EMAIL_SCREEN"]:pg,["CONNECT_ONLY_LANDING_SCREEN"]:pm,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:im,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:vf,["EMBEDDED_WALLET_CREATED_SCREEN"]:_m,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:Pm,["EMBEDDED_WALLET_RECOVERY_SCREEN"]:xf,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Mm,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:ag,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:rg,["FIAT_ON_RAMP_PROMPT_SCREEN"]:Xf,["FIAT_ON_RAMP_STATUS_SCREEN"]:nh,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:Tf,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:wf,["MFA_ENROLLMENT_FLOW_SCREEN"]:ly,["CAPTCHA_SCREEN"]:Zu,["ERROR_SCREEN"]:Af,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:sh,["AFFIRMATIVE_CONSENT_SCREEN"]:Iu},mb=["LANDING","AWAITING_CONNECTION"],fb=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:o,isModalOpen:r}=z(),{headless:n}=W(),{ready:i,currentScreen:a}=_(),{status:l,execute:s,reset:c,enabled:m}=_e(),h=(0,gr.useRef)(null),g=gu(h),v=r&&a&&mb.includes(a)&&!n&&l==="ready";if((0,gr.useEffect)(()=>{v&&s()},[v]),(0,gr.useEffect)(()=>{!r&&m&&c()},[r,m]),(!o||!i)&&a!=="AWAITING_OAUTH_SCREEN")return(0,Fe.jsxs)(di,{children:[(0,Fe.jsx)(A,{}),(0,Fe.jsx)(X,{}),(0,Fe.jsx)(jh,{children:(0,Fe.jsx)(Zt,{})}),(0,Fe.jsx)(ee,{}),(0,Fe.jsx)(oe,{})]});if(!a&&e)return(0,Fe.jsx)(di,{style:{height:g},children:(0,Fe.jsx)("div",{ref:h,children:(0,Fe.jsx)(td,{open:e,onClose:t})})});if(!a)return null;let b=ub[a];return(0,Fe.jsx)(di,{style:{height:g},children:(0,Fe.jsxs)("div",{ref:h,children:[(0,Fe.jsx)(ar,{if:!!e,children:(0,Fe.jsx)(b,{})}),(0,Fe.jsx)(ar,{if:!e,children:(0,Fe.jsx)(td,{open:e,onClose:t})})]})})},hb=()=>{let{closePrivyModal:e}=W(),{onUserCloseViaDialogOrKeybindRef:t}=_();return{gracefulClosePrivyModal:(0,gr.useCallback)(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},yg=({open:e})=>{let{app:t}=_(),{gracefulClosePrivyModal:o}=hb(),[r,n]=(0,gr.useState)(!1);ds({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=(0,Fe.jsx)(fg,{children:(0,Fe.jsx)(fb,{isMfaVerifying:r,onMfaVerificationComplete:()=>n(!1)})}),a=e||r,l=t?.render.inDialog?(0,Fe.jsx)(qh,{open:a,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>o(),children:i}):i;if(typeof window<"u"&&t?.render.inParentNodeId){let s=document.getElementById(t.render.inParentNodeId);if(s)return hg.default.createPortal(l,s)}return l};var El=require("react");var bl=class{constructor(){this.callbacks={}}enqueue(t,o){this.callbacks[t]=o}dequeue(t,o){let r=this.callbacks[o];if(!r)throw new Error(`cannot dequeue ${t} event: no event found for id ${o}`);switch(delete this.callbacks[o],t){case"privy:iframe:ready":return r;case"privy:wallet:create":return r;case"privy:wallet:connect":return r;case"privy:wallet:recover":return r;case"privy:wallet:rpc":return r;case"privy:wallet:set-recovery-password":return r;case"privy:mfa:verify":return r;case"privy:mfa:init-enrollment":return r;case"privy:mfa:submit-enrollment":return r;case"privy:mfa:unenroll":return r;default:throw new Error(`invalid wallet event type ${t}`)}}};async function mn(e,t,o,r,n,i=!1){let a=i,l=async m=>{if(a&&t&&t.length>0){m===(i?0:1)?n("configureMfa","onMfaRequired",t):r.current?.reject(new Ve("missing_or_invalid_mfa","MFA verification failed, retry."));let h=await new Promise((g,v)=>{o.current={resolve:g,reject:v};let b=1e3*60*5;setTimeout(()=>{let T=new Ve("mfa_timeout","Timed out waiting for MFA code");r.current?.reject(T),v(T)},b)});return await e(h)}return await e()},s=4,c=null;for(let m=0;m<s;m++)try{c=await l(m),r.current?.resolve(void 0);break}catch(h){if(h.type==="missing_or_invalid_mfa")a=!0;else throw r.current?.resolve(void 0),h}if(c===null){let m=new Ve("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw r.current?.reject(m),m}return c}var vg=require("react/jsx-runtime"),yb=function(e){return()=>`id-${e++}`}(0);function gb(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function Jo(e){return e.error!==void 0}var ko=new bl,id=new Map,vb=(e,t)=>typeof t=="bigint"?t.toString():t,wb=(e,t)=>`${e}${JSON.stringify(t,vb)}`;function Qo(e,t,o){let r=o.contentWindow;if(!r)throw new Error("iframe not initialized");let n=wb(e,t);if(e==="privy:wallet:create"){let a=id.get(n);if(a)return a}let i=new Promise((a,l)=>{let s=yb();ko.enqueue(s,{resolve:a,reject:l}),r.postMessage({id:s,event:e,data:t},"*")}).finally(()=>{id.delete(n)});return id.set(n,i),i}function Cb(e){switch(e.event){case"privy:iframe:ready":let t=ko.dequeue(e.event,e.id);return Jo(e)?t.reject(new Ve(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let o=ko.dequeue(e.event,e.id);return Jo(e)?o.reject(new Ve(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let r=ko.dequeue(e.event,e.id);return Jo(e)?r.reject(new Ve(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:recover":let n=ko.dequeue(e.event,e.id);return Jo(e)?n.reject(new Ve(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let i=ko.dequeue(e.event,e.id);return Jo(e)?i.reject(new Ve(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:set-recovery-password":let a=ko.dequeue(e.event,e.id);return Jo(e)?a.reject(new Ve(e.error.type,e.error.message)):a.resolve(e.data);case"privy:mfa:verify":let l=ko.dequeue(e.event,e.id);return Jo(e)?l.reject(new Ve(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let s=ko.dequeue(e.event,e.id);return Jo(e)?s.reject(new Ve(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:submit-enrollment":{let s=ko.dequeue(e.event,e.id);return Jo(e)?s.reject(new Ve(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:unenroll":{let s=ko.dequeue(e.event,e.id);return Jo(e)?s.reject(new Ve(e.error.type,e.error.message)):s.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function gg(e){let t=(0,El.useRef)(null),o=Cu();return(0,El.useEffect)(()=>{let r=t.current;if(!r)return;function n(c){c&&c.origin===e.origin&&gb(c.data)&&Cb(c.data)}let i={create(c){return Qo("privy:wallet:create",c,r)},connect(c){return Qo("privy:wallet:connect",c,r)},recover(c){return mn(m=>Qo("privy:wallet:recover",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)},rpc(c){return mn(m=>Qo("privy:wallet:rpc",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},setRecoveryPassword(c){return mn(m=>Qo("privy:wallet:set-recovery-password",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(c){return mn(m=>Qo("privy:mfa:verify",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(c){return mn(m=>Qo("privy:mfa:init-enrollment",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(c){return Qo("privy:mfa:submit-enrollment",c,r)},unenrollMfa(c){return mn(m=>Qo("privy:mfa:unenroll",{...c,...m},r),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)}};window.addEventListener("message",n);let a=()=>e.onLoad(i),l=(...c)=>{console.warn("Privy iframe failed to load: ",...c),e.onLoadFailed()},s=new AbortController;return up(()=>Qo("privy:iframe:ready",{},r),{abortSignal:s.signal}).then(a,l),()=>{window.removeEventListener("message",n),s.abort()}},[t.current,e.mfaMethods]),(0,vg.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},src:Aa(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId})})}function ad(e){let t=e.toLowerCase();return["fbav","fban","instagram","snapchat"].some(r=>t.includes(r))}var Tl=class{constructor(t,o){this.meta={action:t,phoneNumber:o}}async init(){if(!this.meta.action)throw new w("action required");if(!this.api)throw new w("Auth flow has no API instance");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new w("phone number must be set when initialzing authentication.");try{let t=Vd();await this.api.post(t,{action:this.meta.action,phoneNumber:this.meta.phoneNumber})}catch(t){throw me(t)}}async authenticate(){if(!this.meta.action)throw new w("action required");if(!this.api)throw new w("Mfa flow has no API instance");if(!this.meta.smsCode)throw new w("sms code must be set prior to calling authenticate.");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new w("phone number must be set prior to calling authenticate.");try{let t=zd(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return Lt(o)}catch(t){throw me(t)}}};var Mt=require("react/jsx-runtime"),bi;function bb(e){return typeof e=="string"&&e.length===25}function Ke(){if(!bi){let e=de.get(zr);return Promise.resolve(e||null)}return bi.getAccessToken()}var Cg,vp=(e,t)=>Cg(e,t),bg,wp=(e,t)=>bg(e,t),Eg,Cp=(e,t)=>Eg(e,t),Tg,bp=()=>Tg(),Eb=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;de.put(Si,t);let o=new URL(window.location.href);o.searchParams.delete("privy_token"),window.history.pushState({},"",o)},Pg=({config:e,...t})=>{if(!bb(t.appId))throw new w("Cannot initialize the Privy provider with an invalid Privy app ID");bi||(bi=new On({appId:t.appId,apiUrl:t.apiUrl||Ca}));let o=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&o.embeddedWallets?.createOnLogin===void 0&&(o.embeddedWallets||(o.embeddedWallets={}),o.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."),(0,Mt.jsx)($p,{client:bi,clientConfig:o,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,Mt.jsx)(Tb,{...t,config:o,client:bi})})},Tb=e=>{let t=e.client,[o,r]=(0,J.useState)(!1),[n,i]=(0,J.useState)(!1),[a,l]=(0,J.useState)(!1),[s,c]=(0,J.useState)(null),[m,h]=(0,J.useState)(!1),[g,v]=(0,J.useState)([]),b=(0,J.useRef)(g),[T,x]=(0,J.useState)(!1),[E,k]=(0,J.useState)(null),[I,M]=(0,J.useState)(!1),[S,O]=(0,J.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:P}),[D,B]=(0,J.useState)(null),[G,K]=(0,J.useState)(null),[U,j]=(0,J.useState)(null),R=Xa(),le=qp(),[ue,Q]=(0,J.useState)(!0),[ct,Me]=(0,J.useState)({}),[Tt,qe]=(0,J.useState)(null),[ce,Zo]=(0,J.useState)(null),[lo,fn]=(0,J.useState)(!1),[Pt,je]=(0,J.useState)(!1),Ro=(0,J.useRef)(null),hn=(0,J.useRef)(null),N=(0,J.useRef)(vu);t.onStoreToken=d=>{d&&H(N,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{H(N,"accessToken","onAccessTokenRemoved")};let dt=(0,J.useRef)(),Ti=(0,J.useCallback)(d=>{let p=t.connectors?.walletsReady||!1;return a&&s?.linkedAccounts?.some(C=>C.type==="wallet"&&C.walletClientType==="privy")?p&&d?.some(C=>C?.walletClientType==="privy"):p},[a,s?.linkedAccounts,t?.connectors?.walletsReady]),re=d=>{k(d),setTimeout(()=>{r(!0)},15),t.createAnalyticsEvent("modal_open",{initialScreen:d})},$t=d=>{R.embeddedWallets.createOnLogin!=="off"&&Q(!0),re(d)};(0,J.useEffect)(()=>{if(!U||!s){t.connectors?.removeEmbeddedWalletConnector();return}let d=s?.linkedAccounts.filter(p=>p.type==="wallet"&&p.walletClientType==="privy");if(d&&d.length>0){let p=d[0].address;t.connectors?.addEmbeddedWalletConnector(U,p,R.defaultChain)}},[U,s]),(0,J.useEffect)(()=>{U&&ce?.(U)},[U]),(0,J.useEffect)(()=>{(async()=>{if(!R.customAuth?.enabled)return;Q(!0);let{getCustomAccessToken:p,isLoading:y}=R.customAuth;if(!(!n||y))try{let C=await p();if(!C){await gn.logout();return}if(a)return;t.startAuthFlow(new wn(C));let{user:L,isNewUser:Y}=await t.authenticate();L||await gn.logout(),c(L||null),x(Y||!1),l(!0),je(!0)}catch(C){console.warn(C),a&&await gn.logout()}})()},[R.customAuth?.enabled,R.customAuth?.getCustomAccessToken,R.customAuth?.isLoading,n,a]),(0,J.useEffect)(()=>{Pt&&U&&s&&Kt(s,e.config?.embeddedWallets?.createOnLogin)&&(je(!1),da(s,En).catch(console.error))},[Pt&&U&&s]),(0,J.useEffect)(()=>{async function d(){let p=Vr();Eb();let y=(0,wg.createStore)();B(y),t.initializeConnectorManager(R.walletConnectCloudProjectId,R.rpcConfig,R.chains,R.defaultChain,y,R.appearance.walletList,R.shouldEnforceDefaultChainOnConnect),t.connectors?.initialize().then(()=>{yn()});let C=await t.getAuthenticatedUser();e.config?.customAuth?.enabled||(l(!!C),C&&H(N,"login","onComplete",C,!1,!0,null),c(C)),p||Re.setReadyToTrue(),p&&C&&h(!0)}!n&&le&&d()},[t,Tt,n,le]);let Vr=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_oauth_code"),y=d.get("privy_oauth_state"),C=d.get("privy_oauth_provider");return p&&y&&C?(t.startAuthFlow(new br(C,p,y)),$t("AWAITING_OAUTH_SCREEN"),!0):!1},ca=async(d,p,y,C)=>{let L=await t.connectors?.createWalletConnector(d,p)||null;Pi(L,p,y,C)};async function Pi(d,p,y,C){if(!d)return O({status:"disconnected",connectedWallet:null,connectError:new Z("Unable to connect to wallet."),connector:null,connectRetry:P}),C?.(null,y);d instanceof Oo&&p&&await d.resetConnection(p),O({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Pi(d,p,y,C)});try{let L=await d.connect({showPrompt:!0});if(R.shouldEnforceDefaultChainOnConnect&&!R.chains.find(Y=>Y.id===Number(L?.chainId))&&!(L?.connectorType==="wallet_connect_v2"&&L?.walletClientType==="metamask")){O(Y=>({...Y,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:P}));try{await L?.switchChain(R.defaultChain.id),L&&(L.chainId=Tn(Kr(R.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${R.defaultChain.id}`)}}return O(Y=>({...Y,status:"connected",connectedWallet:L,connectError:null,connectRetry:P})),L&&!I&&H(N,"connectWallet","onSuccess",L),C?.(L,y)}catch(L){return L instanceof rt?(console.warn(L.cause?L.cause:L.message),I||H(N,"connectWallet","onError",L.privyErrorCode||"generic_connect_wallet_error")):(console.warn(L),I||H(N,"connectWallet","onError","unknown_connect_wallet_error")),O(Y=>({...Y,status:"disconnected",connectedWallet:null,connectError:L})),C?.(null,y)}}let vr=async(d,p)=>{if(d===null)return;let y=new qr(d,p);t.startAuthFlow(y)},yn=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),y=d.get("privy_wallet_client");if(!p||!y)return;if(y==="phantom"&&!Er()&&$t("LOGIN_FAILED_SCREEN"),!t.connectors)throw new w("Connector not initialized");re("AWAITING_CONNECTION");let C=new URL(window.location.href);C.searchParams.delete("privy_connector"),C.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",C),ca(p,y,void 0,vr)};(0,J.useEffect)(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let pt=()=>{if(!a)throw new w("User must be authenticated before linking a wallet.");h(!0),re("LINK_WALLET_SCREEN")},Wt=d=>{if(!a||!s)return!1;if(d.walletClientType==="privy")return!0;for(let p of s.linkedAccounts)if(p.type==="wallet"&&p.address===d.address&&p.walletClientType!=="privy")return!0;return!1},qt=async d=>{if(!t.connectors)throw new w("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(O(y=>({...y,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:P})),R.captchaEnabled&&!a){let y={callback:C=>vr(d,C),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};Me({captchaModalData:y}),$t("CAPTCHA_SCREEN")}else await vr(d),$t("AWAITING_CONNECTION")},Pl=async(d,p)=>{if(!R.fiatOnRamp.enabled)throw new w("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:y,externalTransactionId:C}=await Qf(t,d,p?.config??{},R.appearance.palette,R.fiatOnRamp.useSandbox);return{signedUrl:y,externalTransactionId:C}}else throw new w("Unsupported fund provider. Currently supported option is `moonpay`.")},wr=()=>{v(d=>{let p=t.connectors?.wallets.map(y=>({...y,linked:Wt(y),loginOrLink:async()=>{if(!await y.isConnected())throw new w("Wallet is not connected");if(y.connectorType==="embedded"&&y.walletClientType==="privy")throw new w("Cannot link or login with embedded wallet");qt(y)},fund:async C=>{let{signedUrl:L,externalTransactionId:Y}=await Pl(y.address,C);Me({fiatOnRampPrompt:{signedUrl:L},fiatOnRampStatus:{externalTransactionId:Y}}),re("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!a)throw new w("User is not authenticated.");if(y.connectorType==="embedded"&&y.walletClientType==="privy")throw new w("Cannot unlink an embedded wallet");let C=await t.unlinkWallet(y.address);c(C)}}))||[];return fn(Ti(p)),Ia(d,p)?d:p})};(0,J.useEffect)(()=>{wr()},[s?.linkedAccounts,a,n]),(0,J.useEffect)(()=>{if(n){if(!t.connectors)throw new w("Connector not initialized");wr(),t.connectors.on("walletsUpdated",wr)}},[n]);let co=()=>{re(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,J.useEffect)(()=>{if(!g[0])return;let d=g[0],p=b.current.find(C=>C.address===d.address),y;if(d.walletClientType==="privy"?y=s?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===d.address&&C.walletClientType==="privy"):y=s?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===d.address&&C.walletClientType!=="privy"),!p&&y){let C=Object.assign({},s);C.wallet=y&&{address:y.address,chainType:y.chainType,chainId:y.chainId,walletClient:y.walletClient,walletClientType:y.walletClientType,connectorType:y.connectorType},c(C)}b.current=g},[g]);let da=async(d,p)=>{if(Ae(d))throw H(N,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[C,L]=await Promise.all([Re.initializeWalletProxy(p),Ke()]);if(!C&&e.config?.customAuth?.enabled)throw H(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!C||!L||e.config?.embeddedWallets?.requireUserPasswordOnCreate)return new Promise((Y,Pe)=>{Q(!0),Me({createWallet:{onSuccess:xt=>{H(N,"createWallet","onSuccess",xt),Y(xt)},onFailure:xt=>{H(N,"createWallet","onError","unknown_embedded_wallet_error"),Pe(xt)},callAuthOnSuccessOnClose:!1}}),re("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await C.create({accessToken:L});let Y=await Re.refreshUser(),Pe=Ae(Y);if(!Pe)throw H(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return H(N,"createWallet","onSuccess",Pe),Pe}},Kg=d=>{if(!R.chains.map(p=>p.id).includes(d))throw new Z(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},cd=(d,p,y)=>new Promise(async(C,L)=>{if(!a||!s){H(N,"sendTransaction","onError","must_be_authenticated"),L(new Error("User must be authenticated before signing with a Privy wallet"));return}let Y=Ae(s);if(!Y){H(N,"sendTransaction","onError","embedded_wallet_not_found"),L(new Error("Must have a Privy wallet before signing"));return}Q(!0);let Pe=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,ut=d.chainId?Number(d.chainId):Pe.chainId;Kg(ut);let xt=Object.assign({},d,{chainId:ut}),Xo=async()=>{let mt=await Ke();if(!mt||!U){H(N,"sendTransaction","onError","embedded_wallet_not_found"),L(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await Re.recoverEmbeddedWallet()){H(N,"sendTransaction","onError","unknown_connect_wallet_error"),L(new Error("Unable to connect to wallet"));return}let er=new Ei.StaticJsonRpcProvider(mo(xt.chainId,R.chains,R.rpcConfig)),Jg=await yi(Y.address,xt,er),ud=await ml(mt,Y.address,U,Jg,er);H(N,"sendTransaction","onSuccess",ud),C(ud)}catch(po){H(N,"sendTransaction","onError","transaction_failure"),L(po)}};if(R.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),Xo();else{let mt={transactionRequest:xt,onSuccess:er=>{H(N,"sendTransaction","onSuccess",er),C(er)},onFailure:er=>{H(N,"sendTransaction","onError","transaction_failure"),L(er)},uiOptions:p||{},fundWalletConfig:y},po={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:er=>{H(N,"sendTransaction","onError","unknown_connect_wallet_error"),L(er)}};Me({connectWallet:po,sendTransaction:mt}),re("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function dd(){return new Promise(async(d,p)=>{let y=await Ke();if(!y||!U)throw new Error("Must have valid access token to enroll in MFA");try{await U.verifyMfa({accessToken:y}),d()}catch(C){p(C)}})}let gn={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:co,linkWallet:pt,linkEmail:()=>{if(!a)throw new w("User must be authenticated before linking an email address.");if(s?.email)throw new w("User already has an email linked to their account.");h(!0),re("LINK_EMAIL_SCREEN")},linkPhone:()=>{if(!a)throw new w("User must be authenticated before linking a phone number.");if(s?.phone)throw new w("User already has a phone number linked to their account.");h(!0),re("LINK_PHONE_SCREEN")},linkGoogle:async()=>{if(!a)throw new w("User must be authenticated before linking a Google account.");if(s?.google)throw new w("User already has a Google account linked to their account.");await Re.initLoginWithOAuth("google")},linkTwitter:async()=>{if(!a)throw new w("User must be authenticated before linking a Twitter account.");if(s?.twitter)throw new w("User already has a Twitter account linked to their account.");await Re.initLoginWithOAuth("twitter")},linkDiscord:async()=>{if(!a)throw new w("User must be authenticated before linking a Discord account.");if(s?.discord)throw new w("User already has a Discord account linked to their account.");await Re.initLoginWithOAuth("discord")},linkGithub:async()=>{if(!a)throw new w("User must be authenticated before linking a GitHub account.");if(s?.github)throw new w("User already has a Github account linked to their account.");await Re.initLoginWithOAuth("github")},linkSpotify:async()=>{if(!a)throw new w("User must be authenticated before linking a Spotify account.");if(s?.spotify)throw new w("User already has a Spotify account linked to their account.");await Re.initLoginWithOAuth("spotify")},linkTiktok:async()=>{if(!a)throw new w("User must be authenticated before linking a TikTok account.");if(s?.tiktok)throw new w("User already has a Tiktok account linked to their account.");await Re.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{if(!a)throw new w("User must be authenticated before linking a LinkedIn account.");if(s?.linkedin)throw new w("User already has a LinkedIn account linked to their account.");await Re.initLoginWithOAuth("linkedin")},linkApple:async()=>{if(!a)throw new w("User must be authenticated before linking an Apple account.");await Re.initLoginWithOAuth("apple")},linkFarcaster:async()=>{if(!a)throw new w("User must be authenticated before linking a Farcaster account.");await Re.initLoginWithFarcaster(),h(!0),re("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(!a)throw new w("User must be authenticated before updating an email address.");if(!s?.email)throw new w("User does not have an email linked to their account.");h(!0),re("UPDATE_EMAIL_SCREEN")},login:async()=>{if(n||(await new Promise(d=>{qe(()=>d)}),qe(null)),a){console.warn("Attempted to log in, but user is already logged in. Use a `link` helper instead.");return}M(!0),$t("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{qe(()=>d)}),qe(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(g[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}$t("CONNECT_OR_CREATE")},logout:async()=>{await t.logout(),c(null),l(!1),k(null),H(N,"logout","onSuccess"),h(!1),r(!1),de.del(_i)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new Se;let d=g.find(y=>s.wallet&&y.address===s.wallet.address),p=t.connectors?.walletConnectors.find(y=>y.wallets.find(C=>C.address===d?.address));return!d||!p?new Se:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new Ei.Web3Provider(new ho(new Se));let d=g.find(y=>s.wallet&&y.address===s.wallet.address),p=t.connectors?.walletConnectors.find(y=>y.wallets.find(C=>C.address===d?.address));return!d||!p?new Ei.Web3Provider(new ho(new Se)):new Ei.Web3Provider(new ho(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new xr(new Se);let d=g.find(y=>s.wallet&&y.address===s.wallet.address),p=t.connectors?.walletConnectors.find(y=>y.wallets.find(C=>C.address===d?.address));return!d||!p?new xr(new Se):new xr(p.proxyProvider)},unlinkWallet:async d=>{let p=await t.unlinkWallet(d);return c(p),p},unlinkEmail:async d=>{let p=await t.unlinkEmail(d);return c(p),p},unlinkPhone:async d=>{let p=await t.unlinkPhone(d);return c(p),p},unlinkGoogle:async d=>{let p=await t.unlinkOAuth("google",d);return c(p),p},unlinkTwitter:async d=>{let p=await t.unlinkOAuth("twitter",d);return c(p),p},unlinkDiscord:async d=>{let p=await t.unlinkOAuth("discord",d);return c(p),p},unlinkGithub:async d=>{let p=await t.unlinkOAuth("github",d);return c(p),p},unlinkSpotify:async d=>{let p=await t.unlinkOAuth("spotify",d);return c(p),p},unlinkTiktok:async d=>{let p=await t.unlinkOAuth("tiktok",d);return c(p),p},unlinkLinkedIn:async d=>{let p=await t.unlinkOAuth("linkedin",d);return c(p),p},unlinkApple:async d=>{let p=await t.unlinkOAuth("apple",d);return c(p),p},unlinkFarcaster:async d=>{let p=await t.unlinkFarcaster(d);return c(p),p},setActiveWallet:async d=>{let p=g.find(C=>(0,la.getAddress)(C.address)===(0,la.getAddress)(d)),y=s?.linkedAccounts.find(C=>C.type==="wallet"&&(0,la.getAddress)(C.address)===(0,la.getAddress)(d));if(!p||!await p.isConnected())K(d),pt();else if(!p.linked)p.loginOrLink();else{let C=Object.assign({},s);C.wallet=y&&{address:y.address,chainType:y.chainType,chainId:y.chainId,walletClient:y.walletClient,walletClientType:y.walletClientType,connectorType:y.connectorType},c(C)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw H(N,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return da(s,15e3)},setWalletPassword:async()=>{if(!a||!s)throw H(N,"setWalletPassword","onError","must_be_authenticated"),new Error("User must be authenticated before adding password to Privy wallet");let d=Ae(s);if(!d||!U)throw H(N,"setWalletPassword","onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a password");if(d.recoveryMethod==="user-passcode")throw H(N,"setWalletPassword","onError","embedded_wallet_password_already_exists"),new Error("Cannot set password. Embedded wallet already has a password.");try{await dd()}catch(p){throw H(N,"setWalletPassword","onError","missing_mfa_credentials"),p}return new Promise((p,y)=>{Q(!0);let C={onSuccess:Y=>{H(N,"setWalletPassword","onSuccess",Y),p(Y)},onFailure:Y=>{H(N,"setWalletPassword","onError","user_exited_set_password_flow"),y(Y)},callAuthOnSuccessOnClose:!1},L={onCompleteNavigateTo:"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",onFailure:Y=>{H(N,"setWalletPassword","onError","unknown_connect_wallet_error"),y(Y)}};Me({setWalletPassword:C,connectWallet:L}),re("EMBEDDED_WALLET_CONNECTING_SCREEN")})},signMessage:(d,p)=>new Promise(async(y,C)=>{if(!a||!s){H(N,"signMessage","onError","must_be_authenticated"),C(new Error("User must be authenticated before signing with a Privy wallet"));return}let L=Ae(s);if(!L){H(N,"signMessage","onError","embedded_wallet_not_found"),C(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){H(N,"signMessage","onError","invalid_message"),C(new Error("Message must be a non-empty string"));return}Q(!0);let Y=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Pe=await Ke();if(!U||!Pe)throw new Error("Unable to connect to wallet");if(!await Re.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_message_started",{walletAddress:L.address});let{response:xt}=await U.rpc({accessToken:Pe,address:L.address,request:{method:"personal_sign",params:[d,L.address]}}),Xo=xt.data;return t.createAnalyticsEvent("embedded_wallet_sign_message_completed",{walletAddress:L.address}),Xo};if(R.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Pe=await Y();H(N,"signMessage","onSuccess",Pe),y(Pe)}catch(Pe){H(N,"signMessage","onError","unable_to_sign"),C(Pe??new nt("Unable to sign message"))}}else{let xt={method:"personal_sign",data:d,confirmAndSign:Y,onSuccess:mt=>{H(N,"signMessage","onSuccess",mt),y(mt)},onFailure:mt=>{H(N,"signMessage","onError","unable_to_sign"),C(mt)},uiOptions:p||{}},Xo={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:mt=>{H(N,"signMessage","onError","unknown_connect_wallet_error"),C(mt)}};Me({signMessage:xt,connectWallet:Xo}),re("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(y,C)=>{if(!a||!s){H(N,"signTypedData","onError","must_be_authenticated"),C(new Error("User must be authenticated before signing with a Privy wallet"));return}let L=Ae(s);if(!L){H(N,"signTypedData","onError","embedded_wallet_not_found"),C(new Error("Must have a Privy wallet before signing"));return}Q(!0);let Y=ka(d),Pe=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let ut=await Ke();if(!U||!ut)throw new Error("Unable to connect to wallet");if(!await Re.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_typed_data_started",{walletAddress:L.address});let{response:Xo}=await U.rpc({accessToken:ut,address:L.address,request:{method:"eth_signTypedData_v4",params:[L.address,Y]}}),mt=Xo.data;return t.createAnalyticsEvent("embedded_wallet_sign_typed_data_completed",{walletAddress:L.address}),mt};if(R.embeddedWallets.noPromptOnSignature||(R.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ut=await Pe();H(N,"signTypedData","onSuccess",ut),y(ut)}catch(ut){H(N,"signTypedData","onError","unable_to_sign"),C(ut??new nt("Unable to sign message"))}}else{let Xo={method:"eth_signTypedData_v4",data:Y,confirmAndSign:Pe,onSuccess:po=>{H(N,"signTypedData","onSuccess",po),y(po)},onFailure:po=>{H(N,"signTypedData","onError","unable_to_sign"),C(po)},uiOptions:p||{}},mt={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:po=>{H(N,"signMessage","onError","unknown_connect_wallet_error"),C(po)}};Me({signMessage:Xo,connectWallet:mt}),re("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,y)=>{let L=await(await cd(d,p,y)).wait();return hl(L)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}let y=Ae(s);if(!y){p(new Error("Must have a Privy wallet before exporting"));return}Q(!0);let C={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p},L=await Ke();if(!L||!U){p(new Error("Must have valid access token to enroll in MFA"));return}if(!U){p(new Error("Must have a Privy wallet before exporting"));return}try{try{await U.connect({accessToken:L,address:y.address}),await U.verifyMfa({accessToken:L})}catch(Pe){if(Qr(Pe))await Re.recoverEmbeddedWallet();else throw Pe}}catch(Pe){p(Pe);return}let Y={appId:e.appId,origin:t.apiUrl,onSuccess:d,onFailure:p};Me({keyExport:Y,connectWallet:C}),re("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:dd,async init(d){let p;switch(d){case"sms":p=new Tl("verify");break;case"totp":return;default:throw new Error(`Unsupported MFA method: ${d}`)}t.startMfaFlow(p),await p.init()},async submit(d,p){switch(d){case"totp":case"sms":Ro.current?.resolve({mfaMethod:d,mfaCode:p}),await new Promise((y,C)=>{hn.current={resolve:y,reject:C}});break;default:throw Ro.current?.reject(new w("Unsupported MFA method")),new w(`Unsupported MFA method: ${d}`)}},cancel(){Ro.current?.reject(new w("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Ke();if(!p||!U)throw new Error("Must have valid access token to enroll in MFA");await U.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,y)=>{if(!d){Re.closePrivyModal(),p();return}R.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."),Me({mfaEnrollmentFlow:{mfaMethods:R.mfa.methods,onSuccess:p,onFailure:y}}),re("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Ke();if(!d||!U)throw new Error("Must have valid access token to enroll in MFA");let p=await U.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await Ke();if(!p||!U)throw new Error("Must have valid access token to enroll in MFA");await U.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let y=await t.getAuthenticatedUser();c(y)},async submitEnrollmentWithTotp(d){let p=await Ke();if(!p||!U)throw new Error("Must have valid access token to enroll in MFA");await U.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let y=await t.getAuthenticatedUser();c(y)},async unenroll(d){let p=await Ke();if(!p||!U)throw new Error("Must have valid access token to remove MFA");await U.unenrollMfa({method:d,accessToken:p});let y=await t.getAuthenticatedUser();c(y)},loginWithCode(d){return Re.loginWithCode(d)},initLoginWithEmail(d){return Re.initLoginWithEmail(d)},initLoginWithSms(d){return Re.initLoginWithSms(d)},isModalOpen:o};Cg=gn.signMessage,bg=gn.signTypedData,Eg=async(...d)=>{let p=await cd(...d);return R.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let pd=!!e.config?.headless,Re=(()=>({headless:pd,isNewUserThisSession:T,isLinking:m,linkingHint:G,pendingTransaction:null,walletConnectionStatus:S,mipdStore:D,connectors:t.connectors?.walletConnectors??[],rpcConfig:R.rpcConfig,chains:R.chains,showFiatPrices:R.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>R.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(U)return U;let p=new Promise(L=>{Zo(()=>Y=>L(Y))}),y=new Promise(L=>setTimeout(()=>L(null),d)),C=await Promise.race([p,y]);return Zo(null),C},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0})=>{let p=n&&a&&s;d.shouldCallAuthOnSuccess&&p?(H(N,"login","onComplete",s,T,!1,dt.current??null),e.onSuccess?.(s,T)):I&&H(N,"login","onError","exited_auth_flow"),K(null),M(!1),h(!1),x(!1),r(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent("modal_closed")},openPrivyModal:re,connectWallet:Pi,initLoginWithWallet:async(d,p)=>{dt.current="siwe",vr(d,p)},loginWithWallet:async()=>{if(!n)throw new vn;if(!(t.authFlow instanceof qr))throw new w("Must initialize SIWE flow first.");let d,p;if(a)d=await t.link();else try{({user:d,isNewUser:p}=await t.authenticate())}catch(y){throw H(N,"login","onError",y.privyErrorCode||"generic_connect_wallet_error"),y}c(d||s||null),x(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new xi(d);t.startAuthFlow(p);try{dt.current="farcaster",await p.initializeFarcasterConnect()}catch(y){throw H(N,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}},loginWithFarcaster:async()=>{if(!n)throw new vn;if(!(t.authFlow instanceof xi))throw new w("Must initialize Farcaster flow first.");let d,p;if(a)d=await t.link();else try{({user:d,isNewUser:p}=await t.authenticate())}catch(y){throw H(N,"login","onError",y.privyErrorCode||"generic_connect_wallet_error"),y}c(d||null),x(p||!1),l(!0)},initLoginWithOAuth:async(d,p)=>{if(ap()){if(d==="google"&&ad(window.navigator.userAgent)){$t("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{$t("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}let y=new br(d);p&&y.addCaptchaToken(p),t.startAuthFlow(y);let C=await t.authFlow.getAuthorizationUrl();C&&C.url&&window.location.assign(C.url)},loginWithOAuth:async d=>{if(!(t.authFlow instanceof br))throw new w("Must initialize OAuth flow before calling loginWithOAuth");let p=uo.get(Cn),y=t.authFlow.meta.stateCode;if(p!==y)throw t.createAnalyticsEvent("possible_phishing_attempt",{provider:d,storedStateCode:p??"",returnedStateCode:y??""}),new w("Unexpected auth flow. This may be a phishing attempt.");let C,L;if(a)C=await t.link();else try{({user:C,isNewUser:L}=await t.authenticate()),dt.current=d}catch(Y){throw H(N,"login","onError",Y.privyErrorCode||"unknown_auth_error"),Y}c(C),x(L||!1),l(!0)},initLoginWithEmail:async(d,p)=>{let y=new Cr(d,p);t.startAuthFlow(y);try{dt.current="email",await y.sendCodeEmail()}catch(C){throw H(N,"login","onError",C.privyErrorCode||"unknown_auth_error"),C}},initUpdateEmail:async(d,p,y)=>{let C=new va(d,p,y);t.startAuthFlow(C),await C.sendCodeEmail()},initLoginWithSms:async(d,p)=>{let y=new jr(d,p);t.startAuthFlow(y);try{dt.current="sms",await y.sendSmsCode()}catch(C){throw H(N,"login","onError",C.privyErrorCode||"unknown_auth_error"),C}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(!n)throw new vn;if(t.authFlow instanceof Cr)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof jr)t.authFlow.meta.smsCode=d.trim();else throw new w("Must initialize a passwordless code flow first");let p,y;a?p=await t.link():{user:p,isNewUser:y}=await t.authenticate(),c(p||s||null),x(y||!1),l(!0)},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:U,createAnalyticsEvent:(d,p,y)=>t.createAnalyticsEvent(d,p,y),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedWallet:async()=>new Promise(async(d,p)=>{let y=s?.linkedAccounts.find(L=>L.type==="wallet"&&L.walletClientType==="privy"),C=await Ke();if(!C||!U||!y){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Q(!0);try{await U.connect({accessToken:C,address:y.address}),d(!0)}catch(L){Qr(L)&&y.recoveryMethod==="privy"?(t.createAnalyticsEvent("embedded_wallet_pinless_recovery_started",{walletAddress:y.address}),(await U.recover({address:y.address,accessToken:C})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent("embedded_wallet_recovery_completed",{walletAddress:y.address}),d(!0)):Qr(L)?(Me({recoverWallet:{privyWallet:y,onFailure:p,onSuccess:()=>d(!0)}}),re("EMBEDDED_WALLET_RECOVERY_SCREEN")):p(L)}}),getFiatOnRampConfig:Pl,setReadyToTrue:()=>{i(!0),Tt?.()},updateWallets:()=>wr()}))();Tg=Re.recoverEmbeddedWallet;let Yg=(0,J.useMemo)(()=>({wallets:g,ready:lo}),[g,lo]);return(0,Mt.jsx)(ge.Provider,{value:gn,children:(0,Mt.jsx)(Jl.Provider,{value:N,children:(0,Mt.jsx)(Zc.Provider,{value:Yg,children:(0,Mt.jsxs)(fu,{...R,children:[e.children,(0,Mt.jsxs)(Yl.Provider,{value:Re,children:[!pd&&R.captchaEnabled&&n&&!a&&(0,Mt.jsx)(as,{delayedExecution:!1}),(0,Mt.jsx)(mg,{theme:{...R.appearance.palette||{}}}),(0,Mt.jsx)(Yp,{data:ct,setModalData:Me,setInitialScreen:k,initialScreen:E,authenticated:a,open:o,children:(0,Mt.jsx)(yg,{open:o})}),ue&&le?(0,Mt.jsx)(gg,{appId:e.appId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:Ro,mfaSubmitPromise:hn,onLoad:j,onLoadFailed:()=>null}):null]})]})})})})};var xg=require("react");function Sg(e){let{login:t}=(0,xg.useContext)(ge);return Be("login",e),{login:t}}var _g=require("react");function Ag(e){let{logout:t}=(0,_g.useContext)(ge);return Be("logout",e),{logout:t}}var sd=require("react");var kg=()=>{let e=_e(),{initLoginWithEmail:t,loginWithCode:o}=z(),r=(0,sd.useCallback)(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return e.status==="disabled",t(i)},[t]),n=(0,sd.useCallback)(async({code:i})=>{if(e.enabled&&e.status==="error")throw new nr(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};var ld=require("react");var Rg=()=>{let e=_e(),{initLoginWithSms:t,loginWithCode:o}=z(),r=(0,ld.useCallback)(async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");return e.status==="disabled",t(i)},[t]),n=(0,ld.useCallback)(async({code:i})=>{if(e.enabled&&e.status!=="success")throw new nr(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};var Ig=require("react");function Mg(e){let{connectWallet:t}=(0,Ig.useContext)(ge);return Be("connectWallet",e),{connectWallet:t}}var Wg=require("react");function Ng(e){let{createWallet:t}=(0,Wg.useContext)(ge);return Be("createWallet",e),{createWallet:t}}var Lg=require("react");function Og(e){let{sendTransaction:t}=(0,Lg.useContext)(ge);return Be("sendTransaction",e),{sendTransaction:t}}var Dg=require("react");function Ug(e){let{setWalletPassword:t}=(0,Dg.useContext)(ge);return Be("setWalletPassword",e),{setWalletPassword:t}}var Fg=require("react");function Bg(e){let{signMessage:t}=(0,Fg.useContext)(ge);return Be("signMessage",e),{signMessage:t}}var Hg=require("react");function Gg(e){let{signTypedData:t}=(0,Hg.useContext)(ge);return Be("signTypedData",e),{signTypedData:t}}var Vg=require("react");var zg=()=>{let{isModalOpen:e}=(0,Vg.useContext)(ge);return{isOpen:e}};var $g=require("react");function qg(e){let{getAccessToken:t}=(0,$g.useContext)(ge);return Be("accessToken",e),{getAccessToken:t}}function jg(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}0&&(module.exports={AsExternalProvider,Captcha,ConnectorManager,PrivyClient,PrivyProvider,PrivyProxyProvider,SUPPORTED_CHAINS,VERSION,WalletConnector,addRpcUrlOverrideToChain,errorIndicatesMaxMfaRetries,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,getAccessToken,useConnectWallet,useCreateWallet,useLogin,useLoginWithEmail,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSignMessage,useSignTypedData,useToken,useWallets});