import{d as k,u as y,K as A,b as o,c as n,y as d,V as $,W as w,v as r,B as h,H as g,e as B,a5 as L,R as b,N as V,O as E,q as f,x as F,G as D,o as T,A as v,F as R,J as U,a6 as H,a as M,E as N,t as I,a7 as J,a8 as W,w as O}from"./registerWidgets.fff064a1.js";import{p as P}from"./icons.907f45d7.js";import{a as x}from"./CircularLoading.59d7fd3d.js";import{F as j}from"./forms.7bc6baea.js";import{D as q}from"./dashes.f5f65b41.js";import{H as z}from"./hooks.039c0cd9.js";import{J as C}from"./jobs.af366134.js";import{W as G}from"./workspaces.32af92db.js";const S=e=>(V("data-v-d2e2e675"),e=e(),E(),e),K={class:"runtime-settings"},Z={key:0,class:"field"},Q=S(()=>r("div",{class:"label"},"Path",-1)),X={class:"field"},Y=S(()=>r("div",{class:"label"},"Code",-1)),tt={class:"input-row"},et={key:1,class:"root-path loading"},ot={key:1,class:"error"},st=k({__name:"RuntimeCommonSettings",props:{runtime:null},setup(e){const t=e,c=y({pathError:null}),{result:a}=x(()=>G.get()),m=()=>{!a.value||!t.runtime.file||a.value.openFile(t.runtime.file)},s=()=>{!a.value||!l.value||a.value.openFile(".")},_=A(),{result:l}=x(()=>fetch("/_editor/api/workspace/root-path").then(u=>u.text()));return t.runtime.onUpdate(()=>{if(!(t.runtime instanceof C))if(console.log("runtime updated",t.runtime.path),t.runtime instanceof j)_.push({path:`/_editor/form/${t.runtime.path}`});else if(t.runtime instanceof z)_.push({path:`/_editor/hook/${t.runtime.path}`});else if(t.runtime instanceof q)_.push({path:`/_editor/dash/${t.runtime.path}`});else throw new Error(`Unknown runtime type ${t.runtime}`)}),(u,i)=>(o(),n("div",K,[e.runtime instanceof d(C)?h("",!0):(o(),n("div",Z,[Q,$(r("input",{"onUpdate:modelValue":i[0]||(i[0]=p=>e.runtime.path=p),class:"path-input",type:"text"},null,512),[[w,e.runtime.path]])])),r("div",X,[Y,r("div",tt,[d(l)?(o(),n("button",{key:0,class:"root-path",onClick:i[1]||(i[1]=p=>s())},g(d(l)),1)):(o(),n("span",et," Loading... ")),$(r("input",{"onUpdate:modelValue":i[2]||(i[2]=p=>e.runtime.file=p),type:"text"},null,512),[[w,e.runtime.file]]),r("button",{class:"open-file-icon",onClick:i[3]||(i[3]=p=>m())},[B(L,{path:d(P)},null,8,["path"]),b(" Open in editor ")])])]),c.pathError?(o(),n("div",ot,g(c.pathError),1)):h("",!0)]))}});const It=f(st,[["__scopeId","data-v-d2e2e675"]]),nt={class:"tab-menu"},at={class:"tabs"},it={key:0,class:"group"},rt={class:"group"},ct=["onClick"],lt={key:1,class:"group"},ut={class:"content"},dt=k({__name:"TabMenuUnderline",setup(e){const t=y([]),c=F(),a=s=>{const _=l=>l==s;t.forEach((l,u)=>{l.isActive=_(u)})},m=D(()=>t.findIndex(s=>s.isActive));return H("addTab",s=>{t.push(s)}),T(()=>{a(0)}),(s,_)=>{const l=M("icon");return o(),n("div",nt,[r("div",at,[d(c).left?(o(),n("div",it,[v(s.$slots,"left",{},void 0,!0)])):h("",!0),r("div",rt,[(o(!0),n(R,null,U(t,(u,i)=>(o(),n("button",{key:u.title,class:N(["form-tab",d(m)==i&&"active"]),onClick:p=>a(i)},[u.icon?(o(),I(l,{key:0,path:u.icon,fill:"#8692A5",width:"10",height:"10"},null,8,["path"])):h("",!0),b(" "+g(u.title),1)],10,ct))),128))]),d(c).right?(o(),n("div",lt,[v(s.$slots,"right",{},void 0,!0)])):h("",!0)]),r("div",ut,[v(s.$slots,"default",{},void 0,!0)])])}}});const St=f(dt,[["__scopeId","data-v-60b2affa"]]),_t={class:"tab"},pt=k({__name:"Tab",props:{title:null,icon:null},setup(e){const t=e,c=y({isActive:!1,title:t.title,icon:t.icon}),a=J("addTab");return T(()=>{a(c)}),(m,s)=>$((o(),n("div",_t,[v(m.$slots,"default",{},void 0,!0)],512)),[[W,c.isActive]])}});const At=f(pt,[["__scopeId","data-v-9c2e92c2"]]),mt={},ht={width:"12",height:"10",viewBox:"0 0 12 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ft=r("path",{d:"M2.8725 4.25L5.5575 1.5575L4.5 0.5L0 5L4.5 9.5L5.5575 8.4425L2.8725 5.75H12V4.25H2.8725Z",fill:"#6D7C93"},null,-1),vt=[ft];function kt(e,t){return o(),n("svg",ht,vt)}const $t=f(mt,[["render",kt]]),gt=k({__name:"BackButton",props:{link:null},setup(e){return(t,c)=>{const a=M("router-link");return o(),I(a,{class:"link-button",to:e.link},{default:O(()=>[B($t),b(" Back ")]),_:1},8,["to"])}}});const Lt=f(gt,[["__scopeId","data-v-56a12edc"]]);export{Lt as B,It as R,St as T,At as a};
//# sourceMappingURL=BackButton.0686fb5a.js.map
