PageSourceSearch

https://www.alrajhitakaful.com/libs_general-pages_src_lib_features…vidual-login-otp-9b82db.0d591254c5a2c58c.js

js alrajhitakaful.com collected 2026-09-24 17:40:58 UTC 7,443 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkDCP_Web=self.webpackChunkDCP_Web||[]).push([["libs_general-pages_src_lib_features_auth_components_individual-login-otp_individual-login-otp-9b82db","libs_general-pages_src_lib_features_auth_services_index_ts"],{40169:(T,_,t)=>{t.d(_,{pq:()=>g});var i=t(23214),p=t(73165),l=t(75835),h=t(45312),d=t(77970),v=t(46006);let g=(()=>{class c{http;_baseUrl="/users/me";_apiUrl=h.c.loopbackApi;_url=h.c.loopbackApi+"/users";apigeeUrl=h.c.apigeeUrl+"/v2/art/dashboard";dcpNodejsHttp=(0,i.WQX)(d.Y);apigeeHttp=(0,i.WQX)(v.J);constructor(n){this.http=n}getProfile(){return this.http.get(this._baseUrl,{context:(0,l.iH)()})}getProfileLang(n){return this.http.get(`${this._baseUrl}?lang=${n}`,{context:(0,l.iH)()})}loadBankingInfo(n){return this.dcpNodejsHttp.get(`${n}/claimant-bank-infos`)}updateBankingInfo(n,a){return a?this.http.patch(`${this._url}/${n.userId}/claimant-bank-infos`,n,{context:(0,l.iH)()}):this.http.post(`${this._url}/${n.userId}/claimant-bank-infos`,n,{context:(0,l.iH)()})}updateUser(n){return this.http.patch(`${this._url}/${n.id}`,n,{context:(0,l.iH)()})}updateEmail(n,a){return this.http.put(`${this._apiUrl}/updateuseremail/${n}`,a,{context:(0,l.iH)()})}updateMobileNumber(n,a){const O=localStorage.getItem("selectedLang")||"en",P=new p.Lr({language:O});return this.http.put(`${this.apigeeUrl}/update-mobile-number/${a}`,n,{headers:P})}checkMobileValidity(n,a){return this.dcpNodejsHttp.get(`/v1/user/checkmobilevalidate?mobileNumber=${n}&nationality=IN&nationalId=${a}`)}guestUpdateMobileNumber(n,a){return this.apigeeHttp.put(`${this.apigeeUrl}/guest/update-mobile/${a}`,n)}static \u0275fac=function(a){return new(a||c)(i.KVO(p.Qq))};static \u0275prov=i.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}return c})();t(63270)},42717:(T,_,t)=>{t.r(_),t.d(_,{IndividualLoginOtpComponent:()=>S});var i=t(23214),p=t(98434),l=t(92947),h=t(21413),d=t(56977),v=t(70980),g=t(68018),f=t(7872),c=t(80288),I=t(2847),n=t(40169),a=t(56964),O=t(81636),P=t(29040),b=t(86182),R=t(73018),u=t(38109),M=t(20786),D=t(71465),m=t(40668);let S=(()=>{class E{otpComRef;isCounterEnabled=(0,i.vPA)(!0);isResendEnabled=(0,i.vPA)(!1);timerDisplay=(0,i.vPA)("00:00");errorMessage=(0,i.vPA)("");phoneNumber=(0,i.vPA)("");customerData=(0,i.vPA)({});state=(0,i.vPA)(null);otpService=(0,i.WQX)(a.K);storage=(0,i.WQX)(c.s);authService=(0,i.WQX)(I.uR);languageService=(0,i.WQX)(P.g);profileService=(0,i.WQX)(n.pq);translate=(0,i.WQX)(g.c$);router=(0,i.WQX)(l.Ix);analytics=(0,i.WQX)(D.cu);$destroy=new h.B;timerSubscription;config=this.otpService.config;timeToReset=this.config.timer;OTP_LENGTH=4;MASKED_PHONE_PREFIX="******";constructor(){this.loadCustomerData(),this.loadNavigationState()}ngOnInit(){this.config.length=this.OTP_LENGTH,this.analytics.pushEvent("otp_sent",{funnel_name:"Login"})}loadCustomerData(){const e=this.storage.GetValue(this.authService.STORAGE_KEY);this.customerData.set(e||{}),this.phoneNumber.set(this.MASKED_PHONE_PREFIX+(e?.mobileTail||""))}loadNavigationState(){const e=this.router.getCurrentNavigation();this.state.set(e?.extras?.state||null)}ngAfterViewInit(){this.initializeOTP()}initializeOTP(){this.timerSubscription?.unsubscribe(),this.timerSubscription=this.startTimer(this.timeToReset),this.otpComRef?.ngOtpInputRef?.otpForm?.enable()}startTimer(e){return(0,O.u)(Math.round(e)).pipe((0,d.Q)(this.$destroy),(0,v.j)(()=>{this.handleTimerExpiry()})).subscribe(s=>{this.timerDisplay.set(s.time)})}handleTimerExpiry(){this.timerDisplay.set("00:00"),this.isResendEnabled.set(!0),this.otpComRef?.ngOtpInputRef?.otpForm?.disable()}changeOTP(e){if(e.length!==this.config.length)return;const s=this.customerData(),r={otp:this.storage.encryptData(e,s.mobileTail.toString()),otpId:s.mobileTail};this.errorMessage.set(""),this.otpComRef?.ngOtpInputRef?.otpForm?.disable(),this.authService.verifyOtp(r).subscribe({next:o=>{o&&this.handleOtpVerificationSuccess(o,s)},error:o=>{this.handleOtpVerificationError(o)}})}handleOtpVerificationSuccess(e,s){this.storeAuthTokens(e.token),this.profileService.getProfileLang(this.languageService.currentLang()).pipe((0,d.Q)(this.$destroy)).subscribe({next:r=>{this.storeUserProfile(r),this.analytics.pushEvent("otp_verfication",{funnel_name:"Login",otp_result:"Verification Success"}),this.navigateAfterLogin(s)},error:r=>{this.analytics.pushEvent("otp_verfication",{funnel_name:"Login",otp_result:`Verification Failed : ${r}`}),this.otpComRef?.ngOtpInputRef?.otpForm?.enable()}})}storeAuthTokens(e){typeof localStorage<"u"&&(localStorage.setItem(u.Hh.TOKEN,e),localStorage.setItem(u.Hh.LOGGED_IN,e),localStorage.setItem(u.Hh.DCP_TOKEN,e),localStorage.setItem("individualLogin","true"),localStorage.setItem("updateMobileSuccess","true"))}storeUserProfile(e){this.authService.idValue=e.idValue,this.authService.setUserInfo(JSON.stringify(e)),this.authService.currentUserSubject.next(e),typeof localStorage<"u"&&localStorage.setItem(u.Hh.USER,JSON.stringify(e))}handleOtpVerificationError(e){const s=e?.error?.Error||this.translate.instant("COMMON.OTP_ERROR");this.errorMessage.set(s),this.analytics.pushEvent("otp_verfication",{funnel_name:"Login",otp_result:`Verification Failed : ${s}`}),this.otpComRef?.ngOtpInputRef?.otpForm?.enable()}navigateAfterLogin(e){const s=this.state();if("online-service"===s?.from&&this.router.navigateByUrl(`${this.languageService.translateRoute(R.g.MAKE_REQUESTS)}?subAreaId=${s.subAreaId}`,{state:{from:"online-service",service:s?.service,subAreaId:s?.subAreaId}}),(0,m.k7)())this.router.navigateByUrl((0,m.wQ)(this.languageService),{state:{from:"",service:""}});else{const r=this.getPostLoginRedirectUrl(e);typeof localStorage<"u"&&localStorage.getItem(u.Hh.ROUTE_TO)===m.hL.REGISTER&&localStorage.removeItem(u.Hh.ROUTE_TO),this.authService.redirectUrl=null,this.router.navigateByUrl(this.languageService.translateRoute(r),{state:{from:"",service:""}})}}getPostLoginRedirectUrl(e){return e?.redirectUrl?e.redirectUrl:typeof localStorage<"u"&&localStorage.getItem(u.Hh.ROUTE_TO)===m.hL.REGISTER?M.hu.HEALTH_CLAIMS_TRACKING_LIST:"/my-space/individual"}changePhoneNumber(){this.router.navigate([this.languageService.translateRoute(b.A.AUTH_CHANGE_MOBILE_NUMBER)])}resendOTP(){this.analytics.pushEvent("otp_sent",{funnel_name:"Login"}),this.authService.resendOtp({}).subscribe({next:()=>{this.isResendEnabled.set(!1),this.initializeOTP()},error:()=>{this.otpComRef?.ngOtpInputRef?.otpForm?.enable()}})}ngOnDestroy(){this.timerSubscription?.unsubscribe(),this.$destroy.next(),this.$destroy.complete()}static \u0275fac=function(s){return new(s||E)};
1static \u0275cmp=i.VBU({type:E,selectors:[["art-dcp-individual-login-otp"]],viewQuery:function(s,r){if(1&s&&i.GBs(f.x,5),2&s){let o;i.mGM(o=i.lsd())&&(r.otpComRef=o.first)}},decls:1,vars:7,consts:[[3,"changeOTP","resendOTP","clickChangePhoneNumber","config","isCounterEnabled","isResendEnabled","timerDisplay","errorMessage","phoneNumber","isChangePhoneEnabled"]],template:function(s,r){1&s&&(i.j41(0,"art-otp",0),i.bIt("changeOTP",function(C){return r.changeOTP(C)})("resendOTP",function(){return r.resendOTP()})("clickChangePhoneNumber",function(){return r.changePhoneNumber()}),i.k0s()),2&s&&i.Y8G("config",r.config)("isCounterEnabled",r.isCounterEnabled())("isResendEnabled",r.isResendEnabled())("timerDisplay",r.timerDisplay())("errorMessage",r.errorMessage())("phoneNumber",r.phoneNumber())("isChangePhoneEnabled",!0)},dependencies:[p.MD,g.h,f.x],encapsulation:2})}return E})()}}]);

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.