import{_ as L}from"./Brk5FU9k.js";import{d as B,z as d,c as u,a as $,f as t,e as l,U as O,w as o,g as a,F as V,i as z,R as D,o as _,A as P,b as x,E as y,G as b,t as C,h as j,n as G}from"./dVzHJMF1.js";import{_ as W}from"./DDV-HLQE.js";import{_ as Y}from"./BqnRxGiA.js";import{_ as q}from"./CPhxMljB.js";import{_ as J}from"./Dnya2_N7.js";import K from"./CnY3cFor.js";import M from"./G1F3Bacz.js";import X from"./C5Oc2f2M.js";import Z from"./B7Hqpkvs.js";import{g as H,S as m,c as Q}from"./BbimXw5J.js";import{u as tt}from"./CJ1p9Ehj.js";import{u as ot}from"./BnffAU85.js";import{u as et}from"./yHxjwlra.js";import"./yXj_05M0.js";import"./Bhud8mbC.js";import"./DhLu8RVk.js";import"./CWHHmK0V.js";import"./tESAK1vk.js";import"./B79Hoqpc.js";import"./CX2DUt_P.js";import"./cMkL48JQ.js";import"./iZ-xiGRB.js";import"./BSLzRQpY.js";import"./CH1bAkoS.js";import"./DaykkcNl.js";import"./D2P12BLM.js";import"./DTJCrQga.js";import"./C9UvFovT.js";import"./FaLtR_4n.js";import"./C9L2ikqF.js";import"./B3dHCiEQ.js";import"./BZjcnCH7.js";import"./DiwqsPB4.js";import"./KcBrPYTF.js";import"./B_Kqq5Cu.js";import"./ClA_a7pZ.js";import"./a1m94JqE.js";import"./BSe03gVj.js";import"./BW5cYMVL.js";import"./BuQ9u7Je.js";import"./CBbadgK0.js";import"./CM8mMzv6.js";import"./DP0doleY.js";import"./BAtzogEJ.js";import"./r1Y5hC84.js";import"./FcRkkR--.js";const at={class:"flex flex-col gap-5"},st={class:"flex gap-5"},Qt=B({__name:"index",setup(nt){const f=tt({add:D.SYS_SETORES_AGENCIA_INCLUIR}),v=d.object({search:d.string(),inativo:d.string()}),s=ot(v),I=u(()=>s.value.inativo),{data:p,status:g}=et(()=>z.agencia.areas.findAll({inativo:s.value.inativo?s.value.inativo===m.Inativo:void 0}),{watch:[I]},"$WbuJXVSZWU"),A=u(()=>{var i,n;return!((i=p.value)!=null&&i.length)||!((n=s.value)!=null&&n.search)?p.value??[]:p.value.filter(r=>r.sigla.toLowerCase().includes(s.value.search.toLowerCase())||r.descricao.toLowerCase().includes(s.value.search.toLowerCase()))}),w=u(()=>H(A.value));function k(i){G("/configuracoes/areas/"+i.data.id,{open:{target:"_blank"}})}return(i,n)=>{const r=L,S=P,N=W,T=Z,h=Y,E=X,U=q,c=M,R=J,F=K;return _(),$(V,null,[t(N,{title:"Setores da agência"},O({_:2},[a(f).add?{name:"title-buttons",fn:o(()=>[t(S,{to:"/configuracoes/areas/nova"},{default:o(()=>[t(r,{mode:"add"})]),_:1})]),key:"0"}:void 0]),1024),l("div",at,[t(U,{schema:a(v),status:a(g),onChange:n[0]||(n[0]=e=>s.value=e)},{default:o(()=>[l("div",st,[t(h,{name:"search",label:"Localizar:",class:"w-full"},{default:o(()=>[t(T,{id:"localizar",placeholder:"Digite sua pesquisa...",type:"search",fluid:""})]),_:1}),t(h,{name:"inativo",label:"Status:",class:"w-full"},{default:o(()=>[t(E,{options:a(Q),"option-value":"value","option-label":"label","show-clear":"",placeholder:"Selecione..."},null,8,["options"])]),_:1})])]),_:1},8,["schema","status"]),t(F,{value:a(w),loading:a(g)==="pending",onRowClick:k},{empty:o(()=>n[1]||(n[1]=[j("Não há itens disponíveis.")])),default:o(()=>[t(c,{header:"Sigla","body-class":"min-column !p-4","header-class":"min-column !text-left py-3",field:"sigla",expander:""},{body:o(({node:e})=>[l("span",{class:b(e.data.status===a(m).Inativo&&"text-gray-500")},C(e.data.sigla),3)]),_:1}),t(c,{header:"Descrição",field:"descricao","body-class":"!text-left !p-4","header-class":"!text-left px-3 py-3"},{body:o(({node:e})=>[l("span",{class:b(e.data.status===a(m).Inativo&&"text-gray-500")},C(e.data.descricao),3)]),_:1}),t(c,{header:"Status","body-class":"min-column justify-center","header-class":"min-column",class:"text-center"},{body:o(({node:e})=>[e.data.status===a(m).Inativo?(_(),x(R,{key:0})):y("",!0)]),_:1}),a(f).add?(_(),x(c,{key:0,"body-class":"min-column"},{body:o(({node:e})=>[t(S,{to:`/configuracoes/areas/${e.data.id}`},{default:o(()=>[t(r,{mode:"editIcon"})]),_:2},1032,["to"])]),_:1})):y("",!0)]),_:1},8,["value","loading"])])],64)}}});export{Qt as default};
