1import{u as X,z as Y,aa as Z,A as ee,l as te,a9 as se,ab as ae,o,b as p,d as l,t as n,g as t,c as x,w as u,h as m,s as oe,C as g,e as f,F as _,v as ne,r as le,n as h,x as A,a8 as ie,G as ce}from"./B0mNtK3X.js";import{_ as re}from"./D1nMKFsg.js";import{u as de,_ as ue}from"./CkhDQqH9.js";import{u as me}from"./6OkFRQbn.js";import{u as pe}from"./CA4hkb76.js";import{d as fe}from"./D84-0CRA.js";import{g as ve}from"./C4mqEALe.js";import"./32Bqtcn_.js";import"./CYkDGJwY.js";import"./WsjsyaGz.js";import"./qCwQHWlQ.js";import"./BEP62XWZ.js";import"./Dlp581so.js";import"./BN1ohDtG.js";import"./N6vRbo-F.js";import"./DMRyVoyL.js";import"./DI8I9sse.js";import"./Cp4VHxXp.js";import"./D1A-3Aho.js";const ye={class:"p-6 pb-[var(--dashboard-padding-y)] mo-dashboard-panel-inner"},xe={class:"w-full flex flex-col min-desktop-menu:sticky min-desktop-menu:top-0 min-desktop-menu:z-[3]"},ge={class:"mb-2 mo-dashboard-title-section mo-set-custom-mb flex items-center justify-between gap-x-4 gap-y-3 relative! top-auto! flex-wrap"},be={class:"text-[40px] max-md:text-[36px] mo-title-section-heading text-secondary-700 font-bold"},he={class:"ml-auto flex items-center gap-x-1.5 gap-y-2 flex-wrap justify-end mt-2"},_e={key:0,class:"mb-0 w-full mo-dashboard-panel-content bg-cream-100 pb-0.5"},ke={class:"flex items-center gap-x-2 gap-y-1.5 flex-wrap rounded-xl bg-secondary-50 ring-1 ring-secondary-200 px-3 py-2"},we={class:"text-sm font-medium text-secondary-700 tabular-nums"},$e={class:"flex items-center gap-2 flex-wrap"},Ce={class:"text-[13px] text-secondary-600"},ze={class:"w-full mo-dashboard-panel-content pt-2!"},Ae={class:"flex flex-col gap-3"},Me={key:0,class:"px-4 py-12 text-center text-sm text-secondary-500"},Ke={__name:"index",setup(Re){const{t:v}=X(),M=Y(),{rawItems:k,loading:R,unreadCount:V,fetch:B,markRead:N,markAllRead:S,dismiss:T,restore:I,dismissMany:P,dismissAll:U,restoreMany:j,remove:D,removeMany:E}=de(),w=Z(),{members:$,fetchMembers:F}=me();ee(()=>{B(),$.value.length||F()});const d=A("all"),H=h(()=>[{value:"all",label:v("agency.notifications.filter.all")},{value:"unread",label:v("agency.notifications.filter.unread")},{value:"archived",label:v("agency.notifications.filter.archived")}]),b=h(()=>{const e=k.value;return d.value==="unread"?e.filter(s=>s.status==="unread"):d.value==="archived"?e.filter(s=>s.status==="archived"):e.filter(s=>s.status!=="archived")}),C=h(()=>d.value==="archived"),L=h(()=>k.value.filter(e=>e.status!=="archived").length),a=pe(()=>b.value.map(e=>e.id)),i=A(!1);te(d,()=>{i.value=!1});async function G(){const e=[...a.selected.value];e.length&&(await P(e),a.stop())}async function O(){const e=[...a.selected.value];e.length&&(await j(e),a.stop())}async function z(){const e=[...a.selected.value];if(e.length){try{await E(e)}catch(s){w.add({class:"mo-toast",title:v("common.error"),description:s?.message,color:"error"})}i.value=!1,a.stop()}}fe({enter:{handler:()=>{i.value&&z()}},escape:{usingInput:!0,handler:()=>{i.value?i.value=!1:a.active.value&&a.stop()}}});async function W(e){try{await D(e.id)}catch(s){w.add({class:"mo-toast",title:v("common.error"),description:s?.message,color:"error"})}}async function q(e){await N(e.id);const s=ie(e,M);s&&ce(s)}const J=se();return ae(ve(J.name,!1)),(e,s)=>{const c=oe,K=re,Q=ue;return o(),p("div",ye,[l("div",xe,[l("div",ge,[l("h1",be,n(e.$t("agency.notifications.all_title")),1),l("div",he,[t(b).length?(o(),x(c,{key:0,size:"sm",color:"secondary",variant:t(a).active.value?"solid":"ghost",icon:"mosy:list-check",class:"text-[14px]! px-3! py-1.5!",onClick:s[0]||(s[0]=r=>{t(a).toggleMode(),i.value=!1})},{default:u(()=>[m(n(t(a).active.value?e.$t("common.cancel"):e.$t("common.select")),1)]),_:1},8,["variant"])):g("",!0),t(V)>0&&!t(a).active.value?(o(),x(c,{key:1,size:"sm",color:"secondary",variant:"subtle",class:"text-[14px]! px-3! py-1.5!",onClick:t(S)},{default:u(()=>[m(n(e.$t("agency.notifications.mark_all_read")),1)]),_:1},8,["onClick"])):g("",!0),t(L)>0&&!t(C)&&!t(a).active.value?(o(),x(c,{key:2,size:"sm",color:"secondary",variant:"subtle",icon:"mosy:box-open",class:"text-[14px]! px-3! py-1.5!",onClick:t(U)},{default:u(()=>[m(n(e.$t("agency.notifications.archive_all")),1)]),_:1},8,["onClick"])):g("",!0)])]),t(a).active.value?(o(),p("div",_e,[l("div",ke,[l("span",we,n(e.$t("agency.notifications.selected_count",{count:t(a).count.value})),1),f(c,{size:"xs",color:"secondary",variant:"ghost",onClick:s[1]||(s[1]=r=>t(a).toggleAll()),class:"mr-auto text-[14px]! px-3! py-1.5!"},{default:u(()=>[m(n(t(a).allSelected.value?e.$t("agency.notifications.deselect_all"):e.$t("agency.notifications.select_all")),1)]),_:1}),l("div",$e,[t(C)?t(i)?(o(),p(_,{key:1},[l("span",Ce,n(e.$t("agency.notifications.delete_confirm_many",{count:t(a).count.value})),1),f(c,{size:"xs",color:"error",variant:"soft",icon:"i-lucide-check",class:"text-[14px]! px-3! py-1.5!",onClick:z}),f(c,{size:"xs",color:"secondary",variant:"subtle",icon:"i-lucide-x",class:"text-[14px]! px-3! py-1.5!",onClick:s[2]||(s[2]=r=>i.value=!1)})],64)):(o(),p(_,{key:2},[f(c,{size:"xs",class:"text-[14px]! px-3! py-1.5!",color:"secondary",variant:"subtle",icon:"mosy:arrow-rotate-left",disabled:!t(a).count.value,onClick:O},{default:u(()=>[m(n(e.$t("agency.notifications.restore_selected")),1)]),_:1},8,["disabled"]),f(c,{size:"xs",class:"text-[14px]! px-3! py-1.5!",color:"error",variant:"subtle",icon:"mosy:trash",disabled:!t(a).count.value,onClick:s[3]||(s[3]=r=>i.value=!0)},{default:u(()=>[m(n(e.$t("agency.notifications.delete_selected")),1)]),_:1},8,["disabled"])],64)):(o(),x(c,{key:0,size:"xs",class:"text-[14px]! px-3! py-1.5!",color:"secondary",variant:"subtle",icon:"mosy:box-open",disabled:!t(a).count.value,onClick:G},{default:u(()=>[m(n(e.$t("agency.notifications.archive_selected")),1)]),_:1},8,["disabled"]))])])])):g("",!0),f(K,{modelValue:t(d),"onUpdate:modelValue":s[4]||(s[4]=r=>ne(d)?d.value=r:null),items:t(H),color:"secondary",class:"w-full mo-settings-tabs mo-tabs mo-tabs-page-scroll mb-0 pb-6 mo-dashboard-panel-content"},null,8,["modelValue","items"])]),l("div",ze,[l("div",Ae,[!t(b).length&&!t(R)?(o(),p("p",Me,n(e.$t("agency.notifications.empty")),1)):g("",!0),(o(!0),p(_,null,le(t(b),r=>(o(),x(Q,{key:r.id,n:r,members:t($),selectable:t(a).active.value,selected:t(a).isSelected(r.id),onSelect:q,onToggle:s[5]||(s[5]=y=>t(a).toggle(y.id)),onDismiss:s[6]||(s[6]=y=>t(T)(y.id)),onRestore:s[7]||(s[7]=y=>t(I)(y.id)),onRemove:W},null,8,["n","members","selectable","selected"]))),128))])])])}}};export{Ke as default};
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.