Lennar.DocReady(function(){var n=document.querySelectorAll(".vue-account-info-edit");Array.prototype.forEach.call(n,function(n){new Vue({el:n,data:{submitting:!1,lennarUserId:"",fullName:"",fullNameErr:"",email:"",emailErr:"",emailConfirm:"",emailConfirmErr:"",email2:"",phone:"",phoneErr:"",phoneSecondary:"",phoneSecondaryErr:"",country:"",countryOptions:[],streetAddress:"",streetAddressSecondary:"",city:"",state:"",stateOptions:[],zip:"",zipErr:""},mounted:function(){axios.get("/Services/Rest/Profile.svc/GetUserProfile").then(function(n){if(n&&n.data){var t=JSON.parse(n.data);t.FirstName&&(this.fullName=t.FirstName+" "+t.LastName,this.email=t.Email,this.emailConfirm=t.Email,this.phone=t.HomePhone,this.$refs.inputPhone.phone=t.HomePhone,this.phoneSecondary=t.CellPhone,this.$refs.inputPhoneSecondary.phone=t.CellPhone,this.country=t.Country,this.streetAddress=t.Street1,this.streetAddressSecondary=t.Street2,this.city=t.City,this.state=t.State,this.zip=t.ZipCode)}}.bind(this)).catch(function(n){console.log(n)});Lennar.Vue.Utils.GetCountries(this.countryOptions);Lennar.Vue.Utils.GetAllStates(this.stateOptions)},components:{"vue-tel-input":VueTelInput.VueTelInput,"vue-search-select":VueSearchSelect.ModelSelect},methods:{validate:function(n){var r=!0,i,t=null,u,f;return n&&n.type=="blur"&&(t=n.target),t&&t!=this.$refs.inputFullName||(this.fullNameErr=""),u=this.fullName.split(" "),(!t||t==this.$refs.inputFullName)&&u.length<2&&(this.fullNameErr=lr_gb.enterFullName,i=this.$refs.inputFullName,r=!1),t&&t!=this.$refs.inputEmail||(this.emailErr=""),t&&t!=this.$refs.inputEmail||Lennar.Vue.Utils.ValidateEmail(this.email)||(this.emailErr=lr_gb.validEmail,i=this.$refs.inputEmail,r=!1),t&&t!=this.$refs.inputConfirmEmail||(this.emailConfirmErr=""),t&&t!=this.$refs.inputConfirmEmail||this.email==this.emailConfirm||(this.emailConfirmErr=lr_gb.emailMatch,i=this.$refs.inputConfirmEmail,r=!1),t&&t!=this.$refs.inputPhone||(this.phoneErr=""),(!t||t==this.$refs.inputPhone)&&this.phone.length>0&&!this.$refs.inputPhone.phoneObject.isValid&&(this.phoneErr=lr_gb.invalidPhone,i=this.$refs.inputPhone,r=!1),t&&t!=this.$refs.inputPhoneSecondary||(this.phoneSecondaryErr=""),(!t||t==this.$refs.inputPhoneSecondary)&&this.phoneSecondary.length>0&&!this.$refs.inputPhoneSecondary.phoneObject.isValid&&(this.phoneSecondaryErr=lr_gb.invalidPhone,i=this.$refs.inputPhoneSecondary,r=!1),t&&t!=this.$refs.inputZip||(this.zipErr=""),t&&t!=this.$refs.inputZip||this.zip!==""?t&&t!=this.$refs.inputZip||this.country!="US"||Lennar.Vue.Utils.ValidateZipCode(this.zip)||(this.zipErr=lr_gb.invalidZipCode,i=this.$refs.inputZip,r=!1):(this.zipErr=lr_gb.enterZipCode,i=this.$refs.inputZip,r=!1),!r&&i&&(f={easing:"ease-in-out",offset:-100,onDone:function(){t||i.focus()}},VueScrollTo.scrollTo(i,300,f)),r},submit:function(){var n,t,i,r;Lennar.Vue.Utils.CleanInstanceXss(this);this.validate()&&this.email2===""&&!this.submitting&&(n=this.fullName.split(" "),t=n[0],n.splice(0,1),i=n.join(" "),r={email:this.email,firstName:t,lastName:i,street1:this.streetAddress,street2:this.streetAddressSecondary,city:this.city,state:this.state,zipCode:this.zip,country:this.country,primaryPhone:this.phone,secondaryPhone:this.phoneSecondary},axios.post("/Services/Rest/Profile.svc/SaveProfileInformation",r).then(function(n){if(n&&n.data){var t=JSON.parse(n.data);t.Status=="Success"?this.closeModal():console.log(JSON.stringify(t))}}.bind(this)).catch(function(n){console.log(n)}))},closeModal:function(){parent.Lennar.Vue.Utils.CloseUrlModal()}}})})},"VueAccountInfoEdit");Lennar.DocReady(function(){var n=document.querySelectorAll(".vue-add-edit-contact");Array.prototype.forEach.call(n,function(n){new Vue({el:n,data:{submitting:!1,lennarUserId:"",contactId:"",contactMode:Lennar.Global.GetQueryStringParameterByName("cm"),fullName:"",fullNameErr:"",email:"",email2:"",phone:"",phoneSecondary:"",companyName:"",title:"",streetAddress:"",streetAddressSecondary:"",city:"",state:"",stateOptions:[],zip:""},mounted:function(){if(this.lennarUserId=this.$refs.hidLennarUserId.value,Lennar.Vue.Utils.GetAllStates(this.stateOptions),this.contactMode=="Edit"){this.contactId=Lennar.Global.GetQueryStringParameterByName("ci");var t={contactID:this.contactId,lennarUserId:this.lennarUserId},n=this;axios.post("/Services/Rest/Profile.svc/getUsrContact",t,{headers:{"Content-Type":"application/json"}}).then(function(t){if(t&&t.data){var i=t.data;n.contactId=i.id;n.fullName=i.fn+" "+i.ln;n.email=i.em;n.phone=i.ph;n.phoneSecondary=i.mp;n.companyName=i.co;n.title=i.ti;n.streetAddress=i.ad;n.streetAddressSecondary=i.a2;n.city=i.cy;n.state=i.st;n.zip=i.zp}}).catch(function(n){console.log(n)})}},components:{"vue-tel-input":VueTelInput.VueTelInput,"vue-search-select":VueSearchSelect.ModelSelect},methods:{validate:function(n){var r=!0,i,t=null,u,f;return n&&n.type=="blur"&&(t=n.target),t&&t!=this.$refs.inputFullName||(this.fullNameErr=""),u=this.fullName.split(" "),(!t||t==this.$refs.inputFullName)&&u.length<2&&(this.fullNameErr=lr_gb.enterFullName,i=this.$refs.inputFullName,r=!1),!r&&i&&(f={easing:"ease-in-out",offset:-100,onDone:function(){t||i.focus()}},VueScrollTo.scrollTo(i,300,f)),r},submit:function(){var t,i,r,n,u;Lennar.Vue.Utils.CleanInstanceXss(this);this.validate()&&this.email2===""&&!this.submitting&&(t=this.fullName.split(" "),i=t[0],t.splice(0,1),r=t.join(" "),n={},n.id=this.contactId,n.id.length==0&&(n.id=0),n.fn=i,n.ln=r,n.em=this.email,n.ph=this.phone,n.mp=this.phoneSecondary,n.co=this.companyName,n.ad=this.streetAddress,n.a2=this.streetAddressSecondary,n.st=this.state,n.zp=this.zip,n.cy=this.city,n.ti=this.title,n.fx="",u=this,axios.post("/Services/Rest/Profile.svc/saveUsrContacts",JSON.stringify({contact:n}),{headers:{"Content-Type":"application/json"}}).then(function(n){n&&n.data&&n.data.IsSuccessful&&u.closeModal()}).catch(function(n){console.log(n)}))},closeModal:function(){parent.Lennar.Vue.Utils.CloseUrlModal()}}})})},"VueAddEditContact");Lennar.DocReady(function(){var n=document.querySelectorAll(".vue-appointment-modal");Array.prototype.forEach.call(n,function(n){new Vue({el:n,data:{isLoggedIn:Lennar.Global.actorStatus>0,submitting:!1,success:!1,fullName:"",fullNameErr:"",email:"",emailErr:"",email2:"",phone:"",phoneErr:"",zip:"",zipErr:"",apptDate:"",apptDateErr:"",apptDateDisplay:"",apptTime:"",apptTimeErr:"",apptTimeDisplay:"",apptTimeOptions:[],disabledDates:{},hasRealtor:"no",realtorDisplayMode:0,realtorFullName:"",realtorFullNameErr:"",realtorEmail:"",realtorEmailErr:"",realtorCompanyName:"",realtorCompanyNameErr:"",comments:"",commentsErr:"",contextIsMobile:"",communityId:"",communityNumber:"",planId:"",inventoryId:"",username:"",usernameErr:"",password:"",passwordErr:"",appointmentId:"",appointmentBaseURL:"",appointmentContextURL:"",appointmentStaff:"",cancel:!1,cancelSuccess:!1,cancelComments:""},watch:{apptDate:function(){this.dateSelected()}},mounted:function(){var n,t;this.cancel=Lennar.Global.GetQueryStringParameterByName("cancel")=="1";this.fillUserData();n=new Date;n.setDate(n.getDate()-1);this.disabledDates={to:n};this.communityNumber=this.$refs.hidCommunityNumber.value;this.appointmentBaseURL=this.$refs.hidAppointmentBaseURL.value;this.appointmentContextURL=this.$refs.hidAppointmentContextURL.value;this.communityId=Lennar.Global.GetQueryStringParameterByName("cid");this.planId=Lennar.Global.GetQueryStringParameterByName("pid");this.inventoryId=Lennar.Global.GetQueryStringParameterByName("iid");this.appointmentId=Lennar.Global.GetQueryStringParameterByName("apt");this.appointmentId.length>0?this.loadAppointmentDetails():this.realtorDisplayMode=Math.floor(Math.random()*3);t=this},components:{"vue-tel-input":VueTelInput.VueTelInput,datepicker:vuejsDatepicker,"vue-search-select":VueSearchSelect.ModelSelect},methods:{fillContext:function(){this.contextIsMobile=this.$refs.hidIsMobile.value},fillUserData:function(){this.isLoggedIn&&axios.get("/Services/Rest/Profile.svc/GetUserProfile").then(function(n){if(n&&n.data){var t=JSON.parse(n.data);t.FirstName&&(this.fullName=t.FirstName+" "+t.LastName,this.email=t.Email,this.phone=t.HomePhone,this.zip=t.ZipCode)}}.bind(this)).catch(function(n){console.log(n)})},validate:function(n){var r=!0,i,t=null,u,f;return n&&n.type=="blur"&&(t=n.target),t&&t!=this.$refs.inputComments||(this.commentsErr=""),t&&t!=this.$refs.inputComments||this.comments!==""||(this.commentsErr=lr_gb.enterComment,i=this.$refs.inputComments,r=!1),t&&t!=this.$refs.inputZip||(this.zipErr=""),t&&t!=this.$refs.inputZip||this.zip!==""?t&&t!=this.$refs.inputZip||Lennar.Vue.Utils.ValidateZipCode(this.zip)||(this.zipErr=lr_gb.invalidZipCode,i=this.$refs.inputZip,r=!1):(this.zipErr=lr_gb.enterZipCode,i=this.$refs.inputZip,r=!1),t&&t!=this.$refs.inputPhone||(this.phoneErr=""),t&&t!=this.$refs.inputPhone||this.$refs.inputPhone.phoneObject.isValid||(this.phoneErr=lr_gb.invalidPhone,i=this.$refs.inputPhone,r=!1),t&&t!=this.$refs.inputEmail||(this.emailErr=""),t&&t!=this.$refs.inputEmail||Lennar.Vue.Utils.ValidateEmail(this.email)||(this.emailErr=lr_gb.validEmail,i=this.$refs.inputEmail,r=!1),t&&t!=this.$refs.inputFullName||(this.fullNameErr=""),u=this.fullName.split(" "),(!t||t==this.$refs.inputFullName)&&u.length<2&&(this.fullNameErr=lr_gb.enterFullName,i=this.$refs.inputFullName,r=!1),t&&t!=this.$refs.inputDate||(this.apptDateErr=""),t&&t!=this.$refs.inputDate||this.apptDate!==""||(this.apptDateErr=lr_gb.selectDate,i=this.$refs.inputDate,r=!1),t&&t!=this.$refs.inputAppointmentTime||(this.apptTimeErr=""),(t&&t!=this.$refs.inputAppointmentTime||this.apptTime!=="")&&typeof this.apptTime!="undefined"||(this.apptTimeErr=lr_gb.selectTime,i=this.$refs.inputAppointmentTime,r=!1),t&&t!=this.$refs.inputRealtorFullName||(this.realtorFullNameErr=""),u=this.realtorFullName.split(" "),(!t||t==this.$refs.inputRealtorFullName)&&this.hasRealtor=="yes"&&this.realtorDisplayMode==2&&u.length<2&&(this.realtorFullNameErr=lr_gb.enterFullName,i=this.$refs.inputRealtorFullName,r=!1),t&&t!=this.$refs.inputRealtorEmail||(this.realtorEmailErr=""),t&&t!=this.$refs.inputRealtorEmail||this.hasRealtor!="yes"||this.realtorDisplayMode!=2||Lennar.Vue.Utils.ValidateEmail(this.realtorEmail)||(this.realtorEmailErr=lr_gb.validEmail,i=this.$refs.inputRealtorEmail,r=!1),t&&t!=this.$refs.inputRealtorCompanyName||(this.realtorCompanyNameErr=""),t&&t!=this.$refs.inputRealtorCompanyName||this.hasRealtor!="yes"||this.realtorDisplayMode!=2||this.realtorCompanyName!==""||(this.realtorCompanyNameErr=lr_gb.enterCompanyName,i=this.$refs.inputRealtorCompanyName,r=!1),!r&&i&&(f={easing:"ease-in-out",offset:-100,onDone:function(){t||i.focus()}},VueScrollTo.scrollTo(i,300,f)),r},validateSignIn:function(){var n=!0;return this.usernameErr="",this.username.length>0&&!Lennar.Vue.Utils.ValidateEmail(this.username)&&(this.usernameErr=lr_gb.validEmail,n=!1),n},dateSelected:function(){this.apptTimeOptions=[{optionVal:"",optionText:"Loading..."}];this.submitting=!0;var n=this,t=$j(n.$refs.inputAppointmentTime);Vue.nextTick(function(){var t=moment(n.apptDate).format("YYYYMMDD");axios.get("/Services/Rest/Appointments.svc/GetOpenSlots/"+n.communityNumber+"/"+t,{headers:{"Content-Type":"application/json"}}).then(function(t){var u,i,r,f;if(t&&t.data){n.submitting=!1;n.apptTimeOptions=[];u=[];for(i in t.data)r=moment(t.data[i].date,"YYYYMMDD"),r.add(t.data[i].start_time,"minutes"),f={dataDate:t.data[i].date,dataLocation:t.data[i].c_id,dataStaff:t.data[i].employee_id,dataValue:t.data[i].start_time,displayText:r.format("hh:mm A"),value:t.data[i].start_time,text:r.format("hh:mm A")},u.push(f);n.apptTimeOptions=u;Lennar.Global.PardotRfi("hidPardotiframeAppointmentModal",n.email)}else n.apptTimeOptions=[{value:"",text:"-No Available-",dataDate:"",dataLocation:"",dataStaff:"",dataValue:"",displayText:"-No Available-"}]}).catch(function(t){n.submitting=!1;console.log(t)})})},submit:function(){Lennar.Vue.Utils.CleanInstanceXss(this);this.validate()&&this.email2===""&&!this.submitting&&(this.fillContext(),this.apptDateDisplay=moment(this.apptDate).format("dddd, MMMM D, YYYY"),this.apptTimeDisplay=this.$refs.inputAppointmentTime.inputText,this.appointmentId.length>0?this.updateAppointment():this.bookAppointment())},bookAppointment:function(){var i=this.fullName.split(" "),f=i[0],t;i.splice(0,1);var e=i.join(" "),r=this.realtorFullName.split(" "),o=r[0];r.splice(0,1);var s=r.join(" "),u=this.$refs.inputAppointmentTime.options[this.$refs.inputAppointmentTime.pointer],n={};n.firstName=f;n.lastName=e;n.email=this.email;n.phone=this.phone;n.zipCode=this.zip;n.date=moment(this.apptDate).format("YYYYMMDD");n.time=this.apptTime;n.location=u.dataLocation;n.staff=u.dataStaff;n.realtorDisplayMode=this.realtorDisplayMode;n.hasRealtor=this.hasRealtor=="yes";n.realtorFirstName=o;n.realtorLastName=s;n.realtorCompany=this.realtorCompanyName;n.realtorEmail=this.realtorEmail;n.comments=this.comments;n.notes=this.appointmentContextURL;t=this;this.submitting=!0;axios.post("/Services/Rest/Appointments.svc/CreateAppointment",JSON.stringify(n),{headers:{"Content-Type":"application/json"}}).then(function(n){if(n!=null&&n!=""&&n!=undefined)t.insertLead(),t.setAppointmentLink(n,t.email);else{t.apptTimeErr==lr_gb.timeUnavailable;var i=this.$refs.inputAppointmentTime,r={easing:"ease-in-out",offset:-100,onDone:function(){i.focus()}};VueScrollTo.scrollTo(i,300,r);t.dateSelected()}}).catch(function(n){t.submitting=!1;console.log(n)})},insertLead:function(){var n={};n.firstName=firstName;n.lastName=lastName;n.email=this.email;n.phone=this.phone;n.zipCode=this.zip;n.comments=this.comments;n.hasRealtor=this.hasRealtor=="yes";n.realtorFirstName=realtorFirstName;n.realtorLastName=realtorLastName;n.realtorCompany=this.realtorCompanyName;n.realtorEmail=this.realtorEmail;n.comId=this.communityId;n.planId=this.planId;n.invId=this.inventoryId;n.source="WEB";axios.post("/Services/Rest/Appointments.svc/InsertLead",JSON.stringify(n),{headers:{"Content-Type":"application/json"}}).then(function(){}).catch(function(n){console.log(n)})},setAppointmentLink:function(n,t){var i=this.appointmentBaseURL,r;i=i+"?e=1&a="+btoa(n.appt_id)+"&m="+btoa(t);i="If you need to cancel or reschedule your appointment, you may do so through our Web site or give us a call.<br/><a target='_blank' href='"+i+"'>"+i+"<\/a>";r=this;params={};params.apptId=n.appt_id;params.link=i;axios.post("/Services/Rest/Appointments.svc/SetAppointmentLink",JSON.stringify(params),{headers:{"Content-Type":"application/json"}}).then(function(n){n!=null&&n!=""&&n!=undefined&&(r.appointmentStaff=n.staff.first_name+" "+n.staff.last_name,r.submitting=!1,r.success=!0)}).catch(function(n){r.submitting=!1;console.log(n)})},updateAppointment:function(){var i=this.fullName.split(" "),f=i[0],t;i.splice(0,1);var e=i.join(" "),r=this.realtorFullName.split(" "),o=r[0];r.splice(0,1);var s=r.join(" "),u=this.$refs.inputAppointmentTime.options[this.$refs.inputAppointmentTime.pointer],n={};n.appt_id=this.appointmentId;n.firstName=f;n.lastName=e;n.email=this.email;n.phone=this.phone;n.zipCode=this.zip;n.date=moment(this.apptDate).format("YYYYMMDD");n.time=this.apptTime;n.location=u.dataLocation;n.staff=u.dataStaff;n.hasRealtor=this.hasRealtor=="yes";n.realtorFirstName=o;n.realtorLastName=s;n.realtorCompany=this.realtorCompanyName;n.realtorEmail=this.realtorEmail;n.comments=this.comments;n.notes=this.appointmentContextURL;t=this;this.submitting=!0;axios.post("/Services/Rest/Appointments.svc/UpdateAppointment",JSON.stringify(n),{headers:{"Content-Type":"application/json"}}).then(function(n){if(n!=null&&n!=""&&n!=undefined)t.appointmentStaff=n.staff.first_name+" "+n.staff.last_name,t.submitting=!1,t.success=!0;else{t.apptTimeErr==lr_gb.timeUnavailable;var i=this.$refs.inputAppointmentTime,r={easing:"ease-in-out",offset:-100,onDone:function(){i.focus()}};VueScrollTo.scrollTo(i,300,r);t.dateSelected()}}).catch(function(n){t.submitting=!1;console.log(n)})},cancelAppointment:function(){if(!this.submitting){params={};params.apptId=this.appointmentId;params.reason=this.cancelComments;var n=this;this.submitting=!0;axios.post("/Services/Rest/Appointments.svc/CancelAppointment",JSON.stringify(params),{headers:{"Content-Type":"application/json"}}).then(function(t){t!=null&&t!=="success"&&(n.submitting=!1,n.cancelSuccess=!0)}).catch(function(t){n.submitting=!1;console.log(t)})}},loadAppointmentDetails:function(){this.fullName=this.$refs.hidAppointmentFirstName.value+" "+this.$refs.hidAppointmentLastName.value;this.email=this.$refs.hidAppointmentEmail.value;this.zip=this.$refs.hidAppointmentZip.value;this.apptDateDisplay=this.$refs.hidAppointmentDisplayDate.value;this.hasRealtor=this.$refs.hidAppointmentHasRealtor.value;this.realtorDisplayMode=this.$refs.hidAppointmentRealtorDisplayMode.value;this.realtorFullName=this.$refs.hidAppointmentRealtorFirstName.value+" "+this.$refs.hidAppointmentRealtorLastName.value;this.realtorEmail=this.$refs.hidAppointmentRealtorEmail.value;this.realtorCompanyName=this.$refs.hidAppointmentRealtorCompanyName.value;this.comments=this.$refs.hidAppointmentComments.value},closeModal:function(){parent.Lennar.Vue.Utils.CloseUrlModal()},loginUser:function(){this.validateSignIn()&&!this.submitting&&(this.submitting=!0,Lennar.Global.loginUser(this.username,this.password,!1,this.loginandRedirectUser_onSuccess))},openCreateAccountModal:function(){this.closeModal();parent.Lennar.Global.openAccountModal()},openForgotPasswordModal:function(){this.closeModal();parent.Lennar.Vue.Utils.OpenUrlModal("/modals/Login?login=forgotpw","gen-mdl-form")},loginandRedirectUser_onSuccess:function(n){this.submitting=!1;n.sid==="2"?(parent.Lennar.Global.setActorStatus(2),typeof parent.Lennar.Global.callBack_OnLogin=="function"?parent.Lennar.Global.callBack_OnLogin():parent.Lennar.Global.callBack_OnLogin!=undefined||n.red!=""&&(window.top.location.href=n.red),parent.location.reload()):n.sid=="1"?(parent.Lennar.Global.setActorStatus(1),typeof parent.Lennar.Global.callBack_OnLogin=="function"?parent.Lennar.Global.callBack_OnLogin():parent.Lennar.Global.callBack_OnLogin!=undefined,this.contextIsMobile?Lennar.Global.openMobileTermsAndConditionsModal(Lennar.Global.logoutUserWithoutRedirect):Lennar.Global.openTermsAndConditionsModal(Lennar.Global.logoutUserWithoutRedirect)):this.passwordErr=n.sid=="3"?n.msg.replace("#ResetPasswordCallback#","/modals/Login?login=forgotpw"):n.sid=="4"?lr_gb.loginPasswordNotSet:lr_gb.loginErrorMessage}}})})},"VueAppointmentModal");Lennar.Vue.Utils.DocReady(function(){var n=document.querySelectorAll(".vue-campaign-builder");Array.prototype.forEach.call(n,function(n){new Vue({el:n,data:{userEmail:"",userEmailErr:"",userEmail2:"",destinationURL:"",destinationURLErr:"",selectedBrand:0,brandErr:"",brandOptions:[],selectedDivision:0,divisionErr:"",divisionOptions:[],selectedSource:0,sourceErr:"",sourceOptions:[],selectedMedium:0,mediumErr:"",mediumOptions:[],selectedContentType:0,contentTypeErr:"",contentTypeOptions:[],selectedType:0,typeErr:"",typeOptions:[],selectedAdFormat:0,adFormatErr:"",adFormatOptions:[],campaignDescription:"",campaignDescriptionErr:"",queryString:"",queryStringErr:"",generatedURL:"",submitting:!1,success:!1,error:!1,fromEmail:"",fromEmailErr:"",fromEmail2:"",selectedMissingInformation:0,missingInformationErr:"",missingInformationOptions:[{value:"Brand",text:"Brand"},{value:"Division",text:"Division"},{value:"Source",text:"Source"},{value:"Medium",text:"Medium"},{value:"Content Type",text:"Content Type"},{value:"Type",text:"Type"},{value:"Ad Format",text:"Ad Format"},{value:"Other",text:"Other"}],comments:"",commentsErr:"",submittingModal:!1,errorModal:!1},components:{"vue-search-select":VueSearchSelect.ModelSelect},watch:{selectedBrand:function(){this.loadDivisions()},selectedSource:function(){this.loadMediums()},selectedMedium:function(){this.loadContentTypes()}},methods:{loadBrands:function(){axios.get("/Services/Rest/CampaignBuilder.svc/GetCampaignBrands").then(function(n){n&&n.data&&(this.selectedBrand=0,this.brandOptions=n.data.map(function(n,t){return{value:t+1,text:n.brandName,data:n}}))}.bind(this)).catch(function(n){console.error(n)})},loadDivisions:function(){axios.get("/Services/Rest/CampaignBuilder.svc/GetCampaignDivisions?brandID="+this.brandOptions[this.selectedBrand-1].data.id).then(function(n){n&&n.data&&(this.selectedDivision=0,this.divisionOptions=n.data.map(function(n,t){return{value:t+1,text:n.divisionName,data:n}}))}.bind(this)).catch(function(n){console.error(n)})},loadSources:function(){axios.get("/Services/Rest/CampaignBuilder.svc/GetCampaignSourcesInOptions").then(function(n){n&&n.data&&(this.selectedSource=0,this.sourceOptions=n.data.map(function(n,t){return{value:t+1,text:n.sourceName,data:n}}))}.bind(this)).catch(function(n){console.error(n)})},loadMediums:function(){axios.get("/Services/Rest/CampaignBuilder.svc/GetCampaignMediums?sourceID="+this.sourceOptions[this.selectedSource-1].data.id).then(function(n){n&&n.data&&(this.selectedMedium=0,this.mediumOptions=n.data.map(function(n,t){return{value:t+1,text:n.mediumName,data:n}}),this.selectedContentType=0,this.contentTypeErr="",this.contentTypeOptions=[])}.bind(this)).catch(function(n){console.error(n)})},loadContentTypes:function(){axios.get("/Services/Rest/CampaignBuilder.svc/GetCampaignContentTypes?sourceID="+this.sourceOptions[this.selectedSource-1].data.id+"&mediumID="+this.mediumOptions[this.selectedMedium-1].data.id).then(function(n){n&&n.data&&(this.selectedContentType=0,this.contentTypeOptions=n.data.map(function(n,t){return{value:t+1,text:n.contentTypeName,data:n}}))}.bind(this)).catch(function(n){console.error(n)})},loadTypes:function(){axios.get("/Services/Rest/CampaignBuilder.svc/GetTypes").then(function(n){n&&n.data&&(this.selectedType=0,this.typeOptions=n.data.map(function(n,t){return{value:t+1,text:n.typeName,data:n}}))}.bind(this)).catch(function(n){console.error(n)})},loadAdFormats:function(){axios.get("/Services/Rest/CampaignBuilder.svc/GetAdFormats").then(function(n){n&&n.data&&(this.selectedAdFormat=0,this.adFormatOptions=n.data.map(function(n,t){return{value:t+1,text:n.adFormatName,data:n}}))}.bind(this)).catch(function(n){console.error(n)})},validateQueryParameters:function(){var n=this.queryString,r,t,i;if(n[0]==="?"&&n.indexOf(" ")<0){for(n=n.substring(1),r=n.split("&"),t=0;t<r.length;t++)if(i=r[t].split("="),!(i.length===2&&i[0]!=""&&i[1]!=""))return!1;return!0}return!1},validate:function(n){var r=!0,i,t,u,f,e;return n&&n.type=="blur"&&(t=n.target),t&&t!=this.$refs.inputQueryString||(this.queryStringErr="",this.queryString==""||this.validateQueryParameters()||(this.queryStringErr="Your query string is not correct",i=this.$refs.inputQueryString,r=!1)),t&&t!=this.$refs.inputAdFormat||(this.adFormatErr="",this.selectedAdFormat||(this.adFormatErr="Please select an ad format option",i=this.$refs.inputAdFormat,r=!1)),t&&t!=this.$refs.inputType||(this.typeErr="",this.selectedType||(this.typeErr="Please select a type option",i=this.$refs.inputType,r=!1)),t&&t!=this.$refs.inputContentType||(this.contentTypeErr="",!this.selectedContentType&&this.contentTypeOptions.length>0&&(this.contentTypeErr="Please select a content type option",i=this.$refs.inputContentType,r=!1)),t&&t!=this.$refs.inputMedium||(this.mediumErr="",!this.selectedMedium&&this.mediumOptions.length>0&&(this.mediumErr="Please select a medium option",i=this.$refs.inputMedium,r=!1)),t&&t!=this.$refs.inputSource||(this.sourceErr="",this.selectedSource||(this.sourceErr="Please select a source option",i=this.$refs.inputSource,r=!1)),t&&t!=this.$refs.inputDivision||(this.divisionErr="",!this.selectedDivision&&this.divisionOptions.length>0&&(this.divisionErr="Please select a division option",i=this.$refs.inputDivision,r=!1)),t&&t!=this.$refs.inputBrand||(this.brandErr="",this.selectedBrand||(this.brandErr="Please select a brand option",i=this.$refs.inputBrand,r=!1)),t&&t!=this.$refs.inputDestinationURL||(this.destinationURLErr="",u=/^(https:\/\/www\.|https:\/\/)+lennar\.com(\/.*)?$/,(!u.test(this.destinationURL)||this.destinationURL.split("?").length>1)&&(this.destinationURLErr="Your destination URL is not correct",i=this.$refs.inputDestinationURL,r=!1)),t&&t!=this.$refs.inputUserEmail||(this.userEmailErr="",f=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/,f.test(this.userEmail)||(this.userEmailErr="Your email is not correct",i=this.$refs.inputUserEmail,r=!1)),r||!i||t||(e={easing:"ease-in-out",offset:-125,onDone:function(){i.focus()}},VueScrollTo.scrollTo(i,300,e)),r},generateCampaignURL:function(){var n="";n+=this.queryString!=""?this.queryString+"&":"?";n+="utm_source="+this.sourceOptions[this.selectedSource-1].data.sourceCode+"&utm_medium="+this.mediumOptions[this.selectedMedium-1].data.mediumCode+"&utm_campaign="+this.divisionOptions[this.selectedDivision-1].data.divisionNumber+"_"+this.sourceOptions[this.selectedSource-1].data.sourceCode+"_"+this.mediumOptions[this.selectedMedium-1].data.mediumCode+"_"+this.typeOptions[this.selectedType-1].data.typeCode+"_"+this.adFormatOptions[this.selectedAdFormat-1].data.adFormatCode;this.campaignDescription!=""&&(n+="_"+this.campaignDescription.replace(/ /g,"_"));this.contentTypeOptions.length>0&&(n+="&utm_content="+this.contentTypeOptions[this.selectedContentType-1].data.contentTypeCode);this.campaignParameters=n;this.generatedURL=this.destinationURL+n},clearURL:function(){var n,t;this.userEmail="";this.userEmailErr="";this.userEmail2="";this.destinationURL="";this.destinationURLErr="";this.selectedBrand=0;this.brandErr="";this.selectedDivision=0;this.divisionErr="";this.divisionOptions=[];this.selectedSource=0;this.sourceErr="";this.selectedMedium=0;this.mediumErr="";this.mediumOptions=[];this.selectedContentType=0;this.contentTypeErr="";this.contentTypeOptions=[];this.selectedType=0;this.typeErr="";this.selectedAdFormat=0;this.adFormatErr="";this.campaignDescription="";this.campaignDescriptionErr="";this.queryString="";this.queryStringErr="";this.generatedURL="";this.submitting=!1;this.success=!1;this.error=!1;n=document.querySelector(".vue-campaign-builder");n&&(t={easing:"ease-in-out",offset:-150},VueScrollTo.scrollTo(n,300,t))},submit:function(){if(Lennar.Vue.Utils.CleanInstanceXss(this),this.validate()&&this.userEmail2===""&&!this.submitting){this.generateCampaignURL();this.submitting=!0;var n={userEmail:this.userEmail,destinationURL:this.destinationURL,brandID:this.brandOptions[this.selectedBrand-1].data.id,brandName:this.brandOptions[this.selectedBrand-1].data.brandName,divisionID:this.divisionOptions[this.selectedDivision-1].data.id,divisionName:this.divisionOptions[this.selectedDivision-1].data.divisionName,sourceID:this.sourceOptions[this.selectedSource-1].data.id,sourceName:this.sourceOptions[this.selectedSource-1].data.sourceName,mediumID:this.mediumOptions[this.selectedMedium-1].data.id,mediumName:this.mediumOptions[this.selectedMedium-1].data.mediumName,contentTypeID:this.contentTypeOptions.length?this.contentTypeOptions[this.selectedContentType-1].data.id:0,contentTypeName:this.contentTypeOptions.length?this.contentTypeOptions[this.selectedContentType-1].data.contentTypeName:"",typeID:this.typeOptions[this.selectedType-1].data.id,typeName:this.typeOptions[this.selectedType-1].data.typeName,adFormatID:this.adFormatOptions[this.selectedAdFormat-1].data.id,adFormatName:this.adFormatOptions[this.selectedAdFormat-1].data.adFormatName,campaignDescription:this.campaignDescription,queryString:this.queryString,campaignParameters:this.campaignParameters,generatedURL:this.generatedURL};axios.post("/Services/Rest/CampaignBuilder.svc/InsertCampaignGeneratedURL",n).then(function(n){n&&n.data?(this.submitting=!1,this.success=!0):(this.submitting=!1,this.error=!0)}.bind(this)).catch(function(n){console.error(n);this.submittin=!1;this.error=!0})}},copyURL:function(){var n=this.$refs.inputGeneratedURL;n.select();n.setSelectionRange(0,99999);document.execCommand("copy");alert("The URL has been copied to your clipboard")},clearContactAdminModal:function(){this.fromEmail="";this.fromEmailErr="";this.fromEmail2="";this.selectedMissingInformation=0;this.missingInformationErr="";this.comments="";this.commentsErr="";this.submittingModal=!1;this.errorModal=!1},openContactAdminModal:function(){this.clearContactAdminModal();this.userEmail&&/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(this.userEmail)&&(this.fromEmail=this.userEmail);this.$refs.contactAdminModal.openHtmlModal()},validateContactAdminModal:function(){var n=!0,t;return this.commentsErr="",this.comments||(this.commentsErr="The comments should not be empty",n=!1),this.missingInformationErr="",this.selectedMissingInformation||(this.missingInformationErr="Please select a missing information option",n=!1),this.fromEmailErr="",t=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/,t.test(this.fromEmail)||(this.fromEmailErr="Your email is not correct",n=!1),n},closeContactAdminModal:function(){this.$refs.contactAdminModal.closeModal()},submitContactAdminModal:function(){if(Lennar.Vue.Utils.CleanInstanceXss(this),this.validateContactAdminModal()&&this.fromEmail2===""&&!this.submittingModal){this.submittingModal=!0;var n={fromEmail:this.fromEmail,missingInformation:this.selectedMissingInformation,comments:this.comments};axios.post("/Services/Rest/CampaignBuilder.svc/SendMissingInformationRequest",n).then(function(n){n&&n.data?(this.submittingModal=!1,this.closeContactAdminModal()):(this.submittingModal=!1,this.errorModal=!0)}.bind(this)).catch(function(n){console.error(n);this.submittingModal=!1;this.errorModal=!0})}},bindDropdownBlurEvent:function(n){n.$refs.input.onblur=function(){this.validate({type:"blur",target:n})}.bind(this)}},mounted:function(){this.loadBrands();this.loadSources();this.loadTypes();this.loadAdFormats();this.bindDropdownBlurEvent(this.$refs.inputBrand);this.bindDropdownBlurEvent(this.$refs.inputDivision);this.bindDropdownBlurEvent(this.$refs.inputSource);this.bindDropdownBlurEvent(this.$refs.inputMedium);this.bindDropdownBlurEvent(this.$refs.inputContentType);this.bindDropdownBlurEvent(this.$refs.inputType);this.bindDropdownBlurEvent(this.$refs.inputAdFormat)}})})},"VueCampaignBuilder");Lennar.DocReady(function(){var n=document.querySelectorAll(".vue-career-opportunity");Array.prototype.forEach.call(n,function(n){new Vue({el:n,data:{isLoggedIn:Lennar.Global.actorStatus>0,submitting:!1,success:!1,fullName:"",fullNameErr:"",email:"",emailErr:"",emailConfirm:"",emailConfirmErr:"",email2:"",phone:"",phoneErr:"",country:"",countryErr:"",countryOptions:[],homeAddress:"",homeAddressErr:"",city:"",cityErr:"",state:"",stateErr:"",stateInt:"",stateIntErr:"",stateOptions:[],zip:"",zipErr:"",comments:"",commentsErr:"",topic:"",topicErr:"",topicOptions:[],contextIsMobile:""},mounted:function(){var n,t,i;this.fillUserData();n=this;this.country=this.$refs.hidPreferredCountry.value;Lennar.Vue.Utils.GetCountries(this.countryOptions);Lennar.Vue.Utils.GetAllStates(this.stateOptions);t={type:"blur",target:this.$refs.inputState};this.$refs.inputState.$refs.input.onblur=function(){n.validate(t)};this.topicOptions=[{value:"Employment questions",text:"Employment questions"},{value:"Employment verification",text:"Employment verification"},{value:"Other topics on career opportunities",text:"Other topics on career opportunities"}];i={type:"blur",target:this.$refs.inputTopic};this.$refs.inputTopic.$refs.input.onblur=function(){n.validate(i)}},components:{"vue-tel-input":VueTelInput.VueTelInput,"vue-search-select":VueSearchSelect.ModelSelect},methods:{fillContext:function(){this.contextIsMobile=this.$refs.hidIsMobile.value},fillUserData:function(){this.isLoggedIn&&axios.get("/Services/Rest/Profile.svc/GetUserProfile").then(function(n){if(n&&n.data){var t=JSON.parse(n.data);t.FirstName&&(this.fullName=t.FirstName+" "+t.LastName,this.email=t.Email,this.emailConfirm=t.Email,this.phone=t.CellPhone||t.HomePhone,this.$refs.inputPhone.phone=t.CellPhone||t.HomePhone,this.homeAddress=t.Street1,this.state=Lennar.Vue.Utils.MapState(t.State),this.city=t.City,this.zip=t.ZipCode)}}.bind(this)).catch(function(n){console.log(n)})},validate:function(n){var r=!0,i,t=null,u,f;return n&&n.type=="blur"&&(t=n.target),t&&t!=this.$refs.inputComments||(this.commentsErr=""),t&&t!=this.$refs.inputComments||this.comments!==""||(this.commentsErr=lr_gb.enterComment,i=this.$refs.inputComments,r=!1),t&&t!=this.$refs.inputTopic||(this.topicErr=""),t&&t!=this.$refs.inputTopic||this.topic!==""||(this.topicErr=lr_gb.selectTopic,i=this.$refs.inputTopic,r=!1),t&&t!=this.$refs.inputZip||(this.zipErr=""),t&&t!=this.$refs.inputZip||this.zip!==""?t&&t!=this.$refs.inputZip||Lennar.Vue.Utils.ValidateZipCode(this.zip)||(this.zipErr=lr_gb.invalidZipCode,i=this.$refs.inputZip,r=!1):(this.zipErr=lr_gb.enterZipCode,i=this.$refs.inputZip,r=!1),t&&t!=this.$refs.inputStateInt||(this.stateIntErr=""),t&&t!=this.$refs.inputStateInt||this.stateInt!==""||this.country=="US"||(this.stateIntErr=lr_gb.enterStateProvince,i=this.$refs.inputStateInt,r=!1),t&&t!=this.$refs.inputState||(this.stateErr=""),t&&t!=this.$refs.inputState||this.state!==""||this.country!=="US"||(this.stateErr=lr_gb.selectState,i=this.$refs.inputState,r=!1),t&&t!=this.$refs.inputCity||(this.cityErr=""),t&&t!=this.$refs.inputCity||this.city!==""||(this.cityErr=lr_gb.enterCity,i=this.$refs.inputCity,r=!1),t&&t!=this.$refs.inputHomeAddress||(this.homeAddressErr=""),t&&t!=this.$refs.inputHomeAddress||this.homeAddress!==""||(this.homeAddressErr=lr_gb.enterStreetAddress,i=this.$refs.inputHomeAddress,r=!1),t&&t!=this.$refs.inputCountry||(this.countryErr=""),t&&t!=this.$refs.inputCountry||this.country!==""||(this.countryErr=lr_gb.selectCountry,i=this.$refs.inputCountry,r=!1),t&&t!=this.$refs.inputPhone||(this.phoneErr=""),t&&t!=this.$refs.inputPhone||this.$refs.inputPhone.phoneObject.isValid||(this.phoneErr=lr_gb.invalidPhone,i=this.$refs.inputPhone,r=!1),t&&t!=this.$refs.inputEmail||(this.emailErr=""),t&&t!=this.$refs.inputEmail||Lennar.Vue.Utils.ValidateEmail(this.email)||(this.emailErr=lr_gb.validEmail,i=this.$refs.inputEmail,r=!1),t&&t!=this.$refs.inputConfirmEmail||(this.emailConfirmErr=""),t&&t!=this.$refs.inputConfirmEmail||this.email==this.emailConfirm||(this.emailConfirmErr=lr_gb.emailMatch,i=this.$refs.inputConfirmEmail,r=!1),t&&t!=this.$refs.inputFullName||(this.fullNameErr=""),u=this.fullName.split(" "),(!t||t==this.$refs.inputFullName)&&u.length<2&&(this.fullNameErr=lr_gb.enterFullName,i=this.$refs.inputFullName,r=!1),!r&&i&&(f={easing:"ease-in-out",offset:-100,onDone:function(){t||i.focus()}},VueScrollTo.scrollTo(i,300,f)),r},submit:function(){var n,r,t;if(Lennar.Global.CleanInputFromXss(),this.validate()&&this.email2===""&&!this.submitting){this.fillContext();n=this.fullName.split(" ");r=n[0];n.splice(0,1);var f=n.join(" "),u=Lennar.Global.getGoogleTagValues(),i=Lennar.Global.SetGAValues(),e={contactType:"CAR",firstName:r,lastName:f,email:this.email,country:this.country,zipCode:this.zip,interestState:"",marketCode:"",phone:this.phone,cellPhone:"",ext:"",address:this.homeAddress,message:this.topic+" - "+this.comments,community:"",moveInDate:"",suite:"",city:this.city,state:this.country==="US"?this.state:this.stateInt,marketName:"",shareFeedback:!1,campaign:u.campaign,referrerDomain:u.referrerDomain,GACLIENTID:i.clientId,GAUSERID:i.userId,GATRACKID:i.trackId,source:this.contextIsMobile=="true"?"MOBILE":""};this.submitting=!0;t=this;axios.post("/Services/Rest/Profile.svc/ProcessContactUs",e).then(function(n){n&&n.data&&(t.submitting=!1,t.success=!0)}).catch(function(n){t.submitting=!1;console.log(n)})}return!1},closeModal:function(){parent.Lennar.Vue.Utils.CloseUrlModal()}}})})},"VueCareerOpportunity");Lennar.DocReady(function(){var n=document.querySelectorAll(".vue-create-account");Array.prototype.forEach.call(n,function(n){new Vue({el:n,data:{isLoggedIn:Lennar.Global.actorStatus>0,submitting:!1,success:!1,fullName:"",fullNameErr:"",email:"",email2:"",emailErr:"",password:"",passwordErr:"",confirmPassword:"",confirmPasswordErr:"",phone:"",phoneErr:"",country:"",countryErr:"",countryOptions:[],state:"",stateErr:"",stateInt:"",stateIntErr:"",stateOptions:[],privacy:!1,privacyErr:"",stateOfInterest:"",stateOfInterestErr:"",stateOfInterestOptions:[],cityOfInterest:"",cityOfInterestErr:"",cityOfInterestOptions:[],contextPageSource:"",contextSignupSource:"",contextControlId:"",contextFavoriteId:"",contextFavoriteType:"",contextUserIdentifier:"",contextAssociatedSocialProvider:"",globalErr:"",termsVisible:!1,isMobile:Lennar.Vue.Utils.IsMobile()},mounted:function(){this.fillJanrainUserData();this.fillContext();this.$nextTick(function(){this.$refs.inputFullName.focus()});this.country=this.$refs.hidPreferredCountry.value;Lennar.Vue.Utils.GetCountries(this.countryOptions);Lennar.Vue.Utils.GetAllStates(this.stateOptions);Lennar.Vue.Utils.GetActiveStates(this.stateOfInterestOptions)},components:{"vue-tel-input":VueTelInput.VueTelInput,"vue-search-select":VueSearchSelect.ModelSelect},watch:{stateOfInterest:function(){this.loadCitiesOfInterest()}},methods:{loadCitiesOfInterest:function(){this.cityOfInterest="";Lennar.Vue.Utils.GetActiveMarkets(this.cityOfInterestOptions,this.stateOfInterest)},fillContext:function(){this.contextPageSource=this.$refs.hdnPageSource.value;this.contextControlId=this.$refs.hdnControlId.value;this.contextFavoriteId=this.$refs.hdnFavoriteId.value;this.contextFavoriteType=this.$refs.hdnFavoriteType.value},fillJanrainUserData:function(){var n,t;window.parent&&(n=window.parent.Lennar.Global.getUserIdentifier(),n&&(this.contextSignupSource="janrain",this.contextUserIdentifier=n,this.contextAssociatedSocialProvider=parent.Lennar.Global.getProvider(),this.fullName=parent.Lennar.Global.getUserFirstName()+" "+parent.Lennar.Global.getUserLastName(),this.email=parent.Lennar.Global.getUserNameEmail(),t=this,Array.prototype.forEach.call(this.$refs.inputState.options,function(n){n.text==parent.Lennar.Global.getUserState()&&(t.state=n.value)}),this.stateInt=parent.Lennar.Global.getUserState()))},validate:function(){var t=!0,n,i,r;return this.privacyErr="",this.privacy||(this.privacyErr=lr_gb.checkTermsConditions,n=this.$refs.inputPrivacy,t=!1),this.stateOfInterestErr="",this.stateOfInterest===""&&(this.stateOfInterestErr=lr_gb.selectStateOfInterest,n=this.$refs.labelStateOfInterest,t=!1),this.cityOfInterestErr="",this.stateOfInterest!==""&&this.cityOfInterest===""&&(this.cityOfInterestErr=lr_gb.selectCityOfInterest,n=this.$refs.labelCityOfInterest,t=!1),this.stateIntErr="",this.stateInt===""&&this.country!="US"&&(this.stateIntErr=lr_gb.enterStateProvince,n=this.$refs.inputStateInt,t=!1),this.stateErr="",this.state===""&&this.country==="US"&&(this.stateErr=lr_gb.selectState,n=this.$refs.labelState,t=!1),this.countryErr="",this.country===""&&(this.countryErr=lr_gb.selectCountry,n=this.$refs.labelCountry,t=!1),this.phoneErr="",this.$refs.inputPhone.phoneObject.isValid||(this.phoneErr=lr_gb.invalidPhone,n=this.$refs.labelPhone,t=!1),this.confirmPasswordErr="",this.password!==this.confirmPassword&&(this.confirmPasswordErr=lr_gb.passwordsDontMatch,n=this.$refs.inputConfirmPassword,t=!1),this.passwordErr="",this.password===""?(this.passwordErr=lr_gb.enterPassword,n=this.$refs.inputPassword,t=!1):/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$!@$%^&*?])[A-Za-z\d$!@$%^&*?]{8,20}$/.test(this.password)||(this.passwordErr=lr_gb.passwordDontMatchRules,n=this.$refs.inputPassword,t=!1),this.emailErr="",Lennar.Vue.Utils.ValidateEmail(this.email)||(this.emailErr=lr_gb.validEmail,n=this.$refs.inputEmail,t=!1),this.fullNameErr="",i=this.fullName.split(" "),i.length<2&&(this.fullNameErr=lr_gb.enterFullName,n=this.$refs.inputFullName,t=!1),!t&&n&&(r={easing:"ease-in-out",offset:-100,onDone:function(){n.focus()}},VueScrollTo.scrollTo(n,300,r)),t},submit:function(){var i,r,u,n,t;return Lennar.Vue.Utils.CleanInstanceXss(this),this.validate()&&this.email2===""&&!this.submitting&&(i=this.fullName.split(" "),r=i[0],i.splice(0,1),u=i.join(" "),n={},n.fname=r,n.lname=u,n.email=this.email,n.pwd=this.password,n.phone=this.phone,n.state=this.state,n.country=this.country,n.pgsr=this.contextPageSource,n.conid=this.contextControlId,n.favid=this.contextFavoriteId,n.favtp=this.contextFavoriteType,this.submitting=!0,t=this,axios.post("/Services/Rest/Profile.svc/CreateAccount",JSON.stringify({info:n}),{headers:{"Content-Type":"application/json"}}).then(function(n){n&&n.data&&(n.data.s?t.loginSuccess(n.data):n.data.msg?(t.submitting=!1,t.globalErr=n.data.msg):t.globalErr=lr_gb.createAccountError)}).catch(function(n){t.submitting=!1;console.log(n)})),!1},closeModal:function(){parent.Lennar.Vue.Utils.CloseUrlModal()},loginSuccess:function(n){for(var r=window,e=!1,u,o,s,t,f,i;r!=r.parent;)r=r.parent;r.Lennar.Vue.DataLayer.Event("accountCreated",{currentCountry:this.country,currentState:this.state,futureState:this.stateOfInterest,futureCity:this.cityOfInterest});r.Lennar.Global.setActorStatus(2);parent&&parent.Lennar.Vue.Utils.UrlModalVueInstance&&parent.Lennar.Vue.Utils.UrlModalVueInstance.$refs.modal&&(parent.Lennar.Vue.Utils.UrlModalVueInstance.$refs.modal.onCloseCallback==null?parent.Lennar.Vue.Utils.UrlModalVueInstance.$refs.modal.onCloseCallback=function(){parent.window.location.reload()}:e=!0);userId=n.uid;u=this.fullName.split(" ");o=u[0];u.splice(0,1);s=u.join(" ");t={};t.fname=o;t.lname=s;t.email=this.email;t.phone=this.phone;t.country=this.country;t.state=t.country!=="US"?this.stateInt:this.state;t.stateOfInterest=this.stateOfInterest;t.cityOfInterest=this.cityOfInterest;t.message="";t.source=this.isMobile?"MOBILE":"";f=Lennar.Global.getGoogleTagValues();t.campaign=f.campaign;t.referrerDomain=f.referrerDomain;t.lt="myLennar";i=this;axios.post("/Services/Rest/Profile.svc/SubmitRfiLead",JSON.stringify({lead:t}),{headers:{"Content-Type":"application/json"}}).then(function(n){i.submitting=!1;n&&n.data&&(i.success=!0,Lennar.Global.PardotRfi("hidPardotiframeCreateAccount",this.email),i.contextSignupSource!=="janrain"&&i.contextPageSource==="Create Account App"&&(window.location="CA://1/"+i.email+"/"+i.password),parent.window!=parent.parent.window&&e&&parent.Lennar.Vue.Utils.CloseUrlModal())}).catch(function(n){i.submitting=!1;console.log(n)})}}})})},"VueCreateAccount");Lennar.DocReady(function(){var n=document.querySelectorAll(".vue-customercare-warranty");Array.prototype.forEach.call(n,function(n){new Vue({el:n,data:{isLoggedIn:Lennar.Global.actorStatus>0,submitting:!1,success:!1,showSteps:!1,showLogin:!1,step:0,signInClosed:!0,firstName:"",firstNameErr:"",lastName:"",lastNameErr:"",email:"",emailErr:"",emailConfirm:"",emailConfirmErr:"",email2:"",phone:"",phoneErr:"",homeAddress:"",homeAddressErr:"",city:"",cityErr:"",state:"",stateErr:"",stateOptions:[],zip:"",zipErr:"",requests:[],requestsErr:"",username:"",usernameErr:"",password:"",passwordErr:"",techEmail:"",techEmailErr:"",retUrl:"",returnUrl:"",cancelUrl:"",source:"",homesiteId:"",showCloseButton:window!==window.parent},computed:{workOrders:function(){for(var i={WorkOrder:[]},t,r,n=0;n<this.requests.length;++n)t=this.requests[n],t.text&&(r=t.text,this.techEmail&&(r="Smart Home Expert’s Email Address: "+this.techEmail+"; Smart Home Expert’s Comment: "+t.text),i.WorkOrder.push({Description:r}));return i.WorkOrder.length?JSON.stringify(i):""}},mounted:function(){var n,t;if(this.source=this.$el.dataset.source,this.returnUrl=this.$el.dataset.returnUrl,this.cancelUrl=this.$el.dataset.cancelUrl,this.showSteps=this.$el.dataset.showSteps=="true",n=Lennar.Vue.Utils.GetQueryStringParameterByName("ty"),n){if(this.returnUrl){window.location.href=this.returnUrl;return}this.success=!0;this.firstName=Lennar.Vue.Utils.GetQueryStringParameterByName("fn");return}t=/ip(od|ad|hone)|android|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase());t&&(this.source+="Mobile");Lennar.Global.LoginValidation="FromContactUs";this.fillUserData();Lennar.Vue.Utils.GetAllStates(this.stateOptions,!0);this.$refs.inputState.$refs.input.onblur=function(){this.validate({type:"blur",target:this.$refs.inputState})}.bind(this);this.checkRequest(0)},components:{"vue-tel-input":VueTelInput.VueTelInput,"vue-search-select":VueSearchSelect.ModelSelect},methods:{fillUserData:function(){this.isLoggedIn&&axios.get("/Services/Rest/Profile.svc/GetUserProfile").then(function(n){if(n&&n.data){var t=JSON.parse(n.data);t.FirstName&&(this.firstName=t.FirstName,this.lastName=t.LastName,this.email=t.Email,this.emailConfirm=t.Email,this.phone=t.CellPhone||t.HomePhone,this.$refs.inputPhone.phone=t.CellPhone||t.HomePhone,this.homeAddress=t.Street1,this.city=t.City,this.state=Lennar.Vue.Utils.MapState(t.State,!0),this.zip=t.ZipCode,this.homesiteId=t.CompleteHomesiteNumber)}}.bind(this)).catch(function(n){console.log(n)})},previousPage:function(){this.step==1&&this.step--},nextPage:function(){Lennar.Vue.Utils.CleanInstanceXss(this);this.step==0&&this.validate()&&this.step++},validate:function(n){var r=!0,i,t=null,u;return n&&n.type=="blur"&&(t=n.target),(!t||Lennar.Vue.Utils.IsChildOf(this.$refs.requestContainer,t))&&(this.requestsErr=""),t&&!Lennar.Vue.Utils.IsChildOf(this.$refs.requestContainer,t)||this.workOrders!==""||this.showSteps&&this.step!=1||(this.requestsErr=lr_gb.enterRequest,i=t,r=!1),t&&t!=this.$refs.inputZip||(this.zipErr=""),t&&t!=this.$refs.inputZip||this.zip!==""?t&&t!=this.$refs.inputZip||Lennar.Vue.Utils.ValidateZipCode(this.zip)||(this.zipErr=lr_gb.invalidZipCode,i=this.$refs.inputZip,r=!1):(this.zipErr=lr_gb.enterZipCode,i=this.$refs.inputZip,r=!1),t&&t!=this.$refs.inputState||(this.stateErr=""),t&&t!=this.$refs.inputState||this.state!==""||(this.stateErr=lr_gb.selectState,i=this.$refs.inputState,r=!1),t&&t!=this.$refs.inputCity||(this.cityErr=""),t&&t!=this.$refs.inputCity||this.city!==""||(this.cityErr=lr_gb.selectCity,i=this.$refs.inputCity,r=!1),t&&t!=this.$refs.inputHomeAddress||(this.homeAddressErr=""),t&&t!=this.$refs.inputHomeAddress||this.homeAddress!==""||(this.homeAddressErr=lr_gb.enterStreetAddress,i=this.$refs.inputHomeAddress,r=!1),t&&t!=this.$refs.inputPhone||(this.phoneErr=""),t&&t!=this.$refs.inputPhone||this.$refs.inputPhone.phoneObject.isValid||(this.phoneErr=lr_gb.invalidPhone,i=this.$refs.inputPhone,r=!1),this.$refs.inputTechEmail&&(t&&t!=this.$refs.inputTechEmail||(this.techEmailErr=""),t&&t!=this.$refs.inputTechEmail||Lennar.Vue.Utils.ValidateEmail(this.techEmail)||(this.techEmailErr=lr_gb.validEmail,i=this.$refs.inputTechEmail,r=!1)),t&&t!=this.$refs.inputEmail||(this.emailErr=""),t&&t!=this.$refs.inputEmail||Lennar.Vue.Utils.ValidateEmail(this.email)||(this.emailErr=lr_gb.validEmail,i=this.$refs.inputEmail,r=!1),t&&t!=this.$refs.inputConfirmEmail||(this.emailConfirmErr=""),t&&t!=this.$refs.inputConfirmEmail||this.email==this.emailConfirm||(this.emailConfirmErr=lr_gb.emailMatch,i=this.$refs.inputConfirmEmail,r=!1),t&&t!=this.$refs.inputLastName||(this.lastNameErr=""),t&&t!=this.$refs.inputLastName||this.lastName!==""||(this.lastNameErr=lr_gb.enterLastName,i=this.$refs.inputLastName,r=!1),t&&t!=this.$refs.inputFirstName||(this.firstNameErr=""),t&&t!=this.$refs.inputFirstName||this.firstName!==""||(this.firstNameErr=lr_gb.enterFirstName,i=this.$refs.inputFirstName,r=!1),!r&&i&&(u={easing:"ease-in-out",offset:-100,onDone:function(){t||i.focus()}},VueScrollTo.scrollTo(i,300,u)),r},validateSignIn:function(){var n=!0;return this.usernameErr="",this.username.length>0&&!Lennar.Vue.Utils.ValidateEmail(this.username)&&(this.usernameErr=lr_gb.validEmail,n=!1),n},toggleSignIn:function(){this.signInClosed=!this.signInClosed},submit:function(){var n,t;for(Lennar.Vue.Utils.CleanInstanceXss(this),n=0;n<this.requests.length;++n)t=this.requests[n],t.text&&(t.text=Lennar.Vue.Utils.CleanXss(t.text));return this.validate()&&this.email2===""&&!this.submitting&&this.submitAudit(),!1},submitAudit:function(){var n=Lennar.Global.getGoogleTagValues(),t;this.submitting=!0;t={firstName:this.firstName,lastName:this.lastName,email:this.email,phone:this.phone,address:this.homeAddress,city:this.city,state:this.state,zipCode:this.zip,homesiteId:this.homesiteId,workOrder:this.workOrders,campaign:n.campaign,referrerDomain:n.referrerDomain,userDeviceInfo:this.getUserDeviceInfo(),source:this.source};axios.post("/Services/Rest/Profile.svc/AuditCustomerCare",t).then(function(){var n=window.location.href.replace(window.location.hash,"").replace(window.location.search,"");this.retUrl=n+"?ty=1&fn="+this.firstName;try{parent.Lennar.Vue.Utils.EventBus.$emit("form-submitted","SubmitCustomerCare")}catch(t){}this.$nextTick(function(){this.submitting=!1;this.$refs.form.submit()})}.bind(this)).catch(function(n){this.submitting=!1;console.log(n)}.bind(this))},getUserDeviceInfo:function(){return"User Agent: "+navigator.userAgent+", Browser: "+navigator.appName+", Platform: "+navigator.platform},closeModal:function(){if(this.cancelUrl){window.location.href=this.cancelUrl;return}Lennar.Vue.Utils.CloseUrlModal()},checkRequest:function(n){while(this.requests.length<=n+1)this.requests.push({text:"",showWarn:!1})},removeRequest:function(n){this.requests.length>1&&this.requests.splice(n,1)},loginUser:function(){this.validateSignIn()&&!this.submitting&&(this.submitting=!0,Lennar.Global.loginUser(this.username,this.password,!1,this.loginandRedirectUser_onSuccess))},openCreateAccountModal:function(){this.closeModal();Lennar.Global.openAccountModal()},openForgotPasswordModal:function(){this.closeModal();Lennar.Vue.Utils.OpenUrlModal("/modals/Login?login=forgotpw","gen-mdl-form")},loginandRedirectUser_onSuccess:function(n){this.submitting=!1;n.sid==="2"?(parent.Lennar.Global.setActorStatus(2),typeof parent.Lennar.Global.callBack_OnLogin=="function"&&parent.Lennar.Global.callBack_OnLogin(),location.reload()):n.sid=="1"?(parent.Lennar.Global.setActorStatus(1),typeof parent.Lennar.Global.callBack_OnLogin=="function"?parent.Lennar.Global.callBack_OnLogin():parent.Lennar.Global.callBack_OnLogin!=undefined,this.contextIsMobile?Lennar.Global.openMobileTermsAndConditionsModal(Lennar.Global.logoutUserWithoutRedirect):Lennar.Global.openTermsAndConditionsModal(Lennar.Global.logoutUserWithoutRedirect)):this.passwordErr=n.sid=="3"?n.msg.replace("#ResetPasswordCallback#","/modals/Login?login=forgotpw"):n.sid=="4"?lr_gb.loginPasswordNotSet:lr_gb.loginErrorMessage}}})})},"VueCustomerCareWarranty");Lennar.DocReady(function(){var n=document.querySelectorAll(".vue-document-upload-edit");Array.prototype.forEach.call(n,function(n){new Vue({el:n,data:{submitting:!1,lennarUserId:"",formType:"",documentId:0,fileName:"",filesInfo:[],filesUploadErr:"",title:"",titleErr:"",category:"",categoryErr:"",subcategory:"",subcategoryErr:"",subcategoryOptions:[]},mounted:function(){var n=this;this.lennarUserId=this.$refs.hidLennarUserId.value;this.formType=Lennar.Global.GetQueryStringParameterByName("type");this.documentId=Lennar.Global.GetQueryStringParameterByName("documentId")?Lennar.Global.GetQueryStringParameterByName("documentId"):0;this.formType==="edit"&&this.documentId&&axios.get("/Services/Rest/Documents.svc/GetDocumentById?id="+this.documentId).then(function(t){t&&t.data&&(n.fileName=t.data.url,n.title=t.data.nm,n.category=t.data.dc,t.data.sc&&n.categorySelected(null,t.data.sc))}).catch(function(n){console.error(n)})},methods:{validate:function(n){var i=!0,r,t=null,u;return this.filesInfo.length||n!=undefined||this.fileName!==""?this.validateFilesInfo(this.filesInfo)||(i=!1):(this.filesUploadErr="Please upload a document in one of the following formats: .pdf, .doc, .docx, .xls, .xlsx, .rtf, .txt, .jpg, .jpeg, .png or .gif",i=!1),n&&n.type=="blur"&&(t=n.target),t&&t!=this.$refs.inputTitle||(this.titleErr=""),t&&t!=this.$refs.inputTitle||this.title!==""||(this.titleErr=lr_gb.enterTitle,r=this.$refs.inputTitle,i=!1),t&&t!=this.$refs.inputCategory||(this.categoryErr=""),t&&t!=this.$refs.inputCategory||this.category!==""||(this.categoryErr=lr_gb.selectCategory,r=this.$refs.inputCategory,i=!1),t&&t!=this.$refs.inputSubcategory||(this.subcategoryErr=""),(!t||t==this.$refs.inputSubcategory)&&this.subcategory===""&&this.subcategoryOptions.length>0&&(this.subcategoryErr=lr_gb.selectSubcategory,r=this.$refs.inputSubcategory,i=!1),!i&&r&&(u={easing:"ease-in-out",offset:-100,onDone:function(){t||r.focus()}},VueScrollTo.scrollTo(r,300,u)),i},isFileExtValid:function(n){var t=n.toLowerCase().substr(n.lastIndexOf(".")+1);switch(t){case"pdf":case"doc":case"docx":case"xls":case"xlsx":case"rtf":case"txt":case"jpg":case"jpeg":case"png":case"gif":return!0;default:return!1}},isFileSizeValid:function(n){return n<=10485760},validateFilesInfo:function(n){for(var t=0;t<n.length;t++)if(n[t].errors)return this.filesUploadErr="Invalid file format or size. Please upload a valid file.",!1;return this.filesUploadErr="",!0},getFileSize:function(n){var t="",i=n/1024,r;return parseInt(i)>1024?(r=i/1024,t+=r.toFixed(2)+" MB"):t+=i.toFixed(2)+" KB",t},removeFile:function(n){this.filesInfo.splice(n,1);this.validateFilesInfo(this.filesInfo)},selectFile:function(n){for(var t=[n.target.files[0]],i=0;i<t.length;i++)t[i].errors=!(this.isFileExtValid(t[i].name)&&this.isFileSizeValid(t[i].size)),t[i].sizeInBytes=this.getFileSize(t[i].size);this.validateFilesInfo(t);this.filesInfo=t},categorySelected:function(n,t){var r=this;this.subcategory=t?t:"";axios.get("/Services/Rest/Documents.svc/GetSubcategories?cat="+this.category,{headers:{"Content-Type":"application/json"}}).then(function(n){n&&n.data&&(r.subcategoryOptions=[],Vue.nextTick(function(){if(n.data.length>0)for(r.subcategoryOptions.push({dc:"",nm:"Choose a subcategory"}),i=0;i<n.data.length;i++)r.subcategoryOptions.push(n.data[i])}))}).catch(function(n){console.error(n)})},submit:function(){if(Lennar.Vue.Utils.CleanInstanceXss(this),this.validate()&&!this.submitting){this.submitting=!0;var n=new FormData;n.append("userfile",this.filesInfo[0]?this.filesInfo[0]:null);n.append("docType",this.category);n.append("docSubType",this.subcategory===""?null:this.subcategory);n.append("docTitle",this.title);n.append("docSource","MYLENNAR");n.append("docID",this.documentId);axios({method:"post",url:"/Services/Rest/Documents.svc/CreateUpdateDocument",headers:{"content-type":"application/json"},data:n}).then(function(n){n.err?(this.submitting=!1,this.filesUploadErr="There was an error saving uploaded Document. Please try again."):parent.Lennar.Vue.Utils.CloseUrlModal()}).catch(function(){this.submitting=!1;this.filesUploadErr="There was an error saving uploaded Document. Please try again."})}},closeModal:function(){parent.Lennar.Vue.Utils.CloseUrlModal()}}})})},"VueDocumentUploadEdit");Lennar.DocReady(function(){var n=document.querySelectorAll(".vue-driving-directions");Array.prototype.forEach.call(n,function(n){new Vue({el:n,data:{email:"",address:"",city:"",state:"",communityLatitude:"",communityLongitude:"",communityAddress:"",communityName:"",stateOptions:[],origin:null,zip:"",showSendToMobile:!1,provider:"",providerOptions:[],phoneNumber:"",providerError:"",cityError:"",stateError:"",directionDetails:[],isStatic:!1,isPrint:!1,isChromeIOS:Lennar.Vue.Utils.IsChromeIOS(),chromeIOSPrint:""},computed:{showDirections:function(){return this.isStatic||this.directionDetails.length>0}},mounted:function(){this.communityAddress=this.$el.dataset.commAddress;this.communityName=this.$el.dataset.commName;this.communityLatitude=this.$el.dataset.commLatitude;this.communityLongitude=this.$el.dataset.commLongitude;this.isStatic=this.$el.dataset.static==="true";this.email=this.$el.dataset.email;this.$refs.map&&this.$refs.map.loadDependencies();this.isPrint=Lennar.Vue.Utils.GetQueryStringParameterByName("p")==="1";this.isPrint?this.handlePrint():(Lennar.Vue.Utils.GetAllStates(this.stateOptions),this.loadProviders());Lennar.Vue.DataLayer.Event("drivingDirections",{isStatic:this.isStatic,isPrint:this.isPrint});this.chromeIOSPrint=this.getPrintModalURL()},components:{"vue-search-select":VueSearchSelect.ModelSelect},methods:{loadProviders:function(){this.providerOptions.length==0&&axios.post("/Services/Rest/SearchMethods.svc/getCarriers").then(function(n){n&&n.data&&(this.providerOptions=n.data.map(function(n){return{value:n.EmailMask,text:n.DisplayName}}))}.bind(this)).catch(function(n){console.log(n)})},printLocation:function(){Lennar.Vue.Utils.OpenUrlModal(this.getPrintModalURL(),"no-bkg-dialog",null,!1,"print-modal",!0)},handlePrint:function(){var n=Lennar.Vue.Utils.GetQueryStringParameterByName("lat"),t=Lennar.Vue.Utils.GetQueryStringParameterByName("long");if(n&&t){this.getDirectionsFromOrigin(n,t);return}this.address=Lennar.Vue.Utils.GetQueryStringParameterByName("add");this.city=Lennar.Vue.Utils.GetQueryStringParameterByName("city");this.state=Lennar.Vue.Utils.GetQueryStringParameterByName("state");this.zip=Lennar.Vue.Utils.GetQueryStringParameterByName("zip");this.state&&this.city?this.getDirections():typeof lennarPrint=="function"&&setTimeout(lennarPrint,100)},toggleSendToMobile:function(){this.showSendToMobile=!this.showSendToMobile},sendToMobile:function(){if(this.providerError="",this.provider==""){this.providerError="Please select a provider";return}if(!Lennar.Vue.Utils.ValidatePhone(this.phoneNumber)){this.providerError="Please enter a valid phone number";return}axios.post("/Services/Rest/SearchMethods.svc/sendSMS",{community:this.communityName,number:this.phoneNumber,content:"https://www.google.com/maps/dir/Current+Location/"+this.communityLatitude.toString().replace(".","%2E")+","+this.communityLongitude.toString().replace(".","%2E"),mask:this.provider}).then(function(n){n&&n.data&&(n.data=="ERROR"?this.providerError="There was an error sending the message.":this.toggleSendToMobile())}.bind(this)).catch(function(n){console.log(n)})},useCurrentLocation:function(){Lennar.Vue.Utils.GetCurrentLocation(function(n){this.origin=new google.maps.LatLng(n.coords.latitude,n.coords.longitude);var t={origin:this.origin,destination:this.communityAddress,travelMode:google.maps.TravelMode.DRIVING,unitSystem:google.maps.UnitSystem.IMPERIAL};(new google.maps.DirectionsService).route(t,this.getDirectionsCallback)}.bind(this))},getDirectionsFromOrigin:function(n,t){if(typeof google=="undefined"){setTimeout(this.getDirectionsFromOrigin.bind(this,n,t),100);return}this.origin=new google.maps.LatLng(n,t);var i={origin:this.origin,destination:this.communityAddress,travelMode:google.maps.TravelMode.DRIVING,unitSystem:google.maps.UnitSystem.IMPERIAL};(new google.maps.DirectionsService).route(i,this.getDirectionsCallback)},getDirections:function(){var n,t;if(this.cityError="",this.stateError="",n=!0,this.state==""&&(this.stateError="Please select a state",n=!1),this.city==""&&(this.cityError="Please select a city",n=!1),typeof google=="undefined"){setTimeout(this.getDirections,100);return}n&&(Lennar.Global.PardotRfi("hidPardotDrivingDirections",this.email),t={origin:this.address+", "+this.city+", "+this.state+" "+this.zip,destination:this.communityAddress,travelMode:google.maps.TravelMode.DRIVING,unitSystem:google.maps.UnitSystem.IMPERIAL},(new google.maps.DirectionsService).route(t,this.getDirectionsCallback))},getDirectionsCallback:function(n,t){t===google.maps.DirectionsStatus.OK?(this.directionDetails=n.routes[0].legs[0].steps,this.$refs.map.showDirections(n,function(){typeof lennarPrint=="function"&&setTimeout(lennarPrint,2e3)}),Lennar.Vue.DataLayer.Event("drivingDirections",{isStatic:this.isStatic,isPrint:this.isPrint,origin:this.origin,address:this.address,city:this.city,state:this.state,zip:this.zip}),this.chromeIOSPrint=this.getPrintModalURL()):alert("No route found")},getPrintModalURL:function(){var n=window.location.href;return n=Lennar.Vue.Utils.AddToQueryString("p","1",!0),this.origin?n=n+"&lat="+this.origin.lat()+"&long="+this.origin.lng():this.state&&(n=n+"&add="+encodeURIComponent(this.address)+"&city="+encodeURIComponent(this.city)+"&state="+encodeURIComponent(this.state)+"&zip="+encodeURIComponent(this.zip)),n}}})})},"VueDrivingDirections");Lennar.DocReady(function(){var n=document.querySelectorAll(".vue-feedback");Array.prototype.forEach.call(n,function(n){new Vue({el:n,data:{isLoggedIn:Lennar.Global.actorStatus>0,submitting:!1,success:!1,fullName:"",fullNameErr:"",email:"",emailErr:"",emailConfirm:"",emailConfirmErr:"",email2:"",phone:"",phoneErr:"",country:"",countryErr:"",countryOptions:[],homeAddress:"",homeAddressErr:"",city:"",cityErr:"",state:"",stateErr:"",stateInt:"",stateIntErr:"",stateOptions:[],zip:"",zipErr:"",comments:"",commentsErr:"",contextIsMobile:"",shareFeedback:!1,topic:"",topicErr:"",topicOptions:[]},computed:{stateLabel:function(){return this.country=="US"?"State":"State/Province"},zipcodeLabel:function(){return this.country=="US"&&this.topic!="FBK"?"Zip Code*":this.country=="US"?"Zip Code":"Postal Code"},commentsLabel:function(){return this.topic==="FBK"?"Comments*":"Comments"}},watch:{topic:function(){this.shareFeedback|=this.topic=="FBK"}},mounted:function(){var n,t,i;this.fillUserData();n=this;this.country=Lennar.Vue.Utils.MapCountry(this.$refs.hidPreferredCountry.value);Lennar.Vue.Utils.GetCountries(this.countryOptions);Lennar.Vue.Utils.GetAllStates(this.stateOptions);t={type:"blur",target:this.$refs.inputState};this.$refs.inputState.$refs.input.onblur=function(){n.validate(t)};this.topicOptions=[{value:"FBK",text:"Comments or feedback"},{value:"Errors with website",text:"Errors with the website"},{value:"Unsubscribe",text:"Unsubscribe"},{value:"myLennar account assistance",text:"myLennar account assistance"}];i={type:"blur",target:this.$refs.inputTopic};this.$refs.inputTopic.$refs.input.onblur=function(){n.validate(i)}},components:{"vue-tel-input":VueTelInput.VueTelInput,"vue-search-select":VueSearchSelect.ModelSelect},methods:{fillContext:function(){this.contextIsMobile=this.$refs.hidIsMobile.value},fillUserData:function(){this.isLoggedIn&&axios.get("/Services/Rest/Profile.svc/GetUserProfile").then(function(n){if(n&&n.data){var t=JSON.parse(n.data);t.FirstName&&(this.fullName=t.FirstName+" "+t.LastName,this.email=t.Email,this.emailConfirm=t.Email,this.phone=t.CellPhone||t.HomePhone,this.$refs.inputPhone.phone=t.CellPhone||t.HomePhone,this.homeAddress=t.Street1,this.state=Lennar.Vue.Utils.MapState(t.State),this.city=t.City,this.zip=t.ZipCode)}}.bind(this)).catch(function(n){console.log(n)})},validate:function(n){var r=!0,i,t=null,u,f;return n&&n.type=="blur"&&(t=n.target),t&&t!=this.$refs.inputComments||(this.commentsErr=""),t&&t!=this.$refs.inputComments||this.topic!=="FBK"||this.comments!==""||(this.commentsErr=lr_gb.enterComment,i=this.$refs.inputComments,r=!1),t&&t!=this.$refs.inputTopic||(this.topicErr=""),t&&t!=this.$refs.inputTopic||this.topic!==""||(this.topicErr=lr_gb.selectTopic,i=this.$refs.inputTopic,r=!1),t&&t!=this.$refs.inputZip||(this.zipErr=""),t&&t!=this.$refs.inputZip||this.country!=="US"||this.topic=="FBK"||this.zip!==""?t&&t!=this.$refs.inputZip||this.zip==""||Lennar.Vue.Utils.ValidateZipCode(this.zip)||(this.zipErr=lr_gb.invalidZipCode,i=this.$refs.inputZip,r=!1):(this.zipErr=lr_gb.enterZipCode,i=this.$refs.inputZip,r=!1),t&&t!=this.$refs.inputCountry||(this.countryErr=""),t&&t!=this.$refs.inputCountry||this.country!==""||(this.countryErr=lr_gb.selectCountry,i=this.$refs.inputCountry,r=!1),t&&t!=this.$refs.inputPhone||(this.phoneErr=""),t&&t!=this.$refs.inputPhone||this.$refs.inputPhone.phone==""||this.$refs.inputPhone.phoneObject.isValid||(this.phoneErr=lr_gb.invalidPhone,i=this.$refs.inputPhone,r=!1),t&&t!=this.$refs.inputEmail||(this.emailErr=""),t&&t!=this.$refs.inputEmail||Lennar.Vue.Utils.ValidateEmail(this.email)||(this.emailErr=lr_gb.validEmail,i=this.$refs.inputEmail,r=!1),t&&t!=this.$refs.inputConfirmEmail||(this.emailConfirmErr=""),t&&t!=this.$refs.inputConfirmEmail||this.email==this.emailConfirm||(this.emailConfirmErr=lr_gb.emailMatch,i=this.$refs.inputConfirmEmail,r=!1),t&&t!=this.$refs.inputFullName||(this.fullNameErr=""),u=this.fullName.split(" "),(!t||t==this.$refs.inputFullName)&&u.length<2&&(this.fullNameErr=lr_gb.enterFullName,i=this.$refs.inputFullName,r=!1),!r&&i&&(f={easing:"ease-in-out",offset:-100,onDone:function(){t||i.focus()}},VueScrollTo.scrollTo(i,300,f)),r},submit:function(){var n,r,t;if(Lennar.Vue.Utils.CleanInstanceXss(this),this.validate()&&this.email2===""&&!this.submitting){this.fillContext();n=this.fullName.split(" ");r=n[0];n.splice(0,1);var f=n.join(" "),u=Lennar.Global.getGoogleTagValues(),i=Lennar.Global.SetGAValues(),e={contactType:this.topic=="FBK"?this.topic:"WEB",firstName:r,lastName:f,email:this.email,country:this.country,zipCode:this.zip,interestState:"",marketCode:"",phone:this.phone,cellPhone:"",ext:"",address:this.homeAddress,message:this.topic==="FBK"?this.comments:this.topic+" - "+this.comments,community:"",moveInDate:"",suite:"",city:this.city,state:this.country==="US"?this.state:this.stateInt,marketName:"",shareFeedback:this.shareFeedback,campaign:u.campaign,referrerDomain:u.referrerDomain,GACLIENTID:i.clientId,GAUSERID:i.userId,GATRACKID:i.trackId,source:this.contextIsMobile=="true"?"MOBILE":""};this.submitting=!0;t=this;axios.post("/Services/Rest/Profile.svc/ProcessContactUs",e).then(function(n){n&&n.data&&(t.submitting=!1,t.success=!0)}).catch(function(n){t.submitting=!1;console.log(n)})}return!1},closeModal:function(){parent.Lennar.Vue.Utils.CloseUrlModal()}}})})},"VueFeedback");Lennar.DocReady(function(){var n=document.querySelectorAll(".vue-general-inquiries");Array.prototype.forEach.call(n,function(n){new Vue({el:n,data:{isLoggedIn:Lennar.Global.actorStatus>0,submitting:!1,success:!1,fullName:"",fullNameErr:"",email:"",emailErr:"",emailConfirm:"",emailConfirmErr:"",email2:"",phone:"",phoneErr:"",country:"",countryErr:"",countryOptions:[],homeAddress:"",homeAddressErr:"",city:"",cityErr:"",state:"",stateErr:"",stateInt:"",stateIntErr:"",stateOptions:[],zip:"",zipErr:"",stateOfInterest:"",stateOfInterestErr:"",stateOfInterestOptions:[],cityOfInterest:"",cityOfInterestErr:"",cityOfInterestOptions:[{MarketCode:"",MarketName:"Select a city"}],comments:"",commentsErr:"",topic:"",topicErr:"",topicOptions:[],contextIsMobile:""},computed:{cityLabel:function(){switch(this.topic){case"COR":case"LND":case"RLT":return"City*";default:return"City"}},phoneLabel:function(){return this.topic=="COR"?"Phone Number*":"Phone Number"},commentsLabel:function(){return this.topic=="COR"?"How can we help?*":"How can we help?"},zipcodeLabel:function(){return this.country=="US"?"Zip code*":"Postal code"},stateLabel:function(){return this.topic=="COR"||this.topic=="HOM"?"State*":"State"},stateIntLabel:function(){return this.topic=="COR"?"State/Province*":"State/Province"}},watch:{stateOfInterest:function(){this.stateOfInterestChange()},topic:function(){this.topic==="HOM"&&(this.country="US")}},mounted:function(){var n,t,i,r,u;this.fillUserData();n=this;this.country=Lennar.Vue.Utils.MapCountry(this.$refs.hidPreferredCountry.value);Lennar.Vue.Utils.GetCountries(this.countryOptions);Lennar.Vue.Utils.GetAllStates(this.stateOptions);Lennar.Vue.Utils.GetActiveStates(this.stateOfInterestOptions);t={type:"blur",target:this.$refs.inputState};this.$refs.inputState.$refs.input.onblur=function(){n.validate(t)};i={type:"blur",target:this.$refs.inputStateOfInterest};this.$refs.inputStateOfInterest.$refs.input.onblur=function(){n.validate(i)};r={type:"blur",target:this.$refs.inputCityOfInterest};this.$refs.inputCityOfInterest.$refs.input.onblur=function(){n.validate(r)};this.topicOptions=[{value:"IR",text:"Investor Relations"},{value:"COR",text:"Corporate assistance"},{value:"LND",text:"Selling land"},{value:"RLT",text:"Realtor"},{value:"BUS",text:"Business partner relationship"},{value:"HOM",text:"Questions about your home"}];u={type:"blur",target:this.$refs.inputTopic};this.$refs.inputTopic.$refs.input.onblur=function(){n.validate(u)}},components:{"vue-tel-input":VueTelInput.VueTelInput,"vue-search-select":VueSearchSelect.ModelSelect},methods:{fillContext:function(){this.contextIsMobile=this.$refs.hidIsMobile.value},fillUserData:function(){this.isLoggedIn&&axios.get("/Services/Rest/Profile.svc/GetUserProfile").then(function(n){if(n&&n.data){var t=JSON.parse(n.data);t.FirstName&&(this.fullName=t.FirstName+" "+t.LastName,this.email=t.Email,this.emailConfirm=t.Email,this.phone=t.CellPhone||t.HomePhone,this.$refs.inputPhone.phone=t.CellPhone||t.HomePhone,this.homeAddress=t.Street1,this.state=Lennar.Vue.Utils.MapState(t.State),this.city=t.City,this.zip=t.ZipCode)}}.bind(this)).catch(function(n){console.log(n)})},validate:function(n){var r=!0,i,t=null,u,f;return n&&n.type=="blur"&&(t=n.target),t&&t!=this.$refs.inputComments||(this.commentsErr=""),t&&t!=this.$refs.inputComments||this.comments!==""||this.topic!=="COR"||(this.commentsErr=lr_gb.enterComment,i=this.$refs.inputComments,r=!1),t&&t!=this.$refs.inputTopic||(this.topicErr=""),t&&t!=this.$refs.inputTopic||this.topic!==""||(this.topicErr=lr_gb.selectTopic,i=this.$refs.inputTopic,r=!1),t&&t!=this.$refs.inputZip||(this.zipErr=""),t&&t!=this.$refs.inputZip||this.country!=="US"||this.zip!==""?t&&t!=this.$refs.inputZip||this.country!=="US"||Lennar.Vue.Utils.ValidateZipCode(this.zip)||(this.zipErr=lr_gb.invalidZipCode,i=this.$refs.inputZip,r=!1):(this.zipErr=lr_gb.enterZipCode,i=this.$refs.inputZip,r=!1),t&&t!=this.$refs.inputCity||(this.cityErr=""),t&&t!=this.$refs.inputCity||this.city!==""||this.topic!="COR"||(this.cityErr=lr_gb.enterCity,i=this.$refs.inputCity,r=!1),t&&t!=this.$refs.inputStateInt||(this.stateIntErr=""),t&&t!=this.$refs.inputStateInt||this.stateInt!==""||this.topic!="COR"||this.country=="US"||(this.stateIntErr=lr_gb.enterStateProvince,i=this.$refs.inputStateInt,r=!1),t&&t!=this.$refs.inputState||(this.stateErr=""),t&&t!=this.$refs.inputState||this.state!==""||this.topic!=="COR"||this.country!=="US"||(this.stateErr=lr_gb.selectState,i=this.$refs.inputState,r=!1),t&&t!=this.$refs.inputCityOfInterest||(this.cityOfInterestErr=""),t&&t!=this.$refs.inputCityOfInterest||this.cityOfInterest!==""||this.topic!=="LND"&&this.topic!="RLT"&&this.topic!="BUS"||(this.cityOfInterestErr=lr_gb.selectCity,i=this.$refs.inputCityOfInterest,r=!1),t&&t!=this.$refs.inputStateOfInterest||(this.stateOfInterestErr=""),t&&t!=this.$refs.inputStateOfInterest||this.stateOfInterest!==""||this.topic!="LND"&&this.topic!="RLT"&&this.topic!="BUS"||(this.stateOfInterestErr=lr_gb.selectState,i=this.$refs.inputStateOfInterest,r=!1),t&&t!=this.$refs.inputCountry||(this.countryErr=""),t&&t!=this.$refs.inputCountry||this.country!==""||(this.countryErr=lr_gb.selectCountry,i=this.$refs.inputCountry,r=!1),t&&t!=this.$refs.inputPhone||(this.phoneErr=""),t&&t!=this.$refs.inputPhone||this.topic!="COR"||this.$refs.inputPhone.phone!==""||(this.phoneErr=lr_gb.enterPhoneNumber,i=this.$refs.inputPhone,r=!1),t&&t!=this.$refs.inputPhone||this.$refs.inputPhone.phone==""||this.$refs.inputPhone.phoneObject.isValid||(this.phoneErr=lr_gb.invalidPhone,i=this.$refs.inputPhone,r=!1),t&&t!=this.$refs.inputEmail||(this.emailErr=""),t&&t!=this.$refs.inputEmail||Lennar.Vue.Utils.ValidateEmail(this.email)||(this.emailErr=lr_gb.validEmail,i=this.$refs.inputEmail,r=!1),t&&t!=this.$refs.inputConfirmEmail||(this.emailConfirmErr=""),t&&t!=this.$refs.inputConfirmEmail||this.email==this.emailConfirm||(this.emailConfirmErr=lr_gb.emailMatch,i=this.$refs.inputConfirmEmail,r=!1),t&&t!=this.$refs.inputFullName||(this.fullNameErr=""),u=this.fullName.split(" "),(!t||t==this.$refs.inputFullName)&&u.length<2&&(this.fullNameErr=lr_gb.enterFullName,i=this.$refs.inputFullName,r=!1),!r&&i&&(f={easing:"ease-in-out",offset:-100,onDone:function(){t||i.focus()}},VueScrollTo.scrollTo(i,300,f)),r},submit:function(){var n,r,t;if(Lennar.Vue.Utils.CleanInstanceXss(this),this.validate()&&this.email2===""&&!this.submitting){this.fillContext();n=this.fullName.split(" ");r=n[0];n.splice(0,1);var f=n.join(" "),u=Lennar.Global.getGoogleTagValues(),i=Lennar.Global.SetGAValues(),e={contactType:this.topic,firstName:r,lastName:f,email:this.email,country:this.country,zipCode:this.zip,interestState:this.stateOfInterest,marketCode:this.cityOfInterest,phone:this.phone,cellPhone:"",ext:"",address:this.homeAddress,message:this.topic+" - "+this.comments,community:"",moveInDate:"",suite:"",city:this.city,state:this.state,marketName:"",shareFeedback:!1,campaign:u.campaign,referrerDomain:u.referrerDomain,GACLIENTID:i.clientId,GAUSERID:i.userId,GATRACKID:i.trackId,source:this.contextIsMobile=="true"?"MOBILE":""};this.submitting=!0;t=this;axios.post("/Services/Rest/Profile.svc/ProcessContactUs",e).then(function(n){n&&n.data&&(t.submitting=!1,t.success=!0)}).catch(function(n){t.submitting=!1;console.log(n)})}return!1},stateOfInterestChange:function(){this.cityOfInterest="";this.cityOfInterestOptions=[];Lennar.Vue.Utils.GetActiveMarkets(this.cityOfInterestOptions,this.stateOfInterest)},closeModal:function(){parent.Lennar.Vue.Utils.CloseUrlModal()}}})})},"VueGeneralInquiries");Lennar.DocReady(function(){var n=document.querySelectorAll(".vue-home-af-calc");Array.prototype.forEach.call(n,function(n){new Vue({el:n,data:{location:null,locationText:null,income:15e4,price:0,monthlyDebt:0,downPayment:0,term:30,interestRate:4,includeTaxAndIns:!0,includePmi:!0,propertyTaxRate:1,homeownerInsuranceRate:1,hoaFee:0,plusAmount:0,periods:[],sliderPeriods:{v:[],max:-1,min:-1},incomeSliderPeriods:{v:[],max:-1,min:-1},debtSliderPeriods:{v:[],max:-1,min:-1},downPaymentPeriods:[{s:0,v:0,k:3,l:"3%"},{s:0,v:0,k:10,l:"10%"},{s:0,v:0,k:20,l:"20%"},{s:0,v:0,k:50,l:"50%"},{s:0,v:0,k:-1,l:"Fixed amount"}],currentPeriod:null,chartData:[],step:0,isEditing:!0,showMonthlyDebtInfo:!1,showDownPaymentInfo:!1,showLoanType:!1,showInterestRate:!1,showPMI:!1,showPropertyTax:!1,showHomeInsurance:!1,showHOAFee:!1,showDebtToIncome:!1,showAdvanced:!1,financialDataLoaded:!1,showError:!1,isLoggedIn:Lennar.Global.actorStatus>0,context:{at:"h"},inventories:[],plans:[],loadingData:!1,showResults:!1,skipFirstStep:!1,hideProgressBar:!1},watch:{sliderPeriods:{handler:function(){this.loadChartData()},deep:!0},chartData:function(){this.loadAffordableHomes()},incomeSliderPeriods:{handler:function(){var n;n=this.incomeSliderPeriods.max>=0?this.incomeSliderPeriods.v[this.incomeSliderPeriods.max].v:this.incomeSliderPeriods.v[this.incomeSliderPeriods.v.length-1].v;this.income!=n&&(this.income=n)},deep:!0},income:{handler:function(){var n=Math.floor((this.income-49e3)/1e3);this.incomeSliderPeriods.max!=n&&n<this.incomeSliderPeriods.v.length&&(this.incomeSliderPeriods.max=n)},deep:!0},debtSliderPeriods:{handler:function(){var n;n=this.debtSliderPeriods.max>=0?this.debtSliderPeriods.v[this.debtSliderPeriods.max].v:this.debtSliderPeriods.v[this.debtSliderPeriods.v.length-1].v;this.monthlyDebt!=n&&(this.monthlyDebt=n)},deep:!0},monthlyDebt:{handler:function(){var n=Math.floor(this.monthlyDebt/500);this.debtSliderPeriods.max!=n&&n<this.debtSliderPeriods.v.length&&(this.debtSliderPeriods.max=n)},deep:!0}},methods:{locationChanged:function(){this.location&&(this.locationText=this.location.selectLabel,this.$refs.finalLocationInput!=this.location&&this.$refs.finalLocationInput.selectItem(this.location),this.loadFinancialData(),this.$nextTick(function(){this.step==0&&this.$refs.locationNext&&this.$refs.locationNext.focus()}))},finalLocationChanged:function(){this.$refs.locationInput.value!=this.location&&this.$refs.locationInput.selectItem(this.location)},loadFinancialData:function(){this.financialDataLoaded=!0;axios.get("/Services/Rest/TypeAheadSearch.svc/GetFinancialData",{params:{searchText:this.location.cid,searchType:this.location.type}}).then(function(n){if(n&&n.data){var t=JSON.parse(n.data);this.propertyTaxRate=t.TaxRate*100;this.homeownerInsuranceRate=t.InsuranceRate*100;this.hoaFee=t.HOAFee}}.bind(this)).catch(function(n){console.log(n)})},toggleMonthlyDebtInfo:function(){this.showMonthlyDebtInfo=!this.showMonthlyDebtInfo;this.addRemoveClickListener(this.showMonthlyDebtInfo,this.toggleMonthlyDebtInfo)},toggleDownPaymentInfo:function(){this.showDownPaymentInfo=!this.showDownPaymentInfo;this.addRemoveClickListener(this.showDownPaymentInfo,this.toggleDownPaymentInfo)},toggleLoanType:function(){this.showLoanType=!this.showLoanType;this.addRemoveClickListener(this.showLoanType,this.toggleLoanType)},toggleInterestRate:function(){this.showInterestRate=!this.showInterestRate;this.addRemoveClickListener(this.showInterestRate,this.toggleInterestRate)},togglePMI:function(){this.showPMI=!this.showPMI;this.addRemoveClickListener(this.showPMI,this.togglePMI)},togglePropertyTax:function(){this.showPropertyTax=!this.showPropertyTax;this.addRemoveClickListener(this.showPropertyTax,this.togglePropertyTax)},toggleHomeInsurance:function(){this.showHomeInsurance=!this.showHomeInsurance;this.addRemoveClickListener(this.showHomeInsurance,this.toggleHomeInsurance)},toggleHOAFee:function(){this.showHOAFee=!this.showHOAFee;this.addRemoveClickListener(this.showHOAFee,this.toggleHOAFee)},toggleDebtToIncome:function(){this.showDebtToIncome=!this.showDebtToIncome;this.addRemoveClickListener(this.showDebtToIncome,this.toggleDebtToIncome)},addRemoveClickListener:function(n,t){n?setTimeout(function(){document.addEventListener("click",t)},0):document.removeEventListener("click",t)},toggleAdvanced:function(){this.showAdvanced=!this.showAdvanced},nextStep:function(){this.gotoStep(this.step+1)},previousStep:function(){this.gotoStep(this.step-1)},gotoStep:function(n){if(this.isEditing){if(n>0&&!this.financialDataLoaded)return;n>this.step&&Lennar.Vue.DataLayer.HAEvent(this);this.step=n;this.$nextTick(function(){this.focusCurrentStepInput();this.$refs.incomeSlider&&this.$refs.incomeSlider.refreshChanges();this.$refs.debtSlider&&this.$refs.debtSlider.refreshChanges()})}},focusCurrentStepInput:function(){switch(this.step){case 0:this.price==0?this.$refs.locationInput.focus():this.$refs.priceInput.focus();break;case 1:this.price==0?this.$refs.incomeInput.focus():this.$refs.downPaymentInput.focus();break;case 2:this.price==0?this.$refs.debtInput.focus():this.$refs.calculateButton.focus();break;case 3:this.$refs.downPaymentInput.focus();break;case 4:this.$refs.calculateButton.focus()}},formatNumber:function(n,t){var t=t|0,u=",",f=n<0?"-":"",r=String(parseInt(n=Math.abs(Number(n)||0).toFixed(t))),i=(i=r.length)>3?i%3:0;return f+(i?r.substr(0,i)+u:"")+r.substr(i).replace(/(\d{3})(?=\d)/g,"$1"+u)+(t?"."+Math.abs(n-r).toFixed(t).slice(2):"")},enableEdit:function(){this.isEditing=!0;VueScrollTo.scrollTo(this.$refs.title,500,{easing:"ease-in-out"});this.$nextTick(function(){this.price==0?this.$refs.finalLocationInput.focus():this.$refs.finalPriceInput.focus()})},calculate:function(){var t,n;if(this.saveDataToProfile(),this.isEditing=!1,this.showResults=!0,this.loadingData=!0,t=this.downPayment,this.downPaymentPeriods[4].v==0)for(n=0;n<this.downPaymentPeriods.length;n++)if(this.downPaymentPeriods[n].v==1){t=this.downPaymentPeriods[n].k/100;break}Lennar.Vue.DataLayer.HAEvent(this);this.price==0?axios.post("/Services/Rest/Calculator.svc/CalculateHomeAffordability",{data:{i:this.income,dp:t,md:this.monthlyDebt,t:this.term,ir:this.interestRate,iti:this.includeTaxAndIns,ip:this.includePmi,ptr:this.propertyTaxRate,hir:this.homeownerInsuranceRate,hf:this.hoaFee,pl:this.plusAmount}}).then(function(n){if(n&&n.data)if(this.loadingData=!1,this.periods=n.data,this.periods.length){if(this.periods.length!=this.sliderPeriods.v.length){this.sliderPeriods.v=[];for(var t=0;t<this.periods.length;++t)this.sliderPeriods.v.push({s:0});this.sliderPeriods.max=Math.floor(this.periods.length/2);this.$nextTick(function(){this.$refs.slider&&this.$refs.slider.refreshChanges()})}this.showError=!1;this.loadChartData()}else this.showError=!0,this.currentPeriod=null,this.inventories=[],this.plans=[]}.bind(this)).catch(function(n){this.loadingData=!1;this.isEditing=!0;console.log(n)}.bind(this)):axios.post("/Services/Rest/Calculator.svc/Calculate",{salesPrice:this.price,initPayment:this.downPayment,mortgageTerm:this.term,interestRate:this.interestRate,taxAmount:this.includeTaxAndIns?this.propertyTaxRate:0,homeownerInsurance:this.includeTaxAndIns?this.homeownerInsuranceRate:0}).then(function(n){if(n&&n.data){this.loadingData=!1;this.showError=!1;Lennar.Global.PardotRfi("hidPardotiframeEstMonPay",this.$refs.hidPardotiframeEmail.value);this.periods=[];var t=this.includePmi?n.data.hi:0;this.periods.push({pai:n.data.pai,hi:t,pt:n.data.pt,mi:n.data.mi,hf:this.hoaFee,mp:n.data.pai+t+n.data.pt+n.data.mi+this.hoaFee});this.sliderPeriods.max=0;this.loadChartData()}}.bind(this)).catch(function(n){this.loadingData=!1;this.isEditing=!0;this.showError=!0;console.log(n)}.bind(this))},loadChartData:function(){if(this.sliderPeriods.max>=0&&this.sliderPeriods.max<this.periods.length&&(this.currentPeriod=this.periods[this.sliderPeriods.max]),this.currentPeriod){this.chartData=[];var n=this.currentPeriod.pai+this.currentPeriod.hi+this.currentPeriod.pt+this.currentPeriod.mi+this.currentPeriod.hf;this.chartData.push(this.currentPeriod.pai/n*100);this.chartData.push(this.currentPeriod.pt/n*100);this.chartData.push(this.currentPeriod.hi/n*100);this.chartData.push(this.currentPeriod.mi/n*100);this.chartData.push(this.currentPeriod.hf/n*100)}},loadDataFromProfile:function(){Lennar.Global.actorStatus>0?axios.get("/Services/Rest/Profile.svc/GetUserProfile").then(function(n){if(n&&n.data){var t=JSON.parse(n.data);t.FirstName&&(t.AnnualIncome&&(this.income=t.AnnualIncome),t.MonthlyDebt&&(this.monthlyDebt=t.MonthlyDebt),t.DownPaymentValue&&(this.downPayment=t.DownPaymentValue),(t.MortgageTerm==15||t.MortgageTerm==30)&&(this.term=t.MortgageTerm),t.InterestRate&&(this.interestRate=t.InterestRate))}}.bind(this)).catch(function(n){console.log(n)}):(this.income=Lennar.Vue.Utils.GetCookie("ha_income",this.income),this.monthlyDebt=Lennar.Vue.Utils.GetCookie("ha_monthlyDebt",this.monthlyDebt),this.downPayment=Lennar.Vue.Utils.GetCookie("ha_downPayment",this.downPayment),this.term=Lennar.Vue.Utils.GetCookie("ha_term",this.term),this.interestRate=Lennar.Vue.Utils.GetCookie("ha_interestRate",this.interestRate))},loadIncomeSlider:function(){for(var t,i,r,n=0;n<=951;n++)t=n+49,i=t*1e3,r=t>=1e3?"$"+t/1e3+"M":"$"+t+"K",this.incomeSliderPeriods.v.push({s:0,l:r,v:i}),this.income==i&&(this.incomeSliderPeriods.max=n)},loadDebtSlider:function(){for(var t,i,r,n=0;n<=200;n++)t=n,i=t*500,r=t>=2e3?"$"+t/2e3+"M":"$"+t/2+"K",this.debtSliderPeriods.v.push({s:0,l:r,v:i}),this.monthlyDebt==i&&(this.debtSliderPeriods.max=n)},saveDataToProfile:function(){var n=window,t;window!=parent&&(n=parent);n.Lennar.Global.actorStatus>0?(t={annualIncome:this.income,monthlyDebt:this.monthlyDebt,downPayment:this.downPayment,mortgageTerm:this.term,interestRate:this.interestRate},axios.post("/Services/Rest/Profile.svc/SaveMortgageInformation",t).then(function(n){if(n&&n.data){var t=JSON.parse(n.data);t.Status!="Success"&&console.log(JSON.stringify(t))}}.bind(this)).catch(function(n){console.log(n)})):(this.income!=0&&Lennar.Vue.Utils.SetCookie("ha_income",this.income,365),this.monthlyDebt!=0&&Lennar.Vue.Utils.SetCookie("ha_monthlyDebt",this.monthlyDebt,365),Lennar.Vue.Utils.SetCookie("ha_downPayment",this.downPayment,365),Lennar.Vue.Utils.SetCookie("ha_term",this.term,365),Lennar.Vue.Utils.SetCookie("ha_interestRate",this.interestRate,365))},changeTab:function(n){this.context.at=n},openSignInModal:function(){var n=window,t;window!=parent&&(n=parent);n.Lennar.Global.actorStatus==0&&(n!=window&&(t={easing:"ease-in-out",container:n.document.body.getElementsByClassName("gen-mdl")[0],force:!0},VueScrollTo.scrollTo(t.container,500,t)),this.$nextTick(function(){n.Lennar.Global.LoginValidation="FromHomeAffordability";n.Lennar.Global.callBack_OnLogin="DoNothing";Lennar.Global.openSignInModal(function(){n.Lennar.Global.getActorStatus()>0&&(this.isLoggedIn=!0,this.saveDataToProfile(),Lennar.Vue.Utils.EventBus.$emit("user-logged-in"))}.bind(this),null,null,null,null,!0)}))},loadAffordableHomes:Lennar.Vue.Utils.Debounce(function(){this.$refs.hwabContainer&&(this.cancellationToken&&this.cancellationToken.cancel(),this.cancellationToken=axios.CancelToken.source(),axios.post("/Services/Rest/Search.svc/GetAffordableHomes",{item:{id:this.location.cid,type:this.location.type},price:this.currentPeriod.hv},{cancelToken:this.cancellationToken.token}).then(function(n){n&&n.data&&(this.inventories=n.data.filter(function(n){return n.type=="h"}),this.plans=n.data.filter(function(n){return n.type=="p"}),!this.inventories.length&&this.plans.length?this.context.at="p":this.inventories.length&&!this.plans.length&&(this.context.at="h"))}.bind(this)).catch(function(n){axios.isCancel(n)||console.log(n)}))},300),changePlusAmount:function(n){this.plusAmount=n;this.calculate()}},mounted:function(){var n=Lennar.Vue.Utils.GetQueryStringParameterByName("hidepg"),t=Lennar.Vue.Utils.GetQueryStringParameterByName("comid"),i=Lennar.Vue.Utils.GetQueryStringParameterByName("comnm");n&&n==="1"&&(this.hideProgressBar=!0);t&&i&&(this.location={searchText:t,searchType:"c",selectLabel:i},this.locationText=this.location.selectLabel,this.$refs.finalLocationInput.selectItem(this.location),this.loadFinancialData(),this.step=1,this.skipFirstStep=!0);this.loadIncomeSlider();this.loadDebtSlider();this.$nextTick(function(){this.loadDataFromProfile();this.$el.dataset.price&&(this.price=parseFloat(this.$el.dataset.price),this.propertyTaxRate=parseFloat(this.$el.dataset.ptr),this.homeownerInsuranceRate=parseFloat(this.$el.dataset.hir),this.hoaFee=parseFloat(this.$el.dataset.hoa),this.income=0,this.monthlyDebt=0,this.financialDataLoaded=!0)})}})})},"VueHomeAffordability");Lennar.DocReady(function(){var n=document.querySelectorAll(".vue-login");Array.prototype.forEach.call(n,function(n){new Vue({el:n,data:{submitting:!1,success:!1,email:"",emailErr:"",password:"",passwordErr:"",rememberMe:!1,userIdentifier:parent.Lennar.Global.getUserIdentifier(),isSecured:"",provider:parent.Lennar.Global.getProvider(),showThankYou:!1,janrain:!1,forgotpw:!1},mounted:function(){this.$nextTick(function(){this.$refs.inputEmail.focus()});this.fillJanrainUserData();var n=Lennar.Global.GetQueryStringParameterByName("login");switch(n){case"janrain":this.janrain=!0;break;case"forgotpw":this.forgotpw=!0}Lennar.Global.LoginValidation=Lennar.Global.GetQueryStringParameterByName("from")},methods:{validate:function(){var t=!0,n,i;return this.passwordErr="",this.password===""&&(this.passwordErr=lr_gb.enterPassword,n=this.$refs.inputPassword,t=!1),this.emailErr="",Lennar.Vue.Utils.ValidateEmail(this.email)||(this.emailErr=lr_gb.validEmail,n=this.$refs.inputEmail,t=!1),!t&&n&&(i={easing:"ease-in-out",offset:-100,onDone:function(){n.focus()}},VueScrollTo.scrollTo(n,300,i)),t},submit:function(){var t,n;return Lennar.Vue.Utils.CleanInstanceXss(this),this.validate()&&!this.submitting&&(t={userName:this.email,password:this.password,rememberMe:this.rememberMe},this.submitting=!0,n=this,axios.post("/Services/Rest/Profile.svc/LoginandRedirectUser",t,{headers:{"Content-Type":"application/json"}}).then(function(t){t&&t.data&&(n.submitting=!1,n.success=!0,Lennar.Global.loginUser_onSuccess(t,n.loginandRedirectUser_onSuccess(t.data)))}).catch(function(t){n.submitting=!1;console.log(t);Lennar.Global.loginUser_onFailed(t,n.loginUser_onFailed)})),!1},submitJanrain:function(){var t,n;return Lennar.Vue.Utils.CleanInstanceXss(this),this.validate()&&!this.submitting&&(t={userName:this.email,password:this.password,rememberMe:this.rememberMe,userIdentifier:this.userIdentifier,isSecured:this.checkSecureUrl(parent.Lennar.Global.getUserIdentifier()),associatedSocialProvider:this.provider,token:Lennar.Global.getJanrainToken()},this.submitting=!0,n=this,axios.post("/Services/Rest/Profile.svc/LoginUserJanrainSyncAndRedirect",t,{headers:{"Content-Type":"application/json"}}).then(function(t){t&&t.data&&(n.submitting=!1,n.success=!0,Lennar.Global.loginUserJanrainSync_onSuccess(t,n.loginUserJanrainSync_onSuccess(t.data)))}).catch(function(t){n.submitting=!1;console.log(t);Lennar.Global.loginUser_onFailed(t,n.loginUser_onFailed)})),!1},checkSecureUrl:function(n){var t="0";return n.indexOf("https://")>-1&&(t="1"),t},loginandRedirectUser_onSuccess:function(n){for(var t=window;t!=t.parent;)t=t.parent;n.sid==="2"?(t.Lennar.Vue.DataLayer.Event("userLogin",{loginType:"lennarAccount",loginBrand:"lennar"}),t.Lennar.Global.setActorStatus(2),typeof t.Lennar.Global.callBack_OnLogin=="function"?t.Lennar.Global.callBack_OnLogin():t.Lennar.Global.callBack_OnLogin!=undefined||n.red!=""&&(window.top.location.href=n.red),this.closeModal()):n.sid=="1"?(t.Lennar.Vue.DataLayer.Event("userLogin",{loginType:"lennarAccount",loginBrand:"lennar"}),t.Lennar.Global.setActorStatus(1),typeof t.Lennar.Global.callBack_OnLogin=="function"?t.Lennar.Global.callBack_OnLogin():t.Lennar.Global.callBack_OnLogin!=undefined,this.closeModal(),typeof isMobile!="undefined"?Lennar.Global.openMobileTermsAndConditionsModal(Lennar.Global.logoutUserWithoutRedirect):Lennar.Global.openTermsAndConditionsModal(Lennar.Global.logoutUserWithoutRedirect)):this.passwordErr=n.sid=="3"?n.msg.replace("#ResetPasswordCallback#","/modals/Login?login=forgotpw"):n.sid=="4"?lr_gb.loginPasswordNotSet:lr_gb.loginErrorMessage},loginUserJanrainSync_onSuccess:function(n){for(var t=window;t!=t.parent;)t=t.parent;n.sid=="2"?(t.Lennar.Vue.DataLayer.Event("userLogin",{loginType:"social",loginBrand:this.provider}),t.Lennar.Global.setActorStatus(2),typeof t.Lennar.Global.callBack_OnLogin=="function"?t.Lennar.Global.callBack_OnLogin():t.Lennar.Global.callBack_OnLogin!=undefined||(Lennar.Global.LoginValidation=="FromContactUs"?window.top.location.href="/contactus?contacttype=WAR":n.red!=""?window.top.location.href=n.red:t.Lennar.Global.reloadPage()),this.closeModal()):n.sid=="1"?(t.Lennar.Vue.DataLayer.Event("userLogin",{loginType:"social",loginBrand:this.provider}),t.Lennar.Global.setActorStatus(1),typeof t.Lennar.Global.callBack_OnLogin=="function"?t.Lennar.Global.callBack_OnLogin():t.Lennar.Global.callBack_OnLogin!=undefined,this.closeModal(),typeof isMobile!="undefined"?Lennar.Global.openMobileTermsAndConditionsModal(Lennar.Global.logoutUserWithoutRedirect):Lennar.Global.openTermsAndConditionsModal(Lennar.Global.logoutUserWithoutRedirect)):this.passwordErr=n.sid=="3"?n.msg.replace("#ResetPasswordCallback#","/modals/Login?login=forgotpw"):n.sid=="4"?lr_gb.loginPasswordNotSet:n.sid=="-1"?lr_gb.loginJanrainSyncError:lr_gb.loginErrorMessage},loginUser_onFailed:function(){this.passwordErr=lr_gb.loginGeneralError},fillJanrainUserData:function(){if(window.parent){var n=window.parent.Lennar.Global.getUserIdentifier();n&&(this.userIdentifier=n,this.provider=parent.Lennar.Global.getProvider(),this.email=parent.Lennar.Global.getUserNameEmail())}},submitForgotPassword:function(){var t,n;this.passwordFormValid()&&(t={},t.userName=this.email,n=this,axios.post("/Services/Rest/Profile.svc/GetPasswordResetUrl",t,{headers:{"Content-Type":"application/json"}}).then(function(t){t&&t.data?(n.submitting=!1,n.success=!0,n.getPassword_onSuccess(t)):n.getPassword_onNotFound(t)}).catch(function(t){n.submitting=!1;console.log(t);n.getPassword_onFailed()}))},getPassword_onSuccess:function(n){var t=n;if(t)this.showThankYou=!0;else return this.emailErr=lr_gb.loginForgotPasswordError,!1},getPassword_onFailed:function(){this.emailErr=lr_gb.loginForgotPasswordError},getPassword_onNotFound:function(){this.emailErr=lr_gb.loginForgotPasswordNotFound},passwordFormValid:function(){var t=!0,n,i;return this.emailErr="",Lennar.Vue.Utils.ValidateEmail(this.email)||(this.emailErr=lr_gb.validEmail,n=this.$refs.inputEmail,t=!1),!t&&n&&(i={easing:"ease-in-out",offset:-100,onDone:function(){n.focus()}},VueScrollTo.scrollTo(n,300,i)),t},closeModal:function(){parent.Lennar.Vue.Utils.CloseUrlModal()}}})})},"VueLogin");Lennar.DocReady(function(){var n,t;typeof n=="undefined"&&(n=new lennar.resources.Global);t=document.querySelectorAll(".vue-ser-req");Array.prototype.forEach.call(t,function(t){new Vue({el:t,data:{isLoggedIn:Lennar.Global.actorStatus>0,submitting:!1,success:!1,fullName:"",fullNameErr:"",email:"",email2:"",emailErr:"",phone:"",phoneErr:"",address:"",addressErr:"",zip:"",zipErr:"",comments:"",commentsErr:""},created:function(){this.fillUserData()},components:{"vue-tel-input":VueTelInput.VueTelInput},methods:{fillUserData:function(){this.isLoggedIn&&axios.get("/Services/Rest/Profile.svc/GetUserProfile").then(function(n){if(n&&n.data){var t=JSON.parse(n.data);t.FirstName&&(this.fullName=t.FirstName+" "+t.LastName,this.email=t.Email,this.phone=t.CellPhone||t.HomePhone,this.$refs.inputPhone.phone=t.CellPhone||t.HomePhone,this.address=t.Street1,this.zip=t.ZipCode)}}.bind(this)).catch(function(n){console.log(n)})},validate:function(){var i=!0,t,r,u;return this.commentsErr="",this.comments===""&&(this.commentsErr=n.enterComment,t=this.$refs.inputComments,i=!1),this.zipErr="",Lennar.Vue.Utils.ValidateZipCode(this.zip)||(this.zipErr=n.invalidZipCode,t=this.$refs.inputZip,i=!1),this.addressErr="",this.address===""&&(this.addressErr=n.enterStreetAddress,t=this.$refs.inputAddress,i=!1),this.phoneErr="",this.$refs.inputPhone.phoneObject.isValid||(this.phoneErr=n.invalidPhone,t=this.$refs.labelPhone,i=!1),this.emailErr="",Lennar.Vue.Utils.ValidateEmail(this.email)||(this.emailErr=n.validEmail,t=this.$refs.inputEmail,i=!1),this.fullNameErr="",r=this.fullName.split(" "),r.length<2&&(this.fullNameErr=n.enterFullName,t=this.$refs.inputFullName,i=!1),!i&&t&&(u={easing:"ease-in-out",offset:-65,onDone:function(){t.focus()}},VueScrollTo.scrollTo(t,300,u)),i},submit:function(){var n,r,u;if(Lennar.Vue.Utils.CleanInstanceXss(this),this.validate()&&this.email2===""&&!this.submitting){n=this.fullName.split(" ");r=n[0];n.splice(0,1);u=n.join(" ");this.submitting=!0;var t=this,f=Lennar.Global.getGoogleTagValues(),i=Lennar.Global.SetGAValues(),e={contactType:"WAR",firstName:r,lastName:u,email:this.email,country:"US",zipCode:this.zip,interestState:"",marketCode:"",phone:this.phone,cellPhone:"",ext:"",address:this.address,message:this.comments,community:"",moveInDate:"",suite:"",city:"",state:"",marketName:"",shareFeedback:!1,campaign:f.campaign,referrerDomain:f.referrerDomain,GACLIENTID:i.clientId,GAUSERID:i.userId,GATRACKID:i.trackId,source:"WEB"};axios.post("/Services/Rest/Profile.svc/ProcessContactUs",e).then(function(n){n&&n.data&&(t.submitting=!1,t.success=!0)}).catch(function(n){t.submitting=!1;console.log(n)})}return!1},openLogin:function(){Lennar.Global.openSignInModal()}}})})},"VueServiceRequest")