import{K as W,Z as A,C as D,av as H,S as s,L as d,M as a,U as p,V as i,T as o,X as r,P as m,a7 as _,W as l,b as e,az as O,N as x,O as R}from"./vendor-bSWkQivH.js";import{i as j,q as w}from"./index-Dqv5IkpS.js";import{_ as q}from"./push-message.vue_vue_type_script_setup_true_lang-BSEZ4noP.js";import{u as F}from"./usePushMessages-b-iMv3M4.js";import"./index-CAMXIOZf.js";import"./types-zo7pMMkl.js";const G={class:"!block"},K={class:"flex items-start justify-between gap-3"},X={class:"mt-4 lg:mt-5"},Z={key:1,class:"p-3 lg:p-6"},J={class:"divide-y rounded border empty:hidden"},Q={key:0,class:"my-3 text-center"},ie=W({__name:"notifications",setup(Y){const{t:v}=A(),c=D("showUnreadOnly_pushMessages_history",!1);H(c,M);const{items:g,markReadAll:b,markUnreadAll:C,totalCount:$,unreadCountWithHidden:h,loading:B,pages:V,page:u}=F({showUnreadOnly:c,withHidden:!0});j({title:v("push_messages.title")});function M(){f(1)}function f(t){u.value=t,window.scroll({top:0,behavior:"smooth"})}return(t,y)=>{const P=s("VcBadge"),U=s("VcTypography"),z=s("VcButton"),k=s("VcMenuItem"),I=s("VcDropdownMenu"),N=s("VcSwitch"),S=s("VcEmptyView"),T=s("VcPagination"),E=s("VcWidget");return a(),d("div",G,[p("div",K,[i(U,{tag:"h1",class:"flex items-center gap-2"},{default:o(()=>[r(l(t.$t("push_messages.title"))+" ",1),e(h)>0?(a(),m(P,{key:0,variant:"outline",size:"lg",rounded:""},{default:o(()=>[r(l(e(h)),1)]),_:1})):_("",!0)]),_:1}),i(I,{placement:"bottom-end",width:"max-content"},{trigger:o(()=>[i(z,{"aria-label":t.$t("common.buttons.toggle_dropdown"),icon:"dots-vertical",variant:"outline",size:"sm"},null,8,["aria-label"])]),content:o(({close:n})=>[i(k,{onClick:L=>{n(),e(b)()}},{default:o(()=>[r(l(t.$t("push_messages.options.make_all_as_read")),1)]),_:2},1032,["onClick"]),i(k,{onClick:L=>{n(),e(C)()}},{default:o(()=>[r(l(t.$t("push_messages.options.make_all_as_unread")),1)]),_:2},1032,["onClick"])]),_:1})]),p("div",X,[i(N,{modelValue:e(c),"onUpdate:modelValue":y[0]||(y[0]=n=>O(c)?c.value=n:null),"aria-label":t.$t("push_messages.show_unread_only"),"label-position":"right"},{default:o(()=>[r(l(t.$t("push_messages.show_unread_only")),1)]),_:1},8,["modelValue","aria-label"])]),i(E,{size:"lg",class:"mt-4 lg:mt-5"},{"default-container":o(()=>[e($)===0&&!e(B)?(a(),m(S,{key:0,text:t.$t("push_messages.empty_list"),icon:"outline-notifications"},null,8,["text"])):(a(),d("div",Z,[p("div",J,[(a(!0),d(x,null,R(e(g),n=>(a(),m(q,{key:n.id,size:"lg",class:"first:rounded-t last:rounded-b","push-message":n},null,8,["push-message"]))),128))]),e(u)>=e(w)?(a(),d("p",Q,l(t.$t("reach_limit.page_limit")),1)):_("",!0),e(g).length&&e(V)>1?(a(),m(T,{key:1,page:e(u),pages:Math.min(e(V),e(w)),class:"mt-6","onUpdate:page":f},null,8,["page","pages"])):_("",!0)]))]),_:1})])}}});export{ie as default};
//# sourceMappingURL=notifications-B7leSHG9.js.map
