1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6287],{65242:function(e,r,n){"use strict";var t,o=n(71383),i=n(90948),a=n(83321),s=(0,i.ZP)(a.Z)(t||(t=(0,o.Z)(["\n line-height: 28px;\n font-size: 20px;\n padding: 9px 6em;\n max-width: 100%;\n border-radius: 25px;\n"])));r.Z=s},1915:function(e,r,n){"use strict";n.r(r),n.d(r,{extractUserInfo:function(){return F}});var t=n(59499),o=n(50029),i=n(17674),a=n(87794),s=n.n(a),c=n(67294),u=n(11163),l=n(86896),d=n(87536),p=n(9669),f=n.n(p),h=n(90948),m=n(50122),g=n(87109),b=n(15861),v=n(86886),w=n(96245),x=n(34853),A=n(34276),k=n(12316),j=n(70307),y=n(91439),Z=n(65242),P=n(90508),S=n(37357),O=n(16253),C=n(11875),E=n(77880),N=n(72390),_=n(42622),D=n(65071),I=n(85893);function T(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function B(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?T(Object(n),!0).forEach((function(r){(0,t.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var z={variant:"standard",inputProps:{inputMode:"numeric",pattern:"[0-9]"}},M=(0,h.ZP)(v.ZP)({marginTop:"20px","@media (max-width:840px)":{marginTop:"30px"}}),R=(0,h.ZP)("button")({width:104,height:37,cursor:"pointer",fontSize:18,borderRadius:6,backgroundColor:"#5c3a93",color:"#ffffff",border:"none",boxShadow:"0 1px rgb(132, 84, 209)",display:"flex",alignContent:"center",justifyContent:"center",alignItems:"center","&:checked":{boxShadow:"0 1px #666",transform:"translateY(1px)"}});function F(e){return(0,w.Z)(e)}function Q(e){return null===e||void 0===e?void 0:e.replace(/[\uff01-\uff5e]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}))}r.default=function(){var e=(0,d.cI)({mode:"onBlur"}),r=e.handleSubmit,n=e.formState,t=n.errors,a=n.touchedFields,p=e.control,h=e.getValues;(0,e.watch)();var w=(0,c.useState)(!1),T=w[0],F=w[1],q=(0,c.useState)(null),G=q[0],X=q[1],H=(0,c.useState)(1),U=H[0],K=H[1],L=(0,N.Z)({seconds:60,stopBy:0}),W=(0,i.Z)(L,3),Y=W[0],V=W[1],J=W[2],$=J.start,ee=J.reset,re=(0,c.useState)({geolocation:{latitude:"",longitude:""},deviceType:{type:"",details:""},ipAddress:""}),ne=re[0],te=re[1],oe=function(){var e=(0,o.Z)(s().mark((function e(){var r,n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f().get("https://api.ipify.org/?format=json");case 3:r=e.sent,n=r.data,te((function(e){return B(B({},e),{},{ipAddress:n.ip})})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error("Error getting IP data:",e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){!function(){var e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Windows Phone/i.test(navigator.userAgent);te((function(r){return B(B({},r),{},{deviceType:{type:e?"Mobile":"Desktop",details:navigator.userAgent}})}))}(),oe(),navigator.geolocation?navigator.geolocation.getCurrentPosition((function(e){te((function(r){return B(B({},r),{},{geolocation:{latitude:String(e.coords.latitude),longitude:String(e.coords.longitude)}})}))}),(function(e){console.error("Error getting GPS location:",e)})):console.error("Geolocation is not supported by this browser.")}),[]);var ie=(0,c.useContext)(_.Z),ae=ie.setToken,se=ie.setPhoneNo,ce=(0,u.useRouter)(),ue=(0,l.Z)().formatMessage,le=(0,c.useRef)(""),de=(0,D.Bo)(),pe=(0,i.Z)(de,1)[0],fe=h().agreementTC,he=(0,u.useRouter)().locale;(0,c.useEffect)((function(){sessionStorage.getItem("token")&&ce.push("/loanDetails");var e=window.location.href.match(/(source=)\w+_/g);le.current=e?e[0].replace("source=","").replace("_",""):""}),[]);var me=(0,c.useRef)(null),ge=function(){var e=(0,o.Z)(s().mark((function e(r){var n,t,o,i,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.preventDefault(),n=h(),t=n.phoneNumber,o=n.hkid,i=o.prefix,a=o.suffix,e.prev=2,!G){e.next=16;break}return e.prev=4,e.next=7,pe({variables:{hkid:Q("".concat(i,"(").concat(a.toUpperCase(),")")),phone:Q("+852".concat(t)),agreementTC:fe?"":"N",marketingSource:le.current,smsProvider:U%4===0||U%4===3?D.Iq.SmsTo:D.Iq.Smartone,clientLoginData:ne,captcha:null!==G&&void 0!==G?G:""}});case 7:K((function(e){return e+1})),ee(),$(),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(4),F(!0),ee();case 16:e.next=22;break;case 18:throw e.prev=18,e.t1=e.catch(2),F(!0),new Error("Request OTP Failed: "+e.t1);case 22:case"end":return e.stop()}}),e,null,[[2,18],[4,12]])})));return function(r){return e.apply(this,arguments)}}(),be=function(){var e=(0,o.Z)(s().mark((function e(r,n){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f().post("/api/enroll",{otp:r,phone:n});case 3:return t=e.sent,e.abrupt("return",t);case 7:e.prev=7,e.t0=e.catch(0),F(!0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(r,n){return e.apply(this,arguments)}}(),ve=function(){var e=(0,o.Z)(s().mark((function e(r){var n,t,o,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=h(),t=n.otp,o=n.phoneNumber,e.next=3,be(Q(t),Q("+852".concat(o)));case 3:i=e.sent,t||F(!0),200===(null===i||void 0===i?void 0:i.status)&&(ae((function(){return i.data.id_token})),se((function(){return o}
1)),sessionStorage.setItem("token",i.data.id_token),sessionStorage.setItem("Customer",i.data.id_token),ce.push("/loanDetails"));case 6:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();return(0,I.jsxs)("form",{"aria-label":"form",style:{width:"100%"},onSubmit:r(ve),children:[(0,I.jsxs)(A.Z,{showAuthToggle:!1,children:[(0,I.jsxs)(v.ZP,{container:!0,direction:"column",children:[(0,I.jsx)(d.Qr,{control:p,name:"phoneNumber",rules:{required:ue({id:"web.enroll.form.phoneNumber.rules.required"}),pattern:{value:/^[4-9\uFF14-\uFF19]{1}[0-9\uFF10-\uFF19]{7}$/,message:ue({id:"web.enroll.form.phoneNumber.rules.validate"})}},render:function(e){var r=e.field;return(0,I.jsx)(j.Z,B(B(B({},r),z),{},{error:!!t[r.name],placeholder:ue({id:"web.enroll.form.phoneNumber.placeholder"}),InputProps:{inputComponent:P.zn,startAdornment:(0,I.jsx)(g.Z,{position:"start",children:(0,I.jsx)(b.Z,{color:C.r.palette.primary.main,fontWeight:"500",variant:"subtitle2",children:ue({id:"web.enroll.form.phoneNumber.prefix"})})})}}))}}),(0,I.jsx)(d.Qr,{control:p,name:"hkid",rules:{validate:function(e){return(0,E.p5)(Q(null===e||void 0===e?void 0:e.prefix)+Q(null===e||void 0===e?void 0:e.suffix)+"")||ue({id:"web.enroll.form.hkid.rules.validate"})}},render:function(e){var r=e.field;return(0,I.jsx)(S.Z,B(B({},r),{},{error:!!t[r.name],placeholder:ue({id:"web.enroll.form.hkid.placeholder"}),disableHidden:!0}))}}),(0,I.jsx)(d.Qr,{control:p,name:"otp",rules:{required:ue({id:"web.enroll.form.otp.rules.required"}),pattern:{value:/[0-9\uff10-\uff19]{6}/,message:ue({id:"web.enroll.form.otp.rules.validate"})}},render:function(e){var r=e.field;return(0,I.jsx)(j.Z,B(B(B({},r),z),{},{error:!!t[r.name],placeholder:ue({id:"web.enroll.form.otp.placeholder"}),autoComplete:"one-time-code",InputProps:{inputComponent:P.s1,endAdornment:(0,I.jsx)(g.Z,{position:"end",children:(0,I.jsx)(R,{disabled:!!t.hkid||!!t.phoneNumber||V||!a.phoneNumber||!G||!fe,style:{opacity:t.hkid||t.phoneNumber||V||!a.phoneNumber||!G||!fe?.4:1},onClick:ge,children:V?"".concat(Y,"s"):ue({id:"web.enroll.form.otp.button"})})})}}))}}),(0,I.jsx)(b.Z,{marginTop:2,color:C.r.palette.error.main,variant:"h5","aria-label":"alert",whiteSpace:"pre-line",sx:{fontSize:"1rem"},children:Object.values(t).map((function(e,r){var n=e;return(0,I.jsx)("div",{children:"*".concat(n.message)},r)}))}),(0,I.jsx)("div",{children:(0,I.jsx)(x.Z,{ref:me,sitekey:"6LfCTuspAAAAALkKDxhP8paQhSgEiDw-1lM1GBtU",onChange:function(e){X(e)},hl:"en"===he?"en-GB":"zh-HK",onExpired:function(){X(null),ee()}})})]}),(0,I.jsxs)(M,{container:!0,direction:"column",alignItems:"center",children:[(0,I.jsx)(Z.Z,{variant:"contained",type:"submit",disabled:!(0!==Object.keys(h()).length&&Object.values(h()).every((function(e){return!!e}))),sx:{marginY:{xs:2},width:"100%"},children:ue({id:"web.common.confirm"})}),(0,I.jsxs)("div",{style:{display:"flex",alignItems:"start",gap:"0.8em"},children:[(0,I.jsx)(d.Qr,{control:p,name:"agreementTC",rules:{required:ue({id:"web.enroll.form.agreement.rules.required"})},render:function(e){var r=e.field;return(0,I.jsx)(y.Z,B({},r))}}),(0,I.jsx)(b.Z,{variant:"loginDeclaration",sx:{color:fe?"#111212":"#9e9f9f"},children:ue({id:"web.enroll.form.agreement.text"},{pdpps:(0,I.jsx)(m.Z,{href:"en"===he?"https://www.funki.com.hk/en/privacy-policy":"https://www.funki.com.hk/privacy-policy",target:"_blank",children:ue({id:"web.common.page.pdpps"})}),tc:(0,I.jsx)(m.Z,{href:"en"===he?"https://www.funki.com.hk/en/terms-of-service":"https://www.funki.com.hk/terms-of-service",target:"_blank",children:ue({id:"web.common.page.tc"})})})})]})]})]}),(0,I.jsx)(k.Z,{}),(0,I.jsx)(O.Z,{onClose:function(){return F(!1)},open:T,setOpen:function(){return F(!1)},type:"warning",title:ue({id:"web.enroll.form.login.fails"}),description:ue({id:"web.enroll.form.login.fails.desc"})})]})}},45328:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/loanDetails/[key]",function(){return n(1915)}])},70324:function(e,r){"use strict";r.Z={src:"/_next/static/media/icon.b299fe52.png",height:77,width:60,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAICAMAAADtGH4KAAAATlBMVEX///+4w8WZoKX0+vnr683w8fLg4+T7/Pz+++3z9/ckMkDB493/9tlrdH14jYDGyMt3wrS0trNQYGmHjpWKzcCi1MY1qJNPU1xptpRgs6ahxBOKAAAACXBIWXMAACHVAAAh1QEEnLSdAAAAN0lEQVR4nAXBiQGAIBAEseHdA1QUfPtv1ASzEgRLvFoLWHzvXXBs3wmaz3CgtdYOyXmfgZKy+AEzlAGlP45QbgAAAABJRU5ErkJggg==",blurWidth:6,blurHeight:8}}},function(e){e.O(0,[7948,6103,8764,6468,4473,9669,2892,3362,184,2273,6253,7383,6514,9774,2888,179],(function(){return r=45328,e(e.s=r);var r}));var r=e.O();_N_E=r}]);
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.