{"version":3,"file":"VIP_Access_Guard.CIbt8Duh.mjs","names":["useState","vipAccessConfig","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/o63HGbgM80lv9yNI5qLS/MSyQTXTRyXZRPDPZ5x8L/VipAccessGate.js","https:/framerusercontent.com/modules/BxUWLl9N1TppYGFUCZEF/mRqk7C25ZYRRBMRasXjo/VIP_Access_Guard.js"],"sourcesContent":["const vipAccessConfig={routes:[{path:\"/mgm-vip\",accessCodes:[\"965c3a5083f7b859d7e0c813719d960eac84777c57d76ed0db2adaa758ba8378\"]},{path:\"/superbook-vip\",accessCodes:[\"cd1490a41e1b97ea021425444246c0a7fb6a8545cddc1db1a88d619af644a6e3\"]},{path:\"/prime-vip\",accessCodes:[\"20aa33b0420a88b0e6fa51d9886916126749bd6921ed8d57ac9c416ecd359e61\"]},{path:\"/kalshi-vip\",accessCodes:[\"be1611d7eaae29c46cc82834022aec28a1b097d1f81c5e5b18be77b4205d1f88\"]},{path:\"/pechanga-vip-2\",accessCodes:[\"9b4d5820dac33ebfdd98c0611c73992ef96b2e86e3763e877e7a23e5d1fda9ae\"]},{path:\"/wynn-vip\",accessCodes:[\"8a503cc3dddc57b8c395f5a890b0b24f0f3edbfcf1be0711289f11c8b3c5591d\"]},{path:\"/carnival-vip\",accessCodes:[\"38e610841b112bb9a34c72b8e9083e58db1233bb88350a9cd5f3c5413b38464e\"]},{path:\"/choctaw-vip\",accessCodes:[\"8ee233c89247c4d19c69aa0fa957ab881ae4082a1b9e9622794f115e1cfdc2b3\"]}]};export default vipAccessConfig;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VipAccessGate.map","// VipAccessGate.tsx\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import vipAccessConfig from\"https://framerusercontent.com/modules/o63HGbgM80lv9yNI5qLS/MSyQTXTRyXZRPDPZ5x8L/VipAccessGate.js\";const STAGING_DOMAIN_PREFIX=\"significant-imaginations-\";export async function hash(input){const enc=new TextEncoder().encode(input);const buffer=await crypto.subtle.digest(\"SHA-256\",enc);return Array.from(new Uint8Array(buffer)).map(b=>b.toString(16).padStart(2,\"0\")).join(\"\");}export function setRootDisplayStyle(value=\"\"){const dataFramerRoot=document.querySelector(\"[data-framer-root]\");if(dataFramerRoot)dataFramerRoot.style.display=value;}export function getSessionKey(path){return`authPassed_${path}`;}/**\n * useVipAccessGate:\n * - If visiting a protected route and sessionStorage doesn't have the right key,\n *   it will save the path and redirect to /vip-access?redirectedFrom=<path>\n * - If authorized (session key exists), simply shows the page (no overlay)\n */export function useVipAccessGuard(props){const[authorized,setAuthorized]=useState(false);const[currentPath,setCurrentPath]=useState(\"\");const VipAccessRoutes=vipAccessConfig.routes;const isStaging=typeof window!==\"undefined\"&&window.location.href.includes(STAGING_DOMAIN_PREFIX);useEffect(()=>{if(typeof window===\"undefined\")return;const path=window.location.pathname;setCurrentPath(path);/*if (isStaging) {\n            // Allow staging to view freely\n            setRootDisplayStyle()\n            return\n        }*/// If the path is not a protected route, nothing to do\nconst currentProtectedRoute=VipAccessRoutes.find(route=>route.path===path);if(!currentProtectedRoute){setRootDisplayStyle();setAuthorized(true);return;}// If we already have a valid session hash for this path, allow\nconst sessionKey=getSessionKey(path);const storedHash=sessionStorage.getItem(sessionKey);if(storedHash&&currentProtectedRoute.accessCodes.includes(storedHash)){setRootDisplayStyle();setAuthorized(true);return;}// Not authorized: store redirect, send to /vip-access\n// Avoid redirect loop in case /vip-access is itself configured (it shouldn't be)\n// Save the original path so the vip access page can send user back\ntry{sessionStorage.setItem(\"redirectAfterLogin\",path);}catch(e){// ignore sessionStorage errors\nconsole.warn(\"Could not set sessionStorage redirect:\",e);}const provider=path.replace(\"/\",\"\").split(\"-\")[0];// Redirect to /vip-access (use full path)\nconst redirectTo=`/vip-access-${provider}?redirectedFrom=${encodeURIComponent(path)}`;// Small timeout to ensure any UI updates commit before navigation\nwindow.location.replace(redirectTo);},[isStaging]);// This override renders nothing; it exists to run the redirect logic.\n// For safety, if unauthorized and the redirect hasn't happened (rare), hide root.\nconst isProtected=VipAccessRoutes.some(route=>route.path===currentPath);if(typeof window===\"undefined\"||!isProtected||isStaging||authorized){return{};}// If we're here, the redirect should already be happening. Hide root as fallback.\nreturn{children:null};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withuseVipAccessGuard(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...useVipAccessGuard(props)});};}withuseVipAccessGuard.displayName=\"useVipAccessGuard\";\nexport const __FramerMetadata__ = {\"exports\":{\"hash\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setRootDisplayStyle\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withuseVipAccessGuard\":{\"type\":\"reactHoc\",\"name\":\"withuseVipAccessGuard\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useVipAccessGuard\":{\"type\":\"override\",\"name\":\"useVipAccessGuard\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getSessionKey\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"2TAAM,EAAgB,CAAC,OAAO,CAAC,CAAC,KAAK,WAAW,YAAY,CAAC,mEAAmE,CAAC,CAAC,CAAC,KAAK,iBAAiB,YAAY,CAAC,mEAAmE,CAAC,CAAC,CAAC,KAAK,aAAa,YAAY,CAAC,mEAAmE,CAAC,CAAC,CAAC,KAAK,cAAc,YAAY,CAAC,mEAAmE,CAAC,CAAC,CAAC,KAAK,kBAAkB,YAAY,CAAC,mEAAmE,CAAC,CAAC,CAAC,KAAK,YAAY,YAAY,CAAC,mEAAmE,CAAC,CAA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