import{Af as d,Bf as h,C as m,Mh as y,O as g,Te as E,Z as b,ba as c,hf as p,ih as C,o as u,qd as v,s as l,vh as S}from"./chunk-ZSQR4KTU.js";import{i as s,j as f}from"./chunk-IQVXR75E.js";var t=class t{authHttp=c(v);restExtractor=c(C);markdownService=c(y);serverService=c(S);aboutCache$=null;getAboutWithCache(){return this.aboutCache$||(this.aboutCache$=this.authHttp.get(t.BASE_CONFIG_URL+"/about").pipe(m(r=>this.restExtractor.handleError(r)),g(1)),setTimeout(()=>{this.aboutCache$=null},1e3)),this.aboutCache$}contactAdministrator(r,e,a,o){let i={fromEmail:r,fromName:e,subject:a,body:o};return this.authHttp.post(t.BASE_SERVER_URL+"/contact",i).pipe(m(n=>this.restExtractor.handleError(n)))}buildHtml(r){return f(this,null,function*(){let e={terms:"",codeOfConduct:"",moderationInformation:"",administrator:"",creationReason:"",maintenanceLifetime:"",businessModel:"",hardwareInformation:""};for(let a of E(e))e[a]=yield this.markdownService.enhancedMarkdownToHTML({markdown:r.instance[a]});return e})}buildTranslatedLanguages(r){return l([this.serverService.getVideoLanguages(),this.serverService.getServerLocale()]).pipe(u(([e,a])=>r.instance.languages.map(o=>{let i=e.find(n=>n.id===o);return i?p(i.label,a):(d.error(`Cannot find language ${o} in available languages`),"")})))}buildTranslatedCategories(r){return l([this.serverService.getVideoCategories(),this.serverService.getServerLocale()]).pipe(u(([e,a])=>r.instance.categories.map(o=>{let i=e.find(n=>n.id===o);return i?p(i.label,a):(d.error(`Cannot find instance category ${o} in available categories`),"")})))}};s(t,"BASE_CONFIG_URL",h.apiUrl+"/api/v1/config"),s(t,"BASE_SERVER_URL",h.apiUrl+"/api/v1/server"),s(t,"\u0275fac",function(e){return new(e||t)}),s(t,"\u0275prov",b({token:t,factory:t.\u0275fac}));var R=t;export{R as a};
/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*/
//# sourceMappingURL=chunk-W3RIPVTB.js.map
