{"version":3,"file":"CardTicker.CtFVsPpX.mjs","names":["useRef","useState","__esmMin","init_ssg_sandbox_shims","_e","p","c","init_jsx_runtime","ce","init_npm_react_18_3_1","de","window","useLocaleInfo","addPropertyControls","init_framer_CaDWdxiz","useIsStaticRenderer","ControlType","PauseToggle","props","fg","theme","bg","ring","onToggle","paused","label","CardTicker","selfRef","isStatic","PAUSE_LABELS","activeLocale","userPaused","setUserPaused","canAnimate","setCanAnimate","userPausedRef","self","shown","el","motion","scope","row","sets","loop","x","frame","last","hovered","focused","held","onScreen","cleanups","pauseOnHover","tick","dt","now","speed","stop","measure","a","setup","fn","found","setLayer","root","on","t","type","s","n","viewport","io","entry","resizeTimer","onResize","onMotion","raf","late","toggle","showButton","pauseButton","buttonTheme","init_CardTicker"],"sources":["https:/framerusercontent.com/modules/LTPtBe6rYgMQkSqTKQss/n7y8ajdxGRWzcmxYYNLV/CardTicker.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer,useLocaleInfo}from\"framer\";const PAUSE_LABELS={en:[\"Pause animation\",\"Play animation\"],nl:[\"Animatie pauzeren\",\"Animatie afspelen\"],de:[\"Animation pausieren\",\"Animation abspielen\"],es:[\"Pausar animaci\\xf3n\",\"Reproducir animaci\\xf3n\"],fr:[\"Mettre l’animation en pause\",\"Lire l’animation\"]};function PauseToggle(props){const{paused,onToggle,theme,label}=props;const fg=theme===\"dark\"?\"rgb(255, 255, 255)\":\"rgb(8, 19, 40)\";const bg=theme===\"dark\"?\"rgba(8, 19, 40, 0.48)\":\"rgba(255, 255, 255, 0.88)\";const ring=theme===\"dark\"?\"rgb(27, 173, 255)\":\"rgb(0, 106, 166)\";return /*#__PURE__*/_jsxs(\"button\",{type:\"button\",className:\"motion-pause-toggle\",onClick:onToggle,\"aria-label\":paused?label[1]:label[0],style:{width:44,height:44,padding:0,border:0,background:\"transparent\",display:\"grid\",placeItems:\"center\",cursor:\"pointer\",pointerEvents:\"auto\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`.motion-pause-toggle span{transition:background-color 150ms ease}.motion-pause-toggle:focus-visible{outline:2px solid ${ring};outline-offset:0;border-radius:999px}@media (hover:hover) and (pointer:fine){.motion-pause-toggle:hover span{filter:brightness(0.96)}}.motion-pause-toggle:active span{filter:brightness(0.92)}`}),/*#__PURE__*/_jsx(\"span\",{style:{width:32,height:32,borderRadius:999,background:bg,display:\"grid\",placeItems:\"center\",backdropFilter:\"blur(8px)\"},children:paused?/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",\"aria-hidden\":true,fill:fg,children:/*#__PURE__*/_jsx(\"path\",{d:\"M8 5.6v12.8c0 .8.9 1.3 1.6.8l9.4-6.4a1 1 0 0 0 0-1.6L9.6 4.8C8.9 4.3 8 4.8 8 5.6z\"})}):/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",\"aria-hidden\":true,fill:fg,children:/*#__PURE__*/_jsx(\"path\",{d:\"M7 5h3.5v14H7zM13.5 5H17v14h-3.5z\"})})})]});}/**\n * Card Ticker\n *\n * Scrolls a row of cards in a seamless loop. Place it inside the frame that\n * clips the row. The row holds two copies of the same CMS list, both named\n * \"Ticker Set\". The second copy is hidden from screen readers and keyboards.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 1\n * @framerIntrinsicHeight 1\n */export default function CardTicker(props){const{speed=40,pauseOnHover=true,setLayer=\"Ticker Set\",pauseButton=false,buttonTheme=\"light\"}=props;const selfRef=useRef(null);const isStatic=useIsStaticRenderer();const{activeLocale}=useLocaleInfo();const label=PAUSE_LABELS[(activeLocale?.code||\"en\").slice(0,2)]||PAUSE_LABELS.en;const[userPaused,setUserPaused]=useState(false);const[canAnimate,setCanAnimate]=useState(false);const userPausedRef=useRef(false);useEffect(()=>{const self=selfRef.current;if(!self||isStatic)return;const shown=el=>el.getClientRects().length>0;const motion=window.matchMedia(\"(prefers-reduced-motion: reduce)\");let scope=null;let row=null;let sets=[];let loop=0;let x=0;let frame=0;let last=0;let hovered=false;let focused=false;let held=false;let onScreen=true;const cleanups=[];const paused=()=>userPausedRef.current||pauseOnHover&&hovered||focused||held||!onScreen||document.hidden;const tick=now=>{const dt=last?Math.min(64,now-last):16;last=now;if(!paused()&&loop>0){x-=speed*dt/1e3;if(x<=-loop)x+=loop;if(row)row.style.transform=`translate3d(${x}px, 0, 0)`;}frame=requestAnimationFrame(tick);};const stop=()=>{if(frame)cancelAnimationFrame(frame);frame=0;last=0;};const measure=()=>{if(!row||sets.length<2)return;const a=sets[0].getBoundingClientRect();const b=sets[1].getBoundingClientRect();loop=b.left-a.left;};const setup=()=>{cleanups.splice(0).forEach(fn=>fn());stop();if(!shown(self))return;let el=self.parentElement;scope=null;while(el){const found=Array.from(el.querySelectorAll(`[data-framer-name=\"${setLayer}\"]`)).filter(shown);if(found.length>=1){scope=el;sets=found;break;}el=el.parentElement;}if(!scope||!sets.length)return;row=sets[0].parentElement;const root=scope;const on=(t,type,fn)=>{t.addEventListener(type,fn);cleanups.push(()=>t.removeEventListener(type,fn));};// Copies after the first are decorative: hide them from assistive tech and the tab order.\nsets.slice(1).forEach(s=>{s.setAttribute(\"aria-hidden\",\"true\");s.querySelectorAll(\"a, button, [tabindex]\").forEach(n=>n.setAttribute(\"tabindex\",\"-1\"));s.style.display=\"\";});setCanAnimate(!motion.matches&&sets.length>=2);if(motion.matches||sets.length<2){// No motion: let people scroll the row themselves instead.\nif(row)row.style.transform=\"\";sets.slice(1).forEach(s=>s.style.display=\"none\");// Scroll the clipping viewport (the row's parent), not the outer wrapper.\nconst viewport=row?.parentElement||root;viewport.style.overflowX=\"auto\";viewport.style.scrollSnapType=\"x proximity\";return;}const viewport=row?.parentElement||root;viewport.style.overflowX=\"\";viewport.style.scrollSnapType=\"\";measure();on(root,\"mouseenter\",()=>{hovered=true;});on(root,\"mouseleave\",()=>{hovered=false;});on(root,\"focusin\",e=>{if(e.target?.closest?.(\".motion-pause-toggle\"))return;focused=true;});on(root,\"focusout\",e=>{if(!root.contains(e.relatedTarget))focused=false;});on(root,\"pointerdown\",e=>{if(e.pointerType!==\"mouse\")held=true;});on(window,\"pointerup\",()=>{held=false;});on(window,\"pointercancel\",()=>{held=false;});const io=new IntersectionObserver(([entry])=>{onScreen=entry.isIntersecting;});io.observe(root);cleanups.push(()=>io.disconnect());frame=requestAnimationFrame(tick);};let resizeTimer=0;const onResize=()=>{window.clearTimeout(resizeTimer);resizeTimer=window.setTimeout(()=>{x=0;setup();},200);};const onMotion=()=>{x=0;setup();};window.addEventListener(\"resize\",onResize);motion.addEventListener(\"change\",onMotion);const raf=requestAnimationFrame(setup);// CMS images can change card widths after load; re-measure once they settle.\nconst late=window.setTimeout(measure,1500);return()=>{cancelAnimationFrame(raf);window.clearTimeout(resizeTimer);window.clearTimeout(late);stop();cleanups.splice(0).forEach(fn=>fn());window.removeEventListener(\"resize\",onResize);motion.removeEventListener(\"change\",onMotion);};},[isStatic,speed,pauseOnHover,setLayer]);const toggle=()=>{userPausedRef.current=!userPausedRef.current;setUserPaused(userPausedRef.current);};// Keep one root element, so the effect's reference to it stays valid when the button appears.\nconst showButton=pauseButton&&canAnimate;return /*#__PURE__*/_jsx(\"div\",{ref:selfRef,\"aria-hidden\":showButton?undefined:true,style:{width:pauseButton?44:1,height:pauseButton?44:1,pointerEvents:showButton?\"auto\":\"none\"},children:showButton&&/*#__PURE__*/_jsx(PauseToggle,{paused:userPaused,onToggle:toggle,theme:buttonTheme,label:label})});}addPropertyControls(CardTicker,{speed:{type:ControlType.Number,title:\"Speed\",defaultValue:40,min:5,max:200,step:5,unit:\"px/s\"},pauseOnHover:{type:ControlType.Boolean,title:\"Pause on hover\",defaultValue:true},setLayer:{type:ControlType.String,title:\"Set layer\",defaultValue:\"Ticker Set\"},pauseButton:{type:ControlType.Boolean,title:\"Pause button\",defaultValue:false},buttonTheme:{type:ControlType.Enum,title:\"Button theme\",options:[\"dark\",\"light\"],optionTitles:[\"On dark\",\"On light\"],defaultValue:\"light\",hidden:p=>!p.pauseButton}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CardTicker\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"1\",\"framerIntrinsicHeight\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CardTicker.map"],"mappings":"A,6NAAkc,SAASiB,EAAY,EAAM,CAAC,GAAK,CAAC,SAAO,WAAS,QAAM,SAAOC,EAAYC,EAAGC,IAAQ,OAAO,qBAAqB,iBAAuBC,EAAGD,IAAQ,OAAO,wBAAwB,4BAAkCE,EAAKF,IAAQ,OAAO,oBAAoB,mBAAmB,MAAoB,gBAAM,SAAS,CAAC,KAAK,SAAS,UAAU,sBAAsB,QAAQG,EAAS,aAAaC,EAAOC,EAAM,GAAGA,EAAM,GAAG,MAAM,CAAC,MAAM,GAAG,OAAO,GAAG,QAAQ,EAAE,OAAO,EAAE,WAAW,cAAc,QAAQ,OAAO,WAAW,SAAS,OAAO,UAAU,cAAc,MAAM,EAAE,SAAS,CAAc,gBAAK,QAAQ,CAAC,SAAS,yHAAyHH,EAAK,iMAAiM,CAAC,EAAe,gBAAK,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,OAAO,GAAG,aAAa,IAAI,WAAWD,EAAG,QAAQ,OAAO,WAAW,SAAS,eAAe,WAAW,EAAE,SAASG,EAAoB,gBAAK,MAAM,CAAC,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,cAAc,GAAK,KAAKL,EAAG,SAAsB,gBAAK,OAAO,CAAC,EAAE,mFAAmF,CAAC,CAAC,CAAC,EAAe,gBAAK,MAAM,CAAC,MAAM,KAAK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