import{Aj as d,Bj as G,md as h,nd as w,od as v,pd as R,s as m,t as j}from"./chunk-EAIMSMGJ.js";import{a as u,b as T,g as S,h as A}from"./chunk-AIHAZUSZ.js";import{j as p,s as g}from"./chunk-KADRYNDC.js";import{b as l,c as y}from"./chunk-IOINCEV4.js";import{Gd as b,ka as a,na as B,sa as n,x as r,xa as c}from"./chunk-JSJB5BKT.js";import{e as k}from"./chunk-SZAW6ZBW.js";var H,J=k(()=>{B();R();j();T();w();b();G();g();y();A();H=(()=>{class i extends m{constructor(e,s,o,t){super(o,t),this.assetsService=e,this.messageService=s}backupNow(){return this.assetsService.BackupNow().pipe(a(e=>this.handleApiResult(e,"BackupFailed")),a(e=>this.sendBackupToastOnSuccess(e)),r(e=>this.isSuccessful(e)))}saveBackupConfig(e){return this.assetsService.SaveBackupJob(e).pipe(a(s=>this.sendToastOnSuccess(s)),r(s=>this.handleSaveApiResult(s)))}getBackupJob(){return this.assetsService.GetBackupJob().pipe(a(e=>this.handleGetApiResult(e)),r(e=>this.returnWhenSuccessful(e,()=>new h(e.data))))}getDatabaseBackupsLogs(e,s,o){return this.assetsService.GetDatabaseBackupLogs(e,s,o).pipe(a(t=>this.handleGetApiResult(t)),r(t=>this.returnWhenSuccessful(t,()=>(t.data||[]).map(f=>new v(f)))))}sendToastOnSuccess(e){e.result===u.Success&&this.messageService.add({key:"globalToast",severity:"success",summary:this.translatorService.translate("gbSavedSuccessfully"),detail:this.translatorService.translate("TheDataHasBeenSuccessfullySaved")})}sendBackupToastOnSuccess(e){e.result===u.Success&&this.messageService.add({key:"globalToast",severity:"success",summary:this.translatorService.translate("Success"),detail:this.translatorService.translate("BackupCreated")})}static{this.\u0275fac=function(s){return new(s||i)(c(d),c(p),c(l),c(S))}}static{this.\u0275prov=n({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()});export{H as a,J as b};
