@privy-io/react-auth 1.59.0 → 1.59.1-beta-20240306183818
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +236 -222
- package/dist/index.d.ts +54 -1
- package/dist/index.js +232 -218
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Fs=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)};var Bc=(e,t,o)=>(Fs(e,t,"read from private field"),o?o.call(e):t.get(e)),ki=(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)},Bs=(e,t,o,r)=>(Fs(e,t,"write to private field"),r?r.call(e,o):t.set(e,o),o);var Hc=(e,t,o)=>(Fs(e,t,"access private method"),o);import{getAddress as Ds}from"@ethersproject/address";import{StaticJsonRpcProvider as i4,Web3Provider as Oc}from"@ethersproject/providers";import{createStore as a4}from"mipd";import{useCallback as s4,useEffect as xo,useMemo as l4,useRef as Si,useState as Te}from"react";import{FetchError as Ty}from"ofetch";var De=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}]`:""}`}},Kt=class extends De{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},w=class extends De{constructor(o,r,n){super(o,r,n);this.type="client_error"}},Ri=class extends w{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var Y=class extends De{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},ie=e=>{if(e instanceof De)return e;if(!(e instanceof Ty))return Ke(e);if(!e.response)return new Kt("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.data;return new Kt(t||"ApiError",e.response.status,o||r,e,n)},Ke=e=>e instanceof De?e:e instanceof Error?new w(e.message,e):new w(`Internal error: ${e}`);var Ar=class extends w{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},ct=class extends w{constructor(t="Embedded wallet error",o){super(t,o,"unknown_embedded_wallet_error")}},Ii=class extends w{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Mi="/api/v1/sessions",Wi="/api/v1/sessions/logout",Gc="/api/v1/sessions/fork",Li="/api/v1/sessions/fork/recover",Vc="/api/v1/siwe/init",zc="/api/v1/siwe/authenticate",$c="/api/v1/siwe/link",qc="/api/v1/siwe/unlink",jc="/api/v1/farcaster/init",Kc="/api/v1/farcaster/authenticate",Yc="/api/v1/farcaster/link",Jc="/api/v1/farcaster/status",Zc="/api/v1/farcaster/unlink",Qc="/api/v1/passwordless/init",Xc="/api/v1/passwordless/authenticate",ed="/api/v1/passwordless/link",td="/api/v1/passwordless/unlink",od="/api/v1/passwordless/update",rd="/api/v1/passwordless_sms/init",nd="/api/v1/passwordless_sms/link",id="/api/v1/passwordless_sms/unlink",ad="/api/v1/passwordless_sms/authenticate",sd="/api/v1/oauth/init",ld="/api/v1/oauth/authenticate",cd="/api/v1/oauth/link",dd="/api/v1/oauth/unlink";var pd="/api/v1/mfa/passwordless_sms/init",ud="/api/v1/mfa/passwordless_sms/enroll";var md="/api/v1/users/me/accept_terms",fd="/api/v1/analytics_events",hd="/api/v1/plugins/moonpay_on_ramp/sign",yd="/api/v1/custom_jwt_account/authenticate";var kr=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(yd,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw ie(t)}}async link(){throw new Error("Unimplemented")}};var ko=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=await this.api.post(Xc,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw ie(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(ed,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw ie(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{return await this.api.post(Qc,{email:this.meta.email,token:this.meta.captchaToken})}catch(r){throw ie(r)}}},Oi=class extends ko{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{return await this.api.post(od,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(o){throw ie(o)}}};import{isMobile as xy}from"react-device-detect";var Ye=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var Mn=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Ye(this._startChannelOnce.bind(this)),this.pollForReady=new Ye(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("Auth flow must be initialized first");try{let t=await this.api.post(Kc,{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 ie(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(Yc,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw ie(t)}}async _startChannelOnce(){if(!this.api)throw new w("Auth flow has no API instance");let t=await this.api.post(jc,{token:this.captchaToken});xy&&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(Jc,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};import{base64url as Id}from"jose";var gd="1.59.0";var Ni="4df5e2316331463a9130964bd6078dfa",vd="fe9c30fc-3bc5-4064-91e2-6ab5887f8f4d",wd="34357d3c125c2bcf2ce2bc3309d98715",Di="https://auth.privy.io",Cd=2e4,Je=1400,bd=2500,Hs=gd;var rr="privy:token",Gs="privy-token",Ui="privy:refresh_token",Vs="privy-refresh-token",Fi="privy-session",Wn="privy:session_transfer_token",_y="privy:wallet",Ln="privy:caid",Rr="privy:state_code",Ir="privy:code_verifier",Bi=e=>`${_y}:${e}`,zs="privy:connectors",$s="privy:connections";var nr=12e4,ho=1,qs="0x1",Mr=3e4,Ed="https://api.moonpay.com/v1",Pd="https://api.moonpay.com/v1",Td="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",xd="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",Sd="0x420000000000000000000000000000000000000F",_d=["function getL1Fee(bytes memory _data) external view returns (uint256)"];async function Ad(e){let t=new TextEncoder().encode(e),o=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(o)}function kd(e){return crypto.getRandomValues(new Uint8Array(e))}var Hi=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)}},js=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)}},Ks=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 Rd(){try{let e="privy:__session_storage__test",t="blobby";return window.sessionStorage.setItem(e,t),window.sessionStorage.removeItem(e),!0}catch{return!1}}function Ay(){return typeof window<"u"&&window.localStorage?new js:new Hi}function ky(){return typeof window<"u"&&window.sessionStorage?new Ks:new Hi}var Ot=ky(),ae=Ay();var Ry="S256",Iy="S256",Ro=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=Ot.get(Ir);if(!t)throw new w("Authentication error.");try{let o=await this.api.post(ld,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Ot.del(Ir),{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(o){let r=ie(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=Ot.get(Ir);if(!t)throw new w("Authentication error.");try{let o=await this.api.post(cd,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Ot.del(Ir),o}catch(o){throw ie(o)}}createCodeVerifier(){return Id.encode(kd(36))}createStateCode(){return this.createCodeVerifier()}async deriveCodeChallengeFromCodeVerifier(t,o=Ry){if(o==Iy){let r=await Ad(t);return Id.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();Ot.put(Ir,t);let o=this.createStateCode();Ot.put(Rr,o);let r=await this.deriveCodeChallengeFromCodeVerifier(t);try{return await this.api.post(sd,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:r,state_code:o})}catch(n){throw ie(n)}}};var ir=class{constructor(t,o){this.createSiweMessage=(t,o,r,n,i,a,l)=>`${r} wants you to sign in with your Ethereum account:
|
|
1
|
+
var Bs=(e,t,o)=>{if(!t.has(e))throw TypeError("Cannot "+o)};var Bc=(e,t,o)=>(Bs(e,t,"read from private field"),o?o.call(e):t.get(e)),Ri=(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)},Hs=(e,t,o,r)=>(Bs(e,t,"write to private field"),r?r.call(e,o):t.set(e,o),o);var Hc=(e,t,o)=>(Bs(e,t,"access private method"),o);import{getAddress as Us}from"@ethersproject/address";import{StaticJsonRpcProvider as n4,Web3Provider as Nc}from"@ethersproject/providers";import{createStore as i4}from"mipd";import{useCallback as a4,useEffect as Ao,useMemo as s4,useRef as An,useState as Ne}from"react";import{FetchError as Py}from"ofetch";var Ue=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}]`:""}`}},Jt=class extends Ue{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},_=class extends Ue{constructor(o,r,n){super(o,r,n);this.type="client_error"}},Ii=class extends _{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var Z=class extends Ue{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},se=e=>{if(e instanceof Ue)return e;if(!(e instanceof Py))return Je(e);if(!e.response)return new Jt("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.data;return new Jt(t||"ApiError",e.response.status,o||r,e,n)},Je=e=>e instanceof Ue?e:e instanceof Error?new _(e.message,e):new _(`Internal error: ${e}`);var _r=class extends _{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},pt=class extends _{constructor(t="Embedded wallet error",o){super(t,o,"unknown_embedded_wallet_error")}},Mi=class extends _{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Wi="/api/v1/sessions",Li="/api/v1/sessions/logout",Gc="/api/v1/sessions/fork",Oi="/api/v1/sessions/fork/recover",Vc="/api/v1/siwe/init",zc="/api/v1/siwe/authenticate",$c="/api/v1/siwe/link",qc="/api/v1/siwe/unlink",jc="/api/v1/farcaster/init",Kc="/api/v1/farcaster/authenticate",Yc="/api/v1/farcaster/link",Jc="/api/v1/farcaster/status",Zc="/api/v1/farcaster/unlink",Qc="/api/v1/passwordless/init",Xc="/api/v1/passwordless/authenticate",ed="/api/v1/passwordless/link",td="/api/v1/passwordless/unlink",od="/api/v1/passwordless/update",rd="/api/v1/passwordless_sms/init",nd="/api/v1/passwordless_sms/link",id="/api/v1/passwordless_sms/unlink",ad="/api/v1/passwordless_sms/authenticate",sd="/api/v1/oauth/init",ld="/api/v1/oauth/authenticate",cd="/api/v1/oauth/link",dd="/api/v1/oauth/unlink";var pd="/api/v1/mfa/passwordless_sms/init",ud="/api/v1/mfa/passwordless_sms/enroll";var md="/api/v1/users/me/accept_terms",fd="/api/v1/analytics_events",hd="/api/v1/plugins/moonpay_on_ramp/sign",yd="/api/v1/custom_jwt_account/authenticate";var Ar=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new _("Auth flow has no API instance");try{let t=await this.api.post(yd,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw se(t)}}async link(){throw new Error("Unimplemented")}};var Ro=class{constructor(t,o){this.meta={email:t,captchaToken:o}}async authenticate(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new _("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(Xc,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw se(t)}}async link(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new _("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(ed,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw se(t)}}async sendCodeEmail(t,o){if(!this.api)throw new _("Auth flow has no API instance");if(t&&(this.meta.email=t),o&&(this.meta.captchaToken=o),!this.meta.email)throw new _("Email must be set when initialzing authentication.");try{return await this.api.post(Qc,{email:this.meta.email,token:this.meta.captchaToken})}catch(r){throw se(r)}}},Ni=class extends Ro{constructor(o,r,n){super(r,n);this.meta={email:r,captchaToken:n,oldAddress:o}}async link(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new _("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(od,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(o){throw se(o)}}};import{isMobile as Ty}from"react-device-detect";var Ze=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 Ln=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Ze(this._startChannelOnce.bind(this)),this.pollForReady=new Ze(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.channelToken)throw new _("Auth flow must be initialized first");try{let t=await this.api.post(Kc,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new _("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 se(t)}}async link(){if(!this.api)throw new _("Auth flow has no API instance");try{return await this.api.post(Yc,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw se(t)}}async _startChannelOnce(){if(!this.api)throw new _("Auth flow has no API instance");let t=await this.api.post(jc,{token:this.captchaToken});Ty&&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 _("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.channelToken)throw new _("Auth flow must be initialized first");let t=await this.api.get(Jc,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};import{base64url as Id}from"jose";var gd="1.59.1-beta-20240306183818";var Di="4df5e2316331463a9130964bd6078dfa",vd="fe9c30fc-3bc5-4064-91e2-6ab5887f8f4d",wd="34357d3c125c2bcf2ce2bc3309d98715",Ui="https://auth.privy.io",Cd=2e4,Qe=1400,bd=2500,Gs=gd;var nr="privy:token",Vs="privy-token",Fi="privy:refresh_token",zs="privy-refresh-token",Bi="privy-session",On="privy:session_transfer_token",Sy="privy:wallet",Nn="privy:caid",kr="privy:state_code",Rr="privy:code_verifier",Hi=e=>`${Sy}:${e}`,$s="privy:connectors",qs="privy:connections";var ir=12e4,vo=1,js="0x1",Ir=3e4,Ed="https://api.moonpay.com/v1",Pd="https://api.moonpay.com/v1",Td="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",xd="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",Sd="0x420000000000000000000000000000000000000F",_d=["function getL1Fee(bytes memory _data) external view returns (uint256)"];async function Ad(e){let t=new TextEncoder().encode(e),o=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(o)}function kd(e){return crypto.getRandomValues(new Uint8Array(e))}var Gi=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)}},Ks=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)}},Ys=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 Rd(){try{let e="privy:__session_storage__test",t="blobby";return window.sessionStorage.setItem(e,t),window.sessionStorage.removeItem(e),!0}catch{return!1}}function _y(){return typeof window<"u"&&window.localStorage?new Ks:new Gi}function Ay(){return typeof window<"u"&&window.sessionStorage?new Ys:new Gi}var Ut=Ay(),le=_y();var ky="S256",Ry="S256",Io=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 _("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new _("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new _("User denied confirmation during OAuth flow");let t=Ut.get(Rr);if(!t)throw new _("Authentication error.");try{let o=await this.api.post(ld,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Ut.del(Rr),{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(o){let r=se(o);throw r.privyErrorCode?new _(r.message||"Invalid code during OAuth flow.",void 0,r.privyErrorCode):r.message==="User denied confirmation during OAuth flow"?new _("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new _("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new _("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new _("User denied confirmation during OAuth flow");let t=Ut.get(Rr);if(!t)throw new _("Authentication error.");try{let o=await this.api.post(cd,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Ut.del(Rr),o}catch(o){throw se(o)}}createCodeVerifier(){return Id.encode(kd(36))}createStateCode(){return this.createCodeVerifier()}async deriveCodeChallengeFromCodeVerifier(t,o=ky){if(o==Ry){let r=await Ad(t);return Id.encode(r)}else return t}async getAuthorizationUrl(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.provider)throw new _("Provider must be set when initializing OAuth authentication.");let t=this.createCodeVerifier();Ut.put(Rr,t);let o=this.createStateCode();Ut.put(kr,o);let r=await this.deriveCodeChallengeFromCodeVerifier(t);try{return await this.api.post(sd,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:r,state_code:o})}catch(n){throw se(n)}}};var ar=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 Ye(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(zc,{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 ie(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($c,{message:t,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw ie(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(Vc,{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 ar=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=await this.api.post(ad,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw ie(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(nd,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ie(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{return await this.api.post(rd,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(r){throw ie(r)}}};import{v4 as Eg}from"uuid";function Ze(e){return new Date(e*1e3)}function My(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:Ze(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:Ze(o.verified_at)};t.push(i);break;case"phone":let a={number:o.phoneNumber,type:o.type,verifiedAt:Ze(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:Ze(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:Ze(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:Ze(o.verified_at)};t.push(c);break;case"discord_oauth":let u={subject:o.subject,username:o.username,email:o.email,type:o.type,verifiedAt:Ze(o.verified_at)};t.push(u);break;case"github_oauth":let m={subject:o.subject,username:o.username,name:o.name,email:o.email,type:o.type,verifiedAt:Ze(o.verified_at)};t.push(m);break;case"tiktok_oauth":let h={subject:o.subject,username:o.username,name:o.name,type:o.type,verifiedAt:Ze(o.verified_at)};t.push(h);break;case"linkedin_oauth":let y={subject:o.subject,name:o.name,email:o.email,type:o.type,verifiedAt:Ze(o.verified_at)};t.push(y);break;case"apple_oauth":let C={subject:o.subject,email:o.email,type:o.type,verifiedAt:Ze(o.verified_at)};t.push(C);break;case"custom_auth":t.push({type:o.type,customUserId:o.custom_user_id,verifiedAt:Ze(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:Ze(o.verified_at)};t.push(E);break;default:console.warn(`Unrecognized account type: ${r}. Please consider upgrading the Privy SDK.`)}}return t}function vt(e,t){return e.sort((o,r)=>r.verifiedAt.getTime()-o.verifiedAt.getTime()),e.find(o=>o.type===t)}var pe=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy")||null,Wy=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),wt=(e,t)=>t==="all-users"&&!pe(e)||t==="users-without-wallets"&&!Wy(e)?.length;function dt(e){if(!e)return null;let t=My(e.linked_accounts),o=vt(t,"wallet"),r=vt(t,"email"),n=vt(t,"phone"),i=vt(t,"google_oauth"),a=vt(t,"twitter_oauth"),l=vt(t,"discord_oauth"),s=vt(t,"github_oauth"),c=vt(t,"spotify_oauth"),u=vt(t,"tiktok_oauth"),m=vt(t,"linkedin_oauth"),h=vt(t,"apple_oauth"),y=vt(t,"farcaster"),C=e.mfa_methods.map(({type:T,verified_at:b})=>({type:T,verifiedAt:Ze(b)}));return{id:e.id,createdAt:Ze(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:u&&{subject:u.subject,username:u.username,name:u.name},linkedin:m&&{subject:m.subject,name:m.name,email:m.email},apple:h&&{subject:h.subject,email:h.email},farcaster:y&&{fid:y.fid,ownerAddress:y.ownerAddress,displayName:y.displayName,username:y.username,bio:y.bio,pfp:y.pfp,url:y.url},mfaMethods:C.map(T=>T.type),hasAcceptedTerms:e.has_accepted_terms??!1}}import{getAddress as Lp}from"@ethersproject/address";import vg from"eventemitter3";function Md(){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 Gi=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 Ys=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Gi(e)!=="MetaMask")return!1;if(e.providers){for(let o of e.providers)if(!Ys(o))return!1}return!0},Io=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Wd=()=>{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 Ld=(e,t)=>{let o=[],r=[];for(let[n,i]of e.entries())n<t?o.push(i):r.push(i);return[o,r]},Vi=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,}))$/),Od=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},Mo=(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}`},Js=e=>new Promise(t=>setTimeout(t,e));function Nd(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 Dd=(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 Js(o)}a||i(new Error("Exceeded max attempts before resolving function"))})},zi=(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 Ud=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),sr=e=>typeof e=="string"?e:"0x"+e.toString(16);async function Fd(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 Md()){let u=Gi(c);if(!l.some(m=>m.info.name===u)){if(Ys(c,!0)&&!s.find(m=>m.type==="metamask")){s.push({type:"metamask",legacyInjectedProvider:c});continue}if(u==="Phantom"&&!s.find(m=>m.type==="phantom")){s.push({type:"phantom",legacyInjectedProvider:c});continue}s.find(m=>m.type==="unknown_browser_extension")||s.push({type:"unknown_browser_extension",legacyInjectedProvider:c})}}i(s)}})}function Wr(e){return`eip155:${String(Number(e))}`}var Nt=(e,t,o)=>{let r=Number(e),n=t.find(a=>a.id===r);if(!n)throw new Y(`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]+"/"+Ni:n.rpcUrls.blast?.http[0]?i=n.rpcUrls.blast.http[0]+"/"+vd:i=n.rpcUrls.default?.http[0],!i)throw new Y(`No RPC url found for ${e}`);return i},Bd=(e,t)=>{let o=Number(e),r=t.find(n=>n.id===o);if(!r)throw new Y(`Unsupported chainId ${e}`,4901);return r.blockExplorers?.default.url},$i=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}}};import Vy from"@coinbase/wallet-sdk";import{jsx as Hd,jsxs as Ly}from"react/jsx-runtime";var qi=({style:e,...t})=>Ly("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:[Hd("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),Hd("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});import{getAddress as Jt}from"@ethersproject/address";import{Web3Provider as Kd}from"@ethersproject/providers";import{default as Hy}from"eventemitter3";import{StaticJsonRpcProvider as Vd}from"@ethersproject/providers";import By from"eventemitter3";var Oy=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Gd=e=>Oy.includes(e);import{ErrorCode as Ny}from"@ethersproject/logger";var Lr=class extends Y{constructor(){super("Wallet timeout");this.type="wallet_error"}},Or=class extends Y{constructor(){super("User rejected connection");this.type="wallet_error"}},Dt=e=>{if(e instanceof Y)return e;if(e?.code&&e?.reason){let t=new ye(e);return e.code===Ny.ACTION_REJECTED&&(t.details=Ue.E4001_USER_REJECTED_REQUEST),t}return e?.code?new ye(e):new Y("Unknown connector error",e)},Ct=class extends De{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},ye=class extends Ct{constructor(o){let r=o;super(r.message,r.code,r.data);let n=Object.values(Ue).find(i=>i.eipCode===r.code);this.details=n||Ue.UNKNOWN_ERROR,r.code===-32002&&(r.message?.includes("already pending for origin")?r.message?.includes("wallet_requestPermissions")?this.details=Ue.E32002_CONNECTION_ALREADY_PENDING:this.details=Ue.E32002_REQUEST_ALREADY_PENDING:r.message?.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=Ue.E32002_WALLET_LOCKED))}},Dy={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}},Uy={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}},Fy={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}},Ue={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...Fy,...Uy},yo={...Dy,...Ue};var ue=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 Lr,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||nr,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 Y(`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 Dt(o)})}},Wo=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},ji=class extends By{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 Vd(Nt(a,this.chains,n)),this.rpcTimeoutDuration=Nr(n,"privy")}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new Wo(`Invalid params for ${o.method}`,4200);let r=o.params[0];if(!await Ae()||!this.address)throw new Wo("Disconnected",4900);return(await qd(r)).hash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new Wo(`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 Wo(`Invalid params for ${o.method}`,4200);this.chainId=Number(r),this.provider=new Vd(Nt(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 zd(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 $d($i(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:sr(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 sr(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(Gd(o.method)){let r=await Ae();if(await jd(),!r||!this.address)throw new Wo("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 Wo("Disconnected",4900)}}else return this.provider.send(o.method,o.params)}async connect(){let o=await Ae();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}}},Yt=class extends ue{constructor(o){super(o,o.rpcTimeoutDuration)}},Lo=class extends ue{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 Gy=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},st=class extends Hy{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=Wr(o),this.walletClientType==="privy"&&ae.put(Bi(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=Nr(i,o),this.connected=!1,this.initialized=!1}buildConnectedWallet(o,r,n){let i=async()=>!!this.wallets.find(a=>Jt(a.address)===Jt(o));return{address:Jt(o),chainId:r,meta:n,switchChain:async a=>{if(!i)throw new Y("Wallet is not currently connected.");let l=this.wallets.find(h=>Jt(h.address)===Jt(o))?.chainId;if(!l)throw new Y("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===Wr(s))return;let u=this.chains.find(h=>h.id===c);if(!u)throw new Y(`Unsupported chainId: ${a}`);let m=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})};try{return await m()}catch(h){if(Gy(h,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:s,chainName:u.name,nativeCurrency:u.nativeCurrency,rpcUrls:[u.rpcUrls.default?.http[0]??""],blockExplorerUrls:[u.blockExplorers?.default.url??""]}]}),m();throw this.walletClientType==="rainbow"&&h.message?.includes("wallet_switchEthereumChain")?new Y(`Rainbow does not support the chainId ${r}`):h}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new Y("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await i())throw new Y("Wallet is not currently connected.");return new Kd(new Yt(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new Y("Wallet is not currently connected.");return new Lo(this.proxyProvider)},sign:async a=>{if(!await i())throw new Y("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=Jt(n),a=[],l;if(this.walletClientType==="privy"){let c=ae.get(Bi(i));this.chains.find(u=>u.id===Number(c))||(ae.del(Bi(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 ${qs}`,c),l=qs}let s=Wr(l);if(!a.find(c=>Jt(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(Jt(n),s,c))}Ki(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=>Jt(n)===Jt(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 Kd(new Yt(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 zy=e=>{let t=`https://mainnet.infura.io/v3/${Ni}`,o=1;return e.makeWeb3Provider(t,o)},Yi,Ji=class extends st{constructor(o,r,n){super("coinbase_wallet",o,r,n);this.connectorType="coinbase_wallet";this.proxyProvider=new ue(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),Yi||(Yi=new Vy({appName:"Privy",darkMode:!1,headlessMode:!1,enableMobileWalletLink:!0})),this.proxyProvider.setWalletProvider(zy(Yi)),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(){Yi.disconnect(),this.onDisconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:qi,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 Y("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([o[0]])}catch(o){throw Dt(o)}}};import{jsx as Yd}from"react/jsx-runtime";var Zi=({...e})=>Yd("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:Yd("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 Qi=class extends st{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:[sr(o?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Zi,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};import{jsx as Jd}from"react/jsx-runtime";var Dr=({style:e,...t})=>Jd("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:Jd("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});import{jsx as pt,jsxs as $y}from"react/jsx-runtime";var Ur=({style:e,...t})=>$y("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:[pt("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),pt("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),pt("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"}),pt("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"}),pt("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"}),pt("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"}),pt("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"}),pt("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"}),pt("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"}),pt("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"}),pt("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"}),pt("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"}),pt("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});import{jsx as Zd,jsxs as qy}from"react/jsx-runtime";var Zt=({style:e,...t})=>qy("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:[Zd("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),Zd("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 Br=class extends st{constructor(o,r,n,i,a){super(a||"unknown",o,r,n);this.connectorType="injected";this.proxyProvider=new ue(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 Y("Unable to retrieve accounts");await this.syncAccounts([o[0]])}catch(o){throw Dt(o)}}},Fr,Hr=class extends st{constructor(o,r,n,i,a){super(a??"unknown",o,r,n);this.connectorType="injected";ki(this,Fr,void 0);this.proxyProvider=new ue(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0}),a==="metamask"?Bs(this,Fr,{name:"MetaMask",icon:Ur,id:"io.metamask"}):a==="phantom"&&Bs(this,Fr,{name:"Phantom",icon:Zt,id:"phantom"})}async connect(o){return o.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return Bc(this,Fr)??{name:"Browser Extension",icon:Dr,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 Y("Unable to retrieve accounts");await this.syncAccounts([o[0]])}catch(o){throw Dt(o)}}};Fr=new WeakMap;import{getAddress as IE}from"@ethersproject/address";import{Web3Provider as WE}from"@ethersproject/providers";import{isMobile as jy}from"react-device-detect";var Xi=class extends Br{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{jy||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 Y("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw Dt(t)}}};var ea=class extends st{constructor(o,r){super(o,[],r,{});this.connectorType="null";this.proxyProvider=new ue(void 0,nr);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 ta=class extends ea{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:Zt,id:"phantom"}}};import{EthereumProvider as fg,OPTIONAL_EVENTS as hg,OPTIONAL_METHODS as yg}from"@walletconnect/ethereum-provider";import{isMobile as gg}from"react-device-detect";import{createContext as ig,useContext as ag,useEffect as el,useRef as sg,useState as lg}from"react";import{jsx as Ky}from"react/jsx-runtime";function oa({src:e,...t}){return Ky("img",{src:e,...t,style:{display:"none"}})}import{useContext as vp,useEffect as gp,useMemo as tg,useState as og}from"react";import{createContext as rg}from"react";var bt={appearance:{theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:wd,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},captchaEnabled:!1,_render:{inDialog:!0,inParentNodeId:null},fiatOnRamp:{useSandbox:!1}};var Qd=({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 `loginMethodsAndOrder.primary`");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 Yy=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets"]),Xd=e=>Yy.has(e),ep=(e,t,o)=>o.indexOf(e)===t,tp=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Xd).filter(ep):e?e.filter(Xd).filter(ep):bt.appearance.walletList;var ra={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 na={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 ia={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 op={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 rp={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 aa={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 sa={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 la={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 np={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 ap={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 sp={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 lp={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 cp={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 dp={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 pp={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 ca={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 da={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 pa={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 ua={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 Nn={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 Dn={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 mp={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 ma={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 fa={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 ha={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 Un=[ra,na,ia,lp,mp,ca,da,pa,ua,Nn,Dn,np,ip,ap,sp,aa,sa,la,dp,pp,op,rp,ma,ha,fa,cp,up],X6=new Set(Un.map(e=>e.id));import lr from"tinycolor2";var fp="#FFFFFF",Jy="#000000",Zy=fp,Qy="#1E1E1D";function Xy(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 Oo(e,t){let o=Math.max(0,Math.min(1,e.toHsl().l+t));return lr({...e.toHsl(),l:o})}function hp({backgroundTheme:e,accentHex:t,successHex:o="#51BA81",warnHex:r="#FFB74D",errorHex:n="#EC6351",whiteHex:i=fp,blackHex:a=Jy}){let l;switch(e){case"light":l=Zy;break;case"dark":l=Qy;break;default:l=e;break}let s=lr(l),c=lr(t),u=lr(o),m=lr(r),h=lr(n),y=Xy(s.getLuminance()),C=Oo(s,y==="light"?-.04:.11),E=Oo(s,y==="light"?-.88:.87),T=Oo(s,y==="light"?-.77:.75),b=Oo(s,y==="light"?-.43:.45).desaturate(y==="light"?60:20),_=Oo(s,y==="light"?-.08:.25).desaturate(y==="light"?60:20),R=Oo(c,.15),I=Oo(c,-.06),x=lr(c.getLuminance()>.5?a:i),O=Oo(u,-.16);return{colorScheme:y,background:s.toHslString(),background2:C.toHslString(),foreground:E.toHslString(),foreground2:T.toHslString(),foreground3:b.toHslString(),foreground4:_.toHslString(),accent:c.toHslString(),accentLight:R.toHslString(),accentDark:I.toHslString(),foregroundAccent:x.toHslString(),success:u.toHslString(),successDark:O.toHslString(),error:h.toHslString(),warn:m.toHslString()}}function Zs(e,t,o){let r=o?console.warn:()=>{},n=["google","twitter","discord","spotify","tiktok","linkedin","github","apple","farcaster"],i=t?.loginMethods?.filter(j=>n.includes(j)),a,l,s,c,u,m,h,y,C,E,T,b;t?.loginMethods?(a=t.loginMethods.includes("email"),l=t.loginMethods.includes("sms"),s=t.loginMethods.includes("wallet"),c=i?.includes("google"),u=i?.includes("twitter"),m=i?.includes("discord"),y=i?.includes("spotify"),h=i?.includes("tiktok"),E=i?.includes("github"),C=i?.includes("linkedin"),T=i?.includes("apple"),b=i?.includes("farcaster")):(a=e.emailAuth,l=e.smsAuth,s=e.walletAuth,c=e.googleOAuth,u=e.twitterOAuth,m=e.discordOAuth,E=e.githubOAuth,y=e.spotifyOAuth,h=e.tiktokOAuth,C=e.linkedinOAuth,T=e.appleOAuth,b=e.farcasterAuth);let _=[a,l].filter(Boolean),R=[c,u,m,E,y,h,C,T,b].filter(Boolean),I=[s].filter(Boolean);if(_.length+R.length+I.length===0)throw new Error("You must enable at least one login method");let x=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;x&&I.length===0?(r("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),x=!1):!x&&R.length+_.length===0&&(r("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),x=!0),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 O=tp({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),N=Qd({input:t?.loginMethodsAndOrder}),F=t?.intl?.defaultCountry??"US",{chains:H,defaultChain:q}=eg({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),D=!!t?.defaultChain||!!t?.supportedChains,z=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,k,oe=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?z?k=t?.embeddedWallets?.noPromptOnSignature??!0:k=t?.embeddedWallets?.noPromptOnSignature??oe:k=oe,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&k!==!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??bt.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??bt.appearance.accentColor}),loginGroupPriority:x?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:O},loginMethods:{wallet:s,email:a,sms:l,google:c,twitter:u,discord:m,github:E,spotify:y,tiktok:h,linkedin:C,apple:T,farcaster:b},loginMethodsAndOrder:N,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??bt.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??bt.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??bt.rpcConfig.rpcTimeouts},chains:H,defaultChain:q,intl:{defaultCountry:F},shouldEnforceDefaultChainOnConnect:D,captchaEnabled:e.captchaEnabled??bt.captchaEnabled,captchaSiteKey:e.captchaSiteKey,embeddedWallets:{...e.embeddedWalletConfig,...z?{createOnLogin:"all-users",requireUserPasswordOnCreate:!1}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...t?.embeddedWallets,noPromptOnSignature:k},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:z?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??bt.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1},render:{inDialog:t?._render?.inDialog??bt._render.inDialog,inParentNodeId:t?._render?.inParentNodeId??bt._render.inParentNodeId}}}function yp(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 eg({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:Un.find(u=>u.id===s.id)??s)}else n=Un.concat(e??[]);let i=t?n[0]:ca,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}}import{jsx as ng}from"react/jsx-runtime";var wp={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:""},Qs=Zs(wp,void 0,!1),Xs=rg({appConfig:Qs,isServerConfigLoaded:!1}),Cp=({children:e,legacyCreateEmbeddedWalletFlag:t,client:o,clientConfig:r})=>{let[n,i]=og(null),a=tg(()=>Zs(n??wp,r,!!n),[n,r]);return gp(()=>{let l=yp(r,t);o.createAnalyticsEvent("sdk_initialize",l)},[r,t]),gp(()=>{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)}})()},[]),ng(Xs.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},ya=()=>{let{appConfig:e}=vp(Xs);return e},bp=()=>{let{isServerConfigLoaded:e}=vp(Xs);return e};var P=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import{jsx as dg,jsxs as pg}from"react/jsx-runtime";var Ep=ig({ready:!1,app:Qs,currentScreen:null,lastScreen:null,navigate:P,navigateBack:P,resetNavigation:P,setModalData:P,onUserCloseViaDialogOrKeybindRef:void 0}),cg=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Pp=e=>{let t=ya(),o=e.authenticated,[r,n]=lg(e.initialScreen);el(()=>{!o&&!cg.includes(e.initialScreen)&&e.setInitialScreen(null)},[o]);let i=sg(null);el(()=>{e.open||(i.current=null)},[e.open]),el(()=>{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 pg(Ep.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&dg(oa,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},S=()=>ag(Ep);import{jsx as Gr,jsxs as ug}from"react/jsx-runtime";var Fn=({style:e,...t})=>{let{app:o}=S();return ug("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:[Gr("rect",{width:"28",height:"28",rx:"3",fill:o?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),Gr("g",{clipPath:"url(#clip0_1765_9946)",children:Gr("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"})}),Gr("defs",{children:Gr("clipPath",{id:"clip0_1765_9946",children:Gr("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var ga=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[o,r]of Object.entries(Vr))if(t.includes(r.hostname))return{walletClientType:o,entry:r}};var Vr={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}}};function mg(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}var Tp=e=>e in Vr,xp=e=>{let t=Vr[e].mobile;if("native"in t)return t.native};function Sp(e,t){let o=mg(t);if(o.deepLink)return Ip(o.deepLink,e);if(o.universalLink)return Mp(o.universalLink,e);throw new w(`Unsupported wallet ${t.id}`)}var _p="WALLETCONNECT_DEEPLINK_CHOICE";function Ap(){try{localStorage.removeItem(_p)}catch{}}function kp({href:e,name:t}){try{localStorage.setItem(_p,JSON.stringify({href:e,name:t}))}catch{}}function Rp(e){return e.startsWith("http://")||e.startsWith("https://")}function Ip(e,t){if(Rp(e))return Mp(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 Mp(e,t){if(!Rp(e))return Ip(e,t);let o=e;o.endsWith("/")||(o=`${o}/`);let r=encodeURIComponent(t);return{redirect:`${o}wc?uri=${r}`,href:o}}function Wp(e,t){window.open(e,t,"noreferrer noopener")}var Qt=class extends st{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 ue(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=Vr[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=ga(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:Ur,id:"io.metamask"}:{name:Ud(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Fn,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=Vr[o],this.walletClientType=o,this.redirectUri=void 0,Ap(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((o,r)=>{let n=()=>{r(new Or)};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 Y("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=ga(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Nr(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),o()})().catch(a=>{if(a){r(Dt(a));return}r(new Y("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=Nt(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 fg.init({projectId:this.walletConnectCloudProjectId,chains:r,optionalChains:n,optionalEvents:hg,optionalMethods:yg,rpcMap:o,showQrModal:!1});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),gg&&this.walletEntry){let{redirect:l,href:s}=Sp(a,this.walletEntry);kp({href:s,name:this.walletEntry.displayName}),this.redirectUri=l,Wp(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=ga(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 tl=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses");return t?!!e?.linkedAccounts.filter(r=>r.type=="wallet"&&r.address===Lp(t)).length:!1},Nr=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||nr:nr,Bn=class extends vg{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 ue: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;ae.get(zs)&&(ae.getKeys().forEach(r=>{r.startsWith("walletconnect")&&ae.del(r)}),ae.del(zs));let o=Fd(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"),!Io()&&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.initializedWalletConnectors++,this.walletsReady=this.initializedWalletConnectors===this.walletConnectors.length,this.emit("walletsUpdated")}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 ji(o,r,this.rpcConfig,this.chains,n.id),l=new Qi(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 Qt&&i.resetConnection(r),i;let l=(()=>{if(o==="injected"){if(r==="metamask"&&n?.eip6963InjectedProvider)return new Xi(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(r==="metamask"&&n?.legacyInjectedProvider)return new Hr(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(r==="phantom"&&n?.legacyInjectedProvider)return new Hr(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&r==="unknown_browser_extension")return new Hr(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Br(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,r)}else return o==="coinbase_wallet"?new Ji(this.chains,this.defaultChain,this.rpcConfig):o==="phantom"?new ta(this.defaultChain):new Qt(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=ae.get($s);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}));ae.put($s,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=Lp(o),this.emit("walletsUpdated")}};function Ki(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}import{ofetch as wg}from"ofetch";var Cg=[Mi,Li,Wi],va=class{constructor(t,o,r){this.appId=t,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Hs,this.client=o,this.defaults=r,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=wg.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=!Cg.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 Ri}})}async get(t,o){try{return await this.baseFetch(t,o)}catch(r){throw ie(r)}}async post(t,o,r){try{return await this.baseFetch(t,{method:"POST",...o?{body:o}:{},...r})}catch(n){throw ie(n)}}async delete(t,o){try{return await this.baseFetch(t,{method:"DELETE",...o})}catch(r){throw ie(r)}}};import cr from"js-cookie";function Op(e){return e instanceof ko?"email":e instanceof ar?"sms":e instanceof ir?"siwe":e instanceof kr?"custom_auth":e instanceof Ro?e.meta.provider:null}import*as Np from"jose";var Xt=class{static parse(t){try{return new Xt(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Np.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 bg=30,wa=class{constructor(){this.authenticateOnce=new Ye(async t=>this._authenticate(t)),this.linkOnce=new Ye(async t=>this._link(t)),this.refreshOnce=new Ye(this._refresh.bind(this)),this.destroyOnce=new Ye(this._destroy.bind(this)),this.forkSessionOnce=new Ye(this._forkSession.bind(this))}get token(){try{let t=ae.get(rr);return typeof t=="string"?new Xt(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=ae.get(Ui);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=ae.get(Wn);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get mightHaveServerCookies(){try{let t=cr.get(Fi);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=Xt.parse(this.token);return t!==null&&!t.isExpired(bg)}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=Op(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:dt(n),isNewUser:i}}catch(o){throw console.warn("Error authenticating session"),Ke(o)}}async _link(t){try{let o=await t.link();return dt(o)}catch(o){throw console.warn("Error linking account"),Ke(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(Mi,a,{headers:i}),r&&this.clearForkedToken()}else if(r)n=await this.api.post(Li,{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(),dt(n.user)}catch(n){if(n instanceof Kt&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw Ke(n)}}async _destroy(){try{await this.api?.post(Wi,{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(Gc,{refresh_token:t});return this.storeToken(o.token),this.storeRefreshToken(o.refresh_token),o.new_session_refresh_token}catch(o){throw Ke(o)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null),this.clearForkedToken(),this.client?.onDeleteToken?.()}storeToken(t){if(typeof t=="string"){let o=ae.get(rr);if(ae.put(rr,t),o!==t&&this.client?.onStoreToken?.(t),!this.client?.useServerCookies){let r=Xt.parse(t)?.expiration;cr.set(Gs,t,{sameSite:"Strict",secure:!0,expires:r?new Date(r*1e3):void 0})}}else ae.del(rr),cr.remove(Gs)}storeRefreshToken(t){typeof t=="string"?(ae.put(Ui,t),this.client?.useServerCookies||(cr.set(Fi,"t",{sameSite:"Strict",secure:!0,expires:30}),cr.set(Vs,t,{sameSite:"Strict",secure:!0,expires:30}))):(ae.del(Ui),cr.remove(Vs),cr.remove(Fi))}clearForkedToken(){ae.del(Wn)}};var ol,Ca,Dp,Hn=class{constructor(t){ki(this,Ca);this.apiUrl=t.apiUrl||Di,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||Cd,this.appId=t.appId,this.clientAnalyticsId=Hc(this,Ca,Dp).call(this),ol||(ol=new wa),this.session=ol,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager(t,o,r,n,i,a,l){this.connectors||(this.connectors=new Bn(t,o,r,n,i,a,l))}generateApi(){let t=new va(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(td,{address:t});return dt(o)}catch(o){throw Ke(o)}}async acceptTerms(){try{let t=await this.api.post(md,{});return dt(t)}catch(t){throw Ke(t)}}async unlinkPhone(t){try{let o=await this.api.post(id,{phoneNumber:t});return dt(o)}catch(o){throw Ke(o)}}async unlinkWallet(t){try{let o=await this.api.post(qc,{address:t});return dt(o)}catch(o){throw Ke(o)}}async unlinkOAuth(t,o){try{let r=await this.api.post(dd,{provider:t,subject:o});return dt(r)}catch(r){throw Ke(r)}}async unlinkFarcaster(t){try{let o=await this.api.post(Zc,{fid:t});return dt(o)}catch(o){throw Ke(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(fd,{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 Ke(o)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?Xt.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 Ke(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()}};Ca=new WeakSet,Dp=function(){if(typeof window>"u")return null;try{let o=ae.get(Ln);if(typeof o=="string"&&o.length>0)return o}catch{}let t=Eg();try{return ae.put(Ln,t),t}catch{return t}};import{Turnstile as Ag}from"@marsidev/react-turnstile";import{useEffect as kg,useMemo as Rg}from"react";import{useMemo as Pg,useRef as Tg,useContext as xg,useState as rl,createContext as Sg}from"react";import{jsx as _g}from"react/jsx-runtime";var Up=Sg({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}),go=class extends De{constructor(o,r,n){super(o||"Captcha failed");this.type="Captcha";r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},Fp=({children:e,id:t,captchaSiteKey:o,captchaEnabled:r})=>{let n=Tg(null),[i,a]=rl(),[l,s]=rl(),[c,u]=rl(!1),m=Pg(()=>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 _g(Up.Provider,{value:{...m,ref:n,enabled:r,siteKey:o,appId:t,setToken:a,setError:s,setExecuting:u,remove(){r&&(n.current?.remove(),u(!1),s(void 0),a(void 0))},reset(){r&&(n.current?.reset(),u(!1),s(void 0),a(void 0))},execute(){r&&(u(!0),n.current?.execute())},async waitForResult(){if(!r)return"";try{return await Nd(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new go("Captcha failed",null,"captcha_timeout")}}},children:e})},ce=()=>xg(Up);import{jsx as Bp}from"react/jsx-runtime";var nl=e=>{let{enabled:t,siteKey:o,appId:r,setError:n,setToken:i,setExecuting:a,ref:l}=ce(),[,s]=Rg(()=>o?.split("t:")||[],[o]);if(kg(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return Bp("div",{className:"hidden h-0 w-0",children:Bp(Ag,{...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")}}})})};import{useCallback as zb,useEffect as cy,useRef as $b,useState as qb}from"react";import jb from"react-dom";import{createContext as Ig,useContext as Mg}from"react";var il=Ig({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,fundWallet:P,setReadyToTrue:P}),M=()=>Mg(il);import{createContext as Wg,useContext as Lg}from"react";var se=Wg({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,fundWallet:P,isModalOpen:!1}),G=()=>Lg(se);import{useEffect as Og,useState as Ng}from"react";var Hp=e=>{let[t,o]=Ng("auto");return Og(()=>{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};import{createContext as Dg,useContext as Ug,useEffect as Fg}from"react";var Gp={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:[]}},al=Dg(void 0),Vp=()=>Ug(al);function be(e,t){if(!t)return;let r=Vp().current[e];return Fg(()=>{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 B(e,t,o,...r){for(let n of e.current[t][o])n(...r)}function zp(){let e=Vp();return(t,o,...r)=>B(e,t,o,...r)}function sl(e){be("configureMfa",e)}import Xp from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import e1 from"@heroicons/react/24/solid/DocumentCheckIcon";import t1 from"styled-components";import pr,{css as pl}from"styled-components";import cl from"styled-components";import{Fragment as Hg,jsx as ll,jsxs as Gg}from"react/jsx-runtime";var No=({success:e,fail:t})=>Gg(Hg,{children:[ll(Et,{className:e?"success":t?"fail":""}),ll(dl,{className:e?"success":t?"fail":""})]}),Et=cl.span`
|
|
12
|
+
- https://privy.io`;this.getNonceOnce=new Ze(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 _("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(zc,{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 se(t)}}async link(){if(!this.api)throw new _("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign();return await this.api.post($c,{message:t,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw se(t)}}async sign(){if(!this.api)throw new _("Auth flow has no API instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new _("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 _("Auth flow has no API instance");let t=this.wallet.address;return(await this.api.post(Vc,{address:t,token:this.captchaToken})).nonce}async buildSiweMessage(){if(!this.api)throw new _("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 sr=class{constructor(t,o){this.meta={phoneNumber:t,captchaToken:o}}async authenticate(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new _("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(ad,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw se(t)}}async link(){if(!this.api)throw new _("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new _("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(nd,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw se(t)}}async sendSmsCode(t,o){if(!this.api)throw new _("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),o&&(this.meta.captchaToken=o),!this.meta.phoneNumber)throw new _("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(rd,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(r){throw se(r)}}};import{v4 as bg}from"uuid";function Xe(e){return new Date(e*1e3)}function Iy(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:Xe(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:Xe(o.verified_at)};t.push(i);break;case"phone":let a={number:o.phoneNumber,type:o.type,verifiedAt:Xe(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:Xe(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:Xe(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:Xe(o.verified_at)};t.push(c);break;case"discord_oauth":let u={subject:o.subject,username:o.username,email:o.email,type:o.type,verifiedAt:Xe(o.verified_at)};t.push(u);break;case"github_oauth":let m={subject:o.subject,username:o.username,name:o.name,email:o.email,type:o.type,verifiedAt:Xe(o.verified_at)};t.push(m);break;case"tiktok_oauth":let v={subject:o.subject,username:o.username,name:o.name,type:o.type,verifiedAt:Xe(o.verified_at)};t.push(v);break;case"linkedin_oauth":let h={subject:o.subject,name:o.name,email:o.email,type:o.type,verifiedAt:Xe(o.verified_at)};t.push(h);break;case"apple_oauth":let w={subject:o.subject,email:o.email,type:o.type,verifiedAt:Xe(o.verified_at)};t.push(w);break;case"custom_auth":t.push({type:o.type,customUserId:o.custom_user_id,verifiedAt:Xe(o.verified_at)});break;case"farcaster":let b={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:Xe(o.verified_at)};t.push(b);break;default:console.warn(`Unrecognized account type: ${r}. Please consider upgrading the Privy SDK.`)}}return t}function Ct(e,t){return e.sort((o,r)=>r.verifiedAt.getTime()-o.verifiedAt.getTime()),e.find(o=>o.type===t)}var me=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy")||null,My=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),bt=(e,t)=>t==="all-users"&&!me(e)||t==="users-without-wallets"&&!My(e)?.length;function ut(e){if(!e)return null;let t=Iy(e.linked_accounts),o=Ct(t,"wallet"),r=Ct(t,"email"),n=Ct(t,"phone"),i=Ct(t,"google_oauth"),a=Ct(t,"twitter_oauth"),l=Ct(t,"discord_oauth"),s=Ct(t,"github_oauth"),c=Ct(t,"spotify_oauth"),u=Ct(t,"tiktok_oauth"),m=Ct(t,"linkedin_oauth"),v=Ct(t,"apple_oauth"),h=Ct(t,"farcaster"),w=e.mfa_methods.map(({type:x,verified_at:C})=>({type:x,verifiedAt:Xe(C)}));return{id:e.id,createdAt:Xe(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:u&&{subject:u.subject,username:u.username,name:u.name},linkedin:m&&{subject:m.subject,name:m.name,email:m.email},apple:v&&{subject:v.subject,email:v.email},farcaster:h&&{fid:h.fid,ownerAddress:h.ownerAddress,displayName:h.displayName,username:h.username,bio:h.bio,pfp:h.pfp,url:h.url},mfaMethods:w.map(x=>x.type),hasAcceptedTerms:e.has_accepted_terms??!1}}import{getAddress as Lp}from"@ethersproject/address";import gg from"eventemitter3";function Md(){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 Vi=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 Js=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Vi(e)!=="MetaMask")return!1;if(e.providers){for(let o of e.providers)if(!Js(o))return!1}return!0},Mo=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Wd=()=>{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 Ld=(e,t)=>{let o=[],r=[];for(let[n,i]of e.entries())n<t?o.push(i):r.push(i);return[o,r]},zi=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,}))$/),Od=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},Wo=(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}`},Zs=e=>new Promise(t=>setTimeout(t,e));function Nd(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 Dd=(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 Zs(o)}a||i(new Error("Exceeded max attempts before resolving function"))})},$i=(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 Ud=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),lr=e=>typeof e=="string"?e:"0x"+e.toString(16);async function Fd(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 Md()){let u=Vi(c);if(!l.some(m=>m.info.name===u)){if(Js(c,!0)&&!s.find(m=>m.type==="metamask")){s.push({type:"metamask",legacyInjectedProvider:c});continue}if(u==="Phantom"&&!s.find(m=>m.type==="phantom")){s.push({type:"phantom",legacyInjectedProvider:c});continue}s.find(m=>m.type==="unknown_browser_extension")||s.push({type:"unknown_browser_extension",legacyInjectedProvider:c})}}i(s)}})}function Mr(e){return`eip155:${String(Number(e))}`}var Ft=(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]+"/"+Di:n.rpcUrls.blast?.http[0]?i=n.rpcUrls.blast.http[0]+"/"+vd:i=n.rpcUrls.default?.http[0],!i)throw new Z(`No RPC url found for ${e}`);return i},Bd=(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},qi=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}}};import Gy from"@coinbase/wallet-sdk";import{jsx as Hd,jsxs as Wy}from"react/jsx-runtime";var ji=({style:e,...t})=>Wy("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:[Hd("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),Hd("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});import{getAddress as Qt}from"@ethersproject/address";import{Web3Provider as Kd}from"@ethersproject/providers";import{default as By}from"eventemitter3";import{StaticJsonRpcProvider as Vd}from"@ethersproject/providers";import Fy from"eventemitter3";var Ly=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Gd=e=>Ly.includes(e);import{ErrorCode as Oy}from"@ethersproject/logger";var Wr=class extends Z{constructor(){super("Wallet timeout");this.type="wallet_error"}},Lr=class extends Z{constructor(){super("User rejected connection");this.type="wallet_error"}},Bt=e=>{if(e instanceof Z)return e;if(e?.code&&e?.reason){let t=new ve(e);return e.code===Oy.ACTION_REJECTED&&(t.details=Fe.E4001_USER_REJECTED_REQUEST),t}return e?.code?new ve(e):new Z("Unknown connector error",e)},Et=class extends Ue{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},ve=class extends Et{constructor(o){let r=o;super(r.message,r.code,r.data);let n=Object.values(Fe).find(i=>i.eipCode===r.code);this.details=n||Fe.UNKNOWN_ERROR,r.code===-32002&&(r.message?.includes("already pending for origin")?r.message?.includes("wallet_requestPermissions")?this.details=Fe.E32002_CONNECTION_ALREADY_PENDING:this.details=Fe.E32002_REQUEST_ALREADY_PENDING:r.message?.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=Fe.E32002_WALLET_LOCKED))}},Ny={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}},Dy={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}},Uy={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}},Fe={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...Uy,...Dy},wo={...Ny,...Fe};var fe=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 Wr,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||ir,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 Bt(o)})}},Lo=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},Ki=class extends Fy{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 Vd(Ft(a,this.chains,n)),this.rpcTimeoutDuration=Or(n,"privy")}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new Lo(`Invalid params for ${o.method}`,4200);let r=o.params[0];if(!await Ae()||!this.address)throw new Lo("Disconnected",4900);return(await qd(r)).hash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new Lo(`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 Lo(`Invalid params for ${o.method}`,4200);this.chainId=Number(r),this.provider=new Vd(Ft(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 zd(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 $d(qi(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:lr(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 lr(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(Gd(o.method)){let r=await Ae();if(await jd(),!r||!this.address)throw new Lo("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 Lo("Disconnected",4900)}}else return this.provider.send(o.method,o.params)}async connect(){let o=await Ae();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}}},Zt=class extends fe{constructor(o){super(o,o.rpcTimeoutDuration)}},Oo=class extends fe{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 Hy=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},st=class extends By{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=Mr(o),this.walletClientType==="privy"&&le.put(Hi(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=Or(i,o),this.connected=!1,this.initialized=!1}buildConnectedWallet(o,r,n){let i=async()=>!!this.wallets.find(a=>Qt(a.address)===Qt(o));return{address:Qt(o),chainId:r,meta:n,switchChain:async a=>{if(!i)throw new Z("Wallet is not currently connected.");let l=this.wallets.find(v=>Qt(v.address)===Qt(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===Mr(s))return;let u=this.chains.find(v=>v.id===c);if(!u)throw new Z(`Unsupported chainId: ${a}`);let m=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})};try{return await m()}catch(v){if(Hy(v,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:s,chainName:u.name,nativeCurrency:u.nativeCurrency,rpcUrls:[u.rpcUrls.default?.http[0]??""],blockExplorerUrls:[u.blockExplorers?.default.url??""]}]}),m();throw this.walletClientType==="rainbow"&&v.message?.includes("wallet_switchEthereumChain")?new Z(`Rainbow does not support the chainId ${r}`):v}},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 Kd(new Zt(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new Z("Wallet is not currently connected.");return new Oo(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=Qt(n),a=[],l;if(this.walletClientType==="privy"){let c=le.get(Hi(i));this.chains.find(u=>u.id===Number(c))||(le.del(Hi(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 ${js}`,c),l=js}let s=Mr(l);if(!a.find(c=>Qt(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(Qt(n),s,c))}Yi(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=>Qt(n)===Qt(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 Kd(new Zt(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 Vy=e=>{let t=`https://mainnet.infura.io/v3/${Di}`,o=1;return e.makeWeb3Provider(t,o)},Ji,Zi=class extends st{constructor(o,r,n){super("coinbase_wallet",o,r,n);this.connectorType="coinbase_wallet";this.proxyProvider=new fe(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),Ji||(Ji=new Gy({appName:"Privy",darkMode:!1,headlessMode:!1,enableMobileWalletLink:!0})),this.proxyProvider.setWalletProvider(Vy(Ji)),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(){Ji.disconnect(),this.onDisconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:ji,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 Bt(o)}}};import{jsx as Yd}from"react/jsx-runtime";var Qi=({...e})=>Yd("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:Yd("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 Xi=class extends st{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:[lr(o?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Qi,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};import{jsx as Jd}from"react/jsx-runtime";var Nr=({style:e,...t})=>Jd("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:Jd("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});import{jsx as mt,jsxs as zy}from"react/jsx-runtime";var Dr=({style:e,...t})=>zy("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:[mt("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),mt("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),mt("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"}),mt("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"}),mt("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"}),mt("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"}),mt("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"}),mt("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"}),mt("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"}),mt("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"}),mt("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"}),mt("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"}),mt("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});import{jsx as Zd,jsxs as $y}from"react/jsx-runtime";var Xt=({style:e,...t})=>$y("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:[Zd("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),Zd("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 Fr=class extends st{constructor(o,r,n,i,a){super(a||"unknown",o,r,n);this.connectorType="injected";this.proxyProvider=new fe(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 Bt(o)}}},Ur,Br=class extends st{constructor(o,r,n,i,a){super(a??"unknown",o,r,n);this.connectorType="injected";Ri(this,Ur,void 0);this.proxyProvider=new fe(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0}),a==="metamask"?Hs(this,Ur,{name:"MetaMask",icon:Dr,id:"io.metamask"}):a==="phantom"&&Hs(this,Ur,{name:"Phantom",icon:Xt,id:"phantom"})}async connect(o){return o.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return Bc(this,Ur)??{name:"Browser Extension",icon:Nr,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 Bt(o)}}};Ur=new WeakMap;import{getAddress as M5}from"@ethersproject/address";import{Web3Provider as L5}from"@ethersproject/providers";import{isMobile as qy}from"react-device-detect";var ea=class extends Fr{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{qy||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 Bt(t)}}};var ta=class extends st{constructor(o,r){super(o,[],r,{});this.connectorType="null";this.proxyProvider=new fe(void 0,ir);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 oa=class extends ta{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:Xt,id:"phantom"}}};import{EthereumProvider as mg,OPTIONAL_EVENTS as fg,OPTIONAL_METHODS as hg}from"@walletconnect/ethereum-provider";import{isMobile as yg}from"react-device-detect";import{createContext as ng,useContext as ig,useEffect as tl,useRef as ag,useState as sg}from"react";import{jsx as jy}from"react/jsx-runtime";function ra({src:e,...t}){return jy("img",{src:e,...t,style:{display:"none"}})}import{useContext as vp,useEffect as gp,useMemo as eg,useState as tg}from"react";import{createContext as og}from"react";var Pt={appearance:{theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:wd,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},captchaEnabled:!1,_render:{inDialog:!0,inParentNodeId:null},fiatOnRamp:{useSandbox:!1}};var Qd=({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 `loginMethodsAndOrder.primary`");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 Ky=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets"]),Xd=e=>Ky.has(e),ep=(e,t,o)=>o.indexOf(e)===t,tp=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Xd).filter(ep):e?e.filter(Xd).filter(ep):Pt.appearance.walletList;var na={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 ia={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 aa={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 op={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 rp={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 sa={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 la={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 ca={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 np={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 ap={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 sp={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 lp={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 cp={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 dp={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 pp={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 da={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 pa={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 ua={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 ma={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 Un={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 Fn={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 mp={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 fa={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 ha={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 ya={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 Bn=[na,ia,aa,lp,mp,da,pa,ua,ma,Un,Fn,np,ip,ap,sp,sa,la,ca,dp,pp,op,rp,fa,ya,ha,cp,up],e7=new Set(Bn.map(e=>e.id));import cr from"tinycolor2";var fp="#FFFFFF",Yy="#000000",Jy=fp,Zy="#1E1E1D";function Qy(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 No(e,t){let o=Math.max(0,Math.min(1,e.toHsl().l+t));return cr({...e.toHsl(),l:o})}function hp({backgroundTheme:e,accentHex:t,successHex:o="#51BA81",warnHex:r="#FFB74D",errorHex:n="#EC6351",whiteHex:i=fp,blackHex:a=Yy}){let l;switch(e){case"light":l=Jy;break;case"dark":l=Zy;break;default:l=e;break}let s=cr(l),c=cr(t),u=cr(o),m=cr(r),v=cr(n),h=Qy(s.getLuminance()),w=No(s,h==="light"?-.04:.11),b=No(s,h==="light"?-.88:.87),x=No(s,h==="light"?-.77:.75),C=No(s,h==="light"?-.43:.45).desaturate(h==="light"?60:20),T=No(s,h==="light"?-.08:.25).desaturate(h==="light"?60:20),L=No(c,.15),I=No(c,-.06),S=cr(c.getLuminance()>.5?a:i),U=No(u,-.16);return{colorScheme:h,background:s.toHslString(),background2:w.toHslString(),foreground:b.toHslString(),foreground2:x.toHslString(),foreground3:C.toHslString(),foreground4:T.toHslString(),accent:c.toHslString(),accentLight:L.toHslString(),accentDark:I.toHslString(),foregroundAccent:S.toHslString(),success:u.toHslString(),successDark:U.toHslString(),error:v.toHslString(),warn:m.toHslString()}}function Qs(e,t,o){let r=o?console.warn:()=>{},n=["google","twitter","discord","spotify","tiktok","linkedin","github","apple","farcaster"],i=t?.loginMethods?.filter(oe=>n.includes(oe)),a,l,s,c,u,m,v,h,w,b,x,C;t?.loginMethods?(a=t.loginMethods.includes("email"),l=t.loginMethods.includes("sms"),s=t.loginMethods.includes("wallet"),c=i?.includes("google"),u=i?.includes("twitter"),m=i?.includes("discord"),h=i?.includes("spotify"),v=i?.includes("tiktok"),b=i?.includes("github"),w=i?.includes("linkedin"),x=i?.includes("apple"),C=i?.includes("farcaster")):(a=e.emailAuth,l=e.smsAuth,s=e.walletAuth,c=e.googleOAuth,u=e.twitterOAuth,m=e.discordOAuth,b=e.githubOAuth,h=e.spotifyOAuth,v=e.tiktokOAuth,w=e.linkedinOAuth,x=e.appleOAuth,C=e.farcasterAuth);let T=[a,l].filter(Boolean),L=[c,u,m,b,h,v,w,x,C].filter(Boolean),I=[s].filter(Boolean);if(T.length+L.length+I.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&&I.length===0?(r("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),S=!1):!S&&L.length+T.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),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 U=tp({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),P=Qd({input:t?.loginMethodsAndOrder}),F=t?.intl?.defaultCountry??"US",{chains:R,defaultChain:q}=Xy({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),ce=!!t?.defaultChain||!!t?.supportedChains,H=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,V,j=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?H?V=t?.embeddedWallets?.noPromptOnSignature??!0:V=t?.embeddedWallets?.noPromptOnSignature??j:V=j,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&V!==!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??Pt.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Pt.appearance.accentColor}),loginGroupPriority:S?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:U},loginMethods:{wallet:s,email:a,sms:l,google:c,twitter:u,discord:m,github:b,spotify:h,tiktok:v,linkedin:w,apple:x,farcaster:C},loginMethodsAndOrder:P,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Pt.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Pt.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Pt.rpcConfig.rpcTimeouts},chains:R,defaultChain:q,intl:{defaultCountry:F},shouldEnforceDefaultChainOnConnect:ce,captchaEnabled:e.captchaEnabled??Pt.captchaEnabled,captchaSiteKey:e.captchaSiteKey,embeddedWallets:{...e.embeddedWalletConfig,...H?{createOnLogin:"all-users",requireUserPasswordOnCreate:!1}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...t?.embeddedWallets,noPromptOnSignature:V},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:H?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??Pt.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1},render:{inDialog:t?._render?.inDialog??Pt._render.inDialog,inParentNodeId:t?._render?.inParentNodeId??Pt._render.inParentNodeId}}}function yp(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 Xy({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:Bn.find(u=>u.id===s.id)??s)}else n=Bn.concat(e??[]);let i=t?n[0]:da,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}}import{jsx as rg}from"react/jsx-runtime";var wp={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:""},Xs=Qs(wp,void 0,!1),el=og({appConfig:Xs,isServerConfigLoaded:!1}),Cp=({children:e,legacyCreateEmbeddedWalletFlag:t,client:o,clientConfig:r})=>{let[n,i]=tg(null),a=eg(()=>Qs(n??wp,r,!!n),[n,r]);return gp(()=>{let l=yp(r,t);o.createAnalyticsEvent("sdk_initialize",l)},[r,t]),gp(()=>{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)}})()},[]),rg(el.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},ga=()=>{let{appConfig:e}=vp(el);return e},bp=()=>{let{isServerConfigLoaded:e}=vp(el);return e};var E=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import{jsx as cg,jsxs as dg}from"react/jsx-runtime";var Ep=ng({ready:!1,app:Xs,currentScreen:null,lastScreen:null,navigate:E,navigateBack:E,resetNavigation:E,setModalData:E,onUserCloseViaDialogOrKeybindRef:void 0}),lg=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Pp=e=>{let t=ga(),o=e.authenticated,[r,n]=sg(e.initialScreen);tl(()=>{!o&&!lg.includes(e.initialScreen)&&e.setInitialScreen(null)},[o]);let i=ag(null);tl(()=>{e.open||(i.current=null)},[e.open]),tl(()=>{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 dg(Ep.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&cg(ra,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},A=()=>ig(Ep);import{jsx as Hr,jsxs as pg}from"react/jsx-runtime";var Hn=({style:e,...t})=>{let{app:o}=A();return pg("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:[Hr("rect",{width:"28",height:"28",rx:"3",fill:o?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),Hr("g",{clipPath:"url(#clip0_1765_9946)",children:Hr("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"})}),Hr("defs",{children:Hr("clipPath",{id:"clip0_1765_9946",children:Hr("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var va=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[o,r]of Object.entries(Gr))if(t.includes(r.hostname))return{walletClientType:o,entry:r}};var Gr={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}}};function ug(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}var Tp=e=>e in Gr,xp=e=>{let t=Gr[e].mobile;if("native"in t)return t.native};function Sp(e,t){let o=ug(t);if(o.deepLink)return Ip(o.deepLink,e);if(o.universalLink)return Mp(o.universalLink,e);throw new _(`Unsupported wallet ${t.id}`)}var _p="WALLETCONNECT_DEEPLINK_CHOICE";function Ap(){try{localStorage.removeItem(_p)}catch{}}function kp({href:e,name:t}){try{localStorage.setItem(_p,JSON.stringify({href:e,name:t}))}catch{}}function Rp(e){return e.startsWith("http://")||e.startsWith("https://")}function Ip(e,t){if(Rp(e))return Mp(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 Mp(e,t){if(!Rp(e))return Ip(e,t);let o=e;o.endsWith("/")||(o=`${o}/`);let r=encodeURIComponent(t);return{redirect:`${o}wc?uri=${r}`,href:o}}function Wp(e,t){window.open(e,t,"noreferrer noopener")}var eo=class extends st{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 fe(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=Gr[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=va(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:Dr,id:"io.metamask"}:{name:Ud(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Hn,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=Gr[o],this.walletClientType=o,this.redirectUri=void 0,Ap(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((o,r)=>{let n=()=>{r(new Lr)};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=va(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Or(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),o()})().catch(a=>{if(a){r(Bt(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=Ft(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 mg.init({projectId:this.walletConnectCloudProjectId,chains:r,optionalChains:n,optionalEvents:fg,optionalMethods:hg,rpcMap:o,showQrModal:!1});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),yg&&this.walletEntry){let{redirect:l,href:s}=Sp(a,this.walletEntry);kp({href:s,name:this.walletEntry.displayName}),this.redirectUri=l,Wp(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=va(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 ol=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses");return t?!!e?.linkedAccounts.filter(r=>r.type=="wallet"&&r.address===Lp(t)).length:!1},Or=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||ir:ir,Gn=class extends gg{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 fe: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;le.get($s)&&(le.getKeys().forEach(r=>{r.startsWith("walletconnect")&&le.del(r)}),le.del($s));let o=Fd(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"),!Mo()&&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.initializedWalletConnectors++,this.walletsReady=this.initializedWalletConnectors===this.walletConnectors.length,this.emit("walletsUpdated")}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 Ki(o,r,this.rpcConfig,this.chains,n.id),l=new Xi(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 eo&&i.resetConnection(r),i;let l=(()=>{if(o==="injected"){if(r==="metamask"&&n?.eip6963InjectedProvider)return new ea(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(r==="metamask"&&n?.legacyInjectedProvider)return new Br(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(r==="phantom"&&n?.legacyInjectedProvider)return new Br(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&r==="unknown_browser_extension")return new Br(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Fr(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,r)}else return o==="coinbase_wallet"?new Zi(this.chains,this.defaultChain,this.rpcConfig):o==="phantom"?new oa(this.defaultChain):new eo(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=le.get(qs);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}));le.put(qs,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=Lp(o),this.emit("walletsUpdated")}};function Yi(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}import{ofetch as vg}from"ofetch";var wg=[Wi,Oi,Li],wa=class{constructor(t,o,r){this.appId=t,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Gs,this.client=o,this.defaults=r,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=vg.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=!wg.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 Ii}})}async get(t,o){try{return await this.baseFetch(t,o)}catch(r){throw se(r)}}async post(t,o,r){try{return await this.baseFetch(t,{method:"POST",...o?{body:o}:{},...r})}catch(n){throw se(n)}}async delete(t,o){try{return await this.baseFetch(t,{method:"DELETE",...o})}catch(r){throw se(r)}}};import dr from"js-cookie";function Op(e){return e instanceof Ro?"email":e instanceof sr?"sms":e instanceof ar?"siwe":e instanceof Ar?"custom_auth":e instanceof Io?e.meta.provider:null}import*as Np from"jose";var to=class{static parse(t){try{return new to(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Np.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 Cg=30,Ca=class{constructor(){this.authenticateOnce=new Ze(async t=>this._authenticate(t)),this.linkOnce=new Ze(async t=>this._link(t)),this.refreshOnce=new Ze(this._refresh.bind(this)),this.destroyOnce=new Ze(this._destroy.bind(this)),this.forkSessionOnce=new Ze(this._forkSession.bind(this))}get token(){try{let t=le.get(nr);return typeof t=="string"?new to(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=le.get(Fi);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=le.get(On);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get mightHaveServerCookies(){try{let t=dr.get(Bi);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=to.parse(this.token);return t!==null&&!t.isExpired(Cg)}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=Op(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:ut(n),isNewUser:i}}catch(o){throw console.warn("Error authenticating session"),Je(o)}}async _link(t){try{let o=await t.link();return ut(o)}catch(o){throw console.warn("Error linking account"),Je(o)}}async _refresh(){if(!this.api)throw new _("Session has no API instance");if(!this.client)throw new _("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(Wi,a,{headers:i}),r&&this.clearForkedToken()}else if(r)n=await this.api.post(Oi,{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(),ut(n.user)}catch(n){if(n instanceof Jt&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw Je(n)}}async _destroy(){try{await this.api?.post(Li,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new _("Session has no API instance");let t=this.refreshToken;try{let o=await this.api.post(Gc,{refresh_token:t});return this.storeToken(o.token),this.storeRefreshToken(o.refresh_token),o.new_session_refresh_token}catch(o){throw Je(o)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null),this.clearForkedToken(),this.client?.onDeleteToken?.()}storeToken(t){if(typeof t=="string"){let o=le.get(nr);if(le.put(nr,t),o!==t&&this.client?.onStoreToken?.(t),!this.client?.useServerCookies){let r=to.parse(t)?.expiration;dr.set(Vs,t,{sameSite:"Strict",secure:!0,expires:r?new Date(r*1e3):void 0})}}else le.del(nr),dr.remove(Vs)}storeRefreshToken(t){typeof t=="string"?(le.put(Fi,t),this.client?.useServerCookies||(dr.set(Bi,"t",{sameSite:"Strict",secure:!0,expires:30}),dr.set(zs,t,{sameSite:"Strict",secure:!0,expires:30}))):(le.del(Fi),dr.remove(zs),dr.remove(Bi))}clearForkedToken(){le.del(On)}};var rl,ba,Dp,Vn=class{constructor(t){Ri(this,ba);this.apiUrl=t.apiUrl||Ui,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||Cd,this.appId=t.appId,this.clientAnalyticsId=Hc(this,ba,Dp).call(this),rl||(rl=new Ca),this.session=rl,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager(t,o,r,n,i,a,l){this.connectors||(this.connectors=new Gn(t,o,r,n,i,a,l))}generateApi(){let t=new wa(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 _("No auth flow in progress.");return this.session.authenticate(this.authFlow)}link(){if(!this.authFlow)throw new _("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(td,{address:t});return ut(o)}catch(o){throw Je(o)}}async acceptTerms(){try{let t=await this.api.post(md,{});return ut(t)}catch(t){throw Je(t)}}async unlinkPhone(t){try{let o=await this.api.post(id,{phoneNumber:t});return ut(o)}catch(o){throw Je(o)}}async unlinkWallet(t){try{let o=await this.api.post(qc,{address:t});return ut(o)}catch(o){throw Je(o)}}async unlinkOAuth(t,o){try{let r=await this.api.post(dd,{provider:t,subject:o});return ut(r)}catch(r){throw Je(r)}}async unlinkFarcaster(t){try{let o=await this.api.post(Zc,{fid:t});return ut(o)}catch(o){throw Je(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(fd,{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 Je(o)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?to.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 Je(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()}};ba=new WeakSet,Dp=function(){if(typeof window>"u")return null;try{let o=le.get(Nn);if(typeof o=="string"&&o.length>0)return o}catch{}let t=bg();try{return le.put(Nn,t),t}catch{return t}};import{Turnstile as _g}from"@marsidev/react-turnstile";import{useEffect as Ag,useMemo as kg}from"react";import{useMemo as Eg,useRef as Pg,useContext as Tg,useState as nl,createContext as xg}from"react";import{jsx as Sg}from"react/jsx-runtime";var Up=xg({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:E,setError:E,setExecuting:E,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:E,reset:E,execute:E}),Co=class extends Ue{constructor(o,r,n){super(o||"Captcha failed");this.type="Captcha";r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},Fp=({children:e,id:t,captchaSiteKey:o,captchaEnabled:r})=>{let n=Pg(null),[i,a]=nl(),[l,s]=nl(),[c,u]=nl(!1),m=Eg(()=>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 Sg(Up.Provider,{value:{...m,ref:n,enabled:r,siteKey:o,appId:t,setToken:a,setError:s,setExecuting:u,remove(){r&&(n.current?.remove(),u(!1),s(void 0),a(void 0))},reset(){r&&(n.current?.reset(),u(!1),s(void 0),a(void 0))},execute(){r&&(u(!0),n.current?.execute())},async waitForResult(){if(!r)return"";try{return await Nd(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new Co("Captcha failed",null,"captcha_timeout")}}},children:e})},pe=()=>Tg(Up);import{jsx as Bp}from"react/jsx-runtime";var il=e=>{let{enabled:t,siteKey:o,appId:r,setError:n,setToken:i,setExecuting:a,ref:l}=pe(),[,s]=kg(()=>o?.split("t:")||[],[o]);if(Ag(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return Bp("div",{className:"hidden h-0 w-0",children:Bp(_g,{...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")}}})})};import{useCallback as Vb,useEffect as cy,useRef as zb,useState as $b}from"react";import qb from"react-dom";import{createContext as Rg,useContext as Ig}from"react";var al=Rg({isNewUserThisSession:!1,linkingHint:null,walletConnectionStatus:null,mipdStore:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,nativeTokenSymbolForChainId:E,initializeWalletProxy:E,getAuthMeta:E,getAuthFlow:E,closePrivyModal:E,openPrivyModal:E,connectWallet:E,initLoginWithWallet:E,loginWithWallet:E,initLoginWithFarcaster:E,loginWithFarcaster:E,loginWithCode:E,initLoginWithEmail:E,initLoginWithSms:E,initUpdateEmail:E,resendEmailCode:E,resendSmsCode:E,initLoginWithOAuth:E,loginWithOAuth:E,refreshUser:E,walletProxy:null,createAnalyticsEvent:E,acceptTerms:E,getUsdTokenPrice:E,recoverEmbeddedWallet:E,getFiatOnRampConfig:E,updateWallets:E,fundWallet:E,setReadyToTrue:E}),W=()=>Ig(al);import{createContext as Mg,useContext as Wg}from"react";var ae=Mg({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:E,login:E,connectOrCreateWallet:E,linkEmail:E,linkPhone:E,linkFarcaster:E,linkWallet:E,linkGoogle:E,linkTwitter:E,linkDiscord:E,linkGithub:E,linkSpotify:E,linkTiktok:E,linkLinkedIn:E,linkApple:E,updateEmail:E,logout:E,getAccessToken:E,getEthereumProvider:E,getEthersProvider:E,getWeb3jsProvider:E,unlinkEmail:E,unlinkPhone:E,unlinkWallet:E,unlinkGoogle:E,unlinkTwitter:E,unlinkDiscord:E,unlinkGithub:E,unlinkSpotify:E,unlinkTiktok:E,unlinkLinkedIn:E,unlinkApple:E,unlinkFarcaster:E,setActiveWallet:E,forkSession:E,createWallet:E,signMessage:E,signTypedData:E,enrollInMfa:E,initEnrollmentWithSms:E,initEnrollmentWithTotp:E,promptMfa:E,init:E,submitEnrollmentWithSms:E,submitEnrollmentWithTotp:E,unenroll:E,submit:E,cancel:E,sendTransaction:E,exportWallet:E,setWalletPassword:E,initLoginWithEmail:E,initLoginWithSms:E,loginWithCode:E,fundWallet:E,isModalOpen:!1}),B=()=>Wg(ae);import{useEffect as Lg,useState as Og}from"react";var Hp=e=>{let[t,o]=Og("auto");return Lg(()=>{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};import{createContext as Ng,useContext as Dg,useEffect as Ug}from"react";var Gp={login:{onComplete:[],onError:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]}},sl=Ng(void 0),Vp=()=>Dg(sl);function ye(e,t){if(!t)return;let r=Vp().current[e];return Ug(()=>{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 N(e,t,o,...r){for(let n of e.current[t][o])n(...r)}function zp(){let e=Vp();return(t,o,...r)=>N(e,t,o,...r)}function ll(e){ye("configureMfa",e)}import Xp from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import Xg from"@heroicons/react/24/solid/DocumentCheckIcon";import e1 from"styled-components";import ur,{css as ul}from"styled-components";import dl from"styled-components";import{Fragment as Bg,jsx as cl,jsxs as Hg}from"react/jsx-runtime";var Do=({success:e,fail:t})=>Hg(Bg,{children:[cl(Tt,{className:e?"success":t?"fail":""}),cl(pl,{className:e?"success":t?"fail":""})]}),Tt=dl.span`
|
|
13
13
|
&& {
|
|
14
14
|
width: 82px;
|
|
15
15
|
height: 82px;
|
|
@@ -42,13 +42,13 @@ Resources:
|
|
|
42
42
|
border-color: var(--privy-color-error);
|
|
43
43
|
border-bottom-color: var(--privy-color-error);
|
|
44
44
|
}
|
|
45
|
-
`,dl
|
|
45
|
+
`,pl=dl(Tt)`
|
|
46
46
|
&& {
|
|
47
47
|
border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
|
|
48
48
|
animation: none;
|
|
49
49
|
opacity: 0.5;
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
51
|
+
`,pr=e=>cl(Fg,{color:e.color||"var(--privy-color-foreground-3)"}),Fg=dl(Tt)`
|
|
52
52
|
&& {
|
|
53
53
|
height: 0.9rem;
|
|
54
54
|
width: 0.9rem;
|
|
@@ -57,7 +57,7 @@ Resources:
|
|
|
57
57
|
/* Override default Loader to match button transitions */
|
|
58
58
|
transition: border-color 200ms ease;
|
|
59
59
|
}
|
|
60
|
-
`;import{jsx as
|
|
60
|
+
`;import{jsx as xt,jsxs as xa}from"react/jsx-runtime";var Ea=ur.button`
|
|
61
61
|
display: flex;
|
|
62
62
|
flex-direction: row;
|
|
63
63
|
align-items: center;
|
|
@@ -85,13 +85,13 @@ Resources:
|
|
|
85
85
|
color: var(--privy-color-foreground-3);
|
|
86
86
|
cursor: not-allowed;
|
|
87
87
|
}
|
|
88
|
-
`,
|
|
89
|
-
${e=>e.hideAnimations&&
|
|
88
|
+
`,D=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>xt($p,{disabled:t||o,...n,children:t?xa("span",{children:[xt(pr,{}),r?xt("span",{children:r}):null]}):e}),pT=ur(D)`
|
|
89
|
+
${e=>e.hideAnimations&&ul`
|
|
90
90
|
&& {
|
|
91
91
|
transition: none;
|
|
92
92
|
}
|
|
93
93
|
`}
|
|
94
|
-
`,
|
|
94
|
+
`,Pa=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>xt($p,{as:"a",disabled:t||o,...n,children:t?xa("span",{children:[xt(pr,{}),r?xt("span",{children:r}):null]}):e}),$p=ur(Ea)`
|
|
95
95
|
position: relative;
|
|
96
96
|
|
|
97
97
|
&& {
|
|
@@ -117,7 +117,7 @@ Resources:
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
/* If an anchor tag, :disabled isn't a thing, so manually set state */
|
|
120
|
-
${e=>e.disabled?
|
|
120
|
+
${e=>e.disabled?ul`
|
|
121
121
|
&&&,
|
|
122
122
|
&&&:hover,
|
|
123
123
|
&&&:active {
|
|
@@ -136,7 +136,7 @@ Resources:
|
|
|
136
136
|
opacity: 1;
|
|
137
137
|
animation: fadein 200ms ease;
|
|
138
138
|
}
|
|
139
|
-
`,
|
|
139
|
+
`,Ht=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>xt(Gg,{disabled:t||o,...n,children:t?xa("span",{children:[xt(pr,{}),r?xt("span",{children:r}):null]}):e}),Gg=ur(Ea)`
|
|
140
140
|
&& {
|
|
141
141
|
border-width: 1px;
|
|
142
142
|
border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"};
|
|
@@ -165,7 +165,7 @@ Resources:
|
|
|
165
165
|
opacity: 1;
|
|
166
166
|
animation: fadein 200ms ease;
|
|
167
167
|
}
|
|
168
|
-
`,
|
|
168
|
+
`,Ta=ur.button`
|
|
169
169
|
&& {
|
|
170
170
|
padding: 12px 16px;
|
|
171
171
|
font-weight: 500;
|
|
@@ -178,7 +178,7 @@ Resources:
|
|
|
178
178
|
transition: opacity 200ms ease, background-color 200ms ease, color 200ms ease;
|
|
179
179
|
user-select: none;
|
|
180
180
|
|
|
181
|
-
${e=>e.invisible&&
|
|
181
|
+
${e=>e.invisible&&ul`
|
|
182
182
|
pointer-events: none;
|
|
183
183
|
`}
|
|
184
184
|
|
|
@@ -196,10 +196,10 @@ Resources:
|
|
|
196
196
|
cursor: not-allowed;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
`,
|
|
199
|
+
`,uT=ur.div`
|
|
200
200
|
/* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
|
|
201
201
|
height: 44px;
|
|
202
|
-
`,
|
|
202
|
+
`,Vr=({children:e,onClick:t,disabled:o,isSubmitting:r,...n})=>xa(Vg,{isSubmitting:r,onClick:t,disabled:o,...n,children:[xt("span",{children:e}),xt("span",{children:xt(pr,{})})]}),Vg=ur.button`
|
|
203
203
|
&& {
|
|
204
204
|
color: var(--privy-color-accent);
|
|
205
205
|
font-size: 16px;
|
|
@@ -241,7 +241,7 @@ Resources:
|
|
|
241
241
|
cursor: not-allowed;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
`;import qp from"styled-components";import{Fragment as
|
|
244
|
+
`;import qp from"styled-components";import{Fragment as zg,jsx as Uo,jsxs as jp}from"react/jsx-runtime";var ml=qp.div`
|
|
245
245
|
margin-top: 16px;
|
|
246
246
|
font-size: 13px;
|
|
247
247
|
text-align: center;
|
|
@@ -250,7 +250,7 @@ Resources:
|
|
|
250
250
|
&& > a {
|
|
251
251
|
color: var(--privy-color-accent);
|
|
252
252
|
}
|
|
253
|
-
`;function
|
|
253
|
+
`;function zr(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:o,requireUsersAcceptTerms:r}}=e.app;if(r&&!e.alwaysShowImplicitConsent)return Uo(ml,{});if(!o&&!t)return Uo(ml,{});let n=!!(t&&o);return jp(ml,{children:["By logging in I agree to the"," ",o&&Uo("a",{href:o,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&Uo("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var G=({protectedByPrivy:e})=>Uo(te,{children:e?jp(zg,{children:[Uo(Qi,{className:"hide-on-mobile"}),Uo("span",{className:"hide-on-mobile",children:Uo("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})})]}):null}),te=qp.div`
|
|
254
254
|
display: flex;
|
|
255
255
|
align-items: center;
|
|
256
256
|
justify-content: center;
|
|
@@ -277,7 +277,7 @@ Resources:
|
|
|
277
277
|
@media all and (display-mode: standalone) {
|
|
278
278
|
padding-bottom: 30px;
|
|
279
279
|
}
|
|
280
|
-
`;import
|
|
280
|
+
`;import $g from"@heroicons/react/24/outline/ArrowLeftIcon";import qg from"@heroicons/react/24/outline/XMarkIcon";import fl from"styled-components";import{jsx as St,jsxs as Zg}from"react/jsx-runtime";var Kp=()=>St("div",{}),jg=({backFn:e})=>St("div",{children:St(Yp,{onClick:e,children:St($g,{height:"16px",width:"16px",strokeWidth:2})})}),Kg=e=>St("div",{children:St(Yp,{"aria-label":"close modal",onClick:e.onClose,children:St(qg,{height:"16px",width:"16px",strokeWidth:2})})});var k=({backFn:e,onClose:t,title:o,closeable:r=!0})=>{let{closePrivyModal:n}=W(),{app:i}=A();return Zg(Yg,{children:[e?St(jg,{backFn:e}):St(Kp,{}),o&&St(Jg,{id:"privy-dialog-title",children:o}),i?.render.inDialog&&r?St(Kg,{onClose:t||(()=>n())}):St(Kp,{})]})},Yp=fl.button`
|
|
281
281
|
&& {
|
|
282
282
|
cursor: pointer;
|
|
283
283
|
display: flex;
|
|
@@ -296,7 +296,7 @@ Resources:
|
|
|
296
296
|
opacity: 1;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
`,
|
|
299
|
+
`,Yg=fl.div`
|
|
300
300
|
padding: 16px 0;
|
|
301
301
|
display: flex;
|
|
302
302
|
align-items: center;
|
|
@@ -318,22 +318,22 @@ Resources:
|
|
|
318
318
|
display: flex;
|
|
319
319
|
justify-content: flex-end;
|
|
320
320
|
}
|
|
321
|
-
`,
|
|
321
|
+
`,Jg=fl.div`
|
|
322
322
|
overflow: hidden;
|
|
323
323
|
white-space: nowrap;
|
|
324
324
|
max-width: 100%;
|
|
325
325
|
text-overflow: ellipsis;
|
|
326
326
|
text-align: center;
|
|
327
327
|
color: var(--privy-color-foreground-2);
|
|
328
|
-
`;import
|
|
328
|
+
`;import $r,{css as Qg}from"styled-components";var Sa=$r.div`
|
|
329
329
|
text-align: left;
|
|
330
330
|
flex-grow: 1;
|
|
331
|
-
`,
|
|
331
|
+
`,_a=$r.div`
|
|
332
332
|
display: flex;
|
|
333
333
|
flex-direction: column;
|
|
334
334
|
justify-content: flex-end;
|
|
335
335
|
flex-grow: 1;
|
|
336
|
-
`,
|
|
336
|
+
`,_t=$r.div`
|
|
337
337
|
display: flex;
|
|
338
338
|
flex-direction: column;
|
|
339
339
|
gap: 12px;
|
|
@@ -348,7 +348,7 @@ Resources:
|
|
|
348
348
|
&::-webkit-scrollbar {
|
|
349
349
|
display: none;
|
|
350
350
|
}
|
|
351
|
-
`,Jp=
|
|
351
|
+
`,Jp=Qg`
|
|
352
352
|
&& {
|
|
353
353
|
width: 100%;
|
|
354
354
|
font-size: 16px;
|
|
@@ -386,14 +386,14 @@ Resources:
|
|
|
386
386
|
max-width: 24px;
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
`,
|
|
389
|
+
`,we=$r.button`
|
|
390
390
|
${Jp}
|
|
391
|
-
`,
|
|
391
|
+
`,hl=$r.a`
|
|
392
392
|
${Jp}
|
|
393
|
-
`,
|
|
393
|
+
`,bo=$r.div`
|
|
394
394
|
width: 100%;
|
|
395
395
|
${e=>e.if?"display: none;":""}
|
|
396
|
-
`;import ke from"styled-components";var
|
|
396
|
+
`;import ke from"styled-components";var Be=ke.div`
|
|
397
397
|
display: flex;
|
|
398
398
|
flex-direction: column;
|
|
399
399
|
align-items: center;
|
|
@@ -401,17 +401,17 @@ Resources:
|
|
|
401
401
|
@media (max-width: 440px) {
|
|
402
402
|
padding: 10px 10px 20px;
|
|
403
403
|
}
|
|
404
|
-
`,
|
|
404
|
+
`,Ce=ke.div`
|
|
405
405
|
font-size: 18px;
|
|
406
406
|
line-height: 18px;
|
|
407
407
|
text-align: center;
|
|
408
408
|
font-weight: 600;
|
|
409
409
|
margin-bottom: 10px;
|
|
410
|
-
`,
|
|
410
|
+
`,he=ke.div`
|
|
411
411
|
font-size: 0.875rem;
|
|
412
412
|
|
|
413
413
|
text-align: center;
|
|
414
|
-
`,
|
|
414
|
+
`,Fo=ke.div`
|
|
415
415
|
display: flex;
|
|
416
416
|
flex-direction: column;
|
|
417
417
|
align-items: center;
|
|
@@ -429,7 +429,7 @@ Resources:
|
|
|
429
429
|
padding: 1rem 0rem 0rem;
|
|
430
430
|
flex-grow: 1;
|
|
431
431
|
width: 100%;
|
|
432
|
-
`,
|
|
432
|
+
`,yl=ke.div`
|
|
433
433
|
width: 25px;
|
|
434
434
|
display: flex;
|
|
435
435
|
align-items: center;
|
|
@@ -441,19 +441,19 @@ Resources:
|
|
|
441
441
|
width: 25px !important;
|
|
442
442
|
color: var(--privy-color-accent);
|
|
443
443
|
}
|
|
444
|
-
`,
|
|
444
|
+
`,gl=ke.div`
|
|
445
445
|
display: flex;
|
|
446
446
|
align-items: center;
|
|
447
447
|
gap: 10px;
|
|
448
448
|
font-size: 0.875rem;
|
|
449
449
|
line-height: 1rem;
|
|
450
450
|
text-align: left;
|
|
451
|
-
`,
|
|
451
|
+
`,Bo=ke.div`
|
|
452
452
|
display: flex;
|
|
453
453
|
flex-direction: column;
|
|
454
454
|
gap: 10px;
|
|
455
455
|
padding-top: 20px;
|
|
456
|
-
`,
|
|
456
|
+
`,Aa=ke.div`
|
|
457
457
|
display: flex;
|
|
458
458
|
flex-direction: column;
|
|
459
459
|
align-items: stretch;
|
|
@@ -461,7 +461,7 @@ Resources:
|
|
|
461
461
|
padding: 1rem 0rem 0rem;
|
|
462
462
|
flex-grow: 1;
|
|
463
463
|
width: 100%;
|
|
464
|
-
`,
|
|
464
|
+
`,ka=ke.div`
|
|
465
465
|
display: flex;
|
|
466
466
|
gap: 5px;
|
|
467
467
|
width: 100%;
|
|
@@ -469,7 +469,7 @@ Resources:
|
|
|
469
469
|
& > button:not(#remove) {
|
|
470
470
|
width: 100%;
|
|
471
471
|
}
|
|
472
|
-
`,
|
|
472
|
+
`,vl=ke.button`
|
|
473
473
|
&& {
|
|
474
474
|
background-color: transparent;
|
|
475
475
|
color: var(--privy-color-foreground-3);
|
|
@@ -488,7 +488,7 @@ Resources:
|
|
|
488
488
|
&&:hover {
|
|
489
489
|
color: var(--privy-color-error);
|
|
490
490
|
}
|
|
491
|
-
`,
|
|
491
|
+
`,Ra=ke.div`
|
|
492
492
|
display: flex;
|
|
493
493
|
align-items: center;
|
|
494
494
|
gap: 0.5rem;
|
|
@@ -498,7 +498,7 @@ Resources:
|
|
|
498
498
|
height: 20px !important;
|
|
499
499
|
width: 20px !important;
|
|
500
500
|
}
|
|
501
|
-
`,
|
|
501
|
+
`,qr=ke.div`
|
|
502
502
|
display: flex;
|
|
503
503
|
align-items: center;
|
|
504
504
|
gap: 6px;
|
|
@@ -512,7 +512,7 @@ Resources:
|
|
|
512
512
|
display: flex !important;
|
|
513
513
|
align-items: flex-end;
|
|
514
514
|
}
|
|
515
|
-
`,
|
|
515
|
+
`,Ia=ke.div`
|
|
516
516
|
width: 100%;
|
|
517
517
|
display: flex;
|
|
518
518
|
justify-content: space-between;
|
|
@@ -520,7 +520,7 @@ Resources:
|
|
|
520
520
|
text-align: left;
|
|
521
521
|
width: 100%;
|
|
522
522
|
color: var(--privy-color-foreground-3) !important;
|
|
523
|
-
`,
|
|
523
|
+
`,wl=ke.button`
|
|
524
524
|
display: flex;
|
|
525
525
|
flex-direction: row;
|
|
526
526
|
align-items: center;
|
|
@@ -550,7 +550,7 @@ Resources:
|
|
|
550
550
|
&:hover {
|
|
551
551
|
text-decoration: underline;
|
|
552
552
|
}
|
|
553
|
-
`,
|
|
553
|
+
`,et=ke.div`
|
|
554
554
|
display: flex;
|
|
555
555
|
align-items: center;
|
|
556
556
|
justify-content: center;
|
|
@@ -565,10 +565,10 @@ Resources:
|
|
|
565
565
|
width: auto !important;
|
|
566
566
|
color: white;
|
|
567
567
|
}
|
|
568
|
-
`;import{Fragment as
|
|
568
|
+
`;import{Fragment as r1,jsx as oo,jsxs as zn}from"react/jsx-runtime";var eu=()=>{let{user:e,logout:t}=B(),{app:o,onUserCloseViaDialogOrKeybindRef:r,setModalData:n,navigate:i}=A(),{acceptTerms:a,closePrivyModal:l}=W(),s=u=>{u?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};r.current=s;let c=async u=>{u.preventDefault(),await a(),e&&bt(e,o?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:m=>console.error(m),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return oo(t1,{termsAndConditionsUrl:o?.legal.termsAndConditionsUrl,privacyPolicyUrl:o?.legal.privacyPolicyUrl,onAccept:c,onDecline:s})},t1=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:o,onDecline:r})=>zn(r1,{children:[oo(k,{closeable:!1}),oo(Xg,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),oo(Ce,{style:{marginTop:24},children:"One last step"}),oo(he,{children:"By signing up, you agree to our terms and privacy policy."}),zn(_t,{style:{marginTop:24},children:[e&&zn(hl,{target:"_blank",href:e,children:["View Terms ",oo(Xp,{style:{marginLeft:"auto"}})]}),t&&zn(hl,{target:"_blank",href:t,children:["View Privacy Policy ",oo(Xp,{style:{marginLeft:"auto"}})]})]}),zn(o1,{style:{marginTop:24},children:[oo(Ht,{onClick:r,children:"No thanks"}),oo(D,{onClick:o,children:"Accept"})]}),oo(G,{protectedByPrivy:!0})]}),o1=e1.div`
|
|
569
569
|
display: flex;
|
|
570
570
|
gap: 10px;
|
|
571
|
-
`;import
|
|
571
|
+
`;import bl from"styled-components";import n1 from"styled-components";var Ma=n1.span`
|
|
572
572
|
&& {
|
|
573
573
|
width: 82px;
|
|
574
574
|
height: 82px;
|
|
@@ -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
|
-
`;import{jsx as tu}from"react/jsx-runtime";var
|
|
586
|
+
`;import{jsx as tu}from"react/jsx-runtime";var Wa=({style:e,...t})=>tu("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:tu("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});import{Fragment as Cl,jsx as ro,jsxs as La}from"react/jsx-runtime";var ou=()=>{let{navigate:e,app:t}=A(),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 La(Cl,{children:[ro(k,{}),La(i1,{children:[ro(s1,{children:La("div",{children:[ro(Ma,{}),ro(Wa,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),La(a1,{children:[typeof o=="string"?ro("h3",{children:o}):ro(Cl,{children:o}),typeof r=="string"?ro("p",{children:r}):ro(Cl,{children:r})]}),t?.allowlistConfig.errorCtaLink?ro(D,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):ro(D,{onClick:()=>{e("LANDING")},children:n})]})]})},i1=bl.div`
|
|
587
587
|
display: flex;
|
|
588
588
|
flex-direction: column;
|
|
589
589
|
align-items: center;
|
|
@@ -591,11 +591,11 @@ Resources:
|
|
|
591
591
|
gap: 24px;
|
|
592
592
|
width: 100%;
|
|
593
593
|
padding-bottom: 16px;
|
|
594
|
-
`,
|
|
594
|
+
`,a1=bl.div`
|
|
595
595
|
display: flex;
|
|
596
596
|
flex-direction: column;
|
|
597
597
|
gap: 8px;
|
|
598
|
-
`,
|
|
598
|
+
`,s1=bl.div`
|
|
599
599
|
display: flex;
|
|
600
600
|
flex-direction: column;
|
|
601
601
|
justify-content: center;
|
|
@@ -618,7 +618,7 @@ Resources:
|
|
|
618
618
|
left: -19px;
|
|
619
619
|
top: -19px;
|
|
620
620
|
}
|
|
621
|
-
`;import
|
|
621
|
+
`;import d1 from"@heroicons/react/24/outline/EnvelopeIcon";import p1 from"@heroicons/react/24/outline/PhoneIcon";import{useEffect as cu,useState as Na}from"react";import{isMobile as u1}from"react-device-detect";import jn from"styled-components";import ft from"styled-components";var At=ft.div`
|
|
622
622
|
display: flex;
|
|
623
623
|
flex-direction: column;
|
|
624
624
|
align-items: flex-start;
|
|
@@ -626,36 +626,36 @@ Resources:
|
|
|
626
626
|
margin-top: auto;
|
|
627
627
|
gap: 16px;
|
|
628
628
|
flex-grow: 100;
|
|
629
|
-
`,
|
|
629
|
+
`,kt=ft.div`
|
|
630
630
|
display: flex;
|
|
631
631
|
flex-direction: column;
|
|
632
632
|
align-items: center;
|
|
633
633
|
justify-content: center;
|
|
634
634
|
flex-grow: 1;
|
|
635
635
|
width: 100%;
|
|
636
|
-
`,ru=
|
|
636
|
+
`,ru=ft.div`
|
|
637
637
|
display: flex;
|
|
638
638
|
flex-direction: column;
|
|
639
639
|
align-items: center;
|
|
640
640
|
width: 100%;
|
|
641
|
-
`,
|
|
641
|
+
`,Oa=ft(kt)`
|
|
642
642
|
padding: 20px 0;
|
|
643
|
-
`,
|
|
643
|
+
`,Gt=ft(kt)`
|
|
644
644
|
gap: 16px;
|
|
645
|
-
`,
|
|
645
|
+
`,El=ft.div`
|
|
646
646
|
display: flex;
|
|
647
647
|
flex-direction: column;
|
|
648
648
|
width: 100%;
|
|
649
|
-
`,
|
|
649
|
+
`,Rt=ft.div`
|
|
650
650
|
display: flex;
|
|
651
651
|
flex-direction: column;
|
|
652
652
|
gap: 8px;
|
|
653
|
-
`,
|
|
653
|
+
`,r8=ft.div`
|
|
654
654
|
display: flex;
|
|
655
655
|
flex-direction: column;
|
|
656
656
|
justify-content: space-between;
|
|
657
657
|
height: 100%;
|
|
658
|
-
`,nu=
|
|
658
|
+
`,nu=ft.div`
|
|
659
659
|
display: flex;
|
|
660
660
|
flex-direction: column;
|
|
661
661
|
justify-content: flex-start;
|
|
@@ -678,13 +678,13 @@ Resources:
|
|
|
678
678
|
color: var(--privy-color-foreground-3);
|
|
679
679
|
font-size: 14px;
|
|
680
680
|
}
|
|
681
|
-
`,
|
|
681
|
+
`,Q=ft.div`
|
|
682
682
|
height: 16px;
|
|
683
|
-
`,
|
|
683
|
+
`,X=ft.div`
|
|
684
684
|
height: 12px;
|
|
685
|
-
`,iu=
|
|
685
|
+
`,iu=ft.div`
|
|
686
686
|
position: relative;
|
|
687
|
-
`,au=
|
|
687
|
+
`,au=ft.div`
|
|
688
688
|
background-color: var(--privy-color-accent);
|
|
689
689
|
display: flex;
|
|
690
690
|
justify-content: center;
|
|
@@ -692,9 +692,9 @@ Resources:
|
|
|
692
692
|
border-radius: 50%;
|
|
693
693
|
border-color: white;
|
|
694
694
|
border-width: 2px !important;
|
|
695
|
-
`;import
|
|
695
|
+
`;import Pl from"styled-components";import{Fragment as c1,jsx as $n,jsxs as lu}from"react/jsx-runtime";var qn=({title:e,description:t,children:o,...r})=>$n(su,{...r,children:lu(c1,{children:[$n("h3",{children:e}),typeof t=="string"?$n("p",{children:t}):t,o]})}),no=Pl(qn)`
|
|
696
696
|
margin-bottom: 24px;
|
|
697
|
-
`,
|
|
697
|
+
`,be=({title:e,description:t,icon:o,children:r,...n})=>lu(l1,{...n,children:[o||null,$n("h3",{children:e}),typeof t=="string"?$n("p",{children:t}):t,r]}),su=Pl.div`
|
|
698
698
|
display: flex;
|
|
699
699
|
flex-direction: column;
|
|
700
700
|
justify-content: flex-start;
|
|
@@ -714,7 +714,7 @@ Resources:
|
|
|
714
714
|
color: var(--privy-color-foreground-2);
|
|
715
715
|
font-size: 14px;
|
|
716
716
|
}
|
|
717
|
-
`,
|
|
717
|
+
`,l1=Pl(su)`
|
|
718
718
|
align-items: center;
|
|
719
719
|
text-align: center;
|
|
720
720
|
gap: 16px;
|
|
@@ -722,7 +722,7 @@ Resources:
|
|
|
722
722
|
h3 {
|
|
723
723
|
margin-bottom: 24px;
|
|
724
724
|
}
|
|
725
|
-
`;import{Fragment as
|
|
725
|
+
`;import{Fragment as Tl,jsx as He,jsxs as Ho}from"react/jsx-runtime";var xl=6,du=new Array(xl).fill(""),m1=1400;var uu=()=>{let{app:e,navigate:t,navigateBack:o,setModalData:r,onUserCloseViaDialogOrKeybindRef:n}=A(),{closePrivyModal:i,resendEmailCode:a,resendSmsCode:l,getAuthMeta:s,loginWithCode:c,updateWallets:u}=W(),{authenticated:m,user:v}=B(),[h,w]=Na(du),[b,x]=Na(!1),[C,T]=Na(null),[L,I]=Na(null);n.current=()=>null;let S=s()?.email?0:1,U=e?.render.inDialog?Qe:0,P=e?.render.inDialog?U-500:0;cu(()=>{if(m&&b&&v){if(e?.legal.requireUsersAcceptTerms&&!v.hasAcceptedTerms){let V=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},P);return()=>clearTimeout(V)}if(bt(v,e?.embeddedWallets?.createOnLogin)){let V=setTimeout(()=>{r({createWallet:{onSuccess:()=>{},onFailure:j=>console.error(j),callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},P);return()=>clearTimeout(V)}else{u();let V=setTimeout(()=>i({shouldCallAuthOnSuccess:!0,isSuccess:!0}),U);return()=>clearTimeout(V)}}},[m,b,v]),cu(()=>{if(C&&L===0){let H=setTimeout(()=>{w(du),T(null),document.querySelector("input[name=code-0]")?.focus()},m1);return()=>clearTimeout(H)}},[C]);let F=H=>{H.preventDefault();let V=H.currentTarget.value.replace(" ","");if(V==="")return;if(isNaN(Number(V))){T("Code should be numeric"),I(1);return}T(null),I(null);let j=Number(H.currentTarget.name?.charAt(5)),ne=[...V||[""]].slice(0,xl-j),oe=[...h.slice(0,j),...ne,...h.slice(j+ne.length)];w(oe);let $e=ne.length,wt=Math.min(Math.max(j+$e,0),xl-1);isNaN(Number(H.currentTarget.value))||document.querySelector(`input[name=code-${wt}]`)?.focus(),oe.every(it=>it&&!isNaN(+it))&&(document.querySelector(`input[name=code-${wt}]`)?.blur(),c(oe.join("")).then(()=>x(!0)).catch(qe=>{qe?.status===422?T("Invalid or expired verification code"):qe instanceof Jt&&qe.privyErrorCode==="cannot_link_more_of_type"?T(qe.message):T("Issue verifying code"),I(0)}))},R=H=>{L===1&&(T(null),I(null));let V=[...h.slice(0,H),"",...h.slice(H+1)];w(V),H>0&&document.querySelector(`input[name=code-${H-1}]`)?.focus()},q=S==0?He(d1,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):He(p1,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),ce=S==0?Ho("p",{children:["Please check ",He(pu,{children:s()?.email})," for an email from privy.io and enter your code below."]}):Ho("p",{children:["Please check ",He(pu,{children:s()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return Ho(Tl,{children:[He(k,{backFn:()=>o()},"header"),Ho(f1,{children:[He(be,{title:"Enter confirmation code",description:ce,icon:q}),Ho(ru,{children:[Ho(h1,{children:[He(y1,{fail:!!C,success:b,children:He("span",{children:C||(b?"Success!":"")})}),He("div",{children:h.map((H,V)=>He("input",{name:`code-${V}`,type:"text",value:h[V],onChange:F,onKeyUp:j=>{j.key==="Backspace"&&R(V)},inputMode:"numeric",autoFocus:V===0,pattern:"[0-9]",className:`${b?"success":""} ${C?"fail":""}`,autoComplete:u1?"one-time-code":"off"},V))})]}),He(g1,{children:S==0?Ho(Tl,{children:[He("span",{children:"Didn't get an email?"}),He("button",{onClick:a,children:"Resend code"})]}):Ho(Tl,{children:[He("span",{children:"Didn't get a message?"}),He("button",{onClick:l,children:"Resend code"})]})})]})]}),He(G,{protectedByPrivy:!0})]})},f1=jn.div`
|
|
726
726
|
display: flex;
|
|
727
727
|
flex-direction: column;
|
|
728
728
|
align-items: flex-start;
|
|
@@ -730,7 +730,7 @@ Resources:
|
|
|
730
730
|
margin: auto;
|
|
731
731
|
gap: 16px;
|
|
732
732
|
flex-grow: 1;
|
|
733
|
-
`,
|
|
733
|
+
`,h1=jn.div`
|
|
734
734
|
display: flex;
|
|
735
735
|
flex-direction: column;
|
|
736
736
|
width: 100%;
|
|
@@ -786,7 +786,7 @@ Resources:
|
|
|
786
786
|
transform: translate(1px, 0px);
|
|
787
787
|
}
|
|
788
788
|
}
|
|
789
|
-
`,
|
|
789
|
+
`,y1=jn.div`
|
|
790
790
|
line-height: 20px;
|
|
791
791
|
height: 20px;
|
|
792
792
|
font-size: 13px;
|
|
@@ -794,7 +794,7 @@ Resources:
|
|
|
794
794
|
display: flex;
|
|
795
795
|
justify-content: flex-end;
|
|
796
796
|
width: 100%;
|
|
797
|
-
`,
|
|
797
|
+
`,g1=jn.div`
|
|
798
798
|
font-size: 13px;
|
|
799
799
|
color: var(--privy-color-foreground-3);
|
|
800
800
|
display: flex;
|
|
@@ -808,10 +808,10 @@ Resources:
|
|
|
808
808
|
> button {
|
|
809
809
|
text-decoration: underline;
|
|
810
810
|
}
|
|
811
|
-
`,pu
|
|
811
|
+
`,pu=jn.span`
|
|
812
812
|
font-weight: 500;
|
|
813
813
|
word-break: break-all;
|
|
814
|
-
`;import
|
|
814
|
+
`;import E1 from"@heroicons/react/24/solid/CheckCircleIcon";import P1 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as Sl,useRef as T1,useState as Kr}from"react";import x1 from"styled-components";import v1 from"styled-components";import{Fragment as b1,jsx as jr,jsxs as C1}from"react/jsx-runtime";var mu=({icon:e})=>{let t=e;return jr(b1,{children:jr(w1,{children:C1("div",{children:[jr(Do,{}),typeof t=="string"?jr("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?jr(t,{style:{width:"38px",height:"38px"}}):jr("span",{})]})})})},w1=v1.div`
|
|
815
815
|
display: flex;
|
|
816
816
|
flex-direction: column;
|
|
817
817
|
justify-content: center;
|
|
@@ -834,14 +834,14 @@ Resources:
|
|
|
834
834
|
left: -19px;
|
|
835
835
|
top: -19px;
|
|
836
836
|
}
|
|
837
|
-
`;import{Fragment as
|
|
837
|
+
`;import{Fragment as _1,jsx as Vt,jsxs as _l}from"react/jsx-runtime";var hu=500,fu=hu*2,yu=()=>{let{lastScreen:e,currentScreen:t,data:o,navigateBack:r,navigate:n,setModalData:i}=A(),{status:a,token:l,waitForResult:s,reset:c,execute:u}=pe(),m=T1([]),v=H=>{m.current=[H,...m.current]},[h,w]=Kr(!0);Sl(()=>{let H=setTimeout(w,fu,!1);return v(H),()=>{m.current.forEach(V=>clearTimeout(V)),m.current=[]}},[]);let[b,x]=Kr(""),[C,T]=Kr("Checking that you are a human..."),[L,I]=Kr(Vt(D,{onClick:()=>{},disabled:!0,children:"Continue"})),[S,U]=Kr(!1),[P,F]=Kr(3),R=o?.captchaModalData,q=async H=>{try{await R?.callback(H),R?.onSuccessNavigateTo&&n(R?.onSuccessNavigateTo,!1)}catch(V){if(V instanceof Co)return;{let j={error:V,previousScreen:e||"LANDING"};i({errorModalData:j}),n(R?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};Sl(()=>{if(a==="success"){let H=setTimeout(async()=>{let V=await s();!V||R?.userIntentRequired||q(V)},fu);v(H)}else if(a==="ready"){let H=setTimeout(()=>{a==="ready"&&u()},hu);v(H)}},[a]),Sl(()=>{if(!h)switch(a){case"success":x("Success!"),T("CAPTCHA passed successfully."),I(Vt(D,{onClick:()=>{U(!0),q(l)},disabled:!R?.userIntentRequired,loading:S,children:R?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":x(""),T("Checking that you are a human..."),I(Vt(D,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":x("Something went wrong"),P<=0?(T("If you use an adblocker or VPN, try disabling and re-attempting."),I(null)):(T("You did not pass CAPTCHA. Please try again."),I(Vt(D,{onClick:ce,children:"Retry"})));break;case"ready":default:break}},[a,h,S]);let ce=async()=>{if(P<=0)return;F(V=>V-1),c(),u();let H=await s();!H||R?.userIntentRequired||q(H)};return _l(_1,{children:[Vt(k,{backFn:!e||t===e?void 0:r}),_l(S1,{children:[a==="success"?Vt(E1,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?Vt(P1,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):Vt(mu,{}),_l(Rt,{children:[b?Vt("h3",{children:b}):null,Vt("p",{children:C})]}),L]}),Vt(te,{})]})},S1=x1.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
|
-
`;import k1 from"@heroicons/react/24/outline/WalletIcon";import{isMobile as R1}from"react-device-detect";import I1 from"styled-components";import{jsx as Ht,jsxs as gu}from"react/jsx-runtime";var vu=({...e})=>gu("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[Ht("defs",{children:gu("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:[Ht("stop",{offset:"0",stopColor:"#f1562b"}),Ht("stop",{offset:"0.3",stopColor:"#f1542b"}),Ht("stop",{offset:"0.41",stopColor:"#f04d2a"}),Ht("stop",{offset:"0.49",stopColor:"#ef4229"}),Ht("stop",{offset:"0.5",stopColor:"#ef4029"}),Ht("stop",{offset:"0.56",stopColor:"#e83e28"}),Ht("stop",{offset:"0.67",stopColor:"#e13c26"}),Ht("stop",{offset:"1",stopColor:"#df3c26"})]})}),Ht("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"}),Ht("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});import{jsx as Gt,jsxs as qn}from"react/jsx-runtime";var wu=({style:e,...t})=>qn("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[Gt("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),Gt("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:Gt("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),qn("g",{mask:"url(#mask0_16909_31415)",children:[Gt("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),Gt("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),Gt("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),Gt("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),qn("defs",{children:[qn("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[Gt("stop",{"stop-color":"#002D72"}),Gt("stop",{offset:"1","stop-color":"#002D72","stop-opacity":"0.01"})]}),qn("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[Gt("stop",{"stop-color":"#002D72","stop-opacity":"0.01"}),Gt("stop",{offset:"1","stop-color":"#002D72"})]})]})]});import{jsx as K,jsxs as mt}from"react/jsx-runtime";var Cu=({style:e,...t})=>mt("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:[K("g",{clipPath:"url(#clip0_5_32)",children:mt("g",{clipPath:"url(#clip1_5_32)",children:[K("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:K("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"})}),K("g",{mask:"url(#mask0_5_32)",children:K("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),K("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)"}),K("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),K("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),K("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),K("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),K("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),K("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)"}),K("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),K("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),mt("defs",{children:[mt("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[K("stop",{stopColor:"#174299"}),K("stop",{offset:"1",stopColor:"#001E59"})]}),mt("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[K("stop",{offset:"0.770277",stopColor:"#FF4000"}),K("stop",{offset:"1",stopColor:"#8754C9"})]}),mt("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[K("stop",{stopColor:"#FF4000"}),K("stop",{offset:"1",stopColor:"#8754C9"})]}),mt("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[K("stop",{stopColor:"#8754C9"}),K("stop",{offset:"1",stopColor:"#FF4000"})]}),mt("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[K("stop",{offset:"0.723929",stopColor:"#FFF700"}),K("stop",{offset:"1",stopColor:"#FF9901"})]}),mt("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[K("stop",{stopColor:"#FFF700"}),K("stop",{offset:"1",stopColor:"#FF9901"})]}),mt("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[K("stop",{stopColor:"#FFF700"}),K("stop",{offset:"1",stopColor:"#FF9901"})]}),mt("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[K("stop",{offset:"0.59513",stopColor:"#00AAFF"}),K("stop",{offset:"1",stopColor:"#01DA40"})]}),mt("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[K("stop",{stopColor:"#00AAFF"}),K("stop",{offset:"1",stopColor:"#01DA40"})]}),mt("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:[K("stop",{stopColor:"#00AAFF"}),K("stop",{offset:"1",stopColor:"#01DA40"})]}),K("clipPath",{id:"clip0_5_32",children:K("rect",{width:"120",height:"120",fill:"white"})}),K("clipPath",{id:"clip1_5_32",children:K("rect",{width:"120",height:"120",fill:"white"})})]})]});import{jsx as ro,jsxs as bu}from"react/jsx-runtime";var Eu=({style:e,...t})=>bu("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[ro("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),bu("g",{filter:"url(#filter0_d_12393_20043)",children:[ro("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),ro("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),ro("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),ro("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),ro("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),ro("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),ro("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),ro("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),ro("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});import{jsx as jn,jsxs as Pu}from"react/jsx-runtime";var Tu=({style:e,...t})=>Pu("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:[Pu("g",{clipPath:"url(#clip0_1704_1423)",children:[jn("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"}),jn("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"})]}),jn("defs",{children:jn("clipPath",{id:"clip0_1704_1423",children:jn("rect",{width:"176",height:"176",fill:"white"})})})]});import{jsx as Jr,jsxs as N1}from"react/jsx-runtime";var no={coinbase_wallet:{logo:qi,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Ur,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Zt,displayName:"Phantom"},rainbow:{logo:Cu,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Fn,displayName:"WalletConnect"},zerion:{logo:Tu,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:vu,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:wu,displayName:"Crypto.com DeFi Wallet"},uniswap:{logo:Eu,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="}},ur=({provider:e,displayName:t,logo:o,connectOnly:r,connector:n})=>{let{navigate:i}=S(),{connectWallet:a}=M(),l=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,s;return n.connectorType==="phantom"?s=()=>{Io()?(a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(R1?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:s=()=>{a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},N1(O1,{onClick:s,children:[Jr(L1,{icon:W1(e,n.connectorType)??o,name:n.walletClientType}),Jr("span",{children:M1(e,n.connectorType)||t||n.walletClientType}),Jr("span",{id:"connect-text",children:"Connect"})]})},M1=(e,t)=>{if(no[e]?.displayName)return no[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},W1=(e,t)=>{if(no[e]?.logo)return no[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Fn},L1=({icon:e,name:t})=>typeof e=="string"?Jr("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?Jr(k1,{}):e?Jr(e,{}):null,O1=I1(ge)`
|
|
844
|
+
`;import A1 from"@heroicons/react/24/outline/WalletIcon";import{isMobile as k1}from"react-device-detect";import R1 from"styled-components";import{jsx as zt,jsxs as gu}from"react/jsx-runtime";var vu=({...e})=>gu("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[zt("defs",{children:gu("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:[zt("stop",{offset:"0",stopColor:"#f1562b"}),zt("stop",{offset:"0.3",stopColor:"#f1542b"}),zt("stop",{offset:"0.41",stopColor:"#f04d2a"}),zt("stop",{offset:"0.49",stopColor:"#ef4229"}),zt("stop",{offset:"0.5",stopColor:"#ef4029"}),zt("stop",{offset:"0.56",stopColor:"#e83e28"}),zt("stop",{offset:"0.67",stopColor:"#e13c26"}),zt("stop",{offset:"1",stopColor:"#df3c26"})]})}),zt("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"}),zt("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});import{jsx as $t,jsxs as Kn}from"react/jsx-runtime";var wu=({style:e,...t})=>Kn("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[$t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),$t("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:$t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),Kn("g",{mask:"url(#mask0_16909_31415)",children:[$t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),$t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),$t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),$t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),Kn("defs",{children:[Kn("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[$t("stop",{"stop-color":"#002D72"}),$t("stop",{offset:"1","stop-color":"#002D72","stop-opacity":"0.01"})]}),Kn("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[$t("stop",{"stop-color":"#002D72","stop-opacity":"0.01"}),$t("stop",{offset:"1","stop-color":"#002D72"})]})]})]});import{jsx as K,jsxs as ht}from"react/jsx-runtime";var Cu=({style:e,...t})=>ht("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:[K("g",{clipPath:"url(#clip0_5_32)",children:ht("g",{clipPath:"url(#clip1_5_32)",children:[K("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:K("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"})}),K("g",{mask:"url(#mask0_5_32)",children:K("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),K("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)"}),K("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),K("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),K("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),K("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),K("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),K("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)"}),K("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),K("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),ht("defs",{children:[ht("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[K("stop",{stopColor:"#174299"}),K("stop",{offset:"1",stopColor:"#001E59"})]}),ht("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[K("stop",{offset:"0.770277",stopColor:"#FF4000"}),K("stop",{offset:"1",stopColor:"#8754C9"})]}),ht("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[K("stop",{stopColor:"#FF4000"}),K("stop",{offset:"1",stopColor:"#8754C9"})]}),ht("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[K("stop",{stopColor:"#8754C9"}),K("stop",{offset:"1",stopColor:"#FF4000"})]}),ht("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[K("stop",{offset:"0.723929",stopColor:"#FFF700"}),K("stop",{offset:"1",stopColor:"#FF9901"})]}),ht("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[K("stop",{stopColor:"#FFF700"}),K("stop",{offset:"1",stopColor:"#FF9901"})]}),ht("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[K("stop",{stopColor:"#FFF700"}),K("stop",{offset:"1",stopColor:"#FF9901"})]}),ht("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[K("stop",{offset:"0.59513",stopColor:"#00AAFF"}),K("stop",{offset:"1",stopColor:"#01DA40"})]}),ht("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[K("stop",{stopColor:"#00AAFF"}),K("stop",{offset:"1",stopColor:"#01DA40"})]}),ht("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:[K("stop",{stopColor:"#00AAFF"}),K("stop",{offset:"1",stopColor:"#01DA40"})]}),K("clipPath",{id:"clip0_5_32",children:K("rect",{width:"120",height:"120",fill:"white"})}),K("clipPath",{id:"clip1_5_32",children:K("rect",{width:"120",height:"120",fill:"white"})})]})]});import{jsx as io,jsxs as bu}from"react/jsx-runtime";var Eu=({style:e,...t})=>bu("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[io("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),bu("g",{filter:"url(#filter0_d_12393_20043)",children:[io("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),io("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),io("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),io("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),io("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),io("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),io("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),io("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),io("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});import{jsx as Yn,jsxs as Pu}from"react/jsx-runtime";var Tu=({style:e,...t})=>Pu("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:[Pu("g",{clipPath:"url(#clip0_1704_1423)",children:[Yn("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"}),Yn("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"})]}),Yn("defs",{children:Yn("clipPath",{id:"clip0_1704_1423",children:Yn("rect",{width:"176",height:"176",fill:"white"})})})]});import{jsx as Yr,jsxs as O1}from"react/jsx-runtime";var ao={coinbase_wallet:{logo:ji,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Dr,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Xt,displayName:"Phantom"},rainbow:{logo:Cu,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Hn,displayName:"WalletConnect"},zerion:{logo:Tu,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:vu,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:wu,displayName:"Crypto.com DeFi Wallet"},uniswap:{logo:Eu,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="}},mr=({provider:e,displayName:t,logo:o,connectOnly:r,connector:n})=>{let{navigate:i}=A(),{connectWallet:a}=W(),l=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,s;return n.connectorType==="phantom"?s=()=>{Mo()?(a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(k1?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:s=()=>{a(n,l),i(r?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},O1(L1,{onClick:s,children:[Yr(W1,{icon:M1(e,n.connectorType)??o,name:n.walletClientType}),Yr("span",{children:I1(e,n.connectorType)||t||n.walletClientType}),Yr("span",{id:"connect-text",children:"Connect"})]})},I1=(e,t)=>{if(ao[e]?.displayName)return ao[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},M1=(e,t)=>{if(ao[e]?.logo)return ao[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Hn},W1=({icon:e,name:t})=>typeof e=="string"?Yr("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?Yr(A1,{}):e?Yr(e,{}):null,L1=R1(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
|
-
`;import{Fragment as
|
|
866
|
+
`;import{Fragment as B1,jsx as Jr,jsxs as H1}from"react/jsx-runtime";var N1=["coinbase_wallet"],D1=["metamask","okx_wallet","rainbow","uniswap","zerion"],U1=["cryptocom"],F1=["phantom"],Zr=({connectOnly:e})=>{let{connectors:t}=W(),{app:o}=A(),r=Jn(o.appearance.walletList,t,e,o.appearance.walletList);return H1(B1,{children:[...r]})},Jn=(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:u,walletClientType:m})=>m==="uniswap_wallet_extension"?!r.includes("uniswap"):u==="injected"&&!r.includes(m));for(let u of c){let{walletClientType:m,walletBranding:v}=u;(m==="unknown"?i:n).push(Jr(mr,{connectOnly:o,provider:m,logo:v.icon,displayName:v.name,connector:u},`${s}-${m}`))}}else if(F1.includes(s)){let c=t.find(u=>u.connectorType==="injected"&&u.walletClientType===s||u.connectorType===s);c&&n.push(Jr(mr,{connectOnly:o,provider:s,connector:c},s))}else if(D1.includes(s)){let c=t.find(u=>s==="uniswap"?u.walletClientType==="uniswap_wallet_extension":u.connectorType==="injected"&&u.walletClientType===s)??l;c&&n.push(Jr(mr,{connectOnly:o,provider:s,connector:c},s))}else if(N1.includes(s)){let c=t.find(({connectorType:u})=>u===s);c&&n.push(Jr(mr,{connectOnly:o,provider:s,connector:c},s))}else U1.includes(s)?l&&a.push(Jr(mr,{connectOnly:o,provider:s,connector:l},s)):s==="wallet_connect"&&l&&a.push(Jr(mr,{connectOnly:o,provider:s,connector:l},s));return[...i,...n,...a]};import{Fragment as G1,jsx as Zn,jsxs as V1}from"react/jsx-runtime";var xu=()=>{let{app:e}=A(),t=`Connect a wallet to ${e?.name}`;return V1(G1,{children:[Zn(k,{},"header"),Zn(no,{title:"Connect your wallet",description:t}),Zn(_t,{children:Zn(Zr,{connectOnly:!0})}),Zn(G,{protectedByPrivy:!0})]})};import K1 from"styled-components";import q1 from"styled-components";import z1 from"react";import{jsx as $1}from"react/jsx-runtime";var Su=()=>{let{app:e}=A(),t=e?.appearance?.logo,o=`${e?.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?$1("img",{src:t,alt:o,style:r}):t.type==="svg"||t.type==="img"?z1.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};import{jsx as _u}from"react/jsx-runtime";var Qr=e=>{let{app:t}=A();return t?.appearance.logo?_u(j1,{...e,children:_u(Su,{})}):null},j1=q1.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
|
-
`;import{Fragment as
|
|
873
|
+
`;import{Fragment as J1,jsx as Xr,jsxs as Z1}from"react/jsx-runtime";var Au=()=>{let{app:e}=A();return Z1(J1,{children:[Xr(k,{},"header"),Xr(Y1,{}),Xr(_t,{children:Xr(Zr,{connectOnly:!0})}),e&&Xr(zr,{app:e,alwaysShowImplicitConsent:!0}),Xr(G,{protectedByPrivy:!0})]})},Y1=K1(Qr)`
|
|
874
874
|
margin-bottom: 16px;
|
|
875
|
-
`;import{useEffect as Wu,useState as Lu}from"react";import{isMobile as
|
|
875
|
+
`;import{useEffect as Wu,useState as Lu}from"react";import{isMobile as iv}from"react-device-detect";import av from"styled-components";import{useEffect as Al,useState as fr}from"react";import{isMobile as Qn}from"react-device-detect";import{useInterval as tv}from"react-use";import Ru from"styled-components";import{useState as Q1,useEffect as X1,useCallback as ev}from"react";function ku(){let[e,t]=Q1(!1),o=ev(()=>{document.hidden&&t(!0)},[]);return X1(()=>(document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)),[o]),{hasTabbedAway:e,reset:()=>t(!1)}}import{Fragment as Mu,jsx as Re,jsxs as Xn}from"react/jsx-runtime";var kl=2,Rl=e=>e?.privyErrorCode==="linked_to_another_user"?wo.ERROR_USER_EXISTS:e instanceof ve&&!e.details.default?e.details:e instanceof Wr?wo.ERROR_TIMED_OUT:e instanceof Lr?wo.ERROR_USER_REJECTED_CONNECTION:wo.ERROR_WALLET_CONNECTION,Iu=()=>{let[e,t]=fr(!1),[o,r]=fr(!1),[n,i]=fr(void 0),{authenticated:a}=B(),{app:l,navigate:s,navigateBack:c,lastScreen:u,currentScreen:m,setModalData:v}=A(),{getAuthFlow:h,walletConnectionStatus:w,closePrivyModal:b,initLoginWithWallet:x,loginWithWallet:C,updateWallets:T}=W(),{walletConnectors:L}=B(),[I,S]=fr(0),{user:U}=B(),[P]=fr(U?.linkedAccounts.length||0),[F,R]=fr(""),[q,ce]=fr(!1),{hasTabbedAway:H}=ku(),{enabled:V,token:j}=pe(),ne=Qn&&w?.connector?.connectorType==="wallet_connect_v2"||Qn&&w?.connector?.connectorType==="coinbase_wallet"||Qn&&w?.connector?.connectorType==="injected"&&w?.connector?.walletClientType==="phantom",oe=w?.status==="connected",$e=w?.status==="switching_to_supported_chain";Al(()=>{let $=h();if(oe&&!$&&(V&&!j&&!a?(v({captchaModalData:{callback:_e=>x(w.connectedWallet,_e).then(()=>{ce(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN",!1)):x(w.connectedWallet,j).then(()=>{ce(!0)})),$&&ne&&oe&&!$.preparedMessage){$.buildSiweMessage();return}!$||ne||!oe||o||(async()=>{r(!0),i(void 0);try{w?.connector?.connectorType==="wallet_connect_v2"&&w?.connector?.walletClientType==="metamask"&&await Zs(2500),await it()}catch(_e){console.warn("Auto-prompted signature failed",_e)}finally{r(!1)}})()},[I,oe,q]),Al(()=>{if(U&&e){let $=l?.render.inDialog?Qe:0,_e=l?.render.inDialog?$-500:0;if(l?.legal.requireUsersAcceptTerms&&!U.hasAcceptedTerms){let De=setTimeout(()=>{s("AFFIRMATIVE_CONSENT_SCREEN")},_e);return()=>clearTimeout(De)}if(bt(U,l?.embeddedWallets?.createOnLogin)){let De=setTimeout(()=>{v({createWallet:{onSuccess:()=>{},onFailure:rr=>console.error(rr),callAuthOnSuccessOnClose:!0}}),s("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},_e);return()=>clearTimeout(De)}T();let In=setTimeout(()=>b({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Qe);return()=>clearTimeout(In)}},[U,e]);let wt=$=>{if($?.privyErrorCode==="allowlist_rejected"){s("ALLOWLIST_REJECTION_SCREEN");return}i(Rl($))};async function it(){try{if(await C(),!l?.render.inDialog)return b({shouldCallAuthOnSuccess:!0,isSuccess:!0});t(!0)}catch($){wt($)}finally{r(!1)}}Al(()=>{w?.connectError&&wt(w?.connectError)},[w]),tv(()=>{let $=qe==="wallet_connect_v2"&&w?.connector instanceof eo?w.connector.redirectUri:void 0;$&&R($)},w?.connector instanceof eo&&!F?500:null);let qe=w?.connector?.connectorType||"injected",ie=w?.connector?.walletClientType||"unknown",ho=ao[ie]?.displayName||w?.connector?.walletBranding.name||"Browser Extension",ct=ao[ie]?.logo||w?.connector?.walletBranding.icon||($=>Re(Nr,{...$})),or=ho==="Browser Extension"?ho.toLowerCase():ho,M;e?M=`Successfully connected with ${or}`:n?M=n.message:$e?M="Switching networks":oe?M=o&&ne?"Signing":"Sign to verify":M=`Waiting for ${or}`;let Y="Don\u2019t see your wallet? Check your other browser windows.";if(e){let $=U?.linkedAccounts.length||0;P===$?Y="Wallet was already linked.":Y="You\u2019re good to go!"}else I>=kl&&n?Y="Unable to connect wallet":n?Y=n.detail:$e?Y="Switch your wallet to the requested network.":oe&&ne?Y="Sign the message in your wallet to verify it belongs to you.":ie==="metamask"&&Qn?Y="Click continue to open and connect MetaMask.":ie==="metamask"?Y="For the best experience, connect only one wallet at a time.":qe==="wallet_connect"?Y="Open your mobile wallet app to continue":qe==="coinbase_wallet"&&(Wd()||(ol(U)?Y="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":Y="Open the Coinbase app on your phone to continue."));let J=L?.walletConnectors?.find($=>$.walletClientType==="coinbase_wallet"),Rn=ie==="coinbase_wallet"&&(ol(U)||n===wo.ERROR_USER_EXISTS);return Xn(Mu,{children:[Re(k,{backFn:!u||m===u?void 0:c}),Xn(rv,{children:[Re(Il,{walletLogo:ct,success:e,fail:!!n}),Xn(Rt,{children:[Re("h3",{children:M}),Re("p",{children:Y}),!oe&&F&&!H?Xn("p",{children:["Still here?"," ",Re("a",{href:F,target:"_blank",style:{textDecoration:"underline"},children:"Try again"})]}):null]}),Rn?Re(D,{onClick:()=>J&&J?.disconnect(),disabled:e,children:"Use a different wallet"}):n==wo.ERROR_USER_EXISTS&&m!==u?Re(D,{onClick:c,children:"Use a different wallet"}):oe&&!e&&ne?Re(D,{onClick:()=>{r(!0),it(),ov(ie)},disabled:o,children:o?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&I<kl?Re(D,{onClick:()=>{S(I+1),i(void 0),oe?(r(!0),it()):w?.connectRetry()},disabled:!e&&(!n?.retryable||I>=kl),children:"Retry"}):!e&&!n?Re(D,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),Re(te,{})]})},ov=e=>{if(!Qn||!Tp(e))return;let t=xp(e);t&&window.open(t,"_self","noopener,noreferrer")},rv=Ru.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
|
-
`,
|
|
882
|
+
`,nv=Ru.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
|
-
`,
|
|
905
|
+
`,Il=e=>{let t=e.walletLogo;return Re(Mu,{children:Re(nv,{children:Xn("div",{children:[Re(Do,{success:e.success,fail:e.fail}),typeof t=="string"?Re("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):Re(t,{style:{width:"38px",height:"38px"}})]})})})};import{Fragment as lv,jsx as Eo,jsxs as Ml}from"react/jsx-runtime";var Da=2,Ou=()=>{let{navigateBack:e,lastScreen:t,currentScreen:o}=A(),{walletConnectionStatus:r,closePrivyModal:n}=W(),[i,a]=Lu(void 0),[l,s]=Lu(0),c=r?.status==="connected",u=r?.status==="switching_to_supported_chain";Wu(()=>{if(c){let L=setTimeout(n,Qe);return()=>clearTimeout(L)}},[c]);let m=L=>{a(Rl(L))};Wu(()=>{r?.connectError&&m(r?.connectError)},[r]);let v=r?.connector?.connectorType||"injected",h=r?.connector?.walletClientType||"unknown",w=ao[h]?.displayName||r?.connector?.walletBranding.name||"Browser Extension",b=ao[h]?.logo||r?.connector?.walletBranding.icon||(L=>Eo(Nr,{...L})),x=w==="Browser Extension"?w.toLowerCase():w,C;c?C=`Successfully connected with ${x}`:i?C=i.message:u?C="Switching networks":C=`Waiting for ${x}`;let T="Don\u2019t see your wallet? Check your other browser windows.";return c?T="You\u2019re good to go!":l>=Da&&i?T="Unable to connect wallet":i?T=i.detail:u?T="Switch your wallet to the requested network.":h==="metamask"&&iv?T="Click to continue to open and connect MetaMask.":h==="metamask"?T="For the best experience, connect only one wallet at a time.":v==="wallet_connect_v2"?T="Open your mobile wallet app to continue":v==="coinbase_wallet"&&(T="Open the Coinbase app on your phone to continue."),Ml(lv,{children:[Eo(k,{backFn:o===t?void 0:e}),Ml(sv,{children:[Eo(Il,{walletLogo:b,success:c,fail:!!i}),Ml(Rt,{children:[Eo("h3",{children:C}),Eo("p",{children:T})]}),i==wo.ERROR_USER_EXISTS?Eo(D,{onClick:e,children:"Use a different wallet"}):!c&&i?.retryable&&l<Da?Eo(D,{onClick:()=>{s(l+1),a(void 0),r?.connectRetry()},disabled:!c&&(!i?.retryable||l>=Da),children:"Retry"}):!c&&i&&l>=Da?Eo(D,{onClick:e,children:"Use a different wallet"}):null]}),Eo(te,{})]})},sv=av.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
|
-
`;import
|
|
912
|
+
`;import hv from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as yv,useMemo as gv,useState as vv}from"react";import wv from"styled-components";import Ua from"styled-components";import{jsx as Wl,jsxs as mv}from"react/jsx-runtime";var en=()=>Wl(cv,{children:mv(dv,{children:[Wl(pv,{}),Wl(uv,{})]})}),cv=Ua.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
|
-
`,
|
|
924
|
+
`,dv=Ua.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
|
-
`,
|
|
931
|
+
`,pv=Ua.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
|
-
`,
|
|
944
|
+
`,uv=Ua.div`
|
|
945
945
|
position: absolute;
|
|
946
946
|
top: 0;
|
|
947
947
|
right: 0;
|
|
@@ -965,20 +965,20 @@ Resources:
|
|
|
965
965
|
transform: rotate(360deg);
|
|
966
966
|
}
|
|
967
967
|
}
|
|
968
|
-
`;var Nu=["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
|
|
968
|
+
`;var Nu=["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 Pe=class extends Error{constructor(o,r){super(r);this.type=o}};function tn(e){let t=e.type;return typeof t=="string"&&Nu.includes(t)}function fv(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function hr(e){return tn(e)&&e.type==="wallet_not_on_device"}function Du(e){return tn(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function on(e){return!!(tn(e)&&e.type==="mfa_timeout")}function rn(e){return!!(tn(e)&&e.type==="missing_or_invalid_mfa")}function Ll(e){return!!(tn(e)&&e.type==="mfa_verification_max_attempts_reached")}function Ol(e){return!!(tn(e)&&e.message.includes("code 429"))}function Nl(e){return!!(fv(e)&&e.message==="MFA canceled")}import{Fragment as Fu,jsx as nn,jsxs as Dl}from"react/jsx-runtime";var Uu=1,Bu=()=>{let{authenticated:e,user:t,getAccessToken:o}=B(),{closePrivyModal:r,createAnalyticsEvent:n,walletProxy:i}=W(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=A(),u=gv(()=>Date.now(),[]),[m,v]=vv(!1),{onCompleteNavigateTo:h,onFailure:w}=l?.connectWallet,b=C=>{m||(v(!0),w(typeof C=="string"?new Error(C):C))};yv(()=>{let C=me(t),T;return!e||!C?b("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let I=await o();if(!I)return b("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:I,address:C.address});let S=(Date.now()-u)/1e3;h==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&S<Uu?T=setTimeout(()=>{a(h)},(Uu-S)*1e3):a(h)}catch(S){if(hr(S)&&C.recoveryMethod==="privy"){let U=await o();if(!U)return b("User must be authenticated and have a Privy wallet before it can be recovered");try{n("embedded_wallet_pinless_recovery_started",{walletAddress:C.address}),(await i?.recover({address:C.address,accessToken:U}))?.address||b(new Error("Unable to recover wallet")),h?a(h):r({shouldCallAuthOnSuccess:!1}),n("embedded_wallet_recovery_completed",{walletAddress:C.address}),a(h)}catch{b("An error has occurred, please try again.")}}else hr(S)?(s({...l,recoverWallet:{privyWallet:C,onCompleteNavigateTo:h,onFailure:w}}),a("EMBEDDED_WALLET_RECOVERY_SCREEN")):b(S)}})(),()=>clearTimeout(T)):void 0},[e,t,i]);let x=()=>{b("User exited before wallet could be connected"),r({shouldCallAuthOnSuccess:!1})};return c.current=x,Dl(Fu,{children:[nn(k,{onClose:x}),m?Dl(Fu,{children:[Dl(Gt,{children:[nn(hv,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),nn(be,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),nn(D,{onClick:()=>r({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):nn(en,{}),nn(Cv,{})]})},Cv=wv.div`
|
|
969
969
|
height: 44px;
|
|
970
|
-
`;import
|
|
970
|
+
`;import bv from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as Ev}from"react";import{Fragment as Pv,jsx as an,jsxs as Hu}from"react/jsx-runtime";var Gu=()=>{let{user:e}=B(),{closePrivyModal:t,isNewUserThisSession:o,updateWallets:r}=W(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=A(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,u=()=>{let m=me(e);m?(r(),l(m)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return Ev(()=>{let m=setTimeout(u,bd);return()=>clearTimeout(m)},[]),a.current=u,Hu(Pv,{children:[an(k,{onClose:u}),an(Q,{}),Hu(Gt,{children:[an(bv,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),an(be,{title:o?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:o?"You\u2019ve successfully created an account.":"Your account is secured."})]}),an(X,{}),an(G,{protectedByPrivy:!0})]})};import Tv from"@heroicons/react/20/solid/ExclamationTriangleIcon";import xv from"@heroicons/react/24/outline/ArrowRightOnRectangleIcon";import{useEffect as $u,useRef as Sv,useState as Ul}from"react";import Go from"styled-components";import{Fragment as Ov,jsx as Te,jsxs as qt}from"react/jsx-runtime";var qu=()=>{let[e,t]=Ul(null),{authenticated:o,user:r,getAccessToken:n}=B(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=W(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=A(),u=me(r)?.address,{onFailure:m,onSuccess:v,origin:h,appId:w}=s.keyExport,b=C=>{i({shouldCallAuthOnSuccess:!1}),m(typeof C=="string"?new Error(C):C)},x=()=>{i({shouldCallAuthOnSuccess:!1}),v(),a("embedded_wallet_key_export_completed",{walletAddress:u})};return $u(()=>{let C=me(r);if(!o||!C)return b("User must be authenticated before exporting their wallet");n().then(t,b)},[o,r]),c.current=x,qt(Ov,{children:[Te(k,{onClose:x}),qt(kv,{children:[qt(be,{icon:Te(xv,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[qt(Wv,{children:[Te(Av,{style:{marginRight:6}}),Wo(u)]}),Te("p",{children:"You can bring your account with you to another site using an external wallet."})]}),qt(Rv,{children:[qt(Vu,{children:[Te(zu,{children:"1"}),qt("span",{children:[Te("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."]})]}),qt(Vu,{children:[Te(zu,{children:"2"}),Te("span",{children:"Copy this key into your other wallet"})]})]}),Te("div",{style:{width:"100%"},children:e&&Te(_v,{origin:h,appId:w,accessToken:e,clientAnalyticsId:l,address:u,dimensions:{height:"44px"}})}),qt(Lv,{children:[qt("div",{children:[Te(Tv,{viewBox:"0 0 20 18"}),Te("h4",{children:"Warning"})]}),Te("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),Te(G,{protectedByPrivy:!0})]})};function _v(e){let[t,o]=Ul(e.dimensions.width),[r,n]=Ul(void 0),i=Sv(null);return $u(()=>{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")})},[]),Te("div",{ref:i,children:t&&qt(Iv,{children:[Te("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:$i(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{token:e.accessToken,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...r})}),Te(Mv,{children:"Loading..."})]})})}function Av(e){return Te("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:Te("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 kv=Go.div`
|
|
971
971
|
display: flex;
|
|
972
972
|
flex-direction: column;
|
|
973
973
|
text-align: left;
|
|
974
|
-
`,
|
|
974
|
+
`,Rv=Go.div`
|
|
975
975
|
display: flex;
|
|
976
976
|
flex-direction: column;
|
|
977
977
|
gap: 24px;
|
|
978
978
|
padding-bottom: 16px;
|
|
979
979
|
margin-left: 11px;
|
|
980
980
|
border-left: 1px solid var(--privy-color-foreground-4) !important;
|
|
981
|
-
`,Vu=
|
|
981
|
+
`,Vu=Go.div`
|
|
982
982
|
display: flex;
|
|
983
983
|
align-items: top;
|
|
984
984
|
gap: 8px;
|
|
@@ -987,7 +987,7 @@ Resources:
|
|
|
987
987
|
color: var(--privy-color-accent);
|
|
988
988
|
text-decoration: underline;
|
|
989
989
|
}
|
|
990
|
-
`,zu=
|
|
990
|
+
`,zu=Go.div`
|
|
991
991
|
display: flex;
|
|
992
992
|
align-items: center;
|
|
993
993
|
justify-content: center;
|
|
@@ -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
|
-
`,
|
|
1004
|
+
`,Iv=Go.div`
|
|
1005
1005
|
overflow: visible;
|
|
1006
1006
|
position: relative;
|
|
1007
1007
|
height: 44px;
|
|
1008
|
-
`,
|
|
1008
|
+
`,Mv=Go.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
|
-
`,
|
|
1020
|
+
`,Wv=Go.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
|
-
`,
|
|
1033
|
+
`,Lv=Go.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
|
-
`;import
|
|
1055
|
+
`;import A2 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as vm,useRef as k2,useState as ii}from"react";import R2 from"styled-components";import{useCallback as gm,useEffect as _2}from"react";import Bv from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useEffect as Hv,useState as Hl}from"react";import Nv from"@heroicons/react/24/outline/ArrowPathIcon";import Dv from"@heroicons/react/24/outline/EyeIcon";import Uv from"@heroicons/react/24/outline/EyeSlashIcon";import Ge,{css as Fl}from"styled-components";var Fv=Fl`
|
|
1056
1056
|
font-size: 14px;
|
|
1057
1057
|
font-style: normal;
|
|
1058
1058
|
font-weight: 400;
|
|
@@ -1060,8 +1060,8 @@ Resources:
|
|
|
1060
1060
|
letter-spacing: -0.008px;
|
|
1061
1061
|
text-align: left;
|
|
1062
1062
|
transition: color 0.1s ease-in;
|
|
1063
|
-
`,
|
|
1064
|
-
${
|
|
1063
|
+
`,Fa=Ge.span`
|
|
1064
|
+
${Fv}
|
|
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"};
|
|
@@ -1069,18 +1069,18 @@ Resources:
|
|
|
1069
1069
|
&[aria-hidden='true'] {
|
|
1070
1070
|
visibility: hidden;
|
|
1071
1071
|
}
|
|
1072
|
-
`,
|
|
1072
|
+
`,Vo=Ge.div`
|
|
1073
1073
|
display: flex;
|
|
1074
1074
|
flex-direction: column;
|
|
1075
1075
|
justify-content: center;
|
|
1076
1076
|
flex-grow: 1;
|
|
1077
|
-
`,
|
|
1078
|
-
${e=>e.hideAnimations&&
|
|
1077
|
+
`,zo=Ge(D)`
|
|
1078
|
+
${e=>e.hideAnimations&&Fl`
|
|
1079
1079
|
&& {
|
|
1080
1080
|
transition: none;
|
|
1081
1081
|
}
|
|
1082
1082
|
`}
|
|
1083
|
-
`,ju=
|
|
1083
|
+
`,ju=Fl`
|
|
1084
1084
|
&& {
|
|
1085
1085
|
width: 100%;
|
|
1086
1086
|
border-width: 1px;
|
|
@@ -1095,7 +1095,7 @@ Resources:
|
|
|
1095
1095
|
font-weight: 300;
|
|
1096
1096
|
line-height: 22px; /* 137.5% */
|
|
1097
1097
|
}
|
|
1098
|
-
`,
|
|
1098
|
+
`,sn=Ge.input`
|
|
1099
1099
|
${ju}
|
|
1100
1100
|
|
|
1101
1101
|
&::placeholder {
|
|
@@ -1103,15 +1103,19 @@ Resources:
|
|
|
1103
1103
|
font-style: italic;
|
|
1104
1104
|
font-size: 14px;
|
|
1105
1105
|
}
|
|
1106
|
-
|
|
1106
|
+
|
|
1107
|
+
overflow: hidden;
|
|
1108
|
+
text-overflow: ellipsis;
|
|
1109
|
+
white-space: nowrap;
|
|
1110
|
+
`,Ku=Ge.div`
|
|
1107
1111
|
${ju}
|
|
1108
|
-
|
|
1112
|
+
`,$o=Ge.div`
|
|
1109
1113
|
position: relative;
|
|
1110
1114
|
width: 100%;
|
|
1111
1115
|
display: flex;
|
|
1112
1116
|
align-items: center;
|
|
1113
1117
|
justify-content: ${({centered:e})=>e?"center":"space-between"};
|
|
1114
|
-
|
|
1118
|
+
`,qo=Ge.div`
|
|
1115
1119
|
display: flex;
|
|
1116
1120
|
flex-direction: column;
|
|
1117
1121
|
align-items: center;
|
|
@@ -1133,12 +1137,12 @@ Resources:
|
|
|
1133
1137
|
font-weight: 400;
|
|
1134
1138
|
line-height: 20px;
|
|
1135
1139
|
}
|
|
1136
|
-
`,
|
|
1140
|
+
`,ei=Ge.div`
|
|
1137
1141
|
display: flex;
|
|
1138
1142
|
flex-direction: column;
|
|
1139
1143
|
gap: 10px;
|
|
1140
1144
|
padding-bottom: 1rem;
|
|
1141
|
-
`,
|
|
1145
|
+
`,ti=Ge.div`
|
|
1142
1146
|
display: flex;
|
|
1143
1147
|
text-align: left;
|
|
1144
1148
|
align-items: center;
|
|
@@ -1158,13 +1162,13 @@ Resources:
|
|
|
1158
1162
|
> :first-child {
|
|
1159
1163
|
min-width: 24px;
|
|
1160
1164
|
}
|
|
1161
|
-
`,
|
|
1165
|
+
`,D9=Ge.div`
|
|
1162
1166
|
height: var(--privy-height-modal-full);
|
|
1163
1167
|
|
|
1164
1168
|
@media (max-width: 440px) {
|
|
1165
1169
|
height: var(--privy-height-modal-compact);
|
|
1166
1170
|
}
|
|
1167
|
-
`,
|
|
1171
|
+
`,Bl=Ge(Ea)`
|
|
1168
1172
|
display: flex;
|
|
1169
1173
|
flex: 1;
|
|
1170
1174
|
gap: 4px;
|
|
@@ -1176,7 +1180,7 @@ Resources:
|
|
|
1176
1180
|
border-color: var(--privy-color-foreground-3);
|
|
1177
1181
|
border-width: 1px;
|
|
1178
1182
|
}
|
|
1179
|
-
`,
|
|
1183
|
+
`,ln=Ge.div`
|
|
1180
1184
|
position: absolute;
|
|
1181
1185
|
right: 0.5rem;
|
|
1182
1186
|
|
|
@@ -1184,7 +1188,7 @@ Resources:
|
|
|
1184
1188
|
flex-direction: row;
|
|
1185
1189
|
justify-content: space-around;
|
|
1186
1190
|
align-items: center;
|
|
1187
|
-
`,Yu=
|
|
1191
|
+
`,Yu=Ge(Nv)`
|
|
1188
1192
|
height: 1.25rem;
|
|
1189
1193
|
width: 1.25rem;
|
|
1190
1194
|
stroke: var(--privy-color-accent);
|
|
@@ -1193,7 +1197,7 @@ Resources:
|
|
|
1193
1197
|
:active {
|
|
1194
1198
|
stroke: var(--privy-color-accent-light);
|
|
1195
1199
|
}
|
|
1196
|
-
`,
|
|
1200
|
+
`,cn=Ge(Uv)`
|
|
1197
1201
|
height: 1.25rem;
|
|
1198
1202
|
width: 1.25rem;
|
|
1199
1203
|
stroke: var(--privy-color-accent);
|
|
@@ -1202,7 +1206,7 @@ Resources:
|
|
|
1202
1206
|
:active {
|
|
1203
1207
|
stroke: var(--privy-color-accent-light);
|
|
1204
1208
|
}
|
|
1205
|
-
`,
|
|
1209
|
+
`,dn=Ge(Dv)`
|
|
1206
1210
|
height: 1.25rem;
|
|
1207
1211
|
width: 1.25rem;
|
|
1208
1212
|
stroke: var(--privy-color-accent);
|
|
@@ -1211,7 +1215,7 @@ Resources:
|
|
|
1211
1215
|
:active {
|
|
1212
1216
|
stroke: var(--privy-color-accent-light);
|
|
1213
1217
|
}
|
|
1214
|
-
`,Ju=
|
|
1218
|
+
`,Ju=Ge.progress`
|
|
1215
1219
|
height: 4px;
|
|
1216
1220
|
width: 100%;
|
|
1217
1221
|
margin: 8px 0;
|
|
@@ -1227,14 +1231,14 @@ Resources:
|
|
|
1227
1231
|
transition: all 0.1s ease-out;
|
|
1228
1232
|
background: ${({label:e})=>e==="Strong"&&"#78dca6"||e==="Medium"&&"var(--privy-color-warn)"||"var(--privy-color-error)"};
|
|
1229
1233
|
}
|
|
1230
|
-
`;import{Fragment as
|
|
1234
|
+
`;import{Fragment as Gv,jsx as yt,jsxs as Ba}from"react/jsx-runtime";var Zu=({buttonHideAnimations:e,buttonLoading:t,password:o,onSubmit:r,onBack:n})=>{let[i,a]=Hl(!0),[l,s]=Hl(!1),[c,u]=Hl(""),m=o===c;return Hv(()=>{c&&!l&&s(!0)},[c]),Ba(Gv,{children:[yt(k,{title:"Confirm Password",closeable:!1,backFn:n}),yt(Q,{}),Ba(Vo,{children:[Ba(qo,{children:[yt(Bv,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),yt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),yt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),Ba($o,{children:[yt(sn,{value:c,onChange:v=>u(v.target.value),onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),yt(ln,{style:{right:"0.75rem"},children:i?yt(cn,{onClick:()=>a(!1)}):yt(dn,{onClick:()=>a(!0)})})]}),yt(Fa,{"aria-hidden":!l||m,error:!0,children:"Passwords do not match"})]}),yt(zo,{onClick:r,loading:t,disabled:!m,hideAnimations:e,children:"Continue"}),yt(X,{}),yt(G,{protectedByPrivy:!0})]})};import qv from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as jv}from"react";import Kv from"styled-components";import Ha from"styled-components";import{jsx as oi,jsxs as $v}from"react/jsx-runtime";var Qu=({className:e,checked:t,color:o="var(--privy-color-accent)",...r})=>oi("label",{children:$v(Vv,{className:e,children:[oi(em,{checked:t,...r}),oi(zv,{color:o,checked:t,children:oi(Xu,{viewBox:"0 0 24 24",children:oi("polyline",{points:"20 6 9 17 4 12"})})})]})}),Vv=Ha.div`
|
|
1231
1235
|
display: inline-block;
|
|
1232
1236
|
vertical-align: middle;
|
|
1233
|
-
`,Xu=
|
|
1237
|
+
`,Xu=Ha.svg`
|
|
1234
1238
|
fill: none;
|
|
1235
1239
|
stroke: white;
|
|
1236
1240
|
stroke-width: 3px;
|
|
1237
|
-
`,em=
|
|
1241
|
+
`,em=Ha.input.attrs({type:"checkbox"})`
|
|
1238
1242
|
border: 0;
|
|
1239
1243
|
clip: rect(0 0 0 0);
|
|
1240
1244
|
clippath: inset(50%);
|
|
@@ -1245,7 +1249,7 @@ Resources:
|
|
|
1245
1249
|
position: absolute;
|
|
1246
1250
|
white-space: nowrap;
|
|
1247
1251
|
width: 1px;
|
|
1248
|
-
|
|
1252
|
+
`,zv=Ha.div`
|
|
1249
1253
|
display: inline-block;
|
|
1250
1254
|
width: 18px;
|
|
1251
1255
|
height: 18px;
|
|
@@ -1267,23 +1271,23 @@ Resources:
|
|
|
1267
1271
|
${Xu} {
|
|
1268
1272
|
visibility: ${e=>e.checked?"visible":"hidden"};
|
|
1269
1273
|
}
|
|
1270
|
-
`;import{Fragment as tm,jsx as
|
|
1274
|
+
`;import{Fragment as tm,jsx as It,jsxs as ri}from"react/jsx-runtime";var om=({buttonHideAnimations:e,buttonLoading:t,onSubmit:o,onBack:r,config:n})=>{let[i,a]=jv(!1);return ri(tm,{children:[It(k,{title:"Confirm Password",closeable:!1,backFn:r}),It(Q,{}),ri(Vo,{children:[ri(qo,{children:[It(qv,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),It("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),It("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),It(ei,{children:ri(ti,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[It(Qu,{color:"var(--privy-color-error)",checked:i}),It(tm,{children:"I understand losing my password means losing my account."})]})})]}),ri(Yv,{children:[n.initiatedBy==="user"&&It(Ht,{onClick:n.onCancel,disabled:t,children:"Cancel"}),It(zo,{onClick:o,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),It(X,{}),It(G,{protectedByPrivy:!0})]})},Yv=Kv.div`
|
|
1271
1275
|
display: flex;
|
|
1272
1276
|
gap: 10px;
|
|
1273
|
-
`;import
|
|
1277
|
+
`;import p2 from"@heroicons/react/24/outline/KeyIcon";import cm from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as dm,useMemo as Gl,useEffect as u2}from"react";import pm from"styled-components";import Jv from"fast-password-entropy";import*as rm from"secure-password-utilities";import{DEFAULT_WORDLIST as Zv}from"secure-password-utilities/wordlists";var Qv=95,Xv=8,e2=3,t2=.3,o2=/[a-z]/,r2=/[A-Z]/,n2=/[0-9]/,i2="a-zA-Z0-9",nm="!@#$%^&*()\\-_+.",im=`${i2}${nm}`,a2=new RegExp(`[${nm}]`),s2=new RegExp(`[${im}]`),am=new RegExp(`^[${im}]{6,}$`),sm=(e="")=>{let t=e.split("").filter(o=>!s2.test(o)).map(o=>o.replace(" ","SPACE"));return[...new Set(t)]},Ga=()=>rm.generatePassphrase(4,Zv);function l2(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function c2(e){if(e.length<Xv)return 0;let t=0;o2.test(e)&&(t+=1),r2.test(e)&&(t+=1),n2.test(e)&&(t+=1),a2.test(e)&&(t+=1);let o=t/e2;return Math.max(0,Math.min(1,o))}function d2(e=""){let t=c2(e),o=Jv(e)/Qv;return(t*t2+o)/2}function lm(e=""){let t=d2(e);return{value:t,label:l2(t)}}import{Fragment as h2,jsx as Ie,jsxs as Po}from"react/jsx-runtime";var um=({buttonHideAnimations:e,buttonLoading:t,password:o="",config:r,onSubmit:n,onClose:i,onPasswordChange:a,onPasswordGenerate:l})=>{let[s,c]=dm(!1),[u,m]=dm(!1);u2(()=>{o&&!u&&m(!0)},[o]);let v=Gl(()=>u?(o?.length||0)<6?"Password must be at least 6 characters":am.test(o||"")?null:`Invalid characters used ( ${sm(o).join(" ")} )`:null,[o,u]),h=Gl(()=>v?{value:0,label:"Weak"}:lm(o),[o,v]),w=Gl(()=>!!(!o?.length||v),[v,o]);return Po(h2,{children:[Ie(k,{onClose:i,title:"Secure your account",closeable:r.initiatedBy==="user"}),Ie(Q,{}),Po(Vo,{children:[Po(qo,{children:[Ie(p2,{height:48,width:48,stroke:"var(--privy-color-accent)"}),Ie("h3",{style:{color:"var(--privy-color-foreground)"},children:"Set your password"}),Ie("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),Po($o,{children:[Ie(sn,{value:o,onChange:b=>a(b.target.value),placeholder:"enter or generate a strong password",type:s?"password":"text",style:{paddingRight:"3.8rem"}}),Po(ln,{style:{width:"3.5rem"},children:[s?Ie(cn,{onClick:()=>c(!1)}):Ie(dn,{onClick:()=>c(!0)}),Ie(Yu,{onClick:l})]})]}),Ie(Ju,{value:h.value===0?.01:h.value,label:h.label}),Ie(Fa,{error:!!v,children:v||`Password Strength: ${u?h.label:"--"}`}),Po(f2,{children:[Ie(m2,{children:Po(ei,{children:[Po(ti,{children:[Ie(cm,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),Po(ti,{children:[Ie(cm,{width:24,height:24,fill:"var(--privy-color-accent)"}),"You will only be asked to enter it when signing on to a new device."]})]})}),Ie(zo,{onClick:n,loading:t,disabled:w,hideAnimations:e,children:"Continue"})]})]}),Ie(X,{}),Ie(G,{protectedByPrivy:!0})]})},m2=pm(ei)`
|
|
1274
1278
|
flex: 1;
|
|
1275
1279
|
padding-top: 1rem;
|
|
1276
|
-
`,
|
|
1280
|
+
`,f2=pm.div`
|
|
1277
1281
|
display: flex;
|
|
1278
1282
|
flex-direction: column;
|
|
1279
1283
|
height: 100%;
|
|
1280
|
-
`;import
|
|
1284
|
+
`;import y2 from"@heroicons/react/24/outline/ArrowDownTrayIcon";import g2 from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import v2 from"@heroicons/react/24/outline/DocumentDuplicateIcon";import w2 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as C2,useCallback as mm}from"react";import{Fragment as Vl,jsx as lt,jsxs as yr}from"react/jsx-runtime";var fm=({buttonHideAnimations:e,buttonLoading:t,appName:o,password:r,onSubmit:n,onBack:i})=>{let[a,l]=C2(!1),s=mm(()=>{l(!0),r&&navigator.clipboard.writeText(r)},[r]),c=mm(()=>{let u=document.createElement("a"),m=o.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),v=new Blob([b2(o,r)],{type:"text/plain"}),h=URL.createObjectURL(v);u.href=h,u.target="_blank",u.download=`${m}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(h)},5e3)},[r]);return yr(Vl,{children:[lt(k,{backFn:i,title:"Save Password",closeable:!1}),lt(Q,{}),yr(Vo,{children:[yr(qo,{children:[lt(w2,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),lt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),lt("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."})]}),lt($o,{centered:!0,children:lt(Ku,{children:r})}),yr("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[lt(Bl,{onClick:s,children:a?yr(Vl,{children:[lt(g2,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):yr(Vl,{children:[lt(v2,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),yr(Bl,{onClick:c,children:[lt(y2,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),lt(zo,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),lt(X,{}),lt(G,{protectedByPrivy:!0})]})},b2=(e,t)=>`Your wallet recovery password for ${e} is
|
|
1281
1285
|
|
|
1282
1286
|
${t}
|
|
1283
1287
|
|
|
1284
|
-
You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;import
|
|
1288
|
+
You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;import E2 from"@heroicons/react/24/solid/CheckCircleIcon";import P2 from"@heroicons/react/24/solid/XCircleIcon";import{Fragment as T2,jsx as To,jsxs as zl}from"react/jsx-runtime";var hm=({error:e,onClose:t})=>zl(T2,{children:[To(k,{closeable:!1}),To(Q,{}),e?zl(Gt,{children:[To(P2,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),To(be,{title:"Something went wrong",description:e})]}):zl(Gt,{children:[To(E2,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),To(be,{title:"Success"})]}),To(D,{onClick:t,children:"Close"}),To(X,{}),To(G,{protectedByPrivy:!0})]});import{useReducer as x2}from"react";var S2=(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}},ym=()=>{let[e,t]=x2(S2,"creating");return{send:t,state:e}};import{jsx as ni}from"react/jsx-runtime";var Va=({onSubmit:e,...t})=>{let{send:o,state:r}=ym(),n=gm(async()=>{r==="finalizing"&&await e(),o("next")},[r,o,e]);_2(()=>{let a;return r==="done"&&t.config.initiatedBy==="automatic"&&(a=setTimeout(()=>t.onClose?.(),Qe)),()=>{a&&clearTimeout(a)}},[r,t.config.initiatedBy,t.onClose]);let i=gm(()=>{o("back")},[o]);return r==="creating"?ni(um,{...t,onSubmit:n}):r==="saving"?ni(fm,{...t,onSubmit:n,onBack:i}):r==="confirming"?ni(Zu,{...t,onSubmit:n,onBack:i}):r==="finalizing"?ni(om,{...t,onSubmit:n,onBack:i}):r==="done"?ni(hm,{...t,onSubmit:n}):null};import{Fragment as M2,jsx as gr,jsxs as wm}from"react/jsx-runtime";var Cm=()=>{let{app:e,navigate:t,data:o,onUserCloseViaDialogOrKeybindRef:r}=A(),[n,i]=ii(""),[a,l]=ii(!1),[s,c]=ii(),[u,m]=ii(null),[v,h]=ii(null),w=k2(!1),{authenticated:b,getAccessToken:x}=B(),{refreshUser:C,closePrivyModal:T,createAnalyticsEvent:L,isNewUserThisSession:I,initializeWalletProxy:S}=W(),{onSuccess:U,onFailure:P,callAuthOnSuccessOnClose:F}=o.createWallet,R=e?.embeddedWallets.requireUserPasswordOnCreate===!0,q=!!(!n||w.current)&&!R,ce=new Ze(async()=>V());vm(()=>{u||S(3e4).then(ne=>m(ne))},[u]),vm(()=>{if(!b){t("LANDING"),P(new Error("User must be authenticated before creating a Privy wallet"));return}!R&&!a&&!w.current&&(l(!0),ce.execute().finally(()=>l(!1)))},[R,b]);let H=()=>{R&&v&&v?.recoveryMethod!=="user-passcode"?P(new pt("User created a wallet but failed to set a password for it")):v?U(v):P(new pt("User wallet creation failed")),T({shouldCallAuthOnSuccess:F})};r.current=()=>null;let V=async function(){let ne=await x();if(ne)try{L("embedded_wallet_creation_started");let oe=await S(Ir);if(!oe)throw new Error("walletProxy does not exist.");let $e=1e4,wt=new Promise((ho,ct)=>{setTimeout(()=>{ct(new Error("walletProxy.create timed out."))},$e)});if(!await Promise.race([oe.create({accessToken:ne,recoveryPassword:s}),wt]))throw new Error("walletProxy.create did not send a response.");let qe=await C();if(!qe)throw new Error("Failed to refresh user.");let ie=me(qe);if(!ie)throw new Error("Updated user is missing embedded wallet.");h(ie),L("embedded_wallet_creation_completed",{walletAddress:ie.address}),i(""),w.current=!0,R?t("EMBEDDED_WALLET_CREATED_SCREEN"):I?t("EMBEDDED_WALLET_CREATED_SCREEN"):ie&&(U(ie),T({shouldCallAuthOnSuccess:F}))}catch(oe){if(w.current)return;L("embedded_wallet_creation_failed",{error:oe.toString()}),i("An error has occurred, please try again."),console.warn(oe)}else i("An error has occured, please login again."),L("embedded_wallet_creation_failed",{error:"Missing access token for user."})},j=async()=>{if(!R)return T({shouldCallAuthOnSuccess:F});l(!0);let ne=250;return ce.execute().then(()=>new Promise(oe=>setTimeout(oe,ne))).finally(()=>l(!1))};return!R&&n?wm(M2,{children:[gr(k,{closeable:!1}),wm(Gt,{children:[gr(A2,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),gr(be,{title:"Something went wrong",description:n})]}),gr(D,{onClick:H,children:"Close"}),gr(I2,{})]}):q?gr(en,{}):gr(Va,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:q||!u,buttonLoading:a,buttonHideAnimations:!v&&a,error:n,password:s||"",onClose:H,onPasswordChange:c,onPasswordGenerate:()=>c(Ga()),onSubmit:j})},I2=R2.div`
|
|
1285
1289
|
height: 44px;
|
|
1286
|
-
`;import{useEffect as
|
|
1290
|
+
`;import{useEffect as W2,useState as za}from"react";import{jsx as L2}from"react/jsx-runtime";var bm=()=>{let[e,t]=za(null),[o,r]=za(!1),[n,i]=za(null),[a,l]=za(""),{authenticated:s,getAccessToken:c,user:u}=B(),{walletProxy:m,refreshUser:v,closePrivyModal:h,createAnalyticsEvent:w}=W(),{app:b,navigate:x,data:C,onUserCloseViaDialogOrKeybindRef:T}=A(),{onSuccess:L,onFailure:I}=C.createWallet,S=me(u),U=e?.recoveryMethod==="user-passcode";W2(()=>{s||(x("LANDING"),I(new Mi("User must be authenticated before setting a password on a Privy wallet")))},[s]);let P=()=>{if(n){I(n),h({shouldCallAuthOnSuccess:!1});return}if(!U){I(new pt("Exited before password was added to wallet")),h({shouldCallAuthOnSuccess:!1});return}L(e),h({shouldCallAuthOnSuccess:!1})};T.current=P;let F=async()=>{let q=await c();if(q&&S?.address&&a&&m)try{if(w("embedded_wallet_set_password_started",{walletAddress:S.address}),!(await m.setRecoveryPassword({accessToken:q,address:S.address,recoveryPassword:a})).address){i(new pt("Error setting password on privy wallet")),w("embedded_wallet_set_password_failed",{walletAddress:S.address,reason:"error setting password"});return}let H=await v(),V=me(H);if(!V){i(new pt("Error setting password on privy wallet")),w("embedded_wallet_set_password_failed",{walletAddress:S.address,reason:"wallet disconnected"});return}t(V),w("embedded_wallet_set_password_completed",{walletAddress:S.address})}catch(ce){console.warn(ce),i(ce instanceof Error?ce:new Error("Error setting password on privy wallet")),w("embedded_wallet_set_password_failed",{walletAddress:S.address,reason:ce})}},R=async()=>{U?(L(e),h({shouldCallAuthOnSuccess:!1})):(r(!0),i(null),await F(),r(!1))};return L2(Va,{appName:b?.name||"privy",config:{initiatedBy:"user",onCancel:P},error:n?"An error has occurred, please try again.":void 0,buttonLoading:o,buttonHideAnimations:!1,password:a,onPasswordGenerate:()=>l(Ga()),onPasswordChange:l,onSubmit:R,onClose:P})};import O2 from"@heroicons/react/24/outline/UserCircleIcon";import N2 from"@heroicons/react/24/solid/LockClosedIcon";import{Fragment as D2,jsx as xo,jsxs as $a}from"react/jsx-runtime";var Em=()=>{let{user:e}=B(),{closePrivyModal:t,createAnalyticsEvent:o}=W(),{data:r,setModalData:n,navigate:i,onUserCloseViaDialogOrKeybindRef:a}=A(),{onSuccess:l,onFailure:s}=r.setWalletPassword,c=()=>{s(new pt("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return a.current=c,$a(D2,{children:[xo(k,{onClose:c}),xo(Q,{}),$a(Gt,{children:[$a(iu,{children:[xo(O2,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),xo(au,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:xo(N2,{width:"12px",height:"12px",fill:"white"})})]}),$a(be,{title:"Secure Your Account",children:["Please set a password to secure your account.",xo("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."})]})]}),xo(D,{onClick:()=>{let m=me(e);o("embedded_wallet_set_password_started",{walletAddress:m?.address}),n({createWallet:{onFailure:s,onSuccess:l,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),i("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),xo(X,{}),xo(G,{protectedByPrivy:!0})]})};import U2 from"@heroicons/react/24/outline/ShieldCheckIcon";import{useEffect as F2,useState as qa}from"react";import ja,{css as B2}from"styled-components";import{Fragment as $2,jsx as tt,jsxs as vr}from"react/jsx-runtime";var Pm=()=>{let[e,t]=qa(!0),{authenticated:o,getAccessToken:r}=B(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=W(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=A(),[u,m]=qa(void 0),[v,h]=qa(""),[w,b]=qa(!1),{privyWallet:x,onCompleteNavigateTo:C,onSuccess:T,onFailure:L}=s.recoverWallet,I=(P="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),L(typeof P=="string"?new pt(P):P)};c.current=I,F2(()=>{if(!o||!x)return I("User must be authenticated and have a Privy wallet before it can be recovered")},[o]);let S=P=>{P&&m(P)};return vr($2,{children:[tt(k,{onClose:I}),tt(Q,{}),vr(G2,{children:[vr(H2,{children:[tt(U2,{height:48,width:48,stroke:"var(--privy-color-accent)"}),tt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Load your account"}),tt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),vr("div",{children:[vr($o,{children:[tt(sn,{type:e?"password":"text",onChange:P=>S(P.target.value),disabled:w,style:{paddingRight:"2.3rem"}}),tt(ln,{style:{right:"0.75rem"},children:e?tt(cn,{onClick:()=>t(!1)}):tt(dn,{onClick:()=>t(!0)})})]}),!!v&&tt(V2,{children:v})]}),vr("div",{children:[vr(nu,{children:[tt("h4",{children:"Why is this necessary?"}),tt("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),tt(z2,{loading:w||!n,disabled:!u,onClick:async()=>{b(!0);let P=await r();if(P&&x&&u!==null)try{a("embedded_wallet_recovery_started",{walletAddress:x.address}),await n?.recover({address:x.address,accessToken:P,recoveryPin:u}),h(""),C?l(C):i({shouldCallAuthOnSuccess:!1}),T?.(x),a("embedded_wallet_recovery_completed",{walletAddress:x.address})}catch(F){Du(F)?h("Invalid recovery password, please try again."):h("An error has occurred, please try again.")}finally{b(!1)}else return I("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!x&&w,children:"Recover your account"})]})]}),tt(X,{}),tt(G,{protectedByPrivy:!0})]})},H2=ja.div`
|
|
1287
1291
|
display: flex;
|
|
1288
1292
|
flex-direction: column;
|
|
1289
1293
|
align-items: center;
|
|
@@ -1305,26 +1309,26 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1305
1309
|
font-weight: 400;
|
|
1306
1310
|
line-height: 20px;
|
|
1307
1311
|
}
|
|
1308
|
-
`,
|
|
1312
|
+
`,G2=ja.div`
|
|
1309
1313
|
display: flex;
|
|
1310
1314
|
flex-direction: column;
|
|
1311
1315
|
justify-content: space-between;
|
|
1312
|
-
`,
|
|
1316
|
+
`,V2=ja.div`
|
|
1313
1317
|
line-height: 20px;
|
|
1314
1318
|
height: 20px;
|
|
1315
1319
|
font-size: 13px;
|
|
1316
1320
|
color: var(--privy-color-error);
|
|
1317
1321
|
text-align: left;
|
|
1318
1322
|
margin-top: 0.5rem;
|
|
1319
|
-
|
|
1320
|
-
${e=>e.hideAnimations&&
|
|
1323
|
+
`,z2=ja(D)`
|
|
1324
|
+
${e=>e.hideAnimations&&B2`
|
|
1321
1325
|
&& {
|
|
1322
1326
|
// Remove animations because the recoverWallet task on the iframe partially
|
|
1323
1327
|
// blocks the renderer, so the animation stutters and doesn't look good
|
|
1324
1328
|
transition: none;
|
|
1325
1329
|
}
|
|
1326
1330
|
`}
|
|
1327
|
-
`;import
|
|
1331
|
+
`;import q2 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import j2 from"@heroicons/react/24/outline/PhoneIcon";import $l from"styled-components";import{Fragment as Q2,jsx as jt,jsxs as Ka}from"react/jsx-runtime";var K2=e=>{let t=jt(q2,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof _)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 Pe&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:jt(j2,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof Ue)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:jt(Wa,{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:jt("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:jt("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 Jt&&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}}},Tm=()=>{let{navigate:e,navigateBack:t,data:o,lastScreen:r,currentScreen:n}=A(),{reset:i}=pe(),a=o?.errorModalData,l=K2(a?.error||new Error),s=c=>{if(c instanceof Ue)switch(c.privyErrorCode){case"invalid_captcha":return()=>i()}return()=>{}};return Ka(Q2,{children:[jt(k,{backFn:!r||n===r?void 0:t}),Ka(Y2,{children:[jt(Z2,{children:Ka("div",{children:[jt(Ma,{color:"var(--privy-color-error)"}),l.icon]})}),Ka(J2,{children:[jt("h3",{children:l.title}),jt("p",{children:l.detail})]}),jt(D,{color:"var(--privy-color-error)",onClick:()=>{s(a?.error||new Error)(),e(r||"LANDING",!1)},children:l.ctaText})]})]})},Y2=$l.div`
|
|
1328
1332
|
display: flex;
|
|
1329
1333
|
flex-direction: column;
|
|
1330
1334
|
align-items: center;
|
|
@@ -1332,11 +1336,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1332
1336
|
gap: 24px;
|
|
1333
1337
|
width: 100%;
|
|
1334
1338
|
padding-bottom: 16px;
|
|
1335
|
-
`,
|
|
1339
|
+
`,J2=$l.div`
|
|
1336
1340
|
display: flex;
|
|
1337
1341
|
flex-direction: column;
|
|
1338
1342
|
gap: 8px;
|
|
1339
|
-
`,
|
|
1343
|
+
`,Z2=$l.div`
|
|
1340
1344
|
display: flex;
|
|
1341
1345
|
flex-direction: column;
|
|
1342
1346
|
justify-content: center;
|
|
@@ -1359,7 +1363,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1359
1363
|
left: -19px;
|
|
1360
1364
|
top: -19px;
|
|
1361
1365
|
}
|
|
1362
|
-
`;import{useEffect as Wm,useRef as
|
|
1366
|
+
`;import{useEffect as Wm,useRef as v0,useState as Kl}from"react";import{isMobile as Lm}from"react-device-detect";import Um from"styled-components";import{useState as X2}from"react";import e0 from"styled-components";import{jsx as xm}from"react/jsx-runtime";var Ya=({style:e,color:t,...o})=>xm("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:xm("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});import{jsx as ql}from"react/jsx-runtime";var Sm=({color:e,...t})=>ql("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:ql("g",{children:ql("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"})})});import{jsx as _m,jsxs as o0}from"react/jsx-runtime";var pn=e=>{let[t,o]=X2(!1);return o0(t0,{color:e.color,onClick:()=>{o(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>o(!1),1500)},justCopied:t,children:[t?_m(Ya,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):_m(Sm,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},t0=e0.button`
|
|
1363
1367
|
display: flex;
|
|
1364
1368
|
align-items: center;
|
|
1365
1369
|
gap: 6px;
|
|
@@ -1397,7 +1401,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1397
1401
|
width: 14px;
|
|
1398
1402
|
height: 14px;
|
|
1399
1403
|
}
|
|
1400
|
-
`;import{useState as
|
|
1404
|
+
`;import{useState as r0}from"react";import n0 from"styled-components";import{jsx as a0}from"react/jsx-runtime";var Am=e=>{let[t,o]=r0(!1);return a0(i0,{color:e.color,onClick:()=>{o(!0),window.open(e.url,"_blank"),setTimeout(()=>o(!1),1500)},justOpened:t,children:e.text})},i0=n0.button`
|
|
1401
1405
|
display: flex;
|
|
1402
1406
|
align-items: center;
|
|
1403
1407
|
gap: 6px;
|
|
@@ -1435,7 +1439,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1435
1439
|
width: 14px;
|
|
1436
1440
|
height: 14px;
|
|
1437
1441
|
}
|
|
1438
|
-
`;import
|
|
1442
|
+
`;import s0 from"qrcode";import l0 from"react";import c0 from"styled-components";import{jsx as km}from"react/jsx-runtime";var Rm=()=>km("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:km("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});import{Fragment as ai,jsx as ot,jsxs as Mm}from"react/jsx-runtime";var gt=7,jl=(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},d0=e=>{let t=s0.create(e,{errorCorrectionLevel:"high"}).modules,o=Od(Array.from(t.data),t.size);return o=jl(o,0,0,gt,gt),o=jl(o,o.length-gt,0,gt,gt),o=jl(o,0,o.length-gt,gt,gt),o},p0=({x:e,y:t,cellSize:o,bgColor:r,fgColor:n})=>ot(ai,{children:[0,1,2].map(i=>ot("circle",{r:o*(gt-i*2)/2,cx:e+o*gt/2,cy:t+o*gt/2,fill:i%2!==0?r:n},`finder-${e}-${t}-${i}`))}),u0=({cellSize:e,matrixSize:t,bgColor:o,fgColor:r})=>{let n=[[0,0],[(t-gt)*e,0],[0,(t-gt)*e]];return ot(ai,{children:n.map(([i,a])=>ot(p0,{x:i,y:a,cellSize:e,bgColor:o,fgColor:r},`finder-${i}-${a}`))})},m0=({matrix:e,cellSize:t,color:o})=>ot(ai,{children:e.map((r,n)=>r.map((i,a)=>i?ot("circle",{r:t/2.5,cx:n*t+t/2,cy:a*t+t/2,fill:o},`circle-${n}-${a}`):ot(l0.Fragment,{},`circle-${n}-${a}`)))}),Im=(e,t)=>e-e%t,f0=({outputSize:e,cellSize:t,element:o,size:r,padding:n,bgColor:i})=>{if(!o)return ot(ai,{});let a=r||40,l=n||4,s=o,c=e/2-a/2-l;return Mm(ai,{children:[ot("rect",{x:Im(c,t),y:Im(c,t),width:a+l*2+(c%t?t+.5:.5),height:a+l*2+(c%t?t+.5:.5),fill:i}),ot(s,{x:e/2-a/2,y:e/2-a/2,height:a,width:a})]})},h0=e=>{let t=e.outputSize,o=d0(e.url),r=t/o.length;return Mm("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[ot(m0,{matrix:o,cellSize:r,color:e.fgColor}),ot(u0,{cellSize:r,matrixSize:o.length,fgColor:e.fgColor,bgColor:e.bgColor}),ot(f0,{outputSize:e.outputSize,cellSize:r,element:e.logo?.element,bgColor:e.bgColor})]})},y0=c0.div`
|
|
1439
1443
|
display: flex;
|
|
1440
1444
|
justify-content: center;
|
|
1441
1445
|
align-items: center;
|
|
@@ -1450,7 +1454,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1450
1454
|
border-color: ${e=>e.fgColor};
|
|
1451
1455
|
border-radius: var(--privy-border-radius-md);
|
|
1452
1456
|
}
|
|
1453
|
-
`,
|
|
1457
|
+
`,Ja=e=>{let t=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",r=e.size||160;return ot(y0,{size:r,bgColor:t,fgColor:o,children:ot(h0,{url:e.url,logo:{element:e.squareLogoElement??Rm},outputSize:r,bgColor:t,fgColor:o})})};import{jsx as Za,jsxs as g0}from"react/jsx-runtime";var si=({style:e,...t})=>g0("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:[Za("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),Za("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"}),Za("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"}),Za("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});import{Fragment as Dm,jsx as Ee,jsxs as wr}from"react/jsx-runtime";var Om="#8a63d2",Fm=1e3,w0=Fm*2,C0=Fm*120,Bm=()=>{let{ready:e,authenticated:t,user:o}=B(),{lastScreen:r,navigate:n,navigateBack:i,setModalData:a,app:l}=A(),{getAuthFlow:s,loginWithFarcaster:c,closePrivyModal:u}=W(),[m,v]=Kl(void 0),[h,w]=Kl(!1),[b,x]=Kl(!1),C=v0([]),T=l?.render.inDialog?Qe:0,L=s(),I=L?.meta.connectUri;return Wm(()=>{let S=Date.now(),U=setInterval(async()=>{let P=await L.pollForReady.execute(),F=Date.now()-S;if(P){clearInterval(U),w(!0);try{await c(),x(!0)}catch(R){let q={retryable:!1,message:"Authentication failed"};if(R?.privyErrorCode==="allowlist_rejected"){n("ALLOWLIST_REJECTION_SCREEN");return}else R?.privyErrorCode==="linked_to_another_user"?q.detail="This account has already been linked to another user.":R?.privyErrorCode==="invalid_credentials"?(q.retryable=!0,q.detail="Something went wrong. Try again."):R?.privyErrorCode==="too_many_requests"&&(q.detail="Too many requests. Please wait before trying again.");v(q)}}else F>C0&&(clearInterval(U),v({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},w0);return()=>{clearInterval(U),C.current.forEach(P=>clearTimeout(P))}},[]),Wm(()=>{if(e&&t&&b&&o){if(l?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let U=setTimeout(()=>{n("AFFIRMATIVE_CONSENT_SCREEN")},T);return()=>clearTimeout(U)}b&&(bt(o,l?.embeddedWallets.createOnLogin)?C.current.push(setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:U=>console.error(U),callAuthOnSuccessOnClose:!0}}),n("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},T)):C.current.push(setTimeout(()=>u({shouldCallAuthOnSuccess:!0,isSuccess:!0}),T)))}},[b,e,t,o]),Lm||h?wr(Dm,{children:[Ee(k,{backFn:r?i:void 0,onClose:u},"header"),Ee(Q,{}),wr(Nm,{children:[Ee(b0,{children:wr("div",{children:[Ee(Do,{success:b,fail:!!m}),Ee(si,{style:{width:"38px",height:"38px"}})]})}),wr(Rt,{children:[Ee(Ce,{children:m?m.message:"Signing in with Farcaster"}),Ee(he,{children:m?m.detail:"This should only take a moment"}),Ee(kt,{children:I&&Lm&&Ee(Am,{text:"Take me to Warpcast",url:I,color:Om})})]})]}),Ee(te,{})]}):wr(Dm,{children:[Ee(k,{backFn:r?i:void 0,onClose:u},"header"),Ee(Q,{}),Ee(Nm,{children:wr("div",{children:[Ee(Ce,{children:"Sign in with Farcaster"}),Ee(he,{children:"Scan with your phone's camera to continue."}),Ee(Oa,{children:I?Ee(Ja,{url:I,size:275,squareLogoElement:si}):Ee(Tt,{})}),wr(kt,{children:[Ee(he,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),I&&Ee(pn,{text:I,itemName:"link",color:Om})]})]})}),Ee(te,{})]})},Nm=Um.div`
|
|
1454
1458
|
display: flex;
|
|
1455
1459
|
flex-direction: column;
|
|
1456
1460
|
align-items: center;
|
|
@@ -1458,7 +1462,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1458
1462
|
margin-left: 27px;
|
|
1459
1463
|
margin-right: 27px;
|
|
1460
1464
|
gap: 24px;
|
|
1461
|
-
`,
|
|
1465
|
+
`,b0=Um.div`
|
|
1462
1466
|
display: flex;
|
|
1463
1467
|
flex-direction: column;
|
|
1464
1468
|
justify-content: center;
|
|
@@ -1481,7 +1485,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1481
1485
|
left: -19px;
|
|
1482
1486
|
top: -19px;
|
|
1483
1487
|
}
|
|
1484
|
-
`;import
|
|
1488
|
+
`;import P0 from"@heroicons/react/24/outline/ClockIcon";import T0 from"@heroicons/react/24/outline/EyeSlashIcon";import x0 from"@heroicons/react/24/outline/LinkIcon";import so from"styled-components";import{jsx as Yl,jsxs as E0}from"react/jsx-runtime";var Qa=({size:e=61,...t})=>Yl("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:E0("g",{id:"moonpay_symbol_wht 2",children:[Yl("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),Yl("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});import{Fragment as Hm,jsx as rt,jsxs as Cr}from"react/jsx-runtime";var Jl=({title:e,desc:t,icon:o})=>Cr(I0,{children:[rt(W0,{children:o}),Cr(M0,{children:[rt(k0,{children:e}),rt(R0,{children:t})]})]}),Gm=({app:e,signedUrl:t,onContinue:o})=>Cr(Hm,{children:[Cr(_0,{children:[rt(Qa,{size:"3.75rem"}),Cr(A0,{children:[e?.name," uses ",rt("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),Cr(L0,{children:[rt(Jl,{icon:rt(x0,{width:"1rem"}),title:"Purchase assets to fund your account",desc:Cr(Hm,{children:["Connect a payment method (",rt("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),rt(Jl,{icon:rt(P0,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),rt(Jl,{icon:rt(T0,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),rt(O0,{className:"mobile-only"})]}),rt(S0,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),rt(Pa,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:o,children:"Continue to Moonpay"})]}),S0=so.span`
|
|
1485
1489
|
display: inline-block;
|
|
1486
1490
|
color: var(--privy-color-foreground-3);
|
|
1487
1491
|
text-align: center;
|
|
@@ -1490,13 +1494,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1490
1494
|
font-weight: 400;
|
|
1491
1495
|
line-height: 140%; /* 0.875rem */
|
|
1492
1496
|
margin-bottom: 0.25rem;
|
|
1493
|
-
`,
|
|
1497
|
+
`,_0=so.div`
|
|
1494
1498
|
display: flex;
|
|
1495
1499
|
flex-direction: column;
|
|
1496
1500
|
align-items: center;
|
|
1497
1501
|
justify-content: center;
|
|
1498
1502
|
padding: 1.5rem 0;
|
|
1499
|
-
`,
|
|
1503
|
+
`,A0=so.span`
|
|
1500
1504
|
color: var(--privy-color-foreground);
|
|
1501
1505
|
text-align: center;
|
|
1502
1506
|
font-size: 1.125rem;
|
|
@@ -1505,46 +1509,46 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1505
1509
|
margin: 1.5rem 0;
|
|
1506
1510
|
text-align: center;
|
|
1507
1511
|
max-width: 19.5rem;
|
|
1508
|
-
`,
|
|
1512
|
+
`,k0=so.span`
|
|
1509
1513
|
color: var(--privy-color-foreground);
|
|
1510
1514
|
font-size: 0.875rem;
|
|
1511
1515
|
font-weight: 500;
|
|
1512
1516
|
line-height: 1.225rem;
|
|
1513
1517
|
width: 100%;
|
|
1514
|
-
`,
|
|
1518
|
+
`,R0=so.span`
|
|
1515
1519
|
color: var(--privy-color-foreground-2);
|
|
1516
1520
|
font-size: 0.875rem;
|
|
1517
1521
|
font-weight: 400;
|
|
1518
1522
|
line-height: 1.225rem;
|
|
1519
|
-
`,
|
|
1523
|
+
`,I0=so.div`
|
|
1520
1524
|
display: flex;
|
|
1521
1525
|
align-items: flex-start;
|
|
1522
1526
|
gap: 0.5rem;
|
|
1523
1527
|
align-self: stretch;
|
|
1524
|
-
`,
|
|
1528
|
+
`,M0=so.div`
|
|
1525
1529
|
display: flex;
|
|
1526
1530
|
flex-direction: column;
|
|
1527
1531
|
gap: 0.25rem;
|
|
1528
1532
|
align-items: flex-start;
|
|
1529
1533
|
text-align: left;
|
|
1530
1534
|
flex: 1 0 0;
|
|
1531
|
-
`,
|
|
1535
|
+
`,W0=so.div`
|
|
1532
1536
|
padding-top: 2px;
|
|
1533
|
-
`,
|
|
1537
|
+
`,L0=so.div`
|
|
1534
1538
|
display: flex;
|
|
1535
1539
|
flex-direction: column;
|
|
1536
1540
|
gap: 1.25rem;
|
|
1537
1541
|
margin: 0 0.5rem;
|
|
1538
|
-
`,
|
|
1542
|
+
`,O0=so.div`
|
|
1539
1543
|
margin: 30px 0;
|
|
1540
|
-
`;import{ofetch as
|
|
1544
|
+
`;import{ofetch as N0}from"ofetch";import{useEffect as D0,useRef as U0,useState as F0}from"react";var Xa="moonpay",Vm="sdk_fiat_on_ramp_completed_with_status";async function zm(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 B0(e,t){let o=t?Pd:Ed,r=t?xd:Td;return N0(`${o}/transactions/ext/${e}`,{query:{apiKey:r}})}function $m(e,t=!1){let[o,r]=F0(null),{createAnalyticsEvent:n}=W(),i=U0(0);return D0(()=>{let a=setInterval(async()=>{if(e)try{let[l]=await B0(e,t),s=l.status==="waitingAuthorization"&&l.paymentMethod==="credit_debit_card"?"pending":l.status;r(s),["failed","completed","awaitingAuthorization"].includes(s)&&(n(Vm,{status:s,provider:Xa,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(Vm,{status:"serviceFailure",provider:Xa}),clearInterval(a))}},3e3);return()=>clearInterval(a)},[e,i]),o}import{Fragment as H0,jsx as Zl,jsxs as G0}from"react/jsx-runtime";var qm=()=>{let{app:e,data:t,navigate:o}=A(),{createAnalyticsEvent:r}=W(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:G0(H0,{children:[Zl(k,{title:"Fund account"},"header"),Zl(Gm,{app:e,signedUrl:n,onContinue:()=>{r("sdk_fiat_on_ramp_started",{provider:Xa}),o("FIAT_ON_RAMP_STATUS_SCREEN")}}),Zl(G,{protectedByPrivy:!0})]})};import V0 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import z0 from"@heroicons/react/24/solid/CheckCircleIcon";import $0 from"@heroicons/react/24/solid/XCircleIcon";import{useMemo as q0}from"react";import jm from"styled-components";import{Fragment as Ql,jsx as nt,jsxs as br}from"react/jsx-runtime";var Km=()=>{let{app:e,data:t}=A(),{closePrivyModal:o}=W(),{externalTransactionId:r}=t?.fiatOnRampStatus,n=$m(r||null,e.fiatOnRamp.useSandbox);return br(Ql,{children:[nt(k,{title:"Fund account"},"header"),nt(K0,{status:n,onClickCta:o}),nt(G,{protectedByPrivy:!0})]})},j0=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:br(Ql,{children:[br("p",{children:["It looks like there was an issue with your payment. Please contact"," ",nt("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),nt("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:""}}},K0=({status:e,onClickCta:t})=>{let{title:o,body:r,cta:n}=q0(()=>j0(e),[e]);return br(Ql,{children:[br(X0,{children:[nt(Z0,{status:e}),br(Rt,{children:[nt("h3",{children:o}),nt(Q0,{children:r})]})]}),n&&nt(D,{onClick:t,children:n})]})},Y0=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)",J0=e=>{switch(e){case"serviceFailure":case"failed":return $0;case"completed":return z0;case"waitingAuthorization":return()=>nt(V0,{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}},Z0=({status:e})=>{if(!e||e==="pending"){let r="var(--privy-color-foreground-4)";return br("div",{style:{position:"relative"},children:[nt(Tt,{color:r,style:{position:"absolute"}}),nt(pl,{color:r}),nt(Qa,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=J0(e),o=Y0(e);return nt("div",{style:{borderColor:o,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&nt(t,{width:"4rem",height:"4rem",color:o})})},Q0=jm.p`
|
|
1541
1545
|
font-size: 1rem;
|
|
1542
1546
|
color: var(--privy-color-foreground-3);
|
|
1543
1547
|
margin-bottom: 1rem;
|
|
1544
1548
|
display: flex;
|
|
1545
1549
|
flex-direction: column;
|
|
1546
1550
|
gap: 1rem;
|
|
1547
|
-
`,
|
|
1551
|
+
`,X0=jm.div`
|
|
1548
1552
|
display: flex;
|
|
1549
1553
|
flex-direction: column;
|
|
1550
1554
|
align-items: center;
|
|
@@ -1552,7 +1556,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1552
1556
|
margin-left: 1.75rem;
|
|
1553
1557
|
margin-right: 1.75rem;
|
|
1554
1558
|
padding: 2rem 0;
|
|
1555
|
-
`;import
|
|
1559
|
+
`;import ew from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import tw from"styled-components";import{Fragment as rw,jsx as jo,jsxs as nw}from"react/jsx-runtime";var Ym=()=>{let{closePrivyModal:e}=W();return nw(rw,{children:[jo(k,{},"header"),jo(ow,{children:jo(ew,{style:{width:32,height:32}})}),jo(no,{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"}}),jo(At,{children:jo(D,{onClick:()=>e(),children:"Close"})}),jo(X,{}),jo(G,{protectedByPrivy:!0})]})},ow=tw.div`
|
|
1556
1560
|
border-radius: 50%;
|
|
1557
1561
|
height: 68px;
|
|
1558
1562
|
width: 68px;
|
|
@@ -1562,18 +1566,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1562
1566
|
background-color: var(--privy-color-accent);
|
|
1563
1567
|
color: white;
|
|
1564
1568
|
margin: 0 auto 24px auto;
|
|
1565
|
-
`;import*as Xm from"react-device-detect";import
|
|
1569
|
+
`;import*as Xm from"react-device-detect";import lw from"styled-components";import Xl from"styled-components";import{jsx as Jm}from"react/jsx-runtime";var Zm=({style:e,...t})=>Jm("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:Jm("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});import{jsx as aw,jsxs as sw}from"react/jsx-runtime";var Qm=Xl.div`
|
|
1566
1570
|
display: flex;
|
|
1567
1571
|
flex-direction: column;
|
|
1568
1572
|
justify-content: flex-start;
|
|
1569
1573
|
gap: 4px;
|
|
1570
|
-
`,Xl
|
|
1574
|
+
`,ec=Xl.div`
|
|
1571
1575
|
&&& {
|
|
1572
1576
|
margin-left: 7px; /* TODO: This is a total hack */
|
|
1573
1577
|
border-left: 2px solid var(--privy-color-foreground-4);
|
|
1574
1578
|
height: 12px;
|
|
1575
1579
|
}
|
|
1576
|
-
`,
|
|
1580
|
+
`,es=({children:e})=>sw(iw,{children:[aw(Zm,{style:{width:"16px",height:"16px"}}),e]}),iw=Xl.div`
|
|
1577
1581
|
display: flex;
|
|
1578
1582
|
justify-content: flex-start;
|
|
1579
1583
|
justify-items: center;
|
|
@@ -1591,21 +1595,25 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1591
1595
|
margin-bottom: auto;
|
|
1592
1596
|
}
|
|
1593
1597
|
}
|
|
1594
|
-
`;import{Fragment as
|
|
1598
|
+
`;import{Fragment as pw,jsx as Me,jsxs as li}from"react/jsx-runtime";var cw=()=>{let{navigate:e}=A(),t="https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en";return Xm.isFirefox&&(t="https://addons.mozilla.org/en-US/firefox/addon/phantom-app/"),li(dw,{children:[Me(qn,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),Me(kt,{children:Me(Xt,{style:{width:"152px",height:"152px"}})}),li(Qm,{children:[Me(es,{children:li("div",{children:[Me("span",{children:"Install the "}),Me("a",{href:t,target:"_blank",children:"Phantom browser extension"})]})}),Me(ec,{}),Me(es,{children:"Set up your first wallet"}),Me(ec,{}),Me(es,{children:"Store your recovery phrase in a safe place!"})]}),Me(Ta,{onClick:()=>e("LANDING"),children:"Done! I have my wallet"})]})},ef=()=>{let{navigateBack:e}=A();return li(pw,{children:[Me(k,{backFn:e},"header"),Me(Q,{}),Me(cw,{}),Me(X,{}),li(te,{children:[Me("span",{children:"Still not sure? "}),Me("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},dw=lw(kt)`
|
|
1595
1599
|
gap: 30px;
|
|
1596
1600
|
|
|
1597
1601
|
> :first-child > svg {
|
|
1598
1602
|
margin-top: 20px;
|
|
1599
1603
|
}
|
|
1600
|
-
`;import
|
|
1604
|
+
`;import qw from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as jw,useState as vf}from"react";import{isMobile as Kw}from"react-device-detect";import Yw from"styled-components";import gw from"@heroicons/react/24/outline/EnvelopeIcon";import{useRef as vw}from"react";import uw from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as mw,useState as tf}from"react";import rf from"styled-components";import{Fragment as yw,jsx as ci,jsxs as of}from"react/jsx-runtime";var ts=mw((e,t)=>{let[o,r]=tf(""),[n,i]=tf(!1),{authenticated:a}=B(),{initLoginWithEmail:l}=W(),{navigate:s,setModalData:c,currentScreen:u}=A(),{enabled:m,token:v}=pe(),h=zi(o),w=n,b=n||!h,x=T=>{i(!0),l(o,T).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(L=>{c({errorModalData:{error:L,previousScreen:u||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},C=()=>{m&&!v&&!a?(c({captchaModalData:{callback:T=>l(o,T),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):x(v)};return of(yw,{children:[ci(fw,{children:of(hw,{stacked:e.stacked,children:[ci(uw,{}),ci("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:T=>r(T.target.value),onKeyUp:T=>{T.key==="Enter"&&C()},value:o,autoComplete:"email"}),e.stacked?null:ci(Vr,{isSubmitting:w,onClick:C,disabled:b,children:"Submit"})]})}),e.stacked?ci(D,{loadingText:null,loading:w,disabled:b,onClick:C,children:"Submit"}):null]})}),fw=rf.div`
|
|
1601
1605
|
width: 100%;
|
|
1602
|
-
`,
|
|
1606
|
+
`,hw=rf.label`
|
|
1603
1607
|
display: block;
|
|
1604
1608
|
position: relative;
|
|
1605
1609
|
width: 100%;
|
|
1606
1610
|
background-color: var(--privy-color-background);
|
|
1607
1611
|
transition: background-color 200ms ease;
|
|
1608
1612
|
|
|
1613
|
+
overflow: hidden;
|
|
1614
|
+
text-overflow: ellipsis;
|
|
1615
|
+
white-space: nowrap;
|
|
1616
|
+
|
|
1609
1617
|
> svg {
|
|
1610
1618
|
position: absolute;
|
|
1611
1619
|
margin: 13px 17px;
|
|
@@ -1619,6 +1627,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1619
1627
|
line-height: 24px;
|
|
1620
1628
|
|
|
1621
1629
|
padding: 12px 88px 12px 52px;
|
|
1630
|
+
padding-right: ${e=>e.stacked?"16px":"88px"};
|
|
1622
1631
|
flex-grow: 1;
|
|
1623
1632
|
background: var(--privy-color-background);
|
|
1624
1633
|
border: 1px solid var(--privy-color-foreground-4);
|
|
@@ -1657,9 +1666,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1657
1666
|
&& > input::placeholder {
|
|
1658
1667
|
color: var(--privy-color-foreground-3);
|
|
1659
1668
|
}
|
|
1660
|
-
`;import{Fragment as
|
|
1669
|
+
`;import{Fragment as ww,jsx as os,jsxs as nf}from"react/jsx-runtime";var rs=({isEditable:e,setIsEditable:t})=>{let o=vw(null);return nf(ww,{children:[os(bo,{if:!e,children:os(ts,{ref:o})}),os(bo,{if:e,children:nf(we,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[os(gw,{})," Continue with Email"]})})]})};import{useState as Cw}from"react";import{jsx as tc,jsxs as bw}from"react/jsx-runtime";var ns=()=>{let[e,t]=Cw(!1),{currentScreen:o,navigate:r,setModalData:n}=A(),{enabled:i,token:a}=pe(),{initLoginWithFarcaster:l}=W();return bw(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:[tc(si,{})," Farcaster",e&&tc("span",{children:tc(pr,{})})]})};import Lw from"@heroicons/react/24/outline/PhoneIcon";import{useRef as Ow}from"react";import{forwardRef as Rw,useState as oc}from"react";import pf from"styled-components";import Ew from"libphonenumber-js/examples.mobile.json";import{isPossiblePhoneNumber as Pw,AsYouType as Tw,getCountries as xw,getCountryCallingCode as is,getExampleNumber as Sw}from"libphonenumber-js/min";import{jsx as kw,jsxs as Aw}from"react/jsx-runtime";var di=(e,t)=>Pw(String(e),t),as=(e,t)=>`+${is(t)} ${e}`,af=e=>`*${e.replaceAll("-","").slice(-4)}`,sf=e=>new Tw(e),_w=xw().map(e=>({code:e,callCode:is(e)})),lf=e=>{let t=Sw(e,Ew)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},cf=({value:e,onChange:t})=>kw("select",{value:e,onChange:t,children:_w.map(o=>Aw("option",{value:o.code,children:[o.code," +",o.callCode]},o.code))});import{Fragment as Ww,jsx as pi,jsxs as df}from"react/jsx-runtime";var un=Rw((e,t)=>{let{app:o}=A(),[r,n]=oc(""),[i,a]=oc(o?.intl.defaultCountry??"US"),l=di(r,i),s=sf(i),c=lf(i),u=is(i),m=!l,[v,h]=oc(!1),w=u.length,b=T=>{let L=T.target.value;a(L),n(""),e.onChange&&e.onChange({rawPhoneNumber:r,qualifiedPhoneNumber:as(r,L),countryCode:L,isValid:di(r,i)})},x=T=>{try{let L=T.replace(/\D/g,""),I=r.replace(/\D/g,""),S=L===I?T:s.input(T);n(S),e.onChange&&e.onChange({rawPhoneNumber:S,qualifiedPhoneNumber:as(T,i),countryCode:i,isValid:di(T,i)})}catch(L){console.error("Error processing phone number:",L)}},C=()=>{h(!0);let T=as(r,i);e.onSubmit({rawPhoneNumber:r,qualifiedPhoneNumber:T,countryCode:i,isValid:di(r,i)}).finally(()=>h(!1))};return df(Ww,{children:[pi(Iw,{children:df(Mw,{callingCodeLength:w,stacked:e.stacked,children:[pi(cf,{value:i,onChange:b}),pi("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:c,onChange:T=>{x(T.target.value)},onKeyUp:T=>{T.key==="Enter"&&C()},value:r,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?pi(Vr,{isSubmitting:v,onClick:C,disabled:m,children:"Submit"}):null]})}),e.stacked&&!e.noIncludeSubmitButton?pi(D,{loading:v,loadingText:null,onClick:C,disabled:m,children:"Submit"}):null]})}),Iw=pf.div`
|
|
1661
1670
|
width: 100%;
|
|
1662
|
-
`,
|
|
1671
|
+
`,Mw=pf.label`
|
|
1663
1672
|
--country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
|
|
1664
1673
|
--phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px));
|
|
1665
1674
|
display: block;
|
|
@@ -1668,6 +1677,10 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1668
1677
|
background-color: var(--privy-color-background);
|
|
1669
1678
|
transition: background-color 200ms ease;
|
|
1670
1679
|
|
|
1680
|
+
overflow: hidden;
|
|
1681
|
+
text-overflow: ellipsis;
|
|
1682
|
+
white-space: nowrap;
|
|
1683
|
+
|
|
1671
1684
|
/* Tablet and Up */
|
|
1672
1685
|
@media (min-width: 441px) {
|
|
1673
1686
|
--country-code-dropdown-width: calc(52px + calc(10 * ${e=>e.callingCodeLength}px));
|
|
@@ -1700,13 +1713,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1700
1713
|
&& > input {
|
|
1701
1714
|
font-size: 16px;
|
|
1702
1715
|
line-height: 24px;
|
|
1703
|
-
|
|
1716
|
+
overflow: hidden;
|
|
1704
1717
|
white-space: nowrap;
|
|
1705
1718
|
text-overflow: ellipsis;
|
|
1706
1719
|
width: calc(100% - var(--country-code-dropdown-width));
|
|
1707
1720
|
|
|
1708
1721
|
padding: 12px 88px 12px
|
|
1709
1722
|
calc(var(--country-code-dropdown-width) + var(--phone-input-extra-padding-left));
|
|
1723
|
+
padding-right: ${e=>e.stacked?"16px":"88px"};
|
|
1710
1724
|
flex-grow: 1;
|
|
1711
1725
|
background: var(--privy-color-background);
|
|
1712
1726
|
border: 1px solid var(--privy-color-foreground-4);
|
|
@@ -1745,11 +1759,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1745
1759
|
&& > input::placeholder {
|
|
1746
1760
|
color: var(--privy-color-foreground-3);
|
|
1747
1761
|
}
|
|
1748
|
-
`;import{Fragment as Dw,jsx as as,jsxs as uf}from"react/jsx-runtime";var ss=({isEditable:e,setIsEditable:t})=>{let o=Nw(null),{authenticated:r}=G(),{navigate:n,setModalData:i,currentScreen:a}=S(),{initLoginWithSms:l}=M(),{enabled:s,token:c}=ce();async function u({qualifiedPhoneNumber:m}){if(s&&!c&&!r)i({captchaModalData:{callback:h=>l(m,h),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(m,c),n("AWAITING_PASSWORDLESS_CODE")}catch(h){i({errorModalData:{error:h,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return uf(Dw,{children:[as(vo,{if:!e,children:as(mn,{ref:o,onSubmit:u})}),as(vo,{if:e,children:uf(ge,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[as(Ow,{})," Continue with SMS"]})})]})};import{jsx as mf,jsxs as Uw}from"react/jsx-runtime";var ls=({style:e,...t})=>Uw("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[mf("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),mf("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});import{jsx as di,jsxs as Fw}from"react/jsx-runtime";var cs=({style:e,...t})=>Fw("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:[di("g",{clipPath:"url(#clip0)",children:di("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"})}),di("defs",{children:di("clipPath",{id:"clip0",children:di("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as ff}from"react/jsx-runtime";var ds=({style:e,...t})=>ff("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:ff("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"})});import{jsx as ps,jsxs as Bw}from"react/jsx-runtime";var us=({style:e,...t})=>Bw("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:[ps("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"}),ps("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"}),ps("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"}),ps("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});import{jsx as ms}from"react/jsx-runtime";function fs({style:e,...t}){return ms("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:ms("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:ms("g",{transform:"scale(5.12,5.12)",children:ms("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}import{jsx as hf,jsxs as Hw}from"react/jsx-runtime";function hs(e){return Hw("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[hf("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"}),hf("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}import{jsx as oc,jsxs as Gw}from"react/jsx-runtime";function ys(e){return Gw("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:[oc("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"}),oc("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"}),oc("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}import{jsx as yf}from"react/jsx-runtime";var gs=({style:e,...t})=>yf("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:yf("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"})});import{jsx as jo,jsxs as zw}from"react/jsx-runtime";var Vw={apple:{logo:jo(ls,{}),displayName:"Apple"},discord:{logo:jo(cs,{}),displayName:"Discord"},github:{logo:jo(ds,{}),displayName:"GitHub"},google:{logo:jo(us,{}),displayName:"Google"},linkedin:{logo:jo(fs,{}),displayName:"LinkedIn"},spotify:{logo:jo(hs,{}),displayName:"Spotify"},twitter:{logo:jo(gs,{}),displayName:"Twitter"},tiktok:{logo:jo(ys,{}),displayName:"TikTok"}},We=({provider:e})=>{let{enabled:t,token:o}=ce(),{navigate:r,setModalData:n}=S(),{initLoginWithOAuth:i}=M(),{displayName:a,logo:l}=Vw[e];return zw(ge,{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]})};import $w from"@heroicons/react/24/outline/ChevronRightIcon";import{jsx as gf,jsxs as qw}from"react/jsx-runtime";var vs=({onClick:e,text:t,icon:o})=>qw(ge,{onClick:e,children:[o,gf(xa,{children:t}),gf($w,{})]});import{Fragment as rc,jsx as Le,jsxs as Cs}from"react/jsx-runtime";var bs=({connectOnly:e})=>{let{closePrivyModal:t,connectors:o}=M(),{app:r,onUserCloseViaDialogOrKeybindRef:n}=S(),i=r.loginMethodsAndOrder?.primary??[],a=r.loginMethodsAndOrder?.overflow??[],l=[...i,...a],[s,c]=vf("default"),[u,m]=vf("email");Kw(()=>{let x=l.indexOf("sms"),O=l.indexOf("email");x>-1&&x<O&&m("sms")},[i,a]);let h=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{c("default")},150)};n.current=h;let y=x=>x==="email"?Le(os,{isEditable:u==="email",setIsEditable:()=>{m("email")}},x):x==="sms"?Le(ss,{isEditable:u==="sms",setIsEditable:()=>{m("sms")}},x):x==="apple"?Le(We,{provider:"apple"},x):x==="discord"?Le(We,{provider:"discord"},x):x==="farcaster"?Le(rs,{},x):x==="github"?Le(We,{provider:"github"},x):x==="google"?Le(We,{provider:"google"},x):x==="linkedin"?Le(We,{provider:"linkedin"},x):x==="tiktok"?Le(We,{provider:"tiktok"},x):x==="twitter"&&(!Yw||r?.loginConfig.twitterOAuthOnMobileEnabled)?Le(We,{provider:"twitter"},x):Kn([x],o,e,l),C=i.map(y).flat(),E=a.map(y).flat(),T=[...C,...E],b=Zw({primary:C.length,overflow:E.length}),[_,R]=Ld(T,b);return Cs(rc,{children:[Le(A,{title:"Log in or sign up",onClose:h,backFn:s==="default"?void 0:()=>{c("default")}}),s==="default"&&Le(Qw,{}),Le(Sa,{style:{overflow:"hidden",padding:2},children:Cs(xt,{children:[s==="default"&&Cs(rc,{children:[..._,R.length>0&&Le(vs,{text:"More options",icon:Le(jw,{}),onClick:()=>c("overflow")})]}),s==="overflow"&&Cs(rc,{children:[...R]})]})}),r&&Le($r,{app:r}),Le(V,{protectedByPrivy:!0})]})},ws=5,Zw=({primary:e,overflow:t})=>e<ws?e:e===ws&&t===0?ws:ws-1,Qw=Jw(Xr)`
|
|
1762
|
+
`;import{Fragment as Nw,jsx as ss,jsxs as uf}from"react/jsx-runtime";var ls=({isEditable:e,setIsEditable:t})=>{let o=Ow(null),{authenticated:r}=B(),{navigate:n,setModalData:i,currentScreen:a}=A(),{initLoginWithSms:l}=W(),{enabled:s,token:c}=pe();async function u({qualifiedPhoneNumber:m}){if(s&&!c&&!r)i({captchaModalData:{callback:v=>l(m,v),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(m,c),n("AWAITING_PASSWORDLESS_CODE")}catch(v){i({errorModalData:{error:v,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return uf(Nw,{children:[ss(bo,{if:!e,children:ss(un,{ref:o,onSubmit:u})}),ss(bo,{if:e,children:uf(we,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[ss(Lw,{})," Continue with SMS"]})})]})};import{jsx as mf,jsxs as Dw}from"react/jsx-runtime";var cs=({style:e,...t})=>Dw("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[mf("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),mf("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});import{jsx as ui,jsxs as Uw}from"react/jsx-runtime";var ds=({style:e,...t})=>Uw("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:[ui("g",{clipPath:"url(#clip0)",children:ui("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"})}),ui("defs",{children:ui("clipPath",{id:"clip0",children:ui("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as ff}from"react/jsx-runtime";var ps=({style:e,...t})=>ff("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:ff("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"})});import{jsx as us,jsxs as Fw}from"react/jsx-runtime";var ms=({style:e,...t})=>Fw("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:[us("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"}),us("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"}),us("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"}),us("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});import{jsx as fs}from"react/jsx-runtime";function hs({style:e,...t}){return fs("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:fs("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:fs("g",{transform:"scale(5.12,5.12)",children:fs("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}import{jsx as hf,jsxs as Bw}from"react/jsx-runtime";function ys(e){return Bw("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[hf("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"}),hf("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}import{jsx as rc,jsxs as Hw}from"react/jsx-runtime";function gs(e){return Hw("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:[rc("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"}),rc("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"}),rc("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}import{jsx as yf}from"react/jsx-runtime";var vs=({style:e,...t})=>yf("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:yf("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"})});import{jsx as Ko,jsxs as Vw}from"react/jsx-runtime";var Gw={apple:{logo:Ko(cs,{}),displayName:"Apple"},discord:{logo:Ko(ds,{}),displayName:"Discord"},github:{logo:Ko(ps,{}),displayName:"GitHub"},google:{logo:Ko(ms,{}),displayName:"Google"},linkedin:{logo:Ko(hs,{}),displayName:"LinkedIn"},spotify:{logo:Ko(ys,{}),displayName:"Spotify"},twitter:{logo:Ko(vs,{}),displayName:"Twitter"},tiktok:{logo:Ko(gs,{}),displayName:"TikTok"}},We=({provider:e})=>{let{enabled:t,token:o}=pe(),{navigate:r,setModalData:n}=A(),{initLoginWithOAuth:i}=W(),{displayName:a,logo:l}=Gw[e];return Vw(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]})};import zw from"@heroicons/react/24/outline/ChevronRightIcon";import{jsx as gf,jsxs as $w}from"react/jsx-runtime";var ws=({onClick:e,text:t,icon:o})=>$w(we,{onClick:e,children:[o,gf(Sa,{children:t}),gf(zw,{})]});import{Fragment as nc,jsx as Le,jsxs as bs}from"react/jsx-runtime";var Es=({connectOnly:e})=>{let{closePrivyModal:t,connectors:o}=W(),{app:r,onUserCloseViaDialogOrKeybindRef:n}=A(),i=r.loginMethodsAndOrder?.primary??[],a=r.loginMethodsAndOrder?.overflow??[],l=[...i,...a],[s,c]=vf("default"),[u,m]=vf("email");jw(()=>{let S=l.indexOf("sms"),U=l.indexOf("email");S>-1&&S<U&&m("sms")},[i,a]);let v=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{c("default")},150)};n.current=v;let h=S=>S==="email"?Le(rs,{isEditable:u==="email",setIsEditable:()=>{m("email")}},S):S==="sms"?Le(ls,{isEditable:u==="sms",setIsEditable:()=>{m("sms")}},S):S==="apple"?Le(We,{provider:"apple"},S):S==="discord"?Le(We,{provider:"discord"},S):S==="farcaster"?Le(ns,{},S):S==="github"?Le(We,{provider:"github"},S):S==="google"?Le(We,{provider:"google"},S):S==="linkedin"?Le(We,{provider:"linkedin"},S):S==="tiktok"?Le(We,{provider:"tiktok"},S):S==="twitter"&&(!Kw||r?.loginConfig.twitterOAuthOnMobileEnabled)?Le(We,{provider:"twitter"},S):Jn([S],o,e,l),w=i.map(h).flat(),b=a.map(h).flat(),x=[...w,...b],C=Jw({primary:w.length,overflow:b.length}),[T,L]=Ld(x,C);return bs(nc,{children:[Le(k,{title:"Log in or sign up",onClose:v,backFn:s==="default"?void 0:()=>{c("default")}}),s==="default"&&Le(Zw,{}),Le(_a,{style:{overflow:"hidden",padding:2},children:bs(_t,{children:[s==="default"&&bs(nc,{children:[...T,L.length>0&&Le(ws,{text:"More options",icon:Le(qw,{}),onClick:()=>c("overflow")})]}),s==="overflow"&&bs(nc,{children:[...L]})]})}),r&&Le(zr,{app:r}),Le(G,{protectedByPrivy:!0})]})},Cs=5,Jw=({primary:e,overflow:t})=>e<Cs?e:e===Cs&&t===0?Cs:Cs-1,Zw=Yw(Qr)`
|
|
1749
1763
|
margin-bottom: 16px;
|
|
1750
|
-
`;import
|
|
1764
|
+
`;import tC from"@heroicons/react/24/outline/EnvelopeIcon";import oC from"@heroicons/react/24/outline/PhoneIcon";import rC from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as nC,useState as Ef}from"react";import{isMobile as iC}from"react-device-detect";import aC from"styled-components";import{jsx as mi,jsxs as wf}from"react/jsx-runtime";var Cf=({...e})=>wf("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[wf("g",{clipPath:"url(#clip0_2856_1743)",children:[mi("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"}),mi("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"})]}),mi("defs",{children:mi("clipPath",{id:"clip0_2856_1743",children:mi("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});import Qw from"@heroicons/react/24/outline/ChevronRightIcon";import Xw from"@heroicons/react/24/outline/WalletIcon";import{jsx as ic,jsxs as eC}from"react/jsx-runtime";var bf=({onClick:e,text:t})=>eC(we,{onClick:e,children:[ic(Xw,{}),ic(Sa,{children:t}),ic(Qw,{})]});import{Fragment as fi,jsx as ge,jsxs as mn}from"react/jsx-runtime";var Ps=({connectOnly:e})=>{let{closePrivyModal:t,connectors:o}=W(),{app:r,onUserCloseViaDialogOrKeybindRef:n}=A(),{email:i,sms:a,google:l,twitter:s,discord:c,github:u,spotify:m,tiktok:v,linkedin:h,apple:w,wallet:b,farcaster:x}=r?.loginMethods??{},C=r?.appearance.loginGroupPriority||"web2-first",T=r?.appearance.hideDirectWeb2Inputs,[L,I]=Ef("default"),[S,U]=Ef(i?"email":"sms");nC(()=>{U(i?"email":"sms")},[i]);let P=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{I("default")},150)};n.current=P;let F=[i&&ge(rs,{isEditable:S==="email",setIsEditable:()=>{U("email")}}),a&&ge(ls,{isEditable:S==="sms",setIsEditable:()=>{U("sms")}})].filter(Boolean),R=[l&&ge(We,{provider:"google"}),s&&(!iC||r?.loginConfig.twitterOAuthOnMobileEnabled)&&ge(We,{provider:"twitter"}),c&&ge(We,{provider:"discord"}),u&&ge(We,{provider:"github"}),m&&ge(We,{provider:"spotify"}),v&&ge(We,{provider:"tiktok"}),h&&ge(We,{provider:"linkedin"}),w&&ge(We,{provider:"apple"}),x&&ge(ns,{})].filter(Boolean),q=Jn(r.appearance.walletList,o,e,r.appearance.walletList),ce=L==="default"?void 0:()=>{I("default")},H=lC({priority:C,email:i,sms:a,social:R}),V=cC({priority:C,email:i,sms:a,social:R}),j=dC({priority:C,email:i,sms:a,social:R}),ne=ge(bf,{text:j,onClick:()=>I("web3-overflow")}),oe=ge(ws,{text:H,icon:V,onClick:()=>I("web2-overflow")}),$e=T?0:1;return mn(fi,{children:[ge(k,{title:"Log in or sign up",onClose:P,backFn:ce}),L==="default"&&ge(sC,{}),ge(_a,{style:{overflow:"hidden",padding:2},children:mn(_t,{children:[L==="default"&&C==="web2-first"&&mn(fi,{children:[...F,...R.length+F.length>4?R.slice(0,3-F.length):R,F.length+R.length>4&&oe,b&&ne]}),L==="default"&&C==="web3-first"&&mn(fi,{children:[b&&mn(fi,{children:[...q.length>4?q.slice(0,3):q,q.length>4&&ne]}),F.length+R.length>$e&&oe,F.length+R.length===$e&&F.length?F[0]:null,F.length+R.length===$e&&R.length?R[0]:null]}),L==="web2-overflow"&&mn(fi,{children:[...C==="web3-first"?F:[],...R]}),...L==="web3-overflow"?q:[]]})}),r&&ge(zr,{app:r}),ge(G,{protectedByPrivy:!0})]})},sC=aC(Qr)`
|
|
1751
1765
|
margin-bottom: 16px;
|
|
1752
|
-
`,
|
|
1766
|
+
`,lC=({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",cC=({priority:e,email:t,sms:o,social:r})=>e==="web2-first"||r.length>0?ge(rC,{}):t&&o?ge(Cf,{}):t?ge(tC,{}):o?ge(oC,{}):null,dC=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";import{jsx as Pf}from"react/jsx-runtime";var Tf=()=>{let{app:e}=A();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?Pf(Es,{connectOnly:!0}):Pf(Ps,{connectOnly:!0})};import{jsx as xf}from"react/jsx-runtime";var Sf=()=>{let{app:e}=A();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?xf(Es,{connectOnly:!1}):xf(Ps,{connectOnly:!1})};import pC from"@heroicons/react/24/outline/EnvelopeIcon";import{Fragment as uC,jsx as Yo,jsxs as mC}from"react/jsx-runtime";var _f=()=>{let{app:e}=A();return mC(uC,{children:[Yo(k,{},"header"),Yo(Q,{}),Yo(be,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:Yo(pC,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Yo(At,{children:Yo(ts,{stacked:!0})}),Yo(X,{}),Yo(G,{protectedByPrivy:!0})]})};import fC from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as hC,jsx as Jo,jsxs as yC}from"react/jsx-runtime";var Af=()=>{let{app:e,currentScreen:t,data:o,navigate:r,setModalData:n}=A(),{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 yC(hC,{children:[Jo(k,{},"header"),Jo(Q,{}),Jo(be,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:Jo(fC,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),Jo(At,{children:Jo(un,{stacked:!0,onSubmit:a})}),Jo(X,{}),Jo(G,{protectedByPrivy:!0})]})};import{Fragment as gC,jsx as hi,jsxs as vC}from"react/jsx-runtime";var kf=()=>{let{linkingHint:e}=W(),{app:t}=A(),o=e?`Select the wallet with ${Wo(e)} and follow the instructions to reconnect your wallet${t?.name?` to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return vC(gC,{children:[hi(k,{},"header"),hi(no,{title:`${e?"Reconnect":"Connect"} your wallet`,description:o}),hi(_t,{children:hi(Zr,{connectOnly:!1})}),hi(G,{protectedByPrivy:!0})]})};import{jsx as Rf,jsxs as wC}from"react/jsx-runtime";var If=({style:e,...t})=>wC("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:[Rf("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),Rf("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});import{Fragment as CC,jsx as Zo,jsxs as Mf}from"react/jsx-runtime";var Wf=()=>{let{closePrivyModal:e}=W(),{navigate:t}=A();return Mf(CC,{children:[Zo(k,{},"header"),Zo(Q,{}),Zo(If,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),Zo(no,{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"}}),Mf(At,{children:[Zo(D,{onClick:()=>t("LANDING"),children:"Try again"}),Zo(Ht,{onClick:()=>e(),children:"Cancel"})]}),Zo(X,{}),Zo(G,{protectedByPrivy:!0})]})};import Gf from"@heroicons/react/20/solid/CheckIcon";import HC from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import GC from"@heroicons/react/24/outline/FingerPrintIcon";import VC from"@heroicons/react/24/outline/PhoneIcon";import Vf from"@heroicons/react/24/outline/TrashIcon";import zC from"@heroicons/react/24/solid/CheckBadgeIcon";import zf from"@heroicons/react/24/solid/CheckCircleIcon";import $f from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import $C from"@heroicons/react/24/solid/IdentificationIcon";import pc from"@heroicons/react/24/solid/PhoneIcon";import dc from"@heroicons/react/24/solid/ShieldCheckIcon";import{useEffect as qf,useState as So}from"react";import{useState as lc}from"react";import{isMobile as SC}from"react-device-detect";import Uf from"styled-components";import{Dialog as Lf,Transition as ac}from"@headlessui/react";import sc from"react";import hn from"styled-components";import{jsx as fn,jsxs as xC}from"react/jsx-runtime";var Of=({children:e,open:t,onClick:o,...r})=>fn(ac,{show:t,as:sc.Fragment,children:xC(Lf,{onClose:o,...r,as:EC,children:[fn(ac.Child,{as:sc.Fragment,enterFrom:"entering",leaveTo:"leaving",children:fn(bC,{"aria-hidden":"true"})}),fn(PC,{children:fn(ac.Child,{as:sc.Fragment,enterFrom:"entering",leaveTo:"leaving",children:fn(Lf.Panel,{as:TC,children:e})})})]})}),yn=hn.div`
|
|
1753
1767
|
display: flex;
|
|
1754
1768
|
flex-direction: column;
|
|
1755
1769
|
text-align: center;
|
|
@@ -1772,7 +1786,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1772
1786
|
box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
|
|
1773
1787
|
border-radius: var(--privy-border-radius-lg);
|
|
1774
1788
|
}
|
|
1775
|
-
`,
|
|
1789
|
+
`,bC=hn.div`
|
|
1776
1790
|
position: fixed;
|
|
1777
1791
|
inset: 0;
|
|
1778
1792
|
|
|
@@ -1785,10 +1799,10 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1785
1799
|
backdrop-filter: unset;
|
|
1786
1800
|
-webkit-backdrop-filter: unset;
|
|
1787
1801
|
}
|
|
1788
|
-
`,
|
|
1802
|
+
`,EC=hn.div`
|
|
1789
1803
|
position: relative;
|
|
1790
1804
|
z-index: 999999;
|
|
1791
|
-
`,
|
|
1805
|
+
`,PC=hn.div`
|
|
1792
1806
|
position: fixed;
|
|
1793
1807
|
inset: 0;
|
|
1794
1808
|
display: flex;
|
|
@@ -1796,7 +1810,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1796
1810
|
justify-content: center;
|
|
1797
1811
|
width: 100vw;
|
|
1798
1812
|
min-height: 100vh;
|
|
1799
|
-
`,
|
|
1813
|
+
`,TC=hn.div`
|
|
1800
1814
|
// reset some default dialog styles
|
|
1801
1815
|
padding: 0;
|
|
1802
1816
|
background: transparent;
|
|
@@ -1843,19 +1857,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1843
1857
|
box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
|
|
1844
1858
|
border-radius: var(--privy-border-radius-lg);
|
|
1845
1859
|
}
|
|
1846
|
-
`,Nf=
|
|
1860
|
+
`,Nf=hn.div`
|
|
1847
1861
|
display: flex;
|
|
1848
1862
|
flex-direction: column;
|
|
1849
1863
|
align-items: center;
|
|
1850
1864
|
justify-content: center;
|
|
1851
1865
|
height: 100%;
|
|
1852
|
-
`;import{Fragment as
|
|
1866
|
+
`;import{Fragment as WC,jsx as yi,jsxs as MC}from"react/jsx-runtime";var gi=6,_C=new Array(gi).fill("");function AC(e){return e.replace(/\s+/g,"")}function cc(e){return/^[0-9]{1}$/.test(e)}function Df(e){return e.length===gi&&e.every(cc)}function kC(e,t){return e.reduce((o,r)=>o+Number(t(r)),0)}var gn=({onChange:e,disabled:t,errorReasonOverride:o,success:r})=>{let[n,i]=lc(_C),[a,l]=lc(null),[s,c]=lc(null),u=async w=>{w.preventDefault();let b=AC(w.currentTarget.value);if(b==="")return;let x=kC(n,cc),C=b.split(""),T=!C.every(cc),L=C.length+x>gi;if(T){l("Passcode can only be numbers"),c(1);return}if(L){l("Passcode must be exactly 6 numbers"),c(1);return}l(null),c(null);let I=Number(w.currentTarget.name?.charAt(4)),S=[...b||[""]].slice(0,gi-I),U=[...n.slice(0,I),...S,...n.slice(I+S.length)];i(U);let P=S.length,F=Math.min(Math.max(I+P,0),gi-1);if(document.querySelector(`input[name=pin-${F}]`)?.focus(),Df(U))try{await e(U.join("")),document.querySelector(`input[name=pin-${F}]`)?.blur()}catch(q){c(1),l(q.message)}else try{await e(null)}catch(q){c(1),l(q.message)}},m=w=>{s===1&&(l(null),c(null));let b=[...n.slice(0,w),"",...n.slice(w+1)];i(b),w>0&&document.querySelector(`input[name=pin-${w-1}]`)?.focus(),Df(b)?e(b.join("")):e(null)},h=r?"success":!!(o||a)?"fail":"";return yi(WC,{children:MC(RC,{children:[yi("div",{children:n.map((w,b)=>yi("input",{name:`pin-${b}`,type:"text",value:n[b],onChange:u,onKeyUp:x=>{x.key==="Backspace"&&m(b)},inputMode:"numeric",autoFocus:b===0,pattern:"[0-9]",className:h,autoComplete:SC?"one-time-code":"off",disabled:t},b))}),yi("div",{children:yi(IC,{fail:!!o||!!a,children:o||a})})]})})},RC=Uf.div`
|
|
1853
1867
|
display: flex;
|
|
1854
1868
|
flex-direction: column;
|
|
1855
1869
|
width: 100%;
|
|
1856
1870
|
gap: 8px;
|
|
1857
1871
|
|
|
1858
|
-
${
|
|
1872
|
+
${yn}[data-height='medium'] & {
|
|
1859
1873
|
margin-top: 22px;
|
|
1860
1874
|
}
|
|
1861
1875
|
|
|
@@ -1920,7 +1934,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1920
1934
|
transform: translate(1px, 0px);
|
|
1921
1935
|
}
|
|
1922
1936
|
}
|
|
1923
|
-
`,
|
|
1937
|
+
`,IC=Uf.div`
|
|
1924
1938
|
line-height: 20px;
|
|
1925
1939
|
font-size: 13px;
|
|
1926
1940
|
display: flex;
|
|
@@ -1928,7 +1942,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1928
1942
|
width: 100%;
|
|
1929
1943
|
|
|
1930
1944
|
color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
|
|
1931
|
-
`;import{useContext as
|
|
1945
|
+
`;import{useContext as LC}from"react";function vn(){let{promptMfa:e,init:t,submit:o,cancel:r}=LC(ae);return{promptMfa:e,init:t,submit:o,cancel:r}}import{useContext as OC}from"react";function vi(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:r,unenroll:n,enrollInMfa:i}=OC(ae);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:r,unenrollWithSms:()=>n("sms"),unenrollWithTotp:()=>n("totp"),showMfaEnrollmentModal:()=>i(!0),closeMfaEnrollmentModal:()=>i(!1)}}import NC from"styled-components";import{jsx as Ff,jsxs as UC}from"react/jsx-runtime";var Bf=e=>UC(DC,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[Ff("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),Ff("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]}),DC=NC.svg`
|
|
1932
1946
|
height: 90px;
|
|
1933
1947
|
width: 90px;
|
|
1934
1948
|
|
|
@@ -1939,7 +1953,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1939
1953
|
> path {
|
|
1940
1954
|
fill: white;
|
|
1941
1955
|
}
|
|
1942
|
-
`;import
|
|
1956
|
+
`;import FC from"@heroicons/react/24/solid/ShieldCheckIcon";import{jsx as BC}from"react/jsx-runtime";var Hf=({size:e,authUrl:t})=>BC(Ja,{url:t,squareLogoElement:FC,size:e,fgColor:"#1F1F1F"});import{Fragment as Mt,jsx as g,jsxs as ee}from"react/jsx-runtime";var jf=()=>{let{user:e,enrollInMfa:t}=B(),[o,r]=So(null),{unenrollWithSms:n,unenrollWithTotp:i}=vi(),{app:a,ready:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=A(),{closePrivyModal:u}=W(),{promptMfa:m}=vn(),[v,h]=So(s?.mfaEnrollmentFlow?.seenIntro||!1),[w,b]=So(s?.mfaEnrollmentFlow?.selectedMfaMethod||null),x=()=>{u({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{r(null),b(null)},500)};c.current=x;let C=e?.mfaMethods.includes("sms"),T=!!e?.phone,L=e?.mfaMethods.includes("totp"),I=C||L;qf(()=>{I&&h(!0)},[I]);function S(){r(null),b(null)}function U(){h(!1)}async function P(ce){await m(),b(ce)}if(!l||!e||!a)return ee(Mt,{children:[g(k,{onClose:x},"header"),g(Be,{children:g(Bf,{})}),g(Fo,{children:g(Tt,{})}),g(te,{})]});async function F(){r(null);try{await n()}catch{r(null)}}async function R(){r(null);try{await i()}catch{r(null)}}if(o==="sms")return ee(Mt,{children:[g(k,{backFn:S,onClose:x},"header"),g(Be,{children:g(et,{children:g(pc,{})})}),g(Ce,{children:"Remove SMS verification?"}),ee(he,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),g(Bo,{children:g(D,{warn:!0,onClick:F,children:"Remove SMS for MFA"})}),g(te,{})]});if(o==="totp")return ee(Mt,{children:[g(k,{backFn:S,onClose:x},"header"),g(Be,{children:g(et,{children:g($f,{})})}),g(Ce,{children:"Remove Authenticator App verification?"}),ee(he,{children:["MFA adds an extra layer of security to your ",a?.name," account. Make sure you have other methods to secure your account."]}),g(Bo,{children:g(D,{warn:!0,onClick:R,children:"Remove Authenticator App for MFA"})}),g(te,{})]});if(s.mfaEnrollmentFlow.mfaMethods.length===0&&!I)return ee(Mt,{children:[g(k,{onClose:x},"header"),g(Be,{children:g(et,{children:g(dc,{})})}),g(Ce,{children:"Add more security"}),ee(he,{children:[a?.name," does not have any verification methods enabled."]}),g(Bo,{children:g(D,{onClick:x,children:"Close"})}),g(te,{})]});let q=!I&&!v;if(q)return ee(Mt,{children:[g(k,{onClose:x},"header"),g(Be,{children:g(et,{children:g(dc,{})})}),g(Ce,{children:"Transaction Protection"}),g(he,{children:"Set up transaction protection to add an extra layer of security to your account"}),ee(Zp,{children:[ee(gl,{children:[g(yl,{children:g(zC,{})}),"Enable 2-Step verification for your ",a?.name," wallet."]}),ee(gl,{children:[g(yl,{children:g($C,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),ee(Bo,{children:[g(D,{onClick:()=>h(!0),children:"Continue"}),g(Ht,{onClick:x,children:"Not now"})]}),g(te,{})]});switch(w){case"sms":return g(qC,{onComplete:x,onReset:S,onClose:x});case"totp":return g(jC,{onComplete:x,onClose:x,onReset:S});default:return ee(Mt,{children:[g(k,{backFn:q?U:void 0,onClose:x},"header"),g(Be,{children:g(et,{children:g(dc,{})})}),g(Ce,{children:"Choose a verification method"}),I?g(he,{children:"To add or delete verification methods, verification is required."}):g(he,{children:"How would you like to verify your identity? You can change this later."}),ee(Aa,{children:[(s.mfaEnrollmentFlow.mfaMethods.includes("totp")||L)&&ee(ka,{children:[g(we,{disabled:L,onClick:()=>P("totp"),children:ee(Ia,{children:[ee(Ra,{children:[g(HC,{}),"Authenticator App"]}),L?ee(qr,{children:[g(Gf,{}),"Added"]}):g(qr,{children:"Recommended"})]})}),L&&g(vl,{id:"remove",onClick:()=>r("totp"),children:g(Vf,{})})]},"totp"),(s.mfaEnrollmentFlow.mfaMethods.includes("sms")||C)&&ee(ka,{children:[g(we,{disabled:C||T,onClick:()=>P("sms"),children:ee(Ia,{children:[ee(Ra,{children:[g(VC,{}),"SMS"]}),C&&ee(qr,{children:[g(Gf,{}),"Added"]}),T&&g(qr,{children:"Disabled"})]})}),C&&g(vl,{id:"remove",onClick:()=>r("sms"),children:g(Vf,{})})]},"sms"),g(ka,{children:g(we,{disabled:!0,children:ee(Ia,{children:[ee(Ra,{children:[g(GC,{}),"Passkey"]}),g(qr,{isAccent:!0,children:"Coming soon"})]})})},"passkey")]}),g(te,{})]})}},qC=({onComplete:e,onReset:t,onClose:o})=>{let[r,n]=So(""),[i,a]=So(!1),[l,s]=So("enroll"),{initEnrollmentWithSms:c,submitEnrollmentWithSms:u}=vi(),{app:m,data:v,currentScreen:h,navigate:w,setModalData:b}=A();function x(){v?.mfaEnrollmentFlow?.onSuccess(),e()}async function C({qualifiedPhoneNumber:I}){try{await c({phoneNumber:I}),n(I),s("verify")}catch(S){b({mfaEnrollmentFlow:v?.mfaEnrollmentFlow?{...v?.mfaEnrollmentFlow,selectedMfaMethod:"sms",seenIntro:!0}:void 0,errorModalData:{error:S,previousScreen:h||"MFA_ENROLLMENT_FLOW_SCREEN"}}),w("ERROR_SCREEN")}}async function T(I){try{if(!I)return;await u({phoneNumber:r,mfaCode:I}),a(!0)}catch(S){throw Ol(S)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):rn(S)?new Error("The code you entered is not valid"):on(S)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Nl(S)?new Error("Verification canceled"):new Error("Unknown error")}}function L(){l==="verify"?s("enroll"):t()}return l==="enroll"?ee(Mt,{children:[g(k,{backFn:t,onClose:o},"header"),g(Be,{children:g(et,{children:g(pc,{})})}),g(Ce,{children:"Set up SMS verification"}),g(he,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),ee(Fo,{children:[g(un,{onSubmit:C}),ee(Qp,{children:["By providing your mobile number, you agree to receive text messages from ",m?.name,". Some carrier charges may apply"]})]}),g(te,{})]}):i?ee(Mt,{children:[g(k,{onClose:x},"header"),g(Be,{children:g(et,{status:"success",children:g(zf,{})})}),g(Ce,{children:"SMS verification added"}),g(he,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),g(Bo,{children:g(D,{onClick:x,children:"Done"})}),g(te,{})]}):ee(Mt,{children:[g(k,{backFn:L,onClose:o},"header"),g(Be,{children:g(et,{children:g(pc,{})})}),g(Ce,{children:"Enter enrollment code"}),ee(Fo,{children:[g(gn,{onChange:T}),ee(he,{children:["To continue, enter the 6-digit code sent to ",g("strong",{children:af(r)})]})]}),g(te,{})]})},jC=({onComplete:e,onClose:t,onReset:o})=>{let[r,n]=So("enroll"),[i,a]=So(null),[l,s]=So(!1),{initEnrollmentWithTotp:c,submitEnrollmentWithTotp:u}=vi(),{data:m}=A();qf(()=>{a(null),c().then(x=>{a(x)}).catch(()=>{a(null),o()})},[]);function v(){m?.mfaEnrollmentFlow?.onSuccess(),e()}function h(){n("verify")}async function w(x){try{if(!x)return;await u({mfaCode:x}),s(!0)}catch(C){throw Ol(C)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):rn(C)?new Error("The code you entered is not valid"):on(C)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Nl(C)?new Error("Verification canceled"):new Error("Unknown error")}}function b(){r==="verify"?n("enroll"):o()}return r==="enroll"?ee(Mt,{children:[g(k,{backFn:o,onClose:t},"header"),g(Ce,{children:"Scan QR code"}),g(he,{children:"Open your authenticator app and scan the QR code to continue."}),g(Oa,{children:i?.authUrl?g(Hf,{authUrl:i.authUrl,size:200}):g(Tt,{})}),ee(Bo,{children:[g(kt,{children:i?.secret&&g(pn,{itemName:"secret",text:i.secret})}),g(D,{onClick:h,children:"Continue"})]}),g(te,{})]}):l?ee(Mt,{children:[g(k,{onClose:v},"header"),g(Be,{children:g(et,{status:"success",children:g(zf,{})})}),g(Ce,{children:"Authenticator app verification added"}),g(he,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),g(Bo,{children:g(D,{onClick:v,children:"Done"})}),g(te,{})]}):ee(Mt,{children:[g(k,{backFn:b,onClose:t},"header"),g(Be,{children:g(et,{children:g($f,{})})}),g(Ce,{children:"Enter enrollment code"}),g(Fo,{children:g(gn,{onChange:w})}),ee(he,{children:["To continue, enter the 6-digit code generated from your ",g("strong",{children:"authenticator app"})]}),g(te,{})]})};import $3 from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import q3 from"@heroicons/react/24/outline/PhoneIcon";import j3 from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import K3 from"@heroicons/react/24/solid/PhoneIcon";import Y3 from"@heroicons/react/24/solid/ShieldCheckIcon";import{useEffect as J3,useState as Ac}from"react";import{StaticJsonRpcProvider as B3}from"@ethersproject/providers";import{useMemo as H3,useEffect as G3,useState as Wh}from"react";import V3 from"styled-components";import hh from"styled-components";import Yf from"styled-components";import{jsx as Kf,jsxs as JC}from"react/jsx-runtime";var Ts=({label:e,children:t,valueStyles:o})=>JC(KC,{children:[Kf("div",{children:e}),Kf(YC,{style:{...o},children:t})]}),KC=Yf.div`
|
|
1943
1957
|
display: flex;
|
|
1944
1958
|
align-items: center;
|
|
1945
1959
|
justify-content: space-between;
|
|
@@ -1954,7 +1968,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1954
1968
|
color: var(--privy-color-foreground-2);
|
|
1955
1969
|
text-align: right;
|
|
1956
1970
|
}
|
|
1957
|
-
`,
|
|
1971
|
+
`,YC=Yf.div`
|
|
1958
1972
|
font-size: 14px;
|
|
1959
1973
|
line-height: 100%;
|
|
1960
1974
|
display: flex;
|
|
@@ -1963,28 +1977,28 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1963
1977
|
border-radius: var(--privy-border-radius-full);
|
|
1964
1978
|
background-color: var(--privy-color-background-2);
|
|
1965
1979
|
padding: 4px 8px;
|
|
1966
|
-
`;import
|
|
1980
|
+
`;import Ss from"styled-components";import{BigNumber as Jf}from"@ethersproject/bignumber";import{formatEther as Zf}from"@ethersproject/units";var wi=(e,t)=>{let o=(t*parseFloat(Zf(e))).toFixed(2);return o!=="0.00"?`$${o}`:"<$0.01"},lo=(e,t,o=6,r=!1)=>{let i=parseFloat(Zf(e)).toFixed(o).replace(/0+$/,"").replace(/\.$/,"");return r?`${i} ${t}`:`${i==="0"?"<0.001":i} ${t}`},uc=e=>e.map(Ve).reduce((t,o)=>t.add(o),Jf.from(0)).toHexString(),Qf=(e,t)=>{let{chains:o}=W(),r=`https://etherscan.io/address/${t}`,n=`${Bd(e,o)}/address/${t}`;if(!n)return r;try{new URL(n)}catch{return r}return n},Ve=e=>Jf.from(e);import{Fragment as e3,jsx as xs,jsxs as Xf}from"react/jsx-runtime";var eh=({weiQuantities:e,tokenPrice:t,tokenSymbol:o})=>{let r=uc(e),n=t?wi(r,t):void 0,i=lo(r,o);return xs(th,{children:n||i})},mc=({weiQuantities:e,tokenPrice:t,tokenSymbol:o})=>{let r=uc(e),n=t?wi(r,t):void 0,i=lo(r,o);return xs(th,{children:n?Xf(e3,{children:[xs(ZC,{children:"USD"}),n==="<$0.01"?Xf(XC,{children:[xs(QC,{children:"<"}),"$0.01"]}):n]}):i})},th=Ss.span`
|
|
1967
1981
|
font-size: 14px;
|
|
1968
1982
|
line-height: 140%;
|
|
1969
1983
|
display: flex;
|
|
1970
1984
|
gap: 4px;
|
|
1971
1985
|
align-items: center;
|
|
1972
|
-
`,
|
|
1986
|
+
`,ZC=Ss.span`
|
|
1973
1987
|
font-size: 12px;
|
|
1974
1988
|
line-height: 12px;
|
|
1975
1989
|
color: var(--privy-color-foreground-3);
|
|
1976
|
-
`,
|
|
1990
|
+
`,QC=Ss.span`
|
|
1977
1991
|
font-size: 10px;
|
|
1978
|
-
`,
|
|
1992
|
+
`,XC=Ss.span`
|
|
1979
1993
|
display: flex;
|
|
1980
1994
|
align-items: center;
|
|
1981
|
-
`;import
|
|
1995
|
+
`;import fc from"styled-components";import{jsx as Qo,jsxs as _s}from"react/jsx-runtime";var oh=({gas:e,tokenPrice:t,tokenSymbol:o})=>_s(El,{style:{paddingBottom:"12px"},children:[_s(nh,{children:[Qo(ah,{children:"Est. Fees"}),Qo("div",{children:Qo(mc,{weiQuantities:[e],tokenPrice:t,tokenSymbol:o})})]}),t&&Qo(ih,{children:`${lo(e,o)}`})]}),rh=({transactionData:e,gas:t,tokenPrice:o,tokenSymbol:r})=>{let n=Ve(e.value||0).add(Ve(t)).toHexString();return _s(El,{children:[_s(nh,{children:[Qo(ah,{children:"Total (including fees)"}),Qo("div",{children:Qo(mc,{weiQuantities:[e.value||0,t],tokenPrice:o,tokenSymbol:r})})]}),o&&Qo(ih,{children:lo(n,r)})]})},nh=fc.div`
|
|
1982
1996
|
display: flex;
|
|
1983
1997
|
flex-direction: row;
|
|
1984
1998
|
justify-content: space-between;
|
|
1985
1999
|
align-items: center;
|
|
1986
2000
|
padding-top: 4px;
|
|
1987
|
-
`,ih=
|
|
2001
|
+
`,ih=fc.div`
|
|
1988
2002
|
display: flex;
|
|
1989
2003
|
flex-direction: row;
|
|
1990
2004
|
height: 12px;
|
|
@@ -1993,23 +2007,23 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1993
2007
|
line-height: 12px;
|
|
1994
2008
|
color: var(--privy-color-foreground-3);
|
|
1995
2009
|
font-weight: 400;
|
|
1996
|
-
`,ah=
|
|
2010
|
+
`,ah=fc.div`
|
|
1997
2011
|
font-size: 14px;
|
|
1998
2012
|
line-height: 22.4px;
|
|
1999
2013
|
font-weight: 400;
|
|
2000
|
-
`;import
|
|
2014
|
+
`;import t3 from"@heroicons/react/24/outline/ChevronDownIcon";import{useContext as Er,useState as o3}from"react";import Xo from"styled-components";import{createContext as sh,useContext as iN}from"react";var wn=sh(void 0);var Ci=sh(void 0);import{Fragment as d3,jsx as Kt,jsxs as lh}from"react/jsx-runtime";var ch=({defaultValue:e,children:t})=>{let[o,r]=o3(e||null),n=i=>{r(o===i?null:i)};return Kt(wn.Provider,{value:{activePanel:o,togglePanel:n},children:Kt(r3,{children:t})})},dh=({value:e,children:t})=>{let{activePanel:o,togglePanel:r}=Er(wn),n=o===e;return Kt(Ci.Provider,{value:{onToggle:()=>r(e),value:e},children:Kt(s3,{isActive:n,"data-open":n,children:t})})},ph=({children:e})=>{let{activePanel:t}=Er(wn),{onToggle:o,value:r}=Er(Ci),n=t===r;return lh(d3,{children:[lh(n3,{onClick:o,"data-open":n,children:[Kt(a3,{children:e}),Kt(c3,{isactive:n,children:Kt(t3,{height:"16px",width:"16px",strokeWidth:"2"})})]}),Kt(i3,{})]})},uh=({children:e})=>{let{activePanel:t}=Er(wn),{value:o}=Er(Ci);return Kt(l3,{"data-open":t===o,children:Kt(fh,{children:e})})},mh=({children:e})=>{let{activePanel:t}=Er(wn),{value:o}=Er(Ci);return Kt(fh,{children:typeof e=="function"?e({isActive:t===o}):e})},r3=Xo.div`
|
|
2001
2015
|
display: flex;
|
|
2002
2016
|
flex-direction: column;
|
|
2003
2017
|
width: 100%;
|
|
2004
2018
|
gap: 8px;
|
|
2005
|
-
`,
|
|
2019
|
+
`,n3=Xo.div`
|
|
2006
2020
|
display: flex;
|
|
2007
2021
|
justify-content: space-between;
|
|
2008
2022
|
align-items: center;
|
|
2009
2023
|
width: 100%;
|
|
2010
2024
|
cursor: pointer;
|
|
2011
2025
|
padding-bottom: 8px;
|
|
2012
|
-
`,
|
|
2026
|
+
`,i3=Xo.div`
|
|
2013
2027
|
width: 100%;
|
|
2014
2028
|
|
|
2015
2029
|
&& {
|
|
@@ -2017,13 +2031,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2017
2031
|
border-color: var(--privy-color-foreground-4);
|
|
2018
2032
|
}
|
|
2019
2033
|
padding-bottom: 12px;
|
|
2020
|
-
`,
|
|
2034
|
+
`,a3=Xo.div`
|
|
2021
2035
|
font-size: 14px;
|
|
2022
2036
|
font-weight: 500;
|
|
2023
2037
|
line-height: 19.6px;
|
|
2024
2038
|
width: 100%;
|
|
2025
2039
|
padding-right: 8px;
|
|
2026
|
-
`,
|
|
2040
|
+
`,s3=Xo.div`
|
|
2027
2041
|
display: flex;
|
|
2028
2042
|
flex-direction: column;
|
|
2029
2043
|
width: 100%;
|
|
@@ -2035,7 +2049,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2035
2049
|
border-color: var(--privy-color-foreground-4);
|
|
2036
2050
|
border-radius: var(--privy-border-radius-md);
|
|
2037
2051
|
}
|
|
2038
|
-
`,
|
|
2052
|
+
`,l3=Xo.div`
|
|
2039
2053
|
position: relative;
|
|
2040
2054
|
overflow: hidden;
|
|
2041
2055
|
transition: max-height 25ms ease-out;
|
|
@@ -2047,38 +2061,38 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2047
2061
|
&[data-open='false'] {
|
|
2048
2062
|
max-height: 0;
|
|
2049
2063
|
}
|
|
2050
|
-
`,fh=
|
|
2064
|
+
`,fh=Xo.div`
|
|
2051
2065
|
display: flex;
|
|
2052
2066
|
flex-direction: column;
|
|
2053
2067
|
gap: 12px;
|
|
2054
2068
|
flex: 1 1 auto;
|
|
2055
2069
|
min-height: 1px;
|
|
2056
|
-
`,
|
|
2070
|
+
`,c3=Xo.div`
|
|
2057
2071
|
transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
|
|
2058
|
-
`;import
|
|
2072
|
+
`;import p3 from"styled-components";import{jsx as m3}from"react/jsx-runtime";var hc=({walletAddress:e,chainId:t=vo})=>m3(u3,{href:Qf(t,e),target:"_blank",children:Wo(e)}),u3=p3.a`
|
|
2059
2073
|
&:hover {
|
|
2060
2074
|
text-decoration: underline;
|
|
2061
2075
|
}
|
|
2062
|
-
`;import{jsx as
|
|
2076
|
+
`;import{jsx as vt,jsxs as yc}from"react/jsx-runtime";var Cn=({from:e,to:t,txn:o,transactionInfo:r,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=o?.value||0;return vt(ch,{children:yc(dh,{value:"details",children:[vt(ph,{children:yc(f3,{children:[vt("div",{children:r?.title||r?.actionDescription||"Details"}),vt(h3,{children:vt(eh,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),yc(uh,{children:[vt(Ts,{label:"From",children:vt(hc,{walletAddress:e,chainId:o.chainId||vo})}),vt(Ts,{label:"To",children:vt(hc,{walletAddress:t,chainId:o.chainId||vo})}),r&&r.action&&vt(Ts,{label:"Action",children:r.action}),i&&vt(oh,{transactionData:o,gas:i,tokenPrice:n,tokenSymbol:a})]}),vt(mh,{children:({isActive:s})=>vt(rh,{transactionData:o,displayFee:s,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},f3=hh.div`
|
|
2063
2077
|
display: flex;
|
|
2064
2078
|
flex-direction: row;
|
|
2065
2079
|
justify-content: space-between;
|
|
2066
|
-
`,
|
|
2080
|
+
`,h3=hh.div`
|
|
2067
2081
|
flex-shrink: 0;
|
|
2068
2082
|
padding-left: 8px;
|
|
2069
|
-
`;import
|
|
2083
|
+
`;import Ei from"styled-components";import{jsx as bi,jsxs as b3}from"react/jsx-runtime";var gc=({description:e,contractInfo:t})=>b3(y3,{children:[t.imgUrl&&bi(g3,{size:t.imgSize||"sm",src:t.imgUrl,alt:t.imgAltText||`${t.name} image`}),t.url&&bi(v3,{children:bi("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.url.replace(/^(https?:\/\/)(www\.)?/,"")})}),t.name&&bi(w3,{children:t.name}),bi(C3,{children:e||t.actionText})]}),y3=Ei.div`
|
|
2070
2084
|
display: flex;
|
|
2071
2085
|
flex-direction: column;
|
|
2072
2086
|
align-items: center;
|
|
2073
2087
|
margin-bottom: 8px;
|
|
2074
|
-
`,
|
|
2088
|
+
`,g3=Ei.img`
|
|
2075
2089
|
&& {
|
|
2076
2090
|
height: ${e=>e.size==="sm"?"65px":"140px"};
|
|
2077
2091
|
width: ${e=>e.size==="sm"?"65px":"140px"};
|
|
2078
2092
|
border-radius: 16px;
|
|
2079
2093
|
margin-bottom: 12px;
|
|
2080
2094
|
}
|
|
2081
|
-
`,
|
|
2095
|
+
`,v3=Ei.div`
|
|
2082
2096
|
font-size: 12px;
|
|
2083
2097
|
line-height: 12px;
|
|
2084
2098
|
padding: 7px;
|
|
@@ -2091,7 +2105,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2091
2105
|
text-decoration: underline;
|
|
2092
2106
|
}
|
|
2093
2107
|
}
|
|
2094
|
-
`,
|
|
2108
|
+
`,w3=Ei.div`
|
|
2095
2109
|
font-size: 18px;
|
|
2096
2110
|
line-height: 18px;
|
|
2097
2111
|
font-weight: 500;
|
|
@@ -2099,7 +2113,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2099
2113
|
white-space: nowrap;
|
|
2100
2114
|
max-width: 275px;
|
|
2101
2115
|
text-overflow: ellipsis;
|
|
2102
|
-
`,
|
|
2116
|
+
`,C3=Ei.div`
|
|
2103
2117
|
font-size: 16px;
|
|
2104
2118
|
line-height: 140%;
|
|
2105
2119
|
font-weight: 400;
|
|
@@ -2107,7 +2121,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2107
2121
|
overflow: hidden;
|
|
2108
2122
|
max-width: 275px;
|
|
2109
2123
|
text-overflow: ellipsis;
|
|
2110
|
-
`;import
|
|
2124
|
+
`;import E3 from"@heroicons/react/24/outline/WalletIcon";import wc from"styled-components";import{jsx as yh,jsxs as vc}from"react/jsx-runtime";var gh=({address:e,txn:t,balance:o,hasFunds:r})=>{let n=!!o,{nativeTokenSymbolForChainId:i}=W(),a=i(t.chainId)||"ETH";return vc(P3,{children:[vc(T3,{children:[yh(E3,{strokeWidth:"2",width:"16px",height:"16px"}),yh("div",{children:Wo(e)})]}),vc(x3,{displayBalanceColor:n,hasFunds:r,children:[o?lo(o,a,6,!0):0," available"]})]})},P3=wc.div`
|
|
2111
2125
|
display: flex;
|
|
2112
2126
|
flex-direction: row;
|
|
2113
2127
|
justify-content: space-between;
|
|
@@ -2120,12 +2134,12 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2120
2134
|
border: 1px solid var(--privy-color-foreground-4);
|
|
2121
2135
|
border-radius: var(--privy-border-radius-md);
|
|
2122
2136
|
}
|
|
2123
|
-
`,
|
|
2137
|
+
`,T3=wc.div`
|
|
2124
2138
|
display: flex;
|
|
2125
2139
|
flex-direction: row;
|
|
2126
2140
|
align-items: center;
|
|
2127
2141
|
gap: 8px;
|
|
2128
|
-
`,
|
|
2142
|
+
`,x3=wc.div`
|
|
2129
2143
|
display: flex;
|
|
2130
2144
|
align-items: center;
|
|
2131
2145
|
justify-content: center;
|
|
@@ -2135,35 +2149,35 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2135
2149
|
background-color: var(--privy-color-background-2);
|
|
2136
2150
|
padding: 5px 8px;
|
|
2137
2151
|
color: ${e=>e.displayBalanceColor?e.hasFunds?"var(--privy-color-success-dark)":"var(--privy-color-error)":"inherit"};
|
|
2138
|
-
`;import
|
|
2152
|
+
`;import As from"styled-components";import{Fragment as wh,jsx as Pi,jsxs as Ch}from"react/jsx-runtime";var bh=({description:e,txn:t,tokenSymbol:o,tokenPrice:r})=>{let n=t.value||0,i=r?wi(n,r):void 0,a=lo(n,o);return Ch(S3,{children:[i?Ch(wh,{children:[Pi(vh,{children:i}),Pi(_3,{children:a})]}):Pi(wh,{children:Pi(vh,{children:a})}),Pi(A3,{children:e})]})},S3=As.div`
|
|
2139
2153
|
display: flex;
|
|
2140
2154
|
flex-direction: column;
|
|
2141
2155
|
align-items: center;
|
|
2142
2156
|
margin-bottom: 20px;
|
|
2143
|
-
`,vh=
|
|
2157
|
+
`,vh=As.h2`
|
|
2144
2158
|
&& {
|
|
2145
2159
|
font-size: 48px;
|
|
2146
2160
|
line-height: 48px;
|
|
2147
2161
|
margin: 8px auto;
|
|
2148
2162
|
}
|
|
2149
|
-
`,
|
|
2163
|
+
`,_3=As.p`
|
|
2150
2164
|
margin-bottom: 12px;
|
|
2151
2165
|
&& {
|
|
2152
2166
|
font-size: 17px;
|
|
2153
2167
|
line-height: 17px;
|
|
2154
2168
|
color: var(--privy-color-foreground-3);
|
|
2155
2169
|
}
|
|
2156
|
-
`,
|
|
2170
|
+
`,A3=As.div`
|
|
2157
2171
|
font-size: 16px;
|
|
2158
2172
|
line-height: 22.4px;
|
|
2159
2173
|
font-weight: 400;
|
|
2160
2174
|
overflow: hidden;
|
|
2161
2175
|
max-width: 275px;
|
|
2162
2176
|
text-overflow: ellipsis;
|
|
2163
|
-
`;import{VoidSigner as
|
|
2177
|
+
`;import{VoidSigner as L3}from"@ethersproject/abstract-signer";import{EtherscanProvider as PD}from"@ethersproject/providers";import{BigNumber as xh}from"@ethersproject/bignumber";import{BigNumber as bn}from"@ethersproject/bignumber";import{Contract as k3}from"@ethersproject/contracts";import{serialize as R3}from"@ethersproject/transactions";var En=e=>[sa.id,la.id,ca.id,pa.id,ua.id,ma.id,fa.id,ya.id,ha.id].includes(e),Eh=async(e,t)=>{if(!En(e.chainId))throw new Error("Invalid chain ID for OP Stack gas estimation.");if(e.maxPriorityFeePerGas&&e.maxFeePerGas||e.gasPrice)return e;try{if(e.type===void 0&&(e.type=2),!e.maxPriorityFeePerGas){let o=await t.send("eth_maxPriorityFeePerGas",[]);e.maxPriorityFeePerGas=o}if(e.maxFeePerGas&&(console.warn("maxFeePerGas is specified without maxPriorityFeePerGas - this can result in hung transactions."),e.maxPriorityFeePerGas>=e.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(!e.maxFeePerGas){let{lastBaseFeePerGas:o}=await t.getFeeData();if(!o)throw new Error("Unable to fetch baseFee for last block.");let i=bn.from(o).mul(bn.from(126)).div(bn.from(100)).add(bn.from(e.maxPriorityFeePerGas));e.maxFeePerGas=Ti(i)}}catch(o){throw new Error(`Failed to set gas price for OP stack transaction: ${o}.`)}return e};async function Ph(e,t){if(!e.chainId||e.chainId&&!En(e.chainId))return bn.from(0);let o=bn.from(0);try{let r=new k3(Sd,_d,t),n=Th(e),i=R3(n);o=await r.getL1Fee(i)}catch{}return o}async function Sh(e,t){return delete e.from,(await t.estimateGas(e)).toHexString()}var _h=async(e,t)=>{if(e.type===void 0&&(e.type=2),e.type===2){if(!e.maxFeePerGas||!e.maxPriorityFeePerGas){let o=await t.getFeeData();e.maxFeePerGas||(e.maxFeePerGas=o.maxFeePerGas?.toHexString()),e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=o.maxPriorityFeePerGas?.toHexString())}}else if(!e.gasPrice){let o=await t.getFeeData();e.gasPrice=o.gasPrice?.toHexString()}return e};async function Pn(e,t){if(!e.gasLimit)throw new ve("gasLimit was not successfully set for transaction.");let o=Ve(e.gasLimit),r=xh.from(0);if(e.type==2)if(e.maxFeePerGas)r=Ve(e.maxFeePerGas);else throw new ve("maxFeePerGas was not successfully set for transaction of type 2.");else if(e.gasPrice)r=Ve(e.gasPrice);else throw new ve("gasPrice was not successfully set for transaction of type 0 or 1.");let n=o.mul(r),i=xh.from(0);if(e.chainId&&En(e.chainId))try{i=await Ph(e,t),n=n.add(i)}catch{}return{totalGasEstimate:n,l1ExecutionFeeEstimate:i}}import{BigNumber as Cc}from"@ethersproject/bignumber";var bc=e=>[na.id,ia.id,aa.id].includes(e),Ah=async(e,t)=>{if(!bc(e.chainId))throw new Error("Invalid chain ID for Arbitrum gas estimation.");if(e.maxFeePerGas)return e;e.type===void 0&&(e.type=2);try{let{lastBaseFeePerGas:o}=await t.getFeeData();if(o){let r=o.mul(Cc.from(120)).div(Cc.from(100));e.maxFeePerGas=Ti(r),e.maxPriorityFeePerGas=Ti(Cc.from(0))}}catch(o){throw new Error(`Failed to set gas price for Arbitrum transaction: ${o}.`)}return e};var Ec=e=>[56,97].includes(e),kh=async(e,t)=>{if(!Ec(e.chainId))throw new Error("Invalid chain ID for BSC gas estimation.");if(e.type===void 0?e.type=0:(e.type==1||e.type==2)&&console.warn("Transaction request type specified is incompatible for chain and will result in undefined behavior. Please use transaction type 0."),!e.gasPrice){let o=await t.getFeeData();e.gasPrice=o.gasPrice?.toHexString()}return e};import{parseUnits as Rh}from"@ethersproject/units";import{ofetch as I3}from"ofetch";var Tc=e=>[Un.id,Fn.id].includes(e),Pc=e=>({maxPriorityFee:Rh(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:Rh(e.maxFee.toFixed(9),"gwei").toHexString()}),M3=e=>({safeLow:Pc(e.safeLow),standard:Pc(e.standard),fast:Pc(e.fast)}),W3=async e=>{let t="";switch(e){case Un.id:t="https://gasstation.polygon.technology/v2";break;case Fn.id:t="https://gasstation-testnet.polygon.technology/v2";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}return M3(await I3(t))};async function Ih(e){if(!Tc(e.chainId))throw new Error("Invalid chain ID for Polygon gas estimation.");if(e.maxPriorityFeePerGas&&e.maxFeePerGas)return e;e.type===void 0&&(e.type=2);try{let{standard:t}=await W3(e.chainId);e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=t.maxPriorityFee),e.maxFeePerGas||(e.maxFeePerGas=t.maxFee)}catch(t){throw new Error(`Failed to set gas prices from Polygon gas station with error: ${t}.`)}return e}function Ti(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 Th(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=Ve(e.nonce).toNumber()),e.gasLimit!==void 0&&(t.gasLimit=Ve(e.gasLimit)),e.gasPrice!==void 0&&(t.gasPrice=Ve(e.gasPrice)),e.value!==void 0&&(t.value=Ve(e.value)),e.maxFeePerGas!==void 0&&(t.maxFeePerGas=Ve(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.maxPriorityFeePerGas=Ve(e.maxPriorityFeePerGas)),t}async function Tn(e,t,o){if(t.chainId=Number(t.chainId),Mh(t),!t.nonce){let r=new L3(e,o);t.nonce=await r.getTransactionCount("pending")}return t.gasLimit||(t.gas?(t.gasLimit=t.gas,delete t.gas):t.gasLimit=await Sh(t,o)),t.from||(t.from=e),Tc(t.chainId)?t=await Ih(t):bc(t.chainId)?t=await Ah(t,o):En(t.chainId)?t=await Eh(t,o):Ec(t.chainId)?t=await kh(t,o):t=await _h(t,o),t}async function ks(e,t,o,r,n){r=Object.assign({chainId:vo},r),Mh(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 Rs(e,t,o,r){let n=await r.getBalance(e),i=t.value||0,l=!n.sub(Ve(i)).sub(o).isNegative();return{balance:n,hasSufficientFunds:l}}function Mh(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let o of t){let r=e[o];if(!(typeof r>"u")&&!O3(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 O3(e){let t=typeof e=="number",o=typeof e=="bigint",r=typeof e=="string"&&N3(e);return t||o||r}function N3(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Is(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}}import{useState as xc,useEffect as D3}from"react";var Ms=e=>{let{showFiatPrices:t,getUsdTokenPrice:o,chains:r}=W(),[n,i]=xc(!0),[a,l]=xc(void 0),[s,c]=xc(void 0);return D3(()=>{let u=e.chainId||vo,m=r.find(h=>h.id===Number(u));if(!m)throw new Z(`Unsupported chain: ${u}`);(async()=>{if(!t){i(!1);return}try{i(!0);let h=await o(m);h?c(h):l(new Error(`Unable to fetch token price on chain id ${m.id}`))}catch(h){l(h)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};import{createContext as U3,useContext as F3}from"react";var Sc=U3(null);function xi(){let e=F3(Sc);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}import{jsx as Lh}from"react/jsx-runtime";var _c=({pendingTransaction:e})=>{let{getAccessToken:t}=B(),{wallets:o}=xi(),{walletProxy:r,rpcConfig:n,chains:i,nativeTokenSymbolForChainId:a}=W(),[l,s]=Wh(null),[c,u]=Wh(e),{tokenPrice:m}=Ms(c),v=a(e.chainId)||"ETH",h=H3(()=>o.find(w=>w.walletClientType==="privy"),[o]);return G3(()=>{async function w(){if(!await t()||!r||!h)return c;let x=new B3(Ft(c.chainId,i,n)),C=await Tn(h.address,c,x),{totalGasEstimate:T}=await Pn(C,x);return s(T.toHexString()),C}w().then(b=>{u(b)})},[r]),h?Lh(z3,{children:Lh(Cn,{from:h.address,to:c.to,txn:c,gas:l??void 0,tokenPrice:m,tokenSymbol:v})}):null},z3=V3.div`
|
|
2164
2178
|
width: 100%;
|
|
2165
2179
|
padding: 1rem 0;
|
|
2166
|
-
`;import{Fragment as
|
|
2180
|
+
`;import{Fragment as kc,jsx as re,jsxs as co}from"react/jsx-runtime";var Rc=({open:e,onClose:t})=>{let{user:o}=B(),[r,n]=Ac(null),{init:i,cancel:a}=vn();J3(()=>{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(u){console.error(u)}}let s=()=>{n(null),a(),t()};return!e||!o?null:r?re(Z3,{selectedMethod:r,onClose:s,onBack:o.mfaMethods.length>1?()=>n(null):void 0}):co(kc,{children:[re(k,{onClose:s},"header"),re(Be,{children:re(et,{children:re(Y3,{})})}),re(Ce,{children:"Verify your identity"}),re(he,{children:"Choose a verification method"}),co(Aa,{children:[o.mfaMethods.includes("totp")&&co(we,{onClick:()=>l("totp"),children:[re($3,{}),"Authenticator App"]},"totp"),o.mfaMethods.includes("sms")&&co(we,{onClick:()=>l("sms"),children:[re(q3,{}),"SMS"]},"sms")]}),re(te,{})]})},Z3=({selectedMethod:e,onClose:t,onBack:o})=>{let{app:r}=A(),{pendingTransaction:n}=W(),[i,a]=Ac(!1),[l,s]=Ac(!1),{submit:c}=vn();async function u(m){try{if(!m)return;await c(e,m),s(!0),a(!1),t()}catch(v){throw Ll(v)?(a(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):rn(v)?(a(!1),new Error("The code you entered is not valid")):on(v)?(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 co(kc,{children:[re(k,{onClose:t},"header"),re(Be,{children:re(et,{children:re(K3,{})})}),re(Ce,{children:"Enter verification code"}),co(Fo,{children:[re(gn,{success:l,disabled:i,onChange:u}),co(he,{children:["To continue, please enter the 6-digit code sent to your ",re("strong",{children:"mobile device"})]}),n&&re(_c,{pendingTransaction:n})]}),o&&re(wl,{theme:r?.appearance.palette.colorScheme,onClick:o,children:"Choose another method"}),re(Ht,{onClick:t,children:"Not now"}),re(te,{})]});case"totp":return co(kc,{children:[re(k,{onClose:t},"header"),re(Be,{children:re(et,{children:re(j3,{})})}),re(Ce,{children:"Enter verification code"}),co(Fo,{children:[re(gn,{success:l,disabled:i,onChange:u}),co(he,{children:["To continue, please enter the 6-digit code generated from your"," ",re("strong",{children:"authenticator app"})]}),n&&re(_c,{pendingTransaction:n})]}),o&&re(wl,{theme:r?.appearance.palette.colorScheme,onClick:o,children:"Choose another method"}),re(Ht,{onClick:t,children:"Not now"}),re(te,{})]});default:return null}};import{useEffect as Oh,useState as Nh}from"react";import Uh from"styled-components";function Ic(e){return e.charAt(0).toUpperCase()+e.slice(1)}import{Fragment as eb,jsx as po,jsxs as Ls}from"react/jsx-runtime";var Dh={google:{name:"Google",component:ms},discord:{name:"Discord",component:ds},github:{name:"Github",component:ps},linkedin:{name:"LinkedIn",component:hs},twitter:{name:"Twitter",component:vs},spotify:{name:"Spotify",component:ys},tiktok:{name:"Tiktok",component:gs},apple:{name:"Apple",component:cs}},Ws=()=>{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"),Ut.del(kr),window.history.pushState({},"",e)},Fh=()=>{let{ready:e,user:t,authenticated:o}=B(),{app:r,setModalData:n,navigate:i,resetNavigation:a}=A(),{getAuthMeta:l,initLoginWithOAuth:s,loginWithOAuth:c,updateWallets:u,setReadyToTrue:m,closePrivyModal:v}=W(),[h,w]=Nh(!1),[b,x]=Nh(void 0),C=l()?.provider||"google",T=Dh[C].name,L=Dh[C].component,I=r?.render.inDialog?Qe:0;Oh(()=>{c(C).then(()=>{Ws(),w(!0)}).catch(P=>{let F={retryable:!1,message:"Authentication failed"};if(P?.privyErrorCode==="allowlist_rejected"){x(void 0),a(),i("ALLOWLIST_REJECTION_SCREEN"),Ws();return}else P?.privyErrorCode==="linked_to_another_user"?F.detail="This account has already been linked to another user.":P?.privyErrorCode==="invalid_credentials"?(F.retryable=!0,F.detail="Something went wrong. Try again."):P.privyErrorCode==="oauth_user_denied"?(F.detail=`Retry and check ${Ic(C)} to finish connecting your account.`,F.retryable=!0):P?.privyErrorCode==="too_many_requests"?F.detail="Too many requests. Please wait before trying again.":P?.privyErrorCode==="oauth_account_suspended"&&(F.detail=`Your ${T} account is suspended. Please try another login method.`);Ws(),x(F)}).finally(()=>{m()})},[T,C]),Oh(()=>{if(e&&o&&h&&t){if(r?.legal.requireUsersAcceptTerms&&!t.hasAcceptedTerms){let F=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},I);return()=>clearTimeout(F)}if(bt(t,r?.embeddedWallets?.createOnLogin)){let F=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:R=>console.error(R),callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},I);return()=>clearTimeout(F)}else{let F=setTimeout(()=>v({shouldCallAuthOnSuccess:!0,isSuccess:!0}),I);return u(),()=>clearTimeout(F)}}},[e,o,h,t]);let S=h?`Successfully connected with ${T}`:b?b.message:`Verifying connection to ${T}`,U="";return h?U="You\u2019re good to go!":b?U=b.detail:U="Just a few moments more",Ls(eb,{children:[po(k,{}),po(Q,{}),Ls(Q3,{children:[po(X3,{children:Ls("div",{children:[po(Do,{success:h,fail:!!b}),po(L,{style:{width:"38px",height:"38px"}})]})}),Ls(Rt,{children:[po("h3",{children:S}),po("p",{children:U})]}),b&&b?.retryable?po(Ta,{onClick:()=>{Ws(),s(C),x(void 0)},disabled:!h&&!b?.retryable,children:"Retry"}):null]}),po(X,{}),po(te,{})]})},Q3=Uh.div`
|
|
2167
2181
|
display: flex;
|
|
2168
2182
|
flex-direction: column;
|
|
2169
2183
|
align-items: center;
|
|
@@ -2171,7 +2185,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2171
2185
|
margin-left: 27px;
|
|
2172
2186
|
margin-right: 27px;
|
|
2173
2187
|
gap: 24px;
|
|
2174
|
-
`,
|
|
2188
|
+
`,X3=Uh.div`
|
|
2175
2189
|
display: flex;
|
|
2176
2190
|
flex-direction: column;
|
|
2177
2191
|
justify-content: center;
|
|
@@ -2194,55 +2208,55 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2194
2208
|
left: -19px;
|
|
2195
2209
|
top: -19px;
|
|
2196
2210
|
}
|
|
2197
|
-
`;import{useEffect as
|
|
2211
|
+
`;import{useEffect as ob,useState as Hh}from"react";import rb from"styled-components";import{isMobile as tb}from"react-device-detect";var Bh=(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(!Mo()&&tb)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${r}?ref=${r}`};import{Fragment as ib,jsx as _o,jsxs as Gh}from"react/jsx-runtime";var Vh=()=>{let{forkSession:e,ready:t,authenticated:o}=B(),[r,n]=Hh(""),[i,a]=Hh(!1);ob(()=>{t&&o&&e().then(n)},[t,o]);let l=Bh(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."),Gh(ib,{children:[_o(k,{},"header"),_o(Q,{}),_o(no,{title:s.title,description:s.description}),Gh(At,{children:[_o(nb,{children:_o(Xt,{style:{width:"72px",height:"72px"}})}),_o(Pa,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?_o("p",{children:s.footnote}):null]}),_o(X,{}),_o(G,{protectedByPrivy:!0})]})},nb=rb(kt)`
|
|
2198
2212
|
margin: 16px auto;
|
|
2199
|
-
`;import{BigNumber as qh}from"@ethersproject/bignumber";import{StaticJsonRpcProvider as
|
|
2213
|
+
`;import{BigNumber as qh}from"@ethersproject/bignumber";import{StaticJsonRpcProvider as pb}from"@ethersproject/providers";import{useMemo as jh,useEffect as Kh,useState as Wt}from"react";import Sn from"styled-components";function zh(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND":"UNKNOWN"}import{BigNumber as Mc}from"@ethersproject/bignumber";import ab from"styled-components";import{Fragment as cb,jsx as Si,jsxs as db}from"react/jsx-runtime";var sb=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let o=Mc.from(e.gasUsed),r=Mc.from(e.effectiveGasPrice),n=o.mul(r);if(t){let i=Mc.from(t);n=n.add(i)}return n.toString()}catch{return}else return},$h=({txn:e,receipt:t,transactionInfo:o,onClose:r,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a})=>db(cb,{children:[Si(k,{onClose:r}),Si(qn,{title:"Transaction complete!",description:"You're all set."}),Si(Cn,{tokenPrice:n,from:t.from,to:t.to,gas:sb(t,a),txn:e,transactionInfo:o,tokenSymbol:i}),Si(lb,{loading:!1,onClick:r,children:"All Done"}),Si(te,{})]}),lb=ab(D)`
|
|
2200
2214
|
&& {
|
|
2201
2215
|
margin-top: 24px;
|
|
2202
2216
|
}
|
|
2203
2217
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2204
|
-
`;import{Fragment as
|
|
2218
|
+
`;import{Fragment as Wc,jsx as ze,jsxs as xn}from"react/jsx-runtime";var ub=({txn:e,txnFamily:t,uiOptions:o,tokenSymbol:r,tokenPrice:n})=>{if(t==="CONTRACT_CALL"){if(o.transactionInfo?.contractInfo)return ze(gc,{contractInfo:o.transactionInfo.contractInfo,description:o.description});if(o.senderInfo)return ze(gc,{contractInfo:o.senderInfo,description:o.description||o.senderInfo.actionText})}return ze(Wc,{children:ze(bh,{description:o.description||o.transactionInfo?.description||"",txn:e,tokenSymbol:r,tokenPrice:n})})},Jh=()=>{let{authenticated:e,getAccessToken:t}=B(),{wallets:o}=xi(),{walletProxy:r,closePrivyModal:n,getFiatOnRampConfig:i,rpcConfig:a,chains:l,nativeTokenSymbolForChainId:s}=W(),{app:c,navigate:u,data:m,onUserCloseViaDialogOrKeybindRef:v,setModalData:h}=A(),{transactionRequest:w,onSuccess:b,onFailure:x,uiOptions:C,fundWalletConfig:T}=m.sendTransaction,[L,I]=Wt(null),[S,U]=Wt(null),[P,F]=Wt(""),[R,q]=Wt(),[ce,H]=Wt(!1),V=()=>{F(""),q(void 0)},j=(dt,xe,Lt)=>{F(dt),q(new ve(new Et(xe??dt,Lt??Fe.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))},[ne,oe]=Wt(!1),[$e,wt]=Wt(!0),[it,qe]=Wt(null),[ie,ho]=Wt(w),{tokenPrice:ct,isTokenPriceLoading:or}=Ms(ie),M=s(w.chainId)||"ETH",[Y,J]=Wt(null),[Rn,$]=Wt(null),[_e,In]=Wt(!0);Kh(()=>{e||(u("LANDING"),x(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let De=jh(()=>o.find(dt=>dt.walletClientType==="privy"),[o]),rr=async()=>{if(!De)return console.warn("No privy wallet found, cannot fund wallet.");let{signedUrl:dt,externalTransactionId:xe}=await i(De.address,{config:T?.config||{}});h({fiatOnRampPrompt:{signedUrl:dt},fiatOnRampStatus:{externalTransactionId:xe}}),u("FIAT_ON_RAMP_PROMPT_SCREEN")},yo=jh(()=>new pb(Ft(ie.chainId,l,a)),[ie.chainId,a]);Kh(()=>{async function dt(){let xe=ie;if(!await t()||!r||!De)return;try{xe=await Tn(De.address,ie,yo),ho(xe)}catch(ko){j("There was an error preparing your transaction. Please try again.",ko.reason)}let Mn=qh.from(0),Wn=qh.from(0);try{({totalGasEstimate:Mn,l1ExecutionFeeEstimate:Wn}=await Pn(xe,yo)),J(Mn.toHexString()),$(Wn.toHexString())}catch{J(null)}try{let{balance:ko,hasSufficientFunds:ki}=await Rs(De.address,xe,Mn,yo);qe(ko.toHexString()),ki||(wt(!1),j("Wallet has insufficient funds for this transaction."),c?.fiatOnRamp.enabled&&H(!0))}catch(ko){console.warn(`Failed to fetch wallet balance with error: ${ko}`)}In(!1)}dt()},[r]);let Ai=zh(ie),je=Ai==="SEND"?`Send ${M}`:"Review transaction",Tr={modalTitle:C.header||C.modalTitle||je,buttonText:C.buttonText||"Submit"},xr=()=>{ne||(S?b(S):x(R||new ve(new Et("The user rejected the request",Fe.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}))};return v.current=xr,ct===void 0&&or||_e?xn(Wc,{children:[C.transactionInfo?.contractInfo?.imgUrl&&ze(ra,{src:C.transactionInfo?.contractInfo?.imgUrl}),ze(k,{title:Tr.modalTitle,onClose:xr}),ze(Yh,{children:ze(en,{})})]}):L!==null?ze($h,{txn:ie,onClose:xr,receipt:L,transactionInfo:C.transactionInfo,tokenPrice:ct,tokenSymbol:M,l1GasEstimate:Rn}):xn(Wc,{children:[ze(k,{title:Tr.modalTitle,onClose:xr}),xn(Yh,{children:[xn(yb,{children:[ze(ub,{txn:ie,txnFamily:Ai,uiOptions:C,tokenSymbol:M,tokenPrice:ct}),De?ze(Cn,{from:De.address,to:ie.to,txn:ie,transactionInfo:C.transactionInfo,gas:Y||void 0,tokenPrice:ct,tokenSymbol:M}):null]}),xn(gb,{children:[ze(mb,{children:P}),ze(gh,{txn:ie,address:De?.address??"",hasFunds:$e,balance:it}),xn(fb,{children:[ce&&ze(D,{onClick:rr,children:"Add Funds"}),ze(hb,{disabled:ne||!$e,loading:!r||ne,loadingText:ne?"Submitting (may take a few minutes)...":"Loading...",onClick:async()=>{oe(!0);let dt=await t();if(dt&&!ne&&De)try{let xe=await ks(dt,De.address,r,ie,yo);U(xe);let Lt=await xe.wait();I(Is(Lt)),V()}catch(xe){let Lt="There was an error processing your transaction. Please contact support.";console.warn({transaction:ie,error:xe}),j(Lt,xe.reason)}finally{oe(!1)}},children:Tr.buttonText})]})]})]})]})},Yh=Sn.div`
|
|
2205
2219
|
display: flex;
|
|
2206
2220
|
flex-direction: column;
|
|
2207
2221
|
justify-content: space-between;
|
|
2208
2222
|
flex-grow: 1;
|
|
2209
2223
|
padding-bottom: 16px;
|
|
2210
|
-
`,
|
|
2224
|
+
`,mb=Sn.div`
|
|
2211
2225
|
font-size: 13px;
|
|
2212
2226
|
color: var(--privy-color-error);
|
|
2213
2227
|
width: 100%;
|
|
2214
2228
|
margin-top: 16px;
|
|
2215
|
-
`,
|
|
2229
|
+
`,fb=Sn.div`
|
|
2216
2230
|
display: flex;
|
|
2217
2231
|
direction: row;
|
|
2218
2232
|
justify-content: space-between;
|
|
2219
2233
|
align-items: center;
|
|
2220
2234
|
gap: 8px;
|
|
2221
|
-
`,
|
|
2235
|
+
`,hb=Sn(D)`
|
|
2222
2236
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2223
|
-
`,
|
|
2237
|
+
`,yb=Sn.div`
|
|
2224
2238
|
height: 100%;
|
|
2225
2239
|
display: flex;
|
|
2226
2240
|
flex-direction: column;
|
|
2227
2241
|
justify-content: space-evenly;
|
|
2228
2242
|
flex-grow: 1;
|
|
2229
|
-
`,
|
|
2243
|
+
`,gb=Sn.div`
|
|
2230
2244
|
display: flex;
|
|
2231
2245
|
flex-direction: column;
|
|
2232
2246
|
gap: 8px;
|
|
2233
|
-
`;import{isHexString as
|
|
2247
|
+
`;import{isHexString as vb}from"@ethersproject/bytes";import{toUtf8String as wb}from"@ethersproject/strings";import{useEffect as Zh,useState as Os}from"react";import er,{css as Cb}from"styled-components";import{Fragment as ey,jsx as Se,jsxs as _n}from"react/jsx-runtime";var bb=e=>{if(!vb(e))return e;try{return wb(e)}catch{return e}},Eb=e=>JSON.stringify(e,null,2),Pb=({data:e})=>{let t=o=>typeof o=="object"&&o!==null?Se(Ab,{children:Object.entries(o).map(([r,n])=>_n("li",{children:[_n("strong",{children:[r,":"]})," ",t(n)]},r))}):Se("span",{children:String(o)});return Se("div",{children:t(e)})},Tb=e=>{let{types:t,primaryType:o,...r}=e.typedData;return _n(ey,{children:[Se(Xh,{children:Se(Pb,{data:r})}),Se(pn,{text:Eb(e.typedData),itemName:"full payload to clipboard"})," "]})},Qh=()=>{let{authenticated:e}=B(),{initializeWalletProxy:t,closePrivyModal:o}=W(),{navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:i}=A(),[a,l]=Os(!0),[s,c]=Os(""),[u,m]=Os(),[v,h]=Os(null),w=v!==null;Zh(()=>{e||r("LANDING")},[e]),Zh(()=>{t(Ir).then(P=>{l(!1),P||(c("An error has occurred, please try again."),m(new ve(new Et(s,Fe.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:b,data:x,confirmAndSign:C,onSuccess:T,onFailure:L,uiOptions:I}=n.signMessage,S={title:I.title||"Sign message",description:I.description||"Signing this message will not cost you any fees.",buttonText:I.buttonText||"Sign and continue"},U=P=>{P?T(P):L(u||new ve(new Et("The user rejected the request.",Fe.E4001_USER_REJECTED_REQUEST.eipCode))),o({shouldCallAuthOnSuccess:!1}),h(null),c(""),m(void 0)};return i.current=()=>{U(v)},_n(ey,{children:[Se(k,{onClose:()=>U(v)}),Se(Q,{}),_n(xb,{children:[Se(Sb,{children:S.title}),Se(_b,{children:S.description}),b==="personal_sign"&&Se(Xh,{children:bb(x)}),b==="eth_signTypedData_v4"&&Se(Tb,{typedData:x}),Se(kb,{fail:!0,children:s}),Se(Ib,{success:w,loading:a,disabled:w,onClick:async()=>{try{let P=await C();h(P),c(""),setTimeout(()=>{U(P)},Qe)}catch{c("An error has occurred, please try again."),m(new ve(new Et(s,Fe.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}},children:w?_n(Rb,{children:[Se(Ya,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",Se("span",{children:"Success"})]}):S.buttonText})]}),Se(X,{}),Se(G,{protectedByPrivy:!0})]})},xb=er.div`
|
|
2234
2248
|
display: flex;
|
|
2235
2249
|
flex-direction: column;
|
|
2236
2250
|
align-items: center;
|
|
2237
2251
|
justify-content: center;
|
|
2238
|
-
`,
|
|
2252
|
+
`,Sb=er.span`
|
|
2239
2253
|
color: var(--privy-color-foreground);
|
|
2240
2254
|
text-align: center;
|
|
2241
2255
|
font-size: 1.125rem;
|
|
2242
2256
|
font-weight: 500;
|
|
2243
2257
|
line-height: 1.25rem; /* 111.111% */
|
|
2244
2258
|
text-align: center;
|
|
2245
|
-
`,
|
|
2259
|
+
`,_b=er.span`
|
|
2246
2260
|
margin-top: 4px;
|
|
2247
2261
|
color: var(--privy-color-foreground);
|
|
2248
2262
|
text-align: center;
|
|
@@ -2252,7 +2266,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2252
2266
|
font-weight: 400;
|
|
2253
2267
|
line-height: 20px; /* 142.857% */
|
|
2254
2268
|
letter-spacing: -0.008px;
|
|
2255
|
-
`,Xh=
|
|
2269
|
+
`,Xh=er.div`
|
|
2256
2270
|
margin-top: 1.5rem;
|
|
2257
2271
|
background-color: var(--privy-color-background-2);
|
|
2258
2272
|
border-radius: var(--privy-border-radius-md);
|
|
@@ -2271,7 +2285,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2271
2285
|
display: none; /* Safari and Chrome */
|
|
2272
2286
|
}
|
|
2273
2287
|
}
|
|
2274
|
-
`,
|
|
2288
|
+
`,Ab=er.ul`
|
|
2275
2289
|
margin-left: 12px !important;
|
|
2276
2290
|
white-space: nowrap;
|
|
2277
2291
|
|
|
@@ -2283,7 +2297,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2283
2297
|
font-weight: 500 !important;
|
|
2284
2298
|
}
|
|
2285
2299
|
}
|
|
2286
|
-
`,
|
|
2300
|
+
`,kb=er.div`
|
|
2287
2301
|
line-height: 20px;
|
|
2288
2302
|
height: 20px;
|
|
2289
2303
|
font-size: 13px;
|
|
@@ -2293,22 +2307,22 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2293
2307
|
width: 100%;
|
|
2294
2308
|
margin-top: 16px;
|
|
2295
2309
|
margin-bottom: 4px;
|
|
2296
|
-
`,
|
|
2310
|
+
`,Rb=er.span`
|
|
2297
2311
|
display: flex;
|
|
2298
2312
|
align-items: center;
|
|
2299
2313
|
gap: 8px;
|
|
2300
|
-
`,
|
|
2314
|
+
`,Ib=er(D)`
|
|
2301
2315
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2302
2316
|
|
|
2303
|
-
${e=>e.success&&
|
|
2317
|
+
${e=>e.success&&Cb`
|
|
2304
2318
|
&&&& {
|
|
2305
2319
|
background-color: var(--privy-color-success);
|
|
2306
2320
|
color: #ffffff;
|
|
2307
2321
|
}
|
|
2308
2322
|
`}
|
|
2309
|
-
`;import
|
|
2323
|
+
`;import Db from"@heroicons/react/24/outline/EnvelopeIcon";import Mb from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as Wb,useState as ty}from"react";import ry from"styled-components";import{Fragment as Nb,jsx as _i,jsxs as oy}from"react/jsx-runtime";var ny=Wb((e,t)=>{let[o,r]=ty(""),[n,i]=ty(!1),{authenticated:a,user:l}=B(),{initUpdateEmail:s}=W(),{navigate:c,setModalData:u,currentScreen:m}=A(),{enabled:v,token:h}=pe(),w=zi(o),b=n,x=n||!w,C=async L=>{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,L),c("AWAITING_PASSWORDLESS_CODE")}catch(I){u({errorModalData:{error:I,previousScreen:m||"LANDING"}})}i(!1)},T=()=>{v&&!h&&!a?(u({captchaModalData:{callback:L=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,o,L)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):C(h)};return oy(Nb,{children:[_i(Lb,{children:oy(Ob,{children:[_i(Mb,{}),_i("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:L=>r(L.target.value),onKeyUp:L=>{L.key==="Enter"&&T()},value:o,autoComplete:"email"}),e.stacked?null:_i(Vr,{isSubmitting:b,onClick:T,disabled:x,children:"Submit"})]})}),e.stacked?_i(D,{loadingText:null,loading:b,disabled:x,onClick:T,children:"Submit"}):null]})}),Lb=ry.div`
|
|
2310
2324
|
width: 100%;
|
|
2311
|
-
`,
|
|
2325
|
+
`,Ob=ry.label`
|
|
2312
2326
|
display: block;
|
|
2313
2327
|
position: relative;
|
|
2314
2328
|
width: 100%;
|
|
@@ -2366,7 +2380,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2366
2380
|
&& > input::placeholder {
|
|
2367
2381
|
color: var(--privy-color-foreground-3);
|
|
2368
2382
|
}
|
|
2369
|
-
`;import{Fragment as
|
|
2383
|
+
`;import{Fragment as Ub,jsx as tr,jsxs as Fb}from"react/jsx-runtime";var iy=()=>Fb(Ub,{children:[tr(k,{},"header"),tr(Q,{}),tr(be,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:tr(Db,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),tr(At,{children:tr(ny,{stacked:!0})}),tr(X,{}),tr(G,{protectedByPrivy:!0})]});import Hb,{createGlobalStyle as Gb}from"styled-components";var Bb=`
|
|
2370
2384
|
*,
|
|
2371
2385
|
::before,
|
|
2372
2386
|
::after {
|
|
@@ -2596,7 +2610,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2596
2610
|
[hidden] {
|
|
2597
2611
|
display: none;
|
|
2598
2612
|
}
|
|
2599
|
-
`,ay=
|
|
2613
|
+
`,ay=Bb;var sy=Gb`
|
|
2600
2614
|
:root {
|
|
2601
2615
|
// Borders
|
|
2602
2616
|
--privy-border-radius-sm: 6px;
|
|
@@ -2628,7 +2642,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2628
2642
|
--privy-height-modal-full: 620px;
|
|
2629
2643
|
--privy-height-modal-compact: 480px;
|
|
2630
2644
|
};
|
|
2631
|
-
`,ly=
|
|
2645
|
+
`,ly=Hb.div`
|
|
2632
2646
|
// css normalize only the privy application to avoid conflicts
|
|
2633
2647
|
// with consuming application
|
|
2634
2648
|
${ay}
|
|
@@ -2690,4 +2704,4 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2690
2704
|
opacity: 1;
|
|
2691
2705
|
}
|
|
2692
2706
|
}
|
|
2693
|
-
`;import{jsx as Oe,jsxs as dy}from"react/jsx-runtime";var Kb={["LANDING"]:Sf,["CONNECT_OR_CREATE"]:Tf,["AWAITING_PASSWORDLESS_CODE"]:uu,["AWAITING_CONNECTION"]:Iu,["AWAITING_CONNECT_ONLY_CONNECTION"]:Ou,["AWAITING_FARCASTER_CONNECTION"]:Bm,["PHANTOM_INTERSTITIAL_SCREEN"]:Vh,["LOGIN_FAILED_SCREEN"]:Wf,["AWAITING_OAUTH_SCREEN"]:Fh,["ALLOWLIST_REJECTION_SCREEN"]:ou,["INSTALL_PHANTOM_SCREEN"]:ef,["LINK_EMAIL_SCREEN"]:_f,["LINK_PHONE_SCREEN"]:Af,["LINK_WALLET_SCREEN"]:kf,["UPDATE_EMAIL_SCREEN"]:iy,["CONNECT_ONLY_LANDING_SCREEN"]:Au,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:xu,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:Cm,["EMBEDDED_WALLET_CREATED_SCREEN"]:Gu,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:Bu,["EMBEDDED_WALLET_RECOVERY_SCREEN"]:Pm,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:qu,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:Qh,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:Jh,["FIAT_ON_RAMP_PROMPT_SCREEN"]:qm,["FIAT_ON_RAMP_STATUS_SCREEN"]:Km,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:Em,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:bm,["MFA_ENROLLMENT_FLOW_SCREEN"]:jf,["CAPTCHA_SCREEN"]:yu,["ERROR_SCREEN"]:Tm,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:Ym,["AFFIRMATIVE_CONSENT_SCREEN"]:eu},Yb=["LANDING","AWAITING_CONNECTION"],Jb=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:o,isModalOpen:r}=G(),{headless:n}=M(),{ready:i,currentScreen:a}=S(),{status:l,execute:s,reset:c,enabled:u}=ce(),m=$b(null),h=Hp(m),y=r&&a&&Yb.includes(a)&&!n&&l==="ready";if(cy(()=>{y&&s()},[y]),cy(()=>{!r&&u&&c()},[r,u]),(!o||!i)&&a!=="AWAITING_OAUTH_SCREEN")return dy(gn,{children:[Oe(A,{}),Oe(J,{}),Oe(Nf,{children:Oe(Et,{})}),Oe(Z,{}),Oe(ee,{})]});if(!a&&e)return Oe(gn,{style:{height:h},children:Oe("div",{ref:m,children:Oe(kc,{open:e,onClose:t})})});if(!a)return null;let C=Kb[a];return Oe(gn,{style:{height:h},children:dy("div",{ref:m,children:[Oe(vo,{if:!!e,children:Oe(C,{})}),Oe(vo,{if:!e,children:Oe(kc,{open:e,onClose:t})})]})})},Zb=()=>{let{closePrivyModal:e}=M(),{onUserCloseViaDialogOrKeybindRef:t}=S();return{gracefulClosePrivyModal:zb(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},py=({open:e})=>{let{app:t}=S(),{gracefulClosePrivyModal:o}=Zb(),[r,n]=qb(!1);sl({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=Oe(ly,{children:Oe(Jb,{isMfaVerifying:r,onMfaVerificationComplete:()=>n(!1)})}),a=e||r,l=t?.render.inDialog?Oe(Of,{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 jb.createPortal(l,s)}return l};import{useRef as Qb}from"react";var Os=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 Er(e,t,o,r,n,i=!1){let a=i,l=async u=>{if(a&&t&&t.length>0){u===(i?0:1)?n("configureMfa","onMfaRequired",t):r.current?.reject(new Ee("missing_or_invalid_mfa","MFA verification failed, retry."));let m=await new Promise((h,y)=>{o.current={resolve:h,reject:y};let C=1e3*60*5;setTimeout(()=>{let E=new Ee("mfa_timeout","Timed out waiting for MFA code");r.current?.reject(E),y(E)},C)});return await e(m)}return await e()},s=4,c=null;for(let u=0;u<s;u++)try{c=await l(u),r.current?.resolve(void 0);break}catch(m){if(m.type==="missing_or_invalid_mfa")a=!0;else throw r.current?.resolve(void 0),m}if(c===null){let u=new Ee("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw r.current?.reject(u),u}return c}import{jsx as n4}from"react/jsx-runtime";var Xb=function(e){return()=>`id-${e++}`}(0);function e4(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function co(e){return e.error!==void 0}var qt=new Os,Wc=new Map,t4=(e,t)=>typeof t=="bigint"?t.toString():t,o4=(e,t)=>`${e}${JSON.stringify(t,t4)}`;function po(e,t,o,r){let n=o.contentWindow;if(!n)throw new Error("iframe not initialized");let i=o4(e,t);if(e==="privy:wallet:create"){let l=Wc.get(i);if(l)return l}let a=new Promise((l,s)=>{let c=Xb();qt.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},r)}).finally(()=>{Wc.delete(i)});return Wc.set(i,a),a}function r4(e){switch(e.event){case"privy:iframe:ready":let t=qt.dequeue(e.event,e.id);return co(e)?t.reject(new Ee(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let o=qt.dequeue(e.event,e.id);return co(e)?o.reject(new Ee(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let r=qt.dequeue(e.event,e.id);return co(e)?r.reject(new Ee(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:recover":let n=qt.dequeue(e.event,e.id);return co(e)?n.reject(new Ee(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let i=qt.dequeue(e.event,e.id);return co(e)?i.reject(new Ee(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:set-recovery-password":let a=qt.dequeue(e.event,e.id);return co(e)?a.reject(new Ee(e.error.type,e.error.message)):a.resolve(e.data);case"privy:mfa:verify":let l=qt.dequeue(e.event,e.id);return co(e)?l.reject(new Ee(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let s=qt.dequeue(e.event,e.id);return co(e)?s.reject(new Ee(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:submit-enrollment":{let s=qt.dequeue(e.event,e.id);return co(e)?s.reject(new Ee(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:unenroll":{let s=qt.dequeue(e.event,e.id);return co(e)?s.reject(new Ee(e.error.type,e.error.message)):s.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function uy(e){let t=Qb(null),o=zp();return n4("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>{let n=t.current;if(!n)return;function i(u){u&&u.origin===e.origin&&e4(u.data)&&r4(u.data)}let a={create(u){return po("privy:wallet:create",u,n,e.origin)},connect(u){return po("privy:wallet:connect",u,n,e.origin)},recover(u){return Er(m=>po("privy:wallet:recover",{...u,...m},n,e.origin),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)},rpc(u){return Er(m=>po("privy:wallet:rpc",{...u,...m},n,e.origin),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},setRecoveryPassword(u){return Er(m=>po("privy:wallet:set-recovery-password",{...u,...m},n,e.origin),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(u){return Er(m=>po("privy:mfa:verify",{...u,...m},n,e.origin),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(u){return Er(m=>po("privy:mfa:init-enrollment",{...u,...m},n,e.origin),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(u){return po("privy:mfa:submit-enrollment",u,n,e.origin)},unenrollMfa(u){return Er(m=>po("privy:mfa:unenroll",{...u,...m},n,e.origin),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)}};window.addEventListener("message",i);let l=()=>e.onLoad(a),s=(...u)=>{console.warn("Privy iframe failed to load: ",...u),e.onLoadFailed()},c=new AbortController;return Dd(()=>po("privy:iframe:ready",{},n,e.origin),{abortSignal:c.signal}).then(l,s),()=>{window.removeEventListener("message",i),c.abort()}},src:zi(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId})})}function Lc(e){let t=e.toLowerCase();return["fbav","fban","instagram","snapchat"].some(r=>t.includes(r))}var Ns=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{await this.api.post(pd,{action:this.meta.action,phoneNumber:this.meta.phoneNumber})}catch(t){throw ie(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=await this.api.post(ud,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return dt(t)}catch(t){throw ie(t)}}};import{jsx as uo,jsxs as my}from"react/jsx-runtime";var kn;function c4(e){return typeof e=="string"&&e.length===25}function Ae(){if(!kn){let e=ae.get(rr);return Promise.resolve(e||null)}return kn.getAccessToken()}var fy,zd=(e,t)=>fy(e,t),hy,$d=(e,t)=>hy(e,t),yy,qd=(e,t)=>yy(e,t),gy,jd=()=>gy(),d4=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;ae.put(Wn,t);let o=new URL(window.location.href);o.searchParams.delete("privy_token"),window.history.pushState({},"",o)},p4=({config:e,...t})=>{if(!c4(t.appId))throw new w("Cannot initialize the Privy provider with an invalid Privy app ID");kn||(kn=new Hn({appId:t.appId,apiUrl:t.apiUrl||Di}));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."),uo(Cp,{client:kn,clientConfig:o,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:uo(u4,{...t,config:o,client:kn})})},u4=e=>{let t=e.client,[o,r]=Te(!1),[n,i]=Te(!1),[a,l]=Te(!1),[s,c]=Te(null),[u,m]=Te(!1),[h,y]=Te([]),C=Si(h),[E,T]=Te(!1),[b,_]=Te(null),[R,I]=Te(!1),[x,O]=Te({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:P}),[N,F]=Te(null),[H,q]=Te(null),[D,z]=Te(null),k=ya(),oe=bp(),[re,j]=Te(!0),[ze,fe]=Te({}),[rt,xe]=Te(null),[ne,mo]=Te(null),[Mt,Pr]=Te(!1),[nt,Se]=Te(!1),jt=Si(null),Tr=Si(null),W=Si(Gp);t.onStoreToken=d=>{d&&B(W,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{B(W,"accessToken","onAccessTokenRemoved")};let $e=Si(),Rn=s4(d=>{let p=t.connectors?.walletsReady||!1;return a&&s?.linkedAccounts?.some(v=>v.type==="wallet"&&v.walletClientType==="privy")?p&&d?.some(v=>v?.walletClientType==="privy"):p},[a,s?.linkedAccounts,t?.connectors?.walletsReady]),X=d=>{_(d),setTimeout(()=>{r(!0)},15),t.createAnalyticsEvent("modal_open",{initialScreen:d})},gt=d=>{k.embeddedWallets.createOnLogin!=="off"&&j(!0),X(d)};xo(()=>{if(!D||!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(D,p,k.defaultChain)}},[D,s]),xo(()=>{D&&ne?.(D)},[D]),xo(()=>{(async()=>{if(!k.customAuth?.enabled)return;j(!0);let{getCustomAccessToken:p,isLoading:f}=k.customAuth;if(!(!n||f))try{let v=await p();if(!v){await _r.logout();return}if(a)return;t.startAuthFlow(new kr(v));let{user:L,isNewUser:$}=await t.authenticate();L||await _r.logout(),c(L||null),T($||!1),l(!0),Se(!0)}catch(v){console.warn(v),a&&await _r.logout()}})()},[k.customAuth?.enabled,k.customAuth?.getCustomAccessToken,k.customAuth?.isLoading,n,a]),xo(()=>{nt&&D&&s&&wt(s,e.config?.embeddedWallets?.createOnLogin)&&(Se(!1),Ai(s,Mr).catch(console.error))},[nt&&D&&s]),xo(()=>{async function d(){let p=xr();d4();let f=a4();F(f),t.initializeConnectorManager(k.walletConnectCloudProjectId,k.rpcConfig,k.chains,k.defaultChain,f,k.appearance.walletList,k.shouldEnforceDefaultChainOnConnect),t.connectors?.initialize().then(()=>{Sr()});let v=await t.getAuthenticatedUser();e.config?.customAuth?.enabled||(l(!!v),v&&B(W,"login","onComplete",v,!1,!0,null),c(v)),p||de.setReadyToTrue(),p&&v&&m(!0)}!n&&oe&&d()},[t,rt,n,oe]);let xr=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_oauth_code"),f=d.get("privy_oauth_state"),v=d.get("privy_oauth_provider");return p&&f&&v?(t.startAuthFlow(new Ro(v,p,f)),gt("AWAITING_OAUTH_SCREEN"),!0):!1},_i=async(d,p,f,v)=>{let L=await t.connectors?.createWalletConnector(d,p)||null;In(L,p,f,v)};async function In(d,p,f,v){if(!d)return O({status:"disconnected",connectedWallet:null,connectError:new Y("Unable to connect to wallet."),connector:null,connectRetry:P}),v?.(null,f);d instanceof Qt&&p&&await d.resetConnection(p),O({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>In(d,p,f,v)});try{let L=await d.connect({showPrompt:!0});if(k.shouldEnforceDefaultChainOnConnect&&!k.chains.find($=>$.id===Number(L?.chainId))&&!(L?.connectorType==="wallet_connect_v2"&&L?.walletClientType==="metamask")){O($=>({...$,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:P}));try{await L?.switchChain(k.defaultChain.id),L&&(L.chainId=Wr(sr(k.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${k.defaultChain.id}`)}}return O($=>({...$,status:"connected",connectedWallet:L,connectError:null,connectRetry:P})),L&&!R&&B(W,"connectWallet","onSuccess",L),v?.(L,f)}catch(L){return L instanceof De?(console.warn(L.cause?L.cause:L.message),R||B(W,"connectWallet","onError",L.privyErrorCode||"generic_connect_wallet_error")):(console.warn(L),R||B(W,"connectWallet","onError","unknown_connect_wallet_error")),O($=>({...$,status:"disconnected",connectedWallet:null,connectError:L})),v?.(null,f)}}let So=async(d,p)=>{if(d===null)return;let f=new ir(d,p);t.startAuthFlow(f)},Sr=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),f=d.get("privy_wallet_client");if(!p||!f)return;if(f==="phantom"&&!Io()&>("LOGIN_FAILED_SCREEN"),!t.connectors)throw new w("Connector not initialized");X("AWAITING_CONNECTION");let v=new URL(window.location.href);v.searchParams.delete("privy_connector"),v.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",v),_i(p,f,void 0,So)};xo(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let it=()=>{if(!a)throw new w("User must be authenticated before linking a wallet.");m(!0),X("LINK_WALLET_SCREEN")},Ne=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},_o=async d=>{if(!t.connectors)throw new w("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(O(f=>({...f,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:P})),k.captchaEnabled&&!a){let f={callback:v=>So(d,v),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};fe({captchaModalData:f}),gt("CAPTCHA_SCREEN")}else await So(d),gt("AWAITING_CONNECTION")},tr=async(d,p)=>{if(!k.fiatOnRamp.enabled)throw new w("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:f,externalTransactionId:v}=await zm(t,d,p?.config??{},k.appearance.palette,k.fiatOnRamp.useSandbox);return{signedUrl:f,externalTransactionId:v}}else throw new w("Unsupported fund provider. Currently supported option is `moonpay`.")},or=()=>{y(d=>{let p=t.connectors?.wallets.map(f=>({...f,linked:Ne(f),loginOrLink:async()=>{if(!await f.isConnected())throw new w("Wallet is not connected");if(f.connectorType==="embedded"&&f.walletClientType==="privy")throw new w("Cannot link or login with embedded wallet");_o(f)},fund:async v=>{let{signedUrl:L,externalTransactionId:$}=await tr(f.address,v);fe({fiatOnRampPrompt:{signedUrl:L},fiatOnRampStatus:{externalTransactionId:$}}),X("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!a)throw new w("User is not authenticated.");if(f.connectorType==="embedded"&&f.walletClientType==="privy")throw new w("Cannot unlink an embedded wallet");let v=await t.unlinkWallet(f.address);c(v)}}))||[];return Pr(Rn(p)),Ki(d,p)?d:p})};xo(()=>{or()},[s?.linkedAccounts,a,n]),xo(()=>{if(n){if(!t.connectors)throw new w("Connector not initialized");or(),t.connectors.on("walletsUpdated",or)}},[n]);let Ao=()=>{X(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};xo(()=>{if(!h[0])return;let d=h[0],p=C.current.find(v=>v.address===d.address),f;if(d.walletClientType==="privy"?f=s?.linkedAccounts.find(v=>v.type==="wallet"&&v.address===d.address&&v.walletClientType==="privy"):f=s?.linkedAccounts.find(v=>v.type==="wallet"&&v.address===d.address&&v.walletClientType!=="privy"),!p&&f){let v=Object.assign({},s);v.wallet=f&&{address:f.address,chainType:f.chainType,chainId:f.chainId,walletClient:f.walletClient,walletClientType:f.walletClientType,connectorType:f.connectorType},c(v)}C.current=h},[h]);let Ai=async(d,p)=>{if(pe(d))throw B(W,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[v,L]=await Promise.all([de.initializeWalletProxy(p),Ae()]);if(!v&&e.config?.customAuth?.enabled)throw B(W,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!v||!L||e.config?.embeddedWallets?.requireUserPasswordOnCreate)return new Promise(($,le)=>{j(!0),fe({createWallet:{onSuccess:at=>{B(W,"createWallet","onSuccess",at),$(at)},onFailure:at=>{B(W,"createWallet","onError","unknown_embedded_wallet_error"),le(at)},callAuthOnSuccessOnClose:!1}}),X("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await v.create({accessToken:L});let $=await de.refreshUser(),le=pe($);if(!le)throw B(W,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return B(W,"createWallet","onSuccess",le),le}},Cy=d=>{if(!k.chains.map(p=>p.id).includes(d))throw new Y(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},Nc=(d,p,f)=>new Promise(async(v,L)=>{if(!a||!s){B(W,"sendTransaction","onError","must_be_authenticated"),L(new Error("User must be authenticated before signing with a Privy wallet"));return}let $=pe(s);if(!$){B(W,"sendTransaction","onError","embedded_wallet_not_found"),L(new Error("Must have a Privy wallet before signing"));return}j(!0);let le=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,qe=d.chainId?Number(d.chainId):le.chainId;Cy(qe);let at=Object.assign({},d,{chainId:qe}),fo=async()=>{let je=await Ae();if(!je||!D){B(W,"sendTransaction","onError","embedded_wallet_not_found"),L(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await de.recoverEmbeddedWallet()){B(W,"sendTransaction","onError","unknown_connect_wallet_error"),L(new Error("Unable to connect to wallet"));return}let Lt=new i4(Nt(at.chainId,k.chains,k.rpcConfig)),Us=await xn($.address,at,Lt);if(k.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:Ey}=await Tn(Us,Lt),{hasSufficientFunds:Py}=await ks($.address,Us,Ey,Lt);if(!Py)throw new ye(new Ct("Wallet has insufficient funds for this transaction.",Ue.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let Fc=await As(je,$.address,D,Us,Lt);B(W,"sendTransaction","onSuccess",Fc),v(Fc)}catch(Wt){B(W,"sendTransaction","onError","transaction_failure"),L(Wt)}};if(k.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),fo();else{let je={transactionRequest:at,onSuccess:Lt=>{B(W,"sendTransaction","onSuccess",Lt),v(Lt)},onFailure:Lt=>{B(W,"sendTransaction","onError","transaction_failure"),L(Lt)},uiOptions:p||{},fundWalletConfig:f},Wt={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:Lt=>{B(W,"sendTransaction","onError","unknown_connect_wallet_error"),L(Lt)}};fe({connectWallet:Wt,sendTransaction:je}),X("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function Dc(){return new Promise(async(d,p)=>{let f=await Ae();if(!f||!D)throw new Error("Must have valid access token to enroll in MFA");try{await D.verifyMfa({accessToken:f}),d()}catch(v){p(v)}})}let _r={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:Ao,linkWallet:it,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.");m(!0),X("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.");m(!0),X("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 de.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 de.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 de.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 de.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 de.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 de.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 de.initLoginWithOAuth("linkedin")},linkApple:async()=>{if(!a)throw new w("User must be authenticated before linking an Apple account.");await de.initLoginWithOAuth("apple")},linkFarcaster:async()=>{if(!a)throw new w("User must be authenticated before linking a Farcaster account.");await de.initLoginWithFarcaster(),m(!0),X("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.");m(!0),X("UPDATE_EMAIL_SCREEN")},login:async()=>{if(n||(await new Promise(d=>{xe(()=>d)}),xe(null)),a){console.warn("Attempted to log in, but user is already logged in. Use a `link` helper instead.");return}I(!0),gt("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{xe(()=>d)}),xe(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(h[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}gt("CONNECT_OR_CREATE")},logout:async()=>{await t.logout(),c(null),l(!1),_(null),B(W,"logout","onSuccess"),m(!1),r(!1),ae.del(Ln)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new ue;let d=h.find(f=>s.wallet&&f.address===s.wallet.address),p=t.connectors?.walletConnectors.find(f=>f.wallets.find(v=>v.address===d?.address));return!d||!p?new ue:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new Oc(new Yt(new ue));let d=h.find(f=>s.wallet&&f.address===s.wallet.address),p=t.connectors?.walletConnectors.find(f=>f.wallets.find(v=>v.address===d?.address));return!d||!p?new Oc(new Yt(new ue)):new Oc(new Yt(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new Lo(new ue);let d=h.find(f=>s.wallet&&f.address===s.wallet.address),p=t.connectors?.walletConnectors.find(f=>f.wallets.find(v=>v.address===d?.address));return!d||!p?new Lo(new ue):new Lo(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=h.find(v=>Ds(v.address)===Ds(d)),f=s?.linkedAccounts.find(v=>v.type==="wallet"&&Ds(v.address)===Ds(d));if(!p||!await p.isConnected())q(d),it();else if(!p.linked)p.loginOrLink();else{let v=Object.assign({},s);v.wallet=f&&{address:f.address,chainType:f.chainType,chainId:f.chainId,walletClient:f.walletClient,walletClientType:f.walletClientType,connectorType:f.connectorType},c(v)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw B(W,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return Ai(s,15e3)},setWalletPassword:async()=>{if(!a||!s)throw B(W,"setWalletPassword","onError","must_be_authenticated"),new Error("User must be authenticated before adding password to Privy wallet");let d=pe(s);if(!d||!D)throw B(W,"setWalletPassword","onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a password");if(d.recoveryMethod==="user-passcode")throw B(W,"setWalletPassword","onError","embedded_wallet_password_already_exists"),new Error("Cannot set password. Embedded wallet already has a password.");try{await Dc()}catch(p){throw B(W,"setWalletPassword","onError","missing_mfa_credentials"),p}return new Promise((p,f)=>{j(!0);let v={onSuccess:$=>{B(W,"setWalletPassword","onSuccess",$),p($)},onFailure:$=>{B(W,"setWalletPassword","onError","user_exited_set_password_flow"),f($)},callAuthOnSuccessOnClose:!1},L={onCompleteNavigateTo:"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",onFailure:$=>{B(W,"setWalletPassword","onError","unknown_connect_wallet_error"),f($)}};fe({setWalletPassword:v,connectWallet:L}),X("EMBEDDED_WALLET_CONNECTING_SCREEN")})},signMessage:(d,p)=>new Promise(async(f,v)=>{if(!a||!s){B(W,"signMessage","onError","must_be_authenticated"),v(new Error("User must be authenticated before signing with a Privy wallet"));return}let L=pe(s);if(!L){B(W,"signMessage","onError","embedded_wallet_not_found"),v(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){B(W,"signMessage","onError","invalid_message"),v(new Error("Message must be a non-empty string"));return}j(!0);let $=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let le=await Ae();if(!D||!le)throw new Error("Unable to connect to wallet");if(!await de.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_message_started",{walletAddress:L.address});let{response:at}=await D.rpc({accessToken:le,address:L.address,request:{method:"personal_sign",params:[d,L.address]}}),fo=at.data;return t.createAnalyticsEvent("embedded_wallet_sign_message_completed",{walletAddress:L.address}),fo};if(k.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let le=await $();B(W,"signMessage","onSuccess",le),f(le)}catch(le){B(W,"signMessage","onError","unable_to_sign"),v(le??new ye("Unable to sign message"))}}else{let at={method:"personal_sign",data:d,confirmAndSign:$,onSuccess:je=>{B(W,"signMessage","onSuccess",je),f(je)},onFailure:je=>{B(W,"signMessage","onError","unable_to_sign"),v(je)},uiOptions:p||{}},fo={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:je=>{B(W,"signMessage","onError","unknown_connect_wallet_error"),v(je)}};fe({signMessage:at,connectWallet:fo}),X("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(f,v)=>{if(!a||!s){B(W,"signTypedData","onError","must_be_authenticated"),v(new Error("User must be authenticated before signing with a Privy wallet"));return}let L=pe(s);if(!L){B(W,"signTypedData","onError","embedded_wallet_not_found"),v(new Error("Must have a Privy wallet before signing"));return}j(!0);let $=$i(d),le=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let qe=await Ae();if(!D||!qe)throw new Error("Unable to connect to wallet");if(!await de.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_typed_data_started",{walletAddress:L.address});let{response:fo}=await D.rpc({accessToken:qe,address:L.address,request:{method:"eth_signTypedData_v4",params:[L.address,$]}}),je=fo.data;return t.createAnalyticsEvent("embedded_wallet_sign_typed_data_completed",{walletAddress:L.address}),je};if(k.embeddedWallets.noPromptOnSignature||(k.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let qe=await le();B(W,"signTypedData","onSuccess",qe),f(qe)}catch(qe){B(W,"signTypedData","onError","unable_to_sign"),v(qe??new ye("Unable to sign message"))}}else{let fo={method:"eth_signTypedData_v4",data:$,confirmAndSign:le,onSuccess:Wt=>{B(W,"signTypedData","onSuccess",Wt),f(Wt)},onFailure:Wt=>{B(W,"signTypedData","onError","unable_to_sign"),v(Wt)},uiOptions:p||{}},je={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Wt=>{B(W,"signMessage","onError","unknown_connect_wallet_error"),v(Wt)}};fe({signMessage:fo,connectWallet:je}),X("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,f)=>{let L=await(await Nc(d,p,f)).wait();return Rs(L)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}let f=pe(s);if(!f){p(new Error("Must have a Privy wallet before exporting"));return}j(!0);let v={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p},L=await Ae();if(!L||!D){p(new Error("Must have valid access token to enroll in MFA"));return}if(!D){p(new Error("Must have a Privy wallet before exporting"));return}try{try{await D.connect({accessToken:L,address:f.address}),await D.verifyMfa({accessToken:L})}catch(le){if(fr(le))await de.recoverEmbeddedWallet();else throw le}}catch(le){p(le);return}let $={appId:e.appId,origin:t.apiUrl,onSuccess:d,onFailure:p};fe({keyExport:$,connectWallet:v}),X("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:Dc,async init(d){let p;switch(d){case"sms":p=new Ns("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":jt.current?.resolve({mfaMethod:d,mfaCode:p}),await new Promise((f,v)=>{Tr.current={resolve:f,reject:v}});break;default:throw jt.current?.reject(new w("Unsupported MFA method")),new w(`Unsupported MFA method: ${d}`)}},cancel(){jt.current?.reject(new w("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Ae();if(!p||!D)throw new Error("Must have valid access token to enroll in MFA");await D.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,f)=>{if(!d){de.closePrivyModal(),p();return}k.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."),fe({mfaEnrollmentFlow:{mfaMethods:k.mfa.methods,onSuccess:p,onFailure:f}}),X("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Ae();if(!d||!D)throw new Error("Must have valid access token to enroll in MFA");let p=await D.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await Ae();if(!p||!D)throw new Error("Must have valid access token to enroll in MFA");await D.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let f=await t.getAuthenticatedUser();c(f)},async submitEnrollmentWithTotp(d){let p=await Ae();if(!p||!D)throw new Error("Must have valid access token to enroll in MFA");await D.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let f=await t.getAuthenticatedUser();c(f)},async unenroll(d){let p=await Ae();if(!p||!D)throw new Error("Must have valid access token to remove MFA");await D.unenrollMfa({method:d,accessToken:p});let f=await t.getAuthenticatedUser();c(f)},loginWithCode(d){return de.loginWithCode(d)},initLoginWithEmail(d){return de.initLoginWithEmail(d)},initLoginWithSms(d){return de.initLoginWithSms(d)},fundWallet(d,p){return de.fundWallet(d,p)},isModalOpen:o};fy=_r.signMessage,hy=_r.signTypedData,yy=async(...d)=>{let p=await Nc(...d);return k.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let Uc=!!e.config?.headless,de=(()=>({headless:Uc,isNewUserThisSession:E,isLinking:u,linkingHint:H,pendingTransaction:null,walletConnectionStatus:x,mipdStore:N,connectors:t.connectors?.walletConnectors??[],rpcConfig:k.rpcConfig,chains:k.chains,showFiatPrices:k.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>k.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(D)return D;let p=new Promise(L=>{mo(()=>$=>L($))}),f=new Promise(L=>setTimeout(()=>L(null),d)),v=await Promise.race([p,f]);return mo(null),v},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0})=>{let p=n&&a&&s;d.shouldCallAuthOnSuccess&&p?(B(W,"login","onComplete",s,E,!1,$e.current??null),e.onSuccess?.(s,E)):R&&B(W,"login","onError","exited_auth_flow"),q(null),I(!1),m(!1),T(!1),r(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent("modal_closed")},openPrivyModal:X,connectWallet:In,initLoginWithWallet:async(d,p)=>{$e.current="siwe",So(d,p)},loginWithWallet:async()=>{if(!n)throw new Ar;if(!(t.authFlow instanceof ir))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(f){throw B(W,"login","onError",f.privyErrorCode||"generic_connect_wallet_error"),f}c(d||s||null),T(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new Mn(d);t.startAuthFlow(p);try{$e.current="farcaster",await p.initializeFarcasterConnect()}catch(f){throw B(W,"login","onError",f.privyErrorCode||"unknown_auth_error"),f}},loginWithFarcaster:async()=>{if(!n)throw new Ar;if(!(t.authFlow instanceof Mn))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(f){throw B(W,"login","onError",f.privyErrorCode||"generic_connect_wallet_error"),f}c(d||null),T(p||!1),l(!0)},initLoginWithOAuth:async(d,p)=>{if(Rd()){if(d==="google"&&Lc(window.navigator.userAgent)){gt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{gt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}let f=new Ro(d);p&&f.addCaptchaToken(p),t.startAuthFlow(f);let v=await t.authFlow.getAuthorizationUrl();v&&v.url&&window.location.assign(v.url)},loginWithOAuth:async d=>{if(!(t.authFlow instanceof Ro))throw new w("Must initialize OAuth flow before calling loginWithOAuth");let p=Ot.get(Rr),f=t.authFlow.meta.stateCode;if(p!==f)throw t.createAnalyticsEvent("possible_phishing_attempt",{provider:d,storedStateCode:p??"",returnedStateCode:f??""}),new w("Unexpected auth flow. This may be a phishing attempt.");let v,L;if(a)v=await t.link();else try{({user:v,isNewUser:L}=await t.authenticate()),$e.current=d}catch($){throw B(W,"login","onError",$.privyErrorCode||"unknown_auth_error"),$}c(v),T(L||!1),l(!0)},initLoginWithEmail:async(d,p)=>{let f=new ko(d,p);t.startAuthFlow(f);try{$e.current="email",await f.sendCodeEmail()}catch(v){throw B(W,"login","onError",v.privyErrorCode||"unknown_auth_error"),v}},initUpdateEmail:async(d,p,f)=>{let v=new Oi(d,p,f);t.startAuthFlow(v),await v.sendCodeEmail()},initLoginWithSms:async(d,p)=>{let f=new ar(d,p);t.startAuthFlow(f);try{$e.current="sms",await f.sendSmsCode()}catch(v){throw B(W,"login","onError",v.privyErrorCode||"unknown_auth_error"),v}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(!n)throw new Ar;if(t.authFlow instanceof ko)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof ar)t.authFlow.meta.smsCode=d.trim();else throw new w("Must initialize a passwordless code flow first");let p,f;a?p=await t.link():{user:p,isNewUser:f}=await t.authenticate(),c(p||s||null),T(f||!1),l(!0)},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:D,createAnalyticsEvent:(d,p,f)=>t.createAnalyticsEvent(d,p,f),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedWallet:async()=>new Promise(async(d,p)=>{let f=s?.linkedAccounts.find(L=>L.type==="wallet"&&L.walletClientType==="privy"),v=await Ae();if(!v||!D||!f){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}j(!0);try{await D.connect({accessToken:v,address:f.address}),d(!0)}catch(L){fr(L)&&f.recoveryMethod==="privy"?(t.createAnalyticsEvent("embedded_wallet_pinless_recovery_started",{walletAddress:f.address}),(await D.recover({address:f.address,accessToken:v})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent("embedded_wallet_recovery_completed",{walletAddress:f.address}),d(!0)):fr(L)?(fe({recoverWallet:{privyWallet:f,onFailure:p,onSuccess:()=>d(!0)}}),X("EMBEDDED_WALLET_RECOVERY_SCREEN")):p(L)}}),getFiatOnRampConfig:tr,setReadyToTrue:()=>{i(!0),rt?.()},updateWallets:()=>or(),fundWallet:async(d,p)=>{let{signedUrl:f,externalTransactionId:v}=await tr(d,p);fe({fiatOnRampPrompt:{signedUrl:f},fiatOnRampStatus:{externalTransactionId:v}}),X("FIAT_ON_RAMP_PROMPT_SCREEN")}}))();gy=de.recoverEmbeddedWallet;let by=l4(()=>({wallets:h,ready:Mt}),[h,Mt]);return uo(se.Provider,{value:_r,children:uo(al.Provider,{value:W,children:uo(xc.Provider,{value:by,children:my(Fp,{...k,children:[e.children,my(il.Provider,{value:de,children:[!Uc&&k.captchaEnabled&&n&&!a&&uo(nl,{delayedExecution:!1}),uo(sy,{theme:{...k.appearance.palette||{}}}),uo(Pp,{data:ze,setModalData:fe,setInitialScreen:_,initialScreen:b,authenticated:a,open:o,children:uo(py,{open:o})}),re&&oe?uo(uy,{appId:e.appId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:jt,mfaSubmitPromise:Tr,onLoad:z,onLoadFailed:()=>null}):null]})]})})})})};import{useContext as m4}from"react";function f4(e){let{login:t}=m4(se);return be("login",e),{login:t}}import{useContext as h4}from"react";function y4(e){let{logout:t}=h4(se);return be("logout",e),{logout:t}}import{useCallback as vy}from"react";var g4=()=>{let e=ce(),{initLoginWithEmail:t,loginWithCode:o}=G(),r=vy(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return e.status==="disabled",t(i)},[t]),n=vy(async({code:i})=>{if(e.enabled&&e.status==="error")throw new go(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};import{useCallback as wy}from"react";var v4=()=>{let e=ce(),{initLoginWithSms:t,loginWithCode:o}=G(),r=wy(async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");return e.status==="disabled",t(i)},[t]),n=wy(async({code:i})=>{if(e.enabled&&e.status!=="success")throw new go(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};import{useContext as w4}from"react";function C4(e){let{connectWallet:t}=w4(se);return be("connectWallet",e),{connectWallet:t}}import{useContext as b4}from"react";function E4(e){let{createWallet:t}=b4(se);return be("createWallet",e),{createWallet:t}}var P4=()=>{let{fundWallet:e}=G();return{fundWallet:e}};import{useContext as T4}from"react";function x4(e){let{sendTransaction:t}=T4(se);return be("sendTransaction",e),{sendTransaction:t}}import{useContext as S4}from"react";function _4(e){let{setWalletPassword:t}=S4(se);return be("setWalletPassword",e),{setWalletPassword:t}}import{useContext as A4}from"react";function k4(e){let{signMessage:t}=A4(se);return be("signMessage",e),{signMessage:t}}import{useContext as R4}from"react";function I4(e){let{signTypedData:t}=R4(se);return be("signTypedData",e),{signTypedData:t}}import{useContext as M4}from"react";var W4=()=>{let{isModalOpen:e}=M4(se);return{isOpen:e}};import{useContext as L4}from"react";function O4(e){let{getAccessToken:t}=L4(se);return be("accessToken",e),{getAccessToken:t}}function N4(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}export{Yt as AsExternalProvider,nl as Captcha,Bn as ConnectorManager,Hn as PrivyClient,p4 as PrivyProvider,ue as PrivyProxyProvider,Un as SUPPORTED_CHAINS,Hs as VERSION,st as WalletConnector,N4 as addRpcUrlOverrideToChain,Wl as errorIndicatesMaxMfaRetries,rn as errorIndicatesMfaTimeout,nn as errorIndicatesMfaVerificationFailed,Ae as getAccessToken,C4 as useConnectWallet,E4 as useCreateWallet,P4 as useFundWallet,f4 as useLogin,g4 as useLoginWithEmail,v4 as useLoginWithSms,y4 as useLogout,wn as useMfa,yi as useMfaEnrollment,W4 as useModalStatus,G as usePrivy,sl as useRegisterMfaListener,x4 as useSendTransaction,_4 as useSetWalletPassword,k4 as useSignMessage,I4 as useSignTypedData,O4 as useToken,Pi as useWallets};
|
|
2707
|
+
`;import{jsx as Oe,jsxs as dy}from"react/jsx-runtime";var jb={["LANDING"]:Sf,["CONNECT_OR_CREATE"]:Tf,["AWAITING_PASSWORDLESS_CODE"]:uu,["AWAITING_CONNECTION"]:Iu,["AWAITING_CONNECT_ONLY_CONNECTION"]:Ou,["AWAITING_FARCASTER_CONNECTION"]:Bm,["PHANTOM_INTERSTITIAL_SCREEN"]:Vh,["LOGIN_FAILED_SCREEN"]:Wf,["AWAITING_OAUTH_SCREEN"]:Fh,["ALLOWLIST_REJECTION_SCREEN"]:ou,["INSTALL_PHANTOM_SCREEN"]:ef,["LINK_EMAIL_SCREEN"]:_f,["LINK_PHONE_SCREEN"]:Af,["LINK_WALLET_SCREEN"]:kf,["UPDATE_EMAIL_SCREEN"]:iy,["CONNECT_ONLY_LANDING_SCREEN"]:Au,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:xu,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:Cm,["EMBEDDED_WALLET_CREATED_SCREEN"]:Gu,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:Bu,["EMBEDDED_WALLET_RECOVERY_SCREEN"]:Pm,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:qu,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:Qh,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:Jh,["FIAT_ON_RAMP_PROMPT_SCREEN"]:qm,["FIAT_ON_RAMP_STATUS_SCREEN"]:Km,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:Em,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:bm,["MFA_ENROLLMENT_FLOW_SCREEN"]:jf,["CAPTCHA_SCREEN"]:yu,["ERROR_SCREEN"]:Tm,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:Ym,["AFFIRMATIVE_CONSENT_SCREEN"]:eu},Kb=["LANDING","AWAITING_CONNECTION"],Yb=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:o,isModalOpen:r}=B(),{headless:n}=W(),{ready:i,currentScreen:a}=A(),{status:l,execute:s,reset:c,enabled:u}=pe(),m=zb(null),v=Hp(m),h=r&&a&&Kb.includes(a)&&!n&&l==="ready";if(cy(()=>{h&&s()},[h]),cy(()=>{!r&&u&&c()},[r,u]),(!o||!i)&&a!=="AWAITING_OAUTH_SCREEN")return dy(yn,{children:[Oe(k,{}),Oe(Q,{}),Oe(Nf,{children:Oe(Tt,{})}),Oe(X,{}),Oe(te,{})]});if(!a&&e)return Oe(yn,{style:{height:v},children:Oe("div",{ref:m,children:Oe(Rc,{open:e,onClose:t})})});if(!a)return null;let w=jb[a];return Oe(yn,{style:{height:v},children:dy("div",{ref:m,children:[Oe(bo,{if:!!e,children:Oe(w,{})}),Oe(bo,{if:!e,children:Oe(Rc,{open:e,onClose:t})})]})})},Jb=()=>{let{closePrivyModal:e}=W(),{onUserCloseViaDialogOrKeybindRef:t}=A();return{gracefulClosePrivyModal:Vb(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},py=({open:e})=>{let{app:t}=A(),{gracefulClosePrivyModal:o}=Jb(),[r,n]=$b(!1);ll({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=Oe(ly,{children:Oe(Yb,{isMfaVerifying:r,onMfaVerificationComplete:()=>n(!1)})}),a=e||r,l=t?.render.inDialog?Oe(Of,{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 qb.createPortal(l,s)}return l};import{useRef as Zb}from"react";var Ns=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 Pr(e,t,o,r,n,i=!1){let a=i,l=async u=>{if(a&&t&&t.length>0){u===(i?0:1)?n("configureMfa","onMfaRequired",t):r.current?.reject(new Pe("missing_or_invalid_mfa","MFA verification failed, retry."));let m=await new Promise((v,h)=>{o.current={resolve:v,reject:h};let w=1e3*60*5;setTimeout(()=>{let b=new Pe("mfa_timeout","Timed out waiting for MFA code");r.current?.reject(b),h(b)},w)});return await e(m)}return await e()},s=4,c=null;for(let u=0;u<s;u++)try{c=await l(u),r.current?.resolve(void 0);break}catch(m){if(m.type==="missing_or_invalid_mfa")a=!0;else throw r.current?.resolve(void 0),m}if(c===null){let u=new Pe("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw r.current?.reject(u),u}return c}import{jsx as r4}from"react/jsx-runtime";var Qb=function(e){return()=>`id-${e++}`}(0);function Xb(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function uo(e){return e.error!==void 0}var Yt=new Ns,Lc=new Map,e4=(e,t)=>typeof t=="bigint"?t.toString():t,t4=(e,t)=>`${e}${JSON.stringify(t,e4)}`;function mo(e,t,o,r){let n=o.contentWindow;if(!n)throw new Error("iframe not initialized");let i=t4(e,t);if(e==="privy:wallet:create"){let l=Lc.get(i);if(l)return l}let a=new Promise((l,s)=>{let c=Qb();Yt.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},r)}).finally(()=>{Lc.delete(i)});return Lc.set(i,a),a}function o4(e){switch(e.event){case"privy:iframe:ready":let t=Yt.dequeue(e.event,e.id);return uo(e)?t.reject(new Pe(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let o=Yt.dequeue(e.event,e.id);return uo(e)?o.reject(new Pe(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let r=Yt.dequeue(e.event,e.id);return uo(e)?r.reject(new Pe(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:recover":let n=Yt.dequeue(e.event,e.id);return uo(e)?n.reject(new Pe(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let i=Yt.dequeue(e.event,e.id);return uo(e)?i.reject(new Pe(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:set-recovery-password":let a=Yt.dequeue(e.event,e.id);return uo(e)?a.reject(new Pe(e.error.type,e.error.message)):a.resolve(e.data);case"privy:mfa:verify":let l=Yt.dequeue(e.event,e.id);return uo(e)?l.reject(new Pe(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let s=Yt.dequeue(e.event,e.id);return uo(e)?s.reject(new Pe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:submit-enrollment":{let s=Yt.dequeue(e.event,e.id);return uo(e)?s.reject(new Pe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:unenroll":{let s=Yt.dequeue(e.event,e.id);return uo(e)?s.reject(new Pe(e.error.type,e.error.message)):s.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function uy(e){let t=Zb(null),o=zp();return r4("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>{let n=t.current;if(!n)return;function i(u){u&&u.origin===e.origin&&Xb(u.data)&&o4(u.data)}let a={create(u){return mo("privy:wallet:create",u,n,e.origin)},connect(u){return mo("privy:wallet:connect",u,n,e.origin)},recover(u){return Pr(m=>mo("privy:wallet:recover",{...u,...m},n,e.origin),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)},rpc(u){return Pr(m=>mo("privy:wallet:rpc",{...u,...m},n,e.origin),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},setRecoveryPassword(u){return Pr(m=>mo("privy:wallet:set-recovery-password",{...u,...m},n,e.origin),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(u){return Pr(m=>mo("privy:mfa:verify",{...u,...m},n,e.origin),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(u){return Pr(m=>mo("privy:mfa:init-enrollment",{...u,...m},n,e.origin),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(u){return mo("privy:mfa:submit-enrollment",u,n,e.origin)},unenrollMfa(u){return Pr(m=>mo("privy:mfa:unenroll",{...u,...m},n,e.origin),e.mfaMethods,e.mfaPromise,e.mfaSubmitPromise,o,!0)}};window.addEventListener("message",i);let l=()=>e.onLoad(a),s=(...u)=>{console.warn("Privy iframe failed to load: ",...u),e.onLoadFailed()},c=new AbortController;return Dd(()=>mo("privy:iframe:ready",{},n,e.origin),{abortSignal:c.signal}).then(l,s),()=>{window.removeEventListener("message",i),c.abort()}},src:$i(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId})})}function Oc(e){let t=e.toLowerCase();return["fbav","fban","instagram","snapchat"].some(r=>t.includes(r))}var Ds=class{constructor(t,o){this.meta={action:t,phoneNumber:o}}async init(){if(!this.meta.action)throw new _("action required");if(!this.api)throw new _("Auth flow has no API instance");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new _("phone number must be set when initialzing authentication.");try{await this.api.post(pd,{action:this.meta.action,phoneNumber:this.meta.phoneNumber})}catch(t){throw se(t)}}async authenticate(){if(!this.meta.action)throw new _("action required");if(!this.api)throw new _("Mfa flow has no API instance");if(!this.meta.smsCode)throw new _("sms code must be set prior to calling authenticate.");if(this.meta.action==="enroll"&&!this.meta.phoneNumber)throw new _("phone number must be set prior to calling authenticate.");try{let t=await this.api.post(ud,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return ut(t)}catch(t){throw se(t)}}};import{jsx as fo,jsxs as my}from"react/jsx-runtime";var kn;function l4(e){return typeof e=="string"&&e.length===25}function Ae(){if(!kn){let e=le.get(nr);return Promise.resolve(e||null)}return kn.getAccessToken()}var fy,zd=(e,t)=>fy(e,t),hy,$d=(e,t)=>hy(e,t),yy,qd=(e,t)=>yy(e,t),gy,jd=()=>gy(),c4=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;le.put(On,t);let o=new URL(window.location.href);o.searchParams.delete("privy_token"),window.history.pushState({},"",o)},d4=({config:e,...t})=>{if(!l4(t.appId))throw new _("Cannot initialize the Privy provider with an invalid Privy app ID");kn||(kn=new Vn({appId:t.appId,apiUrl:t.apiUrl||Ui}));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."),fo(Cp,{client:kn,clientConfig:o,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:fo(p4,{...t,config:o,client:kn})})},p4=e=>{let t=e.client,[o,r]=Ne(!1),[n,i]=Ne(!1),[a,l]=Ne(!1),[s,c]=Ne(null),[u,m]=Ne([]),v=An(u),[h,w]=Ne(!1),[b,x]=Ne(null),[C,T]=Ne({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:E}),[L,I]=Ne(null),[S,U]=Ne(null),[P,F]=Ne(null),R=ga(),q=bp(),[ce,H]=Ne(!0),[V,j]=Ne({}),[ne,oe]=Ne(null),[$e,wt]=Ne(null),[it,qe]=Ne(!1),[ie,ho]=Ne(!1),ct=An(null),or=An(null),M=An(Gp);t.onStoreToken=d=>{d&&N(M,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{N(M,"accessToken","onAccessTokenRemoved")};let Y=An(null),J=An(null),Rn=a4(d=>{let p=t.connectors?.walletsReady||!1;return a&&s?.linkedAccounts?.some(y=>y.type==="wallet"&&y.walletClientType==="privy")?p&&d?.some(y=>y?.walletClientType==="privy"):p},[a,s?.linkedAccounts,t?.connectors?.walletsReady]),$=d=>{x(d),setTimeout(()=>{r(!0)},15),t.createAnalyticsEvent("modal_open",{initialScreen:d})},_e=d=>{R.embeddedWallets.createOnLogin!=="off"&&H(!0),$(d)};Ao(()=>{if(!P||!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(P,p,R.defaultChain)}},[P,s]),Ao(()=>{P&&$e?.(P)},[P]),Ao(()=>{(async()=>{if(!R.customAuth?.enabled)return;H(!0);let{getCustomAccessToken:p,isLoading:f}=R.customAuth;if(!(!n||f))try{let y=await p();if(!y){await Sr.logout();return}if(a)return;t.startAuthFlow(new Ar(y));let{user:O,isNewUser:z}=await t.authenticate();O||await Sr.logout(),c(O||null),w(z||!1),l(!0),ho(!0)}catch(y){console.warn(y),a&&await Sr.logout()}})()},[R.customAuth?.enabled,R.customAuth?.getCustomAccessToken,R.customAuth?.isLoading,n,a]),Ao(()=>{ie&&P&&s&&bt(s,e.config?.embeddedWallets?.createOnLogin)&&(ho(!1),Wn(s,Ir).catch(console.error))},[ie&&P&&s]),Ao(()=>{async function d(){let p=In();c4();let f=i4();I(f),t.initializeConnectorManager(R.walletConnectCloudProjectId,R.rpcConfig,R.chains,R.defaultChain,f,R.appearance.walletList,R.shouldEnforceDefaultChainOnConnect),t.connectors?.initialize().then(()=>{Ai()});let y=await t.getAuthenticatedUser();e.config?.customAuth?.enabled||(l(!!y),y&&N(M,"login","onComplete",y,!1,!0,null),c(y)),p||ue.setReadyToTrue(),p&&(y?J.current="link":J.current="login")}!n&&q&&d()},[t,ne,n,q]);let In=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_oauth_code"),f=d.get("privy_oauth_state"),y=d.get("privy_oauth_provider");return p&&f&&y?(t.startAuthFlow(new Io(y,p,f)),_e("AWAITING_OAUTH_SCREEN"),!0):!1},De=async(d,p,f,y)=>{let O=await t.connectors?.createWalletConnector(d,p)||null;rr(O,p,f,y)};async function rr(d,p,f,y){if(!d)return T({status:"disconnected",connectedWallet:null,connectError:new Z("Unable to connect to wallet."),connector:null,connectRetry:E}),y?.(null,f);d instanceof eo&&p&&await d.resetConnection(p),T({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>rr(d,p,f,y)});try{let O=await d.connect({showPrompt:!0});if(R.shouldEnforceDefaultChainOnConnect&&!R.chains.find(z=>z.id===Number(O?.chainId))&&!(O?.connectorType==="wallet_connect_v2"&&O?.walletClientType==="metamask")){T(z=>({...z,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:E}));try{await O?.switchChain(R.defaultChain.id),O&&(O.chainId=Mr(lr(R.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${R.defaultChain.id}`)}}return T(z=>({...z,status:"connected",connectedWallet:O,connectError:null,connectRetry:E})),O&&!J.current&&N(M,"connectWallet","onSuccess",O),y?.(O,f)}catch(O){return O instanceof Ue?(console.warn(O.cause?O.cause:O.message),J.current||N(M,"connectWallet","onError",O.privyErrorCode||"generic_connect_wallet_error")):(console.warn(O),J.current||N(M,"connectWallet","onError","unknown_connect_wallet_error")),T(z=>({...z,status:"disconnected",connectedWallet:null,connectError:O})),y?.(null,f)}}let yo=async(d,p)=>{if(d===null)return;let f=new ar(d,p);t.startAuthFlow(f)},Ai=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),f=d.get("privy_wallet_client");if(!p||!f)return;if(f==="phantom"&&!Mo()&&_e("LOGIN_FAILED_SCREEN"),!t.connectors)throw new _("Connector not initialized");$("AWAITING_CONNECTION");let y=new URL(window.location.href);y.searchParams.delete("privy_connector"),y.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",y),De(p,f,void 0,yo)};Ao(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let je=()=>{if(!a)throw N(M,"linkAccount","onError","must_be_authenticated"),new _("User must be authenticated before linking an account.")},Tr=()=>{je(),Y.current="siwe",J.current="link",$("LINK_WALLET_SCREEN")},xr=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},dt=async d=>{if(!t.connectors)throw new _("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(T(f=>({...f,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:E})),R.captchaEnabled&&!a){let f={callback:y=>yo(d,y),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};j({captchaModalData:f}),_e("CAPTCHA_SCREEN")}else await yo(d),_e("AWAITING_CONNECTION")},xe=async(d,p)=>{if(!R.fiatOnRamp.enabled)throw new _("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:f,externalTransactionId:y}=await zm(t,d,p?.config??{},R.appearance.palette,R.fiatOnRamp.useSandbox);return{signedUrl:f,externalTransactionId:y}}else throw new _("Unsupported fund provider. Currently supported option is `moonpay`.")},Lt=()=>{m(d=>{let p=t.connectors?.wallets.map(f=>({...f,linked:xr(f),loginOrLink:async()=>{if(!await f.isConnected())throw new _("Wallet is not connected");if(f.connectorType==="embedded"&&f.walletClientType==="privy")throw new _("Cannot link or login with embedded wallet");dt(f)},fund:async y=>{let{signedUrl:O,externalTransactionId:z}=await xe(f.address,y);j({fiatOnRampPrompt:{signedUrl:O},fiatOnRampStatus:{externalTransactionId:z}}),$("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!a)throw new _("User is not authenticated.");if(f.connectorType==="embedded"&&f.walletClientType==="privy")throw new _("Cannot unlink an embedded wallet");let y=await t.unlinkWallet(f.address);c(y)}}))||[];return qe(Rn(p)),Yi(d,p)?d:p})};Ao(()=>{Lt()},[s?.linkedAccounts,a,n]),Ao(()=>{if(n){if(!t.connectors)throw new _("Connector not initialized");Lt(),t.connectors.on("walletsUpdated",Lt)}},[n]);let Mn=()=>{$(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};Ao(()=>{if(!u[0])return;let d=u[0],p=v.current.find(y=>y.address===d.address),f;if(d.walletClientType==="privy"?f=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===d.address&&y.walletClientType==="privy"):f=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===d.address&&y.walletClientType!=="privy"),!p&&f){let y=Object.assign({},s);y.wallet=f&&{address:f.address,chainType:f.chainType,chainId:f.chainId,walletClient:f.walletClient,walletClientType:f.walletClientType,connectorType:f.connectorType},c(y)}v.current=u},[u]);let Wn=async(d,p)=>{if(me(d))throw N(M,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[y,O]=await Promise.all([ue.initializeWalletProxy(p),Ae()]);if(!y&&e.config?.customAuth?.enabled)throw N(M,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!y||!O||e.config?.embeddedWallets?.requireUserPasswordOnCreate)return new Promise((z,de)=>{H(!0),j({createWallet:{onSuccess:at=>{N(M,"createWallet","onSuccess",at),z(at)},onFailure:at=>{N(M,"createWallet","onError","unknown_embedded_wallet_error"),de(at)},callAuthOnSuccessOnClose:!1}}),$("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await y.create({accessToken:O});let z=await ue.refreshUser(),de=me(z);if(!de)throw N(M,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return N(M,"createWallet","onSuccess",de),de}},ko=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")},ki=(d,p,f)=>new Promise(async(y,O)=>{if(!a||!s){N(M,"sendTransaction","onError","must_be_authenticated"),O(new Error("User must be authenticated before signing with a Privy wallet"));return}let z=me(s);if(!z){N(M,"sendTransaction","onError","embedded_wallet_not_found"),O(new Error("Must have a Privy wallet before signing"));return}H(!0);let de=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,Ke=d.chainId?Number(d.chainId):de.chainId;ko(Ke);let at=Object.assign({},d,{chainId:Ke}),go=async()=>{let Ye=await Ae();if(!Ye||!P){N(M,"sendTransaction","onError","embedded_wallet_not_found"),O(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await ue.recoverEmbeddedWallet()){N(M,"sendTransaction","onError","unknown_connect_wallet_error"),O(new Error("Unable to connect to wallet"));return}let Dt=new n4(Ft(at.chainId,R.chains,R.rpcConfig)),Fs=await Tn(z.address,at,Dt);if(R.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:by}=await Pn(Fs,Dt),{hasSufficientFunds:Ey}=await Rs(z.address,Fs,by,Dt);if(!Ey)throw new ve(new Et("Wallet has insufficient funds for this transaction.",Fe.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let Fc=await ks(Ye,z.address,P,Fs,Dt);N(M,"sendTransaction","onSuccess",Fc),y(Fc)}catch(Nt){N(M,"sendTransaction","onError","transaction_failure"),O(Nt)}};if(R.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),go();else{let Ye={transactionRequest:at,onSuccess:Dt=>{N(M,"sendTransaction","onSuccess",Dt),y(Dt)},onFailure:Dt=>{N(M,"sendTransaction","onError","transaction_failure"),O(Dt)},uiOptions:p||{},fundWalletConfig:f},Nt={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:Dt=>{N(M,"sendTransaction","onError","unknown_connect_wallet_error"),O(Dt)}};j({connectWallet:Nt,sendTransaction:Ye}),$("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function Dc(){return new Promise(async(d,p)=>{let f=await Ae();if(!f||!P)throw new Error("Must have valid access token to enroll in MFA");try{await P.verifyMfa({accessToken:f}),d()}catch(y){p(y)}})}let Ot=d=>{if(s?.[d])throw N(M,"linkAccount","onError","cannot_link_more_of_type"),new _(`User already has an account of type ${d} linked.`)},Sr={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:Mn,linkWallet:Tr,linkEmail:()=>{je(),Ot("email"),Y.current="email",J.current="link",$("LINK_EMAIL_SCREEN")},linkPhone:()=>{je(),Ot("phone"),Y.current="sms",J.current="link",$("LINK_PHONE_SCREEN")},linkGoogle:async()=>{je(),Ot("google"),J.current="link",await ue.initLoginWithOAuth("google")},linkTwitter:async()=>{je(),Ot("twitter"),J.current="link",await ue.initLoginWithOAuth("twitter")},linkDiscord:async()=>{je(),Ot("discord"),J.current="link",await ue.initLoginWithOAuth("discord")},linkGithub:async()=>{je(),Ot("github"),J.current="link",await ue.initLoginWithOAuth("github")},linkSpotify:async()=>{je(),Ot("spotify"),J.current="link",await ue.initLoginWithOAuth("spotify")},linkTiktok:async()=>{je(),Ot("tiktok"),J.current="link",await ue.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{je(),Ot("linkedin"),J.current="link",await ue.initLoginWithOAuth("linkedin")},linkApple:async()=>{je(),Ot("apple"),J.current="link",await ue.initLoginWithOAuth("apple")},linkFarcaster:async()=>{je(),Ot("farcaster"),await ue.initLoginWithFarcaster(),J.current="link",Y.current="farcaster",$("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(je(),!s?.email)throw new _("User does not have an email linked to their account.");J.current="link",Y.current="email",$("UPDATE_EMAIL_SCREEN")},login:async()=>{if(n||(await new Promise(d=>{oe(()=>d)}),oe(null)),a){console.warn("Attempted to log in, but user is already logged in. Use a `link` helper instead.");return}J.current="login",_e("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{oe(()=>d)}),oe(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(u[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}_e("CONNECT_OR_CREATE")},logout:async()=>{await t.logout(),c(null),l(!1),x(null),N(M,"logout","onSuccess"),J.current=null,Y.current=null,r(!1),le.del(Nn)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new fe;let d=u.find(f=>s.wallet&&f.address===s.wallet.address),p=t.connectors?.walletConnectors.find(f=>f.wallets.find(y=>y.address===d?.address));return!d||!p?new fe:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new Nc(new Zt(new fe));let d=u.find(f=>s.wallet&&f.address===s.wallet.address),p=t.connectors?.walletConnectors.find(f=>f.wallets.find(y=>y.address===d?.address));return!d||!p?new Nc(new Zt(new fe)):new Nc(new Zt(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new Oo(new fe);let d=u.find(f=>s.wallet&&f.address===s.wallet.address),p=t.connectors?.walletConnectors.find(f=>f.wallets.find(y=>y.address===d?.address));return!d||!p?new Oo(new fe):new Oo(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=u.find(y=>Us(y.address)===Us(d)),f=s?.linkedAccounts.find(y=>y.type==="wallet"&&Us(y.address)===Us(d));if(!p||!await p.isConnected())U(d),Tr();else if(!p.linked)p.loginOrLink();else{let y=Object.assign({},s);y.wallet=f&&{address:f.address,chainType:f.chainType,chainId:f.chainId,walletClient:f.walletClient,walletClientType:f.walletClientType,connectorType:f.connectorType},c(y)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw N(M,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return Wn(s,15e3)},setWalletPassword:async()=>{if(!a||!s)throw N(M,"setWalletPassword","onError","must_be_authenticated"),new Error("User must be authenticated before adding password to Privy wallet");let d=me(s);if(!d||!P)throw N(M,"setWalletPassword","onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a password");if(d.recoveryMethod==="user-passcode")throw N(M,"setWalletPassword","onError","embedded_wallet_password_already_exists"),new Error("Cannot set password. Embedded wallet already has a password.");try{await Dc()}catch(p){throw N(M,"setWalletPassword","onError","missing_mfa_credentials"),p}return new Promise((p,f)=>{H(!0);let y={onSuccess:z=>{N(M,"setWalletPassword","onSuccess",z),p(z)},onFailure:z=>{N(M,"setWalletPassword","onError","user_exited_set_password_flow"),f(z)},callAuthOnSuccessOnClose:!1},O={onCompleteNavigateTo:"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",onFailure:z=>{N(M,"setWalletPassword","onError","unknown_connect_wallet_error"),f(z)}};j({setWalletPassword:y,connectWallet:O}),$("EMBEDDED_WALLET_CONNECTING_SCREEN")})},signMessage:(d,p)=>new Promise(async(f,y)=>{if(!a||!s){N(M,"signMessage","onError","must_be_authenticated"),y(new Error("User must be authenticated before signing with a Privy wallet"));return}let O=me(s);if(!O){N(M,"signMessage","onError","embedded_wallet_not_found"),y(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){N(M,"signMessage","onError","invalid_message"),y(new Error("Message must be a non-empty string"));return}H(!0);let z=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let de=await Ae();if(!P||!de)throw new Error("Unable to connect to wallet");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_message_started",{walletAddress:O.address});let{response:at}=await P.rpc({accessToken:de,address:O.address,request:{method:"personal_sign",params:[d,O.address]}}),go=at.data;return t.createAnalyticsEvent("embedded_wallet_sign_message_completed",{walletAddress:O.address}),go};if(R.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let de=await z();N(M,"signMessage","onSuccess",de),f(de)}catch(de){N(M,"signMessage","onError","unable_to_sign"),y(de??new ve("Unable to sign message"))}}else{let at={method:"personal_sign",data:d,confirmAndSign:z,onSuccess:Ye=>{N(M,"signMessage","onSuccess",Ye),f(Ye)},onFailure:Ye=>{N(M,"signMessage","onError","unable_to_sign"),y(Ye)},uiOptions:p||{}},go={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Ye=>{N(M,"signMessage","onError","unknown_connect_wallet_error"),y(Ye)}};j({signMessage:at,connectWallet:go}),$("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(f,y)=>{if(!a||!s){N(M,"signTypedData","onError","must_be_authenticated"),y(new Error("User must be authenticated before signing with a Privy wallet"));return}let O=me(s);if(!O){N(M,"signTypedData","onError","embedded_wallet_not_found"),y(new Error("Must have a Privy wallet before signing"));return}H(!0);let z=qi(d),de=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Ke=await Ae();if(!P||!Ke)throw new Error("Unable to connect to wallet");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent("embedded_wallet_sign_typed_data_started",{walletAddress:O.address});let{response:go}=await P.rpc({accessToken:Ke,address:O.address,request:{method:"eth_signTypedData_v4",params:[O.address,z]}}),Ye=go.data;return t.createAnalyticsEvent("embedded_wallet_sign_typed_data_completed",{walletAddress:O.address}),Ye};if(R.embeddedWallets.noPromptOnSignature||(R.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Ke=await de();N(M,"signTypedData","onSuccess",Ke),f(Ke)}catch(Ke){N(M,"signTypedData","onError","unable_to_sign"),y(Ke??new ve("Unable to sign message"))}}else{let go={method:"eth_signTypedData_v4",data:z,confirmAndSign:de,onSuccess:Nt=>{N(M,"signTypedData","onSuccess",Nt),f(Nt)},onFailure:Nt=>{N(M,"signTypedData","onError","unable_to_sign"),y(Nt)},uiOptions:p||{}},Ye={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Nt=>{N(M,"signMessage","onError","unknown_connect_wallet_error"),y(Nt)}};j({signMessage:go,connectWallet:Ye}),$("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,f)=>{let O=await(await ki(d,p,f)).wait();return Is(O)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}let f=me(s);if(!f){p(new Error("Must have a Privy wallet before exporting"));return}H(!0);let y={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p},O=await Ae();if(!O||!P){p(new Error("Must have valid access token to enroll in MFA"));return}if(!P){p(new Error("Must have a Privy wallet before exporting"));return}try{try{await P.connect({accessToken:O,address:f.address}),await P.verifyMfa({accessToken:O})}catch(de){if(hr(de))await ue.recoverEmbeddedWallet();else throw de}}catch(de){p(de);return}let z={appId:e.appId,origin:t.apiUrl,onSuccess:d,onFailure:p};j({keyExport:z,connectWallet:y}),$("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:Dc,async init(d){let p;switch(d){case"sms":p=new Ds("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":ct.current?.resolve({mfaMethod:d,mfaCode:p}),await new Promise((f,y)=>{or.current={resolve:f,reject:y}});break;default:throw ct.current?.reject(new _("Unsupported MFA method")),new _(`Unsupported MFA method: ${d}`)}},cancel(){ct.current?.reject(new _("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Ae();if(!p||!P)throw new Error("Must have valid access token to enroll in MFA");await P.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,f)=>{if(!d){ue.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."),j({mfaEnrollmentFlow:{mfaMethods:R.mfa.methods,onSuccess:p,onFailure:f}}),$("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Ae();if(!d||!P)throw new Error("Must have valid access token to enroll in MFA");let p=await P.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await Ae();if(!p||!P)throw new Error("Must have valid access token to enroll in MFA");await P.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let f=await t.getAuthenticatedUser();c(f)},async submitEnrollmentWithTotp(d){let p=await Ae();if(!p||!P)throw new Error("Must have valid access token to enroll in MFA");await P.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let f=await t.getAuthenticatedUser();c(f)},async unenroll(d){let p=await Ae();if(!p||!P)throw new Error("Must have valid access token to remove MFA");await P.unenrollMfa({method:d,accessToken:p});let f=await t.getAuthenticatedUser();c(f)},loginWithCode(d){return ue.loginWithCode(d)},initLoginWithEmail(d){return ue.initLoginWithEmail(d)},initLoginWithSms(d){return ue.initLoginWithSms(d)},fundWallet(d,p){return ue.fundWallet(d,p)},isModalOpen:o};fy=Sr.signMessage,hy=Sr.signTypedData,yy=async(...d)=>{let p=await ki(...d);return R.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let Uc=!!e.config?.headless,ue=(()=>({headless:Uc,isNewUserThisSession:h,linkingHint:S,pendingTransaction:null,walletConnectionStatus:C,mipdStore:L,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(P)return P;let p=new Promise(O=>{wt(()=>z=>O(z))}),f=new Promise(O=>setTimeout(()=>O(null),d)),y=await Promise.race([p,f]);return wt(null),y},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s;J.current==="login"?d.shouldCallAuthOnSuccess&&p?(N(M,"login","onComplete",s,h,!1,Y.current??null),e.onSuccess?.(s,h)):N(M,"login","onError","exited_auth_flow"):J.current==="link"&&Y.current&&(d.isSuccess&&p?N(M,"linkAccount","onSuccess",s,Y.current):N(M,"linkAccount","onError","exited_link_flow")),U(null),J.current=null,Y.current=null,w(!1),r(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent("modal_closed")},openPrivyModal:$,connectWallet:rr,initLoginWithWallet:async(d,p)=>{Y.current="siwe",yo(d,p)},loginWithWallet:async()=>{if(!n)throw new _r;if(!(t.authFlow instanceof ar))throw new _("Must initialize SIWE flow first.");let d,p;if(a)try{d=await t.link(),Y.current="siwe"}catch(f){throw N(M,"linkAccount","onError",f.privyErrorCode||"failed_to_link_account"),f}else try{({user:d,isNewUser:p}=await t.authenticate()),Y.current="siwe"}catch(f){throw N(M,"login","onError",f.privyErrorCode||"generic_connect_wallet_error"),f}c(d||s||null),w(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new Ln(d);t.startAuthFlow(p);try{Y.current="farcaster",await p.initializeFarcasterConnect()}catch(f){throw J.current==="login"?N(M,"login","onError",f.privyErrorCode||"unknown_auth_error"):J.current==="link"&&N(M,"linkAccount","onError",f.privyErrorCode||"unknown_auth_error"),f}},loginWithFarcaster:async()=>{if(!n)throw new _r;if(!(t.authFlow instanceof Ln))throw new _("Must initialize Farcaster flow first.");let d,p;if(a)try{d=await t.link(),Y.current="farcaster"}catch(f){throw N(M,"linkAccount","onError",f.privyErrorCode||"failed_to_link_account"),f}else try{({user:d,isNewUser:p}=await t.authenticate()),Y.current="farcaster"}catch(f){throw N(M,"login","onError",f.privyErrorCode||"unknown_auth_error"),f}c(d||null),w(p||!1),l(!0)},initLoginWithOAuth:async(d,p)=>{if(Y.current=d,Rd()){if(d==="google"&&Oc(window.navigator.userAgent)){_e("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{_e("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}let f=new Io(d);p&&f.addCaptchaToken(p),t.startAuthFlow(f);let y=await t.authFlow.getAuthorizationUrl();y&&y.url&&window.location.assign(y.url)},loginWithOAuth:async d=>{if(!(t.authFlow instanceof Io))throw new _("Must initialize OAuth flow before calling loginWithOAuth");let p=Ut.get(kr),f=t.authFlow.meta.stateCode;if(p!==f)throw t.createAnalyticsEvent("possible_phishing_attempt",{provider:d,storedStateCode:p??"",returnedStateCode:f??""}),new _("Unexpected auth flow. This may be a phishing attempt.");let y,O;if(a)try{y=await t.link(),Y.current=d}catch(z){throw N(M,"linkAccount","onError",z.privyErrorCode||"failed_to_link_account"),z}else try{({user:y,isNewUser:O}=await t.authenticate()),Y.current=d}catch(z){throw J.current==="login"?N(M,"login","onError",z.privyErrorCode||"unknown_auth_error"):J.current==="link"&&N(M,"linkAccount","onError",z.privyErrorCode||"failed_to_link_account"),z}c(y),w(O||!1),l(!0)},initLoginWithEmail:async(d,p)=>{let f=new Ro(d,p);t.startAuthFlow(f);try{Y.current="email",await f.sendCodeEmail()}catch(y){throw J.current==="login"?N(M,"login","onError",y.privyErrorCode||"unknown_auth_error"):J.current==="link"&&N(M,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account"),y}},initUpdateEmail:async(d,p,f)=>{let y=new Ni(d,p,f);t.startAuthFlow(y),await y.sendCodeEmail()},initLoginWithSms:async(d,p)=>{let f=new sr(d,p);t.startAuthFlow(f);try{Y.current="sms",await f.sendSmsCode()}catch(y){throw J.current==="login"?N(M,"login","onError",y.privyErrorCode||"unknown_auth_error"):J.current==="link"&&N(M,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account"),y}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(!n)throw new _r;if(t.authFlow instanceof Ro)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof sr)t.authFlow.meta.smsCode=d.trim();else throw new _("Must initialize a passwordless code flow first");let p,f;if(a)try{p=await t.link()}catch(y){throw N(M,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account"),y}else try{({user:p,isNewUser:f}=await t.authenticate())}catch(y){throw N(M,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}c(p||s||null),w(f||!1),l(!0)},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:P,createAnalyticsEvent:(d,p,f)=>t.createAnalyticsEvent(d,p,f),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedWallet:async()=>new Promise(async(d,p)=>{let f=s?.linkedAccounts.find(O=>O.type==="wallet"&&O.walletClientType==="privy"),y=await Ae();if(!y||!P||!f){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}H(!0);try{await P.connect({accessToken:y,address:f.address}),d(!0)}catch(O){hr(O)&&f.recoveryMethod==="privy"?(t.createAnalyticsEvent("embedded_wallet_pinless_recovery_started",{walletAddress:f.address}),(await P.recover({address:f.address,accessToken:y})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent("embedded_wallet_recovery_completed",{walletAddress:f.address}),d(!0)):hr(O)?(j({recoverWallet:{privyWallet:f,onFailure:p,onSuccess:()=>d(!0)}}),$("EMBEDDED_WALLET_RECOVERY_SCREEN")):p(O)}}),getFiatOnRampConfig:xe,setReadyToTrue:()=>{i(!0),ne?.()},updateWallets:()=>Lt(),fundWallet:async(d,p)=>{let{signedUrl:f,externalTransactionId:y}=await xe(d,p);j({fiatOnRampPrompt:{signedUrl:f},fiatOnRampStatus:{externalTransactionId:y}}),$("FIAT_ON_RAMP_PROMPT_SCREEN")}}))();gy=ue.recoverEmbeddedWallet;let Cy=s4(()=>({wallets:u,ready:it}),[u,it]);return fo(ae.Provider,{value:Sr,children:fo(sl.Provider,{value:M,children:fo(Sc.Provider,{value:Cy,children:my(Fp,{...R,children:[e.children,my(al.Provider,{value:ue,children:[!Uc&&R.captchaEnabled&&n&&!a&&fo(il,{delayedExecution:!1}),fo(sy,{theme:{...R.appearance.palette||{}}}),fo(Pp,{data:V,setModalData:j,setInitialScreen:x,initialScreen:b,authenticated:a,open:o,children:fo(py,{open:o})}),ce&&q?fo(uy,{appId:e.appId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:ct,mfaSubmitPromise:or,onLoad:F,onLoadFailed:()=>null}):null]})]})})})})};import{useContext as u4}from"react";function m4(e){let{login:t}=u4(ae);return ye("login",e),{login:t}}import{useContext as f4}from"react";function h4(e){let{logout:t}=f4(ae);return ye("logout",e),{logout:t}}import{useCallback as vy}from"react";var y4=()=>{let e=pe(),{initLoginWithEmail:t,loginWithCode:o}=B(),r=vy(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return e.status==="disabled",t(i)},[t]),n=vy(async({code:i})=>{if(e.enabled&&e.status==="error")throw new Co(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};import{useCallback as wy}from"react";var g4=()=>{let e=pe(),{initLoginWithSms:t,loginWithCode:o}=B(),r=wy(async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");return e.status==="disabled",t(i)},[t]),n=wy(async({code:i})=>{if(e.enabled&&e.status!=="success")throw new Co(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:r,loginWithCode:n}};import{useContext as v4}from"react";function w4(e){let{linkEmail:t,linkPhone:o,linkWallet:r,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:m,linkFarcaster:v}=v4(ae);return ye("linkAccount",e),{linkEmail:t,linkPhone:o,linkWallet:r,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:m,linkFarcaster:v}}import{useContext as C4}from"react";function b4(e){let{connectWallet:t}=C4(ae);return ye("connectWallet",e),{connectWallet:t}}import{useContext as E4}from"react";function P4(e){let{createWallet:t}=E4(ae);return ye("createWallet",e),{createWallet:t}}var T4=()=>{let{fundWallet:e}=B();return{fundWallet:e}};import{useContext as x4}from"react";function S4(e){let{sendTransaction:t}=x4(ae);return ye("sendTransaction",e),{sendTransaction:t}}import{useContext as _4}from"react";function A4(e){let{setWalletPassword:t}=_4(ae);return ye("setWalletPassword",e),{setWalletPassword:t}}import{useContext as k4}from"react";function R4(e){let{signMessage:t}=k4(ae);return ye("signMessage",e),{signMessage:t}}import{useContext as I4}from"react";function M4(e){let{signTypedData:t}=I4(ae);return ye("signTypedData",e),{signTypedData:t}}import{useContext as W4}from"react";var L4=()=>{let{isModalOpen:e}=W4(ae);return{isOpen:e}};import{useContext as O4}from"react";function N4(e){let{getAccessToken:t}=O4(ae);return ye("accessToken",e),{getAccessToken:t}}function D4(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}export{Zt as AsExternalProvider,il as Captcha,Gn as ConnectorManager,Vn as PrivyClient,d4 as PrivyProvider,fe as PrivyProxyProvider,Bn as SUPPORTED_CHAINS,Gs as VERSION,st as WalletConnector,D4 as addRpcUrlOverrideToChain,Ll as errorIndicatesMaxMfaRetries,on as errorIndicatesMfaTimeout,rn as errorIndicatesMfaVerificationFailed,Ae as getAccessToken,b4 as useConnectWallet,P4 as useCreateWallet,T4 as useFundWallet,w4 as useLinkAccount,m4 as useLogin,y4 as useLoginWithEmail,g4 as useLoginWithSms,h4 as useLogout,vn as useMfa,vi as useMfaEnrollment,L4 as useModalStatus,B as usePrivy,ll as useRegisterMfaListener,S4 as useSendTransaction,A4 as useSetWalletPassword,R4 as useSignMessage,M4 as useSignTypedData,N4 as useToken,xi as useWallets};
|