(function(){const i="userId";let r=null;function s(){try{return localStorage.getItem(i)}catch{return null}}function t(){const e=s();e!==r&&(r=e,chrome.runtime.sendMessage({action:"syncAuth",userId:e??""},()=>{chrome.runtime.lastError}))}window.location.pathname==="/auth/extension-success"&&chrome.runtime.sendMessage({action:"extensionLoginComplete"},()=>{chrome.runtime.lastError});t();window.addEventListener("storage",e=>{(e.key===i||e.key===null)&&t()});document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&t()});let n=null;const o=new MutationObserver(()=>{n&&clearTimeout(n),n=setTimeout(t,500)});o.observe(document.body,{childList:!0,subtree:!0});setInterval(t,5e3);
})()
