{"version":3,"file":"Examples.D2XRiAtm.mjs","names":["useState","useState","useCallback","useRef"],"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/F3zgpJVU4CY6j3ZfI08g/359SQFVdmNof3Tpxf8iD/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,useRef,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 withCheckmarkCheckbox(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[isChecked,setIsChecked]=useState(props.checked!==undefined?Boolean(props.checked):Boolean(props.defaultChecked));const[isFocusVisible,setIsFocusVisible]=useState(false);const[isKeyboardModality,setIsKeyboardModality]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;const onKeyDown=event=>{if(event.key===\"Tab\"||event.key===\" \"||event.key===\"Enter\"||event.key.startsWith(\"Arrow\")){startTransition(()=>setIsKeyboardModality(true));}};const onPointerDown=()=>{startTransition(()=>setIsKeyboardModality(false));};window.addEventListener(\"keydown\",onKeyDown,true);window.addEventListener(\"pointerdown\",onPointerDown,true);window.addEventListener(\"mousedown\",onPointerDown,true);return()=>{window.removeEventListener(\"keydown\",onKeyDown,true);window.removeEventListener(\"pointerdown\",onPointerDown,true);window.removeEventListener(\"mousedown\",onPointerDown,true);};},[]);useEffect(()=>{if(props.checked!==undefined){startTransition(()=>setIsChecked(Boolean(props.checked)));}},[props.checked]);const handleChange=useCallback(event=>{startTransition(()=>setIsChecked(Boolean(event?.currentTarget?.checked)));props.onChange?.(event);},[props]);const handleFocus=useCallback(event=>{if(isKeyboardModality){startTransition(()=>setIsFocusVisible(true));}props.onFocus?.(event);},[isKeyboardModality,props]);const handleBlur=useCallback(event=>{startTransition(()=>setIsFocusVisible(false));props.onBlur?.(event);},[props]);const checkmarkSvg=\"url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.4 6.5 11.2 12.8 4.8' stroke='white' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\\\")\";return /*#__PURE__*/_jsx(Component,{ref:ref,...props,type:props.type??\"checkbox\",onChange:handleChange,onFocus:handleFocus,onBlur:handleBlur,style:{...props.style,appearance:\"none\",WebkitAppearance:\"none\",width:16,height:16,minWidth:16,minHeight:16,borderRadius:4,border:`1px solid ${isChecked?\"#1677FF\":\"#D9D9D9\"}`,backgroundColor:isChecked?\"#1677FF\":\"#FFFFFF\",backgroundImage:isChecked?checkmarkSvg:\"none\",backgroundRepeat:\"no-repeat\",backgroundPosition:\"center\",backgroundSize:\"10px 10px\",boxSizing:\"border-box\",cursor:\"pointer\",display:\"inline-block\",verticalAlign:\"middle\",boxShadow:isFocusVisible?\"0 0 0 3px rgba(22, 119, 255, 0.35)\":props.style?.boxShadow,outline:\"none\"}});});}export function withContactSuccessRedirect(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const handleRedirect=useCallback(event=>{props.onClick?.(event);props.onTap?.(event);if(event?.defaultPrevented)return;if(typeof window===\"undefined\")return;if(window.location.hostname!==\"flowcorewater.com\"&&window.location.hostname!==\"www.flowcorewater.com\"){return;}window.location.assign(\"https://flowcorewater.com/contact-success\");},[props]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleRedirect,onTap:handleRedirect});});}export function withZapierWebhook(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const isSubmittingRef=useRef(false);const handleSubmit=useCallback(event=>{props.onSubmit?.(event);if(event?.defaultPrevented)return;if(isSubmittingRef.current)return;if(typeof window===\"undefined\")return;const form=event?.currentTarget;if(!form||typeof FormData===\"undefined\")return;isSubmittingRef.current=true;const formData=new FormData(form);const values={};formData.forEach((value,key)=>{if(key in values){const existing=values[key];values[key]=Array.isArray(existing)?[...existing,value]:[existing,value];}else{values[key]=value;}});const payload={...values,_meta:{pageUrl:window.location.href,submittedAt:new Date().toISOString(),userAgent:window.navigator.userAgent,referrer:document.referrer||\"\"}};fetch(\"https://hooks.zapier.com/hooks/catch/21990602/4dkjnme/\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify(payload),keepalive:true}).catch(()=>{// Silent failure by design.\n}).finally(()=>{window.setTimeout(()=>{isSubmittingRef.current=false;},1500);});},[props]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onSubmit:handleSubmit});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withCheckmarkCheckbox\":{\"type\":\"reactHoc\",\"name\":\"withCheckmarkCheckbox\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withZapierWebhook\":{\"type\":\"reactHoc\",\"name\":\"withZapierWebhook\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withContactSuccessRedirect\":{\"type\":\"reactHoc\",\"name\":\"withContactSuccessRedirect\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"6NAA8E,SAAgB,EAAY,EAAO,CACjH,IAAM,EAAU,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAG,CAAM,CAAC,CAAC,CAAC,EACjD,EAAa,GAAU,CAC1B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAU,KAAK,GAAG,EAAU,MAAM,OAAO,OAAO,CAAC,GAAG,EAAU,MAAM,GAAG,CAAQ,CAAC,CAAE,EACjI,EAAW,OAAO,GAAS,SAAS,OAAO,OAAO,CAAC,GAAG,CAAM,CAAC,EAAE,EAC7D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