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