"use strict";define(["app","handlebars","View","text!/v2/webapps/FirstAccess/AdminLogin/Templates/LoginTemplate.html","utils","bootstrap","bootstrap-toggle"],function(d,g,f,e,a){var b=0;var c=f.extend({loginTemplate:g.compile(e),events:{"submit form":"submit","click #passwordShowHide":"showPassword","click #dismiss":"hideErrorArea","keypress #userPassword":"enterValues","focus #userName":"hideErrorName"},submit:function(h){h.preventDefault();if(!$("#userName").val().trim()){$("#userValid").show();$("#userName").addClass("userNameError");$("#passwordShowHide").addClass("btn-hideshow-offset");return false;}this.trigger("view:submit");return true;},showPassword:function(i){var h=$("#userPassword").attr("type");if(h!="text"){$(".btn-hideshow").val(a.localize(this,["adminlogin.hide"]));$("#userPassword").attr("type","text");}else{$(".btn-hideshow").val(a.localize(this,["adminlogin.show"]));$("#userPassword").attr("type","password");}},hideErrorArea:function(h){$("#errorarea").addClass("error-no-show-area");$("#errorarea").children("div").addClass("error-no-show");},hideErrorName:function(h){$("#userValid").hide();$("#userName").removeClass("userNameError");$("#passwordShowHide").removeClass("btn-hideshow-offset");},enterValues:function(h){if(b===1&&h.which!==8&&h.which!==0&&h.which!=10&&h.which!=13&&(h.which<48||h.which>57)){return false;}},initialize:function(h){f.prototype.initialize.apply(this,arguments);this.options=h||{};},render:function(h){f.prototype.render.apply(this,arguments);this.$el.html(this.loginTemplate(h));this.$el.find("#userName").attr("maxlength","16");b=h.LoginMode;if(b===0){this.$el.find("#userPassword").attr("placeholder",a.localize(this,["adminlogin.password"]));this.$el.find("#userPassword").attr("maxlength","30");}else{this.$el.find("#userPassword").attr("placeholder",a.localize(this,["adminlogin.pin"]));this.$el.find("#userPassword").attr("maxlength","10");}this.$el.find("#footerTemplate").prepend(this.$el.find("#adminloginfooter").html());return this;}});return c;});