define(["exports","./../../modules/tabbedview/basetab.js","./../../modules/loading/loading.js","./../../modules/emby-elements/emby-input/emby-input.js","./../../modules/emby-elements/emby-button/emby-button.js","./../../modules/emby-elements/emby-toggle/emby-toggle.js","./../../modules/emby-elements/emby-select/emby-select.js","./../../modules/emby-elements/emby-scroller/emby-scroller.js","./../../modules/emby-elements/emby-button/paper-icon-button-light.js","./../../modules/common/responsehelper.js"],function(_exports,_basetab,_loading,_embyInput,_embyButton,_embyToggle,_embySelect,_embyScroller,_paperIconButtonLight,_responsehelper){function View(view,params){_basetab.default.apply(this,arguments)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Object.assign(View.prototype,_basetab.default.prototype),View.prototype.loadTemplate=function(){return require(["text!server/sync/settingstab.html"])},View.prototype.onTemplateLoaded=function(){_basetab.default.prototype.onTemplateLoaded.apply(this,arguments);var view=this.view;view.querySelector(".btnSelectSyncTempPath").addEventListener("click",function(){Emby.importModule("./modules/directorybrowser/directorybrowser.js").then(function(directoryBrowser){var picker=new directoryBrowser;picker.show({callback:function(path){path&&(view.querySelector(".txtSyncTempPath").value=path),picker.close()},validateWriteable:!0})})}),view.querySelector("form").addEventListener("submit",function(e){_loading.default.show();var form=e.target.closest("form"),apiClient=this.getApiClient();return apiClient.getNamedConfiguration("sync").then(function(config){config.TemporaryPath=form.querySelector(".txtSyncTempPath").value,config.EnableFullSpeedTranscoding=form.querySelector(".chkEnableFullSpeedConversion").checked,apiClient.updateNamedConfiguration("sync",config).then(_responsehelper.default.handleConfigurationSavedResponse)}),e.preventDefault(),e.stopPropagation(),!1}.bind(this))},View.prototype.onResume=function(options){_basetab.default.prototype.onResume.apply(this,arguments),_loading.default.show();var page=this.view;this.getApiClient().getNamedConfiguration("sync").then(function(config){!function(page,config){page.querySelector(".txtSyncTempPath").value=config.TemporaryPath||"",page.querySelector(".chkEnableFullSpeedConversion").checked=config.EnableFullSpeedTranscoding,_loading.default.hide()}(page,config)})};_exports.default=View});