{"version":3,"file":"LaunchGate.BfM-oUD6.mjs","names":["forwardRef","useMemo","useState","useCallback","startTransition","useLayoutEffect","_jsx","__esmMin","le","init_ssg_sandbox_shims","te","ne","window","_e","pe","J","init_jsx_runtime","init_npm_react_18_3_1","RenderTarget","init_framer_ChujFWHC","normalizePath","pathname","getEasternNowKey","parts","CONFIG","value","type","part","resolveActiveDestination","easternKey","PRICE_REVEAL_START","DAY_1_START","DAY_2_START","DAY_3_START","EXPIRED_START","PRE_REVEAL","PRICE_REVEAL","DAY_1","DAY_2","DAY_3","EXPIRED","resolveRedirect","path","normalizedPath","activeDestination","withLaunchGate","Component","props","ref","isCanvas","isAllowed","setIsAllowed","runGate","redirectTo","destination","mergedStyle","init_LaunchGate"],"sources":["https:/framerusercontent.com/modules/KEXzETDFKqEdIGJEZBpH/Vhbxx3geJ96hF2AD370c/LaunchGate.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,startTransition,useCallback,useLayoutEffect,useMemo,useState}from\"react\";import{RenderTarget}from\"framer\";// User request summary:\n// Create a single Framer code override named withLaunchGate that enforces\n// time-based routing for /lc and protected offer paths using Eastern wall-clock\n// time, preserving query/hash on redirects, preventing flash-of-wrong-content,\n// and skipping gating in Framer canvas for editor safety.\nconst CONFIG={// All schedule logic uses Eastern wall-clock time via Intl + America/New_York.\n// Do not hardcode EST/EDT offsets; Intl handles DST automatically.\nTIMEZONE:\"America/New_York\",// Stage boundaries are inclusive at exactly 13:00:00 ET:\n// the new stage becomes active at exactly 1:00:00 PM Eastern.\nSTAGE_BOUNDARIES:{PRICE_REVEAL_START:\"2026-09-21T13:00:00\",DAY_1_START:\"2026-09-22T13:00:00\",DAY_2_START:\"2026-09-23T13:00:00\",DAY_3_START:\"2026-09-24T13:00:00\",EXPIRED_START:\"2026-09-25T13:00:00\"},DESTINATIONS:{PRE_REVEAL:\"/lc\",PRICE_REVEAL:\"/pr\",DAY_1:\"/offer-day-1\",DAY_2:\"/offer-day-2\",DAY_3:\"/offer-day-3\",EXPIRED:\"/offer-expired\"},PROTECTED_PATHS:[\"/lc\",\"/pr\",\"/offer\",\"/offer-day-1\",\"/offer-day-2\",\"/offer-day-3\",\"/offer-expired\"]};function normalizePath(pathname){if(!pathname)return\"/\";if(pathname.length>1&&pathname.endsWith(\"/\"))return pathname.slice(0,-1);return pathname;}function getEasternNowKey(){const formatter=new Intl.DateTimeFormat(\"en-CA\",{timeZone:CONFIG.TIMEZONE,year:\"numeric\",month:\"2-digit\",day:\"2-digit\",hour:\"2-digit\",minute:\"2-digit\",second:\"2-digit\",hour12:false});const parts=formatter.formatToParts(new Date);const value=type=>parts.find(part=>part.type===type)?.value??\"00\";return`${value(\"year\")}-${value(\"month\")}-${value(\"day\")}T${value(\"hour\")}:${value(\"minute\")}:${value(\"second\")}`;}function resolveActiveDestination(easternKey){const{PRICE_REVEAL_START,DAY_1_START,DAY_2_START,DAY_3_START,EXPIRED_START}=CONFIG.STAGE_BOUNDARIES;const{PRE_REVEAL,PRICE_REVEAL,DAY_1,DAY_2,DAY_3,EXPIRED}=CONFIG.DESTINATIONS;if(easternKey<PRICE_REVEAL_START)return PRE_REVEAL;if(easternKey<DAY_1_START)return PRICE_REVEAL;if(easternKey<DAY_2_START)return DAY_1;if(easternKey<DAY_3_START)return DAY_2;if(easternKey<EXPIRED_START)return DAY_3;return EXPIRED;}function resolveRedirect(path,easternKey){const normalizedPath=normalizePath(path);const protectedPaths=CONFIG.PROTECTED_PATHS;if(protectedPaths.includes(normalizedPath)){const activeDestination=resolveActiveDestination(easternKey);if(normalizedPath!==activeDestination)return activeDestination;return null;}return null;}export function withLaunchGate(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const isCanvas=useMemo(()=>RenderTarget.current()===RenderTarget.canvas,[]);const[isAllowed,setIsAllowed]=useState(isCanvas);const runGate=useCallback(()=>{if(isCanvas){startTransition(()=>setIsAllowed(true));return;}if(typeof window===\"undefined\"){return;}const pathname=normalizePath(window.location.pathname);const easternNowKey=getEasternNowKey();const redirectTo=resolveRedirect(pathname,easternNowKey);if(redirectTo){const destination=`${redirectTo}${window.location.search}${window.location.hash}`;window.location.replace(destination);return;}startTransition(()=>setIsAllowed(true));},[isCanvas]);useLayoutEffect(()=>{runGate();},[runGate]);const mergedStyle=useMemo(()=>({...props?.style??{},visibility:isAllowed?\"visible\":\"hidden\"}),[props?.style,isAllowed]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:mergedStyle});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withLaunchGate\":{\"type\":\"reactHoc\",\"name\":\"withLaunchGate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LaunchGate.map"],"mappings":"A,qNASub,SAASoB,EAAcC,EAAS,CAAiG,OAA5FA,EAAsBA,EAAS,OAAO,GAAGA,EAAS,SAAS,GAAG,EAASA,EAAS,MAAM,EAAE,EAAE,EAASA,EAApF,GAA6F,CAAC,SAASC,GAAkB,CAAwL,IAAMC,EAAM,IAA/K,KAAK,eAAe,QAAQ,CAAC,SAASC,EAAO,SAAS,KAAK,UAAU,MAAM,UAAU,IAAI,UAAU,KAAK,UAAU,OAAO,UAAU,OAAO,UAAU,OAAO,EAAK,CAAuB,CAAC,CAAC,8BAAc,IAAI,IAAI,EAAQC,EAAMC,GAAMH,EAAM,KAAKI,GAAMA,EAAK,OAAOD,CAAI,CAAC,EAAE,OAAO,KAAK,MAAM,GAAGD,EAAM,MAAM,EAAE,GAAGA,EAAM,OAAO,EAAE,GAAGA,EAAM,KAAK,EAAE,GAAGA,EAAM,MAAM,EAAE,GAAGA,EAAM,QAAQ,EAAE,GAAGA,EAAM,QAAQ,GAAI,CAAC,SAASG,EAAyBC,EAAW,CAAC,GAAK,CAACC,qBAAmBC,cAAYC,cAAYC,cAAYC,iBAAeV,EAAO,iBAAsB,CAACW,aAAWC,eAAaC,QAAMC,QAAMC,QAAMC,WAAShB,EAAO,aAAqO,OAAr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