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