import{r as l,o as S,a as E,w as d,b as _,t as u,g as r,h as m,i as N,k as b,c as L}from"./style-DABnmfbE.chunk.mjs";import{t as a,_ as I,a as A,N as v,c as D,g as M,b as V,s as w,l as y}from"./_plugin-vue_export-helper-BtY0Ms9R.chunk.mjs";import{N as O}from"./NcSettingsSection-EAR0ylbd-ewiV29-M.chunk.mjs";const s={EMAIL_SEND_OFF:0,EMAIL_SEND_HOURLY:1,EMAIL_SEND_3HOURLY:2,EMAIL_SEND_DAILY:3,EMAIL_SEND_WEEKLY:4},p=[{label:a("notifications","Never"),value:s.EMAIL_SEND_OFF},{label:a("notifications","1 hour"),value:s.EMAIL_SEND_HOURLY},{label:a("notifications","3 hours"),value:s.EMAIL_SEND_3HOURLY},{label:a("notifications","1 day"),value:s.EMAIL_SEND_DAILY},{label:a("notifications","1 week"),value:s.EMAIL_SEND_WEEKLY}],T={name:"AdminSettings",components:{NcSelect:v,NcCheckboxRadioSwitch:A,NcSettingsSection:O},setup(){const t=N(y("notifications","config",{})),e=b({get(){return p.find(({value:c})=>c===t.setting_batchtime)},set({value:c}){t.setting_batchtime=c}});return{BATCHTIME_OPTIONS:p,config:t,currentBatchTime:e}},methods:{t:a,async updateSettings(){try{const t=new FormData;t.append("batchSetting",this.config.setting_batchtime),t.append("soundNotification",this.config.sound_notification?"yes":"no"),t.append("soundTalk",this.config.sound_talk?"yes":"no"),await D.post(M("apps/notifications/api/v2/settings/admin"),t),V(a("notifications","Your settings have been updated."))}catch(t){w(a("notifications","An error occurred while updating your settings.")),console.error(t)}}}},U={class:"notification-frequency__wrapper"},k={for:"notification_reminder_batchtime",class:"notification-frequency__label"};function Y(t,e,c,n,B,i){const g=l("NcSelect"),f=l("NcCheckboxRadioSwitch"),h=l("NcSettingsSection");return S(),E(h,{name:i.t("notifications","Notifications defaults"),description:i.t("notifications","Configure the default notification settings")},{default:d(()=>[_("div",U,[_("label",k,u(i.t("notifications","Send email reminders about unhandled notifications after:")),1),r(g,{id:"notification_reminder_batchtime",modelValue:n.currentBatchTime,"onUpdate:modelValue":[e[0]||(e[0]=o=>n.currentBatchTime=o),i.updateSettings],class:"notification-frequency__select",clearable:!1,labelOutside:"",options:n.BATCHTIME_OPTIONS},null,8,["modelValue","options","onUpdate:modelValue"])]),r(f,{modelValue:n.config.sound_notification,"onUpdate:modelValue":[e[1]||(e[1]=o=>n.config.sound_notification=o),i.updateSettings]},{default:d(()=>[m(u(i.t("notifications","Play sound when a new notification arrives")),1)]),_:1},8,["modelValue","onUpdate:modelValue"]),r(f,{modelValue:n.config.sound_talk,"onUpdate:modelValue":[e[2]||(e[2]=o=>n.config.sound_talk=o),i.updateSettings]},{default:d(()=>[m(u(i.t("notifications","Play sound when a call started (requires Nextcloud Talk)")),1)]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:1},8,["name","description"])}const R=I(T,[["render",Y],["__scopeId","data-v-bd271168"]]);L(R).mount("#notifications-admin-settings");
//# sourceMappingURL=notifications-admin-settings.mjs.map
