import{u as x,j as e,y as w,r as N,z as y,p as f,L as j}from"./index-BIVkyPD7.js";const C="_card_f20gt_2",T="_cardUnread_f20gt_15",b="_cardRead_f20gt_20",S="_topRow_f20gt_25",v="_categoryChip_f20gt_32",k="_versionChip_f20gt_45",R="_date_f20gt_57",H="_title_f20gt_65",E="_body_f20gt_74",L="_linkList_f20gt_82",A="_link_f20gt_82",U="_newBadge_f20gt_104",n={card:C,cardUnread:T,cardRead:b,topRow:S,categoryChip:v,versionChip:k,date:R,title:H,body:E,linkList:L,link:A,newBadge:U},B={release:"whatsNew.category.release",notice:"whatsNew.category.notice",deprecation:"whatsNew.category.deprecation",tip:"whatsNew.category.tip"};function u({announcement:s,isNew:g}){const{locale:r,t:i}=x(),o=g?n.cardUnread:n.cardRead,h=s.title[r]??s.title.en,l=s.body[r]??s.body.en,d=s.links??(s.link?[s.link]:[]),_=c=>typeof c=="string"?c:c[r]??c.en;return e.jsxs("div",{className:`${n.card} ${o}`,children:[e.jsxs("div",{className:n.topRow,children:[e.jsx("span",{className:n.categoryChip,children:i(B[s.category])}),s.version&&e.jsx("span",{className:n.versionChip,children:s.version}),g&&e.jsx("span",{className:n.newBadge,children:i("whatsNew.newBadge","NEW")}),e.jsx("span",{className:n.date,children:s.date})]}),e.jsx("h3",{className:n.title,children:h}),e.jsx("p",{className:n.body,children:l}),d.length>0&&e.jsx("div",{className:n.linkList,children:d.map(c=>{const p=_(c.url),t=_(c.label);return e.jsxs("a",{className:n.link,href:p,target:"_blank",rel:"noopener noreferrer",children:["↗"," ",t]},p)})})]})}const I="_page_19yl3_2",$="_pageHeader_19yl3_10",z="_pageHeaderText_19yl3_17",M="_pageTitle_19yl3_24",W="_pageSubtitle_19yl3_31",O="_settingsIcon_19yl3_38",Y="_section_19yl3_67",G="_sectionTitle_19yl3_73",K="_unreadCount_19yl3_85",P="_empty_19yl3_100",q="_divider_19yl3_108",a={page:I,pageHeader:$,pageHeaderText:z,pageTitle:M,pageSubtitle:W,settingsIcon:O,section:Y,sectionTitle:G,unreadCount:K,empty:P,divider:q};function F(){const{t:s}=x(),{readSet:g,markRead:r}=w(),i=N.useMemo(()=>{const t=[];for(const m of y)g.has(m.id)||t.push(m.id);return t},[]),o=N.useRef(i);o.current=i,N.useEffect(()=>()=>{o.current.length>0&&r(o.current)},[]);const h=N.useMemo(()=>new Set(i),[i]),l=y.filter(t=>h.has(t.id)),d=y.filter(t=>!h.has(t.id)),_=l.length>0,c=d.length>0,p=e.jsxs("div",{className:a.pageHeader,children:[e.jsxs("div",{className:a.pageHeaderText,children:[e.jsx("h1",{className:a.pageTitle,children:s("whatsNew.pageTitle","What's New")}),e.jsx("p",{className:a.pageSubtitle,children:s("whatsNew.pageSubtitle","Stay up to date with MCP changes")})]}),e.jsx(f,{text:s("sidebar.settings","Settings"),children:e.jsx(j,{to:"/settings","aria-label":s("sidebar.settings","Settings"),className:a.settingsIcon,children:"⚙️"})})]});return y.length===0?e.jsxs("div",{className:a.page,children:[p,e.jsx("p",{className:a.empty,children:s("whatsNew.empty","No announcements yet")})]}):e.jsxs("div",{className:a.page,children:[p,_&&e.jsxs("section",{className:a.section,children:[e.jsxs("h2",{className:a.sectionTitle,children:[s("whatsNew.unreadSection","Unread"),e.jsx("span",{className:a.unreadCount,children:l.length})]}),l.map(t=>e.jsx(u,{announcement:t,isNew:!0},`unread-${t.id}`))]}),_&&c&&e.jsx("hr",{className:a.divider}),c&&e.jsxs("section",{className:a.section,children:[e.jsx("h2",{className:a.sectionTitle,children:s("whatsNew.allSection","All Announcements")}),d.map(t=>e.jsx(u,{announcement:t,isNew:!1},`all-${t.id}`))]})]})}export{F as Component};
