{"version":3,"file":"ScrollToAnchor.DING53mR.mjs","names":[],"sources":["https:/framerusercontent.com/modules/fVcg8tE0opIdnaiC79w1/aobwKMeyyYWVRiZzFAOQ/ScrollToAnchor.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerDisableUnlink\n * @framerIntrinsicWidth 1\n * @framerIntrinsicHeight 1\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ScrollToAnchor(props){const{anchor,offset,behavior,delay}=props;useEffect(()=>{if(typeof window===\"undefined\"||!anchor)return;const scrollToTarget=()=>{const element=document.getElementById(anchor);if(element){const elementPosition=element.getBoundingClientRect().top+window.pageYOffset;const offsetPosition=elementPosition+offset;window.scrollTo({top:offsetPosition,behavior:behavior});}};if(delay>0){const timer=setTimeout(scrollToTarget,delay);return()=>clearTimeout(timer);}else{scrollToTarget();}},[anchor,offset,behavior,delay]);return /*#__PURE__*/_jsx(\"div\",{style:{width:1,height:1,opacity:0}});}ScrollToAnchor.defaultProps={anchor:\"\",offset:0,behavior:\"smooth\",delay:0};addPropertyControls(ScrollToAnchor,{anchor:{type:ControlType.String,title:\"Anchor ID\",description:\"HTML element ID to scroll to (without #)\",placeholder:\"my-section\"},offset:{type:ControlType.Number,title:\"Offset\",description:\"Pixels to offset from target position\",defaultValue:0,step:1,displayStepper:true},behavior:{type:ControlType.Enum,title:\"Behavior\",options:[\"smooth\",\"instant\",\"auto\"],optionTitles:[\"Smooth\",\"Instant\",\"Auto\"],defaultValue:\"smooth\"},delay:{type:ControlType.Number,title:\"Delay (ms)\",description:\"Delay before scrolling starts\",defaultValue:0,min:0,max:5e3,step:100,displayStepper:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollToAnchor\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"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