import{d as _,eA as w,G as h,b as k,c as C,w as d,f as m,u as O}from"./outputWidgets.04a14374.js";import{e as x,d as I}from"./icons.dee9dbe8.js";import{a as v}from"./asyncComputed.53598080.js";import"./router.4677d467.js";import{O as l}from"./organization.2fe75ceb.js";import"./columns.19f4f485.js";import{_ as A}from"./Navbar.vue_vue_type_script_setup_true_lang.711d9ac2.js";import{C as D}from"./CrudView.a6f509b7.js";import{B}from"./BaseLayout.bcc765e4.js";import{a as N}from"./ant-design.213d3e09.js";import"./Base.0c1843db.js";import"./transButton.772cc0ed.js";import"./Text.84d5ffc7.js";import"./Title.9beb186f.js";import"./index.5d9ba614.js";import"./gateway.f7d4a0c5.js";import"./record.b64a41e6.js";import"./pubsub.bb759777.js";import"./logo.084e5d7c.js";import"./index.164bca62.js";import"./url.311573c2.js";import"./index.9bdc1e6b.js";import"./index.90d3343e.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="d7b04a8e-102a-4bcd-8d5f-8c50183c0dce",o._sentryDebugIdIdentifier="sentry-dbid-d7b04a8e-102a-4bcd-8d5f-8c50183c0dce")}catch{}})();const et=_({__name:"Organizations",setup(o){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],p=w(),{loading:u,result:r,refetch:g}=v(()=>l.list()),s=({key:t})=>{p.push({name:"organization",params:{organizationId:t}})},f=async t=>{const a=await l.create(t.name);s({key:a.id})},y=async({key:t})=>{var e,c;await N("Are you sure you want to delete this organization?")&&(await((c=(e=r.value)==null?void 0:e.find(z=>z.id===t))==null?void 0:c.delete()),g())},b=h(()=>{var t,a;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(t=r.value)==null?void 0:t.map(e=>({key:e.id,cells:[{text:e.name,link:`/organizations/${encodeURIComponent(e.id)}`},{text:e.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:y,dangerous:!0}]}]})))!=null?a:[]}});return(t,a)=>(k(),C(B,null,{navbar:d(()=>[m(A,{breadcrumb:n})]),content:d(()=>[m(D,{"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:f},null,8,["loading","table"])]),_:1}))}});export{et as default};
//# sourceMappingURL=Organizations.77513805.js.map
