import { positionEdgeLabel as n, markers_default as l, insertEdgeLabel as s, insertEdge as m } from "./chunk-QXUST7PY.js";
import { labelHelper as g, insertNode as d, insertCluster as u } from "./chunk-JZLCHNYA.js";
import { interpolateToCurve as y } from "./chunk-S3R3BYOJ.js";
import { getConfig as f, common_default as p } from "./chunk-ABZYJK2D.js";
import { __name as o, log as i } from "./chunk-AGHRB4JF.js";
var h = {
  common: p,
  getConfig: f,
  insertCluster: u,
  insertEdge: m,
  insertEdgeLabel: s,
  insertMarkers: l,
  insertNode: d,
  interpolateToCurve: y,
  labelHelper: g,
  log: i,
  positionEdgeLabel: n
}, t = {}, L = /* @__PURE__ */ o((r) => {
  for (const e of r)
    t[e.name] = e;
}, "registerLayoutLoaders"), w = /* @__PURE__ */ o(() => {
  L([
    {
      name: "dagre",
      loader: /* @__PURE__ */ o(async () => await import("./dagre-6UL2VRFP.js"), "loader")
    },
    {
      name: "cose-bilkent",
      loader: /* @__PURE__ */ o(async () => await import("./cose-bilkent-S5V4N54A.js"), "loader")
    }
  ]);
}, "registerDefaultLayoutLoaders");
w();
var _ = /* @__PURE__ */ o(async (r, e) => {
  if (!(r.layoutAlgorithm in t))
    throw new Error(`Unknown layout algorithm: ${r.layoutAlgorithm}`);
  const a = t[r.layoutAlgorithm];
  return (await a.loader()).render(r, e, h, {
    algorithm: a.algorithm
  });
}, "render"), C = /* @__PURE__ */ o((r = "", { fallback: e = "dagre" } = {}) => {
  if (r in t)
    return r;
  if (e in t)
    return i.warn(`Layout algorithm ${r} is not registered. Using ${e} as fallback.`), e;
  throw new Error(`Both layout algorithms ${r} and ${e} are not registered.`);
}, "getRegisteredLayoutAlgorithm");
export {
  C as getRegisteredLayoutAlgorithm,
  L as registerLayoutLoaders,
  _ as render
};
