import{Bf as l,C as a,D as p,E as h,Z as u,ba as H,ih as _,j as i,nd as c,nh as A,qd as N}from"./chunk-ZSQR4KTU.js";import{i as E}from"./chunk-IQVXR75E.js";var o=class o{authHttp=H(N);restService=H(A);restExtractor=H(_);sendVideoChangeRequest(e,t){let r=o.BASE_VIDEO_CHANGE_OWNERSHIP_URL+e+"/give-ownership",s={username:t};return this.authHttp.post(r,s).pipe(a(n=>this.restExtractor.handleError(n)))}listOfVideos(e,t){let r=o.BASE_VIDEO_CHANGE_OWNERSHIP_URL+"ownership",s=new c;return s=this.restService.addRestGetParams(s,e,t),this.authHttp.get(r,{params:s}).pipe(a(n=>this.restExtractor.handleError(n)))}listFromVideo(e,t){let r=o.BASE_VIDEO_CHANGE_OWNERSHIP_URL+e+"/ownership",s=new c;return s=s.set("state",t),this.authHttp.get(r,{params:s}).pipe(a(n=>this.restExtractor.handleError(n)))}acceptVideo(e,t){return i(e).pipe(h(r=>{let s=o.BASE_VIDEO_CHANGE_OWNERSHIP_URL+"ownership/"+r+"/accept";return this.authHttp.post(s,t)}),p(),a(r=>this.restExtractor.handleError(r)))}rejectVideo(e){return i(e).pipe(h(t=>{let r=o.BASE_VIDEO_CHANGE_OWNERSHIP_URL+"ownership/"+t+"/refuse";return this.authHttp.post(r,{})}),p(),a(t=>this.restExtractor.handleError(t)))}cancelVideo(e){let t=o.BASE_VIDEO_CHANGE_OWNERSHIP_URL+"ownership/"+e;return this.authHttp.delete(t).pipe(a(r=>this.restExtractor.handleError(r)))}sendChannelChangeRequest(e,t){let r=o.BASE_CHANNEL_CHANGE_OWNERSHIP_URL+e+"/give-ownership",s={username:t};return this.authHttp.post(r,s).pipe(a(n=>this.restExtractor.handleError(n)))}listOfChannels(e,t){let r=o.BASE_CHANNEL_CHANGE_OWNERSHIP_URL+"ownership",s=new c;return s=this.restService.addRestGetParams(s,e,t),this.authHttp.get(r,{params:s}).pipe(a(n=>this.restExtractor.handleError(n)))}listFromChannel(e,t){let r=o.BASE_CHANNEL_CHANGE_OWNERSHIP_URL+e+"/ownership",s=new c;return s=s.set("state",t),this.authHttp.get(r,{params:s}).pipe(a(n=>this.restExtractor.handleError(n)))}acceptChannel(e){return i(e).pipe(h(t=>{let r=o.BASE_CHANNEL_CHANGE_OWNERSHIP_URL+"ownership/"+t+"/accept";return this.authHttp.post(r,{})}),p(),a(t=>this.restExtractor.handleError(t)))}rejectChannel(e){return i(e).pipe(h(t=>{let r=o.BASE_CHANNEL_CHANGE_OWNERSHIP_URL+"ownership/"+t+"/refuse";return this.authHttp.post(r,{})}),p(),a(t=>this.restExtractor.handleError(t)))}cancelChannel(e){let t=o.BASE_CHANNEL_CHANGE_OWNERSHIP_URL+"ownership/"+e;return this.authHttp.delete(t).pipe(a(r=>this.restExtractor.handleError(r)))}};E(o,"BASE_VIDEO_CHANGE_OWNERSHIP_URL",l.apiUrl+"/api/v1/videos/"),E(o,"BASE_CHANNEL_CHANGE_OWNERSHIP_URL",l.apiUrl+"/api/v1/video-channels/"),E(o,"\u0275fac",function(t){return new(t||o)}),E(o,"\u0275prov",u({token:o,factory:o.\u0275fac}));var R=o;export{R as a};
/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*/
//# sourceMappingURL=chunk-HCTBNNEZ.js.map
