@crossmint/client-sdk-react-ui 2.2.14 → 2.2.15

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.
Files changed (172) hide show
  1. package/dist/{chunk-M5SZXFBS.js → chunk-2DOHIAVK.js} +1 -1
  2. package/dist/{chunk-HUFKDHMJ.cjs → chunk-4I42JCKB.cjs} +1 -1
  3. package/dist/chunk-4SRO2VKL.js +1 -0
  4. package/dist/{chunk-GPOZTH2S.js → chunk-643TTR4H.js} +1 -1
  5. package/dist/{chunk-3SYFPWRN.cjs → chunk-6G6PC4PF.cjs} +1 -1
  6. package/dist/{chunk-GH7GZN4P.cjs → chunk-6ZSR4M4A.cjs} +1 -1
  7. package/dist/{chunk-TIMWFXI5.cjs → chunk-AY5XZILB.cjs} +1 -1
  8. package/dist/{chunk-VEAVGSER.cjs → chunk-B7QO52HD.cjs} +1 -1
  9. package/dist/{chunk-4HAZNG7B.js → chunk-BH22MNIU.js} +1 -1
  10. package/dist/{chunk-72W2MDK7.cjs → chunk-C6TCJIQS.cjs} +1 -1
  11. package/dist/chunk-CHOIE7TZ.js +2 -0
  12. package/dist/chunk-CNLXVMBD.cjs +1 -0
  13. package/dist/chunk-D6KA2HLB.js +1 -0
  14. package/dist/chunk-DR6MFZ6K.js +1 -0
  15. package/dist/{chunk-5YVOGU43.cjs → chunk-EYTEERNX.cjs} +1 -1
  16. package/dist/{chunk-7IR55EID.js → chunk-EZ4BJYUG.js} +1 -1
  17. package/dist/{chunk-FRXIWXHU.cjs → chunk-F2PJZF7H.cjs} +1 -1
  18. package/dist/chunk-GGUEHZAY.js +1 -0
  19. package/dist/{chunk-WKBTOP6Q.js → chunk-GKMMHRKR.js} +1 -1
  20. package/dist/chunk-GNLTOJSY.cjs +1 -0
  21. package/dist/{chunk-BXA6GFT6.js → chunk-HANJOFAU.js} +1 -1
  22. package/dist/{chunk-FYCKQBCI.cjs → chunk-IYOY7DV2.cjs} +1 -1
  23. package/dist/{chunk-7ES6Y5N6.js → chunk-JK2MXIJK.js} +1 -1
  24. package/dist/chunk-KL5A44S4.js +2 -0
  25. package/dist/{chunk-3ZYH4BAO.cjs → chunk-LU6FL4TS.cjs} +1 -1
  26. package/dist/chunk-LWL72VT5.cjs +1 -0
  27. package/dist/{chunk-YWAEP7EZ.js → chunk-LWX23VQI.js} +3 -3
  28. package/dist/chunk-MIN6TMUL.cjs +2 -0
  29. package/dist/{chunk-YVADYKT7.cjs → chunk-NY7JTHWY.cjs} +1 -1
  30. package/dist/{chunk-PTHDERSV.js → chunk-OENIBGOC.js} +1 -1
  31. package/dist/chunk-OVONVFET.cjs +1 -0
  32. package/dist/{chunk-2NY4GTAE.js → chunk-P7NW7DBQ.js} +1 -1
  33. package/dist/{chunk-IST5CIJH.js → chunk-PX53253N.js} +1 -1
  34. package/dist/chunk-QCLLJVY2.js +1 -0
  35. package/dist/{chunk-45VX2CEN.cjs → chunk-R5AHT63N.cjs} +1 -1
  36. package/dist/chunk-RERW4UT4.cjs +2 -0
  37. package/dist/{chunk-2KRNJ7ZH.js → chunk-S7MVGO3P.js} +1 -1
  38. package/dist/chunk-SGIMVEZT.cjs +1 -0
  39. package/dist/{chunk-FDUPM6VW.js → chunk-TB7PWIBK.js} +1 -1
  40. package/dist/{chunk-KYHACCAW.cjs → chunk-TDQKEPRS.cjs} +1 -1
  41. package/dist/chunk-U6SU4GSC.js +1 -0
  42. package/dist/chunk-UXNLOKSG.cjs +1 -0
  43. package/dist/chunk-VAKQ4II7.js +0 -0
  44. package/dist/{chunk-BO4IWVJ7.cjs → chunk-XH7RM4UW.cjs} +1 -1
  45. package/dist/{chunk-PYYIYSHA.cjs → chunk-XRIQR4V3.cjs} +1 -1
  46. package/dist/{chunk-YJY3ULHC.js → chunk-YMKJ3PWL.js} +1 -1
  47. package/dist/components/CrossmintNFTCollectionView.cjs +1 -1
  48. package/dist/components/CrossmintNFTCollectionView.js +1 -1
  49. package/dist/components/CrossmintNFTDetail.cjs +1 -1
  50. package/dist/components/CrossmintNFTDetail.js +1 -1
  51. package/dist/components/auth/AuthForm.cjs +1 -1
  52. package/dist/components/auth/AuthForm.js +1 -1
  53. package/dist/components/auth/AuthFormBackButton.cjs +1 -1
  54. package/dist/components/auth/AuthFormBackButton.js +1 -1
  55. package/dist/components/auth/AuthFormDialog.cjs +1 -1
  56. package/dist/components/auth/AuthFormDialog.js +1 -1
  57. package/dist/components/auth/EmbeddedAuthForm.cjs +1 -1
  58. package/dist/components/auth/EmbeddedAuthForm.js +1 -1
  59. package/dist/components/auth/PasskeyPrompt.cjs +1 -1
  60. package/dist/components/auth/PasskeyPrompt.js +1 -1
  61. package/dist/components/auth/methods/email/EmailAuthFlow.cjs +1 -1
  62. package/dist/components/auth/methods/email/EmailAuthFlow.js +1 -1
  63. package/dist/components/auth/methods/email/EmailOTPInput.cjs +1 -1
  64. package/dist/components/auth/methods/email/EmailOTPInput.js +1 -1
  65. package/dist/components/auth/methods/email/EmailSignIn.cjs +1 -1
  66. package/dist/components/auth/methods/email/EmailSignIn.js +1 -1
  67. package/dist/components/auth/methods/farcaster/FarcasterSignIn.cjs +1 -1
  68. package/dist/components/auth/methods/farcaster/FarcasterSignIn.js +1 -1
  69. package/dist/components/auth/methods/google/ContinueWithGoogle.cjs +1 -1
  70. package/dist/components/auth/methods/google/ContinueWithGoogle.js +1 -1
  71. package/dist/components/auth/methods/google/GoogleSignIn.cjs +1 -1
  72. package/dist/components/auth/methods/google/GoogleSignIn.js +1 -1
  73. package/dist/components/auth/methods/twitter/TwitterSignIn.cjs +1 -1
  74. package/dist/components/auth/methods/twitter/TwitterSignIn.js +1 -1
  75. package/dist/components/auth/methods/web3/Web3AuthFlow.cjs +1 -1
  76. package/dist/components/auth/methods/web3/Web3AuthFlow.js +1 -1
  77. package/dist/components/auth/methods/web3/Web3AuthFlowButton.cjs +1 -1
  78. package/dist/components/auth/methods/web3/Web3AuthFlowButton.js +1 -1
  79. package/dist/components/auth/methods/web3/Web3Connectors.cjs +1 -1
  80. package/dist/components/auth/methods/web3/Web3Connectors.js +1 -1
  81. package/dist/components/common/Divider.cjs +1 -1
  82. package/dist/components/common/Divider.js +1 -1
  83. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.cjs +1 -1
  84. package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +1 -1
  85. package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.cjs +1 -1
  86. package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.js +1 -1
  87. package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs +1 -1
  88. package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.js +1 -1
  89. package/dist/components/embed/v3/crypto/utils/handleSendTransaction.cjs +1 -1
  90. package/dist/components/embed/v3/crypto/utils/handleSendTransaction.js +1 -1
  91. package/dist/components/embed/v3/index.cjs +1 -1
  92. package/dist/components/embed/v3/index.js +1 -1
  93. package/dist/components/hosted/CrossmintPayButton_DEPRECATED.cjs +1 -1
  94. package/dist/components/hosted/CrossmintPayButton_DEPRECATED.js +1 -1
  95. package/dist/components/hosted/index.cjs +1 -1
  96. package/dist/components/hosted/index.js +1 -1
  97. package/dist/components/hosted/v3/CrossmintHostedCheckoutV3.cjs +1 -1
  98. package/dist/components/hosted/v3/CrossmintHostedCheckoutV3.js +1 -1
  99. package/dist/components/hosted/v3/index.cjs +1 -1
  100. package/dist/components/hosted/v3/index.js +1 -1
  101. package/dist/components/index.cjs +1 -1
  102. package/dist/components/index.d.cts +6 -0
  103. package/dist/components/index.d.ts +6 -0
  104. package/dist/components/index.js +1 -1
  105. package/dist/components/signers/EmailOTPInput.cjs +1 -1
  106. package/dist/components/signers/EmailOTPInput.js +1 -1
  107. package/dist/components/signers/EmailSignersDialog.cjs +1 -1
  108. package/dist/components/signers/EmailSignersDialog.js +1 -1
  109. package/dist/components/signers/PhoneConfirmation.cjs +1 -0
  110. package/dist/components/signers/PhoneConfirmation.d.cts +12 -0
  111. package/dist/components/signers/PhoneConfirmation.d.ts +12 -0
  112. package/dist/components/signers/PhoneConfirmation.js +1 -0
  113. package/dist/components/signers/PhoneOTPInput.cjs +1 -0
  114. package/dist/components/signers/PhoneOTPInput.d.cts +12 -0
  115. package/dist/components/signers/PhoneOTPInput.d.ts +12 -0
  116. package/dist/components/signers/PhoneOTPInput.js +1 -0
  117. package/dist/components/signers/PhoneSignersDialog.cjs +1 -0
  118. package/dist/components/signers/PhoneSignersDialog.d.cts +18 -0
  119. package/dist/components/signers/PhoneSignersDialog.d.ts +18 -0
  120. package/dist/components/signers/PhoneSignersDialog.js +1 -0
  121. package/dist/components/signers/consts.cjs +1 -0
  122. package/dist/components/signers/consts.d.cts +3 -0
  123. package/dist/components/signers/consts.d.ts +3 -0
  124. package/dist/components/signers/consts.js +1 -0
  125. package/dist/components/signers/index.cjs +1 -0
  126. package/dist/components/signers/index.d.cts +9 -0
  127. package/dist/components/signers/index.d.ts +9 -0
  128. package/dist/components/signers/index.js +1 -0
  129. package/dist/consts/version.cjs +1 -1
  130. package/dist/consts/version.js +1 -1
  131. package/dist/hooks/index.cjs +1 -1
  132. package/dist/hooks/index.js +1 -1
  133. package/dist/hooks/useAuth.cjs +1 -1
  134. package/dist/hooks/useAuth.js +1 -1
  135. package/dist/hooks/useCrossmintAuth.cjs +1 -1
  136. package/dist/hooks/useCrossmintAuth.js +1 -1
  137. package/dist/hooks/useCrossmintCheckout.cjs +1 -1
  138. package/dist/hooks/useCrossmintCheckout.js +1 -1
  139. package/dist/hooks/useOAuthWindowListener.cjs +1 -1
  140. package/dist/hooks/useOAuthWindowListener.js +1 -1
  141. package/dist/icons/phoneOTP.cjs +1 -0
  142. package/dist/icons/phoneOTP.d.cts +10 -0
  143. package/dist/icons/phoneOTP.d.ts +10 -0
  144. package/dist/icons/phoneOTP.js +1 -0
  145. package/dist/index.cjs +1 -1
  146. package/dist/index.d.cts +6 -0
  147. package/dist/index.d.ts +6 -0
  148. package/dist/index.js +1 -1
  149. package/dist/providers/CrossmintAuthProvider.cjs +1 -1
  150. package/dist/providers/CrossmintAuthProvider.js +1 -1
  151. package/dist/providers/CrossmintAuthProviderInternal.cjs +1 -1
  152. package/dist/providers/CrossmintAuthProviderInternal.js +1 -1
  153. package/dist/providers/CrossmintWalletProvider.cjs +1 -1
  154. package/dist/providers/CrossmintWalletProvider.js +1 -1
  155. package/dist/providers/auth/AuthFormProvider.cjs +1 -1
  156. package/dist/providers/auth/AuthFormProvider.js +1 -1
  157. package/dist/providers/dynamic/DynamicWalletProvider.cjs +1 -1
  158. package/dist/providers/dynamic/DynamicWalletProvider.js +1 -1
  159. package/dist/providers/index.cjs +1 -1
  160. package/dist/providers/index.js +1 -1
  161. package/dist/utils/createCrossmintApiClient.cjs +1 -1
  162. package/dist/utils/createCrossmintApiClient.js +1 -1
  163. package/package.json +7 -7
  164. package/dist/chunk-A7H6M63M.cjs +0 -2
  165. package/dist/chunk-CNKSQE42.js +0 -1
  166. package/dist/chunk-PJSZM627.js +0 -1
  167. package/dist/chunk-T34D7CJP.cjs +0 -1
  168. package/dist/chunk-XLX43RQW.js +0 -2
  169. /package/dist/{chunk-IXEWRW2O.cjs → chunk-2PVYNZP7.cjs} +0 -0
  170. /package/dist/{chunk-S73E6EBO.cjs → chunk-4YRSANGA.cjs} +0 -0
  171. /package/dist/{chunk-3BUVHV54.js → chunk-MAFITAUM.js} +0 -0
  172. /package/dist/{chunk-J2QFL7IO.js → chunk-QVXTNSBH.js} +0 -0
@@ -1 +1 @@
1
- import{a as o}from"./chunk-2NY4GTAE.js";import{a as e}from"./chunk-PXDN3KFO.js";import{jsx as t}from"react/jsx-runtime";function i(d){return t(o,e({},d))}export{i as a};
1
+ import{a as o}from"./chunk-P7NW7DBQ.js";import{a as e}from"./chunk-PXDN3KFO.js";import{jsx as t}from"react/jsx-runtime";function i(d){return t(o,e({},d))}export{i as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkDGY7DTSCcjs = require('./chunk-DGY7DTSC.cjs');var _chunkA7H6M63Mcjs = require('./chunk-A7H6M63M.cjs');var _chunkWMBBIP2Ccjs = require('./chunk-WMBBIP2C.cjs');var _reactvisuallyhidden = require('@radix-ui/react-visually-hidden');var _jsxruntime = require('react/jsx-runtime');function N({email:l,open:r,setOpen:D,step:s,onSubmitOTP:O,onResendOTPCode:h,onSubmitEmail:E,rejectRef:e,appearance:o}){var d,f,u;if(l==null)throw new Error("Email is required");function m(t){var g;(r||t)&&((g=e.current)==null||g.call(e,new Error),D(!1))}return _jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.a,{modal:!1,open:r,onOpenChange:m,children:_jsxruntime.jsxs.call(void 0, _chunkWMBBIP2Ccjs.e,{onInteractOutside:t=>t.preventDefault(),onOpenAutoFocus:t=>t.preventDefault(),className:"!p-0 !min-[480px]:p-0",style:{borderRadius:o==null?void 0:o.borderRadius,backgroundColor:(d=o==null?void 0:o.colors)==null?void 0:d.background},children:[_jsxruntime.jsx.call(void 0, _reactvisuallyhidden.VisuallyHidden,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.h,{children:"Confirm it's you"})}),_jsxruntime.jsx.call(void 0, _reactvisuallyhidden.VisuallyHidden,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.i,{children:"Create a recovery key"})}),_jsxruntime.jsxs.call(void 0, "div",{className:"relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none max-w-[448px]",children:[s==="initial"?_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-4",children:[_jsxruntime.jsx.call(void 0, "h1",{className:"text-2xl font-bold text-cm-text-primary",style:{color:(f=o==null?void 0:o.colors)==null?void 0:f.textPrimary},children:"Confirm it's you"}),_jsxruntime.jsx.call(void 0, "p",{className:"text-base font-normal mb-3 text-cm-text-secondary",style:{color:(u=o==null?void 0:o.colors)==null?void 0:u.textSecondary},children:"You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code."})]}):null,s==="otp"?_jsxruntime.jsx.call(void 0, _chunkA7H6M63Mcjs.a,{email:l,onSubmitOTP:O,onResendCode:h,appearance:o}):_jsxruntime.jsx.call(void 0, _chunkDGY7DTSCcjs.a,{email:l,onConfirm:E,onCancel:m,appearance:o})]})]})})}exports.a = N;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkDGY7DTSCcjs = require('./chunk-DGY7DTSC.cjs');var _chunkRERW4UT4cjs = require('./chunk-RERW4UT4.cjs');var _chunkWMBBIP2Ccjs = require('./chunk-WMBBIP2C.cjs');var _reactvisuallyhidden = require('@radix-ui/react-visually-hidden');var _jsxruntime = require('react/jsx-runtime');function N({email:l,open:r,setOpen:D,step:s,onSubmitOTP:O,onResendOTPCode:h,onSubmitEmail:E,rejectRef:e,appearance:o}){var d,f,u;if(l==null)throw new Error("Email is required");function m(t){var g;(r||t)&&((g=e.current)==null||g.call(e,new Error),D(!1))}return _jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.a,{modal:!1,open:r,onOpenChange:m,children:_jsxruntime.jsxs.call(void 0, _chunkWMBBIP2Ccjs.e,{onInteractOutside:t=>t.preventDefault(),onOpenAutoFocus:t=>t.preventDefault(),className:"!p-0 !min-[480px]:p-0",style:{borderRadius:o==null?void 0:o.borderRadius,backgroundColor:(d=o==null?void 0:o.colors)==null?void 0:d.background},children:[_jsxruntime.jsx.call(void 0, _reactvisuallyhidden.VisuallyHidden,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.h,{children:"Confirm it's you"})}),_jsxruntime.jsx.call(void 0, _reactvisuallyhidden.VisuallyHidden,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.i,{children:"Create a recovery key"})}),_jsxruntime.jsxs.call(void 0, "div",{className:"relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none max-w-[448px]",children:[s==="initial"?_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-4",children:[_jsxruntime.jsx.call(void 0, "h1",{className:"text-2xl font-bold text-cm-text-primary",style:{color:(f=o==null?void 0:o.colors)==null?void 0:f.textPrimary},children:"Confirm it's you"}),_jsxruntime.jsx.call(void 0, "p",{className:"text-base font-normal mb-3 text-cm-text-secondary",style:{color:(u=o==null?void 0:o.colors)==null?void 0:u.textSecondary},children:"You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code."})]}):null,s==="otp"?_jsxruntime.jsx.call(void 0, _chunkRERW4UT4cjs.a,{email:l,onSubmitOTP:O,onResendCode:h,appearance:o}):_jsxruntime.jsx.call(void 0, _chunkDGY7DTSCcjs.a,{email:l,onConfirm:E,onCancel:m,appearance:o})]})]})})}exports.a = N;
@@ -0,0 +1 @@
1
+ import{a as q}from"./chunk-GKMMHRKR.js";import{a as N}from"./chunk-U6SU4GSC.js";import{a as F}from"./chunk-643TTR4H.js";import{a as j}from"./chunk-ZFHUZZF2.js";import{d as a}from"./chunk-PXDN3KFO.js";import{useState as s,useCallback as z,useRef as l}from"react";import{createPortal as u}from"react-dom";import{CrossmintWalletBaseProvider as G,useCrossmint as J}from"@crossmint/client-sdk-react-base";import{jsx as d,jsxs as K}from"react/jsx-runtime";var p=P=>()=>{throw new Error(`${P} is not available. Make sure you're using an email or phone signer wallet.`)};function te({children:P,showPasskeyHelpers:c=!0,appearance:m,createOnLogin:t,callbacks:i}){let{experimental_customAuth:r}=J(),[h,y]=s({open:!1}),[g,f]=s(!1),[V,v]=s("initial"),[O,S]=s(!1),[B,T]=s("initial"),[M,I]=s(!1),C=l(p("sendEmailWithOtp")),w=l(p("verifyOtp")),R=l(p("sendPhoneWithOtp")),b=l(p("verifyPhoneOtp")),n=l(p("reject")),E=z(e=>()=>new Promise(o=>{if(!c){o();return}y({type:e,open:!0,primaryActionOnClick:()=>{y({open:!1}),o()},secondaryActionOnClick:()=>{y({open:!1}),o()}})}),[c]),k=()=>a(this,null,function*(){try{yield C.current(),v("otp")}catch(e){console.error("Failed to send email OTP",e),n.current(new Error("Failed to send email OTP"))}}),U=e=>a(this,null,function*(){try{yield w.current(e),f(!1),v("initial")}catch(o){console.error("Failed to verify OTP",o),n.current(new Error("Failed to verify OTP"))}}),W=()=>a(this,null,function*(){try{yield R.current(),T("otp")}catch(e){console.error("Failed to send phone OTP",e),n.current(new Error("Failed to send phone OTP"))}}),A=e=>a(this,null,function*(){try{yield b.current(e),S(!1),T("initial")}catch(o){console.error("Failed to verify phone OTP",o),n.current(new Error("Failed to verify phone OTP"))}});return d(j,{children:K(G,{createOnLogin:t,onAuthRequired:(e,o,D,$)=>a(this,null,function*(){(t==null?void 0:t.signer.type)==="phone"&&t.signer.phone?(S(e),R.current=o,b.current=D):(f(e),C.current=o,w.current=D),I(e),n.current=$}),callbacks:(()=>{let e=i==null?void 0:i.onWalletCreationStart,o=i==null?void 0:i.onTransactionStart;return(t==null?void 0:t.signer.type)==="passkey"&&c&&(e=E("create-wallet"),o=E("transaction")),{onWalletCreationStart:e,onTransactionStart:o}})(),children:[P,g&&(r==null?void 0:r.email)!=null?u(d(F,{rejectRef:n,email:r==null?void 0:r.email,open:g,setOpen:f,step:V,onSubmitOTP:U,onResendOTPCode:k,onSubmitEmail:k,appearance:m}),document.body):null,O&&(r==null?void 0:r.phone)!=null?u(d(N,{rejectRef:n,phone:r==null?void 0:r.phone,open:O,setOpen:S,step:B,onSubmitOTP:A,onResendOTPCode:W,onSubmitPhone:W,appearance:m}),document.body):null,h.open?u(d(q,{state:h,appearance:m}),document.body):null]})})}export{te as a};
@@ -1 +1 @@
1
- import{a as y}from"./chunk-JSOMGEEA.js";import{a as c}from"./chunk-XLX43RQW.js";import{a,e as x,h as b,i as C}from"./chunk-UDQUVZUQ.js";import{VisuallyHidden as v}from"@radix-ui/react-visually-hidden";import{jsx as i,jsxs as n}from"react/jsx-runtime";function I({email:l,open:r,setOpen:D,step:s,onSubmitOTP:O,onResendOTPCode:h,onSubmitEmail:E,rejectRef:e,appearance:o}){var d,f,u;if(l==null)throw new Error("Email is required");function m(t){var g;(r||t)&&((g=e.current)==null||g.call(e,new Error),D(!1))}return i(a,{modal:!1,open:r,onOpenChange:m,children:n(x,{onInteractOutside:t=>t.preventDefault(),onOpenAutoFocus:t=>t.preventDefault(),className:"!p-0 !min-[480px]:p-0",style:{borderRadius:o==null?void 0:o.borderRadius,backgroundColor:(d=o==null?void 0:o.colors)==null?void 0:d.background},children:[i(v,{asChild:!0,children:i(b,{children:"Confirm it's you"})}),i(v,{asChild:!0,children:i(C,{children:"Create a recovery key"})}),n("div",{className:"relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none max-w-[448px]",children:[s==="initial"?n("div",{className:"flex flex-col gap-4",children:[i("h1",{className:"text-2xl font-bold text-cm-text-primary",style:{color:(f=o==null?void 0:o.colors)==null?void 0:f.textPrimary},children:"Confirm it's you"}),i("p",{className:"text-base font-normal mb-3 text-cm-text-secondary",style:{color:(u=o==null?void 0:o.colors)==null?void 0:u.textSecondary},children:"You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code."})]}):null,s==="otp"?i(c,{email:l,onSubmitOTP:O,onResendCode:h,appearance:o}):i(y,{email:l,onConfirm:E,onCancel:m,appearance:o})]})]})})}export{I as a};
1
+ import{a as y}from"./chunk-JSOMGEEA.js";import{a as c}from"./chunk-KL5A44S4.js";import{a,e as x,h as b,i as C}from"./chunk-UDQUVZUQ.js";import{VisuallyHidden as v}from"@radix-ui/react-visually-hidden";import{jsx as i,jsxs as n}from"react/jsx-runtime";function I({email:l,open:r,setOpen:D,step:s,onSubmitOTP:O,onResendOTPCode:h,onSubmitEmail:E,rejectRef:e,appearance:o}){var d,f,u;if(l==null)throw new Error("Email is required");function m(t){var g;(r||t)&&((g=e.current)==null||g.call(e,new Error),D(!1))}return i(a,{modal:!1,open:r,onOpenChange:m,children:n(x,{onInteractOutside:t=>t.preventDefault(),onOpenAutoFocus:t=>t.preventDefault(),className:"!p-0 !min-[480px]:p-0",style:{borderRadius:o==null?void 0:o.borderRadius,backgroundColor:(d=o==null?void 0:o.colors)==null?void 0:d.background},children:[i(v,{asChild:!0,children:i(b,{children:"Confirm it's you"})}),i(v,{asChild:!0,children:i(C,{children:"Create a recovery key"})}),n("div",{className:"relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none max-w-[448px]",children:[s==="initial"?n("div",{className:"flex flex-col gap-4",children:[i("h1",{className:"text-2xl font-bold text-cm-text-primary",style:{color:(f=o==null?void 0:o.colors)==null?void 0:f.textPrimary},children:"Confirm it's you"}),i("p",{className:"text-base font-normal mb-3 text-cm-text-secondary",style:{color:(u=o==null?void 0:o.colors)==null?void 0:u.textSecondary},children:"You're using this wallet for the first time on this device. Click 'Send code' to get a one-time verification code."})]}):null,s==="otp"?i(c,{email:l,onSubmitOTP:O,onResendCode:h,appearance:o}):i(y,{email:l,onConfirm:E,onCancel:m,appearance:o})]})]})})}export{I as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkQLPV72AEcjs = require('./chunk-QLPV72AE.cjs');var _chunkTIMWFXI5cjs = require('./chunk-TIMWFXI5.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _react = require('react');var _clientsdkbase = require('@crossmint/client-sdk-base');var _jsxruntime = require('react/jsx-runtime');var V=_react.lazy.call(void 0, ()=>Promise.resolve().then(() => _interopRequireWildcard(require("./components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs"))).then(r=>({default:r.CryptoWalletConnectionHandler})));function J(r){var m;let[e,C]=_react.useState.call(void 0, null),[P,b]=_react.useState.call(void 0, 0),g=_react.useRef.call(void 0, (m=r.payment.crypto.payer)==null?void 0:m.initialChain),n=_react.useRef.call(void 0, r);if(I(r,n.current)){let t=_chunk2WSEHVNPcjs.a.call(void 0, {},r),u=w(r,g.current);u.shouldPreserve&&(t.payment.crypto.payer=u.updatedPayer),n.current=t}let{crossmint:k}=_clientsdkreactbase.useCrossmint.call(void 0, ),c=_chunkTIMWFXI5cjs.a.call(void 0, k,{usageOrigin:"client"}),d=_clientsdkbase.crossmintEmbeddedCheckoutV3Service.call(void 0, {apiClient:c}),i=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>{let t=i.current;!t||e||C(d.iframe.createClient(t))},[i.current,e]),_react.useEffect.call(void 0, ()=>{if(e!=null)return e.on("ui:height.changed",t=>b(t.height)),()=>{e.off("ui:height.changed")}},[e]),_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "iframe",{ref:i,src:d.iframe.getUrl(n.current),id:"crossmint-embedded-checkout.iframe",role:"crossmint-embedded-checkout.iframe",allow:"payment *; microphone; camera",style:{boxShadow:"none",border:"none",padding:"0px",width:"100%",minWidth:"100%",overflow:"hidden",display:"block",userSelect:"none",transform:"translate(0px)",opacity:"1",transition:"ease 0s, opacity 0.4s ease 0.1s",height:`${P}px`,backgroundColor:"transparent"}}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?_jsxruntime.jsx.call(void 0, _chunkQLPV72AEcjs.a,{payer:n.current.payment.crypto.payer,iframeClient:e}):_jsxruntime.jsx.call(void 0, V,{iframeClient:e,apiKeyEnvironment:c.parsedAPIKey.environment}):null,_jsxruntime.jsx.call(void 0, "span",{id:"crossmint-focus-target",tabIndex:-1})]})}function I(r,e){return JSON.stringify(r)!==JSON.stringify(e)}function w(r,e){return r.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {},r.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}exports.a = J;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkQLPV72AEcjs = require('./chunk-QLPV72AE.cjs');var _chunkAY5XZILBcjs = require('./chunk-AY5XZILB.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _react = require('react');var _clientsdkbase = require('@crossmint/client-sdk-base');var _jsxruntime = require('react/jsx-runtime');var V=_react.lazy.call(void 0, ()=>Promise.resolve().then(() => _interopRequireWildcard(require("./components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs"))).then(r=>({default:r.CryptoWalletConnectionHandler})));function J(r){var m;let[e,C]=_react.useState.call(void 0, null),[P,b]=_react.useState.call(void 0, 0),g=_react.useRef.call(void 0, (m=r.payment.crypto.payer)==null?void 0:m.initialChain),n=_react.useRef.call(void 0, r);if(I(r,n.current)){let t=_chunk2WSEHVNPcjs.a.call(void 0, {},r),u=w(r,g.current);u.shouldPreserve&&(t.payment.crypto.payer=u.updatedPayer),n.current=t}let{crossmint:k}=_clientsdkreactbase.useCrossmint.call(void 0, ),c=_chunkAY5XZILBcjs.a.call(void 0, k,{usageOrigin:"client"}),d=_clientsdkbase.crossmintEmbeddedCheckoutV3Service.call(void 0, {apiClient:c}),i=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>{let t=i.current;!t||e||C(d.iframe.createClient(t))},[i.current,e]),_react.useEffect.call(void 0, ()=>{if(e!=null)return e.on("ui:height.changed",t=>b(t.height)),()=>{e.off("ui:height.changed")}},[e]),_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "iframe",{ref:i,src:d.iframe.getUrl(n.current),id:"crossmint-embedded-checkout.iframe",role:"crossmint-embedded-checkout.iframe",allow:"payment *; microphone; camera",style:{boxShadow:"none",border:"none",padding:"0px",width:"100%",minWidth:"100%",overflow:"hidden",display:"block",userSelect:"none",transform:"translate(0px)",opacity:"1",transition:"ease 0s, opacity 0.4s ease 0.1s",height:`${P}px`,backgroundColor:"transparent"}}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?_jsxruntime.jsx.call(void 0, _chunkQLPV72AEcjs.a,{payer:n.current.payment.crypto.payer,iframeClient:e}):_jsxruntime.jsx.call(void 0, V,{iframeClient:e,apiKeyEnvironment:c.parsedAPIKey.environment}):null,_jsxruntime.jsx.call(void 0, "span",{id:"crossmint-focus-target",tabIndex:-1})]})}function I(r,e){return JSON.stringify(r)!==JSON.stringify(e)}function w(r,e){return r.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {},r.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}exports.a = J;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFRXIWXHUcjs = require('./chunk-FRXIWXHU.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,_chunkFRXIWXHUcjs.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
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOVONVFETcjs = require('./chunk-OVONVFET.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,_chunkOVONVFETcjs.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 _chunkFRXIWXHUcjs = require('./chunk-FRXIWXHU.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');function C(t,i){return new (0, _commonsdkbase.CrossmintApiClient)(t,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-ui",version:_chunkFRXIWXHUcjs.a},apiKeyExpectations:i}})}exports.a = C;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOVONVFETcjs = require('./chunk-OVONVFET.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');function C(t,i){return new (0, _commonsdkbase.CrossmintApiClient)(t,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-ui",version:_chunkOVONVFETcjs.a},apiKeyExpectations:i}})}exports.a = C;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTWX7ZBKZcjs = require('./chunk-TWX7ZBKZ.cjs');var _chunkQYQERFYLcjs = require('./chunk-QYQERFYL.cjs');var _chunkVI6TW7JTcjs = require('./chunk-VI6TW7JT.cjs');var _chunkWMBBIP2Ccjs = require('./chunk-WMBBIP2C.cjs');var _chunkDCACW4K6cjs = require('./chunk-DCACW4K6.cjs');var _chunkWABJHG6Bcjs = require('./chunk-WABJHG6B.cjs');var _reactvisuallyhidden = require('@radix-ui/react-visually-hidden');var _jsxruntime = require('react/jsx-runtime');function n({title:e,content:t,primaryButton:s,secondaryAction:l,appearance:r}){var u,a,y,f;return _jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.a,{modal:!1,open:!0,onOpenChange:()=>{},children:_jsxruntime.jsxs.call(void 0, _chunkWMBBIP2Ccjs.e,{showCloseButton:!1,onInteractOutside:d=>d.preventDefault(),onOpenAutoFocus:d=>d.preventDefault(),className:"!p-0 !min-[480px]:p-0",style:{borderRadius:r==null?void 0:r.borderRadius,backgroundColor:(u=r==null?void 0:r.colors)==null?void 0:u.background},children:[_jsxruntime.jsx.call(void 0, _reactvisuallyhidden.VisuallyHidden,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.h,{children:e})}),_jsxruntime.jsxs.call(void 0, "div",{className:"relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none",children:[_jsxruntime.jsx.call(void 0, "div",{className:"flex justify-center left-1.5 relative",children:_jsxruntime.jsx.call(void 0, _chunkTWX7ZBKZcjs.a,{appearance:r})}),_jsxruntime.jsx.call(void 0, "div",{className:"flex justify-center",children:_jsxruntime.jsx.call(void 0, "p",{style:{fontSize:"1.125rem",lineHeight:"1.75rem",fontWeight:"bold",color:((a=r==null?void 0:r.colors)==null?void 0:a.textPrimary)||"#20343E"},children:e})}),_jsxruntime.jsx.call(void 0, "div",{className:"mb-6",children:_jsxruntime.jsx.call(void 0, "div",{style:{fontWeight:"normal",color:((y=r==null?void 0:r.colors)==null?void 0:y.textSecondary)||"#67797F"},children:t})}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-4 justify-center",children:[s,l]}),_jsxruntime.jsx.call(void 0, "div",{className:"flex justify-center pt-4",children:_jsxruntime.jsx.call(void 0, _chunkDCACW4K6cjs.a,{color:(f=r==null?void 0:r.colors)==null?void 0:f.textSecondary})})]})]})})}function R({state:e,appearance:t}){var s,l;switch(e.type){case"create-wallet":return _jsxruntime.jsx.call(void 0, n,{title:"Create Your Wallet",appearance:t,content:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "div",{className:"mb-3",children:"You're about to create a wallet."}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex gap-2",children:[_jsxruntime.jsx.call(void 0, "div",{children:_jsxruntime.jsx.call(void 0, _chunkVI6TW7JTcjs.a,{})}),"Your wallet will be secured with a passkey"]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex gap-2",children:[_jsxruntime.jsx.call(void 0, "div",{children:_jsxruntime.jsx.call(void 0, _chunkQYQERFYLcjs.a,{})}),"Your device will ask you for your fingerprint, face, or screen lock to set it up"]})]})]}),primaryButton:_jsxruntime.jsx.call(void 0, c,{appearance:t,onClick:e.primaryActionOnClick,children:"Create Wallet"})});case"create-wallet-error":return _jsxruntime.jsx.call(void 0, n,{title:"Wallet Creation Failed",appearance:t,content:_jsxruntime.jsx.call(void 0, "div",{children:"We couldn't create your wallet. This could be due to rejecting the request, a timeout, or not having access to your passkey on this device."}),primaryButton:_jsxruntime.jsx.call(void 0, c,{appearance:t,onClick:e.primaryActionOnClick,children:"Try again"})});case"transaction":return _jsxruntime.jsx.call(void 0, n,{title:"Use Your Wallet",appearance:t,content:_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-col gap-2",children:_jsxruntime.jsxs.call(void 0, "div",{className:"flex gap-2",children:[_jsxruntime.jsx.call(void 0, "div",{children:_jsxruntime.jsx.call(void 0, _chunkQYQERFYLcjs.a,{})}),_jsxruntime.jsx.call(void 0, "span",{children:"Your device will ask you for your fingerprint, face, or screen lock to authorize this action."})]})}),primaryButton:_jsxruntime.jsx.call(void 0, c,{appearance:t,onClick:e.primaryActionOnClick,children:"Use Wallet"})});case"transaction-error":return _jsxruntime.jsx.call(void 0, n,{title:"Wallet Access Failed",appearance:t,content:_jsxruntime.jsx.call(void 0, "div",{children:"We couldn't access your wallet. This could be due to rejecting the request, a timeout, or not having access to your passkey on this device."}),primaryButton:_jsxruntime.jsx.call(void 0, c,{appearance:t,onClick:e.primaryActionOnClick,children:"Try again"}),secondaryAction:_jsxruntime.jsx.call(void 0, "a",{href:"https://docs.crossmint.com/wallets/smart-wallets/users/troubleshoot",rel:"noopener noreferrer",target:"_blank",style:{padding:"0.875rem",width:"100%",textAlign:"center",textDecoration:"none",borderRadius:"0.5rem",fontWeight:"bold",backgroundColor:((s=t==null?void 0:t.colors)==null?void 0:s.inputBackground)||"#F0F2F4",color:((l=t==null?void 0:t.colors)==null?void 0:l.textSecondary)||"#00150D"},children:"Troubleshoot"})});case"not-supported":return _jsxruntime.jsx.call(void 0, n,{title:"Passkeys Not Supported on This Device",appearance:t,content:_jsxruntime.jsx.call(void 0, "div",{children:"To access your wallet with a passkey, switch to a device or browser that supports passkeys, such as Chrome or Safari on a smartphone, tablet, or modern computer"}),primaryButton:_jsxruntime.jsx.call(void 0, c,{appearance:t,onClick:e.primaryActionOnClick,children:"Understood"})});default:return null}}var c=({appearance:e,onClick:t,children:s})=>{var l,r;return _jsxruntime.jsxs.call(void 0, "button",{className:_chunkWABJHG6Bcjs.a.call(void 0, "relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none"),style:{borderRadius:e==null?void 0:e.borderRadius,backgroundColor:(l=e==null?void 0:e.colors)==null?void 0:l.buttonBackground},onClick:t,children:[_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",style:{margin:"0px 32px",color:(r=e==null?void 0:e.colors)==null?void 0:r.textPrimary},children:s}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:s})]})};exports.a = R;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVI6TW7JTcjs = require('./chunk-VI6TW7JT.cjs');var _chunkTWX7ZBKZcjs = require('./chunk-TWX7ZBKZ.cjs');var _chunkQYQERFYLcjs = require('./chunk-QYQERFYL.cjs');var _chunkWMBBIP2Ccjs = require('./chunk-WMBBIP2C.cjs');var _chunkDCACW4K6cjs = require('./chunk-DCACW4K6.cjs');var _chunkWABJHG6Bcjs = require('./chunk-WABJHG6B.cjs');var _reactvisuallyhidden = require('@radix-ui/react-visually-hidden');var _jsxruntime = require('react/jsx-runtime');function n({title:e,content:t,primaryButton:s,secondaryAction:l,appearance:r}){var u,a,y,f;return _jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.a,{modal:!1,open:!0,onOpenChange:()=>{},children:_jsxruntime.jsxs.call(void 0, _chunkWMBBIP2Ccjs.e,{showCloseButton:!1,onInteractOutside:d=>d.preventDefault(),onOpenAutoFocus:d=>d.preventDefault(),className:"!p-0 !min-[480px]:p-0",style:{borderRadius:r==null?void 0:r.borderRadius,backgroundColor:(u=r==null?void 0:r.colors)==null?void 0:u.background},children:[_jsxruntime.jsx.call(void 0, _reactvisuallyhidden.VisuallyHidden,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _chunkWMBBIP2Ccjs.h,{children:e})}),_jsxruntime.jsxs.call(void 0, "div",{className:"relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none",children:[_jsxruntime.jsx.call(void 0, "div",{className:"flex justify-center left-1.5 relative",children:_jsxruntime.jsx.call(void 0, _chunkTWX7ZBKZcjs.a,{appearance:r})}),_jsxruntime.jsx.call(void 0, "div",{className:"flex justify-center",children:_jsxruntime.jsx.call(void 0, "p",{style:{fontSize:"1.125rem",lineHeight:"1.75rem",fontWeight:"bold",color:((a=r==null?void 0:r.colors)==null?void 0:a.textPrimary)||"#20343E"},children:e})}),_jsxruntime.jsx.call(void 0, "div",{className:"mb-6",children:_jsxruntime.jsx.call(void 0, "div",{style:{fontWeight:"normal",color:((y=r==null?void 0:r.colors)==null?void 0:y.textSecondary)||"#67797F"},children:t})}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-4 justify-center",children:[s,l]}),_jsxruntime.jsx.call(void 0, "div",{className:"flex justify-center pt-4",children:_jsxruntime.jsx.call(void 0, _chunkDCACW4K6cjs.a,{color:(f=r==null?void 0:r.colors)==null?void 0:f.textSecondary})})]})]})})}function R({state:e,appearance:t}){var s,l;switch(e.type){case"create-wallet":return _jsxruntime.jsx.call(void 0, n,{title:"Create Your Wallet",appearance:t,content:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "div",{className:"mb-3",children:"You're about to create a wallet."}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex gap-2",children:[_jsxruntime.jsx.call(void 0, "div",{children:_jsxruntime.jsx.call(void 0, _chunkVI6TW7JTcjs.a,{})}),"Your wallet will be secured with a passkey"]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex gap-2",children:[_jsxruntime.jsx.call(void 0, "div",{children:_jsxruntime.jsx.call(void 0, _chunkQYQERFYLcjs.a,{})}),"Your device will ask you for your fingerprint, face, or screen lock to set it up"]})]})]}),primaryButton:_jsxruntime.jsx.call(void 0, c,{appearance:t,onClick:e.primaryActionOnClick,children:"Create Wallet"})});case"create-wallet-error":return _jsxruntime.jsx.call(void 0, n,{title:"Wallet Creation Failed",appearance:t,content:_jsxruntime.jsx.call(void 0, "div",{children:"We couldn't create your wallet. This could be due to rejecting the request, a timeout, or not having access to your passkey on this device."}),primaryButton:_jsxruntime.jsx.call(void 0, c,{appearance:t,onClick:e.primaryActionOnClick,children:"Try again"})});case"transaction":return _jsxruntime.jsx.call(void 0, n,{title:"Use Your Wallet",appearance:t,content:_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-col gap-2",children:_jsxruntime.jsxs.call(void 0, "div",{className:"flex gap-2",children:[_jsxruntime.jsx.call(void 0, "div",{children:_jsxruntime.jsx.call(void 0, _chunkQYQERFYLcjs.a,{})}),_jsxruntime.jsx.call(void 0, "span",{children:"Your device will ask you for your fingerprint, face, or screen lock to authorize this action."})]})}),primaryButton:_jsxruntime.jsx.call(void 0, c,{appearance:t,onClick:e.primaryActionOnClick,children:"Use Wallet"})});case"transaction-error":return _jsxruntime.jsx.call(void 0, n,{title:"Wallet Access Failed",appearance:t,content:_jsxruntime.jsx.call(void 0, "div",{children:"We couldn't access your wallet. This could be due to rejecting the request, a timeout, or not having access to your passkey on this device."}),primaryButton:_jsxruntime.jsx.call(void 0, c,{appearance:t,onClick:e.primaryActionOnClick,children:"Try again"}),secondaryAction:_jsxruntime.jsx.call(void 0, "a",{href:"https://docs.crossmint.com/wallets/smart-wallets/users/troubleshoot",rel:"noopener noreferrer",target:"_blank",style:{padding:"0.875rem",width:"100%",textAlign:"center",textDecoration:"none",borderRadius:"0.5rem",fontWeight:"bold",backgroundColor:((s=t==null?void 0:t.colors)==null?void 0:s.inputBackground)||"#F0F2F4",color:((l=t==null?void 0:t.colors)==null?void 0:l.textSecondary)||"#00150D"},children:"Troubleshoot"})});case"not-supported":return _jsxruntime.jsx.call(void 0, n,{title:"Passkeys Not Supported on This Device",appearance:t,content:_jsxruntime.jsx.call(void 0, "div",{children:"To access your wallet with a passkey, switch to a device or browser that supports passkeys, such as Chrome or Safari on a smartphone, tablet, or modern computer"}),primaryButton:_jsxruntime.jsx.call(void 0, c,{appearance:t,onClick:e.primaryActionOnClick,children:"Understood"})});default:return null}}var c=({appearance:e,onClick:t,children:s})=>{var l,r;return _jsxruntime.jsxs.call(void 0, "button",{className:_chunkWABJHG6Bcjs.a.call(void 0, "relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none"),style:{borderRadius:e==null?void 0:e.borderRadius,backgroundColor:(l=e==null?void 0:e.colors)==null?void 0:l.buttonBackground},onClick:t,children:[_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",style:{margin:"0px 32px",color:(r=e==null?void 0:e.colors)==null?void 0:r.textPrimary},children:s}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:s})]})};exports.a = R;
@@ -1 +1 @@
1
- import{a as e}from"./chunk-CNKSQE42.js";import{assertValidNFTCollectionViewProps as r,getNFTCollectionViewSrc as t}from"@crossmint/client-sdk-base";import{jsx as n}from"react/jsx-runtime";function w(o){r(o);let i=t(o,e);return n("iframe",{src:i,width:"100%",height:"100%",style:{flexGrow:"1",border:"none",margin:"0",padding:"0"},role:"nft-collection-view"})}export{w as a};
1
+ import{a as e}from"./chunk-DR6MFZ6K.js";import{assertValidNFTCollectionViewProps as r,getNFTCollectionViewSrc as t}from"@crossmint/client-sdk-base";import{jsx as n}from"react/jsx-runtime";function w(o){r(o);let i=t(o,e);return n("iframe",{src:i,width:"100%",height:"100%",style:{flexGrow:"1",border:"none",margin:"0",padding:"0"},role:"nft-collection-view"})}export{w as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkO5J2ZIJ6cjs = require('./chunk-O5J2ZIJ6.cjs');var _chunkX5BBXO27cjs = require('./chunk-X5BBXO27.cjs');var _chunkFRXIWXHUcjs = require('./chunk-FRXIWXHU.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _react = require('react');var _clientsdkbase = require('@crossmint/client-sdk-base');var _jsxruntime = require('react/jsx-runtime');function at(C){let c=C,{className:g,disabled:P,onClick:h,style:f,tabIndex:I,theme:S="dark",mintTo:B,emailTo:k,listingId:v,auctionId:Z,showOverlay:E=!0,mintConfig:b,whPassThroughArgs:M,environment:T,paymentMethod:t,preferredSigninMethod:x,dismissOverlayOnClick:N,prepay:R,locale:i="en-US",currency:L="usd",successCallbackURL:w="",failureCallbackURL:O="",loginEmail:U="",projectId:H,getButtonText:o,checkoutProps:a={experimental:!1,display:"same-tab",paymentMethods:["fiat","ETH","SOL"]}}=c,s=_chunk2WSEHVNPcjs.c.call(void 0, c,["className","disabled","onClick","style","tabIndex","theme","mintTo","emailTo","listingId","auctionId","showOverlay","mintConfig","whPassThroughArgs","environment","paymentMethod","preferredSigninMethod","dismissOverlayOnClick","prepay","locale","currency","successCallbackURL","failureCallbackURL","loginEmail","projectId","getButtonText","checkoutProps"]),_="clientId"in s?s.clientId:s.collectionId,[e,A]=_react.useState.call(void 0, !1),{isServerSideRendering:D}=_chunkX5BBXO27cjs.a.call(void 0, ),{connect:V}=_clientsdkbase.crossmintModalService.call(void 0, {clientId:_,projectId:H,showOverlay:E,dismissOverlayOnClick:N,setConnecting:A,libVersion:_chunkFRXIWXHUcjs.a,environment:T,clientName:_clientsdkbase.clientNames.reactUi,locale:i,currency:L,successCallbackURL:w,failureCallbackURL:O,loginEmail:U}),{getButtonText:$,handleClick:j}=_clientsdkbase.crossmintPayButtonService.call(void 0, {onClick:h,connecting:e,paymentMethod:t,locale:i,checkoutProps:a}),q=F=>j(F,()=>{V(b,B,k,v,M,t,x,R,a)}),n=_chunkO5J2ZIJ6cjs.b.call(void 0, _chunkO5J2ZIJ6cjs.a.call(void 0, S)),z=_react.useMemo.call(void 0, ()=>_jsxruntime.jsx.call(void 0, "span",{className:n.crossmintParagraph,role:"button-paragraph",children:o!=null?o(e,t||"fiat"):$(e)}),[e,o,t]);return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:!D&&_jsxruntime.jsxs.call(void 0, "button",{className:`${n.crossmintButton} ${g||""}`,disabled:P,onClick:q,style:_chunk2WSEHVNPcjs.a.call(void 0, {},f),tabIndex:I,children:[_jsxruntime.jsx.call(void 0, "img",{className:n.crossmintImg,src:"https://www.crossmint.io/assets/crossmint/logo.svg",alt:"Crossmint logo"}),z]})})}exports.a = at;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkO5J2ZIJ6cjs = require('./chunk-O5J2ZIJ6.cjs');var _chunkX5BBXO27cjs = require('./chunk-X5BBXO27.cjs');var _chunkOVONVFETcjs = require('./chunk-OVONVFET.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _react = require('react');var _clientsdkbase = require('@crossmint/client-sdk-base');var _jsxruntime = require('react/jsx-runtime');function at(C){let c=C,{className:g,disabled:P,onClick:h,style:f,tabIndex:I,theme:S="dark",mintTo:B,emailTo:k,listingId:v,auctionId:Z,showOverlay:E=!0,mintConfig:b,whPassThroughArgs:M,environment:T,paymentMethod:t,preferredSigninMethod:x,dismissOverlayOnClick:N,prepay:R,locale:i="en-US",currency:L="usd",successCallbackURL:w="",failureCallbackURL:O="",loginEmail:U="",projectId:H,getButtonText:o,checkoutProps:a={experimental:!1,display:"same-tab",paymentMethods:["fiat","ETH","SOL"]}}=c,s=_chunk2WSEHVNPcjs.c.call(void 0, c,["className","disabled","onClick","style","tabIndex","theme","mintTo","emailTo","listingId","auctionId","showOverlay","mintConfig","whPassThroughArgs","environment","paymentMethod","preferredSigninMethod","dismissOverlayOnClick","prepay","locale","currency","successCallbackURL","failureCallbackURL","loginEmail","projectId","getButtonText","checkoutProps"]),_="clientId"in s?s.clientId:s.collectionId,[e,A]=_react.useState.call(void 0, !1),{isServerSideRendering:D}=_chunkX5BBXO27cjs.a.call(void 0, ),{connect:V}=_clientsdkbase.crossmintModalService.call(void 0, {clientId:_,projectId:H,showOverlay:E,dismissOverlayOnClick:N,setConnecting:A,libVersion:_chunkOVONVFETcjs.a,environment:T,clientName:_clientsdkbase.clientNames.reactUi,locale:i,currency:L,successCallbackURL:w,failureCallbackURL:O,loginEmail:U}),{getButtonText:$,handleClick:j}=_clientsdkbase.crossmintPayButtonService.call(void 0, {onClick:h,connecting:e,paymentMethod:t,locale:i,checkoutProps:a}),q=F=>j(F,()=>{V(b,B,k,v,M,t,x,R,a)}),n=_chunkO5J2ZIJ6cjs.b.call(void 0, _chunkO5J2ZIJ6cjs.a.call(void 0, S)),z=_react.useMemo.call(void 0, ()=>_jsxruntime.jsx.call(void 0, "span",{className:n.crossmintParagraph,role:"button-paragraph",children:o!=null?o(e,t||"fiat"):$(e)}),[e,o,t]);return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:!D&&_jsxruntime.jsxs.call(void 0, "button",{className:`${n.crossmintButton} ${g||""}`,disabled:P,onClick:q,style:_chunk2WSEHVNPcjs.a.call(void 0, {},f),tabIndex:I,children:[_jsxruntime.jsx.call(void 0, "img",{className:n.crossmintImg,src:"https://www.crossmint.io/assets/crossmint/logo.svg",alt:"Crossmint logo"}),z]})})}exports.a = at;
@@ -0,0 +1,2 @@
1
+ import{a as D}from"./chunk-GGUEHZAY.js";import{a as H}from"./chunk-D6KA2HLB.js";import{a as A}from"./chunk-EMXNIC4M.js";import{a as R,b as G,c as L}from"./chunk-VHNBXIOC.js";import{d as F}from"./chunk-PXDN3KFO.js";import{useState as l}from"react";import{jsx as t,jsxs as r}from"react/jsx-runtime";function X({phone:U,onSubmitOTP:_,onResendCode:d,appearance:o}){var f,g,y,P,h,c,v,k,b,T,e,O,C,I,S,B,E,N;let[u,M]=l(""),[$,m]=l(!1),[j,n]=l(!1),[x,i]=l(null),q=()=>F(this,null,function*(){n(!0);try{yield _(u),m(!1),i(null)}catch(s){console.error("Error confirming recovery key OTP",s),i("Invalid code. Please try again."),m(!0)}finally{n(!1)}});return r("div",{className:"flex flex-col items-center justify-start w-full",children:[t("div",{className:"relative left-3",children:t(H,{customAccentColor:(f=o==null?void 0:o.colors)==null?void 0:f.accent,customButtonBackgroundColor:(g=o==null?void 0:o.colors)==null?void 0:g.buttonBackground,customBackgroundColor:(y=o==null?void 0:o.colors)==null?void 0:y.background})}),t("p",{className:"text-base font-normal mt-4 mb-1 text-center text-cm-text-primary",style:{color:(P=o==null?void 0:o.colors)==null?void 0:P.textPrimary},children:"Check your phone"}),r("p",{className:"text-center text-cm-text-secondary px-4",style:{color:(h=o==null?void 0:o.colors)==null?void 0:h.textSecondary},children:["A temporary login code has been sent to ",U]}),t("div",{className:"py-8",children:t(R,{maxLength:9,value:u,onChange:s=>{M(s),m(!1),i(null)},onComplete:q,disabled:j,customStyles:{accent:(v=(c=o==null?void 0:o.colors)==null?void 0:c.accent)!=null?v:"#04AA6D",danger:(b=(k=o==null?void 0:o.colors)==null?void 0:k.danger)!=null?b:"#f44336",border:(e=(T=o==null?void 0:o.colors)==null?void 0:T.border)!=null?e:"#E5E7EB",textPrimary:(C=(O=o==null?void 0:o.colors)==null?void 0:O.textPrimary)!=null?C:"#909ca3",buttonBackground:(S=(I=o==null?void 0:o.colors)==null?void 0:I.buttonBackground)!=null?S:"#eff6ff",inputBackground:(E=(B=o==null?void 0:o.colors)==null?void 0:B.inputBackground)!=null?E:"#FFFFFF",borderRadius:o==null?void 0:o.borderRadius},children:t(G,{children:Array.from({length:9}).map((s,w)=>t(L,{index:w,hasError:$,className:"max-sm:w-7 max-sm:h-11 max-sm:text-xl max-sm:mx-0 h-12 w-9"},w))})})}),x&&t("div",{className:"text-sm text-red-500 mb-4",children:x}),t("div",{className:"text-xs leading-tight text-cm-text-secondary text-center",children:r("span",{style:{color:(N=o==null?void 0:o.colors)==null?void 0:N.textSecondary},children:["Didn't receive the SMS? Check your signal.",`
2
+ `,"Some messages may take several minutes to arrive."]})}),d&&t(A,{initialSeconds:60,appearance:o,countdownText:s=>`Re-send code in ${s}s`,countdownCompleteText:"Re-send code",handleOnClick:d})]})}export{X as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _jsxruntime = require('react/jsx-runtime');function s({customAccentColor:c,customButtonBackgroundColor:i,customBackgroundColor:e}){let o=c||"#04AA6D",l=i||"#eff6ff",r=e||"#FFFFFF";return _jsxruntime.jsx.call(void 0, "div",{className:"relative",children:_jsxruntime.jsxs.call(void 0, "svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[_jsxruntime.jsx.call(void 0, "circle",{cx:"40",cy:"40",r:"40",fill:r}),_jsxruntime.jsx.call(void 0, "rect",{x:"25",y:"15",width:"30",height:"50",rx:"4",fill:l,stroke:o,strokeWidth:"2"}),_jsxruntime.jsx.call(void 0, "rect",{x:"27",y:"17",width:"26",height:"46",rx:"2",fill:r}),_jsxruntime.jsx.call(void 0, "rect",{x:"32",y:"25",width:"16",height:"8",rx:"4",fill:o}),_jsxruntime.jsx.call(void 0, "circle",{cx:"36",cy:"29",r:"1",fill:r}),_jsxruntime.jsx.call(void 0, "circle",{cx:"40",cy:"29",r:"1",fill:r}),_jsxruntime.jsx.call(void 0, "circle",{cx:"44",cy:"29",r:"1",fill:r}),_jsxruntime.jsx.call(void 0, "rect",{x:"35",y:"45",width:"10",height:"2",rx:"1",fill:o}),_jsxruntime.jsx.call(void 0, "path",{d:"M55 30 Q60 30 60 35",stroke:o,strokeWidth:"2",fill:"none"}),_jsxruntime.jsx.call(void 0, "path",{d:"M55 35 Q62 35 62 40",stroke:o,strokeWidth:"2",fill:"none"}),_jsxruntime.jsx.call(void 0, "path",{d:"M55 40 Q64 40 64 45",stroke:o,strokeWidth:"2",fill:"none"})]})})}exports.a = s;
@@ -0,0 +1 @@
1
+ import{jsx as t,jsxs as n}from"react/jsx-runtime";function d({customAccentColor:c,customButtonBackgroundColor:i,customBackgroundColor:e}){let o=c||"#04AA6D",l=i||"#eff6ff",r=e||"#FFFFFF";return t("div",{className:"relative",children:n("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("circle",{cx:"40",cy:"40",r:"40",fill:r}),t("rect",{x:"25",y:"15",width:"30",height:"50",rx:"4",fill:l,stroke:o,strokeWidth:"2"}),t("rect",{x:"27",y:"17",width:"26",height:"46",rx:"2",fill:r}),t("rect",{x:"32",y:"25",width:"16",height:"8",rx:"4",fill:o}),t("circle",{cx:"36",cy:"29",r:"1",fill:r}),t("circle",{cx:"40",cy:"29",r:"1",fill:r}),t("circle",{cx:"44",cy:"29",r:"1",fill:r}),t("rect",{x:"35",y:"45",width:"10",height:"2",rx:"1",fill:o}),t("path",{d:"M55 30 Q60 30 60 35",stroke:o,strokeWidth:"2",fill:"none"}),t("path",{d:"M55 35 Q62 35 62 40",stroke:o,strokeWidth:"2",fill:"none"}),t("path",{d:"M55 40 Q64 40 64 45",stroke:o,strokeWidth:"2",fill:"none"})]})})}export{d as a};
@@ -0,0 +1 @@
1
+ var s="2.2.15";var r=s;export{r as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFYCKQBCIcjs = require('./chunk-FYCKQBCI.cjs');var _react = require('react');function i(){let t=_react.useContext.call(void 0, _chunkFYCKQBCIcjs.c);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t}exports.a = i;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIYOY7DV2cjs = require('./chunk-IYOY7DV2.cjs');var _react = require('react');function i(){let t=_react.useContext.call(void 0, _chunkIYOY7DV2cjs.c);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t}exports.a = i;
@@ -1 +1 @@
1
- import{v as o}from"./chunk-YWAEP7EZ.js";import{jsx as m}from"react/jsx-runtime";function d(){return m(o,{className:"w-full"})}export{d as a};
1
+ import{v as o}from"./chunk-LWX23VQI.js";import{jsx as m}from"react/jsx-runtime";function d(){return m(o,{className:"w-full"})}export{d as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var s="2.2.14";var c=s;exports.a = c;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var t=9;exports.a = t;
@@ -0,0 +1 @@
1
+ var T=9;export{T as a};
@@ -1 +1 @@
1
- import{a as b}from"./chunk-HVZ5M3FY.js";import{a as m}from"./chunk-OOLXYAO7.js";import{a as C}from"./chunk-77PBG2JJ.js";import{a as g,e as k,h}from"./chunk-UDQUVZUQ.js";import{a as x}from"./chunk-XB3VAPRK.js";import{a as v}from"./chunk-NBJIJZGO.js";import{VisuallyHidden as P}from"@radix-ui/react-visually-hidden";import{Fragment as N,jsx as o,jsxs as i}from"react/jsx-runtime";function n({title:e,content:t,primaryButton:s,secondaryAction:l,appearance:r}){var u,a,y,f;return o(g,{modal:!1,open:!0,onOpenChange:()=>{},children:i(k,{showCloseButton:!1,onInteractOutside:d=>d.preventDefault(),onOpenAutoFocus:d=>d.preventDefault(),className:"!p-0 !min-[480px]:p-0",style:{borderRadius:r==null?void 0:r.borderRadius,backgroundColor:(u=r==null?void 0:r.colors)==null?void 0:u.background},children:[o(P,{asChild:!0,children:o(h,{children:e})}),i("div",{className:"relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none",children:[o("div",{className:"flex justify-center left-1.5 relative",children:o(b,{appearance:r})}),o("div",{className:"flex justify-center",children:o("p",{style:{fontSize:"1.125rem",lineHeight:"1.75rem",fontWeight:"bold",color:((a=r==null?void 0:r.colors)==null?void 0:a.textPrimary)||"#20343E"},children:e})}),o("div",{className:"mb-6",children:o("div",{style:{fontWeight:"normal",color:((y=r==null?void 0:r.colors)==null?void 0:y.textSecondary)||"#67797F"},children:t})}),i("div",{className:"flex flex-col gap-4 justify-center",children:[s,l]}),o("div",{className:"flex justify-center pt-4",children:o(x,{color:(f=r==null?void 0:r.colors)==null?void 0:f.textSecondary})})]})]})})}function F({state:e,appearance:t}){var s,l;switch(e.type){case"create-wallet":return o(n,{title:"Create Your Wallet",appearance:t,content:i(N,{children:[o("div",{className:"mb-3",children:"You're about to create a wallet."}),i("div",{className:"flex flex-col gap-2",children:[i("div",{className:"flex gap-2",children:[o("div",{children:o(C,{})}),"Your wallet will be secured with a passkey"]}),i("div",{className:"flex gap-2",children:[o("div",{children:o(m,{})}),"Your device will ask you for your fingerprint, face, or screen lock to set it up"]})]})]}),primaryButton:o(c,{appearance:t,onClick:e.primaryActionOnClick,children:"Create Wallet"})});case"create-wallet-error":return o(n,{title:"Wallet Creation Failed",appearance:t,content:o("div",{children:"We couldn't create your wallet. This could be due to rejecting the request, a timeout, or not having access to your passkey on this device."}),primaryButton:o(c,{appearance:t,onClick:e.primaryActionOnClick,children:"Try again"})});case"transaction":return o(n,{title:"Use Your Wallet",appearance:t,content:o("div",{className:"flex flex-col gap-2",children:i("div",{className:"flex gap-2",children:[o("div",{children:o(m,{})}),o("span",{children:"Your device will ask you for your fingerprint, face, or screen lock to authorize this action."})]})}),primaryButton:o(c,{appearance:t,onClick:e.primaryActionOnClick,children:"Use Wallet"})});case"transaction-error":return o(n,{title:"Wallet Access Failed",appearance:t,content:o("div",{children:"We couldn't access your wallet. This could be due to rejecting the request, a timeout, or not having access to your passkey on this device."}),primaryButton:o(c,{appearance:t,onClick:e.primaryActionOnClick,children:"Try again"}),secondaryAction:o("a",{href:"https://docs.crossmint.com/wallets/smart-wallets/users/troubleshoot",rel:"noopener noreferrer",target:"_blank",style:{padding:"0.875rem",width:"100%",textAlign:"center",textDecoration:"none",borderRadius:"0.5rem",fontWeight:"bold",backgroundColor:((s=t==null?void 0:t.colors)==null?void 0:s.inputBackground)||"#F0F2F4",color:((l=t==null?void 0:t.colors)==null?void 0:l.textSecondary)||"#00150D"},children:"Troubleshoot"})});case"not-supported":return o(n,{title:"Passkeys Not Supported on This Device",appearance:t,content:o("div",{children:"To access your wallet with a passkey, switch to a device or browser that supports passkeys, such as Chrome or Safari on a smartphone, tablet, or modern computer"}),primaryButton:o(c,{appearance:t,onClick:e.primaryActionOnClick,children:"Understood"})});default:return null}}var c=({appearance:e,onClick:t,children:s})=>{var l,r;return i("button",{className:v("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none"),style:{borderRadius:e==null?void 0:e.borderRadius,backgroundColor:(l=e==null?void 0:e.colors)==null?void 0:l.buttonBackground},onClick:t,children:[o("span",{className:"font-medium",style:{margin:"0px 32px",color:(r=e==null?void 0:e.colors)==null?void 0:r.textPrimary},children:s}),o("span",{className:"sr-only",children:s})]})};export{F as a};
1
+ import{a as C}from"./chunk-77PBG2JJ.js";import{a as b}from"./chunk-HVZ5M3FY.js";import{a as m}from"./chunk-OOLXYAO7.js";import{a as g,e as k,h}from"./chunk-UDQUVZUQ.js";import{a as x}from"./chunk-XB3VAPRK.js";import{a as v}from"./chunk-NBJIJZGO.js";import{VisuallyHidden as P}from"@radix-ui/react-visually-hidden";import{Fragment as N,jsx as o,jsxs as i}from"react/jsx-runtime";function n({title:e,content:t,primaryButton:s,secondaryAction:l,appearance:r}){var u,a,y,f;return o(g,{modal:!1,open:!0,onOpenChange:()=>{},children:i(k,{showCloseButton:!1,onInteractOutside:d=>d.preventDefault(),onOpenAutoFocus:d=>d.preventDefault(),className:"!p-0 !min-[480px]:p-0",style:{borderRadius:r==null?void 0:r.borderRadius,backgroundColor:(u=r==null?void 0:r.colors)==null?void 0:u.background},children:[o(P,{asChild:!0,children:o(h,{children:e})}),i("div",{className:"relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none",children:[o("div",{className:"flex justify-center left-1.5 relative",children:o(b,{appearance:r})}),o("div",{className:"flex justify-center",children:o("p",{style:{fontSize:"1.125rem",lineHeight:"1.75rem",fontWeight:"bold",color:((a=r==null?void 0:r.colors)==null?void 0:a.textPrimary)||"#20343E"},children:e})}),o("div",{className:"mb-6",children:o("div",{style:{fontWeight:"normal",color:((y=r==null?void 0:r.colors)==null?void 0:y.textSecondary)||"#67797F"},children:t})}),i("div",{className:"flex flex-col gap-4 justify-center",children:[s,l]}),o("div",{className:"flex justify-center pt-4",children:o(x,{color:(f=r==null?void 0:r.colors)==null?void 0:f.textSecondary})})]})]})})}function F({state:e,appearance:t}){var s,l;switch(e.type){case"create-wallet":return o(n,{title:"Create Your Wallet",appearance:t,content:i(N,{children:[o("div",{className:"mb-3",children:"You're about to create a wallet."}),i("div",{className:"flex flex-col gap-2",children:[i("div",{className:"flex gap-2",children:[o("div",{children:o(C,{})}),"Your wallet will be secured with a passkey"]}),i("div",{className:"flex gap-2",children:[o("div",{children:o(m,{})}),"Your device will ask you for your fingerprint, face, or screen lock to set it up"]})]})]}),primaryButton:o(c,{appearance:t,onClick:e.primaryActionOnClick,children:"Create Wallet"})});case"create-wallet-error":return o(n,{title:"Wallet Creation Failed",appearance:t,content:o("div",{children:"We couldn't create your wallet. This could be due to rejecting the request, a timeout, or not having access to your passkey on this device."}),primaryButton:o(c,{appearance:t,onClick:e.primaryActionOnClick,children:"Try again"})});case"transaction":return o(n,{title:"Use Your Wallet",appearance:t,content:o("div",{className:"flex flex-col gap-2",children:i("div",{className:"flex gap-2",children:[o("div",{children:o(m,{})}),o("span",{children:"Your device will ask you for your fingerprint, face, or screen lock to authorize this action."})]})}),primaryButton:o(c,{appearance:t,onClick:e.primaryActionOnClick,children:"Use Wallet"})});case"transaction-error":return o(n,{title:"Wallet Access Failed",appearance:t,content:o("div",{children:"We couldn't access your wallet. This could be due to rejecting the request, a timeout, or not having access to your passkey on this device."}),primaryButton:o(c,{appearance:t,onClick:e.primaryActionOnClick,children:"Try again"}),secondaryAction:o("a",{href:"https://docs.crossmint.com/wallets/smart-wallets/users/troubleshoot",rel:"noopener noreferrer",target:"_blank",style:{padding:"0.875rem",width:"100%",textAlign:"center",textDecoration:"none",borderRadius:"0.5rem",fontWeight:"bold",backgroundColor:((s=t==null?void 0:t.colors)==null?void 0:s.inputBackground)||"#F0F2F4",color:((l=t==null?void 0:t.colors)==null?void 0:l.textSecondary)||"#00150D"},children:"Troubleshoot"})});case"not-supported":return o(n,{title:"Passkeys Not Supported on This Device",appearance:t,content:o("div",{children:"To access your wallet with a passkey, switch to a device or browser that supports passkeys, such as Chrome or Safari on a smartphone, tablet, or modern computer"}),primaryButton:o(c,{appearance:t,onClick:e.primaryActionOnClick,children:"Understood"})});default:return null}}var c=({appearance:e,onClick:t,children:s})=>{var l,r;return i("button",{className:v("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none"),style:{borderRadius:e==null?void 0:e.borderRadius,backgroundColor:(l=e==null?void 0:e.colors)==null?void 0:l.buttonBackground},onClick:t,children:[o("span",{className:"font-medium",style:{margin:"0px 32px",color:(r=e==null?void 0:e.colors)==null?void 0:r.textPrimary},children:s}),o("span",{className:"sr-only",children:s})]})};export{F as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZ2FGFHRQcjs = require('./chunk-Z2FGFHRQ.cjs');var _chunkWABJHG6Bcjs = require('./chunk-WABJHG6B.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function L({phone:r,onConfirm:v,onCancel:C,appearance:t}){var m,c,f;let[e,i]=_react.useState.call(void 0, !1),[l,y]=_react.useState.call(void 0, ""),g=()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){i(!0);try{yield v(r)}catch(w){console.error("Error sending authorization code:",w),y("Failed to send code. Please try again.")}finally{i(!1)}}),b=((m=t==null?void 0:t.colors)==null?void 0:m.accent)||"#4CAF50",n=((c=t==null?void 0:t.colors)==null?void 0:c.textPrimary)||"#000000",d=((f=t==null?void 0:t.colors)==null?void 0:f.border)||"#E0E0E0";return _jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col w-full max-w-md mx-auto rounded-xl",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"mb-2",style:{color:n},children:"Send authorization code to"}),_jsxruntime.jsx.call(void 0, "div",{className:"w-full mb-8 p-4 rounded-xl border",style:{borderColor:d},children:_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center",children:[_jsxruntime.jsx.call(void 0, "div",{className:"flex-shrink-0 mr-3",children:_jsxruntime.jsx.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-phone",children:_jsxruntime.jsx.call(void 0, "path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"})})}),_jsxruntime.jsx.call(void 0, "span",{style:{color:n},children:r})]})}),l&&_jsxruntime.jsx.call(void 0, "div",{className:"text-red-500 mb-4 text-sm",children:l}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex gap-3",children:[_jsxruntime.jsx.call(void 0, "button",{onClick:C,className:"flex-1 py-4 px-6 border rounded-full text-center font-medium",style:{borderColor:d},children:"Cancel"}),_jsxruntime.jsx.call(void 0, "button",{onClick:g,disabled:e,className:_chunkWABJHG6Bcjs.a.call(void 0, "flex-1 py-4 px-6 rounded-full text-white text-center font-medium",e?"opacity-70":""),style:{backgroundColor:b},children:e?_jsxruntime.jsx.call(void 0, "div",{className:"flex justify-center items-center",children:_jsxruntime.jsx.call(void 0, _chunkZ2FGFHRQcjs.a,{style:{color:"white"}})}):"Send code"})]})]})}exports.a = L;
@@ -1 +1 @@
1
- import{a}from"./chunk-7ES6Y5N6.js";import{d as u}from"./chunk-YWAEP7EZ.js";import{a as l,b as s,c as m}from"./chunk-PXDN3KFO.js";import{useEffect as p}from"react";import{useCrossmint as d}from"@crossmint/client-sdk-react-base";import{jsx as f}from"react/jsx-runtime";function h({children:o}){let{experimental_setCustomAuth:r,experimental_customAuth:e}=d(),{user:t,jwt:n,experimental_externalWalletSigner:i}=a();return p(()=>{n==null&&(e==null?void 0:e.jwt)!=null&&r(void 0),i!=null||(t==null?void 0:t.email)!=null?r({jwt:n,email:t==null?void 0:t.email,externalWalletSigner:i}):r({jwt:n})},[i,n,t]),o}function S(e){var t=e,{children:o}=t,r=m(t,["children"]);return f(u,s(l({},r),{children:f(h,{children:o})}))}export{S as a};
1
+ import{a}from"./chunk-JK2MXIJK.js";import{d as u}from"./chunk-LWX23VQI.js";import{a as l,b as s,c as m}from"./chunk-PXDN3KFO.js";import{useEffect as p}from"react";import{useCrossmint as d}from"@crossmint/client-sdk-react-base";import{jsx as f}from"react/jsx-runtime";function h({children:o}){let{experimental_setCustomAuth:r,experimental_customAuth:e}=d(),{user:t,jwt:n,experimental_externalWalletSigner:i}=a();return p(()=>{n==null&&(e==null?void 0:e.jwt)!=null&&r(void 0),i!=null||(t==null?void 0:t.email)!=null?r({jwt:n,email:t==null?void 0:t.email,externalWalletSigner:i}):r({jwt:n})},[i,n,t]),o}function S(e){var t=e,{children:o}=t,r=m(t,["children"]);return f(u,s(l({},r),{children:f(h,{children:o})}))}export{S as a};
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkPZ3KXKJDcjs = require('./chunk-PZ3KXKJD.cjs');var _chunkBR77Q3PKcjs = require('./chunk-BR77Q3PK.cjs');var _chunkAHD64NAJcjs = require('./chunk-AHD64NAJ.cjs');var _chunkZBQCXWMDcjs = require('./chunk-ZBQCXWMD.cjs');var _chunkTXOVDTYKcjs = require('./chunk-TXOVDTYK.cjs');var _chunkHG5ML6KXcjs = require('./chunk-HG5ML6KX.cjs');var _chunkZ2FGFHRQcjs = require('./chunk-Z2FGFHRQ.cjs');var _chunkWMBBIP2Ccjs = require('./chunk-WMBBIP2C.cjs');var _chunkDCACW4K6cjs = require('./chunk-DCACW4K6.cjs');var _chunkHLGNSXEQcjs = require('./chunk-HLGNSXEQ.cjs');var _chunkX4BUSZRJcjs = require('./chunk-X4BUSZRJ.cjs');var _chunkWABJHG6Bcjs = require('./chunk-WABJHG6B.cjs');var _chunkYXF74MVIcjs = require('./chunk-YXF74MVI.cjs');var _chunkI4GMMHQRcjs = require('./chunk-I4GMMHQR.cjs');var _chunkSRQAQHYKcjs = require('./chunk-SRQAQHYK.cjs');var _chunkE65EGG73cjs = require('./chunk-E65EGG73.cjs');var _chunkTM7WDKYRcjs = require('./chunk-TM7WDKYR.cjs');var _chunkNRN4WNQLcjs = require('./chunk-NRN4WNQL.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _reactvisuallyhidden = require('@radix-ui/react-visually-hidden');var _react = require('react');var _commonsdkauth = require('@crossmint/common-sdk-auth');var _clientsdkauth = require('@crossmint/client-sdk-auth');var _commonsdkbase = require('@crossmint/common-sdk-base');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');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);var _jsxruntime = require('react/jsx-runtime');function Po({children:e,enabled:o,onSdkLoaded:r,onWalletConnected:t,jwt:n}){let{primaryWallet:i,sdkHasLoaded:l,removeWallet:s,handleUnlinkWallet:c}=_sdkreactcore.useDynamicContext.call(void 0, ),m=!o||l;return _react.useEffect.call(void 0, ()=>{m&&(r==null||r(m))},[m,r]),_react.useEffect.call(void 0, ()=>{n==null&&m&&i!=null&&(s(i.id),c(i.id))},[n,m,i,s,c]),_react.useEffect.call(void 0, ()=>{function x(){return _chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){try{if(_ethereum.isEthereumWallet.call(void 0, i)){let u=yield i.getWalletClient(),a={type:"external-wallet",address:u.account.address,viemAccount:_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {},u.account),{signMessage:d=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){return yield u.signMessage({message:d.message})})})};t(a)}else if(_solana.isSolanaWallet.call(void 0, i)){let u=yield i.getSigner(),a={type:"external-wallet",address:i.address,onSignTransaction:d=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){return yield u.signTransaction(d)})};t(a)}else throw new Error("Unsupported wallet type")}catch(u){throw console.error("Failed to get admin signer",u),new Error("Failed to get admin signer")}})}i!=null&&n!=null&&x()},[i,n,t]),e}function jt({children:e,enabled:o=!0,apiKeyEnvironment:r,loginMethods:t=["web3"],appearance:n,onSdkLoaded:i,onWalletConnected:l}){var u,a;let{crossmintAuth:s,jwt:c}=L(),m=_react.useMemo.call(void 0, ()=>{var d,f;return`.powered-by-dynamic { display: none !important; }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkBR77Q3PKcjs = require('./chunk-BR77Q3PK.cjs');var _chunkPZ3KXKJDcjs = require('./chunk-PZ3KXKJD.cjs');var _chunkAHD64NAJcjs = require('./chunk-AHD64NAJ.cjs');var _chunkZBQCXWMDcjs = require('./chunk-ZBQCXWMD.cjs');var _chunkTXOVDTYKcjs = require('./chunk-TXOVDTYK.cjs');var _chunkYXF74MVIcjs = require('./chunk-YXF74MVI.cjs');var _chunkSRQAQHYKcjs = require('./chunk-SRQAQHYK.cjs');var _chunkE65EGG73cjs = require('./chunk-E65EGG73.cjs');var _chunkTM7WDKYRcjs = require('./chunk-TM7WDKYR.cjs');var _chunkHLGNSXEQcjs = require('./chunk-HLGNSXEQ.cjs');var _chunkHG5ML6KXcjs = require('./chunk-HG5ML6KX.cjs');var _chunkZ2FGFHRQcjs = require('./chunk-Z2FGFHRQ.cjs');var _chunkWMBBIP2Ccjs = require('./chunk-WMBBIP2C.cjs');var _chunkDCACW4K6cjs = require('./chunk-DCACW4K6.cjs');var _chunkWABJHG6Bcjs = require('./chunk-WABJHG6B.cjs');var _chunkI4GMMHQRcjs = require('./chunk-I4GMMHQR.cjs');var _chunkX4BUSZRJcjs = require('./chunk-X4BUSZRJ.cjs');var _chunkNRN4WNQLcjs = require('./chunk-NRN4WNQL.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _reactvisuallyhidden = require('@radix-ui/react-visually-hidden');var _react = require('react');var _commonsdkauth = require('@crossmint/common-sdk-auth');var _clientsdkauth = require('@crossmint/client-sdk-auth');var _commonsdkbase = require('@crossmint/common-sdk-base');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');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);var _jsxruntime = require('react/jsx-runtime');function Po({children:e,enabled:o,onSdkLoaded:r,onWalletConnected:t,jwt:n}){let{primaryWallet:i,sdkHasLoaded:l,removeWallet:s,handleUnlinkWallet:c}=_sdkreactcore.useDynamicContext.call(void 0, ),m=!o||l;return _react.useEffect.call(void 0, ()=>{m&&(r==null||r(m))},[m,r]),_react.useEffect.call(void 0, ()=>{n==null&&m&&i!=null&&(s(i.id),c(i.id))},[n,m,i,s,c]),_react.useEffect.call(void 0, ()=>{function x(){return _chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){try{if(_ethereum.isEthereumWallet.call(void 0, i)){let u=yield i.getWalletClient(),a={type:"external-wallet",address:u.account.address,viemAccount:_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {},u.account),{signMessage:d=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){return yield u.signMessage({message:d.message})})})};t(a)}else if(_solana.isSolanaWallet.call(void 0, i)){let u=yield i.getSigner(),a={type:"external-wallet",address:i.address,onSignTransaction:d=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){return yield u.signTransaction(d)})};t(a)}else throw new Error("Unsupported wallet type")}catch(u){throw console.error("Failed to get admin signer",u),new Error("Failed to get admin signer")}})}i!=null&&n!=null&&x()},[i,n,t]),e}function jt({children:e,enabled:o=!0,apiKeyEnvironment:r,loginMethods:t=["web3"],appearance:n,onSdkLoaded:i,onWalletConnected:l}){var u,a;let{crossmintAuth:s,jwt:c}=L(),m=_react.useMemo.call(void 0, ()=>{var d,f;return`.powered-by-dynamic { display: none !important; }
2
2
  .wallet-list__scroll-container { padding: 0px !important; }
3
3
  .wallet-list__search-container { padding-left: 0px !important; padding-right: 0px !important; }
4
4
  .dynamic-footer { display: none !important; }
@@ -1 +1 @@
1
- import{c as e}from"./chunk-YWAEP7EZ.js";import{useContext as o}from"react";function h(){let t=o(e);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t}export{h as a};
1
+ import{c as e}from"./chunk-LWX23VQI.js";import{useContext as o}from"react";function h(){let t=o(e);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t}export{h as a};
@@ -0,0 +1,2 @@
1
+ import{a as U}from"./chunk-GGUEHZAY.js";import{a as A}from"./chunk-EMXNIC4M.js";import{a as R,b as G,c as L}from"./chunk-VHNBXIOC.js";import{a as H}from"./chunk-C3JRTLQP.js";import{d as F}from"./chunk-PXDN3KFO.js";import{useState as l}from"react";import{jsx as t,jsxs as r}from"react/jsx-runtime";function X({email:_,onSubmitOTP:D,onResendCode:d,appearance:o}){var f,y,g,P,c,k,v,b,T,h,O,C,E,I,B,e,N,S;let[u,$]=l(""),[j,m]=l(!1),[q,n]=l(!1),[x,i]=l(null),z=()=>F(this,null,function*(){n(!0);try{yield D(u),m(!1),i(null)}catch(s){console.error("Error confirming recovery key OTP",s),i("Invalid code. Please try again."),m(!0)}finally{n(!1)}});return r("div",{className:"flex flex-col items-center justify-start w-full",children:[t("div",{className:"relative left-3",children:t(H,{customAccentColor:(f=o==null?void 0:o.colors)==null?void 0:f.accent,customButtonBackgroundColor:(y=o==null?void 0:o.colors)==null?void 0:y.buttonBackground,customBackgroundColor:(g=o==null?void 0:o.colors)==null?void 0:g.background})}),t("p",{className:"text-base font-normal mt-4 mb-1 text-center text-cm-text-primary",style:{color:(P=o==null?void 0:o.colors)==null?void 0:P.textPrimary},children:"Check your email"}),r("p",{className:"text-center text-cm-text-secondary px-4",style:{color:(c=o==null?void 0:o.colors)==null?void 0:c.textSecondary},children:["A temporary login code has been sent to ",_]}),t("div",{className:"py-8",children:t(R,{maxLength:9,value:u,onChange:s=>{$(s),m(!1),i(null)},onComplete:z,disabled:q,customStyles:{accent:(v=(k=o==null?void 0:o.colors)==null?void 0:k.accent)!=null?v:"#04AA6D",danger:(T=(b=o==null?void 0:o.colors)==null?void 0:b.danger)!=null?T:"#f44336",border:(O=(h=o==null?void 0:o.colors)==null?void 0:h.border)!=null?O:"#E5E7EB",textPrimary:(E=(C=o==null?void 0:o.colors)==null?void 0:C.textPrimary)!=null?E:"#909ca3",buttonBackground:(B=(I=o==null?void 0:o.colors)==null?void 0:I.buttonBackground)!=null?B:"#eff6ff",inputBackground:(N=(e=o==null?void 0:o.colors)==null?void 0:e.inputBackground)!=null?N:"#FFFFFF",borderRadius:o==null?void 0:o.borderRadius},children:t(G,{children:Array.from({length:9}).map((s,w)=>t(L,{index:w,hasError:j,className:"max-sm:w-7 max-sm:h-11 max-sm:text-xl max-sm:mx-0 h-12 w-9"},w))})})}),x&&t("div",{className:"text-sm text-red-500 mb-4",children:x}),t("div",{className:"text-xs leading-tight text-cm-text-secondary text-center",children:r("span",{style:{color:(S=o==null?void 0:o.colors)==null?void 0:S.textSecondary},children:["Can't find the email? Check spam folder.",`
2
+ `,"Some emails may take several minutes to arrive."]})}),d&&t(A,{initialSeconds:60,appearance:o,countdownText:s=>`Re-send code in ${s}s`,countdownCompleteText:"Re-send code",handleOnClick:d})]})}export{X as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk56YL3XJWcjs = require('./chunk-56YL3XJW.cjs');var _chunkTIMWFXI5cjs = require('./chunk-TIMWFXI5.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _clientsdkbase = require('@crossmint/client-sdk-base');var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function z(d){let[f,h]=_react.useState.call(void 0, !1),{crossmint:k}=_clientsdkreactbase.useCrossmint.call(void 0, ),y=_chunkTIMWFXI5cjs.a.call(void 0, k),c=d,{recipient:P,locale:g,lineItems:H,payment:S,appearance:V,metadata:v}=c,b=_chunk2WSEHVNPcjs.c.call(void 0, c,["recipient","locale","lineItems","payment","appearance","metadata"]),n={recipient:P,locale:g,lineItems:H,payment:S,appearance:V,metadata:v},x=_clientsdkbase.crossmintHostedCheckoutV3Service.call(void 0, {apiClient:y,hostedCheckoutProps:n}),t=_clientsdkbase.crossmintHostedCheckoutV3StylesService.call(void 0, n),p=b,{onClick:r,className:E,children:o}=p,I=_chunk2WSEHVNPcjs.c.call(void 0, p,["onClick","className","children"]);function B(e){e.preventDefault(),e.stopPropagation(),x.createWindow(),r&&r(e)}let i=t.generateCss();return _react.useEffect.call(void 0, ()=>{let{cleanup:e}=t.injectCss(i);return h(!0),e},[i]),f?_jsxruntime.jsxs.call(void 0, "button",_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {onClick:B,className:_clsx2.default.call(void 0, t.identifiers.buttonClassNames,E)},I),{children:[_jsxruntime.jsx.call(void 0, _chunk56YL3XJWcjs.a,{style:{marginRight:"12px",flex:"none"},displayType:"icon-only",id:t.identifiers.logoId,height:16,width:16}),o!=null?o:_jsxruntime.jsx.call(void 0, "p",{style:{margin:0},children:t.getButtonText()})]})):null}exports.a = z;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk56YL3XJWcjs = require('./chunk-56YL3XJW.cjs');var _chunkAY5XZILBcjs = require('./chunk-AY5XZILB.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _clientsdkbase = require('@crossmint/client-sdk-base');var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function z(d){let[f,h]=_react.useState.call(void 0, !1),{crossmint:k}=_clientsdkreactbase.useCrossmint.call(void 0, ),y=_chunkAY5XZILBcjs.a.call(void 0, k),c=d,{recipient:P,locale:g,lineItems:H,payment:S,appearance:V,metadata:v}=c,b=_chunk2WSEHVNPcjs.c.call(void 0, c,["recipient","locale","lineItems","payment","appearance","metadata"]),n={recipient:P,locale:g,lineItems:H,payment:S,appearance:V,metadata:v},x=_clientsdkbase.crossmintHostedCheckoutV3Service.call(void 0, {apiClient:y,hostedCheckoutProps:n}),t=_clientsdkbase.crossmintHostedCheckoutV3StylesService.call(void 0, n),p=b,{onClick:r,className:E,children:o}=p,I=_chunk2WSEHVNPcjs.c.call(void 0, p,["onClick","className","children"]);function B(e){e.preventDefault(),e.stopPropagation(),x.createWindow(),r&&r(e)}let i=t.generateCss();return _react.useEffect.call(void 0, ()=>{let{cleanup:e}=t.injectCss(i);return h(!0),e},[i]),f?_jsxruntime.jsxs.call(void 0, "button",_chunk2WSEHVNPcjs.b.call(void 0, _chunk2WSEHVNPcjs.a.call(void 0, {onClick:B,className:_clsx2.default.call(void 0, t.identifiers.buttonClassNames,E)},I),{children:[_jsxruntime.jsx.call(void 0, _chunk56YL3XJWcjs.a,{style:{marginRight:"12px",flex:"none"},displayType:"icon-only",id:t.identifiers.logoId,height:16,width:16}),o!=null?o:_jsxruntime.jsx.call(void 0, "p",{style:{margin:0},children:t.getButtonText()})]})):null}exports.a = z;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -1,10 +1,10 @@
1
- import{b as kt}from"./chunk-4KDASQO6.js";import{a as Ht}from"./chunk-JSNUJJQJ.js";import{a as Ft}from"./chunk-LD3MRJ3F.js";import{a as Gt}from"./chunk-JPJKOERH.js";import{a as Vt}from"./chunk-VWL76U5G.js";import{a as Mt,b as Ut,c as q}from"./chunk-VHNBXIOC.js";import{a as D}from"./chunk-TNCETEEL.js";import{a as Wt,e as Nt,h as Ot,i as It}from"./chunk-UDQUVZUQ.js";import{a as _t}from"./chunk-XB3VAPRK.js";import{a as Bt}from"./chunk-EMXNIC4M.js";import{a as Tt}from"./chunk-ZFHUZZF2.js";import{a as W}from"./chunk-NBJIJZGO.js";import{a as Kt}from"./chunk-VLDE23JX.js";import{a as Lt}from"./chunk-C3JRTLQP.js";import{a as Dt}from"./chunk-E4TBJMOO.js";import{a as ut}from"./chunk-WW6GUXHG.js";import{a as Rt}from"./chunk-SFDQPSSP.js";import{a as mt}from"./chunk-UAFW3OWA.js";import{a as z,b as $,c as X,d as w}from"./chunk-PXDN3KFO.js";import{VisuallyHidden as po}from"@radix-ui/react-visually-hidden";import{createContext as Lo,useCallback as Ro,useContext as Bo,useEffect as Do,useState as ct}from"react";import{CrossmintAuthenticationError as _o}from"@crossmint/common-sdk-auth";import{useContext as Uo}from"react";import{createContext as Eo,useEffect as Jt,useMemo as Qt,useRef as Fo,useState as j,useCallback as tt}from"react";import{CrossmintAuth as ko,getCookie as Wo}from"@crossmint/client-sdk-auth";import{validateApiKeyAndGetCrossmintBaseUrl as No}from"@crossmint/common-sdk-base";import{SESSION_PREFIX as Oo}from"@crossmint/common-sdk-auth";import{useCrossmint as Io}from"@crossmint/client-sdk-react-base";import{useEffect as vt,useMemo as zt}from"react";import{useDynamicContext as Co}from"@dynamic-labs/sdk-react-core";import{isEthereumWallet as wo}from"@dynamic-labs/ethereum";import{isSolanaWallet as So}from"@dynamic-labs/solana";import{EthereumWalletConnectors as $t}from"@dynamic-labs/ethereum";import{SolanaWalletConnectors as qt}from"@dynamic-labs/solana";import Po from"bs58";import{jsx as jt}from"react/jsx-runtime";function Ao({children:e,enabled:o,onSdkLoaded:r,onWalletConnected:t,jwt:n}){let{primaryWallet:i,sdkHasLoaded:l,removeWallet:s,handleUnlinkWallet:c}=Co(),m=!o||l;return vt(()=>{m&&(r==null||r(m))},[m,r]),vt(()=>{n==null&&m&&i!=null&&(s(i.id),c(i.id))},[n,m,i,s,c]),vt(()=>{function x(){return w(this,null,function*(){try{if(wo(i)){let u=yield i.getWalletClient(),a={type:"external-wallet",address:u.account.address,viemAccount:$(z({},u.account),{signMessage:d=>w(this,null,function*(){return yield u.signMessage({message:d.message})})})};t(a)}else if(So(i)){let u=yield i.getSigner(),a={type:"external-wallet",address:i.address,onSignTransaction:d=>w(this,null,function*(){return yield u.signTransaction(d)})};t(a)}else throw new Error("Unsupported wallet type")}catch(u){throw console.error("Failed to get admin signer",u),new Error("Failed to get admin signer")}})}i!=null&&n!=null&&x()},[i,n,t]),e}function Xt({children:e,enabled:o=!0,apiKeyEnvironment:r,loginMethods:t=["web3"],appearance:n,onSdkLoaded:i,onWalletConnected:l}){var u,a;let{crossmintAuth:s,jwt:c}=R(),m=zt(()=>{var d,f;return`.powered-by-dynamic { display: none !important; }
1
+ import{a as Ht}from"./chunk-JSNUJJQJ.js";import{b as kt}from"./chunk-4KDASQO6.js";import{a as Ft}from"./chunk-LD3MRJ3F.js";import{a as Gt}from"./chunk-JPJKOERH.js";import{a as Vt}from"./chunk-VWL76U5G.js";import{a as Kt}from"./chunk-VLDE23JX.js";import{a as Dt}from"./chunk-E4TBJMOO.js";import{a as ut}from"./chunk-WW6GUXHG.js";import{a as Bt}from"./chunk-SFDQPSSP.js";import{a as Tt}from"./chunk-EMXNIC4M.js";import{a as Mt,b as Ut,c as q}from"./chunk-VHNBXIOC.js";import{a as D}from"./chunk-TNCETEEL.js";import{a as Wt,e as Nt,h as Ot,i as It}from"./chunk-UDQUVZUQ.js";import{a as _t}from"./chunk-XB3VAPRK.js";import{a as W}from"./chunk-NBJIJZGO.js";import{a as Lt}from"./chunk-C3JRTLQP.js";import{a as Rt}from"./chunk-ZFHUZZF2.js";import{a as mt}from"./chunk-UAFW3OWA.js";import{a as z,b as $,c as X,d as w}from"./chunk-PXDN3KFO.js";import{VisuallyHidden as po}from"@radix-ui/react-visually-hidden";import{createContext as Lo,useCallback as Ro,useContext as Bo,useEffect as Do,useState as ct}from"react";import{CrossmintAuthenticationError as _o}from"@crossmint/common-sdk-auth";import{useContext as Uo}from"react";import{createContext as Eo,useEffect as Jt,useMemo as Qt,useRef as Fo,useState as j,useCallback as tt}from"react";import{CrossmintAuth as ko,getCookie as Wo}from"@crossmint/client-sdk-auth";import{validateApiKeyAndGetCrossmintBaseUrl as No}from"@crossmint/common-sdk-base";import{SESSION_PREFIX as Oo}from"@crossmint/common-sdk-auth";import{useCrossmint as Io}from"@crossmint/client-sdk-react-base";import{useEffect as vt,useMemo as zt}from"react";import{useDynamicContext as Co}from"@dynamic-labs/sdk-react-core";import{isEthereumWallet as wo}from"@dynamic-labs/ethereum";import{isSolanaWallet as So}from"@dynamic-labs/solana";import{EthereumWalletConnectors as $t}from"@dynamic-labs/ethereum";import{SolanaWalletConnectors as qt}from"@dynamic-labs/solana";import Po from"bs58";import{jsx as jt}from"react/jsx-runtime";function Ao({children:e,enabled:o,onSdkLoaded:r,onWalletConnected:t,jwt:n}){let{primaryWallet:i,sdkHasLoaded:l,removeWallet:s,handleUnlinkWallet:c}=Co(),m=!o||l;return vt(()=>{m&&(r==null||r(m))},[m,r]),vt(()=>{n==null&&m&&i!=null&&(s(i.id),c(i.id))},[n,m,i,s,c]),vt(()=>{function x(){return w(this,null,function*(){try{if(wo(i)){let u=yield i.getWalletClient(),a={type:"external-wallet",address:u.account.address,viemAccount:$(z({},u.account),{signMessage:d=>w(this,null,function*(){return yield u.signMessage({message:d.message})})})};t(a)}else if(So(i)){let u=yield i.getSigner(),a={type:"external-wallet",address:i.address,onSignTransaction:d=>w(this,null,function*(){return yield u.signTransaction(d)})};t(a)}else throw new Error("Unsupported wallet type")}catch(u){throw console.error("Failed to get admin signer",u),new Error("Failed to get admin signer")}})}i!=null&&n!=null&&x()},[i,n,t]),e}function Xt({children:e,enabled:o=!0,apiKeyEnvironment:r,loginMethods:t=["web3"],appearance:n,onSdkLoaded:i,onWalletConnected:l}){var u,a;let{crossmintAuth:s,jwt:c}=R(),m=zt(()=>{var d,f;return`.powered-by-dynamic { display: none !important; }
2
2
  .wallet-list__scroll-container { padding: 0px !important; }
3
3
  .wallet-list__search-container { padding-left: 0px !important; padding-right: 0px !important; }
4
4
  .dynamic-footer { display: none !important; }
5
5
  h1 { color: ${(d=n==null?void 0:n.colors)==null?void 0:d.textPrimary} !important; }
6
- * { color: ${(f=n==null?void 0:n.colors)==null?void 0:f.textSecondary} !important; }`},[(u=n==null?void 0:n.colors)==null?void 0:u.textPrimary,(a=n==null?void 0:n.colors)==null?void 0:a.textSecondary]),x=zt(()=>{if(o)return t.includes("web3:evm-only")?[$t]:t.includes("web3:solana-only")?[qt]:[$t,qt]},[o,t]);return jt(Ft,{apiKeyEnvironment:r,settings:{walletConnectors:x,cssOverrides:m,events:{onAuthFailure(d,f){console.error("[DynamicWalletProvider] onAuthFailure",d,f)}},handlers:{handleConnectedWallet:d=>w(this,null,function*(){var g;if(!s)return console.error("[DynamicWalletProvider] crossmintAuth is not available"),!1;let f=d.address;if(f==null)return console.error("[DynamicWalletProvider] handleConnectedWallet: address is missing"),!1;try{let b=(yield kt(d))==="solana"?"solana":"evm",v=yield s.signInWithSmartWallet(f,b);if((v==null?void 0:v.challenge)==null)throw new Error("No challenge received from signInWithSmartWallet");let p=yield(g=d.connector)==null?void 0:g.proveOwnership(f,v.challenge);if(p==null)throw new Error("Failed to get signature from wallet");let F=p;if(b==="solana"){let S=Buffer.from(p,"base64");F=Po.encode(S)}let C=yield s.authenticateSmartWallet(f,b,F);if((C==null?void 0:C.oneTimeSecret)==null)throw new Error("No oneTimeSecret received from authenticateSmartWallet");return yield s.handleRefreshAuthMaterial(C.oneTimeSecret),!0}catch(y){return console.error("[DynamicWalletProvider] Error handling wallet connection:",y),!1}})}},children:jt(Ao,{enabled:o,onSdkLoaded:i,onWalletConnected:l,jwt:c,children:e})},`${r}-${t.join(",")}`)}import{Fragment as Mo,jsx as ot,jsxs as Yt}from"react/jsx-runtime";var To={crossmintAuth:void 0,login:()=>{},logout:()=>{},jwt:void 0,user:void 0,status:"initializing",getUser:()=>{},experimental_externalWalletSigner:void 0},pt=Eo(To);function Br({children:e,appearance:o,termsOfServiceText:r,prefetchOAuthUrls:t=!0,authModalTitle:n,onLoginSuccess:i,loginMethods:l=["email","google"],refreshRoute:s,logoutRoute:c}){let{crossmint:m}=Io("CrossmintAuthProvider must be used within CrossmintProvider"),[x,u]=j(void 0),[a,d]=j(void 0),f=No(m.apiKey),[g,y]=j(!1),[b,v]=j(!1),[p,F]=j(void 0),[C,S]=j(!0),k=l.some(P=>P.startsWith("web3")),[N,U]=j(void 0),B=Fo(null),L=Qt(()=>(B.current||(B.current=ko.from(m,{callbacks:{onLogout:()=>{u(void 0),d(void 0)},onTokenRefresh:P=>{u(P.user),d(P.jwt)}},refreshRoute:s,logoutRoute:c})),B.current),[]),H=tt(()=>{i==null||i()},[i]);Jt(()=>{if(a==null){let P=Wo(Oo);d(P)}v(!0)},[a]),Jt(()=>{a!=null&&g&&(y(!1),H())},[a,g,H]);let M=tt(P=>{if(a!=null){console.log("User already logged in");return}P!=null&&typeof P=="string"&&F(P),y(!0)},[a]),G=tt(()=>{L.logout()},[L]),V=tt(()=>!b||k&&!C?"initializing":a!=null?"logged-in":g?"in-progress":"logged-out",[b,k,C,a,g]),Z=tt(()=>w(this,null,function*(){if(a==null){console.log("User not logged in");return}let P=yield L.getUser();return u(P),P}),[a,L]),lt=Qt(()=>({crossmintAuth:L,login:M,logout:G,jwt:a,user:x,experimental_externalWalletSigner:N,status:V(),getUser:Z}),[L,M,G,a,x,V,Z,N]);return ot(Tt,{children:ot(pt.Provider,{value:lt,children:ot(Zt,{setDialogOpen:(P,st)=>{y(P),st&&H()},preFetchOAuthUrls:V()==="logged-out"&&t,initialState:{appearance:o,loginMethods:l,termsOfServiceText:r,authModalTitle:n,baseUrl:f,defaultEmail:p},children:k?Yt(Xt,{apiKeyEnvironment:m.apiKey.includes("production")?"production":"staging",loginMethods:l,appearance:o,onSdkLoaded:S,onWalletConnected:U,children:[e,ot(at,{open:g})]}):Yt(Mo,{children:[e,ot(at,{open:g})]})})})})}function R(){let e=Uo(pt);if(!e)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return e}import{jsx as Ho}from"react/jsx-runtime";var to={google:"",twitter:""},oo=Lo(void 0),h=()=>{let e=Bo(oo);if(!e)throw new Error("useAuthForm must be used within an AuthFormProvider");return e},Zt=({setDialogOpen:e,preFetchOAuthUrls:o,initialState:r,children:t})=>{let{crossmintAuth:n}=R(),[i,l]=ct("initial"),[s,c]=ct(null),[m,x]=ct(to),[u,a]=ct(!0),{loginMethods:d,baseUrl:f,appearance:g,termsOfServiceText:y,authModalTitle:b,defaultEmail:v}=r,p=Ro(()=>w(void 0,null,function*(){a(!0);try{let k=d.filter(U=>U in to).map(U=>w(void 0,null,function*(){let B=yield n==null?void 0:n.getOAuthUrl(U);return{[U]:B}})),N=Object.assign({},...yield Promise.all(k));x(N)}catch(S){c(S instanceof _o?S.message:"Unable to load oauth providers. Please try again later.")}finally{a(!1)}}),[d,n]);Do(()=>{o&&p()},[p,o]);let C={step:i,error:s,baseUrl:f,appearance:g,termsOfServiceText:y,authModalTitle:b,loginMethods:d,defaultEmail:v,oauthUrlMap:m,isLoadingOauthUrlMap:u,setDialogOpen:(S,k)=>{e==null||e(S,k),S||setTimeout(()=>l("initial"),250)},setError:c,setStep:l};return Ho(oo.Provider,{value:C,children:t})};import dr from"color";import{useState as Yo}from"react";import{useState as Ct}from"react";import{jsx as ro}from"react/jsx-runtime";var J=i=>{var l=i,{className:e,iconColor:o,ringColor:r,onClick:t}=l,n=X(l,["className","iconColor","ringColor","onClick"]);let{setError:s}=h();return ro("button",$(z({className:W("absolute left-4 top-4 min-[480px]:!left-6 min-[480px]:!top-6 rounded-full opacity-70 ring-offset-background text-cm-text-primary transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-cm-accent focus:ring-offset-2 disabled:pointer-events-none",e),onClick:c=>{s(null),t==null||t(c)}},n),{children:ro(Rt,{className:"w-6 h-6",style:{color:o}})}))};import{jsx as O,jsxs as rt}from"react/jsx-runtime";var Go=6;function eo({otpEmailData:e,setOtpEmailData:o}){var y,b,v,p,F,C,S,k,N,U,B,L,H,M,G,V,Z,lt,P,st;let{crossmintAuth:r}=R(),{appearance:t,setDialogOpen:n,setStep:i,setError:l}=h(),[s,c]=Ct(""),[m,x]=Ct(!1),[u,a]=Ct(!1),d=()=>w(this,null,function*(){var K,yt;a(!0);try{let bt=yield r==null?void 0:r.confirmEmailOtp((K=e==null?void 0:e.email)!=null?K:"",(yt=e==null?void 0:e.emailId)!=null?yt:"",s);yield r==null?void 0:r.handleRefreshAuthMaterial(bt),n(!1,!0),i("initial")}catch(bt){console.error("Error confirming email OTP",bt),l("Invalid code. Please try again."),x(!0)}finally{a(!1)}}),f=()=>w(this,null,function*(){var K;try{yield r==null?void 0:r.sendEmailOtp((K=e==null?void 0:e.email)!=null?K:"")}catch(yt){l("Failed to resend code. Please try again.")}});return rt("div",{children:[O(J,{onClick:()=>{i("initial"),o(null)},iconColor:(y=t==null?void 0:t.colors)==null?void 0:y.textPrimary,ringColor:(b=t==null?void 0:t.colors)==null?void 0:b.accent}),rt("div",{className:"flex flex-col items-center justify-start w-full",children:[O("div",{className:"relative left-3",children:O(Lt,{customAccentColor:(v=t==null?void 0:t.colors)==null?void 0:v.accent,customButtonBackgroundColor:(p=t==null?void 0:t.colors)==null?void 0:p.buttonBackground,customBackgroundColor:(F=t==null?void 0:t.colors)==null?void 0:F.background})}),O("p",{className:"text-base font-normal mt-4 mb-1 text-center text-cm-text-primary",style:{color:(C=t==null?void 0:t.colors)==null?void 0:C.textPrimary},children:"Check your email"}),rt("p",{className:"text-center text-cm-text-secondary px-4",style:{color:(S=t==null?void 0:t.colors)==null?void 0:S.textSecondary},children:["A temporary login code has been sent to"," ",e!=null&&e.email?e.email:"your email address"]}),O("div",{className:"py-8",children:O(Mt,{maxLength:Go,value:s,onChange:K=>{c(K),x(!1),l(null)},onComplete:d,disabled:u,customStyles:{accent:(N=(k=t==null?void 0:t.colors)==null?void 0:k.accent)!=null?N:"#04AA6D",danger:(B=(U=t==null?void 0:t.colors)==null?void 0:U.danger)!=null?B:"#f44336",border:(H=(L=t==null?void 0:t.colors)==null?void 0:L.border)!=null?H:"#E5E7EB",textPrimary:(G=(M=t==null?void 0:t.colors)==null?void 0:M.textPrimary)!=null?G:"#909ca3",buttonBackground:(Z=(V=t==null?void 0:t.colors)==null?void 0:V.buttonBackground)!=null?Z:"#eff6ff",inputBackground:(P=(lt=t==null?void 0:t.colors)==null?void 0:lt.inputBackground)!=null?P:"#FFFFFF",borderRadius:t==null?void 0:t.borderRadius},children:rt(Ut,{children:[O(q,{index:0,hasError:m}),O(q,{index:1,hasError:m}),O(q,{index:2,hasError:m}),O(q,{index:3,hasError:m}),O(q,{index:4,hasError:m}),O(q,{index:5,hasError:m})]})})}),O("div",{className:"text-xs leading-tight text-cm-text-secondary text-center",children:rt("span",{style:{color:(st=t==null?void 0:t.colors)==null?void 0:st.textSecondary},children:["Can't find the email? Check spam folder.",`
7
- `,"Some emails may take several minutes to arrive."]})}),O(Bt,{initialSeconds:60,appearance:t,countdownText:K=>`Re-send code in ${K}s`,countdownCompleteText:"Re-send code",handleOnClick:f})]})]})}import{useState as St}from"react";import Jo from"color";import{isEmailValid as ft}from"@crossmint/common-sdk-auth";import{ChildWindow as Ko,PopupWindow as Vo}from"@crossmint/client-sdk-window";import{useEffect as zo,useRef as $o,useState as qo}from"react";import{z as dt}from"zod";var Q=e=>{let{crossmintAuth:o}=R(),{oauthUrlMap:r,setError:t}=h(),[n,i]=qo(!1),l=$o(null);return zo(()=>(l.current==null&&(l.current=new Ko(window.opener||window.parent,"*",{incomingEvents:jo})),()=>{l.current!=null&&l.current.off("authMaterialFromPopupCallback")}),[]),{createPopupAndSetupListeners:c=>w(void 0,null,function*(){if(l.current==null)throw new Error("Child window not initialized");i(!0),t(null);let m=new URL(r[e]);if(c!=null){let f=Array.from(m.searchParams.entries());m.search="",c&&m.searchParams.append("provider_login_hint",c),f.forEach(([g,y])=>{m.searchParams.append(g,y)})}let x=yield Vo.init(m.toString(),{awaitToLoad:!1,crossOrigin:!0,width:400,height:700}),u=f=>w(void 0,null,function*(){var g;yield o==null?void 0:o.handleRefreshAuthMaterial(f.oneTimeSecret),(g=l.current)==null||g.off("authMaterialFromPopupCallback"),x.window.close(),i(!1)}),a=f=>{var g;t(f.error),(g=l.current)==null||g.off("errorFromPopupCallback"),x.window.close(),i(!1)};l.current.on("authMaterialFromPopupCallback",u),l.current.on("errorFromPopupCallback",a);let d=setInterval(()=>{var f,g;(f=x.window)!=null&&f.closed&&(clearInterval(d),i(!1),(g=l.current)==null||g.off("authMaterialFromPopupCallback"))},2500)}),isLoading:n}},jo={authMaterialFromPopupCallback:dt.object({oneTimeSecret:dt.string()}),errorFromPopupCallback:dt.object({error:dt.string()})};import{jsx as wt,jsxs as Xo}from"react/jsx-runtime";function no({emailInput:e,appearance:o}){var n,i,l,s;let{createPopupAndSetupListeners:r,isLoading:t}=Q("google");return Xo("button",{type:"button",className:W("flex items-center gap-2 justify-center h-[32px] px-2.5 border border-cm-border rounded-xl bg-cm-background-primary","hover:bg-cm-hover focus:bg-cm-hover outline-none",t?"cursor-not-allowed hover:bg-cm-muted-primary":""),onClick:t?void 0:()=>r(e.trim().toLowerCase()),style:{backgroundColor:(n=o==null?void 0:o.colors)==null?void 0:n.buttonBackground,borderRadius:o==null?void 0:o.borderRadius},children:[wt(ut,{className:"max-h-[18px] max-w-[18px] h-[18px] w-[18px]"}),t?wt(D,{style:{color:(i=o==null?void 0:o.colors)==null?void 0:i.textSecondary,fill:(l=o==null?void 0:o.colors)==null?void 0:l.textPrimary,width:"18px",height:"18px"}}):wt("span",{className:"text-cm-accent",style:{color:(s=o==null?void 0:o.colors)==null?void 0:s.accent},children:"Continue"})]})}import{Fragment as Qo,jsx as _,jsxs as Pt}from"react/jsx-runtime";function io({setOtpEmailData:e}){var g,y,b,v,p,F,C,S,k,N,U,B,L,H;let{crossmintAuth:o}=R(),{appearance:r,defaultEmail:t,setStep:n,setError:i,loginMethods:l}=h(),[s,c]=St(t!=null?t:""),[m,x]=St(""),[u,a]=St(!1),d=s.toLowerCase().includes("@gmail.com")&&!s.toLowerCase().includes("+")&&ft(s)&&!u&&l.includes("google");function f(M){return w(this,null,function*(){M.preventDefault(),a(!0);try{let G=s.trim().toLowerCase(),V=yield o==null?void 0:o.sendEmailOtp(G);e({email:G,emailId:V.emailId}),n("otp")}catch(G){a(!1),i("Failed to send email. Please try again or contact support.")}})}return _(Qo,{children:_("div",{className:"flex flex-col items-start justify-start w-full rounded-lg",children:Pt("div",{className:"w-full",children:[_("label",{className:"text-cm-text-primary block mb-[5px]",style:{color:(g=r==null?void 0:r.colors)==null?void 0:g.textPrimary},children:"Email"}),Pt("form",{role:"form",className:"relative",onSubmit:M=>{if(d){M.preventDefault();return}ft(s)?f(M):M.preventDefault()},noValidate:!0,children:[_("label",{htmlFor:"emailInput",className:"sr-only",children:"Email"}),_("input",{className:W("flex-grow text-cm-text-primary text-left pl-[16px] h-[58px] w-full border border-cm-border rounded-xl bg-cm-background-primary placeholder:text-md","transition-none duration-200 ease-in-out","focus:outline-none focus-ring-custom","placeholder:[color:var(--placeholder-color)]",m?"border-red-500":"",d?"pr-[132px]":"pr-[80px]"),style:{color:(y=r==null?void 0:r.colors)==null?void 0:y.textPrimary,borderRadius:r==null?void 0:r.borderRadius,borderColor:m?(b=r==null?void 0:r.colors)==null?void 0:b.danger:(v=r==null?void 0:r.colors)==null?void 0:v.border,backgroundColor:(p=r==null?void 0:r.colors)==null?void 0:p.inputBackground,"--placeholder-color":(C=(F=r==null?void 0:r.colors)==null?void 0:F.textSecondary)!=null?C:"#67797F","--focus-ring-color":new Jo((k=(S=r==null?void 0:r.colors)==null?void 0:S.accent)!=null?k:"#04AA6D").alpha(.18).toString()},type:"email",placeholder:"your@email.com",value:s,onChange:M=>{c(M.target.value),x(""),i(null)},readOnly:u,"aria-describedby":"emailError"}),Pt("div",{className:"absolute inset-y-0 right-0 flex items-center pr-4",children:[m&&_(mt,{customColor:(N=r==null?void 0:r.colors)==null?void 0:N.danger}),u&&_(D,{style:{color:(U=r==null?void 0:r.colors)==null?void 0:U.textSecondary,fill:(B=r==null?void 0:r.colors)==null?void 0:B.textPrimary}}),d?_(no,{emailInput:s,appearance:r}):!m&&!u?_("button",{type:"submit",className:W("font-medium text-cm-accent text-nowrap bg-cm-background-primary",ft(s)?"cursor-pointer":"!cursor-not-allowed opacity-60"),style:{color:(L=r==null?void 0:r.colors)==null?void 0:L.accent,backgroundColor:(H=r==null?void 0:r.colors)==null?void 0:H.inputBackground},disabled:!ft(s)||u,children:"Submit"}):null]})]}),m&&_("p",{className:"text-xs text-red-500 mb-2 pt-2",children:m})]})})})}import{jsx as lo}from"react/jsx-runtime";function so(){let{step:e}=h(),[o,r]=Yo(null);return e==="otp"?lo(eo,{otpEmailData:o,setOtpEmailData:r}):e==="initial"?lo(io,{setOtpEmailData:r}):null}import{jsx as At,jsxs as Zo}from"react/jsx-runtime";function mo({appearance:e,text:o}){var t,n,i;let{step:r}=h();return r!=="initial"?null:Zo("div",{className:"flex items-center justify-center w-full pt-2 pb-3",children:[At("span",{className:"w-full h-[1px] bg-cm-border",style:{backgroundColor:(t=e==null?void 0:e.colors)==null?void 0:t.border}}),o!=null?At("p",{className:"flex-none px-2 text-sm text-cm-text-primary",style:{color:(n=e==null?void 0:e.colors)==null?void 0:n.textSecondary},children:o}):null,At("span",{className:"w-full h-[1px] bg-cm-border",style:{backgroundColor:(i=e==null?void 0:e.colors)==null?void 0:i.border}})]})}import{Fragment as tr,jsx as gt,jsxs as uo}from"react/jsx-runtime";function ao(o){var e=X(o,[]);var c,m,x,u;let{step:r,appearance:t,isLoadingOauthUrlMap:n}=h(),{createPopupAndSetupListeners:i,isLoading:l}=Q("google"),s=n||l;return r!=="initial"?null:uo("button",$(z({className:W("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none",s?"cursor-not-allowed hover:bg-cm-muted-primary":""),style:{borderRadius:t==null?void 0:t.borderRadius,backgroundColor:(c=t==null?void 0:t.colors)==null?void 0:c.buttonBackground},onClick:s?void 0:()=>i()},e),{children:[uo(tr,{children:[gt(ut,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),s?gt(D,{style:{color:(m=t==null?void 0:t.colors)==null?void 0:m.textSecondary,fill:(x=t==null?void 0:t.colors)==null?void 0:x.textPrimary}}):gt("span",{className:"font-medium",style:{margin:"0px 32px",color:(u=t==null?void 0:t.colors)==null?void 0:u.textPrimary},children:"Sign in with Google"})]}),gt("span",{className:"sr-only",children:"Sign in with Google"})]}))}import{useEffect as Et,useMemo as or,useState as rr}from"react";import{useSignIn as er,QRCode as nr}from"@farcaster/auth-kit";import{Fragment as lr,jsx as I,jsxs as et}from"react/jsx-runtime";function co(){var n,i;let{step:e,appearance:o,setStep:r,setError:t}=h();return e==="initial"?I("div",{children:et("button",{className:W("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none"),style:{borderRadius:o==null?void 0:o.borderRadius,backgroundColor:(n=o==null?void 0:o.colors)==null?void 0:n.buttonBackground},onClick:()=>{r("qrCode"),t(null)},children:[I(Dt,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),I("span",{className:"font-medium",style:{margin:"0px 32px",color:(i=o==null?void 0:o.colors)==null?void 0:i.textPrimary},children:"Sign in with Farcaster"}),I("span",{className:"sr-only",children:"Sign in with Farcaster"})]})}):e==="qrCode"?I(ir,{}):null}function ir(){var f,g,y,b,v,p,F,C,S;let{crossmintAuth:e}=R(),{appearance:o,setStep:r,setDialogOpen:t,setError:n}=h(),[i,l]=rr(null),s=or(()=>({onSuccess:k=>{l(k)}}),[]),{signIn:c,url:m,connect:x,signOut:u,isConnected:a}=er(s),d=k=>w(this,null,function*(){n(null);try{let N=yield e==null?void 0:e.signInWithFarcaster(k);yield e==null?void 0:e.handleRefreshAuthMaterial(N),t(!1),r("initial")}catch(N){console.error("Error during Farcaster sign-in:",N),n("Failed to sign in with Farcaster")}});return Et(()=>{i!=null&&d(i)},[i]),Et(()=>{a&&c()},[a]),Et(()=>{x()},[]),et("div",{children:[I(J,{onClick:()=>{u(),r("initial")},iconColor:(f=o==null?void 0:o.colors)==null?void 0:f.textPrimary,ringColor:(g=o==null?void 0:o.colors)==null?void 0:g.accent}),et("div",{className:"flex flex-col items-center gap-4",children:[et("div",{className:"text-center",children:[I("h3",{className:"text-lg font-semibold text-cm-text-primary mb-2",style:{color:(y=o==null?void 0:o.colors)==null?void 0:y.textPrimary},children:"Sign in with Farcaster"}),I("p",{className:"text-base font-normal text-cm-text-secondary",style:{color:(b=o==null?void 0:o.colors)==null?void 0:b.textSecondary},children:"Scan with your phone's camera to continue."})]}),I("div",{className:"bg-white aspect-square rounded-lg p-4",style:{backgroundColor:(v=o==null?void 0:o.colors)==null?void 0:v.inputBackground,borderRadius:o==null?void 0:o.borderRadius},children:m!=null?I(nr,{uri:m,size:280}):I("div",{className:"min-h-[246px] flex items-center justify-center",children:I(D,{style:{color:(p=o==null?void 0:o.colors)==null?void 0:p.textSecondary,fill:(F=o==null?void 0:o.colors)==null?void 0:F.textPrimary}})})}),m?et(lr,{children:[I("p",{className:"text-base text-center font-normal text-cm-text-secondary",style:{color:(C=o==null?void 0:o.colors)==null?void 0:C.textSecondary},children:"Alternatively, click on this link to open Warpcast."}),I("a",{href:m,rel:"noopener noreferrer",target:"_blank",className:"text-base font-normal text-cm-link",style:{color:(S=o==null?void 0:o.colors)==null?void 0:S.textLink},children:"Open Warpcast"})]}):null]})]})}import{Fragment as sr,jsx as ht,jsxs as fo}from"react/jsx-runtime";function go(o){var e=X(o,[]);var c,m,x,u;let{step:r,appearance:t,isLoadingOauthUrlMap:n}=h(),{createPopupAndSetupListeners:i,isLoading:l}=Q("twitter"),s=n||l;return r!=="initial"?null:fo("button",$(z({className:W("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none",s?"cursor-not-allowed hover:bg-cm-muted-primary":""),style:{borderRadius:t==null?void 0:t.borderRadius,backgroundColor:(c=t==null?void 0:t.colors)==null?void 0:c.buttonBackground},onClick:s?void 0:()=>i()},e),{children:[fo(sr,{children:[ht(Gt,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),s?ht(D,{style:{color:(m=t==null?void 0:t.colors)==null?void 0:m.textSecondary,fill:(x=t==null?void 0:t.colors)==null?void 0:x.textPrimary}}):ht("span",{className:"font-medium",style:{margin:"0px 32px",color:(u=t==null?void 0:t.colors)==null?void 0:u.textPrimary},children:"Sign in with X"})]}),ht("span",{className:"sr-only",children:"Sign in with X"})]}))}import{jsx as xt,jsxs as mr}from"react/jsx-runtime";function ho(){var n,i,l,s,c;let{step:e,appearance:o,setStep:r,setError:t}=h();return e!=="initial"?null:mr("button",{className:W("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none"),style:{borderRadius:o==null?void 0:o.borderRadius,borderColor:(n=o==null?void 0:o.colors)==null?void 0:n.border,backgroundColor:(i=o==null?void 0:o.colors)==null?void 0:i.buttonBackground},onClick:()=>{r("web3"),t(null)},children:[xt(Vt,{className:"h-[21px] w-[21px] absolute left-[20px]",style:{color:(l=o==null?void 0:o.colors)==null?void 0:l.textPrimary}}),xt("span",{className:"font-medium",style:{margin:"0px 32px",color:(s=o==null?void 0:o.colors)==null?void 0:s.textPrimary},children:"Continue with a wallet"}),xt(Kt,{className:"h-[21px] w-[21px] absolute right-[20px]",style:{color:(c=o==null?void 0:o.colors)==null?void 0:c.textSecondary}}),xt("span",{className:"sr-only",children:"Continue with a wallet"})]})}import{DynamicEmbeddedWidget as ur}from"@dynamic-labs/sdk-react-core";import{Fragment as ar,jsx as nt,jsxs as cr}from"react/jsx-runtime";function xo(){var t,n;let{appearance:e,step:o,setStep:r}=h();return o==="web3"?cr(ar,{children:[nt(J,{onClick:()=>r("initial"),iconColor:(t=e==null?void 0:e.colors)==null?void 0:t.textPrimary,ringColor:(n=e==null?void 0:e.colors)==null?void 0:n.accent}),nt("div",{className:"flex flex-col items-center",children:nt("div",{className:"flex flex-col gap-[10px] w-full",children:nt("div",{className:"widget-container",children:nt(ur,{background:"none"})})})})]}):null}import{jsx as yo}from"react/jsx-runtime";function bo(){let{step:e}=h();return e.startsWith("web3")?yo(xo,{}):e==="initial"?yo(ho,{}):null}import{jsx as T,jsxs as it}from"react/jsx-runtime";function vo({className:e}){var c,m,x,u,a,d,f,g,y,b,v,p,F;let{step:o,appearance:r,loginMethods:t,baseUrl:n,error:i,termsOfServiceText:l,authModalTitle:s}=h();return it("div",{className:W("relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none",e),children:[i!=null?it("div",{className:"flex items-start justify-start w-full rounded-lg p-2 mt-4 bg-cm-danger-muted",style:{backgroundColor:new dr((m=(c=r==null?void 0:r.colors)==null?void 0:c.danger)!=null?m:"#f44336").alpha(.12).toString()},children:[T("div",{className:"min-w-[20px]",children:T(mt,{customColor:(u=(x=r==null?void 0:r.colors)==null?void 0:x.danger)!=null?u:"#f44336"})}),T("p",{className:"ml-2 text-sm",style:{color:(d=(a=r==null?void 0:r.colors)==null?void 0:a.danger)!=null?d:"#f44336"},children:i})]}):null,o==="initial"?it("div",{children:[T("h1",{className:"text-2xl font-bold text-cm-text-primary",style:{color:(f=r==null?void 0:r.colors)==null?void 0:f.textPrimary},children:s!=null?s:"Sign in to Crossmint"}),T("p",{className:"text-base font-normal mb-3 text-cm-text-secondary",style:{color:(g=r==null?void 0:r.colors)==null?void 0:g.textSecondary},children:"Access using one of the options below."})]}):null,t.includes("google")?T(ao,{}):null,t.includes("farcaster")?T(Ht,{baseUrl:n,children:T(co,{})}):null,t.includes("twitter")?T(go,{}):null,t.some(C=>C.startsWith("web3"))?T(bo,{}):null,t.includes("email")?it("div",{children:[t.length>1?T(mo,{appearance:r,text:"OR"}):null,T(so,{})]}):null,o==="initial"&&l!=null?it("div",{className:"text-sm text-center text-cm-text-secondary mt-2",style:{color:(y=r==null?void 0:r.colors)==null?void 0:y.textSecondary},children:[T("style",{children:`
6
+ * { color: ${(f=n==null?void 0:n.colors)==null?void 0:f.textSecondary} !important; }`},[(u=n==null?void 0:n.colors)==null?void 0:u.textPrimary,(a=n==null?void 0:n.colors)==null?void 0:a.textSecondary]),x=zt(()=>{if(o)return t.includes("web3:evm-only")?[$t]:t.includes("web3:solana-only")?[qt]:[$t,qt]},[o,t]);return jt(Ft,{apiKeyEnvironment:r,settings:{walletConnectors:x,cssOverrides:m,events:{onAuthFailure(d,f){console.error("[DynamicWalletProvider] onAuthFailure",d,f)}},handlers:{handleConnectedWallet:d=>w(this,null,function*(){var g;if(!s)return console.error("[DynamicWalletProvider] crossmintAuth is not available"),!1;let f=d.address;if(f==null)return console.error("[DynamicWalletProvider] handleConnectedWallet: address is missing"),!1;try{let b=(yield kt(d))==="solana"?"solana":"evm",v=yield s.signInWithSmartWallet(f,b);if((v==null?void 0:v.challenge)==null)throw new Error("No challenge received from signInWithSmartWallet");let p=yield(g=d.connector)==null?void 0:g.proveOwnership(f,v.challenge);if(p==null)throw new Error("Failed to get signature from wallet");let F=p;if(b==="solana"){let S=Buffer.from(p,"base64");F=Po.encode(S)}let C=yield s.authenticateSmartWallet(f,b,F);if((C==null?void 0:C.oneTimeSecret)==null)throw new Error("No oneTimeSecret received from authenticateSmartWallet");return yield s.handleRefreshAuthMaterial(C.oneTimeSecret),!0}catch(y){return console.error("[DynamicWalletProvider] Error handling wallet connection:",y),!1}})}},children:jt(Ao,{enabled:o,onSdkLoaded:i,onWalletConnected:l,jwt:c,children:e})},`${r}-${t.join(",")}`)}import{Fragment as Mo,jsx as ot,jsxs as Yt}from"react/jsx-runtime";var To={crossmintAuth:void 0,login:()=>{},logout:()=>{},jwt:void 0,user:void 0,status:"initializing",getUser:()=>{},experimental_externalWalletSigner:void 0},pt=Eo(To);function Br({children:e,appearance:o,termsOfServiceText:r,prefetchOAuthUrls:t=!0,authModalTitle:n,onLoginSuccess:i,loginMethods:l=["email","google"],refreshRoute:s,logoutRoute:c}){let{crossmint:m}=Io("CrossmintAuthProvider must be used within CrossmintProvider"),[x,u]=j(void 0),[a,d]=j(void 0),f=No(m.apiKey),[g,y]=j(!1),[b,v]=j(!1),[p,F]=j(void 0),[C,S]=j(!0),k=l.some(P=>P.startsWith("web3")),[N,U]=j(void 0),B=Fo(null),L=Qt(()=>(B.current||(B.current=ko.from(m,{callbacks:{onLogout:()=>{u(void 0),d(void 0)},onTokenRefresh:P=>{u(P.user),d(P.jwt)}},refreshRoute:s,logoutRoute:c})),B.current),[]),H=tt(()=>{i==null||i()},[i]);Jt(()=>{if(a==null){let P=Wo(Oo);d(P)}v(!0)},[a]),Jt(()=>{a!=null&&g&&(y(!1),H())},[a,g,H]);let M=tt(P=>{if(a!=null){console.log("User already logged in");return}P!=null&&typeof P=="string"&&F(P),y(!0)},[a]),G=tt(()=>{L.logout()},[L]),V=tt(()=>!b||k&&!C?"initializing":a!=null?"logged-in":g?"in-progress":"logged-out",[b,k,C,a,g]),Z=tt(()=>w(this,null,function*(){if(a==null){console.log("User not logged in");return}let P=yield L.getUser();return u(P),P}),[a,L]),lt=Qt(()=>({crossmintAuth:L,login:M,logout:G,jwt:a,user:x,experimental_externalWalletSigner:N,status:V(),getUser:Z}),[L,M,G,a,x,V,Z,N]);return ot(Rt,{children:ot(pt.Provider,{value:lt,children:ot(Zt,{setDialogOpen:(P,st)=>{y(P),st&&H()},preFetchOAuthUrls:V()==="logged-out"&&t,initialState:{appearance:o,loginMethods:l,termsOfServiceText:r,authModalTitle:n,baseUrl:f,defaultEmail:p},children:k?Yt(Xt,{apiKeyEnvironment:m.apiKey.includes("production")?"production":"staging",loginMethods:l,appearance:o,onSdkLoaded:S,onWalletConnected:U,children:[e,ot(at,{open:g})]}):Yt(Mo,{children:[e,ot(at,{open:g})]})})})})}function R(){let e=Uo(pt);if(!e)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return e}import{jsx as Ho}from"react/jsx-runtime";var to={google:"",twitter:""},oo=Lo(void 0),h=()=>{let e=Bo(oo);if(!e)throw new Error("useAuthForm must be used within an AuthFormProvider");return e},Zt=({setDialogOpen:e,preFetchOAuthUrls:o,initialState:r,children:t})=>{let{crossmintAuth:n}=R(),[i,l]=ct("initial"),[s,c]=ct(null),[m,x]=ct(to),[u,a]=ct(!0),{loginMethods:d,baseUrl:f,appearance:g,termsOfServiceText:y,authModalTitle:b,defaultEmail:v}=r,p=Ro(()=>w(void 0,null,function*(){a(!0);try{let k=d.filter(U=>U in to).map(U=>w(void 0,null,function*(){let B=yield n==null?void 0:n.getOAuthUrl(U);return{[U]:B}})),N=Object.assign({},...yield Promise.all(k));x(N)}catch(S){c(S instanceof _o?S.message:"Unable to load oauth providers. Please try again later.")}finally{a(!1)}}),[d,n]);Do(()=>{o&&p()},[p,o]);let C={step:i,error:s,baseUrl:f,appearance:g,termsOfServiceText:y,authModalTitle:b,loginMethods:d,defaultEmail:v,oauthUrlMap:m,isLoadingOauthUrlMap:u,setDialogOpen:(S,k)=>{e==null||e(S,k),S||setTimeout(()=>l("initial"),250)},setError:c,setStep:l};return Ho(oo.Provider,{value:C,children:t})};import dr from"color";import{useState as Yo}from"react";import{useState as Ct}from"react";import{jsx as ro}from"react/jsx-runtime";var J=i=>{var l=i,{className:e,iconColor:o,ringColor:r,onClick:t}=l,n=X(l,["className","iconColor","ringColor","onClick"]);let{setError:s}=h();return ro("button",$(z({className:W("absolute left-4 top-4 min-[480px]:!left-6 min-[480px]:!top-6 rounded-full opacity-70 ring-offset-background text-cm-text-primary transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-cm-accent focus:ring-offset-2 disabled:pointer-events-none",e),onClick:c=>{s(null),t==null||t(c)}},n),{children:ro(Bt,{className:"w-6 h-6",style:{color:o}})}))};import{jsx as O,jsxs as rt}from"react/jsx-runtime";var Go=6;function eo({otpEmailData:e,setOtpEmailData:o}){var y,b,v,p,F,C,S,k,N,U,B,L,H,M,G,V,Z,lt,P,st;let{crossmintAuth:r}=R(),{appearance:t,setDialogOpen:n,setStep:i,setError:l}=h(),[s,c]=Ct(""),[m,x]=Ct(!1),[u,a]=Ct(!1),d=()=>w(this,null,function*(){var K,yt;a(!0);try{let bt=yield r==null?void 0:r.confirmEmailOtp((K=e==null?void 0:e.email)!=null?K:"",(yt=e==null?void 0:e.emailId)!=null?yt:"",s);yield r==null?void 0:r.handleRefreshAuthMaterial(bt),n(!1,!0),i("initial")}catch(bt){console.error("Error confirming email OTP",bt),l("Invalid code. Please try again."),x(!0)}finally{a(!1)}}),f=()=>w(this,null,function*(){var K;try{yield r==null?void 0:r.sendEmailOtp((K=e==null?void 0:e.email)!=null?K:"")}catch(yt){l("Failed to resend code. Please try again.")}});return rt("div",{children:[O(J,{onClick:()=>{i("initial"),o(null)},iconColor:(y=t==null?void 0:t.colors)==null?void 0:y.textPrimary,ringColor:(b=t==null?void 0:t.colors)==null?void 0:b.accent}),rt("div",{className:"flex flex-col items-center justify-start w-full",children:[O("div",{className:"relative left-3",children:O(Lt,{customAccentColor:(v=t==null?void 0:t.colors)==null?void 0:v.accent,customButtonBackgroundColor:(p=t==null?void 0:t.colors)==null?void 0:p.buttonBackground,customBackgroundColor:(F=t==null?void 0:t.colors)==null?void 0:F.background})}),O("p",{className:"text-base font-normal mt-4 mb-1 text-center text-cm-text-primary",style:{color:(C=t==null?void 0:t.colors)==null?void 0:C.textPrimary},children:"Check your email"}),rt("p",{className:"text-center text-cm-text-secondary px-4",style:{color:(S=t==null?void 0:t.colors)==null?void 0:S.textSecondary},children:["A temporary login code has been sent to"," ",e!=null&&e.email?e.email:"your email address"]}),O("div",{className:"py-8",children:O(Mt,{maxLength:Go,value:s,onChange:K=>{c(K),x(!1),l(null)},onComplete:d,disabled:u,customStyles:{accent:(N=(k=t==null?void 0:t.colors)==null?void 0:k.accent)!=null?N:"#04AA6D",danger:(B=(U=t==null?void 0:t.colors)==null?void 0:U.danger)!=null?B:"#f44336",border:(H=(L=t==null?void 0:t.colors)==null?void 0:L.border)!=null?H:"#E5E7EB",textPrimary:(G=(M=t==null?void 0:t.colors)==null?void 0:M.textPrimary)!=null?G:"#909ca3",buttonBackground:(Z=(V=t==null?void 0:t.colors)==null?void 0:V.buttonBackground)!=null?Z:"#eff6ff",inputBackground:(P=(lt=t==null?void 0:t.colors)==null?void 0:lt.inputBackground)!=null?P:"#FFFFFF",borderRadius:t==null?void 0:t.borderRadius},children:rt(Ut,{children:[O(q,{index:0,hasError:m}),O(q,{index:1,hasError:m}),O(q,{index:2,hasError:m}),O(q,{index:3,hasError:m}),O(q,{index:4,hasError:m}),O(q,{index:5,hasError:m})]})})}),O("div",{className:"text-xs leading-tight text-cm-text-secondary text-center",children:rt("span",{style:{color:(st=t==null?void 0:t.colors)==null?void 0:st.textSecondary},children:["Can't find the email? Check spam folder.",`
7
+ `,"Some emails may take several minutes to arrive."]})}),O(Tt,{initialSeconds:60,appearance:t,countdownText:K=>`Re-send code in ${K}s`,countdownCompleteText:"Re-send code",handleOnClick:f})]})]})}import{useState as St}from"react";import Jo from"color";import{isEmailValid as ft}from"@crossmint/common-sdk-auth";import{ChildWindow as Ko,PopupWindow as Vo}from"@crossmint/client-sdk-window";import{useEffect as zo,useRef as $o,useState as qo}from"react";import{z as dt}from"zod";var Q=e=>{let{crossmintAuth:o}=R(),{oauthUrlMap:r,setError:t}=h(),[n,i]=qo(!1),l=$o(null);return zo(()=>(l.current==null&&(l.current=new Ko(window.opener||window.parent,"*",{incomingEvents:jo})),()=>{l.current!=null&&l.current.off("authMaterialFromPopupCallback")}),[]),{createPopupAndSetupListeners:c=>w(void 0,null,function*(){if(l.current==null)throw new Error("Child window not initialized");i(!0),t(null);let m=new URL(r[e]);if(c!=null){let f=Array.from(m.searchParams.entries());m.search="",c&&m.searchParams.append("provider_login_hint",c),f.forEach(([g,y])=>{m.searchParams.append(g,y)})}let x=yield Vo.init(m.toString(),{awaitToLoad:!1,crossOrigin:!0,width:400,height:700}),u=f=>w(void 0,null,function*(){var g;yield o==null?void 0:o.handleRefreshAuthMaterial(f.oneTimeSecret),(g=l.current)==null||g.off("authMaterialFromPopupCallback"),x.window.close(),i(!1)}),a=f=>{var g;t(f.error),(g=l.current)==null||g.off("errorFromPopupCallback"),x.window.close(),i(!1)};l.current.on("authMaterialFromPopupCallback",u),l.current.on("errorFromPopupCallback",a);let d=setInterval(()=>{var f,g;(f=x.window)!=null&&f.closed&&(clearInterval(d),i(!1),(g=l.current)==null||g.off("authMaterialFromPopupCallback"))},2500)}),isLoading:n}},jo={authMaterialFromPopupCallback:dt.object({oneTimeSecret:dt.string()}),errorFromPopupCallback:dt.object({error:dt.string()})};import{jsx as wt,jsxs as Xo}from"react/jsx-runtime";function no({emailInput:e,appearance:o}){var n,i,l,s;let{createPopupAndSetupListeners:r,isLoading:t}=Q("google");return Xo("button",{type:"button",className:W("flex items-center gap-2 justify-center h-[32px] px-2.5 border border-cm-border rounded-xl bg-cm-background-primary","hover:bg-cm-hover focus:bg-cm-hover outline-none",t?"cursor-not-allowed hover:bg-cm-muted-primary":""),onClick:t?void 0:()=>r(e.trim().toLowerCase()),style:{backgroundColor:(n=o==null?void 0:o.colors)==null?void 0:n.buttonBackground,borderRadius:o==null?void 0:o.borderRadius},children:[wt(ut,{className:"max-h-[18px] max-w-[18px] h-[18px] w-[18px]"}),t?wt(D,{style:{color:(i=o==null?void 0:o.colors)==null?void 0:i.textSecondary,fill:(l=o==null?void 0:o.colors)==null?void 0:l.textPrimary,width:"18px",height:"18px"}}):wt("span",{className:"text-cm-accent",style:{color:(s=o==null?void 0:o.colors)==null?void 0:s.accent},children:"Continue"})]})}import{Fragment as Qo,jsx as _,jsxs as Pt}from"react/jsx-runtime";function io({setOtpEmailData:e}){var g,y,b,v,p,F,C,S,k,N,U,B,L,H;let{crossmintAuth:o}=R(),{appearance:r,defaultEmail:t,setStep:n,setError:i,loginMethods:l}=h(),[s,c]=St(t!=null?t:""),[m,x]=St(""),[u,a]=St(!1),d=s.toLowerCase().includes("@gmail.com")&&!s.toLowerCase().includes("+")&&ft(s)&&!u&&l.includes("google");function f(M){return w(this,null,function*(){M.preventDefault(),a(!0);try{let G=s.trim().toLowerCase(),V=yield o==null?void 0:o.sendEmailOtp(G);e({email:G,emailId:V.emailId}),n("otp")}catch(G){a(!1),i("Failed to send email. Please try again or contact support.")}})}return _(Qo,{children:_("div",{className:"flex flex-col items-start justify-start w-full rounded-lg",children:Pt("div",{className:"w-full",children:[_("label",{className:"text-cm-text-primary block mb-[5px]",style:{color:(g=r==null?void 0:r.colors)==null?void 0:g.textPrimary},children:"Email"}),Pt("form",{role:"form",className:"relative",onSubmit:M=>{if(d){M.preventDefault();return}ft(s)?f(M):M.preventDefault()},noValidate:!0,children:[_("label",{htmlFor:"emailInput",className:"sr-only",children:"Email"}),_("input",{className:W("flex-grow text-cm-text-primary text-left pl-[16px] h-[58px] w-full border border-cm-border rounded-xl bg-cm-background-primary placeholder:text-md","transition-none duration-200 ease-in-out","focus:outline-none focus-ring-custom","placeholder:[color:var(--placeholder-color)]",m?"border-red-500":"",d?"pr-[132px]":"pr-[80px]"),style:{color:(y=r==null?void 0:r.colors)==null?void 0:y.textPrimary,borderRadius:r==null?void 0:r.borderRadius,borderColor:m?(b=r==null?void 0:r.colors)==null?void 0:b.danger:(v=r==null?void 0:r.colors)==null?void 0:v.border,backgroundColor:(p=r==null?void 0:r.colors)==null?void 0:p.inputBackground,"--placeholder-color":(C=(F=r==null?void 0:r.colors)==null?void 0:F.textSecondary)!=null?C:"#67797F","--focus-ring-color":new Jo((k=(S=r==null?void 0:r.colors)==null?void 0:S.accent)!=null?k:"#04AA6D").alpha(.18).toString()},type:"email",placeholder:"your@email.com",value:s,onChange:M=>{c(M.target.value),x(""),i(null)},readOnly:u,"aria-describedby":"emailError"}),Pt("div",{className:"absolute inset-y-0 right-0 flex items-center pr-4",children:[m&&_(mt,{customColor:(N=r==null?void 0:r.colors)==null?void 0:N.danger}),u&&_(D,{style:{color:(U=r==null?void 0:r.colors)==null?void 0:U.textSecondary,fill:(B=r==null?void 0:r.colors)==null?void 0:B.textPrimary}}),d?_(no,{emailInput:s,appearance:r}):!m&&!u?_("button",{type:"submit",className:W("font-medium text-cm-accent text-nowrap bg-cm-background-primary",ft(s)?"cursor-pointer":"!cursor-not-allowed opacity-60"),style:{color:(L=r==null?void 0:r.colors)==null?void 0:L.accent,backgroundColor:(H=r==null?void 0:r.colors)==null?void 0:H.inputBackground},disabled:!ft(s)||u,children:"Submit"}):null]})]}),m&&_("p",{className:"text-xs text-red-500 mb-2 pt-2",children:m})]})})})}import{jsx as lo}from"react/jsx-runtime";function so(){let{step:e}=h(),[o,r]=Yo(null);return e==="otp"?lo(eo,{otpEmailData:o,setOtpEmailData:r}):e==="initial"?lo(io,{setOtpEmailData:r}):null}import{jsx as At,jsxs as Zo}from"react/jsx-runtime";function mo({appearance:e,text:o}){var t,n,i;let{step:r}=h();return r!=="initial"?null:Zo("div",{className:"flex items-center justify-center w-full pt-2 pb-3",children:[At("span",{className:"w-full h-[1px] bg-cm-border",style:{backgroundColor:(t=e==null?void 0:e.colors)==null?void 0:t.border}}),o!=null?At("p",{className:"flex-none px-2 text-sm text-cm-text-primary",style:{color:(n=e==null?void 0:e.colors)==null?void 0:n.textSecondary},children:o}):null,At("span",{className:"w-full h-[1px] bg-cm-border",style:{backgroundColor:(i=e==null?void 0:e.colors)==null?void 0:i.border}})]})}import{Fragment as tr,jsx as gt,jsxs as uo}from"react/jsx-runtime";function ao(o){var e=X(o,[]);var c,m,x,u;let{step:r,appearance:t,isLoadingOauthUrlMap:n}=h(),{createPopupAndSetupListeners:i,isLoading:l}=Q("google"),s=n||l;return r!=="initial"?null:uo("button",$(z({className:W("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none",s?"cursor-not-allowed hover:bg-cm-muted-primary":""),style:{borderRadius:t==null?void 0:t.borderRadius,backgroundColor:(c=t==null?void 0:t.colors)==null?void 0:c.buttonBackground},onClick:s?void 0:()=>i()},e),{children:[uo(tr,{children:[gt(ut,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),s?gt(D,{style:{color:(m=t==null?void 0:t.colors)==null?void 0:m.textSecondary,fill:(x=t==null?void 0:t.colors)==null?void 0:x.textPrimary}}):gt("span",{className:"font-medium",style:{margin:"0px 32px",color:(u=t==null?void 0:t.colors)==null?void 0:u.textPrimary},children:"Sign in with Google"})]}),gt("span",{className:"sr-only",children:"Sign in with Google"})]}))}import{useEffect as Et,useMemo as or,useState as rr}from"react";import{useSignIn as er,QRCode as nr}from"@farcaster/auth-kit";import{Fragment as lr,jsx as I,jsxs as et}from"react/jsx-runtime";function co(){var n,i;let{step:e,appearance:o,setStep:r,setError:t}=h();return e==="initial"?I("div",{children:et("button",{className:W("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none"),style:{borderRadius:o==null?void 0:o.borderRadius,backgroundColor:(n=o==null?void 0:o.colors)==null?void 0:n.buttonBackground},onClick:()=>{r("qrCode"),t(null)},children:[I(Dt,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),I("span",{className:"font-medium",style:{margin:"0px 32px",color:(i=o==null?void 0:o.colors)==null?void 0:i.textPrimary},children:"Sign in with Farcaster"}),I("span",{className:"sr-only",children:"Sign in with Farcaster"})]})}):e==="qrCode"?I(ir,{}):null}function ir(){var f,g,y,b,v,p,F,C,S;let{crossmintAuth:e}=R(),{appearance:o,setStep:r,setDialogOpen:t,setError:n}=h(),[i,l]=rr(null),s=or(()=>({onSuccess:k=>{l(k)}}),[]),{signIn:c,url:m,connect:x,signOut:u,isConnected:a}=er(s),d=k=>w(this,null,function*(){n(null);try{let N=yield e==null?void 0:e.signInWithFarcaster(k);yield e==null?void 0:e.handleRefreshAuthMaterial(N),t(!1),r("initial")}catch(N){console.error("Error during Farcaster sign-in:",N),n("Failed to sign in with Farcaster")}});return Et(()=>{i!=null&&d(i)},[i]),Et(()=>{a&&c()},[a]),Et(()=>{x()},[]),et("div",{children:[I(J,{onClick:()=>{u(),r("initial")},iconColor:(f=o==null?void 0:o.colors)==null?void 0:f.textPrimary,ringColor:(g=o==null?void 0:o.colors)==null?void 0:g.accent}),et("div",{className:"flex flex-col items-center gap-4",children:[et("div",{className:"text-center",children:[I("h3",{className:"text-lg font-semibold text-cm-text-primary mb-2",style:{color:(y=o==null?void 0:o.colors)==null?void 0:y.textPrimary},children:"Sign in with Farcaster"}),I("p",{className:"text-base font-normal text-cm-text-secondary",style:{color:(b=o==null?void 0:o.colors)==null?void 0:b.textSecondary},children:"Scan with your phone's camera to continue."})]}),I("div",{className:"bg-white aspect-square rounded-lg p-4",style:{backgroundColor:(v=o==null?void 0:o.colors)==null?void 0:v.inputBackground,borderRadius:o==null?void 0:o.borderRadius},children:m!=null?I(nr,{uri:m,size:280}):I("div",{className:"min-h-[246px] flex items-center justify-center",children:I(D,{style:{color:(p=o==null?void 0:o.colors)==null?void 0:p.textSecondary,fill:(F=o==null?void 0:o.colors)==null?void 0:F.textPrimary}})})}),m?et(lr,{children:[I("p",{className:"text-base text-center font-normal text-cm-text-secondary",style:{color:(C=o==null?void 0:o.colors)==null?void 0:C.textSecondary},children:"Alternatively, click on this link to open Warpcast."}),I("a",{href:m,rel:"noopener noreferrer",target:"_blank",className:"text-base font-normal text-cm-link",style:{color:(S=o==null?void 0:o.colors)==null?void 0:S.textLink},children:"Open Warpcast"})]}):null]})]})}import{Fragment as sr,jsx as ht,jsxs as fo}from"react/jsx-runtime";function go(o){var e=X(o,[]);var c,m,x,u;let{step:r,appearance:t,isLoadingOauthUrlMap:n}=h(),{createPopupAndSetupListeners:i,isLoading:l}=Q("twitter"),s=n||l;return r!=="initial"?null:fo("button",$(z({className:W("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none",s?"cursor-not-allowed hover:bg-cm-muted-primary":""),style:{borderRadius:t==null?void 0:t.borderRadius,backgroundColor:(c=t==null?void 0:t.colors)==null?void 0:c.buttonBackground},onClick:s?void 0:()=>i()},e),{children:[fo(sr,{children:[ht(Gt,{className:"max-h-[25px] max-w-[25px] h-[25px] w-[25px] absolute left-[18px]"}),s?ht(D,{style:{color:(m=t==null?void 0:t.colors)==null?void 0:m.textSecondary,fill:(x=t==null?void 0:t.colors)==null?void 0:x.textPrimary}}):ht("span",{className:"font-medium",style:{margin:"0px 32px",color:(u=t==null?void 0:t.colors)==null?void 0:u.textPrimary},children:"Sign in with X"})]}),ht("span",{className:"sr-only",children:"Sign in with X"})]}))}import{jsx as xt,jsxs as mr}from"react/jsx-runtime";function ho(){var n,i,l,s,c;let{step:e,appearance:o,setStep:r,setError:t}=h();return e!=="initial"?null:mr("button",{className:W("relative flex text-base p-4 bg-cm-muted-primary text-cm-text-primary items-center w-full rounded-xl justify-center","transition-colors duration-200 ease-in-out","hover:bg-cm-hover focus:bg-cm-hover outline-none"),style:{borderRadius:o==null?void 0:o.borderRadius,borderColor:(n=o==null?void 0:o.colors)==null?void 0:n.border,backgroundColor:(i=o==null?void 0:o.colors)==null?void 0:i.buttonBackground},onClick:()=>{r("web3"),t(null)},children:[xt(Vt,{className:"h-[21px] w-[21px] absolute left-[20px]",style:{color:(l=o==null?void 0:o.colors)==null?void 0:l.textPrimary}}),xt("span",{className:"font-medium",style:{margin:"0px 32px",color:(s=o==null?void 0:o.colors)==null?void 0:s.textPrimary},children:"Continue with a wallet"}),xt(Kt,{className:"h-[21px] w-[21px] absolute right-[20px]",style:{color:(c=o==null?void 0:o.colors)==null?void 0:c.textSecondary}}),xt("span",{className:"sr-only",children:"Continue with a wallet"})]})}import{DynamicEmbeddedWidget as ur}from"@dynamic-labs/sdk-react-core";import{Fragment as ar,jsx as nt,jsxs as cr}from"react/jsx-runtime";function xo(){var t,n;let{appearance:e,step:o,setStep:r}=h();return o==="web3"?cr(ar,{children:[nt(J,{onClick:()=>r("initial"),iconColor:(t=e==null?void 0:e.colors)==null?void 0:t.textPrimary,ringColor:(n=e==null?void 0:e.colors)==null?void 0:n.accent}),nt("div",{className:"flex flex-col items-center",children:nt("div",{className:"flex flex-col gap-[10px] w-full",children:nt("div",{className:"widget-container",children:nt(ur,{background:"none"})})})})]}):null}import{jsx as yo}from"react/jsx-runtime";function bo(){let{step:e}=h();return e.startsWith("web3")?yo(xo,{}):e==="initial"?yo(ho,{}):null}import{jsx as T,jsxs as it}from"react/jsx-runtime";function vo({className:e}){var c,m,x,u,a,d,f,g,y,b,v,p,F;let{step:o,appearance:r,loginMethods:t,baseUrl:n,error:i,termsOfServiceText:l,authModalTitle:s}=h();return it("div",{className:W("relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none",e),children:[i!=null?it("div",{className:"flex items-start justify-start w-full rounded-lg p-2 mt-4 bg-cm-danger-muted",style:{backgroundColor:new dr((m=(c=r==null?void 0:r.colors)==null?void 0:c.danger)!=null?m:"#f44336").alpha(.12).toString()},children:[T("div",{className:"min-w-[20px]",children:T(mt,{customColor:(u=(x=r==null?void 0:r.colors)==null?void 0:x.danger)!=null?u:"#f44336"})}),T("p",{className:"ml-2 text-sm",style:{color:(d=(a=r==null?void 0:r.colors)==null?void 0:a.danger)!=null?d:"#f44336"},children:i})]}):null,o==="initial"?it("div",{children:[T("h1",{className:"text-2xl font-bold text-cm-text-primary",style:{color:(f=r==null?void 0:r.colors)==null?void 0:f.textPrimary},children:s!=null?s:"Sign in to Crossmint"}),T("p",{className:"text-base font-normal mb-3 text-cm-text-secondary",style:{color:(g=r==null?void 0:r.colors)==null?void 0:g.textSecondary},children:"Access using one of the options below."})]}):null,t.includes("google")?T(ao,{}):null,t.includes("farcaster")?T(Ht,{baseUrl:n,children:T(co,{})}):null,t.includes("twitter")?T(go,{}):null,t.some(C=>C.startsWith("web3"))?T(bo,{}):null,t.includes("email")?it("div",{children:[t.length>1?T(mo,{appearance:r,text:"OR"}):null,T(so,{})]}):null,o==="initial"&&l!=null?it("div",{className:"text-sm text-center text-cm-text-secondary mt-2",style:{color:(y=r==null?void 0:r.colors)==null?void 0:y.textSecondary},children:[T("style",{children:`
8
8
  p a {
9
9
  color: ${(v=(b=r==null?void 0:r.colors)==null?void 0:b.textLink)!=null?v:"#1A74E9"};
10
10
  }
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkF2PJZF7Hcjs = require('./chunk-F2PJZF7H.cjs');var _chunkCNLXVMBDcjs = require('./chunk-CNLXVMBD.cjs');var _chunkHLGNSXEQcjs = require('./chunk-HLGNSXEQ.cjs');var _chunkHG5ML6KXcjs = require('./chunk-HG5ML6KX.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function W({phone:U,onSubmitOTP:_,onResendCode:d,appearance:o}){var f,g,y,P,h,c,v,k,b,T,e,O,C,I,S,B,E,N;let[u,M]=_react.useState.call(void 0, ""),[$,m]=_react.useState.call(void 0, !1),[j,n]=_react.useState.call(void 0, !1),[x,i]=_react.useState.call(void 0, null),q=()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){n(!0);try{yield _(u),m(!1),i(null)}catch(s){console.error("Error confirming recovery key OTP",s),i("Invalid code. Please try again."),m(!0)}finally{n(!1)}});return _jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col items-center justify-start w-full",children:[_jsxruntime.jsx.call(void 0, "div",{className:"relative left-3",children:_jsxruntime.jsx.call(void 0, _chunkCNLXVMBDcjs.a,{customAccentColor:(f=o==null?void 0:o.colors)==null?void 0:f.accent,customButtonBackgroundColor:(g=o==null?void 0:o.colors)==null?void 0:g.buttonBackground,customBackgroundColor:(y=o==null?void 0:o.colors)==null?void 0:y.background})}),_jsxruntime.jsx.call(void 0, "p",{className:"text-base font-normal mt-4 mb-1 text-center text-cm-text-primary",style:{color:(P=o==null?void 0:o.colors)==null?void 0:P.textPrimary},children:"Check your phone"}),_jsxruntime.jsxs.call(void 0, "p",{className:"text-center text-cm-text-secondary px-4",style:{color:(h=o==null?void 0:o.colors)==null?void 0:h.textSecondary},children:["A temporary login code has been sent to ",U]}),_jsxruntime.jsx.call(void 0, "div",{className:"py-8",children:_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.a,{maxLength:9,value:u,onChange:s=>{M(s),m(!1),i(null)},onComplete:q,disabled:j,customStyles:{accent:(v=(c=o==null?void 0:o.colors)==null?void 0:c.accent)!=null?v:"#04AA6D",danger:(b=(k=o==null?void 0:o.colors)==null?void 0:k.danger)!=null?b:"#f44336",border:(e=(T=o==null?void 0:o.colors)==null?void 0:T.border)!=null?e:"#E5E7EB",textPrimary:(C=(O=o==null?void 0:o.colors)==null?void 0:O.textPrimary)!=null?C:"#909ca3",buttonBackground:(S=(I=o==null?void 0:o.colors)==null?void 0:I.buttonBackground)!=null?S:"#eff6ff",inputBackground:(E=(B=o==null?void 0:o.colors)==null?void 0:B.inputBackground)!=null?E:"#FFFFFF",borderRadius:o==null?void 0:o.borderRadius},children:_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.b,{children:Array.from({length:9}).map((s,w)=>_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.c,{index:w,hasError:$,className:"max-sm:w-7 max-sm:h-11 max-sm:text-xl max-sm:mx-0 h-12 w-9"},w))})})}),x&&_jsxruntime.jsx.call(void 0, "div",{className:"text-sm text-red-500 mb-4",children:x}),_jsxruntime.jsx.call(void 0, "div",{className:"text-xs leading-tight text-cm-text-secondary text-center",children:_jsxruntime.jsxs.call(void 0, "span",{style:{color:(N=o==null?void 0:o.colors)==null?void 0:N.textSecondary},children:["Didn't receive the SMS? Check your signal.",`
2
+ `,"Some messages may take several minutes to arrive."]})}),d&&_jsxruntime.jsx.call(void 0, _chunkHLGNSXEQcjs.a,{initialSeconds:60,appearance:o,countdownText:s=>`Re-send code in ${s}s`,countdownCompleteText:"Re-send code",handleOnClick:d})]})}exports.a = W;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFYCKQBCIcjs = require('./chunk-FYCKQBCI.cjs');var _jsxruntime = require('react/jsx-runtime');function u(){return _jsxruntime.jsx.call(void 0, _chunkFYCKQBCIcjs.v,{className:"w-full"})}exports.a = u;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIYOY7DV2cjs = require('./chunk-IYOY7DV2.cjs');var _jsxruntime = require('react/jsx-runtime');function u(){return _jsxruntime.jsx.call(void 0, _chunkIYOY7DV2cjs.v,{className:"w-full"})}exports.a = u;
@@ -1 +1 @@
1
- import{a as C}from"./chunk-EA7H4AXL.js";import{a}from"./chunk-2KRNJ7ZH.js";import{a as m,b as u,c as s}from"./chunk-PXDN3KFO.js";import{useCrossmint as M}from"@crossmint/client-sdk-react-base";import{crossmintHostedCheckoutV3Service as N,crossmintHostedCheckoutV3StylesService as R}from"@crossmint/client-sdk-base";import T from"clsx";import{useEffect as j,useState as w}from"react";import{jsx as l,jsxs as D}from"react/jsx-runtime";function F(d){let[f,h]=w(!1),{crossmint:k}=M(),y=a(k),c=d,{recipient:P,locale:g,lineItems:H,payment:S,appearance:V,metadata:v}=c,b=s(c,["recipient","locale","lineItems","payment","appearance","metadata"]),n={recipient:P,locale:g,lineItems:H,payment:S,appearance:V,metadata:v},x=N({apiClient:y,hostedCheckoutProps:n}),t=R(n),p=b,{onClick:r,className:E,children:o}=p,I=s(p,["onClick","className","children"]);function B(e){e.preventDefault(),e.stopPropagation(),x.createWindow(),r&&r(e)}let i=t.generateCss();return j(()=>{let{cleanup:e}=t.injectCss(i);return h(!0),e},[i]),f?D("button",u(m({onClick:B,className:T(t.identifiers.buttonClassNames,E)},I),{children:[l(C,{style:{marginRight:"12px",flex:"none"},displayType:"icon-only",id:t.identifiers.logoId,height:16,width:16}),o!=null?o:l("p",{style:{margin:0},children:t.getButtonText()})]})):null}export{F as a};
1
+ import{a as C}from"./chunk-EA7H4AXL.js";import{a}from"./chunk-S7MVGO3P.js";import{a as m,b as u,c as s}from"./chunk-PXDN3KFO.js";import{useCrossmint as M}from"@crossmint/client-sdk-react-base";import{crossmintHostedCheckoutV3Service as N,crossmintHostedCheckoutV3StylesService as R}from"@crossmint/client-sdk-base";import T from"clsx";import{useEffect as j,useState as w}from"react";import{jsx as l,jsxs as D}from"react/jsx-runtime";function F(d){let[f,h]=w(!1),{crossmint:k}=M(),y=a(k),c=d,{recipient:P,locale:g,lineItems:H,payment:S,appearance:V,metadata:v}=c,b=s(c,["recipient","locale","lineItems","payment","appearance","metadata"]),n={recipient:P,locale:g,lineItems:H,payment:S,appearance:V,metadata:v},x=N({apiClient:y,hostedCheckoutProps:n}),t=R(n),p=b,{onClick:r,className:E,children:o}=p,I=s(p,["onClick","className","children"]);function B(e){e.preventDefault(),e.stopPropagation(),x.createWindow(),r&&r(e)}let i=t.generateCss();return j(()=>{let{cleanup:e}=t.injectCss(i);return h(!0),e},[i]),f?D("button",u(m({onClick:B,className:T(t.identifiers.buttonClassNames,E)},I),{children:[l(C,{style:{marginRight:"12px",flex:"none"},displayType:"icon-only",id:t.identifiers.logoId,height:16,width:16}),o!=null?o:l("p",{style:{margin:0},children:t.getButtonText()})]})):null}export{F as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var s="2.2.15";var c=s;exports.a = c;
@@ -1 +1 @@
1
- import{a as y}from"./chunk-5X3MPD2V.js";import{a as l}from"./chunk-2KRNJ7ZH.js";import{a,b as p}from"./chunk-PXDN3KFO.js";import{useCrossmint as E}from"@crossmint/client-sdk-react-base";import{lazy as v,useEffect as h,useRef as s,useState as f}from"react";import{crossmintEmbeddedCheckoutV3Service as S}from"@crossmint/client-sdk-base";import{Fragment as x,jsx as o,jsxs as H}from"react/jsx-runtime";var V=v(()=>import("./components/embed/v3/crypto/CryptoWalletConnectionHandler.js").then(r=>({default:r.CryptoWalletConnectionHandler})));function K(r){var m;let[e,C]=f(null),[P,b]=f(0),g=s((m=r.payment.crypto.payer)==null?void 0:m.initialChain),n=s(r);if(I(r,n.current)){let t=a({},r),u=w(r,g.current);u.shouldPreserve&&(t.payment.crypto.payer=u.updatedPayer),n.current=t}let{crossmint:k}=E(),c=l(k,{usageOrigin:"client"}),d=S({apiClient:c}),i=s(null);return h(()=>{let t=i.current;!t||e||C(d.iframe.createClient(t))},[i.current,e]),h(()=>{if(e!=null)return e.on("ui:height.changed",t=>b(t.height)),()=>{e.off("ui:height.changed")}},[e]),H(x,{children:[o("iframe",{ref:i,src:d.iframe.getUrl(n.current),id:"crossmint-embedded-checkout.iframe",role:"crossmint-embedded-checkout.iframe",allow:"payment *; microphone; camera",style:{boxShadow:"none",border:"none",padding:"0px",width:"100%",minWidth:"100%",overflow:"hidden",display:"block",userSelect:"none",transform:"translate(0px)",opacity:"1",transition:"ease 0s, opacity 0.4s ease 0.1s",height:`${P}px`,backgroundColor:"transparent"}}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?o(y,{payer:n.current.payment.crypto.payer,iframeClient:e}):o(V,{iframeClient:e,apiKeyEnvironment:c.parsedAPIKey.environment}):null,o("span",{id:"crossmint-focus-target",tabIndex:-1})]})}function I(r,e){return JSON.stringify(r)!==JSON.stringify(e)}function w(r,e){return r.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:p(a({},r.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}export{K as a};
1
+ import{a as y}from"./chunk-5X3MPD2V.js";import{a as l}from"./chunk-S7MVGO3P.js";import{a,b as p}from"./chunk-PXDN3KFO.js";import{useCrossmint as E}from"@crossmint/client-sdk-react-base";import{lazy as v,useEffect as h,useRef as s,useState as f}from"react";import{crossmintEmbeddedCheckoutV3Service as S}from"@crossmint/client-sdk-base";import{Fragment as x,jsx as o,jsxs as H}from"react/jsx-runtime";var V=v(()=>import("./components/embed/v3/crypto/CryptoWalletConnectionHandler.js").then(r=>({default:r.CryptoWalletConnectionHandler})));function K(r){var m;let[e,C]=f(null),[P,b]=f(0),g=s((m=r.payment.crypto.payer)==null?void 0:m.initialChain),n=s(r);if(I(r,n.current)){let t=a({},r),u=w(r,g.current);u.shouldPreserve&&(t.payment.crypto.payer=u.updatedPayer),n.current=t}let{crossmint:k}=E(),c=l(k,{usageOrigin:"client"}),d=S({apiClient:c}),i=s(null);return h(()=>{let t=i.current;!t||e||C(d.iframe.createClient(t))},[i.current,e]),h(()=>{if(e!=null)return e.on("ui:height.changed",t=>b(t.height)),()=>{e.off("ui:height.changed")}},[e]),H(x,{children:[o("iframe",{ref:i,src:d.iframe.getUrl(n.current),id:"crossmint-embedded-checkout.iframe",role:"crossmint-embedded-checkout.iframe",allow:"payment *; microphone; camera",style:{boxShadow:"none",border:"none",padding:"0px",width:"100%",minWidth:"100%",overflow:"hidden",display:"block",userSelect:"none",transform:"translate(0px)",opacity:"1",transition:"ease 0s, opacity 0.4s ease 0.1s",height:`${P}px`,backgroundColor:"transparent"}}),n.current.payment.crypto.enabled?n.current.payment.crypto.payer!=null?o(y,{payer:n.current.payment.crypto.payer,iframeClient:e}):o(V,{iframeClient:e,apiKeyEnvironment:c.parsedAPIKey.environment}):null,o("span",{id:"crossmint-focus-target",tabIndex:-1})]})}function I(r,e){return JSON.stringify(r)!==JSON.stringify(e)}function w(r,e){return r.payment.crypto.payer&&e!=null?{shouldPreserve:!0,updatedPayer:p(a({},r.payment.crypto.payer),{initialChain:e})}:{shouldPreserve:!1}}export{K as a};
@@ -1 +1 @@
1
- import{a as t}from"./chunk-CNKSQE42.js";import{assertValidValidateNFTDetailProps as e,getNFTDetailSrc as i}from"@crossmint/client-sdk-base";import{jsx as s}from"react/jsx-runtime";function d(r){e(r);let o=i(r,t);return s("iframe",{src:o,width:"100%",height:"100%",style:{flexGrow:"1",border:"none",margin:"0",padding:"0"},role:"nft-details"})}export{d as a};
1
+ import{a as t}from"./chunk-DR6MFZ6K.js";import{assertValidValidateNFTDetailProps as e,getNFTDetailSrc as i}from"@crossmint/client-sdk-base";import{jsx as s}from"react/jsx-runtime";function d(r){e(r);let o=i(r,t);return s("iframe",{src:o,width:"100%",height:"100%",style:{flexGrow:"1",border:"none",margin:"0",padding:"0"},role:"nft-details"})}export{d as a};
@@ -0,0 +1 @@
1
+ import{a as x}from"./chunk-TNCETEEL.js";import{a as u}from"./chunk-NBJIJZGO.js";import{d as a}from"./chunk-PXDN3KFO.js";import{useState as h}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";function S({phone:r,onConfirm:v,onCancel:C,appearance:t}){var m,c,f;let[e,i]=h(!1),[l,y]=h(""),g=()=>a(this,null,function*(){i(!0);try{yield v(r)}catch(w){console.error("Error sending authorization code:",w),y("Failed to send code. Please try again.")}finally{i(!1)}}),b=((m=t==null?void 0:t.colors)==null?void 0:m.accent)||"#4CAF50",n=((c=t==null?void 0:t.colors)==null?void 0:c.textPrimary)||"#000000",d=((f=t==null?void 0:t.colors)==null?void 0:f.border)||"#E0E0E0";return s("div",{className:"flex flex-col w-full max-w-md mx-auto rounded-xl",children:[o("h2",{className:"mb-2",style:{color:n},children:"Send authorization code to"}),o("div",{className:"w-full mb-8 p-4 rounded-xl border",style:{borderColor:d},children:s("div",{className:"flex items-center",children:[o("div",{className:"flex-shrink-0 mr-3",children:o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-phone",children:o("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"})})}),o("span",{style:{color:n},children:r})]})}),l&&o("div",{className:"text-red-500 mb-4 text-sm",children:l}),s("div",{className:"flex gap-3",children:[o("button",{onClick:C,className:"flex-1 py-4 px-6 border rounded-full text-center font-medium",style:{borderColor:d},children:"Cancel"}),o("button",{onClick:g,disabled:e,className:u("flex-1 py-4 px-6 rounded-full text-white text-center font-medium",e?"opacity-70":""),style:{backgroundColor:b},children:e?o("div",{className:"flex justify-center items-center",children:o(x,{style:{color:"white"}})}):"Send code"})]})]})}export{S as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3SYFPWRNcjs = require('./chunk-3SYFPWRN.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _jsxruntime = require('react/jsx-runtime');function s(d){return _jsxruntime.jsx.call(void 0, _chunk3SYFPWRNcjs.a,_chunk2WSEHVNPcjs.a.call(void 0, {},d))}exports.a = s;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6G6PC4PFcjs = require('./chunk-6G6PC4PF.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _jsxruntime = require('react/jsx-runtime');function s(d){return _jsxruntime.jsx.call(void 0, _chunk6G6PC4PFcjs.a,_chunk2WSEHVNPcjs.a.call(void 0, {},d))}exports.a = s;
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkF2PJZF7Hcjs = require('./chunk-F2PJZF7H.cjs');var _chunkHLGNSXEQcjs = require('./chunk-HLGNSXEQ.cjs');var _chunkHG5ML6KXcjs = require('./chunk-HG5ML6KX.cjs');var _chunkI4GMMHQRcjs = require('./chunk-I4GMMHQR.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function W({email:_,onSubmitOTP:D,onResendCode:d,appearance:o}){var f,y,g,P,c,k,v,b,T,h,O,C,E,I,B,e,N,S;let[u,$]=_react.useState.call(void 0, ""),[j,m]=_react.useState.call(void 0, !1),[q,n]=_react.useState.call(void 0, !1),[x,i]=_react.useState.call(void 0, null),z=()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){n(!0);try{yield D(u),m(!1),i(null)}catch(s){console.error("Error confirming recovery key OTP",s),i("Invalid code. Please try again."),m(!0)}finally{n(!1)}});return _jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col items-center justify-start w-full",children:[_jsxruntime.jsx.call(void 0, "div",{className:"relative left-3",children:_jsxruntime.jsx.call(void 0, _chunkI4GMMHQRcjs.a,{customAccentColor:(f=o==null?void 0:o.colors)==null?void 0:f.accent,customButtonBackgroundColor:(y=o==null?void 0:o.colors)==null?void 0:y.buttonBackground,customBackgroundColor:(g=o==null?void 0:o.colors)==null?void 0:g.background})}),_jsxruntime.jsx.call(void 0, "p",{className:"text-base font-normal mt-4 mb-1 text-center text-cm-text-primary",style:{color:(P=o==null?void 0:o.colors)==null?void 0:P.textPrimary},children:"Check your email"}),_jsxruntime.jsxs.call(void 0, "p",{className:"text-center text-cm-text-secondary px-4",style:{color:(c=o==null?void 0:o.colors)==null?void 0:c.textSecondary},children:["A temporary login code has been sent to ",_]}),_jsxruntime.jsx.call(void 0, "div",{className:"py-8",children:_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.a,{maxLength:9,value:u,onChange:s=>{$(s),m(!1),i(null)},onComplete:z,disabled:q,customStyles:{accent:(v=(k=o==null?void 0:o.colors)==null?void 0:k.accent)!=null?v:"#04AA6D",danger:(T=(b=o==null?void 0:o.colors)==null?void 0:b.danger)!=null?T:"#f44336",border:(O=(h=o==null?void 0:o.colors)==null?void 0:h.border)!=null?O:"#E5E7EB",textPrimary:(E=(C=o==null?void 0:o.colors)==null?void 0:C.textPrimary)!=null?E:"#909ca3",buttonBackground:(B=(I=o==null?void 0:o.colors)==null?void 0:I.buttonBackground)!=null?B:"#eff6ff",inputBackground:(N=(e=o==null?void 0:o.colors)==null?void 0:e.inputBackground)!=null?N:"#FFFFFF",borderRadius:o==null?void 0:o.borderRadius},children:_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.b,{children:Array.from({length:9}).map((s,w)=>_jsxruntime.jsx.call(void 0, _chunkHG5ML6KXcjs.c,{index:w,hasError:j,className:"max-sm:w-7 max-sm:h-11 max-sm:text-xl max-sm:mx-0 h-12 w-9"},w))})})}),x&&_jsxruntime.jsx.call(void 0, "div",{className:"text-sm text-red-500 mb-4",children:x}),_jsxruntime.jsx.call(void 0, "div",{className:"text-xs leading-tight text-cm-text-secondary text-center",children:_jsxruntime.jsxs.call(void 0, "span",{style:{color:(S=o==null?void 0:o.colors)==null?void 0:S.textSecondary},children:["Can't find the email? Check spam folder.",`
2
+ `,"Some emails may take several minutes to arrive."]})}),d&&_jsxruntime.jsx.call(void 0, _chunkHLGNSXEQcjs.a,{initialSeconds:60,appearance:o,countdownText:s=>`Re-send code in ${s}s`,countdownCompleteText:"Re-send code",handleOnClick:d})]})}exports.a = W;
@@ -1 +1 @@
1
- import{a as n}from"./chunk-CNKSQE42.js";import{CrossmintApiClient as e}from"@crossmint/common-sdk-base";function m(t,i){return new e(t,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-ui",version:n},apiKeyExpectations:i}})}export{m as a};
1
+ import{a as n}from"./chunk-DR6MFZ6K.js";import{CrossmintApiClient as e}from"@crossmint/common-sdk-base";function m(t,i){return new e(t,{internalConfig:{sdkMetadata:{name:"@crossmint/client-sdk-react-ui",version:n},apiKeyExpectations:i}})}export{m as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkB7QO52HDcjs = require('./chunk-B7QO52HD.cjs');var _chunkUXNLOKSGcjs = require('./chunk-UXNLOKSG.cjs');var _chunk4I42JCKBcjs = require('./chunk-4I42JCKB.cjs');var _chunkX4BUSZRJcjs = require('./chunk-X4BUSZRJ.cjs');var _chunk2WSEHVNPcjs = require('./chunk-2WSEHVNP.cjs');var _react = require('react');var _reactdom = require('react-dom');var _clientsdkreactbase = require('@crossmint/client-sdk-react-base');var _jsxruntime = require('react/jsx-runtime');var p=P=>()=>{throw new Error(`${P} is not available. Make sure you're using an email or phone signer wallet.`)};function re({children:P,showPasskeyHelpers:c=!0,appearance:m,createOnLogin:t,callbacks:i}){let{experimental_customAuth:r}=_clientsdkreactbase.useCrossmint.call(void 0, ),[h,y]=_react.useState.call(void 0, {open:!1}),[g,f]=_react.useState.call(void 0, !1),[V,v]=_react.useState.call(void 0, "initial"),[O,S]=_react.useState.call(void 0, !1),[B,T]=_react.useState.call(void 0, "initial"),[M,I]=_react.useState.call(void 0, !1),C=_react.useRef.call(void 0, p("sendEmailWithOtp")),w=_react.useRef.call(void 0, p("verifyOtp")),R=_react.useRef.call(void 0, p("sendPhoneWithOtp")),b=_react.useRef.call(void 0, p("verifyPhoneOtp")),n=_react.useRef.call(void 0, p("reject")),E=_react.useCallback.call(void 0, e=>()=>new Promise(o=>{if(!c){o();return}y({type:e,open:!0,primaryActionOnClick:()=>{y({open:!1}),o()},secondaryActionOnClick:()=>{y({open:!1}),o()}})}),[c]),k=()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){try{yield C.current(),v("otp")}catch(e){console.error("Failed to send email OTP",e),n.current(new Error("Failed to send email OTP"))}}),U=e=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){try{yield w.current(e),f(!1),v("initial")}catch(o){console.error("Failed to verify OTP",o),n.current(new Error("Failed to verify OTP"))}}),W=()=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){try{yield R.current(),T("otp")}catch(e){console.error("Failed to send phone OTP",e),n.current(new Error("Failed to send phone OTP"))}}),A=e=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){try{yield b.current(e),S(!1),T("initial")}catch(o){console.error("Failed to verify phone OTP",o),n.current(new Error("Failed to verify phone OTP"))}});return _jsxruntime.jsx.call(void 0, _chunkX4BUSZRJcjs.a,{children:_jsxruntime.jsxs.call(void 0, _clientsdkreactbase.CrossmintWalletBaseProvider,{createOnLogin:t,onAuthRequired:(e,o,D,$)=>_chunk2WSEHVNPcjs.d.call(void 0, this,null,function*(){(t==null?void 0:t.signer.type)==="phone"&&t.signer.phone?(S(e),R.current=o,b.current=D):(f(e),C.current=o,w.current=D),I(e),n.current=$}),callbacks:(()=>{let e=i==null?void 0:i.onWalletCreationStart,o=i==null?void 0:i.onTransactionStart;return(t==null?void 0:t.signer.type)==="passkey"&&c&&(e=E("create-wallet"),o=E("transaction")),{onWalletCreationStart:e,onTransactionStart:o}})(),children:[P,g&&(r==null?void 0:r.email)!=null?_reactdom.createPortal.call(void 0, _jsxruntime.jsx.call(void 0, _chunk4I42JCKBcjs.a,{rejectRef:n,email:r==null?void 0:r.email,open:g,setOpen:f,step:V,onSubmitOTP:U,onResendOTPCode:k,onSubmitEmail:k,appearance:m}),document.body):null,O&&(r==null?void 0:r.phone)!=null?_reactdom.createPortal.call(void 0, _jsxruntime.jsx.call(void 0, _chunkUXNLOKSGcjs.a,{rejectRef:n,phone:r==null?void 0:r.phone,open:O,setOpen:S,step:B,onSubmitOTP:A,onResendOTPCode:W,onSubmitPhone:W,appearance:m}),document.body):null,h.open?_reactdom.createPortal.call(void 0, _jsxruntime.jsx.call(void 0, _chunkB7QO52HDcjs.a,{state:h,appearance:m}),document.body):null]})})}exports.a = re;
@@ -1 +1 @@
1
- import{a as o}from"./chunk-2KRNJ7ZH.js";import{createContext as p,useContext as h,useEffect as l,useState as i}from"react";import{useCrossmint as g}from"@crossmint/client-sdk-react-base";import{jsx as k}from"react/jsx-runtime";var s=p(void 0);function b({children:e}){let[r,d]=i(void 0),[c,u]=i(void 0),{crossmint:C}=g(),m=o(C,{usageOrigin:"client"});return l(()=>{let n=t=>{if(t.origin!==new URL(m.baseUrl).origin||t.data.event!=="order:updated")return;let{order:a,orderClientSecret:f}=t.data.data;d(a),u(f)};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[r]),k(s.Provider,{value:{order:r,orderClientSecret:c},children:e})}function S(){let e=h(s);if(!e)throw new Error("useCrossmintCheckout must be used within a CrossmintCheckoutProvider");return e}export{b as a,S as b};
1
+ import{a as o}from"./chunk-S7MVGO3P.js";import{createContext as p,useContext as h,useEffect as l,useState as i}from"react";import{useCrossmint as g}from"@crossmint/client-sdk-react-base";import{jsx as k}from"react/jsx-runtime";var s=p(void 0);function b({children:e}){let[r,d]=i(void 0),[c,u]=i(void 0),{crossmint:C}=g(),m=o(C,{usageOrigin:"client"});return l(()=>{let n=t=>{if(t.origin!==new URL(m.baseUrl).origin||t.data.event!=="order:updated")return;let{order:a,orderClientSecret:f}=t.data.data;d(a),u(f)};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[r]),k(s.Provider,{value:{order:r,orderClientSecret:c},children:e})}function S(){let e=h(s);if(!e)throw new Error("useCrossmintCheckout must be used within a CrossmintCheckoutProvider");return e}export{b as a,S as b};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFRXIWXHUcjs = require('./chunk-FRXIWXHU.cjs');var _clientsdkbase = require('@crossmint/client-sdk-base');var _jsxruntime = require('react/jsx-runtime');function n(r){_clientsdkbase.assertValidValidateNFTDetailProps.call(void 0, r);let o=_clientsdkbase.getNFTDetailSrc.call(void 0, r,_chunkFRXIWXHUcjs.a);return _jsxruntime.jsx.call(void 0, "iframe",{src:o,width:"100%",height:"100%",style:{flexGrow:"1",border:"none",margin:"0",padding:"0"},role:"nft-details"})}exports.a = n;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOVONVFETcjs = require('./chunk-OVONVFET.cjs');var _clientsdkbase = require('@crossmint/client-sdk-base');var _jsxruntime = require('react/jsx-runtime');function n(r){_clientsdkbase.assertValidValidateNFTDetailProps.call(void 0, r);let o=_clientsdkbase.getNFTDetailSrc.call(void 0, r,_chunkOVONVFETcjs.a);return _jsxruntime.jsx.call(void 0, "iframe",{src:o,width:"100%",height:"100%",style:{flexGrow:"1",border:"none",margin:"0",padding:"0"},role:"nft-details"})}exports.a = n;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-CHOIE7TZ.js";import{a as c}from"./chunk-QCLLJVY2.js";import{a as x,e as b,h,i as C}from"./chunk-UDQUVZUQ.js";import{VisuallyHidden as P}from"@radix-ui/react-visually-hidden";import{jsx as i,jsxs as l}from"react/jsx-runtime";function I({phone:e,open:r,setOpen:v,step:s,onSubmitOTP:y,onResendOTPCode:D,onSubmitPhone:O,rejectRef:n,appearance:o}){var m,f,u;if(e==null)throw new Error("Phone is required");function d(t){var g;(r||t)&&((g=n.current)==null||g.call(n,new Error),v(!1))}return i(x,{modal:!1,open:r,onOpenChange:d,children:l(b,{onInteractOutside:t=>t.preventDefault(),onOpenAutoFocus:t=>t.preventDefault(),className:"!p-0 !min-[480px]:p-0",style:{borderRadius:o==null?void 0:o.borderRadius,backgroundColor:(m=o==null?void 0:o.colors)==null?void 0:m.background},children:[i(P,{asChild:!0,children:i(h,{children:"Confirm it's you"})}),i(P,{asChild:!0,children:i(C,{children:"Create a recovery key"})}),l("div",{className:"relative pt-10 pb-[30px] px-6 !min-[480px]:px-10 flex flex-col gap-[10px] antialiased animate-none max-w-[448px]",children:[s==="initial"?l("div",{className:"flex flex-col gap-4",children:[i("h1",{className:"text-2xl font-bold text-cm-text-primary",style:{color:(f=o==null?void 0:o.colors)==null?void 0:f.textPrimary},children:"Confirm it's you"}),i("p",{className:"text-base font-normal mb-3 text-cm-text-secondary",style:{color:(u=o==null?void 0:o.colors)==null?void 0:u.textSecondary},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"?i(a,{phone:e,onSubmitOTP:y,onResendCode:D,appearance:o}):i(c,{phone:e,onConfirm:O,onCancel:d,appearance:o})]})]})})}export{I as a};