"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3776,12975,66884],{3776:function(e,t,r){r.r(t),r.d(t,{default:function(){return h}});var n=r(22696),a=r.n(n),i=r(24468),s=r(46782),o=r(99891),d=r(8566),l=r(70267),u=r(5898),c=r(82885),m=r(76942);function h(e,t,r){var n=this;function h(){var e=v(),r=T[e];return r||((r=T[e]={query:{SortBy:"SortName",SortOrder:"Ascending",IncludeItemTypes:"Movie",Recursive:!0,EnableTotalRecordCount:!1},view:c.getSavedView(e)||"Poster"}).query.ParentId=t.topParentId,c.loadQuerySettings(e,r.query)),r}function p(){return h().query}function v(){return t.topParentId+"-moviegenres"}function b(){return!s.A.desktop}var f,y=function(e){var a=e.target,s=a.getAttribute("data-id"),o=n.getCurrentViewStyle(),d="Thumb"==o||"ThumbCard"==o?5:9;b()&&(d=10);var l={SortBy:"Random",SortOrder:"Ascending",IncludeItemTypes:"Movie",Recursive:!0,Fields:"PrimaryImageAspectRatio,MediaSourceCount",ImageTypeLimit:1,EnableImageTypes:"Thumb"==o||"ThumbCard"==o?"Primary,Backdrop,Thumb":"Primary",Limit:d,GenreIds:s,EnableTotalRecordCount:!1,ParentId:t.topParentId};ApiClient.getItems(ApiClient.getCurrentUserId(),l).then((function(e){"Thumb"==o?i.default.buildCards(e.Items,{itemsContainer:a,shape:(0,m.UI)(b()),preferThumb:!0,showTitle:!0,scalable:!0,centerText:!0,overlayMoreButton:!0,allowBottomPadding:!1}):"ThumbCard"==o?i.default.buildCards(e.Items,{itemsContainer:a,shape:(0,m.UI)(b()),preferThumb:!0,showTitle:!0,scalable:!0,centerText:!1,cardLayout:!0,showYear:!0}):"PosterCard"==o?i.default.buildCards(e.Items,{itemsContainer:a,shape:(0,m.xK)(b()),showTitle:!0,scalable:!0,centerText:!1,cardLayout:!0,showYear:!0}):"Poster"==o&&i.default.buildCards(e.Items,{itemsContainer:a,shape:(0,m.xK)(b()),scalable:!0,overlayMoreButton:!0,allowBottomPadding:!0,showTitle:!0,centerText:!0,showYear:!0}),e.Items.length>=l.Limit&&r.querySelector(".btnMoreFromGenre"+s+" .material-icons").classList.remove("hide")}))},T={};this.getViewStyles=function(){return"Poster,PosterCard,Thumb,ThumbCard".split(",")},this.getCurrentViewStyle=function(){return h().view},this.setCurrentViewStyle=function(e){h().view=e,c.saveViewSetting(v(),e),n.preRender(),n.renderTab()},this.enableViewSelection=!0,this.preRender=function(){f=function(){d.Ay.show();var e=p();return ApiClient.getGenres(ApiClient.getCurrentUserId(),e)}()},this.renderTab=function(){!function(e,r){var n=p();r.then((function(r){for(var i=e.querySelector("#items"),m="",h=r.Items,p=0,f=h.length;p<f;p++){var T=h[p];if(m+='<div class="verticalSection">',m+='<div class="sectionTitleContainer sectionTitleContainer-cards padded-left">',m+='<a is="emby-linkbutton" href="'+l.appRouter.getRouteUrl(T,{context:"movies",parentId:t.topParentId})+'" class="more button-flat button-flat-mini sectionTitleTextButton btnMoreFromGenre'+T.Id+'">',m+='<h2 class="sectionTitle sectionTitle-cards">',m+=a()(T.Name),m+="</h2>",m+='<span class="material-icons hide chevron_right" aria-hidden="true"></span>',m+="</a>",m+="</div>",b()){var g="scrollX hiddenScrollX";s.A.tv&&(g+="smoothScrollX padded-top-focusscale padded-bottom-focusscale"),m+='<div is="emby-itemscontainer" class="itemsContainer '+g+' lazy padded-left padded-right" data-id="'+T.Id+'">'}else m+='<div is="emby-itemscontainer" class="itemsContainer vertical-wrap lazy padded-left padded-right" data-id="'+T.Id+'">';m+="</div>",m+="</div>"}r.Items.length||(m="",m+='<div class="noItemsMessage centerMessage">',m+="<h1>"+u.Ay.translate("MessageNothingHere")+"</h1>",m+="<p>"+u.Ay.translate("MessageNoGenresAvailable")+"</p>",m+="</div>"),i.innerHTML=m,o.Ay.lazyChildren(i,y),c.saveQuerySettings(v(),n),d.Ay.hide()}))}(r,f)}}r(10353)}}]);