{"version":3,"sources":["webpack:///./src/views/Calculators.vue","webpack:///./src/components/Calculators/HomeLoanCalculator.vue","webpack:///./src/components/Calculators/HomeLoanCalculator.vue?2349","webpack:///./src/components/Calculators/HomeLoanCalculator.vue?6315","webpack:///./src/components/Calculators/HomeLoanCalculator.vue?db1a","webpack:///./src/views/Calculators.vue?71db","webpack:///./src/views/Calculators.vue?7fac","webpack:///./src/views/Calculators.vue?d3d1","webpack:///./src/components/Calculators/HomeLoanCalculator.vue?ff51"],"names":["render","_vm","this","_c","_self","_setupProxy","attrs","staticClass","_v","staticRenderFns","loading","_e","hideAmount","directives","name","rawName","value","principal","expression","domProps","on","$event","target","composing","calculate","depositAmount","needsLMI","_m","loanTerm","interestRate","result","length","_s","HomeLoanCalculator","Vue","constructor","amount","mounted","API","Calculators","GetHomeLoanConfig","then","config","InterestRate","rate","repayments","monthly","Math","max","ceil","toLocaleString","__decorate","Prop","default","Component","components","Loader","component","Mixins","View"],"mappings":"yHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAUF,EAAIG,MAAMC,YAAY,OAAOF,EAAG,OAAO,CAACA,EAAG,eAAe,CAACG,MAAM,CAAC,KAAO,OAAO,MAAQ,iBAAiBH,EAAG,aAAa,CAACA,EAAG,mBAAmB,CAACI,YAAY,6BAA6B,CAACJ,EAAG,eAAe,CAACF,EAAIO,GAAG,yBAAyBL,EAAG,uBAAuB,IAAI,IAAI,IAE/UM,EAAkB,G,oCCFlBT,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAUF,EAAIG,MAAMC,YAAY,OAAOF,EAAG,MAAM,CAACI,YAAY,wBAAwB,CAACJ,EAAG,aAAa,CAACG,MAAM,CAAC,KAAO,SAAS,CAAEL,EAAIS,QAASP,EAAG,MAAM,CAACI,YAAY,iCAAiC,CAACJ,EAAG,SAAS,CAACG,MAAM,CAAC,QAAUL,EAAIS,YAAY,GAAGT,EAA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,IAAI,CAACG,MAAM,CAAC,KAAO,oEAAoE,OAAS,SAAS,IAAM,aAAa,CAACL,EAAIO,GAAG,SAASP,EAAIO,GAAG,U,gWCQrW,IAAqByB,EAArB,cAAgDC,OAAhDC,c,oBAOU,KAAAlB,UAAYf,KAAKkC,OAEjB,KAAAX,cAA8B,GAAdvB,KAAKkC,OAErB,KAAAR,SAAW,GAEX,KAAAC,aAAe,EAEf,KAAAnB,SAAU,EAEV,KAAAoB,OAAS,GAET,KAAAJ,UAAW,EAEnBW,UACEC,OAAIC,YAAYC,oBAAoBC,KAAMC,IACxCxC,KAAK2B,aAAea,EAAOC,aAE3BzC,KAAKQ,SAAU,EAEfR,KAAKsB,cAITA,YACE,MAAMoB,EAAQ1C,KAAK2B,aAAe,GAAM,IAClCgB,EAA6B,GAAhB3C,KAAK0B,SAElBX,EAAYf,KAAKe,UAAYf,KAAKuB,cAExCvB,KAAKwB,SAAWxB,KAAKuB,cAAgBvB,KAAKe,UAAY,GAEtD,MAAM6B,EAAUC,KAAKC,IAAI,EAAG/B,IAAc8B,SAAC,EAAIH,EAASC,GAAa,IAAMD,EAAOG,SAAC,EAAIH,EAASC,MAEhG3C,KAAK4B,OAAS,IAAIiB,KAAKE,KAAKH,GAASI,mBAvCvCC,GADCC,kBACD,iCAGAD,GADCC,eAAK,CAAEC,QAAS,OACjB,6BALmBpB,EAAkB,GALtCqB,eAAU,CACTC,WAAY,CACVC,kBAGiBvB,WCV0Y,I,wBCQ3ZwB,EAAY,eACd,EACA,EACA,GACA,EACA,KACA,WACA,MAIa,EAAAA,E,gVCRf,IAAqBlB,EAArB,cAAyCmB,eAAOC,WAA3BpB,EAAW,GAL/Be,eAAU,CACTC,WAAY,CACVtB,yBAGiBM,WCXiX,ICOlY,EAAY,eACd,EACAvC,EACAS,GACA,EACA,KACA,WACA,MAIa,e,kEClBf","file":"js/chunk-53597883.d4a166fb.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('Page',[_c('SiteMasthead',{attrs:{\"mini\":\"true\",\"title\":\"Calculators\"}}),_c('ContentRow',[_c('ContentContainer',{staticClass:\"content-container--medium\"},[_c('SectionTitle',[_vm._v(\"Mortgage Calculator\")]),_c('HomeLoanCalculator')],1)],1)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"home-loan-calculator\"},[_c('transition',{attrs:{\"name\":\"fade\"}},[(_vm.loading)?_c('div',{staticClass:\"home-loan-calculator__loading\"},[_c('Loader',{attrs:{\"loading\":_vm.loading}})],1):_vm._e()]),_c('div',{staticClass:\"home-loan-calculator__fields\"},[(!_vm.hideAmount)?_c('div',{staticClass:\"form-field\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.principal),expression:\"principal\"}],staticClass:\"form-field__input form-field__input--has-value\",attrs:{\"type\":\"number\",\"step\":\"1\",\"min\":\"50000\",\"placeholder\":\"E.g. 500,000\"},domProps:{\"value\":(_vm.principal)},on:{\"input\":[function($event){if($event.target.composing)return;_vm.principal=$event.target.value},_vm.calculate]}}),_c('label',{staticClass:\"form-field__label\"},[_vm._v(\"Property Price ($)\")])]):_vm._e(),_c('div',{staticClass:\"form-field\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.depositAmount),expression:\"depositAmount\"}],staticClass:\"form-field__input form-field__input--has-value\",attrs:{\"type\":\"number\",\"step\":\"1\",\"min\":\"0\",\"placeholder\":\"E.g. 100,000\"},domProps:{\"value\":(_vm.depositAmount)},on:{\"input\":[function($event){if($event.target.composing)return;_vm.depositAmount=$event.target.value},_vm.calculate]}}),_c('label',{staticClass:\"form-field__label\"},[_vm._v(\"Deposit Amount ($)\")])]),(_vm.needsLMI)?_c('div',{staticClass:\"alert\"},[_c('Icon',{staticClass:\"alert__icon\",attrs:{\"icon\":\"info\",\"colour\":\"white\"}}),_vm._m(0)],1):_vm._e(),_c('div',{staticClass:\"form-field\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.loanTerm),expression:\"loanTerm\"}],staticClass:\"form-field__input form-field__input--has-value\",attrs:{\"type\":\"number\",\"step\":\"1\",\"min\":\"1\",\"placeholder\":\"E.g. 30\"},domProps:{\"value\":(_vm.loanTerm)},on:{\"input\":[function($event){if($event.target.composing)return;_vm.loanTerm=$event.target.value},_vm.calculate]}}),_c('label',{staticClass:\"form-field__label\"},[_vm._v(\"Loan Term (years)\")])]),_c('div',{staticClass:\"form-field\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.interestRate),expression:\"interestRate\"}],staticClass:\"form-field__input form-field__input--has-value\",attrs:{\"type\":\"number\",\"step\":\"0.01\",\"min\":\"0.01\",\"placeholder\":\"E.g. 2.9\"},domProps:{\"value\":(_vm.interestRate)},on:{\"input\":[function($event){if($event.target.composing)return;_vm.interestRate=$event.target.value},_vm.calculate]}}),_c('label',{staticClass:\"form-field__label\"},[_vm._v(\"Interest Rate (% PA)\")])])]),_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.result.length),expression:\"result.length\"}],staticClass:\"home-loan-calculator__result\"},[_c('div',{staticClass:\"home-loan-calculator__result__value\"},[_c('div',{staticClass:\"home-loan-calculator__result__value__content\"},[_vm._v(_vm._s(_vm.result))]),_c('div',{staticClass:\"home-loan-calculator__result__value__unit\"},[_vm._v(\"per month est.\")])])])],1)\n}\nvar staticRenderFns = [function (){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('p',{staticClass:\"alert__content\"},[_vm._v(\" Based on your deposit amount, you may need to take out \"),_c('a',{attrs:{\"href\":\"https://moneysmart.gov.au/glossary/lenders-mortgage-insurance-lmi\",\"target\":\"_blank\",\"rel\":\"nofollow\"}},[_vm._v(\"LMI\")]),_vm._v(\". \")])\n}]\n\nexport { render, staticRenderFns }","\r\nimport { API } from 'client-website-ts-library/services';\r\nimport { Component, Prop, Vue } from 'vue-property-decorator';\r\nimport Loader from '../UI/Loader.vue';\r\n\r\n@Component({\r\n components: {\r\n Loader,\r\n },\r\n})\r\nexport default class HomeLoanCalculator extends Vue {\r\n @Prop()\r\n private readonly hideAmount!: boolean;\r\n\r\n @Prop({ default: 500000 })\r\n private readonly amount!: number;\r\n\r\n private principal = this.amount;\r\n\r\n private depositAmount = this.amount * 0.2;\r\n\r\n private loanTerm = 30;\r\n\r\n private interestRate = 0;\r\n\r\n private loading = true;\r\n\r\n private result = '';\r\n\r\n private needsLMI = false;\r\n\r\n mounted() {\r\n API.Calculators.GetHomeLoanConfig().then((config) => {\r\n this.interestRate = config.InterestRate;\r\n\r\n this.loading = false;\r\n\r\n this.calculate();\r\n });\r\n }\r\n\r\n calculate() {\r\n const rate = (this.interestRate / 12) / 100;\r\n const repayments = this.loanTerm * 12;\r\n\r\n const principal = this.principal - this.depositAmount;\r\n\r\n this.needsLMI = this.depositAmount / this.principal < 0.2;\r\n\r\n const monthly = Math.max(0, principal / (((1 + rate) ** repayments - 1) / (rate * (1 + rate) ** repayments)));\r\n\r\n this.result = `$${Math.ceil(monthly).toLocaleString()}`;\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--15-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HomeLoanCalculator.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--15-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HomeLoanCalculator.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./HomeLoanCalculator.vue?vue&type=template&id=4f924d6e&scoped=true&\"\nimport script from \"./HomeLoanCalculator.vue?vue&type=script&lang=ts&\"\nexport * from \"./HomeLoanCalculator.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./HomeLoanCalculator.vue?vue&type=style&index=0&id=4f924d6e&prod&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"4f924d6e\",\n null\n \n)\n\nexport default component.exports","\r\nimport { Component, Mixins } from 'vue-property-decorator';\r\nimport { View } from 'client-website-ts-library/plugins';\r\n\r\nimport HomeLoanCalculator from '@/components/Calculators/HomeLoanCalculator.vue';\r\n\r\n@Component({\r\n components: {\r\n HomeLoanCalculator,\r\n },\r\n})\r\nexport default class Calculators extends Mixins(View) {\r\n}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--15-3!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Calculators.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--15-3!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Calculators.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Calculators.vue?vue&type=template&id=34d808aa&scoped=true&\"\nimport script from \"./Calculators.vue?vue&type=script&lang=ts&\"\nexport * from \"./Calculators.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"34d808aa\",\n null\n \n)\n\nexport default component.exports","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--7-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--7-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HomeLoanCalculator.vue?vue&type=style&index=0&id=4f924d6e&prod&scoped=true&lang=css&\""],"sourceRoot":""}