import { E as e, _ as t, c as n, d as r, f as i, g as a, h as o, m as s, n as c, o as l, p as u, r as d, s as f, t as p, u as m, v as ee, x as te, y as h } from "./reduce-DbMsJ4nx.js";
import { D as ne, O as re, T as ie, f as ae, g, h as oe, i as se, n as ce, t as le, u as ue, w as _ } from "./_baseFor-DZ1vnh4H.js";
import { i as de, n as fe } from "./isEmpty-CVG4Bj-P.js";
import { a as v, i as pe, n as y, o as me, r as he, t as b } from "./flatten-CXxC4cn2.js";
import { C as ge, N as _e, S as ve, T as ye, _ as x, b as be, v as S, x as C, y as xe } from "./chunk-5PVQY5BW-BCjrVrWB.js";
import { i as Se, n as w, r as T, t as E } from "./graphlib-DrXiQBFg.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 (h(e)) return De;
	if (_(e)) {
		var t = typeof e.valueOf == "function" ? e.valueOf() : e;
		e = _(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 be(ve(e, void 0, b), 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 ne.Date.now();
}, Ue = Object.prototype, We = Ue.hasOwnProperty, Ge = xe(function(e, t) {
	e = Object(e);
	var n = -1, r = t.length, i = r > 2 ? t[2] : void 0;
	for (i && S(t[0], t[1], i) && (r = 1); ++n < r;) for (var a = t[n], o = ge(a), s = -1, c = o.length; ++s < c;) {
		var l = o[s], u = e[l];
		(u === void 0 || re(u, Ue[l]) && !We.call(e, l)) && (e[l] = a[l]);
	}
	return e;
});
//#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, i) {
		var a = Object(t);
		if (!se(t)) {
			var o = r(n, 3);
			t = te(t), n = function(e) {
				return o(a[e], e, a);
			};
		}
		var s = e(t, n, i);
		return s > -1 ? a[o ? t[s] : s] : 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 i = e == null ? 0 : e.length;
	if (!i) return -1;
	var a = n == null ? 0 : Fe(n);
	return a < 0 && (a = qe(i + a, 0)), l(e, r(t, 3), a);
}
//#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(e, t) {
	return e == null ? e : le(e, d(t), ge);
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/forOwn.js
function Xe(e, t) {
	return e && m(e, d(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 && s(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" || !g(e) && oe(e) && ie(e) == tt;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/mapValues.js
function A(e, t) {
	var n = {};
	return t = r(t, 3), m(e, function(e, r, i) {
		_e(n, r, t(e, r, i));
	}), n;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/max.js
function j(e) {
	return e && e.length ? pe(e, ce, 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 ? pe(e, r(t, 2), he) : void 0;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSet.js
function rt(e, n, r, i) {
	if (!_(e)) return e;
	n = t(n, e);
	for (var o = -1, s = n.length, c = s - 1, l = e; l != null && ++o < s;) {
		var u = a(n[o]), d = r;
		if (u === "__proto__" || u === "constructor" || u === "prototype") return e;
		if (o != c) {
			var f = l[u];
			d = i ? i(f, u, l) : void 0, d === void 0 && (d = _(f) ? f : ae(n[o + 1]) ? [] : {});
		}
		ye(l, u, d), l = l[u];
	}
	return e;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_basePickBy.js
function it(e, n, r) {
	for (var i = -1, a = n.length, s = {}; ++i < a;) {
		var c = n[i], l = o(e, c);
		r(l, c) && rt(s, t(c, e), l);
	}
	return s;
}
//#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 = h(e), o = t !== void 0, s = t === null, c = t === t, l = h(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(t, n, i) {
	n = n.length ? e(n, function(e) {
		return g(e) ? function(t) {
			return o(t, e.length === 1 ? e[0] : e);
		} : e;
	}) : [ce];
	var a = -1;
	return n = e(n, ue(r)), at(me(t, function(t, r, i) {
		return {
			criteria: e(n, function(e) {
				return e(t);
			}),
			index: ++a,
			value: t
		};
	}), function(e, t) {
		return st(e, t, i);
	});
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_asciiSize.js
var lt = i("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 u(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" && S(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 (se(e)) return nt(e) ? Et(e) : e.length;
	var t = fe(e);
	return t == Mt || t == Nt ? e.size : de(e).length;
}
//#endregion
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/sortBy.js
var L = xe(function(e, t) {
	if (e == null) return [];
	var n = t.length;
	return n > 1 && S(e, t[0], t[1]) ? t = [] : n > 2 && S(t[0], t[1], t[2]) && (t = [t[0]]), ct(e, f(t, 1), []);
}), Ft = 0;
function R(e) {
	var t = ++Ft;
	return ee(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 || [], ye);
}
//#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 z(t), t;
	}
	enqueue(e) {
		var t = this._sentinel;
		e._prev && e._next && z(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, zt)), n = n._prev;
		return "[" + e.join(", ") + "]";
	}
};
function z(e) {
	e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
}
function zt(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 Bt = C(1);
function Vt(e, t) {
	if (e.nodeCount() <= 1) return [];
	var n = Ut(e, t || Bt);
	return b(v(Ht(n.graph, n.buckets, n.zeroIdx), function(t) {
		return e.outEdges(t.v, t.w);
	}));
}
function Ht(e, t, n) {
	for (var r = [], i = t[t.length - 1], a = t[0], o; e.nodeCount();) {
		for (; o = a.dequeue();) B(e, t, n, o);
		for (; o = i.dequeue();) B(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(B(e, t, n, o, !0));
				break;
			}
		}
	}
	return r;
}
function B(e, t, n, r, i) {
	var a = i ? [] : void 0;
	return c(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, V(t, n, s);
	}), c(e.outEdges(r.v), function(r) {
		var i = e.edge(r), a = r.w, o = e.node(a);
		o.in -= i, V(t, n, o);
	}), e.removeNode(r.v), a;
}
function Ut(e, t) {
	var n = new E(), r = 0, i = 0;
	c(e.nodes(), function(e) {
		n.setNode(e, {
			v: e,
			in: 0,
			out: 0
		});
	}), c(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 c(n.nodes(), function(e) {
		V(a, o, n.node(e));
	}), {
		graph: n,
		buckets: a,
		zeroIdx: o
	};
}
function V(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 Wt(e) {
	c(e.graph().acyclicer === "greedy" ? Vt(e, t(e)) : Gt(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 Gt(e) {
	var t = [], n = {}, r = {};
	function i(a) {
		Object.prototype.hasOwnProperty.call(r, a) || (r[a] = !0, n[a] = !0, c(e.outEdges(a), function(e) {
			Object.prototype.hasOwnProperty.call(n, e.w) ? t.push(e) : i(e.w);
		}), delete n[a]);
	}
	return c(e.nodes(), i), t;
}
function Kt(e) {
	c(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 H(e, t, n, r) {
	var i;
	do
		i = R(r);
	while (e.hasNode(i));
	return n.dummy = t, e.setNode(i, n), i;
}
function qt(e) {
	var t = new E().setGraph(e.graph());
	return c(e.nodes(), function(n) {
		t.setNode(n, e.node(n));
	}), c(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 Jt(e) {
	var t = new E({ multigraph: e.isMultigraph() }).setGraph(e.graph());
	return c(e.nodes(), function(n) {
		e.children(n).length || t.setNode(n, e.node(n));
	}), c(e.edges(), function(n) {
		t.setEdge(n, e.edge(n));
	}), t;
}
function Yt(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 U(e) {
	var t = v(I($t(e) + 1), function() {
		return [];
	});
	return c(e.nodes(), function(n) {
		var r = e.node(n), i = r.rank;
		w(i) || (t[i][r.order] = n);
	}), t;
}
function Xt(e) {
	var t = y(v(e.nodes(), function(t) {
		return e.node(t).rank;
	}));
	c(e.nodes(), function(n) {
		var r = e.node(n);
		et(r, "rank") && (r.rank -= t);
	});
}
function Zt(e) {
	var t = y(v(e.nodes(), function(t) {
		return e.node(t).rank;
	})), n = [];
	c(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;
	c(n, function(t, n) {
		w(t) && n % i !== 0 ? --r : r && c(t, function(t) {
			e.node(t).rank += r;
		});
	});
}
function Qt(e, t, n, r) {
	var i = {
		width: 0,
		height: 0
	};
	return arguments.length >= 4 && (i.rank = n, i.order = r), H(e, "border", i, t);
}
function $t(e) {
	return j(v(e.nodes(), function(t) {
		var n = e.node(t).rank;
		if (!w(n)) return n;
	}));
}
function en(e, t) {
	var n = {
		lhs: [],
		rhs: []
	};
	return c(e, function(e) {
		t(e) ? n.lhs.push(e) : n.rhs.push(e);
	}), n;
}
function tn(e, t) {
	var n = He();
	try {
		return t();
	} finally {
		console.log(e + " time: " + (He() - n) + "ms");
	}
}
function nn(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 rn(e) {
	function t(n) {
		var r = e.children(n), i = e.node(n);
		if (r.length && c(r, t), Object.prototype.hasOwnProperty.call(i, "minRank")) {
			i.borderLeft = [], i.borderRight = [];
			for (var a = i.minRank, o = i.maxRank + 1; a < o; ++a) an(e, "borderLeft", "_bl", n, i, a), an(e, "borderRight", "_br", n, i, a);
		}
	}
	c(e.children(), t);
}
function an(e, t, n, r, i, a) {
	var o = {
		width: 0,
		height: 0,
		rank: a,
		borderType: t
	}, s = i[t][a - 1], c = H(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 on(e) {
	var t = e.graph().rankdir.toLowerCase();
	(t === "lr" || t === "rl") && cn(e);
}
function sn(e) {
	var t = e.graph().rankdir.toLowerCase();
	(t === "bt" || t === "rl") && un(e), (t === "lr" || t === "rl") && (dn(e), cn(e));
}
function cn(e) {
	c(e.nodes(), function(t) {
		ln(e.node(t));
	}), c(e.edges(), function(t) {
		ln(e.edge(t));
	});
}
function ln(e) {
	var t = e.width;
	e.width = e.height, e.height = t;
}
function un(e) {
	c(e.nodes(), function(t) {
		W(e.node(t));
	}), c(e.edges(), function(t) {
		var n = e.edge(t);
		c(n.points, W), Object.prototype.hasOwnProperty.call(n, "y") && W(n);
	});
}
function W(e) {
	e.y = -e.y;
}
function dn(e) {
	c(e.nodes(), function(t) {
		G(e.node(t));
	}), c(e.edges(), function(t) {
		var n = e.edge(t);
		c(n.points, G), Object.prototype.hasOwnProperty.call(n, "x") && G(n);
	});
}
function G(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 fn(e) {
	e.graph().dummyChains = [], c(e.edges(), function(t) {
		pn(e, t);
	});
}
function pn(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 = H(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 mn(e) {
	c(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 K(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 = y(v(e.outEdges(r), function(t) {
			return n(t.w) - e.edge(t).minlen;
		}));
		return (a === Infinity || a == null) && (a = 0), i.rank = a;
	}
	c(e.sources(), n);
}
function q(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 hn(e) {
	var t = new E({ directed: !1 }), n = e.nodes()[0], r = e.nodeCount();
	t.setNode(n, {});
	for (var i, a; gn(t, e) < r;) i = _n(t, e), a = t.hasNode(i.v) ? q(e, i) : -q(e, i), vn(t, e, a);
	return t;
}
function gn(e, t) {
	function n(r) {
		c(t.nodeEdges(r), function(i) {
			var a = i.v, o = r === a ? i.w : a;
			!e.hasNode(o) && !q(t, i) && (e.setNode(o, {}), e.setEdge(r, o, {}), n(o));
		});
	}
	return c(e.nodes(), n), e.nodeCount();
}
function _n(e, t) {
	return M(t.edges(), function(n) {
		if (e.hasNode(n.v) !== e.hasNode(n.w)) return q(t, n);
	});
}
function vn(e, t, n) {
	c(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
C(1), C(1), yn.CycleException = J;
function yn(e) {
	var t = {}, n = {}, r = [];
	function i(a) {
		if (Object.prototype.hasOwnProperty.call(n, a)) throw new J();
		Object.prototype.hasOwnProperty.call(t, a) || (n[a] = !0, t[a] = !0, c(e.predecessors(a), i), delete n[a], r.push(a));
	}
	if (c(e.sinks(), i), Pt(t) !== e.nodeCount()) throw new J();
	return r;
}
function J() {}
J.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 bn(e, t, n) {
	g(t) || (t = [t]);
	var r = (e.isDirected() ? e.successors : e.neighbors).bind(e), i = [], a = {};
	return c(t, function(t) {
		if (!e.hasNode(t)) throw Error("Graph does not have node: " + t);
		xn(e, t, n === "post", a, r, i);
	}), i;
}
function xn(e, t, n, r, i, a) {
	Object.prototype.hasOwnProperty.call(r, t) || (r[t] = !0, n || a.push(t), c(i(t), function(t) {
		xn(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 Sn(e, t) {
	return bn(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 Cn(e, t) {
	return bn(e, t, "pre");
}
Y.initLowLimValues = Z, Y.initCutValues = X, Y.calcCutValue = Tn, Y.leaveEdge = Dn, Y.enterEdge = On, Y.exchangeEdges = kn;
function Y(e) {
	e = qt(e), K(e);
	var t = hn(e);
	Z(t), X(t, e);
	for (var n, r; n = Dn(t);) r = On(t, e, n), kn(t, e, n, r);
}
function X(e, t) {
	var n = Sn(e, e.nodes());
	n = n.slice(0, n.length - 1), c(n, function(n) {
		wn(e, t, n);
	});
}
function wn(e, t, n) {
	var r = e.node(n).parent;
	e.edge(n, r).cutvalue = Tn(e, t, n);
}
function Tn(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, c(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, jn(e, n, c)) {
				var d = e.edge(n, c).cutvalue;
				o += l ? -d : d;
			}
		}
	}), o;
}
function Z(e, t) {
	arguments.length < 2 && (t = e.nodes()[0]), En(e, {}, 1, t);
}
function En(e, t, n, r, i) {
	var a = n, o = e.node(r);
	return t[r] = !0, c(e.neighbors(r), function(i) {
		Object.prototype.hasOwnProperty.call(t, i) || (n = En(e, t, n, i, r));
	}), o.low = a, o.lim = n++, i ? o.parent = i : delete o.parent, n;
}
function Dn(e) {
	return k(e.edges(), function(t) {
		return e.edge(t).cutvalue < 0;
	});
}
function On(e, t, r) {
	var i = r.v, a = r.w;
	t.hasEdge(i, a) || (i = r.w, a = r.v);
	var o = e.node(i), s = e.node(a), c = o, l = !1;
	return o.lim > s.lim && (c = s, l = !0), M(n(t.edges(), function(t) {
		return l === Mn(e, e.node(t.v), c) && l !== Mn(e, e.node(t.w), c);
	}), function(e) {
		return q(t, e);
	});
}
function kn(e, t, n, r) {
	var i = n.v, a = n.w;
	e.removeEdge(i, a), e.setEdge(r.v, r.w, {}), Z(e), X(e, t), An(e, t);
}
function An(e, t) {
	var n = Cn(e, k(e.nodes(), function(e) {
		return !t.node(e).parent;
	}));
	n = n.slice(1), c(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 jn(e, t, n) {
	return e.hasEdge(t, n);
}
function Mn(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 Nn(e) {
	switch (e.graph().ranker) {
		case "network-simplex":
			In(e);
			break;
		case "tight-tree":
			Fn(e);
			break;
		case "longest-path":
			Pn(e);
			break;
		default: In(e);
	}
}
var Pn = K;
function Fn(e) {
	K(e), hn(e);
}
function In(e) {
	Y(e);
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/nesting-graph.js
function Ln(e) {
	var t = H(e, "root", {}, "_root"), n = zn(e), r = j(T(n)) - 1, i = 2 * r + 1;
	e.graph().nestingRoot = t, c(e.edges(), function(t) {
		e.edge(t).minlen *= i;
	});
	var a = Bn(e) + 1;
	c(e.children(), function(o) {
		Rn(e, t, i, a, r, n, o);
	}), e.graph().nodeRankFactor = i;
}
function Rn(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 l = Qt(e, "_bt"), u = Qt(e, "_bb"), d = e.node(o);
	e.setParent(l, o), d.borderTop = l, e.setParent(u, o), d.borderBottom = u, c(s, function(s) {
		Rn(e, t, n, r, i, a, s);
		var c = e.node(s), d = c.borderTop ? c.borderTop : s, f = c.borderBottom ? c.borderBottom : s, p = c.borderTop ? r : 2 * r, m = d === f ? i - a[o] + 1 : 1;
		e.setEdge(l, d, {
			weight: p,
			minlen: m,
			nestingEdge: !0
		}), e.setEdge(f, u, {
			weight: p,
			minlen: m,
			nestingEdge: !0
		});
	}), e.parent(o) || e.setEdge(t, l, {
		weight: 0,
		minlen: i + a[o]
	});
}
function zn(e) {
	var t = {};
	function n(r, i) {
		var a = e.children(r);
		a && a.length && c(a, function(e) {
			n(e, i + 1);
		}), t[r] = i;
	}
	return c(e.children(), function(e) {
		n(e, 1);
	}), t;
}
function Bn(e) {
	return p(e.edges(), function(t, n) {
		return t + e.edge(n).weight;
	}, 0);
}
function Vn(e) {
	var t = e.graph();
	e.removeNode(t.nestingRoot), delete t.nestingRoot, c(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 Hn(e, t, n) {
	var r = {}, i;
	c(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 Un(e, t, n) {
	var r = Wn(e), i = new E({ compound: !0 }).setGraph({ root: r }).setDefaultNodeLabel(function(t) {
		return e.node(t);
	});
	return c(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), c(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 Wn(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 Gn(e, t) {
	for (var n = 0, r = 1; r < t.length; ++r) n += Kn(e, t[r - 1], t[r]);
	return n;
}
function Kn(e, t, n) {
	for (var r = Lt(n, v(n, function(e, t) {
		return t;
	})), i = b(v(t, function(t) {
		return L(v(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 = v(Array(o), function() {
		return 0;
	}), l = 0;
	return c(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;
		l += e.weight * n;
	})), l;
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/order/init-order.js
function qn(e) {
	var t = {}, r = n(e.nodes(), function(t) {
		return !e.children(t).length;
	}), i = v(I(j(v(r, function(t) {
		return e.node(t).rank;
	})) + 1), function() {
		return [];
	});
	function a(n) {
		et(t, n) || (t[n] = !0, i[e.node(n).rank].push(n), c(e.successors(n), a));
	}
	return c(L(r, function(t) {
		return e.node(t).rank;
	}), a), i;
}
//#endregion
//#region ../../node_modules/.pnpm/dagre-d3-es@7.0.14/node_modules/dagre-d3-es/src/dagre/order/barycenter.js
function Jn(e, t) {
	return v(t, function(t) {
		var n = e.inEdges(t);
		if (n.length) {
			var r = p(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 Yn(e, t) {
	var r = {};
	return c(e, function(e, t) {
		var n = r[e.v] = {
			indegree: 0,
			in: [],
			out: [],
			vs: [e.v],
			i: t
		};
		w(e.barycenter) || (n.barycenter = e.barycenter, n.weight = e.weight);
	}), c(t.edges(), function(e) {
		var t = r[e.v], n = r[e.w];
		!w(t) && !w(n) && (n.indegree++, t.out.push(r[e.w]));
	}), Xn(n(r, function(e) {
		return !e.indegree;
	}));
}
function Xn(e) {
	var t = [];
	function r(e) {
		return function(t) {
			t.merged || (w(t.barycenter) || w(e.barycenter) || t.barycenter >= e.barycenter) && Zn(e, t);
		};
	}
	function i(t) {
		return function(n) {
			n.in.push(t), --n.indegree === 0 && e.push(n);
		};
	}
	for (; e.length;) {
		var a = e.pop();
		t.push(a), c(a.in.reverse(), r(a)), c(a.out, i(a));
	}
	return v(n(t, function(e) {
		return !e.merged;
	}), function(e) {
		return F(e, [
			"vs",
			"i",
			"barycenter",
			"weight"
		]);
	});
}
function Zn(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 Qn(e, t) {
	var n = en(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, l = 0;
	r.sort(er(!!t)), l = $n(a, i, l), c(r, function(e) {
		l += e.vs.length, a.push(e.vs), o += e.barycenter * e.weight, s += e.weight, l = $n(a, i, l);
	});
	var u = { vs: b(a) };
	return s && (u.barycenter = o / s, u.weight = s), u;
}
function $n(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, r, i) {
	var a = e.children(t), o = e.node(t), s = o ? o.borderLeft : void 0, l = o ? o.borderRight : void 0, u = {};
	s && (a = n(a, function(e) {
		return e !== s && e !== l;
	}));
	var d = Jn(e, a);
	c(d, function(t) {
		if (e.children(t.v).length) {
			var n = tr(e, t.v, r, i);
			u[t.v] = n, Object.prototype.hasOwnProperty.call(n, "barycenter") && rr(t, n);
		}
	});
	var f = Yn(d, r);
	nr(f, u);
	var p = Qn(f, i);
	if (s && (p.vs = b([
		s,
		p.vs,
		l
	]), e.predecessors(s).length)) {
		var m = e.node(e.predecessors(s)[0]), ee = e.node(e.predecessors(l)[0]);
		Object.prototype.hasOwnProperty.call(p, "barycenter") || (p.barycenter = 0, p.weight = 0), p.barycenter = (p.barycenter * p.weight + m.order + ee.order) / (p.weight + 2), p.weight += 2;
	}
	return p;
}
function nr(e, t) {
	c(e, function(e) {
		e.vs = b(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 = $t(e), n = ar(e, I(1, t + 1), "inEdges"), r = ar(e, I(t - 1, -1, -1), "outEdges"), i = qn(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 = U(e);
		var l = Gn(e, i);
		l < a && (c = 0, o = Ve(i), a = l);
	}
	sr(e, o);
}
function ar(e, t, n) {
	return v(t, function(t) {
		return Un(e, t, n);
	});
}
function or(e, t) {
	var n = new E();
	c(e, function(e) {
		var r = e.graph().root, i = tr(e, r, n, t);
		c(i.vs, function(t, n) {
			e.node(t).order = n;
		}), Hn(e, n, i.vs);
	});
}
function sr(e, t) {
	c(t, function(t) {
		c(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);
	c(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;
		c(e.children(i), r), t[i] = {
			low: a,
			lim: n++
		};
	}
	return c(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 c(r, function(t, l) {
			var u = pr(e, t), d = u ? e.node(u).order : o;
			(u || t === s) && (c(r.slice(a, l + 1), function(t) {
				c(e.predecessors(t), function(r) {
					var a = e.node(r), o = a.order;
					(o < i || d < o) && !(a.dummy && e.node(t).dummy) && mr(n, r, t);
				});
			}), a = l + 1, i = d);
		}), r;
	}
	return p(t, r), n;
}
function fr(e, t) {
	var n = {};
	function r(t, r, i, a, o) {
		var s;
		c(I(r, i), function(r) {
			s = t[r], e.node(s).dummy && c(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 c(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 p(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 c(t, function(e) {
		c(e, function(e, t) {
			i[e] = e, a[e] = e, o[e] = t;
		});
	}), c(t, function(e) {
		var t = -1;
		c(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 l(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 u(e) {
		a[e] = o.inEdges(e).reduce(function(e, t) {
			return Math.max(e, a[t.v] + o.edge(t));
		}, 0);
	}
	function d(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 l(u, o.predecessors.bind(o)), l(d, o.successors.bind(o)), c(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 c(t, function(t) {
		var r;
		c(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 = y(n), i = j(n);
	c(["u", "d"], function(n) {
		c(["l", "r"], function(a) {
			var o = n + a, s = e[o], c;
			if (s !== t) {
				var l = T(s);
				c = a === "l" ? r - y(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(v(e, r));
		return (i[1] + i[2]) / 2;
	});
}
function Sr(e) {
	var t = U(e), n = x(dr(e, t), fr(e, t)), r = {}, i;
	return c(["u", "d"], function(a) {
		i = a === "u" ? t : T(t).reverse(), c(["l", "r"], function(t) {
			t === "r" && (i = v(i, function(e) {
				return T(e).reverse();
			}));
			var o = (a === "u" ? e.predecessors : e.successors).bind(e), s = gr(e, i, n, o), c = _r(e, i, s.root, s.align, t === "r");
			t === "r" && (c = A(c, function(e) {
				return -e;
			})), r[a + 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 = Jt(e), Er(e), Xe(Sr(e), function(t, n) {
		e.node(n).x = t;
	});
}
function Er(e) {
	var t = U(e), n = e.graph().ranksep, r = 0;
	c(t, function(t) {
		var i = j(v(t, function(t) {
			return e.node(t).height;
		}));
		c(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 ? tn : nn;
	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", () => Wt(e)), t("    nestingGraph.run", () => Ln(e)), t("    rank", () => Nn(Jt(e))), t("    injectEdgeLabelProxies", () => Br(e)), t("    removeEmptyRanks", () => Zt(e)), t("    nestingGraph.cleanup", () => Vn(e)), t("    normalizeRanks", () => Xt(e)), t("    assignRankMinMax", () => Vr(e)), t("    removeEdgeLabelProxies", () => Hr(e)), t("    normalize.run", () => fn(e)), t("    parentDummyChains", () => cr(e)), t("    addBorderSegments", () => rn(e)), t("    order", () => ir(e)), t("    insertSelfEdges", () => Yr(e)), t("    adjustCoordinateSystem", () => on(e)), t("    position", () => Tr(e)), t("    positionSelfEdges", () => Xr(e)), t("    removeBorderNodes", () => qr(e)), t("    normalize.undo", () => mn(e)), t("    fixupEdgeLabelCoords", () => Gr(e)), t("    undoCoordinateSystem", () => sn(e)), t("    translateGraph", () => Ur(e)), t("    assignNodeIntersects", () => Wr(e)), t("    reversePoints", () => Kr(e)), t("    acyclic.undo", () => Kt(e));
}
function kr(e, t) {
	c(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));
	}), c(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(x({}, jr, Q(n, Ar), F(n, Mr))), c(e.nodes(), function(n) {
		var r = $(e.node(n));
		t.setNode(n, Ge(Q(r, Nr), Pr)), t.setParent(n, e.parent(n));
	}), c(e.edges(), function(n) {
		var r = $(e.edge(n));
		t.setEdge(n, x({}, Ir, Q(r, Fr), F(r, Lr)));
	}), t;
}
function zr(e) {
	var t = e.graph();
	t.ranksep /= 2, c(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) {
	c(e.edges(), function(t) {
		var n = e.edge(t);
		if (n.width && n.height) {
			var r = e.node(t.v);
			H(e, "edge-proxy", {
				rank: (e.node(t.w).rank - r.rank) / 2 + r.rank,
				e: t
			}, "_ep");
		}
	});
}
function Vr(e) {
	var t = 0;
	c(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) {
	c(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 l(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);
	}
	c(e.nodes(), function(t) {
		l(e.node(t));
	}), c(e.edges(), function(t) {
		var n = e.edge(t);
		Object.prototype.hasOwnProperty.call(n, "x") && l(n);
	}), t -= o, r -= s, c(e.nodes(), function(n) {
		var i = e.node(n);
		i.x -= t, i.y -= r;
	}), c(e.edges(), function(n) {
		var i = e.edge(n);
		c(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) {
	c(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(Yt(r, a)), n.points.push(Yt(i, o));
	});
}
function Gr(e) {
	c(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) {
	c(e.edges(), function(t) {
		var n = e.edge(t);
		n.reversed && n.points.reverse();
	});
}
function qr(e) {
	c(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;
		}
	}), c(e.nodes(), function(t) {
		e.node(t).dummy === "border" && e.removeNode(t);
	});
}
function Jr(e) {
	c(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) {
	c(U(e), function(t) {
		var n = 0;
		c(t, function(t, r) {
			var i = e.node(t);
			i.order = r + n, c(i.selfEdges, function(t) {
				H(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) {
	c(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 c(e, function(e, n) {
		t[n.toLowerCase()] = e;
	}), t;
}
//#endregion
export { Dr as t };
