import{$e as l,B as d,Kh as E,Le as h,Xh as S,Y as v,aa as c,id as b,mi as y,n as m,r as p,rf as u,sf as f}from"./chunk-HJJWL6RD.js";import{i as s,l as g}from"./chunk-H2BCKOF6.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:671d995daee9c68b73ac729b7ab2c3cf3be32c7f1a24d9dfa94e261c45ee5241*/
//# sourceMappingURL=chunk-X7FTQSYV.js.map
