import{d as y,o as f,L as b,H as v,b as _,ev as g,f as l,w as r,u as s,bG as w,ar as d}from"./outputWidgets.74b0761d.js";import{W as x}from"./workspaces.f4f2d84c.js";import{E as i}from"./envVars.a9111784.js";import{i as k}from"./icons.fd5c09b0.js";import{C}from"./CrudView.742df36b.js";import{A as h}from"./index.5e119e42.js";import"./runnerData.1309ae56.js";import"./url.0584bb06.js";import"./record.acc69298.js";import"./pubsub.4c1d9617.js";import"./asyncComputed.fbb4ba44.js";import"./Paragraph.5d2768c0.js";import"./Base.4463d78c.js";import"./Typography.5e0282a3.js";import"./Form.a24c61ad.js";import"./hasIn.d2130316.js";import"./Modal.80395829.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.9e6cb829.js";import"./router.e97d6286.js";import"./popupNotifcation.2bb5bdcc.js";import"./index.0327679a.js";import"./Title.a6d4b5b0.js";import"./Text.b007494b.js";import"./index.2189f45b.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]="02ab8b0a-3413-4d9d-9611-c96a7d555710",a._sentryDebugIdIdentifier="sentry-dbid-02ab8b0a-3413-4d9d-9611-c96a7d555710")}catch{}})();const E={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},R=y({__name:"EnvVarsEditor",setup(a){let o=null;f(()=>{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"}],u=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 c({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:u.value,"create-button-text":"Add Environment Variable",fields:m,live:"",onCreate:c},{secondary:r(()=>[l(s(w),{onClick:t[0]||(t[0]=n=>p())},{default:r(()=>[d("Open .env")]),_:1})]),extra:r(()=>[l(s(h),{"show-icon":"",style:{"margin-top":"20px"}},{message:r(()=>[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{R as default};
//# sourceMappingURL=EnvVarsEditor.34af1a60.js.map
