1"use strict";(self.webpackChunklamsa_app=self.webpackChunklamsa_app||[]).push([["src_app_main_login_login_module_ts"],{5075:(N,v,i)=>{i.r(v),i.d(v,{LoginModule:()=>A});var b=i(6895),h=i(2870),a=i(4006),y=i(4790),c=i(3738),f=i(8776),m=i(5861);class C{}var S=i(3532),L=i(1042),e=i(4650),M=i(8057),I=i(8159),w=i(4668),O=i(1024);let P=(()=>{var r;class l{constructor(t,n,o,s,u,x){this.translateService=t,this.router=n,this.userService=o,this.localStorageHandlerService=s,this.eventService=u,this.flashMessagesService=x,this.locale="ar",this.model=new C,this.submit=!1,this.form=new a.nJ({}),this.fields=[{key:"email",type:"input",modelOptions:{updateOn:"submit"},id:"email",hideExpression:()=>this.userService.isMobileInput,templateOptions:{placeholder:"Email or Mobile Number",required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,5}$/,keyup:(p,g)=>{this.userService.toggleBetweenEmailOrMobileInput(p,g,this.form,this.model)}},expressionProperties:{"templateOptions.placeholder":this.translateService.stream("Sign in Screen.Sign in Email Placeholder")},validation:{messages:{pattern:()=>this.translateService.stream("FORM.EMAIL-INVALID")}}},{key:"phone_number",type:"phone_number",modelOptions:{updateOn:"submit"},hideExpression:()=>!this.userService.isMobileInput,id:"mobile",templateOptions:{placeholder:"Email or Mobile Number",required:!0,keyup:(p,g)=>{this.userService.toggleBetweenEmailOrMobileInput(p,g,this.form,this.model)}},validation:{messages:{validatePhoneNumber:()=>this.translateService.stream("FORM.PHONE_NUMBER-INVALID")}}},{key:"password",type:"input",modelOptions:{updateOn:"submit"},id:"password",templateOptions:{placeholder:"Password",required:!0,type:"password"},expressionProperties:{"templateOptions.placeholder":this.translateService.stream("Sign in Screen.Sign in Password Placeholder")}}],this.locale=t.getDefaultLang()}onSubmit(){var t=this;return(0,m.Z)(function*(){if(!t.form.valid)return!1;t.submit=!0;const n=t.form.value;var o;n.phone_number&&(n.phone_number=null===(o=n.phone_number)||void 0===o?void 0:o.e164Number);const s=(0,L.Z)();t.localStorageHandlerService.getItem("device_id")?(n.device_id=t.localStorageHandlerService.getItem("device_id"),t.loginApi(n).then()):yield t.userService.addDevice(s).then(u=>u.subscribe(()=>{n.device_id=s,t.loginApi(n).then()}))})()}loginApi(t){var n=this;return(0,m.Z)(function*(){n.localStorageHandlerService.getItem("teacher_id")&&(t.teacher_id=n.localStorageHandlerService.getItem("teacher_id")),null!=t&&t.source_id&&delete t.source_id,(yield n.userService.login(t)).subscribe(function(){var o=(0,m.Z)(function*(s){n.eventService.send({category:"Login",label:t.phone_number?"Lamsa website: Phone number":"Lamsa website: Email address",data:"Success"}).then(),yield n.userService.getAllUserInfo().finally(()=>{setTimeout(()=>{window.location.replace(`/${n.locale}/`)},300)})});return function(s){return o.apply(this,arguments)}}(),o=>{setTimeout(()=>{n.submit=!1},2e3),n.flashMessagesService.show(o.message,{cssClass:"alert-danger",timeout:2e3})})})()}navigateForGotPassword(){window.location.href="/"+this.locale+"/forgot-password"}navigateToRegister(){this.eventService.send({category:"Registration",label:"Login screen- Registration CTA",data:"Clicked"}),window.location.href="/"+this.locale+"/add-kid"}}return(r=l).\u0275fac=function(t){return new(t||r)(e.\u0275\u0275directiveInject(c.sK),e.\u0275\u0275directiveInject(h.F0),e.\u0275\u0275directiveInject(M.K),e.\u0275\u0275directiveInject(I.A),e.\u0275\u0275directiveInject(w.P),e.\u0275\u0275directiveInject(O.GQ))},r.\u0275cmp=e.\u0275\u0275defineComponent({type:r,selectors:[["app-login"]],viewQuery:function(t,n){if(1&t&&e.\u0275\u0275viewQuery(S.C,5),2&t){let o;e.\u0275\u0275queryRefresh(o=e.\u0275\u0275loadQuery())&&(n.child=o.first)}},decls:17,vars:5,consts:[[1,"container"],[1,"parent_wrap"],["translate","",1,"mb-4"],[3,"formGroup","ngSubmit"],[3,"form","fields","model"],[1,"forgot-password"],["translate","",1,"sign_btn",3,"click"],["type","submit","translate","",1,"btn","bttn","submit_btn",3,"disabled"],["translate","",1,"mt-4","mb-0"],[1,"sign_btn",3,"click"],["translate",""]],template:function(t,n){1&t&&(e.\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"h2",2),e.\u0275\u0275text(3,"Sign in Screen.Sign in Title"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"form",3),e.\u0275\u0275listener("ngSubmit",function(){return n.onSubmit()}),e.\u0275\u0275element(5,"formly-form",4),e.\u0275\u0275elementStart(6,"div",5)(7,"a",6),e.\u0275\u0275listener("click",function(){return n.navigateForGotPassword()}),e.\u0275\u0275text(8,"Forgot password.Forgot password"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(9,"button",7),e.\u0275\u0275text(10,"Sign in Screen.Sign in CTA "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(11,"p",8),e.\u0275\u0275text(12,"Sign in Screen.Sign up "),e.\u0275\u0275elementStart(13,"a",9),e.\u0275\u0275listener("click",function(){return n.navigateToRegister()}),e.\u0275\u0275elementStart(14,"strong",10),e.\u0275\u0275text(15,"Sign in Screen.Sign up CTA"),e.\u0275\u0275elementEnd()()()()(),e.\u0275\u0275element(16,"app-choose-kid")),2&t&&(e.\u0275\u0275advance(4),e.\u0275\u0275property("formGroup",n.form),e.\u0275\u0275advance(1),e.\u0275\u0275property("form",n.form)("fields",n.fields)("model",n.model),e.\u0275\u0275advance(4),e.\u0275\u0275property("disabled",n.submit))},dependencies:[S.C,a._Y,a.JL,a.sg,c.Pi,f.T7],styles:[".forgot-password[_ngcontent-%COMP%]{text-align:right;max-width:400px;margin:10px auto}.forgot-password[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#3e418e} [lang=ar] .forgot-password{text-align:left}"]}),l})();var E=i(9612);const T=[{path:"",component:P},{path:"**",redirectTo:"/page-redirect"}];let A=(()=>{var r;class l{}return(r=l).\u0275fac=function(t){return new(t||r)},r.\u0275mod=e.\u0275\u0275defineNgModule({type:r}),r.\u0275inj=e.\u0275\u0275defineInjector({imports:[b.CommonModule,h.Bz.forChild(T),E.v,a.UX,y.J7,c.aw,f.X0]}),l})()}}]);
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.