"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[31514],{31514:function(e,t,r){r.r(t),r.d(t,{default:function(){return m}}),r.dn(m);var i=r(24468),n=r(40984),a=r(76542),s=r(46782),o=r(8566),l=r(98320),d=r(5898);function c(){return!s.A.desktop}function m(e,t,r){var m;this.preRender=function(){m=function(e,t){o.Ay.show();var r={Limit:48,Fields:"AirTime",UserId:ApiClient.getCurrentUserId(),ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb",EnableTotalRecordCount:!1};return r.ParentId=t.topParentId,ApiClient.getJSON(ApiClient.getUrl("Shows/Upcoming",r))}(0,t)},this.renderTab=function(){var e;e=r,m.then((function(t){var r=t.Items;r.length?e.querySelector(".noItemsMessage").style.display="none":e.querySelector(".noItemsMessage").style.display="block",function(e,t){for(var r,o=[],m=[],h=0,u=t.length;h<u;h++){var p=t[h],y="";if(p.PremiereDate)try{var v=l.Ay.parseISO8601Date(p.PremiereDate,!0);y=l.Ay.isRelativeDay(v,-1)?d.Ay.translate("Yesterday"):l.Ay.toLocaleDateString(v,{weekday:"long",month:"short",day:"numeric"})}catch(e){console.error("error parsing timestamp for upcoming tv shows",e)}y!=r?(r=y,m=[p],o.push({name:r,items:m})):m.push(p)}for(var f="",g=0,T=o.length;g<T;g++){var A=o[g];f+='<div class="verticalSection">',f+='<h2 class="sectionTitle sectionTitle-cards padded-left">'+A.name+"</h2>";var I=!0;if(c()){I=!1;var w="scrollX hiddenScrollX";s.A.tv&&(w+=" smoothScrollX"),f+='<div is="emby-itemscontainer" class="itemsContainer '+w+' padded-left padded-right">'}else f+='<div is="emby-itemscontainer" class="itemsContainer vertical-wrap padded-left padded-right">';f+=i.Ay.getCardsHtml({items:A.items,showLocationTypeIndicator:!1,shape:(0,n.UI)(c()),showTitle:!0,preferThumb:!0,lazy:!0,showDetailsMenu:!0,centerText:!0,showParentTitle:!0,overlayText:!1,allowBottomPadding:I,cardLayout:!1,overlayMoreButton:!0,missingIndicator:!1}),f+="</div>",f+="</div>"}e.innerHTML=f,a.Ay.lazyChildren(e)}(e.querySelector("#upcomingItems"),r),o.Ay.hide()}))}}r(1177)}}]);