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