1"use strict";(self.webpackChunkfab2=self.webpackChunkfab2||[]).push([[885],{29885:(e,l,a)=>{a.r(l),a.d(l,{default:()=>I});var n=a(1413),o=a(88391),t=a(94629),i=a(62172),s=a(67430),d=a(52691),r=a(63449),c=a(75404),u=a(48436),v=a.n(u),x=a(30429),m=a.n(x),h=a(88179),p=a.n(h),b=a(37378),g=(a(17146),a(48607)),f=a.n(g),y=a(9663),w=a.n(y),j=a(62576),L=a(76589),S=a(23712);function N(){for(var e="#",l=0;l<6;l++)e+="0123456789ABCDEF"[Math.floor(16*Math.random())];return e}f()(m()),w()(m());const I=(0,d.Z)()((e=>{let{fields:l={},t:a,params:d,i18n:u,context:x}=e;const h=null===x||void 0===x?void 0:x.pageEditing,{title:g,description:f,items:y,currency:w,titleTag:I}=l,{salaryLabel:E,salarySubLabel:Z,salaryMin:_,salaryMax:T,salaryMaxLength:M,salaryPlaceholder:D,salaryStep:P,salaryAdornmentText:V}=l,{otherIncomeLabel:C,otherIncomeSubLabel:F,otherIncomeMin:k,otherIncomeMax:A,otherIncomeMaxLength:G,otherIncomePlaceholder:H,otherIncomeStep:O,otherIncomeAdornmentText:U}=l,{addExpenseButtonLabel:W,newExpenseLabel:B,newExpensePlaceholder:J,newExpenseMin:R,newExpenseMax:X,newExpenseMaxLength:z,newExpenseAdornmentText:Q,newExpenseStep:q}=l,{moneyGrowText:K,moneyGrowTitle:Y,totalExpensesLabel:$,totalIncomeLabel:ee,closeToIncomeText:le,closeToIncomeWarning:ae,exceedIncomeWarning:ne,exceedIncomeText:oe,closeToIncomePercentage:te}=l,ie={value:0},se=!(null===g||void 0===g||!g.value),de=!(null===f||void 0===f||!f.value),re=!(null===w||void 0===w||!w.value),ce=Array.isArray(y)&&(null===y||void 0===y?void 0:y.length)>0,[ue,ve]=(0,o.useState)(null===ie||void 0===ie?void 0:ie.value),[xe,me]=(0,o.useState)(null===ie||void 0===ie?void 0:ie.value),he=[],pe=[],be=ce?he:[],[ge,fe]=(0,o.useState)(pe),[ye,we]=(0,o.useState)(be),[je,Le]=(0,o.useState)(0),[Se,Ne]=(0,o.useState)(0),[Ie,Ee]=(0,o.useState)([]),[Ze,_e]=(0,o.useState)(""),Te=new i.UP(E,Z,ie,_,T,M,D,P,V),Me=new i.UP(C,F,ie,k,A,G,H,O,U),De=!(null===K||void 0===K||!K.value),Pe=!(null===Y||void 0===Y||!Y.value),Ve=!(null===$||void 0===$||!$.value),Ce=!(null===ee||void 0===ee||!ee.value),Fe=!(null===W||void 0===W||!W.value),ke=!(null===ae||void 0===ae||!ae.value),Ae=!(null===le||void 0===le||!le.value),Ge=!(null===ne||void 0===ne||!ne.value),He=!(null===oe||void 0===oe||!oe.value);ce&&(null===y||void 0===y||y.map((e=>{var l,a;pe.push(null===e||void 0===e||null===(l=e.fields)||void 0===l||null===(a=l.color)||void 0===a?void 0:a.value),he.push((0,n.Z)((0,n.Z)({},e),{},{inputValue:0}))}))),(0,o.useEffect)((()=>{Le("number"===typeof ue?"number"===typeof xe?ue+xe:ue:xe)}),[ue,xe]),(0,o.useEffect)((()=>{let e=0;if(null===ye||void 0===ye||ye.map((l=>{"number"===typeof(null===l||void 0===l?void 0:l.inputValue)&&(e+=null===l||void 0===l?void 0:l.inputValue)})),0===e)return Ne(e),void Ee([]);const l=[];null===ye||void 0===ye||ye.map((a=>{var n,o;null===l||void 0===l||l.push({name:null===a||void 0===a||null===(n=a.fields)||void 0===n||null===(o=n.categoryLabel)||void 0===o?void 0:o.value,y:Math.round((null===a||void 0===a?void 0:a.inputValue)/e*100,2)})})),Ee(l),Ne(e)}),[ye]);const Oe={lang:{resetZoom:a("Label_ResetZoom"),resetZoomTitle:a("Label_ResetZoomTitle"),downloadPNG:a("Label_DownloadPNGImage"),downloadJPEG:a("Label_DownloadJPEGImage"),downloadPDF:a("Label_DownloadPDFImage"),downloadSVG:a("Label_DownloadSVGImage"),printChart:a("Label_Printchart"),viewFullscreen:a("Label_ViewInFullscreen"),viewData:a("Label_ViewDataTable"),downloadCSV:a("Label_DownloadCSV"),downloadXLS:a("Label_DownloadXLS")}};!(0,L.Q)(null===u||void 0===u?void 0:u.language)&&m().setOptions(Oe);const Ue={chart:{backgroundColor:"transparent",borderColor:"transparent",className:"highchart-custom",height:338,width:280,spacing:[0,0,0,0],selectionMarkerFill:"none"},accessibility:{point:{valueSuffix:"%"}},legend:{enabled:!0,layout:"vertical",align:"right",verticalAlign:"right",itemMarginTop:10},exporting:{chartOptions:{legend:{verticalAlign:"top",layout:"vertical"}}},plotOptions:{pie:{colors:ge,dataLabels:{enabled:!1,tooltip:{visible:!1}}},series:{showInLegend:!0}},title:{text:""},tooltip:{headerFormat:"",pointFormat:'<span style="color:{point.color}">\u25cf</span> <b> {point.name}: {point.y}%</b><br/>'},credits:{enabled:!1},series:[{type:"pie",innerSize:"50%",borderWidth:0,name:"Expense",data:0===(null===Ie||void 0===Ie?void 0:Ie.length)?[{color:"#5C89D7",name:"",y:100}]:Ie}]};let We="";if(0!==Se&&0!==je)if(Se>=je)We="exceeds";else{Se/je*100>=(null===te||void 0===te?void 0:te.value)&&(We="close")}return(0,S.jsxs)("div",{id:"lifeStyleCalc",className:(0,s.Z)("life-style-calculator content","add-margins",null===d||void 0===d?void 0:d.Styles),children:[(se||de)&&(0,S.jsxs)("div",{className:"car-loan-heading",children:[se&&(0,S.jsx)(r.x,{className:"car-loan-title",field:g,tag:(0,j.l)(I,"h2")}
1),de&&(0,S.jsx)(c.H,{className:"global-rich-text car-loan-heading_description",field:f})]}),(0,S.jsxs)("div",{className:"car-loan-calculator-content-container",children:[(0,S.jsxs)("div",{className:"content-container-left",children:[(0,S.jsx)(t.Z,(0,n.Z)((0,n.Z)({t:a},Te),{},{value:ue,setValue:ve,isEditorMode:h})),(0,S.jsx)(t.Z,(0,n.Z)((0,n.Z)({t:a},Me),{},{value:xe,setValue:me,isEditorMode:h})),ce&&(null===ye||void 0===ye?void 0:ye.map(((e,l)=>{var o,s,d,r,c,u,v;const x=new i.UP(null===e||void 0===e||null===(o=e.fields)||void 0===o?void 0:o.categoryLabel,"",ie,null===e||void 0===e||null===(s=e.fields)||void 0===s?void 0:s.min,null===e||void 0===e||null===(d=e.fields)||void 0===d?void 0:d.max,null===e||void 0===e||null===(r=e.fields)||void 0===r?void 0:r.maxlength,null===e||void 0===e||null===(c=e.fields)||void 0===c?void 0:c.placeholder,null===e||void 0===e||null===(u=e.fields)||void 0===u?void 0:u.step,null===e||void 0===e||null===(v=e.fields)||void 0===v?void 0:v.adornmentText);return(0,S.jsx)(t.Z,(0,n.Z)((0,n.Z)({t:a},x),{},{index:l,inputs:ye,setInputs:we,withDelete:null===e||void 0===e?void 0:e.withDelete,isEditorMode:h}),l)}))),(0,S.jsxs)("div",{className:"add-expense-group",children:[(0,S.jsx)(b.Z,{disabled:h,className:"add-expense-field",label:null===J||void 0===J?void 0:J.value,type:"tel",value:null===Ze||void 0===Ze?void 0:Ze.toLocaleString(),onChange:e=>_e(e.target.value)}),Fe&&(0,S.jsx)("button",{onClick:()=>{""!==Ze&&(fe((e=>[...e,N()])),we((e=>[...e,{fields:{maxlength:z,categoryLabel:{value:Ze},displayDivisions:null,divisions:null,min:R,step:q,max:X,adornmentText:Q,placeholder:B},inputValue:0,withDelete:!0}])),_e(""))},className:"add-expense-btn button button-contained-primary",children:null===W||void 0===W?void 0:W.value})]})]}),(0,S.jsx)(v(),{className:"car-loan-sticky",bottomOffset:0,boundaryElement:".car-loan-calculator-content-container",children:(0,S.jsx)("div",{className:"content-container-right",children:(0,S.jsxs)("div",{className:"result-card",children:[(0,S.jsx)(p(),{highcharts:m(),constructorType:"chart",options:Ue}),""===We&&Pe&&(0,S.jsx)(c.H,{className:"money-grow-title",field:Y}),""===We&&De&&(0,S.jsx)(c.H,{className:"global-rich-text note",field:K}),"exceeds"===We&&(0,S.jsxs)(S.Fragment,{children:[Ge&&(0,S.jsx)(c.H,{className:"global-rich-text res-error res-msg",field:ne}),He&&(0,S.jsx)(c.H,{className:"global-rich-text note",field:oe})]}),"close"===We&&(0,S.jsxs)(S.Fragment,{children:[ke&&(0,S.jsx)(c.H,{className:"global-rich-text res-warning res-msg",field:ae}),Ae&&(0,S.jsx)(c.H,{className:"global-rich-text note",field:le})]}),Ce&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"monthly__repayment--label result-label",children:(0,S.jsx)(r.x,{field:ee})}),(0,S.jsxs)("div",{className:"monthly__repayment--value result-value",children:[re&&(0,S.jsx)("span",{children:(0,S.jsx)(r.x,{field:w})}),(0,S.jsx)("div",{children:"number"===typeof je&&(null===je||void 0===je?void 0:je.toLocaleString())})]})]}),Ve&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:(0,s.Z)("total__repayable--label result-label","close"===We&&"warning-text","exceeds"===We&&"error-text"),children:(0,S.jsx)(r.x,{field:$})}),(0,S.jsxs)("div",{className:(0,s.Z)("total__repayable--value result-value","close"===We&&"warning-text","exceeds"===We&&"error-text"),children:[re&&(0,S.jsx)("span",{children:(0,S.jsx)(r.x,{field:w})}),(0,S.jsx)("div",{children:"number"===typeof Se&&(null===Se||void 0===Se?void 0:Se.toLocaleString())})]})]})]})})})]})]})}))}}]);
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.