import m from "./index.es461.js";
import u from "./index.es462.js";
import g from "./index.es227.js";
const y = (o, e, l = 3) => {
  let s = 0;
  const c = m(50, 250);
  return u((n) => {
    const r = n.loaded, t = n.lengthComputable ? n.total : void 0, d = r - s, a = c(d), p = r <= t;
    s = r;
    const i = {
      loaded: r,
      total: t,
      progress: t ? r / t : void 0,
      bytes: d,
      rate: a || void 0,
      estimated: a && t && p ? (t - r) / a : void 0,
      event: n,
      lengthComputable: t != null,
      [e ? "download" : "upload"]: !0
    };
    o(i);
  }, l);
}, h = (o, e) => {
  const l = o != null;
  return [(s) => e[0]({
    lengthComputable: l,
    total: o,
    loaded: s
  }), e[1]];
}, C = (o) => (...e) => g.asap(() => o(...e));
export {
  C as asyncDecorator,
  h as progressEventDecorator,
  y as progressEventReducer
};
//# sourceMappingURL=index.es383.js.map
