import{J as Je,m as mt,P as P$1}from'./chunk-lC36WcG5.js';import{J as Ji}from'./chunk-BKjZnZbJ.js';import{B}from'./chunk-B1k1Tm91.js';import'./chunk-Bqgo7Mzt.js';import'./chunk-DDe369Xz.js';import'./chunk-B1ckgyo2.js';import'./chunk-DwfQijvj.js';import'./chunk-uAC8t5Px.js';import{I as It,U as Ut,P as Pt}from'./chunk-CV_T9H11.js';import'./chunk-D6R-e_vb.js';import'./chunk-DsZ3hjLw.js';import{d7 as ak,g,dm as Oi,aQ as Xe,a_ as Lk,aC as x,dd as sg,av as E,ao as D,dG as ze,a9 as Oe,br as lt,fA as Zn,b as Pa,s as sp,y as yV,u as ub,e as Pp,z as zB,a3 as B0}from'./main-sJAtkqeq.js';import'./chunk-EPw0AaBv.js';import'./chunk-DXoNTEyG.js';import'./chunk-F7sai10S.js';var P=(()=>{class r{authService=g(Xe);userSubscription=g(B);hooks=g(Lk);videoService=g(x);scopedTokensService=g(sg);getVideosObservableFunction=this.getVideosObservable.bind(this);getSyndicationItemsFunction=this.getSyndicationItems.bind(this);defaultSort="-publishedAt";actions=[{routerLink:"/my-library/subscriptions",label:"Qu\u1EA3n l\xFD",iconName:"cog"}];disabled=false;feedToken;getVideosObservable(e,i){let t=E(D({},i.toVideosAPIObject()),{videoPagination:e,skipCount:true});return this.hooks.wrapObsFun(this.userSubscription.getUserSubscriptionVideos.bind(this.userSubscription),t,"common","filter:api.user-subscriptions-videos.videos.list.params","filter:api.user-subscriptions-videos.videos.list.result");}getSyndicationItems(){return this.loadFeedToken().then(()=>{let e=this.authService.getUser();return this.videoService.getVideoSubscriptionFeedUrls(e.account.id,this.feedToken);});}disableForReuse(){this.disabled=true;}enabledForReuse(){this.disabled=false;}loadFeedToken(){if(this.feedToken)return Promise.resolve(this.feedToken);let e=this.authService.userInformationLoaded.pipe(ze(),Oe(()=>this.scopedTokensService.getScopedTokens()),lt(i=>this.feedToken=i.feedToken));return Zn(e);}static ɵfac=function(i){return new(i||r)();};static ɵcmp=Pa({type:r,selectors:[["my-videos-user-subscriptions"]],decls:3,vars:5,consts:()=>{let e;return e="Video t\u1EEB c\xE1c k\xEAnh b\u1EA1n \u0111\u0103ng k\xFD",[e,[1,"visually-hidden"],["displayFilters","false","loadUserVideoPreferences","false","groupByDate","true","highlightLives","false",3,"getVideosObservableFunction","getSyndicationItemsFunction","defaultSort","disabled","headerActions"]];},template:function(i,t){i&1&&(sp(0,"h1",1),yV(1,0),ub(),Pp(2,"my-videos-list",2)),i&2&&(zB(2),B0("getVideosObservableFunction",t.getVideosObservableFunction)("getSyndicationItemsFunction",t.getSyndicationItemsFunction)("defaultSort",t.defaultSort)("disabled",t.disabled)("headerActions",t.actions));},dependencies:[Ji],encapsulation:2,changeDetection:1});}return r;})();var oe=[{path:"",providers:[P$1,B,It,Ut,Pt],children:[{path:"overview",component:Je,data:{meta:{title:"Kh\xE1m ph\xE1"},reuse:{enabled:true,key:"videos-discover"}}},{path:"most-liked",redirectTo:"browse?scope=federated&sort=-likes"},{path:"trending",redirectTo:()=>"browse?scope=federated&sort=-"+g(Oi).getDefaultTrendingSort()},{path:"recently-added",redirectTo:"browse?scope=federated&sort=-publishedAt"},{path:"local",redirectTo:"browse?scope=local&sort=-publishedAt"},{path:"browse",component:mt,data:{reuse:{enabled:true,key:"videos-list"}}},{path:"subscriptions",canActivate:[ak],component:P,data:{meta:{title:"K\xEAnh \u0111\u0103ng k\xFD"},reuse:{enabled:true,key:"subscription-videos-list"}}}]}];/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/export{oe as default};//# sourceMappingURL=chunk-DDoLdsBc.js.map