import{d as z,ex as _,H as O,b as w,c as k,w as c,f as m,u as h}from"./registerWidgets.d207d3d8.js";import{e as x,b as C}from"./icons.4cf3c6e7.js";import{a as I}from"./asyncComputed.9245c077.js";import"./gateway.b835e205.js";import{O as d}from"./organization.d491d126.js";import"./index.ec4e5819.js";import{_ as v}from"./Navbar.vue_vue_type_script_setup_true_lang.29155917.js";import{_ as D}from"./CrudView.vue_vue_type_script_setup_true_lang.892f2f1d.js";import{B as M}from"./BaseLayout.0d1c7e47.js";import{M as A}from"./index.17e7a15c.js";import"./passwordlessManager.66faf323.js";import"./pubsub.a025efb1.js";import"./storage.955f9c37.js";import"./activeRecord.3ac0bec0.js";import"./logo.084e5d7c.js";import"./Text.df3bd99f.js";import"./Title.db9c20f2.js";import"./transButton.c5e342ac.js";import"./index.ce572c42.js";import"./index.7710c197.js";import"./Modal.c3922cf6.js";import"./index.ed3f099d.js";import"./index.a3599972.js";import"./index.084f0c6d.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]="7d8bc708-45df-4774-95b3-4d755a2fd9c7",o._sentryDebugIdIdentifier="sentry-dbid-7d8bc708-45df-4774-95b3-4d755a2fd9c7")}catch{}})();const et=z({__name:"Organizations",setup(o){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],l=_(),{loading:p,result:r,refetch:u}=I(()=>d.list()),s=({key:t})=>{l.push({name:"organization",params:{organizationId:t}})},f=async t=>{const e=await d.create(t.name);s({key:e.id})},g=async({key:t})=>{A.confirm({title:"Are you sure you want to delete this organization?",onOk:async()=>{var e,a;await((a=(e=r.value)==null?void 0:e.find(b=>b.id===t))==null?void 0:a.delete()),u()}})},y=O(()=>{var t,e;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Organization Actions"}],rows:(e=(t=r.value)==null?void 0:t.map(a=>({key:a.id,cells:[{text:a.name,link:`/organizations/${encodeURIComponent(a.id)}`},{text:a.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:C,label:"Delete",onClick:g,dangerous:!0}]}]})))!=null?e:[]}});return(t,e)=>(w(),k(M,null,{navbar:c(()=>[m(v,{breadcrumb:n})]),content:c(()=>[m(D,{"entity-name":"organization",loading:h(p),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:y.value,fields:i,onCreate:f},null,8,["loading","table"])]),_:1}))}});export{et as default};
//# sourceMappingURL=Organizations.5eeb2d07.js.map
