{"version":3,"file":"ScrollGNB.Dk5XPy0G.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/XcGnMIzfDLFAHkWecl7F/PK7h2vUBeaOK2i545tPD/ScrollGNB.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{motion,useViewportScroll}from\"framer-motion\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const useStore=createStore({isScroll:false});const variants={visible:{y:0},hidden:{y:-111}};export function onScrollGNB(Component){return props=>{const[scroll,setScroll]=useState(false);const{scrollY}=useViewportScroll();const update=scrollY=>{if((scrollY===null||scrollY===void 0?void 0:scrollY.current)<(scrollY===null||scrollY===void 0?void 0:scrollY.prev)){setScroll(false);}else if((scrollY===null||scrollY===void 0?void 0:scrollY.current)>111&&(scrollY===null||scrollY===void 0?void 0:scrollY.current)>(scrollY===null||scrollY===void 0?void 0:scrollY.prev)){setScroll(true);}};useEffect(()=>{return scrollY.onChange(()=>update(scrollY));});return /*#__PURE__*/_jsx(motion.div,{variants:variants,animate:scroll?\"hidden\":\"visible\",transition:{ease:[.1,.25,.3,1],duration:.6},style:{width:\"inherit\"},children:/*#__PURE__*/_jsx(Component,{...props})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"onScrollGNB\":{\"type\":\"reactHoc\",\"name\":\"onScrollGNB\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollGNB.map"],"mappings":"mOAAsS,SAAgB,EAAY,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAO,GAAWA,EAAS,EAAK,EAAO,CAAC,WAAS,EAAkB,EAAQ,EAAO,GAAS,CAAK,GAAgD,QAAU,GAAgD,KAAO,EAAU,EAAK,EAAY,GAAgD,QAAS,KAAM,GAAgD,QAAU,GAAgD,MAAO,EAAU,EAAI,CAAG,EAAiE,OAA/D,MAAsB,EAAQ,aAAa,EAAO,CAAO,CAAC,CAAG,EAAsB,EAAK,EAAO,IAAI,CAAU,WAAS,QAAQ,EAAO,SAAS,UAAU,WAAW,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,SAAS,EAAE,EAAE,MAAM,CAAC,MAAM,SAAS,EAAE,SAAsB,EAAK,EAAU,CAAC,GAAG,CAAK,CAAC,CAAC,CAAC,CAAE,CAAE,mBAAx/B,IAAsC,IAAoD,IAAqE,EAAgB,EAAY,CAAC,SAAS,EAAK,CAAC,EAAQ,EAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC"}