import{_ as P}from"./nuxt-link.7a09a473.js";import{f as L,D as x,L as C,B as T,W as E,E as g,S as k,T as R,y as S,z as B,P as p,_ as N,r as i,o as I,g as W,w as n,b as a,a as $}from"./entry.78b0ee06.js";import{i as q}from"./utils.88c67cf5.js";const v=L({components:{ListTitle:x,ListPagination:C,ListSearch:T,BTable:E,EntityDelete:g,PermissionList:k,Timeago:R},emits:["deleted"],setup(s,{emit:u}){const _=l=>{u("deleted",l)},o=S(),{realm:b,realmManagementId:f}=B(o),r={filters:{realm_id:[f.value,null]}},m=l=>q(b.value,l.realm_id),c=o.has(p.PERMISSION_EDIT),d=o.has(p.PERMISSION_DROP);return{fields:[{key:"id",label:"ID",thClass:"text-left",tdClass:"text-left"},{key:"name",label:"Name",thClass:"text-left",tdClass:"text-left"},{key:"created_at",label:"Created at",thClass:"text-center",tdClass:"text-center"},{key:"updated_at",label:"Updated at",thClass:"text-left",tdClass:"text-left"},{key:"options",label:"",tdClass:"text-left"}],isResourceWritable:m,hasEditPermission:c,hasDropPermission:d,handleDeleted:_,query:r}}},"$ODlEjoelBE"),O=$("i",{class:"fa-solid fa-bars"},null,-1);function w(s,u,_,o,b,f){const r=i("ListTitle"),m=i("ListSearch"),c=i("ListPagination"),d=i("Timeago"),y=P,l=i("EntityDelete"),h=i("BTable"),D=i("PermissionList");return I(),W(D,{query:s.query,onDeleted:s.handleDeleted},{header:n(e=>[a(r),a(m,{load:e.load,busy:e.busy},null,8,["load","busy"])]),footer:n(e=>[a(c,{busy:e.busy,meta:e.meta,load:e.load},null,8,["busy","meta","load"])]),body:n(e=>[a(h,{items:e.data,fields:s.fields,busy:e.busy,"head-variant":"'dark'",outlined:""},{"cell(created_at)":n(t=>[a(d,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(updated_at)":n(t=>[a(d,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(options)":n(t=>[a(y,{to:"/admin/permissions/"+t.item.id,class:"btn btn-xs btn-outline-primary me-1",disabled:!s.hasEditPermission||!s.isResourceWritable(t.item)},{default:n(()=>[O]),_:2},1032,["to","disabled"]),a(l,{class:"btn btn-xs btn-outline-danger","entity-id":t.item.id,"entity-type":"permission","with-text":!1,disabled:t.item.built_in||!s.hasDropPermission||!s.isResourceWritable(t.item),onDeleted:e.deleted},null,8,["entity-id","disabled","onDeleted"])]),_:2},1032,["items","fields","busy"])]),_:1},8,["query","onDeleted"])}const z=N(v,[["render",w]]);export{z as default};
