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