define(["exports","./../list/list.js","./../modules/common/globalize.js","./../modules/common/servicelocator.js","./../modules/emby-elements/emby-scroller/emby-scroller.js","./../modules/emby-elements/emby-button/emby-button.js","./../modules/emby-elements/emby-toggle/emby-toggle.js","./../modules/common/textencoding.js","./../modules/commandprocessor.js"],function(_exports,_list,_globalize,_servicelocator,_embyScroller,_embyButton,_embyToggle,_textencoding,_commandprocessor){function LogPage(view,params){var apiClient=ApiClient,apiClient=(params.serverId=apiClient.serverId(),this.supportsViewSettings=!1,this.hasOtherViewButtons=!0,this.enableTotalRecordCountDisplay=!1,""),apiClient=(apiClient=(apiClient=(apiClient=(apiClient=(apiClient=(apiClient+="<div>")+('<h2 style="margin-top:0;">'+_textencoding.default.htmlEncode(params.name)+"</h2>"))+'<div class="readOnlyContent">'+'<div class="checkboxContainer fldSanitize">')+'<label style="width:auto;">'+'<input type="checkbox" is="emby-toggle" class="chkSanitize" checked />')+("<span>"+_globalize.default.translate("AnonymizeLogContents")+"</span>"))+"</label>"+"</div>",_servicelocator.appHost.supports("filedownload")&&(apiClient+='<button is="emby-button" type="button" class="raised raised-mini btnDownload" style="margin-inline-start:0;"><i class="md-icon button-icon button-icon-left">download</i>'+_globalize.default.translate("Download")+"</button>"),_servicelocator.appHost.supports("targetblank")&&(apiClient+='<a is="emby-linkbutton" href="#" target="_blank" class="raised raised-mini btnOpen"><i class="md-icon button-icon button-icon-left autortl">&#xe89e;</i>'+_globalize.default.translate("HeaderOpenInNewWindow")+"</a>"),apiClient=apiClient+"</div>"+"</div>",view.querySelector(".itemsViewSettingsContainer").insertAdjacentHTML("beforebegin",apiClient),view.querySelector(".btnDownload"));apiClient&&apiClient.addEventListener("click",function(){var item={Name:this.params.name,Type:"Log",ServerId:this.params.serverId};_commandprocessor.default.executeCommand("download",[item],{Sanitize:this.view.querySelector(".chkSanitize").checked})}.bind(this)),view.querySelector(".chkSanitize").addEventListener("change",function(){this.setNewWindowHref(),this.itemsContainer.refreshItems()}.bind(this)),view.classList.add("logView"),_list.default.call(this,view,params),this.setNewWindowHref()}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,require(["flexStyles","css!logs/log.css"]),Object.assign(LogPage.prototype,_list.default.prototype),LogPage.prototype.getBaseQuery=function(item){var query=_list.default.prototype.getBaseQuery.apply(this,arguments);return query.name=this.params.name,query.Sanitize=this.view.querySelector(".chkSanitize").checked,query},LogPage.prototype.setNewWindowHref=function(){var params=this.params;this.view.querySelector(".btnOpen").href=ApiClient.getLogDownloadUrl({Name:params.name,Sanitize:this.view.querySelector(".chkSanitize").checked})},LogPage.prototype.virtualChunkSize=function(){return 100},LogPage.prototype.getApiClientQueryMethodName=function(){return"getLogLines"},LogPage.prototype.getItemTypes=function(){return["LogLine"]},LogPage.prototype.getBaseListRendererOptions=function(){var options=_list.default.prototype.getBaseListRendererOptions.apply(this,arguments);return options.draggable=!1,options.multiSelect=!1,options},LogPage.prototype.getBaseListRendererOptions=function(){var options=_list.default.prototype.getBaseListRendererOptions.apply(this,arguments);return options.draggable=!1,options.action="none",options.contextMenu=!1,options.multiSelect=!1,options},LogPage.prototype.getListViewOptions=function(items,settings){var options=_list.default.prototype.getListViewOptions.apply(this,arguments);return options.image=!1,options.moreButton=!1,options.fields=["LogLine"],options.highlight=!1,options.verticalPadding=!1,options.code=!0,options},LogPage.prototype.getSettingsKey=function(){return"log"},LogPage.prototype.setTitle=function(){},LogPage.prototype.getSortMenuOptions=function(){return[]},LogPage.prototype.getViewSettingDefaults=function(){var viewSettings=_list.default.prototype.getViewSettingDefaults.apply(this,arguments);return viewSettings.imageType="list",viewSettings},_exports.default=LogPage});