{"version":3,"file":"StartDateCodeTiles.CTFFvFpc.mjs","names":["React.useMemo"],"sources":["https:/framerusercontent.com/modules/nP0npZTueLshaIvD1Bss/j5XXdFArnimdRaRe16QO/StartDateCodeTiles.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useLocaleInfo}from\"framer\";const translations={en:{openForEnrollment:\"Start Anytime\",startDate:\"Starts:\"},\"fr-CA\":{openForEnrollment:\"Commencez \\xe0 tout moment\",startDate:\"Date de d\\xe9but :\"}};export default function StartDateCodeTiles({startDate}){const localeInfo=useLocaleInfo();const activeLocale=localeInfo.activeLocale;const localeCode=activeLocale?.code||\"en\";const t=translations[localeCode]||translations.en;const parsedDate=React.useMemo(()=>{if(!startDate)return null;const date=new Date(startDate);return isNaN(date.getTime())?null:date;},[startDate]);const isPastOrToday=React.useMemo(()=>{if(!parsedDate)return false;const today=new Date;today.setHours(0,0,0,0);const eventDate=new Date(parsedDate);eventDate.setHours(0,0,0,0);return eventDate<=today;},[parsedDate]);const formattedDate=React.useMemo(()=>{if(!parsedDate)return null;const locale=localeCode.startsWith(\"fr\")?\"fr-FR\":\"en-US\";return parsedDate.toLocaleDateString(locale,{month:\"short\",day:\"numeric\",year:\"numeric\"});},[parsedDate,localeCode]);// If date is past/today or missing, show \"Open for enrollment\"\nif(isPastOrToday||!parsedDate){return /*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"DM Sans\",fontSize:20,textAlign:\"left\"},children:/*#__PURE__*/_jsx(\"p\",{style:{fontFamily:\"DM Sans, sans-serif\",fontSize:\"19px\",color:\"rgb(0, 0, 0)\",fontWeight:400,margin:0},children:t.openForEnrollment})});}// Show the actual upcoming date\nreturn /*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"Roboto\",fontSize:19,textAlign:\"left\"},children:/*#__PURE__*/_jsxs(\"p\",{style:{fontFamily:\"Roboto, sans-serif\",fontSize:\"19px\",color:\"rgb(0, 0, 0)\",fontWeight:400,margin:0},children:[t.startDate,\" \",formattedDate]})});}addPropertyControls(StartDateCodeTiles,{startDate:{type:ControlType.String,title:\"Enrollment\",description:\"YYYY-MM-DD format\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StartDateCodeTiles\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StartDateCodeTiles.map"],"mappings":"0LAA+T,SAAwB,EAAmB,CAAC,aAAW,CAA6E,IAAM,EAAjE,GAAe,CAA+B,cAA4C,MAAM,KAAW,EAAE,EAAa,IAAa,EAAa,GAAS,EAAWA,MAAkB,CAAC,GAAG,CAAC,EAAU,OAAO,KAAK,IAAM,EAAK,IAAI,KAAK,EAAU,CAAC,OAAO,MAAM,EAAK,SAAS,CAAC,CAAC,KAAK,GAAO,CAAC,EAAU,CAAC,CAAO,EAAcA,MAAkB,CAAC,GAAG,CAAC,EAAW,MAAO,GAAM,IAAM,EAAM,IAAI,KAAK,EAAM,SAAS,EAAE,EAAE,EAAE,EAAE,CAAC,IAAM,EAAU,IAAI,KAAK,EAAW,CAA6B,OAA5B,EAAU,SAAS,EAAE,EAAE,EAAE,EAAE,CAAQ,GAAW,GAAQ,CAAC,EAAW,CAAC,CAAO,EAAcA,MAAkB,CAAC,GAAG,CAAC,EAAW,OAAO,KAAK,IAAM,EAAO,EAAW,WAAW,KAAK,CAAC,QAAQ,QAAQ,OAAO,EAAW,mBAAmB,EAAO,CAAC,MAAM,QAAQ,IAAI,UAAU,KAAK,UAAU,CAAC,EAAG,CAAC,EAAW,EAAW,CAAC,CAE1nC,OADG,GAAe,CAAC,EAAgC,EAAK,MAAM,CAAC,MAAM,CAAC,WAAW,UAAU,SAAS,GAAG,UAAU,OAAO,CAAC,SAAsB,EAAK,IAAI,CAAC,MAAM,CAAC,WAAW,sBAAsB,SAAS,OAAO,MAAM,eAAe,WAAW,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