define(["globalize","loading","libraryMenu","emby-checkbox","emby-button","emby-linkbutton"],function(globalize,loading,libraryMenu){"use strict";function getTabs(){return[{href:"library.html",name:globalize.translate("HeaderLibraries")},{href:"librarydisplay.html",name:globalize.translate("TabDisplay")},{href:"metadataimages.html",name:globalize.translate("TabMetadata")},{href:"librarysettings.html",name:globalize.translate("TabAdvanced")}]}return function(view,params){function loadData(){ApiClient.getServerConfiguration().then(function(config){view.querySelector(".chkDisplaySpecialsWithinSeasons").checked=config.DisplaySpecialsWithinSeasons,view.querySelector(".chkExternalContentInSuggestions").checked=config.EnableExternalContentInSuggestions})}view.querySelector("form").addEventListener("submit",function(e){loading.show();var form=this;return ApiClient.getServerConfiguration().then(function(config){config.DisplaySpecialsWithinSeasons=form.querySelector(".chkDisplaySpecialsWithinSeasons").checked,config.EnableExternalContentInSuggestions=form.querySelector(".chkExternalContentInSuggestions").checked,ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult)}),e.preventDefault(),!1}),view.addEventListener("viewshow",function(){libraryMenu.setTabs("librarysetup",1,getTabs),loadData()})}});