{"version":3,"file":"utils.CSWfcDKZ.mjs","names":["useStore","useState"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/tlrySEreY6LMJX4iIMKz/2JGDyQAdjJD791ul6yez/utils.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{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{forwardRef,useEffect}from\"react\";const initialState={testingFontDisplayName:\"Insignia LT Pro\",overlayOpened:false};export const useStore=createStore(initialState);// ------  Test It Button Wrapper ------//\nexport function setTestingFontOnClick(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();const handleClick=event=>{const{fontName}=props;setStore({...store,testingFontDisplayName:fontName});props.onClick?.(event);};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleClick});});}// ------ Override to apply blending based on the overlay state ------ //\nexport function withBlending(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:{...props.style,mixBlendMode:store?.overlayOpened?\"normal\":\"difference\"}});});}export function defaultMenuWrapper(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();// Hook for resetting the overlay state\nuseEffect(()=>{if(typeof document!==\"undefined\"){document.body.style.overflow=\"auto\";}setStore({...store,overlayOpened:false});},[]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}export function mobileMenuWrapper(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();// Hook for activating the overlay state\nuseEffect(()=>{if(typeof document!==\"undefined\"){document.body.style.overflow=\"hidden\";}setStore({...store,overlayOpened:true});},[]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:{...props?.style,height:\"100dvh\"},\"data-prevent-reset\":\"true\"});});}// Used for \"Contacts\" button on Desktop/Tablet Navmenu\nexport function withOpenOverlay(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();const handleClick=event=>{if(typeof document!==\"undefined\"){document.body.style.overflow=\"hidden\";}setStore({...store,overlayOpened:true});props.onClick?.(event);};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleClick,\"data-open-overlay\":\"true\"});});}// ------ Global overlay reset ------ //\nexport function withGlobalResetOverlay(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();const handleGlobalClick=event=>{const target=event.target;if(!target){props.onClick?.(event);return;}const insidePreventZone=target.closest(\"[data-prevent-reset]\");const isOpenOverlayButton=target.closest(\"[data-open-overlay]\");if(isOpenOverlayButton){console.log(\"Reset ignored: open overlay button\");props.onClick?.(event);return;}if(insidePreventZone){console.log(\"Reset ignored: inside prevent zone, not a trigger link\");props.onClick?.(event);return;}if(store.overlayOpened||typeof document!==\"undefined\"&&document.body.style.overflow===\"hidden\"){setStore({...store,overlayOpened:false});if(typeof document!==\"undefined\"){document.body.style.overflow=\"auto\";}}props.onClick?.(event);};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleGlobalClick,\"data-trigger-link\":\"true\"});});}// Debug helper for viewing the current store state.\n// Wrap any text node with this override to print the store state on screen.\nexport function withStore(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:{...props?.style,zIndex:100},text:\"store: \"+JSON.stringify(store)});});}\nexport const __FramerMetadata__ = {\"exports\":{\"mobileMenuWrapper\":{\"type\":\"reactHoc\",\"name\":\"mobileMenuWrapper\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setTestingFontOnClick\":{\"type\":\"reactHoc\",\"name\":\"setTestingFontOnClick\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withStore\":{\"type\":\"reactHoc\",\"name\":\"withStore\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGlobalResetOverlay\":{\"type\":\"reactHoc\",\"name\":\"withGlobalResetOverlay\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBlending\":{\"type\":\"reactHoc\",\"name\":\"withBlending\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useStore\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withOpenOverlay\":{\"type\":\"reactHoc\",\"name\":\"withOpenOverlay\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultMenuWrapper\":{\"type\":\"reactHoc\",\"name\":\"defaultMenuWrapper\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./utils.map"],"mappings":"yLAA8E,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,qBEC9E,SAAgB,EAAsB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,EAAM,GAAU,GAAU,CAAO,EAAY,GAAO,CAAC,GAAK,CAAC,YAAU,EAAM,EAAS,CAAC,GAAG,EAAM,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