1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1642],{77808:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(14232);let a=s.forwardRef(function({title:e,titleId:t,...r},a){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":t},r),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"}))})},78460:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/register/email",function(){return r(82285)}])},82285:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>x});var s=r(37876),a=r(48230),l=r.n(a),n=r(89099),i=r(14232),o=r(85392),d=r(74),c=r(93408),u=r(25620),m=r(39126);function x(){let e=(0,n.useRouter)(),{returnUrl:t}=e.query,{signUp:r,user:a,loading:x,onboarding:h}=(0,u.A)(),[f,b]=(0,i.useState)(""),[g,p]=(0,i.useState)(""),[w,y]=(0,i.useState)(!1),[j,v]=(0,i.useState)("");(0,i.useEffect)(()=>{e.isReady&&a&&!x&&!h&&e.replace((0,m.bk)(t))},[e,a,x,h,t]);let N=async e=>{if(e.preventDefault(),v(""),!f.trim()||!g)return void v("Please enter both email and password");if(g.length<6)return void v("Password should be at least 6 characters");y(!0);try{await r(f.trim(),g)}catch(e){v(e?.message||"Registration failed")}finally{y(!1)}};return(0,s.jsxs)("div",{className:"flex flex-col min-h-screen bg-white",children:[(0,s.jsx)(c.A,{title:"Create account â trains.fyi",description:"Create a trains.fyi account",canonical:"/register/email/"}),(0,s.jsx)(d.A,{}),(0,s.jsx)("main",{className:"flex-grow flex items-center justify-center px-4 py-12",children:(0,s.jsxs)("div",{className:"w-full max-w-sm",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Create account"}),(0,s.jsx)("p",{className:"text-gray-600 text-sm mb-6",children:(0,s.jsx)(l(),{href:"/login",className:"text-blue-600 hover:underline",children:"Back to sign in"})}),j&&(0,s.jsx)("div",{className:"mb-4 p-3 rounded-md bg-red-50 text-red-700 text-sm",role:"alert",children:j}),(0,s.jsxs)("form",{onSubmit:N,className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"register-email",className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),(0,s.jsx)("input",{id:"register-email",type:"email",autoComplete:"email",value:f,onChange:e=>b(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-blue-600 focus:border-blue-600",placeholder:"[email protected]"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"register-password",className:"block text-sm font-medium text-gray-700 mb-1",children:"Password"}),(0,s.jsx)("input",{id:"register-password",type:"password",autoComplete:"new-password",value:g,onChange:e=>p(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-blue-600 focus:border-blue-600",placeholder:"At least 6 characters"})]}),(0,s.jsx)("button",{type:"submit",disabled:w,className:"w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-600 disabled:opacity-50 disabled:cursor-not-allowed",children:w?"Creating accountâ¦":"Create account"})]}),(0,s.jsxs)("p",{className:"mt-6 text-center text-sm text-gray-600",children:["Already have an account?"," ",(0,s.jsx)(l(),{href:t?`/login/email?returnUrl=${encodeURIComponent(t)}`:"/login/email",className:"text-blue-600 hover:underline",children:"Sign in"})]})]})}),(0,s.jsx)(o.A,{})]})}}},e=>{e.O(0,[6701,3927,2325,3990,8447,5392,636,6593,8792],()=>e(e.s=78460)),_N_E=e.O()}]);
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.