import{a as l,b as x}from"./chunk-ZFMQAUJZ.js";import{a as g,b as B}from"./chunk-VOLZZ3JP.js";import{V as d,W as w}from"./chunk-INYFUTXB.js";import{Qe as p,Re as k,Wj as v,Xj as R}from"./chunk-2GUKPKKM.js";import{a as o,b as A,g as S,h as I}from"./chunk-CUIDVWNH.js";import{Da as h,La as j}from"./chunk-5YPL7P3G.js";import{b as f,c as b}from"./chunk-IBUDDWQO.js";import{O as c,Sd as T,ka as n,oa as y,ta as u,x as a,ya as i}from"./chunk-XJKQ67XR.js";import{e as C}from"./chunk-SZAW6ZBW.js";var N,D=C(()=>{y();A();k();x();B();T();b();I();w();R();j();N=(()=>{class r extends g{constructor(t,e,s,m,E){super(t,e,s),this.assetServices=m,this.messageService=E}getEmailConfiguration(t=!1){let e=this.assetServices.GetEmailConfiguration().pipe(c(s=>this.handleCatchError(s,l)),n(s=>this.handleGetApiResult(s)),a(s=>this.isSuccessful(s)?[new p(s.data)]:[]));return this.getCache(t,e).pipe(a(s=>s[0]))}saveEmailConfiguration(t){return this.assetServices.SaveEmailConfiguration(t).pipe(c(e=>this.handleCatchError(e,l)),n(e=>this.sendToastOnSuccess(e)),n(()=>this.invalidateCache()),a(e=>this.handleSaveApiResult(e)))}testEmailConfiguration(t){return this.assetServices.TestEmailConfiguration(t).pipe(c(e=>this.handleCatchError(e,l)),a(e=>this.sendToastAfterTest(e)))}sendToastOnSuccess(t){t.result===o.Success&&this.messageService.add({key:"globalToast",severity:"success",summary:this.translatorService.translate("lblSavedSuccessfully"),detail:this.translatorService.translate("TheDataHasBeenSuccessfullySaved")})}sendToastAfterTest(t){let e=t.result===o.Success?"success":"error",s=t.result===o.Success?"EmailSent":"ErrorSendingEmail",m=t.result===o.Success?"":t.errorMessage;this.messageService.add({key:"globalToast",severity:e,summary:this.translatorService.translate(s),detail:m})}static{this.\u0275fac=function(e){return new(e||r)(i(f),i(S),i(d),i(v),i(h))}}static{this.\u0275prov=u({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})()});export{N as a,D as b};
