import{k as d,H as l,O as w,c as g}from"./BSfFG59R.js";import{t as m}from"./Dxr58r9-.js";const C=(p,n={})=>{const o=d().$i18n?.locale??{value:"en"},s=g(),y=l("geo-info",()=>({country:"",city:""})),f=Array.isArray(n.watch)?n.watch:[],a=n.onRequest,c=n.onResponse,r=e=>{if(!e)return"";try{return decodeURIComponent(e)}catch{return e}};return w(s.public.apiBase+p,{retry:0,...n,watch:[...f,o],async onRequest(e){const t=new Headers(e.options.headers);t.set("BT-Domain",s.public.btDomain),t.set("BT-Language",m(o.value)),e.options.headers=t,typeof a=="function"&&await a(e)},async onResponse(e){const t=e.response.headers.get("req-country"),h=e.response.headers.get("req-city"),u=r(t),i=r(h);(u||i)&&(y.value={country:u||"",city:i||""}),typeof c=="function"&&await c(e)}},"$5zAUq7wPc8")};export{C as u};
