1import{y as _,z as f,A as U,o,g as r,e as b,u as i,Z as S,w as v,d as e,s as A,B as E,E as M,F as h,h as w,t as d,c as k,f as T,i as V,k as y,n as $,l as B,O as C}from"./app-42c79df5.js";import{_ as R}from"./AuthenticatedLayout-72b49079.js";import"./bootstrap-a0c9416f.js";import"./ApplicationLogo-4f38a758.js";const j=e("h2",{class:"font-semibold text-xl text-gray-800 leading-tight"},"Customer Users",-1),D={class:"py-12"},H={class:"mx-auto sm:px-6 lg:px-8 mt-3",style:{width:"100%"}},O={class:"bg-white overflow-hidden shadow-sm sm:rounded-lg p-6"},P={class:"mb-6 flex justify-between items-center"},z={class:"w-1/3"},F={class:"overflow-x-auto"},I={class:"table-auto w-full"},q=e("th",{class:"p-3 font-bold text-right"},"Actions",-1),Z={class:"p-3"},G={class:"p-3"},J={class:"p-3"},K={key:0},Q={class:"font-medium text-gray-900"},W={class:"text-xs text-gray-500"},X={key:1,class:"text-gray-400 italic"},Y={class:"p-3"},tt={key:0,class:"text-sm"},et={key:1,class:"text-gray-400 italic text-sm"},st={class:"p-3 text-sm text-gray-500"},ot={class:"p-3 text-right"},rt={key:0},at=e("td",{colspan:"6",class:"p-6 text-center text-gray-500 italic"},"No customer users found.",-1),lt=[at],nt={key:0,class:"mt-6 flex flex-wrap justify-center gap-1"},ct=["innerHTML"],_t={__name:"Index",props:{customerUsers:Object,filters:Object},setup(L){const g=L,u=_(g.customerUsers);let c=_(g.filters.term||""),a=_(new URLSearchParams(window.location.search).get("sort")||""),l=_(new URLSearchParams(window.location.search).get("dir")||"asc");const p=_(null);f(()=>g.customerUsers,n=>{u.value=n}),f(c,function(n){const s={};n&&(s.term=n),C.get(route("customer_users.index",s),{sort:a.value,dir:l.value},{preserveState:!0,replace:!0})});const m=(n,s)=>{a.value===s?l.value=l.value==="asc"?"desc":"asc":(a.value=s,l.value="asc");const t={};c.value&&(t.term=c.value),C.get(route("customer_users.index",t),{sort:a.value,dir:l.value},{preserveState:!0,replace:!0})},x=()=>{p.value&&p.value.querySelectorAll(".sort").forEach(s=>{s.dataset.attr===a.value?(s.classList.remove("asc","desc"),s.classList.add(l.value)):s.classList.remove("asc","desc")})};return f([a,l],()=>{x()}),U(()=>{x()}),(n,s)=>(o(),r(h,null,[b(i(S),{title:"Customer Users"}),b(R,null,{header:v(()=>[j]),default:v(()=>[e("div",D,[e("div",H,[e("div",O,[e("div",P,[e("div",z,[A(e("input",{"onUpdate:modelValue":s[0]||(s[0]=t=>M(c)?c.value=t:c=t),type:"text",placeholder:"Search users or customers...",class:"w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"},null,512),[[E,i(c)]])])]),e("div",F,[e("table",I,[e("thead",null,[e("tr",{class:"text-left border-b-2 bg-gray-50",ref_key:"tableRow",ref:p},[e("th",{class:"p-3 font-bold cursor-pointer hover:bg-gray-100 sort","data-attr":"name",onClick:s[1]||(s[1]=t=>m("customer_users","name"))}," Name "),e("th",{class:"p-3 font-bold cursor-pointer hover:bg-gray-100 sort","data-attr":"email",onClick:s[2]||(s[2]=t=>m("customer_users","email"))}," Email "),e("th",{class:"p-3 font-bold cursor-pointer hover:bg-gray-100 sort","data-attr":"customer.fullname",onClick:s[3]||(s[3]=t=>m("customer_users","customer.fullname"))}," Customer "),e("th",{class:"p-3 font-bold cursor-pointer hover:bg-gray-100 sort","data-attr":"last_login_at",onClick:s[4]||(s[4]=t=>m("customer_users","last_login_at"))}," Last Login "),e("th",{class:"p-3 font-bold cursor-pointer hover:bg-gray-100 sort","data-attr":"created_at",onClick:s[5]||(s[5]=t=>m("customer_users","created_at"))}," Created At "),q],512)]),e("tbody",null,[(o(!0),r(h,null,w(u.value.data,t=>(o(),r("tr",{key:t.id,class:"border-b hover:bg-gray-50"},[e("td",Z,d(t.name||"N/A"),1),e("td",G,d(t.email),1),e("td",J,[t.customer?(o(),r("div",K,[e("div",Q,d(t.customer.fullname||t.customer.shortname),1),e("div",W,d(t.customer.external_id),1)])):(o(),r("span",X,"No Customer"))]),e("td",Y,[t.last_login_at?(o(),r("span",tt,d(t.last_login_at),1)):(o(),r("span",et,"Never"))]),e("td",st,d(t.created_at),1),e("td",ot,[t.customer_id?(o(),k(V,{key:0,href:n.route("customers.edit",{customer:t.customer_id})},{default:v(()=>[T(" View Customer ")]),_:2},1032,["href"])):y("",!0)])]))),128)),u.value.data.length===0?(o(),r("tr",rt,lt)):y("",!0)])])]),u.value.links.length>3?(o(),r("div",nt,[(o(!0),r(h,null,w(u.value.links,(t,N)=>(o(),r(h,{key:N},[t.url===null?(o(),r("div",{key:0,class:"px-4 py-2 text-sm text-gray-500 border rounded",innerHTML:t.label},null,8,ct)):(o(),k(i(B),{key:1,href:t.url+(i(a)?"&sort="+i(a)+"&dir="+i(l):""),class:$(["px-4 py-2 text-sm border rounded hover:bg-white",{"bg-gray-800 text-white hover:bg-gray-700":t.active}]),innerHTML:t.label},null,8,["href","class","innerHTML"]))],64))),128))])):y("",!0)])])])]),_:1})],64))}};export{_t 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.