{"version":3,"file":"goMvDdupy.NzLEpl0m.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/BIHaw55VACfRKwSgwtj7/PgDq0ODqIZnpmSpQHs8h/Clock.js","https:/framerusercontent.com/modules/N3yA5NOeCBUQNC0dOZL2/Y8Swssvbr3hgaIgmjxZG/goMvDdupy.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth 100%\n * @framerSupportedLayoutHeight 100%\n */export default function Clock({timezone,is24HourFormat,showSeconds,showDate,dateFormat,datePosition,monthFormat,prefixOrSuffix,text,fontOptions,style}){const[dateTime,setDateTime]=useState(\"\");const[isValidTimezone,setIsValidTimezone]=useState(true);useEffect(()=>{const formatDate=date=>{const dayOption=dateFormat.includes(\"D\")?\"2-digit\":undefined;const monthOption=dateFormat.includes(\"M\")?monthFormat===\"number\"?\"2-digit\":\"long\":undefined;const yearOption=dateFormat.includes(\"Y\")?\"numeric\":undefined;const options={year:yearOption,month:monthOption,day:dayOption};return new Intl.DateTimeFormat(\"en-US\",options).format(date);};const updateTime=()=>{try{const now=new Date;const timeOptions={hour:\"2-digit\",minute:\"2-digit\",second:showSeconds?\"2-digit\":undefined,timeZone:timezone,hour12:!is24HourFormat};const timeFormatter=new Intl.DateTimeFormat(\"en-US\",timeOptions);const formattedTime=timeFormatter.format(now);const formattedDate=showDate?formatDate(now):\"\";const separator=showDate?\" - \":\"\";let combinedDateTime=\"\";if(datePosition===\"prefix\"){combinedDateTime=`${formattedDate}${separator}${formattedTime}`;}else{combinedDateTime=`${formattedTime}${separator}${formattedDate}`;}setDateTime(prefixOrSuffix===\"prefix\"?`${text}${combinedDateTime}`:`${combinedDateTime}${text}`);setIsValidTimezone(true);}catch(error){console.error(\"Error with timezone: \",error);setIsValidTimezone(false);}};updateTime();const interval=setInterval(updateTime,1e3);return()=>clearInterval(interval);},[timezone,is24HourFormat,showSeconds,showDate,dateFormat,datePosition,monthFormat,prefixOrSuffix,text]);const combinedStyle={...style,...fontOptions,margin:0,padding:0,height:\"auto\",width:\"auto\"};return /*#__PURE__*/_jsx(\"div\",{style:combinedStyle,children:/*#__PURE__*/_jsx(\"p\",{style:{margin:0},children:isValidTimezone?dateTime:\"Please use a timezone identifier. You can find a full list on wikipedia.\"})});}Clock.defaultProps={timezone:\"America/New_York\",is24HourFormat:true,showSeconds:false,showDate:false,dateFormat:\"DMY\",datePosition:\"prefix\",monthFormat:\"number\",prefixOrSuffix:\"suffix\",text:\"\",fontOptions:{fontFamily:\"Arial\",fontSize:16,letterSpacing:0,fontWeight:\"normal\",color:\"#999999\",lineHeight:1.5,textAlign:\"center\"},style:{}};addPropertyControls(Clock,{timezone:{type:ControlType.String,title:\"Timezone\",defaultValue:\"America/New_York\",description:\"Use a timezone identifier ie: 'America/Los_Angeles'\"},is24HourFormat:{type:ControlType.Boolean,title:\"24h Format\",defaultValue:true,enabledTitle:\"24h\",disabledTitle:\"12h\"},showSeconds:{type:ControlType.Boolean,title:\"Show Seconds\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},showDate:{type:ControlType.Boolean,title:\"Show Date\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},dateFormat:{type:ControlType.Enum,title:\"Date Format\",options:[\"D\",\"M\",\"DM\",\"DMY\"],optionTitles:[\"Only Day\",\"Only Month\",\"Day and Month\",\"Day, Month and Year\"],defaultValue:\"DMY\",hidden:({showDate})=>!showDate},datePosition:{type:ControlType.SegmentedEnum,title:\"Date Position\",options:[\"prefix\",\"suffix\"],optionTitles:[\"Prefix\",\"Suffix\"],defaultValue:\"prefix\",hidden:({showDate})=>!showDate},monthFormat:{type:ControlType.SegmentedEnum,title:\"Month Format\",options:[\"number\",\"text\"],optionTitles:[\"Number\",\"Text\"],defaultValue:\"number\",hidden:({showDate})=>!showDate},prefixOrSuffix:{type:ControlType.SegmentedEnum,title:\"Prefix/Suffix\",options:[\"prefix\",\"suffix\"],optionTitles:[\"Prefix\",\"Suffix\"],defaultValue:\"suffix\"},text:{type:ControlType.String,title:\"Text\",defaultValue:\"\"},fontOptions:{type:ControlType.Object,title:\"Font Options\",controls:{fontFamily:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Arial\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:16,min:8,max:100,step:1},letterSpacing:{type:ControlType.Number,title:\"Letter Spacing\",defaultValue:0,min:-5,max:20,step:.1},fontWeight:{type:ControlType.Enum,title:\"Font Weight\",options:[\"100\",\"200\",\"300\",\"400\",\"500\",\"600\",\"700\",\"800\",\"900\"],defaultValue:\"400\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},lineHeight:{type:ControlType.Number,title:\"Line Height\",defaultValue:1.5,min:.5,max:3,step:.1},textAlign:{type:ControlType.Enum,title:\"Text Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\"}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Clock\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"100%\",\"framerDisableUnlink\":\"*\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"100%\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Clock.map","// Generated by Framer (c56cc2c)\nimport{fontStore}from\"framer\";fontStore.loadFonts([]);export const fonts=[{explicitInter:true,fonts:[]}];export const css=[\".framer-zf1La .framer-styles-preset-ipgxz9:not(.rich-text-wrapper), .framer-zf1La .framer-styles-preset-ipgxz9.rich-text-wrapper a { --framer-link-current-text-color: var(--token-9f46d213-188c-4315-b063-b1121aa89db5, #1a1d23); --framer-link-current-text-decoration: none; --framer-link-hover-text-color: var(--token-3ec36f42-1fb6-4b9c-92e3-3656b7b3c172, rgba(26, 29, 35, 0.5)); --framer-link-hover-text-decoration: none; --framer-link-text-color: var(--token-9f46d213-188c-4315-b063-b1121aa89db5, #1a1d23); --framer-link-text-decoration: none; }\"];export const className=\"framer-zf1La\";\nexport const __FramerMetadata__ = {\"exports\":{\"fonts\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"css\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"className\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"yRAMG,SAAwB,EAAM,CAAC,WAAS,iBAAe,cAAY,WAAS,aAAW,eAAa,cAAY,iBAAe,OAAK,cAAY,QAAM,CAAC,CAAC,GAAK,CAAC,EAAS,EAAY,CAACA,EAAS,IAAS,CAAC,EAAgB,EAAmB,CAACA,EAAS,IAAM,MAAc,CAAC,IAAM,EAAW,GAAM,CAAC,IAAM,EAAU,EAAW,SAAS,KAAK,UAAU,IAAA,GAAgB,EAAY,EAAW,SAAS,KAAK,IAAc,SAAS,UAAU,OAAO,IAAA,GAAgB,EAAW,EAAW,SAAS,KAAK,UAAU,IAAA,GAAgB,EAAQ,CAAC,KAAK,EAAW,MAAM,EAAY,IAAI,EAAU,CAAC,OAAO,IAAI,KAAK,eAAe,QAAQ,GAAS,OAAO,EAAO,EAAO,MAAe,CAAC,GAAG,CAAC,IAAM,EAAI,IAAI,KAAW,EAAY,CAAC,KAAK,UAAU,OAAO,UAAU,OAAO,EAAY,UAAU,IAAA,GAAU,SAAS,EAAS,OAAO,CAAC,EAAe,CAAO,EAAc,IAAI,KAAK,eAAe,QAAQ,GAAmB,EAAc,EAAc,OAAO,GAAW,EAAc,EAAS,EAAW,GAAK,GAAS,EAAU,EAAS,MAAM,GAAO,EAAiB,GAAG,AAAkG,EAA/F,IAAe,SAA2B,GAAG,IAAgB,IAAY,IAAuC,GAAG,IAAgB,IAAY,IAAiB,EAAY,IAAiB,SAAS,GAAG,IAAO,IAAmB,GAAG,IAA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