{"version":3,"file":"Auth.C4HelUTK.mjs","names":["useState","createClient"],"sources":["https:/framerusercontent.com/modules/WlApN8O0WafMD2uqVo0j/NfCBYl2TIlYmjHkLYnOE/Auth.js"],"sourcesContent":["// Auth.tsx - Framer Code Override for Supabase Authentication\n// Copy this entire file contents into Framer: Assets Panel > Code > + > Code Override\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{createClient}from\"https://esm.sh/@supabase/supabase-js@2\";// ============================================\n// CONFIGURATION\n// ============================================\nconst SUPABASE_URL=\"https://hbegqpgwdrpgrqhdoeyj.supabase.co\";const SUPABASE_ANON_KEY=\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImhiZWdxcGd3ZHJwZ3JxaGRvZXlqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTUwOTAxOTAsImV4cCI6MjA3MDY2NjE5MH0.mXxF8GvvJwX4SgtenqQYdV4408f-Uwb1dj8-afSuM8g\";// API URL for backend calls\nconst API_URL=\"https://resonance-api.lavendaire.com\";// ============================================\n// SUPABASE CLIENT\n// ============================================\nconst supabase=createClient(SUPABASE_URL,SUPABASE_ANON_KEY,{auth:{autoRefreshToken:true,persistSession:true,detectSessionInUrl:true}});// ============================================\n// OAUTH CALLBACK HANDLER - Apply to your main page frame\n// ============================================\nexport function withAuthCallback(Component){return props=>{useEffect(()=>{const hash=window.location.hash;if(hash&&hash.includes(\"access_token\")){const params=new URLSearchParams(hash.substring(1));const accessToken=params.get(\"access_token\");const refreshToken=params.get(\"refresh_token\");if(accessToken&&refreshToken){supabase.auth.setSession({access_token:accessToken,refresh_token:refreshToken}).then(async({error})=>{if(error){console.error(\"Session error:\",error);alert(\"Login failed: \"+error.message);return;}// Check for stripe intent FIRST (highest priority)\nconst stripeIntent=sessionStorage.getItem(\"stripe_intent\");if(stripeIntent){console.log(\"[Stripe] OAuth callback with stripe intent:\",stripeIntent);sessionStorage.removeItem(\"stripe_intent\");const checkoutUrl=await createStripeCheckout(stripeIntent);if(checkoutUrl){window.location.href=checkoutUrl;return;}// Fallback to pricing page if checkout fails\nwindow.location.href=\"/pricing-plan\";return;}// Check auth intent from sessionStorage\nconst authIntent=sessionStorage.getItem(\"auth_intent\");sessionStorage.removeItem(\"auth_intent\")// Clear after reading\n;if(authIntent===\"trial\"){// Trial signup flow - attempt to grant beta trial\nconst trialGranted=await grantBetaTrial(accessToken);if(trialGranted){console.log(\"30-day beta trial activated!\");}window.location.href=\"/trial-active\";}else{// Regular login flow - redirect to account\nwindow.location.href=\"/account\";}});}}},[]);return /*#__PURE__*/_jsx(Component,{...props});};}// ============================================\n// SHARED FORM STATE (stores input values)\n// ============================================\nconst formState={email:\"\",password:\"\",name:\"\"};// ============================================\n// BETA TRIAL FUNCTION\n// ============================================\n/**\n * Attempt to grant beta trial to new user\n * Silently handles errors - trial grant is best-effort\n */async function grantBetaTrial(accessToken){try{const response=await fetch(`${API_URL}/api/beta-trial/grant`,{method:\"POST\",headers:{Authorization:`Bearer ${accessToken}`,\"Content-Type\":\"application/json\"}});if(response.ok){const data=await response.json();console.log(\"Beta trial granted:\",data);return true;}else if(response.status===409){// Already claimed - silently continue\nconsole.log(\"Beta trial already claimed\");return false;}else if(response.status===403){// Not eligible (existing user or has subscription) - silently continue\nconsole.log(\"Not eligible for beta trial\");return false;}else{console.warn(\"Beta trial grant failed:\",response.status);return false;}}catch(error){console.warn(\"Beta trial grant error:\",error);return false;}}/**\n * Create Stripe checkout session via API\n * @param planType - 'monthly' or 'yearly'\n * @returns Checkout URL or null if error\n */async function createStripeCheckout(planType){try{const{session,error:sessionError}=await getSession();if(sessionError||!session?.access_token){console.error(\"[Stripe] No valid session:\",sessionError);return null;}const response=await fetch(`${API_URL}/api/stripe/checkout`,{method:\"POST\",headers:{Authorization:`Bearer ${session.access_token}`,\"Content-Type\":\"application/json\"},body:JSON.stringify({planType})});if(!response.ok){const errorData=await response.json().catch(()=>({}));// Handle specific error cases\nif(response.status===401){// Not authenticated - should redirect to create-account\nconsole.log(\"[Stripe] User not authenticated\");return null;}if(response.status===409){// Already has active subscription\nalert(\"You already have an active subscription\");return null;}if(response.status===400){// Validation error\nalert(errorData.message||\"Invalid request. Please try again.\");return null;}// Generic error\nalert(\"Something went wrong. Please try again.\");console.error(\"[Stripe] API error:\",response.status,errorData);return null;}const data=await response.json();return data.checkoutUrl;}catch(error){console.error(\"[Stripe] Checkout error:\",error);alert(\"Something went wrong. Please try again.\");return null;}}// ============================================\n// AUTH FUNCTIONS\n// ============================================\nasync function signUp(email,password,name){const{data,error}=await supabase.auth.signUp({email,password,options:{data:{name,full_name:name}}});return{data,error};}async function signIn(email,password){const{data,error}=await supabase.auth.signInWithPassword({email,password});return{data,error};}async function signInWithGoogle(){const{data,error}=await supabase.auth.signInWithOAuth({provider:\"google\",options:{redirectTo:window.location.origin,queryParams:{prompt:\"select_account\"}}});return{data,error};}async function signInWithApple(){const{data,error}=await supabase.auth.signInWithOAuth({provider:\"apple\",options:{redirectTo:window.location.origin}});return{data,error};}async function signOut(){const{error}=await supabase.auth.signOut();return{error};}async function getSession(){const{data:{session},error}=await supabase.auth.getSession();return{session,error};}async function resetPassword(email){const{error}=await supabase.auth.resetPasswordForEmail(email,{redirectTo:`${window.location.origin}/reset-password`});return{error};}// ============================================\n// AUTH HOOK\n// ============================================\nfunction useAuth(){const[user,setUser]=useState(null);const[loading,setLoading]=useState(true);useEffect(()=>{getSession().then(({session})=>{setUser(session?.user??null);setLoading(false);});const{data:{subscription}}=supabase.auth.onAuthStateChange((event,session)=>{setUser(session?.user??null);});return()=>subscription.unsubscribe();},[]);return{user,loading,isAuthenticated:!!user};}// ============================================\n// INPUT OVERRIDES - Apply these to your input fields\n// ============================================\n// Email Input - captures email as user types\nexport function withEmailInput(Component){return props=>{// Handle Framer Input (onValueChange)\nconst handleValueChange=value=>{formState.email=value;console.log(\"Email (onValueChange):\",value);props.onValueChange?.(value);};// Handle native HTML input (onChange)\nconst handleChange=e=>{const value=e?.target?.value??e;formState.email=value;console.log(\"Email (onChange):\",value);props.onChange?.(e);};return /*#__PURE__*/_jsx(Component,{...props,onValueChange:handleValueChange,onChange:handleChange});};}// Password Input - captures password as user types\nexport function withPasswordInput(Component){return props=>{// Handle Framer Input (onValueChange)\nconst handleValueChange=value=>{formState.password=value;console.log(\"Password (onValueChange):\",value.replace(/./g,\"*\"));props.onValueChange?.(value);};// Handle native HTML input (onChange)\nconst handleChange=e=>{const value=e?.target?.value??e;formState.password=value;console.log(\"Password (onChange):\",value.replace(/./g,\"*\"));props.onChange?.(e);};return /*#__PURE__*/_jsx(Component,{...props,onValueChange:handleValueChange,onChange:handleChange});};}// Name Input - captures name as user types\nexport function withNameInput(Component){return props=>{// Handle Framer Input (onValueChange)\nconst handleValueChange=value=>{formState.name=value;console.log(\"Name (onValueChange):\",value);props.onValueChange?.(value);};// Handle native HTML input (onChange)\nconst handleChange=e=>{const value=e?.target?.value??e;formState.name=value;console.log(\"Name (onChange):\",value);props.onChange?.(e);};return /*#__PURE__*/_jsx(Component,{...props,onValueChange:handleValueChange,onChange:handleChange});};}// ============================================\n// BUTTON OVERRIDES\n// ============================================\n// Prevent double submission\nlet isSubmitting=false;// Google Sign In Button (for login page - redirects to /account)\nexport function withGoogleLogin(Component){return props=>{const handleClick=async()=>{if(isSubmitting)return;isSubmitting=true;try{// Set intent to \"login\" so callback redirects to /account\nsessionStorage.setItem(\"auth_intent\",\"login\");const{error}=await signInWithGoogle();if(error){sessionStorage.removeItem(\"auth_intent\");alert(error.message);}}finally{isSubmitting=false;}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,onTap:handleClick});};}// Google Sign Up Button (for trial signup - grants trial and redirects to /trial-active)\nexport function withGoogleSignupTrial(Component){return props=>{const handleClick=async()=>{if(isSubmitting)return;isSubmitting=true;try{// Set intent to \"trial\" so callback grants trial and redirects to /trial-active\nsessionStorage.setItem(\"auth_intent\",\"trial\");const{error}=await signInWithGoogle();if(error){sessionStorage.removeItem(\"auth_intent\");alert(error.message);}}finally{isSubmitting=false;}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,onTap:handleClick});};}// Apple Sign In Button (for login page - redirects to /account)\nexport function withAppleLogin(Component){return props=>{const handleClick=async()=>{if(isSubmitting)return;isSubmitting=true;try{// Set intent to \"login\" so callback redirects to /account\nsessionStorage.setItem(\"auth_intent\",\"login\");const{error}=await signInWithApple();if(error){sessionStorage.removeItem(\"auth_intent\");alert(error.message);}}finally{isSubmitting=false;}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,onTap:handleClick});};}// Apple Sign Up Button (for trial signup - grants trial and redirects to /trial-active)\nexport function withAppleSignupTrial(Component){return props=>{const handleClick=async()=>{if(isSubmitting)return;isSubmitting=true;try{// Set intent to \"trial\" so callback grants trial and redirects to /trial-active\nsessionStorage.setItem(\"auth_intent\",\"trial\");const{error}=await signInWithApple();if(error){sessionStorage.removeItem(\"auth_intent\");alert(error.message);}}finally{isSubmitting=false;}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,onTap:handleClick});};}// Email/Password Sign In Button (for login page - redirects to /account)\nexport function withEmailLogin(Component){return props=>{const handleClick=async()=>{if(isSubmitting)return;isSubmitting=true;try{if(!formState.email||!formState.password){alert(\"Please enter email and password\");return;}const{data,error}=await signIn(formState.email,formState.password);if(error){alert(error.message);}else{// Regular login - redirect to account page\nwindow.location.href=\"/account\";}}finally{isSubmitting=false;}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,onTap:handleClick});};}// Email/Password Sign In Button for Trial (grants trial and redirects to /trial-active)\nexport function withEmailSignupTrial(Component){return props=>{const handleClick=async()=>{if(isSubmitting)return;isSubmitting=true;try{if(!formState.email||!formState.password){alert(\"Please enter email and password\");return;}const{data,error}=await signIn(formState.email,formState.password);if(error){alert(error.message);}else{// Trial signup - grant beta trial and redirect\nif(data?.session?.access_token){const trialGranted=await grantBetaTrial(data.session.access_token);if(trialGranted){console.log(\"30-day beta trial activated!\");}}window.location.href=\"/trial-active\";}}finally{isSubmitting=false;}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,onTap:handleClick});};}// Register Button (regular signup - requires email verification)\nexport function withRegister(Component){return props=>{const handleClick=async()=>{if(isSubmitting)return;isSubmitting=true;try{if(!formState.name||!formState.email||!formState.password){alert(\"Please fill in all fields\");return;}const{data,error}=await signUp(formState.email,formState.password,formState.name);if(error){alert(error.message);}else{// If session exists (email confirmation disabled), redirect to account\nif(data?.session?.access_token){window.location.href=\"/account\";}else{// Email confirmation required - redirect to OTP verification\notpState.pendingEmail=formState.email;otpState.grantTrial=false;otpState.resendCountdown=60;sessionStorage.setItem(\"otp_pending_email\",formState.email);sessionStorage.setItem(\"otp_grant_trial\",\"false\");window.location.href=\"/verify-email\";}}}finally{isSubmitting=false;}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,onTap:handleClick});};}// Register Button for Trial (signup with trial intent - grants trial after email verification)\nexport function withRegisterTrial(Component){return props=>{const handleClick=async()=>{if(isSubmitting)return;isSubmitting=true;try{if(!formState.email||!formState.password){alert(\"Please fill in all fields\");return;}// Use name if provided, otherwise extract from email\nconst name=formState.name||formState.email.split(\"@\")[0];const{data,error}=await signUp(formState.email,formState.password,name);if(error){alert(error.message);}else{// Set trial intent so when user verifies email and logs in, they get the trial\nsessionStorage.setItem(\"auth_intent\",\"trial\");// If session exists (email confirmation disabled), grant trial immediately\nif(data?.session?.access_token){const trialGranted=await grantBetaTrial(data.session.access_token);if(trialGranted){console.log(\"30-day beta trial activated!\");}window.location.href=\"/trial-active\";}else{// Email confirmation required - redirect to OTP verification\notpState.pendingEmail=formState.email;otpState.grantTrial=true;otpState.resendCountdown=60;sessionStorage.setItem(\"otp_pending_email\",formState.email);sessionStorage.setItem(\"otp_grant_trial\",\"true\");window.location.href=\"/verify-email\";}}}finally{isSubmitting=false;}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,onTap:handleClick});};}// Logout Button\nexport function withLogout(Component){return props=>{const handleClick=async()=>{if(isSubmitting)return;isSubmitting=true;try{await signOut();window.location.href=\"/sign-in\";}finally{isSubmitting=false;}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,onTap:handleClick});};}// Password Reset Button - Sends OTP and redirects to verification page\nexport function withPasswordReset(Component){return props=>{const handleClick=async()=>{if(isSubmitting)return;isSubmitting=true;try{if(!formState.email){alert(\"Please enter your email\");return;}const{error}=await sendPasswordResetOtp(formState.email);if(error){alert(error.message);}else{// Store email and flow type, redirect to unified verification page\notpState.pendingEmail=formState.email;otpState.resendCountdown=60;otpState.grantTrial=false;sessionStorage.setItem(\"otp_pending_email\",formState.email);sessionStorage.setItem(\"otp_flow_type\",\"password_reset\");window.location.href=\"/verify-email\";}}finally{isSubmitting=false;}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,onTap:handleClick});};}// ============================================\n// PAGE/COMPONENT OVERRIDES\n// ============================================\n// Protect a page - redirects to /sign-in if not authenticated\nexport function withAuth(Component){return props=>{const{user,loading}=useAuth();useEffect(()=>{if(!loading&&!user){window.location.href=\"/sign-in\";}},[loading,user]);if(loading)return /*#__PURE__*/_jsx(\"div\",{children:\"Loading...\"});if(!user)return null;return /*#__PURE__*/_jsx(Component,{...props});};}// Show component only when logged in\nexport function withShowIfLoggedIn(Component){return props=>{const{user,loading}=useAuth();if(loading||!user)return null;return /*#__PURE__*/_jsx(Component,{...props});};}// Show component only when logged out\nexport function withShowIfLoggedOut(Component){return props=>{const{user,loading}=useAuth();if(loading||user)return null;return /*#__PURE__*/_jsx(Component,{...props});};}// Hide element on specific auth pages (account, verify-email, create-new-password)\nexport function withHideOnAuthPages(Component){return props=>{const[hidden,setHidden]=useState(false);useEffect(()=>{const path=window.location.pathname;const hideOnPages=[\"/account\",\"/verify-email\",\"/create-new-password\"];setHidden(hideOnPages.some(page=>path.startsWith(page)));},[]);if(hidden)return null;return /*#__PURE__*/_jsx(Component,{...props});};}// Display user's name\nexport function withUserName(Component){return props=>{const{user}=useAuth();const name=user?.user_metadata?.name||user?.email?.split(\"@\")[0]||\"Guest\";return /*#__PURE__*/_jsx(Component,{...props,text:name});};}// Display user's email\nexport function withUserEmail(Component){return props=>{const{user}=useAuth();return /*#__PURE__*/_jsx(Component,{...props,text:user?.email||\"\"});};}// ============================================\n// SUBSCRIPTION HELPER FUNCTIONS\n// ============================================\nfunction formatPlanName(productId){if(!productId)return\"No active plan\";// Map RevenueCat product IDs to display names\nconst planNames={resonance_premium_annual:\"Premium Annual\",resonance_premium_monthly:\"Premium Monthly\",beta_trial:\"Beta Trial\"};return planNames[productId]||productId;}function formatDate(dateString){if(!dateString)return\"N/A\";const date=new Date(dateString);return date.toLocaleDateString(\"en-US\",{month:\"short\",day:\"numeric\",year:\"numeric\"});}// ============================================\n// SUBSCRIPTION HOOK\n// ============================================\nfunction useSubscription(){const[subscription,setSubscription]=useState(null);const[loading,setLoading]=useState(true);useEffect(()=>{async function fetchSubscription(){try{const{session}=await getSession();if(!session?.access_token){setLoading(false);return;}const response=await fetch(`${API_URL}/api/subscriptions/status`,{headers:{Authorization:`Bearer ${session.access_token}`}});if(response.ok){const data=await response.json();setSubscription({plan:formatPlanName(data.subscriptionProductId),nextBilling:formatDate(data.subscriptionExpiresAt),status:data.subscriptionStatus});}}catch(error){console.warn(\"Failed to fetch subscription:\",error);}finally{setLoading(false);}}fetchSubscription();},[]);return{subscription,loading};}// ============================================\n// ACCOUNT PAGE OVERRIDES\n// ============================================\n// Protect account page - redirects to /sign-in if not authenticated, logs auth token\nexport function withAccountPage(Component){return props=>{const{user,loading}=useAuth();useEffect(()=>{if(!loading&&!user){window.location.href=\"/sign-in\";}// Log auth token after page loads (moved from login flows)\nif(user){getSession().then(({session})=>{if(session?.access_token){console.log(\"Auth token:\",session.access_token);}});}},[loading,user]);if(loading)return /*#__PURE__*/_jsx(\"div\",{children:\"Loading...\"});if(!user)return null;return /*#__PURE__*/_jsx(Component,{...props});};}// Display user's name with \"!\" suffix for greeting\nexport function withUserGreeting(Component){return props=>{const{user}=useAuth();const name=user?.user_metadata?.name||user?.email?.split(\"@\")[0]||\"Guest\";return /*#__PURE__*/_jsx(Component,{...props,text:`${name}!`});};}// Display subscription plan name\nexport function withSubscriptionPlan(Component){return props=>{const{subscription,loading}=useSubscription();const plan=loading?\"Loading...\":subscription?.plan||\"No active plan\";return /*#__PURE__*/_jsx(Component,{...props,text:plan});};}// Display next billing date\nexport function withNextBilling(Component){return props=>{const{subscription,loading}=useSubscription();const billing=loading?\"Loading...\":subscription?.nextBilling||\"N/A\";return /*#__PURE__*/_jsx(Component,{...props,text:billing});};}// ============================================\n// OTP VERIFICATION STATE\n// ============================================\nconst otpState={pendingEmail:\"\",otpCode:\"\",resendCountdown:0,error:\"\",grantTrial:false};// ============================================\n// PASSWORD RESET STATE\n// ============================================\nconst passwordResetState={pendingEmail:\"\",resendCountdown:0,error:\"\"};// ============================================\n// OTP VERIFICATION FUNCTIONS\n// ============================================\nasync function verifyEmailOtp(email,token){const{data,error}=await supabase.auth.verifyOtp({email,token,type:\"signup\"});return{data,error};}async function resendSignupOtp(email){const{error}=await supabase.auth.resend({type:\"signup\",email});return{error};}// ============================================\n// PASSWORD RESET FUNCTIONS\n// ============================================\n// Send password reset OTP\nasync function sendPasswordResetOtp(email){const{error}=await supabase.auth.resetPasswordForEmail(email,{redirectTo:`${window.location.origin}/create-new-password`});return{error};}// Verify password reset OTP\nasync function verifyPasswordResetOtp(email,token){const{data,error}=await supabase.auth.verifyOtp({email,token,type:\"recovery\"});return{data,error};}// Resend password reset OTP\nasync function resendPasswordResetOtp(email){const{error}=await supabase.auth.resetPasswordForEmail(email,{redirectTo:`${window.location.origin}/create-new-password`});return{error};}// Update user password\nasync function updateUserPassword(newPassword){const{data,error}=await supabase.auth.updateUser({password:newPassword});return{data,error};}// ============================================\n// OTP VERIFICATION OVERRIDES\n// ============================================\n// Page guard for /verify-email - redirects if no pending email\n// Handles both signup OTP and password reset OTP flows\nexport function withOtpPageGuard(Component){return props=>{useEffect(()=>{// Check if we have a pending email to verify\nif(!otpState.pendingEmail){// Try to get from sessionStorage as backup\nconst storedEmail=sessionStorage.getItem(\"otp_pending_email\");if(storedEmail){otpState.pendingEmail=storedEmail;otpState.grantTrial=sessionStorage.getItem(\"otp_grant_trial\")===\"true\";}else{// No pending verification - check flow type to redirect appropriately\nconst flowType=sessionStorage.getItem(\"otp_flow_type\");if(flowType===\"password_reset\"){window.location.href=\"/forgot-password\";}else{window.location.href=\"/30-day-trial\";}}}},[]);return /*#__PURE__*/_jsx(Component,{...props});};}// OTP Input handler - captures code and triggers verification on complete\n// Handles both signup OTP and password reset OTP flows\nexport function withOtpVerification(Component){return props=>{const[error,setError]=useState(false);const handleComplete=async code=>{otpState.otpCode=code;otpState.error=\"\";setError(false);// Get email and flow type from state or sessionStorage\nconst email=otpState.pendingEmail||sessionStorage.getItem(\"otp_pending_email\")||\"\";const flowType=sessionStorage.getItem(\"otp_flow_type\")||\"signup\";if(!email){otpState.error=\"No email found. Please try again.\";setError(true);return;}console.log(\"Verifying OTP for:\",email,\"Flow:\",flowType);// Use different verification based on flow type\nlet data,verifyError;if(flowType===\"password_reset\"){const result=await verifyPasswordResetOtp(email,code);data=result.data;verifyError=result.error;}else{const result=await verifyEmailOtp(email,code);data=result.data;verifyError=result.error;}if(verifyError){console.error(\"OTP verification failed:\",verifyError);otpState.error=verifyError.message||\"Invalid code. Please try again.\";setError(true);return;}console.log(\"OTP verified successfully:\",data);// Handle flow-specific post-verification logic\nif(flowType===\"password_reset\"){// Password reset flow - redirect to create new password\n// Keep otp_pending_email for the create-new-password page to know we're authenticated\nsessionStorage.removeItem(\"otp_flow_type\");otpState.pendingEmail=\"\";window.location.href=\"/create-new-password\";}else{// Signup flow - check if we should grant trial\nconst shouldGrantTrial=otpState.grantTrial||sessionStorage.getItem(\"otp_grant_trial\")===\"true\";if(shouldGrantTrial&&data?.session?.access_token){const trialGranted=await grantBetaTrial(data.session.access_token);if(trialGranted){console.log(\"30-day beta trial activated!\");}// Clear OTP state\nsessionStorage.removeItem(\"otp_pending_email\");sessionStorage.removeItem(\"otp_grant_trial\");sessionStorage.removeItem(\"otp_flow_type\");otpState.pendingEmail=\"\";otpState.grantTrial=false;window.location.href=\"/trial-active\";}else{// Clear OTP state\nsessionStorage.removeItem(\"otp_pending_email\");sessionStorage.removeItem(\"otp_grant_trial\");sessionStorage.removeItem(\"otp_flow_type\");otpState.pendingEmail=\"\";otpState.grantTrial=false;window.location.href=\"/account\";}}};return /*#__PURE__*/_jsx(Component,{...props,onComplete:handleComplete,error:error});};}// Display the email being verified\nexport function withOtpEmail(Component){return props=>{const[email,setEmail]=useState(\"\");useEffect(()=>{const pendingEmail=otpState.pendingEmail||sessionStorage.getItem(\"otp_pending_email\")||\"\";setEmail(pendingEmail);},[]);const text=email?`We sent a code to ${email}`:\"We sent a code to your email\";return /*#__PURE__*/_jsx(Component,{...props,text:text});};}// Display OTP error messages\nexport function withOtpError(Component){return props=>{const[error,setError]=useState(\"\");useEffect(()=>{const checkError=()=>{setError(otpState.error);};checkError();const interval=setInterval(checkError,500);return()=>clearInterval(interval);},[]);if(!error)return null;return /*#__PURE__*/_jsx(Component,{...props,text:error});};}// Display resend countdown\nexport function withOtpCountdown(Component){return props=>{const[countdown,setCountdown]=useState(otpState.resendCountdown);useEffect(()=>{const interval=setInterval(()=>{if(otpState.resendCountdown>0){otpState.resendCountdown--;setCountdown(otpState.resendCountdown);}},1e3);return()=>clearInterval(interval);},[]);const text=countdown>0?`Resend code in ${countdown}s`:\"Resend Code\";return /*#__PURE__*/_jsx(Component,{...props,text:text});};}// Resend OTP button handler\n// Handles both signup OTP and password reset OTP flows\nexport function withResendOtp(Component){return props=>{const[isDisabled,setIsDisabled]=useState(otpState.resendCountdown>0);const[countdown,setCountdown]=useState(otpState.resendCountdown);const[isResending,setIsResending]=useState(false);useEffect(()=>{const interval=setInterval(()=>{setCountdown(otpState.resendCountdown);setIsDisabled(otpState.resendCountdown>0);},500);return()=>clearInterval(interval);},[]);const handleClick=async()=>{if(isResending||otpState.resendCountdown>0)return;setIsResending(true);try{const email=otpState.pendingEmail||sessionStorage.getItem(\"otp_pending_email\")||\"\";const flowType=sessionStorage.getItem(\"otp_flow_type\")||\"signup\";if(!email){alert(\"No email found. Please try again.\");return;}// Use different resend function based on flow type\nlet error;if(flowType===\"password_reset\"){const result=await resendPasswordResetOtp(email);error=result.error;}else{const result=await resendSignupOtp(email);error=result.error;}if(error){alert(error.message);}else{otpState.resendCountdown=60;setCountdown(60);setIsDisabled(true);otpState.error=\"\";alert(\"Code resent! Check your email.\");}}finally{setIsResending(false);}};const text=countdown>0?`Resend code in ${countdown}s`:\"Resend Code\";return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,onTap:handleClick,text:text,style:{...props.style,opacity:isDisabled||isResending?.5:1}});};}// Back link that adapts based on flow type (signup vs password reset)\nexport function withOtpBackLink(Component){return props=>{const[linkConfig,setLinkConfig]=useState({text:\"Back\",href:\"/30-day-trial\"});useEffect(()=>{const flowType=sessionStorage.getItem(\"otp_flow_type\")||\"signup\";if(flowType===\"password_reset\"){setLinkConfig({text:\"Back to forgot password\",href:\"/forgot-password\"});}else{setLinkConfig({text:\"Back to registration\",href:\"/30-day-trial\"});}},[]);const handleClick=()=>{// Clear OTP state when going back\nsessionStorage.removeItem(\"otp_pending_email\");sessionStorage.removeItem(\"otp_grant_trial\");sessionStorage.removeItem(\"otp_flow_type\");otpState.pendingEmail=\"\";otpState.grantTrial=false;window.location.href=linkConfig.href;};return /*#__PURE__*/_jsx(Component,{...props,text:linkConfig.text,onClick:handleClick,onTap:handleClick});};}// ============================================\n// PASSWORD RESET VERIFICATION OVERRIDES (DEPRECATED)\n// These are kept for backwards compatibility but the unified\n// /verify-email page with withOtpVerification should be used instead\n// ============================================\n// Page guard for /verify-reset-password - redirects if no pending email\n// DEPRECATED: Use withOtpPageGuard instead\nexport function withPasswordResetPageGuard(Component){return props=>{useEffect(()=>{if(!passwordResetState.pendingEmail){const storedEmail=sessionStorage.getItem(\"password_reset_email\");if(storedEmail){passwordResetState.pendingEmail=storedEmail;}else{window.location.href=\"/forgot-password\";}}},[]);return /*#__PURE__*/_jsx(Component,{...props});};}// OTP verification for password reset\nexport function withPasswordResetOtpVerification(Component){return props=>{const[error,setError]=useState(false);const handleComplete=async code=>{passwordResetState.error=\"\";setError(false);const email=passwordResetState.pendingEmail||sessionStorage.getItem(\"password_reset_email\")||\"\";if(!email){passwordResetState.error=\"No email found. Please try again.\";setError(true);return;}console.log(\"Verifying password reset OTP for:\",email);const{data,error:verifyError}=await verifyPasswordResetOtp(email,code);if(verifyError){console.error(\"Password reset OTP verification failed:\",verifyError);passwordResetState.error=verifyError.message||\"Invalid code. Please try again.\";setError(true);return;}console.log(\"Password reset OTP verified successfully:\",data);// OTP verified, redirect to create new password\nwindow.location.href=\"/create-new-password\";};return /*#__PURE__*/_jsx(Component,{...props,onComplete:handleComplete,error:error});};}// Display email being verified for password reset\nexport function withPasswordResetEmail(Component){return props=>{const[email,setEmail]=useState(\"\");useEffect(()=>{const pendingEmail=passwordResetState.pendingEmail||sessionStorage.getItem(\"password_reset_email\")||\"\";setEmail(pendingEmail);},[]);const text=email?`We sent a code to ${email}`:\"We sent a code to your email\";return /*#__PURE__*/_jsx(Component,{...props,text:text});};}// Resend password reset OTP\nexport function withResendPasswordResetOtp(Component){return props=>{const[isDisabled,setIsDisabled]=useState(passwordResetState.resendCountdown>0);const[countdown,setCountdown]=useState(passwordResetState.resendCountdown);const[isResending,setIsResending]=useState(false);useEffect(()=>{const interval=setInterval(()=>{if(passwordResetState.resendCountdown>0){passwordResetState.resendCountdown--;}setCountdown(passwordResetState.resendCountdown);setIsDisabled(passwordResetState.resendCountdown>0);},1e3);return()=>clearInterval(interval);},[]);const handleClick=async()=>{if(isResending||passwordResetState.resendCountdown>0)return;setIsResending(true);try{const email=passwordResetState.pendingEmail||sessionStorage.getItem(\"password_reset_email\")||\"\";if(!email){alert(\"No email found. Please try again.\");return;}const{error}=await resendPasswordResetOtp(email);if(error){alert(error.message);}else{passwordResetState.resendCountdown=60;setCountdown(60);setIsDisabled(true);alert(\"Code resent! Check your email.\");}}finally{setIsResending(false);}};const text=countdown>0?`Resend code in ${countdown}s`:\"Resend Code\";return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,onTap:handleClick,text:text,style:{...props.style,opacity:isDisabled||isResending?.5:1}});};}// Display password reset error\nexport function withPasswordResetError(Component){return props=>{const[error,setError]=useState(\"\");useEffect(()=>{const interval=setInterval(()=>setError(passwordResetState.error),500);return()=>clearInterval(interval);},[]);if(!error)return null;return /*#__PURE__*/_jsx(Component,{...props,text:error});};}// ============================================\n// CREATE NEW PASSWORD OVERRIDES\n// ============================================\n// New password input\nexport function withNewPasswordInput(Component){return props=>{const handleValueChange=value=>{formState.password=value;props.onValueChange?.(value);};const handleChange=e=>{const value=e?.target?.value??e;formState.password=value;props.onChange?.(e);};return /*#__PURE__*/_jsx(Component,{...props,onValueChange:handleValueChange,onChange:handleChange});};}// Submit new password button\nexport function withUpdatePassword(Component){return props=>{const handleClick=async()=>{if(isSubmitting)return;isSubmitting=true;try{if(!formState.password){alert(\"Please enter a new password\");return;}if(formState.password.length<6){alert(\"Password must be at least 6 characters\");return;}const{error}=await updateUserPassword(formState.password);if(error){alert(error.message);}else{// Clear all OTP and password reset state\nsessionStorage.removeItem(\"password_reset_email\");sessionStorage.removeItem(\"otp_pending_email\");sessionStorage.removeItem(\"otp_flow_type\");passwordResetState.pendingEmail=\"\";otpState.pendingEmail=\"\";formState.password=\"\";alert(\"Password updated successfully!\");window.location.href=\"/sign-in\";}}finally{isSubmitting=false;}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,onTap:handleClick});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withOtpCountdown\":{\"type\":\"reactHoc\",\"name\":\"withOtpCountdown\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withOtpEmail\":{\"type\":\"reactHoc\",\"name\":\"withOtpEmail\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPasswordResetEmail\":{\"type\":\"reactHoc\",\"name\":\"withPasswordResetEmail\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRegisterTrial\":{\"type\":\"reactHoc\",\"name\":\"withRegisterTrial\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGoogleLogin\":{\"type\":\"reactHoc\",\"name\":\"withGoogleLogin\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withEmailInput\":{\"type\":\"reactHoc\",\"name\":\"withEmailInput\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHideOnAuthPages\":{\"type\":\"reactHoc\",\"name\":\"withHideOnAuthPages\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUserGreeting\":{\"type\":\"reactHoc\",\"name\":\"withUserGreeting\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLogout\":{\"type\":\"reactHoc\",\"name\":\"withLogout\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPasswordResetPageGuard\":{\"type\":\"reactHoc\",\"name\":\"withPasswordResetPageGuard\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withEmailSignupTrial\":{\"type\":\"reactHoc\",\"name\":\"withEmailSignupTrial\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUserName\":{\"type\":\"reactHoc\",\"name\":\"withUserName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAppleSignupTrial\":{\"type\":\"reactHoc\",\"name\":\"withAppleSignupTrial\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withOtpBackLink\":{\"type\":\"reactHoc\",\"name\":\"withOtpBackLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUserEmail\":{\"type\":\"reactHoc\",\"name\":\"withUserEmail\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withShowIfLoggedIn\":{\"type\":\"reactHoc\",\"name\":\"withShowIfLoggedIn\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPasswordReset\":{\"type\":\"reactHoc\",\"name\":\"withPasswordReset\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withOtpPageGuard\":{\"type\":\"reactHoc\",\"name\":\"withOtpPageGuard\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withNextBilling\":{\"type\":\"reactHoc\",\"name\":\"withNextBilling\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withNewPasswordInput\":{\"type\":\"reactHoc\",\"name\":\"withNewPasswordInput\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withEmailLogin\":{\"type\":\"reactHoc\",\"name\":\"withEmailLogin\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAppleLogin\":{\"type\":\"reactHoc\",\"name\":\"withAppleLogin\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withNameInput\":{\"type\":\"reactHoc\",\"name\":\"withNameInput\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withResendPasswordResetOtp\":{\"type\":\"reactHoc\",\"name\":\"withResendPasswordResetOtp\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withShowIfLoggedOut\":{\"type\":\"reactHoc\",\"name\":\"withShowIfLoggedOut\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUpdatePassword\":{\"type\":\"reactHoc\",\"name\":\"withUpdatePassword\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withOtpVerification\":{\"type\":\"reactHoc\",\"name\":\"withOtpVerification\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPasswordInput\":{\"type\":\"reactHoc\",\"name\":\"withPasswordInput\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withOtpError\":{\"type\":\"reactHoc\",\"name\":\"withOtpError\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAuth\":{\"type\":\"reactHoc\",\"name\":\"withAuth\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRegister\":{\"type\":\"reactHoc\",\"name\":\"withRegister\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSubscriptionPlan\":{\"type\":\"reactHoc\",\"name\":\"withSubscriptionPlan\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountPage\":{\"type\":\"reactHoc\",\"name\":\"withAccountPage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGoogleSignupTrial\":{\"type\":\"reactHoc\",\"name\":\"withGoogleSignupTrial\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withResendOtp\":{\"type\":\"reactHoc\",\"name\":\"withResendOtp\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAuthCallback\":{\"type\":\"reactHoc\",\"name\":\"withAuthCallback\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPasswordResetOtpVerification\":{\"type\":\"reactHoc\",\"name\":\"withPasswordResetOtpVerification\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPasswordResetError\":{\"type\":\"reactHoc\",\"name\":\"withPasswordResetError\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Auth.map"],"mappings":"+LA2BG,eAAe,EAAe,EAAY,CAAC,GAAG,CAAC,IAAM,EAAS,MAAM,MAAM,GAAG,EAAQ,uBAAuB,CAAC,OAAO,OAAO,QAAQ,CAAC,cAAc,UAAU,IAAc,eAAe,mBAAmB,CAAC,CAAC,CAAC,GAAG,EAAS,GAAG,CAAC,IAAM,EAAK,MAAM,EAAS,MAAM,CAAyC,OAAxC,QAAQ,IAAI,sBAAsB,EAAK,CAAQ,WAAc,EAAS,SAAS,IACxS,OAA1C,QAAQ,IAAI,6BAA6B,CAAQ,WAAe,EAAS,SAAS,IACvC,OAA3C,QAAQ,IAAI,8BAA8B,CAAQ,QAAqE,OAAzD,QAAQ,KAAK,2BAA2B,EAAS,OAAO,CAAQ,SAAc,EAAM,CAA+C,OAA9C,QAAQ,KAAK,0BAA0B,EAAM,CAAQ,IAYxM,eAAe,EAAO,EAAM,EAAS,EAAK,CAAC,GAAK,CAA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