{"version":3,"file":"WithTodayQueryParam.Co4mjuEs.mjs","names":["WrappedComponent","__esmMin","window","init_ssg_sandbox_shims","init_npm_react_18_3_1","c","J","init_jsx_runtime","ce","init_framer_BWFVvmND","useIsStaticRenderer","getLocalTodayISODate","now","withTodayQueryParam","isStaticRenderer","today","currentURL","url","nextURL","Component","props","init_WithTodayQueryParam"],"sources":["https:/framerusercontent.com/modules/upZ5P4k1LJPGO8urSef2/SsUqtwp1N2rDliIDD0dL/WithTodayQueryParam.js"],"sourcesContent":["// Requested behavior:\n// Keep this as a Framer code override that updates the `today` query param on client usage.\n// It must use the visitor's local date in YYYY-MM-DD, preserve path/hash/other params,\n// skip static renderers, and avoid redirect loops by doing nothing when already correct.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,forwardRef}from\"react\";import{useIsStaticRenderer}from\"framer\";function getLocalTodayISODate(){const now=new Date;const year=now.getFullYear();const month=String(now.getMonth()+1).padStart(2,\"0\");const day=String(now.getDate()).padStart(2,\"0\");return`${year}-${month}-${day}`;}export function withTodayQueryParam(Component){return /*#__PURE__*/forwardRef(function WithTodayQueryParam(props,ref){const isStaticRenderer=useIsStaticRenderer();useEffect(()=>{if(isStaticRenderer)return;if(typeof window===\"undefined\")return;const today=getLocalTodayISODate();try{const currentURL=window.location.href;const url=new URL(currentURL);const currentToday=url.searchParams.get(\"today\");if(currentToday===today)return;url.searchParams.set(\"today\",today);const nextURL=url.toString();if(nextURL===currentURL)return;window.location.replace(nextURL);}catch{// No-op: if URL parsing fails unexpectedly, keep rendering without redirecting.\n}},[isStaticRenderer]);const WrappedComponent=Component;return /*#__PURE__*/_jsx(WrappedComponent,{ref:ref,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withTodayQueryParam\":{\"type\":\"reactHoc\",\"name\":\"withTodayQueryParam\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithTodayQueryParam.map"],"mappings":"A,yLAI2H,SAASW,GAAsB,CAAC,IAAMC,kBAAI,IAAI,KAAuI,MAAM,GAA7HA,EAAI,YAA+H,EAAE,GAAvG,OAAOA,EAAI,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,GAA0E,EAAE,GAA7D,OAAOA,EAAI,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,GAAiC,GAAI,CAAC,SAAgBC,EAAoB,EAAU,CAAC,MAAoB,gBAAW,SAA6B,EAAM,EAAI,CAAC,IAAMC,EAAiBJ,EAAoB,EAC1b,OAD4bF,MAAc,CAA4B,GAAxBM,GAAkCZ,IAAS,OAAY,OAAO,IAAMa,EAAMJ,EAAqB,EAAE,GAAG,CAAC,IAAMK,EAAWd,EAAO,SAAS,KAAWe,EAAI,IAAI,IAAID,CAAU,EAAmD,GAA9BC,EAAI,aAAa,IAAI,OAAuB,IAAIF,EAAM,OAAOE,EAAI,aAAa,IAAI,QAAQF,CAAK,EAAE,IAAMG,EAAQD,EAAI,SAAS,EAAE,GAAGC,IAAUF,EAAW,OAAOd,EAAO,SAAS,QAAQgB,CAAO,CAAE,MAAM,CACt4B,CAAC,EAAE,CAACJ,CAAgB,CAAC,EAAuD,gBAAKd,EAAiB,CAAK,MAAI,GAAGoB,CAAK,CAAC,CAAE,CAAC,CAAE,C"}