{"version":3,"file":"LocalTime.CyjN5P3e.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/UVWQuXe6sqxLUv9y00A2/9TQMwwKNdnjo56JgHmIZ/LocalTime.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const FONT='\"Inter\", \"Inter Placeholder\", -apple-system, BlinkMacSystemFont, sans-serif';function read(timeZone){try{return new Intl.DateTimeFormat(\"en-GB\",{hour:\"2-digit\",minute:\"2-digit\",hour12:false,timeZone}).format(new Date);}catch{return\"\";}}export default function LocalTime({timeZone,suffix,size,weight,ink,style}){const[now,setNow]=useState(null);useEffect(()=>{let timer=0;const tick=()=>{setNow(read(timeZone));// land on the next minute, not 60s from whenever this mounted\nconst ms=6e4-Date.now()%6e4+50;timer=window.setTimeout(tick,ms);};tick();return()=>window.clearTimeout(timer);},[timeZone]);return /*#__PURE__*/_jsxs(\"span\",{style:{...style,font:`${weight} ${size}px/1.4 ${FONT}`,color:ink,fontVariantNumeric:\"tabular-nums\",whiteSpace:\"nowrap\"},suppressHydrationWarning:true,children:[now??read(timeZone),suffix?/*#__PURE__*/_jsx(\"span\",{style:{opacity:.55,marginLeft:8,fontSize:size*.82},children:suffix}):null]});}LocalTime.defaultProps={timeZone:\"Atlantic/Azores\",suffix:\"AZOST\",size:15,weight:500,ink:\"rgb(17, 17, 17)\"};addPropertyControls(LocalTime,{timeZone:{type:ControlType.String,title:\"Zone\",defaultValue:\"Atlantic/Azores\",description:\"An IANA name, e.g. Atlantic/Azores\"},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"AZOST\"},size:{type:ControlType.Number,title:\"Size\",min:10,max:40,step:1,defaultValue:15},weight:{type:ControlType.Number,title:\"Weight\",min:300,max:800,step:100,defaultValue:500},ink:{type:ControlType.Color,title:\"Ink\",defaultValue:\"rgb(17, 17, 17)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\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