{"version":3,"file":"autoCarouselWithPagination.C_9kD3bQ.mjs","names":["useRef","useMemo","useCallback","__legacyOverrideHOC_DataObserverContext","_jsx","__esmMin","window","pe","init_ssg_sandbox_shims","init_npm_react_18_3_1","de","oe","ne","init_jsx_runtime","ce","animate","init_framer_motion_DhsWWWsN","addPropertyControls","init_framer_Bf4_tcb2","DataObserverContext","ControlType","useIsStaticRenderer","autoCarouselWithPagination","ref","root","carousel","pagination","slides","dots","index","isSwiping","startX","deltaX","lastInteractionTime","updateSlide","newIndex","el","dot","i","timeSinceLastInteraction","res","onPointerDown","onPointerMove","onPointerUp","ContinuousHorizontalCarousel","props","isStatic","resolvedSpeed","speed","markCloneSubtree","node","track","reducedMotion","originalWidth","clones","clone","child","hovered","isDragging","dragStartX","dragStartOffset","didDrag","suppressClick","rafId","offset","lastTime","onPointerEnter","onPointerLeave","pauseOnHover","normalizeOffset","value","mod","applyOffset","event","endDrag","onClickCapture","previousTouchAction","shouldAnimate","frame","time","dt","withautoCarouselWithPagination","C","withContinuousHorizontalCarousel","init_autoCarouselWithPagination"],"sources":["https:/framerusercontent.com/modules/tCYrUm1v2Hisj5wc36B3/nxUwKPR650nab69Ol2ym/autoCarouselWithPagination.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useCallback,useEffect,useMemo,useRef}from\"react\";import{animate}from\"framer-motion\";export function autoCarouselWithPagination(){const ref=useRef(null);useEffect(()=>{const root=ref.current;if(!root)return;const slider=root.querySelector(\"[data-framer-name='Slider']\");const carousel=slider?.querySelector(\"[data-framer-name='Carousel']\");const pagination=root.querySelector(\"[data-framer-name='Pagination']\");if(!carousel||!pagination)return;const slides=Array.from(carousel.children);const dots=Array.from(pagination.children);const slideWidth=398;const interval=3500;const pauseAfterSwipe=5e3// ms\n;let index=0;let isSwiping=false;let startX=0;let deltaX=0;let lastInteractionTime=Date.now();const updateSlide=async newIndex=>{index=Math.max(0,Math.min(newIndex,slides.length-1));await animate(carousel,{x:-index*slideWidth},{duration:.6,ease:\"easeInOut\"});// Update dots\ndots.forEach((dot,i)=>{const el=dot;el.style.opacity=i===index?\"1\":\"0.3\";//el.style.scale = i === index ? \"1.2\" : \"1\"\n});};const loop=async()=>{while(true){const now=Date.now();const timeSinceLastInteraction=now-lastInteractionTime;if(!isSwiping&&timeSinceLastInteraction>pauseAfterSwipe){await updateSlide((index+1)%slides.length);}await new Promise(res=>setTimeout(res,interval));}};loop();// Swipe detection\nconst onPointerDown=e=>{isSwiping=true;startX=e.clientX;};const onPointerMove=e=>{if(!isSwiping)return;deltaX=e.clientX-startX;};const onPointerUp=()=>{if(!isSwiping)return;const threshold=50;if(deltaX<-threshold){updateSlide(index+1);}else if(deltaX>threshold){updateSlide(index-1);}isSwiping=false;deltaX=0;lastInteractionTime=Date.now();};carousel.addEventListener(\"pointerdown\",onPointerDown);carousel.addEventListener(\"pointermove\",onPointerMove);carousel.addEventListener(\"pointerup\",onPointerUp);carousel.addEventListener(\"pointerleave\",onPointerUp);return()=>{carousel.removeEventListener(\"pointerdown\",onPointerDown);carousel.removeEventListener(\"pointermove\",onPointerMove);carousel.removeEventListener(\"pointerup\",onPointerUp);carousel.removeEventListener(\"pointerleave\",onPointerUp);};},[]);return{ref};}export function ContinuousHorizontalCarousel(props){const{speed=40,pauseOnHover=true}=props;const ref=useRef(null);const isStatic=useIsStaticRenderer();const resolvedSpeed=useMemo(()=>Math.max(1,speed),[speed]);const markCloneSubtree=useCallback(node=>{node.setAttribute(\"aria-hidden\",\"true\");node.setAttribute(\"data-marquee-clone\",\"true\");node.style.pointerEvents=\"none\";if(\"inert\"in node){node.inert=true;}const focusable=node.querySelectorAll(\"a, button, input, select, textarea, [tabindex], [contenteditable='true']\");focusable.forEach(el=>{el.setAttribute(\"tabindex\",\"-1\");el.setAttribute(\"aria-hidden\",\"true\");if(\"inert\"in el){el.inert=true;}});},[]);useEffect(()=>{const root=ref.current;if(!root)return;if(typeof window===\"undefined\")return;const track=root.firstElementChild;if(!track)return;const mediaQuery=window.matchMedia(\"(prefers-reduced-motion: reduce)\");const reducedMotion=mediaQuery.matches;const originalWidth=track.scrollWidth;if(!Number.isFinite(originalWidth)||originalWidth<=0)return;const originalChildren=Array.from(track.children);const clones=originalChildren.map(child=>{const clone=child.cloneNode(true);markCloneSubtree(clone);return clone;});clones.forEach(clone=>track.appendChild(clone));const dragThreshold=6;let hovered=false;let isDragging=false;let dragStartX=0;let dragStartOffset=0;let didDrag=false;let suppressClick=false;let rafId=0;let offset=0;let lastTime=0;const onPointerEnter=()=>{hovered=true;};const onPointerLeave=()=>{hovered=false;};if(pauseOnHover){root.addEventListener(\"pointerenter\",onPointerEnter);root.addEventListener(\"pointerleave\",onPointerLeave);}const normalizeOffset=value=>{if(!Number.isFinite(value))return 0;const mod=value%originalWidth;return mod<0?mod+originalWidth:mod;};const applyOffset=()=>{track.style.transform=`translate3d(${-offset}px, 0, 0)`;};const onPointerDown=event=>{if(event.button!==0&&event.pointerType!==\"touch\")return;isDragging=true;didDrag=false;dragStartX=event.clientX;dragStartOffset=offset;if(track.setPointerCapture){track.setPointerCapture(event.pointerId);}};const onPointerMove=event=>{if(!isDragging)return;const deltaX=event.clientX-dragStartX;if(!didDrag&&Math.abs(deltaX)>=dragThreshold){didDrag=true;}offset=normalizeOffset(dragStartOffset-deltaX);applyOffset();};const endDrag=event=>{if(!isDragging)return;isDragging=false;offset=normalizeOffset(offset);applyOffset();suppressClick=didDrag;didDrag=false;if(track.releasePointerCapture&&track.hasPointerCapture(event.pointerId)){track.releasePointerCapture(event.pointerId);}};const onClickCapture=event=>{if(!suppressClick)return;event.preventDefault();event.stopPropagation();suppressClick=false;};const previousTouchAction=root.style.touchAction;root.style.touchAction=\"pan-y\";track.addEventListener(\"pointerdown\",onPointerDown);track.addEventListener(\"pointermove\",onPointerMove);track.addEventListener(\"pointerup\",endDrag);track.addEventListener(\"pointercancel\",endDrag);track.addEventListener(\"pointerleave\",endDrag);root.addEventListener(\"click\",onClickCapture,true);const shouldAnimate=!isStatic&&!reducedMotion;const frame=time=>{if(lastTime===0)lastTime=time;const dt=(time-lastTime)/1e3;lastTime=time;const paused=isDragging||pauseOnHover&&hovered;if(!paused&&shouldAnimate){offset+=resolvedSpeed*dt;offset=normalizeOffset(offset);applyOffset();}rafId=window.requestAnimationFrame(frame);};rafId=window.requestAnimationFrame(frame);return()=>{window.cancelAnimationFrame(rafId);if(pauseOnHover){root.removeEventListener(\"pointerenter\",onPointerEnter);root.removeEventListener(\"pointerleave\",onPointerLeave);}track.removeEventListener(\"pointerdown\",onPointerDown);track.removeEventListener(\"pointermove\",onPointerMove);track.removeEventListener(\"pointerup\",endDrag);track.removeEventListener(\"pointercancel\",endDrag);track.removeEventListener(\"pointerleave\",endDrag);root.removeEventListener(\"click\",onClickCapture,true);root.style.touchAction=previousTouchAction;track.style.transform=\"\";clones.forEach(clone=>clone.remove());};},[isStatic,markCloneSubtree,pauseOnHover,resolvedSpeed]);return{ref};}addPropertyControls(ContinuousHorizontalCarousel,{speed:{type:ControlType.Number,title:\"Speed\",defaultValue:40,min:1,max:300,step:1,unit:\"px/s\"},pauseOnHover:{type:ControlType.Boolean,title:\"Pause Hover\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"}});import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withautoCarouselWithPagination(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...autoCarouselWithPagination(props)});};}withautoCarouselWithPagination.displayName=\"autoCarouselWithPagination\";export function withContinuousHorizontalCarousel(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...ContinuousHorizontalCarousel(props)});};}withContinuousHorizontalCarousel.displayName=\"ContinuousHorizontalCarousel\";\nexport const __FramerMetadata__ = {\"exports\":{\"ContinuousHorizontalCarousel\":{\"type\":\"override\",\"name\":\"ContinuousHorizontalCarousel\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withContinuousHorizontalCarousel\":{\"type\":\"reactHoc\",\"name\":\"withContinuousHorizontalCarousel\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withautoCarouselWithPagination\":{\"type\":\"reactHoc\",\"name\":\"withautoCarouselWithPagination\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"autoCarouselWithPagination\":{\"type\":\"override\",\"name\":\"autoCarouselWithPagination\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./autoCarouselWithPagination.map"],"mappings":"A,oRAA8M,SAAgBsB,GAA4B,CAAC,IAAMC,EAAIvB,EAAO,IAAI,EAImhB,OAJjhBc,MAAc,CAAC,IAAMU,EAAKD,EAAI,QAAQ,GAAG,CAACC,EAAK,OAAsE,IAAMC,EAAxDD,EAAK,cAAc,6BAAmD,CAAC,EAAE,cAAc,+BAA+B,EAAQE,EAAWF,EAAK,cAAc,iCAAiC,EAAE,GAAG,CAACC,GAAU,CAACC,EAAW,OAAO,IAAMC,EAAO,MAAM,KAAKF,EAAS,QAAQ,EAAQG,EAAK,MAAM,KAAKF,EAAW,QAAQ,EACpoBG,EAAM,EAAMC,EAAU,GAAUC,EAAO,EAAMC,EAAO,EAAMC,EAAoB,KAAK,IAAI,EAAQC,EAAY,KAAM,IAAU,CAAC,EAAM,KAAK,IAAI,EAAE,KAAK,IAAIC,EAASR,EAAO,OAAO,CAAC,CAAC,EAAE,MAAMZ,EAAQU,EAAS,CAAC,EAAE,CAACI,EAAM,GAAU,EAAE,CAAC,SAAS,GAAG,KAAK,WAAW,CAAC,EACjQD,EAAK,SAAS,EAAI,IAAI,CAAC,IAAMQ,EAAGC,EAAI,EAAG,MAAM,QAAQC,IAAIT,EAAM,IAAI,KACnE,CAAC,CAAE,GAAwQ,SAAlP,CAAC,OAAW,CAAsB,IAAMU,EAAjB,KAAK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