1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6262],{76262:function(e,n,a){a.d(n,{kA:function(){return J},lt:function(){return K},_x:function(){return G},le:function(){return z}});var t=a(57135),r=a(77637),i=a(59072),l=a(15767),o=a(62086),s=a(95122),u=a(93236),c=a(55513),d=a(14908),m=a(30432),f=a(47170),p=a(72051),h=a.n(p),v=a(34547),x=a(43144),g=a(39528),b=a(25462),j=a(77025),k=a(9463),_=a(5565),w=a(62126),y=a(98250),Z=a(39801),N=a(3358);function S(e){var n=e.onClick,a=e.icon,t=e.emailOrText,r=e.method,i=null==r?null:"email"==r?"Login manual":"Login dengan Google";return(0,o.jsxs)("button",{type:"button",onClick:n,className:"py-3 flex justify-between items-center border-solid border-b-[1px] border-b-neutral-800 min-h-[60px]",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[!!a&&a(),(0,o.jsxs)("p",{className:"flex flex-col gap-[2px] font-body text-sm text-white items-start leading-4 font-semibold",children:[t," ",!!i&&(0,o.jsx)("span",{className:"font-normal text-neutral-400",children:i})]})]}),(0,o.jsx)(b.Tfp,{size:20,color:"white"})]})}var C=a(79862),B=a(149),A=a(9972),E=a(72031),L=a(16019),M=a(35570),V=a(88004),R=function(){var e,n=(0,v.useRouter)(),a=(0,f.Mx)({},{selectFromResult:function(n){var a=n.data;return{email:null!==(e=null===a||void 0===a?void 0:a.email)&&void 0!==e?e:""}}}).email,t=(0,L.X)({countdownValue:30,onEmailVerified:function(){n.push({pathname:"/onboarding/jenis-akun",query:n.query}),localStorage.removeItem("showEmailVerification")}}),r=t.countdown,i=t.canResend,l=t.handleResend,s=t.isLoadingResend,c=(0,f.Mx)({}).data;return(0,u.useEffect)((function(){c&&!c.is_email_verified&&l()}),[]),(0,o.jsxs)("section",{className:"flex flex-col text-center gap-6 max-w-[393px] px-4",children:[(0,o.jsx)("img",{src:"".concat(V.L4,"/assets/submit_latihan.svg"),alt:"Verifikasi email",height:120,width:120,className:"self-center"}),(0,o.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,o.jsx)("h3",{className:"text-2xl font-bold",children:"Verifikasi email"}),(0,o.jsxs)("p",{className:"text-sm text-graphite-400 leading-[22px]",children:["Demi keamanan akun, klik link verifikasi yang kami kirim ke"," ",(0,o.jsx)("span",{className:"font-semibold",children:a})]})]}),(0,o.jsxs)("div",{className:"flex flex-col",children:[i?(0,o.jsx)(d.Z,{onClick:l,variant:"tertiary",className:"mb-2 h-[46px]",disabled:s,children:s?(0,o.jsx)(M.Z,{size:"small"}):"Kirim Ulang"}):(0,o.jsxs)("p",{className:"mb-6 text-graphite-400 text-base",children:[(0,o.jsxs)("span",{className:"text-white font-semibold",children:[r," detik"]})," ","sebelum mengirim ulang"]}),(0,o.jsx)(d.Z,{variant:"primary",className:"h-[46px]",onClick:function(){return window.open("https://mail.google.com","_blank")},children:"Periksa Inbox"})]})]})},T=function(e){var n=e.className,a=(0,u.useContext)(C.Z),t=a.step,r=a.setStep;return(0,o.jsxs)("div",{className:(0,Z.cn)("flex gap-8 w-full items-center h-[44px]",n),children:[t>0?(0,o.jsx)(d.Z,{variant:"secondary",className:"rounded-full w-[44px] h-[44px] !p-0 shrink-0 flex items-center justify-center",onClick:function(){return r((function(e){return e-1}))},children:(0,o.jsx)(c.bUI,{size:20})}):null,(0,o.jsx)("div",{className:"flex w-full gap-2",children:G.map((function(e,n){return(0,o.jsx)("button",{onClick:function(){return function(e){e<=t&&r(e)}(n)},type:"button",className:"h-[4px] rounded-2xl w-full ".concat(t===n?"bg-[#B6A6F3]":"bg-violet-3")},n)}))})]})},O=a(72006),P=a(31330),q=a(73506),D=a(4405),F=a(96901),I=a(62920),U=function(e){var n=e.label,a=e.placeholder,t=e.onChange,r=e.onBlur,i=e.value,l=e.className,s=e.name,u=e.startAddorment,c=e.endAddorment,d=e.disabled,m=e.error,f=e.required;return(0,o.jsxs)("div",{className:"flex flex-col w-full gap-1 font-body",children:[n&&(0,o.jsx)("span",{className:"text-white text-sm",children:n}),(0,o.jsxs)("div",{className:"flex w-full items-center rounded-lg px-4 py-3 border bg-violet-2 ".concat(m?"border-red-500":"border-transparent"," ").concat(l),children:[(0,o.jsx)("div",{children:u}),(0,o.jsx)("textarea",{className:"p-0 form-input bg-transparent border-0 w-full focus:outline-none focus:ring-0 focus:appearance-none placeholder:text-neutral-400",placeholder:a,onChange:t,onWheel:function(e){return e.target.blur()},onBlur:r,value:i,name:s,disabled:d,required:f}),(0,o.jsx)("div",{children:c})]}),m&&(0,o.jsx)("span",{className:"mt-2 text-sm text-red-500",children:m})]})},J={"/masuk":function(){var e=(0,u.useState)(!1),n=e[0],a=e[1],p=(0,i.Z)((0,f.YA)(),2),b=p[0],C=p[1].isLoading,B=(0,v.useRouter)(),A=(0,g.C)(),E=A.setLastLogin,L=A.lastLogin,M=(0,u.useState)(!!L.email),V=M[0],R=M[1],T=(0,x.Q)(),O=(0,N.tm)(),P=V&&O(),q=(0,w.Z)().googleLogin,D=(0,_.Nq)({onSuccess:function(){var e=(0,t.Z)((function(e){var n;return(0,l.__generator)(this,(function(a){switch(a.label){case 0:return[4,q(e.access_token)];case 1:return"data"in(n=a.sent())&&E({email:n.data.user.email,method:"google"}),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),onError:function(){y.Am.error("Gagal login, coba beberapa saat lagi")}});return(0,o.jsx)(s.J9,{initialValues:{email:"",password:""},validate:function(e){var n={};return e.email?/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(e.email)||(n.email="Invalid email address"):n.email="Required",e.password||(n.password="Required"),n},onSubmit:function(){var e=(0,t.Z)((function(e,n){var a,t,i;return(0,l.__generator)(this,(function(l){switch(l.label){case 0:return a=n.setSubmitting,e.password,t=(0,r.Z)(e,["password"]),null===T||void 0===T||T.trackAttemptFormSubmit("Basic Login",t),[4,b(e)];case 1:return"data"in(i=l.sent())&&E({email:i.data.user.email,method:"email"}),a(!1),[2]}}))}));return function(n,a){return e.apply(this,arguments)}}(),children:function(e){var t=e.errors,r=e.setValues,i=e.values,l=e.touched,s=e.handleChange,u=e.handleBlur,f=e.handleSubmit,p=e.isSubmitting;return(0,o.jsxs)("form",{onSubmit:f,className:"container flex flex-col gap-[14px] h-full",children:[P?(0,o.jsxs)("section",{className:"flex flex-col",children:[(0,o.jsx)(S,{emailOrText:L.email,icon:function(){return(0,o.jsx)(j.sdR,{size:24,color:"#B9B9B9"})},method:L.method,onClick:function(){null===T||void 0===T||T.genericTrack("Click Last Used Account",{Method:L.method}),L.email&&"email"==L.method?(R(!1),r({email:L.email,password:""})):"google"==L.method&&D&&D()}}),(0,o.jsx)(S,{emailOrText:"Gunakan akun lain",icon:function(){return(0,o.jsx)(k.OzW,{size:24,color:"#666666"})},method:null,onClick:function(){R(!1)}})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,o.jsx)(m.Z,{type:"email",placeholder:"Email",n
1ame:"email",onChange:s,onBlur:u,value:i.email,error:l.email&&t.email?t.email:void 0}),(0,o.jsx)(m.Z,{type:n?"text":"password",placeholder:"Password",name:"password",onChange:s,onBlur:u,value:i.password,error:l.password&&t.password?t.password:void 0,endAddorment:n?(0,o.jsx)(c.tgn,{onClick:function(){return a(!1)},className:"text-gray-500 cursor-pointer"}):(0,o.jsx)(c.dSq,{onClick:function(){return a(!0)},className:"text-gray-500 cursor-pointer"}),className:"highlight-ignore"})]}),(0,o.jsx)(h(),{href:"/lupa-password",className:"self-end text-sm underline text-neutral-400",children:"Lupa kata sandi?"})]}),(0,o.jsxs)("div",{className:"flex flex-col gap-[14px] flex-grow justify-start",children:[!P&&(0,o.jsx)(d.Z,{variant:"custom",className:"w-full text-white bg-accent-purple",type:"submit",disabled:p,children:C?"Tunggu Sebentar...":"Masuk"}),(0,o.jsxs)("div",{className:"flex justify-center w-full gap-2",children:[(0,o.jsx)("span",{children:"Belum punya akun?"}),(0,o.jsx)(h(),{id:"signup-on-login-page",href:"/daftar".concat(B.query.redirect?"?redirect=".concat((0,Z.Nm)(B.query.redirect)):""),onClick:function(){null===T||void 0===T||T.trackButtonClick("Register Button on Login Page","Buat Akun")},children:(0,o.jsx)("span",{className:"font-extrabold text-[#7264EB] cursor-pointer hover:text-[#7264EB]/75 transition-all duration-500",children:"Buat Akun"})})]})]})]})}})},"/daftar":a(47009).V,"/onboarding":function(){var e=(0,B.v9)(A.__),n=(0,u.useContext)(C.Z).step,a=G[n],t=(0,i.Z)((0,N._)("showEmailVerification",!1),1)[0],r=(0,f.Mx)({}),l=r.data;return r.isLoading?(0,o.jsx)(E.Z,{}):e&&t&&(null===l||void 0===l?void 0:l.email)?(0,o.jsx)(R,{}):(0,o.jsxs)("div",{className:"px-4 w-full flex flex-col items-center max-w-[739px]",children:[(0,o.jsx)(T,{className:"mb-[56px] mt-[24px]"}),(0,o.jsx)("div",{id:"form",className:"w-full flex flex-col gap-8 flex-grow items-center",children:(0,o.jsx)(a,{})})]})}},G=[function(){var e=(0,u.useState)(!1),n=e[0],a=e[1],r=(0,u.useState)(!1),p=r[0],h=r[1],v=(0,B.v9)(A.ts),g=(0,i.Z)((0,f.mr)(),2),b=g[0],j=g[1].isLoading,k=(0,u.useContext)(C.Z),_=k.setStep,w=k.formData,y=k.setFormData,Z=(0,x.Q)();(0,u.useEffect)((function(){null===Z||void 0===Z||Z.genericTrack("Visit Onboarding Identity Step")}),[]);var N=(0,F.y1)(function(){var e=(0,t.Z)((function(e,n){var t,r;return(0,l.__generator)(this,(function(i){switch(i.label){case 0:return[4,b({username:e})];case 1:return t=i.sent(),r=t.data.is_available,h(r),a(!1),r||n("username","Username tidak tersedia"),[2]}}))}));return function(n,a){return e.apply(this,arguments)}}(),1e3),S=p?c.FJM:j||n?c.fCD:c.G5m;return(0,o.jsxs)("div",{className:"flex flex-col w-full max-w-[360px]",children:[(0,o.jsx)("h1",{className:"mb-10 text-2xl font-bold",children:"Lengkapi Profil"}),(0,o.jsx)(s.J9,{initialValues:{full_name:w.full_name||v.full_name||"",username:w.username||""},onSubmit:function(e){y((0,D.Z)((0,O.Z)({},w,e),{photo_profile:""})),_(1)},validate:function(){var e=(0,t.Z)((function(e){var n;return(0,l.__generator)(this,(function(a){return n={},e.full_name||(n.full_name="Nama lengkap dibutuhkan"),e.username||(n.username="Username dibutuhkan"),[2,n]}))}));return function(n){return e.apply(this,arguments)}}(),validateOnChange:!1,validateOnBlur:!1,children:function(e){var r=e.values,i=e.errors,s=e.touched,u=e.handleChange,c=e.handleBlur,f=e.handleSubmit,v=e.setFieldError,x=e.initialValues,g=e.isValid;return(0,o.jsxs)("form",{onSubmit:f,children:[(0,o.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,o.jsx)(m.Z,{label:"Nama Lengkap",type:"text",placeholder:"Nama",name:"full_name",onChange:u,onBlur:c,value:r.full_name,error:s.full_name&&i.full_name?i.full_name:void 0}),(0,o.jsx)(m.Z,{label:"Username",type:"text",placeholder:"Username",name:"username",endAddorment:""!==r.username&&x.username!==r.username?(0,o.jsx)(S,{className:" ".concat(j||n?"animate-spin text-[#999999]":p?"text-green-600":"text-red-600")}):void 0,onChange:function(){var e=(0,t.Z)((function(e){var n;return(0,l.__generator)(this,(function(t){switch(t.label){case 0:return u(e),""===e.target.value||e.target.value===x.username?[3,3]:(h(!1),a(!0),v("username",n=void 0),e.target.value.length<5?n="Username terdiri dari minimal 5 karakter alphanumeric":e.target.value.length>16?n="Username terdiri dari maksimal 16 karakter alphanumeric":e.target.value.includes(" ")&&(n="Username tidak boleh mengandung spasi"),n?(v("username",n),a(!1),[3,3]):[3,1]);case 1:return[4,N(e.target.value,v)];case 2:t.sent(),t.label=3;case 3:return[2]}}
1))}));return function(n){return e.apply(this,arguments)}}(),onBlur:c,value:r.username,error:i.username?i.username:void 0})]}),(0,o.jsx)("div",{children:(0,o.jsx)(d.Z,{disabled:!r.full_name||""===r.full_name||!r.username||""===r.username||n||!g,variant:"custom",className:"w-full mt-10 text-white bg-accent-purple h-[46px]",type:"submit",children:"Selanjutnya"})})]})}})]})},function(){var e=(0,u.useContext)(C.Z),n=e.setStep,a=e.formData,t=e.setFormData,r=(0,x.Q)();return(0,u.useEffect)((function(){null===r||void 0===r||r.genericTrack("Visit Onboarding Personal Data Step")}),[]),(0,o.jsxs)("div",{className:"flex flex-col w-full max-w-[360px]",children:[(0,o.jsx)("h1",{className:"mb-10 text-2xl font-bold",children:"Data Pribadi"}),(0,o.jsx)(s.J9,{initialValues:{gender:a.gender||"MALE",phone_number:a.phone_number?a.phone_number.replace("+62",""):"",birthdate:a.birthdate?a.birthdate.split("T")[0]:""},onSubmit:function(e){var r,i,l=(0,O.Z)({},a,e);"0"===(null===(r=e.phone_number)||void 0===r?void 0:r.substring(0,1))?l.phone_number=e.phone_number.replace("0",""):"62"===(null===(i=e.phone_number)||void 0===i?void 0:i.substring(0,2))&&(l.phone_number=e.phone_number.replace("62","")),t(l),n(2)},validate:function(e){var n={};return e.gender||(n.gender="Jenis kelamin tidak boleh kosong"),e.birthdate||(n.birthdate="Tanggal lahir tidak boleh kosong"),e.phone_number?e.phone_number.length<10&&(n.phone_number="Masukkan nomor handphone yang valid"):n.phone_number="Nomor handphone tidak boleh kosong",n},children:function(e){var n=e.values,a=e.errors,t=e.touched,r=e.handleChange,i=e.handleBlur,l=e.handleSubmit,s=e.isValid;return(0,o.jsxs)("form",{onSubmit:l,children:[(0,o.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,o.jsx)(m.Z,{type:"date",label:"Tanggal Lahir",name:"birthdate",onCh
1ange:r,onBlur:i,value:n.birthdate,error:t.birthdate&&a.birthdate?a.birthdate:void 0,required:!0}),(0,o.jsx)(I.Z,{onChange:r,onBlur:i,value:n.gender,name:"gender",label:"Jenis Kelamin",options:[{key:"MALE",value:"Laki-laki"},{key:"FEMALE",value:"Perempuan"}]}),(0,o.jsx)(m.Z,{type:"tel",label:"Nomor Handphone",placeholder:"8211234567",name:"phone_number",onChange:r,onBlur:i,startAddorment:(0,o.jsx)("span",{className:"text-white",children:"+62"}),value:n.phone_number,error:t.phone_number&&a.phone_number?a.phone_number:void 0,required:!0})]}),(0,o.jsx)("div",{children:(0,o.jsx)(d.Z,{disabled:!n.birthdate||!n.gender||!n.phone_number||""===n.phone_number||!s,variant:"custom",className:"w-full mt-10 text-white bg-accent-purple h-[46px]",type:"submit",children:"Selanjutnya"})})]})}})]})},function(){var e=(0,u.useContext)(C.Z),n=e.setStep,a=e.formData,t=e.setFormData,r=(0,x.Q)(),i=(0,q.B)("institute"),l=i.options,c=i.setOptions,m=i.loadOptions,f=(0,q.B)("major"),p=f.options,h=f.setOptions,v=f.loadOptions,g=function(e,n){return function(a){n(e,a)}};return(0,u.useEffect)((function(){return null===r||void 0===r||r.genericTrack("Visit Onboarding Education Step"),function(){c([]),h([])}}),[]),(0,o.jsxs)("div",{className:"flex flex-col w-full max-w-[360px]",children:[(0,o.jsx)("h1",{className:"mb-10 text-2xl font-bold",children:"Isi Detail Pendidikan"}),(0,o.jsx)(s.J9,{initialValues:{education_level:a.education_level||"",institution:a.institution||"",major:a.major||"",profession:a.profession||"student",profession_field:a.profession_field||""},onSubmit:function(e){t((0,O.Z)({},a,e)),n(3)},validate:function(e){var n={};return e.education_level||(n.education_level="Tingkat pendidikan tidak boleh kosong"),e.institution||(n.institution="Asal sekolah/universitas tidak boleh kosong"),"SMP"===e.education_level||e.major||(n.major="Jurusan tidak boleh kosong"),e.profession||(n.profession="Pekerjaan tidak boleh kosong"),"employed"!==e.profession||e.profession_field||(n.profession_field="Bidang pekerjaan tidak boleh kosong"),n},children:function(e){var n=e.values,a=e.errors,t=e.touched,r=e.handleSubmit,i=e.setFieldValue,s=e.isValid;return(0,o.jsxs)("form",{onSubmit:r,children:[(0,o.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,o.jsx)(P.Z,{onChange:g("education_level",i),label:"Tingkat Pendidikan Sekarang",name:"educationLevel",option:K,initialValue:n.education_level,placeholder:"Tuliskan pendidikan",error:t.education_level&&a.education_level?a.education_level:void 0}),(0,o.jsx)(P.Z,{onChange:g("institution",i),isAsync:!0,loadOption:m,isCreatable:!0,name:"institution",option:l,initialValue:n.institution,label:"SMP"===n.education_level||"SMA"===n.education_level||"SMK"===n.education_level?"Asal Sekolah":"Asal Kampus",placeholder:"SMP"===n.education_level||"SMA"===n.education_level||"SMK"===n.education_level?"Tuliskan asal sekolah":"Tuliskan asal kampus",error:t.institution&&a.institution?a.institution:void 0}),"SMP"!==n.education_level&&(0,o.jsx)(P.Z,{onChange:g("major",i),isAsync:!0,loadOption:v,isCreatable:!0,label:"Jurusan",name:"major",option:p,initialValue:n.major,placeholder:"Tuliskan jurusan",error:t.major&&a.major?a.major:void 0})]}),(0,o.jsx)("div",{children:(0,o.jsx)(d.Z,{disabled:!n.education_level||!n.institution||"SMP"!==n.education_level&&!n.major||!n.profession||"employed"===n.profession&&!n.profession_field||!s,variant:"custom",className:"w-full mt-10 text-white bg-accent-purple h-[46px]",type:"submit",children:"Selanjutnya"})})]})}})]})},function(){var e,n=(0,u.useContext)(C.Z),a=n.formData,r=n.updateUser,c=(0,f.GR)({}),m=c.data,p=c.isLoading,h=(0,i.Z)((0,N._)("showEmailVerification",!1),2),v=(h[0],h[1]),g=(0,x.Q)();return(0,u.useEffect)((function(){null===g||void 0===g||g.genericTrack("Visit Onboarding Reference Step")}),[]),(0,o.jsx)("div",{className:"flex flex-col w-full max-w-[458px]",children:!p&&m?(0,o.jsx)(s.J9,{initialValues:{register_reference_id:null===(e=null===m||void 0===m?void 0:m.data[0])||void 0===e?void 0:e.id,join_reasoning:a.join_reasoning||""},onSubmit:function(){var e=(0,t.Z)((function(e,n){var t;return(0,l.__generator)(this,(function(i){switch(i.label){case 0:return(t=n.setSubmitting)(!0),v(!0),[4,r((0,O.Z)({},a,e))];case 1:return i.sent(),t(!1),[2]}}))}));return function(n,a){return e.apply(this,arguments)}}(),validate:function(e){var n={};
1return e.join_reasoning&&""!==e.join_reasoning||(n.join_reasoning="Alasan bergabung tidak boleh kosong"),n},children:function(e){var n=e.values,a=e.errors,t=e.touched,r=e.handleChange,i=e.handleBlur,l=e.handleSubmit,s=e.isSubmitting,u=e.isValid;return(0,o.jsxs)("form",{onSubmit:l,children:[(0,o.jsxs)("div",{className:"flex flex-col gap-10",children:[(0,o.jsx)(I.Z,{onChange:r,onBlur:i,value:n.register_reference_id,name:"register_reference_id",label:"Dari mana kamu mengetahui Gradient?",options:m.data.map((function(e){return{key:e.id,value:e.name}}))}),(0,o.jsx)(U,{label:"Apa yang membuatmu tertarik bergabung bersama Gradient?",name:"join_reasoning",placeholder:"Cara Penyampaian yang menarik",onChange:r,onBlur:i,value:n.join_reasoning,error:t.join_reasoning&&a.join_reasoning?a.join_reasoning:void 0,required:!0})]}),(0,o.jsx)("div",{children:(0,o.jsx)(d.Z,{disabled:!n.register_reference_id||!n.join_reasoning||""===n.join_reasoning||!u||s,variant:"custom",className:"w-full mt-10 text-white bg-accent-purple",type:"submit",children:s?"Menyimpan...":"Simpan"})})]})}}):(0,o.jsx)("span",{className:"font-extrabold text-[#666666] animate-pulse",children:"Loading..."})})}],K=[{value:"SMP",label:"SMP"},{value:"SMA",label:"SMA"},{value:"SMK",label:"SMK"},{value:"S1",label:"Sarjana"},{value:"S2",label:"Magister"},{value:"S3",label:"Doktor"}],z=[{value:"student",label:"Pelajar/Mahasiswa"},{value:"employed",label:"Bekerja"},{value:"fresh_grad",label:"Fresh Graduate"},{value:"unemployed",label:"Tidak Bekerja"}]},47009:function(e,n,a){a.d(n,{V:function(){return b}});var t=a(57135),r=a(77637),i=a(59072),l=a(15767),o=a(62086),s=a(95122),u=a(93236),c=a(55513),d=a(14908),m=a(30432),f=a(47170),p=a(72051),h=a.n(p),v=a(34547),x=a(43144),g=a(13539),b=function(){var e,n=(0,u.useState)(!1),a=n[0],p=n[1],b=(0,i.Z)((0,f.l4)(),2),j=b[0],k=b[1].isLoading,_=(0,v.useRouter)(),w=(0,x.Q)();return(0,o.jsx)(s.J9,{initialValues:{email:"",password:""},validate:function(e){var n={};return e.email?/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(e.email)||(n.email="Invalid email address"):n.email="Required",e.password||(n.password="Required"),n},onSubmit:function(){var e=(0,t.Z)((function(e,n){var a,t,i;return(0,l.__generator)(this,(function(l){switch(l.label){case 0:return a=n.setSubmitting,e.password,t=(0,r.Z)(e,["password"]),null===w||void 0===w||w.trackAttemptFormSubmit("Basic Register",t),[4,j(e).unwrap()];case 1:return(i=l.sent()).is_new_user&&(0,g.sendGTMEvent)({event:"new_register",email:i.user.email}),a(!1),[2]}}))}));return function(n,a){return e.apply(this,arguments)}}(),children:function(n){var t=n.values,r=n.errors,i=n.touched,l=n.handleChange,s=n.handleBlur,u=n.handleSubmit,f=n.isSubmitting;return(0,o.jsxs)("form",{onSubmit:u,className:"container flex flex-col gap-[14px] h-full",children:[(0,o.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,o.jsx)(m.Z,{type:"email",placeholder:"Email",name:"email",onChange:l,onBlur:s,value:t.email,error:i.email&&r.email?r.email:void 0}),(0,o.jsx)(m.Z,{type:a?"text":"password",placeholder:"Password",name:"password",onChange:l,onBlur:s,value:t.password,error:i.password&&r.password?r.password:void 0,endAddorment:a?(0,o.jsx)(c.tgn,{onClick:function(){return p(!1)},className:"text-gray-500 cursor-pointer"}):(0,o.jsx)(c.dSq,{onClick:function(){return p(!0)},className:"text-gray-500 cursor-pointer"}),className:"highlight-ignore"})]}),(0,o.jsxs)("div",{className:"flex flex-col gap-[14px] flex-grow justify-start",children:[(0,o.jsx)(d.Z,{variant:"custom",className:"w-full text-white bg-accent-purple",type:"submit",disabled:f,children:k?"Tunggu Sebentar...":"Buat Akun"}),(0,o.jsxs)("p",{className:"text-xs text-center",children:["Dengan membuat akun, Anda menyetujui"," ",(0,o.jsx)(h(),{className:"font-bold text-[#7264EB] underline cursor-pointer hover:text-[#7264EB]/75 transition-all duration-500",href:"/syarat-dan-ketentuan",children:"Syarat & Ketentuan"})," ","dan"," ",(0,o.jsx)(h(),{className:"font-bold text-[#7264EB] underline cursor-pointer hover:text-[#7264EB]/75 transition-all duration-500",href:"/kebijakan-privasi",children:"Kebijakan Privasi"})," ","Gradient"]}),(0,o.jsxs)("div",{className:"flex justify-center w-full gap-2 mt-8",children:[(0,o.jsx)("span",{children:"Sudah punya akun?"}),(0,o.jsx)(h(),{href:"/masuk?redirect=".concat(null!==(e=_.query.redirect)&&void 0!==e?e:_.asPath),onClick:function(){null===w||void 0===w||w.trackButtonClick("Login Button on Register Page","Login")},children:(0,o.jsx)("span",{className:"font-extrabold text-[#7264EB] cursor-pointer hover:text-[#7264EB]/75 transition-all duration-500",children:"Login"})})]})]})]})}})}},79862:function(e,n,a){a.d(n,{X:function(){return m}});var t=a(57135),r=a(72006),i=a(59072),l=a(15767),o=a(62086),s=a(47170),u=a(93236),c=a(43144),d=(0,u.createContext)({}),m=function(e){var n=e.children,a=(0,i.Z)((0,s.kD)(),2),m=a[0],f=a[1],p=f.isLoading,h=f.isSuccess,v=(0,u.useState)({}),x=v[0],g=v[1],b=(0,u.useState)(0),j=b[0],k=b[1],_=(0,c.Q)(),w=(0,u.useMemo)((function(){return{updateUser:function(){var e=(0,t.Z)((function(e){return(0,l.__generator)(this,(function(n){switch(n.label){case 0:return null===_||void 0===_||_.trackAttemptFormSubmit("Submit Onboarding Data",(0,r.Z)({},e),{Step:j}),g(e),[4,m(e)];case 1:return n.sent(),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),isUserUpdateLoading:p,isUserUpdateSuccess:h,step:j,setStep:k,formData:x,setFormData:g}}),[x,g,j,k,m,p,h]);return(0,o.jsx)(d.Provider,{value:w,children:n})};n.Z=d},16019:function(e,n,a){a.d(n,{X:function(){return s}});var t=a(57135),r=a(59072),i=a(15767),l=a(47170),o=a(93236),s=function(e){var n=e.countdownValue,a=e.onEmailVerified,s=e.disable,u=void 0!==s&&s,c=(0,o.useState)(n),d=c[0],m=c[1],f=(0,o.useState)(!1),p=f[0],h=f[1],v=(0,r.Z)((0,l.Yq)(),2),x=v[0],g=v[1].isLoading,b=(0,l.Mx)({},{pollingInterval:5e3,skip:u}).data;(0,o.useEffect)((function(){(null===b||void 0===b?void 0:b.is_email_verified)&&a()}),[null===b||void 0===b?void 0:b.is_email_verified,a]),(0,o.useEffect)((function(){var e;return!u&&d>0&&(e=setInterval((function(){m((function(e){return e-1}))}),1e3)),0===d&&h(!0),function(){e&&clearInterval(e)}}),[u,d]);var j=function(){var e=(0,t.Z)((function(){var e;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,x().unwrap()];case 1:return n.sent(),m(30),h(!1),[3,3];case 2:return e=n.sent(),console.error("Failed to resend verification email:",e),[3,3];case 3:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}();return{countdown:d,canResend:p,handleResend:j,isLoadingResend:g}}},39528:function(e,n,a){a.d(n,{C:function(){return i}});var t=a(59072),r=a(3358),i=function(){var e=(0,t.Z)((0,r._)("lastLogin",{email:null,method:null}),2);return{lastLogin:e[0],setLastLogin:e[1]}}},73506:function(e,n,a){a.d(n,{B:function(){return o}});var t=a(59072),r=a(93236),i=a(96901),l=a(47170),o=function(e){var n=(0,r.useState)([]),a=n[0],o=n[1],s=(0,t.Z)((0,l.$1)(),1)[0],u=(0,i.y1)((function(n,a){s({fieldName:e,input:n},!0).then((function(e){var n,t,r=null!==(t=null===(n=e.data)||void 0===n?void 0:n.map((function(e){return{value:e.name,label:e.name}})))&&void 0!==t?t:[];o(r),null===a||void 0===a||a(r)}))}),750),c=(0,i.y1)((function(n,a,t,r){s({is_search_target:!0,fieldName:e,input:n,institution_id:a,major_id:t},!0).then((function(e){var n,a,t=null!==(a=null===(n=e.data)||void 0===n?void 0:n.map((function(e){return{value:"".concat(e.id,":").concat(e.name),label:e.name,passing_grade:null===e||void 0===e?void 0:e.passing_grade}})))&&void 0!==a?a:[];o(t),null===r||void 0===r||r(t)}))}),750);return{options:a,setOptions:o,loadOptions:function(e,n){u(e,n)},loadTargetOptions:function(e,n){return function(a,t){c(a,e,n,t)}}}}},62126:function(e,n,a){var t=a(57135),r=a(59072),i=a(15767),l=a(47170);n.Z=function(){var e=(0,r.Z)((0,l.u4)(),2),n=e[0],a=e[1],o=a.data,s=a.isLoading,u=a.isSuccess,c=a.isError,d=function(){var e=(0,t.Z)((function(e){return(0,i.__generator)(this,(function(a){switch(a.label){case 0:return[4,n({access_token:e,provider:"google"})];case 1:return[2,a.sent()]}}))}));return function(n){return e.apply(this,arguments)}}();return{googleLogin:d,data:o,isLoading:s,isError:c,isSuccess:u}}},30432:function(e,n,a){var t=a(62086);n.Z=function(e){var n=e.label,a=e.type,r=e.placeholder,i=e.onChange,l=e.onBlur,o=e.value,s=e.className,u=e.name,c=e.startAddorment,d=e.endAddorment,m=e.disabled,f=e.error,p=e.required,h=e.autoComplete,v=e.max;return(0,t.jsxs)("div",{className:"flex flex-col w-full gap-1 font-body",children:[n&&(0,t.jsx)("span",{className:"text-white text-sm",children:n}),(0,t.jsxs)("div",{className:"flex gap-2 w-full items-center rounded-lg px-4 h-[48px] bg-violet-2 border ".concat(f?"border-red-500":"border-transparent"," ").concat(s),children:[c?(0,t.jsx)("div",{children:c}):null,(0,t.jsx)("input",{type:a,className:"p-0 bg-transparent border-0 w-full focus:outline-none focus:ring-0 focus:appearance-none placeholder:text-graphite-600",placeholder:r,onChange:i,onWheel:function(e){return e.target.blur()},onBlur:l,value:o,name:u,disabled:m,required:p,autoComplete:h,max:v}),d?(0,t.jsx)("div",{children:d}):null]}),f&&(0,t.jsx)("span",{className:"mt-2 text-sm text-red-500",children:f})]})}},62920:function(e,n,a){var t=a(62086),r=a(39801),i=a(93236);n.Z=function(e){var n,a=e.label,l=e.onChange,o=e.onBlur,s=e.value,u=e.name,c=e.options,d=(0,i.useState)(null!==s&&void 0!==s?s:null===(n=c[0])||void 0===n?void 0:n.key),m=d[0],f=d[1];return(0,t.jsxs)("div",{className:"flex flex-col w-full gap-2 font-body",children:[a&&(0,t.jsx)("span",{className:"text-white text-sm",children:a}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:c.map((function(e){return(0,t.jsx)("div",{className:(0,r.cn)("cursor-pointer py-2 px-4 rounded-full text-base",m===e.key?"bg-accent-purple text-white font-semibold":"bg-[#333540]"),onClick:function(){return f((n=e).key),l({target:{value:n.key,name:u}}),void o({target:{value:n.key,name:u}});var n},"aria-hidden":!0,children:e.value},e.key)}))})]})}},31330:function(e,n,a){var t=a(72006),r=a(4405),i=a(62086),l=a(93236),o=a(1425),s=a(41673),u=a(6092),c=a(70792);n.Z=function(e){var n=e.option,a=e.label,d=e.onChange,m=e.name,f=e.error,p=e.placeholder,h=e.initialValue,v=e.isCreatable,x=e.isAsync,g=e.loadOption,b=e.defaultOptions,j=e.isSearchTarget,k=void 0!==j&&j,_=e.isClearable,w=void 0===_||_,y=e.noOptionsMessage,Z=void 0===y?"No options":y,N=e.styles,S=(0,l.useState)(null),C=S[0],B=S[1];(0,l.useEffect)((function(){if(h)if(x){var e=h;k&&(e=h.split(":")[1]),B({value:h,label:e})}else{var a=n.find((function(e){return e.value===h}));a&&B(a)}}),[h,n]);var A=v&&x?u.Z:v?s.Z:x?c.Z:o.ZP;return(0,i.jsxs)("div",{className:"flex flex-col w-full gap-1 font-body",children:[a&&(0,i.jsx)("span",{className:"text-white text-sm",children:a}),(0,i.jsx)(A,{isClearable:w,options:n,placeholder:p&&p,loadOptions:g,defaultOptions:b,name:m,value:C,onChange:function(e){d&&d(e?e.value:null),B(e)},noOptionsMessage:function(){return Z},styles:{control:function(e,n){var a;return(0,t.Z)((0,r.Z)((0,t.Z)({},e),{minHeight:"48px",background:"#20222E",borderRadius:"0.5rem",borderWidth:"1px",borderColor:f?"#ef4444":"transparent",boxShadow:"none",padding:"0px 7px","&:hover":{borderColor:f?"#ef4444":"transparent"}}),null===N||void 0===N||null===(a=N.control)||void 0===a?void 0:a.call(N,e,n))},menu:function(e,n){var a;return(0,t.Z)((0,r.Z)((0,t.Z)({},e),{background:"#333540",borderRadius:"0.4rem",marginTop:"0.5rem",zIndex:100}),null===N||void 0===N||null===(a=N.menu)||void 0===a?void 0:a.call(N,e,n))},option:function(e,n){var a;return(0,t.Z)((0,r.Z)((0,t.Z)({},e),{background:n.isFocused?"#4a4c5c":"#333540",color:"white"}),null===N||void 0===N||null===(a=N.option)||void 0===a?void 0:a.call(N,e,n))},singleValue:function(e,n){var a;return(0,t.Z)((0,r.Z)((0,t.Z)({},e),{color:"white"}),null===N||void 0===N||null===(a=N.singleValue)||void 0===a?void 0:a.call(N,e,n))},clearIndicator:function(e,n){var a;return(0,t.Z)((0,r.Z)((0,t.Z)({},e),{color:"white"}),null===N||void 0===N||null===(a=N.clearIndicator)||void 0===a?void 0:a.call(N,e,n))},dropdownIndicator:function(e,n){var a;return(0,t.Z)((0,r.Z)((0,t.Z)({},e),{color:"#666666"}),null===N||void 0===N||null===(a=N.dropdownIndicator)||void 0===a?void 0:a.call(N,e,n))},input:function(e,n){var a;return(0,t.Z)((0,r.Z)((0,t.Z)({},e),{color:"white","input:focus":{boxShadow:"none"}}),null===N||void 0===N||null===(a=N.input)||void 0===a?void 0:a.call(N,e,n))},placeholder:function(e,n){var a;return(0,t.Z)((0,r.Z)((0,t.Z)({},e),{whiteSpace:"nowrap"}),null===N||void 0===N||null===(a=N.placeholder)||void 0===a?void 0:a.call(N,e,n))}},components:{IndicatorSeparator:function(){return null}}}),f&&(0,i.jsx)("span",{className:"mt-2 text-sm text-red-500",children:f})]})}},96901:function(e,n,a){a.d(n,{Nr:function(){return o},y1:function(){return r}});var t=a(93236);function r(e,n,a){var r=this,i=(0,t.useRef)(null),l=(0,t.useRef)(0),o=(0,t.useRef)(null),s=(0,t.useRef)([]),u=(0,t.useRef)(),c=(0,t.useRef)(),d=(0,t.useRef)(e),m=(0,t.useRef)(!0);(0,t.useEffect)((function(){d.current=e}),[e]);var f=!n&&0!==n&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");n=+n||0;var p=!!(a=a||{}).leading,h=!("trailing"in a)||!!a.trailing,v="maxWait"in a,x=v?Math.max(+a.maxWait||0,n):null;(0,t.useEffect)((function(){return m.current=!0,function(){m.current=!1}}),[]);var g=(0,t.useMemo)((function(){var e=function(e){var n=s.current,a=u.current;return s.current=u.current=null,l.current=e,c.current=d.current.apply(a,n)},a=function(e,n){f&&cancelAnimationFrame(o.current),o.current=f?requestAnimationFrame(e):setTimeout(e,n)},t=function(e){if(!m.current)return!1;var a=e-i.current;return!i.current||a>=n||a<0||v&&e-l.current>=x},g=function(n){return o.current=null,h&&s.current?e(n):(s.current=u.current=null,c.current)},b=function e(){var r=Date.now();if(t(r))return g(r);
1if(m.current){var o=n-(r-i.current),s=v?Math.min(o,x-(r-l.current)):o;a(e,s)}},j=function(){var d=Date.now(),f=t(d);if(s.current=[].slice.call(arguments),u.current=r,i.current=d,f){if(!o.current&&m.current)return l.current=i.current,a(b,n),p?e(i.current):c.current;if(v)return a(b,n),e(i.current)}return o.current||a(b,n),c.current};return j.cancel=function(){o.current&&(f?cancelAnimationFrame(o.current):clearTimeout(o.current)),l.current=0,s.current=i.current=u.current=o.current=null},j.isPending=function(){return!!o.current},j.flush=function(){return o.current?g(Date.now()):c.current},j}),[p,v,n,x,h,f]);return g}function i(e,n){return e===n}function l(e){return"function"==typeof e?function(){return e}:e}function o(e,n,a){var o,s,u=a&&a.equalityFn||i,c=(o=(0,t.useState)(l(e)),s=o[1],[o[0],(0,t.useCallback)((function(e){return s(l(e))}),[])]),d=c[0],m=c[1],f=r((0,t.useCallback)((function(e){return m(e)}),[m]),n,a),p=(0,t.useRef)(e);return u(p.current,e)||(f(e),p.current=e),[d,f]}}}]);
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.