{"version":3,"file":"WithTodayQueryParam.TxrRYUWe.mjs","names":["WrappedComponent"],"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":"yLAI2H,SAAS,GAAsB,CAAC,IAAM,EAAI,IAAI,KAAuI,MAAM,GAA7H,EAAI,YAA+H,EAAE,GAAvG,OAAO,EAAI,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,GAA0E,EAAE,GAA7D,OAAO,EAAI,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,GAAiC,GAAI,CAAC,SAAgB,EAAoB,EAAU,CAAC,OAAoB,EAAW,SAA6B,EAAM,EAAI,CAAC,IAAM,EAAiB,EAAoB,EAC1b,OAD4b,MAAc,CAA4B,GAAxB,GAAkC,IAAS,OAAY,OAAO,IAAM,EAAM,EAAqB,EAAE,GAAG,CAAC,IAAM,EAAW,EAAO,SAAS,KAAW,EAAI,IAAI,IAAI,CAAU,EAAmD,GAA9B,EAAI,aAAa,IAAI,OAAuB,IAAI,EAAM,OAAO,EAAI,aAAa,IAAI,QAAQ,CAAK,EAAE,IAAM,EAAQ,EAAI,SAAS,EAAE,GAAG,IAAU,EAAW,OAAO,EAAO,SAAS,QAAQ,CAAO,CAAE,MAAM,CACt4B,CAAC,EAAE,CAAC,CAAgB,CAAC,EAAuD,EAAKA,EAAiB,CAAK,MAAI,GAAG,CAAK,CAAC,CAAE,CAAC,CAAE,qBAD/E,IAAwC,IAAwC"}