var y=Object.defineProperty;var h=(a,t,e)=>t in a?y(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var u=(a,t,e)=>(h(a,typeof t!="symbol"?t+"":t,e),e);import{d as w,K as v,b as g,t as $,z as d,J as f}from"./registerWidgets.ba12cd54.js";import{a as k}from"./asyncComputed.3e2c3bcb.js";import{A as C,C as o}from"./utils.a13b462f.js";import{C as b}from"./CrudView.705290c0.js";import"./passwordlessManager.a5941d42.js";import"./pubsub.a0411919.js";import"./DropdownMenu.7287e391.js";import"./CircularLoading.79e96d11.js";import"./Modal.9cffe8c6.js";class P{constructor(){u(this,"urlPath","env-vars")}async create(t){return o.post(`projects/${t}/${this.urlPath}`,{})}async delete(t){await o.delete(`${this.urlPath}/${t}`)}async list(t){return o.get(`projects/${t}/${this.urlPath}`)}async get(t){return o.get(`${this.urlPath}/${t}`)}async update(t,e){return o.put(`${this.urlPath}/${t}`,e)}}const s=new P;class r{constructor(t){u(this,"record");this.record=new C(s,t,"id")}static async list(t){return(await s.list(t)).map(n=>new r(n))}static async create(t){const e=await s.create(t);return new r(e)}static async get(t){const e=await s.get(t);return new r(e)}static async update(t,e){const n=await s.update(t,e);return new r(n)}static async delete(t){await s.delete(t)}get key(){return this.record.get("key")}get value(){return this.record.get("value")}set value(t){this.record.set("value",t)}async save(){await this.record.save()}async delete(){await s.delete(this.key)}hasChanges(){return this.record.hasChanges()}}const J=w({__name:"EnvVars",setup(a){const e=f().params.projectId,{loading:n,result:p}=k(()=>r.list(e)),m=v(()=>{var c,i;return{columns:[{name:"Key"},{name:"Value"}],rows:(i=(c=p.value)==null?void 0:c.map(l=>({key:l.key,cells:[{text:l.key,classes:["title","centered"]},{text:l.value,classes:[]}]})))!=null?i:[]}});return(c,i)=>(g(),$(b,{"entity-name":"env-vars",loading:d(n),title:"Environment Variables",description:"Set environment variables for your project.","empty-title":"No environment variables set",table:d(m)},null,8,["loading","table"]))}});export{J as default};
//# sourceMappingURL=EnvVars.dddf610d.js.map
