import "./graph.js";
import o from "../../../../../lodash-es@4.17.22/node_modules/lodash-es/isUndefined.js";
import d from "../../../../../lodash-es@4.17.22/node_modules/lodash-es/clone.js";
import a from "../../../../../lodash-es@4.17.22/node_modules/lodash-es/map.js";
function c(e) {
  var r = {
    options: {
      directed: e.isDirected(),
      multigraph: e.isMultigraph(),
      compound: e.isCompound()
    },
    nodes: u(e),
    edges: p(e)
  };
  return o(e.graph()) || (r.value = d(e.graph())), r;
}
function u(e) {
  return a(e.nodes(), function(r) {
    var i = e.node(r), n = e.parent(r), t = { v: r };
    return o(i) || (t.value = i), o(n) || (t.parent = n), t;
  });
}
function p(e) {
  return a(e.edges(), function(r) {
    var i = e.edge(r), n = { v: r.v, w: r.w };
    return o(r.name) || (n.name = r.name), o(i) || (n.value = i), n;
  });
}
export {
  c as write
};
