import { __module as O } from "../../../../../_virtual/cytoscape-cose-bilkent2.js";
import { __require as q } from "../../../cose-base@1.0.3/node_modules/cose-base/cose-base.js";
var j = O.exports, x;
function W() {
  return x ? O.exports : (x = 1, (function(b, Q) {
    (function(c, d) {
      b.exports = d(q());
    })(j, function(F) {
      return (
        /******/
        (function(c) {
          var d = {};
          function o(i) {
            if (d[i])
              return d[i].exports;
            var n = d[i] = {
              /******/
              i,
              /******/
              l: !1,
              /******/
              exports: {}
              /******/
            };
            return c[i].call(n.exports, n, n.exports, o), n.l = !0, n.exports;
          }
          return o.m = c, o.c = d, o.i = function(i) {
            return i;
          }, o.d = function(i, n, s) {
            o.o(i, n) || Object.defineProperty(i, n, {
              /******/
              configurable: !1,
              /******/
              enumerable: !0,
              /******/
              get: s
              /******/
            });
          }, o.n = function(i) {
            var n = i && i.__esModule ? (
              /******/
              function() {
                return i.default;
              }
            ) : (
              /******/
              function() {
                return i;
              }
            );
            return o.d(n, "a", n), n;
          }, o.o = function(i, n) {
            return Object.prototype.hasOwnProperty.call(i, n);
          }, o.p = "", o(o.s = 1);
        })([
          /* 0 */
          /***/
          (function(c, d) {
            c.exports = F;
          }),
          /* 1 */
          /***/
          (function(c, d, o) {
            var i = o(0).layoutBase.LayoutConstants, n = o(0).layoutBase.FDLayoutConstants, s = o(0).CoSEConstants, H = o(0).CoSELayout, G = o(0).CoSENode, B = o(0).layoutBase.PointD, V = o(0).layoutBase.DimensionD, Y = {
              // Called on `layoutready`
              ready: function() {
              },
              // Called on `layoutstop`
              stop: function() {
              },
              // 'draft', 'default' or 'proof" 
              // - 'draft' fast cooling rate 
              // - 'default' moderate cooling rate 
              // - "proof" slow cooling rate
              quality: "default",
              // include labels in node dimensions
              nodeDimensionsIncludeLabels: !1,
              // number of ticks per frame; higher is faster but more jerky
              refresh: 30,
              // Whether to fit the network view after when done
              fit: !0,
              // Padding on fit
              padding: 10,
              // Whether to enable incremental mode
              randomize: !0,
              // Node repulsion (non overlapping) multiplier
              nodeRepulsion: 4500,
              // Ideal edge (non nested) length
              idealEdgeLength: 50,
              // Divisor to compute edge forces
              edgeElasticity: 0.45,
              // Nesting factor (multiplier) to compute ideal edge length for nested edges
              nestingFactor: 0.1,
              // Gravity force (constant)
              gravity: 0.25,
              // Maximum number of iterations to perform
              numIter: 2500,
              // For enabling tiling
              tile: !0,
              // Type of layout animation. The option set is {'during', 'end', false}
              animate: "end",
              // Duration for animate:end
              animationDuration: 500,
              // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
              tilingPaddingVertical: 10,
              // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
              tilingPaddingHorizontal: 10,
              // Gravity range (constant) for compounds
              gravityRangeCompound: 1.5,
              // Gravity force (constant) for compounds
              gravityCompound: 1,
              // Gravity range (constant)
              gravityRange: 3.8,
              // Initial cooling factor for incremental layout
              initialEnergyOnIncremental: 0.5
            };
            function h(u, t) {
              var l = {};
              for (var r in u)
                l[r] = u[r];
              for (var r in t)
                l[r] = t[r];
              return l;
            }
            function p(u) {
              this.options = h(Y, u), w(this.options);
            }
            var w = function(t) {
              t.nodeRepulsion != null && (s.DEFAULT_REPULSION_STRENGTH = n.DEFAULT_REPULSION_STRENGTH = t.nodeRepulsion), t.idealEdgeLength != null && (s.DEFAULT_EDGE_LENGTH = n.DEFAULT_EDGE_LENGTH = t.idealEdgeLength), t.edgeElasticity != null && (s.DEFAULT_SPRING_STRENGTH = n.DEFAULT_SPRING_STRENGTH = t.edgeElasticity), t.nestingFactor != null && (s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = t.nestingFactor), t.gravity != null && (s.DEFAULT_GRAVITY_STRENGTH = n.DEFAULT_GRAVITY_STRENGTH = t.gravity), t.numIter != null && (s.MAX_ITERATIONS = n.MAX_ITERATIONS = t.numIter), t.gravityRange != null && (s.DEFAULT_GRAVITY_RANGE_FACTOR = n.DEFAULT_GRAVITY_RANGE_FACTOR = t.gravityRange), t.gravityCompound != null && (s.DEFAULT_COMPOUND_GRAVITY_STRENGTH = n.DEFAULT_COMPOUND_GRAVITY_STRENGTH = t.gravityCompound), t.gravityRangeCompound != null && (s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = t.gravityRangeCompound), t.initialEnergyOnIncremental != null && (s.DEFAULT_COOLING_FACTOR_INCREMENTAL = n.DEFAULT_COOLING_FACTOR_INCREMENTAL = t.initialEnergyOnIncremental), t.quality == "draft" ? i.QUALITY = 0 : t.quality == "proof" ? i.QUALITY = 2 : i.QUALITY = 1, s.NODE_DIMENSIONS_INCLUDE_LABELS = n.NODE_DIMENSIONS_INCLUDE_LABELS = i.NODE_DIMENSIONS_INCLUDE_LABELS = t.nodeDimensionsIncludeLabels, s.DEFAULT_INCREMENTAL = n.DEFAULT_INCREMENTAL = i.DEFAULT_INCREMENTAL = !t.randomize, s.ANIMATE = n.ANIMATE = i.ANIMATE = t.animate, s.TILE = t.tile, s.TILING_PADDING_VERTICAL = typeof t.tilingPaddingVertical == "function" ? t.tilingPaddingVertical.call() : t.tilingPaddingVertical, s.TILING_PADDING_HORIZONTAL = typeof t.tilingPaddingHorizontal == "function" ? t.tilingPaddingHorizontal.call() : t.tilingPaddingHorizontal;
            };
            p.prototype.run = function() {
              var u, t, l = this.options;
              this.idToLNode = {};
              var r = this.layout = new H(), a = this;
              a.stopped = !1, this.cy = this.options.cy, this.cy.trigger({ type: "layoutstart", layout: this });
              var e = r.newGraphManager();
              this.gm = e;
              var g = this.options.eles.nodes(), f = this.options.eles.edges();
              this.root = e.addRoot(), this.processChildrenList(this.root, this.getTopMostNodes(g), r);
              for (var E = 0; E < f.length; E++) {
                var A = f[E], v = this.idToLNode[A.data("source")], D = this.idToLNode[A.data("target")];
                if (v !== D && v.getEdgesBetween(D).length == 0) {
                  var N = e.add(r.newEdge(), v, D);
                  N.id = A.id();
                }
              }
              var U = function(L, m) {
                typeof L == "number" && (L = m);
                var I = L.data("id"), R = a.idToLNode[I];
                return {
                  x: R.getRect().getCenterX(),
                  y: R.getRect().getCenterY()
                };
              }, z = function S() {
                for (var L = function() {
                  l.fit && l.cy.fit(l.eles, l.padding), u || (u = !0, a.cy.one("layoutready", l.ready), a.cy.trigger({ type: "layoutready", layout: a }));
                }, m = a.options.refresh, I, R = 0; R < m && !I; R++)
                  I = a.stopped || a.layout.tick();
                if (I) {
                  r.checkLayoutSuccess() && !r.isSubLayout && r.doPostLayout(), r.tilingPostLayout && r.tilingPostLayout(), r.isLayoutFinished = !0, a.options.eles.nodes().positions(U), L(), a.cy.one("layoutstop", a.options.stop), a.cy.trigger({ type: "layoutstop", layout: a }), t && cancelAnimationFrame(t), u = !1;
                  return;
                }
                var C = a.layout.getPositionsData();
                l.eles.nodes().positions(function(y, k) {
                  if (typeof y == "number" && (y = k), !y.isParent()) {
                    for (var M = y.id(), T = C[M], _ = y; T == null && (T = C[_.data("parent")] || C["DummyCompound_" + _.data("parent")], C[M] = T, _ = _.parent()[0], _ != null); )
                      ;
                    return T != null ? {
                      x: T.x,
                      y: T.y
                    } : {
                      x: y.position("x"),
                      y: y.position("y")
                    };
                  }
                }), L(), t = requestAnimationFrame(S);
              };
              return r.addListener("layoutstarted", function() {
                a.options.animate === "during" && (t = requestAnimationFrame(z));
              }), r.runLayout(), this.options.animate !== "during" && (a.options.eles.nodes().not(":parent").layoutPositions(a, a.options, U), u = !1), this;
            }, p.prototype.getTopMostNodes = function(u) {
              for (var t = {}, l = 0; l < u.length; l++)
                t[u[l].id()] = !0;
              var r = u.filter(function(a, e) {
                typeof a == "number" && (a = e);
                for (var g = a.parent()[0]; g != null; ) {
                  if (t[g.id()])
                    return !1;
                  g = g.parent()[0];
                }
                return !0;
              });
              return r;
            }, p.prototype.processChildrenList = function(u, t, l) {
              for (var r = t.length, a = 0; a < r; a++) {
                var e = t[a], g = e.children(), f, E = e.layoutDimensions({
                  nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels
                });
                if (e.outerWidth() != null && e.outerHeight() != null ? f = u.add(new G(l.graphManager, new B(e.position("x") - E.w / 2, e.position("y") - E.h / 2), new V(parseFloat(E.w), parseFloat(E.h)))) : f = u.add(new G(this.graphManager)), f.id = e.data("id"), f.paddingLeft = parseInt(e.css("padding")), f.paddingTop = parseInt(e.css("padding")), f.paddingRight = parseInt(e.css("padding")), f.paddingBottom = parseInt(e.css("padding")), this.options.nodeDimensionsIncludeLabels && e.isParent()) {
                  var A = e.boundingBox({ includeLabels: !0, includeNodes: !1 }).w, v = e.boundingBox({ includeLabels: !0, includeNodes: !1 }).h, D = e.css("text-halign");
                  f.labelWidth = A, f.labelHeight = v, f.labelPos = D;
                }
                if (this.idToLNode[e.data("id")] = f, isNaN(f.rect.x) && (f.rect.x = 0), isNaN(f.rect.y) && (f.rect.y = 0), g != null && g.length > 0) {
                  var N;
                  N = l.getGraphManager().add(l.newGraph(), f), this.processChildrenList(N, g, l);
                }
              }
            }, p.prototype.stop = function() {
              return this.stopped = !0, this;
            };
            var P = function(t) {
              t("layout", "cose-bilkent", p);
            };
            typeof cytoscape < "u" && P(cytoscape), c.exports = P;
          })
          /******/
        ])
      );
    });
  })(O), O.exports);
}
export {
  W as __require
};
