-
Notifications
You must be signed in to change notification settings - Fork 0
/
985.73472cbf82edef89.js
1 lines (1 loc) · 58.9 KB
/
985.73472cbf82edef89.js
1
"use strict";(self.webpackChunkath=self.webpackChunkath||[]).push([[985],{5736:(z,h,l)=>{l.d(h,{AR:()=>f,pT:()=>d,$w:()=>C,SX:()=>x,YK:()=>v});const f={_id:null,accountNo:null,userId:null,active:!0,owner:null,currency:null,name:null,balance:0,createdAt:null,updatedAt:null},d={_id:null,accountId:null,userId:null,invoiceNo:null,amount:0,status:"Nueva",fincimexId:null,fincimexTax:0,sendFincimex:!1,beneficiaryCard:null,beneficiaryNote:null,remitter:void 0,beneficiary:void 0},C={_id:null,accountId:null,userId:null,reference:null,date:null,valueDate:null,description:null,origin:null,destiny:null,accountOrigin:null,accountDestiny:null,operationType:null,currency:null,initBalance:null,amount:null,endBalance:null},x={_id:null,active:!0,name:null,lastname:null,email:null,password:null,roles:[null]},v={_id:null,invoiceId:"",transactionId:0,reason:"",canceled:!1,fincimexResponse:""}},4985:(z,h,l)=>{l.r(h),l.d(h,{UsersModule:()=>et});var f=l(5303),d=l(5357),C=l(2455),x=l(3680),v=l(3668),s=l(3075),p=l(2722),R=l(9646),b=l(7579),E=l(5119),P=l(4787),S=l(5700),A=l(5736),e=l(5e3),w=l(7967),I=l(7495),V=l(1349),$=l(5620),k=l(5245),u=l(9808),U=l(7423),y=l(1125),_=l(7322),N=l(7531),B=l(4107),L=l(508),Q=l(2368),O=l(7446);function G(n,a){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"a",35),e.\u0275\u0275text(2,"Nuevo"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd())}function W(n,a){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"a",35),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate2("",t.selectedUser.name," ",t.selectedUser.lastname,"")}}function Z(n,a){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1," Nuevo "),e.\u0275\u0275elementContainerEnd())}function K(n,a){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275text(1),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate2(" ",t.selectedUser.name," ",t.selectedUser.lastname," ")}}const H=function(n){return{"cursor-not-allowed":n}};function X(n,a){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",36),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().createUser()}),e.\u0275\u0275element(1,"mat-icon",37),e.\u0275\u0275elementStart(2,"span",38),e.\u0275\u0275text(3,"Guardar"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(3,H,t.userForm.invalid))("disabled",t.userForm.invalid),e.\u0275\u0275advance(1),e.\u0275\u0275property("svgIcon","heroicons_outline:save")}}function Y(n,a){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",39),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().updateUser()}),e.\u0275\u0275element(1,"mat-icon",37),e.\u0275\u0275elementStart(2,"span",38),e.\u0275\u0275text(3,"Actualizar"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("svgIcon","heroicons_outline:refresh"))}function J(n,a){1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1," El nombre es obligatorio. "),e.\u0275\u0275elementEnd())}function q(n,a){1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1," Los apellidos son obligatorios. "),e.\u0275\u0275elementEnd())}function ee(n,a){1&n&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1," El correo electr\xf3nico es obligatorio. "),e.\u0275\u0275elementEnd())}function te(n,a){1&n&&e.\u0275\u0275element(0,"mat-icon",48),2&n&&e.\u0275\u0275property("svgIcon","mat_solid:visibility")}function ne(n,a){1&n&&e.\u0275\u0275element(0,"mat-icon",48),2&n&&e.\u0275\u0275property("svgIcon","mat_solid:visibility_off")}function re(n,a){1&n&&(e.\u0275\u0275elementStart(0,"mat-error",49),e.\u0275\u0275text(1,' La contrase\xf1a deber\xe1 tener entre 8 y 100 caracteres e incluir may\xfasculas, min\xfasculas n\xfameros y s\xedmbolos como: !" ? $ % ^ &. '),e.\u0275\u0275elementEnd())}function oe(n,a){1&n&&(e.\u0275\u0275elementStart(0,"mat-error",49),e.\u0275\u0275text(1," La contrase\xf1a es obligatoria "),e.\u0275\u0275elementEnd())}function ae(n,a){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-error",49),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.userForm.get("password").getError("password")," ")}}function ie(n,a){1&n&&e.\u0275\u0275element(0,"mat-icon",48),2&n&&e.\u0275\u0275property("svgIcon","mat_solid:visibility")}function le(n,a){1&n&&e.\u0275\u0275element(0,"mat-icon",48),2&n&&e.\u0275\u0275property("svgIcon","mat_solid:visibility_off")}function se(n,a){1&n&&(e.\u0275\u0275elementStart(0,"mat-error",49),e.\u0275\u0275text(1,' La contrase\xf1a deber\xe1 tener entre 8 y 100 caracteres e incluir may\xfasculas, min\xfasculas n\xfameros y s\xedmbolos como: !" ? $ % ^ &. '),e.\u0275\u0275elementEnd())}function ce(n,a){1&n&&(e.\u0275\u0275elementStart(0,"mat-error",49),e.\u0275\u0275text(1," La contrase\xf1a es obligatoria "),e.\u0275\u0275elementEnd())}function me(n,a){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-error",49),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.userForm.get("password2").getError("password")," ")}}function de(n,a){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-expansion-panel"),e.\u0275\u0275elementStart(1,"mat-expansion-panel-header",21),e.\u0275\u0275elementStart(2,"mat-panel-title",22),e.\u0275\u0275elementStart(3,"div",23),e.\u0275\u0275text(4," Contrase\xf1a "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",40),e.\u0275\u0275elementStart(6,"div",25),e.\u0275\u0275elementStart(7,"mat-form-field",26),e.\u0275\u0275elementStart(8,"mat-label"),e.\u0275\u0275text(9,"Contrase\xf1a"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(10,"input",41,42),e.\u0275\u0275elementStart(12,"button",43),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const o=e.\u0275\u0275reference(11);return o.type="password"===o.type?"text":"password"}),e.\u0275\u0275template(13,te,1,1,"mat-icon",44),e.\u0275\u0275template(14,ne,1,1,"mat-icon",44),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(15,re,2,0,"mat-error",45),e.\u0275\u0275template(16,oe,2,0,"mat-error",45),e.\u0275\u0275template(17,ae,2,1,"mat-error",45),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(18,"div",25),e.\u0275\u0275elementStart(19,"mat-form-field",26),e.\u0275\u0275elementStart(20,"mat-label"),e.\u0275\u0275text(21,"Confirmar contrase\xf1a"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(22,"input",46,47),e.\u0275\u0275elementStart(24,"button",43),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const o=e.\u0275\u0275reference(23);return o.type="password"===o.type?"text":"password"}),e.\u0275\u0275template(25,ie,1,1,"mat-icon",44),e.\u0275\u0275template(26,le,1,1,"mat-icon",44),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(27,se,2,0,"mat-error",45),e.\u0275\u0275template(28,ce,2,0,"mat-error",45),e.\u0275\u0275template(29,me,2,1,"mat-error",45),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275reference(11),r=e.\u0275\u0275reference(23),o=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("collapsedHeight","56px"),e.\u0275\u0275advance(9),e.\u0275\u0275property("formControlName","password"),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf","password"===t.type),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","text"===t.type),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",o.userForm.get("password").hasError("pattern")),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",o.userForm.get("password").hasError("required")),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",o.userForm.get("password").hasError("password")),e.\u0275\u0275advance(5),e.\u0275\u0275property("formControlName","password2"),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf","password"===r.type),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","text"===r.type),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",o.userForm.get("password2").hasError("pattern")),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",o.userForm.get("password2").hasError("required")),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",o.userForm.get("password2").hasError("password"))}}function pe(n,a){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-checkbox",59),e.\u0275\u0275listener("change",function(o){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).manageRoles(i._id,o)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275property("color","primary")("checked",t.checked)}}function ue(n,a){1&n&&e.\u0275\u0275element(0,"mat-icon",60),2&n&&e.\u0275\u0275property("color","primary")}function _e(n,a){if(1&n&&(e.\u0275\u0275elementStart(0,"div",54),e.\u0275\u0275template(1,pe,1,2,"mat-checkbox",55),e.\u0275\u0275template(2,ue,1,1,"mat-icon",56),e.\u0275\u0275elementStart(3,"div"),e.\u0275\u0275elementStart(4,"span",57),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",58),e.\u0275\u0275text(7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&n){const t=a.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.isCoreRole),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isCoreRole),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.name),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",t.description," ")}}function fe(n,a){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-expansion-panel"),e.\u0275\u0275elementStart(1,"mat-expansion-panel-header",21),e.\u0275\u0275elementStart(2,"mat-panel-title",22),e.\u0275\u0275elementStart(3,"div",23),e.\u0275\u0275text(4," Roles "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",50),e.\u0275\u0275elementStart(6,"div",51),e.\u0275\u0275elementStart(7,"div",52),e.\u0275\u0275template(8,_e,8,4,"div",53),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("collapsedHeight","56px"),e.\u0275\u0275advance(7),e.\u0275\u0275property("ngForOf",t.roles)}}let ge=(()=>{class n{constructor(t,r,o,i,c,m,g,tt){this._activatedRoute=t,this._athConfirmationService=r,this._changeDetectorRef=o,this._formBuilder=i,this._router=c,this._usersService=m,this._roleService=g,this.store=tt,this.dialogMode="view",this.editMode=!1,this.formSubmitted=!1,this.isValid=!1,this.selectedUser=A.SX,this.showAlert=!1,this.userId=null,this.userRoles=[],this.roles=[],this.user$=(0,R.of)(null),this._unsubscribeAll=new b.x}ngOnInit(){this.user$=this.store.select(P.dy),this.user$.pipe((0,p.R)(this._unsubscribeAll)).subscribe(t=>{this.user=t,this._changeDetectorRef.markForCheck()}),this.userForm=this._formBuilder.group({_id:[null],userId:[this.user._id,[s.Validators.required]],active:[!0],name:[null,[s.Validators.required]],lastname:[null,[s.Validators.required]],email:[null,[s.Validators.email,s.Validators.required]],account:[null],password:[null,[s.Validators.pattern(/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/)]],password2:[null,[s.Validators.pattern(/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/)]]},{validators:this.mustMatch("password","password2")}),this.userPasswordForm=this._formBuilder.group({userId:[null,[s.Validators.required]],password:[null,[s.Validators.pattern(/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/)]],password2:[null,[s.Validators.pattern(/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/)]]},{validators:this.mustMatch("password","password2")}),this._activatedRoute.params.pipe((0,p.R)(this._unsubscribeAll)).subscribe(({userId:t})=>{this.userId=t,"new"!==this.userId&&(this.editMode=!0,this._usersService.selectedUser$.pipe((0,p.R)(this._unsubscribeAll)).subscribe(r=>{this.selectedUser=r}),this.userForm.patchValue(this.selectedUser)),this._changeDetectorRef.markForCheck()}),this.editMode||this._roleService.roles$.pipe((0,p.R)(this._unsubscribeAll)).subscribe(t=>{this.roles=t,this._changeDetectorRef.markForCheck()})}ngOnDestroy(){this._unsubscribeAll.next(null),this._unsubscribeAll.complete()}createUser(){let t=this.userForm.getRawValue();t.roles=this.userRoles,t=(0,E.Z)(t,["_id"]),this._athConfirmationService.open({title:"Crear usuario",message:"\xbfEst\xe1 seguro que todos los datos son correctos?",icon:{show:!0,name:"heroicons_outline:question-mark-circle",color:"info"},actions:{confirm:{label:"Aceptar",color:"primary"}}}).afterClosed().pipe((0,p.R)(this._unsubscribeAll)).subscribe(o=>{"confirmed"===o&&this._usersService.createUser(t).pipe((0,p.R)(this._unsubscribeAll)).subscribe(i=>{this._athConfirmationService.open({title:"Confirmaci\xf3n",message:`Usuario ${i.name} ${i.lastname} creado correctamente`,icon:{show:!0,name:"heroicons_outline:check",color:"success"},actions:{confirm:{show:!0,label:"Ok",color:"primary"},cancel:{show:!1}},dismissible:!1}),this._router.navigateByUrl("/users"),this._changeDetectorRef.markForCheck()},i=>{console.warn(i),this._athConfirmationService.open({title:`${i.statusText}: ${i.status}`,message:i.error.title,icon:{show:!0,name:"heroicons_outline:exclamation-circle",color:"error"},actions:{confirm:{show:!0,label:"Ok",color:"primary"},cancel:{show:!1}},dismissible:!1})})}),this._changeDetectorRef.markForCheck()}updateUser(){const t=this.userForm.getRawValue();this._athConfirmationService.open({title:"Actualizar datos del usuario",message:"\xbfEst\xe1 seguro que todos los datos son correctos?",icon:{show:!0,name:"heroicons_outline:question-mark-circle",color:"info"},actions:{confirm:{label:"Aceptar",color:"primary"}}}).afterClosed().subscribe(o=>{"confirmed"===o&&this._usersService.updateUser(t).subscribe(i=>{this._athConfirmationService.open({title:"Confirmaci\xf3n",message:`Usuario ${i.user.name} ${i.user.lastname} actualizado correctamente`,icon:{show:!0,name:"heroicons_outline:check",color:"success"},actions:{confirm:{show:!0,label:"Ok",color:"primary"},cancel:{show:!1}},dismissible:!1}),this._router.navigateByUrl("/users"),this._changeDetectorRef.markForCheck()},i=>{console.warn(i),this._athConfirmationService.open({title:`${i.statusText}: ${i.status}`,message:i.error.title,icon:{show:!0,name:"heroicons_outline:exclamation-circle",color:"error"},actions:{confirm:{show:!0,label:"Ok",color:"primary"},cancel:{show:!1}},dismissible:!1})})}),this._changeDetectorRef.markForCheck()}updateUserPassword(){let t=this.userPasswordForm.getRawValue();t=(0,E.Z)(t,"password2"),this._athConfirmationService.open({title:"Actualizar contrase\xf1a",message:"\xbfEst\xe1 seguro que todos los datos son correctos?",icon:{show:!0,name:"heroicons_outline:question-mark-circle",color:"info"},actions:{confirm:{label:"Aceptar",color:"primary"}}}).afterClosed().subscribe(o=>{"confirmed"===o&&this._usersService.resetUserPassword(t).subscribe(i=>{this._athConfirmationService.open({title:"Confirmaci\xf3n",message:`${i.message}`,icon:{show:!0,name:"heroicons_outline:check",color:"success"},actions:{confirm:{show:!0,label:"Ok",color:"primary"},cancel:{show:!1}},dismissible:!1}),this._changeDetectorRef.markForCheck()},i=>{console.warn(i),this._athConfirmationService.open({title:`${i.statusText}: ${i.status}`,message:i.error.title,icon:{show:!0,name:"heroicons_outline:exclamation-circle",color:"error"},actions:{confirm:{show:!0,label:"Ok",color:"primary"},cancel:{show:!1}},dismissible:!1})})}),this._changeDetectorRef.markForCheck()}trackByFn(t,r){return r.id||t}mustMatch(t,r){return o=>{const i=o.get(t),c=o.get(r);if(!i||!c||(c.hasError("mustMatch")&&(delete c.errors.mustMatch,c.updateValueAndValidity()),this._isEmptyInputValue(c.value)||i.value===c.value))return null;const m={mustMatch:"Las contrase\xf1a no coinciden"};return c.setErrors(m),m}}manageRoles(t,r){r.checked?(this.userRoles.push(t),this._changeDetectorRef.markForCheck()):(this.userRoles.splice(this.userRoles.findIndex(o=>o===t),1),this._changeDetectorRef.markForCheck())}_isEmptyInputValue(t){return null==t||0===t.length}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(d.gz),e.\u0275\u0275directiveInject(w.C),e.\u0275\u0275directiveInject(e.ChangeDetectorRef),e.\u0275\u0275directiveInject(s.FormBuilder),e.\u0275\u0275directiveInject(d.F0),e.\u0275\u0275directiveInject(I.K),e.\u0275\u0275directiveInject(V.N),e.\u0275\u0275directiveInject($.yh))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["ath-user-detail"]],decls:67,vars:32,consts:[["cdkScrollable","",1,"absolute","inset-0","flex","flex-col","min-w-0","overflow-y-auto"],[1,"flex","flex-col","flex-wrap","p-6","sm:flex-row","flex-0","sm:items-center","sm:justify-between","sm:pt-12","sm:px-10","bg-mine-50","dark:bg-transparent"],[1,"flex-1","min-w-0"],[1,"flex-wrap","items-center","hidden","font-medium","sm:flex"],[1,"flex","items-center","ml-1","whitespace-nowrap"],[1,"ml-1","text-primary-700","hover:underline",3,"routerLink"],[1,"icon-size-5","text-secondary",3,"svgIcon"],[4,"ngIf"],[1,"flex","sm:hidden"],[1,"inline-flex","items-center","-ml-1.5","text-secondary","font-medium",3,"routerLink"],[1,"ml-1"],[1,"mt-2"],[1,"mt-2","text-3xl","font-extrabold","leading-tight","tracking-tight","sm:text-3xl","text-mine-900"],[1,"flex","items-center","flex-shrink-0","mt-6","sm:mt-0","sm:ml-4"],["class","ml-4 rounded-sm bg-primary-700 hover:shadow-lg","mat-button","",3,"ngClass","disabled","click",4,"ngIf"],["class","ml-4 rounded-sm bg-primary-700 hover:shadow-lg","mat-button","",3,"click",4,"ngIf"],[1,"flex-auto","p-6","bg-mine-200","shadow","sm:p-10","rounded-t-2xl"],[1,"flex","flex-col","flex-auto","min-w-0"],[3,"formGroup","autocomplete"],[1,"w-full"],[3,"expanded"],[3,"collapsedHeight"],[1,"flex","items-center"],[1,"text-2xl","font-extrabold","leading-tight","tracking-tight","sm:text-2xl"],[1,"grid","w-full","gap-6","p-8","mb-6","border-t-2","sm:grid-cols-4"],[1,"sm:col-span-2"],[1,"w-full","fuse-mat-no-subscript"],["matInput","","required","",3,"type","formControlName","placeholder"],["matInput","","required","",3,"type","formControlName"],[3,"formControlName","placeholder"],[3,"value"],[1,"flex","sm:col-span-2"],[1,"flex","flex-col","w-1/4"],[1,"items-start","font-medium"],[3,"formControlName","color"],[1,"ml-1","text-primary-700"],["mat-button","",1,"ml-4","rounded-sm","bg-primary-700","hover:shadow-lg",3,"ngClass","disabled","click"],[1,"text-mine-900",3,"svgIcon"],[1,"ml-2","mr-1","text-lg","text-mine-900"],["mat-button","",1,"ml-4","rounded-sm","bg-primary-700","hover:shadow-lg",3,"click"],[1,"grid","w-full","gap-6","p-8","mb-6","border-t-2","sm:grid-cols-2","md:grid-cols-4"],["type","password","matInput","","placeholder","Contrase\xf1a","required","",3,"formControlName"],["passwordField1",""],["mat-icon-button","","type","button","matSuffix","",3,"click"],["class","icon-size-5",3,"svgIcon",4,"ngIf"],["class","pb-5",4,"ngIf"],["type","password","matInput","","placeholder","Repita la contrase\xf1a","required","",3,"formControlName"],["passwordField2",""],[1,"icon-size-5",3,"svgIcon"],[1,"pb-5"],[1,"flex","flex-col","w-full","space-y-4","sm:mt-4","sm:space-y-8"],[1,"flex","flex-col","mb-10"],[1,"w-full","gap-4",2,"display","flex","flex-direction","row","flex-wrap","wrap","justify-content","space-between"],["style","\n display: flex;\n word-wrap: anywhere;\n width: 48.5%;\n border: #2f9937;\n border-style: dashed;\n border-width: 1.5px;\n padding: 15px;\n border-radius: 10px;\n ",4,"ngFor","ngForOf"],[2,"display","flex","word-wrap","anywhere","width","48.5%","border","#2f9937","border-style","dashed","border-width","1.5px","padding","15px","border-radius","10px"],[3,"color","checked","change",4,"ngIf"],["svgIcon","heroicons_solid:lock-closed","class","mr-1",3,"color",4,"ngIf"],[1,"font-medium"],[2,"opacity","0.7","font-size","0.8rem !important"],[3,"color","checked","change"],["svgIcon","heroicons_solid:lock-closed",1,"mr-1",3,"color"]],template:function(t,r){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"div",1),e.\u0275\u0275elementStart(2,"div",2),e.\u0275\u0275elementStart(3,"div"),e.\u0275\u0275elementStart(4,"div",3),e.\u0275\u0275elementStart(5,"div",4),e.\u0275\u0275elementStart(6,"a",5),e.\u0275\u0275text(7,"Usuarios"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"div",4),e.\u0275\u0275element(9,"mat-icon",6),e.\u0275\u0275template(10,G,3,0,"ng-container",7),e.\u0275\u0275template(11,W,3,2,"ng-container",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"div",8),e.\u0275\u0275elementStart(13,"a",9),e.\u0275\u0275element(14,"mat-icon",6),e.\u0275\u0275elementStart(15,"span",10),e.\u0275\u0275text(16,"Regresar"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"div",11),e.\u0275\u0275elementStart(18,"div",12),e.\u0275\u0275template(19,Z,2,0,"ng-container",7),e.\u0275\u0275template(20,K,2,2,"ng-container",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"div",13),e.\u0275\u0275template(22,X,4,5,"button",14),e.\u0275\u0275template(23,Y,4,1,"button",15),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(24,"div",16),e.\u0275\u0275elementStart(25,"div",17),e.\u0275\u0275elementStart(26,"form",18),e.\u0275\u0275elementStart(27,"mat-accordion",19),e.\u0275\u0275elementStart(28,"mat-expansion-panel",20),e.\u0275\u0275elementStart(29,"mat-expansion-panel-header",21),e.\u0275\u0275elementStart(30,"mat-panel-title",22),e.\u0275\u0275elementStart(31,"div",23),e.\u0275\u0275text(32," Informaci\xf3n General "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(33,"div",24),e.\u0275\u0275elementStart(34,"div",25),e.\u0275\u0275elementStart(35,"mat-form-field",26),e.\u0275\u0275elementStart(36,"mat-label"),e.\u0275\u0275text(37,"Nombre"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(38,"input",27),e.\u0275\u0275template(39,J,2,0,"mat-error",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(40,"div",25),e.\u0275\u0275elementStart(41,"mat-form-field",26),e.\u0275\u0275elementStart(42,"mat-label"),e.\u0275\u0275text(43,"Apellidos"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(44,"input",28),e.\u0275\u0275template(45,q,2,0,"mat-error",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(46,"div",25),e.\u0275\u0275elementStart(47,"mat-form-field",26),e.\u0275\u0275elementStart(48,"mat-label"),e.\u0275\u0275text(49,"Correo electr\xf3nico"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(50,"input",27),e.\u0275\u0275template(51,ee,2,0,"mat-error",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(52,"div",25),e.\u0275\u0275elementStart(53,"mat-form-field",26),e.\u0275\u0275elementStart(54,"mat-label"),e.\u0275\u0275text(55,"Asignar cuenta"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(56,"mat-select",29),e.\u0275\u0275elementStart(57,"mat-option",30),e.\u0275\u0275text(58," Ninguna "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(59,"div",31),e.\u0275\u0275elementStart(60,"div",32),e.\u0275\u0275elementStart(61,"span",33),e.\u0275\u0275text(62,"Estado"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(63,"mat-slide-toggle",34),e.\u0275\u0275text(64),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(65,de,30,13,"mat-expansion-panel",7),e.\u0275\u0275template(66,fe,9,2,"mat-expansion-panel",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(6),e.\u0275\u0275property("routerLink","/users"),e.\u0275\u0275advance(3),e.\u0275\u0275property("svgIcon","heroicons_solid:chevron-right"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","new"===r.userId),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","new"!==r.userId),e.\u0275\u0275advance(2),e.\u0275\u0275property("routerLink","./.."),e.\u0275\u0275advance(1),e.\u0275\u0275property("svgIcon","heroicons_solid:chevron-left"),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf","new"===r.userId),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","new"!==r.userId),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf","new"===r.userId),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","new"!==r.userId),e.\u0275\u0275advance(3),e.\u0275\u0275property("formGroup",r.userForm)("autocomplete","off"),e.\u0275\u0275advance(2),e.\u0275\u0275property("expanded",!0),e.\u0275\u0275advance(1),e.\u0275\u0275property("collapsedHeight","56px"),e.\u0275\u0275advance(9),e.\u0275\u0275property("type","text")("formControlName","name")("placeholder","Nombre"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.userForm.get("name").hasError("required")),e.\u0275\u0275advance(5),e.\u0275\u0275property("type","text")("formControlName","lastname"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.userForm.get("lastname").hasError("required")),e.\u0275\u0275advance(5),e.\u0275\u0275property("type","email")("formControlName","email")("placeholder","Correo electr\xf3nico"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",r.userForm.get("email").hasError("required")),e.\u0275\u0275advance(5),e.\u0275\u0275property("formControlName","account")("placeholder","Seleccione la cuenta a asignar"),e.\u0275\u0275advance(7),e.\u0275\u0275property("formControlName","active")("color","primary"),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",!0===r.userForm.get("active").value?"Activo":"Inactivo"," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!r.editMode),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!r.editMode))},directives:[f.PQ,d.yS,k.Hw,u.O5,U.lW,u.mk,s.\u0275NgNoValidate,s.NgControlStatusGroup,s.FormGroupDirective,y.pp,y.ib,y.yz,y.yK,_.KE,_.hX,N.Nt,s.DefaultValueAccessor,s.RequiredValidator,s.NgControlStatus,s.FormControlName,_.TO,B.gD,L.ey,Q.Rr,_.R9,u.sg,O.oG],encapsulation:2,data:{animation:S.p},changeDetection:0}),n})();var he=l(6087),F=l(4847),xe=l(8765),D=l(8966),M=l(7238);const ve=["imageFileInput"];function ye(n,a){1&n&&e.\u0275\u0275element(0,"mat-icon",28),2&n&&e.\u0275\u0275property("svgIcon","mat_solid:visibility")}function Ce(n,a){1&n&&e.\u0275\u0275element(0,"mat-icon",28),2&n&&e.\u0275\u0275property("svgIcon","mat_solid:visibility_off")}function be(n,a){1&n&&(e.\u0275\u0275elementStart(0,"mat-error",29),e.\u0275\u0275text(1,' La contrase\xf1a deber\xe1 tener entre 8 y 100 caracteres e incluir may\xfasculas, min\xfasculas n\xfameros y s\xedmbolos como: !" ? $ % ^ &. '),e.\u0275\u0275elementEnd())}function Ee(n,a){1&n&&(e.\u0275\u0275elementStart(0,"mat-error",29),e.\u0275\u0275text(1," La contrase\xf1a es obligatoria "),e.\u0275\u0275elementEnd())}function Se(n,a){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-error",29),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.userPasswordForm.get("password").getError("password")," ")}}function we(n,a){1&n&&e.\u0275\u0275element(0,"mat-icon",28),2&n&&e.\u0275\u0275property("svgIcon","mat_solid:visibility")}function Ie(n,a){1&n&&e.\u0275\u0275element(0,"mat-icon",28),2&n&&e.\u0275\u0275property("svgIcon","mat_solid:visibility_off")}function ke(n,a){1&n&&(e.\u0275\u0275elementStart(0,"mat-error",29),e.\u0275\u0275text(1,' La contrase\xf1a deber\xe1 tener entre 8 y 100 caracteres e incluir may\xfasculas, min\xfasculas n\xfameros y s\xedmbolos como: !" ? $ % ^ &. '),e.\u0275\u0275elementEnd())}function Ue(n,a){1&n&&(e.\u0275\u0275elementStart(0,"mat-error",29),e.\u0275\u0275text(1," La contrase\xf1a es obligatoria "),e.\u0275\u0275elementEnd())}function Fe(n,a){if(1&n&&(e.\u0275\u0275elementStart(0,"mat-error",29),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.userPasswordForm.get("password2").getError("password")," ")}}function De(n,a){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementContainerStart(1),e.\u0275\u0275elementStart(2,"div",14),e.\u0275\u0275elementStart(3,"div",15),e.\u0275\u0275elementStart(4,"div",16),e.\u0275\u0275elementStart(5,"form",17),e.\u0275\u0275elementStart(6,"div",18),e.\u0275\u0275elementStart(7,"div",19),e.\u0275\u0275elementStart(8,"mat-form-field",20),e.\u0275\u0275elementStart(9,"mat-label"),e.\u0275\u0275text(10,"Contrase\xf1a"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(11,"input",21,22),e.\u0275\u0275elementStart(13,"button",23),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const o=e.\u0275\u0275reference(12);return o.type="password"===o.type?"text":"password"}),e.\u0275\u0275template(14,ye,1,1,"mat-icon",24),e.\u0275\u0275template(15,Ce,1,1,"mat-icon",24),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(16,be,2,0,"mat-error",25),e.\u0275\u0275template(17,Ee,2,0,"mat-error",25),e.\u0275\u0275template(18,Se,2,1,"mat-error",25),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(19,"div",19),e.\u0275\u0275elementStart(20,"mat-form-field",20),e.\u0275\u0275elementStart(21,"mat-label"),e.\u0275\u0275text(22,"Confirmar contrase\xf1a "),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(23,"input",26,27),e.\u0275\u0275elementStart(25,"button",23),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const o=e.\u0275\u0275reference(24);return o.type="password"===o.type?"text":"password"}),e.\u0275\u0275template(26,we,1,1,"mat-icon",24),e.\u0275\u0275template(27,Ie,1,1,"mat-icon",24),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(28,ke,2,0,"mat-error",25),e.\u0275\u0275template(29,Ue,2,0,"mat-error",25),e.\u0275\u0275template(30,Fe,2,1,"mat-error",25),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerEnd()}if(2&n){const t=e.\u0275\u0275reference(12),r=e.\u0275\u0275reference(24),o=e.\u0275\u0275nextContext();e.\u0275\u0275advance(5),e.\u0275\u0275property("formGroup",o.userPasswordForm)("autocomplete","off"),e.\u0275\u0275advance(6),e.\u0275\u0275property("formControlName","password"),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf","password"===t.type),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","text"===t.type),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",o.userPasswordForm.get("password").hasError("pattern")),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",o.userPasswordForm.get("password").hasError("required")),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",o.userPasswordForm.get("password").hasError("password")),e.\u0275\u0275advance(5),e.\u0275\u0275property("formControlName","password2"),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf","password"===r.type),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","text"===r.type),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",o.userPasswordForm.get("password2").hasError("pattern")),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",o.userPasswordForm.get("password2").hasError("required")),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",o.userPasswordForm.get("password2").hasError("password"))}}function Te(n,a){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"mat-checkbox",41),e.\u0275\u0275listener("change",function(o){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(2).manageRoles(i._id,o)}),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275property("color","primary")("checked",t.checked)}}function Re(n,a){1&n&&e.\u0275\u0275element(0,"mat-icon",42),2&n&&e.\u0275\u0275property("color","primary")}function Ae(n,a){if(1&n&&(e.\u0275\u0275elementStart(0,"div",34),e.\u0275\u0275elementStart(1,"div",35),e.\u0275\u0275template(2,Te,1,2,"mat-checkbox",36),e.\u0275\u0275template(3,Re,1,1,"mat-icon",37),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",38),e.\u0275\u0275elementStart(5,"span",39),e.\u0275\u0275text(6),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"span",40),e.\u0275\u0275text(8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&n){const t=a.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!t.isCoreRole),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.isCoreRole),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",t.name," "),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",t.description," ")}}function Ve(n,a){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementContainerStart(1),e.\u0275\u0275elementStart(2,"div",14),e.\u0275\u0275elementStart(3,"div",15),e.\u0275\u0275elementStart(4,"div",30),e.\u0275\u0275elementStart(5,"div",31),e.\u0275\u0275elementStart(6,"div",32),e.\u0275\u0275template(7,Ae,9,4,"div",33),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementContainerEnd()),2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(7),e.\u0275\u0275property("ngForOf",t.roles)}}function $e(n,a){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",43),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().updateUser()}),e.\u0275\u0275text(1," Actualizar "),e.\u0275\u0275elementEnd()}2&n&&e.\u0275\u0275property("matTooltip","Actualizar")}function Ne(n,a){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",44),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().updateUserPassword()}),e.\u0275\u0275text(1," Actualizar contrase\xf1a "),e.\u0275\u0275elementEnd()}if(2&n){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("disabled",t.userPasswordForm.invalid)("matTooltip","Actualizar")}}let Oe=(()=>{class n{constructor(t,r,o,i,c,m,g){this.data=t,this._dialogRef=r,this._changeDetectorRef=o,this._formBuilder=i,this._athConfirmationService=c,this._userService=m,this._roleService=g,this.showAlert=!1,this.dialogMode="edit",this.roles=[],this.userRoles=[],this.titles=[],this.isValid=!1,this.formSubmitted=!1,this._unsubscribeAll=new b.x,this.dialogMode=t.dialogMode,this.selectedUser=t.user}ngOnInit(){"editPass"===this.dialogMode?this.userPasswordForm=this._formBuilder.group({userId:[this.selectedUser._id,[s.Validators.required]],password:[null,[s.Validators.pattern(/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/)]],password2:[null,[s.Validators.pattern(/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/)]]},{validators:this.mustMatch("password","password2")}):this._roleService.roles$.pipe((0,p.R)(this._unsubscribeAll)).subscribe(t=>{t.forEach(r=>{r.checked=this.selectedUser.roles.some(o=>o._id===r._id),r.checked&&this.userRoles.push(r._id)}),this.roles=t,this._changeDetectorRef.markForCheck()})}ngOnDestroy(){this._unsubscribeAll.next(null),this._unsubscribeAll.complete()}closeDialog(){this._dialogRef.close()}updateUser(){this._athConfirmationService.open({title:"Actualizar roles de usuario",message:"\xbfEsta seguro que todos los datos son correctos?",icon:{show:!0,name:"heroicons_outline:question-mark-circle",color:"info"},actions:{confirm:{label:"Aceptar",color:"primary"}}}).afterClosed().subscribe(r=>{"confirmed"===r&&this._userService.updateUserRoles(this.selectedUser._id,this.userRoles).subscribe(o=>{this._athConfirmationService.open({title:"Confirmaci\xf3n",message:`Roles del usuario ${o.name} ${o.lastName} actualizados correctamente`,icon:{show:!0,name:"heroicons_outline:check",color:"success"},actions:{confirm:{show:!0,label:"Ok",color:"primary"},cancel:{show:!1}},dismissible:!1}),this.closeDialog(),this._changeDetectorRef.markForCheck()},o=>{console.warn(o),this._athConfirmationService.open({title:`${o.statusText}: ${o.status}`,message:o.error.title,icon:{show:!0,name:"heroicons_outline:exclamation-circle",color:"error"},actions:{confirm:{show:!0,label:"Ok",color:"primary"},cancel:{show:!1}},dismissible:!1})})}),this._changeDetectorRef.markForCheck()}updateUserPassword(){let t=this.userPasswordForm.getRawValue();t=(0,E.Z)(t,"password2"),this._athConfirmationService.open({title:"Actualizar contrase\xf1a",message:"\xbfEst\xe1 seguro que todos los datos son correctos?",icon:{show:!0,name:"heroicons_outline:question-mark-circle",color:"info"},actions:{confirm:{label:"Aceptar",color:"primary"}}}).afterClosed().subscribe(o=>{"confirmed"===o&&this._userService.resetUserPassword(t).subscribe(i=>{this._athConfirmationService.open({title:"Confirmaci\xf3n",message:`${i.message}`,icon:{show:!0,name:"heroicons_outline:check",color:"success"},actions:{confirm:{show:!0,label:"Ok",color:"primary"},cancel:{show:!1}},dismissible:!1}),this.closeDialog(),this._changeDetectorRef.markForCheck()},i=>{console.warn(i),this._athConfirmationService.open({title:`${i.statusText}: ${i.status}`,message:i.error.title,icon:{show:!0,name:"heroicons_outline:exclamation-circle",color:"error"},actions:{confirm:{show:!0,label:"Ok",color:"primary"},cancel:{show:!1}},dismissible:!1})})}),this._changeDetectorRef.markForCheck()}trackByFn(t,r){return r.id||t}manageRoles(t,r){r.checked?(this.userRoles.push(t),this._changeDetectorRef.markForCheck()):(this.userRoles.splice(this.userRoles.findIndex(o=>o===t),1),this._changeDetectorRef.markForCheck())}mustMatch(t,r){return o=>{const i=o.get(t),c=o.get(r);if(!i||!c||(c.hasError("mustMatch")&&(delete c.errors.mustMatch,c.updateValueAndValidity()),this._isEmptyInputValue(c.value)||i.value===c.value))return null;const m={mustMatch:"Las contrase\xf1a no coinciden"};return c.setErrors(m),m}}_isEmptyInputValue(t){return null==t||0===t.length}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(D.WI),e.\u0275\u0275directiveInject(D.so),e.\u0275\u0275directiveInject(e.ChangeDetectorRef),e.\u0275\u0275directiveInject(s.FormBuilder),e.\u0275\u0275directiveInject(w.C),e.\u0275\u0275directiveInject(I.K),e.\u0275\u0275directiveInject(V.N))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["user-role-dialog"]],viewQuery:function(t,r){if(1&t&&e.\u0275\u0275viewQuery(ve,5),2&t){let o;e.\u0275\u0275queryRefresh(o=e.\u0275\u0275loadQuery())&&(r._imageFileInput=o.first)}},decls:19,vars:10,consts:[[1,"relative","flex","flex-col","w-full","max-h-screen"],[1,"flex","flex-col","items-center","flex-auto","w-full"],[1,"w-full","py-5","px-12"],[1,"flex","w-full"],[1,"flex","flex-col","justify-end","w-4/5","my-2"],[1,"text-2xl","font-bold","truncate","sm:text-2xl"],[1,"flex","text-xl","font-normal","text-red-900","truncate","cursor-pointer","hover:underline"],[1,"mr-2.5","text-mine-900",3,"svgIcon"],["target","_blank",1,"text-mine-900","hover:text-primary-700",3,"href"],[4,"ngIf"],[1,"flex","items-center","justify-between","w-full","px-8","py-4","sm:px-12","bg-gray-50","dark:bg-transparent"],["mat-button","",1,"rounded-sm",3,"matTooltip","click"],["mat-flat-button","","class","rounded-sm text-mine-900 bg-primary-700",3,"matTooltip","click",4,"ngIf"],["mat-button","","class","rounded-sm text-mine-900 bg-primary-700",3,"disabled","matTooltip","click",4,"ngIf"],[1,"flex","flex-col","border-t","gap-y-5"],[1,"flex","flex-col","w-full","gap-8","md:flex-row"],[1,"flex","flex-col","w-full","space-y-4"],[1,"flex","flex-col",3,"formGroup","autocomplete"],[1,"flex","flex-col","w-full","gap-4","mt-5","mb-2"],[1,"w-full"],[1,"w-full","fuse-mat-no-subscript"],["type","password","matInput","","placeholder","Contrase\xf1a","required","",3,"formControlName"],["passwordUpdateField1",""],["mat-icon-button","","type","button","matSuffix","",3,"click"],["class","icon-size-5",3,"svgIcon",4,"ngIf"],["class","pb-5",4,"ngIf"],["type","password","matInput","","placeholder","Repita la contrase\xf1a","required","",3,"formControlName"],["passwordUpdateField2",""],[1,"icon-size-5",3,"svgIcon"],[1,"pb-5"],[1,"flex","flex-col","w-full","pt-6","space-y-4","sm:mt-4","sm:space-y-8"],[1,"flex","flex-col","mb-10"],[1,"w-full","gap-4","grid","grid-cols-2"],["class","rounded-sm border border-dashed border-primary-700 p-3 ",4,"ngFor","ngForOf"],[1,"rounded-sm","border","border-dashed","border-primary-700","p-3"],[1,"h-6"],[3,"color","checked","change",4,"ngIf"],["svgIcon","heroicons_solid:lock-closed",3,"color",4,"ngIf"],[1,"flex","flex-col"],[1,"font-medium"],[1,"text-md","text-hint"],[3,"color","checked","change"],["svgIcon","heroicons_solid:lock-closed",3,"color"],["mat-flat-button","",1,"rounded-sm","text-mine-900","bg-primary-700",3,"matTooltip","click"],["mat-button","",1,"rounded-sm","text-mine-900","bg-primary-700",3,"disabled","matTooltip","click"]],template:function(t,r){1&t&&(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\u0275elementStart(4,"div",4),e.\u0275\u0275elementStart(5,"span",5),e.\u0275\u0275text(6),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"span",6),e.\u0275\u0275element(8,"mat-icon",7),e.\u0275\u0275elementStart(9,"a",8),e.\u0275\u0275text(10),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(11,De,31,14,"ng-container",9),e.\u0275\u0275template(12,Ve,8,1,"ng-container",9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerStart(13),e.\u0275\u0275elementStart(14,"div",10),e.\u0275\u0275elementStart(15,"button",11),e.\u0275\u0275listener("click",function(){return r.closeDialog()}),e.\u0275\u0275text(16," Cancelar "),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(17,$e,2,1,"button",12),e.\u0275\u0275template(18,Ne,2,2,"button",13),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(6),e.\u0275\u0275textInterpolate2(" ",r.selectedUser.name," ",r.selectedUser.lastname," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("svgIcon","heroicons_outline:mail"),e.\u0275\u0275advance(1),e.\u0275\u0275property("href","mailto:"+r.selectedUser.email,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate(r.selectedUser.email),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","editPass"===r.dialogMode),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","edit"===r.dialogMode),e.\u0275\u0275advance(3),e.\u0275\u0275property("matTooltip","Cancelar"),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf","edit"===r.data.dialogMode),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","editPass"===r.data.dialogMode))},directives:[k.Hw,u.O5,s.\u0275NgNoValidate,s.NgControlStatusGroup,s.FormGroupDirective,_.KE,_.hX,N.Nt,s.DefaultValueAccessor,s.RequiredValidator,s.NgControlStatus,s.FormControlName,U.lW,_.R9,_.TO,u.sg,O.oG,M.gM],encapsulation:2,data:{animation:S.p},changeDetection:0}),n})();var Me=l(1927),T=l(2181);function je(n,a){1&n&&e.\u0275\u0275element(0,"mat-icon",44),2&n&&e.\u0275\u0275property("color","primary")}function ze(n,a){if(1&n&&(e.\u0275\u0275elementStart(0,"div",45),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&n){const t=e.\u0275\u0275nextContext().$implicit,r=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",r.getAccountName(t._id)," ")}}function Pe(n,a){1&n&&(e.\u0275\u0275elementStart(0,"div",46),e.\u0275\u0275text(1," No posee ninguna cuenta asociada "),e.\u0275\u0275elementEnd())}function Be(n,a){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275element(1,"mat-icon",47),e.\u0275\u0275elementContainerEnd()),2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("svgIcon","heroicons_solid:check"))}function Le(n,a){1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275element(1,"mat-icon",48),e.\u0275\u0275elementContainerEnd()),2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("svgIcon","heroicons_solid:x"))}function Qe(n,a){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",49),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const o=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(3).createOrEditUser(o._id)}),e.\u0275\u0275element(1,"mat-icon",23),e.\u0275\u0275elementEnd()}2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("svgIcon","heroicons_solid:pencil"))}function Ge(n,a){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",50),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const o=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(3).openDialog(o,"edit","720px")}),e.\u0275\u0275element(1,"mat-icon",23),e.\u0275\u0275elementEnd()}2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("svgIcon","heroicons_solid:shield-check"))}function We(n,a){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"button",51),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const o=e.\u0275\u0275nextContext().$implicit;return e.\u0275\u0275nextContext(3).deleteUser(o)}),e.\u0275\u0275element(1,"mat-icon",23),e.\u0275\u0275elementEnd()}2&n&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("svgIcon","heroicons_solid:trash"))}function Ze(n,a){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"div",34),e.\u0275\u0275elementStart(2,"div",35),e.\u0275\u0275template(3,je,1,1,"mat-icon",36),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",29),e.\u0275\u0275text(6),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(7,ze,2,1,"div",37),e.\u0275\u0275template(8,Pe,2,0,"div",38),e.\u0275\u0275elementStart(9,"div",30),e.\u0275\u0275template(10,Be,2,1,"ng-container",32),e.\u0275\u0275template(11,Le,2,1,"ng-container",32),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"div",39),e.\u0275\u0275template(13,Qe,2,1,"button",40),e.\u0275\u0275elementStart(14,"button",41),e.\u0275\u0275listener("click",function(){const i=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275nextContext(3).openDialog(i,"editPass","720px")}),e.\u0275\u0275element(15,"mat-icon",23),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(16,Ge,2,1,"button",42),e.\u0275\u0275template(17,We,2,1,"button",43),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()}if(2&n){const t=a.$implicit,r=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",r.checkAdmin(t)),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate2(" ",t.name," ",t.lastname," "),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",t.email," "),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null!==t._id),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null===t._id),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.active),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!t.active),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",!r.checkAdmin(t)),e.\u0275\u0275advance(2),e.\u0275\u0275property("svgIcon","heroicons_solid:key"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!r.checkAdmin(t)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!r.checkAdmin(t))}}function Ke(n,a){if(1&n&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,Ze,18,12,"ng-container",33),e.\u0275\u0275elementContainerEnd()),2&n){const t=a.ngIf,r=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t)("ngForTrackBy",r.trackByFn)}}function He(n,a){if(1&n){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"div",19),e.\u0275\u0275elementStart(2,"div",20),e.\u0275\u0275text(3,"Listado de usuarios"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",21),e.\u0275\u0275elementStart(5,"button",22),e.\u0275\u0275element(6,"mat-icon",23),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"mat-menu",null,24),e.\u0275\u0275elementStart(9,"button",25),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().exportAsExcelFile()}),e.\u0275\u0275text(10,"Exportar a excel"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(11,"button",25),e.\u0275\u0275listener("click",function(){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext().exportAsCsvFile()}),e.\u0275\u0275text(12,"Exportar a csv"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"div",26),e.\u0275\u0275elementStart(14,"div",27),e.\u0275\u0275elementStart(15,"div",28),e.\u0275\u0275text(16," Nombre y Apellidos "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(17,"div",29),e.\u0275\u0275text(18," Correo electr\xf3nico "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(19,"div",30),e.\u0275\u0275text(20," Cuenta "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"div",30),e.\u0275\u0275text(22," Activo "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"div",31),e.\u0275\u0275text(24," Acciones "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(25,Ke,2,2,"ng-container",32),e.\u0275\u0275pipe(26,"async"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()}if(2&n){const t=e.\u0275\u0275reference(8),r=e.\u0275\u0275nextContext();e.\u0275\u0275advance(5),e.\u0275\u0275property("matMenuTriggerFor",t),e.\u0275\u0275advance(1),e.\u0275\u0275property("svgIcon","heroicons_solid:dots-vertical"),e.\u0275\u0275advance(9),e.\u0275\u0275property("mat-sort-header","name"),e.\u0275\u0275advance(10),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(26,4,r.users$))}}function Xe(n,a){1&n&&(e.\u0275\u0275elementStart(0,"div",52),e.\u0275\u0275text(1,"A\xfan no hay usuarios para esta aplicaci\xf3n!"),e.\u0275\u0275elementEnd())}let Ye=(()=>{class n{constructor(t,r,o,i,c,m,g){this._changeDetectorRef=t,this._athConfirmationService=r,this._fileSaverService=o,this._router=i,this._userDialog=c,this._userService=m,this.store=g,this.emptyUser=A.SX,this.searchInputControl=new s.FormControl,this.selectedUser=null,this.users=[],this.users$=(0,R.of)([]),this._unsubscribeAll=new b.x}ngOnInit(){this.users$=this.store.select(xe.Y),this.users$.pipe((0,p.R)(this._unsubscribeAll)).subscribe(t=>{this.users=t,this._changeDetectorRef.markForCheck()})}ngAfterViewInit(){}ngOnDestroy(){this._unsubscribeAll.next(null),this._unsubscribeAll.complete()}createOrEditUser(t="new"){this._router.navigateByUrl(`/users/${t}`)}deleteUser(t){this._athConfirmationService.open({title:"Eliminar Usuario",message:`\xbfEst\xe1 seguro que desea eliminar el usuario ${t.name} ${t.lastname}?`,icon:{show:!0,name:"heroicons_outline:question-mark-circle",color:"info"},actions:{confirm:{label:"Aceptar",color:"primary"}}}).afterClosed().subscribe(o=>{"confirmed"===o&&this._userService.deleteUser(t._id).subscribe(i=>{!i||(this._athConfirmationService.open({title:"Confirmaci\xf3n",message:`Usuario ${t.name} ${t.lastname} eliminado correctamente`,icon:{show:!0,name:"heroicons_outline:check",color:"success"},actions:{confirm:{show:!0,label:"Ok",color:"primary"},cancel:{show:!1}},dismissible:!1}),this._changeDetectorRef.markForCheck())},i=>{this._athConfirmationService.open({title:`${i.statusText}: ${i.status}`,message:i.error.message,icon:{show:!0,name:"heroicons_outline:exclamation-circle",color:"error"},actions:{confirm:{show:!0,label:"Ok",color:"primary"},cancel:{show:!1}},dismissible:!1})})}),this._changeDetectorRef.markForCheck()}exportAsExcelFile(){this._fileSaverService.exportAsExcelFile(this.users,"users")}exportAsCsvFile(){this._fileSaverService.exportAsCsvFile(this.users,"users")}trackByFn(t,r){return r.id||t}getAccountName(t){}openDialog(t,r,o){this._userDialog.open(Oe,{data:{user:t,dialogMode:r},width:o,panelClass:"ath-dialog-panel"})}checkAdmin(t){return t.roles.some(r=>r.isCoreRole)}}return n.\u0275fac=function(t){return new(t||n)(e.\u0275\u0275directiveInject(e.ChangeDetectorRef),e.\u0275\u0275directiveInject(w.C),e.\u0275\u0275directiveInject(Me.m),e.\u0275\u0275directiveInject(d.F0),e.\u0275\u0275directiveInject(D.uw),e.\u0275\u0275directiveInject(I.K),e.\u0275\u0275directiveInject($.yh))},n.\u0275cmp=e.\u0275\u0275defineComponent({type:n,selectors:[["ath-users"]],viewQuery:function(t,r){if(1&t&&(e.\u0275\u0275viewQuery(he.NW,5),e.\u0275\u0275viewQuery(F.YE,5)),2&t){let o;e.\u0275\u0275queryRefresh(o=e.\u0275\u0275loadQuery())&&(r._paginator=o.first),e.\u0275\u0275queryRefresh(o=e.\u0275\u0275loadQuery())&&(r._sort=o.first)}},decls:27,vars:7,consts:[["cdkScrollable","",1,"absolute","inset-0","flex","flex-col","min-w-0","overflow-y-auto"],[1,"flex","flex-col","flex-wrap","p-6","sm:flex-row","flex-0","sm:items-center","sm:justify-between","pb-22","sm:pt-12","sm:pb-28","sm:px-10","bg-mine-50","dark:bg-transparent"],[1,"flex-1","min-w-0"],[1,"flex-wrap","items-center","hidden","font-medium","sm:flex"],[1,"whitespace-nowrap","text-primary-700"],[1,"flex","sm:hidden"],[1,"inline-flex","items-center","-ml-1.5","text-secondary","font-medium",3,"routerLink"],[1,"icon-size-5","text-secondary",3,"svgIcon"],[1,"ml-1"],[1,"mt-2"],[1,"text-3xl","font-extrabold","leading-7","tracking-tight","truncate","md:text-4xl","sm:leading-10"],[1,"flex","items-center","flex-shrink-0","mt-6","sm:mt-0","sm:ml-4"],["mat-button","",1,"ml-4","rounded-sm","bg-primary-700",3,"click"],[1,"text-mine-900",3,"svgIcon"],[1,"ml-2","mr-1","text-lg","text-mine-900"],[1,"flex-auto","p-6","-mt-16","bg-mine-200","shadow","sm:p-10","rounded-t-2xl"],[1,"w-full","p-16","shadow","rounded-2xl","bg-card","print:w-auto","print:rounded-none","print:shadow-none","print:bg-transparent"],[4,"ngIf","ngIfElse"],["noUsers",""],[1,"flex","items-center","justify-between","mb-5"],[1,"text-2xl","font-semibold","leading-tight"],[1,"-mr-3"],["mat-icon-button","",3,"matMenuTriggerFor"],[1,"icon-size-5",3,"svgIcon"],["listUsersMenu","matMenu"],["mat-menu-item","",3,"click"],[1,"grid"],["matSort","","matSortDisableClear","",1,"sticky","top-0","z-10","grid","gap-4","px-6","py-4","font-semibold","shadow","users-grid","md:px-8","text-md","text-secondary","bg-mine-50","dark:bg-black","dark:bg-opacity-5"],[3,"mat-sort-header"],[1,"hidden","truncate","md:block"],[1,"hidden","text-center","lg:block"],[1,"text-center"],[4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"grid","items-center","gap-4","px-6","py-3","border-b","users-grid","md:px-8"],[1,"truncate","flex"],["svgIcon","heroicons_solid:fire","class","mr-1",3,"color",4,"ngIf"],["class","hidden lg:block",4,"ngIf"],["class","hidden md:block",4,"ngIf"],[1,"flex","flex-col","justify-center","gap-1","sm:flex-row"],["class","px-2 leading-6 min-w-10 min-h-7 h-7","mat-stroked-button","","matTooltip","Editar",3,"click",4,"ngIf"],["mat-stroked-button","","matTooltip","Cambiar contrase\xf1a",1,"px-2","leading-6","min-w-10","min-h-7","h-7",3,"click"],["class","px-2 leading-6 min-w-10 min-h-7 h-7","mat-stroked-button","","matTooltip","Asignar Roles",3,"click",4,"ngIf"],["class","px-2 leading-6 min-w-10 min-h-7 h-7","mat-stroked-button","","matTooltip","Eliminar",3,"click",4,"ngIf"],["svgIcon","heroicons_solid:fire",1,"mr-1",3,"color"],[1,"hidden","lg:block"],[1,"hidden","md:block"],[1,"text-green-400","icon-size-5",3,"svgIcon"],[1,"text-red-400","icon-size-5",3,"svgIcon"],["mat-stroked-button","","matTooltip","Editar",1,"px-2","leading-6","min-w-10","min-h-7","h-7",3,"click"],["mat-stroked-button","","matTooltip","Asignar Roles",1,"px-2","leading-6","min-w-10","min-h-7","h-7",3,"click"],["mat-stroked-button","","matTooltip","Eliminar",1,"px-2","leading-6","min-w-10","min-h-7","h-7",3,"click"],[1,"p-8","text-4xl","font-semibold","tracking-tight","text-center","sm:p-16"]],template:function(t,r){if(1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275elementStart(1,"div",1),e.\u0275\u0275elementStart(2,"div",2),e.\u0275\u0275elementStart(3,"div"),e.\u0275\u0275elementStart(4,"div",3),e.\u0275\u0275elementStart(5,"div"),e.\u0275\u0275elementStart(6,"a",4),e.\u0275\u0275text(7,"Usuarios"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"div",5),e.\u0275\u0275elementStart(9,"a",6),e.\u0275\u0275element(10,"mat-icon",7),e.\u0275\u0275elementStart(11,"span",8),e.\u0275\u0275text(12,"Regresar"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(13,"div",9),e.\u0275\u0275elementStart(14,"h2",10),e.\u0275\u0275text(15," Listado de usuarios "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"div",11),e.\u0275\u0275elementStart(17,"button",12),e.\u0275\u0275listener("click",function(){return r.createOrEditUser()}),e.\u0275\u0275element(18,"mat-icon",13),e.\u0275\u0275elementStart(19,"span",14),e.\u0275\u0275text(20,"Nuevo"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"div",15),e.\u0275\u0275elementStart(22,"div",16),e.\u0275\u0275template(23,He,27,6,"ng-container",17),e.\u0275\u0275pipe(24,"async"),e.\u0275\u0275template(25,Xe,2,0,"ng-template",null,18,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementEnd()),2&t){const o=e.\u0275\u0275reference(26);e.\u0275\u0275advance(9),e.\u0275\u0275property("routerLink","./.."),e.\u0275\u0275advance(1),e.\u0275\u0275property("svgIcon","heroicons_solid:chevron-left"),e.\u0275\u0275advance(8),e.\u0275\u0275property("svgIcon","heroicons_outline:plus"),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",e.\u0275\u0275pipeBind1(24,5,r.users$).length>0)("ngIfElse",o)}},directives:[f.PQ,d.yS,k.Hw,U.lW,u.O5,T.p6,T.VK,T.OP,F.YE,F.nU,u.sg,M.gM],pipes:[u.Ov],encapsulation:2,data:{animation:S.p},changeDetection:0}),n})();var j=l(5497);const Je=[{path:"",component:Ye,resolve:{users:j.o,roles:v.N}},{path:":userId",component:ge,resolve:{user:j.O,roles:v.N}}],qe={suppressScrollX:!0};let et=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.\u0275\u0275defineNgModule({type:n}),n.\u0275inj=e.\u0275\u0275defineInjector({providers:[{provide:x.op,useValue:qe}],imports:[[f.ZD,d.Bz.forChild(Je),C.m,x.Xd]]}),n})()}}]);