From 5c14597bb9364a74de27f022dd4b990ea04be5b8 Mon Sep 17 00:00:00 2001 From: josdejong Date: Tue, 23 Apr 2013 13:51:42 +0200 Subject: [PATCH] Implemented namespacing, closure, and support for require.js --- HISTORY.md | 4 +- Jakefile.js | 13 +- README.md | 28 ++- examples/timeline/01_basic.html | 5 +- examples/timeline/02_dataset.html | 4 +- .../timeline/03_requirejs/03_requirejs.html | 11 + .../timeline/03_requirejs/scripts/main.js | 19 ++ .../timeline/03_requirejs/scripts/require.js | 35 +++ src/component/component.js | 8 + src/component/item/item.js | 13 +- src/component/item/itembox.js | 11 + src/component/item/itempoint.js | 11 + src/component/item/itemrange.js | 11 + src/component/itemset.js | 11 +- src/component/panel.js | 8 + src/component/rootpanel.js | 10 +- src/component/timeaxis.js | 8 + src/controller.js | 5 + src/dataset.js | 7 +- src/events.js | 5 + src/module.js | 30 ++- src/range.js | 5 + src/stack.js | 5 + src/timestep.js | 5 + src/util.js | 6 + src/visualization/timeline.js | 5 + vis.js | 210 +++++++++++++++--- vis.min.js | 6 +- 28 files changed, 448 insertions(+), 51 deletions(-) create mode 100644 examples/timeline/03_requirejs/03_requirejs.html create mode 100644 examples/timeline/03_requirejs/scripts/main.js create mode 100644 examples/timeline/03_requirejs/scripts/require.js diff --git a/HISTORY.md b/HISTORY.md index ccfb6928..cbc644c4 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,9 +1,11 @@ vis.js history http://visjs.org -## +## version 0.0.6 - Css is now packaged in the javascript file, and automatically loaded. +- The library has neat namespacing now, is in a closure and, and can be used + with require.js. ## 2012-04-16, version 0.0.5 diff --git a/Jakefile.js b/Jakefile.js index 1e412574..a6ad052b 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -16,7 +16,7 @@ task('default', ['vis'], function () { }); /** - * vis.js, vis.css + * build the visualization library vis.js */ desc('Build the visualization library vis.js'); task('vis', function () { @@ -39,7 +39,8 @@ task('vis', function () { concat({ dest: VIS, src: [ - './src/header.js', + './src/module.js', + './src/util.js', './src/events.js', './src/timestep.js', @@ -47,7 +48,6 @@ task('vis', function () { './src/stack.js', './src/range.js', './src/controller.js', - './src/module.js', './src/component/component.js', './src/component/panel.js', @@ -60,11 +60,16 @@ task('vis', function () { './lib/moment.js' ], + + header: read('./src/header.js') + '\n' + + '(function () { ', // start of closure + separator: '\n', // Note: we insert the css as a string in the javascript code here // the css will be injected on load of the javascript library - footer: 'loadCss(' + cssText + ');' + footer: 'loadCss(' + cssText + ');\n' + + '})();' // end of closure }); // minify javascript diff --git a/README.md b/README.md index 65ceee62..95296e82 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,36 @@ Or download the library from the github project: ## Load -To use a component, include the javascript file of vis in your webpage. +To use a component, include the javascript file of vis in your webpage: ```html - + + + + + + + + + +``` + +or load vis.js using require.js: + +```js +require.config({ + paths: { + vis: 'path/to/vis', + } +}); +require(['vis'], function (math) { + // ... load a visualization +}); ``` + A timeline can be instantiated as: ```js diff --git a/examples/timeline/01_basic.html b/examples/timeline/01_basic.html index 6e4811fc..7d73e901 100644 --- a/examples/timeline/01_basic.html +++ b/examples/timeline/01_basic.html @@ -2,13 +2,14 @@ Timeline basic demo - + +
@@ -24,7 +25,7 @@ {id: 6, content: 'item 6', start: '2013-04-27'} ]; var options = {}; - var timeline = new Timeline(container, data, options); + var timeline = new vis.Timeline(container, data, options); \ No newline at end of file diff --git a/examples/timeline/02_dataset.html b/examples/timeline/02_dataset.html index ee816f4c..7188129e 100644 --- a/examples/timeline/02_dataset.html +++ b/examples/timeline/02_dataset.html @@ -28,7 +28,7 @@ diff --git a/examples/timeline/03_requirejs/03_requirejs.html b/examples/timeline/03_requirejs/03_requirejs.html new file mode 100644 index 00000000..764a75ba --- /dev/null +++ b/examples/timeline/03_requirejs/03_requirejs.html @@ -0,0 +1,11 @@ + + + + Timeline requirejs demo + + + + +
+ + diff --git a/examples/timeline/03_requirejs/scripts/main.js b/examples/timeline/03_requirejs/scripts/main.js new file mode 100644 index 00000000..15e1d872 --- /dev/null +++ b/examples/timeline/03_requirejs/scripts/main.js @@ -0,0 +1,19 @@ +require.config({ + paths: { + vis: '../../../../vis' + } +}); + +require(['vis'], function (vis) { + var container = document.getElementById('visualization'); + var data = [ + {id: 1, content: 'item 1', start: '2013-04-20'}, + {id: 2, content: 'item 2', start: '2013-04-14'}, + {id: 3, content: 'item 3', start: '2013-04-18'}, + {id: 4, content: 'item 4', start: '2013-04-16', end: '2013-04-19'}, + {id: 5, content: 'item 5', start: '2013-04-25'}, + {id: 6, content: 'item 6', start: '2013-04-27'} + ]; + var options = {}; + var timeline = new vis.Timeline(container, data, options); +}); diff --git a/examples/timeline/03_requirejs/scripts/require.js b/examples/timeline/03_requirejs/scripts/require.js new file mode 100644 index 00000000..8de013dc --- /dev/null +++ b/examples/timeline/03_requirejs/scripts/require.js @@ -0,0 +1,35 @@ +/* + RequireJS 2.1.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + Available via the MIT or new BSD license. + see: http://github.com/jrburke/requirejs for details +*/ +var requirejs,require,define; +(function(Y){function H(b){return"[object Function]"===L.call(b)}function I(b){return"[object Array]"===L.call(b)}function x(b,c){if(b){var d;for(d=0;dthis.depCount&&!this.defined){if(H(n)){if(this.events.error)try{e=j.execCb(c,n,b,e)}catch(d){a=d}else e=j.execCb(c,n,b,e);this.map.isDefine&&((b=this.module)&&void 0!==b.exports&&b.exports!==this.exports?e=b.exports:void 0===e&&this.usingExports&&(e=this.exports));if(a)return a.requireMap=this.map,a.requireModules=[this.map.id],a.requireType="define",C(this.error=a)}else e=n;this.exports=e;if(this.map.isDefine&& +!this.ignore&&(p[c]=e,l.onResourceLoad))l.onResourceLoad(j,this.map,this.depMaps);delete k[c];this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,d=h(a.prefix);this.depMaps.push(d);s(d,"defined",t(this,function(e){var n,d;d=this.map.name;var v=this.map.parentMap?this.map.parentMap.name:null,f=j.makeRequire(a.parentMap,{enableBuildCallback:!0, +skipMap:!0});if(this.map.unnormalized){if(e.normalize&&(d=e.normalize(d,function(a){return c(a,v,!0)})||""),e=h(a.prefix+"!"+d,this.map.parentMap),s(e,"defined",t(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=i(k,e.id)){this.depMaps.push(e);if(this.events.error)d.on("error",t(this,function(a){this.emit("error",a)}));d.enable()}}else n=t(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),n.error=t(this,function(a){this.inited=!0;this.error= +a;a.requireModules=[b];E(k,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&delete k[a.map.id]});C(a)}),n.fromText=t(this,function(e,c){var d=a.name,u=h(d),v=O;c&&(e=c);v&&(O=!1);q(u);r(m.config,b)&&(m.config[d]=m.config[b]);try{l.exec(e)}catch(k){throw Error("fromText eval for "+d+" failed: "+k);}v&&(O=!0);this.depMaps.push(u);j.completeLoad(d);f([d],n)}),e.load(a.name,f,n,m)}));j.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){this.enabling=this.enabled=!0;x(this.depMaps,t(this,function(a, +b){var c,e;if("string"===typeof a){a=h(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=i(N,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;s(a,"defined",t(this,function(a){this.defineDep(b,a);this.check()}));this.errback&&s(a,"error",this.errback)}c=a.id;e=k[c];!r(N,c)&&(e&&!e.enabled)&&j.enable(a,this)}));E(this.pluginMaps,t(this,function(a){var b=i(k,a.id);b&&!b.enabled&&j.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c= +this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){x(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};j={config:m,contextName:b,registry:k,defined:p,urlFetched:S,defQueue:F,Module:W,makeModuleMap:h,nextTick:l.nextTick,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=m.pkgs,c=m.shim,e={paths:!0,config:!0,map:!0};E(a,function(a,b){e[b]?"map"===b?Q(m[b],a,!0,!0):Q(m[b],a,!0):m[b]=a});a.shim&&(E(a.shim,function(a, +b){I(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=j.makeShimExports(a);c[b]=a}),m.shim=c);a.packages&&(x(a.packages,function(a){a="string"===typeof a?{name:a}:a;b[a.name]={name:a.name,location:a.location||a.name,main:(a.main||"main").replace(ga,"").replace(aa,"")}}),m.pkgs=b);E(k,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=h(b))});if(a.deps||a.callback)j.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(Y,arguments)); +return b||a.exports&&Z(a.exports)}},makeRequire:function(a,d){function f(e,c,u){var i,m;d.enableBuildCallback&&(c&&H(c))&&(c.__requireJsBuild=!0);if("string"===typeof e){if(H(c))return C(J("requireargs","Invalid require call"),u);if(a&&r(N,e))return N[e](k[a.id]);if(l.get)return l.get(j,e,a);i=h(e,a,!1,!0);i=i.id;return!r(p,i)?C(J("notloaded",'Module name "'+i+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):p[i]}K();j.nextTick(function(){K();m=q(h(null,a));m.skipMap=d.skipMap; +m.init(e,c,u,{enabled:!0});B()});return f}d=d||{};Q(f,{isBrowser:z,toUrl:function(b){var d=b.lastIndexOf("."),g=null;-1!==d&&(g=b.substring(d,b.length),b=b.substring(0,d));return j.nameToUrl(c(b,a&&a.id,!0),g)},defined:function(b){return r(p,h(b,a,!1,!0).id)},specified:function(b){b=h(b,a,!1,!0).id;return r(p,b)||r(k,b)}});a||(f.undef=function(b){w();var c=h(b,a,!0),d=i(k,b);delete p[b];delete S[c.url];delete X[b];d&&(d.events.defined&&(X[b]=d.events),delete k[b])});return f},enable:function(a){i(k, +a.id)&&q(a).enable()},completeLoad:function(a){var b,c,d=i(m.shim,a)||{},h=d.exports;for(w();F.length;){c=F.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);D(c)}c=i(k,a);if(!b&&!r(p,a)&&c&&!c.inited){if(m.enforceDefine&&(!h||!Z(h)))return y(a)?void 0:C(J("nodefine","No define call for "+a,null,[a]));D([a,d.deps||[],d.exportsFn])}B()},nameToUrl:function(a,b){var c,d,h,f,j,k;if(l.jsExtRegExp.test(a))f=a+(b||"");else{c=m.paths;d=m.pkgs;f=a.split("/");for(j=f.length;0f.attachEvent.toString().indexOf("[native code"))&&!V?(O=!0,f.attachEvent("onreadystatechange", +b.onScriptLoad)):(f.addEventListener("load",b.onScriptLoad,!1),f.addEventListener("error",b.onScriptError,!1)),f.src=d,K=f,D?A.insertBefore(f,D):A.appendChild(f),K=null,f;$&&(importScripts(d),b.completeLoad(c))};z&&M(document.getElementsByTagName("script"),function(b){A||(A=b.parentNode);if(s=b.getAttribute("data-main"))return q.baseUrl||(G=s.split("/"),ba=G.pop(),ca=G.length?G.join("/")+"/":"./",q.baseUrl=ca,s=ba),s=s.replace(aa,""),q.deps=q.deps?q.deps.concat(s):[s],!0});define=function(b,c,d){var i, +f;"string"!==typeof b&&(d=c,c=b,b=null);I(c)||(d=c,c=[]);!c.length&&H(d)&&d.length&&(d.toString().replace(ia,"").replace(ja,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c));if(O){if(!(i=K))P&&"interactive"===P.readyState||M(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return P=b}),i=P;i&&(b||(b=i.getAttribute("data-requiremodule")),f=B[i.getAttribute("data-requirecontext")])}(f?f.defQueue:R).push([b,c,d])};define.amd= +{jQuery:!0};l.exec=function(b){return eval(b)};l(q)}})(this); diff --git a/src/component/component.js b/src/component/component.js index a9007549..850003bd 100644 --- a/src/component/component.js +++ b/src/component/component.js @@ -114,3 +114,11 @@ Component.prototype.on = function (event, callback) { throw new Error('Cannot attach event: no root panel found'); } }; + +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + exports.component.Component = Component; +} diff --git a/src/component/item/item.js b/src/component/item/item.js index 0639ee25..41c3d8f4 100644 --- a/src/component/item/item.js +++ b/src/component/item/item.js @@ -33,4 +33,15 @@ Item.prototype.unselect = function () { }; // create a namespace for all item types -var itemTypes = {}; \ No newline at end of file +var itemTypes = {}; + +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + if (!('item' in exports.component)) { + exports.component.item = {}; + } + exports.component.item.Item = Item; +} diff --git a/src/component/item/itembox.js b/src/component/item/itembox.js index 4170fb08..8f7234d8 100644 --- a/src/component/item/itembox.js +++ b/src/component/item/itembox.js @@ -267,3 +267,14 @@ ItemBox.prototype.reposition = function () { dot.style.top = props.dot.top + 'px'; } }; + +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + if (!('item' in exports.component)) { + exports.component.item = {}; + } + exports.component.item.ItemBox = ItemBox; +} diff --git a/src/component/item/itempoint.js b/src/component/item/itempoint.js index 3ad5a745..ab6ea2cb 100644 --- a/src/component/item/itempoint.js +++ b/src/component/item/itempoint.js @@ -207,3 +207,14 @@ ItemPoint.prototype.reposition = function () { dom.dot.style.top = props.dot.top + 'px'; } }; + +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + if (!('item' in exports.component)) { + exports.component.item = {}; + } + exports.component.item.ItemPoint = ItemPoint; +} diff --git a/src/component/item/itemrange.js b/src/component/item/itemrange.js index a88a0fff..4d2ae93c 100644 --- a/src/component/item/itemrange.js +++ b/src/component/item/itemrange.js @@ -217,3 +217,14 @@ ItemRange.prototype.reposition = function () { dom.content.style.left = props.content.left + 'px'; } }; + +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + if (!('item' in exports.component)) { + exports.component.item = {}; + } + exports.component.item.ItemRange = ItemRange; +} diff --git a/src/component/itemset.js b/src/component/itemset.js index ad1bf453..65342c54 100644 --- a/src/component/itemset.js +++ b/src/component/itemset.js @@ -438,6 +438,13 @@ ItemSet.prototype.toTime = function(x) { */ ItemSet.prototype.toScreen = function(time) { var conversion = this.conversion; - var s = (time.valueOf() - conversion.offset) * conversion.factor; - return s; + return (time.valueOf() - conversion.offset) * conversion.factor; }; + +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + exports.component.ItemSet = ItemSet; +} diff --git a/src/component/panel.js b/src/component/panel.js index dcb66eb8..0a00ea11 100644 --- a/src/component/panel.js +++ b/src/component/panel.js @@ -99,3 +99,11 @@ Panel.prototype.reflow = function () { return (changed > 0); }; + +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + exports.component.Panel = Panel; +} diff --git a/src/component/rootpanel.js b/src/component/rootpanel.js index 7265a759..1838c079 100644 --- a/src/component/rootpanel.js +++ b/src/component/rootpanel.js @@ -197,4 +197,12 @@ RootPanel.prototype._updateEventEmitters = function () { // TODO: be able to delete event listeners // TODO: be able to move event listeners to a parent when available } -}; \ No newline at end of file +}; + +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + exports.component.RootPanel = RootPanel; +} diff --git a/src/component/timeaxis.js b/src/component/timeaxis.js index fc5cee4f..5999ff30 100644 --- a/src/component/timeaxis.js +++ b/src/component/timeaxis.js @@ -522,3 +522,11 @@ TimeAxis.prototype._updateConversion = function() { this.conversion = Range.conversion(range.start, range.end, this.width); } }; + +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + exports.component.TimeAxis = TimeAxis; +} diff --git a/src/controller.js b/src/controller.js index 6c15b3c2..70f6a992 100644 --- a/src/controller.js +++ b/src/controller.js @@ -137,3 +137,8 @@ Controller.prototype.reflow = function () { } // TODO: limit the number of nested reflows/repaints, prevent loop }; + +// export +if (typeof exports !== 'undefined') { + exports.Controller = Controller; +} diff --git a/src/dataset.js b/src/dataset.js index 4593148d..e39b200c 100644 --- a/src/dataset.js +++ b/src/dataset.js @@ -464,7 +464,7 @@ DataSet.prototype._castItem = function (item, fieldTypes, fields) { if (item) { clone = {}; fieldTypes = fieldTypes || {}; - + if (fields) { // output filtered fields util.forEach(item, function (value, field) { @@ -545,3 +545,8 @@ DataSet.prototype._appendRow = function (dataTable, columns, item) { dataTable.setValue(row, col, item[field]); }); }; + +// exports +if (typeof exports !== 'undefined') { + exports.DataSet = DataSet; +} diff --git a/src/events.js b/src/events.js index 44f44c12..7ff219da 100644 --- a/src/events.js +++ b/src/events.js @@ -114,3 +114,8 @@ var events = { } } }; + +// exports +if (typeof exports !== 'undefined') { + exports.events = events; +} diff --git a/src/module.js b/src/module.js index 43e49a14..8e37b9a0 100644 --- a/src/module.js +++ b/src/module.js @@ -1,13 +1,13 @@ /** - * load css from contents - * @param {String} css + * load css from text + * @param {String} css Text containing css */ var loadCss = function (css) { // get the script location, and built the css file name from the js file name // http://stackoverflow.com/a/2161748/1262753 var scripts = document.getElementsByTagName('script'); - var jsFile = scripts[scripts.length-1].src.split('?')[0]; + // var jsFile = scripts[scripts.length-1].src.split('?')[0]; // var cssFile = jsFile.substring(0, jsFile.length - 2) + 'css'; // inject css @@ -23,3 +23,27 @@ var loadCss = function (css) { document.getElementsByTagName('head')[0].appendChild(style); }; +/** + * Define CommonJS module exports when not available + */ +if (typeof exports === 'undefined') { + var exports = {}; +} +if (typeof module === 'undefined') { + var module = { + exports: exports + }; +} + +/** + * AMD module exports + */ +if (typeof(require) != 'undefined' && typeof(define) != 'undefined') { + define(function () { + return exports; + }); +} +else { + // attach the module to the window, load as a regular javascript file + window['vis'] = exports; +} diff --git a/src/range.js b/src/range.js index 4ce5c595..8ebee519 100644 --- a/src/range.js +++ b/src/range.js @@ -522,3 +522,8 @@ Range.prototype.move = function(moveFactor) { this.start = newStart; this.end = newEnd; }; + +// exports +if (typeof exports !== 'undefined') { + exports.Range = Range; +} diff --git a/src/stack.js b/src/stack.js index b79c419d..fd80a481 100644 --- a/src/stack.js +++ b/src/stack.js @@ -155,3 +155,8 @@ Stack.prototype.collision = function(a, b, margin) { (a.top - margin) < (b.top + b.height) && (a.top + a.height + margin) > b.top); }; + +// exports +if (typeof exports !== 'undefined') { + exports.Stack = Stack; +} diff --git a/src/timestep.js b/src/timestep.js index 4360a9c7..6f9715a4 100644 --- a/src/timestep.js +++ b/src/timestep.js @@ -448,3 +448,8 @@ TimeStep.prototype.getLabelMajor = function(date) { default: return ''; } }; + +// export +if (typeof exports !== 'undefined') { + exports.TimeStep = TimeStep; +} diff --git a/src/util.js b/src/util.js index 438f69ae..d3753d8f 100644 --- a/src/util.js +++ b/src/util.js @@ -761,3 +761,9 @@ if(!Array.isArray) { return Object.prototype.toString.call(vArg) === "[object Array]"; }; } + + +// export +if (typeof exports !== 'undefined') { + exports.util = util; +} diff --git a/src/visualization/timeline.js b/src/visualization/timeline.js index 7b53cba3..fb15ab62 100644 --- a/src/visualization/timeline.js +++ b/src/visualization/timeline.js @@ -138,3 +138,8 @@ Timeline.prototype.setData = function(data) { this.itemset.setData(data); } }; + +// exports +if (typeof exports !== 'undefined') { + exports.Timeline = Timeline; +} diff --git a/vis.js b/vis.js index e8729dce..956e7d08 100644 --- a/vis.js +++ b/vis.js @@ -23,6 +23,57 @@ * the License. */ +(function () { + +/** + * load css from text + * @param {String} css Text containing css + */ +var loadCss = function (css) { + // get the script location, and built the css file name from the js file name + // http://stackoverflow.com/a/2161748/1262753 + var scripts = document.getElementsByTagName('script'); + // var jsFile = scripts[scripts.length-1].src.split('?')[0]; + // var cssFile = jsFile.substring(0, jsFile.length - 2) + 'css'; + + // inject css + // http://stackoverflow.com/questions/524696/how-to-create-a-style-tag-with-javascript + var style = document.createElement('style'); + style.type = 'text/css'; + if (style.styleSheet){ + style.styleSheet.cssText = css; + } else { + style.appendChild(document.createTextNode(css)); + } + + document.getElementsByTagName('head')[0].appendChild(style); +}; + +/** + * Define CommonJS module exports when not available + */ +if (typeof exports === 'undefined') { + var exports = {}; +} +if (typeof module === 'undefined') { + var module = { + exports: exports + }; +} + +/** + * AMD module exports + */ +if (typeof(require) != 'undefined' && typeof(define) != 'undefined') { + define(function () { + return exports; + }); +} +else { + // attach the module to the window, load as a regular javascript file + window['vis'] = exports; +} + // create namespace var util = {}; @@ -788,6 +839,12 @@ if(!Array.isArray) { } +// export +if (typeof exports !== 'undefined') { + exports.util = util; +} + + /** * Event listener (singleton) */ @@ -904,6 +961,11 @@ var events = { } }; +// exports +if (typeof exports !== 'undefined') { + exports.events = events; +} + /** * @constructor TimeStep * The class TimeStep is an iterator for dates. You provide a start date and an @@ -1355,6 +1417,11 @@ TimeStep.prototype.getLabelMajor = function(date) { } }; +// export +if (typeof exports !== 'undefined') { + exports.TimeStep = TimeStep; +} + /** * DataSet * @@ -1821,7 +1888,7 @@ DataSet.prototype._castItem = function (item, fieldTypes, fields) { if (item) { clone = {}; fieldTypes = fieldTypes || {}; - + if (fields) { // output filtered fields util.forEach(item, function (value, field) { @@ -1903,6 +1970,11 @@ DataSet.prototype._appendRow = function (dataTable, columns, item) { }); }; +// exports +if (typeof exports !== 'undefined') { + exports.DataSet = DataSet; +} + /** * @constructor Stack * Stacks items on top of each other. @@ -2061,6 +2133,11 @@ Stack.prototype.collision = function(a, b, margin) { (a.top + a.height + margin) > b.top); }; +// exports +if (typeof exports !== 'undefined') { + exports.Stack = Stack; +} + /** * @constructor Range * A Range controls a numeric range with a start and end value. @@ -2586,6 +2663,11 @@ Range.prototype.move = function(moveFactor) { this.end = newEnd; }; +// exports +if (typeof exports !== 'undefined') { + exports.Range = Range; +} + /** * @constructor Controller * @@ -2726,31 +2808,10 @@ Controller.prototype.reflow = function () { // TODO: limit the number of nested reflows/repaints, prevent loop }; - -/** - * load css from contents - * @param {String} css - */ -var loadCss = function (css) { - // get the script location, and built the css file name from the js file name - // http://stackoverflow.com/a/2161748/1262753 - var scripts = document.getElementsByTagName('script'); - var jsFile = scripts[scripts.length-1].src.split('?')[0]; - // var cssFile = jsFile.substring(0, jsFile.length - 2) + 'css'; - - // inject css - // http://stackoverflow.com/questions/524696/how-to-create-a-style-tag-with-javascript - var style = document.createElement('style'); - style.type = 'text/css'; - if (style.styleSheet){ - style.styleSheet.cssText = css; - } else { - style.appendChild(document.createTextNode(css)); - } - - document.getElementsByTagName('head')[0].appendChild(style); -}; - +// export +if (typeof exports !== 'undefined') { + exports.Controller = Controller; +} /** * Prototype for visual components @@ -2869,6 +2930,14 @@ Component.prototype.on = function (event, callback) { } }; +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + exports.component.Component = Component; +} + /** * A panel can contain components * @param {Component} [parent] @@ -2971,6 +3040,14 @@ Panel.prototype.reflow = function () { return (changed > 0); }; +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + exports.component.Panel = Panel; +} + /** * A root panel can hold components. The root panel must be initialized with * a DOM element as container. @@ -3171,6 +3248,15 @@ RootPanel.prototype._updateEventEmitters = function () { // TODO: be able to move event listeners to a parent when available } }; + +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + exports.component.RootPanel = RootPanel; +} + /** * A horizontal time axis * @param {Component} parent @@ -3696,6 +3782,14 @@ TimeAxis.prototype._updateConversion = function() { } }; +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + exports.component.TimeAxis = TimeAxis; +} + /** * An ItemSet holds a set of items and ranges which can be displayed in a * range. The width is determined by the parent of the ItemSet, and the height @@ -4136,10 +4230,17 @@ ItemSet.prototype.toTime = function(x) { */ ItemSet.prototype.toScreen = function(time) { var conversion = this.conversion; - var s = (time.valueOf() - conversion.offset) * conversion.factor; - return s; + return (time.valueOf() - conversion.offset) * conversion.factor; }; +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + exports.component.ItemSet = ItemSet; +} + /** * @constructor Item @@ -4176,6 +4277,18 @@ Item.prototype.unselect = function () { // create a namespace for all item types var itemTypes = {}; + +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + if (!('item' in exports.component)) { + exports.component.item = {}; + } + exports.component.item.Item = Item; +} + /** * @constructor ItemBox * @extends Item @@ -4446,6 +4559,17 @@ ItemBox.prototype.reposition = function () { } }; +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + if (!('item' in exports.component)) { + exports.component.item = {}; + } + exports.component.item.ItemBox = ItemBox; +} + /** * @constructor ItemPoint * @extends Item @@ -4656,6 +4780,17 @@ ItemPoint.prototype.reposition = function () { } }; +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + if (!('item' in exports.component)) { + exports.component.item = {}; + } + exports.component.item.ItemPoint = ItemPoint; +} + /** * @constructor ItemRange * @extends Item @@ -4876,6 +5011,17 @@ ItemRange.prototype.reposition = function () { } }; +// exports +if (typeof exports !== 'undefined') { + if (!('component' in exports)) { + exports.component = {}; + } + if (!('item' in exports.component)) { + exports.component.item = {}; + } + exports.component.item.ItemRange = ItemRange; +} + /** * Create a timeline visualization * @param {HTMLElement} container @@ -5017,6 +5163,11 @@ Timeline.prototype.setData = function(data) { } }; +// exports +if (typeof exports !== 'undefined') { + exports.Timeline = Timeline; +} + // moment.js // version : 2.0.0 // author : Tim Wood @@ -6418,4 +6569,5 @@ Timeline.prototype.setData = function(data) { } }).call(this); -loadCss("/* vis.js stylesheet */\n\n.graph {\n position: relative;\n border: 1px solid #bfbfbf;\n}\n\n.graph .panel {\n position: absolute;\n}\n\n.graph .itemset {\n position: absolute;\n}\n\n\n.graph .item {\n position: absolute;\n color: #1A1A1A;\n border-color: #97B0F8;\n background-color: #D5DDF6;\n display: inline-block;\n}\n\n.graph .item.selected {\n border-color: #FFC200;\n background-color: #FFF785;\n z-index: 999;\n}\n\n.graph .item.cluster {\n /* TODO: use another color or pattern? */\n background: #97B0F8 url('img/cluster_bg.png');\n color: white;\n}\n.graph .item.cluster.point {\n border-color: #D5DDF6;\n}\n\n.graph .item.box {\n text-align: center;\n border-style: solid;\n border-width: 1px;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.point {\n background: none;\n}\n\n.graph .dot {\n border: 5px solid #97B0F8;\n position: absolute;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range {\n overflow: hidden;\n border-style: solid;\n border-width: 1px;\n border-radius: 2px;\n -moz-border-radius: 2px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range .drag-left {\n cursor: w-resize;\n z-index: 1000;\n}\n\n.graph .item.range .drag-right {\n cursor: e-resize;\n z-index: 1000;\n}\n\n.graph .item.range .content {\n position: relative;\n display: inline-block;\n}\n\n.graph .item.line {\n position: absolute;\n width: 0;\n border-left-width: 1px;\n border-left-style: solid;\n z-index: -1;\n}\n\n.graph .item .content {\n margin: 5px;\n white-space: nowrap;\n overflow: hidden;\n}\n\n/* TODO: better css name, 'graph' is way to generic */\n\n.graph {\n overflow: hidden;\n}\n\n.graph .axis {\n position: relative;\n}\n\n.graph .axis .text {\n position: absolute;\n color: #4d4d4d;\n padding: 3px;\n white-space: nowrap;\n}\n\n.graph .axis .text.measure {\n position: absolute;\n padding-left: 0;\n padding-right: 0;\n margin-left: 0;\n margin-right: 0;\n visibility: hidden;\n}\n\n.graph .axis .grid.vertical {\n position: absolute;\n width: 0;\n border-right: 1px solid;\n}\n\n.graph .axis .grid.horizontal {\n position: absolute;\n left: 0;\n width: 100%;\n height: 0;\n border-bottom: 1px solid;\n}\n\n.graph .axis .grid.minor {\n border-color: #e5e5e5;\n}\n\n.graph .axis .grid.major {\n border-color: #bfbfbf;\n}\n\n"); \ No newline at end of file +loadCss("/* vis.js stylesheet */\n\n.graph {\n position: relative;\n border: 1px solid #bfbfbf;\n}\n\n.graph .panel {\n position: absolute;\n}\n\n.graph .itemset {\n position: absolute;\n}\n\n\n.graph .item {\n position: absolute;\n color: #1A1A1A;\n border-color: #97B0F8;\n background-color: #D5DDF6;\n display: inline-block;\n}\n\n.graph .item.selected {\n border-color: #FFC200;\n background-color: #FFF785;\n z-index: 999;\n}\n\n.graph .item.cluster {\n /* TODO: use another color or pattern? */\n background: #97B0F8 url('img/cluster_bg.png');\n color: white;\n}\n.graph .item.cluster.point {\n border-color: #D5DDF6;\n}\n\n.graph .item.box {\n text-align: center;\n border-style: solid;\n border-width: 1px;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.point {\n background: none;\n}\n\n.graph .dot {\n border: 5px solid #97B0F8;\n position: absolute;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range {\n overflow: hidden;\n border-style: solid;\n border-width: 1px;\n border-radius: 2px;\n -moz-border-radius: 2px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range .drag-left {\n cursor: w-resize;\n z-index: 1000;\n}\n\n.graph .item.range .drag-right {\n cursor: e-resize;\n z-index: 1000;\n}\n\n.graph .item.range .content {\n position: relative;\n display: inline-block;\n}\n\n.graph .item.line {\n position: absolute;\n width: 0;\n border-left-width: 1px;\n border-left-style: solid;\n z-index: -1;\n}\n\n.graph .item .content {\n margin: 5px;\n white-space: nowrap;\n overflow: hidden;\n}\n\n/* TODO: better css name, 'graph' is way to generic */\n\n.graph {\n overflow: hidden;\n}\n\n.graph .axis {\n position: relative;\n}\n\n.graph .axis .text {\n position: absolute;\n color: #4d4d4d;\n padding: 3px;\n white-space: nowrap;\n}\n\n.graph .axis .text.measure {\n position: absolute;\n padding-left: 0;\n padding-right: 0;\n margin-left: 0;\n margin-right: 0;\n visibility: hidden;\n}\n\n.graph .axis .grid.vertical {\n position: absolute;\n width: 0;\n border-right: 1px solid;\n}\n\n.graph .axis .grid.horizontal {\n position: absolute;\n left: 0;\n width: 100%;\n height: 0;\n border-bottom: 1px solid;\n}\n\n.graph .axis .grid.minor {\n border-color: #e5e5e5;\n}\n\n.graph .axis .grid.major {\n border-color: #bfbfbf;\n}\n\n"); +})(); \ No newline at end of file diff --git a/vis.min.js b/vis.min.js index b58ea8e0..4e4e19f9 100644 --- a/vis.min.js +++ b/vis.min.js @@ -22,6 +22,6 @@ * License for the specific language governing permissions and limitations under * the License. */ -function DataSet(t){var e=this;this.options=t||{},this.data={},this.fieldId=this.options.fieldId||"id",this.fieldTypes={},this.options.fieldTypes&&util.forEach(this.options.fieldTypes,function(t,i){e.fieldTypes[i]="Date"==t||"ISODate"==t||"ASPDate"==t?"Date":t}),this.subscribers={},this.internalIds={}}function Stack(t,e){this.parent=t,this.options={order:function(t,e){return e.width-t.width||t.left-e.left}},this.ordered=[],this.setOptions(e)}function Range(t){this.id=util.randomUUID(),this.start=0,this.end=0,this.options={min:null,max:null,zoomMin:null,zoomMax:null},this.setOptions(t),this.listeners=[]}function Controller(){this.id=util.randomUUID(),this.components={},this.repaintTimer=void 0,this.reflowTimer=void 0}function Component(){this.id=null,this.parent=null,this.depends=null,this.controller=null,this.options=null,this.frame=null,this.top=0,this.left=0,this.width=0,this.height=0}function Panel(t,e,i){this.id=util.randomUUID(),this.parent=t,this.depends=e,this.options={},this.setOptions(i)}function RootPanel(t,e){this.id=util.randomUUID(),this.container=t,this.options={autoResize:!0},this.listeners={},this.setOptions(e)}function TimeAxis(t,e,i){this.id=util.randomUUID(),this.parent=t,this.depends=e,this.dom={majorLines:[],majorTexts:[],minorLines:[],minorTexts:[],redundant:{majorLines:[],majorTexts:[],minorLines:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.options={orientation:"bottom",showMinorLabels:!0,showMajorLabels:!0},this.conversion=null,this.range=null,this.setOptions(i)}function ItemSet(t,e,i){this.id=util.randomUUID(),this.parent=t,this.depends=e,this.options={style:"box",align:"center",orientation:"bottom",margin:{axis:20,item:10},padding:5};var n=this;this.data=null,this.range=null,this.listeners={add:function(t,e){n._onAdd(e.items)},update:function(t,e){n._onUpdate(e.items)},remove:function(t,e){n._onRemove(e.items)}},this.items={},this.queue={},this.stack=new Stack(this),this.conversion=null,this.setOptions(i)}function Item(t,e,i){this.parent=t,this.data=e,this.selected=!1,this.visible=!0,this.dom=null,this.options=i}function ItemBox(t,e,i){this.props={dot:{left:0,top:0,width:0,height:0},line:{top:0,left:0,width:0,height:0}},Item.call(this,t,e,i)}function ItemPoint(t,e,i){this.props={dot:{top:0,width:0,height:0},content:{height:0,marginLeft:0}},Item.call(this,t,e,i)}function ItemRange(t,e,i){this.props={content:{left:0,width:0}},Item.call(this,t,e,i)}function Timeline(t,e,i){var n=this;if(this.options={orientation:"bottom",zoomMin:10,zoomMax:31536e10,moveable:!0,zoomable:!0},this.controller=new Controller,!t)throw Error("No container element provided");this.main=new RootPanel(t,{autoResize:!1,height:function(){return n.timeaxis.height+n.itemset.height}}),this.controller.add(this.main);var o=moment().hours(0).minutes(0).seconds(0).milliseconds(0);this.range=new Range({start:o.clone().add("days",-3).valueOf(),end:o.clone().add("days",4).valueOf()}),this.range.subscribe(this.main,"move","horizontal"),this.range.subscribe(this.main,"zoom","horizontal"),this.range.on("rangechange",function(){n.controller.requestReflow()}),this.range.on("rangechanged",function(){n.controller.requestReflow()}),this.timeaxis=new TimeAxis(this.main,null,{orientation:this.options.orientation,range:this.range}),this.timeaxis.setRange(this.range),this.controller.add(this.timeaxis),this.itemset=new ItemSet(this.main,[this.timeaxis],{orientation:this.options.orientation}),this.itemset.setRange(this.range),e&&this.setData(e),this.controller.add(this.itemset),this.setOptions(i)}var util={};util.isNumber=function(t){return t instanceof Number||"number"==typeof t},util.isString=function(t){return t instanceof String||"string"==typeof t},util.isDate=function(t){if(t instanceof Date)return!0;if(util.isString(t)){var e=ASPDateRegex.exec(t);if(e)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},util.isDataTable=function(t){return"undefined"!=typeof google&&google.visualization&&google.visualization.DataTable&&t instanceof google.visualization.DataTable},util.randomUUID=function(){var t=function(){return Math.floor(65536*Math.random()).toString(16)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},util.extend=function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},util.cast=function(t,e){if(void 0===t)return void 0;if(null===t)return null;if(!e)return t;if("function"==typeof e)return e(t);switch(e){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return Number(t);case"string":case"String":return t+"";case"Date":if(util.isNumber(t))return new Date(t);if(t instanceof Date)return new Date(t.valueOf());if(util.isString(t)){var i=ASPDateRegex.exec(t);return i?new Date(Number(i[1])):moment(t).toDate()}throw Error("Cannot cast object of type "+util.getType(t)+" to type Date");case"ISODate":if(t instanceof Date)return t.toISOString();if(util.isNumber(t)||util.isString(t))return moment(t).toDate().toISOString();throw Error("Cannot cast object of type "+util.getType(t)+" to type ISODate");case"ASPDate":if(t instanceof Date)return"/Date("+t.valueOf()+")/";if(util.isNumber(t)||util.isString(t))return"/Date("+moment(t).valueOf()+")/";throw Error("Cannot cast object of type "+util.getType(t)+" to type ASPDate");default:throw Error("Cannot cast object of type "+util.getType(t)+' to type "'+e+'"')}};var ASPDateRegex=/^\/?Date\((\-?\d+)/i;if(util.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":t instanceof Array?"Array":t instanceof Date?"Date":"Object":"number"==e?"Number":"boolean"==e?"Boolean":"string"==e?"String":e},util.getAbsoluteLeft=function(t){for(var e=document.documentElement,i=document.body,n=t.offsetLeft,o=t.offsetParent;null!=o&&o!=i&&o!=e;)n+=o.offsetLeft,n-=o.scrollLeft,o=o.offsetParent;return n},util.getAbsoluteTop=function(t){for(var e=document.documentElement,i=document.body,n=t.offsetTop,o=t.offsetParent;null!=o&&o!=i&&o!=e;)n+=o.offsetTop,n-=o.scrollTop,o=o.offsetParent;return n},util.getPageY=function(t){if("pageY"in t)return t.pageY;var e;e="targetTouches"in t&&t.targetTouches.length?t.targetTouches[0].clientY:t.clientY;var i=document.documentElement,n=document.body;return e+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)},util.getPageX=function(t){if("pageY"in t)return t.pageX;var e;e="targetTouches"in t&&t.targetTouches.length?t.targetTouches[0].clientX:t.clientX;var i=document.documentElement,n=document.body;return e+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0)},util.addClassName=function(t,e){var i=t.className.split(" ");-1==i.indexOf(e)&&(i.push(e),t.className=i.join(" "))},util.removeClassName=function(t,e){var i=t.className.split(" "),n=i.indexOf(e);-1!=n&&(i.splice(n,1),t.className=i.join(" "))},util.forEach=function(t,e){if(t instanceof Array)t.forEach(e);else for(var i in t)t.hasOwnProperty(i)&&e(t[i],i,t)},util.updateProperty=function(t,e,i){return t[e]!==i?(t[e]=i,!0):!1},util.addEventListener=function(t,e,i,n){t.addEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,n)):t.attachEvent("on"+e,i)},util.removeEventListener=function(t,e,i,n){t.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,n)):t.detachEvent("on"+e,i)},util.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},util.stopPropagation=function(t){t||(t=window.event),t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},util.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},util.option={},util.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},util.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?t+"":e||null},util.option.asSize=function(t,e){return"function"==typeof t&&(t=t()),util.isString(t)?t:util.isNumber(t)?t+"px":e||null},util.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},!Array.prototype.indexOf){Array.prototype.indexOf=function(t){for(var e=0;this.length>e;e++)if(this[e]==t)return e;return-1};try{console.log("Warning: Ancient browser detected. Please update your browser")}catch(err){}}Array.prototype.forEach||(Array.prototype.forEach=function(t,e){for(var i=0,n=this.length;n>i;++i)t.call(e||this,this[i],i,this)}),Array.prototype.map||(Array.prototype.map=function(t,e){var i,n,o;if(null==this)throw new TypeError(" this is null or not defined");var r=Object(this),s=r.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(e&&(i=e),n=Array(s),o=0;s>o;){var a,h;o in r&&(a=r[o],h=t.call(i,a,o,r),n[o]=h),o++}return n}),Array.prototype.filter||(Array.prototype.filter=function(t){"use strict";if(null==this)throw new TypeError;var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var n=[],o=arguments[1],r=0;i>r;r++)if(r in e){var s=e[r];t.call(o,s,r,e)&&n.push(s)}return n}),Object.keys||(Object.keys=function(){var t=Object.prototype.hasOwnProperty,e=!{toString:null}.propertyIsEnumerable("toString"),i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=i.length;return function(o){if("object"!=typeof o&&"function"!=typeof o||null===o)throw new TypeError("Object.keys called on non-object");var r=[];for(var s in o)t.call(o,s)&&r.push(s);if(e)for(var a=0;n>a;a++)t.call(o,i[a])&&r.push(i[a]);return r}}()),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)});var events={listeners:[],indexOf:function(t){for(var e=this.listeners,i=0,n=this.listeners.length;n>i;i++){var o=e[i];if(o&&o.object==t)return i}return-1},addListener:function(t,e,i){var n=this.indexOf(t),o=this.listeners[n];o||(o={object:t,events:{}},this.listeners.push(o));var r=o.events[e];r||(r=[],o.events[e]=r),-1==r.indexOf(i)&&r.push(i)},removeListener:function(t,e,i){var n=this.indexOf(t),o=this.listeners[n];if(o){var r=o.events[e];r&&(n=r.indexOf(i),-1!=n&&r.splice(n,1),0==r.length&&delete o.events[e]);var s=0,a=o.events;for(var h in a)a.hasOwnProperty(h)&&s++;0==s&&delete this.listeners[n]}},removeAllListeners:function(){this.listeners=[]},trigger:function(t,e,i){var n=this.indexOf(t),o=this.listeners[n];if(o){var r=o.events[e];if(r)for(var s=0,a=r.length;a>s;s++)r[s](i)}}};TimeStep=function(t,e,i){this.current=new Date,this._start=new Date,this._end=new Date,this.autoScale=!0,this.scale=TimeStep.SCALE.DAY,this.step=1,this.setRange(t,e,i)},TimeStep.SCALE={MILLISECOND:1,SECOND:2,MINUTE:3,HOUR:4,DAY:5,WEEKDAY:6,MONTH:7,YEAR:8},TimeStep.prototype.setRange=function(t,e,i){t instanceof Date&&e instanceof Date&&(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))},TimeStep.prototype.first=function(){this.current=new Date(this._start.valueOf()),this.roundToMinor()},TimeStep.prototype.roundToMinor=function(){switch(this.scale){case TimeStep.SCALE.YEAR:this.current.setFullYear(this.step*Math.floor(this.current.getFullYear()/this.step)),this.current.setMonth(0);case TimeStep.SCALE.MONTH:this.current.setDate(1);case TimeStep.SCALE.DAY:case TimeStep.SCALE.WEEKDAY:this.current.setHours(0);case TimeStep.SCALE.HOUR:this.current.setMinutes(0);case TimeStep.SCALE.MINUTE:this.current.setSeconds(0);case TimeStep.SCALE.SECOND:this.current.setMilliseconds(0)}if(1!=this.step)switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current.setMilliseconds(this.current.getMilliseconds()-this.current.getMilliseconds()%this.step);break;case TimeStep.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()-this.current.getSeconds()%this.step);break;case TimeStep.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()-this.current.getMinutes()%this.step);break;case TimeStep.SCALE.HOUR:this.current.setHours(this.current.getHours()-this.current.getHours()%this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()-1-(this.current.getDate()-1)%this.step+1);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()-this.current.getMonth()%this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()-this.current.getFullYear()%this.step);break;default:}},TimeStep.prototype.hasNext=function(){return this.current.valueOf()<=this._end.valueOf()},TimeStep.prototype.next=function(){var t=this.current.valueOf();if(6>this.current.getMonth())switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case TimeStep.SCALE.SECOND:this.current=new Date(this.current.valueOf()+1e3*this.step);break;case TimeStep.SCALE.MINUTE:this.current=new Date(this.current.valueOf()+60*1e3*this.step);break;case TimeStep.SCALE.HOUR:this.current=new Date(this.current.valueOf()+60*60*1e3*this.step);var e=this.current.getHours();this.current.setHours(e-e%this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:}else switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case TimeStep.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()+this.step);break;case TimeStep.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()+this.step);break;case TimeStep.SCALE.HOUR:this.current.setHours(this.current.getHours()+this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:}if(1!=this.step)switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current.getMilliseconds()0&&(this.step=e),this.autoScale=!1},TimeStep.prototype.setAutoScale=function(t){this.autoScale=t},TimeStep.prototype.setMinimumStep=function(t){if(void 0!=t){var e=31104e6,i=2592e6,n=864e5,o=36e5,r=6e4,s=1e3,a=1;1e3*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=1e3),500*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=500),100*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=100),50*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=50),10*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=10),5*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=5),e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=1),3*i>t&&(this.scale=TimeStep.SCALE.MONTH,this.step=3),i>t&&(this.scale=TimeStep.SCALE.MONTH,this.step=1),5*n>t&&(this.scale=TimeStep.SCALE.DAY,this.step=5),2*n>t&&(this.scale=TimeStep.SCALE.DAY,this.step=2),n>t&&(this.scale=TimeStep.SCALE.DAY,this.step=1),n/2>t&&(this.scale=TimeStep.SCALE.WEEKDAY,this.step=1),4*o>t&&(this.scale=TimeStep.SCALE.HOUR,this.step=4),o>t&&(this.scale=TimeStep.SCALE.HOUR,this.step=1),15*r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=15),10*r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=10),5*r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=5),r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=1),15*s>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=15),10*s>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=10),5*s>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=5),s>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=1),200*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=200),100*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=100),50*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=50),10*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=10),5*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=5),a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=1)}},TimeStep.prototype.snap=function(t){if(this.scale==TimeStep.SCALE.YEAR){var e=t.getFullYear()+Math.round(t.getMonth()/12);t.setFullYear(Math.round(e/this.step)*this.step),t.setMonth(0),t.setDate(0),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.MONTH)t.getDate()>15?(t.setDate(1),t.setMonth(t.getMonth()+1)):t.setDate(1),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0);else if(this.scale==TimeStep.SCALE.DAY||this.scale==TimeStep.SCALE.WEEKDAY){switch(this.step){case 5:case 2:t.setHours(24*Math.round(t.getHours()/24));break;default:t.setHours(12*Math.round(t.getHours()/12))}t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.HOUR){switch(this.step){case 4:t.setMinutes(60*Math.round(t.getMinutes()/60));break;default:t.setMinutes(30*Math.round(t.getMinutes()/30))}t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.MINUTE){switch(this.step){case 15:case 10:t.setMinutes(5*Math.round(t.getMinutes()/5)),t.setSeconds(0);break;case 5:t.setSeconds(60*Math.round(t.getSeconds()/60));break;default:t.setSeconds(30*Math.round(t.getSeconds()/30))}t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.SECOND)switch(this.step){case 15:case 10:t.setSeconds(5*Math.round(t.getSeconds()/5)),t.setMilliseconds(0);break;case 5:t.setMilliseconds(1e3*Math.round(t.getMilliseconds()/1e3));break;default:t.setMilliseconds(500*Math.round(t.getMilliseconds()/500))}else if(this.scale==TimeStep.SCALE.MILLISECOND){var i=this.step>5?this.step/2:1;t.setMilliseconds(Math.round(t.getMilliseconds()/i)*i)}},TimeStep.prototype.isMajor=function(){switch(this.scale){case TimeStep.SCALE.MILLISECOND:return 0==this.current.getMilliseconds();case TimeStep.SCALE.SECOND:return 0==this.current.getSeconds();case TimeStep.SCALE.MINUTE:return 0==this.current.getHours()&&0==this.current.getMinutes();case TimeStep.SCALE.HOUR:return 0==this.current.getHours();case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:return 1==this.current.getDate();case TimeStep.SCALE.MONTH:return 0==this.current.getMonth();case TimeStep.SCALE.YEAR:return!1;default:return!1}},TimeStep.prototype.getLabelMinor=function(t){switch(void 0==t&&(t=this.current),this.scale){case TimeStep.SCALE.MILLISECOND:return moment(t).format("SSS");case TimeStep.SCALE.SECOND:return moment(t).format("s");case TimeStep.SCALE.MINUTE:return moment(t).format("HH:mm");case TimeStep.SCALE.HOUR:return moment(t).format("HH:mm");case TimeStep.SCALE.WEEKDAY:return moment(t).format("ddd D");case TimeStep.SCALE.DAY:return moment(t).format("D");case TimeStep.SCALE.MONTH:return moment(t).format("MMM");case TimeStep.SCALE.YEAR:return moment(t).format("YYYY");default:return""}},TimeStep.prototype.getLabelMajor=function(t){switch(void 0==t&&(t=this.current),this.scale){case TimeStep.SCALE.MILLISECOND:return moment(t).format("HH:mm:ss");case TimeStep.SCALE.SECOND:return moment(t).format("D MMMM HH:mm");case TimeStep.SCALE.MINUTE:case TimeStep.SCALE.HOUR:return moment(t).format("ddd D MMMM");case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:return moment(t).format("MMMM YYYY");case TimeStep.SCALE.MONTH:return moment(t).format("YYYY");case TimeStep.SCALE.YEAR:return"";default:return""}},DataSet.prototype.subscribe=function(t,e,i){var n=this.subscribers[t];n||(n=[],this.subscribers[t]=n),n.push({id:i?i+"":null,callback:e})},DataSet.prototype.unsubscribe=function(t,e){var i=this.subscribers[t];i&&(this.subscribers[t]=i.filter(function(t){return t.callback!=e}))},DataSet.prototype._trigger=function(t,e,i){if("*"==t)throw Error("Cannot trigger event *");var n=[];t in this.subscribers&&(n=n.concat(this.subscribers[t])),"*"in this.subscribers&&(n=n.concat(this.subscribers["*"])),n.forEach(function(n){n.id!=i&&n.callback&&n.callback(t,e,i||null)})},DataSet.prototype.add=function(t,e){var i,n=[],o=this;if(t instanceof Array)t.forEach(function(t){var e=o._addItem(t);n.push(e)});else if(util.isDataTable(t))for(var r=this._getColumnNames(t),s=0,a=t.getNumberOfRows();a>s;s++){var h={};r.forEach(function(e,i){h[e]=t.getValue(s,i)}),i=o._addItem(h),n.push(i)}else{if(!(t instanceof Object))throw Error("Unknown dataType");i=o._addItem(t),n.push(i)}this._trigger("add",{items:n},e)},DataSet.prototype.update=function(t,e){var i,n=[],o=this;if(t instanceof Array)t.forEach(function(t){var e=o._updateItem(t);n.push(e)});else if(util.isDataTable(t))for(var r=this._getColumnNames(t),s=0,a=t.getNumberOfRows();a>s;s++){var h={};r.forEach(function(e,i){h[e]=t.getValue(s,i)}),i=o._updateItem(h),n.push(i)}else{if(!(t instanceof Object))throw Error("Unknown dataType");i=o._updateItem(t),n.push(i)}this._trigger("update",{items:n},e)},DataSet.prototype.get=function(t,e,i){var n=this;"Object"==util.getType(t)&&(i=e,e=t,t=void 0);var o={};this.options&&this.options.fieldTypes&&util.forEach(this.options.fieldTypes,function(t,e){o[e]=t}),e&&e.fieldTypes&&util.forEach(e.fieldTypes,function(t,e){o[e]=t});var r,s=e?e.fields:void 0;if(e&&e.type){if(r="DataTable"==e.type?"DataTable":"Array",i&&r!=util.getType(i))throw Error('Type of parameter "data" ('+util.getType(i)+") "+"does not correspond with specified options.type ("+e.type+")");if("DataTable"==r&&!util.isDataTable(i))throw Error('Parameter "data" must be a DataTable when options.type is "DataTable"')}else r=i?"DataTable"==util.getType(i)?"DataTable":"Array":"Array";if("DataTable"==r){var a=this._getColumnNames(i);if(void 0==t)util.forEach(this.data,function(t){n._appendRow(i,a,n._castItem(t))});else if(util.isNumber(t)||util.isString(t)){var h=n._castItem(n.data[t],o,s);this._appendRow(i,a,h)}else{if(!(t instanceof Array))throw new TypeError('Parameter "ids" must be undefined, a String, Number, or Array');t.forEach(function(t){var e=n._castItem(n.data[t],o,s);n._appendRow(i,a,e)})}}else if(i=i||[],void 0==t)util.forEach(this.data,function(t){i.push(n._castItem(t,o,s))});else{if(util.isNumber(t)||util.isString(t))return this._castItem(n.data[t],o,s);if(!(t instanceof Array))throw new TypeError('Parameter "ids" must be undefined, a String, Number, or Array');t.forEach(function(t){i.push(n._castItem(n.data[t],o,s))})}return i},DataSet.prototype.remove=function(t,e){var i=[],n=this;if(util.isNumber(t)||util.isString(t))delete this.data[t],delete this.internalIds[t],i.push(t);else if(t instanceof Array)t.forEach(function(t){n.remove(t)}),i=i.concat(t);else if(t instanceof Object)for(var o in this.data)this.data.hasOwnProperty(o)&&this.data[o]==t&&(delete this.data[o],delete this.internalIds[o],i.push(o));this._trigger("remove",{items:i},e)},DataSet.prototype.clear=function(t){var e=Object.keys(this.data);this.data={},this.internalIds={},this._trigger("remove",{items:e},t)},DataSet.prototype.max=function(t){var e=this.data,i=Object.keys(e),n=null,o=null;return i.forEach(function(i){var r=e[i],s=r[t];null!=s&&(!n||s>o)&&(n=r,o=s)}),n},DataSet.prototype.min=function(t){var e=this.data,i=Object.keys(e),n=null,o=null;return i.forEach(function(i){var r=e[i],s=r[t];null!=s&&(!n||o>s)&&(n=r,o=s)}),n},DataSet.prototype._addItem=function(t){var e=t[this.fieldId];void 0==e&&(e=util.randomUUID(),t[this.fieldId]=e,this.internalIds[e]=t);var i={};for(var n in t)if(t.hasOwnProperty(n)){var o=this.fieldTypes[n];i[n]=util.cast(t[n],o)}return this.data[e]=i,e},DataSet.prototype._castItem=function(t,e,i){var n,o=this.fieldId,r=this.internalIds;return t?(n={},e=e||{},i?util.forEach(t,function(t,o){-1!=i.indexOf(o)&&(n[o]=util.cast(t,e[o]))}):util.forEach(t,function(t,i){i==o&&t in r||(n[i]=util.cast(t,e[i]))})):n=null,n},DataSet.prototype._updateItem=function(t){var e=t[this.fieldId];if(void 0==e)throw Error("Item has no id (item: "+JSON.stringify(t)+")");var i=this.data[e];if(i){for(var n in t)if(t.hasOwnProperty(n)){var o=this.fieldTypes[n];i[n]=util.cast(t[n],o)}}else this._addItem(t);return e},DataSet.prototype._getColumnNames=function(t){for(var e=[],i=0,n=t.getNumberOfColumns();n>i;i++)e[i]=t.getColumnId(i)||t.getColumnLabel(i);return e},DataSet.prototype._appendRow=function(t,e,i){var n=t.addRow();e.forEach(function(e,o){t.setValue(n,o,i[e])})},Stack.prototype.setOptions=function(t){util.extend(this.options,t)},Stack.prototype.update=function(){this._order(),this._stack()},Stack.prototype._order=function(){var t=this.parent.items;if(!t)throw Error("Cannot stack items: parent does not contain items");var e=[],i=0;util.forEach(t,function(t){e[i]=t,i++});var n=this.options.order;if("function"!=typeof this.options.order)throw Error("Option order must be a function");e.sort(n),this.ordered=e},Stack.prototype._stack=function(){var t,e,i=this.ordered,n=this.options,o="top"==n.orientation,r=n.margin&&n.margin.item||0;for(t=0,e=i.length;e>t;t++){var s=i[t],a=null;do a=this.checkOverlap(i,t,0,t-1,r),null!=a&&(s.top=o?a.top+a.height+r:a.top-s.height-r);while(a)}},Stack.prototype.checkOverlap=function(t,e,i,n,o){for(var r=this.collision,s=t[e],a=n;a>=i;a--){var h=t[a];if(r(s,h,o)&&a!=e)return h}return null},Stack.prototype.collision=function(t,e,i){return t.left-ie.left&&t.top-ie.top},Range.prototype.setOptions=function(t){util.extend(this.options,t),(null!=t.start||null!=t.end)&&this.setRange(t.start,t.end)},Range.prototype.subscribe=function(t,e,i){var n,o=this;if("horizontal"!=i&&"vertical"!=i)throw new TypeError('Unknown direction "'+i+'". '+'Choose "horizontal" or "vertical".');if("move"==e)n={component:t,event:e,direction:i,callback:function(t){o._onMouseDown(t,n)},params:{}},t.on("mousedown",n.callback),o.listeners.push(n);else{if("zoom"!=e)throw new TypeError('Unknown event "'+e+'". '+'Choose "move" or "zoom".');n={component:t,event:e,direction:i,callback:function(t){o._onMouseWheel(t,n)},params:{}},t.on("mousewheel",n.callback),o.listeners.push(n)}},Range.prototype.on=function(t,e){events.addListener(this,t,e)},Range.prototype._trigger=function(t){events.trigger(this,t,{start:this.start,end:this.end})},Range.prototype.setRange=function(t,e){var i=this._applyRange(t,e);i&&(this._trigger("rangechange"),this._trigger("rangechanged"))},Range.prototype._applyRange=function(t,e){var i,n=null!=t?util.cast(t,"Number"):this.start,o=null!=e?util.cast(e,"Number"):this.end;if(isNaN(n))throw Error('Invalid start "'+t+'"');if(isNaN(o))throw Error('Invalid end "'+e+'"');if(n>o&&(o=n),null!=this.options.min){var r=this.options.min.valueOf();r>n&&(i=r-n,n+=i,o+=i)}if(null!=this.options.max){var s=this.options.max.valueOf();o>s&&(i=o-s,n-=i,o-=i)}if(null!=this.options.zoomMin){var a=this.options.zoomMin.valueOf();0>a&&(a=0),a>o-n&&(this.end-this.start>a?(i=a-(o-n),n-=i/2,o+=i/2):(n=this.start,o=this.end))}if(null!=this.options.zoomMax){var h=this.options.zoomMax.valueOf();0>h&&(h=0),o-n>h&&(h>this.end-this.start?(i=o-n-h,n+=i/2,o-=i/2):(n=this.start,o=this.end))}var u=this.start!=n||this.end!=o;return this.start=n,this.end=o,u},Range.prototype.getRange=function(){return{start:this.start,end:this.end}},Range.prototype.conversion=function(t){return this.start,this.end,Range.conversion(this.start,this.end,t)},Range.conversion=function(t,e,i){return 0!=i&&0!=e-t?{offset:t,factor:i/(e-t)}:{offset:0,factor:1}},Range.prototype._onMouseDown=function(t,e){t=t||window.event;var i=e.params,n=t.which?1==t.which:1==t.button;if(n){i.mouseX=util.getPageX(t),i.mouseY=util.getPageY(t),i.previousLeft=0,i.previousOffset=0,i.moved=!1,i.start=this.start,i.end=this.end;var o=e.component.frame;o&&(o.style.cursor="move");var r=this;i.onMouseMove||(i.onMouseMove=function(t){r._onMouseMove(t,e)},util.addEventListener(document,"mousemove",i.onMouseMove)),i.onMouseUp||(i.onMouseUp=function(t){r._onMouseUp(t,e)},util.addEventListener(document,"mouseup",i.onMouseUp)),util.preventDefault(t)}},Range.prototype._onMouseMove=function(t,e){t=t||window.event;var i=e.params,n=util.getPageX(t),o=util.getPageY(t);void 0==i.mouseX&&(i.mouseX=n),void 0==i.mouseY&&(i.mouseY=o);var r=n-i.mouseX,s=o-i.mouseY,a="horizontal"==e.direction?r:s;Math.abs(a)>=1&&(i.moved=!0);var h=i.end-i.start,u="horizontal"==e.direction?e.component.width:e.component.height,l=-a/u*h;this._applyRange(i.start+l,i.end+l),this._trigger("rangechange"),util.preventDefault(t)},Range.prototype._onMouseUp=function(t,e){t=t||window.event;var i=e.params;e.component.frame&&(e.component.frame.style.cursor="auto"),i.onMouseMove&&(util.removeEventListener(document,"mousemove",i.onMouseMove),i.onMouseMove=null),i.onMouseUp&&(util.removeEventListener(document,"mouseup",i.onMouseUp),i.onMouseUp=null),i.moved&&this._trigger("rangechanged")},Range.prototype._onMouseWheel=function(t,e){t=t||window.event;var i=0;if(t.wheelDelta?i=t.wheelDelta/120:t.detail&&(i=-t.detail/3),i){var n=this,o=function(){var o=i/5,r=null,s=e.component.frame;if(s){var a,h;if("horizontal"==e.direction){a=e.component.width,h=n.conversion(a);var u=util.getAbsoluteLeft(s),l=util.getPageX(t);r=(l-u)/h.factor+h.offset}else{a=e.component.height,h=n.conversion(a);var c=util.getAbsoluteTop(s),p=util.getPageY(t);r=(c+a-p-c)/h.factor+h.offset}}n.zoom(o,r)};o()}util.preventDefault(t)},Range.prototype.zoom=function(t,e){null==e&&(e=(this.start+this.end)/2),t>=1&&(t=.9),-1>=t&&(t=-.9),0>t&&(t/=1+t);var i=this.start-e,n=this.end-e,o=this.start-i*t,r=this.end-n*t;this.setRange(o,r)},Range.prototype.move=function(t){var e=this.end-this.start,i=this.start+e*t,n=this.end+e*t;this.start=i,this.end=n},Controller.prototype.add=function(t){if(void 0==t.id)throw Error("Component has no field id");if(!(t instanceof Component||t instanceof Controller))throw new TypeError("Component must be an instance of prototype Component or Controller");t.controller=this,this.components[t.id]=t},Controller.prototype.requestReflow=function(){if(!this.reflowTimer){var t=this;this.reflowTimer=setTimeout(function(){t.reflowTimer=void 0,t.reflow()},0)}},Controller.prototype.requestRepaint=function(){if(!this.repaintTimer){var t=this;this.repaintTimer=setTimeout(function(){t.repaintTimer=void 0,t.repaint()},0)}},Controller.prototype.repaint=function(){function t(n,o){o in i||(n.depends&&n.depends.forEach(function(e){t(e,e.id)}),n.parent&&t(n.parent,n.parent.id),e=n.repaint()||e,i[o]=!0)}var e=!1;this.repaintTimer&&(clearTimeout(this.repaintTimer),this.repaintTimer=void 0);var i={};util.forEach(this.components,t),e&&this.reflow()},Controller.prototype.reflow=function(){function t(n,o){o in i||(n.depends&&n.depends.forEach(function(e){t(e,e.id)}),n.parent&&t(n.parent,n.parent.id),e=n.reflow()||e,i[o]=!0)}var e=!1;this.reflowTimer&&(clearTimeout(this.reflowTimer),this.reflowTimer=void 0);var i={};util.forEach(this.components,t),e&&this.repaint()};var loadCss=function(t){var e=document.getElementsByTagName("script");e[e.length-1].src.split("?")[0];var i=document.createElement("style");i.type="text/css",i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(i)};Component.prototype.setOptions=function(t){t&&util.extend(this.options,t),this.controller&&(this.requestRepaint(),this.requestReflow()) -},Component.prototype.getContainer=function(){return null},Component.prototype.getFrame=function(){return this.frame},Component.prototype.repaint=function(){return!1},Component.prototype.reflow=function(){return!1},Component.prototype.requestRepaint=function(){if(!this.controller)throw Error("Cannot request a repaint: no controller configured");this.controller.requestRepaint()},Component.prototype.requestReflow=function(){if(!this.controller)throw Error("Cannot request a reflow: no controller configured");this.controller.requestReflow()},Component.prototype.on=function(t,e){if(!this.parent)throw Error("Cannot attach event: no root panel found");this.parent.on(t,e)},Panel.prototype=new Component,Panel.prototype.getContainer=function(){return this.frame},Panel.prototype.repaint=function(){var t=0,e=util.updateProperty,i=util.option.asSize,n=this.options,o=this.frame;if(o||(o=document.createElement("div"),o.className="panel",n.className&&("function"==typeof n.className?util.addClassName(o,n.className()+""):util.addClassName(o,n.className+"")),this.frame=o,t+=1),!o.parentNode){if(!this.parent)throw Error("Cannot repaint panel: no parent attached");var r=this.parent.getContainer();if(!r)throw Error("Cannot repaint panel: parent has no container element");r.appendChild(o),t+=1}return t+=e(o.style,"top",i(n.top,"0px")),t+=e(o.style,"left",i(n.left,"0px")),t+=e(o.style,"width",i(n.width,"100%")),t+=e(o.style,"height",i(n.height,"100%")),t>0},Panel.prototype.reflow=function(){var t=0,e=util.updateProperty,i=this.frame;return i?(t+=e(this,"top",i.offsetTop),t+=e(this,"left",i.offsetLeft),t+=e(this,"width",i.offsetWidth),t+=e(this,"height",i.offsetHeight)):t+=1,t>0},RootPanel.prototype=new Panel,RootPanel.prototype.setOptions=function(t){util.extend(this.options,t),this.options.autoResize?this._watch():this._unwatch()},RootPanel.prototype.repaint=function(){var t=0,e=util.updateProperty,i=util.option.asSize,n=this.options,o=this.frame;if(o||(o=document.createElement("div"),o.className="graph panel",n.className&&util.addClassName(o,util.option.asString(n.className)),this.frame=o,t+=1),!o.parentNode){if(!this.container)throw Error("Cannot repaint root panel: no container attached");this.container.appendChild(o),t+=1}return t+=e(o.style,"top",i(n.top,"0px")),t+=e(o.style,"left",i(n.left,"0px")),t+=e(o.style,"width",i(n.width,"100%")),t+=e(o.style,"height",i(n.height,"100%")),this._updateEventEmitters(),t>0},RootPanel.prototype.reflow=function(){var t=0,e=util.updateProperty,i=this.frame;return i?(t+=e(this,"top",i.offsetTop),t+=e(this,"left",i.offsetLeft),t+=e(this,"width",i.offsetWidth),t+=e(this,"height",i.offsetHeight)):t+=1,t>0},RootPanel.prototype._watch=function(){var t=this;this._unwatch();var e=function(){return t.options.autoResize?(t.frame&&(t.frame.clientWidth!=t.width||t.frame.clientHeight!=t.height)&&t.requestReflow(),void 0):(t._unwatch(),void 0)};util.addEventListener(window,"resize",e),this.watchTimer=setInterval(e,1e3)},RootPanel.prototype._unwatch=function(){this.watchTimer&&(clearInterval(this.watchTimer),this.watchTimer=void 0)},RootPanel.prototype.on=function(t,e){var i=this.listeners[t];i||(i=[],this.listeners[t]=i),i.push(e),this._updateEventEmitters()},RootPanel.prototype._updateEventEmitters=function(){if(this.listeners){var t=this;util.forEach(this.listeners,function(e,i){if(t.emitters||(t.emitters={}),!(i in t.emitters)){var n=t.frame;if(n){var o=function(t){e.forEach(function(e){e(t)})};t.emitters[i]=o,util.addEventListener(n,i,o)}}})}},TimeAxis.prototype=new Component,TimeAxis.prototype.setOptions=function(t){util.extend(this.options,t)},TimeAxis.prototype.setRange=function(t){if(!(t instanceof Range||t&&t.start&&t.end))throw new TypeError("Range must be an instance of Range, or an object containing start and end.");this.range=t},TimeAxis.prototype.toTime=function(t){var e=this.conversion;return new Date(t/e.factor+e.offset)},TimeAxis.prototype.toScreen=function(t){var e=this.conversion;return(t.valueOf()-e.offset)*e.factor},TimeAxis.prototype.repaint=function(){var t=0,e=util.updateProperty,i=util.option.asSize,n=this.options,o=this.props,r=this.step,s=this.frame;if(s||(s=document.createElement("div"),this.frame=s,t+=1),s.className="axis "+n.orientation,!s.parentNode){if(!this.parent)throw Error("Cannot repaint time axis: no parent attached");var a=this.parent.getContainer();if(!a)throw Error("Cannot repaint time axis: parent has no container element");a.appendChild(s),t+=1}var h=s.parentNode;if(h){var u=s.nextSibling;h.removeChild(s);var l=n.orientation,c="bottom"==l&&this.props.parentHeight&&this.height?this.props.parentHeight-this.height+"px":"0px";if(t+=e(s.style,"top",i(n.top,c)),t+=e(s.style,"left",i(n.left,"0px")),t+=e(s.style,"width",i(n.width,"100%")),t+=e(s.style,"height",i(n.height,this.height+"px")),this._repaintMeasureChars(),this.step){this._repaintStart(),r.first();for(var p=void 0,d=0;r.hasNext()&&1e3>d;){d++;var f=r.getCurrent(),m=this.toScreen(f),g=r.isMajor();n.showMinorLabels&&this._repaintMinorText(m,r.getLabelMinor()),g&&n.showMajorLabels?(m>0&&(void 0==p&&(p=m),this._repaintMajorText(m,r.getLabelMajor())),this._repaintMajorLine(m)):this._repaintMinorLine(m),r.next()}if(n.showMajorLabels){var v=this.toTime(0),y=r.getLabelMajor(v),S=y.length*(o.majorCharWidth||10)+10;(void 0==p||p>S)&&this._repaintMajorText(0,y)}this._repaintEnd()}this._repaintLine(),u?h.insertBefore(s,u):h.appendChild(s)}return t>0},TimeAxis.prototype._repaintStart=function(){var t=this.dom,e=t.redundant;e.majorLines=t.majorLines,e.majorTexts=t.majorTexts,e.minorLines=t.minorLines,e.minorTexts=t.minorTexts,t.majorLines=[],t.majorTexts=[],t.minorLines=[],t.minorTexts=[]},TimeAxis.prototype._repaintEnd=function(){util.forEach(this.dom.redundant,function(t){for(;t.length;){var e=t.pop();e&&e.parentNode&&e.parentNode.removeChild(e)}})},TimeAxis.prototype._repaintMinorText=function(t,e){var i=this.dom.redundant.minorTexts.shift();if(!i){var n=document.createTextNode("");i=document.createElement("div"),i.appendChild(n),i.className="text minor",this.frame.appendChild(i)}this.dom.minorTexts.push(i),i.childNodes[0].nodeValue=e,i.style.left=t+"px",i.style.top=this.props.minorLabelTop+"px"},TimeAxis.prototype._repaintMajorText=function(t,e){var i=this.dom.redundant.majorTexts.shift();if(!i){var n=document.createTextNode(e);i=document.createElement("div"),i.className="text major",i.appendChild(n),this.frame.appendChild(i)}this.dom.majorTexts.push(i),i.childNodes[0].nodeValue=e,i.style.top=this.props.majorLabelTop+"px",i.style.left=t+"px"},TimeAxis.prototype._repaintMinorLine=function(t){var e=this.dom.redundant.minorLines.shift();e||(e=document.createElement("div"),e.className="grid vertical minor",this.frame.appendChild(e)),this.dom.minorLines.push(e);var i=this.props;e.style.top=i.minorLineTop+"px",e.style.height=i.minorLineHeight+"px",e.style.left=t-i.minorLineWidth/2+"px"},TimeAxis.prototype._repaintMajorLine=function(t){var e=this.dom.redundant.majorLines.shift();e||(e=document.createElement("DIV"),e.className="grid vertical major",this.frame.appendChild(e)),this.dom.majorLines.push(e);var i=this.props;e.style.top=i.majorLineTop+"px",e.style.left=t-i.majorLineWidth/2+"px",e.style.height=i.majorLineHeight+"px"},TimeAxis.prototype._repaintLine=function(){var t=this.dom.line,e=this.frame,i=this.options;i.showMinorLabels||i.showMajorLabels?(t?(e.removeChild(t),e.appendChild(t)):(t=document.createElement("div"),t.className="grid horizontal major",e.appendChild(t),this.dom.line=t),t.style.top=this.props.lineTop+"px"):t&&axis.parentElement&&(e.removeChild(axis.line),delete this.dom.line)},TimeAxis.prototype._repaintMeasureChars=function(){var t,e=this.dom;if(!e.characterMinor){t=document.createTextNode("0");var i=document.createElement("DIV");i.className="text minor measure",i.appendChild(t),this.frame.appendChild(i),e.measureCharMinor=i}if(!e.characterMajor){t=document.createTextNode("0");var n=document.createElement("DIV");n.className="text major measure",n.appendChild(t),this.frame.appendChild(n),e.measureCharMajor=n}},TimeAxis.prototype.reflow=function(){var t=0,e=util.updateProperty,i=this.frame,n=this.range;if(!n)throw Error("Cannot repaint time axis: no range configured");if(i){t+=e(this,"top",i.offsetTop),t+=e(this,"left",i.offsetLeft);var o=this.props,r=this.options.showMinorLabels,s=this.options.showMajorLabels,a=this.dom.measureCharMinor,h=this.dom.measureCharMajor;a&&(o.minorCharHeight=a.clientHeight,o.minorCharWidth=a.clientWidth),h&&(o.majorCharHeight=h.clientHeight,o.majorCharWidth=h.clientWidth);var u=i.parentNode?i.parentNode.offsetHeight:0;switch(u!=o.parentHeight&&(o.parentHeight=u,t+=1),this.options.orientation){case"bottom":o.minorLabelHeight=r?o.minorCharHeight:0,o.majorLabelHeight=s?o.majorCharHeight:0,o.minorLabelTop=0,o.majorLabelTop=o.minorLabelTop+o.minorLabelHeight,o.minorLineTop=-this.top,o.minorLineHeight=Math.max(this.top+o.majorLabelHeight,0),o.minorLineWidth=1,o.majorLineTop=-this.top,o.majorLineHeight=Math.max(this.top+o.minorLabelHeight+o.majorLabelHeight,0),o.majorLineWidth=1,o.lineTop=0;break;case"top":o.minorLabelHeight=r?o.minorCharHeight:0,o.majorLabelHeight=s?o.majorCharHeight:0,o.majorLabelTop=0,o.minorLabelTop=o.majorLabelTop+o.majorLabelHeight,o.minorLineTop=o.minorLabelTop,o.minorLineHeight=Math.max(u-o.majorLabelHeight-this.top),o.minorLineWidth=1,o.majorLineTop=0,o.majorLineHeight=Math.max(u-this.top),o.majorLineWidth=1,o.lineTop=o.majorLabelHeight+o.minorLabelHeight;break;default:throw Error('Unkown orientation "'+this.options.orientation+'"')}var l=o.minorLabelHeight+o.majorLabelHeight;t+=e(this,"width",i.offsetWidth),t+=e(this,"height",l),this._updateConversion();var c=util.cast(n.start,"Date"),p=util.cast(n.end,"Date"),d=this.toTime(5*(o.minorCharWidth||10))-this.toTime(0);this.step=new TimeStep(c,p,d),t+=e(o.range,"start",c.valueOf()),t+=e(o.range,"end",p.valueOf()),t+=e(o.range,"minimumStep",d.valueOf())}return t>0},TimeAxis.prototype._updateConversion=function(){var t=this.range;if(!t)throw Error("No range configured");this.conversion=t.conversion?t.conversion(this.width):Range.conversion(t.start,t.end,this.width)},ItemSet.prototype=new Panel,ItemSet.prototype.setOptions=function(t){util.extend(this.options,t),this.stack.setOptions(this.options)},ItemSet.prototype.setRange=function(t){if(!(t instanceof Range||t&&t.start&&t.end))throw new TypeError("Range must be an instance of Range, or an object containing start and end.");this.range=t},ItemSet.prototype.repaint=function(){var t=0,e=util.updateProperty,i=util.option.asSize,n=this.options,o=this.frame;if(o||(o=document.createElement("div"),o.className="itemset",n.className&&util.addClassName(o,util.option.asString(n.className)),this.frame=o,t+=1),!o.parentNode){if(!this.parent)throw Error("Cannot repaint itemset: no parent attached");var r=this.parent.getContainer();if(!r)throw Error("Cannot repaint itemset: parent has no container element");r.appendChild(o),t+=1}t+=e(o.style,"height",i(n.height,this.height+"px")),t+=e(o.style,"top",i(n.top,"0px")),t+=e(o.style,"left",i(n.left,"0px")),t+=e(o.style,"width",i(n.width,"100%")),this._updateConversion();var s=this,a=this.queue,h=this.data,u=this.items,l={fields:["id","start","end","content","type"]};return Object.keys(a).forEach(function(e){var i=a[e],o=i.item;switch(i.action){case"add":case"update":var r=h.get(e,l),c=r.type||r.start&&r.end&&"range"||"box",p=itemTypes[c];if(o&&(p&&o instanceof p?(o.data=r,t+=o.repaint()):(o.visible=!1,t+=o.repaint(),o=null)),!o){if(!p)throw new TypeError('Unknown item type "'+c+'"');o=new p(s,r,n),t+=o.repaint()}u[e]=o,delete a[e];break;case"remove":o&&(o.visible=!1,t+=o.repaint()),delete u[e],delete a[e];break;default:console.log('Error: unknown action "'+i.action+'"')}}),util.forEach(this.items,function(t){t.reposition()}),t>0},ItemSet.prototype.reflow=function(){var t=0,e=this.options,i=util.updateProperty,n=this.frame;if(n){if(this._updateConversion(),util.forEach(this.items,function(e){t+=e.reflow()}),this.stack.update(),null!=e.height)t+=i(this,"height",n.offsetHeight);else{var o=this.height,r=0;"top"==e.orientation?util.forEach(this.items,function(t){r=Math.max(r,t.top+t.height)}):util.forEach(this.items,function(t){r=Math.max(r,o-t.top)}),t+=i(this,"height",r+e.margin.axis)}t+=i(this,"top",n.offsetTop),t+=i(this,"left",n.offsetLeft),t+=i(this,"width",n.offsetWidth)}else t+=1;return t>0},ItemSet.prototype.setData=function(t){var e=this.data;e&&util.forEach(this.listeners,function(t,i){e.unsubscribe(i,t)}),t instanceof DataSet?this.data=t:(this.data=new DataSet({fieldTypes:{start:"Date",end:"Date"}}),this.data.add(t));var i=this.id,n=this;util.forEach(this.listeners,function(t,e){n.data.subscribe(e,t,i)});var o=this.data.get({filter:["id"]}),r=[];util.forEach(o,function(t,e){r[e]=t.id}),this._onAdd(r)},ItemSet.prototype.getDataRange=function(){var t=this.data,e=t.min("start");e=e?e.start.valueOf():null;var i=t.max("start"),n=t.max("end");i=i?i.start.valueOf():null,n=n?n.end.valueOf():null;var o=Math.max(i,n);return{min:new Date(e),max:new Date(o)}},ItemSet.prototype._onUpdate=function(t){this._toQueue(t,"update")},ItemSet.prototype._onAdd=function(t){this._toQueue(t,"add")},ItemSet.prototype._onRemove=function(t){this._toQueue(t,"remove")},ItemSet.prototype._toQueue=function(t,e){var i=this.items,n=this.queue;t.forEach(function(t){var o=n[t];o?o.action=e:n[t]={item:i[t]||null,action:e}}),this.controller&&this.requestRepaint()},ItemSet.prototype._updateConversion=function(){var t=this.range;if(!t)throw Error("No range configured");this.conversion=t.conversion?t.conversion(this.width):Range.conversion(t.start,t.end,this.width)},ItemSet.prototype.toTime=function(t){var e=this.conversion;return new Date(t/e.factor+e.offset)},ItemSet.prototype.toScreen=function(t){var e=this.conversion,i=(t.valueOf()-e.offset)*e.factor;return i},Item.prototype=new Component,Item.prototype.select=function(){this.selected=!0},Item.prototype.unselect=function(){this.selected=!1};var itemTypes={};ItemBox.prototype=new Item(null,null),itemTypes.box=ItemBox,ItemBox.prototype.select=function(){this.selected=!0},ItemBox.prototype.unselect=function(){this.selected=!1},ItemBox.prototype.repaint=function(){var t=!1,e=this.dom;if(this.visible){if(e||(this._create(),t=!0),e=this.dom){if(!this.options&&!this.parent)throw Error("Cannot repaint item: no parent attached");var i=this.parent.getContainer();if(!i)throw Error("Cannot repaint time axis: parent has no container element");if(e.box.parentNode||(i.appendChild(e.box),t=!0),e.line.parentNode||(i.appendChild(e.line),t=!0),e.dot.parentNode||(i.appendChild(e.dot),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var n=(this.data.className?" "+this.data.className:"")+(this.selected?" selected":"");this.className!=n&&(this.className=n,e.box.className="item box"+n,e.line.className="item line"+n,e.dot.className="item dot"+n,t=!0)}}else e&&(e.box.parentNode&&(e.box.parentNode.removeChild(e.box),t=!0),e.line.parentNode&&(e.line.parentNode.removeChild(e.line),t=!0),e.dot.parentNode&&(e.dot.parentNode.removeChild(e.dot),t=!0));return t},ItemBox.prototype.reflow=function(){if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);var t,e,i=util.updateProperty,n=this.dom,o=this.props,r=this.options,s=this.parent.toScreen(this.data.start),a=r&&r.align,h=r.orientation,u=0;if(n)if(u+=i(o.dot,"height",n.dot.offsetHeight),u+=i(o.dot,"width",n.dot.offsetWidth),u+=i(o.line,"width",n.line.offsetWidth),u+=i(o.line,"width",n.line.offsetWidth),u+=i(this,"width",n.box.offsetWidth),u+=i(this,"height",n.box.offsetHeight),e="right"==a?s-this.width:"left"==a?s:s-this.width/2,u+=i(this,"left",e),u+=i(o.line,"left",s-o.line.width/2),u+=i(o.dot,"left",s-o.dot.width/2),"top"==h)t=r.margin.axis,u+=i(this,"top",t),u+=i(o.line,"top",0),u+=i(o.line,"height",t),u+=i(o.dot,"top",-o.dot.height/2);else{var l=this.parent.height;t=l-this.height-r.margin.axis,u+=i(this,"top",t),u+=i(o.line,"top",t+this.height),u+=i(o.line,"height",Math.max(r.margin.axis,0)),u+=i(o.dot,"top",l-o.dot.height/2)}else u+=1;return u>0},ItemBox.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.box=document.createElement("DIV"),t.content=document.createElement("DIV"),t.content.className="content",t.box.appendChild(t.content),t.line=document.createElement("DIV"),t.line.className="line",t.dot=document.createElement("DIV"),t.dot.className="dot")},ItemBox.prototype.reposition=function(){var t=this.dom,e=this.props,i=this.options.orientation;if(t){var n=t.box,o=t.line,r=t.dot;n.style.left=this.left+"px",n.style.top=this.top+"px",o.style.left=e.line.left+"px","top"==i?(o.style.top="0px",o.style.height=this.top+"px"):(o.style.top=e.line.top+"px",o.style.top=this.top+this.height+"px",o.style.height=Math.max(e.dot.top-this.top-this.height,0)+"px"),r.style.left=e.dot.left+"px",r.style.top=e.dot.top+"px"}},ItemPoint.prototype=new Item(null,null),itemTypes.point=ItemPoint,ItemPoint.prototype.select=function(){this.selected=!0},ItemPoint.prototype.unselect=function(){this.selected=!1},ItemPoint.prototype.repaint=function(){var t=!1,e=this.dom;if(this.visible){if(e||(this._create(),t=!0),e=this.dom){if(!this.options&&!this.options.parent)throw Error("Cannot repaint item: no parent attached");var i=this.parent.getContainer();if(!i)throw Error("Cannot repaint time axis: parent has no container element");if(e.point.parentNode||(i.appendChild(e.point),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var n=(this.data.className?" "+this.data.className:"")+(this.selected?" selected":"");this.className!=n&&(this.className=n,e.point.className="item point"+n,t=!0)}}else e&&e.point.parentNode&&(e.point.parentNode.removeChild(e.point),t=!0);return t},ItemPoint.prototype.reflow=function(){if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);var t,e=util.updateProperty,i=this.dom,n=this.props,o=this.options,r=o.orientation,s=this.parent.toScreen(this.data.start),a=0;if(i){if(a+=e(this,"width",i.point.offsetWidth),a+=e(this,"height",i.point.offsetHeight),a+=e(n.dot,"width",i.dot.offsetWidth),a+=e(n.dot,"height",i.dot.offsetHeight),a+=e(n.content,"height",i.content.offsetHeight),"top"==r)t=o.margin.axis;else{var h=this.parent.height;t=Math.max(h-this.height-o.margin.axis,0)}a+=e(this,"top",t),a+=e(this,"left",s-n.dot.width/2),a+=e(n.content,"marginLeft",1.5*n.dot.width),a+=e(n.dot,"top",(this.height-n.dot.height)/2)}else a+=1;return a>0},ItemPoint.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.point=document.createElement("div"),t.content=document.createElement("div"),t.content.className="content",t.point.appendChild(t.content),t.dot=document.createElement("div"),t.dot.className="dot",t.point.appendChild(t.dot))},ItemPoint.prototype.reposition=function(){var t=this.dom,e=this.props;t&&(t.point.style.top=this.top+"px",t.point.style.left=this.left+"px",t.content.style.marginLeft=e.content.marginLeft+"px",t.dot.style.top=e.dot.top+"px")},ItemRange.prototype=new Item(null,null),itemTypes.range=ItemRange,ItemRange.prototype.select=function(){this.selected=!0},ItemRange.prototype.unselect=function(){this.selected=!1},ItemRange.prototype.repaint=function(){var t=!1,e=this.dom;if(this.visible){if(e||(this._create(),t=!0),e=this.dom){if(!this.options&&!this.options.parent)throw Error("Cannot repaint item: no parent attached");var i=this.parent.getContainer();if(!i)throw Error("Cannot repaint time axis: parent has no container element");if(e.box.parentNode||(i.appendChild(e.box),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var n=this.data.className?""+this.data.className:"";this.className!=n&&(this.className=n,e.box.className="item range"+n,t=!0)}}else e&&e.box.parentNode&&(e.box.parentNode.removeChild(e.box),t=!0);return t},ItemRange.prototype.reflow=function(){if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);if(void 0==this.data.end)throw Error('Property "end" missing in item '+this.data.id);var t=this.dom,e=this.props,i=this.options,n=this.parent,o=n.toScreen(this.data.start),r=n.toScreen(this.data.end),s=0;if(t){var a,h,u=util.updateProperty,l=t.box,c=n.width,p=i.orientation;s+=u(e.content,"width",t.content.offsetWidth),s+=u(this,"height",l.offsetHeight),-c>o&&(o=-c),r>2*c&&(r=2*c),a=0>o?Math.min(-o,r-o-e.content.width-2*i.padding):0,s+=u(e.content,"left",a),"top"==p?(h=i.margin.axis,s+=u(this,"top",h)):(h=n.height-this.height-i.margin.axis,s+=u(this,"top",h)),s+=u(this,"left",o),s+=u(this,"width",Math.max(r-o,1))}else s+=1;return s>0},ItemRange.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.box=document.createElement("div"),t.content=document.createElement("div"),t.content.className="content",t.box.appendChild(t.content))},ItemRange.prototype.reposition=function(){var t=this.dom,e=this.props;t&&(t.box.style.top=this.top+"px",t.box.style.left=this.left+"px",t.box.style.width=this.width+"px",t.content.style.left=e.content.left+"px")},Timeline.prototype.setOptions=function(t){util.extend(this.options,t),this.timeaxis.setOptions(this.options),this.range.setOptions(this.options);var e,i=this;e="top"==this.options.orientation?function(){return i.timeaxis.height}:function(){return i.main.height-i.timeaxis.height-i.itemset.height},this.itemset.setOptions({orientation:this.options.orientation,top:e}),this.controller.repaint()},Timeline.prototype.setData=function(t){var e=this.itemset.data;if(e)this.itemset.setData(t);else{this.itemset.setData(t);var i=this.itemset.getDataRange(),n=i.min,o=i.max;if(null!=n&&null!=o){var r=o.valueOf()-n.valueOf();n=new Date(n.valueOf()-.05*r),o=new Date(o.valueOf()+.05*r)}(null!=n||null!=o)&&this.range.setRange(n,o)}},function(t){function e(t,e){return function(i){return h(t.call(this,i),e)}}function i(t){return function(e){return this.lang().ordinal(t.call(this,e))}}function n(){}function o(t){s(this,t)}function r(t){var e=this._data={},i=t.years||t.year||t.y||0,n=t.months||t.month||t.M||0,o=t.weeks||t.week||t.w||0,r=t.days||t.day||t.d||0,s=t.hours||t.hour||t.h||0,h=t.minutes||t.minute||t.m||0,u=t.seconds||t.second||t.s||0,l=t.milliseconds||t.millisecond||t.ms||0;this._milliseconds=l+1e3*u+6e4*h+36e5*s,this._days=r+7*o,this._months=n+12*i,e.milliseconds=l%1e3,u+=a(l/1e3),e.seconds=u%60,h+=a(u/60),e.minutes=h%60,s+=a(h/60),e.hours=s%24,r+=a(s/24),r+=7*o,e.days=r%30,n+=a(r/30),e.months=n%12,i+=a(n/12),e.years=i}function s(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function a(t){return 0>t?Math.ceil(t):Math.floor(t)}function h(t,e){for(var i=t+"";e>i.length;)i="0"+i;return i}function u(t,e,i){var n,o=e._milliseconds,r=e._days,s=e._months;o&&t._d.setTime(+t+o*i),r&&t.date(t.date()+r*i),s&&(n=t.date(),t.date(1).month(t.month()+s*i).date(Math.min(n,t.daysInMonth())))}function l(t){return"[object Array]"===Object.prototype.toString.call(t)}function c(t,e){var i,n=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),r=0;for(i=0;n>i;i++)~~t[i]!==~~e[i]&&r++;return r+o}function p(t,e){return e.abbr=t,k[t]||(k[t]=new n),k[t].set(e),k[t]}function d(t){return t?(!k[t]&&H&&require("./lang/"+t),k[t]):O.fn._lang}function f(t){return t.match(/\[.*\]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function m(t){var e,i,n=t.match(j);for(e=0,i=n.length;i>e;e++)n[e]=oe[n[e]]?oe[n[e]]:f(n[e]);return function(o){var r="";for(e=0;i>e;e++)r+="function"==typeof n[e].call?n[e].call(o,t):n[e];return r}}function g(t,e){function i(e){return t.lang().longDateFormat(e)||e}for(var n=5;n--&&P.test(e);)e=e.replace(P,i);return ee[e]||(ee[e]=m(e)),ee[e](t)}function v(t){switch(t){case"DDDD":return F;case"YYYY":return W;case"YYYYY":return B;case"S":case"SS":case"SSS":case"DDD":return z;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":case"a":case"A":return V;case"X":return X;case"Z":case"ZZ":return q;case"T":return Z;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return U;default:return RegExp(t.replace("\\",""))}}function y(t,e,i){var n,o=i._a;switch(t){case"M":case"MM":o[1]=null==e?0:~~e-1;break;case"MMM":case"MMMM":n=d(i._l).monthsParse(e),null!=n?o[1]=n:i._isValid=!1;break;case"D":case"DD":case"DDD":case"DDDD":null!=e&&(o[2]=~~e);break;case"YY":o[0]=~~e+(~~e>68?1900:2e3);break;case"YYYY":case"YYYYY":o[0]=~~e;break;case"a":case"A":i._isPm="pm"===(e+"").toLowerCase();break;case"H":case"HH":case"h":case"hh":o[3]=~~e;break;case"m":case"mm":o[4]=~~e;break;case"s":case"ss":o[5]=~~e;break;case"S":case"SS":case"SSS":o[6]=~~(1e3*("0."+e));break;case"X":i._d=new Date(1e3*parseFloat(e));break;case"Z":case"ZZ":i._useUTC=!0,n=(e+"").match(Q),n&&n[1]&&(i._tzh=~~n[1]),n&&n[2]&&(i._tzm=~~n[2]),n&&"+"===n[0]&&(i._tzh=-i._tzh,i._tzm=-i._tzm)}null==e&&(i._isValid=!1)}function S(t){var e,i,n=[];if(!t._d){for(e=0;7>e;e++)t._a[e]=n[e]=null==t._a[e]?2===e?1:0:t._a[e];n[3]+=t._tzh||0,n[4]+=t._tzm||0,i=new Date(0),t._useUTC?(i.setUTCFullYear(n[0],n[1],n[2]),i.setUTCHours(n[3],n[4],n[5],n[6])):(i.setFullYear(n[0],n[1],n[2]),i.setHours(n[3],n[4],n[5],n[6])),t._d=i}}function T(t){var e,i,n=t._f.match(j),o=t._i;for(t._a=[],e=0;n.length>e;e++)i=(v(n[e]).exec(o)||[])[0],i&&(o=o.slice(o.indexOf(i)+i.length)),oe[n[e]]&&y(n[e],i,t);t._isPm&&12>t._a[3]&&(t._a[3]+=12),t._isPm===!1&&12===t._a[3]&&(t._a[3]=0),S(t)}function w(t){for(var e,i,n,r,a=99;t._f.length;){if(e=s({},t),e._f=t._f.pop(),T(e),i=new o(e),i.isValid()){n=i;break}r=c(e._a,i.toArray()),a>r&&(a=r,n=i)}s(t,n)}function E(t){var e,i=t._i;if(K.exec(i)){for(t._f="YYYY-MM-DDT",e=0;4>e;e++)if($[e][1].exec(i)){t._f+=$[e][0];break}q.exec(i)&&(t._f+=" Z"),T(t)}else t._d=new Date(i)}function b(e){var i=e._i,n=R.exec(i);i===t?e._d=new Date:n?e._d=new Date(+n[1]):"string"==typeof i?E(e):l(i)?(e._a=i.slice(0),S(e)):e._d=i instanceof Date?new Date(+i):new Date(i)}function M(t,e,i,n,o){return o.relativeTime(e||1,!!i,t,n)}function D(t,e,i){var n=I(Math.abs(t)/1e3),o=I(n/60),r=I(o/60),s=I(r/24),a=I(s/365),h=45>n&&["s",n]||1===o&&["m"]||45>o&&["mm",o]||1===r&&["h"]||22>r&&["hh",r]||1===s&&["d"]||25>=s&&["dd",s]||45>=s&&["M"]||345>s&&["MM",I(s/30)]||1===a&&["y"]||["yy",a];return h[2]=e,h[3]=t>0,h[4]=i,M.apply({},h)}function _(t,e,i){var n=i-e,o=i-t.day();return o>n&&(o-=7),n-7>o&&(o+=7),Math.ceil(O(t).add("d",o).dayOfYear()/7)}function C(t){var e=t._i,i=t._f;return null===e||""===e?null:("string"==typeof e&&(t._i=e=d().preparse(e)),O.isMoment(e)?(t=s({},e),t._d=new Date(+e._d)):i?l(i)?w(t):T(t):b(t),new o(t))}function L(t,e){O.fn[t]=O.fn[t+"s"]=function(t){var i=this._isUTC?"UTC":"";return null!=t?(this._d["set"+i+e](t),this):this._d["get"+i+e]()}}function x(t){O.duration.fn[t]=function(){return this._data[t]}}function A(t,e){O.duration.fn["as"+t]=function(){return+this/e}}for(var O,N,Y="2.0.0",I=Math.round,k={},H="undefined"!=typeof module&&module.exports,R=/^\/?Date\((\-?\d+)/i,j=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,P=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,U=/\d\d?/,z=/\d{1,3}/,F=/\d{3}/,W=/\d{1,4}/,B=/[+\-]?\d{1,6}/,V=/[0-9]*[a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF]+\s*?[\u0600-\u06FF]+/i,q=/Z|[\+\-]\d\d:?\d\d/i,Z=/T/i,X=/[\+\-]?\d+(\.\d{1,3})?/,K=/^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,J="YYYY-MM-DDTHH:mm:ssZ",$=[["HH:mm:ss.S",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Q=/([\+\-]|\d\d)/gi,G="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"),te={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},ee={},ie="DDD w W M D d".split(" "),ne="M D H h m s w W".split(" "),oe={M:function(){return this.month()+1},MMM:function(t){return this.lang().monthsShort(this,t)},MMMM:function(t){return this.lang().months(this,t)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(t){return this.lang().weekdaysMin(this,t)},ddd:function(t){return this.lang().weekdaysShort(this,t)},dddd:function(t){return this.lang().weekdays(this,t)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return h(this.year()%100,2)},YYYY:function(){return h(this.year(),4)},YYYYY:function(){return h(this.year(),5)},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().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~~(this.milliseconds()/100)},SS:function(){return h(~~(this.milliseconds()/10),2)},SSS:function(){return h(this.milliseconds(),3)},Z:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+h(~~(t/60),2)+":"+h(~~t%60,2)},ZZ:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+h(~~(10*t/6),4)},X:function(){return this.unix()}};ie.length;)N=ie.pop(),oe[N+"o"]=i(oe[N]);for(;ne.length;)N=ne.pop(),oe[N+N]=e(oe[N],2);for(oe.DDDD=e(oe.DDD,3),n.prototype={set:function(t){var e,i;for(i in t)e=t[i],"function"==typeof e?this[i]=e:this["_"+i]=e},_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){var e,i,n;for(this._monthsParse||(this._monthsParse=[]),e=0;12>e;e++)if(this._monthsParse[e]||(i=O([2e3,e]),n="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[e]=RegExp(n.replace(".",""),"i")),this._monthsParse[e].test(t))return e},_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()]},_longDateFormat:{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},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){var i=this._calendar[t];return"function"==typeof i?i.apply(e):i},_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,n){var o=this._relativeTime[i];return"function"==typeof o?o(t,e,i,n):o.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",preparse:function(t){return t},postformat:function(t){return t},week:function(t){return _(t,this._week.dow,this._week.doy)},_week:{dow:0,doy:6}},O=function(t,e,i){return C({_i:t,_f:e,_l:i,_isUTC:!1})},O.utc=function(t,e,i){return C({_useUTC:!0,_isUTC:!0,_l:i,_i:t,_f:e})},O.unix=function(t){return O(1e3*t)},O.duration=function(t,e){var i,n=O.isDuration(t),o="number"==typeof t,s=n?t._data:o?{}:t;return o&&(e?s[e]=t:s.milliseconds=t),i=new r(s),n&&t.hasOwnProperty("_lang")&&(i._lang=t._lang),i},O.version=Y,O.defaultFormat=J,O.lang=function(e,i){return e?(i?p(e,i):k[e]||d(e),O.duration.fn._lang=O.fn._lang=d(e),t):O.fn._lang._abbr},O.langData=function(t){return t&&t._lang&&t._lang._abbr&&(t=t._lang._abbr),d(t)},O.isMoment=function(t){return t instanceof o},O.isDuration=function(t){return t instanceof r},O.fn=o.prototype={clone:function(){return O(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._d},toJSON:function(){return O.utc(this).format("YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var t=this;return[t.year(),t.month(),t.date(),t.hours(),t.minutes(),t.seconds(),t.milliseconds()]},isValid:function(){return null==this._isValid&&(this._isValid=this._a?!c(this._a,(this._isUTC?O.utc(this._a):O(this._a)).toArray()):!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(t){var e=g(this,t||O.defaultFormat);return this.lang().postformat(e)},add:function(t,e){var i;return i="string"==typeof t?O.duration(+e,t):O.duration(t,e),u(this,i,1),this},subtract:function(t,e){var i;return i="string"==typeof t?O.duration(+e,t):O.duration(t,e),u(this,i,-1),this},diff:function(t,e,i){var n,o,r=this._isUTC?O(t).utc():O(t).local(),s=6e4*(this.zone()-r.zone());return e&&(e=e.replace(/s$/,"")),"year"===e||"month"===e?(n=432e5*(this.daysInMonth()+r.daysInMonth()),o=12*(this.year()-r.year())+(this.month()-r.month()),o+=(this-O(this).startOf("month")-(r-O(r).startOf("month")))/n,"year"===e&&(o/=12)):(n=this-r-s,o="second"===e?n/1e3:"minute"===e?n/6e4:"hour"===e?n/36e5:"day"===e?n/864e5:"week"===e?n/6048e5:n),i?o:a(o)},from:function(t,e){return O.duration(this.diff(t)).lang(this.lang()._abbr).humanize(!e)},fromNow:function(t){return this.from(O(),t)},calendar:function(){var t=this.diff(O().startOf("day"),"days",!0),e=-6>t?"sameElse":-1>t?"lastWeek":0>t?"lastDay":1>t?"sameDay":2>t?"nextDay":7>t?"nextWeek":"sameElse";return this.format(this.lang().calendar(e,this))},isLeapYear:function(){var t=this.year();return 0===t%4&&0!==t%100||0===t%400},isDST:function(){return this.zone()+O(e).startOf(i)},isBefore:function(e,i){return i=i!==t?i:"millisecond",+this.clone().startOf(i)<+O(e).startOf(i)},isSame:function(e,i){return i=i!==t?i:"millisecond",+this.clone().startOf(i)===+O(e).startOf(i)},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},daysInMonth:function(){return O.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(t){var e=I((O(this).startOf("day")-O(this).startOf("year"))/864e5)+1;return null==t?e:this.add("d",t-e)},isoWeek:function(t){var e=_(this,1,4);return null==t?e:this.add("d",7*(t-e))},week:function(t){var e=this.lang().week(this);return null==t?e:this.add("d",7*(t-e))},lang:function(e){return e===t?this._lang:(this._lang=d(e),this)}},N=0;G.length>N;N++)L(G[N].toLowerCase().replace(/s$/,""),G[N]);L("year","FullYear"),O.fn.days=O.fn.day,O.fn.weeks=O.fn.week,O.fn.isoWeeks=O.fn.isoWeek,O.duration.fn=r.prototype={weeks:function(){return a(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+2592e6*this._months},humanize:function(t){var e=+this,i=D(e,!t,this.lang());return t&&(i=this.lang().pastFuture(e,i)),this.lang().postformat(i)},lang:O.fn.lang};for(N in te)te.hasOwnProperty(N)&&(A(N,te[N]),x(N.toLowerCase()));A("Weeks",6048e5),O.lang("en",{ordinal:function(t){var e=t%10,i=1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),H&&(module.exports=O),"undefined"==typeof ender&&(this.moment=O),"function"==typeof define&&define.amd&&define("moment",[],function(){return O})}.call(this),loadCss("/* vis.js stylesheet */\n\n.graph {\n position: relative;\n border: 1px solid #bfbfbf;\n}\n\n.graph .panel {\n position: absolute;\n}\n\n.graph .itemset {\n position: absolute;\n}\n\n\n.graph .item {\n position: absolute;\n color: #1A1A1A;\n border-color: #97B0F8;\n background-color: #D5DDF6;\n display: inline-block;\n}\n\n.graph .item.selected {\n border-color: #FFC200;\n background-color: #FFF785;\n z-index: 999;\n}\n\n.graph .item.cluster {\n /* TODO: use another color or pattern? */\n background: #97B0F8 url('img/cluster_bg.png');\n color: white;\n}\n.graph .item.cluster.point {\n border-color: #D5DDF6;\n}\n\n.graph .item.box {\n text-align: center;\n border-style: solid;\n border-width: 1px;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.point {\n background: none;\n}\n\n.graph .dot {\n border: 5px solid #97B0F8;\n position: absolute;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range {\n overflow: hidden;\n border-style: solid;\n border-width: 1px;\n border-radius: 2px;\n -moz-border-radius: 2px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range .drag-left {\n cursor: w-resize;\n z-index: 1000;\n}\n\n.graph .item.range .drag-right {\n cursor: e-resize;\n z-index: 1000;\n}\n\n.graph .item.range .content {\n position: relative;\n display: inline-block;\n}\n\n.graph .item.line {\n position: absolute;\n width: 0;\n border-left-width: 1px;\n border-left-style: solid;\n z-index: -1;\n}\n\n.graph .item .content {\n margin: 5px;\n white-space: nowrap;\n overflow: hidden;\n}\n\n/* TODO: better css name, 'graph' is way to generic */\n\n.graph {\n overflow: hidden;\n}\n\n.graph .axis {\n position: relative;\n}\n\n.graph .axis .text {\n position: absolute;\n color: #4d4d4d;\n padding: 3px;\n white-space: nowrap;\n}\n\n.graph .axis .text.measure {\n position: absolute;\n padding-left: 0;\n padding-right: 0;\n margin-left: 0;\n margin-right: 0;\n visibility: hidden;\n}\n\n.graph .axis .grid.vertical {\n position: absolute;\n width: 0;\n border-right: 1px solid;\n}\n\n.graph .axis .grid.horizontal {\n position: absolute;\n left: 0;\n width: 100%;\n height: 0;\n border-bottom: 1px solid;\n}\n\n.graph .axis .grid.minor {\n border-color: #e5e5e5;\n}\n\n.graph .axis .grid.major {\n border-color: #bfbfbf;\n}\n\n"); \ No newline at end of file +(function(){function t(t){var e=this;this.options=t||{},this.data={},this.fieldId=this.options.fieldId||"id",this.fieldTypes={},this.options.fieldTypes&&v.forEach(this.options.fieldTypes,function(t,n){e.fieldTypes[n]="Date"==t||"ISODate"==t||"ASPDate"==t?"Date":t}),this.subscribers={},this.internalIds={}}function e(t,e){this.parent=t,this.options={order:function(t,e){return e.width-t.width||t.left-e.left}},this.ordered=[],this.setOptions(e)}function n(t){this.id=v.randomUUID(),this.start=0,this.end=0,this.options={min:null,max:null,zoomMin:null,zoomMax:null},this.setOptions(t),this.listeners=[]}function i(){this.id=v.randomUUID(),this.components={},this.repaintTimer=void 0,this.reflowTimer=void 0}function o(){this.id=null,this.parent=null,this.depends=null,this.controller=null,this.options=null,this.frame=null,this.top=0,this.left=0,this.width=0,this.height=0}function r(t,e,n){this.id=v.randomUUID(),this.parent=t,this.depends=e,this.options={},this.setOptions(n)}function s(t,e){this.id=v.randomUUID(),this.container=t,this.options={autoResize:!0},this.listeners={},this.setOptions(e)}function a(t,e,n){this.id=v.randomUUID(),this.parent=t,this.depends=e,this.dom={majorLines:[],majorTexts:[],minorLines:[],minorTexts:[],redundant:{majorLines:[],majorTexts:[],minorLines:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.options={orientation:"bottom",showMinorLabels:!0,showMajorLabels:!0},this.conversion=null,this.range=null,this.setOptions(n)}function h(t,n,i){this.id=v.randomUUID(),this.parent=t,this.depends=n,this.options={style:"box",align:"center",orientation:"bottom",margin:{axis:20,item:10},padding:5};var o=this;this.data=null,this.range=null,this.listeners={add:function(t,e){o._onAdd(e.items)},update:function(t,e){o._onUpdate(e.items)},remove:function(t,e){o._onRemove(e.items)}},this.items={},this.queue={},this.stack=new e(this),this.conversion=null,this.setOptions(i)}function c(t,e,n){this.parent=t,this.data=e,this.selected=!1,this.visible=!0,this.dom=null,this.options=n}function p(t,e,n){this.props={dot:{left:0,top:0,width:0,height:0},line:{top:0,left:0,width:0,height:0}},c.call(this,t,e,n)}function u(t,e,n){this.props={dot:{top:0,width:0,height:0},content:{height:0,marginLeft:0}},c.call(this,t,e,n)}function l(t,e,n){this.props={content:{left:0,width:0}},c.call(this,t,e,n)}function d(t,e,o){var r=this;if(this.options={orientation:"bottom",zoomMin:10,zoomMax:31536e10,moveable:!0,zoomable:!0},this.controller=new i,!t)throw Error("No container element provided");this.main=new s(t,{autoResize:!1,height:function(){return r.timeaxis.height+r.itemset.height}}),this.controller.add(this.main);var c=moment().hours(0).minutes(0).seconds(0).milliseconds(0);this.range=new n({start:c.clone().add("days",-3).valueOf(),end:c.clone().add("days",4).valueOf()}),this.range.subscribe(this.main,"move","horizontal"),this.range.subscribe(this.main,"zoom","horizontal"),this.range.on("rangechange",function(){r.controller.requestReflow()}),this.range.on("rangechanged",function(){r.controller.requestReflow()}),this.timeaxis=new a(this.main,null,{orientation:this.options.orientation,range:this.range}),this.timeaxis.setRange(this.range),this.controller.add(this.timeaxis),this.itemset=new h(this.main,[this.timeaxis],{orientation:this.options.orientation}),this.itemset.setRange(this.range),e&&this.setData(e),this.controller.add(this.itemset),this.setOptions(o)}var f=function(t){document.getElementsByTagName("script");var e=document.createElement("style");e.type="text/css",e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(e)};if(m===void 0)var m={};if(g===void 0)var g={exports:m};"undefined"!=typeof require&&"undefined"!=typeof define?define(function(){return m}):window.vis=m;var v={};v.isNumber=function(t){return t instanceof Number||"number"==typeof t},v.isString=function(t){return t instanceof String||"string"==typeof t},v.isDate=function(t){if(t instanceof Date)return!0;if(v.isString(t)){var e=y.exec(t);if(e)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},v.isDataTable=function(t){return"undefined"!=typeof google&&google.visualization&&google.visualization.DataTable&&t instanceof google.visualization.DataTable},v.randomUUID=function(){var t=function(){return Math.floor(65536*Math.random()).toString(16)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},v.extend=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},v.cast=function(t,e){if(void 0===t)return void 0;if(null===t)return null;if(!e)return t;if("function"==typeof e)return e(t);switch(e){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return Number(t);case"string":case"String":return t+"";case"Date":if(v.isNumber(t))return new Date(t);if(t instanceof Date)return new Date(t.valueOf());if(v.isString(t)){var n=y.exec(t);return n?new Date(Number(n[1])):moment(t).toDate()}throw Error("Cannot cast object of type "+v.getType(t)+" to type Date");case"ISODate":if(t instanceof Date)return t.toISOString();if(v.isNumber(t)||v.isString(t))return moment(t).toDate().toISOString();throw Error("Cannot cast object of type "+v.getType(t)+" to type ISODate");case"ASPDate":if(t instanceof Date)return"/Date("+t.valueOf()+")/";if(v.isNumber(t)||v.isString(t))return"/Date("+moment(t).valueOf()+")/";throw Error("Cannot cast object of type "+v.getType(t)+" to type ASPDate");default:throw Error("Cannot cast object of type "+v.getType(t)+' to type "'+e+'"')}};var y=/^\/?Date\((\-?\d+)/i;if(v.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":t instanceof Array?"Array":t instanceof Date?"Date":"Object":"number"==e?"Number":"boolean"==e?"Boolean":"string"==e?"String":e},v.getAbsoluteLeft=function(t){for(var e=document.documentElement,n=document.body,i=t.offsetLeft,o=t.offsetParent;null!=o&&o!=n&&o!=e;)i+=o.offsetLeft,i-=o.scrollLeft,o=o.offsetParent;return i},v.getAbsoluteTop=function(t){for(var e=document.documentElement,n=document.body,i=t.offsetTop,o=t.offsetParent;null!=o&&o!=n&&o!=e;)i+=o.offsetTop,i-=o.scrollTop,o=o.offsetParent;return i},v.getPageY=function(t){if("pageY"in t)return t.pageY;var e;e="targetTouches"in t&&t.targetTouches.length?t.targetTouches[0].clientY:t.clientY;var n=document.documentElement,i=document.body;return e+(n&&n.scrollTop||i&&i.scrollTop||0)-(n&&n.clientTop||i&&i.clientTop||0)},v.getPageX=function(t){if("pageY"in t)return t.pageX;var e;e="targetTouches"in t&&t.targetTouches.length?t.targetTouches[0].clientX:t.clientX;var n=document.documentElement,i=document.body;return e+(n&&n.scrollLeft||i&&i.scrollLeft||0)-(n&&n.clientLeft||i&&i.clientLeft||0)},v.addClassName=function(t,e){var n=t.className.split(" ");-1==n.indexOf(e)&&(n.push(e),t.className=n.join(" "))},v.removeClassName=function(t,e){var n=t.className.split(" "),i=n.indexOf(e);-1!=i&&(n.splice(i,1),t.className=n.join(" "))},v.forEach=function(t,e){if(t instanceof Array)t.forEach(e);else for(var n in t)t.hasOwnProperty(n)&&e(t[n],n,t)},v.updateProperty=function(t,e,n){return t[e]!==n?(t[e]=n,!0):!1},v.addEventListener=function(t,e,n,i){t.addEventListener?(void 0===i&&(i=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.addEventListener(e,n,i)):t.attachEvent("on"+e,n)},v.removeEventListener=function(t,e,n,i){t.removeEventListener?(void 0===i&&(i=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,n,i)):t.detachEvent("on"+e,n)},v.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},v.stopPropagation=function(t){t||(t=window.event),t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},v.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},v.option={},v.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},v.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?t+"":e||null},v.option.asSize=function(t,e){return"function"==typeof t&&(t=t()),v.isString(t)?t:v.isNumber(t)?t+"px":e||null},v.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},!Array.prototype.indexOf){Array.prototype.indexOf=function(t){for(var e=0;this.length>e;e++)if(this[e]==t)return e;return-1};try{console.log("Warning: Ancient browser detected. Please update your browser")}catch(S){}}Array.prototype.forEach||(Array.prototype.forEach=function(t,e){for(var n=0,i=this.length;i>n;++n)t.call(e||this,this[n],n,this)}),Array.prototype.map||(Array.prototype.map=function(t,e){var n,i,o;if(null==this)throw new TypeError(" this is null or not defined");var r=Object(this),s=r.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(e&&(n=e),i=Array(s),o=0;s>o;){var a,h;o in r&&(a=r[o],h=t.call(n,a,o,r),i[o]=h),o++}return i}),Array.prototype.filter||(Array.prototype.filter=function(t){"use strict";if(null==this)throw new TypeError;var e=Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var i=[],o=arguments[1],r=0;n>r;r++)if(r in e){var s=e[r];t.call(o,s,r,e)&&i.push(s)}return i}),Object.keys||(Object.keys=function(){var t=Object.prototype.hasOwnProperty,e=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],i=n.length;return function(o){if("object"!=typeof o&&"function"!=typeof o||null===o)throw new TypeError("Object.keys called on non-object");var r=[];for(var s in o)t.call(o,s)&&r.push(s);if(e)for(var a=0;i>a;a++)t.call(o,n[a])&&r.push(n[a]);return r}}()),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),m!==void 0&&(m.util=v);var T={listeners:[],indexOf:function(t){for(var e=this.listeners,n=0,i=this.listeners.length;i>n;n++){var o=e[n];if(o&&o.object==t)return n}return-1},addListener:function(t,e,n){var i=this.indexOf(t),o=this.listeners[i];o||(o={object:t,events:{}},this.listeners.push(o));var r=o.events[e];r||(r=[],o.events[e]=r),-1==r.indexOf(n)&&r.push(n)},removeListener:function(t,e,n){var i=this.indexOf(t),o=this.listeners[i];if(o){var r=o.events[e];r&&(i=r.indexOf(n),-1!=i&&r.splice(i,1),0==r.length&&delete o.events[e]);var s=0,a=o.events;for(var h in a)a.hasOwnProperty(h)&&s++;0==s&&delete this.listeners[i]}},removeAllListeners:function(){this.listeners=[]},trigger:function(t,e,n){var i=this.indexOf(t),o=this.listeners[i];if(o){var r=o.events[e];if(r)for(var s=0,a=r.length;a>s;s++)r[s](n)}}};m!==void 0&&(m.events=T),TimeStep=function(t,e,n){this.current=new Date,this._start=new Date,this._end=new Date,this.autoScale=!0,this.scale=TimeStep.SCALE.DAY,this.step=1,this.setRange(t,e,n)},TimeStep.SCALE={MILLISECOND:1,SECOND:2,MINUTE:3,HOUR:4,DAY:5,WEEKDAY:6,MONTH:7,YEAR:8},TimeStep.prototype.setRange=function(t,e,n){t instanceof Date&&e instanceof Date&&(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(n))},TimeStep.prototype.first=function(){this.current=new Date(this._start.valueOf()),this.roundToMinor()},TimeStep.prototype.roundToMinor=function(){switch(this.scale){case TimeStep.SCALE.YEAR:this.current.setFullYear(this.step*Math.floor(this.current.getFullYear()/this.step)),this.current.setMonth(0);case TimeStep.SCALE.MONTH:this.current.setDate(1);case TimeStep.SCALE.DAY:case TimeStep.SCALE.WEEKDAY:this.current.setHours(0);case TimeStep.SCALE.HOUR:this.current.setMinutes(0);case TimeStep.SCALE.MINUTE:this.current.setSeconds(0);case TimeStep.SCALE.SECOND:this.current.setMilliseconds(0)}if(1!=this.step)switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current.setMilliseconds(this.current.getMilliseconds()-this.current.getMilliseconds()%this.step);break;case TimeStep.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()-this.current.getSeconds()%this.step);break;case TimeStep.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()-this.current.getMinutes()%this.step);break;case TimeStep.SCALE.HOUR:this.current.setHours(this.current.getHours()-this.current.getHours()%this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()-1-(this.current.getDate()-1)%this.step+1);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()-this.current.getMonth()%this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()-this.current.getFullYear()%this.step);break;default:}},TimeStep.prototype.hasNext=function(){return this.current.valueOf()<=this._end.valueOf()},TimeStep.prototype.next=function(){var t=this.current.valueOf();if(6>this.current.getMonth())switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case TimeStep.SCALE.SECOND:this.current=new Date(this.current.valueOf()+1e3*this.step);break;case TimeStep.SCALE.MINUTE:this.current=new Date(this.current.valueOf()+60*1e3*this.step);break;case TimeStep.SCALE.HOUR:this.current=new Date(this.current.valueOf()+60*60*1e3*this.step);var e=this.current.getHours();this.current.setHours(e-e%this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:}else switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case TimeStep.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()+this.step);break;case TimeStep.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()+this.step);break;case TimeStep.SCALE.HOUR:this.current.setHours(this.current.getHours()+this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:}if(1!=this.step)switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current.getMilliseconds()0&&(this.step=e),this.autoScale=!1},TimeStep.prototype.setAutoScale=function(t){this.autoScale=t},TimeStep.prototype.setMinimumStep=function(t){if(void 0!=t){var e=31104e6,n=2592e6,i=864e5,o=36e5,r=6e4,s=1e3,a=1;1e3*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=1e3),500*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=500),100*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=100),50*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=50),10*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=10),5*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=5),e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=1),3*n>t&&(this.scale=TimeStep.SCALE.MONTH,this.step=3),n>t&&(this.scale=TimeStep.SCALE.MONTH,this.step=1),5*i>t&&(this.scale=TimeStep.SCALE.DAY,this.step=5),2*i>t&&(this.scale=TimeStep.SCALE.DAY,this.step=2),i>t&&(this.scale=TimeStep.SCALE.DAY,this.step=1),i/2>t&&(this.scale=TimeStep.SCALE.WEEKDAY,this.step=1),4*o>t&&(this.scale=TimeStep.SCALE.HOUR,this.step=4),o>t&&(this.scale=TimeStep.SCALE.HOUR,this.step=1),15*r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=15),10*r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=10),5*r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=5),r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=1),15*s>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=15),10*s>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=10),5*s>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=5),s>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=1),200*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=200),100*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=100),50*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=50),10*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=10),5*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=5),a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=1)}},TimeStep.prototype.snap=function(t){if(this.scale==TimeStep.SCALE.YEAR){var e=t.getFullYear()+Math.round(t.getMonth()/12);t.setFullYear(Math.round(e/this.step)*this.step),t.setMonth(0),t.setDate(0),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.MONTH)t.getDate()>15?(t.setDate(1),t.setMonth(t.getMonth()+1)):t.setDate(1),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0);else if(this.scale==TimeStep.SCALE.DAY||this.scale==TimeStep.SCALE.WEEKDAY){switch(this.step){case 5:case 2:t.setHours(24*Math.round(t.getHours()/24));break;default:t.setHours(12*Math.round(t.getHours()/12))}t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.HOUR){switch(this.step){case 4:t.setMinutes(60*Math.round(t.getMinutes()/60));break;default:t.setMinutes(30*Math.round(t.getMinutes()/30))}t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.MINUTE){switch(this.step){case 15:case 10:t.setMinutes(5*Math.round(t.getMinutes()/5)),t.setSeconds(0);break;case 5:t.setSeconds(60*Math.round(t.getSeconds()/60));break;default:t.setSeconds(30*Math.round(t.getSeconds()/30))}t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.SECOND)switch(this.step){case 15:case 10:t.setSeconds(5*Math.round(t.getSeconds()/5)),t.setMilliseconds(0);break;case 5:t.setMilliseconds(1e3*Math.round(t.getMilliseconds()/1e3));break;default:t.setMilliseconds(500*Math.round(t.getMilliseconds()/500))}else if(this.scale==TimeStep.SCALE.MILLISECOND){var n=this.step>5?this.step/2:1;t.setMilliseconds(Math.round(t.getMilliseconds()/n)*n)}},TimeStep.prototype.isMajor=function(){switch(this.scale){case TimeStep.SCALE.MILLISECOND:return 0==this.current.getMilliseconds();case TimeStep.SCALE.SECOND:return 0==this.current.getSeconds();case TimeStep.SCALE.MINUTE:return 0==this.current.getHours()&&0==this.current.getMinutes();case TimeStep.SCALE.HOUR:return 0==this.current.getHours();case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:return 1==this.current.getDate();case TimeStep.SCALE.MONTH:return 0==this.current.getMonth();case TimeStep.SCALE.YEAR:return!1;default:return!1}},TimeStep.prototype.getLabelMinor=function(t){switch(void 0==t&&(t=this.current),this.scale){case TimeStep.SCALE.MILLISECOND:return moment(t).format("SSS");case TimeStep.SCALE.SECOND:return moment(t).format("s");case TimeStep.SCALE.MINUTE:return moment(t).format("HH:mm");case TimeStep.SCALE.HOUR:return moment(t).format("HH:mm");case TimeStep.SCALE.WEEKDAY:return moment(t).format("ddd D");case TimeStep.SCALE.DAY:return moment(t).format("D");case TimeStep.SCALE.MONTH:return moment(t).format("MMM");case TimeStep.SCALE.YEAR:return moment(t).format("YYYY");default:return""}},TimeStep.prototype.getLabelMajor=function(t){switch(void 0==t&&(t=this.current),this.scale){case TimeStep.SCALE.MILLISECOND:return moment(t).format("HH:mm:ss");case TimeStep.SCALE.SECOND:return moment(t).format("D MMMM HH:mm");case TimeStep.SCALE.MINUTE:case TimeStep.SCALE.HOUR:return moment(t).format("ddd D MMMM");case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:return moment(t).format("MMMM YYYY");case TimeStep.SCALE.MONTH:return moment(t).format("YYYY");case TimeStep.SCALE.YEAR:return"";default:return""}},m!==void 0&&(m.TimeStep=TimeStep),t.prototype.subscribe=function(t,e,n){var i=this.subscribers[t];i||(i=[],this.subscribers[t]=i),i.push({id:n?n+"":null,callback:e})},t.prototype.unsubscribe=function(t,e){var n=this.subscribers[t];n&&(this.subscribers[t]=n.filter(function(t){return t.callback!=e}))},t.prototype._trigger=function(t,e,n){if("*"==t)throw Error("Cannot trigger event *");var i=[];t in this.subscribers&&(i=i.concat(this.subscribers[t])),"*"in this.subscribers&&(i=i.concat(this.subscribers["*"])),i.forEach(function(i){i.id!=n&&i.callback&&i.callback(t,e,n||null)})},t.prototype.add=function(t,e){var n,i=[],o=this;if(t instanceof Array)t.forEach(function(t){var e=o._addItem(t);i.push(e)});else if(v.isDataTable(t))for(var r=this._getColumnNames(t),s=0,a=t.getNumberOfRows();a>s;s++){var h={};r.forEach(function(e,n){h[e]=t.getValue(s,n)}),n=o._addItem(h),i.push(n)}else{if(!(t instanceof Object))throw Error("Unknown dataType");n=o._addItem(t),i.push(n)}this._trigger("add",{items:i},e)},t.prototype.update=function(t,e){var n,i=[],o=this;if(t instanceof Array)t.forEach(function(t){var e=o._updateItem(t);i.push(e)});else if(v.isDataTable(t))for(var r=this._getColumnNames(t),s=0,a=t.getNumberOfRows();a>s;s++){var h={};r.forEach(function(e,n){h[e]=t.getValue(s,n)}),n=o._updateItem(h),i.push(n)}else{if(!(t instanceof Object))throw Error("Unknown dataType");n=o._updateItem(t),i.push(n)}this._trigger("update",{items:i},e)},t.prototype.get=function(t,e,n){var i=this;"Object"==v.getType(t)&&(n=e,e=t,t=void 0);var o={};this.options&&this.options.fieldTypes&&v.forEach(this.options.fieldTypes,function(t,e){o[e]=t}),e&&e.fieldTypes&&v.forEach(e.fieldTypes,function(t,e){o[e]=t});var r,s=e?e.fields:void 0;if(e&&e.type){if(r="DataTable"==e.type?"DataTable":"Array",n&&r!=v.getType(n))throw Error('Type of parameter "data" ('+v.getType(n)+") "+"does not correspond with specified options.type ("+e.type+")");if("DataTable"==r&&!v.isDataTable(n))throw Error('Parameter "data" must be a DataTable when options.type is "DataTable"')}else r=n?"DataTable"==v.getType(n)?"DataTable":"Array":"Array";if("DataTable"==r){var a=this._getColumnNames(n);if(void 0==t)v.forEach(this.data,function(t){i._appendRow(n,a,i._castItem(t))});else if(v.isNumber(t)||v.isString(t)){var h=i._castItem(i.data[t],o,s);this._appendRow(n,a,h)}else{if(!(t instanceof Array))throw new TypeError('Parameter "ids" must be undefined, a String, Number, or Array');t.forEach(function(t){var e=i._castItem(i.data[t],o,s);i._appendRow(n,a,e)})}}else if(n=n||[],void 0==t)v.forEach(this.data,function(t){n.push(i._castItem(t,o,s))});else{if(v.isNumber(t)||v.isString(t))return this._castItem(i.data[t],o,s);if(!(t instanceof Array))throw new TypeError('Parameter "ids" must be undefined, a String, Number, or Array');t.forEach(function(t){n.push(i._castItem(i.data[t],o,s))})}return n},t.prototype.remove=function(t,e){var n=[],i=this;if(v.isNumber(t)||v.isString(t))delete this.data[t],delete this.internalIds[t],n.push(t);else if(t instanceof Array)t.forEach(function(t){i.remove(t)}),n=n.concat(t);else if(t instanceof Object)for(var o in this.data)this.data.hasOwnProperty(o)&&this.data[o]==t&&(delete this.data[o],delete this.internalIds[o],n.push(o));this._trigger("remove",{items:n},e)},t.prototype.clear=function(t){var e=Object.keys(this.data);this.data={},this.internalIds={},this._trigger("remove",{items:e},t)},t.prototype.max=function(t){var e=this.data,n=Object.keys(e),i=null,o=null;return n.forEach(function(n){var r=e[n],s=r[t];null!=s&&(!i||s>o)&&(i=r,o=s)}),i},t.prototype.min=function(t){var e=this.data,n=Object.keys(e),i=null,o=null;return n.forEach(function(n){var r=e[n],s=r[t];null!=s&&(!i||o>s)&&(i=r,o=s)}),i},t.prototype._addItem=function(t){var e=t[this.fieldId];void 0==e&&(e=v.randomUUID(),t[this.fieldId]=e,this.internalIds[e]=t);var n={};for(var i in t)if(t.hasOwnProperty(i)){var o=this.fieldTypes[i];n[i]=v.cast(t[i],o)}return this.data[e]=n,e},t.prototype._castItem=function(t,e,n){var i,o=this.fieldId,r=this.internalIds;return t?(i={},e=e||{},n?v.forEach(t,function(t,o){-1!=n.indexOf(o)&&(i[o]=v.cast(t,e[o]))}):v.forEach(t,function(t,n){n==o&&t in r||(i[n]=v.cast(t,e[n]))})):i=null,i},t.prototype._updateItem=function(t){var e=t[this.fieldId];if(void 0==e)throw Error("Item has no id (item: "+JSON.stringify(t)+")");var n=this.data[e];if(n){for(var i in t)if(t.hasOwnProperty(i)){var o=this.fieldTypes[i];n[i]=v.cast(t[i],o)}}else this._addItem(t);return e},t.prototype._getColumnNames=function(t){for(var e=[],n=0,i=t.getNumberOfColumns();i>n;n++)e[n]=t.getColumnId(n)||t.getColumnLabel(n);return e},t.prototype._appendRow=function(t,e,n){var i=t.addRow();e.forEach(function(e,o){t.setValue(i,o,n[e])})},m!==void 0&&(m.DataSet=t),e.prototype.setOptions=function(t){v.extend(this.options,t)},e.prototype.update=function(){this._order(),this._stack()},e.prototype._order=function(){var t=this.parent.items;if(!t)throw Error("Cannot stack items: parent does not contain items");var e=[],n=0;v.forEach(t,function(t){e[n]=t,n++});var i=this.options.order;if("function"!=typeof this.options.order)throw Error("Option order must be a function");e.sort(i),this.ordered=e},e.prototype._stack=function(){var t,e,n=this.ordered,i=this.options,o="top"==i.orientation,r=i.margin&&i.margin.item||0;for(t=0,e=n.length;e>t;t++){var s=n[t],a=null;do a=this.checkOverlap(n,t,0,t-1,r),null!=a&&(s.top=o?a.top+a.height+r:a.top-s.height-r);while(a)}},e.prototype.checkOverlap=function(t,e,n,i,o){for(var r=this.collision,s=t[e],a=i;a>=n;a--){var h=t[a];if(r(s,h,o)&&a!=e)return h}return null},e.prototype.collision=function(t,e,n){return t.left-ne.left&&t.top-ne.top},m!==void 0&&(m.Stack=e),n.prototype.setOptions=function(t){v.extend(this.options,t),(null!=t.start||null!=t.end)&&this.setRange(t.start,t.end)},n.prototype.subscribe=function(t,e,n){var i,o=this;if("horizontal"!=n&&"vertical"!=n)throw new TypeError('Unknown direction "'+n+'". '+'Choose "horizontal" or "vertical".');if("move"==e)i={component:t,event:e,direction:n,callback:function(t){o._onMouseDown(t,i)},params:{}},t.on("mousedown",i.callback),o.listeners.push(i);else{if("zoom"!=e)throw new TypeError('Unknown event "'+e+'". '+'Choose "move" or "zoom".');i={component:t,event:e,direction:n,callback:function(t){o._onMouseWheel(t,i)},params:{}},t.on("mousewheel",i.callback),o.listeners.push(i)}},n.prototype.on=function(t,e){T.addListener(this,t,e)},n.prototype._trigger=function(t){T.trigger(this,t,{start:this.start,end:this.end})},n.prototype.setRange=function(t,e){var n=this._applyRange(t,e);n&&(this._trigger("rangechange"),this._trigger("rangechanged"))},n.prototype._applyRange=function(t,e){var n,i=null!=t?v.cast(t,"Number"):this.start,o=null!=e?v.cast(e,"Number"):this.end;if(isNaN(i))throw Error('Invalid start "'+t+'"');if(isNaN(o))throw Error('Invalid end "'+e+'"');if(i>o&&(o=i),null!=this.options.min){var r=this.options.min.valueOf();r>i&&(n=r-i,i+=n,o+=n)}if(null!=this.options.max){var s=this.options.max.valueOf();o>s&&(n=o-s,i-=n,o-=n)}if(null!=this.options.zoomMin){var a=this.options.zoomMin.valueOf();0>a&&(a=0),a>o-i&&(this.end-this.start>a?(n=a-(o-i),i-=n/2,o+=n/2):(i=this.start,o=this.end))}if(null!=this.options.zoomMax){var h=this.options.zoomMax.valueOf();0>h&&(h=0),o-i>h&&(h>this.end-this.start?(n=o-i-h,i+=n/2,o-=n/2):(i=this.start,o=this.end))}var c=this.start!=i||this.end!=o;return this.start=i,this.end=o,c},n.prototype.getRange=function(){return{start:this.start,end:this.end}},n.prototype.conversion=function(t){return this.start,this.end,n.conversion(this.start,this.end,t)},n.conversion=function(t,e,n){return 0!=n&&0!=e-t?{offset:t,factor:n/(e-t)}:{offset:0,factor:1}},n.prototype._onMouseDown=function(t,e){t=t||window.event;var n=e.params,i=t.which?1==t.which:1==t.button;if(i){n.mouseX=v.getPageX(t),n.mouseY=v.getPageY(t),n.previousLeft=0,n.previousOffset=0,n.moved=!1,n.start=this.start,n.end=this.end;var o=e.component.frame;o&&(o.style.cursor="move");var r=this;n.onMouseMove||(n.onMouseMove=function(t){r._onMouseMove(t,e)},v.addEventListener(document,"mousemove",n.onMouseMove)),n.onMouseUp||(n.onMouseUp=function(t){r._onMouseUp(t,e)},v.addEventListener(document,"mouseup",n.onMouseUp)),v.preventDefault(t)}},n.prototype._onMouseMove=function(t,e){t=t||window.event;var n=e.params,i=v.getPageX(t),o=v.getPageY(t);void 0==n.mouseX&&(n.mouseX=i),void 0==n.mouseY&&(n.mouseY=o);var r=i-n.mouseX,s=o-n.mouseY,a="horizontal"==e.direction?r:s;Math.abs(a)>=1&&(n.moved=!0);var h=n.end-n.start,c="horizontal"==e.direction?e.component.width:e.component.height,p=-a/c*h;this._applyRange(n.start+p,n.end+p),this._trigger("rangechange"),v.preventDefault(t)},n.prototype._onMouseUp=function(t,e){t=t||window.event;var n=e.params;e.component.frame&&(e.component.frame.style.cursor="auto"),n.onMouseMove&&(v.removeEventListener(document,"mousemove",n.onMouseMove),n.onMouseMove=null),n.onMouseUp&&(v.removeEventListener(document,"mouseup",n.onMouseUp),n.onMouseUp=null),n.moved&&this._trigger("rangechanged")},n.prototype._onMouseWheel=function(t,e){t=t||window.event;var n=0;if(t.wheelDelta?n=t.wheelDelta/120:t.detail&&(n=-t.detail/3),n){var i=this,o=function(){var o=n/5,r=null,s=e.component.frame;if(s){var a,h;if("horizontal"==e.direction){a=e.component.width,h=i.conversion(a);var c=v.getAbsoluteLeft(s),p=v.getPageX(t);r=(p-c)/h.factor+h.offset}else{a=e.component.height,h=i.conversion(a);var u=v.getAbsoluteTop(s),l=v.getPageY(t);r=(u+a-l-u)/h.factor+h.offset}}i.zoom(o,r)};o()}v.preventDefault(t)},n.prototype.zoom=function(t,e){null==e&&(e=(this.start+this.end)/2),t>=1&&(t=.9),-1>=t&&(t=-.9),0>t&&(t/=1+t);var n=this.start-e,i=this.end-e,o=this.start-n*t,r=this.end-i*t;this.setRange(o,r)},n.prototype.move=function(t){var e=this.end-this.start,n=this.start+e*t,i=this.end+e*t;this.start=n,this.end=i},m!==void 0&&(m.Range=n),i.prototype.add=function(t){if(void 0==t.id)throw Error("Component has no field id");if(!(t instanceof o||t instanceof i))throw new TypeError("Component must be an instance of prototype Component or Controller");t.controller=this,this.components[t.id]=t},i.prototype.requestReflow=function(){if(!this.reflowTimer){var t=this;this.reflowTimer=setTimeout(function(){t.reflowTimer=void 0,t.reflow()},0)}},i.prototype.requestRepaint=function(){if(!this.repaintTimer){var t=this;this.repaintTimer=setTimeout(function(){t.repaintTimer=void 0,t.repaint()},0)}},i.prototype.repaint=function(){function t(i,o){o in n||(i.depends&&i.depends.forEach(function(e){t(e,e.id)}),i.parent&&t(i.parent,i.parent.id),e=i.repaint()||e,n[o]=!0)}var e=!1;this.repaintTimer&&(clearTimeout(this.repaintTimer),this.repaintTimer=void 0);var n={};v.forEach(this.components,t),e&&this.reflow()},i.prototype.reflow=function(){function t(i,o){o in n||(i.depends&&i.depends.forEach(function(e){t(e,e.id)}),i.parent&&t(i.parent,i.parent.id),e=i.reflow()||e,n[o]=!0)}var e=!1;this.reflowTimer&&(clearTimeout(this.reflowTimer),this.reflowTimer=void 0);var n={};v.forEach(this.components,t),e&&this.repaint()},m!==void 0&&(m.Controller=i),o.prototype.setOptions=function(t){t&&v.extend(this.options,t),this.controller&&(this.requestRepaint(),this.requestReflow())},o.prototype.getContainer=function(){return null},o.prototype.getFrame=function(){return this.frame},o.prototype.repaint=function(){return!1},o.prototype.reflow=function(){return!1},o.prototype.requestRepaint=function(){if(!this.controller)throw Error("Cannot request a repaint: no controller configured");this.controller.requestRepaint()},o.prototype.requestReflow=function(){if(!this.controller)throw Error("Cannot request a reflow: no controller configured"); +this.controller.requestReflow()},o.prototype.on=function(t,e){if(!this.parent)throw Error("Cannot attach event: no root panel found");this.parent.on(t,e)},m!==void 0&&("component"in m||(m.component={}),m.component.Component=o),r.prototype=new o,r.prototype.getContainer=function(){return this.frame},r.prototype.repaint=function(){var t=0,e=v.updateProperty,n=v.option.asSize,i=this.options,o=this.frame;if(o||(o=document.createElement("div"),o.className="panel",i.className&&("function"==typeof i.className?v.addClassName(o,i.className()+""):v.addClassName(o,i.className+"")),this.frame=o,t+=1),!o.parentNode){if(!this.parent)throw Error("Cannot repaint panel: no parent attached");var r=this.parent.getContainer();if(!r)throw Error("Cannot repaint panel: parent has no container element");r.appendChild(o),t+=1}return t+=e(o.style,"top",n(i.top,"0px")),t+=e(o.style,"left",n(i.left,"0px")),t+=e(o.style,"width",n(i.width,"100%")),t+=e(o.style,"height",n(i.height,"100%")),t>0},r.prototype.reflow=function(){var t=0,e=v.updateProperty,n=this.frame;return n?(t+=e(this,"top",n.offsetTop),t+=e(this,"left",n.offsetLeft),t+=e(this,"width",n.offsetWidth),t+=e(this,"height",n.offsetHeight)):t+=1,t>0},m!==void 0&&("component"in m||(m.component={}),m.component.Panel=r),s.prototype=new r,s.prototype.setOptions=function(t){v.extend(this.options,t),this.options.autoResize?this._watch():this._unwatch()},s.prototype.repaint=function(){var t=0,e=v.updateProperty,n=v.option.asSize,i=this.options,o=this.frame;if(o||(o=document.createElement("div"),o.className="graph panel",i.className&&v.addClassName(o,v.option.asString(i.className)),this.frame=o,t+=1),!o.parentNode){if(!this.container)throw Error("Cannot repaint root panel: no container attached");this.container.appendChild(o),t+=1}return t+=e(o.style,"top",n(i.top,"0px")),t+=e(o.style,"left",n(i.left,"0px")),t+=e(o.style,"width",n(i.width,"100%")),t+=e(o.style,"height",n(i.height,"100%")),this._updateEventEmitters(),t>0},s.prototype.reflow=function(){var t=0,e=v.updateProperty,n=this.frame;return n?(t+=e(this,"top",n.offsetTop),t+=e(this,"left",n.offsetLeft),t+=e(this,"width",n.offsetWidth),t+=e(this,"height",n.offsetHeight)):t+=1,t>0},s.prototype._watch=function(){var t=this;this._unwatch();var e=function(){return t.options.autoResize?(t.frame&&(t.frame.clientWidth!=t.width||t.frame.clientHeight!=t.height)&&t.requestReflow(),void 0):(t._unwatch(),void 0)};v.addEventListener(window,"resize",e),this.watchTimer=setInterval(e,1e3)},s.prototype._unwatch=function(){this.watchTimer&&(clearInterval(this.watchTimer),this.watchTimer=void 0)},s.prototype.on=function(t,e){var n=this.listeners[t];n||(n=[],this.listeners[t]=n),n.push(e),this._updateEventEmitters()},s.prototype._updateEventEmitters=function(){if(this.listeners){var t=this;v.forEach(this.listeners,function(e,n){if(t.emitters||(t.emitters={}),!(n in t.emitters)){var i=t.frame;if(i){var o=function(t){e.forEach(function(e){e(t)})};t.emitters[n]=o,v.addEventListener(i,n,o)}}})}},m!==void 0&&("component"in m||(m.component={}),m.component.RootPanel=s),a.prototype=new o,a.prototype.setOptions=function(t){v.extend(this.options,t)},a.prototype.setRange=function(t){if(!(t instanceof n||t&&t.start&&t.end))throw new TypeError("Range must be an instance of Range, or an object containing start and end.");this.range=t},a.prototype.toTime=function(t){var e=this.conversion;return new Date(t/e.factor+e.offset)},a.prototype.toScreen=function(t){var e=this.conversion;return(t.valueOf()-e.offset)*e.factor},a.prototype.repaint=function(){var t=0,e=v.updateProperty,n=v.option.asSize,i=this.options,o=this.props,r=this.step,s=this.frame;if(s||(s=document.createElement("div"),this.frame=s,t+=1),s.className="axis "+i.orientation,!s.parentNode){if(!this.parent)throw Error("Cannot repaint time axis: no parent attached");var a=this.parent.getContainer();if(!a)throw Error("Cannot repaint time axis: parent has no container element");a.appendChild(s),t+=1}var h=s.parentNode;if(h){var c=s.nextSibling;h.removeChild(s);var p=i.orientation,u="bottom"==p&&this.props.parentHeight&&this.height?this.props.parentHeight-this.height+"px":"0px";if(t+=e(s.style,"top",n(i.top,u)),t+=e(s.style,"left",n(i.left,"0px")),t+=e(s.style,"width",n(i.width,"100%")),t+=e(s.style,"height",n(i.height,this.height+"px")),this._repaintMeasureChars(),this.step){this._repaintStart(),r.first();for(var l=void 0,d=0;r.hasNext()&&1e3>d;){d++;var f=r.getCurrent(),m=this.toScreen(f),g=r.isMajor();i.showMinorLabels&&this._repaintMinorText(m,r.getLabelMinor()),g&&i.showMajorLabels?(m>0&&(void 0==l&&(l=m),this._repaintMajorText(m,r.getLabelMajor())),this._repaintMajorLine(m)):this._repaintMinorLine(m),r.next()}if(i.showMajorLabels){var y=this.toTime(0),S=r.getLabelMajor(y),T=S.length*(o.majorCharWidth||10)+10;(void 0==l||l>T)&&this._repaintMajorText(0,S)}this._repaintEnd()}this._repaintLine(),c?h.insertBefore(s,c):h.appendChild(s)}return t>0},a.prototype._repaintStart=function(){var t=this.dom,e=t.redundant;e.majorLines=t.majorLines,e.majorTexts=t.majorTexts,e.minorLines=t.minorLines,e.minorTexts=t.minorTexts,t.majorLines=[],t.majorTexts=[],t.minorLines=[],t.minorTexts=[]},a.prototype._repaintEnd=function(){v.forEach(this.dom.redundant,function(t){for(;t.length;){var e=t.pop();e&&e.parentNode&&e.parentNode.removeChild(e)}})},a.prototype._repaintMinorText=function(t,e){var n=this.dom.redundant.minorTexts.shift();if(!n){var i=document.createTextNode("");n=document.createElement("div"),n.appendChild(i),n.className="text minor",this.frame.appendChild(n)}this.dom.minorTexts.push(n),n.childNodes[0].nodeValue=e,n.style.left=t+"px",n.style.top=this.props.minorLabelTop+"px"},a.prototype._repaintMajorText=function(t,e){var n=this.dom.redundant.majorTexts.shift();if(!n){var i=document.createTextNode(e);n=document.createElement("div"),n.className="text major",n.appendChild(i),this.frame.appendChild(n)}this.dom.majorTexts.push(n),n.childNodes[0].nodeValue=e,n.style.top=this.props.majorLabelTop+"px",n.style.left=t+"px"},a.prototype._repaintMinorLine=function(t){var e=this.dom.redundant.minorLines.shift();e||(e=document.createElement("div"),e.className="grid vertical minor",this.frame.appendChild(e)),this.dom.minorLines.push(e);var n=this.props;e.style.top=n.minorLineTop+"px",e.style.height=n.minorLineHeight+"px",e.style.left=t-n.minorLineWidth/2+"px"},a.prototype._repaintMajorLine=function(t){var e=this.dom.redundant.majorLines.shift();e||(e=document.createElement("DIV"),e.className="grid vertical major",this.frame.appendChild(e)),this.dom.majorLines.push(e);var n=this.props;e.style.top=n.majorLineTop+"px",e.style.left=t-n.majorLineWidth/2+"px",e.style.height=n.majorLineHeight+"px"},a.prototype._repaintLine=function(){var t=this.dom.line,e=this.frame,n=this.options;n.showMinorLabels||n.showMajorLabels?(t?(e.removeChild(t),e.appendChild(t)):(t=document.createElement("div"),t.className="grid horizontal major",e.appendChild(t),this.dom.line=t),t.style.top=this.props.lineTop+"px"):t&&axis.parentElement&&(e.removeChild(axis.line),delete this.dom.line)},a.prototype._repaintMeasureChars=function(){var t,e=this.dom;if(!e.characterMinor){t=document.createTextNode("0");var n=document.createElement("DIV");n.className="text minor measure",n.appendChild(t),this.frame.appendChild(n),e.measureCharMinor=n}if(!e.characterMajor){t=document.createTextNode("0");var i=document.createElement("DIV");i.className="text major measure",i.appendChild(t),this.frame.appendChild(i),e.measureCharMajor=i}},a.prototype.reflow=function(){var t=0,e=v.updateProperty,n=this.frame,i=this.range;if(!i)throw Error("Cannot repaint time axis: no range configured");if(n){t+=e(this,"top",n.offsetTop),t+=e(this,"left",n.offsetLeft);var o=this.props,r=this.options.showMinorLabels,s=this.options.showMajorLabels,a=this.dom.measureCharMinor,h=this.dom.measureCharMajor;a&&(o.minorCharHeight=a.clientHeight,o.minorCharWidth=a.clientWidth),h&&(o.majorCharHeight=h.clientHeight,o.majorCharWidth=h.clientWidth);var c=n.parentNode?n.parentNode.offsetHeight:0;switch(c!=o.parentHeight&&(o.parentHeight=c,t+=1),this.options.orientation){case"bottom":o.minorLabelHeight=r?o.minorCharHeight:0,o.majorLabelHeight=s?o.majorCharHeight:0,o.minorLabelTop=0,o.majorLabelTop=o.minorLabelTop+o.minorLabelHeight,o.minorLineTop=-this.top,o.minorLineHeight=Math.max(this.top+o.majorLabelHeight,0),o.minorLineWidth=1,o.majorLineTop=-this.top,o.majorLineHeight=Math.max(this.top+o.minorLabelHeight+o.majorLabelHeight,0),o.majorLineWidth=1,o.lineTop=0;break;case"top":o.minorLabelHeight=r?o.minorCharHeight:0,o.majorLabelHeight=s?o.majorCharHeight:0,o.majorLabelTop=0,o.minorLabelTop=o.majorLabelTop+o.majorLabelHeight,o.minorLineTop=o.minorLabelTop,o.minorLineHeight=Math.max(c-o.majorLabelHeight-this.top),o.minorLineWidth=1,o.majorLineTop=0,o.majorLineHeight=Math.max(c-this.top),o.majorLineWidth=1,o.lineTop=o.majorLabelHeight+o.minorLabelHeight;break;default:throw Error('Unkown orientation "'+this.options.orientation+'"')}var p=o.minorLabelHeight+o.majorLabelHeight;t+=e(this,"width",n.offsetWidth),t+=e(this,"height",p),this._updateConversion();var u=v.cast(i.start,"Date"),l=v.cast(i.end,"Date"),d=this.toTime(5*(o.minorCharWidth||10))-this.toTime(0);this.step=new TimeStep(u,l,d),t+=e(o.range,"start",u.valueOf()),t+=e(o.range,"end",l.valueOf()),t+=e(o.range,"minimumStep",d.valueOf())}return t>0},a.prototype._updateConversion=function(){var t=this.range;if(!t)throw Error("No range configured");this.conversion=t.conversion?t.conversion(this.width):n.conversion(t.start,t.end,this.width)},m!==void 0&&("component"in m||(m.component={}),m.component.TimeAxis=a),h.prototype=new r,h.prototype.setOptions=function(t){v.extend(this.options,t),this.stack.setOptions(this.options)},h.prototype.setRange=function(t){if(!(t instanceof n||t&&t.start&&t.end))throw new TypeError("Range must be an instance of Range, or an object containing start and end.");this.range=t},h.prototype.repaint=function(){var t=0,e=v.updateProperty,n=v.option.asSize,i=this.options,o=this.frame;if(o||(o=document.createElement("div"),o.className="itemset",i.className&&v.addClassName(o,v.option.asString(i.className)),this.frame=o,t+=1),!o.parentNode){if(!this.parent)throw Error("Cannot repaint itemset: no parent attached");var r=this.parent.getContainer();if(!r)throw Error("Cannot repaint itemset: parent has no container element");r.appendChild(o),t+=1}t+=e(o.style,"height",n(i.height,this.height+"px")),t+=e(o.style,"top",n(i.top,"0px")),t+=e(o.style,"left",n(i.left,"0px")),t+=e(o.style,"width",n(i.width,"100%")),this._updateConversion();var s=this,a=this.queue,h=this.data,c=this.items,p={fields:["id","start","end","content","type"]};return Object.keys(a).forEach(function(e){var n=a[e],o=n.item;switch(n.action){case"add":case"update":var r=h.get(e,p),u=r.type||r.start&&r.end&&"range"||"box",l=w[u];if(o&&(l&&o instanceof l?(o.data=r,t+=o.repaint()):(o.visible=!1,t+=o.repaint(),o=null)),!o){if(!l)throw new TypeError('Unknown item type "'+u+'"');o=new l(s,r,i),t+=o.repaint()}c[e]=o,delete a[e];break;case"remove":o&&(o.visible=!1,t+=o.repaint()),delete c[e],delete a[e];break;default:console.log('Error: unknown action "'+n.action+'"')}}),v.forEach(this.items,function(t){t.reposition()}),t>0},h.prototype.reflow=function(){var t=0,e=this.options,n=v.updateProperty,i=this.frame;if(i){if(this._updateConversion(),v.forEach(this.items,function(e){t+=e.reflow()}),this.stack.update(),null!=e.height)t+=n(this,"height",i.offsetHeight);else{var o=this.height,r=0;"top"==e.orientation?v.forEach(this.items,function(t){r=Math.max(r,t.top+t.height)}):v.forEach(this.items,function(t){r=Math.max(r,o-t.top)}),t+=n(this,"height",r+e.margin.axis)}t+=n(this,"top",i.offsetTop),t+=n(this,"left",i.offsetLeft),t+=n(this,"width",i.offsetWidth)}else t+=1;return t>0},h.prototype.setData=function(e){var n=this.data;n&&v.forEach(this.listeners,function(t,e){n.unsubscribe(e,t)}),e instanceof t?this.data=e:(this.data=new t({fieldTypes:{start:"Date",end:"Date"}}),this.data.add(e));var i=this.id,o=this;v.forEach(this.listeners,function(t,e){o.data.subscribe(e,t,i)});var r=this.data.get({filter:["id"]}),s=[];v.forEach(r,function(t,e){s[e]=t.id}),this._onAdd(s)},h.prototype.getDataRange=function(){var t=this.data,e=t.min("start");e=e?e.start.valueOf():null;var n=t.max("start"),i=t.max("end");n=n?n.start.valueOf():null,i=i?i.end.valueOf():null;var o=Math.max(n,i);return{min:new Date(e),max:new Date(o)}},h.prototype._onUpdate=function(t){this._toQueue(t,"update")},h.prototype._onAdd=function(t){this._toQueue(t,"add")},h.prototype._onRemove=function(t){this._toQueue(t,"remove")},h.prototype._toQueue=function(t,e){var n=this.items,i=this.queue;t.forEach(function(t){var o=i[t];o?o.action=e:i[t]={item:n[t]||null,action:e}}),this.controller&&this.requestRepaint()},h.prototype._updateConversion=function(){var t=this.range;if(!t)throw Error("No range configured");this.conversion=t.conversion?t.conversion(this.width):n.conversion(t.start,t.end,this.width)},h.prototype.toTime=function(t){var e=this.conversion;return new Date(t/e.factor+e.offset)},h.prototype.toScreen=function(t){var e=this.conversion;return(t.valueOf()-e.offset)*e.factor},m!==void 0&&("component"in m||(m.component={}),m.component.ItemSet=h),c.prototype=new o,c.prototype.select=function(){this.selected=!0},c.prototype.unselect=function(){this.selected=!1};var w={};m!==void 0&&("component"in m||(m.component={}),"item"in m.component||(m.component.item={}),m.component.item.Item=c),p.prototype=new c(null,null),w.box=p,p.prototype.select=function(){this.selected=!0},p.prototype.unselect=function(){this.selected=!1},p.prototype.repaint=function(){var t=!1,e=this.dom;if(this.visible){if(e||(this._create(),t=!0),e=this.dom){if(!this.options&&!this.parent)throw Error("Cannot repaint item: no parent attached");var n=this.parent.getContainer();if(!n)throw Error("Cannot repaint time axis: parent has no container element");if(e.box.parentNode||(n.appendChild(e.box),t=!0),e.line.parentNode||(n.appendChild(e.line),t=!0),e.dot.parentNode||(n.appendChild(e.dot),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var i=(this.data.className?" "+this.data.className:"")+(this.selected?" selected":"");this.className!=i&&(this.className=i,e.box.className="item box"+i,e.line.className="item line"+i,e.dot.className="item dot"+i,t=!0)}}else e&&(e.box.parentNode&&(e.box.parentNode.removeChild(e.box),t=!0),e.line.parentNode&&(e.line.parentNode.removeChild(e.line),t=!0),e.dot.parentNode&&(e.dot.parentNode.removeChild(e.dot),t=!0));return t},p.prototype.reflow=function(){if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);var t,e,n=v.updateProperty,i=this.dom,o=this.props,r=this.options,s=this.parent.toScreen(this.data.start),a=r&&r.align,h=r.orientation,c=0;if(i)if(c+=n(o.dot,"height",i.dot.offsetHeight),c+=n(o.dot,"width",i.dot.offsetWidth),c+=n(o.line,"width",i.line.offsetWidth),c+=n(o.line,"width",i.line.offsetWidth),c+=n(this,"width",i.box.offsetWidth),c+=n(this,"height",i.box.offsetHeight),e="right"==a?s-this.width:"left"==a?s:s-this.width/2,c+=n(this,"left",e),c+=n(o.line,"left",s-o.line.width/2),c+=n(o.dot,"left",s-o.dot.width/2),"top"==h)t=r.margin.axis,c+=n(this,"top",t),c+=n(o.line,"top",0),c+=n(o.line,"height",t),c+=n(o.dot,"top",-o.dot.height/2);else{var p=this.parent.height;t=p-this.height-r.margin.axis,c+=n(this,"top",t),c+=n(o.line,"top",t+this.height),c+=n(o.line,"height",Math.max(r.margin.axis,0)),c+=n(o.dot,"top",p-o.dot.height/2)}else c+=1;return c>0},p.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.box=document.createElement("DIV"),t.content=document.createElement("DIV"),t.content.className="content",t.box.appendChild(t.content),t.line=document.createElement("DIV"),t.line.className="line",t.dot=document.createElement("DIV"),t.dot.className="dot")},p.prototype.reposition=function(){var t=this.dom,e=this.props,n=this.options.orientation;if(t){var i=t.box,o=t.line,r=t.dot;i.style.left=this.left+"px",i.style.top=this.top+"px",o.style.left=e.line.left+"px","top"==n?(o.style.top="0px",o.style.height=this.top+"px"):(o.style.top=e.line.top+"px",o.style.top=this.top+this.height+"px",o.style.height=Math.max(e.dot.top-this.top-this.height,0)+"px"),r.style.left=e.dot.left+"px",r.style.top=e.dot.top+"px"}},m!==void 0&&("component"in m||(m.component={}),"item"in m.component||(m.component.item={}),m.component.item.ItemBox=p),u.prototype=new c(null,null),w.point=u,u.prototype.select=function(){this.selected=!0},u.prototype.unselect=function(){this.selected=!1},u.prototype.repaint=function(){var t=!1,e=this.dom;if(this.visible){if(e||(this._create(),t=!0),e=this.dom){if(!this.options&&!this.options.parent)throw Error("Cannot repaint item: no parent attached");var n=this.parent.getContainer();if(!n)throw Error("Cannot repaint time axis: parent has no container element");if(e.point.parentNode||(n.appendChild(e.point),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var i=(this.data.className?" "+this.data.className:"")+(this.selected?" selected":"");this.className!=i&&(this.className=i,e.point.className="item point"+i,t=!0)}}else e&&e.point.parentNode&&(e.point.parentNode.removeChild(e.point),t=!0);return t},u.prototype.reflow=function(){if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);var t,e=v.updateProperty,n=this.dom,i=this.props,o=this.options,r=o.orientation,s=this.parent.toScreen(this.data.start),a=0;if(n){if(a+=e(this,"width",n.point.offsetWidth),a+=e(this,"height",n.point.offsetHeight),a+=e(i.dot,"width",n.dot.offsetWidth),a+=e(i.dot,"height",n.dot.offsetHeight),a+=e(i.content,"height",n.content.offsetHeight),"top"==r)t=o.margin.axis;else{var h=this.parent.height;t=Math.max(h-this.height-o.margin.axis,0)}a+=e(this,"top",t),a+=e(this,"left",s-i.dot.width/2),a+=e(i.content,"marginLeft",1.5*i.dot.width),a+=e(i.dot,"top",(this.height-i.dot.height)/2)}else a+=1;return a>0},u.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.point=document.createElement("div"),t.content=document.createElement("div"),t.content.className="content",t.point.appendChild(t.content),t.dot=document.createElement("div"),t.dot.className="dot",t.point.appendChild(t.dot))},u.prototype.reposition=function(){var t=this.dom,e=this.props;t&&(t.point.style.top=this.top+"px",t.point.style.left=this.left+"px",t.content.style.marginLeft=e.content.marginLeft+"px",t.dot.style.top=e.dot.top+"px")},m!==void 0&&("component"in m||(m.component={}),"item"in m.component||(m.component.item={}),m.component.item.ItemPoint=u),l.prototype=new c(null,null),w.range=l,l.prototype.select=function(){this.selected=!0},l.prototype.unselect=function(){this.selected=!1},l.prototype.repaint=function(){var t=!1,e=this.dom;if(this.visible){if(e||(this._create(),t=!0),e=this.dom){if(!this.options&&!this.options.parent)throw Error("Cannot repaint item: no parent attached");var n=this.parent.getContainer();if(!n)throw Error("Cannot repaint time axis: parent has no container element");if(e.box.parentNode||(n.appendChild(e.box),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var i=this.data.className?""+this.data.className:"";this.className!=i&&(this.className=i,e.box.className="item range"+i,t=!0)}}else e&&e.box.parentNode&&(e.box.parentNode.removeChild(e.box),t=!0);return t},l.prototype.reflow=function(){if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);if(void 0==this.data.end)throw Error('Property "end" missing in item '+this.data.id);var t=this.dom,e=this.props,n=this.options,i=this.parent,o=i.toScreen(this.data.start),r=i.toScreen(this.data.end),s=0;if(t){var a,h,c=v.updateProperty,p=t.box,u=i.width,l=n.orientation;s+=c(e.content,"width",t.content.offsetWidth),s+=c(this,"height",p.offsetHeight),-u>o&&(o=-u),r>2*u&&(r=2*u),a=0>o?Math.min(-o,r-o-e.content.width-2*n.padding):0,s+=c(e.content,"left",a),"top"==l?(h=n.margin.axis,s+=c(this,"top",h)):(h=i.height-this.height-n.margin.axis,s+=c(this,"top",h)),s+=c(this,"left",o),s+=c(this,"width",Math.max(r-o,1))}else s+=1;return s>0},l.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.box=document.createElement("div"),t.content=document.createElement("div"),t.content.className="content",t.box.appendChild(t.content))},l.prototype.reposition=function(){var t=this.dom,e=this.props;t&&(t.box.style.top=this.top+"px",t.box.style.left=this.left+"px",t.box.style.width=this.width+"px",t.content.style.left=e.content.left+"px")},m!==void 0&&("component"in m||(m.component={}),"item"in m.component||(m.component.item={}),m.component.item.ItemRange=l),d.prototype.setOptions=function(t){v.extend(this.options,t),this.timeaxis.setOptions(this.options),this.range.setOptions(this.options);var e,n=this;e="top"==this.options.orientation?function(){return n.timeaxis.height}:function(){return n.main.height-n.timeaxis.height-n.itemset.height},this.itemset.setOptions({orientation:this.options.orientation,top:e}),this.controller.repaint()},d.prototype.setData=function(t){var e=this.itemset.data;if(e)this.itemset.setData(t);else{this.itemset.setData(t);var n=this.itemset.getDataRange(),i=n.min,o=n.max;if(null!=i&&null!=o){var r=o.valueOf()-i.valueOf();i=new Date(i.valueOf()-.05*r),o=new Date(o.valueOf()+.05*r)}(null!=i||null!=o)&&this.range.setRange(i,o)}},m!==void 0&&(m.Timeline=d),function(t){function e(t,e){return function(n){return h(t.call(this,n),e)}}function n(t){return function(e){return this.lang().ordinal(t.call(this,e))}}function i(){}function o(t){s(this,t)}function r(t){var e=this._data={},n=t.years||t.year||t.y||0,i=t.months||t.month||t.M||0,o=t.weeks||t.week||t.w||0,r=t.days||t.day||t.d||0,s=t.hours||t.hour||t.h||0,h=t.minutes||t.minute||t.m||0,c=t.seconds||t.second||t.s||0,p=t.milliseconds||t.millisecond||t.ms||0;this._milliseconds=p+1e3*c+6e4*h+36e5*s,this._days=r+7*o,this._months=i+12*n,e.milliseconds=p%1e3,c+=a(p/1e3),e.seconds=c%60,h+=a(c/60),e.minutes=h%60,s+=a(h/60),e.hours=s%24,r+=a(s/24),r+=7*o,e.days=r%30,i+=a(r/30),e.months=i%12,n+=a(i/12),e.years=n}function s(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function a(t){return 0>t?Math.ceil(t):Math.floor(t)}function h(t,e){for(var n=t+"";e>n.length;)n="0"+n;return n}function c(t,e,n){var i,o=e._milliseconds,r=e._days,s=e._months;o&&t._d.setTime(+t+o*n),r&&t.date(t.date()+r*n),s&&(i=t.date(),t.date(1).month(t.month()+s*n).date(Math.min(i,t.daysInMonth())))}function p(t){return"[object Array]"===Object.prototype.toString.call(t)}function u(t,e){var n,i=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),r=0;for(n=0;i>n;n++)~~t[n]!==~~e[n]&&r++;return r+o}function l(t,e){return e.abbr=t,I[t]||(I[t]=new i),I[t].set(e),I[t]}function d(t){return t?(!I[t]&&j&&require("./lang/"+t),I[t]):N.fn._lang}function f(t){return t.match(/\[.*\]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function m(t){var e,n,i=t.match(U);for(e=0,n=i.length;n>e;e++)i[e]=re[i[e]]?re[i[e]]:f(i[e]);return function(o){var r="";for(e=0;n>e;e++)r+="function"==typeof i[e].call?i[e].call(o,t):i[e];return r}}function v(t,e){function n(e){return t.lang().longDateFormat(e)||e}for(var i=5;i--&&z.test(e);)e=e.replace(z,n);return ne[e]||(ne[e]=m(e)),ne[e](t)}function y(t){switch(t){case"DDDD":return W;case"YYYY":return V;case"YYYYY":return q;case"S":case"SS":case"SSS":case"DDD":return F;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":case"a":case"A":return Z;case"X":return K;case"Z":case"ZZ":return B;case"T":return X;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return P;default:return RegExp(t.replace("\\",""))}}function S(t,e,n){var i,o=n._a;switch(t){case"M":case"MM":o[1]=null==e?0:~~e-1;break;case"MMM":case"MMMM":i=d(n._l).monthsParse(e),null!=i?o[1]=i:n._isValid=!1;break;case"D":case"DD":case"DDD":case"DDDD":null!=e&&(o[2]=~~e);break;case"YY":o[0]=~~e+(~~e>68?1900:2e3);break;case"YYYY":case"YYYYY":o[0]=~~e;break;case"a":case"A":n._isPm="pm"===(e+"").toLowerCase();break;case"H":case"HH":case"h":case"hh":o[3]=~~e;break;case"m":case"mm":o[4]=~~e;break;case"s":case"ss":o[5]=~~e;break;case"S":case"SS":case"SSS":o[6]=~~(1e3*("0."+e));break;case"X":n._d=new Date(1e3*parseFloat(e));break;case"Z":case"ZZ":n._useUTC=!0,i=(e+"").match(G),i&&i[1]&&(n._tzh=~~i[1]),i&&i[2]&&(n._tzm=~~i[2]),i&&"+"===i[0]&&(n._tzh=-n._tzh,n._tzm=-n._tzm)}null==e&&(n._isValid=!1)}function T(t){var e,n,i=[];if(!t._d){for(e=0;7>e;e++)t._a[e]=i[e]=null==t._a[e]?2===e?1:0:t._a[e];i[3]+=t._tzh||0,i[4]+=t._tzm||0,n=new Date(0),t._useUTC?(n.setUTCFullYear(i[0],i[1],i[2]),n.setUTCHours(i[3],i[4],i[5],i[6])):(n.setFullYear(i[0],i[1],i[2]),n.setHours(i[3],i[4],i[5],i[6])),t._d=n}}function w(t){var e,n,i=t._f.match(U),o=t._i;for(t._a=[],e=0;i.length>e;e++)n=(y(i[e]).exec(o)||[])[0],n&&(o=o.slice(o.indexOf(n)+n.length)),re[i[e]]&&S(i[e],n,t);t._isPm&&12>t._a[3]&&(t._a[3]+=12),t._isPm===!1&&12===t._a[3]&&(t._a[3]=0),T(t)}function E(t){for(var e,n,i,r,a=99;t._f.length;){if(e=s({},t),e._f=t._f.pop(),w(e),n=new o(e),n.isValid()){i=n;break}r=u(e._a,n.toArray()),a>r&&(a=r,i=n)}s(t,i)}function b(t){var e,n=t._i;if(J.exec(n)){for(t._f="YYYY-MM-DDT",e=0;4>e;e++)if(Q[e][1].exec(n)){t._f+=Q[e][0];break}B.exec(n)&&(t._f+=" Z"),w(t)}else t._d=new Date(n)}function M(e){var n=e._i,i=R.exec(n);n===t?e._d=new Date:i?e._d=new Date(+i[1]):"string"==typeof n?b(e):p(n)?(e._a=n.slice(0),T(e)):e._d=n instanceof Date?new Date(+n):new Date(n)}function _(t,e,n,i,o){return o.relativeTime(e||1,!!n,t,i)}function D(t,e,n){var i=k(Math.abs(t)/1e3),o=k(i/60),r=k(o/60),s=k(r/24),a=k(s/365),h=45>i&&["s",i]||1===o&&["m"]||45>o&&["mm",o]||1===r&&["h"]||22>r&&["hh",r]||1===s&&["d"]||25>=s&&["dd",s]||45>=s&&["M"]||345>s&&["MM",k(s/30)]||1===a&&["y"]||["yy",a];return h[2]=e,h[3]=t>0,h[4]=n,_.apply({},h)}function L(t,e,n){var i=n-e,o=n-t.day();return o>i&&(o-=7),i-7>o&&(o+=7),Math.ceil(N(t).add("d",o).dayOfYear()/7)}function C(t){var e=t._i,n=t._f;return null===e||""===e?null:("string"==typeof e&&(t._i=e=d().preparse(e)),N.isMoment(e)?(t=s({},e),t._d=new Date(+e._d)):n?p(n)?E(t):w(t):M(t),new o(t))}function x(t,e){N.fn[t]=N.fn[t+"s"]=function(t){var n=this._isUTC?"UTC":"";return null!=t?(this._d["set"+n+e](t),this):this._d["get"+n+e]()}}function A(t){N.duration.fn[t]=function(){return this._data[t]}}function O(t,e){N.duration.fn["as"+t]=function(){return+this/e}}for(var N,Y,H="2.0.0",k=Math.round,I={},j=g!==t&&g.exports,R=/^\/?Date\((\-?\d+)/i,U=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,z=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,P=/\d\d?/,F=/\d{1,3}/,W=/\d{3}/,V=/\d{1,4}/,q=/[+\-]?\d{1,6}/,Z=/[0-9]*[a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF]+\s*?[\u0600-\u06FF]+/i,B=/Z|[\+\-]\d\d:?\d\d/i,X=/T/i,K=/[\+\-]?\d+(\.\d{1,3})?/,J=/^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,$="YYYY-MM-DDTHH:mm:ssZ",Q=[["HH:mm:ss.S",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],G=/([\+\-]|\d\d)/gi,te="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"),ee={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},ne={},ie="DDD w W M D d".split(" "),oe="M D H h m s w W".split(" "),re={M:function(){return this.month()+1},MMM:function(t){return this.lang().monthsShort(this,t)},MMMM:function(t){return this.lang().months(this,t)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(t){return this.lang().weekdaysMin(this,t)},ddd:function(t){return this.lang().weekdaysShort(this,t)},dddd:function(t){return this.lang().weekdays(this,t)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return h(this.year()%100,2)},YYYY:function(){return h(this.year(),4)},YYYYY:function(){return h(this.year(),5)},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().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~~(this.milliseconds()/100)},SS:function(){return h(~~(this.milliseconds()/10),2)},SSS:function(){return h(this.milliseconds(),3)},Z:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+h(~~(t/60),2)+":"+h(~~t%60,2)},ZZ:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+h(~~(10*t/6),4)},X:function(){return this.unix()}};ie.length;)Y=ie.pop(),re[Y+"o"]=n(re[Y]);for(;oe.length;)Y=oe.pop(),re[Y+Y]=e(re[Y],2);for(re.DDDD=e(re.DDD,3),i.prototype={set:function(t){var e,n;for(n in t)e=t[n],"function"==typeof e?this[n]=e:this["_"+n]=e},_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){var e,n,i;for(this._monthsParse||(this._monthsParse=[]),e=0;12>e;e++)if(this._monthsParse[e]||(n=N([2e3,e]),i="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[e]=RegExp(i.replace(".",""),"i")),this._monthsParse[e].test(t))return e},_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()]},_longDateFormat:{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},meridiem:function(t,e,n){return t>11?n?"pm":"PM":n?"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){var n=this._calendar[t];return"function"==typeof n?n.apply(e):n},_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,n,i){var o=this._relativeTime[n];return"function"==typeof o?o(t,e,n,i):o.replace(/%d/i,t)},pastFuture:function(t,e){var n=this._relativeTime[t>0?"future":"past"];return"function"==typeof n?n(e):n.replace(/%s/i,e)},ordinal:function(t){return this._ordinal.replace("%d",t)},_ordinal:"%d",preparse:function(t){return t},postformat:function(t){return t},week:function(t){return L(t,this._week.dow,this._week.doy)},_week:{dow:0,doy:6}},N=function(t,e,n){return C({_i:t,_f:e,_l:n,_isUTC:!1})},N.utc=function(t,e,n){return C({_useUTC:!0,_isUTC:!0,_l:n,_i:t,_f:e})},N.unix=function(t){return N(1e3*t)},N.duration=function(t,e){var n,i=N.isDuration(t),o="number"==typeof t,s=i?t._data:o?{}:t; +return o&&(e?s[e]=t:s.milliseconds=t),n=new r(s),i&&t.hasOwnProperty("_lang")&&(n._lang=t._lang),n},N.version=H,N.defaultFormat=$,N.lang=function(e,n){return e?(n?l(e,n):I[e]||d(e),N.duration.fn._lang=N.fn._lang=d(e),t):N.fn._lang._abbr},N.langData=function(t){return t&&t._lang&&t._lang._abbr&&(t=t._lang._abbr),d(t)},N.isMoment=function(t){return t instanceof o},N.isDuration=function(t){return t instanceof r},N.fn=o.prototype={clone:function(){return N(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._d},toJSON:function(){return N.utc(this).format("YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var t=this;return[t.year(),t.month(),t.date(),t.hours(),t.minutes(),t.seconds(),t.milliseconds()]},isValid:function(){return null==this._isValid&&(this._isValid=this._a?!u(this._a,(this._isUTC?N.utc(this._a):N(this._a)).toArray()):!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(t){var e=v(this,t||N.defaultFormat);return this.lang().postformat(e)},add:function(t,e){var n;return n="string"==typeof t?N.duration(+e,t):N.duration(t,e),c(this,n,1),this},subtract:function(t,e){var n;return n="string"==typeof t?N.duration(+e,t):N.duration(t,e),c(this,n,-1),this},diff:function(t,e,n){var i,o,r=this._isUTC?N(t).utc():N(t).local(),s=6e4*(this.zone()-r.zone());return e&&(e=e.replace(/s$/,"")),"year"===e||"month"===e?(i=432e5*(this.daysInMonth()+r.daysInMonth()),o=12*(this.year()-r.year())+(this.month()-r.month()),o+=(this-N(this).startOf("month")-(r-N(r).startOf("month")))/i,"year"===e&&(o/=12)):(i=this-r-s,o="second"===e?i/1e3:"minute"===e?i/6e4:"hour"===e?i/36e5:"day"===e?i/864e5:"week"===e?i/6048e5:i),n?o:a(o)},from:function(t,e){return N.duration(this.diff(t)).lang(this.lang()._abbr).humanize(!e)},fromNow:function(t){return this.from(N(),t)},calendar:function(){var t=this.diff(N().startOf("day"),"days",!0),e=-6>t?"sameElse":-1>t?"lastWeek":0>t?"lastDay":1>t?"sameDay":2>t?"nextDay":7>t?"nextWeek":"sameElse";return this.format(this.lang().calendar(e,this))},isLeapYear:function(){var t=this.year();return 0===t%4&&0!==t%100||0===t%400},isDST:function(){return this.zone()+N(e).startOf(n)},isBefore:function(e,n){return n=n!==t?n:"millisecond",+this.clone().startOf(n)<+N(e).startOf(n)},isSame:function(e,n){return n=n!==t?n:"millisecond",+this.clone().startOf(n)===+N(e).startOf(n)},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},daysInMonth:function(){return N.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(t){var e=k((N(this).startOf("day")-N(this).startOf("year"))/864e5)+1;return null==t?e:this.add("d",t-e)},isoWeek:function(t){var e=L(this,1,4);return null==t?e:this.add("d",7*(t-e))},week:function(t){var e=this.lang().week(this);return null==t?e:this.add("d",7*(t-e))},lang:function(e){return e===t?this._lang:(this._lang=d(e),this)}},Y=0;te.length>Y;Y++)x(te[Y].toLowerCase().replace(/s$/,""),te[Y]);x("year","FullYear"),N.fn.days=N.fn.day,N.fn.weeks=N.fn.week,N.fn.isoWeeks=N.fn.isoWeek,N.duration.fn=r.prototype={weeks:function(){return a(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+2592e6*this._months},humanize:function(t){var e=+this,n=D(e,!t,this.lang());return t&&(n=this.lang().pastFuture(e,n)),this.lang().postformat(n)},lang:N.fn.lang};for(Y in ee)ee.hasOwnProperty(Y)&&(O(Y,ee[Y]),A(Y.toLowerCase()));O("Weeks",6048e5),N.lang("en",{ordinal:function(t){var e=t%10,n=1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),j&&(g.exports=N),"undefined"==typeof ender&&(this.moment=N),"function"==typeof define&&define.amd&&define("moment",[],function(){return N})}.call(this),f("/* vis.js stylesheet */\n\n.graph {\n position: relative;\n border: 1px solid #bfbfbf;\n}\n\n.graph .panel {\n position: absolute;\n}\n\n.graph .itemset {\n position: absolute;\n}\n\n\n.graph .item {\n position: absolute;\n color: #1A1A1A;\n border-color: #97B0F8;\n background-color: #D5DDF6;\n display: inline-block;\n}\n\n.graph .item.selected {\n border-color: #FFC200;\n background-color: #FFF785;\n z-index: 999;\n}\n\n.graph .item.cluster {\n /* TODO: use another color or pattern? */\n background: #97B0F8 url('img/cluster_bg.png');\n color: white;\n}\n.graph .item.cluster.point {\n border-color: #D5DDF6;\n}\n\n.graph .item.box {\n text-align: center;\n border-style: solid;\n border-width: 1px;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.point {\n background: none;\n}\n\n.graph .dot {\n border: 5px solid #97B0F8;\n position: absolute;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range {\n overflow: hidden;\n border-style: solid;\n border-width: 1px;\n border-radius: 2px;\n -moz-border-radius: 2px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range .drag-left {\n cursor: w-resize;\n z-index: 1000;\n}\n\n.graph .item.range .drag-right {\n cursor: e-resize;\n z-index: 1000;\n}\n\n.graph .item.range .content {\n position: relative;\n display: inline-block;\n}\n\n.graph .item.line {\n position: absolute;\n width: 0;\n border-left-width: 1px;\n border-left-style: solid;\n z-index: -1;\n}\n\n.graph .item .content {\n margin: 5px;\n white-space: nowrap;\n overflow: hidden;\n}\n\n/* TODO: better css name, 'graph' is way to generic */\n\n.graph {\n overflow: hidden;\n}\n\n.graph .axis {\n position: relative;\n}\n\n.graph .axis .text {\n position: absolute;\n color: #4d4d4d;\n padding: 3px;\n white-space: nowrap;\n}\n\n.graph .axis .text.measure {\n position: absolute;\n padding-left: 0;\n padding-right: 0;\n margin-left: 0;\n margin-right: 0;\n visibility: hidden;\n}\n\n.graph .axis .grid.vertical {\n position: absolute;\n width: 0;\n border-right: 1px solid;\n}\n\n.graph .axis .grid.horizontal {\n position: absolute;\n left: 0;\n width: 100%;\n height: 0;\n border-bottom: 1px solid;\n}\n\n.graph .axis .grid.minor {\n border-color: #e5e5e5;\n}\n\n.graph .axis .grid.major {\n border-color: #bfbfbf;\n}\n\n")})(); \ No newline at end of file