{"version":3,"file":"Calc2.dDFePQ28.mjs","names":["useState","useRef","amount","downPaymentPercentage","duration","_Fragment"],"sources":["https:/framerusercontent.com/modules/5E3JYEVQu0gYCDGop4lE/PHOHbzFnUwXUIlU0Fm0D/Calc2.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useRef,useState}from\"react\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function Calculator(){const maxAmount=25e3;const minAmount=3e3;const durations=[12,24,36,48,60];const fixedInterest=24.99;const minDownPayment=5;const maxDownPayment=50;const[amount,setAmount]=useState(minAmount);const[duration,setDuration]=useState(durations[0]);const[downPaymentPercentage,setDownPaymentPercentage]=useState(minDownPayment);const[amountThumbPos,setAmountThumbPos]=useState((amount-minAmount)/(maxAmount-minAmount)*100+\"%\");const[durationThumbPos,setDurationThumbPos]=useState(durations.indexOf(duration)/(durations.length-1)*100+\"%\");const[downPaymentThumbPos,setDownPaymentThumbPos]=useState((downPaymentPercentage-minDownPayment)/(maxDownPayment-minDownPayment)*100+\"%\");const amountInput=useRef();const durationInput=useRef();const downPaymentInput=useRef();const handleAmountChange=()=>{const value=parseInt(amountInput.current.value,10);setAmount(value);setAmountThumbPos((value-minAmount)/(maxAmount-minAmount)*100+\"%\");};const handleDurationChange=()=>{const value=parseInt(durationInput.current.value,10);setDuration(durations[value]);setDurationThumbPos(value/(durations.length-1)*100+\"%\");};const handleDownPaymentChange=()=>{const value=parseInt(downPaymentInput.current.value,10);setDownPaymentPercentage(value);setDownPaymentThumbPos((value-minDownPayment)/(maxDownPayment-minDownPayment)*100+\"%\");};const calculateMonthlyPayment=(amount,duration,interest,downPaymentPercentage)=>{const principal=amount-amount*downPaymentPercentage/100;const monthlyInterestRate=interest/100/12;const monthlyPayment=principal*monthlyInterestRate/(1-Math.pow(1+monthlyInterestRate,-duration));return monthlyPayment.toFixed(2);};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`.box {\n        background: #1254FF; /* Changed background color */\n        border-radius: 16px;\n        padding: 40px;\n        color: white;\n      }\n      .slideTitle {\n        font-family: Cabinet Grotesk;\n        font-size: 32px;\n        font-style: normal;\n        font-weight: 700;\n        line-height: 130%;\n        letter-spacing: -1px;\n        margin-bottom: 40px;\n      }\n      .slideSubTitle {\n        font-family: Inter;\n        font-size: 18px;\n        font-style: normal;\n        font-weight: 500;\n        line-height: 170%;\n        margin-bottom: 10px;\n      }\n      \n      .totalBox {\n        border-radius: 16px;\n        background: #000000; /* Changed monthly price background color */\n        padding: 40px;\n        text-align: center;\n        margin-top: 50px;\n      }\n      .totalBox h2 {\n        font-family: Cabinet Grotesk;\n        font-size: 64px;\n        font-style: normal;\n        font-weight: 700;\n        line-height: 110%;\n        letter-spacing: -2px;\n        color: white; /* Ensure the text color is visible on the black background */\n      }\n      \n      .totalBox p {\n        font-family: Inter;\n        font-size: 18px;\n        font-style: normal;\n        font-weight: 400;\n        line-height: 170%; /* 30.6px */\n        color: white; /* Ensure the text color is visible on the black background */\n      }\n      \n      .rangeThumb {\n        background-color: #ffff;\n        min-width: 20px;\n        border-radius: 13px;\n        position: absolute;\n        z-index: 222;\n        top: 50%;\n        left: 0;\n        transform: translate(-50%, -50%);\n        pointer-events: none;\n        display: flex;\n        justify-content: center;\n        align-items: center;\n        color: #081717;\n        font-family: Inter;\n        font-size: 12px;\n        font-weight: 600;\n        line-height: 150%;\n        padding: 3px 10px;\n      }\n      \n      .rangeWrap {\n        position: relative;\n      }\n      \n      .progress {\n        background: #ef8b55;\n        width: 50%;\n        position: absolute;\n        border-radius: 0.5rem;\n        height: 0.5rem;\n        margin-top: 3px;\n        bottom: 0;\n        top: 0;\n        transform: translatey(-50%, -50%);\n        pointer-events: none;\n      }\n      \n      /* ======================== */\n      /********** Range Input Styles **********/\n      /*Range Reset*/\n      .range {\n        -webkit-appearance: none;\n        appearance: none;\n        background: transparent;\n        cursor: pointer;\n        width: 100%;\n      }\n      \n      /* Removes default focus */\n      .range:focus {\n        outline: none;\n      }\n      \n      /***** Chrome, Safari, Opera and Edge Chromium styles *****/\n      /* slider track */\n      .range::-webkit-slider-runnable-track {\n        background-color: #081717;\n        opacity: 0.3;\n        border-radius: 0.5rem;\n        height: 0.5rem;\n      }\n      \n      /* slider thumb */\n      .range::-webkit-slider-thumb {\n        -webkit-appearance: none; /* Override default look */\n        appearance: none;\n        margin-top: -12px; /* Centers thumb on the track */\n      \n        /*custom styles*/\n        background-color: transparent;\n        height: 24px;\n        width: 24px;\n        border-radius: 50%;\n      }\n      \n      .range:focus::-webkit-slider-thumb {\n        border: none;\n        outline: none;\n        outline-offset: none;\n      }\n      \n      /******** Firefox styles ********/\n      /* slider track */\n      .range::-moz-range-track {\n        background-color: #081717;\n        opacity: 0.3;\n        border-radius: 0.5rem;\n        height: 0.5rem;\n      }\n      \n      /* slider thumb */\n      .range::-moz-range-thumb {\n        border: none; /*Removes extra border that FF applies*/\n        border-radius: 0; /*Removes default border-radius that FF applies*/\n      \n        /*custom styles*/\n        background-color: transparent;\n        height: 24px;\n        width: 24px;\n        border-radius: 50%;\n      }\n      \n      .range:focus::-moz-range-thumb {\n        border: none;\n        outline: none;\n        outline-offset: none;\n      }\n      `}),/*#__PURE__*/_jsxs(\"div\",{className:\"box\",children:[/*#__PURE__*/_jsx(\"h1\",{className:\"slideTitle\",children:\"Your Payment:\"}),/*#__PURE__*/_jsxs(\"h4\",{className:\"slideSubTitle\",children:[\"Investment Amount ($\",amount,\")\"]}),/*#__PURE__*/_jsxs(\"div\",{className:\"rangeWrap\",style:{marginBottom:\"32px\"},children:[/*#__PURE__*/_jsx(\"input\",{className:\"range\",ref:amountInput,type:\"range\",min:minAmount,max:maxAmount,step:\"100\",value:amount,onInput:handleAmountChange}),/*#__PURE__*/_jsx(\"div\",{className:\"progress\",style:{width:amountThumbPos}}),/*#__PURE__*/_jsxs(\"div\",{className:\"rangeThumb\",style:{left:amountThumbPos},children:[\"$\",amount]})]}),/*#__PURE__*/_jsxs(\"h4\",{className:\"slideSubTitle\",children:[\"Term Limit (\",duration,\" Months)\"]}),/*#__PURE__*/_jsxs(\"div\",{className:\"rangeWrap\",style:{position:\"relative\"},children:[/*#__PURE__*/_jsx(\"input\",{className:\"range\",ref:durationInput,type:\"range\",min:\"0\",max:durations.length-1,step:\"1\",value:durations.indexOf(duration),onInput:handleDurationChange}),/*#__PURE__*/_jsx(\"div\",{className:\"progress\",style:{width:durationThumbPos}}),/*#__PURE__*/_jsx(\"div\",{className:\"rangeThumb\",style:{left:durationThumbPos},children:duration})]}),/*#__PURE__*/_jsxs(\"h4\",{className:\"slideSubTitle\",children:[\"Down Payment (\",downPaymentPercentage,\"%)\"]}),/*#__PURE__*/_jsxs(\"div\",{className:\"rangeWrap\",style:{position:\"relative\"},children:[/*#__PURE__*/_jsx(\"input\",{className:\"range\",ref:downPaymentInput,type:\"range\",min:minDownPayment,max:maxDownPayment,step:\"1\",value:downPaymentPercentage,onInput:handleDownPaymentChange}),/*#__PURE__*/_jsx(\"div\",{className:\"progress\",style:{width:downPaymentThumbPos}}),/*#__PURE__*/_jsxs(\"div\",{className:\"rangeThumb\",style:{left:downPaymentThumbPos},children:[downPaymentPercentage,\"%\"]})]}),/*#__PURE__*/_jsxs(\"div\",{className:\"totalBox\",children:[/*#__PURE__*/_jsxs(\"h2\",{children:[\"$\",calculateMonthlyPayment(amount,duration,fixedInterest,downPaymentPercentage)]}),/*#__PURE__*/_jsxs(\"p\",{children:[\"Approximate Monthly Payment for \",duration,\" months at\",\" \",fixedInterest,\"% interest\"]})]})]})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Calculator\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\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