import{S as R,V as A,a as c}from"./virtual-BQH0NzJY.js";import{d as H,t as m,aA as I,b as a,v as _,P as X,b4 as B,f as D}from"./app-QjDgb7aF.js";import{X as k}from"./MkNotifications-3MvKmBnV.js";import{X as w}from"./MkNotes-DrVlMmnc.js";import{b as L,w as V,f as h,E as f,j as W,g as j,i as l,k as t,u as e,I as z,a as v}from"./vue-Cm77DuTi.js";import"./media-DuCIZ-3n.js";import"./charts-3gEHPHRq.js";import"./MkPagination-DzUgufpZ.js";import"./MkNotification-DuBjKjip.js";import"./MkReactionIcon.vue_vue_type_script_setup_true_lang-D23mNn1N.js";import"./get-note-summary-DlGmePWF.js";import"./MkDateSeparatedList.vue_vue_type_style_index_0_lang-87CjANkN.js";import"./MkNote-RPFbRjy2.js";import"./MkReactionsViewer-D75lmVQ0.js";import"./share-available-Drgr3YiT.js";const y=500,le=L({__name:"notifications",setup(F){const p=["all","unread","mentions","directNotes"];let n=v(p[0]);V(n,()=>b(p.indexOf(n.value)));let o=v(null);H("notifications/mark-all-as-read");const S=v(m==="smartphone"||window.innerWidth<=y);window.addEventListener("resize",()=>{S.value=m==="smartphone"||window.innerWidth<=y});const x={endpoint:"notes/mentions",limit:10},M={endpoint:"notes/mentions",limit:10,params:{visibility:"specified"}};function N(i){const s=B.notificationTypes.map(r=>({text:a.t(`_notification._types.${r}`),active:o.value&&o.value.includes(r),action:()=>{o.value=[r]}})),u=o.value!=null?[{icon:"ph-x ph-bold ph-lg",text:a.ts.clear,action:()=>{o.value=null}},null,...s]:s;D(u,i.currentTarget??i.target)}const C=h(()=>[n.value==="all"?{text:a.ts.filter,icon:"ph-funnel ph-bold ph-lg",highlighted:o.value!=null,handler:N}:void 0,n.value==="all"?{text:a.ts.markAllAsRead,icon:"ph-checks ph-bold ph-lg",handler:()=>{X("notifications/mark-all-as-read")}}:void 0].filter(i=>i!==void 0)),O=h(()=>[{key:"all",title:a.ts.all,icon:"ph-bell ph-bold ph-lg"},{key:"unread",title:a.ts.unread,icon:"ph-circle-wavy-warning ph-bold ph-lg"},{key:"mentions",title:a.ts.mentions,icon:"ph-at ph-bold ph-lg"},{key:"directNotes",title:a.ts.directNotes,icon:"ph-envelope-simple-open ph-bold ph-lg"}]);I(h(()=>({title:a.ts.notifications,icon:"ph-bell ph-bold ph-lg"})));let d=null;function P(i){d=i,b(p.indexOf(n.value))}function T(){n.value=p[d.activeIndex]}function b(i){d.slideTo(i)}return(i,s)=>{const u=f("MkPageHeader"),r=f("MkSpacer"),E=f("MkStickyContainer");return W(),j(E,null,{header:l(()=>[t(u,{tab:e(n),"onUpdate:tab":s[0]||(s[0]=g=>z(n)?n.value=g:n=g),actions:C.value,tabs:O.value,"display-my-avatar":!0},null,8,["tab","actions","tabs"])]),default:l(()=>[t(r,{"content-max":800},{default:l(()=>[t(e(R),{"round-lengths":!0,"touch-angle":25,threshold:10,centeredSlides:!0,modules:[e(A)],"space-between":20,virtual:!0,"allow-touch-move":e(_).state.swipeOnMobile&&(e(m)!=="desktop"||e(_).state.swipeOnDesktop),onSwiper:P,onSlideChange:T},{default:l(()=>[t(e(c),null,{default:l(()=>[t(k,{class:"notifications","include-types":e(o),"unread-only":!1},null,8,["include-types"])]),_:1}),t(e(c),null,{default:l(()=>[t(k,{class:"notifications","include-types":e(o),"unread-only":!0},null,8,["include-types"])]),_:1}),t(e(c),null,{default:l(()=>[t(w,{pagination:x})]),_:1}),t(e(c),null,{default:l(()=>[t(w,{pagination:M})]),_:1})]),_:1},8,["modules","allow-touch-move"])]),_:1})]),_:1})}}});export{le as default};
//# sourceMappingURL=notifications-eUSsmUqO.js.map
