import{c as n}from"./index.js";import{c as a}from"./config.js";const o=a.supabaseUrl,c=a.supabaseAnonKey,i=n(o,c,{auth:{autoRefreshToken:!1,persistSession:!1,detectSessionInUrl:!1}});async function u(t){if(!t){await chrome.runtime.sendMessage({action:"LOGOUT"});return}const{access_token:e,refresh_token:s,user:r}=t;await chrome.storage.local.set({access_token:e,refresh_token:s,user:r,session_expires_at:t.expires_at})}i.auth.onAuthStateChange(async(t,e)=>{console.log("[AuthShared] Auth state change:",t,!!e),await u(e),e&&await chrome.runtime.sendMessage({action:"AUTH_STATE_CHANGE",event:t,session:{access_token:e.access_token,refresh_token:e.refresh_token,user:e.user,expires_at:e.expires_at}})});function f(t){return document.getElementById(t)}export{f as g,u as p,i as s};
//# sourceMappingURL=authShared.js.map
