import { C as e, N as t, S as n, T as r, _ as i, b as a, v as o, x as s, y as c } from "./chunk-5PVQY5BW-De02jDY6.js";
import { E as l, _ as u, c as d, d as f, f as p, g as m, h as ee, m as te, n as h, o as ne, p as re, r as ie, s as ae, t as g, u as _, v as oe, x as se, y as v } from "./reduce-BM17lgVY.js";
import { D as ce, O as le, T as ue, f as de, g as y, h as fe, i as pe, n as me, t as he, u as ge, w as b } from "./_baseFor-Cankmnlb.js";
import { i as _e, n as ve } from "./isEmpty-KjELx5uD.js";
import { a as x, i as ye, n as S, o as be, r as xe, t as C } from "./flatten-BftWKfuJ.js";
import { i as Se, n as w, r as T, t as E } from "./graphlib-Ci0_poOu.js";
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js
var Ce = /\s/;
function we(e) {
	for (var t = e.length; t-- && Ce.test(e.charAt(t)););
	return t;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js
var Te = /^\s+/;
function Ee(e) {
	return e && e.slice(0, we(e) + 1).replace(Te, "");
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js
var De = NaN, Oe = /^[-+]0x[0-9a-f]+$/i, ke = /^0b[01]+$/i, Ae = /^0o[0-7]+$/i, je = parseInt;
function Me(e) {
	if (typeof e == "number") return e;
	if (v(e)) return De;
	if (b(e)) {
		var t = typeof e.valueOf == "function" ? e.valueOf() : e;
		e = b(t) ? t + "" : t;
	}
	if (typeof e != "string") return e === 0 ? e : +e;
	e = Ee(e);
	var n = ke.test(e);
	return n || Ae.test(e) ? je(e.slice(2), n ? 2 : 8) : Oe.test(e) ? De : +e;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toFinite.js
var Ne = Infinity, Pe = 17976931348623157e292;
function D(e) {
	return e ? (e = Me(e), e === Ne || e === -Ne ? (e < 0 ? -1 : 1) * Pe : e === e ? e : 0) : e === 0 ? e : 0;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toInteger.js
function Fe(e) {
	var t = D(e), n = t % 1;
	return t === t ? n ? t - n : t : 0;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_flatRest.js
function Ie(e) {
	return a(n(e, void 0, C), e + "");
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hasUnicode.js
var Le = RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");
function Re(e) {
	return Le.test(e);
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js
var ze = 1, Be = 4;
function Ve(e) {
	return Se(e, ze | Be);
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/now.js
var He = function() {
	return ce.Date.now();
}, Ue = Object.prototype, We = Ue.hasOwnProperty, Ge = c(function(t, n) {
	t = Object(t);
	var r = -1, i = n.length, a = i > 2 ? n[2] : void 0;
	for (a && o(n[0], n[1], a) && (i = 1); ++r < i;) for (var s = n[r], c = e(s), l = -1, u = c.length; ++l < u;) {
		var d = c[l], f = t[d];
		(f === void 0 || le(f, Ue[d]) && !We.call(t, d)) && (t[d] = s[d]);
	}
	return t;
});
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/last.js
function O(e) {
	var t = e == null ? 0 : e.length;
	return t ? e[t - 1] : void 0;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_createFind.js
function Ke(e) {
	return function(t, n, r) {
		var i = Object(t);
		if (!pe(t)) {
			var a = f(n, 3);
			t = se(t), n = function(e) {
				return a(i[e], e, i);
			};
		}
		var o = e(t, n, r);
		return o > -1 ? i[a ? t[o] : o] : void 0;
	};
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/findIndex.js
var qe = Math.max;
function Je(e, t, n) {
	var r = e == null ? 0 : e.length;
	if (!r) return -1;
	var i = n == null ? 0 : Fe(n);
	return i < 0 && (i = qe(r + i, 0)), ne(e, f(t, 3), i);
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/find.js
var k = Ke(Je);
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/forIn.js
function Ye(t, n) {
	return t == null ? t : he(t, ie(n), e);
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/forOwn.js
function Xe(e, t) {
	return e && _(e, ie(t));
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGt.js
function Ze(e, t) {
	return e > t;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseHas.js
var Qe = Object.prototype.hasOwnProperty;
function $e(e, t) {
	return e != null && Qe.call(e, t);
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/has.js
function et(e, t) {
	return e != null && te(e, t, $e);
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isString.js
var tt = "[object String]";
function nt(e) {
	return typeof e == "string" || !y(e) && fe(e) && ue(e) == tt;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/mapValues.js
function A(e, n) {
	var r = {};
	return n = f(n, 3), _(e, function(e, i, a) {
		t(r, i, n(e, i, a));
	}), r;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/max.js
function j(e) {
	return e && e.length ? ye(e, me, Ze) : void 0;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/minBy.js
function M(e, t) {
	return e && e.length ? ye(e, f(t, 2), xe) : void 0;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSet.js
function rt(e, t, n, i) {
	if (!b(e)) return e;
	t = u(t, e);
	for (var a = -1, o = t.length, s = o - 1, c = e; c != null && ++a < o;) {
		var l = m(t[a]), d = n;
		if (l === "__proto__" || l === "constructor" || l === "prototype") return e;
		if (a != s) {
			var f = c[l];
			d = i ? i(f, l, c) : void 0, d === void 0 && (d = b(f) ? f : de(t[a + 1]) ? [] : {});
		}
		r(c, l, d), c = c[l];
	}
	return e;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_basePickBy.js
function it(e, t, n) {
	for (var r = -1, i = t.length, a = {}; ++r < i;) {
		var o = t[r], s = ee(e, o);
		n(s, o) && rt(a, u(o, e), s);
	}
	return a;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSortBy.js
function at(e, t) {
	var n = e.length;
	for (e.sort(t); n--;) e[n] = e[n].value;
	return e;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_compareAscending.js
function ot(e, t) {
	if (e !== t) {
		var n = e !== void 0, r = e === null, i = e === e, a = v(e), o = t !== void 0, s = t === null, c = t === t, l = v(t);
		if (!s && !l && !a && e > t || a && o && c && !s && !l || r && o && c || !n && c || !i) return 1;
		if (!r && !a && !l && e < t || l && n && i && !r && !a || s && n && i || !o && i || !c) return -1;
	}
	return 0;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_compareMultiple.js
function st(e, t, n) {
	for (var r = -1, i = e.criteria, a = t.criteria, o = i.length, s = n.length; ++r < o;) {
		var c = ot(i[r], a[r]);
		if (c) return r >= s ? c : c * (n[r] == "desc" ? -1 : 1);
	}
	return e.index - t.index;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseOrderBy.js
function ct(e, t, n) {
	t = t.length ? l(t, function(e) {
		return y(e) ? function(t) {
			return ee(t, e.length === 1 ? e[0] : e);
		} : e;
	}) : [me];
	var r = -1;
	return t = l(t, ge(f)), at(be(e, function(e, n, i) {
		return {
			criteria: l(t, function(t) {
				return t(e);
			}),
			index: ++r,
			value: e
		};
	}), function(e, t) {
		return st(e, t, n);
	});
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_asciiSize.js
var lt = p("length"), ut = "\\ud800-\\udfff", dt = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", ft = "\\ufe0e\\ufe0f", pt = "[" + ut + "]", N = "[" + dt + "]", P = "\\ud83c[\\udffb-\\udfff]", mt = "(?:" + N + "|" + P + ")", ht = "[^" + ut + "]", gt = "(?:\\ud83c[\\udde6-\\uddff]){2}", _t = "[\\ud800-\\udbff][\\udc00-\\udfff]", vt = "\\u200d", yt = mt + "?", bt = "[" + ft + "]?", xt = "(?:" + vt + "(?:" + [
	ht,
	gt,
	_t
].join("|") + ")" + bt + yt + ")*", St = bt + yt + xt, Ct = "(?:" + [
	ht + N + "?",
	N,
	gt,
	_t,
	pt
].join("|") + ")", wt = RegExp(P + "(?=" + P + ")|" + Ct + St, "g");
function Tt(e) {
	for (var t = wt.lastIndex = 0; wt.test(e);) ++t;
	return t;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stringSize.js
function Et(e) {
	return Re(e) ? Tt(e) : lt(e);
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_basePick.js
function Dt(e, t) {
	return it(e, t, function(t, n) {
		return re(e, n);
	});
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/pick.js
var F = Ie(function(e, t) {
	return e == null ? {} : Dt(e, t);
}), Ot = Math.ceil, kt = Math.max;
function At(e, t, n, r) {
	for (var i = -1, a = kt(Ot((t - e) / (n || 1)), 0), o = Array(a); a--;) o[r ? a : ++i] = e, e += n;
	return o;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_createRange.js
function jt(e) {
	return function(t, n, r) {
		return r && typeof r != "number" && o(t, n, r) && (n = r = void 0), t = D(t), n === void 0 ? (n = t, t = 0) : n = D(n), r = r === void 0 ? t < n ? 1 : -1 : D(r), At(t, n, r, e);
	};
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/range.js
var I = jt(), Mt = "[object Map]", Nt = "[object Set]";
function Pt(e) {
	if (e == null) return 0;
	if (pe(e)) return nt(e) ? Et(e) : e.length;
	var t = ve(e);
	return t == Mt || t == Nt ? e.size : _e(e).length;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/sortBy.js
var L = c(function(e, t) {
	if (e == null) return [];
	var n = t.length;
	return n > 1 && o(e, t[0], t[1]) ? t = [] : n > 2 && o(t[0], t[1], t[2]) && (t = [t[0]]), ct(e, ae(t, 1), []);
}), Ft = 0;
function R(e) {
	var t = ++Ft;
	return oe(e) + t;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseZipObject.js
function It(e, t, n) {
	for (var r = -1, i = e.length, a = t.length, o = {}; ++r < i;) {
		var s = r < a ? t[r] : void 0;
		n(o, e[r], s);
	}
	return o;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/zipObject.js
function Lt(e, t) {
	return It(e || [], t || [], r);
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/data/list.js
var Rt = class {
	constructor() {
		var e = {};
		e._next = e._prev = e, this._sentinel = e;
	}
	dequeue() {
		var e = this._sentinel, t = e._prev;
		if (t !== e) return zt(t), t;
	}
	enqueue(e) {
		var t = this._sentinel;
		e._prev && e._next && zt(e), e._next = t._next, t._next._prev = e, t._next = e, e._prev = t;
	}
	toString() {
		for (var e = [], t = this._sentinel, n = t._prev; n !== t;) e.push(JSON.stringify(n, Bt)), n = n._prev;
		return "[" + e.join(", ") + "]";
	}
};
function zt(e) {
	e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
}
function Bt(e, t) {
	if (e !== "_next" && e !== "_prev") return t;
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/greedy-fas.js
var Vt = s(1);
function Ht(e, t) {
	if (e.nodeCount() <= 1) return [];
	var n = Wt(e, t || Vt);
	return C(x(Ut(n.graph, n.buckets, n.zeroIdx), function(t) {
		return e.outEdges(t.v, t.w);
	}));
}
function Ut(e, t, n) {
	for (var r = [], i = t[t.length - 1], a = t[0], o; e.nodeCount();) {
		for (; o = a.dequeue();) z(e, t, n, o);
		for (; o = i.dequeue();) z(e, t, n, o);
		if (e.nodeCount()) {
			for (var s = t.length - 2; s > 0; --s) if (o = t[s].dequeue(), o) {
				r = r.concat(z(e, t, n, o, !0));
				break;
			}
		}
	}
	return r;
}
function z(e, t, n, r, i) {
	var a = i ? [] : void 0;
	return h(e.inEdges(r.v), function(r) {
		var o = e.edge(r), s = e.node(r.v);
		i && a.push({
			v: r.v,
			w: r.w
		}), s.out -= o, B(t, n, s);
	}), h(e.outEdges(r.v), function(r) {
		var i = e.edge(r), a = r.w, o = e.node(a);
		o.in -= i, B(t, n, o);
	}), e.removeNode(r.v), a;
}
function Wt(e, t) {
	var n = new E(), r = 0, i = 0;
	h(e.nodes(), function(e) {
		n.setNode(e, {
			v: e,
			in: 0,
			out: 0
		});
	}), h(e.edges(), function(e) {
		var a = n.edge(e.v, e.w) || 0, o = t(e), s = a + o;
		n.setEdge(e.v, e.w, s), i = Math.max(i, n.node(e.v).out += o), r = Math.max(r, n.node(e.w).in += o);
	});
	var a = I(i + r + 3).map(function() {
		return new Rt();
	}), o = r + 1;
	return h(n.nodes(), function(e) {
		B(a, o, n.node(e));
	}), {
		graph: n,
		buckets: a,
		zeroIdx: o
	};
}
function B(e, t, n) {
	n.out ? n.in ? e[n.out - n.in + t].enqueue(n) : e[e.length - 1].enqueue(n) : e[0].enqueue(n);
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/acyclic.js
function Gt(e) {
	h(e.graph().acyclicer === "greedy" ? Ht(e, t(e)) : Kt(e), function(t) {
		var n = e.edge(t);
		e.removeEdge(t), n.forwardName = t.name, n.reversed = !0, e.setEdge(t.w, t.v, n, R("rev"));
	});
	function t(e) {
		return function(t) {
			return e.edge(t).weight;
		};
	}
}
function Kt(e) {
	var t = [], n = {}, r = {};
	function i(a) {
		Object.prototype.hasOwnProperty.call(r, a) || (r[a] = !0, n[a] = !0, h(e.outEdges(a), function(e) {
			Object.prototype.hasOwnProperty.call(n, e.w) ? t.push(e) : i(e.w);
		}), delete n[a]);
	}
	return h(e.nodes(), i), t;
}
function qt(e) {
	h(e.edges(), function(t) {
		var n = e.edge(t);
		if (n.reversed) {
			e.removeEdge(t);
			var r = n.forwardName;
			delete n.reversed, delete n.forwardName, e.setEdge(t.w, t.v, n, r);
		}
	});
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/util.js
function V(e, t, n, r) {
	var i;
	do
		i = R(r);
	while (e.hasNode(i));
	return n.dummy = t, e.setNode(i, n), i;
}
function Jt(e) {
	var t = new E().setGraph(e.graph());
	return h(e.nodes(), function(n) {
		t.setNode(n, e.node(n));
	}), h(e.edges(), function(n) {
		var r = t.edge(n.v, n.w) || {
			weight: 0,
			minlen: 1
		}, i = e.edge(n);
		t.setEdge(n.v, n.w, {
			weight: r.weight + i.weight,
			minlen: Math.max(r.minlen, i.minlen)
		});
	}), t;
}
function Yt(e) {
	var t = new E({ multigraph: e.isMultigraph() }).setGraph(e.graph());
	return h(e.nodes(), function(n) {
		e.children(n).length || t.setNode(n, e.node(n));
	}), h(e.edges(), function(n) {
		t.setEdge(n, e.edge(n));
	}), t;
}
function Xt(e, t) {
	var n = e.x, r = e.y, i = t.x - n, a = t.y - r, o = e.width / 2, s = e.height / 2;
	if (!i && !a) throw Error("Not possible to find intersection inside of the rectangle");
	var c, l;
	return Math.abs(a) * o > Math.abs(i) * s ? (a < 0 && (s = -s), c = s * i / a, l = s) : (i < 0 && (o = -o), c = o, l = o * a / i), {
		x: n + c,
		y: r + l
	};
}
function H(e) {
	var t = x(I(en(e) + 1), function() {
		return [];
	});
	return h(e.nodes(), function(n) {
		var r = e.node(n), i = r.rank;
		w(i) || (t[i][r.order] = n);
	}), t;
}
function Zt(e) {
	var t = S(x(e.nodes(), function(t) {
		return e.node(t).rank;
	}));
	h(e.nodes(), function(n) {
		var r = e.node(n);
		et(r, "rank") && (r.rank -= t);
	});
}
function Qt(e) {
	var t = S(x(e.nodes(), function(t) {
		return e.node(t).rank;
	})), n = [];
	h(e.nodes(), function(r) {
		var i = e.node(r).rank - t;
		n[i] || (n[i] = []), n[i].push(r);
	});
	var r = 0, i = e.graph().nodeRankFactor;
	h(n, function(t, n) {
		w(t) && n % i !== 0 ? --r : r && h(t, function(t) {
			e.node(t).rank += r;
		});
	});
}
function $t(e, t, n, r) {
	var i = {
		width: 0,
		height: 0
	};
	return arguments.length >= 4 && (i.rank = n, i.order = r), V(e, "border", i, t);
}
function en(e) {
	return j(x(e.nodes(), function(t) {
		var n = e.node(t).rank;
		if (!w(n)) return n;
	}));
}
function tn(e, t) {
	var n = {
		lhs: [],
		rhs: []
	};
	return h(e, function(e) {
		t(e) ? n.lhs.push(e) : n.rhs.push(e);
	}), n;
}
function nn(e, t) {
	var n = He();
	try {
		return t();
	} finally {
		console.log(e + " time: " + (He() - n) + "ms");
	}
}
function rn(e, t) {
	return t();
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/add-border-segments.js
function an(e) {
	function t(n) {
		var r = e.children(n), i = e.node(n);
		if (r.length && h(r, t), Object.prototype.hasOwnProperty.call(i, "minRank")) {
			i.borderLeft = [], i.borderRight = [];
			for (var a = i.minRank, o = i.maxRank + 1; a < o; ++a) on(e, "borderLeft", "_bl", n, i, a), on(e, "borderRight", "_br", n, i, a);
		}
	}
	h(e.children(), t);
}
function on(e, t, n, r, i, a) {
	var o = {
		width: 0,
		height: 0,
		rank: a,
		borderType: t
	}, s = i[t][a - 1], c = V(e, "border", o, n);
	i[t][a] = c, e.setParent(c, r), s && e.setEdge(s, c, { weight: 1 });
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/coordinate-system.js
function sn(e) {
	var t = e.graph().rankdir.toLowerCase();
	(t === "lr" || t === "rl") && ln(e);
}
function cn(e) {
	var t = e.graph().rankdir.toLowerCase();
	(t === "bt" || t === "rl") && dn(e), (t === "lr" || t === "rl") && (fn(e), ln(e));
}
function ln(e) {
	h(e.nodes(), function(t) {
		un(e.node(t));
	}), h(e.edges(), function(t) {
		un(e.edge(t));
	});
}
function un(e) {
	var t = e.width;
	e.width = e.height, e.height = t;
}
function dn(e) {
	h(e.nodes(), function(t) {
		U(e.node(t));
	}), h(e.edges(), function(t) {
		var n = e.edge(t);
		h(n.points, U), Object.prototype.hasOwnProperty.call(n, "y") && U(n);
	});
}
function U(e) {
	e.y = -e.y;
}
function fn(e) {
	h(e.nodes(), function(t) {
		W(e.node(t));
	}), h(e.edges(), function(t) {
		var n = e.edge(t);
		h(n.points, W), Object.prototype.hasOwnProperty.call(n, "x") && W(n);
	});
}
function W(e) {
	var t = e.x;
	e.x = e.y, e.y = t;
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/normalize.js
function pn(e) {
	e.graph().dummyChains = [], h(e.edges(), function(t) {
		mn(e, t);
	});
}
function mn(e, t) {
	var n = t.v, r = e.node(n).rank, i = t.w, a = e.node(i).rank, o = t.name, s = e.edge(t), c = s.labelRank;
	if (a !== r + 1) {
		e.removeEdge(t);
		var l = void 0, u, d;
		for (d = 0, ++r; r < a; ++d, ++r) s.points = [], l = {
			width: 0,
			height: 0,
			edgeLabel: s,
			edgeObj: t,
			rank: r
		}, u = V(e, "edge", l, "_d"), r === c && (l.width = s.width, l.height = s.height, l.dummy = "edge-label", l.labelpos = s.labelpos), e.setEdge(n, u, { weight: s.weight }, o), d === 0 && e.graph().dummyChains.push(u), n = u;
		e.setEdge(n, i, { weight: s.weight }, o);
	}
}
function hn(e) {
	h(e.graph().dummyChains, function(t) {
		var n = e.node(t), r = n.edgeLabel, i;
		for (e.setEdge(n.edgeObj, r); n.dummy;) i = e.successors(t)[0], e.removeNode(t), r.points.push({
			x: n.x,
			y: n.y
		}), n.dummy === "edge-label" && (r.x = n.x, r.y = n.y, r.width = n.width, r.height = n.height), t = i, n = e.node(t);
	});
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/rank/util.js
function G(e) {
	var t = {};
	function n(r) {
		var i = e.node(r);
		if (Object.prototype.hasOwnProperty.call(t, r)) return i.rank;
		t[r] = !0;
		var a = S(x(e.outEdges(r), function(t) {
			return n(t.w) - e.edge(t).minlen;
		}));
		return (a === Infinity || a == null) && (a = 0), i.rank = a;
	}
	h(e.sources(), n);
}
function K(e, t) {
	return e.node(t.w).rank - e.node(t.v).rank - e.edge(t).minlen;
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/rank/feasible-tree.js
function gn(e) {
	var t = new E({ directed: !1 }), n = e.nodes()[0], r = e.nodeCount();
	t.setNode(n, {});
	for (var i, a; _n(t, e) < r;) i = vn(t, e), a = t.hasNode(i.v) ? K(e, i) : -K(e, i), yn(t, e, a);
	return t;
}
function _n(e, t) {
	function n(r) {
		h(t.nodeEdges(r), function(i) {
			var a = i.v, o = r === a ? i.w : a;
			!e.hasNode(o) && !K(t, i) && (e.setNode(o, {}), e.setEdge(r, o, {}), n(o));
		});
	}
	return h(e.nodes(), n), e.nodeCount();
}
function vn(e, t) {
	return M(t.edges(), function(n) {
		if (e.hasNode(n.v) !== e.hasNode(n.w)) return K(t, n);
	});
}
function yn(e, t, n) {
	h(e.nodes(), function(e) {
		t.node(e).rank += n;
	});
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/graphlib/alg/topsort.js
s(1), s(1), bn.CycleException = q;
function bn(e) {
	var t = {}, n = {}, r = [];
	function i(a) {
		if (Object.prototype.hasOwnProperty.call(n, a)) throw new q();
		Object.prototype.hasOwnProperty.call(t, a) || (n[a] = !0, t[a] = !0, h(e.predecessors(a), i), delete n[a], r.push(a));
	}
	if (h(e.sinks(), i), Pt(t) !== e.nodeCount()) throw new q();
	return r;
}
function q() {}
q.prototype = /* @__PURE__ */ Error();
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/graphlib/alg/dfs.js
function xn(e, t, n) {
	y(t) || (t = [t]);
	var r = (e.isDirected() ? e.successors : e.neighbors).bind(e), i = [], a = {};
	return h(t, function(t) {
		if (!e.hasNode(t)) throw Error("Graph does not have node: " + t);
		Sn(e, t, n === "post", a, r, i);
	}), i;
}
function Sn(e, t, n, r, i, a) {
	Object.prototype.hasOwnProperty.call(r, t) || (r[t] = !0, n || a.push(t), h(i(t), function(t) {
		Sn(e, t, n, r, i, a);
	}), n && a.push(t));
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/graphlib/alg/postorder.js
function Cn(e, t) {
	return xn(e, t, "post");
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/graphlib/alg/preorder.js
function wn(e, t) {
	return xn(e, t, "pre");
}
J.initLowLimValues = X, J.initCutValues = Y, J.calcCutValue = En, J.leaveEdge = On, J.enterEdge = kn, J.exchangeEdges = An;
function J(e) {
	e = Jt(e), G(e);
	var t = gn(e);
	X(t), Y(t, e);
	for (var n, r; n = On(t);) r = kn(t, e, n), An(t, e, n, r);
}
function Y(e, t) {
	var n = Cn(e, e.nodes());
	n = n.slice(0, n.length - 1), h(n, function(n) {
		Tn(e, t, n);
	});
}
function Tn(e, t, n) {
	var r = e.node(n).parent;
	e.edge(n, r).cutvalue = En(e, t, n);
}
function En(e, t, n) {
	var r = e.node(n).parent, i = !0, a = t.edge(n, r), o = 0;
	return a ||= (i = !1, t.edge(r, n)), o = a.weight, h(t.nodeEdges(n), function(a) {
		var s = a.v === n, c = s ? a.w : a.v;
		if (c !== r) {
			var l = s === i, u = t.edge(a).weight;
			if (o += l ? u : -u, Mn(e, n, c)) {
				var d = e.edge(n, c).cutvalue;
				o += l ? -d : d;
			}
		}
	}), o;
}
function X(e, t) {
	arguments.length < 2 && (t = e.nodes()[0]), Dn(e, {}, 1, t);
}
function Dn(e, t, n, r, i) {
	var a = n, o = e.node(r);
	return t[r] = !0, h(e.neighbors(r), function(i) {
		Object.prototype.hasOwnProperty.call(t, i) || (n = Dn(e, t, n, i, r));
	}), o.low = a, o.lim = n++, i ? o.parent = i : delete o.parent, n;
}
function On(e) {
	return k(e.edges(), function(t) {
		return e.edge(t).cutvalue < 0;
	});
}
function kn(e, t, n) {
	var r = n.v, i = n.w;
	t.hasEdge(r, i) || (r = n.w, i = n.v);
	var a = e.node(r), o = e.node(i), s = a, c = !1;
	return a.lim > o.lim && (s = o, c = !0), M(d(t.edges(), function(t) {
		return c === Nn(e, e.node(t.v), s) && c !== Nn(e, e.node(t.w), s);
	}), function(e) {
		return K(t, e);
	});
}
function An(e, t, n, r) {
	var i = n.v, a = n.w;
	e.removeEdge(i, a), e.setEdge(r.v, r.w, {}), X(e), Y(e, t), jn(e, t);
}
function jn(e, t) {
	var n = wn(e, k(e.nodes(), function(e) {
		return !t.node(e).parent;
	}));
	n = n.slice(1), h(n, function(n) {
		var r = e.node(n).parent, i = t.edge(n, r), a = !1;
		i || (i = t.edge(r, n), a = !0), t.node(n).rank = t.node(r).rank + (a ? i.minlen : -i.minlen);
	});
}
function Mn(e, t, n) {
	return e.hasEdge(t, n);
}
function Nn(e, t, n) {
	return n.low <= t.lim && t.lim <= n.lim;
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/rank/index.js
function Pn(e) {
	switch (e.graph().ranker) {
		case "network-simplex":
			Ln(e);
			break;
		case "tight-tree":
			In(e);
			break;
		case "longest-path":
			Fn(e);
			break;
		default: Ln(e);
	}
}
var Fn = G;
function In(e) {
	G(e), gn(e);
}
function Ln(e) {
	J(e);
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/nesting-graph.js
function Rn(e) {
	var t = V(e, "root", {}, "_root"), n = Bn(e), r = j(T(n)) - 1, i = 2 * r + 1;
	e.graph().nestingRoot = t, h(e.edges(), function(t) {
		e.edge(t).minlen *= i;
	});
	var a = Vn(e) + 1;
	h(e.children(), function(o) {
		zn(e, t, i, a, r, n, o);
	}), e.graph().nodeRankFactor = i;
}
function zn(e, t, n, r, i, a, o) {
	var s = e.children(o);
	if (!s.length) {
		o !== t && e.setEdge(t, o, {
			weight: 0,
			minlen: n
		});
		return;
	}
	var c = $t(e, "_bt"), l = $t(e, "_bb"), u = e.node(o);
	e.setParent(c, o), u.borderTop = c, e.setParent(l, o), u.borderBottom = l, h(s, function(s) {
		zn(e, t, n, r, i, a, s);
		var u = e.node(s), d = u.borderTop ? u.borderTop : s, f = u.borderBottom ? u.borderBottom : s, p = u.borderTop ? r : 2 * r, m = d === f ? i - a[o] + 1 : 1;
		e.setEdge(c, d, {
			weight: p,
			minlen: m,
			nestingEdge: !0
		}), e.setEdge(f, l, {
			weight: p,
			minlen: m,
			nestingEdge: !0
		});
	}), e.parent(o) || e.setEdge(t, c, {
		weight: 0,
		minlen: i + a[o]
	});
}
function Bn(e) {
	var t = {};
	function n(r, i) {
		var a = e.children(r);
		a && a.length && h(a, function(e) {
			n(e, i + 1);
		}), t[r] = i;
	}
	return h(e.children(), function(e) {
		n(e, 1);
	}), t;
}
function Vn(e) {
	return g(e.edges(), function(t, n) {
		return t + e.edge(n).weight;
	}, 0);
}
function Hn(e) {
	var t = e.graph();
	e.removeNode(t.nestingRoot), delete t.nestingRoot, h(e.edges(), function(t) {
		e.edge(t).nestingEdge && e.removeEdge(t);
	});
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/order/add-subgraph-constraints.js
function Un(e, t, n) {
	var r = {}, i;
	h(n, function(n) {
		for (var a = e.parent(n), o, s; a;) {
			if (o = e.parent(a), o ? (s = r[o], r[o] = a) : (s = i, i = a), s && s !== a) {
				t.setEdge(s, a);
				return;
			}
			a = o;
		}
	});
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/order/build-layer-graph.js
function Wn(e, t, n) {
	var r = Gn(e), i = new E({ compound: !0 }).setGraph({ root: r }).setDefaultNodeLabel(function(t) {
		return e.node(t);
	});
	return h(e.nodes(), function(a) {
		var o = e.node(a), s = e.parent(a);
		(o.rank === t || o.minRank <= t && t <= o.maxRank) && (i.setNode(a), i.setParent(a, s || r), h(e[n](a), function(t) {
			var n = t.v === a ? t.w : t.v, r = i.edge(n, a), o = w(r) ? 0 : r.weight;
			i.setEdge(n, a, { weight: e.edge(t).weight + o });
		}), Object.prototype.hasOwnProperty.call(o, "minRank") && i.setNode(a, {
			borderLeft: o.borderLeft[t],
			borderRight: o.borderRight[t]
		}));
	}), i;
}
function Gn(e) {
	for (var t; e.hasNode(t = R("_root")););
	return t;
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/order/cross-count.js
function Kn(e, t) {
	for (var n = 0, r = 1; r < t.length; ++r) n += qn(e, t[r - 1], t[r]);
	return n;
}
function qn(e, t, n) {
	for (var r = Lt(n, x(n, function(e, t) {
		return t;
	})), i = C(x(t, function(t) {
		return L(x(e.outEdges(t), function(t) {
			return {
				pos: r[t.w],
				weight: e.edge(t).weight
			};
		}), "pos");
	})), a = 1; a < n.length;) a <<= 1;
	var o = 2 * a - 1;
	--a;
	var s = x(Array(o), function() {
		return 0;
	}), c = 0;
	return h(i.forEach(function(e) {
		var t = e.pos + a;
		s[t] += e.weight;
		for (var n = 0; t > 0;) t % 2 && (n += s[t + 1]), t = t - 1 >> 1, s[t] += e.weight;
		c += e.weight * n;
	})), c;
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/order/init-order.js
function Jn(e) {
	var t = {}, n = d(e.nodes(), function(t) {
		return !e.children(t).length;
	}), r = x(I(j(x(n, function(t) {
		return e.node(t).rank;
	})) + 1), function() {
		return [];
	});
	function i(n) {
		et(t, n) || (t[n] = !0, r[e.node(n).rank].push(n), h(e.successors(n), i));
	}
	return h(L(n, function(t) {
		return e.node(t).rank;
	}), i), r;
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/order/barycenter.js
function Yn(e, t) {
	return x(t, function(t) {
		var n = e.inEdges(t);
		if (n.length) {
			var r = g(n, function(t, n) {
				var r = e.edge(n), i = e.node(n.v);
				return {
					sum: t.sum + r.weight * i.order,
					weight: t.weight + r.weight
				};
			}, {
				sum: 0,
				weight: 0
			});
			return {
				v: t,
				barycenter: r.sum / r.weight,
				weight: r.weight
			};
		} else return { v: t };
	});
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js
function Xn(e, t) {
	var n = {};
	return h(e, function(e, t) {
		var r = n[e.v] = {
			indegree: 0,
			in: [],
			out: [],
			vs: [e.v],
			i: t
		};
		w(e.barycenter) || (r.barycenter = e.barycenter, r.weight = e.weight);
	}), h(t.edges(), function(e) {
		var t = n[e.v], r = n[e.w];
		!w(t) && !w(r) && (r.indegree++, t.out.push(n[e.w]));
	}), Zn(d(n, function(e) {
		return !e.indegree;
	}));
}
function Zn(e) {
	var t = [];
	function n(e) {
		return function(t) {
			t.merged || (w(t.barycenter) || w(e.barycenter) || t.barycenter >= e.barycenter) && Qn(e, t);
		};
	}
	function r(t) {
		return function(n) {
			n.in.push(t), --n.indegree === 0 && e.push(n);
		};
	}
	for (; e.length;) {
		var i = e.pop();
		t.push(i), h(i.in.reverse(), n(i)), h(i.out, r(i));
	}
	return x(d(t, function(e) {
		return !e.merged;
	}), function(e) {
		return F(e, [
			"vs",
			"i",
			"barycenter",
			"weight"
		]);
	});
}
function Qn(e, t) {
	var n = 0, r = 0;
	e.weight && (n += e.barycenter * e.weight, r += e.weight), t.weight && (n += t.barycenter * t.weight, r += t.weight), e.vs = t.vs.concat(e.vs), e.barycenter = n / r, e.weight = r, e.i = Math.min(t.i, e.i), t.merged = !0;
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/order/sort.js
function $n(e, t) {
	var n = tn(e, function(e) {
		return Object.prototype.hasOwnProperty.call(e, "barycenter");
	}), r = n.lhs, i = L(n.rhs, function(e) {
		return -e.i;
	}), a = [], o = 0, s = 0, c = 0;
	r.sort(er(!!t)), c = Z(a, i, c), h(r, function(e) {
		c += e.vs.length, a.push(e.vs), o += e.barycenter * e.weight, s += e.weight, c = Z(a, i, c);
	});
	var l = { vs: C(a) };
	return s && (l.barycenter = o / s, l.weight = s), l;
}
function Z(e, t, n) {
	for (var r; t.length && (r = O(t)).i <= n;) t.pop(), e.push(r.vs), n++;
	return n;
}
function er(e) {
	return function(t, n) {
		return t.barycenter < n.barycenter ? -1 : t.barycenter > n.barycenter ? 1 : e ? n.i - t.i : t.i - n.i;
	};
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js
function tr(e, t, n, r) {
	var i = e.children(t), a = e.node(t), o = a ? a.borderLeft : void 0, s = a ? a.borderRight : void 0, c = {};
	o && (i = d(i, function(e) {
		return e !== o && e !== s;
	}));
	var l = Yn(e, i);
	h(l, function(t) {
		if (e.children(t.v).length) {
			var i = tr(e, t.v, n, r);
			c[t.v] = i, Object.prototype.hasOwnProperty.call(i, "barycenter") && rr(t, i);
		}
	});
	var u = Xn(l, n);
	nr(u, c);
	var f = $n(u, r);
	if (o && (f.vs = C([
		o,
		f.vs,
		s
	]), e.predecessors(o).length)) {
		var p = e.node(e.predecessors(o)[0]), m = e.node(e.predecessors(s)[0]);
		Object.prototype.hasOwnProperty.call(f, "barycenter") || (f.barycenter = 0, f.weight = 0), f.barycenter = (f.barycenter * f.weight + p.order + m.order) / (f.weight + 2), f.weight += 2;
	}
	return f;
}
function nr(e, t) {
	h(e, function(e) {
		e.vs = C(e.vs.map(function(e) {
			return t[e] ? t[e].vs : e;
		}));
	});
}
function rr(e, t) {
	w(e.barycenter) ? (e.barycenter = t.barycenter, e.weight = t.weight) : (e.barycenter = (e.barycenter * e.weight + t.barycenter * t.weight) / (e.weight + t.weight), e.weight += t.weight);
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/order/index.js
function ir(e) {
	var t = en(e), n = ar(e, I(1, t + 1), "inEdges"), r = ar(e, I(t - 1, -1, -1), "outEdges"), i = Jn(e);
	sr(e, i);
	for (var a = Infinity, o, s = 0, c = 0; c < 4; ++s, ++c) {
		or(s % 2 ? n : r, s % 4 >= 2), i = H(e);
		var l = Kn(e, i);
		l < a && (c = 0, o = Ve(i), a = l);
	}
	sr(e, o);
}
function ar(e, t, n) {
	return x(t, function(t) {
		return Wn(e, t, n);
	});
}
function or(e, t) {
	var n = new E();
	h(e, function(e) {
		var r = e.graph().root, i = tr(e, r, n, t);
		h(i.vs, function(t, n) {
			e.node(t).order = n;
		}), Un(e, n, i.vs);
	});
}
function sr(e, t) {
	h(t, function(t) {
		h(t, function(t, n) {
			e.node(t).order = n;
		});
	});
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/parent-dummy-chains.js
function cr(e) {
	var t = ur(e);
	h(e.graph().dummyChains, function(n) {
		for (var r = e.node(n), i = r.edgeObj, a = lr(e, t, i.v, i.w), o = a.path, s = a.lca, c = 0, l = o[c], u = !0; n !== i.w;) {
			if (r = e.node(n), u) {
				for (; (l = o[c]) !== s && e.node(l).maxRank < r.rank;) c++;
				l === s && (u = !1);
			}
			if (!u) {
				for (; c < o.length - 1 && e.node(l = o[c + 1]).minRank <= r.rank;) c++;
				l = o[c];
			}
			e.setParent(n, l), n = e.successors(n)[0];
		}
	});
}
function lr(e, t, n, r) {
	var i = [], a = [], o = Math.min(t[n].low, t[r].low), s = Math.max(t[n].lim, t[r].lim), c = n, l;
	do
		c = e.parent(c), i.push(c);
	while (c && (t[c].low > o || s > t[c].lim));
	for (l = c, c = r; (c = e.parent(c)) !== l;) a.push(c);
	return {
		path: i.concat(a.reverse()),
		lca: l
	};
}
function ur(e) {
	var t = {}, n = 0;
	function r(i) {
		var a = n;
		h(e.children(i), r), t[i] = {
			low: a,
			lim: n++
		};
	}
	return h(e.children(), r), t;
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/position/bk.js
function dr(e, t) {
	var n = {};
	function r(t, r) {
		var i = 0, a = 0, o = t.length, s = O(r);
		return h(r, function(t, c) {
			var l = pr(e, t), u = l ? e.node(l).order : o;
			(l || t === s) && (h(r.slice(a, c + 1), function(t) {
				h(e.predecessors(t), function(r) {
					var a = e.node(r), o = a.order;
					(o < i || u < o) && !(a.dummy && e.node(t).dummy) && mr(n, r, t);
				});
			}), a = c + 1, i = u);
		}), r;
	}
	return g(t, r), n;
}
function fr(e, t) {
	var n = {};
	function r(t, r, i, a, o) {
		var s;
		h(I(r, i), function(r) {
			s = t[r], e.node(s).dummy && h(e.predecessors(s), function(t) {
				var r = e.node(t);
				r.dummy && (r.order < a || r.order > o) && mr(n, t, s);
			});
		});
	}
	function i(t, n) {
		var i = -1, a, o = 0;
		return h(n, function(s, c) {
			if (e.node(s).dummy === "border") {
				var l = e.predecessors(s);
				l.length && (a = e.node(l[0]).order, r(n, o, c, i, a), o = c, i = a);
			}
			r(n, o, n.length, a, t.length);
		}), n;
	}
	return g(t, i), n;
}
function pr(e, t) {
	if (e.node(t).dummy) return k(e.predecessors(t), function(t) {
		return e.node(t).dummy;
	});
}
function mr(e, t, n) {
	if (t > n) {
		var r = t;
		t = n, n = r;
	}
	Object.prototype.hasOwnProperty.call(e, t) || Object.defineProperty(e, t, {
		enumerable: !0,
		configurable: !0,
		value: {},
		writable: !0
	});
	var i = e[t];
	Object.defineProperty(i, n, {
		enumerable: !0,
		configurable: !0,
		value: !0,
		writable: !0
	});
}
function hr(e, t, n) {
	if (t > n) {
		var r = t;
		t = n, n = r;
	}
	return !!e[t] && Object.prototype.hasOwnProperty.call(e[t], n);
}
function gr(e, t, n, r) {
	var i = {}, a = {}, o = {};
	return h(t, function(e) {
		h(e, function(e, t) {
			i[e] = e, a[e] = e, o[e] = t;
		});
	}), h(t, function(e) {
		var t = -1;
		h(e, function(e) {
			var s = r(e);
			if (s.length) {
				s = L(s, function(e) {
					return o[e];
				});
				for (var c = (s.length - 1) / 2, l = Math.floor(c), u = Math.ceil(c); l <= u; ++l) {
					var d = s[l];
					a[e] === e && t < o[d] && !hr(n, e, d) && (a[d] = e, a[e] = i[e] = i[d], t = o[d]);
				}
			}
		});
	}), {
		root: i,
		align: a
	};
}
function _r(e, t, n, r, i) {
	var a = {}, o = vr(e, t, n, i), s = i ? "borderLeft" : "borderRight";
	function c(e, t) {
		for (var n = o.nodes(), r = n.pop(), i = {}; r;) i[r] ? e(r) : (i[r] = !0, n.push(r), n = n.concat(t(r))), r = n.pop();
	}
	function l(e) {
		a[e] = o.inEdges(e).reduce(function(e, t) {
			return Math.max(e, a[t.v] + o.edge(t));
		}, 0);
	}
	function u(t) {
		var n = o.outEdges(t).reduce(function(e, t) {
			return Math.min(e, a[t.w] - o.edge(t));
		}, Infinity), r = e.node(t);
		n !== Infinity && r.borderType !== s && (a[t] = Math.max(a[t], n));
	}
	return c(l, o.predecessors.bind(o)), c(u, o.successors.bind(o)), h(r, function(e) {
		a[e] = a[n[e]];
	}), a;
}
function vr(e, t, n, r) {
	var i = new E(), a = e.graph(), o = Cr(a.nodesep, a.edgesep, r);
	return h(t, function(t) {
		var r;
		h(t, function(t) {
			var a = n[t];
			if (i.setNode(a), r) {
				var s = n[r], c = i.edge(s, a);
				i.setEdge(s, a, Math.max(o(e, t, r), c || 0));
			}
			r = t;
		});
	}), i;
}
function yr(e, t) {
	return M(T(t), function(t) {
		var n = -Infinity, r = Infinity;
		return Ye(t, function(t, i) {
			var a = wr(e, i) / 2;
			n = Math.max(t + a, n), r = Math.min(t - a, r);
		}), n - r;
	});
}
function br(e, t) {
	var n = T(t), r = S(n), i = j(n);
	h(["u", "d"], function(n) {
		h(["l", "r"], function(a) {
			var o = n + a, s = e[o], c;
			if (s !== t) {
				var l = T(s);
				c = a === "l" ? r - S(l) : i - j(l), c && (e[o] = A(s, function(e) {
					return e + c;
				}));
			}
		});
	});
}
function xr(e, t) {
	return A(e.ul, function(n, r) {
		if (t) return e[t.toLowerCase()][r];
		var i = L(x(e, r));
		return (i[1] + i[2]) / 2;
	});
}
function Sr(e) {
	var t = H(e), n = i(dr(e, t), fr(e, t)), r = {}, a;
	return h(["u", "d"], function(i) {
		a = i === "u" ? t : T(t).reverse(), h(["l", "r"], function(t) {
			t === "r" && (a = x(a, function(e) {
				return T(e).reverse();
			}));
			var o = (i === "u" ? e.predecessors : e.successors).bind(e), s = gr(e, a, n, o), c = _r(e, a, s.root, s.align, t === "r");
			t === "r" && (c = A(c, function(e) {
				return -e;
			})), r[i + t] = c;
		});
	}), br(r, yr(e, r)), xr(r, e.graph().align);
}
function Cr(e, t, n) {
	return function(r, i, a) {
		var o = r.node(i), s = r.node(a), c = 0, l;
		if (c += o.width / 2, Object.prototype.hasOwnProperty.call(o, "labelpos")) switch (o.labelpos.toLowerCase()) {
			case "l":
				l = -o.width / 2;
				break;
			case "r":
				l = o.width / 2;
				break;
		}
		if (l && (c += n ? l : -l), l = 0, c += (o.dummy ? t : e) / 2, c += (s.dummy ? t : e) / 2, c += s.width / 2, Object.prototype.hasOwnProperty.call(s, "labelpos")) switch (s.labelpos.toLowerCase()) {
			case "l":
				l = s.width / 2;
				break;
			case "r":
				l = -s.width / 2;
				break;
		}
		return l && (c += n ? l : -l), l = 0, c;
	};
}
function wr(e, t) {
	return e.node(t).width;
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/position/index.js
function Tr(e) {
	e = Yt(e), Er(e), Xe(Sr(e), function(t, n) {
		e.node(n).x = t;
	});
}
function Er(e) {
	var t = H(e), n = e.graph().ranksep, r = 0;
	h(t, function(t) {
		var i = j(x(t, function(t) {
			return e.node(t).height;
		}));
		h(t, function(t) {
			e.node(t).y = r + i / 2;
		}), r += i + n;
	});
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/layout.js
function Dr(e, t) {
	var n = t && t.debugTiming ? nn : rn;
	n("layout", () => {
		var t = n("  buildLayoutGraph", () => Rr(e));
		n("  runLayout", () => Or(t, n)), n("  updateInputGraph", () => kr(e, t));
	});
}
function Or(e, t) {
	t("    makeSpaceForEdgeLabels", () => zr(e)), t("    removeSelfEdges", () => Jr(e)), t("    acyclic", () => Gt(e)), t("    nestingGraph.run", () => Rn(e)), t("    rank", () => Pn(Yt(e))), t("    injectEdgeLabelProxies", () => Br(e)), t("    removeEmptyRanks", () => Qt(e)), t("    nestingGraph.cleanup", () => Hn(e)), t("    normalizeRanks", () => Zt(e)), t("    assignRankMinMax", () => Vr(e)), t("    removeEdgeLabelProxies", () => Hr(e)), t("    normalize.run", () => pn(e)), t("    parentDummyChains", () => cr(e)), t("    addBorderSegments", () => an(e)), t("    order", () => ir(e)), t("    insertSelfEdges", () => Yr(e)), t("    adjustCoordinateSystem", () => sn(e)), t("    position", () => Tr(e)), t("    positionSelfEdges", () => Xr(e)), t("    removeBorderNodes", () => qr(e)), t("    normalize.undo", () => hn(e)), t("    fixupEdgeLabelCoords", () => Gr(e)), t("    undoCoordinateSystem", () => cn(e)), t("    translateGraph", () => Ur(e)), t("    assignNodeIntersects", () => Wr(e)), t("    reversePoints", () => Kr(e)), t("    acyclic.undo", () => qt(e));
}
function kr(e, t) {
	h(e.nodes(), function(n) {
		var r = e.node(n), i = t.node(n);
		r && (r.x = i.x, r.y = i.y, t.children(n).length && (r.width = i.width, r.height = i.height));
	}), h(e.edges(), function(n) {
		var r = e.edge(n), i = t.edge(n);
		r.points = i.points, Object.prototype.hasOwnProperty.call(i, "x") && (r.x = i.x, r.y = i.y);
	}), e.graph().width = t.graph().width, e.graph().height = t.graph().height;
}
var Ar = [
	"nodesep",
	"edgesep",
	"ranksep",
	"marginx",
	"marginy"
], jr = {
	ranksep: 50,
	edgesep: 20,
	nodesep: 50,
	rankdir: "tb"
}, Mr = [
	"acyclicer",
	"ranker",
	"rankdir",
	"align"
], Nr = ["width", "height"], Pr = {
	width: 0,
	height: 0
}, Fr = [
	"minlen",
	"weight",
	"width",
	"height",
	"labeloffset"
], Ir = {
	minlen: 1,
	weight: 1,
	width: 0,
	height: 0,
	labeloffset: 10,
	labelpos: "r"
}, Lr = ["labelpos"];
function Rr(e) {
	var t = new E({
		multigraph: !0,
		compound: !0
	}), n = $(e.graph());
	return t.setGraph(i({}, jr, Q(n, Ar), F(n, Mr))), h(e.nodes(), function(n) {
		var r = $(e.node(n));
		t.setNode(n, Ge(Q(r, Nr), Pr)), t.setParent(n, e.parent(n));
	}), h(e.edges(), function(n) {
		var r = $(e.edge(n));
		t.setEdge(n, i({}, Ir, Q(r, Fr), F(r, Lr)));
	}), t;
}
function zr(e) {
	var t = e.graph();
	t.ranksep /= 2, h(e.edges(), function(n) {
		var r = e.edge(n);
		r.minlen *= 2, r.labelpos.toLowerCase() !== "c" && (t.rankdir === "TB" || t.rankdir === "BT" ? r.width += r.labeloffset : r.height += r.labeloffset);
	});
}
function Br(e) {
	h(e.edges(), function(t) {
		var n = e.edge(t);
		if (n.width && n.height) {
			var r = e.node(t.v);
			V(e, "edge-proxy", {
				rank: (e.node(t.w).rank - r.rank) / 2 + r.rank,
				e: t
			}, "_ep");
		}
	});
}
function Vr(e) {
	var t = 0;
	h(e.nodes(), function(n) {
		var r = e.node(n);
		r.borderTop && (r.minRank = e.node(r.borderTop).rank, r.maxRank = e.node(r.borderBottom).rank, t = j(t, r.maxRank));
	}), e.graph().maxRank = t;
}
function Hr(e) {
	h(e.nodes(), function(t) {
		var n = e.node(t);
		n.dummy === "edge-proxy" && (e.edge(n.e).labelRank = n.rank, e.removeNode(t));
	});
}
function Ur(e) {
	var t = Infinity, n = 0, r = Infinity, i = 0, a = e.graph(), o = a.marginx || 0, s = a.marginy || 0;
	function c(e) {
		var a = e.x, o = e.y, s = e.width, c = e.height;
		t = Math.min(t, a - s / 2), n = Math.max(n, a + s / 2), r = Math.min(r, o - c / 2), i = Math.max(i, o + c / 2);
	}
	h(e.nodes(), function(t) {
		c(e.node(t));
	}), h(e.edges(), function(t) {
		var n = e.edge(t);
		Object.prototype.hasOwnProperty.call(n, "x") && c(n);
	}), t -= o, r -= s, h(e.nodes(), function(n) {
		var i = e.node(n);
		i.x -= t, i.y -= r;
	}), h(e.edges(), function(n) {
		var i = e.edge(n);
		h(i.points, function(e) {
			e.x -= t, e.y -= r;
		}), Object.prototype.hasOwnProperty.call(i, "x") && (i.x -= t), Object.prototype.hasOwnProperty.call(i, "y") && (i.y -= r);
	}), a.width = n - t + o, a.height = i - r + s;
}
function Wr(e) {
	h(e.edges(), function(t) {
		var n = e.edge(t), r = e.node(t.v), i = e.node(t.w), a, o;
		n.points ? (a = n.points[0], o = n.points[n.points.length - 1]) : (n.points = [], a = i, o = r), n.points.unshift(Xt(r, a)), n.points.push(Xt(i, o));
	});
}
function Gr(e) {
	h(e.edges(), function(t) {
		var n = e.edge(t);
		if (Object.prototype.hasOwnProperty.call(n, "x")) switch ((n.labelpos === "l" || n.labelpos === "r") && (n.width -= n.labeloffset), n.labelpos) {
			case "l":
				n.x -= n.width / 2 + n.labeloffset;
				break;
			case "r":
				n.x += n.width / 2 + n.labeloffset;
				break;
		}
	});
}
function Kr(e) {
	h(e.edges(), function(t) {
		var n = e.edge(t);
		n.reversed && n.points.reverse();
	});
}
function qr(e) {
	h(e.nodes(), function(t) {
		if (e.children(t).length) {
			var n = e.node(t), r = e.node(n.borderTop), i = e.node(n.borderBottom), a = e.node(O(n.borderLeft)), o = e.node(O(n.borderRight));
			n.width = Math.abs(o.x - a.x), n.height = Math.abs(i.y - r.y), n.x = a.x + n.width / 2, n.y = r.y + n.height / 2;
		}
	}), h(e.nodes(), function(t) {
		e.node(t).dummy === "border" && e.removeNode(t);
	});
}
function Jr(e) {
	h(e.edges(), function(t) {
		if (t.v === t.w) {
			var n = e.node(t.v);
			n.selfEdges ||= [], n.selfEdges.push({
				e: t,
				label: e.edge(t)
			}), e.removeEdge(t);
		}
	});
}
function Yr(e) {
	h(H(e), function(t) {
		var n = 0;
		h(t, function(t, r) {
			var i = e.node(t);
			i.order = r + n, h(i.selfEdges, function(t) {
				V(e, "selfedge", {
					width: t.label.width,
					height: t.label.height,
					rank: i.rank,
					order: r + ++n,
					e: t.e,
					label: t.label
				}, "_se");
			}), delete i.selfEdges;
		});
	});
}
function Xr(e) {
	h(e.nodes(), function(t) {
		var n = e.node(t);
		if (n.dummy === "selfedge") {
			var r = e.node(n.e.v), i = r.x + r.width / 2, a = r.y, o = n.x - i, s = r.height / 2;
			e.setEdge(n.e, n.label), e.removeNode(t), n.label.points = [
				{
					x: i + 2 * o / 3,
					y: a - s
				},
				{
					x: i + 5 * o / 6,
					y: a - s
				},
				{
					x: i + o,
					y: a
				},
				{
					x: i + 5 * o / 6,
					y: a + s
				},
				{
					x: i + 2 * o / 3,
					y: a + s
				}
			], n.label.x = n.x, n.label.y = n.y;
		}
	});
}
function Q(e, t) {
	return A(F(e, t), Number);
}
function $(e) {
	var t = {};
	return h(e, function(e, n) {
		t[n.toLowerCase()] = e;
	}), t;
}
//#endregion
export { Dr as t };
