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