import { useRef as t, useEffect as l } from "react";
import f from "./useRenderCount.js";
const p = ["color: #4c5667", "background-color: #e5ebf0", "padding: 2px 4px", "border-radius: 2px"].join(";"), b = (d, e) => {
  const a = f(), c = t({}), n = t(e), o = t(Date.now()), i = Object.keys({ ...e, ...n.current });
  c.current = i.reduce((s, r) => e[r] === n.current[r] ? s : {
    ...s,
    [r]: {
      previous: n.current[r],
      current: e[r]
    }
  }, {});
  const u = {
    renderCount: a,
    changedProps: c.current,
    timeSinceLastRender: Date.now() - o.current,
    lastRenderTimestamp: o.current
  };
  return l(() => {
    n.current = e, o.current = Date.now(), console && (console.groupCollapsed(`%c[debug-info] ${d}`, p), console.log(u), console.groupEnd());
  }), u;
};
export {
  b as default
};
//# sourceMappingURL=useDebugInfo.js.map
