import {J,a5 as fh,fL as x,c as tS,ag as lp,H as ul,a7 as si,b3 as w,fM as F,ah as ot,aa as ye,am as Dh,N as Sr,ac as Dr,bd as K,ad as ce,a6 as pi,ec as ND,aw as fa,aM as AD,ei as I4,aB as ce$1,aJ as hf,al as Kv,ak as Jd,aN as r4}from'./main-WUGO6e7n.js';var H,L=J(()=>{fh();x();tS();lp();ul();si();w();H=(()=>{class i extends F{constructor(e,s,h,I){super(s,I,h),this.assetServices=e;}getAll(e=!1){return this.getCache(e,this.assetServices.AdministrativePermissionDefinitionsGetAll().pipe(ot(s=>s.data)))}static{this.\u0275fac=function(s){return new(s||i)(ye(Dh),ye(Sr),ye(Dr),ye(K))};}static{this.\u0275prov=ce({token:i,factory:i.\u0275fac,providedIn:"root"});}}return i})();});var C,T=J(()=>{pi();fh();ND();fa();tS();lp();AD();w();ul();C=class i extends I4{static{this.customRoleFeatureFlag="AdministrativeRoleAssignmentsCustom";}static{this.customRoleManagementPermissions=new Set([ce$1.AdministrativeRolesAdd,ce$1.AdministrativeRolesEdit,ce$1.AdministrativeRolesDelete]);}constructor(t,e,s,h){super(h,s),this.assetServices=t,this.serverInformationService=e;}get isCustomRoleManagementEnabled(){return this.serverInformationService.isFeatureFlagEnabled(i.customRoleFeatureFlag)}filterSelectablePermissions(t){return this.isCustomRoleManagementEnabled?t:t.filter(e=>!i.customRoleManagementPermissions.has(e.permission))}getAllRoles(){return this.assetServices.AdministrativeRolesGetAll().pipe(hf(t=>this.handleGetApiResult(t)),ot(t=>this.returnWhenSuccessful(t,()=>t.data)))}addRole(t){return this.isCustomRoleManagementEnabled?this.assetServices.AdministrativeRolesAdd(t).pipe(hf(e=>this.handleSaveApiResult(e)),ot(e=>this.returnWhenSuccessful(e,()=>e.data))):Kv(null)}updateRole(t,e){return this.isCustomRoleManagementEnabled?this.assetServices.AdministrativeRolesUpdate(t,e).pipe(hf(s=>this.handleSaveApiResult(s)),ot(s=>this.isSuccessful(s))):Kv(!1)}getLogs(t){return this.assetServices.AdministrativeRolesGetLogs(t).pipe(hf(e=>this.handleGetApiResult(e)),ot(e=>this.returnWhenSuccessful(e,()=>e.data)))}deleteRole(t){return this.isCustomRoleManagementEnabled?this.assetServices.AdministrativeRolesDelete(t).pipe(hf(e=>this.handleDeleteApiResult(e)),ot(e=>this.isSuccessful(e)),Jd(()=>Kv(!1))):Kv(!1)}exportRoles(t){return this.assetServices.AdministrativeRolesExport(t).pipe(ot(e=>new Blob([e],{type:"text/csv"})),Jd(()=>Kv(null)))}exportRolesWithPermissions(t){return this.assetServices.AdministrativeRolesExportPermissions(t).pipe(ot(e=>new Blob([e],{type:"text/html"})),Jd(()=>Kv(null)))}static{this.\u0275fac=function(e){return new(e||i)(ye(Dh),ye(r4),ye(K),ye(Sr))};}static{this.\u0275prov=ce({token:i,factory:i.\u0275fac,providedIn:"root"});}};});export{C,H,L,T};