{"version":3,"file":"RelativeToday.7sIGShHY.mjs","names":["useState","__esmMin","init_npm_react_18_3_1","window","init_ssg_sandbox_shims","ce","init_jsx_runtime","c","_e","getInclusiveToday","inclusiveToday","useIsCzechPath","isCzech","setIsCzech","updateLocale","useViewportWidth","viewportWidth","setViewportWidth","updateWidth","withBlogListLocale","variant","props","Component","withCategoryBlogLocale","init_RelativeToday"],"sources":["https:/framerusercontent.com/modules/9U0sLxPVu0tu6AP7Cr2Q/f6NcbgtOwqNHdmkLFI7p/RelativeToday.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";function getInclusiveToday(){const inclusiveToday=new Date;inclusiveToday.setUTCDate(inclusiveToday.getUTCDate()+1);return inclusiveToday.toISOString().split(\"T\")[0];}function useIsCzechPath(){const[isCzech,setIsCzech]=useState(false);useEffect(()=>{const updateLocale=()=>{setIsCzech(/^\\/cz(?:\\/|$)/i.test(window.location.pathname));};updateLocale();window.addEventListener(\"popstate\",updateLocale);return()=>window.removeEventListener(\"popstate\",updateLocale);},[]);return isCzech;}function useViewportWidth(){const[viewportWidth,setViewportWidth]=useState(null);useEffect(()=>{const updateWidth=()=>setViewportWidth(window.innerWidth);updateWidth();window.addEventListener(\"resize\",updateWidth);return()=>window.removeEventListener(\"resize\",updateWidth);},[]);return viewportWidth;}export function withTodaysDate(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,today:getInclusiveToday()});};}export function withBlogListLocale(Component){return props=>{const isCzech=useIsCzechPath();const viewportWidth=useViewportWidth();let variant=props.variant;if(isCzech&&viewportWidth!==null){variant=viewportWidth<810?\"Mobile All\":viewportWidth<1200?\"Tablet All\":\"Blog List All\";}return /*#__PURE__*/_jsx(Component,{...props,today:getInclusiveToday(),variant:variant});};}export function withCategoryBlogLocale(Component){return props=>{const isCzech=useIsCzechPath();return /*#__PURE__*/_jsx(Component,{...props,today:getInclusiveToday(),variant:isCzech?\"CategoryBlogList All\":props.variant});};}export function withFeaturedBlogLocale(Component){return props=>{const isCzech=useIsCzechPath();const viewportWidth=useViewportWidth();let variant=props.variant;if(isCzech&&viewportWidth!==null){variant=viewportWidth<810?\"Phone All\":viewportWidth<1200?\"Tablet All\":\"Desktop All\";}return /*#__PURE__*/_jsx(Component,{...props,today:getInclusiveToday(),variant:variant});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withBlogListLocale\":{\"type\":\"reactHoc\",\"name\":\"withBlogListLocale\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTodaysDate\":{\"type\":\"reactHoc\",\"name\":\"withTodaysDate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFeaturedBlogLocale\":{\"type\":\"reactHoc\",\"name\":\"withFeaturedBlogLocale\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCategoryBlogLocale\":{\"type\":\"reactHoc\",\"name\":\"withCategoryBlogLocale\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RelativeToday.map"],"mappings":"A,uIAAiF,SAASS,GAAmB,CAAC,IAAMC,kBAAe,IAAI,KAA8D,OAAzDA,EAAe,WAAWA,EAAe,WAAW,EAAE,CAAC,EAASA,EAAe,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,EAAG,CAAC,SAASC,GAAgB,CAAC,GAAK,CAACC,EAAQC,GAAYb,EAAS,EAAK,EAA2O,OAAzOK,MAAc,CAAC,IAAMS,MAAiB,CAACD,EAAW,iBAAiB,KAAKV,EAAO,SAAS,QAAQ,CAAC,CAAE,EAAkE,OAAhEW,EAAa,EAAEX,EAAO,iBAAiB,WAAWW,CAAY,MAAYX,EAAO,oBAAoB,WAAWW,CAAY,CAAE,EAAE,CAAC,CAAC,EAASF,CAAQ,CAAC,SAASG,GAAkB,CAAC,GAAK,CAACC,EAAcC,GAAkBjB,EAAS,IAAI,EAAwM,OAAtMK,MAAc,CAAC,IAAMa,MAAgBD,EAAiBd,EAAO,UAA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