define(["../list/list","globalize","emby-linkbutton","flexStyles","emby-toggle"],function(ListPage,globalize){"use strict";function ApiKeysPage(view,params){params.serverId=ApiClient.serverId(),this.supportsPlayback=!1,this.supportsViewSettings=!1,this.enableAlphaNumericShortcuts=!1,ListPage.call(this,view,params),function(view){view.querySelector(".listTotalRecordCount").insertAdjacentHTML("afterend",'<button is="emby-button" type="button" class="raised raised-mini btnAdd submit" style="margin-left:.5em;" title="'+globalize.translate("HeaderNewApiKey")+'" aria-label="'+globalize.translate("HeaderNewApiKey")+'"><i class="md-icon button-icon button-icon-left">&#xE145;</i><span>'+globalize.translate("HeaderNewApiKey")+"</span></button>")}(view),view.querySelector(".btnAdd").addEventListener("click",function(){var instance=this;require(["prompt"],function(prompt){prompt({title:globalize.translate("HeaderNewApiKey"),label:globalize.translate("LabelAppName"),description:globalize.translate("LabelAppNameExample")}).then(function(value){ApiClient.ajax({type:"POST",url:ApiClient.getUrl("Auth/Keys",{App:value})}).then(function(){instance.itemsContainer.refreshItems()})})})}.bind(this))}return Object.assign(ApiKeysPage.prototype,ListPage.prototype),ApiKeysPage.prototype.getApiClientQueryMethodName=function(){return"getApiKeys"},ApiKeysPage.prototype.getListViewOptions=function(items,settings){var options=ListPage.prototype.getListViewOptions.apply(this,arguments);return options.moreButton=!1,options.action="none",options.enableDefaultIcon=!0,options.deleteButton=!0,options.showAccessToken=!0,options.showDateCreated=!0,options.transparentIcon=!0,options.draggable=!1,options.multiSelect=!1,options},ApiKeysPage.prototype.getSettingsKey=function(){return"apikeys"},ApiKeysPage.prototype.setTitle=function(){},ApiKeysPage.prototype.getSortMenuOptions=function(){return[]},ApiKeysPage.prototype.getVisibleFilters=function(){return[]},ApiKeysPage.prototype.getVisibleViewSettings=function(){return{}},ApiKeysPage.prototype.getViewSettingDefaults=function(){var viewSettings=ListPage.prototype.getViewSettingDefaults.apply(this,arguments);return viewSettings.imageType="list",viewSettings},ApiKeysPage});