1import{j as e}from"./query-CHDd9xWM.js";import{f as p,u as g,r as t}from"./react-vendor-iR8l3MlE.js";import{s as y,a6 as j,k as w,x as N,T as b}from"./index-QkQHgx4Z.js";import{m as k}from"./motion--e7AmMHx.js";import"./radix-DFsJdaPX.js";import"./supabase-92svyh75.js";import"./charts-ROjd8s19.js";const x="#6D45D9",d="#0A0A0A",E="#FAFAF7",r="rgba(10,10,10,0.55)";function L(){const[f]=p(),i=g(),o=f.get("session_id"),[a,n]=t.useState("working"),[h,c]=t.useState(""),l=t.useRef(!1);return t.useEffect(()=>{if(!l.current){if(l.current=!0,!o){n("error"),c("Missing checkout session.");return}(async()=>{try{const{data:s,error:m}=await y.functions.invoke("finalize-lab-signup",{body:{sessionId:o}});if(m)throw m;if(s!=null&&s.error)throw new Error(s.error);n("success");const u=s==null?void 0:s.auto_login_url;setTimeout(()=>{u?window.location.href=u:i(`/auth?email=${encodeURIComponent(s.email)}&redirect=/dashboard`)},1500)}catch(s){n("error"),c((s==null?void 0:s.message)??"Something went wrong finalizing your account.")}})()}},[o,i]),e.jsx("div",{className:"min-h-screen flex items-center justify-center px-6",style:{background:E,color:d,fontFamily:"'General Sans', system-ui, sans-serif"},children:e.jsxs(k.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"w-full max-w-md text-center",children:[e.jsx("div",{className:"inline-flex mb-8",children:e.jsx(j,{size:56})}),a==="working"&&e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"mx-auto h-10 w-10 animate-spin",style:{color:x}}),e.jsx("h1",{className:"mt-6 text-2xl font-bold tracking-[-0.02em]",children:"Setting up your accountâ¦"}),e.jsx("p",{className:"mt-2 text-sm",style:{color:r},children:"Verifying your payment and creating your workspace."})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"mx-auto h-12 w-12",style:{color:x}}),e.jsx("h1",{className:"mt-6 text-2xl font-bold tracking-[-0.02em]",children:"You're in ð"}),e.jsx("p",{className:"mt-2 text-sm",style:{color:r},children:"Your Pro plan has started. Redirecting you to log inâ¦"})]}),a==="error"&&e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"mx-auto h-12 w-12 text-red-500"}),e.jsx("h1",{className:"mt-6 text-2xl font-bold tracking-[-0.02em]",children:"Something went wrong"}),e.jsx("p",{className:"mt-2 text-sm",style:{color:r},children:h}),e.jsx("p",{className:"mt-4 text-sm",style:{color:r},children:"Your payment is safe. Please contact support and we'll set up your account manually."}),e.jsx("a",{href:"mailto:[email protected]",className:"mt-6 inline-flex items-center gap-2 rounded-full px-6 py-3 text-sm font-semibold text-white",style:{background:d},children:"Contact support"})]})]})})}export{L 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.