import{a as c,j as e}from"./vendor-query-Brcc40-Y.js";import{b as d,L as o}from"./vendor-react-DP6BW_9B.js";import{A as i}from"./AuthLayout-DounjrD9.js";import{h as x}from"./index-tN-ddyeb.js";import"./vendor-utils-ui5PHgZB.js";import"./vendor-zustand-CVDiRiMG.js";import"./vendor-form-BQNAly2Z.js";function v(){var s,a,n;const[m]=d(),t=m.get("token")??"",r=x();if(c.useEffect(()=>{t&&r.mutate(t)},[t]),!t)return e.jsxs(i,{title:"Invalid link",subtitle:"This verification link is missing a token",children:[e.jsx("div",{className:"rounded-2xl border border-danger/30 bg-danger-subtle px-6 py-5 text-center",children:e.jsx("p",{className:"text-sm text-danger",children:"Open the link from your verification email, or request a new one from the sign-in page."})}),e.jsx("p",{className:"mt-8 text-center text-sm text-ink-muted",children:e.jsx(o,{to:"/login",className:"text-primary hover:text-primary-hover font-medium",children:"← Back to sign in"})})]});if(r.isError){const l=((n=(a=(s=r.error)==null?void 0:s.response)==null?void 0:a.data)==null?void 0:n.message)??"This verification link is invalid or has expired.";return e.jsxs(i,{title:"Verification failed",subtitle:"We couldn’t verify your email",children:[e.jsx("div",{className:"rounded-2xl border border-danger/30 bg-danger-subtle px-6 py-5 text-center",children:e.jsx("p",{className:"text-sm text-danger",children:l})}),e.jsx("p",{className:"mt-8 text-center text-sm text-ink-muted",children:e.jsx(o,{to:"/login",className:"text-primary hover:text-primary-hover font-medium",children:"← Back to sign in"})})]})}return e.jsx(i,{title:"Verifying email",subtitle:"Just a moment…",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"}),e.jsx("p",{className:"text-sm text-ink-muted",children:"Activating your account"})]})})}export{v as default};
