1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["chunks/jF4qFIwQaT__7dxHe21ba.js","chunks/DGrbOkrFsn0voVzUoWkxi-1790053513351.js","chunks/CEJF4ony9ueqNCi2M6J1k.css","chunks/G_z35mcMeQsIItbNAJgAg.js","chunks/DPJ7h9PqjeZidCo-dyIq2.js","chunks/CAlDl-t9KIXhShkTGkOTU.js","chunks/BGQAmzKgfynu_hFP8PeJU.js","chunks/BlJKh-8YOTBJNiytaT99r.js","chunks/VbM5slOhwXN5vcu6CbcqM.js","chunks/DBsb93C8zHqJJ80J3pIP4.js","chunks/TVEp-sIGOVa4FO0KN_CZ8.js","chunks/CDghZ3zq_OeaCsbs4-ntQ.js","chunks/Ca0MFHNQvh_T_pHRCq1xc.js","chunks/BEoFKgXucDLR2AU5eTxUf.js"])))=>i.map(i=>d[i]); 2import{r as e,u as t,a as s,i as a,S as i,j as o,P as n,T as l,_ as c,t as r}from"./DGrbOkrFsn0voVzUoWkxi-1790053513351.js";import{u as d}from"./G_z35mcMeQsIItbNAJgAg.js";import{f as m}from"./C0VscXY0q_hXYqQxArNlG.js";import"./GM7h-BAS7l37-geROCDvC.js";import u from"./CVUX0FKZTmG_lNrUkIt3I.js";import"./BfzzDmt2RiLmJZVfcg9BD.js";import"./CHSiLyzyFXCI1vlnTHxLQ.js";import"./BHR_E30JFALbpiL80jiU2.js";import"./BlrroQs9l0thMZABoksCJ.js";import"./BL9dUyJlbPDUW1dvFHbSh.js";import"./Cwc5Fkf4CO55m2V60HDn6.js";/* empty css */import"./B5fb8ITR-4qV4a5gN_vIP.js";/* empty css *//* empty css */const f=e.lazy(()=>c(()=>import("./jF4qFIwQaT__7dxHe21ba.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),p=e.lazy(()=>c(()=>import("./BlJKh-8YOTBJNiytaT99r.js"),__vite__mapDeps([7,1,2,8,9]))),j=e.lazy(()=>c(()=>import("./TVEp-sIGOVa4FO0KN_CZ8.js"),__vite__mapDeps([10,1,2,3]))),_=e.lazy(()=>c(()=>import("./CDghZ3zq_OeaCsbs4-ntQ.js"),__vite__mapDeps([11,1,2,12]))),y=e.lazy(()=>c(()=>import("./BEoFKgXucDLR2AU5eTxUf.js"),__vite__mapDeps([13,1,2,9]))),h=()=>{const[c,h]=e.useState([]),[x,b]=e.useState(null),[E,S]=e.useState(!1),[g,w]=e.useState(!0),[T,N]=e.useState(!1),[A,M]=e.useState(!1),[O,I]=e.useState(null),[C,D]=e.useState(),[P,v]=e.useState(1),[L,R]=e.useState(!1),[V,B]=e.useState(""),[k,z]=e.useState(!1),{store:F}=t(),{emitSocket:$}=s(),{control:G,handleSubmit:U,reset:K,setValue:W}=d();e.useEffect(()=>{Y()},[]);const Y=async(e=!1)=>{try{if(E)return;S(!0);const t={search:V,skip:20*((e?P:1)-1),limit:20},{data:s}=await a.get(i,"notification",t);e?(h(e=>[...e,...s.data]),v(e=>e+1)):(h(s.data),v(2)),w(20===s?.data?.length)}catch(t){}finally{S(!1)}},Q=e=>{b(e),z(!0)};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sc-cstm-section-sm sc-copy-table",children:o.jsx(u,{id:"VIEW_MESSAGES",className:"sc-scroll-height ps-3 pe-3",list:c,itemKey:(e,t)=>`${e.id}-${t}`,loader:E,hasMore:g,next:()=>Y(!0),title:"Messages",subtitle:"View and manage your messages",countLabel:`${c.length} ${1===c.length?" MESSAGE":"MESSAGES"}`,toolbarActions:o.jsx(l,{message:"Add Message",position:"bottom",children:o.jsx("button",{type:"button",className:"icon-btn-lg icon-btn-primary-light",onClick:()=>z(!0),children:o.jsx("i",{className:"ri-add-line"})})}),renderRow:e=>({TITLE:o.jsx("span",{className:"fee-row__student-name",children:e.notification_name||"Untitled Title"}),MESSAGE:n(e.message)||"Untitled Message",DATE:m(e.current_date),TO:e.notify,FOR:e.notification_for,NOTIFIED:"1"==e.isactive?"Yes":"No",ACTIONS:o.jsx(_,{item:e,actions:[{label:"Notify",icon:"ri-notification-3-line",handler:e=>{N(!0),D(e)}},{label:"Edit",icon:"ri-edit-line",handler:Q},{label:"Delete",icon:"ri-delete-bin-line",handler:e=>{M(!0),I(e)}}]})})})}),k&&o.jsx(p,{size:"modal-lg",show:k,title:x?"Edit Message":"Add Message",onClose:()=>{z(!1),b(null)},showFooter:!1,modalBody:o.jsx(f,{onClose:()=>{z(!1),b(null)},onAddMessage:x?async e=>{try{e.id=x.id,e.added_by=F.user.id,e.updated_by=F.user.id,(await a.put(i,"notification",e)).success&&Y()}catch(t){}}:async e=>{try{await a.post(i,"notification",e),h(t=>[...t,e]),Y()}catch(t){}},messageToEdit:x})}),o.jsx(p,{show:T,title:"Notify",onClose:()=>{N(!1),D("")},onConfirm:U(async e=>{try{const{sms:t,email:s,notify_web_app:o}=e;if(!t&&!s&&!o)return void r.info("Please select at least one notification channel.");const n={...e,...C};(await a.post(i,"notification/notify",n)).success&&(N(!1),Y(),K({email:"",notify_web_app:""}),o&&$("notify:message",{id:C.id}))}catch(t){}}),modalBody:o.jsx("div",{children:o.jsxs("form",{children:[o.jsx("label",{className:"mb-2 d-block sc-font-14 font-bold letter-spacing-1",children:"Send notification by"}),o.jsx("div",{className:"sc-attendance-row",children:o.jsxs("div",{className:"sc-form-group d-flex gap-12 flex-wrap",children:[o.jsx("div",{className:"sc-checkbox-section",children:o.jsx(j,{control:G,name:"email",label:"Email"})}),o.jsx("div",{className:"sc-checkbox-section",children:o.jsx(j,{control:G,name:"notify_web_app",label:"Notify WEB/APP"})})]})})]})}),confirmButtonText:"Notify",closeButtonText:"Cancel",showFooter:!0}),o.jsx(y,{isOpen:A,title:"Delete Message",message:"Are you sure you want to delete this Message?",onClose:()=>M(!1),onConfirm:async()=>{R(!0);try{await a.delete(i,`notification/${O.id}`),h(e=>e.filter(e=>
2e.id!==O.id))}catch(e){}finally{R(!1),M(!1)}},confirmButtonText:"Yes",closeButtonText:"No",showFooter:!0,data:O})]})};export{h as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.