import e from "../../../../lodash-es/map.js";
import t from "../../../../lodash-es/forEach.js";
import n from "../../../../lodash-es/forOwn.js";
import r from "../../../../lodash-es/max.js";
import { asNonCompoundGraph as i, buildLayerMatrix as a } from "../util.js";
import { positionX as o } from "./bk.js";
//#region ../../node_modules/dagre-d3-es/src/dagre/position/index.js
function s(e) {
	e = i(e), c(e), n(o(e), function(t, n) {
		e.node(n).x = t;
	});
}
function c(n) {
	var i = a(n), o = n.graph().ranksep, s = 0;
	t(i, function(i) {
		var a = r(e(i, function(e) {
			return n.node(e).height;
		}));
		t(i, function(e) {
			n.node(e).y = s + a / 2;
		}), s += a + o;
	});
}
//#endregion
export { s as position };
