{"version":3,"file":"LogoTickerFallback.DdP4aztK.mjs","names":["useState","useEffect","useSyncExternalStore","forwardRef","useRef","useCallback","_jsx","__esmMin","ne","init_npm_react_18_3_1","window","_e","de","init_jsx_runtime","me","J","c","ce","init_ssg_sandbox_shims","RenderTarget","init_framer_ChujFWHC","useFallbackActive","reducedMotion","setReducedMotion","query","update","isStalled","subscribe","stalled","withTickerFallback","Component","props","ref","fallback","localRef","element","timer","offset","stop","observer","entry","previous","current","listeners","listener","STALL_CHECK_MS","mergedRef","node","init_LogoTickerFallback"],"sources":["https:/framerusercontent.com/modules/xCMqcqU8SIZsFYqpZrwN/WEOwEkSIu9v5mxuBsqMG/LogoTickerFallback.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback,useEffect,useRef,useState,useSyncExternalStore}from\"react\";import{RenderTarget}from\"framer\";// Framer's ticker effect stops when iOS Reduce Motion is on and freezes mid-strip, so logos sit cut off at\n// the screen edge. withTickerFallback goes on a plain frame wrapping the ticker rows (an override directly on\n// a ticker frame stops the ticker from starting). It hides the rows whenever they can't scroll (reduced motion,\n// or no movement after a few seconds on screen), and the frame wearing withStaticLogoFallback shows a static,\n// wrapping logo grid in their place.\nconst STALL_CHECK_MS=2500;let stalled=false;const listeners=new Set;const subscribe=listener=>{listeners.add(listener);return()=>listeners.delete(listener);};function useFallbackActive(){// Starts false so SSR and hydration render the ticker; reduced-motion visitors swap right after mount.\nconst[reducedMotion,setReducedMotion]=useState(false);useEffect(()=>{const query=window.matchMedia(\"(prefers-reduced-motion: reduce)\");const update=()=>setReducedMotion(query.matches);update();query.addEventListener(\"change\",update);return()=>query.removeEventListener(\"change\",update);},[]);const isStalled=useSyncExternalStore(subscribe,()=>stalled,()=>false);return reducedMotion||isStalled;}export function withTickerFallback(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const fallback=useFallbackActive();const localRef=useRef(null);useEffect(()=>{const element=localRef.current;if(fallback||!element||RenderTarget.current()!==RenderTarget.preview)return;let timer;const offset=()=>getComputedStyle(element.querySelector(\"ul\")??element).transform;const stop=()=>window.clearInterval(timer);// Compare consecutive samples only while the rows are on screen and the tab is visible; browsers\n// pause animation otherwise. The first sample can predate the ticker starting, so one change isn't proof.\nconst observer=new IntersectionObserver(([entry])=>{stop();if(!entry?.isIntersecting)return;let previous=offset();timer=window.setInterval(()=>{if(document.visibilityState!==\"visible\")return;const current=offset();if(current!==previous){previous=current;return;}stop();stalled=true;listeners.forEach(listener=>listener());},STALL_CHECK_MS);},{threshold:.5});observer.observe(element);return()=>{stop();observer.disconnect();};},[fallback]);const mergedRef=useCallback(node=>{localRef.current=node;if(typeof ref===\"function\")ref(node);else if(ref)ref.current=node;},[ref]);if(fallback)return null;return /*#__PURE__*/_jsx(Component,{...props,ref:mergedRef});});}export function withStaticLogoFallback(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const fallback=useFallbackActive();// Keep the grid visible on the canvas so it stays editable.\nif(!fallback&&RenderTarget.current()!==RenderTarget.canvas)return null;return /*#__PURE__*/_jsx(Component,{...props,ref:ref});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withStaticLogoFallback\":{\"type\":\"reactHoc\",\"name\":\"withStaticLogoFallback\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTickerFallback\":{\"type\":\"reactHoc\",\"name\":\"withTickerFallback\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LogoTickerFallback.map"],"mappings":"A,sNAK8J,SAASqB,GAAmB,CAC1L,GAAK,CAACC,EAAcC,GAAkBvB,EAAS,EAAK,EAAEC,MAAc,CAAC,IAAMuB,EAAMd,EAAO,WAAW,kCAAkC,EAAQe,MAAWF,EAAiBC,EAAM,OAAO,EAAmD,OAAjDC,EAAO,EAAED,EAAM,iBAAiB,SAASC,CAAM,MAAYD,EAAM,oBAAoB,SAASC,CAAM,CAAE,EAAE,CAAC,CAAC,EAAE,IAAMC,EAAUx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