define(["exports","./../modules/viewmanager/baseview.js","./../modules/loading/loading.js","./../modules/approuter.js","./../modules/common/globalize.js","./../modules/emby-elements/emby-input/emby-input.js","./../modules/emby-elements/emby-button/emby-button.js","./../modules/emby-elements/emby-select/emby-select.js","./../modules/emby-elements/emby-scroller/emby-scroller.js"],function(_exports,_baseview,_loading,_approuter,_globalize,_embyInput,_embyButton,_embySelect,_embyScroller){function onUpdateUserComplete(result){_loading.default.hide(),_approuter.default.show("wizard/wizardlibrary.html")}function onSubmit(e){var options,form=e.target;return form.querySelector(".txtPassword").value!==form.querySelector(".txtPasswordConfirm").value?(options=_globalize.default.translate("PasswordMatchError"),Emby.importModule("./modules/common/dialogs/alert.js").then(function(alert){return alert(options)})):function(form,apiClient){_loading.default.show(),apiClient.ajax({type:"POST",data:{Name:form.querySelector(".txtUsername").value,Password:form.querySelector(".txtPassword").value},url:apiClient.getUrl("Startup/User"),dataType:"json"}).then(onUpdateUserComplete)}(form,this.getApiClient()),e.preventDefault(),!1}function onBack(e){_approuter.default.back()}function View(view,params){_baseview.default.apply(this,arguments),view.querySelector("form").addEventListener("submit",onSubmit.bind(this)),view.querySelector(".button-cancel").addEventListener("click",onBack)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,require(["css!wizard/wizard.css"]),Object.assign(View.prototype,_baseview.default.prototype),View.prototype.onResume=function(options){_baseview.default.prototype.onResume.apply(this,arguments),_loading.default.show();var page=this.view,apiClient=this.getApiClient();apiClient.getJSON(apiClient.getUrl("Startup/User")).then(function(user){page.querySelector(".txtUsername").value=user.Name||"",_loading.default.hide()})};_exports.default=View});