import{d7 as c,bI as r}from"./index-Dz5JRQhj.js";const p=async(a,n)=>{const t=new URLSearchParams;return t.set("project",n),t.set("recursion","1"),fetch(`/1.0/networks/${encodeURIComponent(a)}/load-balancers?${t.toString()}`).then(r).then(e=>e.metadata.sort((o,s)=>o.listen_address.localeCompare(s.listen_address)*10+(o.location&&s.location?o.location.localeCompare(s.location):0)))},i=async(a,n,t)=>{const e=new URLSearchParams;return e.set("project",t),e.set("recursion","1"),fetch(`/1.0/networks/${encodeURIComponent(a)}/load-balancers/${encodeURIComponent(n)}?${e.toString()}`).then(r).then(o=>o.metadata)},h=async(a,n,t)=>{const e=new URLSearchParams;return e.set("project",t),fetch(`/1.0/networks/${encodeURIComponent(a)}/load-balancers?${e.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(c).then(o=>o.headers.get("Location")?.split("/").pop()??"")},m=async(a,n,t)=>{const e=new URLSearchParams;e.set("project",t),await fetch(`/1.0/networks/${encodeURIComponent(a)}/load-balancers/${encodeURIComponent(n.listen_address)}?${e.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(r)},w=async(a,n,t)=>{const e=new URLSearchParams;e.set("project",t),await fetch(`/1.0/networks/${encodeURIComponent(a.name)}/load-balancers/${encodeURIComponent(n.listen_address)}?${e.toString()}`,{method:"DELETE"}).then(r)};export{p as a,h as c,w as d,i as f,m as u};
