@privy-io/react-auth 1.76.1 → 1.76.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 +1 -1
- package/dist/index.d.ts +16 -16
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var nd=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var vu=(e,t,r)=>(nd(e,t,"read from private field"),r?r.call(e):t.get(e)),fs=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},id=(e,t,r,o)=>(nd(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var Cu=(e,t,r)=>(nd(e,t,"access private method"),r);import{getAddress as Oo}from"@ethersproject/address";import{Web3Provider as cu}from"@ethersproject/providers";import{createStore as i_}from"mipd";import{useEffect as Yr,useMemo as a_,useRef as Xi,useState as st}from"react";import{isAndroid as s_}from"react-device-detect";import{ProviderErrors as l_,calculateTotalGasEstimate as c_,populateTransactionRequest as d_}from"@privy-io/js-sdk-core";import{FetchError as IC}from"ofetch";var et=class extends Error{constructor(r,o,n){super(r);o instanceof Error&&(this.cause=o),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},Mt=class extends et{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},w=class extends et{constructor(r,o,n){super(r,o,n);this.type="client_error"}},hs=class extends w{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var ce=class extends et{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},le=e=>{if(e instanceof et)return e;if(!(e instanceof IC))return tt(e);if(!e.response)return new Mt("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new Mt(t||"ApiError",e.response.status,r||o,e,n)},tt=e=>e instanceof et?e:e instanceof Error?new w(e.message,e):new w(`Internal error: ${e}`);var bo=class extends w{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Wt=class extends w{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},ys=class extends w{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var br=class extends w{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 gs="/api/v1/sessions",vs="/api/v1/sessions/logout",wu="/api/v1/sessions/fork",Cs="/api/v1/sessions/fork/recover",bu="/api/v1/siwe/init",Eu="/api/v1/siwe/authenticate",Tu="/api/v1/siwe/link",Su="/api/v1/siwe/unlink",_u="/api/v1/farcaster/init",Pu="/api/v1/farcaster/authenticate",Au="/api/v1/farcaster/link",xu="/api/v1/farcaster/status",ku="/api/v1/farcaster/unlink",Ru="/api/v1/passwordless/init",Iu="/api/v1/passwordless/authenticate",Mu="/api/v1/passwordless/link",Wu="/api/v1/passwordless/unlink",Ou="/api/v1/passwordless/update",Lu="/api/v1/passwordless_sms/init",Nu="/api/v1/passwordless_sms/link",Du="/api/v1/passwordless_sms/unlink",Uu="/api/v1/passwordless_sms/authenticate",ws="/api/v1/oauth/init",Fu="/api/v1/oauth/authenticate",bs="/api/v1/oauth/link",Bu="/api/v1/oauth/unlink",Hu="/api/v1/recovery/oauth/init",Gu="/api/v1/recovery/oauth/init_icloud",Vu="/api/v1/recovery/oauth/authenticate",qu="/api/v1/passkeys/link/init",zu="/api/v1/passkeys/authenticate/init",$u="/api/v1/passkeys/link",Ku="/api/v1/passkeys/authenticate",ju="/api/v1/passkeys/unlink",Yu="/api/v1/telegram/authenticate",Zu="/api/v1/telegram/link",Qu="/api/v1/telegram/unlink";var Ju="/api/v1/mfa/passwordless_sms/init",Xu="/api/v1/mfa/passkeys/init",em="/api/v1/users/me/accept_terms",Es="/api/v1/analytics_events",tm="/api/v1/custom_jwt_account/authenticate",rm="/api/v1/plugins/moonpay_on_ramp/sign",om="/api/v1/funding/coinbase_on_ramp/init",nm="/api/v1/funding/coinbase_on_ramp/status";var ei=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(tm,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw le(t)}}async link(){throw new Error("Unimplemented")}};var Lo=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(Iu,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw le(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(Mu,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw le(t)}}async sendCodeEmail(t,r){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new w("Email must be set when initialzing authentication.");try{return await this.api.post(Ru,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw le(o)}}},Ts=class extends Lo{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new w("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Ou,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw le(r)}}};import{isMobile as WC,isIOS as OC}from"react-device-detect";var ad=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,r){r!==void 0?this._cache[t]=r:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},Ss=class{get(t){let r=localStorage.getItem(t);return r===null?void 0:JSON.parse(r)}put(t,r){r!==void 0?localStorage.setItem(t,JSON.stringify(r)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function sd(){try{let e="privy:__session_storage__test",t="blobby",r=new Ss;return r.put(e,t),r.del(e),!0}catch{return!1}}function MC(){return typeof window<"u"&&window.localStorage?new Ss:new ad}var Q=MC();import{StaticJsonRpcProvider as ta}from"@ethersproject/providers";function im(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let o of t.providers)o&&r.push(o);return r.push(e.ethereum),r}var _s=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 ld=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||_s(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!ld(r))return!1}return!0},No=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Ps=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0}return!1};var am=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},As=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,}))$/),sm=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},dt=(e,t=3,r=4)=>{if(!e)return"";let o=2,n=3;if(t+r+o+n>=e.length)return e;let i=e.slice(0,o+t),a=e.slice(e.length-r,e.length);return`${i}...${a}`},cd=e=>new Promise(t=>setTimeout(t,e));function lm(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((o,n)=>{let i=0,a,l=()=>{if(i>=r){n("Max attempts reached without result");return}if(a=e(),i+=t,a!=null){o(a);return}setTimeout(l,t)};l()})}var ra=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<o;){if(t.abortSignal?.aborted)return;e().then(s=>{a=!0,n(s)},(...s)=>{a=!0,i(...s)}),l+=1,await cd(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},xs=(e,t,r={},o={})=>{let n=new URL(t,e);for(let[a,l]of Object.entries(r))l!==void 0&&n.searchParams.set(a,l);let i=Object.entries(o);if(i.length>0){let a=new URLSearchParams;for(let[l,s]of i)a.append(l,s);n.hash=a.toString()}return n.href};var cm=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),hn=e=>typeof e=="string"?e:"0x"+e.toString(16);async function dm(e,t,r,o=3e3){let n=!1,i=window;return new Promise(a=>{i.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},o));function l(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",l);let s=e.getProviders(),c=[];for(let m of s)t.includes("coinbase_wallet")&&m.info.rdns==="com.coinbase.wallet"||c.push({type:m.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:m});for(let m of im()){let f=_s(m);if(!s.some(u=>u.info.name===f)){if(ld(m,!0)&&!c.find(u=>u.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:m});continue}if(f==="Phantom"&&!c.find(u=>u.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:m});continue}if(f==="Coinbase Wallet"&&!c.find(u=>u.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:m});continue}c.find(u=>u.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:m})}}a(c)}})}function ti(e){return`eip155:${String(Number(e))}`}var pm=(e,t,r,o)=>{let n=Number(e),i=t.find(a=>a.id===n);if(!i)throw new ce(`Unsupported chainId ${e}`,4901);return dd(i,r,o)},dd=(e,t,r)=>{let o=e.id,n=Number(e.id),i;if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])i=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[n])i=t.rpcUrls[n];else if(e.rpcUrls.privy?.http[0]){let a=new URL(e.rpcUrls.privy.http[0]);a.searchParams.append("privyAppId",r),i=a.toString()}else e.rpcUrls.public?.http[0]?i=e.rpcUrls.public.http[0]:i=e.rpcUrls.default?.http[0];if(!i)throw new ce(`No RPC url found for ${o}`);return i},um=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new ce(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Gt=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new ce(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new ta(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new ta(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new ta({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.public?.http[0]?a=new ta(i.rpcUrls.public.http[0]):a=new ta(i.rpcUrls.default?.http[0]),!a)throw new ce(`No RPC url found for ${e}`);return a},oa=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([o,n])=>{if(n!=null&&typeof o=="string"&&o in t)return{name:o,type:t[o]}}).filter(o=>o!==void 0);return{...e,types:{...e.types,EIP712Domain:r}}};var ks=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(Rs))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var Rs={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function mm(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function fm(e,t){let r=mm(t);if(r.deepLink)return wm(r.deepLink,e);if(r.universalLink)return pd(r.universalLink,e);throw new w(`Unsupported wallet ${t.id}`)}function hm(e,t){let r=mm(t);if(r.universalLink)return pd(r.universalLink,e)}var ym="WALLETCONNECT_DEEPLINK_CHOICE";function gm(){try{localStorage.removeItem(ym)}catch{}}function vm({href:e,name:t}){try{localStorage.setItem(ym,JSON.stringify({href:e,name:t}))}catch{}}function Cm(e){return e.startsWith("http://")||e.startsWith("https://")}function wm(e,t){if(Cm(e))return pd(e,t);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function pd(e,t){if(!Cm(e))return wm(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function Is(e,t){window.open(e,t,"noreferrer noopener")}var Le=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var na=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Le(this._startChannelOnce.bind(this)),this.pollForReady=new Le(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("Auth flow must be initialized first");try{let t=await this.api.post(Pu,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new w("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw le(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(Au,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw le(t)}}async _startChannelOnce(){if(!this.api)throw new w("Auth flow has no API instance");let t=await this.api.post(_u,{token:this.captchaToken});WC&&!OC&&t.connect_uri&&Is(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new w("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("Auth flow must be initialized first");let t=await this.api.get(xu,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var bm="1.76.1";var Em="34357d3c125c2bcf2ce2bc3309d98715",Ms="https://auth.privy.io",Tm=2e4,Ne=1400,Ws=2500,ud=bm;var yn="privy:token",md="privy-token",Os="privy:refresh_token",Sm="privy-refresh-token",fd="privy:id_token",hd="privy-id-token",Ls="privy-session",ia="privy:session_transfer_token",NC="privy:wallet",aa="privy:caid",sa=e=>`privy:cross-app:${e}`,gn="privy:state_code",vn="privy:code_verifier",Cn="privy:headless_oauth",Ns=e=>`${NC}:${e}`,yd="privy:connectors",gd="privy:connections";var wn=12e4,Eo=1,vd="0x1",ri=3e4,_m="https://api.moonpay.com/v1",Pm="https://api.moonpay.com/v1",Am="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",xm="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var km="deprecated";import{base64url as Mm}from"jose";async function Rm(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function Im(e){return crypto.getRandomValues(new Uint8Array(e))}var DC="S256",UC="S256";function bn(){return Mm.encode(Im(36))}function oi(){return bn()}async function ni(e,t=DC){if(t==UC){let r=await Rm(e);return Mm.encode(r)}else return e}function Wm(){let e=Q.get(vn);if(!e)throw new w("Authentication error.");return e}function Ds(){return!!Q.get(Cn)}var Jr=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Ds();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=Wm();try{let r=await this.api.post(Fu,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Q.del(vn),this.meta.headless&&Q.del(Cn),{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=le(r);throw o.privyErrorCode?new w(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new w("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new w("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=Q.get(vn);if(!t)throw new w("Authentication error.");try{let r=await this.api.post(bs,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Q.del(vn),r}catch(r){throw le(r)}}async getAuthorizationUrl(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.provider)throw new w("Provider must be set when initializing OAuth authentication.");let t=bn();Q.put(vn,t);let r=oi();Q.put(gn,r);let o=await ni(t);this.meta.headless&&Q.put(Cn,!0);try{return await this.api.post(ws,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw le(n)}}};function Cd(e){return e.charAt(0).toUpperCase()+e.slice(1)}import{jsx as Om,jsxs as FC}from"react/jsx-runtime";var Us=({style:e,...t})=>FC("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:[Om("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"}),Om("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 la,jsxs as BC}from"react/jsx-runtime";var Fs=({style:e,...t})=>BC("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:[la("g",{clipPath:"url(#clip0)",children:la("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"})}),la("defs",{children:la("clipPath",{id:"clip0",children:la("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as Lm}from"react/jsx-runtime";var Bs=({style:e,...t})=>Lm("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:Lm("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{GlobeAltIcon as HC}from"@heroicons/react/24/outline";import{jsx as GC}from"react/jsx-runtime";var Nm=({style:e})=>GC(HC,{style:{color:"var(--privy-color-error)",...e}});import{jsx as Hs,jsxs as VC}from"react/jsx-runtime";var Gs=({style:e,...t})=>VC("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:[Hs("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"}),Hs("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"}),Hs("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"}),Hs("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 Er,jsxs as Vs}from"react/jsx-runtime";function qs(e){return Vs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[Vs("defs",{children:[Vs("linearGradient",{id:"b",children:[Er("stop",{offset:"0",stopColor:"#3771c8"}),Er("stop",{stopColor:"#3771c8",offset:".128"}),Er("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),Vs("linearGradient",{id:"a",children:[Er("stop",{offset:"0",stopColor:"#fd5"}),Er("stop",{offset:".1",stopColor:"#fd5"}),Er("stop",{offset:".5",stopColor:"#ff543e"}),Er("stop",{offset:"1",stopColor:"#c837ab"})]}),Er("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),Er("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),Er("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),Er("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),Er("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}import{jsx as zs}from"react/jsx-runtime";function $s({style:e,...t}){return zs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:zs("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:zs("g",{transform:"scale(5.12,5.12)",children:zs("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}import{jsx as Dm,jsxs as qC}from"react/jsx-runtime";function Ks(e){return qC("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[Dm("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),Dm("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}import{jsx as wd,jsxs as zC}from"react/jsx-runtime";function js(e){return zC("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[wd("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),wd("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),wd("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}import{jsx as Um}from"react/jsx-runtime";var Ys=({style:e,...t})=>Um("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:Um("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var Fm={google:{name:"Google",component:Gs},discord:{name:"Discord",component:Fs},github:{name:"Github",component:Bs},linkedin:{name:"LinkedIn",component:$s},twitter:{name:"Twitter",component:Ys},spotify:{name:"Spotify",component:Ks},instagram:{name:"Instagram",component:qs},tiktok:{name:"Tiktok",component:js},apple:{name:"Apple",component:Us}},ca=e=>e in Fm?Fm[e]:{name:"Unknown",component:Nm};function Bm(e,t){let r={detail:"",retryable:!1},o=Cd(t);if(e?.privyErrorCode==="linked_to_another_user"&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode==="invalid_credentials"&&(r.retryable=!0,r.detail="Something went wrong. Try again."),e.privyErrorCode==="oauth_user_denied"&&(r.detail=`Retry and check ${o} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode==="too_many_requests"&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("provider rate limit")){let n=ca(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=ca(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return e?.privyErrorCode==="cannot_link_more_of_type"&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode==="oauth_unexpected"&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}function da(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");if(!t||!r||!o)return{inProgress:!1};let n=!1;try{n=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:Ds(),popupFlow:window.opener!==null&&n}}function En(){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"),Q.del(gn),window.history.replaceState({},"",e)}var Tn=class{constructor(t){this.initAuthenticateOnce=new Le(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Le(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new w("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new w("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let r=await t.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),o=await this.api.post(Ku,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(r){throw r.name==="NotAllowedError"?new w("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):le(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let r=this.meta.initLinkResponse.options,o=await t.startRegistration(this._transformInitLinkOptionsToCamelCase(r));return await this.api.post($u,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new w("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):le(r)}}async _initAuthenticateOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(zu,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(qu,{})}_transformInitLinkOptionsToCamelCase(t){return{rp:t.rp,user:{id:t.user.id,name:t.user.name,displayName:t.user.display_name},challenge:t.challenge,pubKeyCredParams:t.pub_key_cred_params.map(r=>({type:r.type,alg:r.alg})),timeout:t.timeout,excludeCredentials:t.exclude_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports})),authenticatorSelection:{authenticatorAttachment:t.authenticator_selection?.authenticator_attachment,requireResidentKey:t.authenticator_selection?.require_resident_key,residentKey:t.authenticator_selection?.resident_key,userVerification:t.authenticator_selection?.user_verification},attestation:t.attestation,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props?.rk,hmacCreateSecret:t.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,attestation_object:t.response.attestationObject,authenticator_data:t.response.authenticatorData},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}_transformInitAuthenticateOptionsToCamelCase(t){return{challenge:t.challenge,allowCredentials:t.allow_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports}))||[],timeout:t.timeout,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props,hmacCreateSecret:t.extensions?.hmac_create_secret},userVerification:t.user_verification}}_transformAuthenticationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}};var Zs=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,i="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",a=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
|
|
1
|
+
var nd=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var vu=(e,t,r)=>(nd(e,t,"read from private field"),r?r.call(e):t.get(e)),fs=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},id=(e,t,r,o)=>(nd(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var Cu=(e,t,r)=>(nd(e,t,"access private method"),r);import{getAddress as Oo}from"@ethersproject/address";import{Web3Provider as cu}from"@ethersproject/providers";import{createStore as i_}from"mipd";import{useEffect as Yr,useMemo as a_,useRef as Xi,useState as st}from"react";import{isAndroid as s_}from"react-device-detect";import{ProviderErrors as l_,calculateTotalGasEstimate as c_,populateTransactionRequest as d_}from"@privy-io/js-sdk-core";import{FetchError as IC}from"ofetch";var et=class extends Error{constructor(r,o,n){super(r);o instanceof Error&&(this.cause=o),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},Mt=class extends et{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},w=class extends et{constructor(r,o,n){super(r,o,n);this.type="client_error"}},hs=class extends w{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var ce=class extends et{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},le=e=>{if(e instanceof et)return e;if(!(e instanceof IC))return tt(e);if(!e.response)return new Mt("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new Mt(t||"ApiError",e.response.status,r||o,e,n)},tt=e=>e instanceof et?e:e instanceof Error?new w(e.message,e):new w(`Internal error: ${e}`);var bo=class extends w{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Wt=class extends w{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},ys=class extends w{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var br=class extends w{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 gs="/api/v1/sessions",vs="/api/v1/sessions/logout",wu="/api/v1/sessions/fork",Cs="/api/v1/sessions/fork/recover",bu="/api/v1/siwe/init",Eu="/api/v1/siwe/authenticate",Tu="/api/v1/siwe/link",Su="/api/v1/siwe/unlink",_u="/api/v1/farcaster/init",Pu="/api/v1/farcaster/authenticate",Au="/api/v1/farcaster/link",xu="/api/v1/farcaster/status",ku="/api/v1/farcaster/unlink",Ru="/api/v1/passwordless/init",Iu="/api/v1/passwordless/authenticate",Mu="/api/v1/passwordless/link",Wu="/api/v1/passwordless/unlink",Ou="/api/v1/passwordless/update",Lu="/api/v1/passwordless_sms/init",Nu="/api/v1/passwordless_sms/link",Du="/api/v1/passwordless_sms/unlink",Uu="/api/v1/passwordless_sms/authenticate",ws="/api/v1/oauth/init",Fu="/api/v1/oauth/authenticate",bs="/api/v1/oauth/link",Bu="/api/v1/oauth/unlink",Hu="/api/v1/recovery/oauth/init",Gu="/api/v1/recovery/oauth/init_icloud",Vu="/api/v1/recovery/oauth/authenticate",qu="/api/v1/passkeys/link/init",zu="/api/v1/passkeys/authenticate/init",$u="/api/v1/passkeys/link",Ku="/api/v1/passkeys/authenticate",ju="/api/v1/passkeys/unlink",Yu="/api/v1/telegram/authenticate",Zu="/api/v1/telegram/link",Qu="/api/v1/telegram/unlink";var Ju="/api/v1/mfa/passwordless_sms/init",Xu="/api/v1/mfa/passkeys/init",em="/api/v1/users/me/accept_terms",Es="/api/v1/analytics_events",tm="/api/v1/custom_jwt_account/authenticate",rm="/api/v1/plugins/moonpay_on_ramp/sign",om="/api/v1/funding/coinbase_on_ramp/init",nm="/api/v1/funding/coinbase_on_ramp/status";var ei=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(tm,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw le(t)}}async link(){throw new Error("Unimplemented")}};var Lo=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(Iu,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw le(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(Mu,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw le(t)}}async sendCodeEmail(t,r){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new w("Email must be set when initialzing authentication.");try{return await this.api.post(Ru,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw le(o)}}},Ts=class extends Lo{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new w("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Ou,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw le(r)}}};import{isMobile as WC,isIOS as OC}from"react-device-detect";var ad=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,r){r!==void 0?this._cache[t]=r:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},Ss=class{get(t){let r=localStorage.getItem(t);return r===null?void 0:JSON.parse(r)}put(t,r){r!==void 0?localStorage.setItem(t,JSON.stringify(r)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function sd(){try{let e="privy:__session_storage__test",t="blobby",r=new Ss;return r.put(e,t),r.del(e),!0}catch{return!1}}function MC(){return typeof window<"u"&&window.localStorage?new Ss:new ad}var Q=MC();import{StaticJsonRpcProvider as ta}from"@ethersproject/providers";function im(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let o of t.providers)o&&r.push(o);return r.push(e.ethereum),r}var _s=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 ld=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||_s(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!ld(r))return!1}return!0},No=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Ps=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0}return!1};var am=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},As=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,}))$/),sm=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},dt=(e,t=3,r=4)=>{if(!e)return"";let o=2,n=3;if(t+r+o+n>=e.length)return e;let i=e.slice(0,o+t),a=e.slice(e.length-r,e.length);return`${i}...${a}`},cd=e=>new Promise(t=>setTimeout(t,e));function lm(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((o,n)=>{let i=0,a,l=()=>{if(i>=r){n("Max attempts reached without result");return}if(a=e(),i+=t,a!=null){o(a);return}setTimeout(l,t)};l()})}var ra=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<o;){if(t.abortSignal?.aborted)return;e().then(s=>{a=!0,n(s)},(...s)=>{a=!0,i(...s)}),l+=1,await cd(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},xs=(e,t,r={},o={})=>{let n=new URL(t,e);for(let[a,l]of Object.entries(r))l!==void 0&&n.searchParams.set(a,l);let i=Object.entries(o);if(i.length>0){let a=new URLSearchParams;for(let[l,s]of i)a.append(l,s);n.hash=a.toString()}return n.href};var cm=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),hn=e=>typeof e=="string"?e:"0x"+e.toString(16);async function dm(e,t,r,o=3e3){let n=!1,i=window;return new Promise(a=>{i.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},o));function l(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",l);let s=e.getProviders(),c=[];for(let m of s)t.includes("coinbase_wallet")&&m.info.rdns==="com.coinbase.wallet"||c.push({type:m.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:m});for(let m of im()){let f=_s(m);if(!s.some(u=>u.info.name===f)){if(ld(m,!0)&&!c.find(u=>u.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:m});continue}if(f==="Phantom"&&!c.find(u=>u.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:m});continue}if(f==="Coinbase Wallet"&&!c.find(u=>u.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:m});continue}c.find(u=>u.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:m})}}a(c)}})}function ti(e){return`eip155:${String(Number(e))}`}var pm=(e,t,r,o)=>{let n=Number(e),i=t.find(a=>a.id===n);if(!i)throw new ce(`Unsupported chainId ${e}`,4901);return dd(i,r,o)},dd=(e,t,r)=>{let o=e.id,n=Number(e.id),i;if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])i=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[n])i=t.rpcUrls[n];else if(e.rpcUrls.privy?.http[0]){let a=new URL(e.rpcUrls.privy.http[0]);a.searchParams.append("privyAppId",r),i=a.toString()}else e.rpcUrls.public?.http[0]?i=e.rpcUrls.public.http[0]:i=e.rpcUrls.default?.http[0];if(!i)throw new ce(`No RPC url found for ${o}`);return i},um=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new ce(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Gt=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new ce(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new ta(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new ta(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new ta({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.public?.http[0]?a=new ta(i.rpcUrls.public.http[0]):a=new ta(i.rpcUrls.default?.http[0]),!a)throw new ce(`No RPC url found for ${e}`);return a},oa=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([o,n])=>{if(n!=null&&typeof o=="string"&&o in t)return{name:o,type:t[o]}}).filter(o=>o!==void 0);return{...e,types:{...e.types,EIP712Domain:r}}};var ks=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(Rs))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var Rs={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function mm(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function fm(e,t){let r=mm(t);if(r.deepLink)return wm(r.deepLink,e);if(r.universalLink)return pd(r.universalLink,e);throw new w(`Unsupported wallet ${t.id}`)}function hm(e,t){let r=mm(t);if(r.universalLink)return pd(r.universalLink,e)}var ym="WALLETCONNECT_DEEPLINK_CHOICE";function gm(){try{localStorage.removeItem(ym)}catch{}}function vm({href:e,name:t}){try{localStorage.setItem(ym,JSON.stringify({href:e,name:t}))}catch{}}function Cm(e){return e.startsWith("http://")||e.startsWith("https://")}function wm(e,t){if(Cm(e))return pd(e,t);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function pd(e,t){if(!Cm(e))return wm(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function Is(e,t){window.open(e,t,"noreferrer noopener")}var Le=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var na=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Le(this._startChannelOnce.bind(this)),this.pollForReady=new Le(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("Auth flow must be initialized first");try{let t=await this.api.post(Pu,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new w("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw le(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(Au,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw le(t)}}async _startChannelOnce(){if(!this.api)throw new w("Auth flow has no API instance");let t=await this.api.post(_u,{token:this.captchaToken});WC&&!OC&&t.connect_uri&&Is(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new w("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("Auth flow must be initialized first");let t=await this.api.get(xu,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var bm="1.76.2";var Em="34357d3c125c2bcf2ce2bc3309d98715",Ms="https://auth.privy.io",Tm=2e4,Ne=1400,Ws=2500,ud=bm;var yn="privy:token",md="privy-token",Os="privy:refresh_token",Sm="privy-refresh-token",fd="privy:id_token",hd="privy-id-token",Ls="privy-session",ia="privy:session_transfer_token",NC="privy:wallet",aa="privy:caid",sa=e=>`privy:cross-app:${e}`,gn="privy:state_code",vn="privy:code_verifier",Cn="privy:headless_oauth",Ns=e=>`${NC}:${e}`,yd="privy:connectors",gd="privy:connections";var wn=12e4,Eo=1,vd="0x1",ri=3e4,_m="https://api.moonpay.com/v1",Pm="https://api.moonpay.com/v1",Am="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",xm="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var km="deprecated";import{base64url as Mm}from"jose";async function Rm(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function Im(e){return crypto.getRandomValues(new Uint8Array(e))}var DC="S256",UC="S256";function bn(){return Mm.encode(Im(36))}function oi(){return bn()}async function ni(e,t=DC){if(t==UC){let r=await Rm(e);return Mm.encode(r)}else return e}function Wm(){let e=Q.get(vn);if(!e)throw new w("Authentication error.");return e}function Ds(){return!!Q.get(Cn)}var Jr=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Ds();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=Wm();try{let r=await this.api.post(Fu,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Q.del(vn),this.meta.headless&&Q.del(Cn),{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=le(r);throw o.privyErrorCode?new w(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new w("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new w("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=Q.get(vn);if(!t)throw new w("Authentication error.");try{let r=await this.api.post(bs,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Q.del(vn),r}catch(r){throw le(r)}}async getAuthorizationUrl(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.provider)throw new w("Provider must be set when initializing OAuth authentication.");let t=bn();Q.put(vn,t);let r=oi();Q.put(gn,r);let o=await ni(t);this.meta.headless&&Q.put(Cn,!0);try{return await this.api.post(ws,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw le(n)}}};function Cd(e){return e.charAt(0).toUpperCase()+e.slice(1)}import{jsx as Om,jsxs as FC}from"react/jsx-runtime";var Us=({style:e,...t})=>FC("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:[Om("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"}),Om("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 la,jsxs as BC}from"react/jsx-runtime";var Fs=({style:e,...t})=>BC("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:[la("g",{clipPath:"url(#clip0)",children:la("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"})}),la("defs",{children:la("clipPath",{id:"clip0",children:la("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as Lm}from"react/jsx-runtime";var Bs=({style:e,...t})=>Lm("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:Lm("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{GlobeAltIcon as HC}from"@heroicons/react/24/outline";import{jsx as GC}from"react/jsx-runtime";var Nm=({style:e})=>GC(HC,{style:{color:"var(--privy-color-error)",...e}});import{jsx as Hs,jsxs as VC}from"react/jsx-runtime";var Gs=({style:e,...t})=>VC("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:[Hs("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"}),Hs("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"}),Hs("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"}),Hs("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 Er,jsxs as Vs}from"react/jsx-runtime";function qs(e){return Vs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[Vs("defs",{children:[Vs("linearGradient",{id:"b",children:[Er("stop",{offset:"0",stopColor:"#3771c8"}),Er("stop",{stopColor:"#3771c8",offset:".128"}),Er("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),Vs("linearGradient",{id:"a",children:[Er("stop",{offset:"0",stopColor:"#fd5"}),Er("stop",{offset:".1",stopColor:"#fd5"}),Er("stop",{offset:".5",stopColor:"#ff543e"}),Er("stop",{offset:"1",stopColor:"#c837ab"})]}),Er("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),Er("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),Er("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),Er("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),Er("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}import{jsx as zs}from"react/jsx-runtime";function $s({style:e,...t}){return zs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:zs("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:zs("g",{transform:"scale(5.12,5.12)",children:zs("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}import{jsx as Dm,jsxs as qC}from"react/jsx-runtime";function Ks(e){return qC("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[Dm("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),Dm("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}import{jsx as wd,jsxs as zC}from"react/jsx-runtime";function js(e){return zC("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[wd("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),wd("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),wd("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}import{jsx as Um}from"react/jsx-runtime";var Ys=({style:e,...t})=>Um("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:Um("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var Fm={google:{name:"Google",component:Gs},discord:{name:"Discord",component:Fs},github:{name:"Github",component:Bs},linkedin:{name:"LinkedIn",component:$s},twitter:{name:"Twitter",component:Ys},spotify:{name:"Spotify",component:Ks},instagram:{name:"Instagram",component:qs},tiktok:{name:"Tiktok",component:js},apple:{name:"Apple",component:Us}},ca=e=>e in Fm?Fm[e]:{name:"Unknown",component:Nm};function Bm(e,t){let r={detail:"",retryable:!1},o=Cd(t);if(e?.privyErrorCode==="linked_to_another_user"&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode==="invalid_credentials"&&(r.retryable=!0,r.detail="Something went wrong. Try again."),e.privyErrorCode==="oauth_user_denied"&&(r.detail=`Retry and check ${o} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode==="too_many_requests"&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("provider rate limit")){let n=ca(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=ca(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return e?.privyErrorCode==="cannot_link_more_of_type"&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode==="oauth_unexpected"&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}function da(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");if(!t||!r||!o)return{inProgress:!1};let n=!1;try{n=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:Ds(),popupFlow:window.opener!==null&&n}}function En(){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"),Q.del(gn),window.history.replaceState({},"",e)}var Tn=class{constructor(t){this.initAuthenticateOnce=new Le(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Le(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new w("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new w("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let r=await t.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),o=await this.api.post(Ku,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(r){throw r.name==="NotAllowedError"?new w("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):le(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let r=this.meta.initLinkResponse.options,o=await t.startRegistration(this._transformInitLinkOptionsToCamelCase(r));return await this.api.post($u,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new w("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):le(r)}}async _initAuthenticateOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(zu,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(qu,{})}_transformInitLinkOptionsToCamelCase(t){return{rp:t.rp,user:{id:t.user.id,name:t.user.name,displayName:t.user.display_name},challenge:t.challenge,pubKeyCredParams:t.pub_key_cred_params.map(r=>({type:r.type,alg:r.alg})),timeout:t.timeout,excludeCredentials:t.exclude_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports})),authenticatorSelection:{authenticatorAttachment:t.authenticator_selection?.authenticator_attachment,requireResidentKey:t.authenticator_selection?.require_resident_key,residentKey:t.authenticator_selection?.resident_key,userVerification:t.authenticator_selection?.user_verification},attestation:t.attestation,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props?.rk,hmacCreateSecret:t.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,attestation_object:t.response.attestationObject,authenticator_data:t.response.authenticatorData},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}_transformInitAuthenticateOptionsToCamelCase(t){return{challenge:t.challenge,allowCredentials:t.allow_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports}))||[],timeout:t.timeout,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props,hmacCreateSecret:t.extensions?.hmac_create_secret},userVerification:t.user_verification}}_transformAuthenticationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}};var Zs=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,i="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",a=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
|
|
2
2
|
${e}
|
|
3
3
|
|
|
4
4
|
${i}
|
package/dist/index.d.ts
CHANGED
|
@@ -1122,8 +1122,8 @@ declare class PrivyClient {
|
|
|
1122
1122
|
updateApiUrl(customApiUrl?: string | null): void;
|
|
1123
1123
|
authenticate(): Promise<{
|
|
1124
1124
|
user: User | null;
|
|
1125
|
-
isNewUser?: boolean
|
|
1126
|
-
oAuthTokens?: OAuthTokens
|
|
1125
|
+
isNewUser?: boolean;
|
|
1126
|
+
oAuthTokens?: OAuthTokens;
|
|
1127
1127
|
}>;
|
|
1128
1128
|
link(): Promise<{
|
|
1129
1129
|
user: User | null;
|
|
@@ -3177,8 +3177,8 @@ declare function useWallets(): UseWalletsInterface;
|
|
|
3177
3177
|
*/
|
|
3178
3178
|
declare function useMfa(): {
|
|
3179
3179
|
promptMfa: () => Promise<void>;
|
|
3180
|
-
init: (mfaMethod:
|
|
3181
|
-
submit: (mfaMethod:
|
|
3180
|
+
init: (mfaMethod: MfaMethod) => Promise<void | _simplewebauthn_types.PublicKeyCredentialRequestOptionsJSON>;
|
|
3181
|
+
submit: (mfaMethod: MfaMethod, mfaCode: string | _simplewebauthn_types.PublicKeyCredentialRequestOptionsJSON) => Promise<void>;
|
|
3182
3182
|
cancel: () => void;
|
|
3183
3183
|
mfaMethods: ("sms" | "totp" | "passkey")[];
|
|
3184
3184
|
};
|
|
@@ -3488,7 +3488,7 @@ declare function useLogin(callbacks?: PrivyEvents['login']): {
|
|
|
3488
3488
|
/**
|
|
3489
3489
|
* Opens the Privy login modal and prompts the user to login.
|
|
3490
3490
|
*/
|
|
3491
|
-
login: (options?: RuntimeLoginOverridableOptions | react.MouseEvent<any, any>
|
|
3491
|
+
login: (options?: RuntimeLoginOverridableOptions | react.MouseEvent<any, any>) => void;
|
|
3492
3492
|
};
|
|
3493
3493
|
|
|
3494
3494
|
/**
|
|
@@ -3767,8 +3767,8 @@ declare function useConnectWallet(callbacks?: PrivyEvents['connectWallet']): {
|
|
|
3767
3767
|
* Opens the Privy modal and prompts the user to connect a wallet.
|
|
3768
3768
|
*/
|
|
3769
3769
|
connectWallet: (options?: {
|
|
3770
|
-
suggestedAddress?: string
|
|
3771
|
-
} | react.MouseEvent<any, any>
|
|
3770
|
+
suggestedAddress?: string;
|
|
3771
|
+
} | react.MouseEvent<any, any>) => void;
|
|
3772
3772
|
};
|
|
3773
3773
|
|
|
3774
3774
|
/**
|
|
@@ -3824,7 +3824,7 @@ interface UseFundWalletInterface {
|
|
|
3824
3824
|
* @param callbacks.onUserExited {@link PrivyEvents} Callback that will execute when a funding flow is exited. This fires when a user closes a funding flow modal, for any reason.
|
|
3825
3825
|
* @returns fundWallet - function to on-ramp funds to any given wallet
|
|
3826
3826
|
*/
|
|
3827
|
-
declare const useFundWallet: (callbacks?: PrivyEvents[
|
|
3827
|
+
declare const useFundWallet: (callbacks?: PrivyEvents["fundWallet"]) => UseFundWalletInterface;
|
|
3828
3828
|
|
|
3829
3829
|
/**
|
|
3830
3830
|
* Hook to create and interact with Solana wallets. This currently only supports an embedded Solana wallet and no
|
|
@@ -3935,7 +3935,7 @@ declare function useSendTransaction(callbacks?: PrivyEvents['sendTransaction']):
|
|
|
3935
3935
|
/**
|
|
3936
3936
|
* Prompts a user to send a transaction using their embedded wallet.
|
|
3937
3937
|
*/
|
|
3938
|
-
sendTransaction: (data: UnsignedTransactionRequest, uiOptions?: SendTransactionModalUIOptions
|
|
3938
|
+
sendTransaction: (data: UnsignedTransactionRequest, uiOptions?: SendTransactionModalUIOptions, fundWalletConfig?: FundWalletConfig) => Promise<TransactionReceipt>;
|
|
3939
3939
|
};
|
|
3940
3940
|
|
|
3941
3941
|
/**
|
|
@@ -3983,7 +3983,7 @@ declare function useSignMessage(callbacks?: PrivyEvents['signMessage']): {
|
|
|
3983
3983
|
/**
|
|
3984
3984
|
* Prompts a user to sign a message using their embedded wallet.
|
|
3985
3985
|
*/
|
|
3986
|
-
signMessage: (message: string, uiOptions?: SignMessageModalUIOptions
|
|
3986
|
+
signMessage: (message: string, uiOptions?: SignMessageModalUIOptions) => Promise<string>;
|
|
3987
3987
|
};
|
|
3988
3988
|
|
|
3989
3989
|
/**
|
|
@@ -3997,7 +3997,7 @@ declare function useSignTypedData(callbacks?: PrivyEvents['signTypedData']): {
|
|
|
3997
3997
|
/**
|
|
3998
3998
|
* Prompts a user to sign typed data using their embedded wallet.
|
|
3999
3999
|
*/
|
|
4000
|
-
signTypedData: (typedData: SignTypedDataParams, uiOptions?: SignMessageModalUIOptions
|
|
4000
|
+
signTypedData: (typedData: SignTypedDataParams, uiOptions?: SignMessageModalUIOptions) => Promise<string>;
|
|
4001
4001
|
};
|
|
4002
4002
|
|
|
4003
4003
|
/**
|
|
@@ -4077,7 +4077,7 @@ declare function addRpcUrlOverrideToChain(chain: Chain, rpcUrl: string): {
|
|
|
4077
4077
|
};
|
|
4078
4078
|
default: {
|
|
4079
4079
|
http: readonly string[];
|
|
4080
|
-
webSocket?: readonly string[]
|
|
4080
|
+
webSocket?: readonly string[];
|
|
4081
4081
|
};
|
|
4082
4082
|
} | {
|
|
4083
4083
|
privyWalletOverride: {
|
|
@@ -4085,12 +4085,12 @@ declare function addRpcUrlOverrideToChain(chain: Chain, rpcUrl: string): {
|
|
|
4085
4085
|
};
|
|
4086
4086
|
default: {
|
|
4087
4087
|
http: readonly string[];
|
|
4088
|
-
webSocket?: readonly string[]
|
|
4088
|
+
webSocket?: readonly string[];
|
|
4089
4089
|
};
|
|
4090
4090
|
};
|
|
4091
4091
|
id: number;
|
|
4092
4092
|
name: string;
|
|
4093
|
-
network?: string
|
|
4093
|
+
network?: string;
|
|
4094
4094
|
nativeCurrency: {
|
|
4095
4095
|
name: string;
|
|
4096
4096
|
symbol: string;
|
|
@@ -4105,8 +4105,8 @@ declare function addRpcUrlOverrideToChain(chain: Chain, rpcUrl: string): {
|
|
|
4105
4105
|
name: string;
|
|
4106
4106
|
url: string;
|
|
4107
4107
|
};
|
|
4108
|
-
}
|
|
4109
|
-
testnet?: boolean
|
|
4108
|
+
};
|
|
4109
|
+
testnet?: boolean;
|
|
4110
4110
|
};
|
|
4111
4111
|
|
|
4112
4112
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var hw=Object.create;var dl=Object.defineProperty;var yw=Object.getOwnPropertyDescriptor;var gw=Object.getOwnPropertyNames;var vw=Object.getPrototypeOf,Cw=Object.prototype.hasOwnProperty;var ww=(e,t)=>{for(var r in t)dl(e,r,{get:t[r],enumerable:!0})},um=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of gw(t))!Cw.call(e,n)&&n!==r&&dl(e,n,{get:()=>t[n],enumerable:!(o=yw(t,n))||o.enumerable});return e};var y=(e,t,r)=>(r=e!=null?hw(vw(e)):{},um(t||!e||!e.__esModule?dl(r,"default",{value:e,enumerable:!0}):r,e)),bw=e=>um(dl({},"__esModule",{value:!0}),e);var rp=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var mm=(e,t,r)=>(rp(e,t,"read from private field"),r?r.call(e):t.get(e)),pl=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},op=(e,t,r,o)=>(rp(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var fm=(e,t,r)=>(rp(e,t,"access private method"),r);var c7={};ww(c7,{AsExternalProvider:()=>wo,Captcha:()=>ac,ConnectorManager:()=>sa,LoginModal:()=>Qd,PrivyClient:()=>la,PrivyProvider:()=>E0,PrivyProxyProvider:()=>ct,SUPPORTED_CHAINS:()=>ia,VERSION:()=>Ml,WalletConnector:()=>mr,addRpcUrlOverrideToChain:()=>rw,errorIndicatesMaxMfaRetries:()=>Mc,errorIndicatesMfaTimeout:()=>Bn,errorIndicatesMfaVerificationFailed:()=>Hn,getAccessToken:()=>Ie,getEmbeddedConnectedWallet:()=>ow,useConnectWallet:()=>O0,useCreateWallet:()=>N0,useCrossAppAccounts:()=>F0,useExperimentalFarcasterSigner:()=>tw,useFarcasterSigner:()=>om,useFundWallet:()=>D0,useLinkAccount:()=>M0,useLinkWithSiwe:()=>R0,useLogin:()=>S0,useLoginWithEmail:()=>x0,useLoginWithOAuth:()=>A0,useLoginWithSms:()=>k0,useLogout:()=>P0,useMfa:()=>$a,useMfaEnrollment:()=>ho,useModalStatus:()=>Q0,useOAuthTokens:()=>ew,usePrivy:()=>$,useRegisterMfaListener:()=>dc,useSendTransaction:()=>H0,useSetWalletPassword:()=>V0,useSetWalletRecovery:()=>z0,useSignMessage:()=>K0,useSignTypedData:()=>Y0,useSolanaWallets:()=>U0,useToken:()=>X0,useWallets:()=>mo});module.exports=bw(c7);var rn=require("@ethersproject/address"),ep=require("@ethersproject/providers"),f0=require("mipd"),ve=require("react"),h0=require("react-device-detect"),ts=require("@privy-io/js-sdk-core");var hm=require("ofetch"),wt=class extends Error{constructor(r,o,n){super(r);o instanceof Error&&(this.cause=o),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},pr=class extends wt{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},b=class extends wt{constructor(r,o,n){super(r,o,n);this.type="client_error"}},ul=class extends b{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var we=class extends wt{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},Ce=e=>{if(e instanceof wt)return e;if(!(e instanceof hm.FetchError))return bt(e);if(!e.response)return new pr("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new pr(t||"ApiError",e.response.status,r||o,e,n)},bt=e=>e instanceof wt?e:e instanceof Error?new b(e.message,e):new b(`Internal error: ${e}`);var nn=class extends b{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},ur=class extends b{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},ml=class extends b{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var ro=class extends b{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 fl="/api/v1/sessions",hl="/api/v1/sessions/logout",ym="/api/v1/sessions/fork",yl="/api/v1/sessions/fork/recover",gm="/api/v1/siwe/init",vm="/api/v1/siwe/authenticate",Cm="/api/v1/siwe/link",wm="/api/v1/siwe/unlink",bm="/api/v1/farcaster/init",Em="/api/v1/farcaster/authenticate",Tm="/api/v1/farcaster/link",Sm="/api/v1/farcaster/status",_m="/api/v1/farcaster/unlink",Pm="/api/v1/passwordless/init",Am="/api/v1/passwordless/authenticate",xm="/api/v1/passwordless/link",km="/api/v1/passwordless/unlink",Rm="/api/v1/passwordless/update",Im="/api/v1/passwordless_sms/init",Mm="/api/v1/passwordless_sms/link",Wm="/api/v1/passwordless_sms/unlink",Om="/api/v1/passwordless_sms/authenticate",gl="/api/v1/oauth/init",Lm="/api/v1/oauth/authenticate",vl="/api/v1/oauth/link",Nm="/api/v1/oauth/unlink",Dm="/api/v1/recovery/oauth/init",Um="/api/v1/recovery/oauth/init_icloud",Fm="/api/v1/recovery/oauth/authenticate",Bm="/api/v1/passkeys/link/init",Hm="/api/v1/passkeys/authenticate/init",Gm="/api/v1/passkeys/link",Vm="/api/v1/passkeys/authenticate",qm="/api/v1/passkeys/unlink",zm="/api/v1/telegram/authenticate",$m="/api/v1/telegram/link",Km="/api/v1/telegram/unlink";var jm="/api/v1/mfa/passwordless_sms/init",Ym="/api/v1/mfa/passkeys/init",Zm="/api/v1/users/me/accept_terms",Cl="/api/v1/analytics_events",Qm="/api/v1/custom_jwt_account/authenticate",Jm="/api/v1/plugins/moonpay_on_ramp/sign",Xm="/api/v1/funding/coinbase_on_ramp/init",ef="/api/v1/funding/coinbase_on_ramp/status";var Vi=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");try{let t=await this.api.post(Qm,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){throw new Error("Unimplemented")}};var Pn=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(Am,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(xm,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw Ce(t)}}async sendCodeEmail(t,r){if(!this.api)throw new b("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new b("Email must be set when initialzing authentication.");try{return await this.api.post(Pm,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw Ce(o)}}},wl=class extends Pn{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new b("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Rm,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw Ce(r)}}};var kl=require("react-device-detect");var np=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,r){r!==void 0?this._cache[t]=r:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},bl=class{get(t){let r=localStorage.getItem(t);return r===null?void 0:JSON.parse(r)}put(t,r){r!==void 0?localStorage.setItem(t,JSON.stringify(r)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function ip(){try{let e="privy:__session_storage__test",t="blobby",r=new bl;return r.put(e,t),r.del(e),!0}catch{return!1}}function Ew(){return typeof window<"u"&&window.localStorage?new bl:new np}var X=Ew();var qi=require("@ethersproject/providers");function tf(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let o of t.providers)o&&r.push(o);return r.push(e.ethereum),r}var El=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 ap=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||El(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!ap(r))return!1}return!0},An=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Tl=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0}return!1};var rf=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},Sl=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,}))$/),of=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},Wt=(e,t=3,r=4)=>{if(!e)return"";let o=2,n=3;if(t+r+o+n>=e.length)return e;let i=e.slice(0,o+t),a=e.slice(e.length-r,e.length);return`${i}...${a}`},sp=e=>new Promise(t=>setTimeout(t,e));function nf(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((o,n)=>{let i=0,a,l=()=>{if(i>=r){n("Max attempts reached without result");return}if(a=e(),i+=t,a!=null){o(a);return}setTimeout(l,t)};l()})}var os=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<o;){if(t.abortSignal?.aborted)return;e().then(s=>{a=!0,n(s)},(...s)=>{a=!0,i(...s)}),l+=1,await sp(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},_l=(e,t,r={},o={})=>{let n=new URL(t,e);for(let[a,l]of Object.entries(r))l!==void 0&&n.searchParams.set(a,l);let i=Object.entries(o);if(i.length>0){let a=new URLSearchParams;for(let[l,s]of i)a.append(l,s);n.hash=a.toString()}return n.href};var af=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),ii=e=>typeof e=="string"?e:"0x"+e.toString(16);async function sf(e,t,r,o=3e3){let n=!1,i=window;return new Promise(a=>{i.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},o));function l(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",l);let s=e.getProviders(),c=[];for(let m of s)t.includes("coinbase_wallet")&&m.info.rdns==="com.coinbase.wallet"||c.push({type:m.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:m});for(let m of tf()){let f=El(m);if(!s.some(u=>u.info.name===f)){if(ap(m,!0)&&!c.find(u=>u.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:m});continue}if(f==="Phantom"&&!c.find(u=>u.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:m});continue}if(f==="Coinbase Wallet"&&!c.find(u=>u.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:m});continue}c.find(u=>u.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:m})}}a(c)}})}function zi(e){return`eip155:${String(Number(e))}`}var lf=(e,t,r,o)=>{let n=Number(e),i=t.find(a=>a.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);return lp(i,r,o)},lp=(e,t,r)=>{let o=e.id,n=Number(e.id),i;if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])i=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[n])i=t.rpcUrls[n];else if(e.rpcUrls.privy?.http[0]){let a=new URL(e.rpcUrls.privy.http[0]);a.searchParams.append("privyAppId",r),i=a.toString()}else e.rpcUrls.public?.http[0]?i=e.rpcUrls.public.http[0]:i=e.rpcUrls.default?.http[0];if(!i)throw new we(`No RPC url found for ${o}`);return i},cf=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new we(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Er=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new qi.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new qi.StaticJsonRpcProvider(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new qi.StaticJsonRpcProvider({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.public?.http[0]?a=new qi.StaticJsonRpcProvider(i.rpcUrls.public.http[0]):a=new qi.StaticJsonRpcProvider(i.rpcUrls.default?.http[0]),!a)throw new we(`No RPC url found for ${e}`);return a},ns=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([o,n])=>{if(n!=null&&typeof o=="string"&&o in t)return{name:o,type:t[o]}}).filter(o=>o!==void 0);return{...e,types:{...e.types,EIP712Domain:r}}};var Pl=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(Al))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var Al={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function df(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function pf(e,t){let r=df(t);if(r.deepLink)return gf(r.deepLink,e);if(r.universalLink)return cp(r.universalLink,e);throw new b(`Unsupported wallet ${t.id}`)}function uf(e,t){let r=df(t);if(r.universalLink)return cp(r.universalLink,e)}var mf="WALLETCONNECT_DEEPLINK_CHOICE";function ff(){try{localStorage.removeItem(mf)}catch{}}function hf({href:e,name:t}){try{localStorage.setItem(mf,JSON.stringify({href:e,name:t}))}catch{}}function yf(e){return e.startsWith("http://")||e.startsWith("https://")}function gf(e,t){if(yf(e))return cp(e,t);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function cp(e,t){if(!yf(e))return gf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function xl(e,t){window.open(e,t,"noreferrer noopener")}var rt=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var is=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new rt(this._startChannelOnce.bind(this)),this.pollForReady=new rt(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");try{let t=await this.api.post(Em,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new b("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");try{return await this.api.post(Tm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw Ce(t)}}async _startChannelOnce(){if(!this.api)throw new b("Auth flow has no API instance");let t=await this.api.post(bm,{token:this.captchaToken});kl.isMobile&&!kl.isIOS&&t.connect_uri&&xl(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new b("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");let t=await this.api.get(Sm,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var vf="1.76.1";var Cf="34357d3c125c2bcf2ce2bc3309d98715",Rl="https://auth.privy.io",wf=2e4,ot=1400,Il=2500,Ml=vf;var ai="privy:token",dp="privy-token",Wl="privy:refresh_token",bf="privy-refresh-token",pp="privy:id_token",up="privy-id-token",Ol="privy-session",as="privy:session_transfer_token",Sw="privy:wallet",ss="privy:caid",ls=e=>`privy:cross-app:${e}`,si="privy:state_code",li="privy:code_verifier",ci="privy:headless_oauth",Ll=e=>`${Sw}:${e}`,mp="privy:connectors",fp="privy:connections";var di=12e4,an=1,hp="0x1",$i=3e4,Ef="https://api.moonpay.com/v1",Tf="https://api.moonpay.com/v1",Sf="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",_f="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var Pf="deprecated";var yp=require("jose");async function Af(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function xf(e){return crypto.getRandomValues(new Uint8Array(e))}var _w="S256",Pw="S256";function pi(){return yp.base64url.encode(xf(36))}function Ki(){return pi()}async function ji(e,t=_w){if(t==Pw){let r=await Af(e);return yp.base64url.encode(r)}else return e}function kf(){let e=X.get(li);if(!e)throw new b("Authentication error.");return e}function Nl(){return!!X.get(ci)}var Do=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Nl();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=kf();try{let r=await this.api.post(Lm,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(li),this.meta.headless&&X.del(ci),{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=Ce(r);throw o.privyErrorCode?new b(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new b("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new b("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=X.get(li);if(!t)throw new b("Authentication error.");try{let r=await this.api.post(vl,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(li),r}catch(r){throw Ce(r)}}async getAuthorizationUrl(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.provider)throw new b("Provider must be set when initializing OAuth authentication.");let t=pi();X.put(li,t);let r=Ki();X.put(si,r);let o=await ji(t);this.meta.headless&&X.put(ci,!0);try{return await this.api.post(gl,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw Ce(n)}}};function gp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var cs=require("react/jsx-runtime"),Dl=({style:e,...t})=>(0,cs.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,cs.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,cs.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var xn=require("react/jsx-runtime"),Ul=({style:e,...t})=>(0,xn.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,xn.jsx)("g",{clipPath:"url(#clip0)",children:(0,xn.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,xn.jsx)("defs",{children:(0,xn.jsx)("clipPath",{id:"clip0",children:(0,xn.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var vp=require("react/jsx-runtime"),Fl=({style:e,...t})=>(0,vp.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,vp.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});var Rf=require("@heroicons/react/24/outline"),Mf=require("react/jsx-runtime"),If=({style:e})=>(0,Mf.jsx)(Rf.GlobeAltIcon,{style:{color:"var(--privy-color-error)",...e}});var ui=require("react/jsx-runtime"),Bl=({style:e,...t})=>(0,ui.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,ui.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,ui.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,ui.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,ui.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var Ut=require("react/jsx-runtime");function Hl(e){return(0,Ut.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[(0,Ut.jsxs)("defs",{children:[(0,Ut.jsxs)("linearGradient",{id:"b",children:[(0,Ut.jsx)("stop",{offset:"0",stopColor:"#3771c8"}),(0,Ut.jsx)("stop",{stopColor:"#3771c8",offset:".128"}),(0,Ut.jsx)("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),(0,Ut.jsxs)("linearGradient",{id:"a",children:[(0,Ut.jsx)("stop",{offset:"0",stopColor:"#fd5"}),(0,Ut.jsx)("stop",{offset:".1",stopColor:"#fd5"}),(0,Ut.jsx)("stop",{offset:".5",stopColor:"#ff543e"}),(0,Ut.jsx)("stop",{offset:"1",stopColor:"#c837ab"})]}),(0,Ut.jsx)("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),(0,Ut.jsx)("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),(0,Ut.jsx)("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Ut.jsx)("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Ut.jsx)("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}var ds=require("react/jsx-runtime");function Gl({style:e,...t}){return(0,ds.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,ds.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,ds.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,ds.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var ps=require("react/jsx-runtime");function Vl(e){return(0,ps.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,ps.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,ps.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var Yi=require("react/jsx-runtime");function ql(e){return(0,Yi.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,Yi.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,Yi.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,Yi.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var Cp=require("react/jsx-runtime"),zl=({style:e,...t})=>(0,Cp.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,Cp.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var Wf={google:{name:"Google",component:Bl},discord:{name:"Discord",component:Ul},github:{name:"Github",component:Fl},linkedin:{name:"LinkedIn",component:Gl},twitter:{name:"Twitter",component:zl},spotify:{name:"Spotify",component:Vl},instagram:{name:"Instagram",component:Hl},tiktok:{name:"Tiktok",component:ql},apple:{name:"Apple",component:Dl}},us=e=>e in Wf?Wf[e]:{name:"Unknown",component:If};function Of(e,t){let r={detail:"",retryable:!1},o=gp(t);if(e?.privyErrorCode==="linked_to_another_user"&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode==="invalid_credentials"&&(r.retryable=!0,r.detail="Something went wrong. Try again."),e.privyErrorCode==="oauth_user_denied"&&(r.detail=`Retry and check ${o} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode==="too_many_requests"&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("provider rate limit")){let n=us(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=us(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return e?.privyErrorCode==="cannot_link_more_of_type"&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode==="oauth_unexpected"&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}function ms(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");if(!t||!r||!o)return{inProgress:!1};let n=!1;try{n=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:Nl(),popupFlow:window.opener!==null&&n}}function mi(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),X.del(si),window.history.replaceState({},"",e)}var fi=class{constructor(t){this.initAuthenticateOnce=new rt(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new rt(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let r=await t.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),o=await this.api.post(Vm,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):Ce(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let r=this.meta.initLinkResponse.options,o=await t.startRegistration(this._transformInitLinkOptionsToCamelCase(r));return await this.api.post(Gm,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):Ce(r)}}async _initAuthenticateOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(Hm,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(Bm,{})}_transformInitLinkOptionsToCamelCase(t){return{rp:t.rp,user:{id:t.user.id,name:t.user.name,displayName:t.user.display_name},challenge:t.challenge,pubKeyCredParams:t.pub_key_cred_params.map(r=>({type:r.type,alg:r.alg})),timeout:t.timeout,excludeCredentials:t.exclude_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports})),authenticatorSelection:{authenticatorAttachment:t.authenticator_selection?.authenticator_attachment,requireResidentKey:t.authenticator_selection?.require_resident_key,residentKey:t.authenticator_selection?.resident_key,userVerification:t.authenticator_selection?.user_verification},attestation:t.attestation,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props?.rk,hmacCreateSecret:t.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,attestation_object:t.response.attestationObject,authenticator_data:t.response.authenticatorData},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}_transformInitAuthenticateOptionsToCamelCase(t){return{challenge:t.challenge,allowCredentials:t.allow_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports}))||[],timeout:t.timeout,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props,hmacCreateSecret:t.extensions?.hmac_create_secret},userVerification:t.user_verification}}_transformAuthenticationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}};var $l=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,i="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",a=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
|
|
1
|
+
"use strict";var hw=Object.create;var dl=Object.defineProperty;var yw=Object.getOwnPropertyDescriptor;var gw=Object.getOwnPropertyNames;var vw=Object.getPrototypeOf,Cw=Object.prototype.hasOwnProperty;var ww=(e,t)=>{for(var r in t)dl(e,r,{get:t[r],enumerable:!0})},um=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of gw(t))!Cw.call(e,n)&&n!==r&&dl(e,n,{get:()=>t[n],enumerable:!(o=yw(t,n))||o.enumerable});return e};var y=(e,t,r)=>(r=e!=null?hw(vw(e)):{},um(t||!e||!e.__esModule?dl(r,"default",{value:e,enumerable:!0}):r,e)),bw=e=>um(dl({},"__esModule",{value:!0}),e);var rp=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var mm=(e,t,r)=>(rp(e,t,"read from private field"),r?r.call(e):t.get(e)),pl=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},op=(e,t,r,o)=>(rp(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var fm=(e,t,r)=>(rp(e,t,"access private method"),r);var c7={};ww(c7,{AsExternalProvider:()=>wo,Captcha:()=>ac,ConnectorManager:()=>sa,LoginModal:()=>Qd,PrivyClient:()=>la,PrivyProvider:()=>E0,PrivyProxyProvider:()=>ct,SUPPORTED_CHAINS:()=>ia,VERSION:()=>Ml,WalletConnector:()=>mr,addRpcUrlOverrideToChain:()=>rw,errorIndicatesMaxMfaRetries:()=>Mc,errorIndicatesMfaTimeout:()=>Bn,errorIndicatesMfaVerificationFailed:()=>Hn,getAccessToken:()=>Ie,getEmbeddedConnectedWallet:()=>ow,useConnectWallet:()=>O0,useCreateWallet:()=>N0,useCrossAppAccounts:()=>F0,useExperimentalFarcasterSigner:()=>tw,useFarcasterSigner:()=>om,useFundWallet:()=>D0,useLinkAccount:()=>M0,useLinkWithSiwe:()=>R0,useLogin:()=>S0,useLoginWithEmail:()=>x0,useLoginWithOAuth:()=>A0,useLoginWithSms:()=>k0,useLogout:()=>P0,useMfa:()=>$a,useMfaEnrollment:()=>ho,useModalStatus:()=>Q0,useOAuthTokens:()=>ew,usePrivy:()=>$,useRegisterMfaListener:()=>dc,useSendTransaction:()=>H0,useSetWalletPassword:()=>V0,useSetWalletRecovery:()=>z0,useSignMessage:()=>K0,useSignTypedData:()=>Y0,useSolanaWallets:()=>U0,useToken:()=>X0,useWallets:()=>mo});module.exports=bw(c7);var rn=require("@ethersproject/address"),ep=require("@ethersproject/providers"),f0=require("mipd"),ve=require("react"),h0=require("react-device-detect"),ts=require("@privy-io/js-sdk-core");var hm=require("ofetch"),wt=class extends Error{constructor(r,o,n){super(r);o instanceof Error&&(this.cause=o),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},pr=class extends wt{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},b=class extends wt{constructor(r,o,n){super(r,o,n);this.type="client_error"}},ul=class extends b{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var we=class extends wt{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},Ce=e=>{if(e instanceof wt)return e;if(!(e instanceof hm.FetchError))return bt(e);if(!e.response)return new pr("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new pr(t||"ApiError",e.response.status,r||o,e,n)},bt=e=>e instanceof wt?e:e instanceof Error?new b(e.message,e):new b(`Internal error: ${e}`);var nn=class extends b{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},ur=class extends b{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},ml=class extends b{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var ro=class extends b{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 fl="/api/v1/sessions",hl="/api/v1/sessions/logout",ym="/api/v1/sessions/fork",yl="/api/v1/sessions/fork/recover",gm="/api/v1/siwe/init",vm="/api/v1/siwe/authenticate",Cm="/api/v1/siwe/link",wm="/api/v1/siwe/unlink",bm="/api/v1/farcaster/init",Em="/api/v1/farcaster/authenticate",Tm="/api/v1/farcaster/link",Sm="/api/v1/farcaster/status",_m="/api/v1/farcaster/unlink",Pm="/api/v1/passwordless/init",Am="/api/v1/passwordless/authenticate",xm="/api/v1/passwordless/link",km="/api/v1/passwordless/unlink",Rm="/api/v1/passwordless/update",Im="/api/v1/passwordless_sms/init",Mm="/api/v1/passwordless_sms/link",Wm="/api/v1/passwordless_sms/unlink",Om="/api/v1/passwordless_sms/authenticate",gl="/api/v1/oauth/init",Lm="/api/v1/oauth/authenticate",vl="/api/v1/oauth/link",Nm="/api/v1/oauth/unlink",Dm="/api/v1/recovery/oauth/init",Um="/api/v1/recovery/oauth/init_icloud",Fm="/api/v1/recovery/oauth/authenticate",Bm="/api/v1/passkeys/link/init",Hm="/api/v1/passkeys/authenticate/init",Gm="/api/v1/passkeys/link",Vm="/api/v1/passkeys/authenticate",qm="/api/v1/passkeys/unlink",zm="/api/v1/telegram/authenticate",$m="/api/v1/telegram/link",Km="/api/v1/telegram/unlink";var jm="/api/v1/mfa/passwordless_sms/init",Ym="/api/v1/mfa/passkeys/init",Zm="/api/v1/users/me/accept_terms",Cl="/api/v1/analytics_events",Qm="/api/v1/custom_jwt_account/authenticate",Jm="/api/v1/plugins/moonpay_on_ramp/sign",Xm="/api/v1/funding/coinbase_on_ramp/init",ef="/api/v1/funding/coinbase_on_ramp/status";var Vi=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");try{let t=await this.api.post(Qm,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){throw new Error("Unimplemented")}};var Pn=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(Am,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(xm,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw Ce(t)}}async sendCodeEmail(t,r){if(!this.api)throw new b("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new b("Email must be set when initialzing authentication.");try{return await this.api.post(Pm,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw Ce(o)}}},wl=class extends Pn{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new b("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Rm,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw Ce(r)}}};var kl=require("react-device-detect");var np=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,r){r!==void 0?this._cache[t]=r:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},bl=class{get(t){let r=localStorage.getItem(t);return r===null?void 0:JSON.parse(r)}put(t,r){r!==void 0?localStorage.setItem(t,JSON.stringify(r)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function ip(){try{let e="privy:__session_storage__test",t="blobby",r=new bl;return r.put(e,t),r.del(e),!0}catch{return!1}}function Ew(){return typeof window<"u"&&window.localStorage?new bl:new np}var X=Ew();var qi=require("@ethersproject/providers");function tf(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let o of t.providers)o&&r.push(o);return r.push(e.ethereum),r}var El=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 ap=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||El(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!ap(r))return!1}return!0},An=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Tl=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0}return!1};var rf=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},Sl=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,}))$/),of=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},Wt=(e,t=3,r=4)=>{if(!e)return"";let o=2,n=3;if(t+r+o+n>=e.length)return e;let i=e.slice(0,o+t),a=e.slice(e.length-r,e.length);return`${i}...${a}`},sp=e=>new Promise(t=>setTimeout(t,e));function nf(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((o,n)=>{let i=0,a,l=()=>{if(i>=r){n("Max attempts reached without result");return}if(a=e(),i+=t,a!=null){o(a);return}setTimeout(l,t)};l()})}var os=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<o;){if(t.abortSignal?.aborted)return;e().then(s=>{a=!0,n(s)},(...s)=>{a=!0,i(...s)}),l+=1,await sp(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},_l=(e,t,r={},o={})=>{let n=new URL(t,e);for(let[a,l]of Object.entries(r))l!==void 0&&n.searchParams.set(a,l);let i=Object.entries(o);if(i.length>0){let a=new URLSearchParams;for(let[l,s]of i)a.append(l,s);n.hash=a.toString()}return n.href};var af=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),ii=e=>typeof e=="string"?e:"0x"+e.toString(16);async function sf(e,t,r,o=3e3){let n=!1,i=window;return new Promise(a=>{i.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},o));function l(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",l);let s=e.getProviders(),c=[];for(let m of s)t.includes("coinbase_wallet")&&m.info.rdns==="com.coinbase.wallet"||c.push({type:m.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:m});for(let m of tf()){let f=El(m);if(!s.some(u=>u.info.name===f)){if(ap(m,!0)&&!c.find(u=>u.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:m});continue}if(f==="Phantom"&&!c.find(u=>u.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:m});continue}if(f==="Coinbase Wallet"&&!c.find(u=>u.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:m});continue}c.find(u=>u.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:m})}}a(c)}})}function zi(e){return`eip155:${String(Number(e))}`}var lf=(e,t,r,o)=>{let n=Number(e),i=t.find(a=>a.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);return lp(i,r,o)},lp=(e,t,r)=>{let o=e.id,n=Number(e.id),i;if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])i=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[n])i=t.rpcUrls[n];else if(e.rpcUrls.privy?.http[0]){let a=new URL(e.rpcUrls.privy.http[0]);a.searchParams.append("privyAppId",r),i=a.toString()}else e.rpcUrls.public?.http[0]?i=e.rpcUrls.public.http[0]:i=e.rpcUrls.default?.http[0];if(!i)throw new we(`No RPC url found for ${o}`);return i},cf=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new we(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Er=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new qi.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new qi.StaticJsonRpcProvider(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new qi.StaticJsonRpcProvider({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.public?.http[0]?a=new qi.StaticJsonRpcProvider(i.rpcUrls.public.http[0]):a=new qi.StaticJsonRpcProvider(i.rpcUrls.default?.http[0]),!a)throw new we(`No RPC url found for ${e}`);return a},ns=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([o,n])=>{if(n!=null&&typeof o=="string"&&o in t)return{name:o,type:t[o]}}).filter(o=>o!==void 0);return{...e,types:{...e.types,EIP712Domain:r}}};var Pl=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(Al))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var Al={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function df(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function pf(e,t){let r=df(t);if(r.deepLink)return gf(r.deepLink,e);if(r.universalLink)return cp(r.universalLink,e);throw new b(`Unsupported wallet ${t.id}`)}function uf(e,t){let r=df(t);if(r.universalLink)return cp(r.universalLink,e)}var mf="WALLETCONNECT_DEEPLINK_CHOICE";function ff(){try{localStorage.removeItem(mf)}catch{}}function hf({href:e,name:t}){try{localStorage.setItem(mf,JSON.stringify({href:e,name:t}))}catch{}}function yf(e){return e.startsWith("http://")||e.startsWith("https://")}function gf(e,t){if(yf(e))return cp(e,t);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function cp(e,t){if(!yf(e))return gf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function xl(e,t){window.open(e,t,"noreferrer noopener")}var rt=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var is=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new rt(this._startChannelOnce.bind(this)),this.pollForReady=new rt(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");try{let t=await this.api.post(Em,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new b("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");try{return await this.api.post(Tm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw Ce(t)}}async _startChannelOnce(){if(!this.api)throw new b("Auth flow has no API instance");let t=await this.api.post(bm,{token:this.captchaToken});kl.isMobile&&!kl.isIOS&&t.connect_uri&&xl(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new b("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");let t=await this.api.get(Sm,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var vf="1.76.2";var Cf="34357d3c125c2bcf2ce2bc3309d98715",Rl="https://auth.privy.io",wf=2e4,ot=1400,Il=2500,Ml=vf;var ai="privy:token",dp="privy-token",Wl="privy:refresh_token",bf="privy-refresh-token",pp="privy:id_token",up="privy-id-token",Ol="privy-session",as="privy:session_transfer_token",Sw="privy:wallet",ss="privy:caid",ls=e=>`privy:cross-app:${e}`,si="privy:state_code",li="privy:code_verifier",ci="privy:headless_oauth",Ll=e=>`${Sw}:${e}`,mp="privy:connectors",fp="privy:connections";var di=12e4,an=1,hp="0x1",$i=3e4,Ef="https://api.moonpay.com/v1",Tf="https://api.moonpay.com/v1",Sf="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",_f="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var Pf="deprecated";var yp=require("jose");async function Af(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function xf(e){return crypto.getRandomValues(new Uint8Array(e))}var _w="S256",Pw="S256";function pi(){return yp.base64url.encode(xf(36))}function Ki(){return pi()}async function ji(e,t=_w){if(t==Pw){let r=await Af(e);return yp.base64url.encode(r)}else return e}function kf(){let e=X.get(li);if(!e)throw new b("Authentication error.");return e}function Nl(){return!!X.get(ci)}var Do=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Nl();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=kf();try{let r=await this.api.post(Lm,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(li),this.meta.headless&&X.del(ci),{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=Ce(r);throw o.privyErrorCode?new b(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new b("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new b("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=X.get(li);if(!t)throw new b("Authentication error.");try{let r=await this.api.post(vl,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(li),r}catch(r){throw Ce(r)}}async getAuthorizationUrl(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.provider)throw new b("Provider must be set when initializing OAuth authentication.");let t=pi();X.put(li,t);let r=Ki();X.put(si,r);let o=await ji(t);this.meta.headless&&X.put(ci,!0);try{return await this.api.post(gl,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw Ce(n)}}};function gp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var cs=require("react/jsx-runtime"),Dl=({style:e,...t})=>(0,cs.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,cs.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,cs.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var xn=require("react/jsx-runtime"),Ul=({style:e,...t})=>(0,xn.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,xn.jsx)("g",{clipPath:"url(#clip0)",children:(0,xn.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,xn.jsx)("defs",{children:(0,xn.jsx)("clipPath",{id:"clip0",children:(0,xn.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var vp=require("react/jsx-runtime"),Fl=({style:e,...t})=>(0,vp.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,vp.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});var Rf=require("@heroicons/react/24/outline"),Mf=require("react/jsx-runtime"),If=({style:e})=>(0,Mf.jsx)(Rf.GlobeAltIcon,{style:{color:"var(--privy-color-error)",...e}});var ui=require("react/jsx-runtime"),Bl=({style:e,...t})=>(0,ui.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,ui.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,ui.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,ui.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,ui.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var Ut=require("react/jsx-runtime");function Hl(e){return(0,Ut.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[(0,Ut.jsxs)("defs",{children:[(0,Ut.jsxs)("linearGradient",{id:"b",children:[(0,Ut.jsx)("stop",{offset:"0",stopColor:"#3771c8"}),(0,Ut.jsx)("stop",{stopColor:"#3771c8",offset:".128"}),(0,Ut.jsx)("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),(0,Ut.jsxs)("linearGradient",{id:"a",children:[(0,Ut.jsx)("stop",{offset:"0",stopColor:"#fd5"}),(0,Ut.jsx)("stop",{offset:".1",stopColor:"#fd5"}),(0,Ut.jsx)("stop",{offset:".5",stopColor:"#ff543e"}),(0,Ut.jsx)("stop",{offset:"1",stopColor:"#c837ab"})]}),(0,Ut.jsx)("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),(0,Ut.jsx)("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),(0,Ut.jsx)("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Ut.jsx)("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Ut.jsx)("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}var ds=require("react/jsx-runtime");function Gl({style:e,...t}){return(0,ds.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,ds.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,ds.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,ds.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var ps=require("react/jsx-runtime");function Vl(e){return(0,ps.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,ps.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,ps.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var Yi=require("react/jsx-runtime");function ql(e){return(0,Yi.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,Yi.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,Yi.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,Yi.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var Cp=require("react/jsx-runtime"),zl=({style:e,...t})=>(0,Cp.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,Cp.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var Wf={google:{name:"Google",component:Bl},discord:{name:"Discord",component:Ul},github:{name:"Github",component:Fl},linkedin:{name:"LinkedIn",component:Gl},twitter:{name:"Twitter",component:zl},spotify:{name:"Spotify",component:Vl},instagram:{name:"Instagram",component:Hl},tiktok:{name:"Tiktok",component:ql},apple:{name:"Apple",component:Dl}},us=e=>e in Wf?Wf[e]:{name:"Unknown",component:If};function Of(e,t){let r={detail:"",retryable:!1},o=gp(t);if(e?.privyErrorCode==="linked_to_another_user"&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode==="invalid_credentials"&&(r.retryable=!0,r.detail="Something went wrong. Try again."),e.privyErrorCode==="oauth_user_denied"&&(r.detail=`Retry and check ${o} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode==="too_many_requests"&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("provider rate limit")){let n=us(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=us(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return e?.privyErrorCode==="cannot_link_more_of_type"&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode==="oauth_unexpected"&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}function ms(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");if(!t||!r||!o)return{inProgress:!1};let n=!1;try{n=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:Nl(),popupFlow:window.opener!==null&&n}}function mi(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),X.del(si),window.history.replaceState({},"",e)}var fi=class{constructor(t){this.initAuthenticateOnce=new rt(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new rt(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let r=await t.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),o=await this.api.post(Vm,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):Ce(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let r=this.meta.initLinkResponse.options,o=await t.startRegistration(this._transformInitLinkOptionsToCamelCase(r));return await this.api.post(Gm,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):Ce(r)}}async _initAuthenticateOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(Hm,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(Bm,{})}_transformInitLinkOptionsToCamelCase(t){return{rp:t.rp,user:{id:t.user.id,name:t.user.name,displayName:t.user.display_name},challenge:t.challenge,pubKeyCredParams:t.pub_key_cred_params.map(r=>({type:r.type,alg:r.alg})),timeout:t.timeout,excludeCredentials:t.exclude_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports})),authenticatorSelection:{authenticatorAttachment:t.authenticator_selection?.authenticator_attachment,requireResidentKey:t.authenticator_selection?.require_resident_key,residentKey:t.authenticator_selection?.resident_key,userVerification:t.authenticator_selection?.user_verification},attestation:t.attestation,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props?.rk,hmacCreateSecret:t.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,attestation_object:t.response.attestationObject,authenticator_data:t.response.authenticatorData},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}_transformInitAuthenticateOptionsToCamelCase(t){return{challenge:t.challenge,allowCredentials:t.allow_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports}))||[],timeout:t.timeout,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props,hmacCreateSecret:t.extensions?.hmac_create_secret},userVerification:t.user_verification}}_transformAuthenticationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}};var $l=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,i="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",a=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
|
|
2
2
|
${e}
|
|
3
3
|
|
|
4
4
|
${i}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.76.
|
|
2
|
+
"version": "1.76.2",
|
|
3
3
|
"name": "@privy-io/react-auth",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React client for the Privy Auth API",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@marsidev/react-turnstile": "^0.4.1",
|
|
59
59
|
"@metamask/eth-sig-util": "^6.0.0",
|
|
60
60
|
"@simplewebauthn/browser": "^9.0.1",
|
|
61
|
-
"@privy-io/js-sdk-core": "0.24.
|
|
61
|
+
"@privy-io/js-sdk-core": "0.24.2",
|
|
62
62
|
"@walletconnect/ethereum-provider": "^2.13.3",
|
|
63
63
|
"@walletconnect/modal": "^2.6.2",
|
|
64
64
|
"base64-js": "^1.5.1",
|