(function(n){let e=n.extend,f=n.ajax,r="#overviewDiv",o=r+" #propertiesDIV",s="#propertySelectorDiv",u="#Actions_ApplicantCanAddRemoveProperties",h="#ApplicationID",t={sUPDATEWIZARD:"#myRenewalNavButtonDiv",sSAVEPROPERTIES:"#SaveBtn",sCOMPLETEPROPERTYSELECTION:"#CompletePropertySelectionBtn",MYAPPLICATIONS:"#myApplicationsDashboardNavButtonDiv",MYPROPERTIES:"#myPropertiesDashboardNavButtonDiv",MYOFFERS:"#myOffersDashboardNavButtonDiv",MYCORRESPONDENCE:"#myCorrespondenceDashboardNavButtonDiv",sUPDATEPROPERTYSELECTION:"#PropertySelectionEditBtn",sAPPLICANTCONTACTEDIT:"#ApplicantContactEditBtn",sCOAPPLICANTCONTACTEDIT:"#CoApplicantContactEditBtn",sLIVINGSITUATIONEDIT:"#LivingSituationEditBtn",sADDITIONALCONTACTSEDIT:"#AdditionalContactsEditBtn"},i={APPLICATIONINFOINSTRUCTIONS:arcori.makeUrl("Application/GetApplicationInstructions"),APPLICATIONCOMPLETE:arcori.makeUrl("Application/Submit"),MYAPPLICATIONS:arcori.makeUrl("Application/MyApplicationsOverview"),MYPROPERTIES:arcori.makeUrl("Application/MyPropertiesOverview"),MYOFFERS:arcori.makeUrl("Application/MyOffersOverview"),MYCORRESPONDENCE:arcori.makeUrl("Application/MyCorrespondenceOverview"),TOGGLEINTERESTED:arcori.makeUrl("Application/ToggleInterested"),UPDATECONTACTINFO:arcori.makeUrl("Application/UpdateApplicantContactInfo"),SAVEAPPLICANTCHANGES:arcori.makeUrl("Application/SaveApplicantContactInfo")},c=kendo.Class.extend({container:null,address:null,properties:null,ELEMENT:{sORIGINID:"#OriginID",sAPPLICATIONSTATUS:"#ApplicationStatus",ApplicantContactUpdateElement:{sPRIMARYCONTACTID:"#PrimaryContactID",sSECONDARYCONTACTID:"#SecondaryContactID",sHASSECONDARY:"#HasSecondary",sAPPLICATIONID:"#ApplicationID",sHOUSEHOLDCONTACTGRID:"#householdContactGridDiv",sAPPLICANTUPDATETOOLBAR:"#applicantContactUpdateTB",sCOMMUNICATIONPREFERENCESDIV:"#applicantCommunicationPreferences",sLIVINGSITUATIONSDIV:"#applicantLivingSituationDiv",sMOVEOUTDATE:"#MoveOutDate",sMOVEOUTDATEDIV:"#MoveOutDateDiv",sMOVEADDRESSTOPASTRESIDENCE:"#MoveAddressToPastResidence",sORIGINID:"#OriginID",sVERSION:"#Version",sSPOKENLANGUAGES:"#SpokenLanguages",sUSESINTERPRETER:"#UsesInterpreter",sUSEINTERPRETERDIV:"#useInterpreterDiv"},tsCONTACTUPDATE:"#applicantContactUpdateTS"},ACTIONS:{SAVEAPPLICANTUPDATE:"saveApplicantUpdate"},primaryContactPhoneNumberListGrid:null,secondaryContactPhoneNumberListGrid:null,primaryContactEmailListGrid:null,secondaryContactEmailListGrid:null,householdContactGrid:null,housingHistory:null,init:function(){let u=this;this.container=r;n(t.MYAPPLICATIONS).bind("click",function(){u._overviewSelect(t.MYAPPLICATIONS)});n(t.MYPROPERTIES).bind("click",function(){u._overviewSelect(t.MYPROPERTIES)});n(t.MYOFFERS).bind("click",function(){u._overviewSelect(t.MYOFFERS)});n(t.MYCORRESPONDENCE).bind("click",function(){u._overviewSelect(t.MYCORRESPONDENCE)});n(t.sUPDATEWIZARD).bind("click",function(){u._launch(i.APPLICATIONINFOINSTRUCTIONS)});let f=new URLSearchParams(window.location.search.toLocaleLowerCase());n(this.ELEMENT.sAPPLICATIONSTATUS).val()===arcori.ApplicationStatusName.PropertySelection||f.getAll("pageindex")[0]==arcori.ePageIndex.PROPERTYSELECTION.toLocaleLowerCase()?u._overviewSelect(t.MYPROPERTIES):u._overviewSelect(t.MYAPPLICATIONS)},_showPropertyOverview:function(){this._overviewSelect(t.MYPROPERTIES)},_overviewSelect:function(r){let u=this;n(t.MYAPPLICATIONS+"_TitleDiv").removeClass("dashboard-item-selected");n(t.MYPROPERTIES+"_TitleDiv").removeClass("dashboard-item-selected");n(t.MYOFFERS+"_TitleDiv").removeClass("dashboard-item-selected");n(t.MYCORRESPONDENCE+"_TitleDiv").removeClass("dashboard-item-selected");n(r+"_TitleDiv").addClass("dashboard-item-selected");switch(r){case t.MYAPPLICATIONS:this._getView(i.MYAPPLICATIONS).then(function(){u._initMyApplications()});break;case t.MYPROPERTIES:this._getView(i.MYPROPERTIES).then(function(){u._initMyProperties()});break;case t.MYOFFERS:this._getView(i.MYOFFERS).then(function(){u._initMyOffers()});break;case t.MYCORRESPONDENCE:this._getView(i.MYCORRESPONDENCE).then(function(){u._initMyCorrespondence()});break;case t.sAPPLICANTCONTACTEDIT:this._getView(i.UPDATECONTACTINFO).then(function(){u._initUpdateApplicantInfo()});break;case t.sCOAPPLICANTCONTACTEDIT:this._getView(i.UPDATECONTACTINFO).then(function(){u._initUpdateApplicantInfo(arcori.strings.coApplicantContactDetailsTitle)});break;case t.sLIVINGSITUATIONEDIT:this._getView(i.UPDATECONTACTINFO).then(function(){u._initUpdateApplicantInfo(arcori.strings.livingSituationTitle)});break;case t.sADDITIONALCONTACTSEDIT:this._getView(i.UPDATECONTACTINFO).then(function(){u._initUpdateApplicantInfo(arcori.strings.additionalContactsTitle)})}},_getView:function(n){let t=this;t._busy(!0);return Promise.resolve(f({type:"POST",url:n,data:{applicationId:0},cache:!1})).then(function(n){t._updateView(n)}).catch(function(n){if(t._busy(!1),n.responseText)arcori.displayError(n),reject(n);else throw n;})},_initMyApplications:function(){let i=this,r=n(t.sUPDATEPROPERTYSELECTION);r.length&&r.getKendoButton().bind("click",function(){i._overviewSelect(t.MYPROPERTIES)});let u=n(t.sAPPLICANTCONTACTEDIT);u.length&&u.getKendoButton().bind("click",function(){i._overviewSelect(t.sAPPLICANTCONTACTEDIT)});let f=n(t.sCOAPPLICANTCONTACTEDIT);f.length&&f.getKendoButton().bind("click",function(){i._overviewSelect(t.sCOAPPLICANTCONTACTEDIT)});let e=n(t.sLIVINGSITUATIONEDIT);e.length&&e.getKendoButton().bind("click",function(){i._overviewSelect(t.sLIVINGSITUATIONEDIT)});let o=n(t.sADDITIONALCONTACTSEDIT);o.length&&o.getKendoButton().bind("click",function(){i._overviewSelect(t.sADDITIONALCONTACTSEDIT)});this._initCurrentResidenceAddress()},_initCurrentResidenceAddress:function(){this.address&&(this.address.destroy(),this.address=null);n("#CurrentResidenceAddress_UnitType").getKendoComboBox()&&(this.address=new arcori.Address({prefix:"CurrentResidenceAddress",hideAddressee:!0,hideEditorToolbar:!0,hideToolbar:!0}))},_initMyProperties:function(){let r=this;r.properties=new arcori.ApplicationProperty({container:o,selectorContainer:s,saveOnSelect:n(u).isTrue(),saveOnRemove:n(u).isTrue(),excludeOnApplicationID:n(h).val()});r.properties.show().then(function(){n(u).isTrue()?r.model.HasProperties||r.properties.kPropertyGrid._addProperties():(r.properties.kPropertyGrid.kToolBar.hide("#"+r.properties.kPropertyGrid.TBBUTTONS.ADD),r.properties.kPropertyGrid.kToolBar.hide("#"+r.properties.kPropertyGrid.TBBUTTONS.REMOVE))});n(t.sSAVEPROPERTIES).kendoButton().bind("click",function(){r.properties.save()});n(t.sCOMPLETEPROPERTYSELECTION).kendoButton().bind("click",function(){r.properties.save().then(function(){window.open(i.APPLICATIONCOMPLETE,"_self")})})},_initMyOffers:function(){let t=this;n("#overviewDiv input:checkbox").each(function(){n(this).getKendoSwitch().bind("change",function(n){let i=this;t._toggleInterested(this.element[0].id.split("_")[1],n.checked).catch(function(){i.value(i.element[0].checked?!1:!0)})})})},_initMyCorrespondence:function(){this.sentItemIndex=new arcori.SentItemIndex({entityID:n(this.ELEMENT.sORIGINID).val(),entityName:n("#PrimaryMember_Name").val(),entityType:arcori.CorrespondenceEntity.General,type:arcori.CorrespondenceType.Applicant});this.sentItemIndex.bind("deleted",function(){this.attachmentList.kGrid.dataSource.read()}.bind(this))},_initUpdateApplicantInfo:function(t){let i=this;i._initPrimaryMemberContact();n(i.ELEMENT.ApplicantContactUpdateElement.sHASSECONDARY).isTrue()&&i._initSecondaryMemberContact();i._initHouseholdContactsGrid();let r=n(i.ELEMENT.ApplicantContactUpdateElement.sAPPLICANTUPDATETOOLBAR).getKendoToolBar();r.bind("click",i._onApplicantUpdateTBClick.bind(i));n(i.ELEMENT.ApplicantContactUpdateElement.sMOVEOUTDATEDIV).hide();i._getMoveAddressToPastResidenceSwitch().bind("change",i._onApplicantAddressChange.bind(i));i.housingHistory=new arcori.HousingHistory({container:i.ELEMENT.ApplicantContactUpdateElement.sLIVINGSITUATIONSDIV});i.housingHistory._initLivingSituation();i.housingHistory._initReceivedEvictionNotice();i.housingHistory._initOweArrears();i.housingHistory._initCurrentResidenceAddress();i.housingHistory._initSafeAddress();let u=i._getUsesInterpreterSwitch();if(i._onUseInterpreterChange(),u.bind("change",i._onUseInterpreterChange.bind(i)),t!=null){let r=n(i.ELEMENT.tsCONTACTUPDATE).getKendoTabStrip(),u=r.tabGroup.find(':contains("'+t+'")');r.select(u)}},_initPrimaryMemberContact:function(){let n=this,t=n._getPrimaryContactID();n.primaryContactPhoneNumberListGrid=new arcori.ContactPhoneNumberGrid({prefix:"PrimaryMember",ContactID:t.val()});n.primaryContactEmailListGrid=new arcori.ContactEmailGrid({prefix:"PrimaryMember",ContactID:t.val()})},_initSecondaryMemberContact:function(){let n=this,t=n._getSecondaryContactID();n.secondaryContactPhoneNumberListGrid=new arcori.ContactPhoneNumberGrid({prefix:"SecondaryMember",ContactID:t.val()});n.secondaryContactEmailListGrid=new arcori.ContactEmailGrid({prefix:"SecondaryMember",ContactID:t.val()})},_initHouseholdContactsGrid:function(){let n=this;n.householdContactGrid=new arcori.HouseholdContactGrid},_toggleInterested:function(n,t){let r=this;r._busy(!0);return new Promise(function(u,e){let o=Promise.resolve(f({type:"POST",url:i.TOGGLEINTERESTED,data:{offerItemID:n,interested:t},cache:!1})).then(function(n){return r._busy(!1),arcori.showMessage(n.msgTitle,n.msg),n}).catch(function(n){if(r._busy(!1),n.responseText)arcori.displayError(n),e(n);else throw n;}).then(function(n){r._busy(!1);u(n)})})},_updateView:function(t){t&&(t.view&&(kendo.destroy(n(r)),n(r).html(t.view)),t.model&&(this.model=kendo.observable(t.model)))},_launch:function(n){window.open(n,"_self")},_busy:function(t){kendo.ui.progress(n(this.container),t)},_onApplicantUpdateTBClick:function(n){let t=this;switch(n.id){case t.ACTIONS.SAVEAPPLICANTUPDATE:t._saveApplicantContact()}},_onApplicantAddressChange:function(){let t=this,i=t._getMoveAddressToPastResidenceSwitch();i.value()?n(t.ELEMENT.ApplicantContactUpdateElement.sMOVEOUTDATEDIV).show():n(t.ELEMENT.ApplicantContactUpdateElement.sMOVEOUTDATEDIV).hide()},_saveApplicantContact:function(){let n;const t=()=>{let t=this._getApplicantUpdateData();return arcori.ajax({type:"POST",url:i.SAVEAPPLICANTCHANGES,data:t,cache:!1}).then(t=>{n=t})},r=()=>{let n=this._getPrimaryContactID().val();return this.primaryContactPhoneNumberListGrid.save(n).then(()=>this.primaryContactEmailListGrid.save(n))},u=()=>{let t=this.secondaryContactPhoneNumberListGrid!==null;if(t){let n=this._getSecondaryContactID().val();return this.secondaryContactPhoneNumberListGrid.save(n).then(()=>this.secondaryContactEmailListGrid.save(n))}};this._busy(!0);return t().then(r).then(u).then(()=>this.householdContactGrid.save()).then(()=>arcori.showMessage(n.msgTitle,n.msg)).catch(n=>{arcori.displayError(n);throw n;}).finally(()=>this._busy(!1))},_getApplicantUpdateData:function(){let t={vm:this._getData(this.ELEMENT.ApplicantContactUpdateElement.sCOMMUNICATIONPREFERENCESDIV)};return t.vm.SpokenLanguages=n(this.ELEMENT.ApplicantContactUpdateElement.sSPOKENLANGUAGES).getKendoMultiSelect().value(),t.vm.HousingHistory=this._getData(this.ELEMENT.ApplicantContactUpdateElement.sLIVINGSITUATIONSDIV),t.vm.ApplicationID=this._getApplicationID().val(),t.vm.OriginID=this._getOriginID().val(),t.vm.Version=this._getApplicationVersion().val(),t.vm.PrimaryContactID=this._getPrimaryContactID().val(),t.vm.SecondaryContactID=this._getSecondaryContactID().val(),t.vm.HasSecondary=n(this.ELEMENT.ApplicantContactUpdateElement.sHASSECONDARY).val(),t.vm.MoveOutDate=n(this.ELEMENT.ApplicantContactUpdateElement.sMOVEOUTDATE).val(),t.vm.PrimaryMember={ContactID:this._getPrimaryContactID().val()},t.vm.SecondaryMember={ContactID:this._getSecondaryContactID().val()},t.vm.MoveAddressToPastResidence=this._getMoveAddressToPastResidenceSwitch().value(),t},_getData:function(t){let i={};return n.each(n(t+" :input").serializeArray(),function(n,t){t.name in i||(i[t.name]=t.value)}),i},_getMoveAddressToPastResidenceSwitch:function(){return n(this.ELEMENT.ApplicantContactUpdateElement.sMOVEADDRESSTOPASTRESIDENCE).getKendoSwitch()},_getUsesInterpreterSwitch:function(){return n(this.ELEMENT.ApplicantContactUpdateElement.sUSESINTERPRETER).getKendoSwitch()},_getPrimaryContactID:function(){return n(this.ELEMENT.ApplicantContactUpdateElement.sPRIMARYCONTACTID)},_getSecondaryContactID:function(){return n(this.ELEMENT.ApplicantContactUpdateElement.sSECONDARYCONTACTID)},_getApplicationID:function(){return n(this.ELEMENT.ApplicantContactUpdateElement.sAPPLICATIONID)},_getOriginID:function(){return n(this.ELEMENT.ApplicantContactUpdateElement.sORIGINID)},_getApplicationVersion:function(){return n(this.ELEMENT.ApplicantContactUpdateElement.sVERSION)},_onUseInterpreterChange:function(){this._getUsesInterpreterSwitch().value()?n(this.ELEMENT.ApplicantContactUpdateElement.sUSEINTERPRETERDIV).show():n(this.ELEMENT.ApplicantContactUpdateElement.sUSEINTERPRETERDIV).hide()}});e(!0,arcori,{ApplicantHome:c})})(window.kendo.jQuery),function(n){let e=n.extend,o=n.ajax,t={HOUSEHOLD:0,COMMUNICATIONPREFERENCE:1,CURRENTLIVINGSITUATION:2,PREVIOUSLIVINGSITUATION:3,ACCOMMODATIONREQUESTS:4,PRIORITYINFO:5,INCOME:6,OBLIGATIONS:7,ASSISTANCE:8,PROGRAMSELECTION:9,REFERENCES:10,REASONSFORAPPLYING:11,DECLARATION:12,CONSENT:13,ATTACHMENTS:14,PROPERTYSELECTION:15,EMPLOYER:16,MORTGAGEPREAPPROVAL:17,REALESTATEDECLARATION:18},i={PROGRAMSELECTION:"#SectionProgramSelection",COMMUNICATIONPREFERENCES:"#SectionCommunicationPreferences",CURRENTLIVINGSITUATION:"#SectionCurrentLivingSituation",PREVIOUSLIVINGSITUATION:"#SectionPreviousLivingSituation",REFERENCES:"#SectionReferences",ACCOMMODATIONREQUESTS:"#SectionAccommodationRequests",FINANCIALINFORMATION:"#SectionFinancialInformation",EXPENSES:"#SectionExpenses",PRIORITIES:"#SectionPriorities",ASSISTANCE:"#SectionAssistance",DECLARATION:"#SectionDeclaration",CONSENT:"#SectionConsent"},r={REASONSFORAPPLYING:"#ProgramConfigurationReasonsForApplying",MORTGAGEPREAPPROVAL:"#ProgramConfigurationMortgagePreapproval",REALESTATEDECLARATION:"#ProgramConfigurationRealEstateDeclaration",INCOME:"#ProgramConfigurationIncome",LISTEMPLOYERS:"#ProgramConfigurationListEmployers"},s={ASKINCOMEOPTION:"#AskIncomeOption"},u={PREV:-1,NEXT:1},f={APPLICATIONCOMPLETE:arcori.makeUrl("Application/Submit"),SAVELASTPAGE:arcori.makeUrl("Application/SaveLastPage")},h=kendo.Class.extend({sLASTPAGEINDEX:"#LastPageIndex",sPREVIOUSBUTTON:"#PreviousBtn",sNEXTBUTTON:"#NextBtn",sREFRESHBUTTON:"#RefreshBtn",sCONTENTDIV:"#contentDiv",sFORM:"#widgetForm",sCANSUBMITAPPLICATION:"#Actions_ApplicantCanSubmitApplication",_currentPageIndex:arcori.ePageIndex.HOUSEHOLD,_widgetObject:null,section:{Programs:!0,CommunicationPreferences:!0,CurrentLivingSituation:!0,PreviousLivingSituation:!0,References:!0,AccommodationRequests:!0,FinancialInformation:!0,Expenses:!0,Priorities:!0,Assistance:!0,Declaration:!0,Consent:!0},programConfiguration:{ReasonsForApplying:!0,MortgagePreapproval:!0,RealEstateDeclaration:!0,Income:!0,ListEmployers:!0},systemSettingConfiguration:{AskIncomeOption:1},init:function(){var t=this;t.section.ProgramSelection=n(i.PROGRAMSELECTION).val().toLowerCase()==="true";t.section.CommunicationPreferences=n(i.COMMUNICATIONPREFERENCES).val().toLowerCase()==="true";t.section.CurrentLivingSituation=n(i.CURRENTLIVINGSITUATION).val().toLowerCase()==="true";t.section.PreviousLivingSituation=n(i.PREVIOUSLIVINGSITUATION).val().toLowerCase()==="true";t.section.References=n(i.REFERENCES).val().toLowerCase()==="true";t.section.AccommodationRequests=n(i.ACCOMMODATIONREQUESTS).val().toLowerCase()==="true";t.section.FinancialInformation=n(i.FINANCIALINFORMATION).val().toLowerCase()==="true";t.section.Expenses=n(i.EXPENSES).val().toLowerCase()==="true";t.section.Priorities=n(i.PRIORITIES).val().toLowerCase()==="true";t.section.Assistance=n(i.ASSISTANCE).val().toLowerCase()==="true";t.section.Declaration=n(i.DECLARATION).val().toLowerCase()==="true";t.section.Consent=n(i.CONSENT).val().toLowerCase()==="true";t.programConfiguration.ReasonsForApplying=n(r.REASONSFORAPPLYING).val().toLowerCase()==="true";t.programConfiguration.MortgagePreapproval=n(r.MORTGAGEPREAPPROVAL).val().toLowerCase()==="true";t.programConfiguration.RealEstateDeclaration=n(r.REALESTATEDECLARATION).val().toLowerCase()==="true";t.programConfiguration.Income=n(r.INCOME).isTrue();t.programConfiguration.ListEmployers=n(r.LISTEMPLOYERS).isTrue();t.systemSettingConfiguration.AskIncomeOption=parseInt(n(s.ASKINCOMEOPTION).val());t._getInitialPageIndex(n(t.sLASTPAGEINDEX).val());t.container=n(t.sCONTENTDIV);n(t.sPREVIOUSBUTTON).kendoButton().bind("click",function(){t._showNextPrevious(u.PREV)});n(t.sNEXTBUTTON).kendoButton().bind("click",function(){t._showNextPrevious(u.NEXT)});n(t.sREFRESHBUTTON).kendoButton().bind("click",function(){t._refresh()});t._showWidget();n("#helpMenu").show();new arcori.help.actions.MainMenu({container:"#main-nav"});new arcori.help.actions.Form({container:"#mainBody"})},_getInitialPageIndex:function(n){that=this;switch(n){case arcori.ePageIndex.PROGRAMSELECTION:that._currentPageIndex=that.section.ProgramSelection?n:arcori.ePageIndex.HOUSEHOLD;break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:that._currentPageIndex=that.section.CommunicationPreferences?n:arcori.ePageIndex.HOUSEHOLD;break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:that.section.CurrentLivingSituation?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.OBLIGATION);break;case arcori.ePageIndex.PREVIOUSLIVINGSITUATION:that.section.PreviousLivingSituation?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.CURRENTLIVINGSITUATION);break;case arcori.ePageIndex.REFERENCES:that.section.References?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.PREVIOUSLIVINGSITUATION);break;case arcori.ePageIndex.REASONSFORAPPLYING:that.programConfiguration.ReasonsForApplying?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.REFERENCES);break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:that.section.AccommodationRequests?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.REASONSFORAPPLYING);break;case arcori.ePageIndex.INCOME:that.section.FinancialInformation?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.ACCOMMODATIONREQUESTS);break;case arcori.ePageIndex.EMPLOYER:that.section.FinancialInformation?that.programConfiguration.ListEmployers&&that.systemSettingConfiguration.AskIncomeOption===arcori.AskIncomeOption.IncomeTaxOnly?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.INCOME):that._getInitialPageIndex(arcori.ePageIndex.ACCOMMODATIONREQUESTS);break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:that.section.FinancialInformation?that.programConfiguration.MortgagePreapproval?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.INCOME):that._getInitialPageIndex(arcori.ePageIndex.ACCOMMODATIONREQUESTS);break;case arcori.ePageIndex.REALESTATEDECLARATION:that.section.FinancialInformation?that.programConfiguration.RealEstateDeclaration?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.MORTGAGEPREAPPROVAL):that._getInitialPageIndex(arcori.ePageIndex.ACCOMMODATIONREQUESTS);break;case arcori.ePageIndex.OBLIGATION:that.section.Expenses?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.INCOME);break;case arcori.ePageIndex.APPLICATIONPRIORITY:that.section.Priorities?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.OBLIGATION);break;case arcori.ePageIndex.ASSISTANCE:that.section.Assistance?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.APPLICATIONPRIORITY);break;case arcori.ePageIndex.ATTACHMENTS:that._currentPageIndex=n;break;case arcori.ePageIndex.DECLARATION:that.section.Declaration?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.ATTACHMENTS);break;case arcori.ePageIndex.CONSENT:that.section.Consent?that._currentPageIndex=n:that._getInitialPageIndex(arcori.ePageIndex.DECLARATION)}},_showNextPrevious:function(n){this._busy(!0);this._enableButtons(!1);this._widgetObject.save().then(()=>{n==u.NEXT?this._getNext():this._getPrevious(),this._showWidget()}).catch(()=>{this._enableButtons(!0),this._busy(!1)})},_getPrevious:function(){var n=this;switch(n._currentPageIndex){case arcori.ePageIndex.HOUSEHOLD:n._currentPageIndex=arcori.ePageIndex.PROGRAMSELECTION;n.section.ProgramSelection||(n._currentPageIndex=arcori.ePageIndex.PROGRAMSELECTION,n._getPrevious());break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:n._currentPageIndex=arcori.ePageIndex.HOUSEHOLD;break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:n._currentPageIndex=arcori.ePageIndex.COMMUNICATIONPREFERENCES;n.section.CommunicationPreferences||n._getPrevious();break;case arcori.ePageIndex.PREVIOUSLIVINGSITUATION:n._currentPageIndex=arcori.ePageIndex.CURRENTLIVINGSITUATION;n.section.CurrentLivingSituation||n._getPrevious();break;case arcori.ePageIndex.REFERENCES:n._currentPageIndex=arcori.ePageIndex.PREVIOUSLIVINGSITUATION;n.section.PreviousLivingSituation||n._getPrevious();break;case arcori.ePageIndex.REASONSFORAPPLYING:n._currentPageIndex=arcori.ePageIndex.REFERENCES;n.section.References||n._getPrevious();break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:n._currentPageIndex=arcori.ePageIndex.REASONSFORAPPLYING;n.programConfiguration.ReasonsForApplying||n._getPrevious();break;case arcori.ePageIndex.INCOME:n._currentPageIndex=arcori.ePageIndex.ACCOMMODATIONREQUESTS;n.section.AccommodationRequests||n._getPrevious();break;case arcori.ePageIndex.EMPLOYER:n._currentPageIndex=arcori.ePageIndex.INCOME;n.section.FinancialInformation&&(!n.section.FinancialInformation||n.programConfiguration.Income)||n._getPrevious();break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:n._currentPageIndex=arcori.ePageIndex.EMPLOYER;n.section.FinancialInformation&&(!n.section.FinancialInformation||n.programConfiguration.ListEmployers&&n.systemSettingConfiguration.AskIncomeOption===arcori.AskIncomeOption.IncomeTaxOnly)||n._getPrevious();break;case arcori.ePageIndex.REALESTATEDECLARATION:n._currentPageIndex=arcori.ePageIndex.MORTGAGEPREAPPROVAL;n.section.FinancialInformation&&(!n.section.FinancialInformation||n.programConfiguration.MortgagePreapproval)||n._getPrevious();break;case arcori.ePageIndex.OBLIGATION:n._currentPageIndex=arcori.ePageIndex.REALESTATEDECLARATION;n.section.FinancialInformation&&(!n.section.FinancialInformation||n.programConfiguration.RealEstateDeclaration)||n._getPrevious();break;case arcori.ePageIndex.APPLICATIONPRIORITY:n._currentPageIndex=arcori.ePageIndex.OBLIGATION;n.section.Expenses||n._getPrevious();break;case arcori.ePageIndex.ASSISTANCE:n._currentPageIndex=arcori.ePageIndex.APPLICATIONPRIORITY;n.section.Priorities||n._getPrevious();break;case arcori.ePageIndex.ATTACHMENTS:n._currentPageIndex=arcori.ePageIndex.ASSISTANCE;n.section.Assistance||n._getPrevious();break;case arcori.ePageIndex.DECLARATION:n._currentPageIndex=arcori.ePageIndex.ATTACHMENTS;break;case arcori.ePageIndex.CONSENT:n._currentPageIndex=arcori.ePageIndex.DECLARATION;n.section.Declaration||n._getPrevious()}},_getNext:function(){that=this;switch(that._currentPageIndex){case arcori.ePageIndex.PROGRAMSELECTION:that._currentPageIndex=arcori.ePageIndex.HOUSEHOLD;that.section.ProgramSelection||that._getNext();break;case arcori.ePageIndex.HOUSEHOLD:that._currentPageIndex=arcori.ePageIndex.COMMUNICATIONPREFERENCES;that.section.CommunicationPreferences||that._getNext();break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:that._currentPageIndex=arcori.ePageIndex.CURRENTLIVINGSITUATION;that.section.CurrentLivingSituation||that._getNext();break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:that._currentPageIndex=arcori.ePageIndex.PREVIOUSLIVINGSITUATION;that.section.PreviousLivingSituation||that._getNext();break;case arcori.ePageIndex.PREVIOUSLIVINGSITUATION:that._currentPageIndex=arcori.ePageIndex.REFERENCES;that.section.References||that._getNext();break;case arcori.ePageIndex.REFERENCES:that._currentPageIndex=arcori.ePageIndex.REASONSFORAPPLYING;that.programConfiguration.ReasonsForApplying||that._getNext();break;case arcori.ePageIndex.REASONSFORAPPLYING:that._currentPageIndex=arcori.ePageIndex.ACCOMMODATIONREQUESTS;that.section.AccommodationRequests||that._getNext();break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:that._currentPageIndex=arcori.ePageIndex.INCOME;that.section.FinancialInformation&&(!that.section.FinancialInformation||that.programConfiguration.Income)||that._getNext();break;case arcori.ePageIndex.INCOME:that._currentPageIndex=arcori.ePageIndex.EMPLOYER;that.section.FinancialInformation&&(!that.section.FinancialInformation||that.programConfiguration.ListEmployers&&that.systemSettingConfiguration.AskIncomeOption===arcori.AskIncomeOption.IncomeTaxOnly)||that._getNext();break;case arcori.ePageIndex.EMPLOYER:that._currentPageIndex=arcori.ePageIndex.MORTGAGEPREAPPROVAL;that.section.FinancialInformation&&(!that.section.FinancialInformation||that.programConfiguration.MortgagePreapproval)||that._getNext();break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:that._currentPageIndex=arcori.ePageIndex.REALESTATEDECLARATION;that.section.FinancialInformation&&(!that.section.FinancialInformation||that.programConfiguration.RealEstateDeclaration)||that._getNext();break;case arcori.ePageIndex.REALESTATEDECLARATION:that._currentPageIndex=arcori.ePageIndex.OBLIGATION;that.section.Expenses||that._getNext();break;case arcori.ePageIndex.OBLIGATION:that._currentPageIndex=arcori.ePageIndex.APPLICATIONPRIORITY;that.section.Priorities||that._getNext();break;case arcori.ePageIndex.APPLICATIONPRIORITY:that._currentPageIndex=arcori.ePageIndex.ASSISTANCE;that.section.Assistance||that._getNext();break;case arcori.ePageIndex.ASSISTANCE:that._currentPageIndex=arcori.ePageIndex.ATTACHMENTS;break;case arcori.ePageIndex.ATTACHMENTS:that._currentPageIndex=arcori.ePageIndex.DECLARATION;that.section.Declaration||that._getNext();break;case arcori.ePageIndex.DECLARATION:that._currentPageIndex=arcori.ePageIndex.CONSENT;that.section.Consent||that._getNext();break;case arcori.ePageIndex.CONSENT:window.open(f.APPLICATIONCOMPLETE,"_self")}},_refresh:function(){var n=this;n._showWidget()},_enableButtons:function(t){let i=this,r=t&&n(i.sCANSUBMITAPPLICATION).val().toLowerCase()==="true";n(i.sPREVIOUSBUTTON).data("kendoButton").enable(r);n(i.sNEXTBUTTON).data("kendoButton").enable(r)},_updateProgramBasedConfiguration:function(n){this.programConfiguration.ReasonsForApplying=n.ProgramConfiguration.ReasonsForApplying;this.programConfiguration.MortgagePreapproval=n.ProgramConfiguration.MortgagePreapproval;this.programConfiguration.RealEstateDeclaration=n.ProgramConfiguration.RealEstateDeclaration;this.programConfiguration.Income=n.ProgramConfiguration.Income;this.programConfiguration.ListEmployers=n.ProgramConfiguration.ListEmployers;this.section.FinancialInformation=n.ProgramConfiguration.HasFinancialQuestions;this.section.AccommodationRequests=n.ProgramConfiguration.HasAccommodationRequests},_showWidget:function(){var t=this,i={container:t.sCONTENTDIV,form:t.sFORM};t._busy(!0);t._enableButtons(!1);n("[data-helpid].k-icon.k-i-question").attr("data-helpid","1."+t._getPageIndexID());n("[data-helpid].k-icon.k-i-question").data().helpid="1."+t._getPageIndexID();n("[data-helpid].k-icon.k-i-question").attr("data-helpid","1."+t._getPageIndexID());n("[data-helpid].k-icon.k-i-question").data().helpid="1."+t._getPageIndexID();n("#helpMenu").attr("data-helpid","1."+t._getPageIndexID());n("#helpMenu").data().helpid="1."+t._getPageIndexID();switch(t._currentPageIndex){case arcori.ePageIndex.PROGRAMSELECTION:let n=i;n.onSaved=n=>t._updateProgramBasedConfiguration(n);t._widgetObject=new arcori.ApplicationProgramSelection(n);break;case arcori.ePageIndex.HOUSEHOLD:t._widgetObject=new arcori.Household(i);break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:t._widgetObject=new arcori.CommunicationPreferences(i);break;case arcori.ePageIndex.REASONSFORAPPLYING:t._widgetObject=new arcori.ReasonsForApplying(i);break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:t._widgetObject=new arcori.AccommodationRequests(i);break;case arcori.ePageIndex.APPLICATIONPRIORITY:t._widgetObject=new arcori.ApplicationPriority(i);break;case arcori.ePageIndex.INCOME:t._widgetObject=new arcori.Income(i);break;case arcori.ePageIndex.EMPLOYER:t._widgetObject=new arcori.EmployerGrid(i);break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:t._widgetObject=new arcori.MortgagePreapproval(i);break;case arcori.ePageIndex.REALESTATEDECLARATION:t._widgetObject=new arcori.RealEstateDeclaration(i);break;case arcori.ePageIndex.OBLIGATION:t._widgetObject=new arcori.Obligation(i);break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:t._widgetObject=new arcori.HousingHistory(i);break;case arcori.ePageIndex.PREVIOUSLIVINGSITUATION:t._widgetObject=new arcori.ResidenceGrid(i);break;case arcori.ePageIndex.REFERENCES:t._widgetObject=new arcori.ReferenceGrid(i);break;case arcori.ePageIndex.ASSISTANCE:t._widgetObject=new arcori.ApplicationAssistance(i);break;case arcori.ePageIndex.ATTACHMENTS:t._widgetObject=new arcori.ApplicationAttachments(i);break;case arcori.ePageIndex.DECLARATION:t.section.Declaration&&(t._widgetObject=new arcori.Declaration(i));break;case arcori.ePageIndex.CONSENT:t.section.Consent&&(t._widgetObject=new arcori.Consent(i))}t._widgetObject.show().then(function(){t._configurePreviousButton(t._currentPageIndex);t._configureNextButton(t._currentPageIndex);t._savePageIndex();t._enableButtons(!0);t._busy(!1)}).catch(function(){t._enableButtons(!0);t._busy(!1)})},_configurePreviousButton:function(t){var i=this;switch(t){case arcori.ePageIndex.PROGRAMSELECTION:n(i.sPREVIOUSBUTTON).hide();break;case arcori.ePageIndex.HOUSEHOLD:i.section.ProgramSelection?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.HouseholdBackButton),n(i.sPREVIOUSBUTTON).show()):n(i.sPREVIOUSBUTTON).hide();break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.CommunicationPreferencesBackButton);n(i.sPREVIOUSBUTTON).show();break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:i.section.CommunicationPreferences?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.CurrentLivingSituationBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.COMMUNICATIONPREFERENCES);break;case arcori.ePageIndex.PREVIOUSLIVINGSITUATION:i.section.CurrentLivingSituation?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.PreviousLivingSituationBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.CURRENTLIVINGSITUATION);break;case arcori.ePageIndex.REFERENCES:i.section.PreviousLivingSituation?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.ReferencesBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.PREVIOUSLIVINGSITUATION);break;case arcori.ePageIndex.REASONSFORAPPLYING:i.section.References?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.ReasonsForApplyingBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.REFERENCES);break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:i.programConfiguration.ReasonsForApplying?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.AccommodationRequestsBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.REASONSFORAPPLYING);break;case arcori.ePageIndex.INCOME:i.section.AccommodationRequests?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.IncomeBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.ACCOMMODATIONREQUESTS);break;case arcori.ePageIndex.EMPLOYER:i.section.FinancialInformation&&i.programConfiguration.Income?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.EmployerBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.INCOME);break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:i.section.FinancialInformation?i.programConfiguration.ListEmployers&&i.systemSettingConfiguration.AskIncomeOption===arcori.AskIncomeOption.IncomeTaxOnly?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.MortgageApprovalBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.EMPLOYER):i._configurePreviousButton(arcori.ePageIndex.INCOME);break;case arcori.ePageIndex.REALESTATEDECLARATION:i.section.FinancialInformation&&i.programConfiguration.MortgagePreapproval?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.RealEstateDeclarationBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.MORTGAGEPREAPPROVAL);break;case arcori.ePageIndex.OBLIGATION:i.section.FinancialInformation&&i.programConfiguration.RealEstateDeclaration?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.ObligationBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.REALESTATEDECLARATION);break;case arcori.ePageIndex.APPLICATIONPRIORITY:i.section.Expenses?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.PriorityBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.OBLIGATION);break;case arcori.ePageIndex.ASSISTANCE:i.section.Priorities?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.AssistanceBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.APPLICATIONPRIORITY);break;case arcori.ePageIndex.ATTACHMENTS:i.section.Assistance?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.AttachmentsBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.ASSISTANCE);break;case arcori.ePageIndex.DECLARATION:n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.DeclarationBackButton);n(i.sPREVIOUSBUTTON).show();break;case arcori.ePageIndex.CONSENT:i.section.Declaration?(n(i.sPREVIOUSBUTTON).kendoButton().text(arcori.strings.ConsentBackButton),n(i.sPREVIOUSBUTTON).show()):i._configurePreviousButton(arcori.ePageIndex.DECLARATION)}},_configureNextButton:function(t){var i=this;switch(t){case arcori.ePageIndex.PROGRAMSELECTION:n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.ProgramNextButton);break;case arcori.ePageIndex.HOUSEHOLD:i.section.CommunicationPreferences?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.HouseholdNextButton):i._configureNextButton(arcori.ePageIndex.COMMUNICATIONPREFERENCES);break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:i.section.CurrentLivingSituation?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.CommunicationPreferencesNextButton):i._configureNextButton(arcori.ePageIndex.CURRENTLIVINGSITUATION);break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:i.section.PreviousLivingSituation?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.CurrentLivingSituationNextButton):i._configureNextButton(arcori.ePageIndex.PREVIOUSLIVINGSITUATION);break;case arcori.ePageIndex.PREVIOUSLIVINGSITUATION:i.section.References?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.PreviousLivingSituationNextButton):i._configureNextButton(arcori.ePageIndex.REFERENCES);break;case arcori.ePageIndex.REFERENCES:i.programConfiguration.ReasonsForApplying?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.ReferencesNextButton):i._configureNextButton(arcori.ePageIndex.REASONSFORAPPLYING);break;case arcori.ePageIndex.REASONSFORAPPLYING:i.section.AccommodationRequests?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.ReasonsForApplyingNextButton):i._configureNextButton(arcori.ePageIndex.ACCOMMODATIONREQUESTS);break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:i.section.FinancialInformation&&i.programConfiguration.Income?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.AccommodationRequestsNextButton):i._configureNextButton(arcori.ePageIndex.INCOME);break;case arcori.ePageIndex.INCOME:i.section.FinancialInformation&&i.programConfiguration.ListEmployers&&i.systemSettingConfiguration.AskIncomeOption===arcori.AskIncomeOption.IncomeTaxOnly?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.IncomeNextButton):i._configureNextButton(arcori.ePageIndex.EMPLOYER);break;case arcori.ePageIndex.EMPLOYER:i.section.FinancialInformation&&i.programConfiguration.MortgagePreapproval?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.EmployerNextButton):i._configureNextButton(arcori.ePageIndex.MORTGAGEPREAPPROVAL);break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:i.section.FinancialInformation&&i.programConfiguration.RealEstateDeclaration?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.MortgageApprovalNextButton):i._configureNextButton(arcori.ePageIndex.REALESTATEDECLARATION);break;case arcori.ePageIndex.REALESTATEDECLARATION:i.section.Expenses?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.RealEstateDeclarationNextButton):i._configureNextButton(arcori.ePageIndex.OBLIGATION);break;case arcori.ePageIndex.OBLIGATION:i.section.Priorities?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.ObligationNextButton):i._configureNextButton(arcori.ePageIndex.APPLICATIONPRIORITY);break;case arcori.ePageIndex.APPLICATIONPRIORITY:i.section.Assistance?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.PriorityNextButton):i._configureNextButton(arcori.ePageIndex.ASSISTANCE);break;case arcori.ePageIndex.ASSISTANCE:n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.AssistanceNextButton);break;case arcori.ePageIndex.ATTACHMENTS:i.section.Declaration?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.AttachmentsNextButton):i._configureNextButton(arcori.ePageIndex.DECLARATION);break;case arcori.ePageIndex.DECLARATION:i.section.Consent?n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.DeclarationNextButton):i._configureNextButton(arcori.ePageIndex.CONSENT);break;case arcori.ePageIndex.CONSENT:n(i.sNEXTBUTTON).kendoButton().text(arcori.strings.ConsentNextButton)}},_savePageIndex:function(){if(n("#ApplicationID").val()!==0){var t=this,i={id:n("#ApplicationID").val(),pageIndex:t._currentPageIndex};o({type:"POST",url:f.SAVELASTPAGE,data:i,cache:!1})}},_getPageIndexID:function(){switch(this._currentPageIndex){case arcori.ePageIndex.PROGRAMSELECTION:return t.PROGRAMSELECTION;case arcori.ePageIndex.HOUSEHOLD:return t.HOUSEHOLD;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:return t.COMMUNICATIONPREFERENCE;case arcori.ePageIndex.APPLICATIONPRIORITY:return t.PRIORITYINFO;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:return t.ACCOMMODATIONREQUESTS;case arcori.ePageIndex.INCOME:return t.INCOME;case arcori.ePageIndex.EMPLOYER:return t.EMPLOYER;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:return t.MORTGAGEPREAPPROVAL;case arcori.ePageIndex.REALESTATEDECLARATION:return t.REALESTATEDECLARATION;case arcori.ePageIndex.OBLIGATION:return t.OBLIGATIONS;case arcori.ePageIndex.CURRENTLIVINGSITUATION:return t.CURRENTLIVINGSITUATION;case arcori.ePageIndex.PREVIOUSLIVINGSITUATION:return t.PREVIOUSLIVINGSITUATION;case arcori.ePageIndex.REFERENCES:return t.REFERENCES;case arcori.ePageIndex.REASONSFORAPPLYING:return t.REASONSFORAPPLYING;case arcori.ePageIndex.ASSISTANCE:return t.ASSISTANCE;case arcori.ePageIndex.ATTACHMENTS:return t.ATTACHMENTS;case arcori.ePageIndex.DECLARATION:return t.DECLARATION;case arcori.ePageIndex.CONSENT:return t.CONSENT}},_busy:function(t){kendo.ui.progress(n(this.container),t)}});e(!0,arcori,{ApplicationWizard:h})}(window.kendo.jQuery),function(n){let r=n.extend,u=n.ajax,i={APPLICATIONCOMPLETE:arcori.makeUrl("Application/Submit"),SAVELASTPAGE:arcori.makeUrl("Application/SaveLastPage"),WIZARDSTEPURL:arcori.makeUrl("Application/RenewalWizardTemplate")};const t="_WizardNavItem";let f=kendo.Class.extend({_currentPageIndex:arcori.ePageIndex.APPLICATIONQUESTIONNAIRE,_widgetObject:null,kWizard:null,ELEMENT:{sFORM:"#wizardForm",sWIZARD:"#renewalWizard",sDEFAULTSTEPPER:".k-stepper",sWIZARDSTEPPER:"#wizardStepper",sHOUSEHOLDSTEP:`#wizardStepper #Household${t}`,sLIVINGSITUATIONSTEP:`#wizardStepper #CurrentLivingSituation${t}`,sPRIORITYSTEP:`#wizardStepper #PriorityInfo${t}`,sACCOMMODATIONSTEP:`#wizardStepper #AccommodationRequests${t}`},household:null,communicationPreferences:null,accommodationRequests:null,applicationPriority:null,income:null,employerGrid:null,mortgagePreapproval:null,realEstateDeclaration:null,housingHistory:null,applicationAttachments:null,declaration:null,consent:null,renewalQuestionnaire:null,init:function(n){this.options=r(!0,{},this.options,n);this.options.container=this.ELEMENT.sFORM;n.currentPageIndex&&(this._currentPageIndex=n.currentPageIndex);this._initWizard();this._initStepper();this._selectInitialStep()},_initWizard:function(){this.kWizard=n(this.ELEMENT.sWIZARD).getKendoWizard();this.kWizard.bind("contentLoad",n=>this._onStepActivate(n));this.kWizard.bind("select",n=>this._onStepSelect(n));this.kWizard.bind("done",()=>this._onDone())},_initStepper:function(){n(this.ELEMENT.sDEFAULTSTEPPER).hide();n(this.ELEMENT.sWIZARDSTEPPER).on("click",".a-step",n=>this._selectStepFromStepper(n));this.kWizard.removeStepByID("DummyStep");let t=this.kWizard.steps()[0];t.options.buttons.shift();t._buttons.shift();t._leftButtonsContainer.find("[data-wizard-reset]").remove()},_selectStepFromStepper:function(n){let t=this._wizardNavItemToPageIndex(n.currentTarget.id);this._saveCurrentWidget(t)},_saveCurrentWidget:function(n){this._widgetObject&&this._widgetObject.save().then(()=>this._setActiveWidget(n)).catch(()=>{})},_highlightCurrentStep:function(){n(".a-step").removeClass("a-step-current");n(`${this.ELEMENT.sWIZARDSTEPPER} #${this._pageIndexToWizardNavItem(this._currentPageIndex)}`).addClass("a-step-current")},_addStep:function(n){let t=this.kWizard.getStepByID(n);if(t==null){let t={title:n,contentId:n,contentUrl:`${i.WIZARDSTEPURL}?page=${n}`,buttons:["previous","next"]};this.kWizard.insertAt(this._getInsertIndex(n),t)}},_getInsertIndex:function(n){let i=null,t=null;switch(n){case arcori.ePageIndex.HOUSEHOLD:t=arcori.ePageIndex.APPLICATIONQUESTIONNAIRE;break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:t=arcori.ePageIndex.HOUSEHOLD;break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:t=arcori.ePageIndex.CURRENTLIVINGSITUATION;break;case arcori.ePageIndex.INCOME:t=arcori.ePageIndex.ACCOMMODATIONREQUESTS;break;case arcori.ePageIndex.EMPLOYER:t=arcori.ePageIndex.INCOME;break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:t=arcori.ePageIndex.EMPLOYER;break;case arcori.ePageIndex.REALESTATEDECLARATION:t=arcori.ePageIndex.MORTGAGEPREAPPROVAL;break;case arcori.ePageIndex.APPLICATIONPRIORITY:t=arcori.ePageIndex.REALESTATEDECLARATION}return i=this.kWizard.getStepByID(t),i?i.options.index+1:this._getInsertIndex(t)},_removeStep:function(n){switch(n){case arcori.ePageIndex.HOUSEHOLD:this.household=null;break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:this.accommodationRequests=null;break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:this.housingHistory=null;break;case arcori.ePageIndex.APPLICATIONPRIORITY:this.applicationPriority=null}this.kWizard.removeStepByID(n)},_enabledStep:function(n,t){t?this._addStep(n):this._removeStep(n);this._toggleStepVisibility(n,t)},_toggleStepVisibility:function(t,i){let r=null;switch(t){case arcori.ePageIndex.HOUSEHOLD:r=n(this.ELEMENT.sHOUSEHOLDSTEP);break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:r=n(this.ELEMENT.sACCOMMODATIONSTEP);break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:r=n(this.ELEMENT.sLIVINGSITUATIONSTEP);break;case arcori.ePageIndex.APPLICATIONPRIORITY:r=n(this.ELEMENT.sPRIORITYSTEP)}r&&r.toggle(i)},_selectInitialStep:function(){this._stepIsAvailable(this._currentPageIndex)?this._setActiveWidget(this._currentPageIndex):this._setActiveWidget(arcori.ePageIndex.APPLICATIONQUESTIONNAIRE)},_stepIsAvailable:function(t){let i=n(`${this.ELEMENT.sWIZARDSTEPPER} #${this._pageIndexToWizardNavItem(t)}`);return i.is(":visible")},_getWidgetOptions:function(n){return{container:`#${n}ContentDiv`,form:`#${n}Form`}},_updateWizardSteps:function(n){this._enabledStep(arcori.ePageIndex.HOUSEHOLD,n.UpdateHousehold);this._enabledStep(arcori.ePageIndex.ACCOMMODATIONREQUESTS,n.UpdateAccommodations);this._enabledStep(arcori.ePageIndex.CURRENTLIVINGSITUATION,n.UpdateCurrentLivingSituation);this._enabledStep(arcori.ePageIndex.APPLICATIONPRIORITY,n.UpdatePriorityInfo)},_showWidget:function(n){let t=this,i=!1,r=t._getWidgetOptions(n);t._busy(!0);switch(n){case arcori.ePageIndex.APPLICATIONQUESTIONNAIRE:t.renewalQuestionnaire===null&&(r.callBack=n=>t._updateWizardSteps(n),t.renewalQuestionnaire=new arcori.RenewalQuestionnaire(r),i=!0);t._widgetObject=t.renewalQuestionnaire;break;case arcori.ePageIndex.HOUSEHOLD:t.household===null&&(t.household=new arcori.Household(r),i=!0);t._widgetObject=t.household;break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:t.communicationPreferences===null&&(t.communicationPreferences=new arcori.CommunicationPreferences(r),i=!0);t._widgetObject=t.communicationPreferences;break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:t.accommodationRequests===null&&(t.accommodationRequests=new arcori.AccommodationRequests(r),i=!0);t._widgetObject=t.accommodationRequests;break;case arcori.ePageIndex.APPLICATIONPRIORITY:t.applicationPriority===null&&(t.applicationPriority=new arcori.ApplicationPriority(r),i=!0);t._widgetObject=t.applicationPriority;break;case arcori.ePageIndex.INCOME:t.income===null&&(t.income=new arcori.Income(r),i=!0);t._widgetObject=t.income;break;case arcori.ePageIndex.EMPLOYER:t.employerGrid===null&&(t.employerGrid=new arcori.EmployerGrid(r),i=!0);t._widgetObject=t.employerGrid;break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:t.mortgagePreapproval===null&&(t.mortgagePreapproval=new arcori.MortgagePreapproval(r),i=!0);t._widgetObject=t.mortgagePreapproval;break;case arcori.ePageIndex.REALESTATEDECLARATION:t.realEstateDeclaration===null&&(t.realEstateDeclaration=new arcori.RealEstateDeclaration(r),i=!0);t._widgetObject=t.realEstateDeclaration;break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:t.housingHistory===null&&(t.housingHistory=new arcori.HousingHistory(r),i=!0);t._widgetObject=t.housingHistory;break;case arcori.ePageIndex.ATTACHMENTS:t.applicationAttachments===null&&(t.applicationAttachments=new arcori.ApplicationAttachments(r),i=!0);t._widgetObject=t.applicationAttachments;break;case arcori.ePageIndex.DECLARATION:t.declaration===null&&(t.declaration=new arcori.Declaration(r),i=!0);t._widgetObject=t.declaration;break;case arcori.ePageIndex.CONSENT:t.consent===null&&(t.consent=new arcori.Consent(r),i=!0);t._widgetObject=t.consent}i?t._widgetObject.show().finally(()=>this._busy(!1)):t._busy(!1)},_setActiveWidget:function(n){this._currentPageIndex=n;this._highlightCurrentStep();this.kWizard.selectStepByID(this._currentPageIndex);switch(this._currentPageIndex){case arcori.ePageIndex.APPLICATIONQUESTIONNAIRE:this._widgetObject=this.renewalQuestionnaire;break;case arcori.ePageIndex.HOUSEHOLD:this._widgetObject=this.household;break;case arcori.ePageIndex.COMMUNICATIONPREFERENCES:this._widgetObject=this.communicationPreferences;break;case arcori.ePageIndex.ACCOMMODATIONREQUESTS:this._widgetObject=this.accommodationRequests;break;case arcori.ePageIndex.APPLICATIONPRIORITY:this._widgetObject=this.applicationPriority;break;case arcori.ePageIndex.INCOME:this._widgetObject=this.income;break;case arcori.ePageIndex.EMPLOYER:this._widgetObject=this.employerGrid;break;case arcori.ePageIndex.MORTGAGEPREAPPROVAL:this._widgetObject=this.mortgagePreapproval;break;case arcori.ePageIndex.REALESTATEDECLARATION:this._widgetObject=this.realEstateDeclaration;break;case arcori.ePageIndex.CURRENTLIVINGSITUATION:this._widgetObject=this.housingHistory;break;case arcori.ePageIndex.ATTACHMENTS:this._widgetObject=this.applicationAttachments;break;case arcori.ePageIndex.DECLARATION:this._widgetObject=this.declaration;break;case arcori.ePageIndex.CONSENT:this._widgetObject=this.consent}this._savePageIndex()},_savePageIndex:function(){let r=this,t=n("#ApplicationID").val();if(t!==0){var f={id:t,pageIndex:r._currentPageIndex};u({type:"POST",url:i.SAVELASTPAGE,data:f,cache:!1})}},_onStepActivate:function(n){this._showWidget(n.step.options.contentId)},_onStepSelect:function(n){n.preventDefault();let t=n.step.options.contentId;this._saveCurrentWidget(t)},_onDone:function(){this._widgetObject.save().then(()=>{window.open(i.APPLICATIONCOMPLETE,"_self")})},_busy:function(n){arcori.busy(this.options.container,n)},_pageIndexToWizardNavItem:function(n){return`${n}${t}`},_wizardNavItemToPageIndex:function(n){return n.slice(0,-t.length)}});r(!0,arcori,{RenewalWizard:f})}(window.kendo.jQuery),function(n){var t=n.extend,f=n.ajax,i="#ApplicationID",r={RENEW:arcori.makeUrl("Application/Renew")},u=kendo.Class.extend({init:function(n){n&&n.container&&(this.sCONTAINER=n.container)},_renew:function(){var t=this;return new Promise(function(u){n.when(kendo.ui.ExtYesNoDialog.show({title:arcori.strings.renewApplicationTitle,message:arcori.strings.renewApplicationMsg,icon:"k-ext-question",modal:!0})).done(function(f){f.button==="Yes"?(t._busy(!0),Promise.resolve(n.ajax({type:"POST",url:r.RENEW,data:{applicationID:n(i).val()},cache:!1})).then(function(n){return window.location.reload(),n}).catch(function(n){arcori.displayError(n)}).then(function(n){t._busy(!1);u(n)})):u()})})},_busy:function(t){kendo.ui.progress(n(this.sCONTAINER),t)}});t(!0,arcori,{Application:u})}(window.kendo.jQuery),function(n){var t=n.extend,i=n.ajax,r={VIEW:arcori.makeUrl("Application/GetAttachmentsView")},u=kendo.Class.extend({ID:null,sCONTAINER:null,sAPPLICATIONID:"#ApplicationID",sORIGINID:"#OriginID",sFORM:null,kValidator:null,$form:null,attachmentList:null,sATTACHMENTSDIV:"#applicationAttachmentsDiv",NODETYPE:"Application",init:function(n){n&&(n.container&&(this.sCONTAINER=n.container),n.form&&(this.sFORM=n.form))},show:function(){var n=this;return n._getView()},_getView:function(){var t=this;return t._busy(!0),Promise.resolve(i({type:"POST",url:r.VIEW,data:{applicationId:n(t.sAPPLICATIONID).val()},cache:!1})).then(function(n){t._updateView(n)}).catch(function(n){if(n.responseText)arcori.displayError(n);else throw n;}).then(function(){t._busy(!1)})},_updateView:function(t){var i=this;t&&(kendo.destroy(n(i.sCONTAINER)),n(i.sCONTAINER).html(t.view));i.$form=n(i.sFORM);this.attachmentList=new arcori.AttachmentList({entityID:n(this.sAPPLICATIONID).val(),entityType:this.NODETYPE,container:this.sATTACHMENTSDIV,permissions:{add:!0,remove:!0}});arcori.formatServerSideErrors(i.$form);this.kValidator=i.$form.kendoValidator({errorTemplate:arcori.validatorErrorTemplate()}).getKendoValidator()},save:function(){this.attachmentList.entityID=n(this.sAPPLICATIONID).val();this._busy(!0);return new Promise((n,t)=>this.attachmentList.save().then(()=>{arcori.showMessage(arcori.strings.AttachmentsSaveTitle,arcori.strings.AttachmentsSaveMsg),n()}).catch(n=>{arcori.displayError(n),t(n)}).finally(()=>this._busy(!1)))},_busy:function(t){kendo.ui.progress(n(this.sCONTAINER),t)}});t(!0,arcori,{ApplicationAttachments:u})}(window.kendo.jQuery),function(n){let r=n.extend,t=n.ajax,i={VIEW:arcori.makeUrl("Application/GetRenewalQuestionnaire"),SAVE:arcori.makeUrl("Application/SaveRenewalQuestionnaire")},u=kendo.Observable.extend({ID:null,sCONTAINER:null,sDETAILSDIV:"#renewalQuestionnaireDetailsDiv",sAPPLICATIONID:"#ApplicationID",sORIGINID:"#OriginID",sLIVINGSITUATIONSUMMARY:"#renewalQuestionnaireDetailsDiv #livingSituationSummary",sACCOMMODATIONSUMMARY:"#renewalQuestionnaireDetailsDiv #accomodationSummary",sPRIORITIESSUMMARY:"#renewalQuestionnaireDetailsDiv #prioritiesSummary",sHOUSEHOLDSUMMARY:"#renewalQuestionnaireDetailsDiv #householdSummary",sVIEWHOUSEHOLDDETAILSBTN:"#renewalQuestionnaireDetailsDiv #ViewHouseholdDetails",sVIEWLIVINGSITUATIONBTN:"#renewalQuestionnaireDetailsDiv #ViewLivingSituationDetails",sVIEWACCOMMODATIONDETAILSBTN:"#renewalQuestionnaireDetailsDiv #ViewAccommodationDetails",sVIEWPRIORITYDETAILSBTN:"#renewalQuestionnaireDetailsDiv #ViewPriorityDetails",sHOUSEHOLDSWITCH:"#renewalQuestionnaireDetailsDiv #UpdateHousehold",sLIVINGSITUATIONSWITCH:"#renewalQuestionnaireDetailsDiv #UpdateCurrentLivingSituation",sACCOMMODATIONSWITCH:"#renewalQuestionnaireDetailsDiv #UpdateAccommodations",sPRIORITYSWITCH:"#renewalQuestionnaireDetailsDiv #UpdatePriorityInfo",sFORM:null,kValidator:null,$form:null,model:null,callBack:null,init:function(n){kendo.Observable.fn.init.call(this);n&&(n.container&&(this.sCONTAINER=n.container),n.form&&(this.sFORM=n.form),n.callBack&&(this.callBack=n.callBack))},_initSummaries:function(){n(this.sVIEWHOUSEHOLDDETAILSBTN).getKendoButton().bind("click",()=>n(this.sHOUSEHOLDSUMMARY).toggle());n(this.sHOUSEHOLDSWITCH).getKendoSwitch().bind("change",()=>this.onQuestionnaireUpdate());n(this.sVIEWLIVINGSITUATIONBTN).getKendoButton().bind("click",()=>n(this.sLIVINGSITUATIONSUMMARY).toggle());n(this.sLIVINGSITUATIONSWITCH).getKendoSwitch().bind("change",()=>this.onQuestionnaireUpdate());let t=new arcori.Address({prefix:"CurrrentAddressRenewal",hideAddressee:!0,hideToolbar:!0});n(this.sVIEWACCOMMODATIONDETAILSBTN).getKendoButton().bind("click",()=>n(this.sACCOMMODATIONSUMMARY).toggle());n(this.sACCOMMODATIONSWITCH).getKendoSwitch().bind("change",()=>this.onQuestionnaireUpdate());n(this.sVIEWPRIORITYDETAILSBTN).getKendoButton().bind("click",()=>n(this.sPRIORITIESSUMMARY).toggle());n(this.sPRIORITYSWITCH).getKendoSwitch().bind("change",()=>this.onQuestionnaireUpdate())},onQuestionnaireUpdate:function(){if(this.callBack){let n=this._serializedData();this.callBack(n)}},show:function(){return this._getView()},_getView:function(){let r=this;r._busy(!0);return Promise.resolve(t({type:"POST",url:i.VIEW,data:{applicationId:n(r.sAPPLICATIONID).val()},cache:!1})).then(function(n){r._updateView(n)}).catch(function(n){if(n.responseText)arcori.displayError(n);else throw n;}).then(function(){r._busy(!1)})},_updateView:function(t){t&&(kendo.destroy(n(this.sCONTAINER)),n(this.sCONTAINER).html(t.view));this.$form=n(this.sFORM);arcori.formatServerSideErrors(this.$form);this.kValidator=this.$form.kendoValidator({errorTemplate:arcori.validatorErrorTemplate()}).getKendoValidator();t.model&&this._model(t.model);this._initSummaries()},_model:function(n){delete n.UpdateHouseholdQuestionText;delete n.UpdateCurrentLivingSituationQuestionText;delete n.UpdateAccommodationsQuestionText;delete n.UpdatePriorityInfoQuestionText;this.model=kendo.observable(n);kendo.bind(this.sDETAILSDIV,this.model)},save:function(){let n=this;n._busy(!0);return new Promise(function(r,u){Promise.resolve(t({type:"POST",url:i.SAVE,data:n._serializedData(),cache:!1})).then(function(n){arcori.showMessage(n.msgTitle,n.msg)}).catch(function(n){if(n.responseText)arcori.displayError(n),u(n);else throw n;}).then(function(t){n._busy(!1);r(t)})})},_serializedData:function(){let n;return n=this.model.toJSON(),delete n.RenewalInstructions,delete n.PrimaryApplicantPhoneNumbers,delete n.PrimaryApplicantEmailAddresses,delete n.AdditionalHouseholdMembersDisplay,delete n.AlternateContactDisplay,delete n.AlternateContactCards,delete n.HouseholdVM,delete n.CurrentResidenceAddress,n},_busy:function(t){kendo.ui.progress(n(this.sCONTAINER),t)}});r(!0,arcori,{RenewalQuestionnaire:u})}(window.kendo.jQuery),function(n){var ot=n.extend,st=n.ajax,nt="ID",et="StreetDirection",i="Type",e="Addressee",u="StreetType",b="Municipality",o="Province",f="UnitType",a="CivicNumber",v="CivicSuffix",y="StreetName",s="StreetDirection",h="UnitNumber",k="GeneralDeliveryInfo",p="POBox",w="RRNumber",c="StationInfo",l="PostalCode",d="#AddresseeDiv",g="#UnitDiv",tt="#PO_RRDiv",ut="#PODiv",ft="#RRDiv",it="#GeneralDeliveryDiv",rt="#StreetDiv",t={CIVIC:"Civic",POBOX:"PO",RR:"RR",GD:"GeneralDelivery"},r={EDIT:"EditAddress",COPY:"CopyAddress",EDITOR:{OK:"SaveAddress",CANCEL:"CancelAddress"}},ht={VALIDATE:arcori.makeUrl("Address/Validate")},ct=kendo.Class.extend({prefix:"",copyOptions:null,hideAddressee:!1,hideUnit:!1,hideEditorToolbar:!1,hideToolbar:!1,kTypeDropDown:null,kWindow:null,kToolBar:null,kEditorToolBar:null,result:null,title:null,kEdit:null,kCopy:null,init:function(t){var i=this;this.prefix=t.prefix;"copy"in t&&(this.copyOptions=t.copy);"hideAddressee"in t&&(this.hideAddressee=t.hideAddressee);"hideUnit"in t&&(this.hideUnit=t.hideUnit);"hideEditorToolbar"in t&&(this.hideEditorToolbar=t.hideEditorToolbar);"hideToolbar"in t&&(this.hideToolbar=t.hideToolbar);"enabled"in t&&(t.enabled||_setAddressState(!1));this.title="title"in t?t.title:arcori.strings.address;this._initAddress();this._updateDisplayValue();this.hideToolbar&&n("#"+this.prefix+"TB").hide();this.hideEditorToolbar||(this.kEdit=n("#"+this.prefix+"TB"+r.EDIT).getKendoButton(),this.kEdit.bind("click",this._onTBClick.bind(this,r.EDIT)),this.copyOptions&&(n("#"+this.prefix+"TB"+r.COPY).html(this.copyOptions.text),this.kCopy=n("#"+this.prefix+"TB"+r.COPY).kendoButton({spriteCssClass:"fa fa-copy"}).getKendoButton(),this.kCopy.bind("click",this._onTBClick.bind(this,r.COPY))),this.kEditorToolBar=n("#"+this.prefix+"EditorTB").getKendoToolBar(),this.kEditorToolBar.bind("click",function(n){var t=function(){i.result=n.id;i.kWindow.close()};switch(n.id){case r.EDITOR.OK:i._validate().then(function(){t()});break;case r.EDITOR.CANCEL:t()}}))},_onTBClick:function(n){var t=this;switch(n){case r.EDIT:t._edit();break;case r.COPY:t.copyOptions.address().then(function(n){t.value(n)})}},_initAddress:function(t){t&&(kendo.destroy("#"+this.prefix+"Form"),n("#"+this.prefix+"Form").html(t));arcori.formatServerSideErrors(n("#"+this.prefix+"Form"));this.kTypeDropDown=n(this._$getID(i)).getKendoDropDownList();this.kTypeDropDown.bind("change",this._onTypeChange.bind(this));this._onTypeChange();n(this._$getID(et)).getKendoComboBox().list.width(150);n(this._$getID(u)).getKendoComboBox().list.width(150);this.hideAddressee&&n(this._$getSelector(d)).hide();this.hideUnit&&n(this._$getSelector(g)).hide();n(this._$getID(u)).getKendoComboBox().bind("change",arcori.kendo.comboBoxSelectBestMatch);n(this._$getID(et)).getKendoComboBox().bind("change",arcori.kendo.comboBoxSelectBestMatch);n(this._$getID(o)).getKendoComboBox().bind("change",arcori.kendo.comboBoxSelectBestMatch);n(this._$getID(f)).getKendoComboBox().bind("change",arcori.kendo.comboBoxSelectBestMatch);n(this._$getID(l)).bind("blur",function(){this.value=this.value.toUpperCase()})},_edit:function(){var t=this,i=this.value();this.result=null;this.kWindow=n("
").kendoWindow({width:700,height:"auto",modal:!0,title:this.title,resizable:!1,deactivate:function(){this.destroy()},close:function(){t.result===r.EDITOR.OK?t._updateDisplayValue():t.value(i);n("#"+t.prefix+"Hidden").append(n("#"+t.prefix+"Window").contents())}}).getKendoWindow();n("#"+this.prefix+"Window").append(n("#"+this.prefix+"Hidden").contents());this.kWindow.center().open()},destroy:function(){},resize:function(){},_busy:function(t){kendo.ui.progress(n("#"+this.prefix),t)},_validate:function(){var n=this;return this._busy(!0),new Promise(function(t){Promise.resolve(st({type:"POST",url:ht.VALIDATE,data:{address:n.value(),prefix:n.prefix},cache:!1})).then(function(){t()}).catch(function(t){var i=arcori.displayError(t);n._initAddress(i.address)}).then(function(){n._busy(!1)})})},_updateDisplayValue:function(){n("#"+this.prefix+"_d").html(this._displayValue())},_displayValue:function(){var r=this.value(),n="";return r[i]!==t.GD&&(this.hideAddressee||(n+="
",n+=r[e],n+="<\/div>"),n+="
",n+=r[a],r[v]&&(n+=r[v]),n+=" "+r[y],n+=" "+r[u],r[s]&&(n+=" "+r[s]),n+="<\/div>",n+="
",r[f]&&(n+=r[f]),r[h]&&(n+=" "+r[h]),n+="<\/div>"),r[i]!==t.CIVIC&&(n+="
",r[i]===t.POBOX?n+=arcori.strings.poBox+" "+r[p]:r[i]===t.RR?n+=arcori.strings.rr+" "+r[w]:r[i]===t.GD&&(n+="
",n+=r[e],n+="<\/div>",n+=r[k]),r[c]&&(n+=" "+arcori.strings.station+" "+r[c]),n+="<\/div>"),n+="
",n+=r[b],n+=" "+r[o],n+=" "+r[l],n+"<\/div>"},_onTypeChange:function(){var i=this.kTypeDropDown.value();switch(i){case t.CIVIC:n(this._$getSelector(tt)).hide();n(this._$getSelector(rt)).show();n(this._$getSelector(it)).hide();n(this._$getSelector(g)).show();n(this._$getSelector(d)).hide();break;case t.POBOX:n(this._$getSelector(tt)).show();n(this._$getSelector(ut)).show();n(this._$getSelector(ft)).hide();n(this._$getSelector(rt)).show();n(this._$getSelector(it)).hide();n(this._$getSelector(g)).hide();n(this._$getSelector(d)).hide();break;case t.RR:n(this._$getSelector(tt)).show();n(this._$getSelector(ut)).hide();n(this._$getSelector(ft)).show();n(this._$getSelector(rt)).show();n(this._$getSelector(it)).hide();n(this._$getSelector(g)).show();n(this._$getSelector(d)).hide();break;case t.GD:n(this._$getSelector(d)).show();n(this._$getSelector(it)).show();n(this._$getSelector(tt)).hide();n(this._$getSelector(ut)).hide();n(this._$getSelector(ft)).hide();n(this._$getSelector(rt)).hide();n(this._$getSelector(g)).hide()}},_$getID:function(n){return"#"+this.prefix+"_"+n},_getLabelFor:function(n){return this.prefix+"_"+n},_$getSelector:function(n){return"#"+this.prefix+" "+n},enable:function(t){var r=this._$getID(e)+", "+this._$getID(a)+", "+this._$getID(v)+", "+this._$getID(y)+", "+this._$getID(p)+", "+this._$getID(w)+", "+this._$getID(c)+", "+this._$getID(l)+", "+this._$getID(h),k="label[for="+this._getLabelFor(i)+"], label[for="+this._getLabelFor(e)+"], label[for="+this._getLabelFor(a)+"], label[for="+this._getLabelFor(y)+"], label[for="+this._getLabelFor(u)+"], label[for="+this._getLabelFor(s)+"], label[for="+this._getLabelFor(p)+"], label[for="+this._getLabelFor(w)+"], label[for="+this._getLabelFor(c)+"], label[for="+this._getLabelFor(b)+"], label[for="+this._getLabelFor(o)+"], label[for="+this._getLabelFor(l)+"], label[for="+this._getLabelFor(f)+"], label[for="+this._getLabelFor(h)+"]";t?(n(r+", "+k).removeAttr("disabled"),n(r+", "+k).removeClass("k-state-disabled")):(n(r+", "+k).attr("disabled","disabled"),n(r+", "+k).addClass("k-state-disabled"),n(r).val(null),n("#"+this.prefix).kendoValidator().getKendoValidator().hideMessages());arcori.kendo.enableWidget(this._$getID(i),t);arcori.kendo.enableWidget(this._$getID(u),t);arcori.kendo.enableWidget(this._$getID(s),t);arcori.kendo.enableWidget(this._$getID(o),t);arcori.kendo.enableWidget(this._$getID(f),t);this.kEdit.enable(t);this.copyOptions&&this.kCopy.enable(t)},value:function(r){if(arguments.length)r?(n(this._$getID(i)).getKendoDropDownList().value(r.Type===1||r.Type===t.CIVIC?t.CIVIC:r.Type===2||r.Type===t.POBOX?t.POBOX:r.Type===3||r.Type===t.RR?t.RR:t.GD),this._onTypeChange(),n(this._$getID(nt)).val(r.ID),n(this._$getID(e)).val(r.Addressee),n(this._$getID(a)).val(r.CivicNumber),n(this._$getID(v)).val(r.CivicSuffix),n(this._$getID(y)).val(r.StreetName),n(this._$getID(u)).getKendoComboBox().value(r.StreetType),n(this._$getID(s)).getKendoComboBox().value(r.StreetDirection),n(this._$getID(f)).getKendoComboBox().value(r.UnitType),n(this._$getID(h)).val(r.UnitNumber),n(this._$getID(p)).val(r.POBox),n(this._$getID(w)).val(r.RRNumber),n(this._$getID(c)).val(r.StationInfo),n(this._$getID(b)).val(r.Municipality),n(this._$getID(o)).getKendoComboBox().value(r.Province),n(this._$getID(l)).val(r.PostalCode),n(this._$getID(k)).val(r.GeneralDeliveryInfo)):(n(this._$getID(i)).getKendoDropDownList().value(t.CIVIC),this._onTypeChange(),n(this._$getID(nt)).val(r===null?0:r.ID),n(this._$getID(e)).val(""),n(this._$getID(a)).val(""),n(this._$getID(v)).val(""),n(this._$getID(y)).val(""),n(this._$getID(u)).getKendoComboBox().value(""),n(this._$getID(s)).getKendoComboBox().value(""),n(this._$getID(f)).getKendoComboBox().value(""),n(this._$getID(h)).val(""),n(this._$getID(p)).val(""),n(this._$getID(w)).val(""),n(this._$getID(c)).val(""),n(this._$getID(b)).val(""),n(this._$getID(o)).getKendoComboBox().value(""),n(this._$getID(l)).val(""),n(this._$getID(k)).val("")),n("#"+this.prefix).kendoValidator().getKendoValidator().hideMessages(),this._updateDisplayValue();else{var d={};return d[nt]=n(this._$getID(nt)).val(),d[i]=n(this._$getID(i)).getKendoDropDownList().value(),d[e]=n(this._$getID(e)).val(),d[a]=n(this._$getID(a)).val(),d[v]=n(this._$getID(v)).val(),d[y]=n(this._$getID(y)).val(),d[u]=n(this._$getID(u)).getKendoComboBox().value(),d[s]=n(this._$getID(s)).getKendoComboBox().value(),d[f]=n(this._$getID(f)).getKendoComboBox().value(),d[h]=n(this._$getID(h)).val(),d[p]=n(this._$getID(p)).val(),d[w]=n(this._$getID(w)).val(),d[c]=n(this._$getID(c)).val(),d[b]=n(this._$getID(b)).val(),d[o]=n(this._$getID(o)).getKendoComboBox().value(),d[l]=n(this._$getID(l)).val(),d[k]=n(this._$getID(k)).val(),d}}});ot(!0,arcori,{Address:ct})}(window.kendo.jQuery),function(n){let t=n.extend,i=n.ajax,r={VIEW:arcori.makeUrl("Application/GetApplicationProperty")},u=kendo.Class.extend({ID:null,sCONTAINER:null,sAPPLICATIONID:"#ApplicationID",sORIGINID:"#OriginID",sVERSION:"#Version",sPROPERTYSELECTORGRID:"#propertySelectorGrid",kPropertyGrid:null,kValidator:null,init:function(n){let t=this;if(n&&(t.options=n,n.container&&(t.sCONTAINER=n.container),n.form&&(t.sFORM=n.form),n.standalone===!0)){let n=function(n){switch(n.id){case"Save":t.save().catch(function(n){if(n.responseText)arcori.displayError(n);else throw n;})}}}},show:function(){let n=this;return n._getView()},_getView:function(){let t=this;t._busy(!0);return Promise.resolve(i({type:"POST",url:r.VIEW,data:{applicationId:n(t.sORIGINID).val(),version:n(t.sVERSION).val()},cache:!1})).then(function(n){t._updateView(n)}).catch(function(n){if(n.responseText)arcori.displayError(n);else throw n;}).then(function(){t._busy(!1)})},_updateView:function(t){let i=this;t&&(kendo.destroy(n(i.sCONTAINER)),n(i.sCONTAINER).html(t.view),t.view&&n("#buildingSelectionContainerDiv").html(t.view),i.kPropertyGrid=null,i._initPropertyGrid());i.$form=n(i.sFORM);arcori.formatServerSideErrors(i.$form);this.kValidator=i.$form.kendoValidator({errorTemplate:arcori.validatorErrorTemplate()}).getKendoValidator()},updateView:function(t){let i=this;t&&(kendo.destroy(n(i.sCONTAINER)),t.view&&n("#buildingSelectionContainerDiv").html(t.view),i.kPropertyGrid=null,i._initPropertyGrid())},_initPropertyGrid:function(){function t(){this.save().then(function(){let t=n(this.sPROPERTYSELECTORGRID).getKendoGrid();t&&t.dataSource.read()}.bind(this))}this.kPropertyGrid===null&&(this.kPropertyGrid=new arcori.ApplicationPropertyGrid(this.options),this.options.saveOnSelect&&this.kPropertyGrid.bind("PropertiesSelected",t.bind(this)),this.options.saveOnRemove&&this.kPropertyGrid.bind("PropertyRemoved",t.bind(this)))},save:function(){let n=this;return n._busy(!0),n.kPropertyGrid.save().then(function(t){return n._busy(!1),arcori.showMessage(t.msgTitle,t.msg),t})},_validate:function(){let n=this.kValidator.validate();return{valid:n,error:{msg:arcori.strings.validationErrorPreamble,msgTitle:arcori.strings.error,errors:this.kValidator.errors()}}},_busy:function(t){kendo.ui.progress(n(this.sCONTAINER),t)}});t(!0,arcori,{ApplicationProperty:u})}(window.kendo.jQuery),function(n,t){let l=n.extend,a=n.ajax,i="#propertyGridDiv #propertyGrid",v="#applicationEligibleProgramGrid",y=i+" #propertyGridTB",u="#EligibleUnitSizes",f="#HouseholdTypeID",e="#HouseholdTypes",p="#RequireAccessibleUnit",o="#ApplicantProgram",s="#ApplicantHouseholdTypeID",h="#ApplicantEligibleUnitSize",w="#myPropertiesTabStrip",b="#MortgagePreapprovalPurchasePrice",r={ADD:"SelectProperty",REMOVE:"RemoveProperty",EXPORT:"ExportPropertySelection"},c={SAVE:arcori.makeUrl("Application/SaveApplicationProperties"),GETMATCHEDPROPERTYROWDATA:arcori.makeUrl("Application/GetNewSelectedProperties")},k=kendo.Observable.extend({ID:null,kGrid:null,kToolBar:null,options:{showUnits:!0},showUnitSelector:"false",TABS:{SELECTEDPROPERTIESTAB:{name:"selectedPropertiesTab",index:0},PROPERTYSELECTORTAB:{name:"propertySelectorTab",index:1}},TBBUTTONS:r,EVENTS:{PROPERTIESSELECTED:"PropertiesSelected",PROPERTYREMOVED:"PropertyRemoved"},init:function(t){kendo.Observable.fn.init.call(this);let r=!0;t&&(r=t.fillGrid,this.options=t);this.kGrid=n(i).getKendoGrid();this.kGrid.bind("dataBound",this._onDataBound.bind(this));this.kGrid.bind("change",this._onRowSelect.bind(this));this.kGrid.reInitDataSource({transport:{read:{data:this._gridData.bind(this)},update:{data:this._gridData.bind(this)},destroy:{data:this._gridData.bind(this)}}},r);this.kToolBar=n(y).getKendoToolBar();this.kToolBar.bind("click",this._onTBClick.bind(this));this.kTabStrip=n(w).getKendoTabStrip();this.kTabStrip&&this.kTabStrip.bind("activate",function(n){switch(n.item.id){case this.TABS.PROPERTYSELECTORTAB.name:this._addProperties()}}.bind(this));let u=function(t,r,u){let e=n(u).closest("tr"),o=n(i).data("kendoGrid"),f=o.dataItem(e);f.IsDependent=r?!0:!1;f.dirty=!0};n(i).on("click",".gridcheckbox",function(){let t=n(this),i=t.is(":checked");u(t.val(),i,this)})},destroy:function(){this.kGrid.destroy()},resize:function(){},_gridData:function(){return{originID:n("#OriginID").val(),version:n("#Version").val()}},_onDataBound:function(){this._updateToolBarState()},_onRowSelect:function(){this._updateToolBarState()},_busy:function(t){kendo.ui.progress(n(this.options.container),t)},_onTBClick:function(t){let i=this;switch(t.id){case r.ADD:i._addProperties();break;case r.REMOVE:i.kGrid.select().each(function(){i.kGrid.removeRow(n(this));i.trigger(i.EVENTS.PROPERTYREMOVED)});break;case r.EXPORT:i.kGrid.saveAsExcel()}},_addProperties:function(){function l(t){if(t[0]){r._busy(!0);let u=[];u=r.showUnitSelector==="false"?y(t):w(t);u.length>0?Promise.resolve(a({type:"POST",url:c.GETMATCHEDPROPERTYROWDATA,data:{IDs:u},cache:!1})).then(function(t){let f=r.kGrid.dataSource.data().toJSON(),u=[],e=[],o=[];for(let i=0;in.ID===r.ID);if(o){o.Units!==r.Units&&(o.SelectedDate=kendo.parseDate(r.SelectedDate));let t=r.Units.split(","),i=o.Units.split(",");n.each(t,function(n,t){i.includes(t)||(o.Units=`${o.Units},${t}`)});for(let n=0;nn.dirty);r.kGrid.dataSource.data([...f,...u]);let s=[...r.kGrid.dataSource.data().filter(n=>o.find(({ID:t})=>n.ID===t)),...r.kGrid.dataSource.data().filter(n=>u.find(({ID:t})=>n.ID===t)),...r.kGrid.dataSource.data().filter(n=>e.find(({ID:t})=>n.ID===t))];s.forEach(n=>{n.dirty=!0});r.kGrid.dataSource._destroyed=r.kGrid.dataSource._destroyed.filter(n=>!u.filter(t=>t.ID===n.ID).length);arcori.kendo.pokeGrid(i);r.trigger(r.EVENTS.PROPERTIESSELECTED)}).catch(function(n){arcori.displayError(n)}).then(function(){r._busy(!1)}):r._busy(!1)}r.kTabStrip&&r.kTabStrip.select(r.TABS.SELECTEDPROPERTIESTAB.index)}function y(n){let i=[],t=0;for(let r=0;r0;this.kToolBar.enable("#"+r.REMOVE,n)},refresh:function(){this.kGrid.dataSource.read()}});l(!0,arcori,{ApplicationPropertyGrid:k})}(window.kendo.jQuery),function(){let n=$.extend,t=$.ajax;(function(i){let h="selectorWindow",u="#"+h,a="
",o="#selectAll",s="#unSelectAll",r=u+" #selectorFilterArea",e="filterButtonDIV",c=`${r} #${e}`,l=u+" #selectorGridDiv",f={SELECT:"Select",CLOSE:"Close",VIEW:"View"},v=kendo.Observable.extend({options:{multiSelect:!1,autoSelect:!1,url:null,data:null,title:null,filter:null,width:"90%",height:"90%",resizable:!0,container:null},selected:!1,kWindow:null,kToolBar:null,kGrid:null,Members:null,filter:null,init:function(t){kendo.Observable.fn.init.call(this);this.options=n(!0,{},this.options,t);this.filter=kendo.observable({useFilter:t.useFilter});t.container?(r=`${t.container} #selectorFilterArea`,c=`${r} #${e}`,l=`${t.container} #selectorGridDiv`,o=`${t.container} #selectAll`,s=`${t.container} #unSelectAll`):(o=`${u} #selectAll`,s=`${u} #unSelectAll`)},destroy:function(){},resize:function(){if(this.kGrid){let n=this.filter.useFilter?i(r).outerHeight(!0):0;this.kWindow&&i(l).height(i(u).height()-n);this.kGrid.resize()}},show:function(){let n=this;return new Promise(function(r){n.options.container||(n.kWindow=i(a).kendoWindow({width:n.options.width,height:n.options.height,modal:!0,activate:n.resize.bind(n),close:function(){let t={};n.selected&&(t=n._getSelected.call(n));r(t)},deactivate:function(){this.destroy()},resize:n.resize.bind(n),title:n.options.title,resizable:n.options.resizable}).getKendoWindow().center().open());n._busy(!0);Promise.resolve(t({type:"POST",url:n.options.url,data:n.options.data,cache:!1})).then(function(t){n.kWindow?(n.options.title||n.kWindow.title(t.title),n.kWindow.content(t.view)):i(n.options.container).html(t.view);n._toolbar();n._initFilterButtonDiv();n._filter();n._grid();n.Members=i("#Members").getKendoComboBox();n.Members&&n.Members.bind("change",function(n){let t=n.sender.selectedIndex;i("#FirstName_f").val(n.sender.dataSource.data()[t].FirstName);i("#MiddleName_f").val(n.sender.dataSource.data()[t].MiddleName);i("#LastName_f").val(n.sender.dataSource.data()[t].LastName);i("#SIN_f").val(n.sender.dataSource.data()[t].SIN);i("#DateOfBirthAfter_f").getKendoDatePicker().value(n.sender.dataSource.data()[t].DateOfBirth)});n.kWindow&&n.kWindow.center().open()}).catch(function(t){n.kWindow&&n.kWindow.close();arcori.displayError(t)}).then(function(){n.resize();n._busy(!1)})})},_select:function(n){let t=this,r=n.target.checked,u=t.kGrid.dataItem(i(n.target).closest("tr"));u.set("Selected",r);t._updateToolBarState()},_selectAll:function(){let n=this,t=n.kGrid.dataSource.filteredDataItems();i.each(t,function(){this.Selected=!0});n.kGrid.refresh();n._updateToolBarState()},_unSelectAll:function(){let n=this,t=n.kGrid.dataSource.filteredDataItems();i.each(t,function(){this.Selected=!1});n.kGrid.refresh();n._updateToolBarState()},_onRowSelected:function(){let n=this;n._updateToolBarState.call(n)},_updateToolBarState:function(){let n=this,i=n.kGrid.dataSource.data(),t=!1,r=n.kGrid.select().length>0;if(n.options.multiSelect){for(let n=0,r=i.length;n0&&n.kToolBar.enable("#"+f.VIEW,r)},_onTBClick:function(n){let t=this;switch(n.id){case f.SELECT:if(t.selected=!0,t.kWindow)t.kWindow.close();else{let n={};t.selected&&(n=t._getSelected.call(t));t.trigger("select",n)}break;case f.CLOSE:t.kWindow.close();break;case f.VIEW:t._viewItem()}},_busy:function(n){kendo.ui.progress(i(u),n)},_getSelected:function(){let n=this;return n.options.multiSelect?n.kGrid.dataSource.data().filter(function(n){return n.Selected}):[n.kGrid.dataItem(n.kGrid.select())]},_toolbar:function(){this.kWindow?this.kToolBar=i("#"+this.kWindow.element.attr("id")+" .k-widget.k-grid .k-header.k-grid-toolbar .k-toolbar.k-widget").getKendoToolBar():(this.kToolBar=i(this.options.container+" .k-widget.k-grid .k-header.k-grid-toolbar .k-toolbar.k-widget").getKendoToolBar(),i(this.options.container+" .k-widget.k-grid .k-header.k-grid-toolbar .k-toolbar.k-widget #Close").hide());this.kToolBar.bind("click",this._onTBClick.bind(this))},_initFilterButtonDiv:function(){let n=i(r);n.length&&(this.options.showFindButtonIcon?n.append(`
`):n.append(`
`))},_filter:function(){let n=this,t=i(r);if(t.length){t.attr("data-bind","visible: useFilter");let u=i(r+" :input");for(let n=0;n0&&(i(t).attr("data-bind","value: "+t.name),this.filter[t.name]=i(t).val())}let f=i(c);this.options.showFindButtonIcon?f.append("
<\/span>
"+arcori.strings.selectorFilterButtonText+"<\/div><\/div>"):f.append("
"+arcori.strings.selectorFilterButtonText+"<\/div>");i(this._selector("#searchButton")).kendoButton({click:function(){n.kGrid.dataSource.read()}});this.filter=kendo.observable(this.filter);i.each(n.options.filter,function(t,i){n.filter[t+"_f"]===""&&n.filter.set(t+"_f",i)});kendo.bind(r,this.filter)}},_setupSelection:function(){let n=this;this.kGrid=this.options.container?i(this.options.container+" .k-widget.k-grid").getKendoGrid():i("#"+this.kWindow.element.attr("id")+" .k-widget.k-grid").getKendoGrid();i(o).on("click",function(t){n._selectAll();t.stopPropagation()});i(s).on("click",function(t){n._unSelectAll();t.stopPropagation()});this.kGrid.bind("dataBound",function(){n._updateToolBarState()});this.kGrid.one("dataBound",function(){this.options.autoSelect&&n._selectAll()});if(this.options.multiSelect)i(this.kGrid.element).on("click",".gridcheckbox",this._select.bind(this));else{this.kGrid.hideColumn(this.kGrid.wrapper.find(".k-grid-header [data-field=Selected]").index());i(this.kGrid.element).on("dblclick","tbody tr",function(t){t.preventDefault();n.selected=!0;n.kWindow.close()})}n.kGrid.bind("change",n._onRowSelected.bind(this))},_grid:function(){this._setupSelection();this.kGrid.reInitDataSource({transport:{read:{data:this._gridData.bind(this)}},error:arcori.displayError})},_gridData:function(){let t=jQuery.extend(!0,{},this.options.data)||{};return this.filter.useFilter&&n(!0,t,this.filter.toJSON()),t},_getTextValuesFromMultiSelect:function(n){let r=n.dataSource,t="";return i.each(n.value(),function(){let n=this.toString(),u=i.grep(r.data(),function(t){return t.Value===n});t!==""&&(t+=",");t+=u[0].Text}),t===""?arcori.strings.none:t},_selector:function(n){return this.kWindow?`${u} ${n}`:`${this.options.container} ${n}`}});n(!0,arcori,{Selector:v})})(window.kendo.jQuery),function(){let t=arcori.makeUrl("Permission/PermissionSelector"),i=arcori.Selector.extend({init:function(i){let r=this;i=n(!0,{},i,{url:t});arcori.Selector.fn.init.call(r,i)}});n(!0,arcori,{PermissionSelector:i})}(window.kendo.jQuery),function(){let t=arcori.makeUrl("Role/RoleSelector"),i=arcori.Selector.extend({init:function(i){let r=this;i=n(!0,{},i,{url:t});arcori.Selector.fn.init.call(r,i)}});n(!0,arcori,{RoleSelector:i})}(window.kendo.jQuery),function(){let t=arcori.makeUrl("Application/RegionAreaSelector"),i=arcori.Selector.extend({regionId:null,selectedAreaIDs:null,init:function(i){let r=this;i&&(regionId=i.regionId,selectedAreaIDs=i.selectedAreaIDs);i=n(!0,{},i,{url:t,data:{regionId:regionId,selectedAreaIDs:selectedAreaIDs}});arcori.Selector.fn.init.call(r,i)}});n(!0,arcori,{AreaSelector:i})}(window.kendo.jQuery),function(){let t={VIEW:arcori.makeUrl("Selector/HouseholdSelector"),ITEM:arcori.makeUrl("Application/Edit")},i=arcori.Selector.extend({init:function(i){let r=this;i=n(!0,{},i,{url:t.VIEW});arcori.Selector.fn.init.call(r,i)},_filter:function(){this.filter.OfferID_f=this.options.filter.offerID;arcori.Selector.fn._filter.call(this)},_viewItem:function(){let n=this.kGrid.dataItem(this.kGrid.select());n&&window.open(t.ITEM+"/"+n.ApplicationID,"_blank")}});n(!0,arcori,{HouseholdSelector:i})}(window.kendo.jQuery),function(){let t={VIEW:arcori.makeUrl("Selector/BadDebtSelector"),ITEM:arcori.makeUrl("BadDebt/Edit")},i=arcori.Selector.extend({init:function(i){let r=this;i=n(!0,{},i,{url:t.VIEW});arcori.Selector.fn.init.call(r,i)},_viewItem:function(){let n=this.kGrid.dataItem(this.kGrid.select());n&&window.open(t.ITEM+"/"+n.ID,"_blank")}});n(!0,arcori,{BadDebtSelector:i})}(window.kendo.jQuery),function(t){let u=`#${"selectorWindow"}`,e="selectorFilterArea",f=`${u} #${e}`,l=`${f} #filterButtonDIV`,o="RegionID",s=`${u} #${o}`,h="AreaList",i=`${u} #${h}`,r={PROPERTY:"PropertySelector",PROPERTYUNIT:"PropertyUnitSelector"},c={VIEW:arcori.makeUrl("Selector/"+r.PROPERTY),VIEWWITHUNIT:arcori.makeUrl("Selector/"+r.PROPERTYUNIT)},a=arcori.Selector.extend({init:function(t){let u=this;t=t.controller?n(!0,{},t,{url:t.showUnits?arcori.makeUrl(t.controller+"/"+r.PROPERTYUNIT):arcori.makeUrl(t.controller+"/"+r.PROPERTY)}):n(!0,{},t,{url:t.showUnits?c.VIEWWITHUNIT:c.VIEW});t.container&&(f=`${t.container} #${e}`,s=`${t.container} #${o}`,i=`${t.container} #${h}`);arcori.Selector.fn.init.call(u,t);u.resize()},_grid:function(){t("#HouseholdType").getKendoDropDownList()&&t("#HouseholdType").getKendoDropDownList().value(this.options.data.Mandate);t("#UnitSizeList").getKendoMultiSelect()&&t("#UnitSizeList").getKendoMultiSelect().value(this.options.data.UnitSizeList);t("#ProgramList").getKendoMultiSelect()&&t("#ProgramList").getKendoMultiSelect().value(this.options.data.ProgramList);arcori.Selector.fn._grid.call(this)},_filter:function(){let n=this,r=t(f),u=t(l);this.options.override===arcori.PropertySelectorParamOverrideOptions.ShowAll&&t("#overridableFilters").show();this.options.override===arcori.PropertySelectorParamOverrideOptions.Overridable&&r.length&&(u.append("
"+arcori.strings.selectorOverrideButtonText+"<\/div> "),t(this._selector("#overrideButton")).kendoButton({click:function(){arcori.displayError({responseText:arcori.strings.overridePropertyFilterWarningMsg});t("#overridableFilters").show();t("#overrideButton").hide();n.resize()}}));t(s).getKendoComboBox().bind("change",function(n){t(i).getKendoMultiSelect().enable(n.sender.value()!=="");t(i).getKendoMultiSelect().dataSource.read();t(i).getKendoMultiSelect().value([])});arcori.Selector.fn._filter.call(this)},_gridData:function(){let n=jQuery.extend(!0,{},arcori.Selector.fn._gridData.call(this));return n.RegionList=this.options.data.RegionList,n.AreaList=t(i).getKendoMultiSelect().value(),n.HouseholdType=t("#HouseholdType").getKendoDropDownList().value(),n.UnitSizeList=t("#UnitSizeList").getKendoMultiSelect().value(),t("#ProgramList").getKendoMultiSelect().value().length&&(n.ProgramList=t("#ProgramList").getKendoMultiSelect().value()),n.ProgramList||delete n.ProgramList,n.ApplyProgramFilter=t("#ApplyProgramFilter").val(),n.ProviderList=t("#ProviderList").getKendoMultiSelect().value(),t("#unitSizeFilterValues").html(this._getTextValuesFromMultiSelect(t("#UnitSizeList").getKendoMultiSelect())),t("#programsFilterValues").html(this._getTextValuesFromMultiSelect(t("#ProgramList").getKendoMultiSelect())),t("#providerFilterValues").html(this._getTextValuesFromMultiSelect(t("#ProviderList").getKendoMultiSelect())),t("#HouseholdType").getKendoDropDownList().value()===""?t("#householdTypeFilterValues").html(arcori.strings.none):t("#householdTypeFilterValues").html(t("#HouseholdType").getKendoDropDownList().text()),n}});n(!0,arcori,{PropertySelector:a})}(window.kendo.jQuery),function(t){let r=`#${"selectorWindow"}`,f="selectorFilterArea",u=`${r} #${f}`,h=`${u} #filterButtonDIV`,e="RegionID",o=`${r} #${e}`,s="AreaList",i=`${r} #${s}`,c={VIEW:arcori.makeUrl("Selector/UnitSelector")},l=arcori.Selector.extend({init:function(t){t=t.controller?n(!0,{},t,{url:arcori.makeUrl(t.controller+"/UnitSelector")}):n(!0,{},t,{url:c.VIEW});t.container&&(u=`${t.container} #${f}`,o=`${t.container} #${e}`,i=`${t.container} #${s}`);arcori.Selector.fn.init.call(this,t)},_grid:function(){t("#HouseholdType").getKendoDropDownList()&&t("#HouseholdType").getKendoDropDownList().value(this.options.data.Mandate);t("#UnitSizeList").getKendoMultiSelect()&&t("#UnitSizeList").getKendoMultiSelect().value(this.options.data.UnitSizeList);t("#ProgramList").getKendoMultiSelect()&&t("#ProgramList").getKendoMultiSelect().value(this.options.data.ProgramList);arcori.Selector.fn._grid.call(this)},_filter:function(){let n=t(u),r=t(h);this.options.override===arcori.PropertySelectorParamOverrideOptions.ShowAll&&t("#overridableFilters").show();this.options.override===arcori.PropertySelectorParamOverrideOptions.Overridable&&n.length&&(r.append("
"+arcori.strings.selectorOverrideButtonText+"<\/div> "),t(this._selector("#overrideButton")).kendoButton({click:function(){arcori.displayError({responseText:arcori.strings.overridePropertyFilterWarningMsg});t("#overridableFilters").show();t("#overrideButton").hide()}}));t(o).getKendoComboBox().bind("change",function(n){t(i).getKendoMultiSelect().enable(n.sender.value()!=="");t(i).getKendoMultiSelect().dataSource.read();t(i).getKendoMultiSelect().value([])});arcori.Selector.fn._filter.call(this)},_gridData:function(){let n=jQuery.extend(!0,{},arcori.Selector.fn._gridData.call(this));n.RegionList=this.options.data.RegionList;n.AreaList=t(i).getKendoMultiSelect().value();n.HouseholdType=t("#HouseholdType").getKendoDropDownList().value();n.UnitSizeList=t("#UnitSizeList").getKendoMultiSelect().value();let r=t("#ProgramList").getKendoMultiSelect();return r.value().length&&(n.ProgramList=r.value()),n.ProgramList||delete n.ProgramList,n.ProviderList=t("#ProviderList").getKendoMultiSelect().value(),t("#unitSizeFilterValues").html(this._getTextValuesFromMultiSelect(t("#UnitSizeList").getKendoMultiSelect())),t("#programsFilterValues").html(this._getTextValuesFromMultiSelect(t("#ProgramList").getKendoMultiSelect())),t("#providerFilterValues").html(this._getTextValuesFromMultiSelect(t("#ProviderList").getKendoMultiSelect())),t("#HouseholdType").getKendoDropDownList().value()===""?t("#householdTypeFilterValues").html(arcori.strings.none):t("#householdTypeFilterValues").html(t("#HouseholdType").getKendoDropDownList().text()),n}});n(!0,arcori,{PropertyUnitSelector:l})}(window.kendo.jQuery),function(){let t={VIEW:arcori.makeUrl("Selector/ProgramSelector")},i=arcori.Selector.extend({init:function(i){let r=this;i=n(!0,{},i,{url:t.VIEW});arcori.Selector.fn.init.call(r,i)},_gridData:function(){return arcori.Selector.fn._gridData.call(this)}});n(!0,arcori,{ProgramSelector:i})}(window.kendo.jQuery),function(n){let t=n.extend,i=arcori.makeUrl("Dashboard/DashboardItemSelector"),r=arcori.Selector.extend({init:function(n){let r=this;n=t(!0,{},n,{url:i});arcori.Selector.fn.init.call(r,n)}});t(!0,arcori,{DashboardItemSelector:r})}(window.kendo.jQuery),function(){let t={VIEW:arcori.makeUrl("Selector/LetterTemplateSelector")},i=arcori.Selector.extend({init:function(i){let r=this;i=n(!0,{},i,{url:t.VIEW});arcori.Selector.fn.init.call(r,i)}});n(!0,arcori,{LetterTemplateSelector:i})}(window.kendo.jQuery)}(),function(n){let t=n.extend,i=kendo.Observable.extend({entityID:null,entityType:null,kGrid:null,ELEMENT:{sGRID:"#sentItemGrid",sGRIDTOOLBAR:"#sentItemGridTB"},TB:{SENDCORRESPONDENCE:"SendCorrespondence",DELETE:"DeleteCorrespondence",OPEN:"OpenCorrespondence",VIEW:"ViewCorrespondence"},URL:{OPENBATCH:arcori.makeUrl("Correspondence/Batch/"),DELETE:arcori.makeUrl("Correspondence/DeleteBatch")},init:function(t){kendo.Observable.fn.init.call(this);let i=this;if(this.entityID=t.entityID,this.type=t.type,this.entityType=t.entityType,this.kGrid=n(this.ELEMENT.sGRID).getKendoGrid(),this.kGrid){this.kGrid.reInitDataSource({transport:{read:{data:{entityID:this.entityID}}}});this.kGrid.bind("dataBound",function(){i._updateToolBarState()});this.kGrid.bind("change",function(){i._updateToolBarState()});this.kToolBar=n(this.ELEMENT.sGRIDTOOLBAR).getKendoToolBar();this.kToolBar.bind("click",this._onTBClick.bind(this));n(this.ELEMENT.sGRID).on("dblclick","tbody tr",function(n){n.preventDefault();this._viewAttachment()}.bind(this))}},_onTBClick:function(n){switch(n.id){case this.TB.SENDCORRESPONDENCE:let n=new arcori.Correspondence({recipients:[{OriginID:this.entityID}],type:this.type,entity:this.entityType});n.sendCorrespondence();break;case this.TB.DELETE:this._deleteSentItem(this.kGrid.dataItem(this.kGrid.select()).BatchID);break;case this.TB.OPEN:let t=this.kGrid.dataItem(this.kGrid.select());window.open(this.URL.OPENBATCH+t.BatchID,"_blank");break;case this.TB.VIEW:this._viewAttachment()}},_viewAttachment:function(){let n=new arcori.DocumentViewer({id:this.kGrid.dataItem(this.kGrid.select()).DocumentID,fileExt:".pdf"});n.showDialog()},_updateToolBarState:function(){let n=this.kGrid.select().length>0;this.kToolBar.enable("#"+this.TB.DELETE,n);this.kToolBar.enable("#"+this.TB.OPEN,n);this.kToolBar.enable("#"+this.TB.VIEW,n)},_deleteSentItem:function(t){let i=this;return new Promise(function(r){n.when(kendo.ui.ExtYesNoDialog.show({title:arcori.strings.deleteSentItemTitle,message:arcori.strings.deleteSentItemMsg,icon:"k-ext-question",modal:!0})).done(function(u){u.button===arcori.strings.yes?(i._busy(!0),Promise.resolve(n.ajax({type:"POST",url:i.URL.DELETE,data:{batchID:t}})).then(function(n){return arcori.showMessage(n.msgTitle,n.msg),i.trigger("deleted"),i.kGrid.dataSource.read(),n}).catch(function(n){arcori.displayError(n)}).then(function(n){i._busy(!1);r(n)})):r()})})},_busy:function(t){kendo.ui.aProgress(n(this.ELEMENT.sSPLITTER),t)}});t(!0,arcori,{SentItemIndex:i})}(window.kendo.jQuery),function(n){var i=n.extend,r=n.ajax,u=kendo.isFunction,f=n.isArray,e="View Document",o="90%",s="90%",t={CONTENT:"Document/DocumentViewer",DOWNLOAD:"Document/Download"},h={CONTENT:arcori.makeUrl(t.CONTENT),DOWNLOAD:arcori.makeUrl(t.DOWNLOAD)},c=kendo.Class.extend({ELEMENT:{sWINDOWID:"#documentViewerWindow",WINDOWELEMENT:"
",sTOOLBAR:"#documentViewerTB",sDOCAREA:"#documentViewerDoc"},ACTION:{CLOSE:"documentClose",PRINT:"documentPrint",DOWNLOAD:"documentDownload"},options:{url:h,otherTBClickHandler:null,otherToolButtons:[]},kWindow:null,kToolBar:null,init:function(n){function u(){r.options=i(!0,{},r.options,n);r.options.container=arcori.makeID(r.options.container);n.module||(r.options.module=arcori.Module);let t=r.options.id.lastIndexOf(".");t!==-1&&(r.options.id=r.options.id.substring(0,t))}function f(){arcori.Module.key!==r.options.module.key&&(r.options.url={CONTENT:arcori.makeUrl(t.CONTENT,r.options.module),DOWNLOAD:arcori.makeUrl(t.DOWNLOAD,r.options.module)})}let r=this;u();f()},resize:function(){let t=n(this._selector(this.ELEMENT.sDOCAREA));t.outerHeight(t.parent().height()-3)},destroy:function(){this.options.showDialog?this.kWindow.destroy():(kendo.destroy(this.options.container),n(this.options.container).html(""))},showDialog:function(){let t=this;this.options.showDialog=!0;this.options.container=this.ELEMENT.sWINDOWID;this.kWindow=n(this.ELEMENT.WINDOWELEMENT).kendoWindow({title:e,height:o,width:s,modal:!0,activate:this.resize.bind(t),deactivate:function(){t.destroy()},resize:this.resize.bind(this)}).getKendoWindow().center().open();this._busy(!0);this._getDocument().then(function(n){t._showContainer(n.view);t.kWindow.center().open()}).catch(function(n){t.destroy();arcori.displayError(n)}).then(function(){t._busy(!1)})},showContainer:function(){let n=this;this.options.showDialog=!1;this._busy(!0);this._getDocument().then(function(t){kendo.destroy(n.options.container);n._showContainer(t.view)}).catch(function(n){arcori.displayError(n)}).then(function(){n._busy(!1)})},_getDocument:function(){let n=this;return Promise.resolve(r({type:"POST",url:n.options.url.CONTENT,data:{id:n.options.id}})).then(function(n){return n})},_showContainer:function(t){n(this.options.container).html(t);this._setupToolBar();this.resize()},_setupToolBar:function(){this.kToolBar=n(this._selector(this.ELEMENT.sTOOLBAR)).getKendoToolBar();this.kToolBar.bind("click",this._onTBClick.bind(this));this.options.showDialog||this.kToolBar.remove(arcori.makeID(this.ACTION.CLOSE));this.kToolBar.remove(arcori.makeID(this.ACTION.PRINT));this._addToolButtons()},_addToolButtons:function(){let t=this;f(this.options.otherToolButtons)&&this.options.otherToolButtons.length>0&&n.each(this.options.otherToolButtons,function(n,i){t.kToolBar.add(i)})},_onTBClick:function(n){switch(n.id){case this.ACTION.CLOSE:this.kWindow.close();break;case this.ACTION.PRINT:this._printDocument();break;case this.ACTION.DOWNLOAD:this._downloadDocument();break;default:u(this.options.otherTBClickHandler)&&this.options.otherTBClickHandler(n)}},_downloadDocument:function(){let n=this.options.url.DOWNLOAD,t={id:this.options.id,fileDownloadName:this.options.fileDownloadName};arcori.downloadDocument(n,t)},_printDocument:function(){},_selector:function(n){return this.options.container+" "+n},_busy:function(n){arcori.busy(this.options.container,n)}});i(!0,arcori,{DocumentViewer:c})}(window.kendo.jQuery),function(n){var r=n.extend,h=n.ajax,i="#householdContactGridDiv #householdContactGrid",u=i+" #householdContactGridTB",f="#OriginID",e="#Version",t={ADD:"NewContact",REMOVE:"RemoveContact",EDIT:"EditContact"},o={SAVE:arcori.makeUrl("Application/SaveHouseholdContacts")},s=kendo.Class.extend({ID:null,container:null,kGrid:null,kToolBar:null,init:function(){if(this.kGrid=n(i).getKendoGrid(),this.kGrid){this.kGrid.bind("dataBound",this._onDataBound.bind(this));this.kGrid.bind("change",this._onRowSelect.bind(this));n(i).on("dblclick","tbody tr",function(){this._openContact()}.bind(this));this.kGrid.reInitDataSource({transport:{read:{data:this._gridData.bind(this)},update:{data:this._gridData.bind(this)},destroy:{data:this._gridData.bind(this)}}});this.kToolBar=n(u).getKendoToolBar();this.kToolBar.bind("click",this._onTBClick.bind(this))}},destroy:function(){this.kGrid.destroy()},resize:function(){},_gridData:function(){return{id:n(f).val(),version:n(e).val()}},_onDataBound:function(){this._updateToolBarState()},_onRowSelect:function(){this._updateToolBarState()},_onTBClick:function(i){var r=this;switch(i.id){case t.ADD:this._createContact();break;case t.REMOVE:r.kGrid.select().each(function(){r.kGrid.removeRow(n(this))});break;case t.EDIT:this._openContact()}},_openContact:function(){var t=this,n=t.kGrid.dataItem(t.kGrid.select()),i=new arcori.AlternateContact({data:n});i.bind(i.EVENTS.UPDATED,function(i){n.dirtyFields.FirstName=n.dirtyFields.FirstName?!0:n.FirstName!==i.FirstName;n.dirtyFields.LastName=n.dirtyFields.LastName?!0:n.LastName!==i.LastName;n.FirstName=i.FirstName;n.LastName=i.LastName;n.AlternateContactTypeID=i.AlternateContactTypeID;n.AlternateContactTypeName=i.AlternateContactTypeName;n.AlternateContactRelationshipID=i.AlternateContactRelationshipID;n.AlternateContactRelationshipName=i.AlternateContactRelationshipName;n.ConsentOnFile=i.ConsentOnFile;n.HouseholdMemberID=i.HouseholdMemberID;n.HouseholdMemberName=i.HouseholdMemberName;n.PhoneNumbers=i.PhoneNumbers.data();n.EmailAddresses=i.EmailAddresses.data();i.AlternateContactAddress.Municipality&&(n.AlternateContactAddress=i.AlternateContactAddress);n.dirty=!0;t.kGrid.refresh()});i.show()},_createContact:function(){var t=this,n=new arcori.AlternateContact;n.bind(n.EVENTS.CREATED,function(n){t.kGrid.dataSource.add({ID:0,FirstName:n.FirstName,LastName:n.LastName,AlternateContactTypeID:n.AlternateContactTypeID,AlternateContactTypeName:n.AlternateContactTypeName,AlternateContactRelationshipID:n.AlternateContactRelationshipID,AlternateContactRelationshipName:n.AlternateContactRelationshipName,ConsentOnFile:n.ConsentOnFile,HouseholdMemberID:n.HouseholdMemberID,HouseholdMemberName:n.HouseholdMemberName,PhoneNumbers:n.PhoneNumbers.data(),EmailAddresses:n.EmailAddresses.data(),AlternateContactAddress:n.AlternateContactAddress.Municipality?n.AlternateContactAddress:null,dirty:!0});t.kGrid.refresh()});n.show()},data:function(){var n="";return this.kGrid&&(n=this.kGrid.dataSource.serializedChanges({updatedPrefix:"updatedHouseholdContacts",deletedPrefix:"deletedHouseholdContacts",createdPrefix:"newHouseholdContacts"})),n},save:function(){var t=this,i=t.data();return n.extend(!0,i,t._gridData()),new Promise(function(r,u){return Promise.resolve(n.ajax({url:o.SAVE,data:i,type:"POST"})).then(function(n){t.kGrid.dataSource._destroyed=[];t.kGrid.dataSource.read();r(n)}).catch(function(n){u(n)})})},_updateToolBarState:function(){var i=!1,r=this.kGrid.select();i=r.length>0;canEdit=r.length>0;this.kToolBar.enable(n("#"+t.REMOVE),i);this.kToolBar.enable(n("#"+t.EDIT),canEdit)}});r(!0,arcori,{HouseholdContactGrid:s})}(window.kendo.jQuery),function(n){var s=n.extend,h=n.ajax,r="alternateContactPopUpWindow",c="#"+r,l="
",u="#alternateContactForm",a="#AlternateContactTB",v="#FirstName",y="#LastName",t="#HouseholdMemberID",f="#AlternateContactTypeID",e="#AlternateContactRelationshipID",i={OK:"OK",DISCARD:"Discard"},o={View:arcori.makeUrl("Application/AlternateContactView")},p=kendo.Observable.extend({ID:null,container:null,kGrid:null,kToolBar:null,options:{data:null},model:null,EVENTS:{UPDATED:"updated",CREATED:"created"},init:function(n){kendo.Observable.fn.init.call(this);n&&(this.options=n);this.model=kendo.observable({ID:this.options.data===null?0:n.data.ID,ContactID:this.options.data===null?0:n.data.ContactID,FirstName:this.options.data===null?"":n.data.FirstName,LastName:this.options.data===null?"":n.data.LastName,AlternateContactTypeID:this.options.data===null?"":n.data.AlternateContactTypeID,AlternateContactRelationshipID:this.options.data===null?"":n.data.AlternateContactRelationshipID,ConsentOnFile:this.options.data===null?!1:n.data.ConsentOnFile,HouseholdMemberID:this.options.data===null?"":n.data.HouseholdMemberID})},_initView:function(){this.$form=n(u);arcori.formatServerSideErrors(this.$form);this.kValidator=this.$form.kendoValidator({errorTemplate:arcori.validatorErrorTemplate()}).getKendoValidator();this._initToolbar();this._initDetail();this._initAddress();this._initPhoneNumberGrid();this._initEmailGrid();this._bind()},_initToolbar:function(){this.kToolBar=n(a).getKendoToolBar();this.kToolBar.bind("click",this._onTBClick.bind(this))},_initDetail:function(){n(v).val(this.model.Firstname);n(y).val(this.model.LastName)},_initAddress:function(){this.address&&(this.address.destroy(),this.address=null);this.address=new arcori.Address({prefix:"AlternateContactAddress"});this.options.data&&this.address.value(this.options.data.AlternateContactAddress)},_initPhoneNumberGrid:function(){var n=this,t;if(n.phoneNumberListGrid=new arcori.ContactPhoneNumberGrid({ContactID:0}),n.options.data)for(t=0;t0;this.kToolBar.enable(n("#"+i.REMOVE),t)},_busy:function(t){kendo.ui.progress(n(c),t)}});s(!0,arcori,{AlternateContact:p})}(window.kendo.jQuery),function(n){var r=n.extend,o=n.ajax,i="#,contactPhoneNumberGrid",u=i+" #,contactPhoneNumberGridTB",t={ADD:"AddPhoneNumber",REMOVE:"RemovePhoneNumber"},f={SAVE:arcori.makeUrl("Contact/SaveContactPhoneNumbers")},e=kendo.Class.extend({ContactID:null,container:null,prefix:"_",kGrid:null,kToolBar:null,init:function(t){this.ContactID=t.ContactID;t.prefix&&(this.prefix=t.prefix+"_");var r=i.replace(",",this.prefix),f=u.replace(/,/g,this.prefix);this.kGrid=n(r).getKendoGrid();this.kGrid.bind("change",this._onRowSelect.bind(this));this.kGrid.reInitDataSource({transport:{read:{data:this._gridData.bind(this)},update:{data:this._gridData.bind(this)},destroy:{data:this._gridData.bind(this)}}},t.ContactID===0?!1:!0);this.kToolBar=n(f).getKendoToolBar();this.kToolBar.bind("click",this._onTBClick.bind(this))},destroy:function(){this.kGrid.destroy()},resize:function(){},_gridData:function(){return{contactID:this.ContactID}},_onRowSelect:function(){this._updateToolBarState()},_onTBClick:function(i){var r=this;switch(i.id){case t.ADD:r.kGrid.addRow();break;case t.REMOVE:r.kGrid.select().each(function(){r.kGrid.removeRow(n(this))})}},save:function(t){var i=this,r={};return t&&(i.ContactID=t),r=i.kGrid.serializedChanges(),n.extend(!0,r,i._gridData()),new Promise(function(t,u){if(i.ContactID>0)return Promise.resolve(n.ajax({url:f.SAVE,data:r,type:"POST"})).then(function(n){i.kGrid.dataSource._destroyed=[];i.kGrid.dataSource.read();t(n)}).catch(function(n){u(n)});t("Success")})},_updateToolBarState:function(){var n=!1,i=this.kGrid.select();n=i.length>0;this.kToolBar.enable("#"+t.REMOVE,n)}});r(!0,arcori,{ContactPhoneNumberGrid:e})}(window.kendo.jQuery),function(n){var r=n.extend,o=n.ajax,i="#,contactEmailGrid",u=i+" #,contactEmailGridTB",t={ADD:"AddEmail",REMOVE:"RemoveEmail"},f={SAVE:arcori.makeUrl("Contact/SaveContactEmailAddresses")},e=kendo.Class.extend({ContactID:null,container:null,prefix:"_",kGrid:null,kToolBar:null,init:function(t){this.ContactID=t.ContactID;t.prefix&&(this.prefix=t.prefix+"_");var r=i.replace(",",this.prefix),f=u.replace(/,/g,this.prefix);this.kGrid=n(r).getKendoGrid();this.kGrid.bind("change",this._onRowSelect.bind(this));this.kGrid.reInitDataSource({transport:{read:{data:this._gridData.bind(this)},update:{data:this._gridData.bind(this)},destroy:{data:this._gridData.bind(this)}}},t.ContactID===0?!1:!0);this.kToolBar=n(f).getKendoToolBar();this.kToolBar.bind("click",this._onTBClick.bind(this))},destroy:function(){this.kGrid.destroy()},resize:function(){},_gridData:function(){return{contactID:this.ContactID}},_onRowSelect:function(){this._updateToolBarState()},_onTBClick:function(i){var r=this;switch(i.id){case t.ADD:r.kGrid.addRow();break;case t.REMOVE:r.kGrid.select().each(function(){r.kGrid.removeRow(n(this))})}},save:function(t){var i=this,r=i.kGrid.serializedChanges();return t&&(i.ContactID=t),n.extend(!0,r,i._gridData()),new Promise(function(t,u){if(i.ContactID>0)return Promise.resolve(n.ajax({url:f.SAVE,data:r,type:"POST"})).then(function(n){i.kGrid.dataSource._destroyed=[];i.kGrid.dataSource.read();t(n)}).catch(function(n){u(n)});t("Success")})},_updateToolBarState:function(){var n=!1,i=this.kGrid.select();n=i.length>0;this.kToolBar.enable("#"+t.REMOVE,n)}});r(!0,arcori,{ContactEmailGrid:e})}(window.kendo.jQuery),function(n){var h=n.extend,r=n.ajax,c="#pastResidenceGridDiv",l="#referenceGridDiv",t="#rentLivingSituationDiv",i="#otherLivingSituationDiv",u="#receivedEvictionNoticeReasonDiv",f="#oweArrearsDiv",e="#MoveInDateLabel",o="#additionalDetailsForRentDiv",s={EDIT:arcori.makeUrl("Application/EditHousingHistory"),SAVE:arcori.makeUrl("Application/SaveHousingHistory")},a=kendo.Class.extend({sCONTAINER:null,sAPPLICATIONID:"#ApplicationID",sORIGINID:"#OriginID",sVERSION:"#Version",sHOUSINGHISTORYTOOLBAR:"#housingHistoryTB",sHOUSINGHISTORYDIV:"#housingHistoryDiv",sRECEIVEDEVICTIONNOTICE:"#ReceivedEvictionNotice",sOWEARREARS:"#OweArrears",sLIVINGSITUATION:"#LivingSituationID",sARREARSOWING:"#ArrearsOwing",sREPAYMENTAGREEMENT:"#RepaymentAgreement",sLANDLORDFIRSTNAME:"#LandlordFirstName",sLANDLORDLASTNAME:"#LandlordLastName",sLANDLORDEXTENSION:"#LandlordExtension",sLANDLORDPHONE:"#LandlordPhone",sLANDLORDEMAIL:"#LandlordEmail",sLANDLORDADDRESSEDITBUTTON:"#LandlordAddressTBEditAddress",sHASSAFEADDRESS:"#HasSafeAddress",sFORM:null,$form:null,kValidator:null,address:null,safeAddress:null,landlordAddress:null,pastResidenceGrid:null,referenceGrid:null,init:function(t){var i=this,r;t&&(t.container&&(i.sCONTAINER=t.container),t.form&&(i.sFORM=t.form),t.standalone==!0&&(r=function(n){switch(n.id){case"Save":i.save().catch(function(n){if(n.errors){var t={msg:n.responseText,msgTitle:n.msgTitle,errors:n.errors};arcori.displayError(t)}else if(n.responseText)arcori.displayError(n);else throw n;})}},this.kToolBar=n(i.sHOUSINGHISTORYTOOLBAR).getKendoToolBar(),this.kToolBar.bind("click",r.bind(this))))},show:function(){var n=this;return n._getView()},_getView:function(){var t=this;return t._busy(!0),Promise.resolve(r({type:"POST",url:s.EDIT,data:{applicationId:n(t.sORIGINID).val(),version:n(t.sVERSION).val()},cache:!1})).then(function(n){t._updateView(n)}).catch(function(n){if(n.responseText)arcori.displayError(n);else throw n;}).then(function(){t._busy(!1)})},_updateView:function(n){n&&(n.view?this._view(n):n.housingHistoryView&&this._housingHistory(n))},_view:function(t){let i=t&&t.view?t.view:!1;i&&(kendo.destroy(this.sCONTAINER),n(this.sCONTAINER).html(i),this._initView())},_housingHistory:function(t){let i=t&&t.housingHistoryView?t.housingHistoryView:!1;i&&(kendo.destroy(this.sHOUSINGHISTORYDIV),n(this.sHOUSINGHISTORYDIV).html(i),this._initView())},updateView:function(t){var i=this;t.view?(n(i.sCONTAINER).html(t.view),i._initView()):t.housingHistoryView&&(n(i.sHOUSINGHISTORYDIV).html(t.housingHistoryView),i._initLivingSituation(),i._initReceivedEvictionNotice(),i._initOweArrears(),i._initCurrentResidenceAddress(),i._initSafeAddress())},_initView:function(){this._initLivingSituation();this._initReceivedEvictionNotice();this._initOweArrears();this._initCurrentResidenceAddress();this._initSafeAddress();this._initPastResidenceGrid();this._initReferenceGrid();this._validator()},_validator:function(){this.$form=n(this.sFORM);arcori.formatServerSideErrors(this.$form);this.kValidator=this.$form.kendoValidator({errorTemplate:arcori.validatorErrorTemplate()}).getKendoValidator()},_initLivingSituation:function(){var t=this;t._checkLandlordName();n(this.sLANDLORDFIRSTNAME).bind("change",this._checkLandlordName.bind(this));n(this.sLANDLORDLASTNAME).bind("change",this._checkLandlordName.bind(this));t._toggleLivingSituation();n(t.sLIVINGSITUATION).bind("change",function(){t._toggleLivingSituation()});t._initLandlordAddress()},_checkLandlordName:function(){var t=n(this.sLANDLORDFIRSTNAME).val()!==""&&n(this.sLANDLORDLASTNAME).val()!=="";n(this.sLANDLORDADDRESSEDITBUTTON).getKendoButton().enable(t);n(this.sLANDLORDPHONE).getKendoMaskedTextBox().enable(t);n(this.sLANDLORDEXTENSION).getKendoMaskedTextBox().enable(t);t?n(this.sLANDLORDEMAIL).removeAttr("disabled"):(n(this.sLANDLORDPHONE).getKendoMaskedTextBox().value(null),n(this.sLANDLORDEXTENSION).getKendoMaskedTextBox().value(null),n(this.sLANDLORDEMAIL).attr("disabled","disabled"),n(this.sLANDLORDEMAIL).val(null),this.landlordAddress&&this.landlordAddress.value(null))},_toggleLivingSituation:function(){var r=parseInt(n(this.sLIVINGSITUATION).getKendoComboBox().value());n(o).hide();switch(r){case arcori.eLivingSitualtion.Rent:n(t).show();n(i).hide();n(o).show();break;case arcori.eLivingSitualtion.Own:case arcori.eLivingSitualtion.LivingWithFamilyFriends:case arcori.eLivingSitualtion.Shelter:n(t).hide();n(i).hide();break;case arcori.eLivingSitualtion.Homeless:n(e).html(arcori.strings.homelessSince);n(t).hide();n(i).hide();break;case arcori.eLivingSitualtion.Other:n(t).hide();n(i).show()}r!==arcori.eLivingSitualtion.Rent&&(n(this.sLANDLORDFIRSTNAME).val(""),n(this.sLANDLORDLASTNAME).val(""),n(this.sLANDLORDEXTENSION).val(""),n(this.sLANDLORDPHONE).val(""),n(this.sLANDLORDEMAIL).val(""));r!==arcori.eLivingSitualtion.Homeless&&n(e).html(arcori.strings.dateMovedIn)},_initReceivedEvictionNotice:function(){var t=this;t._toggleReceivedEvictionNotice();n(t.sRECEIVEDEVICTIONNOTICE).getKendoSwitch().bind("change",function(){t._toggleReceivedEvictionNotice()})},_toggleReceivedEvictionNotice:function(){n(this.sRECEIVEDEVICTIONNOTICE).getKendoSwitch().value()?n(u).show():n(u).hide()},_initOweArrears:function(){var t=this;t._toggleOweArrears();n(t.sOWEARREARS).getKendoSwitch().bind("change",function(){t._toggleOweArrears()})},_toggleOweArrears:function(){n(this.sOWEARREARS).getKendoSwitch().value()?n(f).show():n(f).hide()},_initCurrentResidenceAddress:function(){this.address&&(this.address.destroy(),this.address=null);this.address=new arcori.Address({prefix:"CurrentResidenceAddress",hideAddressee:!0,hideEditorToolbar:!1})},_initSafeAddress:function(){var t=this;this.safeAddress&&(this.safeAddress.destroy(),this.safeAddress=null);this.safeAddress=new arcori.Address({prefix:"SafeAddress",hideAddressee:!0,hideEditorToolbar:!1,copy:{text:"Copy from Current",address:function(){return Promise.resolve(t.address.value())}}});this.safeAddress.enable(n(this.sHASSAFEADDRESS).is(":checked"));n(this.sHASSAFEADDRESS).click(function(){t.safeAddress.enable(n(t.sHASSAFEADDRESS).is(":checked"))})},_initLandlordAddress:function(){var n=this;this.landlordAddress&&(this.landlordAddress.destroy(),this.landlordAddress=null);this.landlordAddress=new arcori.Address({prefix:"LandlordAddress",hideAddressee:!0,hideEditorToolbar:!1})},_initPastResidenceGrid:function(){var t=this;t.pastResidenceGrid==null&&(t.pastResidenceGrid=new arcori.ResidenceGrid({container:c,applicationID:n(t.sAPPLICATIONID).val()}),t.pastResidenceGrid.kGrid||(t.pastResidenceGrid=null))},_initReferenceGrid:function(){var t=this;t.referenceGrid==null&&(t.referenceGrid=new arcori.ReferenceGrid({container:l,applicationID:n(t.sAPPLICATIONID).val()}),t.referenceGrid.kGrid||(t.referenceGrid=null))},data:function(){var t={};return n.each(n(this.sCONTAINER+" :input").serializeArray(),function(n,i){i.name in t||(t[i.name]=i.value)}),t},save:function(){var n=this;return n._busy(!0),new Promise(function(t,i){var u=n._validate(),f;u.valid?f=Promise.resolve(r({type:"POST",url:s.SAVE,data:n.$form.serialize(),cache:!1})).then(function(n){return n}).then(function(t){return n._updateView(t),arcori.showMessage(t.msgTitle,t.msg),t}).catch(function(n){if(n.responseText)arcori.displayError(n),i(n);else throw n;}).then(function(i){n._busy(!1);t(i)}):(i(u.error),n._busy(!1))})},_validate:function(){var n=this.kValidator.validate();return{valid:n,error:{responseText:arcori.strings.validationErrorPreamble,msgTitle:arcori.strings.error,errors:this.kValidator.errors()}}},_busy:function(t){kendo.ui.progress(n(this.sCONTAINER),t)}});h(!0,arcori,{HousingHistory:a})}(window.kendo.jQuery),function(n){var s=n.extend,f=n.ajax,i="#pastResidenceGridDiv",r=i+" #pastResidenceGrid",h=r+" #pastResidenceGridTB",e="#OriginID",o="#Version",t={ADD:"NewResidence",REMOVE:"RemoveResidence",EDIT:"EditResidence",COPYFROMCURRENT:"CopyFromCurrent"},u={SAVE:arcori.makeUrl("Application/SavePastResidence"),VIEW:arcori.makeUrl("Application/GetPastResidenceGridView"),CURRENCTRESIDENCEDATA:arcori.makeUrl("Application/GetCurrentResidenceData")},c=kendo.Class.extend({ID:null,sCONTAINER:null,kGrid:null,kToolBar:null,init:function(n){n.container&&(this.sCONTAINER=n.container);this._initView()},destroy:function(){this.kGrid.destroy()},resize:function(){},_gridData:function(){return{id:n(e).val(),version:n(o).val()}},_onDataBound:function(){var n=this.kGrid.dataSource.data(),t=n.length},_onRowSelect:function(){this._updateToolBarState()},_onTBClick:function(r){var u=this,f;switch(r.id){case t.ADD:residencePopUp=new arcori.ResidencePopUp({container:i,ID:0});residencePopUp.show().then(function(n){n.saved&&u._addNewItem(n)});break;case t.REMOVE:u.kGrid.select().each(function(){u.kGrid.removeRow(n(this))});break;case t.EDIT:f=u.kGrid.dataItem(u.kGrid.select());u._onRowEdit(f);break;case t.COPYFROMCURRENT:u._getCurrentResidence()}},_onRowEdit:function(n){var t=this;residencePopUp=new arcori.ResidencePopUp({container:i,ID:n.ID?n.ID:0,item:n});residencePopUp.show().then(function(i){if(i.saved){var r=t.kGrid.dataSource;n=t.kGrid.dataItem(t.kGrid.select());n&&(n.ApplicationID=t.ID,n.PastResidenceAddress={ID:n.PastResidenceAddress.ID,Type:i.ADDRESS.Type,CivicNumber:i.ADDRESS.CivicNumber,CivicSuffix:i.ADDRESS.CivicSuffix,StreetName:i.ADDRESS.StreetName,StreetType:i.ADDRESS.StreetType,StreetDirection:i.ADDRESS.StreetDirection,Municipality:i.ADDRESS.Municipality,Province:i.ADDRESS.Province,PostalCode:i.ADDRESS.PostalCode,POBox:i.ADDRESS.POBox,RRNumber:i.ADDRESS.RRNumber,StationInfo:i.ADDRESS.StationInfo,UnitNumber:i.ADDRESS.UnitNumber,UnitType:i.ADDRESS.UnitType,Addressee:i.ADDRESS.Addressee,GeneralDeliveryInfo:i.ADDRESS.GeneralDeliveryInfo},n.StartDate=i.STARTDATE,n.EndDate=i.ENDDATE,n.ReasonForLeaving=i.REASONFORLEAVING,n.AddressString=i.ADDRESSSTRING,n.PRIsSocialHousing=i.ISSOCIALHOUSING,n.PRRentAmount=i.RENTAMOUNT,n.PRReceivingRGISubsidy=i.RECEIVINGRGISUBSIDY,n.PRReceivingOtherSubsidy=i.RECEIVINGOTHERSUBSIDY,n.PRRepaymentAgreement=i.REPAYMENTAGREEMENT,n.PRArrearsOwing=i.ARREARSOWING,n.PROweArrears=i.OWEARREARS,n.PRLivingSituationID=i.LIVINGSITUATIONID,n.PROtherLivingSituation=i.OTHERLIVINGSITUATION,n.PRLiveInCanada=i.LIVEINCANADA,n.PRLandlordFirstName=i.LANDLORDFIRSTNAME,n.PRLandlordLastName=i.LANDLORDLASTNAME,n.PRLandlordExtension=i.LANDLORDEXTENSION,n.PRLandlordPhone=i.LANDLORDPHONE,n.PRLandlordEmail=i.LANDLORDEMAIL,n.PRLandlordAddress={ID:n.PRLandlordAddress.ID,Type:i.LANDLORDADDRESS.Type,CivicNumber:i.LANDLORDADDRESS.CivicNumber,CivicSuffix:i.LANDLORDADDRESS.CivicSuffix,StreetName:i.LANDLORDADDRESS.StreetName,StreetType:i.LANDLORDADDRESS.StreetType,StreetDirection:i.LANDLORDADDRESS.StreetDirection,Municipality:i.LANDLORDADDRESS.Municipality,Province:i.LANDLORDADDRESS.Province,PostalCode:i.LANDLORDADDRESS.PostalCode,POBox:i.LANDLORDADDRESS.POBox,RRNumber:i.LANDLORDADDRESS.RRNumber,StationInfo:i.LANDLORDADDRESS.StationInfo,UnitNumber:i.LANDLORDADDRESS.UnitNumber,UnitType:i.LANDLORDADDRESS.UnitType},n.PRAllMembers=i.ALLMEMBERS,n.ResidenceMembers=i.RESIDENCEMEMBERS,n.PRDescription=i.DESCRIPTION,n.PREvicted=i.EVICTED,n.dirty=!0);t.kGrid.refresh()}})},data:function(){return this.kGrid.dataSource.serializedChanges({updatedPrefix:"updatedResidences",deletedPrefix:"deletedResidences",createdPrefix:"newResidences"})},save:function(){var t=this,i=t.kGrid.serializedChanges();return n.extend(!0,i,t._gridData()),new Promise(function(r,f){return Promise.resolve(n.ajax({url:u.SAVE,data:i,type:"POST"})).then(function(n){t.kGrid.dataSource._destroyed=[];t.kGrid.dataSource.read();r(n)}).catch(function(n){f(n)})})},show:function(){var n=this;return n._getView()},_addNewItem:function(n){var t=this,i=t.kGrid.dataSource,r;i.add({ApplicationID:t.ID,PastResidenceAddress:{ID:n.ADDRESS.ID,Type:n.ADDRESS.Type,CivicNumber:n.ADDRESS.CivicNumber,CivicSuffix:n.ADDRESS.CivicSuffix,StreetName:n.ADDRESS.StreetName,StreetType:n.ADDRESS.StreetType,StreetDirection:n.ADDRESS.StreetDirection,Municipality:n.ADDRESS.Municipality,Province:n.ADDRESS.Province,PostalCode:n.ADDRESS.PostalCode,POBox:n.ADDRESS.POBox,RRNumber:n.ADDRESS.RRNumber,StationInfo:n.ADDRESS.StationInfo,UnitNumber:n.ADDRESS.UnitNumber,UnitType:n.ADDRESS.UnitType,Addressee:n.ADDRESS.Addressee,GeneralDeliveryInfo:n.ADDRESS.GeneralDeliveryInfo},StartDate:n.STARTDATE,EndDate:n.ENDDATE,ReasonForLeaving:n.REASONFORLEAVING,AddressString:n.ADDRESSSTRING,PRIsSocialHousing:n.ISSOCIALHOUSING,PRRentAmount:n.RENTAMOUNT,PRReceivingRGISubsidy:n.RECEIVINGRGISUBSIDY,PRReceivingOtherSubsidy:n.RECEIVINGOTHERSUBSIDY,PRRepaymentAgreement:n.REPAYMENTAGREEMENT,PRArrearsOwing:n.ARREARSOWING,PROweArrears:n.OWEARREARS,PRLivingSituationID:n.LIVINGSITUATIONID,PROtherLivingSituation:n.OTHERLIVINGSITUATION,PRLiveInCanada:n.LIVEINCANADA,PRLandlordFirstName:n.LANDLORDFIRSTNAME,PRLandlordLastName:n.LANDLORDLASTNAME,PRLandlordExtension:n.LANDLORDEXTENSION,PRLandlordPhone:n.LANDLORDPHONE,PRLandlordEmail:n.LANDLORDEMAIL,PRLandlordAddress:{ID:n.LANDLORDADDRESS.ID,Type:n.LANDLORDADDRESS.Type,CivicNumber:n.LANDLORDADDRESS.CivicNumber,CivicSuffix:n.LANDLORDADDRESS.CivicSuffix,StreetName:n.LANDLORDADDRESS.StreetName,StreetType:n.LANDLORDADDRESS.StreetType,StreetDirection:n.LANDLORDADDRESS.StreetDirection,Municipality:n.LANDLORDADDRESS.Municipality,Province:n.LANDLORDADDRESS.Province,PostalCode:n.LANDLORDADDRESS.PostalCode,POBox:n.LANDLORDADDRESS.POBox,RRNumber:n.LANDLORDADDRESS.RRNumber,StationInfo:n.LANDLORDADDRESS.StationInfo,UnitNumber:n.LANDLORDADDRESS.UnitNumber,UnitType:n.LANDLORDADDRESS.UnitType},PRAllMembers:n.ALLMEMBERS,PREvicted:n.Evicted,ResidenceMembers:n.RESIDENCEMEMBERS});r=i.data()[i.data().length-1];r.dirty=!0;t.kGrid.refresh()},_getView:function(){var n=this;return n._busy(!0),Promise.resolve(f({type:"POST",url:u.VIEW,cache:!1})).then(function(t){n._updateView(t)}).catch(function(n){if(n.responseText)arcori.displayError(n);else throw n;}).then(function(){n._busy(!1)})},_getCurrentResidence:function(){var t=this,r=null;return t._busy(!0),Promise.resolve(f({type:"POST",url:u.CURRENCTRESIDENCEDATA,data:{applicationID:n(e).val(),version:n(o).val()},cache:!1})).then(function(n){r=n.newPastResidence}).catch(function(n){if(n.responseText)arcori.displayError(n);else throw n;}).then(function(){return residencePopUp=new arcori.ResidencePopUp({container:i,ID:0,item:r}),residencePopUp.show().then(function(n){n.saved&&t._addNewItem(n)})}).then(function(){t._busy(!1)})},_updateView:function(t){var i=this;t&&(n(i.sCONTAINER).html(t.view),i._initView());this.$form=n(i.sFORM);arcori.formatServerSideErrors(this.$form);this.kValidator=this.$form.kendoValidator({errorTemplate:arcori.validatorErrorTemplate()}).getKendoValidator()},_initView:function(){var t=this;if(this.kGrid=n(r).getKendoGrid(),this.kGrid){this.kGrid.bind("dataBound",this._onDataBound.bind(this));this.kGrid.bind("change",this._onRowSelect.bind(this));this.kGrid.reInitDataSource({transport:{read:{data:this._gridData.bind(this)},update:{data:this._gridData.bind(this)},destroy:{data:this._gridData.bind(this)}}});n(r).on("dblclick","tbody tr",function(n){var i=t.kGrid.dataItem(t.kGrid.select());n.preventDefault();t._onRowEdit(i)})}this.kToolBar=n(h).getKendoToolBar();this.kToolBar&&this.kToolBar.bind("click",this._onTBClick.bind(this))},_updateToolBarState:function(){var i=!1,r=!1;selectedRows=this.kGrid.select();i=selectedRows.length>0;r=selectedRows.length>0;this.kToolBar.enable(n("#"+t.REMOVE),i);this.kToolBar.enable(n("#"+t.EDIT),r)},_busy:function(t){kendo.ui.progress(n(this.sCONTAINER),t)}});s(!0,arcori,{ResidenceGrid:c})}(window.kendo.jQuery),function(n){var at=n.extend,vt=n.ajax,yt="#OriginID",pt="#Version",v="PastResidenceAddress",t="#"+v,wt="
",bt=t+" #pastResidenceTB",kt=t+" #ID",nt=t+" #StartDate",tt=t+" #EndDate",it=t+" #ReasonForLeaving",s=t+" #prRentLivingSituationDiv",y="#prAdditionalDetailsDiv",rt=t+" .prAdditionalDetailsForRentDiv",h=t+" #prOtherLivingSituationDiv",ut=t+" #prOweArrearsDiv",ft=t+" #prAllMembersDiv",p=t+" #PRIsSocialHousing",et=t+" #PRRentAmount",w=t+" #PRReceivingRGISubsidy",b=t+" #PRReceivingOtherSubsidy",k=t+" #PRRepaymentAgreement",ot=t+" #PRArrearsOwing",c=t+" #PROweArrears",i=t+" #PRLivingSituationID",st=t+" #PROtherLivingSituation",d=t+" #PRLiveInCanada",u=t+" #PRLandlordFirstName",f=t+" #PRLandlordLastName",e=t+" #PRLandlordExtension",o=t+" #PRLandlordPhone",r=t+" #PRLandlordEmail",dt=t+" #PRLandlordAddressTBEditAddress",l=t+" #PRAllMembers",ht=t+" #ResidenceMembers",ct=t+" #PRDescription",g=t+" #PREvicted",lt={SAVE:"Save",CANCEL:"Cancel"},a={CIVIC:"Civic",POBOX:"PO",RR:"RR",GD:"GeneralDelivery"},gt={POPUP:arcori.makeUrl("Application/ResidencePopupView")},ni=kendo.Class.extend({ID:null,item:null,container:null,kToolBar:null,address:null,landlordAddress:null,saved:!1,kValidator:null,init:function(n){this.container=n.container;this.ID=n.ID;this.item=n.item},_initLivingSituation:function(){var t=this;t._checkLandlordName();n(u).bind("change",this._checkLandlordName.bind(this));n(f).bind("change",this._checkLandlordName.bind(this));t._toggleLivingSituation();n(i).unbind("change");n(i).bind("change",function(){t._toggleLivingSituation()})},_checkLandlordName:function(){var t=n(u).val()!==""&&n(f).val()!=="";n(dt).getKendoButton().enable(t);n(o).getKendoMaskedTextBox().enable(t);n(e).getKendoMaskedTextBox().enable(t);t?n(r).removeAttr("disabled"):(n(o).getKendoMaskedTextBox().value(null),n(e).getKendoMaskedTextBox().value(null),n(r).attr("disabled","disabled"),n(r).val(null),this.landlordAddress&&this.landlordAddress.value(null))},_initLandlordAddress:function(){var n=this;this.landlordAddress&&(this.landlordAddress.destroy(),this.landlordAddress=null);this.landlordAddress=new arcori.Address({prefix:"PRLandlordAddress",hideAddressee:!0,hideEditorToolbar:!1})},_toggleLivingSituation:function(){n(y).hide();n(rt).hide();switch(parseInt(n(i).getKendoComboBox().value())){case arcori.eLivingSitualtion.Rent:n(s).show();n(h).hide();n(y).show();n(rt).show();break;case arcori.eLivingSitualtion.Own:case arcori.eLivingSitualtion.LivingWithFamilyFriends:case arcori.eLivingSitualtion.Shelter:n(s).hide();n(h).hide();break;case arcori.eLivingSitualtion.Homeless:n(s).hide();n(h).hide();n(y).show();break;case arcori.eLivingSitualtion.Other:n(s).hide();n(h).show()}parseInt(n(i).getKendoComboBox().value())!==arcori.eLivingSitualtion.Rent&&(n(u).val(""),n(f).val(""),n(e).val(""),n(o).val(""),n(r).val(""))},_initOweArrears:function(){var t=this;t._toggleOweArrears();n(c).getKendoSwitch().bind("change",function(){t._toggleOweArrears()})},_toggleOweArrears:function(){n(c).getKendoSwitch().value()?n(ut).show():n(ut).hide()},_initAllMembers:function(){var t=this;t._togglAllMembers();n(l).getKendoSwitch().bind("change",function(){t._togglAllMembers()})},_togglAllMembers:function(){n(l).getKendoSwitch().value()?n(ft).hide():n(ft).show()},show:function(){var t=this;return new Promise(function(s){t.kWindow=n(wt).kendoWindow({height:720,width:1200,modal:!0,activate:t.resize.bind(t),deactivate:function(){this.destroy()},close:function(){var h;h=t.saved?{saved:!0,ID:n(kt).val(),ADDRESS:t.address.value(),ADDRESSSTRING:t._formatAddress(t.address.value()),STARTDATE:n(nt).val(),ENDDATE:n(tt).val(),REASONFORLEAVING:n(it).val(),ISSOCIALHOUSING:n(p).getKendoSwitch().value(),RENTAMOUNT:n(et).getKendoNumericTextBox().value(),RECEIVINGRGISUBSIDY:n(w).getKendoSwitch().value(),RECEIVINGOTHERSUBSIDY:n(b).getKendoSwitch().value(),REPAYMENTAGREEMENT:n(k).getKendoSwitch().value(),OWEARREARS:n(c).getKendoSwitch().value(),ARREARSOWING:n(ot).val(),LIVINGSITUATIONID:n(i).val(),OTHERLIVINGSITUATION:n(st).val(),LIVEINCANADA:n(d).getKendoSwitch().value(),LANDLORDFIRSTNAME:n(u).val(),LANDLORDLASTNAME:n(f).val(),LANDLORDEXTENSION:n(e).val(),LANDLORDPHONE:n(o).val(),LANDLORDEMAIL:n(r).val(),LANDLORDADDRESS:t.landlordAddress.value(),ALLMEMBERS:n(l).getKendoSwitch().value(),RESIDENCEMEMBERS:n(ht).getKendoMultiSelect().value(),DESCRIPTION:n(ct).val(),EVICTED:n(g).getKendoSwitch().value()}:{saved:!1};s(h)},resizable:!1}).getKendoWindow().center().open();t._busy(!0);Promise.resolve(vt({type:"POST",url:gt.POPUP,data:{id:t.ID,householdHistoryID:n(yt).val(),version:n(pt).val()},cache:!1})).then(function(s){t.kWindow.title(s.title);t.kWindow.content(s.view);t.address=new arcori.Address({prefix:v,hideEditorToolbar:!0,hideAddressee:!0});t._initLandlordAddress();t.item?(t.address.value(t.item.PastResidenceAddress),n(nt).getKendoDatePicker().value(t.item.StartDate),n(tt).getKendoDatePicker().value(t.item.EndDate),n(it).val(t.item.ReasonForLeaving),n(p).getKendoSwitch().value(t.item.PRIsSocialHousing),n(et).getKendoNumericTextBox().value(t.item.PRRentAmount),n(w).getKendoSwitch().value(t.item.PRReceivingRGISubsidy),n(b).getKendoSwitch().value(t.item.PRReceivingOtherSubsidy),n(k).getKendoSwitch().value(t.item.PRRepaymentAgreement),n(c).getKendoSwitch().value(t.item.PROweArrears),n(ot).getKendoNumericTextBox().value(t.item.PRArrearsOwing),n(i).getKendoComboBox().value(t.item.PRLivingSituationID),n(st).val(t.item.PROtherLivingSituation),n(d).getKendoSwitch().value(t.item.PRLiveInCanada),n(u).val(t.item.PRLandlordFirstName),n(f).val(t.item.PRLandlordLastName),n(e).val(t.item.PRLandlordExtension),n(o).val(t.item.PRLandlordPhone),n(r).val(t.item.PRLandlordEmail),t.landlordAddress.value(t.item.PRLandlordAddress),n(l).getKendoSwitch().value(t.item.PRAllMembers),n(ht).getKendoMultiSelect().value(t.item.ResidenceMembers),n(ct).val(t.item.PRDescription),n(g).getKendoSwitch().value(t.item.PREvicted)):(n(d).getKendoSwitch().value(!0),n(p).getKendoSwitch().value(!1),n(w).getKendoSwitch().value(!1),n(b).getKendoSwitch().value(!1),n(k).getKendoSwitch().value(!1),n(g).getKendoSwitch().value(!1));t._initLivingSituation();t._initOweArrears();t._initAllMembers();t.kToolBar=n(bt).getKendoToolBar();t.kToolBar.bind("click",t._onTBClick.bind(t));t._validator();t.kWindow.center().open()}).catch(function(n){t.kWindow.close();arcori.displayError(n)}).then(function(){t.resize();t._busy(!1)})})},_validator:function(){var i=n(t);arcori.formatServerSideErrors(i);this.kValidator=i.kendoValidator({errorTemplate:arcori.validatorErrorTemplate()}).getKendoValidator()},_validate:function(){var n=this.kValidator.validate();return{valid:n,error:{msg:arcori.strings.validationErrorPreamble,msgTitle:arcori.strings.error,errors:this.kValidator.errors()}}},_formatAddress:function(n){var t="";return n.Type!=a.GD?(t+=n.CivicNumber?n.CivicNumber+" ":"",t+=n.CivicSuffix?n.CivicSuffix+" ":"",t+=n.StreetName?n.StreetName+" ":"",t+=n.StreetType?n.StreetType+" ":"",t+=n.StreetDirection?n.StreetDirection:"",t+=n.UnitNumber?" "+n.UnitType+" "+n.UnitNumber:"",t+=n.Type==a.POBOX?" "+arcori.strings.poBox+" "+n.POBox+" "+n.StationInfo:"",t+=n.Type==a.RR?" "+arcori.strings.rr+" "+n.RRNumber+" "+n.StationInfo:""):t+=n.Type==a.GD?" "+n.Addressee+" "+n.GeneralDeliveryInfo:"",t+=", "+n.Municipality,t+=", "+n.Province,t+=" "+n.PostalCode,t.trim()},_onTBClick:function(n){var t=this,i;switch(n.id){case lt.SAVE:t.saved=!1;i=t._validate();i.valid?t.address._validate().then(function(){t.saved=!0;t.kWindow.close()}):arcori.displayError(i.error);break;case lt.CANCEL:t.saved=!1;t.kWindow.close()}},resize:function(){},_busy:function(){kendo.ui.progress(n(t))}});at(!0,arcori,{ResidencePopUp:ni})}(window.kendo.jQuery),function(n){var u=n.extend,f=n.ajax,i="#referenceGridDiv #referenceGrid",e=i+" #referenceGridTB",o="#OriginID",s="#Version",t={ADD:"NewReference",REMOVE:"RemoveReference",EDIT:"EditReference"},r={SAVE:arcori.makeUrl("Application/SaveReference"),VIEW:arcori.makeUrl("Application/GetReferencesGridView")},h=kendo.Class.extend({ID:null,sCONTAINER:null,kGrid:null,kToolBar:null,init:function(n){n.container&&(this.sCONTAINER=n.container);this._initView()},destroy:function(){this.kGrid.destroy()},resize:function(){},_gridData:function(){return{id:n(o).val(),version:n(s).val()}},_onDataBound:function(){var n=this.kGrid.dataSource.data(),t=n.length},_onRowSelect:function(){this._updateToolBarState()},_onRowEdit:function(n){n=n||null;var i=this,t=new arcori.Reference({id:n===null?0:n.id,applicationID:i.applicationID,data:n});t.bind("updated",this._updateGridRow.bind(this));t.bind("created",this._addGridRow.bind(this));t.show()},_addGridRow:function(n){var t=this.kGrid.dataSource.add();this._updateGridRowData(t,n)},_updateGridRow:function(n){var t=this.kGrid.dataItem(this.kGrid.select());this._updateGridRowData(t,n)},_updateGridRowData:function(n,t){n.ID=t.ID;n.ApplicationID=t.ApplicationID;n.ReferenceTypeID=t.ReferenceTypeID;n.FirstName=t.FirstName;n.LastName=t.LastName;n.PhoneNumber=t.PhoneNumber;n.Extension=t.Extension;n.Email=t.Email;n.dirty=!0;this.kGrid.refresh()},_onTBClick:function(i){var r=this,u;switch(i.id){case t.ADD:r._onRowEdit();break;case t.REMOVE:r.kGrid.select().each(function(){r.kGrid.removeRow(n(this))});break;case t.EDIT:u=r.kGrid.dataItem(r.kGrid.select());r._onRowEdit(u)}},data:function(){return this.kGrid.dataSource.serializedChanges({updatedPrefix:"updatedReferences",deletedPrefix:"deletedReferences",createdPrefix:"newReferences"})},save:function(){var t=this,i=t.kGrid.serializedChanges();return n.extend(!0,i,t._gridData()),new Promise(function(u,f){return Promise.resolve(n.ajax({url:r.SAVE,data:i,type:"POST"})).then(function(n){t.kGrid.dataSource._destroyed=[];t.kGrid.dataSource.read();u(n)}).catch(function(n){f(n)})})},show:function(){var n=this;return n._getView()},_getView:function(){var n=this;return n._busy(!0),Promise.resolve(f({type:"POST",url:r.VIEW,cache:!1})).then(function(t){n._updateView(t)}).catch(function(n){if(n.responseText)arcori.displayError(n);else throw n;}).then(function(){n._busy(!1)})},_updateView:function(t){var i=this;t&&(n(i.sCONTAINER).html(t.view),i._initView());this.$form=n(i.sFORM);arcori.formatServerSideErrors(this.$form);this.kValidator=this.$form.kendoValidator({errorTemplate:arcori.validatorErrorTemplate()}).getKendoValidator()},_initView:function(){var t=this;if(this.kGrid=n(i).getKendoGrid(),this.kGrid){this.kGrid.bind("dataBound",this._onDataBound.bind(this));this.kGrid.bind("change",this._onRowSelect.bind(this));n(i).on("dblclick","tbody tr",function(n){var i=t.kGrid.dataItem(t.kGrid.select());n.preventDefault();t._onRowEdit(i)});this.kGrid.bind("edit",function(n){n.container.find("td:eq(2) input").focus()});this.kGrid.reInitDataSource({transport:{read:{data:this._gridData.bind(this)},update:{data:this._gridData.bind(this)},destroy:{data:this._gridData.bind(this)}}})}this.kToolBar=n(e).getKendoToolBar();this.kToolBar&&this.kToolBar.bind("click",this._onTBClick.bind(this))},_updateToolBarState:function(){var i=!1,r=!1,u=this.kGrid.select();i=u.length>0;r=u.length>0;this.kToolBar.enable(n("#"+t.REMOVE),i);this.kToolBar.enable(n("#"+t.EDIT),r)},_busy:function(t){kendo.ui.progress(n(this.sCONTAINER),t)}});u(!0,arcori,{ReferenceGrid:h})}(window.kendo.jQuery),function(n){var e=n.extend,o=n.ajax,r="referencePopupWindow",s="#"+r,h="
",i="#referenceDiv #referenceForm",u="#referenceTB",f={UPDATED:"updated",CREATED:"created"},t={SAVE:"Save",CANCEL:"Cancel"},c={POPUP:arcori.makeUrl("Application/ReferencePopupView")},l=kendo.Observable.extend({kWindow:null,kValidator:null,$form:null,options:{},model:{ID:null,ReferenceTypeID:null,FirstName:null,LastName:null,PhoneNumber:null,Extension:null,Email:null},init:function(t){kendo.Observable.fn.init.call(this);this.$form=n(i);this.container=t.container;this.options=t;this.Event=t.data===null?f.CREATED:f.UPDATED},_initView:function(){var t=this;this.$form=n(i);this.kValidator=this.$form.kendoValidator({errorTemplate:arcori.validatorErrorTemplate()}).getKendoValidator();this._initToolBar();this._bind()},_initToolBar:function(){this.kToolBar=n(u).getKendoToolBar();this.kToolBar.bind("click",this._onTBClick.bind(this));n(u+" #"+t.DELETE).length&&this.kToolBar.hide("#"+t.DELETE)},_bind:function(){var t=this.options.data;this.model=kendo.observable({ID:t===null?0:t.ID,ReferenceTypeID:t===null?1:t.ReferenceTypeID,FirstName:t===null?null:t.FirstName,LastName:t===null?null:t.LastName,PhoneNumber:t===null?null:t.PhoneNumber,Extension:t===null?null:t.Extension,Email:t===null?null:t.Email});kendo.bind(n(i),this.model)},_validate:function(){var i=this.kValidator.validate(),t;return errors=[],t=this.model.PhoneNumber.replace("(",""),t=t.replace(") ",""),t=t.replace("-",""),t=t.replaceAll("_",""),t.length<10&&(i=!1,errors.push("Phone Number must be 10 digits.")),i||n.merge(errors,this.kValidator.errors()),{valid:i,error:{msg:arcori.strings.validationErrorPreamble,msgTitle:arcori.strings.error,errors:errors}}},show:function(){var t=this;return new Promise(function(i){t.kWindow=n(h).kendoWindow({width:"800",height:"280",modal:!0,activate:t.resize.bind(t),deactivate:function(){this.destroy()},close:function(){i("closed")},resizable:!1}).getKendoWindow();t.kWindow.center().open();t._busy(!0);Promise.resolve(o({type:"POST",url:c.POPUP,data:{id:t.options.data===null?0:t.options.data.ID},cache:!1})).then(function(n){t.kWindow.title(n.title);t.kWindow.content(n.view);t._initView();t.kWindow.center().open()}).catch(function(n){t.kWindow.close();arcori.displayError(n)}).then(function(){t.resize();t._busy(!1)})})},_onTBClick:function(n){var i=this,r;switch(n.id){case t.SAVE:r=i._validate();r.valid?(i.trigger(i.Event,i.model),i.kWindow.close()):arcori.displayError(r.error);break;case t.CANCEL:i.saved=!1;i.kWindow.close()}},resize:function(){},_busy:function(t){kendo.ui.progress(n(s),t)}});e(!0,arcori,{Reference:l})}(window.kendo.jQuery),function(n){let t=n.extend,i=kendo.Observable.extend({rankingGrid:null,init:function(n){kendo.Observable.fn.init.call(this);this.options=t(!0,{},this.options,n)},show:function(){let t=this;return new Promise(function(i){t.kWindow=n(`
`).kendoWindow({width:"50%",height:"40%",modal:!0,deactivate:function(){this.destroy()},close:function(){i()},activate:t._resize.bind(t),resize:t._resize.bind(t)}).getKendoWindow();t.kWindow.center().open();t._busy(!0);arcori.ajax({type:"POST",url:t.URL.VIEW,cache:!1}).then(function(n){t.kWindow.title(n.title);t.kWindow.content(n.view);t._resize();t.initGrid();t.kWindow.center().open()}).catch(function(n){t.kWindow.close();arcori.displayError(n)}).then(function(){t._busy(!1)})})},initGrid:function(){let t=this;this.rankingGrid=n(this.ELEMENTS.sGRID).getKendoGrid();this.rankingGrid.reInitDataSource({transport:{read:{data:t._gridData.bind(t)}}},!0)},_resize:function(){let i=`#${this.ELEMENTS.WINDOWID}`,t=n(this.ELEMENTS.sGRID),r=t.find(".k-grid-content"),f=t.innerHeight()-r.innerHeight(),u=n(i).height()-t.positionRelative(i).top-6;t.height(u);r.height(u-f)},_busy:function(t){kendo.ui.progress(n(`#${this.ELEMENTS.WINDOWID}`),t)}});t(!0,arcori,{ApplicationRankingPopUp:i})}(window.kendo.jQuery),function(n){let t=n.extend,i=arcori.ApplicationRankingPopUp.extend({ELEMENTS:{WINDOWID:"applicationRankPopUpWindow",sGRID:"#applicationOverallRankingsGrid"},URL:{VIEW:arcori.makeUrl("Application/ShowRanking")},init:function(n){arcori.ApplicationRankingPopUp.fn.init.call(this,n)},initGrid:function(){arcori.ApplicationRankingPopUp.fn.initGrid.call(this);let t=this;n(this.ELEMENTS.sGRID).on("dblclick","tbody tr",function(){let n=t.rankingGrid.dataItem(t.rankingGrid.select()).ProgramID;t._openPropertyRankingGrid(n)})},_gridData:function(){return{originID:this.options.originID,version:this.options.version}},_openPropertyRankingGrid:function(n){let t=new arcori.ApplicationPropertyRanking({programID:n,originID:this.options.originID});t.show()}}),r=arcori.ApplicationRankingPopUp.extend({ELEMENTS:{WINDOWID:"propertyRankingWindow",sGRID:"#applicationPropertyRankingsGrid"},URL:{VIEW:arcori.makeUrl("Application/PropertyRanking")},init:function(n){arcori.ApplicationRankingPopUp.fn.init.call(this,n)},initGrid:function(){arcori.ApplicationRankingPopUp.fn.initGrid.call(this);let t=this;n(this.ELEMENTS.sGRID).on("dblclick","tbody tr",function(){let n=t.rankingGrid.dataItem(t.rankingGrid.select());t.options.propertyID=n.PropertyID;t._openUnitRankingGrid()})},_gridData:function(){return{originID:this.options.originID,programID:this.options.programID}},_openUnitRankingGrid:function(){let n=new arcori.ApplicationUnitRanking({programID:this.options.programID,originID:this.options.originID,propertyID:this.options.propertyID});n.show()}}),u=arcori.ApplicationRankingPopUp.extend({ELEMENTS:{WINDOWID:"unitRankingWindow",sGRID:"#applicationUnitRankingsGrid"},URL:{VIEW:arcori.makeUrl("Application/UnitRanking")},init:function(n){arcori.ApplicationRankingPopUp.fn.init.call(this,n)},_gridData:function(){return{originID:this.options.originID,programID:this.options.programID,propertyID:this.options.propertyID}}});t(!0,arcori,{ApplicationOverallRanking:i,ApplicationPropertyRanking:r,ApplicationUnitRanking:u})}(window.kendo.jQuery),function(n,t){var i=/[<>&\r\n"']/gm,r={"<":"lt;",">":"gt;","&":"amp;","\r":"#13;","\n":"#10;",'"':"quot;","'":"#39;"};n.extend({fileDownload:function(u,f){function it(){var i=e.cookieValue,v,f,t,r,h;if(typeof i=="string"&&(i=i.toLowerCase()),v=e.cookieName.toLowerCase()+"="+i,document.cookie.toLowerCase().indexOf(v)>-1){l.onSuccess(u);f=e.cookieName+"=; path="+e.cookiePath+"; expires="+new Date(0).toUTCString()+";";e.cookieDomain&&(f+=" domain="+e.cookieDomain+";");document.cookie=f;k(!1);return}if(o||c)try{if(t=o?o.document:rt(c),t&&t.body!==null&&t.body.innerHTML.length){if(r=!0,s&&s.length){h=n(t.body).contents().first();try{h.length&&h[0]===s[0]&&(r=!1)}catch(a){if(a&&a.number==-2146828218)r=!0;else throw a;}}if(r){setTimeout(function(){l.onFail(t.body.innerHTML,u);k(!0)},100);return}}}catch(y){l.onFail("",u,y);k(!0);return}setTimeout(it,e.checkInterval)}function rt(n){var t=n[0].contentWindow||n[0].contentDocument;return t.document&&(t=t.document),t}function k(n){setTimeout(function(){o&&(p&&o.close(),y&&o.focus&&(o.focus(),n&&o.close()))},0)}function ut(n){return n.replace(i,function(n){return"&"+r[n]})}var e=n.extend({preparingMessageHtml:null,failMessageHtml:null,androidPostUnsupportedMessageHtml:"Unfortunately your Android browser doesn't support this type of file download. Please try again with a different browser.",dialogOptions:{modal:!0},prepareCallback:function(){},successCallback:function(){},failCallback:function(){},httpMethod:"GET",data:null,checkInterval:100,cookieName:"fileDownload",cookieValue:"true",cookiePath:"/",cookieDomain:null,popupWindowTitle:"Initiating file download...",encodeHTMLEntities:!0},f),a=new n.Deferred,v=(navigator.userAgent||navigator.vendor||t.opera).toLowerCase(),y,p,d,g,h,l,c,o,w,s,tt,b,nt;if(/ip(ad|hone|od)/.test(v)?y=!0:v.indexOf("android")!==-1?p=!0:d=/avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|playbook|silk|iemobile|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(v)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(v.substr(0,4)),g=e.httpMethod.toUpperCase(),p&&g!=="GET"&&e.androidPostUnsupportedMessageHtml)return n().dialog?n("
").html(e.androidPostUnsupportedMessageHtml).dialog(e.dialogOptions):alert(e.androidPostUnsupportedMessageHtml),a.reject();h=null;l={onPrepare:function(t){e.preparingMessageHtml?h=n("
").html(e.preparingMessageHtml).dialog(e.dialogOptions):e.prepareCallback&&e.prepareCallback(t)},onSuccess:function(n){h&&h.dialog("close");e.successCallback(n);a.resolve(n)},onFail:function(t,i,r){h&&h.dialog("close");e.failMessageHtml&&n("
").html(e.failMessageHtml).dialog(e.dialogOptions);e.failCallback(t,i,r);a.reject(t,i)}};l.onPrepare(u);return e.data!==null&&typeof e.data!="string"&&(e.data=n.param(e.data)),g==="GET"?(e.data!==null&&(tt=u.indexOf("?"),tt!==-1?u.substring(u.length-1)!=="&"&&(u=u+"&"):u=u+"?",u=u+e.data),y||p?(o=t.open(u),o.document.title=e.popupWindowTitle,t.focus()):d?t.location(u):c=n("