import{c as x,s as w}from"./chunk-C6uGsfWa.js";import{Io as kg,Ja as g,Ks as sr,Lc as zg,Nr as S$,Ri as Ze,To as je,Zs as th,ao as ho,as as nt,bs as pt,gt as Ex,k as Bb,n as $B,qn as Ng,s as $a,yc as wp}from"./chunk-b0nJCs5_.js";import"./chunk-CDRFWLLW.js";import"./chunk-d9xmxGyl.js";import"./chunk-BXrVgciI.js";import{t as H}from"./chunk-CswnO8Ym.js";import"./chunk-DkSYi3dP.js";import"./chunk-DUrVXBNc.js";import"./chunk-DnSoF4cB.js";import"./chunk-BdDU3qnh.js";import"./chunk-Cmet2Nw-.js";import"./chunk-CkJf4plT.js";import"./chunk-Dga4Oy_6.js";import"./chunk-q-6uNE4L.js";import"./chunk-vxivoKli.js";import"./chunk-YjBxjUE4.js";import"./chunk-aIvt-K7L.js";import"./chunk-kAUBfzSL.js";import"./chunk-CKCWxqhm.js";import"./chunk-DcB590Yc.js";import"./chunk-BvsfL09w.js";import"./chunk-BpR0ReBf.js";import"./chunk-DNBjyHdz2.js";import"./chunk-B4yFU5n32.js";import"./chunk-uNqEPBRE2.js";import"./chunk-DDsZtj252.js";import"./chunk-CnEH9ox82.js";import"./chunk-DwtxXnIx2.js";import"./chunk-D3sqbh442.js";import"./chunk-BqndqiNm2.js";import{n as Ne,o as ke,r as Ue}from"./chunk-BrKSdfk8.js";import"./chunk-Hufy2o-o.js";import"./chunk-D5Fy1Inu.js";import"./chunk-xpAb-8o8.js";import"./chunk-DWd4safw.js";import"./chunk-CqZshDR4.js";import"./chunk-C4CfljK7.js";import"./chunk-DfqsVgzP.js";import{t as At}from"./chunk-BziTa69R.js";import{n as _e,r as ve,t as M}from"./chunk-5GvG54Sk.js";import{t as P}from"./chunk-DIM23SYz.js";var r=class n{authService=g(nt);userSubscription=g(P);hooks=g(zg);videoService=g(H);scopedTokensService=g(Ng);getVideosObservableFunction=this.getVideosObservable.bind(this);getSyndicationItemsFunction=this.getSyndicationItems.bind(this);defaultSort=`-publishedAt`;actions=[{routerLink:`/my-library/subscriptions`,label:"Gestione",iconName:`cog`}];disabled=!1;feedToken;getVideosObservable(e,i){let t=x(w({},i.toVideosAPIObject()),{videoPagination:e,skipCount:!0});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=!0}enabledForReuse(){this.disabled=!1}loadFeedToken(){if(this.feedToken)return Promise.resolve(this.feedToken);return sr(this.authService.userInformationLoaded.pipe(Ze(),je(()=>this.scopedTokensService.getScopedTokens()),pt(i=>this.feedToken=i.feedToken)))}static ɵfac=function(i){return new(i||n)};static ɵcmp=$a({type:n,selectors:[[`my-videos-user-subscriptions`]],decls:3,vars:5,consts:()=>{let e;return e="Video dalle tue iscrizioni",[e,[1,`visually-hidden`],[`displayFilters`,`false`,`loadUserVideoPreferences`,`false`,`groupByDate`,`true`,`highlightLives`,`false`,3,`getVideosObservableFunction`,`getSyndicationItemsFunction`,`defaultSort`,`disabled`,`headerActions`]]},template:function(i,t){i&1&&(wp(0,`h1`,1),S$(1,0),Bb(),th(2,`my-videos-list`,2)),i&2&&($B(2),Ex(`getVideosObservableFunction`,t.getVideosObservableFunction)(`getSyndicationItemsFunction`,t.getSyndicationItemsFunction)(`defaultSort`,t.defaultSort)(`disabled`,t.disabled)(`headerActions`,t.actions))},dependencies:[At],encapsulation:2,changeDetection:1})};var re=[{path:``,providers:[M,P,Ue,Ne,ke],children:[{path:`overview`,component:ve,data:{meta:{title:"Scopri tra i video"},reuse:{enabled:!0,key:`videos-discover`}}},{path:`most-liked`,redirectTo:`browse?scope=federated&sort=-likes`},{path:`trending`,redirectTo:()=>`browse?scope=federated&sort=-`+g(ho).getDefaultTrendingSort()},{path:`recently-added`,redirectTo:`browse?scope=federated&sort=-publishedAt`},{path:`local`,redirectTo:`browse?scope=local&sort=-publishedAt`},{path:`browse`,component:_e,data:{reuse:{enabled:!0,key:`videos-list`}}},{path:`subscriptions`,canActivate:[kg],component:r,data:{meta:{title:"Iscrizioni"},reuse:{enabled:!0,key:`subscription-videos-list`}}}]}];export{re as default};
//# debugId=05f95ddd-e75d-52fd-bcb6-d9ada6b2293e
//# sourceMappingURL=chunk-BwKZTQdf.js.map