import{D as A,E as I}from"./chunk-I7GW4F3B.js";import{a as m,b as W,m as v,n as j}from"./chunk-SM7EQ7ST.js";import{c as f,d as y}from"./chunk-RWCAFOHA.js";import{Gk as S,Hk as x}from"./chunk-BPZQKZKD.js";import{b as d,c as M}from"./chunk-YBNTOQCK.js";import{O as p,Sa as E,be as G,ha as c,ka as r,na as g,r as s,ta as o,x as i,xa as u}from"./chunk-WL5U2YIT.js";import{e as R}from"./chunk-ADEKKGI2.js";var C,B=R(()=>{g();E();W();G();x();j();I();y();M();C=(()=>{let l=class l extends m{constructor(t,e,n,a,b){super(b,a),this.assetServices=t,this.serverInformationService=e,this.currentUserService=n}get isEnabled(){return this.serverInformationService.isFeatureFlagEnabled(l.featureFlag)}getPagedRoleScopeList(t){return this.isEnabled?this.assetServices.GetPagedRoleScopeList(t).pipe(r(e=>this.handleGetApiResult(e)),i(e=>this.returnWhenSuccessful(e,()=>e.data))):s(null)}getMembers(t,e,n){return this.isEnabled?this.assetServices.GetMembers(t,e,n).pipe(r(a=>this.handleGetApiResult(a)),i(a=>this.returnWhenSuccessful(a,()=>a.data))):s([])}addMember(t){return this.isEnabled?this.assetServices.AddMember(t).pipe(r(e=>this.handleSaveApiResult(e)),i(e=>this.isSuccessful(e))):s(!1)}deleteScope(t,e,n){return this.isEnabled?this.assetServices.DeleteScope(t,e,n).pipe(r(a=>this.handleDeleteApiResult(a)),i(a=>this.isSuccessful(a))):s(!1)}removeMember(t){return this.isEnabled?this.assetServices.RemoveMember(t).pipe(r(e=>this.handleDeleteApiResult(e)),i(e=>this.isSuccessful(e))):s(!1)}bulkUpdateMembers(t){return this.isEnabled?this.assetServices.BulkUpdateMembers(t).pipe(r(e=>this.handleSaveApiResult(e)),i(e=>this.isSuccessful(e))):s(!1)}getValidScopeTypes(t){return this.isEnabled?this.assetServices.GetValidScopeTypes(t).pipe(r(e=>this.handleGetApiResult(e)),i(e=>this.returnWhenSuccessful(e,()=>e.data))):s([])}getAvailableRoles(){return this.isEnabled?this.assetServices.GetAvailableRoles().pipe(r(t=>this.handleGetApiResult(t)),i(t=>this.returnWhenSuccessful(t,()=>t.data))):s([])}getMyRoleAssignments(t=!1){return this.isEnabled?t?this.currentUserService.refreshAdministrativePermissions().pipe(c(e=>this.assetServices.GetMyRoleAssignments(t)),r(e=>this.handleGetApiResult(e)),i(e=>this.returnWhenSuccessful(e,()=>e.data))):this.assetServices.GetMyRoleAssignments(t).pipe(r(e=>this.handleGetApiResult(e)),i(e=>this.returnWhenSuccessful(e,()=>e.data))):s([])}getByAssigneeId(t,e=!1){return this.isEnabled?this.assetServices.GetByAssignee(t,e).pipe(r(n=>this.handleGetApiResult(n)),i(n=>this.returnWhenSuccessful(n,()=>n.data))):s([])}getLogs(t){return this.isEnabled?this.assetServices.GetAdministrativeRoleAssignmentLogs(t).pipe(r(e=>this.handleGetApiResult(e)),i(e=>this.returnWhenSuccessful(e,()=>e.data))):s([])}exportRoleScopeList(t){return this.isEnabled?this.assetServices.GetAdministrativeRoleAssignmentsExport(t).pipe(i(e=>new Blob([e],{type:"text/csv"})),p(()=>s(null))):s(null)}getVaultRoleAssignmentReport(t){return this.isEnabled?this.assetServices.AdministrativeRoleAssignments_GetVaultRoleAssignmentReport(t).pipe(r(e=>this.handleGetApiResult(e)),i(e=>this.returnWhenSuccessful(e,()=>e.data))):s(null)}exportVaultRoleAssignmentReport(t){return this.isEnabled?this.assetServices.AdministrativeRoleAssignments_ExportVaultRoleAssignmentReport(t).pipe(i(e=>new Blob([e],{type:"text/csv"})),p(()=>s(null))):s(null)}};l.featureFlag="AdministrativeRoleAssignments",l.\u0275fac=function(e){return new(e||l)(u(S),u(v),u(A),u(f),u(d))},l.\u0275prov=o({token:l,factory:l.\u0275fac,providedIn:"root"});let h=l;return h})()});export{C as a,B as b};
