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