const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["MkNotificationSettingWindow-Dp4RCmWc.js","app-QjDgb7aF.js","vue-Cm77DuTi.js","charts-3gEHPHRq.js","media-DuCIZ-3n.js","app-CV_aoXZ3.css"])))=>i.map(i=>d[i]);
import{aA as T,b as t,M as f,d as p,b4 as _,$ as g,a as C,P as h,l as S}from"./app-QjDgb7aF.js";import{F as k}from"./section-Dbg05qO2.js";import{_ as P}from"./MkPushNotificationAllowButton.vue_vue_type_script_setup_true_lang-DvaRqget.js";import{b as x,E as m,j as F,p as I,k as s,i as e,J as i,D as n,u as a,q as v,z as E,f as y,d as V}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const D={class:"_formRoot"},L={class:"_gaps_m"},O=x({__name:"notifications",setup(U){let c=E(),r=y(()=>c.value?.pushRegistrationInServer),M=y(()=>r.value?.sendReadMessage||!1);async function N(){await p("i/read-all-unread-notes")}async function R(){await p("i/read-all-messaging-messages")}async function b(){await p("notifications/mark-all-as-read")}function w(){const d=_.notificationTypes.filter(o=>!g.mutingNotificationTypes.includes(o));C(V(()=>S(()=>import("./MkNotificationSettingWindow-Dp4RCmWc.js"),__vite__mapDeps([0,1,2,3,4,5]))),{includingTypes:d,showGlobalToggle:!1},{done:async o=>{const{includingTypes:u}=o;await h("i/update",{mutingNotificationTypes:_.notificationTypes.filter(l=>!u.includes(l))}).then(l=>{g.mutingNotificationTypes=l.mutingNotificationTypes})}},"closed")}function A(d){r.value&&h("sw/update-registration",{endpoint:r.value.endpoint,sendReadMessage:d}).then(o=>{c.value&&(c.value.pushRegistrationInServer=o)})}return T({title:t.ts.notifications,icon:"ph-bell ph-bold ph-lg"}),(d,o)=>{const u=m("ForFormButtonmLink"),l=m("I18n"),B=m("MkSwitch");return F(),I("div",D,[s(f,{class:"_formBlock",onClick:w},{icon:e(()=>[...o[0]||(o[0]=[v("i",{class:"ph-gear-six ph-bold ph-lg"},null,-1)])]),default:e(()=>[i(n(a(t).ts.notificationSetting),1)]),_:1}),s(k,null,{default:e(()=>[s(u,{class:"_formBlock",onClick:b},{default:e(()=>[i(n(a(t).ts.markAsReadAllNotifications),1)]),_:1}),s(f,{class:"_formBlock",onClick:N},{default:e(()=>[i(n(a(t).ts.markAsReadAllUnreadNotes),1)]),_:1}),s(f,{class:"_formBlock",onClick:R},{default:e(()=>[i(n(a(t).ts.markAsReadAllTalkMessages),1)]),_:1})]),_:1}),s(k,null,{label:e(()=>[i(n(a(t).ts.pushNotification),1)]),default:e(()=>[v("div",L,[s(P,{ref_key:"allowButton",ref:c},null,512),s(B,{disabled:!a(r),"model-value":a(M),"onUpdate:modelValue":A},{label:e(()=>[i(n(a(t).ts.sendPushNotificationReadMessage),1)]),caption:e(()=>[s(l,{src:a(t).ts.sendPushNotificationReadMessageCaption},{emptyPushNotificationMessage:e(()=>[i(n(a(t).ts._notification.emptyPushNotificationMessage),1)]),_:1},8,["src"])]),_:1},8,["disabled","model-value"])])]),_:1})])}}});export{O as default};
//# sourceMappingURL=notifications-C_-iXq8B.js.map
