UNPKG

535 kBJavaScriptView Raw
1/**
2 * vis-network - network
3 * http://visjs.org/
4 *
5 * A dynamic, browser-based visualization library.
6 *
7 * @version 5.2.3
8 * @date 2019-08-13T19:11:08Z
9 *
10 * @copyright (c) 2011-2017 Almende B.V, http://almende.com
11 * @copyright (c) 2018-2019 visjs contributors, https://github.com/visjs
12 *
13 * @license
14 * vis.js is dual licensed under both
15 *
16 * 1. The Apache 2.0 License
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * and
20 *
21 * 2. The MIT License
22 * http://opensource.org/licenses/MIT
23 *
24 * vis.js may be distributed under either license.
25 */(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e=e||self,t(e.vis=e.vis||{}))})(this,function(e){'use strict';var ao=Math.cos,so=Math.sin,ro=Math.round,lo=Math.pow,co=Math.ceil,uo=Math.abs,po=Math.PI,ho=Math.atan2,mo=Math.sqrt,go=Math.floor,yo=Math.max,fo=Math.min;function t(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function o(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t<e.length;t++)o[t]=e[t];return o}}function n(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function a(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function d(e){return _o(e)||vo(e)||ko()}function s(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function r(e,t){return t={exports:{}},e(t,t.exports),t.exports}function l(e,t){var o=t||0,n=Do;return n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]}function u(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length?arguments[1]:void 0,o=2<arguments.length?arguments[2]:void 0,n=t&&o||0;"string"==typeof e&&(t="binary"===e?Array(16):void 0,e={});var i=e.random||(e.rng||Co)();if(i[6]=64|15&i[6],i[8]=128|63&i[8],t)for(var a=0;16>a;a++)t[n+a]=i[a];return t||l(i)}function p(e,t){var o=Object.keys(e);return Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(e)),t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o}function h(e){for(var t=1,o;t<arguments.length;t++)o=null==arguments[t]?{}:arguments[t],t%2?p(o,!0).forEach(function(t){bo(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):p(o).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))});return e}function m(e){return e instanceof Number||"number"==typeof e}function g(e){if(e)for(;!0===e.hasChildNodes();){var t=e.firstChild;t&&(g(t),e.removeChild(t))}}function y(e){return e instanceof String||"string"==typeof e}function f(e){return"object"===So(e)&&null!==e}function b(e){if(e instanceof Date)return!0;if(y(e)){var t=Yo.exec(e);if(t)return!0;if(!isNaN(Date.parse(e)))return!0}return!1}function _(e){return Oo.isMoment(e)}function v(e,t,o,n){var i=!1;!0===n&&(i=null===t[o]&&e[o]!==void 0),i?delete e[o]:e[o]=t[o]}function k(e,t){var o=!!(2<arguments.length&&arguments[2]!==void 0)&&arguments[2];for(var n in e)if(t[n]!==void 0)if(null===t[n]||"object"!==So(t[n]))v(e,t,n,o);else{var i=e[n],a=t[n];f(i)&&f(a)&&k(i,a,o)}}function w(e,t){if(!Array.isArray(e))throw new Error("Array with property names expected as first argument");for(var o=2,n;o<(2>=arguments.length?0:arguments.length-2);o++){n=2>o+2||arguments.length<=o+2?void 0:arguments[o+2];for(var a=0,d;a<e.length;a++)d=e[a],n&&Object.prototype.hasOwnProperty.call(n,d)&&(t[d]=n[d])}return t}function x(e,t,o){var n=!!(3<arguments.length&&arguments[3]!==void 0)&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var i=0,a;i<e.length;i++)if(a=e[i],Object.prototype.hasOwnProperty.call(o,a))if(o[a]&&o[a].constructor===Object)void 0===t[a]&&(t[a]={}),t[a].constructor===Object?O(t[a],o[a],!1,n):v(t,o,a,n);else if(Array.isArray(o[a]))throw new TypeError("Arrays are not supported by deepExtend");else v(t,o,a,n);return t}function S(e,t,o){var n=!!(3<arguments.length&&arguments[3]!==void 0)&&arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var a in o)if(Object.prototype.hasOwnProperty.call(o,a)&&-1===e.indexOf(a))if(o[a]&&o[a].constructor===Object)void 0===t[a]&&(t[a]={}),t[a].constructor===Object?O(t[a],o[a]):v(t,o,a,n);else if(Array.isArray(o[a])){t[a]=[];for(var d=0;d<o[a].length;d++)t[a].push(o[a][d])}else v(t,o,a,n);return t}function O(e,t){var o=!!(2<arguments.length&&arguments[2]!==void 0)&&arguments[2],n=!!(3<arguments.length&&arguments[3]!==void 0)&&arguments[3];for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)||!0===o)if(t[a]&&t[a].constructor===Object)void 0===e[a]&&(e[a]={}),e[a].constructor===Object?O(e[a],t[a],o):v(e,t,a,n);else if(Array.isArray(t[a])){e[a]=[];for(var d=0;d<t[a].length;d++)e[a].push(t[a][d])}else v(e,t,a,n);return e}function D(e,t){if(e.length!==t.length)return!1;for(var o=0,n=e.length;o<n;o++)if(e[o]!=t[o])return!1;return!0}function T(e,t){var o;if(void 0!==e){if(null===e)return null;if(!t)return e;if("string"!=typeof t&&!(t instanceof String))throw new Error("Type must be a string");switch(t){case"boolean":case"Boolean":return!!e;case"number":case"Number":return y(e)&&!isNaN(Date.parse(e))?Oo(e).valueOf():+e.valueOf();case"string":case"String":return e+"";case"Date":if(m(e))return new Date(e);if(e instanceof Date)return new Date(e.valueOf());if(_(e))return new Date(e.valueOf());if(y(e))return o=Yo.exec(e),o?new Date(+o[1]):Oo(new Date(e)).toDate();throw new Error("Cannot convert object of type "+C(e)+" to type Date");case"Moment":if(m(e))return Oo(e);if(e instanceof Date)return Oo(e.valueOf());if(_(e))return Oo(e);if(y(e))return o=Yo.exec(e),o?Oo(+o[1]):Oo(e);throw new Error("Cannot convert object of type "+C(e)+" to type Date");case"ISODate":if(m(e))return new Date(e);if(e instanceof Date)return e.toISOString();if(_(e))return e.toDate().toISOString();if(y(e))return o=Yo.exec(e),o?new Date(+o[1]).toISOString():Oo(e).format();throw new Error("Cannot convert object of type "+C(e)+" to type ISODate");case"ASPDate":if(m(e))return"/Date("+e+")/";if(e instanceof Date||_(e))return"/Date("+e.valueOf()+")/";if(y(e)){o=Yo.exec(e);var n;return n=o?new Date(+o[1]).valueOf():new Date(e).valueOf(),"/Date("+n+")/"}throw new Error("Cannot convert object of type "+C(e)+" to type ASPDate");default:throw new Error("Unknown type ".concat(t));}}}function C(e){var t=So(e);return"object"===t?null===e?"null":e instanceof Boolean?"Boolean":e instanceof Number?"Number":e instanceof String?"String":Array.isArray(e)?"Array":e instanceof Date?"Date":"Object":"number"===t?"Number":"boolean"===t?"Boolean":"string"===t?"String":void 0===t?"undefined":t}function E(e,t){return[].concat(wo(e),[t])}function M(e){return e.slice()}function I(e){return e.getBoundingClientRect().left}function P(e){return e.getBoundingClientRect().right}function F(e){return e.getBoundingClientRect().top}function Y(e,t){var o=e.className.split(" "),n=t.split(" ");o=o.concat(n.filter(function(e){return 0>o.indexOf(e)})),e.className=o.join(" ")}function z(e,t){var o=e.className.split(" "),n=t.split(" ");o=o.filter(function(e){return 0>n.indexOf(e)}),e.className=o.join(" ")}function N(e,t){if(Array.isArray(e))for(var o=e.length,n=0;n<o;n++)t(e[n],n,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t(e[a],a,e)}function R(e,t,o){return e[t]!==o&&(e[t]=o,!0)}function B(e){var t=!1;return function(){t||(t=!0,requestAnimationFrame(function(){t=!1,e()}))}}function H(e,t,o,n){e.addEventListener?(n===void 0&&(n=!1),"mousewheel"===t&&0<=navigator.userAgent.indexOf("Firefox")&&(t="DOMMouseScroll"),e.addEventListener(t,o,n)):e.attachEvent("on"+t,o)}function L(e,t,o,n){e.removeEventListener?(n===void 0&&(n=!1),"mousewheel"===t&&0<=navigator.userAgent.indexOf("Firefox")&&(t="DOMMouseScroll"),e.removeEventListener(t,o,n)):e.detachEvent("on"+t,o)}function A(e){if(e||(e=window.event),!e);else e.preventDefault?e.preventDefault():e.returnValue=!1}function W(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:window.event,t=null;if(!e);else e.target?t=e.target:e.srcElement&&(t=e.srcElement);return t instanceof Element?null!=t.nodeType&&3==t.nodeType&&(t=t.parentNode,!(t instanceof Element))?null:t:null}function j(e,t){for(var o=e;o;){if(o===t)return!0;if(o.parentNode)o=o.parentNode;else return!1}return!1}function U(e){var t;switch(e.length){case 3:case 4:return t=No.exec(e),t?{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16)}:null;case 6:case 7:return t=zo.exec(e),t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null;default:return null;}}function V(e,t){if(-1!==e.indexOf("rgba"))return e;if(-1!==e.indexOf("rgb")){var o=e.substr(e.indexOf("(")+1).replace(")","").split(",");return"rgba("+o[0]+","+o[1]+","+o[2]+","+t+")"}var n=U(e);return null==n?e:"rgba("+n.r+","+n.g+","+n.b+","+t+")"}function G(e,t,o){return"#"+(16777216+(e<<16)+(t<<8)+o).toString(16).slice(1)}function q(e,t){if(y(e)){var o=e;if(te(o)){var n=o.substr(4).substr(0,o.length-5).split(",").map(function(e){return parseInt(e)});o=G(n[0],n[1],n[2])}if(!0===ee(o)){var i=J(o),a={h:i.h,s:.8*i.s,v:fo(1,1.02*i.v)},d={h:i.h,s:fo(1,1.25*i.s),v:.8*i.v},s=$(d.h,d.s,d.v),r=$(a.h,a.s,a.v);return{background:o,border:s,highlight:{background:r,border:s},hover:{background:r,border:s}}}return{background:o,border:o,highlight:{background:o,border:o},hover:{background:o,border:o}}}if(t){var l={background:e.background||t.background,border:e.border||t.border,highlight:y(e.highlight)?{border:e.highlight,background:e.highlight}:{background:e.highlight&&e.highlight.background||t.highlight.background,border:e.highlight&&e.highlight.border||t.highlight.border},hover:y(e.hover)?{border:e.hover,background:e.hover}:{border:e.hover&&e.hover.border||t.hover.border,background:e.hover&&e.hover.background||t.hover.background}};return l}var c={background:e.background||void 0,border:e.border||void 0,highlight:y(e.highlight)?{border:e.highlight,background:e.highlight}:{background:e.highlight&&e.highlight.background||void 0,border:e.highlight&&e.highlight.border||void 0},hover:y(e.hover)?{border:e.hover,background:e.hover}:{border:e.hover&&e.hover.border||void 0,background:e.hover&&e.hover.background||void 0}};return c}function Z(e,t,o){e/=255,t/=255,o/=255;var n=fo(e,fo(t,o)),i=yo(e,yo(t,o));if(n===i)return{h:0,s:0,v:n};var a=e===n?t-o:o===n?e-t:o-e,d=e===n?3:o===n?1:5;return{h:60*(d-a/(i-n))/360,s:(i-n)/i,v:i}}function X(e,t){var o=Lo.split(e.style.cssText),n=Lo.split(t),i=h({},o,{},n);e.style.cssText=Lo.join(i)}function K(e,t){var o=Lo.split(e.style.cssText),n=Lo.split(t);for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&delete o[i];e.style.cssText=Lo.join(o)}function Q(e,o,n){var a=go(6*e),i=6*e-a,d=n*(1-o),s=n*(1-i*o),l=n*(1-(1-i)*o),t,c,u;switch(a%6){case 0:t=n,c=l,u=d;break;case 1:t=s,c=n,u=d;break;case 2:t=d,c=n,u=l;break;case 3:t=d,c=s,u=n;break;case 4:t=l,c=d,u=n;break;case 5:t=n,c=d,u=s;}return{r:go(255*t),g:go(255*c),b:go(255*u)}}function $(e,t,o){var n=Q(e,t,o);return G(n.r,n.g,n.b)}function J(e){var t=U(e);if(!t)throw new TypeError("'".concat(e,"' is not a valid color."));return Z(t.r,t.g,t.b)}function ee(e){var t=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e);return t}function te(e){e=e.replace(" ","");var t=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(e);return t}function oe(e){e=e.replace(" ","");var t=/rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(0?.{1,3})\)/i.test(e);return t}function ne(e,t){if(null!==t&&"object"===So(t)){for(var o=Object.create(t),n=0;n<e.length;n++)Object.prototype.hasOwnProperty.call(t,e[n])&&"object"==So(t[e[n]])&&(o[e[n]]=ie(t[e[n]]));return o}return null}function ie(e){if(null===e||"object"!==So(e))return null;if(e instanceof Element)return e;var t=Object.create(e);for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&"object"==So(e[o])&&(t[o]=ie(e[o]));return t}function ae(e,t){for(var o=0;o<e.length;o++){var n=e[o],a=void 0;for(a=o;0<a&&0>t(n,e[a-1]);a--)e[a]=e[a-1];e[a]=n}return e}function de(e,t,o){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{},i=function(e){return null!==e&&e!==void 0},a=function(e){return null!==e&&"object"===So(e)};if(!a(e))throw new Error("Parameter mergeTarget must be an object");if(!a(t))throw new Error("Parameter options must be an object");if(!i(o))throw new Error("Parameter option must have a value");if(!a(n))throw new Error("Parameter globalOptions must be an object");var d=function(e,t,o){a(e[o])||(e[o]={});var n=t[o],i=e[o];for(var d in n)Object.prototype.hasOwnProperty.call(n,d)&&(i[d]=n[d])},s=t[o],r=a(n)&&!function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(n),l=r?n[o]:void 0,c=l?l.enabled:void 0;if(void 0!==s){if("boolean"==typeof s)return a(e[o])||(e[o]={}),void(e[o].enabled=s);if(null===s&&!a(e[o]))if(i(l))e[o]=Object.create(l);else return;if(a(s)){var u=!0;void 0===s.enabled?void 0!==c&&(u=l.enabled):u=s.enabled,d(e,t,o),e[o].enabled=u}}}function se(e,t,o,n){for(var i=0,a=0,d=e.length-1;a<=d&&i<1e4;){var s=go((a+d)/2),r=e[s],l=n===void 0?r[o]:r[o][n],c=t(l);if(0==c)return s;-1==c?a=s+1:d=s-1;i++}return-1}function re(e,t,o,n,i){var a=0,d=0,s=e.length-1,r,l,c,u;for(i=null==i?function(e,t){return e==t?0:e<t?-1:1}:i;d<=s&&10000>a;){if(u=go(.5*(s+d)),r=e[yo(0,u-1)][o],l=e[u][o],c=e[fo(e.length-1,u+1)][o],0==i(l,t))return u;if(0>i(r,t)&&0<i(l,t))return"before"==n?yo(0,u-1):u;if(0>i(l,t)&&0<i(c,t))return"before"==n?u:fo(e.length-1,u+1);0>i(l,t)?d=u+1:s=u-1,a++}return-1}function le(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var o=e.offsetWidth;t.style.overflow="scroll";var n=e.offsetWidth;return o==n&&(n=t.clientWidth),document.body.removeChild(t),o-n}function ce(e,t){var o;Array.isArray(t)||(t=[t]);var n=!0,a=!1,d=void 0;try{for(var s=e[Symbol.iterator](),r,l;!(n=(r=s.next()).done);n=!0)if(l=r.value,l){o=l[t[0]];for(var c=1;c<t.length;c++)o&&(o=o[t[c]]);if("undefined"!=typeof o)break}}catch(e){a=!0,d=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw d}}return o}function ue(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function pe(e,t){return t={exports:{}},e(t,t.exports),t.exports}function he(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function me(e,t){for(var o=0,n;o<t.length;o++)n=t[o],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function ge(e,t,o){return t&&me(e.prototype,t),o&&me(e,o),e}function ye(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fe(e,t){return t&&("object"===Vo(t)||"function"==typeof t)?t:Zo(e)}function be(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qo(e,t)}function _e(e,t){var o=t||0,n=Jo;return n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+"-"+n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]+n[e[o++]]}function ve(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length?arguments[1]:void 0,o=2<arguments.length?arguments[2]:void 0,n=t&&o||0;"string"==typeof e&&(t="binary"===e?Array(16):void 0,e={});var i=e.random||(e.rng||tn)();if(i[6]=64|15&i[6],i[8]=128|63&i[8],t)for(var a=0;16>a;a++)t[n+a]=i[a];return t||_e(i)}function ke(e){return ke="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},ke(e)}function we(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function xe(e,t){return t={exports:{}},e(t,t.exports),t.exports}function Se(e){return e instanceof Number||"number"==typeof e}function Oe(e){return e instanceof String||"string"==typeof e}function De(e){return ln.isMoment(e)}function Te(e,t){var o;if(void 0!==e){if(null===e)return null;if(!t)return e;if("string"!=typeof t&&!(t instanceof String))throw new Error("Type must be a string");switch(t){case"boolean":case"Boolean":return!!e;case"number":case"Number":return Oe(e)&&!isNaN(Date.parse(e))?ln(e).valueOf():+e.valueOf();case"string":case"String":return e+"";case"Date":if(Se(e))return new Date(e);if(e instanceof Date)return new Date(e.valueOf());if(De(e))return new Date(e.valueOf());if(Oe(e))return o=bn.exec(e),o?new Date(+o[1]):ln(new Date(e)).toDate();throw new Error("Cannot convert object of type "+Ce(e)+" to type Date");case"Moment":if(Se(e))return ln(e);if(e instanceof Date)return ln(e.valueOf());if(De(e))return ln(e);if(Oe(e))return o=bn.exec(e),o?ln(+o[1]):ln(e);throw new Error("Cannot convert object of type "+Ce(e)+" to type Date");case"ISODate":if(Se(e))return new Date(e);if(e instanceof Date)return e.toISOString();if(De(e))return e.toDate().toISOString();if(Oe(e))return o=bn.exec(e),o?new Date(+o[1]).toISOString():ln(e).format();throw new Error("Cannot convert object of type "+Ce(e)+" to type ISODate");case"ASPDate":if(Se(e))return"/Date("+e+")/";if(e instanceof Date)return"/Date("+e.valueOf()+")/";if(Oe(e)){o=bn.exec(e);var n;return n=o?new Date(+o[1]).valueOf():new Date(e).valueOf(),"/Date("+n+")/"}throw new Error("Cannot convert object of type "+Ce(e)+" to type ASPDate");default:throw new Error("Unknown type ".concat(t));}}}function Ce(e){var t=ke(e);return"object"===t?null===e?"null":e instanceof Boolean?"Boolean":e instanceof Number?"Number":e instanceof String?"String":Array.isArray(e)?"Array":e instanceof Date?"Date":"Object":"number"===t?"Number":"boolean"===t?"Boolean":"string"===t?"String":void 0===t?"undefined":t}function Ee(e){return"string"==typeof e||"number"==typeof e}function Me(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t<e.length;t++)o[t]=e[t];return o}}function Ie(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function Pe(e,t){var o=Object.keys(e);return Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(e)),t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o}function Fe(e){for(var t=1,o;t<arguments.length;t++)o=null==arguments[t]?{}:arguments[t],t%2?Pe(o,!0).forEach(function(t){Uo(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Pe(o).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))});return e}function Ye(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function ze(e,t){return t={exports:{}},e(t,t.exports),t.exports}function Ne(e){return Pn=e,qe()}function Re(){Fn=0,Yn=Pn.charAt(0)}function Be(){Fn++,Yn=Pn.charAt(Fn)}function He(){return Pn.charAt(Fn+1)}function Le(e){return Rn.test(e)}function Ae(e,t){if(e||(e={}),t)for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);return e}function We(e,t,n){for(var i=t.split("."),a=e;i.length;){var d=i.shift();i.length?(!a[d]&&(a[d]={}),a=a[d]):a[d]=n}}function je(e,t){for(var o=null,n=[e],a=e,d,s;a.parent;)n.push(a.parent),a=a.parent;if(a.nodes)for(d=0,s=a.nodes.length;d<s;d++)if(t.id===a.nodes[d].id){o=a.nodes[d];break}for(o||(o={id:t.id},e.node&&(o.attr=Ae(o.attr,e.node))),d=n.length-1;0<=d;d--){var r=n[d];r.nodes||(r.nodes=[]),-1===r.nodes.indexOf(o)&&r.nodes.push(o)}t.attr&&(o.attr=Ae(o.attr,t.attr))}function Ue(e,t){if(e.edges||(e.edges=[]),e.edges.push(t),e.edge){var o=Ae({},e.edge);t.attr=Ae(o,t.attr)}}function Ve(e,t,o,n,i){var a={from:t,to:o,type:n};return e.edge&&(a.attr=Ae({},e.edge)),a.attr=Ae(a.attr||{},i),null!=i&&i.hasOwnProperty("arrows")&&null!=i.arrows&&(a.arrows={to:{enabled:!0,type:i.arrows.type}},i.arrows=null),a}function Ge(){for(Nn=Mn.NULL,zn="";" "===Yn||"\t"===Yn||"\n"===Yn||"\r"===Yn;)Be();do{var e=!1;if("#"===Yn){for(var t=Fn-1;" "===Pn.charAt(t)||"\t"===Pn.charAt(t);)t--;if("\n"===Pn.charAt(t)||""===Pn.charAt(t)){for(;""!=Yn&&"\n"!=Yn;)Be();e=!0}}if("/"===Yn&&"/"===He()){for(;""!=Yn&&"\n"!=Yn;)Be();e=!0}if("/"===Yn&&"*"===He()){for(;""!=Yn;)if("*"===Yn&&"/"===He()){Be(),Be();break}else Be();e=!0}for(;" "===Yn||"\t"===Yn||"\n"===Yn||"\r"===Yn;)Be()}while(e);if(""===Yn)return void(Nn=Mn.DELIMITER);var o=Yn+He();if(In[o])return Nn=Mn.DELIMITER,zn=o,Be(),void Be();if(In[Yn])return Nn=Mn.DELIMITER,zn=Yn,void Be();if(Le(Yn)||"-"===Yn){for(zn+=Yn,Be();Le(Yn);)zn+=Yn,Be();return"false"===zn?zn=!1:"true"===zn?zn=!0:!isNaN(+zn)&&(zn=+zn),void(Nn=Mn.IDENTIFIER)}if("\""===Yn){for(Be();""!=Yn&&("\""!=Yn||"\""===Yn&&"\""===He());)"\""===Yn?(zn+=Yn,Be()):"\\"===Yn&&"n"===He()?(zn+="\n",Be()):zn+=Yn,Be();if("\""!=Yn)throw tt("End of string \" expected");return Be(),void(Nn=Mn.IDENTIFIER)}for(Nn=Mn.UNKNOWN;""!=Yn;)zn+=Yn,Be();throw new SyntaxError("Syntax error in part \""+ot(zn,30)+"\"")}function qe(){var e={};if(Re(),Ge(),"strict"===zn&&(e.strict=!0,Ge()),("graph"===zn||"digraph"===zn)&&(e.type=zn,Ge()),Nn===Mn.IDENTIFIER&&(e.id=zn,Ge()),"{"!=zn)throw tt("Angle bracket { expected");if(Ge(),Ze(e),"}"!=zn)throw tt("Angle bracket } expected");if(Ge(),""!==zn)throw tt("End of file expected");return Ge(),delete e.node,delete e.edge,delete e.graph,e}function Ze(e){for(;""!==zn&&"}"!=zn;)Xe(e),";"===zn&&Ge()}function Xe(e){var t=Ke(e);if(t)return void Je(e,t);var o=Qe(e);if(!o){if(Nn!=Mn.IDENTIFIER)throw tt("Identifier expected");var n=zn;if(Ge(),"="===zn){if(Ge(),Nn!=Mn.IDENTIFIER)throw tt("Identifier expected");e[n]=zn,Ge()}else $e(e,n)}}function Ke(e){var t=null;if("subgraph"===zn&&(t={},t.type="subgraph",Ge(),Nn===Mn.IDENTIFIER&&(t.id=zn,Ge())),"{"===zn){if(Ge(),t||(t={}),t.parent=e,t.node=e.node,t.edge=e.edge,t.graph=e.graph,Ze(t),"}"!=zn)throw tt("Angle bracket } expected");Ge(),delete t.node,delete t.edge,delete t.graph,delete t.parent,e.subgraphs||(e.subgraphs=[]),e.subgraphs.push(t)}return t}function Qe(e){return"node"===zn?(Ge(),e.node=et(),"node"):"edge"===zn?(Ge(),e.edge=et(),"edge"):"graph"===zn?(Ge(),e.graph=et(),"graph"):null}function $e(e,t){var o={id:t},n=et();n&&(o.attr=n),je(e,o),Je(e,t)}function Je(e,t){for(;"->"===zn||"--"===zn;){var o=zn,n;Ge();var i=Ke(e);if(i)n=i;else{if(Nn!=Mn.IDENTIFIER)throw tt("Identifier or subgraph expected");n=zn,je(e,{id:n}),Ge()}var a=et(),d=Ve(e,t,n,o,a);Ue(e,d),t=n}}function et(){for(var e=null,t={dashed:!0,solid:!1,dotted:[1,5]},o={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},n=[],a=[],d;"["===zn;){for(Ge(),e={};""!==zn&&"]"!=zn;){if(Nn!=Mn.IDENTIFIER)throw tt("Attribute name expected");var s=zn;if(Ge(),"="!=zn)throw tt("Equal sign = expected");if(Ge(),Nn!=Mn.IDENTIFIER)throw tt("Attribute value expected");var r=zn;"style"===s&&(r=t[r]);var l;"arrowhead"===s&&(l=o[r],s="arrows",r={to:{enabled:!0,type:l}}),"arrowtail"===s&&(l=o[r],s="arrows",r={from:{enabled:!0,type:l}}),n.push({attr:e,name:s,value:r}),a.push(s),Ge(),","==zn&&Ge()}if("]"!=zn)throw tt("Bracket ] expected");Ge()}if(a.includes("dir")){var c={arrows:{}};for(d=0;d<n.length;d++)if(!("arrows"===n[d].name))"dir"===n[d].name&&(c.dir=d);else if(null!=n[d].value.to)c.arrows.to=d;else if(null!=n[d].value.from)c.arrows.from=d;else throw tt("Invalid value of arrows");var u=n[c.dir].value;if(!a.includes("arrows"))if("both"===u)n.push({attr:n[c.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),c.arrows.to=n.length-1,n.push({attr:n[c.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),c.arrows.from=n.length-1;else if("forward"===u)n.push({attr:n[c.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),c.arrows.to=n.length-1;else if("back"===u)n.push({attr:n[c.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),c.arrows.from=n.length-1;else if("none"===u)n.push({attr:n[c.dir].attr,name:"arrows",value:""}),c.arrows.to=n.length-1;else throw tt("Invalid dir type \""+u+"\"");var p,h;if("both"===u)c.arrows.to&&c.arrows.from?(h=n[c.arrows.to].value.to.type,p=n[c.arrows.from].value.from.type,n[c.arrows.to]={attr:n[c.arrows.to].attr,name:n[c.arrows.to].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}},n.splice(c.arrows.from,1)):c.arrows.to?(h=n[c.arrows.to].value.to.type,p="arrow",n[c.arrows.to]={attr:n[c.arrows.to].attr,name:n[c.arrows.to].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}}):c.arrows.from&&(h="arrow",p=n[c.arrows.from].value.from.type,n[c.arrows.from]={attr:n[c.arrows.from].attr,name:n[c.arrows.from].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}});else if("back"===u)c.arrows.to&&c.arrows.from?(h="",p=n[c.arrows.from].value.from.type,n[c.arrows.from]={attr:n[c.arrows.from].attr,name:n[c.arrows.from].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}}):c.arrows.to?(h="",p="arrow",c.arrows.from=c.arrows.to,n[c.arrows.from]={attr:n[c.arrows.from].attr,name:n[c.arrows.from].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}}):c.arrows.from&&(h="",p=n[c.arrows.from].value.from.type,n[c.arrows.to]={attr:n[c.arrows.from].attr,name:n[c.arrows.from].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}}),n[c.arrows.from]={attr:n[c.arrows.from].attr,name:n[c.arrows.from].name,value:{from:{enabled:!0,type:n[c.arrows.from].value.from.type}}};else if("none"===u){var m;m=c.arrows.to?c.arrows.to:c.arrows.from,n[m]={attr:n[m].attr,name:n[m].name,value:""}}else if("forward"===u)c.arrows.to&&c.arrows.from?(h=n[c.arrows.to].value.to.type,p="",n[c.arrows.to]={attr:n[c.arrows.to].attr,name:n[c.arrows.to].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}}):c.arrows.to?(h=n[c.arrows.to].value.to.type,p="",n[c.arrows.to]={attr:n[c.arrows.to].attr,name:n[c.arrows.to].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}}):c.arrows.from&&(h="arrow",p="",c.arrows.to=c.arrows.from,n[c.arrows.to]={attr:n[c.arrows.to].attr,name:n[c.arrows.to].name,value:{to:{enabled:!0,type:h},from:{enabled:!0,type:p}}}),n[c.arrows.to]={attr:n[c.arrows.to].attr,name:n[c.arrows.to].name,value:{to:{enabled:!0,type:n[c.arrows.to].value.to.type}}};else throw tt("Invalid dir type \""+u+"\"");n.splice(c.dir,1)}var g;if(a.includes("penwidth")){var y=[];for(g=n.length,d=0;d<g;d++)"width"!==n[d].name&&("penwidth"===n[d].name&&(n[d].name="width"),y.push(n[d]));n=y}for(g=n.length,d=0;d<g;d++)We(n[d].attr,n[d].name,n[d].value);return e}function tt(e){return new SyntaxError(e+", got \""+ot(zn,30)+"\" (char "+Fn+")")}function ot(e,t){return e.length<=t?e:e.substr(0,27)+"..."}function nt(e,t,o){Array.isArray(e)?e.forEach(function(e){Array.isArray(t)?t.forEach(function(t){o(e,t)}):o(e,t)}):Array.isArray(t)?t.forEach(function(t){o(e,t)}):o(e,t)}function it(e,t,o){for(var n=t.split("."),a=n.pop(),d=e,s=0,r;s<n.length;s++)r=n[s],r in d||(d[r]={}),d=d[r];return d[a]=o,e}function at(e,t){var o={};for(var n in e)if(e.hasOwnProperty(n)){var i=t[n];Array.isArray(i)?i.forEach(function(t){it(o,t,e[n])}):"string"==typeof i?it(o,i,e[n]):it(o,n,e[n])}return o}function dt(e,t){var o={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};null!=t&&(null!=t.fixed&&(o.nodes.fixed=t.fixed),null!=t.parseColor&&(o.nodes.parseColor=t.parseColor),null!=t.inheritColor&&(o.edges.inheritColor=t.inheritColor));var n=e.edges,i=n.map(function(e){var t={from:e.source,id:e.id,to:e.target};return null!=e.attributes&&(t.attributes=e.attributes),null!=e.label&&(t.label=e.label),null!=e.attributes&&null!=e.attributes.title&&(t.title=e.attributes.title),"Directed"===e.type&&(t.arrows="to"),e.color&&!1===o.edges.inheritColor&&(t.color=e.color),t}),a=e.nodes.map(function(e){var t={id:e.id,fixed:o.nodes.fixed&&null!=e.x&&null!=e.y};return null!=e.attributes&&(t.attributes=e.attributes),null!=e.label&&(t.label=e.label),null!=e.size&&(t.size=e.size),null!=e.attributes&&null!=e.attributes.title&&(t.title=e.attributes.title),null!=e.title&&(t.title=e.title),null!=e.x&&(t.x=e.x),null!=e.y&&(t.y=e.y),null!=e.color&&(!0===o.nodes.parseColor?t.color=e.color:t.color={background:e.color,border:e.color,highlight:{background:e.color,border:e.color},hover:{background:e.color,border:e.color}}),t});return{nodes:a,edges:i}}function st(){return st=Object.assign||function(e){for(var t=1,o;t<arguments.length;t++)for(var n in o=arguments[t],o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n]);return e},st.apply(this,arguments)}function rt(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function lt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ct(e,t){for(var o=t[0].toUpperCase()+t.slice(1),n=0,a,d;n<Zn.length;){if(a=Zn[n],d=a?a+o:t,d in e)return d;n++}}function ut(){if(!ti)return!1;var e={},t=Jn.CSS&&Jn.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(o){return e[o]=!t||Jn.CSS.supports("touch-action",o)}),e}function pt(e,t,o){if(e)if(e.forEach)e.forEach(t,o);else if(void 0!==e.length)for(n=0;n<e.length;)t.call(o,e[n],n,e),n++;else for(var n in e)e.hasOwnProperty(n)&&t.call(o,e[n],n,e)}function ht(e,t){return"function"===typeof e?e.apply(t?t[0]||void 0:void 0,t):e}function mt(e,t){return-1<e.indexOf(t)}function gt(e){if(mt(e,"none"))return"none";var t=mt(e,"pan-x"),o=mt(e,"pan-y");return t&&o?"none":t||o?t?"pan-x":"pan-y":mt(e,"manipulation")?"manipulation":"auto"}function yt(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function ft(e){var t=e.length;if(1===t)return{x:Kn(e[0].clientX),y:Kn(e[0].clientY)};for(var o=0,n=0,a=0;a<t;)o+=e[a].clientX,n+=e[a].clientY,a++;return{x:Kn(o/t),y:Kn(n/t)}}function bt(e){for(var t=[],o=0;o<e.pointers.length;)t[o]={clientX:Kn(e.pointers[o].clientX),clientY:Kn(e.pointers[o].clientY)},o++;return{timeStamp:$n(),pointers:t,center:ft(t),deltaX:e.deltaX,deltaY:e.deltaY}}function _t(e,t,o){o||(o=Oi);var n=t[o[0]]-e[o[0]],i=t[o[1]]-e[o[1]];return mo(n*n+i*i)}function vt(e,t,o){o||(o=Oi);var n=t[o[0]]-e[o[0]],i=t[o[1]]-e[o[1]];return 180*ho(i,n)/po}function kt(e,t){return e===t?1:Qn(e)>=Qn(t)?0>e?2:4:0>t?8:16}function wt(e,t){var o=t.center,n=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===1||a.eventType===4)&&(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},n=e.offsetDelta={x:o.x,y:o.y}),t.deltaX=i.x+(o.x-n.x),t.deltaY=i.y+(o.y-n.y)}function xt(e,t,o){return{x:t/e||0,y:o/e||0}}function St(e,t){return _t(t[0],t[1],Di)/_t(e[0],e[1],Di)}function Ot(e,t){return vt(t[1],t[0],Di)+vt(e[1],e[0],Di)}function Dt(e,t){var o=e.lastInterval||t,n=t.timeStamp-o.timeStamp,i,a,d,s;if(t.eventType!==8&&(n>25||o.velocity===void 0)){var r=t.deltaX-o.deltaX,l=t.deltaY-o.deltaY,c=xt(n,r,l);a=c.x,d=c.y,i=Qn(c.x)>Qn(c.y)?c.x:c.y,s=kt(r,l),e.lastInterval=t}else i=o.velocity,a=o.velocityX,d=o.velocityY,s=o.direction;t.velocity=i,t.velocityX=a,t.velocityY=d,t.direction=s}function Tt(e,t){var o=e.session,n=t.pointers,i=n.length;o.firstInput||(o.firstInput=bt(t)),1<i&&!o.firstMultiple?o.firstMultiple=bt(t):1===i&&(o.firstMultiple=!1);var a=o.firstInput,d=o.firstMultiple,s=d?d.center:a.center,r=t.center=ft(n);t.timeStamp=$n(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=vt(s,r),t.distance=_t(s,r),wt(o,t),t.offsetDirection=kt(t.deltaX,t.deltaY);var l=xt(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=Qn(l.x)>Qn(l.y)?l.x:l.y,t.scale=d?St(d.pointers,n):1,t.rotation=d?Ot(d.pointers,n):0,t.maxPointers=o.prevInput?t.pointers.length>o.prevInput.maxPointers?t.pointers.length:o.prevInput.maxPointers:t.pointers.length,Dt(o,t);var c=e.element;yt(t.srcEvent.target,c)&&(c=t.srcEvent.target),t.target=c}function Ct(e,t,o){var n=o.pointers.length,i=o.changedPointers.length,a=t&1&&0==n-i;o.isFirst=!!a,o.isFinal=!!(t&12&&0==n-i),a&&(e.session={}),o.eventType=t,Tt(e,o),e.emit("hammer.input",o),e.recognize(o),e.session.prevInput=o}function Et(e){return e.trim().split(/\s+/g)}function Mt(e,t,o){pt(Et(t),function(t){e.addEventListener(t,o,!1)})}function It(e,t,o){pt(Et(t),function(t){e.removeEventListener(t,o,!1)})}function Pt(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||window}function Ft(e,t,o){if(e.indexOf&&!o)return e.indexOf(t);for(var n=0;n<e.length;){if(o&&e[n][o]==t||!o&&e[n]===t)return n;n++}return-1}function Yt(e){return Array.prototype.slice.call(e,0)}function zt(e,t,o){for(var n=[],a=[],d=0,s;d<e.length;)s=t?e[d][t]:e[d],0>Ft(a,s)&&n.push(e[d]),a[d]=s,d++;return o&&(t?n=n.sort(function(e,o){return e[t]>o[t]}):n=n.sort()),n}function Nt(e,t){var o=Yt(e.touches),n=this.targetIds;if(3&t&&1===o.length)return n[o[0].identifier]=!0,[o,o];var a=Yt(e.changedTouches),d=[],s=this.target,r,l;if(l=o.filter(function(e){return yt(e.target,s)}),1===t)for(r=0;r<l.length;)n[l[r].identifier]=!0,r++;for(r=0;r<a.length;)n[a[r].identifier]&&d.push(a[r]),12&t&&delete n[a[r].identifier],r++;return d.length?[zt(l.concat(d),"identifier",!0),d]:void 0}function Rt(e){var t=e.changedPointers,o=t[0];if(o.identifier===this.primaryTouch){var n={x:o.clientX,y:o.clientY},a=this.lastTouches;this.lastTouches.push(n);var d=function(){var e=a.indexOf(n);-1<e&&a.splice(e,1)};setTimeout(d,2500)}}function Bt(e,t){e&1?(this.primaryTouch=t.changedPointers[0].identifier,Rt.call(this,t)):e&12&&Rt.call(this,t)}function Ht(e){for(var o=e.srcEvent.clientX,n=e.srcEvent.clientY,a=0;a<this.lastTouches.length;a++){var d=this.lastTouches[a],t=uo(o-d.x),s=uo(n-d.y);if(t<=25&&s<=25)return!0}return!1}function Lt(e){var t=e.options.inputClass,o;return o=t?t:li?Fi:ci?zi:ri?Bi:Ri,new o(e,Ct)}function At(e,t,o){return!!Array.isArray(e)&&(pt(e,o[t],o),!0)}function Wt(){return Gi++}function jt(e,t){var o=t.manager;return o?o.get(e):e}function Ut(e){if(e&16)return"cancel";return 8&e?"end":4&e?"move":2&e?"start":""}function Vt(e,t){var o=e.element;if(o.style){var n;pt(e.options.cssProps,function(i,a){n=ct(o.style,a),t?(e.oldCssProps[n]=o.style[n],o.style[n]=i):o.style[n]=e.oldCssProps[n]||""}),t||(e.oldCssProps={})}}function Gt(e,t){var o=document.createEvent("Event");o.initEvent(e,!0,!0),o.gesture=t,t.target.dispatchEvent(o)}function qt(e,t){var o=Yt(e.touches),n=Yt(e.changedTouches);return 12&t&&(o=zt(o.concat(n),"identifier",!0)),[o,n]}function Zt(e){if(e===16)return"down";return 8===e?"up":2===e?"left":4===e?"right":""}function Xt(t,o,n){return function(){var i=new Error("get-stack-trace"),e=i&&i.stack?i.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=window.console&&(window.console.warn||window.console.log);return a&&a.call(window.console,"DEPRECATED METHOD: "+o+"\n"+n+" AT \n",e),t.apply(this,arguments)}}function Kt(e,t,o){var n=t.prototype,i;i=e.prototype=Object.create(n),i.constructor=e,i._super=n,o&&qn(i,o)}function Qt(e,t){return function(){return e.apply(t,arguments)}}function $t(e){this.active=!1,this.dom={container:e},this.dom.overlay=document.createElement("div"),this.dom.overlay.className="vis-overlay",this.dom.container.appendChild(this.dom.overlay),this.hammer=la(this.dom.overlay),this.hammer.on("tap",this._onTapOverlay.bind(this));var t=this;["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach(function(e){t.hammer.on(e,function(e){e.stopPropagation()})}),document&&document.body&&(this.onClick=function(o){Jt(o.target,e)||t.deactivate()},document.body.addEventListener("click",this.onClick)),this.keycharm!==void 0&&this.keycharm.destroy(),this.keycharm=Un(),this.escListener=this.deactivate.bind(this)}function Jt(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function eo(e,t){for(var o=0,n;o<t.length;o++)n=t[o],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function to(e,t){var o=[],n=!0,i=!1,a=void 0;try{for(var d=e[Symbol.iterator](),s;!(n=(s=d.next()).done)&&(o.push(s.value),!(t&&o.length===t));n=!0);}catch(e){i=!0,a=e}finally{try{n||null==d["return"]||d["return"]()}finally{if(i)throw a}}return o}function oo(e,t){return fa(e)||ba(e,t)||_a()}function no(){var e;window!==void 0&&(e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),window.requestAnimationFrame=void 0===e?function(e){e()}:e}function io(e,t,o){var n=this;if(!(this instanceof io))throw new SyntaxError("Constructor must be called with the new operator");this.options={},this.defaultOptions={locale:"en",locales:ua,clickToUse:!1},Wo.extend(this.options,this.defaultOptions),this.body={container:e,nodes:{},nodeIndices:[],edges:{},edgeIndices:[],emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this),once:this.once.bind(this)},eventListeners:{onTap:function(){},onTouch:function(){},onDoubleTap:function(){},onHold:function(){},onDragStart:function(){},onDrag:function(){},onDragEnd:function(){},onMouseWheel:function(){},onPinch:function(){},onMouseMove:function(){},onRelease:function(){},onContext:function(){}},data:{nodes:null,edges:null},functions:{createNode:function(){},createEdge:function(){},getPointer:function(){}},modules:{},view:{scale:1,translation:{x:0,y:0}}},this.bindEventListeners(),this.images=new ga(function(){return n.body.emitter.emit("_requestRedraw")}),this.groups=new ya,this.canvas=new Ud(this.body),this.selectionHandler=new Xd(this.body,this.canvas),this.interactionHandler=new Zd(this.body,this.canvas,this.selectionHandler),this.view=new Vd(this.body,this.canvas),this.renderer=new Rd(this.body,this.canvas),this.physics=new Fd(this.body),this.layoutEngine=new ns(this.body),this.clustering=new Nd(this.body),this.manipulation=new is(this.body,this.canvas,this.selectionHandler),this.nodesHandler=new od(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new Sd(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new _s(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(o),this.setData(t)}for(var bo=t,_o=o,vo=n,ko=a,wo=d,xo="undefined"==typeof globalThis?"undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?{}:self:global:window:globalThis,So=r(function(e){function t(e){return t="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},t(e)}function o(n){return e.exports="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?o=function(e){return t(e)}:o=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)},o(n)}e.exports=o}),Oo=r(function(e){(function(t,o){e.exports=o()})(xo,function(){function t(){return Lt.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function i(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function a(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function r(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function l(e,t){var o=[],n;for(n=0;n<e.length;++n)o.push(t(e[n],n));return o}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){for(var o in t)c(t,o)&&(e[o]=t[o]);return c(t,"toString")&&(e.toString=t.toString),c(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,o,n){return Ke(e,t,o,n,!0).utc()}function h(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function g(e){return null==e._pf&&(e._pf=h()),e._pf}function y(e){if(null==e._isValid){var t=g(e),o=At.call(t.parsedDateParts,function(e){return null!=e}),n=!isNaN(e._d.getTime())&&0>t.overflow&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&o);if(e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null==Object.isFrozen||!Object.isFrozen(e))e._isValid=n;else return n}return e._isValid}function f(e){var t=p(NaN);return null==e?g(t).userInvalidated=!0:u(g(t),e),t}function b(e,t){var o,n,d;if(a(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),a(t._i)||(e._i=t._i),a(t._f)||(e._f=t._f),a(t._l)||(e._l=t._l),a(t._strict)||(e._strict=t._strict),a(t._tzm)||(e._tzm=t._tzm),a(t._isUTC)||(e._isUTC=t._isUTC),a(t._offset)||(e._offset=t._offset),a(t._pf)||(e._pf=g(t)),a(t._locale)||(e._locale=t._locale),0<Wt.length)for(o=0;o<Wt.length;o++)n=Wt[o],d=t[n],a(d)||(e[n]=d);return e}function _(e){b(this,e),this._d=new Date(null==e._d?NaN:e._d.getTime()),this.isValid()||(this._d=new Date(NaN)),!1===jt&&(jt=!0,t.updateOffset(this),jt=!1)}function v(e){return e instanceof _||null!=e&&null!=e._isAMomentObject}function k(e){return 0>e?co(e)||0:go(e)}function w(e){var t=+e,o=0;return 0!=t&&isFinite(t)&&(o=k(t)),o}function x(e,t,o){var n=fo(e.length,t.length),a=uo(e.length-t.length),d=0,s;for(s=0;s<n;s++)(o&&e[s]!==t[s]||!o&&w(e[s])!==w(t[s]))&&d++;return d+a}function S(e){!1===t.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function O(e,o){var n=!0;return u(function(){if(null!=t.deprecationHandler&&t.deprecationHandler(null,e),n){for(var a=[],d=0,s;d<arguments.length;d++){if(s="","object"==typeof arguments[d]){for(var r in s+="\n["+d+"] ",arguments[0])s+=r+": "+arguments[0][r]+", ";s=s.slice(0,-2)}else s=arguments[d];a.push(s)}S(e+"\nArguments: "+Array.prototype.slice.call(a).join("")+"\n"+new Error().stack),n=!1}return o.apply(this,arguments)},o)}function D(e,o){null!=t.deprecationHandler&&t.deprecationHandler(e,o),Ut[e]||(S(o),Ut[e]=!0)}function T(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function C(e){var t,o;for(o in e)t=e[o],T(t)?this[o]=t:this["_"+o]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function E(e,t){var o=u({},e),i;for(i in t)c(t,i)&&(n(e[i])&&n(t[i])?(o[i]={},u(o[i],e[i]),u(o[i],t[i])):null==t[i]?delete o[i]:o[i]=t[i]);for(i in e)c(e,i)&&!c(t,i)&&n(e[i])&&(o[i]=u({},o[i]));return o}function M(e){null!=e&&this.set(e)}function I(e,t){var o=e.toLowerCase();qt[o]=qt[o+"s"]=qt[t]=e}function P(e){return"string"==typeof e?qt[e]||qt[e.toLowerCase()]:void 0}function F(e){var t={},o,n;for(n in e)c(e,n)&&(o=P(n),o&&(t[o]=e[n]));return t}function Y(e,t){Zt[e]=t}function z(e){var t=[];for(var o in e)t.push({unit:o,priority:Zt[o]});return t.sort(function(e,t){return e.priority-t.priority}),t}function N(e,t,o){var n=""+uo(e),i=t-n.length;return(0<=e?o?"+":"":"-")+lo(10,yo(0,i)).toString().substr(1)+n}function R(e,t,o,n){var i=n;"string"==typeof n&&(i=function(){return this[n]()}),e&&($t[e]=i),t&&($t[t[0]]=function(){return N(i.apply(this,arguments),t[1],t[2])}),o&&($t[o]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function B(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function H(e){var t=e.match(Xt),o,n;for(o=0,n=t.length;o<n;o++)t[o]=$t[t[o]]?$t[t[o]]:B(t[o]);return function(o){var a="",d;for(d=0;d<n;d++)a+=T(t[d])?t[d].call(o,e):t[d];return a}}function L(e,t){return e.isValid()?(t=A(t,e.localeData()),Qt[t]=Qt[t]||H(t),Qt[t](e)):e.localeData().invalidDate()}function A(e,t){function o(e){return t.longDateFormat(e)||e}var n=5;for(Kt.lastIndex=0;0<=n&&Kt.test(e);)e=e.replace(Kt,o),Kt.lastIndex=0,n-=1;return e}function W(e,t,o){So[e]=T(t)?t:function(e){return e&&o?o:t}}function j(e,t){return c(So,e)?So[e](t._strict,t._locale):new RegExp(U(e))}function U(e){return V(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,o,n,i){return t||o||n||i}))}function V(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function G(e,t){var o=t,n;for("string"==typeof e&&(e=[e]),d(t)&&(o=function(e,o){o[t]=w(e)}),n=0;n<e.length;n++)Oo[e[n]]=o}function q(e,t){G(e,function(e,o,n,i){n._w=n._w||{},t(e,n._w,n,i)})}function Z(e,t,o){null!=t&&c(Oo,e)&&Oo[e](t,o._a,o,e)}function X(e){return K(e)?366:365}function K(e){return 0==e%4&&0!=e%100||0==e%400}function Q(e,o){return function(n){return null==n?$(this,e):(J(this,e,n),t.updateOffset(this,o),this)}}function $(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function J(e,t,o){e.isValid()&&!isNaN(o)&&("FullYear"===t&&K(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](o,e.month(),oe(o,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](o))}function ee(e,t){if("object"==typeof e){e=F(e);for(var o=z(e),n=0;n<o.length;n++)this[o[n].unit](e[o[n].unit])}else if(e=P(e),T(this[e]))return this[e](t);return this}function te(e,t){return(e%t+t)%t}function oe(e,t){if(isNaN(e)||isNaN(t))return NaN;var o=te(t,12);return e+=(t-o)/12,1===o?K(e)?29:28:31-o%7%2}function ne(e,t,o){var n=e.toLocaleLowerCase(),a,d,s;if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],a=0;12>a;++a)s=p([2e3,a]),this._shortMonthsParse[a]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[a]=this.months(s,"").toLocaleLowerCase();return o?"MMM"===t?(d=Fo.call(this._shortMonthsParse,n),-1===d?null:d):(d=Fo.call(this._longMonthsParse,n),-1===d?null:d):"MMM"===t?(d=Fo.call(this._shortMonthsParse,n),-1!==d)?d:(d=Fo.call(this._longMonthsParse,n),-1===d?null:d):(d=Fo.call(this._longMonthsParse,n),-1!==d)?d:(d=Fo.call(this._shortMonthsParse,n),-1===d?null:d)}function ie(e,t,o){var n,a,d;if(this._monthsParseExact)return ne.call(this,e,t,o);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;12>n;n++){if(a=p([2e3,n]),o&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),o||this._monthsParse[n]||(d="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[n]=new RegExp(d.replace(".",""),"i")),o&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(o&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!o&&this._monthsParse[n].test(e))return n}}function ae(e,t){var o;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=w(t);else if(t=e.localeData().monthsParse(t),!d(t))return e;return o=fo(e.date(),oe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,o),e}function de(e){return null==e?$(this,"Month"):(ae(this,e),t.updateOffset(this,!0),this)}function se(){function e(e,t){return t.length-e.length}var t=[],o=[],n=[],a,d;for(a=0;12>a;a++)d=p([2e3,a]),t.push(this.monthsShort(d,"")),o.push(this.months(d,"")),n.push(this.months(d,"")),n.push(this.monthsShort(d,""));for(t.sort(e),o.sort(e),n.sort(e),a=0;12>a;a++)t[a]=V(t[a]),o[a]=V(o[a]);for(a=0;24>a;a++)n[a]=V(n[a]);this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function re(e,t,o,n,i,a,d){var s;return 100>e&&0<=e?(s=new Date(e+400,t,o,n,i,a,d),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,o,n,i,a,d),s}function le(e){var t;if(100>e&&0<=e){var o=Array.prototype.slice.call(arguments);o[0]=e+400,t=new Date(Date.UTC.apply(null,o)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function ce(e,t,o){var n=7+t-o,i=(7+le(e,0,n).getUTCDay()-t)%7;return-i+n-1}function ue(e,t,o,n,i){var a=ce(e,n,i),d=1+7*(t-1)+(7+o-n)%7+a,s,r;return 0>=d?(s=e-1,r=X(s)+d):d>X(e)?(s=e+1,r=d-X(e)):(s=e,r=d),{year:s,dayOfYear:r}}function pe(e,t,o){var n=ce(e.year(),t,o),i=go((e.dayOfYear()-n-1)/7)+1,a,d;return 1>i?(d=e.year()-1,a=i+he(d,t,o)):i>he(e.year(),t,o)?(a=i-he(e.year(),t,o),d=e.year()+1):(d=e.year(),a=i),{week:a,year:d}}function he(e,t,o){var n=ce(e,t,o),i=ce(e+1,t,o);return(X(e)-n+i)/7}function me(e,t){return"string"==typeof e?isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10):e}function ge(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function ye(e,t){return e.slice(t,7).concat(e.slice(0,t))}function fe(e,t,o){var n=e.toLocaleLowerCase(),a,d,s;if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],a=0;7>a;++a)s=p([2e3,1]).day(a),this._minWeekdaysParse[a]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[a]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[a]=this.weekdays(s,"").toLocaleLowerCase();return o?"dddd"===t?(d=Fo.call(this._weekdaysParse,n),-1===d?null:d):"ddd"===t?(d=Fo.call(this._shortWeekdaysParse,n),-1===d?null:d):(d=Fo.call(this._minWeekdaysParse,n),-1===d?null:d):"dddd"===t?(d=Fo.call(this._weekdaysParse,n),-1!==d)?d:(d=Fo.call(this._shortWeekdaysParse,n),-1!==d)?d:(d=Fo.call(this._minWeekdaysParse,n),-1===d?null:d):"ddd"===t?(d=Fo.call(this._shortWeekdaysParse,n),-1!==d)?d:(d=Fo.call(this._weekdaysParse,n),-1!==d)?d:(d=Fo.call(this._minWeekdaysParse,n),-1===d?null:d):(d=Fo.call(this._minWeekdaysParse,n),-1!==d)?d:(d=Fo.call(this._weekdaysParse,n),-1!==d)?d:(d=Fo.call(this._shortWeekdaysParse,n),-1===d?null:d)}function be(e,t,o){var n,a,d;if(this._weekdaysParseExact)return fe.call(this,e,t,o);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;7>n;n++){if(a=p([2e3,1]).day(n),o&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(d="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[n]=new RegExp(d.replace(".",""),"i")),o&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(o&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(o&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!o&&this._weekdaysParse[n].test(e))return n}}function _e(){function e(e,t){return t.length-e.length}var t=[],o=[],n=[],a=[],d,s,r,l,c;for(d=0;7>d;d++)s=p([2e3,1]).day(d),r=this.weekdaysMin(s,""),l=this.weekdaysShort(s,""),c=this.weekdays(s,""),t.push(r),o.push(l),n.push(c),a.push(r),a.push(l),a.push(c);for(t.sort(e),o.sort(e),n.sort(e),a.sort(e),d=0;7>d;d++)o[d]=V(o[d]),n[d]=V(n[d]),a[d]=V(a[d]);this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function ve(){return this.hours()%12||12}function ke(e,t){R(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function we(e,t){return t._meridiemParse}function xe(e){return e?e.toLowerCase().replace("_","-"):e}function Se(e){for(var t=0,o,n,a,d;t<e.length;){for(d=xe(e[t]).split("-"),o=d.length,n=xe(e[t+1]),n=n?n.split("-"):null;0<o;){if(a=Oe(d.slice(0,o).join("-")),a)return a;if(n&&n.length>=o&&x(d,n,!0)>=o-1)break;o--}t++}return Ko}function Oe(t){var o=null;if(!Lo[t]&&!0&&e&&e.exports)try{o=Ko._abbr;s("./locale/"+t),De(o)}catch(t){}return Lo[t]}function De(e,t){var o;return e&&(o=a(t)?Ce(e):Te(e,t),o?Ko=o:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Ko._abbr}function Te(e,t){if(null!==t){var o=Ho,n;if(t.abbr=e,null!=Lo[e])D("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),o=Lo[e]._config;else if(null!=t.parentLocale)if(null!=Lo[t.parentLocale])o=Lo[t.parentLocale]._config;else if(n=Oe(t.parentLocale),null!=n)o=n._config;else return Ao[t.parentLocale]||(Ao[t.parentLocale]=[]),Ao[t.parentLocale].push({name:e,config:t}),null;return Lo[e]=new M(E(o,t)),Ao[e]&&Ao[e].forEach(function(e){Te(e.name,e.config)}),De(e),Lo[e]}return delete Lo[e],null}function Ce(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Ko;if(!o(e)){if(t=Oe(e),t)return t;e=[e]}return Se(e)}function Ee(){return Vt(Lo)}function Me(e){var t=e._a,o;return t&&-2===g(e).overflow&&(o=0>t[1]||11<t[1]?1:1>t[2]||t[2]>oe(t[0],t[1])?2:0>t[3]||24<t[3]||24===t[3]&&(0!==t[4]||0!==t[5]||0!==t[6])?3:0>t[4]||59<t[4]?4:0>t[5]||59<t[5]?5:0>t[6]||999<t[6]?6:-1,g(e)._overflowDayOfYear&&(0>o||2<o)&&(o=2),g(e)._overflowWeeks&&-1===o&&(o=7),g(e)._overflowWeekday&&-1===o&&(o=8),g(e).overflow=o),e}function Ie(e,t,o){return null==e?null==t?o:t:e}function Pe(e){var o=new Date(t.now());return e._useUTC?[o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()]:[o.getFullYear(),o.getMonth(),o.getDate()]}function Fe(e){var t=[],o,n,a,d,s;if(!e._d){for(a=Pe(e),e._w&&null==e._a[2]&&null==e._a[1]&&Ye(e),null!=e._dayOfYear&&(s=Ie(e._a[0],a[0]),(e._dayOfYear>X(s)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=le(s,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),o=0;3>o&&null==e._a[o];++o)e._a[o]=t[o]=a[o];for(;7>o;o++)e._a[o]=t[o]=null==e._a[o]?2===o?1:0:e._a[o];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?le:re).apply(null,t),d=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&"undefined"!=typeof e._w.d&&e._w.d!==d&&(g(e).weekdayMismatch=!0)}}function Ye(e){var t,o,n,i,a,d,s,r;if(t=e._w,null!=t.GG||null!=t.W||null!=t.E)a=1,d=4,o=Ie(t.GG,e._a[0],pe(Qe(),1,4).year),n=Ie(t.W,1),i=Ie(t.E,1),(1>i||7<i)&&(r=!0);else{a=e._locale._week.dow,d=e._locale._week.doy;var l=pe(Qe(),a,d);o=Ie(t.gg,e._a[0],l.year),n=Ie(t.w,l.week),null==t.d?null==t.e?i=a:(i=t.e+a,(0>t.e||6<t.e)&&(r=!0)):(i=t.d,(0>i||6<i)&&(r=!0))}1>n||n>he(o,a,d)?g(e)._overflowWeeks=!0:null==r?(s=ue(o,n,i,a,d),e._a[0]=s.year,e._dayOfYear=s.dayOfYear):g(e)._overflowWeekday=!0}function ze(e){var t=e._i,o=Wo.exec(t)||jo.exec(t),n,a,d,s,r,c;if(o){for(g(e).iso=!0,n=0,a=Vo.length;n<a;n++)if(Vo[n][1].exec(o[1])){s=Vo[n][0],d=!1!==Vo[n][2];break}if(null==s)return void(e._isValid=!1);if(o[3]){for(n=0,a=Go.length;n<a;n++)if(Go[n][1].exec(o[3])){r=(o[2]||" ")+Go[n][0];break}if(null==r)return void(e._isValid=!1)}if(!d&&null!=r)return void(e._isValid=!1);if(o[4])if(Uo.exec(o[4]))c="Z";else return void(e._isValid=!1);e._f=s+(r||"")+(c||""),je(e)}else e._isValid=!1}function Ne(e,t,o,n,i,a){var d=[Re(e),zo.indexOf(t),parseInt(o,10),parseInt(n,10),parseInt(i,10)];return a&&d.push(parseInt(a,10)),d}function Re(e){var t=parseInt(e,10);return 49>=t?2e3+t:999>=t?1900+t:t}function Be(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function He(e,t,o){if(e){var n=No.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(n!==i)return g(o).weekdayMismatch=!0,o._isValid=!1,!1}return!0}function Le(e,t,o){if(e)return Xo[e];if(t)return 0;var n=parseInt(o,10),i=n%100;return 60*((n-i)/100)+i}function Ae(e){var t=Zo.exec(Be(e._i));if(t){var o=Ne(t[4],t[3],t[2],t[5],t[6],t[7]);if(!He(t[1],o,e))return;e._a=o,e._tzm=Le(t[8],t[9],t[10]),e._d=le.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),g(e).rfc2822=!0}else e._isValid=!1}function We(e){var o=qo.exec(e._i);if(null!==o)return void(e._d=new Date(+o[1]));if(ze(e),!1===e._isValid)delete e._isValid;else return;if(Ae(e),!1===e._isValid)delete e._isValid;else return;t.createFromInputFallback(e)}function je(e){if(e._f===t.ISO_8601)return void ze(e);if(e._f===t.RFC_2822)return void Ae(e);e._a=[],g(e).empty=!0;var o=""+e._i,n=o.length,a=0,d,s,r,l,c;for(r=A(e._f,e._locale).match(Xt)||[],d=0;d<r.length;d++)l=r[d],s=(o.match(j(l,e))||[])[0],s&&(c=o.substr(0,o.indexOf(s)),0<c.length&&g(e).unusedInput.push(c),o=o.slice(o.indexOf(s)+s.length),a+=s.length),$t[l]?(s?g(e).empty=!1:g(e).unusedTokens.push(l),Z(l,s,e)):e._strict&&!s&&g(e).unusedTokens.push(l);g(e).charsLeftOver=n-a,0<o.length&&g(e).unusedInput.push(o),12>=e._a[3]&&!0===g(e).bigHour&&0<e._a[3]&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[3]=Ue(e._locale,e._a[3],e._meridiem),Fe(e),Me(e)}function Ue(e,t,o){var n;return null==o?t:null==e.meridiemHour?null==e.isPM?t:(n=e.isPM(o),n&&12>t&&(t+=12),n||12!==t||(t=0),t):e.meridiemHour(t,o)}function Ve(e){var t,o,n,a,d;if(0===e._f.length)return g(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;a<e._f.length;a++)(d=0,t=b({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],je(t),!!y(t))&&(d+=g(t).charsLeftOver,d+=10*g(t).unusedTokens.length,g(t).score=d,(null==n||d<n)&&(n=d,o=t));u(e,o||t)}function Ge(e){if(!e._d){var t=F(e._i);e._a=l([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Fe(e)}}function qe(e){var t=new _(Me(Ze(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Ze(e){var t=e._i,n=e._f;return(e._locale=e._locale||Ce(e._l),null===t||void 0===n&&""===t)?f({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),v(t))?new _(Me(t)):(r(t)?e._d=t:o(n)?Ve(e):n?je(e):Xe(e),y(e)||(e._d=null),e)}function Xe(e){var i=e._i;a(i)?e._d=new Date(t.now()):r(i)?e._d=new Date(i.valueOf()):"string"==typeof i?We(e):o(i)?(e._a=l(i.slice(0),function(e){return parseInt(e,10)}),Fe(e)):n(i)?Ge(e):d(i)?e._d=new Date(i):t.createFromInputFallback(e)}function Ke(e,t,a,d,s){var r={};return(!0===a||!1===a)&&(d=a,a=void 0),(n(e)&&i(e)||o(e)&&0===e.length)&&(e=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=s,r._l=a,r._i=e,r._f=t,r._strict=d,qe(r)}function Qe(e,t,o,n){return Ke(e,t,o,n,!1)}function $e(e,t){var n,a;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Qe();for(n=t[0],a=1;a<t.length;++a)(!t[a].isValid()||t[a][e](n))&&(n=t[a]);return n}function Je(e){for(var t in e)if(-1===Fo.call(Jo,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var o=!1,n=0;n<Jo.length;++n)if(e[Jo[n]]){if(o)return!1;parseFloat(e[Jo[n]])!==w(e[Jo[n]])&&(o=!0)}return!0}function et(e){var t=F(e),o=t.year||0,n=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,d=t.day||0,s=t.hour||0,r=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=Je(t),this._milliseconds=+c+1e3*l+6e4*r+60*(60*(1e3*s)),this._days=+d+7*a,this._months=+i+3*n+12*o,this._data={},this._locale=Ce(),this._bubble()}function tt(e){return e instanceof et}function ot(e){return 0>e?-1*ro(-1*e):ro(e)}function nt(e,t){R(e,0,0,function(){var e=this.utcOffset(),o="+";return 0>e&&(e=-e,o="-"),o+N(~~(e/60),2)+t+N(~~e%60,2)})}function it(e,t){var o=(t||"").match(e);if(null===o)return null;var n=o[o.length-1]||[],i=(n+"").match(en)||["-",0,0],a=+(60*i[1])+w(i[2]);return 0===a?0:"+"===i[0]?a:-a}function at(e,o){var n,i;return o._isUTC?(n=o.clone(),i=(v(e)||r(e)?e.valueOf():Qe(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),t.updateOffset(n,!1),n):Qe(e).local()}function dt(e){return 15*-ro(e._d.getTimezoneOffset()/15)}function st(){if(!a(this._isDSTShifted))return this._isDSTShifted;var e={};if(b(e,this),e=Ze(e),e._a){var t=e._isUTC?p(e._a):Qe(e._a);this._isDSTShifted=this.isValid()&&0<x(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted}function rt(){return!!this.isValid()&&this._isUTC&&0===this._offset}function lt(e,t){var o=e,n=null,i,a,s;return tt(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:d(e)?(o={},t?o[t]=e:o.milliseconds=e):(n=tn.exec(e))?(i="-"===n[1]?-1:1,o={y:0,d:w(n[2])*i,h:w(n[3])*i,m:w(n[4])*i,s:w(n[5])*i,ms:w(ot(1e3*n[6]))*i}):(n=on.exec(e))?(i="-"===n[1]?-1:1,o={y:ct(n[2],i),M:ct(n[3],i),w:ct(n[4],i),d:ct(n[5],i),h:ct(n[6],i),m:ct(n[7],i),s:ct(n[8],i)}):null==o?o={}:"object"==typeof o&&(("from"in o)||("to"in o))&&(s=pt(Qe(o.from),Qe(o.to)),o={},o.ms=s.milliseconds,o.M=s.months),a=new et(o),tt(e)&&c(e,"_locale")&&(a._locale=e._locale),a}function ct(e,t){var o=e&&parseFloat(e.replace(",","."));return(isNaN(o)?0:o)*t}function ut(e,t){var o={};return o.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(o.months,"M").isAfter(t)&&--o.months,o.milliseconds=+t-+e.clone().add(o.months,"M"),o}function pt(e,t){var o;return e.isValid()&&t.isValid()?(t=at(t,e),e.isBefore(t)?o=ut(e,t):(o=ut(t,e),o.milliseconds=-o.milliseconds,o.months=-o.months),o):{milliseconds:0,months:0}}function ht(e,t){return function(o,n){var i,a;return null===n||isNaN(+n)||(D(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=o,o=n,n=a),o="string"==typeof o?+o:o,i=lt(o,n),mt(this,i,e),this}}function mt(e,o,n,i){var a=o._milliseconds,d=ot(o._days),s=ot(o._months);e.isValid()&&(i=null==i||i,s&&ae(e,$(e,"Month")+s*n),d&&J(e,"Date",$(e,"Date")+d*n),a&&e._d.setTime(e._d.valueOf()+a*n),i&&t.updateOffset(e,d||s))}function gt(e,t){var o=12*(t.year()-e.year())+(t.month()-e.month()),n=e.clone().add(o,"months"),i,a;return 0>t-n?(i=e.clone().add(o-1,"months"),a=(t-n)/(n-i)):(i=e.clone().add(o+1,"months"),a=(t-n)/(i-n)),-(o+a)||0}function yt(e){var t;return void 0===e?this._locale._abbr:(t=Ce(e),null!=t&&(this._locale=t),this)}function ft(){return this._locale}function bt(e,t){return(e%t+t)%t}function _t(e,t,o){return 100>e&&0<=e?new Date(e+400,t,o)-12622780800000:new Date(e,t,o).valueOf()}function vt(e,t,o){return 100>e&&0<=e?Date.UTC(e+400,t,o)-12622780800000:Date.UTC(e,t,o)}function kt(e,t){R(0,[e,e.length],0,t)}function wt(e,t,o,n,i){var a;return null==e?pe(this,n,i).year:(a=he(e,n,i),t>a&&(t=a),xt.call(this,e,t,o,n,i))}function xt(e,t,o,n,i){var a=ue(e,t,o,n,i),d=le(a.year,0,a.dayOfYear);return this.year(d.getUTCFullYear()),this.month(d.getUTCMonth()),this.date(d.getUTCDate()),this}function St(e,t){t[6]=w(1e3*("0."+e))}function Ot(e){return e}function Dt(e,t,o,n){var i=Ce(),a=p().set(n,t);return i[o](a,e)}function Tt(e,t,o){if(d(e)&&(t=e,e=void 0),e=e||"",null!=t)return Dt(e,t,o,"month");var n=[],a;for(a=0;12>a;a++)n[a]=Dt(e,a,o,"month");return n}function Ct(e,t,o,n){"boolean"==typeof e?(d(t)&&(o=t,t=void 0),t=t||""):(t=e,o=t,e=!1,d(t)&&(o=t,t=void 0),t=t||"");var a=Ce(),s=e?a._week.dow:0;if(null!=o)return Dt(t,(o+s)%7,n,"day");var r=[],l;for(l=0;7>l;l++)r[l]=Dt(t,(l+s)%7,n,"day");return r}function Et(e,t,o,n){var i=lt(t,o);return e._milliseconds+=n*i._milliseconds,e._days+=n*i._days,e._months+=n*i._months,e._bubble()}function Mt(e){return 0>e?go(e):co(e)}function It(e){return 4800*e/146097}function Pt(e){return 146097*e/4800}function Ft(e){return function(){return this.as(e)}}function Yt(e){return function(){return this.isValid()?this._data[e]:NaN}}function zt(e,t,o,n,i){return i.relativeTime(t||1,!!o,e,n)}function Nt(e,t,o){var n=lt(e).abs(),i=In(n.as("s")),d=In(n.as("m")),s=In(n.as("h")),r=In(n.as("d")),l=In(n.as("M")),c=In(n.as("y")),u=i<=Pn.ss&&["s",i]||i<Pn.s&&["ss",i]||1>=d&&["m"]||d<Pn.m&&["mm",d]||1>=s&&["h"]||s<Pn.h&&["hh",s]||1>=r&&["d"]||r<Pn.d&&["dd",r]||1>=l&&["M"]||l<Pn.M&&["MM",l]||1>=c&&["y"]||["yy",c];return u[2]=t,u[3]=0<+e,u[4]=o,zt.apply(null,u)}function Rt(e){return void 0===e?In:"function"==typeof e&&(In=e,!0)}function Bt(e){return(0<e)-(0>e)||+e}function Ht(){if(!this.isValid())return this.localeData().invalidDate();var e=Fn(this._milliseconds)/1e3,t=Fn(this._days),o=Fn(this._months),n,i,a;n=k(e/60),i=k(n/60),e%=60,n%=60,a=k(o/12),o%=12;var d=a,r=o,l=t,c=i,u=n,p=e?e.toFixed(3).replace(/\.?0+$/,""):"",s=this.asSeconds();if(!s)return"P0D";var h=0>s?"-":"",m=Bt(this._months)===Bt(s)?"":"-",g=Bt(this._days)===Bt(s)?"":"-",y=Bt(this._milliseconds)===Bt(s)?"":"-";return h+"P"+(d?m+d+"Y":"")+(r?m+r+"M":"")+(l?g+l+"D":"")+(c||u||p?"T":"")+(c?y+c+"H":"")+(u?y+u+"M":"")+(p?y+p+"S":"")}var Lt,At;At=Array.prototype.some?Array.prototype.some:function(e){for(var o=Object(this),t=o.length>>>0,n=0;n<t;n++)if((n in o)&&e.call(this,o[n],n,o))return!0;return!1};var Wt=t.momentProperties=[],jt=!1,Ut={};t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;var Vt=Object.keys?Object.keys:function(e){var t=[],o;for(o in e)c(e,o)&&t.push(o);return t};var Gt=/\d{1,2}/,qt={},Zt={},Xt=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Kt=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Qt={},$t={},Jt=/\d/,eo=/\d\d/,to=/\d{3}/,oo=/\d{4}/,no=/[+-]?\d{6}/,io=/\d\d?/,ao=/\d\d\d\d?/,so=/\d\d\d\d\d\d?/,po=/\d{1,3}/,ho=/\d{1,4}/,mo=/[+-]?\d{1,6}/,bo=/\d+/,_o=/[+-]?\d+/,vo=/Z|[+-]\d\d:?\d\d/gi,ko=/Z|[+-]\d\d(?::?\d\d)?/gi,wo=/[+-]?\d+(\.\d{1,3})?/,xo=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,So={},Oo={},Do=0,To=1,Co=2,Eo=3,Mo=4,Io=5;R("Y",0,0,function(){var e=this.year();return 9999>=e?""+e:"+"+e}),R(0,["YY",2],0,function(){return this.year()%100}),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),I("year","y"),Y("year",1),W("Y",_o),W("YY",io,eo),W("YYYY",ho,oo),W("YYYYY",mo,no),W("YYYYYY",mo,no),G(["YYYYY","YYYYYY"],Do),G("YYYY",function(e,o){o[Do]=2===e.length?t.parseTwoDigitYear(e):w(e)}),G("YY",function(e,o){o[Do]=t.parseTwoDigitYear(e)}),G("Y",function(e,t){t[Do]=parseInt(e,10)}),t.parseTwoDigitYear=function(e){return w(e)+(68<w(e)?1900:2e3)};var Po=Q("FullYear",!0),Fo;Fo=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},R("M",["MM",2],"Mo",function(){return this.month()+1}),R("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),R("MMMM",0,0,function(e){return this.localeData().months(this,e)}),I("month","M"),Y("month",8),W("M",io),W("MM",io,eo),W("MMM",function(e,t){return t.monthsShortRegex(e)}),W("MMMM",function(e,t){return t.monthsRegex(e)}),G(["M","MM"],function(e,t){t[To]=w(e)-1}),G(["MMM","MMMM"],function(e,t,o,n){var i=o._locale.monthsParse(e,n,o._strict);null==i?g(o).invalidMonth=e:t[To]=i});var Yo=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,zo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),I("week","w"),I("isoWeek","W"),Y("week",5),Y("isoWeek",5),W("w",io),W("ww",io,eo),W("W",io),W("WW",io,eo),q(["w","ww","W","WW"],function(e,t,o,n){t[n.substr(0,1)]=w(e)});R("d",0,"do","day"),R("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),R("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),R("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),I("day","d"),I("weekday","e"),I("isoWeekday","E"),Y("day",11),Y("weekday",11),Y("isoWeekday",11),W("d",io),W("e",io),W("E",io),W("dd",function(e,t){return t.weekdaysMinRegex(e)}),W("ddd",function(e,t){return t.weekdaysShortRegex(e)}),W("dddd",function(e,t){return t.weekdaysRegex(e)}),q(["dd","ddd","dddd"],function(e,t,o,n){var i=o._locale.weekdaysParse(e,n,o._strict);null==i?g(o).invalidWeekday=e:t.d=i}),q(["d","e","E"],function(e,t,o,n){t[n]=w(e)});var No=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];R("H",["HH",2],0,"hour"),R("h",["hh",2],0,ve),R("k",["kk",2],0,function(){return this.hours()||24}),R("hmm",0,0,function(){return""+ve.apply(this)+N(this.minutes(),2)}),R("hmmss",0,0,function(){return""+ve.apply(this)+N(this.minutes(),2)+N(this.seconds(),2)}),R("Hmm",0,0,function(){return""+this.hours()+N(this.minutes(),2)}),R("Hmmss",0,0,function(){return""+this.hours()+N(this.minutes(),2)+N(this.seconds(),2)}),ke("a",!0),ke("A",!1),I("hour","h"),Y("hour",13),W("a",we),W("A",we),W("H",io),W("h",io),W("k",io),W("HH",io,eo),W("hh",io,eo),W("kk",io,eo),W("hmm",ao),W("hmmss",so),W("Hmm",ao),W("Hmmss",so),G(["H","HH"],Eo),G(["k","kk"],function(e,t){var o=w(e);t[Eo]=24===o?0:o}),G(["a","A"],function(e,t,o){o._isPm=o._locale.isPM(e),o._meridiem=e}),G(["h","hh"],function(e,t,o){t[Eo]=w(e),g(o).bigHour=!0}),G("hmm",function(e,t,o){var n=e.length-2;t[Eo]=w(e.substr(0,n)),t[Mo]=w(e.substr(n)),g(o).bigHour=!0}),G("hmmss",function(e,t,o){var n=e.length-4,i=e.length-2;t[Eo]=w(e.substr(0,n)),t[Mo]=w(e.substr(n,2)),t[Io]=w(e.substr(i)),g(o).bigHour=!0}),G("Hmm",function(e,t){var o=e.length-2;t[Eo]=w(e.substr(0,o)),t[Mo]=w(e.substr(o))}),G("Hmmss",function(e,t){var o=e.length-4,n=e.length-2;t[Eo]=w(e.substr(0,o)),t[Mo]=w(e.substr(o,2)),t[Io]=w(e.substr(n))});var Ro=/[ap]\.?m?\.?/i,Bo=Q("Hours",!0),Ho={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:Gt,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:zo,week:{dow:0,doy:6},weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekdaysShort:No,meridiemParse:Ro},Lo={},Ao={},Wo=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,jo=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Uo=/Z|[+-]\d\d(?::?\d\d)?/,Vo=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Go=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],qo=/^\/?Date\((\-?\d+)/i,Zo=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Xo={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480},Ko;t.createFromInputFallback=O("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),t.ISO_8601=function(){},t.RFC_2822=function(){};var Qo=O("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Qe.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:f()}),$o=O("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Qe.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:f()}),Jo=["year","quarter","month","week","day","hour","minute","second","millisecond"];nt("Z",":"),nt("ZZ",""),W("Z",ko),W("ZZ",ko),G(["Z","ZZ"],function(e,t,o){o._useUTC=!0,o._tzm=it(ko,e)});var en=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var tn=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,on=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;lt.fn=et.prototype,lt.invalid=function(){return lt(NaN)};var nn=ht(1,"add"),an=ht(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var dn=O("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});R(0,["gg",2],0,function(){return this.weekYear()%100}),R(0,["GG",2],0,function(){return this.isoWeekYear()%100}),kt("gggg","weekYear"),kt("ggggg","weekYear"),kt("GGGG","isoWeekYear"),kt("GGGGG","isoWeekYear"),I("weekYear","gg"),I("isoWeekYear","GG"),Y("weekYear",1),Y("isoWeekYear",1),W("G",_o),W("g",_o),W("GG",io,eo),W("gg",io,eo),W("GGGG",ho,oo),W("gggg",ho,oo),W("GGGGG",mo,no),W("ggggg",mo,no),q(["gggg","ggggg","GGGG","GGGGG"],function(e,t,o,n){t[n.substr(0,2)]=w(e)}),q(["gg","GG"],function(e,o,n,i){o[i]=t.parseTwoDigitYear(e)}),R("Q",0,"Qo","quarter"),I("quarter","Q"),Y("quarter",7),W("Q",Jt),G("Q",function(e,t){t[To]=3*(w(e)-1)}),R("D",["DD",2],"Do","date"),I("date","D"),Y("date",9),W("D",io),W("DD",io,eo),W("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),G(["D","DD"],Co),G("Do",function(e,t){t[Co]=w(e.match(io)[0])});var sn=Q("Date",!0);R("DDD",["DDDD",3],"DDDo","dayOfYear"),I("dayOfYear","DDD"),Y("dayOfYear",4),W("DDD",po),W("DDDD",to),G(["DDD","DDDD"],function(e,t,o){o._dayOfYear=w(e)}),R("m",["mm",2],0,"minute"),I("minute","m"),Y("minute",14),W("m",io),W("mm",io,eo),G(["m","mm"],Mo);var rn=Q("Minutes",!1);R("s",["ss",2],0,"second"),I("second","s"),Y("second",15),W("s",io),W("ss",io,eo),G(["s","ss"],Io);var ln=Q("Seconds",!1);R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return 10*this.millisecond()}),R(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),R(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),R(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),R(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),R(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),I("millisecond","ms"),Y("millisecond",16),W("S",po,Jt),W("SS",po,eo),W("SSS",po,to);var cn;for(cn="SSSS";9>=cn.length;cn+="S")W(cn,bo);for(cn="S";9>=cn.length;cn+="S")G(cn,St);var un=Q("Milliseconds",!1);R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");var pn=_.prototype;pn.add=nn,pn.calendar=function(e,o){var n=e||Qe(),i=at(n,this).startOf("day"),a=t.calendarFormat(this,i)||"sameElse",d=o&&(T(o[a])?o[a].call(this,n):o[a]);return this.format(d||this.localeData().calendar(a,this,Qe(n)))},pn.clone=function(){return new _(this)},pn.diff=function(e,t,o){var n,i,a;return this.isValid()?(n=at(e,this),!n.isValid())?NaN:(i=6e4*(n.utcOffset()-this.utcOffset()),t=P(t),(a="year"===t?gt(this,n)/12:"month"===t?gt(this,n):"quarter"===t?gt(this,n)/3:"second"===t?(this-n)/1e3:"minute"===t?(this-n)/6e4:"hour"===t?(this-n)/36e5:"day"===t?(this-n-i)/864e5:"week"===t?(this-n-i)/6048e5:this-n,o?a:k(a))):NaN},pn.endOf=function(e){var o;if(e=P(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?vt:_t;return"year"===e?o=n(this.year()+1,0,1)-1:"quarter"===e?o=n(this.year(),this.month()-this.month()%3+3,1)-1:"month"===e?o=n(this.year(),this.month()+1,1)-1:"week"===e?o=n(this.year(),this.month(),this.date()-this.weekday()+7)-1:"isoWeek"===e?o=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1:"day"===e||"date"===e?o=n(this.year(),this.month(),this.date()+1)-1:"hour"===e?(o=this._d.valueOf(),o+=3600000-bt(o+(this._isUTC?0:60000*this.utcOffset()),3600000)-1):"minute"===e?(o=this._d.valueOf(),o+=60000-bt(o,60000)-1):"second"===e?(o=this._d.valueOf(),o+=1000-bt(o,1000)-1):void 0,this._d.setTime(o),t.updateOffset(this,!0),this},pn.format=function(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var o=L(this,e);return this.localeData().postformat(o)},pn.from=function(e,t){return this.isValid()&&(v(e)&&e.isValid()||Qe(e).isValid())?lt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},pn.fromNow=function(e){return this.from(Qe(),e)},pn.to=function(e,t){return this.isValid()&&(v(e)&&e.isValid()||Qe(e).isValid())?lt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},pn.toNow=function(e){return this.to(Qe(),e)},pn.get=function(e){return e=P(e),T(this[e])?this[e]():this},pn.invalidAt=function(){return g(this).overflow},pn.isAfter=function(e,t){var o=v(e)?e:Qe(e);return!!(this.isValid()&&o.isValid())&&(t=P(t)||"millisecond","millisecond"===t?this.valueOf()>o.valueOf():o.valueOf()<this.clone().startOf(t).valueOf())},pn.isBefore=function(e,t){var o=v(e)?e:Qe(e);return!!(this.isValid()&&o.isValid())&&(t=P(t)||"millisecond","millisecond"===t?this.valueOf()<o.valueOf():this.clone().endOf(t).valueOf()<o.valueOf())},pn.isBetween=function(e,t,o,n){var i=v(e)?e:Qe(e),a=v(t)?t:Qe(t);return!!(this.isValid()&&i.isValid()&&a.isValid())&&(n=n||"()",("("===n[0]?this.isAfter(i,o):!this.isBefore(i,o))&&(")"===n[1]?this.isBefore(a,o):!this.isAfter(a,o)))},pn.isSame=function(e,t){var o=v(e)?e:Qe(e),n;return!!(this.isValid()&&o.isValid())&&(t=P(t)||"millisecond","millisecond"===t?this.valueOf()===o.valueOf():(n=o.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},pn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},pn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},pn.isValid=function(){return y(this)},pn.lang=dn,pn.locale=yt,pn.localeData=ft,pn.max=$o,pn.min=Qo,pn.parsingFlags=function(){return u({},g(this))},pn.set=ee,pn.startOf=function(e){var o;if(e=P(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?vt:_t;return"year"===e?o=n(this.year(),0,1):"quarter"===e?o=n(this.year(),this.month()-this.month()%3,1):"month"===e?o=n(this.year(),this.month(),1):"week"===e?o=n(this.year(),this.month(),this.date()-this.weekday()):"isoWeek"===e?o=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)):"day"===e||"date"===e?o=n(this.year(),this.month(),this.date()):"hour"===e?(o=this._d.valueOf(),o-=bt(o+(this._isUTC?0:60000*this.utcOffset()),3600000)):"minute"===e?(o=this._d.valueOf(),o-=bt(o,60000)):"second"===e?(o=this._d.valueOf(),o-=bt(o,1000)):void 0,this._d.setTime(o),t.updateOffset(this,!0),this},pn.subtract=an,pn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},pn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},pn.toDate=function(){return new Date(this.valueOf())},pn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,o=t?this.clone().utc():this;return 0>o.year()||9999<o.year()?L(o,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):T(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+1e3*(60*this.utcOffset())).toISOString().replace("Z",L(o,"Z")):L(o,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},pn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var o="["+e+"(\"]",n=0<=this.year()&&9999>=this.year()?"YYYY":"YYYYYY",i=t+"[\")]";return this.format(o+n+"-MM-DD[T]HH:mm:ss.SSS"+i)},pn.toJSON=function(){return this.isValid()?this.toISOString():null},pn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},pn.unix=function(){return go(this.valueOf()/1e3)},pn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},pn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},pn.year=Po,pn.isLeapYear=function(){return K(this.year())},pn.weekYear=function(e){return wt.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},pn.isoWeekYear=function(e){return wt.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},pn.quarter=pn.quarters=function(e){return null==e?co((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},pn.month=de,pn.daysInMonth=function(){return oe(this.year(),this.month())},pn.week=pn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},pn.isoWeek=pn.isoWeeks=function(e){var t=pe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},pn.weeksInYear=function(){var e=this.localeData()._week;return he(this.year(),e.dow,e.doy)},pn.isoWeeksInYear=function(){return he(this.year(),1,4)},pn.date=sn,pn.day=pn.days=function(e){if(!this.isValid())return null==e?NaN:this;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null==e?t:(e=me(e,this.localeData()),this.add(e-t,"d"))},pn.weekday=function(e){if(!this.isValid())return null==e?NaN:this;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},pn.isoWeekday=function(e){if(!this.isValid())return null==e?NaN:this;if(null!=e){var t=ge(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},pn.dayOfYear=function(e){var t=ro((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},pn.hour=pn.hours=Bo,pn.minute=pn.minutes=rn,pn.second=pn.seconds=ln,pn.millisecond=pn.milliseconds=un,pn.utcOffset=function(e,o,n){var i=this._offset||0,a;if(!this.isValid())return null==e?NaN:this;if(null!=e){if("string"!=typeof e)16>uo(e)&&!n&&(e*=60);else if(e=it(ko,e),null===e)return this;return!this._isUTC&&o&&(a=dt(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),i!==e&&(!o||this._changeInProgress?mt(this,lt(e-i,"m"),1,!1):!this._changeInProgress&&(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:dt(this)},pn.utc=function(e){return this.utcOffset(0,e)},pn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(dt(this),"m")),this},pn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=it(vo,this._i);null==e?this.utcOffset(0,!0):this.utcOffset(e)}return this},pn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Qe(e).utcOffset():0,0==(this.utcOffset()-e)%60)},pn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},pn.isLocal=function(){return!!this.isValid()&&!this._isUTC},pn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},pn.isUtc=rt,pn.isUTC=rt,pn.zoneAbbr=function(){return this._isUTC?"UTC":""},pn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},pn.dates=O("dates accessor is deprecated. Use date instead.",sn),pn.months=O("months accessor is deprecated. Use month instead",de),pn.years=O("years accessor is deprecated. Use year instead",Po),pn.zone=O("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null==e?-this.utcOffset():("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this)}),pn.isDSTShifted=O("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",st);var hn=M.prototype;hn.calendar=function(e,t,o){var n=this._calendar[e]||this._calendar.sameElse;return T(n)?n.call(t,o):n},hn.longDateFormat=function(e){var t=this._longDateFormat[e],o=this._longDateFormat[e.toUpperCase()];return t||!o?t:(this._longDateFormat[e]=o.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},hn.invalidDate=function(){return this._invalidDate},hn.ordinal=function(e){return this._ordinal.replace("%d",e)},hn.preparse=Ot,hn.postformat=Ot,hn.relativeTime=function(e,t,o,n){var i=this._relativeTime[o];return T(i)?i(e,t,o,n):i.replace(/%d/i,e)},hn.pastFuture=function(e,t){var o=this._relativeTime[0<e?"future":"past"];return T(o)?o(t):o.replace(/%s/i,t)},hn.set=C,hn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Yo).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},hn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Yo.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},hn.monthsParse=ie,hn.monthsRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||se.call(this),e?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=xo),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},hn.monthsShortRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||se.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=xo),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},hn.week=function(e){return pe(e,this._week.dow,this._week.doy).week},hn.firstDayOfYear=function(){return this._week.doy},hn.firstDayOfWeek=function(){return this._week.dow},hn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?ye(n,this._week.dow):e?n[e.day()]:n},hn.weekdaysMin=function(e){return!0===e?ye(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},hn.weekdaysShort=function(e){return!0===e?ye(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},hn.weekdaysParse=be,hn.weekdaysRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||_e.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=xo),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},hn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||_e.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=xo),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},hn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||_e.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=xo),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},hn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},hn.meridiem=function(e,t,o){return 11<e?o?"pm":"PM":o?"am":"AM"},De("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,o=1===w(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th";return e+o}}),t.lang=O("moment.lang is deprecated. Use moment.locale instead.",De),t.langData=O("moment.langData is deprecated. Use moment.localeData instead.",Ce);var mn=uo,gn=Ft("ms"),yn=Ft("s"),fn=Ft("m"),bn=Ft("h"),_n=Ft("d"),vn=Ft("w"),kn=Ft("M"),wn=Ft("Q"),xn=Ft("y"),Sn=Yt("milliseconds"),On=Yt("seconds"),Dn=Yt("minutes"),Tn=Yt("hours"),Cn=Yt("days"),En=Yt("months"),Mn=Yt("years"),In=ro,Pn={ss:44,s:45,m:45,h:22,d:26,M:11},Fn=uo,Yn=et.prototype;return Yn.isValid=function(){return this._isValid},Yn.abs=function(){var e=this._data;return this._milliseconds=mn(this._milliseconds),this._days=mn(this._days),this._months=mn(this._months),e.milliseconds=mn(e.milliseconds),e.seconds=mn(e.seconds),e.minutes=mn(e.minutes),e.hours=mn(e.hours),e.months=mn(e.months),e.years=mn(e.years),this},Yn.add=function(e,t){return Et(this,e,t,1)},Yn.subtract=function(e,t){return Et(this,e,t,-1)},Yn.as=function(e){if(!this.isValid())return NaN;var t=this._milliseconds,o,n;if(e=P(e),"month"===e||"quarter"===e||"year"===e)switch(o=this._days+t/864e5,n=this._months+It(o),e){case"month":return n;case"quarter":return n/3;case"year":return n/12;}else switch(o=this._days+ro(Pt(this._months)),e){case"week":return o/7+t/6048e5;case"day":return o+t/864e5;case"hour":return 24*o+t/36e5;case"minute":return 1440*o+t/6e4;case"second":return 86400*o+t/1e3;case"millisecond":return go(864e5*o)+t;default:throw new Error("Unknown unit "+e);}},Yn.asMilliseconds=gn,Yn.asSeconds=yn,Yn.asMinutes=fn,Yn.asHours=bn,Yn.asDays=_n,Yn.asWeeks=vn,Yn.asMonths=kn,Yn.asQuarters=wn,Yn.asYears=xn,Yn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+2592e6*(this._months%12)+31536e6*w(this._months/12):NaN},Yn._bubble=function(){var e=this._milliseconds,t=this._days,o=this._months,n=this._data,i,a,d,s,r;return 0<=e&&0<=t&&0<=o||0>=e&&0>=t&&0>=o||(e+=864e5*Mt(Pt(o)+t),t=0,o=0),n.milliseconds=e%1e3,i=k(e/1e3),n.seconds=i%60,a=k(i/60),n.minutes=a%60,d=k(a/60),n.hours=d%24,t+=k(d/24),r=k(It(t)),o+=r,t-=Mt(Pt(r)),s=k(o/12),o%=12,n.days=t,n.months=o,n.years=s,this},Yn.clone=function(){return lt(this)},Yn.get=function(e){return e=P(e),this.isValid()?this[e+"s"]():NaN},Yn.milliseconds=Sn,Yn.seconds=On,Yn.minutes=Dn,Yn.hours=Tn,Yn.days=Cn,Yn.weeks=function(){return k(this.days()/7)},Yn.months=En,Yn.years=Mn,Yn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),o=Nt(this,!e,t);return e&&(o=t.pastFuture(+this,o)),t.postformat(o)},Yn.toISOString=Ht,Yn.toString=Ht,Yn.toJSON=Ht,Yn.locale=yt,Yn.localeData=ft,Yn.toIsoString=O("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ht),Yn.lang=dn,R("X",0,0,"unix"),R("x",0,0,"valueOf"),W("x",_o),W("X",wo),G("X",function(e,t,o){o._d=new Date(1e3*parseFloat(e,10))}),G("x",function(e,t,o){o._d=new Date(w(e))}),t.version="2.24.0",function(e){Lt=e}(Qe),t.fn=pn,t.min=function(){var e=[].slice.call(arguments,0);return $e("isBefore",e)},t.max=function(){var e=[].slice.call(arguments,0);return $e("isAfter",e)},t.now=function(){return Date.now?Date.now():+new Date},t.utc=p,t.unix=function(e){return Qe(1e3*e)},t.months=function(e,t){return Tt(e,t,"months")},t.isDate=r,t.locale=De,t.invalid=f,t.duration=lt,t.isMoment=v,t.weekdays=function(e,t,o){return Ct(e,t,o,"weekdays")},t.parseZone=function(){return Qe.apply(null,arguments).parseZone()},t.localeData=Ce,t.isDuration=tt,t.monthsShort=function(e,t){return Tt(e,t,"monthsShort")},t.weekdaysMin=function(e,t,o){return Ct(e,t,o,"weekdaysMin")},t.defineLocale=Te,t.updateLocale=function(e,t){if(null!=t){var o=Ho,n,i;i=Oe(e),null!=i&&(o=i._config),t=E(o,t),n=new M(t),n.parentLocale=Lo[e],Lo[e]=n,De(e)}else null!=Lo[e]&&(null==Lo[e].parentLocale?null!=Lo[e]&&delete Lo[e]:Lo[e]=Lo[e].parentLocale);return Lo[e]},t.locales=Ee,t.weekdaysShort=function(e,t,o){return Ct(e,t,o,"weekdaysShort")},t.normalizeUnits=P,t.relativeTimeRounding=Rt,t.relativeTimeThreshold=function(e,t){return void 0!==Pn[e]&&(void 0===t?Pn[e]:(Pn[e]=t,"s"===e&&(Pn.ss=t-1),!0))},t.calendarFormat=function(e,t){var o=e.diff(t,"days",!0);return-6>o?"sameElse":-1>o?"lastWeek":0>o?"lastDay":1>o?"sameDay":2>o?"nextDay":7>o?"nextWeek":"sameElse"},t.prototype=pn,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t})}),Do=[],To=0;256>To;To++)Do[To]=(To+256).toString(16).substr(1);for(var Co=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues){var e=new Uint8Array(16);return function(){return crypto.getRandomValues(e),e}}var t=Array(16);return function(){for(var e=0,o;16>e;e++)0==(3&e)&&(o=4294967296*Math.random()),t[e]=255&o>>>((3&e)<<3);return t}}(),Eo=[],Mo=0;256>Mo;Mo++)Eo[Mo]=(Mo+256).toString(16).substr(1);for(var Io=Co(),Po=[1|Io[0],Io[1],Io[2],Io[3],Io[4],Io[5]],Fo=16383&(Io[6]<<8|Io[7]),Yo=/^\/?Date\((-?\d+)/i,zo=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,No=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Ro=Object.assign,Bo=Object.values,Ho={asBoolean:function(e,t){return"function"==typeof e&&(e=e()),null==e?t||null:!1!=e},asNumber:function(e,t){return"function"==typeof e&&(e=e()),null==e?t||null:+e||t||null},asString:function(e,t){return"function"==typeof e&&(e=e()),null==e?t||null:e+""},asSize:function(e,t){return"function"==typeof e&&(e=e()),y(e)?e:m(e)?e+"px":t||null},asElement:function(e,t){return"function"==typeof e&&(e=e()),e||t||null}},Lo={split:function(e){var t={};return e.split(";").forEach(function(e){if(""!=e.trim()){var o=e.split(":"),n=o[0].trim(),i=o[1].trim();t[n]=i}}),t},join:function(e){return Object.keys(e).map(function(t){return t+": "+e[t]}).join("; ")}},Ao={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return .5>e?2*e*e:-1+(4-2*e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return .5>e?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return .5>e?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return .5>e?16*e*e*e*e*e:1+16*--e*e*e*e*e}},Wo=Object.freeze({isNumber:m,recursiveDOMDelete:g,isString:y,isObject:f,isDate:b,isMoment:_,fillIfDefined:k,extend:Ro,selectiveExtend:w,selectiveDeepExtend:x,selectiveNotDeepExtend:S,deepExtend:O,equalArray:D,convert:T,getType:C,copyAndExtendArray:E,copyArray:M,getAbsoluteLeft:I,getAbsoluteRight:P,getAbsoluteTop:F,addClassName:Y,removeClassName:z,forEach:N,toArray:Bo,updateProperty:R,throttle:B,addEventListener:H,removeEventListener:L,preventDefault:A,getTarget:W,hasParent:j,option:Ho,hexToRGB:U,overrideOpacity:V,RGBToHex:G,parseColor:q,RGBToHSV:Z,addCssText:X,removeCssText:K,HSVToRGB:Q,HSVToHex:$,hexToHSV:J,isValidHex:ee,isValidRGB:te,isValidRGBA:oe,selectiveBridgeObject:ne,bridgeObject:ie,insertSort:ae,mergeOptions:de,binarySearchCustom:se,binarySearchValue:re,easingFunctions:Ao,getScrollBarWidth:le,topMost:ce,randomUUID:u}),jo=Object.freeze({default:Wo,HSVToHex:$,HSVToRGB:Q,RGBToHSV:Z,RGBToHex:G,addClassName:Y,addCssText:X,addEventListener:H,binarySearchCustom:se,binarySearchValue:re,bridgeObject:ie,convert:T,copyAndExtendArray:E,copyArray:M,deepExtend:O,easingFunctions:Ao,equalArray:D,extend:Ro,fillIfDefined:k,forEach:N,getAbsoluteLeft:I,getAbsoluteRight:P,getAbsoluteTop:F,getScrollBarWidth:le,getTarget:W,getType:C,hasParent:j,hexToHSV:J,hexToRGB:U,insertSort:ae,isDate:b,isMoment:_,isNumber:m,isObject:f,isString:y,isValidHex:ee,isValidRGB:te,isValidRGBA:oe,mergeOptions:de,option:Ho,overrideOpacity:V,parseColor:q,preventDefault:A,randomUUID:u,recursiveDOMDelete:g,removeClassName:z,removeCssText:K,removeEventListener:L,selectiveBridgeObject:ne,selectiveDeepExtend:x,selectiveExtend:w,selectiveNotDeepExtend:S,throttle:B,toArray:Bo,topMost:ce,updateProperty:R}),Uo=ue,Vo=pe(function(e){function t(e){return t="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},t(e)}function o(n){return e.exports="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?o=function(e){return t(e)}:o=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)},o(n)}e.exports=o}),Go=he,qo=ge,Zo=ye,Xo=fe,Ko=pe(function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t}),Qo=pe(function(e){function t(n,o){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,o)}e.exports=t}),$o=be,Jo=[],en=0;256>en;en++)Jo[en]=(en+256).toString(16).substr(1);for(var tn=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues){var e=new Uint8Array(16);return function(){return crypto.getRandomValues(e),e}}var t=Array(16);return function(){for(var e=0,o;16>e;e++)0==(3&e)&&(o=4294967296*Math.random()),t[e]=255&o>>>((3&e)<<3);return t}}(),on=[],nn=0;256>nn;nn++)on[nn]=(nn+256).toString(16).substr(1);for(var an=tn(),dn=[1|an[0],an[1],an[2],an[3],an[4],an[5]],sn=16383&(an[6]<<8|an[7]),rn="undefined"==typeof globalThis?"undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?{}:self:global:window:globalThis,ln=xe(function(e){(function(t,o){e.exports=o()})(rn,function(){function t(){return Ht.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function i(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function a(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function s(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function r(e,t){var o=[],n;for(n=0;n<e.length;++n)o.push(t(e[n],n));return o}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){for(var o in t)l(t,o)&&(e[o]=t[o]);return l(t,"toString")&&(e.toString=t.toString),l(t,"valueOf")&&(e.valueOf=t.valueOf),e}function u(e,t,o,n){return Xe(e,t,o,n,!0).utc()}function p(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function h(e){return null==e._pf&&(e._pf=p()),e._pf}function m(e){if(null==e._isValid){var t=h(e),o=Lt.call(t.parsedDateParts,function(e){return null!=e}),n=!isNaN(e._d.getTime())&&0>t.overflow&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&o);if(e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null==Object.isFrozen||!Object.isFrozen(e))e._isValid=n;else return n}return e._isValid}function g(e){var t=u(NaN);return null==e?h(t).userInvalidated=!0:c(h(t),e),t}function y(e,t){var o,n,d;if(a(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),a(t._i)||(e._i=t._i),a(t._f)||(e._f=t._f),a(t._l)||(e._l=t._l),a(t._strict)||(e._strict=t._strict),a(t._tzm)||(e._tzm=t._tzm),a(t._isUTC)||(e._isUTC=t._isUTC),a(t._offset)||(e._offset=t._offset),a(t._pf)||(e._pf=h(t)),a(t._locale)||(e._locale=t._locale),0<At.length)for(o=0;o<At.length;o++)n=At[o],d=t[n],a(d)||(e[n]=d);return e}function f(e){y(this,e),this._d=new Date(null==e._d?NaN:e._d.getTime()),this.isValid()||(this._d=new Date(NaN)),!1===Wt&&(Wt=!0,t.updateOffset(this),Wt=!1)}function b(e){return e instanceof f||null!=e&&null!=e._isAMomentObject}function _(e){return 0>e?co(e)||0:go(e)}function v(e){var t=+e,o=0;return 0!=t&&isFinite(t)&&(o=_(t)),o}function k(e,t,o){var n=fo(e.length,t.length),a=uo(e.length-t.length),d=0,s;for(s=0;s<n;s++)(o&&e[s]!==t[s]||!o&&v(e[s])!==v(t[s]))&&d++;return d+a}function w(e){!1===t.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function x(e,o){var n=!0;return c(function(){if(null!=t.deprecationHandler&&t.deprecationHandler(null,e),n){for(var a=[],d=0,s;d<arguments.length;d++){if(s="","object"==typeof arguments[d]){for(var r in s+="\n["+d+"] ",arguments[0])s+=r+": "+arguments[0][r]+", ";s=s.slice(0,-2)}else s=arguments[d];a.push(s)}w(e+"\nArguments: "+Array.prototype.slice.call(a).join("")+"\n"+new Error().stack),n=!1}return o.apply(this,arguments)},o)}function S(e,o){null!=t.deprecationHandler&&t.deprecationHandler(e,o),jt[e]||(w(o),jt[e]=!0)}function O(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function D(e){var t,o;for(o in e)t=e[o],O(t)?this[o]=t:this["_"+o]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function T(e,t){var o=c({},e),i;for(i in t)l(t,i)&&(n(e[i])&&n(t[i])?(o[i]={},c(o[i],e[i]),c(o[i],t[i])):null==t[i]?delete o[i]:o[i]=t[i]);for(i in e)l(e,i)&&!l(t,i)&&n(e[i])&&(o[i]=c({},o[i]));return o}function C(e){null!=e&&this.set(e)}function E(e,t){var o=e.toLowerCase();Gt[o]=Gt[o+"s"]=Gt[t]=e}function M(e){return"string"==typeof e?Gt[e]||Gt[e.toLowerCase()]:void 0}function I(e){var t={},o,n;for(n in e)l(e,n)&&(o=M(n),o&&(t[o]=e[n]));return t}function P(e,t){qt[e]=t}function F(e){var t=[];for(var o in e)t.push({unit:o,priority:qt[o]});return t.sort(function(e,t){return e.priority-t.priority}),t}function Y(e,t,o){var n=""+uo(e),i=t-n.length;return(0<=e?o?"+":"":"-")+lo(10,yo(0,i)).toString().substr(1)+n}function z(e,t,o,n){var i=n;"string"==typeof n&&(i=function(){return this[n]()}),e&&(Qt[e]=i),t&&(Qt[t[0]]=function(){return Y(i.apply(this,arguments),t[1],t[2])}),o&&(Qt[o]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function N(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function R(e){var t=e.match(Zt),o,n;for(o=0,n=t.length;o<n;o++)t[o]=Qt[t[o]]?Qt[t[o]]:N(t[o]);return function(o){var a="",d;for(d=0;d<n;d++)a+=O(t[d])?t[d].call(o,e):t[d];return a}}function B(e,t){return e.isValid()?(t=H(t,e.localeData()),Kt[t]=Kt[t]||R(t),Kt[t](e)):e.localeData().invalidDate()}function H(e,t){function o(e){return t.longDateFormat(e)||e}var n=5;for(Xt.lastIndex=0;0<=n&&Xt.test(e);)e=e.replace(Xt,o),Xt.lastIndex=0,n-=1;return e}function L(e,t,o){xo[e]=O(t)?t:function(e){return e&&o?o:t}}function A(e,t){return l(xo,e)?xo[e](t._strict,t._locale):new RegExp(W(e))}function W(e){return j(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,o,n,i){return t||o||n||i}))}function j(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function U(e,t){var o=t,n;for("string"==typeof e&&(e=[e]),d(t)&&(o=function(e,o){o[t]=v(e)}),n=0;n<e.length;n++)So[e[n]]=o}function V(e,t){U(e,function(e,o,n,i){n._w=n._w||{},t(e,n._w,n,i)})}function G(e,t,o){null!=t&&l(So,e)&&So[e](t,o._a,o,e)}function q(e){return Z(e)?366:365}function Z(e){return 0==e%4&&0!=e%100||0==e%400}function X(e,o){return function(n){return null==n?K(this,e):(Q(this,e,n),t.updateOffset(this,o),this)}}function K(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Q(e,t,o){e.isValid()&&!isNaN(o)&&("FullYear"===t&&Z(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](o,e.month(),ee(o,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](o))}function $(e,t){if("object"==typeof e){e=I(e);for(var o=F(e),n=0;n<o.length;n++)this[o[n].unit](e[o[n].unit])}else if(e=M(e),O(this[e]))return this[e](t);return this}function J(e,t){return(e%t+t)%t}function ee(e,t){if(isNaN(e)||isNaN(t))return NaN;var o=J(t,12);return e+=(t-o)/12,1===o?Z(e)?29:28:31-o%7%2}function te(e,t,o){var n=e.toLocaleLowerCase(),a,d,s;if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],a=0;12>a;++a)s=u([2e3,a]),this._shortMonthsParse[a]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[a]=this.months(s,"").toLocaleLowerCase();return o?"MMM"===t?(d=Po.call(this._shortMonthsParse,n),-1===d?null:d):(d=Po.call(this._longMonthsParse,n),-1===d?null:d):"MMM"===t?(d=Po.call(this._shortMonthsParse,n),-1!==d)?d:(d=Po.call(this._longMonthsParse,n),-1===d?null:d):(d=Po.call(this._longMonthsParse,n),-1!==d)?d:(d=Po.call(this._shortMonthsParse,n),-1===d?null:d)}function oe(e,t,o){var n,a,d;if(this._monthsParseExact)return te.call(this,e,t,o);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;12>n;n++){if(a=u([2e3,n]),o&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),o||this._monthsParse[n]||(d="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[n]=new RegExp(d.replace(".",""),"i")),o&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(o&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!o&&this._monthsParse[n].test(e))return n}}function ne(e,t){var o;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=v(t);else if(t=e.localeData().monthsParse(t),!d(t))return e;return o=fo(e.date(),ee(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,o),e}function ie(e){return null==e?K(this,"Month"):(ne(this,e),t.updateOffset(this,!0),this)}function ae(){function e(e,t){return t.length-e.length}var t=[],o=[],n=[],a,d;for(a=0;12>a;a++)d=u([2e3,a]),t.push(this.monthsShort(d,"")),o.push(this.months(d,"")),n.push(this.months(d,"")),n.push(this.monthsShort(d,""));for(t.sort(e),o.sort(e),n.sort(e),a=0;12>a;a++)t[a]=j(t[a]),o[a]=j(o[a]);for(a=0;24>a;a++)n[a]=j(n[a]);this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function de(e,t,o,n,i,a,d){var s;return 100>e&&0<=e?(s=new Date(e+400,t,o,n,i,a,d),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,o,n,i,a,d),s}function se(e){var t;if(100>e&&0<=e){var o=Array.prototype.slice.call(arguments);o[0]=e+400,t=new Date(Date.UTC.apply(null,o)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function re(e,t,o){var n=7+t-o,i=(7+se(e,0,n).getUTCDay()-t)%7;return-i+n-1}function le(e,t,o,n,i){var a=re(e,n,i),d=1+7*(t-1)+(7+o-n)%7+a,s,r;return 0>=d?(s=e-1,r=q(s)+d):d>q(e)?(s=e+1,r=d-q(e)):(s=e,r=d),{year:s,dayOfYear:r}}function ce(e,t,o){var n=re(e.year(),t,o),i=go((e.dayOfYear()-n-1)/7)+1,a,d;return 1>i?(d=e.year()-1,a=i+ue(d,t,o)):i>ue(e.year(),t,o)?(a=i-ue(e.year(),t,o),d=e.year()+1):(d=e.year(),a=i),{week:a,year:d}}function ue(e,t,o){var n=re(e,t,o),i=re(e+1,t,o);return(q(e)-n+i)/7}function pe(e,t){return"string"==typeof e?isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10):e}function he(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function me(e,t){return e.slice(t,7).concat(e.slice(0,t))}function ge(e,t,o){var n=e.toLocaleLowerCase(),a,d,s;if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],a=0;7>a;++a)s=u([2e3,1]).day(a),this._minWeekdaysParse[a]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[a]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[a]=this.weekdays(s,"").toLocaleLowerCase();return o?"dddd"===t?(d=Po.call(this._weekdaysParse,n),-1===d?null:d):"ddd"===t?(d=Po.call(this._shortWeekdaysParse,n),-1===d?null:d):(d=Po.call(this._minWeekdaysParse,n),-1===d?null:d):"dddd"===t?(d=Po.call(this._weekdaysParse,n),-1!==d)?d:(d=Po.call(this._shortWeekdaysParse,n),-1!==d)?d:(d=Po.call(this._minWeekdaysParse,n),-1===d?null:d):"ddd"===t?(d=Po.call(this._shortWeekdaysParse,n),-1!==d)?d:(d=Po.call(this._weekdaysParse,n),-1!==d)?d:(d=Po.call(this._minWeekdaysParse,n),-1===d?null:d):(d=Po.call(this._minWeekdaysParse,n),-1!==d)?d:(d=Po.call(this._weekdaysParse,n),-1!==d)?d:(d=Po.call(this._shortWeekdaysParse,n),-1===d?null:d)}function ye(e,t,o){var n,a,d;if(this._weekdaysParseExact)return ge.call(this,e,t,o);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;7>n;n++){if(a=u([2e3,1]).day(n),o&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(d="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[n]=new RegExp(d.replace(".",""),"i")),o&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(o&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(o&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!o&&this._weekdaysParse[n].test(e))return n}}function fe(){function e(e,t){return t.length-e.length}var t=[],o=[],n=[],a=[],d,s,r,l,c;for(d=0;7>d;d++)s=u([2e3,1]).day(d),r=this.weekdaysMin(s,""),l=this.weekdaysShort(s,""),c=this.weekdays(s,""),t.push(r),o.push(l),n.push(c),a.push(r),a.push(l),a.push(c);for(t.sort(e),o.sort(e),n.sort(e),a.sort(e),d=0;7>d;d++)o[d]=j(o[d]),n[d]=j(n[d]),a[d]=j(a[d]);this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function be(){return this.hours()%12||12}function _e(e,t){z(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function ve(e,t){return t._meridiemParse}function ke(e){return e?e.toLowerCase().replace("_","-"):e}function xe(e){for(var t=0,o,n,a,d;t<e.length;){for(d=ke(e[t]).split("-"),o=d.length,n=ke(e[t+1]),n=n?n.split("-"):null;0<o;){if(a=Se(d.slice(0,o).join("-")),a)return a;if(n&&n.length>=o&&k(d,n,!0)>=o-1)break;o--}t++}return Xo}function Se(t){var o=null;if(!Ho[t]&&!0&&e&&e.exports)try{o=Xo._abbr;we("./locale/"+t),Oe(o)}catch(t){}return Ho[t]}function Oe(e,t){var o;return e&&(o=a(t)?Te(e):De(e,t),o?Xo=o:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Xo._abbr}function De(e,t){if(null!==t){var o=Bo,n;if(t.abbr=e,null!=Ho[e])S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),o=Ho[e]._config;else if(null!=t.parentLocale)if(null!=Ho[t.parentLocale])o=Ho[t.parentLocale]._config;else if(n=Se(t.parentLocale),null!=n)o=n._config;else return Lo[t.parentLocale]||(Lo[t.parentLocale]=[]),Lo[t.parentLocale].push({name:e,config:t}),null;return Ho[e]=new C(T(o,t)),Lo[e]&&Lo[e].forEach(function(e){De(e.name,e.config)}),Oe(e),Ho[e]}return delete Ho[e],null}function Te(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Xo;if(!o(e)){if(t=Se(e),t)return t;e=[e]}return xe(e)}function Ce(){return Ut(Ho)}function Ee(e){var t=e._a,o;return t&&-2===h(e).overflow&&(o=0>t[1]||11<t[1]?1:1>t[2]||t[2]>ee(t[0],t[1])?2:0>t[3]||24<t[3]||24===t[3]&&(0!==t[4]||0!==t[5]||0!==t[6])?3:0>t[4]||59<t[4]?4:0>t[5]||59<t[5]?5:0>t[6]||999<t[6]?6:-1,h(e)._overflowDayOfYear&&(0>o||2<o)&&(o=2),h(e)._overflowWeeks&&-1===o&&(o=7),h(e)._overflowWeekday&&-1===o&&(o=8),h(e).overflow=o),e}function Me(e,t,o){return null==e?null==t?o:t:e}function Ie(e){var o=new Date(t.now());return e._useUTC?[o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()]:[o.getFullYear(),o.getMonth(),o.getDate()]}function Pe(e){var t=[],o,n,a,d,s;if(!e._d){for(a=Ie(e),e._w&&null==e._a[2]&&null==e._a[1]&&Fe(e),null!=e._dayOfYear&&(s=Me(e._a[0],a[0]),(e._dayOfYear>q(s)||0===e._dayOfYear)&&(h(e)._overflowDayOfYear=!0),n=se(s,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),o=0;3>o&&null==e._a[o];++o)e._a[o]=t[o]=a[o];for(;7>o;o++)e._a[o]=t[o]=null==e._a[o]?2===o?1:0:e._a[o];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?se:de).apply(null,t),d=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&"undefined"!=typeof e._w.d&&e._w.d!==d&&(h(e).weekdayMismatch=!0)}}function Fe(e){var t,o,n,i,a,d,s,r;if(t=e._w,null!=t.GG||null!=t.W||null!=t.E)a=1,d=4,o=Me(t.GG,e._a[0],ce(Ke(),1,4).year),n=Me(t.W,1),i=Me(t.E,1),(1>i||7<i)&&(r=!0);else{a=e._locale._week.dow,d=e._locale._week.doy;var l=ce(Ke(),a,d);o=Me(t.gg,e._a[0],l.year),n=Me(t.w,l.week),null==t.d?null==t.e?i=a:(i=t.e+a,(0>t.e||6<t.e)&&(r=!0)):(i=t.d,(0>i||6<i)&&(r=!0))}1>n||n>ue(o,a,d)?h(e)._overflowWeeks=!0:null==r?(s=le(o,n,i,a,d),e._a[0]=s.year,e._dayOfYear=s.dayOfYear):h(e)._overflowWeekday=!0}function Ye(e){var t=e._i,o=Ao.exec(t)||Wo.exec(t),n,a,d,s,r,c;if(o){for(h(e).iso=!0,n=0,a=Uo.length;n<a;n++)if(Uo[n][1].exec(o[1])){s=Uo[n][0],d=!1!==Uo[n][2];break}if(null==s)return void(e._isValid=!1);if(o[3]){for(n=0,a=Vo.length;n<a;n++)if(Vo[n][1].exec(o[3])){r=(o[2]||" ")+Vo[n][0];break}if(null==r)return void(e._isValid=!1)}if(!d&&null!=r)return void(e._isValid=!1);if(o[4])if(jo.exec(o[4]))c="Z";else return void(e._isValid=!1);e._f=s+(r||"")+(c||""),We(e)}else e._isValid=!1}function ze(e,t,o,n,i,a){var d=[Ne(e),Yo.indexOf(t),parseInt(o,10),parseInt(n,10),parseInt(i,10)];return a&&d.push(parseInt(a,10)),d}function Ne(e){var t=parseInt(e,10);return 49>=t?2e3+t:999>=t?1900+t:t}function Re(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Be(e,t,o){if(e){var n=zo.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(n!==i)return h(o).weekdayMismatch=!0,o._isValid=!1,!1}return!0}function He(e,t,o){if(e)return Zo[e];if(t)return 0;var n=parseInt(o,10),i=n%100;return 60*((n-i)/100)+i}function Le(e){var t=qo.exec(Re(e._i));if(t){var o=ze(t[4],t[3],t[2],t[5],t[6],t[7]);if(!Be(t[1],o,e))return;e._a=o,e._tzm=He(t[8],t[9],t[10]),e._d=se.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function Ae(e){var o=Go.exec(e._i);if(null!==o)return void(e._d=new Date(+o[1]));if(Ye(e),!1===e._isValid)delete e._isValid;else return;if(Le(e),!1===e._isValid)delete e._isValid;else return;t.createFromInputFallback(e)}function We(e){if(e._f===t.ISO_8601)return void Ye(e);if(e._f===t.RFC_2822)return void Le(e);e._a=[],h(e).empty=!0;var o=""+e._i,n=o.length,a=0,d,s,r,l,c;for(r=H(e._f,e._locale).match(Zt)||[],d=0;d<r.length;d++)l=r[d],s=(o.match(A(l,e))||[])[0],s&&(c=o.substr(0,o.indexOf(s)),0<c.length&&h(e).unusedInput.push(c),o=o.slice(o.indexOf(s)+s.length),a+=s.length),Qt[l]?(s?h(e).empty=!1:h(e).unusedTokens.push(l),G(l,s,e)):e._strict&&!s&&h(e).unusedTokens.push(l);h(e).charsLeftOver=n-a,0<o.length&&h(e).unusedInput.push(o),12>=e._a[3]&&!0===h(e).bigHour&&0<e._a[3]&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[3]=je(e._locale,e._a[3],e._meridiem),Pe(e),Ee(e)}function je(e,t,o){var n;return null==o?t:null==e.meridiemHour?null==e.isPM?t:(n=e.isPM(o),n&&12>t&&(t+=12),n||12!==t||(t=0),t):e.meridiemHour(t,o)}function Ue(e){var t,o,n,a,d;if(0===e._f.length)return h(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;a<e._f.length;a++)(d=0,t=y({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],We(t),!!m(t))&&(d+=h(t).charsLeftOver,d+=10*h(t).unusedTokens.length,h(t).score=d,(null==n||d<n)&&(n=d,o=t));c(e,o||t)}function Ve(e){if(!e._d){var t=I(e._i);e._a=r([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Pe(e)}}function Ge(e){var t=new f(Ee(qe(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function qe(e){var t=e._i,n=e._f;return(e._locale=e._locale||Te(e._l),null===t||void 0===n&&""===t)?g({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),b(t))?new f(Ee(t)):(s(t)?e._d=t:o(n)?Ue(e):n?We(e):Ze(e),m(e)||(e._d=null),e)}function Ze(e){var i=e._i;a(i)?e._d=new Date(t.now()):s(i)?e._d=new Date(i.valueOf()):"string"==typeof i?Ae(e):o(i)?(e._a=r(i.slice(0),function(e){return parseInt(e,10)}),Pe(e)):n(i)?Ve(e):d(i)?e._d=new Date(i):t.createFromInputFallback(e)}function Xe(e,t,a,d,s){var r={};return(!0===a||!1===a)&&(d=a,a=void 0),(n(e)&&i(e)||o(e)&&0===e.length)&&(e=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=s,r._l=a,r._i=e,r._f=t,r._strict=d,Ge(r)}function Ke(e,t,o,n){return Xe(e,t,o,n,!1)}function Qe(e,t){var n,a;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Ke();for(n=t[0],a=1;a<t.length;++a)(!t[a].isValid()||t[a][e](n))&&(n=t[a]);return n}function $e(e){for(var t in e)if(-1===Po.call($o,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var o=!1,n=0;n<$o.length;++n)if(e[$o[n]]){if(o)return!1;parseFloat(e[$o[n]])!==v(e[$o[n]])&&(o=!0)}return!0}function Je(e){var t=I(e),o=t.year||0,n=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,d=t.day||0,s=t.hour||0,r=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=$e(t),this._milliseconds=+c+1e3*l+6e4*r+60*(60*(1e3*s)),this._days=+d+7*a,this._months=+i+3*n+12*o,this._data={},this._locale=Te(),this._bubble()}function et(e){return e instanceof Je}function tt(e){return 0>e?-1*ro(-1*e):ro(e)}function ot(e,t){z(e,0,0,function(){var e=this.utcOffset(),o="+";return 0>e&&(e=-e,o="-"),o+Y(~~(e/60),2)+t+Y(~~e%60,2)})}function nt(e,t){var o=(t||"").match(e);if(null===o)return null;var n=o[o.length-1]||[],i=(n+"").match(Jo)||["-",0,0],a=+(60*i[1])+v(i[2]);return 0===a?0:"+"===i[0]?a:-a}function it(e,o){var n,i;return o._isUTC?(n=o.clone(),i=(b(e)||s(e)?e.valueOf():Ke(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),t.updateOffset(n,!1),n):Ke(e).local()}function at(e){return 15*-ro(e._d.getTimezoneOffset()/15)}function dt(){if(!a(this._isDSTShifted))return this._isDSTShifted;var e={};if(y(e,this),e=qe(e),e._a){var t=e._isUTC?u(e._a):Ke(e._a);this._isDSTShifted=this.isValid()&&0<k(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted}function st(){return!!this.isValid()&&this._isUTC&&0===this._offset}function rt(e,t){var o=e,n=null,i,a,s;return et(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:d(e)?(o={},t?o[t]=e:o.milliseconds=e):(n=en.exec(e))?(i="-"===n[1]?-1:1,o={y:0,d:v(n[2])*i,h:v(n[3])*i,m:v(n[4])*i,s:v(n[5])*i,ms:v(tt(1e3*n[6]))*i}):(n=tn.exec(e))?(i="-"===n[1]?-1:1,o={y:lt(n[2],i),M:lt(n[3],i),w:lt(n[4],i),d:lt(n[5],i),h:lt(n[6],i),m:lt(n[7],i),s:lt(n[8],i)}):null==o?o={}:"object"==typeof o&&(("from"in o)||("to"in o))&&(s=ut(Ke(o.from),Ke(o.to)),o={},o.ms=s.milliseconds,o.M=s.months),a=new Je(o),et(e)&&l(e,"_locale")&&(a._locale=e._locale),a}function lt(e,t){var o=e&&parseFloat(e.replace(",","."));return(isNaN(o)?0:o)*t}function ct(e,t){var o={};return o.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(o.months,"M").isAfter(t)&&--o.months,o.milliseconds=+t-+e.clone().add(o.months,"M"),o}function ut(e,t){var o;return e.isValid()&&t.isValid()?(t=it(t,e),e.isBefore(t)?o=ct(e,t):(o=ct(t,e),o.milliseconds=-o.milliseconds,o.months=-o.months),o):{milliseconds:0,months:0}}function pt(e,t){return function(o,n){var i,a;return null===n||isNaN(+n)||(S(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=o,o=n,n=a),o="string"==typeof o?+o:o,i=rt(o,n),ht(this,i,e),this}}function ht(e,o,n,i){var a=o._milliseconds,d=tt(o._days),s=tt(o._months);e.isValid()&&(i=null==i||i,s&&ne(e,K(e,"Month")+s*n),d&&Q(e,"Date",K(e,"Date")+d*n),a&&e._d.setTime(e._d.valueOf()+a*n),i&&t.updateOffset(e,d||s))}function mt(e,t){var o=12*(t.year()-e.year())+(t.month()-e.month()),n=e.clone().add(o,"months"),i,a;return 0>t-n?(i=e.clone().add(o-1,"months"),a=(t-n)/(n-i)):(i=e.clone().add(o+1,"months"),a=(t-n)/(i-n)),-(o+a)||0}function gt(e){var t;return void 0===e?this._locale._abbr:(t=Te(e),null!=t&&(this._locale=t),this)}function yt(){return this._locale}function ft(e,t){return(e%t+t)%t}function bt(e,t,o){return 100>e&&0<=e?new Date(e+400,t,o)-12622780800000:new Date(e,t,o).valueOf()}function _t(e,t,o){return 100>e&&0<=e?Date.UTC(e+400,t,o)-12622780800000:Date.UTC(e,t,o)}function vt(e,t){z(0,[e,e.length],0,t)}function kt(e,t,o,n,i){var a;return null==e?ce(this,n,i).year:(a=ue(e,n,i),t>a&&(t=a),wt.call(this,e,t,o,n,i))}function wt(e,t,o,n,i){var a=le(e,t,o,n,i),d=se(a.year,0,a.dayOfYear);return this.year(d.getUTCFullYear()),this.month(d.getUTCMonth()),this.date(d.getUTCDate()),this}function xt(e,t){t[6]=v(1e3*("0."+e))}function St(e){return e}function Ot(e,t,o,n){var i=Te(),a=u().set(n,t);return i[o](a,e)}function Dt(e,t,o){if(d(e)&&(t=e,e=void 0),e=e||"",null!=t)return Ot(e,t,o,"month");var n=[],a;for(a=0;12>a;a++)n[a]=Ot(e,a,o,"month");return n}function Tt(e,t,o,n){"boolean"==typeof e?(d(t)&&(o=t,t=void 0),t=t||""):(t=e,o=t,e=!1,d(t)&&(o=t,t=void 0),t=t||"");var a=Te(),s=e?a._week.dow:0;if(null!=o)return Ot(t,(o+s)%7,n,"day");var r=[],l;for(l=0;7>l;l++)r[l]=Ot(t,(l+s)%7,n,"day");return r}function Ct(e,t,o,n){var i=rt(t,o);return e._milliseconds+=n*i._milliseconds,e._days+=n*i._days,e._months+=n*i._months,e._bubble()}function Et(e){return 0>e?go(e):co(e)}function Mt(e){return 4800*e/146097}function It(e){return 146097*e/4800}function Pt(e){return function(){return this.as(e)}}function Ft(e){return function(){return this.isValid()?this._data[e]:NaN}}function Yt(e,t,o,n,i){return i.relativeTime(t||1,!!o,e,n)}function zt(e,t,o){var n=rt(e).abs(),i=Mn(n.as("s")),d=Mn(n.as("m")),s=Mn(n.as("h")),r=Mn(n.as("d")),l=Mn(n.as("M")),c=Mn(n.as("y")),u=i<=In.ss&&["s",i]||i<In.s&&["ss",i]||1>=d&&["m"]||d<In.m&&["mm",d]||1>=s&&["h"]||s<In.h&&["hh",s]||1>=r&&["d"]||r<In.d&&["dd",r]||1>=l&&["M"]||l<In.M&&["MM",l]||1>=c&&["y"]||["yy",c];return u[2]=t,u[3]=0<+e,u[4]=o,Yt.apply(null,u)}function Nt(e){return void 0===e?Mn:"function"==typeof e&&(Mn=e,!0)}function Rt(e){return(0<e)-(0>e)||+e}function Bt(){if(!this.isValid())return this.localeData().invalidDate();var e=Pn(this._milliseconds)/1e3,t=Pn(this._days),o=Pn(this._months),n,i,a;n=_(e/60),i=_(n/60),e%=60,n%=60,a=_(o/12),o%=12;var d=a,r=o,l=t,c=i,u=n,p=e?e.toFixed(3).replace(/\.?0+$/,""):"",s=this.asSeconds();if(!s)return"P0D";var h=0>s?"-":"",m=Rt(this._months)===Rt(s)?"":"-",g=Rt(this._days)===Rt(s)?"":"-",y=Rt(this._milliseconds)===Rt(s)?"":"-";return h+"P"+(d?m+d+"Y":"")+(r?m+r+"M":"")+(l?g+l+"D":"")+(c||u||p?"T":"")+(c?y+c+"H":"")+(u?y+u+"M":"")+(p?y+p+"S":"")}var Ht,Lt;Lt=Array.prototype.some?Array.prototype.some:function(e){for(var o=Object(this),t=o.length>>>0,n=0;n<t;n++)if((n in o)&&e.call(this,o[n],n,o))return!0;return!1};var At=t.momentProperties=[],Wt=!1,jt={};t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;var Ut=Object.keys?Object.keys:function(e){var t=[],o;for(o in e)l(e,o)&&t.push(o);return t};var Vt=/\d{1,2}/,Gt={},qt={},Zt=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Xt=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Kt={},Qt={},$t=/\d/,Jt=/\d\d/,eo=/\d{3}/,to=/\d{4}/,oo=/[+-]?\d{6}/,no=/\d\d?/,io=/\d\d\d\d?/,ao=/\d\d\d\d\d\d?/,so=/\d{1,3}/,po=/\d{1,4}/,ho=/[+-]?\d{1,6}/,mo=/\d+/,bo=/[+-]?\d+/,_o=/Z|[+-]\d\d:?\d\d/gi,vo=/Z|[+-]\d\d(?::?\d\d)?/gi,ko=/[+-]?\d+(\.\d{1,3})?/,wo=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,xo={},So={},Oo=0,Do=1,To=2,Co=3,Eo=4,Mo=5;z("Y",0,0,function(){var e=this.year();return 9999>=e?""+e:"+"+e}),z(0,["YY",2],0,function(){return this.year()%100}),z(0,["YYYY",4],0,"year"),z(0,["YYYYY",5],0,"year"),z(0,["YYYYYY",6,!0],0,"year"),E("year","y"),P("year",1),L("Y",bo),L("YY",no,Jt),L("YYYY",po,to),L("YYYYY",ho,oo),L("YYYYYY",ho,oo),U(["YYYYY","YYYYYY"],Oo),U("YYYY",function(e,o){o[Oo]=2===e.length?t.parseTwoDigitYear(e):v(e)}),U("YY",function(e,o){o[Oo]=t.parseTwoDigitYear(e)}),U("Y",function(e,t){t[Oo]=parseInt(e,10)}),t.parseTwoDigitYear=function(e){return v(e)+(68<v(e)?1900:2e3)};var Io=X("FullYear",!0),Po;Po=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},z("M",["MM",2],"Mo",function(){return this.month()+1}),z("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),z("MMMM",0,0,function(e){return this.localeData().months(this,e)}),E("month","M"),P("month",8),L("M",no),L("MM",no,Jt),L("MMM",function(e,t){return t.monthsShortRegex(e)}),L("MMMM",function(e,t){return t.monthsRegex(e)}),U(["M","MM"],function(e,t){t[Do]=v(e)-1}),U(["MMM","MMMM"],function(e,t,o,n){var i=o._locale.monthsParse(e,n,o._strict);null==i?h(o).invalidMonth=e:t[Do]=i});var Fo=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Yo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];z("w",["ww",2],"wo","week"),z("W",["WW",2],"Wo","isoWeek"),E("week","w"),E("isoWeek","W"),P("week",5),P("isoWeek",5),L("w",no),L("ww",no,Jt),L("W",no),L("WW",no,Jt),V(["w","ww","W","WW"],function(e,t,o,n){t[n.substr(0,1)]=v(e)});z("d",0,"do","day"),z("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),z("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),z("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),z("e",0,0,"weekday"),z("E",0,0,"isoWeekday"),E("day","d"),E("weekday","e"),E("isoWeekday","E"),P("day",11),P("weekday",11),P("isoWeekday",11),L("d",no),L("e",no),L("E",no),L("dd",function(e,t){return t.weekdaysMinRegex(e)}),L("ddd",function(e,t){return t.weekdaysShortRegex(e)}),L("dddd",function(e,t){return t.weekdaysRegex(e)}),V(["dd","ddd","dddd"],function(e,t,o,n){var i=o._locale.weekdaysParse(e,n,o._strict);null==i?h(o).invalidWeekday=e:t.d=i}),V(["d","e","E"],function(e,t,o,n){t[n]=v(e)});var zo=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];z("H",["HH",2],0,"hour"),z("h",["hh",2],0,be),z("k",["kk",2],0,function(){return this.hours()||24}),z("hmm",0,0,function(){return""+be.apply(this)+Y(this.minutes(),2)}),z("hmmss",0,0,function(){return""+be.apply(this)+Y(this.minutes(),2)+Y(this.seconds(),2)}),z("Hmm",0,0,function(){return""+this.hours()+Y(this.minutes(),2)}),z("Hmmss",0,0,function(){return""+this.hours()+Y(this.minutes(),2)+Y(this.seconds(),2)}),_e("a",!0),_e("A",!1),E("hour","h"),P("hour",13),L("a",ve),L("A",ve),L("H",no),L("h",no),L("k",no),L("HH",no,Jt),L("hh",no,Jt),L("kk",no,Jt),L("hmm",io),L("hmmss",ao),L("Hmm",io),L("Hmmss",ao),U(["H","HH"],Co),U(["k","kk"],function(e,t){var o=v(e);t[Co]=24===o?0:o}),U(["a","A"],function(e,t,o){o._isPm=o._locale.isPM(e),o._meridiem=e}),U(["h","hh"],function(e,t,o){t[Co]=v(e),h(o).bigHour=!0}),U("hmm",function(e,t,o){var n=e.length-2;t[Co]=v(e.substr(0,n)),t[Eo]=v(e.substr(n)),h(o).bigHour=!0}),U("hmmss",function(e,t,o){var n=e.length-4,i=e.length-2;t[Co]=v(e.substr(0,n)),t[Eo]=v(e.substr(n,2)),t[Mo]=v(e.substr(i)),h(o).bigHour=!0}),U("Hmm",function(e,t){var o=e.length-2;t[Co]=v(e.substr(0,o)),t[Eo]=v(e.substr(o))}),U("Hmmss",function(e,t){var o=e.length-4,n=e.length-2;t[Co]=v(e.substr(0,o)),t[Eo]=v(e.substr(o,2)),t[Mo]=v(e.substr(n))});var No=/[ap]\.?m?\.?/i,Ro=X("Hours",!0),Bo={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:Vt,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:Yo,week:{dow:0,doy:6},weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekdaysShort:zo,meridiemParse:No},Ho={},Lo={},Ao=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Wo=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,jo=/Z|[+-]\d\d(?::?\d\d)?/,Uo=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Vo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Go=/^\/?Date\((\-?\d+)/i,qo=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Zo={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480},Xo;t.createFromInputFallback=x("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),t.ISO_8601=function(){},t.RFC_2822=function(){};var Ko=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ke.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:g()}),Qo=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ke.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:g()}),$o=["year","quarter","month","week","day","hour","minute","second","millisecond"];ot("Z",":"),ot("ZZ",""),L("Z",vo),L("ZZ",vo),U(["Z","ZZ"],function(e,t,o){o._useUTC=!0,o._tzm=nt(vo,e)});var Jo=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var en=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,tn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;rt.fn=Je.prototype,rt.invalid=function(){return rt(NaN)};var on=pt(1,"add"),nn=pt(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var an=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});z(0,["gg",2],0,function(){return this.weekYear()%100}),z(0,["GG",2],0,function(){return this.isoWeekYear()%100}),vt("gggg","weekYear"),vt("ggggg","weekYear"),vt("GGGG","isoWeekYear"),vt("GGGGG","isoWeekYear"),E("weekYear","gg"),E("isoWeekYear","GG"),P("weekYear",1),P("isoWeekYear",1),L("G",bo),L("g",bo),L("GG",no,Jt),L("gg",no,Jt),L("GGGG",po,to),L("gggg",po,to),L("GGGGG",ho,oo),L("ggggg",ho,oo),V(["gggg","ggggg","GGGG","GGGGG"],function(e,t,o,n){t[n.substr(0,2)]=v(e)}),V(["gg","GG"],function(e,o,n,i){o[i]=t.parseTwoDigitYear(e)}),z("Q",0,"Qo","quarter"),E("quarter","Q"),P("quarter",7),L("Q",$t),U("Q",function(e,t){t[Do]=3*(v(e)-1)}),z("D",["DD",2],"Do","date"),E("date","D"),P("date",9),L("D",no),L("DD",no,Jt),L("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),U(["D","DD"],To),U("Do",function(e,t){t[To]=v(e.match(no)[0])});var dn=X("Date",!0);z("DDD",["DDDD",3],"DDDo","dayOfYear"),E("dayOfYear","DDD"),P("dayOfYear",4),L("DDD",so),L("DDDD",eo),U(["DDD","DDDD"],function(e,t,o){o._dayOfYear=v(e)}),z("m",["mm",2],0,"minute"),E("minute","m"),P("minute",14),L("m",no),L("mm",no,Jt),U(["m","mm"],Eo);var sn=X("Minutes",!1);z("s",["ss",2],0,"second"),E("second","s"),P("second",15),L("s",no),L("ss",no,Jt),U(["s","ss"],Mo);var rn=X("Seconds",!1);z("S",0,0,function(){return~~(this.millisecond()/100)}),z(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),z(0,["SSS",3],0,"millisecond"),z(0,["SSSS",4],0,function(){return 10*this.millisecond()}),z(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),z(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),z(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),z(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),z(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),E("millisecond","ms"),P("millisecond",16),L("S",so,$t),L("SS",so,Jt),L("SSS",so,eo);var ln;for(ln="SSSS";9>=ln.length;ln+="S")L(ln,mo);for(ln="S";9>=ln.length;ln+="S")U(ln,xt);var cn=X("Milliseconds",!1);z("z",0,0,"zoneAbbr"),z("zz",0,0,"zoneName");var un=f.prototype;un.add=on,un.calendar=function(e,o){var n=e||Ke(),i=it(n,this).startOf("day"),a=t.calendarFormat(this,i)||"sameElse",d=o&&(O(o[a])?o[a].call(this,n):o[a]);return this.format(d||this.localeData().calendar(a,this,Ke(n)))},un.clone=function(){return new f(this)},un.diff=function(e,t,o){var n,i,a;return this.isValid()?(n=it(e,this),!n.isValid())?NaN:(i=6e4*(n.utcOffset()-this.utcOffset()),t=M(t),(a="year"===t?mt(this,n)/12:"month"===t?mt(this,n):"quarter"===t?mt(this,n)/3:"second"===t?(this-n)/1e3:"minute"===t?(this-n)/6e4:"hour"===t?(this-n)/36e5:"day"===t?(this-n-i)/864e5:"week"===t?(this-n-i)/6048e5:this-n,o?a:_(a))):NaN},un.endOf=function(e){var o;if(e=M(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?_t:bt;return"year"===e?o=n(this.year()+1,0,1)-1:"quarter"===e?o=n(this.year(),this.month()-this.month()%3+3,1)-1:"month"===e?o=n(this.year(),this.month()+1,1)-1:"week"===e?o=n(this.year(),this.month(),this.date()-this.weekday()+7)-1:"isoWeek"===e?o=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1:"day"===e||"date"===e?o=n(this.year(),this.month(),this.date()+1)-1:"hour"===e?(o=this._d.valueOf(),o+=3600000-ft(o+(this._isUTC?0:60000*this.utcOffset()),3600000)-1):"minute"===e?(o=this._d.valueOf(),o+=60000-ft(o,60000)-1):"second"===e?(o=this._d.valueOf(),o+=1000-ft(o,1000)-1):void 0,this._d.setTime(o),t.updateOffset(this,!0),this},un.format=function(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var o=B(this,e);return this.localeData().postformat(o)},un.from=function(e,t){return this.isValid()&&(b(e)&&e.isValid()||Ke(e).isValid())?rt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},un.fromNow=function(e){return this.from(Ke(),e)},un.to=function(e,t){return this.isValid()&&(b(e)&&e.isValid()||Ke(e).isValid())?rt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},un.toNow=function(e){return this.to(Ke(),e)},un.get=function(e){return e=M(e),O(this[e])?this[e]():this},un.invalidAt=function(){return h(this).overflow},un.isAfter=function(e,t){var o=b(e)?e:Ke(e);return!!(this.isValid()&&o.isValid())&&(t=M(t)||"millisecond","millisecond"===t?this.valueOf()>o.valueOf():o.valueOf()<this.clone().startOf(t).valueOf())},un.isBefore=function(e,t){var o=b(e)?e:Ke(e);return!!(this.isValid()&&o.isValid())&&(t=M(t)||"millisecond","millisecond"===t?this.valueOf()<o.valueOf():this.clone().endOf(t).valueOf()<o.valueOf())},un.isBetween=function(e,t,o,n){var i=b(e)?e:Ke(e),a=b(t)?t:Ke(t);return!!(this.isValid()&&i.isValid()&&a.isValid())&&(n=n||"()",("("===n[0]?this.isAfter(i,o):!this.isBefore(i,o))&&(")"===n[1]?this.isBefore(a,o):!this.isAfter(a,o)))},un.isSame=function(e,t){var o=b(e)?e:Ke(e),n;return!!(this.isValid()&&o.isValid())&&(t=M(t)||"millisecond","millisecond"===t?this.valueOf()===o.valueOf():(n=o.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},un.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},un.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},un.isValid=function(){return m(this)},un.lang=an,un.locale=gt,un.localeData=yt,un.max=Qo,un.min=Ko,un.parsingFlags=function(){return c({},h(this))},un.set=$,un.startOf=function(e){var o;if(e=M(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?_t:bt;return"year"===e?o=n(this.year(),0,1):"quarter"===e?o=n(this.year(),this.month()-this.month()%3,1):"month"===e?o=n(this.year(),this.month(),1):"week"===e?o=n(this.year(),this.month(),this.date()-this.weekday()):"isoWeek"===e?o=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)):"day"===e||"date"===e?o=n(this.year(),this.month(),this.date()):"hour"===e?(o=this._d.valueOf(),o-=ft(o+(this._isUTC?0:60000*this.utcOffset()),3600000)):"minute"===e?(o=this._d.valueOf(),o-=ft(o,60000)):"second"===e?(o=this._d.valueOf(),o-=ft(o,1000)):void 0,this._d.setTime(o),t.updateOffset(this,!0),this},un.subtract=nn,un.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},un.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},un.toDate=function(){return new Date(this.valueOf())},un.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,o=t?this.clone().utc():this;return 0>o.year()||9999<o.year()?B(o,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+1e3*(60*this.utcOffset())).toISOString().replace("Z",B(o,"Z")):B(o,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},un.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var o="["+e+"(\"]",n=0<=this.year()&&9999>=this.year()?"YYYY":"YYYYYY",i=t+"[\")]";return this.format(o+n+"-MM-DD[T]HH:mm:ss.SSS"+i)},un.toJSON=function(){return this.isValid()?this.toISOString():null},un.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},un.unix=function(){return go(this.valueOf()/1e3)},un.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},un.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},un.year=Io,un.isLeapYear=function(){return Z(this.year())},un.weekYear=function(e){return kt.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},un.isoWeekYear=function(e){return kt.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},un.quarter=un.quarters=function(e){return null==e?co((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},un.month=ie,un.daysInMonth=function(){return ee(this.year(),this.month())},un.week=un.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},un.isoWeek=un.isoWeeks=function(e){var t=ce(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},un.weeksInYear=function(){var e=this.localeData()._week;return ue(this.year(),e.dow,e.doy)},un.isoWeeksInYear=function(){return ue(this.year(),1,4)},un.date=dn,un.day=un.days=function(e){if(!this.isValid())return null==e?NaN:this;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null==e?t:(e=pe(e,this.localeData()),this.add(e-t,"d"))},un.weekday=function(e){if(!this.isValid())return null==e?NaN:this;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},un.isoWeekday=function(e){if(!this.isValid())return null==e?NaN:this;if(null!=e){var t=he(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},un.dayOfYear=function(e){var t=ro((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},un.hour=un.hours=Ro,un.minute=un.minutes=sn,un.second=un.seconds=rn,un.millisecond=un.milliseconds=cn,un.utcOffset=function(e,o,n){var i=this._offset||0,a;if(!this.isValid())return null==e?NaN:this;if(null!=e){if("string"!=typeof e)16>uo(e)&&!n&&(e*=60);else if(e=nt(vo,e),null===e)return this;return!this._isUTC&&o&&(a=at(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),i!==e&&(!o||this._changeInProgress?ht(this,rt(e-i,"m"),1,!1):!this._changeInProgress&&(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:at(this)},un.utc=function(e){return this.utcOffset(0,e)},un.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(at(this),"m")),this},un.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=nt(_o,this._i);null==e?this.utcOffset(0,!0):this.utcOffset(e)}return this},un.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Ke(e).utcOffset():0,0==(this.utcOffset()-e)%60)},un.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},un.isLocal=function(){return!!this.isValid()&&!this._isUTC},un.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},un.isUtc=st,un.isUTC=st,un.zoneAbbr=function(){return this._isUTC?"UTC":""},un.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},un.dates=x("dates accessor is deprecated. Use date instead.",dn),un.months=x("months accessor is deprecated. Use month instead",ie),un.years=x("years accessor is deprecated. Use year instead",Io),un.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null==e?-this.utcOffset():("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this)}),un.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",dt);var pn=C.prototype;pn.calendar=function(e,t,o){var n=this._calendar[e]||this._calendar.sameElse;return O(n)?n.call(t,o):n},pn.longDateFormat=function(e){var t=this._longDateFormat[e],o=this._longDateFormat[e.toUpperCase()];return t||!o?t:(this._longDateFormat[e]=o.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},pn.invalidDate=function(){return this._invalidDate},pn.ordinal=function(e){return this._ordinal.replace("%d",e)},pn.preparse=St,pn.postformat=St,pn.relativeTime=function(e,t,o,n){var i=this._relativeTime[o];return O(i)?i(e,t,o,n):i.replace(/%d/i,e)},pn.pastFuture=function(e,t){var o=this._relativeTime[0<e?"future":"past"];return O(o)?o(t):o.replace(/%s/i,t)},pn.set=D,pn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Fo).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},pn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Fo.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},pn.monthsParse=oe,pn.monthsRegex=function(e){return this._monthsParseExact?(l(this,"_monthsRegex")||ae.call(this),e?this._monthsStrictRegex:this._monthsRegex):(l(this,"_monthsRegex")||(this._monthsRegex=wo),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},pn.monthsShortRegex=function(e){return this._monthsParseExact?(l(this,"_monthsRegex")||ae.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(l(this,"_monthsShortRegex")||(this._monthsShortRegex=wo),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},pn.week=function(e){return ce(e,this._week.dow,this._week.doy).week},pn.firstDayOfYear=function(){return this._week.doy},pn.firstDayOfWeek=function(){return this._week.dow},pn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?me(n,this._week.dow):e?n[e.day()]:n},pn.weekdaysMin=function(e){return!0===e?me(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},pn.weekdaysShort=function(e){return!0===e?me(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},pn.weekdaysParse=ye,pn.weekdaysRegex=function(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||fe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=wo),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},pn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||fe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=wo),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},pn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||fe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=wo),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},pn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},pn.meridiem=function(e,t,o){return 11<e?o?"pm":"PM":o?"am":"AM"},Oe("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,o=1===v(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th";return e+o}}),t.lang=x("moment.lang is deprecated. Use moment.locale instead.",Oe),t.langData=x("moment.langData is deprecated. Use moment.localeData instead.",Te);var hn=uo,mn=Pt("ms"),gn=Pt("s"),yn=Pt("m"),fn=Pt("h"),bn=Pt("d"),_n=Pt("w"),vn=Pt("M"),kn=Pt("Q"),wn=Pt("y"),xn=Ft("milliseconds"),Sn=Ft("seconds"),On=Ft("minutes"),Dn=Ft("hours"),Tn=Ft("days"),Cn=Ft("months"),En=Ft("years"),Mn=ro,In={ss:44,s:45,m:45,h:22,d:26,M:11},Pn=uo,Fn=Je.prototype;return Fn.isValid=function(){return this._isValid},Fn.abs=function(){var e=this._data;return this._milliseconds=hn(this._milliseconds),this._days=hn(this._days),this._months=hn(this._months),e.milliseconds=hn(e.milliseconds),e.seconds=hn(e.seconds),e.minutes=hn(e.minutes),e.hours=hn(e.hours),e.months=hn(e.months),e.years=hn(e.years),this},Fn.add=function(e,t){return Ct(this,e,t,1)},Fn.subtract=function(e,t){return Ct(this,e,t,-1)},Fn.as=function(e){if(!this.isValid())return NaN;var t=this._milliseconds,o,n;if(e=M(e),"month"===e||"quarter"===e||"year"===e)switch(o=this._days+t/864e5,n=this._months+Mt(o),e){case"month":return n;case"quarter":return n/3;case"year":return n/12;}else switch(o=this._days+ro(It(this._months)),e){case"week":return o/7+t/6048e5;case"day":return o+t/864e5;case"hour":return 24*o+t/36e5;case"minute":return 1440*o+t/6e4;case"second":return 86400*o+t/1e3;case"millisecond":return go(864e5*o)+t;default:throw new Error("Unknown unit "+e);}},Fn.asMilliseconds=mn,Fn.asSeconds=gn,Fn.asMinutes=yn,Fn.asHours=fn,Fn.asDays=bn,Fn.asWeeks=_n,Fn.asMonths=vn,Fn.asQuarters=kn,Fn.asYears=wn,Fn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+2592e6*(this._months%12)+31536e6*v(this._months/12):NaN},Fn._bubble=function(){var e=this._milliseconds,t=this._days,o=this._months,n=this._data,i,a,d,s,r;return 0<=e&&0<=t&&0<=o||0>=e&&0>=t&&0>=o||(e+=864e5*Et(It(o)+t),t=0,o=0),n.milliseconds=e%1e3,i=_(e/1e3),n.seconds=i%60,a=_(i/60),n.minutes=a%60,d=_(a/60),n.hours=d%24,t+=_(d/24),r=_(Mt(t)),o+=r,t-=Et(It(r)),s=_(o/12),o%=12,n.days=t,n.months=o,n.years=s,this},Fn.clone=function(){return rt(this)},Fn.get=function(e){return e=M(e),this.isValid()?this[e+"s"]():NaN},Fn.milliseconds=xn,Fn.seconds=Sn,Fn.minutes=On,Fn.hours=Dn,Fn.days=Tn,Fn.weeks=function(){return _(this.days()/7)},Fn.months=Cn,Fn.years=En,Fn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),o=zt(this,!e,t);return e&&(o=t.pastFuture(+this,o)),t.postformat(o)},Fn.toISOString=Bt,Fn.toString=Bt,Fn.toJSON=Bt,Fn.locale=gt,Fn.localeData=yt,Fn.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Bt),Fn.lang=an,z("X",0,0,"unix"),z("x",0,0,"valueOf"),L("x",bo),L("X",ko),U("X",function(e,t,o){o._d=new Date(1e3*parseFloat(e,10))}),U("x",function(e,t,o){o._d=new Date(v(e))}),t.version="2.24.0",function(e){Ht=e}(Ke),t.fn=un,t.min=function(){var e=[].slice.call(arguments,0);return Qe("isBefore",e)},t.max=function(){var e=[].slice.call(arguments,0);return Qe("isAfter",e)},t.now=function(){return Date.now?Date.now():+new Date},t.utc=u,t.unix=function(e){return Ke(1e3*e)},t.months=function(e,t){return Dt(e,t,"months")},t.isDate=s,t.locale=Oe,t.invalid=g,t.duration=rt,t.isMoment=b,t.weekdays=function(e,t,o){return Tt(e,t,o,"weekdays")},t.parseZone=function(){return Ke.apply(null,arguments).parseZone()},t.localeData=Te,t.isDuration=et,t.monthsShort=function(e,t){return Dt(e,t,"monthsShort")},t.weekdaysMin=function(e,t,o){return Tt(e,t,o,"weekdaysMin")},t.defineLocale=De,t.updateLocale=function(e,t){if(null!=t){var o=Bo,n,i;i=Se(e),null!=i&&(o=i._config),t=T(o,t),n=new C(t),n.parentLocale=Ho[e],Ho[e]=n,Oe(e)}else null!=Ho[e]&&(null==Ho[e].parentLocale?null!=Ho[e]&&delete Ho[e]:Ho[e]=Ho[e].parentLocale);return Ho[e]},t.locales=Ce,t.weekdaysShort=function(e,t,o){return Tt(e,t,o,"weekdaysShort")},t.normalizeUnits=M,t.relativeTimeRounding=Nt,t.relativeTimeThreshold=function(e,t){return void 0!==In[e]&&(void 0===t?In[e]:(In[e]=t,"s"===e&&(In.ss=t-1),!0))},t.calendarFormat=function(e,t){var o=e.diff(t,"days",!0);return-6>o?"sameElse":-1>o?"lastWeek":0>o?"lastDay":1>o?"sameDay":2>o?"nextDay":7>o?"nextWeek":"sameElse"},t.prototype=un,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t})}),cn=[],un=0;256>un;un++)cn[un]=(un+256).toString(16).substr(1);for(var pn=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues){var e=new Uint8Array(16);return function(){return crypto.getRandomValues(e),e}}var t=Array(16);return function(){for(var e=0,o;16>e;e++)0==(3&e)&&(o=4294967296*Math.random()),t[e]=255&o>>>((3&e)<<3);return t}}(),hn=[],mn=0;256>mn;mn++)hn[mn]=(mn+256).toString(16).substr(1);var gn=pn(),yn=[1|gn[0],gn[1],gn[2],gn[3],gn[4],gn[5]],fn=16383&(gn[6]<<8|gn[7]),bn=/^\/?Date\((-?\d+)/i,_n=function(){function e(t){Go(this,e),this._queue=[],this._timeout=null,this._extended=null,this.delay=null,this.max=1/0,this.setOptions(t)}return qo(e,[{key:"setOptions",value:function(e){e&&"undefined"!=typeof e.delay&&(this.delay=e.delay),e&&"undefined"!=typeof e.max&&(this.max=e.max),this._flushIfNeeded()}},{key:"destroy",value:function(){if(this.flush(),this._extended){for(var e=this._extended.object,t=this._extended.methods,o=0,n;o<t.length;o++)n=t[o],n.original?e[n.name]=n.original:delete e[n.name];this._extended=null}}},{key:"replace",value:function(e,t){var o=this,n=e[t];if(!n)throw new Error("Method "+t+" undefined");e[t]=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];o.queue({args:t,fn:n,context:this})}}},{key:"queue",value:function(e){"function"==typeof e?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}},{key:"_flushIfNeeded",value:function(){var e=this;this._queue.length>this.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),0<this.queue.length&&"number"==typeof this.delay&&(this._timeout=setTimeout(function(){e.flush()},this.delay))}},{key:"flush",value:function(){this._queue.splice(0).forEach(function(e){e.fn.apply(e.context||e.fn,e.args||[])})}}],[{key:"extend",value:function(t,o){var n=new e(o);if(void 0!==t.flush)throw new Error("Target object already has a property flush");t.flush=function(){n.flush()};var a=[{name:"flush",original:void 0}];if(o&&o.replace)for(var d=0,s;d<o.replace.length;d++)s=o.replace[d],a.push({name:s,original:t[s]}),n.replace(t,s);return n._extended={object:t,methods:a},n}}]),e}(),vn=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")},kn=function(e){return Me(e)||Ie(e)||vn()},wn=function(){function e(){Go(this,e),this._subscribers={"*":[],add:[],remove:[],update:[]},this.subscribe=e.prototype.on,this.unsubscribe=e.prototype.off}return qo(e,[{key:"_trigger",value:function(e,t,o){if("*"===e)throw new Error("Cannot trigger event *");for(var n=[].concat(kn(this._subscribers[e]),kn(this._subscribers["*"])),a=0,d=n.length,s;a<d;a++)s=n[a],s.callback&&s.callback(e,t,null==o?null:o)}},{key:"on",value:function(e,t){this._subscribers[e].push({callback:t})}},{key:"off",value:function(e,t){this._subscribers[e]=this._subscribers[e].filter(function(e){return e.callback!==t})}}]),e}(),xn=function(e){function t(e,o){var n;if(Go(this,t),n=Xo(this,Ko(t).call(this)),e&&!Array.isArray(e)&&(o=e,e=[]),n._options=o||{},n._data=Object.create({}),n.length=0,n._idProp=n._options.fieldId||"id",n._type={},n._options.type)for(var a=Object.keys(n._options.type),d=0,s=a.length;d<s;d++){var r=a[d],l=n._options.type[r];n._type[r]="Date"==l||"ISODate"==l||"ASPDate"==l?"Date":l}return e&&e.length&&n.add(e),n.setOptions(o),n}return $o(t,e),qo(t,[{key:"setOptions",value:function(e){e&&void 0!==e.queue&&(!1===e.queue?this._queue&&(this._queue.destroy(),delete this._queue):(!this._queue&&(this._queue=_n.extend(this,{replace:["add","update","remove"]})),e.queue&&"object"===Vo(e.queue)&&this._queue.setOptions(e.queue)))}},{key:"add",value:function(e,t){var o=[],n;if(Array.isArray(e))for(var a=0,d=e.length;a<d;a++)n=this._addItem(e[a]),o.push(n);else if(e&&"object"===Vo(e))n=this._addItem(e),o.push(n);else throw new Error("Unknown dataType");return o.length&&this._trigger("add",{items:o},t),o}},{key:"update",value:function(e,t){var o=this,n=[],a=[],d=[],s=[],r=this._idProp,l=function(e){var t=e[r];if(null!=t&&o._data[t]){var i=e,l=Object.assign({},o._data[t]),c=o._updateItem(i);a.push(c),s.push(i),d.push(l)}else{var u=o._addItem(e);n.push(u)}};if(Array.isArray(e))for(var c=0,u=e.length;c<u;c++)e[c]&&"object"===Vo(e[c])?l(e[c]):console.warn("Ignoring input item, which is not an object at index "+c);else if(e&&"object"===Vo(e))l(e);else throw new Error("Unknown dataType");if(n.length&&this._trigger("add",{items:n},t),a.length){this._trigger("update",{items:a,oldData:d,data:s},t)}return n.concat(a)}},{key:"get",value:function(e,t){var o=void 0,n=void 0,a=void 0;Ee(e)?(o=e,a=t):Array.isArray(e)?(n=e,a=t):a=e;var d=a&&"Object"===a.returnType?"Object":"Array",s=a&&a.type||this._options.type,r=a&&a.filter,l=[],c=null,u=null,p=null;if(null!=o)c=this._getItem(o,s),c&&r&&!r(c)&&(c=null);else if(null!=n)for(var h=0,m=n.length;h<m;h++)c=this._getItem(n[h],s),null!=c&&(!r||r(c))&&l.push(c);else{u=Object.keys(this._data);for(var g=0,y=u.length;g<y;g++)p=u[g],c=this._getItem(p,s),null!=c&&(!r||r(c))&&l.push(c)}if(a&&a.order&&null==o&&this._sort(l,a.order),a&&a.fields){var f=a.fields;if(null!=o&&null!=c)c=this._filterFields(c,f);else for(var b=0,_=l.length;b<_;b++)l[b]=this._filterFields(l[b],f)}if("Object"==d){for(var v={},k=0,w=l.length;k<w;k++){var x=l[k],S=x[this._idProp];v[S]=x}return v}return null==o?l:c}},{key:"getIds",value:function(e){var t=this._data,o=e&&e.filter,n=e&&e.order,a=e&&e.type||this._options.type,d=Object.keys(t),s=[],r,l;if(o){if(n){l=[];for(var c=0,u=d.length,p;c<u;c++)p=d[c],r=this._getItem(p,a),o(r)&&l.push(r);this._sort(l,n);for(var h=0,m=l.length;h<m;h++)s.push(l[h][this._idProp])}else for(var g=0,y=d.length,f;g<y;g++)f=d[g],r=this._getItem(f,a),o(r)&&s.push(r[this._idProp]);}else if(n){l=[];for(var b=0,_=d.length,v;b<_;b++)v=d[b],l.push(t[v]);this._sort(l,n);for(var k=0,w=l.length;k<w;k++)s.push(l[k][this._idProp])}else for(var x=0,S=d.length,O;x<S;x++)O=d[x],r=t[O],s.push(r[this._idProp]);return s}},{key:"getDataSet",value:function(){return this}},{key:"forEach",value:function(e,t){var o=t&&t.filter,n=t&&t.type||this._options.type,a=this._data,d=Object.keys(a);if(t&&t.order)for(var s=this.get(t),r=0,l=s.length;r<l;r++){var c=s[r],u=c[this._idProp];e(c,u)}else for(var p=0,h=d.length;p<h;p++){var m=d[p],g=this._getItem(m,n);(!o||o(g))&&e(g,m)}}},{key:"map",value:function(e,t){for(var o=t&&t.filter,n=t&&t.type||this._options.type,a=[],d=this._data,s=Object.keys(d),r=0,l=s.length;r<l;r++){var c=s[r],u=this._getItem(c,n);(!o||o(u))&&a.push(e(u,c))}return t&&t.order&&this._sort(a,t.order),a}},{key:"_filterFields",value:function(e,t){return e?(Array.isArray(t)?t:Object.keys(t)).reduce(function(t,o){return t[o]=e[o],t},{}):e}},{key:"_sort",value:function(e,t){if("string"==typeof t){var o=t;e.sort(function(e,t){var n=e[o],i=t[o];return n>i?1:n<i?-1:0})}else if("function"==typeof t)e.sort(t);else throw new TypeError("Order must be a function or a string")}},{key:"remove",value:function(e,t){for(var o=[],n=[],a=Array.isArray(e)?e:[e],d=0,s=a.length,r;d<s;d++)if(r=this._remove(a[d]),r){var l=r[this._idProp];null!=l&&(o.push(l),n.push(r))}return o.length&&this._trigger("remove",{items:o,oldData:n},t),o}},{key:"_remove",value:function(e){var t;if(Ee(e)?t=e:e&&"object"===Vo(e)&&(t=e[this._idProp]),null!=t&&this._data[t]){var o=this._data[t];return delete this._data[t],--this.length,o}return null}},{key:"clear",value:function(e){for(var t=Object.keys(this._data),o=[],n=0,a=t.length;n<a;n++)o.push(this._data[t[n]]);return this._data={},this.length=0,this._trigger("remove",{items:t,oldData:o},e),t}},{key:"max",value:function e(t){for(var o=this._data,n=Object.keys(o),e=null,a=null,d=0,s=n.length;d<s;d++){var r=n[d],l=o[r],c=l[t];null!=c&&(null==a||c>a)&&(e=l,a=c)}return e}},{key:"min",value:function e(t){for(var o=this._data,n=Object.keys(o),e=null,a=null,d=0,s=n.length;d<s;d++){var r=n[d],l=o[r],c=l[t];null!=c&&(null==a||c<a)&&(e=l,a=c)}return e}},{key:"distinct",value:function(e){for(var t=this._data,o=Object.keys(t),n=[],a=this._options.type&&this._options.type[e]||null,d=0,s=0,r=o.length;s<r;s++){for(var l=o[s],c=t[l],u=c[e],p=!1,h=0;h<d;h++)if(n[h]==u){p=!0;break}p||void 0===u||(n[d]=u,d++)}if(a)for(var m=0,g=n.length;m<g;m++)n[m]=Te(n[m],a);return n}},{key:"_addItem",value:function(e){var t=e[this._idProp];if(null==t)t=ve(),e[this._idProp]=t;else if(this._data[t])throw new Error("Cannot add item: item with id "+t+" already exists");for(var o={},n=Object.keys(e),a=0,d=n.length;a<d;a++){var s=n[a],r=this._type[s];o[s]=Te(e[s],r)}return this._data[t]=o,this.length++,t}},{key:"_getItem",value:function(e,t){var o=this._data[e];if(!o)return null;var n=Object.keys(o),a;if(t){a={};for(var d=0,s=n.length;d<s;d++){var r=n[d],l=o[r];a[r]=Te(l,t[r])}}else a=Fe({},o);return null==a[this._idProp]&&(a[this._idProp]=o.id),a}},{key:"_updateItem",value:function(e){var t=e[this._idProp];if(null==t)throw new Error("Cannot update item: item has no id (item: "+JSON.stringify(e)+")");var o=this._data[t];if(!o)throw new Error("Cannot update item: no item with id "+t+" found");for(var n=Object.keys(e),a=0,d=n.length;a<d;a++){var s=n[a],r=this._type[s];o[s]=Te(e[s],r)}return t}}]),t}(wn),Sn=function(e){function t(e,o){var n;return Go(this,t),n=Xo(this,Ko(t).call(this)),n.length=0,n._ids={},n._options=o||{},n.listener=n._onEvent.bind(Zo(n)),n.setData(e),n}return $o(t,e),qo(t,[{key:"setData",value:function(e){if(this._data){this._data.off&&this._data.off("*",this.listener);var t=this._data.getIds({filter:this._options.filter}),o=this._data.get(t);this._ids={},this.length=0,this._trigger("remove",{items:t,oldData:o})}if(null!=e){this._data=e;for(var n=this._data.getIds({filter:this._options.filter}),a=0,d=n.length,s;a<d;a++)s=n[a],this._ids[s]=!0;this.length=n.length,this._trigger("add",{items:n})}else this._data=new xn;this._data.on&&this._data.on("*",this.listener)}},{key:"refresh",value:function(){for(var e=this._data.getIds({filter:this._options.filter}),t=Object.keys(this._ids),o={},n=[],a=[],d=[],s=0,r=e.length,l;s<r;s++)l=e[s],o[l]=!0,this._ids[l]||(n.push(l),this._ids[l]=!0);for(var c=0,u=t.length;c<u;c++){var p=t[c],h=this._data.get(p);null==h?console.error("If you see this, report it please."):!o[p]&&(a.push(p),d.push(h),delete this._ids[p])}this.length+=n.length-a.length,n.length&&this._trigger("add",{items:n}),a.length&&this._trigger("remove",{items:a,oldData:d})}},{key:"get",value:function(e,t){if(null==this._data)return null;var o=null,n;Ee(e)||Array.isArray(e)?(o=e,n=t):n=e;var i=Object.assign({},this._options,n),a=this._options.filter,d=n&&n.filter;return a&&d&&(i.filter=function(e){return a(e)&&d(e)}),null==o?this._data.get(i):this._data.get(o,i)}},{key:"getIds",value:function(e){if(this._data.length){var t=this._options.filter,o=null==e?null:e.filter,n;return n=o?t?function(e){return t(e)&&o(e)}:o:t,this._data.getIds({filter:n,order:e&&e.order})}return[]}},{key:"forEach",value:function(e,t){if(this._data){var o=this._options.filter,n=t&&t.filter,i;i=n?o?function(e){return o(e)&&n(e)}:n:o,this._data.forEach(e,{filter:i,order:t&&t.order})}}},{key:"map",value:function(e,t){if(this._data){var o=this._options.filter,n=t&&t.filter,i;return i=n?o?function(e){return o(e)&&n(e)}:n:o,this._data.map(e,{filter:i,order:t&&t.order})}return[]}},{key:"getDataSet",value:function(){return this._data.getDataSet()}},{key:"_onEvent",value:function(e,t,o){if(t&&t.items&&this._data){var n=t.items,a=[],d=[],s=[],r=[],l=[],c=[];switch(e){case"add":for(var u=0,p=n.length;u<p;u++){var h=n[u],m=this.get(h);m&&(this._ids[h]=!0,a.push(h))}break;case"update":for(var g=0,y=n.length;g<y;g++){var f=n[g],b=this.get(f);b?this._ids[f]?(d.push(f),l.push(t.data[g]),r.push(t.oldData[g])):(this._ids[f]=!0,a.push(f)):this._ids[f]&&(delete this._ids[f],s.push(f),c.push(t.oldData[g]))}break;case"remove":for(var _=0,v=n.length,k;_<v;_++)k=n[_],this._ids[k]&&(delete this._ids[k],s.push(k),c.push(t.oldData[_]));}this.length+=a.length-s.length,a.length&&this._trigger("add",{items:a},o),d.length&&this._trigger("update",{items:d,oldData:r,data:l},o),s.length&&this._trigger("remove",{items:s,oldData:c},o)}}}]),t}(wn),On=Object.freeze({default:{DataSet:xn,DataView:Sn,Queue:_n},DataSet:xn,DataView:Sn,Queue:_n});"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.circle=function(e,t,o){this.beginPath(),this.arc(e,t,o,0,2*po,!1),this.closePath()},CanvasRenderingContext2D.prototype.square=function(e,t,o){this.beginPath(),this.rect(e-o,t-o,2*o,2*o),this.closePath()},CanvasRenderingContext2D.prototype.triangle=function(e,t,o){this.beginPath(),o*=1.15,t+=.275*o;var n=2*o,i=n/2,a=mo(3)/6*n,d=mo(n*n-i*i);this.moveTo(e,t-(d-a)),this.lineTo(e+i,t+a),this.lineTo(e-i,t+a),this.lineTo(e,t-(d-a)),this.closePath()},CanvasRenderingContext2D.prototype.triangleDown=function(e,t,o){this.beginPath(),o*=1.15,t-=.275*o;var n=2*o,i=n/2,a=mo(3)/6*n,d=mo(n*n-i*i);this.moveTo(e,t+(d-a)),this.lineTo(e+i,t-a),this.lineTo(e-i,t-a),this.lineTo(e,t+(d-a)),this.closePath()},CanvasRenderingContext2D.prototype.star=function(e,t,o){this.beginPath(),o*=.82,t+=.1*o;for(var i=0,a;10>i;i++)a=0==i%2?1.3*o:.5*o,this.lineTo(e+a*so(2*i*po/10),t-a*ao(2*i*po/10));this.closePath()},CanvasRenderingContext2D.prototype.diamond=function(e,t,o){this.beginPath(),this.lineTo(e,t+o),this.lineTo(e+o,t),this.lineTo(e,t-o),this.lineTo(e-o,t),this.closePath()},CanvasRenderingContext2D.prototype.roundRect=function(e,t,o,n,i){var a=po/180;0>o-2*i&&(i=o/2),0>n-2*i&&(i=n/2),this.beginPath(),this.moveTo(e+i,t),this.lineTo(e+o-i,t),this.arc(e+o-i,t+i,i,270*a,360*a,!1),this.lineTo(e+o,t+n-i),this.arc(e+o-i,t+n-i,i,0,90*a,!1),this.lineTo(e+i,t+n),this.arc(e+i,t+n-i,i,90*a,180*a,!1),this.lineTo(e,t+i),this.arc(e+i,t+i,i,180*a,270*a,!1),this.closePath()},CanvasRenderingContext2D.prototype.ellipse_vis=function(e,t,o,n){var i=.5522848,a=o/2*i,d=n/2*i,s=e+o,r=t+n,l=e+o/2,c=t+n/2;this.beginPath(),this.moveTo(e,c),this.bezierCurveTo(e,c-d,l-a,t,l,t),this.bezierCurveTo(l+a,t,s,c-d,s,c),this.bezierCurveTo(s,c+d,l+a,r,l,r),this.bezierCurveTo(l-a,r,e,c+d,e,c),this.closePath()},CanvasRenderingContext2D.prototype.database=function(e,t,o,n){var i=o,a=n*(1/3),d=.5522848,s=i/2*d,r=a/2*d,l=e+i,c=t+a,u=e+i/2,p=t+a/2,h=t+(n-a/2),m=t+n;this.beginPath(),this.moveTo(l,p),this.bezierCurveTo(l,p+r,u+s,c,u,c),this.bezierCurveTo(u-s,c,e,p+r,e,p),this.bezierCurveTo(e,p-r,u-s,t,u,t),this.bezierCurveTo(u+s,t,l,p-r,l,p),this.lineTo(l,h),this.bezierCurveTo(l,h+r,u+s,m,u,m),this.bezierCurveTo(u-s,m,e,h+r,e,h),this.lineTo(e,p)},CanvasRenderingContext2D.prototype.dashedLine=function(e,t,o,n,i){this.beginPath(),this.moveTo(e,t);for(var a=i.length,d=o-e,s=n-t,r=s/d,l=mo(d*d+s*s),c=0,u=!0,p=0,h=i[0];.1<=l;)h=i[c++%a],h>l&&(h=l),p=mo(h*h/(1+r*r)),p=0>d?-p:p,e+=p,t+=r*p,!0===u?this.lineTo(e,t):this.moveTo(e,t),l-=h,u=!u},CanvasRenderingContext2D.prototype.hexagon=function(e,t,o){this.beginPath();var n=2*po/6;this.moveTo(e+o,t);for(var a=1;a<6;a++)this.lineTo(e+o*ao(n*a),t+o*so(n*a));this.closePath()});var Dn="undefined"==typeof globalThis?"undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?{}:self:global:window:globalThis,Tn=ze(function(e){function t(e){if(e)return o(e)}function o(e){for(var o in t.prototype)e[o]=t.prototype[o];return e}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function o(){this.off(e,o),t.apply(this,arguments)}return o.fn=t,this.on(e,o),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var o=this._callbacks["$"+e];if(!o)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var n=0,a;n<o.length;n++)if(a=o[n],a===t||a.fn===t){o.splice(n,1);break}return 0===o.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),o=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(o){o=o.slice(0);for(var n=0,a=o.length;n<a;++n)o[n].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}}),Cn={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},En=Object.create(Cn);En.color="color.color",En.style="dashes";var Mn={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},In={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},Pn="",Fn=0,Yn="",zn="",Nn=Mn.NULL,Rn=/[a-zA-Z_0-9.:#]/,Bn=Ne,Hn=function(e){var t=Ne(e),o={nodes:[],edges:[],options:{}};if(t.nodes&&t.nodes.forEach(function(e){var t={id:e.id,label:(e.label||e.id)+""};Ae(t,at(e.attr,Cn)),t.image&&(t.shape="image"),o.nodes.push(t)}),t.edges){var n=function(e){var t={from:e.from,to:e.to};return Ae(t,at(e.attr,En)),null==t.arrows&&"->"===e.type&&(t.arrows="to"),t};t.edges.forEach(function(e){var t,i;t=e.from instanceof Object?e.from.nodes:{id:e.from},i=e.to instanceof Object?e.to.nodes:{id:e.to},e.from instanceof Object&&e.from.edges&&e.from.edges.forEach(function(e){var t=n(e);o.edges.push(t)}),nt(t,i,function(t,i){var a=Ve(o,t.id,i.id,e.type,e.attr),d=n(a);o.edges.push(d)}),e.to instanceof Object&&e.to.edges&&e.to.edges.forEach(function(e){var t=n(e);o.edges.push(t)})})}return t.attr&&(o.options=t.attr),o},Ln={parseDOT:Bn,DOTToGraph:Hn},An=Object.freeze({default:Ln,__moduleExports:Ln,parseDOT:Bn,DOTToGraph:Hn}),Wn=Object.freeze({parseGephi:dt}),jn=Object.freeze({}),Un=ze(function(e){(function(t,o){e.exports=o()})(Dn,function(){function e(e){var t=String.fromCharCode,o=e&&e.preventDefault||!1,n=e&&e.container||window,a={},d={keydown:{},keyup:{}},s={},r;for(r=97;122>=r;r++)s[t(r)]={code:65+(r-97),shift:!1};for(r=65;90>=r;r++)s[t(r)]={code:r,shift:!0};for(r=0;9>=r;r++)s[""+r]={code:48+r,shift:!1};for(r=1;12>=r;r++)s["F"+r]={code:111+r,shift:!1};for(r=0;9>=r;r++)s["num"+r]={code:96+r,shift:!1};s["num*"]={code:106,shift:!1},s["num+"]={code:107,shift:!1},s["num-"]={code:109,shift:!1},s["num/"]={code:111,shift:!1},s["num."]={code:110,shift:!1},s.left={code:37,shift:!1},s.up={code:38,shift:!1},s.right={code:39,shift:!1},s.down={code:40,shift:!1},s.space={code:32,shift:!1},s.enter={code:13,shift:!1},s.shift={code:16,shift:void 0},s.esc={code:27,shift:!1},s.backspace={code:8,shift:!1},s.tab={code:9,shift:!1},s.ctrl={code:17,shift:!1},s.alt={code:18,shift:!1},s["delete"]={code:46,shift:!1},s.pageup={code:33,shift:!1},s.pagedown={code:34,shift:!1},s["="]={code:187,shift:!1},s["-"]={code:189,shift:!1},s["]"]={code:221,shift:!1},s["["]={code:219,shift:!1};var l=function(e){u(e,"keydown")},c=function(e){u(e,"keyup")},u=function(e,t){if(void 0!==d[t][e.keyCode]){for(var n=d[t][e.keyCode],a=0;a<n.length;a++)void 0===n[a].shift?n[a].fn(e):!0==n[a].shift&&!0==e.shiftKey?n[a].fn(e):!1==n[a].shift&&!1==e.shiftKey&&n[a].fn(e);!0==o&&e.preventDefault()}};return a.bind=function(e,t,o){if(void 0===o&&(o="keydown"),void 0===s[e])throw new Error("unsupported key: "+e);void 0===d[o][s[e].code]&&(d[o][s[e].code]=[]),d[o][s[e].code].push({fn:t,shift:s[e].shift})},a.bindAll=function(e,t){for(var o in void 0===t&&(t="keydown"),s)s.hasOwnProperty(o)&&a.bind(o,e,t)},a.getKey=function(e){for(var t in s)if(s.hasOwnProperty(t)){if(!0==e.shiftKey&&!0==s[t].shift&&e.keyCode==s[t].code)return t;if(!1==e.shiftKey&&!1==s[t].shift&&e.keyCode==s[t].code)return t;if(e.keyCode==s[t].code&&"shift"==t)return t}return"unknown key, currently not supported"},a.unbind=function(e,t,o){if(void 0===o&&(o="keydown"),void 0===s[e])throw new Error("unsupported key: "+e);if(void 0!==t){var n=[],a=d[o][s[e].code];if(void 0!==a)for(var r=0;r<a.length;r++)(a[r].fn!=t||a[r].shift!=s[e].shift)&&n.push(d[o][s[e].code][r]);d[o][s[e].code]=n}else d[o][s[e].code]=[]},a.reset=function(){d={keydown:{},keyup:{}}},a.destroy=function(){d={keydown:{},keyup:{}},n.removeEventListener("keydown",l,!0),n.removeEventListener("keyup",c,!0)},n.addEventListener("keydown",l,!0),n.addEventListener("keyup",c,!0),a}return e})}),Vn=Object.freeze({default:Un,__moduleExports:Un}),Gn;Gn="function"==typeof Object.assign?Object.assign:function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),o=1,n;o<arguments.length;o++)if(n=arguments[o],void 0!==n&&null!==n)for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i]);return t};var qn=Gn,Zn=["","webkit","Moz","MS","ms","o"],Xn="undefined"==typeof document?{style:{}}:document.createElement("div"),Kn=ro,Qn=uo,$n=Date.now,Jn;Jn="undefined"==typeof window?{}:window;var ei=ct(Xn.style,"touchAction"),ti=ei!==void 0,oi="compute",ni="none",ii="pan-x",ai="pan-y",di=ut(),si=/mobile|tablet|ip(ad|hone|od)|android/i,ri="ontouchstart"in Jn,li=ct(Jn,"PointerEvent")!==void 0,ci=ri&&si.test(navigator.userAgent),ui="touch",pi="mouse",hi=1,mi=2,gi=4,yi=8,fi=1,bi=2,_i=4,vi=8,ki=16,wi=bi|_i,xi=vi|ki,Si=wi|xi,Oi=["x","y"],Di=["clientX","clientY"],Ti=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){e===oi&&(e=this.compute()),ti&&this.manager.element.style&&di[e]&&(this.manager.element.style[ei]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var e=[];return pt(this.manager.recognizers,function(t){ht(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),gt(e.join(" "))},t.preventDefaults=function(e){var t=e.srcEvent,o=e.offsetDirection;if(this.manager.session.prevented)return void t.preventDefault();var n=this.actions,i=mt(n,ni)&&!di[ni],a=mt(n,ai)&&!di[ai],d=mt(n,ii)&&!di[ii];if(i){var s=1===e.pointers.length,r=2>e.distance,l=250>e.deltaTime;if(s&&r&&l)return}return d&&a?void 0:i||a&&o&wi||d&&o&xi?this.preventSrc(t):void 0},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}(),Ci=function(){function e(e,t){var o=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){ht(e.options.enable,[e])&&o.handler(t)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&Mt(this.element,this.evEl,this.domHandler),this.evTarget&&Mt(this.target,this.evTarget,this.domHandler),this.evWin&&Mt(Pt(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&It(this.element,this.evEl,this.domHandler),this.evTarget&&It(this.target,this.evTarget,this.domHandler),this.evWin&&It(Pt(this.element),this.evWin,this.domHandler)},e}(),Ei={pointerdown:hi,pointermove:mi,pointerup:gi,pointercancel:yi,pointerout:yi},Mi={2:ui,3:"pen",4:pi,5:"kinect"},Ii="pointerdown",Pi="pointermove pointerup pointercancel";Jn.MSPointerEvent&&!Jn.PointerEvent&&(Ii="MSPointerDown",Pi="MSPointerMove MSPointerUp MSPointerCancel");var Fi=function(e){function t(){var o=t.prototype,n;return o.evEl=Ii,o.evWin=Pi,n=e.apply(this,arguments)||this,n.store=n.manager.session.pointerEvents=[],n}rt(t,e);var o=t.prototype;return o.handler=function(e){var t=this.store,o=!1,n=e.type.toLowerCase().replace("ms",""),i=Ei[n],a=Mi[e.pointerType]||e.pointerType,d=Ft(t,e.pointerId,"pointerId");i&hi&&(0===e.button||a===ui)?0>d&&(t.push(e),d=t.length-1):i&(gi|yi)&&(o=!0),0>d||(t[d]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),o&&t.splice(d,1))},t}(Ci),Yi={touchstart:hi,touchmove:mi,touchend:gi,touchcancel:yi},zi=function(e){function t(){var o;return t.prototype.evTarget="touchstart touchmove touchend touchcancel",o=e.apply(this,arguments)||this,o.targetIds={},o}rt(t,e);var o=t.prototype;return o.handler=function(e){var t=Yi[e.type],o=Nt.call(this,e,t);o&&this.callback(this.manager,t,{pointers:o[0],changedPointers:o[1],pointerType:ui,srcEvent:e})},t}(Ci),Ni={mousedown:hi,mousemove:mi,mouseup:gi},Ri=function(e){function t(){var o=t.prototype,n;return o.evEl="mousedown",o.evWin="mousemove mouseup",n=e.apply(this,arguments)||this,n.pressed=!1,n}rt(t,e);var o=t.prototype;return o.handler=function(e){var t=Ni[e.type];t&hi&&0===e.button&&(this.pressed=!0),t&mi&&1!==e.which&&(t=gi),this.pressed&&(t&gi&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:pi,srcEvent:e}))},t}(Ci),Bi=function(){var e=function(e){function t(t,o){var n;return n=e.call(this,t,o)||this,n.handler=function(e,t,o){var i=o.pointerType===ui,a=o.pointerType===pi;if(!(a&&o.sourceCapabilities&&o.sourceCapabilities.firesTouchEvents)){if(i)Bt.call(lt(lt(n)),t,o);else if(a&&Ht.call(lt(lt(n)),o))return;n.callback(e,t,o)}},n.touch=new zi(n.manager,n.handler),n.mouse=new Ri(n.manager,n.handler),n.primaryTouch=null,n.lastTouches=[],n}rt(t,e);var o=t.prototype;return o.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Ci);return e}(),Hi=1,Li=2,Ai=4,Wi=8,ji=Wi,Ui=16,Vi=32,Gi=1,qi=function(){function e(e){void 0===e&&(e={}),this.options=st({enable:!0},e),this.id=Wt(),this.manager=null,this.state=Hi,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return qn(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(At(e,"recognizeWith",this))return this;var t=this.simultaneous;return e=jt(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},t.dropRecognizeWith=function(e){return At(e,"dropRecognizeWith",this)?this:(e=jt(e,this),delete this.simultaneous[e.id],this)},t.requireFailure=function(e){if(At(e,"requireFailure",this))return this;var t=this.requireFail;return e=jt(e,this),-1===Ft(t,e)&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(At(e,"dropRequireFailure",this))return this;e=jt(e,this);var t=Ft(this.requireFail,e);return-1<t&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return 0<this.requireFail.length},t.canRecognizeWith=function(e){return!!this.simultaneous[e.id]},t.emit=function e(t){function e(n){o.manager.emit(n,t)}var o=this,n=this.state;n<Wi&&e(o.options.event+Ut(n)),e(o.options.event),t.additionalEvent&&e(t.additionalEvent),n>=Wi&&e(o.options.event+Ut(n))},t.tryEmit=function(e){return this.canEmit()?this.emit(e):void(this.state=Vi)},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(Vi|Hi)))return!1;e++}return!0},t.recognize=function(e){var t=qn({},e);return ht(this.options.enable,[this,t])?void(this.state&(ji|Ui|Vi)&&(this.state=Hi),this.state=this.process(t),this.state&(Li|Ai|Wi|Ui)&&this.tryEmit(t)):(this.reset(),void(this.state=Vi))},t.process=function(){},t.getTouchAction=function(){},t.reset=function(){},e}(),Zi={domEvents:!1,touchAction:oi,enable:!0,inputTarget:null,inputClass:null,preset:[],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Xi=2,Ki=function(){function e(e,t){var o=this;this.options=qn({},Zi,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=Lt(this),this.touchAction=new Ti(this,this.options.touchAction),Vt(this,!0),pt(this.options.recognizers,function(e){var t=o.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}var t=e.prototype;return t.set=function(e){return qn(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},t.stop=function(e){this.session.stopped=e?Xi:1},t.recognize=function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var o=this.recognizers,n=t.curRecognizer,a;(!n||n&&n.state&ji)&&(t.curRecognizer=null,n=null);for(var d=0;d<o.length;)a=o[d],t.stopped!==Xi&&(!n||a===n||a.canRecognizeWith(n))?a.recognize(e):a.reset(),!n&&a.state&(Li|Ai|Wi)&&(t.curRecognizer=a,n=a),d++}},t.get=function(e){if(e instanceof qi)return e;for(var t=this.recognizers,o=0;o<t.length;o++)if(t[o].options.event===e)return t[o];return null},t.add=function(e){if(At(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},t.remove=function(e){if(At(e,"remove",this))return this;var t=this.get(e);if(e){var o=this.recognizers,n=Ft(o,t);-1!==n&&(o.splice(n,1),this.touchAction.update())}return this},t.on=function(e,t){if(void 0===e||void 0===t)return this;var o=this.handlers;return pt(Et(e),function(e){o[e]=o[e]||[],o[e].push(t)}),this},t.off=function(e,t){if(void 0===e)return this;var o=this.handlers;return pt(Et(e),function(e){t?o[e]&&o[e].splice(Ft(o[e],t),1):delete o[e]}),this},t.emit=function(e,t){this.options.domEvents&&Gt(e,t);var o=this.handlers[e]&&this.handlers[e].slice();if(o&&o.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var n=0;n<o.length;)o[n](t),n++}},t.destroy=function(){this.element&&Vt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),Qi={touchstart:hi,touchmove:mi,touchend:gi,touchcancel:yi},$i=function(e){function t(){var o=t.prototype,n;return o.evTarget="touchstart",o.evWin="touchstart touchmove touchend touchcancel",n=e.apply(this,arguments)||this,n.started=!1,n}rt(t,e);var o=t.prototype;return o.handler=function(e){var t=Qi[e.type];if(t===hi&&(this.started=!0),!!this.started){var o=qt.call(this,e,t);t&(gi|yi)&&0==o[0].length-o[1].length&&(this.started=!1),this.callback(this.manager,t,{pointers:o[0],changedPointers:o[1],pointerType:ui,srcEvent:e})}},t}(Ci),Ji=function(e){function t(t){return void 0===t&&(t={}),e.call(this,st({pointers:1},t))||this}rt(t,e);var o=t.prototype;return o.attrTest=function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},o.process=function(e){var t=this.state,o=e.eventType,n=t&(Li|Ai),i=this.attrTest(e);return n&&(o&yi||!i)?t|Ui:n||i?o&gi?t|Wi:t&Li?t|Ai:Li:Vi},t}(qi),ea=function(e){function t(t){var o;return void 0===t&&(t={}),o=e.call(this,st({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,o.pTime=!1,o.pCenter=!1,o._timer=null,o._input=null,o.count=0,o}rt(t,e);var o=t.prototype;return o.getTouchAction=function(){return["manipulation"]},o.process=function(e){var t=this,o=this.options,n=e.pointers.length===o.pointers,i=e.distance<o.threshold,a=e.deltaTime<o.time;if(this.reset(),e.eventType&hi&&0===this.count)return this.failTimeout();if(i&&a&&n){if(e.eventType!==gi)return this.failTimeout();var d=!this.pTime||e.timeStamp-this.pTime<o.interval,s=!this.pCenter||_t(this.pCenter,e.center)<o.posThreshold;this.pTime=e.timeStamp,this.pCenter=e.center,s&&d?this.count+=1:this.count=1,this._input=e;var r=this.count%o.taps;if(0==r)return this.hasRequireFailures()?(this._timer=setTimeout(function(){t.state=ji,t.tryEmit()},o.interval),Li):ji}return Vi},o.failTimeout=function(){var e=this;return this._timer=setTimeout(function(){e.state=Vi},this.options.interval),Vi},o.reset=function(){clearTimeout(this._timer)},o.emit=function(){this.state===ji&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(qi),ta=function(e){function t(t){var o;return void 0===t&&(t={}),o=e.call(this,st({event:"pan",threshold:10,pointers:1,direction:Si},t))||this,o.pX=null,o.pY=null,o}rt(t,e);var o=t.prototype;return o.getTouchAction=function(){var e=this.options.direction,t=[];return e&wi&&t.push(ai),e&xi&&t.push(ii),t},o.directionTest=function(e){var t=this.options,o=!0,n=e.distance,i=e.direction,a=e.deltaX,d=e.deltaY;return i&t.direction||(t.direction&wi?(i=0===a?fi:0>a?bi:_i,o=a!==this.pX,n=uo(e.deltaX)):(i=0===d?fi:0>d?vi:ki,o=d!==this.pY,n=uo(e.deltaY))),e.direction=i,o&&n>t.threshold&&i&t.direction},o.attrTest=function(e){return Ji.prototype.attrTest.call(this,e)&&(this.state&Li||!(this.state&Li)&&this.directionTest(e))},o.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var o=Zt(t.direction);o&&(t.additionalEvent=this.options.event+o),e.prototype.emit.call(this,t)},t}(Ji),oa=function(e){function t(t){return void 0===t&&(t={}),e.call(this,st({event:"swipe",threshold:10,velocity:.3,direction:wi|xi,pointers:1},t))||this}rt(t,e);var o=t.prototype;return o.getTouchAction=function(){return ta.prototype.getTouchAction.call(this)},o.attrTest=function(t){var o=this.options.direction,n;return o&(wi|xi)?n=t.overallVelocity:o&wi?n=t.overallVelocityX:o&xi&&(n=t.overallVelocityY),e.prototype.attrTest.call(this,t)&&o&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&Qn(n)>this.options.velocity&&t.eventType&gi},o.emit=function(e){var t=Zt(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},t}(Ji),na=function(e){function t(t){return void 0===t&&(t={}),e.call(this,st({event:"pinch",threshold:0,pointers:2},t))||this}rt(t,e);var o=t.prototype;return o.getTouchAction=function(){return[ni]},o.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(uo(t.scale-1)>this.options.threshold||this.state&Li)},o.emit=function(t){if(1!==t.scale){var o=1>t.scale?"in":"out";t.additionalEvent=this.options.event+o}e.prototype.emit.call(this,t)},t}(Ji),ia=function(e){function t(t){return void 0===t&&(t={}),e.call(this,st({event:"rotate",threshold:0,pointers:2},t))||this}rt(t,e);var o=t.prototype;return o.getTouchAction=function(){return[ni]},o.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(uo(t.rotation)>this.options.threshold||this.state&Li)},t}(Ji),aa=function(e){function t(t){var o;return void 0===t&&(t={}),o=e.call(this,st({event:"press",pointers:1,time:251,threshold:9},t))||this,o._timer=null,o._input=null,o}rt(t,e);var o=t.prototype;return o.getTouchAction=function(){return["auto"]},o.process=function(e){var t=this,o=this.options,n=e.pointers.length===o.pointers,i=e.distance<o.threshold,a=e.deltaTime>o.time;if(this._input=e,!i||!n||e.eventType&(gi|yi)&&!a)this.reset();else if(e.eventType&hi)this.reset(),this._timer=setTimeout(function(){t.state=ji,t.tryEmit()},o.time);else if(e.eventType&gi)return ji;return Vi},o.reset=function(){clearTimeout(this._timer)},o.emit=function(e){this.state!==ji||(e&&e.eventType&gi?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=$n(),this.manager.emit(this.options.event,this._input)))},t}(qi),da=Xt(function(e,t,o){for(var n=Object.keys(t),a=0;a<n.length;)(!o||o&&void 0===e[n[a]])&&(e[n[a]]=t[n[a]]),a++;return e},"extend","Use `assign`."),sa=Xt(function(e,t){return da(e,t,!0)},"merge","Use `assign`."),ra=function(){var e=function(e,t){return void 0===t&&(t={}),new Ki(e,st({recognizers:[[ia,{enable:!1}],[na,{enable:!1},["rotate"]],[oa,{direction:wi}],[ta,{direction:wi},["swipe"]],[ea],[ea,{event:"doubletap",taps:2},["tap"]],[aa]]},t))};return e.VERSION="2.0.15",e.DIRECTION_ALL=Si,e.DIRECTION_DOWN=ki,e.DIRECTION_LEFT=bi,e.DIRECTION_RIGHT=_i,e.DIRECTION_UP=vi,e.DIRECTION_HORIZONTAL=wi,e.DIRECTION_VERTICAL=xi,e.DIRECTION_NONE=fi,e.DIRECTION_DOWN=ki,e.INPUT_START=hi,e.INPUT_MOVE=mi,e.INPUT_END=gi,e.INPUT_CANCEL=yi,e.STATE_POSSIBLE=Hi,e.STATE_BEGAN=Li,e.STATE_CHANGED=Ai,e.STATE_ENDED=Wi,e.STATE_RECOGNIZED=ji,e.STATE_CANCELLED=Ui,e.STATE_FAILED=Vi,e.Manager=Ki,e.Input=Ci,e.TouchAction=Ti,e.TouchInput=zi,e.MouseInput=Ri,e.PointerEventInput=Fi,e.TouchMouseInput=Bi,e.SingleTouchInput=$i,e.Recognizer=qi,e.AttrRecognizer=Ji,e.Tap=ea,e.Pan=ta,e.Swipe=oa,e.Pinch=na,e.Rotate=ia,e.Press=aa,e.on=Mt,e.off=It,e.each=pt,e.merge=sa,e.extend=da,e.bindFn=Qt,e.assign=qn,e.inherit=Kt,e.bindFn=Qt,e.prefixed=ct,e.toArray=Yt,e.inArray=Ft,e.uniqueArray=zt,e.splitStr=Et,e.boolOrFn=ht,e.hasParent=yt,e.addEventListeners=Mt,e.removeEventListeners=It,e.defaults=Zi,e}(),la=ze(function(e){function t(){var e=function(){};return{on:e,off:e,destroy:e,emit:e,get:function(){return{set:e}}}}if("undefined"!=typeof window){var o=window.Hammer||ra;e.exports=o}else e.exports=function(){return t()}}),ca=Object.freeze({default:la,__moduleExports:la});(function(e){return e&&e["default"]||e})(jn),Tn($t.prototype),$t.current=null,$t.prototype.destroy=function(){this.deactivate(),this.dom.overlay.parentNode.removeChild(this.dom.overlay),this.onClick&&document.body.removeEventListener("click",this.onClick),this.keycharm!==void 0&&this.keycharm.destroy(),this.keycharm=null,this.hammer.destroy(),this.hammer=null},$t.prototype.activate=function(){$t.current&&$t.current.deactivate(),$t.current=this,this.active=!0,this.dom.overlay.style.display="none",Wo.addClassName(this.dom.container,"vis-active"),this.emit("change"),this.emit("activate"),this.keycharm.bind("esc",this.escListener)},$t.prototype.deactivate=function(){this.active=!1,this.dom.overlay.style.display="",Wo.removeClassName(this.dom.container,"vis-active"),this.keycharm.unbind("esc",this.escListener),this.emit("change"),this.emit("deactivate")},$t.prototype._onTapOverlay=function(e){this.activate(),e.stopPropagation()};var ua=ze(function(e,t){t.en={edit:"Edit",del:"Delete selected",back:"Back",addNode:"Add Node",addEdge:"Add Edge",editNode:"Edit Node",editEdge:"Edit Edge",addDescription:"Click in an empty space to place a new node.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",createEdgeError:"Cannot link edges to a cluster.",deleteClusterError:"Clusters cannot be deleted.",editClusterError:"Clusters cannot be edited."},t.en_EN=t.en,t.en_US=t.en,t.de={edit:"Editieren",del:"L\xF6sche Auswahl",back:"Zur\xFCck",addNode:"Knoten hinzuf\xFCgen",addEdge:"Kante hinzuf\xFCgen",editNode:"Knoten editieren",editEdge:"Kante editieren",addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",createEdgeError:"Es ist nicht m\xF6glich, Kanten mit Clustern zu verbinden.",deleteClusterError:"Cluster k\xF6nnen nicht gel\xF6scht werden.",editClusterError:"Cluster k\xF6nnen nicht editiert werden."},t.de_DE=t.de,t.es={edit:"Editar",del:"Eliminar selecci\xF3n",back:"Atr\xE1s",addNode:"A\xF1adir nodo",addEdge:"A\xF1adir arista",editNode:"Editar nodo",editEdge:"Editar arista",addDescription:"Haga clic en un lugar vac\xEDo para colocar un nuevo nodo.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",createEdgeError:"No se puede conectar una arista a un grupo.",deleteClusterError:"No es posible eliminar grupos.",editClusterError:"No es posible editar grupos."},t.es_ES=t.es,t.it={edit:"Modifica",del:"Cancella la selezione",back:"Indietro",addNode:"Aggiungi un nodo",addEdge:"Aggiungi un vertice",editNode:"Modifica il nodo",editEdge:"Modifica il vertice",addDescription:"Clicca per aggiungere un nuovo nodo",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",createEdgeError:"Non si possono collegare vertici ad un cluster",deleteClusterError:"I cluster non possono essere cancellati",editClusterError:"I clusters non possono essere modificati."},t.it_IT=t.it,t.nl={edit:"Wijzigen",del:"Selectie verwijderen",back:"Terug",addNode:"Node toevoegen",addEdge:"Link toevoegen",editNode:"Node wijzigen",editEdge:"Link wijzigen",addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",createEdgeError:"Kan geen link maken naar een cluster.",deleteClusterError:"Clusters kunnen niet worden verwijderd.",editClusterError:"Clusters kunnen niet worden aangepast."},t.nl_NL=t.nl,t.nl_BE=t.nl,t["pt-br"]={edit:"Editar",del:"Remover selecionado",back:"Voltar",addNode:"Adicionar n\xF3",addEdge:"Adicionar aresta",editNode:"Editar n\xF3",editEdge:"Editar aresta",addDescription:"Clique em um espa\xE7o em branco para adicionar um novo n\xF3",edgeDescription:"Clique em um n\xF3 e arraste a aresta at\xE9 outro n\xF3 para conect\xE1-los",editEdgeDescription:"Clique nos pontos de controle e os arraste para um n\xF3 para conect\xE1-los",createEdgeError:"N\xE3o foi poss\xEDvel linkar arestas a um cluster.",deleteClusterError:"Clusters n\xE3o puderam ser removidos.",editClusterError:"Clusters n\xE3o puderam ser editados."},t["pt-BR"]=t["pt-br"],t.pt_BR=t["pt-br"],t.pt_br=t["pt-br"],t.ru={edit:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C",del:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435",back:"\u041D\u0430\u0437\u0430\u0434",addNode:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0443\u0437\u0435\u043B",addEdge:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u043E",editNode:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0443\u0437\u0435\u043B",editEdge:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0435\u0431\u0440\u043E",addDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u0432 \u0441\u0432\u043E\u0431\u043E\u0434\u043D\u043E\u0435 \u043C\u0435\u0441\u0442\u043E, \u0447\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u0443\u0437\u0435\u043B.",edgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u0443\u0437\u0435\u043B \u0438 \u043F\u0440\u043E\u0442\u044F\u043D\u0438\u0442\u0435 \u0440\u0435\u0431\u0440\u043E \u043A \u0434\u0440\u0443\u0433\u043E\u043C\u0443 \u0443\u0437\u043B\u0443, \u0447\u0442\u043E\u0431\u044B \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0438\u0445.",editEdgeDescription:"\u041A\u043B\u0438\u043A\u043D\u0438\u0442\u0435 \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u044B\u0435 \u0442\u043E\u0447\u043A\u0438 \u0438 \u043F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0438\u0445 \u0432 \u0443\u0437\u0435\u043B, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F \u043A \u043D\u0435\u043C\u0443.",createEdgeError:"\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u0440\u0435\u0431\u0440\u0430 \u0432 \u043A\u043B\u0430\u0441\u0442\u0435\u0440.",deleteClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0443\u0434\u0430\u043B\u0435\u043D\u044B",editClusterError:"\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F."},t.ru_RU=t.ru,t.cn={edit:"\u7F16\u8F91",del:"\u5220\u9664\u9009\u5B9A",back:"\u8FD4\u56DE",addNode:"\u6DFB\u52A0\u8282\u70B9",addEdge:"\u6DFB\u52A0\u8FDE\u63A5\u7EBF",editNode:"\u7F16\u8F91\u8282\u70B9",editEdge:"\u7F16\u8F91\u8FDE\u63A5\u7EBF",addDescription:"\u5355\u51FB\u7A7A\u767D\u5904\u653E\u7F6E\u65B0\u8282\u70B9\u3002",edgeDescription:"\u5355\u51FB\u67D0\u4E2A\u8282\u70B9\u5E76\u5C06\u8BE5\u8FDE\u63A5\u7EBF\u62D6\u52A8\u5230\u53E6\u4E00\u4E2A\u8282\u70B9\u4EE5\u8FDE\u63A5\u5B83\u4EEC\u3002",editEdgeDescription:"\u5355\u51FB\u63A7\u5236\u8282\u70B9\u5E76\u5C06\u5B83\u4EEC\u62D6\u5230\u8282\u70B9\u4E0A\u8FDE\u63A5\u3002",createEdgeError:"\u65E0\u6CD5\u5C06\u8FDE\u63A5\u7EBF\u8FDE\u63A5\u5230\u7FA4\u96C6\u3002",deleteClusterError:"\u65E0\u6CD5\u5220\u9664\u7FA4\u96C6\u3002",editClusterError:"\u65E0\u6CD5\u7F16\u8F91\u7FA4\u96C6\u3002"},t.zh_CN=t.cn,t.uk={edit:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438",del:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u043E\u0431\u0440\u0430\u043D\u0435",back:"\u041D\u0430\u0437\u0430\u0434",addNode:"\u0414\u043E\u0434\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B",addEdge:"\u0414\u043E\u0434\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",editNode:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0432\u0443\u0437\u043E\u043B",editEdge:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u043A\u0440\u0430\u0439",addDescription:"K\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0456\u043B\u044C\u043D\u0435 \u043C\u0456\u0441\u0446\u0435, \u0449\u043E\u0431 \u0434\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0432\u0443\u0437\u043E\u043B.",edgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u0432\u0443\u0437\u043E\u043B \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u043A\u0440\u0430\u0439 \u0434\u043E \u0456\u043D\u0448\u043E\u0433\u043E \u0432\u0443\u0437\u043B\u0430, \u0449\u043E\u0431 \u0457\u0445 \u0437'\u0454\u0434\u043D\u0430\u0442\u0438.",editEdgeDescription:"\u041A\u043B\u0456\u043A\u043D\u0456\u0442\u044C \u043D\u0430 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C\u043D\u0456 \u0442\u043E\u0447\u043A\u0438 \u0456 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u0457\u0445 \u0443 \u0432\u0443\u0437\u043E\u043B, \u0449\u043E\u0431 \u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u0438\u0441\u044F \u0434\u043E \u043D\u044C\u043E\u0433\u043E.",createEdgeError:"\u041D\u0435 \u043C\u043E\u0436\u043B\u0438\u0432\u043E \u043E\u0431'\u0454\u0434\u043D\u0430\u0442\u0438 \u043A\u0440\u0430\u0457 \u0432 \u0433\u0440\u0443\u043F\u0443.",deleteClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435 \u043C\u043E\u0436\u0443\u0442\u044C \u0431\u0443\u0442\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u0456.",editClusterError:"\u0413\u0440\u0443\u043F\u0438 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456 \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043D\u043D\u044F."},t.uk_UA=t.uk,t.fr={edit:"Editer",del:"Effacer la selection",back:"Retour",addNode:"Ajouter un noeud",addEdge:"Ajouter un lien",editNode:"Editer le noeud",editEdge:"Editer le lien",addDescription:"Cliquez dans un endroit vide pour placer un noeud.",edgeDescription:"Cliquez sur un noeud et glissez le lien vers un autre noeud pour les connecter.",editEdgeDescription:"Cliquez sur les points de contr\xF4le et glissez-les pour connecter un noeud.",createEdgeError:"Impossible de cr\xE9er un lien vers un cluster.",deleteClusterError:"Les clusters ne peuvent pas \xEAtre \xE9ffac\xE9s.",editClusterError:"Les clusters ne peuvent pas \xEAtre \xE9dites."},t.fr_FR=t.fr,t.cs={edit:"Upravit",del:"Smazat v\xFDb\u011Br",back:"Zp\u011Bt",addNode:"P\u0159idat vrchol",addEdge:"P\u0159idat hranu",editNode:"Upravit vrchol",editEdge:"Upravit hranu",addDescription:"Kluknut\xEDm do pr\xE1zdn\xE9ho prostoru m\u016F\u017Eete p\u0159idat nov\xFD vrchol.",edgeDescription:"P\u0159eta\u017Een\xEDm z jednoho vrcholu do druh\xE9ho m\u016F\u017Eete spojit tyto vrcholy novou hranou.",editEdgeDescription:"P\u0159eta\u017Een\xEDm kontroln\xEDho vrcholu hrany ji m\u016F\u017Eete p\u0159ipojit k jin\xE9mu vrcholu.",createEdgeError:"Nelze p\u0159ipojit hranu ke shluku.",deleteClusterError:"Nelze mazat shluky.",editClusterError:"Nelze upravovat shluky."},t.cs_CZ=t.cs}),pa=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ha=function(e,t,o){return t&&eo(e.prototype,t),o&&eo(e,o),e},ma=function(){function e(){pa(this,e),this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}return ha(e,[{key:"init",value:function(){if(!this.initialized()){this.src=this.image.src;var e=this.image.width,t=this.image.height;this.width=e,this.height=t;var o=go(t/2),n=go(t/4),i=go(t/8),a=go(t/16),d=go(e/2),s=go(e/4),r=go(e/8),l=go(e/16);this.canvas.width=3*s,this.canvas.height=o,this.coordinates=[[0,0,d,o],[d,0,s,n],[d,n,r,i],[5*r,n,l,a]],this._fillMipMap()}}},{key:"initialized",value:function(){return void 0!==this.coordinates}},{key:"_fillMipMap",value:function(){var e=this.canvas.getContext("2d"),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(var o=1;o<this.NUM_ITERATIONS;o++){var n=this.coordinates[o-1],i=this.coordinates[o];e.drawImage(this.canvas,n[0],n[1],n[2],n[3],i[0],i[1],i[2],i[3])}}},{key:"drawImageAtPosition",value:function(e,t,o,n,i,a){if(this.initialized())if(2<t){t*=.5;for(var d=0;2<t&&d<this.NUM_ITERATIONS;)t*=.5,d+=1;d>=this.NUM_ITERATIONS&&(d=this.NUM_ITERATIONS-1);var s=this.coordinates[d];e.drawImage(this.canvas,s[0],s[1],s[2],s[3],o,n,i,a)}else e.drawImage(this.image,o,n,i,a)}}]),e}(),ga=function(){function e(t){pa(this,e),this.images={},this.imageBroken={},this.callback=t}return ha(e,[{key:"_tryloadBrokenUrl",value:function(e,t,o){return void 0===e||void 0===o?void 0:void 0===t?void console.warn("No broken url image defined"):void(o.image.onerror=function(){console.error("Could not load brokenImage:",t)},o.image.src=t)}},{key:"_redrawWithImage",value:function(e){this.callback&&this.callback(e)}},{key:"load",value:function(e,t){var o=this,n=this.images[e];if(n)return n;var i=new ma;return this.images[e]=i,i.image.onload=function(){o._fixImageCoordinates(i.image),i.init(),o._redrawWithImage(i)},i.image.onerror=function(){console.error("Could not load image:",e),o._tryloadBrokenUrl(e,t,i)},i.image.src=e,i}},{key:"_fixImageCoordinates",value:function(e){0===e.width&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}]),e}(),ya=function(){function e(){pa(this,e),this.clear(),this.defaultIndex=0,this.groupsArray=[],this.groupIndex=0,this.defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},Wo.extend(this.options,this.defaultOptions)}return ha(e,[{key:"setOptions",value:function(e){var t=["useDefaultGroups"];if(void 0!==e)for(var o in e)if(e.hasOwnProperty(o)&&-1===t.indexOf(o)){var n=e[o];this.add(o,n)}}},{key:"clear",value:function(){this.groups={},this.groupsArray=[]}},{key:"get",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],o=this.groups[e];if(void 0===o&&t)if(!1===this.options.useDefaultGroups&&0<this.groupsArray.length){var n=this.groupIndex%this.groupsArray.length;this.groupIndex++,o={},o.color=this.groups[this.groupsArray[n]],this.groups[e]=o}else{var i=this.defaultIndex%this.defaultGroups.length;this.defaultIndex++,o={},o.color=this.defaultGroups[i],this.groups[e]=o}return o}},{key:"add",value:function(e,t){return this.groups[e]=t,this.groupsArray.push(e),t}}]),e}(),fa=function(e){if(Array.isArray(e))return e},ba=to,_a=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")},va=oo,ka=ze(function(e){function t(e){return t="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},t(e)}function o(n){return e.exports="function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?o=function(e){return t(e)}:o=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)},o(n)}e.exports=o}),wa=function(){function e(){pa(this,e)}return ha(e,null,[{key:"choosify",value:function(e,t){var o=["node","edge","label"],n=!0,i=Wo.topMost(t,"chosen");if("boolean"==typeof i)n=i;else if("object"===ka(i)){if(-1===o.indexOf(e))throw new Error("choosify: subOption '"+e+"' should be one of '"+o.join("', '")+"'");var a=Wo.topMost(t,["chosen",e]);("boolean"==typeof a||"function"==typeof a)&&(n=a)}return n}},{key:"pointInRect",value:function(e,t,o){if(0>=e.width||0>=e.height)return!1;if(void 0!==o){var n={x:t.x-o.x,y:t.y-o.y};if(0!==o.angle){var i=-o.angle,a={x:ao(i)*n.x-so(i)*n.y,y:so(i)*n.x+ao(i)*n.y};t=a}else t=n}var d=e.x+e.width,s=e.y+e.width;return e.left<t.x&&d>t.x&&e.top<t.y&&s>t.y}},{key:"isValidLabel",value:function(e){return"string"==typeof e&&""!==e}}]),e}(),xa=function(){function e(t){pa(this,e),this.measureText=t,this.current=0,this.width=0,this.height=0,this.lines=[]}return ha(e,[{key:"_add",value:function(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"normal";void 0===this.lines[e]&&(this.lines[e]={width:0,height:0,blocks:[]});var n=t;(void 0===t||""===t)&&(n=" ");var i=this.measureText(n,o),a=Object.assign({},i.values);a.text=t,a.width=i.width,a.mod=o,(void 0===t||""===t)&&(a.width=0),this.lines[e].blocks.push(a),this.lines[e].width+=a.width}},{key:"curWidth",value:function(){var e=this.lines[this.current];return void 0===e?0:e.width}},{key:"append",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,e,t)}},{key:"newLine",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,e,t),this.current++}},{key:"determineLineHeights",value:function(){for(var e=0;e<this.lines.length;e++){var t=this.lines[e],o=0;if(void 0!==t.blocks)for(var n=0,i;n<t.blocks.length;n++)i=t.blocks[n],o<i.height&&(o=i.height);t.height=o}}},{key:"determineLabelSize",value:function(){for(var e=0,t=0,o=0,n;o<this.lines.length;o++)n=this.lines[o],n.width>e&&(e=n.width),t+=n.height;this.width=e,this.height=t}},{key:"removeEmptyBlocks",value:function(){for(var e=[],t=0,o;t<this.lines.length;t++)if(o=this.lines[t],0!==o.blocks.length){if(t==this.lines.length-1&&0===o.width)continue;var n={};Object.assign(n,o),n.blocks=[];for(var i=void 0,a=[],d=0,s;d<o.blocks.length;d++)s=o.blocks[d],0===s.width?void 0===i&&(i=s):a.push(s);0===a.length&&void 0!==i&&a.push(i),n.blocks=a,e.push(n)}return e}},{key:"finalize",value:function(){this.determineLineHeights(),this.determineLabelSize();var e=this.removeEmptyBlocks();return{width:this.width,height:this.height,lines:e}}}]),e}(),Sa={"<b>":/<b>/,"<i>":/<i>/,"<code>":/<code>/,"</b>":/<\/b>/,"</i>":/<\/i>/,"</code>":/<\/code>/,"*":/\*/,_:/\_/,"`":/`/,afterBold:/[^\*]/,afterItal:/[^_]/,afterMono:/[^`]/},Oa=function(){function e(t){pa(this,e),this.text=t,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}return ha(e,[{key:"mod",value:function(){return 0===this.modStack.length?"normal":this.modStack[0]}},{key:"modName",value:function(){return 0===this.modStack.length?"normal":"mono"===this.modStack[0]?"mono":this.bold&&this.ital?"boldital":this.bold?"bold":this.ital?"ital":void 0}},{key:"emitBlock",value:function(){this.spacing&&(this.add(" "),this.spacing=!1),0<this.buffer.length&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}},{key:"add",value:function(e){" "===e&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=e&&(this.buffer+=e)}},{key:"parseWS",value:function(e){return!!/[ \t]/.test(e)&&(this.mono?this.add(e):this.spacing=!0,!0)}},{key:"setTag",value:function(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}},{key:"unsetTag",value:function(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}},{key:"parseStartTag",value:function(e,t){return!(this.mono||this[e]||!this.match(t))&&(this.setTag(e),!0)}},{key:"match",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],o=this.prepareRegExp(e),n=va(o,2),i=n[0],a=n[1],d=i.test(this.text.substr(this.position,a));return d&&t&&(this.position+=a-1),d}},{key:"parseEndTag",value:function(e,t,o){var n=this.mod()===e;return n="mono"===e?n&&this.mono:n&&!this.mono,!!(n&&this.match(t))&&(void 0===o?this.unsetTag(e):(this.position===this.text.length-1||this.match(o,!1))&&this.unsetTag(e),!0)}},{key:"replace",value:function(e,t){return!!this.match(e)&&(this.add(t),this.position+=length-1,!0)}},{key:"prepareRegExp",value:function(e){var t,o;if(e instanceof RegExp)o=e,t=1;else{var n=Sa[e];o=void 0===n?new RegExp(e):n,t=e.length}return[o,t]}}]),e}(),Da=function(){function e(t,o,n,i){var a=this;pa(this,e),this.ctx=t,this.parent=o,this.selected=n,this.hover=i;this.lines=new xa(function(e,o){if(void 0===e)return 0;var d=a.parent.getFormattingValues(t,n,i,o),s=0;if(""!==e){var r=a.ctx.measureText(e);s=r.width}return{width:s,values:d}})}return ha(e,[{key:"process",value:function(e){if(!wa.isValidLabel(e))return this.lines.finalize();var t=this.parent.fontOptions;e=e.replace(/\r\n/g,"\n"),e=e.replace(/\r/g,"\n");var o=(e+"").split("\n"),n=o.length;if(t.multi){for(var a=0,d;a<n;a++)if(d=this.splitBlocks(o[a],t.multi),void 0!==d){if(0===d.length){this.lines.newLine("");continue}if(0<t.maxWdt)for(var s=0;s<d.length;s++){var r=d[s].mod,l=d[s].text;this.splitStringIntoLines(l,r,!0)}else for(var c=0;c<d.length;c++){var u=d[c].mod,p=d[c].text;this.lines.append(p,u)}this.lines.newLine()}}else if(0<t.maxWdt)for(var h=0;h<n;h++)this.splitStringIntoLines(o[h]);else for(var m=0;m<n;m++)this.lines.newLine(o[m]);return this.lines.finalize()}},{key:"decodeMarkupSystem",value:function(e){var t="none";return"markdown"===e||"md"===e?t="markdown":(!0===e||"html"===e)&&(t="html"),t}},{key:"splitHtmlBlocks",value:function(e){for(var t=new Oa(e),o=function(e){if(/&/.test(e)){var o=t.replace(t.text,"&lt;","<")||t.replace(t.text,"&amp;","&");return o||t.add("&"),!0}return!1};t.position<t.text.length;){var n=t.text.charAt(t.position),i=t.parseWS(n)||/</.test(n)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||o(n);i||t.add(n),t.position++}return t.emitBlock(),t.blocks}},{key:"splitMarkdownBlocks",value:function(e){for(var t=this,o=new Oa(e),n=!0,i=function(e){return!!/\\/.test(e)&&(o.position<t.text.length+1&&(o.position++,e=t.text.charAt(o.position),/ \t/.test(e)?o.spacing=!0:(o.add(e),n=!1)),!0)};o.position<o.text.length;){var a=o.text.charAt(o.position),d=o.parseWS(a)||i(a)||(n||o.spacing)&&(o.parseStartTag("bold","*")||o.parseStartTag("ital","_")||o.parseStartTag("mono","`"))||o.parseEndTag("bold","*","afterBold")||o.parseEndTag("ital","_","afterItal")||o.parseEndTag("mono","`","afterMono");d||(o.add(a),n=!1),o.position++}return o.emitBlock(),o.blocks}},{key:"splitBlocks",value:function(e,t){var o=this.decodeMarkupSystem(t);return"none"===o?[{text:e,mod:"normal"}]:"markdown"===o?this.splitMarkdownBlocks(e):"html"===o?this.splitHtmlBlocks(e):void 0}},{key:"overMaxWidth",value:function(e){var t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}},{key:"getLongestFit",value:function(e){for(var t="",o=0;o<e.length;){var n=""===t?"":" ",i=t+n+e[o];if(this.overMaxWidth(i))break;t=i,o++}return o}},{key:"getLongestFitWord",value:function(e){for(var t=0;t<e.length&&!this.overMaxWidth(e.slice(0,t));)t++;return t}},{key:"splitStringIntoLines",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"normal",o=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");for(var n=e.split("\r"),i;0<n.length;)if(i=this.getLongestFit(n),0===i){var a=n[0],d=this.getLongestFitWord(a);this.lines.newLine(a.slice(0,d),t),n[0]=a.slice(d)}else{var s=i;" "===n[i-1]?i--:" "===n[s]&&s++;var r=n.slice(0,i).join("");i==n.length&&o?this.lines.append(r,t):this.lines.newLine(r,t),n=n.slice(s)}}}]),e}(),Ta=["bold","ital","boldital","mono"],Ca=function(){function e(t,o){var n=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];pa(this,e),this.body=t,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(o),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=n}return ha(e,[{key:"setOptions",value:function(e){if(this.elementOptions=e,this.initFontOptions(e.font),wa.isValidLabel(e.label)?this.labelDirty=!0:e.label=void 0,void 0!==e.font&&null!==e.font)if("string"==typeof e.font)this.baseSize=this.fontOptions.size;else if("object"===ka(e.font)){var t=e.font.size;void 0!==t&&(this.baseSize=t)}}},{key:"initFontOptions",value:function(t){var o=this;return Wo.forEach(Ta,function(e){o.fontOptions[e]={}}),e.parseFontString(this.fontOptions,t)?void(this.fontOptions.vadjust=0):void Wo.forEach(t,function(e,t){void 0!==e&&null!==e&&"object"!==ka(e)&&(o.fontOptions[t]=e)})}},{key:"constrain",value:function(e){var t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},o=Wo.topMost(e,"widthConstraint");if("number"==typeof o)t.maxWdt=+o,t.minWdt=+o;else if("object"===ka(o)){var n=Wo.topMost(e,["widthConstraint","maximum"]);"number"==typeof n&&(t.maxWdt=+n);var i=Wo.topMost(e,["widthConstraint","minimum"]);"number"==typeof i&&(t.minWdt=+i)}var a=Wo.topMost(e,"heightConstraint");if("number"==typeof a)t.minHgt=+a;else if("object"===ka(a)){var d=Wo.topMost(e,["heightConstraint","minimum"]);"number"==typeof d&&(t.minHgt=+d);var s=Wo.topMost(e,["heightConstraint","valign"]);"string"==typeof s&&("top"===s||"bottom"===s)&&(t.valign=s)}return t}},{key:"update",value:function(e,t){this.setOptions(e,!0),this.propagateFonts(t),Wo.deepExtend(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=wa.choosify("label",t)}},{key:"adjustSizes",value:function(e){var t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);var o=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=o)}},{key:"addFontOptionsToPile",value:function(e,t){for(var o=0;o<t.length;++o)this.addFontToPile(e,t[o])}},{key:"addFontToPile",value:function(e,t){if(void 0!==t&&void 0!==t.font&&null!==t.font){var o=t.font;e.push(o)}}},{key:"getBasicOptions",value:function(t){for(var o={},i=0;i<t.length;++i){var a=t[i],d={};e.parseFontString(d,a)&&(a=d),Wo.forEach(a,function(e,t){void 0===e||o.hasOwnProperty(t)||(-1===Ta.indexOf(t)?o[t]=e:o[t]={})})}return o}},{key:"getFontOption",value:function(t,o,i){for(var a=0,d,s;a<t.length;++a)if(s=t[a],s.hasOwnProperty(o)){if(d=s[o],void 0===d||null===d)continue;var r={};if(e.parseFontString(r,d)&&(d=r),d.hasOwnProperty(i))return d[i]}if(this.fontOptions.hasOwnProperty(i))return this.fontOptions[i];throw new Error("Did not find value for multi-font for property: '"+i+"'")}},{key:"getFontOptions",value:function(e,t){for(var o={},n=["color","size","face","mod","vadjust"],a=0,d;a<n.length;++a)d=n[a],o[d]=this.getFontOption(e,t,d);return o}},{key:"propagateFonts",value:function(e){var t=this,o=[];this.addFontOptionsToPile(o,e),this.fontOptions=this.getBasicOptions(o);for(var n=function(e){var n=Ta[e],i=t.fontOptions[n],a=t.getFontOptions(o,n);Wo.forEach(a,function(e,t){i[t]=e}),i.size=+i.size,i.vadjust=+i.vadjust},a=0;a<Ta.length;++a)n(a)}},{key:"draw",value:function(e,t,o,n,i){var a=5<arguments.length&&void 0!==arguments[5]?arguments[5]:"middle";if(void 0!==this.elementOptions.label){var d=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&d<this.elementOptions.scaling.label.drawThreshold-1||(d>=this.elementOptions.scaling.label.maxVisible&&(d=+this.elementOptions.scaling.label.maxVisible/this.body.view.scale),this.calculateLabelSize(e,n,i,t,o,a),this._drawBackground(e),this._drawText(e,t,this.size.yLine,a,d))}}},{key:"_drawBackground",value:function(e){if(void 0!==this.fontOptions.background&&"none"!==this.fontOptions.background){e.fillStyle=this.fontOptions.background;var t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}},{key:"_drawText",value:function(e,t,o){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"middle",a=4<arguments.length?arguments[4]:void 0,d=this._setAlignment(e,t,o,n),s=va(d,2);t=s[0],o=s[1],e.textAlign="left",t-=this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&("top"===this.fontOptions.valign&&(o-=(this.size.height-this.size.labelHeight)/2),"bottom"===this.fontOptions.valign&&(o+=(this.size.height-this.size.labelHeight)/2));for(var r=0,l;r<this.lineCount;r++)if(l=this.lines[r],l&&l.blocks){var c=0;this.isEdgeLabel||"center"===this.fontOptions.align?c+=(this.size.width-l.width)/2:"right"===this.fontOptions.align&&(c+=this.size.width-l.width);for(var u=0,p;u<l.blocks.length;u++){p=l.blocks[u],e.font=p.font;var h=this._getColor(p.color,a,p.strokeColor),m=va(h,2),g=m[0],f=m[1];0<p.strokeWidth&&(e.lineWidth=p.strokeWidth,e.strokeStyle=f,e.lineJoin="round"),e.fillStyle=g,0<p.strokeWidth&&e.strokeText(p.text,t+c,o+p.vadjust),e.fillText(p.text,t+c,o+p.vadjust),c+=p.width}o+=l.height}}},{key:"_setAlignment",value:function(e,t,o,n){if(this.isEdgeLabel&&"horizontal"!==this.fontOptions.align&&!1===this.pointToSelf){t=0,o=0;"top"===this.fontOptions.align?(e.textBaseline="alphabetic",o-=4):"bottom"===this.fontOptions.align?(e.textBaseline="hanging",o+=4):e.textBaseline="middle"}else e.textBaseline=n;return[t,o]}},{key:"_getColor",value:function(e,t,o){var n=e||"#000000",i=o||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){var a=yo(0,fo(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));n=Wo.overrideOpacity(n,a),i=Wo.overrideOpacity(i,a)}return[n,i]}},{key:"getTextSize",value:function(e){var t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],o=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];return this._processLabel(e,t,o),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}},{key:"getSize",value:function(){var e=this.size.left,t=this.size.top-1;if(this.isEdgeLabel){var o=.5*-this.size.width;switch(this.fontOptions.align){case"middle":e=o,t=.5*-this.size.height;break;case"top":e=o,t=-(this.size.height+2);break;case"bottom":e=o,t=2;}}var n={left:e,top:t,width:this.size.width,height:this.size.height};return n}},{key:"calculateLabelSize",value:function(e,t,o){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,a=5<arguments.length&&void 0!==arguments[5]?arguments[5]:"middle";this._processLabel(e,t,o),this.size.left=n-.5*this.size.width,this.size.top=i-.5*this.size.height,this.size.yLine=i+.5*(1-this.lineCount)*this.fontOptions.size,"hanging"===a&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}},{key:"getFormattingValues",value:function(e,t,o,n){var i=function(e,t,o){return"normal"===t?"mod"===o?"":e[o]:void 0===e[t][o]?e[o]:e[t][o]},a={color:i(this.fontOptions,n,"color"),size:i(this.fontOptions,n,"size"),face:i(this.fontOptions,n,"face"),mod:i(this.fontOptions,n,"mod"),vadjust:i(this.fontOptions,n,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||o)&&("normal"===n&&!0===this.fontOptions.chooser&&this.elementOptions.labelHighlightBold?a.mod="bold":"function"==typeof this.fontOptions.chooser&&this.fontOptions.chooser(a,this.elementOptions.id,t,o));var d="";return void 0!==a.mod&&""!==a.mod&&(d+=a.mod+" "),d+=a.size+"px "+a.face,e.font=d.replace(/"/g,""),a.font=e.font,a.height=a.size,a}},{key:"differentState",value:function(e,t){return e!==this.selectedState||t!==this.hoverState}},{key:"_processLabelText",value:function(e,t,o,n){var i=new Da(e,this,t,o);return i.process(n)}},{key:"_processLabel",value:function(e,t,o){if(!1!==this.labelDirty||this.differentState(t,o)){var n=this._processLabelText(e,t,o,this.elementOptions.label);0<this.fontOptions.minWdt&&n.width<this.fontOptions.minWdt&&(n.width=this.fontOptions.minWdt),this.size.labelHeight=n.height,0<this.fontOptions.minHgt&&n.height<this.fontOptions.minHgt&&(n.height=this.fontOptions.minHgt),this.lines=n.lines,this.lineCount=n.lines.length,this.size.width=n.width,this.size.height=n.height,this.selectedState=t,this.hoverState=o,this.labelDirty=!1}}},{key:"visible",value:function(){if(0===this.size.width||0===this.size.height||void 0===this.elementOptions.label)return!1;var e=this.fontOptions.size*this.body.view.scale;return!(e<this.elementOptions.scaling.label.drawThreshold-1)}}],[{key:"parseFontString",value:function(e,t){if(!t||"string"!=typeof t)return!1;var o=t.split(" ");return e.size=+o[0].replace("px",""),e.face=o[1],e.color=o[2],!0}}]),e}(),Ea=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},Ma=function(e,t){return t&&("object"===ka(t)||"function"==typeof t)?t:Ea(e)},Ia=ze(function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t}),Pa=ze(function(e){function t(n,o){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,o)}e.exports=t}),Fa=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pa(e,t)},Ya=function(){function e(t,o,n){pa(this,e),this.body=o,this.labelModule=n,this.setOptions(t),this.top=void 0,this.left=void 0,this.height=void 0,this.width=void 0,this.radius=void 0,this.margin=void 0,this.refreshNeeded=!0,this.boundingBox={top:0,left:0,right:0,bottom:0}}return ha(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"_setMargins",value:function(e){this.margin={},this.options.margin&&("object"==ka(this.options.margin)?(this.margin.top=this.options.margin.top,this.margin.right=this.options.margin.right,this.margin.bottom=this.options.margin.bottom,this.margin.left=this.options.margin.left):(this.margin.top=this.options.margin,this.margin.right=this.options.margin,this.margin.bottom=this.options.margin,this.margin.left=this.options.margin)),e.adjustSizes(this.margin)}},{key:"_distanceToBorder",value:function(e,t){var o=this.options.borderWidth;return this.resize(e),fo(uo(this.width/2/ao(t)),uo(this.height/2/so(t)))+o}},{key:"enableShadow",value:function(e,t){t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}},{key:"disableShadow",value:function(e,t){t.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:"enableBorderDashes",value:function(e,t){if(!1!==t.borderDashes)if(void 0!==e.setLineDash){var o=t.borderDashes;!0===o&&(o=[5,15]),e.setLineDash(o)}else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1}},{key:"disableBorderDashes",value:function(e,t){!1!==t.borderDashes&&(void 0===e.setLineDash?(console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."),this.options.shapeProperties.borderDashes=!1,t.borderDashes=!1):e.setLineDash([0]))}},{key:"needsRefresh",value:function(e,t){return!0===this.refreshNeeded?(this.refreshNeeded=!1,!0):void 0===this.width||this.labelModule.differentState(e,t)}},{key:"initContextForDraw",value:function(e,t){var o=t.borderWidth/this.body.view.scale;e.lineWidth=fo(this.width,o),e.strokeStyle=t.borderColor,e.fillStyle=t.color}},{key:"performStroke",value:function(e,t){var o=t.borderWidth/this.body.view.scale;e.save(),0<o&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}},{key:"performFill",value:function(e,t){this.enableShadow(e,t),e.fill(),this.disableShadow(e,t),this.performStroke(e,t)}},{key:"_addBoundingBoxMargin",value:function(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}},{key:"_updateBoundingBox",value:function(e,t,o,n,i){void 0!==o&&this.resize(o,n,i),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"updateBoundingBox",value:function(e,t,o,n,i){this._updateBoundingBox(e,t,o,n,i)}},{key:"getDimensionsFromLabel",value:function(e,t,o){this.textSize=this.labelModule.getTextSize(e,t,o);var n=this.textSize.width,i=this.textSize.height,a=14;return 0===n&&(n=a,i=a),{width:n,height:i}}}]),e}(),za=function(e){function t(e,o,n){var i;return pa(this,t),i=Ma(this,Ia(t).call(this,e,o,n)),i._setMargins(n),i}return Fa(t,e),ha(t,[{key:"resize",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.selected,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,o)){var n=this.getDimensionsFromLabel(e,t,o);this.width=n.width+this.margin.right+this.margin.left,this.height=n.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}},{key:"draw",value:function(e,t,o,n,i,a){this.resize(e,n,i),this.left=t-this.width/2,this.top=o-this.height/2,this.initContextForDraw(e,a),e.roundRect(this.left,this.top,this.width,this.height,a.borderRadius),this.performFill(e,a),this.updateBoundingBox(t,o,e,n,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,i)}},{key:"updateBoundingBox",value:function(e,t,o,n,i){this._updateBoundingBox(e,t,o,n,i);var a=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(a)}},{key:"distanceToBorder",value:function(e,t){this.resize(e);var o=this.options.borderWidth;return fo(uo(this.width/2/ao(t)),uo(this.height/2/so(t)))+o}}]),t}(Ya),Na=function(e){function t(e,o,n){var i;return pa(this,t),i=Ma(this,Ia(t).call(this,e,o,n)),i.labelOffset=0,i.selected=!1,i}return Fa(t,e),ha(t,[{key:"setOptions",value:function(e,t,o){this.options=e,void 0===t&&void 0===o||this.setImages(t,o)}},{key:"setImages",value:function(e,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=t)}},{key:"switchImages",value:function(e){var t=e&&!this.selected||!e&&this.selected;if(this.selected=e,void 0!==this.imageObjAlt&&t){var o=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=o}}},{key:"_resizeImage",value:function(){var e,t;if(!1===this.options.shapeProperties.useImageSize){var o=1,n=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?o=this.imageObj.width/this.imageObj.height:n=this.imageObj.height/this.imageObj.width),e=2*this.options.size*o,t=2*this.options.size*n}else e=this.imageObj.width,t=this.imageObj.height;this.width=e,this.height=t,this.radius=.5*this.width}},{key:"_drawRawCircle",value:function(e,t,o,n){this.initContextForDraw(e,n),e.circle(t,o,n.size),this.performFill(e,n)}},{key:"_drawImageAtPosition",value:function(e,t){if(0!=this.imageObj.width){e.globalAlpha=1,this.enableShadow(e,t);var o=1;!0===this.options.shapeProperties.interpolation&&(o=this.imageObj.width/this.width/this.body.view.scale),this.imageObj.drawImageAtPosition(e,o,this.left,this.top,this.width,this.height),this.disableShadow(e,t)}}},{key:"_drawImageLabel",value:function(e,t,o,n,i){var a=0,d;if(void 0!==this.height){a=.5*this.height;var s=this.labelModule.getTextSize(e,n,i);1<=s.lineCount&&(a+=s.height/2)}d=o+a,this.options.label&&(this.labelOffset=a),this.labelModule.draw(e,t,d,n,i,"hanging")}}]),t}(Ya),Ra=function(e){function t(e,o,n){var i;return pa(this,t),i=Ma(this,Ia(t).call(this,e,o,n)),i._setMargins(n),i}return Fa(t,e),ha(t,[{key:"resize",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.selected,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,o)){var n=this.getDimensionsFromLabel(e,t,o),i=yo(n.width+this.margin.right+this.margin.left,n.height+this.margin.top+this.margin.bottom);this.options.size=i/2,this.width=i,this.height=i,this.radius=this.width/2}}},{key:"draw",value:function(e,t,o,n,i,a){this.resize(e,n,i),this.left=t-this.width/2,this.top=o-this.height/2,this._drawRawCircle(e,t,o,a),this.updateBoundingBox(t,o),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,o,n,i)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size}},{key:"distanceToBorder",value:function(e){return this.resize(e),.5*this.width}}]),t}(Na),Ba=function(e){function t(e,o,n,i,a){var d;return pa(this,t),d=Ma(this,Ia(t).call(this,e,o,n)),d.setImages(i,a),d}return Fa(t,e),ha(t,[{key:"resize",value:function(){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.selected,t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.hover,o=void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height;if(o){var n=2*this.options.size;return this.width=n,this.height=n,void(this.radius=.5*this.width)}this.needsRefresh(e,t)&&this._resizeImage()}},{key:"draw",value:function(e,t,o,n,i,a){this.switchImages(n),this.resize(),this.left=t-this.width/2,this.top=o-this.height/2,this._drawRawCircle(e,t,o,a),e.save(),e.clip(),this._drawImageAtPosition(e,a),e.restore(),this._drawImageLabel(e,t,o,n,i),this.updateBoundingBox(t,o)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,this.boundingBox.left=fo(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=yo(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=yo(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}},{key:"distanceToBorder",value:function(e){return this.resize(e),.5*this.width}}]),t}(Na),Ha=function(e){function t(e,o,n){var i;return pa(this,t),i=Ma(this,Ia(t).call(this,e,o,n)),i._setMargins(n),i}return Fa(t,e),ha(t,[{key:"resize",value:function(e,t,o){if(this.needsRefresh(t,o)){var n=this.getDimensionsFromLabel(e,t,o),i=n.width+this.margin.right+this.margin.left;this.width=i,this.height=i,this.radius=this.width/2}}},{key:"draw",value:function(e,t,o,n,i,a){this.resize(e,n,i),this.left=t-this.width/2,this.top=o-this.height/2,this.initContextForDraw(e,a),e.database(t-this.width/2,o-this.height/2,this.width,this.height),this.performFill(e,a),this.updateBoundingBox(t,o,e,n,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,i)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(Ya),La=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"resize",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.selected,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.hover,n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,o)){this.labelModule.getTextSize(e,t,o);var i=2*n.size;this.width=i,this.height=i,this.radius=.5*this.width}}},{key:"_drawShape",value:function(e,t,o,n,i,a,d,s){if(this.resize(e,a,d,s),this.left=n-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,s),e[t](n,i,s.size),this.performFill(e,s),void 0!==this.options.icon&&void 0!==this.options.icon.code&&(e.font=(a?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",e.fillText(this.options.icon.code,n,i)),void 0!==this.options.label){this.labelModule.calculateLabelSize(e,a,d,n,i,"hanging");var r=i+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,n,r,a,d,"hanging")}this.updateBoundingBox(n,i)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,void 0!==this.options.label&&0<this.labelModule.size.width&&(this.boundingBox.left=fo(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=yo(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=yo(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}]),t}(Ya),Aa=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"draw",value:function(e,t,o,n,i,a){this._drawShape(e,"diamond",4,t,o,n,i,a)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(La),Wa=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"draw",value:function(e,t,o,n,i,a){this._drawShape(e,"circle",2,t,o,n,i,a)}},{key:"distanceToBorder",value:function(e){return this.resize(e),this.options.size}}]),t}(La),ja=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"resize",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.selected,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(t,o)){var n=this.getDimensionsFromLabel(e,t,o);this.height=2*n.height,this.width=n.width+n.height,this.radius=.5*this.width}}},{key:"draw",value:function(e,t,o,n,i,a){this.resize(e,n,i),this.left=t-.5*this.width,this.top=o-.5*this.height,this.initContextForDraw(e,a),e.ellipse_vis(this.left,this.top,this.width,this.height),this.performFill(e,a),this.updateBoundingBox(t,o,e,n,i),this.labelModule.draw(e,t,o,n,i)}},{key:"distanceToBorder",value:function(e,t){this.resize(e);var o=.5*this.width,n=.5*this.height,i=so(t)*o,a=ao(t)*n;return o*n/mo(i*i+a*a)}}]),t}(Ya),Ua=function(e){function t(e,o,n){var i;return pa(this,t),i=Ma(this,Ia(t).call(this,e,o,n)),i._setMargins(n),i}return Fa(t,e),ha(t,[{key:"resize",value:function(e,t,o){this.needsRefresh(t,o)&&(this.iconSize={width:+this.options.icon.size,height:+this.options.icon.size},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(e,t,o,n,i,a){if(this.resize(e,n,i),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=o-this.height/2,this._icon(e,t,o,n,i,a),void 0!==this.options.label){this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,o+this.height/2+5,n)}this.updateBoundingBox(t,o)}},{key:"updateBoundingBox",value:function(e,t){if(this.boundingBox.top=t-.5*this.options.icon.size,this.boundingBox.left=e-.5*this.options.icon.size,this.boundingBox.right=e+.5*this.options.icon.size,this.boundingBox.bottom=t+.5*this.options.icon.size,void 0!==this.options.label&&0<this.labelModule.size.width){this.boundingBox.left=fo(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=yo(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=yo(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5)}}},{key:"_icon",value:function(e,t,o,n,i,a){var d=+this.options.icon.size;void 0===this.options.icon.code?console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally."):(e.font=(n?"bold ":"")+d+"px "+this.options.icon.face,e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,a),e.fillText(this.options.icon.code,t,o),this.disableShadow(e,a))}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(Ya),Va=function(e){function t(e,o,n,i,a){var d;return pa(this,t),d=Ma(this,Ia(t).call(this,e,o,n)),d.setImages(i,a),d}return Fa(t,e),ha(t,[{key:"resize",value:function(){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.selected,t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.hover,o=void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height;if(o){var n=2*this.options.size;return this.width=n,void(this.height=n)}this.needsRefresh(e,t)&&this._resizeImage()}},{key:"draw",value:function(e,t,o,n,i,a){if(this.switchImages(n),this.resize(),this.left=t-this.width/2,this.top=o-this.height/2,!0===this.options.shapeProperties.useBorderWithImage){var d=this.options.borderWidth,s=this.options.borderWidthSelected||2*this.options.borderWidth,r=(n?s:d)/this.body.view.scale;e.lineWidth=fo(this.width,r),e.beginPath(),e.strokeStyle=n?this.options.color.highlight.border:i?this.options.color.hover.border:this.options.color.border,e.fillStyle=n?this.options.color.highlight.background:i?this.options.color.hover.background:this.options.color.background,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),e.fill(),this.performStroke(e,a),e.closePath()}this._drawImageAtPosition(e,a),this._drawImageLabel(e,t,o,n,i),this.updateBoundingBox(t,o)}},{key:"updateBoundingBox",value:function(e,t){this.resize(),this._updateBoundingBox(e,t),void 0!==this.options.label&&0<this.labelModule.size.width&&(this.boundingBox.left=fo(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=yo(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=yo(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(Na),Ga=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"draw",value:function(e,t,o,n,i,a){this._drawShape(e,"square",2,t,o,n,i,a)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(La),qa=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"draw",value:function(e,t,o,n,i,a){this._drawShape(e,"hexagon",4,t,o,n,i,a)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(La),Za=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"draw",value:function(e,t,o,n,i,a){this._drawShape(e,"star",4,t,o,n,i,a)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(La),Xa=function(e){function t(e,o,n){var i;return pa(this,t),i=Ma(this,Ia(t).call(this,e,o,n)),i._setMargins(n),i}return Fa(t,e),ha(t,[{key:"resize",value:function(e,t,o){this.needsRefresh(t,o)&&(this.textSize=this.labelModule.getTextSize(e,t,o),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(e,t,o,n,i,a){this.resize(e,n,i),this.left=t-this.width/2,this.top=o-this.height/2,this.enableShadow(e,a),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,n,i),this.disableShadow(e,a),this.updateBoundingBox(t,o,e,n,i)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(Ya),Ka=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"draw",value:function(e,t,o,n,i,a){this._drawShape(e,"triangle",3,t,o,n,i,a)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(La),Qa=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"draw",value:function(e,t,o,n,i,a){this._drawShape(e,"triangleDown",3,t,o,n,i,a)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),t}(La),$a=!1,Ja="background: #FFeeee; color: #dd0000",ed=function(){function e(){pa(this,e)}return ha(e,null,[{key:"validate",value:function(t,o,n){$a=!1,Qd=o;var i=o;return void 0!==n&&(i=o[n]),e.parse(t,i,[]),$a}},{key:"parse",value:function(t,o,n){for(var i in t)t.hasOwnProperty(i)&&e.check(i,t,o,n)}},{key:"check",value:function(t,o,n,i){if(void 0===n[t]&&void 0===n.__any__)return void e.getSuggestion(t,n,i);var a=t,d=!0;void 0===n[t]&&void 0!==n.__any__&&(a="__any__",d="object"===e.getType(o[t]));var s=n[a];d&&void 0!==s.__type__&&(s=s.__type__),e.checkFields(t,o,n,a,s,i)}},{key:"checkFields",value:function(t,o,n,i,a,d){var s=function(o){console.log("%c"+o+e.printLocation(d,t),Ja)},r=e.getType(o[t]),l=a[r];void 0===l?void 0===a.any&&(s("Invalid type received for \""+t+"\". Expected: "+e.print(Object.keys(a))+". Received ["+r+"] \""+o[t]+"\""),$a=!0):"array"===e.getType(l)&&-1===l.indexOf(o[t])?(s("Invalid option detected in \""+t+"\". Allowed values are:"+e.print(l)+" not \""+o[t]+"\". "),$a=!0):"object"===r&&"__any__"!==i&&(d=Wo.copyAndExtendArray(d,t),e.parse(o[t],n[i],d))}},{key:"getType",value:function(e){var t=ka(e);return"object"===t?null===e?"null":e instanceof Boolean?"boolean":e instanceof Number?"number":e instanceof String?"string":Array.isArray(e)?"array":e instanceof Date?"date":void 0===e.nodeType?!0===e._isAMomentObject?"moment":"object":"dom":"number"===t?"number":"boolean"===t?"boolean":"string"===t?"string":void 0===t?"undefined":t}},{key:"getSuggestion",value:function(t,o,n){var i=e.findInOptions(t,o,n,!1),a=e.findInOptions(t,Qd,[],!0),d;d=void 0===i.indexMatch?a.distance<=4&&i.distance>a.distance?" in "+e.printLocation(i.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+e.printLocation(a.path,a.closestMatch,""):i.distance<=8?". Did you mean \""+i.closestMatch+"\"?"+e.printLocation(i.path,t):". Did you mean one of these: "+e.print(Object.keys(o))+e.printLocation(n,t):" in "+e.printLocation(i.path,t,"")+"Perhaps it was incomplete? Did you mean: \""+i.indexMatch+"\"?\n\n",console.log("%cUnknown option detected: \""+t+"\""+d,Ja),$a=!0}},{key:"findInOptions",value:function(t,o,n){var i=!!(3<arguments.length&&void 0!==arguments[3])&&arguments[3],a=1e9,d="",s=[],r=t.toLowerCase(),l=void 0;for(var c in o){var u=void 0;if(void 0!==o[c].__type__&&!0===i){var p=e.findInOptions(t,o[c],Wo.copyAndExtendArray(n,c));a>p.distance&&(d=p.closestMatch,s=p.path,a=p.distance,l=p.indexMatch)}else-1!==c.toLowerCase().indexOf(r)&&(l=c),u=e.levenshteinDistance(t,c),a>u&&(d=c,s=Wo.copyArray(n),a=u)}return{closestMatch:d,path:s,distance:a,indexMatch:l}}},{key:"printLocation",value:function(e,t){for(var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n",n="\n\n"+o+"options = {\n",a=0;a<e.length;a++){for(var d=0;d<a+1;d++)n+=" ";n+=e[a]+": {\n"}for(var s=0;s<e.length+1;s++)n+=" ";n+=t+"\n";for(var r=0;r<e.length+1;r++){for(var l=0;l<e.length-r;l++)n+=" ";n+="}\n"}return n+"\n\n"}},{key:"print",value:function(e){return JSON.stringify(e).replace(/(\")|(\[)|(\])|(,"__type__")/g,"").replace(/(\,)/g,", ")}},{key:"levenshteinDistance",value:function(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;var o=[],n;for(n=0;n<=t.length;n++)o[n]=[n];var a;for(a=0;a<=e.length;a++)o[0][a]=a;for(n=1;n<=t.length;n++)for(a=1;a<=e.length;a++)o[n][a]=t.charAt(n-1)==e.charAt(a-1)?o[n-1][a-1]:fo(o[n-1][a-1]+1,fo(o[n][a-1]+1,o[n-1][a]+1));return o[t.length][e.length]}}]),e}(),td=function(){function e(t,o,n,i,a,d){pa(this,e),this.options=Wo.bridgeObject(a),this.globalOptions=a,this.defaultOptions=d,this.body=o,this.edges=[],this.id=void 0,this.imagelist=n,this.grouplist=i,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new Ca(this.body,this.options,!1),this.setOptions(t)}return ha(e,[{key:"attachEdge",value:function(e){-1===this.edges.indexOf(e)&&this.edges.push(e)}},{key:"detachEdge",value:function(e){var t=this.edges.indexOf(e);-1!=t&&this.edges.splice(t,1)}},{key:"setOptions",value:function(t){var o=this.options.shape;if(t){if(void 0!==t.id&&(this.id=t.id),void 0===this.id)throw new Error("Node must have an id");e.checkMass(t,this.id),void 0!==t.x&&(null===t.x?(this.x=void 0,this.predefinedPosition=!1):(this.x=parseInt(t.x),this.predefinedPosition=!0)),void 0!==t.y&&(null===t.y?(this.y=void 0,this.predefinedPosition=!1):(this.y=parseInt(t.y),this.predefinedPosition=!0)),void 0!==t.size&&(this.baseSize=t.size),void 0!==t.value&&(t.value=parseFloat(t.value)),e.parseOptions(this.options,t,!0,this.globalOptions,this.grouplist);var n=[t,this.options,this.defaultOptions];return this.chooser=wa.choosify("node",n),this._load_images(),this.updateLabelModule(t),this.updateShape(o),void 0!==t.hidden||void 0!==t.physics}}},{key:"_load_images",value:function(){if(("circularImage"===this.options.shape||"image"===this.options.shape)&&void 0===this.options.image)throw new Error("Option image must be defined for node type '"+this.options.shape+"'");if(void 0!==this.options.image){if(void 0===this.imagelist)throw new Error("Internal Error: No images provided");if("string"==typeof this.options.image)this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id);else{if(void 0===this.options.image.unselected)throw new Error("No unselected image provided");this.imageObj=this.imagelist.load(this.options.image.unselected,this.options.brokenImage,this.id),this.imageObjAlt=void 0===this.options.image.selected?void 0:this.imagelist.load(this.options.image.selected,this.options.brokenImage,this.id)}}}},{key:"getFormattingValues",value:function(){var e={color:this.options.color.background,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};return this.selected||this.hover?!0===this.chooser?this.selected?(e.borderWidth*=2,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):"function"==typeof this.chooser&&(this.chooser(e,this.options.id,this.selected,this.hover),!1===e.shadow&&(e.shadowColor!==this.options.shadow.color||e.shadowSize!==this.options.shadow.size||e.shadowX!==this.options.shadow.x||e.shadowY!==this.options.shadow.y)&&(e.shadow=!0)):e.shadow=this.options.shadow.enabled,e}},{key:"updateLabelModule",value:function(t){(void 0===this.options.label||null===this.options.label)&&(this.options.label=""),e.updateGroupOptions(this.options,t,this.grouplist);var o=this.grouplist.get(this.options.group,!1),n=[t,this.options,o,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,n),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateShape",value:function(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new za(this.options,this.body,this.labelModule);break;case"circle":this.shape=new Ra(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new Ba(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"database":this.shape=new Ha(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new Aa(this.options,this.body,this.labelModule);break;case"dot":this.shape=new Wa(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new ja(this.options,this.body,this.labelModule);break;case"icon":this.shape=new Ua(this.options,this.body,this.labelModule);break;case"image":this.shape=new Va(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new Ga(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new qa(this.options,this.body,this.labelModule);break;case"star":this.shape=new Za(this.options,this.body,this.labelModule);break;case"text":this.shape=new Xa(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new Ka(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new Qa(this.options,this.body,this.labelModule);break;default:this.shape=new ja(this.options,this.body,this.labelModule);}this.needsRefresh()}},{key:"select",value:function(){this.selected=!0,this.needsRefresh()}},{key:"unselect",value:function(){this.selected=!1,this.needsRefresh()}},{key:"needsRefresh",value:function(){this.shape.refreshNeeded=!0}},{key:"getTitle",value:function(){return this.options.title}},{key:"distanceToBorder",value:function(e,t){return this.shape.distanceToBorder(e,t)}},{key:"isFixed",value:function(){return this.options.fixed.x&&this.options.fixed.y}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"getLabelSize",value:function(){return this.labelModule.size()}},{key:"setValueRange",value:function(e,t,o){if(void 0!==this.options.value){var n=this.options.scaling.customScalingFunction(e,t,o,this.options.value),i=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){var a=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*a}this.options.size=this.options.scaling.min+n*i}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}},{key:"draw",value:function(e){var t=this.getFormattingValues();this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)}},{key:"updateBoundingBox",value:function(e){this.shape.updateBoundingBox(this.x,this.y,e)}},{key:"resize",value:function(e){var t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}},{key:"getItemsOnPoint",value:function(e){var t=[];return this.labelModule.visible()&&wa.pointInRect(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),wa.pointInRect(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}},{key:"isOverlappingWith",value:function(e){return this.shape.left<e.right&&this.shape.left+this.shape.width>e.left&&this.shape.top<e.bottom&&this.shape.top+this.shape.height>e.top}},{key:"isBoundingBoxOverlappingWith",value:function(e){return this.shape.boundingBox.left<e.right&&this.shape.boundingBox.right>e.left&&this.shape.boundingBox.top<e.bottom&&this.shape.boundingBox.bottom>e.top}}],[{key:"updateGroupOptions",value:function(e,t,o){if(void 0!==o){var n=e.group;if(void 0!==t&&void 0!==t.group&&n!==t.group)throw new Error("updateGroupOptions: group values in options don't match.");if("number"==typeof n||"string"==typeof n&&""!=n){var i=o.get(n),a=["font"];void 0!==t&&void 0!==t.color&&null!=t.color&&a.push("color"),Wo.selectiveNotDeepExtend(a,e,i),e.color=Wo.parseColor(e.color)}}}},{key:"parseOptions",value:function(t,o){var n=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},a=4<arguments.length?arguments[4]:void 0;if(Wo.selectiveNotDeepExtend(["color","fixed","shadow"],t,o,n),e.checkMass(o),Wo.mergeOptions(t,o,"shadow",i),void 0!==o.color&&null!==o.color){var d=Wo.parseColor(o.color);Wo.fillIfDefined(t.color,d)}else!0===n&&null===o.color&&(t.color=Wo.bridgeObject(i.color));void 0!==o.fixed&&null!==o.fixed&&("boolean"==typeof o.fixed?(t.fixed.x=o.fixed,t.fixed.y=o.fixed):(void 0!==o.fixed.x&&"boolean"==typeof o.fixed.x&&(t.fixed.x=o.fixed.x),void 0!==o.fixed.y&&"boolean"==typeof o.fixed.y&&(t.fixed.y=o.fixed.y))),!0===n&&null===o.font&&(t.font=Wo.bridgeObject(i.font)),e.updateGroupOptions(t,o,a),void 0!==o.scaling&&Wo.mergeOptions(t.scaling,o.scaling,"label",i.scaling)}},{key:"checkMass",value:function(e,t){if(void 0!==e.mass&&0>=e.mass){var o="";void 0!==t&&(o=" in node id: "+t),console.log("%cNegative or zero mass disallowed"+o+", setting mass to 1.",Ja),e.mass=1}}}]),e}(),od=function(){function e(t,o,n,i){var a=this;if(pa(this,e),this.body=t,this.images=o,this.groups=n,this.layoutEngine=i,this.body.functions.createNode=this.create.bind(this),this.nodesListeners={add:function(e,t){a.add(t.items)},update:function(e,t){a.update(t.items,t.data,t.oldData)},remove:function(e,t){a.remove(t.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:2,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,o,n){if(t===e)return .5;return yo(0,(n-e)*(1/(t-e)))}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1},size:25,title:void 0,value:void 0,x:void 0,y:void 0},0>=this.defaultOptions.mass)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=Wo.bridgeObject(this.defaultOptions),this.bindEventListeners()}return ha(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("refreshNodes",this.refresh.bind(this)),this.body.emitter.on("refresh",this.refresh.bind(this)),this.body.emitter.on("destroy",function(){Wo.forEach(e.nodesListeners,function(t,o){e.body.data.nodes&&e.body.data.nodes.off(o,t)}),delete e.body.functions.createNode,delete e.nodesListeners.add,delete e.nodesListeners.update,delete e.nodesListeners.remove,delete e.nodesListeners})}},{key:"setOptions",value:function(e){if(void 0!==e){if(td.parseOptions(this.options,e),void 0!==e.shape)for(var t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&this.body.nodes[t].updateShape();if(void 0!==e.font)for(var o in this.body.nodes)this.body.nodes.hasOwnProperty(o)&&(this.body.nodes[o].updateLabelModule(),this.body.nodes[o].needsRefresh());if(void 0!==e.size)for(var n in this.body.nodes)this.body.nodes.hasOwnProperty(n)&&this.body.nodes[n].needsRefresh();(void 0!==e.hidden||void 0!==e.physics)&&this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],o=this.body.data.nodes;if(e instanceof xn||e instanceof Sn)this.body.data.nodes=e;else if(Array.isArray(e))this.body.data.nodes=new xn,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new xn;else throw new TypeError("Array or DataSet expected");if(o&&Wo.forEach(this.nodesListeners,function(e,t){o.off(t,e)}),this.body.nodes={},this.body.data.nodes){var n=this;Wo.forEach(this.nodesListeners,function(e,t){n.body.data.nodes.on(t,e)});var i=this.body.data.nodes.getIds();this.add(i,!0)}!1===t&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],o=[],n=0,a;n<e.length;n++){a=e[n];var d=this.body.data.nodes.get(a),s=this.create(d);o.push(s),this.body.nodes[a]=s}this.layoutEngine.positionInitially(o),!1===t&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e,t,o){for(var n=this.body.nodes,a=!1,d=0;d<e.length;d++){var s=e[d],r=n[s],l=t[d];void 0===r?(a=!0,r=this.create(l),n[s]=r):r.setOptions(l)&&(a=!0)}a||void 0===o||(a=t.some(function(e,t){var n=o[t];return n&&n.level!==e.level})),!0===a?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){for(var t=this.body.nodes,o=0,n;o<e.length;o++)n=e[o],delete t[n];this.body.emitter.emit("_dataChanged")}},{key:"create",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:td;return new t(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}},{key:"refresh",value:function(){var e=this,t=!!(0<arguments.length&&void 0!==arguments[0])&&arguments[0];Wo.forEach(this.body.nodes,function(o,n){var i=e.body.data.nodes.get(n);void 0!==i&&(!0===t&&o.setOptions({x:null,y:null}),o.setOptions({fixed:!1}),o.setOptions(i))})}},{key:"getPositions",value:function(e){var t={};if(void 0===e)for(var o=0,n;o<this.body.nodeIndices.length;o++)n=this.body.nodes[this.body.nodeIndices[o]],t[this.body.nodeIndices[o]]={x:ro(n.x),y:ro(n.y)};else if(!0===Array.isArray(e)){for(var a=0;a<e.length;a++)if(void 0!==this.body.nodes[e[a]]){var d=this.body.nodes[e[a]];t[e[a]]={x:ro(d.x),y:ro(d.y)}}}else if(void 0!==this.body.nodes[e]){var s=this.body.nodes[e];t[e]={x:ro(s.x),y:ro(s.y)}}return t}},{key:"storePositions",value:function(){var e=[],t=this.body.data.nodes.getDataSet();for(var o in t._data)if(t._data.hasOwnProperty(o)){var n=this.body.nodes[o];(t._data[o].x!=ro(n.x)||t._data[o].y!=ro(n.y))&&e.push({id:n.id,x:ro(n.x),y:ro(n.y)})}t.update(e)}},{key:"getBoundingBox",value:function(e){if(void 0!==this.body.nodes[e])return this.body.nodes[e].shape.boundingBox}},{key:"getConnectedNodes",value:function(e,t){var o=[];if(void 0!==this.body.nodes[e])for(var n=this.body.nodes[e],a={},d=0,s;d<n.edges.length;d++)s=n.edges[d],"to"!==t&&s.toId==n.id?void 0===a[s.fromId]&&(o.push(s.fromId),a[s.fromId]=!0):"from"!==t&&s.fromId==n.id&&void 0===a[s.toId]&&(o.push(s.toId),a[s.toId]=!0);return o}},{key:"getConnectedEdges",value:function(e){var t=[];if(void 0!==this.body.nodes[e])for(var o=this.body.nodes[e],n=0;n<o.edges.length;n++)t.push(o.edges[n].id);else console.log("NodeId provided for getConnectedEdges does not exist. Provided: ",e);return t}},{key:"moveNode",value:function(e,t,o){var n=this;void 0===this.body.nodes[e]?console.log("Node id supplied to moveNode does not exist. Provided: ",e):(this.body.nodes[e].x=+t,this.body.nodes[e].y=+o,setTimeout(function(){n.body.emitter.emit("startSimulation")},0))}}]),e}(),nd=function(){function e(){pa(this,e)}return ha(e,null,[{key:"transform",value:function(e,t){e instanceof Array||(e=[e]);for(var o=t.point.x,n=t.point.y,a=t.angle,d=t.length,s=0;s<e.length;++s){var r=e[s],l=r.x*ao(a)-r.y*so(a),c=r.x*so(a)+r.y*ao(a);r.x=o+d*l,r.y=n+d*c}}},{key:"drawPath",value:function(e,t){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(var o=1;o<t.length;++o)e.lineTo(t[o].x,t[o].y);e.closePath()}}]),e}(),id=function(e){function t(){return pa(this,t),Ma(this,Ia(t).apply(this,arguments))}return Fa(t,e),ha(t,null,[{key:"draw",value:function(e,t){var o=[{x:0,y:0},{x:-1,y:.3},{x:-.9,y:0},{x:-1,y:-.3}];nd.transform(o,t),nd.drawPath(e,o)}}]),t}(nd),ad=function(){function e(){pa(this,e)}return ha(e,null,[{key:"draw",value:function(e,t){var o=[{x:-1,y:0},{x:0,y:.3},{x:-.4,y:0},{x:0,y:-.3}];nd.transform(o,t),nd.drawPath(e,o)}}]),e}(),dd=function(){function e(){pa(this,e)}return ha(e,null,[{key:"draw",value:function(e,t){var o={x:-.4,y:0};nd.transform(o,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";var n=po,i=t.angle-n/2,a=t.angle+n/2;e.beginPath(),e.arc(o.x,o.y,.4*t.length,i,a,!1),e.stroke()}}]),e}(),sd=function(){function e(){pa(this,e)}return ha(e,null,[{key:"draw",value:function(e,t){var o={x:-.3,y:0};nd.transform(o,t),e.strokeStyle=e.fillStyle,e.fillStyle="rgba(0, 0, 0, 0)";var n=po,i=t.angle+n/2,a=t.angle+3*n/2;e.beginPath(),e.arc(o.x,o.y,.4*t.length,i,a,!1),e.stroke()}}]),e}(),rd=function(){function e(){pa(this,e)}return ha(e,null,[{key:"draw",value:function(e,t){var o=[{x:.02,y:0},{x:-1,y:.3},{x:-1,y:-.3}];nd.transform(o,t),nd.drawPath(e,o)}}]),e}(),ld=function(){function e(){pa(this,e)}return ha(e,null,[{key:"draw",value:function(e,t){var o=[{x:0,y:.3},{x:0,y:-.3},{x:-1,y:0}];nd.transform(o,t),nd.drawPath(e,o)}}]),e}(),cd=function(){function e(){pa(this,e)}return ha(e,null,[{key:"draw",value:function(e,t){var o={x:-.4,y:0};nd.transform(o,t),e.circle(o.x,o.y,.4*t.length)}}]),e}(),ud=function(){function e(){pa(this,e)}return ha(e,null,[{key:"draw",value:function(e,t){var o=[{x:0,y:.5},{x:0,y:-.5},{x:-.15,y:-.5},{x:-.15,y:.5}];nd.transform(o,t),nd.drawPath(e,o)}}]),e}(),pd=function(){function e(){pa(this,e)}return ha(e,null,[{key:"draw",value:function(e,t){var o=[{x:0,y:.3},{x:0,y:-.3},{x:-.6,y:-.3},{x:-.6,y:.3}];nd.transform(o,t),nd.drawPath(e,o)}}]),e}(),hd=function(){function e(){pa(this,e)}return ha(e,null,[{key:"draw",value:function(e,t){var o=[{x:0,y:0},{x:-.5,y:-.3},{x:-1,y:0},{x:-.5,y:.3}];nd.transform(o,t),nd.drawPath(e,o)}}]),e}(),md=function(){function e(){pa(this,e)}return ha(e,null,[{key:"draw",value:function(e,t){var o=[{x:-1,y:.3},{x:-.5,y:0},{x:-1,y:-.3},{x:0,y:0}];nd.transform(o,t),nd.drawPath(e,o)}}]),e}(),gd=function(){function e(){pa(this,e)}return ha(e,null,[{key:"draw",value:function(e,t){var o;switch(t.type&&(o=t.type.toLowerCase()),o){case"circle":cd.draw(e,t);break;case"box":pd.draw(e,t);break;case"crow":ad.draw(e,t);break;case"curve":dd.draw(e,t);break;case"diamond":hd.draw(e,t);break;case"inv_curve":sd.draw(e,t);break;case"triangle":rd.draw(e,t);break;case"inv_triangle":ld.draw(e,t);break;case"bar":ud.draw(e,t);break;case"vee":md.draw(e,t);break;case"arrow":default:id.draw(e,t);}}}]),e}(),yd=function(){function e(t,o,n){pa(this,e),this.body=o,this.labelModule=n,this.options={},this.setOptions(t),this.colorDirty=!0,this.color={},this.selectionWidth=2,this.hoverWidth=1.5,this.fromPoint=this.from,this.toPoint=this.to}return ha(e,[{key:"connect",value:function(){this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to]}},{key:"cleanup",value:function(){return!1}},{key:"setOptions",value:function(e){this.options=e,this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to],this.id=this.options.id}},{key:"drawLine",value:function(e,t,o,n,i){e.strokeStyle=this.getColor(e,t,o,n),e.lineWidth=t.width,!1===t.dashes?this._drawLine(e,t,i):this._drawDashedLine(e,t,i)}},{key:"_drawLine",value:function(e,t,o,n,i){if(this.from!=this.to)this._line(e,t,o,n,i);else{var a=this._getCircleData(e),d=va(a,3),s=d[0],r=d[1],l=d[2];this._circle(e,t,s,r,l)}}},{key:"_drawDashedLine",value:function(e,t,o){e.lineCap="round";var n=[5,5];if(!0===Array.isArray(t.dashes)&&(n=t.dashes),void 0!==e.setLineDash){if(e.save(),e.setLineDash(n),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,o);else{var i=this._getCircleData(e),a=va(i,3),d=a[0],s=a[1],r=a[2];this._circle(e,t,d,s,r)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)e.dashedLine(this.from.x,this.from.y,this.to.x,this.to.y,n);else{var l=this._getCircleData(e),c=va(l,3),u=c[0],p=c[1],h=c[2];this._circle(e,t,u,p,h)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}},{key:"findBorderPosition",value:function(e,t,o){return this.from==this.to?this._findBorderPositionCircle(e,t,o):this._findBorderPosition(e,t,o)}},{key:"findBorderPositions",value:function(e){var t={},o={};if(this.from!=this.to)t=this._findBorderPosition(this.from,e),o=this._findBorderPosition(this.to,e);else{var n=this._getCircleData(e).slice(0,2),i=va(n,2),a=i[0],d=i[1];t=this._findBorderPositionCircle(this.from,e,{x:a,y:d,low:.25,high:.6,direction:-1}),o=this._findBorderPositionCircle(this.from,e,{x:a,y:d,low:.6,high:.8,direction:1})}return{from:t,to:o}}},{key:"_getCircleData",value:function(e){var t=this.from,o=this.options.selfReferenceSize,n,i;return void 0!==e&&void 0===t.shape.width&&t.shape.resize(e),t.shape.width>t.shape.height?(n=t.x+.5*t.shape.width,i=t.y-o):(n=t.x+o,i=t.y-.5*t.shape.height),[n,i,o]}},{key:"_pointOnCircle",value:function(e,t,o,n){var i=2*n*po;return{x:e+o*ao(i),y:t-o*so(i)}}},{key:"_findBorderPositionCircle",value:function(e,t,o){for(var n=o.x,i=o.y,a=o.low,d=o.high,s=o.direction,r=0,l=this.options.selfReferenceSize,c=.5*(a+d),u,p,h,m,g;a<=d&&r<10&&(c=.5*(a+d),u=this._pointOnCircle(n,i,l,c),p=ho(e.y-u.y,e.x-u.x),h=e.distanceToBorder(t,p),m=mo(lo(u.x-e.x,2)+lo(u.y-e.y,2)),g=h-m,!(uo(g)<.05));)0<g?0<s?a=c:d=c:0<s?d=c:a=c,r++;return u.t=c,u}},{key:"getLineWidth",value:function(e,t){return!0===e?yo(this.selectionWidth,.3/this.body.view.scale):!0===t?yo(this.hoverWidth,.3/this.body.view.scale):yo(this.options.width,.3/this.body.view.scale)}},{key:"getColor",value:function(e,t){if(!1!==t.inheritsColor){if("both"===t.inheritsColor&&this.from.id!==this.to.id){var o=e.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y),n,i;return n=this.from.options.color.highlight.border,i=this.to.options.color.highlight.border,!1===this.from.selected&&!1===this.to.selected?(n=Wo.overrideOpacity(this.from.options.color.border,t.opacity),i=Wo.overrideOpacity(this.to.options.color.border,t.opacity)):!0===this.from.selected&&!1===this.to.selected?i=this.to.options.color.border:!1===this.from.selected&&!0===this.to.selected&&(n=this.from.options.color.border),o.addColorStop(0,n),o.addColorStop(1,i),o}return"to"===t.inheritsColor?Wo.overrideOpacity(this.to.options.color.border,t.opacity):Wo.overrideOpacity(this.from.options.color.border,t.opacity)}return Wo.overrideOpacity(t.color,t.opacity)}},{key:"_circle",value:function(e,t,o,n,i){this.enableShadow(e,t),e.beginPath(),e.arc(o,n,i,0,2*po,!1),e.stroke(),this.disableShadow(e,t)}},{key:"getDistanceToEdge",value:function(e,t,o,n,i,a,d){var s=0;if(this.from!=this.to)s=this._getDistanceToEdge(e,t,o,n,i,a,d);else{var r=this._getCircleData(void 0),l=va(r,3),c=l[0],u=l[1],p=l[2],h=c-i,m=u-a;s=uo(mo(h*h+m*m)-p)}return s}},{key:"_getDistanceToLine",value:function(e,t,o,n,i,a){var d=o-e,s=n-t,r=((i-e)*d+(a-t)*s)/(d*d+s*s);1<r?r=1:0>r&&(r=0);var l=e+r*d,c=t+r*s,p=l-i,h=c-a;return mo(p*p+h*h)}},{key:"getArrowData",value:function(e,t,o,n,i,a){var d=a.width,s,r,l,c,u,p,h;if("from"===t?(l=this.from,c=this.to,u=.1,p=a.fromArrowScale,h=a.fromArrowType):"to"===t?(l=this.to,c=this.from,u=-.1,p=a.toArrowScale,h=a.toArrowType):(l=this.to,c=this.from,p=a.middleArrowScale,h=a.middleArrowType),l==c){var m=this._getCircleData(e),g=va(m,3),f=g[0],b=g[1],y=g[2];"from"===t?(r=this.findBorderPosition(this.from,e,{x:f,y:b,low:.25,high:.6,direction:-1}),s=-2*r.t*po+1.5*po+.1*po):"to"===t?(r=this.findBorderPosition(this.from,e,{x:f,y:b,low:.6,high:1,direction:1}),s=-2*r.t*po+1.5*po-1.1*po):(r=this._pointOnCircle(f,b,y,.175),s=3.9269908169872414)}else if("middle"===t)s=ho(l.y-c.y,l.x-c.x),r=this.getPoint(.5,o);else if(!0===this.options.smooth.enabled){r=this.findBorderPosition(l,e,{via:o});var _=this.getPoint(yo(0,fo(1,r.t+u)),o);s=ho(r.y-_.y,r.x-_.x)}else s=ho(l.y-c.y,l.x-c.x),r=this.findBorderPosition(l,e);"middle"===t&&0>p&&(d*=-1);var v=15*p+3*d,k=r.x-.9*v*ao(s),w=r.y-.9*v*so(s);return{point:r,core:{x:k,y:w},angle:s,length:v,type:h}}},{key:"drawArrowHead",value:function(e,t,o,n,i){e.strokeStyle=this.getColor(e,t,o,n),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,gd.draw(e,i),this.enableShadow(e,t),e.fill(),this.disableShadow(e,t)}},{key:"enableShadow",value:function(e,t){!0===t.shadow&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}},{key:"disableShadow",value:function(e,t){!0===t.shadow&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}},{key:"drawBackground",value:function(e,t){if(!1!==t.background){var o=["strokeStyle","lineWidth","dashes"],n={};o.forEach(function(t){n[t]=e[t]}),e.strokeStyle=t.backgroundColor,e.lineWidth=t.backgroundSize,this.setStrokeDashed(e,t.backgroundDashes),e.stroke(),o.forEach(function(t){e[t]=n[t]}),this.setStrokeDashed(e,t.dashes)}}},{key:"setStrokeDashed",value:function(e,t){if(!1===t)void 0===e.setLineDash?console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used."):e.setLineDash([]);else if(void 0!==e.setLineDash){var o=[5,5];!0===Array.isArray(t)&&(o=t),e.setLineDash(o)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}]),e}(),fd=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"_findBorderPositionBezier",value:function(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this._getViaCoordinates(),n=0,i=0,a=1,d=this.to,s=!1,r,l,c,u,p;for(e.id===this.from.id&&(d=this.from,s=!0);i<=a&&n<10;){var h=.5*(i+a);if(r=this.getPoint(h,o),l=ho(d.y-r.y,d.x-r.x),c=d.distanceToBorder(t,l),u=mo(lo(r.x-d.x,2)+lo(r.y-d.y,2)),p=c-u,uo(p)<.2)break;else 0>p?!1===s?i=h:a=h:!1===s?a=h:i=h;n++}return r.t=h,r}},{key:"_getDistanceToBezierEdge",value:function(e,o,n,a,d,s,r){var l=1e9,c=e,u=o,p,h,m,g,f;for(h=1;10>h;h++)m=.1*h,g=lo(1-m,2)*e+2*m*(1-m)*r.x+lo(m,2)*n,f=lo(1-m,2)*o+2*m*(1-m)*r.y+lo(m,2)*a,0<h&&(p=this._getDistanceToLine(c,u,g,f,d,s),l=p<l?p:l),c=g,u=f;return l}},{key:"_bezierCurve",value:function(e,t,o,n){var i=void 0!==o&&void 0!==o.x,a=void 0!==n&&void 0!==n.x;e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),i&&a?e.bezierCurveTo(o.x,o.y,n.x,n.y,this.toPoint.x,this.toPoint.y):i?e.quadraticCurveTo(o.x,o.y,this.toPoint.x,this.toPoint.y):e.lineTo(this.toPoint.x,this.toPoint.y),this.drawBackground(e,t),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}}]),t}(yd),bd=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"_getDistanceToBezierEdge",value:function(e,o,n,a,d,s,r,l){var c=1e9,u=e,p=o,h=[0,0,0,0],m,g,f,b,_;for(g=1;10>g;g++)f=.1*g,h[0]=lo(1-f,3),h[1]=3*f*lo(1-f,2),h[2]=3*lo(f,2)*(1-f),h[3]=lo(f,3),b=h[0]*e+h[1]*r.x+h[2]*l.x+h[3]*n,_=h[0]*o+h[1]*r.y+h[2]*l.y+h[3]*a,0<g&&(m=this._getDistanceToLine(u,p,b,_,d,s),c=m<c?m:c),u=b,p=_;return c}}]),t}(fd),_d=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"_line",value:function(e,t,o){var n=o[0],i=o[1];this._bezierCurve(e,t,n,i)}},{key:"_getViaCoordinates",value:function(){var e=this.from.x-this.to.x,t=this.from.y-this.to.y,o=this.options.smooth.roundness,n,i,a,d;return(uo(e)>uo(t)||!0===this.options.smooth.forceDirection||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(i=this.from.y,d=this.to.y,n=this.from.x-o*e,a=this.to.x+o*e):(i=this.from.y-o*t,d=this.to.y+o*t,n=this.from.x,a=this.to.x),[{x:n,y:i},{x:a,y:d}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(e,t){return this._findBorderPositionBezier(e,t)}},{key:"_getDistanceToEdge",value:function(e,t,o,n,i,a){var d=6<arguments.length&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates(),s=va(d,2),r=s[0],l=s[1];return this._getDistanceToBezierEdge(e,t,o,n,i,a,r,l)}},{key:"getPoint",value:function(e){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),n=va(o,2),i=n[0],a=n[1],d=e,t=[];t[0]=lo(1-d,3),t[1]=3*d*lo(1-d,2),t[2]=3*lo(d,2)*(1-d),t[3]=lo(d,3);var s=t[0]*this.fromPoint.x+t[1]*i.x+t[2]*a.x+t[3]*this.toPoint.x,r=t[0]*this.fromPoint.y+t[1]*i.y+t[2]*a.y+t[3]*this.toPoint.y;return{x:s,y:r}}}]),t}(bd),vd=function(e){function t(e,o,n){var i;return pa(this,t),i=Ma(this,Ia(t).call(this,e,o,n)),i._boundFunction=function(){i.positionBezierNode()},i.body.emitter.on("_repositionBezierNodes",i._boundFunction),i}return Fa(t,e),ha(t,[{key:"setOptions",value:function(e){var t=!1;this.options.physics!==e.physics&&(t=!0),this.options=e,this.id=this.options.id,this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to],this.setupSupportNode(),this.connect(),!0==t&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}},{key:"connect",value:function(){this.from=this.body.nodes[this.options.from],this.to=this.body.nodes[this.options.to],void 0===this.from||void 0===this.to||!1===this.options.physics?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}},{key:"cleanup",value:function(){return this.body.emitter.off("_repositionBezierNodes",this._boundFunction),void 0!==this.via&&(delete this.body.nodes[this.via.id],this.via=void 0,!0)}},{key:"setupSupportNode",value:function(){if(void 0===this.via){var e="edgeId:"+this.id,t=this.body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this.body.nodes[e]=t,this.via=t,this.via.parentEdgeId=this.id,this.positionBezierNode()}}},{key:"positionBezierNode",value:function(){void 0!==this.via&&void 0!==this.from&&void 0!==this.to?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):void 0!==this.via&&(this.via.x=0,this.via.y=0)}},{key:"_line",value:function(e,t,o){this._bezierCurve(e,t,o)}},{key:"getViaNode",value:function(){return this.via}},{key:"getPoint",value:function(e){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.via,n=e,t,i;if(this.from===this.to){var d=this._getCircleData(this.from),s=va(d,3),r=s[0],l=s[1],c=s[2],u=2*po*(1-n);t=r+c*so(u),i=l+c-c*(1-ao(u))}else t=lo(1-n,2)*this.fromPoint.x+2*n*(1-n)*o.x+lo(n,2)*this.toPoint.x,i=lo(1-n,2)*this.fromPoint.y+2*n*(1-n)*o.y+lo(n,2)*this.toPoint.y;return{x:t,y:i}}},{key:"_findBorderPosition",value:function(e,t){return this._findBorderPositionBezier(e,t,this.via)}},{key:"_getDistanceToEdge",value:function(e,t,o,n,i,a){return this._getDistanceToBezierEdge(e,t,o,n,i,a,this.via)}}]),t}(fd),kd=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"_line",value:function(e,t,o){this._bezierCurve(e,t,o)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var e=void 0,t=void 0,o=this.options.smooth.roundness,n=this.options.smooth.type,i=uo(this.from.x-this.to.x),a=uo(this.from.y-this.to.y);if("discrete"===n||"diagonalCross"===n){var d,s;d=i<=a?s=o*a:s=o*i,this.from.x>this.to.x&&(d=-d),this.from.y>=this.to.y&&(s=-s),e=this.from.x+d,t=this.from.y+s,"discrete"===n&&(i<=a?e=i<o*a?this.from.x:e:t=a<o*i?this.from.y:t)}else if("straightCross"===n){var r=(1-o)*i,l=(1-o)*a;i<=a?(r=0,this.from.y<this.to.y&&(l=-l)):(this.from.x<this.to.x&&(r=-r),l=0),e=this.to.x+r,t=this.to.y+l}else if("horizontal"===n){var c=(1-o)*i;this.from.x<this.to.x&&(c=-c),e=this.to.x+c,t=this.from.y}else if("vertical"===n){var u=(1-o)*a;this.from.y<this.to.y&&(u=-u),e=this.from.x,t=this.to.y+u}else if("curvedCW"===n){i=this.to.x-this.from.x,a=this.from.y-this.to.y;var p=mo(i*i+a*a),h=po,m=ho(a,i),g=(m+(.5*o+.5)*h)%(2*h);e=this.from.x+(.5*o+.5)*p*so(g),t=this.from.y+(.5*o+.5)*p*ao(g)}else if("curvedCCW"===n){i=this.to.x-this.from.x,a=this.from.y-this.to.y;var y=mo(i*i+a*a),f=po,b=ho(a,i),_=(b+(.5*-o+.5)*f)%(2*f);e=this.from.x+(.5*o+.5)*y*so(_),t=this.from.y+(.5*o+.5)*y*ao(_)}else{var v,k;v=i<=a?k=o*a:k=o*i,this.from.x>this.to.x&&(v=-v),this.from.y>=this.to.y&&(k=-k),e=this.from.x+v,t=this.from.y+k,i<=a?this.from.x<=this.to.x?e=this.to.x<e?this.to.x:e:e=this.to.x>e?this.to.x:e:this.from.y>=this.to.y?t=this.to.y>t?this.to.y:t:t=this.to.y<t?this.to.y:t}return{x:e,y:t}}},{key:"_findBorderPosition",value:function(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(e,t,o.via)}},{key:"_getDistanceToEdge",value:function(e,t,o,n,i,a){var d=6<arguments.length&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,o,n,i,a,d)}},{key:"getPoint",value:function(e){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),n=e,t=lo(1-n,2)*this.fromPoint.x+2*n*(1-n)*o.x+lo(n,2)*this.toPoint.x,i=lo(1-n,2)*this.fromPoint.y+2*n*(1-n)*o.y+lo(n,2)*this.toPoint.y;return{x:t,y:i}}}]),t}(fd),wd=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"_line",value:function(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}},{key:"_findBorderPosition",value:function(e,t){var o=this.to,n=this.from;e.id===this.from.id&&(o=this.from,n=this.to);var i=ho(o.y-n.y,o.x-n.x),a=o.x-n.x,d=o.y-n.y,s=mo(a*a+d*d),r=e.distanceToBorder(t,i),l=(s-r)/s,c={};return c.x=(1-l)*n.x+l*o.x,c.y=(1-l)*n.y+l*o.y,c}},{key:"_getDistanceToEdge",value:function(e,t,o,n,i,a){return this._getDistanceToLine(e,t,o,n,i,a)}}]),t}(yd),xd=function(){function e(t,o,n,i){if(pa(this,e),void 0===o)throw new Error("No body provided");this.options=Wo.bridgeObject(n),this.globalOptions=n,this.defaultOptions=i,this.body=o,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new Ca(this.body,this.options,!0),this.setOptions(t)}return ha(e,[{key:"setOptions",value:function(t){if(t){var o=this.options.hidden;(void 0===o||null===o)&&(o=!1),e.parseOptions(this.options,t,!0,this.globalOptions),void 0!==t.id&&(this.id=t.id),void 0!==t.from&&(this.fromId=t.from),void 0!==t.to&&(this.toId=t.to),void 0!==t.title&&(this.title=t.title),void 0!==t.value&&(t.value=parseFloat(t.value));var n=[t,this.options,this.defaultOptions];this.chooser=wa.choosify("edge",n),this.updateLabelModule(t);var i=this.updateEdgeType();this._setInteractionWidths(),this.connect();var a=this.options.hidden;return(void 0===a||null===a)&&(a=!1),(a!=o||void 0!==t.physics)&&(i=!0),void 0!==t.physics&&(i=!0),i}}},{key:"getFormattingValues",value:function(){var e=!0===this.options.arrows.to||!0===this.options.arrows.to.enabled,t=!0===this.options.arrows.from||!0===this.options.arrows.from.enabled,o=!0===this.options.arrows.middle||!0===this.options.arrows.middle.enabled,n=this.options.color.inherit,i={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,middleArrow:o,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,arrowStrikethrough:this.options.arrowStrikethrough,color:n?void 0:this.options.color.color,inheritsColor:n,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(!(this.selected||this.hover))i.shadow=this.options.shadow.enabled,i.width=yo(i.width,.3/this.body.view.scale);else if(!0!==this.chooser)"function"==typeof this.chooser&&(this.chooser(i,this.options.id,this.selected,this.hover),void 0!==i.color&&(i.inheritsColor=!1),!1===i.shadow&&(i.shadowColor!==this.options.shadow.color||i.shadowSize!==this.options.shadow.size||i.shadowX!==this.options.shadow.x||i.shadowY!==this.options.shadow.y)&&(i.shadow=!0));else if(this.selected){var a=this.options.selectionWidth;"function"==typeof a?i.width=a(i.width):"number"==typeof a&&(i.width+=a),i.width=yo(i.width,.3/this.body.view.scale),i.color=this.options.color.highlight,i.shadow=this.options.shadow.enabled}else if(this.hover){var d=this.options.hoverWidth;"function"==typeof d?i.width=d(i.width):"number"==typeof d&&(i.width+=d),i.width=yo(i.width,.3/this.body.view.scale),i.color=this.options.color.hover,i.shadow=this.options.shadow.enabled}return i}},{key:"updateLabelModule",value:function(e){var t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var e=this.options.smooth,t=!1,o=!0;return void 0!==this.edgeType&&((this.edgeType instanceof vd&&!0===e.enabled&&"dynamic"===e.type||this.edgeType instanceof _d&&!0===e.enabled&&"cubicBezier"===e.type||this.edgeType instanceof kd&&!0===e.enabled&&"dynamic"!==e.type&&"cubicBezier"!==e.type||this.edgeType instanceof wd&&!1===e.type.enabled)&&(o=!1),!0===o&&(t=this.cleanup())),!0===o?!0===e.enabled?"dynamic"===e.type?(t=!0,this.edgeType=new vd(this.options,this.body,this.labelModule)):"cubicBezier"===e.type?this.edgeType=new _d(this.options,this.body,this.labelModule):this.edgeType=new kd(this.options,this.body,this.labelModule):this.edgeType=new wd(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}},{key:"connect",value:function(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=void 0!==this.from&&void 0!==this.to,!0===this.connected?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}},{key:"disconnect",value:function(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}},{key:"getTitle",value:function(){return this.title}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"setValueRange",value:function(e,t,o){if(void 0!==this.options.value){var n=this.options.scaling.customScalingFunction(e,t,o,this.options.value),i=this.options.scaling.max-this.options.scaling.min;if(!0===this.options.scaling.label.enabled){var a=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+n*a}this.options.width=this.options.scaling.min+n*i}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:"_setInteractionWidths",value:function(){this.edgeType.hoverWidth="function"==typeof this.options.hoverWidth?this.options.hoverWidth(this.options.width):this.options.hoverWidth+this.options.width,this.edgeType.selectionWidth="function"==typeof this.options.selectionWidth?this.options.selectionWidth(this.options.width):this.options.selectionWidth+this.options.width}},{key:"draw",value:function(e){var t=this.getFormattingValues();if(!t.hidden){var o=this.edgeType.getViaNode(),n={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(n.from=this.edgeType.getArrowData(e,"from",o,this.selected,this.hover,t),!1===t.arrowStrikethrough&&(this.edgeType.fromPoint=n.from.core)),t.toArrow&&(n.to=this.edgeType.getArrowData(e,"to",o,this.selected,this.hover,t),!1===t.arrowStrikethrough&&(this.edgeType.toPoint=n.to.core)),t.middleArrow&&(n.middle=this.edgeType.getArrowData(e,"middle",o,this.selected,this.hover,t)),this.edgeType.drawLine(e,t,this.selected,this.hover,o),this.drawArrows(e,n,t),this.drawLabel(e,o)}}},{key:"drawArrows",value:function(e,t,o){o.fromArrow&&this.edgeType.drawArrowHead(e,o,this.selected,this.hover,t.from),o.middleArrow&&this.edgeType.drawArrowHead(e,o,this.selected,this.hover,t.middle),o.toArrow&&this.edgeType.drawArrowHead(e,o,this.selected,this.hover,t.to)}},{key:"drawLabel",value:function(e,t){if(void 0!==this.options.label){var o=this.from,n=this.to;if(this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover),o.id!=n.id){this.labelModule.pointToSelf=!1;var i=this.edgeType.getPoint(.5,t);e.save();var a=this._getRotation(e);0!=a.angle&&(e.translate(a.x,a.y),e.rotate(a.angle)),this.labelModule.draw(e,i.x,i.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;var d=this.options.selfReferenceSize,s,r;o.shape.width>o.shape.height?(s=o.x+.5*o.shape.width,r=o.y-d):(s=o.x+d,r=o.y-.5*o.shape.height),i=this._pointOnCircle(s,r,d,.125),this.labelModule.draw(e,i.x,i.y,this.selected,this.hover)}}}},{key:"getItemsOnPoint",value:function(e){var t=[];if(this.labelModule.visible()){var o=this._getRotation();wa.pointInRect(this.labelModule.getSize(),e,o)&&t.push({edgeId:this.id,labelId:0})}var n={left:e.x,top:e.y};return this.isOverlappingWith(n)&&t.push({edgeId:this.id}),t}},{key:"isOverlappingWith",value:function(e){if(this.connected){var t=this.from.x,o=this.from.y,n=this.to.x,i=this.to.y,a=e.left,d=e.top,s=this.edgeType.getDistanceToEdge(t,o,n,i,a,d);return 10>s}return!1}},{key:"_getRotation",value:function(e){var t=this.edgeType.getViaNode(),o=this.edgeType.getPoint(.5,t);void 0!==e&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,o.x,o.y);var n={x:o.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible())return n;if("horizontal"===this.options.font.align)return n;var i=this.from.y-this.to.y,a=this.from.x-this.to.x,d=ho(i,a);return(-1>d&&0>a||0<d&&0>a)&&(d+=po),n.angle=d,n}},{key:"_pointOnCircle",value:function(e,t,o,n){var i=2*n*po;return{x:e+o*ao(i),y:t-o*so(i)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}},{key:"remove",value:function(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}},{key:"endPointsValid",value:function(){return void 0!==this.body.nodes[this.fromId]&&void 0!==this.body.nodes[this.toId]}}],[{key:"parseOptions",value:function(e,t){var o=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},a=!!(4<arguments.length&&void 0!==arguments[4])&&arguments[4];if(Wo.selectiveDeepExtend(["arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","to","title","value","width","font","chosen","widthConstraint"],e,t,o),wa.isValidLabel(t.label)?e.label=t.label:!wa.isValidLabel(e.label)&&(e.label=void 0),Wo.mergeOptions(e,t,"smooth",n),Wo.mergeOptions(e,t,"shadow",n),Wo.mergeOptions(e,t,"background",n),void 0!==t.dashes&&null!==t.dashes?e.dashes=t.dashes:!0===o&&null===t.dashes&&(e.dashes=Object.create(n.dashes)),void 0!==t.scaling&&null!==t.scaling?(void 0!==t.scaling.min&&(e.scaling.min=t.scaling.min),void 0!==t.scaling.max&&(e.scaling.max=t.scaling.max),Wo.mergeOptions(e.scaling,t.scaling,"label",n.scaling)):!0===o&&null===t.scaling&&(e.scaling=Object.create(n.scaling)),void 0===t.arrows||null===t.arrows)!0===o&&null===t.arrows&&(e.arrows=Object.create(n.arrows));else if("string"==typeof t.arrows){var d=t.arrows.toLowerCase();e.arrows.to.enabled=-1!=d.indexOf("to"),e.arrows.middle.enabled=-1!=d.indexOf("middle"),e.arrows.from.enabled=-1!=d.indexOf("from")}else if("object"===ka(t.arrows))Wo.mergeOptions(e.arrows,t.arrows,"to",n.arrows),Wo.mergeOptions(e.arrows,t.arrows,"middle",n.arrows),Wo.mergeOptions(e.arrows,t.arrows,"from",n.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+JSON.stringify(t.arrows));if(void 0!==t.color&&null!==t.color){var s=t.color,r=e.color;if(a)Wo.deepExtend(r,n.color,!1,o);else for(var l in r)r.hasOwnProperty(l)&&delete r[l];if(Wo.isString(r))r.color=r,r.highlight=r,r.hover=r,r.inherit=!1,void 0===s.opacity&&(r.opacity=1);else{var i=!1;void 0!==s.color&&(r.color=s.color,i=!0),void 0!==s.highlight&&(r.highlight=s.highlight,i=!0),void 0!==s.hover&&(r.hover=s.hover,i=!0),void 0!==s.inherit&&(r.inherit=s.inherit),void 0!==s.opacity&&(r.opacity=fo(1,yo(0,s.opacity))),!0==i?r.inherit=!1:void 0===r.inherit&&(r.inherit="from")}}else!0===o&&null===t.color&&(e.color=Wo.bridgeObject(n.color));!0===o&&null===t.font&&(e.font=Wo.bridgeObject(n.font))}}]),e}(),Sd=function(){function e(t,o,n){var i=this;pa(this,e),this.body=t,this.images=o,this.groups=n,this.body.functions.createEdge=this.create.bind(this),this.edgesListeners={add:function(e,t){i.add(t.items)},update:function(e,t){i.update(t.items)},remove:function(e,t){i.remove(t.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(e,t,o,n){if(t===e)return .5;return yo(0,(n-e)*(1/(t-e)))}},selectionWidth:1.5,selfReferenceSize:20,shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},Wo.deepExtend(this.options,this.defaultOptions),this.bindEventListeners()}return ha(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("_forceDisableDynamicCurves",function(t){var o=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];"dynamic"===t&&(t="continuous");var n=!1;for(var i in e.body.edges)if(e.body.edges.hasOwnProperty(i)){var a=e.body.edges[i],d=e.body.data.edges._data[i];if(void 0!==d){var s=d.smooth;void 0!==s&&!0===s.enabled&&"dynamic"===s.type&&(void 0===t?a.setOptions({smooth:!1}):a.setOptions({smooth:{type:t}}),n=!0)}}!0===o&&!0==n&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",function(){e.reconnectEdges()}),this.body.emitter.on("refreshEdges",this.refresh.bind(this)),this.body.emitter.on("refresh",this.refresh.bind(this)),this.body.emitter.on("destroy",function(){Wo.forEach(e.edgesListeners,function(t,o){e.body.data.edges&&e.body.data.edges.off(o,t)}),delete e.body.functions.createEdge,delete e.edgesListeners.add,delete e.edgesListeners.update,delete e.edgesListeners.remove,delete e.edgesListeners})}},{key:"setOptions",value:function(e){if(void 0!==e){xd.parseOptions(this.options,e,!0,this.defaultOptions,!0);var t=!1;if(void 0!==e.smooth)for(var o in this.body.edges)this.body.edges.hasOwnProperty(o)&&(t=this.body.edges[o].updateEdgeType()||t);if(void 0!==e.font)for(var n in this.body.edges)this.body.edges.hasOwnProperty(n)&&this.body.edges[n].updateLabelModule();(void 0!==e.hidden||void 0!==e.physics||!0===t)&&this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var t=this,o=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],n=this.body.data.edges;if(e instanceof xn||e instanceof Sn)this.body.data.edges=e;else if(Array.isArray(e))this.body.data.edges=new xn,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new xn;else throw new TypeError("Array or DataSet expected");if(n&&Wo.forEach(this.edgesListeners,function(e,t){n.off(t,e)}),this.body.edges={},this.body.data.edges){Wo.forEach(this.edgesListeners,function(e,o){t.body.data.edges.on(o,e)});var i=this.body.data.edges.getIds();this.add(i,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===o&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],o=this.body.edges,n=this.body.data.edges,a=0;a<e.length;a++){var d=e[a],s=o[d];s&&s.disconnect();var r=n.get(d,{showInternalIds:!0});o[d]=this.create(r)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===t&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e){for(var t=this.body.edges,o=this.body.data.edges,n=!1,a=0;a<e.length;a++){var d=e[a],s=o.get(d),r=t[d];void 0===r?(this.body.edges[d]=this.create(s),n=!0):(r.disconnect(),n=r.setOptions(s)||n,r.connect())}!0===n?(this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),this.body.emitter.emit("_dataChanged")):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];if(0!==e.length){var o=this.body.edges;Wo.forEach(e,function(e){var t=o[e];void 0!==t&&t.remove()}),t&&this.body.emitter.emit("_dataChanged")}}},{key:"refresh",value:function(){var e=this;Wo.forEach(this.body.edges,function(t,o){var n=e.body.data.edges._data[o];void 0!==n&&t.setOptions(n)})}},{key:"create",value:function(e){return new xd(e,this.body,this.options,this.defaultOptions)}},{key:"reconnectEdges",value:function(){var e=this.body.nodes,t=this.body.edges,o;for(o in e)e.hasOwnProperty(o)&&(e[o].edges=[]);for(o in t)if(t.hasOwnProperty(o)){var n=t[o];n.from=null,n.to=null,n.connect()}}},{key:"getConnectedNodes",value:function(e){var t=[];if(void 0!==this.body.edges[e]){var o=this.body.edges[e];void 0!==o.fromId&&t.push(o.fromId),void 0!==o.toId&&t.push(o.toId)}return t}},{key:"_updateState",value:function(){this._addMissingEdges(),this._removeInvalidEdges()}},{key:"_removeInvalidEdges",value:function(){var e=this,t=[];Wo.forEach(this.body.edges,function(o,n){var i=e.body.nodes[o.toId],a=e.body.nodes[o.fromId];void 0!==i&&!0===i.isCluster||void 0!==a&&!0===a.isCluster||(void 0===i||void 0===a)&&t.push(n)}),this.remove(t,!1)}},{key:"_addMissingEdges",value:function(){var e=this.body.data.edges;if(void 0!==e&&null!==e){var t=this.body.edges,o=[];e.forEach(function(e,n){var i=t[n];void 0===i&&o.push(n)}),this.add(o,!0)}}}]),e}(),Od=function(){function e(t,o,n){pa(this,e),this.body=t,this.physicsBody=o,this.barnesHutTree,this.setOptions(n),this.randomSeed=5}return ha(e,[{key:"setOptions",value:function(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-yo(0,fo(1,this.options.avoidOverlap))}},{key:"seededRandom",value:function(){var e=1e4*so(this.randomSeed++);return e-go(e)}},{key:"solve",value:function(){if(0!==this.options.gravitationalConstant&&0<this.physicsBody.physicsNodeIndices.length){var e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,o=t.length,n=this._formBarnesHutTree(e,t),a;this.barnesHutTree=n;for(var d=0;d<o;d++)a=e[t[d]],0<a.options.mass&&this._getForceContributions(n.root,a)}}},{key:"_getForceContributions",value:function(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}},{key:"_getForceContribution",value:function(e,t){if(0<e.childrenCount){var o,n,i;o=e.centerOfMass.x-t.x,n=e.centerOfMass.y-t.y,i=mo(o*o+n*n),i*e.calcSize>this.thetaInversed?this._calculateForces(i,o,n,t,e):4===e.childrenCount?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(i,o,n,t,e)}}},{key:"_calculateForces",value:function(e,t,o,n,i){0===e&&(e=.1,t=e),1>this.overlapAvoidanceFactor&&n.shape.radius&&(e=yo(.1+this.overlapAvoidanceFactor*n.shape.radius,e-n.shape.radius));var a=this.options.gravitationalConstant*i.mass*n.options.mass/lo(e,3),d=t*a;this.physicsBody.forces[n.id].x+=d,this.physicsBody.forces[n.id].y+=o*a}},{key:"_formBarnesHutTree",value:function(e,t){for(var o=t.length,n=e[t[0]].x,a=e[t[0]].y,d=e[t[0]].x,s=e[t[0]].y,r=1,l;r<o;r++){var c=e[t[r]],u=c.x,p=c.y;0<c.options.mass&&(u<n&&(n=u),u>d&&(d=u),p<a&&(a=p),p>s&&(s=p))}var h=uo(d-n)-uo(s-a);0<h?(a-=.5*h,s+=.5*h):(n+=.5*h,d-=.5*h);var m=yo(1e-5,uo(d-n)),g=.5*m,y=.5*(n+d),f=.5*(a+s),b={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:y-g,maxX:y+g,minY:f-g,maxY:f+g},size:m,calcSize:1/m,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(b.root);for(var _=0;_<o;_++)l=e[t[_]],0<l.options.mass&&this._placeInTree(b.root,l);return b}},{key:"_updateBranchMass",value:function(e,t){var o=e.centerOfMass,n=e.mass+t.options.mass,i=1/n;o.x=o.x*e.mass+t.x*t.options.mass,o.x*=i,o.y=o.y*e.mass+t.y*t.options.mass,o.y*=i,e.mass=n;var a=yo(yo(t.height,t.radius),t.width);e.maxWidth=e.maxWidth<a?a:e.maxWidth}},{key:"_placeInTree",value:function(e,t,o){(!0!=o||void 0===o)&&this._updateBranchMass(e,t);var n=e.children.NW.range,i;i=n.maxX>t.x?n.maxY>t.y?"NW":"SW":n.maxY>t.y?"NE":"SE",this._placeInRegion(e,t,i)}},{key:"_placeInRegion",value:function(e,t,o){var n=e.children[o];switch(n.childrenCount){case 0:n.children.data=t,n.childrenCount=1,this._updateBranchMass(n,t);break;case 1:n.children.data.x===t.x&&n.children.data.y===t.y?(t.x+=this.seededRandom(),t.y+=this.seededRandom()):(this._splitBranch(n),this._placeInTree(n,t));break;case 4:this._placeInTree(n,t);}}},{key:"_splitBranch",value:function(e){var t=null;1===e.childrenCount&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),null!=t&&this._placeInTree(e,t)}},{key:"_insertRegion",value:function(e,t){var o=.5*e.size,n,i,a,d;"NW"===t?(n=e.range.minX,i=e.range.minX+o,a=e.range.minY,d=e.range.minY+o):"NE"===t?(n=e.range.minX+o,i=e.range.maxX,a=e.range.minY,d=e.range.minY+o):"SW"===t?(n=e.range.minX,i=e.range.minX+o,a=e.range.minY+o,d=e.range.maxY):"SE"===t?(n=e.range.minX+o,i=e.range.maxX,a=e.range.minY+o,d=e.range.maxY):void 0,e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:n,maxX:i,minY:a,maxY:d},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}},{key:"_debug",value:function(e,t){void 0!==this.barnesHutTree&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}},{key:"_drawBranch",value:function(e,t,o){void 0===o&&(o="#FF0000"),4===e.childrenCount&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=o,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}]),e}(),Dd=function(){function e(t,o,n){pa(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return ha(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,o=this.physicsBody.forces,n=this.options.nodeDistance,a=0,d,s,r,l,c,u,p,h;a<t.length-1;a++){p=e[t[a]];for(var m=a+1;m<t.length;m++)h=e[t[m]],d=h.x-p.x,s=h.y-p.y,r=mo(d*d+s*s),0===r&&(r=.1*Math.random(),d=r),r<2*n&&(u=r<.5*n?1:-2/3/n*r+4/3,u/=r,l=d*u,c=s*u,o[p.id].x-=l,o[p.id].y-=c,o[h.id].x+=l,o[h.id].y+=c)}}}]),e}(),Td=function(){function e(t,o,n){pa(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return ha(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){var e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,o=this.physicsBody.forces,n=this.options.nodeDistance,a,d,s,r,l,c,u,p,h,m;for(h=0;h<t.length-1;h++)for(u=e[t[h]],m=h+1;m<t.length;m++)if(p=e[t[m]],u.level===p.level){a=p.x-u.x,d=p.y-u.y,s=mo(a*a+d*d);var g=.05;c=s<n?-lo(g*s,2)+lo(g*n,2):0,0===s?s=.01:c/=s,r=a*c,l=d*c,o[u.id].x-=r,o[u.id].y-=l,o[p.id].x+=r,o[p.id].y+=l}}}]),e}(),Cd=function(){function e(t,o,n){pa(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return ha(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e=this.physicsBody.physicsEdgeIndices,t=this.body.edges,o=0,n,a,d,s,r;o<e.length;o++)a=t[e[o]],!0===a.connected&&a.toId!==a.fromId&&void 0!==this.body.nodes[a.toId]&&void 0!==this.body.nodes[a.fromId]&&(void 0===a.edgeType.via?(n=void 0===a.options.length?1.5*this.options.springLength:a.options.length,this._calculateSpringForce(a.from,a.to,n)):(n=void 0===a.options.length?this.options.springLength:a.options.length,d=a.to,s=a.edgeType.via,r=a.from,this._calculateSpringForce(d,s,.5*n),this._calculateSpringForce(s,r,.5*n)))}},{key:"_calculateSpringForce",value:function(e,t,o){var n=e.x-t.x,i=e.y-t.y,a=yo(mo(n*n+i*i),.01),d=this.options.springConstant*(o-a)/a,s=n*d,r=i*d;void 0!==this.physicsBody.forces[e.id]&&(this.physicsBody.forces[e.id].x+=s,this.physicsBody.forces[e.id].y+=r),void 0!==this.physicsBody.forces[t.id]&&(this.physicsBody.forces[t.id].x-=s,this.physicsBody.forces[t.id].y-=r)}}]),e}(),Ed=function(){function e(t,o,n){pa(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return ha(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e=this.body.edges,t=.5,o=this.physicsBody.physicsEdgeIndices,n=this.physicsBody.physicsNodeIndices,a=this.physicsBody.forces,d=0,s,r,l,c,u,p,h,m,g;d<n.length;d++)g=n[d],a[g].springFx=0,a[g].springFy=0;for(var y=0;y<o.length;y++)r=e[o[y]],!0===r.connected&&(s=void 0===r.options.length?this.options.springLength:r.options.length,l=r.from.x-r.to.x,c=r.from.y-r.to.y,m=mo(l*l+c*c),m=0===m?.01:m,h=this.options.springConstant*(s-m)/m,u=l*h,p=c*h,r.to.level==r.from.level?(void 0!==a[r.toId]&&(a[r.toId].x-=t*u,a[r.toId].y-=t*p),void 0!==a[r.fromId]&&(a[r.fromId].x+=t*u,a[r.fromId].y+=t*p)):(void 0!==a[r.toId]&&(a[r.toId].springFx-=u,a[r.toId].springFy-=p),void 0!==a[r.fromId]&&(a[r.fromId].springFx+=u,a[r.fromId].springFy+=p)));h=1;for(var f=0,b,_,v;f<n.length;f++)v=n[f],b=fo(h,yo(-h,a[v].springFx)),_=fo(h,yo(-h,a[v].springFy)),a[v].x+=b,a[v].y+=_;for(var k=0,w=0,x=0,S;x<n.length;x++)S=n[x],k+=a[S].x,w+=a[S].y;for(var O=k/n.length,D=w/n.length,T=0,C;T<n.length;T++)C=n[T],a[C].x-=O,a[C].y-=D}}]),e}(),Md=function(){function e(t,o,n){pa(this,e),this.body=t,this.physicsBody=o,this.setOptions(n)}return ha(e,[{key:"setOptions",value:function(e){this.options=e}},{key:"solve",value:function(){for(var e=this.body.nodes,t=this.physicsBody.physicsNodeIndices,o=this.physicsBody.forces,n=0,a,d,s,r,l;n<t.length;n++)l=t[n],r=e[l],a=-r.x,d=-r.y,s=mo(a*a+d*d),this._calculateForces(s,a,d,o,r)}},{key:"_calculateForces",value:function(e,t,o,n,i){var a=0===e?0:this.options.centralGravity/e;n[i.id].x=t*a,n[i.id].y=o*a}}]),e}(),Id=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"_calculateForces",value:function(e,t,o,n,i){0===e&&(e=.1*Math.random(),t=e),1>this.overlapAvoidanceFactor&&n.shape.radius&&(e=yo(.1+this.overlapAvoidanceFactor*n.shape.radius,e-n.shape.radius));var a=n.edges.length+1,d=this.options.gravitationalConstant*i.mass*n.options.mass*a/lo(e,2),s=t*d;this.physicsBody.forces[n.id].x+=s,this.physicsBody.forces[n.id].y+=o*d}}]),t}(Od),Pd=function(e){function t(e,o,n){return pa(this,t),Ma(this,Ia(t).call(this,e,o,n))}return Fa(t,e),ha(t,[{key:"_calculateForces",value:function(e,t,o,n,i){if(0<e){var a=i.edges.length+1,d=this.options.centralGravity*a*i.options.mass;n[i.id].x=t*d,n[i.id].y=o*d}}}]),t}(Md),Fd=function(){function e(t){pa(this,e),this.body=t,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0},Wo.extend(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return ha(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("initPhysics",function(){e.initPhysics()}),this.body.emitter.on("_layoutFailed",function(){e.layoutFailed=!0}),this.body.emitter.on("resetPhysics",function(){e.stopSimulation(),e.ready=!1}),this.body.emitter.on("disablePhysics",function(){e.physicsEnabled=!1,e.stopSimulation()}),this.body.emitter.on("restorePhysics",function(){e.setOptions(e.options),!0===e.ready&&e.startSimulation()}),this.body.emitter.on("startSimulation",function(){!0===e.ready&&e.startSimulation()}),this.body.emitter.on("stopSimulation",function(){e.stopSimulation()}),this.body.emitter.on("destroy",function(){e.stopSimulation(!1),e.body.emitter.off()}),this.body.emitter.on("_dataChanged",function(){e.updatePhysicsData()})}},{key:"setOptions",value:function(e){void 0!==e&&(!1===e?(this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation()):!0===e?(this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation()):(this.physicsEnabled=!0,Wo.selectiveNotDeepExtend(["stabilization"],this.options,e),Wo.mergeOptions(this.options,e,"stabilization"),void 0===e.enabled&&(this.options.enabled=!0),!1===this.options.enabled&&(this.physicsEnabled=!1,this.stopSimulation()),this.timestep=this.options.timestep)),this.init()}},{key:"init",value:function(){var e;"forceAtlas2Based"===this.options.solver?(e=this.options.forceAtlas2Based,this.nodesSolver=new Id(this.body,this.physicsBody,e),this.edgesSolver=new Cd(this.body,this.physicsBody,e),this.gravitySolver=new Pd(this.body,this.physicsBody,e)):"repulsion"===this.options.solver?(e=this.options.repulsion,this.nodesSolver=new Dd(this.body,this.physicsBody,e),this.edgesSolver=new Cd(this.body,this.physicsBody,e),this.gravitySolver=new Md(this.body,this.physicsBody,e)):"hierarchicalRepulsion"===this.options.solver?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new Td(this.body,this.physicsBody,e),this.edgesSolver=new Ed(this.body,this.physicsBody,e),this.gravitySolver=new Md(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new Od(this.body,this.physicsBody,e),this.edgesSolver=new Cd(this.body,this.physicsBody,e),this.gravitySolver=new Md(this.body,this.physicsBody,e)),this.modelOptions=e}},{key:"initPhysics",value:function(){!0===this.physicsEnabled&&!0===this.options.enabled?!0===this.options.stabilization.enabled?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}},{key:"startSimulation",value:function(){!0===this.physicsEnabled&&!0===this.options.enabled?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),void 0===this.viewFunction&&(this.viewFunction=this.simulationStep.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];this.stabilized=!0,!0===e&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,!0===e&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var e=Date.now();this.physicsTick();var t=Date.now()-e;(t<.4*this.simulationInterval||!0===this.runDoubleSpeed)&&!1===this.stabilized&&(this.physicsTick(),this.runDoubleSpeed=!0),!0===this.stabilized&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(1<this.stabilizationIterations||!0===this.startedStabilization)&&setTimeout(function(){e.body.emitter.emit("stabilized",{iterations:t}),e.startedStabilization=!1,e.stabilizationIterations=0},0)}},{key:"physicsStep",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}},{key:"adjustTimeStep",value:function(){var e=1.2;!0===this._evaluateStepQuality()?this.timestep=e*this.timestep:this.timestep/e<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=yo(this.options.timestep,this.timestep/e))}},{key:"physicsTick",value:function(){if(this._startStabilizing(),!0!==this.stabilized){if(!0===this.adaptiveTimestep&&!0===this.adaptiveTimestepEnabled){var e=0==this.adaptiveCounter%this.adaptiveInterval;e?(this.timestep=2*this.timestep,this.physicsStep(),this.revert(),this.timestep=.5*this.timestep,this.physicsStep(),this.physicsStep(),this.adjustTimeStep()):this.physicsStep(),this.adaptiveCounter+=1}else this.timestep=this.options.timestep,this.physicsStep();!0===this.stabilized&&this.revert(),this.stabilizationIterations++}}},{key:"updatePhysicsData",value:function(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];var e=this.body.nodes,t=this.body.edges;for(var o in e)e.hasOwnProperty(o)&&!0===e[o].options.physics&&this.physicsBody.physicsNodeIndices.push(e[o].id);for(var n in t)t.hasOwnProperty(n)&&!0===t[n].options.physics&&this.physicsBody.physicsEdgeIndices.push(t[n].id);for(var a=0,d;a<this.physicsBody.physicsNodeIndices.length;a++)d=this.physicsBody.physicsNodeIndices[a],this.physicsBody.forces[d]={x:0,y:0},void 0===this.physicsBody.velocities[d]&&(this.physicsBody.velocities[d]={x:0,y:0});for(var s in this.physicsBody.velocities)void 0===e[s]&&delete this.physicsBody.velocities[s]}},{key:"revert",value:function(){var e=Object.keys(this.previousStates),t=this.body.nodes,o=this.physicsBody.velocities;this.referenceState={};for(var n=0,a;n<e.length;n++)a=e[n],void 0===t[a]?delete this.previousStates[a]:!0===t[a].options.physics&&(this.referenceState[a]={positions:{x:t[a].x,y:t[a].y}},o[a].x=this.previousStates[a].vx,o[a].y=this.previousStates[a].vy,t[a].x=this.previousStates[a].x,t[a].y=this.previousStates[a].y)}},{key:"_evaluateStepQuality",value:function(){var e=this.body.nodes,t=this.referenceState,o,n,i;for(var a in this.referenceState)if(this.referenceState.hasOwnProperty(a)&&void 0!==e[a]&&(o=e[a].x-t[a].positions.x,n=e[a].y-t[a].positions.y,i=mo(lo(o,2)+lo(n,2)),i>.3))return!1;return!0}},{key:"moveNodes",value:function(){for(var e=this.physicsBody.physicsNodeIndices,t=0,o=0,n=5,a=0;a<e.length;a++){var d=e[a],s=this._performStep(d);t=yo(t,s),o+=s}this.adaptiveTimestepEnabled=o/e.length<n,this.stabilized=t<this.options.minVelocity}},{key:"calculateComponentVelocity",value:function(e,t,o){var n=this.modelOptions.damping*e;e+=(t-n)/o*this.timestep;var i=this.options.maxVelocity||1e9;return uo(e)>i&&(e=0<e?i:-i),e}},{key:"_performStep",value:function(e){var t=this.body.nodes[e],o=this.physicsBody.forces[e],n=this.physicsBody.velocities[e];this.previousStates[e]={x:t.x,y:t.y,vx:n.x,vy:n.y},!1===t.options.fixed.x?(n.x=this.calculateComponentVelocity(n.x,o.x,t.options.mass),t.x+=n.x*this.timestep):(o.x=0,n.x=0),!1===t.options.fixed.y?(n.y=this.calculateComponentVelocity(n.y,o.y,t.options.mass),t.y+=n.y*this.timestep):(o.y=0,n.y=0);var i=mo(lo(n.x,2)+lo(n.y,2));return i}},{key:"_freezeNodes",value:function(){var e=this.body.nodes;for(var t in e)if(e.hasOwnProperty(t)&&e[t].x&&e[t].y){var o=e[t].options.fixed;this.freezeCache[t]={x:o.x,y:o.y},o.x=!0,o.y=!0}}},{key:"_restoreFrozenNodes",value:function(){var e=this.body.nodes;for(var t in e)e.hasOwnProperty(t)&&void 0!==this.freezeCache[t]&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}},{key:"stabilize",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;return"number"!=typeof t&&(t=this.options.stabilization.iterations,console.log("The stabilize method needs a numeric amount of iterations. Switching to default: ",t)),0===this.physicsBody.physicsNodeIndices.length?void(this.ready=!0):void(this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=t,!0===this.options.stabilization.onlyDynamicEdges&&this._freezeNodes(),this.stabilizationIterations=0,setTimeout(function(){return e._stabilizationBatch()},0))}},{key:"_startStabilizing",value:function(){return!0!==this.startedStabilization&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}},{key:"_stabilizationBatch",value:function(){var e=this,t=function(){return!1===e.stabilized&&e.stabilizationIterations<e.targetIterations},o=function(){e.body.emitter.emit("stabilizationProgress",{iterations:e.stabilizationIterations,total:e.targetIterations})};this._startStabilizing()&&o();for(var n=0;t()&&n<this.options.stabilization.updateInterval;)this.physicsTick(),n++;o(),t()?setTimeout(this._stabilizationBatch.bind(this),0):this._finalizeStabilization()}},{key:"_finalizeStabilization",value:function(){this.body.emitter.emit("_allowRedraw"),!0===this.options.stabilization.fit&&this.body.emitter.emit("fit"),!0===this.options.stabilization.onlyDynamicEdges&&this._restoreFrozenNodes(),this.body.emitter.emit("stabilizationIterationsDone"),this.body.emitter.emit("_requestRedraw"),!0===this.stabilized?this._emitStabilized():this.startSimulation(),this.ready=!0}},{key:"_drawForces",value:function(e){for(var t=0;t<this.physicsBody.physicsNodeIndices.length;t++){var o=this.physicsBody.physicsNodeIndices[t],n=this.body.nodes[o],a=this.physicsBody.forces[o],d=20,s=mo(lo(a.x,2)+lo(a.x,2)),r=fo(yo(5,s),15),l=Wo.HSVToHex((180-180*fo(1,yo(0,.03*s)))/360,1,1),c={x:n.x+d*a.x,y:n.y+d*a.y};e.lineWidth=r,e.strokeStyle=l,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(c.x,c.y),e.stroke();var u=ho(a.y,a.x);e.fillStyle=l,gd.draw(e,{type:"arrow",point:c,angle:u,length:3*r}),e.fill()}}}]),e}(),Yd=function(){function e(){pa(this,e)}return ha(e,null,[{key:"getRange",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],o=1e9,n=-1e9,a=1e9,d=-1e9,s;if(0<t.length)for(var r=0;r<t.length;r++)s=e[t[r]],a>s.shape.boundingBox.left&&(a=s.shape.boundingBox.left),d<s.shape.boundingBox.right&&(d=s.shape.boundingBox.right),o>s.shape.boundingBox.top&&(o=s.shape.boundingBox.top),n<s.shape.boundingBox.bottom&&(n=s.shape.boundingBox.bottom);return 1e9===a&&-1e9===d&&1e9===o&&-1e9===n&&(o=0,n=0,a=0,d=0),{minX:a,maxX:d,minY:o,maxY:n}}},{key:"getRangeCore",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],o=1e9,n=-1e9,a=1e9,d=-1e9,s;if(0<t.length)for(var r=0;r<t.length;r++)s=e[t[r]],a>s.x&&(a=s.x),d<s.x&&(d=s.x),o>s.y&&(o=s.y),n<s.y&&(n=s.y);return 1e9===a&&-1e9===d&&1e9===o&&-1e9===n&&(o=0,n=0,a=0,d=0),{minX:a,maxX:d,minY:o,maxY:n}}},{key:"findCenter",value:function(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}},{key:"cloneOptions",value:function(e,t){var o={};return void 0===t||"node"===t?(Wo.deepExtend(o,e.options,!0),o.x=e.x,o.y=e.y,o.amountOfConnections=e.edges.length):Wo.deepExtend(o,e.options,!0),o}}]),e}(),zd=function(e){function t(e,o,n,i,a,d){var s;return pa(this,t),s=Ma(this,Ia(t).call(this,e,o,n,i,a,d)),s.isCluster=!0,s.containedNodes={},s.containedEdges={},s}return Fa(t,e),ha(t,[{key:"_openChildCluster",value:function(e){var t=this,o=this.body.nodes[e];if(void 0===this.containedNodes[e])throw new Error("node with id: "+e+" not in current cluster");if(!o.isCluster)throw new Error("node with id: "+e+" is not a cluster");delete this.containedNodes[e],Wo.forEach(o.edges,function(e){delete t.containedEdges[e.id]}),Wo.forEach(o.containedNodes,function(e,o){t.containedNodes[o]=e}),o.containedNodes={},Wo.forEach(o.containedEdges,function(e,o){t.containedEdges[o]=e}),o.containedEdges={},Wo.forEach(o.edges,function(e){Wo.forEach(t.edges,function(o){var n=o.clusteringEdgeReplacingIds.indexOf(e.id);-1===n||(Wo.forEach(e.clusteringEdgeReplacingIds,function(e){o.clusteringEdgeReplacingIds.push(e),t.body.edges[e].edgeReplacedById=o.id}),o.clusteringEdgeReplacingIds.splice(n,1))})}),o.edges=[]}}]),t}(td),Nd=function(){function e(t){var o=this;pa(this,e),this.body=t,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},Wo.extend(this.options,this.defaultOptions),this.body.emitter.on("_resetData",function(){o.clusteredNodes={},o.clusteredEdges={}})}return ha(e,[{key:"clusterByHubsize",value:function(e,t){void 0===e?e=this._getHubSize():"object"===ka(e)&&(t=this._checkOptions(e),e=this._getHubSize());for(var o=[],n=0,a;n<this.body.nodeIndices.length;n++)a=this.body.nodes[this.body.nodeIndices[n]],a.edges.length>=e&&o.push(a.id);for(var d=0;d<o.length;d++)this.clusterByConnection(o[d],t,!0);this.body.emitter.emit("_dataChanged")}},{key:"cluster",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},o=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];if(void 0===t.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");t=this._checkOptions(t);var n={},i={};Wo.forEach(this.body.nodes,function(o,a){o.options&&!0===t.joinCondition(o.options)&&(n[a]=o,Wo.forEach(o.edges,function(t){void 0===e.clusteredEdges[t.id]&&(i[t.id]=t)}))}),this._cluster(n,i,t,o)}},{key:"clusterByEdgeCount",value:function(e,t){var o=this,n=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];t=this._checkOptions(t);for(var a=[],d={},s=function(n){var i={},s={},r=o.body.nodeIndices[n],y=o.body.nodes[r];if(void 0===d[r]){u=0,c=[];for(var f=0;f<y.edges.length;f++)l=y.edges[f],void 0===o.clusteredEdges[l.id]&&(l.toId!==l.fromId&&u++,c.push(l));if(u===e){p=function(e){if(void 0===t.joinCondition||null===t.joinCondition)return!0;var o=Yd.cloneOptions(e);return t.joinCondition(o)};for(var b=!0,_=0;_<c.length;_++){l=c[_];var v=o._getConnectedId(l,r);if(p(y))s[l.id]=l,i[r]=y,i[v]=o.body.nodes[v],d[r]=!0;else{b=!1;break}}if(0<Object.keys(i).length&&0<Object.keys(s).length&&!0===b)if(h=function(){for(var e=0;e<a.length;++e)for(var t in i)if(void 0!==a[e].nodes[t])return a[e]},g=h(),void 0!==g){for(var k in i)void 0===g.nodes[k]&&(g.nodes[k]=i[k]);for(var m in s)void 0===g.edges[m]&&(g.edges[m]=s[m])}else a.push({nodes:i,edges:s})}}},r=0,l,c,u;r<this.body.nodeIndices.length;r++){var p,h,g;s(r)}for(var r=0;r<a.length;r++)this._cluster(a[r].nodes,a[r].edges,t,!1);!0===n&&this.body.emitter.emit("_dataChanged")}},{key:"clusterOutliers",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,e,t)}},{key:"clusterBridges",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,e,t)}},{key:"clusterByConnection",value:function(e,t){var o=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];if(void 0===e)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[e])throw new Error("The nodeId given to clusterByConnection does not exist!");var n=this.body.nodes[e];t=this._checkOptions(t,n),void 0===t.clusterNodeProperties.x&&(t.clusterNodeProperties.x=n.x),void 0===t.clusterNodeProperties.y&&(t.clusterNodeProperties.y=n.y),void 0===t.clusterNodeProperties.fixed&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=n.options.fixed.x,t.clusterNodeProperties.fixed.y=n.options.fixed.y);var a={},d={},s=n.id,r=Yd.cloneOptions(n);a[s]=n;for(var l=0,c;l<n.edges.length;l++)if(c=n.edges[l],void 0===this.clusteredEdges[c.id]){var u=this._getConnectedId(c,s);if(void 0===this.clusteredNodes[u])if(u===s)d[c.id]=c;else if(void 0===t.joinCondition)d[c.id]=c,a[u]=this.body.nodes[u];else{var p=Yd.cloneOptions(this.body.nodes[u]);!0===t.joinCondition(r,p)&&(d[c.id]=c,a[u]=this.body.nodes[u])}}var h=Object.keys(a).map(function(e){return a[e].id});for(m in a)if(a.hasOwnProperty(m))for(var m=a[m],g=0,f;g<m.edges.length;g++)f=m.edges[g],-1<h.indexOf(this._getConnectedId(f,m.id))&&(d[f.id]=f);this._cluster(a,d,t,o)}},{key:"_createClusterEdges",value:function(e,t,o,n){for(var a=Object.keys(e),d=[],s=0,r,l,c,u,p,h;s<a.length;s++){l=a[s],c=e[l];for(var m=0;m<c.edges.length;m++)r=c.edges[m],void 0===this.clusteredEdges[r.id]&&(r.toId==r.fromId?t[r.id]=r:r.toId==l?(u=o.id,p=r.fromId,h=p):(u=r.toId,p=o.id,h=u),void 0===e[h]&&d.push({edge:r,fromId:p,toId:u}))}for(var g=[],y=function(e){for(var t=0;t<g.length;t++){var o=g[t],n=e.fromId===o.fromId&&e.toId===o.toId,i=e.fromId===o.toId&&e.toId===o.fromId;if(n||i)return o}return null},f=0;f<d.length;f++){var b=d[f],_=b.edge,v=y(b);null===v?(v=this._createClusteredEdge(b.fromId,b.toId,_,n),g.push(v)):v.clusteringEdgeReplacingIds.push(_.id),this.body.edges[_.id].edgeReplacedById=v.id,this._backupEdgeOptions(_),_.setOptions({physics:!1})}}},{key:"_checkOptions",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return void 0===e.clusterEdgeProperties&&(e.clusterEdgeProperties={}),void 0===e.clusterNodeProperties&&(e.clusterNodeProperties={}),e}},{key:"_cluster",value:function(e,t,o){var i=!(3<arguments.length&&void 0!==arguments[3])||arguments[3],a=[];for(var d in e)e.hasOwnProperty(d)&&void 0!==this.clusteredNodes[d]&&a.push(d);for(var s=0;s<a.length;++s)delete e[a[s]];if(0!=Object.keys(e).length&&(1!=Object.keys(e).length||!0==o.clusterNodeProperties.allowSingleNodeCluster)){var r=Wo.deepExtend({},o.clusterNodeProperties);if(void 0!==o.processProperties){var l=[];for(var c in e)if(e.hasOwnProperty(c)){var u=Yd.cloneOptions(e[c]);l.push(u)}var p=[];for(var h in t)if(t.hasOwnProperty(h)&&"clusterEdge:"!==h.substr(0,12)){var m=Yd.cloneOptions(t[h],"edge");p.push(m)}if(r=o.processProperties(r,l,p),!r)throw new Error("The processProperties function does not return properties!")}void 0===r.id&&(r.id="cluster:"+Wo.randomUUID());var g=r.id;void 0===r.label&&(r.label="cluster");var y;void 0===r.x&&(y=this._getClusterPosition(e),r.x=y.x),void 0===r.y&&(void 0===y&&(y=this._getClusterPosition(e)),r.y=y.y),r.id=g;var f=this.body.functions.createNode(r,zd);f.containedNodes=e,f.containedEdges=t,f.clusterEdgeProperties=o.clusterEdgeProperties,this.body.nodes[r.id]=f,this._clusterEdges(e,t,r,o.clusterEdgeProperties),r.id=void 0,!0===i&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(e){void 0===this.clusteredEdges[e.id]&&(this.clusteredEdges[e.id]={physics:e.options.physics})}},{key:"_restoreEdge",value:function(e){var t=this.clusteredEdges[e.id];void 0!==t&&(e.setOptions({physics:t.physics}),delete this.clusteredEdges[e.id])}},{key:"isCluster",value:function(e){return void 0===this.body.nodes[e]?(console.log("Node does not exist."),!1):!0===this.body.nodes[e].isCluster}},{key:"_getClusterPosition",value:function(e){for(var t=Object.keys(e),o=e[t[0]].x,n=e[t[0]].x,a=e[t[0]].y,d=e[t[0]].y,s=1,r;s<t.length;s++)r=e[t[s]],o=r.x<o?r.x:o,n=r.x>n?r.x:n,a=r.y<a?r.y:a,d=r.y>d?r.y:d;return{x:.5*(o+n),y:.5*(a+d)}}},{key:"openCluster",value:function(e,t){var o=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];if(void 0===e)throw new Error("No clusterNodeId supplied to openCluster.");var n=this.body.nodes[e];if(void 0===n)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(!0!==n.isCluster||void 0===n.containedNodes||void 0===n.containedEdges)throw new Error("The node:"+e+" is not a valid cluster.");var a=this.findNode(e),d=a.indexOf(e)-1;if(0<=d){var s=a[d],r=this.body.nodes[s];return r._openChildCluster(e),delete this.body.nodes[e],void(!0===o&&this.body.emitter.emit("_dataChanged"))}var l=n.containedNodes,c=n.containedEdges;if(void 0!==t&&void 0!==t.releaseFunction&&"function"==typeof t.releaseFunction){var u={},p={x:n.x,y:n.y};for(var h in l)if(l.hasOwnProperty(h)){var m=this.body.nodes[h];u[h]={x:m.x,y:m.y}}var g=t.releaseFunction(p,u);for(var y in l)if(l.hasOwnProperty(y)){var f=this.body.nodes[y];void 0!==g[y]&&(f.x=void 0===g[y].x?n.x:g[y].x,f.y=void 0===g[y].y?n.y:g[y].y)}}else Wo.forEach(l,function(e){!1===e.options.fixed.x&&(e.x=n.x),!1===e.options.fixed.y&&(e.y=n.y)});for(var b in l)if(l.hasOwnProperty(b)){var _=this.body.nodes[b];_.vx=n.vx,_.vy=n.vy,_.setOptions({physics:!0}),delete this.clusteredNodes[b]}for(var v=[],k=0;k<n.edges.length;k++)v.push(n.edges[k]);for(var w=0;w<v.length;w++){for(var x=v[w],S=this._getConnectedId(x,e),O=this.clusteredNodes[S],D=0;D<x.clusteringEdgeReplacingIds.length;D++){var T=x.clusteringEdgeReplacingIds[D],C=this.body.edges[T];if(void 0!==C)if(void 0!==O){var E=this.body.nodes[O.clusterId];E.containedEdges[C.id]=C,delete c[C.id];var M=C.fromId,I=C.toId;C.toId==S?I=O.clusterId:M=O.clusterId,this._createClusteredEdge(M,I,C,E.clusterEdgeProperties,{hidden:!1,physics:!0})}else this._restoreEdge(C)}x.remove()}for(var P in c)c.hasOwnProperty(P)&&this._restoreEdge(c[P]);delete this.body.nodes[e],!0===o&&this.body.emitter.emit("_dataChanged")}},{key:"getNodesInCluster",value:function(e){var t=[];if(!0===this.isCluster(e)){var o=this.body.nodes[e].containedNodes;for(var n in o)o.hasOwnProperty(n)&&t.push(this.body.nodes[n].id)}return t}},{key:"findNode",value:function(e){for(var t=[],o=0,n;void 0!==this.clusteredNodes[e]&&o<100;){if(n=this.body.nodes[e],void 0===n)return[];t.push(n.id),e=this.clusteredNodes[e].clusterId,o++}return(n=this.body.nodes[e],void 0===n)?[]:(t.push(n.id),t.reverse(),t)}},{key:"updateClusteredNode",value:function(e,t){if(void 0===e)throw new Error("No clusteredNodeId supplied to updateClusteredNode.");if(void 0===t)throw new Error("No newOptions supplied to updateClusteredNode.");if(void 0===this.body.nodes[e])throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");this.body.nodes[e].setOptions(t),this.body.emitter.emit("_dataChanged")}},{key:"updateEdge",value:function(e,t){if(void 0===e)throw new Error("No startEdgeId supplied to updateEdge.");if(void 0===t)throw new Error("No newOptions supplied to updateEdge.");if(void 0===this.body.edges[e])throw new Error("The startEdgeId supplied to updateEdge does not exist.");for(var o=this.getClusteredEdges(e),n=0,a;n<o.length;n++)a=this.body.edges[o[n]],a.setOptions(t);this.body.emitter.emit("_dataChanged")}},{key:"getClusteredEdges",value:function(e){for(var t=[],o=0;void 0!==e&&void 0!==this.body.edges[e]&&o<100;)t.push(this.body.edges[e].id),e=this.body.edges[e].edgeReplacedById,o++;return t.reverse(),t}},{key:"getBaseEdge",value:function(e){return this.getBaseEdges(e)[0]}},{key:"getBaseEdges",value:function(e){for(var t=[e],o=[],n=[],a=0,d;0<t.length&&a<100;)if(d=t.pop(),void 0!==d){var s=this.body.edges[d];if(void 0!==s){a++;var r=s.clusteringEdgeReplacingIds;if(void 0===r)n.push(d);else for(var l=0,c;l<r.length;++l)(c=r[l],-1===t.indexOf(r)&&-1===o.indexOf(r))&&t.push(c);o.push(d)}}return n}},{key:"_getConnectedId",value:function(e,t){return e.toId==t?e.fromId==t?e.fromId:e.fromId:e.toId}},{key:"_getHubSize",value:function(){for(var e=0,t=0,o=0,n=0,a=0,d;a<this.body.nodeIndices.length;a++)d=this.body.nodes[this.body.nodeIndices[a]],d.edges.length>n&&(n=d.edges.length),e+=d.edges.length,t+=lo(d.edges.length,2),o+=1;e/=o,t/=o;var s=t-lo(e,2),r=mo(s),l=go(e+2*r);return l>n&&(l=n),l}},{key:"_createClusteredEdge",value:function(e,t,o,n,i){var a=Yd.cloneOptions(o,"edge");Wo.deepExtend(a,n),a.from=e,a.to=t,a.id="clusterEdge:"+Wo.randomUUID(),void 0!==i&&Wo.deepExtend(a,i);var d=this.body.functions.createEdge(a);return d.clusteringEdgeReplacingIds=[o.id],d.connect(),this.body.edges[d.id]=d,d}},{key:"_clusterEdges",value:function(e,t,o,n){if(t instanceof xd){var i=t,a={};a[i.id]=i,t=a}if(e instanceof td){var d=e,s={};s[d.id]=d,e=s}if(void 0===o||null===o)throw new Error("_clusterEdges: parameter clusterNode required");for(var r in void 0===n&&(n=o.clusterEdgeProperties),this._createClusterEdges(e,t,o,n),t)if(t.hasOwnProperty(r)&&void 0!==this.body.edges[r]){var l=this.body.edges[r];this._backupEdgeOptions(l),l.setOptions({physics:!1})}for(var c in e)e.hasOwnProperty(c)&&(this.clusteredNodes[c]={clusterId:o.id,node:this.body.nodes[c]},this.body.nodes[c].setOptions({physics:!1}))}},{key:"_getClusterNodeForNode",value:function(e){if(void 0!==e){var t=this.clusteredNodes[e];if(void 0!==t){var o=t.clusterId;return void 0===o?void 0:this.body.nodes[o]}}}},{key:"_filter",value:function(e,t){var o=[];return Wo.forEach(e,function(e){t(e)&&o.push(e)}),o}},{key:"_updateState",value:function(){var e=this,t=[],o={},i=function(t){Wo.forEach(e.body.nodes,function(e){!0===e.isCluster&&t(e)})},a;for(a in this.clusteredNodes)if(this.clusteredNodes.hasOwnProperty(a)){var d=this.body.nodes[a];void 0===d&&t.push(a)}i(function(e){for(var o=0;o<t.length;o++)delete e.containedNodes[t[o]]});for(var s=0;s<t.length;s++)delete this.clusteredNodes[t[s]];Wo.forEach(this.clusteredEdges,function(t){var n=e.body.edges[t];void 0!==n&&n.endPointsValid()||(o[t]=t)}),i(function(e){Wo.forEach(e.containedEdges,function(e,t){e.endPointsValid()||o[t]||(o[t]=t)})}),Wo.forEach(this.body.edges,function(t,n){var i=!0,a=t.clusteringEdgeReplacingIds;if(void 0!==a){var d=0;Wo.forEach(a,function(t){var o=e.body.edges[t];void 0!==o&&o.endPointsValid()&&(d+=1)}),i=0<d}t.endPointsValid()&&i||(o[n]=n)}),i(function(t){Wo.forEach(o,function(n){delete t.containedEdges[n],Wo.forEach(t.edges,function(i,a){return i.id===n?void(t.edges[a]=null):void(i.clusteringEdgeReplacingIds=e._filter(i.clusteringEdgeReplacingIds,function(e){return!o[e]}))}),t.edges=e._filter(t.edges,function(e){return null!==e})})}),Wo.forEach(o,function(t){delete e.clusteredEdges[t]}),Wo.forEach(o,function(t){delete e.body.edges[t]});var r=Object.keys(this.body.edges);Wo.forEach(r,function(t){var o=e.body.edges[t],n=e._isClusteredNode(o.fromId)||e._isClusteredNode(o.toId);if(n!==e._isClusteredEdge(o.id))if(n){var i=e._getClusterNodeForNode(o.fromId);void 0!==i&&e._clusterEdges(e.body.nodes[o.fromId],o,i);var a=e._getClusterNodeForNode(o.toId);void 0!==a&&e._clusterEdges(e.body.nodes[o.toId],o,a)}else delete e._clusterEdges[t],e._restoreEdge(o)});for(var l=!1,c=!0,u=function(){var t=[];i(function(e){var o=Object.keys(e.containedNodes).length,n=!0===e.options.allowSingleNodeCluster;(n&&1>o||!n&&2>o)&&t.push(e.id)});for(var o=0;o<t.length;++o)e.openCluster(t[o],{},!1);c=0<t.length,l=l||c};c;)u();l&&this._updateState()}},{key:"_isClusteredNode",value:function(e){return void 0!==this.clusteredNodes[e]}},{key:"_isClusteredEdge",value:function(e){return void 0!==this.clusteredEdges[e]}}]),e}(),Rd=function(){function e(t,o){pa(this,e),no(),this.body=t,this.canvas=o,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},Wo.extend(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return ha(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("dragStart",function(){e.dragging=!0}),this.body.emitter.on("dragEnd",function(){e.dragging=!1}),this.body.emitter.on("zoom",function(){e.zooming=!0,window.clearTimeout(e.zoomTimeoutId),e.zoomTimeoutId=window.setTimeout(function(){e.zooming=!1,e._requestRedraw.bind(e)()},250)}),this.body.emitter.on("_resizeNodes",function(){e._resizeNodes()}),this.body.emitter.on("_redraw",function(){!1===e.renderingActive&&e._redraw()}),this.body.emitter.on("_blockRedraw",function(){e.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",function(){e.allowRedraw=!0,e.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",this._requestRedraw.bind(this)),this.body.emitter.on("_startRendering",function(){e.renderRequests+=1,e.renderingActive=!0,e._startRendering()}),this.body.emitter.on("_stopRendering",function(){e.renderRequests-=1,e.renderingActive=0<e.renderRequests,e.renderTimer=void 0}),this.body.emitter.on("destroy",function(){e.renderRequests=0,e.allowRedraw=!1,e.renderingActive=!1,!0===e.requiresTimeout?clearTimeout(e.renderTimer):window.cancelAnimationFrame(e.renderTimer),e.body.emitter.off()})}},{key:"setOptions",value:function(e){if(void 0!==e){Wo.selectiveDeepExtend(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}}},{key:"_requestNextFrame",value:function(e,t){if("undefined"!=typeof window){var o=window,n;return!0===this.requiresTimeout?n=o.setTimeout(e,t):o.requestAnimationFrame&&(n=o.requestAnimationFrame(e)),n}}},{key:"_startRendering",value:function(){!0===this.renderingActive&&void 0===this.renderTimer&&(this.renderTimer=this._requestNextFrame(this._renderStep.bind(this),this.simulationInterval))}},{key:"_renderStep",value:function(){!0===this.renderingActive&&(this.renderTimer=void 0,!0===this.requiresTimeout&&this._startRendering(),this._redraw(),!1===this.requiresTimeout&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var e=this;!0!==this.redrawRequested&&!1===this.renderingActive&&!0===this.allowRedraw&&(this.redrawRequested=!0,this._requestNextFrame(function(){e._redraw(!1)},0))}},{key:"_redraw",value:function(){var e=!!(0<arguments.length&&void 0!==arguments[0])&&arguments[0];if(!0===this.allowRedraw){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1,(0===this.canvas.frame.canvas.width||0===this.canvas.frame.canvas.height)&&this.canvas.setSize(),this.canvas.setTransform();var t=this.canvas.getContext(),o=this.canvas.frame.canvas.clientWidth,n=this.canvas.frame.canvas.clientHeight;if(t.clearRect(0,0,o,n),0===this.canvas.frame.clientWidth)return;t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale),t.beginPath(),this.body.emitter.emit("beforeDrawing",t),t.closePath(),!1===e&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&(!1===this.zooming||!0===this.zooming&&!1===this.options.hideEdgesOnZoom)&&this._drawEdges(t),(!1===this.dragging||!0===this.dragging&&!1===this.options.hideNodesOnDrag)&&this._drawNodes(t,e),t.beginPath(),this.body.emitter.emit("afterDrawing",t),t.closePath(),t.restore(),!0===e&&t.clearRect(0,0,o,n)}}},{key:"_resizeNodes",value:function(){this.canvas.setTransform();var e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);var t=this.body.nodes,o;for(var n in t)t.hasOwnProperty(n)&&(o=t[n],o.resize(e),o.updateBoundingBox(e,o.selected));e.restore()}},{key:"_drawNodes",value:function(e){for(var t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],o=this.body.nodes,n=this.body.nodeIndices,a=[],d=20,s=this.canvas.DOMtoCanvas({x:-d,y:-d}),r=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+d,y:this.canvas.frame.canvas.clientHeight+d}),l={top:s.y,left:s.x,bottom:r.y,right:r.x},c=0,u;c<n.length;c++)u=o[n[c]],u.isSelected()?a.push(n[c]):!0===t?u.draw(e):!0===u.isBoundingBoxOverlappingWith(l)?u.draw(e):u.updateBoundingBox(e,u.selected);for(var p=0;p<a.length;p++)u=o[a[p]],u.draw(e)}},{key:"_drawEdges",value:function(e){for(var t=this.body.edges,o=this.body.edgeIndices,n=0,a;n<o.length;n++)a=t[o[n]],!0===a.connected&&a.draw(e)}},{key:"_determineBrowserMethod",value:function(){if("undefined"!=typeof window){var e=navigator.userAgent.toLowerCase();this.requiresTimeout=!1,-1==e.indexOf("msie 9.0")?-1!=e.indexOf("safari")&&-1>=e.indexOf("chrome")&&(this.requiresTimeout=!0):this.requiresTimeout=!0}else this.requiresTimeout=!0}}]),e}(),Bd=ze(function(e,t){t.onTouch=function(e,t){t.inputHandler=function(e){e.isFirst&&t(e)},e.on("hammer.input",t.inputHandler)},t.onRelease=function(e,t){return t.inputHandler=function(e){e.isFinal&&t(e)},e.on("hammer.input",t.inputHandler)},t.offTouch=function(e,t){e.off("hammer.input",t.inputHandler)},t.offRelease=t.offTouch,t.disablePreventDefaultVertically=function(e){return e.getTouchAction=function(){return["pan-y"]},e}}),Hd=Bd.onTouch,Ld=Bd.onRelease,Ad=Bd.offTouch,Wd=Bd.offRelease,jd=Bd.disablePreventDefaultVertically,Ud=function(){function e(t){pa(this,e),this.body=t,this.pixelRatio=1,this.resizeTimer=void 0,this.resizeFunction=this._onResize.bind(this),this.cameraState={},this.initialized=!1,this.canvasViewCenter={},this.options={},this.defaultOptions={autoResize:!0,height:"100%",width:"100%"},Wo.extend(this.options,this.defaultOptions),this.bindEventListeners()}return ha(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.once("resize",function(t){0!==t.width&&(e.body.view.translation.x=.5*t.width),0!==t.height&&(e.body.view.translation.y=.5*t.height)}),this.body.emitter.on("setSize",this.setSize.bind(this)),this.body.emitter.on("destroy",function(){e.hammerFrame.destroy(),e.hammer.destroy(),e._cleanUp()})}},{key:"setOptions",value:function(e){var t=this;if(void 0!==e){Wo.selectiveDeepExtend(["width","height","autoResize"],this.options,e)}!0===this.options.autoResize&&(this._cleanUp(),this.resizeTimer=setInterval(function(){var e=t.setSize();!0===e&&t.body.emitter.emit("_requestRedraw")},1e3),this.resizeFunction=this._onResize.bind(this),Wo.addEventListener(window,"resize",this.resizeFunction))}},{key:"_cleanUp",value:function(){void 0!==this.resizeTimer&&clearInterval(this.resizeTimer),Wo.removeEventListener(window,"resize",this.resizeFunction),this.resizeFunction=void 0}},{key:"_onResize",value:function(){this.setSize(),this.body.emitter.emit("_redraw")}},{key:"_getCameraState",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.pixelRatio;!0===this.initialized&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}},{key:"_setCameraState",value:function(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&0<this.cameraState.previousWidth){var e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,o=this.cameraState.scale;1!=e&&1!=t?o=.5*this.cameraState.scale*(e+t):1==e?1!=t&&(o=this.cameraState.scale*t):o=this.cameraState.scale*e,this.body.view.scale=o;var n=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),i={x:n.x-this.cameraState.position.x,y:n.y-this.cameraState.position.y};this.body.view.translation.x+=i.x*this.body.view.scale,this.body.view.translation.y+=i.y*this.body.view.scale}}},{key:"_prepareValue",value:function(e){if("number"==typeof e)return e+"px";if("string"==typeof e){if(-1!==e.indexOf("%")||-1!==e.indexOf("px"))return e;if(-1===e.indexOf("%"))return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=900,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),!this.frame.canvas.getContext){var e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}else this._setPixelRatio(),this.setTransform();this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bindHammer",value:function(){var e=this;void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new la(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:la.DIRECTION_ALL}),Bd.onTouch(this.hammer,function(t){e.body.eventListeners.onTouch(t)}),this.hammer.on("tap",function(t){e.body.eventListeners.onTap(t)}),this.hammer.on("doubletap",function(t){e.body.eventListeners.onDoubleTap(t)}),this.hammer.on("press",function(t){e.body.eventListeners.onHold(t)}),this.hammer.on("panstart",function(t){e.body.eventListeners.onDragStart(t)}),this.hammer.on("panmove",function(t){e.body.eventListeners.onDrag(t)}),this.hammer.on("panend",function(t){e.body.eventListeners.onDragEnd(t)}),this.hammer.on("pinch",function(t){e.body.eventListeners.onPinch(t)}),this.frame.canvas.addEventListener("mousewheel",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("DOMMouseScroll",function(t){e.body.eventListeners.onMouseWheel(t)}),this.frame.canvas.addEventListener("mousemove",function(t){e.body.eventListeners.onMouseMove(t)}),this.frame.canvas.addEventListener("contextmenu",function(t){e.body.eventListeners.onContext(t)}),this.hammerFrame=new la(this.frame),Bd.onRelease(this.hammerFrame,function(t){e.body.eventListeners.onRelease(t)})}},{key:"setSize",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.options.width,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);var o=!1,n=this.frame.canvas.width,i=this.frame.canvas.height,a=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(a),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=ro(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=ro(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},o=!0;else{var d=ro(this.frame.canvas.clientWidth*this.pixelRatio),s=ro(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==d||this.frame.canvas.height!==s)&&this._getCameraState(a),this.frame.canvas.width!==d&&(this.frame.canvas.width=d,o=!0),this.frame.canvas.height!==s&&(this.frame.canvas.height=s,o=!0)}return!0==o&&(this.body.emitter.emit("resize",{width:ro(this.frame.canvas.width/this.pixelRatio),height:ro(this.frame.canvas.height/this.pixelRatio),oldWidth:ro(n/this.pixelRatio),oldHeight:ro(i/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,o}},{key:"getContext",value:function(){return this.frame.canvas.getContext("2d")}},{key:"_determinePixelRatio",value:function(){var e=this.getContext();if(void 0===e)throw new Error("Could not get canvax context");var t=1;"undefined"!=typeof window&&(t=window.devicePixelRatio||1);var o=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/o}},{key:"_setPixelRatio",value:function(){this.pixelRatio=this._determinePixelRatio()}},{key:"setTransform",value:function(){var e=this.getContext();if(void 0===e)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}},{key:"_XconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.x)/this.body.view.scale}},{key:"_XconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.x}},{key:"_YconvertDOMtoCanvas",value:function(e){return(e-this.body.view.translation.y)/this.body.view.scale}},{key:"_YconvertCanvasToDOM",value:function(e){return e*this.body.view.scale+this.body.view.translation.y}},{key:"canvasToDOM",value:function(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}},{key:"DOMtoCanvas",value:function(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}]),e}(),Vd=function(){function e(t,o){var n=this;pa(this,e),this.body=t,this.canvas=o,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",this.fit.bind(this)),this.body.emitter.on("animationFinished",function(){n.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",this.releaseNode.bind(this))}return ha(e,[{key:"setOptions",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.options=e}},{key:"fit",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{nodes:[]},t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],o,n;if(e=Object.assign({},e),(void 0===e.nodes||0===e.nodes.length)&&(e.nodes=this.body.nodeIndices),!0===t){var i=0;for(var a in this.body.nodes)if(this.body.nodes.hasOwnProperty(a)){var d=this.body.nodes[a];!0===d.predefinedPosition&&(i+=1)}if(i>.5*this.body.nodeIndices.length)return void this.fit(e,!1);o=Yd.getRange(this.body.nodes,e.nodes);var s=this.body.nodeIndices.length;n=12.662/(s+7.4147)+.0964822;var r=fo(this.canvas.frame.canvas.clientWidth/600,this.canvas.frame.canvas.clientHeight/600);n*=r}else{this.body.emitter.emit("_resizeNodes"),o=Yd.getRange(this.body.nodes,e.nodes);var l=1.1*uo(o.maxX-o.minX),c=1.1*uo(o.maxY-o.minY),u=this.canvas.frame.canvas.clientWidth/l,p=this.canvas.frame.canvas.clientHeight/c;n=u<=p?u:p}1<n?n=1:0===n&&(n=1);var h=Yd.findCenter(o),m={position:h,scale:n,animation:e.animation};this.moveTo(m)}},{key:"focus",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.body.nodes[e]){var o={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=o,t.lockedOnNode=e,this.moveTo(t)}else console.log("Node: "+e+" cannot be found.")}},{key:"moveTo",value:function(e){var t=Number.isFinite;if(void 0===e)return void(e={});if(null!=e.offset){if(null==e.offset.x)e.offset.x=0;else if(e.offset.x=+e.offset.x,!t(e.offset.x))throw new TypeError("The option \"offset.x\" has to be a finite number.");if(null==e.offset.y)e.offset.x=0;else if(e.offset.y=+e.offset.y,!t(e.offset.y))throw new TypeError("The option \"offset.y\" has to be a finite number.")}else e.offset={x:0,y:0};if(null!=e.position){if(null==e.position.x)e.position.x=0;else if(e.position.x=+e.position.x,!t(e.position.x))throw new TypeError("The option \"position.x\" has to be a finite number.");if(null==e.position.y)e.position.x=0;else if(e.position.y=+e.position.y,!t(e.position.y))throw new TypeError("The option \"position.y\" has to be a finite number.")}else e.position=this.getViewPosition();if(null==e.scale)e.scale=this.body.view.scale;else if(e.scale=+e.scale,!(0<e.scale))throw new TypeError("The option \"scale\" has to be a number greater than zero.");void 0===e.animation&&(e.animation={duration:0}),!1===e.animation&&(e.animation={duration:0}),!0===e.animation&&(e.animation={}),void 0===e.animation.duration&&(e.animation.duration=1e3),void 0===e.animation.easingFunction&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}},{key:"animateView",value:function(e){if(void 0!==e){this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),!0===e.locked&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;var t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),o={x:t.x-e.position.x,y:t.y-e.position.y};this.targetTranslation={x:this.sourceTranslation.x+o.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+o.y*this.targetScale+e.offset.y},0===e.animation.duration?null==this.lockedOnNodeId?(this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw")):(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)):(this.animationSpeed=1/(.001*(60*e.animation.duration))||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=this._transitionRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))}}},{key:"_lockedRedraw",value:function(){var e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),o={x:t.x-e.x,y:t.y-e.y},n=this.body.view.translation,i={x:n.x+o.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:n.y+o.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=i}},{key:"releaseNode",value:function(){void 0!==this.lockedOnNodeId&&void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}},{key:"_transitionRedraw",value:function(){var e=!!(0<arguments.length&&void 0!==arguments[0])&&arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=!0===e?1:this.easingTime;var t=Wo.easingFunctions[this.animationEasingFunction](this.easingTime);this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},1<=this.easingTime&&(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,null!=this.lockedOnNodeId&&(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("initRedraw",this.viewFunction)),this.body.emitter.emit("animationFinished"))}},{key:"getScale",value:function(){return this.body.view.scale}},{key:"getViewPosition",value:function(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}]),e}(),Gd=function(){function e(t,o){var n=this;pa(this,e),this.body=t,this.canvas=o,this.iconsCreated=!1,this.navigationHammers=[],this.boundFunctions={},this.touchTime=0,this.activated=!1,this.body.emitter.on("activate",function(){n.activated=!0,n.configureKeyboardBindings()}),this.body.emitter.on("deactivate",function(){n.activated=!1,n.configureKeyboardBindings()}),this.body.emitter.on("destroy",function(){void 0!==n.keycharm&&n.keycharm.destroy()}),this.options={}}return ha(e,[{key:"setOptions",value:function(e){void 0!==e&&(this.options=e,this.create())}},{key:"create",value:function(){!0===this.options.navigationButtons?!1===this.iconsCreated&&this.loadNavigationElements():!0===this.iconsCreated&&this.cleanNavigation(),this.configureKeyboardBindings()}},{key:"cleanNavigation",value:function(){if(0!=this.navigationHammers.length){for(var e=0;e<this.navigationHammers.length;e++)this.navigationHammers[e].destroy();this.navigationHammers=[]}this.navigationDOM&&this.navigationDOM.wrapper&&this.navigationDOM.wrapper.parentNode&&this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper),this.iconsCreated=!1}},{key:"loadNavigationElements",value:function(){var e=this;this.cleanNavigation(),this.navigationDOM={};var t=["up","down","left","right","zoomIn","zoomOut","zoomExtends"],o=["_moveUp","_moveDown","_moveLeft","_moveRight","_zoomIn","_zoomOut","_fit"];this.navigationDOM.wrapper=document.createElement("div"),this.navigationDOM.wrapper.className="vis-navigation",this.canvas.frame.appendChild(this.navigationDOM.wrapper);for(var n=0;n<t.length;n++){this.navigationDOM[t[n]]=document.createElement("div"),this.navigationDOM[t[n]].className="vis-button vis-"+t[n],this.navigationDOM.wrapper.appendChild(this.navigationDOM[t[n]]);var a=new la(this.navigationDOM[t[n]]);"_fit"===o[n]?Bd.onTouch(a,this._fit.bind(this)):Bd.onTouch(a,this.bindToRedraw.bind(this,o[n])),this.navigationHammers.push(a)}var d=new la(this.canvas.frame);Bd.onRelease(d,function(){e._stopMovement()}),this.navigationHammers.push(d),this.iconsCreated=!0}},{key:"bindToRedraw",value:function(e){void 0===this.boundFunctions[e]&&(this.boundFunctions[e]=this[e].bind(this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering"))}},{key:"unbindFromRedraw",value:function(e){void 0!==this.boundFunctions[e]&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}},{key:"_fit",value:function(){700<new Date().valueOf()-this.touchTime&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}},{key:"_stopMovement",value:function(){for(var e in this.boundFunctions)this.boundFunctions.hasOwnProperty(e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}},{key:"_moveUp",value:function(){this.body.view.translation.y+=this.options.keyboard.speed.y}},{key:"_moveDown",value:function(){this.body.view.translation.y-=this.options.keyboard.speed.y}},{key:"_moveLeft",value:function(){this.body.view.translation.x+=this.options.keyboard.speed.x}},{key:"_moveRight",value:function(){this.body.view.translation.x-=this.options.keyboard.speed.x}},{key:"_zoomIn",value:function(){var e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),o=this.body.view.translation,n=t/e,i=(1-n)*this.canvas.canvasViewCenter.x+o.x*n,a=(1-n)*this.canvas.canvasViewCenter.y+o.y*n;this.body.view.scale=t,this.body.view.translation={x:i,y:a},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}},{key:"_zoomOut",value:function(){var e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),o=this.body.view.translation,n=t/e,i=(1-n)*this.canvas.canvasViewCenter.x+o.x*n,a=(1-n)*this.canvas.canvasViewCenter.y+o.y*n;this.body.view.scale=t,this.body.view.translation={x:i,y:a},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}},{key:"configureKeyboardBindings",value:function(){var e=this;void 0!==this.keycharm&&this.keycharm.destroy(),!0===this.options.keyboard.enabled&&(this.keycharm=!0===this.options.keyboard.bindToWindow?Un({container:window,preventDefault:!0}):Un({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),!0===this.activated&&(this.keycharm.bind("up",function(){e.bindToRedraw("_moveUp")},"keydown"),this.keycharm.bind("down",function(){e.bindToRedraw("_moveDown")},"keydown"),this.keycharm.bind("left",function(){e.bindToRedraw("_moveLeft")},"keydown"),this.keycharm.bind("right",function(){e.bindToRedraw("_moveRight")},"keydown"),this.keycharm.bind("=",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num+",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("num-",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("-",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("[",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("]",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pageup",function(){e.bindToRedraw("_zoomIn")},"keydown"),this.keycharm.bind("pagedown",function(){e.bindToRedraw("_zoomOut")},"keydown"),this.keycharm.bind("up",function(){e.unbindFromRedraw("_moveUp")},"keyup"),this.keycharm.bind("down",function(){e.unbindFromRedraw("_moveDown")},"keyup"),this.keycharm.bind("left",function(){e.unbindFromRedraw("_moveLeft")},"keyup"),this.keycharm.bind("right",function(){e.unbindFromRedraw("_moveRight")},"keyup"),this.keycharm.bind("=",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num+",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("num-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("-",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("[",function(){e.unbindFromRedraw("_zoomOut")},"keyup"),this.keycharm.bind("]",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pageup",function(){e.unbindFromRedraw("_zoomIn")},"keyup"),this.keycharm.bind("pagedown",function(){e.unbindFromRedraw("_zoomOut")},"keyup")))}}]),e}(),qd=function(){function e(t,o){pa(this,e),this.container=t,this.overflowMethod=o||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}return ha(e,[{key:"setPosition",value:function(e,t){this.x=parseInt(e),this.y=parseInt(t)}},{key:"setText",value:function(e){e instanceof Element?(this.frame.innerHTML="",this.frame.appendChild(e)):this.frame.innerHTML=e}},{key:"show",value:function(e){if(void 0===e&&(e=!0),!0===e){var t=this.frame.clientHeight,o=this.frame.clientWidth,n=this.frame.parentNode.clientHeight,i=this.frame.parentNode.clientWidth,a=0,d=0;if("flip"==this.overflowMethod){var s=!1,r=!0;this.y-t<this.padding&&(r=!1),this.x+o>i-this.padding&&(s=!0),a=s?this.x-o:this.x,d=r?this.y-t:this.y}else d=this.y-t,d+t+this.padding>n&&(d=n-t-this.padding),d<this.padding&&(d=this.padding),a=this.x,a+o+this.padding>i&&(a=i-o-this.padding),a<this.padding&&(a=this.padding);this.frame.style.left=a+"px",this.frame.style.top=d+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}},{key:"hide",value:function(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}},{key:"destroy",value:function(){this.frame.parentNode.removeChild(this.frame)}}]),e}(),Zd=function(){function e(t,o,n){pa(this,e),this.body=t,this.canvas=o,this.selectionHandler=n,this.navigationHandler=new Gd(t,o),this.body.eventListeners.onTap=this.onTap.bind(this),this.body.eventListeners.onTouch=this.onTouch.bind(this),this.body.eventListeners.onDoubleTap=this.onDoubleTap.bind(this),this.body.eventListeners.onHold=this.onHold.bind(this),this.body.eventListeners.onDragStart=this.onDragStart.bind(this),this.body.eventListeners.onDrag=this.onDrag.bind(this),this.body.eventListeners.onDragEnd=this.onDragEnd.bind(this),this.body.eventListeners.onMouseWheel=this.onMouseWheel.bind(this),this.body.eventListeners.onPinch=this.onPinch.bind(this),this.body.eventListeners.onMouseMove=this.onMouseMove.bind(this),this.body.eventListeners.onRelease=this.onRelease.bind(this),this.body.eventListeners.onContext=this.onContext.bind(this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=this.getPointer.bind(this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},Wo.extend(this.options,this.defaultOptions),this.bindEventListeners()}return ha(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("destroy",function(){clearTimeout(e.popupTimer),delete e.body.functions.getPointer})}},{key:"setOptions",value:function(e){if(void 0!==e){Wo.selectiveNotDeepExtend(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),Wo.mergeOptions(this.options,e,"keyboard"),e.tooltip&&(Wo.extend(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=Wo.parseColor(e.tooltip.color)))}this.navigationHandler.setOptions(this.options)}},{key:"getPointer",value:function(e){return{x:e.x-Wo.getAbsoluteLeft(this.canvas.frame.canvas),y:e.y-Wo.getAbsoluteTop(this.canvas.frame.canvas)}}},{key:"onTouch",value:function(e){50<new Date().valueOf()-this.touchTime&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}},{key:"onTap",value:function(e){var t=this.getPointer(e.center),o=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,e,o),this.selectionHandler._generateClickEvent("click",e,t)}},{key:"onDoubleTap",value:function(e){var t=this.getPointer(e.center);this.selectionHandler._generateClickEvent("doubleClick",e,t)}},{key:"onHold",value:function(e){var t=this.getPointer(e.center),o=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,e,o),this.selectionHandler._generateClickEvent("click",e,t),this.selectionHandler._generateClickEvent("hold",e,t)}},{key:"onRelease",value:function(e){if(10<new Date().valueOf()-this.touchTime){var t=this.getPointer(e.center);this.selectionHandler._generateClickEvent("release",e,t),this.touchTime=new Date().valueOf()}}},{key:"onContext",value:function(e){var t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler._generateClickEvent("oncontext",e,t)}},{key:"checkSelectionChanges",value:function(e,t){var o=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],n=this.selectionHandler.getSelection(),i=!1;i=!0===o?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e);var a=this.selectionHandler.getSelection(),d=this._determineDifference(n,a),s=this._determineDifference(a,n);0<d.edges.length&&(this.selectionHandler._generateClickEvent("deselectEdge",t,e,n),i=!0),0<d.nodes.length&&(this.selectionHandler._generateClickEvent("deselectNode",t,e,n),i=!0),0<s.nodes.length&&(this.selectionHandler._generateClickEvent("selectNode",t,e),i=!0),0<s.edges.length&&(this.selectionHandler._generateClickEvent("selectEdge",t,e),i=!0),!0===i&&this.selectionHandler._generateClickEvent("select",t,e)}},{key:"_determineDifference",value:function(e,t){var o=function(e,t){for(var o=[],n=0,a;n<e.length;n++)a=e[n],-1===t.indexOf(a)&&o.push(a);return o};return{nodes:o(e.nodes,t.nodes),edges:o(e.edges,t.edges)}}},{key:"onDragStart",value:function(e){void 0===this.drag.pointer&&this.onTouch(e);var t=this.selectionHandler.getNodeAt(this.drag.pointer);if(this.drag.dragging=!0,this.drag.selection=[],this.drag.translation=Wo.extend({},this.body.view.translation),this.drag.nodeId=void 0,void 0!==t&&!0===this.options.dragNodes){this.drag.nodeId=t.id,!1===t.isSelected()&&(this.selectionHandler.unselectAll(),this.selectionHandler.selectObject(t)),this.selectionHandler._generateClickEvent("dragStart",e,this.drag.pointer);var o=this.selectionHandler.selectionObj.nodes;for(var n in o)if(o.hasOwnProperty(n)){var i=o[n],a={id:i.id,node:i,x:i.x,y:i.y,xFixed:i.options.fixed.x,yFixed:i.options.fixed.y};i.options.fixed.x=!0,i.options.fixed.y=!0,this.drag.selection.push(a)}}else this.selectionHandler._generateClickEvent("dragStart",e,this.drag.pointer,void 0,!0)}},{key:"onDrag",value:function(e){var t=this;if(!0!==this.drag.pinched){this.body.emitter.emit("unlockNode");var o=this.getPointer(e.center),n=this.drag.selection;if(n&&n.length&&!0===this.options.dragNodes){this.selectionHandler._generateClickEvent("dragging",e,o);var i=o.x-this.drag.pointer.x,a=o.y-this.drag.pointer.y;n.forEach(function(e){var o=e.node;!1===e.xFixed&&(o.x=t.canvas._XconvertDOMtoCanvas(t.canvas._XconvertCanvasToDOM(e.x)+i)),!1===e.yFixed&&(o.y=t.canvas._YconvertDOMtoCanvas(t.canvas._YconvertCanvasToDOM(e.y)+a))}),this.body.emitter.emit("startSimulation")}else if(!0===this.options.dragView){if(this.selectionHandler._generateClickEvent("dragging",e,o,void 0,!0),void 0===this.drag.pointer)return void this.onDragStart(e);var d=o.x-this.drag.pointer.x,s=o.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+d,y:this.drag.translation.y+s},this.body.emitter.emit("_requestRedraw")}}}},{key:"onDragEnd",value:function(e){this.drag.dragging=!1;var t=this.drag.selection;t&&t.length?(t.forEach(function(e){e.node.options.fixed.x=e.xFixed,e.node.options.fixed.y=e.yFixed}),this.selectionHandler._generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler._generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}},{key:"onPinch",value:function(e){var t=this.getPointer(e.center);this.drag.pinched=!0,void 0===this.pinch.scale&&(this.pinch.scale=1);var o=this.pinch.scale*e.scale;this.zoom(o,t)}},{key:"zoom",value:function(e,t){if(!0===this.options.zoomView){var o=this.body.view.scale;1e-5>e&&(e=1e-5),10<e&&(e=10);var n;void 0!==this.drag&&!0===this.drag.dragging&&(n=this.canvas.DOMtoCanvas(this.drag.pointer));var i=this.body.view.translation,a=e/o,d=(1-a)*t.x+i.x*a,s=(1-a)*t.y+i.y*a;if(this.body.view.scale=e,this.body.view.translation={x:d,y:s},null!=n){var r=this.canvas.canvasToDOM(n);this.drag.pointer.x=r.x,this.drag.pointer.y=r.y}this.body.emitter.emit("_requestRedraw"),o<e?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:t}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:t})}}},{key:"onMouseWheel",value:function(e){if(!0===this.options.zoomView){var t=0;if(e.wheelDelta?t=e.wheelDelta/120:e.detail&&(t=-e.detail/3),0!=t){var o=this.body.view.scale,n=t*(this.options.zoomSpeed/10);0>t&&(n/=1-n),o*=1+n;var i=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(o,i)}e.preventDefault()}}},{key:"onMouseMove",value:function(e){var t=this,o=this.getPointer({x:e.clientX,y:e.clientY}),n=!1;void 0!==this.popup&&(!1===this.popup.hidden&&this._checkHidePopup(o),!1===this.popup.hidden&&(n=!0,this.popup.setPosition(o.x+3,o.y-5),this.popup.show())),!1===this.options.keyboard.bindToWindow&&!0===this.options.keyboard.enabled&&this.canvas.frame.focus(),!1===n&&(void 0!==this.popupTimer&&(clearInterval(this.popupTimer),this.popupTimer=void 0),!this.drag.dragging&&(this.popupTimer=setTimeout(function(){return t._checkShowPopup(o)},this.options.tooltipDelay))),!0===this.options.hover&&this.selectionHandler.hoverObject(e,o)}},{key:"_checkShowPopup",value:function(e){var t=this.canvas._XconvertDOMtoCanvas(e.x),o=this.canvas._YconvertDOMtoCanvas(e.y),n={left:t,top:o,right:t,bottom:o},a=void 0===this.popupObj?void 0:this.popupObj.id,d=!1,s="node";if(void 0===this.popupObj){for(var r=this.body.nodeIndices,l=this.body.nodes,c=[],u=0,p;u<r.length;u++)p=l[r[u]],!0===p.isOverlappingWith(n)&&(d=!0,void 0!==p.getTitle()&&c.push(r[u]));0<c.length&&(this.popupObj=l[c[c.length-1]],d=!0)}if(void 0===this.popupObj&&!1===d){for(var h=this.body.edgeIndices,m=this.body.edges,g=[],y=0,f;y<h.length;y++)f=m[h[y]],!0===f.isOverlappingWith(n)&&!0===f.connected&&void 0!==f.getTitle()&&g.push(h[y]);0<g.length&&(this.popupObj=m[g[g.length-1]],s="edge")}void 0===this.popupObj?void 0!==this.popup&&(this.popup.hide(),this.body.emitter.emit("hidePopup")):this.popupObj.id!==a&&(void 0===this.popup&&(this.popup=new qd(this.canvas.frame)),this.popup.popupTargetType=s,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id))}},{key:"_checkHidePopup",value:function(e){var t=this.selectionHandler._pointerToPositionObject(e),o=!1;if("node"!==this.popup.popupTargetType)void 0===this.selectionHandler.getNodeAt(e)&&void 0!==this.body.edges[this.popup.popupTargetId]&&(o=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));else if(void 0!==this.body.nodes[this.popup.popupTargetId]&&(o=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),!0===o)){var n=this.selectionHandler.getNodeAt(e);o=void 0!==n&&n.id===this.popup.popupTargetId}!1===o&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}]),e}(),Xd=function(){function e(t,o){var n=this;pa(this,e),this.body=t,this.canvas=o,this.selectionObj={nodes:[],edges:[]},this.hoverObj={nodes:{},edges:{}},this.options={},this.defaultOptions={multiselect:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0},Wo.extend(this.options,this.defaultOptions),this.body.emitter.on("_dataChanged",function(){n.updateSelection()})}return ha(e,[{key:"setOptions",value:function(e){if(void 0!==e){Wo.selectiveDeepExtend(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}}},{key:"selectOnPoint",value:function(e){var t=!1;if(!0===this.options.selectable){var o=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),void 0!==o&&(t=this.selectObject(o)),this.body.emitter.emit("_requestRedraw")}return t}},{key:"selectAdditionalOnPoint",value:function(e){var t=!1;if(!0===this.options.selectable){var o=this.getNodeAt(e)||this.getEdgeAt(e);void 0!==o&&(t=!0,!0===o.isSelected()?this.deselectObject(o):this.selectObject(o),this.body.emitter.emit("_requestRedraw"))}return t}},{key:"_initBaseEvent",value:function(e,t){var o={pointer:{DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},event:e};return o}},{key:"_generateClickEvent",value:function(e,t,o,n){var i=!!(4<arguments.length&&void 0!==arguments[4])&&arguments[4],a=this._initBaseEvent(t,o);if(!0===i)a.nodes=[],a.edges=[];else{var d=this.getSelection();a.nodes=d.nodes,a.edges=d.edges}void 0!==n&&(a.previousSelection=n),"click"==e&&(a.items=this.getClickedItems(o)),void 0!==t.controlEdge&&(a.controlEdge=t.controlEdge),this.body.emitter.emit(e,a)}},{key:"selectObject",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;return void 0!==e&&(e instanceof td&&!0===t&&this._selectConnectedEdges(e),e.select(),this._addToSelection(e),!0)}},{key:"deselectObject",value:function(e){!0===e.isSelected()&&(e.selected=!1,this._removeFromSelection(e))}},{key:"_getAllNodesOverlappingWith",value:function(e){for(var t=[],o=this.body.nodes,n=0,a;n<this.body.nodeIndices.length;n++)a=this.body.nodeIndices[n],o[a].isOverlappingWith(e)&&t.push(a);return t}},{key:"_pointerToPositionObject",value:function(e){var t=this.canvas.DOMtoCanvas(e);return{left:t.x-1,top:t.y+1,right:t.x+1,bottom:t.y-1}}},{key:"getNodeAt",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],o=this._pointerToPositionObject(e),n=this._getAllNodesOverlappingWith(o);return 0<n.length?!0===t?this.body.nodes[n[n.length-1]]:n[n.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(e,t){for(var o=this.body.edges,n=0,a;n<this.body.edgeIndices.length;n++)a=this.body.edgeIndices[n],o[a].isOverlappingWith(e)&&t.push(a)}},{key:"_getAllEdgesOverlappingWith",value:function(e){var t=[];return this._getEdgesOverlappingWith(e,t),t}},{key:"getEdgeAt",value:function(e){for(var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],o=this.canvas.DOMtoCanvas(e),n=10,a=null,d=this.body.edges,s=0;s<this.body.edgeIndices.length;s++){var r=this.body.edgeIndices[s],l=d[r];if(l.connected){var c=l.from.x,u=l.from.y,p=l.to.x,h=l.to.y,m=l.edgeType.getDistanceToEdge(c,u,p,h,o.x,o.y);m<n&&(a=r,n=m)}}return null===a?void 0:!0===t?this.body.edges[a]:a}},{key:"_addToSelection",value:function(e){e instanceof td?this.selectionObj.nodes[e.id]=e:this.selectionObj.edges[e.id]=e}},{key:"_addToHover",value:function(e){e instanceof td?this.hoverObj.nodes[e.id]=e:this.hoverObj.edges[e.id]=e}},{key:"_removeFromSelection",value:function(e){e instanceof td?(delete this.selectionObj.nodes[e.id],this._unselectConnectedEdges(e)):delete this.selectionObj.edges[e.id]}},{key:"unselectAll",value:function(){for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&this.selectionObj.nodes[e].unselect();for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&this.selectionObj.edges[t].unselect();this.selectionObj={nodes:{},edges:{}}}},{key:"_getSelectedNodeCount",value:function(){var e=0;for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(e+=1);return e}},{key:"_getSelectedNode",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e))return this.selectionObj.nodes[e]}},{key:"_getSelectedEdge",value:function(){for(var e in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(e))return this.selectionObj.edges[e]}},{key:"_getSelectedEdgeCount",value:function(){var e=0;for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&(e+=1);return e}},{key:"_getSelectedObjectCount",value:function(){var e=0;for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(e+=1);for(var o in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(o)&&(e+=1);return e}},{key:"_selectionIsEmpty",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e))return!1;for(var t in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(t))return!1;return!0}},{key:"_clusterInSelection",value:function(){for(var e in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(e)&&1<this.selectionObj.nodes[e].clusterSize)return!0;return!1}},{key:"_selectConnectedEdges",value:function(e){for(var t=0,o;t<e.edges.length;t++)o=e.edges[t],o.select(),this._addToSelection(o)}},{key:"_hoverConnectedEdges",value:function(e){for(var t=0,o;t<e.edges.length;t++)o=e.edges[t],o.hover=!0,this._addToHover(o)}},{key:"_unselectConnectedEdges",value:function(e){for(var t=0,o;t<e.edges.length;t++)o=e.edges[t],o.unselect(),this._removeFromSelection(o)}},{key:"emitBlurEvent",value:function(e,t,o){var n=this._initBaseEvent(e,t);!0===o.hover&&(o.hover=!1,o instanceof td?(n.node=o.id,this.body.emitter.emit("blurNode",n)):(n.edge=o.id,this.body.emitter.emit("blurEdge",n)))}},{key:"emitHoverEvent",value:function(e,t,o){var n=this._initBaseEvent(e,t),i=!1;return!1===o.hover&&(o.hover=!0,this._addToHover(o),i=!0,o instanceof td?(n.node=o.id,this.body.emitter.emit("hoverNode",n)):(n.edge=o.id,this.body.emitter.emit("hoverEdge",n))),i}},{key:"hoverObject",value:function(e,t){var o=this.getNodeAt(t);void 0===o&&(o=this.getEdgeAt(t));var n=!1;for(var i in this.hoverObj.nodes)this.hoverObj.nodes.hasOwnProperty(i)&&(void 0===o||o instanceof td&&o.id!=i||o instanceof xd)&&(this.emitBlurEvent(e,t,this.hoverObj.nodes[i]),delete this.hoverObj.nodes[i],n=!0);for(var a in this.hoverObj.edges)this.hoverObj.edges.hasOwnProperty(a)&&(!0===n?(this.hoverObj.edges[a].hover=!1,delete this.hoverObj.edges[a]):(void 0===o||o instanceof xd&&o.id!=a||o instanceof td&&!o.hover)&&(this.emitBlurEvent(e,t,this.hoverObj.edges[a]),delete this.hoverObj.edges[a],n=!0));if(void 0!==o){var d=Object.keys(this.hoverObj.edges).length,s=Object.keys(this.hoverObj.nodes).length,r=o instanceof xd&&0===d&&0===s,l=o instanceof td&&0===d&&0===s;(n||r||l)&&(n=this.emitHoverEvent(e,t,o)),o instanceof td&&!0===this.options.hoverConnectedEdges&&this._hoverConnectedEdges(o)}!0===n&&this.body.emitter.emit("_requestRedraw")}},{key:"getSelection",value:function(){var e=this.getSelectedNodes(),t=this.getSelectedEdges();return{nodes:e,edges:t}}},{key:"getSelectedNodes",value:function(){var e=[];if(!0===this.options.selectable)for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&e.push(this.selectionObj.nodes[t].id);return e}},{key:"getSelectedEdges",value:function(){var e=[];if(!0===this.options.selectable)for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&e.push(this.selectionObj.edges[t].id);return e}},{key:"setSelection",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},o,n;if(!e||!e.nodes&&!e.edges)throw"Selection must be an object with nodes and/or edges properties";if((t.unselectAll||void 0===t.unselectAll)&&this.unselectAll(),e.nodes)for(o=0;o<e.nodes.length;o++){n=e.nodes[o];var a=this.body.nodes[n];if(!a)throw new RangeError("Node with id \""+n+"\" not found");this.selectObject(a,t.highlightEdges)}if(e.edges)for(o=0;o<e.edges.length;o++){n=e.edges[o];var d=this.body.edges[n];if(!d)throw new RangeError("Edge with id \""+n+"\" not found");this.selectObject(d)}this.body.emitter.emit("_requestRedraw")}},{key:"selectNodes",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];if(!e||void 0===e.length)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}},{key:"selectEdges",value:function(e){if(!e||void 0===e.length)throw"Selection must be an array with ids";this.setSelection({edges:e})}},{key:"updateSelection",value:function(){for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&(this.body.nodes.hasOwnProperty(e)||delete this.selectionObj.nodes[e]);for(var t in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(t)&&(this.body.edges.hasOwnProperty(t)||delete this.selectionObj.edges[t])}},{key:"getClickedItems",value:function(e){for(var t=this.canvas.DOMtoCanvas(e),o=[],n=this.body.nodeIndices,a=this.body.nodes,d=n.length-1;0<=d;d--){var s=a[n[d]],r=s.getItemsOnPoint(t);o.push.apply(o,r)}for(var l=this.body.edgeIndices,c=this.body.edges,u=l.length-1;0<=u;u--){var p=c[l[u]],h=p.getItemsOnPoint(t);o.push.apply(o,h)}return o}}]),e}(),Kd=ze(function(e,t){(function(e,o){o(t)})(Dn,function(e){function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return 1e5>e?100>e?10>e?0:1:1e4>e?1e3>e?2:3:4:1e7>e?1e6>e?5:6:1e9>e?1e8>e?7:8:9}function n(e,n){if(e===n)return 0;if(~~e===e&&~~n===n){if(0===e||0===n)return e<n?-1:1;if(0>e||0>n){if(0<=n)return-1;if(0<=e)return 1;e=-e,n=-n}var i=o(e),d=o(n),s=0;return i<d?(e*=p[d-i-1],n/=10,s=-1):i>d&&(n*=p[i-d-1],e/=10,s=1),e===n?s:e<n?-1:1}var r=e+"",l=n+"";return r===l?0:r<l?-1:1}function i(e){for(var t=0;e>=32;)t|=1&e,e>>=1;return e+t}function a(e,t,o,n){var i=t+1;if(i===o)return 1;if(0>n(e[i++],e[t])){for(;i<o&&0>n(e[i],e[i-1]);)i++;d(e,t,i)}else for(;i<o&&0<=n(e[i],e[i-1]);)i++;return i-t}function d(e,o,n){for(n--;o<n;){var i=e[o];e[o++]=e[n],e[n--]=i}}function s(e,t,o,i,a){for(i===t&&i++;i<o;i++){for(var d=e[i],s=t,r=i;s<r;){var l=s+r>>>1;0>a(d,e[l])?r=l:s=l+1}var c=i-s;switch(c){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;0<c;)e[s+c]=e[s+c-1],c--;}e[s]=d}}function r(e,t,o,n,i,a){var d=0,s=0,r=1;if(0<a(e,t[o+i])){for(s=n-i;r<s&&0<a(e,t[o+i+r]);)d=r,r=(r<<1)+1,0>=r&&(r=s);r>s&&(r=s),d+=i,r+=i}else{for(s=i+1;r<s&&0>=a(e,t[o+i-r]);)d=r,r=(r<<1)+1,0>=r&&(r=s);r>s&&(r=s);var l=d;d=i-r,r=i-l}for(d++;d<r;){var c=d+(r-d>>>1);0<a(e,t[o+c])?d=c+1:r=c}return r}function l(e,t,o,n,i,a){var d=0,s=0,r=1;if(0>a(e,t[o+i])){for(s=i+1;r<s&&0>a(e,t[o+i-r]);)d=r,r=(r<<1)+1,0>=r&&(r=s);r>s&&(r=s);var l=d;d=i-r,r=i-l}else{for(s=n-i;r<s&&0<=a(e,t[o+i+r]);)d=r,r=(r<<1)+1,0>=r&&(r=s);r>s&&(r=s),d+=i,r+=i}for(d++;d<r;){var c=d+(r-d>>>1);0>a(e,t[o+c])?r=c:d=c+1}return r}e.__esModule=!0,e.sort=function(e,t,o,d){if(!Array.isArray(e))throw new TypeError("Can only sort arrays");t?"function"!=typeof t&&(d=o,o=t,t=n):t=n,o||(o=0),d||(d=e.length);var r=d-o;if(!(2>r)){var l=0;if(32>r)return l=a(e,o,d,t),void s(e,o,d,o+l,t);var c=new h(e,t),u=i(r);do{if(l=a(e,o,d,t),l<u){var p=r;p>u&&(p=u),s(e,o,o+p,o+l,t),l=p}c.pushRun(o,l),c.mergeRuns(),r-=l,o+=l}while(0!==r);c.forceMergeRuns()}};var c=7,u=256,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9],h=function(){function e(o,n){t(this,e),this.array=null,this.compare=null,this.minGallop=c,this.length=0,this.tmpStorageLength=u,this.stackLength=0,this.runStart=null,this.runLength=null,this.stackSize=0,this.array=o,this.compare=n,this.length=o.length,this.length<2*u&&(this.tmpStorageLength=this.length>>>1),this.tmp=Array(this.tmpStorageLength),this.stackLength=120>this.length?5:1542>this.length?10:119151>this.length?19:40,this.runStart=Array(this.stackLength),this.runLength=Array(this.stackLength)}return e.prototype.pushRun=function(e,t){this.runStart[this.stackSize]=e,this.runLength[this.stackSize]=t,this.stackSize+=1},e.prototype.mergeRuns=function(){for(;1<this.stackSize;){var e=this.stackSize-2;if(1<=e&&this.runLength[e-1]<=this.runLength[e]+this.runLength[e+1]||2<=e&&this.runLength[e-2]<=this.runLength[e]+this.runLength[e-1])this.runLength[e-1]<this.runLength[e+1]&&e--;else if(this.runLength[e]>this.runLength[e+1])break;this.mergeAt(e)}},e.prototype.forceMergeRuns=function(){for(;1<this.stackSize;){var e=this.stackSize-2;0<e&&this.runLength[e-1]<this.runLength[e+1]&&e--,this.mergeAt(e)}},e.prototype.mergeAt=function(e){var t=this.compare,o=this.array,n=this.runStart[e],i=this.runLength[e],a=this.runStart[e+1],d=this.runLength[e+1];this.runLength[e]=i+d,e===this.stackSize-3&&(this.runStart[e+1]=this.runStart[e+2],this.runLength[e+1]=this.runLength[e+2]),this.stackSize--;var s=l(o[a],o,n,i,0,t);(n+=s,i-=s,0!==i)&&(d=r(o[n+i-1],o,a,d,d-1,t),0===d||(i<=d?this.mergeLow(n,i,a,d):this.mergeHigh(n,i,a,d)))},e.prototype.mergeLow=function(e,t,o,n){var a=this.compare,d=this.array,s=this.tmp,u=0;for(u=0;u<t;u++)s[u]=d[e+u];var p=0,h=o,m=e;if(d[m++]=d[h++],0==--n){for(u=0;u<t;u++)d[m+u]=s[p+u];return}if(1===t){for(u=0;u<n;u++)d[m+u]=d[h+u];return void(d[m+n]=s[p])}for(var g=this.minGallop;;){var y=0,f=0,b=!1;do if(0>a(d[h],s[p])){if(d[m++]=d[h++],f++,y=0,0==--n){b=!0;break}}else if(d[m++]=s[p++],y++,f=0,1==--t){b=!0;break}while((y|f)<g);if(b)break;do{if(y=l(d[h],s,p,t,0,a),0!==y){for(u=0;u<y;u++)d[m+u]=s[p+u];if(m+=y,p+=y,t-=y,1>=t){b=!0;break}}if(d[m++]=d[h++],0==--n){b=!0;break}if(f=r(s[p],d,h,n,0,a),0!==f){for(u=0;u<f;u++)d[m+u]=d[h+u];if(m+=f,h+=f,n-=f,0===n){b=!0;break}}if(d[m++]=s[p++],1==--t){b=!0;break}g--}while(y>=c||f>=c);if(b)break;0>g&&(g=0),g+=2}if(this.minGallop=g,1>g&&(this.minGallop=1),1===t){for(u=0;u<n;u++)d[m+u]=d[h+u];d[m+n]=s[p]}else if(0===t)throw new Error("mergeLow preconditions were not respected");else for(u=0;u<t;u++)d[m+u]=s[p+u]},e.prototype.mergeHigh=function(e,t,o,n){var a=this.compare,d=this.array,s=this.tmp,u=0;for(u=0;u<n;u++)s[u]=d[o+u];var p=e+t-1,h=n-1,m=o+n-1,g=0,y=0;if(d[m--]=d[p--],0==--t){for(g=m-(n-1),u=0;u<n;u++)d[g+u]=s[u];return}if(1===n){for(m-=t,p-=t,y=m+1,g=p+1,u=t-1;0<=u;u--)d[y+u]=d[g+u];return void(d[m]=s[h])}for(var f=this.minGallop;;){var b=0,_=0,v=!1;do if(0>a(s[h],d[p])){if(d[m--]=d[p--],b++,_=0,0==--t){v=!0;break}}else if(d[m--]=s[h--],_++,b=0,1==--n){v=!0;break}while((b|_)<f);if(v)break;do{if(b=t-l(s[h],d,e,t,t-1,a),0!=b){for(m-=b,p-=b,t-=b,y=m+1,g=p+1,u=b-1;0<=u;u--)d[y+u]=d[g+u];if(0===t){v=!0;break}}if(d[m--]=s[h--],1==--n){v=!0;break}if(_=n-r(d[p],s,0,n,n-1,a),0!==_){for(m-=_,h-=_,n-=_,y=m+1,g=h+1,u=0;u<_;u++)d[y+u]=s[g+u];if(1>=n){v=!0;break}}if(d[m--]=d[p--],0==--t){v=!0;break}f--}while(b>=c||_>=c);if(v)break;0>f&&(f=0),f+=2}if(this.minGallop=f,1>f&&(this.minGallop=1),1===n){for(m-=t,p-=t,y=m+1,g=p+1,u=t-1;0<=u;u--)d[y+u]=d[g+u];d[m]=s[h]}else if(0===n)throw new Error("mergeHigh preconditions were not respected");else for(g=m-(n-1),u=0;u<n;u++)d[g+u]=s[u]},e}()})}),Qd;(function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e})(Kd);var $d=Kd,Jd=function(){function e(){pa(this,e)}return ha(e,[{key:"abstract",value:function(){throw new Error("Can't instantiate abstract class!")}},{key:"fake_use",value:function(){}},{key:"curveType",value:function(){return this.abstract()}},{key:"getPosition",value:function(e){return this.fake_use(e),this.abstract()}},{key:"setPosition",value:function(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0;this.fake_use(e,t,o),this.abstract()}},{key:"getTreeSize",value:function(e){return this.fake_use(e),this.abstract()}},{key:"sort",value:function(e){this.fake_use(e),this.abstract()}},{key:"fix",value:function(e,t){this.fake_use(e,t),this.abstract()}},{key:"shift",value:function(e,t){this.fake_use(e,t),this.abstract()}}]),e}(),es=function(e){function t(e){var o;return pa(this,t),o=Ma(this,Ia(t).call(this)),o.layout=e,o}return Fa(t,e),ha(t,[{key:"curveType",value:function(){return"horizontal"}},{key:"getPosition",value:function(e){return e.x}},{key:"setPosition",value:function(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==o&&this.layout.hierarchical.addToOrdering(e,o),e.x=t}},{key:"getTreeSize",value:function(e){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_x,max:t.max_x}}},{key:"sort",value:function(e){$d.sort(e,function(e,t){return e.x-t.x})}},{key:"fix",value:function(e,t){e.y=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.y=!0}},{key:"shift",value:function(e,t){this.layout.body.nodes[e].x+=t}}]),t}(Jd),ts=function(e){function t(e){var o;return pa(this,t),o=Ma(this,Ia(t).call(this)),o.layout=e,o}return Fa(t,e),ha(t,[{key:"curveType",value:function(){return"vertical"}},{key:"getPosition",value:function(e){return e.y}},{key:"setPosition",value:function(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==o&&this.layout.hierarchical.addToOrdering(e,o),e.y=t}},{key:"getTreeSize",value:function(e){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_y,max:t.max_y}}},{key:"sort",value:function(e){$d.sort(e,function(e,t){return e.y-t.y})}},{key:"fix",value:function(e,t){e.x=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.x=!0}},{key:"shift",value:function(e,t){this.layout.body.nodes[e].y+=t}}]),t}(Jd),os=function(){function e(){pa(this,e),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return ha(e,[{key:"addRelation",value:function(e,t){void 0===this.childrenReference[e]&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),void 0===this.parentReference[t]&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}},{key:"checkIfTree",value:function(){for(var e in this.parentReference)if(1<this.parentReference[e].length)return void(this.isTree=!1);this.isTree=!0}},{key:"numTrees",value:function(){return this.treeIndex+1}},{key:"setTreeIndex",value:function(e,t){void 0===t||void 0===this.trees[e.id]&&(this.trees[e.id]=t,this.treeIndex=yo(t,this.treeIndex))}},{key:"ensureLevel",value:function(e){void 0===this.levels[e]&&(this.levels[e]=0)}},{key:"getMaxLevel",value:function(e){var t=this,o={},n=function e(n){if(void 0!==o[n])return o[n];var a=t.levels[n];if(t.childrenReference[n]){var d=t.childrenReference[n];if(0<d.length)for(var s=0;s<d.length;s++)a=yo(a,e(d[s]))}return o[n]=a,a};return n(e)}},{key:"levelDownstream",value:function(e,t){void 0===this.levels[t.id]&&(void 0===this.levels[e.id]&&(this.levels[e.id]=0),this.levels[t.id]=this.levels[e.id]+1)}},{key:"setMinLevelToZero",value:function(e){var t=1e9;for(var o in e)e.hasOwnProperty(o)&&void 0!==this.levels[o]&&(t=fo(this.levels[o],t));for(var n in e)e.hasOwnProperty(n)&&void 0!==this.levels[n]&&(this.levels[n]-=t)}},{key:"getTreeSize",value:function(e,t){var o=1e9,n=-1e9,i=1e9,a=-1e9;for(var d in this.trees)if(this.trees.hasOwnProperty(d)&&this.trees[d]===t){var s=e[d];o=fo(s.x,o),n=yo(s.x,n),i=fo(s.y,i),a=yo(s.y,a)}return{min_x:o,max_x:n,min_y:i,max_y:a}}},{key:"hasSameParent",value:function(e,t){var o=this.parentReference[e.id],n=this.parentReference[t.id];if(void 0===o||void 0===n)return!1;for(var a=0;a<o.length;a++)for(var d=0;d<n.length;d++)if(o[a]==n[d])return!0;return!1}},{key:"inSameSubNetwork",value:function(e,t){return this.trees[e.id]===this.trees[t.id]}},{key:"getLevels",value:function(){return Object.keys(this.distributionOrdering)}},{key:"addToOrdering",value:function(e,t){void 0===this.distributionOrdering[t]&&(this.distributionOrdering[t]=[]);var o=!1,i=this.distributionOrdering[t];for(var a in i)if(i[a]===e){o=!0;break}o||(this.distributionOrdering[t].push(e),this.distributionIndex[e.id]=this.distributionOrdering[t].length-1)}}]),e}(),ns=function(){function e(t){pa(this,e),this.body=t,this.initialRandomSeed=ro(1e6*Math.random()),this.randomSeed=this.initialRandomSeed,this.setPhysics=!1,this.options={},this.optionsBackup={physics:{}},this.defaultOptions={randomSeed:void 0,improvedLayout:!0,hierarchical:{enabled:!1,levelSeparation:150,nodeSpacing:100,treeSpacing:200,blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:"UD",sortMethod:"hubsize"}},Wo.extend(this.options,this.defaultOptions),this.bindEventListeners()}return ha(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("_dataChanged",function(){e.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",function(){e.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",function(){e.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",function(){if(!0===e.options.hierarchical.enabled){var t=e.direction.curveType();e.body.emitter.emit("_forceDisableDynamicCurves",t,!1)}})}},{key:"setOptions",value:function(e,t){if(void 0!==e){var o=this.options.hierarchical,n=o.enabled;if(Wo.selectiveDeepExtend(["randomSeed","improvedLayout"],this.options,e),Wo.mergeOptions(this.options,e,"hierarchical"),void 0!==e.randomSeed&&(this.initialRandomSeed=e.randomSeed),!0===o.enabled)return!0===n&&this.body.emitter.emit("refresh",!0),"RL"===o.direction||"DU"===o.direction?0<o.levelSeparation&&(o.levelSeparation*=-1):0>o.levelSeparation&&(o.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(!0===n)return this.body.emitter.emit("refresh"),Wo.deepExtend(t,this.optionsBackup)}return t}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(e){if(!0===this.options.hierarchical.enabled){var t=this.optionsBackup.physics;void 0===e.physics||!0===e.physics?(e.physics={enabled:void 0===t.enabled||t.enabled,solver:"hierarchicalRepulsion"},t.enabled=void 0===t.enabled||t.enabled,t.solver=t.solver||"barnesHut"):"object"===ka(e.physics)?(t.enabled=void 0===e.physics.enabled||e.physics.enabled,t.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):!1!==e.physics&&(t.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});var o=this.direction.curveType();if(void 0===e.edges)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(void 0===e.edges.smooth)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if("boolean"==typeof e.edges.smooth)this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:o};else{var n=e.edges.smooth;void 0!==n.type&&"dynamic"!==n.type&&(o=n.type),this.optionsBackup.edges={smooth:void 0===n.enabled||n.enabled,type:void 0===n.type?"dynamic":n.type,roundness:void 0===n.roundness?.5:n.roundness,forceDirection:void 0!==n.forceDirection&&n.forceDirection},e.edges.smooth={enabled:void 0===n.enabled||n.enabled,type:o,roundness:void 0===n.roundness?.5:n.roundness,forceDirection:void 0!==n.forceDirection&&n.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",o)}return e}},{key:"seededRandom",value:function(){var e=1e4*so(this.randomSeed++);return e-go(e)}},{key:"positionInitially",value:function(e){if(!0!==this.options.hierarchical.enabled){this.randomSeed=this.initialRandomSeed;for(var t=e.length+50,o=0;o<e.length;o++){var n=e[o],a=2*po*this.seededRandom();void 0===n.x&&(n.x=t*ao(a)),void 0===n.y&&(n.y=t*so(a))}}}},{key:"layoutNetwork",value:function(){if(!0!==this.options.hierarchical.enabled&&!0===this.options.improvedLayout){for(var e=this.body.nodeIndices,t=0,o=0,n;o<e.length;o++)n=this.body.nodes[e[o]],!0===n.predefinedPosition&&(t+=1);if(t<.5*e.length){var a=0,d=150,s={clusterNodeProperties:{shape:"ellipse",label:"",group:"",font:{multi:!1}},clusterEdgeProperties:{label:"",font:{multi:!1},smooth:{enabled:!1}}};if(e.length>d){for(var r=e.length;e.length>d&&10>=a;){a+=1;var l=e.length;0==a%3?this.body.modules.clustering.clusterBridges(s):this.body.modules.clustering.clusterOutliers(s);var c=e.length;if(l==c&&0!=a%3)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:yo(150,2*r)})}10<a&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();for(var u=70,p=0,h;p<e.length;p++)h=this.body.nodes[e[p]],!1===h.predefinedPosition&&(h.x+=(.5-this.seededRandom())*u,h.y+=(.5-this.seededRandom())*u);this._declusterAll(),this.body.emitter.emit("_repositionBezierNodes")}}}},{key:"_shiftToCenter",value:function(){for(var e=Yd.getRangeCore(this.body.nodes,this.body.nodeIndices),t=Yd.findCenter(e),o=0,n;o<this.body.nodeIndices.length;o++)n=this.body.nodes[this.body.nodeIndices[o]],n.x-=t.x,n.y-=t.y}},{key:"_declusterAll",value:function(){for(var e=!0;!0===e;){e=!1;for(var t=0;t<this.body.nodeIndices.length;t++)!0===this.body.nodes[this.body.nodeIndices[t]].isCluster&&(e=!0,this.body.modules.clustering.openCluster(this.body.nodeIndices[t],{},!1));!0===e&&this.body.emitter.emit("_dataChanged")}}},{key:"getSeed",value:function(){return this.initialRandomSeed}},{key:"setupHierarchicalLayout",value:function(){if(!0===this.options.hierarchical.enabled&&0<this.body.nodeIndices.length){var e=!1,t=!1,o,n;for(n in this.lastNodeOnLevel={},this.hierarchical=new os,this.body.nodes)this.body.nodes.hasOwnProperty(n)&&(o=this.body.nodes[n],void 0===o.options.level?t=!0:(e=!0,this.hierarchical.levels[n]=o.options.level));if(!0===t&&!0===e)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");else{if(!0===t){var i=this.options.hierarchical.sortMethod;"hubsize"===i?this._determineLevelsByHubsize():"directed"===i?this._determineLevelsDirected():"custom"===i&&this._determineLevelsCustomCallback()}for(var a in this.body.nodes)this.body.nodes.hasOwnProperty(a)&&this.hierarchical.ensureLevel(a);var d=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(d),this._condenseHierarchy(),this._shiftToCenter()}}}},{key:"_condenseHierarchy",value:function(){var e=this,t=!1,o={},n=function(){for(var t=d(),o=0,n=0,s;n<t.length-1;n++)s=t[n].max-t[n+1].min,o+=s+e.options.hierarchical.treeSpacing,a(n+1,o)},a=function(t,o){var n=e.hierarchical.trees;for(var i in n)n.hasOwnProperty(i)&&n[i]===t&&e.direction.shift(i,o)},d=function(){for(var t=[],o=0;o<e.hierarchical.numTrees();o++)t.push(e.direction.getTreeSize(o));return t},s=function t(o,n){if(!n[o.id]&&(n[o.id]=!0,e.hierarchical.childrenReference[o.id])){var a=e.hierarchical.childrenReference[o.id];if(0<a.length)for(var d=0;d<a.length;d++)t(e.body.nodes[a[d]],n)}},r=function(t){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1e9,n=1e9,i=1e9,a=1e9,d=-1e9;for(var s in t)if(t.hasOwnProperty(s)){var r=e.body.nodes[s],l=e.hierarchical.levels[r.id],c=e.direction.getPosition(r),u=e._getSpaceAroundNode(r,t),p=va(u,2),h=p[0],m=p[1];n=fo(h,n),i=fo(m,i),l<=o&&(a=fo(c,a),d=yo(c,d))}return[a,d,n,i]},l=function(t,o){var n=e.hierarchical.getMaxLevel(t.id),i=e.hierarchical.getMaxLevel(o.id);return fo(n,i)},c=function(t,o,n){for(var a=e.hierarchical,d=0;d<o.length;d++){var s=o[d],r=a.distributionOrdering[s];if(1<r.length)for(var l=0;l<r.length-1;l++){var c=r[l],u=r[l+1];a.hasSameParent(c,u)&&a.inSameSubNetwork(c,u)&&t(c,u,n)}}},u=function(o,n){var i=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],a=e.direction.getPosition(o),d=e.direction.getPosition(n),c=uo(d-a),u=e.options.hierarchical.nodeSpacing;if(c>u){var p={},h={};s(o,p),s(n,h);var m=l(o,n),g=r(p,m),y=r(h,m),f=g[1],b=y[0],_=y[2],v=uo(f-b);if(v>u){var k=f-b+u;k<-_+u&&(k=-_+u),0>k&&(e._shiftBlock(n.id,k),t=!0,!0===i&&e._centerParent(n))}}},p=function(n,a){for(var d=a.id,l=a.edges,c=e.hierarchical.levels[a.id],u=e.options.hierarchical.levelSeparation*e.options.hierarchical.levelSeparation,p={},h=[],m=0,g;m<l.length;m++)if(g=l[m],g.toId!=g.fromId){var y=g.toId==d?g.from:g.to;p[l[m].id]=y,e.hierarchical.levels[y.id]<c&&h.push(g)}var f=function(t,o){for(var n=0,i=0;i<o.length;i++)if(void 0!==p[o[i].id]){var d=e.direction.getPosition(p[o[i].id])-t;n+=d/mo(d*d+u)}return n},b=function(t,o){for(var n=0,i=0;i<o.length;i++)if(void 0!==p[o[i].id]){var d=e.direction.getPosition(p[o[i].id])-t;n-=u*lo(d*d+u,-1.5)}return n},_=function(t,o){for(var n=e.direction.getPosition(a),i={},d=0;d<t;d++){var s=f(n,o),r=b(n,o),l=40,c=yo(-l,fo(l,ro(s/r)));if(n-=c,void 0!==i[n])break;i[n]=d}return n},v=function(n){var i=e.direction.getPosition(a);if(void 0===o[a.id]){var d={};s(a,d),o[a.id]=d}var l=r(o[a.id]),c=l[2],u=l[3],p=n-i,h=0;0<p?h=fo(p,u-e.options.hierarchical.nodeSpacing):0>p&&(h=-fo(-p,c-e.options.hierarchical.nodeSpacing)),0!=h&&(e._shiftBlock(a.id,h),t=!0)},k=function(o){var n=e.direction.getPosition(a),i=e._getSpaceAroundNode(a),d=va(i,2),s=d[0],r=d[1],l=o-n,c=n;0<l?c=fo(n+(r-e.options.hierarchical.nodeSpacing),o):0>l&&(c=yo(n-(s-e.options.hierarchical.nodeSpacing),o)),c!==n&&(e.direction.setPosition(a,c),t=!0)},w=_(n,h);v(w),w=_(n,l),k(w)},h=function(o){var n=e.hierarchical.getLevels();n=n.reverse();for(var a=0;a<o;a++){t=!1;for(var d=0;d<n.length;d++)for(var s=n[d],r=e.hierarchical.distributionOrdering[s],l=0;l<r.length;l++)p(1e3,r[l]);if(!0!==t)break}},m=function(o){var n=e.hierarchical.getLevels();n=n.reverse();for(var a=0;a<o&&(t=!1,c(u,n,!0),!0===t);a++);},g=function(){var t=e.hierarchical.getLevels();t=t.reverse();for(var o=0;o<t.length;o++)for(var n=t[o],a=e.hierarchical.distributionOrdering[n],d=0;d<a.length;d++)e._centerParent(a[d])};!0===this.options.hierarchical.blockShifting&&(m(5),function(){for(var t in e.body.nodes)e.body.nodes.hasOwnProperty(t)&&e._centerParent(e.body.nodes[t])}()),!0===this.options.hierarchical.edgeMinimization&&h(20),!0===this.options.hierarchical.parentCentralization&&g(),n()}},{key:"_getSpaceAroundNode",value:function(e,t){var o=!0;void 0===t&&(o=!1);var n=this.hierarchical.levels[e.id];if(void 0!==n){var i=this.hierarchical.distributionIndex[e.id],a=this.direction.getPosition(e),d=this.hierarchical.distributionOrdering[n],s=1e9,r=1e9;if(0!==i){var l=d[i-1];if(!0==o&&void 0===t[l.id]||!1==o){var c=this.direction.getPosition(l);s=a-c}}if(i!=d.length-1){var u=d[i+1];if(!0==o&&void 0===t[u.id]||!1==o){var p=this.direction.getPosition(u);r=fo(r,p-a)}}return[s,r]}return[0,0]}},{key:"_centerParent",value:function(e){if(this.hierarchical.parentReference[e.id])for(var t=this.hierarchical.parentReference[e.id],o=0;o<t.length;o++){var n=t[o],a=this.body.nodes[n],d=this.hierarchical.childrenReference[n];if(void 0!==d){var s=this._getCenterPosition(d),r=this.direction.getPosition(a),l=this._getSpaceAroundNode(a),c=va(l,2),u=c[0],p=c[1],h=r-s;(0>h&&uo(h)<p-this.options.hierarchical.nodeSpacing||0<h&&uo(h)<u-this.options.hierarchical.nodeSpacing)&&this.direction.setPosition(a,s)}}}},{key:"_placeNodesByHierarchy",value:function(e){for(var t in this.positionedNodes={},e)if(e.hasOwnProperty(t)){var o=Object.keys(e[t]);o=this._indexArrayToNodes(o),this.direction.sort(o);for(var n=0,a=0,d;a<o.length;a++)if(d=o[a],void 0===this.positionedNodes[d.id]){var s=this.options.hierarchical.nodeSpacing,r=s*n;0<n&&(r=this.direction.getPosition(o[a-1])+s),this.direction.setPosition(d,r,t),this._validatePositionAndContinue(d,t,r),n++}}}},{key:"_placeBranchNodes",value:function(e,t){var o=this.hierarchical.childrenReference[e];if(void 0!==o){for(var n=[],a=0;a<o.length;a++)n.push(this.body.nodes[o[a]]);this.direction.sort(n);for(var d=0;d<n.length;d++){var s=n[d],r=this.hierarchical.levels[s.id];if(r>t&&void 0===this.positionedNodes[s.id]){var l=this.options.hierarchical.nodeSpacing,c=void 0;c=0==d?this.direction.getPosition(this.body.nodes[e]):this.direction.getPosition(n[d-1])+l,this.direction.setPosition(s,c,r),this._validatePositionAndContinue(s,r,c)}else return}var u=this._getCenterPosition(n);this.direction.setPosition(this.body.nodes[e],u,t)}}},{key:"_validatePositionAndContinue",value:function(e,t,o){if(this.hierarchical.isTree){if(void 0!==this.lastNodeOnLevel[t]){var n=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(o-n<this.options.hierarchical.nodeSpacing){var i=n+this.options.hierarchical.nodeSpacing-o,a=this._findCommonParent(this.lastNodeOnLevel[t],e.id);this._shiftBlock(a.withChild,i)}}this.lastNodeOnLevel[t]=e.id,this.positionedNodes[e.id]=!0,this._placeBranchNodes(e.id,t)}}},{key:"_indexArrayToNodes",value:function(e){for(var t=[],o=0;o<e.length;o++)t.push(this.body.nodes[e[o]]);return t}},{key:"_getDistribution",value:function(){var e={},t,o;for(t in this.body.nodes)if(this.body.nodes.hasOwnProperty(t)){o=this.body.nodes[t];var n=void 0===this.hierarchical.levels[t]?0:this.hierarchical.levels[t];this.direction.fix(o,n),void 0===e[n]&&(e[n]={}),e[n][t]=o}return e}},{key:"_getActiveEdges",value:function(e){var t=this,o=[];return Wo.forEach(e.edges,function(e){-1!==t.body.edgeIndices.indexOf(e.id)&&o.push(e)}),o}},{key:"_getHubSizes",value:function(){var e=this,t={},o=this.body.nodeIndices;Wo.forEach(o,function(o){var n=e.body.nodes[o],i=e._getActiveEdges(n).length;t[i]=!0});var n=[];return Wo.forEach(t,function(e){n.push(+e)}),$d.sort(n,function(e,t){return t-e}),n}},{key:"_determineLevelsByHubsize",value:function(){for(var e=this,t=function(t,o){e.hierarchical.levelDownstream(t,o)},o=this._getHubSizes(),n=function(n){var i=o[n];return 0===i?"break":void Wo.forEach(e.body.nodeIndices,function(o){var n=e.body.nodes[o];i===e._getActiveEdges(n).length&&e._crawlNetwork(t,o)})},a=0,d;a<o.length&&(d=n(a),"break"!==d);++a);}},{key:"_determineLevelsCustomCallback",value:function(){var e=this,t=function(){};this._crawlNetwork(function(o,n,i){var a=e.hierarchical.levels[o.id];void 0===a&&(a=e.hierarchical.levels[o.id]=1e5);var d=t(Yd.cloneOptions(o,"node"),Yd.cloneOptions(n,"node"),Yd.cloneOptions(i,"edge"));e.hierarchical.levels[n.id]=a+d}),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_determineLevelsDirected",value:function(){var e=this,t=function(t){return Wo.forEach(e.body.edges,function(e){if(e.toId===t.fromId&&e.fromId===t.toId)return!0}),!1};this._crawlNetwork(function(o,n,i){var a=e.hierarchical.levels[o.id],d=e.hierarchical.levels[n.id];if(t(i));void 0===a&&(a=e.hierarchical.levels[o.id]=1e4),e.hierarchical.levels[n.id]=i.toId==n.id?a+1:a-1}),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_generateMap",value:function(){var e=this;this._crawlNetwork(function(t,o){e.hierarchical.levels[o.id]>e.hierarchical.levels[t.id]&&e.hierarchical.addRelation(t.id,o.id)}),this.hierarchical.checkIfTree()}},{key:"_crawlNetwork",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:function(){},o=1<arguments.length?arguments[1]:void 0,n={},a=function o(a,d){if(void 0===n[a.id]){e.hierarchical.setTreeIndex(a,d),n[a.id]=!0;for(var s=e._getActiveEdges(a),r=0,l,c;r<s.length;r++)c=s[r],!0===c.connected&&(l=c.toId==a.id?c.from:c.to,a.id!=l.id&&(t(a,l,c),o(l,d)))}};if(void 0===o){for(var d=0,s=0,r;s<this.body.nodeIndices.length;s++)if(r=this.body.nodeIndices[s],void 0===n[r]){var l=this.body.nodes[r];a(l,d),d+=1}}else{var c=this.body.nodes[o];if(void 0===c)return void console.error("Node not found:",o);a(c)}}},{key:"_shiftBlock",value:function(e,t){var o=this,n={},i=function e(a){if(!n[a]){n[a]=!0,o.direction.shift(a,t);var d=o.hierarchical.childrenReference[a];if(void 0!==d)for(var s=0;s<d.length;s++)e(d[s])}};i(e)}},{key:"_findCommonParent",value:function(e,t){var o=this,n={},i=function e(t,n){var a=o.hierarchical.parentReference[n];if(void 0!==a)for(var d=0,s;d<a.length;d++)s=a[d],t[s]=!0,e(t,s)},a=function e(t,n){var a=o.hierarchical.parentReference[n];if(void 0!==a)for(var d=0,s;d<a.length;d++){if(s=a[d],void 0!==t[s])return{foundParent:s,withChild:n};var r=e(t,s);if(null!==r.foundParent)return r}return{foundParent:null,withChild:n}};return i(n,e),a(n,t)}},{key:"setDirectionStrategy",value:function(){var e="UD"===this.options.hierarchical.direction||"DU"===this.options.hierarchical.direction;this.direction=e?new es(this):new ts(this)}},{key:"_getCenterPosition",value:function(e){for(var t=1e9,o=-1e9,n=0,a;n<e.length;n++){if(a=void 0,void 0!==e[n].id)a=e[n];else{var d=e[n];a=this.body.nodes[d]}var s=this.direction.getPosition(a);t=fo(t,s),o=yo(o,s)}return .5*(t+o)}}]),e}(),is=function(){function e(t,o,n){var i=this;pa(this,e),this.body=t,this.canvas=o,this.selectionHandler=n,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this.manipulationHammers=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},Wo.extend(this.options,this.defaultOptions),this.body.emitter.on("destroy",function(){i._clean()}),this.body.emitter.on("_dataChanged",this._restore.bind(this)),this.body.emitter.on("_resetData",this._restore.bind(this))}return ha(e,[{key:"_restore",value:function(){!1!==this.inMode&&(!0===this.options.initiallyActive?this.enableEditMode():this.disableEditMode())}},{key:"setOptions",value:function(e,t,o){void 0!==t&&(this.options.locale=void 0===t.locale?o.locale:t.locale,this.options.locales=void 0===t.locales?o.locales:t.locales),void 0!==e&&("boolean"==typeof e?this.options.enabled=e:(this.options.enabled=!0,Wo.deepExtend(this.options,e)),!0===this.options.initiallyActive&&(this.editMode=!0),this._setup())}},{key:"toggleEditMode",value:function(){!0===this.editMode?this.disableEditMode():this.enableEditMode()}},{key:"enableEditMode",value:function(){this.editMode=!0,this._clean(),!0===this.guiEnabled&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}},{key:"disableEditMode",value:function(){this.editMode=!1,this._clean(),!0===this.guiEnabled&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}},{key:"showManipulatorToolbar",value:function(){if(this._clean(),this.manipulationDOM={},!0===this.guiEnabled){this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";var e=this.selectionHandler._getSelectedNodeCount(),t=this.selectionHandler._getSelectedEdgeCount(),o=this.options.locales[this.options.locale],n=!1;!1!==this.options.addNode&&(this._createAddNodeButton(o),n=!0),!1!==this.options.addEdge&&(!0===n?this._createSeperator(1):n=!0,this._createAddEdgeButton(o)),1===e&&"function"==typeof this.options.editNode?(!0===n?this._createSeperator(2):n=!0,this._createEditNodeButton(o)):1===t&&0===e&&!1!==this.options.editEdge&&(!0===n?this._createSeperator(3):n=!0,this._createEditEdgeButton(o)),0!==e+t&&(0<e&&!1!==this.options.deleteNode?(!0===n&&this._createSeperator(4),this._createDeleteButton(o)):0===e&&!1!==this.options.deleteEdge&&(!0===n&&this._createSeperator(4),this._createDeleteButton(o))),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this)),this._temporaryBindEvent("select",this.showManipulatorToolbar.bind(this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addNode",!0===this.guiEnabled){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.addDescription||this.options.locales.en.addDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindEvent("click",this._performAddNode.bind(this))}},{key:"editNode",value:function(){var e=this;!0!==this.editMode&&this.enableEditMode(),this._clean();var t=this.selectionHandler._getSelectedNode();if(void 0===t)this.showManipulatorToolbar();else if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");else if(!0!==t.isCluster){var o=Wo.deepExtend({},t.options,!1);if(o.x=t.x,o.y=t.y,2===this.options.editNode.length)this.options.editNode(o,function(t){null!==t&&void 0!==t&&"editNode"===e.inMode&&e.body.data.nodes.getDataSet().update(t),e.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}},{key:"addEdgeMode",value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addEdge",!0===this.guiEnabled){var e=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(e),this._createSeperator(),this._createDescription(e.edgeDescription||this.options.locales.en.edgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}this._temporaryBindUI("onTouch",this._handleConnect.bind(this)),this._temporaryBindUI("onDragEnd",this._finishConnect.bind(this)),this._temporaryBindUI("onDrag",this._dragControlNode.bind(this)),this._temporaryBindUI("onRelease",this._finishConnect.bind(this)),this._temporaryBindUI("onDragStart",this._dragStartEdge.bind(this)),this._temporaryBindUI("onHold",function(){})}},{key:"editEdgeMode",value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="editEdge","object"===ka(this.options.editEdge)&&"function"==typeof this.options.editEdge.editWithoutDrag&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId)){var e=this.body.edges[this.edgeBeingEditedId];return void this._performEditEdge(e.from,e.to)}if(!0===this.guiEnabled){var t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindHammerToDiv(this.closeDiv,this.toggleEditMode.bind(this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdges()[0],void 0!==this.edgeBeingEditedId){var o=this.body.edges[this.edgeBeingEditedId],n=this._getNewTargetNode(o.from.x,o.from.y),i=this._getNewTargetNode(o.to.x,o.to.y);this.temporaryIds.nodes.push(n.id),this.temporaryIds.nodes.push(i.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id),this.body.nodes[i.id]=i,this.body.nodeIndices.push(i.id),this._temporaryBindUI("onTouch",this._controlNodeTouch.bind(this)),this._temporaryBindUI("onTap",function(){}),this._temporaryBindUI("onHold",function(){}),this._temporaryBindUI("onDragStart",this._controlNodeDragStart.bind(this)),this._temporaryBindUI("onDrag",this._controlNodeDrag.bind(this)),this._temporaryBindUI("onDragEnd",this._controlNodeDragEnd.bind(this)),this._temporaryBindUI("onMouseMove",function(){}),this._temporaryBindEvent("beforeDrawing",function(e){var t=o.edgeType.findBorderPositions(e);!1===n.selected&&(n.x=t.from.x,n.y=t.from.y),!1===i.selected&&(i.x=t.to.x,i.y=t.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}},{key:"deleteSelected",value:function(){var e=this;!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="delete";var t=this.selectionHandler.getSelectedNodes(),o=this.selectionHandler.getSelectedEdges(),n=void 0;if(0<t.length){for(var a=0;a<t.length;a++)if(!0===this.body.nodes[t[a]].isCluster)return void alert(this.options.locales[this.options.locale].deleteClusterError||this.options.locales.en.deleteClusterError);"function"==typeof this.options.deleteNode&&(n=this.options.deleteNode)}else 0<o.length&&"function"==typeof this.options.deleteEdge&&(n=this.options.deleteEdge);if("function"==typeof n){if(2===n.length)n({nodes:t,edges:o},function(t){null!==t&&void 0!==t&&"delete"===e.inMode?(e.body.data.edges.getDataSet().remove(t.edges),e.body.data.nodes.getDataSet().remove(t.nodes),e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar()):(e.body.emitter.emit("startSimulation"),e.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(o),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){!0===this.options.enabled?(this.guiEnabled=!0,this._createWrappers(),!1===this.editMode?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.manipulationDiv.style.display=!0===this.editMode?"block":"none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editModeDiv.style.display=!0===this.editMode?"none":"block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv&&(this.closeDiv=document.createElement("div"),this.closeDiv.className="vis-close",this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:"_getNewTargetNode",value:function(e,t){var o=Wo.deepExtend({},this.options.controlNodeStyle);o.id="targetNode"+Wo.randomUUID(),o.hidden=!1,o.physics=!1,o.x=e,o.y=t;var n=this.body.functions.createNode(o);return n.shape.boundingBox={left:e,right:e,top:t,bottom:t},n}},{key:"_createEditButton",value:function(){this._clean(),this.manipulationDOM={},Wo.recursiveDOMDelete(this.editModeDiv);var e=this.options.locales[this.options.locale],t=this._createButton("editMode","vis-button vis-edit vis-edit-mode",e.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(t),this._bindHammerToDiv(t,this.toggleEditMode.bind(this))}},{key:"_clean",value:function(){this.inMode=!1,!0===this.guiEnabled&&(Wo.recursiveDOMDelete(this.editModeDiv),Wo.recursiveDOMDelete(this.manipulationDiv),this._cleanManipulatorHammers()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanManipulatorHammers",value:function(){if(0!=this.manipulationHammers.length){for(var e=0;e<this.manipulationHammers.length;e++)this.manipulationHammers[e].destroy();this.manipulationHammers=[]}}},{key:"_removeManipulationDOM",value:function(){this._clean(),Wo.recursiveDOMDelete(this.manipulationDiv),Wo.recursiveDOMDelete(this.editModeDiv),Wo.recursiveDOMDelete(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}},{key:"_createSeperator",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}},{key:"_createAddNodeButton",value:function(e){var t=this._createButton("addNode","vis-button vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.addNodeMode.bind(this))}},{key:"_createAddEdgeButton",value:function(e){var t=this._createButton("addEdge","vis-button vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.addEdgeMode.bind(this))}},{key:"_createEditNodeButton",value:function(e){var t=this._createButton("editNode","vis-button vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.editNode.bind(this))}},{key:"_createEditEdgeButton",value:function(e){var t=this._createButton("editEdge","vis-button vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.editEdgeMode.bind(this))}},{key:"_createDeleteButton",value:function(e){var t=this.options.rtl?"vis-button vis-delete-rtl":"vis-button vis-delete";var o=this._createButton("delete",t,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(o),this._bindHammerToDiv(o,this.deleteSelected.bind(this))}},{key:"_createBackButton",value:function(e){var t=this._createButton("back","vis-button vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(t),this._bindHammerToDiv(t,this.showManipulatorToolbar.bind(this))}},{key:"_createButton",value:function(e,t,o){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("div"),this.manipulationDOM[e+"Div"].className=t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=n,this.manipulationDOM[e+"Label"].innerHTML=o,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}},{key:"_createDescription",value:function(e){this.manipulationDiv.appendChild(this._createButton("description","vis-button vis-none",e))}},{key:"_temporaryBindEvent",value:function(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}},{key:"_temporaryBindUI",value:function(e,t){if(void 0!==this.body.eventListeners[e])this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+JSON.stringify(Object.keys(this.body.eventListeners)))}},{key:"_unbindTemporaryUIs",value:function(){for(var e in this.temporaryUIFunctions)this.temporaryUIFunctions.hasOwnProperty(e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var e=0;e<this.temporaryEventFunctions.length;e++){var t=this.temporaryEventFunctions[e].event,o=this.temporaryEventFunctions[e].boundFunction;this.body.emitter.off(t,o)}this.temporaryEventFunctions=[]}},{key:"_bindHammerToDiv",value:function(e,t){var o=new la(e,{});Bd.onTouch(o,t),this.manipulationHammers.push(o)}},{key:"_cleanupTemporaryNodesAndEdges",value:function(){for(var e=0;e<this.temporaryIds.edges.length;e++){this.body.edges[this.temporaryIds.edges[e]].disconnect(),delete this.body.edges[this.temporaryIds.edges[e]];var t=this.body.edgeIndices.indexOf(this.temporaryIds.edges[e]);-1!==t&&this.body.edgeIndices.splice(t,1)}for(var o=0;o<this.temporaryIds.nodes.length;o++){delete this.body.nodes[this.temporaryIds.nodes[o]];var n=this.body.nodeIndices.indexOf(this.temporaryIds.nodes[o]);-1!==n&&this.body.nodeIndices.splice(n,1)}this.temporaryIds={nodes:[],edges:[]}}},{key:"_controlNodeTouch",value:function(e){this.selectionHandler.unselectAll(),this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=Wo.extend({},this.body.view.translation)}},{key:"_controlNodeDragStart",value:function(){var e=this.lastTouch,t=this.selectionHandler._pointerToPositionObject(e),o=this.body.nodes[this.temporaryIds.nodes[0]],n=this.body.nodes[this.temporaryIds.nodes[1]],i=this.body.edges[this.edgeBeingEditedId];this.selectedControlNode=void 0;var a=o.isOverlappingWith(t),d=n.isOverlappingWith(t);!0===a?(this.selectedControlNode=o,i.edgeType.from=o):!0===d&&(this.selectedControlNode=n,i.edgeType.to=n),void 0!==this.selectedControlNode&&this.selectionHandler.selectObject(this.selectedControlNode),this.body.emitter.emit("_redraw")}},{key:"_controlNodeDrag",value:function(e){this.body.emitter.emit("disablePhysics");var t=this.body.functions.getPointer(e.center),o=this.canvas.DOMtoCanvas(t);if(void 0!==this.selectedControlNode)this.selectedControlNode.x=o.x,this.selectedControlNode.y=o.y;else{var n=t.x-this.lastTouch.x,i=t.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+n,y:this.lastTouch.translation.y+i}}this.body.emitter.emit("_redraw")}},{key:"_controlNodeDragEnd",value:function(e){var t=this.body.functions.getPointer(e.center),o=this.selectionHandler._pointerToPositionObject(t),n=this.body.edges[this.edgeBeingEditedId];if(void 0!==this.selectedControlNode){this.selectionHandler.unselectAll();for(var a=this.selectionHandler._getAllNodesOverlappingWith(o),d=void 0,s=a.length-1;0<=s;s--)if(a[s]!==this.selectedControlNode.id){d=this.body.nodes[a[s]];break}if(void 0===d||void 0===this.selectedControlNode)n.updateEdgeType(),this.body.emitter.emit("restorePhysics");else if(!0===d.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var r=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===r.id?this._performEditEdge(d.id,n.to.id):this._performEditEdge(n.from.id,d.id)}this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(e){if(100<new Date().valueOf()-this.touchTime){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=Wo.extend({},this.body.view.translation);var t=this.lastTouch,o=this.selectionHandler.getNodeAt(t);if(void 0!==o)if(!0===o.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var n=this._getNewTargetNode(o.x,o.y);this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id);var i=this.body.functions.createEdge({id:"connectionEdge"+Wo.randomUUID(),from:o.id,to:n.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[i.id]=i,this.body.edgeIndices.push(i.id),this.temporaryIds.nodes.push(n.id),this.temporaryIds.edges.push(i.id)}this.touchTime=new Date().valueOf()}}},{key:"_dragControlNode",value:function(e){var t=this.body.functions.getPointer(e.center),o=this.selectionHandler._pointerToPositionObject(t),n=void 0;void 0!==this.temporaryIds.edges[0]&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var a=this.selectionHandler._getAllNodesOverlappingWith(o),d=void 0,s=a.length-1;0<=s;s--)if(-1===this.temporaryIds.nodes.indexOf(a[s])){d=this.body.nodes[a[s]];break}if(e.controlEdge={from:n,to:d?d.id:void 0},this.selectionHandler._generateClickEvent("controlNodeDragging",e,t),void 0!==this.temporaryIds.nodes[0]){var r=this.body.nodes[this.temporaryIds.nodes[0]];r.x=this.canvas._XconvertDOMtoCanvas(t.x),r.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else{var l=t.x-this.lastTouch.x,c=t.y-this.lastTouch.y;this.body.view.translation={x:this.lastTouch.translation.x+l,y:this.lastTouch.translation.y+c}}}},{key:"_finishConnect",value:function(e){var t=this.body.functions.getPointer(e.center),o=this.selectionHandler._pointerToPositionObject(t),n=void 0;void 0!==this.temporaryIds.edges[0]&&(n=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var a=this.selectionHandler._getAllNodesOverlappingWith(o),d=void 0,s=a.length-1;0<=s;s--)if(-1===this.temporaryIds.nodes.indexOf(a[s])){d=this.body.nodes[a[s]];break}this._cleanupTemporaryNodesAndEdges(),void 0!==d&&(!0===d.isCluster?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[n]&&void 0!==this.body.nodes[d.id]&&this._performAddEdge(n,d.id)),e.controlEdge={from:n,to:d?d.id:void 0},this.selectionHandler._generateClickEvent("controlNodeDragEnd",e,t),this.body.emitter.emit("_redraw")}},{key:"_dragStartEdge",value:function(e){var t=this.lastTouch;this.selectionHandler._generateClickEvent("dragStart",e,t,void 0,!0)}},{key:"_performAddNode",value:function(e){var t=this,o={id:Wo.randomUUID(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if("function"!=typeof this.options.addNode)this.body.data.nodes.getDataSet().add(o),this.showManipulatorToolbar();else if(2===this.options.addNode.length)this.options.addNode(o,function(e){null!==e&&void 0!==e&&"addNode"===t.inMode&&t.body.data.nodes.getDataSet().add(e),t.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)")}},{key:"_performAddEdge",value:function(e,t){var o=this,n={from:e,to:t};if("function"!=typeof this.options.addEdge)this.body.data.edges.getDataSet().add(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar();else if(2===this.options.addEdge.length)this.options.addEdge(n,function(e){null!==e&&void 0!==e&&"addEdge"===o.inMode&&(o.body.data.edges.getDataSet().add(e),o.selectionHandler.unselectAll(),o.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)")}},{key:"_performEditEdge",value:function(e,t){var o=this,n={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges._data[this.edgeBeingEditedId].label},i=this.options.editEdge;if("object"===ka(i)&&(i=i.editWithoutDrag),"function"!=typeof i)this.body.data.edges.getDataSet().update(n),this.selectionHandler.unselectAll(),this.showManipulatorToolbar();else if(2===i.length)i(n,function(e){null===e||void 0===e||"editEdge"!==o.inMode?(o.body.edges[n.id].updateEdgeType(),o.body.emitter.emit("_redraw"),o.showManipulatorToolbar()):(o.body.data.edges.getDataSet().update(e),o.selectionHandler.unselectAll(),o.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)")}}]),e}(),as={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"},ds=function(){function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;pa(this,e),this.pixelRatio=t,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=function(){},this.closeCallback=function(){},this._create()}return ha(e,[{key:"insertTo",value:function(e){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}},{key:"setUpdateCallback",value:function(e){if("function"==typeof e)this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}},{key:"setCloseCallback",value:function(e){if("function"==typeof e)this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}},{key:"_isColorString",value:function(e){if("string"==typeof e)return as[e]}},{key:"setColor",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];if("none"!==e){var o=this._isColorString(e),n;if(void 0!==o&&(e=o),!0===Wo.isString(e)){if(!0===Wo.isValidRGB(e)){var i=e.substr(4).substr(0,e.length-5).split(",");n={r:i[0],g:i[1],b:i[2],a:1}}else if(!0===Wo.isValidRGBA(e)){var a=e.substr(5).substr(0,e.length-6).split(",");n={r:a[0],g:a[1],b:a[2],a:a[3]}}else if(!0===Wo.isValidHex(e)){var d=Wo.hexToRGB(e);n={r:d.r,g:d.g,b:d.b,a:1}}}else if(e instanceof Object&&void 0!==e.r&&void 0!==e.g&&void 0!==e.b){var s=void 0===e.a?"1.0":e.a;n={r:e.r,g:e.g,b:e.b,a:s}}if(void 0===n)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+JSON.stringify(e));else this._setColor(n,t)}}},{key:"show",value:function(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}},{key:"_hide",value:function(){var e=this,t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];!0===t&&(this.previousColor=Wo.extend({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",setTimeout(function(){void 0!==e.closeCallback&&(e.closeCallback(),e.closeCallback=void 0)},0)}},{key:"_save",value:function(){this.updateCallback(this.color),this.applied=!1,this._hide()}},{key:"_apply",value:function(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}},{key:"_loadLast",value:function(){void 0===this.previousColor?alert("There is no last color to load..."):this.setColor(this.previousColor,!1)}},{key:"_setColor",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];!0===t&&(this.initialColor=Wo.extend({},e)),this.color=e;var o=Wo.RGBToHSV(e.r,e.g,e.b),n=2*po,i=this.r*o.s,a=this.centerCoordinates.x+i*so(n*o.h),d=this.centerCoordinates.y+i*ao(n*o.h);this.colorPickerSelector.style.left=a-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=d-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}},{key:"_setOpacity",value:function(e){this.color.a=e/100,this._updatePicker(this.color)}},{key:"_setBrightness",value:function(e){var t=Wo.RGBToHSV(this.color.r,this.color.g,this.color.b);t.v=e/100;var o=Wo.HSVToRGB(t.h,t.s,t.v);o.a=this.color.a,this.color=o,this._updatePicker()}},{key:"_updatePicker",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.color,t=Wo.RGBToHSV(e.r,e.g,e.b),o=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1)),o.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var n=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;o.clearRect(0,0,n,i),o.putImageData(this.hueCircle,0,0),o.fillStyle="rgba(0,0,0,"+(1-t.v)+")",o.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),o.fill(),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}},{key:"_setSize",value:function(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}},{key:"_create",value:function(){if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),!this.colorPickerCanvas.getContext){var e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerHTML="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(e)}else{var t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(e){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(e){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var o=this;this.opacityRange.onchange=function(){o._setOpacity(this.value)},this.opacityRange.oninput=function(){o._setOpacity(this.value)},this.brightnessRange.onchange=function(){o._setBrightness(this.value)},this.brightnessRange.oninput=function(){o._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerHTML="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerHTML="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerHTML="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerHTML="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerHTML="cancel",this.cancelButton.onclick=this._hide.bind(this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerHTML="apply",this.applyButton.onclick=this._apply.bind(this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerHTML="save",this.saveButton.onclick=this._save.bind(this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerHTML="load last",this.loadButton.onclick=this._loadLast.bind(this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}},{key:"_bindHammer",value:function(){var e=this;this.drag={},this.pinch={},this.hammer=new la(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),Bd.onTouch(this.hammer,function(t){e._moveSelector(t)}),this.hammer.on("tap",function(t){e._moveSelector(t)}),this.hammer.on("panstart",function(t){e._moveSelector(t)}),this.hammer.on("panmove",function(t){e._moveSelector(t)}),this.hammer.on("panend",function(t){e._moveSelector(t)})}},{key:"_generateHueCircle",value:function(){if(!1===this.generated){var e=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var t=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,o);var n,i,a,d;this.centerCoordinates={x:.5*t,y:.5*o},this.r=.49*t;var s=2*po/360,r=1/this.r,l;for(a=0;360>a;a++)for(d=0;d<this.r;d++)n=this.centerCoordinates.x+d*so(s*a),i=this.centerCoordinates.y+d*ao(s*a),l=Wo.HSVToRGB(a*(1/360),d*r,1),e.fillStyle="rgb("+l.r+","+l.g+","+l.b+")",e.fillRect(n-.5,i-.5,2,2);e.strokeStyle="rgba(0,0,0,1)",e.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),e.stroke(),this.hueCircle=e.getImageData(0,0,t,o)}this.generated=!0}},{key:"_moveSelector",value:function(e){var t=this.colorPickerDiv.getBoundingClientRect(),o=e.center.x-t.left,n=e.center.y-t.top,i=.5*this.colorPickerDiv.clientHeight,a=.5*this.colorPickerDiv.clientWidth,d=o-a,r=n-i,l=ho(d,r),c=.98*fo(mo(d*d+r*r),a),u=ao(l)*c+i,p=so(l)*c+a;this.colorPickerSelector.style.top=u-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=p-.5*this.colorPickerSelector.clientWidth+"px";var m=l/(2*po);m=0>m?m+1:m;var g=c/this.r,s=Wo.RGBToHSV(this.color.r,this.color.g,this.color.b);s.h=m,s.s=g;var y=Wo.HSVToRGB(s.h,s.s,s.v);y.a=this.color.a,this.color=y,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}}]),e}(),ss=function(){function e(t,o,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1;pa(this,e),this.parent=t,this.changedOptions=[],this.container=o,this.allowCreation=!1,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},Wo.extend(this.options,this.defaultOptions),this.configureOptions=n,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new ds(i),this.wrapper=void 0}return ha(e,[{key:"setOptions",value:function(e){if(void 0!==e){this.popupHistory={},this._removePopup();var t=!0;if("string"==typeof e)this.options.filter=e;else if(e instanceof Array)this.options.filter=e.join();else if("object"===ka(e)){if(null==e)throw new TypeError("options cannot be null");void 0!==e.container&&(this.options.container=e.container),void 0!==e.filter&&(this.options.filter=e.filter),void 0!==e.showButton&&(this.options.showButton=e.showButton),void 0!==e.enabled&&(t=e.enabled)}else"boolean"==typeof e?(this.options.filter=!0,t=e):"function"==typeof e&&(this.options.filter=e,t=!0);!1===this.options.filter&&(t=!1),this.options.enabled=t}this._clean()}},{key:"setModuleOptions",value:function(e){this.moduleOptions=e,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}},{key:"_create",value:function(){this._clean(),this.changedOptions=[];var e=this.options.filter,t=0,o=!1;for(var n in this.configureOptions)this.configureOptions.hasOwnProperty(n)&&(this.allowCreation=!1,o=!1,"function"==typeof e?(o=e(n,[]),o=o||this._handleObject(this.configureOptions[n],[n],!0)):(!0===e||-1!==e.indexOf(n))&&(o=!0),!1!==o&&(this.allowCreation=!0,0<t&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),t++);this._makeButton(),this._push()}},{key:"_push",value:function(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var e=0;e<this.domElements.length;e++)this.wrapper.appendChild(this.domElements[e]);this._showPopupIfNeeded()}},{key:"_clean",value:function(){for(var e=0;e<this.domElements.length;e++)this.wrapper.removeChild(this.domElements[e]);void 0!==this.wrapper&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}},{key:"_getValue",value:function(e){for(var t=this.moduleOptions,o=0;o<e.length;o++)if(void 0!==t[e[o]])t=t[e[o]];else{t=void 0;break}return t}},{key:"_makeItem",value:function(e){if(!0===this.allowCreation){var t=document.createElement("div");t.className="vis-configuration vis-config-item vis-config-s"+e.length;for(var o=arguments.length,n=Array(1<o?o-1:0),i=1;i<o;i++)n[i-1]=arguments[i];return n.forEach(function(e){t.appendChild(e)}),this.domElements.push(t),this.domElements.length}return 0}},{key:"_makeHeader",value:function(e){var t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerHTML=e,this._makeItem([],t)}},{key:"_makeLabel",value:function(e,t){var o=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],n=document.createElement("div");return n.className="vis-configuration vis-config-label vis-config-s"+t.length,n.innerHTML=!0===o?"<i><b>"+e+":</b></i>":e+":",n}},{key:"_makeDropdown",value:function(e,t,o){var n=document.createElement("select");n.className="vis-configuration vis-config-select";var a=0;void 0!==t&&-1!==e.indexOf(t)&&(a=e.indexOf(t));for(var d=0,s;d<e.length;d++)s=document.createElement("option"),s.value=e[d],d==a&&(s.selected="selected"),s.innerHTML=e[d],n.appendChild(s);var r=this;n.onchange=function(){r._update(this.value,o)};var l=this._makeLabel(o[o.length-1],o);this._makeItem(o,l,n)}},{key:"_makeRange",value:function(e,t,o){var n=e[0],i=e[1],a=e[2],d=e[3],s=document.createElement("input");s.className="vis-configuration vis-config-range";try{s.type="range",s.min=i,s.max=a}catch(e){}s.step=d;var r="",l=0;if(void 0!==t){var c=1.2;0>t&&t*c<i?(s.min=co(t*c),l=s.min,r="range increased"):t/c<i&&(s.min=co(t/c),l=s.min,r="range increased"),t*c>a&&1!==a&&(s.max=co(t*c),l=s.max,r="range increased"),s.value=t}else s.value=n;var u=document.createElement("input");u.className="vis-configuration vis-config-rangeinput",u.value=s.value;var p=this;s.onchange=function(){u.value=this.value,p._update(+this.value,o)},s.oninput=function(){u.value=this.value};var h=this._makeLabel(o[o.length-1],o),m=this._makeItem(o,h,s,u);""!=r&&this.popupHistory[m]!==l&&(this.popupHistory[m]=l,this._setupPopup(r,m))}},{key:"_makeButton",value:function(){var e=this;if(!0===this.options.showButton){var t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerHTML="generate options",t.onclick=function(){e._printOptions()},t.onmouseover=function(){t.className="vis-configuration vis-config-button hover"},t.onmouseout=function(){t.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(t)}}},{key:"_setupPopup",value:function(e,t){var o=this;if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter<this.popupLimit){var n=document.createElement("div");n.id="vis-configuration-popup",n.className="vis-configuration-popup",n.innerHTML=e,n.onclick=function(){o._removePopup()},this.popupCounter+=1,this.popupDiv={html:n,index:t}}}},{key:"_removePopup",value:function(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}},{key:"_showPopupIfNeeded",value:function(){var e=this;if(void 0!==this.popupDiv.html){var t=this.domElements[this.popupDiv.index],o=t.getBoundingClientRect();this.popupDiv.html.style.left=o.left+"px",this.popupDiv.html.style.top=o.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=setTimeout(function(){e.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=setTimeout(function(){e._removePopup()},1800)}}},{key:"_makeCheckbox",value:function(e,t,o){var n=document.createElement("input");n.type="checkbox",n.className="vis-configuration vis-config-checkbox",n.checked=e,void 0!==t&&(n.checked=t,t!==e&&("object"===ka(e)?t!==e.enabled&&this.changedOptions.push({path:o,value:t}):this.changedOptions.push({path:o,value:t})));var i=this;n.onchange=function(){i._update(this.checked,o)};var a=this._makeLabel(o[o.length-1],o);this._makeItem(o,a,n)}},{key:"_makeTextInput",value:function(e,t,o){var n=document.createElement("input");n.type="text",n.className="vis-configuration vis-config-text",n.value=t,t!==e&&this.changedOptions.push({path:o,value:t});var i=this;n.onchange=function(){i._update(this.value,o)};var a=this._makeLabel(o[o.length-1],o);this._makeItem(o,a,n)}},{key:"_makeColorField",value:function(e,t,o){var n=this,i=e[1],a=document.createElement("div");t=void 0===t?i:t,"none"===t?a.className="vis-configuration vis-config-colorBlock none":(a.className="vis-configuration vis-config-colorBlock",a.style.backgroundColor=t),t=void 0===t?i:t,a.onclick=function(){n._showColorPicker(t,a,o)};var d=this._makeLabel(o[o.length-1],o);this._makeItem(o,d,a)}},{key:"_showColorPicker",value:function(e,t,o){var n=this;t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(function(e){var i="rgba("+e.r+","+e.g+","+e.b+","+e.a+")";t.style.backgroundColor=i,n._update(i,o)}),this.colorPicker.setCloseCallback(function(){t.onclick=function(){n._showColorPicker(e,t,o)}})}},{key:"_handleObject",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],o=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],n=!1,i=this.options.filter,a=!1;for(var d in e)if(e.hasOwnProperty(d)){n=!0;var s=e[d],r=Wo.copyAndExtendArray(t,d);if("function"==typeof i&&(n=i(d,t),!1===n&&!(s instanceof Array)&&"string"!=typeof s&&"boolean"!=typeof s&&s instanceof Object&&(this.allowCreation=!1,n=this._handleObject(s,r,!0),this.allowCreation=!1===o)),!1!==n){a=!0;var l=this._getValue(r);if(s instanceof Array)this._handleArray(s,l,r);else if("string"==typeof s)this._makeTextInput(s,l,r);else if("boolean"==typeof s)this._makeCheckbox(s,l,r);else if(s instanceof Object){var c=!0;if(-1!==t.indexOf("physics")&&this.moduleOptions.physics.solver!==d&&(c=!1),!0==c)if(void 0!==s.enabled){var u=Wo.copyAndExtendArray(r,"enabled"),p=this._getValue(u);if(!0===p){var h=this._makeLabel(d,r,!0);this._makeItem(r,h),a=this._handleObject(s,r)||a}else this._makeCheckbox(s,p,r)}else{var m=this._makeLabel(d,r,!0);this._makeItem(r,m),a=this._handleObject(s,r)||a}}else console.error("dont know how to handle",s,d,r)}}return a}},{key:"_handleArray",value:function(e,t,o){"string"==typeof e[0]&&"color"===e[0]?(this._makeColorField(e,t,o),e[1]!==t&&this.changedOptions.push({path:o,value:t})):"string"==typeof e[0]?(this._makeDropdown(e,t,o),e[0]!==t&&this.changedOptions.push({path:o,value:t})):"number"==typeof e[0]&&(this._makeRange(e,t,o),e[0]!==t&&this.changedOptions.push({path:o,value:+t}))}},{key:"_update",value:function(e,t){var o=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",o),this.initialized=!0,this.parent.setOptions(o)}},{key:"_constructOptions",value:function(e,t){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},n=o;e="true"===e||e,e="false"!==e&&e;for(var a=0;a<t.length;a++)"global"!==t[a]&&(void 0===n[t[a]]&&(n[t[a]]={}),a==t.length-1?n[t[a]]=e:n=n[t[a]]);return o}},{key:"_printOptions",value:function(){var e=this.getOptions();this.optionsContainer.innerHTML="<pre>var options = "+JSON.stringify(e,null,2)+"</pre>"}},{key:"getOptions",value:function(){for(var e={},t=0;t<this.changedOptions.length;t++)this._constructOptions(this.changedOptions[t].value,this.changedOptions[t].path,e);return e}}]),e}(),rs="string",ls="boolean",cs="number",us="array",ps="object",hs="dom",ms=["arrow","circle","bar"],gs={configure:{enabled:{boolean:ls},filter:{boolean:ls,string:rs,array:us,function:"function"},container:{dom:hs},showButton:{boolean:ls},__type__:{object:ps,boolean:ls,string:rs,array:us,function:"function"}},edges:{arrows:{to:{enabled:{boolean:ls},scaleFactor:{number:cs},type:{string:ms},__type__:{object:ps,boolean:ls}},middle:{enabled:{boolean:ls},scaleFactor:{number:cs},type:{string:ms},__type__:{object:ps,boolean:ls}},from:{enabled:{boolean:ls},scaleFactor:{number:cs},type:{string:ms},__type__:{object:ps,boolean:ls}},__type__:{string:["from","to","middle"],object:ps}},arrowStrikethrough:{boolean:ls},background:{enabled:{boolean:ls},color:{string:rs},size:{number:cs},dashes:{boolean:ls,array:us},__type__:{object:ps,boolean:ls}},chosen:{label:{boolean:ls,function:"function"},edge:{boolean:ls,function:"function"},__type__:{object:ps,boolean:ls}},color:{color:{string:rs},highlight:{string:rs},hover:{string:rs},inherit:{string:["from","to","both"],boolean:ls},opacity:{number:cs},__type__:{object:ps,string:rs}},dashes:{boolean:ls,array:us},font:{color:{string:rs},size:{number:cs},face:{string:rs},background:{string:rs},strokeWidth:{number:cs},strokeColor:{string:rs},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:cs},multi:{boolean:ls,string:rs},bold:{color:{string:rs},size:{number:cs},face:{string:rs},mod:{string:rs},vadjust:{number:cs},__type__:{object:ps,string:rs}},boldital:{color:{string:rs},size:{number:cs},face:{string:rs},mod:{string:rs},vadjust:{number:cs},__type__:{object:ps,string:rs}},ital:{color:{string:rs},size:{number:cs},face:{string:rs},mod:{string:rs},vadjust:{number:cs},__type__:{object:ps,string:rs}},mono:{color:{string:rs},size:{number:cs},face:{string:rs},mod:{string:rs},vadjust:{number:cs},__type__:{object:ps,string:rs}},__type__:{object:ps,string:rs}},hidden:{boolean:ls},hoverWidth:{function:"function",number:cs},label:{string:rs,undefined:"undefined"},labelHighlightBold:{boolean:ls},length:{number:cs,undefined:"undefined"},physics:{boolean:ls},scaling:{min:{number:cs},max:{number:cs},label:{enabled:{boolean:ls},min:{number:cs},max:{number:cs},maxVisible:{number:cs},drawThreshold:{number:cs},__type__:{object:ps,boolean:ls}},customScalingFunction:{function:"function"},__type__:{object:ps}},selectionWidth:{function:"function",number:cs},selfReferenceSize:{number:cs},shadow:{enabled:{boolean:ls},color:{string:rs},size:{number:cs},x:{number:cs},y:{number:cs},__type__:{object:ps,boolean:ls}},smooth:{enabled:{boolean:ls},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:cs},forceDirection:{string:["horizontal","vertical","none"],boolean:ls},__type__:{object:ps,boolean:ls}},title:{string:rs,undefined:"undefined"},width:{number:cs},widthConstraint:{maximum:{number:cs},__type__:{object:ps,boolean:ls,number:cs}},value:{number:cs,undefined:"undefined"},__type__:{object:ps}},groups:{useDefaultGroups:{boolean:ls},__any__:"get from nodes, will be overwritten below",__type__:{object:ps}},interaction:{dragNodes:{boolean:ls},dragView:{boolean:ls},hideEdgesOnDrag:{boolean:ls},hideEdgesOnZoom:{boolean:ls},hideNodesOnDrag:{boolean:ls},hover:{boolean:ls},keyboard:{enabled:{boolean:ls},speed:{x:{number:cs},y:{number:cs},zoom:{number:cs},__type__:{object:ps}},bindToWindow:{boolean:ls},__type__:{object:ps,boolean:ls}},multiselect:{boolean:ls},navigationButtons:{boolean:ls},selectable:{boolean:ls},selectConnectedEdges:{boolean:ls},hoverConnectedEdges:{boolean:ls},tooltipDelay:{number:cs},zoomView:{boolean:ls},zoomSpeed:{number:cs},__type__:{object:ps}},layout:{randomSeed:{undefined:"undefined",number:cs},improvedLayout:{boolean:ls},hierarchical:{enabled:{boolean:ls},levelSeparation:{number:cs},nodeSpacing:{number:cs},treeSpacing:{number:cs},blockShifting:{boolean:ls},edgeMinimization:{boolean:ls},parentCentralization:{boolean:ls},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},__type__:{object:ps,boolean:ls}},__type__:{object:ps}},manipulation:{enabled:{boolean:ls},initiallyActive:{boolean:ls},addNode:{boolean:ls,function:"function"},addEdge:{boolean:ls,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:ps,boolean:ls,function:"function"}},deleteNode:{boolean:ls,function:"function"},deleteEdge:{boolean:ls,function:"function"},controlNodeStyle:"get from nodes, will be overwritten below",__type__:{object:ps,boolean:ls}},nodes:{borderWidth:{number:cs},borderWidthSelected:{number:cs,undefined:"undefined"},brokenImage:{string:rs,undefined:"undefined"},chosen:{label:{boolean:ls,function:"function"},node:{boolean:ls,function:"function"},__type__:{object:ps,boolean:ls}},color:{border:{string:rs},background:{string:rs},highlight:{border:{string:rs},background:{string:rs},__type__:{object:ps,string:rs}},hover:{border:{string:rs},background:{string:rs},__type__:{object:ps,string:rs}},__type__:{object:ps,string:rs}},fixed:{x:{boolean:ls},y:{boolean:ls},__type__:{object:ps,boolean:ls}},font:{align:{string:rs},color:{string:rs},size:{number:cs},face:{string:rs},background:{string:rs},strokeWidth:{number:cs},strokeColor:{string:rs},vadjust:{number:cs},multi:{boolean:ls,string:rs},bold:{color:{string:rs},size:{number:cs},face:{string:rs},mod:{string:rs},vadjust:{number:cs},__type__:{object:ps,string:rs}},boldital:{color:{string:rs},size:{number:cs},face:{string:rs},mod:{string:rs},vadjust:{number:cs},__type__:{object:ps,string:rs}},ital:{color:{string:rs},size:{number:cs},face:{string:rs},mod:{string:rs},vadjust:{number:cs},__type__:{object:ps,string:rs}},mono:{color:{string:rs},size:{number:cs},face:{string:rs},mod:{string:rs},vadjust:{number:cs},__type__:{object:ps,string:rs}},__type__:{object:ps,string:rs}},group:{string:rs,number:cs,undefined:"undefined"},heightConstraint:{minimum:{number:cs},valign:{string:rs},__type__:{object:ps,boolean:ls,number:cs}},hidden:{boolean:ls},icon:{face:{string:rs},code:{string:rs},size:{number:cs},color:{string:rs},__type__:{object:ps}},id:{string:rs,number:cs},image:{selected:{string:rs,undefined:"undefined"},unselected:{string:rs,undefined:"undefined"},__type__:{object:ps,string:rs}},label:{string:rs,undefined:"undefined"},labelHighlightBold:{boolean:ls},level:{number:cs,undefined:"undefined"},margin:{top:{number:cs},right:{number:cs},bottom:{number:cs},left:{number:cs},__type__:{object:ps,number:cs}},mass:{number:cs},physics:{boolean:ls},scaling:{min:{number:cs},max:{number:cs},label:{enabled:{boolean:ls},min:{number:cs},max:{number:cs},maxVisible:{number:cs},drawThreshold:{number:cs},__type__:{object:ps,boolean:ls}},customScalingFunction:{function:"function"},__type__:{object:ps}},shadow:{enabled:{boolean:ls},color:{string:rs},size:{number:cs},x:{number:cs},y:{number:cs},__type__:{object:ps,boolean:ls}},shape:{string:["ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},shapeProperties:{borderDashes:{boolean:ls,array:us},borderRadius:{number:cs},interpolation:{boolean:ls},useImageSize:{boolean:ls},useBorderWithImage:{boolean:ls},__type__:{object:ps}},size:{number:cs},title:{string:rs,dom:hs,undefined:"undefined"},value:{number:cs,undefined:"undefined"},widthConstraint:{minimum:{number:cs},maximum:{number:cs},__type__:{object:ps,boolean:ls,number:cs}},x:{number:cs},y:{number:cs},__type__:{object:ps}},physics:{enabled:{boolean:ls},barnesHut:{gravitationalConstant:{number:cs},centralGravity:{number:cs},springLength:{number:cs},springConstant:{number:cs},damping:{number:cs},avoidOverlap:{number:cs},__type__:{object:ps}},forceAtlas2Based:{gravitationalConstant:{number:cs},centralGravity:{number:cs},springLength:{number:cs},springConstant:{number:cs},damping:{number:cs},avoidOverlap:{number:cs},__type__:{object:ps}},repulsion:{centralGravity:{number:cs},springLength:{number:cs},springConstant:{number:cs},nodeDistance:{number:cs},damping:{number:cs},__type__:{object:ps}},hierarchicalRepulsion:{centralGravity:{number:cs},springLength:{number:cs},springConstant:{number:cs},nodeDistance:{number:cs},damping:{number:cs},__type__:{object:ps}},maxVelocity:{number:cs},minVelocity:{number:cs},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:ls},iterations:{number:cs},updateInterval:{number:cs},onlyDynamicEdges:{boolean:ls},fit:{boolean:ls},__type__:{object:ps,boolean:ls}},timestep:{number:cs},adaptiveTimestep:{boolean:ls},__type__:{object:ps,boolean:ls}},autoResize:{boolean:ls},clickToUse:{boolean:ls},locale:{string:rs},locales:{__any__:{any:"any"},__type__:{object:ps}},height:{string:rs},width:{string:rs},__type__:{object:ps}};gs.groups.__any__=gs.nodes,gs.manipulation.controlNodeStyle=gs.nodes;var ys={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,1,1,1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01]}},fs=Object.freeze({allOptions:gs,configureOptions:ys}),bs=function(){function e(){pa(this,e)}return ha(e,[{key:"getDistances",value:function(e,t,o){for(var n={},a=e.edges,d=0;d<t.length;d++){var s=t[d],r={};n[s]=r;for(var l=0;l<t.length;l++)r[t[l]]=d==l?0:1e9}for(var c=0,u;c<o.length;c++)u=a[o[c]],!0===u.connected&&void 0!==n[u.fromId]&&void 0!==n[u.toId]&&(n[u.fromId][u.toId]=1,n[u.toId][u.fromId]=1);for(var p=t.length,h=0;h<p;h++)for(var m=t[h],g=n[m],y=0;y<p-1;y++)for(var f=t[y],b=n[f],_=y+1;_<p;_++){var v=t[_],w=n[v],x=fo(b[v],b[m]+g[v]);b[v]=x,w[f]=x}return n}}]),e}(),_s=function(){function e(t,o,n){pa(this,e),this.body=t,this.springLength=o,this.springConstant=n,this.distanceSolver=new bs}return ha(e,[{key:"setOptions",value:function(e){e&&(e.springLength&&(this.springLength=e.springLength),e.springConstant&&(this.springConstant=e.springConstant))}},{key:"solve",value:function(e,t){var o=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],n=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(n),this._createK_matrix(n),this._createE_matrix();for(var i=0,a=yo(1e3,fo(10*this.body.nodeIndices.length,6e3)),d=1e9,s=0,r=0,l=0,c=0,u=0;d>.01&&i<a;){i+=1;var p=this._getHighestEnergyNode(o),h=va(p,4);for(s=h[0],d=h[1],r=h[2],l=h[3],c=d,u=0;c>1&&u<5;){u+=1,this._moveNode(s,r,l);var m=this._getEnergy(s),g=va(m,3);c=g[0],r=g[1],l=g[2]}}}},{key:"_getHighestEnergyNode",value:function(e){for(var t=this.body.nodeIndices,o=this.body.nodes,n=0,i=t[0],a=0,d=0,s=0,r;s<t.length;s++)if(r=t[s],!1===o[r].predefinedPosition||!0===o[r].isCluster&&!0===e||!0===o[r].options.fixed.x||!0===o[r].options.fixed.y){var l=this._getEnergy(r),c=va(l,3),u=c[0],p=c[1],h=c[2];n<u&&(n=u,i=r,a=p,d=h)}return[i,n,a,d]}},{key:"_getEnergy",value:function(e){var t=va(this.E_sums[e],2),o=t[0],n=t[1],i=mo(lo(o,2)+lo(n,2));return[i,o,n]}},{key:"_moveNode",value:function(e,t,o){for(var n=this.body.nodeIndices,a=this.body.nodes,d=0,s=0,r=0,l=a[e].x,c=a[e].y,u=this.K_matrix[e],p=this.L_matrix[e],h=0,m;h<n.length;h++)if(m=n[h],m!==e){var g=a[m].x,y=a[m].y,f=u[m],b=p[m],_=1/lo(lo(l-g,2)+lo(c-y,2),1.5);d+=f*(1-b*lo(c-y,2)*_),s+=f*(b*(l-g)*(c-y)*_),r+=f*(1-b*lo(l-g,2)*_)}var v=d,k=s,w=t,x=r,S=(w/v+o/k)/(k/v-x/k);a[e].x+=-(k*S+w)/v,a[e].y+=S,this._updateE_matrix(e)}},{key:"_createL_matrix",value:function(e){var t=this.body.nodeIndices,o=this.springLength;this.L_matrix=[];for(var n=0;n<t.length;n++){this.L_matrix[t[n]]={};for(var a=0;a<t.length;a++)this.L_matrix[t[n]][t[a]]=o*e[t[n]][t[a]]}}},{key:"_createK_matrix",value:function(e){var t=this.body.nodeIndices,o=this.springConstant;this.K_matrix=[];for(var n=0;n<t.length;n++){this.K_matrix[t[n]]={};for(var a=0;a<t.length;a++)this.K_matrix[t[n]][t[a]]=o*lo(e[t[n]][t[a]],-2)}}},{key:"_createE_matrix",value:function(){var e=this.body.nodeIndices,t=this.body.nodes;this.E_matrix={},this.E_sums={};for(var o=0;o<e.length;o++)this.E_matrix[e[o]]=[];for(var n=0;n<e.length;n++){for(var a=e[n],d=t[a].x,s=t[a].y,r=0,l=0,c=n,u;c<e.length;c++)if(u=e[c],u!==a){var p=t[u].x,h=t[u].y,m=1/mo(lo(d-p,2)+lo(s-h,2));this.E_matrix[a][c]=[this.K_matrix[a][u]*(d-p-this.L_matrix[a][u]*(d-p)*m),this.K_matrix[a][u]*(s-h-this.L_matrix[a][u]*(s-h)*m)],this.E_matrix[u][n]=this.E_matrix[a][c],r+=this.E_matrix[a][c][0],l+=this.E_matrix[a][c][1]}this.E_sums[a]=[r,l]}}},{key:"_updateE_matrix",value:function(e){for(var t=this.body.nodeIndices,o=this.body.nodes,n=this.E_matrix[e],a=this.K_matrix[e],d=this.L_matrix[e],s=o[e].x,r=o[e].y,l=0,c=0,u=0,p;u<t.length;u++)if(p=t[u],p!==e){var h=n[u],m=h[0],g=h[1],y=o[p].x,f=o[p].y,b=1/mo(lo(s-y,2)+lo(r-f,2)),_=a[p]*(s-y-d[p]*(s-y)*b),v=a[p]*(r-f-d[p]*(r-f)*b);n[u]=[_,v],l+=_,c+=v;var k=this.E_sums[p];k[0]+=_-m,k[1]+=v-g}this.E_sums[e]=[l,c]}}]),e}();Tn(io.prototype),io.prototype.setOptions=function(e){var t=this;if(null===e&&(e=void 0),void 0!==e){var o=ed.validate(e,gs);!0===o&&console.log("%cErrors have been found in the supplied options object.",Ja);if(Wo.selectiveDeepExtend(["locale","locales","clickToUse"],this.options,e),e=this.layoutEngine.setOptions(e.layout,e),this.canvas.setOptions(e),this.groups.setOptions(e.groups),this.nodesHandler.setOptions(e.nodes),this.edgesHandler.setOptions(e.edges),this.physics.setOptions(e.physics),this.manipulation.setOptions(e.manipulation,e,this.options),this.interactionHandler.setOptions(e.interaction),this.renderer.setOptions(e.interaction),this.selectionHandler.setOptions(e.interaction),void 0!==e.groups&&this.body.emitter.emit("refreshNodes"),"configure"in e&&(!this.configurator&&(this.configurator=new ss(this,this.body.container,ys,this.canvas.pixelRatio)),this.configurator.setOptions(e.configure)),this.configurator&&!0===this.configurator.options.enabled){var n={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};Wo.deepExtend(n.nodes,this.nodesHandler.options),Wo.deepExtend(n.edges,this.edgesHandler.options),Wo.deepExtend(n.layout,this.layoutEngine.options),Wo.deepExtend(n.interaction,this.selectionHandler.options),Wo.deepExtend(n.interaction,this.renderer.options),Wo.deepExtend(n.interaction,this.interactionHandler.options),Wo.deepExtend(n.manipulation,this.manipulation.options),Wo.deepExtend(n.physics,this.physics.options),Wo.deepExtend(n.global,this.canvas.options),Wo.deepExtend(n.global,this.options),this.configurator.setModuleOptions(n)}void 0===e.clickToUse?this.body.emitter.emit("activate"):!0===e.clickToUse?void 0===this.activator&&(this.activator=new $t(this.canvas.frame),this.activator.on("change",function(){t.body.emitter.emit("activate")})):(void 0!==this.activator&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}},io.prototype._updateVisibleIndices=function(){var e=this.body.nodes,t=this.body.edges;for(var o in this.body.nodeIndices=[],this.body.edgeIndices=[],e)e.hasOwnProperty(o)&&(this.clustering._isClusteredNode(o)||!1!==e[o].options.hidden||this.body.nodeIndices.push(e[o].id));for(var n in t)if(t.hasOwnProperty(n)){var i=t[n],a=e[i.fromId],d=e[i.toId],s=!this.clustering._isClusteredEdge(n)&&!1===i.options.hidden&&void 0!==a&&void 0!==d&&!1===a.options.hidden&&!1===d.options.hidden;s&&this.body.edgeIndices.push(i.id)}},io.prototype.bindEventListeners=function(){var e=this;this.body.emitter.on("_dataChanged",function(){e.edgesHandler._updateState(),e.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",function(){e.clustering._updateState(),e._updateVisibleIndices(),e._updateValueRange(e.body.nodes),e._updateValueRange(e.body.edges),e.body.emitter.emit("startSimulation"),e.body.emitter.emit("_requestRedraw")})},io.prototype.setData=function(e){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),e&&e.dot&&(e.nodes||e.edges))throw new SyntaxError("Data must contain either parameter \"dot\" or parameter pair \"nodes\" and \"edges\", but not both.");if(this.setOptions(e&&e.options),e&&e.dot){console.log("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");var t=Ln.DOTToGraph(e.dot);return void this.setData(t)}if(e&&e.gephi){console.log("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");var o=dt(e.gephi);return void this.setData(o)}this.nodesHandler.setData(e&&e.nodes,!0),this.edgesHandler.setData(e&&e.edges,!0),this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")},io.prototype.destroy=function(){for(var e in this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images,this.body.nodes)this.body.nodes.hasOwnProperty(e)&&delete this.body.nodes[e];for(var t in this.body.edges)this.body.edges.hasOwnProperty(t)&&delete this.body.edges[t];Wo.recursiveDOMDelete(this.body.container)},io.prototype._updateValueRange=function(e){var t=void 0,o=void 0,n=0,i;for(i in e)if(e.hasOwnProperty(i)){var a=e[i].getValue();a!==void 0&&(t=t===void 0?a:fo(a,t),o=o===void 0?a:yo(a,o),n+=a)}if(t!==void 0&&o!==void 0)for(i in e)e.hasOwnProperty(i)&&e[i].setValueRange(t,o,n)},io.prototype.isActive=function(){return!this.activator||this.activator.active},io.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},io.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},io.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},io.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},io.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},io.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},io.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},io.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},io.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},io.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},io.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},io.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},io.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},io.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},io.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},io.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},io.prototype.editNodeMode=function(){return console.log("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},io.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},io.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},io.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},io.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},io.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},io.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},io.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},io.prototype.getConnectedNodes=function(e){return void 0===this.body.nodes[e]?this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments):this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments)},io.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},io.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},io.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},io.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},io.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},io.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},io.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodes.apply(this.selectionHandler,arguments)},io.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdges.apply(this.selectionHandler,arguments)},io.prototype.getNodeAt=function(){var e=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return void 0!==e&&void 0!==e.id?e.id:e},io.prototype.getEdgeAt=function(){var e=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return void 0!==e&&void 0!==e.id?e.id:e},io.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},io.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},io.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.redraw()},io.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},io.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},io.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},io.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},io.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},io.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},io.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},io.prototype.getOptionsFromConfigurator=function(){var e={};return this.configurator&&(e=this.configurator.getOptions.apply(this.configurator)),e};var vs=ze(function(e,t){t.prepareElements=function(e){for(var t in e)e.hasOwnProperty(t)&&(e[t].redundant=e[t].used,e[t].used=[])},t.cleanupElements=function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t].redundant){for(var o=0;o<e[t].redundant.length;o++)e[t].redundant[o].parentNode.removeChild(e[t].redundant[o]);e[t].redundant=[]}},t.resetElements=function(e){t.prepareElements(e),t.cleanupElements(e),t.prepareElements(e)},t.getSVGElement=function(e,t,o){var n;return t.hasOwnProperty(e)?0<t[e].redundant.length?(n=t[e].redundant[0],t[e].redundant.shift()):(n=document.createElementNS("http://www.w3.org/2000/svg",e),o.appendChild(n)):(n=document.createElementNS("http://www.w3.org/2000/svg",e),t[e]={used:[],redundant:[]},o.appendChild(n)),t[e].used.push(n),n},t.getDOMElement=function(e,t,o,n){var i;return t.hasOwnProperty(e)?0<t[e].redundant.length?(i=t[e].redundant[0],t[e].redundant.shift()):(i=document.createElement(e),void 0===n?o.appendChild(i):o.insertBefore(i,n)):(i=document.createElement(e),t[e]={used:[],redundant:[]},void 0===n?o.appendChild(i):o.insertBefore(i,n)),t[e].used.push(i),i},t.drawPoint=function(e,o,n,i,a,d){var s;if("circle"==n.style?(s=t.getSVGElement("circle",i,a),s.setAttributeNS(null,"cx",e),s.setAttributeNS(null,"cy",o),s.setAttributeNS(null,"r",.5*n.size)):(s=t.getSVGElement("rect",i,a),s.setAttributeNS(null,"x",e-.5*n.size),s.setAttributeNS(null,"y",o-.5*n.size),s.setAttributeNS(null,"width",n.size),s.setAttributeNS(null,"height",n.size)),void 0!==n.styles&&s.setAttributeNS(null,"style",n.styles),s.setAttributeNS(null,"class",n.className+" vis-point"),d){var r=t.getSVGElement("text",i,a);d.xOffset&&(e+=d.xOffset),d.yOffset&&(o+=d.yOffset),d.content&&(r.textContent=d.content),d.className&&r.setAttributeNS(null,"class",d.className+" vis-label"),r.setAttributeNS(null,"x",e),r.setAttributeNS(null,"y",o)}return s},t.drawBar=function(e,o,n,i,a,d,s,r){if(0!=i){0>i&&(i*=-1,o-=i);var l=t.getSVGElement("rect",d,s);l.setAttributeNS(null,"x",e-.5*n),l.setAttributeNS(null,"y",o),l.setAttributeNS(null,"width",n),l.setAttributeNS(null,"height",i),l.setAttributeNS(null,"class",a),r&&l.setAttributeNS(null,"style",r)}}}),ks=vs.prepareElements,ws=vs.cleanupElements,xs=vs.resetElements,Ss=vs.getSVGElement,Os=vs.getDOMElement,Ds=vs.drawPoint,Ts=vs.drawBar,Cs=Object.freeze({default:vs,__moduleExports:vs,prepareElements:ks,cleanupElements:ws,resetElements:xs,getSVGElement:Ss,getDOMElement:Os,drawPoint:Ds,drawBar:Ts}),Es=ze(function(e){(function(t,o){e.exports=o()})(Dn,function(){function t(){return Ht.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function i(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function a(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function s(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function r(e,t){var o=[],n;for(n=0;n<e.length;++n)o.push(t(e[n],n));return o}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){for(var o in t)l(t,o)&&(e[o]=t[o]);return l(t,"toString")&&(e.toString=t.toString),l(t,"valueOf")&&(e.valueOf=t.valueOf),e}function u(e,t,o,n){return Xe(e,t,o,n,!0).utc()}function p(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function h(e){return null==e._pf&&(e._pf=p()),e._pf}function m(e){if(null==e._isValid){var t=h(e),o=Lt.call(t.parsedDateParts,function(e){return null!=e}),n=!isNaN(e._d.getTime())&&0>t.overflow&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&o);if(e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null==Object.isFrozen||!Object.isFrozen(e))e._isValid=n;else return n}return e._isValid}function g(e){var t=u(NaN);return null==e?h(t).userInvalidated=!0:c(h(t),e),t}function y(e,t){var o,n,d;if(a(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),a(t._i)||(e._i=t._i),a(t._f)||(e._f=t._f),a(t._l)||(e._l=t._l),a(t._strict)||(e._strict=t._strict),a(t._tzm)||(e._tzm=t._tzm),a(t._isUTC)||(e._isUTC=t._isUTC),a(t._offset)||(e._offset=t._offset),a(t._pf)||(e._pf=h(t)),a(t._locale)||(e._locale=t._locale),0<At.length)for(o=0;o<At.length;o++)n=At[o],d=t[n],a(d)||(e[n]=d);return e}function f(e){y(this,e),this._d=new Date(null==e._d?NaN:e._d.getTime()),this.isValid()||(this._d=new Date(NaN)),!1===Wt&&(Wt=!0,t.updateOffset(this),Wt=!1)}function b(e){return e instanceof f||null!=e&&null!=e._isAMomentObject}function _(e){return 0>e?co(e)||0:go(e)}function v(e){var t=+e,o=0;return 0!=t&&isFinite(t)&&(o=_(t)),o}function k(e,t,o){var n=fo(e.length,t.length),a=uo(e.length-t.length),d=0,s;for(s=0;s<n;s++)(o&&e[s]!==t[s]||!o&&v(e[s])!==v(t[s]))&&d++;return d+a}function w(e){!1===t.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function x(e,o){var n=!0;return c(function(){if(null!=t.deprecationHandler&&t.deprecationHandler(null,e),n){for(var a=[],d=0,s;d<arguments.length;d++){if(s="","object"==typeof arguments[d]){for(var r in s+="\n["+d+"] ",arguments[0])s+=r+": "+arguments[0][r]+", ";s=s.slice(0,-2)}else s=arguments[d];a.push(s)}w(e+"\nArguments: "+Array.prototype.slice.call(a).join("")+"\n"+new Error().stack),n=!1}return o.apply(this,arguments)},o)}function S(e,o){null!=t.deprecationHandler&&t.deprecationHandler(e,o),jt[e]||(w(o),jt[e]=!0)}function O(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function D(e){var t,o;for(o in e)t=e[o],O(t)?this[o]=t:this["_"+o]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function T(e,t){var o=c({},e),i;for(i in t)l(t,i)&&(n(e[i])&&n(t[i])?(o[i]={},c(o[i],e[i]),c(o[i],t[i])):null==t[i]?delete o[i]:o[i]=t[i]);for(i in e)l(e,i)&&!l(t,i)&&n(e[i])&&(o[i]=c({},o[i]));return o}function C(e){null!=e&&this.set(e)}function E(e,t){var o=e.toLowerCase();Gt[o]=Gt[o+"s"]=Gt[t]=e}function M(e){return"string"==typeof e?Gt[e]||Gt[e.toLowerCase()]:void 0}function I(e){var t={},o,n;for(n in e)l(e,n)&&(o=M(n),o&&(t[o]=e[n]));return t}function P(e,t){qt[e]=t}function F(e){var t=[];for(var o in e)t.push({unit:o,priority:qt[o]});return t.sort(function(e,t){return e.priority-t.priority}),t}function Y(e,t,o){var n=""+uo(e),i=t-n.length;return(0<=e?o?"+":"":"-")+lo(10,yo(0,i)).toString().substr(1)+n}function z(e,t,o,n){var i=n;"string"==typeof n&&(i=function(){return this[n]()}),e&&(Qt[e]=i),t&&(Qt[t[0]]=function(){return Y(i.apply(this,arguments),t[1],t[2])}),o&&(Qt[o]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function N(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function R(e){var t=e.match(Zt),o,n;for(o=0,n=t.length;o<n;o++)t[o]=Qt[t[o]]?Qt[t[o]]:N(t[o]);return function(o){var a="",d;for(d=0;d<n;d++)a+=O(t[d])?t[d].call(o,e):t[d];return a}}function B(e,t){return e.isValid()?(t=H(t,e.localeData()),Kt[t]=Kt[t]||R(t),Kt[t](e)):e.localeData().invalidDate()}function H(e,t){function o(e){return t.longDateFormat(e)||e}var n=5;for(Xt.lastIndex=0;0<=n&&Xt.test(e);)e=e.replace(Xt,o),Xt.lastIndex=0,n-=1;return e}function L(e,t,o){xo[e]=O(t)?t:function(e){return e&&o?o:t}}function A(e,t){return l(xo,e)?xo[e](t._strict,t._locale):new RegExp(W(e))}function W(e){return j(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,o,n,i){return t||o||n||i}))}function j(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function U(e,t){var o=t,n;for("string"==typeof e&&(e=[e]),d(t)&&(o=function(e,o){o[t]=v(e)}),n=0;n<e.length;n++)So[e[n]]=o}function V(e,t){U(e,function(e,o,n,i){n._w=n._w||{},t(e,n._w,n,i)})}function G(e,t,o){null!=t&&l(So,e)&&So[e](t,o._a,o,e)}function q(e){return Z(e)?366:365}function Z(e){return 0==e%4&&0!=e%100||0==e%400}function X(e,o){return function(n){return null==n?K(this,e):(Q(this,e,n),t.updateOffset(this,o),this)}}function K(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Q(e,t,o){e.isValid()&&!isNaN(o)&&("FullYear"===t&&Z(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](o,e.month(),ee(o,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](o))}function $(e,t){if("object"==typeof e){e=I(e);for(var o=F(e),n=0;n<o.length;n++)this[o[n].unit](e[o[n].unit])}else if(e=M(e),O(this[e]))return this[e](t);return this}function J(e,t){return(e%t+t)%t}function ee(e,t){if(isNaN(e)||isNaN(t))return NaN;var o=J(t,12);return e+=(t-o)/12,1===o?Z(e)?29:28:31-o%7%2}function te(e,t,o){var n=e.toLocaleLowerCase(),a,d,s;if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],a=0;12>a;++a)s=u([2e3,a]),this._shortMonthsParse[a]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[a]=this.months(s,"").toLocaleLowerCase();return o?"MMM"===t?(d=Po.call(this._shortMonthsParse,n),-1===d?null:d):(d=Po.call(this._longMonthsParse,n),-1===d?null:d):"MMM"===t?(d=Po.call(this._shortMonthsParse,n),-1!==d)?d:(d=Po.call(this._longMonthsParse,n),-1===d?null:d):(d=Po.call(this._longMonthsParse,n),-1!==d)?d:(d=Po.call(this._shortMonthsParse,n),-1===d?null:d)}function oe(e,t,o){var n,a,d;if(this._monthsParseExact)return te.call(this,e,t,o);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;12>n;n++){if(a=u([2e3,n]),o&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),o||this._monthsParse[n]||(d="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[n]=new RegExp(d.replace(".",""),"i")),o&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(o&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!o&&this._monthsParse[n].test(e))return n}}function ne(e,t){var o;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=v(t);else if(t=e.localeData().monthsParse(t),!d(t))return e;return o=fo(e.date(),ee(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,o),e}function ie(e){return null==e?K(this,"Month"):(ne(this,e),t.updateOffset(this,!0),this)}function ae(){function e(e,t){return t.length-e.length}var t=[],o=[],n=[],a,d;for(a=0;12>a;a++)d=u([2e3,a]),t.push(this.monthsShort(d,"")),o.push(this.months(d,"")),n.push(this.months(d,"")),n.push(this.monthsShort(d,""));for(t.sort(e),o.sort(e),n.sort(e),a=0;12>a;a++)t[a]=j(t[a]),o[a]=j(o[a]);for(a=0;24>a;a++)n[a]=j(n[a]);this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function de(e,t,o,n,i,a,d){var s;return 100>e&&0<=e?(s=new Date(e+400,t,o,n,i,a,d),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,o,n,i,a,d),s}function se(e){var t;if(100>e&&0<=e){var o=Array.prototype.slice.call(arguments);o[0]=e+400,t=new Date(Date.UTC.apply(null,o)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function re(e,t,o){var n=7+t-o,i=(7+se(e,0,n).getUTCDay()-t)%7;return-i+n-1}function le(e,t,o,n,i){var a=re(e,n,i),d=1+7*(t-1)+(7+o-n)%7+a,s,r;return 0>=d?(s=e-1,r=q(s)+d):d>q(e)?(s=e+1,r=d-q(e)):(s=e,r=d),{year:s,dayOfYear:r}}function ce(e,t,o){var n=re(e.year(),t,o),i=go((e.dayOfYear()-n-1)/7)+1,a,d;return 1>i?(d=e.year()-1,a=i+ue(d,t,o)):i>ue(e.year(),t,o)?(a=i-ue(e.year(),t,o),d=e.year()+1):(d=e.year(),a=i),{week:a,year:d}}function ue(e,t,o){var n=re(e,t,o),i=re(e+1,t,o);return(q(e)-n+i)/7}function pe(e,t){return"string"==typeof e?isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10):e}function he(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function me(e,t){return e.slice(t,7).concat(e.slice(0,t))}function ge(e,t,o){var n=e.toLocaleLowerCase(),a,d,s;if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],a=0;7>a;++a)s=u([2e3,1]).day(a),this._minWeekdaysParse[a]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[a]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[a]=this.weekdays(s,"").toLocaleLowerCase();return o?"dddd"===t?(d=Po.call(this._weekdaysParse,n),-1===d?null:d):"ddd"===t?(d=Po.call(this._shortWeekdaysParse,n),-1===d?null:d):(d=Po.call(this._minWeekdaysParse,n),-1===d?null:d):"dddd"===t?(d=Po.call(this._weekdaysParse,n),-1!==d)?d:(d=Po.call(this._shortWeekdaysParse,n),-1!==d)?d:(d=Po.call(this._minWeekdaysParse,n),-1===d?null:d):"ddd"===t?(d=Po.call(this._shortWeekdaysParse,n),-1!==d)?d:(d=Po.call(this._weekdaysParse,n),-1!==d)?d:(d=Po.call(this._minWeekdaysParse,n),-1===d?null:d):(d=Po.call(this._minWeekdaysParse,n),-1!==d)?d:(d=Po.call(this._weekdaysParse,n),-1!==d)?d:(d=Po.call(this._shortWeekdaysParse,n),-1===d?null:d)}function ye(e,t,o){var n,a,d;if(this._weekdaysParseExact)return ge.call(this,e,t,o);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;7>n;n++){if(a=u([2e3,1]).day(n),o&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(d="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[n]=new RegExp(d.replace(".",""),"i")),o&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(o&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(o&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!o&&this._weekdaysParse[n].test(e))return n}}function fe(){function e(e,t){return t.length-e.length}var t=[],o=[],n=[],a=[],d,s,r,l,c;for(d=0;7>d;d++)s=u([2e3,1]).day(d),r=this.weekdaysMin(s,""),l=this.weekdaysShort(s,""),c=this.weekdays(s,""),t.push(r),o.push(l),n.push(c),a.push(r),a.push(l),a.push(c);for(t.sort(e),o.sort(e),n.sort(e),a.sort(e),d=0;7>d;d++)o[d]=j(o[d]),n[d]=j(n[d]),a[d]=j(a[d]);this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function be(){return this.hours()%12||12}function _e(e,t){z(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function ve(e,t){return t._meridiemParse}function ke(e){return e?e.toLowerCase().replace("_","-"):e}function we(e){for(var t=0,o,n,a,d;t<e.length;){for(d=ke(e[t]).split("-"),o=d.length,n=ke(e[t+1]),n=n?n.split("-"):null;0<o;){if(a=xe(d.slice(0,o).join("-")),a)return a;if(n&&n.length>=o&&k(d,n,!0)>=o-1)break;o--}t++}return Xo}function xe(t){var o=null;if(!Ho[t]&&!0&&e&&e.exports)try{o=Xo._abbr;Ye("./locale/"+t),Se(o)}catch(t){}return Ho[t]}function Se(e,t){var o;return e&&(o=a(t)?De(e):Oe(e,t),o?Xo=o:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Xo._abbr}function Oe(e,t){if(null!==t){var o=Bo,n;if(t.abbr=e,null!=Ho[e])S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),o=Ho[e]._config;else if(null!=t.parentLocale)if(null!=Ho[t.parentLocale])o=Ho[t.parentLocale]._config;else if(n=xe(t.parentLocale),null!=n)o=n._config;else return Lo[t.parentLocale]||(Lo[t.parentLocale]=[]),Lo[t.parentLocale].push({name:e,config:t}),null;return Ho[e]=new C(T(o,t)),Lo[e]&&Lo[e].forEach(function(e){Oe(e.name,e.config)}),Se(e),Ho[e]}return delete Ho[e],null}function De(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Xo;if(!o(e)){if(t=xe(e),t)return t;e=[e]}return we(e)}function Te(){return Ut(Ho)}function Ce(e){var t=e._a,o;return t&&-2===h(e).overflow&&(o=0>t[1]||11<t[1]?1:1>t[2]||t[2]>ee(t[0],t[1])?2:0>t[3]||24<t[3]||24===t[3]&&(0!==t[4]||0!==t[5]||0!==t[6])?3:0>t[4]||59<t[4]?4:0>t[5]||59<t[5]?5:0>t[6]||999<t[6]?6:-1,h(e)._overflowDayOfYear&&(0>o||2<o)&&(o=2),h(e)._overflowWeeks&&-1===o&&(o=7),h(e)._overflowWeekday&&-1===o&&(o=8),h(e).overflow=o),e}function Ee(e,t,o){return null==e?null==t?o:t:e}function Me(e){var o=new Date(t.now());return e._useUTC?[o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()]:[o.getFullYear(),o.getMonth(),o.getDate()]}function Ie(e){var t=[],o,n,a,d,s;if(!e._d){for(a=Me(e),e._w&&null==e._a[2]&&null==e._a[1]&&Pe(e),null!=e._dayOfYear&&(s=Ee(e._a[0],a[0]),(e._dayOfYear>q(s)||0===e._dayOfYear)&&(h(e)._overflowDayOfYear=!0),n=se(s,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),o=0;3>o&&null==e._a[o];++o)e._a[o]=t[o]=a[o];for(;7>o;o++)e._a[o]=t[o]=null==e._a[o]?2===o?1:0:e._a[o];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?se:de).apply(null,t),d=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&"undefined"!=typeof e._w.d&&e._w.d!==d&&(h(e).weekdayMismatch=!0)}}function Pe(e){var t,o,n,i,a,d,s,r;if(t=e._w,null!=t.GG||null!=t.W||null!=t.E)a=1,d=4,o=Ee(t.GG,e._a[0],ce(Ke(),1,4).year),n=Ee(t.W,1),i=Ee(t.E,1),(1>i||7<i)&&(r=!0);else{a=e._locale._week.dow,d=e._locale._week.doy;var l=ce(Ke(),a,d);o=Ee(t.gg,e._a[0],l.year),n=Ee(t.w,l.week),null==t.d?null==t.e?i=a:(i=t.e+a,(0>t.e||6<t.e)&&(r=!0)):(i=t.d,(0>i||6<i)&&(r=!0))}1>n||n>ue(o,a,d)?h(e)._overflowWeeks=!0:null==r?(s=le(o,n,i,a,d),e._a[0]=s.year,e._dayOfYear=s.dayOfYear):h(e)._overflowWeekday=!0}function Fe(e){var t=e._i,o=Ao.exec(t)||Wo.exec(t),n,a,d,s,r,c;if(o){for(h(e).iso=!0,n=0,a=Uo.length;n<a;n++)if(Uo[n][1].exec(o[1])){s=Uo[n][0],d=!1!==Uo[n][2];break}if(null==s)return void(e._isValid=!1);if(o[3]){for(n=0,a=Vo.length;n<a;n++)if(Vo[n][1].exec(o[3])){r=(o[2]||" ")+Vo[n][0];break}if(null==r)return void(e._isValid=!1)}if(!d&&null!=r)return void(e._isValid=!1);if(o[4])if(jo.exec(o[4]))c="Z";else return void(e._isValid=!1);e._f=s+(r||"")+(c||""),We(e)}else e._isValid=!1}function ze(e,t,o,n,i,a){var d=[Ne(e),Yo.indexOf(t),parseInt(o,10),parseInt(n,10),parseInt(i,10)];return a&&d.push(parseInt(a,10)),d}function Ne(e){var t=parseInt(e,10);return 49>=t?2e3+t:999>=t?1900+t:t}function Re(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Be(e,t,o){if(e){var n=zo.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(n!==i)return h(o).weekdayMismatch=!0,o._isValid=!1,!1}return!0}function He(e,t,o){if(e)return Zo[e];if(t)return 0;var n=parseInt(o,10),i=n%100;return 60*((n-i)/100)+i}function Le(e){var t=qo.exec(Re(e._i));if(t){var o=ze(t[4],t[3],t[2],t[5],t[6],t[7]);if(!Be(t[1],o,e))return;e._a=o,e._tzm=He(t[8],t[9],t[10]),e._d=se.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function Ae(e){var o=Go.exec(e._i);if(null!==o)return void(e._d=new Date(+o[1]));if(Fe(e),!1===e._isValid)delete e._isValid;else return;if(Le(e),!1===e._isValid)delete e._isValid;else return;t.createFromInputFallback(e)}function We(e){if(e._f===t.ISO_8601)return void Fe(e);if(e._f===t.RFC_2822)return void Le(e);e._a=[],h(e).empty=!0;var o=""+e._i,n=o.length,a=0,d,s,r,l,c;for(r=H(e._f,e._locale).match(Zt)||[],d=0;d<r.length;d++)l=r[d],s=(o.match(A(l,e))||[])[0],s&&(c=o.substr(0,o.indexOf(s)),0<c.length&&h(e).unusedInput.push(c),o=o.slice(o.indexOf(s)+s.length),a+=s.length),Qt[l]?(s?h(e).empty=!1:h(e).unusedTokens.push(l),G(l,s,e)):e._strict&&!s&&h(e).unusedTokens.push(l);h(e).charsLeftOver=n-a,0<o.length&&h(e).unusedInput.push(o),12>=e._a[3]&&!0===h(e).bigHour&&0<e._a[3]&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[3]=je(e._locale,e._a[3],e._meridiem),Ie(e),Ce(e)}function je(e,t,o){var n;return null==o?t:null==e.meridiemHour?null==e.isPM?t:(n=e.isPM(o),n&&12>t&&(t+=12),n||12!==t||(t=0),t):e.meridiemHour(t,o)}function Ue(e){var t,o,n,a,d;if(0===e._f.length)return h(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;a<e._f.length;a++)(d=0,t=y({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],We(t),!!m(t))&&(d+=h(t).charsLeftOver,d+=10*h(t).unusedTokens.length,h(t).score=d,(null==n||d<n)&&(n=d,o=t));c(e,o||t)}function Ve(e){if(!e._d){var t=I(e._i);e._a=r([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Ie(e)}}function Ge(e){var t=new f(Ce(qe(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function qe(e){var t=e._i,n=e._f;return(e._locale=e._locale||De(e._l),null===t||void 0===n&&""===t)?g({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),b(t))?new f(Ce(t)):(s(t)?e._d=t:o(n)?Ue(e):n?We(e):Ze(e),m(e)||(e._d=null),e)}function Ze(e){var i=e._i;a(i)?e._d=new Date(t.now()):s(i)?e._d=new Date(i.valueOf()):"string"==typeof i?Ae(e):o(i)?(e._a=r(i.slice(0),function(e){return parseInt(e,10)}),Ie(e)):n(i)?Ve(e):d(i)?e._d=new Date(i):t.createFromInputFallback(e)}function Xe(e,t,a,d,s){var r={};return(!0===a||!1===a)&&(d=a,a=void 0),(n(e)&&i(e)||o(e)&&0===e.length)&&(e=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=s,r._l=a,r._i=e,r._f=t,r._strict=d,Ge(r)}function Ke(e,t,o,n){return Xe(e,t,o,n,!1)}function Qe(e,t){var n,a;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Ke();for(n=t[0],a=1;a<t.length;++a)(!t[a].isValid()||t[a][e](n))&&(n=t[a]);return n}function $e(e){for(var t in e)if(-1===Po.call($o,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var o=!1,n=0;n<$o.length;++n)if(e[$o[n]]){if(o)return!1;parseFloat(e[$o[n]])!==v(e[$o[n]])&&(o=!0)}return!0}function Je(e){var t=I(e),o=t.year||0,n=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,d=t.day||0,s=t.hour||0,r=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=$e(t),this._milliseconds=+c+1e3*l+6e4*r+60*(60*(1e3*s)),this._days=+d+7*a,this._months=+i+3*n+12*o,this._data={},this._locale=De(),this._bubble()}function et(e){return e instanceof Je}function tt(e){return 0>e?-1*ro(-1*e):ro(e)}function ot(e,t){z(e,0,0,function(){var e=this.utcOffset(),o="+";return 0>e&&(e=-e,o="-"),o+Y(~~(e/60),2)+t+Y(~~e%60,2)})}function nt(e,t){var o=(t||"").match(e);if(null===o)return null;var n=o[o.length-1]||[],i=(n+"").match(Jo)||["-",0,0],a=+(60*i[1])+v(i[2]);return 0===a?0:"+"===i[0]?a:-a}function it(e,o){var n,i;return o._isUTC?(n=o.clone(),i=(b(e)||s(e)?e.valueOf():Ke(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),t.updateOffset(n,!1),n):Ke(e).local()}function at(e){return 15*-ro(e._d.getTimezoneOffset()/15)}function dt(){if(!a(this._isDSTShifted))return this._isDSTShifted;var e={};if(y(e,this),e=qe(e),e._a){var t=e._isUTC?u(e._a):Ke(e._a);this._isDSTShifted=this.isValid()&&0<k(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted}function st(){return!!this.isValid()&&this._isUTC&&0===this._offset}function rt(e,t){var o=e,n=null,i,a,s;return et(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:d(e)?(o={},t?o[t]=e:o.milliseconds=e):(n=en.exec(e))?(i="-"===n[1]?-1:1,o={y:0,d:v(n[2])*i,h:v(n[3])*i,m:v(n[4])*i,s:v(n[5])*i,ms:v(tt(1e3*n[6]))*i}):(n=tn.exec(e))?(i="-"===n[1]?-1:1,o={y:lt(n[2],i),M:lt(n[3],i),w:lt(n[4],i),d:lt(n[5],i),h:lt(n[6],i),m:lt(n[7],i),s:lt(n[8],i)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(s=ut(Ke(o.from),Ke(o.to)),o={},o.ms=s.milliseconds,o.M=s.months),a=new Je(o),et(e)&&l(e,"_locale")&&(a._locale=e._locale),a}function lt(e,t){var o=e&&parseFloat(e.replace(",","."));return(isNaN(o)?0:o)*t}function ct(e,t){var o={};return o.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(o.months,"M").isAfter(t)&&--o.months,o.milliseconds=+t-+e.clone().add(o.months,"M"),o}function ut(e,t){var o;return e.isValid()&&t.isValid()?(t=it(t,e),e.isBefore(t)?o=ct(e,t):(o=ct(t,e),o.milliseconds=-o.milliseconds,o.months=-o.months),o):{milliseconds:0,months:0}}function pt(e,t){return function(o,n){var i,a;return null===n||isNaN(+n)||(S(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=o,o=n,n=a),o="string"==typeof o?+o:o,i=rt(o,n),ht(this,i,e),this}}function ht(e,o,n,i){var a=o._milliseconds,d=tt(o._days),s=tt(o._months);e.isValid()&&(i=null==i||i,s&&ne(e,K(e,"Month")+s*n),d&&Q(e,"Date",K(e,"Date")+d*n),a&&e._d.setTime(e._d.valueOf()+a*n),i&&t.updateOffset(e,d||s))}function mt(e,t){var o=12*(t.year()-e.year())+(t.month()-e.month()),n=e.clone().add(o,"months"),i,a;return 0>t-n?(i=e.clone().add(o-1,"months"),a=(t-n)/(n-i)):(i=e.clone().add(o+1,"months"),a=(t-n)/(i-n)),-(o+a)||0}function gt(e){var t;return void 0===e?this._locale._abbr:(t=De(e),null!=t&&(this._locale=t),this)}function yt(){return this._locale}function ft(e,t){return(e%t+t)%t}function bt(e,t,o){return 100>e&&0<=e?new Date(e+400,t,o)-12622780800000:new Date(e,t,o).valueOf()}function _t(e,t,o){return 100>e&&0<=e?Date.UTC(e+400,t,o)-12622780800000:Date.UTC(e,t,o)}function vt(e,t){z(0,[e,e.length],0,t)}function kt(e,t,o,n,i){var a;return null==e?ce(this,n,i).year:(a=ue(e,n,i),t>a&&(t=a),wt.call(this,e,t,o,n,i))}function wt(e,t,o,n,i){var a=le(e,t,o,n,i),d=se(a.year,0,a.dayOfYear);return this.year(d.getUTCFullYear()),this.month(d.getUTCMonth()),this.date(d.getUTCDate()),this}function xt(e,t){t[6]=v(1e3*("0."+e))}function St(e){return e}function Ot(e,t,o,n){var i=De(),a=u().set(n,t);return i[o](a,e)}function Dt(e,t,o){if(d(e)&&(t=e,e=void 0),e=e||"",null!=t)return Ot(e,t,o,"month");var n=[],a;for(a=0;12>a;a++)n[a]=Ot(e,a,o,"month");return n}function Tt(e,t,o,n){"boolean"==typeof e?(d(t)&&(o=t,t=void 0),t=t||""):(t=e,o=t,e=!1,d(t)&&(o=t,t=void 0),t=t||"");var a=De(),s=e?a._week.dow:0;if(null!=o)return Ot(t,(o+s)%7,n,"day");var r=[],l;for(l=0;7>l;l++)r[l]=Ot(t,(l+s)%7,n,"day");return r}function Ct(e,t,o,n){var i=rt(t,o);return e._milliseconds+=n*i._milliseconds,e._days+=n*i._days,e._months+=n*i._months,e._bubble()}function Et(e){return 0>e?go(e):co(e)}function Mt(e){return 4800*e/146097}function It(e){return 146097*e/4800}function Pt(e){return function(){return this.as(e)}}function Ft(e){return function(){return this.isValid()?this._data[e]:NaN}}function Yt(e,t,o,n,i){return i.relativeTime(t||1,!!o,e,n)}function zt(e,t,o){var n=rt(e).abs(),i=Mn(n.as("s")),d=Mn(n.as("m")),s=Mn(n.as("h")),r=Mn(n.as("d")),l=Mn(n.as("M")),c=Mn(n.as("y")),u=i<=In.ss&&["s",i]||i<In.s&&["ss",i]||1>=d&&["m"]||d<In.m&&["mm",d]||1>=s&&["h"]||s<In.h&&["hh",s]||1>=r&&["d"]||r<In.d&&["dd",r]||1>=l&&["M"]||l<In.M&&["MM",l]||1>=c&&["y"]||["yy",c];return u[2]=t,u[3]=0<+e,u[4]=o,Yt.apply(null,u)}function Nt(e){return void 0===e?Mn:"function"==typeof e&&(Mn=e,!0)}function Rt(e){return(0<e)-(0>e)||+e}function Bt(){if(!this.isValid())return this.localeData().invalidDate();var e=Pn(this._milliseconds)/1e3,t=Pn(this._days),o=Pn(this._months),n,i,a;n=_(e/60),i=_(n/60),e%=60,n%=60,a=_(o/12),o%=12;var d=a,r=o,l=t,c=i,u=n,p=e?e.toFixed(3).replace(/\.?0+$/,""):"",s=this.asSeconds();if(!s)return"P0D";var h=0>s?"-":"",m=Rt(this._months)===Rt(s)?"":"-",g=Rt(this._days)===Rt(s)?"":"-",y=Rt(this._milliseconds)===Rt(s)?"":"-";return h+"P"+(d?m+d+"Y":"")+(r?m+r+"M":"")+(l?g+l+"D":"")+(c||u||p?"T":"")+(c?y+c+"H":"")+(u?y+u+"M":"")+(p?y+p+"S":"")}var Ht,Lt;Lt=Array.prototype.some?Array.prototype.some:function(e){for(var o=Object(this),t=o.length>>>0,n=0;n<t;n++)if(n in o&&e.call(this,o[n],n,o))return!0;return!1};var At=t.momentProperties=[],Wt=!1,jt={};t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;var Ut=Object.keys?Object.keys:function(e){var t=[],o;for(o in e)l(e,o)&&t.push(o);return t};var Vt=/\d{1,2}/,Gt={},qt={},Zt=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Xt=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Kt={},Qt={},$t=/\d/,Jt=/\d\d/,eo=/\d{3}/,to=/\d{4}/,oo=/[+-]?\d{6}/,no=/\d\d?/,io=/\d\d\d\d?/,ao=/\d\d\d\d\d\d?/,so=/\d{1,3}/,po=/\d{1,4}/,ho=/[+-]?\d{1,6}/,mo=/\d+/,bo=/[+-]?\d+/,_o=/Z|[+-]\d\d:?\d\d/gi,vo=/Z|[+-]\d\d(?::?\d\d)?/gi,ko=/[+-]?\d+(\.\d{1,3})?/,wo=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,xo={},So={},Oo=0,Do=1,To=2,Co=3,Eo=4,Mo=5;z("Y",0,0,function(){var e=this.year();return 9999>=e?""+e:"+"+e}),z(0,["YY",2],0,function(){return this.year()%100}),z(0,["YYYY",4],0,"year"),z(0,["YYYYY",5],0,"year"),z(0,["YYYYYY",6,!0],0,"year"),E("year","y"),P("year",1),L("Y",bo),L("YY",no,Jt),L("YYYY",po,to),L("YYYYY",ho,oo),L("YYYYYY",ho,oo),U(["YYYYY","YYYYYY"],Oo),U("YYYY",function(e,o){o[Oo]=2===e.length?t.parseTwoDigitYear(e):v(e)}),U("YY",function(e,o){o[Oo]=t.parseTwoDigitYear(e)}),U("Y",function(e,t){t[Oo]=parseInt(e,10)}),t.parseTwoDigitYear=function(e){return v(e)+(68<v(e)?1900:2e3)};var Io=X("FullYear",!0),Po;Po=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},z("M",["MM",2],"Mo",function(){return this.month()+1}),z("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),z("MMMM",0,0,function(e){return this.localeData().months(this,e)}),E("month","M"),P("month",8),L("M",no),L("MM",no,Jt),L("MMM",function(e,t){return t.monthsShortRegex(e)}),L("MMMM",function(e,t){return t.monthsRegex(e)}),U(["M","MM"],function(e,t){t[Do]=v(e)-1}),U(["MMM","MMMM"],function(e,t,o,n){var i=o._locale.monthsParse(e,n,o._strict);null==i?h(o).invalidMonth=e:t[Do]=i});var Fo=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Yo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];z("w",["ww",2],"wo","week"),z("W",["WW",2],"Wo","isoWeek"),E("week","w"),E("isoWeek","W"),P("week",5),P("isoWeek",5),L("w",no),L("ww",no,Jt),L("W",no),L("WW",no,Jt),V(["w","ww","W","WW"],function(e,t,o,n){t[n.substr(0,1)]=v(e)});z("d",0,"do","day"),z("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),z("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),z("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),z("e",0,0,"weekday"),z("E",0,0,"isoWeekday"),E("day","d"),E("weekday","e"),E("isoWeekday","E"),P("day",11),P("weekday",11),P("isoWeekday",11),L("d",no),L("e",no),L("E",no),L("dd",function(e,t){return t.weekdaysMinRegex(e)}),L("ddd",function(e,t){return t.weekdaysShortRegex(e)}),L("dddd",function(e,t){return t.weekdaysRegex(e)}),V(["dd","ddd","dddd"],function(e,t,o,n){var i=o._locale.weekdaysParse(e,n,o._strict);null==i?h(o).invalidWeekday=e:t.d=i}),V(["d","e","E"],function(e,t,o,n){t[n]=v(e)});var zo=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];z("H",["HH",2],0,"hour"),z("h",["hh",2],0,be),z("k",["kk",2],0,function(){return this.hours()||24}),z("hmm",0,0,function(){return""+be.apply(this)+Y(this.minutes(),2)}),z("hmmss",0,0,function(){return""+be.apply(this)+Y(this.minutes(),2)+Y(this.seconds(),2)}),z("Hmm",0,0,function(){return""+this.hours()+Y(this.minutes(),2)}),z("Hmmss",0,0,function(){return""+this.hours()+Y(this.minutes(),2)+Y(this.seconds(),2)}),_e("a",!0),_e("A",!1),E("hour","h"),P("hour",13),L("a",ve),L("A",ve),L("H",no),L("h",no),L("k",no),L("HH",no,Jt),L("hh",no,Jt),L("kk",no,Jt),L("hmm",io),L("hmmss",ao),L("Hmm",io),L("Hmmss",ao),U(["H","HH"],Co),U(["k","kk"],function(e,t){var o=v(e);t[Co]=24===o?0:o}),U(["a","A"],function(e,t,o){o._isPm=o._locale.isPM(e),o._meridiem=e}),U(["h","hh"],function(e,t,o){t[Co]=v(e),h(o).bigHour=!0}),U("hmm",function(e,t,o){var n=e.length-2;t[Co]=v(e.substr(0,n)),t[Eo]=v(e.substr(n)),h(o).bigHour=!0}),U("hmmss",function(e,t,o){var n=e.length-4,i=e.length-2;t[Co]=v(e.substr(0,n)),t[Eo]=v(e.substr(n,2)),t[Mo]=v(e.substr(i)),h(o).bigHour=!0}),U("Hmm",function(e,t){var o=e.length-2;t[Co]=v(e.substr(0,o)),t[Eo]=v(e.substr(o))}),U("Hmmss",function(e,t){var o=e.length-4,n=e.length-2;t[Co]=v(e.substr(0,o)),t[Eo]=v(e.substr(o,2)),t[Mo]=v(e.substr(n))});var No=/[ap]\.?m?\.?/i,Ro=X("Hours",!0),Bo={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:Vt,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:Yo,week:{dow:0,doy:6},weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekdaysShort:zo,meridiemParse:No},Ho={},Lo={},Ao=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Wo=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,jo=/Z|[+-]\d\d(?::?\d\d)?/,Uo=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Vo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Go=/^\/?Date\((\-?\d+)/i,qo=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Zo={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480},Xo;t.createFromInputFallback=x("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),t.ISO_8601=function(){},t.RFC_2822=function(){};var Ko=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ke.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:g()}),Qo=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ke.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:g()}),$o=["year","quarter","month","week","day","hour","minute","second","millisecond"];ot("Z",":"),ot("ZZ",""),L("Z",vo),L("ZZ",vo),U(["Z","ZZ"],function(e,t,o){o._useUTC=!0,o._tzm=nt(vo,e)});var Jo=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var en=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,tn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;rt.fn=Je.prototype,rt.invalid=function(){return rt(NaN)};var on=pt(1,"add"),nn=pt(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var an=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});z(0,["gg",2],0,function(){return this.weekYear()%100}),z(0,["GG",2],0,function(){return this.isoWeekYear()%100}),vt("gggg","weekYear"),vt("ggggg","weekYear"),vt("GGGG","isoWeekYear"),vt("GGGGG","isoWeekYear"),E("weekYear","gg"),E("isoWeekYear","GG"),P("weekYear",1),P("isoWeekYear",1),L("G",bo),L("g",bo),L("GG",no,Jt),L("gg",no,Jt),L("GGGG",po,to),L("gggg",po,to),L("GGGGG",ho,oo),L("ggggg",ho,oo),V(["gggg","ggggg","GGGG","GGGGG"],function(e,t,o,n){t[n.substr(0,2)]=v(e)}),V(["gg","GG"],function(e,o,n,i){o[i]=t.parseTwoDigitYear(e)}),z("Q",0,"Qo","quarter"),E("quarter","Q"),P("quarter",7),L("Q",$t),U("Q",function(e,t){t[Do]=3*(v(e)-1)}),z("D",["DD",2],"Do","date"),E("date","D"),P("date",9),L("D",no),L("DD",no,Jt),L("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),U(["D","DD"],To),U("Do",function(e,t){t[To]=v(e.match(no)[0])});var dn=X("Date",!0);z("DDD",["DDDD",3],"DDDo","dayOfYear"),E("dayOfYear","DDD"),P("dayOfYear",4),L("DDD",so),L("DDDD",eo),U(["DDD","DDDD"],function(e,t,o){o._dayOfYear=v(e)}),z("m",["mm",2],0,"minute"),E("minute","m"),P("minute",14),L("m",no),L("mm",no,Jt),U(["m","mm"],Eo);var sn=X("Minutes",!1);z("s",["ss",2],0,"second"),E("second","s"),P("second",15),L("s",no),L("ss",no,Jt),U(["s","ss"],Mo);var rn=X("Seconds",!1);z("S",0,0,function(){return~~(this.millisecond()/100)}),z(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),z(0,["SSS",3],0,"millisecond"),z(0,["SSSS",4],0,function(){return 10*this.millisecond()}),z(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),z(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),z(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),z(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),z(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),E("millisecond","ms"),P("millisecond",16),L("S",so,$t),L("SS",so,Jt),L("SSS",so,eo);var ln;for(ln="SSSS";9>=ln.length;ln+="S")L(ln,mo);for(ln="S";9>=ln.length;ln+="S")U(ln,xt);var cn=X("Milliseconds",!1);z("z",0,0,"zoneAbbr"),z("zz",0,0,"zoneName");var un=f.prototype;un.add=on,un.calendar=function(e,o){var n=e||Ke(),i=it(n,this).startOf("day"),a=t.calendarFormat(this,i)||"sameElse",d=o&&(O(o[a])?o[a].call(this,n):o[a]);return this.format(d||this.localeData().calendar(a,this,Ke(n)))},un.clone=function(){return new f(this)},un.diff=function(e,t,o){var n,i,a;return this.isValid()?(n=it(e,this),!n.isValid())?NaN:(i=6e4*(n.utcOffset()-this.utcOffset()),t=M(t),(a="year"===t?mt(this,n)/12:"month"===t?mt(this,n):"quarter"===t?mt(this,n)/3:"second"===t?(this-n)/1e3:"minute"===t?(this-n)/6e4:"hour"===t?(this-n)/36e5:"day"===t?(this-n-i)/864e5:"week"===t?(this-n-i)/6048e5:this-n,o?a:_(a))):NaN},un.endOf=function(e){var o;if(e=M(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?_t:bt;return"year"===e?o=n(this.year()+1,0,1)-1:"quarter"===e?o=n(this.year(),this.month()-this.month()%3+3,1)-1:"month"===e?o=n(this.year(),this.month()+1,1)-1:"week"===e?o=n(this.year(),this.month(),this.date()-this.weekday()+7)-1:"isoWeek"===e?o=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1:"day"===e||"date"===e?o=n(this.year(),this.month(),this.date()+1)-1:"hour"===e?(o=this._d.valueOf(),o+=3600000-ft(o+(this._isUTC?0:60000*this.utcOffset()),3600000)-1):"minute"===e?(o=this._d.valueOf(),o+=60000-ft(o,60000)-1):"second"===e?(o=this._d.valueOf(),o+=1000-ft(o,1000)-1):void 0,this._d.setTime(o),t.updateOffset(this,!0),this},un.format=function(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var o=B(this,e);return this.localeData().postformat(o)},un.from=function(e,t){return this.isValid()&&(b(e)&&e.isValid()||Ke(e).isValid())?rt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},un.fromNow=function(e){return this.from(Ke(),e)},un.to=function(e,t){return this.isValid()&&(b(e)&&e.isValid()||Ke(e).isValid())?rt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},un.toNow=function(e){return this.to(Ke(),e)},un.get=function(e){return e=M(e),O(this[e])?this[e]():this},un.invalidAt=function(){return h(this).overflow},un.isAfter=function(e,t){var o=b(e)?e:Ke(e);return!!(this.isValid()&&o.isValid())&&(t=M(t)||"millisecond","millisecond"===t?this.valueOf()>o.valueOf():o.valueOf()<this.clone().startOf(t).valueOf())},un.isBefore=function(e,t){var o=b(e)?e:Ke(e);return!!(this.isValid()&&o.isValid())&&(t=M(t)||"millisecond","millisecond"===t?this.valueOf()<o.valueOf():this.clone().endOf(t).valueOf()<o.valueOf())},un.isBetween=function(e,t,o,n){var i=b(e)?e:Ke(e),a=b(t)?t:Ke(t);return!!(this.isValid()&&i.isValid()&&a.isValid())&&(n=n||"()",("("===n[0]?this.isAfter(i,o):!this.isBefore(i,o))&&(")"===n[1]?this.isBefore(a,o):!this.isAfter(a,o)))},un.isSame=function(e,t){var o=b(e)?e:Ke(e),n;return!!(this.isValid()&&o.isValid())&&(t=M(t)||"millisecond","millisecond"===t?this.valueOf()===o.valueOf():(n=o.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},un.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},un.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},un.isValid=function(){return m(this)},un.lang=an,un.locale=gt,un.localeData=yt,un.max=Qo,un.min=Ko,un.parsingFlags=function(){return c({},h(this))},un.set=$,un.startOf=function(e){var o;if(e=M(e),void 0===e||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?_t:bt;return"year"===e?o=n(this.year(),0,1):"quarter"===e?o=n(this.year(),this.month()-this.month()%3,1):"month"===e?o=n(this.year(),this.month(),1):"week"===e?o=n(this.year(),this.month(),this.date()-this.weekday()):"isoWeek"===e?o=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)):"day"===e||"date"===e?o=n(this.year(),this.month(),this.date()):"hour"===e?(o=this._d.valueOf(),o-=ft(o+(this._isUTC?0:60000*this.utcOffset()),3600000)):"minute"===e?(o=this._d.valueOf(),o-=ft(o,60000)):"second"===e?(o=this._d.valueOf(),o-=ft(o,1000)):void 0,this._d.setTime(o),t.updateOffset(this,!0),this},un.subtract=nn,un.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},un.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},un.toDate=function(){return new Date(this.valueOf())},un.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,o=t?this.clone().utc():this;return 0>o.year()||9999<o.year()?B(o,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+1e3*(60*this.utcOffset())).toISOString().replace("Z",B(o,"Z")):B(o,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},un.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var o="["+e+"(\"]",n=0<=this.year()&&9999>=this.year()?"YYYY":"YYYYYY",i=t+"[\")]";return this.format(o+n+"-MM-DD[T]HH:mm:ss.SSS"+i)},un.toJSON=function(){return this.isValid()?this.toISOString():null},un.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},un.unix=function(){return go(this.valueOf()/1e3)},un.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},un.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},un.year=Io,un.isLeapYear=function(){return Z(this.year())},un.weekYear=function(e){return kt.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},un.isoWeekYear=function(e){return kt.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},un.quarter=un.quarters=function(e){return null==e?co((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},un.month=ie,un.daysInMonth=function(){return ee(this.year(),this.month())},un.week=un.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},un.isoWeek=un.isoWeeks=function(e){var t=ce(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},un.weeksInYear=function(){var e=this.localeData()._week;return ue(this.year(),e.dow,e.doy)},un.isoWeeksInYear=function(){return ue(this.year(),1,4)},un.date=dn,un.day=un.days=function(e){if(!this.isValid())return null==e?NaN:this;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null==e?t:(e=pe(e,this.localeData()),this.add(e-t,"d"))},un.weekday=function(e){if(!this.isValid())return null==e?NaN:this;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},un.isoWeekday=function(e){if(!this.isValid())return null==e?NaN:this;if(null!=e){var t=he(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},un.dayOfYear=function(e){var t=ro((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},un.hour=un.hours=Ro,un.minute=un.minutes=sn,un.second=un.seconds=rn,un.millisecond=un.milliseconds=cn,un.utcOffset=function(e,o,n){var i=this._offset||0,a;if(!this.isValid())return null==e?NaN:this;if(null!=e){if("string"!=typeof e)16>uo(e)&&!n&&(e*=60);else if(e=nt(vo,e),null===e)return this;return!this._isUTC&&o&&(a=at(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),i!==e&&(!o||this._changeInProgress?ht(this,rt(e-i,"m"),1,!1):!this._changeInProgress&&(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:at(this)},un.utc=function(e){return this.utcOffset(0,e)},un.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(at(this),"m")),this},un.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=nt(_o,this._i);null==e?this.utcOffset(0,!0):this.utcOffset(e)}return this},un.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Ke(e).utcOffset():0,0==(this.utcOffset()-e)%60)},un.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},un.isLocal=function(){return!!this.isValid()&&!this._isUTC},un.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},un.isUtc=st,un.isUTC=st,un.zoneAbbr=function(){return this._isUTC?"UTC":""},un.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},un.dates=x("dates accessor is deprecated. Use date instead.",dn),un.months=x("months accessor is deprecated. Use month instead",ie),un.years=x("years accessor is deprecated. Use year instead",Io),un.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null==e?-this.utcOffset():("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this)}),un.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",dt);var pn=C.prototype;pn.calendar=function(e,t,o){var n=this._calendar[e]||this._calendar.sameElse;return O(n)?n.call(t,o):n},pn.longDateFormat=function(e){var t=this._longDateFormat[e],o=this._longDateFormat[e.toUpperCase()];return t||!o?t:(this._longDateFormat[e]=o.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},pn.invalidDate=function(){return this._invalidDate},pn.ordinal=function(e){return this._ordinal.replace("%d",e)},pn.preparse=St,pn.postformat=St,pn.relativeTime=function(e,t,o,n){var i=this._relativeTime[o];return O(i)?i(e,t,o,n):i.replace(/%d/i,e)},pn.pastFuture=function(e,t){var o=this._relativeTime[0<e?"future":"past"];return O(o)?o(t):o.replace(/%s/i,t)},pn.set=D,pn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Fo).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},pn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Fo.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},pn.monthsParse=oe,pn.monthsRegex=function(e){return this._monthsParseExact?(l(this,"_monthsRegex")||ae.call(this),e?this._monthsStrictRegex:this._monthsRegex):(l(this,"_monthsRegex")||(this._monthsRegex=wo),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},pn.monthsShortRegex=function(e){return this._monthsParseExact?(l(this,"_monthsRegex")||ae.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(l(this,"_monthsShortRegex")||(this._monthsShortRegex=wo),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},pn.week=function(e){return ce(e,this._week.dow,this._week.doy).week},pn.firstDayOfYear=function(){return this._week.doy},pn.firstDayOfWeek=function(){return this._week.dow},pn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?me(n,this._week.dow):e?n[e.day()]:n},pn.weekdaysMin=function(e){return!0===e?me(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},pn.weekdaysShort=function(e){return!0===e?me(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},pn.weekdaysParse=ye,pn.weekdaysRegex=function(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||fe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=wo),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},pn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||fe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=wo),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},pn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||fe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=wo),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},pn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},pn.meridiem=function(e,t,o){return 11<e?o?"pm":"PM":o?"am":"AM"},Se("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,o=1===v(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th";return e+o}}),t.lang=x("moment.lang is deprecated. Use moment.locale instead.",Se),t.langData=x("moment.langData is deprecated. Use moment.localeData instead.",De);var hn=uo,mn=Pt("ms"),gn=Pt("s"),yn=Pt("m"),fn=Pt("h"),bn=Pt("d"),_n=Pt("w"),vn=Pt("M"),kn=Pt("Q"),wn=Pt("y"),xn=Ft("milliseconds"),Sn=Ft("seconds"),On=Ft("minutes"),Dn=Ft("hours"),Tn=Ft("days"),Cn=Ft("months"),En=Ft("years"),Mn=ro,In={ss:44,s:45,m:45,h:22,d:26,M:11},Pn=uo,Fn=Je.prototype;return Fn.isValid=function(){return this._isValid},Fn.abs=function(){var e=this._data;return this._milliseconds=hn(this._milliseconds),this._days=hn(this._days),this._months=hn(this._months),e.milliseconds=hn(e.milliseconds),e.seconds=hn(e.seconds),e.minutes=hn(e.minutes),e.hours=hn(e.hours),e.months=hn(e.months),e.years=hn(e.years),this},Fn.add=function(e,t){return Ct(this,e,t,1)},Fn.subtract=function(e,t){return Ct(this,e,t,-1)},Fn.as=function(e){if(!this.isValid())return NaN;var t=this._milliseconds,o,n;if(e=M(e),"month"===e||"quarter"===e||"year"===e)switch(o=this._days+t/864e5,n=this._months+Mt(o),e){case"month":return n;case"quarter":return n/3;case"year":return n/12;}else switch(o=this._days+ro(It(this._months)),e){case"week":return o/7+t/6048e5;case"day":return o+t/864e5;case"hour":return 24*o+t/36e5;case"minute":return 1440*o+t/6e4;case"second":return 86400*o+t/1e3;case"millisecond":return go(864e5*o)+t;default:throw new Error("Unknown unit "+e);}},Fn.asMilliseconds=mn,Fn.asSeconds=gn,Fn.asMinutes=yn,Fn.asHours=fn,Fn.asDays=bn,Fn.asWeeks=_n,Fn.asMonths=vn,Fn.asQuarters=kn,Fn.asYears=wn,Fn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+2592e6*(this._months%12)+31536e6*v(this._months/12):NaN},Fn._bubble=function(){var e=this._milliseconds,t=this._days,o=this._months,n=this._data,i,a,d,s,r;return 0<=e&&0<=t&&0<=o||0>=e&&0>=t&&0>=o||(e+=864e5*Et(It(o)+t),t=0,o=0),n.milliseconds=e%1e3,i=_(e/1e3),n.seconds=i%60,a=_(i/60),n.minutes=a%60,d=_(a/60),n.hours=d%24,t+=_(d/24),r=_(Mt(t)),o+=r,t-=Et(It(r)),s=_(o/12),o%=12,n.days=t,n.months=o,n.years=s,this},Fn.clone=function(){return rt(this)},Fn.get=function(e){return e=M(e),this.isValid()?this[e+"s"]():NaN},Fn.milliseconds=xn,Fn.seconds=Sn,Fn.minutes=On,Fn.hours=Dn,Fn.days=Tn,Fn.weeks=function(){return _(this.days()/7)},Fn.months=Cn,Fn.years=En,Fn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),o=zt(this,!e,t);return e&&(o=t.pastFuture(+this,o)),t.postformat(o)},Fn.toISOString=Bt,Fn.toString=Bt,Fn.toJSON=Bt,Fn.locale=gt,Fn.localeData=yt,Fn.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Bt),Fn.lang=an,z("X",0,0,"unix"),z("x",0,0,"valueOf"),L("x",bo),L("X",ko),U("X",function(e,t,o){o._d=new Date(1e3*parseFloat(e,10))}),U("x",function(e,t,o){o._d=new Date(v(e))}),t.version="2.24.0",function(e){Ht=e}(Ke),t.fn=un,t.min=function(){var e=[].slice.call(arguments,0);return Qe("isBefore",e)},t.max=function(){var e=[].slice.call(arguments,0);return Qe("isAfter",e)},t.now=function(){return Date.now?Date.now():+new Date},t.utc=u,t.unix=function(e){return Ke(1e3*e)},t.months=function(e,t){return Dt(e,t,"months")},t.isDate=s,t.locale=Se,t.invalid=g,t.duration=rt,t.isMoment=b,t.weekdays=function(e,t,o){return Tt(e,t,o,"weekdays")},t.parseZone=function(){return Ke.apply(null,arguments).parseZone()},t.localeData=De,t.isDuration=et,t.monthsShort=function(e,t){return Dt(e,t,"monthsShort")},t.weekdaysMin=function(e,t,o){return Tt(e,t,o,"weekdaysMin")},t.defineLocale=Oe,t.updateLocale=function(e,t){if(null!=t){var o=Bo,n,i;i=xe(e),null!=i&&(o=i._config),t=T(o,t),n=new C(t),n.parentLocale=Ho[e],Ho[e]=n,Se(e)}else null!=Ho[e]&&(null==Ho[e].parentLocale?null!=Ho[e]&&delete Ho[e]:Ho[e]=Ho[e].parentLocale);return Ho[e]},t.locales=Te,t.weekdaysShort=function(e,t,o){return Tt(e,t,o,"weekdaysShort")},t.normalizeUnits=M,t.relativeTimeRounding=Nt,t.relativeTimeThreshold=function(e,t){return void 0!==In[e]&&(void 0===t?In[e]:(In[e]=t,"s"===e&&(In.ss=t-1),!0))},t.calendarFormat=function(e,t){var o=e.diff(t,"days",!0);return-6>o?"sameElse":-1>o?"lastWeek":0>o?"lastDay":1>o?"sameDay":2>o?"nextDay":7>o?"nextWeek":"sameElse"},t.prototype=un,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t})}),Ms="undefined"!=typeof window&&window.moment||Es,Is=Object.freeze({default:Ms,__moduleExports:Ms}),Ps={Images:ga,dotparser:An,gephiParser:Wn,allOptions:fs,convertDot:Hn,convertGephi:dt},Fs=Object.freeze({util:jo,data:On,network:Ps,DOMutil:Cs,moment:Is,Hammer:ca,keycharm:Vn,DataSet:xn,DataView:Sn,Queue:_n,Network:io});e.DOMutil=Cs,e.DataSet=xn,e.DataView=Sn,e.Hammer=ca,e.Network=io,e.Queue=_n,e.data=On,e.default=Fs,e.keycharm=Vn,e.moment=Is,e.network=Ps,e.util=jo,Object.defineProperty(e,"__esModule",{value:!0})});
26//# sourceMappingURL=vis-network.min.js.map