!function(e){var t={};function a(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=t,a.d=function(e,t,o){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(a.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(o,n,function(t){return e[t]}.bind(null,n));return o},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=10)}([function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.birthdateId=t.ethnicityIds=t.addExistingParam=t.otherIncomeId=t.incomeId=t.emailConfirmErrorMessaage=t.customEmailFieldId=t.emailFieldId=void 0,t.emailFieldId="emailaddress1",t.customEmailFieldId="emailaddressconfirm_custom",t.emailConfirmErrorMessaage="The email addresses you have entered do not match, please try again.",t.incomeId="kbnz_incomesourcetype",t.otherIncomeId="kbnz_othersourcedescription",t.addExistingParam="addExisting",t.ethnicityIds=["kbnz_ethnicity","kbnz_ethnicity2","kbnz_ethnicity3"],t.birthdateId="birthdate"},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filePrefix=t.locationIds=t.locationPreferenceIds=t.fieldRulesUrl=t.applicationStates=t.assetFieldIds=t.phoneFieldIds=t.stepType=t.contactType=t.pageType=void 0,t.pageType={APPLICATION_DETAILS:"phoapplicationdetails",ADDITIONAL_APPLICANT:"phoadditionalapplicant",ELIGIBILITY:"phoeligibility",SOURCEOFINCOME:"source-of-income",PROFILE:"profile",DEPENDENT:"dependent",SHARE_TRANSACTION:"share-transaction",SHARED_OWNERSHIP:"shared-ownership",DASHBOARD:"dashboard",CONTACT_US:"contact-us",MY_REQUESTS:"my-requests",GOALS_MANAGEMENT:"goals-management"},t.contactType={PRIMARY:"primary",ADDITIONAL:"additional"},t.stepType={A:"A",B:"B",C:"C"},t.phoneFieldIds=["telephone2","mobilephone"],t.assetFieldIds=["kbnz_moneyinbankaccounts","kbnz_sharesstocksandbonds","kbnz_buildingsocietyshares","kbnz_boatorcaravan","kbnz_investmentsinbanks","kbnz_othervehicles","kbnz_anyotherindividualassets"],t.applicationStates={allocated:"973770001",approved:"973770005",approvedInactive:"973770009",declined:"973770006",draft:"1",eligible:"973770004",expired:"973770008",inactive:"2",moreInfo:"973770002",resubmitted:"973770003",submitted:"973770000",withdrawn:"973770007"},t.fieldRulesUrl="/_odata/kbnz_fieldrules",t.locationPreferenceIds=["kbnz_primarylocation","kbnz_secondarylocation"],t.locationIds={AUCKLAND:"2b1c11aa-8286-e911-a97e-000d3ae13260",BAY_OF_PLENTY:"0f1c11aa-8286-e911-a97e-000d3ae13260",CANTERBURY:"211c11aa-8286-e911-a97e-000d3ae13260",GISBORNE:"111c11aa-8286-e911-a97e-000d3ae13260",HAWKES_BAY:"131c11aa-8286-e911-a97e-000d3ae13260",MANAWATU_WANGANUI:"171c11aa-8286-e911-a97e-000d3ae13260",MARLBOROUGH:"1f1c11aa-8286-e911-a97e-000d3ae13260",NELSON:"1d1c11aa-8286-e911-a97e-000d3ae13260",NORTHLAND:"0b1c11aa-8286-e911-a97e-000d3ae13260",SOUTHLAND:"291c11aa-8286-e911-a97e-000d3ae13260",OTAGO:"271c11aa-8286-e911-a97e-000d3ae13260",TARANAKI:"151c11aa-8286-e911-a97e-000d3ae13260",TASMAN:"1b1c11aa-8286-e911-a97e-000d3ae13260",WAIKATO:"0d1c11aa-8286-e911-a97e-000d3ae13260",WELLINGTON:"191c11aa-8286-e911-a97e-000d3ae13260",WEST_COAST:"231c11aa-8286-e911-a97e-000d3ae13260"},t.filePrefix="Uploaded to FHP: "},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.manageEthnicity=void 0;const o=a(0);t.manageEthnicity=()=>{Xrm.Portal.Form.get("kbnz_ethnicityother").setVisible(!1);for(let e of o.ethnicityIds)Xrm.Portal.Form.get(e).attachOnChange(n);n()};const n=()=>{for(let e=1;e<=13;e++)if(11!=e)for(let t of o.ethnicityIds)$(`#${t} option[value='${e}']`).show(),$(`#${t} option[value='${e}']`).removeAttr("disabled");let e=[];for(let t of o.ethnicityIds)e.push(Xrm.Portal.Form.get(t).getValue());let t=!1;e.includes("9")&&(t=!0),e.forEach((function(e,t){""!==e&&o.ethnicityIds.forEach((function(a,o){t!==o&&($(`#${a} option[value='${e}']`).hide(),$(`#${a} option[value='${e}']`).attr("disabled","disabled"))}))})),(e=>{Xrm.Portal.Form.get("kbnz_ethnicityother").setVisible(e),Xrm.Portal.Form.get("kbnz_ethnicityother").setRequired(e),e||Xrm.Portal.Form.get("kbnz_ethnicityother").setValue("")})(t)}},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.manageExistingAdditional=void 0;const o=a(0);t.manageExistingAdditional=(e,t)=>{$("#"+o.emailFieldId).on("change",n),$(`#${o.emailFieldId}_label`).parent().append(`
`,i(o.emailFieldId,e,t))};const n=()=>{const e=encodeURI("~/api-contact/?email="+Xrm.Portal.Form.get(o.emailFieldId).getValue());$.ajax({url:e}).done((function(e){e.count>0&&$(`#${o.emailFieldId}-modal`).modal("show")}))},i=(e,t,a)=>`\n