PageSourceSearch

https://app.grof.co/_next/static/chunks/pages/onboarding/setup-pin-ed8cbe7d95a544ca.js

js grof.co collected 2026-10-07 20:37:19 UTC 12,998 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9499],{55925:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/onboarding/setup-pin",function(){return n(46469)}])},20118:function(e,t,n){"use strict";var r=n(35666),s=n.n(r),i=n(85893),a=n(67294),o=n(96486),c=n(53854),l=n(81526),u=n(36706),d=n(64753),p=n(64788);function m(e,t,n,r,s,i,a){try{var o=e[i](a),c=o.value}catch(l){return void n(l)}o.done?t(c):Promise.resolve(c).then(r,s)}function f(e){return function(){var t=this,n=arguments;return new Promise((function(r,s){var i=e.apply(t,n);function a(e){m(i,r,s,a,o,"next",e)}function o(e){m(i,r,s,a,o,"throw",e)}a(void 0)}))}}t.Z=function(e){var t=(0,u.Z)(),n=t.requestOtp,r=t.verifyOtp,m=t.verifyOtpVulnerable,h=(0,a.useRef)(l.q.getState()).current.setGlobalSnackbar,x=(0,a.useState)(""),b=x[0],g=x[1],v=(0,a.useState)(0),j=v[0],N=v[1],y=(0,a.useState)(30),w=y[0],k=y[1],O=(0,a.useState)(!1),P=O[0],S=O[1],C=(0,a.useState)(e.sendByEmail||!1),R=C[0],T=C[1],L=f(s().mark((function t(n){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.vulnerable?m(n):r(n));case 1:case"end":return t.stop()}}),t)}))),Z=f(s().mark((function t(){var n;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={channel:R||e.sendByEmail?"email":"sms",code:b,dialCode:e.credentials.dialCode,phoneNumber:e.credentials.phoneNumber,emailAddress:e.credentials.emailAddress},t.next=3,L(n).then((function(t){"OK"===(0,o.result)(t,"status")?(e.handleSuccess(),h("OTP verified successfully","info")):S(!0)}));case 3:case"end":return t.stop()}}),t)}))),D=f(s().mark((function t(){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.sendByEmail?{channel:"email",emailAddress:e.credentials.emailAddress}:{channel:"sms",dialCode:e.credentials.dialCode,phoneNumber:e.credentials.phoneNumber},n(r).then((function(e){"OK"===(0,o.result)(e,"status")&&h("OTP Sent","info")})),N(0),k(30);case 4:case"end":return t.stop()}}),t)}))),I=f(s().mark((function t(){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r={channel:"email",emailAddress:e.credentials.emailAddress},n(r).then((function(e){"OK"===(0,o.result)(e,"status")&&h("OTP Sent","info")})),N(0),k(30);case 4:case"end":return t.stop()}}),t)})));return(0,a.useEffect)((function(){6===b.length&&Z()}),[b]),(0,a.useEffect)((function(){var e=setInterval((function(){w>0&&k(w-1),0===w&&(0===j?clearInterval(e):(N(j-1),k(59)))}),1e3);return function(){clearInterval(e)}})),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"row",children:[(0,i.jsx)("div",{className:"mt-1 font-lg",children:(0,i.jsx)(c.jTe,{className:"cursor",onClick:function(){e.handleBack()}})}),(0,i.jsx)("h2",{className:"mt-1 ml-1 mb-4 bold lg:sprout-text-lg",children:e.title})]}),(0,i.jsxs)("div",{className:"sprout-pt-[10px]",children:[(0,i.jsx)("p",{className:"sprout-text-[20px] sprout-pb-[8px] sprout-font-semibold",children:"Enter OTP Code"}),(0,i.jsxs)("p",{className:"sprout-text-[#595959] sprout-font-normal sprout-text-[16px]",children:["We have sent a 6 digit OTP code to"," ",e.sendByEmail?"".concat(e.credentials.emailAddress):"(".concat(e.credentials.dialCode,") ").concat(e.credentials.phoneNumber)]}),(0,i.jsx)("p",{className:"sprout-text-[#595959] sprout-font-normal sprout-text-[16px] sprout-pb-[0px] md:sprout-pb-[24px] lg:sprout-pb-[24px]",children:"Please enter the OTP below."})]}),(0,i.jsxs)("div",{className:"sprout-mb-3 md:sprout-border-2 md:sprout-border-gray md:sprout-rounded-2xl sprout-pt-[50px] sprout-pb-[50px]",children:[(0,i.jsx)(d.Z,{pin:b,onPinChanged:function(e){S(!1),g(e)},pinLength:6,revealPin:!0,isOtp:!0,error:P}),(0,i.jsxs)("div",{className:"mt-4 sprout-text-center sprout-p-5",children:[(0,i.jsx)("span",{children:"Didn't receive the code?\xa0"}),(0,i.jsx)(p.Z,{linkLabel:"Resend the code",isRedirectLink:!1,disabled:!(0===j&&0===w),clickToOpen:function(){T(!1),D()}}),e.sendByEmail?"":(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{children:"\xa0or\xa0"}),(0,i.jsx)(p.Z,{linkLabel:"resend to email",isRedirectLink:!1,disabled:!(0===j&&0===w),clickToOpen:function(){T(!0),I()}})]}),(0,i.jsxs)("span",{children:["\xa0(",j<10?"0".concat(j):j,":",w<10?"0".concat(w):w,")"]})]})]})]})}},64753:function(e,t,n){"use strict";var r=n(85893),s=n(67294),i=n(38279),a=n.n(i),o=n(53854),c=n(64788);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){l(e,t,n[t])}))}return e}
1t.Z=function(e){var t=(0,s.useState)(e.revealPin),n=t[0],i=t[1],l={inputStyle:{width:"42px",height:"60px",border:"none",borderBottom:"2px solid #FB8110",color:"#fb8110",fontSize:n?"2rem":"4rem",marginLeft:"0.5rem",marginRight:"0.5rem",textAlign:"center",WebkitTextSecurity:n?"none":"disc",MozTextSecurity:n?"none":"disc",textSecurity:n?"none":"disc"},inputStyleInvalid:{border:"none",borderBottom:"2px solid #960F21",color:"#960F21",fontSize:n?"2rem":"4rem",marginLeft:"0.5rem",marginRight:"0.5rem"}},d=(0,s.useRef)(void 0);return e.error&&(d.current.textInput[0]&&d.current.textInput[0].focus(),d.current.state.input[0]="",d.current.state.input[1]="",d.current.state.input[2]="",d.current.state.input[3]="",d.current.state.input[4]="",d.current.state.input[5]=""),(0,r.jsxs)("div",{className:"sprout-text-center",children:[!e.isOtp&&(0,r.jsx)("p",{className:"bold mb-4",children:"Enter your PIN below"}),(0,r.jsx)(a(),u({ref:d,type:"number",fields:6,name:"pin",inputMode:"numeric",onChange:function(t){return e.onPinChanged(t)},value:e.error?"":e.pin},l,{className:e.className})),e.needRevealButton?(0,r.jsx)("div",{className:"col-12-md text-center mt-2",children:(0,r.jsx)(c.Z,{linkLabel:n?"Hide PIN":"Reveal PIN",isRedirectLink:!1,clickToOpen:function(){return i(!n)},class:"row justify-center mt-3",prefixLogo:(0,r.jsx)(o.Rbo,{})})}):null]})}},64788:function(e,t,n){"use strict";var r=n(85893),s=(n(67294),n(41664));t.Z=function(e){return e.isRedirectLink?(0,r.jsx)(s.default,{href:e.url,passHref:!0,children:(0,r.jsx)("a",{target:e.openInNewTab?"_blank":"_self",className:e.disabled?"inline-link-disabled ".concat(e.class):"inline-link ".concat(e.class),rel:"noreferrer",children:e.linkLabel})}):(0,r.jsxs)("a",{className:e.disabled?"inline-link-disabled ".concat(e.class):"inline-link ".concat(e.class),onClick:e.clickToOpen,children:[e.prefixLogo?(0,r.jsx)("div",{className:"mr-1 text-lg",children:e.prefixLogo}):"",e.linkLabel]})}},19600:function(e,t,n){"use strict";var r=n(85893),s=(n(67294),n(74650)),i=n(15545);t.Z=function(e){var t=e.children,n=e.pageTitle,a=e.pageDesription,o=e.pageDesription2,c=e.needHeader,l=e.pageStyle;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z,{}),(0,r.jsxs)("div",{className:"white sprout-text-sm sprout-flex sprout-flex-col lg:sprout-flex-row sprout-min-h-screen",children:[c?(0,r.jsx)(i.Z,{}):null,(0,r.jsxs)("div",{className:"sprout-bg-secondary sprout-text-white sprout-text-sm lg:sprout-pt-9 lg:sprout-pl-5 lg:sprout-text-base lg:sprout-max-w-[280px]",style:l,children:[(0,r.jsx)("div",{className:"mb-3 sprout-w-[70px] sprout-h-[28px] lg:sprout-w-[149px] lg:sprout-h-[60px]",children:(0,r.jsx)("img",{src:"/assets/svgs/grof-logo.svg",width:"auto",height:"auto",alt:"vector",className:"pt-3 pl-3"})}),(0,r.jsx)("p",{className:"bold pl-3 pt-2 sprout-text-base lg:sprout-text-2xl lg:sprout-p-5",children:n}),(0,r.jsx)("p",{className:"mt-1 mr-3 pl-3 lg:sprout-p-5",children:a}),(0,r.jsx)("p",{className:"mt-1 mr-3 pl-3 pb-4 lg:sprout-p-5",children:o})]}),(0,r.jsx)("div",{className:"sprout-text-sm sprout-w-full sprout-grid-cols-6 md:sprout-grid lg:sprout-py-10 lg:sprout-text-base",children:(0,r.jsx)("div",{className:"sprout-p-3 md:sprout-col-start-2 md:sprout-col-span-4 sprout-h-full",children:t})})]})]})}},46469:function(e,t,n){"use strict";n.r(t);var r=n(35666),s=n.n(r),i=n(85893),a=n(67294),o=n(19982),c=n(2418),l=n(96486),u=n(11163),d=n(53854),p=n(20118),m=n(64753),f=n(81526),h=n(19600),x=n(36706),b=n(81060);function g(e,t,n,r,s,i,a){try{var o=e[i](a),c=o.value}catch(l){return void n(l)}o.done?t(c):Promise.resolve(c).then(r,s)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){v(e,t,n[t])}))}return e}t.default=function(){var e,t=(0,x.Z)(),n=t.requestOtp,r=t.signUp,v=t.registerDevice,N=(0,u.useRouter)(),y=(0,b.Z)(),w=y.registrationData,k=y.addRegistrationData,O=(0,a.useRef)(f.q.getState()).current.setGlobalSnackbar,P=(0,a.useState)(""),S=P[0],C=P[1],R=(0,a.useState)(""),T=R[0],L=R[1],Z=(0,a.useState)(!1),D=Z[
10],I=Z[1],E=(0,a.useState)(!1),B=E[0],_=E[1],q=(0,a.useState)(!1),A=q[0],F=q[1],K=function(){return D||6===S.length?!D||S===T||(O("PIN doesn't match!","error"),!1):(O("Please fill pin with 6 digits","error"),!1)},H=(e=s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(_(!0),D||!K()){e.next=5;break}I(!0),e.next=10;break;case 5:if(!D||!K()){e.next=10;break}return k(j({},w,{pin:c.hashSync(S,12)})),t={channel:"sms",dialCode:w.dialCode,phoneNumber:w.phoneNumber},e.next=10,n(t).then((function(e){"sent"===(0,l.result)(e,"data.status")&&F(!0)}));case 10:_(!1);case 11:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,s){var i=e.apply(t,n);function a(e){g(i,r,s,a,o,"next",e)}function o(e){g(i,r,s,a,o,"throw",e)}a(void 0)}))});return A?(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(h.Z,{needHeader:!1,pageTitle:"Welcome Onboard!",pageDesription:"Before we start your business with Grof, we need to create your account.",children:(0,i.jsx)(p.Z,{title:"Confirm Phone Number",handleBack:function(){F(!1)},handleSuccess:function(){!function(){var e=j({},w,{isFromRfi:!!N.query.rfiLink});r(e).then((function(e){var t,n;"OK"===(0,l.result)(e,"status")&&(v(),N.query.rfiLink?window.location.href=N.query.rfiLink:(null===(t=N.query)||void 0===t?void 0:t.id)&&(null===(n=N.query)||void 0===n?void 0:n.token)?N.push({pathname:"/kyc",query:N.query}):N.push("/kyb"))}))}()},credentials:{dialCode:w.dialCode,phoneNumber:w.phoneNumber,emailAddress:w.emailAddress},vulnerable:!0})})}):(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(h.Z,{needHeader:!1,pageTitle:"Welcome Onboard!",pageDesription:"Before we start your business with Grof, we need to create your account.",children:[D?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"row",children:[(0,i.jsx)("span",{className:"font-lg",children:(0,i.jsx)(d.jTe,{className:"cursor",onClick:function(){return I(!1)}})}),(0,i.jsx)("span",{className:"ml-2 mb-4 bold",children:"PIN Confirmation"})]}),(0,i.jsx)("p",{className:"mb-4 sprout-w-full",children:"Please re-enter your desired PIN."})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"row",children:[(0,i.jsx)("span",{className:"font-lg",children:(0,i.jsx)(d.jTe,{className:"cursor",onClick:function(){N.push({pathname:"/onboarding/account-creation",query:N.query})}})}),(0,i.jsx)("span",{className:"ml-2 mb-4 bold",children:"Set Up your Desired PIN"})]}),(0,i.jsx)("p",{className:"mb-4 sprout-w-full",children:"Please enter your desired PIN to secure your account."})]}),(0,i.jsxs)("div",{className:"md:sprout-p-5 sprout-mb-3 md:sprout-border-2 md:sprout-border-gray md:sprout-rounded-2xl",children:[D&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(m.Z,{onPinChanged:function(e){L(e)},pin:T,pinLength:6,needRevealButton:!0,error:!1})}),!D&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(m.Z,{onPinChanged:function(e){C(e)},pin:S,pinLength:6,needRevealButton:!0,error:!1})})]}),(0,i.jsx)(o.iR,{className:"primary mt-4 w-100",onClick:H,disabled:B||(D?6!==T.length:6!==S.length),children:"Confirm"})]})})}},81060:function(e,t,n){"use strict";var r=(0,n(14671).Z)((function(e){return{registrationData:{firstName:"",lastName:"",dialCode:"+65",phoneNumber:"",emailAddress:"",pin:"",userKycId:""},setRegistrationData:function(t){return e({registrationData:t})}}}));t.Z=function(){var e=r((function(e){return e.registrationData})),t=r((function(e){return e.setRegistrationData}));return{registrationData:e,addRegistrationData:function(e){t({firstName:e.firstName,lastName:e.lastName,dialCode:e.dialCode,phoneNumber:e.phoneNumber.toString(),emailAddress:e.emailAddress,pin:e.pin,userKycId:e.userKycId})}}}}},function(e){e.O(0,[4885,8166,6556,9250,6962,4201,7933,8029,3735,1302,5545,9774,2888,179],(function(){return t=55925,e(e.s=t);var t}));var t=e.O();_N_E=t}]);

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.