import{a as H,V as R,S as d}from"./virtual-akr7sWHM.js";import{f as X,d as f,i as a,P as A,a4 as B,a as _,ba as E,c as I}from"./app-JmgyQoR0.js";import{X as w}from"./MkNotifications-v0_g-x04.js";import{X as y}from"./MkNotes-Z5KXbZLG.js";import{b as L,a as v,w as V,c as u,D as b,h as W,i as z,j as o,l as e,z as i}from"./vue-y3KLWBaS.js";import"./MkPagination-urywMrXv.js";import"./MkNotification-CZxoNE6o.js";import"./MkReactionIcon.vue_vue_type_script_setup_true_lang-MnLL2GJr.js";import"./get-note-summary-7eDLQp-L.js";import"./MkDateSeparatedList.vue_vue_type_style_index_0_lang-bpwwzSpi.js";import"./MkNote-Y7yPCL5J.js";import"./MkReactionsViewer-iZKN4Via.js";import"./share-available-LNRVMfAE.js";const k=500,ae=L({__name:"notifications",setup(j){const p=["all","unread","mentions","directNotes"];let t=v(p[0]);V(t,()=>g(p.indexOf(t.value)));let l=v(null);u(()=>t.value==="unread"),X("notifications/mark-all-as-read");const S=v(f==="smartphone"||window.innerWidth<=k);window.addEventListener("resize",()=>{S.value=f==="smartphone"||window.innerWidth<=k});const x={endpoint:"notes/mentions",limit:10},M={endpoint:"notes/mentions",limit:10,params:{visibility:"specified"}};function N(n){var c;const s=E.notificationTypes.map(r=>({text:a.t(`_notification._types.${r}`),active:l.value&&l.value.includes(r),action:()=>{l.value=[r]}})),h=l.value!=null?[{icon:"ph-x ph-bold ph-lg",text:a.ts.clear,action:()=>{l.value=null}},null,...s]:s;I(h,(c=n.currentTarget)!=null?c:n.target)}const C=u(()=>[t.value==="all"?{text:a.ts.filter,icon:"ph-funnel ph-bold ph-lg",highlighted:l.value!=null,handler:N}:void 0,t.value==="all"?{text:a.ts.markAllAsRead,icon:"ph-checks ph-bold ph-lg",handler:()=>{A("notifications/mark-all-as-read")}}:void 0].filter(n=>n!==void 0)),O=u(()=>[{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"}]);B(u(()=>({title:a.ts.notifications,icon:"ph-bell ph-bold ph-lg"})));let m=null;function P(n){m=n,g(p.indexOf(t.value))}function T(){t.value=p[m.activeIndex]}function g(n){m.slideTo(n)}return(n,s)=>{const h=b("MkPageHeader"),c=b("MkSpacer"),r=b("MkStickyContainer");return W(),z(r,null,{header:o(()=>[e(h,{tab:t.value,"onUpdate:tab":s[0]||(s[0]=D=>t.value=D),actions:C.value,tabs:O.value,"display-my-avatar":!0},null,8,["tab","actions","tabs"])]),default:o(()=>[e(c,{"content-max":800},{default:o(()=>[e(i(H),{"round-lengths":!0,"touch-angle":25,threshold:10,centeredSlides:!0,modules:[i(R)],"space-between":20,virtual:!0,"allow-touch-move":i(_).state.swipeOnMobile&&(i(f)!=="desktop"||i(_).state.swipeOnDesktop),onSwiper:P,onSlideChange:T},{default:o(()=>[e(i(d),null,{default:o(()=>[e(w,{class:"notifications","include-types":l.value,"unread-only":!1},null,8,["include-types"])]),_:1}),e(i(d),null,{default:o(()=>[e(w,{class:"notifications","include-types":l.value,"unread-only":!0},null,8,["include-types"])]),_:1}),e(i(d),null,{default:o(()=>[e(y,{pagination:x})]),_:1}),e(i(d),null,{default:o(()=>[e(y,{pagination:M})]),_:1})]),_:1},8,["modules","allow-touch-move"])]),_:1})]),_:1})}}});export{ae as default};
