{"version":3,"file":"ScrollNavigation.DpBKn_EO.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/Twt6nVOt2ZYF2t0QzXn0/0VnPFQULBScBRfMGYPGA/ScrollNavigation.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,forwardRef}from\"react\";let activeSection=\"\";const observers=new Map;export function withScrollSection(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const sectionId=props.id;useEffect(()=>{// Only apply override for screens below 1200px\nif(window.innerWidth>=1200)return;if(!sectionId)return;const element=document.getElementById(sectionId);if(!element)return;const observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{if(entry.isIntersecting&&entry.boundingClientRect.top<window.innerHeight){activeSection=sectionId;// Trigger nav update by dispatching custom event\nwindow.dispatchEvent(new CustomEvent(\"sectionChange\",{detail:{activeSection:sectionId}}));}});},{rootMargin:\"-10% 0px -80% 0px\",threshold:0});observer.observe(element);observers.set(sectionId,observer);return()=>{observer.disconnect();observers.delete(sectionId);};},[sectionId]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}export function withNavLink(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const targetSection=props.link?.split(\"#\")[1];const[isActive,setIsActive]=useState(false);const[isMobile,setIsMobile]=useState(false);useEffect(()=>{// Check if screen is below 1200px\nconst checkWidth=()=>{setIsMobile(window.innerWidth<1200);};checkWidth();window.addEventListener(\"resize\",checkWidth);return()=>window.removeEventListener(\"resize\",checkWidth);},[]);useEffect(()=>{// Only listen for section changes on mobile\nif(!isMobile)return;const handleSectionChange=event=>{setIsActive(event.detail.activeSection===targetSection);};window.addEventListener(\"sectionChange\",handleSectionChange);return()=>{window.removeEventListener(\"sectionChange\",handleSectionChange);};},[targetSection,isMobile]);if(isMobile){return /*#__PURE__*/_jsx(Component,{ref:ref,...props,variant:isActive?\"mob-active\":\"mob-default\"});}// Return default component for desktop\nreturn /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}export function withSafeViewHeight(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:{...props.style,maxHeight:\"100dvh\"}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withNavLink\":{\"type\":\"reactHoc\",\"name\":\"withNavLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSafeViewHeight\":{\"type\":\"reactHoc\",\"name\":\"withSafeViewHeight\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrollSection\":{\"type\":\"reactHoc\",\"name\":\"withScrollSection\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollNavigation.map"],"mappings":"8IAAyI,SAAgB,EAAkB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,IAAM,EAAU,EAAM,GAE+B,OAF5B,MAAc,CACxO,GAA/B,EAAO,YAAY,MAAe,CAAC,EAAU,OAAO,IAAM,EAAQ,SAAS,eAAe,EAAU,CAAC,GAAG,CAAC,EAAQ,OAAO,IAAM,EAAS,IAAI,qBAAqB,GAAS,CAAC,EAAQ,QAAQ,GAAO,CAAI,EAAM,gBAAgB,EAAM,mBAAmB,IAAI,EAAO,aAClQ,EAAO,cAAc,IAAI,YAAY,gBAAgB,CAAC,OAAO,CAAC,cAAc,EAAU,CAAC,CAAC,CAAC,EAAI,EAAG,CAAC,WAAW,oBAAoB,UAAU,EAAE,CAAC,CAA6D,OAA5D,EAAS,QAAQ,EAAQ,CAAC,EAAU,IAAI,EAAU,EAAS,KAAW,CAAC,EAAS,YAAY,CAAC,EAAU,OAAO,EAAU,GAAK,CAAC,EAAU,CAAC,CAAqB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,CAAC,EAAG,CAAE,SAAgB,EAAY,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,IAAM,EAAc,EAAM,MAAM,MAAM,IAAI,CAAC,GAAQ,CAAC,EAAS,GAAaA,EAAS,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