import{d as U,aw as a,o,a as d,f as l,v as i,x as w,z as u,F as p,n as b,ap as I,t as n,ax as c,q as M}from"./app-bWy6VYs1.js";const D={class:"space-y-3 rounded-xl border border-slate-200 bg-white p-3"},T={class:"grid grid-cols-1 gap-2"},q=["value"],V=["value"],S={class:"flex flex-wrap gap-1"},B=["onClick"],C=["disabled"],L=U({__name:"DispatchFilters",props:c({users:{},teams:{},loading:{type:Boolean}},{boardDate:{required:!0},boardDateModifiers:{},search:{required:!0},searchModifiers:{},assignedUserId:{required:!0},assignedUserIdModifiers:{},assignedTeamId:{required:!0},assignedTeamIdModifiers:{},priority:{required:!0},priorityModifiers:{},tab:{required:!0},tabModifiers:{}}),emits:c(["refresh"],["update:boardDate","update:search","update:assignedUserId","update:assignedTeamId","update:priority","update:tab"]),setup(s){const m=a(s,"boardDate"),v=a(s,"search"),g=a(s,"assignedUserId"),x=a(s,"assignedTeamId"),f=a(s,"priority"),y=a(s,"tab"),k=[{value:"unscheduled",label:"Unscheduled"},{value:"needs_follow_up",label:"Follow-up"},{value:"waiting_for_parts",label:"Parts"},{value:"emergency",label:"Emergency"},{value:"all",label:"All open"}];return(r,e)=>(o(),d("div",D,[l("div",null,[e[6]||(e[6]=l("label",{class:"mb-1 block text-[11px] font-semibold uppercase tracking-wide text-slate-500"},"Board day",-1)),i(l("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>m.value=t),type:"date",class:"w-full rounded-md border border-slate-200 px-2 py-1.5 text-sm"},null,512),[[w,m.value]])]),l("div",null,[e[7]||(e[7]=l("label",{class:"mb-1 block text-[11px] font-semibold uppercase tracking-wide text-slate-500"},"Search",-1)),i(l("input",{"onUpdate:modelValue":e[1]||(e[1]=t=>v.value=t),type:"search",placeholder:"Job #, customer, phone, address…",class:"w-full rounded-md border border-slate-200 px-2 py-1.5 text-sm"},null,512),[[w,v.value]])]),l("div",T,[l("div",null,[e[9]||(e[9]=l("label",{class:"mb-1 block text-[11px] font-semibold uppercase tracking-wide text-slate-500"},"Technician",-1)),i(l("select",{"onUpdate:modelValue":e[2]||(e[2]=t=>g.value=t),class:"w-full rounded-md border border-slate-200 px-2 py-1.5 text-sm"},[e[8]||(e[8]=l("option",{value:""},"All",-1)),(o(!0),d(p,null,b(r.users,t=>(o(),d("option",{key:t.id,value:String(t.id)},n(t.name),9,q))),128))],512),[[u,g.value]])]),l("div",null,[e[11]||(e[11]=l("label",{class:"mb-1 block text-[11px] font-semibold uppercase tracking-wide text-slate-500"},"Team",-1)),i(l("select",{"onUpdate:modelValue":e[3]||(e[3]=t=>x.value=t),class:"w-full rounded-md border border-slate-200 px-2 py-1.5 text-sm"},[e[10]||(e[10]=l("option",{value:""},"All",-1)),(o(!0),d(p,null,b(r.teams,t=>(o(),d("option",{key:t.id,value:String(t.id)},n(t.name),9,V))),128))],512),[[u,x.value]])]),l("div",null,[e[13]||(e[13]=l("label",{class:"mb-1 block text-[11px] font-semibold uppercase tracking-wide text-slate-500"},"Priority",-1)),i(l("select",{"onUpdate:modelValue":e[4]||(e[4]=t=>f.value=t),class:"w-full rounded-md border border-slate-200 px-2 py-1.5 text-sm"},[...e[12]||(e[12]=[I('<option value="">Any</option><option value="low">Low</option><option value="normal">Normal</option><option value="high">High</option><option value="urgent">Urgent</option>',5)])],512),[[u,f.value]])])]),l("div",null,[e[14]||(e[14]=l("p",{class:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-slate-500"},"Queue tab",-1)),l("div",S,[(o(),d(p,null,b(k,t=>l("button",{key:t.value,type:"button",class:M(["rounded-full border px-2 py-0.5 text-xs font-medium transition",y.value===t.value?"border-indigo-500 bg-indigo-600 text-white":"border-slate-200 bg-slate-50 text-slate-700 hover:bg-slate-100"]),onClick:A=>y.value=t.value},n(t.label),11,B)),64))])]),l("button",{type:"button",class:"w-full rounded-md border border-slate-200 px-2 py-1.5 text-sm text-slate-700 hover:bg-slate-50",disabled:r.loading,onClick:e[5]||(e[5]=t=>r.$emit("refresh"))},n(r.loading?"Loading…":"Refresh"),9,C)]))}});export{L as _};
