import {J,c as tS,ag as lp,a5 as fh,fL as x,H as ul,b3 as w,a7 as si,aZ as Dt,fM as F,L as w$1,am as Dh,ah as ot,aJ as hf,aa as ye,N as Sr,bd as K,ac as Dr,b6 as Yi,ad as ce}from'./main-WUGO6e7n.js';var D,T=J(()=>{tS();lp();fh();x();tS();ul();w();si();Dt();D=(()=>{class i extends F{constructor(e,t,m,p){super(e,t,m),this.messageService=p,this.assetService=w$1(Dh);}hasNotificationPreferences(){return this.getNotificationPreferences().pipe(ot(e=>(e.notifications||[]).length>0))}getNotificationPreferences(e=!1){return this.getCache(e,this.getNotificationPreferencesInternal()).pipe(ot(t=>t[0]))}saveNotificationPreferences(e){return this.assetService.SaveNotificationPreferences(e).pipe(hf(t=>this.handleSaveApiResult(t)),hf(t=>this.notifyWhenSuccessful(t)),hf(()=>this.invalidateCache()),ot(t=>this.isSuccessful(t)))}getNotificationPreferencesInternal(){return this.assetService.GetNotificationPreferences().pipe(hf(e=>this.handleGetApiResult(e)),ot(e=>this.returnWhenSuccessful(e,()=>[e.data])))}notifyWhenSuccessful(e){this.isSuccessful(e)?this.messageService.add({key:"globalToast",severity:"success",summary:this.translatorService.translate("lblSavedSuccessfully"),detail:this.translatorService.translate("TheDataHasBeenSuccessfullySaved")}):this.messageService.add({key:"globalToast",severity:"error",summary:this.translatorService.translate("UnableToSave"),detail:this.translatorService.translate("lbl")});}static{this.\u0275fac=function(t){return new(t||i)(ye(Sr),ye(K),ye(Dr),ye(Yi))};}static{this.\u0275prov=ce({token:i,factory:i.\u0275fac,providedIn:"root"});}}return i})();});export{D,T};