import{$c as b,B as d,Eh as S,Oe as l,Vh as y,Y as v,aa as c,n as m,r as p,sg as u,sh as E,tg as f,ye as h}from"./chunk-GM43ZGTR.js";import{i as s,j as g}from"./chunk-SLIYHYWC.js";var e=class e{authHttp=c(b);restExtractor=c(E);markdownService=c(y);serverService=c(S);getAbout(){return this.authHttp.get(e.BASE_CONFIG_URL+"/about").pipe(d(t=>this.restExtractor.handleError(t)))}contactAdministrator(t,r,a,o){let i={fromEmail:t,fromName:r,subject:a,body:o};return this.authHttp.post(e.BASE_SERVER_URL+"/contact",i).pipe(d(n=>this.restExtractor.handleError(n)))}buildHtml(t){return g(this,null,function*(){let r={terms:"",codeOfConduct:"",moderationInformation:"",administrator:"",creationReason:"",maintenanceLifetime:"",businessModel:"",hardwareInformation:""};for(let a of h(r))r[a]=yield this.markdownService.enhancedMarkdownToHTML({markdown:t.instance[a]});return r})}buildTranslatedLanguages(t){return p([this.serverService.getVideoLanguages(),this.serverService.getServerLocale()]).pipe(m(([r,a])=>t.instance.languages.map(o=>{let i=r.find(n=>n.id===o);return i?l(i.label,a):(u.error(`Cannot find language ${o} in available languages`),"")})))}buildTranslatedCategories(t){return p([this.serverService.getVideoCategories(),this.serverService.getServerLocale()]).pipe(m(([r,a])=>t.instance.categories.map(o=>{let i=r.find(n=>n.id===o);return i?l(i.label,a):(u.error(`Cannot find instance category ${o} in available categories`),"")})))}};s(e,"BASE_CONFIG_URL",f.apiUrl+"/api/v1/config"),s(e,"BASE_SERVER_URL",f.apiUrl+"/api/v1/server"),s(e,"\u0275fac",function(r){return new(r||e)}),s(e,"\u0275prov",v({token:e,factory:e.\u0275fac}));var L=e;export{L as a};
/**i18n:aa38438cfc6bb6877c9985433629bf5f310ba8cfd6183982ad2c0c8f601d3935*/
//# sourceMappingURL=chunk-5AD6GLX2.js.map
