{"version":3,"file":"Colour_Cycle_Change.BmL6SeMa.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/0d8Fy3eyt5ndnU26YV9g/PW9NyOaBgxNhrqDHs0Tn/Colour_Cycle_Change.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";const COLOURS=[\"#E3EA53\",\"#DACAED\",\"#BCE2DB\",\"#C8DDAC\"];const STORAGE_KEY=\"bg_colour_index\";function getNextIndex(currentIndex){const otherIndices=COLOURS.map((_,i)=>i).filter(i=>i!==currentIndex);return otherIndices[Math.floor(Math.random()*otherIndices.length)];}function resolveColour(){try{const stored=localStorage.getItem(STORAGE_KEY);const currentIndex=stored!==null?parseInt(stored,10):-1;const nextIndex=getNextIndex(currentIndex);localStorage.setItem(STORAGE_KEY,String(nextIndex));return COLOURS[nextIndex];}catch{// localStorage unavailable — fall back to random\nreturn COLOURS[Math.floor(Math.random()*COLOURS.length)];}}export function cyclingBackground(Component){return props=>{const[bgColour,setBgColour]=useState(\"\");useEffect(()=>{// Runs only in the browser, never during SSR/pre-render\nsetBgColour(resolveColour());},[]);return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,backgroundColor:bgColour||undefined}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"cyclingBackground\":{\"type\":\"reactHoc\",\"name\":\"cyclingBackground\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Colour_Cycle_Change.map"],"mappings":"yHAA6K,SAAS,EAAa,EAAa,CAAC,IAAM,EAAa,EAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,CAAY,EAAE,OAAO,EAAa,KAAK,MAAM,KAAK,OAAO,EAAE,EAAa,MAAM,EAAG,CAAC,SAAS,GAAe,CAAC,GAAG,CAAC,IAAM,EAAO,aAAa,QAAQ,CAAW,EAAgE,EAAU,EAArD,IAAS,KAAyB,GAApB,SAAS,EAAO,EAAE,CAA8C,EAAsD,OAApD,aAAa,QAAQ,EAAY,OAAO,CAAS,CAAC,EAAS,EAAQ,EAAW,MAAM,CAC7lB,OAAO,EAAQ,KAAK,MAAM,KAAK,OAAO,EAAE,EAAQ,MAAM,EAAG,CAAC,CAAC,SAAgB,EAAkB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAS,EAAE,EAC3H,OAD6H,MAAc,CAC9K,EAAY,EAAc,CAAC,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAM,MAAM,CAAC,GAAG,EAAM,MAAM,gBAAgB,GAAU,IAAA,EAAS,CAAC,CAAC,CAAE,CAAE,qBAFrG,IAAsC,EAAO,EAAQ,CAAC,UAAU,UAAU,UAAU,SAAS,EAAQ,EAAY"}