Liferay.Loader.define("portal-workflow-kaleo-designer-web$graphlib@2.1.8/lib/json",["module","exports","require","./lodash","./graph"],(function(e,n,r){window;{var a=r("./lodash"),i=r("./graph");function writeNodes(e){return a.map(e.nodes(),(function(n){var r=e.node(n),i=e.parent(n),t={v:n};return a.isUndefined(r)||(t.value=r),a.isUndefined(i)||(t.parent=i),t}))}function writeEdges(e){return a.map(e.edges(),(function(n){var r=e.edge(n),i={v:n.v,w:n.w};return a.isUndefined(n.name)||(i.name=n.name),a.isUndefined(r)||(i.value=r),i}))}e.exports={write:function write(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:writeNodes(e),edges:writeEdges(e)};return a.isUndefined(e.graph())||(n.value=a.clone(e.graph())),n},read:function read(e){var n=new i(e.options).setGraph(e.value);return a.each(e.nodes,(function(e){n.setNode(e.v,e.value),e.parent&&n.setParent(e.v,e.parent)})),a.each(e.edges,(function(e){n.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),n}}}}));
//# sourceMappingURL=json.js.map