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,bV as w,ar as d}from"./outputWidgets.0d6c71c4.js";import{W as x}from"./workspaces.3b8771ae.js";import{E as i}from"./envVars.57685009.js";import{i as k}from"./icons.3c0b1217.js";import{C}from"./CrudView.7208f86a.js";import{A as h}from"./index.939fb41d.js";import"./runnerData.87fb3f80.js";import"./url.54f51be3.js";import"./record.19c12a45.js";import"./pubsub.a3cc160d.js";import"./asyncComputed.27df476d.js";import"./Paragraph.fa27bd72.js";import"./Base.027fcad1.js";import"./Typography.a1d2ddc8.js";import"./Form.4c2d0255.js";import"./hasIn.e6aa186e.js";import"./Modal.2b3bb1b6.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.ba54ed30.js";import"./router.e5be387e.js";import"./index.79a50c9a.js";import"./Title.773b1396.js";import"./Text.5f5581ee.js";import"./index.c2096d22.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]="b2849884-ec3f-44d4-94f8-a8f9e7c60df2",n._sentryDebugIdIdentifier="sentry-dbid-b2849884-ec3f-44d4-94f8-a8f9e7c60df2")}catch{}})();const E={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},Q=f({__name:"EnvVarsEditor",setup(n){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 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=>p())},{default:a(()=>[d("Open .env")]),_:1})]),extra:a(()=>[l(s(h),{"show-icon":"",style:{"margin-top":"20px"}},{message:a(()=>[d(" 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{Q as default};
//# sourceMappingURL=EnvVarsEditor.a8d8383d.js.map
