@privy-io/react-auth 1.81.3 → 1.83.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,118 +0,0 @@
1
- var B=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Rn=(e,t,n)=>(B(e,t,"read from private field"),n?n.call(e):t.get(e)),Dn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Nn=(e,t,n,r)=>(B(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Fn=(e,t,n)=>(B(e,t,"access private method"),n);var te="1.81.3";var ne="34357d3c125c2bcf2ce2bc3309d98715",Bn="https://auth.privy.io",$n=2e4,Gn=1400,Yn=2500,zn=4e3,qn=te;var Vn="privy:token",Xn="privy-token",Zn="privy:refresh_token",Jn="privy-refresh-token",Qn="privy:id_token",eo="privy-id-token",to="privy-session",no="privy:session_transfer_token",At="privy:wallet",oo="privy:caid",ro=e=>`privy:guest:${e}`,io=e=>`privy:cross-app:${e}`,so="privy:state_code",ao="privy:code_verifier",lo="privy:headless_oauth",co=e=>`${At}:${e}`,po="privy:connectors",uo="privy:connections";var mo=12e4,ho=1,fo="0x1",go=3e4,yo="https://api.moonpay.com/v1",bo="https://api.moonpay.com/v1",Eo="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",vo="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var Co="deprecated";var oe={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},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 re={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0};var ie={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}};var se={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0};var ae={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}};var le={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0};var ce={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0};var pe={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1};var ue={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0};var de={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 me={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}};var he={id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}};var fe={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}};var ge={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1};var ye={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0};var be={id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}};var M={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},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 Ee={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},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 ve={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0};var Ce={id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},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 we={id:80002,name:"Polygon Amoy",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0};var Ae={id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}};var xe={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0};var _e={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}};var Se={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0};var Pe={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0};var R=[oe,re,xe,M,Ee,ve,Ce,we,pe,ue,de,me,ae,le,ce,be,ge,ye,ie,se,_e,Pe,Se,fe,Ae,he],Cr=new Set(R.map(e=>e.id));import{createContext as xt,useContext as _t}from"react";var o=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var I=xt({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:o,login:o,connectOrCreateWallet:o,linkEmail:o,linkPhone:o,linkFarcaster:o,linkWallet:o,linkCrossAppAccount:o,linkGoogle:o,linkTwitter:o,linkDiscord:o,linkGithub:o,linkSpotify:o,linkInstagram:o,linkTelegram:o,linkTiktok:o,linkLinkedIn:o,linkApple:o,linkPasskey:o,updateEmail:o,updatePhone:o,logout:o,getAccessToken:o,getEthereumProvider:o,getEthersProvider:o,getWeb3jsProvider:o,unlinkEmail:o,unlinkPhone:o,unlinkWallet:o,unlinkGoogle:o,unlinkTwitter:o,unlinkDiscord:o,unlinkGithub:o,unlinkSpotify:o,unlinkInstagram:o,unlinkTiktok:o,unlinkLinkedIn:o,unlinkApple:o,unlinkCrossAppAccount:o,unlinkFarcaster:o,unlinkTelegram:o,unlinkPasskey:o,setActiveWallet:o,forkSession:o,createWallet:o,importWallet:o,signMessage:o,signTypedData:o,enrollInMfa:o,initEnrollmentWithSms:o,initEnrollmentWithTotp:o,initEnrollmentWithPasskey:o,promptMfa:o,init:o,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:o,submitEnrollmentWithPasskey:o,unenroll:o,submit:o,cancel:o,sendTransaction:o,exportWallet:o,setWalletPassword:o,setWalletRecovery:o,requestFarcasterSignerFromWarpcast:o,getFarcasterSignerPublicKey:o,signFarcasterMessage:o,createGuestAccount:o,initLoginWithEmail:o,initLoginWithSms:o,otpState:{status:"initial"},loginWithCode:o,fundWallet:o,initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:o,generateSiweMessage:o,linkWithSiwe:o,signMessageWithCrossAppWallet:o,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:o,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[],setCustomMetadata:o}),Te=()=>_t(I);import{createContext as St,useContext as Pt}from"react";var Tt=St(null);function Tr(){let e=Pt(Tt);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}import{useContext as Lt}from"react";import{createContext as kt,useContext as Wt,useEffect as It}from"react";var Ir={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},setCustomMetadata:{onSuccess:[],onError:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},Ot=kt(void 0),ke=()=>Wt(Ot);function y(e,t){if(!t)return;let r=ke().current[e];return It(()=>{for(let[i,s]of Object.entries(t))r.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${e}"`),r[i]?.push(s);return()=>{for(let[i,s]of Object.entries(t))r.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${e}"`),r[i]=r[i]?.filter(l=>l!==s)}},[t])}function Ut(e,t,n,...r){for(let i of e.current[t][n])i(...r)}function Or(){let e=ke();return(t,n,...r)=>Ut(e,t,n,...r)}function Dr(e){let{login:t}=Lt(I);return y("login",e),{login:t}}import{useContext as Mt}from"react";function Kr(e){let{logout:t}=Mt(I);return y("logout",e),{logout:t}}var Yr=e=>{y("fundWallet",e);let{fundWallet:t}=Te();return{fundWallet:t}};import{FetchError as Rt}from"ofetch";var E=class extends Error{constructor(n,r,i){super(n);r instanceof Error&&(this.cause=r),this.privyErrorCode=i}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},D=class extends E{constructor(n,r,i,s,l){super(i,s,l);this.type=n;this.status=r}},g=class extends E{constructor(n,r,i){super(n,r,i);this.type="client_error"}},We=class extends g{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var b=class extends E{constructor(n,r,i){super(n,r,i);this.type="connector_error"}},Vr=e=>{if(e instanceof E)return e;if(!(e instanceof Rt))return Dt(e);if(!e.response)return new D("api_error",null,e.message,e);let{type:t,message:n,error:r,code:i}=e.data;return new D(t||"ApiError",e.response.status,n||r,e,i)},Dt=e=>e instanceof E?e:e instanceof Error?new g(e.message,e):new g(`Internal error: ${e}`);var Ie=class extends g{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Oe=class extends g{constructor(t="Embedded wallet error",n){super(t,n,"unknown_embedded_wallet_error")}},Ue=class extends g{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Le=class extends g{constructor(t){super("This application is in development mode and must be upgraded to production to log in new users.",t,"max_accounts_reached")}};var $=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,n){n!==void 0?this._cache[t]=n:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},N=class{get(t){let n=localStorage.getItem(t);return n===null?void 0:JSON.parse(n)}put(t,n){n!==void 0?localStorage.setItem(t,JSON.stringify(n)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function Zr(){try{let e="privy:__session_storage__test",t="blobby",n=new N;return n.put(e,t),n.del(e),!0}catch{return!1}}function Nt(){return typeof window<"u"&&window.localStorage?new N:new $}var P=Nt();function Me(){let e=window,t=e.ethereum;if(!t)return[];let n=[];if(t.providers?.length)for(let r of t.providers)r&&n.push(r);return n.push(e.ethereum),n}var F=e=>{if(e.isApexWallet)return"Apex Wallet";if(e.isAvalanche)return"Core Wallet";if(e.isBackpack)return"Backpack";if(e.isBifrost)return"Bifrost Wallet";if(e.isBitKeep)return"BitKeep";if(e.isBitski)return"Bitski";if(e.isBlockWallet)return"BlockWallet";if(e.isBraveWallet)return"Brave Wallet";if(e.isClover)return"Clover";if(e.isCoin98)return"Coin98 Wallet";if(e.isCoinbaseWallet)return"Coinbase Wallet";if(e.isDawn)return"Dawn Wallet";if(e.isDefiant)return"Defiant";if(e.isDesig)return"Desig Wallet";if(e.isEnkrypt)return"Enkrypt";if(e.isExodus)return"Exodus";if(e.isFordefi)return"Fordefi";if(e.isFrame)return"Frame";if(e.isFrontier)return"Frontier Wallet";if(e.isGamestop)return"GameStop Wallet";if(e.isHaqqWallet)return"HAQQ Wallet";if(e.isHyperPay)return"HyperPay Wallet";if(e.isImToken)return"ImToken";if(e.isHaloWallet)return"Halo Wallet";if(e.isKuCoinWallet)return"KuCoin Wallet";if(e.isMathWallet)return"MathWallet";if(e.isNovaWallet)return"Nova Wallet";if(e.isOkxWallet||e.isOKExWallet)return"OKX Wallet";if(e.isOneInchIOSWallet||e.isOneInchAndroidWallet)return"1inch Wallet";if(e.isOneKey)return"OneKey Wallet";if(e.isOpera)return"Opera";if(e.isPhantom)return"Phantom";if(e.isPortal)return"Ripio Portal";if(e.isRabby)return"Rabby Wallet";if(e.isRainbow)return"Rainbow";if(e.isSafePal)return"SafePal Wallet";if(e.isStatus)return"Status";if(e.isSubWallet)return"SubWallet";if(e.isTalisman)return"Talisman";if(e.isTally||e.isTaho)return"Taho";if(e.isTokenPocket)return"TokenPocket";if(e.isTokenary)return"Tokenary";if(e.isTrust||e.isTrustWallet)return"Trust Wallet";if(e.isTTWallet)return"TTWallet";if(e.isXDEFI)return"XDEFI Wallet";if(e.isZeal)return"Zeal";if(e.isZerion)return"Zerion";if(e.isMetaMask)return"MetaMask"};var G=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||F(e)!=="MetaMask")return!1;if(e.providers){for(let n of e.providers)if(!G(n))return!1}return!0},ti=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),ni=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0}return!1};import{StaticJsonRpcProvider as O}from"@ethersproject/providers";var li=(e,t)=>{let n=[],r=[];for(let[i,s]of e.entries())i<t?n.push(s):r.push(s);return[n,r]},ci=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,}))$/),pi=(e,t)=>{let n=e.slice(0),r=[];for(;n.length;)r.push(n.splice(0,t));return r},Y=(e,t=3,n=4,r="ethereum")=>{if(!e)return"";let i=r==="ethereum"?2:0,s=3;if(t+n+i+s>=e.length)return e;let l=e.slice(0,i+t),c=e.slice(e.length-n,e.length);return`${l}...${c}`},Ft=e=>new Promise(t=>setTimeout(t,e));function ui(e,{interval:t=100,timeout:n=5e3}={}){return new Promise((r,i)=>{let s=0,l,c=()=>{if(s>=n){i("Max attempts reached without result");return}if(l=e(),s+=t,l!=null){r(l);return}setTimeout(c,t)};c()})}var di=(e,t={})=>{let n=t.delayMs||150,r=t.maxAttempts||270;return new Promise(async(i,s)=>{let l=!1,c=0;for(;!l&&c<r;){if(t.abortSignal?.aborted)return;e().then(a=>{l=!0,i(a)},(...a)=>{l=!0,s(...a)}),c+=1,await Ft(n)}l||s(new Error("Exceeded max attempts before resolving function"))})},mi=(e,t,n={},r={})=>{let i=new URL(t,e);for(let[l,c]of Object.entries(n))c!==void 0&&i.searchParams.set(l,c);let s=Object.entries(r);if(s.length>0){let l=new URLSearchParams;for(let[c,a]of s)l.append(c,a);i.hash=l.toString()}return i.href};var hi=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),fi=e=>typeof e=="string"?e:"0x"+e.toString(16);async function gi(e,t,n,r=3e3){let i=!1,s=window;return new Promise(l=>{s.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout(()=>{c()},r));function c(){if(i)return;i=!0,window.removeEventListener("ethereum#initialized",c);let a=e.getProviders();console.debug("Detected injected providers:",a.map(u=>u.info));let p=[];for(let u of a)t.includes("coinbase_wallet")&&u.info.rdns==="com.coinbase.wallet"||p.push({type:u.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:u});for(let u of Me()){let f=F(u);if(!a.some(d=>d.info.name===f)){if(G(u,!0)&&!p.find(d=>d.type==="metamask")){p.push({type:"metamask",legacyInjectedProvider:u});continue}if(f==="Phantom"&&!p.find(d=>d.type==="phantom")){p.push({type:"phantom",legacyInjectedProvider:u});continue}if(f==="Coinbase Wallet"&&!p.find(d=>d.type==="coinbase_wallet"&&n?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){p.push({type:"coinbase_wallet",legacyInjectedProvider:u});continue}p.find(d=>d.type==="unknown_browser_extension")||p.push({type:"unknown_browser_extension",legacyInjectedProvider:u})}}l(p)}})}function yi(e){return`eip155:${String(Number(e))}`}var bi=(e,t,n,r)=>{let i=Number(e),s=t.find(l=>l.id===i);if(!s)throw new b(`Unsupported chainId ${e}`,4901);return Ht(s,n,r)},Ht=(e,t,n)=>{let r=e.id,i=Number(e.id),s;if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])s=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[i])s=t.rpcUrls[i];else if(e.rpcUrls.privy?.http[0]){let l=new URL(e.rpcUrls.privy.http[0]);l.searchParams.append("privyAppId",n),s=l.toString()}else e.rpcUrls.public?.http[0]?s=e.rpcUrls.public.http[0]:s=e.rpcUrls.default?.http[0];if(!s)throw new b(`No RPC url found for ${r}`);return s},Re=(e,t)=>{let n=Number(e),r=t.find(i=>i.id===n);if(!r)throw new b(`Unsupported chainId ${e}`,4901);return r.blockExplorers?.default.url},Ei=(e,t,n,r)=>{let i=Number(e),s=t.find(c=>c.id===i);if(!s)throw new b(`Unsupported chainId ${e}`,4901);let l;if(s.rpcUrls.privyWalletOverride&&s.rpcUrls.privyWalletOverride.http[0]?l=new O(s.rpcUrls.privyWalletOverride.http[0]):n.rpcUrls&&n.rpcUrls[i]?l=new O(n.rpcUrls[i]):s.rpcUrls.privy?.http[0]?l=new O({url:s.rpcUrls.privy.http[0],headers:{"privy-app-id":r.appId}}):s.rpcUrls.public?.http[0]?l=new O(s.rpcUrls.public.http[0]):l=new O(s.rpcUrls.default?.http[0]),!l)throw new b(`No RPC url found for ${e}`);return l},vi=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},n=e.types.EIP712Domain??Object.entries(e.domain).map(([r,i])=>{if(i!=null&&typeof r=="string"&&r in t)return{name:r,type:t[r]}}).filter(r=>r!==void 0);return{...e,types:{...e.types,EIP712Domain:n}}};function Ci(e,{min:t,max:n}){return Math.min(Math.max(e,t),n)}import{jsx as De}from"react/jsx-runtime";var Ne=({...e})=>De("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:De("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});import{useContext as qe,useEffect as ze,useMemo as Jt,useState as Qt}from"react";import{createContext as en}from"react";var m={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:ne,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};var Fe=({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],n=[];e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`");for(let r of e.primary.slice(1))t.includes(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let r of e.overflow??[])!t.includes(r)&&!n.includes(r)?n.push(r):console.warn(`Duplicated login method: ${r}`);return{primary:t,overflow:n}};var jt=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet","safe"]),He=e=>jt.has(e),je=(e,t,n)=>n.indexOf(e)===t,Ke=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(He).filter(je):e?e.filter(He).filter(je):m.appearance.walletList;import v from"tinycolor2";var Be="#FFFFFF",Kt="#040217",Bt=Be,$t="#1E1E1D";function Gt(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 h(e,t){let n=Math.max(0,Math.min(1,e.toHsl().l+t));return v({...e.toHsl(),l:n})}var Yt="#51BA81",zt="#FFB74D",qt="#EC6351",Vt=Be,Xt=Kt;function $e({backgroundTheme:e,accentHex:t}){let n;switch(e){case"light":n=Bt;break;case"dark":n=$t;break;default:n=e;break}let r=v(n),i=v(t),s=v(Yt),l=v(zt),c=v(qt),a=Gt(r.getLuminance()),p=h(r,a==="light"?-.04:.11),u=h(r,a==="light"?-.88:.87),f=h(r,a==="light"?-.7:.75),d=h(r,a==="light"?-.43:.45).desaturate(a==="light"?60:20),C=h(r,a==="light"?-.08:.25).desaturate(a==="light"?60:20),w=h(i,.15),A=h(i,-.06),x=h(c,.3),_=h(l,.3),S=v(i.getLuminance()>.5?Xt:Vt),U=h(s,-.16),L=h(s,.4);return{colorScheme:a,background:r.toHslString(),background2:p.toHslString(),foreground:u.toHslString(),foreground2:f.toHslString(),foreground3:d.toHslString(),foreground4:C.toHslString(),accent:i.toHslString(),accentLight:w.toHslString(),accentDark:A.toHslString(),foregroundAccent:S.toHslString(),success:s.toHslString(),successDark:U.toHslString(),successLight:L.toHslString(),error:c.toHslString(),errorLight:x.toHslString(),warn:l.toHslString(),warnLight:_.toHslString()}}function z(e,t,n){let r=n?console.warn:()=>{},i,s,l,c,a,p,u,f,d,C,w,A,x,_,S;t?.loginMethods?(i=t.loginMethods.includes("email"),s=t.loginMethods.includes("sms"),c=t.loginMethods.includes("wallet"),a=t.loginMethods.includes("google"),p=t.loginMethods.includes("twitter"),u=t.loginMethods.includes("discord"),d=t.loginMethods.includes("spotify"),C=t.loginMethods.includes("instagram"),f=t.loginMethods.includes("tiktok"),A=t.loginMethods.includes("github"),w=t.loginMethods.includes("linkedin"),x=t.loginMethods.includes("apple"),_=t.loginMethods.includes("farcaster"),S=t.loginMethods.includes("telegram")):(i=e.emailAuth,s=e.smsAuth,c=e.walletAuth,a=e.googleOAuth,p=e.twitterOAuth,u=e.discordOAuth,A=e.githubOAuth,d=e.spotifyOAuth,C=e.instagramOAuth,f=e.tiktokOAuth,w=e.linkedinOAuth,x=e.appleOAuth,_=e.farcasterAuth,S=e.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?l=!1:e.passkeyAuth&&(l=!0);let U=[i,s].filter(Boolean),L=[a,p,u,A,d,C,f,w,x,_,S].filter(Boolean),j=[c].filter(Boolean);if(U.length+L.length+j.length===0)throw new Error("You must enable at least one login method");let k=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;k&&j.length===0?(r("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),k=!1):!k&&L.length+U.length===0&&(r("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),k=!0);let ht=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&r("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let ft=Ke({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),gt=Fe({input:t?.loginMethodsAndOrder}),yt=t?.intl?.defaultCountry??"US",{chains:bt,defaultChain:Et}=Zt({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),vt=!!t?.defaultChain,K=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,W,Q=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?K?W=t?.embeddedWallets?.noPromptOnSignature??!0:W=t?.embeddedWallets?.noPromptOnSignature??Q:W=Q,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&W!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:ee,...Ct}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??m.appearance.landingHeader,loginMessage:typeof t?.appearance?.loginMessage=="string"?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:$e({backgroundTheme:t?.appearance?.theme??m.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??m.appearance.accentColor}),loginGroupPriority:k?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:ft},loginMethods:{wallet:c,email:i,sms:s,passkey:l,google:a,twitter:p,discord:u,github:A,spotify:d,instagram:C,tiktok:f,linkedin:w,apple:x,farcaster:_,telegram:S},loginMethodsAndOrder:gt,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??m.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??m.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??m.rpcConfig.rpcTimeouts},chains:bt,defaultChain:Et,intl:{defaultCountry:yt},shouldEnforceDefaultChainOnConnect:vt,captchaEnabled:e.captchaEnabled??m.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??m.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:ht}},embeddedWallets:{...e.embeddedWalletConfig,...typeof ee=="boolean"?{requireUserOwnedRecoveryOnCreate:ee}:{},...K?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...Ct,noPromptOnSignature:W},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:K?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??m._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??m.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??m.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??m.fundingMethodConfig.moonpay.useSandbox}}}}function Ge(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:n,additionalChains:r,supportedChains:i,defaultChain:s,...l}=e;return{...l,...r?{additionalChains:r.map(a=>a.id)}:void 0,...i?{supportedChains:i.map(a=>a.id)}:void 0,...s?{defaultChain:s.id}:void 0,legacyCreateEmbeddedWalletFlag:t}}function Zt({additionalChains:e,supportedChains:t,defaultChainFromConfig:n,hasRpcConfigDefined:r}){let i;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(t.length===0)throw new Error("`supportedChains` must contain at least one chain");t.filter(a=>a.rpcUrls.privyWalletOverride).length>0&&r&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),i=t.map(a=>a.rpcUrls.privyWalletOverride?a:R.find(u=>u.id===a.id)??a)}else i=R.concat(e??[]);let s=t?i[0]:M,l=n??s;if(!i.find(c=>c.id===l.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:i,defaultChain:l}}var Ye=function(e,t=0){let n=3735928559^t,r=1103547991^t;for(let i=0,s;i<e.length;i++)s=e.charCodeAt(i),n=Math.imul(n^s,2654435761),r=Math.imul(r^s,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),4294967296*(2097151&r)+(n>>>0)};import{jsx as nn}from"react/jsx-runtime";var Ve={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},tn=z(Ve,void 0,!1),q=en({appConfig:tn,isServerConfigLoaded:!1}),Gi=({children:e,legacyCreateEmbeddedWalletFlag:t,client:n,clientConfig:r})=>{let[i,s]=Qt(null),l=Jt(()=>z(i??Ve,r,!!i),[i,r]);return ze(()=>{if(!i)return;let c=Ge(r,t),a=Ye(JSON.stringify(c)).toString(),p=`privy:sent:${i.id}:${a}`;localStorage.getItem(p)||(n.createAnalyticsEvent({eventName:"sdk_initialize",payload:c}),localStorage.setItem(p,"t"))},[r,t,i]),ze(()=>{i||(async()=>{try{let a=await n.getServerConfig();a.customApiUrl&&n.updateApiUrl(a.customApiUrl),s(a)}catch(a){console.warn("Error generating app config: ",a)}})()},[]),nn(q.Provider,{value:{appConfig:l,isServerConfigLoaded:!!i},children:e})},Xe=()=>{let{appConfig:e}=qe(q);return e},Yi=()=>{let{isServerConfigLoaded:e}=qe(q);return e};import{createContext as on,useContext as rn}from"react";var sn=on({isNewUserThisSession:!1,linkingOrConnectingHint:null,walletConnectionStatus:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",customAuthStatus:{status:"not-enabled"},nativeTokenSymbolForChainId:o,initializeWalletProxy:o,getAuthMeta:o,getAuthFlow:o,closePrivyModal:o,openPrivyModal:o,connectWallet:o,initLoginWithWallet:o,loginWithWallet:o,initLoginWithFarcaster:o,loginWithFarcaster:o,loginWithCode:o,initLoginWithEmail:o,initLoginWithSms:o,initUpdateEmail:o,initUpdatePhone:o,resendEmailCode:o,resendSmsCode:o,initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:o,crossAppAuthFlow:o,initLoginWithOAuth:o,recoveryOAuthFlow:o,loginWithOAuth:o,initLoginWithPasskey:o,loginWithPasskey:o,initLinkWithPasskey:o,linkWithPasskey:o,refreshUser:o,loginWithGuestAccountFlow:o,walletProxy:null,createAnalyticsEvent:o,acceptTerms:o,getUsdTokenPrice:o,recoverEmbeddedEthereumWallet:o,getMoonpaySignedUrl:o,initCoinbaseOnRamp:o,getCoinbaseOnRampStatus:o,updateWallets:o,fundWallet:o,setReadyToTrue:o,requestFarcasterSignerStatus:o,initLoginWithTelegram:o,loginWithTelegram:o,generateSiweMessage:o,linkWithSiwe:o,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:o,recoverEmbeddedSolanaWallet:o,exportSolanaWallet:o,solanaSignMessage:o,connectCoinbaseSmartWallet:o,setCustomMetadataForUser:o}),Ze=()=>rn(sn);import{useEffect as an,useState as ln}from"react";var Qi=e=>{let[t,n]=ln("auto");return an(()=>{let r=new ResizeObserver(i=>{n(i[0]?.contentRect.height??"auto")});return e.current&&r.observe(e.current),()=>{e.current&&r.unobserve(e.current)}},[e.current]),t};import Je from"styled-components";import{jsx as T,jsxs as Qe}from"react/jsx-runtime";var V=Je.div`
2
- margin-top: 16px;
3
- font-size: 13px;
4
- text-align: center;
5
- color: var(--privy-color-foreground-3);
6
-
7
- && > a {
8
- color: var(--privy-color-accent);
9
- }
10
- `;function os(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:n,requireUsersAcceptTerms:r}}=e.app;if(r&&!e.alwaysShowImplicitConsent)return T(V,{});if(!n&&!t)return T(V,{});let i=!!(t&&n);return Qe(V,{children:["By logging in I agree to the"," ",n&&T("a",{href:n,target:"_blank",children:i?"Terms":"Terms of Service"}),i&&" & ",t&&T("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var rs=()=>Qe(cn,{children:[T(Ne,{}),T("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})]}),cn=Je.div`
11
- display: flex;
12
- align-items: center;
13
- justify-content: center;
14
- padding-top: 8px;
15
- padding-bottom: 12px;
16
- gap: 2px;
17
-
18
- font-size: 13px;
19
-
20
- && svg {
21
- height: 14px;
22
- width: 14px;
23
- margin-bottom: 2px;
24
- opacity: 0.5;
25
- }
26
-
27
- && a {
28
- color: var(--privy-color-foreground-3);
29
- &:hover {
30
- text-decoration: underline;
31
- }
32
- }
33
-
34
- @media all and (display-mode: standalone) {
35
- padding-bottom: 30px;
36
- }
37
- `;import{useContext as pn,useEffect as un,useState as dn}from"react";import{createContext as mn}from"react";import{jsx as hn}from"react/jsx-runtime";var tt=mn({}),ms=({children:e})=>{let t=Xe(),[n,r]=dn({});return y("login",{onComplete:(i,s,l,c,a)=>{!a||a.type==="passkey"||a.type==="cross_app"||a.type==="wallet"&&a.walletClientType==="privy"||(P.put(et(t.id),a.type),a.type==="wallet"?(P.put(X(t.id),a.walletClientType),r({accountType:a.type,walletClientType:a.walletClientType})):(P.del(X(t.id)),r({accountType:a.type})))}}),un(()=>{if(!t.id)return;let i=P.get(et(t.id)),s=P.get(X(t.id));i&&r(i==="wallet"?{accountType:i,walletClientType:s}:{accountType:i})},[t.id]),hn(tt.Provider,{value:n,children:e})},et=e=>`privy:${e}:recent-login-method`,X=e=>`privy:${e}:recent-login-wallet-client`,hs=()=>pn(tt);import yn,{css as rt,keyframes as bn}from"styled-components";import{keyframes as fn,css as nt}from"styled-components";var gn=fn`
38
- from, to {
39
- background: var(--privy-color-foreground-4);
40
- color: var(--privy-color-foreground-4);
41
- }
42
-
43
- 50% {
44
- background: var(--privy-color-foreground-accent);
45
- color: var(--privy-color-foreground-accent);
46
- }
47
- `,ot=nt`
48
- ${e=>e.$isLoading?nt`
49
- width: 35%;
50
- animation: ${gn} 2s linear infinite;
51
- border-radius: var(--privy-border-radius-sm);
52
- `:""}
53
- `;import{jsx as vn}from"react/jsx-runtime";var it=({children:e,color:t,isLoading:n,isPulsing:r,className:i})=>vn(En,{$color:t,$isLoading:n,$isPulsing:r,className:i,children:e}),En=yn.span`
54
- padding: 0.125rem 0.5rem;
55
- font-size: 0.75rem;
56
- font-weight: 500;
57
- line-height: 1.125rem; /* 150% */
58
- border-radius: var(--privy-border-radius-sm);
59
-
60
- ${e=>{let t,n;e.$color==="green"&&(t="var(--privy-color-success-dark)",n="var(--privy-color-success-light)"),e.$color==="red"&&(t="var(--privy-color-error)",n="var(--privy-color-error-light)"),e.$color==="gray"&&(t="var(--privy-color-foreground-2)",n="var(--privy-color-background-2)");let r=bn`
61
- from, to {
62
- background-color: ${n};
63
- }
64
-
65
- 50% {
66
- background-color: rgba(${n}, 0.8);
67
- }
68
- `;return rt`
69
- color: ${t};
70
- background-color: ${n};
71
- ${e.$isPulsing&&rt`
72
- animation: ${r} 3s linear infinite;
73
- `};
74
- `}}
75
-
76
- ${ot}
77
- `;import Cn from"styled-components";var st=Cn.div`
78
- display: flex;
79
- flex-direction: column;
80
- `;import wn from"styled-components";var at=wn.span`
81
- text-align: left;
82
- font-size: 0.75rem;
83
- font-weight: 500;
84
- line-height: 1.125rem; /* 150% */
85
-
86
- color: var(--privy-color-error);
87
- `;import An from"styled-components";var lt=An.span`
88
- color: var(--privy-color-foreground-3);
89
- font-size: 0.75rem;
90
- font-weight: 500;
91
- line-height: 1.125rem; /* 150% */
92
- `;import xn from"@heroicons/react/24/outline/Square2StackIcon";import _n from"styled-components";import{jsx as ct,jsxs as Pn}from"react/jsx-runtime";var pt=({address:e,showCopyIcon:t,url:n,className:r})=>n?ct("a",{title:e,className:r,href:`${n}/address/${e}`,target:"_blank",children:Y(e)}):Pn("button",{title:e,className:r,onClick:()=>navigator.clipboard.writeText(e).catch(console.error),children:[Y(e),t&&ct(Sn,{})]}),Sn=_n(xn)`
93
- && {
94
- display: inline;
95
- }
96
- stroke-width: 2;
97
- height: 0.875rem;
98
- width: 0.875rem;
99
- margin-left: 0.125rem;
100
- color: var(--privy-color-foreground-3);
101
- `;import Tn,{css as kn}from"styled-components";var Wn=kn`
102
- && {
103
- border-width: 1px;
104
- padding: 0.5rem 1rem;
105
- }
106
-
107
- width: 100%;
108
- text-align: left;
109
- border: solid 1px var(--privy-color-foreground-4);
110
- border-radius: var(--privy-border-radius-md);
111
- display: flex;
112
- justify-content: space-between;
113
- align-items: center;
114
-
115
- ${e=>e.$state==="error"?"border-color: var(--privy-color-error);":""}
116
- `,ut=Tn.div`
117
- ${Wn}
118
- `;import{Fragment as In,jsx as H,jsxs as Z}from"react/jsx-runtime";var Ks=({errMsg:e,balance:t,address:n,isLoading:r,className:i,title:s,isPulsing:l,showIcon:c,statusColor:a="green"})=>{let p;return a?p=a:e?p="red":p="green",Z(In,{children:[Z(ut,{className:i,$state:e?"error":void 0,children:[Z(st,{children:[H(lt,{children:s||"Pay with"}),H(pt,{address:n,showCopyIcon:c||!!e})]}),t!==void 0&&H(it,{isLoading:r,isPulsing:l,color:p,children:t})]}),e&&H(at,{style:{marginTop:"0.25rem"},children:e})]})};import{BigNumber as On}from"@ethersproject/bignumber";import{formatEther as dt}from"@ethersproject/units";import{QuantityToBigNumber as Un}from"@privy-io/js-sdk-core";var Ln=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),mt=e=>Ln.format(e),Xs=(e,t)=>{let n=mt(t*parseFloat(e));return n!=="$0.00"?n:"<$0.01"},Zs=(e,t)=>{let n=mt(t*parseFloat(dt(e)));return n==="$0.00"?"<$0.01":n},Js=(e,t,n=6,r=!1)=>{let s=parseFloat(dt(e)).toFixed(n).replace(/0+$/,"").replace(/\.$/,"");return r?`${s} ${t}`:`${s==="0"?"<0.001":s} ${t}`},Qs=e=>e.map(Un).reduce((t,n)=>t.add(n),On.from(0)).toHexString(),ea=(e,t)=>{let{chains:n}=Ze(),r=`https://etherscan.io/address/${t}`,i=`${Re(e,n)}/address/${t}`;if(!i)return r;try{new URL(i)}catch{return r}return i};import{jsx as J}from"react/jsx-runtime";var na=({color:e,...t})=>J("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...t,children:J("g",{children:J("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});export{Rn as a,Dn as b,Nn as c,Fn as d,E as e,D as f,g,We as h,b as i,Vr as j,Dt as k,Ie as l,Oe as m,Ue as n,Le as o,Zr as p,P as q,ti as r,ni as s,li as t,ci as u,pi as v,Y as w,Ft as x,ui as y,di as z,mi as A,hi as B,fi as C,gi as D,yi as E,bi as F,Ht as G,Ei as H,vi as I,Ci as J,Bn as K,$n as L,Gn as M,Yn as N,zn as O,qn as P,Vn as Q,Xn as R,Zn as S,Jn as T,Qn as U,eo as V,to as W,no as X,oo as Y,ro as Z,io as _,so as $,ao as aa,lo as ba,co as ca,po as da,uo as ea,mo as fa,ho as ga,fo as ha,go as ia,yo as ja,bo as ka,Eo as la,vo as ma,Co as na,Ne as oa,oe as pa,re as qa,ie as ra,se as sa,ae as ta,le as ua,pe as va,ge as wa,M as xa,Ee as ya,ve as za,Ce as Aa,we as Ba,xe as Ca,_e as Da,R as Ea,Cr as Fa,tn as Ga,Gi as Ha,Xe as Ia,Yi as Ja,o as Ka,sn as La,Ze as Ma,I as Na,Te as Oa,Qi as Pa,Ir as Qa,Ot as Ra,y as Sa,Ut as Ta,Or as Ua,os as Va,rs as Wa,cn as Xa,ot as Ya,it as Za,ms as _a,hs as $a,at as ab,pt as bb,Wn as cb,ut as db,Ks as eb,na as fb,Tt as gb,Tr as hb,Xs as ib,Zs as jb,Js as kb,Qs as lb,ea as mb,Dr as nb,Kr as ob,Yr as pb};