{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/2NIkYvfc9ZKixSA6a2LA/FtjXhhy9pIQxB1nucjiG/Clock_1.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{useEffect,useState}from\"react\";const useStore=createStore({weather:{temp:19,weathercode:0}});function weatherIcon(code){const weatherCodes={\"0\":\"Clear\",\"1\":\"Clear\",\"2\":\"Cloudy\",\"3\":\"Cloudy\",\"45\":\"Drizzle\",\"48\":\"Drizzle\",\"51\":\"Drizzle\",\"53\":\"Drizzle\",\"55\":\"Drizzle\",\"56\":\"Drizzle\",\"57\":\"Drizzle\",\"61\":\"Rain\",\"63\":\"Rain\",\"65\":\"Rain\",\"66\":\"Rain\",\"67\":\"Rain\",\"71\":\"Snow\",\"73\":\"Snow\",\"75\":\"Snow\",\"77\":\"Snow\",\"80\":\"Rain\",\"81\":\"Rain\",\"82\":\"Rain\",\"85\":\"Snow\",\"86\":\"Snow\",\"95\":\"Thunderstorms\",\"96\":\"Thunderstorms\",\"99\":\"Thunderstorms\"};return weatherCodes[code];}export function withClock(Component){return props=>{const[time,setTime]=useState(new Date);useEffect(()=>{const interval=setInterval(()=>{setTime(new Date);},1e3);return()=>{clearInterval(interval);};},[]);return /*#__PURE__*/_jsx(Component,{...props,text:time.toLocaleString(\"en-US\",{timeZone:\"America/Los_Angeles\",hour:\"2-digit\",minute:\"2-digit\",second:\"2-digit\"})});};}export function withWeather(Component){return props=>{// const [weather, setWeather] = useState({ temp: 19, weathercode: 0 })\nconst[store,setStore]=useStore();useEffect(()=>{const fetchData=async()=>{try{const response=await fetch(\"https://api.open-meteo.com/v1/forecast?latitude=52.374&longitude=4.8897&daily=weathercode,temperature_2m_max&timezone=GMT&forecast_days=1&models=best_match\");const json=await response.json();setStore({weather:{temp:json.daily.temperature_2m_max,weathercode:json.daily.weathercode}});}catch(error){console.error(\"error fetching data\",error);}};fetchData();},[]);return /*#__PURE__*/_jsx(Component,{...props,temp:store.weather.temp.toString(),icon:weatherIcon(store.weather.weathercode)});};}export function withWeatherIcon(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,variant:weatherIcon(store.weather.weathercode)});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withWeather\":{\"type\":\"reactHoc\",\"name\":\"withWeather\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withClock\":{\"type\":\"reactHoc\",\"name\":\"withClock\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withWeatherIcon\":{\"type\":\"reactHoc\",\"name\":\"withWeatherIcon\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Clock_1.map"],
  "mappings": "gGAAsJ,IAAMA,EAASC,EAAY,CAAC,QAAQ,CAAC,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,EAAsd,SAASC,EAAUC,EAAU,CAAC,OAAOC,GAAO,CAAC,GAAK,CAACC,EAAKC,CAAO,EAAEC,EAAS,IAAI,IAAI,EAAE,OAAAC,EAAU,IAAI,CAAC,IAAMC,EAAS,YAAY,IAAI,CAACH,EAAQ,IAAI,IAAI,CAAE,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC,cAAcG,CAAQ,CAAE,CAAE,EAAE,CAAC,CAAC,EAAsBC,EAAKP,EAAU,CAAC,GAAGC,EAAM,KAAKC,EAAK,eAAe,QAAQ,CAAC,SAAS,sBAAsB,KAAK,UAAU,OAAO,UAAU,OAAO,SAAS,CAAC,CAAC,CAAC,CAAE,CAAE",
  "names": ["useStore", "createStore", "withClock", "Component", "props", "time", "setTime", "ye", "ue", "interval", "p"]
}
