import{_ as y}from"./nuxt-link.40687dc5.js";import{f as h,P as D,E as x,Q as C,T as P,y as E,z as k,D as b,_ as R,r as o,o as T,g as N,w as a,b as i,a as B}from"./entry.c7cd0af6.js";import{i as I}from"./utils.1db1ba01.js";const g=h({components:{BTable:D,EntityDelete:x,PermissionList:C,Timeago:P},emits:["deleted"],setup(t,{emit:c}){const u=s=>{c("deleted",s)},l=E(),{realm:_,realmManagementId:f}=k(l),n={filter:{realm_id:[f.value,null]}},d=s=>I(_.value,s.realm_id),r=l.has(b.PERMISSION_EDIT),m=l.has(b.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:d,hasEditPermission:r,hasDropPermission:m,handleDeleted:u,query:n}}},"$ODlEjoelBE"),v=B("i",{class:"fa-solid fa-bars"},null,-1);function O(t,c,u,l,_,f){const n=o("Timeago"),d=y,r=o("EntityDelete"),m=o("BTable"),p=o("PermissionList");return T(),N(p,{"header-title":{icon:"fa-solid fa-list pe-1",content:"Overview"},query:t.query,onDeleted:t.handleDeleted},{body:a(s=>[i(m,{items:s.data,fields:t.fields,busy:s.busy,"head-variant":"'dark'",outlined:""},{"cell(created_at)":a(e=>[i(n,{datetime:e.item.created_at},null,8,["datetime"])]),"cell(updated_at)":a(e=>[i(n,{datetime:e.item.created_at},null,8,["datetime"])]),"cell(options)":a(e=>[i(d,{to:"/admin/permissions/"+e.item.id,class:"btn btn-xs btn-outline-primary me-1",disabled:!t.hasEditPermission||!t.isResourceWritable(e.item)},{default:a(()=>[v]),_:2},1032,["to","disabled"]),i(r,{class:"btn btn-xs btn-outline-danger","entity-id":e.item.id,"entity-type":"permission","with-text":!1,disabled:e.item.built_in||!t.hasDropPermission||!t.isResourceWritable(e.item),onDeleted:s.deleted},null,8,["entity-id","disabled","onDeleted"])]),_:2},1032,["items","fields","busy"])]),_:1},8,["query","onDeleted"])}const w=R(g,[["render",O]]);export{w as default};
