{"version":3,"file":"Examples.DraX5B_g.mjs","names":["useStore","useState","useState","useMemo","parsed"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js","https:/framer.com/m/framer/utils.js@^0.9.0","https:/framerusercontent.com/modules/OXoMHYaPDNeV2kr15ouB/idoqAZodfGbikc25RNid/Examples.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","export const centerContent = {\n    display: \"flex\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n};\nexport const autoSizingText = {\n    width: \"max-content\",\n    wordBreak: \"break-word\",\n    overflowWrap: \"break-word\",\n    overflow: \"hidden\",\n    whiteSpace: \"pre-wrap\",\n    flexShrink: 0\n};\nexport const defaultContainerStyles = {\n    ...centerContent,\n    overflow: \"hidden\"\n};\nexport const containerStyles = defaultContainerStyles;\nexport const randomColor = ()=>\"#\" + Math.floor(Math.random() * 16777215).toString(16)\n;\n\nexport const __FramerMetadata__ = {\"exports\":{\"centerContent\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"autoSizingText\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultContainerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"randomColor\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./Utils.map","/*\n * Utils (framer/utils@0.9.0)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,startTransition,useCallback,useEffect,useMemo,useState}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";// Learn more: https://www.framer.com/developers/overrides/\nconst useStore=createStore({background:\"#0099FF\"});export function withRotate(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{rotate:90},transition:{duration:2}});});}export function withHover(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,whileHover:{scale:1.05}});});}export function withRandomColor(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});});}export function withSubtleRandomSheenDrift(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[drift,setDrift]=useState({x:0,y:0,opacity:1});const[reduceMotion,setReduceMotion]=useState(false);const pickNextDrift=useCallback(()=>{startTransition(()=>{setDrift({x:(Math.random()-.5)*6,y:(Math.random()-.5)*6,opacity:.9+Math.random()*.1});});},[]);useEffect(()=>{if(typeof window===\"undefined\")return;const mediaQuery=window.matchMedia(\"(prefers-reduced-motion: reduce)\");const updateMotionPreference=()=>{startTransition(()=>{setReduceMotion(mediaQuery.matches);});};updateMotionPreference();mediaQuery.addEventListener(\"change\",updateMotionPreference);return()=>{mediaQuery.removeEventListener(\"change\",updateMotionPreference);};},[]);useEffect(()=>{if(typeof window===\"undefined\"||reduceMotion)return;let timeoutId=0;let cancelled=false;const loop=()=>{if(cancelled)return;pickNextDrift();const nextDelay=3500+Math.random()*2500;timeoutId=window.setTimeout(loop,nextDelay);};timeoutId=window.setTimeout(loop,1800);return()=>{cancelled=true;window.clearTimeout(timeoutId);};},[pickNextDrift,reduceMotion]);const style=useMemo(()=>{const incomingStyle=props.style??{};if(reduceMotion)return incomingStyle;const existingTransform=typeof incomingStyle.transform===\"string\"?incomingStyle.transform:\"\";const incomingOpacityRaw=incomingStyle.opacity;const incomingOpacity=typeof incomingOpacityRaw===\"number\"?incomingOpacityRaw:typeof incomingOpacityRaw===\"string\"?Number.parseFloat(incomingOpacityRaw):Number.NaN;const mergedOpacity=Number.isFinite(incomingOpacity)?incomingOpacity*drift.opacity:drift.opacity;const driftTransform=`translate3d(${drift.x.toFixed(2)}px, ${drift.y.toFixed(2)}px, 0)`;return{...incomingStyle,transform:existingTransform?`${existingTransform} ${driftTransform}`:driftTransform,opacity:mergedOpacity,transition:\"transform 4.8s ease-in-out, opacity 4.8s ease-in-out\",willChange:\"transform, opacity\"};},[props.style,drift,reduceMotion]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:style});});}export function withBlurToClearOnAppear(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[reduceMotion,setReduceMotion]=useState(false);const[isClear,setIsClear]=useState(false);const initialHoldMs=120;const delayMs=useMemo(()=>{const parseDelay=value=>{if(typeof value===\"number\"&&Number.isFinite(value)){return Math.max(0,value);}if(typeof value===\"string\"){const trimmed=value.trim();if(!trimmed)return 0;if(trimmed.endsWith(\"ms\")){const parsed=Number.parseFloat(trimmed);return Number.isFinite(parsed)?Math.max(0,parsed):0;}if(trimmed.endsWith(\"s\")){const parsed=Number.parseFloat(trimmed);return Number.isFinite(parsed)?Math.max(0,parsed*1e3):0;}const parsed=Number.parseFloat(trimmed);return Number.isFinite(parsed)?Math.max(0,parsed):0;}return 0;};const incomingStyle=props.style??{};const customDelay=incomingStyle[\"--blur-delay\"]??incomingStyle[\"--appear-delay\"]??props[\"data-blur-delay\"]??props[\"data-appear-delay\"];return parseDelay(customDelay);},[props]);useEffect(()=>{if(typeof window===\"undefined\")return;const mediaQuery=window.matchMedia(\"(prefers-reduced-motion: reduce)\");const updateMotionPreference=()=>{startTransition(()=>{setReduceMotion(mediaQuery.matches);});};updateMotionPreference();mediaQuery.addEventListener(\"change\",updateMotionPreference);return()=>{mediaQuery.removeEventListener(\"change\",updateMotionPreference);};},[]);useEffect(()=>{if(reduceMotion){startTransition(()=>{setIsClear(true);});return;}startTransition(()=>{setIsClear(false);});if(typeof window===\"undefined\")return;const timeoutId=window.setTimeout(()=>{startTransition(()=>{setIsClear(true);});},delayMs+initialHoldMs);return()=>{window.clearTimeout(timeoutId);};},[delayMs,reduceMotion]);const style=useMemo(()=>{const incomingStyle=props.style??{};if(reduceMotion)return incomingStyle;const baseFilter=typeof incomingStyle.filter===\"string\"?incomingStyle.filter.trim():\"\";const baseBackdropFilter=typeof incomingStyle.backdropFilter===\"string\"?incomingStyle.backdropFilter.trim():\"\";const supportsBackdropFilter=typeof window!==\"undefined\"&&typeof CSS!==\"undefined\"&&typeof CSS.supports===\"function\"&&(CSS.supports(\"backdrop-filter\",\"blur(1px)\")||CSS.supports(\"-webkit-backdrop-filter\",\"blur(1px)\"));const startFilter=baseFilter?`${baseFilter} blur(16px)`:\"blur(16px)\";const startBackdropFilter=baseBackdropFilter?`${baseBackdropFilter} blur(16px)`:\"blur(16px)\";const mergedTransition=incomingStyle.transition?`${incomingStyle.transition}, filter 1200ms cubic-bezier(0.22, 1, 0.36, 1), backdrop-filter 1200ms cubic-bezier(0.22, 1, 0.36, 1)`:\"filter 1200ms cubic-bezier(0.22, 1, 0.36, 1), backdrop-filter 1200ms cubic-bezier(0.22, 1, 0.36, 1)\";return{...incomingStyle,filter:isClear?baseFilter||undefined:startFilter,backdropFilter:supportsBackdropFilter||baseBackdropFilter?isClear?baseBackdropFilter||undefined:startBackdropFilter:incomingStyle.backdropFilter,transition:mergedTransition,willChange:incomingStyle.willChange?`${incomingStyle.willChange}, filter`:\"filter\"};},[props.style,reduceMotion,isClear]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:style});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBlurToClearOnAppear\":{\"type\":\"reactHoc\",\"name\":\"withBlurToClearOnAppear\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSubtleRandomSheenDrift\":{\"type\":\"reactHoc\",\"name\":\"withSubtleRandomSheenDrift\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"qNAA8E,SAAgB,EAAY,EAAO,CACjH,IAAM,EAAU,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAG,EAAO,CAAC,CAAC,CAAC,CAClD,EAAa,GAAU,CAC1B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAU,MAAM,EAAE,EAAU,MAAM,OAAO,OAAO,CAAC,GAAG,EAAU,MAAM,GAAG,EAAS,CAAC,EAChI,EAAW,OAAO,GAAS,SAAS,OAAO,OAAO,CAAC,GAAG,EAAO,CAAC,CAAC,EAC7D,EAAa,IAAI,IACjB,EAAc,GAAU,CAC3B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAW,EAAE,EAAW,OAAO,GAAW,SAAS,OAAO,OAAO,CAAC,GAAG,EAAW,GAAG,EAAS,CAAC,CAAC,EACjJ,EAAa,QAAQ,GAAQ,EAAO,EAAW,CAAC,EAChD,SAASA,GAAU,CACnB,GAAK,CAAC,EAAM,GAAUC,EAAS,EAAW,CAK1C,OAHA,OACA,EAAa,IAAI,EAAS,KAAW,EAAa,OAAO,EAAS,EAAG,EAAE,CAAC,CACrE,GAAgB,GAAG,IAAM,GAAgB,CAAO,CAAC,EAAU,MAAM,EAAa,EAC3E,CAAC,EAAM,EAAc,CAAG,OAAOD,mBAfC,IAAwC,iCEAjE,EAAgB,CACzB,QAAS,OACT,eAAgB,SAChB,WAAY,SACf,CAWG,CADA,GAAG,EACO,qBEdyoF,SAAgB,EAAwB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,EAAa,GAAiBE,EAAS,GAAM,CAAM,CAAC,EAAQ,GAAYA,EAAS,GAAM,CAA+B,EAAQC,MAAY,CAAC,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