import{B as d,Ch as S,Me as l,Th as y,Y as v,_c as b,aa as c,n as m,qg as u,qh as E,r as p,rg as f,we as h}from"./chunk-2GYONVCW.js";import{i as s,j as g}from"./chunk-6PUAHDUH.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:7c691147a9ded88b46d9cd2285c6afa220006ce26eb0d02eb4522192723b6cd8*/
//# sourceMappingURL=chunk-NM6UDG3V.js.map
