{"version":3,"file":"AuthGate.nFgexvSE.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/gN4wqcV3bfMD5TMcFwIq/HULLvy0Eg2EnLqAburou/AuthGate.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{Frame}from\"framer\";import{supabase}from\"https://framerusercontent.com/modules/tjZM2cZpsFNl8z96IwXu/jw6w4qyek4alHS6SSwvk/supabaseClient.js\";const PUBLIC_LOGIN_URL=\"https://www.jiveportal.com\";export function AuthGate(props){const[loading,setLoading]=React.useState(true);const[authed,setAuthed]=React.useState(false);React.useEffect(()=>{let mounted=true;async function check(){const{data}=await supabase.auth.getSession();if(!mounted)return;const hasSession=!!data?.session;setAuthed(hasSession);setLoading(false);if(!hasSession&&typeof window!==\"undefined\"){window.location.replace(PUBLIC_LOGIN_URL);}}check();const{data:sub}=supabase.auth.onAuthStateChange((_event,session)=>{const hasSession=!!session;setAuthed(hasSession);if(!hasSession&&typeof window!==\"undefined\"){window.location.replace(PUBLIC_LOGIN_URL);}});return()=>{mounted=false;sub.subscription.unsubscribe();};},[]);if(loading){return /*#__PURE__*/_jsx(Frame,{width:\"100%\",height:\"100%\",background:\"transparent\",children:/*#__PURE__*/_jsx(\"div\",{style:{padding:24},children:\"Loading…\"})});}if(!authed){return /*#__PURE__*/_jsx(Frame,{width:\"100%\",height:\"100%\",background:\"transparent\",children:/*#__PURE__*/_jsx(\"div\",{style:{padding:24},children:\"Redirecting…\"})});}return /*#__PURE__*/_jsx(Frame,{width:\"100%\",height:\"100%\",background:\"transparent\",children:props.children});}AuthGate.defaultProps={width:\"100%\",height:\"100%\"};\nexport const __FramerMetadata__ = {\"exports\":{\"AuthGate\":{\"type\":\"reactComponent\",\"name\":\"AuthGate\",\"slots\":[\"children\"],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"6OAA6Q,SAAgB,EAAS,EAAM,CAAC,GAAK,CAAC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