@crossmint/client-sdk-react-ui 2.4.14 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-2F3UEXTE.js +1 -0
- package/dist/{chunk-K44DMLFD.js → chunk-4LRANWK2.js} +1 -1
- package/dist/{chunk-7WGCMUOL.cjs → chunk-4QCC45CF.cjs} +1 -1
- package/dist/{chunk-2SBA4RZZ.cjs → chunk-6O6IJTQD.cjs} +2 -2
- package/dist/{chunk-SL4HNAAQ.cjs → chunk-6ZSMAX3Z.cjs} +1 -1
- package/dist/{chunk-QQP4GR7V.js → chunk-AC2SJG3Q.js} +1 -1
- package/dist/{chunk-VKLZD4KR.js → chunk-D6AIYT3G.js} +1 -1
- package/dist/{chunk-TBD7RAFW.js → chunk-ED6OVXN6.js} +1 -1
- package/dist/{chunk-2HAPKOV4.cjs → chunk-ERHYDCKR.cjs} +1 -1
- package/dist/{chunk-MTNTPNKF.cjs → chunk-FF2MPFUQ.cjs} +1 -1
- package/dist/{chunk-KT4LGFPN.cjs → chunk-HNUI5756.cjs} +1 -1
- package/dist/{chunk-NIUZIBUG.cjs → chunk-I4UE7ZH5.cjs} +1 -1
- package/dist/{chunk-EMDC2MSL.cjs → chunk-IF36OTGR.cjs} +1 -1
- package/dist/chunk-JFXA2IM2.js +1 -0
- package/dist/{chunk-TKOJ53TQ.js → chunk-KSEBRSJ7.js} +1 -1
- package/dist/{chunk-U7W3V4AV.js → chunk-LI7QMYLA.js} +1 -1
- package/dist/{chunk-YEXRA5WE.cjs → chunk-N2FP2XTI.cjs} +1 -1
- package/dist/{chunk-TD7Y5ILY.js → chunk-NOV4WKFA.js} +1 -1
- package/dist/{chunk-TNFAHW6C.cjs → chunk-NQ6UUT72.cjs} +1 -1
- package/dist/chunk-NXEC4PED.cjs +1 -0
- package/dist/{chunk-4RX3E7RE.js → chunk-NXXSBR2J.js} +1 -1
- package/dist/{chunk-7ZAT35XW.js → chunk-OIOJYRRW.js} +1 -1
- package/dist/{chunk-NB4ENN4K.cjs → chunk-PC74ALET.cjs} +1 -1
- package/dist/{chunk-QYL5L7QT.js → chunk-PL33AYN5.js} +1 -1
- package/dist/{chunk-S4KQK5O2.js → chunk-Q5P4ZVKE.js} +1 -1
- package/dist/{chunk-MS75EYBH.js → chunk-QK65AMJQ.js} +2 -2
- package/dist/{chunk-XNNGBVFG.cjs → chunk-QVM6WPJU.cjs} +1 -1
- package/dist/{chunk-MMTPVBV7.js → chunk-R7XW5QUB.js} +1 -1
- package/dist/{chunk-7U6Q4ELB.cjs → chunk-S5QCH2ED.cjs} +2 -2
- package/dist/{chunk-P2ZEGHZ2.js → chunk-SC4WT2LS.js} +1 -1
- package/dist/{chunk-HJGCM4XH.js → chunk-TQ3JBX7K.js} +1 -1
- package/dist/{chunk-QZHJH22E.js → chunk-TQFETWXB.js} +1 -1
- package/dist/{chunk-WK3BTTQG.cjs → chunk-UV7TO6A4.cjs} +2 -2
- package/dist/{chunk-P3Z3BNPP.js → chunk-VFP74OBW.js} +1 -1
- package/dist/chunk-VLBYZIVH.js +231 -0
- package/dist/{chunk-CBP7TWQD.cjs → chunk-VNEMKR3Q.cjs} +1 -1
- package/dist/{chunk-B6DD26XO.cjs → chunk-YAHXNHDL.cjs} +1 -1
- package/dist/{chunk-CDCQLZVQ.cjs → chunk-YJCJIS3I.cjs} +1 -1
- package/dist/{chunk-HU2QAGS7.cjs → chunk-YL7XGPZV.cjs} +1 -1
- package/dist/{chunk-5AMDRL3A.js → chunk-ZHPSJCFM.js} +1 -1
- package/dist/chunk-ZMGWLGIG.cjs +231 -0
- package/dist/{chunk-3IRE2QDL.cjs → chunk-ZNFOZDZO.cjs} +2 -2
- package/dist/components/CrossmintNFTCollectionView.cjs +1 -1
- package/dist/components/CrossmintNFTCollectionView.js +1 -1
- package/dist/components/CrossmintNFTDetail.cjs +1 -1
- package/dist/components/CrossmintNFTDetail.js +1 -1
- package/dist/components/auth/AuthForm.cjs +1 -1
- package/dist/components/auth/AuthForm.js +1 -1
- package/dist/components/auth/AuthFormBackButton.cjs +1 -1
- package/dist/components/auth/AuthFormBackButton.js +1 -1
- package/dist/components/auth/AuthFormDialog.cjs +1 -1
- package/dist/components/auth/AuthFormDialog.js +1 -1
- package/dist/components/auth/EmbeddedAuthForm.cjs +1 -1
- package/dist/components/auth/EmbeddedAuthForm.js +1 -1
- package/dist/components/auth/PasskeyPrompt.cjs +1 -1
- package/dist/components/auth/PasskeyPrompt.js +1 -1
- package/dist/components/auth/methods/email/EmailAuthFlow.cjs +1 -1
- package/dist/components/auth/methods/email/EmailAuthFlow.js +1 -1
- package/dist/components/auth/methods/email/EmailOTPInput.cjs +1 -1
- package/dist/components/auth/methods/email/EmailOTPInput.js +1 -1
- package/dist/components/auth/methods/email/EmailSignIn.cjs +1 -1
- package/dist/components/auth/methods/email/EmailSignIn.js +1 -1
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.cjs +1 -1
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.js +1 -1
- package/dist/components/auth/methods/google/ContinueWithGoogle.cjs +1 -1
- package/dist/components/auth/methods/google/ContinueWithGoogle.js +1 -1
- package/dist/components/auth/methods/google/GoogleSignIn.cjs +1 -1
- package/dist/components/auth/methods/google/GoogleSignIn.js +1 -1
- package/dist/components/auth/methods/twitter/TwitterSignIn.cjs +1 -1
- package/dist/components/auth/methods/twitter/TwitterSignIn.js +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlow.cjs +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlow.js +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlowButton.cjs +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlowButton.js +1 -1
- package/dist/components/auth/methods/web3/Web3Connectors.cjs +1 -1
- package/dist/components/auth/methods/web3/Web3Connectors.js +1 -1
- package/dist/components/common/Divider.cjs +1 -1
- package/dist/components/common/Divider.js +1 -1
- package/dist/components/embed/index.cjs +1 -1
- package/dist/components/embed/index.js +1 -1
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.cjs +1 -1
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +1 -1
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.cjs +1 -1
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.js +1 -1
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs +1 -1
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.js +1 -1
- package/dist/components/embed/v3/crypto/utils/handleSendTransaction.cjs +1 -1
- package/dist/components/embed/v3/crypto/utils/handleSendTransaction.js +1 -1
- package/dist/components/embed/v3/index.cjs +1 -1
- package/dist/components/embed/v3/index.js +1 -1
- package/dist/components/hosted/index.cjs +1 -1
- package/dist/components/hosted/index.js +1 -1
- package/dist/components/hosted/v3/CrossmintHostedCheckoutV3.cjs +1 -1
- package/dist/components/hosted/v3/CrossmintHostedCheckoutV3.js +1 -1
- package/dist/components/hosted/v3/index.cjs +1 -1
- package/dist/components/hosted/v3/index.js +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/signers/BaseCodeInput.cjs +1 -1
- package/dist/components/signers/BaseCodeInput.js +1 -1
- package/dist/components/signers/EmailSignersDialog.cjs +1 -1
- package/dist/components/signers/EmailSignersDialog.js +1 -1
- package/dist/components/signers/PhoneSignersDialog.cjs +1 -1
- package/dist/components/signers/PhoneSignersDialog.js +1 -1
- package/dist/components/signers/index.cjs +1 -1
- package/dist/components/signers/index.js +1 -1
- package/dist/consts/version.cjs +1 -1
- package/dist/consts/version.js +1 -1
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.cts +1 -5
- package/dist/hooks/index.d.ts +1 -5
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useAuth.cjs +1 -1
- package/dist/hooks/useAuth.d.cts +8 -20
- package/dist/hooks/useAuth.d.ts +8 -20
- package/dist/hooks/useAuth.js +1 -1
- package/dist/hooks/useCrossmintCheckout.cjs +1 -1
- package/dist/hooks/useCrossmintCheckout.js +1 -1
- package/dist/hooks/useOAuthWindowListener.cjs +1 -1
- package/dist/hooks/useOAuthWindowListener.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.js +1 -1
- package/dist/providers/CrossmintAuthProvider.cjs +1 -1
- package/dist/providers/CrossmintAuthProvider.d.cts +6 -3
- package/dist/providers/CrossmintAuthProvider.d.ts +6 -3
- package/dist/providers/CrossmintAuthProvider.js +1 -1
- package/dist/providers/CrossmintWalletProvider.cjs +1 -1
- package/dist/providers/CrossmintWalletProvider.js +1 -1
- package/dist/providers/auth/AuthFormProvider.cjs +1 -1
- package/dist/providers/auth/AuthFormProvider.d.cts +2 -3
- package/dist/providers/auth/AuthFormProvider.d.ts +2 -3
- package/dist/providers/auth/AuthFormProvider.js +1 -1
- package/dist/providers/auth/OAuthFlowProvider.cjs +1 -1
- package/dist/providers/auth/OAuthFlowProvider.js +1 -1
- package/dist/providers/dynamic/DynamicWalletProvider.cjs +1 -1
- package/dist/providers/dynamic/DynamicWalletProvider.js +1 -1
- package/dist/providers/index.cjs +1 -1
- package/dist/providers/index.d.cts +4 -2
- package/dist/providers/index.d.ts +4 -2
- package/dist/providers/index.js +1 -1
- package/dist/types/auth.d.cts +7 -11
- package/dist/types/auth.d.ts +7 -11
- package/dist/utils/createCrossmintApiClient.cjs +1 -1
- package/dist/utils/createCrossmintApiClient.js +1 -1
- package/package.json +7 -7
- package/dist/chunk-4UUATSN7.js +0 -231
- package/dist/chunk-7ABHEMG7.cjs +0 -1
- package/dist/chunk-CRAAKUIH.cjs +0 -231
- package/dist/chunk-EQBKWDH2.cjs +0 -1
- package/dist/chunk-GGGQABDX.cjs +0 -1
- package/dist/chunk-GIFMRB57.cjs +0 -1
- package/dist/chunk-HYWUM3J2.js +0 -1
- package/dist/chunk-P326KEWC.js +0 -1
- package/dist/chunk-P4RTBQI6.js +0 -0
- package/dist/chunk-S3657AEO.cjs +0 -1
- package/dist/chunk-USHJQJ4J.js +0 -1
- package/dist/chunk-VLZLZ4PN.js +0 -1
- package/dist/chunk-WK7PY5WL.js +0 -1
- package/dist/hooks/useCrossmintAuth.cjs +0 -1
- package/dist/hooks/useCrossmintAuth.d.cts +0 -22
- package/dist/hooks/useCrossmintAuth.d.ts +0 -22
- package/dist/hooks/useCrossmintAuth.js +0 -1
- package/dist/providers/CrossmintAuthProviderInternal.cjs +0 -1
- package/dist/providers/CrossmintAuthProviderInternal.d.cts +0 -26
- package/dist/providers/CrossmintAuthProviderInternal.d.ts +0 -26
- package/dist/providers/CrossmintAuthProviderInternal.js +0 -1
- /package/dist/{chunk-QVXTNSBH.js → chunk-5MZTUSMQ.js} +0 -0
- /package/dist/{chunk-2PVYNZP7.cjs → chunk-QI37PBS5.cjs} +0 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import{a as Tt}from"./chunk-LI7QMYLA.js";import{b as ht}from"./chunk-4KDASQO6.js";import{a as Ft}from"./chunk-JSNUJJQJ.js";import{a as kt}from"./chunk-ED6OVXN6.js";import{a as bt,b as St,c as Ot}from"./chunk-O5IPDCMT.js";import{a as H}from"./chunk-WHUNYZQD.js";import{a as gt}from"./chunk-LTY4MYLM.js";import{a as J}from"./chunk-AC2SJG3Q.js";import{a as P,b as Pt}from"./chunk-2F3UEXTE.js";import{a as Wt}from"./chunk-KFFPM6JM.js";import{a as vt}from"./chunk-23YVHBPI.js";import{a as _}from"./chunk-AOBO3CEQ.js";import{a as Et}from"./chunk-UG5R7IPH.js";import{a as wt}from"./chunk-JL7YHC7D.js";import{a as xt,b as yt,c as Ct}from"./chunk-RV2X7AFS.js";import{a as N}from"./chunk-NZUCXN2O.js";import{a as s}from"./chunk-DFSB3TWF.js";import{a as It}from"./chunk-UHFCB2EY.js";import{a as Y}from"./chunk-OAHZHKRR.js";import{a as X}from"./chunk-UAFW3OWA.js";import{a as At}from"./chunk-C3JRTLQP.js";import{a as B,b as R,c as q,d as w}from"./chunk-PXDN3KFO.js";import go from"color";import ie from"@emotion/styled";import{useState as Ze}from"react";import{useState as lt}from"react";import M from"@emotion/styled";import{useCrossmint as hr,useWallet as xr}from"@crossmint/client-sdk-react-base";import{useContext as Le}from"react";import{useEffect as it,useMemo as Se,useState as tt,useCallback as et,createContext as Oe,useRef as Ee}from"react";import{validateApiKeyAndGetCrossmintBaseUrl as ke}from"@crossmint/common-sdk-base";import{useCrossmint as Ie,CrossmintAuthBaseProvider as Fe,useCrossmintAuthBase as Nt}from"@crossmint/client-sdk-react-base";import{createContext as he,useCallback as Lt,useContext as xe,useEffect as ye,useState as Bt}from"react";import{useEffect as ce,useRef as ue,useState as me,useCallback as pe}from"react";import{ChildWindow as de,PopupWindow as fe}from"@crossmint/client-sdk-window";import{z as Z}from"zod";var Ut=(o,e)=>{let{crossmintAuth:t}=F(),[r,a]=me(null),i=ue(null);return ce(()=>(i.current==null&&(i.current=new de(window.opener||window.parent,"*",{incomingEvents:ge})),()=>{i.current!=null&&i.current.off("authMaterialFromPopupCallback")}),[]),{createPopupAndSetupListeners:pe((n,x)=>w(void 0,null,function*(){if(i.current==null)throw new Error("Child window not initialized");a(n),e(null),console.log("createPopupAndSetupListeners",n,x),console.log("oauthUrlMap",o),console.log("oauthUrlMap[provider]",o[n]);let l=new URL(o[n]);if(x!=null){let u=Array.from(l.searchParams.entries());l.search="",x&&l.searchParams.append("provider_login_hint",x),u.forEach(([m,h])=>{l.searchParams.append(m,h)})}let y=yield fe.init(l.toString(),{awaitToLoad:!1,crossOrigin:!0,width:400,height:700}),g=u=>w(void 0,null,function*(){var m,h;yield t==null?void 0:t.handleRefreshAuthMaterial(u.oneTimeSecret),(m=i.current)==null||m.off("authMaterialFromPopupCallback"),(h=y.window)==null||h.close(),a(null)}),p=u=>{var m,h;e(u.error),(m=i.current)==null||m.off("errorFromPopupCallback"),(h=y.window)==null||h.close(),a(null)};i.current.on("authMaterialFromPopupCallback",g),i.current.on("errorFromPopupCallback",p);let d=setInterval(()=>{var u,m;(u=y.window)!=null&&u.closed&&(clearInterval(d),a(null),(m=i.current)==null||m.off("authMaterialFromPopupCallback"))},2500)}),[o,t,e]),isLoading:r!=null,activeOAuthProvider:r}},ge={authMaterialFromPopupCallback:Z.object({oneTimeSecret:Z.string()}),errorFromPopupCallback:Z.object({error:Z.string()})};import{jsx as Ce}from"react/jsx-runtime";var Rt={google:"",twitter:""},$t=he(void 0);function $(){let o=xe($t);if(!o)throw new Error("useOAuthFlow must be used within an OAuthFlowProvider");return o}function Mt({children:o,prefetchOAuthUrls:e}){let{crossmintAuth:t,loginMethods:r}=Dt(),{setError:a}=P(),[i,c]=Bt(Rt),[n,x]=Bt(!0),{createPopupAndSetupListeners:l,isLoading:y,activeOAuthProvider:g}=Ut(i,a),p=Lt(()=>w(this,null,function*(){x(!0);try{let h=(r||[]).filter(f=>f in Rt).map(f=>w(this,null,function*(){let C=yield t==null?void 0:t.getOAuthUrl(f);return{[f]:C}})),v=Object.assign({},...yield Promise.all(h));c(v)}catch(m){a(m instanceof Error?m.message:"Unable to load oauth providers. Please try again later.")}finally{x(!1)}}),[r,t,a]);ye(()=>{e&&p()},[p,e]);let u={startOAuthLogin:Lt((m,h)=>w(this,null,function*(){yield l(m,h)}),[l]),isLoading:n||y,activeOAuthProvider:g};return Ce($t.Provider,{value:u,children:o})}import{useEffect as nt,useMemo as zt}from"react";import{useDynamicContext as we}from"@dynamic-labs/sdk-react-core";import{isEthereumWallet as ve}from"@dynamic-labs/ethereum";import{isSolanaWallet as Ae}from"@dynamic-labs/solana";import Pe from"bs58";import{EthereumWalletConnectors as jt}from"@dynamic-labs/ethereum";import{SolanaWalletConnectors as Gt}from"@dynamic-labs/solana";import{jsx as _t}from"react/jsx-runtime";function be({children:o,enabled:e,onSdkLoaded:t,onWalletConnected:r,jwt:a}){let{primaryWallet:i,sdkHasLoaded:c,removeWallet:n,handleUnlinkWallet:x}=we(),l=!e||c;return nt(()=>{l&&(t==null||t(l))},[l,t]),nt(()=>{a==null&&l&&i!=null&&(n(i.id),x(i.id))},[a,l,i,n,x]),nt(()=>{function y(){return w(this,null,function*(){try{if(ve(i)){let g=yield i.getWalletClient(),p={type:"external-wallet",address:g.account.address,viemAccount:R(B({},g.account),{signMessage:d=>w(this,null,function*(){return yield g.signMessage({message:d.message})})})};r(p)}else if(Ae(i)){let g=yield i.getSigner(),p={type:"external-wallet",address:i.address,onSignTransaction:d=>w(this,null,function*(){return yield g.signTransaction(d)})};r(p)}else throw new Error("Unsupported wallet type")}catch(g){throw console.error("Failed to get admin signer",g),new Error("Failed to get admin signer")}})}i!=null&&a!=null&&y()},[i,a,r]),o}function Ht({children:o,enabled:e=!0,apiKeyEnvironment:t,loginMethods:r=["web3"],appearance:a,onSdkLoaded:i,onWalletConnected:c}){var g,p;let{crossmintAuth:n,jwt:x}=F(),l=zt(()=>{var d,u;return`.powered-by-dynamic { display: none !important; }
|
|
2
|
+
.wallet-list__scroll-container { padding: 0px !important; }
|
|
3
|
+
.wallet-list__search-container { padding-left: 0px !important; padding-right: 0px !important; }
|
|
4
|
+
.dynamic-footer { display: none !important; }
|
|
5
|
+
h1 { color: ${(d=a==null?void 0:a.colors)==null?void 0:d.textPrimary} !important; }
|
|
6
|
+
* { color: ${(u=a==null?void 0:a.colors)==null?void 0:u.textSecondary} !important; }`},[(g=a==null?void 0:a.colors)==null?void 0:g.textPrimary,(p=a==null?void 0:a.colors)==null?void 0:p.textSecondary]),y=zt(()=>{if(e)return r.includes("web3:evm-only")?[jt]:r.includes("web3:solana-only")?[Gt]:[jt,Gt]},[e,r]);return _t(gt,{apiKeyEnvironment:t,settings:{walletConnectors:y,cssOverrides:l,events:{onAuthFailure(d,u){console.error("[DynamicWalletProvider] onAuthFailure",d,u)}},handlers:{handleConnectedWallet:d=>w(this,null,function*(){var m;if(!n)return console.error("[DynamicWalletProvider] crossmintAuth is not available"),!1;let u=d.address;if(u==null)return console.error("[DynamicWalletProvider] handleConnectedWallet: address is missing"),!1;try{let v=(yield ht(d))==="solana"?"solana":"evm",f=yield n.signInWithSmartWallet(u,v);if((f==null?void 0:f.challenge)==null)throw new Error("No challenge received from signInWithSmartWallet");let C=yield(m=d.connector)==null?void 0:m.proveOwnership(u,f.challenge);if(C==null)throw new Error("Failed to get signature from wallet");let W=C;if(v==="solana"){let L=Buffer.from(C,"base64");W=Pe.encode(L)}let A=yield n.authenticateSmartWallet(u,v,W);if((A==null?void 0:A.oneTimeSecret)==null)throw new Error("No oneTimeSecret received from authenticateSmartWallet");return yield n.handleRefreshAuthMaterial(A.oneTimeSecret),!0}catch(h){return console.error("[DynamicWalletProvider] Error handling wallet connection:",h),!1}})}},children:_t(be,{enabled:e,onSdkLoaded:i,onWalletConnected:c,jwt:x,children:o})},`${t}-${r.join(",")}`)}import{Fragment as Kt,jsx as T,jsxs as Qt}from"react/jsx-runtime";var We={crossmintAuth:void 0,login:()=>{},logout:()=>{},jwt:void 0,user:void 0,status:"initializing",getUser:()=>{},experimental_externalWalletSigner:void 0,experimental_loginWithOAuth:()=>Promise.resolve(),loginMethods:[]},at=Oe(We);function Te({children:o,appearance:e,termsOfServiceText:t,prefetchOAuthUrls:r=!0,authModalTitle:a,onLoginSuccess:i,loginMethods:c=["email","google"]}){let n=Nt(),{crossmint:x,experimental_setCustomAuth:l,experimental_customAuth:y}=Ie("CrossmintAuthProvider must be used within CrossmintProvider"),g=ke(x.apiKey),[p,d]=tt(!1),[u,m]=tt(void 0),[h,v]=tt(!0),f=c.some(I=>I.startsWith("web3")),[C,W]=tt(void 0),A=Ee(null);it(()=>{var I,G;n.jwt==null&&(y==null?void 0:y.jwt)!=null&&l(void 0),C!=null||((I=n.user)==null?void 0:I.email)!=null?l({jwt:n.jwt,email:(G=n.user)==null?void 0:G.email,externalWalletSigner:C}):l({jwt:n.jwt})},[C,n.jwt,n.user,l,y]),it(()=>{n.jwt!=null&&p&&d(!1)},[n.jwt,p]);let L=et(I=>{if(n.jwt!=null){console.log("User already logged in");return}I!=null&&typeof I=="string"&&m(I),d(!0)},[n.jwt]),j=et(()=>n.status==="initializing"||f&&!h?"initializing":n.jwt!=null?"logged-in":p?"in-progress":"logged-out",[n.status,n.jwt,f,h,p]),ft=et(I=>w(this,null,function*(){var G;if(n.jwt!=null){console.log("User already logged in");return}yield(G=A.current)==null?void 0:G.call(A,I)}),[n.jwt]),se=Se(()=>R(B({},n),{login:L,status:j(),experimental_externalWalletSigner:C,experimental_loginWithOAuth:ft,loginMethods:c}),[n,L,j,C,ft,c]);return T(at.Provider,{value:se,children:T(Pt,{setDialogOpen:(I,G)=>{d(I),G&&(i==null||i())},initialState:{appearance:e,loginMethods:c,termsOfServiceText:t,authModalTitle:a,baseUrl:g,defaultEmail:u},children:T(Mt,{prefetchOAuthUrls:j()==="logged-out"&&r,children:T(Ue,{loginWithOAuthRef:A,children:f?Qt(Ht,{apiKeyEnvironment:x.apiKey.includes("production")?"production":"staging",loginMethods:c,appearance:e,onSdkLoaded:v,onWalletConnected:W,children:[o,T(ot,{open:p})]}):Qt(Kt,{children:[o,T(ot,{open:p})]})})})})})}function Ue({children:o,loginWithOAuthRef:e}){let{startOAuthLogin:t}=$(),r=Nt(),a=et(i=>w(this,null,function*(){if(r.jwt!=null){console.log("User already logged in");return}yield t(i)}),[r.jwt,t]);return it(()=>{e.current=a},[a,e]),T(Kt,{children:o})}function tr({children:o,appearance:e,termsOfServiceText:t,prefetchOAuthUrls:r=!0,authModalTitle:a,onLoginSuccess:i,loginMethods:c=["email","google"],refreshRoute:n,logoutRoute:x}){return T(Fe,{onLoginSuccess:i,refreshRoute:n,logoutRoute:x,children:T(Te,{onLoginSuccess:i,appearance:e,termsOfServiceText:t,prefetchOAuthUrls:r,authModalTitle:a,loginMethods:c,children:o})})}function F(){let o=Le(at);if(o==null)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return o}var Dt=F;import{jsx as b,jsxs as K}from"react/jsx-runtime";var Be=M.div`
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
`,Re=M.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: flex-start;
|
|
14
|
+
width: 100%;
|
|
15
|
+
`,$e=M.div`
|
|
16
|
+
position: relative;
|
|
17
|
+
left: 12px;
|
|
18
|
+
`,Me=M.p`
|
|
19
|
+
font-size: 16px;
|
|
20
|
+
font-weight: 400;
|
|
21
|
+
margin: 16px 0 4px 0;
|
|
22
|
+
text-align: center;
|
|
23
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textPrimary)||s["cm-text-primary"]}};
|
|
24
|
+
`,De=M.p`
|
|
25
|
+
text-align: center;
|
|
26
|
+
padding: 0 16px;
|
|
27
|
+
margin: 0;
|
|
28
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||s["cm-text-secondary"]}};
|
|
29
|
+
font-size: 14px;
|
|
30
|
+
line-height: 1.4;
|
|
31
|
+
`,ze=M.div`
|
|
32
|
+
padding: 32px 0;
|
|
33
|
+
`,Q=M(Ot)`
|
|
34
|
+
@media (max-width: 379px) {
|
|
35
|
+
width: 40px;
|
|
36
|
+
height: 56px;
|
|
37
|
+
font-size: 28px;
|
|
38
|
+
margin: 0;
|
|
39
|
+
}
|
|
40
|
+
`,je=M.div`
|
|
41
|
+
font-size: 12px;
|
|
42
|
+
line-height: 1.3;
|
|
43
|
+
text-align: center;
|
|
44
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||s["cm-text-secondary"]}};
|
|
45
|
+
`;function Vt({otpEmailData:o,setOtpEmailData:e}){var h,v,f,C,W;let{crossmintAuth:t}=F(),{appearance:r,setDialogOpen:a,setStep:i,setError:c}=P(),[n,x]=lt(""),[l,y]=lt(!1),[g,p]=lt(!1),d=()=>w(this,null,function*(){var A,L;p(!0);try{let j=yield t==null?void 0:t.confirmEmailOtp((A=o==null?void 0:o.email)!=null?A:"",(L=o==null?void 0:o.emailId)!=null?L:"",n);yield t==null?void 0:t.handleRefreshAuthMaterial(j),a(!1,!0),i("initial")}catch(j){console.error("Error confirming email OTP",j),c("Invalid code. Please try again."),y(!0)}finally{p(!1)}}),u=()=>w(this,null,function*(){var A;try{yield t==null?void 0:t.sendEmailOtp((A=o==null?void 0:o.email)!=null?A:"")}catch(L){c("Failed to resend code. Please try again.")}});return K(Be,{children:[b(J,{onClick:()=>{i("initial"),e(null)},iconColor:(h=r==null?void 0:r.colors)==null?void 0:h.textPrimary,ringColor:(v=r==null?void 0:r.colors)==null?void 0:v.accent}),K(Re,{children:[b($e,{children:b(At,{customAccentColor:(f=r==null?void 0:r.colors)==null?void 0:f.accent,customButtonBackgroundColor:(C=r==null?void 0:r.colors)==null?void 0:C.buttonBackground,customBackgroundColor:(W=r==null?void 0:r.colors)==null?void 0:W.background})}),b(Me,{appearance:r,children:"Check your email"}),K(De,{appearance:r,children:["A temporary login code has been sent to",b("br",{}),o!=null&&o.email?b("strong",{children:o.email}):"your email address"]}),b(ze,{children:b(bt,{maxLength:6,value:n,onChange:A=>{x(A),y(!1),c(null)},onComplete:d,disabled:g,appearance:r,children:K(St,{children:[b(Q,{index:0,hasError:l}),b(Q,{index:1,hasError:l}),b(Q,{index:2,hasError:l}),b(Q,{index:3,hasError:l}),b(Q,{index:4,hasError:l}),b(Q,{index:5,hasError:l})]})})}),K(je,{appearance:r,children:["Can't find the email? Check spam folder.",b("br",{}),"Some emails may take several minutes to arrive."]}),b(wt,{initialSeconds:60,appearance:r,countdownText:A=>`Re-send code in ${A}s`,countdownCompleteText:"Re-send code",handleOnClick:u})]})]})}import{useState as ct}from"react";import Jt from"color";import D from"@emotion/styled";import{isEmailValid as ut}from"@crossmint/common-sdk-auth";import qt from"@emotion/styled";import{jsx as st,jsxs as He}from"react/jsx-runtime";var Ge=qt.button`
|
|
46
|
+
${N}
|
|
47
|
+
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
gap: 8px;
|
|
52
|
+
height: 32px;
|
|
53
|
+
padding: 0 10px;
|
|
54
|
+
border: 1px solid ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.border)||s["cm-border"]}};
|
|
55
|
+
border-radius: ${o=>{var e;return((e=o.appearance)==null?void 0:e.borderRadius)||"12px"}};
|
|
56
|
+
background-color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.buttonBackground)||s["cm-background-primary"]}};
|
|
57
|
+
cursor: ${o=>o.isLoading?"not-allowed":"pointer"};
|
|
58
|
+
|
|
59
|
+
/* Hover and focus states */
|
|
60
|
+
&:hover {
|
|
61
|
+
background-color: ${o=>o.isLoading?s["cm-muted-primary"]:s["cm-hover"]};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:focus {
|
|
65
|
+
outline: none;
|
|
66
|
+
background-color: theme["cm-hover"];
|
|
67
|
+
}
|
|
68
|
+
`,_e=qt.span`
|
|
69
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||s["cm-accent"]}};
|
|
70
|
+
font-size: 14px;
|
|
71
|
+
font-weight: 400;
|
|
72
|
+
`;function Xt({emailInput:o,appearance:e}){var i,c;let{startOAuthLogin:t,activeOAuthProvider:r}=$(),a=r==="google";return He(Ge,{type:"button",appearance:e,isLoading:a,onClick:a?void 0:()=>t("google",o.trim().toLowerCase()),children:[st(Y,{style:{height:"18px",width:"18px"}}),a?st(_,{style:{color:(i=e==null?void 0:e.colors)==null?void 0:i.textSecondary,fill:(c=e==null?void 0:e.colors)==null?void 0:c.textPrimary,width:"18px",height:"18px"}}):st(_e,{appearance:e,children:"Continue"})]})}import{jsx as U,jsxs as mt}from"react/jsx-runtime";var Qe=D.div`
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
align-items: flex-start;
|
|
76
|
+
justify-content: flex-start;
|
|
77
|
+
width: 100%;
|
|
78
|
+
border-radius: 8px;
|
|
79
|
+
`,Ne=D.div`
|
|
80
|
+
width: 100%;
|
|
81
|
+
`,Ke=D.label`
|
|
82
|
+
display: block;
|
|
83
|
+
margin-bottom: 5px;
|
|
84
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textPrimary)||s["cm-text-primary"]}};
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
font-weight: 400;
|
|
87
|
+
`,Ve=D.form`
|
|
88
|
+
position: relative;
|
|
89
|
+
`,qe=D.input`
|
|
90
|
+
${N}
|
|
91
|
+
|
|
92
|
+
/* Base input styles */
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-grow: 1;
|
|
95
|
+
text-align: left;
|
|
96
|
+
padding-left: 16px;
|
|
97
|
+
padding-right: ${o=>o.showGoogleButton?"132px":"80px"};
|
|
98
|
+
height: 58px;
|
|
99
|
+
width: 100%;
|
|
100
|
+
border: 1px solid;
|
|
101
|
+
border-color: ${o=>{var e,t,r,a;return o.hasError?((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.danger)||s["cm-danger"]:((a=(r=o.appearance)==null?void 0:r.colors)==null?void 0:a.border)||s["cm-border"]}};
|
|
102
|
+
border-radius: ${o=>{var e;return((e=o.appearance)==null?void 0:e.borderRadius)||"12px"}};
|
|
103
|
+
background-color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.inputBackground)||s["cm-background-primary"]}};
|
|
104
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textPrimary)||s["cm-text-primary"]}};
|
|
105
|
+
font-size: 16px;
|
|
106
|
+
transition: border-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
|
|
107
|
+
|
|
108
|
+
&::placeholder {
|
|
109
|
+
font-weight: 400;
|
|
110
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||s["cm-text-secondary"]}};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&:focus {
|
|
114
|
+
outline: none;
|
|
115
|
+
box-shadow: 0 0 0 2px ${o=>{var e,t;return new Jt(((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||s["cm-accent"]).alpha(.18).toString()}};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&:read-only {
|
|
119
|
+
cursor: not-allowed;
|
|
120
|
+
opacity: 0.7;
|
|
121
|
+
}
|
|
122
|
+
`,Xe=D.div`
|
|
123
|
+
position: absolute;
|
|
124
|
+
right: 0;
|
|
125
|
+
top: 0;
|
|
126
|
+
bottom: 0;
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
padding-right: 16px;
|
|
130
|
+
aspect-ratio: 1/1;
|
|
131
|
+
`,Je=D.button`
|
|
132
|
+
${N}
|
|
133
|
+
|
|
134
|
+
font-weight: 500;
|
|
135
|
+
white-space: nowrap;
|
|
136
|
+
background-color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.inputBackground)||s["cm-background-primary"]}};
|
|
137
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||s["cm-accent"]}};
|
|
138
|
+
cursor: ${o=>o.disabled?"not-allowed":"pointer"};
|
|
139
|
+
opacity: ${o=>o.disabled?.6:1};
|
|
140
|
+
border: none;
|
|
141
|
+
padding: 8px 12px;
|
|
142
|
+
border-radius: 6px;
|
|
143
|
+
transition: opacity 200ms ease;
|
|
144
|
+
|
|
145
|
+
&:hover:not(:disabled) {
|
|
146
|
+
opacity: 0.8;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&:focus-visible {
|
|
150
|
+
outline: 2px solid ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||s["cm-accent"]}};
|
|
151
|
+
outline-offset: 2px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&:not(:disabled):focus-visible {
|
|
155
|
+
box-shadow: 0 0 0 2px ${o=>{var e,t;return new Jt(((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||s["cm-accent"]).alpha(.18).toString()}};
|
|
156
|
+
}
|
|
157
|
+
`,Ye=D.p`
|
|
158
|
+
font-size: 12px;
|
|
159
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.danger)||s["cm-danger"]}};
|
|
160
|
+
margin: 8px 0 8px 0;
|
|
161
|
+
`;function Yt({setOtpEmailData:o}){var m,h,v;let{crossmintAuth:e}=F(),{appearance:t,defaultEmail:r,setStep:a,setError:i,loginMethods:c}=P(),[n,x]=ct(r!=null?r:""),[l,y]=ct(""),[g,p]=ct(!1),d=n.toLowerCase().includes("@gmail.com")&&!n.toLowerCase().includes("+")&&ut(n)&&!g&&c.includes("google");function u(f){return w(this,null,function*(){f.preventDefault(),p(!0);try{let C=n.trim().toLowerCase(),W=yield e==null?void 0:e.sendEmailOtp(C);o({email:C,emailId:W.emailId}),a("otp")}catch(C){p(!1),i("Failed to send email. Please try again or contact support.")}})}return U(Qe,{children:mt(Ne,{children:[U(Ke,{appearance:t,children:"Email"}),mt(Ve,{role:"form",onSubmit:f=>{if(d){f.preventDefault();return}ut(n)?u(f):f.preventDefault()},noValidate:!0,children:[U(vt,{children:"Email"}),U(qe,{id:"emailInput",appearance:t,hasError:!!l,showGoogleButton:d,type:"email",placeholder:"your@email.com",value:n,onChange:f=>{x(f.target.value),y(""),i(null)},readOnly:g,"aria-describedby":"emailError"}),mt(Xe,{children:[l&&U(X,{customColor:(m=t==null?void 0:t.colors)==null?void 0:m.danger}),g&&U(_,{style:{color:(h=t==null?void 0:t.colors)==null?void 0:h.textSecondary,fill:(v=t==null?void 0:t.colors)==null?void 0:v.textPrimary}}),d?U(Xt,{emailInput:n,appearance:t}):!l&&!g?U(Je,{type:"submit",appearance:t,disabled:!ut(n)||g,children:"Submit"}):null]})]}),l&&U(Ye,{appearance:t,id:"emailError",children:l})]})})}import{jsx as Zt}from"react/jsx-runtime";function te(){let{step:o}=P(),[e,t]=Ze(null);return o==="otp"?Zt(Vt,{otpEmailData:e,setOtpEmailData:t}):o==="initial"?Zt(Yt,{setOtpEmailData:t}):null}import{jsx as pt}from"react/jsx-runtime";function ee(e){var o=q(e,[]);var n;let{step:t,appearance:r}=P(),{startOAuthLogin:a,activeOAuthProvider:i}=$(),c=i==="google";return t!=="initial"?null:pt(H,R(B({icon:pt(Y,{style:{height:"25px",width:"25px"}}),isLoading:c,appearance:r,onButtonClick:()=>a("google")},o),{children:pt("span",{style:{color:(n=r==null?void 0:r.colors)==null?void 0:n.textPrimary},children:"Sign in with Google"})}))}import{useEffect as dt,useMemo as to,useState as eo}from"react";import{useSignIn as oo,QRCode as ro}from"@farcaster/auth-kit";import z from"@emotion/styled";import{Fragment as fo,jsx as k,jsxs as rt}from"react/jsx-runtime";var no=z.div`
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-direction: column;
|
|
164
|
+
align-items: center;
|
|
165
|
+
gap: 16px;
|
|
166
|
+
`,io=z.div`
|
|
167
|
+
text-align: center;
|
|
168
|
+
`,ao=z.h3`
|
|
169
|
+
font-size: 18px;
|
|
170
|
+
font-weight: 600;
|
|
171
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textPrimary)||s["cm-text-primary"]}};
|
|
172
|
+
margin: 0 0 8px 0;
|
|
173
|
+
`,lo=z.p`
|
|
174
|
+
font-size: 16px;
|
|
175
|
+
font-weight: 400;
|
|
176
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||s["cm-text-secondary"]}};
|
|
177
|
+
margin: 0;
|
|
178
|
+
`,so=z.div`
|
|
179
|
+
background-color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.inputBackground)||s["cm-background-primary"]}};
|
|
180
|
+
aspect-ratio: 1;
|
|
181
|
+
border-radius: ${o=>{var e;return((e=o.appearance)==null?void 0:e.borderRadius)||"8px"}};
|
|
182
|
+
padding: 16px;
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
justify-content: center;
|
|
186
|
+
`,co=z.div`
|
|
187
|
+
min-height: 246px;
|
|
188
|
+
display: flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
justify-content: center;
|
|
191
|
+
`,uo=z.p`
|
|
192
|
+
font-size: 16px;
|
|
193
|
+
text-align: center;
|
|
194
|
+
font-weight: 400;
|
|
195
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||s["cm-text-secondary"]}};
|
|
196
|
+
margin: 0;
|
|
197
|
+
`,mo=z.a`
|
|
198
|
+
font-size: 16px;
|
|
199
|
+
font-weight: 400;
|
|
200
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textLink)||s["cm-accent"]}};
|
|
201
|
+
text-decoration: none;
|
|
202
|
+
|
|
203
|
+
&:hover {
|
|
204
|
+
text-decoration: underline;
|
|
205
|
+
}
|
|
206
|
+
`;function oe(){let{step:o,appearance:e,setStep:t,setError:r}=P();return o==="initial"?k(H,{icon:k(It,{style:{height:"25px",width:"25px"}}),appearance:e,onButtonClick:()=>{t("qrCode"),r(null)},children:"Sign in with Farcaster"}):o==="qrCode"?k(po,{}):null}function po(){var u,m,h,v;let{crossmintAuth:o}=F(),{appearance:e,setStep:t,setDialogOpen:r,setError:a}=P(),[i,c]=eo(null),n=to(()=>({onSuccess:f=>{c(f)}}),[]),{signIn:x,url:l,connect:y,signOut:g,isConnected:p}=oo(n),d=f=>w(this,null,function*(){a(null);try{let C=yield o==null?void 0:o.signInWithFarcaster(f);yield o==null?void 0:o.handleRefreshAuthMaterial(C),r(!1),t("initial")}catch(C){console.error("Error during Farcaster sign-in:",C),a("Failed to sign in with Farcaster")}});return dt(()=>{i!=null&&d(i)},[i]),dt(()=>{p&&x()},[p]),dt(()=>{y()},[]),rt("div",{children:[k(J,{onClick:()=>{g(),t("initial")},iconColor:(u=e==null?void 0:e.colors)==null?void 0:u.textPrimary,ringColor:(m=e==null?void 0:e.colors)==null?void 0:m.accent}),rt(no,{children:[rt(io,{children:[k(ao,{appearance:e,children:"Sign in with Farcaster"}),k(lo,{appearance:e,children:"Scan with your phone's camera to continue."})]}),k(so,{appearance:e,children:l!=null?k(ro,{uri:l,size:280}):k(co,{children:k(_,{style:{color:(h=e==null?void 0:e.colors)==null?void 0:h.textSecondary,fill:(v=e==null?void 0:e.colors)==null?void 0:v.textPrimary}})})}),l?rt(fo,{children:[k(uo,{appearance:e,children:"Alternatively, click on this link to open Warpcast."}),k(mo,{href:l,rel:"noopener noreferrer",target:"_blank",appearance:e,children:"Open Warpcast"})]}):k("div",{style:{height:"66px"}})]})]})}import{jsx as re}from"react/jsx-runtime";function ne(e){var o=q(e,[]);let{step:t,appearance:r}=P(),{startOAuthLogin:a,activeOAuthProvider:i}=$(),c=i==="twitter";return t!=="initial"?null:re(H,R(B({icon:re(Wt,{style:{height:"22px",width:"22px"}}),isLoading:c,appearance:r,onButtonClick:()=>a("twitter")},o),{children:"Sign in with X"}))}import{jsx as E,jsxs as V}from"react/jsx-runtime";var ho=ie.div`
|
|
207
|
+
position: relative;
|
|
208
|
+
padding: 40px 24px 30px 24px;
|
|
209
|
+
display: flex;
|
|
210
|
+
flex-direction: column;
|
|
211
|
+
gap: 10px;
|
|
212
|
+
-webkit-font-smoothing: antialiased;
|
|
213
|
+
animation: none;
|
|
214
|
+
|
|
215
|
+
@media (min-width: 480px) {
|
|
216
|
+
padding: 40px 40px 30px 40px;
|
|
217
|
+
}
|
|
218
|
+
`,xo=ie.div`
|
|
219
|
+
display: flex;
|
|
220
|
+
align-items: flex-start;
|
|
221
|
+
justify-content: flex-start;
|
|
222
|
+
border-radius: 8px;
|
|
223
|
+
padding: 8px;
|
|
224
|
+
gap: 8px;
|
|
225
|
+
margin-top: 34px;
|
|
226
|
+
background-color: ${o=>{var e,t,r;return new go((r=(t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.danger)!=null?r:s["cm-danger"]).alpha(.12).toString()}};
|
|
227
|
+
`;function ae({style:o}){var x,l,y,g,p,d,u,m,h,v;let{step:e,appearance:t,loginMethods:r,baseUrl:a,error:i,termsOfServiceText:c,authModalTitle:n}=P();return V(ho,{style:o,children:[i!=null?V(xo,{appearance:t,children:[E("div",{style:{minWidth:"20px"},children:E(X,{customColor:(l=(x=t==null?void 0:t.colors)==null?void 0:x.danger)!=null?l:s["cm-danger"]})}),E("p",{style:{fontSize:"14px",margin:0,color:(g=(y=t==null?void 0:t.colors)==null?void 0:y.danger)!=null?g:s["cm-danger"]},children:i})]}):null,e==="initial"?V("div",{children:[E(yt,{appearance:t,children:n!=null?n:"Sign in to Crossmint"}),E(Ct,{appearance:t,children:"Access using one of the options below."})]}):null,r.includes("google")?E(ee,{}):null,r.includes("farcaster")?E(Ft,{baseUrl:a,children:E(oe,{})}):null,r.includes("twitter")?E(ne,{}):null,r.some(f=>f.startsWith("web3"))?E(Tt,{}):null,r.includes("email")?V("div",{children:[r.length>1?E(kt,{appearance:t,text:"OR"}):null,E(te,{})]}):null,e==="initial"&&c!=null?V("div",{style:{fontSize:"0.875rem",textAlign:"center",marginTop:"0.5rem",color:(d=(p=t==null?void 0:t.colors)==null?void 0:p.textSecondary)!=null?d:s["cm-text-secondary"]},children:[E("style",{children:`
|
|
228
|
+
p a {
|
|
229
|
+
color: ${(m=(u=t==null?void 0:t.colors)==null?void 0:u.textLink)!=null?m:s["cm-link"]};
|
|
230
|
+
}
|
|
231
|
+
`}),c]}):null,e==="initial"||e==="otp"?E(Et,{style:{marginTop:"1rem",justifyContent:"center"},color:(v=(h=t==null?void 0:t.colors)==null?void 0:h.textSecondary)!=null?v:s["cm-text-secondary"]}):null]})}import{jsx as le}from"react/jsx-runtime";function ot({open:o}){let{appearance:e,setDialogOpen:t}=P();return le(xt,{open:o,setDialogOpen:t,appearance:e,children:le(ae,{style:{maxWidth:"448px",padding:"0px"}})})}export{ot as a,Ut as b,$ as c,Mt as d,Ht as e,at as f,tr as g,F as h,Dt as i,hr as j,xr as k,Vt as l,Xt as m,Yt as n,te as o,ee as p,oe as q,ne as r,ae as s};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkN2FP2XTIcjs = require('./chunk-N2FP2XTI.cjs');var _chunkOVJIGWD7cjs = require('./chunk-OVJIGWD7.cjs');var _chunkO3H2EYFAcjs = require('./chunk-O3H2EYFA.cjs');var _chunkYGN7O63Xcjs = require('./chunk-YGN7O63X.cjs');var _chunkEDALAJ5Icjs = require('./chunk-EDALAJ5I.cjs');var _jsxruntime = require('react/jsx-runtime');function B({phone:i,open:r,setOpen:v,step:s,onSubmitOTP:D,onResendOTPCode:h,onSubmitPhone:y,rejectRef:n,appearance:o}){var m,c;function l(O){var g;(r||O)&&((g=n.current)==null||g.call(n,new Error),v(!1))}return _jsxruntime.jsxs.call(void 0, _chunkO3H2EYFAcjs.a,{open:r,setDialogOpen:l,appearance:o,style:{overflow:"hidden"},children:[s==="initial"?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkO3H2EYFAcjs.b,{appearance:o,children:"Confirm it's you"}),_jsxruntime.jsx.call(void 0, _chunkO3H2EYFAcjs.c,{appearance:o,children:"You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code via SMS."})]}):null,s==="otp"?_jsxruntime.jsx.call(void 0, _chunkN2FP2XTIcjs.a,{contactInfo:i!=null?i:"",contactType:"phone",icon:_jsxruntime.jsx.call(void 0, _chunkYGN7O63Xcjs.a,{customAccentColor:(m=o==null?void 0:o.colors)==null?void 0:m.accent,customBackgroundColor:(c=o==null?void 0:o.colors)==null?void 0:c.background}),title:"Check your phone",description:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:["A temporary login code has been sent via SMS to ",_jsxruntime.jsx.call(void 0, "strong",{children:i})]}),helpText:`Can't receive the SMS? Check your phone number.
|
|
2
2
|
Some messages may take several minutes to arrive.`,onSubmitOTP:D,onResendCode:h,appearance:o}):_jsxruntime.jsx.call(void 0, _chunkOVJIGWD7cjs.a,{contactInfo:i!=null?i:"",icon:_jsxruntime.jsx.call(void 0, _chunkEDALAJ5Icjs.a,{}),onConfirm:y,onCancel:l,appearance:o})]})}exports.a = B;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZMGWLGIGcjs = require('./chunk-ZMGWLGIG.cjs');var _jsxruntime = require('react/jsx-runtime');function m(){return _jsxruntime.jsx.call(void 0, _chunkZMGWLGIGcjs.s,{style:{width:"100%"}})}exports.a = m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkERHYDCKRcjs = require('./chunk-ERHYDCKR.cjs');var _clientsdkbase = require('@crossmint/client-sdk-base');var _jsxruntime = require('react/jsx-runtime');function m(o){_clientsdkbase.assertValidNFTCollectionViewProps.call(void 0, o);let i=_clientsdkbase.getNFTCollectionViewSrc.call(void 0, o,_chunkERHYDCKRcjs.a);return _jsxruntime.jsx.call(void 0, "iframe",{src:i,width:"100%",height:"100%",style:{flexGrow:"1",border:"none",margin:"0",padding:"0"},role:"nft-collection-view"})}exports.a = m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkI4UE7ZH5cjs = require('./chunk-I4UE7ZH5.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _jsxruntime = require('react/jsx-runtime');function s(d){return _jsxruntime.jsx.call(void 0, _chunkI4UE7ZH5cjs.a,_chunk2WSEHVNPcjs.a.call(void 0, {},d))}exports.a = s;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as p}from"./chunk-
|
|
1
|
+
import{a as p}from"./chunk-2F3UEXTE.js";import{a as u}from"./chunk-HHI2XRKR.js";import{a as l}from"./chunk-23YVHBPI.js";import{a as s}from"./chunk-NZUCXN2O.js";import{a as n}from"./chunk-DFSB3TWF.js";import{a as m}from"./chunk-H3CPTTQQ.js";import i from"@emotion/styled";import{jsx as r,jsxs as y}from"react/jsx-runtime";var f=i.button`
|
|
2
2
|
${s}
|
|
3
3
|
|
|
4
4
|
/* Base button styles */
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkNXEC4PEDcjs = require('./chunk-NXEC4PED.cjs');var _chunkPZ3KXKJDcjs = require('./chunk-PZ3KXKJD.cjs');var _chunkBR77Q3PKcjs = require('./chunk-BR77Q3PK.cjs');var _chunk6O6IJTQDcjs = require('./chunk-6O6IJTQD.cjs');var _chunkXBXL7GMYcjs = require('./chunk-XBXL7GMY.cjs');var _chunkCD6E2BGDcjs = require('./chunk-CD6E2BGD.cjs');var _chunkKSUMPQNDcjs = require('./chunk-KSUMPQND.cjs');var _chunkS5QCH2EDcjs = require('./chunk-S5QCH2ED.cjs');var _chunkHNUI5756cjs = require('./chunk-HNUI5756.cjs');var _chunkUMWTEGO6cjs = require('./chunk-UMWTEGO6.cjs');var _chunkS4BKL6MRcjs = require('./chunk-S4BKL6MR.cjs');var _chunkAHMPKIEYcjs = require('./chunk-AHMPKIEY.cjs');var _chunkSCHRLC2Icjs = require('./chunk-SCHRLC2I.cjs');var _chunkDJZOP4MTcjs = require('./chunk-DJZOP4MT.cjs');var _chunkO3H2EYFAcjs = require('./chunk-O3H2EYFA.cjs');var _chunk3X24JZVGcjs = require('./chunk-3X24JZVG.cjs');var _chunkEAWYV5ZOcjs = require('./chunk-EAWYV5ZO.cjs');var _chunkW5RDCN5Gcjs = require('./chunk-W5RDCN5G.cjs');var _chunkVXAHFAP4cjs = require('./chunk-VXAHFAP4.cjs');var _chunkNRN4WNQLcjs = require('./chunk-NRN4WNQL.cjs');var _chunkI4GMMHQRcjs = require('./chunk-I4GMMHQR.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _color = require('color'); var _color2 = _interopRequireDefault(_color);var _styled = require('@emotion/styled'); var _styled2 = _interopRequireDefault(_styled);var _react = require('react');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _commonsdkbase = require('@crossmint/common-sdk-base');var _clientsdkwindow = require('@crossmint/client-sdk-window');var _zod = require('zod');var Tt=(o,e)=>{let{crossmintAuth:t}=I(),[r,a]=_react.useState.call(void 0, null),i=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>(i.current==null&&(i.current=new (0, _clientsdkwindow.ChildWindow)(window.opener||window.parent,"*",{incomingEvents:fe})),()=>{i.current!=null&&i.current.off("authMaterialFromPopupCallback")}),[]),{createPopupAndSetupListeners:_react.useCallback.call(void 0, (n,x)=>_chunk2WSEHVNPcjs.d.call(void 0, void 0,null,function*(){if(i.current==null)throw new Error("Child window not initialized");a(n),e(null),console.log("createPopupAndSetupListeners",n,x),console.log("oauthUrlMap",o),console.log("oauthUrlMap[provider]",o[n]);let l=new URL(o[n]);if(x!=null){let u=Array.from(l.searchParams.entries());l.search="",x&&l.searchParams.append("provider_login_hint",x),u.forEach(([m,h])=>{l.searchParams.append(m,h)})}let y=yield _clientsdkwindow.PopupWindow.init(l.toString(),{awaitToLoad:!1,crossOrigin:!0,width:400,height:700}),g=u=>_chunk2WSEHVNPcjs.d.call(void 0, void 0,null,function*(){var m,h;yield t==null?void 0:t.handleRefreshAuthMaterial(u.oneTimeSecret),(m=i.current)==null||m.off("authMaterialFromPopupCallback"),(h=y.window)==null||h.close(),a(null)}),p=u=>{var m,h;e(u.error),(m=i.current)==null||m.off("errorFromPopupCallback"),(h=y.window)==null||h.close(),a(null)};i.current.on("authMaterialFromPopupCallback",g),i.current.on("errorFromPopupCallback",p);let d=setInterval(()=>{var u,m;(u=y.window)!=null&&u.closed&&(clearInterval(d),a(null),(m=i.current)==null||m.off("authMaterialFromPopupCallback"))},2500)}),[o,t,e]),isLoading:r!=null,activeOAuthProvider:r}},fe={authMaterialFromPopupCallback:_zod.z.object({oneTimeSecret:_zod.z.string()}),errorFromPopupCallback:_zod.z.object({error:_zod.z.string()})};var _jsxruntime = require('react/jsx-runtime');var Bt={google:"",twitter:""},Rt=_react.createContext.call(void 0, void 0);function R(){let o=_react.useContext.call(void 0, Rt);if(!o)throw new Error("useOAuthFlow must be used within an OAuthFlowProvider");return o}function $t({children:o,prefetchOAuthUrls:e}){let{crossmintAuth:t,loginMethods:r}=Mt(),{setError:a}=_chunkHNUI5756cjs.a.call(void 0, ),[i,c]=_react.useState.call(void 0, Bt),[n,x]=_react.useState.call(void 0, !0),{createPopupAndSetupListeners:l,isLoading:y,activeOAuthProvider:g}=Tt(i,a),p=_react.useCallback.call(void 0, ()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){x(!0);try{let h=(r||[]).filter(f=>f in Bt).map(f=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){let C=yield t==null?void 0:t.getOAuthUrl(f);return{[f]:C}})),v=Object.assign({},...yield Promise.all(h));c(v)}catch(m){a(m instanceof Error?m.message:"Unable to load oauth providers. Please try again later.")}finally{x(!1)}}),[r,t,a]);_react.useEffect.call(void 0, ()=>{e&&p()},[p,e]);let u={startOAuthLogin:_react.useCallback.call(void 0, (m,h)=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){yield l(m,h)}),[l]),isLoading:n||y,activeOAuthProvider:g};return _jsxruntime.jsx.call(void 0, Rt.Provider,{value:u,children:o})}var _sdkreactcore = require('@dynamic-labs/sdk-react-core');var _ethereum = require('@dynamic-labs/ethereum');var _solana = require('@dynamic-labs/solana');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);function Pe({children:o,enabled:e,onSdkLoaded:t,onWalletConnected:r,jwt:a}){let{primaryWallet:i,sdkHasLoaded:c,removeWallet:n,handleUnlinkWallet:x}=_sdkreactcore.useDynamicContext.call(void 0, ),l=!e||c;return _react.useEffect.call(void 0, ()=>{l&&(t==null||t(l))},[l,t]),_react.useEffect.call(void 0, ()=>{a==null&&l&&i!=null&&(n(i.id),x(i.id))},[a,l,i,n,x]),_react.useEffect.call(void 0, ()=>{function y(){return _chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){try{if(_ethereum.isEthereumWallet.call(void 0, i)){let g=yield i.getWalletClient(),p={type:"external-wallet",address:g.account.address,viemAccount:_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {},g.account),{signMessage:d=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){return yield g.signMessage({message:d.message})})})};r(p)}else if(_solana.isSolanaWallet.call(void 0, i)){let g=yield i.getSigner(),p={type:"external-wallet",address:i.address,onSignTransaction:d=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){return yield g.signTransaction(d)})};r(p)}else throw new Error("Unsupported wallet type")}catch(g){throw console.error("Failed to get admin signer",g),new Error("Failed to get admin signer")}})}i!=null&&a!=null&&y()},[i,a,r]),o}function _t({children:o,enabled:e=!0,apiKeyEnvironment:t,loginMethods:r=["web3"],appearance:a,onSdkLoaded:i,onWalletConnected:c}){var g,p;let{crossmintAuth:n,jwt:x}=I(),l=_react.useMemo.call(void 0, ()=>{var d,u;return`.powered-by-dynamic { display: none !important; }
|
|
2
|
+
.wallet-list__scroll-container { padding: 0px !important; }
|
|
3
|
+
.wallet-list__search-container { padding-left: 0px !important; padding-right: 0px !important; }
|
|
4
|
+
.dynamic-footer { display: none !important; }
|
|
5
|
+
h1 { color: ${(d=a==null?void 0:a.colors)==null?void 0:d.textPrimary} !important; }
|
|
6
|
+
* { color: ${(u=a==null?void 0:a.colors)==null?void 0:u.textSecondary} !important; }`},[(g=a==null?void 0:a.colors)==null?void 0:g.textPrimary,(p=a==null?void 0:a.colors)==null?void 0:p.textSecondary]),y=_react.useMemo.call(void 0, ()=>{if(e)return r.includes("web3:evm-only")?[_ethereum.EthereumWalletConnectors]:r.includes("web3:solana-only")?[_solana.SolanaWalletConnectors]:[_ethereum.EthereumWalletConnectors,_solana.SolanaWalletConnectors]},[e,r]);return _jsxruntime.jsx.call(void 0, _chunkKSUMPQNDcjs.a,{apiKeyEnvironment:t,settings:{walletConnectors:y,cssOverrides:l,events:{onAuthFailure(d,u){console.error("[DynamicWalletProvider] onAuthFailure",d,u)}},handlers:{handleConnectedWallet:d=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){var m;if(!n)return console.error("[DynamicWalletProvider] crossmintAuth is not available"),!1;let u=d.address;if(u==null)return console.error("[DynamicWalletProvider] handleConnectedWallet: address is missing"),!1;try{let v=(yield _chunkPZ3KXKJDcjs.b.call(void 0, d))==="solana"?"solana":"evm",f=yield n.signInWithSmartWallet(u,v);if((f==null?void 0:f.challenge)==null)throw new Error("No challenge received from signInWithSmartWallet");let C=yield(m=d.connector)==null?void 0:m.proveOwnership(u,f.challenge);if(C==null)throw new Error("Failed to get signature from wallet");let F=C;if(v==="solana"){let U=Buffer.from(C,"base64");F=_bs582.default.encode(U)}let A=yield n.authenticateSmartWallet(u,v,F);if((A==null?void 0:A.oneTimeSecret)==null)throw new Error("No oneTimeSecret received from authenticateSmartWallet");return yield n.handleRefreshAuthMaterial(A.oneTimeSecret),!0}catch(h){return console.error("[DynamicWalletProvider] Error handling wallet connection:",h),!1}})}},children:_jsxruntime.jsx.call(void 0, Pe,{enabled:e,onSdkLoaded:i,onWalletConnected:c,jwt:x,children:o})},`${t}-${r.join(",")}`)}var Fe={crossmintAuth:void 0,login:()=>{},logout:()=>{},jwt:void 0,user:void 0,status:"initializing",getUser:()=>{},experimental_externalWalletSigner:void 0,experimental_loginWithOAuth:()=>Promise.resolve(),loginMethods:[]},it= exports.f =_react.createContext.call(void 0, Fe);function We({children:o,appearance:e,termsOfServiceText:t,prefetchOAuthUrls:r=!0,authModalTitle:a,onLoginSuccess:i,loginMethods:c=["email","google"]}){let n=_clientsdkreactbase.useCrossmintAuthBase.call(void 0, ),{crossmint:x,experimental_setCustomAuth:l,experimental_customAuth:y}=_clientsdkreactbase.useCrossmint.call(void 0, "CrossmintAuthProvider must be used within CrossmintProvider"),g=_commonsdkbase.validateApiKeyAndGetCrossmintBaseUrl.call(void 0, x.apiKey),[p,d]=_react.useState.call(void 0, !1),[u,m]=_react.useState.call(void 0, void 0),[h,v]=_react.useState.call(void 0, !0),f=c.some(k=>k.startsWith("web3")),[C,F]=_react.useState.call(void 0, void 0),A=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{var k,j;n.jwt==null&&(y==null?void 0:y.jwt)!=null&&l(void 0),C!=null||((k=n.user)==null?void 0:k.email)!=null?l({jwt:n.jwt,email:(j=n.user)==null?void 0:j.email,externalWalletSigner:C}):l({jwt:n.jwt})},[C,n.jwt,n.user,l,y]),_react.useEffect.call(void 0, ()=>{n.jwt!=null&&p&&d(!1)},[n.jwt,p]);let U=_react.useCallback.call(void 0, k=>{if(n.jwt!=null){console.log("User already logged in");return}k!=null&&typeof k=="string"&&m(k),d(!0)},[n.jwt]),z=_react.useCallback.call(void 0, ()=>n.status==="initializing"||f&&!h?"initializing":n.jwt!=null?"logged-in":p?"in-progress":"logged-out",[n.status,n.jwt,f,h,p]),dt=_react.useCallback.call(void 0, k=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){var j;if(n.jwt!=null){console.log("User already logged in");return}yield(j=A.current)==null?void 0:j.call(A,k)}),[n.jwt]),le=_react.useMemo.call(void 0, ()=>_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {},n),{login:U,status:z(),experimental_externalWalletSigner:C,experimental_loginWithOAuth:dt,loginMethods:c}),[n,U,z,C,dt,c]);return _jsxruntime.jsx.call(void 0, it.Provider,{value:le,children:_jsxruntime.jsx.call(void 0, _chunkHNUI5756cjs.b,{setDialogOpen:(k,j)=>{d(k),j&&(i==null||i())},initialState:{appearance:e,loginMethods:c,termsOfServiceText:t,authModalTitle:a,baseUrl:g,defaultEmail:u},children:_jsxruntime.jsx.call(void 0, $t,{prefetchOAuthUrls:z()==="logged-out"&&r,children:_jsxruntime.jsx.call(void 0, Te,{loginWithOAuthRef:A,children:f?_jsxruntime.jsxs.call(void 0, _t,{apiKeyEnvironment:x.apiKey.includes("production")?"production":"staging",loginMethods:c,appearance:e,onSdkLoaded:v,onWalletConnected:F,children:[o,_jsxruntime.jsx.call(void 0, et,{open:p})]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[o,_jsxruntime.jsx.call(void 0, et,{open:p})]})})})})})}function Te({children:o,loginWithOAuthRef:e}){let{startOAuthLogin:t}=R(),r=_clientsdkreactbase.useCrossmintAuthBase.call(void 0, ),a=_react.useCallback.call(void 0, i=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){if(r.jwt!=null){console.log("User already logged in");return}yield t(i)}),[r.jwt,t]);return _react.useEffect.call(void 0, ()=>{e.current=a},[a,e]),_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:o})}function Zo({children:o,appearance:e,termsOfServiceText:t,prefetchOAuthUrls:r=!0,authModalTitle:a,onLoginSuccess:i,loginMethods:c=["email","google"],refreshRoute:n,logoutRoute:x}){return _jsxruntime.jsx.call(void 0, _clientsdkreactbase.CrossmintAuthBaseProvider,{onLoginSuccess:i,refreshRoute:n,logoutRoute:x,children:_jsxruntime.jsx.call(void 0, We,{onLoginSuccess:i,appearance:e,termsOfServiceText:t,prefetchOAuthUrls:r,authModalTitle:a,loginMethods:c,children:o})})}function I(){let o=_react.useContext.call(void 0, it);if(o==null)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return o}var Mt=I;var Le=_styled2.default.div`
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
`,Be=_styled2.default.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: flex-start;
|
|
14
|
+
width: 100%;
|
|
15
|
+
`,Re=_styled2.default.div`
|
|
16
|
+
position: relative;
|
|
17
|
+
left: 12px;
|
|
18
|
+
`,$e=_styled2.default.p`
|
|
19
|
+
font-size: 16px;
|
|
20
|
+
font-weight: 400;
|
|
21
|
+
margin: 16px 0 4px 0;
|
|
22
|
+
text-align: center;
|
|
23
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textPrimary)||_chunkEAWYV5ZOcjs.a["cm-text-primary"]}};
|
|
24
|
+
`,Me=_styled2.default.p`
|
|
25
|
+
text-align: center;
|
|
26
|
+
padding: 0 16px;
|
|
27
|
+
margin: 0;
|
|
28
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||_chunkEAWYV5ZOcjs.a["cm-text-secondary"]}};
|
|
29
|
+
font-size: 14px;
|
|
30
|
+
line-height: 1.4;
|
|
31
|
+
`,De=_styled2.default.div`
|
|
32
|
+
padding: 32px 0;
|
|
33
|
+
`,H=_styled2.default.call(void 0, _chunkXBXL7GMYcjs.c)`
|
|
34
|
+
@media (max-width: 379px) {
|
|
35
|
+
width: 40px;
|
|
36
|
+
height: 56px;
|
|
37
|
+
font-size: 28px;
|
|
38
|
+
margin: 0;
|
|
39
|
+
}
|
|
40
|
+
`,ze=_styled2.default.div`
|
|
41
|
+
font-size: 12px;
|
|
42
|
+
line-height: 1.3;
|
|
43
|
+
text-align: center;
|
|
44
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||_chunkEAWYV5ZOcjs.a["cm-text-secondary"]}};
|
|
45
|
+
`;function Kt({otpEmailData:o,setOtpEmailData:e}){var h,v,f,C,F;let{crossmintAuth:t}=I(),{appearance:r,setDialogOpen:a,setStep:i,setError:c}=_chunkHNUI5756cjs.a.call(void 0, ),[n,x]=_react.useState.call(void 0, ""),[l,y]=_react.useState.call(void 0, !1),[g,p]=_react.useState.call(void 0, !1),d=()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){var A,U;p(!0);try{let z=yield t==null?void 0:t.confirmEmailOtp((A=o==null?void 0:o.email)!=null?A:"",(U=o==null?void 0:o.emailId)!=null?U:"",n);yield t==null?void 0:t.handleRefreshAuthMaterial(z),a(!1,!0),i("initial")}catch(z){console.error("Error confirming email OTP",z),c("Invalid code. Please try again."),y(!0)}finally{p(!1)}}),u=()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){var A;try{yield t==null?void 0:t.sendEmailOtp((A=o==null?void 0:o.email)!=null?A:"")}catch(U){c("Failed to resend code. Please try again.")}});return _jsxruntime.jsxs.call(void 0, Le,{children:[_jsxruntime.jsx.call(void 0, _chunkS5QCH2EDcjs.a,{onClick:()=>{i("initial"),e(null)},iconColor:(h=r==null?void 0:r.colors)==null?void 0:h.textPrimary,ringColor:(v=r==null?void 0:r.colors)==null?void 0:v.accent}),_jsxruntime.jsxs.call(void 0, Be,{children:[_jsxruntime.jsx.call(void 0, Re,{children:_jsxruntime.jsx.call(void 0, _chunkI4GMMHQRcjs.a,{customAccentColor:(f=r==null?void 0:r.colors)==null?void 0:f.accent,customButtonBackgroundColor:(C=r==null?void 0:r.colors)==null?void 0:C.buttonBackground,customBackgroundColor:(F=r==null?void 0:r.colors)==null?void 0:F.background})}),_jsxruntime.jsx.call(void 0, $e,{appearance:r,children:"Check your email"}),_jsxruntime.jsxs.call(void 0, Me,{appearance:r,children:["A temporary login code has been sent to",_jsxruntime.jsx.call(void 0, "br",{}),o!=null&&o.email?_jsxruntime.jsx.call(void 0, "strong",{children:o.email}):"your email address"]}),_jsxruntime.jsx.call(void 0, De,{children:_jsxruntime.jsx.call(void 0, _chunkXBXL7GMYcjs.a,{maxLength:6,value:n,onChange:A=>{x(A),y(!1),c(null)},onComplete:d,disabled:g,appearance:r,children:_jsxruntime.jsxs.call(void 0, _chunkXBXL7GMYcjs.b,{children:[_jsxruntime.jsx.call(void 0, H,{index:0,hasError:l}),_jsxruntime.jsx.call(void 0, H,{index:1,hasError:l}),_jsxruntime.jsx.call(void 0, H,{index:2,hasError:l}),_jsxruntime.jsx.call(void 0, H,{index:3,hasError:l}),_jsxruntime.jsx.call(void 0, H,{index:4,hasError:l}),_jsxruntime.jsx.call(void 0, H,{index:5,hasError:l})]})})}),_jsxruntime.jsxs.call(void 0, ze,{appearance:r,children:["Can't find the email? Check spam folder.",_jsxruntime.jsx.call(void 0, "br",{}),"Some emails may take several minutes to arrive."]}),_jsxruntime.jsx.call(void 0, _chunkDJZOP4MTcjs.a,{initialSeconds:60,appearance:r,countdownText:A=>`Re-send code in ${A}s`,countdownCompleteText:"Re-send code",handleOnClick:u})]})]})}var _commonsdkauth = require('@crossmint/common-sdk-auth');var je=_styled2.default.button`
|
|
46
|
+
${_chunk3X24JZVGcjs.a}
|
|
47
|
+
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
gap: 8px;
|
|
52
|
+
height: 32px;
|
|
53
|
+
padding: 0 10px;
|
|
54
|
+
border: 1px solid ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.border)||_chunkEAWYV5ZOcjs.a["cm-border"]}};
|
|
55
|
+
border-radius: ${o=>{var e;return((e=o.appearance)==null?void 0:e.borderRadius)||"12px"}};
|
|
56
|
+
background-color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.buttonBackground)||_chunkEAWYV5ZOcjs.a["cm-background-primary"]}};
|
|
57
|
+
cursor: ${o=>o.isLoading?"not-allowed":"pointer"};
|
|
58
|
+
|
|
59
|
+
/* Hover and focus states */
|
|
60
|
+
&:hover {
|
|
61
|
+
background-color: ${o=>o.isLoading?_chunkEAWYV5ZOcjs.a["cm-muted-primary"]:_chunkEAWYV5ZOcjs.a["cm-hover"]};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:focus {
|
|
65
|
+
outline: none;
|
|
66
|
+
background-color: theme["cm-hover"];
|
|
67
|
+
}
|
|
68
|
+
`,Ge=_styled2.default.span`
|
|
69
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||_chunkEAWYV5ZOcjs.a["cm-accent"]}};
|
|
70
|
+
font-size: 14px;
|
|
71
|
+
font-weight: 400;
|
|
72
|
+
`;function qt({emailInput:o,appearance:e}){var i,c;let{startOAuthLogin:t,activeOAuthProvider:r}=R(),a=r==="google";return _jsxruntime.jsxs.call(void 0, je,{type:"button",appearance:e,isLoading:a,onClick:a?void 0:()=>t("google",o.trim().toLowerCase()),children:[_jsxruntime.jsx.call(void 0, _chunkVXAHFAP4cjs.a,{style:{height:"18px",width:"18px"}}),a?_jsxruntime.jsx.call(void 0, _chunkAHMPKIEYcjs.a,{style:{color:(i=e==null?void 0:e.colors)==null?void 0:i.textSecondary,fill:(c=e==null?void 0:e.colors)==null?void 0:c.textPrimary,width:"18px",height:"18px"}}):_jsxruntime.jsx.call(void 0, Ge,{appearance:e,children:"Continue"})]})}var He=_styled2.default.div`
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
align-items: flex-start;
|
|
76
|
+
justify-content: flex-start;
|
|
77
|
+
width: 100%;
|
|
78
|
+
border-radius: 8px;
|
|
79
|
+
`,Qe=_styled2.default.div`
|
|
80
|
+
width: 100%;
|
|
81
|
+
`,Ne=_styled2.default.label`
|
|
82
|
+
display: block;
|
|
83
|
+
margin-bottom: 5px;
|
|
84
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textPrimary)||_chunkEAWYV5ZOcjs.a["cm-text-primary"]}};
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
font-weight: 400;
|
|
87
|
+
`,Ke=_styled2.default.form`
|
|
88
|
+
position: relative;
|
|
89
|
+
`,Ve=_styled2.default.input`
|
|
90
|
+
${_chunk3X24JZVGcjs.a}
|
|
91
|
+
|
|
92
|
+
/* Base input styles */
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-grow: 1;
|
|
95
|
+
text-align: left;
|
|
96
|
+
padding-left: 16px;
|
|
97
|
+
padding-right: ${o=>o.showGoogleButton?"132px":"80px"};
|
|
98
|
+
height: 58px;
|
|
99
|
+
width: 100%;
|
|
100
|
+
border: 1px solid;
|
|
101
|
+
border-color: ${o=>{var e,t,r,a;return o.hasError?((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.danger)||_chunkEAWYV5ZOcjs.a["cm-danger"]:((a=(r=o.appearance)==null?void 0:r.colors)==null?void 0:a.border)||_chunkEAWYV5ZOcjs.a["cm-border"]}};
|
|
102
|
+
border-radius: ${o=>{var e;return((e=o.appearance)==null?void 0:e.borderRadius)||"12px"}};
|
|
103
|
+
background-color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.inputBackground)||_chunkEAWYV5ZOcjs.a["cm-background-primary"]}};
|
|
104
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textPrimary)||_chunkEAWYV5ZOcjs.a["cm-text-primary"]}};
|
|
105
|
+
font-size: 16px;
|
|
106
|
+
transition: border-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
|
|
107
|
+
|
|
108
|
+
&::placeholder {
|
|
109
|
+
font-weight: 400;
|
|
110
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||_chunkEAWYV5ZOcjs.a["cm-text-secondary"]}};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&:focus {
|
|
114
|
+
outline: none;
|
|
115
|
+
box-shadow: 0 0 0 2px ${o=>{var e,t;return new (0, _color2.default)(((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||_chunkEAWYV5ZOcjs.a["cm-accent"]).alpha(.18).toString()}};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&:read-only {
|
|
119
|
+
cursor: not-allowed;
|
|
120
|
+
opacity: 0.7;
|
|
121
|
+
}
|
|
122
|
+
`,qe=_styled2.default.div`
|
|
123
|
+
position: absolute;
|
|
124
|
+
right: 0;
|
|
125
|
+
top: 0;
|
|
126
|
+
bottom: 0;
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
padding-right: 16px;
|
|
130
|
+
aspect-ratio: 1/1;
|
|
131
|
+
`,Xe=_styled2.default.button`
|
|
132
|
+
${_chunk3X24JZVGcjs.a}
|
|
133
|
+
|
|
134
|
+
font-weight: 500;
|
|
135
|
+
white-space: nowrap;
|
|
136
|
+
background-color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.inputBackground)||_chunkEAWYV5ZOcjs.a["cm-background-primary"]}};
|
|
137
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||_chunkEAWYV5ZOcjs.a["cm-accent"]}};
|
|
138
|
+
cursor: ${o=>o.disabled?"not-allowed":"pointer"};
|
|
139
|
+
opacity: ${o=>o.disabled?.6:1};
|
|
140
|
+
border: none;
|
|
141
|
+
padding: 8px 12px;
|
|
142
|
+
border-radius: 6px;
|
|
143
|
+
transition: opacity 200ms ease;
|
|
144
|
+
|
|
145
|
+
&:hover:not(:disabled) {
|
|
146
|
+
opacity: 0.8;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&:focus-visible {
|
|
150
|
+
outline: 2px solid ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||_chunkEAWYV5ZOcjs.a["cm-accent"]}};
|
|
151
|
+
outline-offset: 2px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&:not(:disabled):focus-visible {
|
|
155
|
+
box-shadow: 0 0 0 2px ${o=>{var e,t;return new (0, _color2.default)(((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.accent)||_chunkEAWYV5ZOcjs.a["cm-accent"]).alpha(.18).toString()}};
|
|
156
|
+
}
|
|
157
|
+
`,Je=_styled2.default.p`
|
|
158
|
+
font-size: 12px;
|
|
159
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.danger)||_chunkEAWYV5ZOcjs.a["cm-danger"]}};
|
|
160
|
+
margin: 8px 0 8px 0;
|
|
161
|
+
`;function Jt({setOtpEmailData:o}){var m,h,v;let{crossmintAuth:e}=I(),{appearance:t,defaultEmail:r,setStep:a,setError:i,loginMethods:c}=_chunkHNUI5756cjs.a.call(void 0, ),[n,x]=_react.useState.call(void 0, r!=null?r:""),[l,y]=_react.useState.call(void 0, ""),[g,p]=_react.useState.call(void 0, !1),d=n.toLowerCase().includes("@gmail.com")&&!n.toLowerCase().includes("+")&&_commonsdkauth.isEmailValid.call(void 0, n)&&!g&&c.includes("google");function u(f){return _chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){f.preventDefault(),p(!0);try{let C=n.trim().toLowerCase(),F=yield e==null?void 0:e.sendEmailOtp(C);o({email:C,emailId:F.emailId}),a("otp")}catch(C){p(!1),i("Failed to send email. Please try again or contact support.")}})}return _jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsxs.call(void 0, Qe,{children:[_jsxruntime.jsx.call(void 0, Ne,{appearance:t,children:"Email"}),_jsxruntime.jsxs.call(void 0, Ke,{role:"form",onSubmit:f=>{if(d){f.preventDefault();return}_commonsdkauth.isEmailValid.call(void 0, n)?u(f):f.preventDefault()},noValidate:!0,children:[_jsxruntime.jsx.call(void 0, _chunkS4BKL6MRcjs.a,{children:"Email"}),_jsxruntime.jsx.call(void 0, Ve,{id:"emailInput",appearance:t,hasError:!!l,showGoogleButton:d,type:"email",placeholder:"your@email.com",value:n,onChange:f=>{x(f.target.value),y(""),i(null)},readOnly:g,"aria-describedby":"emailError"}),_jsxruntime.jsxs.call(void 0, qe,{children:[l&&_jsxruntime.jsx.call(void 0, _chunkNRN4WNQLcjs.a,{customColor:(m=t==null?void 0:t.colors)==null?void 0:m.danger}),g&&_jsxruntime.jsx.call(void 0, _chunkAHMPKIEYcjs.a,{style:{color:(h=t==null?void 0:t.colors)==null?void 0:h.textSecondary,fill:(v=t==null?void 0:t.colors)==null?void 0:v.textPrimary}}),d?_jsxruntime.jsx.call(void 0, qt,{emailInput:n,appearance:t}):!l&&!g?_jsxruntime.jsx.call(void 0, Xe,{type:"submit",appearance:t,disabled:!_commonsdkauth.isEmailValid.call(void 0, n)||g,children:"Submit"}):null]})]}),l&&_jsxruntime.jsx.call(void 0, Je,{appearance:t,id:"emailError",children:l})]})})}function Zt(){let{step:o}=_chunkHNUI5756cjs.a.call(void 0, ),[e,t]=_react.useState.call(void 0, null);return o==="otp"?_jsxruntime.jsx.call(void 0, Kt,{otpEmailData:e,setOtpEmailData:t}):o==="initial"?_jsxruntime.jsx.call(void 0, Jt,{setOtpEmailData:t}):null}function te(e){var o=_chunk2WSEHVNPcjs.c.call(void 0, e,[]);var n;let{step:t,appearance:r}=_chunkHNUI5756cjs.a.call(void 0, ),{startOAuthLogin:a,activeOAuthProvider:i}=R(),c=i==="google";return t!=="initial"?null:_jsxruntime.jsx.call(void 0, _chunkCD6E2BGDcjs.a,_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {icon:_jsxruntime.jsx.call(void 0, _chunkVXAHFAP4cjs.a,{style:{height:"25px",width:"25px"}}),isLoading:c,appearance:r,onButtonClick:()=>a("google")},o),{children:_jsxruntime.jsx.call(void 0, "span",{style:{color:(n=r==null?void 0:r.colors)==null?void 0:n.textPrimary},children:"Sign in with Google"})}))}var _authkit = require('@farcaster/auth-kit');var ro=_styled2.default.div`
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-direction: column;
|
|
164
|
+
align-items: center;
|
|
165
|
+
gap: 16px;
|
|
166
|
+
`,no=_styled2.default.div`
|
|
167
|
+
text-align: center;
|
|
168
|
+
`,io=_styled2.default.h3`
|
|
169
|
+
font-size: 18px;
|
|
170
|
+
font-weight: 600;
|
|
171
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textPrimary)||_chunkEAWYV5ZOcjs.a["cm-text-primary"]}};
|
|
172
|
+
margin: 0 0 8px 0;
|
|
173
|
+
`,ao=_styled2.default.p`
|
|
174
|
+
font-size: 16px;
|
|
175
|
+
font-weight: 400;
|
|
176
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||_chunkEAWYV5ZOcjs.a["cm-text-secondary"]}};
|
|
177
|
+
margin: 0;
|
|
178
|
+
`,lo=_styled2.default.div`
|
|
179
|
+
background-color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.inputBackground)||_chunkEAWYV5ZOcjs.a["cm-background-primary"]}};
|
|
180
|
+
aspect-ratio: 1;
|
|
181
|
+
border-radius: ${o=>{var e;return((e=o.appearance)==null?void 0:e.borderRadius)||"8px"}};
|
|
182
|
+
padding: 16px;
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
justify-content: center;
|
|
186
|
+
`,so=_styled2.default.div`
|
|
187
|
+
min-height: 246px;
|
|
188
|
+
display: flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
justify-content: center;
|
|
191
|
+
`,co=_styled2.default.p`
|
|
192
|
+
font-size: 16px;
|
|
193
|
+
text-align: center;
|
|
194
|
+
font-weight: 400;
|
|
195
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textSecondary)||_chunkEAWYV5ZOcjs.a["cm-text-secondary"]}};
|
|
196
|
+
margin: 0;
|
|
197
|
+
`,uo=_styled2.default.a`
|
|
198
|
+
font-size: 16px;
|
|
199
|
+
font-weight: 400;
|
|
200
|
+
color: ${o=>{var e,t;return((t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.textLink)||_chunkEAWYV5ZOcjs.a["cm-accent"]}};
|
|
201
|
+
text-decoration: none;
|
|
202
|
+
|
|
203
|
+
&:hover {
|
|
204
|
+
text-decoration: underline;
|
|
205
|
+
}
|
|
206
|
+
`;function ee(){let{step:o,appearance:e,setStep:t,setError:r}=_chunkHNUI5756cjs.a.call(void 0, );return o==="initial"?_jsxruntime.jsx.call(void 0, _chunkCD6E2BGDcjs.a,{icon:_jsxruntime.jsx.call(void 0, _chunkW5RDCN5Gcjs.a,{style:{height:"25px",width:"25px"}}),appearance:e,onButtonClick:()=>{t("qrCode"),r(null)},children:"Sign in with Farcaster"}):o==="qrCode"?_jsxruntime.jsx.call(void 0, mo,{}):null}function mo(){var u,m,h,v;let{crossmintAuth:o}=I(),{appearance:e,setStep:t,setDialogOpen:r,setError:a}=_chunkHNUI5756cjs.a.call(void 0, ),[i,c]=_react.useState.call(void 0, null),n=_react.useMemo.call(void 0, ()=>({onSuccess:f=>{c(f)}}),[]),{signIn:x,url:l,connect:y,signOut:g,isConnected:p}=_authkit.useSignIn.call(void 0, n),d=f=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){a(null);try{let C=yield o==null?void 0:o.signInWithFarcaster(f);yield o==null?void 0:o.handleRefreshAuthMaterial(C),r(!1),t("initial")}catch(C){console.error("Error during Farcaster sign-in:",C),a("Failed to sign in with Farcaster")}});return _react.useEffect.call(void 0, ()=>{i!=null&&d(i)},[i]),_react.useEffect.call(void 0, ()=>{p&&x()},[p]),_react.useEffect.call(void 0, ()=>{y()},[]),_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, _chunkS5QCH2EDcjs.a,{onClick:()=>{g(),t("initial")},iconColor:(u=e==null?void 0:e.colors)==null?void 0:u.textPrimary,ringColor:(m=e==null?void 0:e.colors)==null?void 0:m.accent}),_jsxruntime.jsxs.call(void 0, ro,{children:[_jsxruntime.jsxs.call(void 0, no,{children:[_jsxruntime.jsx.call(void 0, io,{appearance:e,children:"Sign in with Farcaster"}),_jsxruntime.jsx.call(void 0, ao,{appearance:e,children:"Scan with your phone's camera to continue."})]}),_jsxruntime.jsx.call(void 0, lo,{appearance:e,children:l!=null?_jsxruntime.jsx.call(void 0, _authkit.QRCode,{uri:l,size:280}):_jsxruntime.jsx.call(void 0, so,{children:_jsxruntime.jsx.call(void 0, _chunkAHMPKIEYcjs.a,{style:{color:(h=e==null?void 0:e.colors)==null?void 0:h.textSecondary,fill:(v=e==null?void 0:e.colors)==null?void 0:v.textPrimary}})})}),l?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, co,{appearance:e,children:"Alternatively, click on this link to open Warpcast."}),_jsxruntime.jsx.call(void 0, uo,{href:l,rel:"noopener noreferrer",target:"_blank",appearance:e,children:"Open Warpcast"})]}):_jsxruntime.jsx.call(void 0, "div",{style:{height:"66px"}})]})]})}function re(e){var o=_chunk2WSEHVNPcjs.c.call(void 0, e,[]);let{step:t,appearance:r}=_chunkHNUI5756cjs.a.call(void 0, ),{startOAuthLogin:a,activeOAuthProvider:i}=R(),c=i==="twitter";return t!=="initial"?null:_jsxruntime.jsx.call(void 0, _chunkCD6E2BGDcjs.a,_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {icon:_jsxruntime.jsx.call(void 0, _chunkUMWTEGO6cjs.a,{style:{height:"22px",width:"22px"}}),isLoading:c,appearance:r,onButtonClick:()=>a("twitter")},o),{children:"Sign in with X"}))}var go=_styled2.default.div`
|
|
207
|
+
position: relative;
|
|
208
|
+
padding: 40px 24px 30px 24px;
|
|
209
|
+
display: flex;
|
|
210
|
+
flex-direction: column;
|
|
211
|
+
gap: 10px;
|
|
212
|
+
-webkit-font-smoothing: antialiased;
|
|
213
|
+
animation: none;
|
|
214
|
+
|
|
215
|
+
@media (min-width: 480px) {
|
|
216
|
+
padding: 40px 40px 30px 40px;
|
|
217
|
+
}
|
|
218
|
+
`,ho=_styled2.default.div`
|
|
219
|
+
display: flex;
|
|
220
|
+
align-items: flex-start;
|
|
221
|
+
justify-content: flex-start;
|
|
222
|
+
border-radius: 8px;
|
|
223
|
+
padding: 8px;
|
|
224
|
+
gap: 8px;
|
|
225
|
+
margin-top: 34px;
|
|
226
|
+
background-color: ${o=>{var e,t,r;return new (0, _color2.default)((r=(t=(e=o.appearance)==null?void 0:e.colors)==null?void 0:t.danger)!=null?r:_chunkEAWYV5ZOcjs.a["cm-danger"]).alpha(.12).toString()}};
|
|
227
|
+
`;function ie({style:o}){var x,l,y,g,p,d,u,m,h,v;let{step:e,appearance:t,loginMethods:r,baseUrl:a,error:i,termsOfServiceText:c,authModalTitle:n}=_chunkHNUI5756cjs.a.call(void 0, );return _jsxruntime.jsxs.call(void 0, go,{style:o,children:[i!=null?_jsxruntime.jsxs.call(void 0, ho,{appearance:t,children:[_jsxruntime.jsx.call(void 0, "div",{style:{minWidth:"20px"},children:_jsxruntime.jsx.call(void 0, _chunkNRN4WNQLcjs.a,{customColor:(l=(x=t==null?void 0:t.colors)==null?void 0:x.danger)!=null?l:_chunkEAWYV5ZOcjs.a["cm-danger"]})}),_jsxruntime.jsx.call(void 0, "p",{style:{fontSize:"14px",margin:0,color:(g=(y=t==null?void 0:t.colors)==null?void 0:y.danger)!=null?g:_chunkEAWYV5ZOcjs.a["cm-danger"]},children:i})]}):null,e==="initial"?_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, _chunkO3H2EYFAcjs.b,{appearance:t,children:n!=null?n:"Sign in to Crossmint"}),_jsxruntime.jsx.call(void 0, _chunkO3H2EYFAcjs.c,{appearance:t,children:"Access using one of the options below."})]}):null,r.includes("google")?_jsxruntime.jsx.call(void 0, te,{}):null,r.includes("farcaster")?_jsxruntime.jsx.call(void 0, _chunkBR77Q3PKcjs.a,{baseUrl:a,children:_jsxruntime.jsx.call(void 0, ee,{})}):null,r.includes("twitter")?_jsxruntime.jsx.call(void 0, re,{}):null,r.some(f=>f.startsWith("web3"))?_jsxruntime.jsx.call(void 0, _chunkNXEC4PEDcjs.a,{}):null,r.includes("email")?_jsxruntime.jsxs.call(void 0, "div",{children:[r.length>1?_jsxruntime.jsx.call(void 0, _chunk6O6IJTQDcjs.a,{appearance:t,text:"OR"}):null,_jsxruntime.jsx.call(void 0, Zt,{})]}):null,e==="initial"&&c!=null?_jsxruntime.jsxs.call(void 0, "div",{style:{fontSize:"0.875rem",textAlign:"center",marginTop:"0.5rem",color:(d=(p=t==null?void 0:t.colors)==null?void 0:p.textSecondary)!=null?d:_chunkEAWYV5ZOcjs.a["cm-text-secondary"]},children:[_jsxruntime.jsx.call(void 0, "style",{children:`
|
|
228
|
+
p a {
|
|
229
|
+
color: ${(m=(u=t==null?void 0:t.colors)==null?void 0:u.textLink)!=null?m:_chunkEAWYV5ZOcjs.a["cm-link"]};
|
|
230
|
+
}
|
|
231
|
+
`}),c]}):null,e==="initial"||e==="otp"?_jsxruntime.jsx.call(void 0, _chunkSCHRLC2Icjs.a,{style:{marginTop:"1rem",justifyContent:"center"},color:(v=(h=t==null?void 0:t.colors)==null?void 0:h.textSecondary)!=null?v:_chunkEAWYV5ZOcjs.a["cm-text-secondary"]}):null]})}function et({open:o}){let{appearance:e,setDialogOpen:t}=_chunkHNUI5756cjs.a.call(void 0, );return _jsxruntime.jsx.call(void 0, _chunkO3H2EYFAcjs.a,{open:o,setDialogOpen:t,appearance:e,children:_jsxruntime.jsx.call(void 0, ie,{style:{maxWidth:"448px",padding:"0px"}})})}exports.a = et; exports.b = Tt; exports.c = R; exports.d = $t; exports.e = _t; exports.f = it; exports.g = Zo; exports.h = I; exports.i = Mt; exports.j = _clientsdkreactbase.useCrossmint; exports.k = _clientsdkreactbase.useWallet; exports.l = Kt; exports.m = qt; exports.n = Jt; exports.o = Zt; exports.p = te; exports.q = ee; exports.r = re; exports.s = ie;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkHNUI5756cjs = require('./chunk-HNUI5756.cjs');var _chunkYCYSZLQ2cjs = require('./chunk-YCYSZLQ2.cjs');var _chunkS4BKL6MRcjs = require('./chunk-S4BKL6MR.cjs');var _chunk3X24JZVGcjs = require('./chunk-3X24JZVG.cjs');var _chunkEAWYV5ZOcjs = require('./chunk-EAWYV5ZO.cjs');var _chunkCDQFTAM2cjs = require('./chunk-CDQFTAM2.cjs');var _styled = require('@emotion/styled'); var _styled2 = _interopRequireDefault(_styled);var _jsxruntime = require('react/jsx-runtime');var f=_styled2.default.button`
|
|
2
2
|
${_chunk3X24JZVGcjs.a}
|
|
3
3
|
|
|
4
4
|
/* Base button styles */
|
|
@@ -43,4 +43,4 @@
|
|
|
43
43
|
font-weight: 400;
|
|
44
44
|
margin: 0 32px;
|
|
45
45
|
color: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.colors)==null?void 0:o.textPrimary)||_chunkEAWYV5ZOcjs.a["cm-text-primary"]}};
|
|
46
|
-
`;function R(){var a,c;let{step:e,appearance:t,setStep:o,setError:d}=
|
|
46
|
+
`;function R(){var a,c;let{step:e,appearance:t,setStep:o,setError:d}=_chunkHNUI5756cjs.a.call(void 0, );return e!=="initial"?null:_jsxruntime.jsxs.call(void 0, f,{appearance:t,onClick:()=>{o("web3"),d(null)},children:[_jsxruntime.jsx.call(void 0, x,{children:_jsxruntime.jsx.call(void 0, _chunkYCYSZLQ2cjs.a,{style:{height:"21px",width:"21px",color:(a=t==null?void 0:t.colors)==null?void 0:a.textPrimary}})}),_jsxruntime.jsx.call(void 0, h,{appearance:t,children:"Continue with a wallet"}),_jsxruntime.jsx.call(void 0, g,{children:_jsxruntime.jsx.call(void 0, _chunkCDQFTAM2cjs.a,{style:{height:"21px",width:"21px",color:(c=t==null?void 0:t.colors)==null?void 0:c.textSecondary}})}),_jsxruntime.jsx.call(void 0, _chunkS4BKL6MRcjs.a,{children:"Continue with a wallet"})]})}exports.a = R;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYJCJIS3Icjs = require('../chunk-YJCJIS3I.cjs');require('../chunk-ERHYDCKR.cjs');require('../chunk-2WSEHVNP.cjs');exports.CrossmintNFTCollectionView = _chunkYJCJIS3Icjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-R7XW5QUB.js";import"../chunk-JFXA2IM2.js";import"../chunk-PXDN3KFO.js";export{a as CrossmintNFTCollectionView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNQ6UUT72cjs = require('../chunk-NQ6UUT72.cjs');require('../chunk-ERHYDCKR.cjs');require('../chunk-2WSEHVNP.cjs');exports.CrossmintNFTDetail = _chunkNQ6UUT72cjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-KSEBRSJ7.js";import"../chunk-JFXA2IM2.js";import"../chunk-PXDN3KFO.js";export{a as CrossmintNFTDetail};
|