{"version":3,"file":"BackToTop.uudm4c19.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/2gmihhNs7HxRmcjZ9NbM/eBfOa1v5rVIG35eqoN7M/BackToTop.js"],"sourcesContent":["// Back to top button that appears after scrolling and returns user to top of page\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function BackToTop(props){const{scrollThreshold,backgroundColor,iconColor,size,borderRadius,showShadow,bottomOffset,rightOffset}=props;const[isVisible,setIsVisible]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;const handleScroll=()=>{const scrolled=window.scrollY>scrollThreshold;startTransition(()=>setIsVisible(scrolled));};window.addEventListener(\"scroll\",handleScroll);handleScroll();return()=>window.removeEventListener(\"scroll\",handleScroll);},[scrollThreshold]);const scrollToTop=()=>{if(typeof window===\"undefined\")return;window.scrollTo({top:0,behavior:\"smooth\"});};return /*#__PURE__*/_jsx(AnimatePresence,{children:isVisible&&/*#__PURE__*/_jsx(motion.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},onClick:scrollToTop,style:{position:\"fixed\",bottom:bottomOffset,right:rightOffset,width:size,height:size,backgroundColor,border:\"none\",borderRadius,cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:9999,boxShadow:showShadow?\"0 4px 12px rgba(0, 0, 0, 0.15)\":\"none\"},whileHover:{scale:1.1},whileTap:{scale:.95},\"aria-label\":\"Back to top\",children:/*#__PURE__*/_jsxs(\"svg\",{width:size*.5,height:size*.5,viewBox:\"0 0 24 24\",fill:\"none\",stroke:iconColor,strokeWidth:\"2.5\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:[/*#__PURE__*/_jsx(\"title\",{children:\"Arrow up\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M12 19V5M5 12l7-7 7 7\"})]})})});}addPropertyControls(BackToTop,{scrollThreshold:{type:ControlType.Number,title:\"Scroll Threshold\",defaultValue:300,min:0,max:1e3,step:50,unit:\"px\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#FFFFFF\"},size:{type:ControlType.Number,title:\"Size\",defaultValue:48,min:32,max:80,step:4,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:24,min:0,max:40,step:2,unit:\"px\"},showShadow:{type:ControlType.Boolean,title:\"Shadow\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},bottomOffset:{type:ControlType.Number,title:\"Bottom Offset\",defaultValue:32,min:0,max:200,step:8,unit:\"px\"},rightOffset:{type:ControlType.Number,title:\"Right Offset\",defaultValue:32,min:0,max:200,step:8,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BackToTop\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BackToTop.map"],"mappings":"gQAIG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,kBAAgB,kBAAgB,YAAU,OAAK,eAAa,aAAW,eAAa,eAAa,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAma,OAAla,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,MAAiB,CAAC,IAAM,EAAS,EAAO,QAAQ,EAAgB,MAAoB,EAAa,EAAS,CAAC,EAAiE,OAA9D,EAAO,iBAAiB,SAAS,EAAa,CAAC,GAAc,KAAW,EAAO,oBAAoB,SAAS,EAAa,EAAG,CAAC,EAAgB,CAAC,CAA+H,EAAK,E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