import{a as v,b as I}from"./chunk-3JJ5PGXK.js";import{P as S,Q as j}from"./chunk-DCSOZT4N.js";import{Aj as u,Bj as P}from"./chunk-5XZEGBWY.js";import{g as h,h as N}from"./chunk-AIHAZUSZ.js";import{j as f,s as y}from"./chunk-KADRYNDC.js";import{b as l,c as b}from"./chunk-IOINCEV4.js";import{Gd as o,ka as r,na as g,sa as c,x as s,xa as a,ya as n}from"./chunk-JSJB5BKT.js";import{e as d}from"./chunk-SZAW6ZBW.js";var D,T=d(()=>{o();P();g();I();o();b();N();j();y();D=(()=>{class i extends v{constructor(e,t,m,p){super(e,t,m),this.messageService=p,this.assetService=n(u)}hasNotificationPreferences(){return this.getNotificationPreferences().pipe(s(e=>(e.notifications||[]).length>0))}getNotificationPreferences(e=!1){return this.getCache(e,this.getNotificationPreferencesInternal()).pipe(s(t=>t[0]))}saveNotificationPreferences(e){return this.assetService.SaveNotificationPreferences(e).pipe(r(t=>this.handleSaveApiResult(t)),r(t=>this.notifyWhenSuccessful(t)),r(()=>this.invalidateCache()),s(t=>this.isSuccessful(t)))}getNotificationPreferencesInternal(){return this.assetService.GetNotificationPreferences().pipe(r(e=>this.handleGetApiResult(e)),s(e=>this.returnWhenSuccessful(e,()=>[e.data])))}notifyWhenSuccessful(e){this.isSuccessful(e)?this.messageService.add({key:"globalToast",severity:"success",summary:this.translatorService.translate("gbSavedSuccessfully"),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)(a(l),a(h),a(S),a(f))}}static{this.\u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()});export{D as a,T as b};
