"use strict";(self.webpackChunkForest_Rangers_System=self.webpackChunkForest_Rangers_System||[]).push([[9723],{59723:function(e,t,r){r.r(t),r.d(t,{default:function(){return G}});var n=r(4942),s=r(22650),i=r(29466),a=r(17592),l=r(73428),o=r(61113),d=r(90891),c=r(70178),m=r(57829),u=r(61689),x=r(1229),h=r(22868),p=r(76025),f=r(22227),g=r(67002),Z=r(25937),j=r(1413),v=r(15861),y=r(29439),b=r(64687),w=r.n(b),S=r(3463),C=r(47313),E=r(75627),_=r(1432),k=r(35898),N=r(99881),P=r(41727),q=r(47131),I=r(32703),F=r(75667),R=r(24185),A=r(72473),L=r(46417);function B(){var e=(0,x.Z)().register,t=(0,F.Z)(),r=(0,C.useState)(!1),n=(0,y.Z)(r,2),s=n[0],i=n[1],a=S.Ry().shape({firstName:S.Z_().required("First name required"),lastName:S.Z_().required("Last name required"),email:S.Z_().email("Email must be a valid email address").required("Email is required"),password:S.Z_().required("Password is required")}),l=(0,E.cI)({resolver:(0,_.X)(a),defaultValues:{firstName:"",lastName:"",email:"",password:""}}),o=(l.reset,l.setError),d=l.handleSubmit,c=l.formState,m=c.errors,u=c.isSubmitting,h=function(){var r=(0,v.Z)(w().mark((function r(n){return w().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,e(n.email,n.password,n.firstName,n.lastName);case 3:r.next=9;break;case 5:r.prev=5,r.t0=r.catch(0),console.error(r.t0),t.current&&o("afterSubmit",(0,j.Z)((0,j.Z)({},r.t0),{},{message:r.t0.message}));case 9:case"end":return r.stop()}}),r,null,[[0,5]])})));return function(e){return r.apply(this,arguments)}}();return(0,L.jsx)(A.RV,{methods:l,onSubmit:d(h),children:(0,L.jsxs)(k.Z,{spacing:3,children:[!!m.afterSubmit&&(0,L.jsx)(N.Z,{severity:"error",children:m.afterSubmit.message}),(0,L.jsxs)(k.Z,{direction:{xs:"column",sm:"row"},spacing:2,children:[(0,L.jsx)(A.au,{autoComplete:"new-name",name:"firstName",label:"First name"}),(0,L.jsx)(A.au,{autoComplete:"new-name",name:"lastName",label:"Last name"})]}),(0,L.jsx)(A.au,{autoComplete:"new-email",name:"email",label:"Email address"}),(0,L.jsx)(A.au,{autoComplete:"new-password",name:"password",label:"Password",type:s?"text":"password",InputProps:{endAdornment:(0,L.jsx)(P.Z,{position:"end",children:(0,L.jsx)(q.Z,{edge:"end",onClick:function(){return i(!s)},children:(0,L.jsx)(R.Z,{icon:s?"eva:eye-fill":"eva:eye-off-fill"})})})}}),(0,L.jsx)(I.Z,{fullWidth:!0,size:"large",type:"submit",variant:"contained",loading:u,children:"Sign up"})]})})}var D=(0,a.ZP)("div")((function(e){var t=e.theme;return(0,n.Z)({},t.breakpoints.up("md"),{display:"flex"})})),M=(0,a.ZP)("header")((function(e){var t=e.theme;return(0,n.Z)({top:0,zIndex:9,lineHeight:0,width:"100%",display:"flex",alignItems:"center",position:"absolute",padding:t.spacing(3),justifyContent:"space-between"},t.breakpoints.up("md"),{alignItems:"flex-start",padding:t.spacing(7,5,0,7)})})),W=(0,a.ZP)(l.Z)((function(e){return{width:"100%",maxWidth:464,display:"flex",flexDirection:"column",justifyContent:"center",margin:e.theme.spacing(2,0,2,2)}})),z=(0,a.ZP)("div")((function(e){return{maxWidth:480,margin:"auto",minHeight:"100vh",display:"flex",justifyContent:"center",flexDirection:"column",padding:e.theme.spacing(12,0)}}));function G(){var e=(0,x.Z)().method,t=(0,h.Z)("up","sm"),r=(0,h.Z)("up","md");return(0,L.jsx)(f.Z,{title:"Register",children:(0,L.jsxs)(D,{children:[(0,L.jsxs)(M,{children:[(0,L.jsx)(g.Z,{}),t&&(0,L.jsxs)(o.Z,{variant:"body2",sx:{mt:{md:-2}},children:["Already have an account? ","",(0,L.jsx)(d.Z,{variant:"subtitle2",component:i.rU,to:p.EE.login,children:"Login"})]})]}),r&&(0,L.jsxs)(W,{children:[(0,L.jsx)(o.Z,{variant:"h3",sx:{px:5,mt:10,mb:5},children:"Manage the job more effectively with Minimal"}),(0,L.jsx)(Z.Z,{visibleByDefault:!0,disabledEffect:!0,alt:"register",src:"/assets/illustrations/illustration_register.png"})]}),(0,L.jsx)(c.Z,{children:(0,L.jsxs)(z,{children:[(0,L.jsxs)(m.Z,{sx:{mb:5,display:"flex",alignItems:"center"},children:[(0,L.jsxs)(m.Z,{sx:{flexGrow:1},children:[(0,L.jsx)(o.Z,{variant:"h4",gutterBottom:!0,children:"Get started absolutely free."}),(0,L.jsx)(o.Z,{sx:{color:"text.secondary"},children:"Free forever. No credit card needed."})]}),(0,L.jsx)(u.Z,{title:(0,s.I)(e),children:(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(Z.Z,{disabledEffect:!0,src:"https://minimal-assets-api-dev.vercel.app/assets/icons/auth/ic_".concat(e,".png"),sx:{width:32,height:32}})})})]}),(0,L.jsx)(B,{}),(0,L.jsxs)(o.Z,{variant:"body2",align:"center",sx:{color:"text.secondary",mt:3},children:["By registering, I agree to Minimal\xa0",(0,L.jsx)(d.Z,{underline:"always",color:"text.primary",href:"#",children:"Terms of Service"}),"","and","",(0,L.jsx)(d.Z,{underline:"always",color:"text.primary",href:"#",children:"Privacy Policy"}),"."]}),!t&&(0,L.jsxs)(o.Z,{variant:"body2",sx:{mt:3,textAlign:"center"},children:["Already have an account?"," ",(0,L.jsx)(d.Z,{variant:"subtitle2",to:p.EE.login,component:i.rU,children:"Login"})]})]})})]})})}}}]);