import{C as o,Oc as g,Rf as b,Xe as h,Ye as m,Z as E,aa as p,ge as v,gg as S,hg as L,n as u,s as d,ue as l}from"./chunk-4JM6MIZ5.js";import{i as c,j as f}from"./chunk-QJQRWPYR.js";var e=class e{authHttp;restExtractor;markdownService;serverService;constructor(r,t,a,i){this.authHttp=r,this.restExtractor=t,this.markdownService=a,this.serverService=i}getAbout(){return this.authHttp.get(e.BASE_CONFIG_URL+"/about").pipe(o(r=>this.restExtractor.handleError(r)))}updateInstanceBanner(r){let t=e.BASE_CONFIG_URL+"/instance-banner/pick";return this.authHttp.post(t,r).pipe(o(a=>this.restExtractor.handleError(a)))}deleteInstanceBanner(){let r=e.BASE_CONFIG_URL+"/instance-banner";return this.authHttp.delete(r).pipe(o(t=>this.restExtractor.handleError(t)))}updateInstanceAvatar(r){let t=e.BASE_CONFIG_URL+"/instance-avatar/pick";return this.authHttp.post(t,r).pipe(o(a=>this.restExtractor.handleError(a)))}deleteInstanceAvatar(){let r=e.BASE_CONFIG_URL+"/instance-avatar";return this.authHttp.delete(r).pipe(o(t=>this.restExtractor.handleError(t)))}contactAdministrator(r,t,a,i){let n={fromEmail:r,fromName:t,subject:a,body:i};return this.authHttp.post(e.BASE_SERVER_URL+"/contact",n).pipe(o(s=>this.restExtractor.handleError(s)))}buildHtml(r){return f(this,null,function*(){let t={terms:"",codeOfConduct:"",moderationInformation:"",administrator:"",creationReason:"",maintenanceLifetime:"",businessModel:"",hardwareInformation:""};for(let a of v(t))t[a]=yield this.markdownService.enhancedMarkdownToHTML({markdown:r.instance[a]});return t})}buildTranslatedLanguages(r){return d([this.serverService.getVideoLanguages(),this.serverService.getServerLocale()]).pipe(u(([t,a])=>r.instance.languages.map(i=>{let n=t.find(s=>s.id===i);return n?l(n.label,a):(h.error(`Cannot find language ${i} in available languages`),"")})))}buildTranslatedCategories(r){return d([this.serverService.getVideoCategories(),this.serverService.getServerLocale()]).pipe(u(([t,a])=>r.instance.categories.map(i=>{let n=t.find(s=>s.id===i);return n?l(n.label,a):(h.error(`Cannot find instance category ${i} in available categories`),"")})))}};c(e,"BASE_CONFIG_URL",m.apiUrl+"/api/v1/config"),c(e,"BASE_SERVER_URL",m.apiUrl+"/api/v1/server"),c(e,"\u0275fac",function(t){return new(t||e)(p(g),p(b),p(S),p(L))}),c(e,"\u0275prov",E({token:e,factory:e.\u0275fac}));var R=e;export{R as a};
/**i18n:68865f44f2a527c44cf5136a17c76a0ff8308c2bae5c7c8d50070a5fb9847c44*/
//# sourceMappingURL=chunk-XJKJDKJW.js.map
