import{o as F}from"./chunk-C6uGsfWa.js";import{Fa as er,Hi as Zt,Ja as g,Jo as lc,Mr as S,Rn as Mn,St as G,at as Dm,bi as Xc,ea as ae,ei as V,pi as Wn,qi as _F,ro as he}from"./chunk-b0nJCs5_.js";var E=class o{authHttp=g(Wn);restExtractor=g(er);markdownService=g(Xc);serverService=g(Zt);static BASE_CONFIG_URL=ae.apiUrl+`/api/v1/config`;static BASE_SERVER_URL=ae.apiUrl+`/api/v1/server`;aboutCache$=null;getAboutWithCache(){return this.aboutCache$||(this.aboutCache$=this.authHttp.get(o.BASE_CONFIG_URL+`/about`).pipe(he(t=>this.restExtractor.handleError(t)),Mn(1)),setTimeout(()=>{this.aboutCache$=null},1e3)),this.aboutCache$}contactAdministrator(t,e,r,a){let i={fromEmail:t,fromName:e,subject:r,body:a};return this.authHttp.post(o.BASE_SERVER_URL+`/contact`,i).pipe(he(n=>this.restExtractor.handleError(n)))}buildHtml(t){return F(this,null,function*(){let e={terms:``,codeOfConduct:``,moderationInformation:``,administrator:``,creationReason:``,maintenanceLifetime:``,businessModel:``,hardwareInformation:``};for(let r of lc(e))e[r]=yield this.markdownService.enhancedMarkdownToHTML({markdown:t.instance[r]});return e})}buildTranslatedLanguages(t){return _F([this.serverService.getVideoLanguages(),this.serverService.getServerLocale()]).pipe(G(([e,r])=>t.instance.languages.map(a=>{let i=e.find(n=>n.id===a);return i?Dm(i.label,r):(V.error(`Cannot find language ${a} in available languages`),``)})))}buildTranslatedCategories(t){return _F([this.serverService.getVideoCategories(),this.serverService.getServerLocale()]).pipe(G(([e,r])=>t.instance.categories.map(a=>{let i=e.find(n=>n.id===a);return i?Dm(i.label,r):(V.error(`Cannot find instance category ${a} in available categories`),``)})))}static ɵfac=function(e){return new(e||o)};static ɵprov=S({token:o,factory:o.ɵfac})};export{E as t};
//# debugId=a68d4e0f-b938-5a41-8a23-5c243ca93f5a
//# sourceMappingURL=chunk-C0C2vyNb.js.map