import c from "axios";
import n from "axios/lib/adapters/xhr.js";
const r = /* @__PURE__ */ new Map(), h = 10 * 60 * 1e3, i = (a) => {
  const { url: s, method: o } = a, t = JSON.stringify({ url: s, method: o });
  if (r.has(t)) {
    const e = r.get(t);
    if (Date.now() - e.timestamp < h)
      return e.error ? Promise.reject(e.error) : Promise.resolve({ headers: e.headers });
    r.delete(t);
  }
  return n(a).then((e) => (r.set(t, { headers: e.headers, timestamp: Date.now() }), e)).catch((e) => {
    throw r.set(t, { error: e, timestamp: Date.now() }), e;
  });
}, p = c.create({
  adapter: i,
  timeout: 5e3
});
export {
  p as default
};
