import{a as l,b}from"./chunk-SM7EQ7ST.js";import{c as h,d as K}from"./chunk-RWCAFOHA.js";import{Gk as d,Hk as T}from"./chunk-BPZQKZKD.js";import{Da as p,La as y}from"./chunk-5E3JCGAH.js";import{b as u,c as v}from"./chunk-YBNTOQCK.js";import{Sa as S,be as f,ka as i,ta as n,x as a,xa as c}from"./chunk-WL5U2YIT.js";import{e as A}from"./chunk-ADEKKGI2.js";var O,W=A(()=>{S();b();f();v();K();T();y();O=(()=>{let r=class r extends l{constructor(e,t,s,m){super(e,t),this.assetService=s,this.messageService=m}generateApiKey(){return this.assetService.GenerateApiKey().pipe(i(e=>this.handleGetApiResult(e)),i(e=>this.executeBasedOnResult(e,()=>this.showToast("success","lblSuccess","YourApiKeyWasGenerated"),()=>this.showToast("error","lblError","AnUnexpectedErrorOccuredContactYourAdmin"))),a(e=>this.returnWhenSuccessful(e,()=>e.data)))}deleteApiKey(e){return this.assetService.DeleteApiKey(e).pipe(i(t=>this.handleGetApiResult(t)),i(t=>this.executeBasedOnResult(t,()=>this.showToast("success","lblSuccess","YourApiKeyWasDeleted"),()=>this.showToast("error","lblError","AnUnexpectedErrorOccuredContactYourAdmin"))),a(t=>this.returnWhenSuccessful(t,()=>!0)))}updateApiKey(e,t){return this.assetService.UpdateApiKey(e,t).pipe(i(s=>this.handleGetApiResult(s)),a(s=>this.returnWhenSuccessful(s,()=>s)))}listApiKeys(){return this.assetService.ListApiKeys().pipe(i(e=>this.handleGetApiResult(e)),a(e=>this.returnWhenSuccessful(e,()=>e.data)))}showToast(e,t,s){this.messageService.add({key:"globalToast",severity:e,summary:this.translatorService.translate(t),detail:this.translatorService.translate(s)})}};r.\u0275fac=function(t){return new(t||r)(c(u),c(h),c(d),c(p))},r.\u0275prov=n({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})()});export{O as a,W as b};
