var e=`/api`,t=class extends Error{status=404;constructor(e){super(`Not found: ${e}`),this.name=`ApiNotFoundError`}},n=class extends Error{constructor(e,t,n){super(`API error: ${e} ${t} (${n})`),this.status=e,this.statusText=t,this.name=`ApiError`}};async function r(r){let i=await fetch(`${e}${r}`);if(!i.ok)throw i.status===404?new t(r):new n(i.status,i.statusText,r);return i.json()}async function i(e,t,n){return r(`/games/${e}/teams/${t}/h2h/${n}`)}function a(e,t){return r(`/games/${e}/matches/${t}/vetoes`)}async function o(e,t,n={}){return r(`/games/${e}/search?q=${encodeURIComponent(t)}&category=${n.category??`all`}&limit=${n.limit??8}`)}export{i as a,a as i,t as n,o,r,n as t};