PageSourceSearch

https://app.zwitch.io/chunk-IYWKJMTA.js

js zwitch.io collected 2026-10-06 04:50:37 UTC 10,600 bytes, 1 lines download raw bytes

1import{K as ee,Y as te,oa as ne}from"./chunk-ITMNHGYE.js";import"./chunk-4XDD5GRH.js";import{a as $}from"./chunk-3CHGNBR7.js";import{d as X,i as ie}from"./chunk-OOWR3H43.js";import{b as Z}from"./chunk-HYW2USYE.js";import"./chunk-Y7BYMT2D.js";import"./chunk-RK7C6G2K.js";import"./chunk-BTQP77C2.js";import"./chunk-GNN3H3LZ.js";import"./chunk-RSFGMTUK.js";import"./chunk-GX4HI6RT.js";import"./chunk-NNH2TRT4.js";import"./chunk-GBXK5JU4.js";import"./chunk-3BRGWMOC.js";import"./chunk-JU4XO2TT.js";import"./chunk-STN2SNR6.js";import"./chunk-AC4H6TVA.js";import"./chunk-FSRGYLKD.js";import"./chunk-XCQ2J2WS.js";import"./chunk-XQXGBHKK.js";import"./chunk-V6WZ7HXO.js";import"./chunk-FGZZGEHQ.js";import"./chunk-I3QGYS47.js";import"./chunk-Z6YHTJW3.js";import"./chunk-5TNVQEBA.js";import"./chunk-TQZTSBAR.js";import"./chunk-ZNC3RO6K.js";import{d as K,e as Q}from"./chunk-5IMFKJPO.js";import{b as G,k as Y,l as J}from"./chunk-SS66KW5H.js";import"./chunk-2VIEC7KJ.js";import"./chunk-DFLW7TDA.js";import"./chunk-PMBKTCU7.js";import{Ba as A,Da as y,Ga as F,Ma as j,Qa as q,Wa as L,Xa as H,bb as W}from"./chunk-CUGSD5VN.js";import{d as N,f as z}from"./chunk-P6MDVPEW.js";import"./chunk-CJYAEVHA.js";import"./chunk-AGLGVGR7.js";import"./chunk-LS45BCAD.js";import"./chunk-35ZSDQDQ.js";import"./chunk-BUTVEMGC.js";import{m as R,y as U}from"./chunk-KEL3FZJN.js";import{$c as g,Db as w,Ec as l,Fc as B,Gc as S,Hc as D,J as T,Jb as C,P as O,Ub as a,Yb as E,Zc as b,ec as r,fc as s,gc as h,hb as _,hc as k,ic as P,kc as f,ob as o,pb as x,pc as d,rc as p,t as V,wa as m,xa as u}from"./chunk-OCUFLB2J.js";import{a as I,b as M}from"./chunk-HZFTEYNC.js";function oe(n,c){if(n&1){let e=f();r(0,"p",17),l(1),r(2,"span",18),d("click",function(){m(e);let t=p();return t.editMobile=!t.editMobile,u(t.backupExistingMobileNo=t.mobile_number)}),l(3,"change"),s()()}if(n&2){let e=p();o(),D(" We have ",e.resent?"re":"","sent an OTP to registered mobile Number ",e.mobile_number," ")}}function re(n,c){if(n&1){let e=f();r(0,"p",17),l(1," Please update your mobile number to receive new OTP "),r(2,"span",18),d("click",function(){m(e);let t=p();return t.editMobile=!t.editMobile,u(t.mobile_number=t.backupExistingMobileNo)}),l(3,"cancel"),s()()}}function se(n,c){n&1&&(r(0,"span",23),l(1,"Incorrect OTP"),s())}function ae(n,c){n&1&&(r(0,"span",24),l(1," OTP verification is successful "),s())}function le(n,c){if(n&1){let e=f();r(0,"section",19),d("keyup.enter",function(){m(e);let t=p();return u(t.enter())}),r(1,"app-otp-box",20),d("filled",function(t){m(e);let v=p();return u(v.verifyOTP(t))}),s(),C(2,se,2,0,"span",21)(3,ae,2,0,"span",22),s()}if(n&2){let e=p();o(),a("mode",e.otpMode),o(),a("ngIf",e.otpMode==="error"),o(),a("ngIf",e.otpMode==="success")}}function pe(n,c){if(n&1&&(r(0,"div",30),l(1),s()),n&2){let e=p(2);o(),S(" ",e.phoneInvalidError," ")}}function ce(n,c){if(n&1){let e=f();r(0,"section",25)(1,"mat-form-field",26)(2,"mat-label"),l(3," New mobile number "),s(),h(4,"input",27),s(),C(5,pe,2,1,"div",28),r(6,"app-button",29),d("click",function(){m(e);let t=p();return u(t.sendOTP())}),l(7," Send OTP "),s()()}if(n&2){let e=p();o(4),a("formControl",e.phoneno),o(),a("ngIf",e.isPhoneInvalid)}}function me(n,c){if(n&1){let e=f();r(0,"p",31),l(1," Haven\u2019t received OTP? "),r(2,"strong",32),d("click",function(){m(e);let t=p();return u(t.sendOTP(!0))}),l(3,"Resend"),s()()}}function ue(n,c){if(n&1&&(r(0,"p",31),l(1," Resend OTP available in "),r(2,"strong",33),l(3),s()()),n&2){let e=p();o(3),B(e.timer)}}function de(n,c){if(n&1){let e=f();r(0,"div",34)(1,"app-button",35),d("click",function(){m(e);let t=p();return u(t.nextStep())}),l(2," Next "),s()()}}var Pe=(()=>{class n{static{this.TIMER_COUNT=90}constructor(e,i,t){this.authService=e,this.route=i,this.router=t,this.classes="w-full",this.otpMode="none",this.otpSent=!1,this.nextRoute="hj",this.resent=!1,this.timerCount=n.TIMER_COUNT,this.timer="01:30",this.editMobile=!1,this.backupExistingMobileNo="",this.otpVerificationId="",this.phoneno=new j(null,[y.required,y.minLength(10)]),this.isOtpBeingVerified=!1}ngOnInit(){this.route.paramMap.pipe(V(()=>window.history.state)).subscribe({next:({data:e,user:i,otp_verification_id:t,next:v})=>{this.nextRoute=v,this.userData=i,this.otpVerificationId=t,e?(this.mobile_number=typeof e=="string"?e:e?.mobile_number,v?(this.otpSent=!0,this.startTimer()):this.sendOTP()):!e&&i?(this.mobile_number=i.phoneno,this.sendOTP()):(this.authService.logout(),this.router.navigateByUrl("login"))}}),this.phoneno.valueChanges.pipe(T(300)).subscribe({next:e=>{this.mobile_number=e}})}enter(){this.otpMode==="success"&&this.nextStep()}startTimer(){this.interval=setInterval(()=>{this.timerCount===0?this.timerCount--:this.timerCount--,this.timer=this.timerCount===0?"00:00":this.transform(this.timerCount),this.timer==="00:00"&&(clearInterval(this.interval),this.otpSent=!1,this.timerCount=n.TIMER_COUNT)},1e3)}transform(e){let i=Math.floor(e/60);
1return i.toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1})+":"+(e-i*60).toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1})}verifyOTP(e){if(!e)this.otpMode="none";else{if(this.isOtpBeingVerified)return;this.isOtpBeingVerified=!0,this.authService.verifyOTP(this.mobile_number,e,this.otpVerificationId).pipe(O(()=>this.isOtpBeingVerified=!1)).subscribe({next:i=>{this.otpVerificationId=i.data.verification_code??i.data?.verification_id,this.otpMode="success",!this.nextRoute&&(this.userData=M(I({},this.userData),{phoneno:this.mobile_number}))},error:()=>this.otpMode="error"})}}sendOTP(e=!1){this.editMobile?!this.isPhoneInvalid&&this.phoneno.touched?this.authService.sendOTP(this.mobile_number).subscribe({next:i=>{this.otpVerificationId=i.data.id??i.data?.verification_id,this.otpSent=!0,this.editMobile=!1,this.otpSent=!0,this.backupExistingMobileNo=this.mobile_number},error:()=>this.otpSent=!1,complete:()=>this.startTimer()}):this.phoneno.markAllAsTouched():(this.resent=e,this.otpSent=!0,this.authService.sendOTP(this.mobile_number).subscribe({next:i=>{this.otpVerificationId=i.data.id??i.data.verification_id,this.otpSent=!0},error:()=>this.otpSent=!1,complete:()=>this.startTimer()}))}nextStep(){this.userData?this.authService.signup(this.userData,this.route.snapshot.queryParamMap.get("from")==="invite").subscribe({next:()=>{let{phoneno:e,password:i}=this.userData;this.authService.authenticate({username:e,password:i}).subscribe({next:t=>{localStorage.setItem("rememberMe","true"),localStorage.setItem("inviteSecret",t.access_key),t.companies_pid?(sessionStorage.setItem("activeWorkspace",t.companies_pid),localStorage.setItem("activeWorkspace",t.companies_pid)):t.refresh_token&&localStorage.setItem("refSecret",t.refresh_token),t.is_zwitch_native_user=!0,this.authService.storeToken(t),this.route.snapshot.queryParamMap.get("from")==="invite"?this.router.navigateByUrl("/welcome-page"):this.router.navigateByUrl("/login/company-details")}})}}):this.router.navigate([this.nextRoute??"/launchpad"],{state:{data:this.mobile_number,otp_verification_code:this.otpVerificationId},queryParams:{next:null},queryParamsHandling:"merge"})}get isPhoneInvalid(){let e=this.phoneno;return(e?.hasError("required")||e?.hasError("minlength"))&&(e?.touched||e?.dirty)}get phoneInvalidError(){return this.phoneno?.hasError("required")?"Please enter mobile number ":"Please provie a 10 digit Mobile number"}ngOnDestroy(){clearInterval(this.interval)}static{this.\u0275fac=function(i){return new(i||n)(x(X),x(N),x(z))}}static{this.\u0275cmp=w({type:n,selectors:[["app-otp-verification"]],hostVars:2,hostBindings:function(i,t){i&2&&E(t.classes)},decls:27,vars:24,consts:[["form","",1,"flex","flex-col","justify-center","items-start"],[1,"font-bold","text-xl","text-orange-200"],["class","text-sm mt-2",4,"ngIf"],["class","my-8 flex flex-col justify-between",3,"keyup.enter",4,"ngIf"],["class","w-full",4,"ngIf"],["class","text-xs",4,"ngIf"],["class","mt-3",4,"ngIf"],["content",""],[1,"h-full","grid","place-content-center","text-orange-200","text-2xl","text-opacity-40","font-bold","relative","overflow-hidden"],[1,"text-center"],[1,"absolute","-bottom-6","right-5","h-full","w-full"],[1,"relative","h-full","w-full"],["alt","orange_blob",1,"absolute","z-10","h-32",3,"src"],["alt","white_blob","appBubbleMove","",1,"absolute","h-14","-top-5",3,"src"],[1,"absolute","right-5","h-full","w-full"],["alt","orange_blob",1,"absolute","h-32","-bottom-10","right-4",3,"src"],["alt","white_blob","appBubbleMove","",1,"absolute","z-10","h-14","bottom-8","right-0",3,"src"],[1,"text-sm","mt-2"],[1,"text-skyblue-500","font-semibold","cursor-pointer",3,"click"],[1,"my-8","flex","flex-col","justify-between",3,"keyup.enter"],["textSize","lg",3,"filled","mode"],["class","validation-block mt-3",4,"ngIf"],["class","validation-block success mt-3",4,"ngIf"],[1,"validation-block","mt-3"],[1,"validation-block","success","mt-3"],[1,"w-full"],["appearance","outline",1,"pt-5"],["matInput","","maxlength","10","minlength","10","type","tel","appAllowOnly","number",3,"formControl"],["class","validation-block ml-1 mt-3 relative -top-2 w-full",4,"ngIf"],["color","orange","type","submit","id","form-submit",1,"py-5",3,"click"],[1,"validation-block","ml-1","mt-3","relative","-top-2","w-full"],[1,"text-xs"],[1,"font-semibold","ml-1","cursor-pointer","text-skyblue-500",3,"click"],[1,"font-semibold","text-orange-400","ml-1"],[1,"mt-3"],["color","orange","type","submit","id","form-submit",3,"click"]],template:function(i,t){i&1&&(r(0,"app-common-layout")(1,"div",0)(2,"h1",1),l(3,"OTP sent"),s(),C(4,oe,4,2,"p",2)(5,re,4,0,"p",2)(6,le,4,3,"section",3)(7,ce,8,2,"section",4)(8,me,4,0,"p",5)(9,ue,4,1,"p",5)(10,de,3,0,"div",6),s(),k(11,7),r(12,"div",8)(13,"div",9),l(14),s(),r(15,"div",10)(16,"div",11),h(17,"img",12),b(18,"s3"),h(19,"img",13),b(20,"s3"),s()(),r(21,"div",14)(22,"div",11),h(23,"img",15),b(24,"s3"),h(25,"img",16),b(26,"s3"),s()()(),P(),s()),i&2&&(o(4),a("ngIf",!t.editMobile),o(),a("ngIf",t.editMobile),o(),a("ngIf",!t.editMobile),o(),a("ngIf",t.editMobile),o(),a("ngIf",!t.editMobile&&t.otpMode!=="success"&&!t.otpSent),o(),a("ngIf",!t.editMobile&&t.otpMode!=="success"&&t.otpSent),o(),a("ngIf",t.otpMode==="success"&&!t.editMobile),o(4),S(" ",t.editMobile?"You'll get a message":"You\u2019ve got a message"," "),o(3),a("src",g(18,12,"white_circle.png","img"),_),o(2),a("src",g(20,15,"orange_circle.png","img"),_),o(4),a("src",g(24,18,"orange_circle.png","img"),_),o(2),a("src",g(26,21,"white_circle.png","img"),_))},dependencies:[U,R,te,ie,ne,ee,Z,W,A,F,L,H,q,J,Y,G,Q,K],encapsulation:2,data:{animation:[$]}})}}return n})();export{Pe as OtpVerificationComponent};

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.