1import{d as I,k,u as L,c as a,a as m,b as u,h as U,w as b,e as t,o as l,F as x,r as h,p as w,l as v,n as y,f as _,t as i,i as j,j as z,m as H,q as f,s as M}from"./app-DMdnmbZT.js";import{_ as S}from"./InputError.vue_vue_type_script_setup_true_lang-BuntCEik.js";import{_ as G}from"./AdminLayout.vue_vue_type_script_setup_true_lang-DW9RcZ78.js";import"./createLucideIcon-D6RKAtEM.js";import"./SiteWordmark.vue_vue_type_script_setup_true_lang-Cf_YsHkz.js";const J={class:"mb-4 flex flex-wrap gap-2"},K={class:"ml-1 opacity-80"},O={key:0,class:"mb-4 flex flex-wrap items-center gap-3 rounded-xl border border-indigo-200 bg-indigo-50 px-4 py-3"},P={class:"text-sm font-medium text-indigo-900"},Q=["value"],W=["disabled"],X={key:1,class:"rounded-xl border border-dashed border-slate-300 bg-white px-6 py-12 text-center text-sm text-slate-500"},Y={key:2,class:"overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm"},Z={class:"overflow-x-auto"},tt={class:"min-w-full divide-y divide-slate-200 text-sm"},et={class:"bg-slate-50"},st={class:"text-left text-xs uppercase tracking-wide text-slate-500"},ot={class:"px-4 py-3"},nt=["checked","indeterminate"],lt={class:"divide-y divide-slate-100"},at={class:"px-4 py-3"},it=["checked","onChange"],rt={class:"whitespace-nowrap px-4 py-3 text-slate-600"},dt={class:"px-4 py-3"},ut={class:"px-4 py-3"},ct=["value","onChange"],pt=["value"],mt={class:"px-4 py-3 font-medium text-slate-900"},xt={class:"px-4 py-3 text-slate-600"},gt={class:"px-4 py-3 text-slate-600"},bt={class:"max-w-xs truncate px-4 py-3 text-slate-600"},ht={class:"px-4 py-3"},ft={key:1,class:"text-slate-400"},vt={class:"px-4 py-3 text-right"},Ct=I({__name:"Index",props:{leads:{},filter:{},counts:{},statuses:{}},setup(c){const r=c,n=k([]),g=k(r.statuses[0]?.value??"new"),p=L({ids:[],status:g.value}),C=f(()=>[{key:"all",label:"All submissions",count:r.counts.all},{key:"contact",label:"Contact",count:r.counts.contact},{key:"support",label:"Technical support",count:r.counts.support}]),B=f(()=>r.leads.length>0&&n.value.length===r.leads.length),N=f(()=>n.value.length>0&&n.value.length<r.leads.length),V=f(()=>n.value.length>0);function D(o){return o==="all"?route("admin.submissions.index"):route("admin.submissions.index",{type:o})}function F(o){return o?new Date(o).toLocaleString():"â"}function T(o){return o==="technical_support_form"?"bg-amber-100 text-amber-800":"bg-sky-100 text-sky-800"}function R(o){return{new:"bg-blue-100 text-blue-800",in_review:"bg-violet-100 text-violet-800",in_progress:"bg-amber-100 text-amber-800",resolved:"bg-emerald-100 text-emerald-800",closed:"bg-slate-200 text-slate-700"}[o]??"bg-slate-100 text-slate-700"}function $(o){n.value=o?r.leads.map(e=>e.id):[]}function q(o,e){if(e){n.value.includes(o)||(n.value=[...n.value,o]);return}n.value=n.value.filter(s=>s!==o)}function A(){p.ids=[...n.value],p.status=g.value,p.patch(route("admin.submissions.batch-status"),{preserveScroll:!0,onSuccess:()=>{n.value=[]}})}function E(o,e){e!==o.status&&M.patch(route("admin.submissions.update",o.id),{status:e},{preserveScroll:!0})}return(o,e)=>(l(),a(x,null,[m(u(U),{title:"Submissions"}),m(G,{title:"Submissions"},{default:b(()=>[e[13]||(e[13]=t("p",{class:"mb-4 text-sm text-slate-600"}," Review contact form and technical support requests submitted from the public site. ",-1)),t("div",J,[(l(!0),a(x,null,h(C.value,s=>(l(),w(u(v),{key:s.key,href:D(s.key),class:y(["rounded-full px-3 py-1.5 text-sm font-medium transition",c.filter===s.key?"bg-indigo-600 text-white":"bg-white text-slate-700 ring-1 ring-slate-200 hover:bg-slate-50"])},{default:b(()=>[_(i(s.label)+" ",1),t("span",K,"("+i(s.count)+")",1)]),_:2},1032,["href","class"]))),128))]),V.value?(l(),a("div",O,[t("p",P,i(n.value.length)+" selected ",1),j(t("select",{"onUpdate:modelValue":e[0]||(e[0]=s=>g.value=s),class:"rounded-md border border-slate-300 bg-white px-3 py-2 text-sm shadow-sm focus:border-indigo-500 focus:ring-indigo-500"},[(l(!0),a(x,null,h(c.statuses,s=>(l(),a("option",{key:s.value,value:s.value},i(s.label),9,Q))),128))],512),[[z,g.value]]),t("button",{type:"button",class:"rounded-md bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 disabled:opacity-60",disabled:u(p).processing,onClick:A}," Update status ",8,W),t("button",{type:"button",class:"text-sm text-indigo-700 hover:text-indigo-900",onClick:e[1]||(e[1]=s=>n.value=[])}," Clear selection "),m(S,{message:u(p).errors.ids},null,8,["message"]),m(S,{message:u(p).errors.status},null,8,["message"])])):H("",!0),c.leads.length===0?(l(),a("div",X," No submissions yet for this filter. ")):(l(),a("div",Y,[t("div",Z,[t("table",tt,[t("thead",et,[t("tr",st,[t("th",ot,[t("input",{type:"checkbox",class:"rounded border-slate-300 text-indigo-600 focus:ring-indigo-500",checked:B.value,indeterminate:N.value,onChange:e[2]||(e[2]=s=>$(s.target.checked))},null,40,nt)]),e[3]||(e[3]=t("th",{class:"px-4 py-3"},"Submitted",-1)),e[4]||(e[4]=t("th",{class:"px-4 py-3"},"Type",-1)),e[5]||(e[5]=t("th",{class:"px-4 py-3"},"Status",-1)),e[6]||(e[6]=t("th",{class:"px-4 py-3"},"Name",-1)),e[7]||(e[7]=t("th",{class:"px-4 py-3"},"Email",-1)),e[8]||(e[8]=t("th",{class:"px-4 py-3"},"Company",-1)),e[9]||(e[9]=t("th",{class:"px-4 py-3"},"Summary",-1)),e[10]||(e[10]=t("th",{class:"px-4 py-3"},"Ticket",-1)),e[11]||(e[11]=t("th",{class:"px-4 py-3"},null,-1))])]),t("tbody",lt,[(l(!0),a(x,null,h(c.leads,s=>(l(),a("tr",{key:s.id},[t("td",at,[t("input",{type:"checkbox",class:"rounded border-slate-300 text-indigo-600 focus:ring-indigo-500",checked:n.value.includes(s.id
1),onChange:d=>q(s.id,d.target.checked)},null,40,it)]),t("td",rt,i(F(s.created_at)),1),t("td",dt,[t("span",{class:y(["rounded-full px-2.5 py-1 text-xs font-medium",T(s.source)])},i(s.source_label),3)]),t("td",ut,[t("select",{value:s.status,class:y(["min-w-[8.5rem] rounded-md border border-slate-300 bg-white px-2 py-1.5 text-xs font-medium shadow-sm focus:border-indigo-500 focus:ring-indigo-500",R(s.status)]),onChange:d=>E(s,d.target.value)},[(l(!0),a(x,null,h(c.statuses,d=>(l(),a("option",{key:d.value,value:d.value},i(d.label),9,pt))),128))],42,ct)]),t("td",mt,i(s.full_name),1),t("td",xt,i(s.email),1),t("td",gt,i(s.company??"â"),1),t("td",bt,i(s.summary),1),t("td",ht,[s.ticket?(l(),w(u(v),{key:0,href:o.route("admin.tickets.show",s.ticket.id),class:"font-medium text-indigo-600 hover:text-indigo-800"},{default:b(()=>[_(i(s.ticket.ticket_number),1)]),_:2},1032,["href"])):(l(),a("span",ft,"â"))]),t("td",vt,[m(u(v),{href:o.route("admin.submissions.show",s.id),class:"font-medium text-indigo-600 hover:text-indigo-800"},{default:b(()=>[...e[12]||(e[12]=[_(" View ",-1)])]),_:1},8,["href"])])]))),128))])])])]))]),_:1})],64))}});export{Ct 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.