1import{t as A,v as m,w as C,g as E,a as P,r as i,j as e,R as L,S as $,x as Y,y as I,l as q,z as p,A as c,e as M,L as F,J as u}from"./index-S7OHX2-6.js";import{P as O}from"./ParticlesBackground-BPZZyMrY.js";import{C as b}from"./checkbox-C16KYxkS.js";import{S as T,a as _,b as J,c as R,d as a}from"./select-azrqOQKa.js";import{L as W,E as z}from"./lock-BGAP221b.js";import{E as D}from"./eye-U9b14YhF.js";import"./index-DebbtrBo.js";import"./check-3mOQBuS8.js";import"./chevron-up-DTB5nL8a.js";const U=A().shape({name:m().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").required("Name is required"),email:m().email("Invalid email address").required("Email is required"),password:m().min(8,"Password must be at least 8 characters").matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^\s]*$/,"Password must contain at least one uppercase letter, one lowercase letter, one number, and no spaces").required("Password is required"),registerAs:m().required("Please select an option."),terms:C().oneOf([!0],"You must agree to the terms of service").required("You must agree to the terms of service")}),w="signup_draft",V=()=>{try{const n=sessionStorage.getItem(w);if(n)return JSON.parse(n)}catch{}return{name:"",email:"",password:"",terms:!1,registerAs:"",newsletter:!1}},ae=()=>{const{user:n,signup:j,subscribeNewsletter:N}=E(),d=P(),[x,v]=i.useState(!1),[g,f]=i.useState(!1),[h,y]=i.useState(0),S=Math.max(0,1-h*.001);i.useEffect(()=>{n&&d("/")},[n,d]),i.useEffect(()=>{const s=()=>y(window.scrollY);return window.addEventListener("scroll",s,{passive:!0}),()=>window.removeEventListener("scroll",s)},[]);const k=async(s,{setSubmitting:r})=>{var l,o;f(!0);try{const t=await j(s.name,s.email,s.password,s.registerAs);t.state?(s.newsletter&&await N(),sessionStorage.removeItem(w),u.success("Signup successful!"),d("/")):((l=t.backendMsg)==null?void 0:l.toLowerCase().includes("already"))||((o=t.backendMsg)==null?void 0:o.toLowerCase().includes("registered"))?u.error("You already have an account with this email.",{description:"Sign in to your existing account, or reset your password if you've forgotten it.",action:{label:"Sign in",onClick:()=>d("/login")},duration:8e3}):u.error(t.backendMsg||t.message||"Failed to create account")}catch(t){console.error("Error:",t),u.error(t.message||"Failed to create account")}finally{f(!1),r(!1)}};return e.jsxs("section",{className:"relative py-20 hero-gradient overflow-hidden",children:[e.jsxs("div",{className:"hero-particles",children:[e.jsx("div",{className:"absolute inset-0 hero-gradient",style:{transform:`translateY(${h*.3}px)`}}),e.jsx(O,{}),e.jsx("div",{className:"absolute top-10 left-10 w-24 h-24 bg-[#9327e0]/10 rounded-full blur-xl animate-pulse"}),e.jsx("div",{className:"absolute bottom-10 right-10 w-32 h-32 bg-[#204d74]/10 rounded-full blur-2xl animate-pulse delay-1000"})]}),e.jsx("div",{className:"relative z-10 max-w-md mx-auto px-4",style:{opacity:S,transform:`translateY(${h*.1}px)`},children:e.jsxs("div",{className:"glass-dark rounded-2xl p-8 shadow-2xl animate-scale-in",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsxs("div",{className:"inline-flex items-center gap-3 glass rounded-full px-4 py-2 mb-6 hover:bg-white/10 transition-all duration-500 group",children:[e.jsx(L,{className:"w-4 h-4 text-[#9327e0] group-hover:rotate-12 transition-transform duration-500"}),e.jsx("span",{className:"text-white text-sm font-medium",children:"Create Account"}),e.jsx($,{className:"w-4 h-4 text-[#9327e0] group-hover:-rotate-12 transition-transform duration-500"})]}),e.jsx("h1",{className:"text-3xl font-bold text-white mb-2",children:"Join World Space Week"}),e.jsx("p",{className:"text-gray-300",children:"Create your account to start adding events"})]}),e.jsx(Y,{initialValues:V(),validationSchema:U,onSubmit:k,children:({errors:s,touched:r,values:l,setFieldValue:o})=>e.jsxs(I,{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-white mb-2",children:"Full Name"}),e.jsxs("div",{className:"relative",children:[e.jsx(q,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-5 h-5"}),e.jsx(p,{name:"name",type:"text",className:`w-full pl-10 pr-4 py-3 bg-[#220536]/50 border ${s.name&&r.name?"border-red-500":"border-[#9327e0]/30"} rounded-xl text-white placeholder-gray-400 focus:ring-2 focus:ring-[#9327e0] focus:border-transparent transition-all duration-300`,placeholder:"Your full name"})]}),e.jsx(c,{name:"name",component:"div",className:"text-red-500 text-sm mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-white mb-2",children:"Email Address"}),e.jsxs("div",{className:"relative",children:[e.jsx(M,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-5 h-5"}),e.jsx(p,{name:"email",type:"email",className:`w-full pl-10 pr-4 py-3 bg-[#220536]/50 border ${s.email&&r.email?"border-red-500":"border-[#9327e0]/30"} rounded-xl text-white placeholder-gray-400 focus:ring-2 focus:ring-[#9327e0] focus:border-transparent transition-all duration-300`,placeholder:"[email protected]"})]}),e.jsx(c,{name:"email",component:"div",className:"text-red-500 text-sm mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-white mb-2",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(W,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-5 h-5"}),e.jsx(p,{name:"password",type:x?"text":"password",className:`w-full pl-10 pr-12 py-3 bg-[#220536]/50 border ${s.password&&r.password?"border-red-500":"border-[#9327e0]/30"} rounded-xl text-white placeholder-gray-400 focus:ring-2 focus:ring-[#9327e0] focus:border-transparent transition-all duration-300`,placeholder:"Create a password"}),e.jsx("button",{type:"button",onClick:()=>v(!x),className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-[#9327e0] transition-colors duration-300",children:x?e.jsx(z,{className:"w-5 h-5"}):e.jsx(D,{className:"w-5 h-5"})})]}),e.jsx(c,{name:"password",component:"div",className:"text-red-500 text-sm mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-white mb-2",children:"I'm registering as:"}),e.jsxs(T,{value:l.registerAs,onValueChange:t=>o("registerAs",t),children:[e.jsx(_,{className:`w-full pl-4 pr-4 py-3 h-auto bg-[#220536]/50 border ${s.registerAs&&r.registerAs?"border-red-500":"border-[#9327e0]/30"} rounded-xl text-white focus:ring-2 focus:ring-[#9327e0] focus:border-transparent transition-all duration-300`,children:e.jsx(J,{placeholder:"Please select...",className:"text-gray-400"})}),e.jsxs(R,{className:"bg-[#220536] border-[#9327e0]/30 text-white",children:[e.jsx(a,{value:"Teacher/Educator",className:"focus:bg-[#9327e0]/20 focus:text-white",children:"Teacher / Educator"}),e.jsx(a,{value:"Student",className:"focus:bg-[#9327e0]/20 focus:text-white",children:"Student"}),e.jsx(a,{value:"Space Agency",className:"focus:bg-[#9327e0]/20 focus:text-white",children:"Space Agency"}),e.jsx(a,{value:"Space/Astronomy Club",className:"focus:bg-[#9327e0]/20 focus:text-white",children:"Space / Astronomy Club"}),e.jsx(a,{value:"Museum",className:"focus:bg-[#9327e0]/20 focus:text-white",children:"Museum"}),e.jsx(a,{value:"Planetarium",className:"focus:bg-[#9327e0]/20 focus:text-white",children:"Planetarium"}),e.jsx(a,{value:"Library",className:"focus:bg-[#9327e0]/20 focus:text-white",children:"Library"}),e.jsx(a,{value:"Other",className:"focus:bg-[#9327e0]/20 focus:text-white",children:"Other"})]})]}),e.jsx(c,{name:"registerAs",component:"div",className:"text-red-500 text-sm mt-1"})]}),e.jsxs("div",{className:"flex items-start",children:[e.jsx(b,{checked:l.terms,onCheckedChange:t=>o("terms",t===!0),className:`mt-0.5 border-[#9327e0]/40 data-[state=checked]:bg-[#9327e0] data-[state=checked]:border-[#9327e0] ${s.terms&&r.terms?"border-red-500":""}`}),e.jsxs("span",{className:"ml-2 text-sm text-gray-300",children:["I agree to the"," ",e.jsx("a",{href:"/p/terms",target:"_blank",rel:"noopener noreferrer",className:"text-[#9327e0] hover:text-[#204d74] transition-colors duration-300",children:"Terms of Service"})," ","and acknowledge the"," ",e.jsx("a",{href:"/p/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"text-[#9327e0] hover:text-[#204d74] transition-colors duration-300",children:"Privacy Policy"}),"."]})]}),e.jsx(c,{name:"terms",component:"div",className:"text-red-500 text-sm -mt-4"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(b,{checked:l.newsletter,onCheckedChange:t=>o("newsletter",t===!0),className:"border-[#9327e0]/40 data-[state=checked]:bg-[#9327e0] data-[state=checked]:border-[#9327e0]"}),e.jsx("span",{className:"ml-2 text-sm text-gray-300",children:"Send me World Space Week Newsletter."})]}),e.jsx("button",{type:"submit",className:"btn-primary w-full",disabled:g,children:g?"Creating Account...":"Sign Up"})]})}),e.jsx("div",{className:"mt-8 text-center space-y-2",children:e.jsxs("p",{className:"text-gray-300",children:["Already have an account?"," ",e.jsx(F,{to:"/login",className:"text-[#9327e0] hover:text-[#204d74] transition-colors duration-300 font-medium",children:"Sign in here"})]})})]})})]})};export{ae 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.