1import{_ as z,m as b,p as D,s as v,o as d,c as n,d as N,b as e,t as i,h as o,f as U,x as F,v as L,F as V,i as O,a as P,g as $,e as y,j as _,W as k,S as C}from"./app-94837c1f.js";import{_ as W}from"./PaginationLinks-a9e1c4af.js";const G={class:"app-main"},Y={class:"app-content"},H={class:"container-fluid"},J={class:"row g-3 mb-4"},K={class:"col-12 col-sm-6 col-md-3"},Q={class:"card border-0 shadow-sm rounded-3 p-3 bg-white h-100 border-start border-4 border-primary"},X={class:"d-flex align-items-center justify-content-between"},Z={class:"fw-bold mb-0 mt-1 text-dark"},ee={class:"col-12 col-sm-6 col-md-3"},te={class:"card border-0 shadow-sm rounded-3 p-3 bg-white h-100 border-start border-4 border-warning"},se={class:"d-flex align-items-center justify-content-between"},le={class:"fw-bold mb-0 mt-1 text-warning"},ae={class:"col-12 col-sm-6 col-md-3"},ie={class:"card border-0 shadow-sm rounded-3 p-3 bg-white h-100 border-start border-4 border-success"},oe={class:"d-flex align-items-center justify-content-between"},de={class:"fw-bold mb-0 mt-1 text-success"},ne={class:"card border-0 shadow-sm rounded-3 mb-4 bg-white"},re={class:"card-header bg-white border-bottom py-3 d-flex flex-column flex-md-row align-items-md-center justify-content-between gap-3"},ce={class:"d-flex flex-wrap align-items-center gap-2"},ue={class:"input-group input-group-sm",style:{width:"260px"}},be={class:"card-body p-0"},me={key:0,class:"text-center py-5"},pe={key:1,class:"table-responsive"},ve={class:"table table-hover align-middle mb-0"},fe=["onClick"],ge=["onClick"],xe={key:0,class:"badge rounded-circle p-2 bg-warning-subtle text-warning border border-warning",title:"Unread"},he={key:1,class:"badge rounded-circle p-2 bg-light text-muted border",title:"Read"},we={class:"d-flex align-items-center gap-2"},ye={class:"avatar-circle rounded-circle bg-primary text-white fw-bold d-flex align-items-center justify-content-center",style:{width:"36px",height:"36px","font-size":"0.85rem","flex-shrink":"0"}},_e={class:"text-truncate",style:{"max-width":"180px"}},ke={class:"text-dark fw-semibold text-truncate"},Ce={class:"text-muted small text-truncate"},Se={class:"text-dark fw-semibold text-truncate mb-1",style:{"max-width":"480px"}},Me={class:"text-muted small text-truncate",style:{"max-width":"520px"}},je={class:"text-muted small"},Re={class:"btn-group btn-group-sm"},Te=["onClick"],Be=["href"],De=["onClick"],Ne={key:0,class:"card-footer bg-white border-top py-3"},Ue={class:"modal-dialog modal-dialog-centered modal-dialog-scrollable modal-lg"},$e={class:"modal-content border-0 shadow-lg rounded-4 overflow-hidden",style:{"max-height":"90vh"}},Ee={class:"modal-header bg-primary text-white p-4 border-0 position-relative"},Ie={class:"modal-title fw-bold text-white mb-0"},Ae={class:"modal-body p-4 bg-light-subtle",style:{"max-height":"65vh","overflow-y":"auto"}},qe={class:"card border-0 shadow-sm rounded-3 p-3 mb-4 bg-white"},ze={class:"row g-3 align-items-center"},Fe={class:"col-auto"},Le={class:"avatar-circle rounded-circle bg-primary text-white fw-bold d-flex align-items-center justify-content-center fs-4",style:{width:"54px",height:"54px"}},Ve={class:"col"},Oe={class:"fw-bold mb-1 text-dark fs-5"},Pe={class:"d-flex flex-wrap align-items-center gap-3 text-muted small"},We={class:"col-auto"},Ge={class:"card border-0 shadow-sm rounded-3 p-4 bg-white"},Ye={class:"message-content text-dark fs-6 lh-base p-3 rounded-3 bg-light border-start border-4 border-primary",style:{"white-space":"pre-wrap","font-family":"sans-serif","max-height":"320px","overflow-y":"auto"}},He={class:"modal-footer bg-white border-top p-3 d-flex justify-content-between"},Je={class:"d-flex gap-2"},Ke=["href"],Qe={__name:"Messages",props:{messages:Object,searchTerm:String},setup(f){var B;const u=f,c=b((B=u.messages)!=null&&B.data?[...u.messages.data]:[]);D(()=>u.messages,s=>{c.value=s!=null&&s.data?[...s.data]:[]},{deep:!0});const g=b(u.searchTerm||""),m=b("all");let S;D(g,s=>{clearTimeout(S),S=setTimeout(()=>{k.get(route("allmessages"),{search:s},{preserveState:!0,preserveScroll:!0})},400)});const a=b(null),x=b(!1),M=s=>
1s?s.split(" ").map(t=>t[0]).join("").substring(0,2).toUpperCase():"AT",j=s=>{if(!s)return"";const t=new Date(s);return isNaN(t.getTime())?s:t.toLocaleDateString("fr-FR",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})},R=v(()=>{let s=[...c.value];return m.value==="unread"?s=s.filter(t=>t.status==="unread"):m.value==="read"&&(s=s.filter(t=>t.status==="read")),s}),E=v(()=>{var s;return((s=u.messages)==null?void 0:s.total)||c.value.length}),I=v(()=>c.value.filter(s=>s.status==="unread").length),A=v(()=>c.value.filter(s=>s.status==="read").length),T=s=>{a.value=s,s.status==="unread"&&h(s,!0),x.value=!0},p=()=>{x.value=!1,a.value=null},h=(s,t=!1)=>{const r=s.status==="unread"?"read":"unread";s.status=r,k.put(route("messages.toggleStatus",s.id),{},{preserveScroll:!0,onSuccess:()=>{t||C.fire({toast:!0,position:"top-end",icon:"success",title:r==="read"?"Message marked as read":"Message marked as unread",showConfirmButton:!1,timer:2e3})}})},q=s=>{C.fire({title:"Delete this message?",text:"This action cannot be undone.",icon:"warning",showCancelButton:!0,confirmButtonColor:"#dc3545",cancelButtonColor:"#6c757d",confirmButtonText:"Yes, delete"}).then(t=>{t.isConfirmed&&k.delete(route("messages.delete",s),{preserveScroll:!0,onSuccess:()=>{var r;c.value=c.value.filter(l=>l.id!==s),((r=a.value)==null?void 0:r.id)===s&&p(),C.fire({toast:!0,position:"top-end",icon:"success",title:"Message deleted successfully",showConfirmButton:!1,timer:2e3})}})})};return(s,t)=>{var r;return d(),n("main",G,[t[31]||(t[31]=N('<div class="app-content-header" data-v-73b844db><div class="container-fluid" data-v-73b844db><div class="row align-items-center" data-v-73b844db><div class="col-sm-6" data-v-73b844db><h3 class="mb-0 fw-bold text-dark d-flex align-items-center gap-2" data-v-73b844db><i class="bi bi-chat-left-text-fill text-primary" data-v-73b844db></i> CONTACT MESSAGES </h3></div><div class="col-sm-6" data-v-73b844db><ol class="breadcrumb float-sm-end" data-v-73b844db><li class="breadcrumb-item" data-v-73b844db><a href="/dashboard" data-v-73b844db>Dashboard</a></li><li class="breadcrumb-item active" aria-current="page" data-v-73b844db>Messages</li></ol></div></div></div></div>',1)),e("div",Y,[e("div",H,[e("div",J,[e("div",K,[e("div",Q,[e("div",X,[e("div",null,[t[4]||(t[4]=e("span",{class:"text-muted small fw-semibold text-uppercase"},"Total Messages",-1)),e("h3",Z,i(E.value),1)]),t[5]||(t[5]=e("div",{class:"rounded-circle bg-primary-subtle text-primary p-3 d-flex align-items-center justify-content-center",style:{width:"48px",height:"48px"}},[e("i",{class:"bi bi-inbox-fill fs-5"})],-1))])])]),e("div",ee,[e("div",te,[e("div",se,[e("div",null,[t[6]||(t[6]=e("span",{class:"text-muted small fw-semibold text-uppercase"},"Unread",-1)),e("h3",le,i(I.value),1)]),t[7]||(t[7]=e("div",{class:"rounded-circle bg-warning-subtle text-warning p-3 d-flex align-items-center justify-content-center",style:{width:"48px",height:"48px"}},[e("i",{class:"bi bi-envelope-exclamation-fill fs-5"})],-1))])])]),e("div",ae,[e("div",ie,[e("div",oe,[e("div",null,[t[8]||(t[8]=e("span",{class:"text-muted small fw-semibold text-uppercase"},"Read",-1)),e("h3",de,i(A.value),1)]),t[9]||(t[9]=e("div",{class:"rounded-circle bg-success-subtle text-success p-3 d-flex align-items-center justify-content-center",style:{width:"48px",height:"48px"}},[e("i",{class:"bi bi-envelope-check-fill fs-5"})],-1))])])]),t[10]||(t[10]=N('<div class="col-12 col-sm-6 col-md-3" data-v-73b844db><div class="card border-0 shadow-sm rounded-3 p-3 bg-white h-100 border-start border-4 border-info" data-v-73b844db><div class="d-flex align-items-center justify-content-between" data-v-73b844db><div data-v-73b844db><span class="text-muted small fw-semibold text-uppercase" data-v-73b844db>Contact Form</span><h3 class="fw-bold mb-0 mt-1 text-info" data-v-73b844db>Services Page</h3></div><div class="rounded-circle bg-info-subtle text-info p-3 d-flex align-items-center justify-content-center" style="width:48px;height:48px;" data-v-73b844db><i class="bi bi-send-fill fs-5" data-v-73b844db></i></div></div></div></div>',1))]),e("div",ne,[e("div",re,[t[13]||(t[13]=e("div",null,[e("h5",{class:"mb-0 fw-bold text-dark d-flex align-items-center gap-2"},[e("i",{class:"bi bi-tray-fill text-primary"}),o(" Front-End Inquiries List ")]),e("span",{class:"small text-muted"}
1,"View contact form entries submitted by visitors on the Services page")],-1)),e("div",ce,[U(e("select",{"onUpdate:modelValue":t[0]||(t[0]=l=>m.value=l),class:"form-select form-select-sm border-secondary-subtle",style:{width:"140px","border-radius":"8px"}},t[11]||(t[11]=[e("option",{value:"all"},"All Status",-1),e("option",{value:"unread"},"Unread",-1),e("option",{value:"read"},"Read",-1)]),512),[[F,m.value]]),e("div",ue,[t[12]||(t[12]=e("span",{class:"input-group-text bg-light text-muted border-secondary-subtle",style:{"border-radius":"8px 0 0 8px"}},[e("i",{class:"bi bi-search"})],-1)),U(e("input",{type:"text",placeholder:"Search sender, email, subject...","onUpdate:modelValue":t[1]||(t[1]=l=>g.value=l),class:"form-control border-secondary-subtle border-start-0",style:{"border-radius":"0 8px 8px 0"}},null,512),[[L,g.value]])])])]),e("div",be,[R.value.length===0?(d(),n("div",me,t[14]||(t[14]=[e("i",{class:"bi bi-chat-square-dots text-muted display-4"},null,-1),e("h5",{class:"mt-3 text-secondary"},"No messages found",-1),e("p",{class:"text-muted small"},"No contact inquiries match your search or filter criteria.",-1)]))):(d(),n("div",pe,[e("table",ve,[t[21]||(t[21]=e("thead",{class:"bg-light text-muted small text-uppercase"},[e("tr",null,[e("th",{class:"ps-4",style:{width:"50px"}},"Status"),e("th",{style:{width:"240px"}},"Sender"),e("th",null,"Subject & Preview"),e("th",{style:{width:"160px"}},"Received At"),e("th",{class:"text-end pe-4",style:{width:"140px"}},"Actions")])],-1)),e("tbody",null,[(d(!0),n(V,null,O(R.value,l=>(d(),n("tr",{key:l.id,class:_({"fw-bold bg-light-subtle":l.status==="unread"}),style:{cursor:"pointer",transition:"background-color 0.2s"},onClick:w=>T(l)},[e("td",{class:"ps-4",onClick:y(w=>h(l),["stop"]),title:"Click to toggle status"},[l.status==="unread"?(d(),n("span",xe,t[15]||(t[15]=[e("i",{class:"bi bi-circle-fill",style:{"font-size":"8px"}},null,-1)]))):(d(),n("span",he,t[16]||(t[16]=[e("i",{class:"bi bi-envelope-open",style:{"font-size":"11px"}},null,-1)])))],8,ge),e("td",null,[e("div",we,[e("div",ye,i(M(l.name)),1),e("div",_e,[e("div",ke,i(l.name),1),e("div",Ce,i(l.email),1)])])]),e("td",null,[e("div",Se,i(l.subject),1),e("div",Me,i(l.message),1)]),e("td",je,[t[17]||(t[17]=e("i",{class:"bi bi-clock me-1"},null,-1)),o(" "+i(j(l.created_at)),1)]),e("td",{class:"text-end pe-4",onClick:t[2]||(t[2]=y(()=>{},["stop"]))},[e("div",Re,[e("button",{class:"btn btn-outline-primary btn-sm rounded-2 me-1",onClick:w=>T(l),title:"View Message Details"},t[18]||(t[18]=[e("i",{class:"bi bi-eye"},null,-1)]),8,Te),e("a",{href:`mailto:${l.email}?subject=RE: ${encodeURIComponent(l.subject)}`,class:"btn btn-outline-success btn-sm rounded-2 me-1",title:"Reply via Email"},t[19]||(t[19]=[e("i",{class:"bi bi-reply-fill"},null,-1)]),8,Be),e("button",{class:"btn btn-outline-danger btn-sm rounded-2",onClick:w=>q(l.id),title:"Delete Message"},t[20]||(t[20]=[e("i",{class:"bi bi-trash"},null,-1)]),8,De)])])],10,fe))),128))])])]))]),(r=f.messages)!=null&&r.links?(d(),n("div",Ne,[P(W,{paginator:f.messages},null,8,["paginator"])])):$("",!0)])])]),x.value&&a.value?(d(),n("div",{key:0,class:"modal fade show d-block",tabindex:"-1",style:{background:"rgba(15, 23, 42, 0.6)","backdrop-filter":"blur(4px)"},onClick:y(p,["self"])},[e("div",Ue,[e("div",$e,[e("div",Ee,[e("div",null,[t[22]||(t[22]=e("span",{class:"badge bg-white text-primary mb-2 px-3 py-1 rounded-pill text-uppercase fw-bold",style:{"font-size":"0.7rem"}},[e("i",{class:"bi bi-envelope-fill me-1"}),o(" Contact Inquiry ")],-1)),e("h4",Ie,i(a.value.subject),1)]),e("button",{type:"button",class:"btn-close btn-close-white position-absolute top-0 end-0 m-3",onClick:p,"aria-label":"Close"})]),e("div",Ae,[e("div",qe,[e("div",ze,[e("div",Fe,[e("div",Le,i(M(a.value.name)),1)]),e("div",Ve,[e("h6",Oe,i(a.value.name),1),e("div",Pe,[e("span",null,[t[23]||(t[23]=e("i",{class:"bi bi-envelope me-1 text-primary"},null,-1)),t[24]||(t[24]=o()),t[25]||(t[25]=e("strong",null,"Email:",-1)),o(" "+i(a.value.email),1)]),e("span",null,[t[26]||(t[26]=e("i",{class:"bi bi-calendar3 me-1 text-primary"},null,-1)),t[27]||(t[27]=o()),t[28]||(t[28]=e("strong",null,"Date:",-1)),o(" "+i(j(a.value.created_at)),1)])])]),e("div",We,[e("span",{class:_(["badge rounded-pill px-3 py-2",a.value.status==="unread"?"bg-warning-subtle text-warning border border-warning":"bg-success-subtle text-success border border-success"])}
1,i(a.value.status==="unread"?"Unread Message":"Read"),3)])])]),e("div",Ge,[t[29]||(t[29]=e("h6",{class:"text-muted small fw-bold text-uppercase mb-3"},[e("i",{class:"bi bi-chat-quote-fill me-1 text-primary"}),o(" Message Body ")],-1)),e("div",Ye,i(a.value.message),1)])]),e("div",He,[e("button",{class:"btn btn-outline-secondary rounded-3 px-4",onClick:t[3]||(t[3]=l=>h(a.value))},[e("i",{class:_([a.value.status==="unread"?"bi bi-envelope-open":"bi bi-envelope-fill","me-1"])},null,2),o(" Mark as "+i(a.value.status==="unread"?"Read":"Unread"),1)]),e("div",Je,[e("a",{href:`mailto:${a.value.email}?subject=RE: ${encodeURIComponent(a.value.subject)}`,class:"btn btn-primary rounded-3 px-4 fw-bold"},t[30]||(t[30]=[e("i",{class:"bi bi-reply-fill me-1"},null,-1),o(" Reply via Email ")]),8,Ke),e("button",{type:"button",class:"btn btn-light border rounded-3 px-4",onClick:p}," Close ")])])])])])):$("",!0)])}}},et=z(Qe,[["__scopeId","data-v-73b844db"]]);export{et 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.