import{d as g,ex as A,ey as j,r as C,F as T,b as t,c as o,bw as m,ez as w,er as n,eA as I,ew as $,e as r,I as x,eu as h,u as D,eq as S,bu as u,t as b,eB as v,eC as k,e8 as W,e9 as E,a as F}from"./registerWidgets.4423f919.js";import{d as N,w as O,a as P,c as R,m as V,b as z}from"./icons.83f94343.js";import{T as K}from"./Tooltip.8617d77b.js";import{_ as M}from"./logo.084e5d7c.js";import{a as q}from"./asyncComputed.39878ec5.js";import{W as G}from"./workspaces.2e933305.js";import{L,D as H}from"./DocsButton.8e7a1ad0.js";import"./activeRecord.9d71c559.js";import"./pubsub.7260b9d2.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},c=new Error().stack;c&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[c]="808d89df-5ed9-45f2-b2f3-2766aaaab6bc",e._sentryDebugIdIdentifier="sentry-dbid-808d89df-5ed9-45f2-b2f3-2766aaaab6bc")}catch{}})();const U={class:"sidebar"},J={class:"section-name"},Q=["onClick"],X={class:"item-name"},Y={key:0,class:"tag soon"},Z={key:1,class:"tag beta"},ee={key:2,class:"tag cloud"},te=g({__name:"Sidebar",setup(e){var f;const c=A(),d=j(),a=C((f=d.name)!=null?f:"forms"),p=T(()=>[{name:"Runtime",items:[{name:"Forms",icon:N,path:"forms"},{name:"Hooks",icon:O,path:"hooks"},{name:"Dashes",icon:P,path:"dashes",beta:!0}]},{name:"Settings",items:[{name:"Style",icon:R,path:"style"},{name:"Sidebar",icon:V,path:"sidebar"}]}]),y=l=>{l.unavailable||(c.push(l.path),a.value=l.path)};return(l,i)=>(t(),o("div",U,[(t(!0),o(m,null,w(p.value,_=>(t(),o("div",{key:_.name,class:"section"},[n("span",J,I(_.name),1),(t(!0),o(m,null,w(_.items,s=>(t(),o("div",{key:s.name,role:"button",class:$(["item",{active:a.value===s.path,disabled:s.unavailable||_.cloud}]),tabindex:"0",onClick:Ie=>y(s)},[r(x,{class:$(["icon",{disabled:s.unavailable,active:a.value===s.path}]),path:s.icon,width:"20",height:"20"},null,8,["class","path"]),n("span",X,I(s.name),1),s.unavailable?(t(),o("span",Y,"SOON")):h("",!0),s.beta?(t(),o("span",Z,"BETA")):h("",!0),s.cloud?(t(),o("span",ee,"CLOUD")):h("",!0),s.warning?(t(),D(K,{key:3,class:"warning",text:s.warning,fixed:!0,top:18,left:18},{default:S(()=>[r(x,{path:u(z),fill:"#D35249",width:"20",height:"20"},null,8,["path"])]),_:2},1032,["text"])):h("",!0)],10,Q))),128))]))),128))]))}});const oe=b(te,[["__scopeId","data-v-7f7d195e"]]);const se={},B=e=>(v("data-v-ccfb70ef"),e=e(),k(),e),ae={class:"logo"},ne=B(()=>n("img",{src:M,alt:"Abstra cloud logo"},null,-1)),ce=B(()=>n("span",null," Abstra ",-1)),re=[ne,ce];function le(e,c){return t(),o("div",ae,re)}const ie=b(se,[["render",le],["__scopeId","data-v-ccfb70ef"]]),de=e=>(v("data-v-920953d9"),e=e(),k(),e),_e={key:0,class:"login-block"},ue={key:1,class:"login-block"},pe=["href"],fe=de(()=>n("button",{class:"button"},"Deploy",-1)),he={key:1,class:"button"},be={key:2,class:"login-block"},ye=g({__name:"LoginBlock",setup(e){const c=C(!1),{loading:d,result:a,refetch:p}=q(()=>L.get());async function y(){const i=prompt(`Login to our console at https://cloud.abstra.io and get an API Key to deploy your Projects.

Enter your API Key here:`);!i||(await L.create(i),p())}async function f(){!a.value||(await a.value.delete(),p())}async function l(){if(!!a.value){c.value=!0;try{await G.deploy(),window.open(`https://cloud.abstra.io/projects/${a.value.projectId}/builds`,"_blank")}catch(i){W.error({message:"Deploy failed",description:String(i)})}c.value=!1}}return(i,_)=>u(d)?(t(),o("div",_e,"loading...")):u(a)?(t(),o("div",ue,[n("a",{class:"button",href:`https://cloud.abstra.io/projects/${u(a).projectId}`,target:"_blank"},"Go to console ",8,pe),c.value?(t(),o("button",he,"Deploying ...")):(t(),D(u(E),{key:0,title:"Are you sure you want to deploy this project to Abstra Cloud?",onConfirm:l},{default:S(()=>[fe]),_:1})),n("button",{class:"button",onClick:f},"Logout")])):(t(),o("div",be,[n("button",{class:"button",onClick:y},"Login to deploy")]))}});const me=b(ye,[["__scopeId","data-v-920953d9"]]),ge=e=>(v("data-v-77e07499"),e=e(),k(),e),ve=ge(()=>n("div",{class:"grow"},null,-1)),ke={class:"workspace"},we=g({__name:"Workspace",setup(e){return(c,d)=>{const a=F("router-view");return t(),o(m,null,[n("nav",null,[r(ie),ve,r(H),r(me)]),n("div",ke,[r(oe,{class:"sidebar"}),r(a)])],64)}}});const Te=b(we,[["__scopeId","data-v-77e07499"]]);export{Te as default};
//# sourceMappingURL=Workspace.9deb2673.js.map
