{"version":3,"file":"VIP_Access_Gate_1.D5orMu3I.mjs","names":["React.useState","vipAccessConfig","VipFormStyles"],"sources":["https:/framerusercontent.com/modules/B3AHORJWRahpPWyaXFrP/jU0Rv7yDzWzUVfge1A9j/VIP_Access_Gate_1.js"],"sourcesContent":["// VIP_Access_Gate.tsx\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import VipFormStyles from\"https://framerusercontent.com/modules/8Bz9GJT524TqIlejNISg/MjgKFo9NBduP6WXeGSpJ/VIP_Form_Styles.js\";import{hash,getSessionKey}from\"https://framerusercontent.com/modules/BxUWLl9N1TppYGFUCZEF/m8ZdGmdidHgOJlYq7yBd/VIP_Access_Guard.js\";import vipAccessConfig from\"https://framerusercontent.com/modules/o63HGbgM80lv9yNI5qLS/I2RGS8t8a4JYT2XCr2t6/VipAccessGate.js\";export default function VIPAccessGate(){const[loading,setLoading]=React.useState(false);const[gateError,setGateError]=React.useState(\"\");const[vipCode,setVipCode]=React.useState(\"\");const[tosChecked,setTosChecked]=React.useState(false);const searchParams=typeof window!==\"undefined\"?new URLSearchParams(window.location.search):null;const redirectedFrom=searchParams?.get(\"redirectedFrom\")||sessionStorage.getItem(\"redirectAfterLogin\")||\"\";async function handleGateSubmit(e){e.preventDefault();setGateError(\"\");if(!tosChecked){setGateError(\"❌ You must confirm you are 21+ to continue\");return;}setLoading(true);try{const hashedInput=await hash(vipCode.trim());// find the route that contains this hash\nconst route=vipAccessConfig.routes.find(r=>r.path===redirectedFrom);if(!route||!route.accessCodes.includes(hashedInput)){setGateError(\"❌ Wrong access code\");setLoading(false);return;}// store the session key for that route\nconst sessionKey=getSessionKey(route.path);sessionStorage.setItem(sessionKey,hashedInput);// clear the redirectAfterLogin storage (optional)\ntry{sessionStorage.removeItem(\"redirectAfterLogin\");}catch{// ignore\n}// redirect back to the originally requested page, or fallback\nconst destination=redirectedFrom||route.path||\"/\";window.location.href=destination;}catch(err){console.error(\"Error checking VIP code:\",err);setGateError(\"❌ Error validating code\");setLoading(false);}}return /*#__PURE__*/_jsxs(\"div\",{className:\"vip-wrapper\",children:[/*#__PURE__*/_jsx(\"style\",{children:VipFormStyles}),/*#__PURE__*/_jsxs(\"div\",{className:\"vip-header\",children:[/*#__PURE__*/_jsxs(\"h1\",{children:[\"Welcome to \",/*#__PURE__*/_jsx(\"span\",{children:\"EDGE Boost VIP\"})]}),/*#__PURE__*/_jsx(\"p\",{children:\"Unlock your exclusive access to EDGE Boost VIP. Enter your code below to join our exclusive community and enjoy premium benefits reserved for members only.\"})]}),/*#__PURE__*/_jsxs(\"form\",{onSubmit:handleGateSubmit,className:\"vip-form\",children:[/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"label\",{className:\"vip-label\",htmlFor:\"vipCode\",children:\"VIP Access Code\"}),/*#__PURE__*/_jsx(\"input\",{type:\"password\",name:\"vipCode\",value:vipCode,onChange:e=>setVipCode(e.target.value),placeholder:\"Enter VIP code\",required:true,className:\"vip-input\"})]}),/*#__PURE__*/_jsxs(\"label\",{className:\"vip-checkbox\",children:[/*#__PURE__*/_jsx(\"input\",{type:\"checkbox\",name:\"tos\",checked:tosChecked,onChange:e=>setTosChecked(e.target.checked),required:true,className:\"vip-checkbox-input\"}),\"I confirm I am 21+ years old.\"]}),gateError&&/*#__PURE__*/_jsx(\"div\",{style:{color:\"#fb9494\",marginTop:10},children:gateError}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",className:\"vip-button\",disabled:loading,children:loading?/*#__PURE__*/_jsx(\"div\",{className:\"spinner\"}):\"Submit\"})]})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VIPAccessGate\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"qcACqd,SAAwB,GAAe,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAe,GAAM,CAAM,CAAC,EAAU,GAA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