import{S as k}from"./SaveButton.9c6a5df2.js";import{C as _}from"./CrudView.75d6f80a.js";import{a as E}from"./asyncComputed.c4333d47.js";import{u as T}from"./polling.b00cc5ce.js";import{o as p}from"./omniChatStore.6b2bc826.js";import{a as x}from"./controller.6ad7dde1.js";import{d as A,k as B,aq as F,a5 as I,u as e,a as d,ef as S,b as a,h as u,aR as U,o as i,f as c,g as m,bR as D,ec as b,cw as M,d8 as N,cC as O,cx as P,M as R}from"./jwt-decode.esm.c1356de1.js";import{A as L}from"./index.04b3ace7.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[n]="12de953d-bace-4edc-bcbb-76be7e8f6551",l._sentryDebugIdIdentifier="sentry-dbid-12de953d-bace-4edc-bcbb-76be7e8f6551")}catch{}})();const Q=A({__name:"View",props:{envVarRepository:{},mode:{},fileOpener:{},hideTitle:{type:Boolean}},setup(l){const n=l,{result:t,loading:h,refetch:f}=E(async()=>{const o=await x.create(n.envVarRepository,n.mode,n.fileOpener);return w(),o}),{startPolling:w,endPolling:C}=T({task:()=>{var o;return(o=t.value)==null?void 0:o.pollingFunction()},interval:2e3}),V={columns:[],rows:[]};return B(()=>{const o=p.subscribe("envVarCreated",()=>{f()}),r=p.subscribe("envVarEdited",()=>{f()});F(()=>{C(),p.unsubscribe(o),p.unsubscribe(r)})}),(o,r)=>{var v,y;return i(),I(U,null,[e(t)?(i(),d(_,{key:0,"entity-name":"Env var",loading:e(h),title:n.hideTitle?"":"Environment Variables",description:n.hideTitle?"":"Set environment variables for your project.","empty-title":"No environment variables set",table:e(t).table()||V,"create-button-text":"Add Environment Variable",create:e(t).create,fields:e(t).creationFields||[],live:e(t).isLocalEditor},S({_:2},[(v=e(t))!=null&&v.isLocalEditor?{name:"secondary",fn:a(()=>{var s;return[c(e(D),{onClick:(s=e(t))==null?void 0:s.openEnvFile},{default:a(()=>[m("Open .env")]),_:1},8,["onClick"]),o.mode=="editor"?(i(),d(k,{key:0,model:e(t),disabled:!e(t).hasChanges()},{"with-changes":a(()=>[m(b(e(t).saveMessage),1)]),_:1},8,["model","disabled"])):u("",!0)]}),key:"0"}:void 0,(y=e(t))!=null&&y.isLocalEditor?{name:"extra",fn:a(()=>[c(e(L),{"show-icon":"",style:{"margin-top":"20px"}},{message:a(()=>[m(" 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(()=>[o.mode=="console"?(i(),d(k,{key:0,model:e(t),disabled:!e(t).hasChanges()},{"with-changes":a(()=>[m(b(e(t).saveMessage),1)]),_:1},8,["model","disabled"])):u("",!0)]),key:"2"}:void 0]),1032,["loading","title","description","table","create","fields","live"])):u("",!0),e(t)?(i(),d(e(R),{key:1,open:e(t).isUpdating,title:"Update value",onCancel:r[1]||(r[1]=s=>{var g;return(g=e(t))==null?void 0:g.cancelUpdate()}),onOk:r[2]||(r[2]=()=>{var s;return(s=e(t))==null?void 0:s.confirmUpdate()})},{default:a(()=>[e(t).state.value.type==="updating"?(i(),d(e(M),{key:0,layout:"vertical"},{default:a(()=>[c(e(P),null,{default:a(()=>[c(e(N),null,{default:a(()=>[m(b(e(t).state.value.name),1)]),_:1}),c(e(O),{value:e(t).state.value.value,"onUpdate:value":r[0]||(r[0]=s=>e(t).state.value.value=s)},null,8,["value"])]),_:1})]),_:1})):u("",!0)]),_:1},8,["open"])):u("",!0)],64)}}});export{Q as _};
//# sourceMappingURL=View.vue_vue_type_script_setup_true_lang.4b0e3383.js.map
