{"version":3,"file":"SessionInfo.DE6PAFOe.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/CXAy6hi2tHF0y0gfwTIm/scffsTcPQZ5r4848LKWy/SessionInfo.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";export default function SessionInfo(){const[sessionId,setSessionId]=useState(\"\");const[email,setEmail]=useState(\"\");const[name,setName]=useState(\"\");const[error,setError]=useState(\"\");const[loading,setLoading]=useState(true);// ✅ Human-friendly purchase date (computed once)\nconst[purchaseDate]=useState(()=>new Date().toLocaleDateString(\"en-US\",{year:\"numeric\",month:\"long\",day:\"numeric\"}));useEffect(()=>{// 🔍 HARD DEBUG\nconst fullUrl=window.location.href;const query=window.location.search;console.log(\"FULL URL:\",fullUrl);console.log(\"QUERY STRING:\",query);// ✅ RELIABLE SESSION EXTRACTION\nconst match=fullUrl.match(/session_id=([^&]+)/);const id=match?match[1]:null;console.log(\"EXTRACTED SESSION:\",id);if(!id){setError(\"Receipt number missing from URL.\");setLoading(false);return;}setSessionId(id);async function fetchData(){try{const res=await fetch(`https://us-central1-modstream-470ed.cloudfunctions.net/getSessionInfo?sessionId=${id}`);const data=await res.json();console.log(\"SESSION API RESPONSE:\",data);if(data.error){setError(data.error);}else{setEmail(data.email||\"\");setName(data.name||\"\");}}catch(e){console.error(\"FETCH ERROR:\",e);setError(\"Failed to load receipt information.\");}setLoading(false);}fetchData();},[]);if(loading)return /*#__PURE__*/_jsx(\"p\",{children:\"Loading…\"});if(error)return /*#__PURE__*/_jsx(\"p\",{children:error});return /*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsxs(\"p\",{children:[/*#__PURE__*/_jsx(\"strong\",{children:\"Name:\"}),\" \",name]}),/*#__PURE__*/_jsxs(\"p\",{children:[/*#__PURE__*/_jsx(\"strong\",{children:\"Email:\"}),\" \",email]}),/*#__PURE__*/_jsxs(\"p\",{children:[/*#__PURE__*/_jsx(\"strong\",{children:\"Purchase Date:\"}),\" \",purchaseDate]}),/*#__PURE__*/_jsxs(\"p\",{children:[/*#__PURE__*/_jsx(\"strong\",{children:\"Recovery ID:\"}),\" \",/*#__PURE__*/_jsx(\"code\",{children:sessionId})]}),/*#__PURE__*/_jsx(\"small\",{children:\"Save this Recovery ID. You'll only need it if you ever lose access to your account.\"})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SessionInfo\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SessionInfo.map"],"mappings":"8IAA+F,SAAwB,GAAa,CAAC,GAAK,CAAC,EAAU,GAAcA,EAAS,GAAG,CAAM,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAM,CAAC,EAAK,GAASA,EAAS,GAAG,CAAM,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAM,CAAC,EAAQ,GAAYA,EAAS,GAAK,CAC1T,CAAC,GAAcA,MAAa,IAAI,MAAM,CAAC,mBAAmB,QAAQ,CAAC,KAAK,UAAU,MAAM,OAAO,IAAI,UAAU,CAAC,CAAC,CAEooB,OAFnoB,MAAc,CACnI,IAAM,EAAQ,EAAO,SAAS,KAAW,EAAM,EAAO,SAAS,OAAO,QAAQ,IAAI,YAAY,EAAQ,CAAC,QAAQ,IAAI,gBAAgB,EAAM,CACzI,IAAM,EAAM,EAAQ,MAAM,qBAAqB,CAAO,EAAG,EAAM,EAAM,GAAG,KAA0C,GAArC,QAAQ,IAAI,qBAAqB,EAAG,CAAI,CAAC,EAAG,CAAC,EAAS,mCAAmC,CAAC,EAAW,GAAM,CAAC,OAAQ,EAAa,EAAG,CAAC,eAAe,GAAW,CAAC,GAAG,CAAgH,IAAM,EAAK,MAAhH,MAAM,MAAM,mFAAmF,IAAK,EAAsB,MAAM,CAAC,QAAQ,IAAI,wBAAwB,EAAK,CAAI,EAAK,MAAO,EAAS,EAAK,MAAM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