import * as a from "d3";
const n = {}, o = {}, u = 3 * 60 * 1e3, r = (t) => JSON.parse(JSON.stringify(t)), l = (t) => {
  const i = Date.now(), e = t;
  if (n[e])
    return n[e].then(r);
  if (o[e] && i - o[e].timestamp < u)
    return Promise.resolve(r(o[e].data));
  const s = a.json(t).then((c) => (o[e] = { data: c, timestamp: Date.now() }, c)).finally(() => {
    delete n[e];
  });
  return n[e] = s, s.then(r);
}, m = (t) => l(t);
export {
  m as loadJSON
};
