@privy-io/react-auth 1.28.2-beta.1 → 1.28.2-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{getAddress as bn}from"@ethersproject/address";import{Web3Provider as Ui}from"@ethersproject/providers";import{useEffect as Nt,useMemo as wf,useRef as Cf,useState as ue}from"react";var x=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import{FetchError as $c}from"ofetch";var ke=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}]`:""}`}},Ut=class extends ke{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},P=class extends ke{constructor(o,r,n){super(o,r,n);this.type="client_error"}},sr=class extends P{constructor(){super("Request timed out",void 0,To.CLIENT_REQUEST_TIMEOUT)}};var F=class extends ke{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},J=e=>{if(e instanceof ke)return e;if(!(e instanceof $c))return xe(e);if(!e.response)return new Ut("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.data;return new Ut(t||"ApiError",e.response.status,o||r,e,n)},xe=e=>e instanceof ke?e:e instanceof Error?new P(e.message,e):new P(`Internal error: ${e}`),To=(a=>(a.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",a.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",a.INVALID_DATA="invalid_data",a.LINKED_TO_ANOTHER_USER="linked_to_another_user",a.ALLOWLIST_REJECTED="allowlist_rejected",a.CLIENT_REQUEST_TIMEOUT="client_request_timeout",a))(To||{});var lr=()=>"/api/v1/sessions",Fi=()=>"/api/v1/sessions/logout",Gi=()=>"/api/v1/sessions/fork",cr=()=>"/api/v1/sessions/fork/recover",Hi=()=>"/api/v1/siwe/init",zi=()=>"/api/v1/siwe/authenticate",Vi=()=>"/api/v1/siwe/link",$i=()=>"/api/v1/passwordless/init",qi=()=>"/api/v1/passwordless/authenticate",ji=()=>"/api/v1/passwordless/link",Ki=()=>"/api/v1/passwordless_sms/init",Yi=()=>"/api/v1/passwordless_sms/authenticate",Qi=()=>"/api/v1/passwordless_sms/link",Zi=()=>"/api/v1/oauth/init",Ji=()=>"/api/v1/oauth/authenticate",Xi=()=>"/api/v1/oauth/link",ea=()=>"/api/v1/siwe/unlink",ta=()=>"/api/v1/passwordless/unlink",oa=()=>"/api/v1/passwordless_sms/unlink",ra=()=>"/api/v1/oauth/unlink",na=()=>"/api/v1/analytics_events";var yt=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{let t=qi(),o=await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw J(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{let t=ji();return await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw J(t)}}async sendCodeEmail(t){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new P("Email must be set when initialzing authentication.");try{let o=$i();return await this.api.post(o,{email:this.meta.email})}catch(o){throw J(o)}}};var nt=class{constructor(t,o,r){this.meta={provider:t},this.meta.authorizationCode=o,this.meta.stateCode=r}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");try{let t=Ji(),o=await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw J(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");try{let t=Xi();return await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})}catch(t){throw J(t)}}async getAuthorizationUrl(){var t;if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.provider)throw new P("Provider must be set when initialzing OAuth authentication.");try{let o=Zi();return await this.api.post(o,{provider:this.meta.provider,redirect_to:window.location.href},{baseURL:(t=this.api)==null?void 0:t.fallbackApiUrl})}catch(o){throw J(o)}}};var gt=class{constructor(t){this.createSiweMessage=(t,o,r,n,i,a,l)=>`${r} wants you to sign in with your Ethereum account:
1
+ import{getAddress as bn}from"@ethersproject/address";import{Web3Provider as Ui}from"@ethersproject/providers";import{useEffect as Nt,useMemo as wf,useRef as Cf,useState as ue}from"react";var x=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import{FetchError as $c}from"ofetch";var ke=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}]`:""}`}},Ut=class extends ke{constructor(o,r,n,i,a){super(n,i,a);this.type=o;this.status=r}},P=class extends ke{constructor(o,r,n){super(o,r,n);this.type="client_error"}},lr=class extends P{constructor(){super("Request timed out",void 0,To.CLIENT_REQUEST_TIMEOUT)}};var F=class extends ke{constructor(o,r,n){super(o,r,n);this.type="connector_error"}},J=e=>{if(e instanceof ke)return e;if(!(e instanceof $c))return xe(e);if(!e.response)return new Ut("api_error",null,e.message,e);let{type:t,message:o,error:r,code:n}=e.data;return new Ut(t||"ApiError",e.response.status,o||r,e,n)},xe=e=>e instanceof ke?e:e instanceof Error?new P(e.message,e):new P(`Internal error: ${e}`),To=(a=>(a.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",a.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",a.INVALID_DATA="invalid_data",a.LINKED_TO_ANOTHER_USER="linked_to_another_user",a.ALLOWLIST_REJECTED="allowlist_rejected",a.CLIENT_REQUEST_TIMEOUT="client_request_timeout",a))(To||{});var cr=()=>"/api/v1/sessions",Fi=()=>"/api/v1/sessions/logout",Gi=()=>"/api/v1/sessions/fork",dr=()=>"/api/v1/sessions/fork/recover",Hi=()=>"/api/v1/siwe/init",zi=()=>"/api/v1/siwe/authenticate",Vi=()=>"/api/v1/siwe/link",$i=()=>"/api/v1/passwordless/init",qi=()=>"/api/v1/passwordless/authenticate",ji=()=>"/api/v1/passwordless/link",Ki=()=>"/api/v1/passwordless_sms/init",Yi=()=>"/api/v1/passwordless_sms/authenticate",Qi=()=>"/api/v1/passwordless_sms/link",Zi=()=>"/api/v1/oauth/init",Ji=()=>"/api/v1/oauth/authenticate",Xi=()=>"/api/v1/oauth/link",ea=()=>"/api/v1/siwe/unlink",ta=()=>"/api/v1/passwordless/unlink",oa=()=>"/api/v1/passwordless_sms/unlink",ra=()=>"/api/v1/oauth/unlink",na=()=>"/api/v1/analytics_events";var yt=class{constructor(t){this.meta={email:t}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{let t=qi(),o=await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw J(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new P("Email and email code must be set prior to calling authenticate.");try{let t=ji();return await this.api.post(t,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw J(t)}}async sendCodeEmail(t){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.email=t),!this.meta.email)throw new P("Email must be set when initialzing authentication.");try{let o=$i();return await this.api.post(o,{email:this.meta.email})}catch(o){throw J(o)}}};var nt=class{constructor(t,o,r){this.meta={provider:t},this.meta.authorizationCode=o,this.meta.stateCode=r}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");try{let t=Ji(),o=await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw J(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new P("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new P("User denied confirmation during OAuth flow");try{let t=Xi();return await this.api.post(t,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode})}catch(t){throw J(t)}}async getAuthorizationUrl(){var t;if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.provider)throw new P("Provider must be set when initialzing OAuth authentication.");try{let o=Zi();return await this.api.post(o,{provider:this.meta.provider,redirect_to:window.location.href},{baseURL:(t=this.api)==null?void 0:t.fallbackApiUrl})}catch(o){throw J(o)}}};var gt=class{constructor(t){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.wallet=t}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(zi(),{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 J(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign();return await this.api.post(Vi(),{message:t,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw J(t)}}async sign(){if(!this.api)throw new P("Auth flow has no API instance");if(this.preparedMessage||await this.buildSiweMessage(),!this.preparedMessage)throw new P("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async buildSiweMessage(){if(!this.api)throw new P("Auth flow has no API instance");let t=this.wallet.address,o=this.wallet.chainId.replace("eip155:",""),r=await this.api.post(Hi(),{address:t});return this.preparedMessage=this.prepareMessage(o,t,r.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 vt=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{let t=Yi(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw J(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{let t=Qi();return await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw J(t)}}async sendSmsCode(t){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new P("phone nNumber must be set when initialzing authentication.");try{let o=Ki();return await this.api.post(o,{phoneNumber:this.meta.phoneNumber})}catch(o){throw J(o)}}};function je(e){return new Date(e*1e3)}function qc(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:je(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:je(o.verified_at)};t.push(i);break;case"phone":let a={number:o.phoneNumber,type:o.type,verifiedAt:je(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:je(o.verified_at)};t.push(l);break;case"twitter_oauth":let s={subject:o.subject,username:o.username,name:o.name,type:o.type,verifiedAt:je(o.verified_at)};t.push(s);break;case"discord_oauth":let u={subject:o.subject,username:o.username,email:o.email,type:o.type,verifiedAt:je(o.verified_at)};t.push(u);break;case"github_oauth":let h={subject:o.subject,username:o.username,name:o.name,email:o.email,type:o.type,verifiedAt:je(o.verified_at)};t.push(h);break;case"apple_oauth":let C={subject:o.subject,email:o.email,type:o.type,verifiedAt:je(o.verified_at)};t.push(C);break;default:console.warn(`Unrecognized account type: ${r}. Please consider upgrading the Privy SDK.`)}}return t}function it(e,t){return e.sort((o,r)=>r.verifiedAt.getTime()-o.verifiedAt.getTime()),e.find(o=>o.type===t)}var $=e=>e==null?void 0:e.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClient==="privy"),jc=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Bt=(e,t)=>{var o;return t==="all-users"&&!$(e)||t==="users-without-wallets"&&!((o=jc(e))!=null&&o.length)};function Ke(e){if(!e)return null;let t=qc(e.linked_accounts),o=it(t,"wallet"),r=it(t,"email"),n=it(t,"phone"),i=it(t,"google_oauth"),a=it(t,"twitter_oauth"),l=it(t,"discord_oauth"),s=it(t,"github_oauth"),u=it(t,"apple_oauth");return{id:e.id,createdAt:je(e.created_at),linkedAccounts:t,email:r&&{address:r==null?void 0:r.address},phone:n&&{number:n==null?void 0: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},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},apple:u&&{subject:u.subject,email:u.email}}}import{getAddress as qa}from"@ethersproject/address";import Pd from"eventemitter3";var ia="1.28.2-beta.1";var Ft="4df5e2316331463a9130964bd6078dfa",aa="34357d3c125c2bcf2ce2bc3309d98715",dr="https://auth.privy.io",sa=1e4,Re=1400,la=4500,En=ia;var Gt="privy:token",xn="privy-token",pr="privy:refresh_token",Tn="privy-refresh-token",Po="privy:session_transfer_token",Pn="privy:connectors",_n="privy:connections";var Te=1;var An=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)}},Sn=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)}};function Yc(){return typeof window<"u"&&window.localStorage?new Sn:new An}var G=Yc();import{isPossiblePhoneNumber as Qc}from"libphonenumber-js/min";var ca={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 da={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Arbitrum Goerli Ether",symbol:"ETH",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 pa={id:84531,network:"base-goerli",name:"Base Goerli",nativeCurrency:{name:"Base Goerli",symbol:"ETH",decimals:18},rpcUrls:{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 ua={id:42220,name:"Celo",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 ma={id:44787,name:"Alfajores",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"A-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 ha={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 fa={id:314159,name:"Filecoin Calibration",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 ya={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 ga={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 va={id:10,name:"Optimism",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 ba={id:420,name:"Optimism Goerli",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 wa={id:137,name:"Polygon",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 Ca={id:80001,name:"Polygon 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 ur=[ca,da,ya,ga,va,ba,wa,Ca,ua,ma,ha,fa,pa];var hr=()=>{let e=window;if(!e.ethereum)return!1;if(mr(window.ethereum,!0))return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(mr(t,!0))return!0}return!1},_o=()=>{let e=window;if(!e.ethereum)return!1;if(mr(window.ethereum,!1))return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(mr(t,!1))return!0}return!1},mr=(e,t)=>e.isMetaMask?e.isMetaMask&&!t?!0:!(e.isBraveWallet&&!e._events&&!e._state||e.isApexWallet||e.isAvalanche||e.isBitKeep||e.isBlockWallet||e.isKuCoinWallet||e.isMathWallet||e.isOkxWallet||e.isOKExWallet||e.isOneInchIOSWallet||e.isOneInchAndroidWallet||e.isOpera||e.isPhantom||e.isPortal||e.isRabby||e.isTokenPocket||e.isTokenary||e.isZerion):!1,Pe=()=>{var e,t;if("phantom"in window){let o=window;if((t=(e=o==null?void 0:o.phantom)==null?void 0:e.ethereum)!=null&&t.isPhantom)return!0}return!1},at=()=>{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.isCoinbaseWallet)return!0}return!1};var Ea=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,}))$/),xa=e=>Qc(String(e),"US"),Ta=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},Ht=(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}`},Zc=e=>new Promise(t=>setTimeout(t,e)),Pa=(e,t={})=>{let o=t.delayMs||40,r=t.maxAttempts||1e3;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<r;)e().then(()=>{a=!0,n()},(...s)=>{a=!0,i(...s)}),l+=1,await Zc(o);a||i(new Error("Exceeded max attempts before resolving function"))})},fr=(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 kn=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Ao=e=>typeof e=="string"?e:"0x"+e.toString(16);async function _a(e=3e3){let t=!1,o=window;return new Promise(r=>{o.ethereum?n():(window.addEventListener("ethereum#initialized",n,{once:!0}),setTimeout(()=>{n()},e));function n(){if(t)return;t=!0,window.removeEventListener("ethereum#initialized",n);let i=[];hr()&&i.push("metamask"),Pe()&&i.push("phantom"),o.ethereum&&o.ethereum.isBraveWallet&&i.push("brave"),r(i)}})}function Rn(e){return`eip155:${String(Number(e))}`}var bt=e=>{var o;let t=ur.find(r=>r.id===e);if(!t)throw new F(`Unsupported chainId ${e}`,4901);return((o=t.rpcUrls.infura)==null?void 0:o.http[0])+`/${Ft}`};import cd from"@coinbase/wallet-sdk";import{jsx as Aa,jsxs as Jc}from"react/jsx-runtime";var _e=({style:e,...t})=>Jc("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:[Aa("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),Aa("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 ct}from"@ethersproject/address";import{Web3Provider as Wa}from"@ethersproject/providers";import{default as ld}from"eventemitter3";import{isHexString as nd}from"@ethersproject/bytes";import{JsonRpcProvider as ka}from"@ethersproject/providers";import{toUtf8String as id}from"@ethersproject/strings";import ad from"eventemitter3";var Xc=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign"],Sa=e=>Xc.includes(e);import{ErrorCode as ed}from"@ethersproject/logger";var zt=class extends F{constructor(){super("Wallet timeout");this.type="wallet_error"}},Vt=class extends F{constructor(){super("User rejected connection");this.type="wallet_error"}},Le=e=>{if(e instanceof F)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new $t(e);return e.code===ed.ACTION_REJECTED&&(t.details=wt.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new $t(e):new F("Unknown connector error",e)},In=class extends ke{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},$t=class extends In{constructor(o){var i,a,l;let r=o;super(r.message,r.code,r.data);let n=Object.values(wt).find(s=>s.eipCode===r.code);this.details=n||wt.UNKNOWN_ERROR,r.code===-32002&&((i=r.message)!=null&&i.includes("already pending for origin")?(a=r.message)!=null&&a.includes("wallet_requestPermissions")?this.details=wt.E32002_CONNECTION_ALREADY_PENDING:this.details=wt.E32002_REQUEST_ALREADY_PENDING:(l=r.message)!=null&&l.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=wt.E32002_WALLET_LOCKED))}},td={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}},od={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},rd={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}},wt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...rd,...od},Ye={...td,...wt};var sd=12e4,Wn=(e=new zt,t=sd)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),H=class{constructor(t){this.removeListener=(t,o)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,o)}catch{console.warn("Unable to remove wallet provider listener")}};this.setWalletProvider=t=>{this.walletProvider&&this._subscriptions.forEach(o=>{this.removeListener(o.eventName,o.listener)}),this.walletProvider=t,this._subscriptions.forEach(o=>{var r;(r=this.walletProvider)==null||r.on(o.eventName,o.listener)})};this.walletProvider=t,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 F(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),Wn()]).catch(o=>{throw Le(o)})}},st=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},yr=class extends ad{constructor(o,r,n=1){super();this.walletProxy=o,this.address=r,this.chainId=n,this.provider=new ka(bt(n))}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new st(`Invalid params for ${o.method}`,4200);let r=o.params[0];if(!await So()||!this.address)throw new st("Disconnected",4900);return(await Ia(r)).transactionHash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new st(`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 st(`Invalid params for ${o.method}`,4200);this.chainId=Number(r),this.provider=new ka(bt(this.chainId)),this.emit("chainChanged",r)}async handlePersonalSign(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r=o.params[0],n=nd(r)?id(r):r;return await Ra(n)}async handleEstimateGas(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r={...o.params[0],chainId:Ao(this.chainId)};return this.provider.send("eth_estimateGas",[r])}async request(o){switch(console.debug("Embedded1193Provider.request() called with args",o),o.method){case"eth_accounts":return this.address?[this.address]:[];case"eth_chainId":return Ao(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);default:break}if(Sa(o.method)){let r=await So();if(!r||!this.address)throw new st("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 st("Disconnected",4900)}}else return this.provider.send(o.method,o.params)}async connect(){let o=await So();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}}},Me=class extends H{constructor(o){super(o)}},lt=class extends H{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var ve=class extends ld{constructor(o){super();this.onAccountsChanged=o=>{this.syncAccounts(o)};this.onChainChanged=o=>{this.wallets.forEach(r=>{r.chainId=Rn(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.connected=!1,this.initialized=!1}buildConnectedWallet(o,r){let n=async()=>!!this.wallets.find(i=>ct(i.address)===ct(o));return{address:ct(o),chainId:r,connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:n,getEthereumProvider:async()=>{if(!await n())throw new F("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await n())throw new F("Wallet is not currently connected.");return new Wa(new Me(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await n())throw new F("Wallet is not currently connected.");return new lt(this.proxyProvider)},sign:async i=>{if(!await n())throw new F("Wallet is not currently connected.");return await this.sign(i)},disconnect:()=>{this.disconnect()}}}async syncAccounts(o){let r=o;if(r===void 0){let l=await this.proxyProvider.request({method:"eth_accounts"});Array.isArray(l)&&(r=l)}if(r===void 0||!Array.isArray(r)||r.length<=0)return;let n=[],i=await this.proxyProvider.request({method:"eth_chainId"}),a=Rn(i);for(let l of r)n.find(s=>ct(s.address)===ct(l))||n.push(this.buildConnectedWallet(ct(l),a));gr(n,this.wallets)||(this.wallets=n,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=>ct(n)===ct(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 Wa(new Me(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 dd=e=>{let t=`https://mainnet.infura.io/v3/${Ft}`,o=1;return e.makeWeb3Provider(t,o)},vr,br=class extends ve{constructor(){super("coinbase_wallet");this.connectorType="coinbase_wallet";this.proxyProvider=new H,this.subscribeListeners(),vr||(vr=new cd({appName:"Privy",darkMode:!1,headlessMode:!1})),this.proxyProvider.setWalletProvider(dd(vr)),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(){vr.disconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:_e}}async promptConnection(){try{let o=await this.proxyProvider.request({method:"eth_requestAccounts"});if(o.length===0)throw new F("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts(o)}catch(o){throw Le(o)}}};import{jsx as Na}from"react/jsx-runtime";var qt=({style:e,...t})=>Na("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:Na("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99555 0.929932C-1.12055 1.31799 -0.499722 9.15734 2.17445 8.76915C0.0807959 10.5544 -0.960455 16.6416 6.01654 16.0265C10.6356 15.9489 15.5635 12.2232 15.5635 8.1095C15.5635 2.63748 10.7516 0.929932 7.99555 0.929932ZM9.47052 7.53055C9.47052 8.49933 8.81856 9.28468 8.01433 9.28468C7.2101 9.28468 6.55814 8.49933 6.55814 7.53055C6.55814 6.56176 7.2101 5.77641 8.01433 5.77641C8.81856 5.77641 9.47052 6.56176 9.47052 7.53055ZM12.3171 9.28468C13.1213 9.28468 13.7733 8.49933 13.7733 7.53055C13.7733 6.56176 13.1213 5.77641 12.3171 5.77641C11.5129 5.77641 10.8609 6.56176 10.8609 7.53055C10.8609 8.49933 11.5129 9.28468 12.3171 9.28468Z",fill:t.color||"var(--privy-color-foreground-3)"})});var wr=class extends ve{constructor(o){super("privy");this.connectorType="embedded";this.proxyProvider=o,this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}async connect(o){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[Ao((o==null?void 0:o.chainId)||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:qt}}disconnect(){this.connected=!1}async promptConnection(){}};import{getAddress as fy}from"@ethersproject/address";import{Web3Provider as gy}from"@ethersproject/providers";import{isMobile as ud}from"react-device-detect";import{jsx as be,jsxs as pd}from"react/jsx-runtime";var se=({style:e,...t})=>pd("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:[be("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),be("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),be("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"}),be("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"}),be("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"}),be("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"}),be("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"}),be("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"}),be("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"}),be("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"}),be("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"}),be("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"}),be("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var Cr=class extends ve{constructor(){super("metamask");this.connectorType="injected";this.proxyProvider=new H,this.subscribeListeners();let o=window,r=o.ethereum,n=o.ethereum.providers||[];for(let i of n)if(i.isMetaMask){r=i;break}this.proxyProvider.setWalletProvider(r),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:"MetaMask",icon:se}}disconnect(){console.warn("Metamask does not support programmatic disconnect.")}async promptConnection(){try{!ud&&hr()&&await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let o=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!o||o.length===0)throw new F("Unable to retrieve accounts");await this.syncAccounts(o)}catch(o){throw Le(o)}}};import{jsx as jt,jsxs as Er}from"react/jsx-runtime";var Oe=({style:e,...t})=>Er("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:[jt("rect",{width:"28",height:"28",rx:"6",fill:"url(#paint0_linear_1765_9937)"}),jt("path",{d:"M24.0223 14.1704H21.5542C21.5542 9.14083 17.4627 5.06372 12.4151 5.06372C7.43008 5.06372 3.37717 9.04101 3.27798 13.9845C3.17536 19.0945 7.98653 23.5318 13.1154 23.5318H13.7605C18.2822 23.5318 24.3426 20.0047 25.2895 15.7072C25.4643 14.9151 24.8364 14.1704 24.0223 14.1704ZM8.74752 14.3945C8.74752 15.0671 8.19544 15.6172 7.52045 15.6172C6.84545 15.6172 6.29341 15.0669 6.29341 14.3945V12.4165C6.29341 11.7439 6.84545 11.1938 7.52045 11.1938C8.19544 11.1938 8.74752 11.7439 8.74752 12.4165V14.3945ZM13.0083 14.3945C13.0083 15.0671 12.4563 15.6172 11.7813 15.6172C11.1063 15.6172 10.5543 15.0669 10.5543 14.3945V12.4165C10.5543 11.7439 11.1065 11.1938 11.7813 11.1938C12.4563 11.1938 13.0083 11.7439 13.0083 12.4165V14.3945Z",fill:"url(#paint1_linear_1765_9937)"}),Er("defs",{children:[Er("linearGradient",{id:"paint0_linear_1765_9937",x1:"14",y1:"0",x2:"14",y2:"28",gradientUnits:"userSpaceOnUse",children:[jt("stop",{stopColor:"#534BB1"}),jt("stop",{offset:"1",stopColor:"#551BF9"})]}),Er("linearGradient",{id:"paint1_linear_1765_9937",x1:"14.2976",y1:"5.06372",x2:"14.2976",y2:"23.5318",gradientUnits:"userSpaceOnUse",children:[jt("stop",{stopColor:"white"}),jt("stop",{offset:"1",stopColor:"white",stopOpacity:"0.82"})]})]})]});var xr=class extends ve{constructor(){super("phantom");this.connectorType="injected";this.proxyProvider=new H,this.subscribeListeners(),this.proxyProvider.setWalletProvider(window.phantom.ethereum),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:"Phantom",icon:Oe}}disconnect(){console.warn("Phantom does not support programmatic disconnect.")}async promptConnection(){try{let o=await this.proxyProvider.request({method:"eth_requestAccounts"});await this.syncAccounts(o)}catch(o){throw Le(o)}}};import{EthereumProvider as Ed}from"@walletconnect/ethereum-provider";import Mn from"@walletconnect/qrcode-modal";import{isAndroid as xd,isMobile as Td}from"react-device-detect";import{createContext as hd,useContext as fd,useEffect as Nn,useState as Ma}from"react";import{jsx as md}from"react/jsx-runtime";function La(e){return md("link",{rel:"prefetch",href:e.src})}import{jsx as yd,jsxs as gd}from"react/jsx-runtime";var Qe="LANDING",Oa=hd({ready:!1,app:null,currentScreen:Qe,lastScreen:Qe,navigate:x,navigateBack:x,setModalData:x}),Da=e=>{var h,C,b;let t=e.appConfig,o=e.authenticated,r=e.visible,[n,i]=Ma(e.initialScreen||Qe),[a,l]=Ma(e.initialScreen||Qe);Nn(()=>{o||i(Qe)},[o]),Nn(()=>{r||(l(Qe),i(Qe))},[r]),Nn(()=>{e.initialScreen&&n===Qe&&(i(e.initialScreen),l(e.initialScreen))},[e.initialScreen]);let s=e.initialScreen&&n===Qe?e.initialScreen:n,u={ready:!!(t!=null&&t.id),app:t,data:e.data,setModalData:e.setModalData,currentScreen:s,lastScreen:a,navigate:m=>{l(n),i(m)},navigateBack:()=>{i(a)}};return gd(Oa.Provider,{value:u,children:[(typeof((h=t==null?void 0:t.appearance)==null?void 0:h.logo)=="string"||((b=(C=t==null?void 0:t.appearance)==null?void 0:C.logo)==null?void 0:b.type)==="img")&&yd(La,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},v=()=>fd(Oa);import{jsx as Kt,jsxs as vd}from"react/jsx-runtime";var Yt=({style:e,...t})=>{let{app:o}=v();return vd("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:[Kt("rect",{width:"28",height:"28",rx:"3",fill:(o==null?void 0:o.appearance.palette.colorScheme)==="dark"?"#3396ff":"#141414"}),Kt("g",{clipPath:"url(#clip0_1765_9946)",children:Kt("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"})}),Kt("defs",{children:Kt("clipPath",{id:"clip0_1765_9946",children:Kt("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};import{isAndroid as Ba,isDesktop as bd,isMobileOnly as wd}from"react-device-detect";var Tr=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[o,r]of Object.entries(Fa))if(r.hostname===t)return{walletClientType:o,entry:r}};var Fa={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",image_id:"5195e9db-94d8-4579-6f11-ef553be95100",hostname:"metamask.io",mobile:{native:"metamask:"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",image_id:"0528ee7e-16d1-4089-21e3-bbfb41933100",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",image_id:"a1cb2777-f8f9-49b0-53fd-443d20ee0b00",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",image_id:"7a33d7f1-3d12-4b5c-f3ee-5cd83cb1b500",hostname:"rainbow.me",mobile:{universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",image_id:"bff9cf1f-df19-42ce-f62a-87f04df13c00",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",image_id:"f216b371-96cf-409a-9d88-296392b85800",hostname:"zerion.io",mobile:{universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",image_id:"215158d2-614b-49c9-410f-77aa661c3900",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",image_id:"1bf33a89-b049-4a1c-d1f6-4dd7419ee400",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",image_id:"2cd67b4c-282b-4809-e7c0-a88cd5116f00",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",image_id:"7c5ff577-a68d-49c5-02cd-3d83637b0b00",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",image_id:"6f913b80-86c0-46f9-61ca-cc90a1805900",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",image_id:"252753e7-b783-4e03-7f77-d39864530900",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",image_id:"3f7075d0-4ab7-4db5-404d-3e4c05e6fe00",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",image_id:"cfc07342-23ea-4f3f-f071-ec9d2cd86b00",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",image_id:"52b1da3c-9e72-40ae-5dac-6142addd9c00",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",image_id:"ebac7b39-688c-41e3-7912-a4fefba74600",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",image_id:"4c16cad4-cac9-4643-6726-c696efaf5200",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",image_id:"e2024511-2c9b-46d7-3111-52df3d241700",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",image_id:"5b1cddfb-056e-4e78-029a-54de5d70c500",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",image_id:"dda0f0fb-34e8-4a57-dcea-b008e7d1ff00",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",image_id:"26a8f588-3231-4411-60ce-5bb6b805a700",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",image_id:"4725dda0-4471-4d0f-7adf-6bbe8b929c00",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",image_id:"61abe2ca-b06d-4a8b-de3e-8326f523e900",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",image_id:"c39b3a16-1a38-4588-f089-cb7aeb584700",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",image_id:"204b2240-5ce4-4996-6ec4-f06a22726900",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",image_id:"fc460647-ea95-447a-99f0-1bff8fa4be00",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",image_id:"f9854c79-14ba-4987-42e1-4a82abbf5700",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",image_id:"f78dab27-7165-4a3d-fdb1-fcff06c0a700",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",image_id:"79285c9f-2630-451e-0680-c71b42fb7400",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",image_id:"2d8006c3-852b-458a-d6b0-916c5ba76800",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",image_id:"339b9e9d-e2a7-46eb-4ed3-272321257a00",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",image_id:"cae1be94-9f53-4eba-b915-f6e381d5a500",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",image_id:"7eec7187-3f48-4fda-53bb-b0ad55749a00",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",image_id:"add9626b-a5fa-4c12-178c-e5584e6dcd00",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",image_id:"c268e78d-ffb0-4c8b-5cad-04c3add48500",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",image_id:"a7106965-91cc-4a73-4688-c5c72ae0ed00",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",image_id:"f90bc33f-f085-40cf-7538-fae5ae84f900",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",image_id:"691c0716-5213-4b99-e837-079268313800",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",image_id:"a5d9dd15-8cef-42de-8bed-09e01a8b0200",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",image_id:"b57b2163-1bd8-4f6b-3311-470767e6d200",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",image_id:"3ccbd966-97e8-45a0-1ceb-6141a8978e00",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",image_id:"6487869b-1165-4f30-aa3a-115665be8300",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",image_id:"10c75467-6612-48ad-b97b-63985e922200",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",image_id:"363fae03-882a-4d81-a721-6e6f6e9ac500",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",image_id:"32e89601-0490-42fc-0cc4-8627d62a2000",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",image_id:"98183be0-3125-45ee-a6b6-fbd47ebefd00",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",image_id:"75dd1471-77e9-4811-ce57-ec8fc980ec00",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",image_id:"374258d3-c749-4f37-7815-77e61f798c00",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",image_id:"ea0140c7-787c-43a4-838f-d5ab6a342000",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}}},Ga=(e,t="md")=>`https://registry.walletconnect.com/v2/logo/${t}/${e}`;function Ln(e){return{name:e.displayName||"",universalLink:e.mobile.universal||"",deepLink:e.mobile.native||""}}function Cd(e){let t="mobile";return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>Ln(o))}function Ha(){return Cd(Fa)}function za(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${e}`:""}function Va(e,t){return Ba?e:za(e,Ln(t))}var $a="WALLETCONNECT_DEEPLINK_CHOICE";function Ua(e){let t=e.href.split("?")[0];G.put($a,{...e,href:t})}var ko=(e,t)=>{if(!e||bd){G.del($a);return}if(Ba){Ua({name:"Unknown",href:t||"wc:"});return}else if(wd){let o=za(t||"wc:",Ln(e));Ua({name:(e==null?void 0:e.displayName)||"",href:o})}};var Ro=class extends ve{constructor(o,r){super(r||"unknown");this.connectorType="wallet_connect_v2";this.walletConnectCloudProjectId=o,this.proxyProvider=new H,this.createProvider().then(n=>{var i,a;if(this.provider=n,this.proxyProvider.setWalletProvider(n),this.subscribeListeners(),n.session){if((i=this.walletProvider.session)!=null&&i.peer.metadata.url){let l=Tr((a=this.walletProvider.session)==null?void 0:a.peer.metadata.url);this.walletEntry=l==null?void 0:l.entry,this.walletClientType=(l==null?void 0:l.walletClientType)||"unknown",ko(this.walletEntry)}this.connected=!0,this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}else this.emit("initialized"),this.initialized=!0})}async connect(o){return o.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return this.walletProvider.connected}get walletBranding(){var o,r,n;return this.walletEntry?{name:this.walletEntry.displayName,icon:this.walletClientType==="metamask"?se:Ga(this.walletEntry.image_id)}:{name:kn(((o=this.walletProvider.session)==null?void 0:o.peer.metadata.name)||"")||"WalletConnect",icon:((n=(r=this.walletProvider.session)==null?void 0:r.peer.metadata.icons)==null?void 0:n[0])||Yt}}resetConnection(){this.walletProvider.connected&&(this.walletProvider.signer.session=void 0,this.walletEntry=void 0,ko(void 0),this.onDisconnect())}async promptConnection(){if(!!this.provider)return new Promise((o,r)=>{let n=()=>{r(new Vt)};this.onQrModalClosed=n,(async()=>{var s,u;let a="",l=await Promise.race([this.walletProvider.enable(),Wn()]);if(l.length>0&&(a=l[0]),!a||a==="")throw new F("Unable to retrieve address");if((s=this.walletProvider.session)!=null&&s.peer.metadata.url){let h=Tr((u=this.walletProvider.session)==null?void 0:u.peer.metadata.url);this.walletEntry=h==null?void 0:h.entry,this.walletClientType=(h==null?void 0:h.walletClientType)||"unknown"}this.connected=!0,await this.syncAccounts(l),o()})().catch(a=>{if(a){r(Le(a));return}r(new F("Unknown error during connection"))}).finally(()=>Mn.close())})}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(){var n,i;let o={};for(let a of ur){let l=(i=(n=a.rpcUrls.infura)==null?void 0:n.http)==null?void 0:i[0];l&&(o[a.id]=l+"/"+Ft)}let r=await Ed.init({projectId:this.walletConnectCloudProjectId,chains:[1],rpcMap:o,showQrModal:!1});return r.on("display_uri",a=>{if(xd)window.open(a,"_self");else if(Td&&this.walletEntry){ko(this.walletEntry,a);let s=Va(a,this.walletEntry);window.open(s,"_self","noopener,noreferrer")}else Mn.open(a,()=>{this.onQrModalClosed&&this.onQrModalClosed()},{mobileLinks:Ha().map(l=>l.name)})}),r.on("connect",()=>{var a,l;if(Mn.close(),(a=r.session)!=null&&a.peer.metadata.url){let s=Tr((l=r.session)==null?void 0:l.peer.metadata.url);this.walletEntry=s==null?void 0:s.entry,this.walletClientType=(s==null?void 0:s.walletClientType)||"unknown",ko(this.walletEntry)}}),r}async enableProvider(){return this.walletProvider.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider.enable()}};var On=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses");return t?!!(e==null?void 0:e.linkedAccounts.filter(r=>r.type=="wallet"&&r.address===qa(t)).length):!1},Io=class extends Pd{constructor(o){super();this.getEthereumProvider=()=>{let o=this.wallets[0],r=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===(o==null?void 0:o.address)));return!o||!r?new H:r.proxyProvider};this.walletConnectCloudProjectId=o,this.walletConnectors=[],this.initialized=!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}initialize(){this.initialized||(G.get(Pn)&&(G.getKeys().forEach(o=>{o.startsWith("walletconnect")&&G.del(o)}),G.del(Pn)),_a().then(o=>o.forEach(r=>{switch(r){case"metamask":this.createWalletConnector("injected","metamask");break;case"phantom":this.createWalletConnector("injected","phantom");break;case"unknown":default:break}})),(at()||G.getKeys().find(o=>o.startsWith("-walletlink")))&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),this.createWalletConnector("wallet_connect_v2","unknown"),this.initialized=!0)}findWalletConnector(o,r){return o==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===o)||null:this.walletConnectors.find(n=>n.connectorType===o&&n.walletClientType===r)||null}onInitialized(o){o.wallets.forEach(r=>{let n=this.storedConnections.find(i=>i.address===r.address&&i.connectorType===r.connectorType&&i.walletClientType===r.walletClientType);n&&(r.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated")}onWalletsUpdated(o){o.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(o,r){if(!this.findWalletConnector("embedded","privy")){let i=new yr(o,r),a=new wr(i);this.addWalletConnector(a)}}removeEmbeddedWalletConnector(){let o=this.findWalletConnector("embedded","privy");if(o){let r=this.walletConnectors.indexOf(o);this.walletConnectors.splice(r,1),this.saveConnectionHistory(),this.emit("walletsUpdated")}}async createWalletConnector(o,r){let n=this.findWalletConnector(o,r);if(n)return n instanceof Ro&&n.resetConnection(),n;let a=(()=>{switch(o){case"injected":switch(r){case"phantom":return Pe()?new xr:null;case"metamask":default:return _o()?new Cr:null}case"coinbase_wallet":return new br;case"wallet_connect_v2":return new Ro(this.walletConnectCloudProjectId)}})();return a&&this.addWalletConnector(a),a||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=G.get(_n);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}));G.put(_n,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=qa(o),this.emit("walletsUpdated")}};function gr(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==null?void 0:r.address)!==(n==null?void 0:n.address)||(r==null?void 0:r.chainId)!==(n==null?void 0:n.chainId)||(r==null?void 0:r.connectorType)!==(n==null?void 0:n.connectorType)||(r==null?void 0:r.connectedAt)!==(n==null?void 0:n.connectedAt)||(r==null?void 0:r.walletClientType)!==(n==null?void 0:n.walletClientType)||(r==null?void 0:r.isConnected)!==(n==null?void 0:n.isConnected)||(r==null?void 0:r.linked)!==(n==null?void 0:n.linked))return!1}return!0}import{ofetch as _d}from"ofetch";var Ad=[lr(),cr()],Pr=class{constructor(t,o,r){this.appId=t,this.sdkVersion=En,this.client=o,this.defaults=r,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=_d.create({baseURL:this.defaults.baseURL,credentials:"include",onRequest:async({request:n,options:i})=>{let a=new Headers(i.headers);a.set("privy-app-id",this.appId),a.set("privy-client",`react-auth:${this.sdkVersion}`);let l=!Ad.includes(n.toString());if(!a.has("authorization")&&l){let s=await this.client.getAccessToken();s!==null&&a.set("authorization",`Bearer ${s}`)}i.headers=a,i.signal||(i.signal=AbortSignal.timeout(this.defaults.timeout))},onRequestError:({error:n})=>{if(n instanceof DOMException&&n.name==="AbortError")throw new sr}})}async get(t,o){try{return await this.baseFetch(t,o)}catch(r){throw J(r)}}async post(t,o,r){try{return await this.baseFetch(t,{method:"POST",...o?{body:o}:{},...r})}catch(n){throw J(n)}}async delete(t,o){try{return await this.baseFetch(t,{method:"DELETE",...o})}catch(r){throw J(r)}}};import _r from"js-cookie";function ja(e){return e instanceof yt?"email":e instanceof vt?"sms":e instanceof gt?"siwe":e instanceof nt?e.meta.provider:null}var De=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}};import*as Ka from"jose";var Ue=class{static parse(t){try{return new Ue(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Ka.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 Sd=30,Ar=class{constructor(){this.authenticateOnce=new De(async t=>this._authenticate(t)),this.linkOnce=new De(async t=>this._link(t)),this.refreshOnce=new De(this._refresh.bind(this)),this.destroyOnce=new De(this._destroy.bind(this)),this.forkSessionOnce=new De(this._forkSession.bind(this))}get token(){try{let t=G.get(Gt);return typeof t=="string"?new Ue(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=G.get(pr);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=G.get(Po);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}hasRefreshCredentials(){return typeof this.token=="string"&&typeof this.refreshToken=="string"}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Ue.parse(this.token);return t!==null&&!t.isExpired(Sd)}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=ja(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:Ke(n),isNewUser:i}}catch(o){throw console.warn("Error authenticating session"),xe(o)}}async _link(t){try{let o=await t.link();return Ke(o)}catch(o){throw console.warn("Error linking account"),xe(o)}}async _refresh(){if(!this.api)throw new P("Session has no API instance");if(!this.client)throw new P("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)n=await this.api.post(lr(),{refresh_token:o},{headers:{authorization:`Bearer ${t}`}}),r&&this.clearForkedToken();else if(r)n=await this.api.post(cr(),{refresh_token:r}),this.clearForkedToken();else return null;return this.storeToken(n.token),this.storeRefreshToken(n.refresh_token),Ke(n.user)}catch(n){if(n instanceof Ut&&n.status===400&&n.message==="Invalid auth token")return this.destroyLocalState(),null;throw xe(n)}}async _destroy(){var t;try{await((t=this.api)==null?void 0:t.post(Fi(),{refresh_token:this.refreshToken}))}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new P("Session has no API instance");let t=this.refreshToken;try{let o=await this.api.post(Gi(),{refresh_token:t});return this.storeToken(o.token),this.storeRefreshToken(o.refresh_token),o.new_session_refresh_token}catch(o){throw xe(o)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null),this.clearForkedToken()}storeToken(t){var o;if(typeof t=="string"){G.put(Gt,t);let r=(o=Ue.parse(t))==null?void 0:o.expiration;_r.set(xn,t,{sameSite:"Strict",secure:!0,expires:r?new Date(r*1e3):void 0})}else G.del(Gt),_r.remove(xn)}storeRefreshToken(t){typeof t=="string"?(G.put(pr,t),_r.set(Tn,t,{sameSite:"Strict",secure:!0,expires:30})):(G.del(pr),_r.remove(Tn))}clearForkedToken(){G.del(Po)}};var Dn,Wo=class{constructor(t){this.apiUrl=t.apiUrl||dr,this.fallbackApiUrl=this.apiUrl,this.timeout=t.timeout||sa,this.appId=t.appId,this.clientAnalyticsId=typeof window>"u"?null:crypto.randomUUID(),Dn||(Dn=new Ar),this.session=Dn,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager(t){this.connectors||(this.connectors=new Io(t))}generateApi(){let t=new Pr(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()}authenticate(){if(!this.authFlow)throw new P("No auth flow in progress.");return this.session.authenticate(this.authFlow)}link(){if(!this.authFlow)throw new P("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}async unlinkEmail(t){try{let o=await this.api.post(ta(),{address:t});return Ke(o)}catch(o){throw xe(o)}}async unlinkPhone(t){try{let o=await this.api.post(oa(),{phoneNumber:t});return Ke(o)}catch(o){throw xe(o)}}async unlinkWallet(t){try{let o=await this.api.post(ea(),{address:t});return Ke(o)}catch(o){throw xe(o)}}async unlinkOAuth(t,o){try{let r=await this.api.post(ra(),{provider:t,subject:o});return Ke(r)}catch(r){throw xe(r)}}async createAnalyticsEvent(t,o,r){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.error("No client analytics id set, refusing to send analytics event"),await this.api.post(na(),{event_name:t,client_id:this.clientAnalyticsId,payload:{...o||{},clientTimestamp:r?r.toISOString():new Date().toISOString()}})}catch(n){console.error("Failed to create analytics event",n)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){var o;return this.session.hasActiveToken()?((o=Ue.parse(this.session.token))==null?void 0:o.audience)!==this.appId?(await this.logout(),null):this.session.token:!(t!=null&&t.disableAutoRefresh)&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){var t,o;try{let r=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl});return{id:r.id,name:r.name,verificationKey:r.verification_key,logoUrl:r.logo_url||void 0,accentColor:r.accent_color||void 0,showWalletLoginFirst:r.show_wallet_login_first,allowlistConfig:{errorTitle:r.allowlist_config.error_title,errorDetail:r.allowlist_config.error_detail,errorCtaText:r.allowlist_config.cta_text,errorCtaLink:r.allowlist_config.cta_link},walletAuth:r.wallet_auth,emailAuth:r.email_auth,smsAuth:r.sms_auth,googleOAuth:r.google_oauth,twitterOAuth:r.twitter_oauth,discordOAuth:r.discord_oauth,githubOAuth:r.github_oauth,appleOAuth:r.apple_oauth,termsAndConditionsUrl:r.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:(t=r.embedded_wallet_config)==null?void 0:t.create_on_login,requireUserPasswordOnCreate:(o=r.embedded_wallet_config)==null?void 0:o.require_user_password_on_create},privacyPolicyUrl:r.privacy_policy_url,customApiUrl:r.custom_api_url,walletConnectCloudProjectId:r.wallet_connect_cloud_project_id,createdAt:new Date(r.created_at*1e3),updatedAt:new Date(r.updated_at*1e3)}}catch(r){throw xe(r)}}async getUsdTokenPrice(t){try{return(await this.api.get(`/api/v1/token_price?chainId=${t}`)).usd}catch{console.error(`Unable to fetch token price for chain with id ${t}`);return}}async forkSession(){return await this.session.forkSession()}};import"wicg-inert";import{disableBodyScroll as Zh,clearAllBodyScrollLocks as Jh}from"body-scroll-lock";import{useRef as Xh,useCallback as ef}from"react";import{useEffect as Mc}from"react";import tf from"react-dom";import Oi from"styled-components";import{createContext as kd,useContext as Rd}from"react";var Un=kd({isNewUserThisSession:!1,isLinking:!1,linkingHint:null,walletConnectionStatus:null,getAuthMeta:x,getAuthFlow:x,closePrivyModal:x,connectWallet:x,initLoginWithWallet:x,loginWithWallet:x,loginWithCode:x,initLoginWithEmail:x,initLoginWithSms:x,resendEmailCode:x,resendSmsCode:x,initLoginWithOAuth:x,loginWithOAuth:x,refreshUser:x,walletProxy:null,createAnalyticsEvent:x,getUsdTokenPrice:x,recoverEmbeddedWallet:x}),I=()=>Rd(Un);import{createContext as Id,useContext as Wd}from"react";var Bn=Id({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:x,login:x,linkEmail:x,linkPhone:x,linkWallet:x,linkGoogle:x,linkTwitter:x,linkDiscord:x,linkGithub:x,linkApple:x,logout:x,getAccessToken:x,getEthereumProvider:x,getEthersProvider:x,getWeb3jsProvider:x,unlinkEmail:x,unlinkPhone:x,unlinkWallet:x,unlinkGoogle:x,unlinkTwitter:x,unlinkDiscord:x,unlinkGithub:x,unlinkApple:x,setActiveWallet:x,forkSession:x,createWallet:x,signMessage:x,sendTransaction:x,exportWallet:x}),B=()=>Wd(Bn);import Vn from"styled-components";import Lo,{css as Ya}from"styled-components";import Gn from"styled-components";import{Fragment as Md,jsx as Fn,jsxs as Od}from"react/jsx-runtime";var Sr=({success:e,fail:t})=>Od(Md,{children:[Fn(No,{className:e?"success":t?"fail":""}),Fn(Nd,{className:e?"success":t?"fail":""})]}),No=Gn.span`
12
+ - https://privy.io`;this.wallet=t}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign(),r=await this.api.post(zi(),{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 J(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");try{let{message:t,signature:o}=await this.sign();return await this.api.post(Vi(),{message:t,signature:o,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw J(t)}}async sign(){if(!this.api)throw new P("Auth flow has no API instance");if(this.preparedMessage||await this.buildSiweMessage(),!this.preparedMessage)throw new P("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async buildSiweMessage(){if(!this.api)throw new P("Auth flow has no API instance");let t=this.wallet.address,o=this.wallet.chainId.replace("eip155:",""),r=await this.api.post(Hi(),{address:t});return this.preparedMessage=this.prepareMessage(o,t,r.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 vt=class{constructor(t){this.meta={phoneNumber:t}}async authenticate(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{let t=Yi(),o=await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw J(t)}}async link(){if(!this.api)throw new P("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new P("phone number and sms code must be set prior to calling authenticate.");try{let t=Qi();return await this.api.post(t,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw J(t)}}async sendSmsCode(t){if(!this.api)throw new P("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),!this.meta.phoneNumber)throw new P("phone nNumber must be set when initialzing authentication.");try{let o=Ki();return await this.api.post(o,{phoneNumber:this.meta.phoneNumber})}catch(o){throw J(o)}}};function je(e){return new Date(e*1e3)}function qc(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:je(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:je(o.verified_at)};t.push(i);break;case"phone":let a={number:o.phoneNumber,type:o.type,verifiedAt:je(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:je(o.verified_at)};t.push(l);break;case"twitter_oauth":let s={subject:o.subject,username:o.username,name:o.name,type:o.type,verifiedAt:je(o.verified_at)};t.push(s);break;case"discord_oauth":let u={subject:o.subject,username:o.username,email:o.email,type:o.type,verifiedAt:je(o.verified_at)};t.push(u);break;case"github_oauth":let h={subject:o.subject,username:o.username,name:o.name,email:o.email,type:o.type,verifiedAt:je(o.verified_at)};t.push(h);break;case"apple_oauth":let C={subject:o.subject,email:o.email,type:o.type,verifiedAt:je(o.verified_at)};t.push(C);break;default:console.warn(`Unrecognized account type: ${r}. Please consider upgrading the Privy SDK.`)}}return t}function it(e,t){return e.sort((o,r)=>r.verifiedAt.getTime()-o.verifiedAt.getTime()),e.find(o=>o.type===t)}var $=e=>e==null?void 0:e.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClient==="privy"),jc=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Bt=(e,t)=>{var o;return t==="all-users"&&!$(e)||t==="users-without-wallets"&&!((o=jc(e))!=null&&o.length)};function Ke(e){if(!e)return null;let t=qc(e.linked_accounts),o=it(t,"wallet"),r=it(t,"email"),n=it(t,"phone"),i=it(t,"google_oauth"),a=it(t,"twitter_oauth"),l=it(t,"discord_oauth"),s=it(t,"github_oauth"),u=it(t,"apple_oauth");return{id:e.id,createdAt:je(e.created_at),linkedAccounts:t,email:r&&{address:r==null?void 0:r.address},phone:n&&{number:n==null?void 0: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},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},apple:u&&{subject:u.subject,email:u.email}}}import{getAddress as qa}from"@ethersproject/address";import Pd from"eventemitter3";var ia="1.28.2-beta.2";var Ft="4df5e2316331463a9130964bd6078dfa",aa="34357d3c125c2bcf2ce2bc3309d98715",pr="https://auth.privy.io",sa=1e4,Re=1400,la=4500,En=ia;var Gt="privy:token",xn="privy-token",ur="privy:refresh_token",Tn="privy-refresh-token",Po="privy:session_transfer_token",Pn="privy:connectors",_n="privy:connections";var Te=1;var An=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)}},Sn=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)}};function Yc(){return typeof window<"u"&&window.localStorage?new Sn:new An}var G=Yc();import{isPossiblePhoneNumber as Qc}from"libphonenumber-js/min";var ca={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 da={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Arbitrum Goerli Ether",symbol:"ETH",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 pa={id:84531,network:"base-goerli",name:"Base Goerli",nativeCurrency:{name:"Base Goerli",symbol:"ETH",decimals:18},rpcUrls:{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 ua={id:42220,name:"Celo",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 ma={id:44787,name:"Alfajores",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"A-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 ha={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 fa={id:314159,name:"Filecoin Calibration",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 ya={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 ga={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 va={id:10,name:"Optimism",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 ba={id:420,name:"Optimism Goerli",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 wa={id:137,name:"Polygon",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 Ca={id:80001,name:"Polygon 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 _o=[ca,da,ya,ga,va,ba,wa,Ca,ua,ma,ha,fa,pa];var hr=()=>{let e=window;if(!e.ethereum)return!1;if(mr(window.ethereum,!0))return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(mr(t,!0))return!0}return!1},Ao=()=>{let e=window;if(!e.ethereum)return!1;if(mr(window.ethereum,!1))return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(mr(t,!1))return!0}return!1},mr=(e,t)=>e.isMetaMask?e.isMetaMask&&!t?!0:!(e.isBraveWallet&&!e._events&&!e._state||e.isApexWallet||e.isAvalanche||e.isBitKeep||e.isBlockWallet||e.isKuCoinWallet||e.isMathWallet||e.isOkxWallet||e.isOKExWallet||e.isOneInchIOSWallet||e.isOneInchAndroidWallet||e.isOpera||e.isPhantom||e.isPortal||e.isRabby||e.isTokenPocket||e.isTokenary||e.isZerion):!1,Pe=()=>{var e,t;if("phantom"in window){let o=window;if((t=(e=o==null?void 0:o.phantom)==null?void 0:e.ethereum)!=null&&t.isPhantom)return!0}return!1},at=()=>{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.isCoinbaseWallet)return!0}return!1};var Ea=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,}))$/),xa=e=>Qc(String(e),"US"),Ta=(e,t)=>{let o=e.slice(0),r=[];for(;o.length;)r.push(o.splice(0,t));return r},Ht=(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}`},Zc=e=>new Promise(t=>setTimeout(t,e)),Pa=(e,t={})=>{let o=t.delayMs||40,r=t.maxAttempts||1e3;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<r;)e().then(()=>{a=!0,n()},(...s)=>{a=!0,i(...s)}),l+=1,await Zc(o);a||i(new Error("Exceeded max attempts before resolving function"))})},fr=(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 kn=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),So=e=>typeof e=="string"?e:"0x"+e.toString(16);async function _a(e=3e3){let t=!1,o=window;return new Promise(r=>{o.ethereum?n():(window.addEventListener("ethereum#initialized",n,{once:!0}),setTimeout(()=>{n()},e));function n(){if(t)return;t=!0,window.removeEventListener("ethereum#initialized",n);let i=[];hr()&&i.push("metamask"),Pe()&&i.push("phantom"),o.ethereum&&o.ethereum.isBraveWallet&&i.push("brave"),r(i)}})}function Rn(e){return`eip155:${String(Number(e))}`}var bt=e=>{var o;let t=_o.find(r=>r.id===e);if(!t)throw new F(`Unsupported chainId ${e}`,4901);return((o=t.rpcUrls.infura)==null?void 0:o.http[0])+`/${Ft}`};import cd from"@coinbase/wallet-sdk";import{jsx as Aa,jsxs as Jc}from"react/jsx-runtime";var _e=({style:e,...t})=>Jc("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:[Aa("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),Aa("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 ct}from"@ethersproject/address";import{Web3Provider as Wa}from"@ethersproject/providers";import{default as ld}from"eventemitter3";import{isHexString as nd}from"@ethersproject/bytes";import{JsonRpcProvider as ka}from"@ethersproject/providers";import{toUtf8String as id}from"@ethersproject/strings";import ad from"eventemitter3";var Xc=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign"],Sa=e=>Xc.includes(e);import{ErrorCode as ed}from"@ethersproject/logger";var zt=class extends F{constructor(){super("Wallet timeout");this.type="wallet_error"}},Vt=class extends F{constructor(){super("User rejected connection");this.type="wallet_error"}},Le=e=>{if(e instanceof F)return e;if((e==null?void 0:e.code)&&(e==null?void 0:e.reason)){let t=new $t(e);return e.code===ed.ACTION_REJECTED&&(t.details=wt.E4001_USER_REJECTED_REQUEST),t}return e!=null&&e.code?new $t(e):new F("Unknown connector error",e)},In=class extends ke{constructor(o,r,n){super(o);this.type="provider_error";this.code=r,this.data=n}},$t=class extends In{constructor(o){var i,a,l;let r=o;super(r.message,r.code,r.data);let n=Object.values(wt).find(s=>s.eipCode===r.code);this.details=n||wt.UNKNOWN_ERROR,r.code===-32002&&((i=r.message)!=null&&i.includes("already pending for origin")?(a=r.message)!=null&&a.includes("wallet_requestPermissions")?this.details=wt.E32002_CONNECTION_ALREADY_PENDING:this.details=wt.E32002_REQUEST_ALREADY_PENDING:(l=r.message)!=null&&l.includes("Already processing")&&r.message.includes("eth_requestAccounts")&&(this.details=wt.E32002_WALLET_LOCKED))}},td={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}},od={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},rd={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}},wt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...rd,...od},Ye={...td,...wt};var sd=12e4,Wn=(e=new zt,t=sd)=>new Promise((o,r)=>setTimeout(()=>{r(e)},t)),H=class{constructor(t){this.removeListener=(t,o)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,o)}catch{console.warn("Unable to remove wallet provider listener")}};this.setWalletProvider=t=>{this.walletProvider&&this._subscriptions.forEach(o=>{this.removeListener(o.eventName,o.listener)}),this.walletProvider=t,this._subscriptions.forEach(o=>{var r;(r=this.walletProvider)==null||r.on(o.eventName,o.listener)})};this.walletProvider=t,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 F(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),Wn()]).catch(o=>{throw Le(o)})}},st=class extends Error{constructor(o,r,n){super(o);this.code=r,this.data=n}},yr=class extends ad{constructor(o,r,n=1){super();this.walletProxy=o,this.address=r,this.chainId=n,this.provider=new ka(bt(n))}async handleSendTransaction(o){if(!o.params||!Array.isArray(o.params))throw new st(`Invalid params for ${o.method}`,4200);let r=o.params[0];if(!await ko()||!this.address)throw new st("Disconnected",4900);return(await Ia(r)).transactionHash}handleSwitchEthereumChain(o){if(!o.params||!Array.isArray(o.params))throw new st(`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 st(`Invalid params for ${o.method}`,4200);this.chainId=Number(r),this.provider=new ka(bt(this.chainId)),this.emit("chainChanged",r)}async handlePersonalSign(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r=o.params[0],n=nd(r)?id(r):r;return await Ra(n)}async handleEstimateGas(o){if(!o.params||!Array.isArray(o.params))throw new Error("Invalid params for eth_estimateGas");let r={...o.params[0],chainId:So(this.chainId)};return this.provider.send("eth_estimateGas",[r])}async request(o){switch(console.debug("Embedded1193Provider.request() called with args",o),o.method){case"eth_accounts":return this.address?[this.address]:[];case"eth_chainId":return So(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);default:break}if(Sa(o.method)){let r=await ko();if(!r||!this.address)throw new st("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 st("Disconnected",4900)}}else return this.provider.send(o.method,o.params)}async connect(){let o=await ko();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}}},Me=class extends H{constructor(o){super(o)}},lt=class extends H{constructor(t){super(t)}sendAsync(t,o){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var ve=class extends ld{constructor(o){super();this.onAccountsChanged=o=>{this.syncAccounts(o)};this.onChainChanged=o=>{this.wallets.forEach(r=>{r.chainId=Rn(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.connected=!1,this.initialized=!1}buildConnectedWallet(o,r){let n=async()=>!!this.wallets.find(i=>ct(i.address)===ct(o));return{address:ct(o),chainId:r,connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:n,getEthereumProvider:async()=>{if(!await n())throw new F("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await n())throw new F("Wallet is not currently connected.");return new Wa(new Me(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await n())throw new F("Wallet is not currently connected.");return new lt(this.proxyProvider)},sign:async i=>{if(!await n())throw new F("Wallet is not currently connected.");return await this.sign(i)},disconnect:()=>{this.disconnect()}}}async syncAccounts(o){let r=o;if(r===void 0){let l=await this.proxyProvider.request({method:"eth_accounts"});Array.isArray(l)&&(r=l)}if(r===void 0||!Array.isArray(r)||r.length<=0)return;let n=[],i=await this.proxyProvider.request({method:"eth_chainId"}),a=Rn(i);for(let l of r)n.find(s=>ct(s.address)===ct(l))||n.push(this.buildConnectedWallet(ct(l),a));gr(n,this.wallets)||(this.wallets=n,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=>ct(n)===ct(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 Wa(new Me(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 dd=e=>{let t=`https://mainnet.infura.io/v3/${Ft}`,o=1;return e.makeWeb3Provider(t,o)},vr,br=class extends ve{constructor(){super("coinbase_wallet");this.connectorType="coinbase_wallet";this.proxyProvider=new H,this.subscribeListeners(),vr||(vr=new cd({appName:"Privy",darkMode:!1,headlessMode:!1})),this.proxyProvider.setWalletProvider(dd(vr)),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(){vr.disconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:_e}}async promptConnection(){try{let o=await this.proxyProvider.request({method:"eth_requestAccounts"});if(o.length===0)throw new F("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts(o)}catch(o){throw Le(o)}}};import{jsx as Na}from"react/jsx-runtime";var qt=({style:e,...t})=>Na("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:Na("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99555 0.929932C-1.12055 1.31799 -0.499722 9.15734 2.17445 8.76915C0.0807959 10.5544 -0.960455 16.6416 6.01654 16.0265C10.6356 15.9489 15.5635 12.2232 15.5635 8.1095C15.5635 2.63748 10.7516 0.929932 7.99555 0.929932ZM9.47052 7.53055C9.47052 8.49933 8.81856 9.28468 8.01433 9.28468C7.2101 9.28468 6.55814 8.49933 6.55814 7.53055C6.55814 6.56176 7.2101 5.77641 8.01433 5.77641C8.81856 5.77641 9.47052 6.56176 9.47052 7.53055ZM12.3171 9.28468C13.1213 9.28468 13.7733 8.49933 13.7733 7.53055C13.7733 6.56176 13.1213 5.77641 12.3171 5.77641C11.5129 5.77641 10.8609 6.56176 10.8609 7.53055C10.8609 8.49933 11.5129 9.28468 12.3171 9.28468Z",fill:t.color||"var(--privy-color-foreground-3)"})});var wr=class extends ve{constructor(o){super("privy");this.connectorType="embedded";this.proxyProvider=o,this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}async connect(o){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[So((o==null?void 0:o.chainId)||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:qt}}disconnect(){this.connected=!1}async promptConnection(){}};import{getAddress as fy}from"@ethersproject/address";import{Web3Provider as gy}from"@ethersproject/providers";import{isMobile as ud}from"react-device-detect";import{jsx as be,jsxs as pd}from"react/jsx-runtime";var se=({style:e,...t})=>pd("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:[be("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),be("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),be("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"}),be("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"}),be("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"}),be("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"}),be("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"}),be("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"}),be("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"}),be("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"}),be("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"}),be("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"}),be("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var Cr=class extends ve{constructor(){super("metamask");this.connectorType="injected";this.proxyProvider=new H,this.subscribeListeners();let o=window,r=o.ethereum,n=o.ethereum.providers||[];for(let i of n)if(i.isMetaMask){r=i;break}this.proxyProvider.setWalletProvider(r),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:"MetaMask",icon:se}}disconnect(){console.warn("Metamask does not support programmatic disconnect.")}async promptConnection(){try{!ud&&hr()&&await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let o=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!o||o.length===0)throw new F("Unable to retrieve accounts");await this.syncAccounts(o)}catch(o){throw Le(o)}}};import{jsx as jt,jsxs as Er}from"react/jsx-runtime";var Oe=({style:e,...t})=>Er("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:[jt("rect",{width:"28",height:"28",rx:"6",fill:"url(#paint0_linear_1765_9937)"}),jt("path",{d:"M24.0223 14.1704H21.5542C21.5542 9.14083 17.4627 5.06372 12.4151 5.06372C7.43008 5.06372 3.37717 9.04101 3.27798 13.9845C3.17536 19.0945 7.98653 23.5318 13.1154 23.5318H13.7605C18.2822 23.5318 24.3426 20.0047 25.2895 15.7072C25.4643 14.9151 24.8364 14.1704 24.0223 14.1704ZM8.74752 14.3945C8.74752 15.0671 8.19544 15.6172 7.52045 15.6172C6.84545 15.6172 6.29341 15.0669 6.29341 14.3945V12.4165C6.29341 11.7439 6.84545 11.1938 7.52045 11.1938C8.19544 11.1938 8.74752 11.7439 8.74752 12.4165V14.3945ZM13.0083 14.3945C13.0083 15.0671 12.4563 15.6172 11.7813 15.6172C11.1063 15.6172 10.5543 15.0669 10.5543 14.3945V12.4165C10.5543 11.7439 11.1065 11.1938 11.7813 11.1938C12.4563 11.1938 13.0083 11.7439 13.0083 12.4165V14.3945Z",fill:"url(#paint1_linear_1765_9937)"}),Er("defs",{children:[Er("linearGradient",{id:"paint0_linear_1765_9937",x1:"14",y1:"0",x2:"14",y2:"28",gradientUnits:"userSpaceOnUse",children:[jt("stop",{stopColor:"#534BB1"}),jt("stop",{offset:"1",stopColor:"#551BF9"})]}),Er("linearGradient",{id:"paint1_linear_1765_9937",x1:"14.2976",y1:"5.06372",x2:"14.2976",y2:"23.5318",gradientUnits:"userSpaceOnUse",children:[jt("stop",{stopColor:"white"}),jt("stop",{offset:"1",stopColor:"white",stopOpacity:"0.82"})]})]})]});var xr=class extends ve{constructor(){super("phantom");this.connectorType="injected";this.proxyProvider=new H,this.subscribeListeners(),this.proxyProvider.setWalletProvider(window.phantom.ethereum),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:"Phantom",icon:Oe}}disconnect(){console.warn("Phantom does not support programmatic disconnect.")}async promptConnection(){try{let o=await this.proxyProvider.request({method:"eth_requestAccounts"});await this.syncAccounts(o)}catch(o){throw Le(o)}}};import{EthereumProvider as Ed}from"@walletconnect/ethereum-provider";import Mn from"@walletconnect/qrcode-modal";import{isAndroid as xd,isMobile as Td}from"react-device-detect";import{createContext as hd,useContext as fd,useEffect as Nn,useState as Ma}from"react";import{jsx as md}from"react/jsx-runtime";function La(e){return md("link",{rel:"prefetch",href:e.src})}import{jsx as yd,jsxs as gd}from"react/jsx-runtime";var Qe="LANDING",Oa=hd({ready:!1,app:null,currentScreen:Qe,lastScreen:Qe,navigate:x,navigateBack:x,setModalData:x}),Da=e=>{var h,C,b;let t=e.appConfig,o=e.authenticated,r=e.visible,[n,i]=Ma(e.initialScreen||Qe),[a,l]=Ma(e.initialScreen||Qe);Nn(()=>{o||i(Qe)},[o]),Nn(()=>{r||(l(Qe),i(Qe))},[r]),Nn(()=>{e.initialScreen&&n===Qe&&(i(e.initialScreen),l(e.initialScreen))},[e.initialScreen]);let s=e.initialScreen&&n===Qe?e.initialScreen:n,u={ready:!!(t!=null&&t.id),app:t,data:e.data,setModalData:e.setModalData,currentScreen:s,lastScreen:a,navigate:m=>{l(n),i(m)},navigateBack:()=>{i(a)}};return gd(Oa.Provider,{value:u,children:[(typeof((h=t==null?void 0:t.appearance)==null?void 0:h.logo)=="string"||((b=(C=t==null?void 0:t.appearance)==null?void 0:C.logo)==null?void 0:b.type)==="img")&&yd(La,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},v=()=>fd(Oa);import{jsx as Kt,jsxs as vd}from"react/jsx-runtime";var Yt=({style:e,...t})=>{let{app:o}=v();return vd("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:[Kt("rect",{width:"28",height:"28",rx:"3",fill:(o==null?void 0:o.appearance.palette.colorScheme)==="dark"?"#3396ff":"#141414"}),Kt("g",{clipPath:"url(#clip0_1765_9946)",children:Kt("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"})}),Kt("defs",{children:Kt("clipPath",{id:"clip0_1765_9946",children:Kt("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};import{isAndroid as Ba,isDesktop as bd,isMobileOnly as wd}from"react-device-detect";var Tr=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[o,r]of Object.entries(Fa))if(r.hostname===t)return{walletClientType:o,entry:r}};var Fa={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",image_id:"5195e9db-94d8-4579-6f11-ef553be95100",hostname:"metamask.io",mobile:{native:"metamask:"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",image_id:"0528ee7e-16d1-4089-21e3-bbfb41933100",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",image_id:"a1cb2777-f8f9-49b0-53fd-443d20ee0b00",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",image_id:"7a33d7f1-3d12-4b5c-f3ee-5cd83cb1b500",hostname:"rainbow.me",mobile:{universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",image_id:"bff9cf1f-df19-42ce-f62a-87f04df13c00",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",image_id:"f216b371-96cf-409a-9d88-296392b85800",hostname:"zerion.io",mobile:{universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",image_id:"215158d2-614b-49c9-410f-77aa661c3900",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",image_id:"1bf33a89-b049-4a1c-d1f6-4dd7419ee400",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",image_id:"2cd67b4c-282b-4809-e7c0-a88cd5116f00",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",image_id:"7c5ff577-a68d-49c5-02cd-3d83637b0b00",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",image_id:"6f913b80-86c0-46f9-61ca-cc90a1805900",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",image_id:"252753e7-b783-4e03-7f77-d39864530900",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",image_id:"3f7075d0-4ab7-4db5-404d-3e4c05e6fe00",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",image_id:"cfc07342-23ea-4f3f-f071-ec9d2cd86b00",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",image_id:"52b1da3c-9e72-40ae-5dac-6142addd9c00",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",image_id:"ebac7b39-688c-41e3-7912-a4fefba74600",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",image_id:"4c16cad4-cac9-4643-6726-c696efaf5200",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",image_id:"e2024511-2c9b-46d7-3111-52df3d241700",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",image_id:"5b1cddfb-056e-4e78-029a-54de5d70c500",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",image_id:"dda0f0fb-34e8-4a57-dcea-b008e7d1ff00",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",image_id:"26a8f588-3231-4411-60ce-5bb6b805a700",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",image_id:"4725dda0-4471-4d0f-7adf-6bbe8b929c00",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",image_id:"61abe2ca-b06d-4a8b-de3e-8326f523e900",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",image_id:"c39b3a16-1a38-4588-f089-cb7aeb584700",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",image_id:"204b2240-5ce4-4996-6ec4-f06a22726900",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",image_id:"fc460647-ea95-447a-99f0-1bff8fa4be00",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",image_id:"f9854c79-14ba-4987-42e1-4a82abbf5700",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",image_id:"f78dab27-7165-4a3d-fdb1-fcff06c0a700",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",image_id:"79285c9f-2630-451e-0680-c71b42fb7400",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",image_id:"2d8006c3-852b-458a-d6b0-916c5ba76800",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",image_id:"339b9e9d-e2a7-46eb-4ed3-272321257a00",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",image_id:"cae1be94-9f53-4eba-b915-f6e381d5a500",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",image_id:"7eec7187-3f48-4fda-53bb-b0ad55749a00",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",image_id:"add9626b-a5fa-4c12-178c-e5584e6dcd00",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",image_id:"c268e78d-ffb0-4c8b-5cad-04c3add48500",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",image_id:"a7106965-91cc-4a73-4688-c5c72ae0ed00",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",image_id:"f90bc33f-f085-40cf-7538-fae5ae84f900",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",image_id:"691c0716-5213-4b99-e837-079268313800",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",image_id:"a5d9dd15-8cef-42de-8bed-09e01a8b0200",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",image_id:"b57b2163-1bd8-4f6b-3311-470767e6d200",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",image_id:"3ccbd966-97e8-45a0-1ceb-6141a8978e00",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",image_id:"6487869b-1165-4f30-aa3a-115665be8300",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",image_id:"10c75467-6612-48ad-b97b-63985e922200",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",image_id:"363fae03-882a-4d81-a721-6e6f6e9ac500",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",image_id:"32e89601-0490-42fc-0cc4-8627d62a2000",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",image_id:"98183be0-3125-45ee-a6b6-fbd47ebefd00",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",image_id:"75dd1471-77e9-4811-ce57-ec8fc980ec00",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",image_id:"374258d3-c749-4f37-7815-77e61f798c00",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",image_id:"ea0140c7-787c-43a4-838f-d5ab6a342000",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}}},Ga=(e,t="md")=>`https://registry.walletconnect.com/v2/logo/${t}/${e}`;function Ln(e){return{name:e.displayName||"",universalLink:e.mobile.universal||"",deepLink:e.mobile.native||""}}function Cd(e){let t="mobile";return Object.values(e).filter(o=>!!o[t].universal||!!o[t].native).map(o=>Ln(o))}function Ha(){return Cd(Fa)}function za(e,t){let o=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${o}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${e}`:""}function Va(e,t){return Ba?e:za(e,Ln(t))}var $a="WALLETCONNECT_DEEPLINK_CHOICE";function Ua(e){let t=e.href.split("?")[0];G.put($a,{...e,href:t})}var Ro=(e,t)=>{if(!e||bd){G.del($a);return}if(Ba){Ua({name:"Unknown",href:t||"wc:"});return}else if(wd){let o=za(t||"wc:",Ln(e));Ua({name:(e==null?void 0:e.displayName)||"",href:o})}};var Io=class extends ve{constructor(o,r){super(r||"unknown");this.connectorType="wallet_connect_v2";this.walletConnectCloudProjectId=o,this.proxyProvider=new H,this.createProvider().then(n=>{var i,a;if(this.provider=n,this.proxyProvider.setWalletProvider(n),this.subscribeListeners(),n.session){if((i=this.walletProvider.session)!=null&&i.peer.metadata.url){let l=Tr((a=this.walletProvider.session)==null?void 0:a.peer.metadata.url);this.walletEntry=l==null?void 0:l.entry,this.walletClientType=(l==null?void 0:l.walletClientType)||"unknown",Ro(this.walletEntry)}this.connected=!0,this.syncAccounts().then(()=>{this.emit("initialized"),this.initialized=!0})}else this.emit("initialized"),this.initialized=!0})}async connect(o){return o.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return this.walletProvider.connected}get walletBranding(){var o,r,n;return this.walletEntry?{name:this.walletEntry.displayName,icon:this.walletClientType==="metamask"?se:Ga(this.walletEntry.image_id)}:{name:kn(((o=this.walletProvider.session)==null?void 0:o.peer.metadata.name)||"")||"WalletConnect",icon:((n=(r=this.walletProvider.session)==null?void 0:r.peer.metadata.icons)==null?void 0:n[0])||Yt}}resetConnection(){this.walletProvider.connected&&(this.walletProvider.signer.session=void 0,this.walletEntry=void 0,Ro(void 0),this.onDisconnect())}async promptConnection(){if(!!this.provider)return new Promise((o,r)=>{let n=()=>{r(new Vt)};this.onQrModalClosed=n,(async()=>{var s,u;let a="",l=await Promise.race([this.walletProvider.enable(),Wn()]);if(l.length>0&&(a=l[0]),!a||a==="")throw new F("Unable to retrieve address");if((s=this.walletProvider.session)!=null&&s.peer.metadata.url){let h=Tr((u=this.walletProvider.session)==null?void 0:u.peer.metadata.url);this.walletEntry=h==null?void 0:h.entry,this.walletClientType=(h==null?void 0:h.walletClientType)||"unknown"}this.connected=!0,await this.syncAccounts(l),o()})().catch(a=>{if(a){r(Le(a));return}r(new F("Unknown error during connection"))}).finally(()=>Mn.close())})}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(){var n,i;let o={};for(let a of _o){let l=(i=(n=a.rpcUrls.infura)==null?void 0:n.http)==null?void 0:i[0];l&&(o[a.id]=l+"/"+Ft)}let r=await Ed.init({projectId:this.walletConnectCloudProjectId,chains:[1],optionalChains:_o.map(a=>a.id),rpcMap:o,showQrModal:!1});return r.on("display_uri",a=>{if(xd)window.open(a,"_self");else if(Td&&this.walletEntry){Ro(this.walletEntry,a);let s=Va(a,this.walletEntry);window.open(s,"_self","noopener,noreferrer")}else Mn.open(a,()=>{this.onQrModalClosed&&this.onQrModalClosed()},{mobileLinks:Ha().map(l=>l.name)})}),r.on("connect",()=>{var a,l;if(Mn.close(),(a=r.session)!=null&&a.peer.metadata.url){let s=Tr((l=r.session)==null?void 0:l.peer.metadata.url);this.walletEntry=s==null?void 0:s.entry,this.walletClientType=(s==null?void 0:s.walletClientType)||"unknown",Ro(this.walletEntry)}}),r}async enableProvider(){return this.walletProvider.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider.enable()}};var On=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses");return t?!!(e==null?void 0:e.linkedAccounts.filter(r=>r.type=="wallet"&&r.address===qa(t)).length):!1},Wo=class extends Pd{constructor(o){super();this.getEthereumProvider=()=>{let o=this.wallets[0],r=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===(o==null?void 0:o.address)));return!o||!r?new H:r.proxyProvider};this.walletConnectCloudProjectId=o,this.walletConnectors=[],this.initialized=!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}initialize(){this.initialized||(G.get(Pn)&&(G.getKeys().forEach(o=>{o.startsWith("walletconnect")&&G.del(o)}),G.del(Pn)),_a().then(o=>o.forEach(r=>{switch(r){case"metamask":this.createWalletConnector("injected","metamask");break;case"phantom":this.createWalletConnector("injected","phantom");break;case"unknown":default:break}})),(at()||G.getKeys().find(o=>o.startsWith("-walletlink")))&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),this.createWalletConnector("wallet_connect_v2","unknown"),this.initialized=!0)}findWalletConnector(o,r){return o==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===o)||null:this.walletConnectors.find(n=>n.connectorType===o&&n.walletClientType===r)||null}onInitialized(o){o.wallets.forEach(r=>{let n=this.storedConnections.find(i=>i.address===r.address&&i.connectorType===r.connectorType&&i.walletClientType===r.walletClientType);n&&(r.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated")}onWalletsUpdated(o){o.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(o,r){if(!this.findWalletConnector("embedded","privy")){let i=new yr(o,r),a=new wr(i);this.addWalletConnector(a)}}removeEmbeddedWalletConnector(){let o=this.findWalletConnector("embedded","privy");if(o){let r=this.walletConnectors.indexOf(o);this.walletConnectors.splice(r,1),this.saveConnectionHistory(),this.emit("walletsUpdated")}}async createWalletConnector(o,r){let n=this.findWalletConnector(o,r);if(n)return n instanceof Io&&n.resetConnection(),n;let a=(()=>{switch(o){case"injected":switch(r){case"phantom":return Pe()?new xr:null;case"metamask":default:return Ao()?new Cr:null}case"coinbase_wallet":return new br;case"wallet_connect_v2":return new Io(this.walletConnectCloudProjectId)}})();return a&&this.addWalletConnector(a),a||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=G.get(_n);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}));G.put(_n,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=qa(o),this.emit("walletsUpdated")}};function gr(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==null?void 0:r.address)!==(n==null?void 0:n.address)||(r==null?void 0:r.chainId)!==(n==null?void 0:n.chainId)||(r==null?void 0:r.connectorType)!==(n==null?void 0:n.connectorType)||(r==null?void 0:r.connectedAt)!==(n==null?void 0:n.connectedAt)||(r==null?void 0:r.walletClientType)!==(n==null?void 0:n.walletClientType)||(r==null?void 0:r.isConnected)!==(n==null?void 0:n.isConnected)||(r==null?void 0:r.linked)!==(n==null?void 0:n.linked))return!1}return!0}import{ofetch as _d}from"ofetch";var Ad=[cr(),dr()],Pr=class{constructor(t,o,r){this.appId=t,this.sdkVersion=En,this.client=o,this.defaults=r,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=_d.create({baseURL:this.defaults.baseURL,credentials:"include",onRequest:async({request:n,options:i})=>{let a=new Headers(i.headers);a.set("privy-app-id",this.appId),a.set("privy-client",`react-auth:${this.sdkVersion}`);let l=!Ad.includes(n.toString());if(!a.has("authorization")&&l){let s=await this.client.getAccessToken();s!==null&&a.set("authorization",`Bearer ${s}`)}i.headers=a,i.signal||(i.signal=AbortSignal.timeout(this.defaults.timeout))},onRequestError:({error:n})=>{if(n instanceof DOMException&&n.name==="AbortError")throw new lr}})}async get(t,o){try{return await this.baseFetch(t,o)}catch(r){throw J(r)}}async post(t,o,r){try{return await this.baseFetch(t,{method:"POST",...o?{body:o}:{},...r})}catch(n){throw J(n)}}async delete(t,o){try{return await this.baseFetch(t,{method:"DELETE",...o})}catch(r){throw J(r)}}};import _r from"js-cookie";function ja(e){return e instanceof yt?"email":e instanceof vt?"sms":e instanceof gt?"siwe":e instanceof nt?e.meta.provider:null}var De=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}};import*as Ka from"jose";var Ue=class{static parse(t){try{return new Ue(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Ka.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 Sd=30,Ar=class{constructor(){this.authenticateOnce=new De(async t=>this._authenticate(t)),this.linkOnce=new De(async t=>this._link(t)),this.refreshOnce=new De(this._refresh.bind(this)),this.destroyOnce=new De(this._destroy.bind(this)),this.forkSessionOnce=new De(this._forkSession.bind(this))}get token(){try{let t=G.get(Gt);return typeof t=="string"?new Ue(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=G.get(ur);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=G.get(Po);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}hasRefreshCredentials(){return typeof this.token=="string"&&typeof this.refreshToken=="string"}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Ue.parse(this.token);return t!==null&&!t.isExpired(Sd)}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=ja(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:Ke(n),isNewUser:i}}catch(o){throw console.warn("Error authenticating session"),xe(o)}}async _link(t){try{let o=await t.link();return Ke(o)}catch(o){throw console.warn("Error linking account"),xe(o)}}async _refresh(){if(!this.api)throw new P("Session has no API instance");if(!this.client)throw new P("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)n=await this.api.post(cr(),{refresh_token:o},{headers:{authorization:`Bearer ${t}`}}),r&&this.clearForkedToken();else if(r)n=await this.api.post(dr(),{refresh_token:r}),this.clearForkedToken();else return null;return this.storeToken(n.token),this.storeRefreshToken(n.refresh_token),Ke(n.user)}catch(n){if(n instanceof Ut&&n.status===400&&n.message==="Invalid auth token")return this.destroyLocalState(),null;throw xe(n)}}async _destroy(){var t;try{await((t=this.api)==null?void 0:t.post(Fi(),{refresh_token:this.refreshToken}))}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new P("Session has no API instance");let t=this.refreshToken;try{let o=await this.api.post(Gi(),{refresh_token:t});return this.storeToken(o.token),this.storeRefreshToken(o.refresh_token),o.new_session_refresh_token}catch(o){throw xe(o)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null),this.clearForkedToken()}storeToken(t){var o;if(typeof t=="string"){G.put(Gt,t);let r=(o=Ue.parse(t))==null?void 0:o.expiration;_r.set(xn,t,{sameSite:"Strict",secure:!0,expires:r?new Date(r*1e3):void 0})}else G.del(Gt),_r.remove(xn)}storeRefreshToken(t){typeof t=="string"?(G.put(ur,t),_r.set(Tn,t,{sameSite:"Strict",secure:!0,expires:30})):(G.del(ur),_r.remove(Tn))}clearForkedToken(){G.del(Po)}};var Dn,No=class{constructor(t){this.apiUrl=t.apiUrl||pr,this.fallbackApiUrl=this.apiUrl,this.timeout=t.timeout||sa,this.appId=t.appId,this.clientAnalyticsId=typeof window>"u"?null:crypto.randomUUID(),Dn||(Dn=new Ar),this.session=Dn,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager(t){this.connectors||(this.connectors=new Wo(t))}generateApi(){let t=new Pr(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()}authenticate(){if(!this.authFlow)throw new P("No auth flow in progress.");return this.session.authenticate(this.authFlow)}link(){if(!this.authFlow)throw new P("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}async unlinkEmail(t){try{let o=await this.api.post(ta(),{address:t});return Ke(o)}catch(o){throw xe(o)}}async unlinkPhone(t){try{let o=await this.api.post(oa(),{phoneNumber:t});return Ke(o)}catch(o){throw xe(o)}}async unlinkWallet(t){try{let o=await this.api.post(ea(),{address:t});return Ke(o)}catch(o){throw xe(o)}}async unlinkOAuth(t,o){try{let r=await this.api.post(ra(),{provider:t,subject:o});return Ke(r)}catch(r){throw xe(r)}}async createAnalyticsEvent(t,o,r){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.error("No client analytics id set, refusing to send analytics event"),await this.api.post(na(),{event_name:t,client_id:this.clientAnalyticsId,payload:{...o||{},clientTimestamp:r?r.toISOString():new Date().toISOString()}})}catch(n){console.error("Failed to create analytics event",n)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){var o;return this.session.hasActiveToken()?((o=Ue.parse(this.session.token))==null?void 0:o.audience)!==this.appId?(await this.logout(),null):this.session.token:!(t!=null&&t.disableAutoRefresh)&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){var t,o;try{let r=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl});return{id:r.id,name:r.name,verificationKey:r.verification_key,logoUrl:r.logo_url||void 0,accentColor:r.accent_color||void 0,showWalletLoginFirst:r.show_wallet_login_first,allowlistConfig:{errorTitle:r.allowlist_config.error_title,errorDetail:r.allowlist_config.error_detail,errorCtaText:r.allowlist_config.cta_text,errorCtaLink:r.allowlist_config.cta_link},walletAuth:r.wallet_auth,emailAuth:r.email_auth,smsAuth:r.sms_auth,googleOAuth:r.google_oauth,twitterOAuth:r.twitter_oauth,discordOAuth:r.discord_oauth,githubOAuth:r.github_oauth,appleOAuth:r.apple_oauth,termsAndConditionsUrl:r.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:(t=r.embedded_wallet_config)==null?void 0:t.create_on_login,requireUserPasswordOnCreate:(o=r.embedded_wallet_config)==null?void 0:o.require_user_password_on_create},privacyPolicyUrl:r.privacy_policy_url,customApiUrl:r.custom_api_url,walletConnectCloudProjectId:r.wallet_connect_cloud_project_id,createdAt:new Date(r.created_at*1e3),updatedAt:new Date(r.updated_at*1e3)}}catch(r){throw xe(r)}}async getUsdTokenPrice(t){try{return(await this.api.get(`/api/v1/token_price?chainId=${t}`)).usd}catch{console.error(`Unable to fetch token price for chain with id ${t}`);return}}async forkSession(){return await this.session.forkSession()}};import"wicg-inert";import{disableBodyScroll as Zh,clearAllBodyScrollLocks as Jh}from"body-scroll-lock";import{useRef as Xh,useCallback as ef}from"react";import{useEffect as Mc}from"react";import tf from"react-dom";import Oi from"styled-components";import{createContext as kd,useContext as Rd}from"react";var Un=kd({isNewUserThisSession:!1,isLinking:!1,linkingHint:null,walletConnectionStatus:null,getAuthMeta:x,getAuthFlow:x,closePrivyModal:x,connectWallet:x,initLoginWithWallet:x,loginWithWallet:x,loginWithCode:x,initLoginWithEmail:x,initLoginWithSms:x,resendEmailCode:x,resendSmsCode:x,initLoginWithOAuth:x,loginWithOAuth:x,refreshUser:x,walletProxy:null,createAnalyticsEvent:x,getUsdTokenPrice:x,recoverEmbeddedWallet:x}),I=()=>Rd(Un);import{createContext as Id,useContext as Wd}from"react";var Bn=Id({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:x,login:x,linkEmail:x,linkPhone:x,linkWallet:x,linkGoogle:x,linkTwitter:x,linkDiscord:x,linkGithub:x,linkApple:x,logout:x,getAccessToken:x,getEthereumProvider:x,getEthersProvider:x,getWeb3jsProvider:x,unlinkEmail:x,unlinkPhone:x,unlinkWallet:x,unlinkGoogle:x,unlinkTwitter:x,unlinkDiscord:x,unlinkGithub:x,unlinkApple:x,setActiveWallet:x,forkSession:x,createWallet:x,signMessage:x,sendTransaction:x,exportWallet:x}),B=()=>Wd(Bn);import Vn from"styled-components";import Mo,{css as Ya}from"styled-components";import Gn from"styled-components";import{Fragment as Md,jsx as Fn,jsxs as Od}from"react/jsx-runtime";var Sr=({success:e,fail:t})=>Od(Md,{children:[Fn(Lo,{className:e?"success":t?"fail":""}),Fn(Nd,{className:e?"success":t?"fail":""})]}),Lo=Gn.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
- `,Nd=Gn(No)`
45
+ `,Nd=Gn(Lo)`
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
- `,Ie=e=>Fn(Ld,{color:e.color||"var(--privy-color-background-2)"}),Ld=Gn(No)`
51
+ `,Ie=e=>Fn(Ld,{color:e.color||"var(--privy-color-background-2)"}),Ld=Gn(Lo)`
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 Ze,jsxs as Hn}from"react/jsx-runtime";var Qa=Lo.button`
60
+ `;import{jsx as Ze,jsxs as Hn}from"react/jsx-runtime";var Qa=Mo.button`
61
61
  display: flex;
62
62
  flex-direction: row;
63
63
  align-items: center;
@@ -79,7 +79,7 @@ Resources:
79
79
  color: var(--privy-color-foreground-3);
80
80
  cursor: not-allowed;
81
81
  }
82
- `,q=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>Ze(Za,{disabled:t||o,...n,children:t?Hn("span",{children:[Ze(Ie,{}),r?Ze("span",{children:r}):null]}):e}),kr=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>Ze(Za,{as:"a",disabled:t||o,...n,children:t?Hn("span",{children:[Ze(Ie,{}),r?Ze("span",{children:r}):null]}):e}),Za=Lo(Qa)`
82
+ `,q=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>Ze(Za,{disabled:t||o,...n,children:t?Hn("span",{children:[Ze(Ie,{}),r?Ze("span",{children:r}):null]}):e}),kr=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>Ze(Za,{as:"a",disabled:t||o,...n,children:t?Hn("span",{children:[Ze(Ie,{}),r?Ze("span",{children:r}):null]}):e}),Za=Mo(Qa)`
83
83
  && {
84
84
  background-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-accent)"};
85
85
  color: var(--privy-color-foreground-accent);
@@ -122,7 +122,7 @@ Resources:
122
122
  opacity: 1;
123
123
  animation: fadein 200ms ease;
124
124
  }
125
- `,Ja=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>Ze(Dd,{disabled:t||o,...n,children:t?Hn("span",{children:[Ze(Ie,{}),r?Ze("span",{children:r}):null]}):e}),Dd=Lo(Qa)`
125
+ `,Ja=({children:e,loading:t,disabled:o,loadingText:r="Loading...",...n})=>Ze(Dd,{disabled:t||o,...n,children:t?Hn("span",{children:[Ze(Ie,{}),r?Ze("span",{children:r}):null]}):e}),Dd=Mo(Qa)`
126
126
  && {
127
127
  border-width: 1px;
128
128
  border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"};
@@ -151,7 +151,7 @@ Resources:
151
151
  opacity: 1;
152
152
  animation: fadein 200ms ease;
153
153
  }
154
- `,ie=Lo.button`
154
+ `,ie=Mo.button`
155
155
  && {
156
156
  padding: 12px 16px;
157
157
  font-weight: 500;
@@ -182,7 +182,7 @@ Resources:
182
182
  cursor: not-allowed;
183
183
  }
184
184
  }
185
- `,Rr=Lo.div`
185
+ `,Rr=Mo.div`
186
186
  /* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
187
187
  height: 44px;
188
188
  `;import Ud from"styled-components";var Xa=Ud.span`
@@ -299,7 +299,7 @@ Resources:
299
299
  left: -19px;
300
300
  top: -19px;
301
301
  }
302
- `;import{useEffect as ds,useState as Mr}from"react";import{isMobile as ep}from"react-device-detect";import Mo from"styled-components";import Wr from"styled-components";var ce=Wr.div`
302
+ `;import{useEffect as ds,useState as Mr}from"react";import{isMobile as ep}from"react-device-detect";import Oo from"styled-components";import Wr from"styled-components";var ce=Wr.div`
303
303
  display: flex;
304
304
  flex-direction: column;
305
305
  align-items: flex-start;
@@ -390,7 +390,7 @@ Resources:
390
390
  border-color: var(--privy-color-background-2);
391
391
  border-width: 1px;
392
392
  }
393
- `;import{Fragment as $n,jsx as we,jsxs as Et}from"react/jsx-runtime";var qn=6,ps=new Array(qn).fill(""),tp=1400;var us=()=>{var z,ae,V;let{app:e,navigate:t,setModalData:o}=v(),{closePrivyModal:r,resendEmailCode:n,resendSmsCode:i,getAuthMeta:a,loginWithCode:l}=I(),{authenticated:s,user:u}=B(),[h,C]=Mr(ps),[b,m]=Mr(!1),[f,p]=Mr(null),[w,A]=Mr(null),W=(z=a())!=null&&z.email?0:1,E=e!=null&&e.render.inDialog?Re:0,S=e!=null&&e.render.inDialog?E-500:0;ds(()=>{var U;if(!!(s&&b&&u))if(Bt(u,(U=e==null?void 0:e.embeddedWallets)==null?void 0:U.createOnLogin)){let O=setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:j=>console.error(j),callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_SCREEN")},S);return()=>clearTimeout(O)}else{let O=setTimeout(r,E);return()=>clearTimeout(O)}},[s,b,u]),ds(()=>{if(f&&w===0){let k=setTimeout(()=>{C(ps),p(null);let U=document.querySelector("input[name=code-0]");U==null||U.focus()},tp);return()=>clearTimeout(k)}},[f]);let R=k=>{var oe;let U=k.currentTarget.value.replace(" ","");if(U==="")return;if(isNaN(Number(U))){p("Code should be numeric"),A(1);return}p(null),A(null);let O=Number((oe=k.currentTarget.name)==null?void 0:oe.charAt(5)),j=[...U||[""]].slice(0,qn-O),te=[...h.slice(0,O),...j,...h.slice(O+j.length)];C(te);let tt=j.length,ot=Math.min(Math.max(O+tt,0),qn-1);if(!isNaN(Number(k.currentTarget.value))){let re=document.querySelector(`input[name=code-${ot}]`);re==null||re.focus()}if(te.every(re=>re&&!isNaN(+re))){let re=document.querySelector(`input[name=code-${ot}]`);re==null||re.blur(),l(te.join("")).then(()=>m(!0)).catch(rt=>{(rt==null?void 0:rt.status)===422?p("Invalid or expired verification code"):p("Issue verifying code"),A(0)})}k.preventDefault()},L=k=>{w===1&&(p(null),A(null));let U=[...h.slice(0,k),"",...h.slice(k+1)];if(C(U),k>0){let O=document.querySelector(`input[name=code-${k-1}]`);O==null||O.focus()}},N=`Verify your ${W==0?"email":"phone"}`,ne=W==0?Et("p",{children:["Please check ",we(ap,{children:(ae=a())==null?void 0:ae.email})," for an email from privy.io and enter your code below."]}):`Please check ${(V=a())==null?void 0:V.phoneNumber} for a message from ${(e==null?void 0:e.name)||"privy.io"} and enter your code below.`;return Et($n,{children:[we(T,{},"header"),Et(op,{children:[we(de,{title:N,description:ne}),Et(Ct,{children:[Et(rp,{children:[we(np,{fail:!!f,success:b,children:we("span",{children:f||(b?"Success!":"")})}),we("div",{children:h.map((k,U)=>we("input",{name:`code-${U}`,type:"text",value:h[U],onChange:R,onKeyUp:O=>{O.key==="Backspace"&&L(U)},inputMode:"numeric",autoFocus:U===0,pattern:"[0-9]",className:`${b?"success":""} ${f?"fail":""}`,autoComplete:ep?"one-time-code":"off"},U))})]}),we(ip,{children:W==0?Et($n,{children:[we("span",{children:"Didn't get an email?"}),we("button",{onClick:n,children:"Resend Code"})]}):Et($n,{children:[we("span",{children:"Didn't get a message?"}),we("button",{onClick:i,children:"Resend Code"})]})})]})]}),we(D,{protectedByPrivy:!0})]})},op=Mo.div`
393
+ `;import{Fragment as $n,jsx as we,jsxs as Et}from"react/jsx-runtime";var qn=6,ps=new Array(qn).fill(""),tp=1400;var us=()=>{var z,ae,V;let{app:e,navigate:t,setModalData:o}=v(),{closePrivyModal:r,resendEmailCode:n,resendSmsCode:i,getAuthMeta:a,loginWithCode:l}=I(),{authenticated:s,user:u}=B(),[h,C]=Mr(ps),[b,m]=Mr(!1),[f,p]=Mr(null),[w,A]=Mr(null),W=(z=a())!=null&&z.email?0:1,E=e!=null&&e.render.inDialog?Re:0,S=e!=null&&e.render.inDialog?E-500:0;ds(()=>{var U;if(!!(s&&b&&u))if(Bt(u,(U=e==null?void 0:e.embeddedWallets)==null?void 0:U.createOnLogin)){let O=setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:j=>console.error(j),callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_SCREEN")},S);return()=>clearTimeout(O)}else{let O=setTimeout(r,E);return()=>clearTimeout(O)}},[s,b,u]),ds(()=>{if(f&&w===0){let k=setTimeout(()=>{C(ps),p(null);let U=document.querySelector("input[name=code-0]");U==null||U.focus()},tp);return()=>clearTimeout(k)}},[f]);let R=k=>{var oe;let U=k.currentTarget.value.replace(" ","");if(U==="")return;if(isNaN(Number(U))){p("Code should be numeric"),A(1);return}p(null),A(null);let O=Number((oe=k.currentTarget.name)==null?void 0:oe.charAt(5)),j=[...U||[""]].slice(0,qn-O),te=[...h.slice(0,O),...j,...h.slice(O+j.length)];C(te);let tt=j.length,ot=Math.min(Math.max(O+tt,0),qn-1);if(!isNaN(Number(k.currentTarget.value))){let re=document.querySelector(`input[name=code-${ot}]`);re==null||re.focus()}if(te.every(re=>re&&!isNaN(+re))){let re=document.querySelector(`input[name=code-${ot}]`);re==null||re.blur(),l(te.join("")).then(()=>m(!0)).catch(rt=>{(rt==null?void 0:rt.status)===422?p("Invalid or expired verification code"):p("Issue verifying code"),A(0)})}k.preventDefault()},L=k=>{w===1&&(p(null),A(null));let U=[...h.slice(0,k),"",...h.slice(k+1)];if(C(U),k>0){let O=document.querySelector(`input[name=code-${k-1}]`);O==null||O.focus()}},N=`Verify your ${W==0?"email":"phone"}`,ne=W==0?Et("p",{children:["Please check ",we(ap,{children:(ae=a())==null?void 0:ae.email})," for an email from privy.io and enter your code below."]}):`Please check ${(V=a())==null?void 0:V.phoneNumber} for a message from ${(e==null?void 0:e.name)||"privy.io"} and enter your code below.`;return Et($n,{children:[we(T,{},"header"),Et(op,{children:[we(de,{title:N,description:ne}),Et(Ct,{children:[Et(rp,{children:[we(np,{fail:!!f,success:b,children:we("span",{children:f||(b?"Success!":"")})}),we("div",{children:h.map((k,U)=>we("input",{name:`code-${U}`,type:"text",value:h[U],onChange:R,onKeyUp:O=>{O.key==="Backspace"&&L(U)},inputMode:"numeric",autoFocus:U===0,pattern:"[0-9]",className:`${b?"success":""} ${f?"fail":""}`,autoComplete:ep?"one-time-code":"off"},U))})]}),we(ip,{children:W==0?Et($n,{children:[we("span",{children:"Didn't get an email?"}),we("button",{onClick:n,children:"Resend Code"})]}):Et($n,{children:[we("span",{children:"Didn't get a message?"}),we("button",{onClick:i,children:"Resend Code"})]})})]})]}),we(D,{protectedByPrivy:!0})]})},op=Oo.div`
394
394
  display: flex;
395
395
  flex-direction: column;
396
396
  align-items: flex-start;
@@ -398,7 +398,7 @@ Resources:
398
398
  margin: auto;
399
399
  gap: 16px;
400
400
  flex-grow: 1;
401
- `,rp=Mo.div`
401
+ `,rp=Oo.div`
402
402
  display: flex;
403
403
  flex-direction: column;
404
404
  width: 100%;
@@ -466,7 +466,7 @@ Resources:
466
466
  transform: translate(1px, 0px);
467
467
  }
468
468
  }
469
- `,np=Mo.div`
469
+ `,np=Oo.div`
470
470
  line-height: 20px;
471
471
  height: 20px;
472
472
  font-size: 13px;
@@ -474,7 +474,7 @@ Resources:
474
474
  display: flex;
475
475
  justify-content: flex-end;
476
476
  width: 100%;
477
- `,ip=Mo.div`
477
+ `,ip=Oo.div`
478
478
  font-size: 13px;
479
479
  color: var(--privy-color-foreground-3);
480
480
  display: flex;
@@ -488,7 +488,7 @@ Resources:
488
488
  > button {
489
489
  text-decoration: underline;
490
490
  }
491
- `,ap=Mo.span`
491
+ `,ap=Oo.span`
492
492
  word-break: break-all;
493
493
  `;import{useEffect as lp,useState as cp}from"react";import dp from"styled-components";import{isMobile as sp}from"react-device-detect";var ms=e=>{let t=new URL(window.location.href);if(!at()&&sp)return`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(`${t.href.replace(/\/$/g,"")}?privy_connector=coinbase_wallet&privy_wallet_client=coinbase_wallet${e?`&privy_token=${e}`:""}`)}`};import{Fragment as up,jsx as xt,jsxs as hs}from"react/jsx-runtime";var fs=()=>{let{forkSession:e,ready:t,authenticated:o}=B(),{closePrivyModal:r}=I(),[n,i]=cp("");lp(()=>{t&&o&&e().then(s=>i(s))},[o,t]);let a=ms(n),l={title:"Redirecting to Coinbase Wallet",description:"We'll take you to the Coinbase Wallet app to continue your login experience.",footnote:""};return t&&o&&(l.description="For the best experience, we'll automatically log you into the Coinbase Wallet in-app browser.",l.footnote="Once you're done, you can always return here and refresh to view your updated account."),hs(up,{children:[xt(T,{},"header"),xt(Ge,{title:l.title,description:l.description}),hs(ce,{children:[xt(pp,{children:xt(_e,{style:{width:"72px",height:"72px"}})}),xt(kr,{href:a,onClick:()=>{r()},loading:t&&o&&!n,children:"Continue"}),l.footnote?xt("p",{children:l.footnote}):null]}),xt(D,{protectedByPrivy:!0})]})},pp=dp(Ct)`
494
494
  margin: 16px auto;
@@ -496,7 +496,7 @@ Resources:
496
496
  @media (max-width: 440px) {
497
497
  display: none;
498
498
  }
499
- `;import{jsx as Se,jsxs as eo}from"react/jsx-runtime";var dt=({connectOnly:e})=>{let{navigate:t}=v(),{initLoginWithWallet:o,connectWallet:r}=I();return eo(hp,{children:[eo(Dr,{onClick:()=>{_o()?e?(r("injected","metamask"),t("AWAITING_CONNECT_ONLY_CONNECTION")):(o("injected","metamask"),t("AWAITING_CONNECTION")):Or?e?(r("wallet_connect_v2","metamask"),t("AWAITING_CONNECT_ONLY_CONNECTION")):(o("wallet_connect_v2","metamask"),t("AWAITING_CONNECTION")):t("INSTALL_METAMASK_SCREEN")},children:[Se(se,{}),Se("span",{children:"Metamask"}),Se("span",{children:_o()?"Connect":"Install"})]}),eo(Dr,{onClick:()=>{at()?e?(r("coinbase_wallet","coinbase_wallet"),t("AWAITING_CONNECT_ONLY_CONNECTION")):(o("coinbase_wallet","coinbase_wallet"),t("AWAITING_CONNECTION")):Or?t("COINBASE_INTERSTITIAL_SCREEN"):e?(r("coinbase_wallet","coinbase_wallet"),t("AWAITING_CONNECT_ONLY_CONNECTION")):(o("coinbase_wallet","coinbase_wallet"),t("AWAITING_CONNECTION"))},children:[Se(_e,{}),eo("span",{children:["Coinbase",Se(ys,{children:" Wallet"})]}),Se("span",{children:"Connect"})]}),(Or||Pe())&&eo(Dr,{id:"privy-phantom-button",onClick:()=>{Pe()?e?(r("injected","phantom"),t("AWAITING_CONNECT_ONLY_CONNECTION")):(o("injected","phantom"),t("AWAITING_CONNECTION")):t(Or?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")},children:[Se(Oe,{}),Se("span",{children:"Phantom"}),Se("span",{children:Pe()?"Connect":"Install"})]}),eo(Dr,{onClick:()=>{e?(r("wallet_connect_v2","unknown"),t("AWAITING_CONNECT_ONLY_CONNECTION")):(o("wallet_connect_v2","unknown"),t("AWAITING_CONNECTION"))},children:[Se(Yt,{}),Se("span",{children:"WalletConnect"}),Se("span",{children:"Connect"})]})]})},hp=gs.div`
499
+ `;import{jsx as Se,jsxs as eo}from"react/jsx-runtime";var dt=({connectOnly:e})=>{let{navigate:t}=v(),{initLoginWithWallet:o,connectWallet:r}=I();return eo(hp,{children:[eo(Dr,{onClick:()=>{Ao()?e?(r("injected","metamask"),t("AWAITING_CONNECT_ONLY_CONNECTION")):(o("injected","metamask"),t("AWAITING_CONNECTION")):Or?e?(r("wallet_connect_v2","metamask"),t("AWAITING_CONNECT_ONLY_CONNECTION")):(o("wallet_connect_v2","metamask"),t("AWAITING_CONNECTION")):t("INSTALL_METAMASK_SCREEN")},children:[Se(se,{}),Se("span",{children:"Metamask"}),Se("span",{children:Ao()?"Connect":"Install"})]}),eo(Dr,{onClick:()=>{at()?e?(r("coinbase_wallet","coinbase_wallet"),t("AWAITING_CONNECT_ONLY_CONNECTION")):(o("coinbase_wallet","coinbase_wallet"),t("AWAITING_CONNECTION")):Or?t("COINBASE_INTERSTITIAL_SCREEN"):e?(r("coinbase_wallet","coinbase_wallet"),t("AWAITING_CONNECT_ONLY_CONNECTION")):(o("coinbase_wallet","coinbase_wallet"),t("AWAITING_CONNECTION"))},children:[Se(_e,{}),eo("span",{children:["Coinbase",Se(ys,{children:" Wallet"})]}),Se("span",{children:"Connect"})]}),(Or||Pe())&&eo(Dr,{id:"privy-phantom-button",onClick:()=>{Pe()?e?(r("injected","phantom"),t("AWAITING_CONNECT_ONLY_CONNECTION")):(o("injected","phantom"),t("AWAITING_CONNECTION")):t(Or?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")},children:[Se(Oe,{}),Se("span",{children:"Phantom"}),Se("span",{children:Pe()?"Connect":"Install"})]}),eo(Dr,{onClick:()=>{e?(r("wallet_connect_v2","unknown"),t("AWAITING_CONNECT_ONLY_CONNECTION")):(o("wallet_connect_v2","unknown"),t("AWAITING_CONNECTION"))},children:[Se(Yt,{}),Se("span",{children:"WalletConnect"}),Se("span",{children:"Connect"})]})]})},hp=gs.div`
500
500
  display: flex;
501
501
  flex-direction: column;
502
502
  align-items: flex-start;
@@ -566,7 +566,7 @@ Resources:
566
566
  @media (max-width: 440px) {
567
567
  margin-top: 4px;
568
568
  }
569
- `;import{Fragment as vp,jsx as Oo,jsxs as bs}from"react/jsx-runtime";var ws=()=>{let{app:e}=v(),t=`Connect a wallet to ${e==null?void 0:e.name}`;return bs(vp,{children:[Oo(T,{},"header"),Oo(Ge,{title:"Connect your wallet",description:t}),bs(ce,{children:[Oo(dt,{connectOnly:!0}),Oo(pt,{})]}),Oo(D,{protectedByPrivy:!0})]})};import jn from"styled-components";import bp from"react";import{jsx as Cs}from"react/jsx-runtime";var Ur=()=>{var a;let{app:e}=v(),t=(a=e==null?void 0:e.appearance)==null?void 0:a.logo,o=`${e==null?void 0:e.name} logo`,r={maxHeight:"50px"},n="100%",i="auto";return t?typeof t=="string"?Cs("div",{children:Cs("img",{height:n,width:i,src:t,alt:o,style:r})}):t.type==="svg"||t.type==="img"?bp.cloneElement(t,{height:n,width:i,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{Fragment as xp,jsx as Je,jsxs as Es}from"react/jsx-runtime";var xs=()=>{let{app:e}=v();return Es(xp,{children:[Je(T,{},"header"),Je(Ep,{hasTerms:!!((e==null?void 0:e.legal.privacyPolicyUrl)||(e==null?void 0:e.legal.termsAndConditionsUrl)),children:Je(Ur,{})}),Es(Cp,{children:[Je(wp,{children:Je("h4",{children:"Connect Wallet"})}),Je(dt,{connectOnly:!0}),Je(pt,{})]}),e&&Je(Nr,{app:e}),Je(D,{protectedByPrivy:!0})]})},wp=jn.div`
569
+ `;import{Fragment as vp,jsx as Do,jsxs as bs}from"react/jsx-runtime";var ws=()=>{let{app:e}=v(),t=`Connect a wallet to ${e==null?void 0:e.name}`;return bs(vp,{children:[Do(T,{},"header"),Do(Ge,{title:"Connect your wallet",description:t}),bs(ce,{children:[Do(dt,{connectOnly:!0}),Do(pt,{})]}),Do(D,{protectedByPrivy:!0})]})};import jn from"styled-components";import bp from"react";import{jsx as Cs}from"react/jsx-runtime";var Ur=()=>{var a;let{app:e}=v(),t=(a=e==null?void 0:e.appearance)==null?void 0:a.logo,o=`${e==null?void 0:e.name} logo`,r={maxHeight:"50px"},n="100%",i="auto";return t?typeof t=="string"?Cs("div",{children:Cs("img",{height:n,width:i,src:t,alt:o,style:r})}):t.type==="svg"||t.type==="img"?bp.cloneElement(t,{height:n,width:i,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{Fragment as xp,jsx as Je,jsxs as Es}from"react/jsx-runtime";var xs=()=>{let{app:e}=v();return Es(xp,{children:[Je(T,{},"header"),Je(Ep,{hasTerms:!!((e==null?void 0:e.legal.privacyPolicyUrl)||(e==null?void 0:e.legal.termsAndConditionsUrl)),children:Je(Ur,{})}),Es(Cp,{children:[Je(wp,{children:Je("h4",{children:"Connect Wallet"})}),Je(dt,{connectOnly:!0}),Je(pt,{})]}),e&&Je(Nr,{app:e}),Je(D,{protectedByPrivy:!0})]})},wp=jn.div`
570
570
  font-weight: 600;
571
571
  color: 'var(--privy-color-foreground)';
572
572
  display: flex;
@@ -602,7 +602,7 @@ Resources:
602
602
  @media (max-width: 440px) {
603
603
  padding: 10px 10px 20px;
604
604
  }
605
- `;import{useEffect as _s,useState as As}from"react";import Ss from"styled-components";import{useEffect as Kn,useState as Do}from"react";import{isMobile as Yn}from"react-device-detect";import Qn from"styled-components";import{Fragment as Ps,jsx as me,jsxs as Fr}from"react/jsx-runtime";var Br=2,Uo={metamask:{name:"MetaMask",component:se},phantom:{name:"Phantom",component:Oe},coinbase_wallet:{name:"Coinbase Wallet",component:_e},wallet_connect:{name:"WalletConnect",component:Yt},embedded:{name:"Privy Wallet",component:qt}},Zn=e=>(e==null?void 0:e.privyErrorCode)==="linked_to_another_user"?Ye.ERROR_USER_EXISTS:e instanceof $t&&!e.details.default?e.details:e instanceof zt?Ye.ERROR_TIMED_OUT:e instanceof Vt?Ye.ERROR_USER_REJECTED_CONNECTION:Ye.ERROR_WALLET_CONNECTION,Ts=()=>{var ot,oe,re,rt,Lt,Co,Mt,nr,Eo,ir,ar;let[e,t]=Do(!1),[o,r]=Do(!1),[n,i]=Do(void 0),{app:a,navigate:l,navigateBack:s,lastScreen:u,currentScreen:h,setModalData:C}=v(),{getAuthFlow:b,walletConnectionStatus:m,closePrivyModal:f,loginWithWallet:p}=I(),{walletConnectors:w}=B(),[A,W]=Do(0),{user:E}=B(),[S]=Do((E==null?void 0:E.linkedAccounts.length)||0),R=b(),L=Yn&&((ot=m==null?void 0:m.connector)==null?void 0:ot.connectorType)==="wallet_connect_v2"||Yn&&((oe=m==null?void 0:m.connector)==null?void 0:oe.connectorType)==="coinbase_wallet"||Yn&&((re=m==null?void 0:m.connector)==null?void 0:re.connectorType)==="injected"&&((rt=m==null?void 0:m.connector)==null?void 0:rt.walletClientType)==="phantom",N=(m==null?void 0:m.status)==="connected";Kn(()=>{if(R&&L&&N&&!R.preparedMessage){R.buildSiweMessage();return}!R||L||!N||(r(!0),i(void 0),z().catch(Q=>console.warn("Auto-prompted signature failed",Q)).finally(()=>r(!1)))},[A,N]),Kn(()=>{var Q;if(E&&e){let ft;if(Bt(E,(Q=a==null?void 0:a.embeddedWallets)==null?void 0:Q.createOnLogin)){let wn=a!=null&&a.render.inDialog?Re:0,xo=a!=null&&a.render.inDialog?wn-500:0;ft=setTimeout(()=>{C({createWallet:{onSuccess:()=>{},onFailure:Bi=>console.error(Bi),callAuthOnSuccessOnClose:!0}}),l("EMBEDDED_WALLET_SCREEN")},xo)}else ft=setTimeout(f,Re);return()=>clearTimeout(ft)}},[E,e]);let ne=Q=>{if((Q==null?void 0:Q.privyErrorCode)==="allowlist_rejected"){l("ALLOWLIST_REJECTION_SCREEN");return}i(Zn(Q))};async function z(){try{if(await p(),!(a!=null&&a.render.inDialog))return f();t(!0)}catch(Q){ne(Q)}finally{r(!1)}}Kn(()=>{m!=null&&m.connectError&&ne(m==null?void 0:m.connectError)},[m]);let ae=((Lt=m==null?void 0:m.connector)==null?void 0:Lt.connectorType)||"metamask",V=((Co=m==null?void 0:m.connector)==null?void 0:Co.walletClientType)||"metamask",k=((Mt=m==null?void 0:m.connector)==null?void 0:Mt.walletBranding.name)||((nr=Uo[V])==null?void 0:nr.name)||"Metamask",U=((Eo=m==null?void 0:m.connector)==null?void 0:Eo.walletBranding.icon)||((ir=Uo[V])==null?void 0:ir.component)||(Q=>me(se,{...Q})),O=e?`Successfully connected with ${k}`:n?n.message:N?o&&L?"Signing":"Sign to verify":`Waiting for ${k}`,j="Don\u2019t see your wallet modal? Check your other browser windows.";if(e){let Q=(E==null?void 0:E.linkedAccounts.length)||0;S===Q?j="Wallet was already linked.":j="You\u2019re good to go!"}else A>=Br&&n?j="Unable to connect wallet":n?j=n.detail:N&&L?j="Sign the message in your wallet to verify it belongs to you.":V==="metamask"?j="For the best experience, connect only one wallet at a time.":ae==="wallet_connect"?j="Open your mobile wallet app to continue":ae==="coinbase_wallet"&&(at()||(On(E)?j="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":j="Open the Coinbase app on your phone to continue."));let te=(ar=w==null?void 0:w.walletConnectors)==null?void 0:ar.find(Q=>Q.walletClientType==="coinbase_wallet"),tt=V==="coinbase_wallet"&&(On(E)||n===Ye.ERROR_USER_EXISTS);return Fr(Ps,{children:[me(T,{backFn:h===u?void 0:s}),Fr(Tp,{children:[me(Jn,{walletLogo:U,success:e,fail:!!n}),Fr(Pp,{children:[me("h3",{children:O}),me("p",{children:j})]}),me(Rr,{children:tt?me(ie,{onClick:()=>te&&(te==null?void 0:te.disconnect()),invisible:e,disabled:e,children:"Use a different wallet"}):n==Ye.ERROR_USER_EXISTS&&h!==u?me(ie,{onClick:s,children:"Use a different wallet"}):N&&!e&&L?me(ie,{onClick:()=>{r(!0),z()},disabled:o,children:o?"Signing":"Sign with your wallet"}):!e&&(n==null?void 0:n.retryable)&&A<Br?me(ie,{onClick:()=>{W(A+1),i(void 0),N?(r(!0),z()):m==null||m.connectRetry()},invisible:e||!(n!=null&&n.retryable)||A>=Br,disabled:!e&&(!(n!=null&&n.retryable)||A>=Br),children:"Retry"}):null})]})]})},Tp=Qn.div`
605
+ `;import{useEffect as _s,useState as As}from"react";import Ss from"styled-components";import{useEffect as Kn,useState as Uo}from"react";import{isMobile as Yn}from"react-device-detect";import Qn from"styled-components";import{Fragment as Ps,jsx as me,jsxs as Fr}from"react/jsx-runtime";var Br=2,Bo={metamask:{name:"MetaMask",component:se},phantom:{name:"Phantom",component:Oe},coinbase_wallet:{name:"Coinbase Wallet",component:_e},wallet_connect:{name:"WalletConnect",component:Yt},embedded:{name:"Privy Wallet",component:qt}},Zn=e=>(e==null?void 0:e.privyErrorCode)==="linked_to_another_user"?Ye.ERROR_USER_EXISTS:e instanceof $t&&!e.details.default?e.details:e instanceof zt?Ye.ERROR_TIMED_OUT:e instanceof Vt?Ye.ERROR_USER_REJECTED_CONNECTION:Ye.ERROR_WALLET_CONNECTION,Ts=()=>{var ot,oe,re,rt,Lt,Co,Mt,ir,Eo,ar,sr;let[e,t]=Uo(!1),[o,r]=Uo(!1),[n,i]=Uo(void 0),{app:a,navigate:l,navigateBack:s,lastScreen:u,currentScreen:h,setModalData:C}=v(),{getAuthFlow:b,walletConnectionStatus:m,closePrivyModal:f,loginWithWallet:p}=I(),{walletConnectors:w}=B(),[A,W]=Uo(0),{user:E}=B(),[S]=Uo((E==null?void 0:E.linkedAccounts.length)||0),R=b(),L=Yn&&((ot=m==null?void 0:m.connector)==null?void 0:ot.connectorType)==="wallet_connect_v2"||Yn&&((oe=m==null?void 0:m.connector)==null?void 0:oe.connectorType)==="coinbase_wallet"||Yn&&((re=m==null?void 0:m.connector)==null?void 0:re.connectorType)==="injected"&&((rt=m==null?void 0:m.connector)==null?void 0:rt.walletClientType)==="phantom",N=(m==null?void 0:m.status)==="connected";Kn(()=>{if(R&&L&&N&&!R.preparedMessage){R.buildSiweMessage();return}!R||L||!N||(r(!0),i(void 0),z().catch(Q=>console.warn("Auto-prompted signature failed",Q)).finally(()=>r(!1)))},[A,N]),Kn(()=>{var Q;if(E&&e){let ft;if(Bt(E,(Q=a==null?void 0:a.embeddedWallets)==null?void 0:Q.createOnLogin)){let wn=a!=null&&a.render.inDialog?Re:0,xo=a!=null&&a.render.inDialog?wn-500:0;ft=setTimeout(()=>{C({createWallet:{onSuccess:()=>{},onFailure:Bi=>console.error(Bi),callAuthOnSuccessOnClose:!0}}),l("EMBEDDED_WALLET_SCREEN")},xo)}else ft=setTimeout(f,Re);return()=>clearTimeout(ft)}},[E,e]);let ne=Q=>{if((Q==null?void 0:Q.privyErrorCode)==="allowlist_rejected"){l("ALLOWLIST_REJECTION_SCREEN");return}i(Zn(Q))};async function z(){try{if(await p(),!(a!=null&&a.render.inDialog))return f();t(!0)}catch(Q){ne(Q)}finally{r(!1)}}Kn(()=>{m!=null&&m.connectError&&ne(m==null?void 0:m.connectError)},[m]);let ae=((Lt=m==null?void 0:m.connector)==null?void 0:Lt.connectorType)||"metamask",V=((Co=m==null?void 0:m.connector)==null?void 0:Co.walletClientType)||"metamask",k=((Mt=m==null?void 0:m.connector)==null?void 0:Mt.walletBranding.name)||((ir=Bo[V])==null?void 0:ir.name)||"Metamask",U=((Eo=m==null?void 0:m.connector)==null?void 0:Eo.walletBranding.icon)||((ar=Bo[V])==null?void 0:ar.component)||(Q=>me(se,{...Q})),O=e?`Successfully connected with ${k}`:n?n.message:N?o&&L?"Signing":"Sign to verify":`Waiting for ${k}`,j="Don\u2019t see your wallet modal? Check your other browser windows.";if(e){let Q=(E==null?void 0:E.linkedAccounts.length)||0;S===Q?j="Wallet was already linked.":j="You\u2019re good to go!"}else A>=Br&&n?j="Unable to connect wallet":n?j=n.detail:N&&L?j="Sign the message in your wallet to verify it belongs to you.":V==="metamask"?j="For the best experience, connect only one wallet at a time.":ae==="wallet_connect"?j="Open your mobile wallet app to continue":ae==="coinbase_wallet"&&(at()||(On(E)?j="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":j="Open the Coinbase app on your phone to continue."));let te=(sr=w==null?void 0:w.walletConnectors)==null?void 0:sr.find(Q=>Q.walletClientType==="coinbase_wallet"),tt=V==="coinbase_wallet"&&(On(E)||n===Ye.ERROR_USER_EXISTS);return Fr(Ps,{children:[me(T,{backFn:h===u?void 0:s}),Fr(Tp,{children:[me(Jn,{walletLogo:U,success:e,fail:!!n}),Fr(Pp,{children:[me("h3",{children:O}),me("p",{children:j})]}),me(Rr,{children:tt?me(ie,{onClick:()=>te&&(te==null?void 0:te.disconnect()),invisible:e,disabled:e,children:"Use a different wallet"}):n==Ye.ERROR_USER_EXISTS&&h!==u?me(ie,{onClick:s,children:"Use a different wallet"}):N&&!e&&L?me(ie,{onClick:()=>{r(!0),z()},disabled:o,children:o?"Signing":"Sign with your wallet"}):!e&&(n==null?void 0:n.retryable)&&A<Br?me(ie,{onClick:()=>{W(A+1),i(void 0),N?(r(!0),z()):m==null||m.connectRetry()},invisible:e||!(n!=null&&n.retryable)||A>=Br,disabled:!e&&(!(n!=null&&n.retryable)||A>=Br),children:"Retry"}):null})]})]})},Tp=Qn.div`
606
606
  display: flex;
607
607
  flex-direction: column;
608
608
  align-items: center;
@@ -640,7 +640,7 @@ Resources:
640
640
  left: -19px;
641
641
  top: -19px;
642
642
  }
643
- `,Jn=e=>{let t=e.walletLogo;return me(Ps,{children:me(_p,{children:Fr("div",{children:[me(Sr,{success:e.success,fail:e.fail}),typeof t=="string"?me("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):me(t,{style:{width:"38px",height:"38px"}})]})})})};import{Fragment as kp,jsx as ut,jsxs as Xn}from"react/jsx-runtime";var Gr=2,ks=()=>{var A,W,E,S,R,L;let{navigateBack:e,lastScreen:t,currentScreen:o}=v(),{walletConnectionStatus:r,closePrivyModal:n}=I(),[i,a]=As(void 0),[l,s]=As(0),u=(r==null?void 0:r.status)==="connected";_s(()=>{if(u){let N=setTimeout(n,Re);return()=>clearTimeout(N)}},[u]);let h=N=>{a(Zn(N))};_s(()=>{r!=null&&r.connectError&&h(r==null?void 0:r.connectError)},[r]);let C=((A=r==null?void 0:r.connector)==null?void 0:A.connectorType)||"metamask",b=((W=r==null?void 0:r.connector)==null?void 0:W.walletClientType)||"metamask",m=((E=r==null?void 0:r.connector)==null?void 0:E.walletBranding.name)||((S=Uo[b])==null?void 0:S.name)||"Metamask",f=((R=r==null?void 0:r.connector)==null?void 0:R.walletBranding.icon)||((L=Uo[b])==null?void 0:L.component)||(N=>ut(se,{...N})),p=u?`Successfully connected with ${m}`:i?i.message:`Waiting for ${m}`,w="Don\u2019t see your wallet modal? Check your other browser windows.";return u?w="You\u2019re good to go!":l>=Gr&&i?w="Unable to connect wallet":i?w=i.detail:b==="metamask"?w="For the best experience, connect only one wallet at a time.":C==="wallet_connect_v2"?w="Open your mobile wallet app to continue":C==="coinbase_wallet"&&(w="Open the Coinbase app on your phone to continue."),Xn(kp,{children:[ut(T,{backFn:o===t?void 0:e}),Xn(Ap,{children:[ut(Jn,{walletLogo:f,success:u,fail:!!i}),Xn(Sp,{children:[ut("h3",{children:p}),ut("p",{children:w})]}),ut(Rr,{children:i==Ye.ERROR_USER_EXISTS?ut(ie,{onClick:e,children:"Use a different wallet"}):!u&&(i==null?void 0:i.retryable)&&l<Gr?ut(ie,{onClick:()=>{s(l+1),a(void 0),r==null||r.connectRetry()},invisible:u||!(i!=null&&i.retryable)||l>=Gr,disabled:!u&&(!(i!=null&&i.retryable)||l>=Gr),children:"Retry"}):null})]})]})},Ap=Ss.div`
643
+ `,Jn=e=>{let t=e.walletLogo;return me(Ps,{children:me(_p,{children:Fr("div",{children:[me(Sr,{success:e.success,fail:e.fail}),typeof t=="string"?me("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):me(t,{style:{width:"38px",height:"38px"}})]})})})};import{Fragment as kp,jsx as ut,jsxs as Xn}from"react/jsx-runtime";var Gr=2,ks=()=>{var A,W,E,S,R,L;let{navigateBack:e,lastScreen:t,currentScreen:o}=v(),{walletConnectionStatus:r,closePrivyModal:n}=I(),[i,a]=As(void 0),[l,s]=As(0),u=(r==null?void 0:r.status)==="connected";_s(()=>{if(u){let N=setTimeout(n,Re);return()=>clearTimeout(N)}},[u]);let h=N=>{a(Zn(N))};_s(()=>{r!=null&&r.connectError&&h(r==null?void 0:r.connectError)},[r]);let C=((A=r==null?void 0:r.connector)==null?void 0:A.connectorType)||"metamask",b=((W=r==null?void 0:r.connector)==null?void 0:W.walletClientType)||"metamask",m=((E=r==null?void 0:r.connector)==null?void 0:E.walletBranding.name)||((S=Bo[b])==null?void 0:S.name)||"Metamask",f=((R=r==null?void 0:r.connector)==null?void 0:R.walletBranding.icon)||((L=Bo[b])==null?void 0:L.component)||(N=>ut(se,{...N})),p=u?`Successfully connected with ${m}`:i?i.message:`Waiting for ${m}`,w="Don\u2019t see your wallet modal? Check your other browser windows.";return u?w="You\u2019re good to go!":l>=Gr&&i?w="Unable to connect wallet":i?w=i.detail:b==="metamask"?w="For the best experience, connect only one wallet at a time.":C==="wallet_connect_v2"?w="Open your mobile wallet app to continue":C==="coinbase_wallet"&&(w="Open the Coinbase app on your phone to continue."),Xn(kp,{children:[ut(T,{backFn:o===t?void 0:e}),Xn(Ap,{children:[ut(Jn,{walletLogo:f,success:u,fail:!!i}),Xn(Sp,{children:[ut("h3",{children:p}),ut("p",{children:w})]}),ut(Rr,{children:i==Ye.ERROR_USER_EXISTS?ut(ie,{onClick:e,children:"Use a different wallet"}):!u&&(i==null?void 0:i.retryable)&&l<Gr?ut(ie,{onClick:()=>{s(l+1),a(void 0),r==null||r.connectRetry()},invisible:u||!(i!=null&&i.retryable)||l>=Gr,disabled:!u&&(!(i!=null&&i.retryable)||l>=Gr),children:"Retry"}):null})]})]})},Ap=Ss.div`
644
644
  display: flex;
645
645
  flex-direction: column;
646
646
  align-items: center;
@@ -790,7 +790,7 @@ Resources:
790
790
  && > h4 {
791
791
  color: var(--privy-color-error);
792
792
  }
793
- `;import{useEffect as fu,useState as li}from"react";import ci,{css as yu}from"styled-components";import{useEffect as ou,useState as Bo}from"react";import si from"styled-components";import{jsx as zs}from"react/jsx-runtime";var Vs=({style:e,...t})=>zs("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:zs("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"})});import{jsx as $s}from"react/jsx-runtime";var ro=({style:e,color:t,...o})=>$s("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:$s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});import{Fragment as hu,jsx as no,jsxs as ai}from"react/jsx-runtime";var io=6,ru=new Array(io).fill("");function nu(e){return e.replace(/\s+/g,"")}function ii(e){return/^[a-zA-Z0-9]{1}$/.test(e)}function iu(e){return/^[a-zA-Z]{1}$/.test(e)}function au(e){return/^[a-z]{1}$/.test(e)}function qs(e){return e.length===io&&e.every(ii)}function su(e,t){return e.reduce((o,r)=>o+Number(t(r)),0)}function lu(){return crypto.getRandomValues(new Uint8Array(1))[0]}function cu(){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",t=[];for(;t.length<io;){let o=lu();o>247||t.push(e.charAt(o%62))}return t.join("")}var Vr=({onChange:e,disabled:t,readOnly:o,disableGeneration:r,errorReasonOverride:n})=>{let[i,a]=Bo(ru),[l,s]=Bo(null),[u,h]=Bo(null),C=f=>{var V;let p=nu(f.currentTarget.value);if(p==="")return;let w=su(i,ii),A=p.split(""),W=!A.every(ii),E=A.length+w>io;if(W){s("Passcode can only be letters and numbers"),h(1);return}if(E){s("Passcode must be exactly 6 letters and numbers"),h(1);return}s(null),h(null);let S=Number((V=f.currentTarget.name)==null?void 0:V.charAt(4)),R=[...p||[""]].slice(0,io-S),L=[...i.slice(0,S),...R,...i.slice(S+R.length)];a(L);let N=R.length,ne=Math.min(Math.max(S+N,0),io-1),z=document.querySelector(`input[name=pin-${ne}]`),ae=R[R.length-1]||"";if(iu(ae)&&(au(ae)?z.autocapitalize="none":z.autocapitalize="on"),z==null||z.focus(),qs(L)){let k=document.querySelector(`input[name=pin-${ne}]`);k==null||k.blur(),e(L.join(""))}else e(null);f.preventDefault()},b=f=>{u===1&&(s(null),h(null));let p=[...i.slice(0,f),"",...i.slice(f+1)];if(a(p),f>0){let w=document.querySelector(`input[name=pin-${f-1}]`);w==null||w.focus()}qs(p)?e(p.join("")):e(null)},m=o||r;return ai(hu,{children:[ai(du,{children:[no(pu,{fail:!!n||!!l,children:n||l||"Passcode can be letters and numbers"}),no("div",{children:i.map((f,p)=>no("input",{name:`pin-${p}`,type:"text",value:i[p],onChange:C,onKeyUp:w=>{w.key==="Backspace"&&b(p)},inputMode:"text",autoFocus:p===0,pattern:"[a-zA-Z0-9]",className:l?"fail":"",autoComplete:"off",disabled:t||o,autoCapitalize:"none"},p))})]}),!m&&no(uu,{disabled:t,onClick:()=>{let f=cu();a([...f]),e(f)}})]})},du=si.div`
793
+ `;import{useEffect as fu,useState as li}from"react";import ci,{css as yu}from"styled-components";import{useEffect as ou,useState as Fo}from"react";import si from"styled-components";import{jsx as zs}from"react/jsx-runtime";var Vs=({style:e,...t})=>zs("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:zs("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"})});import{jsx as $s}from"react/jsx-runtime";var ro=({style:e,color:t,...o})=>$s("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:$s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});import{Fragment as hu,jsx as no,jsxs as ai}from"react/jsx-runtime";var io=6,ru=new Array(io).fill("");function nu(e){return e.replace(/\s+/g,"")}function ii(e){return/^[a-zA-Z0-9]{1}$/.test(e)}function iu(e){return/^[a-zA-Z]{1}$/.test(e)}function au(e){return/^[a-z]{1}$/.test(e)}function qs(e){return e.length===io&&e.every(ii)}function su(e,t){return e.reduce((o,r)=>o+Number(t(r)),0)}function lu(){return crypto.getRandomValues(new Uint8Array(1))[0]}function cu(){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",t=[];for(;t.length<io;){let o=lu();o>247||t.push(e.charAt(o%62))}return t.join("")}var Vr=({onChange:e,disabled:t,readOnly:o,disableGeneration:r,errorReasonOverride:n})=>{let[i,a]=Fo(ru),[l,s]=Fo(null),[u,h]=Fo(null),C=f=>{var V;let p=nu(f.currentTarget.value);if(p==="")return;let w=su(i,ii),A=p.split(""),W=!A.every(ii),E=A.length+w>io;if(W){s("Passcode can only be letters and numbers"),h(1);return}if(E){s("Passcode must be exactly 6 letters and numbers"),h(1);return}s(null),h(null);let S=Number((V=f.currentTarget.name)==null?void 0:V.charAt(4)),R=[...p||[""]].slice(0,io-S),L=[...i.slice(0,S),...R,...i.slice(S+R.length)];a(L);let N=R.length,ne=Math.min(Math.max(S+N,0),io-1),z=document.querySelector(`input[name=pin-${ne}]`),ae=R[R.length-1]||"";if(iu(ae)&&(au(ae)?z.autocapitalize="none":z.autocapitalize="on"),z==null||z.focus(),qs(L)){let k=document.querySelector(`input[name=pin-${ne}]`);k==null||k.blur(),e(L.join(""))}else e(null);f.preventDefault()},b=f=>{u===1&&(s(null),h(null));let p=[...i.slice(0,f),"",...i.slice(f+1)];if(a(p),f>0){let w=document.querySelector(`input[name=pin-${f-1}]`);w==null||w.focus()}qs(p)?e(p.join("")):e(null)},m=o||r;return ai(hu,{children:[ai(du,{children:[no(pu,{fail:!!n||!!l,children:n||l||"Passcode can be letters and numbers"}),no("div",{children:i.map((f,p)=>no("input",{name:`pin-${p}`,type:"text",value:i[p],onChange:C,onKeyUp:w=>{w.key==="Backspace"&&b(p)},inputMode:"text",autoFocus:p===0,pattern:"[a-zA-Z0-9]",className:l?"fail":"",autoComplete:"off",disabled:t||o,autoCapitalize:"none"},p))})]}),!m&&no(uu,{disabled:t,onClick:()=>{let f=cu();a([...f]),e(f)}})]})},du=si.div`
794
794
  display: flex;
795
795
  flex-direction: column;
796
796
  width: 100%;
@@ -865,7 +865,7 @@ Resources:
865
865
  display: flex;
866
866
  justify-content: flex-end;
867
867
  width: 100%;
868
- `,uu=({onClick:e,disabled:t,...o})=>{let[r,n]=Bo(!1),[i,a]=Bo();return ou(()=>{t&&i&&clearTimeout(i),a(void 0)},[t]),ai(mu,{onClick:l=>{i&&clearTimeout(i),n(!0),e==null||e(l),a(setTimeout(()=>n(!1),1e3))},justGenerated:r,disabled:t,...o,children:[r?no(ro,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):no(Vs,{style:{height:"14px",width:"14px"}}),r?"Generated":"Generate"," passcode"]})},mu=si.button`
868
+ `,uu=({onClick:e,disabled:t,...o})=>{let[r,n]=Fo(!1),[i,a]=Fo();return ou(()=>{t&&i&&clearTimeout(i),a(void 0)},[t]),ai(mu,{onClick:l=>{i&&clearTimeout(i),n(!0),e==null||e(l),a(setTimeout(()=>n(!1),1e3))},justGenerated:r,disabled:t,...o,children:[r?no(ro,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):no(Vs,{style:{height:"14px",width:"14px"}}),r?"Generated":"Generate"," passcode"]})},mu=si.button`
869
869
  display: flex;
870
870
  align-items: center;
871
871
  gap: 6px;
@@ -1344,12 +1344,12 @@ Resources:
1344
1344
  > a {
1345
1345
  text-decoration: underline;
1346
1346
  }
1347
- `;import El from"styled-components";import{jsx as bl,jsxs as um}from"react/jsx-runtime";var rn=({style:e,...t})=>um("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:[bl("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"}),bl("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 Fo,jsxs as mm}from"react/jsx-runtime";var nn=({style:e,...t})=>mm("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:[Fo("g",{clipPath:"url(#clip0)",children:Fo("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"})}),Fo("defs",{children:Fo("clipPath",{id:"clip0",children:Fo("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as wl}from"react/jsx-runtime";var an=({style:e,...t})=>wl("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:wl("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});import{jsx as sn,jsxs as hm}from"react/jsx-runtime";var ln=({style:e,...t})=>hm("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:[sn("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"}),sn("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"}),sn("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"}),sn("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 Cl}from"react/jsx-runtime";var cn=({style:e,...t})=>Cl("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:Cl("path",{d:"M7.54311 19.7551C16.5973 19.7551 21.5516 12.2467 21.5516 5.74656C21.5516 5.53533 21.5516 5.32409 21.542 5.11286C22.5021 4.42156 23.3375 3.54783 24 2.55888C23.1166 2.95254 22.1661 3.21178 21.1675 3.3366C22.1853 2.73171 22.963 1.76196 23.3375 0.609788C22.3869 1.17627 21.3308 1.57953 20.2074 1.80037C19.3049 0.840223 18.0279 0.244934 16.6165 0.244934C13.8993 0.244934 11.6909 2.45326 11.6909 5.17047C11.6909 5.55453 11.7389 5.92898 11.8157 6.29384C7.72554 6.09221 4.09619 4.12391 1.66703 1.14747C1.24457 1.87718 1.00453 2.72211 1.00453 3.62464C1.00453 5.3337 1.87826 6.84112 3.19366 7.72445C2.38714 7.69565 1.62862 7.47481 0.966125 7.10996C0.966125 7.12916 0.966125 7.14837 0.966125 7.17717C0.966125 9.55833 2.66558 11.5554 4.91232 12.0067C4.49945 12.1219 4.06739 12.1795 3.61612 12.1795C3.29927 12.1795 2.99203 12.1507 2.69438 12.0931C3.31848 14.0518 5.14275 15.4728 7.29347 15.5112C5.60362 16.8362 3.4817 17.6235 1.17736 17.6235C0.783698 17.6235 0.390039 17.6043 0.00598145 17.5563C2.17591 18.9389 4.76829 19.7551 7.54311 19.7551Z",fill:"#1da1f2"})});import{jsx as $e,jsxs as ym}from"react/jsx-runtime";var xl=({showGoogle:e,showTwitter:t,showDiscord:o,showGithub:r,showApple:n})=>{let{initLoginWithOAuth:i}=I(),{app:a}=v(),l=a==null?void 0:a.appearance.palette.colorScheme;return ym(fm,{children:[e&&$e(Go,{onClick:()=>{i("google")},children:$e(ln,{})}),t&&$e(Go,{onClick:()=>{i("twitter")},children:$e(cn,{})}),o&&$e(Go,{onClick:()=>{i("discord")},children:$e(nn,{})}),r&&$e(Go,{onClick:()=>{i("github")},children:$e(an,{style:{color:l==="light"?"#000":"#fff"}})}),n&&$e(Go,{onClick:()=>{i("apple")},children:$e(rn,{style:{color:l==="light"?"#000":"#fff"}})})]})},fm=El.div`
1347
+ `;import El from"styled-components";import{jsx as bl,jsxs as um}from"react/jsx-runtime";var rn=({style:e,...t})=>um("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:[bl("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"}),bl("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 Go,jsxs as mm}from"react/jsx-runtime";var nn=({style:e,...t})=>mm("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:[Go("g",{clipPath:"url(#clip0)",children:Go("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"})}),Go("defs",{children:Go("clipPath",{id:"clip0",children:Go("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as wl}from"react/jsx-runtime";var an=({style:e,...t})=>wl("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:wl("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});import{jsx as sn,jsxs as hm}from"react/jsx-runtime";var ln=({style:e,...t})=>hm("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:[sn("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"}),sn("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"}),sn("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"}),sn("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 Cl}from"react/jsx-runtime";var cn=({style:e,...t})=>Cl("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:Cl("path",{d:"M7.54311 19.7551C16.5973 19.7551 21.5516 12.2467 21.5516 5.74656C21.5516 5.53533 21.5516 5.32409 21.542 5.11286C22.5021 4.42156 23.3375 3.54783 24 2.55888C23.1166 2.95254 22.1661 3.21178 21.1675 3.3366C22.1853 2.73171 22.963 1.76196 23.3375 0.609788C22.3869 1.17627 21.3308 1.57953 20.2074 1.80037C19.3049 0.840223 18.0279 0.244934 16.6165 0.244934C13.8993 0.244934 11.6909 2.45326 11.6909 5.17047C11.6909 5.55453 11.7389 5.92898 11.8157 6.29384C7.72554 6.09221 4.09619 4.12391 1.66703 1.14747C1.24457 1.87718 1.00453 2.72211 1.00453 3.62464C1.00453 5.3337 1.87826 6.84112 3.19366 7.72445C2.38714 7.69565 1.62862 7.47481 0.966125 7.10996C0.966125 7.12916 0.966125 7.14837 0.966125 7.17717C0.966125 9.55833 2.66558 11.5554 4.91232 12.0067C4.49945 12.1219 4.06739 12.1795 3.61612 12.1795C3.29927 12.1795 2.99203 12.1507 2.69438 12.0931C3.31848 14.0518 5.14275 15.4728 7.29347 15.5112C5.60362 16.8362 3.4817 17.6235 1.17736 17.6235C0.783698 17.6235 0.390039 17.6043 0.00598145 17.5563C2.17591 18.9389 4.76829 19.7551 7.54311 19.7551Z",fill:"#1da1f2"})});import{jsx as $e,jsxs as ym}from"react/jsx-runtime";var xl=({showGoogle:e,showTwitter:t,showDiscord:o,showGithub:r,showApple:n})=>{let{initLoginWithOAuth:i}=I(),{app:a}=v(),l=a==null?void 0:a.appearance.palette.colorScheme;return ym(fm,{children:[e&&$e(Ho,{onClick:()=>{i("google")},children:$e(ln,{})}),t&&$e(Ho,{onClick:()=>{i("twitter")},children:$e(cn,{})}),o&&$e(Ho,{onClick:()=>{i("discord")},children:$e(nn,{})}),r&&$e(Ho,{onClick:()=>{i("github")},children:$e(an,{style:{color:l==="light"?"#000":"#fff"}})}),n&&$e(Ho,{onClick:()=>{i("apple")},children:$e(rn,{style:{color:l==="light"?"#000":"#fff"}})})]})},fm=El.div`
1348
1348
  display: flex;
1349
1349
  justify-content: space-between;
1350
1350
  width: 100%;
1351
1351
  gap: 4px;
1352
- `,Go=El.div`
1352
+ `,Ho=El.div`
1353
1353
  border-radius: var(--privy-border-radius-sm);
1354
1354
  cursor: pointer;
1355
1355
  height: 44px;
@@ -1422,7 +1422,7 @@ Resources:
1422
1422
  }
1423
1423
  `,xm=po(ce)`
1424
1424
  flex-direction: ${e=>e.reverse?"column-reverse":"column"};
1425
- `;import{Fragment as Tm,jsx as uo,jsxs as Pm}from"react/jsx-runtime";var kl=()=>{let{app:e}=v();return Pm(Tm,{children:[uo(T,{},"header"),uo(Ae,{title:"Connect your email",description:`Add your email to your ${e==null?void 0:e.name} account`,icon:uo(Zr,{})}),uo(ce,{children:uo(Xr,{stacked:!0})}),uo(D,{protectedByPrivy:!0})]})};import{Fragment as _m,jsx as mo,jsxs as Am}from"react/jsx-runtime";var Rl=()=>{let{app:e}=v();return Am(_m,{children:[mo(T,{},"header"),mo(Ae,{title:"Connect your phone",description:`Add your number to your ${e==null?void 0:e.name} account`,icon:mo(en,{})}),mo(ce,{children:mo(on,{stacked:!0})}),mo(D,{protectedByPrivy:!0})]})};import{Fragment as Sm,jsx as Ho,jsxs as Il}from"react/jsx-runtime";var Wl=()=>{let{linkingHint:e}=I(),{app:t}=v(),o=e?`Select the wallet with ${Ht(e)} and follow the instructions to reconnect your wallet${t!=null&&t.name?` to ${t.name}.`:"."}`:`Link a wallet to your ${t==null?void 0:t.name} account`;return Il(Sm,{children:[Ho(T,{},"header"),Ho(Ge,{title:`${e?"Reconnect":"Connect"} your wallet`,description:o}),Il(ce,{children:[Ho(dt,{connectOnly:!1}),Ho(pt,{})]}),Ho(D,{protectedByPrivy:!0})]})};import{jsx as Nl,jsxs as km}from"react/jsx-runtime";var Ll=({style:e,...t})=>km("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:[Nl("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),Nl("path",{"fill-rule":"evenodd","clip-rule":"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 Rm,jsx as ho,jsxs as Ml}from"react/jsx-runtime";var Ol=()=>{let{closePrivyModal:e}=I(),{navigate:t}=v();return Ml(Rm,{children:[ho(T,{},"header"),ho(Ll,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),ho(Ge,{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"}}),Ml(ce,{children:[ho(q,{onClick:()=>t("LANDING"),children:"Try again"}),ho(Ja,{onClick:()=>e(),children:"Cancel"})]}),ho(D,{protectedByPrivy:!0})]})};import{useEffect as Dl,useState as Ul}from"react";import Si from"styled-components";import{Fragment as Mm,jsx as At,jsxs as dn}from"react/jsx-runtime";var Bl={google:{name:"Google",component:ln},discord:{name:"Discord",component:nn},github:{name:"Github",component:an},twitter:{name:"Twitter",component:cn},apple:{name:"Apple",component:rn}},Im=e=>e.charAt(0).toUpperCase()+e.slice(1),Ai=()=>{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"),window.history.pushState({},"",e)},Fl=()=>{var S;let{ready:e,user:t,authenticated:o}=B(),{app:r,setModalData:n,navigate:i}=v(),{getAuthMeta:a,initLoginWithOAuth:l,loginWithOAuth:s,closePrivyModal:u}=I(),[h,C]=Ul(!1),[b,m]=Ul(void 0),f=((S=a())==null?void 0:S.provider)||"google",p=Bl[f].name,w=Bl[f].component,A=r!=null&&r.render.inDialog?Re:0;Dl(()=>{!e||s().then(()=>{Ai(),C(!0)}).catch(R=>{let L={retryable:!1,message:"Authentication failed."};R.message.includes("Another user has already linked this")?L.detail="This account has already been linked to another user.":R.message==="Invalid code during oauth flow."?(L.retryable=!0,L.detail="Something went wrong. Try again."):R.message==="User denied confirmation during OAuth flow"&&(L.detail=`Retry and check ${Im(f)} to finish connecting your account.`,L.retryable=!0),Ai(),m(L)})},[e]),Dl(()=>{var L;if(!!(o&&h&&t))if(Bt(t,(L=r==null?void 0:r.embeddedWallets)==null?void 0:L.createOnLogin)){let N=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:ne=>console.error(ne),callAuthOnSuccessOnClose:!0}}),console.log("Navigating to wallet creation flow"),i("EMBEDDED_WALLET_SCREEN")},A);return()=>clearTimeout(N)}else{let N=setTimeout(u,A);return()=>clearTimeout(N)}},[o,h,t]);let W=h?`Successfully connected with ${p}`:b?b.message:`Verifying connection to ${p}`,E="";return h?E="You\u2019re good to go!":b?E=b.detail:E="Just a few moments more",dn(Mm,{children:[At(T,{}),dn(Wm,{children:[At(Lm,{children:dn("div",{children:[At(Sr,{success:h,fail:!!b}),At(w,{style:{width:"38px",height:"38px"}})]})}),dn(Nm,{children:[At("h3",{children:W}),At("p",{children:E})]}),At(ie,{onClick:()=>{Ai(),l(f),m(void 0)},invisible:h||!(b!=null&&b.retryable),disabled:!h&&!(b!=null&&b.retryable),children:"Retry"})]})]})},Wm=Si.div`
1425
+ `;import{Fragment as Tm,jsx as uo,jsxs as Pm}from"react/jsx-runtime";var kl=()=>{let{app:e}=v();return Pm(Tm,{children:[uo(T,{},"header"),uo(Ae,{title:"Connect your email",description:`Add your email to your ${e==null?void 0:e.name} account`,icon:uo(Zr,{})}),uo(ce,{children:uo(Xr,{stacked:!0})}),uo(D,{protectedByPrivy:!0})]})};import{Fragment as _m,jsx as mo,jsxs as Am}from"react/jsx-runtime";var Rl=()=>{let{app:e}=v();return Am(_m,{children:[mo(T,{},"header"),mo(Ae,{title:"Connect your phone",description:`Add your number to your ${e==null?void 0:e.name} account`,icon:mo(en,{})}),mo(ce,{children:mo(on,{stacked:!0})}),mo(D,{protectedByPrivy:!0})]})};import{Fragment as Sm,jsx as zo,jsxs as Il}from"react/jsx-runtime";var Wl=()=>{let{linkingHint:e}=I(),{app:t}=v(),o=e?`Select the wallet with ${Ht(e)} and follow the instructions to reconnect your wallet${t!=null&&t.name?` to ${t.name}.`:"."}`:`Link a wallet to your ${t==null?void 0:t.name} account`;return Il(Sm,{children:[zo(T,{},"header"),zo(Ge,{title:`${e?"Reconnect":"Connect"} your wallet`,description:o}),Il(ce,{children:[zo(dt,{connectOnly:!1}),zo(pt,{})]}),zo(D,{protectedByPrivy:!0})]})};import{jsx as Nl,jsxs as km}from"react/jsx-runtime";var Ll=({style:e,...t})=>km("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:[Nl("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),Nl("path",{"fill-rule":"evenodd","clip-rule":"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 Rm,jsx as ho,jsxs as Ml}from"react/jsx-runtime";var Ol=()=>{let{closePrivyModal:e}=I(),{navigate:t}=v();return Ml(Rm,{children:[ho(T,{},"header"),ho(Ll,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),ho(Ge,{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"}}),Ml(ce,{children:[ho(q,{onClick:()=>t("LANDING"),children:"Try again"}),ho(Ja,{onClick:()=>e(),children:"Cancel"})]}),ho(D,{protectedByPrivy:!0})]})};import{useEffect as Dl,useState as Ul}from"react";import Si from"styled-components";import{Fragment as Mm,jsx as At,jsxs as dn}from"react/jsx-runtime";var Bl={google:{name:"Google",component:ln},discord:{name:"Discord",component:nn},github:{name:"Github",component:an},twitter:{name:"Twitter",component:cn},apple:{name:"Apple",component:rn}},Im=e=>e.charAt(0).toUpperCase()+e.slice(1),Ai=()=>{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"),window.history.pushState({},"",e)},Fl=()=>{var S;let{ready:e,user:t,authenticated:o}=B(),{app:r,setModalData:n,navigate:i}=v(),{getAuthMeta:a,initLoginWithOAuth:l,loginWithOAuth:s,closePrivyModal:u}=I(),[h,C]=Ul(!1),[b,m]=Ul(void 0),f=((S=a())==null?void 0:S.provider)||"google",p=Bl[f].name,w=Bl[f].component,A=r!=null&&r.render.inDialog?Re:0;Dl(()=>{!e||s().then(()=>{Ai(),C(!0)}).catch(R=>{let L={retryable:!1,message:"Authentication failed."};R.message.includes("Another user has already linked this")?L.detail="This account has already been linked to another user.":R.message==="Invalid code during oauth flow."?(L.retryable=!0,L.detail="Something went wrong. Try again."):R.message==="User denied confirmation during OAuth flow"&&(L.detail=`Retry and check ${Im(f)} to finish connecting your account.`,L.retryable=!0),Ai(),m(L)})},[e]),Dl(()=>{var L;if(!!(o&&h&&t))if(Bt(t,(L=r==null?void 0:r.embeddedWallets)==null?void 0:L.createOnLogin)){let N=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:ne=>console.error(ne),callAuthOnSuccessOnClose:!0}}),console.log("Navigating to wallet creation flow"),i("EMBEDDED_WALLET_SCREEN")},A);return()=>clearTimeout(N)}else{let N=setTimeout(u,A);return()=>clearTimeout(N)}},[o,h,t]);let W=h?`Successfully connected with ${p}`:b?b.message:`Verifying connection to ${p}`,E="";return h?E="You\u2019re good to go!":b?E=b.detail:E="Just a few moments more",dn(Mm,{children:[At(T,{}),dn(Wm,{children:[At(Lm,{children:dn("div",{children:[At(Sr,{success:h,fail:!!b}),At(w,{style:{width:"38px",height:"38px"}})]})}),dn(Nm,{children:[At("h3",{children:W}),At("p",{children:E})]}),At(ie,{onClick:()=>{Ai(),l(f),m(void 0)},invisible:h||!(b!=null&&b.retryable),disabled:!h&&!(b!=null&&b.retryable),children:"Retry"})]})]})},Wm=Si.div`
1426
1426
  display: flex;
1427
1427
  flex-direction: column;
1428
1428
  align-items: center;
@@ -1459,7 +1459,7 @@ Resources:
1459
1459
  }
1460
1460
  `;import{useEffect as Dm,useState as Hl}from"react";import Um from"styled-components";import{isMobile as Om}from"react-device-detect";var Gl=(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(!Pe()&&Om)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${r}?ref=${r}`};import{Fragment as Fm,jsx as St,jsxs as zl}from"react/jsx-runtime";var Vl=()=>{let{forkSession:e,ready:t,authenticated:o}=B(),[r,n]=Hl(""),[i,a]=Hl(!1);Dm(()=>{t&&o&&e().then(n)},[t,o]);let l=Gl(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."),zl(Fm,{children:[St(T,{},"header"),St(Ge,{title:s.title,description:s.description}),zl(ce,{children:[St(Bm,{children:St(Oe,{style:{width:"72px",height:"72px"}})}),St(kr,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?St("p",{children:s.footnote}):null]}),St(D,{protectedByPrivy:!0})]})},Bm=Um(Ct)`
1461
1461
  margin: 16px auto;
1462
- `;import{useEffect as _c,useState as Zo}from"react";import go from"styled-components";import cc from"styled-components";import ql from"styled-components";import{jsx as $l,jsxs as zm}from"react/jsx-runtime";var zo=({label:e,children:t,valueStyles:o})=>zm(Gm,{children:[$l("div",{children:e}),$l(Hm,{style:{...o},children:t})]}),Gm=ql.div`
1462
+ `;import{useEffect as _c,useState as Jo}from"react";import go from"styled-components";import cc from"styled-components";import ql from"styled-components";import{jsx as $l,jsxs as zm}from"react/jsx-runtime";var Vo=({label:e,children:t,valueStyles:o})=>zm(Gm,{children:[$l("div",{children:e}),$l(Hm,{style:{...o},children:t})]}),Gm=ql.div`
1463
1463
  display: flex;
1464
1464
  align-items: center;
1465
1465
  justify-content: space-between;
@@ -1481,7 +1481,7 @@ Resources:
1481
1481
  border-radius: var(--privy-border-radius-md);
1482
1482
  background-color: var(--privy-color-background-2);
1483
1483
  padding: 4px 8px;
1484
- `;import{BigNumber as jm}from"@ethersproject/bignumber";import{BigNumber as Vm}from"@ethersproject/bignumber";import{isHexString as $m}from"@ethersproject/bytes";import{getNetwork as qm}from"@ethersproject/providers";import{formatEther as jl}from"@ethersproject/units";var pn=(e,t)=>(t*parseFloat(jl(e))).toFixed(2),kt=(e,t=8)=>parseFloat(jl(e)).toFixed(t).replace(/0+$/,"").replace(/\.$/,""),Kl=(e,t)=>{$m(e)&&(e=Number(e));let o=qm(e);return`https://${o.name==="homestead"?"www":o.name}.etherscan.io/address/${t}`},Ee=e=>Vm.from(e);import{Fragment as Km,jsx as Ym}from"react/jsx-runtime";var Vo=({weiQuantities:e,tokenPrice:t})=>{let o=e.map(Ee).reduce((n,i)=>n.add(i),jm.from(0)),r=pn(o.toHexString(),t);return Ym(Km,{children:r==="0.00"?"< USD $0.01":`USD $${r}`})};import fo from"styled-components";import{jsx as Ne,jsxs as $o}from"react/jsx-runtime";var Xl=({transactionData:e,displayFee:t=!1,gas:o,tokenPrice:r,isLoading:n=!1})=>$o(Qm,{children:[Ne(Zm,{"data-open":t,children:$o(Yl,{children:[$o(Ql,{children:[Ne(Jl,{children:"Est. Fees"}),Ne("div",{children:n?Ne(Ie,{color:"var(--privy-color-accent)"}):Ne(Vo,{weiQuantities:[o],tokenPrice:r})})]}),Ne(Zl,{children:`ETH ${kt(Ee(o).toHexString())}`})]})}),$o(Yl,{children:[$o(Ql,{children:[Ne(Jl,{children:"Total (including fees)"}),Ne("div",{children:n||!e.value?Ne(Ie,{color:"var(--privy-color-accent)"}):Ne(Vo,{weiQuantities:[e.value,o],tokenPrice:r})})]}),Ne(Zl,{children:e.value?`ETH ${kt(Ee(e.value).add(Ee(o)).toHexString())}`:null})]})]}),Qm=fo.div`
1484
+ `;import{BigNumber as jm}from"@ethersproject/bignumber";import{BigNumber as Vm}from"@ethersproject/bignumber";import{isHexString as $m}from"@ethersproject/bytes";import{getNetwork as qm}from"@ethersproject/providers";import{formatEther as jl}from"@ethersproject/units";var pn=(e,t)=>(t*parseFloat(jl(e))).toFixed(2),kt=(e,t=8)=>parseFloat(jl(e)).toFixed(t).replace(/0+$/,"").replace(/\.$/,""),Kl=(e,t)=>{$m(e)&&(e=Number(e));let o=qm(e);return`https://${o.name==="homestead"?"www":o.name}.etherscan.io/address/${t}`},Ee=e=>Vm.from(e);import{Fragment as Km,jsx as Ym}from"react/jsx-runtime";var $o=({weiQuantities:e,tokenPrice:t})=>{let o=e.map(Ee).reduce((n,i)=>n.add(i),jm.from(0)),r=pn(o.toHexString(),t);return Ym(Km,{children:r==="0.00"?"< USD $0.01":`USD $${r}`})};import fo from"styled-components";import{jsx as Ne,jsxs as qo}from"react/jsx-runtime";var Xl=({transactionData:e,displayFee:t=!1,gas:o,tokenPrice:r,isLoading:n=!1})=>qo(Qm,{children:[Ne(Zm,{"data-open":t,children:qo(Yl,{children:[qo(Ql,{children:[Ne(Jl,{children:"Est. Fees"}),Ne("div",{children:n?Ne(Ie,{color:"var(--privy-color-accent)"}):Ne($o,{weiQuantities:[o],tokenPrice:r})})]}),Ne(Zl,{children:`ETH ${kt(Ee(o).toHexString())}`})]})}),qo(Yl,{children:[qo(Ql,{children:[Ne(Jl,{children:"Total (including fees)"}),Ne("div",{children:n||!e.value?Ne(Ie,{color:"var(--privy-color-accent)"}):Ne($o,{weiQuantities:[e.value,o],tokenPrice:r})})]}),Ne(Zl,{children:e.value?`ETH ${kt(Ee(e.value).add(Ee(o)).toHexString())}`:null})]})]}),Qm=fo.div`
1485
1485
  display: flex;
1486
1486
  flex-direction: column;
1487
1487
  gap: 4px;
@@ -1519,7 +1519,7 @@ Resources:
1519
1519
  &[data-open='false'] {
1520
1520
  max-height: 0;
1521
1521
  }
1522
- `;import{useContext as Rt,useState as Jm}from"react";import It from"styled-components";import{jsx as ec}from"react/jsx-runtime";var tc=({style:e,...t})=>ec("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:ec("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})});import{createContext as oc,useContext as UC}from"react";var yo=oc(void 0);var qo=oc(void 0);import{jsx as qe,jsxs as ih}from"react/jsx-runtime";var rc=({defaultValue:e,children:t})=>{let[o,r]=Jm(e||null),n=i=>{r(o===i?null:i)};return qe(yo.Provider,{value:{activePanel:o,togglePanel:n},children:qe(Xm,{children:t})})},nc=({value:e,children:t})=>{let{activePanel:o,togglePanel:r}=Rt(yo),n=o===e;return qe(qo.Provider,{value:{onToggle:()=>r(e),value:e},children:qe(oh,{isActive:n,"data-open":n,children:t})})},ic=({children:e})=>{let{activePanel:t}=Rt(yo),{onToggle:o,value:r}=Rt(qo),n=t===r;return ih(eh,{onClick:o,"data-open":n,children:[qe(th,{children:e}),qe(nh,{isactive:n,children:qe(tc,{})})]})},ac=({children:e})=>{let{activePanel:t}=Rt(yo),{value:o}=Rt(qo);return qe(rh,{"data-open":t===o,children:qe(lc,{children:e})})},sc=({children:e})=>{let{activePanel:t}=Rt(yo),{value:o}=Rt(qo);return qe(lc,{children:typeof e=="function"?e({isActive:t===o}):e})},Xm=It.div`
1522
+ `;import{useContext as Rt,useState as Jm}from"react";import It from"styled-components";import{jsx as ec}from"react/jsx-runtime";var tc=({style:e,...t})=>ec("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:ec("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})});import{createContext as oc,useContext as UC}from"react";var yo=oc(void 0);var jo=oc(void 0);import{jsx as qe,jsxs as ih}from"react/jsx-runtime";var rc=({defaultValue:e,children:t})=>{let[o,r]=Jm(e||null),n=i=>{r(o===i?null:i)};return qe(yo.Provider,{value:{activePanel:o,togglePanel:n},children:qe(Xm,{children:t})})},nc=({value:e,children:t})=>{let{activePanel:o,togglePanel:r}=Rt(yo),n=o===e;return qe(jo.Provider,{value:{onToggle:()=>r(e),value:e},children:qe(oh,{isActive:n,"data-open":n,children:t})})},ic=({children:e})=>{let{activePanel:t}=Rt(yo),{onToggle:o,value:r}=Rt(jo),n=t===r;return ih(eh,{onClick:o,"data-open":n,children:[qe(th,{children:e}),qe(nh,{isactive:n,children:qe(tc,{})})]})},ac=({children:e})=>{let{activePanel:t}=Rt(yo),{value:o}=Rt(jo);return qe(rh,{"data-open":t===o,children:qe(lc,{children:e})})},sc=({children:e})=>{let{activePanel:t}=Rt(yo),{value:o}=Rt(jo);return qe(lc,{children:typeof e=="function"?e({isActive:t===o}):e})},Xm=It.div`
1523
1523
  display: flex;
1524
1524
  flex-direction: column;
1525
1525
  width: 100%;
@@ -1579,24 +1579,24 @@ Resources:
1579
1579
  &:hover {
1580
1580
  text-decoration: underline;
1581
1581
  }
1582
- `;import{Fragment as ph,jsx as ge,jsxs as Ri}from"react/jsx-runtime";var un=e=>{var o,r,n;let t=!!(((o=e.txn)==null?void 0:o.value)&&e.gas);return ge(rc,{children:Ri(nc,{value:"details",children:[ge(ic,{children:Ri(ch,{children:[ge("div",{children:((r=e.transactionInfo)==null?void 0:r.actionDescription)||"Details"}),((n=e.txn)==null?void 0:n.value)&&e.tokenPrice?ge(dh,{children:ge(Vo,{weiQuantities:[e.txn.value],tokenPrice:e.tokenPrice})}):null]})}),Ri(ac,{children:[ge(zo,{label:"From",children:ge(ki,{walletAddress:e.from,chainId:e.txn.chainId||Te})}),ge(zo,{label:"To",children:ge(ki,{walletAddress:e.to,chainId:e.txn.chainId||Te})}),t&&e.transactionInfo&&e.transactionInfo.action&&ge(zo,{label:"Action",children:e.transactionInfo.action})]}),ge(sc,{children:({isActive:i})=>t&&e.gas?ge(Xl,{transactionData:e.txn,displayFee:i,gas:e.gas,tokenPrice:e.tokenPrice}):ge(ph,{children:e.transactionInfo&&e.transactionInfo.action&&ge(zo,{label:"Action",children:e.transactionInfo.action})})})]})})},ch=cc.div`
1582
+ `;import{Fragment as ph,jsx as ge,jsxs as Ri}from"react/jsx-runtime";var un=e=>{var o,r,n;let t=!!(((o=e.txn)==null?void 0:o.value)&&e.gas);return ge(rc,{children:Ri(nc,{value:"details",children:[ge(ic,{children:Ri(ch,{children:[ge("div",{children:((r=e.transactionInfo)==null?void 0:r.actionDescription)||"Details"}),((n=e.txn)==null?void 0:n.value)&&e.tokenPrice?ge(dh,{children:ge($o,{weiQuantities:[e.txn.value],tokenPrice:e.tokenPrice})}):null]})}),Ri(ac,{children:[ge(Vo,{label:"From",children:ge(ki,{walletAddress:e.from,chainId:e.txn.chainId||Te})}),ge(Vo,{label:"To",children:ge(ki,{walletAddress:e.to,chainId:e.txn.chainId||Te})}),t&&e.transactionInfo&&e.transactionInfo.action&&ge(Vo,{label:"Action",children:e.transactionInfo.action})]}),ge(sc,{children:({isActive:i})=>t&&e.gas?ge(Xl,{transactionData:e.txn,displayFee:i,gas:e.gas,tokenPrice:e.tokenPrice}):ge(ph,{children:e.transactionInfo&&e.transactionInfo.action&&ge(Vo,{label:"Action",children:e.transactionInfo.action})})})]})})},ch=cc.div`
1583
1583
  display: flex;
1584
1584
  flex-direction: row;
1585
1585
  justify-content: space-between;
1586
1586
  `,dh=cc.div`
1587
1587
  flex-shrink: 0;
1588
1588
  padding-left: 8px;
1589
- `;import Ko from"styled-components";import{jsx as jo,jsxs as gh}from"react/jsx-runtime";var dc=({partyInfo:e})=>gh(uh,{children:[e.imgUrl&&jo(mh,{size:e.imgSize||"sm",src:e.imgUrl,alt:e.imgAltText||`${e.name} image`}),jo(hh,{children:jo("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:e.url.replace(/^(https?:\/\/)(www\.)?/,"")})}),jo(fh,{children:e.name}),jo(yh,{children:e.actionText})]}),uh=Ko.div`
1589
+ `;import Yo from"styled-components";import{jsx as Ko,jsxs as gh}from"react/jsx-runtime";var dc=({partyInfo:e})=>gh(uh,{children:[e.imgUrl&&Ko(mh,{size:e.imgSize||"sm",src:e.imgUrl,alt:e.imgAltText||`${e.name} image`}),Ko(hh,{children:Ko("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:e.url.replace(/^(https?:\/\/)(www\.)?/,"")})}),Ko(fh,{children:e.name}),Ko(yh,{children:e.actionText})]}),uh=Yo.div`
1590
1590
  display: flex;
1591
1591
  flex-direction: column;
1592
1592
  align-items: center;
1593
1593
  margin-bottom: 20px;
1594
- `,mh=Ko.img`
1594
+ `,mh=Yo.img`
1595
1595
  height: ${e=>e.size==="sm"?"65px":"140px"};
1596
1596
  width: ${e=>e.size==="sm"?"65px":"140px"};
1597
1597
  border-radius: 16px;
1598
1598
  margin-bottom: 20px;
1599
- `,hh=Ko.div`
1599
+ `,hh=Yo.div`
1600
1600
  margin-bottom: 8px;
1601
1601
  > a {
1602
1602
  font-size: 12px;
@@ -1608,7 +1608,7 @@ Resources:
1608
1608
  text-decoration: underline;
1609
1609
  }
1610
1610
  }
1611
- `,fh=Ko.div`
1611
+ `,fh=Yo.div`
1612
1612
  font-size: 18px;
1613
1613
  line-height: 18px;
1614
1614
  font-weight: 500;
@@ -1616,7 +1616,7 @@ Resources:
1616
1616
  white-space: nowrap;
1617
1617
  max-width: 275px;
1618
1618
  text-overflow: ellipsis;
1619
- `,yh=Ko.div`
1619
+ `,yh=Yo.div`
1620
1620
  font-size: 16px;
1621
1621
  line-height: 22.4px;
1622
1622
  font-weight: 500;
@@ -1650,7 +1650,7 @@ Resources:
1650
1650
  background-color: var(--privy-color-background-2);
1651
1651
  padding: 4px 12px;
1652
1652
  color: ${e=>e.displayBalanceColor?e.hasFunds?"green":"red":"inherit"};
1653
- `;import hn from"styled-components";import{useState as Yo,useEffect as Cc}from"react";var mn=e=>{let{getUsdTokenPrice:t}=I(),[o,r]=Yo(!1),[n,i]=Yo(!1),[a,l]=Yo(void 0),[s,u]=Yo(void 0),[h,C]=Yo(null);return Cc(()=>{let b=e.chainId||Te;(async()=>{try{r(!0);let f=await t(b);u(f)}catch(f){l(f)}finally{r(!1)}})()},[]),Cc(()=>{(async()=>{try{i(!0);let m=await hc(e);C(m.toBigInt())}catch(m){l(m)}finally{i(!1)}})()},[e]),{tokenPrice:s,estimatedGas:h,isLoading:o||n,error:a}};import{jsx as Rh,jsxs as Li}from"react/jsx-runtime";var Ec=e=>{var o,r;let{tokenPrice:t}=mn(e.txn);return Li(_h,{children:[Li(Ah,{children:["$",((o=e.txn)==null?void 0:o.value)&&t?pn(Ee(e.txn.value).toHexString(),t):"--"]}),Li(Sh,{children:[(r=e.txn)!=null&&r.value?kt(Ee(e.txn.value).toHexString()):"--"," ","ETH"]}),Rh(kh,{children:e.description})]})},_h=hn.div`
1653
+ `;import hn from"styled-components";import{useState as Qo,useEffect as Cc}from"react";var mn=e=>{let{getUsdTokenPrice:t}=I(),[o,r]=Qo(!1),[n,i]=Qo(!1),[a,l]=Qo(void 0),[s,u]=Qo(void 0),[h,C]=Qo(null);return Cc(()=>{let b=e.chainId||Te;(async()=>{try{r(!0);let f=await t(b);u(f)}catch(f){l(f)}finally{r(!1)}})()},[]),Cc(()=>{(async()=>{try{i(!0);let m=await hc(e);C(m.toBigInt())}catch(m){l(m)}finally{i(!1)}})()},[e]),{tokenPrice:s,estimatedGas:h,isLoading:o||n,error:a}};import{jsx as Rh,jsxs as Li}from"react/jsx-runtime";var Ec=e=>{var o,r;let{tokenPrice:t}=mn(e.txn);return Li(_h,{children:[Li(Ah,{children:["$",((o=e.txn)==null?void 0:o.value)&&t?pn(Ee(e.txn.value).toHexString(),t):"--"]}),Li(Sh,{children:[(r=e.txn)!=null&&r.value?kt(Ee(e.txn.value).toHexString()):"--"," ","ETH"]}),Rh(kh,{children:e.description})]})},_h=hn.div`
1654
1654
  display: flex;
1655
1655
  flex-direction: column;
1656
1656
  align-items: center;
@@ -1676,7 +1676,7 @@ Resources:
1676
1676
  white-space: nowrap;
1677
1677
  max-width: 275px;
1678
1678
  text-overflow: ellipsis;
1679
- `;function xc(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND_ETH":"UNKNOWN"}import Tc from"styled-components";import{Fragment as Nh,jsx as Qo,jsxs as Mi}from"react/jsx-runtime";var Pc=({txn:e,receipt:t,transactionInfo:o,onClose:r,tokenPrice:n})=>Mi(Nh,{children:[Qo(T,{onClose:r}),Mi(Ih,{children:[Mi("div",{children:[Qo(de,{title:"Transaction complete!",description:"You're all set."}),Qo(un,{tokenPrice:n,from:t.from,to:t.to,gas:t.gasUsed,txn:e,transactionInfo:o})]}),Qo("div",{children:Qo(Wh,{loading:!1,onClick:r,children:"All Done"})})]})]}),Ih=Tc.div`
1679
+ `;function xc(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND_ETH":"UNKNOWN"}import Tc from"styled-components";import{Fragment as Nh,jsx as Zo,jsxs as Mi}from"react/jsx-runtime";var Pc=({txn:e,receipt:t,transactionInfo:o,onClose:r,tokenPrice:n})=>Mi(Nh,{children:[Zo(T,{onClose:r}),Mi(Ih,{children:[Mi("div",{children:[Zo(de,{title:"Transaction complete!",description:"You're all set."}),Zo(un,{tokenPrice:n,from:t.from,to:t.to,gas:t.gasUsed,txn:e,transactionInfo:o})]}),Zo("div",{children:Zo(Wh,{loading:!1,onClick:r,children:"All Done"})})]})]}),Ih=Tc.div`
1680
1680
  display: flex;
1681
1681
  height: 100%;
1682
1682
  flex-direction: column;
@@ -1684,7 +1684,7 @@ Resources:
1684
1684
  flex-grow: 1;
1685
1685
  `,Wh=Tc(q)`
1686
1686
  transition: color 350ms ease, background-color 350ms ease;
1687
- `;import{Fragment as fn,jsx as pe,jsxs as Jo}from"react/jsx-runtime";var Lh=e=>{var t;switch(e.txnFamily){case"SEND_ETH":return pe(fn,{children:pe(Ec,{description:((t=e.uiOptions.transactionInfo)==null?void 0:t.description)||"",txn:e.txn})});case"CONTRACT_CALL":return pe(fn,{children:e.uiOptions.senderInfo&&pe(dc,{partyInfo:e.uiOptions.senderInfo})});default:return pe("div",{children:"Unsupported transaction."})}},Sc=()=>{let{authenticated:e,getAccessToken:t,user:o}=B(),{walletProxy:r,closePrivyModal:n}=I(),{navigate:i,data:a}=v(),{transactionRequest:l,onSuccess:s,onFailure:u,uiOptions:h}=a.sendTransaction,[C,b]=Zo(null),[m,f]=Zo(""),[p,w]=Zo(!0),[A,W]=Zo(!1),[E,S]=Zo(l),{tokenPrice:R,estimatedGas:L}=mn(E);_c(()=>{e||(i("LANDING"),u(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let N=$(o);_c(()=>{async function V(){let k=await t();return!k||!r||!N?E:pc(k,N.address,r,E)}V().then(k=>{w(!1),S(k)},k=>{w(!0),Ws(k)?f(k.message):(f("There was an error preparing transaction"),console.error(k))})},[r]);let ne=xc(E),z={modalTitle:h.modalTitle||"Review transaction",title:h.title||ne==="SEND_ETH"?"Send ETH":"Submit transaction",description:h.description||"Confirm the details of the transaction",buttonText:h.buttonText||"Submit"},ae=()=>{A||(C?s(C):u(new Error(m||"User exited the modal before submitting the transaction")),n({shouldCallAuthOnSuccess:!1}))};return R===void 0?Jo(fn,{children:[pe(T,{title:z.modalTitle,onClose:ae}),pe(Ac,{children:pe(to,{})})]}):C!==null?pe(Pc,{txn:E,onClose:ae,receipt:C,transactionInfo:h.transactionInfo,tokenPrice:R}):Jo(fn,{children:[pe(T,{title:z.modalTitle,onClose:ae}),Jo(Ac,{children:[Jo(Uh,{children:[pe(Lh,{txn:E,txnFamily:ne,uiOptions:h}),N?pe(un,{from:N.address,to:E.to,txn:E,transactionInfo:h.transactionInfo,gas:L?Ee(L).toHexString():void 0,tokenPrice:R}):null]}),Jo(Bh,{children:[pe(Mh,{children:m}),N?pe(wc,{txnValue:E.value,wallet:N,chainId:Number(E.chainId)}):null,pe(Oh,{children:pe(Dh,{disabled:p||A,loading:!r||A,loadingText:A?"Submitting (may take a few minutes)...":"Loading...",onClick:async()=>{W(!0);let V=await t();if(V&&!A&&N)try{let k=await uc(V,N.address,r,E);b(k),f("")}catch(k){f(k.reason||"An error has occurred, please try again.")}finally{W(!1)}},children:z.buttonText})})]})]})]})},Ac=go.div`
1687
+ `;import{Fragment as fn,jsx as pe,jsxs as Xo}from"react/jsx-runtime";var Lh=e=>{var t;switch(e.txnFamily){case"SEND_ETH":return pe(fn,{children:pe(Ec,{description:((t=e.uiOptions.transactionInfo)==null?void 0:t.description)||"",txn:e.txn})});case"CONTRACT_CALL":return pe(fn,{children:e.uiOptions.senderInfo&&pe(dc,{partyInfo:e.uiOptions.senderInfo})});default:return pe("div",{children:"Unsupported transaction."})}},Sc=()=>{let{authenticated:e,getAccessToken:t,user:o}=B(),{walletProxy:r,closePrivyModal:n}=I(),{navigate:i,data:a}=v(),{transactionRequest:l,onSuccess:s,onFailure:u,uiOptions:h}=a.sendTransaction,[C,b]=Jo(null),[m,f]=Jo(""),[p,w]=Jo(!0),[A,W]=Jo(!1),[E,S]=Jo(l),{tokenPrice:R,estimatedGas:L}=mn(E);_c(()=>{e||(i("LANDING"),u(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let N=$(o);_c(()=>{async function V(){let k=await t();return!k||!r||!N?E:pc(k,N.address,r,E)}V().then(k=>{w(!1),S(k)},k=>{w(!0),Ws(k)?f(k.message):(f("There was an error preparing transaction"),console.error(k))})},[r]);let ne=xc(E),z={modalTitle:h.modalTitle||"Review transaction",title:h.title||ne==="SEND_ETH"?"Send ETH":"Submit transaction",description:h.description||"Confirm the details of the transaction",buttonText:h.buttonText||"Submit"},ae=()=>{A||(C?s(C):u(new Error(m||"User exited the modal before submitting the transaction")),n({shouldCallAuthOnSuccess:!1}))};return R===void 0?Xo(fn,{children:[pe(T,{title:z.modalTitle,onClose:ae}),pe(Ac,{children:pe(to,{})})]}):C!==null?pe(Pc,{txn:E,onClose:ae,receipt:C,transactionInfo:h.transactionInfo,tokenPrice:R}):Xo(fn,{children:[pe(T,{title:z.modalTitle,onClose:ae}),Xo(Ac,{children:[Xo(Uh,{children:[pe(Lh,{txn:E,txnFamily:ne,uiOptions:h}),N?pe(un,{from:N.address,to:E.to,txn:E,transactionInfo:h.transactionInfo,gas:L?Ee(L).toHexString():void 0,tokenPrice:R}):null]}),Xo(Bh,{children:[pe(Mh,{children:m}),N?pe(wc,{txnValue:E.value,wallet:N,chainId:Number(E.chainId)}):null,pe(Oh,{children:pe(Dh,{disabled:p||A,loading:!r||A,loadingText:A?"Submitting (may take a few minutes)...":"Loading...",onClick:async()=>{W(!0);let V=await t();if(V&&!A&&N)try{let k=await uc(V,N.address,r,E);b(k),f("")}catch(k){f(k.reason||"An error has occurred, please try again.")}finally{W(!1)}},children:z.buttonText})})]})]})]})},Ac=go.div`
1688
1688
  display: flex;
1689
1689
  height: 100%;
1690
1690
  flex-direction: column;
@@ -1715,13 +1715,13 @@ Resources:
1715
1715
  display: flex;
1716
1716
  flex-direction: column;
1717
1717
  gap: 8px;
1718
- `;import{useEffect as Fh,useState as kc}from"react";import Xo,{css as Gh}from"styled-components";import{Fragment as jh,jsx as ht,jsxs as yn}from"react/jsx-runtime";var Rc=()=>{let{authenticated:e,getAccessToken:t,user:o}=B(),{walletProxy:r,closePrivyModal:n,createAnalyticsEvent:i}=I(),{navigate:a,data:l}=v(),[s,u]=kc(!1),[h,C]=kc("");Fh(()=>{e||(a("LANDING"),f(new Error("User must be authenticated before signing with a Privy wallet")))},[e]);let{message:b,onSuccess:m,onFailure:f,uiOptions:p}=l.signMessage,w=$(o),A=!r,W={title:p.title||"Sign message",description:p.description||"Signing this message will not cost you any fees.",buttonText:p.buttonText||"Sign and continue"};return yn(jh,{children:[ht(T,{onClose:()=>n({shouldCallAuthOnSuccess:!1})}),yn(Hh,{children:[yn("div",{children:[ht(de,{title:W.title,description:W.description}),ht(zh,{children:b}),ht(Vh,{fail:!0,children:h})]}),ht(qh,{success:s,loading:A,disabled:s,onClick:async()=>{let E=await t();if(E&&!A&&w)try{i("embedded_wallet_sign_message_started",{walletAddress:w.address});let{response:S}=await r.rpc({accessToken:E,address:w==null?void 0:w.address,request:{method:"eth_sign",params:[w.address,b]}}),R=S.data;C(""),m(R),i("embedded_wallet_sign_message_completed",{walletAddress:w.address}),u(!0),setTimeout(()=>{n({shouldCallAuthOnSuccess:!1})},Re)}catch(S){C("An error has occurred, please try again."),f(S)}},children:s?yn($h,{children:[ht(ro,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",ht("span",{children:"Success"})]}):W.buttonText})]}),ht(D,{protectedByPrivy:!0})]})},Hh=Xo.div`
1718
+ `;import{useEffect as Fh,useState as kc}from"react";import er,{css as Gh}from"styled-components";import{Fragment as jh,jsx as ht,jsxs as yn}from"react/jsx-runtime";var Rc=()=>{let{authenticated:e,getAccessToken:t,user:o}=B(),{walletProxy:r,closePrivyModal:n,createAnalyticsEvent:i}=I(),{navigate:a,data:l}=v(),[s,u]=kc(!1),[h,C]=kc("");Fh(()=>{e||(a("LANDING"),f(new Error("User must be authenticated before signing with a Privy wallet")))},[e]);let{message:b,onSuccess:m,onFailure:f,uiOptions:p}=l.signMessage,w=$(o),A=!r,W={title:p.title||"Sign message",description:p.description||"Signing this message will not cost you any fees.",buttonText:p.buttonText||"Sign and continue"};return yn(jh,{children:[ht(T,{onClose:()=>n({shouldCallAuthOnSuccess:!1})}),yn(Hh,{children:[yn("div",{children:[ht(de,{title:W.title,description:W.description}),ht(zh,{children:b}),ht(Vh,{fail:!0,children:h})]}),ht(qh,{success:s,loading:A,disabled:s,onClick:async()=>{let E=await t();if(E&&!A&&w)try{i("embedded_wallet_sign_message_started",{walletAddress:w.address});let{response:S}=await r.rpc({accessToken:E,address:w==null?void 0:w.address,request:{method:"eth_sign",params:[w.address,b]}}),R=S.data;C(""),m(R),i("embedded_wallet_sign_message_completed",{walletAddress:w.address}),u(!0),setTimeout(()=>{n({shouldCallAuthOnSuccess:!1})},Re)}catch(S){C("An error has occurred, please try again."),f(S)}},children:s?yn($h,{children:[ht(ro,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",ht("span",{children:"Success"})]}):W.buttonText})]}),ht(D,{protectedByPrivy:!0})]})},Hh=er.div`
1719
1719
  display: flex;
1720
1720
  height: 100%;
1721
1721
  flex-direction: column;
1722
1722
  justify-content: space-between;
1723
1723
  flex-grow: 1;
1724
- `,zh=Xo.div`
1724
+ `,zh=er.div`
1725
1725
  background-color: var(--privy-color-background-2);
1726
1726
  border-radius: 8px;
1727
1727
  padding: 12px;
@@ -1737,7 +1737,7 @@ Resources:
1737
1737
  &::-webkit-scrollbar {
1738
1738
  display: none; /* Safari and Chrome */
1739
1739
  }
1740
- `,Vh=Xo.div`
1740
+ `,Vh=er.div`
1741
1741
  line-height: 20px;
1742
1742
  height: 20px;
1743
1743
  font-size: 13px;
@@ -1746,11 +1746,11 @@ Resources:
1746
1746
  justify-content: flex-start;
1747
1747
  width: 100%;
1748
1748
  margin-top: 4px;
1749
- `,$h=Xo.span`
1749
+ `,$h=er.span`
1750
1750
  display: flex;
1751
1751
  align-items: center;
1752
1752
  gap: 8px;
1753
- `,qh=Xo(q)`
1753
+ `,qh=er(q)`
1754
1754
  transition: color 350ms ease, background-color 350ms ease;
1755
1755
 
1756
1756
  ${e=>e.success&&Gh`
@@ -2076,7 +2076,7 @@ Resources:
2076
2076
  opacity: 1;
2077
2077
  }
2078
2078
  }
2079
- `;import{jsx as M,jsxs as Lc}from"react/jsx-runtime";var of=()=>{let{ready:e}=B(),{isLinking:t}=I(),{ready:o,currentScreen:r,app:n}=v(),i=!!(n!=null&&n.loginMethods.wallet),a=!!((n==null?void 0:n.loginMethods.email)||(n==null?void 0:n.loginMethods.sms)),l=i!==a,s;return["AWAITING_CONNECTION","AWAITING_CONNECT_ONLY_CONNECTION","CONNECT_ONLY_LANDING_SCREEN","AWAITING_OAUTH_SCREEN","ALLOWLIST_REJECTION_SCREEN"].includes(r)||l&&r==="LANDING"?s="compact":"WALLET_EDUCATION"===r?s="full":t&&r!=="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"?s="medium":s="full",!e||!o?Lc(Xt,{"data-height":s,children:[M(T,{}),M(af,{children:M(No,{})}),M(We,{})]}):Lc(Xt,{"data-height":s,children:[r==="LANDING"&&M(_l,{}),r==="AWAITING_PASSWORDLESS_CODE"&&M(us,{}),r==="WALLET_EDUCATION"&&M(dl,{}),r==="AWAITING_CONNECTION"&&M(Ts,{}),r==="AWAITING_CONNECT_ONLY_CONNECTION"&&M(ks,{}),r==="COINBASE_INTERSTITIAL_SCREEN"&&M(fs,{}),r==="PHANTOM_INTERSTITIAL_SCREEN"&&M(Vl,{}),r==="LOGIN_FAILED_SCREEN"&&M(Ol,{}),r==="AWAITING_OAUTH_SCREEN"&&M(Fl,{}),r==="ALLOWLIST_REJECTION_SCREEN"&&M(is,{}),r==="INSTALL_METAMASK_SCREEN"&&M(hl,{}),r==="INSTALL_PHANTOM_SCREEN"&&M(yl,{}),r==="INSTALL_COINBASE_WALLET_SCREEN"&&M(ul,{}),r==="LINK_EMAIL_SCREEN"&&M(kl,{}),r==="LINK_PHONE_SCREEN"&&M(Rl,{}),r==="LINK_WALLET_SCREEN"&&M(Wl,{}),r==="CONNECT_ONLY_LANDING_SCREEN"&&M(xs,{}),r==="CONNECT_ONLY_AUTHENTICATED_SCREEN"&&M(ws,{}),r==="EMBEDDED_WALLET_SCREEN"&&M(Js,{}),r==="EMBEDDED_WALLET_CREATED_SCREEN"&&M(Ds,{}),r==="EMBEDDED_WALLET_CONNECTING_SCREEN"&&M(Ms,{}),r==="EMBEDDED_WALLET_RECOVERY_SCREEN"&&M(js,{}),r==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&M(Hs,{}),r==="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"&&M(Rc,{}),r==="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"&&M(Sc,{})]})},Oc=()=>{let{closePrivyModal:e}=I(),{app:t}=v(),o=ef(i=>{i.key==="Escape"&&(t==null?void 0:t.render.inDialog)&&e()},[t==null?void 0:t.render.inDialog]);Mc(()=>(document.addEventListener("keydown",o,!1),()=>{document.removeEventListener("keydown",o,!1)}),[o]);let r=M(Nc,{onClick:i=>i.stopPropagation(),children:M(of,{})}),n=t!=null&&t.render.inDialog?M(nf,{id:"privy-dialog",onClick:()=>e(),children:r}):r;return tf.createPortal(n,t!=null&&t.render.inParentNodeId&&document.getElementById(t.render.inParentNodeId)||document.body)},rf=({children:e,...t})=>{let o=Xh(null);return Mc(()=>{var n;(n=document==null?void 0:document.activeElement)==null||n.blur();let r=(document==null?void 0:document.getElementById("root"))||(document==null?void 0:document.getElementById("__next"));if(!!r)return r.setAttribute("inert","true"),Zh(o==null?void 0:o.current),()=>{let i=(document==null?void 0:document.getElementById("root"))||(document==null?void 0:document.getElementById("__next"));!i||(i.removeAttribute("inert"),Jh())}},[t.open,t.onClose]),M("dialog",{open:!0,role:"dialog",...t,ref:o,children:e})},nf=Oi(rf)`
2079
+ `;import{jsx as M,jsxs as Lc}from"react/jsx-runtime";var of=()=>{let{ready:e}=B(),{isLinking:t}=I(),{ready:o,currentScreen:r,app:n}=v(),i=!!(n!=null&&n.loginMethods.wallet),a=!!((n==null?void 0:n.loginMethods.email)||(n==null?void 0:n.loginMethods.sms)),l=i!==a,s;return["AWAITING_CONNECTION","AWAITING_CONNECT_ONLY_CONNECTION","CONNECT_ONLY_LANDING_SCREEN","AWAITING_OAUTH_SCREEN","ALLOWLIST_REJECTION_SCREEN"].includes(r)||l&&r==="LANDING"?s="compact":"WALLET_EDUCATION"===r?s="full":t&&r!=="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"?s="medium":s="full",!e||!o?Lc(Xt,{"data-height":s,children:[M(T,{}),M(af,{children:M(Lo,{})}),M(We,{})]}):Lc(Xt,{"data-height":s,children:[r==="LANDING"&&M(_l,{}),r==="AWAITING_PASSWORDLESS_CODE"&&M(us,{}),r==="WALLET_EDUCATION"&&M(dl,{}),r==="AWAITING_CONNECTION"&&M(Ts,{}),r==="AWAITING_CONNECT_ONLY_CONNECTION"&&M(ks,{}),r==="COINBASE_INTERSTITIAL_SCREEN"&&M(fs,{}),r==="PHANTOM_INTERSTITIAL_SCREEN"&&M(Vl,{}),r==="LOGIN_FAILED_SCREEN"&&M(Ol,{}),r==="AWAITING_OAUTH_SCREEN"&&M(Fl,{}),r==="ALLOWLIST_REJECTION_SCREEN"&&M(is,{}),r==="INSTALL_METAMASK_SCREEN"&&M(hl,{}),r==="INSTALL_PHANTOM_SCREEN"&&M(yl,{}),r==="INSTALL_COINBASE_WALLET_SCREEN"&&M(ul,{}),r==="LINK_EMAIL_SCREEN"&&M(kl,{}),r==="LINK_PHONE_SCREEN"&&M(Rl,{}),r==="LINK_WALLET_SCREEN"&&M(Wl,{}),r==="CONNECT_ONLY_LANDING_SCREEN"&&M(xs,{}),r==="CONNECT_ONLY_AUTHENTICATED_SCREEN"&&M(ws,{}),r==="EMBEDDED_WALLET_SCREEN"&&M(Js,{}),r==="EMBEDDED_WALLET_CREATED_SCREEN"&&M(Ds,{}),r==="EMBEDDED_WALLET_CONNECTING_SCREEN"&&M(Ms,{}),r==="EMBEDDED_WALLET_RECOVERY_SCREEN"&&M(js,{}),r==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&M(Hs,{}),r==="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"&&M(Rc,{}),r==="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"&&M(Sc,{})]})},Oc=()=>{let{closePrivyModal:e}=I(),{app:t}=v(),o=ef(i=>{i.key==="Escape"&&(t==null?void 0:t.render.inDialog)&&e()},[t==null?void 0:t.render.inDialog]);Mc(()=>(document.addEventListener("keydown",o,!1),()=>{document.removeEventListener("keydown",o,!1)}),[o]);let r=M(Nc,{onClick:i=>i.stopPropagation(),children:M(of,{})}),n=t!=null&&t.render.inDialog?M(nf,{id:"privy-dialog",onClick:()=>e(),children:r}):r;return tf.createPortal(n,t!=null&&t.render.inParentNodeId&&document.getElementById(t.render.inParentNodeId)||document.body)},rf=({children:e,...t})=>{let o=Xh(null);return Mc(()=>{var n;(n=document==null?void 0:document.activeElement)==null||n.blur();let r=(document==null?void 0:document.getElementById("root"))||(document==null?void 0:document.getElementById("__next"));if(!!r)return r.setAttribute("inert","true"),Zh(o==null?void 0:o.current),()=>{let i=(document==null?void 0:document.getElementById("root"))||(document==null?void 0:document.getElementById("__next"));!i||(i.removeAttribute("inert"),Jh())}},[t.open,t.onClose]),M("dialog",{open:!0,role:"dialog",...t,ref:o,children:e})},nf=Oi(rf)`
2080
2080
  position: fixed;
2081
2081
  top: 0;
2082
2082
  left: 0;
@@ -2135,4 +2135,4 @@ Resources:
2135
2135
  align-items: center;
2136
2136
  justify-content: center;
2137
2137
  height: 100%;
2138
- `;import vo from"tinycolor2";var Dc="#FFFFFF",sf="#000000",lf=Dc,cf="#1E1E1D";function df(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 Wt(e,t){let o=Math.max(0,Math.min(1,e.toHsl().l+t));return vo({...e.toHsl(),l:o})}function Uc({backgroundTheme:e,accentHex:t,successHex:o="#51BA81",errorHex:r="#EC6351",whiteHex:n=Dc,blackHex:i=sf}){let a;switch(e){case"light":a=lf;break;case"dark":a=cf;break;default:a=e;break}let l=vo(a),s=vo(t),u=vo(o),h=vo(r),C=df(l.getLuminance()),b=Wt(l,C==="light"?-.04:.11),m=Wt(l,C==="light"?-.88:.87),f=Wt(l,C==="light"?-.77:.75),p=Wt(l,C==="light"?-.43:.45).desaturate(C==="light"?60:20),w=Wt(l,C==="light"?-.13:.25).desaturate(C==="light"?60:20),A=Wt(s,.15),W=Wt(s,-.06),E=vo(s.getLuminance()>.5?i:n);return{colorScheme:C,background:l.toHslString(),background2:b.toHslString(),foreground:m.toHslString(),foreground2:f.toHslString(),foreground3:p.toHslString(),foreground4:w.toHslString(),accent:s.toHslString(),accentLight:A.toHslString(),accentDark:W.toHslString(),foregroundAccent:E.toHslString(),success:u.toHslString(),error:h.toHslString()}}var er={appearance:{theme:"light",accentColor:"#676FFF"},walletConnectCloudProjectId:aa,_render:{inDialog:!0,inParentNodeId:null}};function gn(e,t){var C,b,m,f,p,w,A,W,E,S;let o,r,n,i,a,l,s,u;if(t!=null&&t.loginMethods?(o=t.loginMethods.includes("email"),r=t.loginMethods.includes("sms"),n=t.loginMethods.includes("wallet"),i=t.loginMethods.includes("google"),a=t.loginMethods.includes("twitter"),l=t.loginMethods.includes("discord"),s=t.loginMethods.includes("github"),u=t.loginMethods.includes("apple")):(o=e.emailAuth,r=e.smsAuth,n=e.walletAuth,i=e.googleOAuth,a=e.twitterOAuth,l=e.discordOAuth,s=e.githubOAuth,u=e.appleOAuth),o&&r&&(console.warn("Enabling both email and SMS passwordless is not currently supported. Disabling SMS."),r=!1),!o&&!r&&[i,a,l,s,u].some(R=>R))throw new Error("To enable social logins you must also enable either SMS or Email login");if(![o,r,n,i,a,l,s,u].some(R=>R))throw new Error("You must enable at least one login method");return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,appearance:{logo:((C=t==null?void 0:t.appearance)==null?void 0:C.logo)??e.logoUrl,palette:Uc({backgroundTheme:((b=t==null?void 0:t.appearance)==null?void 0:b.theme)??er.appearance.theme,accentHex:((m=t==null?void 0:t.appearance)==null?void 0:m.accentColor)??e.accentColor??er.appearance.accentColor}),showWalletLoginFirst:((f=t==null?void 0:t.appearance)==null?void 0:f.showWalletLoginFirst)??e.showWalletLoginFirst},loginMethods:{wallet:n,email:o,sms:r,google:i,twitter:a,discord:l,github:s,apple:u},legal:{termsAndConditionsUrl:((p=t==null?void 0:t.legal)==null?void 0:p.termsAndConditionsUrl)??e.termsAndConditionsUrl,privacyPolicyUrl:((w=t==null?void 0:t.legal)==null?void 0:w.privacyPolicyUrl)??e.privacyPolicyUrl},walletConnectCloudProjectId:(t==null?void 0:t.walletConnectCloudProjectId)??e.walletConnectCloudProjectId??er.walletConnectCloudProjectId,embeddedWallets:{createOnLogin:((A=t==null?void 0:t.embeddedWallets)==null?void 0:A.createOnLogin)??e.embeddedWalletConfig.createOnLogin,requireUserPasswordOnCreate:((W=t==null?void 0:t.embeddedWallets)==null?void 0:W.requireUserPasswordOnCreate)??e.embeddedWalletConfig.requireUserPasswordOnCreate},render:{inDialog:((E=t==null?void 0:t._render)==null?void 0:E.inDialog)??er._render.inDialog,inParentNodeId:((S=t==null?void 0:t._render)==null?void 0:S.inParentNodeId)??er._render.inParentNodeId}}}function Bc(e,t){var o;return((o=e==null?void 0:e.appearance)==null?void 0:o.logo)&&typeof e.appearance.logo=="object"&&(e.appearance.logo="component"),{...e,legacyCreateEmbeddedWalletFlag:t}}import{useRef as pf,useEffect as uf}from"react";var vn=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;default:throw new Error(`invalid wallet event type ${t}`)}}};import{jsx as yf}from"react/jsx-runtime";var mf=function(e){return()=>`id-${e++}`}(0);function hf(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function tr(e){return e.error!==void 0}var bo=new vn;function or(e,t,o){let r=o.contentWindow;if(!r)throw new Error("iframe not initialized");return new Promise((n,i)=>{let a=mf();bo.enqueue(a,{resolve:n,reject:i}),r.postMessage({id:a,event:e,data:t},"*")})}function ff(e){switch(e.event){case"privy:iframe:ready":let t=bo.dequeue(e.event,e.id);return tr(e)?t.reject(new mt(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let o=bo.dequeue(e.event,e.id);return tr(e)?o.reject(new mt(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let r=bo.dequeue(e.event,e.id);return tr(e)?r.reject(new mt(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:recover":let n=bo.dequeue(e.event,e.id);return tr(e)?n.reject(new mt(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let i=bo.dequeue(e.event,e.id);return tr(e)?i.reject(new mt(e.error.type,e.error.message)):i.resolve(e.data)}}function Fc(e){let t=pf(null);return uf(()=>{let o=t.current;if(!o)return;function r(l){l&&l.origin===e.origin&&hf(l.data)&&ff(l.data)}let n={create(l){return or("privy:wallet:create",l,o)},connect(l){return or("privy:wallet:connect",l,o)},recover(l){return or("privy:wallet:recover",l,o)},rpc(l){return or("privy:wallet:rpc",l,o)}};window.addEventListener("message",r);let i=()=>e.onLoad(n),a=(...l)=>{console.error("privy iframe failed to load: ",...l),e.onLoadFailed()};return Pa(()=>or("privy:iframe:ready",{},o)).then(i,a),()=>window.removeEventListener("message",r)},[t.current]),yf("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},src:fr(e.origin,`/apps/${e.appId}/embedded-wallets`)})}import{createContext as gf,useContext as vf}from"react";var Di=gf({wallets:[]});function bf(){return vf(Di)}import{jsx as wo,jsxs as Gc}from"react/jsx-runtime";function Ef(e){return typeof e=="string"&&e.length===25}var rr;function So(){if(!rr){let e=G.get(Gt);return Promise.resolve(e||null)}return rr.getAccessToken()}var Hc,Ra=(e,t)=>Hc(e,t),zc,Ia=(e,t)=>zc(e,t),xf=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;G.put(Po,t);let o=new URL(window.location.href);o.searchParams.delete("privy_token"),window.history.pushState({},"",o)},Tf=({config:e,...t})=>{var r,n;if(!Ef(t.appId))throw new P("Cannot initialize the Privy provider with an invalid Privy app ID");rr||(rr=new Wo({appId:t.appId,apiUrl:t.apiUrl||dr}));let o=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&((r=o.embeddedWallets)==null?void 0:r.createOnLogin)===void 0&&(o.embeddedWallets||(o.embeddedWallets={}),o.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&((n=e==null?void 0:e.embeddedWallets)==null?void 0:n.createOnLogin)&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),wo(Pf,{...t,config:o,client:rr})},Pf=e=>{let t=e.client,[o,r]=ue(!1),[n,i]=ue(!1),[a,l]=ue(!1),[s,u]=ue(null),[h,C]=ue([]),b=Cf(h),[m,f]=ue(!1),[p,w]=ue(null),[A,W]=ue(!1),[E,S]=ue({status:"disconnected",connectError:null,connector:null,connectRetry:x}),[R,L]=ue(null),[N,ne]=ue(null),[z,ae]=ue({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,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserPasswordOnCreate:!1}}),[V,k]=ue(()=>{let c=Bc(e.config,e.createPrivyWalletOnLogin);return t.createAnalyticsEvent("sdk_initialize",c),gn(z,e.config)}),[U,O]=ue(!0),[j,te]=ue({}),[tt,ot]=ue(null),oe=c=>{c&&w(c),r(!0),t.createAnalyticsEvent("modal_open",{initialScreen:c})},re=c=>{V.embeddedWallets.createOnLogin!=="off"&&O(!0),oe(c)};Nt(()=>{var d,g;if(!N||!s){(d=t.connectors)==null||d.removeEmbeddedWalletConnector();return}let c=s==null?void 0:s.linkedAccounts.filter(y=>y.type==="wallet"&&y.walletClient==="privy");if(c&&c.length>0){let y=c[0].address;(g=t.connectors)==null||g.addEmbeddedWalletConnector(N,y)}},[N,s]),Nt(()=>{async function c(){var Dt;let d=await t.getServerConfig();ae(d);let g=gn(d,e.config);k(g),d.customApiUrl&&t.updateApiUrl(d.customApiUrl),t.initializeConnectorManager(g.walletConnectCloudProjectId),(Dt=t.connectors)==null||Dt.initialize();let y=rt();xf();let Z=await t.getAuthenticatedUser();l(!!Z),u(Z),i(!0),tt==null||tt(),y&&Z&&W(!0),nr()}c()},[t,tt,n]),Nt(()=>{let c=gn(z,e.config);k(c)},[e.config]);let rt=()=>{let c=new URLSearchParams(window.location.search),d=c.get("privy_oauth_code"),g=c.get("privy_oauth_state"),y=c.get("privy_oauth_provider");return d&&g&&y?(t.startAuthFlow(new nt(y,d,g)),re("AWAITING_OAUTH_SCREEN"),!0):!1},Lt=async(c,d,g)=>{var Z;let y=await((Z=t.connectors)==null?void 0:Z.createWalletConnector(c,d))||null;Co(y,g)};async function Co(c,d){if(!c)return S({status:"disconnected",connectError:new F("Unable to connect to wallet."),connector:null,connectRetry:x}),d==null?void 0:d(null);S({connector:c,status:"connecting",connectError:null,connectRetry:()=>Co(c,d)});try{let g=await c.connect({showPrompt:!0});return S(y=>({...y,status:"connected",connectError:null,connectRetry:x})),d==null?void 0:d(g)}catch(g){return g instanceof ke?console.error(g.cause?g.cause:g.message):console.error(g),S(y=>({...y,status:"disconnected",connectError:g})),d==null?void 0:d(null)}}let Mt=c=>{c!==null&&t.startAuthFlow(new gt(c))},nr=()=>{let c=new URLSearchParams(window.location.search),d=c.get("privy_connector"),g=c.get("privy_wallet_client");if(!d||!g)return;if(g==="phantom"&&!Pe()&&re("LOGIN_FAILED_SCREEN"),!t.connectors)throw new P("Connector not initialized");oe("AWAITING_CONNECTION");let y=new URL(window.location.href);y.searchParams.delete("privy_connector"),y.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",y),Lt(d,g,Mt)};Nt(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(u)},[n,a,s,t]);let Eo=()=>{W(!0),oe("LINK_WALLET_SCREEN")},ir=c=>{if(!a||!s)return!1;for(let d of s.linkedAccounts)if(d.type==="wallet"&&d.address===c.address)return!0;return!1},ar=async c=>{if(!t.connectors)throw new P("Connector not initialized");W(!!a);let d=t.connectors.findWalletConnector(c.connectorType,c.walletClientType)||null;S(g=>({...g,connector:d,status:"connected",connectError:null,connectRetry:x})),Mt(c),re("AWAITING_CONNECTION")},Q=async(c,d)=>{if(!t.connectors)throw new P("Connector not initialized");W(!!a),await Lt(c,d,Mt)},ft=()=>{C(c=>{var g;let d=((g=t.connectors)==null?void 0:g.wallets.map(y=>({...y,linked:ir(y),loginOrLink:async()=>{if(!await y.isConnected())throw new P("Wallet is not connected");if(y.connectorType==="embedded"&&y.walletClientType==="privy")throw new P("Cannot link or login with embedded wallet");ar(y)},unlink:async()=>{if(!a)throw new P("User is not authenticated.");if(y.connectorType==="embedded"&&y.walletClientType==="privy")throw new P("Cannot unlink an embedded wallet");let Z=await t.unlinkWallet(y.address);u(Z)}})))||[];return gr(c,d)?c:d})};Nt(()=>{ft()},[s==null?void 0:s.linkedAccounts]),Nt(()=>{if(n){if(!t.connectors)throw new P("Connector not initialized");ft(),t.connectors.on("walletsUpdated",ft)}},[n]);let wn=()=>{oe(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};Nt(()=>{if(!h[0])return;let c=h[0],d=b.current.find(y=>y.address===c.address),g=s==null?void 0:s.linkedAccounts.find(y=>y.type==="wallet"&&y.address===c.address);if(!d&&g){let y=Object.assign({},s);y.wallet=g&&{address:g.address,chainType:g.chainType,chainId:g.chainId,walletClient:g.walletClient,walletClientType:g.walletClientType,connectorType:g.connectorType},u(y)}b.current=h},[h]);let xo={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:wn,linkWallet:Eo,linkEmail:()=>{W(!0),oe("LINK_EMAIL_SCREEN")},linkPhone:()=>{W(!0),oe("LINK_PHONE_SCREEN")},linkGoogle:async()=>{await Ot.initLoginWithOAuth("google")},linkTwitter:async()=>{await Ot.initLoginWithOAuth("twitter")},linkDiscord:async()=>{await Ot.initLoginWithOAuth("discord")},linkGithub:async()=>{await Ot.initLoginWithOAuth("github")},linkApple:async()=>{await Ot.initLoginWithOAuth("apple")},login:async()=>{if(n||(await new Promise(c=>{ot(()=>c)}),ot(null)),a){console.warn("Attempted to log in, but user is already logged in. Use a `link` helper instead.");return}re()},logout:async()=>{await t.logout(),u(null),l(!1),w(null),W(!1),r(!1)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{var g;if(!s||!s.wallet)return new H;let c=h.find(y=>s.wallet&&y.address===s.wallet.address),d=(g=t.connectors)==null?void 0:g.walletConnectors.find(y=>y.wallets.find(Z=>Z.address===(c==null?void 0:c.address)));return!c||!d?new H:d.proxyProvider},getEthersProvider:()=>{var g;if(!s||!s.wallet)return new Ui(new Me(new H));let c=h.find(y=>s.wallet&&y.address===s.wallet.address),d=(g=t.connectors)==null?void 0:g.walletConnectors.find(y=>y.wallets.find(Z=>Z.address===(c==null?void 0:c.address)));return!c||!d?new Ui(new Me(new H)):new Ui(new Me(d.proxyProvider))},getWeb3jsProvider:()=>{var g;if(!s||!s.wallet)return new lt(new H);let c=h.find(y=>s.wallet&&y.address===s.wallet.address),d=(g=t.connectors)==null?void 0:g.walletConnectors.find(y=>y.wallets.find(Z=>Z.address===(c==null?void 0:c.address)));return!c||!d?new lt(new H):new lt(d.proxyProvider)},unlinkWallet:async c=>{let d=await t.unlinkWallet(c);return u(d),d},unlinkEmail:async c=>{let d=await t.unlinkEmail(c);return u(d),d},unlinkPhone:async c=>{let d=await t.unlinkPhone(c);return u(d),d},unlinkGoogle:async c=>{let d=await t.unlinkOAuth("google",c);return u(d),d},unlinkTwitter:async c=>{let d=await t.unlinkOAuth("twitter",c);return u(d),d},unlinkDiscord:async c=>{let d=await t.unlinkOAuth("discord",c);return u(d),d},unlinkGithub:async c=>{let d=await t.unlinkOAuth("github",c);return u(d),d},unlinkApple:async c=>{let d=await t.unlinkOAuth("apple",c);return u(d),d},setActiveWallet:async c=>{let d=h.find(y=>bn(y.address)===bn(c)),g=s==null?void 0:s.linkedAccounts.find(y=>y.type==="wallet"&&bn(y.address)===bn(c));if(!d||!await d.isConnected())L(c),Eo();else if(!d.linked)d.loginOrLink();else{let y=Object.assign({},s);y.wallet=g&&{address:g.address,chainType:g.chainType,chainId:g.chainId,walletClient:g.walletClient,walletClientType:g.walletClientType,connectorType:g.connectorType},u(y)}},forkSession:()=>t.forkSession(),createWallet:()=>new Promise((c,d)=>{if(!a||!s){d(new Error("User must be authenticated before creating a Privy wallet"));return}if($(s)){d(new Error("Only one Privy wallet per user is currently allowed"));return}O(!0),te({createWallet:{onSuccess:c,onFailure:d,callAuthOnSuccessOnClose:!1}}),oe("EMBEDDED_WALLET_SCREEN")}),signMessage:(c,d)=>new Promise((g,y)=>{if(!a||!s){y(new Error("User must be authenticated before signing with a Privy wallet"));return}if(!$(s)){y(new Error("Must have a Privy wallet before signing"));return}if(typeof c!="string"||c.length<1){y(new Error("Message must be a non-empty string"));return}O(!0);let Dt={message:c,onSuccess:g,onFailure:y,uiOptions:d||{}},Cn={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:y};te({signMessage:Dt,connectWallet:Cn}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")}),sendTransaction:(c,d)=>new Promise(async(g,y)=>{if(!a||!s){y(new Error("User must be authenticated before signing with a Privy wallet"));return}if(!$(s)){y(new Error("Must have a Privy wallet before signing"));return}O(!0);let Dt={transactionRequest:c,onSuccess:g,onFailure:y,uiOptions:d||{}},Cn={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:y};te({connectWallet:Cn,sendTransaction:Dt}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")}),exportWallet:()=>new Promise((c,d)=>{if(!a||!s){d(new Error("User must be authenticated before exporting their Privy wallet"));return}if(!$(s)){d(new Error("Must have a Privy wallet before exporting"));return}O(!0);let y={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:d},Z={appId:e.appId,origin:t.apiUrl,onSuccess:c,onFailure:d};te({keyExport:Z,connectWallet:y}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")})};Hc=xo.signMessage,zc=xo.sendTransaction;let Ot=(()=>({isNewUserThisSession:m,isLinking:A,linkingHint:R,walletConnectionStatus:E,getAuthFlow:()=>t.authFlow,getAuthMeta:()=>{var c;return(c=t.authFlow)==null?void 0:c.meta},closePrivyModal:(c={shouldCallAuthOnSuccess:!0})=>{var g;let d=n&&a&&s;c.shouldCallAuthOnSuccess&&d&&((g=e.onSuccess)==null||g.call(e,s,m)),t.authFlow=void 0,L(null),w(null),W(!1),f(!1),r(!1),t.createAnalyticsEvent("modal_closed")},connectWallet:Lt,initLoginWithWallet:Q,loginWithWallet:async()=>{if(!(t.authFlow instanceof gt))throw new P("Must initialize SIWE flow first.");let c,d;A?c=await t.link():{user:c,isNewUser:d}=await t.authenticate(),u(c||s||null),f(d||!1),l(!0)},initLoginWithOAuth:async c=>{t.startAuthFlow(new nt(c));let d=await t.authFlow.getAuthorizationUrl();d&&d.url&&window.location.assign(d.url)},loginWithOAuth:async()=>{if(!(t.authFlow instanceof nt))throw new P("Must initialize OAuth flow before calling loginWithOAuth");let c,d;n&&a?c=await t.link():{user:c,isNewUser:d}=await t.authenticate(),u(c),f(d||!1),l(!0)},initLoginWithEmail:async c=>{let d=new yt(c);t.startAuthFlow(d),await d.sendCodeEmail()},initLoginWithSms:async c=>{let d=new vt(c);t.startAuthFlow(d),await d.sendSmsCode()},resendEmailCode:async()=>{var c;await((c=t.authFlow)==null?void 0:c.sendCodeEmail())},resendSmsCode:async()=>{var c;await((c=t.authFlow)==null?void 0:c.sendSmsCode())},loginWithCode:async c=>{if(t.authFlow instanceof yt)t.authFlow.meta.emailCode=c.trim();else if(t.authFlow instanceof vt)t.authFlow.meta.smsCode=c.trim();else throw new P("Must initialize a passwordless code flow first");let d,g;A?d=await t.link():{user:d,isNewUser:g}=await t.authenticate(),u(d||s||null),f(g||!1),l(!0)},refreshUser:async()=>{let c=await t.getAuthenticatedUser();return u(c),c},walletProxy:N,createAnalyticsEvent:(c,d,g)=>t.createAnalyticsEvent(c,d,g),getUsdTokenPrice:c=>t.getUsdTokenPrice(c),recoverEmbeddedWallet:c=>new Promise((d,g)=>{if(!a||!s){g(new Error("User must be authenticated before recovering the Privy wallet"));return}let y=$(s);if(!y){g(new Error("Must have a Privy wallet in order to recover it"));return}O(!0),te({recoverWallet:{privyWallet:y,onCompleteNavigateTo:c,onFailure:g,onSuccess:d}}),oe("EMBEDDED_WALLET_RECOVERY_SCREEN")})}))(),Vc=wf(()=>({wallets:h}),[h]);return wo(Bn.Provider,{value:xo,children:Gc(Di.Provider,{value:Vc,children:[e.children,Gc(Un.Provider,{value:Ot,children:[wo(Wc,{theme:{...V.appearance.palette||{}}}),wo(Da,{appConfig:V,data:j,setModalData:te,initialScreen:p,visible:o,authenticated:a,children:o&&wo(Oc,{})}),U&&wo(Fc,{appId:e.appId,origin:t.apiUrl,onLoad:ne,onLoadFailed:()=>null})]})]})})};export{Me as AsExternalProvider,Io as ConnectorManager,Wo as PrivyClient,Tf as PrivyProvider,H as PrivyProxyProvider,En as VERSION,ve as WalletConnector,So as getAccessToken,B as usePrivy,bf as useWallets};
2138
+ `;import vo from"tinycolor2";var Dc="#FFFFFF",sf="#000000",lf=Dc,cf="#1E1E1D";function df(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 Wt(e,t){let o=Math.max(0,Math.min(1,e.toHsl().l+t));return vo({...e.toHsl(),l:o})}function Uc({backgroundTheme:e,accentHex:t,successHex:o="#51BA81",errorHex:r="#EC6351",whiteHex:n=Dc,blackHex:i=sf}){let a;switch(e){case"light":a=lf;break;case"dark":a=cf;break;default:a=e;break}let l=vo(a),s=vo(t),u=vo(o),h=vo(r),C=df(l.getLuminance()),b=Wt(l,C==="light"?-.04:.11),m=Wt(l,C==="light"?-.88:.87),f=Wt(l,C==="light"?-.77:.75),p=Wt(l,C==="light"?-.43:.45).desaturate(C==="light"?60:20),w=Wt(l,C==="light"?-.13:.25).desaturate(C==="light"?60:20),A=Wt(s,.15),W=Wt(s,-.06),E=vo(s.getLuminance()>.5?i:n);return{colorScheme:C,background:l.toHslString(),background2:b.toHslString(),foreground:m.toHslString(),foreground2:f.toHslString(),foreground3:p.toHslString(),foreground4:w.toHslString(),accent:s.toHslString(),accentLight:A.toHslString(),accentDark:W.toHslString(),foregroundAccent:E.toHslString(),success:u.toHslString(),error:h.toHslString()}}var tr={appearance:{theme:"light",accentColor:"#676FFF"},walletConnectCloudProjectId:aa,_render:{inDialog:!0,inParentNodeId:null}};function gn(e,t){var C,b,m,f,p,w,A,W,E,S;let o,r,n,i,a,l,s,u;if(t!=null&&t.loginMethods?(o=t.loginMethods.includes("email"),r=t.loginMethods.includes("sms"),n=t.loginMethods.includes("wallet"),i=t.loginMethods.includes("google"),a=t.loginMethods.includes("twitter"),l=t.loginMethods.includes("discord"),s=t.loginMethods.includes("github"),u=t.loginMethods.includes("apple")):(o=e.emailAuth,r=e.smsAuth,n=e.walletAuth,i=e.googleOAuth,a=e.twitterOAuth,l=e.discordOAuth,s=e.githubOAuth,u=e.appleOAuth),o&&r&&(console.warn("Enabling both email and SMS passwordless is not currently supported. Disabling SMS."),r=!1),!o&&!r&&[i,a,l,s,u].some(R=>R))throw new Error("To enable social logins you must also enable either SMS or Email login");if(![o,r,n,i,a,l,s,u].some(R=>R))throw new Error("You must enable at least one login method");return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,appearance:{logo:((C=t==null?void 0:t.appearance)==null?void 0:C.logo)??e.logoUrl,palette:Uc({backgroundTheme:((b=t==null?void 0:t.appearance)==null?void 0:b.theme)??tr.appearance.theme,accentHex:((m=t==null?void 0:t.appearance)==null?void 0:m.accentColor)??e.accentColor??tr.appearance.accentColor}),showWalletLoginFirst:((f=t==null?void 0:t.appearance)==null?void 0:f.showWalletLoginFirst)??e.showWalletLoginFirst},loginMethods:{wallet:n,email:o,sms:r,google:i,twitter:a,discord:l,github:s,apple:u},legal:{termsAndConditionsUrl:((p=t==null?void 0:t.legal)==null?void 0:p.termsAndConditionsUrl)??e.termsAndConditionsUrl,privacyPolicyUrl:((w=t==null?void 0:t.legal)==null?void 0:w.privacyPolicyUrl)??e.privacyPolicyUrl},walletConnectCloudProjectId:(t==null?void 0:t.walletConnectCloudProjectId)??e.walletConnectCloudProjectId??tr.walletConnectCloudProjectId,embeddedWallets:{createOnLogin:((A=t==null?void 0:t.embeddedWallets)==null?void 0:A.createOnLogin)??e.embeddedWalletConfig.createOnLogin,requireUserPasswordOnCreate:((W=t==null?void 0:t.embeddedWallets)==null?void 0:W.requireUserPasswordOnCreate)??e.embeddedWalletConfig.requireUserPasswordOnCreate},render:{inDialog:((E=t==null?void 0:t._render)==null?void 0:E.inDialog)??tr._render.inDialog,inParentNodeId:((S=t==null?void 0:t._render)==null?void 0:S.inParentNodeId)??tr._render.inParentNodeId}}}function Bc(e,t){var o;return((o=e==null?void 0:e.appearance)==null?void 0:o.logo)&&typeof e.appearance.logo=="object"&&(e.appearance.logo="component"),{...e,legacyCreateEmbeddedWalletFlag:t}}import{useRef as pf,useEffect as uf}from"react";var vn=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;default:throw new Error(`invalid wallet event type ${t}`)}}};import{jsx as yf}from"react/jsx-runtime";var mf=function(e){return()=>`id-${e++}`}(0);function hf(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function or(e){return e.error!==void 0}var bo=new vn;function rr(e,t,o){let r=o.contentWindow;if(!r)throw new Error("iframe not initialized");return new Promise((n,i)=>{let a=mf();bo.enqueue(a,{resolve:n,reject:i}),r.postMessage({id:a,event:e,data:t},"*")})}function ff(e){switch(e.event){case"privy:iframe:ready":let t=bo.dequeue(e.event,e.id);return or(e)?t.reject(new mt(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let o=bo.dequeue(e.event,e.id);return or(e)?o.reject(new mt(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let r=bo.dequeue(e.event,e.id);return or(e)?r.reject(new mt(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:recover":let n=bo.dequeue(e.event,e.id);return or(e)?n.reject(new mt(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let i=bo.dequeue(e.event,e.id);return or(e)?i.reject(new mt(e.error.type,e.error.message)):i.resolve(e.data)}}function Fc(e){let t=pf(null);return uf(()=>{let o=t.current;if(!o)return;function r(l){l&&l.origin===e.origin&&hf(l.data)&&ff(l.data)}let n={create(l){return rr("privy:wallet:create",l,o)},connect(l){return rr("privy:wallet:connect",l,o)},recover(l){return rr("privy:wallet:recover",l,o)},rpc(l){return rr("privy:wallet:rpc",l,o)}};window.addEventListener("message",r);let i=()=>e.onLoad(n),a=(...l)=>{console.error("privy iframe failed to load: ",...l),e.onLoadFailed()};return Pa(()=>rr("privy:iframe:ready",{},o)).then(i,a),()=>window.removeEventListener("message",r)},[t.current]),yf("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},src:fr(e.origin,`/apps/${e.appId}/embedded-wallets`)})}import{createContext as gf,useContext as vf}from"react";var Di=gf({wallets:[]});function bf(){return vf(Di)}import{jsx as wo,jsxs as Gc}from"react/jsx-runtime";function Ef(e){return typeof e=="string"&&e.length===25}var nr;function ko(){if(!nr){let e=G.get(Gt);return Promise.resolve(e||null)}return nr.getAccessToken()}var Hc,Ra=(e,t)=>Hc(e,t),zc,Ia=(e,t)=>zc(e,t),xf=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;G.put(Po,t);let o=new URL(window.location.href);o.searchParams.delete("privy_token"),window.history.pushState({},"",o)},Tf=({config:e,...t})=>{var r,n;if(!Ef(t.appId))throw new P("Cannot initialize the Privy provider with an invalid Privy app ID");nr||(nr=new No({appId:t.appId,apiUrl:t.apiUrl||pr}));let o=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&((r=o.embeddedWallets)==null?void 0:r.createOnLogin)===void 0&&(o.embeddedWallets||(o.embeddedWallets={}),o.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&((n=e==null?void 0:e.embeddedWallets)==null?void 0:n.createOnLogin)&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),wo(Pf,{...t,config:o,client:nr})},Pf=e=>{let t=e.client,[o,r]=ue(!1),[n,i]=ue(!1),[a,l]=ue(!1),[s,u]=ue(null),[h,C]=ue([]),b=Cf(h),[m,f]=ue(!1),[p,w]=ue(null),[A,W]=ue(!1),[E,S]=ue({status:"disconnected",connectError:null,connector:null,connectRetry:x}),[R,L]=ue(null),[N,ne]=ue(null),[z,ae]=ue({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,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserPasswordOnCreate:!1}}),[V,k]=ue(()=>{let c=Bc(e.config,e.createPrivyWalletOnLogin);return t.createAnalyticsEvent("sdk_initialize",c),gn(z,e.config)}),[U,O]=ue(!0),[j,te]=ue({}),[tt,ot]=ue(null),oe=c=>{c&&w(c),r(!0),t.createAnalyticsEvent("modal_open",{initialScreen:c})},re=c=>{V.embeddedWallets.createOnLogin!=="off"&&O(!0),oe(c)};Nt(()=>{var d,g;if(!N||!s){(d=t.connectors)==null||d.removeEmbeddedWalletConnector();return}let c=s==null?void 0:s.linkedAccounts.filter(y=>y.type==="wallet"&&y.walletClient==="privy");if(c&&c.length>0){let y=c[0].address;(g=t.connectors)==null||g.addEmbeddedWalletConnector(N,y)}},[N,s]),Nt(()=>{async function c(){var Dt;let d=await t.getServerConfig();ae(d);let g=gn(d,e.config);k(g),d.customApiUrl&&t.updateApiUrl(d.customApiUrl),t.initializeConnectorManager(g.walletConnectCloudProjectId),(Dt=t.connectors)==null||Dt.initialize();let y=rt();xf();let Z=await t.getAuthenticatedUser();l(!!Z),u(Z),i(!0),tt==null||tt(),y&&Z&&W(!0),ir()}c()},[t,tt,n]),Nt(()=>{let c=gn(z,e.config);k(c)},[e.config]);let rt=()=>{let c=new URLSearchParams(window.location.search),d=c.get("privy_oauth_code"),g=c.get("privy_oauth_state"),y=c.get("privy_oauth_provider");return d&&g&&y?(t.startAuthFlow(new nt(y,d,g)),re("AWAITING_OAUTH_SCREEN"),!0):!1},Lt=async(c,d,g)=>{var Z;let y=await((Z=t.connectors)==null?void 0:Z.createWalletConnector(c,d))||null;Co(y,g)};async function Co(c,d){if(!c)return S({status:"disconnected",connectError:new F("Unable to connect to wallet."),connector:null,connectRetry:x}),d==null?void 0:d(null);S({connector:c,status:"connecting",connectError:null,connectRetry:()=>Co(c,d)});try{let g=await c.connect({showPrompt:!0});return S(y=>({...y,status:"connected",connectError:null,connectRetry:x})),d==null?void 0:d(g)}catch(g){return g instanceof ke?console.error(g.cause?g.cause:g.message):console.error(g),S(y=>({...y,status:"disconnected",connectError:g})),d==null?void 0:d(null)}}let Mt=c=>{c!==null&&t.startAuthFlow(new gt(c))},ir=()=>{let c=new URLSearchParams(window.location.search),d=c.get("privy_connector"),g=c.get("privy_wallet_client");if(!d||!g)return;if(g==="phantom"&&!Pe()&&re("LOGIN_FAILED_SCREEN"),!t.connectors)throw new P("Connector not initialized");oe("AWAITING_CONNECTION");let y=new URL(window.location.href);y.searchParams.delete("privy_connector"),y.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",y),Lt(d,g,Mt)};Nt(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(u)},[n,a,s,t]);let Eo=()=>{W(!0),oe("LINK_WALLET_SCREEN")},ar=c=>{if(!a||!s)return!1;for(let d of s.linkedAccounts)if(d.type==="wallet"&&d.address===c.address)return!0;return!1},sr=async c=>{if(!t.connectors)throw new P("Connector not initialized");W(!!a);let d=t.connectors.findWalletConnector(c.connectorType,c.walletClientType)||null;S(g=>({...g,connector:d,status:"connected",connectError:null,connectRetry:x})),Mt(c),re("AWAITING_CONNECTION")},Q=async(c,d)=>{if(!t.connectors)throw new P("Connector not initialized");W(!!a),await Lt(c,d,Mt)},ft=()=>{C(c=>{var g;let d=((g=t.connectors)==null?void 0:g.wallets.map(y=>({...y,linked:ar(y),loginOrLink:async()=>{if(!await y.isConnected())throw new P("Wallet is not connected");if(y.connectorType==="embedded"&&y.walletClientType==="privy")throw new P("Cannot link or login with embedded wallet");sr(y)},unlink:async()=>{if(!a)throw new P("User is not authenticated.");if(y.connectorType==="embedded"&&y.walletClientType==="privy")throw new P("Cannot unlink an embedded wallet");let Z=await t.unlinkWallet(y.address);u(Z)}})))||[];return gr(c,d)?c:d})};Nt(()=>{ft()},[s==null?void 0:s.linkedAccounts]),Nt(()=>{if(n){if(!t.connectors)throw new P("Connector not initialized");ft(),t.connectors.on("walletsUpdated",ft)}},[n]);let wn=()=>{oe(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};Nt(()=>{if(!h[0])return;let c=h[0],d=b.current.find(y=>y.address===c.address),g=s==null?void 0:s.linkedAccounts.find(y=>y.type==="wallet"&&y.address===c.address);if(!d&&g){let y=Object.assign({},s);y.wallet=g&&{address:g.address,chainType:g.chainType,chainId:g.chainId,walletClient:g.walletClient,walletClientType:g.walletClientType,connectorType:g.connectorType},u(y)}b.current=h},[h]);let xo={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:wn,linkWallet:Eo,linkEmail:()=>{W(!0),oe("LINK_EMAIL_SCREEN")},linkPhone:()=>{W(!0),oe("LINK_PHONE_SCREEN")},linkGoogle:async()=>{await Ot.initLoginWithOAuth("google")},linkTwitter:async()=>{await Ot.initLoginWithOAuth("twitter")},linkDiscord:async()=>{await Ot.initLoginWithOAuth("discord")},linkGithub:async()=>{await Ot.initLoginWithOAuth("github")},linkApple:async()=>{await Ot.initLoginWithOAuth("apple")},login:async()=>{if(n||(await new Promise(c=>{ot(()=>c)}),ot(null)),a){console.warn("Attempted to log in, but user is already logged in. Use a `link` helper instead.");return}re()},logout:async()=>{await t.logout(),u(null),l(!1),w(null),W(!1),r(!1)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{var g;if(!s||!s.wallet)return new H;let c=h.find(y=>s.wallet&&y.address===s.wallet.address),d=(g=t.connectors)==null?void 0:g.walletConnectors.find(y=>y.wallets.find(Z=>Z.address===(c==null?void 0:c.address)));return!c||!d?new H:d.proxyProvider},getEthersProvider:()=>{var g;if(!s||!s.wallet)return new Ui(new Me(new H));let c=h.find(y=>s.wallet&&y.address===s.wallet.address),d=(g=t.connectors)==null?void 0:g.walletConnectors.find(y=>y.wallets.find(Z=>Z.address===(c==null?void 0:c.address)));return!c||!d?new Ui(new Me(new H)):new Ui(new Me(d.proxyProvider))},getWeb3jsProvider:()=>{var g;if(!s||!s.wallet)return new lt(new H);let c=h.find(y=>s.wallet&&y.address===s.wallet.address),d=(g=t.connectors)==null?void 0:g.walletConnectors.find(y=>y.wallets.find(Z=>Z.address===(c==null?void 0:c.address)));return!c||!d?new lt(new H):new lt(d.proxyProvider)},unlinkWallet:async c=>{let d=await t.unlinkWallet(c);return u(d),d},unlinkEmail:async c=>{let d=await t.unlinkEmail(c);return u(d),d},unlinkPhone:async c=>{let d=await t.unlinkPhone(c);return u(d),d},unlinkGoogle:async c=>{let d=await t.unlinkOAuth("google",c);return u(d),d},unlinkTwitter:async c=>{let d=await t.unlinkOAuth("twitter",c);return u(d),d},unlinkDiscord:async c=>{let d=await t.unlinkOAuth("discord",c);return u(d),d},unlinkGithub:async c=>{let d=await t.unlinkOAuth("github",c);return u(d),d},unlinkApple:async c=>{let d=await t.unlinkOAuth("apple",c);return u(d),d},setActiveWallet:async c=>{let d=h.find(y=>bn(y.address)===bn(c)),g=s==null?void 0:s.linkedAccounts.find(y=>y.type==="wallet"&&bn(y.address)===bn(c));if(!d||!await d.isConnected())L(c),Eo();else if(!d.linked)d.loginOrLink();else{let y=Object.assign({},s);y.wallet=g&&{address:g.address,chainType:g.chainType,chainId:g.chainId,walletClient:g.walletClient,walletClientType:g.walletClientType,connectorType:g.connectorType},u(y)}},forkSession:()=>t.forkSession(),createWallet:()=>new Promise((c,d)=>{if(!a||!s){d(new Error("User must be authenticated before creating a Privy wallet"));return}if($(s)){d(new Error("Only one Privy wallet per user is currently allowed"));return}O(!0),te({createWallet:{onSuccess:c,onFailure:d,callAuthOnSuccessOnClose:!1}}),oe("EMBEDDED_WALLET_SCREEN")}),signMessage:(c,d)=>new Promise((g,y)=>{if(!a||!s){y(new Error("User must be authenticated before signing with a Privy wallet"));return}if(!$(s)){y(new Error("Must have a Privy wallet before signing"));return}if(typeof c!="string"||c.length<1){y(new Error("Message must be a non-empty string"));return}O(!0);let Dt={message:c,onSuccess:g,onFailure:y,uiOptions:d||{}},Cn={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:y};te({signMessage:Dt,connectWallet:Cn}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")}),sendTransaction:(c,d)=>new Promise(async(g,y)=>{if(!a||!s){y(new Error("User must be authenticated before signing with a Privy wallet"));return}if(!$(s)){y(new Error("Must have a Privy wallet before signing"));return}O(!0);let Dt={transactionRequest:c,onSuccess:g,onFailure:y,uiOptions:d||{}},Cn={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:y};te({connectWallet:Cn,sendTransaction:Dt}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")}),exportWallet:()=>new Promise((c,d)=>{if(!a||!s){d(new Error("User must be authenticated before exporting their Privy wallet"));return}if(!$(s)){d(new Error("Must have a Privy wallet before exporting"));return}O(!0);let y={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:d},Z={appId:e.appId,origin:t.apiUrl,onSuccess:c,onFailure:d};te({keyExport:Z,connectWallet:y}),oe("EMBEDDED_WALLET_CONNECTING_SCREEN")})};Hc=xo.signMessage,zc=xo.sendTransaction;let Ot=(()=>({isNewUserThisSession:m,isLinking:A,linkingHint:R,walletConnectionStatus:E,getAuthFlow:()=>t.authFlow,getAuthMeta:()=>{var c;return(c=t.authFlow)==null?void 0:c.meta},closePrivyModal:(c={shouldCallAuthOnSuccess:!0})=>{var g;let d=n&&a&&s;c.shouldCallAuthOnSuccess&&d&&((g=e.onSuccess)==null||g.call(e,s,m)),t.authFlow=void 0,L(null),w(null),W(!1),f(!1),r(!1),t.createAnalyticsEvent("modal_closed")},connectWallet:Lt,initLoginWithWallet:Q,loginWithWallet:async()=>{if(!(t.authFlow instanceof gt))throw new P("Must initialize SIWE flow first.");let c,d;A?c=await t.link():{user:c,isNewUser:d}=await t.authenticate(),u(c||s||null),f(d||!1),l(!0)},initLoginWithOAuth:async c=>{t.startAuthFlow(new nt(c));let d=await t.authFlow.getAuthorizationUrl();d&&d.url&&window.location.assign(d.url)},loginWithOAuth:async()=>{if(!(t.authFlow instanceof nt))throw new P("Must initialize OAuth flow before calling loginWithOAuth");let c,d;n&&a?c=await t.link():{user:c,isNewUser:d}=await t.authenticate(),u(c),f(d||!1),l(!0)},initLoginWithEmail:async c=>{let d=new yt(c);t.startAuthFlow(d),await d.sendCodeEmail()},initLoginWithSms:async c=>{let d=new vt(c);t.startAuthFlow(d),await d.sendSmsCode()},resendEmailCode:async()=>{var c;await((c=t.authFlow)==null?void 0:c.sendCodeEmail())},resendSmsCode:async()=>{var c;await((c=t.authFlow)==null?void 0:c.sendSmsCode())},loginWithCode:async c=>{if(t.authFlow instanceof yt)t.authFlow.meta.emailCode=c.trim();else if(t.authFlow instanceof vt)t.authFlow.meta.smsCode=c.trim();else throw new P("Must initialize a passwordless code flow first");let d,g;A?d=await t.link():{user:d,isNewUser:g}=await t.authenticate(),u(d||s||null),f(g||!1),l(!0)},refreshUser:async()=>{let c=await t.getAuthenticatedUser();return u(c),c},walletProxy:N,createAnalyticsEvent:(c,d,g)=>t.createAnalyticsEvent(c,d,g),getUsdTokenPrice:c=>t.getUsdTokenPrice(c),recoverEmbeddedWallet:c=>new Promise((d,g)=>{if(!a||!s){g(new Error("User must be authenticated before recovering the Privy wallet"));return}let y=$(s);if(!y){g(new Error("Must have a Privy wallet in order to recover it"));return}O(!0),te({recoverWallet:{privyWallet:y,onCompleteNavigateTo:c,onFailure:g,onSuccess:d}}),oe("EMBEDDED_WALLET_RECOVERY_SCREEN")})}))(),Vc=wf(()=>({wallets:h}),[h]);return wo(Bn.Provider,{value:xo,children:Gc(Di.Provider,{value:Vc,children:[e.children,Gc(Un.Provider,{value:Ot,children:[wo(Wc,{theme:{...V.appearance.palette||{}}}),wo(Da,{appConfig:V,data:j,setModalData:te,initialScreen:p,visible:o,authenticated:a,children:o&&wo(Oc,{})}),U&&wo(Fc,{appId:e.appId,origin:t.apiUrl,onLoad:ne,onLoadFailed:()=>null})]})]})})};export{Me as AsExternalProvider,Wo as ConnectorManager,No as PrivyClient,Tf as PrivyProvider,H as PrivyProxyProvider,En as VERSION,ve as WalletConnector,ko as getAccessToken,B as usePrivy,bf as useWallets};