{"version":3,"file":"Clock.dBAigaIR.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/BIHaw55VACfRKwSgwtj7/G7JGvVhzHUbk6jZsTk1B/Clock.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Component made by Eleveight Supply, All rights reserved.\n/**\n\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth 100%\n * @framerSupportedLayoutHeight 100%\n */export default function Clock({timezone,is24HourFormat,showSeconds,font,fontSize,textColor,dateSettings:{showDate,dateFormat,datePosition,monthFormat},prefixSuffixSettings:{usePrefixSuffix,text:psText}}){const[currentDateTime,setCurrentDateTime]=useState(\"\");const[isValidTimezone,setIsValidTimezone]=useState(true);useEffect(()=>{function updateDateTime(){try{const now=new Date;const timeOptions={hour:\"2-digit\",minute:\"2-digit\",second:showSeconds?\"2-digit\":undefined,timeZone:timezone,hour12:!is24HourFormat};const dateOptions={year:dateFormat.includes(\"Y\")?\"numeric\":undefined,month:dateFormat.includes(\"M\")?monthFormat===\"text\"?\"long\":\"2-digit\":undefined,day:dateFormat.includes(\"D\")?\"2-digit\":undefined};const timeFormatter=new Intl.DateTimeFormat(\"en-US\",timeOptions);const dateFormatter=new Intl.DateTimeFormat(\"en-US\",dateOptions);const timeString=timeFormatter.format(now);const dateString=showDate?dateFormatter.format(now):\"\";let combinedString=dateString?`${dateString} - ${timeString}`:timeString;if(usePrefixSuffix===\"prefix\"&&psText){combinedString=`${psText} ${combinedString}`;}else if(usePrefixSuffix===\"suffix\"&&psText){combinedString=`${combinedString} ${psText}`;}setCurrentDateTime(combinedString);setIsValidTimezone(true);}catch(error){console.error(\"Error with timezone: \",error);setIsValidTimezone(false);}}updateDateTime();const intervalId=setInterval(updateDateTime,1e3);return()=>clearInterval(intervalId);},[timezone,is24HourFormat,showSeconds,showDate,dateFormat,datePosition,monthFormat,textColor,font,fontSize,usePrefixSuffix,psText]);const dynamicStyle={fontSize:`${fontSize}px`,fontFeatureSettings:\"'tnum'\",fontVariantNumeric:\"lining-nums\",color:textColor,...font};return /*#__PURE__*/_jsx(\"div\",{style:dynamicStyle,children:currentDateTime});}Clock.defaultProps={timezone:\"America/New_York\",is24HourFormat:true,showSeconds:false,dateSettings:{showDate:false,dateFormat:\"DMY\",datePosition:\"prefix\",monthFormat:\"number\"},prefixSuffixSettings:{usePrefixSuffix:\"none\",text:\"\",fontSize:16},textColor:\"#999999\",fontSize:24};addPropertyControls(Clock,{timezone:{type:ControlType.String,title:\"Timezone\",defaultValue:\"America/New_York\",description:\"Use a timezone identifier ie: 'America/Los_Angeles' [Full list here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:\"Inter\",controls:\"extended\"},textColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#999999\"},is24HourFormat:{type:ControlType.Boolean,title:\"Format\",defaultValue:true,enabledTitle:\"24h\",disabledTitle:\"12h\"},showSeconds:{type:ControlType.Boolean,title:\"Seconds\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},prefixSuffixSettings:{type:ControlType.Object,title:\"Prefix/Suffix\",controls:{usePrefixSuffix:{type:ControlType.SegmentedEnum,title:\"Use\",options:[\"none\",\"prefix\",\"suffix\"],optionTitles:[\"None\",\"Pref.\",\"Suff.\"],defaultValue:\"none\"},text:{type:ControlType.String,title:\"Text\",defaultValue:\"\",description:\"include your divider directly here, ie: - , :\"}}},dateSettings:{type:ControlType.Object,title:\"Date\",controls:{showDate:{type:ControlType.Boolean,title:\"Show Date\"},dateFormat:{type:ControlType.Enum,title:\"Format\",options:[\"D\",\"M\",\"DM\",\"DMY\"],optionTitles:[\"Only Day\",\"Only Month\",\"Day and Month\",\"Day, Month and Year\"]},datePosition:{type:ControlType.SegmentedEnum,title:\"Position\",options:[\"prefix\",\"suffix\"],optionTitles:[\"Front\",\"End\"]},monthFormat:{type:ControlType.SegmentedEnum,title:\"Month Format\",options:[\"number\",\"text\"],optionTitles:[\"Numeric\",\"Text\"]}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Clock\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"100%\",\"framerDisableUnlink\":\"*\",\"framerSupportedLayoutHeight\":\"100%\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Clock.map"],"mappings":"0QAOG,SAAwB,EAAM,CAAC,WAAS,iBAAe,cAAY,OAAK,WAAS,YAAU,aAAa,CAAC,WAAS,aAAW,eAAa,cAAY,CAAC,qBAAqB,CAAC,kBAAgB,KAAK,EAAO,CAAC,CAAC,CAAC,GAAK,CAAC,EAAgB,EAAmB,CAACA,EAAS,IAAS,CAAC,EAAgB,EAAmB,CAACA,EAAS,IAAM,MAAc,CAAC,SAAS,GAAgB,CAAC,GAAG,CAAC,IAAM,EAAI,IAAI,KAAW,EAAY,CAAC,KAAK,UAAU,OAAO,UAAU,OAAO,EAAY,UAAU,IAAA,GAAU,SAAS,EAAS,OAAO,CAAC,EAAe,CAAO,EAAY,CAAC,KAAK,EAAW,SAAS,KAAK,UAAU,IAAA,GAAU,MAAM,EAAW,SAAS,KAAK,IAAc,OAAO,OAAO,UAAU,IAAA,GAAU,IAAI,EAAW,SAAS,KAAK,UAAU,IAAA,GAAU,CAAO,EAAc,IAAI,KAAK,eAAe,QAAQ,GAAmB,EAAc,IAAI,KAAK,eAAe,QAAQ,GAAmB,EAAW,EAAc,OAAO,GAAW,EAAW,EAAS,EAAc,OAAO,GAAK,GAAO,EAAe,EAAW,GAAG,EAAW,KAAK,IAAa,EAAc,IAAkB,UAAU,EAAQ,EAAe,GAAG,EAAO,GAAG,IAA0B,IAAkB,UAAU,IAAQ,EAAe,GAAG,EAAe,GAAG,KAAU,EAAmB,GAAgB,EAAmB,GAAO,OAAM,EAAM,CAAC,QAAQ,MAAM,wBAAwB,G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