import{B as o,Dh as I,Eg as u,Ih as S,Ph as R,Q as l,Y as h,Ze as f,aa as p,dd as m,hd as E,ii as x,jh as v,n as d}from"./chunk-CUA2BO3S.js";import{i as n}from"./chunk-75J4RO44.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:42440f0a8726af1836b15b193adfd3f46a3ecd983a1ed2a1e05982c4f600c8a1*/
//# sourceMappingURL=chunk-VSFSQ2PT.js.map
