Root Zanli
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
o5t6x7pgljbm
/
www
/
_next
/
static
/
chunks
/
pages
/
Filename :
signup-9c4d6fcbecfdbeb6.js
back
Copy
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7616],{87109:function(e,n,r){"use strict";r.d(n,{Z:function(){return w}});var t,i=r(63366),o=r(87462),a=r(67294),l=r(90512),s=r(94780),d=r(98216),c=r(15861),u=r(47167),h=r(74423),m=r(90948),p=r(1588),x=r(34867);function g(e){return(0,x.Z)("MuiInputAdornment",e)}let f=(0,p.Z)("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var y=r(71657),Z=r(85893);let b=["children","className","component","disablePointerEvents","disableTypography","position","variant"],j=e=>{let{classes:n,disablePointerEvents:r,hiddenLabel:t,position:i,size:o,variant:a}=e,l={root:["root",r&&"disablePointerEvents",i&&`position${(0,d.Z)(i)}`,a,t&&"hiddenLabel",o&&`size${(0,d.Z)(o)}`]};return(0,s.Z)(l,g,n)},v=(0,m.ZP)("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:(e,n)=>{let{ownerState:r}=e;return[n.root,n[`position${(0,d.Z)(r.position)}`],!0===r.disablePointerEvents&&n.disablePointerEvents,n[r.variant]]}})(({theme:e,ownerState:n})=>(0,o.Z)({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active},"filled"===n.variant&&{[`&.${f.positionStart}&:not(.${f.hiddenLabel})`]:{marginTop:16}},"start"===n.position&&{marginRight:8},"end"===n.position&&{marginLeft:8},!0===n.disablePointerEvents&&{pointerEvents:"none"})),C=a.forwardRef(function(e,n){let r=(0,y.Z)({props:e,name:"MuiInputAdornment"}),{children:s,className:d,component:m="div",disablePointerEvents:p=!1,disableTypography:x=!1,position:g,variant:f}=r,C=(0,i.Z)(r,b),w=(0,h.Z)()||{},P=f;f&&w.variant,w&&!P&&(P=w.variant);let k=(0,o.Z)({},r,{hiddenLabel:w.hiddenLabel,size:w.size,disablePointerEvents:p,position:g,variant:P}),E=j(k);return(0,Z.jsx)(u.Z.Provider,{value:null,children:(0,Z.jsx)(v,(0,o.Z)({as:m,ownerState:k,className:(0,l.Z)(E.root,d),ref:n},C,{children:"string"!=typeof s||x?(0,Z.jsxs)(a.Fragment,{children:["start"===g?t||(t=(0,Z.jsx)("span",{className:"notranslate",children:""})):null,s]}):(0,Z.jsx)(c.Z,{color:"text.secondary",children:s})}))})});var w=C},59334:function(e,n,r){"use strict";var t=r(63366),i=r(87462),o=r(67294),a=r(90512),l=r(94780),s=r(15861),d=r(59773),c=r(71657),u=r(90948),h=r(26336),m=r(85893);let p=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],x=e=>{let{classes:n,inset:r,primary:t,secondary:i,dense:o}=e;return(0,l.Z)({root:["root",r&&"inset",o&&"dense",t&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},h.L,n)},g=(0,u.ZP)("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,n)=>{let{ownerState:r}=e;return[{[`& .${h.Z.primary}`]:n.primary},{[`& .${h.Z.secondary}`]:n.secondary},n.root,r.inset&&n.inset,r.primary&&r.secondary&&n.multiline,r.dense&&n.dense]}})(({ownerState:e})=>(0,i.Z)({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},e.primary&&e.secondary&&{marginTop:6,marginBottom:6},e.inset&&{paddingLeft:56})),f=o.forwardRef(function(e,n){let r=(0,c.Z)({props:e,name:"MuiListItemText"}),{children:l,className:u,disableTypography:h=!1,inset:f=!1,primary:y,primaryTypographyProps:Z,secondary:b,secondaryTypographyProps:j}=r,v=(0,t.Z)(r,p),{dense:C}=o.useContext(d.Z),w=null!=y?y:l,P=b,k=(0,i.Z)({},r,{disableTypography:h,inset:f,primary:!!w,secondary:!!P,dense:C}),E=x(k);return null==w||w.type===s.Z||h||(w=(0,m.jsx)(s.Z,(0,i.Z)({variant:C?"body2":"body1",className:E.primary,component:null!=Z&&Z.variant?void 0:"span",display:"block"},Z,{children:w}))),null==P||P.type===s.Z||h||(P=(0,m.jsx)(s.Z,(0,i.Z)({variant:"body2",className:E.secondary,color:"text.secondary",display:"block"},j,{children:P}))),(0,m.jsxs)(g,(0,i.Z)({className:(0,a.Z)(E.root,u),ownerState:k,ref:n},v,{children:[w,P]}))});n.Z=f},75975:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/signup",function(){return r(57356)}])},51881:function(e,n,r){"use strict";r.d(n,{H:function(){return s}});var t=r(85893),i=r(99226),o=r(2734),a=r(86886);function l(e){let n=(0,o.Z)();return(0,t.jsx)(i.Z,{sx:{background:"linear-gradient(180deg, #EFF9FA 0%, rgba(239, 249, 250, 0) 69.16%)"},children:(0,t.jsx)(i.Z,{className:"container",children:(0,t.jsx)(i.Z,{sx:{background:"#DFF2F299",padding:"1rem",backdropFilter:"blur(60px)",borderRadius:"1rem"},children:(0,t.jsxs)(a.ZP,{container:!0,justifyContent:"center",alignItems:"center",spacing:4,children:[(0,t.jsx)(a.ZP,{item:!0,xs:12,md:6,order:{xs:2,md:1},display:{xs:"none",md:"block"},children:(0,t.jsx)(i.Z,{sx:{[n.breakpoints.up("md")]:{borderRight:"1px solid #a1c6b3"},padding:"4vw"},children:(0,t.jsx)("img",{alt:"student",src:"/static/svg/login - main.svg",style:{maxWidth:"400px",width:"100%",height:"auto"}})})}),(0,t.jsx)(a.ZP,{item:!0,xs:12,md:6,order:{xs:1,md:2},children:(0,t.jsx)(i.Z,{children:e.children})})]})})})})}function s(e){return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(i.Z,{paddingBottom:"4rem",id:"login-container",children:(0,t.jsx)(l,{children:e.children})})})}},57356:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return E}});var t=r(85893),i=r(99226),o=r(11163),a=r(67294),l=r(61343),s=r(54994),d=r(51881),c=r(58329),u=r(4730),h=r(93561),m=r(16637),p=r(38887),x=r(1954),g=r(31812),f=r(86886),y=r(15861),Z=r(98271),b=r(50480),j=r(69368),v=r(83321),C=r(43599);function w(e){let n=(0,o.useRouter)(),[r,l]=a.useState("");return a.useEffect(()=>{l("+".concat(e.form.countryCallingCode).concat(e.form.nationalNumber))},[]),(0,t.jsx)("form",{onSubmit:n=>{n.preventDefault(),e.handleForm()},children:(0,t.jsxs)(f.ZP,{container:!0,spacing:4,children:[(0,t.jsx)(f.ZP,{item:!0,xs:12,children:(0,t.jsx)(y.Z,{variant:"h4",sx:{fontFamily:"TTFirsNeue",fontWeight:"bold",marginBottom:"1rem"},children:"Create a new account"})}),(0,t.jsxs)(f.ZP,{item:!0,xs:12,md:6,children:[(0,t.jsx)(y.Z,{fontWeight:"bold",children:"First Name*"}),(0,t.jsx)(Z.Z,{sx:{"& .MuiOutlinedInput-root":{background:"white"}},autoFocus:!0,onChange:e.handleInputChange,style:{marginTop:"8px"},fullWidth:!0,label:"",id:"firstName",placeholder:"Enter first name",required:!0,value:e.form.firstName,disabled:e.loading})]}),(0,t.jsxs)(f.ZP,{item:!0,xs:12,md:6,children:[(0,t.jsx)(y.Z,{fontWeight:"bold",children:"Last Name*"}),(0,t.jsx)(Z.Z,{sx:{"& .MuiOutlinedInput-root":{background:"white"}},onChange:e.handleInputChange,style:{marginTop:"8px"},fullWidth:!0,label:"",id:"lastName",placeholder:"Enter last name",required:!0,value:e.form.lastName,disabled:e.loading})]}),(0,t.jsxs)(f.ZP,{item:!0,xs:12,md:6,children:[(0,t.jsx)(y.Z,{fontWeight:"bold",children:"Email*"}),(0,t.jsx)(Z.Z,{sx:{"& .MuiOutlinedInput-root":{background:"white"}},onChange:e.handleInputChange,style:{marginTop:"8px"},fullWidth:!0,label:"",type:"email",id:"email",placeholder:"Enter email address",required:!0,value:e.form.email,disabled:e.loading})]}),(0,t.jsxs)(f.ZP,{item:!0,xs:12,md:6,children:[(0,t.jsx)(y.Z,{fontWeight:"bold",children:"Password*"}),(0,t.jsx)(Z.Z,{sx:{"& .MuiOutlinedInput-root":{background:"white"}},onChange:e.handleInputChange,style:{marginTop:"8px"},fullWidth:!0,label:"",type:"password",id:"password",placeholder:"Enter password",required:!0,value:e.form.password,disabled:e.loading})]}),(0,t.jsxs)(f.ZP,{item:!0,xs:12,md:6,children:[(0,t.jsx)(y.Z,{fontWeight:"bold",children:"Phone*"}),(0,t.jsx)(C.Kr,{sx:{"& .MuiOutlinedInput-root":{background:"white"}},fullWidth:!0,required:!0,placeholder:"Enter phone number",defaultCountry:"US",value:r,onChange:(n,r)=>{var t,i,o;l(n),e.setForm(e=>({...e,countryCallingCode:null!==(t=r.countryCallingCode)&&void 0!==t?t:e.countryCallingCode,nationalNumber:null!==(i=r.nationalNumber)&&void 0!==i?i:"",countryCode:null!==(o=r.countryCode)&&void 0!==o?o:e.countryCode}))}})]}),(0,t.jsx)(f.ZP,{item:!0,xs:12,children:(0,t.jsx)(b.Z,{control:(0,t.jsx)(j.Z,{required:!0,disabled:e.loading}),label:(0,t.jsxs)("span",{style:{fontSize:"small"},children:["I agree with",(0,t.jsx)("a",{href:"/terms-and-conditions",target:"_blank",style:{color:"#14A9FF"},children:" Terms & Conditions "}),"of Coins For College"]})})}),(0,t.jsx)(f.ZP,{item:!0,xs:12,children:(0,t.jsx)(g.Z,{loading:e.loading,type:"submit",variant:"contained",disabled:e.loading,children:(0,t.jsxs)(i.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,t.jsx)(y.Z,{children:"Next"}),(0,t.jsx)(x.JO,{icon:"bi:arrow-up",rotate:45,fontSize:"large"})]})})}),(0,t.jsx)(f.ZP,{item:!0,xs:12,children:(0,t.jsxs)("div",{style:{marginTop:"24px"},children:[(0,t.jsx)("span",{style:{fontSize:"small"},children:"Already have an account?"}),(0,t.jsx)(v.Z,{onClick:()=>n.replace("/login"),style:{textTransform:"none"},children:"Login instead"})]})})]})})}function P(e){return(0,t.jsx)("form",{onSubmit:n=>{n.preventDefault(),e.handleForm(e.form.otpEmail,e.form.otpPhone)},children:(0,t.jsxs)(f.ZP,{container:!0,spacing:4,children:[(0,t.jsx)(f.ZP,{item:!0,xs:12,children:(0,t.jsx)(y.Z,{variant:"h4",sx:{fontFamily:"TTFirsNeue",fontWeight:"bold",marginBottom:"1rem"},children:"Create a new account"})}),(0,t.jsxs)(f.ZP,{item:!0,xs:12,children:[(0,t.jsx)(y.Z,{fontWeight:"bold",children:"Email Verification Code*"}),(0,t.jsx)(Z.Z,{sx:{"& .MuiOutlinedInput-root":{background:"white"}},autoFocus:!0,onChange:e.handleInputChange,style:{marginTop:"8px"},fullWidth:!0,label:"",id:"otpEmail",placeholder:"Enter the code sent to your email",required:!0,value:e.form.otpEmail,disabled:e.loading}),(0,t.jsxs)(y.Z,{paddingTop:"0.5rem",fontSize:"0.75rem",children:["Didn’t receive the code?",(0,t.jsx)(v.Z,{sx:{fontSize:"inherit"},onClick:()=>e.handleForm("",e.form.otpPhone),children:"Resend"})]})]}),(0,t.jsxs)(f.ZP,{item:!0,xs:12,children:[(0,t.jsx)(y.Z,{fontWeight:"bold",children:"Phone Verification Code*"}),(0,t.jsx)(Z.Z,{sx:{"& .MuiOutlinedInput-root":{background:"white"}},onChange:e.handleInputChange,style:{marginTop:"8px"},fullWidth:!0,label:"",id:"otpPhone",placeholder:"Enter the code sent to your phone",required:!0,value:e.form.otpPhone,disabled:e.loading}),(0,t.jsxs)(y.Z,{paddingTop:"0.5rem",fontSize:"0.75rem",children:["Didn’t receive the code?",(0,t.jsx)(v.Z,{sx:{fontSize:"inherit"},onClick:()=>e.handleForm(e.form.otpEmail,""),children:"Resend"})]})]}),(0,t.jsx)(f.ZP,{item:!0,xs:12,children:(0,t.jsxs)(f.ZP,{container:!0,justifyContent:"space-between",children:[(0,t.jsx)(f.ZP,{item:!0,children:(0,t.jsx)(g.Z,{loading:e.loading,type:"submit",variant:"contained",disabled:e.loading,children:(0,t.jsx)(y.Z,{children:"Verify & Sign In"})})}),(0,t.jsx)(f.ZP,{item:!0,children:(0,t.jsx)(v.Z,{onClick:e.onBack,children:"Back"})})]})})]})})}function k(){let e=(0,u.G)(),{setToken:n}=(0,h.L)(),r=(0,o.useRouter)(),[i,l]=a.useState(!1),{loading:s,user:d}=a.useContext(c.V);a.useEffect(()=>{s||(d?r.replace(d.type===m.pq.parent?"/user/me":"/learning/dashboard"):n(null))},[s]);let[x,g]=a.useState(0),[f,y]=a.useState({firstName:"",lastName:"",email:"",password:"",otpEmail:"",otpPhone:"",referrer:"",countryCallingCode:"1",countryCode:"US",nationalNumber:""});a.useEffect(()=>{var e,n,t,i;if(!r.isReady)return;let o=null!==(t=null===(e=r.query.referrer)||void 0===e?void 0:e.toString())&&void 0!==t?t:"",a=null!==(i=null===(n=r.query.email)||void 0===n?void 0:n.toString())&&void 0!==i?i:"";y(e=>({...e,referrer:o,email:a}))},[r.isReady]);let Z=e=>{let n=e.target,r="checkbox"===n.type?n.checked:"number"===n.type?Number(n.value):n.value,t=n.id;y(e=>({...e,[t]:r}))},b=async(r,t)=>{if(0===f.countryCallingCode.length){e.show("Please enter country code in phone number","error");return}if(0===f.countryCode.length){e.show("Please select country from dropdown of phone number","error");return}if(0===f.nationalNumber.length){e.show("Please enter your phone number","error");return}l(!0),await p.R.default.post("/api/account/create",{...f,otpEmail:r,otpPhone:t}).then(r=>{e.show(r.data.message,"success"),r.data.token?(n(r.data.token),window.location.href="/user/add/student"):(g(1),window.scroll(0,0))}).catch(n=>{var r,t,i;e.show(null!==(i=null===(t=n.response)||void 0===t?void 0:null===(r=t.data)||void 0===r?void 0:r.message)&&void 0!==i?i:"Unknown error, please try again","error")}),l(!1)};return 1===x?(0,t.jsx)(P,{handleForm:b,form:f,loading:i,handleInputChange:Z,onBack:()=>{g(0),window.scroll(0,0)}}):(0,t.jsx)(w,{setForm:y,handleForm:b,form:f,loading:i,handleInputChange:Z})}k.GetLayout=function(e){return(0,t.jsxs)(i.Z,{sx:{background:"linear-gradient(180deg, #EFF9FA 0%, rgba(239, 249, 250, 0) 69.16%)"},children:[(0,t.jsx)(s.g,{title:"Create an account",background:"#EFF9FA"}),(0,t.jsx)(d.H,{children:e}),(0,t.jsx)(l.i,{})]})};var E=k}},function(e){e.O(0,[674,959,9049,3947,5644,8871,9774,2888,179],function(){return e(e.s=75975)}),_N_E=e.O()}]);