import{d as y,o as f,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 p}from"./outputWidgets.25dce6ef.js";import{W as x}from"./workspaces.7774725f.js";import{E as i}from"./envVars.bcc2bdd3.js";import{i as k}from"./icons.7960dc02.js";import{C}from"./CrudView.95230a58.js";import{A as h}from"./index.85d40d30.js";import"./runnerData.361e047a.js";import"./url.79cbe7ef.js";import"./record.7f3a448e.js";import"./pubsub.d8283e38.js";import"./asyncComputed.a16c4c65.js";import"./Paragraph.fadf37c7.js";import"./Base.fa280ef3.js";import"./Typography.339a5435.js";import"./Form.3655a4e5.js";import"./hasIn.e0d864a0.js";import"./Modal.69a1b2db.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.049638d2.js";import"./router.e51f5f97.js";import"./popupNotifcation.c74dae43.js";import"./index.fc4c597e.js";import"./Title.83602e90.js";import"./Text.b67c302b.js";import"./index.7c4562af.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="0d994d1d-5667-4c3d-9870-acdb7164180e",n._sentryDebugIdIdentifier="sentry-dbid-0d994d1d-5667-4c3d-9870-acdb7164180e")}catch{}})();const E={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},R=y({__name:"EnvVarsEditor",setup(n){let o=null;f(()=>{o=setInterval(i.listComputed.refetch,2e3)}),b(()=>{o&&clearInterval(o)});function d(){var e;(e=x.computed.result.value)==null||e.openFile(".env")}const m=[{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(r=>({key:r.key,cells:[{type:"text",text:r.key},{text:r.value,type:"secret"},{type:"actions",actions:[{icon:k,label:"Delete",onClick:()=>r.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:m,live:"",onCreate:u},{secondary:a(()=>[l(s(w),{onClick:t[0]||(t[0]=r=>d())},{default:a(()=>[p("Open .env")]),_:1})]),extra:a(()=>[l(s(h),{"show-icon":"",style:{"margin-top":"20px"}},{message:a(()=>[p(" 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{R as default};
//# sourceMappingURL=EnvVarsEditor.75fd1dea.js.map
