{"version":3,"file":"Back_to_Top.CSQCqSoC.mjs","names":["React.forwardRef","React.useState"],"sources":["https:/framerusercontent.com/modules/ALWPCKi6B8ANbqZse0bA/xBbeILGrIDfP5lwLRNVF/kTMbxXT_W.js","https:/framerusercontent.com/modules/xy9vJsMaNjJkDXMaBh8G/u5gJPLpIzbjeOtMq2jPK/Back_to_Top.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask='url(\\'data:image/svg+xml,<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 9 3 L 9 9 L 13.5 9 M 18 9 C 18 13.971 13.971 18 9 18 C 4.029 18 0 13.971 0 9 C 0 4.029 4.029 0 9 0 C 13.971 0 18 4.029 18 9 Z\" fill=\"transparent\" height=\"18px\" id=\"T5Oq1Yd2z\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" stroke=\"var(--szd5nr, black)\" transform=\"translate(3 3)\" width=\"18px\"/></svg>\\') alpha no-repeat center / auto var(--framer-icon-mask-mode, add), var(--framer-icon-mask, none)';const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(motion.div,{...rest,layoutId:layoutId,ref:ref}):/*#__PURE__*/_jsx(\"div\",{...rest,ref:ref});});const getProps=({height,id,stroke,width,...props})=>{return{...props,YmfIrZ3Ez:stroke??props.YmfIrZ3Ez??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,YmfIrZ3Ez,...restProps}=getProps(props);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-BMdHE\",className),layoutId:layoutId,ref:ref,style:{\"--szd5nr\":YmfIrZ3Ez,...style}});});const css=[`.framer-BMdHE { -webkit-mask: ${mask}; aspect-ratio: 1; background-color: var(--szd5nr); mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"YmfIrZ3Ez\":\"stroke\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Clock\",\"color\":{\"type\":\"variable\",\"value\":\"szd5nr\"},\"set\":{\"localId\":\"vectorSet/kNBkgkDkJ\",\"id\":\"kNBkgkDkJ\",\"moduleId\":\"DyJDRQD0f0RPOu0ZYoEG\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-BMdHE\");Icon.displayName=\"Clock\";export default Icon;addPropertyControls(Icon,{YmfIrZ3Ez:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Stroke\",type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"24\",\"framerIntrinsicHeight\":\"24\",\"framerVector\":\"{\\\"name\\\":\\\"Clock\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"szd5nr\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/kNBkgkDkJ\\\",\\\"id\\\":\\\"kNBkgkDkJ\\\",\\\"moduleId\\\":\\\"DyJDRQD0f0RPOu0ZYoEG\\\"}}\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"true\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerVariables\":\"{\\\"YmfIrZ3Ez\\\":\\\"stroke\\\"}\",\"framerImmutableVariables\":\"true\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";export default function BackToTopButton(props){const{showAfter,desktopRight,desktopBottom,mobileRight,mobileBottom,bgColor,borderColor,iconColor,shadow,defaultImage,hoverImage,imageRadius}=props;const[visible,setVisible]=React.useState(false);const[isMobile,setIsMobile]=React.useState(false);React.useEffect(()=>{function update(){setVisible(window.scrollY>showAfter);setIsMobile(window.innerWidth<768);}update();window.addEventListener(\"scroll\",update,{passive:true});window.addEventListener(\"resize\",update);return()=>{window.removeEventListener(\"scroll\",update);window.removeEventListener(\"resize\",update);};},[showAfter]);function scrollToTop(){window.scrollTo({top:0,behavior:\"smooth\"});}const right=isMobile?mobileRight:desktopRight;const bottom=isMobile?mobileBottom:desktopBottom;const size=isMobile?42:44;const iconSize=isMobile?16:18;return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(AnimatePresence,{children:visible&&/*#__PURE__*/_jsx(motion.button,{initial:{opacity:0,y:8,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.96},transition:{duration:.18,ease:\"easeOut\"},onClick:scrollToTop,style:{position:\"fixed\",right,bottom,width:size,height:size,borderRadius:imageRadius,overflow:\"hidden\",border:`1px solid ${borderColor}`,background:bgColor,boxShadow:shadow,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",pointerEvents:\"auto\",zIndex:1200,backdropFilter:\"blur(10px)\",WebkitBackdropFilter:\"blur(10px)\",padding:0},whileHover:{y:-1},whileTap:{scale:.97},\"aria-label\":\"Back to top\",children:/*#__PURE__*/_jsxs(motion.div,{whileHover:\"hover\",initial:\"default\",animate:\"default\",style:{width:\"100%\",height:\"100%\",borderRadius:imageRadius,overflow:\"hidden\",position:\"relative\"},children:[/*#__PURE__*/_jsx(motion.img,{variants:{default:{opacity:1},hover:{opacity:0}},transition:{duration:.2},src:defaultImage,alt:\"\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\"}}),/*#__PURE__*/_jsx(motion.img,{variants:{default:{opacity:0},hover:{opacity:1}},transition:{duration:.2},src:hoverImage,alt:\"\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\"}})]})})})});}BackToTopButton.defaultProps={showAfter:500,desktopRight:28,desktopBottom:28,mobileRight:16,mobileBottom:84,bgColor:\"rgba(255,255,255,0.72)\",borderColor:\"rgba(0,0,0,0.08)\",iconColor:\"#4A4A4A\",shadow:\"0 8px 24px rgba(0,0,0,0.08)\"};addPropertyControls(BackToTopButton,{showAfter:{type:ControlType.Number,title:\"Show After\",defaultValue:500,min:0,max:3e3,step:10},desktopRight:{type:ControlType.Number,title:\"Desk Right\",defaultValue:28,min:0,max:200,step:1},desktopBottom:{type:ControlType.Number,title:\"Desk Bottom\",defaultValue:28,min:0,max:200,step:1},mobileRight:{type:ControlType.Number,title:\"Mob Right\",defaultValue:16,min:0,max:200,step:1},mobileBottom:{type:ControlType.Number,title:\"Mob Bottom\",defaultValue:84,min:0,max:240,step:1},bgColor:{type:ControlType.Color,title:\"BG\",defaultValue:\"rgba(255,255,255,0.72)\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"rgba(0,0,0,0.08)\"},iconColor:{type:ControlType.Color,title:\"Icon\",defaultValue:\"#4A4A4A\"},shadow:{type:ControlType.String,title:\"Shadow\",defaultValue:\"0 8px 24px rgba(0,0,0,0.08)\"},defaultImage:{type:ControlType.Image,title:\"Default Img\"},hoverImage:{type:ControlType.Image,title:\"Hover Img\"},imageRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:4,min:0,max:24,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BackToTopButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=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