import{B as d,Fh as E,Ke as h,Sh as S,Y as v,_e as l,aa as c,hd as b,hi as y,n as m,pf as u,qf as f,r as p}from"./chunk-AVPM423Z.js";import{i as s,l as g}from"./chunk-W5TMGCPH.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:ceac57349051bcddcb40dd2878e0abcb86556d5ceb9d6109d22ac3f1ae3cc7b1*/
//# sourceMappingURL=chunk-H52ZZWV7.js.map
