{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/83OlKqWGzyvjVV5pRinl/JsC7aW71h56GxdYjYQXF/Slider.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{ControlType,addPropertyControls}from\"framer\";import{useEffect,useState,useRef}from\"react\";export function SliderComponent(props){const{style,boxShadow:{shadowY,shadowX,shadowBlur,shadowSpread,shadowColor}}=props;const[sliderValue,setSliderValue]=useState(5e4);const[sliderPosition,setSliderPosition]=useState(0);const sliderRef=useRef(null);const isDragging=useRef(false);const roundToNearestHundred=value=>{const remainder=value%100;if(remainder>=50){return Math.ceil(value/100)*100;}else{return Math.floor(value/100)*100;}};useEffect(()=>{checkLocalStorage();const pollInterval=setInterval(checkLocalStorage,500);const timeout=setTimeout(()=>clearInterval(pollInterval),5e3);const handleStorageEvent=e=>{if(e.key===\"userSavings\")checkLocalStorage();};const handleCustomEvent=()=>checkLocalStorage();window.addEventListener(\"storage\",handleStorageEvent);window.addEventListener(\"savingsUpdated\",handleCustomEvent);return()=>{clearInterval(pollInterval);clearTimeout(timeout);window.removeEventListener(\"storage\",handleStorageEvent);window.removeEventListener(\"savingsUpdated\",handleCustomEvent);};},[]);const checkLocalStorage=()=>{const savedValue=localStorage.getItem(\"userSavings\");if(savedValue){const value=Number(savedValue)/.025;updateSliderValueFromSavings(value);}};const updateSliderValueFromSavings=savings=>{const position=(savings-5e4)/(2e6-5e4)*100;setSliderValue(savings);setSliderPosition(position);};const updateSliderValue=position=>{const mappedValue=Math.round(5e4+position/100*(2e6-5e4));setSliderValue(mappedValue);setSliderPosition(position);localStorage.setItem(\"sliderValue\",mappedValue);window.dispatchEvent(new CustomEvent(\"localStorageChange\",{detail:{sliderValue:mappedValue}}));};const handleMouseDown=()=>{isDragging.current=true;document.addEventListener(\"mousemove\",handleMouseMove);document.addEventListener(\"mouseup\",handleMouseUp);};const handleMouseUp=()=>{isDragging.current=false;document.removeEventListener(\"mousemove\",handleMouseMove);document.removeEventListener(\"mouseup\",handleMouseUp);};const handleMouseMove=event=>{if(isDragging.current){const trackRect=sliderRef.current.getBoundingClientRect();const offsetX=event.clientX-trackRect.left;const position=Math.min(Math.max(offsetX/trackRect.width*100,0),100);updateSliderValue(position);}};const handleTouchMove=event=>{if(isDragging.current){const trackRect=sliderRef.current.getBoundingClientRect();const offsetX=event.touches[0].clientX-trackRect.left;const position=Math.min(Math.max(offsetX/trackRect.width*100,0),100);updateSliderValue(position);}};return /*#__PURE__*/_jsxs(\"div\",{style:{...style,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:\"18px\",padding:\"25px\",background:\"radial-gradient(circle at center, #FFFFFF , #F4AA6925)\",boxShadow:`${shadowY}px ${shadowX}px ${shadowBlur}px ${shadowSpread}px ${shadowColor}`,borderRadius:props.radius},children:[/*#__PURE__*/_jsxs(\"div\",{style:styles.text_container,children:[/*#__PURE__*/_jsx(\"p\",{style:{fontFamily:props.fontStyle,fontSize:props.fontStyle.fontSize,textAlign:props.fontStyle.textAlign,fontWeight:props.fontStyle.fontWeight,color:props.textColor,lineHeight:\"1em\"},children:\"Homa Saves You:\"}),/*#__PURE__*/_jsxs(\"p\",{style:{fontFamily:props.savedNumbersFontStyle,fontSize:props.savedNumbersFontStyle.fontSize,textAlign:props.savedNumbersFontStyle.textAlign,fontWeight:props.savedNumbersFontStyle.fontWeight,color:props.homaSavesColor,lineHeight:\"1em\"},children:[\"$\",roundToNearestHundred(sliderValue*.025).toLocaleString()]})]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",justifyContent:\"center\",alignItems:\"center\",gap:\"4px\",width:\"100%\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:styles.text_container_home,children:[/*#__PURE__*/_jsx(\"p\",{style:{fontFamily:props.fontStyle,fontSize:props.fontStyle.fontSize,textAlign:props.fontStyle.textAlign,fontWeight:props.fontStyle.fontWeight,color:props.textColor,lineHeight:\"1.2em\"},children:\"Home Price:\"}),/*#__PURE__*/_jsxs(\"p\",{style:{...styles.homeNumber,fontFamily:props.numbersFontStyle,fontSize:props.numbersFontStyle.fontSize,textAlign:props.numbersFontStyle.textAlign,fontWeight:props.numbersFontStyle.fontWeight,color:props.homePriceColor,lineHeight:\"1.2em\"},children:[\"$\",sliderValue.toLocaleString()]})]}),/*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"6px\",backgroundColor:props.barBackgroundColor,borderRadius:\"5px\",position:\"relative\",margin:\"20px 0\",cursor:\"pointer\"},ref:sliderRef,onMouseDown:handleMouseDown,onTouchStart:handleMouseDown,onTouchEnd:handleMouseUp,onTouchMove:handleTouchMove,children:[/*#__PURE__*/_jsx(\"div\",{style:{width:`${sliderPosition}%`,height:\"100%\",backgroundColor:props.barColor,borderRadius:\"5px\"}}),/*#__PURE__*/_jsx(\"div\",{style:{width:\"24px\",height:\"24px\",backgroundColor:props.barColor,outline:\"3px solid white\",borderRadius:\"50%\",position:\"absolute\",top:\"50%\",left:`${sliderPosition}%`,transform:\"translate(-50%, -50%)\",cursor:\"pointer\"}})]})]})]});}addPropertyControls(SliderComponent,{textColor:{type:ControlType.Color,defaultValue:\"#000000\",optional:true},homePriceColor:{type:ControlType.Color,defaultValue:\"#000000\",optional:true},homaSavesColor:{type:ControlType.Color,defaultValue:\"#F4AA69\",optional:true},barColor:{type:ControlType.Color,defaultValue:\"#72AEB4\",optional:true},barBackgroundColor:{type:ControlType.Color,defaultValue:\"#ddd\",optional:true},fontStyle:{type:ControlType.Font,defaultFontType:\"Plus Jakarta Sans\",defaulFontSize:\"42px\",displayFontSize:true,displayTextAlignment:true,displaySegmentedControl:true},numbersFontStyle:{type:ControlType.Font,defaultFontType:\"Plus Jakarta Sans\",defaulFontSize:\"42px\",displayFontSize:true,displayTextAlignment:true,displaySegmentedControl:true},savedNumbersFontStyle:{type:ControlType.Font,defaultFontType:\"Plus Jakarta Sans\",defaulFontSize:\"42px\",displayFontSize:true,displayTextAlignment:true,displaySegmentedControl:true},radius:{type:ControlType.Number,defaultValue:10,min:0,max:100,unit:\"px\",title:\"Radius\"},boxShadow:{type:ControlType.Object,controls:{shadowY:{type:ControlType.Number,defaultValue:2,min:0,unit:\"px\",title:\"Y\"},shadowX:{type:ControlType.Number,defaultValue:2,min:0,unit:\"px\",title:\"X\"},shadowBlur:{type:ControlType.Number,defaultValue:2,min:0,unit:\"px\",title:\"Blur\"},shadowSpread:{type:ControlType.Number,defaultValue:2,min:0,unit:\"px\",title:\"Spread\"},shadowColor:{type:ControlType.Color,defaultValue:\"#000000\",optional:true}}}});const styles={homeNumber:{fontSize:\"24px\",fontWeight:\"bold\"},savedNumber:{fontSize:\"30px\",fontWeight:\"bold\",color:\"#F4AA69\"},slider:{width:\"100%\"},text_container:{height:\"fit-content\",width:\"100%\",display:\"flex\",gap:\"8px\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\"},text_container_home:{height:\"35px\",width:\"100%\",display:\"flex\",flexDirection:\"row\",gap:\"10px\",alignItems:\"center\",justifyContent:\"center\"}};\nexport const __FramerMetadata__ = {\"exports\":{\"SliderComponent\":{\"type\":\"reactComponent\",\"name\":\"SliderComponent\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Slider.map"],
  "mappings": "8JAAiK,SAASA,EAAgBC,EAAM,CAAC,GAAK,CAAC,MAAAC,EAAM,UAAU,CAAC,QAAAC,EAAQ,QAAAC,EAAQ,WAAAC,EAAW,aAAAC,EAAa,YAAAC,CAAW,CAAC,EAAEN,EAAW,CAACO,EAAYC,CAAc,EAAEC,EAAS,GAAG,EAAO,CAACC,EAAeC,CAAiB,EAAEF,EAAS,CAAC,EAAQG,EAAUC,EAAO,IAAI,EAAQC,EAAWD,EAAO,EAAK,EAAQE,EAAsBC,GAAwBA,EAAM,KAAkB,GAAW,KAAK,KAAKA,EAAM,GAAG,EAAE,IAAiB,KAAK,MAAMA,EAAM,GA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,CAAC,CAAC,CAAC,CAAC,EAAE,IAAMH,EAAO,CAAC,WAAW,CAAC,SAAS,OAAO,WAAW,MAAM,EAAE,YAAY,CAAC,SAAS,OAAO,WAAW,OAAO,MAAM,SAAS,EAAE,OAAO,CAAC,MAAM,MAAM,EAAE,eAAe,CAAC,OAAO,cAAc,MAAM,OAAO,QAAQ,OAAO,IAAI,MAAM,cAAc,SAAS,WAAW,SAAS,eAAe,QAAQ,EAAE,oBAAoB,CAAC,OAAO,OAAO,MAAM,OAAO,QAAQ,OAAO,cAAc,MAAM,IAAI,OAAO,WAAW,SAAS,eAAe,QAAQ,CAAC",
  "names": ["SliderComponent", "props", "style", "shadowY", "shadowX", "shadowBlur", "shadowSpread", "shadowColor", "sliderValue", "setSliderValue", "ye", "sliderPosition", "setSliderPosition", "sliderRef", "pe", "isDragging", "roundToNearestHundred", "value", "ue", "checkLocalStorage", "pollInterval", "timeout", "handleStorageEvent", "e", "handleCustomEvent", "window", "savedValue", "updateSliderValueFromSavings", "savings", "position", "updateSliderValue", "mappedValue", "handleMouseDown", "handleMouseMove", "handleMouseUp", "event", "trackRect", "offsetX", "handleTouchMove", "u", "styles", "p", "addPropertyControls", "ControlType"]
}
