import{B as s,C as c,D as h,Y as A,aa as u,bh as L,gh as I,hd as w,i as p,kd as E,uf as P,xe as f}from"./chunk-6YFOH76E.js";import{i as d}from"./chunk-QQ7SJNXU.js";var l=class l{authHttp=u(E);restService=u(I);restExtractor=u(L);listSubscriptions(r){let{pagination:o,sort:t,search:a,state:i,actorType:n}=r,e=new w();return e=this.restService.addRestGetParams(e,o,t),a&&(e=e.append("search",a)),i&&(e=e.append("state",i)),n&&(e=e.append("actorType",n)),this.authHttp.get(l.BASE_APPLICATION_URL+"/following",{params:e}).pipe(s(m=>this.restExtractor.handleError(m)));}listFollowers(r){let{pagination:o,sort:t,search:a,state:i,actorType:n}=r,e=new w();return e=this.restService.addRestGetParams(e,o,t),a&&(e=e.append("search",a)),i&&(e=e.append("state",i)),n&&(e=e.append("actorType",n)),this.authHttp.get(l.BASE_APPLICATION_URL+"/followers",{params:e}).pipe(s(m=>this.restExtractor.handleError(m)));}follow(r){let o={handles:r.filter(t=>t.includes("@")),hosts:r.filter(t=>!t.includes("@"))};return this.authHttp.post(l.BASE_APPLICATION_URL+"/following",o).pipe(s(t=>this.restExtractor.handleError(t)));}unfollow(r){let o=f(r);return p(o).pipe(h(t=>{let a=t.following.name+"@"+t.following.host;return this.authHttp.delete(l.BASE_APPLICATION_URL+"/following/"+a);}),c(),s(t=>this.restExtractor.handleError(t)));}acceptFollower(r){let o=f(r);return p(o).pipe(h(t=>{let a=t.follower.name+"@"+t.follower.host;return this.authHttp.post(`${l.BASE_APPLICATION_URL}/followers/${a}/accept`,{});}),c(),s(t=>this.restExtractor.handleError(t)));}rejectFollower(r){let o=f(r);return p(o).pipe(h(t=>{let a=t.follower.name+"@"+t.follower.host;return this.authHttp.post(`${l.BASE_APPLICATION_URL}/followers/${a}/reject`,{});}),c(),s(t=>this.restExtractor.handleError(t)));}removeFollower(r){let o=f(r);return p(o).pipe(h(t=>{let a=t.follower.name+"@"+t.follower.host;return this.authHttp.delete(`${l.BASE_APPLICATION_URL}/followers/${a}`);}),c(),s(t=>this.restExtractor.handleError(t)));}buildFollowsListFilters(){return[{type:"options",key:"state",title:"Follow state",options:[{value:"all",label:"All follows"},{value:"accepted",label:"\u5DF2\u63A5\u53D7\u7684\u8FFD\u8E64"},{value:"rejected",label:"\u5DF2\u56DE\u7D55\u7684\u8FFD\u8E64"},{value:"pending",label:"\u64F1\u7F6E\u4E2D\u7684\u8FFD\u8E64"}]}];}};d(l,"BASE_APPLICATION_URL",P.apiUrl+"/api/v1/server"),d(l,"\u0275fac",function(o){return new(o||l)();}),d(l,"\u0275prov",A({token:l,factory:l.ɵfac}));var R=l;export{R as a};/**i18n:5a85df092a135682c90bae008e37ec28160e04e5f445e29af2927333ba91ffa1*///# sourceMappingURL=chunk-AL3JY7FR.js.map