import{$h as x,B as s,Gh as R,Q as h,Qe as f,Y as l,Zc as d,aa as c,ah as v,bd as E,n as m,uh as u,vg as S,zh as I}from"./chunk-K5TQVRW4.js";import{i as n}from"./chunk-RYEVWIKN.js";var e=class e{authHttp=c(E);restService=c(I);restExtractor=c(u);serverService=c(R);importVideo(t){let r=e.BASE_VIDEO_IMPORT_URL,a=v(t);return this.authHttp.post(r,a).pipe(s(p=>this.restExtractor.handleError(p)))}getMyVideoImports(t){let{pagination:r,sort:a,search:p}=t,i=new d;if(i=this.restService.addRestGetParams(i,r,a),p){let o=this.restService.parseQueryStringFilter(p,{videoChannelSyncId:{prefix:"videoChannelSyncId:"},targetUrl:{prefix:"targetUrl:"}});i=this.restService.addObjectParams(i,o)}return this.authHttp.get(x.BASE_USERS_URL+"me/videos/imports",{params:i}).pipe(h(o=>this.extractVideoImports(o)),s(o=>this.restExtractor.handleError(o)))}deleteVideoImport(t){return this.authHttp.delete(e.BASE_VIDEO_IMPORT_URL+t.id).pipe(s(r=>this.restExtractor.handleError(r)))}cancelVideoImport(t){return this.authHttp.post(e.BASE_VIDEO_IMPORT_URL+t.id+"/cancel",{}).pipe(s(r=>this.restExtractor.handleError(r)))}extractVideoImports(t){return this.serverService.getServerLocale().pipe(m(r=>(t.data.forEach(a=>a.state.label=f(a.state.label,r)),t)))}};n(e,"BASE_VIDEO_IMPORT_URL",S.apiUrl+"/api/v1/videos/imports/"),n(e,"\u0275fac",function(r){return new(r||e)}),n(e,"\u0275prov",l({token:e,factory:e.\u0275fac}));var U=e;export{U as a};
/**i18n:3ab8a6a12ff574644ebf46057f36e5643b4288edb94e57af377eaee98d8b77d4*/
//# sourceMappingURL=chunk-H4PQANA7.js.map
