function T(n, i, e) {
  let l = e.initialDeps ?? [], t;
  function r() {
    var o, m, h, f;
    let g;
    e.key && ((o = e.debug) != null && o.call(e)) && (g = Date.now());
    const u = n();
    if (!(u.length !== l.length || u.some((c, a) => l[a] !== c)))
      return t;
    l = u;
    let s;
    if (e.key && ((m = e.debug) != null && m.call(e)) && (s = Date.now()), t = i(...u), e.key && ((h = e.debug) != null && h.call(e))) {
      const c = Math.round((Date.now() - g) * 100) / 100, a = Math.round((Date.now() - s) * 100) / 100, b = a / 16, w = (d, v) => {
        for (d = String(d); d.length < v; )
          d = " " + d;
        return d;
      };
      console.info(
        `%c⏱ ${w(a, 5)} /${w(c, 5)} ms`,
        `
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(
          0,
          Math.min(120 - 120 * b, 120)
        )}deg 100% 31%);`,
        e?.key
      );
    }
    return (f = e?.onChange) == null || f.call(e, t), t;
  }
  return r.updateDeps = (o) => {
    l = o;
  }, r;
}
function y(n, i) {
  if (n === void 0)
    throw new Error("Unexpected undefined");
  return n;
}
const M = (n, i) => Math.abs(n - i) < 1.01, k = (n, i, e) => {
  let l;
  return function(...t) {
    n.clearTimeout(l), l = n.setTimeout(() => i.apply(this, t), e);
  };
};
export {
  M as approxEqual,
  k as debounce,
  T as memo,
  y as notUndefined
};
//# sourceMappingURL=utils.js.map
