{"version":3,"file":"VIP_Access_Guard.hBS0NgcT.mjs","names":["useState","vipAccessConfig","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/o63HGbgM80lv9yNI5qLS/EkhmMtO23bIqYNLNidwk/VipAccessGate.js","https:/framerusercontent.com/modules/BxUWLl9N1TppYGFUCZEF/lQ4Wu1xXsZb2lk2VJsZP/VIP_Access_Guard.js"],"sourcesContent":["const vipAccessConfig={routes:[{path:\"/carnivalvip\",accessCodes:[\"ca6eb4630fd232d2b5757c66e5abd482254cd6be5cc890309c112158cf55a0a0\"]},{path:\"/choctawvip\",accessCodes:[\"ca6eb4630fd232d2b5757c66e5abd482254cd6be5cc890309c112158cf55a0a0\"]},{path:\"/betopenlyvip\",accessCodes:[\"ca6eb4630fd232d2b5757c66e5abd482254cd6be5cc890309c112158cf55a0a0\"]},{path:\"/superbookvip\",accessCodes:[\"ca6eb4630fd232d2b5757c66e5abd482254cd6be5cc890309c112158cf55a0a0\"]},{path:\"/pechangavip\",accessCodes:[\"ca6eb4630fd232d2b5757c66e5abd482254cd6be5cc890309c112158cf55a0a0\"]},{path:\"/carnival\",accessCodes:[\"ca6eb4630fd232d2b5757c66e5abd482254cd6be5cc890309c112158cf55a0a0\"]},{path:\"/choctaw\",accessCodes:[\"ca6eb4630fd232d2b5757c66e5abd482254cd6be5cc890309c112158cf55a0a0\"]},{path:\"/betopenly\",accessCodes:[\"ca6eb4630fd232d2b5757c66e5abd482254cd6be5cc890309c112158cf55a0a0\"]},{path:\"/superbook\",accessCodes:[\"ca6eb4630fd232d2b5757c66e5abd482254cd6be5cc890309c112158cf55a0a0\"]},{path:\"/pechanga\",accessCodes:[\"ca6eb4630fd232d2b5757c66e5abd482254cd6be5cc890309c112158cf55a0a0\"]}]};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/EkhmMtO23bIqYNLNidwk/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 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].replace(\"vip\",\"\");// 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);console.log(isProtected,\"isProtected\");console.log(isStaging,\"isStaging\");console.log(VipAccessRoutes,\"VipAccessRoutes\");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\":{\"setRootDisplayStyle\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"hash\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getSessionKey\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useVipAccessGuard\":{\"type\":\"override\",\"name\":\"useVipAccessGuard\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withuseVipAccessGuard\":{\"type\":\"reactHoc\",\"name\":\"withuseVipAccessGuard\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VIP_Access_Guard.map"],"mappings":"2TAAM,EAAgB,CAAC,OAAO,CAAC,CAAC,KAAK,eAAe,YAAY,CAAC,mEAAmE,CAAC,CAAC,CAAC,KAAK,cAAc,YAAY,CAAC,mEAAmE,CAAC,CAAC,CAAC,KAA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