"use strict";(globalThis.webpackChunk_plex_client_qt=globalThis.webpackChunk_plex_client_qt||[]).push([["packages_app_screens_profile_WatchlistHubGridScreen_tsx"],{26305:(e,t,i)=>{i.r(t),i.d(t,{default:()=>b});var a=i(80038),s=i(36725),n=i(62401),r=i(43933),o=i(82357),c=i(10213),l=i(86794),u=i(6389);class d extends l.Z{constructor(e){super(),this.metricsPage=o.GJ.WatchlistDetails,this._fetchItems=async(e,t)=>{var i,s;const{data:n}=await(0,a.JT)(a.Jc,{first:e,after:t,uuid:this._uuid,skipUserState:!0},"cache-and-network");return{hasNextPage:!(null==n||!n.user.watchlist.pageInfo.hasNextPage),cursor:null!==(i=null==n?void 0:n.user.watchlist.pageInfo.endCursor)&&void 0!==i?i:"",items:null!==(s=null==n?void 0:n.user.watchlist.nodes.map((e=>(0,c.Z)(e,r.providerIdentifiers.discoverIdentifier))))&&void 0!==s?s:[]}},this._uuid=e,this.hubViewModel=new u.Z(n.cA.ProfileWatchlist,"",e,this._fetchItems,void 0,void 0,void 0,{allowViewAllItem:!1})}}var h=i(95206),p=i(88271),f=i(62930),v=i(95794),_=function(e,t,i,a){var s,n=arguments.length,r=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(r=(n<3?s(r):n>3?s(t,i,r):s(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},y=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class g extends f.Z{_attach(){this.icon.icon=p.eG.Bookmark,this.title.content=(0,s.ZP)("Save anything to your Watchlist"),this.body.content=(0,s.ZP)("Keep track of what you want to watch next from any streaming service, all in one place."),this.button.label=(0,s.ZP)("Discover Something New"),this.button.onPress=()=>{const e=this._providerManager.pinnedSources.find((e=>e.providerId===r.providerIdentifiers.discoverIdentifier));e&&this._appStore.setFocusedSidebarSource(e)}}}_([(0,v.Z)("providerManager"),y("design:type",Object)],g.prototype,"_providerManager",void 0),_([(0,v.Z)("appStore"),y("design:type",Object)],g.prototype,"_appStore",void 0);class b extends h.Z{async _init(){this.initialData&&(this.model=new d(this.initialData.uuid),super._init(),this.patch({Screen:{ZeroState:{type:g,visible:!1}}}))}async setTitle(){var e;if(!this.initialData)return;const{data:t}=await(0,a.JT)(a.bS,{uuid:this.initialData.uuid});t&&t.user.username!==(null===(e=this._userManager.current)||void 0===e?void 0:e.username)?this._title.content=(0,s.ZP)("{name}'s Watchlist",{name:t.user.displayName||t.user.username}):this._title.content=(0,s.ZP)("My Watchlist")}}}}]);