import{d as _,eA as w,G as h,b as k,c as C,w as c,f as l,u as O}from"./outputWidgets.396f5ce1.js";import{v as x,D as I}from"./icons.37b6f90f.js";import{a as v}from"./asyncComputed.95737324.js";import"./router.898a5ca4.js";import"./index.d80eeb49.js";import{O as p}from"./organization.e739f1ec.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.3f62416a.js";import{C as A}from"./CrudView.ece8081d.js";import{B}from"./BaseLayout.16854fe5.js";import{a as N}from"./ant-design.e656dd24.js";import"./FormItem.a8de7296.js";import"./hasIn.63a13365.js";import"./index.f3919413.js";import"./index.cf4c23b9.js";import"./record.1aff3d29.js";import"./pubsub.06faa612.js";import"./gateway.a0e7cb55.js";import"./logo.084e5d7c.js";import"./Text.4e180dc2.js";import"./Base.ee1dde08.js";import"./index.f6bad865.js";import"./Form.716e7fa5.js";import"./Modal.c02a2840.js";import"./url.4e42e1d0.js";import"./index.645b3e28.js";import"./index.a44632c5.js";import"./Title.819eb0fe.js";import"./index.f0384574.js";import"./index.a23873b5.js";import"./index.b703167a.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="c95f3025-0f27-4074-abf2-aec5170ef9a5",a._sentryDebugIdIdentifier="sentry-dbid-c95f3025-0f27-4074-abf2-aec5170ef9a5")}catch{}})();const mt=_({__name:"Organizations",setup(a){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],d=w(),{loading:u,result:r,refetch:f}=v(()=>p.list()),s=({key:t})=>{d.push({name:"organization",params:{organizationId:t}})},g=async t=>{const e=await p.create(t.name);s({key:e.id})},y=async({key:t})=>{var o,m;await N("Are you sure you want to delete this organization?")&&(await((m=(o=r.value)==null?void 0:o.find(z=>z.id===t))==null?void 0:m.delete()),f())},b=h(()=>{var t,e;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(e=(t=r.value)==null?void 0:t.map(o=>({key:o.id,cells:[{text:o.name,link:`/organizations/${encodeURIComponent(o.id)}`},{text:o.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:y,dangerous:!0}]}]})))!=null?e:[]}});return(t,e)=>(k(),C(B,null,{navbar:c(()=>[l(D,{breadcrumb:n})]),content:c(()=>[l(A,{"entity-name":"organization",loading:O(u),title:"My organizations",description:"An organization is your company\u2019s account. Add co-workers, manage their access, organize projects and billing.","create-button-text":"Create Organization","empty-title":"No organizations here yet",table:b.value,fields:i,onCreate:g},null,8,["loading","table"])]),_:1}))}});export{mt as default};
//# sourceMappingURL=Organizations.212928a3.js.map
