{
  "version": 3,
  "sources": ["ssg:https://framer.com/m/framer/store.js@^1.0.0", "ssg:https://framerusercontent.com/modules/tnfEyfQF9pBCo6EJyWQu/7OzY7r4Bxw9rKGaJVJPY/CycleVariant.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", "import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createStore } from \"https://framer.com/m/framer/store.js@^1.0.0\";\nimport { useEffect } from \"react\";\nimport { useCycle } from \"framer-motion\"; // Learn more: https://www.framer.com/docs/guides/overrides/\nconst useStore = createStore({\n  background: \"#eeeeee\",\n  selectedVariant: \"Data\",\n  autoSwitchVariant: true\n});\nexport function getVariant(Component) {\n  return props => {\n    const [store, setStore] = useStore();\n    const [cycle, setCycle] = useCycle(\"Data\", \"Design\");\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      variant: store.selectedVariant\n    });\n  };\n}\nexport function variantBackground(Component) {\n  return props => {\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      width: \"auto\",\n      style: {\n        backgroundColor: useStore.background\n      }\n    });\n  };\n}\nexport function setSelectedVariant(Component) {\n  return props => {\n    const [store, setStore] = useStore();\n    const [cycle, setCycle] = useCycle(\"Data\", \"Design\");\n    const autoToggle = () => {\n      window.setTimeout(() => {\n        if (store.selectedVariant == \"Data\") {\n          setStore({\n            selectedVariant: \"Design\"\n          });\n        } else {\n          setStore({\n            selectedVariant: \"Data\"\n          });\n        }\n        autoToggle();\n      }, 2e3);\n    };\n    const onToggle = () => {\n      setStore({\n        autoSwitchVariant: false\n      });\n      if (store.selectedVariant == \"Data\") {\n        setStore({\n          selectedVariant: \"Design\"\n        });\n      } else {\n        setStore({\n          selectedVariant: \"Data\"\n        });\n      }\n    };\n    useEffect(() => {\n      if (store.autoSwitchVariant == true) {\n        autoToggle();\n      }\n    }, []);\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      style: {\n        cursor: \"pointer\"\n      },\n      onClick: () => {\n        onToggle();\n        console.log(store.autoSwitchVariant);\n      }\n    });\n  };\n}\nexport function setVariantData(Component) {\n  return props => {\n    const [store, setStore] = useStore();\n    const [cycle, setCycle] = useCycle(\"Data\", \"Design\");\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      style: {\n        cursor: \"pointer\"\n      },\n      onClick: () => {\n        setStore({\n          selectedVariant: \"Data\",\n          background: \"#eeeeee\"\n        });\n      }\n    });\n  };\n}\nexport function setVariantDesign(Component) {\n  return props => {\n    const [store, setStore] = useStore();\n    const [cycle, setCycle] = useCycle(\"Data\", \"Design\");\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      style: {\n        cursor: \"pointer\"\n      },\n      onClick: () => {\n        setStore({\n          selectedVariant: \"Design\",\n          background: \"#F9C924\"\n        });\n      }\n    });\n  };\n}\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"setVariantDesign\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"setVariantDesign\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"setVariantData\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"setVariantData\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"getVariant\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"getVariant\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"variantBackground\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"variantBackground\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"setSelectedVariant\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"setSelectedVariant\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n};\n//# sourceMappingURL=./CycleVariant.map"],
  "mappings": "uJAAqF,SAASA,EAAYC,EAAO,CACjH,IAAMC,EAAUC,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAGF,CAAM,CAAC,CAAC,CAAC,EACjDG,EAAaC,GAAU,CAC1B,OAAOA,GAAW,aAAYA,EAASA,EAASH,EAAU,KAAK,GAAGA,EAAU,MAAM,OAAO,OAAO,CAAC,GAAGA,EAAU,MAAM,GAAGG,CAAQ,CAAC,CAAE,EACjIC,EAAW,OAAOL,GAAS,SAAS,OAAO,OAAO,CAAC,GAAGA,CAAM,CAAC,EAAEA,EAC7DM,EAAa,IAAI,IACjBC,EAAcH,GAAU,CAC3B,OAAOA,GAAW,aAAYA,EAASA,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L,EACA,OAAAQ,EAAU,IAAM,CACVT,EAAM,mBAAqB,IAC7BM,EAAW,CAEf,EAAG,CAAC,CAAC,EACeI,EAAKZ,EAAW,CAClC,GAAGC,EACH,MAAO,CACL,OAAQ,SACV,EACA,QAAS,IAAM,CACbS,EAAS,EACT,QAAQ,IAAIR,EAAM,iBAAiB,CACrC,CACF,CAAC,CACH,CACF,CACO,SAASW,EAAeb,EAAW,CACxC,OAAOC,GAAS,CACd,GAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAS,EAC7B,CAACC,EAAOC,CAAQ,EAAIC,EAAS,OAAQ,QAAQ,EACnD,OAAoBK,EAAKZ,EAAW,CAClC,GAAGC,EACH,MAAO,CACL,OAAQ,SACV,EACA,QAAS,IAAM,CACbE,EAAS,CACP,gBAAiB,OACjB,WAAY,SACd,CAAC,CACH,CACF,CAAC,CACH,CACF,CACO,SAASW,EAAiBd,EAAW,CAC1C,OAAOC,GAAS,CACd,GAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAS,EAC7B,CAACC,EAAOC,CAAQ,EAAIC,EAAS,OAAQ,QAAQ,EACnD,OAAoBK,EAAKZ,EAAW,CAClC,GAAGC,EACH,MAAO,CACL,OAAQ,SACV,EACA,QAAS,IAAM,CACbE,EAAS,CACP,gBAAiB,SACjB,WAAY,SACd,CAAC,CACH,CACF,CAAC,CACH,CACF",
  "names": ["createStore", "state1", "dataStore", "Data", "setDataStore", "newState", "storeState", "storeSetters", "setStoreState", "setter", "useStore", "state", "setState", "ye", "ue", "useObserveData", "useStore", "createStore", "getVariant", "Component", "props", "store", "setStore", "cycle", "setCycle", "useCycle", "p", "setSelectedVariant", "Component", "props", "store", "setStore", "useStore", "cycle", "setCycle", "useCycle", "autoToggle", "window", "onToggle", "ue", "p", "setVariantData", "setVariantDesign"]
}
