define(["exports","./../list/list.js","./../modules/emby-elements/emby-select/emby-select.js","./../modules/emby-elements/emby-scroller/emby-scroller.js","./../modules/emby-elements/emby-button/emby-button.js","./../modules/common/globalize.js","./../modules/common/servicelocator.js"],function(_exports,_list,_embySelect,_embyScroller,_embyButton,_globalize,_servicelocator){function addLogLevelToggle(view){var html=(html=(html='<div class="readOnlyContent flex padded-top"><div class="selectContainer" style="margin-bottom:0;">')+'<select is="emby-select" class="selectLogLevel" label="'+_globalize.default.translate("LabelEnableDebugLogging")+'" >'+function(){var html="";return(html+='<option value="yes">'+_globalize.default.translate("Yes")+"</option>")+('<option value="restart">'+_globalize.default.translate("YesUntilServerRestart")+"</option>")+('<option value="rotate">'+_globalize.default.translate("YesUntilLogRotate")+"</option>")+('<option value="">'+_globalize.default.translate("No")+"</option>")}()+"</select>")+'<div class="fieldDescription">'+_globalize.default.translate("EnableDebugLoggingHelp")+"</div></div></div>";view.querySelector(".itemsViewSettingsContainer").insertAdjacentHTML("beforebegin",html)}function onLogLevelChanged(){var value=this.value;ApiClient.getServerConfiguration().then(function(config){config.EnableDebugLevelLogging=!!value,config.EnableDebugLevelLogging?config.RevertDebugLogging="yes"===value?null:value:config.RevertDebugLogging=null,ApiClient.updateServerConfiguration(config)})}function LogsPage(view,params){params.serverId=ApiClient.serverId(),this.enableAlphaNumericShortcuts=!1,_list.default.call(this,view,params),addLogLevelToggle(view),view.querySelector(".selectLogLevel").addEventListener("change",onLogLevelChanged)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,require(["flexStyles"]),Object.assign(LogsPage.prototype,_list.default.prototype),LogsPage.prototype.onResume=function(options){var view;_list.default.prototype.onResume.apply(this,arguments),view=this.view,ApiClient.getServerConfiguration().then(function(config){var value="";config.EnableDebugLevelLogging&&(value="restart"===config.RevertDebugLogging?"restart":"rotate"===config.RevertDebugLogging?"rotate":"yes"),view.querySelector(".selectLogLevel").value=value})},LogsPage.prototype.getApiClientQueryMethodName=function(){return"getLogs"},LogsPage.prototype.getBaseListRendererOptions=function(){var options=_list.default.prototype.getBaseListRendererOptions.apply(this,arguments);return options.draggable=!1,options.action="link",options},LogsPage.prototype.getListViewOptions=function(items,settings){var options=_list.default.prototype.getListViewOptions.apply(this,arguments);return options.image=!1,options.transparentIcon=!0,options.enableDefaultIcon=!0,options.moreButton=!1,options.downloadButton=_servicelocator.appHost.supports("filedownload"),options.openInNewWindowButton=!0,options},LogsPage.prototype.getCardOptions=function(items,settings){var options=_list.default.prototype.getCardOptions.apply(this,arguments);return options.shape="backdrop",options.defaultBackground=!0,options},LogsPage.prototype.getItemTypes=function(){return["Log"]},LogsPage.prototype.getSettingsKey=function(){return"logs"},LogsPage.prototype.setTitle=function(){},LogsPage.prototype.supportsViewType=function(viewType){return"datagrid"!==viewType},LogsPage.prototype.getViewSettingDefaults=function(){var viewSettings=_list.default.prototype.getViewSettingDefaults.apply(this,arguments);return viewSettings.imageType="list",viewSettings},LogsPage.prototype.getItemCountText=function(numItems){return 1===numItems?_globalize.default.translate("OneLog"):_globalize.default.translate("LogCountValue",numItems)},_exports.default=LogsPage});