/** * vis.js * https://github.com/almende/vis * * A dynamic, browser-based visualization library. * * @version 4.0.0-SNAPSHOT * @date 2015-03-02 * * @license * Copyright (C) 2011-2014 Almende B.V, http://almende.com * * Vis.js is dual licensed under both * * * The Apache 2.0 License * http://www.apache.org/licenses/LICENSE-2.0 * * and * * * The MIT License * http://opensource.org/licenses/MIT * * Vis.js may be distributed under either license. */ "use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.vis=e():t.vis=e()}(this,function(){return function(t){function e(o){if(i[o])return i[o].exports;var s=i[o]={exports:{},id:o,loaded:!1};return t[o].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){e.util=i(1),e.DOMutil=i(2),e.DataSet=i(3),e.DataView=i(4),e.Queue=i(5),e.Graph3d=i(6),e.graph3d={Camera:i(7),Filter:i(8),Point2d:i(9),Point3d:i(10),Slider:i(11),StepNumber:i(12)},e.Timeline=i(13),e.Graph2d=i(14),e.timeline={DateUtil:i(15),DataStep:i(16),Range:i(17),stack:i(18),TimeStep:i(19),components:{items:{Item:i(20),BackgroundItem:i(21),BoxItem:i(22),PointItem:i(23),RangeItem:i(24)},Component:i(25),CurrentTime:i(26),CustomTime:i(27),DataAxis:i(28),GraphGroup:i(29),Group:i(30),BackgroundGroup:i(31),ItemSet:i(32),Legend:i(33),LineGraph:i(34),TimeAxis:i(35)}},e.Network=i(36),e.network={Edge:i(37),Groups:i(38),Images:i(39),Node:i(40),Popup:i(41),dotparser:i(42),gephiParser:i(43)},e.Graph=function(){throw new Error("Graph is renamed to Network. Please create a graph as new vis.Network(...)")},e.moment=i(44),e.hammer=i(45),e.Hammer=i(45)},function(t,e,i){var o=i(44);e.isNumber=function(t){return t instanceof Number||"number"==typeof t},e.giveRange=function(t,e,i,o){if(e==t)return.5;var s=1/(e-t);return Math.max(0,(o-t)*s)},e.isString=function(t){return t instanceof String||"string"==typeof t},e.isDate=function(t){if(t instanceof Date)return!0;if(e.isString(t)){var i=s.exec(t);if(i)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},e.isDataTable=function(t){return"undefined"!=typeof google&&google.visualization&&google.visualization.DataTable&&t instanceof google.visualization.DataTable},e.randomUUID=function(){var t=function(){return Math.floor(65536*Math.random()).toString(16)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},e.extend=function(t){for(var e=1,i=arguments.length;i>e;e++){var o=arguments[e];for(var s in o)o.hasOwnProperty(s)&&(t[s]=o[s])}return t},e.selectiveExtend=function(t,e){if(!Array.isArray(t))throw new Error("Array with property names expected as first argument");for(var i=2;ii;i++)if(t[i]!=e[i])return!1;return!0},e.convert=function(t,i){var n;if(void 0===t)return void 0;if(null===t)return null;if(!i)return t;if("string"!=typeof i&&!(i instanceof String))throw new Error("Type must be a string");switch(i){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return Number(t.valueOf());case"string":case"String":return String(t);case"Date":if(e.isNumber(t))return new Date(t);if(t instanceof Date)return new Date(t.valueOf());if(o.isMoment(t))return new Date(t.valueOf());if(e.isString(t))return n=s.exec(t),n?new Date(Number(n[1])):o(t).toDate();throw new Error("Cannot convert object of type "+e.getType(t)+" to type Date");case"Moment":if(e.isNumber(t))return o(t);if(t instanceof Date)return o(t.valueOf());if(o.isMoment(t))return o(t);if(e.isString(t))return n=s.exec(t),o(n?Number(n[1]):t);throw new Error("Cannot convert object of type "+e.getType(t)+" to type Date");case"ISODate":if(e.isNumber(t))return new Date(t);if(t instanceof Date)return t.toISOString();if(o.isMoment(t))return t.toDate().toISOString();if(e.isString(t))return n=s.exec(t),n?new Date(Number(n[1])).toISOString():new Date(t).toISOString();throw new Error("Cannot convert object of type "+e.getType(t)+" to type ISODate");case"ASPDate":if(e.isNumber(t))return"/Date("+t+")/";if(t instanceof Date)return"/Date("+t.valueOf()+")/";if(e.isString(t)){n=s.exec(t);var r;return r=n?new Date(Number(n[1])).valueOf():new Date(t).valueOf(),"/Date("+r+")/"}throw new Error("Cannot convert object of type "+e.getType(t)+" to type ASPDate");default:throw new Error('Unknown type "'+i+'"')}};var s=/^\/?Date\((\-?\d+)/i;e.getType=function(t){var e=typeof t;return"object"==e?null==t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":Array.isArray(t)?"Array":t instanceof Date?"Date":"Object":"number"==e?"Number":"boolean"==e?"Boolean":"string"==e?"String":e},e.getAbsoluteLeft=function(t){return t.getBoundingClientRect().left},e.getAbsoluteTop=function(t){return t.getBoundingClientRect().top},e.addClassName=function(t,e){var i=t.className.split(" ");-1==i.indexOf(e)&&(i.push(e),t.className=i.join(" "))},e.removeClassName=function(t,e){var i=t.className.split(" "),o=i.indexOf(e);-1!=o&&(i.splice(o,1),t.className=i.join(" "))},e.forEach=function(t,e){var i,o;if(Array.isArray(t))for(i=0,o=t.length;o>i;i++)e(t[i],i,t);else for(i in t)t.hasOwnProperty(i)&&e(t[i],i,t)},e.toArray=function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(t[i]);return e},e.updateProperty=function(t,e,i){return t[e]!==i?(t[e]=i,!0):!1},e.addEventListener=function(t,e,i,o){t.addEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,o)):t.attachEvent("on"+e,i)},e.removeEventListener=function(t,e,i,o){t.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,o)):t.detachEvent("on"+e,i)},e.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},e.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},e.option={},e.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},e.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},e.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},e.option.asSize=function(t,i){return"function"==typeof t&&(t=t()),e.isString(t)?t:e.isNumber(t)?t+"px":i||null},e.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},e.hexToRGB=function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,i,o){return e+e+i+i+o+o});var i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return i?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null},e.overrideOpacity=function(t,i){if(-1!=t.indexOf("rgb")){var o=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+o[0]+","+o[1]+","+o[2]+","+i+")"}var o=e.hexToRGB(t);return null==o?t:"rgba("+o.r+","+o.g+","+o.b+","+i+")"},e.RGBToHex=function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},e.parseColor=function(t){var i;if(e.isString(t)){if(e.isValidRGB(t)){var o=t.substr(4).substr(0,t.length-5).split(",");t=e.RGBToHex(o[0],o[1],o[2])}if(e.isValidHex(t)){var s=e.hexToHSV(t),n={h:s.h,s:.45*s.s,v:Math.min(1,1.05*s.v)},r={h:s.h,s:Math.min(1,1.25*s.v),v:.6*s.v},a=e.HSVToHex(r.h,r.h,r.v),h=e.HSVToHex(n.h,n.s,n.v);i={background:t,border:a,highlight:{background:h,border:a},hover:{background:h,border:a}}}else i={background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}}}else i={},i.background=t.background||"white",i.border=t.border||i.background,e.isString(t.highlight)?i.highlight={border:t.highlight,background:t.highlight}:(i.highlight={},i.highlight.background=t.highlight&&t.highlight.background||i.background,i.highlight.border=t.highlight&&t.highlight.border||i.border),e.isString(t.hover)?i.hover={border:t.hover,background:t.hover}:(i.hover={},i.hover.background=t.hover&&t.hover.background||i.background,i.hover.border=t.hover&&t.hover.border||i.border);return i},e.RGBToHSV=function(t,e,i){t/=255,e/=255,i/=255;var o=Math.min(t,Math.min(e,i)),s=Math.max(t,Math.max(e,i));if(o==s)return{h:0,s:0,v:o};var n=t==o?e-i:i==o?t-e:i-t,r=t==o?3:i==o?1:5,a=60*(r-n/(s-o))/360,h=(s-o)/s,d=s;return{h:a,s:h,v:d}};var n={split:function(t){var e={};return t.split(";").forEach(function(t){if(""!=t.trim()){var i=t.split(":"),o=i[0].trim(),s=i[1].trim();e[o]=s}}),e},join:function(t){return Object.keys(t).map(function(e){return e+": "+t[e]}).join("; ")}};e.addCssText=function(t,i){var o=n.split(t.style.cssText),s=n.split(i),r=e.extend(o,s);t.style.cssText=n.join(r)},e.removeCssText=function(t,e){var i=n.split(t.style.cssText),o=n.split(e);for(var s in o)o.hasOwnProperty(s)&&delete i[s];t.style.cssText=n.join(i)},e.HSVToRGB=function(t,e,i){var o,s,n,r=Math.floor(6*t),a=6*t-r,h=i*(1-e),d=i*(1-a*e),l=i*(1-(1-a)*e);switch(r%6){case 0:o=i,s=l,n=h;break;case 1:o=d,s=i,n=h;break;case 2:o=h,s=i,n=l;break;case 3:o=h,s=d,n=i;break;case 4:o=l,s=h,n=i;break;case 5:o=i,s=h,n=d}return{r:Math.floor(255*o),g:Math.floor(255*s),b:Math.floor(255*n)}},e.HSVToHex=function(t,i,o){var s=e.HSVToRGB(t,i,o);return e.RGBToHex(s.r,s.g,s.b)},e.hexToHSV=function(t){var i=e.hexToRGB(t);return e.RGBToHSV(i.r,i.g,i.b)},e.isValidHex=function(t){var e=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);return e},e.isValidRGB=function(t){t=t.replace(" ","");var e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/i.test(t);return e},e.selectiveBridgeObject=function(t,i){if("object"==typeof i){for(var o=Object.create(i),s=0;s=r&&s>n;){var h=Math.floor((r+a)/2),d=t[h],l=void 0===o?d[i]:d[i][o],c=e(l);if(0==c)return h;-1==c?r=h+1:a=h-1,n++}return-1},e.binarySearchValue=function(t,e,i,o){for(var s,n,r,a,h=1e4,d=0,l=0,c=t.length-1;c>=l&&h>d;){if(a=Math.floor(.5*(c+l)),s=t[Math.max(0,a-1)][i],n=t[a][i],r=t[Math.min(t.length-1,a+1)][i],n==e)return a;if(e>s&&n>e)return"before"==o?Math.max(0,a-1):a;if(e>n&&r>e)return"before"==o?a:Math.min(t.length-1,a+1);e>n?l=a+1:c=a-1,d++}return-1},e.easeInOutQuad=function(t,e,i,o){var s=i-e;return t/=o/2,1>t?s/2*t*t+e:(t--,-s/2*(t*(t-2)-1)+e)},e.easingFunctions={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return.5>t?2*t*t:-1+(4-2*t)*t},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return.5>t?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return.5>t?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return.5>t?16*t*t*t*t*t:1+16*--t*t*t*t*t}}},function(t,e){e.prepareElements=function(t){for(var e in t)t.hasOwnProperty(e)&&(t[e].redundant=t[e].used,t[e].used=[])},e.cleanupElements=function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].redundant){for(var i=0;i0?(o=e[t].redundant[0],e[t].redundant.shift()):(o=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(o)):(o=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(o)),e[t].used.push(o),o},e.getDOMElement=function(t,e,i,o){var s;return e.hasOwnProperty(t)?e[t].redundant.length>0?(s=e[t].redundant[0],e[t].redundant.shift()):(s=document.createElement(t),void 0!==o?i.insertBefore(s,o):i.appendChild(s)):(s=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==o?i.insertBefore(s,o):i.appendChild(s)),e[t].used.push(s),s},e.drawPoint=function(t,i,o,s,n,r){var a;"circle"==o.options.drawPoints.style?(a=e.getSVGElement("circle",s,n),a.setAttributeNS(null,"cx",t),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*o.options.drawPoints.size)):(a=e.getSVGElement("rect",s,n),a.setAttributeNS(null,"x",t-.5*o.options.drawPoints.size),a.setAttributeNS(null,"y",i-.5*o.options.drawPoints.size),a.setAttributeNS(null,"width",o.options.drawPoints.size),a.setAttributeNS(null,"height",o.options.drawPoints.size)),void 0!==o.options.drawPoints.styles&&a.setAttributeNS(null,"style",o.group.options.drawPoints.styles),a.setAttributeNS(null,"class",o.className+" point");var h=e.getSVGElement("text",s,n);return r&&(r.xOffset&&(t+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(h.textContent=r.content),r.className&&h.setAttributeNS(null,"class",r.className+" label")),h.setAttributeNS(null,"x",t),h.setAttributeNS(null,"y",i),a},e.drawBar=function(t,i,o,s,n,r,a){if(0!=s){0>s&&(s*=-1,i-=s);var h=e.getSVGElement("rect",r,a);h.setAttributeNS(null,"x",t-.5*o),h.setAttributeNS(null,"y",i),h.setAttributeNS(null,"width",o),h.setAttributeNS(null,"height",s),h.setAttributeNS(null,"class",n)}}},function(t,e,i){function o(t,e){if(!t||Array.isArray(t)||s.isDataTable(t)||(e=t,t=null),this._options=e||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i in this._options.type)if(this._options.type.hasOwnProperty(i)){var o=this._options.type[i];this._type[i]="Date"==o||"ISODate"==o||"ASPDate"==o?"Date":o}if(this._options.convert)throw new Error('Option "convert" is deprecated. Use "type" instead.');this._subscribers={},t&&this.add(t),this.setOptions(e)}var s=i(1),n=i(5);o.prototype.setOptions=function(t){t&&void 0!==t.queue&&(t.queue===!1?this._queue&&(this._queue.destroy(),delete this._queue):(this._queue||(this._queue=n.extend(this,{replace:["add","update","remove"]})),"object"==typeof t.queue&&this._queue.setOptions(t.queue)))},o.prototype.on=function(t,e){var i=this._subscribers[t];i||(i=[],this._subscribers[t]=i),i.push({callback:e})},o.prototype.subscribe=o.prototype.on,o.prototype.off=function(t,e){var i=this._subscribers[t];i&&(this._subscribers[t]=i.filter(function(t){return t.callback!=e}))},o.prototype.unsubscribe=o.prototype.off,o.prototype._trigger=function(t,e,i){if("*"==t)throw new Error("Cannot trigger event *");var o=[];t in this._subscribers&&(o=o.concat(this._subscribers[t])),"*"in this._subscribers&&(o=o.concat(this._subscribers["*"]));for(var s=0;sr;r++)i=n._addItem(t[r]),o.push(i);else if(s.isDataTable(t))for(var h=this._getColumnNames(t),d=0,l=t.getNumberOfRows();l>d;d++){for(var c={},u=0,p=h.length;p>u;u++){var f=h[u];c[f]=t.getValue(d,u)}i=n._addItem(c),o.push(i)}else{if(!(t instanceof Object))throw new Error("Unknown dataType");i=n._addItem(t),o.push(i)}return o.length&&this._trigger("add",{items:o},e),o},o.prototype.update=function(t,e){var i=[],o=[],n=[],r=this,a=r._fieldId,h=function(t){var e=t[a];r._data[e]?(e=r._updateItem(t),o.push(e),n.push(t)):(e=r._addItem(t),i.push(e))};if(Array.isArray(t))for(var d=0,l=t.length;l>d;d++)h(t[d]);else if(s.isDataTable(t))for(var c=this._getColumnNames(t),u=0,p=t.getNumberOfRows();p>u;u++){for(var f={},m=0,g=c.length;g>m;m++){var v=c[m];f[v]=t.getValue(u,m)}h(f)}else{if(!(t instanceof Object))throw new Error("Unknown dataType");h(t)}return i.length&&this._trigger("add",{items:i},e),o.length&&this._trigger("update",{items:o,data:n},e),i.concat(o)},o.prototype.get=function(){var t,e,i,o,n=this,r=s.getType(arguments[0]);"String"==r||"Number"==r?(t=arguments[0],i=arguments[1],o=arguments[2]):"Array"==r?(e=arguments[0],i=arguments[1],o=arguments[2]):(i=arguments[0],o=arguments[1]);var a;if(i&&i.returnType){var h=["DataTable","Array","Object"];if(a=-1==h.indexOf(i.returnType)?"Array":i.returnType,o&&a!=s.getType(o))throw new Error('Type of parameter "data" ('+s.getType(o)+") does not correspond with specified options.type ("+i.type+")");if("DataTable"==a&&!s.isDataTable(o))throw new Error('Parameter "data" must be a DataTable when options.type is "DataTable"')}else a=o&&"DataTable"==s.getType(o)?"DataTable":"Array";var d,l,c,u,p=i&&i.type||this._options.type,f=i&&i.filter,m=[];if(void 0!=t)d=n._getItem(t,p),f&&!f(d)&&(d=null);else if(void 0!=e)for(c=0,u=e.length;u>c;c++)d=n._getItem(e[c],p),(!f||f(d))&&m.push(d);else for(l in this._data)this._data.hasOwnProperty(l)&&(d=n._getItem(l,p),(!f||f(d))&&m.push(d));if(i&&i.order&&void 0==t&&this._sort(m,i.order),i&&i.fields){var g=i.fields;if(void 0!=t)d=this._filterFields(d,g);else for(c=0,u=m.length;u>c;c++)m[c]=this._filterFields(m[c],g)}if("DataTable"==a){var v=this._getColumnNames(o);if(void 0!=t)n._appendRow(o,v,d);else for(c=0;cc;c++)o.push(m[c]);return o}return m},o.prototype.getIds=function(t){var e,i,o,s,n,r=this._data,a=t&&t.filter,h=t&&t.order,d=t&&t.type||this._options.type,l=[];if(a)if(h){n=[];for(o in r)r.hasOwnProperty(o)&&(s=this._getItem(o,d),a(s)&&n.push(s));for(this._sort(n,h),e=0,i=n.length;i>e;e++)l[e]=n[e][this._fieldId]}else for(o in r)r.hasOwnProperty(o)&&(s=this._getItem(o,d),a(s)&&l.push(s[this._fieldId]));else if(h){n=[];for(o in r)r.hasOwnProperty(o)&&n.push(r[o]);for(this._sort(n,h),e=0,i=n.length;i>e;e++)l[e]=n[e][this._fieldId]}else for(o in r)r.hasOwnProperty(o)&&(s=r[o],l.push(s[this._fieldId]));return l},o.prototype.getDataSet=function(){return this},o.prototype.forEach=function(t,e){var i,o,s=e&&e.filter,n=e&&e.type||this._options.type,r=this._data;if(e&&e.order)for(var a=this.get(e),h=0,d=a.length;d>h;h++)i=a[h],o=i[this._fieldId],t(i,o);else for(o in r)r.hasOwnProperty(o)&&(i=this._getItem(o,n),(!s||s(i))&&t(i,o))},o.prototype.map=function(t,e){var i,o=e&&e.filter,s=e&&e.type||this._options.type,n=[],r=this._data;for(var a in r)r.hasOwnProperty(a)&&(i=this._getItem(a,s),(!o||o(i))&&n.push(t(i,a)));return e&&e.order&&this._sort(n,e.order),n},o.prototype._filterFields=function(t,e){if(!t)return t;var i={};for(var o in t)t.hasOwnProperty(o)&&-1!=e.indexOf(o)&&(i[o]=t[o]);return i},o.prototype._sort=function(t,e){if(s.isString(e)){var i=e;t.sort(function(t,e){var o=t[i],s=e[i];return o>s?1:s>o?-1:0})}else{if("function"!=typeof e)throw new TypeError("Order must be a function or a string");t.sort(e)}},o.prototype.remove=function(t,e){var i,o,s,n=[];if(Array.isArray(t))for(i=0,o=t.length;o>i;i++)s=this._remove(t[i]),null!=s&&n.push(s);else s=this._remove(t),null!=s&&n.push(s);return n.length&&this._trigger("remove",{items:n},e),n},o.prototype._remove=function(t){if(s.isNumber(t)||s.isString(t)){if(this._data[t])return delete this._data[t],this.length--,t}else if(t instanceof Object){var e=t[this._fieldId];if(e&&this._data[e])return delete this._data[e],this.length--,e}return null},o.prototype.clear=function(t){var e=Object.keys(this._data);return this._data={},this.length=0,this._trigger("remove",{items:e},t),e},o.prototype.max=function(t){var e=this._data,i=null,o=null;for(var s in e)if(e.hasOwnProperty(s)){var n=e[s],r=n[t];null!=r&&(!i||r>o)&&(i=n,o=r)}return i},o.prototype.min=function(t){var e=this._data,i=null,o=null;for(var s in e)if(e.hasOwnProperty(s)){var n=e[s],r=n[t];null!=r&&(!i||o>r)&&(i=n,o=r)}return i},o.prototype.distinct=function(t){var e,i=this._data,o=[],n=this._options.type&&this._options.type[t]||null,r=0;for(var a in i)if(i.hasOwnProperty(a)){var h=i[a],d=h[t],l=!1;for(e=0;r>e;e++)if(o[e]==d){l=!0;break}l||void 0===d||(o[r]=d,r++)}if(n)for(e=0;ei;i++)e[i]=t.getColumnId(i)||t.getColumnLabel(i);return e},o.prototype._appendRow=function(t,e,i){for(var o=t.addRow(),s=0,n=e.length;n>s;s++){var r=e[s];t.setValue(o,s,i[r])}},t.exports=o},function(t,e,i){function o(t,e){this._data=null,this._ids={},this.length=0,this._options=e||{},this._fieldId="id",this._subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(t)}var s=i(1),n=i(3);o.prototype.setData=function(t){var e,i,o;if(this._data){this._data.unsubscribe&&this._data.unsubscribe("*",this.listener),e=[];for(var s in this._ids)this._ids.hasOwnProperty(s)&&e.push(s);this._ids={},this.length=0,this._trigger("remove",{items:e})}if(this._data=t,this._data){for(this._fieldId=this._options.fieldId||this._data&&this._data.options&&this._data.options.fieldId||"id",e=this._data.getIds({filter:this._options&&this._options.filter}),i=0,o=e.length;o>i;i++)s=e[i],this._ids[s]=!0;this.length=e.length,this._trigger("add",{items:e}),this._data.on&&this._data.on("*",this.listener)}},o.prototype.refresh=function(){for(var t,e=this._data.getIds({filter:this._options&&this._options.filter}),i={},o=[],s=[],n=0;no;o++)n=a[o],r=this.get(n),r&&(this._ids[n]=!0,d.push(n));break;case"update":for(o=0,s=a.length;s>o;o++)n=a[o],r=this.get(n),r?this._ids[n]?l.push(n):(this._ids[n]=!0,d.push(n)):this._ids[n]&&(delete this._ids[n],c.push(n));break;case"remove":for(o=0,s=a.length;s>o;o++)n=a[o],this._ids[n]&&(delete this._ids[n],c.push(n))}this.length+=d.length-c.length,d.length&&this._trigger("add",{items:d},i),l.length&&this._trigger("update",{items:l},i),c.length&&this._trigger("remove",{items:c},i)}},o.prototype.on=n.prototype.on,o.prototype.off=n.prototype.off,o.prototype._trigger=n.prototype._trigger,o.prototype.subscribe=o.prototype.on,o.prototype.unsubscribe=o.prototype.off,t.exports=o},function(t){function e(t){this.delay=null,this.max=1/0,this._queue=[],this._timeout=null,this._extended=null,this.setOptions(t)}e.prototype.setOptions=function(t){t&&"undefined"!=typeof t.delay&&(this.delay=t.delay),t&&"undefined"!=typeof t.max&&(this.max=t.max),this._flushIfNeeded()},e.extend=function(t,i){var o=new e(i);if(void 0!==t.flush)throw new Error("Target object already has a property flush");t.flush=function(){o.flush()};var s=[{name:"flush",original:void 0}];if(i&&i.replace)for(var n=0;nthis.max&&this.flush(),clearTimeout(this._timeout),this.queue.length>0&&"number"==typeof this.delay){var t=this;this._timeout=setTimeout(function(){t.flush()},this.delay)}},e.prototype.flush=function(){for(;this._queue.length>0;){var t=this._queue.shift();t.fn.apply(t.context||t.fn,t.args||[])}},t.exports=e},function(t,e,i){function o(t,e,i){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this.containerElement=t,this.width="400px",this.height="400px",this.margin=10,this.defaultXCenter="55%",this.defaultYCenter="50%",this.xLabel="x",this.yLabel="y",this.zLabel="z";var s=function(t){return t};this.xValueLabel=s,this.yValueLabel=s,this.zValueLabel=s,this.filterLabel="time",this.legendLabel="value",this.style=o.STYLE.DOT,this.showPerspective=!0,this.showGrid=!0,this.keepAspectRatio=!0,this.showShadow=!1,this.showGrayBottom=!1,this.showTooltip=!1,this.verticalRatio=.5,this.animationInterval=1e3,this.animationPreload=!1,this.camera=new u,this.eye=new l(0,0,-1),this.dataTable=null,this.dataPoints=null,this.colX=void 0,this.colY=void 0,this.colZ=void 0,this.colValue=void 0,this.colFilter=void 0,this.xMin=0,this.xStep=void 0,this.xMax=1,this.yMin=0,this.yStep=void 0,this.yMax=1,this.zMin=0,this.zStep=void 0,this.zMax=1,this.valueMin=0,this.valueMax=1,this.xBarWidth=1,this.yBarWidth=1,this.colorAxis="#4D4D4D",this.colorGrid="#D3D3D3",this.colorDot="#7DC1FF",this.colorDotBorder="#3267D2",this.create(),this.setOptions(i),e&&this.setData(e)}function s(t){return"clientX"in t?t.clientX:t.targetTouches[0]&&t.targetTouches[0].clientX||0}function n(t){return"clientY"in t?t.clientY:t.targetTouches[0]&&t.targetTouches[0].clientY||0}var r=i(62),a=i(3),h=i(4),d=i(1),l=i(10),c=i(9),u=i(7),p=i(8),f=i(11),m=i(12);r(o.prototype),o.prototype._setScale=function(){this.scale=new l(1/(this.xMax-this.xMin),1/(this.yMax-this.yMin),1/(this.zMax-this.zMin)),this.keepAspectRatio&&(this.scale.x3&&(this.colFilter=3);else{if(this.style!==o.STYLE.DOTCOLOR&&this.style!==o.STYLE.DOTSIZE&&this.style!==o.STYLE.BARCOLOR&&this.style!==o.STYLE.BARSIZE)throw'Unknown style "'+this.style+'"';this.colX=0,this.colY=1,this.colZ=2,this.colValue=3,t.getNumberOfColumns()>4&&(this.colFilter=4)}},o.prototype.getNumberOfRows=function(t){return t.length},o.prototype.getNumberOfColumns=function(t){var e=0;for(var i in t[0])t[0].hasOwnProperty(i)&&e++;return e},o.prototype.getDistinctValues=function(t,e){for(var i=[],o=0;ot[o][e]&&(i.min=t[o][e]),i.maxt;t++){var f=(t-u)/(p-u),g=240*f,v=this._hsv2rgb(g,1,1);c.strokeStyle=v,c.beginPath(),c.moveTo(h,r+t),c.lineTo(a,r+t),c.stroke()}c.strokeStyle=this.colorAxis,c.strokeRect(h,r,i,n)}if(this.style===o.STYLE.DOTSIZE&&(c.strokeStyle=this.colorAxis,c.fillStyle=this.colorDot,c.beginPath(),c.moveTo(h,r),c.lineTo(a,r),c.lineTo(a-i+e,d),c.lineTo(h,d),c.closePath(),c.fill(),c.stroke()),this.style===o.STYLE.DOTCOLOR||this.style===o.STYLE.DOTSIZE){var y=5,b=new m(this.valueMin,this.valueMax,(this.valueMax-this.valueMin)/5,!0);for(b.start(),b.getCurrent()0?this.yMin:this.yMax,s=this._convert3Dto2D(new l(x,r,this.zMin)),Math.cos(2*w)>0?(g.textAlign="center",g.textBaseline="top",s.y+=b):Math.sin(2*w)<0?(g.textAlign="right",g.textBaseline="middle"):(g.textAlign="left",g.textBaseline="middle"),g.fillStyle=this.colorAxis,g.fillText(" "+this.xValueLabel(i.getCurrent())+" ",s.x,s.y),i.next()}for(g.lineWidth=1,o=void 0===this.defaultYStep,i=new m(this.yMin,this.yMax,this.yStep,o),i.start(),i.getCurrent()0?this.xMin:this.xMax,s=this._convert3Dto2D(new l(n,i.getCurrent(),this.zMin)),Math.cos(2*w)<0?(g.textAlign="center",g.textBaseline="top",s.y+=b):Math.sin(2*w)>0?(g.textAlign="right",g.textBaseline="middle"):(g.textAlign="left",g.textBaseline="middle"),g.fillStyle=this.colorAxis,g.fillText(" "+this.yValueLabel(i.getCurrent())+" ",s.x,s.y),i.next();for(g.lineWidth=1,o=void 0===this.defaultZStep,i=new m(this.zMin,this.zMax,this.zStep,o),i.start(),i.getCurrent()0?this.xMin:this.xMax,r=Math.sin(w)<0?this.yMin:this.yMax;!i.end();)t=this._convert3Dto2D(new l(n,r,i.getCurrent())),g.strokeStyle=this.colorAxis,g.beginPath(),g.moveTo(t.x,t.y),g.lineTo(t.x-b,t.y),g.stroke(),g.textAlign="right",g.textBaseline="middle",g.fillStyle=this.colorAxis,g.fillText(this.zValueLabel(i.getCurrent())+" ",t.x-5,t.y),i.next();g.lineWidth=1,t=this._convert3Dto2D(new l(n,r,this.zMin)),e=this._convert3Dto2D(new l(n,r,this.zMax)),g.strokeStyle=this.colorAxis,g.beginPath(),g.moveTo(t.x,t.y),g.lineTo(e.x,e.y),g.stroke(),g.lineWidth=1,u=this._convert3Dto2D(new l(this.xMin,this.yMin,this.zMin)),p=this._convert3Dto2D(new l(this.xMax,this.yMin,this.zMin)),g.strokeStyle=this.colorAxis,g.beginPath(),g.moveTo(u.x,u.y),g.lineTo(p.x,p.y),g.stroke(),u=this._convert3Dto2D(new l(this.xMin,this.yMax,this.zMin)),p=this._convert3Dto2D(new l(this.xMax,this.yMax,this.zMin)),g.strokeStyle=this.colorAxis,g.beginPath(),g.moveTo(u.x,u.y),g.lineTo(p.x,p.y),g.stroke(),g.lineWidth=1,t=this._convert3Dto2D(new l(this.xMin,this.yMin,this.zMin)),e=this._convert3Dto2D(new l(this.xMin,this.yMax,this.zMin)),g.strokeStyle=this.colorAxis,g.beginPath(),g.moveTo(t.x,t.y),g.lineTo(e.x,e.y),g.stroke(),t=this._convert3Dto2D(new l(this.xMax,this.yMin,this.zMin)),e=this._convert3Dto2D(new l(this.xMax,this.yMax,this.zMin)),g.strokeStyle=this.colorAxis,g.beginPath(),g.moveTo(t.x,t.y),g.lineTo(e.x,e.y),g.stroke();var _=this.xLabel;_.length>0&&(c=.1/this.scale.y,n=(this.xMin+this.xMax)/2,r=Math.cos(w)>0?this.yMin-c:this.yMax+c,s=this._convert3Dto2D(new l(n,r,this.zMin)),Math.cos(2*w)>0?(g.textAlign="center",g.textBaseline="top"):Math.sin(2*w)<0?(g.textAlign="right",g.textBaseline="middle"):(g.textAlign="left",g.textBaseline="middle"),g.fillStyle=this.colorAxis,g.fillText(_,s.x,s.y));var M=this.yLabel;M.length>0&&(d=.1/this.scale.x,n=Math.sin(w)>0?this.xMin-d:this.xMax+d,r=(this.yMin+this.yMax)/2,s=this._convert3Dto2D(new l(n,r,this.zMin)),Math.cos(2*w)<0?(g.textAlign="center",g.textBaseline="top"):Math.sin(2*w)>0?(g.textAlign="right",g.textBaseline="middle"):(g.textAlign="left",g.textBaseline="middle"),g.fillStyle=this.colorAxis,g.fillText(M,s.x,s.y));var D=this.zLabel;D.length>0&&(h=30,n=Math.cos(w)>0?this.xMin:this.xMax,r=Math.sin(w)<0?this.yMin:this.yMax,a=(this.zMin+this.zMax)/2,s=this._convert3Dto2D(new l(n,r,a)),g.textAlign="right",g.textBaseline="middle",g.fillStyle=this.colorAxis,g.fillText(D,s.x-h,s.y))},o.prototype._hsv2rgb=function(t,e,i){var o,s,n,r,a,h;switch(r=i*e,a=Math.floor(t/60),h=r*(1-Math.abs(t/60%2-1)),a){case 0:o=r,s=h,n=0;break;case 1:o=h,s=r,n=0;break;case 2:o=0,s=r,n=h;break;case 3:o=0,s=h,n=r;break;case 4:o=h,s=0,n=r;break;case 5:o=r,s=0,n=h;break;default:o=0,s=0,n=0}return"RGB("+parseInt(255*o)+","+parseInt(255*s)+","+parseInt(255*n)+")"},o.prototype._redrawDataGrid=function(){var t,e,i,s,n,r,a,h,d,c,u,p,f,m=this.frame.canvas,g=m.getContext("2d");if(!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(n=0;n0}else r=!0;r?(f=(t.point.z+e.point.z+i.point.z+s.point.z)/4,c=240*(1-(f-this.zMin)*this.scale.z/this.verticalRatio),u=1,this.showShadow?(p=Math.min(1+M.x/D/2,1),a=this._hsv2rgb(c,u,p),h=a):(p=1,a=this._hsv2rgb(c,u,p),h=this.colorAxis)):(a="gray",h=this.colorAxis),d=.5,g.lineWidth=d,g.fillStyle=a,g.strokeStyle=h,g.beginPath(),g.moveTo(t.screen.x,t.screen.y),g.lineTo(e.screen.x,e.screen.y),g.lineTo(s.screen.x,s.screen.y),g.lineTo(i.screen.x,i.screen.y),g.closePath(),g.fill(),g.stroke()}}else for(n=0;nu&&(u=0);var p,f,m;this.style===o.STYLE.DOTCOLOR?(p=240*(1-(d.point.value-this.valueMin)*this.scale.value),f=this._hsv2rgb(p,1,1),m=this._hsv2rgb(p,1,.8)):this.style===o.STYLE.DOTSIZE?(f=this.colorDot,m=this.colorDotBorder):(p=240*(1-(d.point.z-this.zMin)*this.scale.z/this.verticalRatio),f=this._hsv2rgb(p,1,1),m=this._hsv2rgb(p,1,.8)),i.lineWidth=1,i.strokeStyle=m,i.fillStyle=f,i.beginPath(),i.arc(d.screen.x,d.screen.y,u,0,2*Math.PI,!0),i.fill(),i.stroke()}}},o.prototype._redrawDataBar=function(){var t,e,i,s,n=this.frame.canvas,r=n.getContext("2d");if(!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(t=0;t0&&(t=this.dataPoints[0],o.lineWidth=1,o.strokeStyle="blue",o.beginPath(),o.moveTo(t.screen.x,t.screen.y)),e=1;e0&&o.stroke()}},o.prototype._onMouseDown=function(t){if(t=t||window.event,this.leftButtonDown&&this._onMouseUp(t),this.leftButtonDown=t.which?1===t.which:1===t.button,this.leftButtonDown||this.touchDown){this.startMouseX=s(t),this.startMouseY=n(t),this.startStart=new Date(this.start),this.startEnd=new Date(this.end),this.startArmRotation=this.camera.getArmRotation(),this.frame.style.cursor="move";var e=this;this.onmousemove=function(t){e._onMouseMove(t)},this.onmouseup=function(t){e._onMouseUp(t)},d.addEventListener(document,"mousemove",e.onmousemove),d.addEventListener(document,"mouseup",e.onmouseup),d.preventDefault(t)}},o.prototype._onMouseMove=function(t){t=t||window.event;var e=parseFloat(s(t))-this.startMouseX,i=parseFloat(n(t))-this.startMouseY,o=this.startArmRotation.horizontal+e/200,r=this.startArmRotation.vertical+i/200,a=4,h=Math.sin(a/360*2*Math.PI);Math.abs(Math.sin(o))0?1:0>t?-1:0}var o=e[0],s=e[1],n=e[2],r=i((s.x-o.x)*(t.y-o.y)-(s.y-o.y)*(t.x-o.x)),a=i((n.x-s.x)*(t.y-s.y)-(n.y-s.y)*(t.x-s.x)),h=i((o.x-n.x)*(t.y-n.y)-(o.y-n.y)*(t.x-n.x));return!(0!=r&&0!=a&&r!=a||0!=a&&0!=h&&a!=h||0!=r&&0!=h&&r!=h)},o.prototype._dataPointFromXY=function(t,e){var i,s=100,n=null,r=null,a=null,h=new c(t,e);if(this.style===o.STYLE.BAR||this.style===o.STYLE.BARCOLOR||this.style===o.STYLE.BARSIZE)for(i=this.dataPoints.length-1;i>=0;i--){n=this.dataPoints[i];var d=n.surfaces;if(d)for(var l=d.length-1;l>=0;l--){var u=d[l],p=u.corners,f=[p[0].screen,p[1].screen,p[2].screen],m=[p[2].screen,p[3].screen,p[0].screen];if(this._insideTriangle(h,f)||this._insideTriangle(h,m))return n}}else for(i=0;ib)&&s>b&&(a=b,r=n)}}return r},o.prototype._showTooltip=function(t){var e,i,o;this.tooltip?(e=this.tooltip.dom.content,i=this.tooltip.dom.line,o=this.tooltip.dom.dot):(e=document.createElement("div"),e.style.position="absolute",e.style.padding="10px",e.style.border="1px solid #4d4d4d",e.style.color="#1a1a1a",e.style.background="rgba(255,255,255,0.7)",e.style.borderRadius="2px",e.style.boxShadow="5px 5px 10px rgba(128,128,128,0.5)",i=document.createElement("div"),i.style.position="absolute",i.style.height="40px",i.style.width="0",i.style.borderLeft="1px solid #4d4d4d",o=document.createElement("div"),o.style.position="absolute",o.style.height="0",o.style.width="0",o.style.border="5px solid #4d4d4d",o.style.borderRadius="5px",this.tooltip={dataPoint:null,dom:{content:e,line:i,dot:o}}),this._hideTooltip(),this.tooltip.dataPoint=t,e.innerHTML="function"==typeof this.showTooltip?this.showTooltip(t.point):"
x:"+t.point.x+"
y:"+t.point.y+"
z:"+t.point.z+"
",e.style.left="0",e.style.top="0",this.frame.appendChild(e),this.frame.appendChild(i),this.frame.appendChild(o);var s=e.offsetWidth,n=e.offsetHeight,r=i.offsetHeight,a=o.offsetWidth,h=o.offsetHeight,d=t.screen.x-s/2;d=Math.min(Math.max(d,10),this.frame.clientWidth-10-s),i.style.left=t.screen.x+"px",i.style.top=t.screen.y-r+"px",e.style.left=d+"px",e.style.top=t.screen.y-r-n+"px",o.style.left=t.screen.x-a/2+"px",o.style.top=t.screen.y-h/2+"px"},o.prototype._hideTooltip=function(){if(this.tooltip){this.tooltip.dataPoint=null;for(var t in this.tooltip.dom)if(this.tooltip.dom.hasOwnProperty(t)){var e=this.tooltip.dom[t];e&&e.parentNode&&e.parentNode.removeChild(e)}}},t.exports=o},function(t,e,i){function o(){this.armLocation=new s,this.armRotation={},this.armRotation.horizontal=0,this.armRotation.vertical=0,this.armLength=1.7,this.cameraLocation=new s,this.cameraRotation=new s(.5*Math.PI,0,0),this.calculateCameraOrientation()}var s=i(10);o.prototype.setArmLocation=function(t,e,i){this.armLocation.x=t,this.armLocation.y=e,this.armLocation.z=i,this.calculateCameraOrientation()},o.prototype.setArmRotation=function(t,e){void 0!==t&&(this.armRotation.horizontal=t),void 0!==e&&(this.armRotation.vertical=e,this.armRotation.vertical<0&&(this.armRotation.vertical=0),this.armRotation.vertical>.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),(void 0!==t||void 0!==e)&&this.calculateCameraOrientation()},o.prototype.getArmRotation=function(){var t={};return t.horizontal=this.armRotation.horizontal,t.vertical=this.armRotation.vertical,t},o.prototype.setArmLength=function(t){void 0!==t&&(this.armLength=t,this.armLength<.71&&(this.armLength=.71),this.armLength>5&&(this.armLength=5),this.calculateCameraOrientation())},o.prototype.getArmLength=function(){return this.armLength},o.prototype.getCameraLocation=function(){return this.cameraLocation},o.prototype.getCameraRotation=function(){return this.cameraRotation},o.prototype.calculateCameraOrientation=function(){this.cameraLocation.x=this.armLocation.x-this.armLength*Math.sin(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.y=this.armLocation.y-this.armLength*Math.cos(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.z=this.armLocation.z+this.armLength*Math.sin(this.armRotation.vertical),this.cameraRotation.x=Math.PI/2-this.armRotation.vertical,this.cameraRotation.y=0,this.cameraRotation.z=-this.armRotation.horizontal},t.exports=o},function(t,e,i){function o(t,e,i){this.data=t,this.column=e,this.graph=i,this.index=void 0,this.value=void 0,this.values=i.getDistinctValues(t.get(),this.column),this.values.sort(function(t,e){return t>e?1:e>t?-1:0}),this.values.length>0&&this.selectValue(0),this.dataPoints=[],this.loaded=!1,this.onLoadCallback=void 0,i.animationPreload?(this.loaded=!1,this.loadInBackground()):this.loaded=!0}var s=i(4);o.prototype.isLoaded=function(){return this.loaded},o.prototype.getLoadedProgress=function(){for(var t=this.values.length,e=0;this.dataPoints[e];)e++;return Math.round(e/t*100)},o.prototype.getLabel=function(){return this.graph.filterLabel},o.prototype.getColumn=function(){return this.column},o.prototype.getSelectedValue=function(){return void 0===this.index?void 0:this.values[this.index]},o.prototype.getValues=function(){return this.values},o.prototype.getValue=function(t){if(t>=this.values.length)throw"Error: index out of range";return this.values[t]},o.prototype._getDataPoints=function(t){if(void 0===t&&(t=this.index),void 0===t)return[];var e;if(this.dataPoints[t])e=this.dataPoints[t]; else{var i={};i.column=this.column,i.value=this.values[t];var o=new s(this.data,{filter:function(t){return t[i.column]==i.value}}).get();e=this.graph._getDataPoints(o),this.dataPoints[t]=e}return e},o.prototype.setOnLoadCallback=function(t){this.onLoadCallback=t},o.prototype.selectValue=function(t){if(t>=this.values.length)throw"Error: index out of range";this.index=t,this.value=this.values[t]},o.prototype.loadInBackground=function(t){void 0===t&&(t=0);var e=this.graph.frame;if(t0&&(t--,this.setIndex(t))},o.prototype.next=function(){var t=this.getIndex();t0?this.setIndex(0):this.index=void 0},o.prototype.setIndex=function(t){if(!(to&&(o=0),o>this.values.length-1&&(o=this.values.length-1),o},o.prototype.indexToLeft=function(t){var e=parseFloat(this.frame.bar.style.width)-this.frame.slide.clientWidth-10,i=t/(this.values.length-1)*e,o=i+3;return o},o.prototype._onMouseMove=function(t){var e=t.clientX-this.startClientX,i=this.startSlideX+e,o=this.leftToIndex(i);this.setIndex(o),s.preventDefault()},o.prototype._onMouseUp=function(){this.frame.style.cursor="auto",s.removeEventListener(document,"mousemove",this.onmousemove),s.removeEventListener(document,"mouseup",this.onmouseup),s.preventDefault()},t.exports=o},function(t){function e(t,e,i,o){this._start=0,this._end=0,this._step=1,this.prettyStep=!0,this.precision=5,this._current=0,this.setRange(t,e,i,o)}e.prototype.setRange=function(t,e,i,o){this._start=t?t:0,this._end=e?e:0,this.setStep(i,o)},e.prototype.setStep=function(t,i){void 0===t||0>=t||(void 0!==i&&(this.prettyStep=i),this._step=this.prettyStep===!0?e.calculatePrettyStep(t):t)},e.calculatePrettyStep=function(t){var e=function(t){return Math.log(t)/Math.LN10},i=Math.pow(10,Math.round(e(t))),o=2*Math.pow(10,Math.round(e(t/2))),s=5*Math.pow(10,Math.round(e(t/5))),n=i;return Math.abs(o-t)<=Math.abs(n-t)&&(n=o),Math.abs(s-t)<=Math.abs(n-t)&&(n=s),0>=n&&(n=1),n},e.prototype.getCurrent=function(){return parseFloat(this._current.toPrecision(this.precision))},e.prototype.getStep=function(){return this._step},e.prototype.start=function(){this._current=this._start-this._start%this._step},e.prototype.next=function(){this._current+=this._step},e.prototype.end=function(){return this._current>this._end},t.exports=e},function(t,e,i){function o(t,e,i,h){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");if(!(Array.isArray(i)||i instanceof n||i instanceof r)&&i instanceof Object){var p=h;h=i,i=p}var f=this;this.defaultOptions={start:null,end:null,autoResize:!0,orientation:"bottom",width:null,height:null,maxHeight:null,minHeight:null},this.options=s.deepExtend({},this.defaultOptions),this._create(t),this.components=[],this.body={dom:this.dom,domProps:this.props,emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this)},hiddenDates:[],util:{getScale:function(){return f.timeAxis.step.scale},getStep:function(){return f.timeAxis.step.step},toScreen:f._toScreen.bind(f),toGlobalScreen:f._toGlobalScreen.bind(f),toTime:f._toTime.bind(f),toGlobalTime:f._toGlobalTime.bind(f)}},this.range=new a(this.body),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new d(this.body),this.components.push(this.timeAxis),this.currentTime=new l(this.body),this.components.push(this.currentTime),this.customTime=new c(this.body),this.components.push(this.customTime),this.itemSet=new u(this.body),this.components.push(this.itemSet),this.itemsData=null,this.groupsData=null,h&&this.setOptions(h),i&&this.setGroups(i),e?this.setItems(e):this._redraw()}var s=(i(62),i(45),i(1)),n=i(3),r=i(4),a=i(17),h=i(46),d=i(35),l=i(26),c=i(27),u=i(32);o.prototype=new h,o.prototype.redraw=function(){this.itemSet&&this.itemSet.markDirty({refreshItems:!0}),this._redraw()},o.prototype.setItems=function(t){var e,i=null==this.itemsData;if(e=t?t instanceof n||t instanceof r?t:new n(t,{type:{start:"Date",end:"Date"}}):null,this.itemsData=e,this.itemSet&&this.itemSet.setItems(e),i)if(void 0!=this.options.start||void 0!=this.options.end){if(void 0==this.options.start||void 0==this.options.end)var o=this._getDataRange();var s=void 0!=this.options.start?this.options.start:o.start,a=void 0!=this.options.end?this.options.end:o.end;this.setWindow(s,a,{animate:!1})}else this.fit({animate:!1})},o.prototype.setGroups=function(t){var e;e=t?t instanceof n||t instanceof r?t:new n(t):null,this.groupsData=e,this.itemSet.setGroups(e)},o.prototype.setSelection=function(t,e){this.itemSet&&this.itemSet.setSelection(t),e&&e.focus&&this.focus(t,e)},o.prototype.getSelection=function(){return this.itemSet&&this.itemSet.getSelection()||[]},o.prototype.focus=function(t,e){if(this.itemsData&&void 0!=t){var i=Array.isArray(t)?t:[t],o=this.itemsData.getDataSet().get(i,{type:{start:"Date",end:"Date"}}),s=null,n=null;if(o.forEach(function(t){var e=t.start.valueOf(),i="end"in t?t.end.valueOf():t.start.valueOf();(null===s||s>e)&&(s=e),(null===n||i>n)&&(n=i)}),null!==s&&null!==n){var r=(s+n)/2,a=Math.max(this.range.end-this.range.start,1.1*(n-s)),h=e&&void 0!==e.animate?e.animate:!0;this.range.setRange(r-a/2,r+a/2,h)}}},o.prototype.getItemRange=function(){var t=this.itemsData.getDataSet(),e=null,i=null;if(t){var o=t.min("start");e=o?s.convert(o.start,"Date").valueOf():null;var n=t.max("start");n&&(i=s.convert(n.start,"Date").valueOf());var r=t.max("end");r&&(i=null==i?s.convert(r.end,"Date").valueOf():Math.max(i,s.convert(r.end,"Date").valueOf()))}return{min:null!=e?new Date(e):null,max:null!=i?new Date(i):null}},t.exports=o},function(t,e,i){function o(t,e,i,o){if(!(Array.isArray(i)||i instanceof n)&&i instanceof Object){var r=o;o=i,i=r}var h=this;this.defaultOptions={start:null,end:null,autoResize:!0,orientation:"bottom",width:null,height:null,maxHeight:null,minHeight:null},this.options=s.deepExtend({},this.defaultOptions),this._create(t),this.components=[],this.body={dom:this.dom,domProps:this.props,emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this)},hiddenDates:[],util:{toScreen:h._toScreen.bind(h),toGlobalScreen:h._toGlobalScreen.bind(h),toTime:h._toTime.bind(h),toGlobalTime:h._toGlobalTime.bind(h)}},this.range=new a(this.body),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new d(this.body),this.components.push(this.timeAxis),this.currentTime=new l(this.body),this.components.push(this.currentTime),this.customTime=new c(this.body),this.components.push(this.customTime),this.linegraph=new u(this.body),this.components.push(this.linegraph),this.itemsData=null,this.groupsData=null,o&&this.setOptions(o),i&&this.setGroups(i),e?this.setItems(e):this._redraw()}var s=(i(62),i(45),i(1)),n=i(3),r=i(4),a=i(17),h=i(46),d=i(35),l=i(26),c=i(27),u=i(34);o.prototype=new h,o.prototype.setItems=function(t){var e,i=null==this.itemsData;if(e=t?t instanceof n||t instanceof r?t:new n(t,{type:{start:"Date",end:"Date"}}):null,this.itemsData=e,this.linegraph&&this.linegraph.setItems(e),i)if(void 0!=this.options.start||void 0!=this.options.end){var o=void 0!=this.options.start?this.options.start:null,s=void 0!=this.options.end?this.options.end:null;this.setWindow(o,s,{animate:!1})}else this.fit({animate:!1})},o.prototype.setGroups=function(t){var e;e=t?t instanceof n||t instanceof r?t:new n(t):null,this.groupsData=e,this.linegraph.setGroups(e)},o.prototype.getLegend=function(t,e,i){return void 0===e&&(e=15),void 0===i&&(i=15),void 0!==this.linegraph.groups[t]?this.linegraph.groups[t].getLegend(e,i):"cannot find group:"+t},o.prototype.isGroupVisible=function(t){return void 0!==this.linegraph.groups[t]?this.linegraph.groups[t].visible&&(void 0===this.linegraph.options.groups.visibility[t]||1==this.linegraph.options.groups.visibility[t]):!1},o.prototype.getItemRange=function(){var t=null,e=null;for(var i in this.linegraph.groups)if(this.linegraph.groups.hasOwnProperty(i)&&1==this.linegraph.groups[i].visible)for(var o=0;or?r:t,e=null==e?r:r>e?r:e}return{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}},t.exports=o},function(t,e,i){var o=i(44);e.convertHiddenOptions=function(t,e){if(t.hiddenDates=[],e&&1==Array.isArray(e)){for(var i=0;i=4*a){var u=0,p=n.clone();switch(i[h].repeat){case"daily":d.day()!=l.day()&&(u=1),d.dayOfYear(s.dayOfYear()),d.year(s.year()),d.subtract(7,"days"),l.dayOfYear(s.dayOfYear()),l.year(s.year()),l.subtract(7-u,"days"),p.add(1,"weeks");break;case"weekly":var f=l.diff(d,"days"),m=d.day();d.date(s.date()),d.month(s.month()),d.year(s.year()),l=d.clone(),d.day(m),l.day(m),l.add(f,"days"),d.subtract(1,"weeks"),l.subtract(1,"weeks"),p.add(1,"weeks");break;case"monthly":d.month()!=l.month()&&(u=1),d.month(s.month()),d.year(s.year()),d.subtract(1,"months"),l.month(s.month()),l.year(s.year()),l.subtract(1,"months"),l.add(u,"months"),p.add(1,"months");break;case"yearly":d.year()!=l.year()&&(u=1),d.year(s.year()),d.subtract(1,"years"),l.year(s.year()),l.subtract(1,"years"),l.add(u,"years"),p.add(1,"years");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",i[h].repeat)}for(;p>d;)switch(t.hiddenDates.push({start:d.valueOf(),end:l.valueOf()}),i[h].repeat){case"daily":d.add(1,"days"),l.add(1,"days");break;case"weekly":d.add(1,"weeks"),l.add(1,"weeks");break;case"monthly":d.add(1,"months"),l.add(1,"months");break;case"yearly":d.add(1,"y"),l.add(1,"y");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",i[h].repeat)}t.hiddenDates.push({start:d.valueOf(),end:l.valueOf()})}}e.removeDuplicates(t);var g=e.isHidden(t.range.start,t.hiddenDates),v=e.isHidden(t.range.end,t.hiddenDates),y=t.range.start,b=t.range.end;1==g.hidden&&(y=1==t.range.startToFront?g.startDate-1:g.endDate+1),1==v.hidden&&(b=1==t.range.endToFront?v.startDate-1:v.endDate+1),(1==g.hidden||1==v.hidden)&&t.range._applyRange(y,b)}},e.removeDuplicates=function(t){for(var e=t.hiddenDates,i=[],o=0;o=e[o].start&&e[s].end<=e[o].end?e[s].remove=!0:e[s].start>=e[o].start&&e[s].start<=e[o].end?(e[o].end=e[s].end,e[s].remove=!0):e[s].end>=e[o].start&&e[s].end<=e[o].end&&(e[o].start=e[s].start,e[s].remove=!0));for(var o=0;o=r&&a>s){i=!0;break}}if(1==i&&s=e&&i>r&&(o+=r-n)}return o},e.correctTimeForHidden=function(t,i,s){return s=o(s).toDate().valueOf(),s-=e.getHiddenDurationBefore(t,i,s)},e.getHiddenDurationBefore=function(t,e,i){var s=0;i=o(i).toDate().valueOf();for(var n=0;n=e.start&&a=a&&(s+=a-r)}return s},e.getAccumulatedHiddenDuration=function(t,e,i){for(var o=0,s=0,n=e.start,r=0;r=e.start&&h=i)break;o+=h-a}}return o},e.snapAwayFromHidden=function(t,i,o,s){var n=e.isHidden(i,t);return 1==n.hidden?0>o?1==s?n.startDate-(n.endDate-i)-1:n.startDate-1:1==s?n.endDate+(i-n.startDate)+1:n.endDate+1:i},e.isHidden=function(t,e){for(var i=0;i=o&&s>t)return{hidden:!0,startDate:o,endDate:s}}return{hidden:!1,startDate:o,endDate:s}}},function(t){function e(t,e,i,o,s,n){this.current=0,this.autoScale=!0,this.stepIndex=0,this.step=1,this.scale=1,this.marginStart,this.marginEnd,this.deadSpace=0,this.majorSteps=[1,2,5,10],this.minorSteps=[.25,.5,1,2],this.alignZeros=n,this.setRange(t,e,i,o,s)}e.prototype.setRange=function(t,e,i,o,s){this._start=void 0===s.min?t:s.min,this._end=void 0===s.max?e:s.max,this._start==this._end&&(this._start-=.75,this._end+=1),1==this.autoScale&&this.setMinimumStep(i,o),this.setFirst(s)},e.prototype.setMinimumStep=function(t,e){var i=this._end-this._start,o=1.2*i,s=t*(o/e),n=Math.round(Math.log(o)/Math.LN10),r=-1,a=Math.pow(10,n),h=0;0>n&&(h=n);for(var d=!1,l=h;Math.abs(l)<=Math.abs(n);l++){a=Math.pow(10,l);for(var c=0;c=s){d=!0,r=c;break}}if(1==d)break}this.stepIndex=r,this.scale=a,this.step=a*this.minorSteps[r]},e.prototype.setFirst=function(t){void 0===t&&(t={});var e=void 0===t.min?this._start-2*this.scale*this.minorSteps[this.stepIndex]:t.min,i=void 0===t.max?this._end+this.scale*this.minorSteps[this.stepIndex]:t.max;this.marginEnd=void 0===t.max?this.roundToMinor(i):t.max,this.marginStart=void 0===t.min?this.roundToMinor(e):t.min,1==this.alignZeros&&(this.marginEnd-this.marginStart)%this.step!=0&&(this.marginEnd+=this.marginEnd%this.step),this.deadSpace=this.roundToMinor(i)-i+this.roundToMinor(e)-e,this.marginRange=this.marginEnd-this.marginStart,this.current=this.marginEnd},e.prototype.roundToMinor=function(t){var e=t-t%(this.scale*this.minorSteps[this.stepIndex]);return t%(this.scale*this.minorSteps[this.stepIndex])>.5*this.scale*this.minorSteps[this.stepIndex]?e+this.scale*this.minorSteps[this.stepIndex]:e},e.prototype.hasNext=function(){return this.current>=this.marginStart},e.prototype.next=function(){var t=this.current;this.current-=this.step,this.current==t&&(this.current=this._end)},e.prototype.previous=function(){this.current+=this.step,this.marginEnd+=this.step,this.marginRange=this.marginEnd-this.marginStart},e.prototype.getCurrent=function(t){var e=Math.abs(this.current)0;o--){if("0"!=i[o]){if("."==i[o]||","==i[o]){i=i.slice(0,o);break}break}i=i.slice(0,o)}}else{var s="",n=i.indexOf("e");if(-1!=n&&(s=i.slice(n),i=i.slice(0,n)),n=Math.max(i.indexOf(","),i.indexOf(".")),-1===n?(0!==t&&(i+="."),n=i.length+t):0!==t&&(n+=t+1),n>i.length)for(var r=n-i.length;r>0;r--)i+="0";else i=i.slice(0,n);i+=s}return i},e.prototype.isMajor=function(){return this.current%(this.scale*this.majorSteps[this.stepIndex])==0},t.exports=e},function(t,e,i){function o(t,e){var i=a().hours(0).minutes(0).seconds(0).milliseconds(0);this.start=i.clone().add(-3,"days").valueOf(),this.end=i.clone().add(4,"days").valueOf(),this.body=t,this.deltaDifference=0,this.scaleOffset=0,this.startToFront=!1,this.endToFront=!0,this.defaultOptions={start:null,end:null,direction:"horizontal",moveable:!0,zoomable:!0,min:null,max:null,zoomMin:10,zoomMax:31536e10},this.options=r.extend({},this.defaultOptions),this.props={touch:{}},this.animateTimer=null,this.body.emitter.on("panstart",this._onDragStart.bind(this)),this.body.emitter.on("panmove",this._onDrag.bind(this)),this.body.emitter.on("panend",this._onDragEnd.bind(this)),this.body.emitter.on("press",this._onHold.bind(this)),this.body.emitter.on("mousewheel",this._onMouseWheel.bind(this)),this.body.emitter.on("touch",this._onTouch.bind(this)),this.body.emitter.on("pinch",this._onPinch.bind(this)),this.setOptions(e)}function s(t){if("horizontal"!=t&&"vertical"!=t)throw new TypeError('Unknown direction "'+t+'". Choose "horizontal" or "vertical".')}function n(t,e){return{x:t.x-r.getAbsoluteLeft(e),y:t.y-r.getAbsoluteTop(e)}}var r=i(1),a=(i(47),i(44)),h=i(25),d=i(15);o.prototype=new h,o.prototype.setOptions=function(t){if(t){var e=["direction","min","max","zoomMin","zoomMax","moveable","zoomable","activate","hiddenDates"];r.selectiveExtend(e,this.options,t),("start"in t||"end"in t)&&this.setRange(t.start,t.end)}},o.prototype.setRange=function(t,e,i,o){o!==!0&&(o=!1);var s=void 0!=t?r.convert(t,"Date").valueOf():null,n=void 0!=e?r.convert(e,"Date").valueOf():null;if(this._cancelAnimation(),i){var a=this,h=this.start,l=this.end,c="number"==typeof i?i:500,u=(new Date).valueOf(),p=!1,f=function(){if(!a.props.touch.dragging){var t=(new Date).valueOf(),e=t-u,i=e>c,g=i||null===s?s:r.easeInOutQuad(e,h,s,c),v=i||null===n?n:r.easeInOutQuad(e,l,n,c);m=a._applyRange(g,v),d.updateHiddenDates(a.body,a.options.hiddenDates),p=p||m,m&&a.body.emitter.emit("rangechange",{start:new Date(a.start),end:new Date(a.end),byUser:o}),i?p&&a.body.emitter.emit("rangechanged",{start:new Date(a.start),end:new Date(a.end),byUser:o}):a.animateTimer=setTimeout(f,20)}};return f()}var m=this._applyRange(s,n);if(d.updateHiddenDates(this.body,this.options.hiddenDates),m){var g={start:new Date(this.start),end:new Date(this.end),byUser:o};this.body.emitter.emit("rangechange",g),this.body.emitter.emit("rangechanged",g)}},o.prototype._cancelAnimation=function(){this.animateTimer&&(clearTimeout(this.animateTimer),this.animateTimer=null)},o.prototype._applyRange=function(t,e){var i,o=null!=t?r.convert(t,"Date").valueOf():this.start,s=null!=e?r.convert(e,"Date").valueOf():this.end,n=null!=this.options.max?r.convert(this.options.max,"Date").valueOf():null,a=null!=this.options.min?r.convert(this.options.min,"Date").valueOf():null;if(isNaN(o)||null===o)throw new Error('Invalid start "'+t+'"');if(isNaN(s)||null===s)throw new Error('Invalid end "'+e+'"');if(o>s&&(s=o),null!==a&&a>o&&(i=a-o,o+=i,s+=i,null!=n&&s>n&&(s=n)),null!==n&&s>n&&(i=s-n,o-=i,s-=i,null!=a&&a>o&&(o=a)),null!==this.options.zoomMin){var h=parseFloat(this.options.zoomMin);0>h&&(h=0),h>s-o&&(this.end-this.start===h&&o>this.start&&sd&&(d=0),s-o>d&&(this.end-this.start===d&&othis.end?(o=this.start,s=this.end):(i=s-o-d,o+=i/2,s-=i/2))}var l=this.start!=o||this.end!=s;return o>=this.start&&o<=this.end||s>=this.start&&s<=this.end||this.start>=o&&this.start<=s||this.end>=o&&this.end<=s||this.body.emitter.emit("checkRangedItems"),this.start=o,this.end=s,l},o.prototype.getRange=function(){return{start:this.start,end:this.end}},o.prototype.conversion=function(t,e){return o.conversion(this.start,this.end,t,e)},o.conversion=function(t,e,i,o){return void 0===o&&(o=0),0!=i&&e-t!=0?{offset:t,scale:i/(e-t-o)}:{offset:0,scale:1}},o.prototype._onDragStart=function(t){this.deltaDifference=0,this.previousDelta=0,this.options.moveable&&this.props.touch.allowDragging&&(this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.dragging=!0,this.body.dom.root&&(this.body.dom.root.style.cursor="move"),t.preventDefault())},o.prototype._onDrag=function(t){if(this.options.moveable&&this.props.touch.allowDragging){var e=this.options.direction;s(e);var i="horizontal"==e?t.deltaX:t.deltaY;i-=this.deltaDifference;var o=this.props.touch.end-this.props.touch.start,n=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end);o-=n;var r="horizontal"==e?this.body.domProps.center.width:this.body.domProps.center.height,a=-i/r*o,h=this.props.touch.start+a,l=this.props.touch.end+a,c=d.snapAwayFromHidden(this.body.hiddenDates,h,this.previousDelta-i,!0),u=d.snapAwayFromHidden(this.body.hiddenDates,l,this.previousDelta-i,!0);if(c!=h||u!=l)return this.deltaDifference+=i,this.props.touch.start=c,this.props.touch.end=u,void this._onDrag(t);this.previousDelta=i,this._applyRange(h,l),this.body.emitter.emit("rangechange",{start:new Date(this.start),end:new Date(this.end),byUser:!0}),t.preventDefault()}},o.prototype._onDragEnd=function(){this.options.moveable&&this.props.touch.allowDragging&&(this.props.touch.dragging=!1,this.body.dom.root&&(this.body.dom.root.style.cursor="auto"),this.body.emitter.emit("rangechanged",{start:new Date(this.start),end:new Date(this.end),byUser:!0}))},o.prototype._onMouseWheel=function(t){if(this.options.zoomable&&this.options.moveable){var e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),e){var i;i=0>e?1-e/5:1/(1+e/5);var o=n({x:t.pageX,y:t.pageY},this.body.dom.center),s=this._pointerToDate(o);this.zoom(i,s,e)}t.preventDefault()}},o.prototype._onTouch=function(){this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.allowDragging=!0,this.props.touch.center=null,this.scaleOffset=0,this.deltaDifference=0},o.prototype._onHold=function(){this.props.touch.allowDragging=!1},o.prototype._onPinch=function(t){if(this.options.zoomable&&this.options.moveable){this.props.touch.allowDragging=!1,this.props.touch.center||(this.props.touch.center=n(t.center,this.body.dom.center));var e=1/(t.scale+this.scaleOffset),i=this._pointerToDate(this.props.touch.center),o=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),s=d.getHiddenDurationBefore(this.body.hiddenDates,this,i),r=o-s,a=i-s+(this.props.touch.start-(i-s))*e,h=i+r+(this.props.touch.end-(i+r))*e;this.startToFront=0>=1-e,this.endToFront=0>=e-1;var l=d.snapAwayFromHidden(this.body.hiddenDates,a,1-e,!0),c=d.snapAwayFromHidden(this.body.hiddenDates,h,e-1,!0);(l!=a||c!=h)&&(this.props.touch.start=l,this.props.touch.end=c,this.scaleOffset=1-t.scale,a=l,h=c),this.setRange(a,h,!1,!0),this.startToFront=!1,this.endToFront=!0,t.preventDefault()}},o.prototype._pointerToDate=function(t){var e,i=this.options.direction;if(s(i),"horizontal"==i)return this.body.util.toTime(t.x).valueOf();var o=this.body.domProps.center.height;return e=this.conversion(o),t.y/e.scale+e.offset},o.prototype.zoom=function(t,e,i){null==e&&(e=(this.start+this.end)/2);var o=d.getHiddenDurationBetween(this.body.hiddenDates,this.start,this.end),s=d.getHiddenDurationBefore(this.body.hiddenDates,this,e),n=o-s,r=e-s+(this.start-(e-s))*t,a=e+n+(this.end-(e+n))*t;this.startToFront=i>0?!1:!0,this.endToFront=-i>0?!1:!0;var h=d.snapAwayFromHidden(this.body.hiddenDates,r,i,!0),l=d.snapAwayFromHidden(this.body.hiddenDates,a,-i,!0);(h!=r||l!=a)&&(r=h,a=l),this.setRange(r,a,!1,!0),this.startToFront=!1,this.endToFront=!0},o.prototype.move=function(t){var e=this.end-this.start,i=this.start+e*t,o=this.end+e*t;this.start=i,this.end=o},o.prototype.moveTo=function(t){var e=(this.start+this.end)/2,i=e-t,o=this.start-i,s=this.end-i;this.setRange(o,s)},t.exports=o},function(t,e){var i=.001;e.orderByStart=function(t){t.sort(function(t,e){return t.data.start-e.data.start})},e.orderByEnd=function(t){t.sort(function(t,e){var i="end"in t.data?t.data.end:t.data.start,o="end"in e.data?e.data.end:e.data.start;return i-o})},e.stack=function(t,i,o){var s,n;if(o)for(s=0,n=t.length;n>s;s++)t[s].top=null;for(s=0,n=t.length;n>s;s++){var r=t[s];if(r.stack&&null===r.top){r.top=i.axis;do{for(var a=null,h=0,d=t.length;d>h;h++){var l=t[h];if(null!==l.top&&l!==r&&l.stack&&e.collision(r,l,i.item)){a=l;break}}null!=a&&(r.top=a.top+a.height+i.item.vertical)}while(a)}}},e.nostack=function(t,e,i){var o,s,n;for(o=0,s=t.length;s>o;o++)if(void 0!==t[o].data.subgroup){n=e.axis;for(var r in i)i.hasOwnProperty(r)&&1==i[r].visible&&i[r].indexe.left&&t.top-o.vertical+ie.top}},function(t,e,i){function o(t,e,i,s){this.current=new Date,this._start=new Date,this._end=new Date,this.autoScale=!0,this.scale="day",this.step=1,this.setRange(t,e,i),this.switchedDay=!1,this.switchedMonth=!1,this.switchedYear=!1,this.hiddenDates=s,void 0===s&&(this.hiddenDates=[]),this.format=o.FORMAT}var s=i(44),n=i(15),r=i(1);o.FORMAT={minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",month:"YYYY",year:""}},o.prototype.setFormat=function(t){var e=r.deepExtend({},o.FORMAT);this.format=r.deepExtend(e,t)},o.prototype.setRange=function(t,e,i){if(!(t instanceof Date&&e instanceof Date))throw"No legal start or end date in method setRange";this._start=void 0!=t?new Date(t.valueOf()):new Date,this._end=void 0!=e?new Date(e.valueOf()):new Date,this.autoScale&&this.setMinimumStep(i)},o.prototype.first=function(){this.current=new Date(this._start.valueOf()),this.roundToMinor()},o.prototype.roundToMinor=function(){switch(this.scale){case"year":this.current.setFullYear(this.step*Math.floor(this.current.getFullYear()/this.step)),this.current.setMonth(0);case"month":this.current.setDate(1);case"day":case"weekday":this.current.setHours(0);case"hour":this.current.setMinutes(0);case"minute":this.current.setSeconds(0);case"second":this.current.setMilliseconds(0)}if(1!=this.step)switch(this.scale){case"millisecond":this.current.setMilliseconds(this.current.getMilliseconds()-this.current.getMilliseconds()%this.step);break;case"second":this.current.setSeconds(this.current.getSeconds()-this.current.getSeconds()%this.step);break;case"minute":this.current.setMinutes(this.current.getMinutes()-this.current.getMinutes()%this.step); break;case"hour":this.current.setHours(this.current.getHours()-this.current.getHours()%this.step);break;case"weekday":case"day":this.current.setDate(this.current.getDate()-1-(this.current.getDate()-1)%this.step+1);break;case"month":this.current.setMonth(this.current.getMonth()-this.current.getMonth()%this.step);break;case"year":this.current.setFullYear(this.current.getFullYear()-this.current.getFullYear()%this.step)}},o.prototype.hasNext=function(){return this.current.valueOf()<=this._end.valueOf()},o.prototype.next=function(){var t=this.current.valueOf();if(this.current.getMonth()<6)switch(this.scale){case"millisecond":this.current=new Date(this.current.valueOf()+this.step);break;case"second":this.current=new Date(this.current.valueOf()+1e3*this.step);break;case"minute":this.current=new Date(this.current.valueOf()+1e3*this.step*60);break;case"hour":this.current=new Date(this.current.valueOf()+1e3*this.step*60*60);var e=this.current.getHours();this.current.setHours(e-e%this.step);break;case"weekday":case"day":this.current.setDate(this.current.getDate()+this.step);break;case"month":this.current.setMonth(this.current.getMonth()+this.step);break;case"year":this.current.setFullYear(this.current.getFullYear()+this.step)}else switch(this.scale){case"millisecond":this.current=new Date(this.current.valueOf()+this.step);break;case"second":this.current.setSeconds(this.current.getSeconds()+this.step);break;case"minute":this.current.setMinutes(this.current.getMinutes()+this.step);break;case"hour":this.current.setHours(this.current.getHours()+this.step);break;case"weekday":case"day":this.current.setDate(this.current.getDate()+this.step);break;case"month":this.current.setMonth(this.current.getMonth()+this.step);break;case"year":this.current.setFullYear(this.current.getFullYear()+this.step)}if(1!=this.step)switch(this.scale){case"millisecond":this.current.getMilliseconds()0?t.step:1,this.autoScale=!1)},o.prototype.setAutoScale=function(t){this.autoScale=t},o.prototype.setMinimumStep=function(t){if(void 0!=t){var e=31104e6,i=2592e6,o=864e5,s=36e5,n=6e4,r=1e3,a=1;1e3*e>t&&(this.scale="year",this.step=1e3),500*e>t&&(this.scale="year",this.step=500),100*e>t&&(this.scale="year",this.step=100),50*e>t&&(this.scale="year",this.step=50),10*e>t&&(this.scale="year",this.step=10),5*e>t&&(this.scale="year",this.step=5),e>t&&(this.scale="year",this.step=1),3*i>t&&(this.scale="month",this.step=3),i>t&&(this.scale="month",this.step=1),5*o>t&&(this.scale="day",this.step=5),2*o>t&&(this.scale="day",this.step=2),o>t&&(this.scale="day",this.step=1),o/2>t&&(this.scale="weekday",this.step=1),4*s>t&&(this.scale="hour",this.step=4),s>t&&(this.scale="hour",this.step=1),15*n>t&&(this.scale="minute",this.step=15),10*n>t&&(this.scale="minute",this.step=10),5*n>t&&(this.scale="minute",this.step=5),n>t&&(this.scale="minute",this.step=1),15*r>t&&(this.scale="second",this.step=15),10*r>t&&(this.scale="second",this.step=10),5*r>t&&(this.scale="second",this.step=5),r>t&&(this.scale="second",this.step=1),200*a>t&&(this.scale="millisecond",this.step=200),100*a>t&&(this.scale="millisecond",this.step=100),50*a>t&&(this.scale="millisecond",this.step=50),10*a>t&&(this.scale="millisecond",this.step=10),5*a>t&&(this.scale="millisecond",this.step=5),a>t&&(this.scale="millisecond",this.step=1)}},o.snap=function(t,e,i){var o=new Date(t.valueOf());if("year"==e){var s=o.getFullYear()+Math.round(o.getMonth()/12);o.setFullYear(Math.round(s/i)*i),o.setMonth(0),o.setDate(0),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)}else if("month"==e)o.getDate()>15?(o.setDate(1),o.setMonth(o.getMonth()+1)):o.setDate(1),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0);else if("day"==e){switch(i){case 5:case 2:o.setHours(24*Math.round(o.getHours()/24));break;default:o.setHours(12*Math.round(o.getHours()/12))}o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)}else if("weekday"==e){switch(i){case 5:case 2:o.setHours(12*Math.round(o.getHours()/12));break;default:o.setHours(6*Math.round(o.getHours()/6))}o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)}else if("hour"==e){switch(i){case 4:o.setMinutes(60*Math.round(o.getMinutes()/60));break;default:o.setMinutes(30*Math.round(o.getMinutes()/30))}o.setSeconds(0),o.setMilliseconds(0)}else if("minute"==e){switch(i){case 15:case 10:o.setMinutes(5*Math.round(o.getMinutes()/5)),o.setSeconds(0);break;case 5:o.setSeconds(60*Math.round(o.getSeconds()/60));break;default:o.setSeconds(30*Math.round(o.getSeconds()/30))}o.setMilliseconds(0)}else if("second"==e)switch(i){case 15:case 10:o.setSeconds(5*Math.round(o.getSeconds()/5)),o.setMilliseconds(0);break;case 5:o.setMilliseconds(1e3*Math.round(o.getMilliseconds()/1e3));break;default:o.setMilliseconds(500*Math.round(o.getMilliseconds()/500))}else if("millisecond"==e){var n=i>5?i/2:1;o.setMilliseconds(Math.round(o.getMilliseconds()/n)*n)}return o},o.prototype.isMajor=function(){if(1==this.switchedYear)switch(this.switchedYear=!1,this.scale){case"year":case"month":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedMonth)switch(this.switchedMonth=!1,this.scale){case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedDay)switch(this.switchedDay=!1,this.scale){case"millisecond":case"second":case"minute":case"hour":return!0;default:return!1}switch(this.scale){case"millisecond":return 0==this.current.getMilliseconds();case"second":return 0==this.current.getSeconds();case"minute":return 0==this.current.getHours()&&0==this.current.getMinutes();case"hour":return 0==this.current.getHours();case"weekday":case"day":return 1==this.current.getDate();case"month":return 0==this.current.getMonth();case"year":return!1;default:return!1}},o.prototype.getLabelMinor=function(t){void 0==t&&(t=this.current);var e=this.format.minorLabels[this.scale];return e&&e.length>0?s(t).format(e):""},o.prototype.getLabelMajor=function(t){void 0==t&&(t=this.current);var e=this.format.majorLabels[this.scale];return e&&e.length>0?s(t).format(e):""},o.prototype.getClassName=function(){function t(t){return t/h%2==0?" even":" odd"}function e(t){return t.isSame(new Date,"day")?" today":t.isSame(s().add(1,"day"),"day")?" tomorrow":t.isSame(s().add(-1,"day"),"day")?" yesterday":""}function i(t){return t.isSame(new Date,"week")?" current-week":""}function o(t){return t.isSame(new Date,"month")?" current-month":""}function n(t){return t.isSame(new Date,"year")?" current-year":""}var r=s(this.current),a=r.locale?r.locale("en"):r.lang("en"),h=this.step;switch(this.scale){case"millisecond":return t(a.milliseconds()).trim();case"second":return t(a.seconds()).trim();case"minute":return t(a.minutes()).trim();case"hour":var d=a.hours();return 4==this.step&&(d=d+"-h"+(d+4)),"h"+d+e(a)+t(a.hours());case"weekday":return a.format("dddd").toLowerCase()+e(a)+i(a)+t(a.date());case"day":var l=a.date(),c=a.format("MMMM").toLowerCase();return"day"+l+" "+c+o(a)+t(l-1);case"month":return a.format("MMMM").toLowerCase()+o(a)+t(a.month());case"year":var u=a.year();return"year"+u+n(a)+t(u);default:return""}},t.exports=o},function(t,e,i){function o(t,e,i){this.id=null,this.parent=null,this.data=t,this.dom=null,this.conversion=e||{},this.options=i||{},this.selected=!1,this.displayed=!1,this.dirty=!0,this.top=null,this.left=null,this.width=null,this.height=null}var s=i(45),n=i(1);o.prototype.stack=!0,o.prototype.select=function(){this.selected=!0,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.unselect=function(){this.selected=!1,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.setData=function(t){this.data=t,this.dirty=!0,this.displayed&&this.redraw()},o.prototype.setParent=function(t){this.displayed?(this.hide(),this.parent=t,this.parent&&this.show()):this.parent=t},o.prototype.isVisible=function(){return!1},o.prototype.show=function(){return!1},o.prototype.hide=function(){return!1},o.prototype.redraw=function(){},o.prototype.repositionX=function(){},o.prototype.repositionY=function(){},o.prototype._repaintDeleteButton=function(t){if(this.selected&&this.options.editable.remove&&!this.dom.deleteButton){var e=this,i=document.createElement("div");i.className="delete",i.title="Delete this item",new s(i).on("tap",function(t){e.parent.removeFromDataSet(e),t.stopPropagation(),t.preventDefault()}),t.appendChild(i),this.dom.deleteButton=i}else!this.selected&&this.dom.deleteButton&&(this.dom.deleteButton.parentNode&&this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton),this.dom.deleteButton=null)},o.prototype._updateContents=function(t){var e;if(this.options.template){var i=this.parent.itemSet.itemsData.get(this.id);e=this.options.template(i)}else e=this.data.content;if(e!==this.content){if(e instanceof Element)t.innerHTML="",t.appendChild(e);else if(void 0!=e)t.innerHTML=e;else if("background"!=this.data.type||void 0!==this.data.content)throw new Error('Property "content" missing in item '+this.id);this.content=e}},o.prototype._updateTitle=function(t){null!=this.data.title?t.title=this.data.title||"":t.removeAttribute("title")},o.prototype._updateDataAttributes=function(t){if(this.options.dataAttributes&&this.options.dataAttributes.length>0){var e=[];if(Array.isArray(this.options.dataAttributes))e=this.options.dataAttributes;else{if("all"!=this.options.dataAttributes)return;e=Object.keys(this.data)}for(var i=0;it.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.content=document.createElement("div"),t.content.className="content",t.box.appendChild(t.content),this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.background;if(!e)throw new Error("Cannot redraw item: parent has no background container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.content),this._updateDataAttributes(this.dom.content),this._updateStyle(this.dom.box);var i=(this.data.className?" "+this.data.className:"")+(this.selected?" selected":"");t.box.className=this.baseClassName+i,this.overflow="hidden"!==window.getComputedStyle(t.content).overflow,this.props.content.width=this.dom.content.offsetWidth,this.height=0,this.dirty=!1}},o.prototype.show=r.prototype.show,o.prototype.hide=r.prototype.hide,o.prototype.repositionX=r.prototype.repositionX,o.prototype.repositionY=function(t){var e="top"===this.options.orientation;this.dom.content.style.top=e?"":"0",this.dom.content.style.bottom=e?"0":"";var i;if(void 0!==this.data.subgroup){var o=this.data.subgroup,s=this.parent.subgroups,r=s[o].index;if(1==e){i=this.parent.subgroups[o].height+t.item.vertical,i+=0==r?t.axis-.5*t.item.vertical:0;var a=this.parent.top;for(var h in s)s.hasOwnProperty(h)&&1==s[h].visible&&s[h].indexr&&(a+=s[h].height+t.item.vertical);i=this.parent.subgroups[o].height+t.item.vertical,this.dom.box.style.top=a+"px",this.dom.box.style.bottom=""}}else this.parent instanceof n?(i=Math.max(this.parent.height,this.parent.itemSet.body.domProps.center.height,this.parent.itemSet.body.domProps.centerContainer.height),this.dom.box.style.top=e?"0":"",this.dom.box.style.bottom=e?"":"0"):(i=this.parent.height,this.dom.box.style.top=this.parent.top+"px",this.dom.box.style.bottom="");this.dom.box.style.height=i+"px"},t.exports=o},function(t,e,i){function o(t,e,i){if(this.props={dot:{width:0,height:0},line:{width:0,height:0}},t&&void 0==t.start)throw new Error('Property "start" missing in item '+t);s.call(this,t,e,i)}{var s=i(20);i(1)}o.prototype=new s(null,null,null),o.prototype.isVisible=function(t){var e=(t.end-t.start)/4;return this.data.start>t.start-e&&this.data.startt.start-e&&this.data.startt.start},o.prototype.redraw=function(){var t=this.dom;if(t||(this.dom={},t=this.dom,t.box=document.createElement("div"),t.content=document.createElement("div"),t.content.className="content",t.box.appendChild(t.content),t.box["timeline-item"]=this,this.dirty=!0),!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!t.box.parentNode){var e=this.parent.dom.foreground;if(!e)throw new Error("Cannot redraw item: parent has no foreground container element");e.appendChild(t.box)}if(this.displayed=!0,this.dirty){this._updateContents(this.dom.content),this._updateTitle(this.dom.box),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);var i=(this.data.className?" "+this.data.className:"")+(this.selected?" selected":"");t.box.className=this.baseClassName+i,this.overflow="hidden"!==window.getComputedStyle(t.content).overflow,this.dom.content.style.maxWidth="none",this.props.content.width=this.dom.content.offsetWidth,this.height=this.dom.box.offsetHeight,this.dom.content.style.maxWidth="",this.dirty=!1}this._repaintDeleteButton(t.box),this._repaintDragLeft(),this._repaintDragRight()},o.prototype.show=function(){this.displayed||this.redraw()},o.prototype.hide=function(){if(this.displayed){var t=this.dom.box;t.parentNode&&t.parentNode.removeChild(t),this.top=null,this.left=null,this.displayed=!1}},o.prototype.repositionX=function(){var t,e,i=this.parent.width,o=this.conversion.toScreen(this.data.start),s=this.conversion.toScreen(this.data.end);-i>o&&(o=-i),s>2*i&&(s=2*i);var n=Math.max(s-o,1);switch(this.overflow?(this.left=o,this.width=n+this.props.content.width,e=this.props.content.width):(this.left=o,this.width=n,e=Math.min(s-o-2*this.options.padding,this.props.content.width)),this.dom.box.style.left=this.left+"px",this.dom.box.style.width=n+"px",this.options.align){case"left":this.dom.content.style.left="0";break;case"right":this.dom.content.style.left=Math.max(n-e-2*this.options.padding,0)+"px";break;case"center":this.dom.content.style.left=Math.max((n-e-2*this.options.padding)/2,0)+"px";break;default:t=this.overflow?s>0?Math.max(-o,0):-e:0>o?Math.min(-o,s-o-e-2*this.options.padding):0,this.dom.content.style.left=t+"px"}},o.prototype.repositionY=function(){var t=this.options.orientation,e=this.dom.box;e.style.top="top"==t?this.top+"px":this.parent.height-this.top-this.height+"px"},o.prototype._repaintDragLeft=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragLeft){var t=document.createElement("div");t.className="drag-left",t.dragLeftItem=this,this.dom.box.appendChild(t),this.dom.dragLeft=t}else!this.selected&&this.dom.dragLeft&&(this.dom.dragLeft.parentNode&&this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft),this.dom.dragLeft=null)},o.prototype._repaintDragRight=function(){if(this.selected&&this.options.editable.updateTime&&!this.dom.dragRight){var t=document.createElement("div");t.className="drag-right",t.dragRightItem=this,this.dom.box.appendChild(t),this.dom.dragRight=t}else!this.selected&&this.dom.dragRight&&(this.dom.dragRight.parentNode&&this.dom.dragRight.parentNode.removeChild(this.dom.dragRight),this.dom.dragRight=null)},t.exports=o},function(t){function e(){this.options=null,this.props=null}e.prototype.setOptions=function(t){t&&util.extend(this.options,t)},e.prototype.redraw=function(){return!1},e.prototype.destroy=function(){},e.prototype._isResized=function(){var t=this.props._previousWidth!==this.props.width||this.props._previousHeight!==this.props.height;return this.props._previousWidth=this.props.width,this.props._previousHeight=this.props.height,t},t.exports=e},function(t,e,i){function o(t,e){this.body=t,this.defaultOptions={showCurrentTime:!0,locales:a,locale:"en"},this.options=s.extend({},this.defaultOptions),this.offset=0,this._create(),this.setOptions(e)}var s=i(1),n=i(25),r=i(44),a=i(48);o.prototype=new n,o.prototype._create=function(){var t=document.createElement("div");t.className="currenttime",t.style.position="absolute",t.style.top="0px",t.style.height="100%",this.bar=t},o.prototype.destroy=function(){this.options.showCurrentTime=!1,this.redraw(),this.body=null},o.prototype.setOptions=function(t){t&&s.selectiveExtend(["showCurrentTime","locale","locales"],this.options,t)},o.prototype.redraw=function(){if(this.options.showCurrentTime){var t=this.body.dom.backgroundVertical;this.bar.parentNode!=t&&(this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),t.appendChild(this.bar),this.start());var e=new Date((new Date).valueOf()+this.offset),i=this.body.util.toScreen(e),o=this.options.locales[this.options.locale],s=o.current+" "+o.time+": "+r(e).format("dddd, MMMM Do YYYY, H:mm:ss");s=s.charAt(0).toUpperCase()+s.substring(1),this.bar.style.left=i+"px",this.bar.title=s}else this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),this.stop();return!1},o.prototype.start=function(){function t(){e.stop();var i=e.body.range.conversion(e.body.domProps.center.width).scale,o=1/i/10;30>o&&(o=30),o>1e3&&(o=1e3),e.redraw(),e.currentTimeTimer=setTimeout(t,o)}var e=this;t()},o.prototype.stop=function(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),delete this.currentTimeTimer)},o.prototype.setCurrentTime=function(t){var e=s.convert(t,"Date").valueOf(),i=(new Date).valueOf();this.offset=e-i,this.redraw()},o.prototype.getCurrentTime=function(){return new Date((new Date).valueOf()+this.offset)},t.exports=o},function(t,e,i){function o(t,e){this.body=t,this.defaultOptions={showCustomTime:!1,locales:h,locale:"en",id:0},this.options=n.extend({},this.defaultOptions),this.customTime=e&&e.time?e.time:new Date,this.eventParams={},this._create(),this.setOptions(e)}var s=i(45),n=i(1),r=i(25),a=i(44),h=i(48);o.prototype=new r,o.prototype.setOptions=function(t){t&&(n.selectiveExtend(["showCustomTime","locale","locales","id"],this.options,t),this.options.id&&this.redraw())},o.prototype._create=function(){var t=document.createElement("div");t.className="customtime",t.style.position="absolute",t.style.top="0px",t.style.height="100%",this.bar=t;var e=document.createElement("div");e.style.position="relative",e.style.top="0px",e.style.left="-10px",e.style.height="100%",e.style.width="20px",t.appendChild(e),this.hammer=new s(e),this.hammer.on("panstart",this._onDragStart.bind(this)),this.hammer.on("panmove",this._onDrag.bind(this)),this.hammer.on("panend",this._onDragEnd.bind(this)),this.hammer.on("pan",function(t){t.preventDefault()})},o.prototype.destroy=function(){this.options.showCustomTime=!1,this.redraw(),this.hammer.enable(!1),this.hammer=null,this.body=null},o.prototype.redraw=function(){if(this.options.showCustomTime){var t=this.body.dom.backgroundVertical;this.bar.parentNode!=t&&(this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),t.appendChild(this.bar));var e=this.body.util.toScreen(this.customTime),i=this.options.locales[this.options.locale],o=i.time+": "+a(this.customTime).format("dddd, MMMM Do YYYY, H:mm:ss");o=o.charAt(0).toUpperCase()+o.substring(1),this.bar.style.left=e+"px",this.bar.title=o}else this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar);return!1},o.prototype.setCustomTime=function(t){this.customTime=n.convert(t,"Date"),this.redraw()},o.prototype.getCustomTime=function(){return new Date(this.customTime.valueOf())},o.prototype._onDragStart=function(t){this.eventParams.dragging=!0,this.eventParams.customTime=this.customTime,t.stopPropagation(),t.preventDefault()},o.prototype._onDrag=function(t){if(this.eventParams.dragging){var e=this.body.util.toScreen(this.eventParams.customTime)+t.deltaX,i=this.body.util.toTime(e);this.setCustomTime(i),this.body.emitter.emit("timechange",{id:this.options.id,time:new Date(this.customTime.valueOf())}),t.stopPropagation(),t.preventDefault()}},o.prototype._onDragEnd=function(t){this.eventParams.dragging&&(this.body.emitter.emit("timechanged",{id:this.options.id,time:new Date(this.customTime.valueOf())}),t.stopPropagation(),t.preventDefault())},t.exports=o},function(t,e,i){function o(t,e,i,o){this.id=s.randomUUID(),this.body=t,this.defaultOptions={orientation:"left",showMinorLabels:!0,showMajorLabels:!0,icons:!0,majorLinesOffset:7,minorLinesOffset:4,labelOffsetX:10,labelOffsetY:2,iconWidth:20,width:"40px",visible:!0,alignZeros:!0,customRange:{left:{min:void 0,max:void 0},right:{min:void 0,max:void 0}},title:{left:{text:void 0},right:{text:void 0}},format:{left:{decimals:void 0},right:{decimals:void 0}}},this.linegraphOptions=o,this.linegraphSVG=i,this.props={},this.DOMelements={lines:{},labels:{},title:{}},this.dom={},this.range={start:0,end:0},this.options=s.extend({},this.defaultOptions),this.conversionFactor=1,this.setOptions(e),this.width=Number((""+this.options.width).replace("px","")),this.minWidth=this.width,this.height=this.linegraphSVG.offsetHeight,this.hidden=!1,this.stepPixels=25,this.stepPixelsForced=25,this.zeroCrossing=-1,this.lineOffset=0,this.master=!0,this.svgElements={},this.iconsRemoved=!1,this.groups={},this.amountOfGroups=0,this._create();var n=this;this.body.emitter.on("verticalDrag",function(){n.dom.lineContainer.style.top=n.body.domProps.scrollTop+"px"})}var s=i(1),n=i(2),r=i(25),a=i(16);o.prototype=new r,o.prototype.addGroup=function(t,e){this.groups.hasOwnProperty(t)||(this.groups[t]=e),this.amountOfGroups+=1},o.prototype.updateGroup=function(t,e){this.groups[t]=e},o.prototype.removeGroup=function(t){this.groups.hasOwnProperty(t)&&(delete this.groups[t],this.amountOfGroups-=1)},o.prototype.setOptions=function(t){if(t){var e=!1;this.options.orientation!=t.orientation&&void 0!==t.orientation&&(e=!0);var i=["orientation","showMinorLabels","showMajorLabels","icons","majorLinesOffset","minorLinesOffset","labelOffsetX","labelOffsetY","iconWidth","width","visible","customRange","title","format","alignZeros"];s.selectiveExtend(i,this.options,t),this.minWidth=Number((""+this.options.width).replace("px","")),1==e&&this.dom.frame&&(this.hide(),this.show())}},o.prototype._create=function(){this.dom.frame=document.createElement("div"),this.dom.frame.style.width=this.options.width,this.dom.frame.style.height=this.height,this.dom.lineContainer=document.createElement("div"),this.dom.lineContainer.style.width="100%",this.dom.lineContainer.style.height=this.height,this.dom.lineContainer.style.position="relative",this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="absolute",this.svg.style.top="0px",this.svg.style.height="100%",this.svg.style.width="100%",this.svg.style.display="block",this.dom.frame.appendChild(this.svg)},o.prototype._redrawGroupIcons=function(){n.prepareElements(this.svgElements);var t,e=this.options.iconWidth,i=15,o=4,s=o+.5*i;t="left"==this.options.orientation?o:this.width-e-o;for(var r in this.groups)this.groups.hasOwnProperty(r)&&(1!=this.groups[r].visible||void 0!==this.linegraphOptions.visibility[r]&&1!=this.linegraphOptions.visibility[r]||(this.groups[r].drawIcon(t,s,this.svgElements,this.svg,e,i),s+=i+o));n.cleanupElements(this.svgElements),this.iconsRemoved=!1},o.prototype._cleanupIcons=function(){0==this.iconsRemoved&&(n.prepareElements(this.svgElements),n.cleanupElements(this.svgElements),this.iconsRemoved=!0)},o.prototype.show=function(){this.hidden=!1,this.dom.frame.parentNode||("left"==this.options.orientation?this.body.dom.left.appendChild(this.dom.frame):this.body.dom.right.appendChild(this.dom.frame)),this.dom.lineContainer.parentNode||this.body.dom.backgroundHorizontal.appendChild(this.dom.lineContainer)},o.prototype.hide=function(){this.hidden=!0,this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame),this.dom.lineContainer.parentNode&&this.dom.lineContainer.parentNode.removeChild(this.dom.lineContainer)},o.prototype.setRange=function(t,e){0==this.master&&1==this.options.alignZeros&&-1!=this.zeroCrossing&&t>0&&(t=0),this.range.start=t,this.range.end=e},o.prototype.redraw=function(){var t=!1,e=0;this.dom.lineContainer.style.top=this.body.domProps.scrollTop+"px";for(var i in this.groups)this.groups.hasOwnProperty(i)&&(1!=this.groups[i].visible||void 0!==this.linegraphOptions.visibility[i]&&1!=this.linegraphOptions.visibility[i]||e++);if(0==this.amountOfGroups||0==e)this.hide();else{this.show(),this.height=Number(this.linegraphSVG.style.height.replace("px","")),this.dom.lineContainer.style.height=this.height+"px",this.width=1==this.options.visible?Number((""+this.options.width).replace("px","")):0;var o=this.props,s=this.dom.frame;s.className="dataaxis",this._calculateCharSize();var n=this.options.orientation,r=this.options.showMinorLabels,a=this.options.showMajorLabels;o.minorLabelHeight=r?o.minorCharHeight:0,o.majorLabelHeight=a?o.majorCharHeight:0,o.minorLineWidth=this.body.dom.backgroundHorizontal.offsetWidth-this.lineOffset-this.width+2*this.options.minorLinesOffset,o.minorLineHeight=1,o.majorLineWidth=this.body.dom.backgroundHorizontal.offsetWidth-this.lineOffset-this.width+2*this.options.majorLinesOffset,o.majorLineHeight=1,"left"==n?(s.style.top="0",s.style.left="0",s.style.bottom="",s.style.width=this.width+"px",s.style.height=this.height+"px",this.props.width=this.body.domProps.left.width,this.props.height=this.body.domProps.left.height):(s.style.top="",s.style.bottom="0",s.style.left="0",s.style.width=this.width+"px",s.style.height=this.height+"px",this.props.width=this.body.domProps.right.width,this.props.height=this.body.domProps.right.height),t=this._redrawLabels(),t=this._isResized()||t,1==this.options.icons?this._redrawGroupIcons():this._cleanupIcons(),this._redrawTitle(n) }return t},o.prototype._redrawLabels=function(){var t=!1;n.prepareElements(this.DOMelements.lines),n.prepareElements(this.DOMelements.labels);var e=this.options.orientation,i=this.master?this.props.majorCharHeight||10:this.stepPixelsForced,o=new a(this.range.start,this.range.end,i,this.dom.frame.offsetHeight,this.options.customRange[this.options.orientation],0==this.master&&this.options.alignZeros);this.step=o;var s=(this.dom.frame.offsetHeight-o.deadSpace*(this.dom.frame.offsetHeight/o.marginRange))/((o.marginRange-o.deadSpace)/o.step);this.stepPixels=s;var r=this.height/s,h=0;if(0==this.master){s=this.stepPixelsForced,h=Math.round(this.dom.frame.offsetHeight/s-r);for(var d=0;.5*h>d;d++)o.previous();if(r=this.height/s,-1!=this.zeroCrossing&&1==this.options.alignZeros){var l=o.marginEnd/o.step-this.zeroCrossing;if(l>0)for(var d=0;l>d;d++)o.next();else if(0>l)for(var d=0;-l>d;d++)o.previous()}}else r+=.25;this.valueAtZero=o.marginEnd;var c,u=0,p=1;void 0!==this.options.format[e]&&(c=this.options.format[e].decimals),this.maxLabelSize=0;for(var f=0;p=0&&this._redrawLabel(f-2,o.getCurrent(c),e,"yAxis major",this.props.majorCharHeight),this._redrawLine(f,e,"grid horizontal major",this.options.majorLinesOffset,this.props.majorLineWidth)):this._redrawLine(f,e,"grid horizontal minor",this.options.minorLinesOffset,this.props.minorLineWidth),1==this.master&&0==o.current&&(this.zeroCrossing=p),p++}this.conversionFactor=0==this.master?f/(this.valueAtZero-o.current):this.dom.frame.offsetHeight/o.marginRange;var g=0;void 0!==this.options.title[e]&&void 0!==this.options.title[e].text&&(g=this.props.titleCharHeight);var v=1==this.options.icons?Math.max(this.options.iconWidth,g)+this.options.labelOffsetX+15:g+this.options.labelOffsetX+15;return this.maxLabelSize>this.width-v&&1==this.options.visible?(this.width=this.maxLabelSize+v,this.options.width=this.width+"px",n.cleanupElements(this.DOMelements.lines),n.cleanupElements(this.DOMelements.labels),this.redraw(),t=!0):this.maxLabelSizethis.minWidth?(this.width=Math.max(this.minWidth,this.maxLabelSize+v),this.options.width=this.width+"px",n.cleanupElements(this.DOMelements.lines),n.cleanupElements(this.DOMelements.labels),this.redraw(),t=!0):(n.cleanupElements(this.DOMelements.lines),n.cleanupElements(this.DOMelements.labels),t=!1),t},o.prototype.convertValue=function(t){var e=this.valueAtZero-t,i=e*this.conversionFactor;return i},o.prototype._redrawLabel=function(t,e,i,o,s){var r=n.getDOMElement("div",this.DOMelements.labels,this.dom.frame);r.className=o,r.innerHTML=e,"left"==i?(r.style.left="-"+this.options.labelOffsetX+"px",r.style.textAlign="right"):(r.style.right="-"+this.options.labelOffsetX+"px",r.style.textAlign="left"),r.style.top=t-.5*s+this.options.labelOffsetY+"px",e+="";var a=Math.max(this.props.majorCharWidth,this.props.minorCharWidth);this.maxLabelSized;d++){var c=this.visibleItems[d];c.repositionY(e)}return o},o.prototype._calculateHeight=function(t){var e,i=this.visibleItems;this.resetSubgroups();var o=this;if(i.length){var n=i[0].top,r=i[0].top+i[0].height;if(s.forEach(i,function(t){n=Math.min(n,t.top),r=Math.max(r,t.top+t.height),void 0!==t.data.subgroup&&(o.subgroups[t.data.subgroup].height=Math.max(o.subgroups[t.data.subgroup].height,t.height),o.subgroups[t.data.subgroup].visible=!0)}),n>t.axis){var a=n-t.axis;r-=a,s.forEach(i,function(t){t.top-=a})}e=r+t.item.vertical/2}else e=t.axis+t.item.vertical;return e=Math.max(e,this.props.label.height)},o.prototype.show=function(){this.dom.label.parentNode||this.itemSet.dom.labelSet.appendChild(this.dom.label),this.dom.foreground.parentNode||this.itemSet.dom.foreground.appendChild(this.dom.foreground),this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background),this.dom.axis.parentNode||this.itemSet.dom.axis.appendChild(this.dom.axis)},o.prototype.hide=function(){var t=this.dom.label;t.parentNode&&t.parentNode.removeChild(t);var e=this.dom.foreground;e.parentNode&&e.parentNode.removeChild(e);var i=this.dom.background;i.parentNode&&i.parentNode.removeChild(i);var o=this.dom.axis;o.parentNode&&o.parentNode.removeChild(o)},o.prototype.add=function(t){if(this.items[t.id]=t,t.setParent(this),void 0!==t.data.subgroup&&(void 0===this.subgroups[t.data.subgroup]&&(this.subgroups[t.data.subgroup]={height:0,visible:!1,index:this.subgroupIndex,items:[]},this.subgroupIndex++),this.subgroups[t.data.subgroup].items.push(t)),this.orderSubgroups(),-1==this.visibleItems.indexOf(t)){var e=this.itemSet.body.range;this._checkIfVisible(t,this.visibleItems,e)}},o.prototype.orderSubgroups=function(){if(void 0!==this.subgroupOrderer){var t=[];if("string"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push({subgroup:e,sortField:this.subgroups[e].items[0].data[this.subgroupOrderer]});t.sort(function(t,e){return t.sortField-e.sortField})}else if("function"==typeof this.subgroupOrderer){for(var e in this.subgroups)t.push(this.subgroups[e].items[0].data);t.sort(this.subgroupOrderer)}if(t.length>0)for(var i=0;it?-1:l>=t?0:1};if(e.length>0)for(n=0;nl}),1==this.checkRangedItems)for(this.checkRangedItems=!1,n=0;nl})}for(n=0;n=0&&(n=e[r],!s(n));r--)void 0===o[n.id]&&(o[n.id]=!0,i.push(n));for(r=t+1;ro;o++){var n=this.visibleItems[o];n.repositionY(e)}return i},o.prototype.show=function(){this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background)},t.exports=o},function(t,e,i){function o(t,e){this.body=t,this.defaultOptions={type:null,orientation:"bottom",align:"auto",stack:!0,groupOrder:null,selectable:!0,editable:{updateTime:!1,updateGroup:!1,add:!1,remove:!1},snap:h.snap,onAdd:function(t,e){e(t)},onUpdate:function(t,e){e(t)},onMove:function(t,e){e(t)},onRemove:function(t,e){e(t)},onMoving:function(t,e){e(t)},margin:{item:{horizontal:10,vertical:10},axis:20},padding:5},this.options=n.extend({},this.defaultOptions),this.itemOptions={type:{start:"Date",end:"Date"}},this.conversion={toScreen:t.util.toScreen,toTime:t.util.toTime},this.dom={},this.props={},this.hammer=null;var i=this;this.itemsData=null,this.groupsData=null,this.itemListeners={add:function(t,e){i._onAdd(e.items)},update:function(t,e){i._onUpdate(e.items)},remove:function(t,e){i._onRemove(e.items)}},this.groupListeners={add:function(t,e){i._onAddGroups(e.items)},update:function(t,e){i._onUpdateGroups(e.items)},remove:function(t,e){i._onRemoveGroups(e.items)}},this.items={},this.groups={},this.groupIds=[],this.selection=[],this.stackDirty=!0,this.touchParams={},this._create(),this.setOptions(e)}var s=i(45),n=i(1),r=i(3),a=i(4),h=i(19),d=i(25),l=i(30),c=i(31),u=i(22),p=i(23),f=i(24),m=i(21),g="__ungrouped__",v="__background__";o.prototype=new d,o.types={background:m,box:u,range:f,point:p},o.prototype._create=function(){var t=document.createElement("div");t.className="itemset",t["timeline-itemset"]=this,this.dom.frame=t;var e=document.createElement("div");e.className="background",t.appendChild(e),this.dom.background=e;var i=document.createElement("div");i.className="foreground",t.appendChild(i),this.dom.foreground=i;var o=document.createElement("div");o.className="axis",this.dom.axis=o;var n=document.createElement("div");n.className="labelset",this.dom.labelSet=n,this._updateUngrouped();var r=new c(v,null,this);r.show(),this.groups[v]=r,this.hammer=new s(this.body.dom.centerContainer),this.hammer.on("hammer.input",function(t){t.isFirst&&this._onTouch(t)}.bind(this)),this.hammer.on("panstart",this._onDragStart.bind(this)),this.hammer.on("panmove",this._onDrag.bind(this)),this.hammer.on("panend",this._onDragEnd.bind(this)),this.hammer.on("tap",this._onSelectItem.bind(this)),this.hammer.on("press",this._onMultiSelectItem.bind(this)),this.hammer.on("doubletap",this._onAddItem.bind(this)),this.show()},o.prototype.setOptions=function(t){if(t){var e=["type","align","orientation","padding","stack","selectable","groupOrder","dataAttributes","template","hide","snap"];n.selectiveExtend(e,this.options,t),"margin"in t&&("number"==typeof t.margin?(this.options.margin.axis=t.margin,this.options.margin.item.horizontal=t.margin,this.options.margin.item.vertical=t.margin):"object"==typeof t.margin&&(n.selectiveExtend(["axis"],this.options.margin,t.margin),"item"in t.margin&&("number"==typeof t.margin.item?(this.options.margin.item.horizontal=t.margin.item,this.options.margin.item.vertical=t.margin.item):"object"==typeof t.margin.item&&n.selectiveExtend(["horizontal","vertical"],this.options.margin.item,t.margin.item)))),"editable"in t&&("boolean"==typeof t.editable?(this.options.editable.updateTime=t.editable,this.options.editable.updateGroup=t.editable,this.options.editable.add=t.editable,this.options.editable.remove=t.editable):"object"==typeof t.editable&&n.selectiveExtend(["updateTime","updateGroup","add","remove"],this.options.editable,t.editable));var i=function(e){var i=t[e];if(i){if(!(i instanceof Function))throw new Error("option "+e+" must be a function "+e+"(item, callback)");this.options[e]=i}}.bind(this);["onAdd","onUpdate","onRemove","onMove","onMoving"].forEach(i),this.markDirty()}},o.prototype.markDirty=function(t){this.groupIds=[],this.stackDirty=!0,t&&t.refreshItems&&n.forEach(this.items,function(t){t.dirty=!0,t.displayed&&t.redraw()})},o.prototype.destroy=function(){this.hide(),this.setItems(null),this.setGroups(null),this.hammer=null,this.body=null,this.conversion=null},o.prototype.hide=function(){this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame),this.dom.axis.parentNode&&this.dom.axis.parentNode.removeChild(this.dom.axis),this.dom.labelSet.parentNode&&this.dom.labelSet.parentNode.removeChild(this.dom.labelSet)},o.prototype.show=function(){this.dom.frame.parentNode||this.body.dom.center.appendChild(this.dom.frame),this.dom.axis.parentNode||this.body.dom.backgroundVertical.appendChild(this.dom.axis),this.dom.labelSet.parentNode||this.body.dom.left.appendChild(this.dom.labelSet)},o.prototype.setSelection=function(t){var e,i,o,s;for(void 0==t&&(t=[]),Array.isArray(t)||(t=[t]),e=0,i=this.selection.length;i>e;e++)o=this.selection[e],s=this.items[o],s&&s.unselect();for(this.selection=[],e=0,i=t.length;i>e;e++)o=t[e],s=this.items[o],s&&(this.selection.push(o),s.select())},o.prototype.getSelection=function(){return this.selection.concat([])},o.prototype.getVisibleItems=function(){var t=this.body.range.getRange(),e=this.body.util.toScreen(t.start),i=this.body.util.toScreen(t.end),o=[];for(var s in this.groups)if(this.groups.hasOwnProperty(s))for(var n=this.groups[s],r=n.visibleItems,a=0;ae&&o.push(h.id)}return o},o.prototype._deselect=function(t){for(var e=this.selection,i=0,o=e.length;o>i;i++)if(e[i]==t){e.splice(i,1);break}},o.prototype.redraw=function(){var t=this.options.margin,e=this.body.range,i=n.option.asSize,o=this.options,s=o.orientation,r=!1,a=this.dom.frame,h=o.editable.updateTime||o.editable.updateGroup;this.props.top=this.body.domProps.top.height+this.body.domProps.border.top,this.props.left=this.body.domProps.left.width+this.body.domProps.border.left,a.className="itemset"+(h?" editable":""),r=this._orderGroups()||r;var d=e.end-e.start,l=d!=this.lastVisibleInterval||this.props.width!=this.props.lastWidth;l&&(this.stackDirty=!0),this.lastVisibleInterval=d,this.props.lastWidth=this.props.width;var c=this.stackDirty,u=this._firstGroup(),p={item:t.item,axis:t.axis},f={item:t.item,axis:t.item.vertical/2},m=0,g=t.axis+t.item.vertical;return this.groups[v].redraw(e,f,c),n.forEach(this.groups,function(t){var i=t==u?p:f,o=t.redraw(e,i,c);r=o||r,m+=t.height}),m=Math.max(m,g),this.stackDirty=!1,a.style.height=i(m),this.props.width=a.offsetWidth,this.props.height=m,this.dom.axis.style.top=i("top"==s?this.body.domProps.top.height+this.body.domProps.border.top:this.body.domProps.top.height+this.body.domProps.centerContainer.height),this.dom.axis.style.left="0",r=this._isResized()||r},o.prototype._firstGroup=function(){var t="top"==this.options.orientation?0:this.groupIds.length-1,e=this.groupIds[t],i=this.groups[e]||this.groups[g];return i||null},o.prototype._updateUngrouped=function(){{var t,e,i=this.groups[g];this.groups[v]}if(this.groupsData){if(i){i.hide(),delete this.groups[g];for(e in this.items)if(this.items.hasOwnProperty(e)){t=this.items[e],t.parent&&t.parent.remove(t);var o=this._getGroupId(t.data),s=this.groups[o];s&&s.add(t)||t.hide()}}}else if(!i){var n=null,r=null;i=new l(n,r,this),this.groups[g]=i;for(e in this.items)this.items.hasOwnProperty(e)&&(t=this.items[e],i.add(t));i.show()}},o.prototype.getLabelSet=function(){return this.dom.labelSet},o.prototype.setItems=function(t){var e,i=this,o=this.itemsData;if(t){if(!(t instanceof r||t instanceof a))throw new TypeError("Data must be an instance of DataSet or DataView");this.itemsData=t}else this.itemsData=null;if(o&&(n.forEach(this.itemListeners,function(t,e){o.off(e,t)}),e=o.getIds(),this._onRemove(e)),this.itemsData){var s=this.id;n.forEach(this.itemListeners,function(t,e){i.itemsData.on(e,t,s)}),e=this.itemsData.getIds(),this._onAdd(e),this._updateUngrouped()}},o.prototype.getItems=function(){return this.itemsData},o.prototype.setGroups=function(t){var e,i=this;if(this.groupsData&&(n.forEach(this.groupListeners,function(t,e){i.groupsData.unsubscribe(e,t)}),e=this.groupsData.getIds(),this.groupsData=null,this._onRemoveGroups(e)),t){if(!(t instanceof r||t instanceof a))throw new TypeError("Data must be an instance of DataSet or DataView");this.groupsData=t}else this.groupsData=null;if(this.groupsData){var o=this.id;n.forEach(this.groupListeners,function(t,e){i.groupsData.on(e,t,o)}),e=this.groupsData.getIds(),this._onAddGroups(e)}this._updateUngrouped(),this._order(),this.body.emitter.emit("change",{queue:!0})},o.prototype.getGroups=function(){return this.groupsData},o.prototype.removeItem=function(t){var e=this.itemsData.get(t),i=this.itemsData.getDataSet();e&&this.options.onRemove(e,function(e){e&&i.remove(t)})},o.prototype._getType=function(t){return t.type||this.options.type||(t.end?"range":"box")},o.prototype._getGroupId=function(t){var e=this._getType(t);return"background"==e&&void 0==t.group?v:this.groupsData?t.group:g},o.prototype._onUpdate=function(t){var e=this;t.forEach(function(t){var i=e.itemsData.get(t,e.itemOptions),s=e.items[t],n=e._getType(i),r=o.types[n];if(s&&(r&&s instanceof r?e._updateItem(s,i):(e._removeItem(s),s=null)),!s){if(!r)throw new TypeError("rangeoverflow"==n?'Item type "rangeoverflow" is deprecated. Use css styling instead: .vis.timeline .item.range .content {overflow: visible;}':'Unknown item type "'+n+'"');s=new r(i,e.conversion,e.options),s.id=t,e._addItem(s)}}),this._order(),this.stackDirty=!0,this.body.emitter.emit("change",{queue:!0})},o.prototype._onAdd=o.prototype._onUpdate,o.prototype._onRemove=function(t){var e=0,i=this;t.forEach(function(t){var o=i.items[t];o&&(e++,i._removeItem(o))}),e&&(this._order(),this.stackDirty=!0,this.body.emitter.emit("change",{queue:!0}))},o.prototype._order=function(){n.forEach(this.groups,function(t){t.order()})},o.prototype._onUpdateGroups=function(t){this._onAddGroups(t)},o.prototype._onAddGroups=function(t){var e=this;t.forEach(function(t){var i=e.groupsData.get(t),o=e.groups[t];if(o)o.setData(i);else{if(t==g||t==v)throw new Error("Illegal group id. "+t+" is a reserved id.");var s=Object.create(e.options);n.extend(s,{height:null}),o=new l(t,i,e),e.groups[t]=o;for(var r in e.items)if(e.items.hasOwnProperty(r)){var a=e.items[r];a.data.group==t&&o.add(a)}o.order(),o.show()}}),this.body.emitter.emit("change",{queue:!0})},o.prototype._onRemoveGroups=function(t){var e=this.groups;t.forEach(function(t){var i=e[t];i&&(i.hide(),delete e[t])}),this.markDirty(),this.body.emitter.emit("change",{queue:!0})},o.prototype._orderGroups=function(){if(this.groupsData){var t=this.groupsData.getIds({order:this.options.groupOrder}),e=!n.equalArray(t,this.groupIds);if(e){var i=this.groups;t.forEach(function(t){i[t].hide()}),t.forEach(function(t){i[t].show()}),this.groupIds=t}return e}return!1},o.prototype._addItem=function(t){this.items[t.id]=t;var e=this._getGroupId(t.data),i=this.groups[e];i&&i.add(t)},o.prototype._updateItem=function(t,e){var i=t.data.group;if(t.setData(e),i!=t.data.group){var o=this.groups[i];o&&o.remove(t);var s=this._getGroupId(t.data),n=this.groups[s];n&&n.add(t)}},o.prototype._removeItem=function(t){t.hide(),delete this.items[t.id];var e=this.selection.indexOf(t.id);-1!=e&&this.selection.splice(e,1),t.parent&&t.parent.remove(t)},o.prototype._constructByEndArray=function(t){for(var e=[],i=0;i0||s.length>0)&&this.body.emitter.emit("select",{items:a})}},o.prototype._onAddItem=function(t){if(this.options.selectable&&this.options.editable.add){var e=this,i=this.options.snap||null,s=o.itemFromTarget(t);if(s){var r=e.itemsData.get(s.id);this.options.onUpdate(r,function(t){t&&e.itemsData.getDataSet().update(t)})}else{var a=n.getAbsoluteLeft(this.dom.frame),h=t.center.x-a,d=this.body.util.toTime(h),l=this.body.util.getScale(),c=this.body.util.getStep(),u={start:i?i(d,l,c):d,content:"new item"};if("range"===this.options.type){var p=this.body.util.toTime(h+this.props.width/5);u.end=i?i(p,l,c):p}u[this.itemsData._fieldId]=n.randomUUID();var f=this.groupFromTarget(t);f&&(u.group=f.groupId),this.options.onAdd(u,function(t){t&&e.itemsData.getDataSet().add(t)})}}},o.prototype._onMultiSelectItem=function(t){if(this.options.selectable){var e,i=o.itemFromTarget(t);if(i){e=this.getSelection();var s=t.srcEvent&&t.srcEvent.shiftKey||!1;if(s){e.push(i.id);var n=o._getItemRange(this.itemsData.get(e,this.itemOptions));e=[];for(var r in this.items)if(this.items.hasOwnProperty(r)){var a=this.items[r],h=a.data.start,d=void 0!==a.data.end?a.data.end:h;h>=n.min&&d<=n.max&&e.push(a.id)}}else{var l=e.indexOf(i.id);-1==l?e.push(i.id):e.splice(l,1)}this.setSelection(e),this.body.emitter.emit("select",{items:this.getSelection()})}}},o._getItemRange=function(t){var e=null,i=null;return t.forEach(function(t){(null==i||t.starte)&&(e=t.end):(null==e||t.start>e)&&(e=t.start) }),{min:i,max:e}},o.itemFromTarget=function(t){for(var e=t.target;e;){if(e.hasOwnProperty("timeline-item"))return e["timeline-item"];e=e.parentNode}return null},o.prototype.groupFromTarget=function(t){for(var e=t.gesture.center.clientY,i=0;ia&&ea)return s}else if(0===i&&e"));this.dom.textArea.innerHTML=o,this.dom.textArea.style.lineHeight=.75*this.options.iconSize+this.options.iconSpacing+"px"}},o.prototype.drawLegendIcons=function(){if(this.dom.frame.parentNode){n.prepareElements(this.svgElements);var t=window.getComputedStyle(this.dom.frame).paddingTop,e=Number(t.replace("px","")),i=e,o=this.options.iconSize,s=.75*this.options.iconSize,r=e+.5*s+3;this.svg.style.width=o+5+e+"px";for(var a in this.groups)this.groups.hasOwnProperty(a)&&(1!=this.groups[a].visible||void 0!==this.linegraphOptions.visibility[a]&&1!=this.linegraphOptions.visibility[a]||(this.groups[a].drawIcon(i,r,this.svgElements,this.svg,o,s),r+=s+this.options.iconSpacing));n.cleanupElements(this.svgElements)}},t.exports=o},function(t,e,i){function o(t,e){this.id=s.randomUUID(),this.body=t,this.defaultOptions={yAxisOrientation:"left",defaultGroup:"default",sort:!0,sampling:!0,graphHeight:"400px",shaded:{enabled:!1,orientation:"bottom"},style:"line",barChart:{width:50,handleOverlap:"overlap",align:"center"},catmullRom:{enabled:!0,parametrization:"centripetal",alpha:.5},drawPoints:{enabled:!0,size:6,style:"square"},dataAxis:{showMinorLabels:!0,showMajorLabels:!0,icons:!1,width:"40px",visible:!0,alignZeros:!0,customRange:{left:{min:void 0,max:void 0},right:{min:void 0,max:void 0}}},legend:{enabled:!1,icons:!0,left:{visible:!0,position:"top-left"},right:{visible:!0,position:"top-right"}},groups:{visibility:{}}},this.options=s.extend({},this.defaultOptions),this.dom={},this.props={},this.hammer=null,this.groups={},this.abortedGraphUpdate=!1,this.updateSVGheight=!1,this.updateSVGheightOnResize=!1;var i=this;this.itemsData=null,this.groupsData=null,this.itemListeners={add:function(t,e){i._onAdd(e.items)},update:function(t,e){i._onUpdate(e.items)},remove:function(t,e){i._onRemove(e.items)}},this.groupListeners={add:function(t,e){i._onAddGroups(e.items)},update:function(t,e){i._onUpdateGroups(e.items)},remove:function(t,e){i._onRemoveGroups(e.items)}},this.items={},this.selection=[],this.lastStart=this.body.range.start,this.touchParams={},this.svgElements={},this.setOptions(e),this.groupsUsingDefaultStyles=[0],this.COUNTER=0,this.body.emitter.on("rangechanged",function(){i.lastStart=i.body.range.start,i.svg.style.left=s.option.asSize(-i.props.width),i.redraw.call(i,!0)}),this._create(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups},this.body.emitter.emit("change")}var s=i(1),n=i(2),r=i(3),a=i(4),h=i(25),d=i(28),l=i(29),c=i(33),u=i(50),p="__ungrouped__";o.prototype=new h,o.prototype._create=function(){var t=document.createElement("div");t.className="LineGraph",this.dom.frame=t,this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="relative",this.svg.style.height=(""+this.options.graphHeight).replace("px","")+"px",this.svg.style.display="block",t.appendChild(this.svg),this.options.dataAxis.orientation="left",this.yAxisLeft=new d(this.body,this.options.dataAxis,this.svg,this.options.groups),this.options.dataAxis.orientation="right",this.yAxisRight=new d(this.body,this.options.dataAxis,this.svg,this.options.groups),delete this.options.dataAxis.orientation,this.legendLeft=new c(this.body,this.options.legend,"left",this.options.groups),this.legendRight=new c(this.body,this.options.legend,"right",this.options.groups),this.show()},o.prototype.setOptions=function(t){if(t){var e=["sampling","defaultGroup","height","graphHeight","yAxisOrientation","style","barChart","dataAxis","sort","groups"];void 0===t.graphHeight&&void 0!==t.height&&void 0!==this.body.domProps.centerContainer.height?(this.updateSVGheight=!0,this.updateSVGheightOnResize=!0):void 0!==this.body.domProps.centerContainer.height&&void 0!==t.graphHeight&&parseInt((t.graphHeight+"").replace("px",""))0){var d=this.body.util.toGlobalTime(-this.body.domProps.root.width),l=this.body.util.toGlobalTime(2*this.body.domProps.root.width),c={};for(this._getRelevantData(a,c,d,l),this._applySampling(a,c),e=0;ep&&console.log("WARNING: there may be an infinite loop in the _updateGraph emitter cycle."),this.COUNTER=0,this.abortedGraphUpdate=!1,e=0;e0)for(r=0;ro){d.push(h);break}d.push(h)}}else for(a=0;ai&&h.x0)for(var o=0;o0){var n=1,r=s.length,a=this.body.util.toGlobalScreen(s[s.length-1].x)-this.body.util.toGlobalScreen(s[0].x),h=r/a;n=Math.min(Math.ceil(.2*r),Math.max(1,Math.round(h)));for(var d=[],l=0;r>l;l+=n)d.push(s[l]);e[t[o]]=d}}},o.prototype._getYRanges=function(t,e,i){var o,s,n,r,a=[],h=[];if(t.length>0){for(n=0;n0&&(s=this.groups[t[n]],"stack"==r.barChart.handleOverlap&&"bar"==r.style?"left"==r.yAxisOrientation?a=a.concat(s.getYRange(o)):h=h.concat(s.getYRange(o)):i[t[n]]=s.getYRange(o,t[n]));u.getStackedBarYRange(a,i,t,"__barchartLeft","left"),u.getStackedBarYRange(h,i,t,"__barchartRight","right")}},o.prototype._updateYAxis=function(t,e){var i,o,s=!1,n=!1,r=!1,a=1e9,h=1e9,d=-1e9,l=-1e9;if(t.length>0){for(var c=0;ci?i:a,d=o>d?o:d):(r=!0,h=h>i?i:h,l=o>l?o:l));1==n&&this.yAxisLeft.setRange(a,d),1==r&&this.yAxisRight.setRange(h,l)}return s=this._toggleAxisVisiblity(n,this.yAxisLeft)||s,s=this._toggleAxisVisiblity(r,this.yAxisRight)||s,1==r&&1==n?(this.yAxisLeft.drawIcons=!0,this.yAxisRight.drawIcons=!0):(this.yAxisLeft.drawIcons=!1,this.yAxisRight.drawIcons=!1),this.yAxisRight.master=!n,0==this.yAxisRight.master?(this.yAxisLeft.lineOffset=1==r?this.yAxisRight.width:0,s=this.yAxisLeft.redraw()||s,this.yAxisRight.stepPixelsForced=this.yAxisLeft.stepPixels,this.yAxisRight.zeroCrossing=this.yAxisLeft.zeroCrossing,s=this.yAxisRight.redraw()||s):s=this.yAxisRight.redraw()||s,-1!=t.indexOf("__barchartLeft")&&t.splice(t.indexOf("__barchartLeft"),1),-1!=t.indexOf("__barchartRight")&&t.splice(t.indexOf("__barchartRight"),1),s},o.prototype._toggleAxisVisiblity=function(t,e){var i=!1;return 0==t?e.dom.frame.parentNode&&0==e.hidden&&(e.hide(),i=!0):e.dom.frame.parentNode||1!=e.hidden||(e.show(),i=!0),i},o.prototype._convertXcoordinates=function(t){for(var e,i,o=[],s=this.body.util.toScreen,n=0;ny;)y++,l=h.getCurrent(),c=h.isMajor(),p=h.getClassName(),m=f,f=this.body.util.toScreen(l),g=f-m,u&&(u.style.width=g+"px"),this.options.showMinorLabels&&this._repaintMinorText(f,h.getLabelMinor(),t,p),c&&this.options.showMajorLabels?(f>0&&(void 0==v&&(v=f),this._repaintMajorText(f,h.getLabelMajor(),t,p)),u=this._repaintMajorLine(f,t,p)):u=this._repaintMinorLine(f,t,p),h.next();if(this.options.showMajorLabels){var b=this.body.util.toTime(0),w=h.getLabelMajor(b),x=w.length*(this.props.majorCharWidth||10)+10;(void 0==v||v>x)&&this._repaintMajorText(0,w,t,p)}s.forEach(this.dom.redundant,function(t){for(;t.length;){var e=t.pop();e&&e.parentNode&&e.parentNode.removeChild(e)}})},o.prototype._repaintMinorText=function(t,e,i,o){var s=this.dom.redundant.minorTexts.shift();if(!s){var n=document.createTextNode("");s=document.createElement("div"),s.appendChild(n),this.dom.foreground.appendChild(s)}this.dom.minorTexts.push(s),s.childNodes[0].nodeValue=e,s.style.top="top"==i?this.props.majorLabelHeight+"px":"0",s.style.left=t+"px",s.className="text minor "+o},o.prototype._repaintMajorText=function(t,e,i,o){var s=this.dom.redundant.majorTexts.shift();if(!s){var n=document.createTextNode(e);s=document.createElement("div"),s.appendChild(n),this.dom.foreground.appendChild(s)}this.dom.majorTexts.push(s),s.childNodes[0].nodeValue=e,s.className="text major "+o,s.style.top="top"==i?"0":this.props.minorLabelHeight+"px",s.style.left=t+"px"},o.prototype._repaintMinorLine=function(t,e,i){var o=this.dom.redundant.lines.shift();o||(o=document.createElement("div"),this.dom.background.appendChild(o)),this.dom.lines.push(o);var s=this.props;return o.style.top="top"==e?s.majorLabelHeight+"px":this.body.domProps.top.height+"px",o.style.height=s.minorLineHeight+"px",o.style.left=t-s.minorLineWidth/2+"px",o.className="grid vertical minor "+i,o},o.prototype._repaintMajorLine=function(t,e,i){var o=this.dom.redundant.lines.shift();o||(o=document.createElement("div"),this.dom.background.appendChild(o)),this.dom.lines.push(o);var s=this.props;return o.style.top="top"==e?"0":this.body.domProps.top.height+"px",o.style.left=t-s.majorLineWidth/2+"px",o.style.height=s.majorLineHeight+"px",o.className="grid vertical major "+i,o},o.prototype._calculateCharSize=function(){this.dom.measureCharMinor||(this.dom.measureCharMinor=document.createElement("DIV"),this.dom.measureCharMinor.className="text minor measure",this.dom.measureCharMinor.style.position="absolute",this.dom.measureCharMinor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMinor)),this.props.minorCharHeight=this.dom.measureCharMinor.clientHeight,this.props.minorCharWidth=this.dom.measureCharMinor.clientWidth,this.dom.measureCharMajor||(this.dom.measureCharMajor=document.createElement("DIV"),this.dom.measureCharMajor.className="text major measure",this.dom.measureCharMajor.style.position="absolute",this.dom.measureCharMajor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMajor)),this.props.majorCharHeight=this.dom.measureCharMajor.clientHeight,this.props.majorCharWidth=this.dom.measureCharMajor.clientWidth},t.exports=o},function(t,e,i){function o(t,e,i){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");this._initializeMixinLoaders(),this.initializing=!0,this.triggerFunctions={add:null,edit:null,editEdge:null,connect:null,del:null};var s=function(t,e,i,o){if(e==t)return.5;var s=1/(e-t);return Math.max(0,(o-t)*s)};this.defaultOptions={nodes:{customScalingFunction:s,mass:1,radiusMin:10,radiusMax:30,radius:10,shape:"ellipse",image:void 0,widthMin:16,widthMax:64,fontColor:"black",fontSize:14,fontFace:"verdana",fontFill:void 0,fontStrokeWidth:0,fontStrokeColor:"#ffffff",fontDrawThreshold:3,scaleFontWithValue:!1,fontSizeMin:14,fontSizeMax:30,fontSizeMaxVisible:30,value:1,level:-1,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},group:void 0,borderWidth:1,borderWidthSelected:void 0},edges:{customScalingFunction:s,widthMin:1,widthMax:15,width:1,widthSelectionMultiplier:2,hoverWidth:1.5,value:1,style:"line",color:{color:"#848484",highlight:"#848484",hover:"#848484"},opacity:1,fontColor:"#343434",fontSize:14,fontFace:"arial",fontFill:"white",fontStrokeWidth:0,fontStrokeColor:"white",labelAlignment:"horizontal",arrowScaleFactor:1,dash:{length:10,gap:5,altLength:void 0},inheritColor:"from",useGradients:!1},configurePhysics:!1,navigation:{enabled:!1},keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0},dataManipulation:{enabled:!1,initiallyVisible:!1},hierarchicalLayout:{enabled:!1,levelSeparation:150,nodeSpacing:100,direction:"UD",layout:"hubsize"},smoothCurves:{enabled:!0,dynamic:!0,type:"continuous",roundness:.5},locale:"en",locales:v,tooltip:{delay:300,fontColor:"black",fontSize:14,fontFace:"verdana",color:{border:"#666",background:"#FFFFC6"}},dragNetwork:!0,dragNodes:!0,zoomable:!0,hover:!1,hideEdgesOnDrag:!1,hideNodesOnDrag:!1,width:"100%",height:"100%",selectable:!0,useDefaultGroups:!0},this.constants=n.extend({},this.defaultOptions),this.body={nodes:{},nodeIndices:[],supportNodes:{},supportNodeIndices:[],edges:{},data:{nodes:null,edges:null},functions:{createNode:this._createNode.bind(this),createEdge:this._createEdge.bind(this)},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(){}},container:t},this.view=new _(this.body),this.renderer=new w(this.body),this.clustering=new b(this.body),this.physics=new y(this.body),this.canvas=new x(this.body),this.touchHandler=new M(this.body),this.renderer.setCanvas(this.canvas),this.view.setCanvas(this.canvas),this.touchHandler.setCanvas(this.canvas),this.hoverObj={nodes:{},edges:{}},this.controlNodesActive=!1,this.navigationHammers=[],this.manipulationHammers=[];var r=this;this.groups=new l,this.images=new c,this.images.setOnloadCallback(function(){r._requestRedraw()}),this.xIncrement=0,this.yIncrement=0,this.zoomIncrement=0,this._loadSelectionSystem(),this.setOptions(i),this.cachedFunctions={},this.startedStabilization=!1,this.stabilized=!1,this.stabilizationIterations=null,this.draggingNodes=!1,this.pointerPosition={x:0,y:0},this.scale=1,this.nodesListeners={add:function(t,e){r._addNodes(e.items),r.start()},update:function(t,e){r._updateNodes(e.items,e.data),r.start()},remove:function(t,e){r._removeNodes(e.items),r.start()}},this.edgesListeners={add:function(t,e){r._addEdges(e.items),r.start()},update:function(t,e){r._updateEdges(e.items),r.start()},remove:function(t,e){r._removeEdges(e.items),r.start()}},this.moving=!0,this.renderTimer=void 0,this.setData(e,this.constants.hierarchicalLayout.enabled),1==this.constants.hierarchicalLayout.enabled?this._setupHierarchicalLayout():0==this.constants.stabilize&&this.zoomExtent({duration:0},!0,this.constants.clustering.enabled),0==this.constants.stabilize&&(this.initializing=!1);var r=this;this.on("_dataChanged",function(){r._updateNodeIndexList(),r.physics._updateCalculationNodes(),r._markAllEdgesAsDirty(),r.initializing!==!0&&(r.moving=!0,r.start())}),this.on("_newEdgesCreated",this._createBezierNodes.bind(this))}var s=i(62),n=(i(45),i(63),i(1)),r=(i(47),i(3)),a=i(4),h=i(42),d=i(43),l=i(38),c=i(39),u=i(40),p=i(37),f=i(41),m=i(52),g=i(53),v=i(54);i(55);var y=i(56).PhysicsEngine,b=i(57).ClusterEngine,w=i(58).CanvasRenderer,x=i(59).Canvas,_=i(60).View,M=i(61).TouchEventHandler;s(o.prototype),o.prototype._createNode=function(t){return new u(t,this.images,this.groups,this.constants)},o.prototype._createEdge=function(t){return new p(t,this.body,this.constants)},o.prototype._updateNodeIndexList=function(){this.body.supportNodeIndices=Object.keys(this.body.supportNodes),this.body.nodeIndices=Object.keys(this.body.nodes)},o.prototype.setData=function(t,e){if(void 0===e&&(e=!1),this._unselectAll(!0),this.initializing=!0,t&&t.dot&&(t.nodes||t.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(1==this.constants.dataManipulation.enabled&&this._createManipulatorBar(),this.setOptions(t&&t.options),t&&t.dot){if(t&&t.dot){var i=h.DOTToGraph(t.dot);return void this.setData(i)}}else if(t&&t.gephi){if(t&&t.gephi){var o=d.parseGephi(t.gephi);return void this.setData(o)}}else this._setNodes(t&&t.nodes),this._setEdges(t&&t.edges);0==e?1==this.constants.hierarchicalLayout.enabled?(this._resetLevels(),this._setupHierarchicalLayout()):this.physics.startSimulation():this.initializing=!1},o.prototype.setOptions=function(t){if(t){var e,i=["nodes","edges","smoothCurves","hierarchicalLayout","navigation","keyboard","dataManipulation","onAdd","onEdit","onEditEdge","onConnect","onDelete","clickToUse"];if(n.selectiveNotDeepExtend(i,this.constants,t),n.selectiveNotDeepExtend(["color"],this.constants.nodes,t.nodes),n.selectiveNotDeepExtend(["color","length"],this.constants.edges,t.edges),this.groups.useDefaultGroups=this.constants.useDefaultGroups,this.physics.setOptions(t.physics),this.canvas.setOptions(this.constants),t.onAdd&&(this.triggerFunctions.add=t.onAdd),t.onEdit&&(this.triggerFunctions.edit=t.onEdit),t.onEditEdge&&(this.triggerFunctions.editEdge=t.onEditEdge),t.onConnect&&(this.triggerFunctions.connect=t.onConnect),t.onDelete&&(this.triggerFunctions.del=t.onDelete),n.mergeOptions(this.constants,t,"smoothCurves"),n.mergeOptions(this.constants,t,"hierarchicalLayout"),n.mergeOptions(this.constants,t,"clustering"),n.mergeOptions(this.constants,t,"navigation"),n.mergeOptions(this.constants,t,"keyboard"),n.mergeOptions(this.constants,t,"dataManipulation"),t.dataManipulation&&(this.editMode=this.constants.dataManipulation.initiallyVisible),t.edges&&(void 0!==t.edges.color&&(n.isString(t.edges.color)?(this.constants.edges.color={},this.constants.edges.color.color=t.edges.color,this.constants.edges.color.highlight=t.edges.color,this.constants.edges.color.hover=t.edges.color):(void 0!==t.edges.color.color&&(this.constants.edges.color.color=t.edges.color.color),void 0!==t.edges.color.highlight&&(this.constants.edges.color.highlight=t.edges.color.highlight),void 0!==t.edges.color.hover&&(this.constants.edges.color.hover=t.edges.color.hover)),this.constants.edges.inheritColor=!1),t.edges.fontColor||void 0!==t.edges.color&&(n.isString(t.edges.color)?this.constants.edges.fontColor=t.edges.color:void 0!==t.edges.color.color&&(this.constants.edges.fontColor=t.edges.color.color))),t.nodes&&t.nodes.color){var o=n.parseColor(t.nodes.color); this.constants.nodes.color.background=o.background,this.constants.nodes.color.border=o.border,this.constants.nodes.color.highlight.background=o.highlight.background,this.constants.nodes.color.highlight.border=o.highlight.border,this.constants.nodes.color.hover.background=o.hover.background,this.constants.nodes.color.hover.border=o.hover.border}if(t.groups)for(var s in t.groups)if(t.groups.hasOwnProperty(s)){var r=t.groups[s];this.groups.add(s,r)}if(t.tooltip){for(e in t.tooltip)t.tooltip.hasOwnProperty(e)&&(this.constants.tooltip[e]=t.tooltip[e]);t.tooltip.color&&(this.constants.tooltip.color=n.parseColor(t.tooltip.color))}if("clickToUse"in t&&(t.clickToUse?this.activator||(this.activator=new g(this.frame),this.activator.on("change",this._createKeyBinds.bind(this))):this.activator&&(this.activator.destroy(),delete this.activator)),t.labels)throw new Error('Option "labels" is deprecated. Use options "locale" and "locales" instead.');this.canvas._bindHammer(),this._markAllEdgesAsDirty(),this.canvas.setSize(this.constants.width,this.constants.height),1==this.constants.hierarchicalLayout.enabled&&0==this.initializing&&(this._resetLevels(),this._setupHierarchicalLayout()),this.initializing!==!0&&(this.moving=!0,this.start())}},o.prototype._createKeyBinds=function(){},o.prototype.destroy=function(){this.start=function(){},this.redraw=function(){},this.renderTimer=!1,this._cleanupPhysicsConfiguration(),this.keycharm.reset(),this.hammer.dispose(),this.off(),this._recursiveDOMDelete(this.containerElement)},o.prototype._recursiveDOMDelete=function(t){for(;1==t.hasChildNodes();)this._recursiveDOMDelete(t.firstChild),t.removeChild(t.firstChild)},o.prototype._checkShowPopup=function(t){var e,i={left:this._XconvertDOMtoCanvas(t.x),top:this._YconvertDOMtoCanvas(t.y),right:this._XconvertDOMtoCanvas(t.x),bottom:this._YconvertDOMtoCanvas(t.y)},o=void 0===this.popupObj?"":this.popupObj.id,s=!1,n="node";if(void 0==this.popupObj){var r=this.body.nodes,a=[];for(e in r)if(r.hasOwnProperty(e)){var h=r[e];h.isOverlappingWith(i)&&void 0!==h.getTitle()&&a.push(e)}a.length>0&&(this.popupObj=this.body.nodes[a[a.length-1]],s=!0)}if(void 0===this.popupObj&&0==s){var d=this.body.edges,l=[];for(e in d)if(d.hasOwnProperty(e)){var c=d[e];c.connected===!0&&void 0!==c.getTitle()&&c.isOverlappingWith(i)&&l.push(e)}l.length>0&&(this.popupObj=this.body.edges[l[l.length-1]],n="edge")}this.popupObj?this.popupObj.id!=o&&(void 0===this.popup&&(this.popup=new f(this.frame,this.constants.tooltip)),this.popup.popupTargetType=n,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(t.x+3,t.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show()):this.popup&&this.popup.hide()},o.prototype._checkHidePopup=function(t){var e={left:this._XconvertDOMtoCanvas(t.x),top:this._YconvertDOMtoCanvas(t.y),right:this._XconvertDOMtoCanvas(t.x),bottom:this._YconvertDOMtoCanvas(t.y)},i=!1;if("node"==this.popup.popupTargetType){if(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(e),i===!0){var o=this._getNodeAt(t);i=o.id==this.popup.popupTargetId}}else null===this._getNodeAt(t)&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(e));i===!1&&(this.popupObj=void 0,this.popup.hide())},o.prototype._setNodes=function(t){var e=this.body.data.nodes;if(t instanceof r||t instanceof a)this.body.data.nodes=t;else if(Array.isArray(t))this.body.data.nodes=new r,this.body.data.nodes.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new r}if(e&&n.forEach(this.nodesListeners,function(t,i){e.off(i,t)}),this.body.nodes={},this.body.data.nodes){var i=this;n.forEach(this.nodesListeners,function(t,e){i.body.data.nodes.on(e,t)});var o=this.body.data.nodes.getIds();this._addNodes(o)}this._updateSelection()},o.prototype._addNodes=function(t){for(var e,i=0,o=t.length;o>i;i++){e=t[i];var s=this.body.data.nodes.get(e),n=new u(s,this.images,this.groups,this.constants);if(this.body.nodes[e]=n,!(0!=n.xFixed&&0!=n.yFixed||null!==n.x&&null!==n.y)){var r=1*t.length+10,a=2*Math.PI*Math.random();0==n.xFixed&&(n.x=r*Math.cos(a)),0==n.yFixed&&(n.y=r*Math.sin(a))}this.moving=!0}this._updateNodeIndexList(),1==this.constants.hierarchicalLayout.enabled&&0==this.initializing&&(this._resetLevels(),this._setupHierarchicalLayout()),this.physics._updateCalculationNodes(),this._reconnectEdges(),this._updateValueRange(this.body.nodes)},o.prototype._updateNodes=function(t,e){for(var i=this.body.nodes,o=0,s=t.length;s>o;o++){var n=t[o],r=i[n],a=e[o];r?r.setProperties(a,this.constants):(r=new u(properties,this.images,this.groups,this.constants),i[n]=r)}this.moving=!0,1==this.constants.hierarchicalLayout.enabled&&0==this.initializing&&(this._resetLevels(),this._setupHierarchicalLayout()),this._updateNodeIndexList(),this._updateValueRange(i),this._markAllEdgesAsDirty()},o.prototype._markAllEdgesAsDirty=function(){for(var t in this.body.edges)this.body.edges[t].colorDirty=!0},o.prototype._removeNodes=function(t){for(var e=this.body.nodes,i=0,o=t.length;o>i;i++)void 0!==this.selectionObj.nodes[t[i]]&&(this.body.nodes[t[i]].unselect(),this._removeFromSelection(this.body.nodes[t[i]]));for(var i=0,o=t.length;o>i;i++){var s=t[i];delete e[s]}this._updateNodeIndexList(),1==this.constants.hierarchicalLayout.enabled&&0==this.initializing&&(this._resetLevels(),this._setupHierarchicalLayout()),this.physics._updateCalculationNodes(),this._reconnectEdges(),this._updateSelection(),this._updateValueRange(e)},o.prototype._setEdges=function(t){var e=this.body.data.edges;if(t instanceof r||t instanceof a)this.body.data.edges=t;else if(Array.isArray(t))this.body.data.edges=new r,this.body.data.edges.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.edges=new r}if(e&&n.forEach(this.edgesListeners,function(t,i){e.off(i,t)}),this.body.edges={},this.body.data.edges){var i=this;n.forEach(this.edgesListeners,function(t,e){i.body.data.edges.on(e,t)});var o=this.body.data.edges.getIds();this._addEdges(o)}this._reconnectEdges()},o.prototype._addEdges=function(t){for(var e=this.body.edges,i=this.body.data.edges,o=0,s=t.length;s>o;o++){var n=t[o],r=e[n];r&&r.disconnect();var a=i.get(n,{showInternalIds:!0});e[n]=new p(a,this.body,this.constants)}this.moving=!0,this._updateValueRange(e),this._createBezierNodes(),this.physics._updateCalculationNodes(),1==this.constants.hierarchicalLayout.enabled&&0==this.initializing&&(this._resetLevels(),this._setupHierarchicalLayout())},o.prototype._updateEdges=function(t){for(var e=this.body.edges,i=this.body.data.edges,o=0,s=t.length;s>o;o++){var n=t[o],r=i.get(n),a=e[n];a?(a.disconnect(),a.setProperties(r),a.connect()):(a=new p(r,this.body,this.constants),this.body.edges[n]=a)}this._createBezierNodes(),1==this.constants.hierarchicalLayout.enabled&&0==this.initializing&&(this._resetLevels(),this._setupHierarchicalLayout()),this.moving=!0,this._updateValueRange(e)},o.prototype._removeEdges=function(t){for(var e=this.body.edges,i=0,o=t.length;o>i;i++)void 0!==this.selectionObj.edges[t[i]]&&(e[t[i]].unselect(),this._removeFromSelection(e[t[i]]));for(var i=0,o=t.length;o>i;i++){var s=t[i],n=e[s];n&&(null!=n.via&&delete this.body.supportNodes[n.via.id],n.disconnect(),delete e[s])}this.moving=!0,this._updateValueRange(e),1==this.constants.hierarchicalLayout.enabled&&0==this.initializing&&(this._resetLevels(),this._setupHierarchicalLayout()),this.physics._updateCalculationNodes()},o.prototype._reconnectEdges=function(){var t,e=this.body.nodes,i=this.body.edges;for(t in e)e.hasOwnProperty(t)&&(e[t].edges=[]);for(t in i)if(i.hasOwnProperty(t)){var o=i[t];o.from=null,o.to=null,o.connect()}},o.prototype._updateValueRange=function(t){var e,i=void 0,o=void 0,s=0;for(e in t)if(t.hasOwnProperty(e)){var n=t[e].getValue();void 0!==n&&(i=void 0===i?n:Math.min(n,i),o=void 0===o?n:Math.max(n,o),s+=n)}if(void 0!==i&&void 0!==o)for(e in t)t.hasOwnProperty(e)&&t[e].setValueRange(i,o,s)},o.prototype._setTranslation=function(t,e){void 0===this.translation&&(this.translation={x:0,y:0}),void 0!==t&&(this.translation.x=t),void 0!==e&&(this.translation.y=e),this.emit("viewChanged")},o.prototype._getTranslation=function(){return{x:this.translation.x,y:this.translation.y}},o.prototype._setScale=function(t){this.scale=t},o.prototype._getScale=function(){return this.scale},o.prototype._handleNavigation=function(){if(0!=this.xIncrement||0!=this.yIncrement){var t=this._getTranslation();this._setTranslation(t.x+this.xIncrement,t.y+this.yIncrement)}if(0!=this.zoomIncrement){var e={x:this.frame.canvas.clientWidth/2,y:this.frame.canvas.clientHeight/2};this._zoom(this.scale*(1+this.zoomIncrement),e)}},o.prototype.freezeSimulation=function(t){1==t?(this.freezeSimulationEnabled=!0,this.moving=!1):(this.freezeSimulationEnabled=!1,this.moving=!0,this.start())},o.prototype._configureSmoothCurves=function(){var t=void 0===arguments[0]?!0:arguments[0];if(1==this.constants.smoothCurves.enabled&&1==this.constants.smoothCurves.dynamic){this._createBezierNodes();for(var e=0;eh}return!1},o.prototype._getColor=function(t){var e=this.options.color;if(1==this.options.useGradients){var i,o,n=t.createLinearGradient(this.from.x,this.from.y,this.to.x,this.to.y);return i=this.from.options.color.highlight.border,o=this.to.options.color.highlight.border,0==this.from.selected&&0==this.to.selected?(i=s.overrideOpacity(this.from.options.color.border,this.options.opacity),o=s.overrideOpacity(this.to.options.color.border,this.options.opacity)):1==this.from.selected&&0==this.to.selected?o=this.to.options.color.border:0==this.from.selected&&1==this.to.selected&&(i=this.from.options.color.border),n.addColorStop(0,i),n.addColorStop(1,o),n}return this.colorDirty===!0&&("to"==this.options.inheritColor?e={highlight:this.to.options.color.highlight.border,hover:this.to.options.color.hover.border,color:s.overrideOpacity(this.from.options.color.border,this.options.opacity)}:("from"==this.options.inheritColor||1==this.options.inheritColor)&&(e={highlight:this.from.options.color.highlight.border,hover:this.from.options.color.hover.border,color:s.overrideOpacity(this.from.options.color.border,this.options.opacity)}),this.options.color=e,this.colorDirty=!1),1==this.selected?e.highlight:1==this.hover?e.hover:e.color},o.prototype._drawLine=function(t){if(t.strokeStyle=this._getColor(t),t.lineWidth=this._getLineWidth(),this.from!=this.to){var e,i=this._line(t);if(this.label){if(1==this.options.smoothCurves.enabled&&null!=i){var o=.5*(.5*(this.from.x+i.x)+.5*(this.to.x+i.x)),s=.5*(.5*(this.from.y+i.y)+.5*(this.to.y+i.y));e={x:o,y:s}}else e=this._pointOnLine(.5);this._label(t,this.label,e.x,e.y)}}else{var n,r,a=this.physics.springLength/4,h=this.from;h.width||h.resize(t),h.width>h.height?(n=h.x+h.width/2,r=h.y-a):(n=h.x+a,r=h.y-h.height/2),this._circle(t,n,r,a),e=this._pointOnCircle(n,r,a,.5),this._label(t,this.label,e.x,e.y)}},o.prototype._getLineWidth=function(){return 1==this.selected?Math.max(Math.min(this.widthSelected,this.options.widthMax),.3*this.networkScaleInv):1==this.hover?Math.max(Math.min(this.options.hoverWidth,this.options.widthMax),.3*this.networkScaleInv):Math.max(this.options.width,.3*this.networkScaleInv)},o.prototype._getViaCoordinates=function(){if(1==this.options.smoothCurves.dynamic&&1==this.options.smoothCurves.enabled)return this.via;if(0==this.options.smoothCurves.enabled)return{x:0,y:0};var t=null,e=null,i=this.options.smoothCurves.roundness,o=this.options.smoothCurves.type,s=Math.abs(this.from.x-this.to.x),n=Math.abs(this.from.y-this.to.y);if("discrete"==o||"diagonalCross"==o)Math.abs(this.from.x-this.to.x)this.to.y?this.from.xthis.to.x&&(t=this.from.x-i*n,e=this.from.y-i*n):this.from.ythis.to.x&&(t=this.from.x-i*n,e=this.from.y+i*n)),"discrete"==o&&(t=i*n>s?this.from.x:t)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>this.to.y?this.from.xthis.to.x&&(t=this.from.x-i*s,e=this.from.y-i*s):this.from.ythis.to.x&&(t=this.from.x-i*s,e=this.from.y+i*s)),"discrete"==o&&(e=i*s>n?this.from.y:e));else if("straightCross"==o)Math.abs(this.from.x-this.to.x)Math.abs(this.from.y-this.to.y)&&(t=this.from.xthis.to.y?this.from.xthis.to.x&&(t=this.from.x-i*n,e=this.from.y-i*n,t=this.to.x>t?this.to.x:t):this.from.ythis.to.x&&(t=this.from.x-i*n,e=this.from.y+i*n,t=this.to.x>t?this.to.x:t)):Math.abs(this.from.x-this.to.x)>Math.abs(this.from.y-this.to.y)&&(this.from.y>this.to.y?this.from.xe?this.to.y:e):this.from.x>this.to.x&&(t=this.from.x-i*s,e=this.from.y-i*s,e=this.to.y>e?this.to.y:e):this.from.ythis.to.x&&(t=this.from.x-i*s,e=this.from.y+i*s,e=this.to.yd;d++){var l=t.measureText(n[d]).width;h=l>h?l:h}var c=this.options.fontSize*r,u=i-h/2,p=o-c/2;this.labelDimensions={top:p,left:u,width:h,height:c,yLine:s}}var s=this.labelDimensions.yLine;t.save(),"horizontal"!=this.options.labelAlignment&&(t.translate(i,s),this._rotateForLabelAlignment(t),i=0,s=0),this._drawLabelRect(t),this._drawLabelText(t,i,s,n,r,a),t.restore()}},o.prototype._rotateForLabelAlignment=function(t){var e=this.from.y-this.to.y,i=this.from.x-this.to.x,o=Math.atan2(e,i);(-1>o&&0>i||o>0&&0>i)&&(o+=Math.PI),t.rotate(o)},o.prototype._drawLabelRect=function(t){if(void 0!==this.options.fontFill&&null!==this.options.fontFill&&"none"!==this.options.fontFill){t.fillStyle=this.options.fontFill;var e=2;"line-center"==this.options.labelAlignment?t.fillRect(.5*-this.labelDimensions.width,.5*-this.labelDimensions.height,this.labelDimensions.width,this.labelDimensions.height):"line-above"==this.options.labelAlignment?t.fillRect(.5*-this.labelDimensions.width,-(this.labelDimensions.height+e),this.labelDimensions.width,this.labelDimensions.height):"line-below"==this.options.labelAlignment?t.fillRect(.5*-this.labelDimensions.width,e,this.labelDimensions.width,this.labelDimensions.height):t.fillRect(this.labelDimensions.left,this.labelDimensions.top,this.labelDimensions.width,this.labelDimensions.height)}},o.prototype._drawLabelText=function(t,e,i,o,s,n){if(t.fillStyle=this.options.fontColor||"black",t.textAlign="center","horizontal"!=this.options.labelAlignment){var r=2;"line-above"==this.options.labelAlignment?(t.textBaseline="alphabetic",i-=2*r):"line-below"==this.options.labelAlignment?(t.textBaseline="hanging",i+=2*r):t.textBaseline="middle"}else t.textBaseline="middle";this.options.fontStrokeWidth>0&&(t.lineWidth=this.options.fontStrokeWidth,t.strokeStyle=this.options.fontStrokeColor,t.lineJoin="round");for(var a=0;s>a;a++)this.options.fontStrokeWidth>0&&t.strokeText(o[a],e,i),t.fillText(o[a],e,i),i+=n},o.prototype._drawDashLine=function(t){t.strokeStyle=this._getColor(t),t.lineWidth=this._getLineWidth();var e=null;if(void 0!==t.setLineDash){t.save();var i=[0];i=void 0!==this.options.dash.length&&void 0!==this.options.dash.gap?[this.options.dash.length,this.options.dash.gap]:[5,5],t.setLineDash(i),t.lineDashOffset=0,e=this._line(t),t.setLineDash([0]),t.lineDashOffset=0,t.restore()}else t.beginPath(),t.lineCap="round",void 0!==this.options.dash.altLength?t.dashedLine(this.from.x,this.from.y,this.to.x,this.to.y,[this.options.dash.length,this.options.dash.gap,this.options.dash.altLength,this.options.dash.gap]):void 0!==this.options.dash.length&&void 0!==this.options.dash.gap?t.dashedLine(this.from.x,this.from.y,this.to.x,this.to.y,[this.options.dash.length,this.options.dash.gap]):(t.moveTo(this.from.x,this.from.y),t.lineTo(this.to.x,this.to.y)),t.stroke();if(this.label){var o;if(1==this.options.smoothCurves.enabled&&null!=e){var s=.5*(.5*(this.from.x+e.x)+.5*(this.to.x+e.x)),n=.5*(.5*(this.from.y+e.y)+.5*(this.to.y+e.y));o={x:s,y:n}}else o=this._pointOnLine(.5);this._label(t,this.label,o.x,o.y)}},o.prototype._pointOnLine=function(t){return{x:(1-t)*this.from.x+t*this.to.x,y:(1-t)*this.from.y+t*this.to.y}},o.prototype._pointOnCircle=function(t,e,i,o){var s=2*(o-3/8)*Math.PI;return{x:t+i*Math.cos(s),y:e-i*Math.sin(s)}},o.prototype._drawArrowCenter=function(t){var e;if(t.strokeStyle=this._getColor(t),t.fillStyle=t.strokeStyle,t.lineWidth=this._getLineWidth(),this.from!=this.to){var i=this._line(t),o=Math.atan2(this.to.y-this.from.y,this.to.x-this.from.x),s=(10+5*this.options.width)*this.options.arrowScaleFactor;if(1==this.options.smoothCurves.enabled&&null!=i){var n=.5*(.5*(this.from.x+i.x)+.5*(this.to.x+i.x)),r=.5*(.5*(this.from.y+i.y)+.5*(this.to.y+i.y));e={x:n,y:r}}else e=this._pointOnLine(.5);t.arrow(e.x,e.y,o,s),t.fill(),t.stroke(),this.label&&this._label(t,this.label,e.x,e.y)}else{var a,h,d=.25*Math.max(100,this.physics.springLength),l=this.from;l.width||l.resize(t),l.width>l.height?(a=l.x+.5*l.width,h=l.y-d):(a=l.x+d,h=l.y-.5*l.height),this._circle(t,a,h,d);var o=.2*Math.PI,s=(10+5*this.options.width)*this.options.arrowScaleFactor;e=this._pointOnCircle(a,h,d,.5),t.arrow(e.x,e.y,o,s),t.fill(),t.stroke(),this.label&&(e=this._pointOnCircle(a,h,d,.5),this._label(t,this.label,e.x,e.y))}},o.prototype._pointOnBezier=function(t){var e=this._getViaCoordinates(),i=Math.pow(1-t,2)*this.from.x+2*t*(1-t)*e.x+Math.pow(t,2)*this.to.x,o=Math.pow(1-t,2)*this.from.y+2*t*(1-t)*e.y+Math.pow(t,2)*this.to.y;return{x:i,y:o}},o.prototype._findBorderPosition=function(t,e){var i,o,s,n,r,a=10,h=0,d=0,l=1,c=.2,u=this.to;for(1==t&&(u=this.from);l>=d&&a>h;){var p=.5*(d+l);if(i=this._pointOnBezier(p),o=Math.atan2(u.y-i.y,u.x-i.x),s=u.distanceToBorder(e,o),n=Math.sqrt(Math.pow(i.x-u.x,2)+Math.pow(i.y-u.y,2)),r=s-n,Math.abs(r)r?0==t?d=p:l=p:0==t?l=p:d=p,h++}return i.t=p,i},o.prototype._drawArrow=function(t){t.strokeStyle=this._getColor(t),t.fillStyle=t.strokeStyle,t.lineWidth=this._getLineWidth();var e,i,o;if(this.from!=this.to){if(this._line(t),1==this.options.smoothCurves.enabled){var s=this._getViaCoordinates();o=this._findBorderPosition(!1,t);var n=this._pointOnBezier(Math.max(0,o.t-.1));e=Math.atan2(o.y-n.y,o.x-n.x)}else{e=Math.atan2(this.to.y-this.from.y,this.to.x-this.from.x);var r=this.to.x-this.from.x,a=this.to.y-this.from.y,h=Math.sqrt(r*r+a*a),d=this.to.distanceToBorder(t,e),l=(h-d)/h;o={},o.x=(1-l)*this.from.x+l*this.to.x,o.y=(1-l)*this.from.y+l*this.to.y}if(i=(10+5*this.options.width)*this.options.arrowScaleFactor,t.arrow(o.x,o.y,e,i),t.fill(),t.stroke(),this.label){var c;c=1==this.options.smoothCurves.enabled&&null!=s?this._pointOnBezier(.5):this._pointOnLine(.5),this._label(t,this.label,c.x,c.y)}}else{var u,p,f,m=this.from,g=.25*Math.max(100,this.physics.springLength);m.width||m.resize(t),m.width>m.height?(u=m.x+.5*m.width,p=m.y-g,f={x:u,y:m.y,angle:.9*Math.PI}):(u=m.x+g,p=m.y-.5*m.height,f={x:m.x,y:p,angle:.6*Math.PI}),t.beginPath(),t.arc(u,p,g,0,2*Math.PI,!1),t.stroke();var i=(10+5*this.options.width)*this.options.arrowScaleFactor;t.arrow(f.x,f.y,f.angle,i),t.fill(),t.stroke(),this.label&&(c=this._pointOnCircle(u,p,g,.5),this._label(t,this.label,c.x,c.y))}},o.prototype._getDistanceToEdge=function(t,e,i,o,s,n){var r=0;if(this.from!=this.to)if(1==this.options.smoothCurves.enabled){var a,h;if(1==this.options.smoothCurves.enabled&&1==this.options.smoothCurves.dynamic)a=this.via.x,h=this.via.y;else{var d=this._getViaCoordinates();a=d.x,h=d.y}var l,c,u,p,f,m,g,v=1e9;for(c=0;10>c;c++)u=.1*c,p=Math.pow(1-u,2)*t+2*u*(1-u)*a+Math.pow(u,2)*i,f=Math.pow(1-u,2)*e+2*u*(1-u)*h+Math.pow(u,2)*o,c>0&&(l=this._getDistanceToLine(m,g,p,f,s,n),v=v>l?l:v),m=p,g=f;r=v}else r=this._getDistanceToLine(t,e,i,o,s,n);else{var p,f,y,b,w=.25*this.physics.springLength,x=this.from;x.width>x.height?(p=x.x+.5*x.width,f=x.y-w):(p=x.x+w,f=x.y-.5*x.height),y=p-s,b=f-n,r=Math.abs(Math.sqrt(y*y+b*b)-w)}return this.labelDimensions.lefts&&this.labelDimensions.topn?0:r},o.prototype._getDistanceToLine=function(t,e,i,o,s,n){var r=i-t,a=o-e,h=r*r+a*a,d=((s-t)*r+(n-e)*a)/h;d>1?d=1:0>d&&(d=0);var l=t+d*r,c=e+d*a,u=l-s,p=c-n;return Math.sqrt(u*u+p*p)},o.prototype.setScale=function(t){this.networkScaleInv=1/t},o.prototype.select=function(){this.selected=!0},o.prototype.unselect=function(){this.selected=!1},o.prototype.positionBezierNode=function(){null!==this.via&&null!==this.from&&null!==this.to?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):null!==this.via&&(this.via.x=0,this.via.y=0)},o.prototype._drawControlNodes=function(t){if(1==this.controlNodesEnabled){if(null===this.controlNodes.from&&null===this.controlNodes.to){var e="edgeIdFrom:".concat(this.id),i="edgeIdTo:".concat(this.id),o={nodes:{group:"",radius:7,borderWidth:2,borderWidthSelected:2},physics:{damping:0},clustering:{maxNodeSizeIncrements:0,nodeScaling:{width:0,height:0,radius:0}}};this.controlNodes.from=new n({id:e,shape:"dot",color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968"}}},{},{},o),this.controlNodes.to=new n({id:i,shape:"dot",color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968"}}},{},{},o)}this.controlNodes.positions={},0==this.controlNodes.from.selected&&(this.controlNodes.positions.from=this.getControlNodeFromPosition(t),this.controlNodes.from.x=this.controlNodes.positions.from.x,this.controlNodes.from.y=this.controlNodes.positions.from.y),0==this.controlNodes.to.selected&&(this.controlNodes.positions.to=this.getControlNodeToPosition(t),this.controlNodes.to.x=this.controlNodes.positions.to.x,this.controlNodes.to.y=this.controlNodes.positions.to.y),this.controlNodes.from.draw(t),this.controlNodes.to.draw(t)}else this.controlNodes={from:null,to:null,positions:{}}},o.prototype._enableControlNodes=function(){this.fromBackup=this.from,this.toBackup=this.to,this.controlNodesEnabled=!0},o.prototype._disableControlNodes=function(){this.fromId=this.from.id,this.toId=this.to.id,this.fromId!=this.fromBackup.id?this.fromBackup.detachEdge(this):this.toId!=this.toBackup.id&&this.toBackup.detachEdge(this),this.fromBackup=null,this.toBackup=null,this.controlNodesEnabled=!1},o.prototype._getSelectedControlNode=function(t,e){var i=this.controlNodes.positions,o=Math.sqrt(Math.pow(t-i.from.x,2)+Math.pow(e-i.from.y,2)),s=Math.sqrt(Math.pow(t-i.to.x,2)+Math.pow(e-i.to.y,2));return 15>o?(this.connectedNode=this.from,this.from=this.controlNodes.from,this.controlNodes.from):15>s?(this.connectedNode=this.to,this.to=this.controlNodes.to,this.controlNodes.to):null},o.prototype._restoreControlNodes=function(){1==this.controlNodes.from.selected?(this.from=this.connectedNode,this.connectedNode=null,this.controlNodes.from.unselect()):1==this.controlNodes.to.selected&&(this.to=this.connectedNode,this.connectedNode=null,this.controlNodes.to.unselect())},o.prototype.getControlNodeFromPosition=function(t){var e;if(1==this.options.smoothCurves.enabled)e=this._findBorderPosition(!0,t);else{var i=Math.atan2(this.to.y-this.from.y,this.to.x-this.from.x),o=this.to.x-this.from.x,s=this.to.y-this.from.y,n=Math.sqrt(o*o+s*s),r=this.from.distanceToBorder(t,i+Math.PI),a=(n-r)/n;e={},e.x=a*this.from.x+(1-a)*this.to.x,e.y=a*this.from.y+(1-a)*this.to.y }return e},o.prototype.getControlNodeToPosition=function(t){var e;if(1==this.options.smoothCurves.enabled)e=this._findBorderPosition(!1,t);else{var i=Math.atan2(this.to.y-this.from.y,this.to.x-this.from.x),o=this.to.x-this.from.x,s=this.to.y-this.from.y,n=Math.sqrt(o*o+s*s),r=this.to.distanceToBorder(t,i),a=(n-r)/n;e={},e.x=(1-a)*this.from.x+a*this.to.x,e.y=(1-a)*this.from.y+a*this.to.y}return e},t.exports=o},function(t,e,i){function o(){this.clear(),this.defaultIndex=0,this.groupsArray=[],this.groupIndex=0,this.useDefaultGroups=!0}i(1);o.DEFAULT=[{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"}}],o.prototype.clear=function(){this.groups={},this.groups.length=function(){var t=0;for(var e in this)this.hasOwnProperty(e)&&t++;return t}},o.prototype.get=function(t){var e=this.groups[t];if(void 0==e)if(this.useDefaultGroups===!1&&this.groupsArray.length>0){var i=this.groupIndex%this.groupsArray.length;this.groupIndex++,e={},e.color=this.groups[this.groupsArray[i]],this.groups[t]=e}else{var i=this.defaultIndex%o.DEFAULT.length;this.defaultIndex++,e={},e.color=o.DEFAULT[i],this.groups[t]=e}return e},o.prototype.add=function(t,e){return this.groups[t]=e,this.groupsArray.push(t),e},t.exports=o},function(t){function e(){this.images={},this.imageBroken={},this.callback=void 0}e.prototype.setOnloadCallback=function(t){this.callback=t},e.prototype.load=function(t,e){var i=this.images[t];if(void 0===i){var o=this;i=new Image,i.onload=function(){0==this.width&&(document.body.appendChild(this),this.width=this.offsetWidth,this.height=this.offsetHeight,document.body.removeChild(this)),o.callback&&(o.images[t]=i,o.callback(this))},i.onerror=function(){void 0===e?(console.error("Could not load image:",t),delete this.src,o.callback&&o.callback(this)):o.imageBroken[t]===!0?this.src==e?(console.error("Could not load brokenImage:",e),delete this.src,o.callback&&o.callback(this)):(console.error("Could not load image:",t),this.src=e):(console.error("Could not load image:",t),this.src=e,o.imageBroken[t]=!0)},i.src=t}return i},t.exports=e},function(t,e,i){function o(t,e,i,o){var n=s.selectiveBridgeObject(["nodes"],o);this.options=n.nodes,this.selected=!1,this.hover=!1,this.edges=[],this.id=void 0,this.allowedToMoveX=!1,this.allowedToMoveY=!1,this.xFixed=!1,this.yFixed=!1,this.horizontalAlignLeft=!0,this.verticalAlignTop=!0,this.baseRadiusValue=o.nodes.radius,this.radiusFixed=!1,this.level=-1,this.preassignedLevel=!1,this.hierarchyEnumerated=!1,this.labelDimensions={top:0,left:0,width:0,height:0,yLine:0},this.boundingBox={top:0,left:0,right:0,bottom:0},this.imagelist=e,this.grouplist=i,this.x=null,this.y=null,this.predefinedPosition=!1,this.previousState={vx:0,vy:0,x:0,y:0},this.fixedData={x:null,y:null},this.setProperties(t,n),this.networkScaleInv=1,this.networkScale=1,this.canvasTopLeft={x:-300,y:-300},this.canvasBottomRight={x:300,y:300},this.parentEdgeId=null}var s=i(1);o.prototype.attachEdge=function(t){-1==this.edges.indexOf(t)&&this.edges.push(t)},o.prototype.detachEdge=function(t){var e=this.edges.indexOf(t);-1!=e&&this.edges.splice(e,1)},o.prototype.setProperties=function(t,e){if(t){this.properties=t;var i=["borderWidth","borderWidthSelected","shape","image","brokenImage","radius","fontColor","fontSize","fontFace","fontFill","fontStrokeWidth","fontStrokeColor","group","mass","fontDrawThreshold","scaleFontWithValue","fontSizeMaxVisible","customScalingFunction","iconFontFace","icon","iconColor","iconSize","value"];if(s.selectiveDeepExtend(i,this.options,t),void 0!==t.id&&(this.id=t.id),void 0!==t.label&&(this.label=t.label,this.originalLabel=t.label),void 0!==t.title&&(this.title=t.title),void 0!==t.x&&(this.x=t.x,this.predefinedPosition=!0),void 0!==t.y&&(this.y=t.y,this.predefinedPosition=!0),void 0!==t.value&&(this.value=t.value),void 0!==t.level&&(this.level=t.level,this.preassignedLevel=!0),void 0!==t.horizontalAlignLeft&&(this.horizontalAlignLeft=t.horizontalAlignLeft),void 0!==t.verticalAlignTop&&(this.verticalAlignTop=t.verticalAlignTop),void 0!==t.triggerFunction&&(this.triggerFunction=t.triggerFunction),void 0===this.id)throw"Node must have an id";if("number"==typeof t.group||"string"==typeof t.group&&""!=t.group){var o=this.grouplist.get(t.group);s.deepExtend(this.options,o),this.options.color=s.parseColor(this.options.color)}if(void 0!==t.radius&&(this.baseRadiusValue=this.options.radius),void 0!==t.color&&(this.options.color=s.parseColor(t.color)),void 0!==this.options.image&&""!=this.options.image){if(!this.imagelist)throw"No imagelist provided";this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage)}switch(void 0!==t.allowedToMoveX?(this.xFixed=!t.allowedToMoveX,this.allowedToMoveX=t.allowedToMoveX):void 0!==t.x&&0==this.allowedToMoveX&&(this.xFixed=!0),void 0!==t.allowedToMoveY?(this.yFixed=!t.allowedToMoveY,this.allowedToMoveY=t.allowedToMoveY):void 0!==t.y&&0==this.allowedToMoveY&&(this.yFixed=!0),this.radiusFixed=this.radiusFixed||void 0!==t.radius,("image"===this.options.shape||"circularImage"===this.options.shape)&&(this.options.radiusMin=e.nodes.widthMin,this.options.radiusMax=e.nodes.widthMax),this.options.shape){case"database":this.draw=this._drawDatabase,this.resize=this._resizeDatabase;break;case"box":this.draw=this._drawBox,this.resize=this._resizeBox;break;case"circle":this.draw=this._drawCircle,this.resize=this._resizeCircle;break;case"ellipse":this.draw=this._drawEllipse,this.resize=this._resizeEllipse;break;case"image":this.draw=this._drawImage,this.resize=this._resizeImage;break;case"circularImage":this.draw=this._drawCircularImage,this.resize=this._resizeCircularImage;break;case"text":this.draw=this._drawText,this.resize=this._resizeText;break;case"dot":this.draw=this._drawDot,this.resize=this._resizeShape;break;case"square":this.draw=this._drawSquare,this.resize=this._resizeShape;break;case"triangle":this.draw=this._drawTriangle,this.resize=this._resizeShape;break;case"triangleDown":this.draw=this._drawTriangleDown,this.resize=this._resizeShape;break;case"star":this.draw=this._drawStar,this.resize=this._resizeShape;break;case"icon":this.draw=this._drawIcon,this.resize=this._resizeIcon;break;default:this.draw=this._drawEllipse,this.resize=this._resizeEllipse}this._reset()}},o.prototype.select=function(){this.selected=!0,this._reset()},o.prototype.unselect=function(){this.selected=!1,this._reset()},o.prototype.clearSizeCache=function(){this._reset()},o.prototype._reset=function(){this.width=void 0,this.height=void 0},o.prototype.getTitle=function(){return"function"==typeof this.title?this.title():this.title},o.prototype.distanceToBorder=function(t,e){var i=1;switch(this.width||this.resize(t),this.options.shape){case"circle":case"dot":return this.options.radius+i;case"ellipse":var o=this.width/2,s=this.height/2,n=Math.sin(e)*o,r=Math.cos(e)*s;return o*s/Math.sqrt(n*n+r*r);case"box":case"image":case"text":default:return this.width?Math.min(Math.abs(this.width/2/Math.cos(e)),Math.abs(this.height/2/Math.sin(e)))+i:0}},o.prototype.isFixed=function(){return this.xFixed&&this.yFixed},o.prototype.isSelected=function(){return this.selected},o.prototype.getValue=function(){return this.value},o.prototype.getDistance=function(t,e){var i=this.x-t,o=this.y-e;return Math.sqrt(i*i+o*o)},o.prototype.setValueRange=function(t,e,i){if(!this.radiusFixed&&void 0!==this.value){var o=this.options.customScalingFunction(t,e,i,this.value),s=this.options.radiusMax-this.options.radiusMin;if(1==this.options.scaleFontWithValue){var n=this.options.fontSizeMax-this.options.fontSizeMin;this.options.fontSize=this.options.fontSizeMin+o*n}this.options.radius=this.options.radiusMin+o*s}this.baseRadiusValue=this.options.radius},o.prototype.draw=function(){throw"Draw method not initialized for node"},o.prototype.resize=function(){throw"Resize method not initialized for node"},o.prototype.isOverlappingWith=function(t){return this.leftt.left&&this.topt.top},o.prototype._resizeImage=function(){if(!this.width||!this.height){var t,e;if(this.value){this.options.radius=this.baseRadiusValue;var i=this.imageObj.height/this.imageObj.width;void 0!==i?(t=this.options.radius||this.imageObj.width,e=this.options.radius*i||this.imageObj.height):(t=0,e=0)}else t=this.imageObj.width,e=this.imageObj.height;this.width=t,this.height=e}},o.prototype._drawImageAtPosition=function(t){0!=this.imageObj.width&&(t.globalAlpha=1,t.drawImage(this.imageObj,this.left,this.top,this.width,this.height))},o.prototype._drawImageLabel=function(t){var e,i=0;if(this.height){i=this.height/2;var o=this.getTextSize(t);o.lineCount>=1&&(i+=o.height/2,i+=3)}e=this.y+i,this._label(t,this.label,this.x,e,void 0)},o.prototype._drawImage=function(t){this._resizeImage(t),this.left=this.x-this.width/2,this.top=this.y-this.height/2,this._drawImageAtPosition(t),this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height,this._drawImageLabel(t),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelDimensions.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelDimensions.left+this.labelDimensions.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelDimensions.height)},o.prototype._resizeCircularImage=function(t){if(this.imageObj.src&&this.imageObj.width&&this.imageObj.height)this._swapToImageResizeWhenImageLoaded&&(this.width=0,this.height=0,delete this._swapToImageResizeWhenImageLoaded),this._resizeImage(t);else if(!this.width){var e=2*this.options.radius;this.width=e,this.height=e,this._swapToImageResizeWhenImageLoaded=!0}},o.prototype._drawCircularImage=function(t){this._resizeCircularImage(t),this.left=this.x-this.width/2,this.top=this.y-this.height/2;var e=this.left+this.width/2,i=this.top+this.height/2,o=Math.abs(this.height/2);this._drawRawCircle(t,e,i,o),t.save(),t.circle(this.x,this.y,o),t.stroke(),t.clip(),this._drawImageAtPosition(t),t.restore(),this.boundingBox.top=this.y-this.options.radius,this.boundingBox.left=this.x-this.options.radius,this.boundingBox.right=this.x+this.options.radius,this.boundingBox.bottom=this.y+this.options.radius,this._drawImageLabel(t),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelDimensions.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelDimensions.left+this.labelDimensions.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelDimensions.height)},o.prototype._resizeBox=function(t){if(!this.width){var e=5,i=this.getTextSize(t);this.width=i.width+2*e,this.height=i.height+2*e}},o.prototype._drawBox=function(t){this._resizeBox(t),this.left=this.x-this.width/2,this.top=this.y-this.height/2;var e=this.options.borderWidth,i=this.options.borderWidthSelected||2*this.options.borderWidth;t.strokeStyle=this.selected?this.options.color.highlight.border:this.hover?this.options.color.hover.border:this.options.color.border,t.lineWidth=this.selected?i:e,t.lineWidth*=this.networkScaleInv,t.lineWidth=Math.min(this.width,t.lineWidth),t.fillStyle=this.selected?this.options.color.highlight.background:this.hover?this.options.color.hover.background:this.options.color.background,t.roundRect(this.left,this.top,this.width,this.height,this.options.radius),t.fill(),t.stroke(),this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height,this._label(t,this.label,this.x,this.y)},o.prototype._resizeDatabase=function(t){if(!this.width){var e=5,i=this.getTextSize(t),o=i.width+2*e;this.width=o,this.height=o}},o.prototype._drawDatabase=function(t){this._resizeDatabase(t),this.left=this.x-this.width/2,this.top=this.y-this.height/2;var e=this.options.borderWidth,i=this.options.borderWidthSelected||2*this.options.borderWidth;t.strokeStyle=this.selected?this.options.color.highlight.border:this.hover?this.options.color.hover.border:this.options.color.border,t.lineWidth=this.selected?i:e,t.lineWidth*=this.networkScaleInv,t.lineWidth=Math.min(this.width,t.lineWidth),t.fillStyle=this.selected?this.options.color.highlight.background:this.hover?this.options.color.hover.background:this.options.color.background,t.database(this.x-this.width/2,this.y-.5*this.height,this.width,this.height),t.fill(),t.stroke(),this.boundingBox.top=this.top,this.boundingBox.left=this.left,this.boundingBox.right=this.left+this.width,this.boundingBox.bottom=this.top+this.height,this._label(t,this.label,this.x,this.y)},o.prototype._resizeCircle=function(t){if(!this.width){var e=5,i=this.getTextSize(t),o=Math.max(i.width,i.height)+2*e;this.options.radius=o/2,this.width=o,this.height=o}},o.prototype._drawRawCircle=function(t,e,i,o){var s=this.options.borderWidth,n=this.options.borderWidthSelected||2*this.options.borderWidth;t.strokeStyle=this.selected?this.options.color.highlight.border:this.hover?this.options.color.hover.border:this.options.color.border,t.lineWidth=this.selected?n:s,t.lineWidth*=this.networkScaleInv,t.lineWidth=Math.min(this.width,t.lineWidth),t.fillStyle=this.selected?this.options.color.highlight.background:this.hover?this.options.color.hover.background:this.options.color.background,t.circle(this.x,this.y,o),t.fill(),t.stroke()},o.prototype._drawCircle=function(t){this._resizeCircle(t),this.left=this.x-this.width/2,this.top=this.y-this.height/2,this._drawRawCircle(t,this.x,this.y,this.options.radius),this.boundingBox.top=this.y-this.options.radius,this.boundingBox.left=this.x-this.options.radius,this.boundingBox.right=this.x+this.options.radius,this.boundingBox.bottom=this.y+this.options.radius,this._label(t,this.label,this.x,this.y)},o.prototype._resizeEllipse=function(t){if(!this.width){var e=this.getTextSize(t);this.width=1.5*e.width,this.height=2*e.height,this.widththis.options.fontDrawThreshold-1){var i=Number(this.options.iconSize);t.font=(this.selected?"bold ":"")+i+"px "+this.options.iconFontFace,t.fillStyle=this.options.iconColor||"black",t.textAlign="center",t.textBaseline="middle",t.fillText(this.options.icon,this.x,this.y)}},o.prototype._label=function(t,e,i,o,n,r,a){var h=Number(this.options.fontSize)*this.networkScale;if(e&&h>=this.options.fontDrawThreshold-1){var d=Number(this.options.fontSize);h>=this.options.fontSizeMaxVisible&&(d=Number(this.options.fontSizeMaxVisible)*this.networkScaleInv);var l=this.options.fontColor||"#000000",c=this.options.fontStrokeColor;if(h<=this.options.fontDrawThreshold){var u=Math.max(0,Math.min(1,1-(this.options.fontDrawThreshold-h)));l=s.overrideOpacity(l,u),c=s.overrideOpacity(c,u)}t.font=(this.selected?"bold ":"")+d+"px "+this.options.fontFace;var p=e.split("\n"),f=p.length,m=o+(1-f)/2*d;1==a&&(m=o+(1-f)/(2*d));for(var g=t.measureText(p[0]).width,v=1;f>v;v++){var y=t.measureText(p[v]).width;g=y>g?y:g}var b=d*f,w=i-g/2,x=o-b/2;"hanging"==r&&(x+=.5*d,x+=4,m+=4),this.labelDimensions={top:x,left:w,width:g,height:b,yLine:m},void 0!==this.options.fontFill&&null!==this.options.fontFill&&"none"!==this.options.fontFill&&(t.fillStyle=this.options.fontFill,t.fillRect(w,x,g,b)),t.fillStyle=l,t.textAlign=n||"center",t.textBaseline=r||"middle",this.options.fontStrokeWidth>0&&(t.lineWidth=this.options.fontStrokeWidth,t.strokeStyle=c,t.lineJoin="round");for(var v=0;f>v;v++)this.options.fontStrokeWidth&&t.strokeText(p[v],i,m),t.fillText(p[v],i,m),m+=d}},o.prototype.getTextSize=function(t){if(void 0!==this.label){var e=Number(this.options.fontSize);e*this.networkScale>this.options.fontSizeMaxVisible&&(e=Number(this.options.fontSizeMaxVisible)*this.networkScaleInv),t.font=(this.selected?"bold ":"")+e+"px "+this.options.fontFace;for(var i=this.label.split("\n"),o=(e+4)*i.length,s=0,n=0,r=i.length;r>n;n++)s=Math.max(s,t.measureText(i[n]).width);return{width:s,height:o,lineCount:i.length}}return{width:0,height:0,lineCount:0}},o.prototype.inArea=function(){return void 0!==this.width?this.x+this.width*this.networkScaleInv>=this.canvasTopLeft.x&&this.x-this.width*this.networkScaleInv=this.canvasTopLeft.y&&this.y-this.height*this.networkScaleInvo&&(n=o-e-this.padding),ns&&(r=s-i-this.padding),ri;i++)if(e.id===r.nodes[i].id){s=r.nodes[i];break}for(s||(s={id:e.id},t.node&&(s.attr=a(s.attr,t.node))),i=n.length-1;i>=0;i--){var h=n[i];h.nodes||(h.nodes=[]),-1==h.nodes.indexOf(s)&&h.nodes.push(s)}e.attr&&(s.attr=a(s.attr,e.attr))}function l(t,e){if(t.edges||(t.edges=[]),t.edges.push(e),t.edge){var i=a({},t.edge);e.attr=a(i,e.attr)}}function c(t,e,i,o,s){var n={from:e,to:i,type:o};return t.edge&&(n.attr=a({},t.edge)),n.attr=a(n.attr||{},s),n}function u(){for(N=O.NULL,k="";" "==E||" "==E||"\n"==E||"\r"==E;)s();do{var t=!1;if("#"==E){for(var e=T-1;" "==C.charAt(e)||" "==C.charAt(e);)e--;if("\n"==C.charAt(e)||""==C.charAt(e)){for(;""!=E&&"\n"!=E;)s();t=!0}}if("/"==E&&"/"==n()){for(;""!=E&&"\n"!=E;)s();t=!0}if("/"==E&&"*"==n()){for(;""!=E;){if("*"==E&&"/"==n()){s(),s();break}s()}t=!0}for(;" "==E||" "==E||"\n"==E||"\r"==E;)s()}while(t);if(""==E)return void(N=O.DELIMITER);var i=E+n();if(S[i])return N=O.DELIMITER,k=i,s(),void s();if(S[E])return N=O.DELIMITER,k=E,void s();if(r(E)||"-"==E){for(k+=E,s();r(E);)k+=E,s();return"false"==k?k=!1:"true"==k?k=!0:isNaN(Number(k))||(k=Number(k)),void(N=O.IDENTIFIER)}if('"'==E){for(s();""!=E&&('"'!=E||'"'==E&&'"'==n());)k+=E,'"'==E&&s(),s();if('"'!=E)throw x('End of string " expected');return s(),void(N=O.IDENTIFIER)}for(N=O.UNKNOWN;""!=E;)k+=E,s();throw new SyntaxError('Syntax error in part "'+_(k,30)+'"')}function p(){var t={};if(o(),u(),"strict"==k&&(t.strict=!0,u()),("graph"==k||"digraph"==k)&&(t.type=k,u()),N==O.IDENTIFIER&&(t.id=k,u()),"{"!=k)throw x("Angle bracket { expected");if(u(),f(t),"}"!=k)throw x("Angle bracket } expected");if(u(),""!==k)throw x("End of file expected");return u(),delete t.node,delete t.edge,delete t.graph,t}function f(t){for(;""!==k&&"}"!=k;)m(t),";"==k&&u()}function m(t){var e=g(t);if(e)return void b(t,e);var i=v(t);if(!i){if(N!=O.IDENTIFIER)throw x("Identifier expected");var o=k;if(u(),"="==k){if(u(),N!=O.IDENTIFIER)throw x("Identifier expected");t[o]=k,u()}else y(t,o)}}function g(t){var e=null;if("subgraph"==k&&(e={},e.type="subgraph",u(),N==O.IDENTIFIER&&(e.id=k,u())),"{"==k){if(u(),e||(e={}),e.parent=t,e.node=t.node,e.edge=t.edge,e.graph=t.graph,f(e),"}"!=k)throw x("Angle bracket } expected");u(),delete e.node,delete e.edge,delete e.graph,delete e.parent,t.subgraphs||(t.subgraphs=[]),t.subgraphs.push(e)}return e}function v(t){return"node"==k?(u(),t.node=w(),"node"):"edge"==k?(u(),t.edge=w(),"edge"):"graph"==k?(u(),t.graph=w(),"graph"):null}function y(t,e){var i={id:e},o=w();o&&(i.attr=o),d(t,i),b(t,e)}function b(t,e){for(;"->"==k||"--"==k;){var i,o=k;u();var s=g(t);if(s)i=s;else{if(N!=O.IDENTIFIER)throw x("Identifier or subgraph expected");i=k,d(t,{id:i}),u()}var n=w(),r=c(t,e,i,o,n);l(t,r),e=i}}function w(){for(var t=null;"["==k;){for(u(),t={};""!==k&&"]"!=k;){if(N!=O.IDENTIFIER)throw x("Attribute name expected");var e=k;if(u(),"="!=k)throw x("Equal sign = expected");if(u(),N!=O.IDENTIFIER)throw x("Attribute value expected");var i=k;h(t,e,i),u(),","==k&&u()}if("]"!=k)throw x("Bracket ] expected");u()}return t}function x(t){return new SyntaxError(t+', got "'+_(k,30)+'" (char '+T+")")}function _(t,e){return t.length<=e?t:t.substr(0,27)+"..."}function M(t,e,i){Array.isArray(t)?t.forEach(function(t){Array.isArray(e)?e.forEach(function(e){i(t,e)}):i(t,e)}):Array.isArray(e)?e.forEach(function(e){i(t,e)}):i(t,e)}function D(t){var e=i(t),o={nodes:[],edges:[],options:{}};if(e.nodes&&e.nodes.forEach(function(t){var e={id:t.id,label:String(t.label||t.id)};a(e,t.attr),e.image&&(e.shape="image"),o.nodes.push(e)}),e.edges){var s=function(t){var e={from:t.from,to:t.to};return a(e,t.attr),e.style="->"==t.type?"arrow":"line",e};e.edges.forEach(function(t){var e,i;e=t.from instanceof Object?t.from.nodes:{id:t.from},i=t.to instanceof Object?t.to.nodes:{id:t.to},t.from instanceof Object&&t.from.edges&&t.from.edges.forEach(function(t){var e=s(t);o.edges.push(e)}),M(e,i,function(e,i){var n=c(o,e.id,i.id,t.type,t.attr),r=s(n);o.edges.push(r)}),t.to instanceof Object&&t.to.edges&&t.to.edges.forEach(function(t){var e=s(t);o.edges.push(e)})})}return e.attr&&(o.options=e.attr),o}var O={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},S={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},C="",T=0,E="",k="",N=O.NULL,L=/[a-zA-Z_0-9.:#]/;e.parseDOT=i,e.DOTToGraph=D},function(t,e){function i(t,e){var i=[],o=[];this.options={edges:{inheritColor:!0},nodes:{allowedToMove:!1,parseColor:!1}},void 0!==e&&(this.options.nodes.allowedToMove=e.allowedToMove|!1,this.options.nodes.parseColor=e.parseColor|!1,this.options.edges.inheritColor=e.inheritColor|!0);for(var s=t.edges,n=t.nodes,r=0;r0?Math.max.apply(null,i)+1:1):(this.customBarIds.forEach(function(t){if(t===e)throw new Error("Custom time ID already exists")}),s=e),this.customBarIds.push(s),o=new d(this.body,{showCustomTime:!0,time:n,id:s}),this.components.push(o),this.redraw(),s},o.prototype.removeCustomTime=function(t){var e=this;this.components.forEach(function(i,o,s){i instanceof d&&i.options.id===t&&0!==i.options.id&&(e.customBarIds.splice(e.customBarIds.indexOf(t),1),s.splice(o,1),i.destroy())})},o.prototype.getVisibleItems=function(){return this.itemSet&&this.itemSet.getVisibleItems()||[]},o.prototype.clear=function(t){(!t||t.items)&&this.setItems(null),(!t||t.groups)&&this.setGroups(null),(!t||t.options)&&(this.components.forEach(function(t){return t.setOptions(t.defaultOptions)}),this.setOptions(this.defaultOptions))},o.prototype.fit=function(t){var e=this._getDataRange();if(null!==e.start||null!==e.end){var i=t&&void 0!==t.animate?t.animate:!0;this.range.setRange(e.start,e.end,i)}},o.prototype._getDataRange=function(){var t=this.getItemRange(),e=t.min,i=t.max;if(null!=e&&null!=i){var o=i.valueOf()-e.valueOf();0>=o&&(o=864e5),e=new Date(e.valueOf()-.05*o),i=new Date(i.valueOf()+.05*o)}return{start:e,end:i}},o.prototype.setWindow=function(t,e,i){var o;if(1==arguments.length){var s=arguments[0];o=void 0!==s.animate?s.animate:!0,this.range.setRange(s.start,s.end,o)}else o=i&&void 0!==i.animate?i.animate:!0,this.range.setRange(t,e,o)},o.prototype.moveTo=function(t,e){var i=this.range.end-this.range.start,o=r.convert(t,"Date").valueOf(),s=o-i/2,n=o+i/2,a=e&&void 0!==e.animate?e.animate:!0;this.range.setRange(s,n,a)},o.prototype.getWindow=function(){var t=this.range.getRange();return{start:new Date(t.start),end:new Date(t.end)}},o.prototype.redraw=function(){this._redraw()},o.prototype._redraw=function(){var t=!1,e=this.options,i=this.props,o=this.dom;if(o){h.updateHiddenDates(this.body,this.options.hiddenDates),"top"==e.orientation?(r.addClassName(o.root,"top"),r.removeClassName(o.root,"bottom")):(r.removeClassName(o.root,"top"),r.addClassName(o.root,"bottom")),o.root.style.maxHeight=r.option.asSize(e.maxHeight,""),o.root.style.minHeight=r.option.asSize(e.minHeight,""),o.root.style.width=r.option.asSize(e.width,""),i.border.left=(o.centerContainer.offsetWidth-o.centerContainer.clientWidth)/2,i.border.right=i.border.left,i.border.top=(o.centerContainer.offsetHeight-o.centerContainer.clientHeight)/2,i.border.bottom=i.border.top;var s=o.root.offsetHeight-o.root.clientHeight,n=o.root.offsetWidth-o.root.clientWidth;0===o.centerContainer.clientHeight&&(i.border.left=i.border.top,i.border.right=i.border.left),0===o.root.clientHeight&&(n=s),i.center.height=o.center.offsetHeight,i.left.height=o.left.offsetHeight,i.right.height=o.right.offsetHeight,i.top.height=o.top.clientHeight||-i.border.top,i.bottom.height=o.bottom.clientHeight||-i.border.bottom;var a=Math.max(i.left.height,i.center.height,i.right.height),d=i.top.height+a+i.bottom.height+s+i.border.top+i.border.bottom;o.root.style.height=r.option.asSize(e.height,d+"px"),i.root.height=o.root.offsetHeight,i.background.height=i.root.height-s;var l=i.root.height-i.top.height-i.bottom.height-s;i.centerContainer.height=l,i.leftContainer.height=l,i.rightContainer.height=i.leftContainer.height,i.root.width=o.root.offsetWidth,i.background.width=i.root.width-n,i.left.width=o.leftContainer.clientWidth||-i.border.left,i.leftContainer.width=i.left.width,i.right.width=o.rightContainer.clientWidth||-i.border.right,i.rightContainer.width=i.right.width;var c=i.root.width-i.left.width-i.right.width-n;i.center.width=c,i.centerContainer.width=c,i.top.width=c,i.bottom.width=c,o.background.style.height=i.background.height+"px",o.backgroundVertical.style.height=i.background.height+"px",o.backgroundHorizontal.style.height=i.centerContainer.height+"px",o.centerContainer.style.height=i.centerContainer.height+"px",o.leftContainer.style.height=i.leftContainer.height+"px",o.rightContainer.style.height=i.rightContainer.height+"px",o.background.style.width=i.background.width+"px",o.backgroundVertical.style.width=i.centerContainer.width+"px",o.backgroundHorizontal.style.width=i.background.width+"px",o.centerContainer.style.width=i.center.width+"px",o.top.style.width=i.top.width+"px",o.bottom.style.width=i.bottom.width+"px",o.background.style.left="0",o.background.style.top="0",o.backgroundVertical.style.left=i.left.width+i.border.left+"px",o.backgroundVertical.style.top="0",o.backgroundHorizontal.style.left="0",o.backgroundHorizontal.style.top=i.top.height+"px",o.centerContainer.style.left=i.left.width+"px",o.centerContainer.style.top=i.top.height+"px",o.leftContainer.style.left="0",o.leftContainer.style.top=i.top.height+"px",o.rightContainer.style.left=i.left.width+i.center.width+"px",o.rightContainer.style.top=i.top.height+"px",o.top.style.left=i.left.width+"px",o.top.style.top="0",o.bottom.style.left=i.left.width+"px",o.bottom.style.top=i.top.height+i.centerContainer.height+"px",this._updateScrollTop();var u=this.props.scrollTop;"bottom"==e.orientation&&(u+=Math.max(this.props.centerContainer.height-this.props.center.height-this.props.border.top-this.props.border.bottom,0)),o.center.style.left="0",o.center.style.top=u+"px",o.left.style.left="0",o.left.style.top=u+"px",o.right.style.left="0",o.right.style.top=u+"px";var p=0==this.props.scrollTop?"hidden":"",f=this.props.scrollTop==this.props.scrollTopMin?"hidden":"";if(o.shadowTop.style.visibility=p,o.shadowBottom.style.visibility=f,o.shadowTopLeft.style.visibility=p,o.shadowBottomLeft.style.visibility=f,o.shadowTopRight.style.visibility=p,o.shadowBottomRight.style.visibility=f,this.components.forEach(function(e){t=e.redraw()||t}),t){var m=3;this.redrawCount0&&(this.props.scrollTop=0),this.props.scrollTopt[o].y?t[o].y:e,i=i0){var r,a,h=Number(i.svg.style.height.replace("px",""));if(r=s.getSVGElement("path",i.svgElements,i.svg),r.setAttributeNS(null,"class",e.className),void 0!==e.style&&r.setAttributeNS(null,"style",e.style),a=1==e.options.catmullRom.enabled?o._catmullRom(t,e):o._linear(t),1==e.options.shaded.enabled){var d,l=s.getSVGElement("path",i.svgElements,i.svg);d="top"==e.options.shaded.orientation?"M"+t[0].x+",0 "+a+"L"+t[t.length-1].x+",0":"M"+t[0].x+","+h+" "+a+"L"+t[t.length-1].x+","+h,l.setAttributeNS(null,"class",e.className+" fill"),void 0!==e.options.shaded.style&&l.setAttributeNS(null,"style",e.options.shaded.style),l.setAttributeNS(null,"d",d)}r.setAttributeNS(null,"d","M"+a),1==e.options.drawPoints.enabled&&n.draw(t,e,i)}},o._catmullRomUniform=function(t){for(var e,i,o,s,n,r,a=Math.round(t[0].x)+","+Math.round(t[0].y)+" ",h=1/6,d=t.length,l=0;d-1>l;l++)e=0==l?t[0]:t[l-1],i=t[l],o=t[l+1],s=d>l+2?t[l+2]:o,n={x:(-e.x+6*i.x+o.x)*h,y:(-e.y+6*i.y+o.y)*h},r={x:(i.x+6*o.x-s.x)*h,y:(i.y+6*o.y-s.y)*h},a+="C"+n.x+","+n.y+" "+r.x+","+r.y+" "+o.x+","+o.y+" ";return a},o._catmullRom=function(t,e){var i=e.options.catmullRom.alpha;if(0==i||void 0===i)return this._catmullRomUniform(t);for(var o,s,n,r,a,h,d,l,c,u,p,f,m,g,v,y,b,w,x,_=Math.round(t[0].x)+","+Math.round(t[0].y)+" ",M=t.length,D=0;M-1>D;D++)o=0==D?t[0]:t[D-1],s=t[D],n=t[D+1],r=M>D+2?t[D+2]:n,d=Math.sqrt(Math.pow(o.x-s.x,2)+Math.pow(o.y-s.y,2)),l=Math.sqrt(Math.pow(s.x-n.x,2)+Math.pow(s.y-n.y,2)),c=Math.sqrt(Math.pow(n.x-r.x,2)+Math.pow(n.y-r.y,2)),g=Math.pow(c,i),y=Math.pow(c,2*i),v=Math.pow(l,i),b=Math.pow(l,2*i),x=Math.pow(d,i),w=Math.pow(d,2*i),u=2*w+3*x*v+b,p=2*y+3*g*v+b,f=3*x*(x+v),f>0&&(f=1/f),m=3*g*(g+v),m>0&&(m=1/m),a={x:(-b*o.x+u*s.x+w*n.x)*f,y:(-b*o.y+u*s.y+w*n.y)*f},h={x:(y*s.x+p*n.x-b*r.x)*m,y:(y*s.y+p*n.y-b*r.y)*m},0==a.x&&0==a.y&&(a=s),0==h.x&&0==h.y&&(h=n),_+="C"+a.x+","+a.y+" "+h.x+","+h.y+" "+n.x+","+n.y+" ";return _},o._linear=function(t){for(var e="",i=0;it[o].y?t[o].y:e,i=i0&&(r=Math.min(r,Math.abs(u[l-1].x-a))),h=o._getSafeDrawData(r,d,m);else{var v=l+(p[a].amount-p[a].resolved),y=l-(p[a].resolved+1);v0&&(r=Math.min(r,Math.abs(u[y].x-a))),h=o._getSafeDrawData(r,d,m),p[a].resolved+=1,"stack"==d.options.barChart.handleOverlap?(g=p[a].accumulated,p[a].accumulated+=d.zeroPosition-u[l].y):"sideBySide"==d.options.barChart.handleOverlap&&(h.width=h.width/p[a].amount,h.offset+=p[a].resolved*h.width-.5*h.width*(p[a].amount+1),"left"==d.options.barChart.align?h.offset-=.5*h.width:"right"==d.options.barChart.align&&(h.offset+=.5*h.width))}s.drawBar(u[l].x+h.offset,u[l].y-g,h.width,d.zeroPosition-u[l].y,d.className+" bar",i.svgElements,i.svg),1==d.options.drawPoints.enabled&&n.draw([u[l]],d,i,h.offset)}},o._getDataIntersections=function(t,e){for(var i,o=0;o0&&(i=Math.min(i,Math.abs(e[o-1].x-e[o].x))),0==i&&(void 0===t[e[o].x]&&(t[e[o].x]={amount:0,resolved:0,accumulated:0}),t[e[o].x].amount+=1)},o._getSafeDrawData=function(t,e,i){var o,s;return t0?(o=i>t?i:t,s=0,"left"==e.options.barChart.align?s-=.5*t:"right"==e.options.barChart.align&&(s+=.5*t)):(o=e.options.barChart.width,s=0,"left"==e.options.barChart.align?s-=.5*e.options.barChart.width:"right"==e.options.barChart.align&&(s+=.5*e.options.barChart.width)),{width:o,offset:s}},o.getStackedBarYRange=function(t,e,i,s,n){if(t.length>0){t.sort(function(t,e){return t.x==e.x?t.groupId-e.groupId:t.x-e.x});var r={};o._getDataIntersections(r,t),e[s]=o._getStackedBarYRange(r,t),e[s].yAxisOrientation=n,i.push(s)}},o._getStackedBarYRange=function(t,e){for(var i,o=e[0].y,s=e[0].y,n=0;ne[n].y?e[n].y:o,s=st[r].accumulated?t[r].accumulated:o,s=st[o].y?t[o].y:e,i=io;o++){var s=o%2===0?1.3*i:.5*i;this.lineTo(t+s*Math.sin(2*o*Math.PI/10),e-s*Math.cos(2*o*Math.PI/10))}this.closePath()},CanvasRenderingContext2D.prototype.roundRect=function(t,e,i,o,s){var n=Math.PI/180;0>i-2*s&&(s=i/2),0>o-2*s&&(s=o/2),this.beginPath(),this.moveTo(t+s,e),this.lineTo(t+i-s,e),this.arc(t+i-s,e+s,s,270*n,360*n,!1),this.lineTo(t+i,e+o-s),this.arc(t+i-s,e+o-s,s,0,90*n,!1),this.lineTo(t+s,e+o),this.arc(t+s,e+o-s,s,90*n,180*n,!1),this.lineTo(t,e+s),this.arc(t+s,e+s,s,180*n,270*n,!1)},CanvasRenderingContext2D.prototype.ellipse=function(t,e,i,o){var s=.5522848,n=i/2*s,r=o/2*s,a=t+i,h=e+o,d=t+i/2,l=e+o/2;this.beginPath(),this.moveTo(t,l),this.bezierCurveTo(t,l-r,d-n,e,d,e),this.bezierCurveTo(d+n,e,a,l-r,a,l),this.bezierCurveTo(a,l+r,d+n,h,d,h),this.bezierCurveTo(d-n,h,t,l+r,t,l)},CanvasRenderingContext2D.prototype.database=function(t,e,i,o){var s=1/3,n=i,r=o*s,a=.5522848,h=n/2*a,d=r/2*a,l=t+n,c=e+r,u=t+n/2,p=e+r/2,f=e+(o-r/2),m=e+o;this.beginPath(),this.moveTo(l,p),this.bezierCurveTo(l,p+d,u+h,c,u,c),this.bezierCurveTo(u-h,c,t,p+d,t,p),this.bezierCurveTo(t,p-d,u-h,e,u,e),this.bezierCurveTo(u+h,e,l,p-d,l,p),this.lineTo(l,f),this.bezierCurveTo(l,f+d,u+h,m,u,m),this.bezierCurveTo(u-h,m,t,f+d,t,f),this.lineTo(t,p)},CanvasRenderingContext2D.prototype.arrow=function(t,e,i,o){var s=t-o*Math.cos(i),n=e-o*Math.sin(i),r=t-.9*o*Math.cos(i),a=e-.9*o*Math.sin(i),h=s+o/3*Math.cos(i+.5*Math.PI),d=n+o/3*Math.sin(i+.5*Math.PI),l=s+o/3*Math.cos(i-.5*Math.PI),c=n+o/3*Math.sin(i-.5*Math.PI);this.beginPath(),this.moveTo(t,e),this.lineTo(h,d),this.lineTo(r,a),this.lineTo(l,c),this.closePath()},CanvasRenderingContext2D.prototype.dashedLine=function(t,e,i,o,s){s||(s=[10,5]),0==u&&(u=.001);var n=s.length;this.moveTo(t,e);for(var r=i-t,a=o-e,h=a/r,d=Math.sqrt(r*r+a*a),l=0,c=!0;d>=.1;){var u=s[l++%n];u>d&&(u=d);var p=Math.sqrt(u*u/(1+h*h));0>r&&(p=-p),t+=p,e+=h*p,this[c?"lineTo":"moveTo"](t,e),d-=u,c=!c}})},function(t,e,i){var o=function(t,e,i){e&&Object.defineProperties(t,e),i&&Object.defineProperties(t.prototype,i)},s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},n=i(67).BarnesHutSolver,r=i(68).Repulsion,a=i(69).HierarchicalRepulsion,h=i(70).SpringSolver,d=i(71).HierarchicalSpringSolver,l=i(72).CentralGravitySolver,c=i(1),u=function(){function t(e,i){var o=this;s(this,t),this.body=e,this.physicsBody={calculationNodes:{},calculationNodeIndices:[],forces:{},velocities:{}},this.scale=1,this.viewFunction=void 0,this.body.emitter.on("_setScale",function(t){return o.scale=t}),this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},void 0==this.renderTimer,this.stabilized=!1,this.stabilizationIterations=0,this.options={barnesHut:{thetaInverted:2,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09},repulsion:{centralGravity:0,springLength:200,springConstant:.05,nodeDistance:100,damping:.09},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:150,damping:.09},model:"BarnesHut",timestep:.5,maxVelocity:50,minVelocity:.1,stabilization:{enabled:!0,iterations:1e3,updateInterval:100,onlyDynamicEdges:!1,zoomExtent:!0}},this.setOptions(i)}return o(t,null,{setOptions:{value:function(t){void 0!==t&&("boolean"==typeof t.stabilization&&(t.stabilization={enabled:t.stabilization}),c.deepExtend(this.options,t)),this.init()},writable:!0,configurable:!0},init:{value:function(){var t;"repulsion"==this.options.model?(t=this.options.repulsion,this.nodesSolver=new r(this.body,this.physicsBody,t),this.edgesSolver=new h(this.body,this.physicsBody,t)):"hierarchicalRepulsion"==this.options.model?(t=this.options.hierarchicalRepulsion,this.nodesSolver=new a(this.body,this.physicsBody,t),this.edgesSolver=new d(this.body,this.physicsBody,t)):(t=this.options.barnesHut,this.nodesSolver=new n(this.body,this.physicsBody,t),this.edgesSolver=new h(this.body,this.physicsBody,t)),this.gravitySolver=new l(this.body,this.physicsBody,t),this.modelOptions=t},writable:!0,configurable:!0},startSimulation:{value:function(){this.stabilized=!1,this.options.stabilization.enabled===!0?this.stabilize():this.runSimulation()},writable:!0,configurable:!0},runSimulation:{value:function(){void 0===this.viewFunction&&(this.viewFunction=this.simulationStep.bind(this),this.body.emitter.on("_beforeRender",this.viewFunction),this.body.emitter.emit("_startRendering"))},writable:!0,configurable:!0},simulationStep:{value:function(){var t=Date.now();this.physicsTick();var e=Date.now()-t;if((e<.4*this.simulationInterval||1==this.runDoubleSpeed)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0){if(this.stabilizationIterations>1){var i=this,o={iterations:this.stabilizationIterations};this.stabilizationIterations=0,this.startedStabilization=!1,setTimeout(function(){i.body.emitter.emit("stabilized",o)},0)}else this.stabilizationIterations=0;this.body.emitter.emit("_stopRendering")}},writable:!0,configurable:!0},physicsTick:{value:function(){this.stabilized===!1&&(this.calculateForces(),this.stabilized=this.moveNodes(),this.stabilized===!0?this.revert():0==this.startedStabilization&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0),this.stabilizationIterations++)},writable:!0,configurable:!0},_updateCalculationNodes:{value:function(){this.physicsBody.calculationNodes={},this.physicsBody.forces={},this.physicsBody.calculationNodeIndices=[];for(var t=0;ta&&o===!0,t=!0}return 1==t?s>.5*this.options.maxVelocity?!1:o:!0},writable:!0,configurable:!0},_performStep:{value:function(t,e){var i=this.physicsBody.calculationNodes[t],o=this.options.timestep,s=this.physicsBody.forces,n=this.physicsBody.velocities;if(this.previousStates[t]={x:i.x,y:i.y,vx:n[t].x,vy:n[t].y},i.xFixed)s[t].x=0,n[t].x=0;else{var r=this.modelOptions.damping*n[t].x,a=(s[t].x-r)/i.options.mass;n[t].x+=a*o,n[t].x=Math.abs(n[t].x)>e?n[t].x>0?e:-e:n[t].x,i.x+=n[t].x*o}if(i.yFixed)s[t].y=0,n[t].y=0;else{var h=this.modelOptions.damping*n[t].y,d=(s[t].y-h)/i.options.mass;n[t].y+=d*o,n[t].y=Math.abs(n[t].y)>e?n[t].y>0?e:-e:n[t].y,i.y+=n[t].y*o}var l=Math.sqrt(Math.pow(n[t].x,2)+Math.pow(n[t].y,2));return l},writable:!0,configurable:!0},calculateForces:{value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve()},writable:!0,configurable:!0},_freezeNodes:{value:function(){var t=this.body.nodes;for(var e in t)t.hasOwnProperty(e)&&null!=t[e].x&&null!=t[e].y&&(t[e].fixedData.x=t[e].xFixed,t[e].fixedData.y=t[e].yFixed,t[e].xFixed=!0,t[e].yFixed=!0)},writable:!0,configurable:!0},_restoreFrozenNodes:{value:function(){var t=this.body.nodes;for(var e in t)t.hasOwnProperty(e)&&null!=t[e].fixedData.x&&(t[e].xFixed=t[e].fixedData.x,t[e].yFixed=t[e].fixedData.y)},writable:!0,configurable:!0},stabilize:{value:function(){1==this.options.stabilization.onlyDynamicEdges&&this._freezeNodes(),this.stabilizationSteps=0,setTimeout(this._stabilizationBatch.bind(this),0)},writable:!0,configurable:!0},_stabilizationBatch:{value:function(){for(var t=0;0==this.stabilized&&t=t&&i.push(s.id)}for(var o=0;os?e.x:s,n=e.yr?e.y:r;return{x:.5*(o+s),y:.5*(n+r)}},writable:!0,configurable:!0},openCluster:{value:function(t,e){if(void 0===t)throw new Error("No clusterNodeId supplied to openCluster.");if(void 0===this.body.nodes[t])throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(void 0===this.body.nodes[t].containedNodes)return void console.log("The node:"+t+" is not a cluster.");var i=this.body.nodes[t],o=i.containedNodes,s=i.containedEdges;for(var n in o)o.hasOwnProperty(n)&&(this.body.nodes[n]=o[n],this.body.nodes[n].x=i.x,this.body.nodes[n].y=i.y,this.body.nodes[n].vx=i.vx,this.body.nodes[n].vy=i.vy,delete this.clusteredNodes[n]);for(var r in s)if(s.hasOwnProperty(r)){this.body.edges[r]=s[r],this.body.edges[r].connect();var a=this.body.edges[r];a.connected===!1&&(void 0!==this.clusteredNodes[a.fromId]&&this._connectEdge(a,a.fromId,!0),void 0!==this.clusteredNodes[a.toId]&&this._connectEdge(a,a.toId,!1))}this.body.emitter.emit("_newEdgesCreated",s);for(var h=[],d=0;d0&&a.fromId==t)void 0!==this.body.nodes[a.fromArray[0].id]&&this._connectEdge(a,a.fromArray[0].id,!0);else if(a.toArray.length>0&&a.toId==t)void 0!==this.body.nodes[a.toArray[0].id]&&this._connectEdge(a,a.toArray[0].id,!1);else{var r=h[d],l=this.body.edges[r].via.id;l&&(this.body.edges[r].via=null,delete this.body.supportNodes[l]),this.body.edges[r].disconnect(),delete this.body.edges[r]}}delete this.body.nodes[t],e!==!0&&this.body.emitter.emit("_dataChanged")},writable:!0,configurable:!0},_connectEdge:{value:function(t,e,i){var o=this._getClusterStack(e);1==i?(t.from=o[o.length-1],t.fromId=o[o.length-1].id,o.pop(),t.fromArray=o):(t.to=o[o.length-1],t.toId=o[o.length-1].id,o.pop(),t.toArray=o),t.connect()},writable:!0,configurable:!0},_getClusterStack:{value:function(t){for(var e=[],i=100,o=0;void 0!==this.clusteredNodes[t]&&i>o;)e.push(this.clusteredNodes[t].node),t=this.clusteredNodes[t].clusterId,o++;return e.push(this.body.nodes[t]),e},writable:!0,configurable:!0},_getConnectedId:{value:function(t,e){return t.toId!=e?t.toId:t.fromId!=e?t.fromId:t.fromId},writable:!0,configurable:!0},_getHubSize:{value:function(){for(var t=0,e=0,i=0,o=0,s=0;so&&(o=n.edges.length),t+=n.edges.length,e+=Math.pow(n.edges.length,2),i+=1}t/=i,e/=i;var r=e-Math.pow(t,2),a=Math.sqrt(r),h=Math.floor(t+2*a);return h>o&&(h=o),h},writable:!0,configurable:!0}}),t}();e.ClusterEngine=r,Object.defineProperty(e,"__esModule",{value:!0})},function(t,e){var i=function(t,e,i){e&&Object.defineProperties(t,e),i&&Object.defineProperties(t.prototype,i)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};"undefined"!=typeof window&&(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame);var s=function(){function t(e){var i=this;o(this,t),this.body=e,this.redrawRequested=!1,this.renderTimer=!1,this.requiresTimeout=!0,this.continueRendering=!0,this.renderRequests=0,this.translation={x:0,y:0},this.scale=1,this.canvasTopLeft={x:0,y:0},this.canvasBottomRight={x:0,y:0},this.body.emitter.on("_setScale",function(t){return i.scale=t}),this.body.emitter.on("_setTranslation",function(t){i.translation.x=t.x,i.translation.y=t.y}),this.body.emitter.on("_redraw",this._redraw.bind(this)),this.body.emitter.on("_redrawHidden",this._redraw.bind(this,!0)),this.body.emitter.on("_requestRedraw",this._requestRedraw.bind(this)),this.body.emitter.on("_startRendering",function(){i.renderRequests+=1,i.continueRendering=!0,i.startRendering()}),this.body.emitter.on("_stopRendering",function(){i.renderRequests-=1,i.continueRendering=i.renderRequests>0}),this._determineBrowserMethod()}return i(t,null,{startRendering:{value:function(){this.continueRendering===!0&&(this.renderTimer||(this.renderTimer=1==this.requiresTimeout?window.setTimeout(this.renderStep.bind(this),this.simulationInterval):window.requestAnimationFrame(this.renderStep.bind(this))))},writable:!0,configurable:!0},renderStep:{value:function(){this.renderTimer=void 0,1==this.requiresTimeout&&this.startRendering(),this._redraw(),0==this.requiresTimeout&&this.startRendering()},writable:!0,configurable:!0},setCanvas:{value:function(t){this.canvas=t},writable:!0,configurable:!0},redraw:{value:function(){this.setSize(this.constants.width,this.constants.height),this._redraw()},writable:!0,configurable:!0},_requestRedraw:{value:function(t){this.redrawRequested!==!0&&(this.redrawRequested=!0,this.requiresTimeout===!0?window.setTimeout(this._redraw.bind(this,t),0):window.requestAnimationFrame(this._redraw.bind(this,t,!0)))},writable:!0,configurable:!0},_redraw:{value:function(){var t=void 0===arguments[0]?!1:arguments[0];this.body.emitter.emit("_beforeRender"),this.redrawRequested=!1;var e=this.canvas.frame.canvas.getContext("2d");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);var i=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;e.clearRect(0,0,i,o),e.save(),e.translate(this.translation.x,this.translation.y),e.scale(this.scale,this.scale),this.canvasTopLeft=this.canvas.DOMtoCanvas({x:0,y:0}),this.canvasBottomRight=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth,y:this.canvas.frame.canvas.clientHeight}),t===!1&&this._drawEdges(e),this._drawNodes(e,this.body.nodes,t),t===!1&&1==this.controlNodesActive&&this._drawControlNodes(e),e.restore(),t===!0&&e.clearRect(0,0,i,o)},writable:!0,configurable:!0},_drawNodes:{value:function(t,e){var i=void 0===arguments[2]?!1:arguments[2],o=[];for(var s in e)e.hasOwnProperty(s)&&(e[s].setScaleAndPos(this.scale,this.canvasTopLeft,this.canvasBottomRight),e[s].isSelected()?o.push(s):i===!0?e[s].draw(t):e[s].inArea()===!0&&e[s].draw(t));for(var n=0,r=o.length;r>n;n++)(e[o[n]].inArea()||i)&&e[o[n]].draw(t)},writable:!0,configurable:!0},_drawEdges:{value:function(t){var e=this.body.edges;for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];o.setScale(this.scale),o.connected===!0&&e[i].draw(t)}},writable:!0,configurable:!0},_drawControlNodes:{value:function(t){var e=this.body.edges;for(var i in e)e.hasOwnProperty(i)&&e[i]._drawControlNodes(t)},writable:!0,configurable:!0},_determineBrowserMethod:{value:function(){if("undefined"!=typeof window){var t=navigator.userAgent.toLowerCase();this.requiresTimeout=!1,-1!=t.indexOf("msie 9.0")?this.requiresTimeout=!0:-1!=t.indexOf("safari")&&t.indexOf("chrome")<=-1&&(this.requiresTimeout=!0)}else this.requiresTimeout=!0},writable:!0,configurable:!0}}),t}();e.CanvasRenderer=s,Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,i){var o=function(t,e,i){e&&Object.defineProperties(t,e),i&&Object.defineProperties(t.prototype,i)},s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},n=i(45),r=function(){function t(e,i){var o=this;for(s(this,t),this.body=e,this.setOptions(i),this.translation={x:0,y:0},this.scale=1,this.body.emitter.on("_setScale",function(t){o.scale=t}),this.body.emitter.on("_setTranslation",function(t){o.translation.x=t.x,o.translation.y=t.y}),this.body.emitter.once("resize",function(t){o.translation.x=.5*t.width,o.translation.y=.5*t.height,o.body.emitter.emit("_setTranslation",o.translation)}),this.pixelRatio=1;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis network-frame",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 n=this.frame.canvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1),this.frame.canvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{var r=document.createElement("DIV");r.style.color="red",r.style.fontWeight="bold",r.style.padding="10px",r.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(r)}this.body.container.appendChild(this.frame),this.body.emitter.emit("_setScale",1),this.body.emitter.emit("_setTranslation",{x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),this._bindHammer()}return o(t,null,{_bindHammer:{value:function(){var t=this;void 0!==this.hammer&&this.hammer.dispose(),this.drag={},this.pinch={},this.hammer=n(this.frame.canvas,{prevent_default:!0}),this.hammer.on("tap",t.body.eventListeners.onTap),this.hammer.on("doubletap",t.body.eventListeners.onDoubleTap),this.hammer.on("hold",t.body.eventListeners.onHold),this.hammer.on("touch",t.body.eventListeners.onTouch),this.hammer.on("dragstart",t.body.eventListeners.onDragStart),this.hammer.on("drag",t.body.eventListeners.onDrag),this.hammer.on("dragend",t.body.eventListeners.onDragEnd),1==this.options.zoomable&&(this.hammer.on("mousewheel",t.body.eventListeners.onMouseWheel.bind(t)),this.hammer.on("DOMMouseScroll",t.body.eventListeners.onMouseWheel.bind(t)),this.hammer.on("pinch",t.body.eventListeners.onPinch.bind(t))),this.hammer.on("mousemove",t.body.eventListeners.onMouseMove.bind(t)),this.hammerFrame=n(this.frame,{prevent_default:!0}),this.hammerFrame.on("release",t.body.eventListeners.onRelease.bind(t))},writable:!0,configurable:!0},setOptions:{value:function(){var t=void 0===arguments[0]?{}:arguments[0];this.options=t},writable:!0,configurable:!0},setSize:{value:function(t,e){var i=!1,o=this.frame.canvas.width,s=this.frame.canvas.height;t!=this.options.width||e!=this.options.height||this.frame.style.width!=t||this.frame.style.height!=e?(this.frame.style.width=t,this.frame.style.height=e,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=this.frame.canvas.clientWidth*this.pixelRatio,this.frame.canvas.height=this.frame.canvas.clientHeight*this.pixelRatio,this.options.width=t,this.options.height=e,i=!0):(this.frame.canvas.width!=this.frame.canvas.clientWidth*this.pixelRatio&&(this.frame.canvas.width=this.frame.canvas.clientWidth*this.pixelRatio,i=!0),this.frame.canvas.height!=this.frame.canvas.clientHeight*this.pixelRatio&&(this.frame.canvas.height=this.frame.canvas.clientHeight*this.pixelRatio,i=!0)),i===!0&&this.body.emitter.emit("resize",{width:this.frame.canvas.width*this.pixelRatio,height:this.frame.canvas.height*this.pixelRatio,oldWidth:o*this.pixelRatio,oldHeight:s*this.pixelRatio})},writable:!0,configurable:!0},_XconvertDOMtoCanvas:{value:function(t){return(t-this.translation.x)/this.scale},writable:!0,configurable:!0},_XconvertCanvasToDOM:{value:function(t){return t*this.scale+this.translation.x},writable:!0,configurable:!0},_YconvertDOMtoCanvas:{value:function(t){return(t-this.translation.y)/this.scale},writable:!0,configurable:!0},_YconvertCanvasToDOM:{value:function(t){return t*this.scale+this.translation.y},writable:!0,configurable:!0},canvasToDOM:{value:function(t){return{x:this._XconvertCanvasToDOM(t.x),y:this._YconvertCanvasToDOM(t.y)}},writable:!0,configurable:!0},DOMtoCanvas:{value:function(t){return{x:this._XconvertDOMtoCanvas(t.x),y:this._YconvertDOMtoCanvas(t.y)}},writable:!0,configurable:!0}}),t}();e.Canvas=r,Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,i){var o=function(t,e,i){e&&Object.defineProperties(t,e),i&&Object.defineProperties(t.prototype,i)},s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},n=i(1),r=function(){function t(e,i){var o=this;s(this,t),this.body=e,this.setOptions(i),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=null,this.lockedOnNodeOffset=null,this.touchTime=0,this.translation={x:0,y:0},this.scale=1,this.viewFunction=void 0,this.body.emitter.on("zoomExtent",this.zoomExtent.bind(this)),this.body.emitter.on("_setScale",function(t){return o.scale=t}),this.body.emitter.on("_setTranslation",function(t){o.translation.x=t.x,o.translation.y=t.y}),this.body.emitter.on("animationFinished",function(){o.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",this.releaseNode.bind(this))}return o(t,null,{setOptions:{value:function(){var t=void 0===arguments[0]?{}:arguments[0];this.options=t},writable:!0,configurable:!0},setCanvas:{value:function(t){this.canvas=t},writable:!0,configurable:!0},_getRange:{value:function(){var t,e=void 0===arguments[0]?[]:arguments[0],i=1e9,o=-1e9,s=1e9,n=-1e9;if(e.length>0)for(var r=0;rt.boundingBox.left&&(s=t.boundingBox.left),nt.boundingBox.bottom&&(i=t.boundingBox.top),ot.boundingBox.left&&(s=t.boundingBox.left),nt.boundingBox.bottom&&(i=t.boundingBox.top),o.5*this.body.nodeIndices.length)return void this.zoomExtent(i,!1);t=this._getRange(i.nodes);var a=this.body.nodeIndices.length;e=1==this.options.smoothCurves?12.662/(a+7.4147)+.0964822:30.5062972/(a+19.93597763)+.08413486;var h=Math.min(this.canvas.frame.canvas.clientWidth/600,this.canvas.frame.canvas.clientHeight/600);e*=h}else{this.body.emitter.emit("_redrawHidden"),t=this._getRange(i.nodes);var d=1.1*Math.abs(t.maxX-t.minX),l=1.1*Math.abs(t.maxY-t.minY),c=this.canvas.frame.canvas.clientWidth/d,u=this.canvas.frame.canvas.clientHeight/l;e=u>=c?c:u}e>1&&(e=1);var p=this._findCenter(t),f={position:p,scale:e,animation:i};this.moveTo(f)},writable:!0,configurable:!0},focusOnNode:{value:function(t){var e=void 0===arguments[1]?{}:arguments[1];if(void 0!==this.body.nodes[t]){var i={x:this.body.nodes[t].x,y:this.body.nodes[t].y};e.position=i,e.lockedOnNode=t,this.moveTo(e)}else console.log("Node: "+t+" cannot be found.")},writable:!0,configurable:!0},moveTo:{value:function(t){return void 0===t?void(t={}):(void 0===t.offset&&(t.offset={x:0,y:0}),void 0===t.offset.x&&(t.offset.x=0),void 0===t.offset.y&&(t.offset.y=0),void 0===t.scale&&(t.scale=this.scale),void 0===t.position&&(t.position=this.translation),void 0===t.animation&&(t.animation={duration:0}),t.animation===!1&&(t.animation={duration:0}),t.animation===!0&&(t.animation={}),void 0===t.animation.duration&&(t.animation.duration=1e3),void 0===t.animation.easingFunction&&(t.animation.easingFunction="easeInOutQuad"),void this.animateView(t))},writable:!0,configurable:!0},animateView:{value:function(t){if(void 0!==t){this.animationEasingFunction=t.animation.easingFunction,this.releaseNode(),1==t.locked&&(this.lockedOnNodeId=t.lockedOnNode,this.lockedOnNodeOffset=t.offset),0!=this.easingTime&&this._transitionRedraw(!0),this.sourceScale=this.scale,this.sourceTranslation=this.translation,this.targetScale=t.scale,this.body.emitter.emit("_setScale",this.targetScale);var e=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:e.x-t.position.x,y:e.y-t.position.y};this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+t.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+t.offset.y},0==t.animation.duration?null!=this.lockedOnNodeId?(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("_beforeRender",this.viewFunction)):(this.body.emitter.emit("_setScale",this.targetScale),this.body.emitter.emit("_setTranslation",this.targetTranslation),this.body.emitter.emit("_requestRedraw")):(this.animationSpeed=1/(60*t.animation.duration*.001)||1/60,this.animationEasingFunction=t.animation.easingFunction,this.viewFunction=this._transitionRedraw.bind(this),this.body.emitter.on("_beforeRender",this.viewFunction),this.body.emitter.emit("_startRendering"))}},writable:!0,configurable:!0},_lockedRedraw:{value:function(){var t={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},e=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),i={x:e.x-t.x,y:e.y-t.y},o=this.translation,s={x:o.x+i.x*this.scale+this.lockedOnNodeOffset.x,y:o.y+i.y*this.scale+this.lockedOnNodeOffset.y};this.body.emitter.emit("_setTranslation",s)},writable:!0,configurable:!0},releaseNode:{value:function(){void 0!==this.lockedOnNodeId&&(this.body.emitter.off("_beforeRender",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)},writable:!0,configurable:!0},_transitionRedraw:{value:function(){var t=void 0===arguments[0]?!1:arguments[0];this.easingTime+=this.animationSpeed,this.easingTime=t===!0?1:this.easingTime;var e=n.easingFunctions[this.animationEasingFunction](this.easingTime);this.body.emitter.emit("_setScale",this.sourceScale+(this.targetScale-this.sourceScale)*e),this.body.emitter.emit("_setTranslation",{x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*e,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*e}),this.easingTime>=1&&(this.body.emitter.off("_beforeRender",this.viewFunction),this.easingTime=0,null!=this.lockedOnNodeId&&(this.viewFunction=this._lockedRedraw.bind(this),this.body.emitter.on("_beforeRender",this.viewFunction)),this.body.emitter.emit("animationFinished"))},writable:!0,configurable:!0}}),t}();e.View=r,Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,i){var o=function(t,e,i){e&&Object.defineProperties(t,e),i&&Object.defineProperties(t.prototype,i)},s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},n=i(73).SelectionHandler,r=i(1),a=function(){function t(e){var i=this;s(this,t),this.body=e,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.touchTime=0,this.drag={},this.pinch={},this.pointerPosition={x:0,y:0},this.scale=1,this.body.emitter.on("_setScale",function(t){return i.scale=t}),this.selectionHandler=new n(e)}return o(t,null,{setCanvas:{value:function(t){this.canvas=t,this.selectionHandler.setCanvas(t)},writable:!0,configurable:!0},getPointer:{value:function(t){return{x:t.pageX-r.getAbsoluteLeft(this.canvas.frame.canvas),y:t.pageY-r.getAbsoluteTop(this.canvas.frame.canvas)}},writable:!0,configurable:!0},onTouch:{value:function(t){(new Date).valueOf()-this.touchTime>100&&(this.drag.pointer=this.getPointer(t.gesture.center),this.drag.pinched=!1,this.pinch.scale=this.scale,this.touchTime=(new Date).valueOf())},writable:!0,configurable:!0},onTap:{value:function(t){console.log("tap",t);var e=this.getPointer(t.gesture.center);this.pointerPosition=e,this.selectionHandler.selectOnPoint(e)},writable:!0,configurable:!0},onDragStart:{value:function(){},writable:!0,configurable:!0},onDrag:{value:function(){},writable:!0,configurable:!0},onDragEnd:{value:function(){},writable:!0,configurable:!0},onDoubleTap:{value:function(){},writable:!0,configurable:!0},onHold:{value:function(){},writable:!0,configurable:!0},onRelease:{value:function(){},writable:!0,configurable:!0},onPinch:{value:function(){},writable:!0,configurable:!0},_zoom:{value:function(){},writable:!0,configurable:!0},onMouseWheel:{value:function(){},writable:!0,configurable:!0},onMouseMove:{value:function(){},writable:!0,configurable:!0}}),t}();e.TouchEventHandler=a,Object.defineProperty(e,"__esModule",{value:!0})},function(t){function e(t){return t?i(t):void 0}function i(t){for(var i in e.prototype)t[i]=e.prototype[i];return t}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},e.prototype.once=function(t,e){function i(){o.off(t,i),e.apply(this,arguments)}var o=this;return this._callbacks=this._callbacks||{},i.fn=e,this.on(t,i),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks[t];if(!i)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var o,s=0;so;++o)i[o].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e){var i,o,s;!function(n,r){o=[],i=r,s="function"==typeof i?i.apply(e,o):i,!(void 0!==s&&(t.exports=s))}(this,function(){function t(t){var e,i=t&&t.preventDefault||!1,o=t&&t.container||window,s={},n={keydown:{},keyup:{}},r={};for(e=97;122>=e;e++)r[String.fromCharCode(e)]={code:65+(e-97),shift:!1};for(e=65;90>=e;e++)r[String.fromCharCode(e)]={code:e,shift:!0};for(e=0;9>=e;e++)r[""+e]={code:48+e,shift:!1};for(e=1;12>=e;e++)r["F"+e]={code:111+e,shift:!1};for(e=0;9>=e;e++)r["num"+e]={code:96+e,shift:!1};r["num*"]={code:106,shift:!1},r["num+"]={code:107,shift:!1},r["num-"]={code:109,shift:!1},r["num/"]={code:111,shift:!1},r["num."]={code:110,shift:!1},r.left={code:37,shift:!1},r.up={code:38,shift:!1},r.right={code:39,shift:!1},r.down={code:40,shift:!1},r.space={code:32,shift:!1},r.enter={code:13,shift:!1},r.shift={code:16,shift:void 0},r.esc={code:27,shift:!1},r.backspace={code:8,shift:!1},r.tab={code:9,shift:!1},r.ctrl={code:17,shift:!1},r.alt={code:18,shift:!1},r["delete"]={code:46,shift:!1},r.pageup={code:33,shift:!1},r.pagedown={code:34,shift:!1},r["="]={code:187,shift:!1},r["-"]={code:189,shift:!1},r["]"]={code:221,shift:!1},r["["]={code:219,shift:!1};var a=function(t){d(t,"keydown")},h=function(t){d(t,"keyup")},d=function(t,e){if(void 0!==n[e][t.keyCode]){for(var o=n[e][t.keyCode],s=0;se-n?(i=t.clone().add(s-1,"months"),o=(e-n)/(n-i)):(i=t.clone().add(s+1,"months"),o=(e-n)/(i-n)),-(s+o)}function m(t,e,i){var o;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?(o=t.isPM(i),o&&12>e&&(e+=12),o||12!==e||(e=0),e):e}function g(){}function v(t,e){e!==!1&&R(t),w(this,t),this._d=new Date(+t._d),Oi===!1&&(Oi=!0,Se.updateOffset(this),Oi=!1)}function y(t){var e=N(t),i=e.year||0,o=e.quarter||0,s=e.month||0,n=e.week||0,r=e.day||0,a=e.hour||0,h=e.minute||0,d=e.second||0,l=e.millisecond||0;this._milliseconds=+l+1e3*d+6e4*h+36e5*a,this._days=+r+7*n,this._months=+s+3*o+12*i,this._data={},this._locale=Se.localeData(),this._bubble() }function b(t,e){for(var i in e)a(e,i)&&(t[i]=e[i]);return a(e,"toString")&&(t.toString=e.toString),a(e,"valueOf")&&(t.valueOf=e.valueOf),t}function w(t,e){var i,o,s;if("undefined"!=typeof e._isAMomentObject&&(t._isAMomentObject=e._isAMomentObject),"undefined"!=typeof e._i&&(t._i=e._i),"undefined"!=typeof e._f&&(t._f=e._f),"undefined"!=typeof e._l&&(t._l=e._l),"undefined"!=typeof e._strict&&(t._strict=e._strict),"undefined"!=typeof e._tzm&&(t._tzm=e._tzm),"undefined"!=typeof e._isUTC&&(t._isUTC=e._isUTC),"undefined"!=typeof e._offset&&(t._offset=e._offset),"undefined"!=typeof e._pf&&(t._pf=e._pf),"undefined"!=typeof e._locale&&(t._locale=e._locale),He.length>0)for(i in He)o=He[i],s=e[o],"undefined"!=typeof s&&(t[o]=s);return t}function x(t){return 0>t?Math.ceil(t):Math.floor(t)}function _(t,e,i){for(var o=""+Math.abs(t),s=t>=0;o.lengtho;o++)(i&&t[o]!==e[o]||!i&&I(t[o])!==I(e[o]))&&r++;return r+n}function k(t){if(t){var e=t.toLowerCase().replace(/(.)s$/,"$1");t=gi[t]||vi[e]||e}return t}function N(t){var e,i,o={};for(i in t)a(t,i)&&(e=k(i),e&&(o[e]=t[i]));return o}function L(t){var e,i;if(0===t.indexOf("week"))e=7,i="day";else{if(0!==t.indexOf("month"))return;e=12,i="month"}Se[t]=function(o,s){var r,a,h=Se._locale[t],d=[];if("number"==typeof o&&(s=o,o=n),a=function(t){var e=Se().utc().set(i,t);return h.call(Se._locale,e,o||"")},null!=s)return a(s);for(r=0;e>r;r++)d.push(a(r));return d}}function I(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=e>=0?Math.floor(e):Math.ceil(e)),i}function P(t,e){return new Date(Date.UTC(t,e+1,0)).getUTCDate()}function A(t,e,i){return fe(Se([t,11,31+e-i]),e,i).week}function z(t){return F(t)?366:365}function F(t){return t%4===0&&t%100!==0||t%400===0}function R(t){var e;t._a&&-2===t._pf.overflow&&(e=t._a[Pe]<0||t._a[Pe]>11?Pe:t._a[Ae]<1||t._a[Ae]>P(t._a[Ie],t._a[Pe])?Ae:t._a[ze]<0||t._a[ze]>24||24===t._a[ze]&&(0!==t._a[Fe]||0!==t._a[Re]||0!==t._a[Be])?ze:t._a[Fe]<0||t._a[Fe]>59?Fe:t._a[Re]<0||t._a[Re]>59?Re:t._a[Be]<0||t._a[Be]>999?Be:-1,t._pf._overflowDayOfYear&&(Ie>e||e>Ae)&&(e=Ae),t._pf.overflow=e)}function B(t){return null==t._isValid&&(t._isValid=!isNaN(t._d.getTime())&&t._pf.overflow<0&&!t._pf.empty&&!t._pf.invalidMonth&&!t._pf.nullInput&&!t._pf.invalidFormat&&!t._pf.userInvalidated,t._strict&&(t._isValid=t._isValid&&0===t._pf.charsLeftOver&&0===t._pf.unusedTokens.length&&t._pf.bigHour===n)),t._isValid}function Y(t){return t?t.toLowerCase().replace("_","-"):t}function H(t){for(var e,i,o,s,n=0;n0;){if(o=j(s.slice(0,e).join("-")))return o;if(i&&i.length>=e&&E(s,i,!0)>=e-1)break;e--}n++}return null}function j(t){var e=null;if(!Ye[t]&&je)try{e=Se.locale(),!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),Se.locale(e)}catch(i){}return Ye[t]}function W(t,e){var i,o;return e._isUTC?(i=e.clone(),o=(Se.isMoment(t)||T(t)?+t:+Se(t))-+i,i._d.setTime(+i._d+o),Se.updateOffset(i,!1),i):Se(t).local()}function G(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function U(t){var e,i,o=t.match(Ve);for(e=0,i=o.length;i>e;e++)o[e]=_i[o[e]]?_i[o[e]]:G(o[e]);return function(s){var n="";for(e=0;i>e;e++)n+=o[e]instanceof Function?o[e].call(s,t):o[e];return n}}function V(t,e){return t.isValid()?(e=X(e,t.localeData()),yi[e]||(yi[e]=U(e)),yi[e](t)):t.localeData().invalidDate()}function X(t,e){function i(t){return e.longDateFormat(t)||t}var o=5;for(Xe.lastIndex=0;o>=0&&Xe.test(t);)t=t.replace(Xe,i),Xe.lastIndex=0,o-=1;return t}function q(t,e){var i,o=e._strict;switch(t){case"Q":return si;case"DDDD":return ri;case"YYYY":case"GGGG":case"gggg":return o?ai:Qe;case"Y":case"G":case"g":return di;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return o?hi:Ke;case"S":if(o)return si;case"SS":if(o)return ni;case"SSS":if(o)return ri;case"DDD":return Ze;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Je;case"a":case"A":return e._locale._meridiemParse;case"x":return ii;case"X":return oi;case"Z":case"ZZ":return ti;case"T":return ei;case"SSSS":return $e;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return o?ni:qe;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return qe;case"Do":return o?e._locale._ordinalParse:e._locale._ordinalParseLenient;default:return i=new RegExp(oe(ie(t.replace("\\","")),"i"))}}function Z(t){t=t||"";var e=t.match(ti)||[],i=e[e.length-1]||[],o=(i+"").match(fi)||["-",0,0],s=+(60*o[1])+I(o[2]);return"+"===o[0]?s:-s}function Q(t,e,i){var o,s=i._a;switch(t){case"Q":null!=e&&(s[Pe]=3*(I(e)-1));break;case"M":case"MM":null!=e&&(s[Pe]=I(e)-1);break;case"MMM":case"MMMM":o=i._locale.monthsParse(e,t,i._strict),null!=o?s[Pe]=o:i._pf.invalidMonth=e;break;case"D":case"DD":null!=e&&(s[Ae]=I(e));break;case"Do":null!=e&&(s[Ae]=I(parseInt(e.match(/\d{1,2}/)[0],10)));break;case"DDD":case"DDDD":null!=e&&(i._dayOfYear=I(e));break;case"YY":s[Ie]=Se.parseTwoDigitYear(e);break;case"YYYY":case"YYYYY":case"YYYYYY":s[Ie]=I(e);break;case"a":case"A":i._meridiem=e;break;case"h":case"hh":i._pf.bigHour=!0;case"H":case"HH":s[ze]=I(e);break;case"m":case"mm":s[Fe]=I(e);break;case"s":case"ss":s[Re]=I(e);break;case"S":case"SS":case"SSS":case"SSSS":s[Be]=I(1e3*("0."+e));break;case"x":i._d=new Date(I(e));break;case"X":i._d=new Date(1e3*parseFloat(e));break;case"Z":case"ZZ":i._useUTC=!0,i._tzm=Z(e);break;case"dd":case"ddd":case"dddd":o=i._locale.weekdaysParse(e),null!=o?(i._w=i._w||{},i._w.d=o):i._pf.invalidWeekday=e;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":t=t.substr(0,1);case"gggg":case"GGGG":case"GGGGG":t=t.substr(0,2),e&&(i._w=i._w||{},i._w[t]=I(e));break;case"gg":case"GG":i._w=i._w||{},i._w[t]=Se.parseTwoDigitYear(e)}}function K(t){var e,i,o,s,n,a,h;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(n=1,a=4,i=r(e.GG,t._a[Ie],fe(Se(),1,4).year),o=r(e.W,1),s=r(e.E,1)):(n=t._locale._week.dow,a=t._locale._week.doy,i=r(e.gg,t._a[Ie],fe(Se(),n,a).year),o=r(e.w,1),null!=e.d?(s=e.d,n>s&&++o):s=null!=e.e?e.e+n:n),h=me(i,o,s,a,n),t._a[Ie]=h.year,t._dayOfYear=h.dayOfYear}function $(t){var e,i,o,s,n=[];if(!t._d){for(o=te(t),t._w&&null==t._a[Ae]&&null==t._a[Pe]&&K(t),t._dayOfYear&&(s=r(t._a[Ie],o[Ie]),t._dayOfYear>z(s)&&(t._pf._overflowDayOfYear=!0),i=le(s,0,t._dayOfYear),t._a[Pe]=i.getUTCMonth(),t._a[Ae]=i.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=n[e]=o[e];for(;7>e;e++)t._a[e]=n[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[ze]&&0===t._a[Fe]&&0===t._a[Re]&&0===t._a[Be]&&(t._nextDay=!0,t._a[ze]=0),t._d=(t._useUTC?le:de).apply(null,n),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[ze]=24)}}function J(t){var e;t._d||(e=N(t._i),t._a=[e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],$(t))}function te(t){var e=new Date;return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function ee(t){if(t._f===Se.ISO_8601)return void ne(t);t._a=[],t._pf.empty=!0;var e,i,o,s,r,a=""+t._i,h=a.length,d=0;for(o=X(t._f,t._locale).match(Ve)||[],e=0;e0&&t._pf.unusedInput.push(r),a=a.slice(a.indexOf(i)+i.length),d+=i.length),_i[s]?(i?t._pf.empty=!1:t._pf.unusedTokens.push(s),Q(s,i,t)):t._strict&&!i&&t._pf.unusedTokens.push(s);t._pf.charsLeftOver=h-d,a.length>0&&t._pf.unusedInput.push(a),t._pf.bigHour===!0&&t._a[ze]<=12&&(t._pf.bigHour=n),t._a[ze]=m(t._locale,t._a[ze],t._meridiem),$(t),R(t)}function ie(t){return t.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,o,s){return e||i||o||s})}function oe(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function se(t){var e,i,o,s,n;if(0===t._f.length)return t._pf.invalidFormat=!0,void(t._d=new Date(0/0));for(s=0;sn)&&(o=n,i=e));b(t,i||e)}function ne(t){var e,i,o=t._i,s=li.exec(o);if(s){for(t._pf.iso=!0,e=0,i=ui.length;i>e;e++)if(ui[e][1].exec(o)){t._f=ui[e][0]+(s[6]||" ");break}for(e=0,i=pi.length;i>e;e++)if(pi[e][1].exec(o)){t._f+=pi[e][0];break}o.match(ti)&&(t._f+="Z"),ee(t)}else t._isValid=!1}function re(t){ne(t),t._isValid===!1&&(delete t._isValid,Se.createFromInputFallback(t))}function ae(t,e){var i,o=[];for(i=0;it&&a.setFullYear(t),a}function le(t){var e=new Date(Date.UTC.apply(null,arguments));return 1970>t&&e.setUTCFullYear(t),e}function ce(t,e){if("string"==typeof t)if(isNaN(t)){if(t=e.weekdaysParse(t),"number"!=typeof t)return null}else t=parseInt(t,10);return t}function ue(t,e,i,o,s){return s.relativeTime(e||1,!!i,t,o)}function pe(t,e,i){var o=Se.duration(t).abs(),s=Ne(o.as("s")),n=Ne(o.as("m")),r=Ne(o.as("h")),a=Ne(o.as("d")),h=Ne(o.as("M")),d=Ne(o.as("y")),l=s0,l[4]=i,ue.apply({},l)}function fe(t,e,i){var o,s=i-e,n=i-t.day();return n>s&&(n-=7),s-7>n&&(n+=7),o=Se(t).add(n,"d"),{week:Math.ceil(o.dayOfYear()/7),year:o.year()}}function me(t,e,i,o,s){var n,r,a=le(t,0,1).getUTCDay();return a=0===a?7:a,i=null!=i?i:s,n=s-a+(a>o?7:0)-(s>a?7:0),r=7*(e-1)+(i-s)+n+1,{year:r>0?t:t-1,dayOfYear:r>0?r:z(t-1)+r}}function ge(t){var e,i=t._i,o=t._f;return t._locale=t._locale||Se.localeData(t._l),null===i||o===n&&""===i?Se.invalid({nullInput:!0}):("string"==typeof i&&(t._i=i=t._locale.preparse(i)),Se.isMoment(i)?new v(i,!0):(o?C(o)?se(t):ee(t):he(t),e=new v(t),e._nextDay&&(e.add(1,"d"),e._nextDay=n),e))}function ve(t,e){var i,o;if(1===e.length&&C(e[0])&&(e=e[0]),!e.length)return Se();for(i=e[0],o=1;o=0?"+":"-";return e+_(Math.abs(t),6)},gg:function(){return _(this.weekYear()%100,2)},gggg:function(){return _(this.weekYear(),4)},ggggg:function(){return _(this.weekYear(),5)},GG:function(){return _(this.isoWeekYear()%100,2)},GGGG:function(){return _(this.isoWeekYear(),4)},GGGGG:function(){return _(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return I(this.milliseconds()/100)},SS:function(){return _(I(this.milliseconds()/10),2)},SSS:function(){return _(this.milliseconds(),3)},SSSS:function(){return _(this.milliseconds(),3)},Z:function(){var t=this.utcOffset(),e="+";return 0>t&&(t=-t,e="-"),e+_(I(t/60),2)+":"+_(I(t)%60,2)},ZZ:function(){var t=this.utcOffset(),e="+";return 0>t&&(t=-t,e="-"),e+_(I(t/60),2)+_(I(t)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},x:function(){return this.valueOf()},X:function(){return this.unix()},Q:function(){return this.quarter()}},Mi={},Di=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"],Oi=!1;wi.length;)Te=wi.pop(),_i[Te+"o"]=p(_i[Te],Te);for(;xi.length;)Te=xi.pop(),_i[Te+Te]=u(_i[Te],2);_i.DDDD=u(_i.DDD,3),b(g.prototype,{set:function(t){var e,i;for(i in t)e=t[i],"function"==typeof e?this[i]=e:this["_"+i]=e;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(t){return this._months[t.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(t){return this._monthsShort[t.month()]},monthsParse:function(t,e,i){var o,s,n;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),o=0;12>o;o++){if(s=Se.utc([2e3,o]),i&&!this._longMonthsParse[o]&&(this._longMonthsParse[o]=new RegExp("^"+this.months(s,"").replace(".","")+"$","i"),this._shortMonthsParse[o]=new RegExp("^"+this.monthsShort(s,"").replace(".","")+"$","i")),i||this._monthsParse[o]||(n="^"+this.months(s,"")+"|^"+this.monthsShort(s,""),this._monthsParse[o]=new RegExp(n.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[o].test(t))return o;if(i&&"MMM"===e&&this._shortMonthsParse[o].test(t))return o;if(!i&&this._monthsParse[o].test(t))return o}},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(t){return this._weekdays[t.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(t){return this._weekdaysShort[t.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(t){return this._weekdaysMin[t.day()]},weekdaysParse:function(t){var e,i,o;for(this._weekdaysParse||(this._weekdaysParse=[]),e=0;7>e;e++)if(this._weekdaysParse[e]||(i=Se([2e3,1]).day(e),o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[e]=new RegExp(o.replace(".",""),"i")),this._weekdaysParse[e].test(t))return e},_longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(t){var e=this._longDateFormat[t];return!e&&this._longDateFormat[t.toUpperCase()]&&(e=this._longDateFormat[t.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t]=e),e},isPM:function(t){return"p"===(t+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(t,e,i){var o=this._calendar[t];return"function"==typeof o?o.apply(e,[i]):o},_relativeTime:{future:"in %s",past:"%s ago",s:"a few 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"},relativeTime:function(t,e,i,o){var s=this._relativeTime[i];return"function"==typeof s?s(t,e,i,o):s.replace(/%d/i,t)},pastFuture:function(t,e){var i=this._relativeTime[t>0?"future":"past"];return"function"==typeof i?i(e):i.replace(/%s/i,e)},ordinal:function(t){return this._ordinal.replace("%d",t)},_ordinal:"%d",_ordinalParse:/\d{1,2}/,preparse:function(t){return t},postformat:function(t){return t},week:function(t){return fe(t,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},firstDayOfWeek:function(){return this._week.dow},firstDayOfYear:function(){return this._week.doy},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),Se=function(t,e,i,o){var s;return"boolean"==typeof i&&(o=i,i=n),s={},s._isAMomentObject=!0,s._i=t,s._f=e,s._l=i,s._strict=o,s._isUTC=!1,s._pf=h(),ge(s)},Se.suppressDeprecationWarnings=!1,Se.createFromInputFallback=l("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),Se.min=function(){var t=[].slice.call(arguments,0);return ve("isBefore",t)},Se.max=function(){var t=[].slice.call(arguments,0);return ve("isAfter",t)},Se.utc=function(t,e,i,o){var s;return"boolean"==typeof i&&(o=i,i=n),s={},s._isAMomentObject=!0,s._useUTC=!0,s._isUTC=!0,s._l=i,s._i=t,s._f=e,s._strict=o,s._pf=h(),ge(s).utc()},Se.unix=function(t){return Se(1e3*t)},Se.duration=function(t,e){var i,o,s,n,r=t,h=null;return Se.isDuration(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(r={},e?r[e]=t:r.milliseconds=t):(h=Ge.exec(t))?(i="-"===h[1]?-1:1,r={y:0,d:I(h[Ae])*i,h:I(h[ze])*i,m:I(h[Fe])*i,s:I(h[Re])*i,ms:I(h[Be])*i}):(h=Ue.exec(t))?(i="-"===h[1]?-1:1,s=function(t){var e=t&&parseFloat(t.replace(",","."));return(isNaN(e)?0:e)*i},r={y:s(h[2]),M:s(h[3]),d:s(h[4]),h:s(h[5]),m:s(h[6]),s:s(h[7]),w:s(h[8])}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(n=D(Se(r.from),Se(r.to)),r={},r.ms=n.milliseconds,r.M=n.months),o=new y(r),Se.isDuration(t)&&a(t,"_locale")&&(o._locale=t._locale),o},Se.version=Ee,Se.defaultFormat=ci,Se.ISO_8601=function(){},Se.momentProperties=He,Se.updateOffset=function(){},Se.relativeTimeThreshold=function(t,e){return bi[t]===n?!1:e===n?bi[t]:(bi[t]=e,!0)},Se.lang=l("moment.lang is deprecated. Use moment.locale instead.",function(t,e){return Se.locale(t,e)}),Se.locale=function(t,e){var i;return t&&(i="undefined"!=typeof e?Se.defineLocale(t,e):Se.localeData(t),i&&(Se.duration._locale=Se._locale=i)),Se._locale._abbr},Se.defineLocale=function(t,e){return null!==e?(e.abbr=t,Ye[t]||(Ye[t]=new g),Ye[t].set(e),Se.locale(t),Ye[t]):(delete Ye[t],null)},Se.langData=l("moment.langData is deprecated. Use moment.localeData instead.",function(t){return Se.localeData(t)}),Se.localeData=function(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Se._locale;if(!C(t)){if(e=j(t))return e;t=[t]}return H(t)},Se.isMoment=function(t){return t instanceof v||null!=t&&a(t,"_isAMomentObject")},Se.isDuration=function(t){return t instanceof y};for(Te=Di.length-1;Te>=0;--Te)L(Di[Te]);Se.normalizeUnits=function(t){return k(t)},Se.invalid=function(t){var e=Se.utc(0/0);return null!=t?b(e._pf,t):e._pf.userInvalidated=!0,e},Se.parseZone=function(){return Se.apply(null,arguments).parseZone()},Se.parseTwoDigitYear=function(t){return I(t)+(I(t)>68?1900:2e3)},Se.isDate=T,b(Se.fn=v.prototype,{clone:function(){return Se(this)},valueOf:function(){return+this._d-6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var t=Se(this).utc();return 00:!1},parsingFlags:function(){return b({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(t){return this.utcOffset(0,t)},local:function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(this._dateUtcOffset(),"m")),this},format:function(t){var e=V(this,t||Se.defaultFormat);return this.localeData().postformat(e)},add:O(1,"add"),subtract:O(-1,"subtract"),diff:function(t,e,i){var o,s,n=W(t,this),r=6e4*(n.utcOffset()-this.utcOffset());return e=k(e),"year"===e||"month"===e||"quarter"===e?(s=f(this,n),"quarter"===e?s/=3:"year"===e&&(s/=12)):(o=this-n,s="second"===e?o/1e3:"minute"===e?o/6e4:"hour"===e?o/36e5:"day"===e?(o-r)/864e5:"week"===e?(o-r)/6048e5:o),i?s:x(s)},from:function(t,e){return Se.duration({to:this,from:t}).locale(this.locale()).humanize(!e)},fromNow:function(t){return this.from(Se(),t)},calendar:function(t){var e=t||Se(),i=W(e,this).startOf("day"),o=this.diff(i,"days",!0),s=-6>o?"sameElse":-1>o?"lastWeek":0>o?"lastDay":1>o?"sameDay":2>o?"nextDay":7>o?"nextWeek":"sameElse";return this.format(this.localeData().calendar(s,this,Se(e)))},isLeapYear:function(){return F(this.year())},isDST:function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},day:function(t){var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=ce(t,this.localeData()),this.add(t-e,"d")):e},month:xe("Month",!0),startOf:function(t){switch(t=k(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t?this.weekday(0):"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this},endOf:function(t){return t=k(t),t===n||"millisecond"===t?this:this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms")},isAfter:function(t,e){var i;return e=k("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=Se.isMoment(t)?t:Se(t),+this>+t):(i=Se.isMoment(t)?+t:+Se(t),i<+this.clone().startOf(e))},isBefore:function(t,e){var i;return e=k("undefined"!=typeof e?e:"millisecond"),"millisecond"===e?(t=Se.isMoment(t)?t:Se(t),+t>+this):(i=Se.isMoment(t)?+t:+Se(t),+this.clone().endOf(e)t?this:t}),max:l("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(t){return t=Se.apply(null,arguments),t>this?this:t}),zone:l("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}),utcOffset:function(t,e){var i,o=this._offset||0;return null!=t?("string"==typeof t&&(t=Z(t)),Math.abs(t)<16&&(t=60*t),!this._isUTC&&e&&(i=this._dateUtcOffset()),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),o!==t&&(!e||this._changeInProgress?S(this,Se.duration(t-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,Se.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?o:this._dateUtcOffset()},isLocal:function(){return!this._isUTC},isUtcOffset:function(){return this._isUTC},isUtc:function(){return this._isUTC&&0===this._offset},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Z(this._i)),this},hasAlignedHourOffset:function(t){return t=t?Se(t).utcOffset():0,(this.utcOffset()-t)%60===0},daysInMonth:function(){return P(this.year(),this.month())},dayOfYear:function(t){var e=Ne((Se(this).startOf("day")-Se(this).startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},quarter:function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},weekYear:function(t){var e=fe(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==t?e:this.add(t-e,"y")},isoWeekYear:function(t){var e=fe(this,1,4).year;return null==t?e:this.add(t-e,"y")},week:function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},isoWeek:function(t){var e=fe(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},weekday:function(t){var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},isoWeekday:function(t){return null==t?this.day()||7:this.day(this.day()%7?t:t-7)},isoWeeksInYear:function(){return A(this.year(),1,4)},weeksInYear:function(){var t=this.localeData()._week;return A(this.year(),t.dow,t.doy)},get:function(t){return t=k(t),this[t]()},set:function(t,e){var i;if("object"==typeof t)for(i in t)this.set(i,t[i]);else t=k(t),"function"==typeof this[t]&&this[t](e);return this},locale:function(t){var e;return t===n?this._locale._abbr:(e=Se.localeData(t),null!=e&&(this._locale=e),this)},lang:l("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===n?this.localeData():this.locale(t)}),localeData:function(){return this._locale},_dateUtcOffset:function(){return 15*-Math.round(this._d.getTimezoneOffset()/15)}}),Se.fn.millisecond=Se.fn.milliseconds=xe("Milliseconds",!1),Se.fn.second=Se.fn.seconds=xe("Seconds",!1),Se.fn.minute=Se.fn.minutes=xe("Minutes",!1),Se.fn.hour=Se.fn.hours=xe("Hours",!0),Se.fn.date=xe("Date",!0),Se.fn.dates=l("dates accessor is deprecated. Use date instead.",xe("Date",!0)),Se.fn.year=xe("FullYear",!0),Se.fn.years=l("years accessor is deprecated. Use year instead.",xe("FullYear",!0)),Se.fn.days=Se.fn.day,Se.fn.months=Se.fn.month,Se.fn.weeks=Se.fn.week,Se.fn.isoWeeks=Se.fn.isoWeek,Se.fn.quarters=Se.fn.quarter,Se.fn.toJSON=Se.fn.toISOString,Se.fn.isUTC=Se.fn.isUtc,b(Se.duration.fn=y.prototype,{_bubble:function(){var t,e,i,o=this._milliseconds,s=this._days,n=this._months,r=this._data,a=0;r.milliseconds=o%1e3,t=x(o/1e3),r.seconds=t%60,e=x(t/60),r.minutes=e%60,i=x(e/60),r.hours=i%24,s+=x(i/24),a=x(_e(s)),s-=x(Me(a)),n+=x(s/30),s%=30,a+=x(n/12),n%=12,r.days=s,r.months=n,r.years=a},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return x(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*I(this._months/12)},humanize:function(t){var e=pe(this,!t,this.localeData());return t&&(e=this.localeData().pastFuture(+this,e)),this.localeData().postformat(e)},add:function(t,e){var i=Se.duration(t,e);return this._milliseconds+=i._milliseconds,this._days+=i._days,this._months+=i._months,this._bubble(),this},subtract:function(t,e){var i=Se.duration(t,e);return this._milliseconds-=i._milliseconds,this._days-=i._days,this._months-=i._months,this._bubble(),this},get:function(t){return t=k(t),this[t.toLowerCase()+"s"]()},as:function(t){var e,i;if(t=k(t),"month"===t||"year"===t)return e=this._days+this._milliseconds/864e5,i=this._months+12*_e(e),"month"===t?i:i/12;switch(e=this._days+Math.round(Me(this._months/12)),t){case"week":return e/7+this._milliseconds/6048e5;case"day":return e+this._milliseconds/864e5;case"hour":return 24*e+this._milliseconds/36e5;case"minute":return 24*e*60+this._milliseconds/6e4;case"second":return 24*e*60*60+this._milliseconds/1e3;case"millisecond":return Math.floor(24*e*60*60*1e3)+this._milliseconds;default:throw new Error("Unknown unit "+t)}},lang:Se.fn.lang,locale:Se.fn.locale,toIsoString:l("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var t=Math.abs(this.years()),e=Math.abs(this.months()),i=Math.abs(this.days()),o=Math.abs(this.hours()),s=Math.abs(this.minutes()),n=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(t?t+"Y":"")+(e?e+"M":"")+(i?i+"D":"")+(o||s||n?"T":"")+(o?o+"H":"")+(s?s+"M":"")+(n?n+"S":""):"P0D" },localeData:function(){return this._locale},toJSON:function(){return this.toISOString()}}),Se.duration.fn.toString=Se.duration.fn.toISOString;for(Te in mi)a(mi,Te)&&De(Te.toLowerCase());Se.duration.fn.asMilliseconds=function(){return this.as("ms")},Se.duration.fn.asSeconds=function(){return this.as("s")},Se.duration.fn.asMinutes=function(){return this.as("m")},Se.duration.fn.asHours=function(){return this.as("h")},Se.duration.fn.asDays=function(){return this.as("d")},Se.duration.fn.asWeeks=function(){return this.as("weeks")},Se.duration.fn.asMonths=function(){return this.as("M")},Se.duration.fn.asYears=function(){return this.as("y")},Se.locale("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,i=1===I(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),je?s.exports=Se:(o=function(t,e,i){return i.config&&i.config()&&i.config().noGlobal===!0&&(ke.moment=Ce),Se}.call(e,i,e,s),!(o!==n&&(s.exports=o)),Oe(!0))}).call(this)}).call(e,function(){return this}(),i(79)(t))},function(t,e){var i,o,s;!function(n){o=[],i=n,s="function"==typeof i?i.apply(e,o):i,!(void 0!==s&&(t.exports=s))}(function(){var t=null;return function e(i){function o(t){return t.match(/[^ ]+/g)}function s(e){if("hammer.input"!==e.type){if(e.srcEvent._handled&&e.srcEvent._handled[e.type])return;e.srcEvent._handled={},e.srcEvent._handled[e.type]=!0}var i=!1;e.stopPropagation=function(){i=!0},e.firstTarget=t;for(var o=t;o&&!i;){var s=o.hammer&&o.hammer._handlers[e.type];if(s)for(var n=0;n0?i._handlers[t]=o:(i._off(t,s),delete i._handlers[t]))}),i},i.emit=function(e,o){t=o.target,i._emit(e,o)},i.destroy=function(){var t=i.element;delete t.hammer,i._handlers={},i._destroy()},i}})},function(t,e,i){var o;!function(s,n,r,a){function h(t,e,i){return setTimeout(f(t,i),e)}function d(t,e,i){return Array.isArray(t)?(l(t,i[e],i),!0):!1}function l(t,e,i){var o;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==a)for(o=0;o-1}function x(t){return t.trim().split(/\s+/g)}function _(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var o=0;oi[e]}):o.sort()),o}function O(t,e){for(var i,o,s=e[0].toUpperCase()+e.slice(1),n=0;n1&&!i.firstMultiple?i.firstMultiple=P(e):1===s&&(i.firstMultiple=!1);var n=i.firstInput,r=i.firstMultiple,a=r?r.center:n.center,h=e.center=A(o);e.timeStamp=ve(),e.deltaTime=e.timeStamp-n.timeStamp,e.angle=B(a,h),e.distance=R(a,h),L(i,e),e.offsetDirection=F(e.deltaX,e.deltaY),e.scale=r?H(r.pointers,o):1,e.rotation=r?Y(r.pointers,o):0,I(i,e);var d=t.element;b(e.srcEvent.target,d)&&(d=e.srcEvent.target),e.target=d}function L(t,e){var i=e.center,o=t.offsetDelta||{},s=t.prevDelta||{},n=t.prevInput||{};(e.eventType===Te||n.eventType===ke)&&(s=t.prevDelta={x:n.deltaX||0,y:n.deltaY||0},o=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=s.x+(i.x-o.x),e.deltaY=s.y+(i.y-o.y)}function I(t,e){var i,o,s,n,r=t.lastInterval||e,h=e.timeStamp-r.timeStamp;if(e.eventType!=Ne&&(h>Ce||r.velocity===a)){var d=r.deltaX-e.deltaX,l=r.deltaY-e.deltaY,c=z(h,d,l);o=c.x,s=c.y,i=ge(c.x)>ge(c.y)?c.x:c.y,n=F(d,l),t.lastInterval=e}else i=r.velocity,o=r.velocityX,s=r.velocityY,n=r.direction;e.velocity=i,e.velocityX=o,e.velocityY=s,e.direction=n}function P(t){for(var e=[],i=0;is;)i+=t[s].clientX,o+=t[s].clientY,s++;return{x:me(i/e),y:me(o/e)}}function z(t,e,i){return{x:e/t||0,y:i/t||0}}function F(t,e){return t===e?Le:ge(t)>=ge(e)?t>0?Ie:Pe:e>0?Ae:ze}function R(t,e,i){i||(i=Ye);var o=e[i[0]]-t[i[0]],s=e[i[1]]-t[i[1]];return Math.sqrt(o*o+s*s)}function B(t,e,i){i||(i=Ye);var o=e[i[0]]-t[i[0]],s=e[i[1]]-t[i[1]];return 180*Math.atan2(s,o)/Math.PI}function Y(t,e){return B(e[1],e[0],He)-B(t[1],t[0],He)}function H(t,e){return R(e[0],e[1],He)/R(t[0],t[1],He)}function j(){this.evEl=We,this.evWin=Ge,this.allow=!0,this.pressed=!1,T.apply(this,arguments)}function W(){this.evEl=Xe,this.evWin=qe,T.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function G(){this.evTarget=Qe,this.evWin=Ke,this.started=!1,T.apply(this,arguments)}function U(t,e){var i=M(t.touches),o=M(t.changedTouches);return e&(ke|Ne)&&(i=D(i.concat(o),"identifier",!0)),[i,o]}function V(){this.evTarget=Je,this.targetIds={},T.apply(this,arguments)}function X(t,e){var i=M(t.touches),o=this.targetIds;if(e&(Te|Ee)&&1===i.length)return o[i[0].identifier]=!0,[i,i];var s,n,r=M(t.changedTouches),a=[],h=this.target;if(n=i.filter(function(t){return b(t.target,h)}),e===Te)for(s=0;sa&&(e.push(t),a=e.length-1):s&(ke|Ne)&&(i=!0),0>a||(e[a]=t,this.callback(this.manager,s,{pointers:e,changedPointers:[t],pointerType:n,srcEvent:t}),i&&e.splice(a,1))}});var Ze={touchstart:Te,touchmove:Ee,touchend:ke,touchcancel:Ne},Qe="touchstart",Ke="touchstart touchmove touchend touchcancel";p(G,T,{handler:function(t){var e=Ze[t.type];if(e===Te&&(this.started=!0),this.started){var i=U.call(this,t,e);e&(ke|Ne)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:Me,srcEvent:t})}}});var $e={touchstart:Te,touchmove:Ee,touchend:ke,touchcancel:Ne},Je="touchstart touchmove touchend touchcancel";p(V,T,{handler:function(t){var e=$e[t.type],i=X.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:Me,srcEvent:t})}}),p(q,T,{handler:function(t,e,i){var o=i.pointerType==Me,s=i.pointerType==Oe;if(o)this.mouse.allow=!1;else if(s&&!this.mouse.allow)return;e&(ke|Ne)&&(this.mouse.allow=!0),this.callback(t,e,i)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ti=O(pe.style,"touchAction"),ei=ti!==a,ii="compute",oi="auto",si="manipulation",ni="none",ri="pan-x",ai="pan-y";Z.prototype={set:function(t){t==ii&&(t=this.compute()),ei&&(this.manager.element.style[ti]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return l(this.manager.recognizers,function(e){m(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),Q(t.join(" "))},preventDefaults:function(t){if(!ei){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var o=this.actions,s=w(o,ni),n=w(o,ai),r=w(o,ri);return s||n&&i&Fe||r&&i&Re?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var hi=1,di=2,li=4,ci=8,ui=ci,pi=16,fi=32;K.prototype={defaults:{},set:function(t){return c(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(d(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=te(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return d(t,"dropRecognizeWith",this)?this:(t=te(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(d(t,"requireFailure",this))return this;var e=this.requireFail;return t=te(t,this),-1===_(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(d(t,"dropRequireFailure",this))return this;t=te(t,this);var e=_(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(i.options.event+(e?$(o):""),t)}var i=this,o=this.state;ci>o&&e(!0),e(),o>=ci&&e(!0)},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=fi)},canEmit:function(){for(var t=0;tn?Ie:Pe,i=n!=this.pX,o=Math.abs(t.deltaX)):(s=0===r?Le:0>r?Ae:ze,i=r!=this.pY,o=Math.abs(t.deltaY))),t.direction=s,i&&o>e.threshold&&s&e.direction},attrTest:function(t){return ee.prototype.attrTest.call(this,t)&&(this.state&di||!(this.state&di)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=J(t.direction);e&&this.manager.emit(this.options.event+e,t),this._super.emit.call(this,t)}}),p(oe,ee,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ni]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&di)},emit:function(t){if(this._super.emit.call(this,t),1!==t.scale){var e=t.scale<1?"in":"out";this.manager.emit(this.options.event+e,t)}}}),p(se,K,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[oi]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distancee.time;if(this._input=t,!o||!i||t.eventType&(ke|Ne)&&!s)this.reset();else if(t.eventType&Te)this.reset(),this._timer=h(function(){this.state=ui,this.tryEmit()},e.time,this);else if(t.eventType&ke)return ui;return fi},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===ui&&(t&&t.eventType&ke?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=ve(),this.manager.emit(this.options.event,this._input)))}}),p(ne,ee,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ni]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&di)}}),p(re,ee,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:Fe|Re,pointers:1},getTouchAction:function(){return ie.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Fe|Re)?e=t.velocity:i&Fe?e=t.velocityX:i&Re&&(e=t.velocityY),this._super.attrTest.call(this,t)&&i&t.direction&&t.distance>this.options.threshold&&ge(e)>this.options.velocity&&t.eventType&ke},emit:function(t){var e=J(t.direction);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),p(ae,K,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[si]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distancen;n++)t=e[i[n]],t.options.mass>0&&(this._getForceContribution(s.root.children.NW,t),this._getForceContribution(s.root.children.NE,t),this._getForceContribution(s.root.children.SW,t),this._getForceContribution(s.root.children.SE,t))}},writable:!0,configurable:!0},_getForceContribution:{value:function(t,e){if(t.childrenCount>0){var i,o,s;if(i=t.centerOfMass.x-e.x,o=t.centerOfMass.y-e.y,s=Math.sqrt(i*i+o*o),s*t.calcSize>this.options.thetaInverted){0==s&&(s=.1*Math.random(),i=s);var n=this.options.gravitationalConstant*t.mass*e.options.mass/(s*s*s),r=i*n,a=o*n;this.physicsBody.forces[e.id].x+=r,this.physicsBody.forces[e.id].y+=a}else if(4==t.childrenCount)this._getForceContribution(t.children.NW,e),this._getForceContribution(t.children.NE,e),this._getForceContribution(t.children.SW,e),this._getForceContribution(t.children.SE,e);else if(t.children.data.id!=e.id){0==s&&(s=.5*Math.random(),i=s);var n=this.options.gravitationalConstant*t.mass*e.options.mass/(s*s*s),r=i*n,a=o*n;this.physicsBody.forces[e.id].x+=r,this.physicsBody.forces[e.id].y+=a}}},writable:!0,configurable:!0},_formBarnesHutTree:{value:function(t,e){for(var i,o=e.length,s=Number.MAX_VALUE,n=Number.MAX_VALUE,r=-Number.MAX_VALUE,a=-Number.MAX_VALUE,h=0;o>h;h++){var d=t[e[h]].x,l=t[e[h]].y;t[e[h]].options.mass>0&&(s>d&&(s=d),d>r&&(r=d),n>l&&(n=l),l>a&&(a=l))}var c=Math.abs(r-s)-Math.abs(a-n);c>0?(n-=.5*c,a+=.5*c):(s+=.5*c,r-=.5*c);var u=1e-5,p=Math.max(u,Math.abs(r-s)),f=.5*p,m=.5*(s+r),g=.5*(n+a),v={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:m-f,maxX:m+f,minY:g-f,maxY:g+f},size:p,calcSize:1/p,children:{data:null},maxWidth:0,level:0,childrenCount:4}};for(this._splitBranch(v.root),h=0;o>h;h++)i=t[e[h]],i.options.mass>0&&this._placeInTree(v.root,i);return v},writable:!0,configurable:!0},_updateBranchMass:{value:function(t,e){var i=t.mass+e.options.mass,o=1/i;t.centerOfMass.x=t.centerOfMass.x*t.mass+e.x*e.options.mass,t.centerOfMass.x*=o,t.centerOfMass.y=t.centerOfMass.y*t.mass+e.y*e.options.mass,t.centerOfMass.y*=o,t.mass=i;var s=Math.max(Math.max(e.height,e.radius),e.width);t.maxWidth=t.maxWidthe.x?t.children.NW.range.maxY>e.y?this._placeInRegion(t,e,"NW"):this._placeInRegion(t,e,"SW"):t.children.NW.range.maxY>e.y?this._placeInRegion(t,e,"NE"):this._placeInRegion(t,e,"SE")},writable:!0,configurable:!0},_placeInRegion:{value:function(t,e,i){switch(t.children[i].childrenCount){case 0:t.children[i].children.data=e,t.children[i].childrenCount=1,this._updateBranchMass(t.children[i],e);break;case 1:t.children[i].children.data.x==e.x&&t.children[i].children.data.y==e.y?(e.x+=Math.random(),e.y+=Math.random()):(this._splitBranch(t.children[i]),this._placeInTree(t.children[i],e));break;case 4:this._placeInTree(t.children[i],e)}},writable:!0,configurable:!0},_splitBranch:{value:function(t){var e=null;1==t.childrenCount&&(e=t.children.data,t.mass=0,t.centerOfMass.x=0,t.centerOfMass.y=0),t.childrenCount=4,t.children.data=null,this._insertRegion(t,"NW"),this._insertRegion(t,"NE"),this._insertRegion(t,"SW"),this._insertRegion(t,"SE"),null!=e&&this._placeInTree(t,e)},writable:!0,configurable:!0},_insertRegion:{value:function(t,e){var i,o,s,n,r=.5*t.size;switch(e){case"NW":i=t.range.minX,o=t.range.minX+r,s=t.range.minY,n=t.range.minY+r;break;case"NE":i=t.range.minX+r,o=t.range.maxX,s=t.range.minY,n=t.range.minY+r;break;case"SW":i=t.range.minX,o=t.range.minX+r,s=t.range.minY+r,n=t.range.maxY;break;case"SE":i=t.range.minX+r,o=t.range.maxX,s=t.range.minY+r,n=t.range.maxY}t.children[e]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:o,minY:s,maxY:n},size:.5*t.size,calcSize:2*t.calcSize,children:{data:null},maxWidth:0,level:t.level+1,childrenCount:0}},writable:!0,configurable:!0},_debug:{value:function(t,e){void 0!==this.barnesHutTree&&(t.lineWidth=1,this._drawBranch(this.barnesHutTree.root,t,e))},writable:!0,configurable:!0},_drawBranch:{value:function(t,e,i){void 0===i&&(i="#FF0000"),4==t.childrenCount&&(this._drawBranch(t.children.NW,e),this._drawBranch(t.children.NE,e),this._drawBranch(t.children.SE,e),this._drawBranch(t.children.SW,e)),e.strokeStyle=i,e.beginPath(),e.moveTo(t.range.minX,t.range.minY),e.lineTo(t.range.maxX,t.range.minY),e.stroke(),e.beginPath(),e.moveTo(t.range.maxX,t.range.minY),e.lineTo(t.range.maxX,t.range.maxY),e.stroke(),e.beginPath(),e.moveTo(t.range.maxX,t.range.maxY),e.lineTo(t.range.minX,t.range.maxY),e.stroke(),e.beginPath(),e.moveTo(t.range.minX,t.range.maxY),e.lineTo(t.range.minX,t.range.minY),e.stroke()},writable:!0,configurable:!0}}),t}();e.BarnesHutSolver=s,Object.defineProperty(e,"__esModule",{value:!0})},function(t,e){var i=function(t,e,i){e&&Object.defineProperties(t,e),i&&Object.defineProperties(t.prototype,i)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=function(){function t(e,i,s){o(this,t),this.body=e,this.physicsBody=i,this.setOptions(s)}return i(t,null,{setOptions:{value:function(t){this.options=t},writable:!0,configurable:!0},solve:{value:function(){for(var t,e,i,o,s,n,r,a,h=this.physicsBody.calculationNodes,d=this.physicsBody.calculationNodeIndices,l=this.physicsBody.forces,c=this.options.nodeDistance,u=-2/3/c,p=4/3,f=0;fi&&(n=.5*c>i?1:u*i+p,n/=i,o=t*n,s=e*n,l[r.id].x-=o,l[r.id].y-=s,l[a.id].x+=o,l[a.id].y+=s)}},writable:!0,configurable:!0}}),t}();e.RepulsionSolver=s,Object.defineProperty(e,"__esModule",{value:!0})},function(t,e){var i=function(t,e,i){e&&Object.defineProperties(t,e),i&&Object.defineProperties(t.prototype,i)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=function(){function t(e,i,s){o(this,t),this.body=e,this.physicsBody=i,this.setOptions(s)}return i(t,null,{setOptions:{value:function(t){this.options=t},writable:!0,configurable:!0},solve:{value:function(){var t,e,i,o,s,n,r,a,h,d,l=this.physicsBody.calculationNodes,c=this.physicsBody.calculationNodeIndices,u=this.physicsBody.forces,p=this.options.nodeDistance;for(h=0;hi?-Math.pow(f*i,2)+Math.pow(f*p,2):0,0==i?i=.01:n/=i,o=t*n,s=e*n,u[r.id].x-=o,u[r.id].y-=s,u[a.id].x+=o,u[a.id].y+=s}},writable:!0,configurable:!0}}),t}();e.HierarchicalRepulsionSolver=s,Object.defineProperty(e,"__esModule",{value:!0})},function(t,e){var i=function(t,e,i){e&&Object.defineProperties(t,e),i&&Object.defineProperties(t.prototype,i)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=function(){function t(e,i,s){o(this,t),this.body=e,this.physicsBody=i,this.setOptions(s)}return i(t,null,{setOptions:{value:function(t){this.options=t},writable:!0,configurable:!0},solve:{value:function(){var t,e,i,o=this.body.edges;for(i in o)if(o.hasOwnProperty(i)&&(e=o[i],e.connected===!0&&void 0!==this.body.nodes[e.toId]&&void 0!==this.body.nodes[e.fromId]))if(t=void 0===e.properties.length?this.options.springLength:e.properties.length,null!=e.via){var s=e.to,n=e.via,r=e.from;this._calculateSpringForce(s,n,.5*t),this._calculateSpringForce(n,r,.5*t)}else this._calculateSpringForce(e.from,e.to,t)},writable:!0,configurable:!0},_calculateSpringForce:{value:function(t,e,i){var o,s,n,r,a,h;o=t.x-e.x,s=t.y-e.y,h=Math.sqrt(o*o+s*s),h=0==h?.01:h,a=this.options.springConstant*(i-h)/h,n=o*a,r=s*a,this.physicsBody.forces[t.id].x+=n,this.physicsBody.forces[t.id].y+=r,this.physicsBody.forces[e.id].x-=n,this.physicsBody.forces[e.id].y-=r},writable:!0,configurable:!0}}),t}();e.SpringSolver=s,Object.defineProperty(e,"__esModule",{value:!0})},function(t,e){var i=function(t,e,i){e&&Object.defineProperties(t,e),i&&Object.defineProperties(t.prototype,i)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=function(){function t(e,i,s){o(this,t),this.body=e,this.physicsBody=i,this.setOptions(s)}return i(t,null,{setOptions:{value:function(t){this.options=t},writable:!0,configurable:!0},solve:{value:function(){for(var t,e,i,o,s,n,r,a,h,d=this.body.edges,l=this.physicsBody.calculationNodeIndices,c=this.physicsBody.forces,u=0;u0&&this._unselectAll(),this.selectObject(t),this._generateClickEvent(t),this.body.emitter.emit("_requestRedraw"))},writable:!0,configurable:!0},_generateClickEvent:{value:function(t){var e=this.getSelection(); e.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},this.body.emitter.emit("click",e)},writable:!0,configurable:!0},selectObject:{value:function(t){var e=this._getNodeAt(t);return null!=e?this.options.selectConnectedEdges===!0&&this._selectConnectedEdges(e):e=this._getEdgeAt(t),null!==e&&(e.select(),this._addToSelection(e),this.body.emitter.emit("selected",this.getSelection())),e},writable:!0,configurable:!0},_getNodesOverlappingWith:{value:function(t,e){var i=this.body.nodes;for(var o in i)i.hasOwnProperty(o)&&i[o].isOverlappingWith(t)&&e.push(o)},writable:!0,configurable:!0},_getAllNodesOverlappingWith:{value:function(t){var e=[];return this._getNodesOverlappingWith(t,e),e},writable:!0,configurable:!0},_pointerToPositionObject:{value:function(t){var e=this.canvas.DOMtoCanvas(t);return{left:e.x,top:e.y,right:e.x,bottom:e.y}},writable:!0,configurable:!0},_getNodeAt:{value:function(t){var e=this._pointerToPositionObject(t),i=this._getAllNodesOverlappingWith(e);return i.length>0?this.body.nodes[i[i.length-1]]:null},writable:!0,configurable:!0},_getEdgesOverlappingWith:{value:function(t,e){var i=this.body.edges;for(var o in i)i.hasOwnProperty(o)&&i[o].isOverlappingWith(t)&&e.push(o)},writable:!0,configurable:!0},_getAllEdgesOverlappingWith:{value:function(t){var e=[];return this._getEdgesOverlappingWith(t,e),e},writable:!0,configurable:!0},_getEdgeAt:{value:function(t){var e=this._pointerToPositionObject(t),i=this._getAllEdgesOverlappingWith(e);return i.length>0?this.body.edges[i[i.length-1]]:null},writable:!0,configurable:!0},_addToSelection:{value:function(t){t instanceof n?this.selectionObj.nodes[t.id]=t:this.selectionObj.edges[t.id]=t},writable:!0,configurable:!0},_addToHover:{value:function(t){t instanceof n?this.hoverObj.nodes[t.id]=t:this.hoverObj.edges[t.id]=t},writable:!0,configurable:!0},_removeFromSelection:{value:function(t){t instanceof n?delete this.selectionObj.nodes[t.id]:delete this.selectionObj.edges[t.id]},writable:!0,configurable:!0},_unselectAll:{value:function(){var t=void 0===arguments[0]?!1:arguments[0];for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&this.selectionObj.nodes[e].unselect();for(var i in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(i)&&this.selectionObj.edges[i].unselect();this.selectionObj={nodes:{},edges:{}},0==t&&this.body.emitter.emit("select",this.getSelection())},writable:!0,configurable:!0},_getSelectedNodeCount:{value:function(){var t=0;for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&(t+=1);return t},writable:!0,configurable:!0},_getSelectedNode:{value:function(){for(var t in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(t))return this.selectionObj.nodes[t];return null},writable:!0,configurable:!0},_getSelectedEdge:{value:function(){for(var t in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(t))return this.selectionObj.edges[t];return null},writable:!0,configurable:!0},_getSelectedEdgeCount:{value:function(){var t=0;for(var e in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(e)&&(t+=1);return t},writable:!0,configurable:!0},_getSelectedObjectCount:{value:function(){var t=0;for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&(t+=1);for(var i in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(i)&&(t+=1);return t},writable:!0,configurable:!0},_selectionIsEmpty:{value:function(){for(var t in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(t))return!1;for(var e in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(e))return!1;return!0},writable:!0,configurable:!0},_clusterInSelection:{value:function(){for(var t in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(t)&&this.selectionObj.nodes[t].clusterSize>1)return!0;return!1},writable:!0,configurable:!0},_selectConnectedEdges:{value:function(t){for(var e=0;ei;i++){s=t[i];var n=this.body.nodes[s];if(!n)throw new RangeError('Node with id "'+s+'" not found');this._selectObject(n,!0,!0,e,!0)}this.redraw()},writable:!0,configurable:!0},selectEdges:{value:function(t){var e,i,o;if(!t||void 0==t.length)throw"Selection must be an array with ids";for(this._unselectAll(!0),e=0,i=t.length;i>e;e++){o=t[e];var s=this.body.edges[o];if(!s)throw new RangeError('Edge with id "'+o+'" not found');this._selectObject(s,!0,!0,!1,!0)}this.redraw()},writable:!0,configurable:!0},_updateSelection:{value:function(){for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(this.body.nodes.hasOwnProperty(t)||delete this.selectionObj.nodes[t]);for(var e in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(e)&&(this.body.edges.hasOwnProperty(e)||delete this.selectionObj.edges[e])},writable:!0,configurable:!0}}),t}();e.SelectionHandler=r,Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,i){var o=i(40);e._getNodesOverlappingWith=function(t,e){var i=this.body.nodes;for(var o in i)i.hasOwnProperty(o)&&i[o].isOverlappingWith(t)&&e.push(o)},e._getAllNodesOverlappingWith=function(t){var e=[];return this._getNodesOverlappingWith(t,e),e},e._pointerToPositionObject=function(t){var e=this._XconvertDOMtoCanvas(t.x),i=this._YconvertDOMtoCanvas(t.y);return{left:e,top:i,right:e,bottom:i}},e._getNodeAt=function(t){var e=this._pointerToPositionObject(t),i=this._getAllNodesOverlappingWith(e);return i.length>0?this.body.nodes[i[i.length-1]]:null},e._getEdgesOverlappingWith=function(t,e){var i=this.body.edges;for(var o in i)i.hasOwnProperty(o)&&i[o].isOverlappingWith(t)&&e.push(o)},e._getAllEdgesOverlappingWith=function(t){var e=[];return this._getEdgesOverlappingWith(t,e),e},e._getEdgeAt=function(t){var e=this._pointerToPositionObject(t),i=this._getAllEdgesOverlappingWith(e);return i.length>0?this.body.edges[i[i.length-1]]:null},e._addToSelection=function(t){t instanceof o?this.selectionObj.nodes[t.id]=t:this.selectionObj.edges[t.id]=t},e._addToHover=function(t){t instanceof o?this.hoverObj.nodes[t.id]=t:this.hoverObj.edges[t.id]=t},e._removeFromSelection=function(t){t instanceof o?delete this.selectionObj.nodes[t.id]:delete this.selectionObj.edges[t.id]},e._unselectAll=function(t){void 0===t&&(t=!1);for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&this.selectionObj.nodes[e].unselect();for(var i in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(i)&&this.selectionObj.edges[i].unselect();this.selectionObj={nodes:{},edges:{}},0==t&&this.emit("select",this.getSelection())},e._unselectClusters=function(t){void 0===t&&(t=!1);for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&this.selectionObj.nodes[e].clusterSize>1&&(this.selectionObj.nodes[e].unselect(),this._removeFromSelection(this.selectionObj.nodes[e]));0==t&&this.emit("select",this.getSelection())},e._getSelectedNodeCount=function(){var t=0;for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&(t+=1);return t},e._getSelectedNode=function(){for(var t in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(t))return this.selectionObj.nodes[t];return null},e._getSelectedEdge=function(){for(var t in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(t))return this.selectionObj.edges[t];return null},e._getSelectedEdgeCount=function(){var t=0;for(var e in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(e)&&(t+=1);return t},e._getSelectedObjectCount=function(){var t=0;for(var e in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(e)&&(t+=1);for(var i in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(i)&&(t+=1);return t},e._selectionIsEmpty=function(){for(var t in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(t))return!1;for(var e in this.selectionObj.edges)if(this.selectionObj.edges.hasOwnProperty(e))return!1;return!0},e._clusterInSelection=function(){for(var t in this.selectionObj.nodes)if(this.selectionObj.nodes.hasOwnProperty(t)&&this.selectionObj.nodes[t].clusterSize>1)return!0;return!1},e._selectConnectedEdges=function(t){for(var e=0;ei;i++){s=t[i];var n=this.body.nodes[s];if(!n)throw new RangeError('Node with id "'+s+'" not found');this._selectObject(n,!0,!0,e,!0)}this.redraw()},e.selectEdges=function(t){var e,i,o;if(!t||void 0==t.length)throw"Selection must be an array with ids";for(this._unselectAll(!0),e=0,i=t.length;i>e;e++){o=t[e];var s=this.body.edges[o];if(!s)throw new RangeError('Edge with id "'+o+'" not found');this._selectObject(s,!0,!0,!1,!0)}this.redraw()},e._updateSelection=function(){for(var t in this.selectionObj.nodes)this.selectionObj.nodes.hasOwnProperty(t)&&(this.body.nodes.hasOwnProperty(t)||delete this.selectionObj.nodes[t]);for(var e in this.selectionObj.edges)this.selectionObj.edges.hasOwnProperty(e)&&(this.body.edges.hasOwnProperty(e)||delete this.selectionObj.edges[e])}},function(t,e,i){var o=i(1),s=(i(40),i(37),i(45));e._clearManipulatorBar=function(){this._recursiveDOMDelete(this.manipulationDiv),this.manipulationDOM={},this._cleanManipulatorHammers(),this._manipulationReleaseOverload=function(){},delete this.body.sectors.support.nodes.targetNode,delete this.body.sectors.support.nodes.targetViaNode,this.controlNodesActive=!1,this.freezeSimulationEnabled=!1},e._cleanManipulatorHammers=function(){if(0!=this.manipulationHammers.length){for(var t=0;t0){var t,e,i=0,o=!1,s=!1;for(e in this.body.nodes)this.body.nodes.hasOwnProperty(e)&&(t=this.body.nodes[e],-1!=t.level?o=!0:s=!0,io&&(n.xFixed=!1,n.x=i[n.level].minPos,r=!0):n.yFixed&&n.level>o&&(n.yFixed=!1,n.y=i[n.level].minPos,r=!0),1==r&&(i[n.level].minPos+=i[n.level].nodeSpacing,n.edges.length>1&&this._placeBranchNodes(n.edges,n.id,i,n.level))}},e._setLevel=function(t,e,i){for(var o=0;ot)&&(s.level=t,s.edges.length>1&&this._setLevel(t+1,s.edges,s.id))}},e._setLevelDirected=function(t,e,i){this.body.nodes[i].hierarchyEnumerated=!0;for(var o,s,n=0;n1&&o.hierarchyEnumerated===!1&&this._setLevelDirected(o.level,o.edges,o.id)},e._restoreNodes=function(){for(var t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&(this.body.nodes[t].xFixed=!1,this.body.nodes[t].yFixed=!1)}},function(t){function e(t){throw new Error("Cannot find module '"+t+"'.")}e.keys=function(){return[]},e.resolve=e,t.exports=e,e.id=78},function(t){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){(function(e){t.exports=e}).call(e,{})}])}); //# sourceMappingURL=vis.map