import{$ as e,C as t,D as n,E as r,F as i,H as a,I as o,Q as s,S as c,X as l,Y as u,_ as d,b as f,n as p}from"./app-TUitoOVa.js";import{n as m,t as h}from"./AppLayout-BpT0nFS-.js";var g={class:`mx-auto max-w-[760px]`},_={class:`mb-5 flex items-center justify-between`},v={class:`overflow-hidden rounded-c border border-line bg-surface`},y=[`onClick`],b={class:`min-w-0 flex-1`},x={class:`text-sm leading-snug text-ink`},S={key:0,class:`mt-1 truncate text-sm text-ink-muted`},C={class:`mt-1 text-xs text-ink-muted`},w={key:0,class:`mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-primary`},T={key:0,class:`px-5 py-16 text-center text-ink-muted`},E=n({__name:`Index`,props:{items:{},unread:{}},setup(n){let E=n;function D(e){return e.type===`mention`?`${e.actor.name} mentioned you in ${e.topic.title}`:e.type===`reaction`?`${e.actor.name} reacted ${e.emoji??``} to your post`:`${e.actor.name} replied in ${e.topic.title}`}function O(t){t.read||e.post(`/notifications/${t.id}/read`,{},{preserveScroll:!0}),e.visit(t.url)}function k(){e.post(`/notifications/read`,{},{preserveScroll:!0})}return(e,n)=>(i(),t(d,null,[r(u(p),{title:`Notifications`}),r(h,null,{default:a(()=>[f(`div`,g,[f(`div`,_,[n[0]||=f(`h1`,{class:`text-2xl font-extrabold tracking-tight`},`Notifications`,-1),E.unread>0?(i(),t(`button`,{key:0,type:`button`,class:`rounded-lg border border-line bg-surface px-3 py-2 text-sm font-semibold text-ink-2 hover:bg-surface-2`,onClick:k},`Mark all read`)):c(``,!0)]),f(`div`,v,[(i(!0),t(d,null,o(E.items,e=>(i(),t(`button`,{key:e.id,type:`button`,class:l([`flex w-full gap-3 border-b border-line/60 px-5 py-4 text-left last:border-0 hover:bg-surface-2`,e.read?``:`bg-primary/10`]),onClick:t=>O(e)},[r(m,{avatar:{initials:e.actor.initials,color:e.actor.color},size:40},null,8,[`avatar`]),f(`div`,b,[f(`div`,x,s(D(e)),1),e.excerpt?(i(),t(`div`,S,s(e.excerpt),1)):c(``,!0),f(`div`,C,s(e.time),1)]),e.read?c(``,!0):(i(),t(`span`,w))],10,y))),128)),E.items.length?c(``,!0):(i(),t(`div`,T,[...n[1]||=[f(`div`,{class:`text-3xl`},`🎉`,-1),f(`p`,{class:`mt-2 text-sm`},`No notifications yet — you're all caught up.`,-1)]]))])])]),_:1})],64))}});export{E as default};