"use strict";define(["app","handlebars","View","text!/v2/webapps/FirstAccess/Home/Templates/HomeTemplate.html","utils"],function(c,f,e,d,b){var a=e.extend({homeTemplate:f.compile(d),findMethod1:null,findMethod2:null,events:{"submit form":"findAppt"},findAppt:function(j){j.preventDefault();var g=this.$el.find("#patientId").val();c.instance().Cache.PatientId=g;var h=this.$el.find("#day").val();var i=this.$el.find("#month option:selected").val();if($("form")[0].checkValidity()){this.trigger("view:submit",g,h,i,this.findMethod1,this.findMethod2);}},initialize:function(g){e.prototype.initialize.apply(this,arguments);this.options=g||{};},showDayOfBirth:function(){this.findMethod2=1;this.$el.find("#day").val("");this.$el.find("#birthdayfieldset").removeAttr("disabled").show();this.$el.find("#birthdayfieldset .help-info").removeClass("hidden");},render:function(h){e.prototype.render.apply(this,arguments);this.findMethod1=h.FindMethod1;this.findMethod2=h.FindMethod2;h.months=_.map(["home.Jan","home.Feb","home.Mar","home.Apr","home.May","home.Jun","home.Jul","home.Aug","home.Sep","home.Oct","home.Nov","home.Dec"],function(j,k){return{val:++k,text:b.localize(this,[j])};});this.$el.html(this.homeTemplate(h));var i=this.findMethod1===0?b.localize(this,["home.patientId"]):this.findMethod1===1?b.localize(this,["home.name"]):b.localize(this,["home.patientIdName"]);var g=this.findMethod1===0?b.localize(this,["home.enterPatientId"]):this.findMethod1===1?b.localize(this,["home.enterName"]):b.localize(this,["home.enterPatientIdName"]);this.$el.find(".patient-label").text(i);this.$el.find("#patientId").prop("placeholder",g);if(this.findMethod2===0){this.$el.find("#birthdayfieldset").attr("disabled","disabled").hide();this.$el.find("#day").val("1");}this.$el.find(".logo").css({background:"url("+c.instance().Cache.logo+")"});this.$el.find("#build-number").append("<span>&nbsp;"+b.localize(this,["FirstAccess.kioskProfile",c.instance().Cache.profileId])+"</span>");if(h.AutofocusFirstField){this.$el.find("#patientId").attr("autofocus","autofocus");this.$el.find("#patientId").trigger("focus");}return this;}});return a;});