1"use strict";(self.webpackChunktheme_boilerplate=self.webpackChunktheme_boilerplate||[]).push([[2339],{2339:function(t,e,n){n.r(e);var a,o,r=function(t,e,n){return'\n <div class="t7t-calculator__table-row">\n <div>'.concat(t.initial_pay_rate,"%</div>\n <div>").concat(t.mortgage_class,"</div>\n <div>").concat(t.initial_rate_period_months," month(s)</div>\n <div>").concat(t.max_ltv_available,"%</div>\n <div>").concat(parseFloat(t.initial_monthly_payment).toLocaleString("en",{style:"currency",currency:"GBP"}),"</div>\n <div>Yes</div>\n <div>").concat(t.apr_lenders,'% APRC Representative</div>\n <div>\n <a\n href="').concat(n,'"\n class="t7t-calculator__more-info-button"\n data-index="').concat(e,'"\n >contact us</a>\n </div>\n </div>\n')},l={apiPath:"/twenty7tec/mortgage_products",inputFormSelector:"t7t-calculator__details-form",resultsTableSelector:"t7t-calculator__results-table",maxNumberOfResultsInTable:10,last_products:[],last_inputs:{},serializeParams:function(t){var e=[];return Object.keys(t).forEach((function(n){return"PropertyCost"===n||"LoanRequired"===n?e.push("".concat(n,"=").concat(l.priceStringToNumber(t[n]))):e.push("".concat(n,"=").concat(t[n]))})),"?".concat(e.join("&"))},productRows:function(t){for(var e=l.options.contactLink,n=void 0===e?"#mortgage-contact-form":e,a="",o=0;o<t.length&&o<l.maxNumberOfResultsInTable;o+=1)a+=r(t[o],o,n);return a},resultsBody:function(t){return'<div class="t7t-calculator__table-body">'.concat(l.productRows(t),"</div>")},createResultsTable:function(t,e){var n=document.getElementById(l.resultsTableSelector);e?(n.innerHTML='\n<div class="t7t-calculator__header-row">\n <div>\n <a\n href="#initial-rate"\n data-attribute="initial-rate"\n title="click to find out more"\n class="content-guide-tooltip"\n >initial rate</a>\n </div>\n <div>\n <a\n href="#initial-rate"\n data-attribute="type-of-mortgage"\n title="click to find out more"\n class="content-guide-tooltip"\n >type of mortgage</a>\n </div>\n <div>\n <a\n href="#initial-rate"\n data-attribute="initial-rate-period"\n title="click to find out more"\n class="content-guide-tooltip"\n >initial rate period</a>\n </div>\n <div>\n <a\n href="#initial-rate"\n data-attribute="max-ltv"\n title="click to find out more"\n class="content-guide-tooltip"\n >max LTV</a>\n </div>\n <div>\n <a\n href="#initial-rate"\n data-attribute="initial-monthly-cost"\n title="click to find out more"\n class="content-guide-tooltip"\n >initial monthly cost</a>\n </div>\n <div>\n <a\n href="#initial-rate"\n data-attribute="product-fees"\n title="click to find out more"\n class="content-guide-tooltip"\n >product fees</a>\n </div>\n <div>\n <a\n href="#initial-rate"\n data-attribute="overall-cost-for-comparison"\n title="click to find out more"\n class="content-guide-tooltip"\n >overall cost of comparison</a>\n </div>\n <div></div>\n</div>\n'+l.resultsBody(e),l.options.onContactUs&&(l.last_products=e,l.last_inputs=t)):n.innerHTML='<div class="t7t-calculator__no-results">Sorry, there were no results found matching your criteria</div>',l.loaded(e)},submitFormInputs:function(t){var e=l.apiPath+l.serializeParams(t);return fetch(e).then((function(t){return t.json()}))},captureFormInputs:function(t){return t.preventDefault(),{PropertyCost:document.getElementById("PropertyCost").value,LoanRequired:document.getElementById("LoanRequired").value,MortgageClass:document.getElementById("MortgageClass").value,Term:document.getElementById("Term").value,AgencyID:window.agencyId}},createInputsForm:function(){document.getElementById(l.inputFormSelector).innerHTML='\n<div class="t7t-calculator__form">\n <div class="t7t-calculator__control-wrapper t7t-calculator__control-wrapper--currency">\n <label for="PropertyCost" class="t7t-calculator__label">purchase price</label>\n <input\n type="text"\n min="0"\n step="1000"\n data-number-to-fixed="2"\n placeholder="e.g. £250000"\n data-number-stepfactor="1000"\n class="t7t-calculator__control"\n id="PropertyCost"\n data-input-key-validator="numeric"\n />\n </div>\n\n <div class="t7t-calculator__control-wrapper t7t-calculator__control-wrapper--currency">\n <label for="LoanRequired" class="t7t-calculator__label">amount to borrow</label>\n <input\n type="text"\n value=""\n min="0"\n step="1000"\n data-number-to-fixed="2"\n placeholder="e.g. £200000"\n data-number-stepfactor="1000"\n class="t7t-calculator__control"\n id="LoanRequired"\n data-input-key-validator="numeric"\n />\n </div>\n\n <div class="t7t-calculator__control-wrapper">\n <label for="Term" class="t7t-calculator__label">length of mortgage</label>\n <select id="Term" class="t7t-calculator__control">\n <option value="" invalid="">please select</option>\n <option value="5">5 years</option>\n <option value="10">10 years</option>\n <option value="15">15 years</option>\n <option value="20">20 years</option>\n <option value="25">25 years</option>\n <option value="30">30 years</option>\n <option value="35">35 years</option>\n <option value="40">40 years</option>\n </select>\n </div>\n\n <div class="t7t-calculator__control-wrapper">\n <label for="MortgageClass" class="t7t-calculator__label">type of mortgage</label>\n <select id="MortgageClass" class="t7t-calculator__control">\n <option value="" invalid="">please select</option>\n <option value="all">all</option>\n <option value="fixed">fixed</option>\n <option value="tracker">tracker</option>\n </select>\n </div>\n</div>\n\n<div class="t7t-calculator__validation-bar">\n <div class="t7t-calculator__validation-bar-item t7t-calculator__validation-bar-item--PropertyCost">\n <svg viewBox="0 0 1024 1024">\n <path d="M864 192 l -480 480 -224 -224 -160 160 384 384 640 -640z" />\n </svg>\n\n </div>\n <div class="t7t-calculator__validation-bar-item t7t-calculator__validation-bar-item--LoanRequired">\n <svg viewBox="0 0 1024 1024">\n <path d="M864 192 l -480 480 -224 -224 -160 160 384 384 640 -640z" />\n </svg>\n </div>\n <div class="t7t-calculator__validation-bar-item t7t-calculator__validation-bar-item--Term">\n <svg viewBox="0 0 1024 1024">\n <path d="M864 192 l -480 480 -224 -224 -160 160 384 384 640 -640z" />\n </svg>\n </div>\n <div class="t7t-calculator__validation-bar-item t7t-calculator__validation-bar-item--MortgageClass">\n <svg viewBox="0 0 1024 1024">\n <path d="M864 192 l -480 480 -224 -224 -160 160 384 384 640 -640z" />\n </svg>\n </div>\n</div>\n\n<div class="t7t-calculator__button-wrapper">\n <button type="submit" class="t7t-calculator__button t7t-calculator__button--disabled">show results</button>\n</div>\n'},createContainer:function(){var t=l.options.containerSelector;document.getElementById(t).innerHTML='\n<form role="form" id="t7t-calculator__details-form">\n\n</form>\n\n<div class="t7t-calculator__loading"></div>\n\n<div id="t7t-calculator__results-table">\n\n</div>\n'},loading:function(){var t=l.options.loadingElement;t&&(document.querySelector(".t7t-calculator__loading").innerHTML=t),document.getElementById(l.resultsTableSelector).innerHTML="";var e=l.options.onResultsDisplayed;e&&e(null)},loaded:function(t){document.querySelector(".t7t-calculator__loading").innerHTML="",document.querySelector(".t7t-calculator__button").innerHTML="update results";var e=l.options.onResultsDisplayed;e&&e(t)}
1,handleSubmit:function(t){var e=l.captureFormInputs(t),n=l.submitFormInputs(e);l.loading(),n.then((function(t){l.createResultsTable(e,t)})).catch((function(t){l.createResultsTable(e,null),console.error("An error occured",t)}))},numberToPriceString:function(t){var e=l.options.hideCurrencySign;return"".concat(e?"":"£").concat(parseInt(t,10).toLocaleString())},priceStringToNumber:function(t){return parseInt(t.replace("£","").replace(/,/g,""),10)},handleInputChange:function(t){var e=l.options.formatPrices,n=void 0===e||e,a=t.currentTarget.id,o=document.querySelector(".t7t-calculator__validation-bar-item--".concat(a));""===t.currentTarget.value?o.classList.remove("t7t-calculator__validation-bar-item--active"):o.classList.add("t7t-calculator__validation-bar-item--active");var r=document.querySelectorAll(".t7t-calculator__validation-bar-item--active").length,i=document.querySelector(".t7t-calculator__button");if(r<4?(i.classList.add("t7t-calculator__button--disabled"),i.disabled=!0):(i.classList.remove("t7t-calculator__button--disabled"),i.disabled=!1),"PropertyCost"===a||"LoanRequired"===a){var c=l.priceStringToNumber(document.getElementById("PropertyCost").value),u=l.priceStringToNumber(document.getElementById("LoanRequired").value);if(n){var s=t.target,d=s.value.replace(/\D/g,"");Number.isNaN(parseInt(d,10))&&(d=0);var v=l.numberToPriceString(d);s.value=v}c<u&&c>0&&(document.getElementById("LoanRequired").value=n?l.numberToPriceString(c):c)}},addEventListeners:function(){var t=l.options,e=t.onContactUs,n=t.containerSelector;document.getElementById(l.inputFormSelector).addEventListener("submit",l.handleSubmit);for(var a=document.querySelectorAll(".t7t-calculator__control"),o=0;o<a.length;o+=1)a[o].addEventListener("change",l.handleInputChange);e&&document.getElementById(n).addEventListener("click",(function(t){var n=t.target;if(n.classList.contains("t7t-calculator__more-info-button")){t.stopPropagation();var a=n.getAttribute("data-index");e(t,l.last_inputs,l.last_products[a])}}))}};o=(a={containerSelector:"mortgage-finder",onContactUs:function(t,e,n){var a={type:n.mortgage_class,initialRate:n.initial_pay_rate,ltv:n.max_ltv_available,followOnCost:n.monthly_payment_after_initial_period,overallCostComparison:n.apr_lenders};if(a){var o=document.querySelector("#PropertyCost").value,r=document.querySelector("#LoanRequired").value,l=document.querySelector("#Term").value,i=document.querySelector("#MortgageClass").value,c="I am interested in a mortgage:\nType of mortgage: ".concat(a.type,"\nInitial rate: ").concat(a.initialRate,"%\nLTV: ").concat(a.ltv,"%\nFollow on monthly cost: £").concat(a.followOnCost,"\nOverall cost comparison: ").concat(a.overallCostComparison,"% APRC Representative\n\nI have selected these options:\n\nPurchase price: ").concat(o,"\nAmount to borrow: ").concat(r,"\nLength of mortgage: ").concat(l,"\nType of mortgage: ").concat(i),u=document.querySelector("#additional_information");u&&(u.value=c)}}}).containerSelector,document.getElementById(o)&&(l.options=a,l.createContainer(),l.createInputsForm(),l.addEventListeners())}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.