import{d as y,o as f,K as v,H as b,b as _,eu as g,f as l,w as r,u as s,eQ as w,bE as x,aq as p}from"./outputWidgets.67d01534.js";import{W as k}from"./workspaces.e9b90016.js";import{E as i}from"./envVars.5aa8e6b1.js";import{C}from"./CrudView.d78585d4.js";import{A as E}from"./index.12d5bc2c.js";import"./runnerData.0c424852.js";import"./url.df413b89.js";import"./record.97ce606c.js";import"./pubsub.ce0b10ac.js";import"./asyncComputed.9c2e7c90.js";import"./Paragraph.5d6efe5b.js";import"./Text.fce07a64.js";import"./Form.18143f38.js";import"./hasIn.18867aca.js";import"./Modal.e44b2640.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.00cfbae2.js";import"./BookOutlined.93eb4c42.js";import"./router.da0efacf.js";import"./popupNotifcation.48a418fa.js";import"./index.3dca3a8f.js";import"./Title.3431c309.js";import"./index.378e6c26.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[o]="7ef0ddac-8692-4064-a6d7-0d8a91567c08",a._sentryDebugIdIdentifier="sentry-dbid-7ef0ddac-8692-4064-a6d7-0d8a91567c08")}catch{}})();const h={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},L=y({__name:"EnvVarsEditor",setup(a){let o=null;f(()=>{o=setInterval(i.listComputed.refetch,2e3)}),v(()=>{o&&clearInterval(o)});function d(){var e;(e=k.computed.result.value)==null||e.openFile(".env")}const m=[{label:"Variable name",key:"key"},{label:"Variable value",key:"value",type:"password"}],u=b(()=>{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:w,label:"Delete",onClick:()=>n.delete(),dangerous:!0}]}]})))!=null?t:[]}});async function c({key:e,value:t}){await i.create(e,t)}return(e,t)=>(_(),g("div",h,[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:u.value,"create-button-text":"Add Environment Variable",fields:m,live:"",onCreate:c},{secondary:r(()=>[l(s(x),{onClick:t[0]||(t[0]=n=>d())},{default:r(()=>[p("Open .env")]),_:1})]),extra:r(()=>[l(s(E),{"show-icon":"",style:{"margin-top":"20px"}},{message:r(()=>[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{L as default};
//# sourceMappingURL=EnvVarsEditor.6dd0f333.js.map
