define(["dom","../list/list","commandProcessor","globalize","apphost","listViewStyle","emby-linkbutton","flexStyles","emby-toggle","css!./log"],function(dom,ListPage,commandProcessor,globalize,appHost){"use strict";function LogPage(view,params){var apiClient=ApiClient;params.serverId=apiClient.serverId(),this.supportsPlayback=!1,this.supportsViewSettings=!1,this.enableTotalRecordCountDisplay=!1;var html="";html+='<div class="padded-bottom padded-left padded-left-page padded-right" style="padding-bottom:2em;">',html+='<h2 style="margin-bottom:.75em;">'+dom.htmlEncode(params.name)+"</h2>",html+="<div>",appHost.supports("filedownload")&&(html+='<button is="emby-button" type="button" class="raised raised-mini btnDownload" style="margin-left:0;"><i class="md-icon button-icon button-icon-left">download</i>'+globalize.translate("Download")+"</button>"),appHost.supports("targetblank")&&(html+='<a is="emby-linkbutton" href="'+apiClient.getLogDownloadUrl({Name:params.name})+'" target="_blank" class="raised raised-mini btnOpen"><i class="md-icon button-icon button-icon-left">open_in_new</i>'+globalize.translate("HeaderOpenInNewWindow")+"</a>"),html+="</div>",html+="</div>",view.querySelector(".itemsViewSettingsContainer").insertAdjacentHTML("beforebegin",html);var btnDownload=view.querySelector(".btnDownload");btnDownload&&btnDownload.addEventListener("click",function(){var item={Name:this.params.name,Type:"Log",ServerId:this.params.serverId};commandProcessor.executeCommand("download",item)}.bind(this)),view.classList.add("logView"),ListPage.call(this,view,params)}return Object.assign(LogPage.prototype,ListPage.prototype),LogPage.prototype.getBaseQuery=function(item){var query=ListPage.prototype.getBaseQuery.apply(this,arguments);return query.name=this.params.name,query},LogPage.prototype.virtualChunkSize=function(){return 100},LogPage.prototype.getApiClientQueryMethodName=function(){return"getLogLines"},LogPage.prototype.getListViewOptions=function(items,settings){var options=ListPage.prototype.getListViewOptions.apply(this,arguments);return options.image=!1,options.moreButton=!1,options.action="none",options.showLogLine=!0,options.highlight=!1,options.verticalPadding=!1,options.code=!0,options.multiSelect=!1,options},LogPage.prototype.getSettingsKey=function(){return"log"},LogPage.prototype.setTitle=function(){},LogPage.prototype.getSortMenuOptions=function(){return[]},LogPage.prototype.getVisibleFilters=function(){return[]},LogPage.prototype.getVisibleViewSettings=function(){return{}},LogPage.prototype.getViewSettingDefaults=function(){var viewSettings=ListPage.prototype.getViewSettingDefaults.apply(this,arguments);return viewSettings.imageType="list",viewSettings},LogPage});