import{br as c,A as l,c as n,ct as u}from"./index.cf09daef.js";const d=c("notification",{state:()=>({rows:[],permissions:{}}),getters:{module:a=>({name:"Notifications",label:a.$t("label.notifications"),singular:a.$t("singular.notification"),plural:a.$t("plural.notifications")}),columns:a=>[{name:"label",align:"left",label:a.$t("label.label"),field:"label",sortable:!0},{name:"type",align:"left",label:a.$t("label.type"),field:"type",sortable:!0},{name:"default",align:"center",label:a.$t("label.default"),field:"is_default"},{name:"actions",align:"right"}],actions:a=>[{label:a.$t("label.edit"),action:"route",route:"Notification",params:i=>({id:i.id}),query:i=>({action:"edit"}),icon:"fas fa-edit",deleted:!1},{label:a.$t("label.duplicate"),action:a.duplicate,icon:"fas fa-copy",deleted:!1},{label:a.$t("label.markAsDefault"),condition:i=>!i.is_default,action:a.markAsDefault,icon:"fas fa-star",deleted:!1},{label:a.$t("label.delete"),action:"delete",icon:"fas fa-trash-alt",deleted:!1},{label:a.$t("label.restore"),action:"restore",icon:"fas fa-trash-undo",deleted:!0}],toolbar:a=>[{icon:"fal fa-plus-circle",label:a.$t("label.addTemplate"),action:"route",params:{id:"add"},route:"Notification",color:"primary",deleted:"all"}],types:a=>[{label:a.$t("label.invoiceSent"),value:"user:invoice-sent"},{label:a.$t("label.signup"),value:"user:singup"},{label:a.$t("label.subscriptionCancel"),value:"user:subscription-cancel"},{label:a.$t("label.subscriptionCanceled"),value:"user:subscription-canceled"},{label:a.$t("label.subscriptionDowngrade"),value:"user:subscription-downgrade"},{label:a.$t("label.subscriptionExpired"),value:"user:subscription-expired"},{label:a.$t("label.subscriptionUpgraded"),value:"user:subscription-upgraded"},{label:a.$t("label.enquiryNotification"),value:"user:enquiry-notification"},{label:a.$t("label.enquiryConfirmation"),value:"user:enquiry-confirmation"},{label:a.$t("label.AdminSubscriptionExpired"),value:"admin:subscription-expired"},{label:a.$t("label.AdminSubscriptionCancel"),value:"admin:subscription-cancel"},{label:a.$t("label.AdminHoldRelease"),value:"admin:hold-release"},{label:a.$t("label.AdminTaskUserNotification"),value:"admin:task-user-notification"},{label:a.$t("label.AdminEnquiryNotification"),value:"admin:enquiry-notification"},{label:a.$t("label.AdminContactUsNotification"),value:"admin:contact-us-notification"},{label:a.$t("label.AdminMemberStatusUpdate"),value:"admin:member-status-update"},{label:a.$t("label.AdminMemberAvatarUpdate"),value:"admin:member-avatar-update"},{label:a.$t("label.bookingConfirmedNotification"),value:"user:booking-confirmed"},{label:a.$t("label.bookingStandbyConfirmedNotification"),value:"user:booking-standby-confirmed"},{label:a.$t("label.bookingStandbyNotification"),value:"user:booking-standby"},{label:a.$t("label.bookingCanceledNotification"),value:"user:booking-canceled"},{label:a.$t("label.AdminNewStaffWelcome"),value:"admin:new-account"},{label:a.$t("PushWhatsappBookingConfirmedNotification"),value:"push:booking-confirmed"},{label:a.$t("PushWhatsappBookingStandbyConfirmedNotification"),value:"push:booking-standby-confirmed"},{label:a.$t("PushWhatsappBookingStandbyNotification"),value:"push:booking-standby"},{label:a.$t("PushWhatsappBookingCanceledNotification"),value:"push:booking-canceled"},{label:a.$t("PushWhatsappUpcomingClassNotification"),value:"push:upcoming-class"}]},actions:{get(a){return new Promise((i,t)=>{l.get("settings/notifications",a).then(e=>{this.rows=e.data,i(e)}).catch(e=>{t(e)})})},store(a){return new Promise((i,t)=>{l.post("settings/notifications/store",a).then(e=>{i(e)}).catch(e=>{t(e)})})},show(a){return new Promise((i,t)=>{l.get(`settings/notifications/${a}`).then(e=>{i(e)}).catch(e=>{t(e)})})},update(a){return new Promise((i,t)=>{l.put(`settings/notifications/${a.id}`,a).then(e=>{i(e)}).catch(e=>{t(e)})})},delete(a){return new Promise((i,t)=>{l.delete(`settings/notifications/${a}/destroy`).then(e=>{i(e)}).catch(e=>{t(e)})})},markAsDefault(a){return new Promise((i,t)=>{l.post(`settings/notifications/${a.id}/mark-as-default`).then(e=>{const{message:o,data:s}=e;a.is_default=s.is_default,n.success(o),i(e)}).catch(e=>{n.error(e),t(e)})})},duplicate(a){return new Promise((i,t)=>{l.post(`settings/notifications/${a.id}/duplicate`).then(e=>{const{message:o,data:s}=e;n.success(o),u.push({name:"Notification",params:{id:s.id},query:{action:"edit"}}),i(e)}).catch(e=>{n.error(e),t(e)})})}}});export{d as u};
