@privy-io/react-auth 1.85.0 → 1.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var L=(t,n,o)=>{if(!n.has(t))throw TypeError("Cannot "+o)};var ut=(t,n,o)=>(L(t,n,"read from private field"),o?o.call(t):n.get(t)),ht= exports.b =(t,n,o)=>{if(n.has(t))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(t):n.set(t,o)},gt= exports.c =(t,n,o,s)=>(L(t,n,"write to private field"),s?s.call(t,o):n.set(t,o),o);var yt=(t,n,o)=>(L(t,n,"access private method"),o);var F="1.85.0";var H="34357d3c125c2bcf2ce2bc3309d98715",_t= exports.p ="https://auth.privy.io",Ct= exports.q =2e4,St= exports.r =1400,At= exports.s =2500,wt= exports.t =4e3,Tt= exports.u =F;var kt="privy:token",Pt= exports.w ="privy-token",xt= exports.x ="privy:refresh_token",vt= exports.y ="privy-refresh-token",Wt= exports.z ="privy:id_token",Ot= exports.A ="privy-id-token",It= exports.B ="privy-session",Ut= exports.C ="privy:session_transfer_token",De="privy:wallet",Lt= exports.D ="privy:caid",Mt= exports.E =t=>`privy:guest:${t}`,Rt= exports.F =t=>`privy:cross-app:${t}`,Nt= exports.G ="privy:state_code",Dt= exports.H ="privy:code_verifier",Ft= exports.I ="privy:headless_oauth",Ht= exports.J ="privy:oauth_disable_signup",jt= exports.K =t=>`${De}:${t}`,Kt= exports.L ="privy:connectors",Yt= exports.M ="privy:connections";var Gt=12e4,Bt= exports.O =1,qt= exports.P ="0x1",zt= exports.Q =3e4,Vt= exports.R ="https://api.moonpay.com/v1",Xt= exports.S ="https://api.moonpay.com/v1",$t= exports.T ="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",Zt= exports.U ="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var Jt="deprecated";var j={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}};var K={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0};var Y={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}};var G={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0};var B={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}};var q={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0};var z={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0};var V={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1};var X={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0};var $={id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}};var Z={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}};var J={id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}};var Q={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}};var ee={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1};var te={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0};var ne={id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}};var v={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}};var oe={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}};var se={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0};var ie={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}};var ae={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0};var re={id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}};var le={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0};var pe={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}};var ce={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0};var de={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0};var W=[j,K,le,v,oe,se,ie,ae,V,X,$,Z,B,q,z,ne,ee,te,Y,G,pe,de,ce,Q,re,J],Qn= exports.la =new Set(W.map(t=>t.id));var _react = require('react');var e=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var je=_react.createContext.call(void 0, {ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:e,login:e,connectOrCreateWallet:e,linkEmail:e,linkPhone:e,linkFarcaster:e,linkWallet:e,startCrossAppAuthFlow:e,linkGoogle:e,linkTwitter:e,linkDiscord:e,linkGithub:e,linkSpotify:e,linkInstagram:e,linkTelegram:e,linkTiktok:e,linkLinkedIn:e,linkApple:e,linkPasskey:e,updateEmail:e,updatePhone:e,logout:e,getAccessToken:e,getEthereumProvider:e,getEthersProvider:e,getWeb3jsProvider:e,unlinkEmail:e,unlinkPhone:e,unlinkWallet:e,unlinkGoogle:e,unlinkTwitter:e,unlinkDiscord:e,unlinkGithub:e,unlinkSpotify:e,unlinkInstagram:e,unlinkTiktok:e,unlinkLinkedIn:e,unlinkApple:e,unlinkCrossAppAccount:e,unlinkFarcaster:e,unlinkTelegram:e,unlinkPasskey:e,setActiveWallet:e,forkSession:e,createWallet:e,importWallet:e,signMessage:e,signTypedData:e,enrollInMfa:e,initEnrollmentWithSms:e,initEnrollmentWithTotp:e,initEnrollmentWithPasskey:e,promptMfa:e,init:e,submitEnrollmentWithSms:e,submitEnrollmentWithTotp:e,submitEnrollmentWithPasskey:e,unenroll:e,submit:e,cancel:e,sendTransaction:e,sendSolanaTransaction:e,exportWallet:e,setWalletPassword:e,setWalletRecovery:e,requestFarcasterSignerFromWarpcast:e,getFarcasterSignerPublicKey:e,signFarcasterMessage:e,createGuestAccount:e,initLoginWithEmail:e,initLoginWithSms:e,otpState:{status:"initial"},loginWithCode:e,fundWallet:e,initLoginWithHeadlessOAuth:e,loginWithHeadlessOAuth:e,generateSiweMessage:e,linkWithSiwe:e,signMessageWithCrossAppWallet:e,signTypedDataWithCrossAppWallet:e,sendTransactionWithCrossAppWallet:e,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[]}),so= exports.ta =()=>_react.useContext.call(void 0, je);var Ge=_react.createContext.call(void 0, null);function ro(){let t=_react.useContext.call(void 0, Ge);if(t===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return t}var _ofetch = require('ofetch');var g=class extends Error{constructor(o,s,i){super(o);s instanceof Error&&(this.cause=s),this.privyErrorCode=i}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},O= exports.f =class extends g{constructor(o,s,i,r,l){super(i,r,l);this.type=o;this.status=s}},u= exports.g =class extends g{constructor(o,s,i){super(o,s,i);this.type="client_error"}},me= exports.h =class extends u{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var ue=class extends g{constructor(o,s,i){super(o,s,i);this.type="connector_error"}},co= exports.j =t=>{if(t instanceof g)return t;if(!(t instanceof _ofetch.FetchError))return qe(t);if(!t.response)return new O("api_error",null,t.message,t);let{type:n,message:o,error:s,code:i}=t.data;return new O(n||"ApiError",t.response.status,o||s,t,i)},qe= exports.k =t=>t instanceof g?t:t instanceof Error?new u(t.message,t):new u(`Internal error: ${t}`);var he=class extends u{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},ge= exports.m =class extends u{constructor(n="Embedded wallet error",o){super(n,o,"unknown_embedded_wallet_error")}},ye= exports.n =class extends u{constructor(n="User must be authenticated"){super(n,void 0,"must_be_authenticated")}};var fe=class extends u{constructor(n){super("This application is in development mode and must be upgraded to production to log in new users.",n,"max_accounts_reached")}};var d={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:H,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};var be=({input:t})=>{if(!t||!t.primary[0])return;let n=[t.primary[0]],o=[];t.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`");for(let s of t.primary.slice(1))n.includes(s)?console.warn(`Duplicated login method: ${s}`):n.push(s);for(let s of _nullishCoalesce(t.overflow, () => ([])))!n.includes(s)&&!o.includes(s)?o.push(s):console.warn(`Duplicated login method: ${s}`);return{primary:n,overflow:o}};var ze=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet","safe"]),Ee=t=>ze.has(t),_e=(t,n,o)=>o.indexOf(t)===n,Ce=({input:t,overrides:n})=>n?n.primary.concat(_nullishCoalesce(n.overflow, () => ([]))).filter(Ee).filter(_e):t?t.filter(Ee).filter(_e):d.appearance.walletList;var _tinycolor2 = require('tinycolor2'); var _tinycolor22 = _interopRequireDefault(_tinycolor2);var Se="#FFFFFF",Ve="#040217",Xe=Se,$e="#1E1E1D";function Ze(t){return t<.8&&t>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),t>.5?"light":"dark"}function m(t,n){let o=Math.max(0,Math.min(1,t.toHsl().l+n));return _tinycolor22.default.call(void 0, {...t.toHsl(),l:o})}var Je="#51BA81",Qe="#FFB74D",et="#EC6351",tt=Se,nt=Ve;function Ae({backgroundTheme:t,accentHex:n}){let o;switch(t){case"light":o=Xe;break;case"dark":o=$e;break;default:o=t;break}let s=_tinycolor22.default.call(void 0, o),i=_tinycolor22.default.call(void 0, n),r=_tinycolor22.default.call(void 0, Je),l=_tinycolor22.default.call(void 0, Qe),p=_tinycolor22.default.call(void 0, et),a=Ze(s.getLuminance()),c=m(s,a==="light"?-.04:.11),h=m(s,a==="light"?-.88:.87),f=m(s,a==="light"?-.7:.75),b=m(s,a==="light"?-.43:.45).desaturate(a==="light"?60:20),E=m(s,a==="light"?-.08:.25).desaturate(a==="light"?60:20),_=m(i,.15),C=m(i,-.06),S=m(p,.3),A=m(l,.3),w=_tinycolor22.default.call(void 0, i.getLuminance()>.5?nt:tt),P=m(r,-.16),x=m(r,.4);return{colorScheme:a,background:s.toHslString(),background2:c.toHslString(),foreground:h.toHslString(),foreground2:f.toHslString(),foreground3:b.toHslString(),foreground4:E.toHslString(),accent:i.toHslString(),accentLight:_.toHslString(),accentDark:C.toHslString(),foregroundAccent:w.toHslString(),success:r.toHslString(),successDark:P.toHslString(),successLight:x.toHslString(),error:p.toHslString(),errorLight:S.toHslString(),warn:l.toHslString(),warnLight:A.toHslString()}}function M(t,n,o){let s=o?console.warn:()=>{},i,r,l,p,a,c,h,f,b,E,_,C,S,A,w;_optionalChain([n, 'optionalAccess', _2 => _2.loginMethods])?(i=n.loginMethods.includes("email"),r=n.loginMethods.includes("sms"),p=n.loginMethods.includes("wallet"),a=n.loginMethods.includes("google"),c=n.loginMethods.includes("twitter"),h=n.loginMethods.includes("discord"),b=n.loginMethods.includes("spotify"),E=n.loginMethods.includes("instagram"),f=n.loginMethods.includes("tiktok"),C=n.loginMethods.includes("github"),_=n.loginMethods.includes("linkedin"),S=n.loginMethods.includes("apple"),A=n.loginMethods.includes("farcaster"),w=n.loginMethods.includes("telegram")):(i=t.emailAuth,r=t.smsAuth,p=t.walletAuth,a=t.googleOAuth,c=t.twitterOAuth,h=t.discordOAuth,C=t.githubOAuth,b=t.spotifyOAuth,E=t.instagramOAuth,f=t.tiktokOAuth,_=t.linkedinOAuth,S=t.appleOAuth,A=t.farcasterAuth,w=t.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?l=!1:t.passkeyAuth&&(l=!0);let P=[i,r].filter(Boolean),x=[a,c,h,C,b,E,f,_,S,A,w].filter(Boolean),I=[p].filter(Boolean);if(P.length+x.length+I.length===0)throw new Error("You must enable at least one login method");let T=_optionalChain([n, 'optionalAccess', _3 => _3.appearance, 'optionalAccess', _4 => _4.showWalletLoginFirst])!==void 0?_optionalChain([n, 'optionalAccess', _5 => _5.appearance, 'optionalAccess', _6 => _6.showWalletLoginFirst]):t.showWalletLoginFirst;T&&I.length===0?(s("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),T=!1):!T&&x.length+P.length===0&&(s("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),T=!0);let ve=_nullishCoalesce(_optionalChain([n, 'optionalAccess', _7 => _7.externalWallets, 'optionalAccess', _8 => _8.walletConnect, 'optionalAccess', _9 => _9.enabled]), () => (!0));_optionalChain([n, 'optionalAccess', _10 => _10.loginMethods])&&n.loginMethodsAndOrder&&s("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let We=Ce({input:_optionalChain([n, 'optionalAccess', _11 => _11.appearance, 'optionalAccess', _12 => _12.walletList]),overrides:_optionalChain([n, 'optionalAccess', _13 => _13.loginMethodsAndOrder])}),Oe=be({input:_optionalChain([n, 'optionalAccess', _14 => _14.loginMethodsAndOrder])}),Ie=_nullishCoalesce(_optionalChain([n, 'optionalAccess', _15 => _15.intl, 'optionalAccess', _16 => _16.defaultCountry]), () => ("US")),{chains:Ue,defaultChain:Le}=ot({additionalChains:_optionalChain([n, 'optionalAccess', _17 => _17.additionalChains]),supportedChains:_optionalChain([n, 'optionalAccess', _18 => _18.supportedChains]),defaultChainFromConfig:_optionalChain([n, 'optionalAccess', _19 => _19.defaultChain]),hasRpcConfigDefined:Object.keys(_nullishCoalesce(_optionalChain([n, 'optionalAccess', _20 => _20.rpcConfig, 'optionalAccess', _21 => _21.rpcUrls]), () => ({}))).length>0}),Me=!!_optionalChain([n, 'optionalAccess', _22 => _22.defaultChain]),U=_optionalChain([n, 'optionalAccess', _23 => _23.customAuth, 'optionalAccess', _24 => _24.getCustomAccessToken])&&_optionalChain([n, 'optionalAccess', _25 => _25.customAuth, 'optionalAccess', _26 => _26.enabled])!==!1,k,N=!(_nullishCoalesce(t.enforceWalletUis, () => (!0)));if(_nullishCoalesce(t.legacyWalletUiConfig, () => (!0))?U?k=_nullishCoalesce(_optionalChain([n, 'optionalAccess', _27 => _27.embeddedWallets, 'optionalAccess', _28 => _28.noPromptOnSignature]), () => (!0)):k=_nullishCoalesce(_optionalChain([n, 'optionalAccess', _29 => _29.embeddedWallets, 'optionalAccess', _30 => _30.noPromptOnSignature]), () => (N)):k=N,_optionalChain([n, 'optionalAccess', _31 => _31.embeddedWallets, 'optionalAccess', _32 => _32.waitForTransactionConfirmation])===!1&&k!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:D,...Re}=_nullishCoalesce(_optionalChain([n, 'optionalAccess', _33 => _33.embeddedWallets]), () => ({}));return{id:t.id,name:t.name,allowlistConfig:t.allowlistConfig,legacyWalletUiConfig:t.legacyWalletUiConfig,appearance:{logo:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _34 => _34.appearance, 'optionalAccess', _35 => _35.logo]), () => (t.logoUrl)),landingHeader:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _36 => _36.appearance, 'optionalAccess', _37 => _37.landingHeader]), () => (d.appearance.landingHeader)),loginMessage:typeof _optionalChain([n, 'optionalAccess', _38 => _38.appearance, 'optionalAccess', _39 => _39.loginMessage])=="string"?_optionalChain([n, 'optionalAccess', _40 => _40.appearance, 'optionalAccess', _41 => _41.loginMessage, 'access', _42 => _42.slice, 'call', _43 => _43(0,100)]):_optionalChain([n, 'optionalAccess', _44 => _44.appearance, 'optionalAccess', _45 => _45.loginMessage]),palette:Ae({backgroundTheme:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _46 => _46.appearance, 'optionalAccess', _47 => _47.theme]), () => (d.appearance.theme)),accentHex:_nullishCoalesce(_nullishCoalesce(_optionalChain([n, 'optionalAccess', _48 => _48.appearance, 'optionalAccess', _49 => _49.accentColor]), () => (t.accentColor)), () => (d.appearance.accentColor))}),loginGroupPriority:T?"web3-first":"web2-first",hideDirectWeb2Inputs:!!_optionalChain([n, 'optionalAccess', _50 => _50.appearance, 'optionalAccess', _51 => _51.hideDirectWeb2Inputs]),walletList:We,walletChainType:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _52 => _52.appearance, 'optionalAccess', _53 => _53.walletChainType]), () => ("ethereum-only"))},loginMethods:{wallet:p,email:i,sms:r,passkey:l,google:a,twitter:c,discord:h,github:C,spotify:b,instagram:E,tiktok:f,linkedin:_,apple:S,farcaster:A,telegram:w},loginMethodsAndOrder:Oe,legal:{termsAndConditionsUrl:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _54 => _54.legal, 'optionalAccess', _55 => _55.termsAndConditionsUrl]), () => (t.termsAndConditionsUrl)),privacyPolicyUrl:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _56 => _56.legal, 'optionalAccess', _57 => _57.privacyPolicyUrl]), () => (t.privacyPolicyUrl)),requireUsersAcceptTerms:_nullishCoalesce(t.requireUsersAcceptTerms, () => (!1))},walletConnectCloudProjectId:_nullishCoalesce(_nullishCoalesce(_optionalChain([n, 'optionalAccess', _58 => _58.walletConnectCloudProjectId]), () => (t.walletConnectCloudProjectId)), () => (d.walletConnectCloudProjectId)),rpcConfig:{rpcUrls:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _59 => _59.rpcConfig, 'optionalAccess', _60 => _60.rpcUrls]), () => (d.rpcConfig.rpcUrls)),rpcTimeouts:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _61 => _61.rpcConfig, 'optionalAccess', _62 => _62.rpcTimeouts]), () => (d.rpcConfig.rpcTimeouts))},chains:Ue,defaultChain:Le,intl:{defaultCountry:Ie},shouldEnforceDefaultChainOnConnect:Me,captchaEnabled:_nullishCoalesce(t.captchaEnabled, () => (d.captchaEnabled)),captchaSiteKey:t.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _63 => _63.externalWallets, 'optionalAccess', _64 => _64.coinbaseWallet, 'optionalAccess', _65 => _65.connectionOptions]), () => (d.externalWallets.coinbaseWallet.connectionOptions))},walletConnect:{enabled:ve},solana:{connectors:_optionalChain([n, 'optionalAccess', _66 => _66.externalWallets, 'optionalAccess', _67 => _67.solana, 'optionalAccess', _68 => _68.connectors])}},embeddedWallets:{...t.embeddedWalletConfig,...typeof D=="boolean"?{requireUserOwnedRecoveryOnCreate:D}:{},...U?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...Re,noPromptOnSignature:k},mfa:{methods:_nullishCoalesce(t.mfaMethods, () => ([])),noPromptOnMfaRequired:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _69 => _69.mfa, 'optionalAccess', _70 => _70.noPromptOnMfaRequired]), () => (!1))},customAuth:U?{enabled:!0,...n.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:t.telegramAuthConfiguration},headless:!!_optionalChain([n, 'optionalAccess', _71 => _71.headless]),render:{standalone:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _72 => _72._render, 'optionalAccess', _73 => _73.standalone]), () => (d._render.standalone))},fundingConfig:t.fundingConfig,fundingMethodConfig:{..._nullishCoalesce(_optionalChain([n, 'optionalAccess', _74 => _74.fundingMethodConfig]), () => (d.fundingMethodConfig)),moonpay:{..._nullishCoalesce(_optionalChain([n, 'optionalAccess', _75 => _75.fundingMethodConfig, 'optionalAccess', _76 => _76.moonpay]), () => (d.fundingMethodConfig.moonpay)),useSandbox:_nullishCoalesce(_nullishCoalesce(_optionalChain([n, 'optionalAccess', _77 => _77.fundingMethodConfig, 'optionalAccess', _78 => _78.moonpay, 'access', _79 => _79.useSandbox]), () => (_optionalChain([n, 'optionalAccess', _80 => _80.fiatOnRamp, 'optionalAccess', _81 => _81.useSandbox]))), () => (d.fundingMethodConfig.moonpay.useSandbox))}}}}function we(t,n){if(!t)return{legacyCreateEmbeddedWalletFlag:n};let{appearance:o,additionalChains:s,supportedChains:i,defaultChain:r,externalWallets:l,...p}=t;return{...p,...s?{additionalChains:s.map(c=>c.id)}:void 0,...i?{supportedChains:i.map(c=>c.id)}:void 0,...r?{defaultChain:r.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:_optionalChain([l, 'access', _82 => _82.solana, 'optionalAccess', _83 => _83.connectors, 'optionalAccess', _84 => _84.get, 'call', _85 => _85(), 'access', _86 => _86.map, 'call', _87 => _87(c=>c.walletClientType)])}}:void 0,legacyCreateEmbeddedWalletFlag:n}}function ot({additionalChains:t,supportedChains:n,defaultChainFromConfig:o,hasRpcConfigDefined:s}){let i;if(t&&n&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),n){if(n.length===0)throw new Error("`supportedChains` must contain at least one chain");n.filter(a=>a.rpcUrls.privyWalletOverride).length>0&&s&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),i=n.map(a=>a.rpcUrls.privyWalletOverride?a:_nullishCoalesce(W.find(h=>h.id===a.id), () => (a)))}else i=W.concat(_nullishCoalesce(t, () => ([])));let r=n?i[0]:v,l=_nullishCoalesce(o, () => (r));if(!i.find(p=>p.id===l.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:i,defaultChain:l}}var Te=function(t,n=0){let o=3735928559^n,s=1103547991^n;for(let i=0,r;i<t.length;i++)r=t.charCodeAt(i),o=Math.imul(o^r,2654435761),s=Math.imul(s^r,1597334677);return o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(s^s>>>13,3266489909),s=Math.imul(s^s>>>16,2246822507),s^=Math.imul(o^o>>>13,3266489909),4294967296*(2097151&s)+(o>>>0)};var _jsxruntime = require('react/jsx-runtime');var xe={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},rt= exports.ma =M(xe,void 0,!1),R=_react.createContext.call(void 0, {appConfig:rt,isServerConfigLoaded:!1}),Uo= exports.na =({children:t,legacyCreateEmbeddedWalletFlag:n,client:o,clientConfig:s})=>{let[i,r]=_react.useState.call(void 0, null),l=_react.useMemo.call(void 0, ()=>M(_nullishCoalesce(i, () => (xe)),s,!!i),[i,s]);return _react.useEffect.call(void 0, ()=>{if(!i)return;let p=we(s,n),a=Te(JSON.stringify(p)).toString(),c=`privy:sent:${i.id}:${a}`;localStorage.getItem(c)||(o.createAnalyticsEvent({eventName:"sdk_initialize",payload:p}),localStorage.setItem(c,"t"))},[s,n,i]),_react.useEffect.call(void 0, ()=>{i||(async()=>{try{let a=await o.getServerConfig();a.customApiUrl&&o.updateApiUrl(a.customApiUrl),r(a)}catch(a){console.warn("Error generating app config: ",a)}})()},[]),_jsxruntime.jsx.call(void 0, R.Provider,{value:{appConfig:l,isServerConfigLoaded:!!i},children:t})},Lo= exports.oa =()=>{let{appConfig:t}=_react.useContext.call(void 0, R);return t},Mo= exports.pa =()=>{let{isServerConfigLoaded:t}=_react.useContext.call(void 0, R);return t};var dt=_react.createContext.call(void 0, {isNewUserThisSession:!1,walletConnectionStatus:null,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,appId:"notAdded",customAuthStatus:{status:"not-enabled"},noPromptOnSignature:{current:!1},nativeTokenSymbolForChainId:e,initializeWalletProxy:e,getAuthMeta:e,getAuthFlow:e,closePrivyModal:e,openPrivyModal:e,connectWallet:e,initLoginWithWallet:e,loginWithWallet:e,initLoginWithFarcaster:e,loginWithFarcaster:e,loginWithCode:e,initLoginWithEmail:e,initLoginWithSms:e,initUpdateEmail:e,initUpdatePhone:e,resendEmailCode:e,resendSmsCode:e,initLoginWithHeadlessOAuth:e,loginWithHeadlessOAuth:e,crossAppAuthFlow:e,initLoginWithOAuth:e,recoveryOAuthFlow:e,loginWithOAuth:e,initLoginWithPasskey:e,loginWithPasskey:e,initLinkWithPasskey:e,linkWithPasskey:e,refreshUser:e,loginWithGuestAccountFlow:e,walletProxy:null,createAnalyticsEvent:e,acceptTerms:e,getUsdTokenPrice:e,getUsdPriceForSol:e,recoverEmbeddedEthereumWallet:e,getMoonpaySignedUrl:e,initCoinbaseOnRamp:e,getCoinbaseOnRampStatus:e,updateWallets:e,fundWallet:e,setReadyToTrue:e,requestFarcasterSignerStatus:e,initLoginWithTelegram:e,loginWithTelegram:e,generateSiweMessage:e,linkWithSiwe:e,linkSmartWallet:e,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:e,recoverEmbeddedSolanaWallet:e,exportSolanaWallet:e,solanaSignMessage:e,connectCoinbaseSmartWallet:e}),Ho= exports.ra =()=>_react.useContext.call(void 0, dt);exports.a = ut; exports.b = ht; exports.c = gt; exports.d = yt; exports.e = g; exports.f = O; exports.g = u; exports.h = me; exports.i = ue; exports.j = co; exports.k = qe; exports.l = he; exports.m = ge; exports.n = ye; exports.o = fe; exports.p = _t; exports.q = Ct; exports.r = St; exports.s = At; exports.t = wt; exports.u = Tt; exports.v = kt; exports.w = Pt; exports.x = xt; exports.y = vt; exports.z = Wt; exports.A = Ot; exports.B = It; exports.C = Ut; exports.D = Lt; exports.E = Mt; exports.F = Rt; exports.G = Nt; exports.H = Dt; exports.I = Ft; exports.J = Ht; exports.K = jt; exports.L = Kt; exports.M = Yt; exports.N = Gt; exports.O = Bt; exports.P = qt; exports.Q = zt; exports.R = Vt; exports.S = Xt; exports.T = $t; exports.U = Zt; exports.V = Jt; exports.W = e; exports.X = j; exports.Y = K; exports.Z = Y; exports._ = G; exports.$ = B; exports.aa = q; exports.ba = V; exports.ca = ee; exports.da = v; exports.ea = oe; exports.fa = se; exports.ga = ie; exports.ha = ae; exports.ia = le; exports.ja = pe; exports.ka = W; exports.la = Qn; exports.ma = rt; exports.na = Uo; exports.oa = Lo; exports.pa = Mo; exports.qa = dt; exports.ra = Ho; exports.sa = je; exports.ta = so; exports.ua = Ge; exports.va = ro;