-
Notifications
You must be signed in to change notification settings - Fork 0
/
917.46cfbb40b6161a8f.js
1 lines (1 loc) · 7.86 KB
/
917.46cfbb40b6161a8f.js
1
"use strict";(self.webpackChunkath=self.webpackChunkath||[]).push([[917],{2917:(R,u,r)=>{r.r(u),r.d(u,{AuthSignInModule:()=>j});var s=r(5357),p=r(2455),a=r(3075),g=r(5700),e=r(5e3),f=r(8951),h=r(9808),I=r(6307),l=r(7322),v=r(7531),y=r(7423),S=r(5245),x=r(7446),F=r(773);const C=["signInNgForm"];function b(t,o){if(1&t&&(e.\u0275\u0275elementStart(0,"ath-alert",22),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&t){const n=e.\u0275\u0275nextContext();e.\u0275\u0275property("appearance","outline")("showIcon",!1)("type",n.alert.type)("@shake","error"===n.alert.type),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",n.alert.message," ")}}function E(t,o){1&t&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1," El correo electr\xf3nico es obligatorio "),e.\u0275\u0275elementEnd())}function w(t,o){1&t&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1," Correo electr\xf3nico no v\xe1lido "),e.\u0275\u0275elementEnd())}function A(t,o){1&t&&e.\u0275\u0275element(0,"mat-icon",23),2&t&&e.\u0275\u0275property("svgIcon","heroicons_solid:eye")}function N(t,o){1&t&&e.\u0275\u0275element(0,"mat-icon",23),2&t&&e.\u0275\u0275property("svgIcon","heroicons_solid:eye-off")}function M(t,o){1&t&&(e.\u0275\u0275elementStart(0,"span",24),e.\u0275\u0275text(1," Iniciar Sesi\xf3n "),e.\u0275\u0275elementEnd())}function T(t,o){1&t&&e.\u0275\u0275element(0,"mat-progress-spinner",25),2&t&&e.\u0275\u0275property("diameter",24)("mode","indeterminate")}const V=[{path:"",component:(()=>{class t{constructor(n,i,m,c){this._activatedRoute=n,this._authService=i,this._formBuilder=m,this._router=c,this.alert={type:"success",message:""},this.showAlert=!1,this.email=null,this.rememberMe=!1}ngOnInit(){this.email=localStorage.getItem("email")||null,this.signInForm=this._formBuilder.group({email:[null,[a.Validators.required,a.Validators.email]],password:[null,a.Validators.required],rememberMe:[!1]}),null!==this.email&&(this.signInForm.get("email").setValue(this.email),this.signInForm.get("rememberMe").setValue(!0))}signIn(){this.signInForm.invalid||(this.signInForm.get("rememberMe").value?localStorage.setItem("email",this.signInForm.get("email").value):localStorage.removeItem("email"),this.signInForm.disable(),this.showAlert=!1,this._authService.signIn(this.signInForm.value).subscribe(()=>{const n=this._activatedRoute.snapshot.queryParamMap.get("redirectURL")||"/signed-in-redirect";this._router.navigateByUrl(n)},()=>{this.signInForm.enable(),this.signInNgForm.resetForm(),this.alert={type:"error",message:"Credenciales incorrectas"},this.showAlert=!0}))}}return t.\u0275fac=function(n){return new(n||t)(e.\u0275\u0275directiveInject(s.gz),e.\u0275\u0275directiveInject(f.e),e.\u0275\u0275directiveInject(a.FormBuilder),e.\u0275\u0275directiveInject(s.F0))},t.\u0275cmp=e.\u0275\u0275defineComponent({type:t,selectors:[["auth-sign-in"]],viewQuery:function(n,i){if(1&n&&e.\u0275\u0275viewQuery(C,5),2&n){let m;e.\u0275\u0275queryRefresh(m=e.\u0275\u0275loadQuery())&&(i.signInNgForm=m.first)}},decls:32,vars:14,consts:[[1,"flex","flex-col","items-center","flex-auto","min-w-0","sm:justify-center","bg-mine-900"],[1,"w-full","px-4","py-8","sm:w-auto","sm:p-12","sm:rounded-sm","sm:shadow","sm:bg-card"],[1,"w-full","mx-auto","max-w-80","sm:w-80","sm:mx-0"],[1,"w-12"],["src","assets/images/logo/logo-wiremid-green.svg"],[1,"mt-8","text-4xl","font-extrabold","leading-tight","tracking-tight","text-mine-200","sm:text-mine-800"],["class","mt-8 -mb-4",3,"appearance","showIcon","type",4,"ngIf"],[1,"mt-8",3,"formGroup"],["signInNgForm","ngForm"],[1,"w-full"],[1,"text-mine-200","sm:text-mine-600"],["id","email","matInput","",3,"formControlName"],[4,"ngIf"],["id","password","matInput","","type","password",3,"formControlName"],["passwordField",""],["mat-icon-button","","type","button","matSuffix","",3,"click"],["class","icon-size-5 text-mine-500",3,"svgIcon",4,"ngIf"],[1,"inline-flex","items-end","justify-between","w-full","mt-1.5"],[1,"text-mine-200","sm:text-hint",3,"color","formControlName"],["mat-flat-button","",1,"w-full","mt-6","rounded-sm","fuse-mat-button-large","bg-primary-600",3,"disabled","click"],["class","text-lg font-semibold tracking-wide text-mine-900",4,"ngIf"],["class","text-mine-900",3,"diameter","mode",4,"ngIf"],[1,"mt-8","-mb-4",3,"appearance","showIcon","type"],[1,"icon-size-5","text-mine-500",3,"svgIcon"],[1,"text-lg","font-semibold","tracking-wide","text-mine-900"],[1,"text-mine-900",3,"diameter","mode"]],template:function(n,i){if(1&n){const m=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"div",1),e.\u0275\u0275elementStart(2,"div",2),e.\u0275\u0275elementStart(3,"div",3),e.\u0275\u0275element(4,"img",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",5),e.\u0275\u0275text(6,"Iniciar Sesi\xf3n"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(7,b,2,5,"ath-alert",6),e.\u0275\u0275elementStart(8,"form",7,8),e.\u0275\u0275elementStart(10,"mat-form-field",9),e.\u0275\u0275elementStart(11,"mat-label",10),e.\u0275\u0275text(12,"Correo electr\xf3nico"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(13,"input",11),e.\u0275\u0275template(14,E,2,0,"mat-error",12),e.\u0275\u0275template(15,w,2,0,"mat-error",12),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"mat-form-field",9),e.\u0275\u0275elementStart(17,"mat-label",10),e.\u0275\u0275text(18,"Contrase\xf1a"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(19,"input",13,14),e.\u0275\u0275elementStart(21,"button",15),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(m);const d=e.\u0275\u0275reference(20);return d.type="password"===d.type?"text":"password"}),e.\u0275\u0275template(22,A,1,1,"mat-icon",16),e.\u0275\u0275template(23,N,1,1,"mat-icon",16),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(24,"mat-error"),e.\u0275\u0275text(25," La contrase\xf1a es obligatoria "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(26,"div",17),e.\u0275\u0275elementStart(27,"mat-checkbox",18),e.\u0275\u0275text(28," Recordar mi usuario "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(29,"button",19),e.\u0275\u0275listener("click",function(){return i.signIn()}),e.\u0275\u0275template(30,M,2,0,"span",20),e.\u0275\u0275template(31,T,1,2,"mat-progress-spinner",21),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&n){const m=e.\u0275\u0275reference(20);e.\u0275\u0275advance(1),e.\u0275\u0275property("@fadeInBottom",void 0),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngIf",i.showAlert),e.\u0275\u0275advance(1),e.\u0275\u0275property("formGroup",i.signInForm),e.\u0275\u0275advance(5),e.\u0275\u0275property("formControlName","email"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.signInForm.get("email").hasError("required")),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.signInForm.get("email").hasError("email")),e.\u0275\u0275advance(4),e.\u0275\u0275property("formControlName","password"),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf","password"===m.type),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","text"===m.type),e.\u0275\u0275advance(4),e.\u0275\u0275property("color","primary")("formControlName","rememberMe"),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",i.signInForm.disabled),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!i.signInForm.disabled),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",i.signInForm.disabled)}},directives:[h.O5,I.M,a.\u0275NgNoValidate,a.NgControlStatusGroup,a.FormGroupDirective,l.KE,l.hX,v.Nt,a.DefaultValueAccessor,a.NgControlStatus,a.FormControlName,l.TO,y.lW,l.R9,S.Hw,x.oG,F.Ou],encapsulation:2,data:{animation:g.p}}),t})()}];let j=(()=>{class t{}return t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=e.\u0275\u0275defineNgModule({type:t}),t.\u0275inj=e.\u0275\u0275defineInjector({imports:[[s.Bz.forChild(V),p.m]]}),t})()}}]);