import{S as E}from"./SaveButton.19767b11.js";import{C as V}from"./CrudView.ae9acdbf.js";import{a as x}from"./asyncComputed.fcda3bbf.js";import{u as h}from"./polling.3fa763eb.js";import{o as y}from"./omniChatStore.7479aa96.js";import{a as A}from"./controller.c17e6763.js";import{d as F,J as B,aj as I,K as S,u as e,c as m,ed as T,w as a,F as c,aL as U,o as d,b as i,az as u,bM as D,eb as b,cr as L,d5 as M,cx as N,cs as O,cE as P}from"./index.aa57db48.js";import{A as j}from"./index.0cc8d51e.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[s]="334459e9-957d-43b4-a139-a98c23687939",r._sentryDebugIdIdentifier="sentry-dbid-334459e9-957d-43b4-a139-a98c23687939")}catch{}})();const Q=F({__name:"View",props:{envVarRepository:{},mode:{},fileOpener:{}},setup(r){const s=r,{result:t,loading:g,refetch:k}=x(async()=>{const o=await A.create(s.envVarRepository,s.mode,s.fileOpener);return w(),o}),{startPolling:w,endPolling:C}=h({task:()=>{var o;return(o=t.value)==null?void 0:o.pollingFunction()},interval:2e3}),_={columns:[],rows:[]};return B(()=>{const o=y.subscribe("envVarCreated",()=>{k()});I(()=>{C(),y.unsubscribe(o)})}),(o,l)=>{var p,v;return d(),S(U,null,[e(t)?(d(),m(V,{key:0,"entity-name":"Env var",loading:e(g),title:"Environment Variables",description:"Set environment variables for your project.","empty-title":"No environment variables set",table:e(t).table()||_,"create-button-text":"Add Environment Variable",create:e(t).create,fields:e(t).creationFields||[],live:e(t).isLocalEditor},T({_:2},[(p=e(t))!=null&&p.isLocalEditor?{name:"secondary",fn:a(()=>{var n;return[i(e(D),{onClick:(n=e(t))==null?void 0:n.openEnvFile},{default:a(()=>[u("Open .env")]),_:1},8,["onClick"])]}),key:"0"}:void 0,(v=e(t))!=null&&v.isLocalEditor?{name:"extra",fn:a(()=>[i(e(j),{"show-icon":"",style:{"margin-top":"20px"}},{message:a(()=>[u(" This is simply a helper to manage your environment variables locally. The variables set here will not be deployed to Cloud with your project. ")]),_:1})]),key:"1"}:void 0,e(t)?{name:"more",fn:a(()=>[i(E,{model:e(t),disabled:!e(t).hasChanges()},{"with-changes":a(()=>[u(b(e(t).saveMessage),1)]),_:1},8,["model","disabled"])]),key:"2"}:void 0]),1032,["loading","table","create","fields","live"])):c("",!0),e(t)?(d(),m(e(P),{key:1,open:e(t).isUpdating,title:"Update value",onCancel:l[1]||(l[1]=n=>{var f;return(f=e(t))==null?void 0:f.cancelUpdate()}),onOk:l[2]||(l[2]=()=>{var n;return(n=e(t))==null?void 0:n.confirmUpdate()})},{default:a(()=>[e(t).state.value.type==="updating"?(d(),m(e(L),{key:0,layout:"vertical"},{default:a(()=>[i(e(O),null,{default:a(()=>[i(e(M),null,{default:a(()=>[u(b(e(t).state.value.name),1)]),_:1}),i(e(N),{value:e(t).state.value.value,"onUpdate:value":l[0]||(l[0]=n=>e(t).state.value.value=n)},null,8,["value"])]),_:1})]),_:1})):c("",!0)]),_:1},8,["open"])):c("",!0)],64)}}});export{Q as _};
//# sourceMappingURL=View.vue_vue_type_script_setup_true_lang.2d9f213a.js.map
