{"version":3,"file":"Carousel.Cv89O2b8.mjs","names":["useState","useRef","useState","__legacyOverrideHOC_DataObserverContext","_jsx","__esmMin","window","init_npm_react_18_3_1","te","oe","init_ssg_sandbox_shims","_e","de","J","c","ce","useObserveData","init_framer_Bf4_tcb2","DataObserverContext","Data","createStore","dataStore","state1","setDataStore","newState","storeState","storeSetters","setStoreState","setter","useStore","state","setState","init_createStore","init_store_js__1_0","getGallery","GALLERY_ID","withGalleryScroll","store","setStore","update","el","timer","fewImages","MAX_VISIBLE","Component","props","ScrollPrev","SCROLL_AMOUNT","ScrollNext","HorizontalProgramScroller","localRef","isTablet","setIsTablet","mediaQuery","node","applyChildSnapStyles","element","child","removeChildSnapStyles","observer","ref","event","target","withScrollPrev","C","withScrollNext","init_Carousel","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/liyDWXjAbb7hZ85sajt2/mkqbSulXCzJpXwUFiXeR/Carousel.js"],"sourcesContent":["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map","/*\n * createStore (framer/store@1.0.1)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,startTransition,useEffect,useRef,useState}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const GALLERY_ID=\"gallery-carousel\";const SCROLL_AMOUNT=300;const MAX_VISIBLE=4;const useStore=createStore({imageCount:99});function getGallery(){return document.getElementById(GALLERY_ID);}// ── Apply to Gallery component ──────────────────────────────\nexport function withGalleryScroll(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();useEffect(()=>{function update(){const el=document.getElementById(GALLERY_ID);if(el)setStore({imageCount:el.querySelectorAll(\"img\").length});}update();const timer=setTimeout(update,500);return()=>clearTimeout(timer);},[]);const fewImages=store.imageCount<=MAX_VISIBLE;return /*#__PURE__*/_jsx(Component,{ref:ref,...props,id:GALLERY_ID,style:{...props.style,scrollBehavior:\"smooth\",scrollbarWidth:\"none\",msOverflowStyle:\"none\",justifyContent:fewImages?\"center\":\"flex-start\"}});});}// ── Apply to left arrow button ──────────────────────────────\nexport function ScrollPrev(){const[store]=useStore();const fewImages=store.imageCount<=MAX_VISIBLE;return{style:{display:fewImages?\"none\":undefined},onClick(){const el=getGallery();if(el)el.scrollLeft-=SCROLL_AMOUNT;}};}// ── Apply to right arrow button ─────────────────────────────\nexport function ScrollNext(){const[store]=useStore();const fewImages=store.imageCount<=MAX_VISIBLE;return{style:{display:fewImages?\"none\":undefined},onClick(){const el=getGallery();if(el)el.scrollLeft+=SCROLL_AMOUNT;}};}// ── Apply to 03 / PROGRAM cards container (Phone/Tablet) ───\nexport function HorizontalProgramScroller(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const localRef=useRef(null);const[isTablet,setIsTablet]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;const mediaQuery=window.matchMedia(\"(min-width: 810px) and (max-width: 1199px)\");const update=()=>{startTransition(()=>setIsTablet(mediaQuery.matches));};update();if(typeof mediaQuery.addEventListener===\"function\"){mediaQuery.addEventListener(\"change\",update);return()=>mediaQuery.removeEventListener(\"change\",update);}mediaQuery.addListener(update);return()=>mediaQuery.removeListener(update);},[]);useEffect(()=>{if(typeof window===\"undefined\")return;const node=localRef.current;if(!node)return;const applyChildSnapStyles=()=>{Array.from(node.children).forEach(child=>{const element=child;element.style.flexShrink=\"0\";element.style.scrollSnapAlign=\"start\";});};const removeChildSnapStyles=()=>{Array.from(node.children).forEach(child=>{const element=child;element.style.removeProperty(\"flex-shrink\");element.style.removeProperty(\"scroll-snap-align\");});};if(!isTablet){removeChildSnapStyles();return;}applyChildSnapStyles();const observer=new MutationObserver(()=>{applyChildSnapStyles();});observer.observe(node,{childList:true});return()=>{observer.disconnect();removeChildSnapStyles();};},[isTablet]);return /*#__PURE__*/_jsx(Component,{...props,ref:node=>{localRef.current=node;if(typeof ref===\"function\")ref(node);else if(ref&&typeof ref===\"object\"){ref.current=node;}},onWheel:event=>{if(props.onWheel)props.onWheel(event);if(event.defaultPrevented)return;if(!isTablet)return;if(Math.abs(event.deltaY)>Math.abs(event.deltaX)){event.preventDefault();const target=event.currentTarget;target.scrollLeft+=event.deltaY;}},style:{...props.style,...isTablet?{display:\"flex\",flexDirection:\"row\",overflowX:\"auto\",overflowY:\"hidden\",touchAction:\"pan-x\",WebkitOverflowScrolling:\"touch\",scrollSnapType:\"x mandatory\",overscrollBehaviorY:\"contain\"}:null}});});}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withScrollPrev(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...ScrollPrev(props)});};}withScrollPrev.displayName=\"ScrollPrev\";export function withScrollNext(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...ScrollNext(props)});};}withScrollNext.displayName=\"ScrollNext\";\nexport const __FramerMetadata__ = {\"exports\":{\"ScrollPrev\":{\"type\":\"override\",\"name\":\"ScrollPrev\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGalleryScroll\":{\"type\":\"reactHoc\",\"name\":\"withGalleryScroll\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"HorizontalProgramScroller\":{\"type\":\"reactHoc\",\"name\":\"HorizontalProgramScroller\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrollPrev\":{\"type\":\"reactHoc\",\"name\":\"withScrollPrev\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ScrollNext\":{\"type\":\"override\",\"name\":\"ScrollNext\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrollNext\":{\"type\":\"reactHoc\",\"name\":\"withScrollNext\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Carousel.map"],"mappings":"A,8NAA8E,SAAgBoB,EAAY,EAAO,CACjH,IAAMC,EAAUF,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAGG,CAAM,CAAC,CAAC,CAAC,EACjDC,EAAa,GAAU,CAC1B,OAAOC,GAAW,aAAY,EAASA,EAASH,EAAU,KAAK,GAAG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