1import{u as v,r as w,j as e,H as y,L as o,b as T}from"./app-D4IBpXEE.js";import{A as S}from"./AdminLayout-B7cFynqJ.js";import{a as C}from"./datetime-BfxD2VX1.js";import{u as $}from"./useTranslation-mV-gvqqz.js";import{b as i}from"./Sidebar-CzTRGA0N.js";import{P as A}from"./plus-BtmR7ya-.js";import{T as L}from"./trending-up-CWgeT_5J.js";import{C as I}from"./clock-CjNziwQQ.js";import{C as z}from"./circle-check-big-Cs_dpEV5.js";import{M as B}from"./message-square-CnPXhMbL.js";import"./Topbar-YNLa3oLe.js";import"./ApplicationLogo-Bp8Si-NU.js";import"./Tabs-CO9UBWDc.js";import"./Modal-BG2UZmBH.js";import"./useLocale-DI-M_4se.js";import"./search-DEcyoQmh.js";import"./createLucideIcon-CNbh77gd.js";import"./x-Bdl9lUlz.js";import"./loader-circle-D9S0CuXo.js";import"./user-DjuKNgwl.js";import"./file-text-Bmh95Nys.js";import"./users-CkbR-kb7.js";import"./globe-DvUr_wFZ.js";import"./shield-check-D7ft-euV.js";import"./user-cog-Uq6F85Cy.js";import"./key-round-BvhkL2Uv.js";import"./useBranding-B7C0EavV.js";import"./chevron-down-BD_xrt_b.js";const m={open:"bg-emerald-50 text-emerald-700 border border-emerald-200 dark:bg-emerald-900/20 dark:text-emerald-400 dark:border-emerald-800",in_progress:"bg-blue-50 text-blue-700 border border-blue-200 dark:bg-blue-900/20 dark:text-blue-400 dark:border-blue-800",closed:"bg-neutral-100 text-neutral-500 border border-neutral-200 dark:bg-neutral-700/50 dark:text-neutral-400 dark:border-neutral-600"},b={open:"bg-emerald-500",in_progress:"bg-blue-500",closed:"bg-neutral-400"},h={urgent:{cls:"text-red-600 dark:text-red-400 font-semibold",dot:"bg-red-500"},high:{cls:"text-orange-500 dark:text-orange-400 font-medium",dot:"bg-orange-500"},normal:{cls:"text-neutral-500 dark:text-neutral-400",dot:"bg-neutral-400"},low:{cls:"text-neutral-400 dark:text-neutral-500",dot:"bg-neutral-300"}},D=["all","open","in_progress","closed"];function x({icon:s,label:a,value:l,iconCls:r}){return e.jsxs("div",{className:"bg-white dark:bg-neutral-800/70 rounded-xl border border-neutral-200 dark:border-neutral-700/50 p-4 flex items-center gap-3 shadow-soft",children:[e.jsx("div",{className:`p-2 rounded-soft-lg ${r}`,children:e.jsx(s,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-neutral-900 dark:text-white tabular-nums",children:l}),e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:a})]})]})}function ie({tickets:s,stats:a,filters:l}){var u,c;const{t:r}=$(),g=v().props.timezone||"Asia/Dhaka",[d,k]=w.useState((l==null?void 0:l.status)??"all"),j=D.map(t=>({value:t,label:r(t==="all"?"support_tickets.tab_all":`support_tickets.${t}`)})),f=t=>{k(t),T.get(route("admin.support.index"),t!=="all"?{status:t}:{},{preserveState:!1,replace:!0})};return e.jsxs(S,{title:r("support_tickets.admin_title"),children:[e.jsx(y,{title:r("support_tickets.admin_title")}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-brand-50 dark:bg-brand-900/30 rounded-soft-lg",children:e.jsx(i,{className:"h-5 w-5 text-brand-600 dark:text-brand-400"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-neutral-900 dark:text-white",children:r("support_tickets.admin_title")}),e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:r("support_tickets.admin_subtitle")})]}),e.jsxs(o,{href:route("admin.support.create"),className:"ml-auto flex items-center gap-2 px-4 py-2 bg-brand-600 hover:bg-brand-700 text-white text-sm font-medium rounded-soft-lg transition-colors shadow-soft",children:[e.jsx(A,{className:"h-4 w-4"}),r("support_tickets.new_ticket")]})]}),a&&e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[e.jsx(x,{icon:L,label:r("support_tickets.total"),value:a.total,iconCls:"bg-brand-50 dark:bg-brand-900/30 text-brand-600 dark:text-brand-400"}),e.jsx(x,{icon:i,label:r("support_tickets.open"),value:a.open,iconCls:"bg-emerald-50 dark:bg-emerald-900/30 text-emerald-600 dark:text-emerald-400"}),e.jsx(x,{icon:I,label:r("support_tickets.in_progress"),value:a.in_progress,iconCls:"bg-blue-50 dark:bg-blue-900/30 text-blue-600 dar
1k:text-blue-400"}),e.jsx(x,{icon:z,label:r("support_tickets.closed"),value:a.closed,iconCls:"bg-neutral-100 dark:bg-neutral-700 text-neutral-500 dark:text-neutral-400"})]}),e.jsx("div",{className:"flex items-center gap-1 p-1 bg-neutral-100 dark:bg-neutral-800 rounded-xl w-fit border border-neutral-200 dark:border-neutral-700",children:j.map(t=>e.jsxs("button",{onClick:()=>f(t.value),className:`px-3 py-1.5 text-xs font-medium rounded-soft-lg transition-all ${d===t.value?"bg-white dark:bg-neutral-700 text-neutral-900 dark:text-white shadow-soft":"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300"}`,children:[t.label,t.value!=="all"&&(a==null?void 0:a[t.value])>0&&e.jsx("span",{className:`ml-1.5 px-1.5 py-0.5 rounded-full text-xs ${d===t.value?"bg-brand-100 dark:bg-brand-900/50 text-brand-600 dark:text-brand-400":"bg-neutral-200 dark:bg-neutral-600 text-neutral-500 dark:text-neutral-400"}`,children:a[t.value]})]},t.value))}),e.jsx("div",{className:"bg-white dark:bg-neutral-800/70 rounded-xl border border-neutral-200 dark:border-neutral-700/50 overflow-hidden shadow-soft",children:((u=s.data)==null?void 0:u.length)>0?e.jsxs(e.Fragment,{children:[e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-neutral-100 dark:border-neutral-700 bg-neutral-50 dark:bg-neutral-800",children:[e.jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wide",children:r("support_tickets.col_ticket")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wide hidden sm:table-cell",children:r("support_tickets.col_customer")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wide hidden md:table-cell",children:r("support_tickets.col_priority")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wide",children:r("support_tickets.col_status")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wide hidden md:table-cell",children:r("support_tickets.col_replies")}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wide hidden lg:table-cell",children:r("support_tickets.col_submitted")}),e.jsx("th",{className:"px-4 py-3"})]})}),e.jsx("tbody",{className:"divide-y divide-neutral-50 dark:divide-neutral-700/50",children:s.data.map(t=>{const n=m[t.status]??m.open,N=b[t.status]??b.open,_=r(`support_tickets.${t.status}`)||t.status,p=h[t.priority]??h.normal;return e.jsxs("tr",{className:"hover:bg-neutral-50 dark:hover:bg-neutral-700/30 transition-colors",children:[e.jsx("td",{className:"px-4 py-3.5",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("span",{className:"text-xs text-neutral-400 dark:text-neutral-500 tabular-nums mt-0.5",children:["#",t.id]}),e.jsxs("div",{children:[e.jsx(o,{href:route("admin.support.show",t.id),className:"font-medium text-neutral-900 dark:text-white hover:text-brand-600 dark:hover:text-brand-400 transition-colors line-clamp-1",children:t.subject}),e.jsx("p",{className:"text-xs text-neutral-400 dark:text-neutral-500 mt-0.5 sm:hidden",children:t.name})]})]})}),e.jsxs("td",{className:"px-4 py-3.5 hidden sm:table-cell",children:[e.jsx("p",{className:"text-sm text-neutral-700 dark:text-neutral-300",children:t.name}),e.jsx("p",{className:"text-xs text-neutral-400 dark:text-neutral-500",children:t.email})]}),e.jsx("td",{className:"px-4 py-3.5 hidden md:table-cell",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${p.dot}`}),e.jsx("span",{className:`text-xs capitalize ${p.cls}`,children:t.priority})]})}),e.jsx("td",{className:"px-4 py-3.5",children:e.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${n}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${N}`}),_]})}),e.jsx("td",{className:"px-4 py-3.5 hidden md:table-cell",children:e.jsxs("div",{className:"flex items-center gap-1 text-neutral-500 dark:text-neutral-400",children:[e.jsx(B,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"text-xs",children:t.replies_count})]})}),e.jsx("td",{className:"px-4 py-3.5 text-xs text-neutral-400 dark:text-neutral-500 hidden lg:table-cell tabular-nums",children:C(t.created_at,g)}),e.jsx("td",{className:"px-4 py-3.5 text-right",children:e.jsx(o,{href:route("admin.support.show",t.id),className:"text-xs text-brand-600 dark:text-brand-400 hover:text-brand-700 dark:hover:text-brand-300 font-medium",children:r("support_tickets.view")})})]},t.id)})})]}),s.last_page>1&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-neutral-100 dar
1k:border-neutral-700",children:[e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:r("support_tickets.showing",{from:s.from,to:s.to,total:s.total})}),e.jsx("div",{className:"flex gap-1",children:(c=s.links)==null?void 0:c.map((t,n)=>t.url?e.jsx(o,{href:t.url,className:`px-3 py-1 text-xs rounded-soft border transition-colors ${t.active?"bg-brand-600 text-white border-brand-600":"border-neutral-200 dark:border-neutral-600 text-neutral-600 dark:text-neutral-400 hover:bg-neutral-50 dark:hover:bg-neutral-700"}`,dangerouslySetInnerHTML:{__html:t.label}},n):e.jsx("span",{className:"px-3 py-1 text-xs rounded-soft border border-neutral-100 dark:border-neutral-700 text-neutral-300 dark:text-neutral-600 cursor-not-allowed",dangerouslySetInnerHTML:{__html:t.label}},n))})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx("div",{className:"p-4 bg-neutral-100 dark:bg-neutral-700 rounded-full mb-4",children:e.jsx(i,{className:"h-8 w-8 text-neutral-400 dark:text-neutral-500"})}),e.jsx("p",{className:"text-sm font-medium text-neutral-600 dar
1k:text-neutral-400",children:r("support_tickets.no_tickets_found")}),e.jsx("p",{className:"text-xs text-neutral-400 dark:text-neutral-500 mt-1",children:r(d!=="all"?`support_tickets.${d}`:"support_tickets.no_tickets_admin_desc")})]})})]})]})}export{ie 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.