1"use strict";(self.webpackChunkoscus=self.webpackChunkoscus||[]).push([[225],{3225:(w,p,i)=>{i.r(p),i.d(p,{AuthModule:()=>M});var h=i(6895),g=i(4496),t=i(4650);let m=(()=>{class r{constructor(o){this.router=o}canActivate(o,e){const n=localStorage.getItem("usuario");return!n||!JSON.parse(n).identificador||(this.router.navigate(["/dashboard/"]),!1)}}return r.\u0275fac=function(o){return new(o||r)(t.LFG(g.F0))},r.\u0275prov=t.Yz7({token:r,factory:r.\u0275fac,providedIn:"root"}),r})();var a=i(4006),v=i(5226),c=i.n(v),C=i(3826),d=i(5861),x=i(4004),O=i(3385),P=i(1085);let b=(()=>{class r{constructor(o,e){this.afAuth=o,this.firestore=e,this.formRef=this.firestore.collection("perfiles"),this.formRefUsua=this.firestore.collection("usuarios"),this.itemsCollection=e.collection("usuarios"),this.Usuario=this.itemsCollection.snapshotChanges().pipe((0,x.U)(n=>n.map(u=>{const l=u.payload.doc.data();return{id:u.payload.doc.id,...l}})))}login(o,e){var n=this;return(0,d.Z)(function*(){try{return yield n.afAuth.signInWithEmailAndPassword(o,e)}catch{return null}})()}registrar(o,e){var n=this;return(0,d.Z)(function*(){try{return yield n.afAuth.createUserWithEmailAndPassword(o,e)}catch{return null}})()}registrarUsuario(o){var e=this;return(0,d.Z)(function*(){return e.firestore.collection("usuarios").add(o)})()}resetPassword(o){var e=this;return(0,d.Z)(function*(){try{return e.afAuth.sendPasswordResetEmail(o)}catch{}})()}postUsuario(o){return this.firestore.collection("items").add(o)}getUsuarios(){return this.firestore.collection("usuarios").snapshotChanges()}getUsuario(o){return this.firestore.collection("usuarios",e=>e.where("identificador","==",o)).get()}getUsuarioPorId(o){return this.formRefUsua.doc(o).snapshotChanges()}getUsuariosAdmin(o){return this.firestore.collection("usuarios").doc(o).snapshotChanges()}eliminarUsuario(o,e){return this.formRefUsua.doc(o).update(e)}eliminarPerfil(o,e){return this.formRef.doc(o).update(e)}getPerfiles(){return this.firestore.collection("perfiles").snapshotChanges()}actualizarUsuario(o,e){return this.firestore.collection("usuarios").doc(o).update(e)}}return r.\u0275fac=function(o){return new(o||r)(t.LFG(O.zQ),t.LFG(P.ST))},r.\u0275prov=t.Yz7({token:r,factory:r.\u0275fac,providedIn:"root"}),r})();function U(r,s){1&r&&(t.TgZ(0,"span"),t._uU(1,"\u{1f441}\ufe0f"),t.qZA())}function _(r,s){1&r&&(t.TgZ(0,"span"),t._uU(1,"\u{1f648}"),t.qZA())}const y=[{path:"",children:[{path:"login",component:(()=>{class r{constructor(o,e,n){this.formBuilder=o,this.loginService=e,this.router=n,this.usuarioData=[],this.loading=!1,this.showPassword=!1,this.userEmail=new a.NI(""),this.formLogin=this.formBuilder.group({usuario:["",[a.kI.required]],contrasenia:["",[a.kI.required]]}),this.loginform=!0,this.recoverform=!1}get usuario(){return this.formLogin.get("usuario")}get contrasenia(){return this.formLogin.get("contrasenia")}ngOnInit(){}showRecoverForm(){this.loginform=!this.loginform,this.recoverform=!this.recoverform}iniciarSesion(){this.loading=!0;const o=this.formLogin.get("usuario")?.value,e=this.formLogin.get("contrasenia")?.value;o&&e?this.loginService.login(o,e).then(n=>{this.loginService.getUsuario(n.user.uid).subscribe(u=>{let l;this.usuarioData=[],u.forEach(f=>{this.usuarioData.push(f.id,f.data())}),this.usuarioData.length>0?this.usuarioData[1]?.perfil_usuario?.length>0?"Activo"==this.usuarioData[1]?.estado_usuario?(l={id_usuario:this.usuarioData[0],email_usuario:this.usuarioData[1].email_usuario,identificador:this.usuarioData[1].identificador,nombre_usuario:this.usuarioData[1].nombre_usuario,perfil_usuario:this.usuarioData[1].perfil_usuario},localStorage.setItem("perfilUsuario",JSON.stringify(l.perfil_usuario)),localStorage.setItem("usuario",JSON.stringify(l)),this.router.navigate(["/dashboard/"]),this.loading=!1):(this.loading=!1,c().fire({icon:"error",title:"Oops...",text:"Usuario no registrado o inactivo"})):(this.loading=!1,c().fire({icon:"error",title:"Oops...",text:"Usuario no puede acceder al sistema, contactar con el administrador"})):(this.loading=!1,c().fire({icon:"error",title:"Oops...",text:"Usuario no registrado o inactivo"}))})}).catch(n=>{this.loading=!1,c().fire({icon:"error",title:"Oops...",text:"Usuario o contrase\xf1a incorrectos, verificar las credenciales"})}):(this.loading=!1,c().fire({icon:"error",title:"Oops...",text:"Usuario o contrase\xf1a vac\xedos, verificar las credenciales"}))}}return r.\u0275fac=function(o){return new(o||r)(t.Y36(a.qu),t.Y36(b),t.Y36(g.F0))},r.\u0275cmp=t.Xpm({type:r,selectors:[["app-login"]],features:[t._Bn([C.a]
1)],decls:37,vars:4,consts:[[1,"login-block"],[1,"container"],[1,"row"],[1,"col-md-4","login-sec"],[1,"text-center"],[1,"login-form",3,"formGroup"],[1,"form-group"],["for","exampleInputEmail1",1,"text-uppercase","texto"],["type","text","placeholder","","formControlName","usuario",1,"form-control"],[1,"text-uppercase","texto"],[1,"password-wrapper"],["formControlName","contrasenia",1,"form-control",3,"type","keyup.enter"],["type","button",1,"toggle-password",3,"click"],[4,"ngIf"],[1,"form-check"],["type","button",1,"btn","btn-login","float-right",3,"click"],[1,"copy-text"],[1,"fa","fa-heart"],["href",""],[1,"col-md-8","banner-sec"],["id","carouselExampleIndicators","data-ride","carousel",1,"carousel","slide"],[1,"carousel-indicators"],["data-target","#carouselExampleIndicators","data-slide-to","0",1,"active"],["role","listbox",1,"carousel-inner"],[1,"carousel-item","active"],["src","../../../assets/img/admin/IMAGEN-LOGIN.png","alt","First slide",1,"d-block","img-fluid"],[1,"carousel-caption","d-none","d-md-block"],[1,"banner-text"]],template:function(o,e){1&o&&(t.TgZ(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h2",4),t._uU(5,"Cooperativa de Ahorro y Cr\xe9dito OSCUS ltda."),t.qZA(),t.TgZ(6,"form",5)(7,"div",6)(8,"label",7),t._uU(9,"Usuario"),t.qZA(),t._UZ(10,"input",8),t.qZA(),t.TgZ(11,"div",6)(12,"label",9),t._uU(13,"Contrase\xf1a"),t.qZA(),t.TgZ(14,"div",10)(15,"input",11),t.NdJ("keyup.enter",function(){return e.iniciarSesion()}),t.qZA(),t.TgZ(16,"button",12),t.NdJ("click",function(){return e.showPassword=!e.showPassword}),t.YNc(17,U,2,0,"span",13),t.YNc(18,_,2,0,"span",13),t.qZA()()(),t.TgZ(19,"div",14)(20,"button",15),t.NdJ("click",function(){return e.iniciarSesion()}),t._uU(21,"Ingresar"),t.qZA()()(),t.TgZ(22,"div",16),t._uU(23,"Creado"),t._UZ(24,"i",17),t._uU(25," por "),t.TgZ(26,"a",18),t._uU(27,"OSCUS"),t.qZA()()(),t.TgZ(28,"div",19)(29,"div",20)(30,"ol",21),t._UZ(31,"li",22),t.qZA(),t.TgZ(32,"div",23)(33,"div",24),t._UZ(34,"img",25),t.TgZ(35,"div",26),t._UZ(36,"div",27),t.qZA()()()()()()()()),2&o&&(t.xp6(6),t.Q6J("formGroup",e.formLogin),t.xp6(9),t.Q6J("type",e.showPassword?"text":"password"),t.xp6(2),t.Q6J("ngIf",!e.showPassword),t.xp6(1),t.Q6J("ngIf",e.showPassword))},dependencies:[h.O5,a._Y,a.Fj,a.JJ,a.JL,a.sg,a.u],styles:['.login-block[_ngcontent-%COMP%]{background:#fff;float:left;width:100%;padding:200px 0;height:100vh}.banner-sec[_ngcontent-%COMP%]{background-size:cover;min-height:500px;border-radius:0 10px 10px 0;padding:0}.texto[_ngcontent-%COMP%]{color:#2e56a1}.container[_ngcontent-%COMP%]{background:#fff;border-radius:10px;box-shadow:0 11px 15px 5px #000000a1}.carousel-inner[_ngcontent-%COMP%]{border-radius:0 10px 10px 0}.carousel-caption[_ngcontent-%COMP%]{text-align:left;left:5%}.login-sec[_ngcontent-%COMP%]{padding:150px 30px;position:relative}.login-sec[_ngcontent-%COMP%] .copy-text[_ngcontent-%COMP%]{position:absolute;width:80%;bottom:20px;font-size:13px;text-align:center}.login-sec[_ngcontent-%COMP%] .copy-text[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .login-sec[_ngcontent-%COMP%] .copy-text[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#2e56a1}.login-sec[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin-bottom:30px;font-weight:800;font-size:30px;color:#2e56a1}.login-sec[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]:after{content:" ";width:100px;height:5px;background:#2e56a1;display:block;margin-top:20px;border-radius:3px;margin-left:auto;margin-right:auto}.btn-login[_ngcontent-%COMP%]{background:#2e56a1;color:#fff;font-weight:600}.banner-text[_ngcontent-%COMP%]{width:70%;position:absolute;bottom:40px;padding-left:20px}.banner-text[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{color:#fff;font-weight:600}.banner-text[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]:after{content:" ";width:100px;height:5px;background:#FFF;display:block;margin-top:20px;border-radius:3px}.banner-text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#fff}.password-wrapper[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center}.password-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-right:45px}.toggle-password[_ngcontent-%COMP%]{position:absolute;right:10px;border:none;background:transparent;cursor:pointer;font-size:18px;color:#2e56a1;display:flex;align-items:center;justify-content:center;height:100%}.toggle-password[_ngcontent-%COMP%]:focus{outline:none}']}),r})(),canActivate:[m],data:{title:"Inicio de Sesi\xf3n",urls:[]}}]}];let M=(()=>{class r{}return r.\u0275fac=function(o){return new(o||r)},r.\u0275mod=t.oAB({type:r}),r.\u0275inj=t.cJS({imports:[h.ez,a.UX,g.Bz.forChild(y)]}),r})()}}]);
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.