import e from "../../../lodash-es/forEach.js";
import { addDummyNode as t } from "./util.js";
//#region ../../node_modules/dagre-d3-es/src/dagre/add-border-segments.js
function n(t) {
	function n(i) {
		var a = t.children(i), o = t.node(i);
		if (a.length && e(a, n), Object.prototype.hasOwnProperty.call(o, "minRank")) {
			o.borderLeft = [], o.borderRight = [];
			for (var s = o.minRank, c = o.maxRank + 1; s < c; ++s) r(t, "borderLeft", "_bl", i, o, s), r(t, "borderRight", "_br", i, o, s);
		}
	}
	e(t.children(), n);
}
function r(e, n, r, i, a, o) {
	var s = {
		width: 0,
		height: 0,
		rank: o,
		borderType: n
	}, c = a[n][o - 1], l = t(e, "border", s, r);
	a[n][o] = l, e.setParent(l, i), c && e.setEdge(c, l, { weight: 1 });
}
//#endregion
export { n as addBorderSegments };
