{"version":3,"file":"StickyHeaderScrollReveal.CASfTxKY.mjs","names":["useState","useCallback","useMemo","useRef"],"sources":["https:/framerusercontent.com/modules/xDI2iRdv4ffO96Xl0Sa0/UGPLO6dZjlXV00YhOQWY/StickyHeaderScrollReveal.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,startTransition,useCallback,useEffect,useMemo,useRef,useState}from\"react\";import{useIsStaticRenderer}from\"framer\";export function StickyHeaderScrollReveal(Component){return /*#__PURE__*/forwardRef(function StickyHeaderScrollRevealOverride(props,ref){const isStaticRenderer=useIsStaticRenderer();const[isRevealed,setIsRevealed]=useState(false);const updateRevealState=useCallback(()=>{if(typeof window===\"undefined\")return;const nextValue=window.scrollY>=120;startTransition(()=>{setIsRevealed(nextValue);});},[]);useEffect(()=>{if(isStaticRenderer)return;if(typeof window===\"undefined\")return;updateRevealState();window.addEventListener(\"scroll\",updateRevealState,{passive:true});return()=>{window.removeEventListener(\"scroll\",updateRevealState);};},[isStaticRenderer,updateRevealState]);const revealStyle=useMemo(()=>isRevealed?{backgroundColor:\"rgba(248, 244, 236, 0.88)\",boxShadow:\"0px 18px 50px rgba(0,0,0,0.18)\",border:\"1px solid rgba(176,137,88,0.24)\"}:{backgroundColor:\"rgba(248, 244, 236, 0)\",boxShadow:\"none\",border:\"1px solid rgba(176,137,88,0.08)\"},[isRevealed]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:{...props.style,...revealStyle,transition:\"background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease\",pointerEvents:props.style?.pointerEvents??\"auto\"}});});}export function CountUpOnView(Component){return /*#__PURE__*/forwardRef(function CountUpOnViewOverride(props,ref){const isStaticRenderer=useIsStaticRenderer();const elementRef=useRef(null);const hasAnimatedRef=useRef(false);const animationFrameRef=useRef(null);const observerRef=useRef(null);const targetTextNodeRef=useRef(null);const originalNodeValueRef=useRef(\"\");const setRefs=useCallback(node=>{elementRef.current=node;if(typeof ref===\"function\"){ref(node);}else if(ref&&typeof ref===\"object\"){ref.current=node;}},[ref]);useEffect(()=>{if(isStaticRenderer)return;if(typeof window===\"undefined\")return;if(typeof IntersectionObserver===\"undefined\")return;const element=elementRef.current;if(!element)return;const walker=document.createTreeWalker(element,window.NodeFilter.SHOW_TEXT);let currentNode=walker.nextNode();let selectedNode=null;let selectedDepth=-1;let selectedMatch=null;const getDepth=node=>{let depth=0;let parent=node.parentNode;while(parent&&parent!==element){depth+=1;parent=parent.parentNode;}return depth;};while(currentNode){const value=currentNode.nodeValue??\"\";const match=value.match(/^(.*?)(-?\\d[\\d,]*(?:\\.\\d+)?)(.*)$/);if(match){const depth=getDepth(currentNode);if(depth>=selectedDepth){selectedNode=currentNode;selectedDepth=depth;selectedMatch=match;}}currentNode=walker.nextNode();}if(!selectedNode||!selectedMatch)return;targetTextNodeRef.current=selectedNode;originalNodeValueRef.current=selectedNode.nodeValue??\"\";const match=selectedMatch;if(!match)return;const prefix=match[1]??\"\";const numericPart=(match[2]??\"\").replace(/,/g,\"\");const suffix=match[3]??\"\";const targetValue=Number(numericPart);if(!Number.isFinite(targetValue))return;const decimalMatch=(match[2]??\"\").match(/\\.(\\d+)/);const decimalPlaces=decimalMatch?decimalMatch[1].length:0;const hasGrouping=(match[2]??\"\").includes(\",\");const formatValue=value=>{const rounded=decimalPlaces>0?value.toFixed(decimalPlaces):Math.round(value).toString();if(!hasGrouping||decimalPlaces>0)return rounded;return Number(rounded).toLocaleString();};const startAnimation=()=>{if(hasAnimatedRef.current)return;hasAnimatedRef.current=true;const durationMs=1200;const startTime=performance.now();const step=now=>{const elapsed=now-startTime;const linearProgress=Math.min(elapsed/durationMs,1);const easedProgress=1-Math.pow(1-linearProgress,3);const currentValue=targetValue*easedProgress;if(targetTextNodeRef.current){targetTextNodeRef.current.nodeValue=`${prefix}${formatValue(currentValue)}${suffix}`;}if(linearProgress<1){animationFrameRef.current=window.requestAnimationFrame(step);}else{if(targetTextNodeRef.current){targetTextNodeRef.current.nodeValue=`${prefix}${formatValue(targetValue)}${suffix}`;}}};animationFrameRef.current=window.requestAnimationFrame(step);};observerRef.current=new IntersectionObserver(entries=>{for(const entry of entries){if(entry.isIntersecting){startAnimation();observerRef.current?.disconnect();observerRef.current=null;break;}}},{threshold:.25});observerRef.current.observe(element);return()=>{observerRef.current?.disconnect();observerRef.current=null;if(animationFrameRef.current!==null){window.cancelAnimationFrame(animationFrameRef.current);animationFrameRef.current=null;}if(!hasAnimatedRef.current&&targetTextNodeRef.current){targetTextNodeRef.current.nodeValue=originalNodeValueRef.current;}};},[isStaticRenderer]);return /*#__PURE__*/_jsx(Component,{ref:setRefs,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"CountUpOnView\":{\"type\":\"reactHoc\",\"name\":\"CountUpOnView\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"StickyHeaderScrollReveal\":{\"type\":\"reactHoc\",\"name\":\"StickyHeaderScrollReveal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StickyHeaderScrollReveal.map"],"mappings":"uNAA+K,SAAgB,EAAyB,EAAU,CAAC,OAAoB,EAAW,SAA0C,EAAM,EAAI,CAAC,IAAM,EAAiB,EAAoB,EAAO,CAAC,EAAW,GAAeA,EAAS,EAAK,EAAQ,EAAkBC,MAAgB,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAU,EAAO,SAAS,IAAI,MAAoB,CAAC,EAAc,CAAS,CAAE,CAAC,CAAE,EAAE,CAAC,CAAC,EAAE,MAAc,CAAI,OAAkC,IAAS,OAA0G,OAAvF,EAAkB,EAAE,EAAO,iBAAiB,SAAS,EAAkB,CAAC,QAAQ,EAAI,CAAC,MAAY,CAAC,EAAO,oBAAoB,SAAS,CAAiB,CAAE,CAAE,EAAE,CAAC,EAAiB,CAAiB,CAAC,EAAE,IAAM,EAAYC,MAAY,EAAW,CAAC,gBAAgB,4BAA4B,UAAU,iCAAiC,OAAO,i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