{"version":3,"file":"CurrentTime.DGDTr3Im.mjs","names":["useState","__esmMin","init_npm_react_18_3_1","te","init_jsx_runtime","ce","_e","withDynamicDateTime","formattedDate","setFormattedDate","updateDateTime","now","hours","minutes","ampm","strHours","day","shortMonth","capitalizedMonth","intervalId","Component","props","withTimeOnly","formattedTime","setFormattedTime","updateTime","init_CurrentTime"],"sources":["https:/framerusercontent.com/modules/sdQb5vHAZHrBY81US2eY/2mTyVHhPOaqUXGeYNPID/CurrentTime.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";/**\n * 1. COMPACT DATE & TIME (Original)\n * Output: \"08:00 AM, 5 Abr.\"\n */export function withDynamicDateTime(Component){return props=>{const[formattedDate,setFormattedDate]=useState(\"\");useEffect(()=>{const updateDateTime=()=>{const now=new Date;let hours=now.getHours();const minutes=now.getMinutes().toString().padStart(2,\"0\");const ampm=hours>=12?\"PM\":\"AM\";hours=hours%12;hours=hours?hours:12;const strHours=hours.toString().padStart(2,\"0\");const day=now.getDate();const currentMonthStr=now.toLocaleDateString(\"es-ES\",{month:\"long\"});const shortMonth=currentMonthStr.substring(0,3);const capitalizedMonth=shortMonth.charAt(0).toUpperCase()+shortMonth.slice(1)+\".\";startTransition(()=>{setFormattedDate(`${strHours}:${minutes} ${ampm}, ${day} ${capitalizedMonth}`);});};updateDateTime();const intervalId=setInterval(updateDateTime,6e4);return()=>clearInterval(intervalId);},[]);return /*#__PURE__*/_jsx(Component,{...props,text:formattedDate||props.text});};}/**\n * 2. TIME ONLY\n * Output: \"08:00 AM\"\n * Ideal for top navigation bars or status indicators.\n */export function withTimeOnly(Component){return props=>{const[formattedTime,setFormattedTime]=useState(\"\");useEffect(()=>{const updateTime=()=>{const now=new Date;let hours=now.getHours();const minutes=now.getMinutes().toString().padStart(2,\"0\");const ampm=hours>=12?\"PM\":\"AM\";hours=hours%12;hours=hours?hours:12;const strHours=hours.toString().padStart(2,\"0\");startTransition(()=>{setFormattedTime(`${strHours}:${minutes} ${ampm}`);});};updateTime();const intervalId=setInterval(updateTime,6e4);return()=>clearInterval(intervalId);},[]);return /*#__PURE__*/_jsx(Component,{...props,text:formattedTime||props.text});};}/**\n * 3. DASHBOARD HEADER (Full Formal Date)\n * Output: \"Lunes, 5 de Abril\"\n * Perfect for the main welcome header of an HR or user portal.\n */export function withDashboardDate(Component){return props=>{const[formattedDate,setFormattedDate]=useState(\"\");useEffect(()=>{const updateDate=()=>{const now=new Date;const options={weekday:\"long\",day:\"numeric\",month:\"long\"};let dateString=now.toLocaleDateString(\"es-ES\",options);// Capitalize the first letter for a cleaner UI look\ndateString=dateString.charAt(0).toUpperCase()+dateString.slice(1);startTransition(()=>{setFormattedDate(dateString);});};updateDate();// Only needs to update every hour to check for midnight crossovers safely\nconst intervalId=setInterval(updateDate,36e5);return()=>clearInterval(intervalId);},[]);return /*#__PURE__*/_jsx(Component,{...props,text:formattedDate||props.text});};}/**\n * 4. COMPACT NUMERIC (Data Tables / Logs)\n * Output: \"05/04/2026\"\n * Excellent for payroll tables, transaction histories, or tight UI layouts.\n */export function withNumericDate(Component){return props=>{const[formattedDate,setFormattedDate]=useState(\"\");useEffect(()=>{const updateDate=()=>{const now=new Date;const day=now.getDate().toString().padStart(2,\"0\");const month=(now.getMonth()+1).toString().padStart(2,\"0\");const year=now.getFullYear();startTransition(()=>{setFormattedDate(`${day}/${month}/${year}`);});};updateDate();const intervalId=setInterval(updateDate,36e5);return()=>clearInterval(intervalId);},[]);return /*#__PURE__*/_jsx(Component,{...props,text:formattedDate||props.text});};}/**\n * 5. DYNAMIC SAAS GREETING\n * Output: \"Buenos días\" | \"Buenas tardes\" | \"Buenas noches\"\n * Changes based on the user's local time.\n */export function withDynamicGreeting(Component){return props=>{const[greeting,setGreeting]=useState(\"\");useEffect(()=>{const updateGreeting=()=>{const hour=new Date().getHours();let currentGreeting=\"Hola\";if(hour>=5&&hour<12){currentGreeting=\"Buenos d\\xedas\";}else if(hour>=12&&hour<19){currentGreeting=\"Buenas tardes\";}else{currentGreeting=\"Buenas noches\";}startTransition(()=>{setGreeting(currentGreeting);});};updateGreeting();const intervalId=setInterval(updateGreeting,6e4);return()=>clearInterval(intervalId);},[]);return /*#__PURE__*/_jsx(Component,{...props,text:greeting||props.text});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withNumericDate\":{\"type\":\"reactHoc\",\"name\":\"withNumericDate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDynamicDateTime\":{\"type\":\"reactHoc\",\"name\":\"withDynamicDateTime\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDynamicGreeting\":{\"type\":\"reactHoc\",\"name\":\"withDynamicGreeting\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTimeOnly\":{\"type\":\"reactHoc\",\"name\":\"withTimeOnly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDashboardDate\":{\"type\":\"reactHoc\",\"name\":\"withDashboardDate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CurrentTime.map"],"mappings":"A,gIAGG,SAAgBO,EAAoB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAACC,EAAcC,GAAkBT,EAAS,EAAE,EAAwrB,OAAtrBK,MAAc,CAAC,IAAMK,MAAmB,CAAC,IAAMC,kBAAI,IAAI,KAASC,EAAMD,EAAI,SAAS,EAAQE,EAAQF,EAAI,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,EAAQG,EAAKF,GAAO,GAAG,KAAK,KAAK,GAAY,GAAG,IAAkB,GAAG,IAAMG,EAASH,EAAM,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,EAAQI,EAAIL,EAAI,QAAQ,EAA6EM,EAArDN,EAAI,mBAAmB,QAAQ,CAAC,MAAM,MAAM,CAAkC,CAAC,CAAC,UAAU,EAAE,CAAC,EAAQO,EAAiBD,EAAW,OAAO,CAAC,CA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