import{m as c,j as e,L as u}from"./app-D_lWdAF1.js";import{I as i}from"./input-error-Dz46bbCi.js";import{T as x}from"./text-link-CF71Tnex.js";import{B as h}from"./app-logo-icon-B18IWF-o.js";import{L as l,I as d}from"./label-4h6KnNp-.js";import{A as g}from"./auth-layout-CPcoyQnT.js";import{L as j}from"./loader-circle-CqvjZacN.js";import"./app-gFGt7Tbg.js";import"./index-DKsctv8k.js";function L(){const{data:r,setData:o,post:m,processing:s,errors:t,reset:n}=c({name:"",mobile:"",email:"",password:"",password_confirmation:""}),p=a=>{a.preventDefault(),m(route("register"),{onFinish:()=>n("password","password_confirmation")})};return e.jsxs(g,{title:"Create an account",description:"Enter your details below to create your account",children:[e.jsx(u,{title:"Register"}),e.jsxs("form",{className:"flex flex-col gap-6",onSubmit:p,children:[e.jsxs("div",{className:"grid gap-6",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(l,{htmlFor:"name",children:"Name"}),e.jsx(d,{id:"name",type:"text",required:!0,autoFocus:!0,tabIndex:1,autoComplete:"name",value:r.name,onChange:a=>o("name",a.target.value),disabled:s,placeholder:"Full name"}),e.jsx(i,{message:t.name,className:"mt-2"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(l,{htmlFor:"email",children:"Mobile"}),e.jsx(d,{id:"mobile",required:!0,tabIndex:2,autoComplete:"mobile",value:r.mobile,onChange:a=>o("mobile",a.target.value),disabled:s,placeholder:"XXXXXXXXXX"}),e.jsx(i,{message:t.mobile})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(l,{htmlFor:"email",children:"Email address"}),e.jsx(d,{id:"email",type:"email",required:!0,tabIndex:2,autoComplete:"email",value:r.email,onChange:a=>o("email",a.target.value),disabled:s,placeholder:"email@example.com"}),e.jsx(i,{message:t.email})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(l,{htmlFor:"password",children:"Password"}),e.jsx(d,{id:"password",type:"password",required:!0,tabIndex:3,autoComplete:"new-password",value:r.password,onChange:a=>o("password",a.target.value),disabled:s,placeholder:"Password"}),e.jsx(i,{message:t.password})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(l,{htmlFor:"password_confirmation",children:"Confirm password"}),e.jsx(d,{id:"password_confirmation",type:"password",required:!0,tabIndex:4,autoComplete:"new-password",value:r.password_confirmation,onChange:a=>o("password_confirmation",a.target.value),disabled:s,placeholder:"Confirm password"}),e.jsx(i,{message:t.password_confirmation})]}),e.jsxs(h,{type:"submit",className:"mt-2 w-full",tabIndex:5,disabled:s,children:[s&&e.jsx(j,{className:"h-4 w-4 animate-spin"}),"Create account"]})]}),e.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:["Already have an account?"," ",e.jsx(x,{href:route("login"),tabIndex:6,children:"Log in"})]})]})]})}export{L as default};
