import{d as f,o as y,L as b,H as v,b as _,ev as g,f as l,w as a,u as s,bG as w,ar as m}from"./outputWidgets.dd3997b1.js";import{W as x}from"./workspaces.2ea8b15b.js";import{E as i}from"./envVars.5bc5f242.js";import{i as k}from"./icons.9d0ae195.js";import{C}from"./CrudView.63395425.js";import{A as h}from"./index.b8296571.js";import"./runnerData.f27a42d3.js";import"./url.71144004.js";import"./record.27251633.js";import"./pubsub.7e2ca77e.js";import"./asyncComputed.1a148b8f.js";import"./Paragraph.142c9e94.js";import"./Base.20fd4dfc.js";import"./Typography.c4837fd7.js";import"./Form.366406d1.js";import"./hasIn.fd08179b.js";import"./Modal.af3bb857.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.9cb78b19.js";import"./router.23ca8c5c.js";import"./popupNotifcation.6af08685.js";import"./index.d42bac9c.js";import"./Title.95ef7227.js";import"./Text.6383284e.js";import"./index.e703a32a.js";import"./SyncOutlined.092b7f7b.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[o]="66981c43-5689-4729-875f-9d9dcbf18abc",r._sentryDebugIdIdentifier="sentry-dbid-66981c43-5689-4729-875f-9d9dcbf18abc")}catch{}})();const E={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},X=f({__name:"EnvVarsEditor",setup(r){let o=null;y(()=>{o=setInterval(i.listComputed.refetch,2e3)}),b(()=>{o&&clearInterval(o)});function p(){var e;(e=x.computed.result.value)==null||e.openFile(".env")}const d=[{label:"Variable name",key:"key"},{label:"Variable value",key:"value",type:"password"}],c=v(()=>{var e,t;return{columns:[{name:"Key"},{name:"Value"},{name:""}],rows:(t=(e=i.listComputed.result.value)==null?void 0:e.map(n=>({key:n.key,cells:[{type:"text",text:n.key},{text:n.value,type:"secret"},{type:"actions",actions:[{icon:k,label:"Delete",onClick:()=>n.delete(),dangerous:!0}]}]})))!=null?t:[]}});async function u({key:e,value:t}){await i.create(e,t)}return(e,t)=>(_(),g("div",E,[l(C,{"entity-name":"Env var",loading:s(i).listComputed.loading.value,title:"Environment Variables",description:"Set environment variables for your project.","empty-title":"No environment variables set",table:c.value,"create-button-text":"Add Environment Variable",fields:d,live:"",onCreate:u},{secondary:a(()=>[l(s(w),{onClick:t[0]||(t[0]=n=>p())},{default:a(()=>[m("Open .env")]),_:1})]),extra:a(()=>[l(s(h),{"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})]),_:1},8,["loading","table"])]))}});export{X as default};
//# sourceMappingURL=EnvVarsEditor.9dc73d8b.js.map
