{"version":3,"file":"BackToTopOnScroll.wOS87mn2.mjs","names":["React.forwardRef","useState","useCallback"],"sources":["https:/framerusercontent.com/modules/ZZpxbrwF6wSX62EilgrF/iimdrXKk4ghY6N5tnggY/y52ysWUoo.js","https:/framerusercontent.com/modules/oZllMuZ39DVKFcJPiCTc/uSeAZvlS01dC9JbPEl1m/BackToTopOnScroll.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 0 6.75 L 6.75 0 L 13.5 6.75 Z\" fill-opacity=\"var(--1m6trwb, 0)\" fill=\"var(--21h8s6, rgb(0, 0, 0))\" height=\"6.75px\" id=\"yhZZECx0u\" transform=\"translate(5.25 6.75)\" width=\"13.5px\"/><path d=\"M 0 7.5 L 0 0\" fill=\"transparent\" height=\"7.5px\" id=\"GgtoHQFfG\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--pgex8v, 1.5)\" stroke=\"var(--21h8s6, rgb(0, 0, 0))\" transform=\"translate(12 13.5)\" width=\"1px\"/><path d=\"M 0 6.75 L 6.75 0 L 13.5 6.75 Z\" fill=\"transparent\" height=\"6.75px\" id=\"oRmLdmfGO\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--pgex8v, 1.5)\" stroke=\"var(--21h8s6, rgb(0, 0, 0))\" transform=\"translate(5.25 6.75)\" width=\"13.5px\"/><path d=\"M 0 0 L 16.5 0\" fill=\"transparent\" height=\"1px\" id=\"gtHArt6WK\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--pgex8v, 1.5)\" stroke=\"var(--21h8s6, rgb(0, 0, 0))\" transform=\"translate(3.75 3.75)\" width=\"16.5px\"/></svg>';const getProps=({alpha,color,height,id,width,width1,...props})=>{return{...props,ezTt3ayMo:color??props.ezTt3ayMo??\"rgb(0, 0, 0)\",lschgej4H:width1??props.lschgej4H??1.5,qxTvv_EBh:alpha??props.qxTvv_EBh};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,ezTt3ayMo,lschgej4H,qxTvv_EBh,...restProps}=getProps(props);const href=useSVGTemplate(\"1009892809\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-Cx0P0\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1m6trwb\":qxTvv_EBh,\"--21h8s6\":ezTt3ayMo,\"--pgex8v\":lschgej4H,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-Cx0P0 { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; 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 {\"ezTt3ayMo\":\"color\",\"lschgej4H\":\"width1\",\"qxTvv_EBh\":\"alpha\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Arrow Line Up\",\"color\":{\"type\":\"variable\",\"value\":\"21h8s6\"},\"set\":{\"localId\":\"vectorSet/NGVKdicsm\",\"id\":\"NGVKdicsm\",\"moduleId\":\"omX0gWFPqDwhaiWwf6ab\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-Cx0P0\");Icon.displayName=\"Arrow Line Up\";export default Icon;addPropertyControls(Icon,{ezTt3ayMo:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},lschgej4H:{defaultValue:1.5,displayStepper:true,hidden:false,max:6,min:0,step:.5,title:\"Width\",type:ControlType.Number},qxTvv_EBh:{defaultValue:0,displayStepper:true,hidden:false,max:1,min:0,step:.1,title:\"Alpha\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerVariables\":\"{\\\"ezTt3ayMo\\\":\\\"color\\\",\\\"lschgej4H\\\":\\\"width1\\\",\\\"qxTvv_EBh\\\":\\\"alpha\\\"}\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"24\",\"framerIntrinsicHeight\":\"24\",\"framerVector\":\"{\\\"name\\\":\\\"Arrow Line Up\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"21h8s6\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/NGVKdicsm\\\",\\\"id\\\":\\\"NGVKdicsm\\\",\\\"moduleId\\\":\\\"omX0gWFPqDwhaiWwf6ab\\\"}}\",\"framerDisableUnlink\":\"true\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerImmutableVariables\":\"true\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,startTransition,useCallback,useEffect,useState}from\"react\";import{useIsStaticRenderer}from\"framer\";export function BackToTopOnScroll(Component){return /*#__PURE__*/forwardRef(function BackToTopOnScrollOverride(props,ref){const isStatic=useIsStaticRenderer();const[isVisible,setIsVisible]=useState(false);const updateVisibilityFromScroll=useCallback(y=>{startTransition(()=>{setIsVisible(current=>{if(!current&&y>280)return true;if(current&&y<80)return false;return current;});});},[]);useEffect(()=>{if(isStatic)return;if(typeof window===\"undefined\")return;updateVisibilityFromScroll(window.scrollY||0);const onScroll=()=>{updateVisibilityFromScroll(window.scrollY||0);};window.addEventListener(\"scroll\",onScroll,{passive:true});return()=>window.removeEventListener(\"scroll\",onScroll);},[isStatic,updateVisibilityFromScroll]);const scrollToTop=useCallback(()=>{if(typeof window===\"undefined\")return;window.scrollTo({top:0,behavior:\"smooth\"});},[]);const handleTap=useCallback(event=>{scrollToTop();if(props.onTap)props.onTap(event);},[props,scrollToTop]);const handleClick=useCallback(event=>{scrollToTop();if(props.onClick)props.onClick(event);},[props,scrollToTop]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onTap:handleTap,onClick:handleClick,animate:{...props.animate||{},x:\"-50%\",y:isVisible?0:-36,opacity:isVisible?1:0},transition:{duration:.22,ease:\"easeOut\",...props.transition||{}},style:{...props.style,position:\"fixed\",left:\"50vw\",right:\"auto\",top:props.style?.top??\"90px\",zIndex:9999,pointerEvents:isVisible?\"auto\":\"none\"}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"BackToTopOnScroll\":{\"type\":\"reactHoc\",\"name\":\"BackToTopOnScroll\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BackToTopOnScroll.map"],"mappings":"sTAC0C,IAAqF,IAA4B,EAAqC,EAAK,0BAAgC,EAAkB,EAAW,SAAS,EAAM,EAAI,CAAC,OAAoB,EAAK,MAAM,CAAC,GAAG,EAAU,MAAI,SAAS,EAAM,QAAQ,CAAC,CAAE,CAAC,EAAQ,EAAU,EAAO,OAAO,CAAI,EAAQ,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG,GAAM,EAAM,OAAO,EAAsB,EAAK,EAAU,CAA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