1import{a as e,r as s,j as a,L as t}from"./vendor-DdjWeKhn.js";import{u as r,a as i,e as l,C as o}from"./index-DVNfcHhn.js";import{a as n}from"./accountAr-B8phKkDY.js";import{u as d,P as c,t as m,d as x}from"./useDefaultPhoneCountry-BEyKp0zs.js";import{T as h}from"./Toast-DsbQGKHg.js";import{m as u}from"./animations-BiTprZVg.js";import{j as p,A as g,O as b,a0 as f,J as y,a5 as j,at as w,Q as N,U as v,S as C}from"./icons-BCa0xwjb.js";const D=()=>{const{lang:D,isAr:k,dir:S}=r(),P=e=>n(e,k),T=e(),[E,A]=i({threshold:.1}),{register:F,error:L,isLoading:R}=l(),q=d(),[z,B]=s.useState(null),[_,W]=s.useState(!1),[J,M]=s.useState(""),[U,Y]=s.useState(!1),[Z,$]=s.useState(!1),[H,I]=s.useState({firstName:"",lastName:"",email:"",phone:"",company:"",password:"",confirmPassword:"",agreeToTerms:!1,subscribeNewsletter:!0}),[O,Q]=s.useState({score:0,feedback:[]}),X=e=>{const{name:s,value:a,type:t,checked:r}=e.target;I(e=>({...e,[s]:"checkbox"===t?r:a})),"password"===s&&G(a)},G=e=>{let s=0;const a=[];e.length>=8?s++:a.push("At least 8 characters"),/[a-z]/.test(e)?s++:a.push("Lowercase letter"),/[A-Z]/.test(e)?s++:a.push("Uppercase letter"),/\d/.test(e)?s++:a.push("Number"),/[^a-zA-Z0-9]/.test(e)?s++:a.push("Special character"),Q({score:s,feedback:a})};return a.jsxs("div",{className:"min-h-screen pt-20 bg-[#0B0B0B] relative overflow-hidden",dir:S,lang:D,children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-[#D80027]/5 via-transparent to-purple-900/5"}),a.jsx("div",{className:'absolute inset-0 bg-[url(\'data:image/svg+xml,%3Csvg width="60" height="60" viewB
1ox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23D80027" fill-opacity="0.03"%3E%3Ccircle cx="30" cy="30" r="1"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E\')]'}),a.jsx("div",{className:"container mx-auto px-6 py-20 relative z-10",children:a.jsxs("div",{className:"max-w-lg mx-auto",children:[a.jsxs(u.div,{initial:{opacity:0,y:-50},animate:{opacity:1,y:0},transition:{duration:.8},className:"text-center mb-12",children:[a.jsx("div",{className:"flex justify-center mb-8",children:a.jsxs("div",{className:"relative",children:[a.jsx(o,{variant:"full",className:"h-16 w-auto text-[#F5F5F5]",style:{filter:"drop-shadow(0 0 20px rgba(216, 0, 39, 0.6))"}}),a.jsx("div",{className:"absolute inset-0 bg-[#D80027]/20 rounded-full blur-xl opacity-50 scale-150"})]})}),a.jsx("h1",{className:"text-4xl font-bold text-white mb-4",children:_?a.jsxs(a.Fragment,{children:[P("Registration"),a.jsx("span",{className:"text-[#D80027]",children:P("Successful")})]}):a.jsxs(a.Fragment,{children:[P("Join"),a.jsx("span",{className:"text-[#D80027]",children:"Cyparta"})]})}),a.jsx("p",{className:"text-gray-300 text-lg",children:_?"Complete email verification to activate your account.":P("Create your account and start building amazing projects")})]}),a.jsxs(u.div,{ref:E,initial:{opacity:0,y:50},animate:A?{opacity:1,y:0}:{},transition:{duration:.8,delay:.2},className:"bg-white/5 backdrop-blur-md rounded-2xl p-8 md:p-10 border border-white/10 shadow-2xl",children:[_?a.jsxs("div",{className:"text-center py-4 md:py-8",children:[a.jsx(u.div,{initial:{scale:.8,opacity:0}
1,animate:{scale:1,opacity:1},transition:{type:"spring",stiffness:200,damping:18},className:"inline-flex items-center justify-center w-24 h-24 rounded-full bg-emerald-500/15 border border-emerald-500/40 mb-8",children:a.jsx(p,{className:"w-14 h-14 text-emerald-400",strokeWidth:1.75})}),a.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-white mb-3",children:P("Registration successful")}),a.jsx("p",{className:"text-gray-300 text-base md:text-lg mb-2 max-w-md mx-auto leading-relaxed",children:"Your account has been created. We've sent a verification code to your email address."}),a.jsxs("p",{className:"text-sm text-gray-400 mb-10 break-all max-w-md mx-auto",children:[a.jsx("span",{className:"text-gray-500",children:P("Email:")}),a.jsx("span",{className:"text-white font-medium",children:J})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-stretch sm:items-center",children:[a.jsxs("button",{type:"button",onClick:()=>T("/otp-verification",{state:{context:"register",email:J,method:"email"}}),className:"inline-flex items-center justify-center gap-2 px-8 py-3.5 rounded-lg font-semibold bg-[#D80027] text-white hover:bg-[#D80027]/90 transition-all shadow-lg hover:shadow-[#D80027]/25",children:[a.jsx("span",{children:P("Continue to email verification")}),a.jsx(g,{className:"w-5 h-5 rtl:rotate-180"})]}),a.jsx(t,{to:"/login",className:"inline-flex items-center justify-center px-8 py-3.5 rounded-lg font-medium text-gray-300 border border-gray-600 hover:border-gray-500 hover:text-white transition-colors",children:P("Back to sign in")})]})]}):a.jsxs("form",{onSubmit:async e=>{if(e.preventDefault(),!(H.firstName&&H.lastName&&H.email&&H.password&&H.confirmPassword))return B({message:"â Please fill in all required fields.",type:"error"}),void setTimeout(()=>B(null),3e3);if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(H.email))return B({message:"â Please enter a valid email address.",type:"error"}),void setTimeout(()=>B(null),3e3);if(H.password!==H.confirmPassword)return B({message:"â Passwords do not match.",type:"error"}),void setTimeout(()=>B(null),3e3);if(O.score<3)return B({message:"â Please choose a stronger password.",type:"error"}),void setTimeout(()=>B(null),3e3);if(!H.agreeToTerms)return B({message:"â Please agree to the terms and conditions.",type:"error"}),void setTimeout(()=>B(null),3e3);try{const e=await F({email:H.email,first_name:H.firstName,last_name:H.lastName,password:H.password,confirm_password:H.confirmPassword,company_name:H.company,phone:H.phone});M(e.email),W(!0),window.scrollTo({top:0,behavior:"smooth"})}catch(s){const e=s instanceof Error?s.message:"Registration failed. Please try again.";B({message:`â ${e}`,type:"error"}),setTimeout(()=>B(null),3e3)}},className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:P("First Name *")}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:a.jsx(b,{className:"h-5 w-5 text-gray-400"})}),a.jsx("input",{type:"text",name:"firstName",value:H.firstName,onChange:X,className:"w-full pl-10 pr-4 py-3 bg-white/10 border border-gray-700 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-[#D80027] focus:ring-2 focus:ring-[#D80027]/20 transition-all",placeholder:P("First name"),required:!0,disabled:R})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:P("Last Name *")}),a.jsx("input",{type:"text",name:"lastName",value:H.lastName,onChange:X,className:"w-full px-4 py-3 bg-white/10 border border-gray-700 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-[#D80027] focus:ring-2 focus:ring-[#D80027]/20 transition-all",placeholder:P("Last name"),required:!0,disabled:R})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:P("Email Address *")}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:a.jsx(f,{className:"h-5 w-5 text-gray-400"})}),a.jsx("input",{type:"email",name:"email",value:H.email,onChange:X,className:"w-full pl-10 pr-4 py-3 bg-white/10 border border-gray-700 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-[#D80027] focus:ring-2 focus:ring-[#D80027]/20 transition-all",placeholder:P("Enter your email"),disabled:R})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:P("Phone number")}),a.jsx(c,{country:q,value:m(H.phone),onChange:e=>I(s=>({...s,phone:x(e)})),containerClass:"cyparta-react-tel",dropdownClass:"cyparta-tel-country-panel",searchPlaceholder:"Search country or dial codeâ¦",dropdownStyle:{backgroundColor:"#121212",borderRadius:12,border:"1px solid #374151",boxShadow:"0 24px 48px rgba(0, 0, 0, 0.55)",maxHeight:280},searchStyle:{width:"100%",margin:0,padding:"10px 12px",fontSize:14,color:"#f3f4f6",backgroundColor:"#0b0b0b",border:"1px solid #3f3f46",borderRadius:8,outline:"none",boxSizing:"border-box"},inputStyle:{backgroundColor:"rgba(255,255,255,0.05)",border:"1px solid #374151",borderRadius:"0.5rem",width:"100%",height:"48px",color:"white",paddingLeft:"48px"},buttonStyle:{backgroundColor:"rgba(255,255,255,0.05)",border:"1px solid #374151",borderTopLeftRadius:"0.5rem",borderBottomLeftRadius:"0.5rem"},containerStyle:{width:"100%"},inputClass:"focus:outline-none focus:ring-2 focus:ring-[#D80027]/20 focus:border-[#D80027] placeholder-gray-400",specialLabel:"",disabled:R,enableSearch:!0,countryCodeEditable:!1})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:P("C
1ompany")}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:a.jsx(y,{className:"h-5 w-5 text-gray-400"})}),a.jsx("input",{type:"text",name:"company",value:H.company,onChange:X,className:"w-full pl-10 pr-4 py-3 bg-white/10 border border-gray-700 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-[#D80027] focus:ring-2 focus:ring-[#D80027]/20 transition-all",placeholder:P("Company name"),disabled:R})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:P("Password *")}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:a.jsx(j,{className:"h-5 w-5 text-gray-400"})}),a.jsx("input",{type:U?"text":"password",name:"password",value:H.password,onChange:X,className:"w-full pl-10 pr-12 py-3 bg-white/10 border border-gray-700 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-[#D80027] focus:ring-2 focus:ring-[#D80027]/20 transition-all",placeholder:P("Create a password"),required:!0,disabled:R}),a.jsx("button",{type:"button",onClick:()=>Y(!U),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-white transition-colors",disabled:R,children:U?a.jsx(w,{className:"h-5 w-5"}):a.jsx(N,{className:"h-5 w-5"})})]}),H.password&&a.jsxs("div",{className:"mt-2",children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[a.jsx("div",{className:"flex-1 bg-gray-700 rounded-full h-2",children:a.jsx("div",{className:"h-2 rounded-full transition-all duration-300 "+(O.score<=1?"bg-red-500":O.score<=3?"bg-yellow-500":"bg-green-500"),style:{width:O.score/5*100+"%"}})}),a.jsx("span",{className:"text-xs font-medium "+(O.score<=1?"text-red-400":O.score<=3?"text-yellow-400":"text-green-400"),children:O.score<=1?"Weak":O.score<=3?"Medium":"Strong"})]}),O.feedback.length>0&&a.jsxs("p",{className:"text-xs text-gray-400",children:["Missing: ",O.feedback.join(", ")]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:P("Confirm Password *")}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:a.jsx(j,{className:"h-5 w-5 text-gray-400"})}),a.jsx("input",{type:Z?"text":"password",name:"confirmPassword",value:H.confirmPassword,onChange:X,className:"w-full pl-10 pr-12 py-3 bg-white/10 border border-gray-700 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-[#D80027] focus:ring-2 focus:ring-[#D80027]/20 transition-all",placeholder:P("Confirm your password"),required:!0,disabled:R}),a.jsx("button",{type:"button",onClick:()=>$(!Z),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-white transition-colors",disabled:R,children:Z?a.jsx(w,{className:"h-5 w-5"}):a.jsx(N,{className:"h-5 w-5"})})]}),H.confirmPassword&&H.password!==H.confirmPassword&&a.jsx("p",{className:"mt-1 text-xs text-red-400",children:P("Passwords do not match")})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("label",{className:"flex items-start",children:[a.jsx("input",{type:"checkbox",name:"agreeToTerms",checked:H.agreeToTerms,onChange:X,className:"w-4 h-4 mt-1 text-[#D80027] bg-white/10 border-gray-700 rounded focus:ring-[#D80027] focus:ring-2",required:!0,disabled:R}),a.jsxs("span",{className:"ml-2 text-sm text-gray-300",children:[P("I agree to the")," ",a.jsx(t,{to:"/privacy",className:"text-[#D80027] hover:text-white transition-colors",children:P("Terms of Service")})," ","and"," ",a.jsx(t,{to:"/privacy",className:"text-[#D80027] hover:text-white transition-colors",children:P("Privacy Policy")})]})]}),a.jsxs("label",{className:"flex items-start",children:[a.jsx("input",{type:"checkbox",name:"subscribeNewsletter",checked:H.subscribeNewsletter,onChange:X,className:"w-4 h-4 mt-1 text-[#D80027] bg-white/10 border-gray-700 rounded focus:ring-[#D80027] focus:ring-2",disabled:R}),a.jsx("span",{className:"ml-2 text-sm text-gray-300",children:P("Subscribe to our newsletter for updates and insights")})]})]}),a.jsx("button",{type:"submit",disabled:R,className:"w-full flex items-center justify-center space-x-3 py-3 px-6 rounded-lg font-semibold transition-all duration-300 "+(R?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-[#D80027] text-white hover:bg-[#D80027]/90 transform hover:scale-105 shadow-lg hover:shadow-[#D80027]/25"),children:R?a.jsxs(a.Fragment,{children:[a.jsx(u.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"w-5 h-5 border-2 border-gray-400 border-t-white rounded-full"}),a.jsx("span",{children:P("Creating Account...")})]}):a.jsxs(a.Fragment,{children:[a.jsx(v,{className:"w-5 h-5"}),a.jsx("span",{children:P("Create Account")}
1),a.jsx(g,{className:"w-5 h-5 rtl:rotate-180"})]})})]}),!_&&a.jsx(a.Fragment,{children:a.jsx("div",{className:"mt-8 text-center",children:a.jsxs("p",{className:"text-gray-400",children:[P("Already have an account?")," ",a.jsx(t,{to:"/login",className:"text-[#D80027] hover:text-white transition-colors",children:P("Sign in here")})]})})})]}),!_&&a.jsx(u.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.8,delay:.4},className:"mt-8 bg-white/5 backdrop-blur-md rounded-xl p-6 border border-white/10",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(C,{className:"w-6 h-6 text-[#D80027]"}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-semibold",children:P("Secure Registration")}),a.jsx("p",{className:"text-gray-400 text-sm",children:P("Your information is encrypted and protected with industry-standard security")})]})]})})]})}),z&&a.jsx(h,{message:z.message,type:z.type})]})};export{D 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.