var PhoneUtils,GlobalFunctions,appaction,Constants,CCGApp;String.prototype.toTitleCase=function(){for(var e=this,r=e.split(" "),u=[],n,i,f,t=0;t<r.length;t++)n=r[t],i="",n.length>1&&(i=n.substring(1,n.length)),f=n.substring(0,1).toUpperCase()+i,u.push(f);return u.join(" ")};PhoneUtils={};PhoneUtils.isValidMobileAU=function(n){n!=undefined&&typeof n=="string"&&(n=n.replace(/\s*/g,""));return/^(04[0-9]{8}|([+]?614|04)[0-9]{8})$/.test(n)};PhoneUtils.isValidLandlineAU=function(n){n!=undefined&&typeof n=="string"&&(n=n.replace(/\s*/g,""));return/^([+]?61)?(\([0](2|3|7|8)\)|([0](2|3|7|8)))[1-9][0-9]{7}$/.test(n)};PhoneUtils.isValidSpecialNumberAU=function(n){n!=undefined&&typeof n=="string"&&(n=n.replace(/\s*/g,""));return/^(13[0-9]{4}|1300[0-9]{6}|1800[0-9]{6})$/.test(n)};PhoneUtils.isValidMobileNZ=function(n){n!=undefined&&typeof n=="string"&&(n=n.replace(/\s*/g,""));return/^(02[0-9]{7,9}|([+]?642|02)[0-9]{7,9})$/.test(n)};PhoneUtils.isValidLandlineNZ=function(n){n!=undefined&&typeof n=="string"&&(n=n.replace(/\s*/g,""));return/^((([+]?64)[3|4|6|7|9])|([0][3|4|6|7|9]))[0-9]{7}$/.test(n)};Date.prototype.copy=function(){return new Date(this.getTime())};Date.prototype.addMilliseconds=function(n){this.setMilliseconds(this.getMilliseconds()+n)};Date.prototype.addSeconds=function(n){this.setSeconds(this.getSeconds()+n)};Date.prototype.addDays=function(n){this.setDate(this.getDate()+n)};Date.prototype.addMonths=function(n){var t=this.getDate();this.setMonth(this.getMonth()+n);this.getDate()<t&&this.setDate(0)};Date.prototype.addYears=function(n){var t=this.getMonth();this.setFullYear(this.getFullYear()+n);t<this.getMonth()&&this.setDate(0)};Date.prototype.toDateString=function(){var n=this.getMonth(),t=this.getDate();return n=n+1,n<10&&(n="0"+n),t<10&&(t="0"+t),this.getFullYear()+"-"+n+"-"+t};Date.prototype.toAusDateString=function(){var n=this.getMonth(),t=this.getDate();return n=n+1,n<10&&(n="0"+n),t<10&&(t="0"+t),t+"/"+n+"/"+this.getFullYear()};Date.prototype.dateAddDays=function(n,t){return n.setDate(n.getDate()+t),n};Date.isLeapYear=function(n){return n%400==0?!0:n%100==0?!1:n%4==0?!0:!1};Date.isDateObject=function(n){return Object.prototype.toString.call(n)==="[object Date]"?isNaN(n.getTime())?!1:!0:!1};Date.isValidDate=function(n,t,i){return t<0||t>11?!1:i<1||i>31?!1:Date.isLeapYear(n)&&t==1?i>=1&&i<=29:!Date.isLeapYear(n)&&t==1&&i>28?!1:i>[31,28,31,30,31,30,31,31,30,31,30,31][t]?!1:!0};Date.getDateObjectFromString=function(n,t){var o,e,r,s,i,f;if(t=t||{},t.resolveMilleniumYear===undefined&&(t.resolveMilleniumYear=!0),o=new RegExp(/[0-9]{4,4}-[0-9]{1,2}-[0-9]{2,4}/),n&&typeof n=="string")if(e=n.split("/"),e&&e.length>2){if(!isNaN(e[0])&&!isNaN(e[1])&&!isNaN(e[2])){var i=parseInt(e[2],10),u=parseInt(e[1],10)-1,f=parseInt(e[0],10);if(t.resolveMilleniumYear===!0&&i<100&&(i=i<50?i+2e3:i+1900),Date.isValidDate(i,u,f))return new Date(i,u,f)}}else if(o.test(n)){if(r=n.split("-"),isNaN(r[0])||isNaN(r[1])||isNaN(r[2]))return new Date(n);var i=parseInt(r[0],10),u=parseInt(r[1],10)-1,f=parseInt(r[2],10);if(i<100&&r[0].length<4&&(f=parseInt(r[0],10),i=parseInt(r[2],10)),t.resolveMilleniumYear===!0&&i<100&&(i=i<50?i+2e3:i+1900),Date.isValidDate(i,u,f))return new Date(i,u,f)}else{var h=$.trim(n),r=h.split(" "),u=-1;if(r[1]!==undefined&&(s=r[1].toLowerCase(),u=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"].indexOf(s),!isNaN(r[0])&&u!=-1&&!isNaN(r[2])&&(i=parseInt(r[2],10),f=parseInt(r[0],10),Date.isValidDate(i,u,f))))return new Date(i,u,f)}return n};Date.getYearMonthDurationDisplayText=function(n,t){var f;if(n!==undefined){t=t||new Date;var i=0,r=0,u=n;do u.addYears(1),u<t&&i++;while(u<t);for(u.addYears(-1),i<0&&(i=0),i==0&&(u=n);u<t;)u.addMonths(1),r++;return r==12&&(r=0,i=1),f="",i>0&&(f=i>1?i.toString()+" years ":i.toString()+" year "),r>0?r>1?f+r.toString()+" months":f+r.toString()+" month":"Less than a month"}return""};Date.dateDiff=function(n,t){var i=t-n,r=parseInt(Math.round((t.getTime()-n.getTime())/864e5,0)),u=r*24,f=u*60,e=f*60,o=e*1e3;return isNaN(i)?NaN:{diff:i,ms:o,s:e,m:f,h:u,d:r}};Date.convertDateStringToFormat=function(n){var t=n,i=Date.getDateObjectFromString(n);return i instanceof Date&&(t=i.toDateString()),t};Date.convertDateStringIfTouchDevice=function(n){var t=n;return Modernizr&&Modernizr.touch&&(t=Date.convertDateStringToFormat(n,"yyyy-mm-dd")),t},function(){var n,t,i,u,f,r;n=jQuery;i=function(n){return Object.prototype.toString.call(n)==="[object Number]"&&isFinite(n)};r=function(n){var t;return n=n.toString().replace(/[$,\s]/g,""),t=parseFloat(n),i(t)?t:t==""?"":0};u=function(n){var t,i,r,e,f,u,o;for(e=Math.floor(n).toFixed().toString(),t=e.split("").reverse(),i=[];t.length>3;){for(r=f=1;f<=3;r=++f)i.push(t.shift());i.push(",")}for(u=0,o=t.length;u<o;u++)r=t[u],i.push(r);return i.reverse().join("")};f=function(n){return(n-Math.floor(n)).toFixed(2).replace(/\d*\./,"")};t=function(n){return i(n)?"$"+u(n)+"."+f(n):t(r(n))};isInArray=function(n,t){for(var i=0;i<n.length;i++)if(n[i]==t)return!0;return!1};isControlChar=function(n){var t=n;return t.which==0&&isInArray([9,13,35,36,37,39,46],t.keyCode)?!0:isInArray([8,13],t.which)?!0:!1};isCmdShortcut=function(n){var t=n;return t.ctrlKey&&isInArray([99,118,121,122],t.charCode)?!0:!1};isValidChar=function(n){return isControlChar(n)?!0:n.which==46||n.which>=48&&n.which<=57?!0:!1};isInteger=function(n){return isControlChar(n)?!0:n.which>=48&&n.which<=57?!0:!1};isValidBSB=function(n){return isControlChar(n)?!0:n.which==45||n.which>=48&&n.which<=57?!0:!1};n.fn.name=function(){return this.each(function(){return n(this).bind("keypress",function(n){if(isCmdShortcut(n)||isControlChar(n))return!0;var t=new RegExp(/[a-zA-Z' \-]/),i=String.fromCharCode(n.which),r=t.test(i);return r?!0:!1})})};n.fn.integer=function(){return this.each(function(){return n(this).bind("keypress",function(n){if(isCmdShortcut(n))return!0;isInteger(n)||n.preventDefault()})})};n.fn.bsbNumber=function(){return this.each(function(){return n(this).bind("keypress",function(n){if(isCmdShortcut(n))return!0;isValidBSB(n)||n.preventDefault()})})};n.fn.alpha=function(){return this.each(function(){return n(this).bind("keypress",function(n){if(isCmdShortcut(n)||isControlChar(n))return!0;var t=new RegExp(/[a-zA-Z0-9 _\.\-]/),i=String.fromCharCode(n.which),r=t.test(i);return r?!0:!1})})};n.fn.alpha2=function(){return this.each(function(){return n(this).bind("keypress",function(n){if(isCmdShortcut(n)||isControlChar(n))return!0;var t=new RegExp(/[?a-zA-Z0-9 _,!()$%@:;\.\-]/),i=String.fromCharCode(n.which),r=t.test(i);return r?!0:!1})})};n.fn.address=function(){return this.each(function(){return n(this).bind("keypress",function(n){if(isCmdShortcut(n)||isControlChar(n))return!0;var t=new RegExp(/[a-zA-Z0-9 _\.\-,/\(\)]/),i=String.fromCharCode(n.which),r=t.test(i);return r?!0:!1})})};n.fn.phone=function(){return this.each(function(){return n(this).bind("keypress",function(n){if(isCmdShortcut(n)||isControlChar(n))return!0;var t=new RegExp(/[0-9 +\-\(\)]/),i=String.fromCharCode(n.which),r=t.test(i);return r?!0:!1})})};n.fn.currency=function(i){var u=function(){};return i&&(u=i.beforeChange,afterChangeCallback=i.afterChange),this.each(function(){var i=this;return this.value!=undefined&&this.value!=""&&(this.value=t(this.value)),n(this).closest("form").bind("submit.currency",function(){return i.value!=undefined&&i.value!=""&&(i.value=r(i.value)),!0}),n(this).bind("blur.currency",function(){return typeof u=="function"&&u(),i.value!=undefined&&i.value!=""&&(i.value=t(i.value)),typeof afterChangeCallback=="function"&&afterChangeCallback(),i.value}).bind("blur",function(){return typeof u=="function"&&u(),i.value!=undefined&&i.value!=""&&(i.value=t(i.value)),typeof afterChangeCallback=="function"&&afterChangeCallback(),i.value}).bind("keypress",function(n){if(isCmdShortcut(n))return!0;isValidChar(n)||n.preventDefault()})})}}.call(this);CCGApp=CCGApp||{};CCGApp.WalletWizardAPI=function(n){function t(t,i){t=t||{};var r=n("#requestSMSCodeContainer").val();i&&typeof i.successCallback=="function"&&i.successCallback(r)}function i(t,i){var r=n("#returningCustomerLoginFieldContainer").val();i&&typeof i.successCallback=="function"&&i.successCallback(r)}function r(t,i){t=t||{};var r=n("#newCustomerNewPasswordContainer").val();i&&typeof i.successCallback=="function"&&i.successCallback(r)}function u(t,i){var r=n("#wrongCountryContainer").val();i&&typeof i.successCallback=="function"&&i.successCallback(r)}function f(t,i){t=t||{};n.ajax({type:"POST",url:"/umbraco/surface/LoanApplicationSurface/HandleRequestSMSCode",data:{token:t.token,workflow:t.workflow},beforeSend:function(n,t){i&&typeof i.beforeSendCallback=="function"&&i.beforeSendCallback(n,t)},success:function(n){i&&typeof i.successCallback=="function"&&i.successCallback(n)},error:function(n,t,r){i&&typeof i.errorCallback=="function"&&i.errorCallback(n,t,r)}})}function e(t,i){t=t||{};n.ajax({type:"POST",url:"/umbraco/surface/LoanApplicationSurface/HandleResendSMSCode",data:{token:t.token,workflow:t.workflow},beforeSend:function(n,t){i&&typeof i.beforeSendCallback=="function"&&i.beforeSendCallback(n,t)},success:function(n){i&&typeof i.successCallback=="function"&&i.successCallback(n)},error:function(n,t,r){i&&typeof i.errorCallback=="function"&&i.errorCallback(n,t,r)}})}function o(t,i){t=t||{};n.ajax({type:"POST",url:"/umbraco/surface/LoanApplicationSurface/HandleVerifySMSCode",data:{token:t.token,pin:t.pinCode,workflow:t.workflow},beforeSend:function(n,t){i&&typeof i.beforeSendCallback=="function"&&i.beforeSendCallback(n,t)},success:function(n){i&&typeof i.successCallback=="function"&&i.successCallback(n)},error:function(n,t,r){i&&typeof i.errorCallback=="function"&&i.errorCallback(n,t,r)}})}function s(t,i){n.ajax({type:"POST",url:"/umbraco/surface/LoanApplicationSurface/HandleSetupCustomerAccount",data:{token:t.token,password:t.password,customerType:t.customerType},beforeSend:function(n,t){i&&typeof i.beforeSendCallback=="function"&&i.beforeSendCallback(n,t)},success:function(n){i&&typeof i.successCallback=="function"&&i.successCallback(n)}})}function h(t,i){t=t||{};n.ajax({type:"POST",url:"/api/loans/LookupCustomer",dataType:"json",contentType:"application/json",timeout:12e4,data:JSON.stringify({EmailAddress:t.emailAddress,DateOfBirth:t.dob,Lastname:t.lastname}),success:function(n){i&&typeof i.successCallback=="function"&&i.successCallback(n)},error:function(n,t,r){i&&typeof i.errorCallback=="function"&&i.errorCallback(n,t,r)}})}function c(t,i){t=t||{};n.ajax({type:"POST",url:"/umbraco/surface/MemberAreaSurface/HandleRegisterMember",data:t.formDataAsJson,success:function(n){i&&typeof i.successCallback=="function"&&i.successCallback(n)}})}function l(t,i){t=t||{};n.ajax({type:"POST",url:"/umbraco/surface/MemberAreaSurface/HandleRegisterCustomerFinalStep",data:t.formDataAsJson,success:function(n){i&&typeof i.successCallback=="function"&&i.successCallback(n)}})}function a(t,i){t=t||{};n.ajax({type:"POST",url:"/umbraco/surface/LoanApplicationSurface/HandleReturningCustomerLogin",data:{email:t.email,password:t.password},success:function(n){i&&typeof i.successCallback=="function"&&i.successCallback(n)}})}function v(t,i){n.ajax({url:"/api/loans/LookupBankBranch",type:"GET",contentType:"text/json",data:{input:t},cache:!1,timeout:2e4,dataType:"json",success:function(n,t,r){i&&typeof i.successCallback=="function"&&i.successCallback(n,t,r)}}).done(function(n,t,r){i&&typeof i.doneCallback=="function"&&i.doneCallback(n,t,r)}).error(function(n,t,r){i&&typeof i.errorCallback=="function"&&i.errorCallback(n,t,r)}).fail(function(n,t,r){i&&typeof i.failCallback=="function"&&i.failCallback(n,t,r)})}function y(t,i){t=t||{};t.bankId&&t.loanAppId&&n.ajax({url:"/api/loans/GetBankFields",type:"POST",cache:!1,timeout:3e4,contentType:"application/json",dataType:"json",data:JSON.stringify({bankId:t.bankId}),beforeSend:function(){i&&typeof i.beforeSendCallback=="function"&&i.beforeSendCallback()},success:function(n,t,r){i&&typeof i.successCallback=="function"&&i.successCallback(n,t,r)}}).done(function(n,t,r){i&&typeof i.doneCallback=="function"&&i.doneCallback(n,t,r)}).error(function(n,t,r){i&&typeof i.errorCallback=="function"&&i.errorCallback(n,t,r)}).fail(function(n,t,r){i&&typeof i.failCallback=="function"&&i.failCallback(n,t,r)})}function p(t,i){if(t=t||{},t.bankId){var r=n("#"+t.formId);r.length>0&&(r.validate({errorClass:"application-form-error"}),r.valid()&&n.ajax({url:"/api/loans/AddItem",type:"POST",cache:!1,data:r.serialize(),dataType:"json",beforeSend:function(){i&&typeof i.beforeSendCallback=="function"&&i.beforeSendCallback()},success:function(n,t,r){i&&typeof i.successCallback=="function"&&i.successCallback(n,t,r)}}).done(function(n,t,r){i&&typeof i.doneCallback=="function"&&i.doneCallback(n,t,r)}))}}function w(t,i){t=t||{};n.ajax({type:"POST",url:"/api/loans/GetLoanAssessmentResult",cache:!1,contentType:"application/json",dataType:"json",data:JSON.stringify({aid:t.aid}),success:function(n,t,r){i&&typeof i.successCallback=="function"&&i.successCallback(n,t,r)}}).done(function(n,t,r){i&&typeof i.doneCallback=="function"&&i.doneCallback(n,t,r)}).error(function(n,t,r){i&&typeof i.errorCallback=="function"&&i.errorCallback(n,t,r)}).fail(function(n,t,r){i&&typeof i.failCallback=="function"&&i.failCallback(n,t,r)})}function b(t,i){t=t||{};t.searchInput.length>4&&n.ajax({url:"/api/addressLookup/GetPossibleMatches",type:"POST",contentType:"text/json",cache:!1,dataType:"json",data:n.toJSON({input:t.searchInput}),success:function(n,t,r){i&&typeof i.successCallback=="function"&&i.successCallback(n,t,r)}}).done(function(n,t,r){i&&typeof i.doneCallback=="function"&&i.doneCallback(n,t,r)}).error(function(n,t,r){i&&typeof i.errorCallback=="function"&&i.errorCallback(n,t,r)}).fail(function(n,t,r){i&&typeof i.failCallback=="function"&&i.failCallback(n,t,r)})}function k(t,i){t=t||{};t.reference&&n.ajax({url:"/api/addressLookup/GetParts",type:"POST",contentType:"text/json",cache:!1,dataType:"json",data:n.toJSON({reference:t.reference}),success:function(n,t,r){i&&typeof i.successCallback=="function"&&i.successCallback(n,t,r)}}).done(function(n,t,r){i&&typeof i.doneCallback=="function"&&i.doneCallback(n,t,r)}).error(function(n,t,r){i&&typeof i.errorCallback=="function"&&i.errorCallback(n,t,r)}).fail(function(n,t,r){i&&typeof i.failCallback=="function"&&i.failCallback(n,t,r)})}function d(n,t,i,r){t=t||"";i=i||"";r=r||"";var f=t+"_"+i+"_"+r+"_flag",u=t+"_"+i+"_"+r+"_interval";n[f]=!1;n[u]=setInterval(function(){typeof ga=="function"&&(ga("wwEventTracker.send","event",t,i,r),n[f]=!0,n[u]!==undefined&&(n.clearInterval(n[u]),n[u]=undefined))},1e3)}return{getRequestSMSCodeInputFields:t,getReturningCustomerLoginFields:i,getNewPasswordInputFields:r,getWrongCountryView:u,requestSMSCode:f,resendSMSCode:e,verifySMSCode:o,registerUser:c,doReturningCustomerLogin:a,registerUserFinalStep:l,setupCustomerAccount:s,lookupCustomer:h,lookupBankBranch:v,getYodleeBankFields:y,addBankAccount:p,getLoanAssessmentResult:w,addressServiceGetPossibleMatches:b,addressServiceParseAddressParts:k,sendGoogleAnalyticsTrackingEventForAppForm:d}}(jQuery,ko);GlobalFunctions={};GlobalFunctions.enableLogging=!1;GlobalFunctions.undefinedToEmptyString=function(n){return n==undefined?"":n};GlobalFunctions.isUndefinedOrEmptyString=function(n){return n==undefined||n==""};GlobalFunctions.log=function(n){GlobalFunctions.enableLogging&&typeof console!="undefined"&&typeof console.log=="function"&&console.log(n)};GlobalFunctions.useSelfOrDefaultValue=function(n,t,i){return i===!0&&n===undefined?t:n};GlobalFunctions.isIE8=function(){var n=window.navigator.userAgent.indexOf("MSIE 8.0");return n!=-1};GlobalFunctions.isValidDate=function(n,t,i){var n=parseInt(n||"0",10),t=parseInt(t||"0",10),i=parseInt(i||"0",10);return n<1900?!1:(t-=1,t<0&&(t=0),Date.isValidDate(n,t,i))};GlobalFunctions.isValidDOBInternal=function(n,t,i){var r=!0,u;try{u=(n||"").toString().length>0&&(t||"").toString().length>0&&(i||"").toString().length>0;r=u?GlobalFunctions.isValidDate(n,t,i):!1}catch(f){r=!1}return r};GlobalFunctions.currencyToDecimal=function(n){return n&&n.replace?n.replace(/[$,]/g,""):n};GlobalFunctions.formatCurrency=function(n){if(n!==undefined&&!isNaN(n))return n>=0?"$"+n.toFixed(2):"-$"+(-1*n).toFixed(2)};GlobalFunctions.convertAmount=function(n,t,i){var r,u;return(amount=parseFloat(GlobalFunctions.currencyToDecimal(n)),t&&(t=t.toString()),i&&(i=i.toString()),isNaN(t)||isNaN(i))?amount:t==i?amount:(r=[],r[Constants.PAYMENT_FREQUENCY_WEEKLY.toString()+"_"+Constants.PAYMENT_FREQUENCY_FORTNIGHTLY.toString()]=.5,r[Constants.PAYMENT_FREQUENCY_WEEKLY.toString()+"_"+Constants.PAYMENT_FREQUENCY_MONTHLY.toString()]=4.33,r[Constants.PAYMENT_FREQUENCY_FORTNIGHTLY.toString()+"_"+Constants.PAYMENT_FREQUENCY_WEEKLY.toString()]=2,r[Constants.PAYMENT_FREQUENCY_FORTNIGHTLY.toString()+"_"+Constants.PAYMENT_FREQUENCY_MONTHLY.toString()]=2.165,r[Constants.PAYMENT_FREQUENCY_MONTHLY.toString()+"_"+Constants.PAYMENT_FREQUENCY_WEEKLY.toString()]=1/4.33,r[Constants.PAYMENT_FREQUENCY_MONTHLY.toString()+"_"+Constants.PAYMENT_FREQUENCY_FORTNIGHTLY.toString()]=1/2.165,u=r[t.toString()+"_"+i.toString()],amount*u)};GlobalFunctions.convertPaymentFrequencyToText=function(n){return n==Constants.PAYMENT_FREQUENCY_FORTNIGHTLY?"fortnightly":n==Constants.PAYMENT_FREQUENCY_WEEKLY?"weekly":n==Constants.PAYMENT_FREQUENCY_MONTHLY?"monthly":""};GlobalFunctions.getTimeDurationText=function(n,t){var i=[];return n<0||t<0?"Invalid date range":(n>0&&(n>1?i.push(n.toString()+" years"):i.push(n.toString()+" year")),t>0?t>1?i.push(t.toString()+" months"):i.push(t.toString()+" month"):t==0&&i.length==0&&(i=["Less than a month"]),i.join(" and "))};GlobalFunctions.nTh=function(n,t){return n==1||Math.floor(n/10)==1&&n!=11?"1st "+t:n==2||Math.floor(n/10)==2&&n!=12?"2nd "+t:n==3||Math.floor(n/10)==3&&n!=13?"3rd "+t:n+"th "+t};GlobalFunctions.isInArray=function(n,t){for(var i=0;i<t.length;i++)if(n==t[i])return!0;return!1};GlobalFunctions.defaultToValueIfUndefined=function(n){return n===undefined?!0:n};GlobalFunctions.trackGoogleAnalyticsPageView=function(n){typeof _gaq!="undefined"&&_gaq.push(["_trackPageview",n])};GlobalFunctions.getDoBDate=function(n){var i=new Date,t=new Date(i),r;return t.setYear(t.getYear()-20),n=="yyyy-mm-dd"?t.getFullYear()+"-"+("0"+(t.getMonth()+1)).slice(-2)+"-"+("0"+t.getDate()).slice(-2):("0"+t.getDate()).slice(-2)+"-"+("0"+(t.getMonth()+1)).slice(-2)+"-"+t.getFullYear()};appaction=function(n,t,i){this.value=n;this.label=t;this.group=i};Constants={};Constants.YES="Y";Constants.NO="N";Constants.OVERALL_STATUS_APPROVED="Approved";Constants.OVERALL_STATUS_REFERRED="Referred";Constants.OVERALL_STATUS_DECLINED="Declined";Constants.QUALIFYING_CONDITION_DECLINED_NON_PERMANENT_RESIDENT="Declined - Not Permanent Resident";Constants.QUALIFYING_CONDITION_DECLINED_NON_MIN_AGE="Declined - Below Minimum Age";Constants.QUALIFYING_CONDITION_DECLINED_SINGLE_AND_BELOW_THRESHOLD="Declined - Single, capacity below threshold (-$100)";Constants.QUALIFYING_CONDITION_APPROVED="Approved";Constants.QUALIFYING_CONDITION_REFERRED_BANKRUPT="Referred - Bankrupt";Constants.QUALIFYING_CONDITION_REFERRED_UNEMPLOYED="Referred - Unemployed";Constants.QUALIFYING_CONDITION_REFERRED_CASH_IN_HAND="Referred - Cash in Hand";Constants.QUALIFYING_CONDITION_REFERRED_PARTNERED_CAPACITY_BELOW_THRESHOLD="Referred - Partnered, capacity below threshold (-$100)";Constants.QUALIFYING_CONDITION_REFERRED_CAPACITY_WITHIN_BUFFER="Referred - Capacity within buffer (-$100 to $100)";Constants.FIELD_CAPTION_EMPLOYMENT_INCOME="Employment Income";Constants.FIELD_CAPTION_GOVERNMENT_BENEFITS="Government Benefits";Constants.TOOLTIP_EMPLOYMENT_INCOME="Do not include income you receive from government benefits here. If you receive government benefits, please indicate the amount in the next row.";Constants.TOOLTIP_GOVERNMENT_BENEFITS="This is only for government benefits (excluding Child Support Agency payments). If you don’t receive Government Benefits, please leave this blank.";Constants.QUALIFYING_CONDITION_RULE_VS_STATUS_MAP=[];Constants.QUALIFYING_CONDITION_RULE_VS_STATUS_MAP[Constants.QUALIFYING_CONDITION_DECLINED_NON_PERMANENT_RESIDENT]=Constants.OVERALL_STATUS_DECLINED;Constants.QUALIFYING_CONDITION_RULE_VS_STATUS_MAP[Constants.QUALIFYING_CONDITION_DECLINED_NON_MIN_AGE]=Constants.OVERALL_STATUS_DECLINED;Constants.QUALIFYING_CONDITION_RULE_VS_STATUS_MAP[Constants.QUALIFYING_CONDITION_DECLINED_SINGLE_AND_BELOW_THRESHOLD]=Constants.OVERALL_STATUS_DECLINED;Constants.QUALIFYING_CONDITION_RULE_VS_STATUS_MAP[Constants.QUALIFYING_CONDITION_APPROVED]=Constants.OVERALL_STATUS_APPROVED;Constants.QUALIFYING_CONDITION_RULE_VS_STATUS_MAP[Constants.QUALIFYING_CONDITION_REFERRED_BANKRUPT]=Constants.OVERALL_STATUS_REFERRED;Constants.QUALIFYING_CONDITION_RULE_VS_STATUS_MAP[Constants.QUALIFYING_CONDITION_REFERRED_UNEMPLOYED]=Constants.OVERALL_STATUS_REFERRED;Constants.QUALIFYING_CONDITION_RULE_VS_STATUS_MAP[Constants.QUALIFYING_CONDITION_REFERRED_CASH_IN_HAND]=Constants.OVERALL_STATUS_REFERRED;Constants.QUALIFYING_CONDITION_RULE_VS_STATUS_MAP[Constants.QUALIFYING_CONDITION_REFERRED_PARTNERED_CAPACITY_BELOW_THRESHOLD]=Constants.OVERALL_STATUS_REFERRED;Constants.QUALIFYING_CONDITION_RULE_VS_STATUS_MAP[Constants.QUALIFYING_CONDITION_REFERRED_CAPACITY_WITHIN_BUFFER]=Constants.OVERALL_STATUS_REFERRED;Constants.HOUSING_INDIVIDUAL=571;Constants.HOUSING_COUPLE=627;Constants.HOUSING_PER_CHILD=57;Constants.LIVING_INDIVIDUAL=1174;Constants.LIVING_COUPLE=1707;Constants.LIVING_FIRST_CHILD_OR_DEPENDENT=438;Constants.LIVING_OTHER_DEPENDENTS=415;Constants.CREDIT_CARD_MIN_PAYMENT_PERCENT=.03;Constants.APPLICATION_FEE=45;Constants.PAYMENT_FREQUENCY_MONTHLY=15;Constants.PAYMENT_FREQUENCY_FORTNIGHTLY=12;Constants.PAYMENT_FREQUENCY_WEEKLY=11;Constants.TITLE_MR="Mr";Constants.TITLE_MISS="Miss";Constants.TITLE_MRS="Mrs";Constants.TITLE_MS="Ms";Constants.TITLE_DR="Dr";Constants.LOAN_PURPOSE_BILLS=162;Constants.LOAN_PURPOSE_CAR_PURCHASE=38;Constants.LOAN_PURPOSE_CAR_REGO=163;Constants.LOAN_PURPOSE_DEBT_CONSOLIDATION=39;Constants.LOAN_PURPOSE_DEBT_REPAYMENT=20;Constants.LOAN_PURPOSE_ENTERTAINMENT_LEISURE=16;Constants.LOAN_PURPOSE_FUNERAL=164;Constants.LOAN_PURPOSE_HOUSEHOLD_PERSONAL_GOODS=40;Constants.LOAN_PURPOSE_TRAVAL_HOLIDAY=41;Constants.LOAN_PURPOSE_RENOVATIONS_ALTERATIONS=42;Constants.LOAN_PURPOSE_MEDICAL_EXPENSES=43;Constants.LOAN_PURPOSE_TEMPORARY_CASH_SHORTFALL=29;Constants.LOAN_PURPOSE_VET_EXPENSES=170;Constants.LOAN_PURPOSE_WEDDING=44;Constants.LOAN_PURPOSE_OTHER=21;Constants.LOAN_PURPOSE_CAR_LOAN=38;Constants.LOAN_PURPOSE_MOTORBIKE_LOAN=204;Constants.LOAN_PURPOSE_BOAT_JETSKI_LOAN=205;Constants.LOAN_PURPOSE_CARAVAN_LOAN=206;Constants.LOAN_PURPOSE_EQUIPMENT_BUSINESS_LOAN=207;Constants.REPAYMENT_TERM_36MONTHS=1036;Constants.REPAYMENT_TERM_48MONTHS=1048;Constants.REPAYMENT_TERM_60MONTHS=1060;Constants.REPAYMENT_TERM_72MONTHS=1072;Constants.REPAYMENT_TERM_84MONTHS=1084;Constants.LOAN_PURPOSE_BILLS=162;Constants.LOAN_PURPOSE_CAR_REGISTRATION_AND_OTHER=163;Constants.LOAN_PURPOSE_FUNERAL=164;Constants.LOAN_PURPOSE_REPAIRS=165;Constants.LOAN_PURPOSE_VET_EXPENSES=170;Constants.LOAN_PURPOSE_DEBT_REPAYMENT=171;Constants.LOAN_PURPOSE_HOUSEHOLD_BILLS=201;Constants.LOAN_PURPOSE_HOUSEHOLD_KITCHENWARE_SMALL_ELECTRICAL=173;Constants.LOAN_PURPOSE_HOUSEHOLD_CLOTHING=174;Constants.LOAN_PURPOSE_HOUSEHOLD_WHITEGOODS_ENTERTAINMENT_AV=175;Constants.LOAN_PURPOSE_HOUSEHOLD_FURNITURE=176;Constants.LOAN_PURPOSE_HOUSEHOLD_COMPUTERPURCHASE=177;Constants.LOAN_PURPOSE_HOUSEHOLD_HOME_MAINTENANCE=178;Constants.LOAN_PURPOSE_HOUSEHOLD_LANDSCAPING_RENOVATIONS=179;Constants.LOAN_PURPOSE_HOUSEHOLD_RENTALBOND=180;Constants.LOAN_PURPOSE_HOUSEHOLD_RELOCATION=181;Constants.LOAN_PURPOSE_CAR_REPAIRS_IMPROVEMENTS=182;Constants.LOAN_PURPOSE_CAR_REGISTRATION_FINES_INSURANCE=202;Constants.LOAN_PURPOSE_TRAVAL_HOLIDAY_SPENDINGMONEY=183;Constants.LOAN_PURPOSE_TRAVAL_HOLIDAY_AIRFARES_OR_ACCOMMODATION=184;Constants.LOAN_PURPOSE_TRAVAL_HOLIDAY_OVERSEAS_TRAVEL=185;Constants.LOAN_PURPOSE_GIFTS_WEDDING_CHRISTMAS_BIRTHDAY=186;Constants.LOAN_PURPOSE_EVENT_WEDDING_GOWN_SUIT_HIRE=187;Constants.LOAN_PURPOSE_EVENT_WEDDING_RECEPTION=188;Constants.LOAN_PURPOSE_EVENT_WEDDING_SUPPLIER_COSTS=189;Constants.LOAN_PURPOSE_EVENT_CONCERT_SPORTING_TICKETS=190;Constants.LOAN_PURPOSE_EVENT_PART_HOSTING_COSTS=191;Constants.LOAN_PURPOSE_EDUCATION_EMPLOYMENT_TEXTBOOKS=192;Constants.LOAN_PURPOSE_EDUCATION_EMPLOYMENT_BUSINESS_CLOTHING=193;Constants.LOAN_PURPOSE_EDUCATION_EMPLOYMENT_OFFICE_EQUIPMENT_SUPPLIES=194;Constants.LOAN_PURPOSE_EDUCATION_EMPLOYMENT_SCHOOL_COURSE_FEES=195;Constants.LOAN_PURPOSE_HEALTH_FITNESS_EQUIPMENT_OR_MEMBESHIP=196;Constants.LOAN_PURPOSE_HEALTH_MEDICAL_SPECIALIST_FEES=197;Constants.LOAN_PURPOSE_HEALTH_HOSPITAL_EXPENSES=198;Constants.LOAN_PURPOSE_PET_PURCHASE_ASSOCIATED_COSTS=199;Constants.LOAN_PURPOSE_PET_VETERINARY_COSTS=200;Constants.CONTACT_TYPE_MOBILE=4;Constants.CONTACT_TYPE_HOME=6;Constants.CONTACT_TYPE_WORK=7;Constants.CONTACT_TYPE_EMAIL=37;Constants.INCOME_SOURCE_FULLTIME=22;Constants.INCOME_SOURCE_PARTTIME=23;Constants.INCOME_SOURCE_CASUAL=24;Constants.INCOME_SOURCE_SELF_EMPLOYED=25;Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT=26;Constants.INCOME_SOURCE_GENERAL_EMPLOYMENT=30;Constants.INCOME_SOURCE_CASH_IN_HAND=63;Constants.INCOME_SOURCE_SEASONAL=64;Constants.INCOME_SOURCE_INVESTMENT=45;Constants.INCOME_SOURCE_SECOND_JOB=46;Constants.INCOME_SOURCE_BENEFITS=47;Constants.INCOME_SOURCE_PARTNER_INCOME=48;Constants.INCOME_SOURCE_CHILD_SUPPORT=49;Constants.INCOME_SOURCE_OTHER=65;Constants.EMPLOYMENT_STATUS_CASH_IN_HAND=107;Constants.EMPLOYMENT_STATUS_CASUAL=108;Constants.EMPLOYMENT_STATUS_FULLTIME=109;Constants.EMPLOYMENT_STATUS_PARTTIME=110;Constants.EMPLOYMENT_STATUS_SELF_EMPLOYED=111;Constants.EMPLOYMENT_STATUS_SUBCONTRACTOR=172;Constants.EMPLOYMENT_STATUS_SEASONAL=112;Constants.EMPLOYMENT_STATUS_UNEMPLOYED=113;Constants.FIXED_LOAN_LOAN_PAYMENT=76;Constants.FIXED_LOAN_RENTAL_AGREEMENT=77;Constants.FIXED_LOAN_CAR_LOAN=78;Constants.FIXED_LOAN_OTHER=79;Constants.OCCUPATION_TYPE_ARMED_FORCES=118;Constants.OCCUPATION_TYPE_EXECUTIVE_PROFESSIONAL=119;Constants.OCCUPATION_TYPE_LABOURER=120;Constants.OCCUPATION_TYPE_OFFICE_CLERICAL=121;Constants.OCCUPATION_TYPE_RETAIL=122;Constants.OCCUPATION_TYPE_SALES=123;Constants.OCCUPATION_TYPE_SKILLED_TRADE=124;Constants.OCCUPATION_TYPE_UNEMPLOYED=125;Constants.ASSET_TYPE_CAR=80;Constants.ASSET_TYPE_CONTENTS=81;Constants.ASSET_TYPE_HOUSE=82;Constants.ASSET_TYPE_MOTORCYCLE=83;Constants.ASSET_TYPE_BOAT=84;Constants.CUSTOMER_CHANNEL_SOURCE_LETTER=126;Constants.CUSTOMER_CHANNEL_SOURCE_PHONE_CALL=127;Constants.CUSTOMER_CHANNEL_SOURCE_GOOGLE_SEARCH=128;Constants.CUSTOMER_CHANNEL_SOURCE_WEB_BANNER=129;Constants.CUSTOMER_CHANNEL_SOURCE_EMAIL=130;Constants.CUSTOMER_CHANNEL_SOURCE_WORD_OF_MOUTH=131;Constants.CUSTOMER_CHANNEL_SOURCE_OTHER=132;Constants.RELATIONSHIP_TYPE_BROTHER=85;Constants.RELATIONSHIP_TYPE_BROTHER_IN_LAW=86;Constants.RELATIONSHIP_TYPE_COLLEAGUE=87;Constants.RELATIONSHIP_TYPE_COUSIN=88;Constants.RELATIONSHIP_TYPE_DAUGHTER=89;Constants.RELATIONSHIP_TYPE_DAUGHTER_IN_LAW=90;Constants.RELATIONSHIP_TYPE_DE_FACTO=91;Constants.RELATIONSHIP_TYPE_FATHER=92;Constants.RELATIONSHIP_TYPE_FATHER_IN_LAW=93;Constants.RELATIONSHIP_TYPE_FRIEND=94;Constants.RELATIONSHIP_TYPE_GRANDFATHER=95;Constants.RELATIONSHIP_TYPE_GRANDMOTHER=96;Constants.RELATIONSHIP_TYPE_HUSBAND=97;Constants.RELATIONSHIP_TYPE_MOTHER=98;Constants.RELATIONSHIP_TYPE_MOTHER_IN_LAW=99;Constants.RELATIONSHIP_TYPE_NEIGHBOUR=100;Constants.RELATIONSHIP_TYPE_NEPHEW=101;Constants.RELATIONSHIP_TYPE_NIECE=102;Constants.RELATIONSHIP_TYPE_SISTER=103;Constants.RELATIONSHIP_TYPE_SON=104;Constants.RELATIONSHIP_TYPE_SON_IN_LAW=105;Constants.RELATIONSHIP_TYPE_WIFE=106;Constants.MARITAL_STATUS_SINGLE=58;Constants.MARITAL_STATUS_MARRIED=59;Constants.MARITAL_STATUS_DEFACTO=60;Constants.MARITAL_STATUS_DIVORCED=61;Constants.MARITAL_STATUS_WIDOWED=62;Constants.MARITAL_STATUS_SEPARATED=114;Constants.MARITAL_STATUS_OTHER=115;Constants.RESIDENTIAL_STATUS_OWN_OUTRIGHT=50;Constants.RESIDENTIAL_STATUS_OWN_BUYING=51;Constants.RESIDENTIAL_STATUS_OWN_RENTING=52;Constants.RESIDENTIAL_STATUS_OWN_BOARDING=53;Constants.RESIDENTIAL_STATUS_OWN_EMPLOYER_PROVIDED=54;Constants.RESIDENTIAL_STATUS_OWN_LIVING_AT_HOME=55;Constants.RESIDENTIAL_STATUS_OWN_CARAVAN=56;Constants.RESIDENTIAL_STATUS_OWN_HOSTEL=57;Constants.RESIDENTIAL_STATUSES=[{code:Constants.RESIDENTIAL_STATUS_OWN_OUTRIGHT,name:"Own Outright"},{code:Constants.RESIDENTIAL_STATUS_OWN_BUYING,name:"Own Buying"},{code:Constants.RESIDENTIAL_STATUS_OWN_RENTING,name:"Renting"},{code:Constants.RESIDENTIAL_STATUS_OWN_LIVING_AT_HOME,name:"Living at Home"},{code:Constants.RESIDENTIAL_STATUS_OWN_EMPLOYER_PROVIDED,name:"Employer Provided"},{code:Constants.RESIDENTIAL_STATUS_OWN_BOARDING,name:"Boarding"},{code:Constants.RESIDENTIAL_STATUS_OWN_CARAVAN,name:"Caravan"},{code:Constants.RESIDENTIAL_STATUS_OWN_HOSTEL,name:"Hostel"}];Constants.MARITAL_STATUSES=[{code:Constants.MARITAL_STATUS_SINGLE,name:"Single"},{code:Constants.MARITAL_STATUS_MARRIED,name:"Married"},{code:Constants.MARITAL_STATUS_DEFACTO,name:"De Facto"},{code:Constants.MARITAL_STATUS_DIVORCED,name:"Divorced"},{code:Constants.MARITAL_STATUS_SEPARATED,name:"Separated"},{code:Constants.MARITAL_STATUS_WIDOWED,name:"Widowed"}];Constants.MAX_NUMBER_OF_DEPENDENTS=4;Constants.NUMBER_OF_DEPENDENTS=[{code:0,name:"0"},{code:1,name:"1"},{code:2,name:"2"},{code:3,name:"3"},{code:Constants.MAX_NUMBER_OF_DEPENDENTS,name:"4+"}];Constants.DURATION_YEARS=[{code:0,name:"0"},{code:1,name:"1"},{code:2,name:"2"},{code:3,name:"3"},{code:4,name:"4"},{code:5,name:"5"},{code:6,name:"6"},{code:7,name:"7"},{code:8,name:"8"},{code:9,name:"9"},{code:10,name:"10+"}];Constants.DURATION_MONTHS=[{code:0,name:"0"},{code:1,name:"1"},{code:2,name:"2"},{code:3,name:"3"},{code:4,name:"4"},{code:5,name:"5"},{code:6,name:"6"},{code:7,name:"7"},{code:8,name:"8"},{code:9,name:"9"},{code:10,name:"10"},{code:11,name:"11"},{code:12,name:"12"}];Constants.MONTHS=[{code:1,name:"Jan"},{code:2,name:"Feb"},{code:3,name:"Mar"},{code:4,name:"Apr"},{code:5,name:"May"},{code:6,name:"Jun"},{code:7,name:"Jul"},{code:8,name:"Aug"},{code:9,name:"Sep"},{code:10,name:"Oct"},{code:11,name:"Nov"},{code:12,name:"Dec"}];Constants.TITLES=[{code:Constants.TITLE_MR,name:"Mr"},{code:Constants.TITLE_MRS,name:"Mrs"},{code:Constants.TITLE_MS,name:"Ms"},{code:Constants.TITLE_MISS,name:"Miss"},{code:Constants.TITLE_DR,name:"Dr"}];Constants.LOAN_PURPOSE_CHOICES_SACC1=[{code:Constants.LOAN_PURPOSE_HOUSEHOLD_BILLS,name:"Household - Bills"},{code:Constants.LOAN_PURPOSE_HOUSEHOLD_KITCHENWARE_SMALL_ELECTRICAL,name:"Household - Kitchenware/Small Electrical"},{code:Constants.LOAN_PURPOSE_HOUSEHOLD_CLOTHING,name:"Household - Clothing"},{code:Constants.LOAN_PURPOSE_CAR_REGISTRATION_FINES_INSURANCE,name:"Car - Registration, Fines or Insurance"},{code:Constants.LOAN_PURPOSE_TRAVAL_HOLIDAY_SPENDINGMONEY,name:"Holiday - Vacation Spending Money"},{code:Constants.LOAN_PURPOSE_GIFTS_WEDDING_CHRISTMAS_BIRTHDAY,name:"Gifts - Wedding/Christmas/Birthday"},{code:Constants.LOAN_PURPOSE_EVENT_CONCERT_SPORTING_TICKETS,name:"Event - Concert/Sporting Tickets"},{code:Constants.LOAN_PURPOSE_EDUCATION_EMPLOYMENT_TEXTBOOKS,name:"Education/Employment - Textbooks"},{code:Constants.LOAN_PURPOSE_HEALTH_FITNESS_EQUIPMENT_OR_MEMBESHIP,name:"Health & Wellbeing - Fitness/Sports Equipment or Membership"},{code:Constants.LOAN_PURPOSE_OTHER,name:"Other - We will contact you to discuss your requirements"}];Constants.LOAN_PURPOSE_CHOICES_SACC2=[{code:Constants.LOAN_PURPOSE_HOUSEHOLD_WHITEGOODS_ENTERTAINMENT_AV,name:"Household - Whitegoods/Entertainment/AV"},{code:Constants.LOAN_PURPOSE_HOUSEHOLD_FURNITURE,name:"Household - Furniture"},{code:Constants.LOAN_PURPOSE_HOUSEHOLD_COMPUTERPURCHASE,name:"Household - Computer Purchase"},{code:Constants.LOAN_PURPOSE_HOUSEHOLD_HOME_MAINTENANCE,name:"Household - Home Maintenance/Repairs"},{code:Constants.LOAN_PURPOSE_HOUSEHOLD_RENTALBOND,name:"Household - Rental Bond"},{code:Constants.LOAN_PURPOSE_HOUSEHOLD_RELOCATION,name:"Household - Relocation"},{code:Constants.LOAN_PURPOSE_CAR_REPAIRS_IMPROVEMENTS,name:"Car - Repairs/Improvements"},{code:Constants.LOAN_PURPOSE_TRAVAL_HOLIDAY_AIRFARES_OR_ACCOMMODATION,name:"Holiday - Airfares or Accommodation"},{code:Constants.LOAN_PURPOSE_GIFTS_WEDDING_CHRISTMAS_BIRTHDAY,name:"Gifts - Wedding/Christmas/Birthday"},{code:Constants.LOAN_PURPOSE_EVENT_WEDDING_GOWN_SUIT_HIRE,name:"Event - Wedding Gown and/or Suit Hire"},{code:Constants.LOAN_PURPOSE_EVENT_WEDDING_RECEPTION,name:"Event - Wedding Reception"},{code:Constants.LOAN_PURPOSE_EVENT_WEDDING_SUPPLIER_COSTS,name:"Event - Wedding Supplier Costs"},{code:Constants.LOAN_PURPOSE_EVENT_PART_HOSTING_COSTS,name:"Event - Party Hosting Costs"},{code:Constants.LOAN_PURPOSE_FUNERAL,name:"Event - Funeral Costs"},{code:Constants.LOAN_PURPOSE_EDUCATION_EMPLOYMENT_BUSINESS_CLOTHING,name:"Education/Employment - Business Clothing"},{code:Constants.LOAN_PURPOSE_EDUCATION_EMPLOYMENT_OFFICE_EQUIPMENT_SUPPLIES,name:"Education/Employment - Office Equipment/Supplies"},{code:Constants.LOAN_PURPOSE_EDUCATION_EMPLOYMENT_SCHOOL_COURSE_FEES,name:"Education/Employment - School/Course Fees"},{code:Constants.LOAN_PURPOSE_HEALTH_FITNESS_EQUIPMENT_OR_MEMBESHIP,name:"Health & Wellbeing - Fitness/Sports Equipment or Membership"},{code:Constants.LOAN_PURPOSE_HEALTH_MEDICAL_SPECIALIST_FEES,name:"Health & Wellbeing - Medical Specialist Fees"},{code:Constants.LOAN_PURPOSE_HEALTH_HOSPITAL_EXPENSES,name:"Health & Wellbeing - Hospital Expenses"},{code:Constants.LOAN_PURPOSE_PET_PURCHASE_ASSOCIATED_COSTS,name:"Pet - Purchase & Associated Costs"},{code:Constants.LOAN_PURPOSE_PET_VETERINARY_COSTS,name:"Pet - Veterinary Costs"},{code:Constants.LOAN_PURPOSE_OTHER,name:"Other - We will contact you to discuss your requirements"}];Constants.LOAN_PURPOSE_CHOICES_PERSONAL_LOAN=[{code:Constants.LOAN_PURPOSE_HOUSEHOLD_WHITEGOODS_ENTERTAINMENT_AV,name:"Household - Whitegoods/Entertainment/AV"},{code:Constants.LOAN_PURPOSE_HOUSEHOLD_FURNITURE,name:"Household - Furniture"},{code:Constants.LOAN_PURPOSE_HOUSEHOLD_COMPUTERPURCHASE,name:"Household - Computer Purchase"},{code:Constants.LOAN_PURPOSE_HOUSEHOLD_LANDSCAPING_RENOVATIONS,name:"Household - Landscaping/Renovations"},{code:Constants.LOAN_PURPOSE_HOUSEHOLD_RENTALBOND,name:"Household - Rental Bond"},{code:Constants.LOAN_PURPOSE_HOUSEHOLD_RELOCATION,name:"Household - Relocation"},{code:Constants.LOAN_PURPOSE_CAR_REPAIRS_IMPROVEMENTS,name:"Car - Repairs/Improvements"},{code:Constants.LOAN_PURPOSE_CAR_PURCHASE,name:"Car - Purchase"},{code:Constants.LOAN_PURPOSE_TRAVAL_HOLIDAY_OVERSEAS_TRAVEL,name:"Holiday - Overseas Travel"},{code:Constants.LOAN_PURPOSE_GIFTS_WEDDING_CHRISTMAS_BIRTHDAY,name:"Gifts - Wedding/Christmas/Birthday"},{code:Constants.LOAN_PURPOSE_EVENT_WEDDING_RECEPTION,name:"Event - Wedding Reception"},{code:Constants.LOAN_PURPOSE_FUNERAL,name:"Event - Funeral Costs"},{code:Constants.LOAN_PURPOSE_EDUCATION_EMPLOYMENT_OFFICE_EQUIPMENT_SUPPLIES,name:"Education/Employment - Office Equipment/Supplies"},{code:Constants.LOAN_PURPOSE_HEALTH_HOSPITAL_EXPENSES,name:"Health & Wellbeing - Hospital Expenses"},{code:Constants.LOAN_PURPOSE_PET_VETERINARY_COSTS,name:"Pet - Veterinary Costs"},{code:Constants.LOAN_PURPOSE_OTHER,name:"Other - We will contact you to discuss your requirements"}];Constants.LOAN_PURPOSE_CHOICES_PERSONAL_LOAN_GROUPED=[new appaction(Constants.LOAN_PURPOSE_HOUSEHOLD_WHITEGOODS_ENTERTAINMENT_AV,"Whitegoods/Entertainment/AV","Household"),new appaction(Constants.LOAN_PURPOSE_HOUSEHOLD_FURNITURE,"Furniture","Household"),new appaction(Constants.LOAN_PURPOSE_HOUSEHOLD_COMPUTERPURCHASE,"Computer Purchase","Household"),new appaction(Constants.LOAN_PURPOSE_HOUSEHOLD_LANDSCAPING_RENOVATIONS,"Landscaping/Renovations","Household"),new appaction(Constants.LOAN_PURPOSE_HOUSEHOLD_RENTALBOND,"Rental Bond","Household"),new appaction(Constants.LOAN_PURPOSE_HOUSEHOLD_RELOCATION,"Relocation","Household"),new appaction(Constants.LOAN_PURPOSE_CAR_REPAIRS_IMPROVEMENTS,"Repairs/Improvements","Car"),new appaction(Constants.LOAN_PURPOSE_CAR_PURCHASE,"Purchase","Car"),new appaction(Constants.LOAN_PURPOSE_TRAVAL_HOLIDAY_OVERSEAS_TRAVEL,"Overseas Travel","Holiday"),new appaction(Constants.LOAN_PURPOSE_GIFTS_WEDDING_CHRISTMAS_BIRTHDAY,"Wedding/Christmas/Birthday","Gifts"),new appaction(Constants.LOAN_PURPOSE_EVENT_WEDDING_RECEPTION,"Wedding Reception","Event"),new appaction(Constants.LOAN_PURPOSE_FUNERAL,"Funeral Costs","Event"),new appaction(Constants.LOAN_PURPOSE_EDUCATION_EMPLOYMENT_OFFICE_EQUIPMENT_SUPPLIES,"Office Equipment/Supplies","Education/Employment"),new appaction(Constants.LOAN_PURPOSE_HEALTH_HOSPITAL_EXPENSES,"Hospital Expenses","Health & Wellbeing"),new appaction(Constants.LOAN_PURPOSE_PET_VETERINARY_COSTS,"Veterinary Costs","Pet"),new appaction(Constants.LOAN_PURPOSE_OTHER,"We will contact you to discuss your requirements","Other")];Constants.LOAN_PURPOSE_CHOICES=[{code:Constants.LOAN_PURPOSE_CAR_LOAN,name:"Car Loan"},{code:Constants.LOAN_PURPOSE_MOTORBIKE_LOAN,name:"Motorbike Loan"},{code:Constants.LOAN_PURPOSE_BOAT_JETSKI_LOAN,name:"Boat/JetSki Loan"},{code:Constants.LOAN_PURPOSE_CARAVAN_LOAN,name:"Caravan Loan"},{code:Constants.LOAN_PURPOSE_EQUIPMENT_BUSINESS_LOAN,name:"Equipment/Business Loan"}];Constants.REPAYMENT_TERM_CHOICES=[{code:Constants.REPAYMENT_TERM_36MONTHS,name:"36 months"},{code:Constants.REPAYMENT_TERM_48MONTHS,name:"48 months"},{code:Constants.REPAYMENT_TERM_60MONTHS,name:"60 months"},{code:Constants.REPAYMENT_TERM_72MONTHS,name:"72 months"},{code:Constants.REPAYMENT_TERM_84MONTHS,name:"84 months"}];Constants.FIXED_LOAN_TYPE_CHOICES=[{code:Constants.FIXED_LOAN_LOAN_PAYMENT,name:"Loan Payment"},{code:Constants.FIXED_LOAN_RENTAL_AGREEMENT,name:"Rental Agreement"},{code:Constants.FIXED_LOAN_CAR_LOAN,name:"Car Loan"},{code:Constants.FIXED_LOAN_OTHER,name:"Other Fixed Loan Type"}];Constants.ASSET_TYPE_CHOICES=[{code:Constants.ASSET_TYPE_CAR,name:"Car"},{code:Constants.ASSET_TYPE_BOAT,name:"Boat"},{code:Constants.ASSET_TYPE_MOTORCYCLE,name:"Motorcycle"},{code:Constants.ASSET_TYPE_HOUSE,name:"House"},{code:Constants.ASSET_TYPE_CONTENTS,name:"Contents"}];Constants.INCOME_SOURCE_CHOICES=[{code:Constants.INCOME_SOURCE_SECOND_JOB,name:"Second Job"},{code:Constants.INCOME_SOURCE_INVESTMENT,name:"Investment"},{code:Constants.INCOME_SOURCE_BENEFITS,name:"Benefits"},{code:Constants.INCOME_SOURCE_PARTNER_INCOME,name:"Partner Income"},{code:Constants.INCOME_SOURCE_CHILD_SUPPORT,name:"Child Support"},{code:Constants.INCOME_SOURCE_OTHER,name:"Other"}];Constants.INCOME_SOURCE_CHOICES_FOR_ADMIN_PORTAL=[{code:Constants.INCOME_SOURCE_FULLTIME,name:"Permanent Full Time"},{code:Constants.INCOME_SOURCE_PARTTIME,name:"Permanent Part Time"},{code:Constants.INCOME_SOURCE_CASUAL,name:"Casual"},{code:Constants.INCOME_SOURCE_SELF_EMPLOYED,name:"Self Employed"},{code:Constants.INCOME_SOURCE_CASH_IN_HAND,name:"Cash in hand"},{code:Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT,name:"Government Benefits"},{code:Constants.INCOME_SOURCE_SEASONAL,name:"Seasonal"},{code:Constants.INCOME_SOURCE_SECOND_JOB,name:"Second Job"},{code:Constants.INCOME_SOURCE_INVESTMENT,name:"Investment"},{code:Constants.INCOME_SOURCE_BENEFITS,name:"Benefits"},{code:Constants.INCOME_SOURCE_PARTNER_INCOME,name:"Partner Income"},{code:Constants.INCOME_SOURCE_CHILD_SUPPORT,name:"Child Support"},{code:Constants.INCOME_SOURCE_OTHER,name:"Other"}];Constants.EMPLOYMENT_STATUS_CHOICES=[{code:Constants.EMPLOYMENT_STATUS_FULLTIME,name:"Permanent Full Time"},{code:Constants.EMPLOYMENT_STATUS_PARTTIME,name:"Permanent Part Time"},{code:Constants.EMPLOYMENT_STATUS_CASUAL,name:"Casual"},{code:Constants.EMPLOYMENT_STATUS_SELF_EMPLOYED,name:"Self Employed"},{code:Constants.EMPLOYMENT_STATUS_SUBCONTRACTOR,name:"Sub Contractor"},{code:Constants.EMPLOYMENT_STATUS_UNEMPLOYED,name:"Unemployed - Government Benefits"},{code:Constants.EMPLOYMENT_STATUS_CASH_IN_HAND,name:"Cash in Hand"},{code:Constants.EMPLOYMENT_STATUS_SEASONAL,name:"Seasonal"}];Constants.OCCUPATION_CHOICES=[{code:Constants.OCCUPATION_TYPE_EXECUTIVE_PROFESSIONAL,name:"Executive / Professional"},{code:Constants.OCCUPATION_TYPE_ARMED_FORCES,name:"Armed Forces"},{code:Constants.OCCUPATION_TYPE_LABOURER,name:"Labourer"},{code:Constants.OCCUPATION_TYPE_OFFICE_CLERICAL,name:"Office / Clerical"},{code:Constants.OCCUPATION_TYPE_RETAIL,name:"Retail"},{code:Constants.OCCUPATION_TYPE_SALES,name:"Sales"},{code:Constants.OCCUPATION_TYPE_SKILLED_TRADE,name:"Skilled / Trade"}];Constants.RESIDENTIAL_STATUS_OWN_OUTRIGHT=50;Constants.RESIDENTIAL_STATUS_OWN_BUYING=51;Constants.RESIDENTIAL_STATUS_OWN_RENTING=52;Constants.RESIDENTIAL_STATUS_OWN_BOARDING=53;Constants.RESIDENTIAL_STATUS_OWN_EMPLOYER_PROVIDED=54;Constants.RESIDENTIAL_STATUS_OWN_LIVING_AT_HOME=55;Constants.RESIDENTIAL_STATUS_OWN_CARAVAN=56;Constants.RESIDENTIAL_STATUS_OWN_HOSTEL=57;Constants.RESIDENTIAL_STATUS_CHOICES=[{code:Constants.RESIDENTIAL_STATUS_OWN_OUTRIGHT,name:"Own Outright"},{code:Constants.RESIDENTIAL_STATUS_OWN_BUYING,name:"Own Buying"},{code:Constants.RESIDENTIAL_STATUS_OWN_RENTING,name:"Renting"},{code:Constants.RESIDENTIAL_STATUS_OWN_BOARDING,name:"Boarding"},{code:Constants.RESIDENTIAL_STATUS_OWN_EMPLOYER_PROVIDED,name:"Employer Provided"},{code:Constants.RESIDENTIAL_STATUS_OWN_LIVING_AT_HOME,name:"Living at Home"},{code:Constants.RESIDENTIAL_STATUS_OWN_CARAVAN,name:"Caravan"},{code:Constants.RESIDENTIAL_STATUS_OWN_HOSTEL,name:"Hostel"}];Constants.MARITAL_STATUS_SINGLE=58;Constants.MARITAL_STATUS_MARRIED=59;Constants.MARITAL_STATUS_DEFACTO=60;Constants.MARITAL_STATUS_DIVORCED=61;Constants.MARITAL_STATUS_WIDOWED=62;Constants.MARITAL_STATUS_SEPARATED=114;Constants.MARITAL_STATUS_CHOICES=[{code:Constants.MARITAL_STATUS_SINGLE,name:"Single"},{code:Constants.MARITAL_STATUS_MARRIED,name:"Married"},{code:Constants.MARITAL_STATUS_DEFACTO,name:"De Facto"},{code:Constants.MARITAL_STATUS_DIVORCED,name:"Divorced / Separated"},{code:Constants.MARITAL_STATUS_WIDOWED,name:"Widowed"}];Constants.RELATIONSHIP_CHOICES=[{code:Constants.RELATIONSHIP_TYPE_BROTHER,name:"Brother"},{code:Constants.RELATIONSHIP_TYPE_BROTHER_IN_LAW,name:"Brother-in-Law"},{code:Constants.RELATIONSHIP_TYPE_COLLEAGUE,name:"Colleague"},{code:Constants.RELATIONSHIP_TYPE_COUSIN,name:"Cousin"},{code:Constants.RELATIONSHIP_TYPE_DAUGHTER,name:"Daughter"},{code:Constants.RELATIONSHIP_TYPE_DAUGHTER_IN_LAW,name:"Daughter-in-Law"},{code:Constants.RELATIONSHIP_TYPE_DE_FACTO,name:"De Facto"},{code:Constants.RELATIONSHIP_TYPE_FATHER,name:"Father"},{code:Constants.RELATIONSHIP_TYPE_FATHER_IN_LAW,name:"Father-in-Law"},{code:Constants.RELATIONSHIP_TYPE_FRIEND,name:"Friend"},{code:Constants.RELATIONSHIP_TYPE_GRANDFATHER,name:"Grandfather"},{code:Constants.RELATIONSHIP_TYPE_GRANDMOTHER,name:"Grandmother"},{code:Constants.RELATIONSHIP_TYPE_HUSBAND,name:"Husband"},{code:Constants.RELATIONSHIP_TYPE_MOTHER,name:"Mother"},{code:Constants.RELATIONSHIP_TYPE_MOTHER_IN_LAW,name:"Mother-in-Law"},{code:Constants.RELATIONSHIP_TYPE_NEIGHBOUR,name:"Neighbour"},{code:Constants.RELATIONSHIP_TYPE_NEPHEW,name:"Nephew"},{code:Constants.RELATIONSHIP_TYPE_NIECE,name:"Niece"},{code:Constants.RELATIONSHIP_TYPE_SISTER,name:"Sister"},{code:Constants.RELATIONSHIP_TYPE_SON,name:"Son"},{code:Constants.RELATIONSHIP_TYPE_SON_IN_LAW,name:"Son-in-Law"},{code:Constants.RELATIONSHIP_TYPE_WIFE,name:"Wife"}];Constants.AUSTRALIAN_STATES=["NSW","ACT","VIC","QLD","NT","SA","TAS","WA"];Constants.COUNTRIES=[{code:"AFG",name:"Afghanistan"},{code:"ALA",name:"Åland Islands"},{code:"ALB",name:"Albania"},{code:"DZA",name:"Algeria"},{code:"ASM",name:"American Samoa"},{code:"AND",name:"Andorra"},{code:"AGO",name:"Angola"},{code:"AIA",name:"Anguilla"},{code:"ATA",name:"Antarctica"},{code:"ATG",name:"Antigua and Barbuda"},{code:"ARG",name:"Argentina"},{code:"ARM",name:"Armenia"},{code:"ABW",name:"Aruba"},{code:"AUS",name:"Australia"},{code:"AUT",name:"Austria"},{code:"AZE",name:"Azerbaijan"},{code:"BHS",name:"Bahamas"},{code:"BHR",name:"Bahrain"},{code:"BGD",name:"Bangladesh"},{code:"BRB",name:"Barbados"},{code:"BLR",name:"Belarus"},{code:"BEL",name:"Belgium"},{code:"BLZ",name:"Belize"},{code:"BEN",name:"Benin"},{code:"BMU",name:"Bermuda"},{code:"BTN",name:"Bhutan"},{code:"BOL",name:"Bolivia, Plurinational State of"},{code:"BIH",name:"Bosnia and Herzegovina"},{code:"BWA",name:"Botswana"},{code:"BVT",name:"Bouvet Island"},{code:"BRA",name:"Brazil"},{code:"IOT",name:"British Indian Ocean Territory"},{code:"BRN",name:"Brunei Darussalam"},{code:"BGR",name:"Bulgaria"},{code:"BFA",name:"Burkina Faso"},{code:"BDI",name:"Burundi"},{code:"KHM",name:"Cambodia"},{code:"CMR",name:"Cameroon"},{code:"CAN",name:"Canada"},{code:"CPV",name:"Cape Verde"},{code:"CYM",name:"Cayman Islands"},{code:"CAF",name:"Central African Republic"},{code:"TCD",name:"Chad"},{code:"CHL",name:"Chile"},{code:"CHN",name:"China"},{code:"CXR",name:"Christmas Island"},{code:"CCK",name:"Cocos (Keeling) Islands"},{code:"COL",name:"Colombia"},{code:"COM",name:"Comoros"},{code:"COG",name:"Congo"},{code:"COD",name:"Congo, the Democratic Republic of the"},{code:"COK",name:"Cook Islands"},{code:"CRI",name:"Costa Rica"},{code:"CIV",name:"Côte d'Ivoire"},{code:"HRV",name:"Croatia"},{code:"CUB",name:"Cuba"},{code:"CYP",name:"Cyprus"},{code:"CZE",name:"Czech Republic"},{code:"DNK",name:"Denmark"},{code:"DJI",name:"Djibouti"},{code:"DMA",name:"Dominica"},{code:"DOM",name:"Dominican Republic"},{code:"ECU",name:"Ecuador"},{code:"EGY",name:"Egypt"},{code:"SLV",name:"El Salvador"},{code:"GNQ",name:"Equatorial Guinea"},{code:"ERI",name:"Eritrea"},{code:"EST",name:"Estonia"},{code:"ETH",name:"Ethiopia"},{code:"FLK",name:"Falkland Islands (Malvinas)"},{code:"FRO",name:"Faroe Islands"},{code:"FJI",name:"Fiji"},{code:"FIN",name:"Finland"},{code:"FRA",name:"France"},{code:"GUF",name:"French Guiana"},{code:"PYF",name:"French Polynesia"},{code:"ATF",name:"French Southern Territories"},{code:"GAB",name:"Gabon"},{code:"GMB",name:"Gambia"},{code:"GEO",name:"Georgia"},{code:"DEU",name:"Germany"},{code:"GHA",name:"Ghana"},{code:"GIB",name:"Gibraltar"},{code:"GRC",name:"Greece"},{code:"GRL",name:"Greenland"},{code:"GRD",name:"Grenada"},{code:"GLP",name:"Guadeloupe"},{code:"GUM",name:"Guam"},{code:"GTM",name:"Guatemala"},{code:"GGY",name:"Guernsey"},{code:"GIN",name:"Guinea"},{code:"GNB",name:"Guinea-Bissau"},{code:"GUY",name:"Guyana"},{code:"HTI",name:"Haiti"},{code:"HMD",name:"Heard Island and McDonald Islands"},{code:"VAT",name:"Holy See (Vatican City State)"},{code:"HND",name:"Honduras"},{code:"HKG",name:"Hong Kong"},{code:"HUN",name:"Hungary"},{code:"ISL",name:"Iceland"},{code:"IND",name:"India"},{code:"IDN",name:"Indonesia"},{code:"IRN",name:"Iran, Islamic Republic of"},{code:"IRQ",name:"Iraq"},{code:"IRL",name:"Ireland"},{code:"IMN",name:"Isle of Man"},{code:"ISR",name:"Israel"},{code:"ITA",name:"Italy"},{code:"JAM",name:"Jamaica"},{code:"JPN",name:"Japan"},{code:"JEY",name:"Jersey"},{code:"JOR",name:"Jordan"},{code:"KAZ",name:"Kazakhstan"},{code:"KEN",name:"Kenya"},{code:"KIR",name:"Kiribati"},{code:"PRK",name:"Korea, Democratic People's Republic of"},{code:"KOR",name:"Korea, Republic of"},{code:"KWT",name:"Kuwait"},{code:"KGZ",name:"Kyrgyzstan"},{code:"LAO",name:"Lao People's Democratic Republic"},{code:"LVA",name:"Latvia"},{code:"LBN",name:"Lebanon"},{code:"LSO",name:"Lesotho"},{code:"LBR",name:"Liberia"},{code:"LBY",name:"Libyan Arab Jamahiriya"},{code:"LIE",name:"Liechtenstein"},{code:"LTU",name:"Lithuania"},{code:"LUX",name:"Luxembourg"},{code:"MAC",name:"Macao"},{code:"MKD",name:"Macedonia, the former Yugoslav Republic of"},{code:"MDG",name:"Madagascar"},{code:"MWI",name:"Malawi"},{code:"MYS",name:"Malaysia"},{code:"MDV",name:"Maldives"},{code:"MLI",name:"Mali"},{code:"MLT",name:"Malta"},{code:"MHL",name:"Marshall Islands"},{code:"MTQ",name:"Martinique"},{code:"MRT",name:"Mauritania"},{code:"MUS",name:"Mauritius"},{code:"MYT",name:"Mayotte"},{code:"MEX",name:"Mexico"},{code:"FSM",name:"Micronesia, Federated States of"},{code:"MDA",name:"Moldova, Republic of"},{code:"MCO",name:"Monaco"},{code:"MNG",name:"Mongolia"},{code:"MNE",name:"Montenegro"},{code:"MSR",name:"Montserrat"},{code:"MAR",name:"Morocco"},{code:"MOZ",name:"Mozambique"},{code:"MMR",name:"Myanmar"},{code:"NAM",name:"Namibia"},{code:"NRU",name:"Nauru"},{code:"NPL",name:"Nepal"},{code:"NLD",name:"Netherlands"},{code:"ANT",name:"Netherlands Antilles"},{code:"NCL",name:"New Caledonia"},{code:"NZL",name:"New Zealand"},{code:"NIC",name:"Nicaragua"},{code:"NER",name:"Niger"},{code:"NGA",name:"Nigeria"},{code:"NIU",name:"Niue"},{code:"NFK",name:"Norfolk Island"},{code:"MNP",name:"Northern Mariana Islands"},{code:"NOR",name:"Norway"},{code:"OMN",name:"Oman"},{code:"PAK",name:"Pakistan"},{code:"PLW",name:"Palau"},{code:"PSE",name:"Palestinian Territory, Occupied"},{code:"PAN",name:"Panama"},{code:"PNG",name:"Papua New Guinea"},{code:"PRY",name:"Paraguay"},{code:"PER",name:"Peru"},{code:"PHL",name:"Philippines"},{code:"PCN",name:"Pitcairn"},{code:"POL",name:"Poland"},{code:"PRT",name:"Portugal"},{code:"PRI",name:"Puerto Rico"},{code:"QAT",name:"Qatar"},{code:"REU",name:"Réunion"},{code:"ROU",name:"Romania"},{code:"RUS",name:"Russian Federation"},{code:"RWA",name:"Rwanda"},{code:"BLM",name:"Saint Barthélemy"},{code:"SHN",name:"Saint Helena"},{code:"KNA",name:"Saint Kitts and Nevis"},{code:"LCA",name:"Saint Lucia"},{code:"MAF",name:"Saint Martin (French part)"},{code:"SPM",name:"Saint Pierre and Miquelon"},{code:"VCT",name:"Saint Vincent and the Grenadines"},{code:"WSM",name:"Samoa"},{code:"SMR",name:"San Marino"},{code:"STP",name:"Sao Tome and Principe"},{code:"SAU",name:"Saudi Arabia"},{code:"SEN",name:"Senegal"},{code:"SRB",name:"Serbia"},{code:"SYC",name:"Seychelles"},{code:"SLE",name:"Sierra Leone"},{code:"SGP",name:"Singapore"},{code:"SVK",name:"Slovakia"},{code:"SVN",name:"Slovenia"},{code:"SLB",name:"Solomon Islands"},{code:"SOM",name:"Somalia"},{code:"ZAF",name:"South Africa"},{code:"SGS",name:"South Georgia and the South Sandwich Islands"},{code:"ESP",name:"Spain"},{code:"LKA",name:"Sri Lanka"},{code:"SDN",name:"Sudan"},{code:"SUR",name:"Suriname"},{code:"SJM",name:"Svalbard and Jan Mayen"},{code:"SWZ",name:"Swaziland"},{code:"SWE",name:"Sweden"},{code:"CHE",name:"Switzerland"},{code:"SYR",name:"Syrian Arab Republic"},{code:"TWN",name:"Taiwan, Province of China"},{code:"TJK",name:"Tajikistan"},{code:"TZA",name:"Tanzania, United Republic of"},{code:"THA",name:"Thailand"},{code:"TLS",name:"Timor-Leste"},{code:"TGO",name:"Togo"},{code:"TKL",name:"Tokelau"},{code:"TON",name:"Tonga"},{code:"TTO",name:"Trinidad and Tobago"},{code:"TUN",name:"Tunisia"},{code:"TUR",name:"Turkey"},{code:"TKM",name:"Turkmenistan"},{code:"TCA",name:"Turks and Caicos Islands"},{code:"TUV",name:"Tuvalu"},{code:"UGA",name:"Uganda"},{code:"UKR",name:"Ukraine"},{code:"ARE",name:"United Arab Emirates"},{code:"GBR",name:"United Kingdom"},{code:"USA",name:"United States"},{code:"UMI",name:"United States Minor Outlying Islands"},{code:"URY",name:"Uruguay"},{code:"UZB",name:"Uzbekistan"},{code:"VUT",name:"Vanuatu"},{code:"VEN",name:"Venezuela, Bolivarian Republic of"},{code:"VNM",name:"Viet Nam"},{code:"VGB",name:"Virgin Islands, British"},{code:"VIR",name:"Virgin Islands, U.S."},{code:"WLF",name:"Wallis and Futuna"},{code:"ESH",name:"Western Sahara"},{code:"YEM",name:"Yemen"},{code:"ZMB",name:"Zambia"},{code:"ZWE",name:"Zimbabwe"}],function(n,t,i,r){n.validation.rules.valrulebsbnumber={async:!0,validator:function(n,t,i){var r=!1;CCGApp.WalletWizardAPI.lookupBankBranch(n,{successCallback:function(n){r=n.succeeded===!0&&n.isValid===!0},doneCallback:function(n){i(n.isValid);n.isValid?(t.bsbValidated("Y"),t.bankName(n.bankName)):t.bsbValidated("N")},errorCallback:function(){t.bsbValidated("N");i(!0)},failCallback:function(){t.bsbValidated("N");i(!0)}})},message:"Please enter a valid BSB"};n.validation.rules.newZealandBSBNumber={async:!0,validator:function(n,t,i){var r=!1,u=t.bankCode()||"",f=t.branchCode()||"";u.length>0&&f.length>0&&CCGApp.WalletWizardAPI.lookupBankBranch(n,{successCallback:function(n){r=n.succeeded===!0&&n.isValid===!0},doneCallback:function(n){i(n.isValid);n.isValid?(t.bsbValidated("Y"),t.bankName(n.bankName)):t.bsbValidated("N")},errorCallback:function(){t.bsbValidated("N");i(!0)},failCallback:function(){t.bsbValidated("N");i(!0)}})},message:"Please check bank code and branch code"};n.validation.rules.exactDigits={validator:function(n,t){return n===undefined||n==""||n!==undefined&&n.toString().length==t},message:"Incorrect number of digits."};n.validation.rules.minDigits={validator:function(n,t){return n===undefined||n==""||n!==undefined&&n.toString().length>=t},message:"Insufficient number of digits."};n.validation.rules.maxDigits={validator:function(n,t){return n===undefined||n==""||n!==undefined&&n.toString().length<=t},message:"Too many digits."};n.validation.rules.minDigits={validator:function(n,t){return n===undefined||n==""||n!==undefined&&n.toString().length>=t},message:"Not enough digits."};n.validation.rules.employmentStartDateRequiredForEmployed={validator:function(t,i){return n.validation.rules.required.validator(t,i)},message:"Please enter the date you started at this employer"};n.validation.rules.employmentStartDateRequiredForUnemployed={validator:function(t,i){return n.validation.rules.required.validator(t,i)},message:"Please enter the date you become unemployed"};n.validation.rules.isValidDateString={validator:function(n){var t=Date.getDateObjectFromString(n),i,r;return t instanceof Date?isNaN(t.getTime())?!1:!0:(i="^([0-9]{1,2}[ ]*(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[ ]*[0-9]{4})$",r=n.toString().match(i),r)},message:"Please enter a valid date"};n.validation.rules.isAtLeast18YearsOld={validator:function(n){var t=Date.getDateObjectFromString(n),u=new Date,r=new Date(u.getFullYear(),u.getMonth(),u.getDate()),f=t instanceof Date&&r.getFullYear()==t.getFullYear()&&r.getMonth()==t.getMonth()&&r.getDate()==t.getDate()?!0:!1;return t instanceof Date&&(f&&i!==undefined&&i.touch!==undefined||(t.addYears(18),r=new Date,t<r))?!0:!1},message:"Year cannot be a future year"};n.validation.rules.lessThanCurrentYear={validator:function(n){var t=(new Date).getFullYear();return n<=t},message:"Year cannot be a future year"};n.validation.rules.mustEqual={getValue:function(n){return typeof n=="function"?n():n},validator:function(n,t){var i=this;return n===i.getValue(t)},message:"The field must equal {0}"};n.validation.rules.mustEqualCaseInsensitive={getValue:function(n){return typeof n=="function"?n():n},validator:function(n,t){var r=this,i=r.getValue(t);return typeof n=="string"&&typeof i=="string"?n.toLowerCase()===i.toLowerCase():n===r.getValue(i)},message:"The field must equal {0}"};n.validation.rules.mustUnequalToZeroWithOtherField={getValue:function(n){return typeof n=="function"?n():n},validator:function(n,t){return(t=this.getValue(t),n==0&&t==0)?!1:!0},message:"The field must cannot be {0}"};n.validation.rules.dateIsAfter={getValue:function(n){return typeof n=="function"?n():n},validator:function(n,t){var r=this,i;return n?(i=r.getValue(t),typeof i=="string"&&(i=Date.getDateObjectFromString(i,{resolveMilleniumYear:!1})),Date.getDateObjectFromString(n,{resolveMilleniumYear:!1})>i):!0},message:"This date must be after {0}"};n.validation.rules.dateIsBefore={getValue:function(n){return typeof n=="function"?n():n},validator:function(n,t){var r=this,i;return n?(i=r.getValue(t),typeof i=="string"&&(i=Date.getDateObjectFromString(i,{resolveMilleniumYear:!1})),Date.getDateObjectFromString(n,{resolveMilleniumYear:!1})<i):!0},message:"This date must be after {0}"};n.validation.rules.dateIsAfterDateString={getValue:function(n){return typeof n=="function"?n():n},validator:function(n,t){var i=this;return n?Date.getDateObjectFromString(n)>Date.getDateObjectFromString(i.getValue(t)):!0},message:"The value must be after {0}"};n.validation.rules.medicareNum={validator:function(n){return n!=undefined?(n=n.replace(/\s*/g,""),n=="")?!0:/^[0-9]{10}$/.test(n):!0},message:"Invalid medicare number"};n.validation.rules.licenseCardNumber={validator:function(n){return n!=undefined?(n=n.replace(/\s*/g,""),n=="")?!0:/^[0-9]{10}$/.test(n):!0},message:"Invalid license card number"};n.validation.rules.customMin={isEmptyVal:function(n){return n===undefined?!0:n===null?!0:n===""?!0:void 0},validator:function(n,t){return n!=undefined&&typeof n=="string"&&(n=n.replace(/[$,]/g,"")),this.isEmptyVal(n)||n>=t},message:"Please enter a value greater than or equal to {0}."};n.validation.rules.customMax={isEmptyVal:function(n){return n===undefined?!0:n===null?!0:n===""?!0:void 0},validator:function(n,t){return n!=undefined&&typeof n=="string"&&(n=n.replace(/[$,]/g,"")),this.isEmptyVal(n)||n<=t},message:"Please enter a value less than or equal to {0}."};n.validation.rules.phoneNumber={sameDigits:function(n){for(var i=!0,t=0;i&&t<n.length-1;t++)i=n[t]==n[t+1];return i},isRunningSequence:function(n){for(var i=!0,t=0;i&&t<n.length-1;t++)i=n[t].charCodeAt()+1==n[t+1].charCodeAt(),i||n[t]!="9"||n[t+1]!="0"||(i=!0);return i},validator:function(n,i){var f=!0;if(n!==undefined){n=n.replace(/\s*/g,"");var o=!1,u=undefined,e=!1;if(i!==undefined&&typeof i=="object"?(o=i.optional,u=i.type,e=!0):i!==undefined&&(typeof i=="function"||typeof i=="number")&&(u=i,typeof i=="function"&&(u=i()),e=!0),f=e?u!=t.CONTACT_TYPE_MOBILE&&r.isValidLandlineAU(n)||u==t.CONTACT_TYPE_MOBILE&&r.isValidMobileAU(n):r.isValidLandlineAU(n)||r.isValidMobileAU(n)||r.isValidSpecialNumberAU(n),o&&n=="")return!0;f=f&&!this.isRunningSequence(n)&&!this.sameDigits(n)}return f},message:"Invalid phone number format"};n.validation.rules.mobileOrLandLine={sameDigits:function(n){for(var i=!0,t=0;i&&t<n.length-1;t++)i=n[t]==n[t+1];return i},isRunningSequence:function(n){for(var i=!0,t=0;i&&t<n.length-1;t++)i=n[t].charCodeAt()+1==n[t+1].charCodeAt(),i||n[t]!="9"||n[t+1]!="0"||(i=!0);return i},validator:function(n,t){var i=!0;if(n!==undefined){n=n.replace(/\s*/g,"");var e=!1,u=undefined,f=!1;if(t!==undefined&&typeof t=="object"?(e=t.optional,u=t.type,f=!0):t!==undefined&&(typeof t=="function"||typeof t=="number")&&(u=t,typeof t=="function"&&(u=t()),f=!0),i=f?r.isValidLandlineAU(n)||r.isValidMobileAU(n):r.isValidLandlineAU(n)||r.isValidMobileAU(n)||r.isValidSpecialNumberAU(n),e&&n=="")return!0;i=i&&!this.isRunningSequence(n)&&!this.sameDigits(n)}return i},message:"Invalid phone number format"};n.validation.rules.phoneNumberNZ={sameDigits:function(n){for(var i=!0,t=0;i&&t<n.length-1;t++)i=n[t]==n[t+1];return i},isRunningSequence:function(n){for(var i=!0,t=0;i&&t<n.length-1;t++)i=n[t].charCodeAt()+1==n[t+1].charCodeAt(),i||n[t]!="9"||n[t+1]!="0"||(i=!0);return i},validator:function(n,i){var f=!0;if(n!==undefined){n=n.replace(/\s*/g,"");var o=!1,u=undefined,e=!1;if(i!==undefined&&typeof i=="object"?(o=i.optional,u=i.type,e=!0):i!==undefined&&(typeof i=="function"||typeof i=="number")&&(u=i,typeof i=="function"&&(u=i()),e=!0),f=e?u!=t.CONTACT_TYPE_MOBILE&&r.isValidLandlineNZ(n)||u==t.CONTACT_TYPE_MOBILE&&r.isValidMobileNZ(n):r.isValidLandlineNZ(n)||r.isValidMobileNZ(n),o&&n=="")return!0;f=f&&!this.isRunningSequence(n)&&!this.sameDigits(n)}return f},message:"Invalid phone number format"};n.validation.rules.ausStates={validator:function(n){var r=t.AUSTRALIAN_STATES,i;if(n)for(i=0;i<r.length;i++)if(n.toUpperCase()==r[i])return!0;return!1},message:"Incorrect state"};n.validation.rules.ausPostcode={validator:function(n){n!=undefined&&typeof n=="string"&&(n=n.replace(/[$,]/g,""));return/^[0-9]{4}$/.test(n)},message:"Incorrect postcode"};n.validation.rules.daysFromToday={validator:function(n,t){var r,i,u;return n?(r=parseInt(t,10),i=new Date,i.addDays(r),u=Date.getDateObjectFromString(n),i<=u?!0:!1):!0},message:"The date should be at least 16 days from today"};n.validation.rules.lessThanOrEqualTo={getValue:function(n){return typeof n=="function"?n():n},validator:function(n,t){var i=this.getValue(t);return(n!=undefined&&typeof n=="string"&&(n=n.replace(/[$,]/g,"")),i!=undefined&&typeof i=="string"&&(i=i.replace(/[$,]/g,"")),i=="")?!0:parseInt(n,10)>parseInt(i,10)?!1:!0},message:"This should be less than {0}"};n.validation.rules.moreThanOrEqualToRepaymentAmount={getValue:function(n){return typeof n=="function"?n():n},validator:function(n,t){var i=t.RepaymentAmount();return(n!=undefined&&typeof n=="string"&&(n=n.replace(/[$,]/g,"")),i!=undefined&&typeof i=="string"&&(i=i.replace(/[$,]/g,"")),i=="")?!0:parseInt(n,10)<parseInt(i,10)?!1:!0},message:"This should be more than {0}"};n.validation.rules.regPattern={validator:function(n,t){var i=GlobalFunctions.isUndefinedOrEmptyString(n);return i||n.toString().match(t)!=null},message:"Please check this value."};n.validation.rules.dummy={validator:function(){return!0},message:""};n.validation.registerExtenders()}(ko,Constants,Modernizr,PhoneUtils);ko.bindingHandlers.stopBindings={init:function(){return{controlsDescendantBindings:!0}}};ko.bindingHandlers.logger={update:function(n){var t=ko.utils.domData.get(n,"_ko_logger")||0;ko.utils.domData.set(n,"_ko_logger",++t);console&&console.log&&console.log("logger: "+t+" "+n)}};ko.bindingHandlers.tickCheckboxIfReadContract={init:function(){},update:function(n,t,i,r,u){var e=u.$data.inspectedAllOfContract(),f=t(),o=ko.utils.unwrapObservable(f);if(!e)return $(n).prop("checked",!1),o&&f(!1),!1}};ko.bindingHandlers.scrollBottom={init:function(n,t,i,r,u){var f=$(n),e=f.mCustomScrollbar({axis:"y",scrollInertia:500,mouseWheelPixels:2e3,scrollButtons:{enable:!0,scrollType:"pixels",scrollSpeed:"auto",scrollAmount:500},callbacks:{onTotalScroll:function(){u.$data.inspectedAllOfContract(!0)}},theme:"dark"});u.$data.myScroll=e}};ko.bindingHandlers.dataValidationBinding={init:function(n){var t=$(n),i=t.attr("data-input-format");i=="alpha"?t.alpha():i=="currency"?t.currency():i=="integer"?t.integer():i=="bsbNumber"?t.bsbNumber():i=="address"?t.address():i=="phone"?t.phone():i=="name"&&t.name()},update:function(n){var t=$(n),i;t.val()!=""&&(i=t.attr("data-input-format"),i=="alpha"?t.alpha():i=="currency"?t.currency():i=="integer"?t.integer():i=="bsbNumber"?t.bsbNumber():i=="address"?t.address():i=="phone"&&t.phone())}};ko.bindingHandlers.fadeVisible={init:function(n,t){var i=t();$(n).toggle(ko.unwrap(i))},update:function(n,t){var r=t(),i;ko.unwrap(r)?(i=$(n),window.setTimeout(function(){i.fadeIn(500);i.addClass("is-active")},500)):($(n).fadeOut(500),$(n).removeClass("is-active"))}};ko.bindingHandlers.fileUpload={init:function(){},update:function(n,t,i,r,u){var e=ko.utils.unwrapObservable(t()),o=ko.utils.unwrapObservable(e.inputControlId),s=$("#"+o),f=2097152;s.fileupload({dataType:"text",maxFileSize:f,add:function(n,t){var i=t.files[0];u.$data.errMsg("");i.size!=undefined?i.size>f?(u.$data.errMsg("Exceeded max file size. No file selected."),u.$data.contractFileName("")):u.$data.contractFileName(i.name):u.$data.contractFileName(i.name)}})}};ko.bindingHandlers.valueWithInit={init:function(n,t,i,r){var f=t(),u=$(n).val();u!=undefined&&u!=""&&(f(u),ko.bindingHandlers.value.init(n,t,i,r))},update:ko.bindingHandlers.value.update};ko.bindingHandlers.removeFakepath={init:function(){},update:function(n,t){var f=t(),i=$(n).val(),r,u;i!=undefined&&i!=""&&(r="C:\\fakepath\\",u=i.indexOf(r),i&&u!=-1&&(i=i.substring(r.length)),f(i))}};ko.bindingHandlers.driverLicenceStateContainer={init:function(n,t){var r=t(),i;jQuery!==undefined&&r.fieldName!==undefined&&(i=jQuery(n).find('input[name="'+r.fieldName+'"]'),i!==undefined&&i.length>0&&i.blur(function(){r.observableValue(i.val())}))},update:function(n,t){var u=t(),i,r;jQuery!==undefined&&(i=jQuery(n).find('input[name="'+u.fieldName+'"]'),i!==undefined&&i.length>0&&(r=i.val(),r!=""&&u.observableValue(r)))}};ko.bindingHandlers.validationImg={update:function(){}};ko.bindingHandlers.visibleIfDifferentFromOriginalValue={refresh:function(n,t){var u=t(),r=ko.utils.unwrapObservable(u),i=$(n).attr("data-differentFromOriginalValue-original-value");i=i||"";i==""||GlobalFunctions.isUndefinedOrEmptyString(r)||r.toString()==i?$(n).hide():$(n).show()},init:function(n,t,i,r){ko.bindingHandlers.visibleIfDifferentFromOriginalValue.refresh(n,t,i,r)},update:function(n,t,i,r){ko.bindingHandlers.visibleIfDifferentFromOriginalValue.refresh(n,t,i,r)}};ko.bindingHandlers.differentFromOriginalValue={refresh:function(n,t){var u=t(),r=ko.utils.unwrapObservable(u),i=$(n).attr("data-differentFromOriginalValue-original-value");i=i||"";i==""||GlobalFunctions.isUndefinedOrEmptyString(r)||r.toString()==i?$(n).removeClass("different-from-original"):$(n).addClass("different-from-original")},init:function(n,t,i,r,u){ko.bindingHandlers.differentFromOriginalValue.refresh(n,t,i,r,u)},update:function(n,t,i,r,u){ko.bindingHandlers.differentFromOriginalValue.refresh(n,t,i,r,u)}};ko.bindingHandlers.formatYear={refresh:function(n,t){var f=t(),u=ko.utils.unwrapObservable(t()),i,r;GlobalFunctions.isUndefinedOrEmptyString(u)||isNaN(u)||(i=parseInt(u,10),i>=0&&(i<30?(r=parseInt((2e3+i).toString(),10),f(r),n.value=r.toString()):i>=30&&i<100?(r=parseInt((1900+i).toString(),10),f(r),n.value=r.toString()):u.toString().length==4||(f(0),n.value="0")))},init:function(n,t,i,r,u){ko.bindingHandlers.formatYear.refresh(n,t,i,r,u)},update:function(n,t,i,r,u){ko.bindingHandlers.formatYear.refresh(n,t,i,r,u)}};ko.bindingHandlers.fileUpload={self:this,changeWaitSpinnerText:function(){},init:function(){},update:function(n,t,i,r,u){var c=ko.utils.unwrapObservable(t()),v=ko.utils.unwrapObservable(c.inputControlId),y=ko.utils.unwrapObservable(c.url),h=$("#"+v),e=h.parent(".form-field-fileinput-wrapper").first(),o=e.siblings(".form-field-fileinput-controls").first(),l=e.siblings(".file-details").first(),p=e.siblings(".accepted-format").first(),w=e.siblings(".file-remove-button").first(),b=h.parents().find("#loading"),s=null,f=null,a=2097152;h.fileupload({url:y,dataType:"text",maxFileSize:a,maxChunkSize:65536,acceptFileTypes:/(\.|\/)(jpe?g|pdf|png)$/i,add:function(n,t){var r=null,i=t.files[0],h=(i.size/1024).toFixed(2),c;isNaN(h)||u.$data.filesize(h.toString()+" Kb");c=u.$parent;u.$data.filename(i.name);u.$data.contentType(i.type);u.$data.uploadedPercentage(0);$(l).show();u.$data.errMsg("");i.size>a&&u.$data.errMsg("Exceeded max file size");i.type!=undefined&&i.type!="application/pdf"&&i.type!="image/png"&&i.type!="image/jpg"&&i.type!="image/jpeg"?(u.$data.errMsg("Accepted file types are JPG, PNG and PDF"),o.children(".btn-uploadfile").each(function(){$(this).unbind("click");$(this).remove()}),o.children(".btn-canceluploadfile").each(function(){$(this).unbind("click");$(this).remove()})):(o.children(".btn-uploadfile").each(function(){$(this).unbind("click");$(this).remove()}),o.children(".btn-canceluploadfile").each(function(){$(this).unbind("click");$(this).remove()}),s=$('<button class="btn-uploadfile" />').text("Upload"),f=$('<button class="btn-canceluploadfile"/>').text("Cancel"),f.hide(),s&&f&&(s.appendTo(o).click(function(n){return t.context=$("").replaceAll($(this)),s.hide(),f.show(),r=t.submit(),c.showMustSubmitAllFilesMessage(!1),n.preventDefault(),!1}),f.appendTo(o).click(function(n){return r.abort(),e.show(),s.show(),f.hide(),n.preventDefault(),!1})))},submit:function(n,t){var i=t.files[0],r=u.$data.uniqueId();t.formData={UniqueId:r,Filename:i.name,ContentType:i.type}},start:function(){}}).bind("fileuploadprogress",function(n,t){var i=parseInt(t.loaded/t.total*100,10);i>100&&(i=100);u.$data.uploadedPercentage(i)}).bind("fileuploadfail",function(){u.$data.isUploaded(!1);f&&f.hide()}).bind("fileuploaddone",function(n,t){var i=$.evalJSON(t.result);i.resultCode==1?($(l).addClass("uploaded"),e.css("visibility","hidden"),$(p).hide(),$(w).show(),u.$data.isUploaded(!0),u.$data.uploadStatusText("")):(u.$data.isUploaded(!1),u.$data.uploadStatusText(i.errMsg));f&&f.hide()})}};ko.bindingHandlers.titleCaseString={init:function(){},update:function(n,t){var r=t(),i=ko.utils.unwrapObservable(r);typeof i=="string"&&(i=i.toTitleCase(),r(i))}};ko.bindingHandlers.upperCaseString={init:function(){},update:function(n,t){var r=t(),i=ko.utils.unwrapObservable(r);typeof i=="string"&&(i=i.toUpperCase(),r(i))}},function(n){n.utils.copyObservableValuesToViewModel=function(t,i,r){var e,f,h;if(r=r||{},t!==undefined&&i!==undefined&&(e=Object.getOwnPropertyNames(t),e.length>0))for(f=0,f=0;f<e.length;f++){var o=e[f],u=t[o],s=undefined;n.isObservable(u)&&!n.isComputed(u)&&i[o]!==undefined&&(s=n.isObservable(i[o])?u():i[o],h=u(),h!=s&&(r.overwriteOnlyIfValueBlank?(h===undefined||h=="")&&u(s):u(s)))}};n.utils.copyObservable=function(t,i,r){var u,f;r=r||{};t!==undefined&&i!==undefined&&(u=n.utils.unwrapObservable(i),r.overwriteOnlyIfValueBlank?(f=n.utils.unwrapObservable(t),(f===undefined||f==="")&&t(u)):t(u))}}(ko);jQuery.extend({Guid:{Set:function(){var n;return 1==arguments.length&&(n=this.IsValid(arguments[0])?arguments[0]:this.Empty()),$(this).data("value",n),n},Empty:function(){return"00000000-0000-0000-0000-000000000000"},IsEmpty:function(n){return n==this.Empty()||"undefined"==typeof n||null==n||""==n},IsValid:function(n){return rGx=new RegExp("\\b(?:[A-F0-9]{8})(?:-[A-F0-9]{4}){3}-(?:[A-F0-9]{12})\\b"),null!=rGx.exec(n)},New:function(){var n="";1==arguments.length&&this.IsValid(arguments[0])&&($(this).data("value",arguments[0]),n=arguments[0]);for(var t,r=[],u=new RegExp("[2345]"),i=0;8>i;i++)t=(65536*(1+Math.random())|0).toString(16).substring(1),null!=u.exec(i.toString())&&(3==i&&(t="6"+t.substr(1,3)),r.push("-")),r.push(t.toUpperCase());return n=r.join(""),$(this).data("value",n),n},Value:function(){if($(this).data("value"))return $(this).data("value");var n=this.New();return $(this).data("value",n),n}}})();var NewCustomerPasswordModel=function(n){var t=this;n=n||{};t.emailAddress=ko.observable(n.emailAddress).subscribeTo("emailAddressChanged");t.password=ko.observable(n.password);t.password.subscribe(function(n){ko.postbox.publish("passwordChanged",n);t.sendIdentityEstablishedMessage(n,t.confirmPassword())});t.confirmPassword=ko.observable(n.confirmPassword);t.confirmPassword.subscribe(function(n){ko.postbox.publish("confirmPasswordChanged",n);t.sendIdentityEstablishedMessage(t.password(),n)});t.sendIdentityEstablishedMessage=function(n,i){CCGApp.ValidationRules.applyToNewPassword(t);var r=t.password.isValid(),u=t.confirmPassword.isValid();r&&u&&n==i&&ko.postbox.publish("identityEstablishedChanged",!0)};t.showPasswordError=ko.observable();t.showPasswordErrorMessage=ko.observable();t.showLoginButton=ko.observable(n.showLoginButton);t.buttonInProgress=ko.observable();t.identityEstablished=ko.observable(n.identityEstablished).subscribeTo("identityEstablishedChanged");t.disableLoginButton=ko.computed(function(){var n=t.identityEstablished(),i=t.buttonInProgress();return n||i});t.buttonCaption=ko.computed(function(){return""});t.setupAccount=function(){}},ReturningCustomerLoginModel=function(n){var t=this;n=n||{};t.workflow=ko.observable(n.workflow);t.emailAddress=ko.observable(n.emailAddress);t.password=ko.observable(n.password).publishOn("password");t.password.subscribe(function(){t.showPasswordErrorMessage("");t.showPasswordError(!1)});t.confirmPassword=ko.observable(n.confirmPassword).publishOn("confirmPassword");n.validateConfirmationPassword===undefined&&(n.validateConfirmationPassword=!0);t.validateConfirmationPassword=ko.observable(n.validateConfirmationPassword);t.identityEstablished=ko.observable(n.identityEstablished).subscribeTo("identityEstablishedChanged");t.buttonInProgress=ko.observable();t.buttonCaption=ko.computed(function(){return t.buttonInProgress()?"Logging in...":"Login"});t.disableLoginButton=ko.computed(function(){var n=t.identityEstablished(),i=t.buttonInProgress();return n||i});t.setupAccountToken=ko.observable(n.setupAccountToken);t.showPasswordError=ko.observable();t.showPasswordErrorMessage=ko.observable();t.errors=ko.validation.group(t,{deep:!1});t.isNewUserWorkflow=ko.computed(function(){var n=t.workflow();return n=="newUser"||n=="appForm"});t.setupAccount=function(n,i,r){var u,f;t.identityEstablished()||(u=t.errors().length>0,GlobalFunctions.isUndefinedOrEmptyString(n)&&(n=t.setupAccountToken()),u||t.password().length<1?t.errors.showAllMessages():(f={email:t.emailAddress(),password:t.password(),token:n,customerType:r},CCGApp.WalletWizardAPI.setupCustomerAccount(f,{beforeSendCallback:function(){t.buttonInProgress(!0)},errorCallback:function(){t.buttonInProgress(!1)},successCallback:function(n){if(n)if(n.redirectUrl!==undefined&&n.redirectUrl.length>0)ko.postbox.publish("identityEstablishedChanged",!0),window.location.href=n.redirectUrl;else if(n.succeeded==!1)t.showPasswordError(!0),t.showPasswordErrorMessage(n.errMessage),t.buttonInProgress(!1);else{t.showPasswordError(!1);t.showPasswordErrorMessage("");var i=t.workflow();i=="appForm"?(ko.postbox.publish("identityEstablishedChanged",!0),ko.postbox.publish("explicitDisableConfirmPasswordRequirement",!0),t.walletWizardModelJsonString(n.loanData),t.buttonInProgress(!1)):i=="newUser"&&($("#Username").val(t.emailAddress()),$("#Password").val(t.password()),$(".js-div-login input[type='submit']").click())}}})))};t.walletWizardModelJsonString=ko.observable().publishOn("updateLoanModelWithJSONString");t.showLoginButton=ko.computed(function(){return t.isNewUserWorkflow()})},RequestSMSCodeModel=function(n){var t=this;n=n||{};t.emailAddress=ko.observable(n.emailAddress);t.mobileNumber=ko.observable(n.mobileNumber);t.workflow=ko.observable(n.workflow);t.smsToken=ko.observable(n.smsToken);t.buttonInProgress=ko.observable();t.buttonCaption=ko.computed(function(){return t.buttonInProgress()?"Sending code...":"Send code"});t.sendSMSCode=function(n){if(GlobalFunctions.isUndefinedOrEmptyString(n)&&(n=t.smsToken()),n&&n.length>0){var i={token:n,workflow:t.workflow()};CCGApp.WalletWizardAPI.requestSMSCode(i,{beforeSendCallback:function(){t.buttonInProgress(!0)},errorCallback:function(){t.buttonInProgress(!1)},successCallback:function(n){var r=$("#authenticationSection"),i,u;r.html(n);i=r.find("#verifySMSCodeSection");i&&i.get()&&i.get().length>0&&(u=new VerifySMSCodeModel({workflow:t.workflow(),emailAddress:t.emailAddress()}),ko.applyBindings(u,i.get()[0]));t.buttonInProgress(!1)}})}};t.resendSMSCode=function(n){if(n&&n.length>0){var i={token:n,workflow:t.workflow()};CCGApp.WalletWizardAPI.resendSMSCode(i,{successCallback:function(n){n&&n.succeeded===!0}})}}},VerifySMSCodeModel=function(n){var t=this;n=n||{};t.emailAddress=ko.observable(n.emailAddress);t.workflow=ko.observable(n.workflow);t.pin=ko.observable();t.errorMessage=ko.observable();t.buttonInProgress=ko.observable();t.buttonCaption=ko.computed(function(){return t.buttonInProgress()?"Verifying ...":"Go"});t.verifySMSCode=function(n){var i,r;n&&n.length>0&&(i=t.pin(),i&&i.length>0&&(r={token:n,pinCode:i,workflow:t.workflow()},CCGApp.WalletWizardAPI.verifySMSCode(r,{beforeSendCallback:function(){t.buttonInProgress(!0)},errorCallback:function(){t.buttonInProgress(!1)},successCallback:function(n){if(n)if(n.succeeded===!1)t.errorMessage(n.errorMessage),t.buttonInProgress(!1);else{t.errorMessage("");var i={type:"returning",token:n.token,workflow:t.workflow()};CCGApp.WalletWizardAPI.getNewPasswordInputFields(i,{successCallback:function(i){var u="authenticationSection",r,f;ko.postbox.publish("explicitDisableConfirmPasswordRequirement",!1);$("#"+u).html(i);r=new ReturningCustomerLoginModel({workflow:t.workflow(),emailAddress:t.emailAddress(),setupAccountToken:n.token,showLoginButton:n.showLoginButton,validateConfirmationPassword:!0});CCGApp.ValidationRules.applyToReturningCustomerModel(r);f=$("#"+u+"> #newPasswordSection").get()[0];ko.applyBindings(r,f)}})}}})))};t.resendSMSCode=function(n){if(n&&n.length>0){var i=new RequestSMSCodeModel({workflow:t.workflow(),emailAddress:t.emailAddress()});i.resendSMSCode(n);t.pin("");t.errorMessage("")}}},PersonalDetailModel=function(n){var t=this;t.maritalStatusChoices=Constants.MARITAL_STATUS_CHOICES;PersonalDetailModel.VALIDATION_GROUP_LOAN_DETAIL="LoanDetail";PersonalDetailModel.VALIDATION_GROUP_APP_FORM="AppForm";n=n||{};t.modelValidPublishTopicName=n.modelValidPublishTopicName||"personModelCompleteAndValid";t.countryCode=n.countryCode||"";t.gender=ko.observable(n.gender);t.title=ko.observable(n.title);t.title.subscribe(function(n){n!=Constants.TITLE_DR?n==Constants.TITLE_MR?t.gender("M"):n!=Constants.TITLE_MR&&t.gender("F"):t.gender(undefined)});t.emailAddress=ko.observable(n.emailAddress).publishOn("emailAddressChanged");t.emailAddress.subscribe(function(){t.lookupCustomer()});t.password=ko.observable(n.password).subscribeTo("passwordChanged");t.confirmPassword=ko.observable(n.confirmPassword).subscribeTo("confirmPasswordChanged");t.explicitDisableConfirmPasswordRequirement=ko.observable(n.explicitDisableConfirmPasswordRequirement).subscribeTo("explicitDisableConfirmPasswordRequirement");t.firstname=ko.observable(n.firstname);t.middlename=ko.observable(n.middlename);t.lastname=ko.observable(n.lastname);t.lastname.subscribe(function(){t.lookupCustomer()});t.dateOfBirth=ko.observable(Date.convertDateStringIfTouchDevice(n.dateOfBirth));t.dateOfBirth.subscribe(function(){t.lookupCustomer()});t.maritalStatus=ko.observable(n.maritalStatus);t.isPermanentResident=ko.observable(n.isPermanentResident);n.numberOfDependants=n.numberOfDependants;n.numberOfDependants>Constants.MAX_NUMBER_OF_DEPENDENTS&&(n.numberOfDependants=Constants.MAX_NUMBER_OF_DEPENDENTS);n.numberOfDependants<0&&(n.numberOfDependants=undefined);t.numberOfDependants=ko.observable(n.numberOfDependants);t.isAbove18Immediate=function(n){if(!GlobalFunctions.isUndefinedOrEmptyString(n)){var t=Date.getDateObjectFromString(n),i=new Date;return t instanceof Date?(t.addYears(18),t<i?!0:!1):!1}return!0};t.isAbove18=ko.computed(function(){var n=t.dateOfBirth();return t.isAbove18Immediate()});n.allowCustomerDetailEdit===undefined&&(n.allowCustomerDetailEdit=!0);t.allowCustomerDetailEdit=ko.observable(n.allowCustomerDetailEdit);t.identityEstablished=ko.observable(n.identityEstablished||!1).subscribeTo("identityEstablishedChanged");t.requireIdentityEstablish=ko.observable(n.requireIdentityEstablish||!0);t.hasInitiatedIdentityEstablish=ko.observable(n.hasInitiatedIdentityEstablish||!1);t.showIdentityEstablishError=ko.computed(function(){var n=t.identityEstablished();return!n||t.hasInitiatedIdentityEstablish()&&t.requireIdentityEstablish()});t.setGender=function(n){t.allowCustomerDetailEdit()&&t.gender(n)};t.initDateOfBirth=function(n,i){if(Modernizr.touch&&GlobalFunctions.isUndefinedOrEmptyString(t.dateOfBirth())){var r=GlobalFunctions.getDoBDate("yyyy-mm-dd");t.dateOfBirth(r);$(i.target).attr("value",r)}return!0};t.isNewCustomer=ko.observable(n.isNewCustomer||!1);t.doLookupCustomer=ko.observable(!0);t.doValidateConfirmPassword=ko.computed(function(){return t.isNewCustomer()&&!t.explicitDisableConfirmPasswordRequirement()});t.lookupCustomer=function(){var r=t.lastname(),n=t.dateOfBirth(),i=t.emailAddress(),f=t.isAbove18Immediate(n),e=Date.getDateObjectFromString(n)instanceof Date,u;t.doLookupCustomer()&&e&&f&&!GlobalFunctions.isUndefinedOrEmptyString(r)&&!GlobalFunctions.isUndefinedOrEmptyString(n)&&!GlobalFunctions.isUndefinedOrEmptyString(i)&&t.allowCustomerDetailEdit()&&(u={emailAddress:i,dob:n,lastname:r},CCGApp.WalletWizardAPI.lookupCustomer(u,{errorCallback:function(){t.requireIdentityEstablish(!1);t.isNewCustomer(!0);t.renderNewPasswordFields()},successCallback:function(u){var f,e;u.customerType==="existing"?(f=u.smsToken,t.isNewCustomer(!1),CCGApp.WalletWizardAPI.getRequestSMSCodeInputFields({smsToken:f},{successCallback:function(e){var s=$("#authenticationSection"),o,h;t.hasInitiatedIdentityEstablish(!0);s.html(e);o=s.find("#requestSMSCodeSection");o&&o.get()&&o.get().length>0&&(h=new RequestSMSCodeModel({emailAddress:i,mobileNumber:u.mobileNumber,dateOfBirth:n,lastname:r,workflow:"appForm",smsToken:f}),ko.applyBindings(h,o.get()[0]))}})):u.customerType==="returning"?(e={emailAddress:i,workflow:"appForm"},CCGApp.WalletWizardAPI.getReturningCustomerLoginFields(e,{successCallback:function(n){var e=$("#authenticationSection"),r,f;t.hasInitiatedIdentityEstablish(!0);e.html(n);u.originatingLender.toUpperCase()=="OldCCL".toUpperCase()||u.originatingLender.toUpperCase()=="OldCC".toUpperCase()?$("#ReturnmemberMessage").text("Looks like we’ve met before! You’ve previously registered with this email, so you will need to login to our Members' Area and we can prefill all your form details for you."):u.originatingLender.toUpperCase()=="WW".toUpperCase()?u.countryCode.toUpperCase()!="NZ".toUpperCase()?$("#ReturnmemberMessage").text("Looks like we’ve met before! You’ve previously registered with this email, so you will need to login to our Members' Area and we can prefill all your form details for you."):$("#ReturnmemberMessage").text("It seems like you may be registered as a customer of our New Zealand Wallet Wizard website. If you meant to be on the New Zealand website, click here to be directed to Wallet Wizard New Zealand. Otherwise please give us a call on 1300 925 538."):$("#ReturnmemberMessage").text("Looks like we’ve met before! You’ve previously registered with this email, so you will need to login to our Members' Area and we can prefill all your form details for you.");r=e.find("#returningCustomerLoginSection");r&&r.get()&&r.get().length>0&&(f=new ReturningCustomerLoginModel({emailAddress:i,workflow:"appForm",setupAccountToken:u.setupAccountToken,validateConfirmationPassword:!1}),CCGApp.ValidationRules.applyToReturningCustomerModel(f),ko.applyBindings(f,r.get()[0]))}})):u.customerType==="wrong_country"?CCGApp.WalletWizardAPI.getWrongCountryView(e,{successCallback:function(n){var i=$("#authenticationSection"),t;i.html(n);t=i.find("#wrongCountrySection");t&&t.get()&&t.get().length>0&&u.customData&&t.html('<div class="application-form-row">It seems like you may be registered as a customer of our '+u.customData[2]+" Credit 2U website. If you meant to be on the "+u.customData[2]+' website, <a href="'+u.customData[0]+'" title="'+u.customData[0]+'"> click here<\/a> to be directed to '+u.customData[1]+". Otherwise please give us a call on "+u.customData[3]+"<\/div>")}}):(t.isNewCustomer(!0),t.hasInitiatedIdentityEstablish(!0),ko.postbox.publish("identityEstablishedChanged",!0),$("#ReturnmemberMessage").text("Looks like we’ve met before! You’ve previously registered with this email, so you will need to login to our Members' Area and we can prefill all your form details for you."),t.renderNewPasswordFields())}}))};t.renderNewPasswordFields=function(n){CCGApp.WalletWizardAPI.getNewPasswordInputFields(n,{successCallback:function(n){var i="authenticationSection",r,u;$("#"+i).html(n);r=new NewCustomerPasswordModel({emailAddress:t.emailAddress(),showLoginButton:!1});u=$("#"+i+"> #newPasswordSection").get()[0];ko.applyBindings(r,u)}})};t.errors=ko.validation.group(t,{deep:!1});t.permanentResidentQuestion=ko.computed(function(){return n.countryCode=="NZ"?"Are you a permanent resident of NZ?":"Are you a permanent resident of Australia?"})},PersonalDetailModelNZ=function(n){n.countryCode="NZ";ko.utils.extend(this,new PersonalDetailModel(n))},FinancialCapabilityModel=function(n){var t=this;n=n||{};t.residentialStatusChoices=Constants.RESIDENTIAL_STATUS_CHOICES;t.residentialStatus=ko.observable(n.residentialStatus);t.isSoleIncomeEarner=ko.observable(n.isSoleIncomeEarner);t.maritalStatus=ko.observable(n.maritalStatus);n.numberOfDependants=n.numberOfDependants;n.numberOfDependants>Constants.MAX_NUMBER_OF_DEPENDENTS&&(n.numberOfDependants=Constants.MAX_NUMBER_OF_DEPENDENTS);n.numberOfDependants<0&&(n.numberOfDependants=undefined);t.numberOfDependants=ko.observable(n.numberOfDependants)},ContactDetailCollectionModel=function(n){var t=this;n=n||{};t.mobilePhone=ko.observable(n.mobilePhone);t.homePhone=ko.observable(n.homePhone)},AddressModel=function(n){var t=this;n=n||{};t.caption=n.caption;t.requireStartDate=ko.observable(typeof n.requireStartDate===undefined?!0:n.requireStartDate||!1);t.requireEndDate=ko.observable(typeof n.requireEndDate===undefined?!0:n.requireEndDate||!1);t.durationChangedTopicName=n.durationChangedTopicName||"durationChanged";t.otherDurationChangedTopicName=n.otherDurationChangedTopicName||"otherDurationChanged";t.mustAsk=ko.observable(typeof n.mustAsk===undefined?!0:n.mustAsk);t.mustAskAndRequireStartDate=ko.computed(function(){return t.mustAsk()&&t.requireStartDate()},t,{deferEvaluation:!0});t.mustAskAndRequireEndDate=ko.computed(function(){return t.mustAsk()&&t.requireEndDate()},t,{deferEvaluation:!0});t.address=ko.observable(n.address);t.hasAddress=ko.computed(function(){return(t.address()||"").length>1},t,{deferEvaluation:!1});t.mustAskAndHasAddress=ko.computed(function(){return t.mustAsk()&&t.hasAddress()},t,{deferEvaluation:!1});t.unitNumber=ko.observable(n.unitNumber);t.streetNumber=ko.observable(n.streetNumber);t.streetName=ko.observable(n.streetName);t.streetType=ko.observable(n.streetType);t.suburb=ko.observable(n.suburb);t.city=ko.observable(n.city);t.state=ko.observable(n.state);t.postcode=ko.observable(n.postcode);t.durationIsValid=ko.observable(typeof n.durationIsValid=="undefined"?!0:n.durationIsValid);n.timeAtAddressYears>10&&(n.timeAtAddressYears=10);n.timeAtAddressYears<1&&(n.timeAtAddressYears=1);n.timeAtAddressMonths>12&&(n.timeAtAddressMonths=12);n.timeAtAddressMonths<1&&(n.timeAtAddressMonths=1);t.timeAtAddressYears=ko.observable(n.timeAtAddressYears);t.timeAtAddressMonths=ko.observable(n.timeAtAddressMonths);t.isLessThanTwoYears=ko.computed(function(){var n=t.timeAtAddressYears();return n<2},t,{deferEvaluation:!0});t.setIsModified=function(n){t.address.isModified(n);t.timeAtAddressYears.isModified(n);t.timeAtAddressMonths.isModified(n)}},AddressCollectionModel=function(n){var t=this;n=n||[];t.currentAddress=n.currentAddress||{};t.previousAddress=n.previousAddress||{};t.requirePreviousAddress=ko.computed(function(){if(typeof t.currentAddress!="undefined"&&typeof t.currentAddress.isLessThanTwoYears=="function"){var n=t.currentAddress.isLessThanTwoYears();return t.previousAddress!==undefined&&(t.previousAddress.mustAsk(n),t.previousAddress.requireStartDate(n),t.previousAddress.requireEndDate(n)),n}return!1},t,{deferEvaluation:!0})},ContactAndAddressDetailModel=function(n){var t=this;n=n||{};t.modelValidPublishTopicName=n.modelValidPublishTopicName||"contactAddressDetailsModelCompleteAndValid";t.contactDetailCollection=n.contactDetailCollection||{};t.addressCollection=n.addressCollection||{};t.trackedGAPageViewName=ko.observable(n.trackedGAPageViewName);t.errors=ko.validation.group(t,{deep:!0});t.validate=function(n){var r=t.errors,i;return n=n||{},n.doPublishEvent===undefined&&(n.doPublishEvent=!0),i=r().length==0,i?t.trackedGAPageViewName()||(GlobalFunctions.trackGoogleAnalyticsPageView("/application-form/contact-and-address-details"),t.trackedGAPageViewName(!0)):r.showAllMessages(),i};t.validateAndContinueContactAddressDetails=function(){var n=t.validate()}},IdentificationDetailModel=function(n){var t=this;n=n||{};t.states=Constants.AUSTRALIAN_STATES;t.countries=Constants.COUNTRIES;t.modelValidPublishTopicName=n.modelValidPublishTopicName||"identificationDetailsModelCompleteAndValid";t.hasDriverLicenceDetails=ko.observable(n.hasDriverLicenceDetails);t.hasDriverLicenceDetails.subscribe(function(n){t.driverLicenceNumber.isModified(!1);t.driverLicenceState.isModified(!1);t.updateNumberOfIDProofType(n)});t.driverLicenceNumber=ko.observable(n.driverLicenceNumber);t.driverLicenceState=ko.observable(n.driverLicenceState);t.driverLicenceStateRequired=ko.computed(function(){return t.hasDriverLicenceDetails()&&t.driverLicenceState.isModified()&&GlobalFunctions.isUndefinedOrEmptyString(t.driverLicenceState())},t,{deferEvaluation:!0});t.isDriverLicenceCardNumberRequired=ko.computed(function(){return t.hasDriverLicenceDetails()&&!GlobalFunctions.isUndefinedOrEmptyString(t.driverLicenceNumber())&&t.driverLicenceState()=="NSW"},t,{deferEvaluation:!0});t.isDriverLicenceExpiryDateRequired=ko.computed(function(){return t.hasDriverLicenceDetails()&&t.driverLicenceState()=="WA"},t,{deferEvaluation:!0});t.driverLicenceCardNumber=ko.observable(n.driverLicenceCardNumber);t.driverLicenceExpiryDate=ko.observable(Date.convertDateStringIfTouchDevice(n.driverLicenceExpiryDate));t.hasMedicareCard=ko.observable(n.hasMedicareCard);t.hasMedicareCard.subscribe(function(n){t.medicareNumber.isModified(!1);t.medicarePosition.isModified(!1);t.updateNumberOfIDProofType(n)});t.medicareNumber=ko.observable(n.medicareNumber);t.medicarePosition=ko.observable(n.medicarePosition);t.hasPassportDetails=ko.observable(n.hasPassportDetails);t.hasPassportDetails.subscribe(function(n){t.passportNumber.isModified(!1);t.passportCountryOfBirth.isModified(!1);t.passportCountryOfIssue.isModified(!1);t.passportPlaceOfBirth.isModified(!1);t.passportFamilyNameAtBirth.isModified(!1);t.passportFirstNameAtCitizenship.isModified(!1);t.passportFamilyNameAtCitizenship.isModified(!1);t.updateNumberOfIDProofType(n)});t.passportNumber=ko.observable(n.passportNumber);t.passportCountryOfBirth=ko.observable(n.passportCountryOfBirth);t.passportCountryOfIssue=ko.observable(n.passportCountryOfIssue);t.passportPlaceOfBirth=ko.observable(n.passportPlaceOfBirth);t.passportFamilyNameAtBirth=ko.observable(n.passportFamilyNameAtBirth);t.passportFirstNameAtCitizenship=ko.observable(n.passportFirstNameAtCitizenship);t.passportFamilyNameAtCitizenship=ko.observable(n.passportFamilyNameAtCitizenship);t.numIDProofTypes=ko.observable(n.numIDProofTypes||0);t.updateNumberOfIDProofType=function(n){var i=t.numIDProofTypes();n===!0?t.numIDProofTypes(i+1):n===!1&&t.numIDProofTypes(i-1)};t.attemptToSubmitAndContinueCount=ko.observable(0);t.incrementAttemptToSubmitCount=function(){var n=t.attemptToSubmitAndContinueCount();t.attemptToSubmitAndContinueCount(n+1)};t.errors=ko.validation.group(t,{deep:!1});t.trackedGAPageViewName=ko.observable(n.trackedGAPageViewName);t.validate=function(n){n=n||{};n.doPublishEvent===undefined&&(n.doPublishEvent=!0);var u=t.errors,r=t.numIDProofTypes()>=2,i=!0;return r&&(i=u().length==0,i||t.errors.showAllMessages()),i&&r};t.validateAndContinueIdentificationlDetails=function(){t.attemptToSubmitAndContinueCount(t.attemptToSubmitAndContinueCount()+1);var n=t.validate()};t.hasPassportDetails()&&t.updateNumberOfIDProofType(!0);t.hasMedicareCard()&&t.updateNumberOfIDProofType(!0);t.hasDriverLicenceDetails()&&t.updateNumberOfIDProofType(!0)},IdentificationDetailModelNZ=function(n){var t=this;t.hasDriverLicenceDetails=ko.observable(n.hasDriverLicenceDetails);t.driverLicenceNumber=ko.observable(n.driverLicenceNumber);t.driverLicenceVersion=ko.observable(n.driverLicenceVersion);t.hasDriverLicenceDetails.subscribe(function(n){t.driverLicenceNumber.isModified(!1);t.driverLicenceVersion.isModified(!1);t.updateNumberOfIDProofType(n)});t.hasNZAAMembershipNumber=ko.observable(n.hasNZAAMembershipNumber);t.nzaaMembershipNumber=ko.observable(n.nzaaMembershipNumber);t.hasNZAAMembershipNumber.subscribe(function(n){t.nzaaMembershipNumber.isModified(!1);t.updateNumberOfIDProofType(n)});t.hasPassportDetails=ko.observable(n.hasPassportDetails);t.passportNumber=ko.observable(n.passportNumber);t.passportExpiryDate=ko.observable(n.passportExpiryDate);t.hasPassportDetails.subscribe(function(n){t.passportNumber.isModified(!1);t.passportExpiryDate.isModified(!1);t.updateNumberOfIDProofType(n)});t.numIDProofTypes=ko.observable(n.numIDProofTypes||0);t.updateNumberOfIDProofType=function(n){var i=t.numIDProofTypes();n===!0?t.numIDProofTypes(i+1):n===!1&&t.numIDProofTypes(i-1)};t.attemptToSubmitAndContinueCount=ko.observable(0);t.incrementAttemptToSubmitCount=function(){var n=t.attemptToSubmitAndContinueCount();t.attemptToSubmitAndContinueCount(n+1)};t.errors=ko.validation.group(t,{deep:!1});t.validate=function(n){n=n||{};n.doPublishEvent===undefined&&(n.doPublishEvent=!0);var u=t.errors,r=t.numIDProofTypes()>=2,i=!0;return r&&(i=u().length==0,i||t.errors.showAllMessages()),i&&r};t.validateAndContinueIdentificationlDetails=function(){t.attemptToSubmitAndContinueCount(t.attemptToSubmitAndContinueCount()+1);var n=t.validate()};t.hasDriverLicenceDetails()&&t.updateNumberOfIDProofType(!0);t.hasNZAAMembershipNumber()&&t.updateNumberOfIDProofType(!0);t.hasPassportDetails()&&t.updateNumberOfIDProofType(!0)},IncomeSourceModel=function(n){var t=this;n=n||{};n.requireIncomeSourceType==undefined&&(n.requireIncomeSourceType=!1);GlobalFunctions.isUndefinedOrEmptyString(n.incomeSourceId)||(n.requireIncomeSourceType=n.incomeSourceId!=Constants.INCOME_SOURCE_OTHER&&n.incomeSourceId!=Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT);n.requireIncomeSourceType!=!1||GlobalFunctions.isUndefinedOrEmptyString(n.incomeSourceTypeId)||(n.requireIncomeSourceType=n.incomeSourceTypeId!=Constants.INCOME_SOURCE_OTHER&&n.incomeSourceTypeId!=Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT);t.incomeSourceChoices=Constants.INCOME_SOURCE_CHOICES;t.incomeSource=ko.observable(n.incomeSource);t.incomeSourceId=ko.observable(n.incomeSourceId);GlobalFunctions.isUndefinedOrEmptyString(n.incomeSourceTypeId)&&!GlobalFunctions.isUndefinedOrEmptyString(n.incomeSourceId)&&(n.incomeSourceTypeId=n.incomeSourceId);t.incomeSourceTypeId=ko.observable(n.incomeSourceTypeId);t.incomeSourceTypeId.subscribe(function(){var n=t.hasData()});t.isGovernmentBenefit=ko.observable(n.isGovernmentBenefit);t.isAfterTax=ko.observable(typeof n.isAfterTax=="undefined"?!1:n.isAfterTax);t.incomeFrequency=ko.observable(n.incomeFrequency);t.incomeFrequency.subscribe(function(){var n=t.hasData()});t.hasIncomeFrequency=ko.computed(function(){return!GlobalFunctions.isUndefinedOrEmptyString(t.incomeFrequency())});t.incomeAmount=ko.observable(n.incomeAmount);t.incomeAmount.subscribe(function(){var n=t.hasData()});t.hasIncomeAmount=ko.computed(function(){return!GlobalFunctions.isUndefinedOrEmptyString(t.incomeAmount())});t.incomeSourceOther=ko.observable(n.incomeSourceOther);t.requireIncomeSourceType=ko.observable(n.requireIncomeSourceType);t.incomeAmountCaption=ko.observable(n.incomeAmountCaption||Constants.FIELD_CAPTION_EMPLOYMENT_INCOME);t.tooltip=ko.computed(function(){var n=t.incomeSourceId();return n==Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT?Constants.TOOLTIP_GOVERNMENT_BENEFITS:Constants.TOOLTIP_EMPLOYMENT_INCOME});t.mustAsk=ko.observable(n.mustAsk!==!0?!1:!0);t.isNotGovernmentBenefit=ko.computed(function(){var n=t.isGovernmentBenefit();return n!==!0},t,{deferEvaluation:!0});t.requireIncomeSourceOther=ko.computed(function(){return!1},t,{deferEvaluation:!0});t.incomeCaptionWithTaxStatus=ko.computed(function(){var i=t.isAfterTax(),n=t.incomeAmountCaption();return t.isGovernmentBenefit()?Constants.FIELD_CAPTION_GOVERNMENT_BENEFITS:i?n+" (after tax) ":n},this,{deferEvaluation:!0});t.incomeFrequencyCaption=ko.computed(function(){return t.isGovernmentBenefit()?Constants.FIELD_CAPTION_GOVERNMENT_BENEFITS:t.incomeAmountCaption()});t.hasData=function(){return!GlobalFunctions.isUndefinedOrEmptyString(t.incomeAmount())&&!GlobalFunctions.isUndefinedOrEmptyString(t.incomeSourceId())&&!GlobalFunctions.isUndefinedOrEmptyString(t.incomeFrequency())};t.isEitherFulltimeOrGovernmentBenefit=function(){var n=t.incomeSourceId(),i=t.incomeSourceTypeId();return n==Constants.INCOME_SOURCE_OTHER||n==Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT||i==Constants.INCOME_SOURCE_OTHER||i==Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT?!0:!1};t.setIsModified=function(n){t.hasIncomeAmount()&&!t.hasIncomeFrequency()&&t.incomeFrequency.isModified(n);!t.hasIncomeAmount()&&t.hasIncomeFrequency()&&t.incomeAmount.isModified(n)}},IncomeSourcesModel=function(n){var t=this;n=n||[];t.MAX_INCOME_SOURCES_COUNT=2;t.incomeSources=ko.observableArray(n);t.monthlyTotalIncomeAmount=ko.computed(function(){var n=0;return ko.utils.arrayForEach(t.incomeSources(),function(t){var r=t.incomeAmount()||0,i=GlobalFunctions.convertAmount(r,parseInt(t.incomeFrequency(),10),Constants.PAYMENT_FREQUENCY_MONTHLY);i===undefined||isNaN(i)||(n+=parseFloat(i))}),n});t.getPrimaryRepaymentFrequency=function(){var n=0,i=undefined;return ko.utils.arrayForEach(t.incomeSources(),function(t){var r=t.incomeFrequency(),u=GlobalFunctions.convertAmount(t.incomeAmount(),r,Constants.PAYMENT_FREQUENCY_MONTHLY);u>n&&(n=u,i=r)}),i};t.primaryIncomeSourceFrequency=ko.computed(function(){return t.getPrimaryRepaymentFrequency()});t.hasAtLeastOneFulltimeOrGovernmentBenefit=ko.observable();t.hasSufficientIncomeSource=function(){var n=0;return t.incomeSources.incomeSources!==undefined&&ko.utils.arrayForEach(t.incomeSources.incomeSources(),function(t){t.hasData()&&t.isEitherFulltimeOrGovernmentBenefit()&&n++}),n>0};t.setIsModified=function(n){ko.utils.arrayForEach(t.incomeSources(),function(t){t.setIsModified(n)})}},BankDetailModel=function(n){var t=this;n=n||{};t.bsbValidated=ko.observable(n.bsbValidated||"N");t.bsb=ko.observable(n.bsb);t.bankName=ko.observable(n.bankName);t.accountNumber=ko.observable(n.accountNumber);t.accountName=ko.observable(n.accountName)},BankDetailModelNZ=function(n){var t=this;n=n||{};t.bsbValidated=ko.observable(n.bsbValidated||"N");t.bankName=ko.observable(n.bankName);t.bankCode=ko.observable(n.bankCode);t.branchCode=ko.observable(n.branchCode);t.accountNumber=ko.observable(n.accountNumber);t.accountSuffix=ko.observable(n.accountSuffix);t.accountName=ko.observable(n.accountName);t.bsb=ko.computed(function(){var n=t.bankCode()||"",i=t.branchCode()||"";return n+i})},FixedLoanModel=function(n){var t=this;n=n||{};t.creditor=ko.observable(n.creditor);t.repaymentAmount=ko.observable(n.repaymentAmount);t.repaymentFrequency=ko.observable(n.repaymentFrequency)},FixedLoansModel=function(n){var t=this;n=n||{};t.MAX_FIXED_LOAN_COUNT=6;t.fixedLoans=ko.observableArray(n.collection||[]);t.showRemoveLink=ko.computed(function(){return t.fixedLoans().length>1});t.getMonthlyFixedLoanRepaymentAmount=function(){var n=0;return ko.utils.arrayForEach(t.fixedLoans(),function(t){var i=GlobalFunctions.convertAmount(t.repaymentAmount(),parseInt(t.repaymentFrequency(),10),Constants.PAYMENT_FREQUENCY_MONTHLY);i===undefined||isNaN(i)||(n+=parseFloat(i))}),n};t.addFixedLoan=function(){if(t.fixedLoans().length<t.MAX_FIXED_LOAN_COUNT){var n=new FixedLoanModel({doValidation:!0});CCGApp.ValidationRules.applyToFixedLoanModel(n);t.fixedLoans.push(n)}};t.removeFixedLoan=function(n){t.fixedLoans.remove(n)};t.canAddFixedLoan=ko.computed(function(){var n=t.fixedLoans().length;return n>=0&&n<=t.MAX_FIXED_LOAN_COUNT},t,{deferEvalution:!0});t.moreThanOneFixedLoan=ko.computed(function(){return t.fixedLoans().length>1},t,{deferEvaluation:!0});t.isAllFixedLoansUndefined=function(){var n=!0;return ko.utils.arrayForEach(t.fixedLoans(),function(t){n=n&&GlobalFunctions.isUndefinedOrEmptyString(t.repaymentAmount())}),n};t.monthlyFixedLoanRepaymentAmount=ko.computed(function(){var i=t.isAllFixedLoansUndefined(),n;return i?undefined:(n=t.getMonthlyFixedLoanRepaymentAmount(),n=parseFloat(n.toFixed(2)),ko.postbox.publish("fixedLoanTotalChanged",n),n)})},ExpenseModel=function(n){var t=this;n=n||{};t.rentMortgageRepayment=ko.observable(n.rentMortgageRepayment);t.rentMortgagePaymentFrequencyId=ko.observable(n.rentMortgagePaymentFrequencyId);t.livingExpensesAmount=ko.observable(n.livingExpensesAmount);t.livingExpensesPaymentFrequencyId=ko.observable(n.livingExpensesPaymentFrequencyId);t.numberOfCreditCards=ko.observable(n.numberOfCreditCards);t.totalLimitOfCreditCards=ko.observable(n.totalLimitOfCreditCards);t.totalMonthlyLoanRepayment=ko.observable(n.totalMonthlyLoanRepayment);ko.postbox.subscribe("fixedLoanTotalChanged",function(n){t.totalMonthlyLoanRepayment(n)});t.monthlyTotalHousingExpense=ko.computed(function(){return GlobalFunctions.convertAmount(t.rentMortgageRepayment(),parseInt(t.rentMortgagePaymentFrequencyId(),10),Constants.PAYMENT_FREQUENCY_MONTHLY)});t.monthlyTotalLivingExpense=ko.computed(function(){return GlobalFunctions.convertAmount(t.livingExpensesAmount(),parseInt(t.livingExpensesPaymentFrequencyId(),10),Constants.PAYMENT_FREQUENCY_MONTHLY)})},JobModel=function(n){var t=this;n=n||{};t.modelName="JobModel";t.employerCompanyNameCaption=n.employerCompanyNameCaption||"Employer Company Name ";t.employerContactNumberCaption=n.employerContactNumberCaption||"Employer Company Number";t.parentEmploymentStatus=ko.observable();t.isUnemployed=ko.computed(function(){var n=t.parentEmploymentStatus();return n===undefined?!1:n!==undefined&&n==Constants.EMPLOYMENT_STATUS_UNEMPLOYED});t.requireEndDate=ko.observable(n.requireEndDate||!1);t.durationChangedTopicName=n.durationChangedTopicName||"durationChanged";t.otherDurationChangedTopicName=n.otherDurationChangedTopicName||"otherDurationChanged";t.mustAsk=ko.observable(typeof n.mustAsk===undefined?!0:n.mustAsk);t.mustAskAndRequireEndDate=ko.computed(function(){return t.mustAsk()&&t.requireEndDate()},t,{deferEvaluation:!0});t.mustAskAndEmployed=ko.computed(function(){return t.mustAsk()&&!t.isUnemployed()},t,{deferEvaluation:!0});t.mustAskAndUnemployed=ko.computed(function(){return t.mustAsk()&&t.isUnemployed()},t,{deferEvaluation:!0});t.isCurrentEmployment=ko.observable(n.isCurrentEmployment||!1);t.employerCompanyName=ko.observable(n.employerCompanyName);t.employerContactNumber=ko.observable(n.employerContactNumber);t.occupation=ko.observable(n.occupation);t.employmentStartDate=ko.observable(Date.convertDateStringIfTouchDevice(n.employmentStartDate));t.employmentEndDate=ko.observable(Date.convertDateStringIfTouchDevice(n.employmentEndDate));t.durationIsValid=ko.observable(typeof n.durationIsValid=="undefined"?!0:n.durationIsValid);t.doValidateOccupation=ko.computed(function(){return t.mustAskAndEmployed()&&t.isCurrentEmployment()});t.isLessThanTwoYears=ko.computed(function(){var n=Date.getDateObjectFromString(t.employmentStartDate()),i=Date.getDateObjectFromString(t.employmentEndDate());return(t.requiredEndDate||(i=new Date),n!==undefined&&i!==undefined&&Date.isDateObject(n)&&Date.isDateObject(i)&&(n.addYears(2),n>i))?!0:!1},t,{deferEvaluation:!0})},EmploymentModel=function(n){var t=this;n=n||{};t.occupationOptions=Constants.OCCUPATION_CHOICES;t.employmentStatusOptions=Constants.EMPLOYMENT_STATUS_CHOICES;t.modelValidPublishTopicName=n.modelValidPublishTopicName||"employmentDetailsModelCompleteAndValid";t.currentJob=n.currentJob||new JobModel({employerCompanyNameCaption:"Employer Company Name",mustAsk:!0,requireEndDate:!1,mustAskJobTitle:!0,mustAskOccupation:!0,employerContactNumberCaption:"Employer Contact Number",durationChangedTopicName:"employmentEurationChanged",isCurrentEmployment:!0});t.previousJob=n.previousJob||new JobModel({employerCompanyNameCaption:"Previous Employer Company Name",mustAsk:!1,requireEndDate:!0,mustAskJobTitle:!1,mustAskOccupation:!1,employerContactNumberCaption:"Previous Employer Contact Number",otherDurationChangedTopicName:"employmentDurationChanged",isCurrentEmployment:!1});t.employmentStatus=ko.observable(n.employmentStatus);t.employmentStatus.subscribe(function(n){ko.isObservable(t.currentJob.parentEmploymentStatus)&&t.currentJob.parentEmploymentStatus(n);ko.isObservable(t.previousJob.parentEmploymentStatus)&&t.previousJob.parentEmploymentStatus(n)});t.doRequestPreviousEmployer=ko.computed(function(){var i=t.employmentStatus(),n;return typeof t.currentJob!="undefined"&&typeof t.currentJob.isLessThanTwoYears=="function"&&i!=Constants.EMPLOYMENT_STATUS_UNEMPLOYED?(n=t.currentJob.isLessThanTwoYears(),t.previousJob!==undefined&&(t.previousJob.mustAsk(n),t.previousJob.requireEndDate(n)),n):!1},t,{deferEvaluation:!0})},ContactReferenceModel=function(n){var t=this;n=n||{};t.refFirstName=ko.observable(n.refFirstName);t.refSurname=ko.observable(n.refSurname);t.refBestContact=ko.observable(n.refBestContact);t.refRelationshipType=ko.observable(n.refRelationshipType);t.RelationshipChoices=ko.observableArray(["Brother","Brother-in-Law","Colleague","Cousin","Daughter","Daughter-in-Law","De facto","Father","Father-in-Law","Friend","Grandfather","Grandmother","Husband","Mother","Mother-in-Law","Neighbour","Nephew","Niece","Sister","Son","Son-in-Law","Wife"]);t.getRelationshipChoices=ko.computed(function(){return window.setTimeout(function(){$("#refRelationship").selectOrDie("update")},300),Constants.RELATIONSHIP_CHOICES})},FinancialDetailsModel=function(n){var t=this;n=n||{};t.modelValidPublishTopicName=n.modelValidPublishTopicName||"financialDetailsModelCompleteAndValid";t.incomeSources=n.incomeSources||{};t.expenses=n.expenses||{};t.isSoleIncomeEarner=ko.observable(n.isSoleIncomeEarner);t.maritalStatus=ko.observable(n.maritalStatus);t.numberOfDependants=ko.observable(n.numberOfDependants);t.trackedGAPageViewName=ko.observable(n.trackedGAPageViewName)},ContractModel=function(n){var t=this;t.inspectedAllOfContract=ko.observable(!1);t.showContractNotFullyInspectedError=ko.observable(!1);t.form=n.form||jQuery("#contractForm");t.loanAmount=ko.observable(n.loanAmount);t.submitButtonReadyCssClass=n.submitButtonReadyCssClass||"";t.submitButtonNotReadyCssClass=n.submitButtonNotReadyCssClass||"";t.submitAttemptCount=ko.observable(n.submitAttemptCount||0);t.agreedTermsAndConditions=ko.observable();t.marketingConsent=ko.observable();t.agreeCreditLimitToRequirements=ko.observable();t.agreeRefinancing=ko.observable();t.agreeToImportantNotice=ko.observable();t.agreeToDebitAuthority=ko.observable();t.agreeToPrivacyDisclosureStatement=ko.observable();t.loanWillNotBeUsedToPayForALoan=ko.observable();t.loanAmountFitsPurpose=ko.observable();t.contactWhenEligibleForAnotherDebitCard=ko.observable();t.requireSubscribeToNewsAndOffers=ko.observable(n.requireSubscribeToNewsAndOffers);t.isCLInrease=ko.observable(n.isCLInrease);t.isDrawdown=ko.observable(n.isDrawdown);t.isHigher=ko.observable(n.isHigher);t.suppressLoanPurposeSelect=ko.observable(n.suppressLoanPurposeSelect);t.suppressLoanPurposeSelect()===undefined&&t.suppressLoanPurposeSelect(!1);t.errors=ko.validation.group(t,{deep:!1});t.doShowLoanWillNotBeUsedToPayForALoanCheckbox=ko.computed(function(){var n=t.loanAmount();return!isNaN(n)&&n<=2e3});t.hasAllAgreement=ko.computed(function(){var i=t.loanAmount(),u=t.requireSubscribeToNewsAndOffers(),r=!n.OpenPL||t.agreeRefinancing();return t.isDrawdown()===!0?t.isHigher()===!0?t.agreeToDebitAuthority()&&t.agreeToImportantNotice():t.agreeToDebitAuthority():t.isCLInrease()===!0?t.isHigher()===!0?t.agreedTermsAndConditions()&&t.agreeToPrivacyDisclosureStatement()&&t.agreeToImportantNotice()&&t.agreeToDebitAuthority()&&r&&!isNaN(i):t.agreedTermsAndConditions()&&t.agreeToPrivacyDisclosureStatement()&&t.agreeToDebitAuthority()&&r&&!isNaN(i):t.agreedTermsAndConditions()&&t.agreeToDebitAuthority()&&t.agreeToPrivacyDisclosureStatement()&&t.agreeCreditLimitToRequirements()&&r&&!isNaN(i)},t,{deferEvaluation:!0});t.turnOnInspectedAllOfContract=function(){return t.inspectedAllOfContract(!0),!0};t.checkIfContractScrollToBottom=function(){return t.inspectedAllOfContract()?(t.showContractNotFullyInspectedError(!1),!0):(t.showContractNotFullyInspectedError(!0),t.agreedTermsAndConditions.isModified(!1),t.agreeToDebitAuthority.isModified(!1),t.agreeToPrivacyDisclosureStatement.isModified(!1),t.isHigher===!0&&t.agreeToImportantNotice.isModified(!1),t.loanAmountFitsPurpose&&typeof t.loanAmountFitsPurpose.isModified=="function"&&t.loanAmountFitsPurpose.isModified(!1),App.smoothScrollingLinks.scrollToElement($("#contract-top")),!1)};t.inspectedAllOfContract.subscribe(function(){t.showContractNotFullyInspectedError(!1)});t.submitReviewContractForm=function(){var u=t.hasAllAgreement(),i,r,n;u&&(t.inspectedAllOfContract()||t.showContractNotFullyInspectedError(!0),i=t.errors(),i.length!=0?(t.errors.showAllMessages(),r=$(".application-form-error:first"),App.smoothScrollingLinks.scrollToElement(r)):(n=t.submitAttemptCount(),n==0&&(t.submitAttemptCount(n+1),t.form.submit())))};t.myScroll=undefined;t.scrollTo=function(n){var i=$("#"+n);i.length>0&&t.myScroll&&typeof t.myScroll.mCustomScrollbar=="function"&&t.myScroll.mCustomScrollbar("scrollTo","#"+n)}},WalletWizardCalculatorModel=function(n){var t=this;n=n||{};n.countryCode=n.countryCode||"";t.loanAmount=ko.observable(n.loanAmount).publishOn("loanAmountChanged");t.loanFrequency=ko.observable(n.loanFrequency||Constants.PAYMENT_FREQUENCY_MONTHLY);t.refinanceAmount=ko.observable(n.refinanceAmount||-1);t.maxCapacity=n.maxCapacity;t.creditProduct=n.creditProduct;t.totalcredit=n.creditlimit+n.netAmount;t.calc=new window["WalletWizardCalculator"+n.countryCode];t.repaymentAmount=ko.computed(function(){var n=t.calc.getRepaymentAmount(t.loanAmount(),t.loanFrequency(),t.maxCapacity,t.creditProduct);return parseFloat(n).toFixed(2)},t,{deferEvaluation:!1});t.ddrepaymentAmount=ko.computed(function(){var n=t.calc.getRepaymentAmount(t.totalcredit,t.loanFrequency(),t.maxCapacity,t.creditProduct);return parseFloat(n).toFixed(2)},t,{deferEvaluation:!1});t.weeklyRepaymentAmount=ko.computed(function(){return t.calc.getRepaymentAmount(t.loanAmount(),Constants.PAYMENT_FREQUENCY_WEEKLY,t.maxCapacity,t.creditProduct)},t,{deferEvaluation:!1});t.monthlyRepaymentAmount=ko.computed(function(){return t.calc.getRepaymentAmount(t.loanAmount(),Constants.PAYMENT_FREQUENCY_MONTHLY,t.maxCapacity,t.creditProduct)},t,{deferEvaluation:!1});t.numberOfRepayments=ko.computed(function(){return t.calc.getNumberOfRepayments(t.loanAmount(),t.loanFrequency())},t,{deferEvaluation:!1});t.showAllRepayments=function(){function i(n){var t=n.toString(),i;return t.indexOf(".")>=0?(i=t.split(".")[1],i.length===1)?t+"0":t:t+".00"}jQuery.magnificPopup.open({items:{src:"#allRepaymentsContainer"},type:"inline"});for(var f=t.loanAmount(),e=t.loanFrequency(),r=e==11?0:e==12?1:2,o=[334,366,381,364,361,396,395,418,443],u=0,n=o[u],s=1e3;f>s;)u++,n=o[u],s+=500;r==0&&(n=n*12/52);r==1&&(n=n*12/26);n=Math.round(n*100)/100;$("#TotalInterest").html("");$("#TotalFees").html("");$("#TotalAmount").html("");$("#allRepaymentsList").html("");$("#maxPay").html(i(n));jQuery.ajax({url:"/api/loans/GetMemberRepaymentSchedule?type="+r+"&amount="+f,success:function(n){var t;for($("#TotalInterest").html("$"+i(n.TotalInterest)),$("#TotalFees").html("$"+i(n.TotalFees)),$("#TotalAmount").html("$"+i(n.TotalAmount)),t=0;t<n.Repayments.length;t++){var r=n.Repayments[t],u=r.PaymentDate.split("T")[0].split("-"),f="<tr><td>"+r.Id+"<\/td><td>"+u[2]+"/"+u[1]+"/"+u[0]+'<\/td><td class="amount"><span>$'+i(r.Amount)+"<\/span><\/td><\/tr>";$(f).appendTo($("#allRepaymentsList"))}}})};t.repaymentFrequencyExpression=function(n){var i=[],r=[];return(i[Constants.PAYMENT_FREQUENCY_WEEKLY]="weekly",i[Constants.PAYMENT_FREQUENCY_FORTNIGHTLY]="fortnightly",i[Constants.PAYMENT_FREQUENCY_MONTHLY]="monthly",r[Constants.PAYMENT_FREQUENCY_WEEKLY]="week",r[Constants.PAYMENT_FREQUENCY_FORTNIGHTLY]="fortnight",r[Constants.PAYMENT_FREQUENCY_MONTHLY]="month",n==0)?i[t.loanFrequency()]:n==1?r[t.loanFrequency()]:""};t.setLoanRepaymentFrequency=function(n){t.loanFrequency(n)};t.formattedLoanAmount=ko.computed(function(){var n=t.loanAmount();return n!==undefined?"$"+n.toString():n});t.showAsteriskForSmallLoan=ko.computed(function(){return parseFloat(t.loanAmount())<2001});t.setLoanAmount=function(n){console.log("setting loan amount to = "+n);t.loanAmount(n)};t.refinanceAmount.subscribe(function(i){if(n.netAmount>=0){var r=parseFloat(i)+n.netAmount;t.setLoanAmount(r)}});t.formatCurrency=function(n){return GlobalFunctions.formatCurrency(n)}},WalletWizardCalculator=function(){var n=this;n.ABSOLUTE_MAX_BORROW_AMOUNT=1e5;n.handlingFee=45;n.loanAmountToLoanTermMappingUsingAverageTermDays=[{to:300,term:38},{to:600,term:121},{to:1200,term:167},{to:2e3,term:273},{to:5e3,term:912}];n.loanAmountToLoanTermMappingMonths=[{to:300,term:4},{to:600,term:4},{to:1200,term:6},{to:2e3,term:12},{to:5e3,term:24}];n.establishmentFeeRate=.15;n.getPeriodicalFee=function(n){return n==Constants.PAYMENT_FREQUENCY_WEEKLY?1.1577:n==Constants.PAYMENT_FREQUENCY_FORTNIGHTLY?2.285:n==Constants.PAYMENT_FREQUENCY_MONTHLY?4.954:0};n.sanitiseLoanAmount=function(t){return t<0&&(t=0),t>1e5&&(t=n.ABSOLUTE_MAX_BORROW_AMOUNT),parseFloat(t)};n.isSACC=function(t){return(t=n.sanitiseLoanAmount(t),t>0&&t<=2e3)?!0:!1};n.getLoanTermDays=function(t){var i,r;for(t=parseFloat(t),i=0;i<n.loanAmountToLoanTermMappingUsingAverageTermDays.length;i++)if(r=n.loanAmountToLoanTermMappingUsingAverageTermDays[i],t<=r.to)return r.term;return 0};n.getLoanTermMonths=function(t){var i,r;for(t=parseFloat(t),i=0;i<n.loanAmountToLoanTermMappingMonths.length;i++)if(r=n.loanAmountToLoanTermMappingMonths[i],t<=r.to)return r.term;return 0};n.getNumberOfRepayments=function(t,i){var u,r;t=n.sanitiseLoanAmount(t);var f=n.getLoanTermMonths(t),o=new Date,e=new Date;return e.addMonths(f),u=Date.dateDiff(o,e),r=0,i==Constants.PAYMENT_FREQUENCY_WEEKLY?r=u.d/7:i==Constants.PAYMENT_FREQUENCY_FORTNIGHTLY?r=u.d/14:i==Constants.PAYMENT_FREQUENCY_MONTHLY&&(r=f),Math.floor(r)};n.getInterestRate=function(n,t,i){return i==Constants.PAYMENT_FREQUENCY_WEEKLY?n/52:i==Constants.PAYMENT_FREQUENCY_FORTNIGHTLY?n/26:i==Constants.PAYMENT_FREQUENCY_MONTHLY?n/12:0};n.getSACCRepaymentAmount=function(t,i){var r=n.getNumberOfRepayments(t,i),u=n.getLoanTermMonths(t);return t*(1+n.establishmentFeeRate+.02*u)/r};n.getBigLoanRepaymentAmount=function(t,i){var u=n.getNumberOfRepayments(t,i),r=n.getInterestRate(.36,t,i),f=n.getPeriodicalFee(i);return(t+n.handlingFee)*r/(1-1/Math.pow(1+r,u))+f};n.getRepaymentAmount=function(t,i){var f,u,r;for(t=n.sanitiseLoanAmount(t),n.loanAmountToRepaymentMappin=[{amount:5e3,wk:71.03,ft:142.39,mt:310.1},{amount:4900,wk:69.68,ft:139.68,mt:304.2},{amount:4800,wk:68.33,ft:136.97,mt:298.3},{amount:4700,wk:69.18,ft:139.61,mt:300.7},{amount:4600,wk:67.78,ft:136.79,mt:294.62},{amount:4500,wk:68.23,ft:137.76,mt:297.25},{amount:4400,wk:66.79,ft:134.85,mt:290.97},{amount:4300,wk:65.35,ft:131.95,mt:284.7},{amount:4200,wk:65.8,ft:132.91,mt:287.35},{amount:4100,wk:64.32,ft:129.91,mt:280.87},{amount:4e3,wk:65.32,ft:130.95,mt:283.76},{amount:3900,wk:63.77,ft:127.85,mt:277.04},{amount:3800,wk:62.23,ft:124.75,mt:270.32},{amount:3700,wk:62.73,ft:125.76,mt:273.22},{amount:3600,wk:61.13,ft:122.55,mt:266.24},{amount:3500,wk:61.67,ft:123.63,mt:269.39},{amount:3400,wk:60,ft:120.3,mt:262.12},{amount:3300,wk:58.34,ft:116.96,mt:254.85},{amount:3200,wk:59.43,ft:120.36,mt:257.97},{amount:3100,wk:57.68,ft:116.82,mt:250.37},{amount:3e3,wk:58.28,ft:118.12,mt:253.76},{amount:2900,wk:56.34,ft:114.18,mt:245.3},{amount:2800,wk:54.39,ft:110.24,mt:236.84},{amount:2700,wk:54.82,ft:111.22,mt:239.6},{amount:2600,wk:52.79,ft:107.1,mt:230.73},{amount:2500,wk:53.87,ft:108.03,mt:233.5},{amount:2400,wk:51.72,ft:103.71,mt:224.16},{amount:2300,wk:49.56,ft:99.39,mt:214.82},{amount:2200,wk:50,ft:100.27,mt:217.59},{amount:2100,wk:47.73,ft:95.71,mt:207.7},{amount:2e3,wk:48.14,ft:96.53,mt:210.47},{amount:1900,wk:45.73,ft:91.71,mt:199.95},{amount:1800,wk:43.32,ft:86.88,mt:189.43},{amount:1700,wk:44.37,ft:90.56,mt:191.85},{amount:1600,wk:41.76,ft:85.23,mt:180.56},{amount:1500,wk:42.04,ft:85.97,mt:182.71},{amount:1400,wk:39.23,ft:80.24,mt:170.53},{amount:1300,wk:36.43,ft:74.51,mt:158.35},{amount:1200,wk:36.48,ft:74.8,mt:159.61},{amount:1100,wk:33.44,ft:68.56,mt:146.31},{amount:1e3,wk:34.14,ft:68.49,mt:146.93},{amount:900,wk:30.73,ft:61.64,mt:132.24},{amount:800,wk:27.31,ft:54.79,mt:117.55},{amount:700,wk:23.9,ft:47.94,mt:102.85},{amount:600,wk:22.84,ft:45.81,mt:98.99},{amount:500,wk:21.6,ft:43.32,mt:94.54}],f=0,u=0;u<n.loanAmountToRepaymentMappin.length;u++)if(r=n.loanAmountToRepaymentMappin[u],t==r.amount)return i==11?r.wk:i==12?r.ft:r.mt;return f}},WalletWizardCalculatorNZ=function(){var n=this;WalletWizardCalculator.apply(n);n.handlingFee=95;n.loanAmountToLoanTermMappingUsingAverageTermDays=[{to:300,term:4},{to:600,term:4},{to:1200,term:6},{to:2e3,term:12},{to:5e3,term:24}];n.getPeriodicalFee=function(n){return n==Constants.PAYMENT_FREQUENCY_WEEKLY?.344:n==Constants.PAYMENT_FREQUENCY_FORTNIGHTLY?.694:n==Constants.PAYMENT_FREQUENCY_MONTHLY?1.5:0};n.getSACCRepaymentAmount=function(t,i){var u=n.getNumberOfRepayments(t,i),r=n.getInterestRate(.75,t,i),f=n.getPeriodicalFee(i);return(t+n.handlingFee)*r/(1-Math.pow(1+r,-1*u))+f};n.getBigLoanRepaymentAmount=function(t,i){var u=n.getNumberOfRepayments(t,i),r=n.getInterestRate(.36,t,i),f=n.getPeriodicalFee(i);return(t+n.handlingFee)*r/(1-Math.pow(1+r,-1*u))+f}},LoanPurposeModel=function(n){var t=this;n=n||{};t.loanPurposeChoices=Constants.LOAN_PURPOSE_CHOICES;t.loanPurposeId=ko.observable(n.loanPurposeId);t.getLoanPurposeChoices=ko.computed(function(){return window.setTimeout(function(){$("#LoanPurposeId").selectOrDie("update")},300),Constants.LOAN_PURPOSE_CHOICES})},RepaymentTermModel=function(n){var t=this;n=n||{};t.repaymentTermChoices=Constants.REPAYMENT_TERM_CHOICES;t.repaymentTerm=ko.observable(n.repaymentTerm);t.getRepaymentTermChoices=ko.computed(function(){return window.setTimeout(function(){$("#repaymentTerm").selectOrDie("update")},300),Constants.REPAYMENT_TERM_CHOICES})},MiscInfoModel=function(n){var t=this;n=n||{};t.canForeseeReasonLoanCannotBeRepaid=ko.observable(n.canForeseeReasonLoanCannotBeRepaid);t.agreeToTermsAndConditions=ko.observable(n.agreeToTermsAndConditions);t.subscribeToNewsAndOffers=ko.observable(n.subscribeToNewsAndOffers);t.informationIsTrueAndAccurate=ko.observable(n.informationIsTrueAndAccurate);t.MarketingConsent=ko.observable(n.MarketingConsent);t.hasAllMandatoryTickboxesChecked=ko.computed(function(){return t.agreeToTermsAndConditions()&&t.informationIsTrueAndAccurate()})},WalletWizardApplicationFormModel=function(n){var t=this;n=n||{};t.form=n.form||{};t.modelAsJsonString=ko.observable().subscribeTo("updateLoanModelWithJSONString");t.modelAsJsonString.subscribe(function(n){var s,f,e,o,h,w;if(n!==undefined){var r=$.evalJSON(n),i={overwriteOnlyIfValueBlank:!0},u=$.evalJSON(r.personDetail||{});t.personDetails.doLookupCustomer(!1);t.personDetails.isNewCustomer(!1);ko.utils.copyObservableValuesToViewModel(t.personDetails,u,i);t.personDetails.firstname(u.firstname);t.personDetails.middlename(u.middlename);t.personDetails.dateOfBirth(Date.convertDateStringIfTouchDevice(u.dateOfBirth));t.personDetails.lastname(u.lastname);t.personDetails.isPermanentResident("Y");s=$.evalJSON(r["identificationDetails"+window.countryCode]||{});s.driverLicenceExpiryDate=s.driverLicenceExpiryDate!=undefined&&Date.getDateObjectFromString(s.driverLicenceExpiryDate)<new Date?undefined:Date.convertDateStringIfTouchDevice(s.driverLicenceExpiryDate);ko.utils.copyObservableValuesToViewModel(t.identificationDetails,s,i);ko.utils.copyObservable(t.contactDetails.homePhone,r.homePhone,i);ko.utils.copyObservable(t.contactDetails.mobilePhone,r.mobilePhone,i);f=$.evalJSON(r.currentEmploymentDetail||{});e=$.evalJSON(r.previousEmploymentDetail||{});GlobalFunctions.isUndefinedOrEmptyString(f.employmentStartDate)||(f.employmentStartDate=Date.convertDateStringIfTouchDevice(f.employmentStartDate));GlobalFunctions.isUndefinedOrEmptyString(f.employmentEndDate)||(f.employmentEndDate=Date.convertDateStringIfTouchDevice(f.employmentEndDate));GlobalFunctions.isUndefinedOrEmptyString(e.employmentStartDate)||(e.employmentStartDate=Date.convertDateStringIfTouchDevice(e.employmentStartDate));GlobalFunctions.isUndefinedOrEmptyString(e.employmentEndDate)||(e.employmentEndDate=Date.convertDateStringIfTouchDevice(e.employmentEndDate));ko.utils.copyObservableValuesToViewModel(t.employmentDetails.currentJob,f,i);ko.utils.copyObservableValuesToViewModel(t.employmentDetails.previousJob,e,i);ko.utils.copyObservable(t.employmentDetails.employmentStatus,f.employmentStatus,i);o=$.evalJSON(r.expenses||{});o.numberOfCreditCards||(o.numberOfCreditCards=0);o.totalLimitOfCreditCards||(o.totalLimitOfCreditCards=0);o.totalMonthlyLoanRepayment||(o.totalMonthlyLoanRepayment=0);ko.utils.copyObservableValuesToViewModel(t.expenses,o,i);ko.utils.copyObservableValuesToViewModel(t.bankDetailsModel,$.evalJSON(r["bankDetail"+window.countryCode]||{}),i);h=$.evalJSON(r.miscellaneousInfo||{});h.agreeToTermsAndConditions=undefined;h.subscribeToNewsAndOffers=undefined;h.informationIsTrueAndAccurate=undefined;h.MarketingConsent=undefined;ko.utils.copyObservableValuesToViewModel(t.miscInfoModel,h,i);ko.utils.copyObservable(t.financialCapabilityModel.isSoleIncomeEarner,u.isSoleIncomeEarner,i);ko.utils.copyObservable(t.financialCapabilityModel.maritalStatus,u.maritalStatus,i);ko.utils.copyObservable(t.financialCapabilityModel.numberOfDependants,u.numberOfDependants||0,i);ko.utils.copyObservable(t.financialCapabilityModel.residentialStatus,u.residentialStatus,i);ko.utils.copyObservableValuesToViewModel(t.addressDetails.currentAddress,$.evalJSON(r.currentAddress||{}),i);ko.utils.copyObservableValuesToViewModel(t.addressDetails.previousAddress,$.evalJSON(r.previousAddress||{}),i);t.addressDetails.refAddress.timeAtAddressMonths(10);t.addressDetails.refAddress.timeAtAddressYears(10);ko.utils.copyObservableValuesToViewModel(t.addressDetails.refAddress,$.evalJSON(r.refAddress||{}),i);t.addressDetails.currentAddress.mustAsk(!0);t.addressDetails.currentAddress.requireStartDate(!0);t.addressDetails.currentAddress.requireEndDate(!1);t.addressDetails.previousAddress.mustAsk(!1);t.addressDetails.currentAddress.requireStartDate(!0);t.addressDetails.currentAddress.requireEndDate(!0);t.personDetails.allowCustomerDetailEdit(!1);var a=[],v=$.evalJSON(r.incomeSources||[]),y=!1,p=!1,c,l;ko.utils.arrayForEach(v,function(n){n.incomeSourceId==Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT?(y=!0,n.incomeAmountCaption=Constants.FIELD_CAPTION_GOVERNMENT_BENEFITS,n.isGovernmentBenefit=!0,c=n):(p=!0,n.isGovernmentBenefit=!1,l=n);a.push(new IncomeSourceModel(n))});v.length==1?(y&&(l=new IncomeSourceModel({incomeSourceId:Constants.INCOME_SOURCE_OTHER,isGovernmentBenefit:!1,isAfterTax:!0,incomeAmountCaption:Constants.FIELD_CAPTION_EMPLOYMENT_INCOME}),a.push(l)),p&&(c=new IncomeSourceModel({incomeSourceId:Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT,isGovernmentBenefit:!0,isAfterTax:!0,incomeAmountCaption:Constants.FIELD_CAPTION_GOVERNMENT_BENEFITS}),a.push(c))):v.length==0&&(l=new IncomeSourceModel({incomeSourceId:Constants.INCOME_SOURCE_OTHER,isGovernmentBenefit:!1,isAfterTax:!0,incomeAmountCaption:Constants.FIELD_CAPTION_EMPLOYMENT_INCOME}),c=new IncomeSourceModel({incomeSourceId:Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT,isGovernmentBenefit:!0,isAfterTax:!0,incomeAmountCaption:Constants.FIELD_CAPTION_GOVERNMENT_BENEFITS}),a.push(l),a.push(c));ko.utils.arrayForEach(t.incomeSources.incomeSources(),function(n){n.incomeSourceId()==Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT?ko.utils.copyObservableValuesToViewModel(n,c,i):ko.utils.copyObservableValuesToViewModel(n,l,i)});t.incomeSources.incomeSources.sort(function(n,t){return n.incomeSourceId()==Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT&&t.incomeSourceId()!=Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT?1:t.incomeSourceId()==Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT&&n.incomeSourceId()!=Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT?-1:0});w=t.identificationDetails;t.initIdentificationDetails(w);$("select").selectOrDie("update")}});t.loanAmount=ko.observable(n.loanAmount).subscribeTo("loanAmountChanged");t.loanPurposeDetail=n.loanPurposeDetails||new LoanPurposeModel;t.repaymentTermDetail=n.repaymentTermDetails||new RepaymentTermModel;t.personDetails=n.personDetails||new window["PersonalDetailModel"+window.countryCode];t.contactReferenceDetails=n.contactReferenceDetails||new ContactReferenceModel;t.identificationDetails=n.identificationDetails||new window["IdentificationDetailModel"+window.countryCode];t.addressDetails=n.addressDetails||new AddressCollectionModel;t.contactDetails=n.contactDetails||new ContactDetailCollectionModel;t.employmentDetails=n.employmentDetails||new EmploymentModel;t.incomeSources=n.incomeSources||{};t.expenses=n.expenses||{};t.bankDetailsModel=n.bankDetailsModel||{};t.miscInfoModel=n.miscInfoModel||{};t.financialCapabilityModel=n.financialCapabilityModel||{};t.errorsArray=[];t.errorsCount=0;t.hasSufficientIncomeSource=function(){var n=0;return t.incomeSources.incomeSources!==undefined&&ko.utils.arrayForEach(t.incomeSources.incomeSources(),function(t){t.hasData()&&t.isEitherFulltimeOrGovernmentBenefit()&&n++}),n>0};t.evalErrors=function(){t.loanPurposeErrors=ko.validation.group(t.loanPurposeDetail,{deep:!0});t.repaymentTermErrors=ko.validation.group(t.repaymentTermDetail,{deep:!0});t.personDetailsErrors=ko.validation.group(t.personDetails,{deep:!0});t.identificationDetailsErrors=ko.validation.group(t.identificationDetails,{deep:!0});t.addressDetailsCurrentAddressErrors=ko.validation.group(t.addressDetails.currentAddress,{deep:!0});t.addressDetailsPreviousAddressErrors=ko.validation.group(t.addressDetails.previousAddress,{deep:!0});t.addressDetailsrefAddressErrors=ko.validation.group(t.addressDetails.refAddress,{deep:!0});t.contactDetailsErrors=ko.validation.group(t.contactDetails,{deep:!0});t.currentEmploymentDetailsErrors=ko.validation.group(t.employmentDetails.currentJob,{deep:!0});t.contactReferenceDetailsErrors=ko.validation.group(t.contactReferenceDetails,{deep:!0});t.previousEmploymentDetailsErrors=ko.validation.group(t.employmentDetails.previousJob,{deep:!0});t.incomeSourcesErrors=ko.validation.group(t.incomeSources,{deep:!0});t.expensesErrors=ko.validation.group(t.expenses,{deep:!0});t.bankDetailsModelErrors=ko.validation.group(t.bankDetailsModel,{deep:!0});t.miscInfoModelErrors=ko.validation.group(t.miscInfoModel,{deep:!0});t.financialCapabilityModelErrors=ko.validation.group(t.financialCapabilityModel,{deep:!1});t.errorsCount+=t.loanPurposeErrors().length;t.errorsCount+=t.repaymentTermErrors().length;t.errorsCount+=t.personDetailsErrors().length;t.errorsCount+=t.identificationDetailsErrors().length;t.errorsCount+=t.addressDetailsCurrentAddressErrors().length;t.errorsCount+=t.addressDetailsPreviousAddressErrors().length;t.errorsCount+=t.addressDetailsrefAddressErrors().length;t.errorsCount+=t.contactDetailsErrors().length;t.errorsCount+=t.currentEmploymentDetailsErrors().length;t.errorsCount+=t.contactReferenceDetailsErrors().length;t.errorsCount+=t.previousEmploymentDetailsErrors().length;t.errorsCount+=t.incomeSourcesErrors().length;t.errorsCount+=t.expensesErrors().length;t.errorsCount+=t.bankDetailsModelErrors().length;t.errorsCount+=t.miscInfoModelErrors().length;t.errorsCount+=t.financialCapabilityModelErrors().length};t.showErrorMessages=function(){t.loanPurposeErrors.showAllMessages();t.repaymentTermErrors.showAllMessages();t.personDetailsErrors.showAllMessages();t.identificationDetailsErrors.showAllMessages();t.addressDetailsCurrentAddressErrors.showAllMessages();t.addressDetailsPreviousAddressErrors.showAllMessages();t.addressDetailsrefAddressErrors.showAllMessages();t.contactDetailsErrors.showAllMessages();t.currentEmploymentDetailsErrors.showAllMessages();t.contactReferenceDetailsErrors.showAllMessages();t.previousEmploymentDetailsErrors.showAllMessages();t.incomeSourcesErrors.showAllMessages();t.expensesErrors.showAllMessages();t.bankDetailsModelErrors.showAllMessages();t.miscInfoModelErrors.showAllMessages();t.financialCapabilityModelErrors.showAllMessages()};t.validate=function(){var n=t.hasSufficientIncomeSource(),i,r;return t.incomeSources.hasAtLeastOneFulltimeOrGovernmentBenefit(n),t.addressDetails.currentAddress.setIsModified(!0),t.addressDetails.requirePreviousAddress()&&t.addressDetails.previousAddress.setIsModified(!0),t.identificationDetails.attemptToSubmitAndContinueCount(t.identificationDetails.attemptToSubmitAndContinueCount()+1),t.incomeSources.setIsModified(!0),t.errorsCount=0,t.evalErrors(),i=t.errorsCount==0,r=t.identificationDetails.numIDProofTypes()>=2,i&&n&&r||(t.showErrorMessages(),window.setTimeout(function(){var n=$(".application-form-error:visible"),t,i;n.length>0&&(t=n.parents(".application-form-row:first"),t.length>0?n=t:(i=n.parents(".application-form-field:first"),i.length>0&&(n=i)),App.smoothScrollingLinks.scrollToElement(n[0]))},250)),i&&n&&r};t.disabledSubmitButton=ko.observable(n.disabledSubmitButton);t.greyOutSubmitButton=ko.computed(function(){var n=t.disabledSubmitButton(),i=t.miscInfoModel.hasAllMandatoryTickboxesChecked();return!i||n});t.validateAndSubmitLoanApplication=function(){var i=t.miscInfoModel.hasAllMandatoryTickboxesChecked(),n;!t.disabledSubmitButton()&&i&&(n=t.validate(),n&&(t.disabledSubmitButton(!0),t.form.submit()))};t.initIdentificationDetails=function(n){var i,f,r,u;if(n instanceof IdentificationDetailModelNZ){if(n){var i=0,r=!GlobalFunctions.isUndefinedOrEmptyString(n.passportNumber())||!GlobalFunctions.isUndefinedOrEmptyString(n.passportExpiryDate()),u=!GlobalFunctions.isUndefinedOrEmptyString(n.driverLicenceVersion())||!GlobalFunctions.isUndefinedOrEmptyString(n.driverLicenceNumber()),e=!GlobalFunctions.isUndefinedOrEmptyString(n.nzaaMembershipNumber());n.hasDriverLicenceDetails(u);n.hasPassportDetails(r);n.hasNZAAMembershipNumber(e);e&&i++;r&&i++;u&&i++;t.identificationDetails.numIDProofTypes(i)}}else n instanceof IdentificationDetailModel&&n&&(i=0,f=!GlobalFunctions.isUndefinedOrEmptyString(n.medicareNumber())||!GlobalFunctions.isUndefinedOrEmptyString(n.medicarePosition()),n.hasMedicareCard(f),r=!GlobalFunctions.isUndefinedOrEmptyString(n.passportNumber())||!GlobalFunctions.isUndefinedOrEmptyString(n.passportCountryOfBirth())||!GlobalFunctions.isUndefinedOrEmptyString(n.passportCountryOfIssue())||!GlobalFunctions.isUndefinedOrEmptyString(n.passportPlaceOfBirth())||!GlobalFunctions.isUndefinedOrEmptyString(n.passportFamilyNameAtBirth())||!GlobalFunctions.isUndefinedOrEmptyString(n.passportFirstNameAtCitizenship())||!GlobalFunctions.isUndefinedOrEmptyString(n.passportFamilyNameAtCitizenship()),n.hasPassportDetails(r),u=!GlobalFunctions.isUndefinedOrEmptyString(n.driverLicenceCardNumber())||!GlobalFunctions.isUndefinedOrEmptyString(n.driverLicenceExpiryDate())||!GlobalFunctions.isUndefinedOrEmptyString(n.driverLicenceNumber())||!GlobalFunctions.isUndefinedOrEmptyString(n.driverLicenceState()),n.hasDriverLicenceDetails(u),f&&i++,r&&i++,u&&i++,t.identificationDetails.numIDProofTypes(i))}},DrawDownApplicationFormModel=function(n,t){var i=this;n=n||{};i.bankDetails=new BankDetailModel(n.bankDetail);i.uExistingData=ko.observable(n.useExistingDetails);i.useExistingDetails=ko.computed({read:function(){return i.uExistingData()+""},write:function(n){n==="true"?i.uExistingData(!0):i.uExistingData(!1)}});i.useExistingIncomeDetails=ko.observable(n.useExistingIncomeDetails);i.useWwVisaCard=ko.observable(n.useWalletWizardVisa);i.useWalletWizardVisa=ko.computed({read:function(){return i.useWwVisaCard()+""},write:function(n){n==="true"?i.useWwVisaCard(!0):i.useWwVisaCard(!1)}});i.bankDetails.isValidationEnabled=function(){return i.useWalletWizardVisa()==="false"};i.evalErrors=function(){i.bankDetailsModelErrors=ko.validation.group(i.bankDetails,{deep:!0});i.drawDownErrors=ko.validation.group(i);i.errorsCount+=i.bankDetailsModelErrors().length;i.errorsCount+=i.drawDownErrors().length};i.showErrorMessages=function(){i.drawDownErrors.showAllMessages();i.bankDetailsModelErrors.showAllMessages()};i.validate=function(){i.errorsCount=0;i.evalErrors();var n=i.errorsCount==0;return n||(i.showErrorMessages(),window.setTimeout(function(){var n=$(".application-form-error:visible"),t,i;n.length>0&&(t=n.parents(".application-form-row:first"),t.length>0?n=t:(i=n.parents(".application-form-field:first"),i.length>0&&(n=i)),App.smoothScrollingLinks.scrollToElement(n[0]))},250)),n};i.disabledSubmitButton=ko.observable(!1);i.greyOutSubmitButton=ko.computed(function(){var n=i.disabledSubmitButton();return n});i.validateAndSubmitLoanApplication=function(){if(!i.disabledSubmitButton()){var n=i.validate();n&&(i.disabledSubmitButton(!0),t.form.submit())}}},YodleeFormModel=function(n){var t=this;n=n||{};t.formId=n.formId;t.MAX_YODLEE_AUTH_ERROR_BEFORE_FILE_UPLOAD=3;t.MAX_TRIVIA_ITEMS=n.maxTriviaItems||31;t.MAX_STEPS=6;t.overallDurationInSeconds=n.overallDurationInSeconds||300;t.decisionStep1TimeoutInSeconds=n.decisionStep1TimeoutInSeconds||20;t.decisionStepDurationInSeconds=[t.decisionStep1TimeoutInSeconds];t.minimumShowTimeInMilliseconds=n.minimumShowTimeInMilliseconds;t.isDebug=!0;t.loanAppId=ko.observable();t.bankId=ko.observable();t.consentForBankAccountAccess=ko.observable();t.showErrorForConsentRequired=ko.observable(!1);t.bankFields=ko.observable();t.nextStepUrl=ko.observable();t.isApproved=ko.observable();t.authErrorCount=ko.observable(0);t.ylError=ko.observable();t.hasError=ko.computed(function(){return!GlobalFunctions.isUndefinedOrEmptyString(t.ylError())});t.popupStep=ko.observable(0);t.triviaStep=ko.observable(0);t.bankId.subscribe(function(){t.attemptToSubmitWithoutProvideBankDetails(0);t.getBankFields(t.loanAppId())});t.errors=ko.validation.group(t,{deep:!0});t.isPopupOpen=!1;t.closePopup=function(){t.isPopupOpen&&(t.popupShowTime=undefined,$.magnificPopup.close(),t.isPopupOpen=!1)};t.isLoadingGifVisible=ko.observable();t.getBankFields=function(n){var i={bankId:t.bankId(),loanAppId:n};$("#yl-form-fields-zone").find("select").selectOrDie("destroy");t.bankFields("");t.ylError("");t.authErrorCount(0);CCGApp.WalletWizardAPI.getYodleeBankFields(i,{successCallback:function(n){n.length>0?(t.bankFields(n),t.isLoadingGifVisible(!1),$("#yl-form-fields-zone").find("select").selectOrDie({customClass:"sod_select"})):t.goToFileUploadSection()},beforeSendCallback:function(){t.isLoadingGifVisible(!0)},errorCallback:function(){t.goToFileUploadSection()}})};t.getAppId=function(){return $("#"+t.formId).find('input[name="aid"]').val()};t.expandFileUploadSection=function(){ko.postbox.publish("useFileUploadOption",!0)};t.goToFileUploadSection=function(){t.expandFileUploadSection();window.setTimeout(function(){var n=$("#fileuploadSectionHeader");App.smoothScrollingLinks.scrollToElement(n)},100)};t.isUploadDocsMode=function(){var n=!1;return document.location.pathname=="/apply-now/verification-uploaddocs"&&(n=!0),n};t.hasAllBankCredentialsBlank=function(n){var u=!0;if(n){var t=n.find('input[type="text"]').val(),i=n.find('input[type="password"]').val(),r=n.find('select[id!="bankId"] option:selected').val();t===undefined&&(t="");i===undefined&&(i="");r===undefined&&(r="");u=t.length==0&&i.length==0&&r.length==0}return u};t.attemptToSubmitWithoutProvideBankDetails=ko.observable(0);t.doBankLogin=function(){var i=t.bankId(),r=$("#"+n.formId),u,f,e;r.validate({errorClass:"application-form-error"});u=t.errors();f=t.hasAllBankCredentialsBlank(r);(u.length>0||!r.valid())&&t.errors.showAllMessages();f?(t.attemptToSubmitWithoutProvideBankDetails()==0?t.ylError("To be able to use our quick automated decisioning system, we will need to verify your income electronically through a secure and safe income check using Yodlee. Rest assured, your details are secure. Please enter your login details to continue. If you have any questions, please call us or use chat."):t.attemptToSubmitWithoutProvideBankDetails()==1&&t.goToFileUploadSection(),t.attemptToSubmitWithoutProvideBankDetails(t.attemptToSubmitWithoutProvideBankDetails()+1)):(i===undefined||i==="")&&t.ylError('The details you have entered could not be validated. Please check your details and try again. It’s important to ensure you have the right details as entering incorrect details can lock out your account.  <a id="uploadManually" href="javascript: ko.contextFor(document.getElementById(\'uploadManually\')).$data.goToFileUploadSection()">Upload your documents manually<\/a>.');u.length!=0||i===undefined||i===""||f||(t.ylError(""),e={bankId:i,aid:t.getAppId(),formId:t.formId},t.popupStep(0),CCGApp.WalletWizardAPI.addBankAccount(e,{beforeSendCallback:function(){t.launchPopupAndStartPolling()},successCallback:function(n){n&&n.succeeded===!1&&n.isContinuing===!1&&(t.closePopup(),t.ylError(n.errorMessage),t.popupStep(0),n.isAuthError&&t.authErrorCount(t.authErrorCount()+1),(n.useFileUpload||t.authErrorCount()==t.MAX_YODLEE_AUTH_ERROR_BEFORE_FILE_UPLOAD)&&t.goToFileUploadSection())},doneCallback:function(){}}))};t.moveToLastStep=function(){t.popupStep(t.MAX_STEPS-1)};t.isStepActive=ko.computed(function(n){return t.popupStep()==n});t.isStepDeactivated=ko.computed(function(n){return t.popupStep()>n});t.isStepCompleted=ko.computed(function(n){return t.popupStep()<n});t.setupDecisionLoaderStepIntervals=function(){for(var u=t.overallDurationInSeconds/(t.MAX_STEPS-2),i=(t.overallDurationInSeconds-t.decisionStep1TimeoutInSeconds)%(t.MAX_STEPS-2),r=(t.overallDurationInSeconds-t.decisionStep1TimeoutInSeconds)/(t.MAX_STEPS-2),n=0,n=0;n<t.MAX_STEPS-2;n++)n==0&&i>0?t.decisionStepDurationInSeconds.push(r+i):t.decisionStepDurationInSeconds.push(r);return u};t.setupDecisionLoader=function(){t.popupStep(0);t.setupDecisionLoaderStepIntervals();$.magnificPopup.open({modal:!0,items:{src:"#decisionPopup"},type:"inline",callbacks:{close:function(){t.popupStep(0);window.progressStepTimeoutHandle&&window.clearInterval(window.progressStepTimeoutHandle);window.getLoanAssessmentResultHandle&&window.clearInterval(window.getLoanAssessmentResultHandle);window.window.messagesTickingHandle&&window.clearInterval(window.messagesTickingHandle)}}});var n=function(i){return window.progressStepTimeoutHandle=window.setTimeout(function(){var i,r;t.popupStep()<t.MAX_STEPS-1&&t.popupStep(t.popupStep()+1);window.progressStepTimeoutHandle!==undefined&&window.clearTimeout(window.progressStepTimeoutHandle);i=t.decisionStepDurationInSeconds[t.popupStep()];i===undefined&&(i=15);t.isDebug&&console!==undefined&&console.log("Called fxProgressDecisionStep at "+t.popupStep());r=new Date;t.overallAbsoluteFinishingTime!==undefined&&r>t.overallAbsoluteFinishingTime?window.clearInterval(window.progressStepTimeoutHandle):window.progressStepTimeoutHandle=n(i)},i*1e3),window.progressStepTimeoutHandle};t.popupStep(0);t.isDebug&&console!==undefined&&console.log("Called fxProgressDecisionStep at "+t.popupStep());n(t.decisionStepDurationInSeconds[t.popupStep()]);t.setupMessagesTicking()};t.setupMessagesTicking=function(){window.messagesTickingHandle=window.setInterval(function(){var n=t.triviaStep()+1;n>=t.MAX_TRIVIA_ITEMS&&(n=0,window.triviaStep=0);t.triviaStep(n)},1e4)};t.doCancelAutoRedirection=ko.observable();t.explicitContinueClickedFromPopup=function(){t.doCancelAutoRedirection(!0)};t.launchPopupAndStartPolling=function(){t.popupShowTime=new Date;t.overallAbsoluteFinishingTime=t.popupShowTime.copy();t.overallAbsoluteFinishingTime.addSeconds(t.overallDurationInSeconds);t.isPopupOpen=!0;t.setupDecisionLoader();t.isDebug&&console!==undefined&&(console.log(" self.overallDurationInSeconds: "+t.overallDurationInSeconds),console.log(" self.overallAbsoluteFinishingTime: "+t.overallAbsoluteFinishingTime),console.log(t.decisionStepDurationInSeconds));var n=15,i={aid:t.getAppId()};t.isDebug&&console!==undefined&&console.log("Polling in "+n+" seconds");window.getLoanAssessmentResultHandle=window.setInterval(function(){CCGApp.WalletWizardAPI.getLoanAssessmentResult(i,{successCallback:function(n){var r,u,f,i;n&&(n.succeeded===!0?n.continuePolling===!1?(window.clearInterval(window.getLoanAssessmentResultHandle),t.isApproved(n.isApproved),t.nextStepUrl(n.nextUrl),n.isApproved&&t.moveToLastStep(),n.nextUrl&&(r="/application-timeout",t.minimumShowTimeCriteriaMet()?(t.moveToLastStep(),i=t.nextStepUrl(),(i==undefined||i=="")&&t.nextStepUrl(r),t.redirectToNextStepUrlAfterMilliseconds(1e4)):(u=t.timeUntilMinimumShowTimeInMilliseconds(),window.setTimeout(function(){t.moveToLastStep();var n=t.nextStepUrl();(n==undefined||n=="")&&t.nextStepUrl(r);t.redirectToNextStepUrlAfterMilliseconds(1e4)},u)))):t.isDebug&&(console.log("  continuePolling==true"),console.log(n)):n.continuePolling||(t.nextStepUrl(n.nextUrl),t.isApproved(n.isApproved),t.moveToLastStep(),t.redirectToNextStepUrlAfterMilliseconds(1e4)));f=new Date;f>t.overallAbsoluteFinishingTime&&(window.clearInterval(window.getLoanAssessmentResultHandle),t.isApproved(!1),t.moveToLastStep(),i=t.nextStepUrl(),(i==undefined||i=="")&&t.nextStepUrl("/application-timeout"),t.redirectToNextStepUrlAfterMilliseconds(1e4))},errorCallback:function(){t.nextStepUrl("/application-timeout")},failCallback:function(){t.nextStepUrl("/application-timeout")}})},n*1e3)};t.timeUntilMinimumShowTimeInMilliseconds=function(){var i,n;return t.popupShowTime&&(i=new Date,n=t.popupShowTime.copy(),n.addMilliseconds(t.minimumShowTimeInMilliseconds),i<n)?n.getTime()-i.getTime():0};t.minimumShowTimeCriteriaMet=function(){if(t.popupShowTime){var i=new Date,n=t.popupShowTime.copy();if(n.addMilliseconds(t.minimumShowTimeInMilliseconds),i>n)return!0}return!1};t.redirectToNextStepUrlAfterMilliseconds=function(n){if(n>=0){var i=t.doCancelAutoRedirection();i||window.setTimeout(function(){var n=t.nextStepUrl();window.location.href=n},n)}};t.debugLoanAssessment=function(){var n={aid:t.getAppId()};CCGApp.WalletWizardAPI.getLoanAssessmentResult(n,{successCallback:function(n){console.log("debugLoanAssessment");console.log(n)}})}},RegisterUserModel=function(){var n=this;n.firstname=ko.observable();n.lastname=ko.observable();n.dateOfBirth=ko.observable();n.emailAddress=ko.observable();n.password=ko.observable().subscribeTo("password");n.confirmPassword=ko.observable().subscribeTo("confirmPassword");n.isCreateAccountVisible=ko.observable();n.isCreateAccountVisible(!0);n.password.subscribe(function(){n.showLoginButton()});n.confirmPassword.subscribe(function(){n.showLoginButton()});n.gotPasswords=function(){var t=n.password(),i=n.confirmPassword();return t!==undefined&&t!==""&&i!==undefined&&i!==""};n.showLoginButton=function(){var t=n.gotPasswords();return n.isLoginButtonVisible(t),t};n.isLoginButtonVisible=ko.observable(!0);n.errorMessage=ko.observable();n.errors=ko.validation.group(n,{deep:!0});n.registeruser=function(){var i=n.errors(),t;if(i.length>0){n.errors.showAllMessages();return}t={formDataAsJson:{FirstName:n.firstname(),LastName:n.lastname(),DOB:n.dateOfBirth(),Email:n.emailAddress()}};CCGApp.WalletWizardAPI.registerUser(t,{successCallback:function(t){var r,u,i,f;t&&(t.succeeded===!1?n.errorMessage(t.errorMessage):(n.errorMessage(""),n.isCreateAccountVisible(!1),r=$("#requestSMSCodeContainer").val(),$("#js-register-result").html('<div id="authenticationSection">'+r+"<\/div>"),u=$("#authenticationSection"),i=u.find("#requestSMSCodeSection"),i&&i.get()&&i.get().length>0&&(f=new RequestSMSCodeModel({workflow:"newUser",emailAddress:n.emailAddress(),mobileNumber:t.mobileNumber,smsToken:t.requestToken}),ko.applyBindings(f,i.get()[0]))))}})}},File=function(n){var t=this;t.uniqueId=ko.observable(n.uniqueId);t.filename=ko.observable(n.filename);t.filesize=ko.observable(n.filesize);t.contentType=ko.observable(n.contentType);t.uploadedPercentage=ko.observable(0);t.isUploaded=ko.observable(typeof n.isUploaded=="undefined"?!1:n.isUploaded);t.uploadStatusText=ko.observable(n.uploadStatusText);t.errMsg=ko.observable(n.errMsg);t.uploadedPercentageExpression=ko.computed(function(){var n=t.uploadedPercentage();return n.toFixed(2)+"%"},t,{deferEvaluation:!0})},FilesCollection=function(n){var t=this,i;n=n||{};t.formName=n.formName;i=n.onBeforeSubmit||{};t.maxTriviaItems=ko.observable(n.maxTriviaItems);t.showFileUploadOption=ko.observable(!1).subscribeTo("useFileUploadOption");t.files=ko.observableArray(n.files||[]);t.addFile=function(){var n=new File({uniqueId:jQuery.Guid.New()});t.files.push(n)};t.removeFile=function(n){var i=$(".file-upload-wrap .form-field-wrap").length;i==1&&$(".add-another-file-real").click();t.files.remove(n)};t.filesWithFilenameCount=ko.computed(function(){var n=0;return ko.utils.arrayForEach(t.files(),function(t){GlobalFunctions.isUndefinedOrEmptyString(t.filename())||n++}),n},t,{});t.triggerValidation=ko.observable(n.triggerValidation);t.hasAtLeastOneFile=function(){for(var r=0,u=t.files(),n,i=0;r==0&&i<u.length;i++)n=u[i],n!=null&&n.filename!=undefined&&n.filename()!=undefined&&n.isUploaded()&&r++;return r>0};t.hasFileNotUploaded=function(){for(var r=0,u=t.files(),n,i=0;r==0&&i<u.length;i++)n=u[i],n==null||n.filename==undefined||n.filename()==undefined||n.isUploaded()||r++;return r>0};t.showMustSubmitAllFilesMessage=ko.observable();t.submitBankStatements=function(){if(t.triggerValidation(!0),t.showMustSubmitAllFilesMessage(t.hasFileNotUploaded()),t.hasAtLeastOneFile()&&!t.hasFileNotUploaded()){var n=$(t.formName);i&&i();n.ajaxSubmit();t.pollForAssessmentResult({decisionStep1TimeoutInSeconds:1,minimumShowTimeInMilliseconds:3e4})}};t.pollForAssessmentResult=function(n){n=n||{};var t=ko.contextFor(document.getElementById("ylForm")).$data;t.decisionStep1TimeoutInSeconds=n.decisionStep1TimeoutInSeconds;t.decisionStepDurationInSeconds=[];t.decisionStepDurationInSeconds.push(n.decisionStep1TimeoutInSeconds);t.minimumShowTimeInMilliseconds=n.minimumShowTimeInMilliseconds;t.launchPopupAndStartPolling()}},ConfirmLoanOfferModel=function(n){var t=this;n=n||{};t.form=n.form;t.originalLoanAmount=ko.observable(n.originalLoanAmount);t.disbursementMethod=ko.observable(n.disbursementMethod);t.loanOfferIdentifier=ko.observable(n.loanOfferIdentifier);t.loanPurposeMeetsRequirements=ko.observable(n.loanPurposeMeetsRequirements);t.originalLoanPurposeId=ko.observable(n.originalLoanPurposeId);t.loanPurposeId=ko.observable(n.loanPurposeId);t.repaymentTerm=ko.observable(n.repaymentTerm);t.refRelationship=ko.observable(n.refRelationship);t.chosenOfferLoanAmount=ko.observable(n.chosenOfferLoanAmount);t.chosenOfferLoanTerm=ko.observable(n.chosenOfferLoanTerm);t.needReselectLoanPurpose=ko.observable(n.needReselectLoanPurpose);t.suppressLoanPurposeSelect=ko.observable(n.suppressLoanPurposeSelect);t.isLoanPurposeInBand=ko.observable(n.isLoanPurposeInBand);t.loanPurposeIsOther=ko.computed(function(){return t.loanPurposeId()==Constants.LOAN_PURPOSE_OTHER});t.errors=ko.validation.group(t,{deep:!1});t.setLoanOfferIdentifier=function(n,i,r){return t.loanOfferIdentifier(n),t.chosenOfferLoanAmount(i),t.chosenOfferLoanTerm(r),!0};t.setLoanPurposeMeetRequirements=function(n){return t.loanPurposeMeetsRequirements(n),n=="MEETS_REQUIREMENTS"&&t.needReselectLoanPurpose(!1),!0};t.setDisbursementMethod=function(n){return t.disbursementMethod(n),!0};t.disabledFinalisedMyLoanButton=ko.computed(function(){var n=!GlobalFunctions.isUndefinedOrEmptyString(t.loanOfferIdentifier()),i=!GlobalFunctions.isUndefinedOrEmptyString(t.disbursementMethod());return!n||!i?!0:!1});t.disabledContinueButton=ko.computed(function(){var f=!GlobalFunctions.isUndefinedOrEmptyString(t.loanOfferIdentifier()),e=!GlobalFunctions.isUndefinedOrEmptyString(t.disbursementMethod()),n=t.needReselectLoanPurpose(),i=t.isLoanPurposeInBand(),r=t.loanPurposeId(),o=!n||n&&(r!=undefined||r==Constants.LOAN_PURPOSE_OTHER),s=!i||i&&!GlobalFunctions.isUndefinedOrEmptyString(t.loanPurposeMeetsRequirements()),u=!1;return f&&e&&s&&o&&(u=!0),!u});t.getLoanPurposeTextInner=function(n){for(var f=[Constants.LOAN_PURPOSE_CHOICES,Constants.LOAN_PURPOSE_CHOICES_SACC1,Constants.LOAN_PURPOSE_CHOICES_SACC2,Constants.LOAN_PURPOSE_CHOICES_PERSONAL_LOAN],r,i,u,t=0;t<f.length;t++)for(r=f[t],i=0;i<r.length;i++)if(u=r[i],u.code==n)return u.name;return""};t.getRepaymentTermTextInner=function(n){for(var f=[Constants.REPAYMENT_TERM_CHOICES],r,i,u,t=0;t<f.length;t++)for(r=f[t],i=0;i<r.length;i++)if(u=r[i],u.code==n)return u.name;return""};t.getRelationshipTextInner=function(n){for(var f=[Constants.RELATIONSHIP_CHOICES],r,i,u,t=0;t<f.length;t++)for(r=f[t],i=0;i<r.length;i++)if(u=r[i],u.code==n)return u.name;return""};t.getOriginalLoanPurposeText=ko.computed(function(){var n=t.originalLoanPurposeId();return t.getLoanPurposeTextInner(n)},t,{deferEvaluation:!0});t.getLoanPurposeText=ko.computed(function(){var n=t.loanPurposeId();return t.getLoanPurposeTextInner(n)},t,{deferEvaluation:!0});t.getRepaymentTermText=ko.computed(function(){var n=t.repaymentTerm();return t.getRepaymentTermTextInner(n)},t,{deferEvaluation:!0});t.getRelationshipText=ko.computed(function(){var n=t.refRelationship();return t.getRelationshipTextInner(n)},t,{deferEvaluation:!0});t.getMessageText=function(n,i,r,u){var f=t.getLoanPurposeTextInner(r);return u?"We could not approve you for $"+n+" for the purpose of "+f+". Please confirm that the approved amount of $"+i+" still meets your requirements and objectives for the purpose of "+f+", or alternatively you can select another purpose.":"We could not approve you for $"+n+" for the purpose of "+f+". You have been approved for a loan of $"+i+" but we need to confirm your requirements and objectives for this amount if you still want to proceed. Please select the purpose of your $"+i+" loan below."};t.messageText=ko.observable();t.loanPurposeDropdownVisible=ko.computed(function(){return!t.isLoanPurposeInBand()||t.loanPurposeMeetsRequirements()=="SELECT_NEW_LOAN_PURPOSE"});t.triggerLoanPurposeLogic=function(){var n=parseFloat(t.originalLoanAmount()),u=parseFloat(t.chosenOfferLoanAmount()),f=t.determineLoanPurposeBandForAmount(n),i=t.determineLoanPurposeBandForAmount(u),r;f==i?t.needReselectLoanPurpose(!1):t.needReselectLoanPurpose(!0);!t.suppressLoanPurposeSelect()&&t.needReselectLoanPurpose()?(t.isLoanPurposeInBand(t.determineIsLoanPurposeInBand(t.originalLoanPurposeId(),i)),r=t.getMessageText(n,t.chosenOfferLoanAmount(),t.originalLoanPurposeId(),t.isLoanPurposeInBand()),t.messageText(r),t.loanPurposeId(undefined),t.showLightbox()):t.submitForm()};t.submitLoanOffer=function(){var n=t.errors();n.length>0?t.errors.showAllMessages():t.submitForm()};t.submitForm=function(){t.form&&t.form.submit()};t.determineLoanPurposeBandForAmount=function(n){console.log("*************determineLoanPurposeBandForAmount******************");var t=n;return t<100&&(t=100),t>5e3&&(t=5e3),t>=100&&t<600?"LOAN_PURPOSE_CHOICES_SACC1":t>=600&&t<=2e3?"LOAN_PURPOSE_CHOICES_SACC2":"LOAN_PURPOSE_CHOICES_PERSONAL_LOAN"};t.determineIsLoanPurposeInBand=function(n,t){var i=Constants[t],r,u;if(i!==undefined&&Array.isArray(i))for(r=0;r<i.length;r++)if(u=i[r],u.code==n)return!0;return!1};t.getLoanPurposeChoices=ko.computed(function(){var n,i;return console.log("*********getLoanPurposeChoices*************"),n=t.chosenOfferLoanAmount(),n<100&&(n=100),n>5e3&&(n=5e3),i=[],i=n>=100&&n<600?Constants.LOAN_PURPOSE_CHOICES_SACC1:n>=600&&n<=2e3?Constants.LOAN_PURPOSE_CHOICES_SACC2:Constants.LOAN_PURPOSE_CHOICES_PERSONAL_LOAN,window.setTimeout(function(){$("#LoanPurposeId").selectOrDie("update")},300),i});t.getRepaymentTermChoices=ko.computed(function(){return window.setTimeout(function(){$("#repaymentTerm").selectOrDie("update")},300),Constants.REPAYMENT_TERM_CHOICES});t.getRelationshipChoices=ko.computed(function(){return window.setTimeout(function(){$("#refRelationship").selectOrDie("update")},300),Constants.RELATIONSHIP_CHOICES});t.showLightbox=function(){$("#confirmLoanOfferLoanPurposePopup").length>0&&jQuery.magnificPopup.open({items:{src:"#confirmLoanOfferLoanPurposePopup"},type:"inline",closeOnContentClick:!1,closeOnBgClick:!1,enableEscapeKey:!1,callbacks:{close:function(){t.loanPurposeMeetsRequirements(undefined);t.loanPurposeId(undefined)}}},0)};t.init=function(){$(".view-all-repayments").on("click",function(n){var i=$(this).data("id");t.showRepayments(i);n.preventDefault()})};t.showRepayments=function(n){jQuery.magnificPopup.open({items:{src:"#loan-repayments-"+n},type:"inline"})};t.init()};CCGApp=CCGApp||{};CCGApp.ValidationRules=function(n,t,i,r){function p(){o||t===undefined||t.validation===undefined||t.validation.init===undefined||(t.validation.init({errorMessageClass:"application-form-error",decorateElement:!0,errorElementClass:"is-invalid",insertMessages:!0,grouping:{deep:!1}}),o=!0)}function w(n){n!==undefined&&(n.password&&n.password.extend({required:{message:"Please enter your password"},pattern:{params:"^[!-~]{6,}$",message:"Please enter a valid password. Your password must be at least 6 characters in length"}}),n.confirmPassword&&n.confirmPassword.extend({required:{message:"Please confirm your password"},mustEqual:{message:"Passwords do not match",params:n.password}}))}function b(n){n!==undefined&&(n.password&&n.password.extend({required:{message:"Please enter your password"},pattern:{params:"^[!-~]{6,}$",message:"Please enter a valid password. Your password must be at least 6 characters in length"}}),n.confirmPassword&&n.confirmPassword.extend({required:{onlyIf:n.validateConfirmationPassword,message:"Please confirm your password"},mustEqual:{onlyIf:n.validateConfirmationPassword,message:"Passwords do not match",params:n.password}}))}function s(n){n!==undefined&&(n.title.extend({required:{message:"Please select your title"}}),n.firstname.extend({required:{message:"Please enter your first name"}}),n.lastname.extend({required:{message:"Please enter your last name"}}),n.gender.extend({required:{message:"Please select an option"}}),n.dateOfBirth.extend({required:{message:"Please enter Date of Birth"},regPattern:{params:u,message:"Please enter a valid date (dd/mm/yyyy)"},isAtLeast18YearsOld:{message:"Sorry! You must be over the age of 18 to apply"},dateIsAfter:{message:"Please confirm Date of Birth",params:new Date(1900,0,1)},dateIsBefore:{message:"Must be a past date",params:new Date}}),n.isPermanentResident.extend({required:{message:"Please select an option for this question"}}),n.emailAddress.extend({required:{message:"Please enter a valid email address"},email:{message:"Please enter a valid email address"}}),n.password.extend({required:{onlyIf:n.isNewCustomer,message:"Please enter your password"},pattern:{params:"^[!-~]{6,}$",message:"Please enter a valid password. Your password must be at least 6 characters in length"}}),n.confirmPassword.extend({required:{onlyIf:n.doValidateConfirmPassword,message:"Please confirm your password "},mustEqual:{onlyIf:n.doValidateConfirmPassword,message:"Passwords do not match",params:n.password}}),n.identityEstablished.extend({required:{onlyIf:n.showIdentityEstablishError,message:"Please complete the section in green below to continue with your application"},mustEqual:{onlyIf:n.showIdentityEstablishError,message:"Please complete the section in green below to continue with your application",params:!0}}))}function h(n){n&&(n.refFirstName.extend({required:{message:"Please enter the Contact Reference first name"}}),n.refSurname.extend({required:{message:"Please enter the Contact Reference surname"}}),n.refBestContact.extend({required:{message:"Please enter your Contact’s phone number"}}),n.refRelationshipType.extend({required:{message:"Please select the Relationship with Reference"}}),n.refBestContact.extend({required:{message:"Please enter your mobile number"},mobileOrLandLine:{message:"Contact number has to be 10 digits in total and start with '04' or '02'",params:{type:Constants.CONTACT_TYPE_MOBILE,optional:!1}}}))}function k(n){n&&n.loanPurposeId.extend({required:{message:"Please specify loan purpose"}})}function d(n){n&&n.repaymentTerm.extend({required:{message:"Please specify the repayment terms"}})}function g(n,t){var i=t||{};n&&(n.driverLicenceNumber.extend({required:{onlyIf:n.hasDriverLicenceDetails,message:"Please enter driver licence number"},maxDigits:{onlyIf:n.hasDriverLicenceDetails,message:"Please enter no more than 15 digits",params:15}}),n.driverLicenceState.extend({required:{onlyIf:n.driverLicenceStateRequired,message:"Please choose driver licence state"}}),n.driverLicenceExpiryDate.extend({required:{onlyIf:n.hasDriverLicenceDetails,message:"Please enter expiry date"},regPattern:{onlyIf:n.hasDriverLicenceDetails,params:u,message:"Please enter a valid date (dd/mm/yyyy)"},dateIsAfter:{message:"Should be a valid future date",params:new Date}}),n.driverLicenceCardNumber.extend({required:{onlyIf:n.isDriverLicenceCardNumberRequired,message:"Please enter a Driver Licence Card Number. If you don't have one, please put 0000000000 in this field."},maxDigits:{onlyIf:n.hasDriverLicenceDetails,message:"Please enter no more than 10 digits",params:10},licenseCardNumber:{onlyIf:n.hasDriverLicenceDetails,params:n.driverLicenceCardNumber,message:"Please enter a Driver Licence Card Number. If you don't have one, please put 0000000000 in this field."}}),n.hasDriverLicenceDetails.subscribe(function(){n.driverLicenceNumber.isModified(!1);n.driverLicenceState.isModified(!1);n.driverLicenceExpiryDate.isModified(!1);n.driverLicenceCardNumber.isModified(!1)}),n.medicareNumber.extend({required:{onlyIf:n.hasMedicareCard,message:"Please provide your Medicare Number"},maxDigits:{onlyIf:n.hasMedicareCard,message:"Please enter no more than 10 digits",params:10},medicareNum:{onlyIf:n.hasMedicareCard,params:n.MedicareNumber,message:"Please enter a valid Medicare Number"}}),n.medicarePosition.extend({required:{onlyIf:n.hasMedicareCard,message:"Please provide your Medicare Reference Number"},maxDigits:{onlyIf:n.hasMedicareCard,message:"Please enter no more than 1 digit",params:1},number:{message:"Number please"}}),n.hasMedicareCard.subscribe(function(){n.medicareNumber.isModified(!1);n.medicarePosition.isModified(!1)}),n.passportNumber.extend({required:{onlyIf:n.hasPassportDetails,message:"Please enter a Passport Number"}}),n.hasPassportDetails.subscribe(function(){n.passportCountryOfBirth.isModified(!1);n.passportCountryOfIssue.isModified(!1);n.passportPlaceOfBirth.isModified(!1);n.passportFamilyNameAtBirth.isModified(!1);n.passportFirstNameAtCitizenship.isModified(!1);n.passportFamilyNameAtCitizenship.isModified(!1)}),n.passportCountryOfBirth.extend({required:{onlyIf:n.hasPassportDetails,message:"Please select a Country of Birth"}}),n.passportCountryOfIssue.extend({required:{onlyIf:n.hasPassportDetails,message:"Please select a Country of Issue"}}),n.passportPlaceOfBirth.extend({required:{onlyIf:n.hasPassportDetails,message:"Please enter a valid Place of Birth"}}),n.passportFamilyNameAtBirth.extend({required:{onlyIf:n.hasPassportDetails,message:"Please enter a valid Last Name at Birth"}}),n.passportFirstNameAtCitizenship.extend({required:{onlyIf:n.hasPassportDetails,message:"Please enter a valid Citizenship First Name"}}),n.passportFamilyNameAtCitizenship.extend({required:{onlyIf:n.hasPassportDetails,message:"Please enter a valid Citizenship Last Name"}}))}function nt(n,t){var i=t||{};n&&(n.driverLicenceNumber.extend({required:{onlyIf:n.hasDriverLicenceDetails,message:"Please enter your driver’s licence number. This is labelled as 5a on your licence. If you do not have a licence then please enter 00000000 in this field."},maxDigits:{onlyIf:n.hasDriverLicenceDetails,message:"Please enter no more than 30 characters",params:30}}),n.driverLicenceVersion.extend({required:{onlyIf:n.hasDriverLicenceDetails,message:"Please enter your driver’s licence version. This is labelled as 5b on your licence. If you do not have a licence then please enter 000 in this field"},maxDigits:{onlyIf:n.hasDriverLicenceDetails,message:"Please enter no more than 30 characters",params:30}}),n.nzaaMembershipNumber.extend({required:{onlyIf:n.hasNZAAMembershipNumber,message:"Please enter your passport expiry date - DD/MM/YYYY. If you do not have an NZAA membership then please enter 000000000000000000 in this field."},maxDigits:{onlyIf:n.hasNZAAMembershipNumber,message:"Please enter no more than 16 digits",params:16}}),n.passportNumber.extend({required:{onlyIf:n.hasPassportDetails,message:"Please enter your passport number. If you do not have a passport then please enter 00000000 in this field"}}),n.passportExpiryDate.extend({required:{onlyIf:n.hasPassportDetails,message:"Please enter your passport expiry date - DD/MM/YYYY. If you do not have a passport then please enter 01/01/2020 in this field"},dateIsAfter:{onlyIf:n.hasPassportDetails,message:"Please confirm Passport expiry date",params:new Date}}))}function tt(n){n&&(n.homePhone.extend({phoneNumber:{message:"Phone number has to be 10 digits in total. please include the area code if it's a landline number",params:{type:Constants.CONTACT_TYPE_HOME,optional:!0}}}),n.mobilePhone.extend({required:{message:"Please enter your mobile number"},phoneNumber:{message:"Mobile number has to be 10 digits in total and start with '04'",params:{type:Constants.CONTACT_TYPE_MOBILE,optional:!1}}}))}function it(n){n&&(n.homePhone.extend({phoneNumberNZ:{message:"Phone number has to be 9 digits in total. Please include the area code if it's a landline number",params:{type:Constants.CONTACT_TYPE_HOME,optional:!0}}}),n.mobilePhone.extend({required:{message:"Please enter your mobile number"},phoneNumberNZ:{message:"Mobile number should start with '02' followed by 7 to 9 digits",params:{type:Constants.CONTACT_TYPE_MOBILE,optional:!1}}}))}function rt(n,t){t=t||{};n&&(t.addressRequiredMessage=t.addressRequiredMessage||"Please enter your address",n.address.extend({required:{onlyIf:n.mustAsk,message:t.addressRequiredMessage},throttle:500}),n.durationIsValid.extend({mustEqual:{onlyIf:n.mustAskAndRequireEndDate,params:!0,message:"Address date range is invalid"}}),n.streetNumber.extend({required:{onlyIf:n.mustAskAndHasAddress,message:"Please enter street number"}}),n.streetName.extend({required:{onlyIf:n.mustAskAndHasAddress,message:"Please enter street name"}}),n.streetType.extend({required:{onlyIf:n.mustAskAndHasAddress,message:"Please enter street type"}}),n.suburb.extend({required:{onlyIf:n.mustAskAndHasAddress,message:"Please enter suburb"}}),t.isForeignAddress?n.postcode.extend({required:{onlyIf:n.mustAskAndHasAddress,message:"Please enter postcode"}}):(n.state.extend({required:{onlyIf:n.mustAskAndHasAddress,message:"Please enter state"},ausStates:{onlyIf:n.mustAskAndHasAddress,message:"Invalid state"}}),n.postcode.extend({required:{onlyIf:n.mustAskAndHasAddress,message:"Please enter postcode"},ausPostcode:{onlyIf:n.mustAskAndHasAddress,message:"Please enter an Australian postcode"}})),n.timeAtAddressYears.extend({required:{onlyIf:n.mustAsk,message:"Please select the number of years"}}),n.timeAtAddressMonths.extend({required:{onlyIf:n.mustAsk,message:"Please select the number of months"}}))}function ut(n,t){t=t||{};n&&(t.addressRequiredMessage=t.addressRequiredMessage||"Please enter your address",n.address.extend({required:{onlyIf:n.mustAsk,message:t.addressRequiredMessage},throttle:500}),n.durationIsValid.extend({mustEqual:{onlyIf:n.mustAskAndRequireEndDate,params:!0,message:"Address date range is invalid"}}),n.streetNumber.extend({required:{onlyIf:n.mustAskAndHasAddress,message:"Please enter street number"}}),n.streetName.extend({required:{onlyIf:n.mustAskAndHasAddress,message:"Please enter street name"}}),n.streetType.extend({required:{onlyIf:n.mustAskAndHasAddress,message:"Please enter street type"}}),n.city.extend({required:{onlyIf:n.mustAskAndHasAddress,message:"Please enter city"}}),n.postcode.extend({required:{onlyIf:n.mustAskAndHasAddress,message:"Please enter postcode"},ausPostcode:{onlyIf:n.mustAskAndHasAddress,message:"Please enter an New Zealand postcode"}}),n.timeAtAddressYears.extend({required:{onlyIf:n.mustAsk,message:"Please select the number of years"}}),n.timeAtAddressMonths.extend({required:{onlyIf:n.mustAsk,message:"Please select the number of months"}}))}function c(n){n&&n.employmentStatus.extend({required:{message:"Please enter employment status"}})}function ft(n){n&&n.modelName=="JobModel"&&(n.employerCompanyName.extend({required:{onlyIf:n.mustAskAndEmployed,message:"Please enter your employer's name"}}),n.employerContactNumber.extend({required:{onlyIf:n.mustAskAndEmployed,message:"Please enter your employer's contact number"},phoneNumber:{onlyIf:n.mustAskAndEmployed,params:undefined,message:"Please check that the phone number is correct"}}),n.occupation.extend({required:{onlyIf:n.doValidateOccupation,message:"Please enter occupation"}}),n.employmentStartDate.extend({regPattern:{onlyIf:n.mustAskAndEmployed,params:u,message:"Please enter a valid date (dd/mm/yyyy)"},employmentStartDateRequiredForEmployed:{onlyIf:n.mustAskAndEmployed,message:"Please enter the date you started at this employer"},employmentStartDateRequiredForUnemployed:{onlyIf:n.mustAskAndUnemployed,message:"Please enter the date you become unemployed"},dateIsAfter:{onlyIf:n.mustAskAndEmployed,message:"Please confirm start date",params:new Date(1900,0,1)},dateIsBefore:{onlyIf:n.mustAskAndEmployed,message:"Should be a past date",params:new Date}}),n.employmentEndDate.extend({regPattern:{onlyIf:n.mustAskAndRequireEndDate,params:"^([0-9]{1,2}[ ]*(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[ ]*(19|2[0-9])[0-9]{2,2})|([0-9]{4}-[0-9]{2}-[0-9]{2,2})|([0-9]{1,2}/[0-9]{1,2}/(19|2[0-9])[0-9]{2,2})$",message:"Please enter a valid date (dd/mm/yyyy)"},required:{onlyIf:n.mustAskAndRequireEndDate,message:"Please specify the year you ended this employment"},dateIsAfter:{onlyIf:n.mustAskAndRequireEndDate,message:"Should be after start date",params:n.employmentStartDate},dateIsBefore:{onlyIf:n.mustAskAndRequireEndDate,message:"Should be a past date",params:new Date}}))}function et(n){n&&n.modelName=="JobModel"&&(n.employerCompanyName.extend({required:{onlyIf:n.mustAskAndEmployed,message:"Please enter your employer's name"}}),n.employerContactNumber.extend({required:{onlyIf:n.mustAskAndEmployed,message:"Please enter your employer's contact number"},phoneNumberNZ:{onlyIf:n.mustAskAndEmployed,params:undefined,message:"Please check that the phone number is correct"}}),n.occupation.extend({required:{onlyIf:n.doValidateOccupation,message:"Please enter occupation"}}),n.employmentStartDate.extend({regPattern:{onlyIf:n.mustAskAndEmployed,params:u,message:"Please enter a valid date (dd/mm/yyyy)"},employmentStartDateRequiredForEmployed:{onlyIf:n.mustAskAndEmployed,message:"Please enter the date you started at this employer"},employmentStartDateRequiredForUnemployed:{onlyIf:n.mustAskAndUnemployed,message:"Please enter the date you become unemployed"},dateIsAfter:{onlyIf:n.mustAskAndEmployed,message:"Please confirm start date",params:new Date(1900,0,1)},dateIsBefore:{onlyIf:n.mustAskAndEmployed,message:"Should be a past date",params:new Date}}),n.employmentEndDate.extend({regPattern:{onlyIf:n.mustAskAndRequireEndDate,params:"^([0-9]{1,2}[ ]*(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[ ]*(19|2[0-9])[0-9]{2,2})|([0-9]{4}-[0-9]{2}-[0-9]{2,2})|([0-9]{1,2}/[0-9]{1,2}/(19|2[0-9])[0-9]{2,2})$",message:"Please enter a valid date (dd/mm/yyyy)"},required:{onlyIf:n.mustAskAndRequireEndDate,message:"Please specify the year you ended this employment"},dateIsAfter:{onlyIf:n.mustAskAndRequireEndDate,message:"Should be after start date",params:n.employmentStartDate},dateIsBefore:{onlyIf:n.mustAskAndRequireEndDate,message:"Should be a past date",params:new Date}}))}function f(n){n&&(n.incomeFrequency.extend({required:{onlyIf:n.hasIncomeAmount,message:"Please enter income frequency"}}),n.incomeAmount.extend({required:{onlyIf:n.hasIncomeFrequency,message:"Please enter income amount"},customMin:{params:0,message:"Please check income amount"},customMax:{params:9999999999.99,message:"Please check income amount"}}))}function ot(n){n&&(n.creditor.extend({required:{message:"Please enter creditor name"}}),n.repaymentAmount.extend({required:{message:"Please enter repayment amount"},customMin:{params:0,message:"Minimum repayment should be more than $0"}}),n.repaymentFrequency.extend({required:{message:"Please enter repayment frequency"}}))}function l(n){n!==undefined&&typeof n.hasAtLeastOneFulltimeOrGovernmentBenefit!="undefined"&&n.hasAtLeastOneFulltimeOrGovernmentBenefit.extend({mustEqual:{params:!0,message:"At least one source of Employment Income must be populated"}})}function a(n,t){var t=t||{};n&&(n.canForeseeReasonLoanCannotBeRepaid.extend({required:{message:"Please select an option for this question"}}),n.agreeToTermsAndConditions.extend({required:{message:"Please acknowledge that you agree to the above."},mustEqual:{message:"Please acknowledge that you agree to the above.",params:!0}}),n.informationIsTrueAndAccurate.extend({required:{message:"Please acknowledge that you have provided true and correct information."},mustEqual:{message:"Please acknowledge that you have provided true and correct information.",params:!0}}))}function v(n){n&&(n.rentMortgageRepayment.extend({required:{message:"Please enter your rent/mortgage expenses"},customMin:{params:0,message:"Rent/mortgage expenses cannot be less than $0"},customMax:{params:9999999999.99,message:"Living Expenses value is too high"}}),n.rentMortgagePaymentFrequencyId.extend({required:{message:"Please choose one"}}),n.livingExpensesAmount.extend({required:{message:"Please enter your living expenses"},customMin:{params:0,message:"Living Expenses cannot be less than $0"},customMax:{params:9999999999.99,message:"Living Expenses value is too high"}}),n.livingExpensesPaymentFrequencyId.extend({required:{message:"Please choose one"}}),n.numberOfCreditCards.extend({required:{message:"Please enter your number of credit cards"},maxDigits:{params:2,message:"Should be no more than 2 digits"}}),n.totalLimitOfCreditCards.extend({required:{message:"Please enter total limit of your credit cards"}}),n.totalMonthlyLoanRepayment.extend({required:{message:"Please enter how much you pay every month for your loan repayments. If you have no loans, just put in 0"},customMin:{params:0,message:"Total monthly loan repayment cannot be less than $0"},customMax:{params:9999999999.99,message:"Total monthly loan repayment value is too high"}}))}function e(n){n&&(n.bsb.extend({required:{onlyIf:n.isValidationEnabled,message:"Please enter a valid BSB number."},maxDigits:{onlyIf:n.isValidationEnabled,message:"Please enter no more than 6 digits",params:6},valrulebsbnumber:{onlyIf:n.isValidationEnabled,message:"Please enter a valid BSB",params:n}}),n.accountNumber.extend({required:{onlyIf:n.isValidationEnabled,message:"Please enter an account number"},minDigits:{onlyIf:n.isValidationEnabled,message:"Please enter at least 6 digits",params:6},maxDigits:{onlyIf:n.isValidationEnabled,message:"Please enter no more than 30 digits",params:30}}),n.accountName.extend({required:{onlyIf:n.isValidationEnabled,message:"Please enter an account name"}}))}function y(n){n!==undefined&&(n.residentialStatus.extend({required:{message:"Please select the Residential Status"}}),n.maritalStatus.extend({required:{message:"Please select a Marital Status"}}),n.isSoleIncomeEarner.extend({required:{message:"Please select an option for this question"}}),n.numberOfDependants.extend({required:{message:"Please select number of dependents"}}))}function st(n,t){var t=t||{};n&&(n.useExistingDetails.extend({required:{message:"Please select an option for this question"}}),n.useExistingIncomeDetails.extend({required:{onlyIf:function(){return t.hasYodleeCredentials},message:"Please select an option for this question"}}),n.useWalletWizardVisa.extend({required:{onlyIf:function(){return t.hasActivatedEMerchantCard},message:"Please select an option for this question"}}))}function ht(n){var n=n||{},i=new WalletWizardCalculatorModel({loanAmount:n.loanAmount,loanFrequency:n.loanFrequency,countryCode:n.countryCode,netAmount:n.netAmount,refinanceAmount:n.refinanceAmount,maxCapacity:n.maxCapacity,creditProduct:n.creditProduct,creditlimit:n.creditlimit});t.applyBindings(i,document.getElementById("loanfilter"))}function ct(i){var i=i||{},g=i.personModel||new r["PersonalDetailModel"+i.countryCode],nt=i.contactReferenceDetail||new ContactReferenceModel,tt=i.loanPurposeModel||new LoanPurposeModel,it=i.repaymentTermModel||new RepaymentTermModel,rt=i.identificationDetail||new r["IdentificationDetailModel"+i.countryCode],bt=new JobModel({employerCompanyNameCaption:"Employer Company Name",mustAsk:!0,requireEndDate:!1,mustAskJobTitle:!0,mustAskOccupation:!0,employerContactNumberCaption:"Employer Contact Number",durationChangedTopicName:"employmentEurationChanged",isCurrentEmployment:!0}),kt=new JobModel({employerCompanyNameCaption:"Previous Employer Company Name",mustAsk:!1,requireEndDate:!0,mustAskJobTitle:!1,mustAskOccupation:!1,employerContactNumberCaption:"Previous Employer Contact Number",otherDurationChangedTopicName:"employmentDurationChanged",isCurrentEmployment:!1}),p=i.employmentDetail||new EmploymentModel({currentJob:bt,previousJob:kt}),ut=i.contactDetailCollection||new ContactDetailCollectionModel,ft=i.currentAddress||new AddressModel({caption:"Current Address",mustAsk:!0,requireStartDate:!0,requireEndDate:!1}),et=i.previousAddress||new AddressModel({caption:"Previous Address",mustAsk:!1,requireStartDate:!0,requireEndDate:!0}),w=i.refAddress||new AddressModel({caption:"Reference Address",mustAsk:!0,requireStartDate:!1,requireEndDate:!1}),u,ct,lt,vt,yt,pt,wt;w.timeAtAddressMonths(10);w.timeAtAddressYears(10);u=i.addressCollection||new AddressCollectionModel({currentAddress:ft,previousAddress:et,refAddress:w});u.currentAddress===undefined&&(u.currentAddress=ft);u.previousAddress===undefined&&(u.previousAddress=et);u.refAddress===undefined&&(u.refAddress=w);var ot=i.expenses,b=i.bankDetail,st=i.miscInfo,ht=i.financialCapabilityModel,o={};i.incomeSources===undefined||i.incomeSources!==undefined&&i.incomeSources.incomeSources().length==0?(ct=new IncomeSourceModel({mustAsk:!0,isGovernmentBenefit:!1,isAfterTax:!0,incomeSource:Constants.FIELD_CAPTION_EMPLOYMENT_INCOME,incomeSourceId:Constants.INCOME_SOURCE_OTHER}),lt=new IncomeSourceModel({mustAsk:!0,isGovernmentBenefit:!0,isAfterTax:!1,incomeSource:Constants.FIELD_CAPTION_GOVERNMENT_BENEFITS,incomeSourceId:Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT}),f(ct),f(lt),o=new IncomeSourcesModel([ct,lt])):(o=i.incomeSources,t.utils.arrayForEach(o.incomeSources(),function(n){f(n)}));at(o.incomeSources());vt=new FixedLoanModel;yt=new FixedLoansModel({collection:[vt]});b.isValidationEnabled=function(){return!0};s(g);h(nt);k(tt);d(it);this["applyToIdentificationDetailModel"+i.countryCode](rt);this["applyToAddressDetailModel"+i.countryCode](ft);this["applyToAddressDetailModel"+i.countryCode](et);this["applyToAddressDetailModel"+i.countryCode](w,{addressRequiredMessage:"Please enter contact reference address"});this["applyToContactCollectionModel"+i.countryCode](ut);this["applyToJobModel"+i.countryCode](p.currentJob);this["applyToJobModel"+i.countryCode](p.previousJob);c(p);l(o);v(ot);e(b);a(st,{countryCode:i.countryCode});y(ht);pt={countryCode:i.countryCode,form:n("#appForm"),loanPurposeDetails:tt,repaymentTermDetails:it,personDetails:g,identificationDetails:rt,addressDetails:u,contactDetails:ut,contactReferenceDetails:nt,employmentDetails:p,incomeSources:o,expenses:ot,bankDetailsModel:b,miscInfoModel:st,financialCapabilityModel:ht};wt=new WalletWizardApplicationFormModel(pt);t.applyBindings(g,document.getElementById("personDetailsSection"));t.applyBindings(nt,document.getElementById("contactReferenceSection"));t.applyBindings(u,document.getElementById("referenceAddressSection"));t.applyBindings(tt,document.getElementById("loanPurposeSection"));t.applyBindings(it,document.getElementById("repaymentTermSection"));t.applyBindings(rt,document.getElementById("identificationDetailsSection"));t.applyBindings(p,document.getElementById("employmentDetailSection"));t.applyBindings(u,document.getElementById("addressCollectionSection"));t.applyBindings(ut,document.getElementById("contactDetailCollectionSection"));t.applyBindings(o,document.getElementById("incomeSection"));t.applyBindings(ot,document.getElementById("expensesSection"));t.applyBindings(b,document.getElementById("bankDetailsSection"));t.applyBindings(st,document.getElementById("miscInfoSection"));t.applyBindings(ht,document.getElementById("financialCapabilitySection"));t.applyBindings(yt,document.getElementById("fixedLoanContainer"));t.applyBindings(wt,document.getElementById("formSubmitSection"));n("#monthlyLoanCalculationPopupLaunch").magnificPopup({items:[{src:"#monthlyLoanCalculatorPopup",type:"inline"}]})}function lt(i,r){var f={form:n("#appForm")},u=new DrawDownApplicationFormModel(i,f);st(u,r);e(u.bankDetails);t.applyBindings(u,document.getElementById("drawDownSection"))}function at(n){n!==undefined&&n.sort(function(n,t){var u=n.isGovernmentBenefit(),f=t.isGovernmentBenefit(),i,r;return!u&&f?-1:u&&!f?1:!n.isEitherFulltimeOrGovernmentBenefit()&&!t.isEitherFulltimeOrGovernmentBenefit()?(i=n.incomeAmount(),r=t.incomeAmount(),i>r?-1:i==r?0:1):void 0})}function vt(n){n.loanPurposeModel.loanPurposeId(undefined);n.repaymentTermModel.repaymentTerm(undefined);n.miscInfo.canForeseeReasonLoanCannotBeRepaid(undefined);n.miscInfo.agreeToTermsAndConditions(undefined);n.miscInfo.subscribeToNewsAndOffers(undefined);n.miscInfo.informationIsTrueAndAccurate(undefined);n.miscInfo.MarketingConsent(undefined)}function yt(i,u){var f=i,b,k,d;u=u||{};u.countryCode=u.countryCode||"";var c=n.evalJSON(f.personDetail),tt=n.evalJSON(f.contactReferences||"{}"),h=n.evalJSON(f.expenses||"{}"),v=n.evalJSON(f.incomeSources||"[]"),it=n.evalJSON(f["bankDetail"+u.countryCode]||"{}"),y=n.evalJSON(f.miscellaneousInfo||"{}"),o=n.evalJSON(f.currentEmploymentDetail||"{}"),e=n.evalJSON(f.previousEmploymentDetail||"{}"),l=n.evalJSON(f.currentAddress||"{}"),a=n.evalJSON(f.previousAddress||"{}"),rt=n.evalJSON(f["identificationDetails"+u.countryCode]||"{}"),ut=new FinancialCapabilityModel({residentialStatus:c.residentialStatus,isSoleIncomeEarner:c.isSoleIncomeEarner,maritalStatus:c.maritalStatus,numberOfDependants:c.numberOfDependants}),ft=new LoanPurposeModel({loanPurposeId:f.loanPurposeId}),et=new r["PersonalDetailModel"+u.countryCode](c),ot=new RepaymentTermModel({repaymentTerm:f.repaymentTerm}),st=new ExpenseModel({rentMortgageRepayment:GlobalFunctions.useSelfOrDefaultValue(h.rentMortgageRepayment,undefined,u.initWithDefaultValues),rentMortgagePaymentFrequencyId:h.rentMortgagePaymentFrequencyId,livingExpensesAmount:GlobalFunctions.useSelfOrDefaultValue(h.livingExpensesAmount,undefined,u.initWithDefaultValues),livingExpensesPaymentFrequencyId:h.livingExpensesPaymentFrequencyId,numberOfCreditCards:GlobalFunctions.useSelfOrDefaultValue(h.numberOfCreditCards,undefined,u.initWithDefaultValues),totalLimitOfCreditCards:GlobalFunctions.useSelfOrDefaultValue(h.totalLimitOfCreditCards,undefined,u.initWithDefaultValues),totalMonthlyLoanRepayment:GlobalFunctions.useSelfOrDefaultValue(h.totalMonthlyLoanRepayment,undefined,u.initWithDefaultValues)}),s=[],p=!1,w=!1;v.length>0&&t.utils.arrayForEach(v,function(n){s.push(new IncomeSourceModel(n));n.incomeFrequency==Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT?w=!0:p=!0});s.length==1?(w||s.push(new IncomeSourceModel({incomeSourceId:Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT,isGovernmentBenefit:!0,isAfterTax:!0})),p||s.push(new IncomeSourceModel({incomeSourceId:Constants.INCOME_SOURCE_OTHER,isGovernmentBenefit:!1,isAfterTax:!0}))):s.length==0&&(s.push(new IncomeSourceModel({incomeSourceId:Constants.INCOME_SOURCE_OTHER,isGovernmentBenefit:!1,isAfterTax:!0})),s.push(new IncomeSourceModel({incomeSourceId:Constants.INCOME_SOURCE_GOVERNMENT_BENEFIT,isGovernmentBenefit:!0,isAfterTax:!0})));b=new IncomeSourcesModel(s);k=new r["BankDetailModel"+u.countryCode](it);y.canForeseeReasonLoanCannotBeRepaid=f.canForeseeReasonLoanCannotBeRepaid;d=new MiscInfoModel(y);o.requireEndDate=!1;o.mustAsk=!0;o.mustAskJobTitle=!0;o.mustAskOccupation=!0;o.isCurrentEmployment=!0;o.durationChangedTopicName="currentJobDurationChanged";e.requireEndDate=!0;e.mustAsk=!1;e.mustAskJobTitle=!1;e.mustAskOccupation=!1;e.isCurrentEmployment=!1;e.otherDurationChangedTopicName="previousJobDurationChanged";e.employerCompanyNameCaption="Previous Employer Company Name";e.employerContactNumberCaption="Previous Employer Contact Number";var ht=new JobModel(o),ct=new JobModel(e),lt=new EmploymentModel({employmentStatus:o.employmentStatus,currentJob:ht,previousJob:ct}),at=new ContactReferenceModel({}),vt=new ContactDetailCollectionModel({homePhone:f.homePhone,mobilePhone:f.mobilePhone});tt.mustAsk=!0;l.mustAsk=!0;l.requireStartDate=!0;l.requireEndDate=!1;l.durationChangedTopicName="currentAddressDurationChanged";a.mustAsk=!1;a.requireStartDate=!0;a.requireEndDate=!0;a.otherDurationChangedTopicName="previousAddressDurationChanged";var g=new AddressModel(l),nt=new AddressModel(a),yt=new AddressCollectionModel({residentialStatus:c.residentialStatus,currentAddress:g,previousAddress:nt}),pt=new r["IdentificationDetailModel"+u.countryCode](rt);return{loanPurposeModel:ft,repaymentTermModel:ot,personModel:et,contactReferenceDetailModel:at,expenses:st,incomeSources:b,addressCollection:yt,identificationDetail:pt,contactDetailCollection:vt,employmentDetail:lt,bankDetail:k,miscInfo:d,currentAddress:g,previousAddress:nt,financialCapabilityModel:ut}}function pt(n){n!==undefined&&(n.firstname.extend({required:{message:"Please enter your first name"}}),n.lastname.extend({required:{message:"Please enter your last name"}}),n.dateOfBirth.extend({required:{message:"Please enter date of birth"},regPattern:{params:u,message:"Please enter a valid date (dd/mm/yyyy)"},isAtLeast18YearsOld:{message:"Sorry! You must be over the age of 18 to apply"},dateIsAfter:{message:"Please confirm Date of Birth",params:new Date(1900,0,1)},dateIsBefore:{message:"Must be a past date",params:new Date}}),n.emailAddress.extend({required:{message:"Please enter a valid email address"},email:{message:"Please enter a valid email address"}}))}function wt(n){n&&n.isDrawdown()===!0?n.agreeToDebitAuthority.extend({required:{onlyIf:n.inspectedAllOfContract,message:"You must read and agree to the Direct Debit Service Agreement and authorise the Direct Debit request to proceed"},mustEqual:{onlyIf:n.inspectedAllOfContract,message:"You must read and agree to the Direct Debit Service Agreement and authorise the Direct Debit request to proceed",params:!0}}):!n||n.isCLInrease()===!0?n&&n.isCLInrease()===!1&&n.agreedTermsAndConditions.extend({required:{onlyIf:n.inspectedAllOfContract,message:"You must read and agree to the Terms and Conditions to proceed"},mustEqual:{onlyIf:n.inspectedAllOfContract,message:"You must read and agree to the Terms and Conditions to proceed",params:!0}}):(n.agreedTermsAndConditions.extend({required:{onlyIf:n.inspectedAllOfContract,message:"You must read and agree to the Terms and Conditions to proceed"},mustEqual:{onlyIf:n.inspectedAllOfContract,message:"You must read and agree to the Terms and Conditions to proceed",params:!0}}),n.agreeToDebitAuthority.extend({required:{onlyIf:n.inspectedAllOfContract,message:"You must read and agree to the Direct Debit Service Agreement and authorise the Direct Debit request to proceed"},mustEqual:{onlyIf:n.inspectedAllOfContract,message:"You must read and agree to the Direct Debit Service Agreement and authorise the Direct Debit request to proceed",params:!0}}),n.agreeToPrivacyDisclosureStatement.extend({required:{onlyIf:n.inspectedAllOfContract,message:"You must read and agree to the Privacy Disclosure Statement to proceed"},mustEqual:{onlyIf:n.inspectedAllOfContract,message:"You must read and agree to the Privacy Disclosure Statement to proceed",params:!0}}))}function bt(n){n&&n.consentForBankAccountAccess.extend({required:{message:"Please provide your consent to continue"},mustEqual:{message:"Please provide your consent to continue",params:!0}})}function kt(n){n&&(n.loanOfferIdentifier.extend({required:{message:"Please select a loan offer"}}),n.disbursementMethod.extend({required:{message:"Please select a disbursement method"}}))}var o=!1,u="^(([0-9]{1,2}[ ]*(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[ ]*(19|2[0-9])[0-9]{2,2})|([0-9]{4}-[0-9]{2}-[0-9]{2,2})|([0-9]{1,2}/[0-9]{1,2}/(19|2[0-9])[0-9]{2,2}))$";return{initKOValidation:p,mapJSONToModels:yt,bindApplicationFormModel:ct,bindDrawDownApplicationFormModel:lt,bindLoanCalculatorModel:ht,clearEssentialQuestions:vt,applyToPersonDetailModelInApplicationForm:s,applyToContactReferenceModel:h,applyToIdentificationDetailModel:g,applyToIdentificationDetailModelNZ:nt,applyToAddressDetailModel:rt,applyToAddressDetailModelNZ:ut,applyToContactCollectionModel:tt,applyToContactCollectionModelNZ:it,applyToEmploymentModel:c,applyToJobModel:ft,applyToJobModelNZ:et,applyToIncomeSourceModel:f,applyToFixedLoanModel:ot,applyToIncomeSourcesModel:l,applyToExpensesModel:v,applyToBankDetailModel:e,applyToMiscellanousModel:a,applyToFinancialCapabilityModel:y,applyToNewPassword:w,applyToReturningCustomerModel:b,applyToRegisterModel:pt,applyToContractModel:wt,applyToLoanOfferModel:kt,applyToYodleeForm:bt}}(jQuery,ko,Modernizr,window);$(function(n){function e(n){return(ko.contextFor(n)||{}).$data}function h(n){return typeof n.unitNumber=="function"?n:n.address!==undefined&&typeof n.address.unitNumber=="function"?n.address:n}function d(n,t){var u=tt(t),f=it(t),r=y(t),h=g(t,r,f,u),e=v(t,r),i=nt(t,e),o="",s="";i&&i.length>1&&(s=i[0],o=i[1]);k(n,s,o,e,r,h,f,u)}function l(n,i){var n=h(n),b,s,r,u,f,c,e,v,y;if(o(n),b={},n!==undefined&&i!==undefined)for(s=0;s<i.length;s++)if(r=i[s],t("subpremise",r.types)!=-1)n.unitNumber(r.long_name);else if(t("street_number",r.types)!=-1)n.streetNumber(r.long_name);else if(t("route",r.types)!=-1)if(u=r.long_name,f=w(r.long_name),f!=undefined&&f.streetTypeAbbr!=undefined&&f.streetType!=undefined){n.streetType(f.streetType);c=f.streetTypeAbbr;c==undefined&&(c="");var k=u.toLowerCase(),l=u.split(" "),a=[];for(e=0;e<l.length;e++)if(l[e].toLowerCase()==f.streetTypeAbbr.toLowerCase())break;else a.push(l[e]);a.length>0?n.streetName($.trim(a.join(" "))):(v=k.indexOf(f.streetTypeAbbr.toLowerCase()),v>=0?(u=u.substring(0,v),n.streetName($.trim(u))):n.streetName($.trim(u)))}else n.streetName($.trim(u));else t("postal_code",r.types)!=-1?n.postcode(r.long_name):t("sublocality_level_1",r.types)!=-1?n.suburb(r.long_name):t("locality",r.types)!=-1?n.suburb(r.long_name):t("administrative_area_level_1",r.types)!=-1&&(y=p(r.long_name),n.state(y))}function a(n,i){var n=h(n),u,c,r,f,e,l,s,y;if(o(n),u={},n!==undefined&&i!==undefined){for(c=0;c<i.length;c++)if(r=i[c],t("subpremise",r.types)!=-1)n.unitNumber(r.long_name);else if(t("street_number",r.types)!=-1)n.streetNumber(r.long_name);else if(t("route",r.types)!=-1)if(f=r.long_name,e=w(r.long_name),e!=undefined&&e.streetTypeAbbr!=undefined&&e.streetType!=undefined){n.streetType(e.streetType);l=e.streetTypeAbbr;l==undefined&&(l="");var p=f.toLowerCase(),a=f.split(" "),v=[];for(s=0;s<a.length;s++)if(a[s].toLowerCase()==e.streetTypeAbbr.toLowerCase())break;else v.push(a[s]);v.length>0?n.streetName($.trim(v.join(" "))):(y=p.indexOf(e.streetTypeAbbr.toLowerCase()),y>=0?(f=f.substring(0,y),n.streetName($.trim(f))):n.streetName($.trim(f)))}else n.streetName($.trim(f));else t("postal_code",r.types)!=-1?n.postcode(r.long_name):t("sublocality_level_1",r.types)!=-1?u.sublocality_level_1=r.long_name:t("locality",r.types)!=-1?u.locality=r.long_name:t("administrative_area_level_1",r.types)!=-1&&(u.administrative_area_level_1=r.long_name);u.sublocality_level_1!==undefined?(n.suburb(u.sublocality_level_1),n.city(u.locality)):n.city(u.locality);n.state(u.administrative_area_level_1)}}function g(n,t,i,r){var u="",o,f;if(n&&t){var s=n.toUpperCase().indexOf(t.toUpperCase()),e=n.toUpperCase().indexOf((" "+i+" ").toUpperCase()),h=-1;r!=""&&(h=n.toUpperCase().indexOf(r.toUpperCase()));e==-1&&(o=rt(i),o&&(e=n.toUpperCase().indexOf(o.toUpperCase())));f=h;(f==-1||f>e)&&(f=e);s>0&&f>0&&(u=n.substring(0,f),u=u.substring(s+t.length).replace(/[,]/g,""),u=$.trim(u))}return u}function nt(n,t){var r="",f="",u;if(n&&t){for(var s=t||v(n),e=n.toUpperCase().indexOf(s.toUpperCase()),i=e,o=!1;i>0;)if(u=n[i],u.charCodeAt()>=48&&u.charCodeAt()<=57&&(o=!0),(u==" "||u==","||u=="/")&&o)break;else i--;i<0&&i==0;f=n.substring(i,e);f=$.trim(f.replace(/[, ]/g,""));i-1>0&&(r=n.substring(0,i-1),r=r.replace(/[, \/]/,"").replace(/Unit/i,"").replace(/[uU]/i,""),r=$.trim(r))}return[r,f]}function v(n,t){var r,u;if(n){for(var e=t||y(n),f=n.toLowerCase().indexOf(e.toLowerCase()),i=f-1;i>0;)if(r=n[i].charCodeAt(),r<48||r>57)i--;else break;if(i>=0,u=n.substring(i+1,f),u!=undefined)return $.trim(u)}return""}function y(n){var f,u,t,e,o;if(n)for(f=n.normalize_space(),u=f.split(" "),i=0;i<u.length;i++)for(t=u[i].replace(/[, ]/g,"").toUpperCase(),c=0;c<r.length;c++){if(e=t.indexOf(r[c]),e>=0)return r[c];if(o=b(t),o!=null)return t}return""}function tt(n){var t=n.match(/[0-9]{4}/);return t?t[0]:""}function it(n){for(var e=n.normalize_space(),r=e.split(" "),o,i,s,t=0;t<f.length;t++)if(e.toLowerCase().indexOf(f[t].toLowerCase())>-1)return p(f[t]);if(r!=null)for(t=0;t<r.length;t++)for(o=r[t].toUpperCase(),i=0;i<u.length;i++)if(s=o.indexOf(u[i].toUpperCase()),s!=-1)return u[i];return""}function p(n){var r=["NSW","QLD","VIC","NT","WA","ACT","SA","TAS"],i=["NewSouthWales","Queensland","Victoria","NorthernTerritory","WesternAustralia","AustralianCapitalTerritory","SouthAustralia","Tasmania"],t;if(n)for(n=n.replace(/\s/g,""),t=0;t<i.length;t++)if(n.toUpperCase()==i[t].toUpperCase())return r[t];return""}function w(n){var i,f,u,e,o;return n&&(i=n.split(" "),i&&i.length>0&&(f=i[i.length-1],u=b(f),u!=null&&(f=u.name.replace(/[.\s]/g,"")),e=t(f.toUpperCase(),r),e>=0))?(o=r[e],u&&(o=u.abbr),{streetTypeAbbr:o,streetType:r[e]}):{}}function b(n){var i,r,t;if(n)for(n=n.replace(". ").toLowerCase(),i=0;i<s.length;i++)if(r=s[i],t=r.split(":"),t&&n==t[0])return{abbr:t[0],name:t[1]};return null}function rt(n){for(var t=0;t<u.length;t++)if(u[t].toUpperCase()==n)return f[t]}function k(n,t,i,r,u,f,e,o){if(n!==undefined){var s=n;typeof s.unitNumber!="function"&&(s=n.address);s.streetNumber(i);s.unitNumber(t);s.streetName(r);s.streetType(u);s.suburb(f);s.state(e);s.postcode(o)}}function o(n){k(n,"","","","","","","")}function t(n,t){for(var i=0;i<t.length;i++)if(n==t[i])return i;return-1}String.prototype.normalize_space=function(){return this.replace(/^\s*|\s(?=\s)|\s*$/g,"")};var u=["NSW","VIC","NT","SA","WA","QLD","TAS","ACT"],f=["New South Wales","Victoria","Northern Territory","South Australia","Western Australia","Queensland","Tasmania","Australian Capital Territory"],r=["ALLEY","APPROACH","ARCADE","AVENUE","BOULEVARD","BROW","BYPASS","CAUSEWAY","CIRCLE","CIRCUIT","CIRCUS","CLOSE","COPSE","CORNER","COURT","COVE","CRESCENT","DRIVE","END","ESPLANADE","FLAT","FREEWAY","FRONTAGE","GAP","GARDENS","GLADE","GLEN","GREEN","GROVE","HEIGHTS","HIGHWAY","LANE","LINK","LOOP","MALL","MEWS","PACKET","PARADE","PARK","PARKWAY","PASS","PLACE","PL","PROMENADE","QUAY","QUAYS","RESERVE","REST","RIDGE","RISE","ROAD","ROW","SQUARE","STREET","STRIP","TARN","TERRACE","THOROUGHFARE","TRACK","TRUNKWAY","VIEW","VISTA","WALK","WALKWAY","WAY","YARD"],s=["st:STREET","rd:ROAD","hwy:HIGHWAY","ln:LANE","ave:AVENUE","dr:DRIVE","fwy:FREEWAY","sq:SQUARE","pl:PLACE","parade:PARADE","pde:PARADE","ct:COURT","crescent:CRESCENT","circuit:CIRCUIT","blvd:BOULEVARD"];return $("input[address-searchfield]").each(function(){var t=$(this),u=t.get()[0],s=t.attr("address-searchfield"),i=$('div[address-fieldcontainer="'+s+'"]'),h=$('div[address-showfields-fieldcontainer="'+s+'"]'),r,f;h.length>0?i=h:i.slideUp();r=t.val();f=r.indexOf(",");f>0&&(r=r.substring(0,f),r=$.trim(r));t.bind("keydown",function(n){var r,f;n.keyCode===9&&(r=e(u),f=t.attr("ko-addressobservablename"),f.length>0&&(r=r[f]),o(r),d(r,t.val()),i.slideDown())}).bind("click",function(){$(this).val()!=""&&i.slideDown()}).bind("blur",function(){i.slideDown()}).autocomplete({minLength:4,source:function(n,r){var u=t.val(),f=u.indexOf(","),e;f>0&&(u=u.substring(0,f),u=$.trim(u));u!=""&&(e={searchInput:u},CCGApp.WalletWizardAPI.addressServiceGetPossibleMatches(e,{successCallback:function(n){n?r(n):i.slideDown()}}))},appendTo:"#addresspopup",focus:function(n,i){var r=e(u),f=t.attr("ko-addressobservablename"),o=r[f];return o.address(i.item.value),!1},select:function(r,f){var o=e(u),h=t.attr("ko-addressobservablename"),c=o[h],s;c.address(f.item.value);s={reference:f.item.reference};CCGApp.WalletWizardAPI.addressServiceParseAddressParts(s,{successCallback:function(r){var u=$.evalJSON(r),e=t.attr("ko-addressobservablename"),f=o[e];f!==undefined&&u.result!==undefined&&u.result.address_components!==undefined&&(n.countryCode=="NZ"?a(f,u.result.address_components):l(f,u.result.address_components));i.slideDown()}})}})}),{populateAddressFields:l,populateAddressFieldsNZ:a}}(window))