import {j,a}from'./chunk-Blf_arF2.js';import {J as J$1,a5 as fh,ec as ND,ae as x,fl as FS,fm as Kh,c as tS,ag as lp,aZ as Dt,H as ul,aM as AD,a7 as si,b3 as w,ei as I4,ah as ot,fn as Ot,aJ as hf,ai as o$1,aq as Sr,fo as Yl,aa as ye,am as Dh,b6 as Yi,N as Sr$1,aN as r4,ac as Dr,bd as K,ad as ce}from'./main-WUGO6e7n.js';var $,J=J$1(()=>{fh();ND();x();FS();Kh();j();tS();lp();Dt();ul();AD();si();w();$=(()=>{class n extends I4{constructor(e,t,P,y,C,I,j){super(j,I),this.assetService=e,this.messageService=t,this.translator=P,this.serverInformationService=y,this.settingsCache=new a(C);}getSettings(e=!1){return this.settingsCache.getCache(e,this.getSettingsInternal()).pipe(ot(t=>new Ot(JSON.parse(JSON.stringify(t)))))}setSettings(e){return this.settingsCache.invalidateCache(),this.assetService.SavePamGlobalSettings(e).pipe(hf(t=>this.handleSaveApiResult(t)),hf(t=>this.sendToastOnSuccess(t)),ot(t=>t.result===o$1.Success))}getUsagePoliciesSettings(){return this.assetService.GetPamUsagePolicies().pipe(Sr(e=>e.result===o$1.Success),ot(e=>this.returnWhenSuccessful(e,()=>new Yl(e.data))))}setUsagePoliciesSettings(e){return this.settingsCache.invalidateCache(),this.assetService.SavePamUsagePolicies(e).pipe(hf(t=>this.handleSaveApiResult(t)),hf(t=>this.updateServerInfoOnSuccess(t)),hf(t=>this.sendToastOnSuccess(t)),ot(t=>t.result===o$1.Success))}getSettingsInternal(){return this.assetService.GetPamGlobalSettings().pipe(Sr(e=>e.result===o$1.Success),ot(e=>this.returnWhenSuccessful(e,()=>new Ot(e.data))))}updateServerInfoOnSuccess(e){e.result===o$1.Success&&this.serverInformationService.update();}sendToastOnSuccess(e){e.result===o$1.Success&&this.messageService.add({key:"globalToast",severity:"success",summary:this.translator.translate("lblSavedSuccessfully"),detail:this.translator.translate("TheDataHasBeenSuccessfullySaved")});}static{this.\u0275fac=function(t){return new(t||n)(ye(Dh),ye(Yi),ye(Sr$1),ye(r4),ye(Dr),ye(K),ye(Sr$1))};}static{this.\u0275prov=ce({token:n,factory:n.\u0275fac,providedIn:"root"});}}return n})();});export{$,J};