import e from "../../../../lodash-es/forEach.js";
import t from "../../../../lodash-es/map.js";
import n from "../../../../lodash-es/min.js";
//#region ../../node_modules/dagre-d3-es/src/dagre/rank/util.js
function r(r) {
	var i = {};
	function a(e) {
		var o = r.node(e);
		if (Object.prototype.hasOwnProperty.call(i, e)) return o.rank;
		i[e] = !0;
		var s = n(t(r.outEdges(e), function(e) {
			return a(e.w) - r.edge(e).minlen;
		}));
		return (s === Infinity || s == null) && (s = 0), o.rank = s;
	}
	e(r.sources(), a);
}
function i(e, t) {
	return e.node(t.w).rank - e.node(t.v).rank - e.edge(t).minlen;
}
//#endregion
export { r as longestPath, i as slack };

//# sourceMappingURL=util.js.map