1import{R as v,u as N,r,j as e,L as w,s as S}from"./index-P1I-393C.js";import{l as C}from"./index-BDXZQHs3.js";import{S as k,a as A}from"./site-footer-CwdpVmZO.js";function R(){const s=v.useSearch(),m=N(),[n,b]=r.useState(""),[o,x]=r.useState(""),[l,g]=r.useState(""),[i,a]=r.useState(null),[d,c]=r.useState(!1),[p,h]=r.useState(!1),f=async t=>{t.preventDefault(),a(null),c(!0);const{data:j,error:u}=await S.auth.signUp({email:o,password:l,options:{emailRedirectTo:`${window.location.origin}${s.redirect}`,data:{full_name:n}}});c(!1),u?a(u.message):j.session?m({to:s.redirect}):h(!0)},y=async()=>{a(null);const t=await C.auth.signInWithOAuth("google",{redirect_uri:`${window.location.origin}${s.redirect}`});t.error&&a(t.error.message)};return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(k,{}),e.jsxs("main",{className:"mx-auto max-w-md px-6 py-24",children:[e.jsx("h1",{className:"mb-2 font-display text-4xl",children:"Create account"}),e.jsx("p",{className:"mb-8 text-sm text-muted-foreground",children:"Set up your member account to apply for SPAA USA membership."}),p?e.jsxs("div",{className:"border border-brand-gold/40 bg-brand-gold/5 p-6",children:[e.jsx("h2",{className:"mb-2 font-display text-2xl",children:"Check your email"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["We sent a confirmation link to ",e.jsx("strong",{children:o}),". Click it to activate your account, then return to sign in."]})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:y,className:"mb-6 w-full border border-border bg-white py-3 text-sm font-medium text-brand-navy hover:bg-brand-gold/10",children:"Continue with Google"}),e.jsxs("div",{className:"mb-6 flex items-center gap-3 text-xs uppercase tracking-widest text-muted-foreground",children:[e.jsx("div",{className:"h-px flex-1 bg-border"})," or ",e.jsx("div",{className:"h-px flex-1 bg-border"})]}),e.jsxs("form",{onSubmit:f,className:"space-y-4",children:[e.jsx("input",{value:n,onChange:t=>b(t.target.value),required:!0,placeholder:"Full name",className:"w-full border border-border bg-transparent px-3 py-3 focus:border-brand-gold focus:outline-none"}),e.jsx("input",{type:"email",value:o,onChange:t=>x(t.target.value),required:!0,placeholder:"Email",className:"w-full border border-border bg-transparent px-3 py-3 focus:border-brand-gold focus:outline-none"}),e.jsx("input",{type:"password",value:l,onChange:t=>g(t.target.value),required:!0,minLength:8,placeholder:"Password (min 8 chars)",className:"w-full border border-border bg-transparent px-3 py-3 focus:border-brand-gold focus:outline-none"}),i&&e.jsx("p",{className:"text-sm text-red-600",children:i}),e.jsx("button",{type:"submit",disabled:d,className:"w-full bg-brand-navy py-4 text-xs font-bold uppercase tracking-widest text-white hover:bg-brand-gold disabled:opacity-60",children:d?"Creating...":"Create account"})]}),e.jsxs("p",{className:"mt-6 text-sm text-muted-foreground",children:["Already a member?"," ",e.jsx(w,{to:"/login",search:{redirect:s.redirect},className:"text-brand-navy hover:text-brand-gold",children:"Sign in"})]})]})]}),e.jsx(A,{})]})}export{R as component};
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.