import{d as y,H as I,J as S,r as $,K as D,b as e,c as o,F as g,L as v,x as a,N as k,G as w,e as r,I as x,D as m,t as B,w as A,z as _,q as b,O as T,Q as j,a as N}from"./registerWidgets.7452ec0b.js";import{d as O,s as W,w as F,a as R,b as E,c as K,m as P,e as V}from"./icons.97625e56.js";import{T as z}from"./Tooltip.2879568f.js";import{_ as G}from"./logo.084e5d7c.js";import{a as H}from"./asyncComputed.23d75013.js";import{W as J}from"./workspaces.4c177a35.js";import{L}from"./login.29b4c1f1.js";import"./utils.95f0e9e8.js";import"./pubsub.a0411919.js";const M={class:"sidebar"},q={class:"section-name"},Q=["onClick"],U={class:"item-name"},X={key:0,class:"tag soon"},Y={key:1,class:"tag beta"},Z={key:2,class:"tag cloud"},ee=y({__name:"Sidebar",setup(n){var p;const c=I(),u=S(),s=$((p=u.name)!=null?p:"forms"),d=D(()=>[{name:"Runtime",items:[{name:"Forms",icon:O,path:"forms"},{name:"Jobs",icon:W,path:"jobs",cloud:!0},{name:"Hooks",icon:F,path:"hooks"},{name:"Dashes",icon:R,path:"dashes",beta:!0}]},{name:"Resources",items:[{name:"Tables",icon:E,path:"tables",beta:!0}]},{name:"Settings",items:[{name:"Style",icon:K,path:"style"},{name:"Sidebar",icon:P,path:"sidebar"}]}]),f=l=>{l.unavailable||(c.push(l.path),s.value=l.path)};return(l,h)=>(e(),o("div",M,[(e(!0),o(g,null,v(_(d),i=>(e(),o("div",{key:i.name,class:"section"},[a("span",q,k(i.name),1),(e(!0),o(g,null,v(i.items,t=>(e(),o("div",{key:t.name,role:"button",class:w(["item",{active:s.value===t.path,disabled:t.unavailable||i.cloud}]),tabindex:"0",onClick:ge=>f(t)},[r(x,{class:w(["icon",{disabled:t.unavailable,active:s.value===t.path}]),path:t.icon,width:"20",height:"20"},null,8,["class","path"]),a("span",U,k(t.name),1),t.unavailable?(e(),o("span",X,"SOON")):m("",!0),t.beta?(e(),o("span",Y,"BETA")):m("",!0),t.cloud?(e(),o("span",Z,"CLOUD")):m("",!0),t.warning?(e(),B(z,{key:3,class:"warning",text:t.warning,fixed:!0,top:18,left:18},{default:A(()=>[r(x,{path:_(V),fill:"#D35249",width:"20",height:"20"},null,8,["path"])]),_:2},1032,["text"])):m("",!0)],10,Q))),128))]))),128))]))}});const oe=b(ee,[["__scopeId","data-v-320e9ff3"]]);const te={},C=n=>(T("data-v-ccfb70ef"),n=n(),j(),n),se={class:"logo"},ae=C(()=>a("img",{src:G,alt:"Abstra cloud logo"},null,-1)),ne=C(()=>a("span",null," Abstra ",-1)),ce=[ae,ne];function le(n,c){return e(),o("div",se,ce)}const re=b(te,[["render",le],["__scopeId","data-v-ccfb70ef"]]),ie={key:0,class:"login-block"},_e={key:1,class:"login-block"},ue=["href"],de={key:1,class:"button"},pe={key:2,class:"login-block"},he=y({__name:"LoginBlock",setup(n){const c=$(!1),{loading:u,result:s,refetch:d}=H(()=>L.get());async function f(){const h=prompt(`Login to our console at https://cloud.abstra.io and get an API Key to deploy your Projects.

Enter your API Key here:`);!h||(await L.create(h),d())}async function p(){!s.value||(await s.value.delete(),d())}async function l(){!s.value||(c.value=!0,confirm("Are you sure you want to deploy this project to Abstra Cloud?")&&(await J.deploy(),alert("Deployed!")),c.value=!1)}return(h,i)=>_(u)?(e(),o("div",ie,"loading...")):_(s)?(e(),o("div",_e,[a("a",{class:"button",href:`https://cloud.abstra.io/projects/${_(s).projectId}`,target:"_blank"},"Go to console ",8,ue),c.value?(e(),o("button",de,"Deploying...")):(e(),o("button",{key:0,class:"button",onClick:l},"Deploy")),a("button",{class:"button",onClick:p},"Logout")])):(e(),o("div",pe,[a("button",{class:"button",onClick:f},"Login to deploy")]))}});const me=b(he,[["__scopeId","data-v-279534de"]]),be={class:"workspace"},fe=y({__name:"Workspace",setup(n){return(c,u)=>{const s=N("router-view");return e(),o(g,null,[a("nav",null,[r(re),r(me)]),a("div",be,[r(oe,{class:"sidebar"}),r(s)])],64)}}});const Se=b(fe,[["__scopeId","data-v-91804c74"]]);export{Se as default};
//# sourceMappingURL=Workspace.422575e6.js.map
