@privy-io/react-auth 1.88.0-beta-20240926133016 → 1.88.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,4 +1,4 @@
1
- "use strict";var e=require("@ethersproject/address"),t=require("react"),r=require("react/jsx-runtime"),i=require("styled-components"),a=require("./useWallets.js"),s=require("@heroicons/react/24/outline/Square2StackIcon"),o=require("@ethersproject/bignumber"),n=require("@ethersproject/units"),l=require("./internal-context.js"),c=require("@ethersproject/providers");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=d(s);let u=e=>o.BigNumber.from(e);class f{get(e){let t=localStorage.getItem(e);return null===t?void 0:JSON.parse(t)}put(e,t){void 0!==t?localStorage.setItem(e,JSON.stringify(t)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map((([e])=>e))}}var m="undefined"!=typeof window&&window.localStorage?new f:new class{get(e){return this._cache[e]}put(e,t){void 0!==t?this._cache[e]=t:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};const v=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,h=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==v(e))return!1;if(e.providers)for(let t of e.providers)if(!h(t))return!1;return!0},y=(e,t=3,r=4,i="ethereum")=>{if(!e)return"";let a="ethereum"===i?2:0;return t+r+a+3>=e.length?e:`${e.slice(0,a+t)}...${e.slice(e.length-r,e.length)}`},g=e=>new Promise((t=>setTimeout(t,e)));const _=(e,t,r)=>{let i,a=e.id,s=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])i=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[s])i=t.rpcUrls[s];else if(e.rpcUrls.privy?.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",r),i=t.toString()}else i=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!i)throw new l.PrivyConnectorError(`No RPC url found for ${a}`);return i};function x(e){return e?new Date(1e3*e):null}function b(e,t){return e.slice().sort(((e,t)=>(t.firstVerifiedAt??t.verifiedAt).getTime()-(e.firstVerifiedAt??e.verifiedAt).getTime())).find((e=>e.type===t))}const w=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType&&0===e.walletIndex))||null,A=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType))||null;const k=({...e})=>r.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:r.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})}),W=t.createContext(void 0);let j=()=>t.useContext(W);function C(e,r){if(!r)return;let i=j().current[e];return t.useEffect((()=>{for(let[t,a]of Object.entries(r))i.hasOwnProperty(t)||console.warn(`Invalid event type "${t}" for action "${e}"`),i[t]?.push(a);return()=>{for(let[t,a]of Object.entries(r))i.hasOwnProperty(t)||console.warn(`Invalid event type "${t}" for action "${e}"`),i[t]=i[t]?.filter((e=>e!==a))}}),[r])}function P(e,t,r,...i){for(let a of e.current[t][r])a(...i)}let T=i.styled.div`
1
+ "use strict";var e=require("react"),r=require("react/jsx-runtime"),t=require("styled-components"),o=require("./useWallets.js"),i=require("./privy-context.js"),n=require("@heroicons/react/24/outline/Square2StackIcon"),s=require("@ethersproject/bignumber"),l=require("@ethersproject/units"),a=require("@ethersproject/providers");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=c(n);let u=e=>s.BigNumber.from(e);class d{get(e){let r=localStorage.getItem(e);return null===r?void 0:JSON.parse(r)}put(e,r){void 0!==r?localStorage.setItem(e,JSON.stringify(r)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map((([e])=>e))}}var h="undefined"!=typeof window&&window.localStorage?new d:new class{get(e){return this._cache[e]}put(e,r){void 0!==r?this._cache[e]=r:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};const v=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,f=(e,r)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!r)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==v(e))return!1;if(e.providers)for(let r of e.providers)if(!f(r))return!1;return!0},y=(e,r=3,t=4,o="ethereum")=>{if(!e)return"";let i="ethereum"===o?2:0;return r+t+i+3>=e.length?e:`${e.slice(0,i+r)}...${e.slice(e.length-t,e.length)}`},m=e=>new Promise((r=>setTimeout(r,e)));const g=(e,r,t)=>{let o,n=e.id,s=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])o=e.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[s])o=r.rpcUrls[s];else if(e.rpcUrls.privy?.http[0]){let r=new URL(e.rpcUrls.privy.http[0]);r.searchParams.append("privyAppId",t),o=r.toString()}else o=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!o)throw new i.PrivyConnectorError(`No RPC url found for ${n}`);return o};const x=({...e})=>r.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:r.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})}),w=e.createContext(void 0);let b=()=>e.useContext(w);function C(r,t){if(!t)return;let o=b().current[r];return e.useEffect((()=>{for(let[e,i]of Object.entries(t))o.hasOwnProperty(e)||console.warn(`Invalid event type "${e}" for action "${r}"`),o[e]?.push(i);return()=>{for(let[e,i]of Object.entries(t))o.hasOwnProperty(e)||console.warn(`Invalid event type "${e}" for action "${r}"`),o[e]=o[e]?.filter((e=>e!==i))}}),[t])}function W(e,r,t,...o){for(let i of e.current[r][t])i(...o)}let P=t.styled.div`
2
2
  margin-top: 16px;
3
3
  font-size: 13px;
4
4
  text-align: center;
@@ -7,7 +7,7 @@
7
7
  && > a {
8
8
  color: var(--privy-color-accent);
9
9
  }
10
- `;const I=i.styled.div`
10
+ `;const k=t.styled.div`
11
11
  display: flex;
12
12
  align-items: center;
13
13
  justify-content: center;
@@ -34,7 +34,7 @@
34
34
  @media all and (display-mode: standalone) {
35
35
  padding-bottom: 30px;
36
36
  }
37
- `,E=({address:e,showCopyIcon:t,url:i,className:a})=>i?r.jsx("a",{title:e,className:a,href:`${i}/address/${e}`,target:"_blank",children:y(e)}):r.jsxs("button",{title:e,className:a,onClick:()=>navigator.clipboard.writeText(e).catch(console.error),children:[y(e),t&&r.jsx(S,{})]});let S=i.styled(p.default)`
37
+ `,$=({address:e,showCopyIcon:t,url:o,className:i})=>o?r.jsx("a",{title:e,className:i,href:`${o}/address/${e}`,target:"_blank",children:y(e)}):r.jsxs("button",{title:e,className:i,onClick:()=>navigator.clipboard.writeText(e).catch(console.error),children:[y(e),t&&r.jsx(T,{})]});let T=t.styled(p.default)`
38
38
  && {
39
39
  display: inline;
40
40
  }
@@ -43,7 +43,7 @@
43
43
  width: 0.875rem;
44
44
  margin-left: 0.125rem;
45
45
  color: var(--privy-color-foreground-3);
46
- `,$=i.keyframes`
46
+ `,E=t.keyframes`
47
47
  from, to {
48
48
  background: var(--privy-color-foreground-4);
49
49
  color: var(--privy-color-foreground-4);
@@ -53,52 +53,52 @@
53
53
  background: var(--privy-color-foreground-accent);
54
54
  color: var(--privy-color-foreground-accent);
55
55
  }
56
- `;const U=i.css`
57
- ${e=>e.$isLoading?i.css`
56
+ `;const S=t.css`
57
+ ${e=>e.$isLoading?t.css`
58
58
  width: 35%;
59
- animation: ${$} 2s linear infinite;
59
+ animation: ${E} 2s linear infinite;
60
60
  border-radius: var(--privy-border-radius-sm);
61
61
  `:""}
62
- `,F=({children:e,color:t,isLoading:i,isPulsing:a,className:s})=>r.jsx(V,{$color:t,$isLoading:i,$isPulsing:a,className:s,children:e});let V=i.styled.span`
62
+ `,j=({children:e,color:t,isLoading:o,isPulsing:i,className:n})=>r.jsx(F,{$color:t,$isLoading:o,$isPulsing:i,className:n,children:e});let F=t.styled.span`
63
63
  padding: 0.125rem 0.5rem;
64
64
  font-size: 0.75rem;
65
65
  font-weight: 500;
66
66
  line-height: 1.125rem; /* 150% */
67
67
  border-radius: var(--privy-border-radius-sm);
68
68
 
69
- ${e=>{let t,r;"green"===e.$color&&(t="var(--privy-color-success-dark)",r="var(--privy-color-success-light)"),"red"===e.$color&&(t="var(--privy-color-error)",r="var(--privy-color-error-light)"),"gray"===e.$color&&(t="var(--privy-color-foreground-2)",r="var(--privy-color-background-2)");let a=i.keyframes`
69
+ ${e=>{let r,o;"green"===e.$color&&(r="var(--privy-color-success-dark)",o="var(--privy-color-success-light)"),"red"===e.$color&&(r="var(--privy-color-error)",o="var(--privy-color-error-light)"),"gray"===e.$color&&(r="var(--privy-color-foreground-2)",o="var(--privy-color-background-2)");let i=t.keyframes`
70
70
  from, to {
71
- background-color: ${r};
71
+ background-color: ${o};
72
72
  }
73
73
 
74
74
  50% {
75
- background-color: rgba(${r}, 0.8);
75
+ background-color: rgba(${o}, 0.8);
76
76
  }
77
- `;return i.css`
78
- color: ${t};
79
- background-color: ${r};
80
- ${e.$isPulsing&&i.css`
81
- animation: ${a} 3s linear infinite;
77
+ `;return t.css`
78
+ color: ${r};
79
+ background-color: ${o};
80
+ ${e.$isPulsing&&t.css`
81
+ animation: ${i} 3s linear infinite;
82
82
  `};
83
83
  `}}
84
84
 
85
- ${U}
86
- `,N=t.createContext({});let D=e=>`privy:${e}:recent-login-method`,M=e=>`privy:${e}:recent-login-wallet-client`,O=e=>`privy:${e}:recent-login-chain-type`;const L=i.styled.div`
85
+ ${S}
86
+ `,I=e.createContext({});let U=e=>`privy:${e}:recent-login-method`,O=e=>`privy:${e}:recent-login-wallet-client`,D=e=>`privy:${e}:recent-login-chain-type`;const A=t.styled.div`
87
87
  display: flex;
88
88
  flex-direction: column;
89
- `,R=i.styled.span`
89
+ `,L=t.styled.span`
90
90
  text-align: left;
91
91
  font-size: 0.75rem;
92
92
  font-weight: 500;
93
93
  line-height: 1.125rem; /* 150% */
94
94
 
95
95
  color: var(--privy-color-error);
96
- `,B=i.styled.span`
96
+ `,M=t.styled.span`
97
97
  color: var(--privy-color-foreground-3);
98
98
  font-size: 0.75rem;
99
99
  font-weight: 500;
100
100
  line-height: 1.125rem; /* 150% */
101
- `,H=i.css`
101
+ `,_=t.css`
102
102
  && {
103
103
  border-width: 1px;
104
104
  padding: 0.5rem 1rem;
@@ -113,6 +113,6 @@
113
113
  align-items: center;
114
114
 
115
115
  ${e=>"error"===e.$state?"border-color: var(--privy-color-error);":""}
116
- `,q=i.styled.div`
117
- ${H}
118
- `;let z=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),K=e=>z.format(e);exports.Address=E,exports.Blobby=k,exports.BlobbyFooter=()=>r.jsxs(I,{children:[r.jsx(k,{}),r.jsx("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})]}),exports.Box=q,exports.BoxStyles=H,exports.Chip=F,exports.Copy=({color:e,...t})=>r.jsx("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...t,children:r.jsx("g",{children:r.jsx("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})}),exports.ErrorMessage=R,exports.LoadingSkeleton=U,exports.ModalFooter=I,exports.PrivyEventsContext=W,exports.RecentlyUsedAccountProvider=({children:e})=>{let i=a.useAppConfig(),[s,o]=t.useState({});return C("login",{onComplete:(e,t,r,a,s)=>{s&&"passkey"!==s.type&&"cross_app"!==s.type&&("wallet"!==s.type||"privy"!==s.walletClientType)&&(m.put(D(i.id),s.type),"wallet"===s.type?(m.put(M(i.id),s.walletClientType),m.put(O(i.id),s.chainType),o({accountType:s.type,walletClientType:s.walletClientType,chainType:s.chainType})):(m.del(M(i.id)),m.del(O(i.id)),o({accountType:s.type})))}}),t.useEffect((()=>{if(!i.id)return;let e=m.get(D(i.id)),t=m.get(M(i.id)),r=m.get(O(i.id));e&&o("wallet"===e?{accountType:e,walletClientType:t,chainType:r}:{accountType:e})}),[i.id]),r.jsx(N.Provider,{value:s,children:e})},exports.TermsAndConditions=function(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:i,requireUsersAcceptTerms:a}}=e.app;if(a&&!e.alwaysShowImplicitConsent||!i&&!t)return r.jsx(T,{});let s=!(!t||!i);return r.jsxs(T,{children:["By logging in I agree to the"," ",i&&r.jsx("a",{href:i,target:"_blank",children:s?"Terms":"Terms of Service"}),s&&" & ",t&&r.jsx("a",{href:t,target:"_blank",children:"Privacy Policy"})]})},exports.WalletInfoCard=({errMsg:e,balance:t,address:i,isLoading:a,className:s,title:o,isPulsing:n,showIcon:l,statusColor:c="green"})=>{let d;return d=c||(e?"red":"green"),r.jsxs(r.Fragment,{children:[r.jsxs(q,{className:s,$state:e?"error":void 0,children:[r.jsxs(L,{children:[r.jsx(B,{children:o||"Pay with"}),r.jsx(E,{address:i,showCopyIcon:l||!!e})]}),void 0!==t&&r.jsx(F,{isLoading:a,isPulsing:n,color:d,children:t})]}),e&&r.jsx(R,{style:{marginTop:"0.25rem"},children:e})]})},exports.clamp=function(e,{min:t,max:r}){return Math.min(Math.max(e,t),r)},exports.constructURL=(e,t,r={},i={})=>{let a=new URL(t,e);for(let[e,t]of Object.entries(r))void 0!==t&&a.searchParams.set(e,t);let s=Object.entries(i);if(s.length>0){let e=new URLSearchParams;for(let[t,r]of s)e.append(t,r);a.hash=e.toString()}return a.href},exports.convert1dTo2dArray=(e,t)=>{let r=e.slice(0),i=[];for(;r.length;)i.push(r.splice(0,t));return i},exports.convertUserResponseToUser=function(e){if(!e)return null;let t=function(e){let t=[];for(let r of e){let e=r.type;switch(r.type){case"wallet":let i={address:r.address,type:r.type,imported:r.imported,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at),chainType:r.chain_type,chainId:r.chain_id,walletClient:"privy"===r.wallet_client_type?"privy":"unknown",walletClientType:r.wallet_client_type,connectorType:r.connector_type,recoveryMethod:r.recovery_method,walletIndex:r.wallet_index};t.push(i);break;case"smart_wallet":let a={address:r.address,type:r.type,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at),smartWalletType:r.smart_wallet_type};t.push(a);break;case"cross_app":let s={type:r.type,subject:r.subject,embeddedWallets:r.embedded_wallets,smartWallets:r.smart_wallets,providerApp:{id:r.provider_app_id},verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at)};t.push(s);break;case"email":let o={address:r.address,type:r.type,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at)};t.push(o);break;case"phone":let n={number:r.phoneNumber,type:r.type,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at)};t.push(n);break;case"google_oauth":let l={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at)};t.push(l);break;case"spotify_oauth":let c={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at)};t.push(c);break;case"instagram_oauth":let d={subject:r.subject,username:r.username,type:r.type,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at)};t.push(d);break;case"twitter_oauth":let p={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at)};t.push(p);break;case"discord_oauth":let u={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at)};t.push(u);break;case"github_oauth":let f={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at)};t.push(f);break;case"tiktok_oauth":let m={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at)};t.push(m);break;case"linkedin_oauth":let v={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at)};t.push(v);break;case"apple_oauth":let h={subject:r.subject,email:r.email,type:r.type,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at)};t.push(h);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at)});break;case"farcaster":let y={type:r.type,fid:r.fid,ownerAddress:r.owner_address,displayName:r.display_name,username:r.username,bio:r.bio,pfp:r.profile_picture_url,url:r.homepage_url,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(y);break;case"passkey":let g={type:r.type,enrolledInMfa:r.enrolled_in_mfa,credentialId:r.credential_id,authenticatorName:r.authenticator_name,createdWithDevice:r.created_with_device,createdWithOs:r.created_with_os,createdWithBrowser:r.created_with_browser,verifiedAt:x(r.verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at)};t.push(g);break;case"telegram":let _={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,verifiedAt:x(r.first_verified_at),firstVerifiedAt:x(r.first_verified_at),latestVerifiedAt:x(r.latest_verified_at)};t.push(_);break;default:console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),r=b(t,"wallet"),i=b(t,"smart_wallet"),a=b(t,"email"),s=b(t,"phone"),o=b(t,"google_oauth"),n=b(t,"twitter_oauth"),l=b(t,"discord_oauth"),c=b(t,"github_oauth"),d=b(t,"spotify_oauth"),p=b(t,"instagram_oauth"),u=b(t,"tiktok_oauth"),f=b(t,"linkedin_oauth"),m=b(t,"apple_oauth"),v=b(t,"farcaster"),h=b(t,"telegram"),y=e.mfa_methods.map((({type:e,verified_at:t})=>({type:e,verifiedAt:x(t)})));return{id:e.id,createdAt:x(e.created_at),linkedAccounts:t,email:a&&{address:a?.address},phone:s&&{number:s?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported,walletIndex:r.walletIndex},smartWallet:i&&{address:i.address,smartWalletType:i.smartWalletType},google:o&&{subject:o.subject,email:o.email,name:o.name},twitter:n&&{subject:n.subject,username:n.username,name:n.name,profilePictureUrl:n.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:c&&{subject:c.subject,username:c.username,name:c.name,email:c.email},spotify:d&&{subject:d.subject,email:d.email,name:d.name},instagram:p&&{subject:p.subject,username:p.username},tiktok:u&&{subject:u.subject,username:u.username,name:u.name},linkedin:f&&{subject:f.subject,name:f.name,email:f.email,vanityName:f.vanityName},apple:m&&{subject:m.subject,email:m.email},farcaster:v&&{fid:v.fid,ownerAddress:v.ownerAddress,displayName:v.displayName,username:v.username,bio:v.bio,pfp:v.pfp,url:v.url,signerPublicKey:v.signerPublicKey},telegram:h&&{telegramUserId:h.telegramUserId,firstName:h.firstName,lastName:h.lastName,username:h.username,photoUrl:h.photoUrl},mfaMethods:y.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}},exports.detectInjectedConnectors=async function(e,t,r,i=3e3){let a=!1,s=window;return new Promise((o=>{function n(){if(a)return;a=!0,window.removeEventListener("ethereum#initialized",n);let i=e.getProviders();console.debug("Detected injected providers:",i.map((e=>e.info)));let s=[];for(let e of i)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||s.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let e of t.providers)e&&r.push(e);return r.push(e.ethereum),r}()){let t=v(e);if(!i.some((e=>e.info.name===t))){if(h(e,!0)&&!s.find((e=>"metamask"===e.type))){s.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!s.find((e=>"phantom"===e.type))){s.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!s.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==r?.coinbaseWallet?.connectionOptions))){s.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}s.find((e=>"unknown_browser_extension"===e.type))||s.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}o(s)}s.ethereum?n():(window.addEventListener("ethereum#initialized",n,{once:!0}),setTimeout((()=>{n()}),i))}))},exports.e=function(){try{let e="privy:__session_storage__test",t=new f;return t.put(e,"blobby"),t.del(e),!0}catch(e){return!1}},exports.e0=m,exports.emitPrivyEvent=P,exports.formatChainIdToCAIP2=function(e){return`eip155:${String(Number(e))}`},exports.formatWalletAddress=y,exports.generateTypedDataWithDomainType=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map((([e,r])=>{if(null!=r&&"string"==typeof e&&e in t)return{name:e,type:t[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:r}}},exports.getBlockExplorerUrlForAddress=(e,t)=>{let{chains:r}=l.usePrivyInternal(),i=`https://etherscan.io/address/${t}`,a=`${((e,t)=>{let r=Number(e),i=t.find((e=>e.id===r));if(!i)throw new l.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return i.blockExplorers?.default.url})(e,r)}/address/${t}`;if(!a)return i;try{new URL(a)}catch{return i}return a},exports.getDollarsFromStringFloat=(e,t)=>{let r=K(t*parseFloat(e));return"$0.00"!==r?r:"<$0.01"},exports.getDollarsFromWei=(e,t)=>{let r=K(t*parseFloat(n.formatEther(e)));return"$0.00"===r?"<$0.01":r},exports.getImportedPrivyEthereumWallet=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType))||null,exports.getJsonRpcEndpoint=(e,t,r,i)=>{let a=Number(e),s=t.find((e=>e.id===a));if(!s)throw new l.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return _(s,r,i)},exports.getJsonRpcEndpointFromChain=_,exports.getJsonRpcProvider=(e,t,r,i)=>{let a=Number(e),s=t.find((e=>e.id===a));if(!s)throw new l.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return new c.StaticJsonRpcProvider(s.rpcUrls.privyWalletOverride&&s.rpcUrls.privyWalletOverride.http[0]?s.rpcUrls.privyWalletOverride.http[0]:r.rpcUrls&&r.rpcUrls[a]?r.rpcUrls[a]:s.rpcUrls.privy?.http[0]?{url:s.rpcUrls.privy.http[0],headers:{"privy-app-id":i.appId}}:s.rpcUrls.public?.http[0]?s.rpcUrls.public.http[0]:s.rpcUrls.default?.http[0])},exports.getNativeCurrencyFromWei=(e,t,r=6,i=!1)=>{let a=parseFloat(n.formatEther(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return i?`${a} ${t}`:`${"0"===a?"<0.001":a} ${t}`},exports.getPrivyEthereumHDWallets=e=>e?.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType)),exports.getPrivyEthereumWallet=w,exports.getPrivySolanaWallet=A,exports.getSigningAndRootWallet=(t,r)=>{let i=(e=>e?.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&"ethereum"===e.chainType)))(t).find((t=>e.getAddress(t.address)===e.getAddress(r)));return{signingWallet:i,rootWallet:i?i.imported?i:w(t):void 0}},exports.i=u,exports.invokeUntilSettled=(e,t={})=>{let r=t.delayMs||150,i=t.maxAttempts||270;return new Promise((async(a,s)=>{let o=!1,n=0;for(;!o&&n<i;){if(t.abortSignal?.aborted)return;e().then((e=>{o=!0,a(e)}),((...e)=>{o=!0,s(...e)})),n+=1,await g(r)}o||s(Error("Exceeded max attempts before resolving function"))}))},exports.isCoinbaseWalletInstalled=()=>{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},exports.isPhantomInstalled=()=>{if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom)return!0}return!1},exports.pollForResult=function(e,{interval:t=100,timeout:r=5e3}={}){return new Promise(((i,a)=>{let s,o=0,n=()=>{o>=r?a("Max attempts reached without result"):(s=e(),o+=t,null==s?setTimeout(n,t):i(s))};n()}))},exports.privyEventsDefault={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},sendSolanaTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},exports.r=function(e){let t={};return void 0!==e.to&&(t.to=e.to),void 0!==e.data&&(t.data=e.data),void 0!==e.chainId&&(t.chainId=e.chainId),void 0!==e.type&&(t.type=e.type),void 0!==e.accessList&&(t.accessList=e.accessList),void 0!==e.nonce&&(t.nonce=u(e.nonce).toNumber()),void 0!==e.gasLimit&&(t.gasLimit=u(e.gasLimit)),void 0!==e.gasPrice&&(t.gasPrice=u(e.gasPrice)),void 0!==e.value&&(t.value=u(e.value)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=u(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=u(e.maxPriorityFeePerGas)),t},exports.shouldProceedtoEmbeddedWalletCreationFlow=(e,t)=>!(w(e)||A(e)||"all-users"!==t&&("users-without-wallets"!==t||(e=>e.linkedAccounts.filter((e=>"wallet"===e.type)))(e)?.length)),exports.sleep=g,exports.splitAtIndex=(e,t)=>{let r=[],i=[];for(let[a,s]of e.entries())a<t?r.push(s):i.push(s);return[r,i]},exports.stripEmoji=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),exports.sumWeiQuantitiesToHexString=e=>e.map(u).reduce(((e,t)=>e.add(t)),o.BigNumber.from(0)).toHexString(),exports.t=function(e){if("number"==typeof e||"bigint"==typeof e||"string"==typeof e)return e;if("function"==typeof e.toHexString)return e.toHexString();throw Error(`Expected numeric value but received ${e}`)},exports.toHex=e=>"string"==typeof e?e:"0x"+e.toString(16),exports.useConnectWallet=function(e){let{connectWallet:r}=t.useContext(a.PrivyContext);return C("connectWallet",e),{connectWallet:r}},exports.useElementHeight=e=>{let[r,i]=t.useState("auto");return t.useEffect((()=>{let t=new ResizeObserver((e=>{i(e[0]?.contentRect.height??"auto")}));return e.current&&t.observe(e.current),()=>{e.current&&t.unobserve(e.current)}}),[e.current]),r},exports.useEmitPrivyEvent=function(){let e=j();return(t,r,...i)=>P(e,t,r,...i)},exports.useFundWallet=e=>{C("fundWallet",e);let{fundWallet:t}=a.usePrivy();return{fundWallet:t}},exports.useLogin=function(e){let{login:r}=t.useContext(a.PrivyContext);return C("login",e),{login:r}},exports.useLogout=function(e){let{logout:r}=t.useContext(a.PrivyContext);return C("logout",e),{logout:r}},exports.usePrivyEventSubscription=C,exports.useRecentlyUsedLogin=()=>t.useContext(N),exports.validateEmail=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,}))$/);
116
+ `,R=t.styled.div`
117
+ ${_}
118
+ `;let B=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),N=e=>B.format(e);exports.Address=$,exports.Blobby=x,exports.BlobbyFooter=()=>r.jsxs(k,{children:[r.jsx(x,{}),r.jsx("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})]}),exports.Box=R,exports.BoxStyles=_,exports.Chip=j,exports.Copy=({color:e,...t})=>r.jsx("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...t,children:r.jsx("g",{children:r.jsx("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})}),exports.ErrorMessage=L,exports.LoadingSkeleton=S,exports.ModalFooter=k,exports.PrivyEventsContext=w,exports.RecentlyUsedAccountProvider=({children:t})=>{let i=o.useAppConfig(),[n,s]=e.useState({});return C("login",{onComplete:(e,r,t,o,n)=>{n&&"passkey"!==n.type&&"cross_app"!==n.type&&("wallet"!==n.type||"privy"!==n.walletClientType)&&(h.put(U(i.id),n.type),"wallet"===n.type?(h.put(O(i.id),n.walletClientType),h.put(D(i.id),n.chainType),s({accountType:n.type,walletClientType:n.walletClientType,chainType:n.chainType})):(h.del(O(i.id)),h.del(D(i.id)),s({accountType:n.type})))}}),e.useEffect((()=>{if(!i.id)return;let e=h.get(U(i.id)),r=h.get(O(i.id)),t=h.get(D(i.id));e&&s("wallet"===e?{accountType:e,walletClientType:r,chainType:t}:{accountType:e})}),[i.id]),r.jsx(I.Provider,{value:n,children:t})},exports.TermsAndConditions=function(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:o,requireUsersAcceptTerms:i}}=e.app;if(i&&!e.alwaysShowImplicitConsent||!o&&!t)return r.jsx(P,{});let n=!(!t||!o);return r.jsxs(P,{children:["By logging in I agree to the"," ",o&&r.jsx("a",{href:o,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&r.jsx("a",{href:t,target:"_blank",children:"Privacy Policy"})]})},exports.WalletInfoCard=({errMsg:e,balance:t,address:o,isLoading:i,className:n,title:s,isPulsing:l,showIcon:a,statusColor:c="green"})=>{let p;return p=c||(e?"red":"green"),r.jsxs(r.Fragment,{children:[r.jsxs(R,{className:n,$state:e?"error":void 0,children:[r.jsxs(A,{children:[r.jsx(M,{children:s||"Pay with"}),r.jsx($,{address:o,showCopyIcon:a||!!e})]}),void 0!==t&&r.jsx(j,{isLoading:i,isPulsing:l,color:p,children:t})]}),e&&r.jsx(L,{style:{marginTop:"0.25rem"},children:e})]})},exports.clamp=function(e,{min:r,max:t}){return Math.min(Math.max(e,r),t)},exports.constructURL=(e,r,t={},o={})=>{let i=new URL(r,e);for(let[e,r]of Object.entries(t))void 0!==r&&i.searchParams.set(e,r);let n=Object.entries(o);if(n.length>0){let e=new URLSearchParams;for(let[r,t]of n)e.append(r,t);i.hash=e.toString()}return i.href},exports.convert1dTo2dArray=(e,r)=>{let t=e.slice(0),o=[];for(;t.length;)o.push(t.splice(0,r));return o},exports.detectInjectedConnectors=async function(e,r,t,o=3e3){let i=!1,n=window;return new Promise((s=>{function l(){if(i)return;i=!0,window.removeEventListener("ethereum#initialized",l);let o=e.getProviders();console.debug("Detected injected providers:",o.map((e=>e.info)));let n=[];for(let e of o)r.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||n.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});for(let e of function(){let e=window,r=e.ethereum;if(!r)return[];let t=[];if(r.providers?.length)for(let e of r.providers)e&&t.push(e);return t.push(e.ethereum),t}()){let r=v(e);if(!o.some((e=>e.info.name===r))){if(f(e,!0)&&!n.find((e=>"metamask"===e.type))){n.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===r&&!n.find((e=>"phantom"===e.type))){n.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===r&&!n.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==t?.coinbaseWallet?.connectionOptions))){n.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}n.find((e=>"unknown_browser_extension"===e.type))||n.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}s(n)}n.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout((()=>{l()}),o))}))},exports.e=function(){try{let e="privy:__session_storage__test",r=new d;return r.put(e,"blobby"),r.del(e),!0}catch(e){return!1}},exports.e5=h,exports.emitPrivyEvent=W,exports.formatChainIdToCAIP2=function(e){return`eip155:${String(Number(e))}`},exports.formatWalletAddress=y,exports.generateTypedDataWithDomainType=e=>{let r={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},t=e.types.EIP712Domain??Object.entries(e.domain).map((([e,t])=>{if(null!=t&&"string"==typeof e&&e in r)return{name:e,type:r[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:t}}},exports.getBlockExplorerUrlForAddress=(e,r)=>{let{chains:t}=i.usePrivyInternal(),o=`https://etherscan.io/address/${r}`,n=`${((e,r)=>{let t=Number(e),o=r.find((e=>e.id===t));if(!o)throw new i.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url})(e,t)}/address/${r}`;if(!n)return o;try{new URL(n)}catch{return o}return n},exports.getDollarsFromStringFloat=(e,r)=>{let t=N(r*parseFloat(e));return"$0.00"!==t?t:"<$0.01"},exports.getDollarsFromWei=(e,r)=>{let t=N(r*parseFloat(l.formatEther(e)));return"$0.00"===t?"<$0.01":t},exports.getJsonRpcEndpoint=(e,r,t,o)=>{let n=Number(e),s=r.find((e=>e.id===n));if(!s)throw new i.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return g(s,t,o)},exports.getJsonRpcEndpointFromChain=g,exports.getJsonRpcProvider=(e,r,t,o)=>{let n=Number(e),s=r.find((e=>e.id===n));if(!s)throw new i.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return new a.StaticJsonRpcProvider(s.rpcUrls.privyWalletOverride&&s.rpcUrls.privyWalletOverride.http[0]?s.rpcUrls.privyWalletOverride.http[0]:t.rpcUrls&&t.rpcUrls[n]?t.rpcUrls[n]:s.rpcUrls.privy?.http[0]?{url:s.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}:s.rpcUrls.public?.http[0]?s.rpcUrls.public.http[0]:s.rpcUrls.default?.http[0])},exports.getNativeCurrencyFromWei=(e,r,t=6,o=!1)=>{let i=parseFloat(l.formatEther(e)).toFixed(t).replace(/0+$/,"").replace(/\.$/,"");return o?`${i} ${r}`:`${"0"===i?"<0.001":i} ${r}`},exports.i=u,exports.invokeUntilSettled=(e,r={})=>{let t=r.delayMs||150,o=r.maxAttempts||270;return new Promise((async(i,n)=>{let s=!1,l=0;for(;!s&&l<o;){if(r.abortSignal?.aborted)return;e().then((e=>{s=!0,i(e)}),((...e)=>{s=!0,n(...e)})),l+=1,await m(t)}s||n(Error("Exceeded max attempts before resolving function"))}))},exports.isCoinbaseWalletInstalled=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let r of e.ethereum.providers)if(r&&r.isCoinbaseWallet)return!0;return!1},exports.isPhantomInstalled=()=>{if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom)return!0}return!1},exports.pollForResult=function(e,{interval:r=100,timeout:t=5e3}={}){return new Promise(((o,i)=>{let n,s=0,l=()=>{s>=t?i("Max attempts reached without result"):(n=e(),s+=r,null==n?setTimeout(l,r):o(n))};l()}))},exports.privyEventsDefault={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},sendSolanaTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},exports.r=function(e){let r={};return void 0!==e.to&&(r.to=e.to),void 0!==e.data&&(r.data=e.data),void 0!==e.chainId&&(r.chainId=e.chainId),void 0!==e.type&&(r.type=e.type),void 0!==e.accessList&&(r.accessList=e.accessList),void 0!==e.nonce&&(r.nonce=u(e.nonce).toNumber()),void 0!==e.gasLimit&&(r.gasLimit=u(e.gasLimit)),void 0!==e.gasPrice&&(r.gasPrice=u(e.gasPrice)),void 0!==e.value&&(r.value=u(e.value)),void 0!==e.maxFeePerGas&&(r.maxFeePerGas=u(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=u(e.maxPriorityFeePerGas)),r},exports.sleep=m,exports.splitAtIndex=(e,r)=>{let t=[],o=[];for(let[i,n]of e.entries())i<r?t.push(n):o.push(n);return[t,o]},exports.stripEmoji=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),exports.sumWeiQuantitiesToHexString=e=>e.map(u).reduce(((e,r)=>e.add(r)),s.BigNumber.from(0)).toHexString(),exports.t=function(e){if("number"==typeof e||"bigint"==typeof e||"string"==typeof e)return e;if("function"==typeof e.toHexString)return e.toHexString();throw Error(`Expected numeric value but received ${e}`)},exports.toHex=e=>"string"==typeof e?e:"0x"+e.toString(16),exports.useConnectWallet=function(r){let{connectWallet:t}=e.useContext(i.PrivyContext);return C("connectWallet",r),{connectWallet:t}},exports.useElementHeight=r=>{let[t,o]=e.useState("auto");return e.useEffect((()=>{let e=new ResizeObserver((e=>{o(e[0]?.contentRect.height??"auto")}));return r.current&&e.observe(r.current),()=>{r.current&&e.unobserve(r.current)}}),[r.current]),t},exports.useEmitPrivyEvent=function(){let e=b();return(r,t,...o)=>W(e,r,t,...o)},exports.useFundWallet=e=>{C("fundWallet",e);let{fundWallet:r}=i.usePrivy();return{fundWallet:r}},exports.useLogin=function(r){let{login:t}=e.useContext(i.PrivyContext);return C("login",r),{login:t}},exports.useLogout=function(r){let{logout:t}=e.useContext(i.PrivyContext);return C("logout",r),{logout:t}},exports.usePrivyEventSubscription=C,exports.useRecentlyUsedLogin=()=>e.useContext(I),exports.validateEmail=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,}))$/);
@@ -1 +1 @@
1
- "use strict";var e=require("./internal-context.js"),t=require("@ethersproject/logger");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s,r,n=a(require("eventemitter3"));(r=s||(s={})).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",r.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",r.INVALID_DATA="invalid_data",r.LINKED_TO_ANOTHER_USER="linked_to_another_user",r.ALLOWLIST_REJECTED="allowlist_rejected",r.OAUTH_USER_DENIED="oauth_user_denied",r.UNKNOWN_AUTH_ERROR="unknown_auth_error",r.USER_EXITED_AUTH_FLOW="exited_auth_flow",r.MUST_BE_AUTHENTICATED="must_be_authenticated",r.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",r.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",r.CLIENT_REQUEST_TIMEOUT="client_request_timeout",r.INVALID_CREDENTIALS="invalid_credentials";class o extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,a){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=a}}class i extends o{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}let l={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};class d extends e.PrivyConnectorError{constructor(){super("Wallet timeout"),this.type="wallet_error"}}class c extends e.PrivyConnectorError{constructor(){super("User rejected connection"),this.type="wallet_error"}}const E=a=>{if(a instanceof e.PrivyConnectorError)return a;if(a?.code&&a?.reason){let e=new u(a);return a.code===t.ErrorCode.ACTION_REJECTED&&(e.details=l.E4001_USER_REJECTED_REQUEST),e}return a?.code?new u(a):new e.PrivyConnectorError("Unknown connector error",a)};class _ extends e.PrivyError{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}class u extends _{constructor(e){super(e.message,e.code,e.data);let t=Object.values(l).find((t=>t.eipCode===e.code));this.details=t||l.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=l.E32002_CONNECTION_ALREADY_PENDING:this.details=l.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=l.E32002_WALLET_LOCKED))}}const h={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},...l};class p extends n.default{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}}const y=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","crypto.com_wallet_extension","coinbase_wallet","coinbase_smart_wallet","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitkeep","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","privy","unknown","phantom","solflare","glow"];exports.ConnectorErrors=h,exports.E=l,exports.PrivyProviderRpcError=u,exports.ProviderRpcError=_,exports.SolanaWalletConnector=class extends p{get isInstalled(){return"Installed"===this.adapter.readyState}buildConnectedWallet(t,a){let s,r,n;if("Installed"!==t.readyState||!t.publicKey)throw Error("Wallet is not connected.");return"signMessage"in t&&(s=async(...e)=>{if(!t.connected)throw Error("Wallet is not connected.");return await t.signMessage(e[0])}),"sendTransaction"in t&&(r=async(...e)=>await t.sendTransaction(e[0],e[1],e[2])),"signTransaction"in t&&(n=async e=>await t.signTransaction(e)),{type:"solana",address:t.publicKey.toBase58(),meta:a,imported:!1,connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:async()=>t.connected,disconnect:()=>{try{t.disconnect()}catch(e){console.error("Wallet does not support programmatic disconnect")}},getProvider:e.notImplemented,signMessage:s,sendTransaction:r,signTransaction:n}}async syncAccounts(){if("Installed"===this.adapter.readyState&&this.adapter.publicKey){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};this.wallets.find((e=>this.adapter.publicKey&&e.address===this.adapter.publicKey.toBase58()))||(this.wallets=[this.buildConnectedWallet(this.adapter,e)],this.emit("walletsUpdated"))}else this.wallets.length>0&&(this.wallets=[],this.emit("walletsUpdated"))}get walletBranding(){return{id:this.adapter.name,name:this.adapter.name,icon:this.adapter.icon}}async initialize(){this.subscribeListeners(),await this.syncAccounts(),this.shouldAutoConnect&&await this.adapter.autoConnect().catch(console.error),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}async getConnectedWallet(){return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt))[0]||null}async isConnected(){return this.adapter.connected&&["Installed"].includes(this.adapter.readyState)}subscribeListeners(){this.adapter.addListener("disconnect",this.onDisconnect),this.adapter.addListener("connect",this.onConnect),this.adapter.addListener("error",this.onError),this.adapter.addListener("readyStateChange",this.onReadyStateChange)}unsubscribeListeners(){this.adapter.removeAllListeners()}constructor(e,t){super(function(e){return y.includes(e)}(e.name.toLowerCase())?e.name.toLowerCase():"unknown"),this.chainType="solana",this.connectorType="solana_adapter",this.disconnect=()=>{this.adapter.disconnect().then((()=>this.onDisconnect())).catch((e=>console.error("Error disconnecting",e)))},this.promptConnection=async()=>{try{await this.adapter.connect()}catch(e){throw E(e)}},this.onDisconnect=()=>{this.syncAccounts()},this.onConnect=e=>{this.syncAccounts()},this.onError=e=>{this.syncAccounts()},this.onReadyStateChange=e=>{"Installed"!==e&&(this.connected=!1),this.syncAccounts()},this.adapter=e,this.shouldAutoConnect=t,this.wallets=[]}},exports.UserRejectedConnectionError=c,exports.WalletConnector=p,exports.WalletTimeoutError=d,exports.formatConnectorError=E,exports.isBaseConnectedSolanaWallet=function(e){return"solana"===e.type},exports.isSolanaWalletConnector=function(e){return"solana"===e.chainType},exports.l=class extends i{constructor(e){super(e.message,e.code,e.data);let t=Object.values(l).find((t=>t.eipCode===e.code));this.details=t||l.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=l.E32002_CONNECTION_ALREADY_PENDING:this.details=l.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=l.E32002_WALLET_LOCKED))}},exports.useSolanaWallets=()=>{let{embeddedSolanaWallet:t,exportSolanaWallet:a,createEmbeddedSolanaWallet:s,solanaWallets:r}=e.usePrivyInternal();return{createWallet:s,exportWallet:a,wallets:r.concat(t?[t]:[])}};
1
+ "use strict";var e=require("./privy-context.js"),t=require("@ethersproject/logger"),a=require("eventemitter3"),s=require("./user.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n,i,o=r(a);(i=n||(n={})).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",i.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",i.INVALID_DATA="invalid_data",i.LINKED_TO_ANOTHER_USER="linked_to_another_user",i.ALLOWLIST_REJECTED="allowlist_rejected",i.OAUTH_USER_DENIED="oauth_user_denied",i.UNKNOWN_AUTH_ERROR="unknown_auth_error",i.USER_EXITED_AUTH_FLOW="exited_auth_flow",i.MUST_BE_AUTHENTICATED="must_be_authenticated",i.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",i.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",i.CLIENT_REQUEST_TIMEOUT="client_request_timeout",i.INVALID_CREDENTIALS="invalid_credentials";class l extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,a){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=a}}class d extends l{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}let c={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};class E extends e.PrivyConnectorError{constructor(){super("Wallet timeout"),this.type="wallet_error"}}class _ extends e.PrivyConnectorError{constructor(){super("User rejected connection"),this.type="wallet_error"}}const u=a=>{if(a instanceof e.PrivyConnectorError)return a;if(a?.code&&a?.reason){let e=new p(a);return a.code===t.ErrorCode.ACTION_REJECTED&&(e.details=c.E4001_USER_REJECTED_REQUEST),e}return a?.code?new p(a):new e.PrivyConnectorError("Unknown connector error",a)};class h extends e.PrivyError{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}class p extends h{constructor(e){super(e.message,e.code,e.data);let t=Object.values(c).find((t=>t.eipCode===e.code));this.details=t||c.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=c.E32002_CONNECTION_ALREADY_PENDING:this.details=c.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=c.E32002_WALLET_LOCKED))}}const y={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},...c};class C extends o.default{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}}const T=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","crypto.com_wallet_extension","coinbase_wallet","coinbase_smart_wallet","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitkeep","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","privy","unknown","phantom","solflare","glow"];exports.ConnectorErrors=y,exports.E=c,exports.PrivyProviderRpcError=p,exports.ProviderRpcError=h,exports.SolanaWalletConnector=class extends C{get isInstalled(){return"Installed"===this.adapter.readyState}buildConnectedWallet(t,a){let s,r,n;if("Installed"!==t.readyState||!t.publicKey)throw Error("Wallet is not connected.");return"signMessage"in t&&(s=async(...e)=>{if(!t.connected)throw Error("Wallet is not connected.");return await t.signMessage(e[0])}),"sendTransaction"in t&&(r=async(...e)=>await t.sendTransaction(e[0],e[1],e[2])),"signTransaction"in t&&(n=async e=>await t.signTransaction(e)),{type:"solana",address:t.publicKey.toBase58(),meta:a,imported:!1,connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:async()=>t.connected,disconnect:()=>{try{t.disconnect()}catch(e){console.error("Wallet does not support programmatic disconnect")}},getProvider:e.notImplemented,signMessage:s,sendTransaction:r,signTransaction:n}}async syncAccounts(){if("Installed"===this.adapter.readyState&&this.adapter.publicKey){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};this.wallets.find((e=>this.adapter.publicKey&&e.address===this.adapter.publicKey.toBase58()))||(this.wallets=[this.buildConnectedWallet(this.adapter,e)],this.emit("walletsUpdated"))}else this.wallets.length>0&&(this.wallets=[],this.emit("walletsUpdated"))}get walletBranding(){return{id:this.adapter.name,name:this.adapter.name,icon:this.adapter.icon}}async initialize(){this.subscribeListeners(),await this.syncAccounts(),this.shouldAutoConnect&&await this.adapter.autoConnect().catch(console.error),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}async getConnectedWallet(){return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt))[0]||null}async isConnected(){return this.adapter.connected&&["Installed"].includes(this.adapter.readyState)}subscribeListeners(){this.adapter.addListener("disconnect",this.onDisconnect),this.adapter.addListener("connect",this.onConnect),this.adapter.addListener("error",this.onError),this.adapter.addListener("readyStateChange",this.onReadyStateChange)}unsubscribeListeners(){this.adapter.removeAllListeners()}constructor(e,t){super(function(e){return T.includes(e)}(e.name.toLowerCase())?e.name.toLowerCase():"unknown"),this.chainType="solana",this.connectorType="solana_adapter",this.disconnect=()=>{this.adapter.disconnect().then((()=>this.onDisconnect())).catch((e=>console.error("Error disconnecting",e)))},this.promptConnection=async()=>{try{await this.adapter.connect()}catch(e){throw u(e)}},this.onDisconnect=()=>{this.syncAccounts()},this.onConnect=e=>{this.syncAccounts()},this.onError=e=>{this.syncAccounts()},this.onReadyStateChange=e=>{"Installed"!==e&&(this.connected=!1),this.syncAccounts()},this.adapter=e,this.shouldAutoConnect=t,this.wallets=[]}},exports.UserRejectedConnectionError=_,exports.WalletConnector=C,exports.WalletTimeoutError=E,exports.formatConnectorError=u,exports.isBaseConnectedSolanaWallet=function(e){return"solana"===e.type},exports.isSolanaWalletConnector=function(e){return"solana"===e.chainType},exports.l=class extends d{constructor(e){super(e.message,e.code,e.data);let t=Object.values(c).find((t=>t.eipCode===e.code));this.details=t||c.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=c.E32002_CONNECTION_ALREADY_PENDING:this.details=c.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=c.E32002_WALLET_LOCKED))}},exports.useSolanaWallets=()=>{let{embeddedSolanaWallet:t,exportSolanaWallet:a,createEmbeddedSolanaWallet:r,solanaWallets:n,initDelegateAction:i}=e.usePrivyInternal(),{user:o}=e.usePrivy();return{createWallet:r,exportWallet:a,delegateWalletAction:async()=>{let t=s.getPrivySolanaWallet(o);if(!t)throw new e.PrivyClientError("User must have a solana wallet in order to delegate actions");return await i({address:t.address})},wallets:n.concat(t?[t]:[])}};
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("tinycolor2"),o=require("./internal-context.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=r(n);const a={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let i=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","wallet_connect","detected_wallets","rabby_wallet","safe"]),s=e=>i.has(e),p=(e,t,n)=>n.indexOf(e)===t;const c=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(s).filter(p):e?e.filter(s).filter(p):a.appearance.walletList,m={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"}}},d={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},u={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"}}},h={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},g={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"}}},f={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},y={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},b={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},C={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"}}},E={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"}}},w={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},k={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"}}},v={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},S={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},x={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"}}},I=[m,d,S,C,E,w,k,v,y,{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},{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"}}},{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"}}},g,f,{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},{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"}}},b,{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},u,h,x,{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},{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},{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"}}},{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/"}}},{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"}}}],A=new Set(I.map((e=>e.id)));let O="#FFFFFF";function T(e,t){let n=Math.max(0,Math.min(1,e.toHsl().l+t));return l.default({...e.toHsl(),l:n})}function _({backgroundTheme:e,accentHex:t}){let n;switch(e){case"light":n=O;break;case"dark":n="#1E1E1D";break;default:n=e}let o=l.default(n),r=l.default(t),a=l.default("#51BA81"),i=l.default("#FFB74D"),s=l.default("#EC6351"),p=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(o.getLuminance()),c=T(o,"light"===p?-.04:.11),m=T(o,"light"===p?-.88:.87),d=T(o,"light"===p?-.7:.75),u=T(o,"light"===p?-.43:.45).desaturate("light"===p?60:20),h=T(o,"light"===p?-.08:.25).desaturate("light"===p?60:20),g=T(r,.15),f=T(r,-.06),y=T(s,.3),b=T(i,.3),C=l.default(r.getLuminance()>.5?"#040217":O),E=T(a,-.16),w=T(a,.4);return{colorScheme:p,background:o.toHslString(),background2:c.toHslString(),foreground:m.toHslString(),foreground2:d.toHslString(),foreground3:u.toHslString(),foreground4:h.toHslString(),accent:r.toHslString(),accentLight:g.toHslString(),accentDark:f.toHslString(),foregroundAccent:C.toHslString(),success:a.toHslString(),successDark:E.toHslString(),successLight:w.toHslString(),error:s.toHslString(),errorLight:y.toHslString(),warn:i.toHslString(),warnLight:b.toHslString()}}function U(e,t,n){let o,r,l,i,s,p,m,d,u,h,g,f,y,b,E,w,k=n?console.warn:()=>{};t?.loginMethods?(o=t.loginMethods.includes("email"),r=t.loginMethods.includes("sms"),i=t.loginMethods.includes("wallet"),s=t.loginMethods.includes("google"),p=t.loginMethods.includes("twitter"),m=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),h=t.loginMethods.includes("instagram"),d=t.loginMethods.includes("tiktok"),f=t.loginMethods.includes("github"),g=t.loginMethods.includes("linkedin"),y=t.loginMethods.includes("apple"),b=t.loginMethods.includes("farcaster"),E=t.loginMethods.includes("telegram")):(o=e.emailAuth,r=e.smsAuth,i=e.walletAuth,s=e.googleOAuth,p=e.twitterOAuth,m=e.discordOAuth,f=e.githubOAuth,u=e.spotifyOAuth,h=e.instagramOAuth,d=e.tiktokOAuth,g=e.linkedinOAuth,y=e.appleOAuth,b=e.farcasterAuth,E=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?l=!1:e.passkeyAuth&&(l=!0);let v=[o,r].filter(Boolean),S=[s,p,m,f,u,h,d,g,y,b,E].filter(Boolean),x=[i].filter(Boolean);if(v.length+S.length+x.length===0)throw Error("You must enable at least one login method");let A=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;A&&0===x.length?(k("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),A=!1):A||S.length+v.length!==0||(k("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),A=!0);let O=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&k("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let T=c({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),U=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],n=[];for(let n of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(n)?console.warn(`Duplicated login method: ${n}`):t.push(n);for(let o of e.overflow??[])t.includes(o)||n.includes(o)?console.warn(`Duplicated login method: ${o}`):n.push(o);return{primary:t,overflow:n}})({input:t?.loginMethodsAndOrder}),W=t?.intl?.defaultCountry??"US",{chains:L,defaultChain:M}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:n,hasRpcConfigDefined:o}){let r;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(0===t.length)throw Error("`supportedChains` must contain at least one chain");t.filter((e=>e.rpcUrls.privyWalletOverride)).length>0&&o&&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`."),r=t.map((e=>e.rpcUrls.privyWalletOverride?e:I.find((t=>t.id===e.id))??e))}else r=I.concat(e??[]);let l=t?r[0]:C,a=n??l;if(!r.find((e=>e.id===a.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:r,defaultChain:a}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),P=!!t?.defaultChain,F=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,H=!(e.enforceWalletUis??1);if(w=e.legacyWalletUiConfig??1?F?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??H:H,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==w)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:R,...D}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??a.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:_({backgroundTheme:t?.appearance?.theme??a.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??a.appearance.accentColor}),loginGroupPriority:A?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:T,walletChainType:t?.appearance?.walletChainType??"ethereum-only"},loginMethods:{wallet:i,email:o,sms:r,passkey:l,google:s,twitter:p,discord:m,github:f,spotify:u,instagram:h,tiktok:d,linkedin:g,apple:y,farcaster:b,telegram:E},loginMethodsAndOrder:U,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??a.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??a.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??a.rpcConfig.rpcTimeouts},chains:L,defaultChain:M,intl:{defaultCountry:W},shouldEnforceDefaultChainOnConnect:P,captchaEnabled:e.captchaEnabled??a.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??a.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:O},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof R?{requireUserOwnedRecoveryOnCreate:R}:{},...F?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...D,noPromptOnSignature:w},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:F?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??a._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??a.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??a.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??a.fundingMethodConfig.moonpay.useSandbox}}}}let W={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:""};const L=U(W,void 0,!1);let M=t.createContext({appConfig:L,isServerConfigLoaded:!1});const P=t.createContext({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:o.notImplemented,login:o.notImplemented,connectOrCreateWallet:o.notImplemented,linkEmail:o.notImplemented,linkPhone:o.notImplemented,linkFarcaster:o.notImplemented,linkWallet:o.notImplemented,startCrossAppAuthFlow:o.notImplemented,linkGoogle:o.notImplemented,linkTwitter:o.notImplemented,linkDiscord:o.notImplemented,linkGithub:o.notImplemented,linkSpotify:o.notImplemented,linkInstagram:o.notImplemented,linkTelegram:o.notImplemented,linkTiktok:o.notImplemented,linkLinkedIn:o.notImplemented,linkApple:o.notImplemented,linkPasskey:o.notImplemented,updateEmail:o.notImplemented,updatePhone:o.notImplemented,logout:o.notImplemented,getAccessToken:o.notImplemented,getEthereumProvider:o.notImplemented,getEthersProvider:o.notImplemented,getWeb3jsProvider:o.notImplemented,unlinkEmail:o.notImplemented,unlinkPhone:o.notImplemented,unlinkWallet:o.notImplemented,unlinkGoogle:o.notImplemented,unlinkTwitter:o.notImplemented,unlinkDiscord:o.notImplemented,unlinkGithub:o.notImplemented,unlinkSpotify:o.notImplemented,unlinkInstagram:o.notImplemented,unlinkTiktok:o.notImplemented,unlinkLinkedIn:o.notImplemented,unlinkApple:o.notImplemented,unlinkCrossAppAccount:o.notImplemented,unlinkFarcaster:o.notImplemented,unlinkTelegram:o.notImplemented,unlinkPasskey:o.notImplemented,setActiveWallet:o.notImplemented,forkSession:o.notImplemented,createWallet:o.notImplemented,importWallet:o.notImplemented,signMessage:o.notImplemented,signTypedData:o.notImplemented,enrollInMfa:o.notImplemented,initEnrollmentWithSms:o.notImplemented,initEnrollmentWithTotp:o.notImplemented,initEnrollmentWithPasskey:o.notImplemented,promptMfa:o.notImplemented,init:o.notImplemented,submitEnrollmentWithSms:o.notImplemented,submitEnrollmentWithTotp:o.notImplemented,submitEnrollmentWithPasskey:o.notImplemented,unenroll:o.notImplemented,submit:o.notImplemented,cancel:o.notImplemented,sendTransaction:o.notImplemented,sendSolanaTransaction:o.notImplemented,exportWallet:o.notImplemented,setWalletPassword:o.notImplemented,setWalletRecovery:o.notImplemented,requestFarcasterSignerFromWarpcast:o.notImplemented,getFarcasterSignerPublicKey:o.notImplemented,signFarcasterMessage:o.notImplemented,createGuestAccount:o.notImplemented,initLoginWithEmail:o.notImplemented,initLoginWithSms:o.notImplemented,otpState:{status:"initial"},loginWithCode:o.notImplemented,fundWallet:o.notImplemented,initLoginWithHeadlessOAuth:o.notImplemented,loginWithHeadlessOAuth:o.notImplemented,generateSiweMessage:o.notImplemented,linkWithSiwe:o.notImplemented,signMessageWithCrossAppWallet:o.notImplemented,signTypedDataWithCrossAppWallet:o.notImplemented,sendTransactionWithCrossAppWallet:o.notImplemented,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[]}),F=t.createContext(null);exports.CHAIN_ID_MAINNET=1,exports.CLIENT_ANALYTICS_ID_KEY="privy:caid",exports.CODE_VERIFIER_KEY="privy:code_verifier",exports.CONNECTIONS_HISTORY_KEY="privy:connections",exports.CONNECTORS_STATE_KEY="privy:connectors",exports.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_APP_CONFIG=L,exports.DEFAULT_NETWORK="0x1",exports.DEFAULT_PRIVY_API_URL="https://auth.privy.io",exports.DEFAULT_RPC_TIMEOUT=12e4,exports.DEFAULT_SUCCESS_SCREEN_DURATION_MS=1400,exports.DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS=4e3,exports.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS=2500,exports.DEFAULT_SUPPORTED_CHAINS=I,exports.DEFAULT_SUPPORTED_CHAIN_IDS=A,exports.DEPRECATED_REFRESH_TOKEN="deprecated",exports.FORKED_TOKEN_STORAGE_KEY="privy:session_transfer_token",exports.HEADLESS_OAUTH_KEY="privy:headless_oauth",exports.IDENTITY_TOKEN_COOKIE_KEY="privy-id-token",exports.IDENTITY_TOKEN_STORAGE_KEY="privy:id_token",exports.MOONPAY_API_URL="https://api.moonpay.com/v1",exports.MOONPAY_API_URL_SANDBOX="https://api.moonpay.com/v1",exports.MOONPAY_PUBLIC_KEY="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",exports.MOONPAY_PUBLIC_KEY_SANDBOX="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",exports.OAUTH_DISABLE_SIGNUP_KEY="privy:oauth_disable_signup",exports.PrivyAppConfigProvider=({children:n,legacyCreateEmbeddedWalletFlag:o,client:r,clientConfig:l})=>{let[a,i]=t.useState(null),s=t.useMemo((()=>U(a??W,l,!!a)),[a,l]);return t.useEffect((()=>{if(!a)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:n,additionalChains:o,supportedChains:r,defaultChain:l,externalWallets:a,...i}=e;return{...i,...o?{additionalChains:o.map((e=>e.id))}:void 0,...r?{supportedChains:r.map((e=>e.id))}:void 0,...l?{defaultChain:l.id}:void 0,...a?{walletConnect:a.walletConnect,coinbaseWallet:a.coinbaseWallet,solana:{connectors:a.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(l,o),t=function(e,t=0){let n=3735928559^t,o=1103547991^t;for(let t,r=0;r<e.length;r++)n=Math.imul(n^(t=e.charCodeAt(r)),2654435761),o=Math.imul(o^t,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),4294967296*(2097151&(o=Math.imul(o^o>>>16,2246822507)^Math.imul(n^n>>>13,3266489909)))+(n>>>0)}(JSON.stringify(e)).toString(),n=`privy:sent:${a.id}:${t}`;localStorage.getItem(n)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(n,"t"))}),[l,o,a]),t.useEffect((()=>{a||(async()=>{try{let e=await r.getServerConfig();e.customApiUrl&&r.updateApiUrl(e.customApiUrl),i(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),e.jsx(M.Provider,{value:{appConfig:s,isServerConfigLoaded:!!a},children:n})},exports.PrivyContext=P,exports.REFRESH_TOKEN_COOKIE_KEY="privy-refresh-token",exports.REFRESH_TOKEN_STORAGE_KEY="privy:refresh_token",exports.SESSION_COOKIE_KEY="privy-session",exports.STATE_CODE_KEY="privy:state_code",exports.TOKEN_COOKIE_KEY="privy-token",exports.TOKEN_STORAGE_KEY="privy:token",exports.UseWalletsContext=F,exports.VERSION="1.88.0-beta-20240926133016",exports.WALLET_PROXY_TIMEOUT=3e4,exports.arbitrum=m,exports.arbitrumSepolia=d,exports.avalanche=u,exports.avalancheFuji=h,exports.base=g,exports.baseSepolia=f,exports.celo=y,exports.getGuestCredentialStorageKey=e=>`privy:guest:${e}`,exports.getPrivyWalletKey=e=>`privy:wallet:${e}`,exports.getProviderAccessTokenStorageKey=e=>`privy:cross-app:${e}`,exports.linea=b,exports.mainnet=C,exports.optimism=E,exports.optimismSepolia=w,exports.polygon=k,exports.polygonAmoy=v,exports.sepolia=S,exports.useAppConfig=()=>{let{appConfig:e}=t.useContext(M);return e},exports.useIsServerConfigLoaded=()=>{let{isServerConfigLoaded:e}=t.useContext(M);return e},exports.usePrivy=()=>t.useContext(P),exports.useWallets=function(){let e=t.useContext(F);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e},exports.zora=x;
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(require("tinycolor2"));const a={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let n=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","wallet_connect","detected_wallets","rabby_wallet","safe"]),l=e=>n.has(e),i=(e,t,r)=>r.indexOf(e)===t;const s=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(l).filter(i):e?e.filter(l).filter(i):a.appearance.walletList,p={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"}}},c={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},h={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"}}},u={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},d={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"}}},m={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},g={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},f={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},y={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"}}},b={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"}}},C={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},w={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"}}},E={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},v={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},k={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"}}},S=[p,c,v,y,b,C,w,E,g,{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},{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"}}},{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"}}},d,m,{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},{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"}}},f,{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},h,u,k,{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},{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},{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"}}},{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/"}}},{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"}}}],x=new Set(S.map((e=>e.id)));let O="#FFFFFF";function A(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return o.default({...e.toHsl(),l:r})}function _({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=O;break;case"dark":r="#1E1E1D";break;default:r=e}let a=o.default(r),n=o.default(t),l=o.default("#51BA81"),i=o.default("#FFB74D"),s=o.default("#EC6351"),p=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(a.getLuminance()),c=A(a,"light"===p?-.04:.11),h=A(a,"light"===p?-.88:.87),u=A(a,"light"===p?-.7:.75),d=A(a,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=A(a,"light"===p?-.08:.25).desaturate("light"===p?60:20),g=A(n,.15),f=A(n,-.06),y=A(s,.3),b=A(i,.3),C=o.default(n.getLuminance()>.5?"#040217":O),w=A(l,-.16),E=A(l,.4);return{colorScheme:p,background:a.toHslString(),background2:c.toHslString(),foreground:h.toHslString(),foreground2:u.toHslString(),foreground3:d.toHslString(),foreground4:m.toHslString(),accent:n.toHslString(),accentLight:g.toHslString(),accentDark:f.toHslString(),foregroundAccent:C.toHslString(),success:l.toHslString(),successDark:w.toHslString(),successLight:E.toHslString(),error:s.toHslString(),errorLight:y.toHslString(),warn:i.toHslString(),warnLight:b.toHslString()}}function T(e,t,r){let o,n,l,i,p,c,h,u,d,m,g,f,b,C,w,E,v=r?console.warn:()=>{};t?.loginMethods?(o=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),i=t.loginMethods.includes("wallet"),p=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),h=t.loginMethods.includes("discord"),d=t.loginMethods.includes("spotify"),m=t.loginMethods.includes("instagram"),u=t.loginMethods.includes("tiktok"),f=t.loginMethods.includes("github"),g=t.loginMethods.includes("linkedin"),b=t.loginMethods.includes("apple"),C=t.loginMethods.includes("farcaster"),w=t.loginMethods.includes("telegram")):(o=e.emailAuth,n=e.smsAuth,i=e.walletAuth,p=e.googleOAuth,c=e.twitterOAuth,h=e.discordOAuth,f=e.githubOAuth,d=e.spotifyOAuth,m=e.instagramOAuth,u=e.tiktokOAuth,g=e.linkedinOAuth,b=e.appleOAuth,C=e.farcasterAuth,w=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?l=!1:e.passkeyAuth&&(l=!0);let k=[o,n].filter(Boolean),x=[p,c,h,f,d,m,u,g,b,C,w].filter(Boolean),O=[i].filter(Boolean);if(k.length+x.length+O.length===0)throw Error("You must enable at least one login method");let A=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;A&&0===O.length?(v("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),A=!1):A||x.length+k.length!==0||(v("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),A=!0);let T=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&v("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let U=s({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),L=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];for(let r of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let o of e.overflow??[])t.includes(o)||r.includes(o)?console.warn(`Duplicated login method: ${o}`):r.push(o);return{primary:t,overflow:r}})({input:t?.loginMethodsAndOrder}),M=t?.intl?.defaultCountry??"US",{chains:H,defaultChain:F}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:o}){let a;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(0===t.length)throw Error("`supportedChains` must contain at least one chain");t.filter((e=>e.rpcUrls.privyWalletOverride)).length>0&&o&&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`."),a=t.map((e=>e.rpcUrls.privyWalletOverride?e:S.find((t=>t.id===e.id))??e))}else a=S.concat(e??[]);let n=t?a[0]:y,l=r??n;if(!a.find((e=>e.id===l.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:a,defaultChain:l}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),P=!!t?.defaultChain,I=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,W=!(e.enforceWalletUis??1);if(E=e.legacyWalletUiConfig??1?I?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??W:W,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==E)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:R,...N}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??a.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:_({backgroundTheme:t?.appearance?.theme??a.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??a.appearance.accentColor}),loginGroupPriority:A?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:U,walletChainType:t?.appearance?.walletChainType??"ethereum-only"},loginMethods:{wallet:i,email:o,sms:n,passkey:l,google:p,twitter:c,discord:h,github:f,spotify:d,instagram:m,tiktok:u,linkedin:g,apple:b,farcaster:C,telegram:w},loginMethodsAndOrder:L,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??a.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??a.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??a.rpcConfig.rpcTimeouts},chains:H,defaultChain:F,intl:{defaultCountry:M},shouldEnforceDefaultChainOnConnect:P,captchaEnabled:e.captchaEnabled??a.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??a.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:T},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof R?{requireUserOwnedRecoveryOnCreate:R}:{},...I?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...N,noPromptOnSignature:E},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:I?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??a._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??a.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??a.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??a.fundingMethodConfig.moonpay.useSandbox}}}}let U={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:""};const L=T(U,void 0,!1);let M=t.createContext({appConfig:L,isServerConfigLoaded:!1});const H=t.createContext(null);exports.CHAIN_ID_MAINNET=1,exports.CLIENT_ANALYTICS_ID_KEY="privy:caid",exports.CODE_VERIFIER_KEY="privy:code_verifier",exports.CONNECTIONS_HISTORY_KEY="privy:connections",exports.CONNECTORS_STATE_KEY="privy:connectors",exports.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_APP_CONFIG=L,exports.DEFAULT_NETWORK="0x1",exports.DEFAULT_PRIVY_API_URL="https://auth.privy.io",exports.DEFAULT_RPC_TIMEOUT=12e4,exports.DEFAULT_SUCCESS_SCREEN_DURATION_MS=1400,exports.DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS=4e3,exports.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS=2500,exports.DEFAULT_SUPPORTED_CHAINS=S,exports.DEFAULT_SUPPORTED_CHAIN_IDS=x,exports.DEPRECATED_REFRESH_TOKEN="deprecated",exports.FORKED_TOKEN_STORAGE_KEY="privy:session_transfer_token",exports.HEADLESS_OAUTH_KEY="privy:headless_oauth",exports.IDENTITY_TOKEN_COOKIE_KEY="privy-id-token",exports.IDENTITY_TOKEN_STORAGE_KEY="privy:id_token",exports.MOONPAY_API_URL="https://api.moonpay.com/v1",exports.MOONPAY_API_URL_SANDBOX="https://api.moonpay.com/v1",exports.MOONPAY_PUBLIC_KEY="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",exports.MOONPAY_PUBLIC_KEY_SANDBOX="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",exports.OAUTH_DISABLE_SIGNUP_KEY="privy:oauth_disable_signup",exports.PrivyAppConfigProvider=({children:r,legacyCreateEmbeddedWalletFlag:o,client:a,clientConfig:n})=>{let[l,i]=t.useState(null),s=t.useMemo((()=>T(l??U,n,!!l)),[l,n]);return t.useEffect((()=>{if(!l)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:a,defaultChain:n,externalWallets:l,...i}=e;return{...i,...o?{additionalChains:o.map((e=>e.id))}:void 0,...a?{supportedChains:a.map((e=>e.id))}:void 0,...n?{defaultChain:n.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:l.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(n,o),t=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let t,a=0;a<e.length;a++)r=Math.imul(r^(t=e.charCodeAt(a)),2654435761),o=Math.imul(o^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),4294967296*(2097151&(o=Math.imul(o^o>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)}(JSON.stringify(e)).toString(),r=`privy:sent:${l.id}:${t}`;localStorage.getItem(r)||(a.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(r,"t"))}),[n,o,l]),t.useEffect((()=>{l||(async()=>{try{let e=await a.getServerConfig();e.customApiUrl&&a.updateApiUrl(e.customApiUrl),i(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),e.jsx(M.Provider,{value:{appConfig:s,isServerConfigLoaded:!!l},children:r})},exports.REFRESH_TOKEN_COOKIE_KEY="privy-refresh-token",exports.REFRESH_TOKEN_STORAGE_KEY="privy:refresh_token",exports.SESSION_COOKIE_KEY="privy-session",exports.STATE_CODE_KEY="privy:state_code",exports.TOKEN_COOKIE_KEY="privy-token",exports.TOKEN_STORAGE_KEY="privy:token",exports.UseWalletsContext=H,exports.VERSION="1.88.0",exports.WALLET_PROXY_TIMEOUT=3e4,exports.arbitrum=p,exports.arbitrumSepolia=c,exports.avalanche=h,exports.avalancheFuji=u,exports.base=d,exports.baseSepolia=m,exports.celo=g,exports.getGuestCredentialStorageKey=e=>`privy:guest:${e}`,exports.getPrivyWalletKey=e=>`privy:wallet:${e}`,exports.getProviderAccessTokenStorageKey=e=>`privy:cross-app:${e}`,exports.linea=f,exports.mainnet=y,exports.optimism=b,exports.optimismSepolia=C,exports.polygon=w,exports.polygonAmoy=E,exports.sepolia=v,exports.useAppConfig=()=>{let{appConfig:e}=t.useContext(M);return e},exports.useIsServerConfigLoaded=()=>{let{isServerConfigLoaded:e}=t.useContext(M);return e},exports.useWallets=function(){let e=t.useContext(H);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e},exports.zora=k;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("@ethersproject/address");function t(e){return e?new Date(1e3*e):null}function i(e,t){return e.slice().sort(((e,t)=>(t.firstVerifiedAt??t.verifiedAt).getTime()-(e.firstVerifiedAt??e.verifiedAt).getTime())).find((e=>e.type===t))}const a=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType&&0===e.walletIndex))||null,r=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType))||null;exports.convertUserResponseToUser=function(e){if(!e)return null;let a=function(e){let i=[];for(let a of e){let e=a.type;switch(a.type){case"wallet":let r={address:a.address,type:a.type,imported:a.imported,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at),chainType:a.chain_type,chainId:a.chain_id,walletClient:"privy"===a.wallet_client_type?"privy":"unknown",walletClientType:a.wallet_client_type,connectorType:a.connector_type,recoveryMethod:a.recovery_method,walletIndex:a.wallet_index};i.push(r);break;case"smart_wallet":let s={address:a.address,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at),smartWalletType:a.smart_wallet_type};i.push(s);break;case"cross_app":let l={type:a.type,subject:a.subject,embeddedWallets:a.embedded_wallets,smartWallets:a.smart_wallets,providerApp:{id:a.provider_app_id},verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(l);break;case"email":let d={address:a.address,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(d);break;case"phone":let f={number:a.phoneNumber,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(f);break;case"google_oauth":let n={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(n);break;case"spotify_oauth":let u={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(u);break;case"instagram_oauth":let p={subject:a.subject,username:a.username,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(p);break;case"twitter_oauth":let _={subject:a.subject,username:a.username,name:a.name,type:a.type,profilePictureUrl:a.profile_picture_url,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(_);break;case"discord_oauth":let m={subject:a.subject,username:a.username,email:a.email,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(m);break;case"github_oauth":let c={subject:a.subject,username:a.username,name:a.name,email:a.email,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(c);break;case"tiktok_oauth":let o={subject:a.subject,username:a.username,name:a.name,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(o);break;case"linkedin_oauth":let y={subject:a.subject,name:a.name,email:a.email,vanityName:a.vanity_name,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(y);break;case"apple_oauth":let v={subject:a.subject,email:a.email,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(v);break;case"custom_auth":i.push({type:a.type,customUserId:a.custom_user_id,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)});break;case"farcaster":let h={type:a.type,fid:a.fid,ownerAddress:a.owner_address,displayName:a.display_name,username:a.username,bio:a.bio,pfp:a.profile_picture_url,url:a.homepage_url,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at),signerPublicKey:a.signer_public_key};i.push(h);break;case"passkey":let b={type:a.type,enrolledInMfa:a.enrolled_in_mfa,credentialId:a.credential_id,authenticatorName:a.authenticator_name,createdWithDevice:a.created_with_device,createdWithOs:a.created_with_os,createdWithBrowser:a.created_with_browser,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(b);break;case"telegram":let A={type:a.type,telegramUserId:a.telegram_user_id,firstName:a.first_name,lastName:a.last_name,username:a.username,photoUrl:a.photo_url,verifiedAt:t(a.first_verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(A);break;default:console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return i}(e.linked_accounts),r=i(a,"wallet"),s=i(a,"smart_wallet"),l=i(a,"email"),d=i(a,"phone"),f=i(a,"google_oauth"),n=i(a,"twitter_oauth"),u=i(a,"discord_oauth"),p=i(a,"github_oauth"),_=i(a,"spotify_oauth"),m=i(a,"instagram_oauth"),c=i(a,"tiktok_oauth"),o=i(a,"linkedin_oauth"),y=i(a,"apple_oauth"),v=i(a,"farcaster"),h=i(a,"telegram"),b=e.mfa_methods.map((({type:e,verified_at:i})=>({type:e,verifiedAt:t(i)})));return{id:e.id,createdAt:t(e.created_at),linkedAccounts:a,email:l&&{address:l?.address},phone:d&&{number:d?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported,walletIndex:r.walletIndex},smartWallet:s&&{address:s.address,smartWalletType:s.smartWalletType},google:f&&{subject:f.subject,email:f.email,name:f.name},twitter:n&&{subject:n.subject,username:n.username,name:n.name,profilePictureUrl:n.profilePictureUrl},discord:u&&{subject:u.subject,username:u.username,email:u.email},github:p&&{subject:p.subject,username:p.username,name:p.name,email:p.email},spotify:_&&{subject:_.subject,email:_.email,name:_.name},instagram:m&&{subject:m.subject,username:m.username},tiktok:c&&{subject:c.subject,username:c.username,name:c.name},linkedin:o&&{subject:o.subject,name:o.name,email:o.email,vanityName:o.vanityName},apple:y&&{subject:y.subject,email:y.email},farcaster:v&&{fid:v.fid,ownerAddress:v.ownerAddress,displayName:v.displayName,username:v.username,bio:v.bio,pfp:v.pfp,url:v.url,signerPublicKey:v.signerPublicKey},telegram:h&&{telegramUserId:h.telegramUserId,firstName:h.firstName,lastName:h.lastName,username:h.username,photoUrl:h.photoUrl},mfaMethods:b.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}},exports.getImportedPrivyEthereumWallet=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType))||null,exports.getPrivyEthereumHDWallets=e=>e?.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType)),exports.getPrivyEthereumWallet=a,exports.getPrivySolanaWallet=r,exports.getSigningAndRootWallet=(t,i)=>{let r=(s=t,s?.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&"ethereum"===e.chainType))).find((t=>e.getAddress(t.address)===e.getAddress(i)));var s;return{signingWallet:r,rootWallet:r?r.imported?r:a(t):void 0}},exports.shouldProceedtoEmbeddedWalletCreationFlow=(e,t)=>!(a(e)||r(e)||"all-users"!==t&&("users-without-wallets"!==t||(e=>e.linkedAccounts.filter((e=>"wallet"===e.type)))(e)?.length));
@@ -327,6 +327,30 @@ type SolanaWalletRpcRequestDataType = {
327
327
  publicKey: string;
328
328
  request: SolanaRpcRequestType;
329
329
  };
330
+ type RootWalletForDelegation = {
331
+ /** Address of the root wallet for the entropy being delegated. */
332
+ address: string;
333
+ /** Chain type of the root wallet for the entropy being delegated. */
334
+ chainType: 'ethereum' | 'solana';
335
+ /** Whether or not the root wallet for the entropy being delegated is imported. */
336
+ imported: boolean;
337
+ };
338
+ type DelegatedWallet = {
339
+ /** Address for a wallet to delegate. */
340
+ address: string;
341
+ /** Chain type for a wallet to delegate. */
342
+ chainType: 'ethereum' | 'solana';
343
+ /** HD index for the wallet to delegate. */
344
+ walletIndex: number;
345
+ };
346
+ type DelegatedActionsConsentRequestDataType = {
347
+ /** Access token for the user */
348
+ accessToken: string;
349
+ /** Root wallet to delegate, which is the wallet at HD index 0 for the entropy. */
350
+ rootWallet: RootWalletForDelegation;
351
+ /** Wallets to delegate, whose entropy is the same as `rootWallet`'s. */
352
+ delegatedWallets: DelegatedWallet[];
353
+ };
330
354
  type MfaVerifyRequestDataType = {
331
355
  accessToken: string;
332
356
  };
@@ -414,6 +438,9 @@ type SolanaWalletRpcResponseDataType = {
414
438
  publicKey: string;
415
439
  response: SolanaRpcResponseType;
416
440
  };
441
+ type DelegatedActionsConsentResponseDataType = {
442
+ success: boolean;
443
+ };
417
444
  type MfaVerifyResponseDataType = Record<string, never>;
418
445
  type MfaInitEnrollmentResponseDataType = {
419
446
  method: string;
@@ -442,6 +469,7 @@ interface EmbeddedWalletProxy {
442
469
  connectSolana: (data: SolanaWalletConnectRequestDataType) => Promise<SolanaWalletConnectResponseDataType>;
443
470
  recoverSolana: (data: SolanaWalletRecoverRequestDataType) => Promise<SolanaWalletRecoverResponseDataType>;
444
471
  rpcSolana: (data: SolanaWalletRpcRequestDataType) => Promise<SolanaWalletRpcResponseDataType>;
472
+ createDelegatedAction: (data: DelegatedActionsConsentRequestDataType) => Promise<DelegatedActionsConsentResponseDataType>;
445
473
  verifyMfa: (data: MfaVerifyRequestDataType) => Promise<MfaVerifyResponseDataType>;
446
474
  initEnrollMfa: (data: MfaInitEnrollmentRequestDataType) => Promise<MfaInitEnrollmentResponseDataType>;
447
475
  submitEnrollMfa: (data: MfaSubmitEnrollmentRequestDataType) => Promise<MfaSubmitEnrollmentResponseDataType>;
@@ -327,6 +327,30 @@ type SolanaWalletRpcRequestDataType = {
327
327
  publicKey: string;
328
328
  request: SolanaRpcRequestType;
329
329
  };
330
+ type RootWalletForDelegation = {
331
+ /** Address of the root wallet for the entropy being delegated. */
332
+ address: string;
333
+ /** Chain type of the root wallet for the entropy being delegated. */
334
+ chainType: 'ethereum' | 'solana';
335
+ /** Whether or not the root wallet for the entropy being delegated is imported. */
336
+ imported: boolean;
337
+ };
338
+ type DelegatedWallet = {
339
+ /** Address for a wallet to delegate. */
340
+ address: string;
341
+ /** Chain type for a wallet to delegate. */
342
+ chainType: 'ethereum' | 'solana';
343
+ /** HD index for the wallet to delegate. */
344
+ walletIndex: number;
345
+ };
346
+ type DelegatedActionsConsentRequestDataType = {
347
+ /** Access token for the user */
348
+ accessToken: string;
349
+ /** Root wallet to delegate, which is the wallet at HD index 0 for the entropy. */
350
+ rootWallet: RootWalletForDelegation;
351
+ /** Wallets to delegate, whose entropy is the same as `rootWallet`'s. */
352
+ delegatedWallets: DelegatedWallet[];
353
+ };
330
354
  type MfaVerifyRequestDataType = {
331
355
  accessToken: string;
332
356
  };
@@ -414,6 +438,9 @@ type SolanaWalletRpcResponseDataType = {
414
438
  publicKey: string;
415
439
  response: SolanaRpcResponseType;
416
440
  };
441
+ type DelegatedActionsConsentResponseDataType = {
442
+ success: boolean;
443
+ };
417
444
  type MfaVerifyResponseDataType = Record<string, never>;
418
445
  type MfaInitEnrollmentResponseDataType = {
419
446
  method: string;
@@ -442,6 +469,7 @@ interface EmbeddedWalletProxy {
442
469
  connectSolana: (data: SolanaWalletConnectRequestDataType) => Promise<SolanaWalletConnectResponseDataType>;
443
470
  recoverSolana: (data: SolanaWalletRecoverRequestDataType) => Promise<SolanaWalletRecoverResponseDataType>;
444
471
  rpcSolana: (data: SolanaWalletRpcRequestDataType) => Promise<SolanaWalletRpcResponseDataType>;
472
+ createDelegatedAction: (data: DelegatedActionsConsentRequestDataType) => Promise<DelegatedActionsConsentResponseDataType>;
445
473
  verifyMfa: (data: MfaVerifyRequestDataType) => Promise<MfaVerifyResponseDataType>;
446
474
  initEnrollMfa: (data: MfaInitEnrollmentRequestDataType) => Promise<MfaInitEnrollmentResponseDataType>;
447
475
  submitEnrollMfa: (data: MfaSubmitEnrollmentRequestDataType) => Promise<MfaSubmitEnrollmentResponseDataType>;
@@ -1 +1 @@
1
- import{jsx as E,jsxs as _}from"react/jsx-runtime";import{useState as N,useEffect as A,useRef as S,useContext as R,createContext as C}from"react";import{u as T,a2 as L,a3 as D,a1 as O}from"./useWallets.mjs";import{n as I}from"./internal-context.mjs";function e({src:_,...N}){return E("img",{src:_,...N,style:{display:"none"}})}var a,n;(a=n||(n={})).LANDING="LANDING",a.CONNECT_OR_CREATE="CONNECT_OR_CREATE",a.AWAITING_CONNECTION="AWAITING_CONNECTION",a.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",a.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",a.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",a.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",a.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",a.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",a.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",a.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",a.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",a.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",a.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",a.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",a.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",a.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",a.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",a.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",a.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",a.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",a.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",a.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",a.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",a.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",a.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",a.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",a.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",a.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",a.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",a.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",a.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",a.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",a.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",a.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",a.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",a.INSTALL_PHANTOM_SCREEN="INSTALL_PHANTOM_SCREEN",a.PHANTOM_INTERSTITIAL_SCREEN="PHANTOM_INTERSTITIAL_SCREEN",a.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",a.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",a.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",a.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",a.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",a.MOONPAY_PROMPT_SCREEN="MOONPAY_PROMPT_SCREEN",a.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",a.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",a.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",a.CAPTCHA_SCREEN="CAPTCHA_SCREEN",a.ERROR_SCREEN="ERROR_SCREEN",a.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",a.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",a.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN";const t=C({ready:!1,app:L,currentScreen:null,lastScreen:null,navigate:I,navigateBack:I,resetNavigation:I,setModalData:I,onUserCloseViaDialogOrKeybindRef:void 0});let r=[n.LANDING,n.CONNECT_ONLY_LANDING_SCREEN,null];const i=R=>{let C=T(),L=R.authenticated,[D,O]=N(R.initialScreen);A((()=>{L||r.includes(R.initialScreen)||R.setInitialScreen(null)}),[L]);let I=S(null);A((()=>{R.open||(I.current=null)}),[R.open]),A((()=>{I.current=null}),[R.initialScreen]);let a={ready:!!C.id,app:C,data:R.data,setModalData:R.setModalData,currentScreen:R.initialScreen,lastScreen:D,navigate:(E,_=!0)=>{R.setInitialScreen(E),_&&O(R.initialScreen)},navigateBack:()=>{R.setInitialScreen(D)},resetNavigation:()=>{R.setInitialScreen(null),O(null)},onUserCloseViaDialogOrKeybindRef:I};return _(t.Provider,{value:a,children:[("string"==typeof C.appearance.logo||"img"===C.appearance.logo?.type)&&E(e,{src:"string"==typeof C.appearance.logo?C.appearance.logo:C.appearance.logo.props.src}),R.children]})},M=()=>R(t);function W(E,_){return{...E,rpcUrls:{...E.rpcUrls,privyWalletOverride:{http:[_]}}}}function l(E){let _=E.filter((E=>!D.has(E.id)));return O.concat(_)}function P(E){let _=new RegExp(RegExp("^eip155:(?<chainId>\\d+)$","gm")),N=_.exec(E)?.groups?.chainId;if(N)return parseInt(N);throw Error("Chain ID not compatible with CAIP-2 format.")}function o(E){return E.find((E=>"privy"===E.walletClientType&&"embedded"===E.connectorType&&!E.imported))??null}export{n as M,l as a,i as b,W as c,P as e,o as g,M as u};
1
+ import{jsx as E,jsxs as _}from"react/jsx-runtime";import{useState as N,useEffect as A,useRef as S,useContext as R,createContext as T}from"react";import{u as C,a0 as D,a1 as L,$ as O}from"./useWallets.mjs";import{n as I}from"./privy-context.mjs";function e({src:_,...N}){return E("img",{src:_,...N,style:{display:"none"}})}var a,n;(a=n||(n={})).LANDING="LANDING",a.CONNECT_OR_CREATE="CONNECT_OR_CREATE",a.AWAITING_CONNECTION="AWAITING_CONNECTION",a.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",a.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",a.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",a.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",a.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",a.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",a.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",a.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",a.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",a.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",a.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",a.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",a.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",a.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",a.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",a.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",a.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",a.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",a.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",a.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",a.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",a.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",a.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",a.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",a.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",a.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",a.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",a.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",a.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",a.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",a.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",a.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",a.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",a.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",a.INSTALL_PHANTOM_SCREEN="INSTALL_PHANTOM_SCREEN",a.PHANTOM_INTERSTITIAL_SCREEN="PHANTOM_INTERSTITIAL_SCREEN",a.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",a.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",a.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",a.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",a.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",a.MOONPAY_PROMPT_SCREEN="MOONPAY_PROMPT_SCREEN",a.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",a.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",a.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",a.CAPTCHA_SCREEN="CAPTCHA_SCREEN",a.ERROR_SCREEN="ERROR_SCREEN",a.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",a.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",a.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN";const r=T({ready:!1,app:D,currentScreen:null,lastScreen:null,navigate:I,navigateBack:I,resetNavigation:I,setModalData:I,onUserCloseViaDialogOrKeybindRef:void 0});let t=[n.LANDING,n.CONNECT_ONLY_LANDING_SCREEN,null];const i=R=>{let T=C(),D=R.authenticated,[L,O]=N(R.initialScreen);A((()=>{D||t.includes(R.initialScreen)||R.setInitialScreen(null)}),[D]);let I=S(null);A((()=>{R.open||(I.current=null)}),[R.open]),A((()=>{I.current=null}),[R.initialScreen]);let a={ready:!!T.id,app:T,data:R.data,setModalData:R.setModalData,currentScreen:R.initialScreen,lastScreen:L,navigate:(E,_=!0)=>{R.setInitialScreen(E),_&&O(R.initialScreen)},navigateBack:()=>{R.setInitialScreen(L)},resetNavigation:()=>{R.setInitialScreen(null),O(null)},onUserCloseViaDialogOrKeybindRef:I};return _(r.Provider,{value:a,children:[("string"==typeof T.appearance.logo||"img"===T.appearance.logo?.type)&&E(e,{src:"string"==typeof T.appearance.logo?T.appearance.logo:T.appearance.logo.props.src}),R.children]})},M=()=>R(r);function W(E,_){return{...E,rpcUrls:{...E.rpcUrls,privyWalletOverride:{http:[_]}}}}function l(E){let _=E.filter((E=>!L.has(E.id)));return O.concat(_)}function P(E){let _=new RegExp(RegExp("^eip155:(?<chainId>\\d+)$","gm")),N=_.exec(E)?.groups?.chainId;if(N)return parseInt(N);throw Error("Chain ID not compatible with CAIP-2 format.")}function o(E){return E.find((E=>"privy"===E.walletClientType&&"embedded"===E.connectorType&&!E.imported))??null}export{n as M,l as a,i as b,W as c,P as e,o as g,M as u};