define(["exports","./../modules/viewmanager/basesettingsview.js","./../modules/emby-elements/emby-input/emby-input.js","./../modules/emby-elements/emby-button/emby-button.js","./../modules/common/responsehelper.js","./../modules/loading/loading.js"],function(_exports,_basesettingsview,_embyInput,_embyButton,_responsehelper,_loading){function loadData(page,params,apiClient){_loading.default.show();var params=params.id,promise1=apiClient.getJSON(apiClient.getUrl("Devices/Info",{Id:params})),apiClient=apiClient.getJSON(apiClient.getUrl("Devices/Options",{Id:params}));return Promise.all([promise1,apiClient]).then(function(responses){!function(page,device,deviceOptions){page.querySelector(".txtCustomName").value=deviceOptions.CustomName||"",page.querySelector(".reportedName").textContent=device.Name||""}(page,responses[0],responses[1]),_loading.default.hide()})}function onSubmit(e){return function(form,instance){var id=instance.params.id;(instance=instance.getApiClient()).ajax({url:instance.getUrl("Devices/Options",{Id:id}),type:"POST",data:JSON.stringify({CustomName:form.querySelector(".txtCustomName").value}),contentType:"application/json"}).then(_responsehelper.default.handleConfigurationSavedResponse)}(e.target,this),e.preventDefault(),!1}function View(view,params){_basesettingsview.default.apply(this,arguments),view.querySelector("form").addEventListener("submit",onSubmit.bind(this))}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Object.assign(View.prototype,_basesettingsview.default.prototype),View.prototype.loadSettingsInternal=function(){return loadData(this.view,this.params,this.getApiClient())};_exports.default=View});