import{B as o,Eh as I,Jh as S,Q as l,Qh as R,Xf as v,Y as h,Ze as f,aa as p,dd as m,hd as E,ji as x,n as d,pf as u}from"./chunk-W6R7I2TH.js";import{i as n}from"./chunk-PTJGHD3V.js";var e=class e{authHttp=p(E);restService=p(S);restExtractor=p(I);serverService=p(R);importVideo(t){let r=e.BASE_VIDEO_IMPORT_URL,a=v(t);return this.authHttp.post(r,a).pipe(o(c=>this.restExtractor.handleError(c)))}listMyVideoImports(t){let{pagination:r,sort:a,search:c,includeCollaborations:U}=t,i=new m;if(i=this.restService.addRestGetParams(i,r,a),U&&(i=i.append("includeCollaborations","true")),c){let s=this.restService.parseQueryStringFilter(c,{id:{prefix:"id:"},videoId:{prefix:"videoId:"},videoChannelSyncId:{prefix:"videoChannelSyncId:"},targetUrl:{prefix:"targetUrl:"}});i=this.restService.addObjectParams(i,s)}return this.authHttp.get(x.BASE_USERS_URL+"me/videos/imports",{params:i}).pipe(l(s=>this.extractVideoImports(s)),o(s=>this.restExtractor.handleError(s)))}deleteVideoImport(t){return this.authHttp.delete(e.BASE_VIDEO_IMPORT_URL+t.id).pipe(o(r=>this.restExtractor.handleError(r)))}cancelVideoImport(t){return this.authHttp.post(e.BASE_VIDEO_IMPORT_URL+t.id+"/cancel",{}).pipe(o(r=>this.restExtractor.handleError(r)))}retryVideoImport(t){return this.authHttp.post(e.BASE_VIDEO_IMPORT_URL+t.id+"/retry",{}).pipe(o(r=>this.restExtractor.handleError(r)))}extractVideoImports(t){return this.serverService.getServerLocale().pipe(d(r=>(t.data.forEach(a=>a.state.label=f(a.state.label,r)),t)))}};n(e,"BASE_VIDEO_IMPORT_URL",u.apiUrl+"/api/v1/videos/imports/"),n(e,"\u0275fac",function(r){return new(r||e)}),n(e,"\u0275prov",h({token:e,factory:e.\u0275fac}));var O=e;export{O as a};
/**i18n:90f1dd82a779b57eddc91ef20913c88eecaa9632bba8ac04ad50f47ae2b82df7*/
//# sourceMappingURL=chunk-JTZG3XDO.js.map
