define(["itemsTab","cardBuilder","layoutManager","globalize","listView","emby-itemscontainer"],function(ItemsTab,cardBuilder,layoutManager,globalize,listView){"use strict";function FoldersTab(view,params){this.enableAlphaPicker=!0,ItemsTab.call(this,view,params)}return Object.assign(FoldersTab.prototype,ItemsTab.prototype),FoldersTab.prototype.getBaseQuery=function(){var parentId=this.params.parentId,sortValues=this.getSortValues(),fields="BasicSyncInfo,MediaSourceCount";layoutManager.mobile||(fields+=",SortName"),"primary"===this.getViewSettings().imageType&&(fields+=",PrimaryImageAspectRatio");var query={SortBy:sortValues.sortBy,SortOrder:sortValues.sortOrder,Fields:fields,ImageTypeLimit:1,EnableImageTypes:"Primary,Backdrop,Banner,Thumb,Disc",StartIndex:this.startIndex||0,Limit:this.nextPageButtons.length?100:null,ParentId:parentId},alphaPicker=this.alphaPicker;return alphaPicker&&(query.NameStartsWithOrGreater=alphaPicker.value()),query},FoldersTab.prototype.getItemsHtml=function(items){var settings=this.getViewSettings();if("list"===settings.imageType)return listView.getListViewHtml({items:items});var shape,preferThumb,preferDisc;"banner"===settings.imageType?shape="banner":"disc"===settings.imageType?(shape="square",preferDisc=!0):"thumb"===settings.imageType?(shape="backdrop",preferThumb=!0):shape="auto";return cardBuilder.getCardsHtml(items,{items:items,shape:shape,centerText:!0,preferThumb:preferThumb,preferDisc:preferDisc,overlayMoreButton:!layoutManager.tv,showTitle:settings.showTitle,overlayText:!settings.showTitle,cardLayout:!1,context:"folders"})},FoldersTab.prototype.getSettingsKey=function(){return ItemsTab.prototype.getSettingsKey.call(this)+"-folders"},FoldersTab.prototype.getViewSettings=function(){var settings=ItemsTab.prototype.getViewSettings.call(this);return settings.showTitle=!1!==settings.showTitle,settings},FoldersTab.prototype.getDefaultSortBy=function(){return"IsFolder,SortName"},FoldersTab.prototype.getFolderSortOption=function(){return{name:globalize.translate("sharedcomponents#Folders"),value:"IsFolder,SortName"}},FoldersTab.prototype.getVisibleViewSettings=function(){return["showTitle","imageType"]},FoldersTab.prototype.getVisibleFilters=function(){return[]},FoldersTab});