import {J,as as t,f_ as qt,at as Zm,c as tS,G as vl,a7 as si,aM as AD,aA as o$1,g0 as U,aa as ye,Y,ac as Dr,ad as ce,aD as _s}from'./main-WUGO6e7n.js';var W,x,y=J(()=>{t();qt();Zm();tS();vl();si();AD();W=(()=>{class t{constructor(e,r){this.router=e,this.currentUserService=r;}canActivate(e,r){let i=e.data.permissions,u=e.data.securables,v=e.data.isRepositoryDependant,f=e.data.excludePrivateVault,p=e.data.isPamProviderDependant,n=!1;return v&&(n=this.hasAtLeastOneOfTheRequiredRepositoryPermission(i,!f)),p&&(n=this.hasAtLeastOneOfTheRequiredPamProviderPermission(i)),n||(n=u?.length>0?this.hasAtLeastOneOfTheRequiredSecurable(u):this.hasAtLeastOneOfTheRequiredPermission(i)),n||this.router.navigate([o$1.location+"dashboard"]),n}hasAtLeastOneOfTheRequiredPermission(e){return e?.some(r=>this.currentUserService.hasPermission(r))}hasAtLeastOneOfTheRequiredPamProviderPermission(e){return e?.some(r=>this.currentUserService.hasPermissionGlobalOrAnyScoped(r,U.PamProvider))}hasAtLeastOneOfTheRequiredRepositoryPermission(e,r){return e?.some(i=>this.currentUserService.hasPermissionGlobalOrAnyScoped(i,U.Repository,r))}hasAtLeastOneOfTheRequiredSecurable(e){return e?.some(r=>this.currentUserService.hasAnyPermissionOnSecurable(r))}static{this.\u0275fac=function(r){return new(r||t)(ye(Y),ye(Dr))};}static{this.\u0275prov=ce({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})(),x=(()=>{class t{constructor(e,r){this.router=e,this.currentUserService=r;}canActivate(e,r){switch(e.data.page){case _s.Dashboard:return !0;case _s.Vault:return !0;case _s.PrivateVault:return this.redirectToAccessDeniedWhenDenied(this.currentUserService.sectionAccessSnapshot.hasAccessPrivateVault);case _s.Reports:return this.redirectToAccessDeniedWhenDenied(this.currentUserService.sectionAccessSnapshot.hasAccessReports);case _s.Administration:return this.redirectToAccessDeniedWhenDenied(this.currentUserService.sectionAccessSnapshot.hasAccessAdmin);case _s.Pam:return this.redirectToAccessDeniedWhenDenied(this.currentUserService.sectionAccessSnapshot.hasAccessPam);case _s.SystemDashboard:return this.redirectToAccessDeniedWhenDenied(this.currentUserService.sectionAccessSnapshot.hasAccessSystemDashboard)}}redirectToAccessDeniedWhenDenied(e){return e?!0:this.router.createUrlTree(["/access-denied"])}static{this.\u0275fac=function(r){return new(r||t)(ye(Y),ye(Dr))};}static{this.\u0275prov=ce({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();});export{W,x,y};