1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[363],{8732:(e,t,n)=>{"use strict";n.d(t,{O:()=>f}),n(14232);var r=n(89890),s=n(34846),c=n(48230),a=n.n(c),i=n(89099),o=n(65470),l=n(16839),u=n(21882),d=n(46863),m=n(46989),b=n(20520),x=n(37876),p=[{name:"profile",link:"profile",kycRequire:!1,elkremRequire:!1},{name:"security",link:"security",kycRequire:!1,elkremRequire:!1},{name:"pdpa_form",link:"pdpa",kycRequire:!1,elkremRequire:!1},{name:"link_merkle_account",link:"transfer-merkle-account",kycRequire:!1,elkremRequire:!0}];function v(e){return"/invest/user-portal/account/".concat(e)}function f(e){var t,n,c=e.children,f=e.sidebar,h=(0,r.Ay)("/kyc",l.GO).data,g=(0,i.useRouter)(),k=(0,b.A)().user,y=(0,s.Bd)(["tab","my-account"]).t,j=(0,o.x)("useMerkleToElkremParse2");return(0,x.jsxs)(d.Y,{sidebar:void 0!==f&&f,children:[(0,x.jsxs)("div",{className:"grid grid-cols-1 space-y-5",children:[(0,x.jsx)("div",{children:(0,x.jsxs)("button",{type:"button",onClick:function(){return g.replace("/invest/user-portal/overall")},className:"cursor-pointer focus:outline-none",children:[(0,x.jsx)(u.A.ArrowLeft,{className:"inline mr-3"})," ",y("overview",{ns:"tab"})]})}),(0,x.jsx)("div",{className:"text-3xl text-left font-semibold",children:y("settings",{ns:"my-account"})}),k&&(null==(t=k.allowInvest)?void 0:t.status)===m.HX.REJECTED&&(0,x.jsx)("div",{className:"border border-failure p-4 bg-failure bg-opacity-30 text-black-override mb-3 my-4","data-cy":"allow-invest-reject-reason",children:null==(n=k.allowInvest)?void 0:n.rejectReason})]}),(0,x.jsxs)("div",{className:"grid grid-cols-1 space-y-5",children:[(0,x.jsx)("div",{className:"space-x-10 mt-7",children:p.map(function(e){var t=e.name,n=e.link,r=e.kycRequire,s=e.elkremRequire;return(r&&h||!r)&&(s&&j||!s)?(0,x.jsx)(a(),{href:v(n),className:"inline-block focus:outline-none ".concat(g.pathname.match(RegExp("".concat(v(n)),"g"))?"border-success border-b":""),children:y(t,{ns:"tab"})},t):""})}),(0,x.jsx)("div",{className:"bg-gray-100-override rounded-md mt-5 text-gray-200 text-sm w-auto",children:c})]})]})}},34578:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SecurityPage:()=>k,default:()=>y});var r=n(34846),s=n(14232),c=n(89890),a=n(48230),i=n.n(a),o=n(89099),l=n(16839),u=n(34729),d=n(40341),m=n(20520),b=n(80846),x=n(88488),p=n(37876);function v(e){var t=e.enabled,n=(0,r.Bd)("button").t,s=(0,r.Bd)("my-account").t;return t?(0,p.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full px-3 py-1 text-xs font-semibold bg-emerald-500/20 text-emerald-500 whitespace-nowrap",children:["â ",n("enable")]}):(0,p.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full px-3 py-1 text-xs font-semibold bg-gray-300/20 text-gray-200 whitespace-nowrap",children:["â ",s("security_not_enabled")]})}function f(e){var t=e.enabled,n=e.href,s=(0,r.Bd)("button").t;return t?(0,p.jsx)(i(),{href:n,className:"rounded-lg px-4 py-2 text-sm font-semibold bg-green-300 text-white hover:opacity-90 whitespace-nowrap",children:s("security_manage")}):(0,p.jsx)(i(),{href:n,className:"rounded-lg px-4 py-2 text-sm font-semibold border border-green text-green-300 hover:bg-green-300/10 whitespace-nowrap",children:s("security_setup")})}function h(){var e=(0,r.Bd)("button").t;return(0,p.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full px-3 py-1 text-xs font-semibold bg-emerald-500/20 text-emerald-500 whitespace-nowrap",children:["â ",e("enable")]})}function g(e){var t=e.title,n=e.description,r=e.right;return(0,p.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-xl bg-white border border-gray-30 px-6 py-5 shadow-s hover:shadow-xs hover:border-gray-100 transition-all duration-150",children:[(0,p.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,p.jsx)("div",{className:"font-semibold text-black-override",children:t}),(0,p.jsx)("div",{className:"text-sm text-gray-200",children:n})]}),(0,p.jsx)("div",{className:"flex flex-shrink-0 items-center gap-3",children:r})]})}function k(){var e,t=(0,r.Bd)("my-account").t,n=(0,m.A)().user,a=(0,o.useRouter)().pathname,i=(0,c.Ay)(n?"/security/".concat(n.uuid,"/2fa-generate"):null,l.GO).data,d=(0,c.Ay)(n?"/security/".concat(n.uuid,"/otpPhoneNumber"):null,l.GO).data,k=(0,c.Ay)(n?"/security/".concat(n.uuid,"/pincode"):null,l.GO).data,y=(0,s.use
1State)(!0),j=y[0],_=y[1],N=(0,s.useState)(null),w=N[0],A=N[1];(0,s.useEffect)(function(){A((0,x.Jt)()),_(!1)},[]);var T=!!(null==d?void 0:d.number),O=!!k,E=(null==i?void 0:i.active)===!0;return(0,p.jsx)(b._,{children:(0,p.jsxs)("div",{className:"flex flex-col gap-3 px-10 py-4",children:[!j&&!w&&(0,p.jsx)(g,{title:t("security_change_password"),description:"".concat(t("security_last_updated")," ").concat(n?(0,u.A)(n.updatePasswordAt).format("YYYY-MM-DD HH:mm:ss"):""),right:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(v,{enabled:!0}),(0,p.jsx)(f,{enabled:!0,href:"".concat(a,"/password")})]})}),(0,p.jsx)(g,{title:t("security_email_verification"),description:"".concat(t("security_email_verified_with")," ").concat(null!=(e=null==n?void 0:n.email)?e:""),right:(0,p.jsx)(h,{})}),!j&&!w&&(0,p.jsx)(g,{title:"SMS AUTHENTICATION",description:t("security_sms_desc"),right:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(v,{enabled:T}),(0,p.jsx)(f,{enabled:T,href:"".concat(a,"/sms")})]})}),!j&&!w&&(0,p.jsx)(g,{title:"PINCODE",description:t("security_pincode_desc"),right:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(v,{enabled:O}),(0,p.jsx)(f,{enabled:O,href:"".concat(a,"/pincode")})]})}),!j&&!w&&(0,p.jsx)(g,{title:"2-FACTOR AUTHENTICATION",description:t("security_2fa_desc"),right:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(v,{enabled:E}),(0,p.jsx)(f,{enabled:E,href:"".concat(a,"/2fa")})]})})]})})}let y=(0,d.ru)(k)},40341:(e,t,n)=>{"use strict";n.d(t,{ru:()=>N});var r=n(63857),s=n(42969),c=n(43081),a=n.n(c);n(14232);var i=n(89099),o=n.n(i),l=n(60072),u=n.n(l),d=n(26757),m=n(33191),b=n.n(m),x=n(88488),p=n(99536),v=n(66763),f=n(94706),h=n(54902),g=n(37876);function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach(function(t){(0,s.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function j(e,t){o().push(e)}var _=function(e,t){var n=u()(e)[x.T],r=t.reverse,s=n?(0,d.A)(n):null;return{token:n,user:s,reverse:void 0!==r&&r}},N=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=function(t){return(0,g.jsx)(e,y({},t))};return t=(0,r.A)(a().mark(function t(r){var s,c,i,o,l,u,m,g,k,N,w,A,T,O;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(c=_(r,n).token,i=null,o=_(r,n).reverse,f.v.debug("withAuth headers",null==(s=r.req)?void 0:s.headers),l=function(e){var t,n,r,s,c,a;return h._.TRUE_MONEY_DEV_ACCESS_TOKEN?(f.v.debug("get tmnToken from ENV TRUE_MONEY_DEV_ACCESS_TOKEN: ".concat(h._.TRUE_MONEY_DEV_ACCESS_TOKEN)),h._.TRUE_MONEY_DEV_ACCESS_TOKEN):null!=e&&null!=(t=e.query)&&t.tmnAccessToken?(f.v.debug("get tmnToken from query params ".concat(null==e||null==(c=e.query)?void 0:c.tmnAccessToken)),null==e||null==(a=e.query)?void 0:a.tmnAccessToken):b().get(x.cr)?(f.v.debug("get tmnToken from cookie: ".concat(b().get(x.cr))),b().get(x.cr)):(f.v.debug("get tmnToken from header: ".concat(null==(n=e.req)?void 0:n.headers["tmn-access-token"])),null!=(r=null==(s=e.req)?void 0:s.headers["tmn-access-token"])?r:null)}(r),u=null,l&&(r.tmnAccessToken=l),(m=function(e){var t,n,r,s,c;return null!=e&&null!=(t=e.query)&&t.scbsAccessToken?(f.v.debug("get scbsToken from query params ".concat(null==e||null==(s=e.query)?void 0:s.scbsAccessToken)),null==e||null==(c=e.query)?void 0:c.scbsAccessToken):b().get(x.T)?b().get(x.T):null!=(n=null==(r=e.req)?void 0:r.headers["scbs-access-token"])?n:null}(r))&&(r.scbsAccessToken=m),!c){t.next=14;break}r.token=c,i=(0,d.A)(c),t.next=33;break;case 14:if(!(!c&&r.tmnAccessToken)){t.next=32;break}return t.next=17,(0,p.F)(l?{accessToken:l}:{});case 17:if(g=t.sent,f.v.debug("withAuth tmnUser: ".concat(JSON.stringify(g))),k=g.public_profile,N=g.email,w=g.tmn_id,!k){t.next=30;break}return t.next=23,(0,v.ds)(N,w);case 23:r.token=c=(A=t.sent).token,r.tmnUserId=u=w,i=c?(0,d.A)(c):null,r.res&&A.setCookie?(f.v.debug("Forwarding Set-Cookie to client: ".concat(A.setCookie)),r.res.setHeader("Set-Cookie",A.setCookie)):f.v.warn("No Set-Cookie header received from API response");case 30:t.next=33;break;case 32:!c&&r.scbsAccessToken&&(r.token=c=m,i=c?(0,d.A)(c):null);case 33:if(f.v.debug("withAuth merkle token: ".concat(c)),f.v.debug("withAuth tmnAccessToken: ".concat(l)),f.v.debug("withAuth user: ".concat(i?i.uuid:"null")),f.v.debug("reverse: ".concat(o)),!(!c&&!o)){t.next=43;break}j("/"!==(T=r.asPath||"/")?"/invest/login?redirect=".concat(encodeURIComponent(T)):"/invest/login",r),t.next=50;break;case 43:if(!(i&&!i.isVerified&&!i.trueMoneyId&&!i.scbsId)){t.next=49;break}return t.next=46,(0,v.ri)("/invest/login");case 46:j("/",r),t.next=50;break;case 49:c&&o&&j("/invest/user-portal",r);case 50:if(t.t0=e.getInitialProps,!t.t0){t.next=55;break}return t.next=54,e.getInitialProps(r);case 54:t.t0=t.sent;case 55:return O=t.t0,t.abrupt("return",y(y({},O),{},{token:c,user:i,tmnAccessToken:l,tmnUserId:u}));case 57:case"end":return t.stop()}},t)})),s.getInitialProps=function(e){return t.apply(this,arguments)},s}},80846:(e,t,n)=>{"use strict";n.d(t,{_:()=>a}),n(14232);var r=n(34846),s=n(8732),c=n(37876),a=function(e){var t=e.children,n=e.subHeader,a=void 0===n?"":n,i=(0,r.Bd)(["tab"]).t;return(0,c.jsx)(s.O,{children:(0,c.jsxs)("div",{className:"grid grid-cols-1 py-10 ",children:[(0,c.jsxs)("div",{className:"px-10",children:[(0,c.jsx)("div",{className:"text-black-override text-3xl font-bold",children:i("security",{ns:"tab"})}),a&&(0,c.jsx)("div",{className:"text-lg",children:a})]}),(0,c.jsx)("div",{className:"border-b border-gray-30 my-6"}),t]})})}},98513:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/invest/user-portal/account/security",function(){return n(34578)}])}},e=>{e.O(0,[6497,8230,5352,1882,6863,636,6593,8792],()=>e(e.s=98513)),_N_E=e.O()}]);
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.