import{Bf as S,C as o,Qh as U,R as d,Z as l,ba as s,hf as R,ig as f,ih as v,nd as u,nh as O,o as E,qd as I,vh as x}from"./chunk-EKZJWO2J.js";import{c as h,i as p}from"./chunk-BODC7FZN.js";var e=class e{authHttp=s(I);restService=s(O);restExtractor=s(v);serverService=s(x);importVideo(t){let r=e.BASE_VIDEO_IMPORT_URL,a=f(t);return this.authHttp.post(r,a).pipe(o(c=>this.restExtractor.handleError(c)))}listMyVideoImports(t){let m=t,{pagination:r,sort:a}=m,c=h(m,["pagination","sort"]),i=new u;return i=this.restService.addRestGetParams(i,r,a),i=this.restService.addObjectParams(i,c),this.authHttp.get(U.BASE_USERS_URL+"me/videos/imports",{params:i}).pipe(d(n=>this.extractVideoImports(n)),o(n=>this.restExtractor.handleError(n)))}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(E(r=>(t.data.forEach(a=>a.state.label=R(a.state.label,r)),t)))}};p(e,"BASE_VIDEO_IMPORT_URL",S.apiUrl+"/api/v1/videos/imports/"),p(e,"\u0275fac",function(r){return new(r||e)}),p(e,"\u0275prov",l({token:e,factory:e.\u0275fac}));var V=e;export{V as a};
/**i18n:e079feaac094a2c754af8c2d9f82a9400e546e6b8cdd8ff7d538e47a33fc4649*/
//# sourceMappingURL=chunk-SLRRKQGZ.js.map
