define(["exports","./../../modules/viewmanager/basesettingsview.js","./../../modules/loading/loading.js","./../../modules/common/responsehelper.js","./../../modules/emby-elements/emby-input/emby-input.js","./../../modules/emby-elements/emby-toggle/emby-toggle.js"],function(_exports,_basesettingsview,_loading,_responsehelper,_embyInput,_embyToggle){function DatabaseView(view,params){_basesettingsview.default.apply(this,arguments),view.querySelector("form").addEventListener("submit",function(e){_loading.default.show();var form=e.target.closest("form"),apiClient=this.getApiClient();return apiClient.getServerConfiguration().then(function(config){config.OptimizeDatabaseOnShutdown=form.querySelector(".chkOptimizeOnShutdown").checked,config.VacuumDatabaseOnStartup=form.querySelector(".chkVacuum").checked,config.DatabaseCacheSizeMB=form.querySelector(".txtCacheSize").value,config.DatabaseAnalysisLimit=form.querySelector(".txtAnalysisLimit").value,apiClient.updateServerConfiguration(config).then(_responsehelper.default.handleConfigurationSavedResponse)}),e.preventDefault(),e.stopPropagation(),!1}.bind(this))}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Object.assign(DatabaseView.prototype,_basesettingsview.default.prototype),DatabaseView.prototype.loadSettingsInternal=function(){return(instance=this).getApiClient().getServerConfiguration().then(function(config){var view=instance.view;view.querySelector(".chkOptimizeOnShutdown").checked=config.OptimizeDatabaseOnShutdown||!1,view.querySelector(".chkVacuum").checked=config.VacuumDatabaseOnStartup||!1,view.querySelector(".txtCacheSize").value=config.DatabaseCacheSizeMB||96,view.querySelector(".txtAnalysisLimit").value=config.DatabaseAnalysisLimit||400});var instance};_exports.default=DatabaseView});