graphology
Advanced tools
Comparing version 0.15.0 to 0.15.1
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.graphology=t():e.graphology=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function o(e){var t="function"==typeof Map?new Map:void 0;return(o=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return c(e,arguments,d(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,e)})(e)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function c(e,t,n){return(c=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&u(i,n.prototype),i}).apply(null,arguments)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return p}));var s=function(e){function t(t,n){var r;return(r=e.call(this)||this).name="GraphError",r.message=t||"",r.data=n||{},r}return i(t,e),t}(o(Error)),h=function(e){function t(n,i){var o;return(o=e.call(this,n,i)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r(o),t.prototype.constructor),o}return i(t,e),t}(s),f=function(e){function t(n,i){var o;return(o=e.call(this,n,i)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r(o),t.prototype.constructor),o}return i(t,e),t}(s),p=function(e){function t(n,i){var o;return(o=e.call(this,n,i)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r(o),t.prototype.constructor),o}return i(t,e),t}(s)},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){for(var e=arguments[0]||{},t=1,n=arguments.length;t<n;t++)if(arguments[t])for(var r in arguments[t])e[r]=arguments[t][r];return e}function o(e,t,n,r){var i=e._nodes.get(t),o=null;return i?o="mixed"===r?i.out&&i.out[n]||i.undirected&&i.undirected[n]:"directed"===r?i.out&&i.out[n]:i.undirected&&i.undirected[n]:o}function a(e){return null!==e&&"object"===r(e)&&"function"==typeof e.addUndirectedEdgeWithKey&&"function"==typeof e.dropNode}function c(e){return"object"===r(e)&&null!==e&&e.constructor===Object}function u(e){for(var t=""+e,n="",r=0,i=t.length;r<i;r++){n=t[i-r-1]+n,(r-2)%3||r===i-1||(n=","+n)}return n}function d(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function s(e,t,n){var r={enumerable:!0,configurable:!0};"function"==typeof n?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function h(){var e=0;return function(){return"_geid".concat(e++,"_")}}n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return c})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"h",(function(){return s})),n.d(t,"c",(function(){return h}))},function(e,t){function n(e){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:e}),this.done=!1}n.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var e=arguments,t=e.length,r=0;return new n((function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}}))},n.empty=function(){var e=new n(null);return e.done=!0,e},n.is=function(e){return e instanceof n||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=n},function(e,t,n){"use strict";var r=n(6),i=n(2),o=n.n(i),a=n(5),c=n.n(a),u=n(0);function d(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function s(e,t){this.key=e,this.attributes=t||{},this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function h(e,t){this.key=e,this.attributes=t||{},this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function f(e,t,n,r,i){this.key=e,this.attributes=i,this.source=n,this.target=r,this.generatedKey=t}function p(e,t,n,r,i){this.key=e,this.attributes=i,this.source=n,this.target=r,this.generatedKey=t}function g(e,t,n,r,i,o,a){var c=e.multi,u=t?"undirected":"out",d=t?"undirected":"in",s=o[u][i];void 0===s&&(s=c?new Set:n,o[u][i]=s),c&&s.add(n),r!==i&&void 0===a[d][r]&&(a[d][r]=s)}function l(e,t,n){var r=e.multi,i=n.source,o=n.target,a=i.key,c=o.key,u=i[t?"undirected":"out"],d=t?"undirected":"in";if(c in u)if(r){var s=u[c];1===s.size?(delete u[c],delete o[d][a]):s.delete(n)}else delete u[c];r||delete o[d][a]}s.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},h.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var b=n(1);var y=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes[i]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+arguments[1];if(!(i=Object(b.b)(this,o,a,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(e=""+e,!(i=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(i instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes.hasOwnProperty(i)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i,o){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var c=""+e,d=""+i;if(i=arguments[2],o=arguments[3],!(a=Object(b.b)(this,c,d,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(c,'" - "').concat(d,'").'))}else if(e=""+e,!(a=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(a instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[i]=o,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",meta:{name:i,value:o}}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i,o){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var c=""+e,d=""+i;if(i=arguments[2],o=arguments[3],!(a=Object(b.b)(this,c,d,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(c,'" - "').concat(d,'").'))}else if(e=""+e,!(a=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("function"!=typeof o)throw new u.a("Graph.".concat(t,": updater should be a function."));if("mixed"!==n&&!(a instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[i]=o(a.attributes[i]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",meta:{name:i,value:a.attributes[i]}}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return delete o.attributes[i],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",meta:{name:i}}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!Object(b.e)(i))throw new u.a("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));var d=o.attributes;return o.attributes=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",meta:{before:d,after:i}}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!Object(b.e)(i))throw new u.a("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return Object(b.a)(o.attributes,i),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",meta:{data:i}}),this}}}];var v=n(4),w=n.n(v),m=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function _(e,t){for(var n in t)t[n]instanceof Set?t[n].forEach((function(t){return e.push(t.key)})):e.push(t[n].key)}function G(e,t){for(var n in e)if(e[n]instanceof Set)e[n].forEach((function(e){return t(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)}));else{var r=e[n];t(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes)}}function x(e){var t=Object.keys(e),n=t.length,r=null,i=0;return new o.a((function o(){var a;if(r){var c=r.next();if(c.done)return r=null,i++,o();a=c.value}else{if(i>=n)return{done:!0};var u=t[i];if((a=e[u])instanceof Set)return r=a.values(),o();i++}return{done:!1,value:[a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes]}}))}function E(e,t,n){n in t&&(t[n]instanceof Set?t[n].forEach((function(t){return e.push(t.key)})):e.push(t[n].key))}function k(e,t,n){if(t in e)if(e[t]instanceof Set)e[t].forEach((function(e){return n(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)}));else{var r=e[t];n(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes)}}function j(e,t){var n=e[t];if(n instanceof Set){var r=n.values();return new o.a((function(){var e=r.next();if(e.done)return e;var t=e.value;return{done:!1,value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes]}}))}return o.a.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function O(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return c()(e._edges.keys(),e._edges.size);var n="undirected"===t?e.undirectedSize:e.directedSize,r=new Array(n),i="undirected"===t,o=0;return e._edges.forEach((function(e,t){e instanceof p===i&&(r[o++]=t)})),r}function S(e,t,n){if(0!==e.size)if("mixed"===t||t===e.type)e._edges.forEach((function(e,t){var r=e.attributes,i=e.source,o=e.target;n(t,r,i.key,o.key,i.attributes,o.attributes)}));else{var r="undirected"===t;e._edges.forEach((function(e,t){if(e instanceof p===r){var i=e.attributes,o=e.source,a=e.target;n(t,i,o.key,a.key,o.attributes,a.attributes)}}))}}function A(e,t){return 0===e.size?o.a.empty():"mixed"===t?(n=e._edges.values(),new o.a((function(){var e=n.next();if(e.done)return e;var t=e.value;return{value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes],done:!1}}))):(n=e._edges.values(),new o.a((function e(){var r=n.next();if(r.done)return r;var i=r.value;return i instanceof p==("undirected"===t)?{value:[i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes],done:!1}:e()})));var n}function N(e,t,n){var r=[];return"undirected"!==e&&("out"!==t&&_(r,n.in),"in"!==t&&_(r,n.out)),"directed"!==e&&_(r,n.undirected),r}function L(e,t,n,r){"undirected"!==e&&("out"!==t&&G(n.in,r),"in"!==t&&G(n.out,r)),"directed"!==e&&G(n.undirected,r)}function D(e,t,n){var r=o.a.empty();return"undirected"!==e&&("out"!==t&&void 0!==n.in&&(r=w()(r,x(n.in))),"in"!==t&&void 0!==n.out&&(r=w()(r,x(n.out)))),"directed"!==e&&void 0!==n.undirected&&(r=w()(r,x(n.undirected))),r}function U(e,t,n,r){var i=[];return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&E(i,n.in,r),void 0!==n.out&&"in"!==t&&E(i,n.out,r)),"directed"!==e&&void 0!==n.undirected&&E(i,n.undirected,r),i}function z(e,t,n,r,i){"undirected"!==e&&(void 0!==n.in&&"out"!==t&&k(n.in,r,i),void 0!==n.out&&"in"!==t&&k(n.out,r,i)),"directed"!==e&&void 0!==n.undirected&&k(n.undirected,r,i)}function M(e,t,n,r){var i=o.a.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&r in n.in&&(i=w()(i,j(n.in,r))),void 0!==n.out&&"in"!==t&&r in n.out&&(i=w()(i,j(n.out,r)))),"directed"!==e&&void 0!==n.undirected&&r in n.undirected&&(i=w()(i,j(n.undirected,r))),i}var P=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function K(e,t){if(void 0!==t)for(var n in t)e.add(n)}function C(e,t,n){if("mixed"!==e){if("undirected"===e)return Object.keys(n.undirected);if("string"==typeof t)return Object.keys(n[t])}var r=new Set;return"undirected"!==e&&("out"!==t&&K(r,n.in),"in"!==t&&K(r,n.out)),"directed"!==e&&K(r,n.undirected),c()(r.values(),r.size)}function T(e,t,n){for(var r in t){var i=t[r];i instanceof Set&&(i=i.values().next().value);var o=i.source,a=i.target,c=o===e?a:o;n(c.key,c.attributes)}}function R(e,t,n,r){for(var i in n){var o=n[i];o instanceof Set&&(o=o.values().next().value);var a=o.source,c=o.target,u=a===t?c:a;e.has(u.key)||(e.add(u.key),r(u.key,u.attributes))}}function F(e,t){var n=Object.keys(t),r=n.length,i=0;return new o.a((function(){if(i>=r)return{done:!0};var o=t[n[i++]];o instanceof Set&&(o=o.values().next().value);var a=o.source,c=o.target,u=a===e?c:a;return{done:!1,value:[u.key,u.attributes]}}))}function W(e,t,n){var r=Object.keys(n),i=r.length,a=0;return new o.a((function o(){if(a>=i)return{done:!0};var c=n[r[a++]];c instanceof Set&&(c=c.values().next().value);var u=c.source,d=c.target,s=u===t?d:u;return e.has(s.key)?o():(e.add(s.key),{done:!1,value:[s.key,s.attributes]})}))}function I(e,t,n,r,i){var o=e._nodes.get(r);if("undirected"!==t){if("out"!==n&&void 0!==o.in)for(var a in o.in)if(a===i)return!0;if("in"!==n&&void 0!==o.out)for(var c in o.out)if(c===i)return!0}if("directed"!==t&&void 0!==o.undirected)for(var u in o.undirected)if(u===i)return!0;return!1}function Y(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){e=""+e;var n=this._nodes.get(e);if(void 0===n)throw new u.b("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,r){if("mixed"!==e){if("undirected"===e)return T(n,n.undirected,r);if("string"==typeof t)return T(n,n[t],r)}var i=new Set;"undirected"!==e&&("out"!==t&&R(i,n,n.in,r),"in"!==t&&R(i,n,n.out,r)),"directed"!==e&&R(i,n,n.undirected,r)}("mixed"===r?this.type:r,i,n,t)}}}function J(e,t){var n=t.name,r=t.type,i=t.direction,a=n.slice(0,-1)+"Entries";e.prototype[a]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return o.a.empty();e=""+e;var t=this._nodes.get(e);if(void 0===t)throw new u.b("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return F(n,n.undirected);if("string"==typeof t)return F(n,n[t])}var r=o.a.empty(),i=new Set;return"undirected"!==e&&("out"!==t&&(r=w()(r,W(i,n,n.in))),"in"!==t&&(r=w()(r,W(i,n,n.out)))),"directed"!==e&&(r=w()(r,W(i,n,n.undirected))),r}("mixed"===r?this.type:r,i,t)}}function q(e,t){var n={key:e};return Object.keys(t.attributes).length&&(n.attributes=Object(b.a)({},t.attributes)),n}function B(e,t){var n={source:t.source.key,target:t.target.key};return t.generatedKey||(n.key=e),Object.keys(t.attributes).length&&(n.attributes=Object(b.a)({},t.attributes)),t instanceof p&&(n.undirected=!0),n}function H(e){return Object(b.e)(e)?"key"in e?"attributes"in e&&(!Object(b.e)(e.attributes)||null===e.attributes)?"invalid-attributes":null:"no-key":"not-object"}function Q(e){return Object(b.e)(e)?"source"in e?"target"in e?"attributes"in e&&(!Object(b.e)(e.attributes)||null===e.attributes)?"invalid-attributes":"undirected"in e&&"boolean"!=typeof e.undirected?"invalid-undirected":null:"no-target":"no-source":"not-object"}function V(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return re}));var X=new Set(["directed","undirected","mixed"]),Z=new Set(["domain","_events","_eventsCount","_maxListeners"]),$={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function ee(e,t,n,r,i,o,a,c){if(!r&&"undirected"===e.type)throw new u.c("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new u.c("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(c&&!Object(b.e)(c))throw new u.a("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(c,'"'));if(o=""+o,a=""+a,c=c||{},!e.allowSelfLoops&&o===a)throw new u.c("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var d=e._nodes.get(o),s=e._nodes.get(a);if(!d)throw new u.b("Graph.".concat(t,': source node "').concat(o,'" not found.'));if(!s)throw new u.b("Graph.".concat(t,': target node "').concat(a,'" not found.'));var h={key:null,undirected:r,source:o,target:a,attributes:c};if(n&&(i=e._edgeKeyGenerator(h)),i=""+i,e._edges.has(i))throw new u.c("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));if(!e.multi&&(r?void 0!==d.undirected[a]:void 0!==d.out[a]))throw new u.c("Graph.".concat(t,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var l=new(r?p:f)(i,n,d,s,c);return e._edges.set(i,l),o===a?r?d.undirectedSelfLoops++:d.directedSelfLoops++:r?(d.undirectedDegree++,s.undirectedDegree++):(d.outDegree++,s.inDegree++),g(e,r,l,o,a,d,s),r?e._undirectedSize++:e._directedSize++,h.key=i,e.emit("edgeAdded",h),i}function te(e,t,n,r,i,o,a,c){if(!r&&"undirected"===e.type)throw new u.c("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new u.c("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(c&&!Object(b.e)(c))throw new u.a("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(c,'"'));if(o=""+o,a=""+a,c=c||{},!e.allowSelfLoops&&o===a)throw new u.c("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var d,s,h=e._nodes.get(o),l=e._nodes.get(a),y=null;if(!n&&(d=e._edges.get(i))){if(d.source!==o||d.target!==a||r&&(d.source!==a||d.target!==o))throw new u.c("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. (').concat(d.source,", ").concat(d.target,")."));y=i}if(y||e.multi||!h||(r?void 0===h.undirected[a]:void 0===h.out[a])||(s=Object(b.b)(e,o,a,r?"undirected":"directed")),s)return c?(Object(b.a)(s.attributes,c),y):y;var v={key:null,undirected:r,source:o,target:a,attributes:c};if(n&&(i=e._edgeKeyGenerator(v)),i=""+i,e._edges.has(i))throw new u.c("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));return h||(e.addNode(o),h=e._nodes.get(o),o===a&&(l=h)),l||(e.addNode(a),l=e._nodes.get(a)),d=new(r?p:f)(i,n,h,l,c),e._edges.set(i,d),o===a?r?h.undirectedSelfLoops++:h.directedSelfLoops++:r?(h.undirectedDegree++,l.undirectedDegree++):(h.outDegree++,l.inDegree++),g(e,r,d,o,a,h,l),r?e._undirectedSize++:e._directedSize++,v.key=i,e.emit("edgeAdded",v),i}var ne,re=function(e){var t,n;function r(t){var n;if(n=e.call(this)||this,(t=Object(b.a)({},$,t)).edgeKeyGenerator&&"function"!=typeof t.edgeKeyGenerator)throw new u.a("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(t.edgeKeyGenerator,'".'));if("boolean"!=typeof t.multi)throw new u.a("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!X.has(t.type))throw new u.a('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new u.a("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var r="mixed"===t.type?d:"directed"===t.type?s:h;return Object(b.g)(V(n),"NodeDataClass",r),Object(b.g)(V(n),"_attributes",{}),Object(b.g)(V(n),"_nodes",new Map),Object(b.g)(V(n),"_edges",new Map),Object(b.g)(V(n),"_directedSize",0),Object(b.g)(V(n),"_undirectedSize",0),Object(b.g)(V(n),"_edgeKeyGenerator",t.edgeKeyGenerator||Object(b.c)()),Object(b.g)(V(n),"_options",t),Z.forEach((function(e){return Object(b.g)(V(n),e,n[e])})),Object(b.h)(V(n),"order",(function(){return n._nodes.size})),Object(b.h)(V(n),"size",(function(){return n._edges.size})),Object(b.h)(V(n),"directedSize",(function(){return n._directedSize})),Object(b.h)(V(n),"undirectedSize",(function(){return n._undirectedSize})),Object(b.h)(V(n),"multi",n._options.multi),Object(b.h)(V(n),"type",n._options.type),Object(b.h)(V(n),"allowSelfLoops",n._options.allowSelfLoops),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.hasNode=function(e){return this._nodes.has(""+e)},i.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var n=""+e,r=this._edges.get(n);return!!r&&r instanceof f}if(2===arguments.length){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)return!1;var o=i.out[t];return!!o&&(!this.multi||!!o.size)}throw new u.a("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var n=""+e,r=this._edges.get(n);return!!r&&r instanceof p}if(2===arguments.length){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)return!1;var o=i.undirected[t];return!!o&&(!this.multi||!!o.size)}throw new u.a("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasEdge=function(e,t){if(1===arguments.length){var n=""+e;return this._edges.has(n)}if(2===arguments.length){e=""+e,t=""+t;var r=this._nodes.get(e);if(!r)return!1;var i=void 0!==r.out&&r.out[t];return i||(i=void 0!==r.undirected&&r.undirected[t]),!!i&&(!this.multi||!!i.size)}throw new u.a("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new u.c("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(e);if(!n)throw new u.b('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||void 0;return r?r.key:void 0}},i.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new u.c("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(e);if(!n)throw new u.b('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.undirected&&n.undirected[t]||void 0;return r?r.key:void 0}},i.edge=function(e,t){if(this.multi)throw new u.c("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key},i.inDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.inDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));if("undirected"===this.type)return 0;var r=t?n.directedSelfLoops:0;return n.inDegree+r},i.outDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.outDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));if("undirected"===this.type)return 0;var r=t?n.directedSelfLoops:0;return n.outDegree+r},i.directedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.directedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(e=""+e,!this.hasNode(e))throw new u.b('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:this.inDegree(e,t)+this.outDegree(e,t)},i.undirectedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.undirectedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(e=""+e,!this.hasNode(e))throw new u.b('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));if("directed"===this.type)return 0;var n=this._nodes.get(e),r=t?2*n.undirectedSelfLoops:0;return n.undirectedDegree+r},i.degree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.degree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(e=""+e,!this.hasNode(e))throw new u.b('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var n=0;return"undirected"!==this.type&&(n+=this.directedDegree(e,t)),"directed"!==this.type&&(n+=this.undirectedDegree(e,t)),n},i.source=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},i.target=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},i.extremities=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},i.opposite=function(e,t){if(e=""+e,t=""+t,!this._nodes.has(e))throw new u.b('Graph.opposite: could not find the "'.concat(e,'" node in the graph.'));var n=this._edges.get(t);if(!n)throw new u.b('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var r=n.source,i=n.target,o=r.key,a=i.key;if(e!==o&&e!==a)throw new u.b('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(o,", ").concat(a,")."));return e===o?a:o},i.undirected=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.undirected: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof p},i.directed=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.directed: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof f},i.selfLoop=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.selfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},i.addNode=function(e,t){if(t&&!Object(b.e)(t))throw new u.a('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));if(e=""+e,t=t||{},this._nodes.has(e))throw new u.c('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var n=new this.NodeDataClass(e,t);return this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e},i.mergeNode=function(e,t){if(t&&!Object(b.e)(t))throw new u.a('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));e=""+e,t=t||{};var n=this._nodes.get(e);return n?(t&&Object(b.a)(n.attributes,t),e):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e)},i.dropNode=function(e){if(e=""+e,!this.hasNode(e))throw new u.b('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));for(var t=this.edges(e),n=0,r=t.length;n<r;n++)this.dropEdge(t[n]);var i=this._nodes.get(e);this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:i.attributes})},i.dropEdge=function(e){var t;if(arguments.length>1){var n=""+arguments[0],r=""+arguments[1];if(!(t=Object(b.b)(this,n,r,this.type)))throw new u.b('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(e=""+e,!(t=this._edges.get(e)))throw new u.b('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));this._edges.delete(t.key);var i=t,o=i.source,a=i.target,c=i.attributes,d=t instanceof p;return o===a?o.selfLoops--:d?(o.undirectedDegree--,a.undirectedDegree--):(o.outDegree--,a.inDegree--),l(this,d,t),d?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:e,attributes:c,source:o.key,target:a.key,undirected:d}),this},i.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},i.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},i.getAttribute=function(e){return this._attributes[e]},i.getAttributes=function(){return this._attributes},i.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},i.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",meta:{name:e,value:t}}),this},i.updateAttribute=function(e,t){if("function"!=typeof t)throw new u.a("Graph.updateAttribute: updater should be a function.");return this._attributes[e]=t(this._attributes[e]),this.emit("attributesUpdated",{type:"set",meta:{name:e,value:this._attributes[e]}}),this},i.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",meta:{name:e}}),this},i.replaceAttributes=function(e){if(!Object(b.e)(e))throw new u.a("Graph.replaceAttributes: provided attributes are not a plain object.");var t=this._attributes;return this._attributes=e,this.emit("attributesUpdated",{type:"replace",meta:{before:t,after:e}}),this},i.mergeAttributes=function(e){if(!Object(b.e)(e))throw new u.a("Graph.mergeAttributes: provided attributes are not a plain object.");return this._attributes=Object(b.a)(this._attributes,e),this.emit("attributesUpdated",{type:"merge",meta:{data:this._attributes}}),this},i.getNodeAttribute=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.getNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes[t]},i.getNodeAttributes=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new u.b('Graph.getNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));return t.attributes},i.hasNodeAttribute=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes.hasOwnProperty(t)},i.setNodeAttribute=function(e,t,n){e=""+e;var r=this._nodes.get(e);if(!r)throw new u.b('Graph.setNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new u.a("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return r.attributes[t]=n,this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:n}}),this},i.updateNodeAttribute=function(e,t,n){e=""+e;var r=this._nodes.get(e);if(!r)throw new u.b('Graph.updateNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new u.a("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new u.a("Graph.updateAttribute: updater should be a function.");var i=r.attributes;return i[t]=n(i[t]),this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:i[t]}}),this},i.removeNodeAttribute=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return delete n.attributes[t],this.emit("nodeAttributesUpdated",{key:e,type:"remove",meta:{name:t}}),this},i.replaceNodeAttributes=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.replaceNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!Object(b.e)(t))throw new u.a("Graph.replaceNodeAttributes: provided attributes are not a plain object.");var r=n.attributes;return n.attributes=t,this.emit("nodeAttributesUpdated",{key:e,type:"replace",meta:{before:r,after:t}}),this},i.mergeNodeAttributes=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.mergeNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!Object(b.e)(t))throw new u.a("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return Object(b.a)(n.attributes,t),this.emit("nodeAttributesUpdated",{key:e,type:"merge",meta:{data:t}}),this},i.forEach=function(e){if("function"!=typeof e)throw new u.a("Graph.forEach: expecting a callback.");this._edges.forEach((function(t,n){var r=t.source,i=t.target;e(r.key,i.key,r.attributes,i.attributes,n,t.attributes)}))},i.adjacency=function(){var e=this._edges.values();return new o.a((function(){var t=e.next();if(t.done)return t;var n=t.value,r=n.source,i=n.target;return{done:!1,value:[r.key,i.key,r.attributes,i.attributes,n.key,n.attributes]}}))},i.nodes=function(){return c()(this._nodes.keys(),this._nodes.size)},i.forEachNode=function(e){if("function"!=typeof e)throw new u.a("Graph.forEachNode: expecting a callback.");this._nodes.forEach((function(t,n){e(n,t.attributes)}))},i.nodeEntries=function(){var e=this._nodes.values();return new o.a((function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:[n.key,n.attributes],done:!1}}))},i.exportNode=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new u.b('Graph.exportNode: could not find the "'.concat(e,'" node in the graph.'));return q(e,t)},i.exportEdge=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.exportEdge: could not find the "'.concat(e,'" edge in the graph.'));return B(e,t)},i.export=function(){var e=new Array(this._nodes.size),t=0;this._nodes.forEach((function(n,r){e[t++]=q(r,n)}));var n=new Array(this._edges.size);return t=0,this._edges.forEach((function(e,r){n[t++]=B(r,e)})),{attributes:this.getAttributes(),nodes:e,edges:n}},i.importNode=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=H(e);if(n){if("not-object"===n)throw new u.a('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new u.a("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new u.a("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var r=e.key,i=e.attributes,o=void 0===i?{}:i;return t?this.mergeNode(r,o):this.addNode(r,o),this},i.importEdge=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Q(e);if(n){if("not-object"===n)throw new u.a('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new u.a("Graph.importEdge: missing souce.");if("no-target"===n)throw new u.a("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new u.a("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new u.a("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var r=e.source,i=e.target,o=e.attributes,a=void 0===o?{}:o,c=e.undirected,d=void 0!==c&&c;return"key"in e?(t?d?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:d?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,e.key,r,i,a):(t?d?this.mergeUndirectedEdge:this.mergeDirectedEdge:d?this.addUndirectedEdge:this.addDirectedEdge).call(this,r,i,a),this},i.import=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Object(b.d)(e))return this.import(e.export(),n),this;if(!Object(b.e)(e))throw new u.a("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!Object(b.e)(e.attributes))throw new u.a("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}return e.nodes&&e.nodes.forEach((function(e){return t.importNode(e,n)})),e.edges&&e.edges.forEach((function(e){return t.importEdge(e,n)})),this},i.emptyCopy=function(e){return new r(Object(b.a)({},this._options,e))},i.copy=function(){var e=new r(this._options);return e.import(this),e},i.upgradeToMixed=function(){return"mixed"===this.type?this:(this._nodes.forEach((function(e){return e.upgradeToMixed()})),this._options.type="mixed",Object(b.h)(this,"type",this._options.type),Object(b.g)(this,"NodeDataClass",d),this)},i.upgradeToMulti=function(){return this.multi?this:(this._options.multi=!0,Object(b.h)(this,"multi",!0),(e=this)._nodes.forEach((function(t,n){if(t.out)for(var r in t.out){var i=new Set;i.add(t.out[r]),t.out[r]=i,e._nodes.get(r).in[n]=i}if(t.undirected)for(var o in t.undirected)if(!(o>n)){var a=new Set;a.add(t.undirected[o]),t.undirected[o]=a,e._nodes.get(o).undirected[n]=a}})),this);var e},i.clearIndex=function(){return this._nodes.forEach((function(e){void 0!==e.in&&(e.in={},e.out={}),void 0!==e.undirected&&(e.undirected={})})),this},i.toJSON=function(){return this.export()},i.toString=function(){var e=this.order>1||0===this.order,t=this.size>1||0===this.size;return"Graph<".concat(Object(b.f)(this.order)," node").concat(e?"s":"",", ").concat(Object(b.f)(this.size)," edge").concat(t?"s":"",">")},i.inspect=function(){var e=this,t={};this._nodes.forEach((function(e,n){t[n]=e.attributes}));var n={},r={};this._edges.forEach((function(t,i){var o=t instanceof p?"--":"->",a="",c="(".concat(t.source.key,")").concat(o,"(").concat(t.target.key,")");t.generatedKey?e.multi&&(void 0===r[c]?r[c]=0:r[c]++,a+="".concat(r[c],". ")):a+="[".concat(i,"]: "),n[a+=c]=t.attributes}));var i={};for(var o in this)this.hasOwnProperty(o)&&!Z.has(o)&&"function"!=typeof this[o]&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,Object(b.g)(i,"constructor",this.constructor),i},r}(r.EventEmitter);"undefined"!=typeof Symbol&&(re.prototype[Symbol.for("nodejs.util.inspect.custom")]=re.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach((function(e){["add","merge"].forEach((function(t){var n=e.name(t),r="add"===t?ee:te;e.generateKey?re.prototype[n]=function(t,i,o){return r(this,n,!0,"undirected"===(e.type||this.type),null,t,i,o)}:re.prototype[n]=function(t,i,o,a){return r(this,n,!1,"undirected"===(e.type||this.type),t,i,o,a)}}))})),"undefined"!=typeof Symbol&&(re.prototype[Symbol.iterator]=re.prototype.adjacency),ne=re,y.forEach((function(e){var t=e.name,n=e.attacher;n(ne,t("Edge"),"mixed",f),n(ne,t("DirectedEdge"),"directed",f),n(ne,t("UndirectedEdge"),"undirected",p)})),function(e){m.forEach((function(t){!function(e,t){var n=t.name,r=t.type,i=t.direction;e.prototype[n]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return O(this,r);if(1===arguments.length){e=""+e;var o=this._nodes.get(e);if(void 0===o)throw new u.b("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return N("mixed"===r?this.type:r,i,o)}if(2===arguments.length){e=""+e,t=""+t;var a=this._nodes.get(e);if(!a)throw new u.b("Graph.".concat(n,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b("Graph.".concat(n,': could not find the "').concat(t,'" target node in the graph.'));return U(r,i,a,t)}throw new u.a("Graph.".concat(n,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return S(this,r,n=e);if(2===arguments.length){e=""+e,n=t;var a=this._nodes.get(e);if(void 0===a)throw new u.b("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return L("mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){e=""+e,t=""+t;var c=this._nodes.get(e);if(!c)throw new u.b("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return z(r,i,c,t,n)}throw new u.a("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,a=n.slice(0,-1)+"Entries";e.prototype[a]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return o.a.empty();if(!arguments.length)return A(this,r);if(1===arguments.length){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));return D(r,i,n)}if(2===arguments.length){e=""+e,t=""+t;var c=this._nodes.get(e);if(!c)throw new u.b("Graph.".concat(a,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b("Graph.".concat(a,': could not find the "').concat(t,'" target node in the graph.'));return M(r,i,c,t)}throw new u.a("Graph.".concat(a,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)}))}(re),function(e){P.forEach((function(t){!function(e,t){var n=t.name,r=t.type,i=t.direction;e.prototype[n]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(2===arguments.length){var t=""+arguments[0],o=""+arguments[1];if(!this._nodes.has(t))throw new u.b("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));if(!this._nodes.has(o))throw new u.b("Graph.".concat(n,': could not find the "').concat(o,'" node in the graph.'));return I(this,r,i,t,o)}if(1===arguments.length){e=""+e;var a=this._nodes.get(e);if(void 0===a)throw new u.b("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));var c=C("mixed"===r?this.type:r,i,a);return c}throw new u.a("Graph.".concat(n,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),Y(e,t),J(e,t)}))}(re)},function(e,t,n){var r=n(2);e.exports=function(){var e,t=arguments,n=-1;return new r((function r(){if(!e){if(++n>=t.length)return{done:!0};e=t[n]}var i=e.next();return i.done?(e=null,r()):i}))}},function(e,t){e.exports=function(e,t){for(var n,r=arguments.length>1?t:1/0,i=r!==1/0?new Array(r):[],o=0;;){if(o===r)return i;if((n=e.next()).done)return o!==t?i.slice(0,o):i;i[o++]=n.value}}},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function c(){c.init.call(this)}e.exports=c,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var u=10;function d(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?c.defaultMaxListeners:e._maxListeners}function h(e,t,n,r){var i,o,a,c;if(d(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=s(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,c=u,console&&console.warn&&console.warn(c)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function g(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):b(i,i.length)}function l(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function b(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),c.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},c.prototype.getMaxListeners=function(){return s(this)},c.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var d=u.length,s=b(u,d);for(n=0;n<d;++n)o(s[n],this,t)}return!0},c.prototype.addListener=function(e,t){return h(this,e,t,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(e,t){return h(this,e,t,!0)},c.prototype.once=function(e,t){return d(t),this.on(e,p(this,e,t)),this},c.prototype.prependOnceListener=function(e,t){return d(t),this.prependListener(e,p(this,e,t)),this},c.prototype.removeListener=function(e,t){var n,r,i,o,a;if(d(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},c.prototype.listeners=function(e){return g(this,e,!0)},c.prototype.rawListeners=function(e){return g(this,e,!1)},c.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):l.call(e,t)},c.prototype.listenerCount=l,c.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";n.r(t),function(e){var t=n(1),r=n(3),i=n(0);function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var a=function(e){function n(n){return e.call(this,Object(t.a)({type:"directed"},n))||this}return o(n,e),n}(r.a),c=function(e){function n(n){return e.call(this,Object(t.a)({type:"undirected"},n))||this}return o(n,e),n}(r.a),u=function(e){function n(n){return e.call(this,Object(t.a)({multi:!0,type:"directed"},n))||this}return o(n,e),n}(r.a),d=function(e){function n(n){return e.call(this,Object(t.a)({multi:!0,type:"undirected"},n))||this}return o(n,e),n}(r.a);function s(e){e.from=function(t,n){var r=new e(n);return r.import(t),r}}s(r.a),s(a),s(c),s(u),s(d),r.a.Graph=r.a,r.a.DirectedGraph=a,r.a.UndirectedGraph=c,r.a.MultiDirectedGraph=u,r.a.MultiUndirectedGraph=d,r.a.InvalidArgumentsGraphError=i.a,r.a.NotFoundGraphError=i.b,r.a.UsageGraphError=i.c,e.exports=r.a}.call(this,n(8)(e))},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.graphology=t():e.graphology=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function o(e){var t="function"==typeof Map?new Map:void 0;return(o=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return c(e,arguments,d(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,e)})(e)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function c(e,t,n){return(c=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&u(i,n.prototype),i}).apply(null,arguments)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return p}));var s=function(e){function t(t,n){var r;return(r=e.call(this)||this).name="GraphError",r.message=t||"",r.data=n||{},r}return i(t,e),t}(o(Error)),h=function(e){function t(n,i){var o;return(o=e.call(this,n,i)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r(o),t.prototype.constructor),o}return i(t,e),t}(s),f=function(e){function t(n,i){var o;return(o=e.call(this,n,i)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r(o),t.prototype.constructor),o}return i(t,e),t}(s),p=function(e){function t(n,i){var o;return(o=e.call(this,n,i)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r(o),t.prototype.constructor),o}return i(t,e),t}(s)},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){for(var e=arguments[0]||{},t=1,n=arguments.length;t<n;t++)if(arguments[t])for(var r in arguments[t])e[r]=arguments[t][r];return e}function o(e,t,n,r){var i=e._nodes.get(t),o=null;return i?o="mixed"===r?i.out&&i.out[n]||i.undirected&&i.undirected[n]:"directed"===r?i.out&&i.out[n]:i.undirected&&i.undirected[n]:o}function a(e){return null!==e&&"object"===r(e)&&"function"==typeof e.addUndirectedEdgeWithKey&&"function"==typeof e.dropNode}function c(e){return"object"===r(e)&&null!==e&&e.constructor===Object}function u(e){for(var t=""+e,n="",r=0,i=t.length;r<i;r++){n=t[i-r-1]+n,(r-2)%3||r===i-1||(n=","+n)}return n}function d(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function s(e,t,n){var r={enumerable:!0,configurable:!0};"function"==typeof n?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function h(){var e=0;return function(){return"_geid".concat(e++,"_")}}n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return c})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"h",(function(){return s})),n.d(t,"c",(function(){return h}))},function(e,t){function n(e){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:e}),this.done=!1}n.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var e=arguments,t=e.length,r=0;return new n((function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}}))},n.empty=function(){var e=new n(null);return e.done=!0,e},n.is=function(e){return e instanceof n||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=n},function(e,t,n){"use strict";var r=n(6),i=n(2),o=n.n(i),a=n(5),c=n.n(a),u=n(0);function d(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function s(e,t){this.key=e,this.attributes=t||{},this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function h(e,t){this.key=e,this.attributes=t||{},this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function f(e,t,n,r,i){this.key=e,this.attributes=i,this.source=n,this.target=r,this.generatedKey=t}function p(e,t,n,r,i){this.key=e,this.attributes=i,this.source=n,this.target=r,this.generatedKey=t}function g(e,t,n,r,i,o,a){var c=e.multi,u=t?"undirected":"out",d=t?"undirected":"in",s=o[u][i];void 0===s&&(s=c?new Set:n,o[u][i]=s),c&&s.add(n),r!==i&&void 0===a[d][r]&&(a[d][r]=s)}function l(e,t,n){var r=e.multi,i=n.source,o=n.target,a=i.key,c=o.key,u=i[t?"undirected":"out"],d=t?"undirected":"in";if(c in u)if(r){var s=u[c];1===s.size?(delete u[c],delete o[d][a]):s.delete(n)}else delete u[c];r||delete o[d][a]}s.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},h.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var b=n(1);var y=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes[i]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+arguments[1];if(!(i=Object(b.b)(this,o,a,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(e=""+e,!(i=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(i instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes.hasOwnProperty(i)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i,o){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var c=""+e,d=""+i;if(i=arguments[2],o=arguments[3],!(a=Object(b.b)(this,c,d,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(c,'" - "').concat(d,'").'))}else if(e=""+e,!(a=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(a instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[i]=o,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",meta:{name:i,value:o}}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i,o){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var c=""+e,d=""+i;if(i=arguments[2],o=arguments[3],!(a=Object(b.b)(this,c,d,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(c,'" - "').concat(d,'").'))}else if(e=""+e,!(a=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("function"!=typeof o)throw new u.a("Graph.".concat(t,": updater should be a function."));if("mixed"!==n&&!(a instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[i]=o(a.attributes[i]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",meta:{name:i,value:a.attributes[i]}}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return delete o.attributes[i],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",meta:{name:i}}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!Object(b.e)(i))throw new u.a("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));var d=o.attributes;return o.attributes=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",meta:{before:d,after:i}}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!Object(b.e)(i))throw new u.a("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return Object(b.a)(o.attributes,i),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",meta:{data:i}}),this}}}];var v=n(4),w=n.n(v),m=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function _(e,t){for(var n in t)t[n]instanceof Set?t[n].forEach((function(t){return e.push(t.key)})):e.push(t[n].key)}function G(e,t){for(var n in e)if(e[n]instanceof Set)e[n].forEach((function(e){return t(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)}));else{var r=e[n];t(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes)}}function x(e){var t=Object.keys(e),n=t.length,r=null,i=0;return new o.a((function o(){var a;if(r){var c=r.next();if(c.done)return r=null,i++,o();a=c.value}else{if(i>=n)return{done:!0};var u=t[i];if((a=e[u])instanceof Set)return r=a.values(),o();i++}return{done:!1,value:[a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes]}}))}function E(e,t,n){n in t&&(t[n]instanceof Set?t[n].forEach((function(t){return e.push(t.key)})):e.push(t[n].key))}function k(e,t,n){if(t in e)if(e[t]instanceof Set)e[t].forEach((function(e){return n(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)}));else{var r=e[t];n(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes)}}function j(e,t){var n=e[t];if(n instanceof Set){var r=n.values();return new o.a((function(){var e=r.next();if(e.done)return e;var t=e.value;return{done:!1,value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes]}}))}return o.a.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function O(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return c()(e._edges.keys(),e._edges.size);var n="undirected"===t?e.undirectedSize:e.directedSize,r=new Array(n),i="undirected"===t,o=0;return e._edges.forEach((function(e,t){e instanceof p===i&&(r[o++]=t)})),r}function S(e,t,n){if(0!==e.size)if("mixed"===t||t===e.type)e._edges.forEach((function(e,t){var r=e.attributes,i=e.source,o=e.target;n(t,r,i.key,o.key,i.attributes,o.attributes)}));else{var r="undirected"===t;e._edges.forEach((function(e,t){if(e instanceof p===r){var i=e.attributes,o=e.source,a=e.target;n(t,i,o.key,a.key,o.attributes,a.attributes)}}))}}function A(e,t){return 0===e.size?o.a.empty():"mixed"===t?(n=e._edges.values(),new o.a((function(){var e=n.next();if(e.done)return e;var t=e.value;return{value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes],done:!1}}))):(n=e._edges.values(),new o.a((function e(){var r=n.next();if(r.done)return r;var i=r.value;return i instanceof p==("undirected"===t)?{value:[i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes],done:!1}:e()})));var n}function N(e,t,n){var r=[];return"undirected"!==e&&("out"!==t&&_(r,n.in),"in"!==t&&_(r,n.out)),"directed"!==e&&_(r,n.undirected),r}function L(e,t,n,r){"undirected"!==e&&("out"!==t&&G(n.in,r),"in"!==t&&G(n.out,r)),"directed"!==e&&G(n.undirected,r)}function D(e,t,n){var r=o.a.empty();return"undirected"!==e&&("out"!==t&&void 0!==n.in&&(r=w()(r,x(n.in))),"in"!==t&&void 0!==n.out&&(r=w()(r,x(n.out)))),"directed"!==e&&void 0!==n.undirected&&(r=w()(r,x(n.undirected))),r}function U(e,t,n,r){var i=[];return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&E(i,n.in,r),void 0!==n.out&&"in"!==t&&E(i,n.out,r)),"directed"!==e&&void 0!==n.undirected&&E(i,n.undirected,r),i}function z(e,t,n,r,i){"undirected"!==e&&(void 0!==n.in&&"out"!==t&&k(n.in,r,i),void 0!==n.out&&"in"!==t&&k(n.out,r,i)),"directed"!==e&&void 0!==n.undirected&&k(n.undirected,r,i)}function M(e,t,n,r){var i=o.a.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&r in n.in&&(i=w()(i,j(n.in,r))),void 0!==n.out&&"in"!==t&&r in n.out&&(i=w()(i,j(n.out,r)))),"directed"!==e&&void 0!==n.undirected&&r in n.undirected&&(i=w()(i,j(n.undirected,r))),i}var P=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function K(e,t){if(void 0!==t)for(var n in t)e.add(n)}function C(e,t,n){if("mixed"!==e){if("undirected"===e)return Object.keys(n.undirected);if("string"==typeof t)return Object.keys(n[t])}var r=new Set;return"undirected"!==e&&("out"!==t&&K(r,n.in),"in"!==t&&K(r,n.out)),"directed"!==e&&K(r,n.undirected),c()(r.values(),r.size)}function T(e,t,n){for(var r in t){var i=t[r];i instanceof Set&&(i=i.values().next().value);var o=i.source,a=i.target,c=o===e?a:o;n(c.key,c.attributes)}}function R(e,t,n,r){for(var i in n){var o=n[i];o instanceof Set&&(o=o.values().next().value);var a=o.source,c=o.target,u=a===t?c:a;e.has(u.key)||(e.add(u.key),r(u.key,u.attributes))}}function F(e,t){var n=Object.keys(t),r=n.length,i=0;return new o.a((function(){if(i>=r)return{done:!0};var o=t[n[i++]];o instanceof Set&&(o=o.values().next().value);var a=o.source,c=o.target,u=a===e?c:a;return{done:!1,value:[u.key,u.attributes]}}))}function W(e,t,n){var r=Object.keys(n),i=r.length,a=0;return new o.a((function o(){if(a>=i)return{done:!0};var c=n[r[a++]];c instanceof Set&&(c=c.values().next().value);var u=c.source,d=c.target,s=u===t?d:u;return e.has(s.key)?o():(e.add(s.key),{done:!1,value:[s.key,s.attributes]})}))}function I(e,t,n,r,i){var o=e._nodes.get(r);if("undirected"!==t){if("out"!==n&&void 0!==o.in)for(var a in o.in)if(a===i)return!0;if("in"!==n&&void 0!==o.out)for(var c in o.out)if(c===i)return!0}if("directed"!==t&&void 0!==o.undirected)for(var u in o.undirected)if(u===i)return!0;return!1}function Y(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){e=""+e;var n=this._nodes.get(e);if(void 0===n)throw new u.b("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,r){if("mixed"!==e){if("undirected"===e)return T(n,n.undirected,r);if("string"==typeof t)return T(n,n[t],r)}var i=new Set;"undirected"!==e&&("out"!==t&&R(i,n,n.in,r),"in"!==t&&R(i,n,n.out,r)),"directed"!==e&&R(i,n,n.undirected,r)}("mixed"===r?this.type:r,i,n,t)}}}function J(e,t){var n=t.name,r=t.type,i=t.direction,a=n.slice(0,-1)+"Entries";e.prototype[a]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return o.a.empty();e=""+e;var t=this._nodes.get(e);if(void 0===t)throw new u.b("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return F(n,n.undirected);if("string"==typeof t)return F(n,n[t])}var r=o.a.empty(),i=new Set;return"undirected"!==e&&("out"!==t&&(r=w()(r,W(i,n,n.in))),"in"!==t&&(r=w()(r,W(i,n,n.out)))),"directed"!==e&&(r=w()(r,W(i,n,n.undirected))),r}("mixed"===r?this.type:r,i,t)}}function q(e,t){var n={key:e};return Object.keys(t.attributes).length&&(n.attributes=Object(b.a)({},t.attributes)),n}function B(e,t){var n={source:t.source.key,target:t.target.key};return t.generatedKey||(n.key=e),Object.keys(t.attributes).length&&(n.attributes=Object(b.a)({},t.attributes)),t instanceof p&&(n.undirected=!0),n}function H(e){return Object(b.e)(e)?"key"in e?"attributes"in e&&(!Object(b.e)(e.attributes)||null===e.attributes)?"invalid-attributes":null:"no-key":"not-object"}function Q(e){return Object(b.e)(e)?"source"in e?"target"in e?"attributes"in e&&(!Object(b.e)(e.attributes)||null===e.attributes)?"invalid-attributes":"undirected"in e&&"boolean"!=typeof e.undirected?"invalid-undirected":null:"no-target":"no-source":"not-object"}function V(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return re}));var X=new Set(["directed","undirected","mixed"]),Z=new Set(["domain","_events","_eventsCount","_maxListeners"]),$={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function ee(e,t,n,r,i,o,a,c){if(!r&&"undirected"===e.type)throw new u.c("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new u.c("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(c&&!Object(b.e)(c))throw new u.a("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(c,'"'));if(o=""+o,a=""+a,c=c||{},!e.allowSelfLoops&&o===a)throw new u.c("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var d=e._nodes.get(o),s=e._nodes.get(a);if(!d)throw new u.b("Graph.".concat(t,': source node "').concat(o,'" not found.'));if(!s)throw new u.b("Graph.".concat(t,': target node "').concat(a,'" not found.'));var h={key:null,undirected:r,source:o,target:a,attributes:c};if(n&&(i=e._edgeKeyGenerator(h)),i=""+i,e._edges.has(i))throw new u.c("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));if(!e.multi&&(r?void 0!==d.undirected[a]:void 0!==d.out[a]))throw new u.c("Graph.".concat(t,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var l=new(r?p:f)(i,n,d,s,c);return e._edges.set(i,l),o===a?r?d.undirectedSelfLoops++:d.directedSelfLoops++:r?(d.undirectedDegree++,s.undirectedDegree++):(d.outDegree++,s.inDegree++),g(e,r,l,o,a,d,s),r?e._undirectedSize++:e._directedSize++,h.key=i,e.emit("edgeAdded",h),i}function te(e,t,n,r,i,o,a,c){if(!r&&"undirected"===e.type)throw new u.c("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new u.c("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(c&&!Object(b.e)(c))throw new u.a("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(c,'"'));if(o=""+o,a=""+a,c=c||{},!e.allowSelfLoops&&o===a)throw new u.c("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var d,s,h=e._nodes.get(o),l=e._nodes.get(a),y=null;if(!n&&(d=e._edges.get(i))){if(d.source!==o||d.target!==a||r&&(d.source!==a||d.target!==o))throw new u.c("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. (').concat(d.source,", ").concat(d.target,")."));y=i}if(y||e.multi||!h||(r?void 0===h.undirected[a]:void 0===h.out[a])||(s=Object(b.b)(e,o,a,r?"undirected":"directed")),s)return c?(Object(b.a)(s.attributes,c),y):y;var v={key:null,undirected:r,source:o,target:a,attributes:c};if(n&&(i=e._edgeKeyGenerator(v)),i=""+i,e._edges.has(i))throw new u.c("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));return h||(e.addNode(o),h=e._nodes.get(o),o===a&&(l=h)),l||(e.addNode(a),l=e._nodes.get(a)),d=new(r?p:f)(i,n,h,l,c),e._edges.set(i,d),o===a?r?h.undirectedSelfLoops++:h.directedSelfLoops++:r?(h.undirectedDegree++,l.undirectedDegree++):(h.outDegree++,l.inDegree++),g(e,r,d,o,a,h,l),r?e._undirectedSize++:e._directedSize++,v.key=i,e.emit("edgeAdded",v),i}var ne,re=function(e){var t,n;function r(t){var n;if(n=e.call(this)||this,(t=Object(b.a)({},$,t)).edgeKeyGenerator&&"function"!=typeof t.edgeKeyGenerator)throw new u.a("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(t.edgeKeyGenerator,'".'));if("boolean"!=typeof t.multi)throw new u.a("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!X.has(t.type))throw new u.a('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new u.a("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var r="mixed"===t.type?d:"directed"===t.type?s:h;return Object(b.g)(V(n),"NodeDataClass",r),Object(b.g)(V(n),"_attributes",{}),Object(b.g)(V(n),"_nodes",new Map),Object(b.g)(V(n),"_edges",new Map),Object(b.g)(V(n),"_directedSize",0),Object(b.g)(V(n),"_undirectedSize",0),Object(b.g)(V(n),"_edgeKeyGenerator",t.edgeKeyGenerator||Object(b.c)()),Object(b.g)(V(n),"_options",t),Z.forEach((function(e){return Object(b.g)(V(n),e,n[e])})),Object(b.h)(V(n),"order",(function(){return n._nodes.size})),Object(b.h)(V(n),"size",(function(){return n._edges.size})),Object(b.h)(V(n),"directedSize",(function(){return n._directedSize})),Object(b.h)(V(n),"undirectedSize",(function(){return n._undirectedSize})),Object(b.h)(V(n),"multi",n._options.multi),Object(b.h)(V(n),"type",n._options.type),Object(b.h)(V(n),"allowSelfLoops",n._options.allowSelfLoops),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.hasNode=function(e){return this._nodes.has(""+e)},i.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var n=""+e,r=this._edges.get(n);return!!r&&r instanceof f}if(2===arguments.length){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)return!1;var o=i.out[t];return!!o&&(!this.multi||!!o.size)}throw new u.a("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var n=""+e,r=this._edges.get(n);return!!r&&r instanceof p}if(2===arguments.length){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)return!1;var o=i.undirected[t];return!!o&&(!this.multi||!!o.size)}throw new u.a("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasEdge=function(e,t){if(1===arguments.length){var n=""+e;return this._edges.has(n)}if(2===arguments.length){e=""+e,t=""+t;var r=this._nodes.get(e);if(!r)return!1;var i=void 0!==r.out&&r.out[t];return i||(i=void 0!==r.undirected&&r.undirected[t]),!!i&&(!this.multi||!!i.size)}throw new u.a("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new u.c("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(e);if(!n)throw new u.b('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||void 0;return r?r.key:void 0}},i.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new u.c("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(e);if(!n)throw new u.b('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.undirected&&n.undirected[t]||void 0;return r?r.key:void 0}},i.edge=function(e,t){if(this.multi)throw new u.c("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key},i.inDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.inDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));if("undirected"===this.type)return 0;var r=t?n.directedSelfLoops:0;return n.inDegree+r},i.outDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.outDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));if("undirected"===this.type)return 0;var r=t?n.directedSelfLoops:0;return n.outDegree+r},i.directedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.directedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(e=""+e,!this.hasNode(e))throw new u.b('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:this.inDegree(e,t)+this.outDegree(e,t)},i.undirectedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.undirectedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(e=""+e,!this.hasNode(e))throw new u.b('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));if("directed"===this.type)return 0;var n=this._nodes.get(e),r=t?2*n.undirectedSelfLoops:0;return n.undirectedDegree+r},i.degree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.degree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(e=""+e,!this.hasNode(e))throw new u.b('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var n=0;return"undirected"!==this.type&&(n+=this.directedDegree(e,t)),"directed"!==this.type&&(n+=this.undirectedDegree(e,t)),n},i.source=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},i.target=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},i.extremities=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},i.opposite=function(e,t){if(e=""+e,t=""+t,!this._nodes.has(e))throw new u.b('Graph.opposite: could not find the "'.concat(e,'" node in the graph.'));var n=this._edges.get(t);if(!n)throw new u.b('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var r=n.source,i=n.target,o=r.key,a=i.key;if(e!==o&&e!==a)throw new u.b('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(o,", ").concat(a,")."));return e===o?a:o},i.undirected=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.undirected: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof p},i.directed=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.directed: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof f},i.selfLoop=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.selfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},i.addNode=function(e,t){if(t&&!Object(b.e)(t))throw new u.a('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));if(e=""+e,t=t||{},this._nodes.has(e))throw new u.c('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var n=new this.NodeDataClass(e,t);return this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e},i.mergeNode=function(e,t){if(t&&!Object(b.e)(t))throw new u.a('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));e=""+e,t=t||{};var n=this._nodes.get(e);return n?(t&&Object(b.a)(n.attributes,t),e):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e)},i.dropNode=function(e){if(e=""+e,!this.hasNode(e))throw new u.b('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));for(var t=this.edges(e),n=0,r=t.length;n<r;n++)this.dropEdge(t[n]);var i=this._nodes.get(e);this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:i.attributes})},i.dropEdge=function(e){var t;if(arguments.length>1){var n=""+arguments[0],r=""+arguments[1];if(!(t=Object(b.b)(this,n,r,this.type)))throw new u.b('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(e=""+e,!(t=this._edges.get(e)))throw new u.b('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));this._edges.delete(t.key);var i=t,o=i.source,a=i.target,c=i.attributes,d=t instanceof p;return o===a?o.selfLoops--:d?(o.undirectedDegree--,a.undirectedDegree--):(o.outDegree--,a.inDegree--),l(this,d,t),d?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:e,attributes:c,source:o.key,target:a.key,undirected:d}),this},i.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},i.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},i.getAttribute=function(e){return this._attributes[e]},i.getAttributes=function(){return this._attributes},i.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},i.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",meta:{name:e,value:t}}),this},i.updateAttribute=function(e,t){if("function"!=typeof t)throw new u.a("Graph.updateAttribute: updater should be a function.");return this._attributes[e]=t(this._attributes[e]),this.emit("attributesUpdated",{type:"set",meta:{name:e,value:this._attributes[e]}}),this},i.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",meta:{name:e}}),this},i.replaceAttributes=function(e){if(!Object(b.e)(e))throw new u.a("Graph.replaceAttributes: provided attributes are not a plain object.");var t=this._attributes;return this._attributes=e,this.emit("attributesUpdated",{type:"replace",meta:{before:t,after:e}}),this},i.mergeAttributes=function(e){if(!Object(b.e)(e))throw new u.a("Graph.mergeAttributes: provided attributes are not a plain object.");return this._attributes=Object(b.a)(this._attributes,e),this.emit("attributesUpdated",{type:"merge",meta:{data:this._attributes}}),this},i.getNodeAttribute=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.getNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes[t]},i.getNodeAttributes=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new u.b('Graph.getNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));return t.attributes},i.hasNodeAttribute=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes.hasOwnProperty(t)},i.setNodeAttribute=function(e,t,n){e=""+e;var r=this._nodes.get(e);if(!r)throw new u.b('Graph.setNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new u.a("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return r.attributes[t]=n,this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:n}}),this},i.updateNodeAttribute=function(e,t,n){e=""+e;var r=this._nodes.get(e);if(!r)throw new u.b('Graph.updateNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new u.a("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new u.a("Graph.updateAttribute: updater should be a function.");var i=r.attributes;return i[t]=n(i[t]),this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:i[t]}}),this},i.removeNodeAttribute=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return delete n.attributes[t],this.emit("nodeAttributesUpdated",{key:e,type:"remove",meta:{name:t}}),this},i.replaceNodeAttributes=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.replaceNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!Object(b.e)(t))throw new u.a("Graph.replaceNodeAttributes: provided attributes are not a plain object.");var r=n.attributes;return n.attributes=t,this.emit("nodeAttributesUpdated",{key:e,type:"replace",meta:{before:r,after:t}}),this},i.mergeNodeAttributes=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.mergeNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!Object(b.e)(t))throw new u.a("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return Object(b.a)(n.attributes,t),this.emit("nodeAttributesUpdated",{key:e,type:"merge",meta:{data:t}}),this},i.forEach=function(e){if("function"!=typeof e)throw new u.a("Graph.forEach: expecting a callback.");this._edges.forEach((function(t,n){var r=t.source,i=t.target;e(r.key,i.key,r.attributes,i.attributes,n,t.attributes)}))},i.adjacency=function(){var e=this._edges.values();return new o.a((function(){var t=e.next();if(t.done)return t;var n=t.value,r=n.source,i=n.target;return{done:!1,value:[r.key,i.key,r.attributes,i.attributes,n.key,n.attributes]}}))},i.nodes=function(){return c()(this._nodes.keys(),this._nodes.size)},i.forEachNode=function(e){if("function"!=typeof e)throw new u.a("Graph.forEachNode: expecting a callback.");this._nodes.forEach((function(t,n){e(n,t.attributes)}))},i.nodeEntries=function(){var e=this._nodes.values();return new o.a((function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:[n.key,n.attributes],done:!1}}))},i.exportNode=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new u.b('Graph.exportNode: could not find the "'.concat(e,'" node in the graph.'));return q(e,t)},i.exportEdge=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.exportEdge: could not find the "'.concat(e,'" edge in the graph.'));return B(e,t)},i.export=function(){var e=new Array(this._nodes.size),t=0;this._nodes.forEach((function(n,r){e[t++]=q(r,n)}));var n=new Array(this._edges.size);return t=0,this._edges.forEach((function(e,r){n[t++]=B(r,e)})),{attributes:this.getAttributes(),nodes:e,edges:n}},i.importNode=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=H(e);if(n){if("not-object"===n)throw new u.a('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new u.a("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new u.a("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var r=e.key,i=e.attributes,o=void 0===i?{}:i;return t?this.mergeNode(r,o):this.addNode(r,o),this},i.importEdge=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Q(e);if(n){if("not-object"===n)throw new u.a('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new u.a("Graph.importEdge: missing souce.");if("no-target"===n)throw new u.a("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new u.a("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new u.a("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var r=e.source,i=e.target,o=e.attributes,a=void 0===o?{}:o,c=e.undirected,d=void 0!==c&&c;return"key"in e?(t?d?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:d?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,e.key,r,i,a):(t?d?this.mergeUndirectedEdge:this.mergeDirectedEdge:d?this.addUndirectedEdge:this.addDirectedEdge).call(this,r,i,a),this},i.import=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Object(b.d)(e))return this.import(e.export(),n),this;if(!Object(b.e)(e))throw new u.a("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!Object(b.e)(e.attributes))throw new u.a("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}return e.nodes&&e.nodes.forEach((function(e){return t.importNode(e,n)})),e.edges&&e.edges.forEach((function(e){return t.importEdge(e,n)})),this},i.emptyCopy=function(e){return new r(Object(b.a)({},this._options,e))},i.copy=function(){var e=new r(this._options);return e.import(this),e},i.upgradeToMixed=function(){return"mixed"===this.type?this:(this._nodes.forEach((function(e){return e.upgradeToMixed()})),this._options.type="mixed",Object(b.h)(this,"type",this._options.type),Object(b.g)(this,"NodeDataClass",d),this)},i.upgradeToMulti=function(){return this.multi?this:(this._options.multi=!0,Object(b.h)(this,"multi",!0),(e=this)._nodes.forEach((function(t,n){if(t.out)for(var r in t.out){var i=new Set;i.add(t.out[r]),t.out[r]=i,e._nodes.get(r).in[n]=i}if(t.undirected)for(var o in t.undirected)if(!(o>n)){var a=new Set;a.add(t.undirected[o]),t.undirected[o]=a,e._nodes.get(o).undirected[n]=a}})),this);var e},i.clearIndex=function(){return this._nodes.forEach((function(e){void 0!==e.in&&(e.in={},e.out={}),void 0!==e.undirected&&(e.undirected={})})),this},i.toJSON=function(){return this.export()},i.toString=function(){var e=this.order>1||0===this.order,t=this.size>1||0===this.size;return"Graph<".concat(Object(b.f)(this.order)," node").concat(e?"s":"",", ").concat(Object(b.f)(this.size)," edge").concat(t?"s":"",">")},i.inspect=function(){var e=this,t={};this._nodes.forEach((function(e,n){t[n]=e.attributes}));var n={},r={};this._edges.forEach((function(t,i){var o=t instanceof p?"--":"->",a="",c="(".concat(t.source.key,")").concat(o,"(").concat(t.target.key,")");t.generatedKey?e.multi&&(void 0===r[c]?r[c]=0:r[c]++,a+="".concat(r[c],". ")):a+="[".concat(i,"]: "),n[a+=c]=t.attributes}));var i={};for(var o in this)this.hasOwnProperty(o)&&!Z.has(o)&&"function"!=typeof this[o]&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,Object(b.g)(i,"constructor",this.constructor),i},r}(r.EventEmitter);"undefined"!=typeof Symbol&&(re.prototype[Symbol.for("nodejs.util.inspect.custom")]=re.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach((function(e){["add","merge"].forEach((function(t){var n=e.name(t),r="add"===t?ee:te;e.generateKey?re.prototype[n]=function(t,i,o){return r(this,n,!0,"undirected"===(e.type||this.type),null,t,i,o)}:re.prototype[n]=function(t,i,o,a){return r(this,n,!1,"undirected"===(e.type||this.type),t,i,o,a)}}))})),"undefined"!=typeof Symbol&&(re.prototype[Symbol.iterator]=re.prototype.adjacency),ne=re,y.forEach((function(e){var t=e.name,n=e.attacher;n(ne,t("Edge"),"mixed",f),n(ne,t("DirectedEdge"),"directed",f),n(ne,t("UndirectedEdge"),"undirected",p)})),function(e){m.forEach((function(t){!function(e,t){var n=t.name,r=t.type,i=t.direction;e.prototype[n]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return O(this,r);if(1===arguments.length){e=""+e;var o=this._nodes.get(e);if(void 0===o)throw new u.b("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return N("mixed"===r?this.type:r,i,o)}if(2===arguments.length){e=""+e,t=""+t;var a=this._nodes.get(e);if(!a)throw new u.b("Graph.".concat(n,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b("Graph.".concat(n,': could not find the "').concat(t,'" target node in the graph.'));return U(r,i,a,t)}throw new u.a("Graph.".concat(n,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return S(this,r,n=e);if(2===arguments.length){e=""+e,n=t;var a=this._nodes.get(e);if(void 0===a)throw new u.b("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return L("mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){e=""+e,t=""+t;var c=this._nodes.get(e);if(!c)throw new u.b("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return z(r,i,c,t,n)}throw new u.a("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,a=n.slice(0,-1)+"Entries";e.prototype[a]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return o.a.empty();if(!arguments.length)return A(this,r);if(1===arguments.length){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));return D(r,i,n)}if(2===arguments.length){e=""+e,t=""+t;var c=this._nodes.get(e);if(!c)throw new u.b("Graph.".concat(a,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b("Graph.".concat(a,': could not find the "').concat(t,'" target node in the graph.'));return M(r,i,c,t)}throw new u.a("Graph.".concat(a,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)}))}(re),function(e){P.forEach((function(t){!function(e,t){var n=t.name,r=t.type,i=t.direction;e.prototype[n]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(2===arguments.length){var t=""+arguments[0],o=""+arguments[1];if(!this._nodes.has(t))throw new u.b("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));if(!this._nodes.has(o))throw new u.b("Graph.".concat(n,': could not find the "').concat(o,'" node in the graph.'));return I(this,r,i,t,o)}if(1===arguments.length){e=""+e;var a=this._nodes.get(e);if(void 0===a)throw new u.b("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));var c=C("mixed"===r?this.type:r,i,a);return c}throw new u.a("Graph.".concat(n,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),Y(e,t),J(e,t)}))}(re)},function(e,t,n){var r=n(2);e.exports=function(){var e,t=arguments,n=-1;return new r((function r(){if(!e){if(++n>=t.length)return{done:!0};e=t[n]}var i=e.next();return i.done?(e=null,r()):i}))}},function(e,t){e.exports=function(e,t){for(var n,r=arguments.length>1?t:1/0,i=r!==1/0?new Array(r):[],o=0;;){if(o===r)return i;if((n=e.next()).done)return o!==t?i.slice(0,o):i;i[o++]=n.value}}},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function c(){c.init.call(this)}e.exports=c,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var u=10;function d(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?c.defaultMaxListeners:e._maxListeners}function h(e,t,n,r){var i,o,a,c;if(d(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=s(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,c=u,console&&console.warn&&console.warn(c)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function g(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):b(i,i.length)}function l(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function b(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),c.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},c.prototype.getMaxListeners=function(){return s(this)},c.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var d=u.length,s=b(u,d);for(n=0;n<d;++n)o(s[n],this,t)}return!0},c.prototype.addListener=function(e,t){return h(this,e,t,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(e,t){return h(this,e,t,!0)},c.prototype.once=function(e,t){return d(t),this.on(e,p(this,e,t)),this},c.prototype.prependOnceListener=function(e,t){return d(t),this.prependListener(e,p(this,e,t)),this},c.prototype.removeListener=function(e,t){var n,r,i,o,a;if(d(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},c.prototype.listeners=function(e){return g(this,e,!0)},c.prototype.rawListeners=function(e){return g(this,e,!1)},c.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):l.call(e,t)},c.prototype.listenerCount=l,c.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";n.r(t),function(e){var t=n(1),r=n(3),i=n(0);function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var a=function(e){function n(n){return e.call(this,Object(t.a)({type:"directed"},n))||this}return o(n,e),n}(r.a),c=function(e){function n(n){return e.call(this,Object(t.a)({type:"undirected"},n))||this}return o(n,e),n}(r.a),u=function(e){function n(n){return e.call(this,Object(t.a)({multi:!0},n))||this}return o(n,e),n}(r.a),d=function(e){function n(n){return e.call(this,Object(t.a)({multi:!0,type:"directed"},n))||this}return o(n,e),n}(r.a),s=function(e){function n(n){return e.call(this,Object(t.a)({multi:!0,type:"undirected"},n))||this}return o(n,e),n}(r.a);function h(e){e.from=function(t,n){var r=new e(n);return r.import(t),r}}h(r.a),h(a),h(c),h(u),h(d),h(s),r.a.Graph=r.a,r.a.DirectedGraph=a,r.a.UndirectedGraph=c,r.a.MultiGraph=u,r.a.MultiDirectedGraph=d,r.a.MultiUndirectedGraph=s,r.a.InvalidArgumentsGraphError=i.a,r.a.NotFoundGraphError=i.b,r.a.UsageGraphError=i.c,e.exports=r.a}.call(this,n(8)(e))},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}}])})); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.graphology=t():e.graphology=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function o(e){var t="function"==typeof Map?new Map:void 0;return(o=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return c(e,arguments,d(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,e)})(e)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function c(e,t,n){return(c=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&u(i,n.prototype),i}).apply(null,arguments)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return p}));var s=function(e){function t(t,n){var r;return(r=e.call(this)||this).name="GraphError",r.message=t||"",r.data=n||{},r}return i(t,e),t}(o(Error)),h=function(e){function t(n,i){var o;return(o=e.call(this,n,i)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r(o),t.prototype.constructor),o}return i(t,e),t}(s),f=function(e){function t(n,i){var o;return(o=e.call(this,n,i)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r(o),t.prototype.constructor),o}return i(t,e),t}(s),p=function(e){function t(n,i){var o;return(o=e.call(this,n,i)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r(o),t.prototype.constructor),o}return i(t,e),t}(s)},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){for(var e=arguments[0]||{},t=1,n=arguments.length;t<n;t++)if(arguments[t])for(var r in arguments[t])e[r]=arguments[t][r];return e}function o(e,t,n,r){var i=e._nodes.get(t),o=null;return i?o="mixed"===r?i.out&&i.out[n]||i.undirected&&i.undirected[n]:"directed"===r?i.out&&i.out[n]:i.undirected&&i.undirected[n]:o}function a(e){return null!==e&&"object"===r(e)&&"function"==typeof e.addUndirectedEdgeWithKey&&"function"==typeof e.dropNode}function c(e){return"object"===r(e)&&null!==e&&e.constructor===Object}function u(e){for(var t=""+e,n="",r=0,i=t.length;r<i;r++){n=t[i-r-1]+n,(r-2)%3||r===i-1||(n=","+n)}return n}function d(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function s(e,t,n){var r={enumerable:!0,configurable:!0};"function"==typeof n?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function h(){var e=0;return function(){return"_geid".concat(e++,"_")}}n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return c})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"h",(function(){return s})),n.d(t,"c",(function(){return h}))},function(e,t){function n(e){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:e}),this.done=!1}n.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var e=arguments,t=e.length,r=0;return new n((function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}}))},n.empty=function(){var e=new n(null);return e.done=!0,e},n.is=function(e){return e instanceof n||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=n},function(e,t,n){"use strict";var r=n(6),i=n(2),o=n.n(i),a=n(5),c=n.n(a),u=n(0);function d(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function s(e,t){this.key=e,this.attributes=t||{},this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function h(e,t){this.key=e,this.attributes=t||{},this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function f(e,t,n,r,i){this.key=e,this.attributes=i,this.source=n,this.target=r,this.generatedKey=t}function p(e,t,n,r,i){this.key=e,this.attributes=i,this.source=n,this.target=r,this.generatedKey=t}function g(e,t,n,r,i,o,a){var c=e.multi,u=t?"undirected":"out",d=t?"undirected":"in",s=o[u][i];void 0===s&&(s=c?new Set:n,o[u][i]=s),c&&s.add(n),r!==i&&void 0===a[d][r]&&(a[d][r]=s)}function l(e,t,n){var r=e.multi,i=n.source,o=n.target,a=i.key,c=o.key,u=i[t?"undirected":"out"],d=t?"undirected":"in";if(c in u)if(r){var s=u[c];1===s.size?(delete u[c],delete o[d][a]):s.delete(n)}else delete u[c];r||delete o[d][a]}s.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},h.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var b=n(1);var y=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes[i]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+arguments[1];if(!(i=Object(b.b)(this,o,a,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(e=""+e,!(i=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(i instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes.hasOwnProperty(i)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i,o){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var c=""+e,d=""+i;if(i=arguments[2],o=arguments[3],!(a=Object(b.b)(this,c,d,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(c,'" - "').concat(d,'").'))}else if(e=""+e,!(a=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(a instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[i]=o,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",meta:{name:i,value:o}}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i,o){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var c=""+e,d=""+i;if(i=arguments[2],o=arguments[3],!(a=Object(b.b)(this,c,d,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(c,'" - "').concat(d,'").'))}else if(e=""+e,!(a=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("function"!=typeof o)throw new u.a("Graph.".concat(t,": updater should be a function."));if("mixed"!==n&&!(a instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[i]=o(a.attributes[i]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",meta:{name:i,value:a.attributes[i]}}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return delete o.attributes[i],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",meta:{name:i}}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!Object(b.e)(i))throw new u.a("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));var d=o.attributes;return o.attributes=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",meta:{before:d,after:i}}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!Object(b.e)(i))throw new u.a("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return Object(b.a)(o.attributes,i),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",meta:{data:i}}),this}}}];var v=n(4),w=n.n(v),m=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function _(e,t){for(var n in t)t[n]instanceof Set?t[n].forEach((function(t){return e.push(t.key)})):e.push(t[n].key)}function G(e,t){for(var n in e)if(e[n]instanceof Set)e[n].forEach((function(e){return t(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)}));else{var r=e[n];t(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes)}}function x(e){var t=Object.keys(e),n=t.length,r=null,i=0;return new o.a((function o(){var a;if(r){var c=r.next();if(c.done)return r=null,i++,o();a=c.value}else{if(i>=n)return{done:!0};var u=t[i];if((a=e[u])instanceof Set)return r=a.values(),o();i++}return{done:!1,value:[a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes]}}))}function E(e,t,n){n in t&&(t[n]instanceof Set?t[n].forEach((function(t){return e.push(t.key)})):e.push(t[n].key))}function k(e,t,n){if(t in e)if(e[t]instanceof Set)e[t].forEach((function(e){return n(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)}));else{var r=e[t];n(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes)}}function j(e,t){var n=e[t];if(n instanceof Set){var r=n.values();return new o.a((function(){var e=r.next();if(e.done)return e;var t=e.value;return{done:!1,value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes]}}))}return o.a.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function O(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return c()(e._edges.keys(),e._edges.size);var n="undirected"===t?e.undirectedSize:e.directedSize,r=new Array(n),i="undirected"===t,o=0;return e._edges.forEach((function(e,t){e instanceof p===i&&(r[o++]=t)})),r}function S(e,t,n){if(0!==e.size)if("mixed"===t||t===e.type)e._edges.forEach((function(e,t){var r=e.attributes,i=e.source,o=e.target;n(t,r,i.key,o.key,i.attributes,o.attributes)}));else{var r="undirected"===t;e._edges.forEach((function(e,t){if(e instanceof p===r){var i=e.attributes,o=e.source,a=e.target;n(t,i,o.key,a.key,o.attributes,a.attributes)}}))}}function A(e,t){return 0===e.size?o.a.empty():"mixed"===t?(n=e._edges.values(),new o.a((function(){var e=n.next();if(e.done)return e;var t=e.value;return{value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes],done:!1}}))):(n=e._edges.values(),new o.a((function e(){var r=n.next();if(r.done)return r;var i=r.value;return i instanceof p==("undirected"===t)?{value:[i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes],done:!1}:e()})));var n}function N(e,t,n){var r=[];return"undirected"!==e&&("out"!==t&&_(r,n.in),"in"!==t&&_(r,n.out)),"directed"!==e&&_(r,n.undirected),r}function L(e,t,n,r){"undirected"!==e&&("out"!==t&&G(n.in,r),"in"!==t&&G(n.out,r)),"directed"!==e&&G(n.undirected,r)}function D(e,t,n){var r=o.a.empty();return"undirected"!==e&&("out"!==t&&void 0!==n.in&&(r=w()(r,x(n.in))),"in"!==t&&void 0!==n.out&&(r=w()(r,x(n.out)))),"directed"!==e&&void 0!==n.undirected&&(r=w()(r,x(n.undirected))),r}function U(e,t,n,r){var i=[];return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&E(i,n.in,r),void 0!==n.out&&"in"!==t&&E(i,n.out,r)),"directed"!==e&&void 0!==n.undirected&&E(i,n.undirected,r),i}function z(e,t,n,r,i){"undirected"!==e&&(void 0!==n.in&&"out"!==t&&k(n.in,r,i),void 0!==n.out&&"in"!==t&&k(n.out,r,i)),"directed"!==e&&void 0!==n.undirected&&k(n.undirected,r,i)}function M(e,t,n,r){var i=o.a.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&r in n.in&&(i=w()(i,j(n.in,r))),void 0!==n.out&&"in"!==t&&r in n.out&&(i=w()(i,j(n.out,r)))),"directed"!==e&&void 0!==n.undirected&&r in n.undirected&&(i=w()(i,j(n.undirected,r))),i}var P=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function K(e,t){if(void 0!==t)for(var n in t)e.add(n)}function C(e,t,n){if("mixed"!==e){if("undirected"===e)return Object.keys(n.undirected);if("string"==typeof t)return Object.keys(n[t])}var r=new Set;return"undirected"!==e&&("out"!==t&&K(r,n.in),"in"!==t&&K(r,n.out)),"directed"!==e&&K(r,n.undirected),c()(r.values(),r.size)}function T(e,t,n){for(var r in t){var i=t[r];i instanceof Set&&(i=i.values().next().value);var o=i.source,a=i.target,c=o===e?a:o;n(c.key,c.attributes)}}function R(e,t,n,r){for(var i in n){var o=n[i];o instanceof Set&&(o=o.values().next().value);var a=o.source,c=o.target,u=a===t?c:a;e.has(u.key)||(e.add(u.key),r(u.key,u.attributes))}}function F(e,t){var n=Object.keys(t),r=n.length,i=0;return new o.a((function(){if(i>=r)return{done:!0};var o=t[n[i++]];o instanceof Set&&(o=o.values().next().value);var a=o.source,c=o.target,u=a===e?c:a;return{done:!1,value:[u.key,u.attributes]}}))}function W(e,t,n){var r=Object.keys(n),i=r.length,a=0;return new o.a((function o(){if(a>=i)return{done:!0};var c=n[r[a++]];c instanceof Set&&(c=c.values().next().value);var u=c.source,d=c.target,s=u===t?d:u;return e.has(s.key)?o():(e.add(s.key),{done:!1,value:[s.key,s.attributes]})}))}function I(e,t,n,r,i){var o=e._nodes.get(r);if("undirected"!==t){if("out"!==n&&void 0!==o.in)for(var a in o.in)if(a===i)return!0;if("in"!==n&&void 0!==o.out)for(var c in o.out)if(c===i)return!0}if("directed"!==t&&void 0!==o.undirected)for(var u in o.undirected)if(u===i)return!0;return!1}function Y(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){e=""+e;var n=this._nodes.get(e);if(void 0===n)throw new u.b("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,r){if("mixed"!==e){if("undirected"===e)return T(n,n.undirected,r);if("string"==typeof t)return T(n,n[t],r)}var i=new Set;"undirected"!==e&&("out"!==t&&R(i,n,n.in,r),"in"!==t&&R(i,n,n.out,r)),"directed"!==e&&R(i,n,n.undirected,r)}("mixed"===r?this.type:r,i,n,t)}}}function J(e,t){var n=t.name,r=t.type,i=t.direction,a=n.slice(0,-1)+"Entries";e.prototype[a]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return o.a.empty();e=""+e;var t=this._nodes.get(e);if(void 0===t)throw new u.b("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return F(n,n.undirected);if("string"==typeof t)return F(n,n[t])}var r=o.a.empty(),i=new Set;return"undirected"!==e&&("out"!==t&&(r=w()(r,W(i,n,n.in))),"in"!==t&&(r=w()(r,W(i,n,n.out)))),"directed"!==e&&(r=w()(r,W(i,n,n.undirected))),r}("mixed"===r?this.type:r,i,t)}}function q(e,t){var n={key:e};return Object.keys(t.attributes).length&&(n.attributes=Object(b.a)({},t.attributes)),n}function B(e,t){var n={source:t.source.key,target:t.target.key};return t.generatedKey||(n.key=e),Object.keys(t.attributes).length&&(n.attributes=Object(b.a)({},t.attributes)),t instanceof p&&(n.undirected=!0),n}function H(e){return Object(b.e)(e)?"key"in e?"attributes"in e&&(!Object(b.e)(e.attributes)||null===e.attributes)?"invalid-attributes":null:"no-key":"not-object"}function Q(e){return Object(b.e)(e)?"source"in e?"target"in e?"attributes"in e&&(!Object(b.e)(e.attributes)||null===e.attributes)?"invalid-attributes":"undirected"in e&&"boolean"!=typeof e.undirected?"invalid-undirected":null:"no-target":"no-source":"not-object"}function V(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return re}));var X=new Set(["directed","undirected","mixed"]),Z=new Set(["domain","_events","_eventsCount","_maxListeners"]),$={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function ee(e,t,n,r,i,o,a,c){if(!r&&"undirected"===e.type)throw new u.c("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new u.c("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(c&&!Object(b.e)(c))throw new u.a("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(c,'"'));if(o=""+o,a=""+a,c=c||{},!e.allowSelfLoops&&o===a)throw new u.c("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var d=e._nodes.get(o),s=e._nodes.get(a);if(!d)throw new u.b("Graph.".concat(t,': source node "').concat(o,'" not found.'));if(!s)throw new u.b("Graph.".concat(t,': target node "').concat(a,'" not found.'));var h={key:null,undirected:r,source:o,target:a,attributes:c};if(n&&(i=e._edgeKeyGenerator(h)),i=""+i,e._edges.has(i))throw new u.c("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));if(!e.multi&&(r?void 0!==d.undirected[a]:void 0!==d.out[a]))throw new u.c("Graph.".concat(t,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var l=new(r?p:f)(i,n,d,s,c);return e._edges.set(i,l),o===a?r?d.undirectedSelfLoops++:d.directedSelfLoops++:r?(d.undirectedDegree++,s.undirectedDegree++):(d.outDegree++,s.inDegree++),g(e,r,l,o,a,d,s),r?e._undirectedSize++:e._directedSize++,h.key=i,e.emit("edgeAdded",h),i}function te(e,t,n,r,i,o,a,c){if(!r&&"undirected"===e.type)throw new u.c("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new u.c("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(c&&!Object(b.e)(c))throw new u.a("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(c,'"'));if(o=""+o,a=""+a,c=c||{},!e.allowSelfLoops&&o===a)throw new u.c("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var d,s,h=e._nodes.get(o),l=e._nodes.get(a),y=null;if(!n&&(d=e._edges.get(i))){if(d.source!==o||d.target!==a||r&&(d.source!==a||d.target!==o))throw new u.c("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. (').concat(d.source,", ").concat(d.target,")."));y=i}if(y||e.multi||!h||(r?void 0===h.undirected[a]:void 0===h.out[a])||(s=Object(b.b)(e,o,a,r?"undirected":"directed")),s)return c?(Object(b.a)(s.attributes,c),y):y;var v={key:null,undirected:r,source:o,target:a,attributes:c};if(n&&(i=e._edgeKeyGenerator(v)),i=""+i,e._edges.has(i))throw new u.c("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));return h||(e.addNode(o),h=e._nodes.get(o),o===a&&(l=h)),l||(e.addNode(a),l=e._nodes.get(a)),d=new(r?p:f)(i,n,h,l,c),e._edges.set(i,d),o===a?r?h.undirectedSelfLoops++:h.directedSelfLoops++:r?(h.undirectedDegree++,l.undirectedDegree++):(h.outDegree++,l.inDegree++),g(e,r,d,o,a,h,l),r?e._undirectedSize++:e._directedSize++,v.key=i,e.emit("edgeAdded",v),i}var ne,re=function(e){var t,n;function r(t){var n;if(n=e.call(this)||this,(t=Object(b.a)({},$,t)).edgeKeyGenerator&&"function"!=typeof t.edgeKeyGenerator)throw new u.a("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(t.edgeKeyGenerator,'".'));if("boolean"!=typeof t.multi)throw new u.a("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!X.has(t.type))throw new u.a('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new u.a("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var r="mixed"===t.type?d:"directed"===t.type?s:h;return Object(b.g)(V(n),"NodeDataClass",r),Object(b.g)(V(n),"_attributes",{}),Object(b.g)(V(n),"_nodes",new Map),Object(b.g)(V(n),"_edges",new Map),Object(b.g)(V(n),"_directedSize",0),Object(b.g)(V(n),"_undirectedSize",0),Object(b.g)(V(n),"_edgeKeyGenerator",t.edgeKeyGenerator||Object(b.c)()),Object(b.g)(V(n),"_options",t),Z.forEach((function(e){return Object(b.g)(V(n),e,n[e])})),Object(b.h)(V(n),"order",(function(){return n._nodes.size})),Object(b.h)(V(n),"size",(function(){return n._edges.size})),Object(b.h)(V(n),"directedSize",(function(){return n._directedSize})),Object(b.h)(V(n),"undirectedSize",(function(){return n._undirectedSize})),Object(b.h)(V(n),"multi",n._options.multi),Object(b.h)(V(n),"type",n._options.type),Object(b.h)(V(n),"allowSelfLoops",n._options.allowSelfLoops),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.hasNode=function(e){return this._nodes.has(""+e)},i.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var n=""+e,r=this._edges.get(n);return!!r&&r instanceof f}if(2===arguments.length){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)return!1;var o=i.out[t];return!!o&&(!this.multi||!!o.size)}throw new u.a("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var n=""+e,r=this._edges.get(n);return!!r&&r instanceof p}if(2===arguments.length){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)return!1;var o=i.undirected[t];return!!o&&(!this.multi||!!o.size)}throw new u.a("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasEdge=function(e,t){if(1===arguments.length){var n=""+e;return this._edges.has(n)}if(2===arguments.length){e=""+e,t=""+t;var r=this._nodes.get(e);if(!r)return!1;var i=void 0!==r.out&&r.out[t];return i||(i=void 0!==r.undirected&&r.undirected[t]),!!i&&(!this.multi||!!i.size)}throw new u.a("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new u.c("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(e);if(!n)throw new u.b('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||void 0;return r?r.key:void 0}},i.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new u.c("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(e);if(!n)throw new u.b('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.undirected&&n.undirected[t]||void 0;return r?r.key:void 0}},i.edge=function(e,t){if(this.multi)throw new u.c("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key},i.inDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.inDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));if("undirected"===this.type)return 0;var r=t?n.directedSelfLoops:0;return n.inDegree+r},i.outDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.outDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));if("undirected"===this.type)return 0;var r=t?n.directedSelfLoops:0;return n.outDegree+r},i.directedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.directedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(e=""+e,!this.hasNode(e))throw new u.b('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:this.inDegree(e,t)+this.outDegree(e,t)},i.undirectedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.undirectedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(e=""+e,!this.hasNode(e))throw new u.b('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));if("directed"===this.type)return 0;var n=this._nodes.get(e),r=t?2*n.undirectedSelfLoops:0;return n.undirectedDegree+r},i.degree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.degree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(e=""+e,!this.hasNode(e))throw new u.b('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var n=0;return"undirected"!==this.type&&(n+=this.directedDegree(e,t)),"directed"!==this.type&&(n+=this.undirectedDegree(e,t)),n},i.source=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},i.target=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},i.extremities=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},i.opposite=function(e,t){if(e=""+e,t=""+t,!this._nodes.has(e))throw new u.b('Graph.opposite: could not find the "'.concat(e,'" node in the graph.'));var n=this._edges.get(t);if(!n)throw new u.b('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var r=n.source,i=n.target,o=r.key,a=i.key;if(e!==o&&e!==a)throw new u.b('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(o,", ").concat(a,")."));return e===o?a:o},i.undirected=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.undirected: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof p},i.directed=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.directed: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof f},i.selfLoop=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.selfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},i.addNode=function(e,t){if(t&&!Object(b.e)(t))throw new u.a('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));if(e=""+e,t=t||{},this._nodes.has(e))throw new u.c('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var n=new this.NodeDataClass(e,t);return this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e},i.mergeNode=function(e,t){if(t&&!Object(b.e)(t))throw new u.a('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));e=""+e,t=t||{};var n=this._nodes.get(e);return n?(t&&Object(b.a)(n.attributes,t),e):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e)},i.dropNode=function(e){if(e=""+e,!this.hasNode(e))throw new u.b('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));for(var t=this.edges(e),n=0,r=t.length;n<r;n++)this.dropEdge(t[n]);var i=this._nodes.get(e);this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:i.attributes})},i.dropEdge=function(e){var t;if(arguments.length>1){var n=""+arguments[0],r=""+arguments[1];if(!(t=Object(b.b)(this,n,r,this.type)))throw new u.b('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(e=""+e,!(t=this._edges.get(e)))throw new u.b('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));this._edges.delete(t.key);var i=t,o=i.source,a=i.target,c=i.attributes,d=t instanceof p;return o===a?o.selfLoops--:d?(o.undirectedDegree--,a.undirectedDegree--):(o.outDegree--,a.inDegree--),l(this,d,t),d?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:e,attributes:c,source:o.key,target:a.key,undirected:d}),this},i.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},i.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},i.getAttribute=function(e){return this._attributes[e]},i.getAttributes=function(){return this._attributes},i.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},i.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",meta:{name:e,value:t}}),this},i.updateAttribute=function(e,t){if("function"!=typeof t)throw new u.a("Graph.updateAttribute: updater should be a function.");return this._attributes[e]=t(this._attributes[e]),this.emit("attributesUpdated",{type:"set",meta:{name:e,value:this._attributes[e]}}),this},i.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",meta:{name:e}}),this},i.replaceAttributes=function(e){if(!Object(b.e)(e))throw new u.a("Graph.replaceAttributes: provided attributes are not a plain object.");var t=this._attributes;return this._attributes=e,this.emit("attributesUpdated",{type:"replace",meta:{before:t,after:e}}),this},i.mergeAttributes=function(e){if(!Object(b.e)(e))throw new u.a("Graph.mergeAttributes: provided attributes are not a plain object.");return this._attributes=Object(b.a)(this._attributes,e),this.emit("attributesUpdated",{type:"merge",meta:{data:this._attributes}}),this},i.getNodeAttribute=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.getNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes[t]},i.getNodeAttributes=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new u.b('Graph.getNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));return t.attributes},i.hasNodeAttribute=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes.hasOwnProperty(t)},i.setNodeAttribute=function(e,t,n){e=""+e;var r=this._nodes.get(e);if(!r)throw new u.b('Graph.setNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new u.a("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return r.attributes[t]=n,this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:n}}),this},i.updateNodeAttribute=function(e,t,n){e=""+e;var r=this._nodes.get(e);if(!r)throw new u.b('Graph.updateNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new u.a("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new u.a("Graph.updateAttribute: updater should be a function.");var i=r.attributes;return i[t]=n(i[t]),this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:i[t]}}),this},i.removeNodeAttribute=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return delete n.attributes[t],this.emit("nodeAttributesUpdated",{key:e,type:"remove",meta:{name:t}}),this},i.replaceNodeAttributes=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.replaceNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!Object(b.e)(t))throw new u.a("Graph.replaceNodeAttributes: provided attributes are not a plain object.");var r=n.attributes;return n.attributes=t,this.emit("nodeAttributesUpdated",{key:e,type:"replace",meta:{before:r,after:t}}),this},i.mergeNodeAttributes=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.mergeNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!Object(b.e)(t))throw new u.a("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return Object(b.a)(n.attributes,t),this.emit("nodeAttributesUpdated",{key:e,type:"merge",meta:{data:t}}),this},i.forEach=function(e){if("function"!=typeof e)throw new u.a("Graph.forEach: expecting a callback.");this._edges.forEach((function(t,n){var r=t.source,i=t.target;e(r.key,i.key,r.attributes,i.attributes,n,t.attributes)}))},i.adjacency=function(){var e=this._edges.values();return new o.a((function(){var t=e.next();if(t.done)return t;var n=t.value,r=n.source,i=n.target;return{done:!1,value:[r.key,i.key,r.attributes,i.attributes,n.key,n.attributes]}}))},i.nodes=function(){return c()(this._nodes.keys(),this._nodes.size)},i.forEachNode=function(e){if("function"!=typeof e)throw new u.a("Graph.forEachNode: expecting a callback.");this._nodes.forEach((function(t,n){e(n,t.attributes)}))},i.nodeEntries=function(){var e=this._nodes.values();return new o.a((function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:[n.key,n.attributes],done:!1}}))},i.exportNode=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new u.b('Graph.exportNode: could not find the "'.concat(e,'" node in the graph.'));return q(e,t)},i.exportEdge=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.exportEdge: could not find the "'.concat(e,'" edge in the graph.'));return B(e,t)},i.export=function(){var e=new Array(this._nodes.size),t=0;this._nodes.forEach((function(n,r){e[t++]=q(r,n)}));var n=new Array(this._edges.size);return t=0,this._edges.forEach((function(e,r){n[t++]=B(r,e)})),{attributes:this.getAttributes(),nodes:e,edges:n}},i.importNode=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=H(e);if(n){if("not-object"===n)throw new u.a('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new u.a("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new u.a("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var r=e.key,i=e.attributes,o=void 0===i?{}:i;return t?this.mergeNode(r,o):this.addNode(r,o),this},i.importEdge=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Q(e);if(n){if("not-object"===n)throw new u.a('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new u.a("Graph.importEdge: missing souce.");if("no-target"===n)throw new u.a("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new u.a("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new u.a("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var r=e.source,i=e.target,o=e.attributes,a=void 0===o?{}:o,c=e.undirected,d=void 0!==c&&c;return"key"in e?(t?d?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:d?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,e.key,r,i,a):(t?d?this.mergeUndirectedEdge:this.mergeDirectedEdge:d?this.addUndirectedEdge:this.addDirectedEdge).call(this,r,i,a),this},i.import=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Object(b.d)(e))return this.import(e.export(),n),this;if(!Object(b.e)(e))throw new u.a("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!Object(b.e)(e.attributes))throw new u.a("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}return e.nodes&&e.nodes.forEach((function(e){return t.importNode(e,n)})),e.edges&&e.edges.forEach((function(e){return t.importEdge(e,n)})),this},i.emptyCopy=function(e){return new r(Object(b.a)({},this._options,e))},i.copy=function(){var e=new r(this._options);return e.import(this),e},i.upgradeToMixed=function(){return"mixed"===this.type?this:(this._nodes.forEach((function(e){return e.upgradeToMixed()})),this._options.type="mixed",Object(b.h)(this,"type",this._options.type),Object(b.g)(this,"NodeDataClass",d),this)},i.upgradeToMulti=function(){return this.multi?this:(this._options.multi=!0,Object(b.h)(this,"multi",!0),(e=this)._nodes.forEach((function(t,n){if(t.out)for(var r in t.out){var i=new Set;i.add(t.out[r]),t.out[r]=i,e._nodes.get(r).in[n]=i}if(t.undirected)for(var o in t.undirected)if(!(o>n)){var a=new Set;a.add(t.undirected[o]),t.undirected[o]=a,e._nodes.get(o).undirected[n]=a}})),this);var e},i.clearIndex=function(){return this._nodes.forEach((function(e){void 0!==e.in&&(e.in={},e.out={}),void 0!==e.undirected&&(e.undirected={})})),this},i.toJSON=function(){return this.export()},i.toString=function(){var e=this.order>1||0===this.order,t=this.size>1||0===this.size;return"Graph<".concat(Object(b.f)(this.order)," node").concat(e?"s":"",", ").concat(Object(b.f)(this.size)," edge").concat(t?"s":"",">")},i.inspect=function(){var e=this,t={};this._nodes.forEach((function(e,n){t[n]=e.attributes}));var n={},r={};this._edges.forEach((function(t,i){var o=t instanceof p?"--":"->",a="",c="(".concat(t.source.key,")").concat(o,"(").concat(t.target.key,")");t.generatedKey?e.multi&&(void 0===r[c]?r[c]=0:r[c]++,a+="".concat(r[c],". ")):a+="[".concat(i,"]: "),n[a+=c]=t.attributes}));var i={};for(var o in this)this.hasOwnProperty(o)&&!Z.has(o)&&"function"!=typeof this[o]&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,Object(b.g)(i,"constructor",this.constructor),i},r}(r.EventEmitter);"undefined"!=typeof Symbol&&(re.prototype[Symbol.for("nodejs.util.inspect.custom")]=re.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach((function(e){["add","merge"].forEach((function(t){var n=e.name(t),r="add"===t?ee:te;e.generateKey?re.prototype[n]=function(t,i,o){return r(this,n,!0,"undirected"===(e.type||this.type),null,t,i,o)}:re.prototype[n]=function(t,i,o,a){return r(this,n,!1,"undirected"===(e.type||this.type),t,i,o,a)}}))})),"undefined"!=typeof Symbol&&(re.prototype[Symbol.iterator]=re.prototype.adjacency),ne=re,y.forEach((function(e){var t=e.name,n=e.attacher;n(ne,t("Edge"),"mixed",f),n(ne,t("DirectedEdge"),"directed",f),n(ne,t("UndirectedEdge"),"undirected",p)})),function(e){m.forEach((function(t){!function(e,t){var n=t.name,r=t.type,i=t.direction;e.prototype[n]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return O(this,r);if(1===arguments.length){e=""+e;var o=this._nodes.get(e);if(void 0===o)throw new u.b("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return N("mixed"===r?this.type:r,i,o)}if(2===arguments.length){e=""+e,t=""+t;var a=this._nodes.get(e);if(!a)throw new u.b("Graph.".concat(n,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b("Graph.".concat(n,': could not find the "').concat(t,'" target node in the graph.'));return U(r,i,a,t)}throw new u.a("Graph.".concat(n,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return S(this,r,n=e);if(2===arguments.length){e=""+e,n=t;var a=this._nodes.get(e);if(void 0===a)throw new u.b("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return L("mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){e=""+e,t=""+t;var c=this._nodes.get(e);if(!c)throw new u.b("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return z(r,i,c,t,n)}throw new u.a("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,a=n.slice(0,-1)+"Entries";e.prototype[a]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return o.a.empty();if(!arguments.length)return A(this,r);if(1===arguments.length){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));return D(r,i,n)}if(2===arguments.length){e=""+e,t=""+t;var c=this._nodes.get(e);if(!c)throw new u.b("Graph.".concat(a,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b("Graph.".concat(a,': could not find the "').concat(t,'" target node in the graph.'));return M(r,i,c,t)}throw new u.a("Graph.".concat(a,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)}))}(re),function(e){P.forEach((function(t){!function(e,t){var n=t.name,r=t.type,i=t.direction;e.prototype[n]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(2===arguments.length){var t=""+arguments[0],o=""+arguments[1];if(!this._nodes.has(t))throw new u.b("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));if(!this._nodes.has(o))throw new u.b("Graph.".concat(n,': could not find the "').concat(o,'" node in the graph.'));return I(this,r,i,t,o)}if(1===arguments.length){e=""+e;var a=this._nodes.get(e);if(void 0===a)throw new u.b("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));var c=C("mixed"===r?this.type:r,i,a);return c}throw new u.a("Graph.".concat(n,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),Y(e,t),J(e,t)}))}(re)},function(e,t,n){var r=n(2);e.exports=function(){var e,t=arguments,n=-1;return new r((function r(){if(!e){if(++n>=t.length)return{done:!0};e=t[n]}var i=e.next();return i.done?(e=null,r()):i}))}},function(e,t){e.exports=function(e,t){for(var n,r=arguments.length>1?t:1/0,i=r!==1/0?new Array(r):[],o=0;;){if(o===r)return i;if((n=e.next()).done)return o!==t?i.slice(0,o):i;i[o++]=n.value}}},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function c(){c.init.call(this)}e.exports=c,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var u=10;function d(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?c.defaultMaxListeners:e._maxListeners}function h(e,t,n,r){var i,o,a,c;if(d(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=s(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,c=u,console&&console.warn&&console.warn(c)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function g(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):b(i,i.length)}function l(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function b(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),c.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},c.prototype.getMaxListeners=function(){return s(this)},c.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var d=u.length,s=b(u,d);for(n=0;n<d;++n)o(s[n],this,t)}return!0},c.prototype.addListener=function(e,t){return h(this,e,t,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(e,t){return h(this,e,t,!0)},c.prototype.once=function(e,t){return d(t),this.on(e,p(this,e,t)),this},c.prototype.prependOnceListener=function(e,t){return d(t),this.prependListener(e,p(this,e,t)),this},c.prototype.removeListener=function(e,t){var n,r,i,o,a;if(d(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},c.prototype.listeners=function(e){return g(this,e,!0)},c.prototype.rawListeners=function(e){return g(this,e,!1)},c.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):l.call(e,t)},c.prototype.listenerCount=l,c.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";n.r(t),function(e){var t=n(1),r=n(3),i=n(0);function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var a=function(e){function n(n){return e.call(this,Object(t.a)({type:"directed"},n))||this}return o(n,e),n}(r.a),c=function(e){function n(n){return e.call(this,Object(t.a)({type:"undirected"},n))||this}return o(n,e),n}(r.a),u=function(e){function n(n){return e.call(this,Object(t.a)({multi:!0,type:"directed"},n))||this}return o(n,e),n}(r.a),d=function(e){function n(n){return e.call(this,Object(t.a)({multi:!0,type:"undirected"},n))||this}return o(n,e),n}(r.a);function s(e){e.from=function(t,n){var r=new e(n);return r.import(t),r}}s(r.a),s(a),s(c),s(u),s(d),r.a.Graph=r.a,r.a.DirectedGraph=a,r.a.UndirectedGraph=c,r.a.MultiDirectedGraph=u,r.a.MultiUndirectedGraph=d,r.a.InvalidArgumentsGraphError=i.a,r.a.NotFoundGraphError=i.b,r.a.UsageGraphError=i.c,e.exports=r.a}.call(this,n(8)(e))},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.graphology=t():e.graphology=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function o(e){var t="function"==typeof Map?new Map:void 0;return(o=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return c(e,arguments,d(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,e)})(e)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function c(e,t,n){return(c=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&u(i,n.prototype),i}).apply(null,arguments)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return p}));var s=function(e){function t(t,n){var r;return(r=e.call(this)||this).name="GraphError",r.message=t||"",r.data=n||{},r}return i(t,e),t}(o(Error)),h=function(e){function t(n,i){var o;return(o=e.call(this,n,i)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r(o),t.prototype.constructor),o}return i(t,e),t}(s),f=function(e){function t(n,i){var o;return(o=e.call(this,n,i)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r(o),t.prototype.constructor),o}return i(t,e),t}(s),p=function(e){function t(n,i){var o;return(o=e.call(this,n,i)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r(o),t.prototype.constructor),o}return i(t,e),t}(s)},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){for(var e=arguments[0]||{},t=1,n=arguments.length;t<n;t++)if(arguments[t])for(var r in arguments[t])e[r]=arguments[t][r];return e}function o(e,t,n,r){var i=e._nodes.get(t),o=null;return i?o="mixed"===r?i.out&&i.out[n]||i.undirected&&i.undirected[n]:"directed"===r?i.out&&i.out[n]:i.undirected&&i.undirected[n]:o}function a(e){return null!==e&&"object"===r(e)&&"function"==typeof e.addUndirectedEdgeWithKey&&"function"==typeof e.dropNode}function c(e){return"object"===r(e)&&null!==e&&e.constructor===Object}function u(e){for(var t=""+e,n="",r=0,i=t.length;r<i;r++){n=t[i-r-1]+n,(r-2)%3||r===i-1||(n=","+n)}return n}function d(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function s(e,t,n){var r={enumerable:!0,configurable:!0};"function"==typeof n?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function h(){var e=0;return function(){return"_geid".concat(e++,"_")}}n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return c})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"h",(function(){return s})),n.d(t,"c",(function(){return h}))},function(e,t){function n(e){Object.defineProperty(this,"_next",{writable:!1,enumerable:!1,value:e}),this.done=!1}n.prototype.next=function(){if(this.done)return{done:!0};var e=this._next();return e.done&&(this.done=!0),e},"undefined"!=typeof Symbol&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var e=arguments,t=e.length,r=0;return new n((function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}}))},n.empty=function(){var e=new n(null);return e.done=!0,e},n.is=function(e){return e instanceof n||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=n},function(e,t,n){"use strict";var r=n(6),i=n(2),o=n.n(i),a=n(5),c=n.n(a),u=n(0);function d(e,t){this.key=e,this.attributes=t,this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.directedSelfLoops=0,this.undirectedSelfLoops=0,this.in={},this.out={},this.undirected={}}function s(e,t){this.key=e,this.attributes=t||{},this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}}function h(e,t){this.key=e,this.attributes=t||{},this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}}function f(e,t,n,r,i){this.key=e,this.attributes=i,this.source=n,this.target=r,this.generatedKey=t}function p(e,t,n,r,i){this.key=e,this.attributes=i,this.source=n,this.target=r,this.generatedKey=t}function g(e,t,n,r,i,o,a){var c=e.multi,u=t?"undirected":"out",d=t?"undirected":"in",s=o[u][i];void 0===s&&(s=c?new Set:n,o[u][i]=s),c&&s.add(n),r!==i&&void 0===a[d][r]&&(a[d][r]=s)}function l(e,t,n){var r=e.multi,i=n.source,o=n.target,a=i.key,c=o.key,u=i[t?"undirected":"out"],d=t?"undirected":"in";if(c in u)if(r){var s=u[c];1===s.size?(delete u[c],delete o[d][a]):s.delete(n)}else delete u[c];r||delete o[d][a]}s.prototype.upgradeToMixed=function(){this.undirectedDegree=0,this.undirectedSelfLoops=0,this.undirected={}},h.prototype.upgradeToMixed=function(){this.inDegree=0,this.outDegree=0,this.directedSelfLoops=0,this.in={},this.out={}};var b=n(1);var y=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes[i]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e){var i;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,a=""+arguments[1];if(!(i=Object(b.b)(this,o,a,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(a,'").'))}else if(e=""+e,!(i=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(i instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return i.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return o.attributes.hasOwnProperty(i)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i,o){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var c=""+e,d=""+i;if(i=arguments[2],o=arguments[3],!(a=Object(b.b)(this,c,d,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(c,'" - "').concat(d,'").'))}else if(e=""+e,!(a=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(a instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[i]=o,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",meta:{name:i,value:o}}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i,o){var a;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var c=""+e,d=""+i;if(i=arguments[2],o=arguments[3],!(a=Object(b.b)(this,c,d,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(c,'" - "').concat(d,'").'))}else if(e=""+e,!(a=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("function"!=typeof o)throw new u.a("Graph.".concat(t,": updater should be a function."));if("mixed"!==n&&!(a instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return a.attributes[i]=o(a.attributes[i]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",meta:{name:i,value:a.attributes[i]}}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return delete o.attributes[i],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",meta:{name:i}}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!Object(b.e)(i))throw new u.a("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));var d=o.attributes;return o.attributes=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",meta:{before:d,after:i}}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n,r){e.prototype[t]=function(e,i){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new u.c("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new u.c("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,c=""+i;if(i=arguments[2],!(o=Object(b.b)(this,a,c,n)))throw new u.b("Graph.".concat(t,': could not find an edge for the given path ("').concat(a,'" - "').concat(c,'").'))}else if(e=""+e,!(o=this._edges.get(e)))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'));if(!Object(b.e)(i))throw new u.a("Graph.".concat(t,": provided attributes are not a plain object."));if("mixed"!==n&&!(o instanceof r))throw new u.b("Graph.".concat(t,': could not find the "').concat(e,'" ').concat(n," edge in the graph."));return Object(b.a)(o.attributes,i),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",meta:{data:i}}),this}}}];var v=n(4),w=n.n(v),m=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function _(e,t){for(var n in t)t[n]instanceof Set?t[n].forEach((function(t){return e.push(t.key)})):e.push(t[n].key)}function G(e,t){for(var n in e)if(e[n]instanceof Set)e[n].forEach((function(e){return t(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)}));else{var r=e[n];t(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes)}}function x(e){var t=Object.keys(e),n=t.length,r=null,i=0;return new o.a((function o(){var a;if(r){var c=r.next();if(c.done)return r=null,i++,o();a=c.value}else{if(i>=n)return{done:!0};var u=t[i];if((a=e[u])instanceof Set)return r=a.values(),o();i++}return{done:!1,value:[a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes]}}))}function E(e,t,n){n in t&&(t[n]instanceof Set?t[n].forEach((function(t){return e.push(t.key)})):e.push(t[n].key))}function k(e,t,n){if(t in e)if(e[t]instanceof Set)e[t].forEach((function(e){return n(e.key,e.attributes,e.source.key,e.target.key,e.source.attributes,e.target.attributes)}));else{var r=e[t];n(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes)}}function j(e,t){var n=e[t];if(n instanceof Set){var r=n.values();return new o.a((function(){var e=r.next();if(e.done)return e;var t=e.value;return{done:!1,value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes]}}))}return o.a.of([n.key,n.attributes,n.source.key,n.target.key,n.source.attributes,n.target.attributes])}function O(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return c()(e._edges.keys(),e._edges.size);var n="undirected"===t?e.undirectedSize:e.directedSize,r=new Array(n),i="undirected"===t,o=0;return e._edges.forEach((function(e,t){e instanceof p===i&&(r[o++]=t)})),r}function S(e,t,n){if(0!==e.size)if("mixed"===t||t===e.type)e._edges.forEach((function(e,t){var r=e.attributes,i=e.source,o=e.target;n(t,r,i.key,o.key,i.attributes,o.attributes)}));else{var r="undirected"===t;e._edges.forEach((function(e,t){if(e instanceof p===r){var i=e.attributes,o=e.source,a=e.target;n(t,i,o.key,a.key,o.attributes,a.attributes)}}))}}function A(e,t){return 0===e.size?o.a.empty():"mixed"===t?(n=e._edges.values(),new o.a((function(){var e=n.next();if(e.done)return e;var t=e.value;return{value:[t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes],done:!1}}))):(n=e._edges.values(),new o.a((function e(){var r=n.next();if(r.done)return r;var i=r.value;return i instanceof p==("undirected"===t)?{value:[i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes],done:!1}:e()})));var n}function N(e,t,n){var r=[];return"undirected"!==e&&("out"!==t&&_(r,n.in),"in"!==t&&_(r,n.out)),"directed"!==e&&_(r,n.undirected),r}function L(e,t,n,r){"undirected"!==e&&("out"!==t&&G(n.in,r),"in"!==t&&G(n.out,r)),"directed"!==e&&G(n.undirected,r)}function D(e,t,n){var r=o.a.empty();return"undirected"!==e&&("out"!==t&&void 0!==n.in&&(r=w()(r,x(n.in))),"in"!==t&&void 0!==n.out&&(r=w()(r,x(n.out)))),"directed"!==e&&void 0!==n.undirected&&(r=w()(r,x(n.undirected))),r}function U(e,t,n,r){var i=[];return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&E(i,n.in,r),void 0!==n.out&&"in"!==t&&E(i,n.out,r)),"directed"!==e&&void 0!==n.undirected&&E(i,n.undirected,r),i}function z(e,t,n,r,i){"undirected"!==e&&(void 0!==n.in&&"out"!==t&&k(n.in,r,i),void 0!==n.out&&"in"!==t&&k(n.out,r,i)),"directed"!==e&&void 0!==n.undirected&&k(n.undirected,r,i)}function M(e,t,n,r){var i=o.a.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&r in n.in&&(i=w()(i,j(n.in,r))),void 0!==n.out&&"in"!==t&&r in n.out&&(i=w()(i,j(n.out,r)))),"directed"!==e&&void 0!==n.undirected&&r in n.undirected&&(i=w()(i,j(n.undirected,r))),i}var P=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function K(e,t){if(void 0!==t)for(var n in t)e.add(n)}function C(e,t,n){if("mixed"!==e){if("undirected"===e)return Object.keys(n.undirected);if("string"==typeof t)return Object.keys(n[t])}var r=new Set;return"undirected"!==e&&("out"!==t&&K(r,n.in),"in"!==t&&K(r,n.out)),"directed"!==e&&K(r,n.undirected),c()(r.values(),r.size)}function T(e,t,n){for(var r in t){var i=t[r];i instanceof Set&&(i=i.values().next().value);var o=i.source,a=i.target,c=o===e?a:o;n(c.key,c.attributes)}}function R(e,t,n,r){for(var i in n){var o=n[i];o instanceof Set&&(o=o.values().next().value);var a=o.source,c=o.target,u=a===t?c:a;e.has(u.key)||(e.add(u.key),r(u.key,u.attributes))}}function F(e,t){var n=Object.keys(t),r=n.length,i=0;return new o.a((function(){if(i>=r)return{done:!0};var o=t[n[i++]];o instanceof Set&&(o=o.values().next().value);var a=o.source,c=o.target,u=a===e?c:a;return{done:!1,value:[u.key,u.attributes]}}))}function W(e,t,n){var r=Object.keys(n),i=r.length,a=0;return new o.a((function o(){if(a>=i)return{done:!0};var c=n[r[a++]];c instanceof Set&&(c=c.values().next().value);var u=c.source,d=c.target,s=u===t?d:u;return e.has(s.key)?o():(e.add(s.key),{done:!1,value:[s.key,s.attributes]})}))}function I(e,t,n,r,i){var o=e._nodes.get(r);if("undirected"!==t){if("out"!==n&&void 0!==o.in)for(var a in o.in)if(a===i)return!0;if("in"!==n&&void 0!==o.out)for(var c in o.out)if(c===i)return!0}if("directed"!==t&&void 0!==o.undirected)for(var u in o.undirected)if(u===i)return!0;return!1}function Y(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){e=""+e;var n=this._nodes.get(e);if(void 0===n)throw new u.b("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));!function(e,t,n,r){if("mixed"!==e){if("undirected"===e)return T(n,n.undirected,r);if("string"==typeof t)return T(n,n[t],r)}var i=new Set;"undirected"!==e&&("out"!==t&&R(i,n,n.in,r),"in"!==t&&R(i,n,n.out,r)),"directed"!==e&&R(i,n,n.undirected,r)}("mixed"===r?this.type:r,i,n,t)}}}function J(e,t){var n=t.name,r=t.type,i=t.direction,a=n.slice(0,-1)+"Entries";e.prototype[a]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return o.a.empty();e=""+e;var t=this._nodes.get(e);if(void 0===t)throw new u.b("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return F(n,n.undirected);if("string"==typeof t)return F(n,n[t])}var r=o.a.empty(),i=new Set;return"undirected"!==e&&("out"!==t&&(r=w()(r,W(i,n,n.in))),"in"!==t&&(r=w()(r,W(i,n,n.out)))),"directed"!==e&&(r=w()(r,W(i,n,n.undirected))),r}("mixed"===r?this.type:r,i,t)}}function q(e,t){var n={key:e};return Object.keys(t.attributes).length&&(n.attributes=Object(b.a)({},t.attributes)),n}function B(e,t){var n={source:t.source.key,target:t.target.key};return t.generatedKey||(n.key=e),Object.keys(t.attributes).length&&(n.attributes=Object(b.a)({},t.attributes)),t instanceof p&&(n.undirected=!0),n}function H(e){return Object(b.e)(e)?"key"in e?"attributes"in e&&(!Object(b.e)(e.attributes)||null===e.attributes)?"invalid-attributes":null:"no-key":"not-object"}function Q(e){return Object(b.e)(e)?"source"in e?"target"in e?"attributes"in e&&(!Object(b.e)(e.attributes)||null===e.attributes)?"invalid-attributes":"undirected"in e&&"boolean"!=typeof e.undirected?"invalid-undirected":null:"no-target":"no-source":"not-object"}function V(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return re}));var X=new Set(["directed","undirected","mixed"]),Z=new Set(["domain","_events","_eventsCount","_maxListeners"]),$={allowSelfLoops:!0,edgeKeyGenerator:null,multi:!1,type:"mixed"};function ee(e,t,n,r,i,o,a,c){if(!r&&"undirected"===e.type)throw new u.c("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new u.c("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(c&&!Object(b.e)(c))throw new u.a("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(c,'"'));if(o=""+o,a=""+a,c=c||{},!e.allowSelfLoops&&o===a)throw new u.c("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var d=e._nodes.get(o),s=e._nodes.get(a);if(!d)throw new u.b("Graph.".concat(t,': source node "').concat(o,'" not found.'));if(!s)throw new u.b("Graph.".concat(t,': target node "').concat(a,'" not found.'));var h={key:null,undirected:r,source:o,target:a,attributes:c};if(n&&(i=e._edgeKeyGenerator(h)),i=""+i,e._edges.has(i))throw new u.c("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));if(!e.multi&&(r?void 0!==d.undirected[a]:void 0!==d.out[a]))throw new u.c("Graph.".concat(t,': an edge linking "').concat(o,'" to "').concat(a,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var l=new(r?p:f)(i,n,d,s,c);return e._edges.set(i,l),o===a?r?d.undirectedSelfLoops++:d.directedSelfLoops++:r?(d.undirectedDegree++,s.undirectedDegree++):(d.outDegree++,s.inDegree++),g(e,r,l,o,a,d,s),r?e._undirectedSize++:e._directedSize++,h.key=i,e.emit("edgeAdded",h),i}function te(e,t,n,r,i,o,a,c){if(!r&&"undirected"===e.type)throw new u.c("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new u.c("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(c&&!Object(b.e)(c))throw new u.a("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(c,'"'));if(o=""+o,a=""+a,c=c||{},!e.allowSelfLoops&&o===a)throw new u.c("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var d,s,h=e._nodes.get(o),l=e._nodes.get(a),y=null;if(!n&&(d=e._edges.get(i))){if(d.source!==o||d.target!==a||r&&(d.source!==a||d.target!==o))throw new u.c("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(i,'" edge with "').concat(o,'" source & "').concat(a,'" target vs. (').concat(d.source,", ").concat(d.target,")."));y=i}if(y||e.multi||!h||(r?void 0===h.undirected[a]:void 0===h.out[a])||(s=Object(b.b)(e,o,a,r?"undirected":"directed")),s)return c?(Object(b.a)(s.attributes,c),y):y;var v={key:null,undirected:r,source:o,target:a,attributes:c};if(n&&(i=e._edgeKeyGenerator(v)),i=""+i,e._edges.has(i))throw new u.c("Graph.".concat(t,': the "').concat(i,'" edge already exists in the graph.'));return h||(e.addNode(o),h=e._nodes.get(o),o===a&&(l=h)),l||(e.addNode(a),l=e._nodes.get(a)),d=new(r?p:f)(i,n,h,l,c),e._edges.set(i,d),o===a?r?h.undirectedSelfLoops++:h.directedSelfLoops++:r?(h.undirectedDegree++,l.undirectedDegree++):(h.outDegree++,l.inDegree++),g(e,r,d,o,a,h,l),r?e._undirectedSize++:e._directedSize++,v.key=i,e.emit("edgeAdded",v),i}var ne,re=function(e){var t,n;function r(t){var n;if(n=e.call(this)||this,(t=Object(b.a)({},$,t)).edgeKeyGenerator&&"function"!=typeof t.edgeKeyGenerator)throw new u.a("Graph.constructor: invalid 'edgeKeyGenerator' option. Expecting a function but got \"".concat(t.edgeKeyGenerator,'".'));if("boolean"!=typeof t.multi)throw new u.a("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(t.multi,'".'));if(!X.has(t.type))throw new u.a('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(t.type,'".'));if("boolean"!=typeof t.allowSelfLoops)throw new u.a("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(t.allowSelfLoops,'".'));var r="mixed"===t.type?d:"directed"===t.type?s:h;return Object(b.g)(V(n),"NodeDataClass",r),Object(b.g)(V(n),"_attributes",{}),Object(b.g)(V(n),"_nodes",new Map),Object(b.g)(V(n),"_edges",new Map),Object(b.g)(V(n),"_directedSize",0),Object(b.g)(V(n),"_undirectedSize",0),Object(b.g)(V(n),"_edgeKeyGenerator",t.edgeKeyGenerator||Object(b.c)()),Object(b.g)(V(n),"_options",t),Z.forEach((function(e){return Object(b.g)(V(n),e,n[e])})),Object(b.h)(V(n),"order",(function(){return n._nodes.size})),Object(b.h)(V(n),"size",(function(){return n._edges.size})),Object(b.h)(V(n),"directedSize",(function(){return n._directedSize})),Object(b.h)(V(n),"undirectedSize",(function(){return n._undirectedSize})),Object(b.h)(V(n),"multi",n._options.multi),Object(b.h)(V(n),"type",n._options.type),Object(b.h)(V(n),"allowSelfLoops",n._options.allowSelfLoops),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.hasNode=function(e){return this._nodes.has(""+e)},i.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var n=""+e,r=this._edges.get(n);return!!r&&r instanceof f}if(2===arguments.length){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)return!1;var o=i.out[t];return!!o&&(!this.multi||!!o.size)}throw new u.a("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var n=""+e,r=this._edges.get(n);return!!r&&r instanceof p}if(2===arguments.length){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)return!1;var o=i.undirected[t];return!!o&&(!this.multi||!!o.size)}throw new u.a("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.hasEdge=function(e,t){if(1===arguments.length){var n=""+e;return this._edges.has(n)}if(2===arguments.length){e=""+e,t=""+t;var r=this._nodes.get(e);if(!r)return!1;var i=void 0!==r.out&&r.out[t];return i||(i=void 0!==r.undirected&&r.undirected[t]),!!i&&(!this.multi||!!i.size)}throw new u.a("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},i.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new u.c("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(e);if(!n)throw new u.b('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||void 0;return r?r.key:void 0}},i.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new u.c("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(e);if(!n)throw new u.b('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.undirected&&n.undirected[t]||void 0;return r?r.key:void 0}},i.edge=function(e,t){if(this.multi)throw new u.c("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key},i.inDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.inDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));if("undirected"===this.type)return 0;var r=t?n.directedSelfLoops:0;return n.inDegree+r},i.outDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.outDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));if("undirected"===this.type)return 0;var r=t?n.directedSelfLoops:0;return n.outDegree+r},i.directedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.directedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(e=""+e,!this.hasNode(e))throw new u.b('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:this.inDegree(e,t)+this.outDegree(e,t)},i.undirectedDegree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.undirectedDegree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(e=""+e,!this.hasNode(e))throw new u.b('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));if("directed"===this.type)return 0;var n=this._nodes.get(e),r=t?2*n.undirectedSelfLoops:0;return n.undirectedDegree+r},i.degree=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("boolean"!=typeof t)throw new u.a('Graph.degree: Expecting a boolean but got "'.concat(t,'" for the second parameter (allowing self-loops to be counted).'));if(e=""+e,!this.hasNode(e))throw new u.b('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var n=0;return"undirected"!==this.type&&(n+=this.directedDegree(e,t)),"directed"!==this.type&&(n+=this.undirectedDegree(e,t)),n},i.source=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},i.target=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},i.extremities=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},i.opposite=function(e,t){if(e=""+e,t=""+t,!this._nodes.has(e))throw new u.b('Graph.opposite: could not find the "'.concat(e,'" node in the graph.'));var n=this._edges.get(t);if(!n)throw new u.b('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var r=n.source,i=n.target,o=r.key,a=i.key;if(e!==o&&e!==a)throw new u.b('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(o,", ").concat(a,")."));return e===o?a:o},i.undirected=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.undirected: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof p},i.directed=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.directed: could not find the "'.concat(e,'" edge in the graph.'));return t instanceof f},i.selfLoop=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.selfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},i.addNode=function(e,t){if(t&&!Object(b.e)(t))throw new u.a('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));if(e=""+e,t=t||{},this._nodes.has(e))throw new u.c('Graph.addNode: the "'.concat(e,'" node already exist in the graph.'));var n=new this.NodeDataClass(e,t);return this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e},i.mergeNode=function(e,t){if(t&&!Object(b.e)(t))throw new u.a('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));e=""+e,t=t||{};var n=this._nodes.get(e);return n?(t&&Object(b.a)(n.attributes,t),e):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),e)},i.dropNode=function(e){if(e=""+e,!this.hasNode(e))throw new u.b('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));for(var t=this.edges(e),n=0,r=t.length;n<r;n++)this.dropEdge(t[n]);var i=this._nodes.get(e);this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:i.attributes})},i.dropEdge=function(e){var t;if(arguments.length>1){var n=""+arguments[0],r=""+arguments[1];if(!(t=Object(b.b)(this,n,r,this.type)))throw new u.b('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(e=""+e,!(t=this._edges.get(e)))throw new u.b('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));this._edges.delete(t.key);var i=t,o=i.source,a=i.target,c=i.attributes,d=t instanceof p;return o===a?o.selfLoops--:d?(o.undirectedDegree--,a.undirectedDegree--):(o.outDegree--,a.inDegree--),l(this,d,t),d?this._undirectedSize--:this._directedSize--,this.emit("edgeDropped",{key:e,attributes:c,source:o.key,target:a.key,undirected:d}),this},i.clear=function(){this._edges.clear(),this._nodes.clear(),this.emit("cleared")},i.clearEdges=function(){this._edges.clear(),this.clearIndex(),this.emit("edgesCleared")},i.getAttribute=function(e){return this._attributes[e]},i.getAttributes=function(){return this._attributes},i.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},i.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",meta:{name:e,value:t}}),this},i.updateAttribute=function(e,t){if("function"!=typeof t)throw new u.a("Graph.updateAttribute: updater should be a function.");return this._attributes[e]=t(this._attributes[e]),this.emit("attributesUpdated",{type:"set",meta:{name:e,value:this._attributes[e]}}),this},i.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",meta:{name:e}}),this},i.replaceAttributes=function(e){if(!Object(b.e)(e))throw new u.a("Graph.replaceAttributes: provided attributes are not a plain object.");var t=this._attributes;return this._attributes=e,this.emit("attributesUpdated",{type:"replace",meta:{before:t,after:e}}),this},i.mergeAttributes=function(e){if(!Object(b.e)(e))throw new u.a("Graph.mergeAttributes: provided attributes are not a plain object.");return this._attributes=Object(b.a)(this._attributes,e),this.emit("attributesUpdated",{type:"merge",meta:{data:this._attributes}}),this},i.getNodeAttribute=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.getNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes[t]},i.getNodeAttributes=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new u.b('Graph.getNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));return t.attributes},i.hasNodeAttribute=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return n.attributes.hasOwnProperty(t)},i.setNodeAttribute=function(e,t,n){e=""+e;var r=this._nodes.get(e);if(!r)throw new u.b('Graph.setNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new u.a("Graph.setNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or value, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");return r.attributes[t]=n,this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:n}}),this},i.updateNodeAttribute=function(e,t,n){e=""+e;var r=this._nodes.get(e);if(!r)throw new u.b('Graph.updateNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));if(arguments.length<3)throw new u.a("Graph.updateNodeAttribute: not enough arguments. Either you forgot to pass the attribute's name or updater, or you meant to use #.replaceNodeAttributes / #.mergeNodeAttributes instead.");if("function"!=typeof n)throw new u.a("Graph.updateAttribute: updater should be a function.");var i=r.attributes;return i[t]=n(i[t]),this.emit("nodeAttributesUpdated",{key:e,type:"set",meta:{name:t,value:i[t]}}),this},i.removeNodeAttribute=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.hasNodeAttribute: could not find the "'.concat(e,'" node in the graph.'));return delete n.attributes[t],this.emit("nodeAttributesUpdated",{key:e,type:"remove",meta:{name:t}}),this},i.replaceNodeAttributes=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.replaceNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!Object(b.e)(t))throw new u.a("Graph.replaceNodeAttributes: provided attributes are not a plain object.");var r=n.attributes;return n.attributes=t,this.emit("nodeAttributesUpdated",{key:e,type:"replace",meta:{before:r,after:t}}),this},i.mergeNodeAttributes=function(e,t){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b('Graph.mergeNodeAttributes: could not find the "'.concat(e,'" node in the graph.'));if(!Object(b.e)(t))throw new u.a("Graph.mergeNodeAttributes: provided attributes are not a plain object.");return Object(b.a)(n.attributes,t),this.emit("nodeAttributesUpdated",{key:e,type:"merge",meta:{data:t}}),this},i.forEach=function(e){if("function"!=typeof e)throw new u.a("Graph.forEach: expecting a callback.");this._edges.forEach((function(t,n){var r=t.source,i=t.target;e(r.key,i.key,r.attributes,i.attributes,n,t.attributes)}))},i.adjacency=function(){var e=this._edges.values();return new o.a((function(){var t=e.next();if(t.done)return t;var n=t.value,r=n.source,i=n.target;return{done:!1,value:[r.key,i.key,r.attributes,i.attributes,n.key,n.attributes]}}))},i.nodes=function(){return c()(this._nodes.keys(),this._nodes.size)},i.forEachNode=function(e){if("function"!=typeof e)throw new u.a("Graph.forEachNode: expecting a callback.");this._nodes.forEach((function(t,n){e(n,t.attributes)}))},i.nodeEntries=function(){var e=this._nodes.values();return new o.a((function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:[n.key,n.attributes],done:!1}}))},i.exportNode=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new u.b('Graph.exportNode: could not find the "'.concat(e,'" node in the graph.'));return q(e,t)},i.exportEdge=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new u.b('Graph.exportEdge: could not find the "'.concat(e,'" edge in the graph.'));return B(e,t)},i.export=function(){var e=new Array(this._nodes.size),t=0;this._nodes.forEach((function(n,r){e[t++]=q(r,n)}));var n=new Array(this._edges.size);return t=0,this._edges.forEach((function(e,r){n[t++]=B(r,e)})),{attributes:this.getAttributes(),nodes:e,edges:n}},i.importNode=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=H(e);if(n){if("not-object"===n)throw new u.a('Graph.importNode: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if("no-key"===n)throw new u.a("Graph.importNode: no key provided.");if("invalid-attributes"===n)throw new u.a("Graph.importNode: invalid attributes. Attributes should be a plain object, null or omitted.")}var r=e.key,i=e.attributes,o=void 0===i?{}:i;return t?this.mergeNode(r,o):this.addNode(r,o),this},i.importEdge=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Q(e);if(n){if("not-object"===n)throw new u.a('Graph.importEdge: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if("no-source"===n)throw new u.a("Graph.importEdge: missing souce.");if("no-target"===n)throw new u.a("Graph.importEdge: missing target.");if("invalid-attributes"===n)throw new u.a("Graph.importEdge: invalid attributes. Attributes should be a plain object, null or omitted.");if("invalid-undirected"===n)throw new u.a("Graph.importEdge: invalid undirected. Undirected should be boolean or omitted.")}var r=e.source,i=e.target,o=e.attributes,a=void 0===o?{}:o,c=e.undirected,d=void 0!==c&&c;return"key"in e?(t?d?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:d?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,e.key,r,i,a):(t?d?this.mergeUndirectedEdge:this.mergeDirectedEdge:d?this.addUndirectedEdge:this.addDirectedEdge).call(this,r,i,a),this},i.import=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Object(b.d)(e))return this.import(e.export(),n),this;if(!Object(b.e)(e))throw new u.a("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!Object(b.e)(e.attributes))throw new u.a("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}return e.nodes&&e.nodes.forEach((function(e){return t.importNode(e,n)})),e.edges&&e.edges.forEach((function(e){return t.importEdge(e,n)})),this},i.emptyCopy=function(e){return new r(Object(b.a)({},this._options,e))},i.copy=function(){var e=new r(this._options);return e.import(this),e},i.upgradeToMixed=function(){return"mixed"===this.type?this:(this._nodes.forEach((function(e){return e.upgradeToMixed()})),this._options.type="mixed",Object(b.h)(this,"type",this._options.type),Object(b.g)(this,"NodeDataClass",d),this)},i.upgradeToMulti=function(){return this.multi?this:(this._options.multi=!0,Object(b.h)(this,"multi",!0),(e=this)._nodes.forEach((function(t,n){if(t.out)for(var r in t.out){var i=new Set;i.add(t.out[r]),t.out[r]=i,e._nodes.get(r).in[n]=i}if(t.undirected)for(var o in t.undirected)if(!(o>n)){var a=new Set;a.add(t.undirected[o]),t.undirected[o]=a,e._nodes.get(o).undirected[n]=a}})),this);var e},i.clearIndex=function(){return this._nodes.forEach((function(e){void 0!==e.in&&(e.in={},e.out={}),void 0!==e.undirected&&(e.undirected={})})),this},i.toJSON=function(){return this.export()},i.toString=function(){var e=this.order>1||0===this.order,t=this.size>1||0===this.size;return"Graph<".concat(Object(b.f)(this.order)," node").concat(e?"s":"",", ").concat(Object(b.f)(this.size)," edge").concat(t?"s":"",">")},i.inspect=function(){var e=this,t={};this._nodes.forEach((function(e,n){t[n]=e.attributes}));var n={},r={};this._edges.forEach((function(t,i){var o=t instanceof p?"--":"->",a="",c="(".concat(t.source.key,")").concat(o,"(").concat(t.target.key,")");t.generatedKey?e.multi&&(void 0===r[c]?r[c]=0:r[c]++,a+="".concat(r[c],". ")):a+="[".concat(i,"]: "),n[a+=c]=t.attributes}));var i={};for(var o in this)this.hasOwnProperty(o)&&!Z.has(o)&&"function"!=typeof this[o]&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,Object(b.g)(i,"constructor",this.constructor),i},r}(r.EventEmitter);"undefined"!=typeof Symbol&&(re.prototype[Symbol.for("nodejs.util.inspect.custom")]=re.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach((function(e){["add","merge"].forEach((function(t){var n=e.name(t),r="add"===t?ee:te;e.generateKey?re.prototype[n]=function(t,i,o){return r(this,n,!0,"undirected"===(e.type||this.type),null,t,i,o)}:re.prototype[n]=function(t,i,o,a){return r(this,n,!1,"undirected"===(e.type||this.type),t,i,o,a)}}))})),"undefined"!=typeof Symbol&&(re.prototype[Symbol.iterator]=re.prototype.adjacency),ne=re,y.forEach((function(e){var t=e.name,n=e.attacher;n(ne,t("Edge"),"mixed",f),n(ne,t("DirectedEdge"),"directed",f),n(ne,t("UndirectedEdge"),"undirected",p)})),function(e){m.forEach((function(t){!function(e,t){var n=t.name,r=t.type,i=t.direction;e.prototype[n]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return O(this,r);if(1===arguments.length){e=""+e;var o=this._nodes.get(e);if(void 0===o)throw new u.b("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return N("mixed"===r?this.type:r,i,o)}if(2===arguments.length){e=""+e,t=""+t;var a=this._nodes.get(e);if(!a)throw new u.b("Graph.".concat(n,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b("Graph.".concat(n,': could not find the "').concat(t,'" target node in the graph.'));return U(r,i,a,t)}throw new u.a("Graph.".concat(n,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return S(this,r,n=e);if(2===arguments.length){e=""+e,n=t;var a=this._nodes.get(e);if(void 0===a)throw new u.b("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return L("mixed"===r?this.type:r,i,a,n)}if(3===arguments.length){e=""+e,t=""+t;var c=this._nodes.get(e);if(!c)throw new u.b("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return z(r,i,c,t,n)}throw new u.a("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}}}(e,t),function(e,t){var n=t.name,r=t.type,i=t.direction,a=n.slice(0,-1)+"Entries";e.prototype[a]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return o.a.empty();if(!arguments.length)return A(this,r);if(1===arguments.length){e=""+e;var n=this._nodes.get(e);if(!n)throw new u.b("Graph.".concat(a,': could not find the "').concat(e,'" node in the graph.'));return D(r,i,n)}if(2===arguments.length){e=""+e,t=""+t;var c=this._nodes.get(e);if(!c)throw new u.b("Graph.".concat(a,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new u.b("Graph.".concat(a,': could not find the "').concat(t,'" target node in the graph.'));return M(r,i,c,t)}throw new u.a("Graph.".concat(a,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)}))}(re),function(e){P.forEach((function(t){!function(e,t){var n=t.name,r=t.type,i=t.direction;e.prototype[n]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(2===arguments.length){var t=""+arguments[0],o=""+arguments[1];if(!this._nodes.has(t))throw new u.b("Graph.".concat(n,': could not find the "').concat(t,'" node in the graph.'));if(!this._nodes.has(o))throw new u.b("Graph.".concat(n,': could not find the "').concat(o,'" node in the graph.'));return I(this,r,i,t,o)}if(1===arguments.length){e=""+e;var a=this._nodes.get(e);if(void 0===a)throw new u.b("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));var c=C("mixed"===r?this.type:r,i,a);return c}throw new u.a("Graph.".concat(n,": invalid number of arguments (expecting 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),Y(e,t),J(e,t)}))}(re)},function(e,t,n){var r=n(2);e.exports=function(){var e,t=arguments,n=-1;return new r((function r(){if(!e){if(++n>=t.length)return{done:!0};e=t[n]}var i=e.next();return i.done?(e=null,r()):i}))}},function(e,t){e.exports=function(e,t){for(var n,r=arguments.length>1?t:1/0,i=r!==1/0?new Array(r):[],o=0;;){if(o===r)return i;if((n=e.next()).done)return o!==t?i.slice(0,o):i;i[o++]=n.value}}},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function c(){c.init.call(this)}e.exports=c,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var u=10;function d(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?c.defaultMaxListeners:e._maxListeners}function h(e,t,n,r){var i,o,a,c;if(d(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=s(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,c=u,console&&console.warn&&console.warn(c)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function g(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):b(i,i.length)}function l(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function b(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),c.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},c.prototype.getMaxListeners=function(){return s(this)},c.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var d=u.length,s=b(u,d);for(n=0;n<d;++n)o(s[n],this,t)}return!0},c.prototype.addListener=function(e,t){return h(this,e,t,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(e,t){return h(this,e,t,!0)},c.prototype.once=function(e,t){return d(t),this.on(e,p(this,e,t)),this},c.prototype.prependOnceListener=function(e,t){return d(t),this.prependListener(e,p(this,e,t)),this},c.prototype.removeListener=function(e,t){var n,r,i,o,a;if(d(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},c.prototype.listeners=function(e){return g(this,e,!0)},c.prototype.rawListeners=function(e){return g(this,e,!1)},c.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):l.call(e,t)},c.prototype.listenerCount=l,c.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";n.r(t),function(e){var t=n(1),r=n(3),i=n(0);function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var a=function(e){function n(n){return e.call(this,Object(t.a)({type:"directed"},n))||this}return o(n,e),n}(r.a),c=function(e){function n(n){return e.call(this,Object(t.a)({type:"undirected"},n))||this}return o(n,e),n}(r.a),u=function(e){function n(n){return e.call(this,Object(t.a)({multi:!0},n))||this}return o(n,e),n}(r.a),d=function(e){function n(n){return e.call(this,Object(t.a)({multi:!0,type:"directed"},n))||this}return o(n,e),n}(r.a),s=function(e){function n(n){return e.call(this,Object(t.a)({multi:!0,type:"undirected"},n))||this}return o(n,e),n}(r.a);function h(e){e.from=function(t,n){var r=new e(n);return r.import(t),r}}h(r.a),h(a),h(c),h(u),h(d),h(s),r.a.Graph=r.a,r.a.DirectedGraph=a,r.a.UndirectedGraph=c,r.a.MultiGraph=u,r.a.MultiDirectedGraph=d,r.a.MultiUndirectedGraph=s,r.a.InvalidArgumentsGraphError=i.a,r.a.NotFoundGraphError=i.b,r.a.UsageGraphError=i.c,e.exports=r.a}.call(this,n(8)(e))},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}}])})); |
# Changelog | ||
## 0.15.1 | ||
* Adding missing `MultiGraph` export. | ||
* Adding missing error typings. | ||
## 0.15.0 | ||
@@ -4,0 +9,0 @@ |
@@ -9,1 +9,5 @@ import AbstractGraph from 'graphology-types'; | ||
export class MultiUndirectedGraph extends Graph {} | ||
export class InvalidArgumentsGraphError extends Error {} | ||
export class NotFoundGraphError extends Error {} | ||
export class UsageGraphError extends Error {} |
@@ -44,9 +44,23 @@ "use strict"; | ||
var MultiDirectedGraph = | ||
var MultiGraph = | ||
/*#__PURE__*/ | ||
function (_Graph3) { | ||
_inheritsLoose(MultiDirectedGraph, _Graph3); | ||
_inheritsLoose(MultiGraph, _Graph3); | ||
function MultiGraph(options) { | ||
return _Graph3.call(this, (0, _utils.assign)({ | ||
multi: true | ||
}, options)) || this; | ||
} | ||
return MultiGraph; | ||
}(_graph["default"]); | ||
var MultiDirectedGraph = | ||
/*#__PURE__*/ | ||
function (_Graph4) { | ||
_inheritsLoose(MultiDirectedGraph, _Graph4); | ||
function MultiDirectedGraph(options) { | ||
return _Graph3.call(this, (0, _utils.assign)({ | ||
return _Graph4.call(this, (0, _utils.assign)({ | ||
multi: true, | ||
@@ -62,7 +76,7 @@ type: 'directed' | ||
/*#__PURE__*/ | ||
function (_Graph4) { | ||
_inheritsLoose(MultiUndirectedGraph, _Graph4); | ||
function (_Graph5) { | ||
_inheritsLoose(MultiUndirectedGraph, _Graph5); | ||
function MultiUndirectedGraph(options) { | ||
return _Graph4.call(this, (0, _utils.assign)({ | ||
return _Graph5.call(this, (0, _utils.assign)({ | ||
multi: true, | ||
@@ -98,2 +112,3 @@ type: 'undirected' | ||
attachStaticFromMethod(UndirectedGraph); | ||
attachStaticFromMethod(MultiGraph); | ||
attachStaticFromMethod(MultiDirectedGraph); | ||
@@ -109,2 +124,3 @@ attachStaticFromMethod(MultiUndirectedGraph); | ||
_graph["default"].UndirectedGraph = UndirectedGraph; | ||
_graph["default"].MultiGraph = MultiGraph; | ||
_graph["default"].MultiDirectedGraph = MultiDirectedGraph; | ||
@@ -111,0 +127,0 @@ _graph["default"].MultiUndirectedGraph = MultiUndirectedGraph; |
{ | ||
"name": "graphology", | ||
"version": "0.15.0", | ||
"version": "0.15.1", | ||
"description": "A robust and multipurpose Graph object for JavaScript.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
405818
6834