import{s as j}from"./BRrjJgJc.js";import{a as A}from"./BLsGNFkl.js";import{s as M}from"./BeiPJ-Ey.js";import{s as G}from"./DOlpiDlz.js";import{s as H}from"./BmkZKiAf.js";import{S as P,u as R}from"./ZIw2O0V5.js";import{E as U,I as J,J as i,b as K,p as h,o as a,c as l,K as n,v as s,y as t,L as c,u as d,m as k,z as v,C as g,O as u,Q as L,N as x,S as O}from"./CVN9mXi8.js";import"./Cnr6hwyY.js";import"./ByD9s0OG.js";import"./BzjqEU2Y.js";import"./CeHl1rk9.js";import"./BuPR-zpu.js";import"./O5JmsoSo.js";import"./2PnuRw05.js";import"./U-WKJCH1.js";import"./CG5Ae_0g.js";import"./1kJjC6_k.js";import"./oLVS05MJ.js";const Q={class:"flex justify-between"},q={class:"text-xl m-2"},F=["href","onClick"],W={class:"text-primary font-semibold"},X=["href","target"],Z={class:"text-surface-700 dark:text-surface-0"},oo={class:"base-grid"},eo={class:"col-span-4"},xo=U({__name:"index",setup(so){const C=J(),m=i([]),p=i({}),w=i([]),D=i([{label:"Início",icon:"pi pi-home"},{label:"Segurança",icon:"pi pi-shield"},{label:"Permissões",faIcon:"user-shield"}]),I=R();function N(e){return e?I(e).format("DD/MM/YYYY"):""}async function S(){try{const e=await P.usuarios.findGrupos();m.value=e}catch(e){C.add({severity:"error",summary:"Erro ao buscar",detail:e})}}function V(e){O(`/seguranca/gruposAcesso/${e.data.id}`)}return K(()=>{S()}),(e,r)=>{const f=h("fa-icon"),z=h("router-link"),B=H,T=G,_=M,y=A,$=j;return a(),l("div",null,[n(_,{class:"m-4 p-4"},{header:s(()=>[t("div",Q,[t("div",q,[n(B,{model:c(D)},{item:s(({item:o,props:b})=>[o.route?(a(),d(z,{key:0,to:o.route,custom:""},{default:s(({href:E,navigate:Y})=>[t("a",k({href:E},b.action,{onClick:Y}),[o.icon?(a(),l("i",{key:0,class:v([o.icon,"text-color"]),style:{"font-size":"1.5rem"}},null,2)):o.faIcon?(a(),d(f,{key:1,icon:o.faIcon,style:{"font-size":"1.5rem"}},null,8,["icon"])):g("",!0),t("span",W,u(o.label),1)],16,F)]),_:2},1032,["to"])):(a(),l("a",k({key:1,href:o.url,target:o.target},b.action),[o.icon?(a(),l("i",{key:0,class:v([o.icon,"text-color"]),style:{"font-size":"1.2rem"}},null,2)):o.faIcon?(a(),d(f,{key:1,icon:o.faIcon,style:{"font-size":"1.2rem"}},null,8,["icon"])):g("",!0),t("span",Z,u(o.label),1)],16,X))]),_:1},8,["model"])])])]),content:s(()=>[t("div",oo,[t("div",eo,[r[1]||(r[1]=t("label",{for:"usuario"},"Selecione o grupo de usuário:",-1)),n(T,{modelValue:c(p),"onUpdate:modelValue":r[0]||(r[0]=o=>L(p)?p.value=o:null),options:c(m),"option-label":"nome","option-value":"id",placeholder:"Todos",fluid:""},null,8,["modelValue","options"])])])]),_:1}),n(_,{class:"m-4"},{content:s(()=>[n($,{"table-style":"min-width: 50rem",paginator:"",value:c(w),rows:10,"rows-per-page-options":[5,10,20],"selection-mode":"single",onRowClick:V},{empty:s(()=>r[2]||(r[2]=[x("Não há dados.")])),default:s(()=>[n(y,{field:"descricao",header:"Nome",sortable:""}),n(y,{field:"datHorAlteracao",header:"Data de alteração",sortable:""},{body:s(({data:o})=>[x(u(N(o.datHorAlteracao)),1)]),_:1})]),_:1},8,["value"])]),_:1})])}}});export{xo as default};
