1import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,r as n}from"./framework-A1pNZAzD.js";var r=e(t(),1),i=n();function a(){let[e,t]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=!1,n=!1,r=null;async function i(){if(n||document.visibilityState!==`visible`)return;n=!0,r=new AbortController;let i=setTimeout(()=>r?.abort(),1e4);try{let n=await fetch(`/api/workspace/notices?summary=1`,{cache:`no-store`,signal:r.signal});if(!n.ok)throw Error();let i=await n.json();e||t({signedIn:i.signedIn===!0,unread:Number.isSafeInteger(i.unread)&&typeof i.unread==`number`&&i.unread>0?i.unread:0})}catch{e||t(null)}finally{clearTimeout(i),n=!1}}i();let a=setInterval(i,3e4);return window.addEventListener(`focus`,i),window.addEventListener(`sa-account-update`,i),document.addEventListener(`visibilitychange`,i),()=>{e=!0,r?.abort(),clearInterval(a),window.removeEventListener(`focus`,i),window.removeEventListener(`sa-account-update`,i),document.removeEventListener(`visibilitychange`,i)}},[]);let n=e?.signedIn,a=e?.unread||0;return(0,i.jsxs)(`a`,{className:`header-login`,href:n?`/workspace?tab=notices`:`/login`,"aria-label":n?`ãã¤ãã¼ã¸`+(a?`ã»æªèªã®ãç¥ãã`+a+`ä»¶`:``):`ãã°ã¤ã³ç»é¢ãéã`,children:[n?`ãã¤ãã¼ã¸`:`ãã°ã¤ã³`,n&&a>0&&(0,i.jsx)(`span`,{className:`chat-nav-count`,"aria-hidden":`true`,children:a>99?`99+`:a})]})}export{a as AccountLink};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.