1import{o as k,m as F,a as A,r as l,s as u,j as e,b as $,H as E,L as T,C as h,X as B,B as w,p as S,F as G}from"./index-Mli6dXd9.js";import{l as L}from"./index-DF2SZD9D.js";import{f as I}from"./fantaisy-icon.png.asset-DlPdZ6Gz.js";import{C as M}from"./clock-DMGd-AqF.js";import{C as z}from"./credit-card-D0UU1yDZ.js";import{S as O}from"./shield-noq5LLTx.js";const r={pro:{name:"Pro",description:"Casual everyday bettor",monthlyPrice:9.99,annualPrice:95.9,annualMonthly:7.99,features:["CBB Projections","CBB Best Bets","PGA Insights","PGA One and Done","PGA Props","PGA Major Square","UFC Bets"],notIncluded:["UFC Daily Fantasy Optimizer","PGA Daily Fantasy Optimizer"]},sharp:{name:"Sharp",description:"For serious bettors & DFS players",monthlyPrice:19.99,annualPrice:191.9,annualMonthly:15.99,features:["EVERYTHING in Pro, plus:","UFC Daily Fantasy Optimizer","PGA Daily Fantasy Optimizer"],notIncluded:[]}},V=()=>{const[d]=k(),b=F(),{toast:m}=A(),[a,p]=l.useState("sharp"),[c,y]=l.useState("annual"),[f,N]=l.useState(!1),[g,v]=l.useState(!1),[x,j]=l.useState(null);l.useEffect(()=>{(async()=>{var n;const{data:{session:o}}=await u.auth.getSession();if((n=o==null?void 0:o.user)!=null&&n.email){j(o.user.email);const{data:i}=await u.from("profiles").select("has_completed_checkout").eq("id",o.user.id).single();i!=null&&i.has_completed_checkout&&b("/dashboard")}})();const{data:{subscription:t}}=u.auth.onAuthStateChange((o,n)=>{var i;(i=n==null?void 0:n.user)!=null&&i.email?j(n.user.email):j(null)});return()=>t.unsubscribe()},[b]),l.useEffect(()=>{d.get("canceled")==="true"&&m({title:"Checkout canceled",description:"No worries! You can try again whenever you're ready."})},[d,m]),l.useEffect(()=>{const s=d.get("tier");(s==="pro"||s==="sharp")&&p(s)},[d]);const C=async()=>{v(!0);try{const{error:s}=await L.auth.signInWithOAuth("google",{redirect_uri:window.location.origin+"/start-trial",extraParams:{prompt:"select_account"}});if(s)throw s}catch(s){console.error("Google sign-in error:",s),m({title:"Sign in failed",description:s instanceof Error?s.message:"Please try again.",variant:"destructive"}),v(!1)}},P=async()=>{N(!0);try{const{data:s,error:t}=await u.functions.invoke("create-guest-checkout",{body:{tier:a,interval:c,email:x}});if(t)throw t;if(s!=null&&s.url)window.location.href=s.url;else throw new Error("No checkout URL returned")}catch(s){console.error("Checkout error:",s),m({title:"Checkout failed",description:s instanceof Error?s.message:"Please try again.",variant:"destructive"}),N(!1)}};return e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx($,{title:"Start Your 7-Day Trial for $1",description:"Try FANTAISY for 7 days for just $1. Full access to Daily Fantasy tools and betting picks. Cancel anytime."}),e.jsx(E,{}),e.jsx("main",{className:"flex-1 pt-20 md:pt-24 pb-12 px-4",children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx(T,{to:"/",className:"inline-block mb-6",children:e.jsx("img",{src:I.url,alt:"FANTAISY",className:"w-14 h-14 mx-auto"})}),e.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-foreground mb-3",children:"Start Your 7-Day Trial for $1"}),e.jsx("p",{className:"text-lg text-muted-foreground max-w-xl mx-auto",children:"Full access to all features. Cancel anytime."})]}),e.jsxs("div",{className:"flex flex-wrap justify-center gap-6 mb-10",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(M,{className:"w-4 h-4 text-success-text"}),e.jsx("span",{className:"text-sm",children:"7-day trial for $1"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(z,{className:"w-4 h-4 text-success-text"}),e.jsx("span",{className:"text-sm",children:"Cancel anytime"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(O,{className:"w-4 h-4 text-success-text"}),e.jsx("span",{className:"text-sm",children:"Secure checkout"})]})]}),e.jsx("div",{className:"flex justify-center mb-10",children:e.jsxs("div",{className:"bg-card border border-border rounded-xl p-1 flex",children:[e.jsx("button",{onClick:()=>y("monthly"),className:`px-5 py-2.5 rounded-lg font-medium transition-all text-sm ${c==="monthly"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Monthly"}),e.jsxs("button",{onClick:()=>y("annual"),className:`px-5 py-2.5 rounded-lg font-medium transition-all flex items-center gap-2 text-sm ${c==="annual"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:["Annual",e.jsx("span",{className:"bg-success text-white text-xs px-2 py-0.5 rounded-full font-bold",children:"SAVE 20%"})]})]})}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6 max-w-4xl mx-auto mb-10",children:[e.jsxs("div",{onClick:()=>p("pro"),className:` 2 relative bg-card rounded-2xl p-6 cursor-pointer transition-all 3 ${a==="pro"?"border-2 border-primary shadow-lg shadow-primary/20":"border border-border hover:border-muted-foreground
3/50"} 4 `,children:[e.jsx("div",{className:`absolute top-5 right-5 w-6 h-6 rounded-full border-2 flex items-center justify-center ${a==="pro"?"border-primary bg-primary":"border-muted-foreground/50"}`,children:a==="pro"&&e.jsx(h,{className:"w-4 h-4 text-primary-foreground"})}),e.jsx("h3",{className:"text-2xl font-bold text-foreground mb-1",children:"Pro"}),e.jsx("p",{className:"text-muted-foreground text-sm mb-5",children:r.pro.description}),e.jsxs("div",{className:"mb-5",children:[c==="monthly"?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-3xl font-bold text-foreground",children:["$",r.pro.monthlyPrice]}),e.jsx("span",{className:"text-muted-foreground",children:"/month"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-3xl font-bold text-foreground",children:["$",r.pro.annualMonthly]}),e.jsx("span",{className:"text-muted-foreground",children:"/month"}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["$",r.pro.annualPrice," billed annually"]})]}),e.jsx("p",{className:"text-sm text-success-text mt-1",children:"After 7-day trial"})]}),e.jsx("ul",{className:"space-y-2.5 mb-5",children:r.pro.features.map((s,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(h,{className:"w-4 h-4 text-success-text mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-muted-foreground text-sm",children:s})]},t))}),e.jsxs("div",{className:"pt-4 border-t border-border",children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-2.5",children:"Not included:"}),e.jsx("ul",{className:"space-y-2",children:r.pro.notIncluded.map((s,t)=>e.jsxs("li",{className:"flex items-center gap-2 text-muted-foreground/70",children:[e.jsx(B,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm",children:s})]},t))})]})]}),e.jsxs("div",{onClick:()=>p("sharp"),className:` 5 relative bg-card rounded-2xl p-6 cursor-pointer transition-all 6 ${a==="sharp"?"border-2 border-primary shadow-lg shadow-primary/20":"border border-border hover:border-muted-foreground/50"} 7 `,children:[e.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:e.jsx("span",{className:"bg-gradient-to-r from-primary to-primary/80 text-primary-foreground text-xs font-bold px-4 py-1 rounded-full",children:"MOST POPULAR"})}),e.jsx("div",{className:`absolute top-5 right-5 w-6 h-6 rounded-full border-2 flex items-center justify-center ${a==="sharp"?"border-primary bg-primary":"border-muted-foreground/50"}`,children:a==="sharp"&&e.jsx(h,{className:"w-4 h-4 text-primary-foreground"})}),e.jsx("h3",{className:"text-2xl font-bold text-foreground mb-1",children:"Sharp"}),e.jsx("p",{className:"text-muted-foreground text-sm mb-5",children:r.sharp.description}),e.jsxs("div",{className:"mb-5",children:[c==="monthly"?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-3xl font-bold text-foreground",children:["$",r.sharp.monthlyPrice]}),e.jsx("span",{className:"text-muted-foreground",children:"/month"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-3xl font-bold text-foreground",children:["$",r.sharp.annualMonthly]}),e.jsx("span",{className:"text-muted-foreground",children:"/month"}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["$",r.sharp.annualPrice," billed annually"]})]}),e.jsx("p",{className:"text-sm text-success-text mt-1",children:"After 7-day trial"})]}),e.jsx("ul",{className:"space-y-2.5",children:r.sharp.features.map((s,t)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(h,{className:"w-4 h-4 text-success-text mt-0.5 flex-shrink-0"}),e.jsx("span",{className:`text-sm ${t===0?"text-primary font-semibold":"text-muted-foreground"}`,children:s})]},t))})]})]}),e.jsxs("div",{className:"text-center space-y-4",children:[x&&e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:["Signed in as ",e.jsx("span",{className:"font-medium text-foreground",children:x})]}),e.jsx(w,{onClick:P,disabled:f||g,size:"lg",className:"px-10 py-6 text-lg font-bold",children:f?e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"w-5 h-5 mr-2 animate-spin"}),"Loading..."]}):`START FOR $1 â ${a==="pro"?"Pro":"Sharp"}`}),!x&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-3 max-w-xs mx-auto my-4",children:[e.jsx("div",{className:"flex-1 h-px bg-border"}),e.jsx("span",{className:"text-xs text-muted-foreground uppercase",children:"or continue with"}),e.jsx("div",{className:"flex-1 h-px bg-border"})]}),e.jsxs(w,{onClick:C,disabled:g||f,variant:"outline",size:"lg",className:"px-8 py-5",children:[g?e.jsx(S,{className:"w-5 h-5 mr-2 animate-spin"}):e.jsxs("svg",{className:"w-5 h-5 mr-2",viewBox:"0 0 24 24",children:[e.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),e.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),e.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),e.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Continue with Google"]})]}),e.jsx("p",{className:"text-muted-foreground text-sm mt-4",children:"Secure checkout powered by Stripe"}
7),e.jsx("p",{className:"text-muted-foreground/70 text-xs mt-2",children:"You'll be charged $1 today; your plan renews after the 7-day trial"})]}),e.jsx("div",{className:"flex justify-center items-center gap-6 mt-10 text-muted-foreground/50",children:e.jsx("span",{className:"text-sm",children:"256-bit SSL Encryption"})})]})}),e.jsx(G,{})]})};export{V as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.